diff --git a/.circleci/config.yml b/.circleci/config.yml index 711e19ff57f..22f05c19a5e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -39,8 +39,8 @@ commands: # a reusable command with parameters command: |- printf '127.0.0.1 petstore.swagger.io ' | sudo tee -a /etc/hosts - # - run: docker pull openapitools/openapi-petstore - # - run: docker run -d -e OPENAPI_BASE_PATH=/v3 -e DISABLE_API_KEY=1 -e DISABLE_OAUTH=1 -p 80:8080 openapitools/openapi-petstore + # - run: docker pull openapijsonschematools/openapi-petstore + # - run: docker run -d -e OPENAPI_BASE_PATH=/v3 -e DISABLE_API_KEY=1 -e DISABLE_OAUTH=1 -p 80:8080 openapijsonschematools/openapi-petstore - run: docker pull swaggerapi/petstore - run: docker run --name petstore.swagger -d -e SWAGGER_HOST=http://petstore.swagger.io -e SWAGGER_BASE_PATH=/v2 -p 80:8080 swaggerapi/petstore - run: docker ps -a diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 416f9199ba2..0c7322028fc 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,12 +1,12 @@ ## Core team -modules/openapi-generator/src/main/java/org/openapitools/codegen/*.java @OpenAPITools/generator-core-team -modules/openapi-generator/src/main/java/org/openapitools/codegen/auth/*.java @OpenAPITools/generator-core-team -modules/openapi-generator/src/main/java/org/openapitools/codegen/config/*.java @OpenAPITools/generator-core-team -modules/openapi-generator/src/main/java/org/openapitools/codegen/examples/*.java @OpenAPITools/generator-core-team -modules/openapi-generator/src/main/java/org/openapitools/codegen/ignore/**/*.java @OpenAPITools/generator-core-team -modules/openapi-generator/src/main/java/org/openapitools/codegen/serializer/*.java @OpenAPITools/generator-core-team -modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/**/*.java @OpenAPITools/generator-core-team -modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/**/*.java @OpenAPITools/generator-core-team +modules/openapi-generator/src/main/java/org/openapijsonschematools/codegen/*.java @OpenAPITools/generator-core-team +modules/openapi-generator/src/main/java/org/openapijsonschematools/codegen/auth/*.java @OpenAPITools/generator-core-team +modules/openapi-generator/src/main/java/org/openapijsonschematools/codegen/config/*.java @OpenAPITools/generator-core-team +modules/openapi-generator/src/main/java/org/openapijsonschematools/codegen/examples/*.java @OpenAPITools/generator-core-team +modules/openapi-generator/src/main/java/org/openapijsonschematools/codegen/ignore/**/*.java @OpenAPITools/generator-core-team +modules/openapi-generator/src/main/java/org/openapijsonschematools/codegen/serializer/*.java @OpenAPITools/generator-core-team +modules/openapi-generator/src/main/java/org/openapijsonschematools/codegen/templating/**/*.java @OpenAPITools/generator-core-team +modules/openapi-generator/src/main/java/org/openapijsonschematools/codegen/utils/**/*.java @OpenAPITools/generator-core-team modules/openapi-generator-core/**/* @OpenAPITools/generator-core-team # No need for auto-generated subdirectories (reduces noise) @@ -29,7 +29,7 @@ modules/openapi-generator-gradle-plugin/**/* @jimschubert modules/openapi-generator-maven-plugin/**/* @jimschubert # Martin Delille -/Users/martin/dev/clone/openapi-generator/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQtClientCodegen.java @martindelille -/Users/martin/dev/clone/openapi-generator/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQtAbstractCodegen.java @martindelille +/Users/martin/dev/clone/openapi-generator/modules/openapi-generator/src/main/java/org/openapijsonschematools/codegen/languages/CppQtClientCodegen.java @martindelille +/Users/martin/dev/clone/openapi-generator/modules/openapi-generator/src/main/java/org/openapijsonschematools/codegen/languages/CppQtAbstractCodegen.java @martindelille /Users/martin/dev/clone/openapi-generator/modules/openapi-generator/src/main/resources/cpp-qt-client @martindelille /Users/martin/dev/clone/openapi-generator/samples/client/petstore/cpp-qt @martindelille diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 5c7bdfdce01..b15dfa48107 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -37,7 +37,7 @@ link it here. ##### Related issues/PRs - + ##### Suggest a fix/enhancement diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 9a5ab2f6d90..c802fbdb8d0 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -59,7 +59,7 @@ link it here. ##### Related issues/PRs - + ##### Suggest a fix diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index cf673ad47c0..b811df27a89 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -3,7 +3,7 @@ ### PR checklist -- [ ] Read the [contribution guidelines](https://github.com/openapitools/openapi-json-schema-generator/blob/master/CONTRIBUTING.md). +- [ ] Read the [contribution guidelines](https://github.com/openapi-json-schema-tools/openapi-json-schema-generator/blob/master/CONTRIBUTING.md). - [ ] 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](https://github.com/OpenAPITools/openapi-json-schema-generator#14---build-projects) and update samples: ``` diff --git a/.github/workflows/openapi-generator.yaml b/.github/workflows/openapi-generator.yaml index e7053340e0a..bb4a6afb8a1 100644 --- a/.github/workflows/openapi-generator.yaml +++ b/.github/workflows/openapi-generator.yaml @@ -30,7 +30,7 @@ jobs: ~/.m2/repository ~/.gradle !~/.gradle/caches/*/plugin-resolution/ - !~/.m2/repository/org/openapitools/ + !~/.m2/repository/org/openapijsonschematools/ key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} restore-keys: | ${{ runner.os }}-build-${{ env.cache-name }}- @@ -66,7 +66,7 @@ jobs: ~/.m2/repository ~/.gradle !~/.gradle/caches/*/plugin-resolution/ - !~/.m2/repository/org/openapitools/ + !~/.m2/repository/org/openapijsonschematools/ key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} restore-keys: | ${{ runner.os }}-build-${{ env.cache-name }}- @@ -175,7 +175,7 @@ jobs: ~/.m2/repository ~/.gradle !~/.gradle/caches/*/plugin-resolution/ - !~/.m2/repository/org/openapitools/ + !~/.m2/repository/org/openapijsonschematools/ key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} restore-keys: | ${{ runner.os }}-test-maven-plugin-${{ env.cache-name }}- @@ -209,7 +209,7 @@ jobs: ~/.gradle !~/.gradle/caches/modules-2/modules-2.lock !~/.gradle/caches/*/plugin-resolution/ - !~/.m2/repository/org/openapitools/ + !~/.m2/repository/org/openapijsonschematools/ key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} restore-keys: | ${{ runner.os }}-test-gradle-plugin-${{ env.cache-name }}- diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index 4df69baebf7..86cd301419e 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -23,4 +23,4 @@ jobs: - name: Jacoco Aggregate run: mvn jacoco:report-aggregate - name: Publish to Sonar - run: mvn -B -q -nsu sonar:sonar -Dsonar.projectKey=OpenAPITools_openapi-generator -Dsonar.organization=openapitools -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=${{ secrets.SONAR_LOGIN }} -Dsonar.branch.name=${GITHUB_REF##*/} + run: mvn -B -q -nsu sonar:sonar -Dsonar.projectKey=OpenAPITools_openapi-generator -Dsonar.organization=openapijsonschematools -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=${{ secrets.SONAR_LOGIN }} -Dsonar.branch.name=${GITHUB_REF##*/} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index aa1007f065b..00000000000 --- a/.travis.yml +++ /dev/null @@ -1,239 +0,0 @@ -sudo: required -language: java -jdk: - - openjdk8 - -# See https://docs.travis-ci.com/user/languages/java/#caching -before_cache: - - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock - - rm -fr $HOME/.gradle/caches/*/plugin-resolution/ - # Avoid caching our built dependencies between runs. - - rm -fr $HOME/.m2/repository/org/openapitools/ - -cache: - yarn: true - directories: - - $HOME/.m2 - - $HOME/.ivy2 - - $HOME/.gradle/caches/ - - $HOME/.gradle/wrapper/ - - $HOME/samples/client/petstore/javascript/node_modules - - $HOME/samples/client/petstore/php/OpenAPIToolsClient-php/vendor - - $HOME/samples/client/petstore/ruby/vendor/bundle - - $HOME/samples/client/petstore/python/.venv/ - - $HOME/samples/server/petstore/rust-server/target - - $HOME/perl5 - - $HOME/.cargo - - $HOME/.pub-cache - - $HOME/samples/server/petstore/cpp-pistache/pistache - - $HOME/.rvm/gems/ruby-2.4.1 - - $HOME/website/node_modules/ - - $HOME/.cache/deno - - $HOME/.phpenv/versions/8.1.4 - -services: - - docker - -# comment out the host table change to use the public petstore server -addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - g++-5 - chrome: stable - hosts: - - petstore.swagger.io - -before_install: - - sudo rm -rf /var/lib/apt/lists/* - - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - - - sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) edge" - - sudo apt-get update - - sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce - - mkdir -vp ~/.docker/cli-plugins/ - - curl --silent -L "https://github.com/docker/buildx/releases/download/v0.3.0/buildx-v0.3.0.linux-amd64" > ~/.docker/cli-plugins/docker-buildx - - chmod a+x ~/.docker/cli-plugins/docker-buildx - # to run petstore server locally via docker - - echo "$DOCKER_HUB_PASSWORD" | docker login --username=$DOCKER_HUB_USERNAME --password-stdin || true - - docker pull swaggerapi/petstore - - docker run -d -e SWAGGER_HOST=http://petstore.swagger.io -e SWAGGER_BASE_PATH=/v2 -p 80:8080 swaggerapi/petstore - - docker ps -a - # comment out crystal installation as the tests will run on circleci or github action instead - # install crystal - #- echo 'deb http://download.opensuse.org/repositories/devel:/languages:/crystal/xUbuntu_16.04/ /' | sudo tee /etc/apt/sources.list.d/devel:languages:crystal.list - #- curl -fsSL https://download.opensuse.org/repositories/devel:languages:crystal/xUbuntu_16.04/Release.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/devel_languages_crystal.gpg > /dev/null - #- sudo apt update - #- sudo apt install crystal - #- crystal --version - - curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.22.0 - - export PATH="$HOME/.yarn/bin:$PATH" - # install rust - - curl https://sh.rustup.rs -sSf | sh -s -- -y -v - # required when sudo: required for the Ruby petstore tests - - gem install bundler - # set python 3.6.3 as default - - source ~/virtualenv/python3.6/bin/activate - # -- skip bash test to shorten build time - # Add bats test framework and cURL for Bash script integration tests - #- sudo add-apt-repository ppa:duggan/bats --yes - #- sudo apt-get update -qq - #- sudo apt-get install -qq bats - #- sudo apt-get install -qq curl - # -- skip bash test end - # install dart - #- sudo apt-get update - #- sudo apt-get install apt-transport-https - #- sudo sh -c 'curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -' - #- sudo sh -c 'curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list' - #- sudo apt-get update - #- sudo apt-get install dart - # switch to php7 - - sudo apt-get install libonig-dev libzip-dev - - git clone https://github.com/php-build/php-build $(phpenv root)/plugins/php-build - - git clone https://github.com/ngyuki/phpenv-composer.git $(phpenv root)/plugins/phpenv-composer - - if [ $(ls -A "$HOME/.phpenv/versions/8.1.4" | wc -l) -eq 0 ]; then - phpenv install 8.1.4; - fi; - - phpenv rehash - - phpenv versions - #- phpenv global 7.2.15 - - phpenv global 8.1.4 - - php -v - # comment out below as installation failed in travis - # Add rebar3 build tool and recent Erlang/OTP for Erlang petstore server tests. - # - Travis CI does not support rebar3 [yet](https://github.com/travis-ci/travis-ci/issues/6506#issuecomment-275189490). - # - Rely on `kerl` for [pre-compiled versions available](https://docs.travis-ci.com/user/languages/erlang#Choosing-OTP-releases-to-test-against). Rely on installation path chosen by [`travis-erlang-builder`](https://github.com/travis-ci/travis-erlang-builder/blob/e6d016b1a91ca7ecac5a5a46395bde917ea13d36/bin/compile#L18). - # - . ~/otp/18.2.1/activate && erl -version - #- curl -f -L -o ./rebar3 https://s3.amazonaws.com/rebar3/rebar3 && chmod +x ./rebar3 && ./rebar3 version && export PATH="${TRAVIS_BUILD_DIR}:$PATH" - # install C++ tools - - sudo apt install -y --no-install-recommends valgrind cmake build-essential - - cmake --version - # install Qt5 - #- sudo apt install -y --no-install-recommends qt5-default - # install boost - - sudo apt install -y --no-install-recommends libboost-all-dev - # perl dep - - cpanm --local-lib=~/perl5 local::lib && eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib) - - cpanm --quiet --no-interactive Test::Exception Test::More Log::Any LWP::UserAgent URI::Query Module::Runtime DateTime Module::Find Moose::Role JSON || echo "Ignored failure from cpanm" - # show host table to confirm petstore.swagger.io is mapped to localhost - - cat /etc/hosts - # show java version - - java -version - - if [ "$TRAVIS_BRANCH" = "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then - openssl aes-256-cbc -K $encrypted_6e2c8bba47c6_key -iv $encrypted_6e2c8bba47c6_iv -in sec.gpg.enc -out sec.gpg -d ; - gpg --keyserver keyserver.ubuntu.com --recv-key $SIGNING_KEY ; - gpg --check-trustdb ; - fi; - - pushd .; cd website; yarn install; popd - # install Deno - - sh -s v1.6.2 < ./CI/deno_install.sh - - export PATH="$HOME/.deno/bin:$PATH" - -install: - # Add Godeps dependencies to GOPATH and PATH - #- eval "$(curl -sL https://raw.githubusercontent.com/travis-ci/gimme/master/gimme | GIMME_GO_VERSION=1.4 bash)" - #- export GOPATH="${TRAVIS_BUILD_DIR}/Godeps/_workspace" - - export PATH="${TRAVIS_BUILD_DIR}/Godeps/_workspace/bin:$HOME/.cargo/bin:$PATH:/usr/lib/dart/bin" - #- go version - - gcc -v - - echo $CC - - echo $CXX - #- pub version - #- dart --version - -script: - # fail fast - - set -e - # show docker buildx version - - docker buildx version - # fail if the template files contains tabs - - /bin/bash ./bin/utils/detect_tab_in_templates.sh - # fail if the test files have changes - - bin/utils/detect_test_file_changes.rb bin/utils/test_file_list.yaml - # fail if templates/generators contain carriage return '\r' - - /bin/bash ./bin/utils/detect_carriage_return.sh - # fail if generators contain merge conflicts - - /bin/bash ./bin/utils/detect_merge_conflict.sh - # fail if generators contain tab '\t' - - /bin/bash ./bin/utils/detect_tab_in_java_class.sh - # run integration tests defined in maven pom.xml - # WARN: Travis will timeout after 10 minutes of no stdout/stderr activity, which is problematic with mvn --quiet. - - mvn -e --no-snapshot-updates --quiet --batch-mode --show-version clean install -Dorg.slf4j.simpleLogger.defaultLogLevel=error - - mvn -e --no-snapshot-updates --quiet --batch-mode --show-version verify -Psamples -Dorg.slf4j.simpleLogger.defaultLogLevel=error -after_success: - # push to maven repo - - if [ $SONATYPE_USERNAME ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then - if [ "$TRAVIS_BRANCH" = "master" ] && [ -z $TRAVIS_TAG ]; then - echo "Publishing from branch $TRAVIS_BRANCH"; - mvn clean deploy -DskipTests=true -B -U -P release --settings CI/settings.xml; - echo "Finished mvn clean deploy for $TRAVIS_BRANCH"; - pushd .; - cd modules/openapi-generator-gradle-plugin; - ./gradlew -Psigning.keyId="$SIGNING_KEY" -Psigning.password="$SIGNING_PASSPHRASE" -Psigning.secretKeyRingFile="${TRAVIS_BUILD_DIR}/sec.gpg" -PossrhUsername="${SONATYPE_USERNAME}" -PossrhPassword="${SONATYPE_PASSWORD}" publishMavenJavaPublicationToNexusRepository closeAndReleaseRepository --no-daemon; - echo "Finished ./gradlew publishPluginMavenPublicationToNexusRepository closeAndReleaseRepository"; - popd; - elif [ -z $TRAVIS_TAG ] && [[ "$TRAVIS_BRANCH" =~ ^[0-9]+\.[0-9]+\.x$ ]]; then - echo "Publishing from branch $TRAVIS_BRANCH"; - mvn clean deploy --settings CI/settings.xml; - echo "Finished mvn clean deploy for $TRAVIS_BRANCH"; - pushd .; - cd modules/openapi-generator-gradle-plugin; - ./gradlew -PossrhUsername="${SONATYPE_USERNAME}" -PossrhPassword="${SONATYPE_PASSWORD}" publishPluginMavenPublicationToNexusRepository closeAndReleaseRepository --no-daemon; - echo "Finished ./gradlew publishPluginMavenPublicationToNexusRepository closeAndReleaseRepository"; - popd; - fi; - if [ -n $TRAVIS_TAG ] && [[ "$TRAVIS_TAG" =~ ^[v][0-9]+\.[0-9]+\.[0-9]+$ ]]; then - echo "Publishing the gradle plugin to Gradle Portal on tag $TRAVIS_TAG (only)"; - pushd .; - cd modules/openapi-generator-gradle-plugin; - ./gradlew -Psigning.keyId="$SIGNING_KEY" -Psigning.password="$SIGNING_PASSPHRASE" -Psigning.secretKeyRingFile="${TRAVIS_BUILD_DIR}/sec.gpg" publishPlugins -Dgradle.publish.key=$GRADLE_PUBLISH_KEY -Dgradle.publish.secret=$GRADLE_PUBLISH_SECRET --no-daemon; - echo "Finished ./gradlew publishPlugins (plugin portal)"; - popd; - fi; - fi; - ## docker: build and push openapi-generator-online to DockerHub - - if [ $DOCKER_HUB_USERNAME ]; then - echo "$DOCKER_HUB_PASSWORD" | docker login --username=$DOCKER_HUB_USERNAME --password-stdin; - export cli_version=$(\mvn -o org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version | grep -v '\['); - export build_date=$(date -u +"%Y-%m-%dT%H:%M:%SZ"); - docker buildx create --use; - if [ ! -z "$TRAVIS_TAG" ]; then - docker buildx build --push --platform linux/amd64,linux/arm64 --label=org.opencontainers.image.created=$build_date --label=org.opencontainers.image.title=openapi-generator-online --label=org.opencontainers.image.revision=$TRAVIS_COMMIT --label=org.opencontainers.image.version=$cli_version -t $DOCKER_GENERATOR_IMAGE_NAME:latest -t $DOCKER_GENERATOR_IMAGE_NAME:$TRAVIS_TAG -t $DOCKER_GENERATOR_IMAGE_NAME -t $DOCKER_GENERATOR_IMAGE_NAME:latest-release ./modules/openapi-generator-online; - echo "Built and tagged $DOCKER_GENERATOR_IMAGE_NAME"; - fi; - if [ -z "$TRAVIS_TAG" ] && [ "$TRAVIS_BRANCH" = "master" ] && [ "$TRAVIS_PULL_REQUEST" = "false" ]; then - docker buildx build --push --platform linux/amd64,linux/arm64 --label=org.opencontainers.image.created=$build_date --label=org.opencontainers.image.title=openapi-generator-online --label=org.opencontainers.image.revision=$TRAVIS_COMMIT --label=org.opencontainers.image.version=$cli_version -t $DOCKER_GENERATOR_IMAGE_NAME ./modules/openapi-generator-online; - echo "Pushed to $DOCKER_GENERATOR_IMAGE_NAME for master"; - fi; - fi; - ## docker: build cli image and push to Docker Hub - - if [ $DOCKER_HUB_USERNAME ]; then - echo "$DOCKER_HUB_PASSWORD" | docker login --username=$DOCKER_HUB_USERNAME --password-stdin; - cp docker-entrypoint.sh ./modules/openapi-generator-cli; - export cli_version=$(\mvn -o org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version | grep -v '\['); - export build_date=$(date -u +"%Y-%m-%dT%H:%M:%SZ"); - docker buildx create --use; - docker buildx build --platform linux/amd64,linux/arm64 --label=org.opencontainers.image.created=$build_date --label=org.opencontainers.image.title=openapi-generator-cli --label=org.opencontainers.image.revision=$TRAVIS_COMMIT --label=org.opencontainers.image.version=$cli_version -t $DOCKER_CODEGEN_CLI_IMAGE_NAME ./modules/openapi-generator-cli; - if [ ! -z "$TRAVIS_TAG" ]; then - docker buildx build --push --platform linux/amd64,linux/arm64 --label=org.opencontainers.image.created=$build_date --label=org.opencontainers.image.title=openapi-generator-cli --label=org.opencontainers.image.revision=$TRAVIS_COMMIT --label=org.opencontainers.image.version=$cli_version -t $DOCKER_CODEGEN_CLI_IMAGE_NAME:latest -t $DOCKER_CODEGEN_CLI_IMAGE_NAME:$TRAVIS_TAG -t $DOCKER_CODEGEN_CLI_IMAGE_NAME -t $DOCKER_CODEGEN_CLI_IMAGE_NAME:latest-release ./modules/openapi-generator-cli; - echo "Built and tagged $DOCKER_GENERATOR_IMAGE_NAME"; - fi; - if [ -z "$TRAVIS_TAG" ] && [ "$TRAVIS_BRANCH" = "master" ] && [ "$TRAVIS_PULL_REQUEST" = "false" ]; then - docker buildx build --push --platform linux/amd64,linux/arm64 --label=org.opencontainers.image.created=$build_date --label=org.opencontainers.image.title=openapi-generator-cli --label=org.opencontainers.image.revision=$TRAVIS_COMMIT --label=org.opencontainers.image.version=$cli_version -t $DOCKER_CODEGEN_CLI_IMAGE_NAME ./modules/openapi-generator-cli; - echo "Pushed to $DOCKER_CODEGEN_CLI_IMAGE_NAME"; - fi; - fi; - ## publish latest website, variables below are secure environment variables which are unavailable to PRs from forks. - - if [ "$TRAVIS_BRANCH" = "master" ] && [ -z $TRAVIS_TAG ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then - cd website; - git config --global user.name "${GH_NAME}"; - git config --global user.email "${GH_EMAIL}"; - echo "machine github.com login ${GH_NAME} password ${GH_TOKEN}" > ~/.netrc; - yarn install; - GIT_USER="${GH_NAME}" yarn run publish-gh-pages; - fi; - -env: - - DOCKER_GENERATOR_IMAGE_NAME=openapitools/openapi-generator-online DOCKER_CODEGEN_CLI_IMAGE_NAME=openapitools/openapi-generator-cli NODE_ENV=test CC=gcc-5 CXX=g++-5 - diff --git a/CI/circle_parallel.sh b/CI/circle_parallel.sh index 716ed76214f..2e611bddece 100755 --- a/CI/circle_parallel.sh +++ b/CI/circle_parallel.sh @@ -70,6 +70,7 @@ elif [ "$NODE_INDEX" = "4" ]; then (cd samples/openapi3/client/petstore/python && make test) (cd samples/openapi3/client/3_0_3_unit_test/python && make test) (cd samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python && make test) + (cd samples/openapi3/client/features/security/python && make test) else echo "Running node $NODE_INDEX" diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index b417192acb3..b9d420dd41d 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -34,7 +34,7 @@ This Code of Conduct applies both within project spaces and in public spaces whe ## Enforcement -Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at team@openapitools.org. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at team@openapijsonschematools.org. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a1c8ee7fe57..e0c94b2c25d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,16 +2,16 @@ ## Before submitting an issue - - If you're not using the latest master to generate API clients or server stubs, please give it another try by pulling the latest master as the issue may have already been addressed. Ref: [Getting Started](https://github.com/openapitools/openapi-generator#getting-started) - - Search the [open issue](https://github.com/openapitools/openapi-generator/issues) and [closed issue](https://github.com/openapitools/openapi-generator/issues?q=is%3Aissue+is%3Aclosed) to ensure no one else has reported something similar before. - - File an [issue ticket](https://github.com/openapitools/openapi-generator/issues/new) by providing all the required information. Failure to provide enough detail may result in slow response from the community. + - If you're not using the latest master to generate API clients or server stubs, please give it another try by pulling the latest master as the issue may have already been addressed. Ref: [Getting Started](https://github.com/openapi-json-schema-tools/openapi-json-schema-generator#getting-started) + - Search the [open issue](https://github.com/openapi-json-schema-tools/openapi-json-schema-generator/issues) and [closed issue](https://github.com/openapi-json-schema-tools/openapi-json-schema-generator/issues?q=is%3Aissue+is%3Aclosed) to ensure no one else has reported something similar before. + - File an [issue ticket](https://github.com/openapi-json-schema-tools/openapi-json-schema-generator/issues/new) by providing all the required information. Failure to provide enough detail may result in slow response from the community. - Test with the latest master by building the JAR locally to see if the issue has already been addressed. - You can also make a suggestion or ask a question by opening an "issue". ## Before submitting a PR - - Search the [open issue](https://github.com/openapitools/openapi-generator/issues) to ensure no one else has reported something similar and no one is actively working on similar proposed change. - - If no one has suggested something similar, open an ["issue"](https://github.com/openapitools/openapi-generator/issues) with your suggestion to gather feedback from the community. + - Search the [open issue](https://github.com/openapi-json-schema-tools/openapi-json-schema-generator/issues) to ensure no one else has reported something similar and no one is actively working on similar proposed change. + - If no one has suggested something similar, open an ["issue"](https://github.com/openapi-json-schema-tools/openapi-json-schema-generator/issues) with your suggestion to gather feedback from the community. - If you're adding a new option to a generator, please consider using the `-t` option with customized templates instead or start a discussion first by opening an issue as we want to avoid adding too many options to the generator. - It's recommended to **create a new git branch** for the change so that the merge commit message looks nicer in the commit history. @@ -21,7 +21,7 @@ If you're new to git, you may find the following FAQs useful: -https://github.com/openapitools/openapi-generator/wiki/FAQ#git +https://github.com/openapi-json-schema-tools/openapi-json-schema-generator/wiki/FAQ#git ### Branches @@ -29,15 +29,15 @@ Please file the pull request against the correct branch, e.g. `master` for non-b ### Code generators -All the code generators can be found in [modules/openapi-generator/src/main/java/org/openapitools/codegen/languages](https://github.com/openapitools/openapi-generator/tree/master/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages) +All the code generators can be found in [modules/openapi-generator/src/main/java/org/openapijsonschematools/codegen/languages](https://github.com/openapi-json-schema-tools/openapi-json-schema-generator/tree/master/modules/openapi-generator/src/main/java/org/openapijsonschematools/codegen/languages) If you want to add a new generator, follow the [new-generator](https://openapi-generator.tech/docs/new-generator) guide. ### Templates -All the templates ([mustache](https://mustache.github.io/)) can be found in [modules/openapi-generator/src/main/resources](https://github.com/openapitools/openapi-generator/tree/master/modules/openapi-generator/src/main/resources). +All the templates ([mustache](https://mustache.github.io/)) can be found in [modules/openapi-generator/src/main/resources](https://github.com/openapi-json-schema-tools/openapi-json-schema-generator/tree/master/modules/openapi-generator/src/main/resources). -For a list of variables available in the template, please refer to this [page](https://github.com/openapitools/openapi-generator/wiki/Mustache-Template-Variables) +For a list of variables available in the template, please refer to this [page](https://github.com/openapi-json-schema-tools/openapi-json-schema-generator/wiki/Mustache-Template-Variables) ### Style guide @@ -80,15 +80,15 @@ You may find the current code base not 100% conform to the coding style and we w For [Vendor Extensions](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#vendorExtensions), please follow the naming convention below: - For general vendor extension, use lower case and hyphen. e.g. `x-is-unique`, `x-content-type` - For language-specified vendor extension, put it in the form of `x-{lang}-{extension-name}`. e.g. `x-objc-operation-id`, `x-java-feign-retry-limit` -- For a list of existing vendor extensions in use, please refer to https://github.com/openapitools/openapi-generator/wiki/Vendor-Extensions. If you've added new vendor extensions as part of your PR, please update the wiki page. +- For a list of existing vendor extensions in use, please refer to https://github.com/openapi-json-schema-tools/openapi-json-schema-generator/wiki/Vendor-Extensions. If you've added new vendor extensions as part of your PR, please update the wiki page. ### Testing -To add test cases (optional) covering the change in the code generator, please refer to [modules/openapi-generator/src/test/java/org/openapitools/codegen](https://github.com/openapitools/openapi-generator/tree/master/modules/openapi-generator/src/test/java/org/openapitools/codegen) +To add test cases (optional) covering the change in the code generator, please refer to [modules/openapi-generator/src/test/java/org/openapijsonschematools/codegen](https://github.com/openapi-json-schema-tools/openapi-json-schema-generator/tree/master/modules/openapi-generator/src/test/java/org/openapijsonschematools/codegen) To test the templates, please perform the following: -- Update the Petstore sample by running the shell scripts under the `bin` folder. For example, run `./bin/generate-samples.sh ./bin/configs/python*` to update the Python-related samples under [`samples`](https://github.com/openapitools/openapi-generator/tree/master/samples). For Windows, please install [GIT bash](https://gitforwindows.org/). (If you find that there are new files generated or unexpected changes as a result of the update, that's not unusual as the test cases are added to the OpenAPI spec from time to time. If you've questions or concerns, please open a ticket to start a discussion) +- Update the Petstore sample by running the shell scripts under the `bin` folder. For example, run `./bin/generate-samples.sh ./bin/configs/python*` to update the Python-related samples under [`samples`](https://github.com/openapi-json-schema-tools/openapi-json-schema-generator/tree/master/samples). For Windows, please install [GIT bash](https://gitforwindows.org/). (If you find that there are new files generated or unexpected changes as a result of the update, that's not unusual as the test cases are added to the OpenAPI spec from time to time. If you've questions or concerns, please open a ticket to start a discussion) - During development, it can be helpful to quickly regenerate the samples without recompiling all of openapi-generator, e.g. when you have only updated the mustache templates. This can be done by passing the `-t` parameter: `-t modules/openapi-generator/src/main/resources/python`. - Run the tests in the sample folder using maven `mvn integration-test -f /path/to/pom.xml`, e.g. `mvn integration-test -f samples/client/petstore/python/pom.xml`. (some languages may not contain unit testing for Petstore and we're looking for contribution from the community to implement those tests). __Please notice:__ you must run a local instance of the Petstore server in order to perform the tests, as running them against petstore.swagger.io is not supported anymore. Please refer to item 3 of [Integration Tests - How to add integration tests for new Petstore samples](https://github.com/OpenAPITools/openapi-generator/wiki/Integration-Tests#how-to-add-integration-tests-for-new-petstore-samples) to learn how to quickly configure and run it. - Finally, git commit the updated samples files: `git commit -a` (`git add -A` if added files with new test cases) diff --git a/Dockerfile b/Dockerfile index 94a11131cf2..9cb61b342ae 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,7 +11,6 @@ COPY ./LICENSE ${GEN_DIR} COPY ./google_checkstyle.xml ${GEN_DIR} # Modules are copied individually here to allow for caching of docker layers between major.minor versions -COPY ./modules/openapi-json-schema-generator-online ${GEN_DIR}/modules/openapi-json-schema-generator-online COPY ./modules/openapi-json-schema-generator-cli ${GEN_DIR}/modules/openapi-json-schema-generator-cli COPY ./modules/openapi-json-schema-generator-core ${GEN_DIR}/modules/openapi-json-schema-generator-core COPY ./modules/openapi-json-schema-generator ${GEN_DIR}/modules/openapi-json-schema-generator diff --git a/README.md b/README.md index 5fda81a28df..15a37d08030 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,10 @@ -

OpenAPI JSON Schema Generator

+# OpenAPI JSON Schema Generator -
+[![CI Tests](https://dl.circleci.com/status-badge/img/gh/openapi-json-schema-tools/openapi-json-schema-generator/tree/master.svg?style=shield)](https://dl.circleci.com/status-badge/redirect/gh/openapi-json-schema-tools/openapi-json-schema-generator/tree/master) +[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-orange)](./LICENSE) -[![CI Tests](https://dl.circleci.com/status-badge/img/gh/openapi-json-schema-tools/openapi-json-schema-generator/tree/master.svg?style=shield)](https://dl.circleci.com/status-badge/redirect/gh/openapi-json-schema-tools/openapi-json-schema-generator/tree/master) [![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-orange)](./LICENSE) - -
- -
- -:star::star::star: If you would like to contribute, please refer to [guidelines](CONTRIBUTING.md) and a list of [open tasks](https://github.com/openapi-json-schema-tools/openapi-json-schema-generator/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22).:star::star::star: - -:warning: If the OpenAPI spec, templates or any input (e.g. options, environment variables) is obtained from an untrusted source or environment, please make sure you've reviewed these inputs before using OpenAPI JSON Schema Generator to generate the API client, server stub or documentation to avoid potential security issues (e.g. [code injection](https://en.wikipedia.org/wiki/Code_injection)). For security vulnerabilities, please contact create an issue. :warning: - -:bangbang: Both "openapi-json-schema-tools" (the parent organization of OpenAPI JSON Schema Generator) and "OpenAPI JSON Schema Generator" are not affiliated with OpenAPI Initiative (OAI) :bangbang: - -
+Auto generate a client sdk from your openapi 3.0.0-3.0.3 document using Openapi JSON Schema Generator. +This project is a code generator that focuses on supporting all openapi and json schema features. ## Overview OpenAPI JSON Schema Generator allows auto-generation of API client libraries (SDK generation) given an @@ -41,14 +31,16 @@ Currently, the following languages/frameworks are supported: - accessing properties in object instances so some_val in some_val = some_inst['someKey'] will have the correct type hint - accessing array items in array instances so some_val in some_val = array_inst[0] will have the correct type hint - endpoint inputs + responses +- Code re-use built in from the ground up + - components/schemas/headers etc are generated as separate classes and imported when used via $ref +- Openapi spec inline schemas supported at any depth in any location - Format support for: int32, int64, float, double, binary, date, datetime, uuid - Invalid (in python) property names supported like `from`, `1var`, `hi-there` etc in - schema property names - endpoint parameter names -- Openapi spec inline schemas supported at any depth - If needed, validation of some json schema keywords can be deactivated via a configuration class - Payload values are not coerced when validated, so a datetime value can pass other validations that describe the payload only as type string -- String transmission of numbers supported with type: string, format: number, value can be accessed as a Decimal with inst.as_decimal_oapg +- String transmission of numbers supported with type: string, format: number, value can be accessed as a Decimal with inst.as_decimal_ - Multiple content types supported for request and response bodies - Endpoint response always also includes the urllib3.HTTPResponse - Endpoint response deserialization can be skipped with the skip_deserialization argument @@ -63,10 +55,8 @@ And many more! ### Can I build here? -Yes! Contributions are welcome. -If you want to build a new server or client or documentation generator you are welcome to here. -Can I write a python generator based on the pydantic or jsonschema libraries? -Definitely! +Yes; contributions are welcome! +Submit a PR if you want to add a new server scaffold, client sdk, or documentation generator in any language. ## Table of contents @@ -81,8 +71,7 @@ Definitely! - [3 - Usage](#3---usage) - [3.1 - Customization](#31---customization) - [3.2 - Workflow Integration](#32---workflow-integration-maven-gradle-github-cicd) - - [3.3 - Online Generators](#33---online-openapi-json-schema-generator) - - [3.4 - License Information on Generated Code](#34---license-information-on-generated-code) + - [3.3 - License Information on Generated Code](#34---license-information-on-generated-code) - [4 - Companies/Projects using OpenAPI JSON Schema Generator](#4---companiesprojects-using-openapi-json-schema-generator) - [5 - About Us](#5---about-us) - [5.1 - History of OpenAPI JSON Schema Generator](#51---history-of-openapi-json-schema-generator) @@ -96,6 +85,7 @@ The OpenAPI Specification has undergone 3 revisions since initial creation in 20 | OpenAPI JSON Schema Generator Version | OpenAPI Spec compatibility | |---------------------------------------|-----------------------------| +| 2.0.0 | 3.0.0 - 3.0.3 | | 1.0.4 | 3.0.0 - 3.0.3 | | 1.0.3 | 3.0.0 - 3.0.3 | | 1.0.2 | 3.0.0 - 3.0.3 | @@ -150,39 +140,6 @@ docker run --rm -v "${PWD}:/local" openapjsonschematools/openapi-json-schema-gen The generated code will be located under `./out/python` in the current directory. -#### OpenAPI JSON Schema Generator Online Docker Image - -The openapi-json-schema-generator-online image can act as a self-hosted web application and API for generating code. This container can be incorporated into a CI pipeline, and requires at least two HTTP requests and some docker orchestration to access generated code. - -Example usage: - -```sh -# Start container at port 8888 and save the container id -> CID=$(docker run -d -p 8888:8080 openapitools/openapi-json-schema-generator-online) - -# allow for startup -> sleep 10 - -# Get the IP of the running container (optional) -GEN_IP=$(docker inspect --format '{{.NetworkSettings.IPAddress}}' $CID) - -# Execute an HTTP request to generate a Ruby client -> curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' \ --d '{"openAPIUrl": "https://raw.githubusercontent.com/openapitools/openapi-json-schema-generator/master/modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml"}' \ -'http://localhost:8888/api/gen/clients/python' - -{"code":"c2d483.3.4672-40e9-91df-b9ffd18d22b8","link":"http://localhost:8888/api/gen/download/c2d483.3.4672-40e9-91df-b9ffd18d22b8"} - -# Download the generated zip file -> wget http://localhost:8888/api/gen/download/c2d483.3.4672-40e9-91df-b9ffd18d22b8 - -# Unzip the file -> unzip c2d483.3.4672-40e9-91df-b9ffd18d22b8 - -# Shutdown the openapi generator image -> docker stop $CID && docker rm $CID -``` - #### Development in docker You can use `run-in-docker.sh` to do all development. This script maps your local repository to `/gen` @@ -249,7 +206,7 @@ java -jar modules/openapi-json-schema-generator-cli/target/openapi-json-schema-g (if you're on Windows, replace the last command with `java -jar modules\openapi-json-schema-generator-cli\target\openapi-json-schema-generator-cli.jar generate -i https://raw.githubusercontent.com/openapi-json-schema-tools/openapi-json-schema-generator/master/modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml -g python -o c:\temp\python_api_client`) -You can also download the JAR (latest release) directly from [maven.org](https://repo1.maven.org/maven2/org/openapitools/openapi-json-schema-generator-cli/6.1.0/openapi-json-schema-generator-cli-6.1.0.jar) +You can also download the JAR (latest release) directly from [maven.org](https://repo1.maven.org/maven2/org/openapijsonschematools/openapi-json-schema-generator-cli/6.1.0/openapi-json-schema-generator-cli-6.1.0.jar) To get a list of **general** options available, please run `java -jar modules/openapi-json-schema-generator-cli/target/openapi-json-schema-generator-cli.jar help generate` @@ -259,7 +216,7 @@ To get a list of PHP specified options (which can be passed to the generator wit ## [3 - Usage](#table-of-contents) ### To generate a sample client library -You can build a client against the [Petstore API](https://raw.githubusercontent.com/openapitools/openapi-json-schema-generator/master/modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml) as follows: +You can build a client against the [Petstore API](https://raw.githubusercontent.com/openapijsonschematools/openapi-json-schema-generator/master/modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml) as follows: ```sh ./bin/generate-samples.sh ./bin/configs/python.yaml @@ -271,7 +228,7 @@ This script will run the generator with this command: ```sh java -jar modules/openapi-json-schema-generator-cli/target/openapi-json-schema-generator-cli.jar generate \ - -i https://raw.githubusercontent.com/openapitools/openapi-json-schema-generator/master/modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml \ + -i https://raw.githubusercontent.com/openapijsonschematools/openapi-json-schema-generator/master/modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml \ -g python \ -t modules/openapi-json-schema-generator/src/main/resources/python \ --additional-properties packageName=petstore_api \ @@ -345,11 +302,7 @@ Please refer to [customization.md](docs/customization.md) on how to customize th Please refer to [integration.md](docs/integration.md) on how to integrate OpenAPI generator with Maven, Gradle, Github and CI/CD. -### [3.3 - Online OpenAPI generator](#table-of-contents) - -Please refer to [online.md](docs/online.md) on how to run and use the `openapi-json-schema-generator-online` - a web service for `openapi-json-schema-generator`. - -### [3.4 - License information on Generated Code](#table-of-contents) +### [3.3 - License information on Generated Code](#table-of-contents) The OpenAPI JSON Schema Generator project is intended as a benefit for users of the Open API Specification. The project itself has the [License](#license) as specified. In addition, please understand the following points: diff --git a/bin/configs/python.yaml b/bin/configs/python.yaml index 12a23163bd6..4412061bc5e 100644 --- a/bin/configs/python.yaml +++ b/bin/configs/python.yaml @@ -1,6 +1,6 @@ generatorName: python outputDir: samples/openapi3/client/petstore/python -inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/python/petstore_customized.yaml templateDir: modules/openapi-json-schema-generator/src/main/resources/python additionalProperties: packageName: petstore_api diff --git a/bin/configs/python_security.yaml b/bin/configs/python_security.yaml new file mode 100644 index 00000000000..dc27f965fe8 --- /dev/null +++ b/bin/configs/python_security.yaml @@ -0,0 +1,5 @@ +generatorName: python +outputDir: samples/openapi3/client/features/security/python +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/security.yaml +additionalProperties: + packageName: this_package diff --git a/bin/configs/unmaintained/ada.yaml b/bin/configs/unmaintained/ada.yaml index c67b9b7d3f0..8dd8df8a3e4 100644 --- a/bin/configs/unmaintained/ada.yaml +++ b/bin/configs/unmaintained/ada.yaml @@ -1,7 +1,7 @@ generatorName: ada outputDir: samples/client/petstore/ada -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/Ada +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/Ada additionalProperties: modelPackage: Samples.Petstore projectName: Petstore diff --git a/bin/configs/unmaintained/android-httpclient.yaml b/bin/configs/unmaintained/android-httpclient.yaml index 7a58659d0e3..2a7cba0a8bb 100644 --- a/bin/configs/unmaintained/android-httpclient.yaml +++ b/bin/configs/unmaintained/android-httpclient.yaml @@ -1,5 +1,5 @@ generatorName: android outputDir: samples/client/petstore/android/httpclient library: httpclient -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/android +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/android diff --git a/bin/configs/unmaintained/android-volley.yaml b/bin/configs/unmaintained/android-volley.yaml index 5c479033268..508ddfa42d4 100644 --- a/bin/configs/unmaintained/android-volley.yaml +++ b/bin/configs/unmaintained/android-volley.yaml @@ -1,7 +1,7 @@ generatorName: android outputDir: samples/client/petstore/android/volley library: volley -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/android +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/android additionalProperties: artifactId: petstore-android-volley diff --git a/bin/configs/unmaintained/apache2.yaml b/bin/configs/unmaintained/apache2.yaml index a5b28c44e51..ea5559bcea7 100644 --- a/bin/configs/unmaintained/apache2.yaml +++ b/bin/configs/unmaintained/apache2.yaml @@ -1,4 +1,4 @@ generatorName: apache2 outputDir: samples/config/petstore/apache2 -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/apache2 +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/apache2 diff --git a/bin/configs/unmaintained/apex.yaml b/bin/configs/unmaintained/apex.yaml index 23ec0ef743e..25b9ca77ec4 100644 --- a/bin/configs/unmaintained/apex.yaml +++ b/bin/configs/unmaintained/apex.yaml @@ -2,5 +2,5 @@ systemProperties: skipFormModel: "true" generatorName: apex outputDir: samples/client/petstore/apex -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/apex +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/apex diff --git a/bin/configs/unmaintained/asciidoc.yaml b/bin/configs/unmaintained/asciidoc.yaml index 4d93790d87b..df1595a0540 100644 --- a/bin/configs/unmaintained/asciidoc.yaml +++ b/bin/configs/unmaintained/asciidoc.yaml @@ -1,7 +1,7 @@ generatorName: asciidoc outputDir: samples/documentation/asciidoc -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/asciidoc-documentation +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/asciidoc-documentation additionalProperties: - specDir: modules/openapi-generator/src/main/resources/asciidoc-documentation + specDir: modules/openapi-json-schema-generator/src/main/resources/asciidoc-documentation snippetDir: "." diff --git a/bin/configs/unmaintained/aspnetcore-2.2.yaml b/bin/configs/unmaintained/aspnetcore-2.2.yaml index 2f91ef75ede..d32f97ab278 100644 --- a/bin/configs/unmaintained/aspnetcore-2.2.yaml +++ b/bin/configs/unmaintained/aspnetcore-2.2.yaml @@ -1,7 +1,7 @@ generatorName: aspnetcore outputDir: samples/server/petstore/aspnetcore -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/aspnetcore/2.1 +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/aspnetcore/2.1 additionalProperties: packageGuid: '{3C799344-F285-4669-8FD5-7ED9B795D5C5}' aspnetCoreVersion: "2.2" diff --git a/bin/configs/unmaintained/aspnetcore-3.0.yaml b/bin/configs/unmaintained/aspnetcore-3.0.yaml index fcf9430d8b1..c6731eb6a99 100644 --- a/bin/configs/unmaintained/aspnetcore-3.0.yaml +++ b/bin/configs/unmaintained/aspnetcore-3.0.yaml @@ -1,7 +1,7 @@ generatorName: aspnetcore outputDir: samples/server/petstore/aspnetcore-3.0 -inputSpec: modules/openapi-generator/src/test/resources/3_0/aspnetcore/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/aspnetcore/3.0 +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/aspnetcore/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/aspnetcore/3.0 additionalProperties: packageGuid: '{3C799344-F285-4669-8FD5-7ED9B795D5C5}' aspnetCoreVersion: "3.0" diff --git a/bin/configs/unmaintained/aspnetcore-3.1.yaml b/bin/configs/unmaintained/aspnetcore-3.1.yaml index 2859ae3629d..11e50b45255 100644 --- a/bin/configs/unmaintained/aspnetcore-3.1.yaml +++ b/bin/configs/unmaintained/aspnetcore-3.1.yaml @@ -1,7 +1,7 @@ generatorName: aspnetcore outputDir: samples/server/petstore/aspnetcore-3.1 -inputSpec: modules/openapi-generator/src/test/resources/3_0/aspnetcore/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/aspnetcore/3.0 +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/aspnetcore/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/aspnetcore/3.0 additionalProperties: packageGuid: '{3C799344-F285-4669-8FD5-7ED9B795D5C5}' # comment out below as 3.1 the default diff --git a/bin/configs/unmaintained/aspnetcore-5.0.yaml b/bin/configs/unmaintained/aspnetcore-5.0.yaml index fd4e6d5fc2c..ccd095da999 100644 --- a/bin/configs/unmaintained/aspnetcore-5.0.yaml +++ b/bin/configs/unmaintained/aspnetcore-5.0.yaml @@ -1,7 +1,7 @@ generatorName: aspnetcore outputDir: samples/server/petstore/aspnetcore-5.0 -inputSpec: modules/openapi-generator/src/test/resources/3_0/aspnetcore/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/aspnetcore/3.0 +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/aspnetcore/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/aspnetcore/3.0 additionalProperties: packageGuid: '{3C799344-F285-4669-8FD5-7ED9B795D5C5}' aspnetCoreVersion: "5.0" diff --git a/bin/configs/unmaintained/aspnetcore-6.0-pocoModels.yaml b/bin/configs/unmaintained/aspnetcore-6.0-pocoModels.yaml index 9e360262234..d98eecd704e 100644 --- a/bin/configs/unmaintained/aspnetcore-6.0-pocoModels.yaml +++ b/bin/configs/unmaintained/aspnetcore-6.0-pocoModels.yaml @@ -1,7 +1,7 @@ generatorName: aspnetcore outputDir: samples/server/petstore/aspnetcore-6.0-pocoModels -inputSpec: modules/openapi-generator/src/test/resources/3_0/aspnetcore/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/aspnetcore/3.0 +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/aspnetcore/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/aspnetcore/3.0 additionalProperties: packageGuid: '{3C799344-F285-4669-8FD5-7ED9B795D5C5}' aspnetCoreVersion: "6.0" diff --git a/bin/configs/unmaintained/aspnetcore-6.0-project4Models.yaml b/bin/configs/unmaintained/aspnetcore-6.0-project4Models.yaml index bb8b63602c5..e3d13bbe02e 100644 --- a/bin/configs/unmaintained/aspnetcore-6.0-project4Models.yaml +++ b/bin/configs/unmaintained/aspnetcore-6.0-project4Models.yaml @@ -1,7 +1,7 @@ generatorName: aspnetcore outputDir: samples/server/petstore/aspnetcore-6.0-project4Models -inputSpec: modules/openapi-generator/src/test/resources/3_0/aspnetcore/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/aspnetcore/3.0 +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/aspnetcore/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/aspnetcore/3.0 additionalProperties: packageGuid: '{3C799344-F285-4669-8FD5-7ED9B795D5C5}' aspnetCoreVersion: "6.0" diff --git a/bin/configs/unmaintained/aspnetcore-6.0.yaml b/bin/configs/unmaintained/aspnetcore-6.0.yaml index a5cd2cc235b..8cf1b4f7124 100644 --- a/bin/configs/unmaintained/aspnetcore-6.0.yaml +++ b/bin/configs/unmaintained/aspnetcore-6.0.yaml @@ -1,7 +1,7 @@ generatorName: aspnetcore outputDir: samples/server/petstore/aspnetcore-6.0 -inputSpec: modules/openapi-generator/src/test/resources/3_0/aspnetcore/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/aspnetcore/3.0 +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/aspnetcore/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/aspnetcore/3.0 additionalProperties: packageGuid: '{3C799344-F285-4669-8FD5-7ED9B795D5C5}' aspnetCoreVersion: "6.0" diff --git a/bin/configs/unmaintained/avro-schema.yaml b/bin/configs/unmaintained/avro-schema.yaml index 872043a6968..5dfd8d69765 100644 --- a/bin/configs/unmaintained/avro-schema.yaml +++ b/bin/configs/unmaintained/avro-schema.yaml @@ -1,4 +1,4 @@ generatorName: avro-schema outputDir: samples/openapi3/schema/petstore/avro-schema -inputSpec: modules/openapi-generator/src/test/resources/3_0/avro-schema/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/avro-schema +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/avro-schema/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/avro-schema diff --git a/bin/configs/unmaintained/bash.yaml b/bin/configs/unmaintained/bash.yaml index 4ad33693827..85259c5657a 100644 --- a/bin/configs/unmaintained/bash.yaml +++ b/bin/configs/unmaintained/bash.yaml @@ -1,7 +1,7 @@ generatorName: bash outputDir: samples/client/petstore/bash -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/bash +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/bash additionalProperties: generateZshCompletion: true hostEnvironmentVariable: PETSTORE_HOST diff --git a/bin/configs/unmaintained/c.yaml b/bin/configs/unmaintained/c.yaml index f622e7919a6..5f964a1cce2 100644 --- a/bin/configs/unmaintained/c.yaml +++ b/bin/configs/unmaintained/c.yaml @@ -1,4 +1,4 @@ generatorName: c outputDir: samples/client/petstore/c -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/C-libcurl +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/C-libcurl diff --git a/bin/configs/unmaintained/clojure.yaml b/bin/configs/unmaintained/clojure.yaml index f58c95316cd..a8239f4a6d9 100644 --- a/bin/configs/unmaintained/clojure.yaml +++ b/bin/configs/unmaintained/clojure.yaml @@ -1,4 +1,4 @@ generatorName: clojure outputDir: samples/client/petstore/clojure -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.json -templateDir: modules/openapi-generator/src/main/resources/clojure +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.json +templateDir: modules/openapi-json-schema-generator/src/main/resources/clojure diff --git a/bin/configs/unmaintained/cpp-pistache-server-cpp-pistache.yaml b/bin/configs/unmaintained/cpp-pistache-server-cpp-pistache.yaml index 4a0326357ef..e471666dd6c 100644 --- a/bin/configs/unmaintained/cpp-pistache-server-cpp-pistache.yaml +++ b/bin/configs/unmaintained/cpp-pistache-server-cpp-pistache.yaml @@ -1,7 +1,7 @@ generatorName: cpp-pistache-server outputDir: samples/server/petstore/cpp-pistache -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/cpp-pistache-server +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/cpp-pistache-server additionalProperties: useStructModel: "false" addExternalLibs: "true" diff --git a/bin/configs/unmaintained/cpp-qt-client.yaml b/bin/configs/unmaintained/cpp-qt-client.yaml index 26f46eae4ae..f5f4986bb28 100644 --- a/bin/configs/unmaintained/cpp-qt-client.yaml +++ b/bin/configs/unmaintained/cpp-qt-client.yaml @@ -1,7 +1,7 @@ generatorName: cpp-qt-client outputDir: samples/client/petstore/cpp-qt -inputSpec: modules/openapi-generator/src/test/resources/3_0/cpp-qt/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/cpp-qt-client +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/cpp-qt/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/cpp-qt-client additionalProperties: cppNamespace: test_namespace modelNamePrefix: PFX diff --git a/bin/configs/unmaintained/cpp-qt-qhttpengine-server.yaml b/bin/configs/unmaintained/cpp-qt-qhttpengine-server.yaml index 9a03bcbc951..5a4a69fb7af 100644 --- a/bin/configs/unmaintained/cpp-qt-qhttpengine-server.yaml +++ b/bin/configs/unmaintained/cpp-qt-qhttpengine-server.yaml @@ -1,4 +1,4 @@ generatorName: cpp-qt-qhttpengine-server outputDir: samples/server/petstore/cpp-qt-qhttpengine-server -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/cpp-qt-qhttpengine-server diff --git a/bin/configs/unmaintained/cpp-restbed-server.yaml b/bin/configs/unmaintained/cpp-restbed-server.yaml index 6dc3929ec08..5ec72950719 100644 --- a/bin/configs/unmaintained/cpp-restbed-server.yaml +++ b/bin/configs/unmaintained/cpp-restbed-server.yaml @@ -1,4 +1,4 @@ generatorName: cpp-restbed-server outputDir: samples/server/petstore/cpp-restbed/generated/3_0 -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/cpp-restbed-server +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/cpp-restbed-server diff --git a/bin/configs/unmaintained/cpp-restsdk-client.yaml b/bin/configs/unmaintained/cpp-restsdk-client.yaml index fedc628a69e..80098617c2b 100644 --- a/bin/configs/unmaintained/cpp-restsdk-client.yaml +++ b/bin/configs/unmaintained/cpp-restsdk-client.yaml @@ -1,6 +1,6 @@ generatorName: cpp-restsdk outputDir: samples/client/petstore/cpp-restsdk/client -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/cpp-rest-sdk-client +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/cpp-rest-sdk-client additionalProperties: packageName: CppRestPetstoreClient diff --git a/bin/configs/unmaintained/cpp-tiny.yaml b/bin/configs/unmaintained/cpp-tiny.yaml index 237ae1403f4..fb91a8330e7 100644 --- a/bin/configs/unmaintained/cpp-tiny.yaml +++ b/bin/configs/unmaintained/cpp-tiny.yaml @@ -1,7 +1,7 @@ generatorName: cpp-tiny outputDir: samples/client/petstore/cpp-tiny -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/cpp-tiny +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/cpp-tiny additionalProperties: hideGenerationTimestamp: "true" controller: "esp32" diff --git a/bin/configs/unmaintained/cpp-tizen.yaml b/bin/configs/unmaintained/cpp-tizen.yaml index 5efd42127c1..65f10ee169e 100644 --- a/bin/configs/unmaintained/cpp-tizen.yaml +++ b/bin/configs/unmaintained/cpp-tizen.yaml @@ -1,4 +1,4 @@ generatorName: cpp-tizen outputDir: samples/client/petstore/cpp-tizen -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/cpp-tizen-client +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/cpp-tizen-client diff --git a/bin/configs/unmaintained/cpp-ue4.yaml b/bin/configs/unmaintained/cpp-ue4.yaml index 98df851e2d2..978a4054949 100644 --- a/bin/configs/unmaintained/cpp-ue4.yaml +++ b/bin/configs/unmaintained/cpp-ue4.yaml @@ -1,4 +1,4 @@ generatorName: cpp-ue4 outputDir: samples/client/petstore/cpp-ue4 -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/cpp-ue4 +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/cpp-ue4 diff --git a/bin/configs/unmaintained/crystal.yaml b/bin/configs/unmaintained/crystal.yaml index 74badcce662..87d1a403d25 100644 --- a/bin/configs/unmaintained/crystal.yaml +++ b/bin/configs/unmaintained/crystal.yaml @@ -1,7 +1,7 @@ generatorName: crystal outputDir: samples/client/petstore/crystal -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/crystal +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/crystal additionalProperties: shardVersion: 1.0.0 moduleName: Petstore diff --git a/bin/configs/unmaintained/csharp-OpenAPIClient.yaml b/bin/configs/unmaintained/csharp-OpenAPIClient.yaml index 5855eb4a350..127c5276d9f 100644 --- a/bin/configs/unmaintained/csharp-OpenAPIClient.yaml +++ b/bin/configs/unmaintained/csharp-OpenAPIClient.yaml @@ -1,6 +1,6 @@ generatorName: csharp outputDir: samples/client/petstore/csharp/OpenAPIClient -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/csharp +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/csharp additionalProperties: packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}' diff --git a/bin/configs/unmaintained/csharp-OpenAPIClientNet35.yaml b/bin/configs/unmaintained/csharp-OpenAPIClientNet35.yaml index c308c2ceed9..1f8e80198e6 100644 --- a/bin/configs/unmaintained/csharp-OpenAPIClientNet35.yaml +++ b/bin/configs/unmaintained/csharp-OpenAPIClientNet35.yaml @@ -1,7 +1,7 @@ generatorName: csharp outputDir: samples/client/petstore/csharp/OpenAPIClientNet35 -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/csharp +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/csharp additionalProperties: targetFramework: v3.5 packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}' diff --git a/bin/configs/unmaintained/csharp-OpenAPIClientNet40.yaml b/bin/configs/unmaintained/csharp-OpenAPIClientNet40.yaml index bd5d7cf794e..6343c5573ac 100644 --- a/bin/configs/unmaintained/csharp-OpenAPIClientNet40.yaml +++ b/bin/configs/unmaintained/csharp-OpenAPIClientNet40.yaml @@ -1,7 +1,7 @@ generatorName: csharp outputDir: samples/client/petstore/csharp/OpenAPIClientNet40 -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/csharp +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/csharp additionalProperties: targetFramework: v4.0 packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}' diff --git a/bin/configs/unmaintained/csharp-OpenAPIClientNetCoreProject.yaml b/bin/configs/unmaintained/csharp-OpenAPIClientNetCoreProject.yaml index e9fca548604..5813ac6c88f 100644 --- a/bin/configs/unmaintained/csharp-OpenAPIClientNetCoreProject.yaml +++ b/bin/configs/unmaintained/csharp-OpenAPIClientNetCoreProject.yaml @@ -1,7 +1,7 @@ generatorName: csharp outputDir: samples/client/petstore/csharp/OpenAPIClientNetCoreProject -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/csharp +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/csharp additionalProperties: targetFramework: netstandard1.3 packageGuid: '{67035b31-f8e5-41a4-9673-954035084f7d}' diff --git a/bin/configs/unmaintained/csharp-OpenAPIClientNetStandard.yaml b/bin/configs/unmaintained/csharp-OpenAPIClientNetStandard.yaml index b4f72b50b28..01fbe3607b9 100644 --- a/bin/configs/unmaintained/csharp-OpenAPIClientNetStandard.yaml +++ b/bin/configs/unmaintained/csharp-OpenAPIClientNetStandard.yaml @@ -1,7 +1,7 @@ generatorName: csharp outputDir: samples/client/petstore/csharp/OpenAPIClientNetStandard -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/csharp +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/csharp additionalProperties: targetFramework: netstandard1.3 packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}' diff --git a/bin/configs/unmaintained/csharp-OpenAPIClientWithPropertyChanged.yaml b/bin/configs/unmaintained/csharp-OpenAPIClientWithPropertyChanged.yaml index d5e7325510f..65f0593c414 100644 --- a/bin/configs/unmaintained/csharp-OpenAPIClientWithPropertyChanged.yaml +++ b/bin/configs/unmaintained/csharp-OpenAPIClientWithPropertyChanged.yaml @@ -1,7 +1,7 @@ generatorName: csharp outputDir: samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/csharp +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/csharp additionalProperties: packageGuid: '{5CD900DE-8266-412F-A758-28E1F9C623D5}' generatePropertyChanged: "true" diff --git a/bin/configs/unmaintained/csharp-dotnet2-OpenAPIClient.yaml b/bin/configs/unmaintained/csharp-dotnet2-OpenAPIClient.yaml index 76c07c772d6..1cfbba67df0 100644 --- a/bin/configs/unmaintained/csharp-dotnet2-OpenAPIClient.yaml +++ b/bin/configs/unmaintained/csharp-dotnet2-OpenAPIClient.yaml @@ -1,6 +1,6 @@ generatorName: csharp-dotnet2 outputDir: samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/csharp-dotnet2 +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/csharp-dotnet2 additionalProperties: hideGenerationTimestamp: "true" diff --git a/bin/configs/unmaintained/csharp-netcore-OpenAPIClient-generichost-netcore5.0-nrt.yaml b/bin/configs/unmaintained/csharp-netcore-OpenAPIClient-generichost-netcore5.0-nrt.yaml index d234b5399f2..33154979fab 100644 --- a/bin/configs/unmaintained/csharp-netcore-OpenAPIClient-generichost-netcore5.0-nrt.yaml +++ b/bin/configs/unmaintained/csharp-netcore-OpenAPIClient-generichost-netcore5.0-nrt.yaml @@ -1,9 +1,9 @@ # for csharp-netcore generichost generatorName: csharp-netcore outputDir: samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt -inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml library: generichost -templateDir: modules/openapi-generator/src/main/resources/csharp-netcore +templateDir: modules/openapi-json-schema-generator/src/main/resources/csharp-netcore additionalProperties: packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}' useCompareNetObjects: true diff --git a/bin/configs/unmaintained/csharp-netcore-OpenAPIClient-generichost-netcore5.0.yaml b/bin/configs/unmaintained/csharp-netcore-OpenAPIClient-generichost-netcore5.0.yaml index 1b07cd23c2c..c8f095850de 100644 --- a/bin/configs/unmaintained/csharp-netcore-OpenAPIClient-generichost-netcore5.0.yaml +++ b/bin/configs/unmaintained/csharp-netcore-OpenAPIClient-generichost-netcore5.0.yaml @@ -1,9 +1,9 @@ # for csharp-netcore generichost generatorName: csharp-netcore outputDir: samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0 -inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml library: generichost -templateDir: modules/openapi-generator/src/main/resources/csharp-netcore +templateDir: modules/openapi-json-schema-generator/src/main/resources/csharp-netcore additionalProperties: packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}' useCompareNetObjects: true diff --git a/bin/configs/unmaintained/csharp-netcore-OpenAPIClient-generichost-netstandard2.0.yaml b/bin/configs/unmaintained/csharp-netcore-OpenAPIClient-generichost-netstandard2.0.yaml index 597c9753d4f..fda971fed7c 100644 --- a/bin/configs/unmaintained/csharp-netcore-OpenAPIClient-generichost-netstandard2.0.yaml +++ b/bin/configs/unmaintained/csharp-netcore-OpenAPIClient-generichost-netstandard2.0.yaml @@ -1,9 +1,9 @@ # for csharp-netcore generichost generatorName: csharp-netcore outputDir: samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0 -inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml library: generichost -templateDir: modules/openapi-generator/src/main/resources/csharp-netcore +templateDir: modules/openapi-json-schema-generator/src/main/resources/csharp-netcore additionalProperties: packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}' useCompareNetObjects: true diff --git a/bin/configs/unmaintained/csharp-netcore-OpenAPIClient-httpclient.yaml b/bin/configs/unmaintained/csharp-netcore-OpenAPIClient-httpclient.yaml index 1139faf069c..b5539f840f8 100644 --- a/bin/configs/unmaintained/csharp-netcore-OpenAPIClient-httpclient.yaml +++ b/bin/configs/unmaintained/csharp-netcore-OpenAPIClient-httpclient.yaml @@ -1,8 +1,8 @@ # for .net standard httpclient generatorName: csharp-netcore outputDir: samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient -inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml -templateDir: modules/openapi-generator/src/main/resources/csharp-netcore +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/csharp-netcore library: httpclient additionalProperties: packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}' diff --git a/bin/configs/unmaintained/csharp-netcore-OpenAPIClient-net47.yaml b/bin/configs/unmaintained/csharp-netcore-OpenAPIClient-net47.yaml index 35e90e8db71..157bd41e788 100644 --- a/bin/configs/unmaintained/csharp-netcore-OpenAPIClient-net47.yaml +++ b/bin/configs/unmaintained/csharp-netcore-OpenAPIClient-net47.yaml @@ -1,8 +1,8 @@ # for .net standard generatorName: csharp-netcore outputDir: samples/client/petstore/csharp-netcore/OpenAPIClient-net47 -inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml -templateDir: modules/openapi-generator/src/main/resources/csharp-netcore +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/csharp-netcore additionalProperties: packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}' useCompareNetObjects: true diff --git a/bin/configs/unmaintained/csharp-netcore-OpenAPIClient-net50.yaml b/bin/configs/unmaintained/csharp-netcore-OpenAPIClient-net50.yaml index 9036f89e027..4175ccd9ab1 100644 --- a/bin/configs/unmaintained/csharp-netcore-OpenAPIClient-net50.yaml +++ b/bin/configs/unmaintained/csharp-netcore-OpenAPIClient-net50.yaml @@ -1,8 +1,8 @@ # for .net standard generatorName: csharp-netcore outputDir: samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0 -inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml -templateDir: modules/openapi-generator/src/main/resources/csharp-netcore +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/csharp-netcore additionalProperties: packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}' useCompareNetObjects: true diff --git a/bin/configs/unmaintained/csharp-netcore-OpenAPIClient.yaml b/bin/configs/unmaintained/csharp-netcore-OpenAPIClient.yaml index 16bf7675519..09a33df345a 100644 --- a/bin/configs/unmaintained/csharp-netcore-OpenAPIClient.yaml +++ b/bin/configs/unmaintained/csharp-netcore-OpenAPIClient.yaml @@ -1,8 +1,8 @@ # for .net standard generatorName: csharp-netcore outputDir: samples/client/petstore/csharp-netcore/OpenAPIClient -inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml -templateDir: modules/openapi-generator/src/main/resources/csharp-netcore +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/csharp-netcore additionalProperties: packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}' useCompareNetObjects: true diff --git a/bin/configs/unmaintained/csharp-netcore-OpenAPIClientCore.yaml b/bin/configs/unmaintained/csharp-netcore-OpenAPIClientCore.yaml index bcdecbc653b..6fdb72b7bb6 100644 --- a/bin/configs/unmaintained/csharp-netcore-OpenAPIClientCore.yaml +++ b/bin/configs/unmaintained/csharp-netcore-OpenAPIClientCore.yaml @@ -1,7 +1,7 @@ generatorName: csharp-netcore outputDir: samples/client/petstore/csharp-netcore/OpenAPIClientCore -inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml -templateDir: modules/openapi-generator/src/main/resources/csharp-netcore +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/csharp-netcore additionalProperties: packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}' targetFramework: netcoreapp3.1 diff --git a/bin/configs/unmaintained/csharp-netcore-OpenAPIClientCoreAndNet47.yaml b/bin/configs/unmaintained/csharp-netcore-OpenAPIClientCoreAndNet47.yaml index 45750b9f03e..4627abdea58 100644 --- a/bin/configs/unmaintained/csharp-netcore-OpenAPIClientCoreAndNet47.yaml +++ b/bin/configs/unmaintained/csharp-netcore-OpenAPIClientCoreAndNet47.yaml @@ -1,7 +1,7 @@ generatorName: csharp-netcore outputDir: samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47 -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/csharp-netcore +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/csharp-netcore additionalProperties: packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}' targetFramework: netstandard2.1;net47 diff --git a/bin/configs/unmaintained/csharp-netcore-OpenAPIClient_ConditionalSerialization.yaml b/bin/configs/unmaintained/csharp-netcore-OpenAPIClient_ConditionalSerialization.yaml index cc75d89db86..2a1db299aed 100644 --- a/bin/configs/unmaintained/csharp-netcore-OpenAPIClient_ConditionalSerialization.yaml +++ b/bin/configs/unmaintained/csharp-netcore-OpenAPIClient_ConditionalSerialization.yaml @@ -1,8 +1,8 @@ # for .net standard generatorName: csharp-netcore outputDir: samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization -inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml -templateDir: modules/openapi-generator/src/main/resources/csharp-netcore +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/csharp-netcore additionalProperties: packageGuid: '{fa96c953-af24-457d-8a01-f2fd2a7547a9}' useCompareNetObjects: true diff --git a/bin/configs/unmaintained/csharp-netcore-complex-files.yaml b/bin/configs/unmaintained/csharp-netcore-complex-files.yaml index b67cece1ad1..a94a2c6c6f1 100644 --- a/bin/configs/unmaintained/csharp-netcore-complex-files.yaml +++ b/bin/configs/unmaintained/csharp-netcore-complex-files.yaml @@ -1,7 +1,7 @@ generatorName: csharp-netcore outputDir: samples/client/others/csharp-netcore-complex-files -inputSpec: modules/openapi-generator/src/test/resources/3_0/form-multipart-binary-array.yaml -templateDir: modules/openapi-generator/src/main/resources/csharp-netcore +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/form-multipart-binary-array.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/csharp-netcore additionalProperties: packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}' targetFramework: netstandard2.0 diff --git a/bin/configs/unmaintained/csharp-netcore-functions.yaml b/bin/configs/unmaintained/csharp-netcore-functions.yaml index 6d7e9a691b0..7bba90b74f8 100644 --- a/bin/configs/unmaintained/csharp-netcore-functions.yaml +++ b/bin/configs/unmaintained/csharp-netcore-functions.yaml @@ -1,6 +1,6 @@ generatorName: csharp-netcore-functions outputDir: samples/client/petstore/csharp-netcore-functions -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/csharp-netcore-functions +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/csharp-netcore-functions #additionalProperties: # packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}' diff --git a/bin/configs/unmaintained/cwiki.yaml b/bin/configs/unmaintained/cwiki.yaml index bc17eb304fe..cb9631cd9c9 100644 --- a/bin/configs/unmaintained/cwiki.yaml +++ b/bin/configs/unmaintained/cwiki.yaml @@ -1,4 +1,4 @@ generatorName: cwiki outputDir: samples/documentation/cwiki -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/confluenceWikiDocs +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/confluenceWikiDocs diff --git a/bin/configs/unmaintained/dart-dio-oneof-polymorphism-and-inheritance.yaml b/bin/configs/unmaintained/dart-dio-oneof-polymorphism-and-inheritance.yaml index d3d5b622bc0..08218863b81 100644 --- a/bin/configs/unmaintained/dart-dio-oneof-polymorphism-and-inheritance.yaml +++ b/bin/configs/unmaintained/dart-dio-oneof-polymorphism-and-inheritance.yaml @@ -1,7 +1,7 @@ generatorName: dart-dio outputDir: samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance -inputSpec: modules/openapi-generator/src/test/resources/3_0/oneof_polymorphism_and_inheritance.yaml -templateDir: modules/openapi-generator/src/main/resources/dart/libraries/dio +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/oneof_polymorphism_and_inheritance.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/dart/libraries/dio typeMappings: Client: "ModelClient" File: "ModelFile" diff --git a/bin/configs/unmaintained/dart-dio-oneof-primitive.yaml b/bin/configs/unmaintained/dart-dio-oneof-primitive.yaml index 29130b5dc46..081aae311d9 100644 --- a/bin/configs/unmaintained/dart-dio-oneof-primitive.yaml +++ b/bin/configs/unmaintained/dart-dio-oneof-primitive.yaml @@ -1,7 +1,7 @@ generatorName: dart-dio outputDir: samples/openapi3/client/petstore/dart-dio/oneof_primitive -inputSpec: modules/openapi-generator/src/test/resources/3_0/oneOf_primitive.yaml -templateDir: modules/openapi-generator/src/main/resources/dart/libraries/dio +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/oneOf_primitive.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/dart/libraries/dio typeMappings: Client: "ModelClient" File: "ModelFile" diff --git a/bin/configs/unmaintained/dart-dio-oneof.yaml b/bin/configs/unmaintained/dart-dio-oneof.yaml index 865312cdd49..8bb84ee1781 100644 --- a/bin/configs/unmaintained/dart-dio-oneof.yaml +++ b/bin/configs/unmaintained/dart-dio-oneof.yaml @@ -1,7 +1,7 @@ generatorName: dart-dio outputDir: samples/openapi3/client/petstore/dart-dio/oneof -inputSpec: modules/openapi-generator/src/test/resources/3_0/oneOf.yaml -templateDir: modules/openapi-generator/src/main/resources/dart/libraries/dio +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/oneOf.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/dart/libraries/dio typeMappings: Client: "ModelClient" File: "ModelFile" diff --git a/bin/configs/unmaintained/dart-dio-petstore-client-lib-fake-json_serializable.yaml b/bin/configs/unmaintained/dart-dio-petstore-client-lib-fake-json_serializable.yaml index 9809a61d7a0..750da402c7e 100644 --- a/bin/configs/unmaintained/dart-dio-petstore-client-lib-fake-json_serializable.yaml +++ b/bin/configs/unmaintained/dart-dio-petstore-client-lib-fake-json_serializable.yaml @@ -1,7 +1,7 @@ generatorName: dart-dio outputDir: samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/dart/libraries/dio +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/dart/libraries/dio typeMappings: Client: "ModelClient" File: "ModelFile" diff --git a/bin/configs/unmaintained/dart-dio-petstore-client-lib-fake.yaml b/bin/configs/unmaintained/dart-dio-petstore-client-lib-fake.yaml index 3faed9515af..093d923f4f8 100644 --- a/bin/configs/unmaintained/dart-dio-petstore-client-lib-fake.yaml +++ b/bin/configs/unmaintained/dart-dio-petstore-client-lib-fake.yaml @@ -1,7 +1,7 @@ generatorName: dart-dio outputDir: samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/dart/libraries/dio +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/dart/libraries/dio typeMappings: Client: "ModelClient" File: "ModelFile" diff --git a/bin/configs/unmaintained/dart-petstore-client-lib-fake.yaml b/bin/configs/unmaintained/dart-petstore-client-lib-fake.yaml index d48cd8038b7..1aba00c8bf9 100644 --- a/bin/configs/unmaintained/dart-petstore-client-lib-fake.yaml +++ b/bin/configs/unmaintained/dart-petstore-client-lib-fake.yaml @@ -1,7 +1,7 @@ generatorName: dart outputDir: samples/openapi3/client/petstore/dart2/petstore_client_lib_fake -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/dart2 +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/dart2 typeMappings: Client: "ModelClient" File: "ModelFile" diff --git a/bin/configs/unmaintained/dart-petstore-client-lib.yaml b/bin/configs/unmaintained/dart-petstore-client-lib.yaml index 8b4a6deefd7..ad19f15a204 100644 --- a/bin/configs/unmaintained/dart-petstore-client-lib.yaml +++ b/bin/configs/unmaintained/dart-petstore-client-lib.yaml @@ -1,6 +1,6 @@ generatorName: dart outputDir: samples/openapi3/client/petstore/dart2/petstore_client_lib -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/dart2 +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/dart2 additionalProperties: hideGenerationTimestamp: "true" diff --git a/bin/configs/unmaintained/dynamic-html.yaml b/bin/configs/unmaintained/dynamic-html.yaml index 6f32574d95a..3ee83cd9b51 100644 --- a/bin/configs/unmaintained/dynamic-html.yaml +++ b/bin/configs/unmaintained/dynamic-html.yaml @@ -1,4 +1,4 @@ generatorName: dynamic-html outputDir: samples/documentation/dynamic-html -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/openapi-static +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/openapi-static diff --git a/bin/configs/unmaintained/eiffel.yaml b/bin/configs/unmaintained/eiffel.yaml index 53f9468802d..9d1d076e70d 100644 --- a/bin/configs/unmaintained/eiffel.yaml +++ b/bin/configs/unmaintained/eiffel.yaml @@ -1,4 +1,4 @@ generatorName: eiffel outputDir: samples/client/petstore/eiffel -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/Eiffel +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/Eiffel diff --git a/bin/configs/unmaintained/elixir.yaml b/bin/configs/unmaintained/elixir.yaml index a287f44705b..970b6b8eb37 100644 --- a/bin/configs/unmaintained/elixir.yaml +++ b/bin/configs/unmaintained/elixir.yaml @@ -1,6 +1,6 @@ generatorName: elixir outputDir: samples/client/petstore/elixir -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/elixir +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/elixir additionalProperties: invokerPackage: OpenapiPetstore diff --git a/bin/configs/unmaintained/elm.yaml b/bin/configs/unmaintained/elm.yaml index b826d487ddd..c3e9288c5d1 100644 --- a/bin/configs/unmaintained/elm.yaml +++ b/bin/configs/unmaintained/elm.yaml @@ -1,4 +1,4 @@ generatorName: elm outputDir: samples/openapi3/client/elm -inputSpec: modules/openapi-generator/src/test/resources/3_0/elm.yaml -templateDir: modules/openapi-generator/src/main/resources/elm +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/elm.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/elm diff --git a/bin/configs/unmaintained/erlang-client.yaml b/bin/configs/unmaintained/erlang-client.yaml index 27f1bdefe89..70e980dac86 100644 --- a/bin/configs/unmaintained/erlang-client.yaml +++ b/bin/configs/unmaintained/erlang-client.yaml @@ -1,6 +1,6 @@ generatorName: erlang-client outputDir: samples/client/petstore/erlang-client -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/erlang-client +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/erlang-client additionalProperties: packageName: petstore diff --git a/bin/configs/unmaintained/erlang-proper.yaml b/bin/configs/unmaintained/erlang-proper.yaml index efde38060cd..bc77a82260b 100644 --- a/bin/configs/unmaintained/erlang-proper.yaml +++ b/bin/configs/unmaintained/erlang-proper.yaml @@ -1,6 +1,6 @@ generatorName: erlang-proper outputDir: samples/client/petstore/erlang-proper -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/erlang-proper +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/erlang-proper additionalProperties: packageName: petstore diff --git a/bin/configs/unmaintained/erlang-server.yaml b/bin/configs/unmaintained/erlang-server.yaml index 043ec4ffa73..84331514f03 100644 --- a/bin/configs/unmaintained/erlang-server.yaml +++ b/bin/configs/unmaintained/erlang-server.yaml @@ -1,4 +1,4 @@ generatorName: erlang-server outputDir: samples/server/petstore/erlang-server -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/erlang-server +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/erlang-server diff --git a/bin/configs/unmaintained/fsharp-functions.yaml b/bin/configs/unmaintained/fsharp-functions.yaml index c96a1707156..7eb582e0826 100644 --- a/bin/configs/unmaintained/fsharp-functions.yaml +++ b/bin/configs/unmaintained/fsharp-functions.yaml @@ -1,4 +1,4 @@ generatorName: fsharp-functions outputDir: samples/server/petstore/fsharp-functions -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/fsharp-functions-server +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/fsharp-functions-server diff --git a/bin/configs/unmaintained/fsharp-giraffe-server-fsharp-giraffe.yaml b/bin/configs/unmaintained/fsharp-giraffe-server-fsharp-giraffe.yaml index 88882603304..6f24cd879ac 100644 --- a/bin/configs/unmaintained/fsharp-giraffe-server-fsharp-giraffe.yaml +++ b/bin/configs/unmaintained/fsharp-giraffe-server-fsharp-giraffe.yaml @@ -1,4 +1,4 @@ generatorName: fsharp-giraffe-server outputDir: samples/server/petstore/fsharp-giraffe -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/fsharp-giraffe-server +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/fsharp-giraffe-server diff --git a/bin/configs/unmaintained/go-echo-server-petstore-new.yaml b/bin/configs/unmaintained/go-echo-server-petstore-new.yaml index bfc2e946c58..12b68c16170 100644 --- a/bin/configs/unmaintained/go-echo-server-petstore-new.yaml +++ b/bin/configs/unmaintained/go-echo-server-petstore-new.yaml @@ -1,6 +1,6 @@ generatorName: go-echo-server outputDir: samples/server/petstore/go-echo-server -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/go-echo-server +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/go-echo-server additionalProperties: hideGenerationTimestamp: "true" diff --git a/bin/configs/unmaintained/go-extensions-x-auth-id-alias.yaml b/bin/configs/unmaintained/go-extensions-x-auth-id-alias.yaml index 5c3ab87b367..4de08876f17 100644 --- a/bin/configs/unmaintained/go-extensions-x-auth-id-alias.yaml +++ b/bin/configs/unmaintained/go-extensions-x-auth-id-alias.yaml @@ -1,6 +1,6 @@ generatorName: go outputDir: samples/openapi3/client/extensions/x-auth-id-alias/go-experimental -inputSpec: modules/openapi-generator/src/test/resources/3_0/extensions/x-auth-id-alias.yaml -templateDir: modules/openapi-generator/src/main/resources/go +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/extensions/x-auth-id-alias.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/go additionalProperties: packageName: x_auth_id_alias diff --git a/bin/configs/unmaintained/go-gin-server-go-gin-api-server.yaml b/bin/configs/unmaintained/go-gin-server-go-gin-api-server.yaml index 7d9932bd14f..3f8cf2434f4 100644 --- a/bin/configs/unmaintained/go-gin-server-go-gin-api-server.yaml +++ b/bin/configs/unmaintained/go-gin-server-go-gin-api-server.yaml @@ -1,7 +1,7 @@ generatorName: go-gin-server outputDir: samples/server/petstore/go-gin-api-server -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/go-gin-server +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/go-gin-server additionalProperties: hideGenerationTimestamp: "true" packageName: petstoreserver diff --git a/bin/configs/unmaintained/go-petstore-oas2.yaml b/bin/configs/unmaintained/go-petstore-oas2.yaml index 18cb77a9c25..a0ce5e6beca 100644 --- a/bin/configs/unmaintained/go-petstore-oas2.yaml +++ b/bin/configs/unmaintained/go-petstore-oas2.yaml @@ -1,7 +1,7 @@ generatorName: go outputDir: samples/client/petstore/go/go-petstore -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/go +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/go additionalProperties: packageName: petstore generateInterfaces: true diff --git a/bin/configs/unmaintained/go-petstore.yaml b/bin/configs/unmaintained/go-petstore.yaml index 3ce286ca806..3536b92a700 100644 --- a/bin/configs/unmaintained/go-petstore.yaml +++ b/bin/configs/unmaintained/go-petstore.yaml @@ -1,7 +1,7 @@ generatorName: go outputDir: samples/openapi3/client/petstore/go/go-petstore -inputSpec: modules/openapi-generator/src/test/resources/3_0/go/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml -templateDir: modules/openapi-generator/src/main/resources/go +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/go/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/go additionalProperties: enumClassPrefix: "true" packageName: petstore diff --git a/bin/configs/unmaintained/go-server-chi-api-server.yaml b/bin/configs/unmaintained/go-server-chi-api-server.yaml index 16db86a3d62..e3e80283648 100644 --- a/bin/configs/unmaintained/go-server-chi-api-server.yaml +++ b/bin/configs/unmaintained/go-server-chi-api-server.yaml @@ -1,7 +1,7 @@ generatorName: go-server outputDir: samples/server/petstore/go-chi-server -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/go-server +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/go-server additionalProperties: hideGenerationTimestamp: "true" packageName: petstoreserver diff --git a/bin/configs/unmaintained/go-server-go-api-server.yaml b/bin/configs/unmaintained/go-server-go-api-server.yaml index 7fb761639b2..aadddd4c84d 100644 --- a/bin/configs/unmaintained/go-server-go-api-server.yaml +++ b/bin/configs/unmaintained/go-server-go-api-server.yaml @@ -1,7 +1,7 @@ generatorName: go-server outputDir: samples/server/petstore/go-api-server -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/go-server +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/go-server additionalProperties: hideGenerationTimestamp: "true" packageName: petstoreserver diff --git a/bin/configs/unmaintained/go-server-required.yaml b/bin/configs/unmaintained/go-server-required.yaml index fd90bbbeb83..c6eaf8deaa7 100644 --- a/bin/configs/unmaintained/go-server-required.yaml +++ b/bin/configs/unmaintained/go-server-required.yaml @@ -1,7 +1,7 @@ generatorName: go-server outputDir: samples/server/petstore/go-server-required -inputSpec: modules/openapi-generator/src/test/resources/3_0/server-required.yaml -templateDir: modules/openapi-generator/src/main/resources/go-server +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/server-required.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/go-server additionalProperties: hideGenerationTimestamp: "true" packageName: petstoreserver diff --git a/bin/configs/unmaintained/graphql-nodejs-express-server.yaml b/bin/configs/unmaintained/graphql-nodejs-express-server.yaml index a26f6ad4448..1bb81790331 100644 --- a/bin/configs/unmaintained/graphql-nodejs-express-server.yaml +++ b/bin/configs/unmaintained/graphql-nodejs-express-server.yaml @@ -1,6 +1,6 @@ generatorName: graphql-nodejs-express-server outputDir: samples/server/petstore/graphql-nodejs-express-server -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/graphql-nodejs-express-server +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/graphql-nodejs-express-server additionalProperties: packageName: petstore diff --git a/bin/configs/unmaintained/graphql-schema.yaml b/bin/configs/unmaintained/graphql-schema.yaml index 2b019d74f63..c0507ee5730 100644 --- a/bin/configs/unmaintained/graphql-schema.yaml +++ b/bin/configs/unmaintained/graphql-schema.yaml @@ -1,6 +1,6 @@ generatorName: graphql-schema outputDir: samples/config/petstore/graphql-schema -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/graphql-schema +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/graphql-schema additionalProperties: packageName: petstore diff --git a/bin/configs/unmaintained/groovy.yaml b/bin/configs/unmaintained/groovy.yaml index df745d168e1..9875d97b5b9 100644 --- a/bin/configs/unmaintained/groovy.yaml +++ b/bin/configs/unmaintained/groovy.yaml @@ -1,6 +1,6 @@ generatorName: groovy outputDir: samples/client/petstore/groovy -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/Groovy +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/Groovy additionalProperties: hideGenerationTimestamp: "true" diff --git a/bin/configs/unmaintained/haskell-http-client.yaml b/bin/configs/unmaintained/haskell-http-client.yaml index 1f2dc62fe60..01142c57ae3 100644 --- a/bin/configs/unmaintained/haskell-http-client.yaml +++ b/bin/configs/unmaintained/haskell-http-client.yaml @@ -1,6 +1,6 @@ generatorName: haskell-http-client outputDir: samples/client/petstore/haskell-http-client -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/haskell-http-client +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/haskell-http-client additionalProperties: queryExtraUnreserved: '' diff --git a/bin/configs/unmaintained/haskell-servant.yaml b/bin/configs/unmaintained/haskell-servant.yaml index 1419e549097..10eb19c1dda 100644 --- a/bin/configs/unmaintained/haskell-servant.yaml +++ b/bin/configs/unmaintained/haskell-servant.yaml @@ -1,4 +1,4 @@ generatorName: haskell outputDir: samples/server/petstore/haskell-servant -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/haskell-servant +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/haskell-servant diff --git a/bin/configs/unmaintained/haskell-yesod-petstore-new.yaml b/bin/configs/unmaintained/haskell-yesod-petstore-new.yaml index f7ae3890cdf..d413bff6dbe 100644 --- a/bin/configs/unmaintained/haskell-yesod-petstore-new.yaml +++ b/bin/configs/unmaintained/haskell-yesod-petstore-new.yaml @@ -1,6 +1,6 @@ generatorName: haskell-yesod outputDir: samples/server/petstore/haskell-yesod -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/haskell-yesod +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/haskell-yesod additionalProperties: hideGenerationTimestamp: "true" diff --git a/bin/configs/unmaintained/html.md.yaml b/bin/configs/unmaintained/html.md.yaml index 23980658eff..c77dcd5182f 100644 --- a/bin/configs/unmaintained/html.md.yaml +++ b/bin/configs/unmaintained/html.md.yaml @@ -1,4 +1,4 @@ generatorName: html outputDir: samples/documentation/html.md -inputSpec: modules/openapi-generator/src/test/resources/2_0/markdown.yaml -templateDir: modules/openapi-generator/src/main/resources/htmlDocs +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/markdown.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/htmlDocs diff --git a/bin/configs/unmaintained/html.yaml b/bin/configs/unmaintained/html.yaml index ea24dcbd4b9..eabeb902223 100644 --- a/bin/configs/unmaintained/html.yaml +++ b/bin/configs/unmaintained/html.yaml @@ -1,4 +1,4 @@ generatorName: html outputDir: samples/documentation/html -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/htmlDocs +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/htmlDocs diff --git a/bin/configs/unmaintained/html2.yaml b/bin/configs/unmaintained/html2.yaml index 09022fd5fbc..873d8af5e56 100644 --- a/bin/configs/unmaintained/html2.yaml +++ b/bin/configs/unmaintained/html2.yaml @@ -1,6 +1,6 @@ generatorName: html2 outputDir: samples/documentation/html2 -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/htmlDocs2 +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/htmlDocs2 additionalProperties: hideGenerationTimestamp: "true" diff --git a/bin/configs/unmaintained/java-apache-httpclient.yaml b/bin/configs/unmaintained/java-apache-httpclient.yaml index 5696973f86f..3d550b322f1 100644 --- a/bin/configs/unmaintained/java-apache-httpclient.yaml +++ b/bin/configs/unmaintained/java-apache-httpclient.yaml @@ -1,8 +1,8 @@ generatorName: java outputDir: samples/client/petstore/java/apache-httpclient library: apache-httpclient -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/Java +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/Java additionalProperties: artifactId: petstore-apache-httpclient hideGenerationTimestamp: true diff --git a/bin/configs/unmaintained/java-camel-petstore-new.yaml b/bin/configs/unmaintained/java-camel-petstore-new.yaml index 9b28eaf1ee7..60f71c541cb 100644 --- a/bin/configs/unmaintained/java-camel-petstore-new.yaml +++ b/bin/configs/unmaintained/java-camel-petstore-new.yaml @@ -1,7 +1,7 @@ generatorName: java-camel outputDir: samples/server/petstore/java-camel -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/java-camel-server +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/java-camel-server additionalProperties: oas3: "true" hideGenerationTimestamp: true diff --git a/bin/configs/unmaintained/java-feign-no-nullable.yaml b/bin/configs/unmaintained/java-feign-no-nullable.yaml index 05453b419dc..0dd1ca8733c 100644 --- a/bin/configs/unmaintained/java-feign-no-nullable.yaml +++ b/bin/configs/unmaintained/java-feign-no-nullable.yaml @@ -1,8 +1,8 @@ generatorName: java outputDir: samples/client/petstore/java/feign-no-nullable library: feign -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/Java +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/Java additionalProperties: booleanGetterPrefix: is artifactId: petstore-feign-no-nullable diff --git a/bin/configs/unmaintained/java-feign.yaml b/bin/configs/unmaintained/java-feign.yaml index c27e7abaaab..149c5ba3e84 100644 --- a/bin/configs/unmaintained/java-feign.yaml +++ b/bin/configs/unmaintained/java-feign.yaml @@ -1,8 +1,8 @@ generatorName: java outputDir: samples/client/petstore/java/feign library: feign -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/Java +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/Java additionalProperties: booleanGetterPrefix: is artifactId: petstore-feign diff --git a/bin/configs/unmaintained/java-google-api-client.yaml b/bin/configs/unmaintained/java-google-api-client.yaml index 7fed4f4fd38..e6c14928eb2 100644 --- a/bin/configs/unmaintained/java-google-api-client.yaml +++ b/bin/configs/unmaintained/java-google-api-client.yaml @@ -1,8 +1,8 @@ generatorName: java outputDir: samples/client/petstore/java/google-api-client library: google-api-client -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/Java +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/Java additionalProperties: artifactId: petstore-google-api-client hideGenerationTimestamp: "true" diff --git a/bin/configs/unmaintained/java-inflector.yaml b/bin/configs/unmaintained/java-inflector.yaml index d7a88695aca..7414833d20b 100644 --- a/bin/configs/unmaintained/java-inflector.yaml +++ b/bin/configs/unmaintained/java-inflector.yaml @@ -1,6 +1,6 @@ generatorName: java-inflector outputDir: samples/server/petstore/java-inflector -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaInflector +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaInflector additionalProperties: hideGenerationTimestamp: "true" diff --git a/bin/configs/unmaintained/java-jersey1.yaml b/bin/configs/unmaintained/java-jersey1.yaml index 26cf1f0e5c1..f9f2445fe79 100644 --- a/bin/configs/unmaintained/java-jersey1.yaml +++ b/bin/configs/unmaintained/java-jersey1.yaml @@ -1,8 +1,8 @@ generatorName: java outputDir: samples/client/petstore/java/jersey1 library: jersey1 -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/Java +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/Java additionalProperties: hideGenerationTimestamp: "true" artifactId: petstore-java-client-jersey1 diff --git a/bin/configs/unmaintained/java-jersey2-8-oas2.yaml b/bin/configs/unmaintained/java-jersey2-8-oas2.yaml index 4d3253e23ee..e7821c2fe3c 100644 --- a/bin/configs/unmaintained/java-jersey2-8-oas2.yaml +++ b/bin/configs/unmaintained/java-jersey2-8-oas2.yaml @@ -1,8 +1,8 @@ generatorName: java outputDir: samples/client/petstore/java/jersey2-java8 library: jersey2 -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/Java +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/Java additionalProperties: artifactId: petstore-jersey2-java8 hideGenerationTimestamp: true diff --git a/bin/configs/unmaintained/java-jersey2-8.yaml b/bin/configs/unmaintained/java-jersey2-8.yaml index ca0452d33e3..48c83ab0b3b 100644 --- a/bin/configs/unmaintained/java-jersey2-8.yaml +++ b/bin/configs/unmaintained/java-jersey2-8.yaml @@ -1,8 +1,8 @@ generatorName: java outputDir: samples/openapi3/client/petstore/java/jersey2-java8 library: jersey2 -inputSpec: modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml -templateDir: modules/openapi-generator/src/main/resources/Java +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/Java additionalProperties: artifactId: petstore-openapi3-jersey2-java8 hideGenerationTimestamp: true diff --git a/bin/configs/unmaintained/java-jersey2-extensions-x-auth-id-alias.yaml b/bin/configs/unmaintained/java-jersey2-extensions-x-auth-id-alias.yaml index f651475259d..d95df0ef5c6 100644 --- a/bin/configs/unmaintained/java-jersey2-extensions-x-auth-id-alias.yaml +++ b/bin/configs/unmaintained/java-jersey2-extensions-x-auth-id-alias.yaml @@ -1,8 +1,8 @@ generatorName: java outputDir: samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8 library: jersey2 -inputSpec: modules/openapi-generator/src/test/resources/3_0/extensions/x-auth-id-alias.yaml -templateDir: modules/openapi-generator/src/main/resources/Java +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/extensions/x-auth-id-alias.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/Java additionalProperties: artifactId: openapi3-extensions-x-auth-id-alias-jersey2-java8 hideGenerationTimestamp: true diff --git a/bin/configs/unmaintained/java-jersey2-java8-localdatetime.yaml b/bin/configs/unmaintained/java-jersey2-java8-localdatetime.yaml index efa977d08a3..dfe5fd4c74c 100644 --- a/bin/configs/unmaintained/java-jersey2-java8-localdatetime.yaml +++ b/bin/configs/unmaintained/java-jersey2-java8-localdatetime.yaml @@ -1,8 +1,8 @@ generatorName: java outputDir: samples/client/petstore/java/jersey2-java8-localdatetime library: jersey2 -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/Java +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/Java additionalProperties: artifactId: petstore-jersey2-java8-localdatetime hideGenerationTimestamp: "true" diff --git a/bin/configs/unmaintained/java-jersey2-special-characters.yaml b/bin/configs/unmaintained/java-jersey2-special-characters.yaml index c73b70cc36c..5d50633f744 100644 --- a/bin/configs/unmaintained/java-jersey2-special-characters.yaml +++ b/bin/configs/unmaintained/java-jersey2-special-characters.yaml @@ -1,8 +1,8 @@ generatorName: java outputDir: samples/openapi3/client/petstore/java/jersey2-java8-special-characters library: jersey2 -inputSpec: modules/openapi-generator/src/test/resources/3_0/schema-with-special-characters.yaml -templateDir: modules/openapi-generator/src/main/resources/Java +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/schema-with-special-characters.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/Java additionalProperties: artifactId: petstore-openapi3-jersey2-java8-special-characters hideGenerationTimestamp: true diff --git a/bin/configs/unmaintained/java-jersey3.yaml b/bin/configs/unmaintained/java-jersey3.yaml index 50ea3258eca..77e4f0135bc 100644 --- a/bin/configs/unmaintained/java-jersey3.yaml +++ b/bin/configs/unmaintained/java-jersey3.yaml @@ -1,8 +1,8 @@ generatorName: java outputDir: samples/client/petstore/java/jersey3 library: jersey3 -inputSpec: modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml -templateDir: modules/openapi-generator/src/main/resources/Java +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/Java additionalProperties: artifactId: petstore-jersey3 hideGenerationTimestamp: true diff --git a/bin/configs/unmaintained/java-micronaut-client.yaml b/bin/configs/unmaintained/java-micronaut-client.yaml index 247c139afb4..9516fe30078 100644 --- a/bin/configs/unmaintained/java-micronaut-client.yaml +++ b/bin/configs/unmaintained/java-micronaut-client.yaml @@ -1,6 +1,6 @@ generatorName: java-micronaut-client outputDir: samples/client/petstore/java-micronaut-client/ -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml additionalProperties: artifactId: petstore-micronaut hideGenerationTimestamp: "true" diff --git a/bin/configs/unmaintained/java-micronaut-server.yaml b/bin/configs/unmaintained/java-micronaut-server.yaml index 15b9ba58b32..5aa2e2417a4 100644 --- a/bin/configs/unmaintained/java-micronaut-server.yaml +++ b/bin/configs/unmaintained/java-micronaut-server.yaml @@ -1,6 +1,6 @@ generatorName: java-micronaut-server outputDir: samples/server/petstore/java-micronaut-server/ -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml additionalProperties: artifactId: petstore-micronaut-server hideGenerationTimestamp: "true" diff --git a/bin/configs/unmaintained/java-microprofile-rest-client-3.0.yaml b/bin/configs/unmaintained/java-microprofile-rest-client-3.0.yaml index e0a2c0a3178..143aebfe9d2 100644 --- a/bin/configs/unmaintained/java-microprofile-rest-client-3.0.yaml +++ b/bin/configs/unmaintained/java-microprofile-rest-client-3.0.yaml @@ -1,8 +1,8 @@ generatorName: java outputDir: samples/client/petstore/java/microprofile-rest-client-3.0 library: microprofile -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/Java +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/Java additionalProperties: artifactId: microprofile-rest-client-3 configKey: petstore diff --git a/bin/configs/unmaintained/java-microprofile-rest-client.yaml b/bin/configs/unmaintained/java-microprofile-rest-client.yaml index 384a6aa7f30..8a2bbe58b7b 100644 --- a/bin/configs/unmaintained/java-microprofile-rest-client.yaml +++ b/bin/configs/unmaintained/java-microprofile-rest-client.yaml @@ -1,8 +1,8 @@ generatorName: java outputDir: samples/client/petstore/java/microprofile-rest-client library: microprofile -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/Java +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/Java additionalProperties: artifactId: microprofile-rest-client configKey: petstore diff --git a/bin/configs/unmaintained/java-msf4j.yaml b/bin/configs/unmaintained/java-msf4j.yaml index 71c5d117d83..79a97dd6bfe 100644 --- a/bin/configs/unmaintained/java-msf4j.yaml +++ b/bin/configs/unmaintained/java-msf4j.yaml @@ -1,7 +1,7 @@ generatorName: java-msf4j outputDir: samples/server/petstore/java-msf4j -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/java-msf4j-server +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/java-msf4j-server additionalProperties: hideGenerationTimestamp: "true" artifactId: java-msf4j-server diff --git a/bin/configs/unmaintained/java-native-async.yaml b/bin/configs/unmaintained/java-native-async.yaml index eb95d524a29..8a7911e2812 100644 --- a/bin/configs/unmaintained/java-native-async.yaml +++ b/bin/configs/unmaintained/java-native-async.yaml @@ -1,8 +1,8 @@ generatorName: java outputDir: samples/client/petstore/java/native-async library: native -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/Java +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/Java additionalProperties: artifactId: petstore-native hideGenerationTimestamp: "true" diff --git a/bin/configs/unmaintained/java-native.yaml b/bin/configs/unmaintained/java-native.yaml index 14259765250..25a7ee5356a 100644 --- a/bin/configs/unmaintained/java-native.yaml +++ b/bin/configs/unmaintained/java-native.yaml @@ -1,8 +1,8 @@ generatorName: java outputDir: samples/client/petstore/java/native library: native -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/Java +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/Java additionalProperties: artifactId: petstore-native hideGenerationTimestamp: "true" diff --git a/bin/configs/unmaintained/java-okhttp-gson-dynamicOperations.yaml b/bin/configs/unmaintained/java-okhttp-gson-dynamicOperations.yaml index 751ce2e992c..05d16a30031 100644 --- a/bin/configs/unmaintained/java-okhttp-gson-dynamicOperations.yaml +++ b/bin/configs/unmaintained/java-okhttp-gson-dynamicOperations.yaml @@ -1,8 +1,8 @@ generatorName: java outputDir: samples/client/petstore/java/okhttp-gson-dynamicOperations library: okhttp-gson -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/Java +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/Java additionalProperties: artifactId: petstore-okhttp-gson-dynamicoperations hideGenerationTimestamp: "true" diff --git a/bin/configs/unmaintained/java-okhttp-gson-group-parameter.yaml b/bin/configs/unmaintained/java-okhttp-gson-group-parameter.yaml index 936f9f0a4b0..eae0c9e0a0f 100644 --- a/bin/configs/unmaintained/java-okhttp-gson-group-parameter.yaml +++ b/bin/configs/unmaintained/java-okhttp-gson-group-parameter.yaml @@ -1,8 +1,8 @@ generatorName: java outputDir: samples/client/petstore/java/okhttp-gson-group-parameter library: okhttp-gson -inputSpec: modules/openapi-generator/src/test/resources/3_0/java/petstore-group-parameter.yaml -templateDir: modules/openapi-generator/src/main/resources/Java +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/java/petstore-group-parameter.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/Java additionalProperties: artifactId: petstore-okhttp-gson-group-parameter hideGenerationTimestamp: "true" diff --git a/bin/configs/unmaintained/java-okhttp-gson-parcelableModel.yaml b/bin/configs/unmaintained/java-okhttp-gson-parcelableModel.yaml index c9cbb2008b1..db9e1ffe5dd 100644 --- a/bin/configs/unmaintained/java-okhttp-gson-parcelableModel.yaml +++ b/bin/configs/unmaintained/java-okhttp-gson-parcelableModel.yaml @@ -1,8 +1,8 @@ generatorName: java outputDir: samples/client/petstore/java/okhttp-gson-parcelableModel library: okhttp-gson -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/Java +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/Java additionalProperties: parcelableModel: "true" artifactId: petstore-okhttp-gson-parcelableModel diff --git a/bin/configs/unmaintained/java-okhttp-gson-streaming.yaml b/bin/configs/unmaintained/java-okhttp-gson-streaming.yaml index 34da56581a7..8744d0944bf 100644 --- a/bin/configs/unmaintained/java-okhttp-gson-streaming.yaml +++ b/bin/configs/unmaintained/java-okhttp-gson-streaming.yaml @@ -1,8 +1,8 @@ generatorName: java outputDir: samples/client/others/java/okhttp-gson-streaming library: okhttp-gson -inputSpec: modules/openapi-generator/src/test/resources/3_0/streaming.yaml -templateDir: modules/openapi-generator/src/main/resources/Java +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/streaming.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/Java additionalProperties: artifactId: petstore-okhttp-gson hideGenerationTimestamp: "true" diff --git a/bin/configs/unmaintained/java-okhttp-gson.yaml b/bin/configs/unmaintained/java-okhttp-gson.yaml index e138af15401..0a8198dd56a 100644 --- a/bin/configs/unmaintained/java-okhttp-gson.yaml +++ b/bin/configs/unmaintained/java-okhttp-gson.yaml @@ -1,8 +1,8 @@ generatorName: java outputDir: samples/client/petstore/java/okhttp-gson library: okhttp-gson -inputSpec: modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature-okhttp-gson.yaml -templateDir: modules/openapi-generator/src/main/resources/Java +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature-okhttp-gson.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/Java additionalProperties: artifactId: petstore-okhttp-gson hideGenerationTimestamp: "true" diff --git a/bin/configs/unmaintained/java-pkmst.yaml b/bin/configs/unmaintained/java-pkmst.yaml index 4d428c3679c..4442277bd02 100644 --- a/bin/configs/unmaintained/java-pkmst.yaml +++ b/bin/configs/unmaintained/java-pkmst.yaml @@ -1,6 +1,6 @@ generatorName: java-pkmst outputDir: samples/server/petstore/java-pkmst -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/java-pkmst +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/java-pkmst additionalProperties: hideGenerationTimestamp: "true" diff --git a/bin/configs/unmaintained/java-play-framework-api-package-override.yaml b/bin/configs/unmaintained/java-play-framework-api-package-override.yaml index 93b1d8f1788..507ed0c358c 100644 --- a/bin/configs/unmaintained/java-play-framework-api-package-override.yaml +++ b/bin/configs/unmaintained/java-play-framework-api-package-override.yaml @@ -1,7 +1,7 @@ generatorName: java-play-framework outputDir: samples/server/petstore/java-play-framework-api-package-override -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaPlayFramework +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaPlayFramework additionalProperties: hideGenerationTimestamp: "true" apiPackage: com.puppies.store.apis diff --git a/bin/configs/unmaintained/java-play-framework-async.yaml b/bin/configs/unmaintained/java-play-framework-async.yaml index 0cf9d1bca2e..1d9606b9a51 100644 --- a/bin/configs/unmaintained/java-play-framework-async.yaml +++ b/bin/configs/unmaintained/java-play-framework-async.yaml @@ -1,7 +1,7 @@ generatorName: java-play-framework outputDir: samples/server/petstore/java-play-framework-async -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaPlayFramework +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaPlayFramework additionalProperties: supportAsync: true hideGenerationTimestamp: "true" diff --git a/bin/configs/unmaintained/java-play-framework-controller-only.yaml b/bin/configs/unmaintained/java-play-framework-controller-only.yaml index 8c4ceb8afa6..6cea6da49c4 100644 --- a/bin/configs/unmaintained/java-play-framework-controller-only.yaml +++ b/bin/configs/unmaintained/java-play-framework-controller-only.yaml @@ -1,7 +1,7 @@ generatorName: java-play-framework outputDir: samples/server/petstore/java-play-framework-controller-only -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaPlayFramework +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaPlayFramework additionalProperties: controllerOnly: "true" hideGenerationTimestamp: "true" diff --git a/bin/configs/unmaintained/java-play-framework-fake-endpoints-with-security.yaml b/bin/configs/unmaintained/java-play-framework-fake-endpoints-with-security.yaml index b21a8a9ba0c..14724247eba 100644 --- a/bin/configs/unmaintained/java-play-framework-fake-endpoints-with-security.yaml +++ b/bin/configs/unmaintained/java-play-framework-fake-endpoints-with-security.yaml @@ -1,6 +1,6 @@ generatorName: java-play-framework outputDir: samples/server/petstore/java-play-framework-fake-endpoints-with-security -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-for-testing-playframework-with-security.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaPlayFramework +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-for-testing-playframework-with-security.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaPlayFramework additionalProperties: hideGenerationTimestamp: "true" diff --git a/bin/configs/unmaintained/java-play-framework-fake-endpoints.yaml b/bin/configs/unmaintained/java-play-framework-fake-endpoints.yaml index 7ab4bb95563..1b9c5987c6b 100644 --- a/bin/configs/unmaintained/java-play-framework-fake-endpoints.yaml +++ b/bin/configs/unmaintained/java-play-framework-fake-endpoints.yaml @@ -1,6 +1,6 @@ generatorName: java-play-framework outputDir: samples/server/petstore/java-play-framework-fake-endpoints -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaPlayFramework +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaPlayFramework additionalProperties: hideGenerationTimestamp: "true" diff --git a/bin/configs/unmaintained/java-play-framework-no-bean-validation.yaml b/bin/configs/unmaintained/java-play-framework-no-bean-validation.yaml index 22614f20d8d..1235e38877e 100644 --- a/bin/configs/unmaintained/java-play-framework-no-bean-validation.yaml +++ b/bin/configs/unmaintained/java-play-framework-no-bean-validation.yaml @@ -1,7 +1,7 @@ generatorName: java-play-framework outputDir: samples/server/petstore/java-play-framework-no-bean-validation -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaPlayFramework +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaPlayFramework additionalProperties: hideGenerationTimestamp: "true" useBeanValidation: "false" diff --git a/bin/configs/unmaintained/java-play-framework-no-exception-handling.yaml b/bin/configs/unmaintained/java-play-framework-no-exception-handling.yaml index f231fbb9607..f7e858d92ae 100644 --- a/bin/configs/unmaintained/java-play-framework-no-exception-handling.yaml +++ b/bin/configs/unmaintained/java-play-framework-no-exception-handling.yaml @@ -1,7 +1,7 @@ generatorName: java-play-framework outputDir: samples/server/petstore/java-play-framework-no-exception-handling -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaPlayFramework +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaPlayFramework additionalProperties: handleExceptions: "false" hideGenerationTimestamp: "true" diff --git a/bin/configs/unmaintained/java-play-framework-no-interface.yaml b/bin/configs/unmaintained/java-play-framework-no-interface.yaml index 51633c13dc5..1a84c67247a 100644 --- a/bin/configs/unmaintained/java-play-framework-no-interface.yaml +++ b/bin/configs/unmaintained/java-play-framework-no-interface.yaml @@ -1,7 +1,7 @@ generatorName: java-play-framework outputDir: samples/server/petstore/java-play-framework-no-interface -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaPlayFramework +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaPlayFramework additionalProperties: hideGenerationTimestamp: "true" useInterfaces: "false" diff --git a/bin/configs/unmaintained/java-play-framework-no-nullable.yaml b/bin/configs/unmaintained/java-play-framework-no-nullable.yaml index 3eaf7366c2a..ef1655108af 100644 --- a/bin/configs/unmaintained/java-play-framework-no-nullable.yaml +++ b/bin/configs/unmaintained/java-play-framework-no-nullable.yaml @@ -1,7 +1,7 @@ generatorName: java-play-framework outputDir: samples/server/petstore/java-play-framework-no-nullable -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaPlayFramework +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaPlayFramework additionalProperties: hideGenerationTimestamp: "true" openApiNullable: "false" diff --git a/bin/configs/unmaintained/java-play-framework-no-swagger-ui.yaml b/bin/configs/unmaintained/java-play-framework-no-swagger-ui.yaml index b2cb39224b6..6d03355d7eb 100644 --- a/bin/configs/unmaintained/java-play-framework-no-swagger-ui.yaml +++ b/bin/configs/unmaintained/java-play-framework-no-swagger-ui.yaml @@ -1,7 +1,7 @@ generatorName: java-play-framework outputDir: samples/server/petstore/java-play-framework-no-swagger-ui -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaPlayFramework +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaPlayFramework additionalProperties: hideGenerationTimestamp: "true" useSwaggerUI: "false" diff --git a/bin/configs/unmaintained/java-play-framework-no-wrap-calls.yaml b/bin/configs/unmaintained/java-play-framework-no-wrap-calls.yaml index d8ab5013bde..62beca64e9c 100644 --- a/bin/configs/unmaintained/java-play-framework-no-wrap-calls.yaml +++ b/bin/configs/unmaintained/java-play-framework-no-wrap-calls.yaml @@ -1,7 +1,7 @@ generatorName: java-play-framework outputDir: samples/server/petstore/java-play-framework-no-wrap-calls -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaPlayFramework +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaPlayFramework additionalProperties: hideGenerationTimestamp: "true" wrapCalls: "false" diff --git a/bin/configs/unmaintained/java-play-framework.yaml b/bin/configs/unmaintained/java-play-framework.yaml index ee9b2705273..5c941a100a5 100644 --- a/bin/configs/unmaintained/java-play-framework.yaml +++ b/bin/configs/unmaintained/java-play-framework.yaml @@ -1,6 +1,6 @@ generatorName: java-play-framework outputDir: samples/server/petstore/java-play-framework -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaPlayFramework +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaPlayFramework additionalProperties: hideGenerationTimestamp: "true" diff --git a/bin/configs/unmaintained/java-rest-assured-jackson.yaml b/bin/configs/unmaintained/java-rest-assured-jackson.yaml index db2014be022..a6c222cfc93 100644 --- a/bin/configs/unmaintained/java-rest-assured-jackson.yaml +++ b/bin/configs/unmaintained/java-rest-assured-jackson.yaml @@ -1,8 +1,8 @@ generatorName: java outputDir: ./samples/client/petstore/java/rest-assured-jackson library: rest-assured -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/Java +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/Java additionalProperties: serializationLibrary: jackson dateLibrary: java8 diff --git a/bin/configs/unmaintained/java-rest-assured.yaml b/bin/configs/unmaintained/java-rest-assured.yaml index 39426761ef2..af78df2db7a 100644 --- a/bin/configs/unmaintained/java-rest-assured.yaml +++ b/bin/configs/unmaintained/java-rest-assured.yaml @@ -1,8 +1,8 @@ generatorName: java outputDir: samples/client/petstore/java/rest-assured library: rest-assured -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/Java +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/Java additionalProperties: performBeanValidation: "true" useBeanValidation: "true" diff --git a/bin/configs/unmaintained/java-resteasy.yaml b/bin/configs/unmaintained/java-resteasy.yaml index a6b09924858..b5c15c9a579 100644 --- a/bin/configs/unmaintained/java-resteasy.yaml +++ b/bin/configs/unmaintained/java-resteasy.yaml @@ -1,8 +1,8 @@ generatorName: java outputDir: samples/client/petstore/java/resteasy library: resteasy -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/Java +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/Java additionalProperties: artifactId: petstore-resteasy hideGenerationTimestamp: "true" diff --git a/bin/configs/unmaintained/java-resttemplate-withXml.yaml b/bin/configs/unmaintained/java-resttemplate-withXml.yaml index c0122422f0a..2ff258d5995 100644 --- a/bin/configs/unmaintained/java-resttemplate-withXml.yaml +++ b/bin/configs/unmaintained/java-resttemplate-withXml.yaml @@ -1,8 +1,8 @@ generatorName: java outputDir: samples/client/petstore/java/resttemplate-withXml library: resttemplate -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/Java +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/Java additionalProperties: java8: true withXml: "true" diff --git a/bin/configs/unmaintained/java-resttemplate.yaml b/bin/configs/unmaintained/java-resttemplate.yaml index 9c61a34ba90..919827a25b9 100644 --- a/bin/configs/unmaintained/java-resttemplate.yaml +++ b/bin/configs/unmaintained/java-resttemplate.yaml @@ -1,8 +1,8 @@ generatorName: java outputDir: samples/client/petstore/java/resttemplate library: resttemplate -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/Java +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/Java additionalProperties: artifactId: petstore-resttemplate hideGenerationTimestamp: "true" diff --git a/bin/configs/unmaintained/java-retrofit2-play26.yaml b/bin/configs/unmaintained/java-retrofit2-play26.yaml index b65e8a3a95c..8fdcbc7de13 100644 --- a/bin/configs/unmaintained/java-retrofit2-play26.yaml +++ b/bin/configs/unmaintained/java-retrofit2-play26.yaml @@ -1,8 +1,8 @@ generatorName: java outputDir: samples/client/petstore/java/retrofit2-play26 library: retrofit2 -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/Java +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/Java additionalProperties: usePlayWS: "true" enableBuilderSupport: "true" diff --git a/bin/configs/unmaintained/java-retrofit2.yaml b/bin/configs/unmaintained/java-retrofit2.yaml index 2879e3e4493..3e844e112da 100644 --- a/bin/configs/unmaintained/java-retrofit2.yaml +++ b/bin/configs/unmaintained/java-retrofit2.yaml @@ -1,8 +1,8 @@ generatorName: java outputDir: samples/client/petstore/java/retrofit2 library: retrofit2 -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/Java +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/Java additionalProperties: artifactId: petstore-retrofit2 hideGenerationTimestamp: "true" diff --git a/bin/configs/unmaintained/java-retrofit2rx2.yaml b/bin/configs/unmaintained/java-retrofit2rx2.yaml index dfb55acb481..5bc6946770c 100644 --- a/bin/configs/unmaintained/java-retrofit2rx2.yaml +++ b/bin/configs/unmaintained/java-retrofit2rx2.yaml @@ -1,8 +1,8 @@ generatorName: java outputDir: samples/client/petstore/java/retrofit2rx2 library: retrofit2 -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/Java +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/Java additionalProperties: useRxJava2: "true" artifactId: petstore-retrofit2-rx2 diff --git a/bin/configs/unmaintained/java-retrofit2rx3.yaml b/bin/configs/unmaintained/java-retrofit2rx3.yaml index e4a1b5207c6..bbda2397ecc 100644 --- a/bin/configs/unmaintained/java-retrofit2rx3.yaml +++ b/bin/configs/unmaintained/java-retrofit2rx3.yaml @@ -1,8 +1,8 @@ generatorName: java outputDir: samples/client/petstore/java/retrofit2rx3 library: retrofit2 -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/Java +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/Java additionalProperties: useRxJava3: "true" artifactId: petstore-retrofit2-rx3 diff --git a/bin/configs/unmaintained/java-undertow-server-java-undertow.yaml b/bin/configs/unmaintained/java-undertow-server-java-undertow.yaml index 2cbb1160f17..02e2609cc58 100644 --- a/bin/configs/unmaintained/java-undertow-server-java-undertow.yaml +++ b/bin/configs/unmaintained/java-undertow-server-java-undertow.yaml @@ -1,6 +1,6 @@ generatorName: java-undertow-server outputDir: samples/server/petstore/java-undertow -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/java-undertow-server +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/java-undertow-server additionalProperties: hideGenerationTimestamp: "true" diff --git a/bin/configs/unmaintained/java-vertx-async.yaml b/bin/configs/unmaintained/java-vertx-async.yaml index cbc5b3c1c97..d9c05649f26 100644 --- a/bin/configs/unmaintained/java-vertx-async.yaml +++ b/bin/configs/unmaintained/java-vertx-async.yaml @@ -1,7 +1,7 @@ generatorName: java-vertx outputDir: samples/server/petstore/java-vertx/async -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaVertXServer +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaVertXServer additionalProperties: hideGenerationTimestamp: "true" vertxSwaggerRouterVersion: 1.4.0 diff --git a/bin/configs/unmaintained/java-vertx-no-nullable.yaml b/bin/configs/unmaintained/java-vertx-no-nullable.yaml index 1282bdfae71..3f1a1362efd 100644 --- a/bin/configs/unmaintained/java-vertx-no-nullable.yaml +++ b/bin/configs/unmaintained/java-vertx-no-nullable.yaml @@ -1,8 +1,8 @@ generatorName: java outputDir: samples/client/petstore/java/vertx-no-nullable library: vertx -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/Java +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/Java additionalProperties: artifactId: petstore-vertx-no-nullable hideGenerationTimestamp: "true" diff --git a/bin/configs/unmaintained/java-vertx-rx.yaml b/bin/configs/unmaintained/java-vertx-rx.yaml index d5dde08656e..8fa8be0f48d 100644 --- a/bin/configs/unmaintained/java-vertx-rx.yaml +++ b/bin/configs/unmaintained/java-vertx-rx.yaml @@ -1,7 +1,7 @@ generatorName: java-vertx outputDir: samples/server/petstore/java-vertx/rx -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaVertXServer +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaVertXServer additionalProperties: artifactId: java-vertx-rx-server hideGenerationTimestamp: "true" diff --git a/bin/configs/unmaintained/java-vertx-web-server.yaml b/bin/configs/unmaintained/java-vertx-web-server.yaml index 204f89ebf1c..ead05997008 100644 --- a/bin/configs/unmaintained/java-vertx-web-server.yaml +++ b/bin/configs/unmaintained/java-vertx-web-server.yaml @@ -1,7 +1,7 @@ generatorName: java-vertx-web outputDir: samples/server/petstore/java-vertx-web -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaVertXWebServer +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaVertXWebServer additionalProperties: hideGenerationTimestamp: "true" artifactId: java-vertx-web-server diff --git a/bin/configs/unmaintained/java-vertx.yaml b/bin/configs/unmaintained/java-vertx.yaml index cf019b5da88..6dcd79274c6 100644 --- a/bin/configs/unmaintained/java-vertx.yaml +++ b/bin/configs/unmaintained/java-vertx.yaml @@ -1,8 +1,8 @@ generatorName: java outputDir: samples/client/petstore/java/vertx library: vertx -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/Java +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/Java additionalProperties: artifactId: petstore-vertx hideGenerationTimestamp: "true" diff --git a/bin/configs/unmaintained/java-webclient-nullable-array.yaml b/bin/configs/unmaintained/java-webclient-nullable-array.yaml index 24d280bc8cb..a30f092a22e 100644 --- a/bin/configs/unmaintained/java-webclient-nullable-array.yaml +++ b/bin/configs/unmaintained/java-webclient-nullable-array.yaml @@ -1,8 +1,8 @@ generatorName: java outputDir: samples/client/petstore/java/webclient-nulable-arrays library: webclient -inputSpec: modules/openapi-generator/src/test/resources/3_0/schema-with-nullable-arrays.yaml -templateDir: modules/openapi-generator/src/main/resources/Java +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/schema-with-nullable-arrays.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/Java additionalProperties: artifactId: petstore-webclient-nullable-arrays hideGenerationTimestamp: "true" diff --git a/bin/configs/unmaintained/java-webclient.yaml b/bin/configs/unmaintained/java-webclient.yaml index a78b3f5e47d..7d155166eb7 100644 --- a/bin/configs/unmaintained/java-webclient.yaml +++ b/bin/configs/unmaintained/java-webclient.yaml @@ -1,8 +1,8 @@ generatorName: java outputDir: samples/client/petstore/java/webclient library: webclient -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/Java +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/Java additionalProperties: artifactId: petstore-webclient hideGenerationTimestamp: "true" diff --git a/bin/configs/unmaintained/javascript-apollo.yaml b/bin/configs/unmaintained/javascript-apollo.yaml index 74853eec57f..50522c394ae 100644 --- a/bin/configs/unmaintained/javascript-apollo.yaml +++ b/bin/configs/unmaintained/javascript-apollo.yaml @@ -1,7 +1,7 @@ generatorName: javascript outputDir: samples/client/petstore/javascript-apollo library: apollo -inputSpec: modules/openapi-generator/src/test/resources/3_0/javascript/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/Javascript +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/javascript/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/Javascript additionalProperties: appName: PetstoreClient diff --git a/bin/configs/unmaintained/javascript-closure-angular.yaml b/bin/configs/unmaintained/javascript-closure-angular.yaml index d911066fc6f..8cf50dac764 100644 --- a/bin/configs/unmaintained/javascript-closure-angular.yaml +++ b/bin/configs/unmaintained/javascript-closure-angular.yaml @@ -1,4 +1,4 @@ generatorName: javascript-closure-angular outputDir: samples/client/petstore/javascript-closure-angular -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/Javascript-Closure-Angular +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/Javascript-Closure-Angular diff --git a/bin/configs/unmaintained/javascript-es6.yaml b/bin/configs/unmaintained/javascript-es6.yaml index 67f013b0c51..0ef1d4974e0 100644 --- a/bin/configs/unmaintained/javascript-es6.yaml +++ b/bin/configs/unmaintained/javascript-es6.yaml @@ -1,7 +1,7 @@ generatorName: javascript outputDir: samples/client/petstore/javascript-es6 library: javascript -inputSpec: modules/openapi-generator/src/test/resources/3_0/javascript/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/Javascript +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/javascript/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/Javascript additionalProperties: appName: PetstoreClient diff --git a/bin/configs/unmaintained/javascript-flowtyped.yaml b/bin/configs/unmaintained/javascript-flowtyped.yaml index 514f7fe1dfe..23708aab539 100644 --- a/bin/configs/unmaintained/javascript-flowtyped.yaml +++ b/bin/configs/unmaintained/javascript-flowtyped.yaml @@ -1,6 +1,6 @@ generatorName: javascript-flowtyped outputDir: samples/client/petstore/javascript-flowtyped -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/Javascript-Flowtyped +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/Javascript-Flowtyped additionalProperties: appName: PetstoreClient diff --git a/bin/configs/unmaintained/javascript-promise-es6.yaml b/bin/configs/unmaintained/javascript-promise-es6.yaml index 9ffae513eb8..765c4aee0f0 100644 --- a/bin/configs/unmaintained/javascript-promise-es6.yaml +++ b/bin/configs/unmaintained/javascript-promise-es6.yaml @@ -1,8 +1,8 @@ generatorName: javascript outputDir: samples/client/petstore/javascript-promise-es6 library: javascript -inputSpec: modules/openapi-generator/src/test/resources/3_0/javascript/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/Javascript +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/javascript/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/Javascript additionalProperties: usePromises: "true" appName: PetstoreClient diff --git a/bin/configs/unmaintained/jaxrs-cxf-annotated-base-path.yaml b/bin/configs/unmaintained/jaxrs-cxf-annotated-base-path.yaml index ddff8105f24..d47f254d8e8 100644 --- a/bin/configs/unmaintained/jaxrs-cxf-annotated-base-path.yaml +++ b/bin/configs/unmaintained/jaxrs-cxf-annotated-base-path.yaml @@ -1,7 +1,7 @@ generatorName: jaxrs-cxf outputDir: samples/server/petstore/jaxrs-cxf-annotated-base-path -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS/cxf +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaJaxRS/cxf additionalProperties: artifactId: cxf-annotated-basepath hideGenerationTimestamp: "true" diff --git a/bin/configs/unmaintained/jaxrs-cxf-cdi.yaml b/bin/configs/unmaintained/jaxrs-cxf-cdi.yaml index 63299c1d4e9..04d77acf713 100644 --- a/bin/configs/unmaintained/jaxrs-cxf-cdi.yaml +++ b/bin/configs/unmaintained/jaxrs-cxf-cdi.yaml @@ -1,7 +1,7 @@ generatorName: jaxrs-cxf-cdi outputDir: samples/server/petstore/jaxrs-cxf-cdi -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaJaxRS/cxf-cdi additionalProperties: hideGenerationTimestamp: "true" implicitHeadersRegex: api_key diff --git a/bin/configs/unmaintained/jaxrs-cxf-client-jackson.yaml b/bin/configs/unmaintained/jaxrs-cxf-client-jackson.yaml index 86cb90696fe..2a2af81a0e1 100644 --- a/bin/configs/unmaintained/jaxrs-cxf-client-jackson.yaml +++ b/bin/configs/unmaintained/jaxrs-cxf-client-jackson.yaml @@ -1,7 +1,7 @@ generatorName: jaxrs-cxf-client outputDir: samples/client/petstore/jaxrs-cxf-client-jackson -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS/cxf +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaJaxRS/cxf additionalProperties: artifactId: jaxrs-cxf-jackson-petstore-client jackson: "true" diff --git a/bin/configs/unmaintained/jaxrs-cxf-client.yaml b/bin/configs/unmaintained/jaxrs-cxf-client.yaml index 26faac332b8..1b3709b6263 100644 --- a/bin/configs/unmaintained/jaxrs-cxf-client.yaml +++ b/bin/configs/unmaintained/jaxrs-cxf-client.yaml @@ -1,6 +1,6 @@ generatorName: jaxrs-cxf-client outputDir: samples/client/petstore/jaxrs-cxf-client -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS/cxf +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaJaxRS/cxf additionalProperties: artifactId: jaxrs-cxf-petstore-client diff --git a/bin/configs/unmaintained/jaxrs-cxf-extended-jaxrs-cxf-test-data.yaml b/bin/configs/unmaintained/jaxrs-cxf-extended-jaxrs-cxf-test-data.yaml index c66a09deeeb..69aba82f537 100644 --- a/bin/configs/unmaintained/jaxrs-cxf-extended-jaxrs-cxf-test-data.yaml +++ b/bin/configs/unmaintained/jaxrs-cxf-extended-jaxrs-cxf-test-data.yaml @@ -1,7 +1,7 @@ generatorName: jaxrs-cxf-extended outputDir: samples/server/petstore/jaxrs-cxf-test-data -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaJaxRS/cxf-ext generateAliasAsModel: true additionalProperties: java8: "true" diff --git a/bin/configs/unmaintained/jaxrs-cxf-non-spring-app.yaml b/bin/configs/unmaintained/jaxrs-cxf-non-spring-app.yaml index b1f09c10810..b35b7e4743b 100644 --- a/bin/configs/unmaintained/jaxrs-cxf-non-spring-app.yaml +++ b/bin/configs/unmaintained/jaxrs-cxf-non-spring-app.yaml @@ -1,7 +1,7 @@ generatorName: jaxrs-cxf outputDir: samples/server/petstore/jaxrs-cxf-non-spring-app -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS/cxf +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaJaxRS/cxf additionalProperties: artifactId: cxf-server-non-spring hideGenerationTimestamp: "true" diff --git a/bin/configs/unmaintained/jaxrs-cxf.yaml b/bin/configs/unmaintained/jaxrs-cxf.yaml index 76c2b2108fc..4994db42a2a 100644 --- a/bin/configs/unmaintained/jaxrs-cxf.yaml +++ b/bin/configs/unmaintained/jaxrs-cxf.yaml @@ -1,7 +1,7 @@ generatorName: jaxrs-cxf outputDir: samples/server/petstore/jaxrs-cxf -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS/cxf +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaJaxRS/cxf additionalProperties: hideGenerationTimestamp: "true" serverPort: "8082" diff --git a/bin/configs/unmaintained/jaxrs-jersey-jaxrs-datelib-j8.yaml b/bin/configs/unmaintained/jaxrs-jersey-jaxrs-datelib-j8.yaml index 902a8abae0b..99fa2272c97 100644 --- a/bin/configs/unmaintained/jaxrs-jersey-jaxrs-datelib-j8.yaml +++ b/bin/configs/unmaintained/jaxrs-jersey-jaxrs-datelib-j8.yaml @@ -1,7 +1,7 @@ generatorName: jaxrs-jersey outputDir: samples/server/petstore/jaxrs-datelib-j8 -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaJaxRS additionalProperties: serializableModel: true withXml: true diff --git a/bin/configs/unmaintained/jaxrs-jersey-jersey1-useTags.yaml b/bin/configs/unmaintained/jaxrs-jersey-jersey1-useTags.yaml index 98c76c0e451..6cab1ef94df 100644 --- a/bin/configs/unmaintained/jaxrs-jersey-jersey1-useTags.yaml +++ b/bin/configs/unmaintained/jaxrs-jersey-jersey1-useTags.yaml @@ -1,8 +1,8 @@ generatorName: jaxrs-jersey outputDir: samples/server/petstore/jaxrs/jersey1-useTags library: jersey1 -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaJaxRS additionalProperties: artifactId: jaxrs-jersey1-useTags hideGenerationTimestamp: "true" diff --git a/bin/configs/unmaintained/jaxrs-jersey-jersey1.yaml b/bin/configs/unmaintained/jaxrs-jersey-jersey1.yaml index 8df27c59be7..3e7823d808b 100644 --- a/bin/configs/unmaintained/jaxrs-jersey-jersey1.yaml +++ b/bin/configs/unmaintained/jaxrs-jersey-jersey1.yaml @@ -1,8 +1,8 @@ generatorName: jaxrs-jersey outputDir: samples/server/petstore/jaxrs/jersey1 library: jersey1 -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaJaxRS additionalProperties: artifactId: jaxrs-jersey1-server hideGenerationTimestamp: "true" diff --git a/bin/configs/unmaintained/jaxrs-jersey-jersey2-useTags.yaml b/bin/configs/unmaintained/jaxrs-jersey-jersey2-useTags.yaml index 8a2d89b02f2..bd39d4989a0 100644 --- a/bin/configs/unmaintained/jaxrs-jersey-jersey2-useTags.yaml +++ b/bin/configs/unmaintained/jaxrs-jersey-jersey2-useTags.yaml @@ -1,7 +1,7 @@ generatorName: jaxrs-jersey outputDir: samples/server/petstore/jaxrs/jersey2-useTags -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaJaxRS additionalProperties: artifactId: jaxrs-jersey2-useTags hideGenerationTimestamp: "true" diff --git a/bin/configs/unmaintained/jaxrs-jersey-jersey2.yaml b/bin/configs/unmaintained/jaxrs-jersey-jersey2.yaml index 8345db9f397..2aa73837276 100644 --- a/bin/configs/unmaintained/jaxrs-jersey-jersey2.yaml +++ b/bin/configs/unmaintained/jaxrs-jersey-jersey2.yaml @@ -1,7 +1,7 @@ generatorName: jaxrs-jersey outputDir: samples/server/petstore/jaxrs/jersey2 -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaJaxRS additionalProperties: artifactId: jaxrs-jersey-petstore-server hideGenerationTimestamp: "true" diff --git a/bin/configs/unmaintained/jaxrs-jersey.yaml b/bin/configs/unmaintained/jaxrs-jersey.yaml index 81328a6de1b..71b93991912 100644 --- a/bin/configs/unmaintained/jaxrs-jersey.yaml +++ b/bin/configs/unmaintained/jaxrs-jersey.yaml @@ -1,7 +1,7 @@ generatorName: jaxrs-jersey outputDir: samples/server/petstore/jaxrs-jersey -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaJaxRS additionalProperties: artifactId: openapiv3-jaxrs-jersey-petstore-server hideGenerationTimestamp: "true" diff --git a/bin/configs/unmaintained/jaxrs-resteasy-default.yaml b/bin/configs/unmaintained/jaxrs-resteasy-default.yaml index e05f414253f..52c46f3b3c8 100644 --- a/bin/configs/unmaintained/jaxrs-resteasy-default.yaml +++ b/bin/configs/unmaintained/jaxrs-resteasy-default.yaml @@ -1,7 +1,7 @@ generatorName: jaxrs-resteasy outputDir: samples/server/petstore/jaxrs-resteasy/default -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaJaxRS/resteasy additionalProperties: hideGenerationTimestamp: "true" implicitHeadersRegex: api_key diff --git a/bin/configs/unmaintained/jaxrs-resteasy-eap-eap-java8.yaml b/bin/configs/unmaintained/jaxrs-resteasy-eap-eap-java8.yaml index 5191921e8e6..a7cfb97d42c 100644 --- a/bin/configs/unmaintained/jaxrs-resteasy-eap-eap-java8.yaml +++ b/bin/configs/unmaintained/jaxrs-resteasy-eap-eap-java8.yaml @@ -1,7 +1,7 @@ generatorName: jaxrs-resteasy-eap outputDir: samples/server/petstore/jaxrs-resteasy/eap-java8 -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaJaxRS/resteasy/eap additionalProperties: artifactId: jaxrs-resteasy-eap-java8-server hideGenerationTimestamp: "true" diff --git a/bin/configs/unmaintained/jaxrs-resteasy-eap-eap-joda.yaml b/bin/configs/unmaintained/jaxrs-resteasy-eap-eap-joda.yaml index a985b866cd3..b43a9e008cb 100644 --- a/bin/configs/unmaintained/jaxrs-resteasy-eap-eap-joda.yaml +++ b/bin/configs/unmaintained/jaxrs-resteasy-eap-eap-joda.yaml @@ -1,7 +1,7 @@ generatorName: jaxrs-resteasy-eap outputDir: samples/server/petstore/jaxrs-resteasy/eap-joda -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaJaxRS/resteasy/eap additionalProperties: artifactId: jaxrs-resteasy-eap-joda-server hideGenerationTimestamp: "true" diff --git a/bin/configs/unmaintained/jaxrs-resteasy-eap-eap.yaml b/bin/configs/unmaintained/jaxrs-resteasy-eap-eap.yaml index 5f776839cab..e157a06515b 100644 --- a/bin/configs/unmaintained/jaxrs-resteasy-eap-eap.yaml +++ b/bin/configs/unmaintained/jaxrs-resteasy-eap-eap.yaml @@ -1,6 +1,6 @@ generatorName: jaxrs-resteasy-eap outputDir: samples/server/petstore/jaxrs-resteasy/eap -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaJaxRS/resteasy/eap additionalProperties: hideGenerationTimestamp: "true" diff --git a/bin/configs/unmaintained/jaxrs-resteasy-java8.yaml b/bin/configs/unmaintained/jaxrs-resteasy-java8.yaml index bf23076f8c8..b46cc46fc49 100644 --- a/bin/configs/unmaintained/jaxrs-resteasy-java8.yaml +++ b/bin/configs/unmaintained/jaxrs-resteasy-java8.yaml @@ -1,7 +1,7 @@ generatorName: jaxrs-resteasy outputDir: samples/server/petstore/jaxrs-resteasy/java8 -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaJaxRS/resteasy additionalProperties: artifactId: jaxrs-resteasy-java8-server hideGenerationTimestamp: "true" diff --git a/bin/configs/unmaintained/jaxrs-resteasy-joda.yaml b/bin/configs/unmaintained/jaxrs-resteasy-joda.yaml index 13fb6b8b671..cd1921f4d1b 100644 --- a/bin/configs/unmaintained/jaxrs-resteasy-joda.yaml +++ b/bin/configs/unmaintained/jaxrs-resteasy-joda.yaml @@ -1,7 +1,7 @@ generatorName: jaxrs-resteasy outputDir: samples/server/petstore/jaxrs-resteasy/joda -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaJaxRS/resteasy additionalProperties: artifactId: jaxrs-resteasy-joda-server hideGenerationTimestamp: "true" diff --git a/bin/configs/unmaintained/jaxrs-spec-interface-response.yaml b/bin/configs/unmaintained/jaxrs-spec-interface-response.yaml index 3e4b7edfb93..233e9612a44 100644 --- a/bin/configs/unmaintained/jaxrs-spec-interface-response.yaml +++ b/bin/configs/unmaintained/jaxrs-spec-interface-response.yaml @@ -1,7 +1,7 @@ generatorName: jaxrs-spec outputDir: samples/server/petstore/jaxrs-spec-interface-response -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS/spec +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaJaxRS/spec additionalProperties: artifactId: jaxrs-spec-interface-response-petstore-server interfaceOnly: "true" diff --git a/bin/configs/unmaintained/jaxrs-spec-interface.yaml b/bin/configs/unmaintained/jaxrs-spec-interface.yaml index 57a5034b273..72189e34cb2 100644 --- a/bin/configs/unmaintained/jaxrs-spec-interface.yaml +++ b/bin/configs/unmaintained/jaxrs-spec-interface.yaml @@ -1,7 +1,7 @@ generatorName: jaxrs-spec outputDir: samples/server/petstore/jaxrs-spec-interface -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS/spec +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaJaxRS/spec additionalProperties: artifactId: jaxrs-spec-interface-petstore-server interfaceOnly: "true" diff --git a/bin/configs/unmaintained/jaxrs-spec.yaml b/bin/configs/unmaintained/jaxrs-spec.yaml index dbbb86bb420..4c6b04948b0 100644 --- a/bin/configs/unmaintained/jaxrs-spec.yaml +++ b/bin/configs/unmaintained/jaxrs-spec.yaml @@ -1,7 +1,7 @@ generatorName: jaxrs-spec outputDir: samples/server/petstore/jaxrs-spec -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS/spec +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaJaxRS/spec additionalProperties: artifactId: jaxrs-spec-petstore-server serializableModel: "true" diff --git a/bin/configs/unmaintained/jmeter.yaml b/bin/configs/unmaintained/jmeter.yaml index 79b5de0e41b..eacbbd4701e 100644 --- a/bin/configs/unmaintained/jmeter.yaml +++ b/bin/configs/unmaintained/jmeter.yaml @@ -1,4 +1,4 @@ generatorName: jmeter outputDir: samples/client/petstore/jmeter -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/jmeter-client +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/jmeter-client diff --git a/bin/configs/unmaintained/k6.yaml b/bin/configs/unmaintained/k6.yaml index 9933744e314..bb51dd0be88 100644 --- a/bin/configs/unmaintained/k6.yaml +++ b/bin/configs/unmaintained/k6.yaml @@ -1,6 +1,6 @@ generatorName: k6 outputDir: samples/client/petstore/k6 -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/k6 +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/k6 additionalProperties: appName: PetstoreClient diff --git a/bin/configs/unmaintained/kotlin-allOff-discriminator.yaml b/bin/configs/unmaintained/kotlin-allOff-discriminator.yaml index 0de0dd1e429..21d3024463d 100644 --- a/bin/configs/unmaintained/kotlin-allOff-discriminator.yaml +++ b/bin/configs/unmaintained/kotlin-allOff-discriminator.yaml @@ -1,7 +1,7 @@ generatorName: kotlin outputDir: samples/client/petstore/kotlin-allOff-discriminator -inputSpec: modules/openapi-generator/src/test/resources/3_0/issue_10792.yaml -templateDir: modules/openapi-generator/src/main/resources/kotlin-client +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/issue_10792.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/kotlin-client additionalProperties: artifactId: kotlin-allOff-discriminator serializableModel: "false" diff --git a/bin/configs/unmaintained/kotlin-array-simple-string-jvm-okhttp3.yaml b/bin/configs/unmaintained/kotlin-array-simple-string-jvm-okhttp3.yaml index d24f50303a1..6e0319999b4 100644 --- a/bin/configs/unmaintained/kotlin-array-simple-string-jvm-okhttp3.yaml +++ b/bin/configs/unmaintained/kotlin-array-simple-string-jvm-okhttp3.yaml @@ -1,7 +1,7 @@ generatorName: kotlin outputDir: samples/client/petstore/kotlin-array-simple-string-jvm-okhttp3 -inputSpec: modules/openapi-generator/src/test/resources/3_0/issue_7199_array_simple_string.yaml -templateDir: modules/openapi-generator/src/main/resources/kotlin-client +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/issue_7199_array_simple_string.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/kotlin-client additionalProperties: artifactId: kotlin-array-simple-string-jvm-okhttp3 library: jvm-okhttp3 diff --git a/bin/configs/unmaintained/kotlin-array-simple-string-jvm-okhttp4.yaml b/bin/configs/unmaintained/kotlin-array-simple-string-jvm-okhttp4.yaml index 53e16ff7c1f..4261259fbf2 100644 --- a/bin/configs/unmaintained/kotlin-array-simple-string-jvm-okhttp4.yaml +++ b/bin/configs/unmaintained/kotlin-array-simple-string-jvm-okhttp4.yaml @@ -1,7 +1,7 @@ generatorName: kotlin outputDir: samples/client/petstore/kotlin-array-simple-string-jvm-okhttp4 -inputSpec: modules/openapi-generator/src/test/resources/3_0/issue_7199_array_simple_string.yaml -templateDir: modules/openapi-generator/src/main/resources/kotlin-client +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/issue_7199_array_simple_string.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/kotlin-client additionalProperties: artifactId: kotlin-array-simple-string-jvm-okhttp4 library: jvm-okhttp4 diff --git a/bin/configs/unmaintained/kotlin-array-simple-string-jvm-volley.yaml b/bin/configs/unmaintained/kotlin-array-simple-string-jvm-volley.yaml index 88f6304907c..15934cb6c63 100644 --- a/bin/configs/unmaintained/kotlin-array-simple-string-jvm-volley.yaml +++ b/bin/configs/unmaintained/kotlin-array-simple-string-jvm-volley.yaml @@ -1,7 +1,7 @@ generatorName: kotlin outputDir: samples/client/petstore/kotlin-array-simple-string-jvm-volley -inputSpec: modules/openapi-generator/src/test/resources/3_0/issue_7199_array_simple_string.yaml -templateDir: modules/openapi-generator/src/main/resources/kotlin-client +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/issue_7199_array_simple_string.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/kotlin-client additionalProperties: artifactId: kotlin-array-simple-string-jvm-volley library: jvm-volley diff --git a/bin/configs/unmaintained/kotlin-array-simple-string-multiplatform.yaml b/bin/configs/unmaintained/kotlin-array-simple-string-multiplatform.yaml index 8c880a67971..728305aa086 100644 --- a/bin/configs/unmaintained/kotlin-array-simple-string-multiplatform.yaml +++ b/bin/configs/unmaintained/kotlin-array-simple-string-multiplatform.yaml @@ -1,7 +1,7 @@ generatorName: kotlin outputDir: samples/client/petstore/kotlin-array-simple-string-multiplatform -inputSpec: modules/openapi-generator/src/test/resources/3_0/issue_7199_array_simple_string.yaml -templateDir: modules/openapi-generator/src/main/resources/kotlin-client +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/issue_7199_array_simple_string.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/kotlin-client additionalProperties: artifactId: kotlin-array-simple-string-multiplatform library: multiplatform diff --git a/bin/configs/unmaintained/kotlin-bigdecimal-default-multiplatform.yaml b/bin/configs/unmaintained/kotlin-bigdecimal-default-multiplatform.yaml index c525b0b9edc..a0ab6039994 100644 --- a/bin/configs/unmaintained/kotlin-bigdecimal-default-multiplatform.yaml +++ b/bin/configs/unmaintained/kotlin-bigdecimal-default-multiplatform.yaml @@ -1,7 +1,7 @@ generatorName: kotlin outputDir: samples/client/petstore/kotlin-bigdecimal-default-multiplatform -inputSpec: modules/openapi-generator/src/test/resources/3_0/issue_10866_bigdecimal_default.yaml -templateDir: modules/openapi-generator/src/main/resources/kotlin-client +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/issue_10866_bigdecimal_default.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/kotlin-client additionalProperties: artifactId: kotlin-bigdecimal-default-multiplatform library: multiplatform diff --git a/bin/configs/unmaintained/kotlin-bigdecimal-default-okhttp4.yaml b/bin/configs/unmaintained/kotlin-bigdecimal-default-okhttp4.yaml index bceaf195f8f..72f5c88f152 100644 --- a/bin/configs/unmaintained/kotlin-bigdecimal-default-okhttp4.yaml +++ b/bin/configs/unmaintained/kotlin-bigdecimal-default-okhttp4.yaml @@ -1,7 +1,7 @@ generatorName: kotlin outputDir: samples/client/petstore/kotlin-bigdecimal-default-okhttp4 -inputSpec: modules/openapi-generator/src/test/resources/3_0/issue_10866_bigdecimal_default.yaml -templateDir: modules/openapi-generator/src/main/resources/kotlin-client +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/issue_10866_bigdecimal_default.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/kotlin-client additionalProperties: artifactId: kotlin-bigdecimal-default-okhttp4 library: jvm-okhttp4 diff --git a/bin/configs/unmaintained/kotlin-default-values-jvm-okhttp3.yaml b/bin/configs/unmaintained/kotlin-default-values-jvm-okhttp3.yaml index 7b6aa2e9687..d1d552e8c4b 100644 --- a/bin/configs/unmaintained/kotlin-default-values-jvm-okhttp3.yaml +++ b/bin/configs/unmaintained/kotlin-default-values-jvm-okhttp3.yaml @@ -1,7 +1,7 @@ generatorName: kotlin outputDir: samples/client/petstore/kotlin-default-values-jvm-okhttp3 -inputSpec: modules/openapi-generator/src/test/resources/3_0/issue_10865_default_values.yaml -templateDir: modules/openapi-generator/src/main/resources/kotlin-client +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/issue_10865_default_values.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/kotlin-client additionalProperties: artifactId: kotlin-default-values-jvm-okhttp3 library: jvm-okhttp3 diff --git a/bin/configs/unmaintained/kotlin-default-values-jvm-okhttp4.yaml b/bin/configs/unmaintained/kotlin-default-values-jvm-okhttp4.yaml index 022c3cab534..2666192a649 100644 --- a/bin/configs/unmaintained/kotlin-default-values-jvm-okhttp4.yaml +++ b/bin/configs/unmaintained/kotlin-default-values-jvm-okhttp4.yaml @@ -1,7 +1,7 @@ generatorName: kotlin outputDir: samples/client/petstore/kotlin-default-values-jvm-okhttp4 -inputSpec: modules/openapi-generator/src/test/resources/3_0/issue_10865_default_values.yaml -templateDir: modules/openapi-generator/src/main/resources/kotlin-client +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/issue_10865_default_values.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/kotlin-client additionalProperties: artifactId: kotlin-default-values-jvm-okhttp4 library: jvm-okhttp4 diff --git a/bin/configs/unmaintained/kotlin-default-values-jvm-retrofit2.yaml b/bin/configs/unmaintained/kotlin-default-values-jvm-retrofit2.yaml index eca953c3f51..1e15c19891c 100644 --- a/bin/configs/unmaintained/kotlin-default-values-jvm-retrofit2.yaml +++ b/bin/configs/unmaintained/kotlin-default-values-jvm-retrofit2.yaml @@ -1,7 +1,7 @@ generatorName: kotlin outputDir: samples/client/petstore/kotlin-default-values-jvm-retrofit2 -inputSpec: modules/openapi-generator/src/test/resources/3_0/issue_10865_default_values.yaml -templateDir: modules/openapi-generator/src/main/resources/kotlin-client +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/issue_10865_default_values.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/kotlin-client additionalProperties: artifactId: kotlin-default-values-jvm-retrofit2 library: jvm-retrofit2 diff --git a/bin/configs/unmaintained/kotlin-default-values-jvm-volley.yaml b/bin/configs/unmaintained/kotlin-default-values-jvm-volley.yaml index d885b30356d..de49ef52c82 100644 --- a/bin/configs/unmaintained/kotlin-default-values-jvm-volley.yaml +++ b/bin/configs/unmaintained/kotlin-default-values-jvm-volley.yaml @@ -1,7 +1,7 @@ generatorName: kotlin outputDir: samples/client/petstore/kotlin-default-values-jvm-volley -inputSpec: modules/openapi-generator/src/test/resources/3_0/issue_10865_default_values.yaml -templateDir: modules/openapi-generator/src/main/resources/kotlin-client +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/issue_10865_default_values.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/kotlin-client additionalProperties: artifactId: kotlin-default-values-jvm-volley library: jvm-volley diff --git a/bin/configs/unmaintained/kotlin-default-values-multiplatform.yaml b/bin/configs/unmaintained/kotlin-default-values-multiplatform.yaml index 7a9a0fa52e6..09074f4743b 100644 --- a/bin/configs/unmaintained/kotlin-default-values-multiplatform.yaml +++ b/bin/configs/unmaintained/kotlin-default-values-multiplatform.yaml @@ -1,7 +1,7 @@ generatorName: kotlin outputDir: samples/client/petstore/kotlin-default-values-multiplatform -inputSpec: modules/openapi-generator/src/test/resources/3_0/issue_10865_default_values.yaml -templateDir: modules/openapi-generator/src/main/resources/kotlin-client +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/issue_10865_default_values.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/kotlin-client additionalProperties: artifactId: kotlin-default-values-multiplatform library: multiplatform diff --git a/bin/configs/unmaintained/kotlin-default-values-numbers.yaml b/bin/configs/unmaintained/kotlin-default-values-numbers.yaml index 1a76dd1dfde..17815661f81 100644 --- a/bin/configs/unmaintained/kotlin-default-values-numbers.yaml +++ b/bin/configs/unmaintained/kotlin-default-values-numbers.yaml @@ -1,7 +1,7 @@ generatorName: kotlin outputDir: samples/client/petstore/kotlin-default-values-numbers -inputSpec: modules/openapi-generator/src/test/resources/3_0/kotlin/issue13506-defaultValue-numbers.yaml -templateDir: modules/openapi-generator/src/main/resources/kotlin-client +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/kotlin/issue13506-defaultValue-numbers.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/kotlin-client additionalProperties: artifactId: kotlin-default-values-numbers serializationLibrary: gson diff --git a/bin/configs/unmaintained/kotlin-enum-default-value.yaml b/bin/configs/unmaintained/kotlin-enum-default-value.yaml index ddb00c55283..a8a4e997808 100644 --- a/bin/configs/unmaintained/kotlin-enum-default-value.yaml +++ b/bin/configs/unmaintained/kotlin-enum-default-value.yaml @@ -1,7 +1,7 @@ generatorName: kotlin outputDir: samples/client/petstore/kotlin-enum-default-value -inputSpec: modules/openapi-generator/src/test/resources/3_0/kotlin/issue10591-enum-defaultValue.yaml -templateDir: modules/openapi-generator/src/main/resources/kotlin-client +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/kotlin/issue10591-enum-defaultValue.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/kotlin-client additionalProperties: artifactId: kotlin-enum-default-value serializableModel: "true" diff --git a/bin/configs/unmaintained/kotlin-gson.yaml b/bin/configs/unmaintained/kotlin-gson.yaml index e4e55689509..67bd0ce2e81 100644 --- a/bin/configs/unmaintained/kotlin-gson.yaml +++ b/bin/configs/unmaintained/kotlin-gson.yaml @@ -1,7 +1,7 @@ generatorName: kotlin outputDir: samples/client/petstore/kotlin-gson -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/kotlin-client +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/kotlin-client additionalProperties: serializationLibrary: gson artifactId: kotlin-petstore-gson diff --git a/bin/configs/unmaintained/kotlin-jackson.yaml b/bin/configs/unmaintained/kotlin-jackson.yaml index 2d37a29f38a..1f3aa121ec7 100644 --- a/bin/configs/unmaintained/kotlin-jackson.yaml +++ b/bin/configs/unmaintained/kotlin-jackson.yaml @@ -1,7 +1,7 @@ generatorName: kotlin outputDir: samples/client/petstore/kotlin-jackson -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/kotlin-client +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/kotlin-client additionalProperties: serializationLibrary: jackson artifactId: kotlin-petstore-jackson diff --git a/bin/configs/unmaintained/kotlin-json-request-string.yaml b/bin/configs/unmaintained/kotlin-json-request-string.yaml index 31943045ab6..8d98a0f9903 100644 --- a/bin/configs/unmaintained/kotlin-json-request-string.yaml +++ b/bin/configs/unmaintained/kotlin-json-request-string.yaml @@ -1,7 +1,7 @@ generatorName: kotlin outputDir: samples/client/petstore/kotlin-json-request-string -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-date-field.yaml -templateDir: modules/openapi-generator/src/main/resources/kotlin-client +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-date-field.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/kotlin-client additionalProperties: requestDateConverter: toString artifactId: kotlin-petstore-json-request-string diff --git a/bin/configs/unmaintained/kotlin-jvm-ktor-gson.yaml b/bin/configs/unmaintained/kotlin-jvm-ktor-gson.yaml index 6b8bd62f644..561f2abeaf4 100644 --- a/bin/configs/unmaintained/kotlin-jvm-ktor-gson.yaml +++ b/bin/configs/unmaintained/kotlin-jvm-ktor-gson.yaml @@ -1,8 +1,8 @@ generatorName: kotlin outputDir: samples/client/petstore/kotlin-jvm-ktor-gson library: jvm-ktor -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/kotlin-client +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/kotlin-client additionalProperties: artifactId: kotlin-petstore-jvm-ktor-gson enumUnknownDefaultCase: true diff --git a/bin/configs/unmaintained/kotlin-jvm-ktor-jackson.yaml b/bin/configs/unmaintained/kotlin-jvm-ktor-jackson.yaml index 5fc856c88df..abe6877042d 100644 --- a/bin/configs/unmaintained/kotlin-jvm-ktor-jackson.yaml +++ b/bin/configs/unmaintained/kotlin-jvm-ktor-jackson.yaml @@ -1,8 +1,8 @@ generatorName: kotlin outputDir: samples/client/petstore/kotlin-jvm-ktor-jackson library: jvm-ktor -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/kotlin-client +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/kotlin-client additionalProperties: artifactId: kotlin-petstore-jvm-ktor-jackson enumUnknownDefaultCase: true diff --git a/bin/configs/unmaintained/kotlin-jvm-okhttp3-okhttp3.yaml b/bin/configs/unmaintained/kotlin-jvm-okhttp3-okhttp3.yaml index 13baa85c9a6..4a9dee38f67 100644 --- a/bin/configs/unmaintained/kotlin-jvm-okhttp3-okhttp3.yaml +++ b/bin/configs/unmaintained/kotlin-jvm-okhttp3-okhttp3.yaml @@ -1,8 +1,8 @@ generatorName: kotlin outputDir: samples/client/petstore/kotlin-okhttp3 library: jvm-okhttp3 -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/kotlin-client +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/kotlin-client additionalProperties: artifactId: kotlin-petstore-okhttp3 enumUnknownDefaultCase: true diff --git a/bin/configs/unmaintained/kotlin-jvm-okhttp4-coroutines.yaml b/bin/configs/unmaintained/kotlin-jvm-okhttp4-coroutines.yaml index 0718c164d56..3dfc6cedcb0 100644 --- a/bin/configs/unmaintained/kotlin-jvm-okhttp4-coroutines.yaml +++ b/bin/configs/unmaintained/kotlin-jvm-okhttp4-coroutines.yaml @@ -1,8 +1,8 @@ generatorName: kotlin outputDir: samples/client/petstore/kotlin-jvm-okhttp4-coroutines library: jvm-okhttp4 -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/kotlin-client +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/kotlin-client additionalProperties: serializationLibrary: gson useCoroutines: "true" diff --git a/bin/configs/unmaintained/kotlin-jvm-retrofit2-coroutines.yaml b/bin/configs/unmaintained/kotlin-jvm-retrofit2-coroutines.yaml index b401e273723..f44c8d22385 100644 --- a/bin/configs/unmaintained/kotlin-jvm-retrofit2-coroutines.yaml +++ b/bin/configs/unmaintained/kotlin-jvm-retrofit2-coroutines.yaml @@ -1,8 +1,8 @@ generatorName: kotlin outputDir: samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines library: jvm-retrofit2 -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/kotlin-client +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/kotlin-client additionalProperties: serializationLibrary: gson useCoroutines: "true" diff --git a/bin/configs/unmaintained/kotlin-jvm-retrofit2-kotlinx_serialization.yaml b/bin/configs/unmaintained/kotlin-jvm-retrofit2-kotlinx_serialization.yaml index f54496d25f1..977624043e2 100644 --- a/bin/configs/unmaintained/kotlin-jvm-retrofit2-kotlinx_serialization.yaml +++ b/bin/configs/unmaintained/kotlin-jvm-retrofit2-kotlinx_serialization.yaml @@ -1,8 +1,8 @@ generatorName: kotlin outputDir: samples/client/petstore/kotlin-retrofit2-kotlinx_serialization library: jvm-retrofit2 -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/kotlin-client +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/kotlin-client additionalProperties: serializationLibrary: kotlinx_serialization artifactId: kotlin-petstore-retrofit2-kotlinx_serialization diff --git a/bin/configs/unmaintained/kotlin-jvm-retrofit2-retrofit2.yaml b/bin/configs/unmaintained/kotlin-jvm-retrofit2-retrofit2.yaml index 0729bf8ecd8..339b171cb3a 100644 --- a/bin/configs/unmaintained/kotlin-jvm-retrofit2-retrofit2.yaml +++ b/bin/configs/unmaintained/kotlin-jvm-retrofit2-retrofit2.yaml @@ -1,7 +1,7 @@ generatorName: kotlin outputDir: samples/client/petstore/kotlin-retrofit2 library: jvm-retrofit2 -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/kotlin-client +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/kotlin-client additionalProperties: artifactId: kotlin-petstore-retrofit2 diff --git a/bin/configs/unmaintained/kotlin-jvm-retrofit2-rx.yaml b/bin/configs/unmaintained/kotlin-jvm-retrofit2-rx.yaml index 882aa38c7c5..eef96c14455 100644 --- a/bin/configs/unmaintained/kotlin-jvm-retrofit2-rx.yaml +++ b/bin/configs/unmaintained/kotlin-jvm-retrofit2-rx.yaml @@ -1,8 +1,8 @@ generatorName: kotlin outputDir: samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx library: jvm-retrofit2 -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/kotlin-client +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/kotlin-client additionalProperties: serializationLibrary: gson useRxJava: "true" diff --git a/bin/configs/unmaintained/kotlin-jvm-retrofit2-rx2-kotlinx_serialization.yaml b/bin/configs/unmaintained/kotlin-jvm-retrofit2-rx2-kotlinx_serialization.yaml index afd9f324186..23cda2462ce 100644 --- a/bin/configs/unmaintained/kotlin-jvm-retrofit2-rx2-kotlinx_serialization.yaml +++ b/bin/configs/unmaintained/kotlin-jvm-retrofit2-rx2-kotlinx_serialization.yaml @@ -1,8 +1,8 @@ generatorName: kotlin outputDir: samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2-kotlinx_serialization library: jvm-retrofit2 -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/kotlin-client +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/kotlin-client additionalProperties: serializationLibrary: kotlinx_serialization useRxJava2: "true" diff --git a/bin/configs/unmaintained/kotlin-jvm-retrofit2-rx2.yaml b/bin/configs/unmaintained/kotlin-jvm-retrofit2-rx2.yaml index 2332ff3be1f..b4349b65d4c 100644 --- a/bin/configs/unmaintained/kotlin-jvm-retrofit2-rx2.yaml +++ b/bin/configs/unmaintained/kotlin-jvm-retrofit2-rx2.yaml @@ -1,8 +1,8 @@ generatorName: kotlin outputDir: samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2 library: jvm-retrofit2 -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/kotlin-client +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/kotlin-client additionalProperties: serializationLibrary: gson useRxJava2: "true" diff --git a/bin/configs/unmaintained/kotlin-jvm-retrofit2-rx3.yaml b/bin/configs/unmaintained/kotlin-jvm-retrofit2-rx3.yaml index 06284f2fa24..e37add02caa 100644 --- a/bin/configs/unmaintained/kotlin-jvm-retrofit2-rx3.yaml +++ b/bin/configs/unmaintained/kotlin-jvm-retrofit2-rx3.yaml @@ -1,8 +1,8 @@ generatorName: kotlin outputDir: samples/client/petstore/kotlin-retrofit2-rx3 library: jvm-retrofit2 -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/kotlin-client +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/kotlin-client additionalProperties: artifactId: kotlin-petstore-retrofit2-rx3 useRxJava3: "true" diff --git a/bin/configs/unmaintained/kotlin-jvm-volley.yaml b/bin/configs/unmaintained/kotlin-jvm-volley.yaml index cdb8ac51a9b..fdeee4aef5d 100644 --- a/bin/configs/unmaintained/kotlin-jvm-volley.yaml +++ b/bin/configs/unmaintained/kotlin-jvm-volley.yaml @@ -1,8 +1,8 @@ generatorName: kotlin outputDir: samples/client/petstore/kotlin-jvm-volley library: jvm-volley -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/kotlin-client +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/kotlin-client additionalProperties: artifactId: kotlin-petstore-jvm-volley generateRoomModels: "true" diff --git a/bin/configs/unmaintained/kotlin-modelMutable.yaml b/bin/configs/unmaintained/kotlin-modelMutable.yaml index 584224804ed..2f826fe805a 100644 --- a/bin/configs/unmaintained/kotlin-modelMutable.yaml +++ b/bin/configs/unmaintained/kotlin-modelMutable.yaml @@ -1,7 +1,7 @@ generatorName: kotlin outputDir: samples/client/petstore/kotlin-modelMutable -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/kotlin-client +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/kotlin-client additionalProperties: artifactId: kotlin-modelMutable modelMutable: "true" diff --git a/bin/configs/unmaintained/kotlin-moshi-codegen.yaml b/bin/configs/unmaintained/kotlin-moshi-codegen.yaml index 00536bbf1cf..4ac46de4525 100644 --- a/bin/configs/unmaintained/kotlin-moshi-codegen.yaml +++ b/bin/configs/unmaintained/kotlin-moshi-codegen.yaml @@ -1,7 +1,7 @@ generatorName: kotlin outputDir: samples/client/petstore/kotlin-moshi-codegen -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/kotlin-client +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/kotlin-client additionalProperties: serializationLibrary: moshi artifactId: kotlin-petstore-moshi-codegen diff --git a/bin/configs/unmaintained/kotlin-multiplatform.yaml b/bin/configs/unmaintained/kotlin-multiplatform.yaml index ba50f38f678..aa7daba743a 100644 --- a/bin/configs/unmaintained/kotlin-multiplatform.yaml +++ b/bin/configs/unmaintained/kotlin-multiplatform.yaml @@ -1,7 +1,7 @@ generatorName: kotlin outputDir: samples/client/petstore/kotlin-multiplatform library: multiplatform -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/kotlin-client +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/kotlin-client additionalProperties: artifactId: kotlin-client-petstore-multiplatform diff --git a/bin/configs/unmaintained/kotlin-nonpublic.yaml b/bin/configs/unmaintained/kotlin-nonpublic.yaml index fbc64ceb00d..76deef93958 100644 --- a/bin/configs/unmaintained/kotlin-nonpublic.yaml +++ b/bin/configs/unmaintained/kotlin-nonpublic.yaml @@ -1,7 +1,7 @@ generatorName: kotlin outputDir: samples/client/petstore/kotlin-nonpublic -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/kotlin-client +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/kotlin-client additionalProperties: nonPublicApi: "true" artifactId: kotlin-petstore-nonpublic diff --git a/bin/configs/unmaintained/kotlin-nullable.yaml b/bin/configs/unmaintained/kotlin-nullable.yaml index 27fe5c6b0d8..295d3f735b6 100644 --- a/bin/configs/unmaintained/kotlin-nullable.yaml +++ b/bin/configs/unmaintained/kotlin-nullable.yaml @@ -1,7 +1,7 @@ generatorName: kotlin outputDir: samples/client/petstore/kotlin-nullable -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/kotlin-client +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/kotlin-client additionalProperties: artifactId: kotlin-petstore-nullable serializableModel: "true" diff --git a/bin/configs/unmaintained/kotlin-server-jaxrs-spec.yaml b/bin/configs/unmaintained/kotlin-server-jaxrs-spec.yaml index 11d4fcec7a8..f7fc70a5f83 100644 --- a/bin/configs/unmaintained/kotlin-server-jaxrs-spec.yaml +++ b/bin/configs/unmaintained/kotlin-server-jaxrs-spec.yaml @@ -1,7 +1,7 @@ generatorName: kotlin-server outputDir: samples/server/petstore/kotlin-server/jaxrs-spec library: jaxrs-spec -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/kotlin-server +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/kotlin-server additionalProperties: useCoroutines: "true" diff --git a/bin/configs/unmaintained/kotlin-server-ktor.yaml b/bin/configs/unmaintained/kotlin-server-ktor.yaml index ad5bce1047e..eefb12a080e 100644 --- a/bin/configs/unmaintained/kotlin-server-ktor.yaml +++ b/bin/configs/unmaintained/kotlin-server-ktor.yaml @@ -1,8 +1,8 @@ generatorName: kotlin-server outputDir: samples/server/petstore/kotlin-server/ktor library: ktor -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/kotlin-server +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/kotlin-server additionalProperties: hideGenerationTimestamp: "true" serializableModel: "true" diff --git a/bin/configs/unmaintained/kotlin-server-modelMutable.yaml b/bin/configs/unmaintained/kotlin-server-modelMutable.yaml index 1af6d3edb62..4e6de035ece 100644 --- a/bin/configs/unmaintained/kotlin-server-modelMutable.yaml +++ b/bin/configs/unmaintained/kotlin-server-modelMutable.yaml @@ -1,8 +1,8 @@ generatorName: kotlin-server outputDir: samples/server/petstore/kotlin-server-modelMutable library: ktor -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/kotlin-server +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/kotlin-server additionalProperties: hideGenerationTimestamp: "true" modelMutable: "true" diff --git a/bin/configs/unmaintained/kotlin-spring-boot-delegate.yaml b/bin/configs/unmaintained/kotlin-spring-boot-delegate.yaml index 56adfb9f46c..a9da474ce3c 100644 --- a/bin/configs/unmaintained/kotlin-spring-boot-delegate.yaml +++ b/bin/configs/unmaintained/kotlin-spring-boot-delegate.yaml @@ -1,8 +1,8 @@ generatorName: kotlin-spring outputDir: samples/server/petstore/kotlin-springboot-delegate library: spring-boot -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/kotlin-spring +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/kotlin-spring additionalProperties: documentationProvider: springdoc annotationLibrary: swagger2 diff --git a/bin/configs/unmaintained/kotlin-spring-boot-modelMutable.yaml b/bin/configs/unmaintained/kotlin-spring-boot-modelMutable.yaml index 6a75dc2d04a..26acb8c936f 100644 --- a/bin/configs/unmaintained/kotlin-spring-boot-modelMutable.yaml +++ b/bin/configs/unmaintained/kotlin-spring-boot-modelMutable.yaml @@ -1,8 +1,8 @@ generatorName: kotlin-spring outputDir: samples/server/petstore/kotlin-springboot-modelMutable library: spring-boot -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/kotlin-spring +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/kotlin-spring additionalProperties: documentationProvider: springdoc annotationLibrary: swagger2 diff --git a/bin/configs/unmaintained/kotlin-spring-boot-reactive.yaml b/bin/configs/unmaintained/kotlin-spring-boot-reactive.yaml index f9a3f199679..1012c40c4d0 100644 --- a/bin/configs/unmaintained/kotlin-spring-boot-reactive.yaml +++ b/bin/configs/unmaintained/kotlin-spring-boot-reactive.yaml @@ -1,8 +1,8 @@ generatorName: kotlin-spring outputDir: samples/server/petstore/kotlin-springboot-reactive library: spring-boot -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/kotlin-spring +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/kotlin-spring additionalProperties: documentationProvider: springdoc annotationLibrary: swagger2 diff --git a/bin/configs/unmaintained/kotlin-spring-boot-source-swagger1.yaml b/bin/configs/unmaintained/kotlin-spring-boot-source-swagger1.yaml index 5f877b6c9a1..0e53e5521eb 100644 --- a/bin/configs/unmaintained/kotlin-spring-boot-source-swagger1.yaml +++ b/bin/configs/unmaintained/kotlin-spring-boot-source-swagger1.yaml @@ -1,8 +1,8 @@ generatorName: kotlin-spring outputDir: samples/server/petstore/kotlin-springboot-source-swagger1 library: spring-boot -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/kotlin-spring +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/kotlin-spring additionalProperties: documentationProvider: source annotationLibrary: swagger1 diff --git a/bin/configs/unmaintained/kotlin-spring-boot-source-swagger2.yaml b/bin/configs/unmaintained/kotlin-spring-boot-source-swagger2.yaml index bd08d444d47..8e1671e3520 100644 --- a/bin/configs/unmaintained/kotlin-spring-boot-source-swagger2.yaml +++ b/bin/configs/unmaintained/kotlin-spring-boot-source-swagger2.yaml @@ -1,8 +1,8 @@ generatorName: kotlin-spring outputDir: samples/server/petstore/kotlin-springboot-source-swagger2 library: spring-boot -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/kotlin-spring +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/kotlin-spring additionalProperties: documentationProvider: source annotationLibrary: swagger2 diff --git a/bin/configs/unmaintained/kotlin-spring-boot-springfox.yaml b/bin/configs/unmaintained/kotlin-spring-boot-springfox.yaml index 9e0bc3e274c..f7f375894eb 100644 --- a/bin/configs/unmaintained/kotlin-spring-boot-springfox.yaml +++ b/bin/configs/unmaintained/kotlin-spring-boot-springfox.yaml @@ -1,8 +1,8 @@ generatorName: kotlin-spring outputDir: samples/server/petstore/kotlin-springboot-springfox library: spring-boot -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/kotlin-spring +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/kotlin-spring additionalProperties: documentationProvider: springfox annotationLibrary: swagger1 diff --git a/bin/configs/unmaintained/kotlin-spring-boot.yaml b/bin/configs/unmaintained/kotlin-spring-boot.yaml index e727be7ebdf..33ca6a04788 100644 --- a/bin/configs/unmaintained/kotlin-spring-boot.yaml +++ b/bin/configs/unmaintained/kotlin-spring-boot.yaml @@ -1,8 +1,8 @@ generatorName: kotlin-spring outputDir: samples/server/petstore/kotlin-springboot library: spring-boot -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/kotlin-spring +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/kotlin-spring additionalProperties: documentationProvider: none annotationLibrary: none diff --git a/bin/configs/unmaintained/kotlin-string.yaml b/bin/configs/unmaintained/kotlin-string.yaml index e6cd63e4b40..0b3a53fd048 100644 --- a/bin/configs/unmaintained/kotlin-string.yaml +++ b/bin/configs/unmaintained/kotlin-string.yaml @@ -1,7 +1,7 @@ generatorName: kotlin outputDir: samples/client/petstore/kotlin-string -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/kotlin-client +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/kotlin-client additionalProperties: artifactId: kotlin-petstore-string serializableModel: "true" diff --git a/bin/configs/unmaintained/kotlin-threetenbp.yaml b/bin/configs/unmaintained/kotlin-threetenbp.yaml index 02c900e8e03..7ec1edc4f4e 100644 --- a/bin/configs/unmaintained/kotlin-threetenbp.yaml +++ b/bin/configs/unmaintained/kotlin-threetenbp.yaml @@ -1,7 +1,7 @@ generatorName: kotlin outputDir: samples/client/petstore/kotlin-threetenbp -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/kotlin-client +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/kotlin-client additionalProperties: artifactId: kotlin-petstore-threetenbp dateLibrary: threetenbp diff --git a/bin/configs/unmaintained/kotlin-uppercase-enum.yaml b/bin/configs/unmaintained/kotlin-uppercase-enum.yaml index f4066ef7db9..727a19c4ebb 100644 --- a/bin/configs/unmaintained/kotlin-uppercase-enum.yaml +++ b/bin/configs/unmaintained/kotlin-uppercase-enum.yaml @@ -1,7 +1,7 @@ generatorName: kotlin outputDir: samples/client/petstore/kotlin-uppercase-enum -inputSpec: modules/openapi-generator/src/test/resources/3_0/issue-4062.yaml -templateDir: modules/openapi-generator/src/main/resources/kotlin-client +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/issue-4062.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/kotlin-client additionalProperties: artifactId: kotlin-uppercase-enum enumPropertyNaming: UPPERCASE diff --git a/bin/configs/unmaintained/kotlin-vertx-modelMutable.yaml b/bin/configs/unmaintained/kotlin-vertx-modelMutable.yaml index 2f61ae3ba9a..9bb176694ed 100644 --- a/bin/configs/unmaintained/kotlin-vertx-modelMutable.yaml +++ b/bin/configs/unmaintained/kotlin-vertx-modelMutable.yaml @@ -1,6 +1,6 @@ generatorName: kotlin-vertx outputDir: samples/server/petstore/kotlin-vertx-modelMutable -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/kotlin-vertx-server +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/kotlin-vertx-server additionalProperties: modelMutable: "true" diff --git a/bin/configs/unmaintained/kotlin-vertx-vertx.yaml b/bin/configs/unmaintained/kotlin-vertx-vertx.yaml index 64efa733325..f19d8efec09 100644 --- a/bin/configs/unmaintained/kotlin-vertx-vertx.yaml +++ b/bin/configs/unmaintained/kotlin-vertx-vertx.yaml @@ -1,6 +1,6 @@ generatorName: kotlin-vertx outputDir: samples/server/petstore/kotlin/vertx -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/kotlin-vertx-server +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/kotlin-vertx-server additionalProperties: modelMutable: "false" diff --git a/bin/configs/unmaintained/kotlin.yaml b/bin/configs/unmaintained/kotlin.yaml index 136fff6480d..fe5d12e879d 100644 --- a/bin/configs/unmaintained/kotlin.yaml +++ b/bin/configs/unmaintained/kotlin.yaml @@ -1,7 +1,7 @@ generatorName: kotlin outputDir: samples/client/petstore/kotlin -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/kotlin-client +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/kotlin-client additionalProperties: artifactId: kotlin-petstore-client serializableModel: "true" diff --git a/bin/configs/unmaintained/ktorm-schema-modelMutable.yaml b/bin/configs/unmaintained/ktorm-schema-modelMutable.yaml index dc63925fbad..89b5b0e4b8b 100644 --- a/bin/configs/unmaintained/ktorm-schema-modelMutable.yaml +++ b/bin/configs/unmaintained/ktorm-schema-modelMutable.yaml @@ -1,8 +1,8 @@ generatorName: ktorm-schema outputDir: samples/schema/petstore/ktorm-modelMutable -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/ktorm-schema +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/ktorm-schema additionalProperties: hideGenerationTimestamp: true - importModelPackageName: org.openapitools.client.models + importModelPackageName: org.openapijsonschematools.client.models modelMutable: "true" diff --git a/bin/configs/unmaintained/ktorm-schema.yaml b/bin/configs/unmaintained/ktorm-schema.yaml index d3c5beb9a33..ed227055c2b 100644 --- a/bin/configs/unmaintained/ktorm-schema.yaml +++ b/bin/configs/unmaintained/ktorm-schema.yaml @@ -1,7 +1,7 @@ generatorName: ktorm-schema outputDir: samples/schema/petstore/ktorm -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/ktorm-schema +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/ktorm-schema additionalProperties: hideGenerationTimestamp: true - importModelPackageName: org.openapitools.client.models + importModelPackageName: org.openapijsonschematools.client.models diff --git a/bin/configs/unmaintained/lua.yaml b/bin/configs/unmaintained/lua.yaml index 280cf32e741..34b15caf22c 100644 --- a/bin/configs/unmaintained/lua.yaml +++ b/bin/configs/unmaintained/lua.yaml @@ -1,6 +1,6 @@ generatorName: lua outputDir: samples/client/petstore/lua -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/lua +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/lua additionalProperties: packageName: petstore diff --git a/bin/configs/unmaintained/markdown.yaml b/bin/configs/unmaintained/markdown.yaml index 9b490267160..34324ea5c0f 100644 --- a/bin/configs/unmaintained/markdown.yaml +++ b/bin/configs/unmaintained/markdown.yaml @@ -1,4 +1,4 @@ generatorName: markdown outputDir: samples/documentation/markdown -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/markdown-documentation +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/markdown-documentation diff --git a/bin/configs/unmaintained/mysql-schema-mysql.yaml b/bin/configs/unmaintained/mysql-schema-mysql.yaml index 4a4811ae106..a69bbf4f5f3 100644 --- a/bin/configs/unmaintained/mysql-schema-mysql.yaml +++ b/bin/configs/unmaintained/mysql-schema-mysql.yaml @@ -1,4 +1,4 @@ generatorName: mysql-schema outputDir: samples/schema/petstore/mysql -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/mysql-schema +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/mysql-schema diff --git a/bin/configs/unmaintained/nim.yaml b/bin/configs/unmaintained/nim.yaml index 13a27a6b764..9a47bda0cd7 100644 --- a/bin/configs/unmaintained/nim.yaml +++ b/bin/configs/unmaintained/nim.yaml @@ -1,6 +1,6 @@ generatorName: nim outputDir: samples/client/petstore/nim -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/nim-client +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/nim-client additionalProperties: packageName: petstore diff --git a/bin/configs/unmaintained/nodejs-express-server.yaml b/bin/configs/unmaintained/nodejs-express-server.yaml index 96c577ffacb..7c03537bdd3 100644 --- a/bin/configs/unmaintained/nodejs-express-server.yaml +++ b/bin/configs/unmaintained/nodejs-express-server.yaml @@ -1,4 +1,4 @@ generatorName: nodejs-express-server outputDir: samples/server/petstore/nodejs-express-server -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/nodejs-express-server +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/nodejs-express-server diff --git a/bin/configs/unmaintained/objc-core-data.yaml b/bin/configs/unmaintained/objc-core-data.yaml index 7625d0934ce..e11912b55a8 100644 --- a/bin/configs/unmaintained/objc-core-data.yaml +++ b/bin/configs/unmaintained/objc-core-data.yaml @@ -1,7 +1,7 @@ generatorName: objc outputDir: samples/client/petstore/objc/core-data -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.json -templateDir: modules/openapi-generator/src/main/resources/objc +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.json +templateDir: modules/openapi-json-schema-generator/src/main/resources/objc additionalProperties: classPrefix: SWG podName: SwaggerClient diff --git a/bin/configs/unmaintained/objc-default.yaml b/bin/configs/unmaintained/objc-default.yaml index 5acc6b0c916..79c65dec6d9 100644 --- a/bin/configs/unmaintained/objc-default.yaml +++ b/bin/configs/unmaintained/objc-default.yaml @@ -1,7 +1,7 @@ generatorName: objc outputDir: samples/client/petstore/objc/default -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.json -templateDir: modules/openapi-generator/src/main/resources/objc +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.json +templateDir: modules/openapi-json-schema-generator/src/main/resources/objc additionalProperties: classPrefix: SWG podName: SwaggerClient diff --git a/bin/configs/unmaintained/ocaml.yaml b/bin/configs/unmaintained/ocaml.yaml index 1933d84fb7d..8fed8e2c568 100644 --- a/bin/configs/unmaintained/ocaml.yaml +++ b/bin/configs/unmaintained/ocaml.yaml @@ -1,6 +1,6 @@ generatorName: ocaml outputDir: samples/client/petstore/ocaml -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/ocaml +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/ocaml additionalProperties: packageName: petstore_client diff --git a/bin/configs/unmaintained/openapi3/android-httpclient.yaml b/bin/configs/unmaintained/openapi3/android-httpclient.yaml index e06c7a66fae..54d88753ad8 100644 --- a/bin/configs/unmaintained/openapi3/android-httpclient.yaml +++ b/bin/configs/unmaintained/openapi3/android-httpclient.yaml @@ -1,5 +1,5 @@ generatorName: android outputDir: samples/client/petstore/android/httpclient library: httpclient -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/android +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/android diff --git a/bin/configs/unmaintained/openapi3/android-volley.yaml b/bin/configs/unmaintained/openapi3/android-volley.yaml index eee8b0e3e33..349531da02a 100644 --- a/bin/configs/unmaintained/openapi3/android-volley.yaml +++ b/bin/configs/unmaintained/openapi3/android-volley.yaml @@ -1,7 +1,7 @@ generatorName: android outputDir: samples/client/petstore/android/volley library: volley -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/android +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/android additionalProperties: artifactId: petstore-android-volley diff --git a/bin/configs/unmaintained/openapi3/avro-schema.yaml b/bin/configs/unmaintained/openapi3/avro-schema.yaml index bf44846dc07..2661d6af222 100644 --- a/bin/configs/unmaintained/openapi3/avro-schema.yaml +++ b/bin/configs/unmaintained/openapi3/avro-schema.yaml @@ -1,4 +1,4 @@ generatorName: avro-schema outputDir: samples/openapi3/schema/petstore/avro-schema -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/avro-schema +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/avro-schema diff --git a/bin/configs/unmaintained/openapi3/bash.yaml b/bin/configs/unmaintained/openapi3/bash.yaml index 04de158b3fc..8fff5343d72 100644 --- a/bin/configs/unmaintained/openapi3/bash.yaml +++ b/bin/configs/unmaintained/openapi3/bash.yaml @@ -1,7 +1,7 @@ generatorName: bash outputDir: samples/client/petstore/bash -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/bash +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/bash additionalProperties: generateZshCompletion: true hostEnvironmentVariable: PETSTORE_HOST diff --git a/bin/configs/unmaintained/openapi3/clojure.yaml b/bin/configs/unmaintained/openapi3/clojure.yaml index 3c526d5ac10..bd5f3a20d29 100644 --- a/bin/configs/unmaintained/openapi3/clojure.yaml +++ b/bin/configs/unmaintained/openapi3/clojure.yaml @@ -1,4 +1,4 @@ generatorName: clojure outputDir: samples/client/petstore/clojure -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.json -templateDir: modules/openapi-generator/src/main/resources/clojure +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.json +templateDir: modules/openapi-json-schema-generator/src/main/resources/clojure diff --git a/bin/configs/unmaintained/openapi3/cpp-pistache-server-cpp-pistache.yaml b/bin/configs/unmaintained/openapi3/cpp-pistache-server-cpp-pistache.yaml index 4faabff095d..a3610fead18 100644 --- a/bin/configs/unmaintained/openapi3/cpp-pistache-server-cpp-pistache.yaml +++ b/bin/configs/unmaintained/openapi3/cpp-pistache-server-cpp-pistache.yaml @@ -1,4 +1,4 @@ generatorName: cpp-pistache-server outputDir: samples/server/petstore/cpp-pistache -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/cpp-pistache-server +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/cpp-pistache-server diff --git a/bin/configs/unmaintained/openapi3/cpp-qt5-client-cpp-qt5.yaml b/bin/configs/unmaintained/openapi3/cpp-qt5-client-cpp-qt5.yaml index 904d99a7510..92cc7e9449a 100644 --- a/bin/configs/unmaintained/openapi3/cpp-qt5-client-cpp-qt5.yaml +++ b/bin/configs/unmaintained/openapi3/cpp-qt5-client-cpp-qt5.yaml @@ -1,4 +1,4 @@ generatorName: cpp-qt5-client outputDir: samples/client/petstore/cpp-qt5 -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/cpp-qt5-client +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/cpp-qt5-client diff --git a/bin/configs/unmaintained/openapi3/cpp-qt5-qhttpengine-server.yaml b/bin/configs/unmaintained/openapi3/cpp-qt5-qhttpengine-server.yaml index 285c0d9d5dd..b8a217a8962 100644 --- a/bin/configs/unmaintained/openapi3/cpp-qt5-qhttpengine-server.yaml +++ b/bin/configs/unmaintained/openapi3/cpp-qt5-qhttpengine-server.yaml @@ -1,4 +1,4 @@ generatorName: cpp-qt5-qhttpengine-server outputDir: samples/client/petstore/cpp-qt5-qhttpengine-server -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/cpp-qt5-qhttpengine-server diff --git a/bin/configs/unmaintained/openapi3/cpp-restbed-server-cpp-restbed-deprecated.yaml b/bin/configs/unmaintained/openapi3/cpp-restbed-server-cpp-restbed-deprecated.yaml index 8a9b93fffe8..fcca00b51e2 100644 --- a/bin/configs/unmaintained/openapi3/cpp-restbed-server-cpp-restbed-deprecated.yaml +++ b/bin/configs/unmaintained/openapi3/cpp-restbed-server-cpp-restbed-deprecated.yaml @@ -1,4 +1,4 @@ generatorName: cpp-restbed-server-deprecated outputDir: samples/server/petstore/cpp-restbed-deprecated -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/cpp-restbed-server-deprecated +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/cpp-restbed-server-deprecated diff --git a/bin/configs/unmaintained/openapi3/cpp-restbed-server-cpp-restbed.yaml b/bin/configs/unmaintained/openapi3/cpp-restbed-server-cpp-restbed.yaml index 6dc3929ec08..5ec72950719 100644 --- a/bin/configs/unmaintained/openapi3/cpp-restbed-server-cpp-restbed.yaml +++ b/bin/configs/unmaintained/openapi3/cpp-restbed-server-cpp-restbed.yaml @@ -1,4 +1,4 @@ generatorName: cpp-restbed-server outputDir: samples/server/petstore/cpp-restbed/generated/3_0 -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/cpp-restbed-server +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/cpp-restbed-server diff --git a/bin/configs/unmaintained/openapi3/cpp-tizen.yaml b/bin/configs/unmaintained/openapi3/cpp-tizen.yaml index 4f8d0e2a8c5..9f853164f68 100644 --- a/bin/configs/unmaintained/openapi3/cpp-tizen.yaml +++ b/bin/configs/unmaintained/openapi3/cpp-tizen.yaml @@ -1,4 +1,4 @@ generatorName: cpp-tizen outputDir: samples/client/petstore/cpp-tizen -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/cpp-tizen-client +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/cpp-tizen-client diff --git a/bin/configs/unmaintained/openapi3/csharp-OpenAPIClient.yaml b/bin/configs/unmaintained/openapi3/csharp-OpenAPIClient.yaml index 24a5fd2b5b3..d0263f5f694 100644 --- a/bin/configs/unmaintained/openapi3/csharp-OpenAPIClient.yaml +++ b/bin/configs/unmaintained/openapi3/csharp-OpenAPIClient.yaml @@ -1,6 +1,6 @@ generatorName: csharp outputDir: samples/openapi3/client/petstore/csharp/OpenAPIClient -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/csharp +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/csharp additionalProperties: packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}' diff --git a/bin/configs/unmaintained/openapi3/csharp-OpenAPIClientNetStandard.yaml b/bin/configs/unmaintained/openapi3/csharp-OpenAPIClientNetStandard.yaml index e2dcfd8e9a2..e97b412cb12 100644 --- a/bin/configs/unmaintained/openapi3/csharp-OpenAPIClientNetStandard.yaml +++ b/bin/configs/unmaintained/openapi3/csharp-OpenAPIClientNetStandard.yaml @@ -1,7 +1,7 @@ generatorName: csharp outputDir: samples/client/petstore/csharp/OpenAPIClientNetStandard -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/csharp +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/csharp additionalProperties: targetFramework: netstandard1.3 packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}' diff --git a/bin/configs/unmaintained/openapi3/csharp-OpenAPIClientWithPropertyChanged.yaml b/bin/configs/unmaintained/openapi3/csharp-OpenAPIClientWithPropertyChanged.yaml index 03034797145..aea9a2cbde2 100644 --- a/bin/configs/unmaintained/openapi3/csharp-OpenAPIClientWithPropertyChanged.yaml +++ b/bin/configs/unmaintained/openapi3/csharp-OpenAPIClientWithPropertyChanged.yaml @@ -1,7 +1,7 @@ generatorName: csharp outputDir: samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/csharp +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/csharp additionalProperties: packageGuid: '{5CD900DE-8266-412F-A758-28E1F9C623D5}' generatePropertyChanged: "true" diff --git a/bin/configs/unmaintained/openapi3/csharp-dotnet2-OpenAPIClient.yaml b/bin/configs/unmaintained/openapi3/csharp-dotnet2-OpenAPIClient.yaml index 428ce87b8b9..58d0a84ced8 100644 --- a/bin/configs/unmaintained/openapi3/csharp-dotnet2-OpenAPIClient.yaml +++ b/bin/configs/unmaintained/openapi3/csharp-dotnet2-OpenAPIClient.yaml @@ -1,6 +1,6 @@ generatorName: csharp-dotnet2 outputDir: samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/csharp-dotnet2 +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/csharp-dotnet2 additionalProperties: hideGenerationTimestamp: "true" diff --git a/bin/configs/unmaintained/openapi3/elixir.yaml b/bin/configs/unmaintained/openapi3/elixir.yaml index 79dd519cb1b..dc3235a3347 100644 --- a/bin/configs/unmaintained/openapi3/elixir.yaml +++ b/bin/configs/unmaintained/openapi3/elixir.yaml @@ -1,4 +1,4 @@ generatorName: elixir outputDir: samples/client/petstore/elixir -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/elixir +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/elixir diff --git a/bin/configs/unmaintained/openapi3/go-gin-server-go-gin-api-server.yaml b/bin/configs/unmaintained/openapi3/go-gin-server-go-gin-api-server.yaml index 81932e5d67a..7d0fe8d2dfd 100644 --- a/bin/configs/unmaintained/openapi3/go-gin-server-go-gin-api-server.yaml +++ b/bin/configs/unmaintained/openapi3/go-gin-server-go-gin-api-server.yaml @@ -1,7 +1,7 @@ generatorName: go-gin-server outputDir: samples/openapi3/server/petstore/go-gin-api-server -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/go-gin-server +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/go-gin-server additionalProperties: hideGenerationTimestamp: "true" packageName: petstoreserver diff --git a/bin/configs/unmaintained/openapi3/go-petstore.yaml b/bin/configs/unmaintained/openapi3/go-petstore.yaml index aefc71b9011..4ce5aaab2b1 100644 --- a/bin/configs/unmaintained/openapi3/go-petstore.yaml +++ b/bin/configs/unmaintained/openapi3/go-petstore.yaml @@ -1,7 +1,7 @@ generatorName: go outputDir: samples/openapi3/client/petstore/go/go-petstore -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/go +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/go additionalProperties: enumClassPrefix: "true" packageName: petstore diff --git a/bin/configs/unmaintained/openapi3/go-server-go-api-server.yaml b/bin/configs/unmaintained/openapi3/go-server-go-api-server.yaml index c5c85b26daa..41f603157be 100644 --- a/bin/configs/unmaintained/openapi3/go-server-go-api-server.yaml +++ b/bin/configs/unmaintained/openapi3/go-server-go-api-server.yaml @@ -1,7 +1,7 @@ generatorName: go-server outputDir: samples/openapi3/server/petstore/go-api-server -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/go-server +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/go-server additionalProperties: hideGenerationTimestamp: "true" packageName: petstoreserver diff --git a/bin/configs/unmaintained/openapi3/graphql-nodejs-express-server.yaml b/bin/configs/unmaintained/openapi3/graphql-nodejs-express-server.yaml index 52f9f68d239..b852ab8e797 100644 --- a/bin/configs/unmaintained/openapi3/graphql-nodejs-express-server.yaml +++ b/bin/configs/unmaintained/openapi3/graphql-nodejs-express-server.yaml @@ -1,6 +1,6 @@ generatorName: graphql-nodejs-express-server outputDir: samples/server/petstore/graphql-nodejs-express-server -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/graphql-nodejs-express-server +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/graphql-nodejs-express-server additionalProperties: packageName: petstore diff --git a/bin/configs/unmaintained/openapi3/haskell-http-client.yaml b/bin/configs/unmaintained/openapi3/haskell-http-client.yaml index 7e16cbc5731..cb1d69a5caf 100644 --- a/bin/configs/unmaintained/openapi3/haskell-http-client.yaml +++ b/bin/configs/unmaintained/openapi3/haskell-http-client.yaml @@ -1,4 +1,4 @@ generatorName: haskell-http-client outputDir: samples/client/petstore/haskell-http-client -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/haskell-http-client +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/haskell-http-client diff --git a/bin/configs/unmaintained/openapi3/haskell-servant.yaml b/bin/configs/unmaintained/openapi3/haskell-servant.yaml index 579db01c7f2..88bd670fb49 100644 --- a/bin/configs/unmaintained/openapi3/haskell-servant.yaml +++ b/bin/configs/unmaintained/openapi3/haskell-servant.yaml @@ -1,4 +1,4 @@ generatorName: haskell outputDir: samples/server/petstore/haskell-servant -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/haskell-servant +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/haskell-servant diff --git a/bin/configs/unmaintained/openapi3/javascript-closure-angular.yaml b/bin/configs/unmaintained/openapi3/javascript-closure-angular.yaml index dd3caa461ec..6ebadc57b80 100644 --- a/bin/configs/unmaintained/openapi3/javascript-closure-angular.yaml +++ b/bin/configs/unmaintained/openapi3/javascript-closure-angular.yaml @@ -1,4 +1,4 @@ generatorName: javascript-closure-angular outputDir: samples/client/petstore/javascript-closure-angular -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/Javascript-Closure-Angular +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/Javascript-Closure-Angular diff --git a/bin/configs/unmaintained/openapi3/jaxrs-cxf-client-jackson-nullable.yaml b/bin/configs/unmaintained/openapi3/jaxrs-cxf-client-jackson-nullable.yaml index c7e0393d752..d2604ee793a 100644 --- a/bin/configs/unmaintained/openapi3/jaxrs-cxf-client-jackson-nullable.yaml +++ b/bin/configs/unmaintained/openapi3/jaxrs-cxf-client-jackson-nullable.yaml @@ -1,6 +1,6 @@ generatorName: jaxrs-cxf-client outputDir: samples/openapi3/client/petstore/jaxrs-cxf-client-jackson-nullable -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS/cxf +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaJaxRS/cxf additionalProperties: jackson: "true" \ No newline at end of file diff --git a/bin/configs/unmaintained/openapi3/jaxrs-cxf-client.yaml b/bin/configs/unmaintained/openapi3/jaxrs-cxf-client.yaml index 08cb8cd0a60..3902c9d721a 100644 --- a/bin/configs/unmaintained/openapi3/jaxrs-cxf-client.yaml +++ b/bin/configs/unmaintained/openapi3/jaxrs-cxf-client.yaml @@ -1,6 +1,6 @@ generatorName: jaxrs-cxf-client outputDir: samples/client/petstore/jaxrs-cxf-client -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS/cxf +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaJaxRS/cxf additionalProperties: artifactId: jaxrs-cxf-petstore-client diff --git a/bin/configs/unmaintained/openapi3/php-laravel.yaml b/bin/configs/unmaintained/openapi3/php-laravel.yaml index 3a405cc6736..5298ab22fbc 100644 --- a/bin/configs/unmaintained/openapi3/php-laravel.yaml +++ b/bin/configs/unmaintained/openapi3/php-laravel.yaml @@ -1,4 +1,4 @@ generatorName: php-laravel outputDir: samples/server/petstore/php-laravel -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/php-laravel +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/php-laravel diff --git a/bin/configs/unmaintained/openapi3/php-slim4.yaml b/bin/configs/unmaintained/openapi3/php-slim4.yaml index a15c313a772..9e82f23efc1 100644 --- a/bin/configs/unmaintained/openapi3/php-slim4.yaml +++ b/bin/configs/unmaintained/openapi3/php-slim4.yaml @@ -1,4 +1,4 @@ generatorName: php-slim4 outputDir: samples/server/petstore/php-slim4 -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/php-slim4-server +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/php-slim4-server diff --git a/bin/configs/unmaintained/openapi3/php-symfony-SymfonyBundle-php.yaml b/bin/configs/unmaintained/openapi3/php-symfony-SymfonyBundle-php.yaml index ffb7015b650..925bba5f2d3 100644 --- a/bin/configs/unmaintained/openapi3/php-symfony-SymfonyBundle-php.yaml +++ b/bin/configs/unmaintained/openapi3/php-symfony-SymfonyBundle-php.yaml @@ -1,4 +1,4 @@ generatorName: php-symfony outputDir: samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/php-symfony +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/php-symfony diff --git a/bin/configs/unmaintained/openapi3/python-flask-python2.yaml b/bin/configs/unmaintained/openapi3/python-flask-python2.yaml index 407389d9121..4b70c823f57 100644 --- a/bin/configs/unmaintained/openapi3/python-flask-python2.yaml +++ b/bin/configs/unmaintained/openapi3/python-flask-python2.yaml @@ -1,6 +1,6 @@ generatorName: python-flask outputDir: samples/openapi3/server/petstore/python-flask-python2 -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-object-as-parameter.yaml -templateDir: modules/openapi-generator/src/main/resources/python-flask +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore-with-object-as-parameter.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/python-flask additionalProperties: supportPython2: true diff --git a/bin/configs/unmaintained/openapi3/python-flask.yaml b/bin/configs/unmaintained/openapi3/python-flask.yaml index aaca56bc6ee..024356e7903 100644 --- a/bin/configs/unmaintained/openapi3/python-flask.yaml +++ b/bin/configs/unmaintained/openapi3/python-flask.yaml @@ -1,4 +1,4 @@ generatorName: python-flask outputDir: samples/openapi3/server/petstore/python-flask -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-object-as-parameter.yaml -templateDir: modules/openapi-generator/src/main/resources/python-flask +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore-with-object-as-parameter.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/python-flask diff --git a/bin/configs/unmaintained/openapi3/r-R.yaml b/bin/configs/unmaintained/openapi3/r-R.yaml index 61be8bc8f11..830ae33fd7c 100644 --- a/bin/configs/unmaintained/openapi3/r-R.yaml +++ b/bin/configs/unmaintained/openapi3/r-R.yaml @@ -1,6 +1,6 @@ generatorName: r outputDir: samples/client/petstore/R -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/r +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/r additionalProperties: packageName: petstore diff --git a/bin/configs/unmaintained/openapi3/rust.yaml b/bin/configs/unmaintained/openapi3/rust.yaml index bb987820088..2154063108e 100644 --- a/bin/configs/unmaintained/openapi3/rust.yaml +++ b/bin/configs/unmaintained/openapi3/rust.yaml @@ -1,6 +1,6 @@ generatorName: rust outputDir: samples/client/petstore/rust -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/rust +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/rust additionalProperties: packageName: petstore_client diff --git a/bin/configs/unmaintained/openapi3/scala-finch.yaml b/bin/configs/unmaintained/openapi3/scala-finch.yaml index 3a9e69e674f..8ad535d4f71 100644 --- a/bin/configs/unmaintained/openapi3/scala-finch.yaml +++ b/bin/configs/unmaintained/openapi3/scala-finch.yaml @@ -1,4 +1,4 @@ generatorName: scala-finch outputDir: samples/server/petstore/scala-finch -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/scala-finch +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/scala-finch diff --git a/bin/configs/unmaintained/openapi3/typescript-angular-default.yaml b/bin/configs/unmaintained/openapi3/typescript-angular-default.yaml index 0fefcc8f6f3..b316bc17586 100644 --- a/bin/configs/unmaintained/openapi3/typescript-angular-default.yaml +++ b/bin/configs/unmaintained/openapi3/typescript-angular-default.yaml @@ -1,6 +1,6 @@ generatorName: typescript-angular outputDir: samples/client/petstore/typescript-angular/default -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-angular +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript-angular additionalProperties: ngVersion: 13.3.2 diff --git a/bin/configs/unmaintained/openapi3/typescript-angular-npm.yaml b/bin/configs/unmaintained/openapi3/typescript-angular-npm.yaml index 4533bbcd6cb..c4e913c0d2d 100644 --- a/bin/configs/unmaintained/openapi3/typescript-angular-npm.yaml +++ b/bin/configs/unmaintained/openapi3/typescript-angular-npm.yaml @@ -1,10 +1,10 @@ generatorName: typescript-angular outputDir: samples/client/petstore/typescript-angular/npm -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-angular +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript-angular additionalProperties: npmVersion: 0.0.1 ngVersion: 13.3.2 - npmName: '@openapitools/angular2-typescript-petstore' + npmName: '@openapijsonschematools/angular2-typescript-petstore' npmRepository: https://skimdb.npmjs.com/registry snapshot: false diff --git a/bin/configs/unmaintained/openapi3/typescript-angular-with-interfaces.yaml b/bin/configs/unmaintained/openapi3/typescript-angular-with-interfaces.yaml index 2b860ba10b6..725e225860e 100644 --- a/bin/configs/unmaintained/openapi3/typescript-angular-with-interfaces.yaml +++ b/bin/configs/unmaintained/openapi3/typescript-angular-with-interfaces.yaml @@ -1,7 +1,7 @@ generatorName: typescript-angular outputDir: samples/client/petstore/typescript-angular/with-interfaces -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-angular +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript-angular additionalProperties: withInterfaces: "true" ngVersion: 13.3.2 diff --git a/bin/configs/unmaintained/openapi3/typescript-aurelia-default.yaml b/bin/configs/unmaintained/openapi3/typescript-aurelia-default.yaml index 070074e0f64..c9bca96e6ac 100644 --- a/bin/configs/unmaintained/openapi3/typescript-aurelia-default.yaml +++ b/bin/configs/unmaintained/openapi3/typescript-aurelia-default.yaml @@ -1,4 +1,4 @@ generatorName: typescript-aurelia outputDir: samples/client/petstore/typescript-aurelia/default -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-aurelia +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript-aurelia diff --git a/bin/configs/unmaintained/openapi3/typescript-fetch-default.yaml b/bin/configs/unmaintained/openapi3/typescript-fetch-default.yaml index 3e7ffa489e8..f383b0ec912 100644 --- a/bin/configs/unmaintained/openapi3/typescript-fetch-default.yaml +++ b/bin/configs/unmaintained/openapi3/typescript-fetch-default.yaml @@ -1,4 +1,4 @@ generatorName: typescript-fetch outputDir: samples/client/petstore/typescript-fetch/builds/default -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-fetch +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript-fetch diff --git a/bin/configs/unmaintained/openapi3/typescript-fetch-es6-target.yaml b/bin/configs/unmaintained/openapi3/typescript-fetch-es6-target.yaml index 061f6290ab3..0c9db415e42 100644 --- a/bin/configs/unmaintained/openapi3/typescript-fetch-es6-target.yaml +++ b/bin/configs/unmaintained/openapi3/typescript-fetch-es6-target.yaml @@ -1,10 +1,10 @@ generatorName: typescript-fetch outputDir: samples/client/petstore/typescript-fetch/builds/es6-target -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-fetch +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript-fetch additionalProperties: npmVersion: 1.0.0 supportsES6: true - npmName: '@openapitools/typescript-fetch-petstore' + npmName: '@openapijsonschematools/typescript-fetch-petstore' npmRepository: https://skimdb.npmjs.com/registry snapshot: false diff --git a/bin/configs/unmaintained/openapi3/typescript-fetch-with-interfaces.yaml b/bin/configs/unmaintained/openapi3/typescript-fetch-with-interfaces.yaml index 3e840041de8..0327f43c9f5 100644 --- a/bin/configs/unmaintained/openapi3/typescript-fetch-with-interfaces.yaml +++ b/bin/configs/unmaintained/openapi3/typescript-fetch-with-interfaces.yaml @@ -1,6 +1,6 @@ generatorName: typescript-fetch outputDir: samples/client/petstore/typescript-fetch/builds/with-interfaces -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-fetch +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript-fetch additionalProperties: withInterfaces: "true" diff --git a/bin/configs/unmaintained/openapi3/typescript-fetch-with-npm-version.yaml b/bin/configs/unmaintained/openapi3/typescript-fetch-with-npm-version.yaml index 7d00832abe1..c2dcca8082f 100644 --- a/bin/configs/unmaintained/openapi3/typescript-fetch-with-npm-version.yaml +++ b/bin/configs/unmaintained/openapi3/typescript-fetch-with-npm-version.yaml @@ -1,9 +1,9 @@ generatorName: typescript-fetch outputDir: samples/client/petstore/typescript-fetch/builds/with-npm-version -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-fetch +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript-fetch additionalProperties: npmVersion: 1.0.0 - npmName: '@openapitools/typescript-fetch-petstore' + npmName: '@openapijsonschematools/typescript-fetch-petstore' npmRepository: https://skimdb.npmjs.com/registry snapshot: false diff --git a/bin/configs/unmaintained/openapi3/typescript-inversify.yaml b/bin/configs/unmaintained/openapi3/typescript-inversify.yaml index 6e819934b68..30646061084 100644 --- a/bin/configs/unmaintained/openapi3/typescript-inversify.yaml +++ b/bin/configs/unmaintained/openapi3/typescript-inversify.yaml @@ -1,4 +1,4 @@ generatorName: typescript-inversify outputDir: samples/client/petstore/typescript-inversify -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-inversify +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript-inversify diff --git a/bin/configs/unmaintained/openapi3/typescript-jquery-default.yaml b/bin/configs/unmaintained/openapi3/typescript-jquery-default.yaml index 70cd96bea35..eeae81f6178 100644 --- a/bin/configs/unmaintained/openapi3/typescript-jquery-default.yaml +++ b/bin/configs/unmaintained/openapi3/typescript-jquery-default.yaml @@ -1,4 +1,4 @@ generatorName: typescript-jquery outputDir: samples/client/petstore/typescript-jquery/default -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-jquery +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript-jquery diff --git a/bin/configs/unmaintained/openapi3/typescript-jquery-npm.yaml b/bin/configs/unmaintained/openapi3/typescript-jquery-npm.yaml index 1b842c66aa6..1a45e61f48a 100644 --- a/bin/configs/unmaintained/openapi3/typescript-jquery-npm.yaml +++ b/bin/configs/unmaintained/openapi3/typescript-jquery-npm.yaml @@ -1,9 +1,9 @@ generatorName: typescript-jquery outputDir: samples/client/petstore/typescript-jquery/npm -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-jquery +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript-jquery additionalProperties: npmVersion: 0.0.1 - npmName: '@openapitools/jquery-typescript-petstore' + npmName: '@openapijsonschematools/jquery-typescript-petstore' npmRepository: https://skimdb.npmjs.com/registry snapshot: false diff --git a/bin/configs/unmaintained/openapi3/typescript-node-default.yaml b/bin/configs/unmaintained/openapi3/typescript-node-default.yaml index 54db17e7328..536443fa3d6 100644 --- a/bin/configs/unmaintained/openapi3/typescript-node-default.yaml +++ b/bin/configs/unmaintained/openapi3/typescript-node-default.yaml @@ -1,4 +1,4 @@ generatorName: typescript-node outputDir: samples/client/petstore/typescript-node/default -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-node +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript-node diff --git a/bin/configs/unmaintained/openapi3/typescript-node-npm.yaml b/bin/configs/unmaintained/openapi3/typescript-node-npm.yaml index 01d5cf687e5..ceb9bf36544 100644 --- a/bin/configs/unmaintained/openapi3/typescript-node-npm.yaml +++ b/bin/configs/unmaintained/openapi3/typescript-node-npm.yaml @@ -1,9 +1,9 @@ generatorName: typescript-node outputDir: samples/client/petstore/typescript-node/npm -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-node +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript-node additionalProperties: npmVersion: 0.0.1 - npmName: '@openapitools/angular2-typescript-petstore' + npmName: '@openapijsonschematools/angular2-typescript-petstore' npmRepository: https://skimdb.npmjs.com/registry snapshot: false diff --git a/bin/configs/unmaintained/perl-deep_module_test.yaml b/bin/configs/unmaintained/perl-deep_module_test.yaml index ea9cd53d886..c8845e6b276 100644 --- a/bin/configs/unmaintained/perl-deep_module_test.yaml +++ b/bin/configs/unmaintained/perl-deep_module_test.yaml @@ -1,7 +1,7 @@ generatorName: perl outputDir: samples/client/petstore/perl/deep_module_test -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/perl +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/perl additionalProperties: moduleName: Something::Deep hideGenerationTimestamp: "true" diff --git a/bin/configs/unmaintained/perl.yaml b/bin/configs/unmaintained/perl.yaml index 17575b85be0..64c2fc09da5 100644 --- a/bin/configs/unmaintained/perl.yaml +++ b/bin/configs/unmaintained/perl.yaml @@ -1,6 +1,6 @@ generatorName: perl outputDir: samples/client/petstore/perl -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/perl +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/perl additionalProperties: hideGenerationTimestamp: "true" diff --git a/bin/configs/unmaintained/php-OpenAPIClient.yaml b/bin/configs/unmaintained/php-OpenAPIClient.yaml index d3ce7bdae35..44c2bbd3289 100644 --- a/bin/configs/unmaintained/php-OpenAPIClient.yaml +++ b/bin/configs/unmaintained/php-OpenAPIClient.yaml @@ -1,4 +1,4 @@ generatorName: php outputDir: samples/client/petstore/php/OpenAPIClient-php -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/php +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/php diff --git a/bin/configs/unmaintained/php-dt-modern.yaml b/bin/configs/unmaintained/php-dt-modern.yaml index 33432079423..712f4187ce4 100644 --- a/bin/configs/unmaintained/php-dt-modern.yaml +++ b/bin/configs/unmaintained/php-dt-modern.yaml @@ -1,6 +1,6 @@ generatorName: php-dt outputDir: samples/client/petstore/php-dt-modern -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/php-dt-modern +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/php-dt-modern additionalProperties: modern: "true" diff --git a/bin/configs/unmaintained/php-dt.yaml b/bin/configs/unmaintained/php-dt.yaml index 6e1cbcccc57..ea3041abb94 100644 --- a/bin/configs/unmaintained/php-dt.yaml +++ b/bin/configs/unmaintained/php-dt.yaml @@ -1,4 +1,4 @@ generatorName: php-dt outputDir: samples/client/petstore/php-dt -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/php-dt +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/php-dt diff --git a/bin/configs/unmaintained/php-laravel.yaml b/bin/configs/unmaintained/php-laravel.yaml index 88d17374326..53ec7042d1d 100644 --- a/bin/configs/unmaintained/php-laravel.yaml +++ b/bin/configs/unmaintained/php-laravel.yaml @@ -1,6 +1,6 @@ generatorName: php-laravel outputDir: samples/server/petstore/php-laravel -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/php-laravel -gitUserId: openapitools +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/php-laravel +gitUserId: openapijsonschematools gitRepoId: petstore diff --git a/bin/configs/unmaintained/php-lumen.yaml b/bin/configs/unmaintained/php-lumen.yaml index 4436f9ba46d..63ee671f677 100644 --- a/bin/configs/unmaintained/php-lumen.yaml +++ b/bin/configs/unmaintained/php-lumen.yaml @@ -1,4 +1,4 @@ generatorName: php-lumen outputDir: samples/server/petstore/php-lumen -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/php-lumen +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/php-lumen diff --git a/bin/configs/unmaintained/php-mezzio-ph-modern.yaml b/bin/configs/unmaintained/php-mezzio-ph-modern.yaml index accaa2dfe30..03e7c832290 100644 --- a/bin/configs/unmaintained/php-mezzio-ph-modern.yaml +++ b/bin/configs/unmaintained/php-mezzio-ph-modern.yaml @@ -1,6 +1,6 @@ generatorName: php-mezzio-ph outputDir: samples/server/petstore/php-mezzio-ph-modern -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/php-mezzio-ph-modern +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/php-mezzio-ph-modern additionalProperties: modern: "true" diff --git a/bin/configs/unmaintained/php-mezzio-ph.yaml b/bin/configs/unmaintained/php-mezzio-ph.yaml index 614be6ce9fb..d5a792881b1 100644 --- a/bin/configs/unmaintained/php-mezzio-ph.yaml +++ b/bin/configs/unmaintained/php-mezzio-ph.yaml @@ -1,4 +1,4 @@ generatorName: php-mezzio-ph outputDir: samples/server/petstore/php-mezzio-ph -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/php-mezzio-ph +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/php-mezzio-ph diff --git a/bin/configs/unmaintained/php-slim4.yaml b/bin/configs/unmaintained/php-slim4.yaml index a15c313a772..9e82f23efc1 100644 --- a/bin/configs/unmaintained/php-slim4.yaml +++ b/bin/configs/unmaintained/php-slim4.yaml @@ -1,4 +1,4 @@ generatorName: php-slim4 outputDir: samples/server/petstore/php-slim4 -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/php-slim4-server +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/php-slim4-server diff --git a/bin/configs/unmaintained/php-symfony-SymfonyBundle-php.yaml b/bin/configs/unmaintained/php-symfony-SymfonyBundle-php.yaml index 45871b6da22..07db981a4aa 100644 --- a/bin/configs/unmaintained/php-symfony-SymfonyBundle-php.yaml +++ b/bin/configs/unmaintained/php-symfony-SymfonyBundle-php.yaml @@ -1,6 +1,6 @@ generatorName: php-symfony outputDir: samples/server/petstore/php-symfony/SymfonyBundle-php -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/php-symfony -gitUserId: openapitools +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/php-symfony +gitUserId: openapijsonschematools gitRepoId: petstore diff --git a/bin/configs/unmaintained/plantuml.yaml b/bin/configs/unmaintained/plantuml.yaml index 397fad4f643..77efbd42c27 100644 --- a/bin/configs/unmaintained/plantuml.yaml +++ b/bin/configs/unmaintained/plantuml.yaml @@ -1,4 +1,4 @@ generatorName: plantuml outputDir: samples/documentation/petstore/plantuml -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/plantuml +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/plantuml diff --git a/bin/configs/unmaintained/powershell.yaml b/bin/configs/unmaintained/powershell.yaml index 9a408c2ad17..06810c97c95 100644 --- a/bin/configs/unmaintained/powershell.yaml +++ b/bin/configs/unmaintained/powershell.yaml @@ -1,7 +1,7 @@ generatorName: powershell outputDir: samples/client/petstore/powershell -inputSpec: modules/openapi-generator/src/test/resources/3_0/powershell/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml -templateDir: modules/openapi-generator/src/main/resources/powershell +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/powershell/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/powershell additionalProperties: packageGuid: a27b908d-2a20-467f-bc32-af6f3a654ac5 commonVerbs: Delete=Remove:Patch=Update diff --git a/bin/configs/unmaintained/protobuf-schema.yaml b/bin/configs/unmaintained/protobuf-schema.yaml index 30f606c915f..556529d3407 100644 --- a/bin/configs/unmaintained/protobuf-schema.yaml +++ b/bin/configs/unmaintained/protobuf-schema.yaml @@ -1,6 +1,6 @@ generatorName: protobuf-schema outputDir: samples/config/petstore/protobuf-schema -inputSpec: modules/openapi-generator/src/test/resources/3_0/protobuf/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/protobuf-schema +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/protobuf/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/protobuf-schema additionalProperties: packageName: petstore diff --git a/bin/configs/unmaintained/python-aiohttp-srclayout.yaml b/bin/configs/unmaintained/python-aiohttp-srclayout.yaml index d376bbf63b8..1d71f0315b1 100644 --- a/bin/configs/unmaintained/python-aiohttp-srclayout.yaml +++ b/bin/configs/unmaintained/python-aiohttp-srclayout.yaml @@ -1,6 +1,6 @@ generatorName: python-aiohttp outputDir: samples/server/petstore/python-aiohttp-srclayout -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/python-aiohttp +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/python-aiohttp additionalProperties: pythonSrcRoot: src diff --git a/bin/configs/unmaintained/python-aiohttp.yaml b/bin/configs/unmaintained/python-aiohttp.yaml index 2a10c592ae3..b7bb4647d8b 100644 --- a/bin/configs/unmaintained/python-aiohttp.yaml +++ b/bin/configs/unmaintained/python-aiohttp.yaml @@ -1,4 +1,4 @@ generatorName: python-aiohttp outputDir: samples/server/petstore/python-aiohttp -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/python-aiohttp +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/python-aiohttp diff --git a/bin/configs/unmaintained/python-asyncio.yaml b/bin/configs/unmaintained/python-asyncio.yaml index e0918c1d48d..9c3601ff430 100644 --- a/bin/configs/unmaintained/python-asyncio.yaml +++ b/bin/configs/unmaintained/python-asyncio.yaml @@ -1,7 +1,7 @@ generatorName: python-legacy outputDir: samples/client/petstore/python-asyncio library: asyncio -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/python-legacy +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/python-legacy additionalProperties: packageName: petstore_api diff --git a/bin/configs/unmaintained/python-blueplanet.yaml b/bin/configs/unmaintained/python-blueplanet.yaml index eb38af7fefd..eeed272acec 100644 --- a/bin/configs/unmaintained/python-blueplanet.yaml +++ b/bin/configs/unmaintained/python-blueplanet.yaml @@ -1,4 +1,4 @@ generatorName: python-blueplanet outputDir: samples/server/petstore/python-blueplanet -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/python-blueplanet +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/python-blueplanet diff --git a/bin/configs/unmaintained/python-fastapi.yaml b/bin/configs/unmaintained/python-fastapi.yaml index fdba2dbe340..3cf26bc39f6 100644 --- a/bin/configs/unmaintained/python-fastapi.yaml +++ b/bin/configs/unmaintained/python-fastapi.yaml @@ -1,7 +1,7 @@ generatorName: python-fastapi outputDir: samples/server/petstore/python-fastapi -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/python-fastapi +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/python-fastapi sourceFolder: "src" additionalProperties: hideGenerationTimestamp: "true" diff --git a/bin/configs/unmaintained/python-features-dynamic-servers.yaml b/bin/configs/unmaintained/python-features-dynamic-servers.yaml index 6b154d3dd1c..423ee7824f2 100644 --- a/bin/configs/unmaintained/python-features-dynamic-servers.yaml +++ b/bin/configs/unmaintained/python-features-dynamic-servers.yaml @@ -1,6 +1,6 @@ generatorName: python outputDir: samples/openapi3/client/features/dynamic-servers/python/ -inputSpec: modules/openapi-generator/src/test/resources/3_0/features/dynamic-servers.yaml -templateDir: modules/openapi-generator/src/main/resources/python +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/features/dynamic-servers.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/python additionalProperties: packageName: dynamic_servers diff --git a/bin/configs/unmaintained/python-flask.yaml b/bin/configs/unmaintained/python-flask.yaml index c8bc1d08f5d..caf64db63c3 100644 --- a/bin/configs/unmaintained/python-flask.yaml +++ b/bin/configs/unmaintained/python-flask.yaml @@ -1,4 +1,4 @@ generatorName: python-flask outputDir: samples/server/petstore/python-flask -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/python-flask +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/python-flask diff --git a/bin/configs/unmaintained/python-legacy-oas2.yaml b/bin/configs/unmaintained/python-legacy-oas2.yaml index 14003ec2214..20d1da0f9de 100644 --- a/bin/configs/unmaintained/python-legacy-oas2.yaml +++ b/bin/configs/unmaintained/python-legacy-oas2.yaml @@ -1,6 +1,6 @@ generatorName: python-legacy outputDir: samples/client/petstore/python-legacy -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/python-legacy +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/python-legacy additionalProperties: packageName: petstore_api diff --git a/bin/configs/unmaintained/python-legacy.yaml b/bin/configs/unmaintained/python-legacy.yaml index 58657e4891a..35f86c21173 100644 --- a/bin/configs/unmaintained/python-legacy.yaml +++ b/bin/configs/unmaintained/python-legacy.yaml @@ -1,6 +1,6 @@ generatorName: python-legacy outputDir: samples/openapi3/client/petstore/python-legacy -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/python-legacy +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/python-legacy additionalProperties: packageName: petstore_api diff --git a/bin/configs/unmaintained/python-prior-extensions-x-auth-id-alias.yaml b/bin/configs/unmaintained/python-prior-extensions-x-auth-id-alias.yaml index a017b13b22a..1b2e091e9c8 100644 --- a/bin/configs/unmaintained/python-prior-extensions-x-auth-id-alias.yaml +++ b/bin/configs/unmaintained/python-prior-extensions-x-auth-id-alias.yaml @@ -1,6 +1,6 @@ generatorName: python-prior outputDir: samples/openapi3/client/extensions/x-auth-id-alias/python-prior/ -inputSpec: modules/openapi-generator/src/test/resources/3_0/extensions/x-auth-id-alias.yaml -templateDir: modules/openapi-generator/src/main/resources/python +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/extensions/x-auth-id-alias.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/python additionalProperties: packageName: x_auth_id_alias diff --git a/bin/configs/unmaintained/python-prior-oas2.yaml b/bin/configs/unmaintained/python-prior-oas2.yaml index 160afab7d94..71391209104 100644 --- a/bin/configs/unmaintained/python-prior-oas2.yaml +++ b/bin/configs/unmaintained/python-prior-oas2.yaml @@ -4,7 +4,7 @@ # Composed schemas are schemas that contain the allOf/oneOf/anyOf keywords. v2 specs only support the allOf keyword. generatorName: python-prior outputDir: samples/client/petstore/python-prior -inputSpec: modules/openapi-generator/src/test/resources/2_0/python-prior/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/python-prior +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/python-prior/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/python-prior additionalProperties: packageName: petstore_api diff --git a/bin/configs/unmaintained/python-prior-oas2_disallowAdditionalPropertiesIfNotPresent.yaml b/bin/configs/unmaintained/python-prior-oas2_disallowAdditionalPropertiesIfNotPresent.yaml index e524b83b4ea..9d407f307e9 100644 --- a/bin/configs/unmaintained/python-prior-oas2_disallowAdditionalPropertiesIfNotPresent.yaml +++ b/bin/configs/unmaintained/python-prior-oas2_disallowAdditionalPropertiesIfNotPresent.yaml @@ -1,7 +1,7 @@ generatorName: python-prior outputDir: samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent -inputSpec: modules/openapi-generator/src/test/resources/2_0/python-prior/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/python-prior +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/python-prior/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/python-prior additionalProperties: disallowAdditionalPropertiesIfNotPresent: "true" packageName: petstore_api diff --git a/bin/configs/unmaintained/python-prior.yaml b/bin/configs/unmaintained/python-prior.yaml index 11a918d1ad1..0810dca67c5 100644 --- a/bin/configs/unmaintained/python-prior.yaml +++ b/bin/configs/unmaintained/python-prior.yaml @@ -1,7 +1,7 @@ generatorName: python-prior outputDir: samples/openapi3/client/petstore/python-prior -inputSpec: modules/openapi-generator/src/test/resources/3_0/python-prior/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml -templateDir: modules/openapi-generator/src/main/resources/python-prior +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/python-prior/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/python-prior additionalProperties: packageName: petstore_api recursionLimit: "1234" diff --git a/bin/configs/unmaintained/python-tornado.yaml b/bin/configs/unmaintained/python-tornado.yaml index e7b89865d40..beafda4e994 100644 --- a/bin/configs/unmaintained/python-tornado.yaml +++ b/bin/configs/unmaintained/python-tornado.yaml @@ -1,7 +1,7 @@ generatorName: python-legacy outputDir: samples/client/petstore/python-tornado library: tornado -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/python-legacy +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/python-legacy additionalProperties: packageName: petstore_api diff --git a/bin/configs/unmaintained/r-client.yaml b/bin/configs/unmaintained/r-client.yaml index d52db86cac8..8ab7328d0fe 100644 --- a/bin/configs/unmaintained/r-client.yaml +++ b/bin/configs/unmaintained/r-client.yaml @@ -1,7 +1,7 @@ generatorName: r outputDir: samples/client/petstore/R -inputSpec: modules/openapi-generator/src/test/resources/3_0/r/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/r +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/r/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/r httpUserAgent: PetstoreAgent additionalProperties: packageName: petstore diff --git a/bin/configs/unmaintained/r-httr2-client.yaml b/bin/configs/unmaintained/r-httr2-client.yaml index 15779e26d36..3d529f8e11e 100644 --- a/bin/configs/unmaintained/r-httr2-client.yaml +++ b/bin/configs/unmaintained/r-httr2-client.yaml @@ -1,7 +1,7 @@ generatorName: r outputDir: samples/client/petstore/R-httr2 -inputSpec: modules/openapi-generator/src/test/resources/3_0/r/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/r +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/r/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/r httpUserAgent: PetstoreAgent library: httr2 additionalProperties: diff --git a/bin/configs/unmaintained/r-httr2-wrapper-client.yaml b/bin/configs/unmaintained/r-httr2-wrapper-client.yaml index 18b3dbc4bb1..63d3ada3745 100644 --- a/bin/configs/unmaintained/r-httr2-wrapper-client.yaml +++ b/bin/configs/unmaintained/r-httr2-wrapper-client.yaml @@ -1,7 +1,7 @@ generatorName: r outputDir: samples/client/petstore/R-httr2-wrapper -inputSpec: modules/openapi-generator/src/test/resources/3_0/r/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/r +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/r/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/r httpUserAgent: PetstoreAgent library: httr2 additionalProperties: diff --git a/bin/configs/unmaintained/ruby-autoload.yaml b/bin/configs/unmaintained/ruby-autoload.yaml index ee8e82896d0..74bedd6abb8 100644 --- a/bin/configs/unmaintained/ruby-autoload.yaml +++ b/bin/configs/unmaintained/ruby-autoload.yaml @@ -1,8 +1,8 @@ generatorName: ruby outputDir: samples/client/petstore/ruby-autoload library: typhoeus -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/ruby-client +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/ruby-client additionalProperties: gemVersion: 1.0.0 moduleName: Petstore diff --git a/bin/configs/unmaintained/ruby-extensions-x-auth-id-alias.yaml b/bin/configs/unmaintained/ruby-extensions-x-auth-id-alias.yaml index 7f51216567c..a6e074be84d 100644 --- a/bin/configs/unmaintained/ruby-extensions-x-auth-id-alias.yaml +++ b/bin/configs/unmaintained/ruby-extensions-x-auth-id-alias.yaml @@ -1,7 +1,7 @@ generatorName: ruby outputDir: samples/openapi3/client/extensions/x-auth-id-alias/ruby-client -inputSpec: modules/openapi-generator/src/test/resources/3_0/extensions/x-auth-id-alias.yaml -templateDir: modules/openapi-generator/src/main/resources/ruby-client +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/extensions/x-auth-id-alias.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/ruby-client additionalProperties: gemName: x_auth_id_alias gemVersion: 1.0.0 diff --git a/bin/configs/unmaintained/ruby-faraday.yaml b/bin/configs/unmaintained/ruby-faraday.yaml index b289ae977f4..0dda621aa39 100644 --- a/bin/configs/unmaintained/ruby-faraday.yaml +++ b/bin/configs/unmaintained/ruby-faraday.yaml @@ -1,8 +1,8 @@ generatorName: ruby outputDir: samples/client/petstore/ruby-faraday library: faraday -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/ruby-client +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/ruby-client additionalProperties: gemVersion: 1.0.0 moduleName: Petstore diff --git a/bin/configs/unmaintained/ruby-features-dynamic-servers.yaml b/bin/configs/unmaintained/ruby-features-dynamic-servers.yaml index 469beff7171..b9a9c938956 100644 --- a/bin/configs/unmaintained/ruby-features-dynamic-servers.yaml +++ b/bin/configs/unmaintained/ruby-features-dynamic-servers.yaml @@ -1,7 +1,7 @@ generatorName: ruby outputDir: samples/openapi3/client/features/dynamic-servers/ruby/ -inputSpec: modules/openapi-generator/src/test/resources/3_0/features/dynamic-servers.yaml -templateDir: modules/openapi-generator/src/main/resources/ruby-client +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/features/dynamic-servers.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/ruby-client additionalProperties: gemVersion: 1.0.0 moduleName: DynamicServers diff --git a/bin/configs/unmaintained/ruby-generate-alias-as-model.yaml b/bin/configs/unmaintained/ruby-generate-alias-as-model.yaml index 126e1e09483..910726340db 100644 --- a/bin/configs/unmaintained/ruby-generate-alias-as-model.yaml +++ b/bin/configs/unmaintained/ruby-generate-alias-as-model.yaml @@ -1,8 +1,8 @@ generatorName: ruby outputDir: samples/openapi3/client/features/generate-alias-as-model/ruby-client/ library: typhoeus -inputSpec: modules/openapi-generator/src/test/resources/3_0/features/generate-alias-as-model.yaml -templateDir: modules/openapi-generator/src/main/resources/ruby-client +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/features/generate-alias-as-model.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/ruby-client additionalProperties: gemVersion: 1.0.0 moduleName: Petstore diff --git a/bin/configs/unmaintained/ruby-on-rails.yaml b/bin/configs/unmaintained/ruby-on-rails.yaml index 931c44baa00..51b89440e8f 100644 --- a/bin/configs/unmaintained/ruby-on-rails.yaml +++ b/bin/configs/unmaintained/ruby-on-rails.yaml @@ -1,4 +1,4 @@ generatorName: ruby-on-rails outputDir: samples/server/petstore/ruby-on-rails -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/ruby-on-rails-server +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/ruby-on-rails-server diff --git a/bin/configs/unmaintained/ruby-sinatra.yaml b/bin/configs/unmaintained/ruby-sinatra.yaml index f612a023c30..630059e2300 100644 --- a/bin/configs/unmaintained/ruby-sinatra.yaml +++ b/bin/configs/unmaintained/ruby-sinatra.yaml @@ -1,4 +1,4 @@ generatorName: ruby-sinatra outputDir: samples/server/petstore/ruby-sinatra -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/ruby-sinatra-server +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/ruby-sinatra-server diff --git a/bin/configs/unmaintained/ruby.yaml b/bin/configs/unmaintained/ruby.yaml index 1a7e2c24363..24bf1881eff 100644 --- a/bin/configs/unmaintained/ruby.yaml +++ b/bin/configs/unmaintained/ruby.yaml @@ -1,8 +1,8 @@ generatorName: ruby outputDir: samples/client/petstore/ruby library: typhoeus -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/ruby-client +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/ruby-client additionalProperties: gemVersion: 1.0.0 moduleName: Petstore diff --git a/bin/configs/unmaintained/rust-hyper-petstore.yaml b/bin/configs/unmaintained/rust-hyper-petstore.yaml index 0d8ab210f77..725e7a30e02 100644 --- a/bin/configs/unmaintained/rust-hyper-petstore.yaml +++ b/bin/configs/unmaintained/rust-hyper-petstore.yaml @@ -1,8 +1,8 @@ generatorName: rust outputDir: samples/client/petstore/rust/hyper/petstore library: hyper -inputSpec: modules/openapi-generator/src/test/resources/3_0/rust/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/rust +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/rust/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/rust additionalProperties: supportAsync: "false" packageName: petstore-hyper diff --git a/bin/configs/unmaintained/rust-reqwest-petstore-async.yaml b/bin/configs/unmaintained/rust-reqwest-petstore-async.yaml index ed156ec550e..95d35173ec5 100644 --- a/bin/configs/unmaintained/rust-reqwest-petstore-async.yaml +++ b/bin/configs/unmaintained/rust-reqwest-petstore-async.yaml @@ -1,8 +1,8 @@ generatorName: rust outputDir: samples/client/petstore/rust/reqwest/petstore-async library: reqwest -inputSpec: modules/openapi-generator/src/test/resources/3_0/rust/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/rust +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/rust/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/rust additionalProperties: supportAsync: true supportMultipleResponses: true diff --git a/bin/configs/unmaintained/rust-reqwest-petstore-awsv4signature.yaml b/bin/configs/unmaintained/rust-reqwest-petstore-awsv4signature.yaml index 3ffd335719a..9bcaea6ecac 100644 --- a/bin/configs/unmaintained/rust-reqwest-petstore-awsv4signature.yaml +++ b/bin/configs/unmaintained/rust-reqwest-petstore-awsv4signature.yaml @@ -1,8 +1,8 @@ generatorName: rust outputDir: samples/client/petstore/rust/reqwest/petstore-awsv4signature library: reqwest -inputSpec: modules/openapi-generator/src/test/resources/3_0/rust/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/rust +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/rust/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/rust additionalProperties: supportAsync: false packageName: petstore-reqwest-awsv4signature diff --git a/bin/configs/unmaintained/rust-reqwest-petstore.yaml b/bin/configs/unmaintained/rust-reqwest-petstore.yaml index e107582b217..a892310aa34 100644 --- a/bin/configs/unmaintained/rust-reqwest-petstore.yaml +++ b/bin/configs/unmaintained/rust-reqwest-petstore.yaml @@ -1,8 +1,8 @@ generatorName: rust outputDir: samples/client/petstore/rust/reqwest/petstore library: reqwest -inputSpec: modules/openapi-generator/src/test/resources/3_0/rust/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/rust +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/rust/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/rust additionalProperties: supportAsync: false packageName: petstore-reqwest diff --git a/bin/configs/unmaintained/rust-server-multipart-v3.yaml b/bin/configs/unmaintained/rust-server-multipart-v3.yaml index ca84dfb04e6..e5996c4ddfb 100644 --- a/bin/configs/unmaintained/rust-server-multipart-v3.yaml +++ b/bin/configs/unmaintained/rust-server-multipart-v3.yaml @@ -1,7 +1,7 @@ generatorName: rust-server outputDir: samples/server/petstore/rust-server/output/multipart-v3 -inputSpec: modules/openapi-generator/src/test/resources/3_0/rust-server/multipart-v3.yaml -templateDir: modules/openapi-generator/src/main/resources/rust-server +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/rust-server/multipart-v3.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/rust-server generateAliasAsModel: true additionalProperties: hideGenerationTimestamp: "true" diff --git a/bin/configs/unmaintained/rust-server-no-example-v3.yaml b/bin/configs/unmaintained/rust-server-no-example-v3.yaml index 5694c8373e5..0e2d29e4cb1 100644 --- a/bin/configs/unmaintained/rust-server-no-example-v3.yaml +++ b/bin/configs/unmaintained/rust-server-no-example-v3.yaml @@ -1,7 +1,7 @@ generatorName: rust-server outputDir: samples/server/petstore/rust-server/output/no-example-v3 -inputSpec: modules/openapi-generator/src/test/resources/3_0/rust-server/no-example-v3.yaml -templateDir: modules/openapi-generator/src/main/resources/rust-server +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/rust-server/no-example-v3.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/rust-server generateAliasAsModel: true additionalProperties: hideGenerationTimestamp: "true" diff --git a/bin/configs/unmaintained/rust-server-openapi-v3.yaml b/bin/configs/unmaintained/rust-server-openapi-v3.yaml index 6ed1c294662..db370bfd923 100644 --- a/bin/configs/unmaintained/rust-server-openapi-v3.yaml +++ b/bin/configs/unmaintained/rust-server-openapi-v3.yaml @@ -1,7 +1,7 @@ generatorName: rust-server outputDir: samples/server/petstore/rust-server/output/openapi-v3 -inputSpec: modules/openapi-generator/src/test/resources/3_0/rust-server/openapi-v3.yaml -templateDir: modules/openapi-generator/src/main/resources/rust-server +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/rust-server/openapi-v3.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/rust-server generateAliasAsModel: true additionalProperties: hideGenerationTimestamp: "true" diff --git a/bin/configs/unmaintained/rust-server-ops-v3.yaml b/bin/configs/unmaintained/rust-server-ops-v3.yaml index 5d8f47cea46..f956a7d5813 100644 --- a/bin/configs/unmaintained/rust-server-ops-v3.yaml +++ b/bin/configs/unmaintained/rust-server-ops-v3.yaml @@ -1,7 +1,7 @@ generatorName: rust-server outputDir: samples/server/petstore/rust-server/output/ops-v3 -inputSpec: modules/openapi-generator/src/test/resources/3_0/rust-server/ops-v3.yaml -templateDir: modules/openapi-generator/src/main/resources/rust-server +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/rust-server/ops-v3.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/rust-server generateAliasAsModel: true additionalProperties: hideGenerationTimestamp: "true" diff --git a/bin/configs/unmaintained/rust-server-petstore-with-fake-endpoints-models-for-testing.yaml b/bin/configs/unmaintained/rust-server-petstore-with-fake-endpoints-models-for-testing.yaml index 7e009c7d952..c9d9c5b61a5 100644 --- a/bin/configs/unmaintained/rust-server-petstore-with-fake-endpoints-models-for-testing.yaml +++ b/bin/configs/unmaintained/rust-server-petstore-with-fake-endpoints-models-for-testing.yaml @@ -1,7 +1,7 @@ generatorName: rust-server outputDir: samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing -inputSpec: modules/openapi-generator/src/test/resources/2_0/rust-server/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/rust-server +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/rust-server/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/rust-server generateAliasAsModel: true additionalProperties: hideGenerationTimestamp: "true" diff --git a/bin/configs/unmaintained/rust-server-ping-bearer-auth-v3.yaml b/bin/configs/unmaintained/rust-server-ping-bearer-auth-v3.yaml index 5f02e791e1a..c19b72b5e81 100644 --- a/bin/configs/unmaintained/rust-server-ping-bearer-auth-v3.yaml +++ b/bin/configs/unmaintained/rust-server-ping-bearer-auth-v3.yaml @@ -1,7 +1,7 @@ generatorName: rust-server outputDir: samples/server/petstore/rust-server/output/ping-bearer-auth -inputSpec: modules/openapi-generator/src/test/resources/3_0/rust-server/ping-bearer-auth.yaml -templateDir: modules/openapi-generator/src/main/resources/rust-server +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/rust-server/ping-bearer-auth.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/rust-server generateAliasAsModel: true additionalProperties: hideGenerationTimestamp: "true" diff --git a/bin/configs/unmaintained/rust-server-test.yaml b/bin/configs/unmaintained/rust-server-test.yaml index 522a66ad227..4e8bd25ad1c 100644 --- a/bin/configs/unmaintained/rust-server-test.yaml +++ b/bin/configs/unmaintained/rust-server-test.yaml @@ -1,7 +1,7 @@ generatorName: rust-server outputDir: samples/server/petstore/rust-server/output/rust-server-test -inputSpec: modules/openapi-generator/src/test/resources/2_0/rust-server/rust-server-test.yaml -templateDir: modules/openapi-generator/src/main/resources/rust-server +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/rust-server/rust-server-test.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/rust-server generateAliasAsModel: true additionalProperties: hideGenerationTimestamp: "true" diff --git a/bin/configs/unmaintained/scala-akka-http-server.yaml b/bin/configs/unmaintained/scala-akka-http-server.yaml index 9c939d81af0..560d155fbc2 100644 --- a/bin/configs/unmaintained/scala-akka-http-server.yaml +++ b/bin/configs/unmaintained/scala-akka-http-server.yaml @@ -1,6 +1,6 @@ generatorName: scala-akka-http-server outputDir: samples/server/petstore/scala-akka-http-server -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/scala-akka-http-server +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/scala-akka-http-server additionalProperties: artifactId: openapi-scala-akka-http-server diff --git a/bin/configs/unmaintained/scala-akka.yaml b/bin/configs/unmaintained/scala-akka.yaml index 0a22803ca9e..c6a7cde91a9 100644 --- a/bin/configs/unmaintained/scala-akka.yaml +++ b/bin/configs/unmaintained/scala-akka.yaml @@ -1,6 +1,6 @@ generatorName: scala-akka outputDir: samples/client/petstore/scala-akka -inputSpec: modules/openapi-generator/src/test/resources/3_0/scala-akka/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/scala-akka-client +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/scala-akka/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/scala-akka-client additionalProperties: artifactId: scala-akka-petstore-client diff --git a/bin/configs/unmaintained/scala-finch.yaml b/bin/configs/unmaintained/scala-finch.yaml index 4ec9a16b9f5..290b0de3dec 100644 --- a/bin/configs/unmaintained/scala-finch.yaml +++ b/bin/configs/unmaintained/scala-finch.yaml @@ -2,5 +2,5 @@ systemProperties: skipFormModel: "true" generatorName: scala-finch outputDir: samples/server/petstore/scala-finch -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/scala-finch +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/scala-finch diff --git a/bin/configs/unmaintained/scala-gatling.yaml b/bin/configs/unmaintained/scala-gatling.yaml index 19858a71e1c..cf016186222 100644 --- a/bin/configs/unmaintained/scala-gatling.yaml +++ b/bin/configs/unmaintained/scala-gatling.yaml @@ -1,4 +1,4 @@ generatorName: scala-gatling outputDir: samples/client/petstore/scala-gatling -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/scala-gatling +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/scala-gatling diff --git a/bin/configs/unmaintained/scala-httpclient-deprecated-scala-httpclient.yaml b/bin/configs/unmaintained/scala-httpclient-deprecated-scala-httpclient.yaml index 45bfe59e5e1..09bd521757a 100644 --- a/bin/configs/unmaintained/scala-httpclient-deprecated-scala-httpclient.yaml +++ b/bin/configs/unmaintained/scala-httpclient-deprecated-scala-httpclient.yaml @@ -1,4 +1,4 @@ generatorName: scala-httpclient-deprecated outputDir: samples/client/petstore/scala-httpclient -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/scala-httpclient +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/scala-httpclient diff --git a/bin/configs/unmaintained/scala-lagom-server.yaml b/bin/configs/unmaintained/scala-lagom-server.yaml index 8aabf4b0fd0..b975aa55352 100644 --- a/bin/configs/unmaintained/scala-lagom-server.yaml +++ b/bin/configs/unmaintained/scala-lagom-server.yaml @@ -2,5 +2,5 @@ systemProperties: skipFormModel: "true" generatorName: scala-lagom-server outputDir: samples/server/petstore/scala-lagom-server -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/scala-lagom-server +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/scala-lagom-server diff --git a/bin/configs/unmaintained/scala-legacy.yaml b/bin/configs/unmaintained/scala-legacy.yaml index 7c9c1865bc0..b65cc32fb50 100644 --- a/bin/configs/unmaintained/scala-legacy.yaml +++ b/bin/configs/unmaintained/scala-legacy.yaml @@ -1,9 +1,9 @@ # This is for generating scala legacy client generatorName: scala-httpclient-deprecated outputDir: samples/client/petstore/scala-httpclient-deprecated -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/scala-httpclient +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/scala-httpclient additionalProperties: - apiPackage: org.openapitools.example.api - invokerPackage: org.openapitools.example.invoker + apiPackage: org.openapijsonschematools.example.api + invokerPackage: org.openapijsonschematools.example.invoker artifactId: scala-legacy-petstore \ No newline at end of file diff --git a/bin/configs/unmaintained/scala-play-server.yaml b/bin/configs/unmaintained/scala-play-server.yaml index 8d8d7ba70f6..07b3b62ec99 100644 --- a/bin/configs/unmaintained/scala-play-server.yaml +++ b/bin/configs/unmaintained/scala-play-server.yaml @@ -1,6 +1,6 @@ generatorName: scala-play-server outputDir: samples/server/petstore/scala-play-server -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/scala-play-server +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/scala-play-server additionalProperties: hideGenerationTimestamp: "true" diff --git a/bin/configs/unmaintained/scala-sttp.yaml b/bin/configs/unmaintained/scala-sttp.yaml index abcd83a23b1..7dd30bdf22d 100644 --- a/bin/configs/unmaintained/scala-sttp.yaml +++ b/bin/configs/unmaintained/scala-sttp.yaml @@ -1,6 +1,6 @@ generatorName: scala-sttp outputDir: samples/client/petstore/scala-sttp -inputSpec: modules/openapi-generator/src/test/resources/3_0/scala/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/scala-sttp +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/scala/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/scala-sttp additionalProperties: artifactId: scala-sttp-petstore diff --git a/bin/configs/unmaintained/scalatra.yaml b/bin/configs/unmaintained/scalatra.yaml index 6445e10cd84..284adcbdc7e 100644 --- a/bin/configs/unmaintained/scalatra.yaml +++ b/bin/configs/unmaintained/scalatra.yaml @@ -1,4 +1,4 @@ generatorName: scalatra outputDir: samples/server/petstore/scalatra -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/scalatra +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/scalatra diff --git a/bin/configs/unmaintained/scalaz.yaml b/bin/configs/unmaintained/scalaz.yaml index 3cb4834d03b..f07f72d8d5e 100644 --- a/bin/configs/unmaintained/scalaz.yaml +++ b/bin/configs/unmaintained/scalaz.yaml @@ -2,5 +2,5 @@ systemProperties: skipFormModel: "true" generatorName: scalaz outputDir: samples/client/petstore/scalaz -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/scalaz +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/scalaz diff --git a/bin/configs/unmaintained/spring-boot-3.yaml b/bin/configs/unmaintained/spring-boot-3.yaml index 5c8b97cdad1..2005e0685c3 100644 --- a/bin/configs/unmaintained/spring-boot-3.yaml +++ b/bin/configs/unmaintained/spring-boot-3.yaml @@ -1,9 +1,9 @@ generatorName: spring outputDir: samples/openapi3/server/petstore/springboot-3 -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaSpring +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaSpring additionalProperties: - groupId: org.openapitools.openapi3 + groupId: org.openapijsonschematools.openapi3 documentationProvider: springdoc artifactId: springboot snapshotVersion: "true" diff --git a/bin/configs/unmaintained/spring-boot-beanvalidation-no-nullable-oas3.yaml b/bin/configs/unmaintained/spring-boot-beanvalidation-no-nullable-oas3.yaml index b1e5245ae85..b4a239539d8 100644 --- a/bin/configs/unmaintained/spring-boot-beanvalidation-no-nullable-oas3.yaml +++ b/bin/configs/unmaintained/spring-boot-beanvalidation-no-nullable-oas3.yaml @@ -1,10 +1,10 @@ generatorName: spring outputDir: samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable library: spring-boot -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaSpring +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaSpring additionalProperties: - groupId: org.openapitools.openapi3 + groupId: org.openapijsonschematools.openapi3 documentationProvider: springdoc java8: "false" useBeanValidation: true diff --git a/bin/configs/unmaintained/spring-boot-beanvalidation-no-nullable.yaml b/bin/configs/unmaintained/spring-boot-beanvalidation-no-nullable.yaml index 1457469bc72..24ad4571fd7 100644 --- a/bin/configs/unmaintained/spring-boot-beanvalidation-no-nullable.yaml +++ b/bin/configs/unmaintained/spring-boot-beanvalidation-no-nullable.yaml @@ -1,8 +1,8 @@ generatorName: spring outputDir: samples/server/petstore/springboot-beanvalidation-no-nullable library: spring-boot -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaSpring +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaSpring additionalProperties: documentationProvider: springfox java8: "false" diff --git a/bin/configs/unmaintained/spring-boot-beanvalidation.yaml b/bin/configs/unmaintained/spring-boot-beanvalidation.yaml index 4a5daef5845..5d8e166a7d3 100644 --- a/bin/configs/unmaintained/spring-boot-beanvalidation.yaml +++ b/bin/configs/unmaintained/spring-boot-beanvalidation.yaml @@ -1,8 +1,8 @@ generatorName: spring outputDir: samples/server/petstore/springboot-beanvalidation library: spring-boot -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaSpring +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaSpring additionalProperties: documentationProvider: springfox useSwaggerUI: false diff --git a/bin/configs/unmaintained/spring-boot-defaultInterface-unhandledException.yaml b/bin/configs/unmaintained/spring-boot-defaultInterface-unhandledException.yaml index 3d492c12f76..970936cb13f 100644 --- a/bin/configs/unmaintained/spring-boot-defaultInterface-unhandledException.yaml +++ b/bin/configs/unmaintained/spring-boot-defaultInterface-unhandledException.yaml @@ -1,7 +1,7 @@ generatorName: spring outputDir: samples/server/petstore/spring-boot-defaultInterface-unhandledException -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaSpring +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaSpring additionalProperties: artifactId: spring-boot-defaultInterface-unhandledException hideGenerationTimestamp: true diff --git a/bin/configs/unmaintained/spring-boot-delegate-j8.yaml b/bin/configs/unmaintained/spring-boot-delegate-j8.yaml index e1fae5805cd..77e7b200b6a 100644 --- a/bin/configs/unmaintained/spring-boot-delegate-j8.yaml +++ b/bin/configs/unmaintained/spring-boot-delegate-j8.yaml @@ -1,7 +1,7 @@ generatorName: spring outputDir: samples/server/petstore/springboot-delegate-j8 -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaSpring +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaSpring additionalProperties: documentationProvider: springfox artifactId: springboot-delegate-j8 diff --git a/bin/configs/unmaintained/spring-boot-delegate-oas3.yaml b/bin/configs/unmaintained/spring-boot-delegate-oas3.yaml index 8b604d558a9..711240b8e15 100644 --- a/bin/configs/unmaintained/spring-boot-delegate-oas3.yaml +++ b/bin/configs/unmaintained/spring-boot-delegate-oas3.yaml @@ -1,9 +1,9 @@ generatorName: spring outputDir: samples/openapi3/server/petstore/springboot-delegate -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaSpring +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaSpring additionalProperties: - groupId: org.openapitools.openapi3 + groupId: org.openapijsonschematools.openapi3 documentationProvider: springdoc artifactId: springboot-delegate hideGenerationTimestamp: "true" diff --git a/bin/configs/unmaintained/spring-boot-delegate.yaml b/bin/configs/unmaintained/spring-boot-delegate.yaml index 228b14d823e..2b4eab3b0b6 100644 --- a/bin/configs/unmaintained/spring-boot-delegate.yaml +++ b/bin/configs/unmaintained/spring-boot-delegate.yaml @@ -1,7 +1,7 @@ generatorName: spring outputDir: samples/server/petstore/springboot-delegate -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaSpring +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaSpring additionalProperties: documentationProvider: springfox artifactId: springboot-delegate diff --git a/bin/configs/unmaintained/spring-boot-implicitHeaders-annotationLibrary.yaml b/bin/configs/unmaintained/spring-boot-implicitHeaders-annotationLibrary.yaml index 7e9fb4758ce..79933b8a234 100644 --- a/bin/configs/unmaintained/spring-boot-implicitHeaders-annotationLibrary.yaml +++ b/bin/configs/unmaintained/spring-boot-implicitHeaders-annotationLibrary.yaml @@ -1,7 +1,7 @@ generatorName: spring outputDir: samples/server/petstore/springboot-implicitHeaders-annotationLibrary -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaSpring +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaSpring additionalProperties: artifactId: springboot-implicitHeaders-annotationLibrary documentationProvider: none diff --git a/bin/configs/unmaintained/spring-boot-implicitHeaders-oas3.yaml b/bin/configs/unmaintained/spring-boot-implicitHeaders-oas3.yaml index 3d9423cd326..0138a39e95f 100644 --- a/bin/configs/unmaintained/spring-boot-implicitHeaders-oas3.yaml +++ b/bin/configs/unmaintained/spring-boot-implicitHeaders-oas3.yaml @@ -1,9 +1,9 @@ generatorName: spring outputDir: samples/openapi3/server/petstore/springboot-implicitHeaders -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaSpring +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaSpring additionalProperties: - groupId: org.openapitools.openapi3 + groupId: org.openapijsonschematools.openapi3 documentationProvider: springdoc oas3: "true" artifactId: springboot-implicitHeaders diff --git a/bin/configs/unmaintained/spring-boot-implicitHeaders.yaml b/bin/configs/unmaintained/spring-boot-implicitHeaders.yaml index d870353a0ff..e130b4db45c 100644 --- a/bin/configs/unmaintained/spring-boot-implicitHeaders.yaml +++ b/bin/configs/unmaintained/spring-boot-implicitHeaders.yaml @@ -1,7 +1,7 @@ generatorName: spring outputDir: samples/server/petstore/springboot-implicitHeaders -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaSpring +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaSpring additionalProperties: artifactId: springboot-implicitHeaders documentationProvider: springfox diff --git a/bin/configs/unmaintained/spring-boot-oas3.yaml b/bin/configs/unmaintained/spring-boot-oas3.yaml index 21994a14ad4..3fa5c6d530c 100644 --- a/bin/configs/unmaintained/spring-boot-oas3.yaml +++ b/bin/configs/unmaintained/spring-boot-oas3.yaml @@ -1,9 +1,9 @@ generatorName: spring outputDir: samples/openapi3/server/petstore/springboot -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaSpring +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaSpring additionalProperties: - groupId: org.openapitools.openapi3 + groupId: org.openapijsonschematools.openapi3 documentationProvider: springdoc artifactId: springboot snapshotVersion: "true" diff --git a/bin/configs/unmaintained/spring-boot-oneof.yaml b/bin/configs/unmaintained/spring-boot-oneof.yaml index a986fc8fabe..13432931153 100644 --- a/bin/configs/unmaintained/spring-boot-oneof.yaml +++ b/bin/configs/unmaintained/spring-boot-oneof.yaml @@ -1,9 +1,9 @@ generatorName: spring outputDir: samples/openapi3/server/petstore/spring-boot-oneof -inputSpec: modules/openapi-generator/src/test/resources/3_0/oneof_polymorphism_and_inheritance.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaSpring +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/oneof_polymorphism_and_inheritance.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaSpring additionalProperties: - groupId: org.openapitools.openapi3 + groupId: org.openapijsonschematools.openapi3 documentationProvider: springdoc artifactId: springboot-oneof snapshotVersion: "true" diff --git a/bin/configs/unmaintained/spring-boot-reactive-oas3.yaml b/bin/configs/unmaintained/spring-boot-reactive-oas3.yaml index 3e3fb91657b..d7af4ceddef 100644 --- a/bin/configs/unmaintained/spring-boot-reactive-oas3.yaml +++ b/bin/configs/unmaintained/spring-boot-reactive-oas3.yaml @@ -1,9 +1,9 @@ generatorName: spring outputDir: samples/openapi3/server/petstore/springboot-reactive -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaSpring +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaSpring additionalProperties: - groupId: org.openapitools.openapi3 + groupId: org.openapijsonschematools.openapi3 documentationProvider: springdoc artifactId: springboot-reactive reactive: "true" diff --git a/bin/configs/unmaintained/spring-boot-reactive.yaml b/bin/configs/unmaintained/spring-boot-reactive.yaml index b3edff7de11..fc57289a59f 100644 --- a/bin/configs/unmaintained/spring-boot-reactive.yaml +++ b/bin/configs/unmaintained/spring-boot-reactive.yaml @@ -1,7 +1,7 @@ generatorName: spring outputDir: samples/server/petstore/springboot-reactive -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaSpring +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaSpring additionalProperties: artifactId: springboot-reactive documentationProvider: springfox diff --git a/bin/configs/unmaintained/spring-boot-source.yaml b/bin/configs/unmaintained/spring-boot-source.yaml index a1572c0e19c..9237927bf13 100644 --- a/bin/configs/unmaintained/spring-boot-source.yaml +++ b/bin/configs/unmaintained/spring-boot-source.yaml @@ -1,9 +1,9 @@ generatorName: spring outputDir: samples/openapi3/server/petstore/springboot-source -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaSpring +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaSpring additionalProperties: - groupId: org.openapitools.openapi3 + groupId: org.openapijsonschematools.openapi3 documentationProvider: source artifactId: springboot snapshotVersion: "true" diff --git a/bin/configs/unmaintained/spring-boot-springdoc.yaml b/bin/configs/unmaintained/spring-boot-springdoc.yaml index fe479cd21e7..1150ec15d16 100644 --- a/bin/configs/unmaintained/spring-boot-springdoc.yaml +++ b/bin/configs/unmaintained/spring-boot-springdoc.yaml @@ -1,9 +1,9 @@ generatorName: spring outputDir: samples/openapi3/server/petstore/spring-boot-springdoc -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaSpring +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaSpring additionalProperties: - groupId: org.openapitools.openapi3 + groupId: org.openapijsonschematools.openapi3 documentationProvider: springdoc useSwaggerUI: false artifactId: spring-boot-springdoc diff --git a/bin/configs/unmaintained/spring-boot-useoptional-oas3.yaml b/bin/configs/unmaintained/spring-boot-useoptional-oas3.yaml index ac66d1df148..1b6955a074e 100644 --- a/bin/configs/unmaintained/spring-boot-useoptional-oas3.yaml +++ b/bin/configs/unmaintained/spring-boot-useoptional-oas3.yaml @@ -1,9 +1,9 @@ generatorName: spring outputDir: samples/openapi3/server/petstore/springboot-useoptional -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaSpring +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaSpring additionalProperties: - groupId: org.openapitools.openapi3 + groupId: org.openapijsonschematools.openapi3 documentationProvider: springdoc useOptional: true artifactId: spring-boot-useoptional diff --git a/bin/configs/unmaintained/spring-boot-useoptional.yaml b/bin/configs/unmaintained/spring-boot-useoptional.yaml index 1e028977898..f6345e79fa6 100644 --- a/bin/configs/unmaintained/spring-boot-useoptional.yaml +++ b/bin/configs/unmaintained/spring-boot-useoptional.yaml @@ -1,7 +1,7 @@ generatorName: spring outputDir: samples/server/petstore/springboot-useoptional -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaSpring +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaSpring additionalProperties: documentationProvider: springfox useOptional: true diff --git a/bin/configs/unmaintained/spring-boot-virtualan.yaml b/bin/configs/unmaintained/spring-boot-virtualan.yaml index f1ae90fa859..2beddfeb651 100644 --- a/bin/configs/unmaintained/spring-boot-virtualan.yaml +++ b/bin/configs/unmaintained/spring-boot-virtualan.yaml @@ -1,12 +1,12 @@ generatorName: spring outputDir: samples/server/petstore/springboot-virtualan library: spring-boot -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaSpring +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaSpring additionalProperties: documentationProvider: springdoc - apiPackage: org.openapitools.virtualan.api - modelPackage: org.openapitools.virtualan.model + apiPackage: org.openapijsonschematools.virtualan.api + modelPackage: org.openapijsonschematools.virtualan.model virtualService: true artifactId: springboot-virtualan hideGenerationTimestamp: "true" diff --git a/bin/configs/unmaintained/spring-boot.yaml b/bin/configs/unmaintained/spring-boot.yaml index fe2345e7126..2656269e47d 100644 --- a/bin/configs/unmaintained/spring-boot.yaml +++ b/bin/configs/unmaintained/spring-boot.yaml @@ -1,7 +1,7 @@ generatorName: spring outputDir: samples/server/petstore/springboot -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaSpring +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaSpring additionalProperties: documentationProvider: springfox artifactId: springboot diff --git a/bin/configs/unmaintained/spring-cloud-3.yaml b/bin/configs/unmaintained/spring-cloud-3.yaml index 392f4389537..e9483a14ce6 100644 --- a/bin/configs/unmaintained/spring-cloud-3.yaml +++ b/bin/configs/unmaintained/spring-cloud-3.yaml @@ -1,10 +1,10 @@ generatorName: spring library: spring-cloud outputDir: samples/openapi3/client/petstore/spring-cloud-3 -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaSpring +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaSpring additionalProperties: - groupId: org.openapitools.openapi3 + groupId: org.openapijsonschematools.openapi3 documentationProvider: springdoc artifactId: spring-cloud-oas3 useSpringBoot3: "true" diff --git a/bin/configs/unmaintained/spring-cloud-async-oas3.yaml b/bin/configs/unmaintained/spring-cloud-async-oas3.yaml index 59c9d22e695..a03cb304ae8 100644 --- a/bin/configs/unmaintained/spring-cloud-async-oas3.yaml +++ b/bin/configs/unmaintained/spring-cloud-async-oas3.yaml @@ -1,10 +1,10 @@ generatorName: spring outputDir: samples/openapi3/client/petstore/spring-cloud-async library: spring-cloud -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaSpring +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaSpring additionalProperties: - groupId: org.openapitools.openapi3 + groupId: org.openapijsonschematools.openapi3 documentationProvider: springdoc async: "true" java8: "true" diff --git a/bin/configs/unmaintained/spring-cloud-async.yaml b/bin/configs/unmaintained/spring-cloud-async.yaml index b14f654366f..c1705f2d467 100644 --- a/bin/configs/unmaintained/spring-cloud-async.yaml +++ b/bin/configs/unmaintained/spring-cloud-async.yaml @@ -1,8 +1,8 @@ generatorName: spring outputDir: samples/client/petstore/spring-cloud-async library: spring-cloud -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaSpring +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaSpring additionalProperties: documentationProvider: springfox async: "true" diff --git a/bin/configs/unmaintained/spring-cloud-date-time-oas3.yaml b/bin/configs/unmaintained/spring-cloud-date-time-oas3.yaml index 9e5724d2ac9..b418a8326ae 100644 --- a/bin/configs/unmaintained/spring-cloud-date-time-oas3.yaml +++ b/bin/configs/unmaintained/spring-cloud-date-time-oas3.yaml @@ -1,10 +1,10 @@ generatorName: spring library: spring-cloud outputDir: samples/openapi3/client/petstore/spring-cloud-date-time -inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/date-time-parameter-types-for-testing.yml -templateDir: modules/openapi-generator/src/main/resources/JavaSpring +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/spring/date-time-parameter-types-for-testing.yml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaSpring additionalProperties: - groupId: org.openapitools.openapi3 + groupId: org.openapijsonschematools.openapi3 documentationProvider: springdoc artifactId: spring-cloud-date-time-oas3 interfaceOnly: "true" diff --git a/bin/configs/unmaintained/spring-cloud-date-time.yaml b/bin/configs/unmaintained/spring-cloud-date-time.yaml index ff06030aab3..7b7c5f06660 100644 --- a/bin/configs/unmaintained/spring-cloud-date-time.yaml +++ b/bin/configs/unmaintained/spring-cloud-date-time.yaml @@ -1,8 +1,8 @@ generatorName: spring library: spring-cloud outputDir: samples/client/petstore/spring-cloud-date-time -inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/date-time-parameter-types-for-testing.yml -templateDir: modules/openapi-generator/src/main/resources/JavaSpring +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/spring/date-time-parameter-types-for-testing.yml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaSpring additionalProperties: documentationProvider: springfox artifactId: spring-cloud-date-time diff --git a/bin/configs/unmaintained/spring-cloud-oas3-fakeapi.yaml b/bin/configs/unmaintained/spring-cloud-oas3-fakeapi.yaml index 3f4e3c8ba3a..89f3175c5a2 100644 --- a/bin/configs/unmaintained/spring-cloud-oas3-fakeapi.yaml +++ b/bin/configs/unmaintained/spring-cloud-oas3-fakeapi.yaml @@ -1,10 +1,10 @@ generatorName: spring library: spring-cloud outputDir: samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaSpring +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaSpring additionalProperties: - groupId: org.openapitools.openapi3 + groupId: org.openapijsonschematools.openapi3 documentationProvider: springdoc artifactId: spring-cloud-oas3 interfaceOnly: "true" diff --git a/bin/configs/unmaintained/spring-cloud-oas3.yaml b/bin/configs/unmaintained/spring-cloud-oas3.yaml index c43b53303af..7512f937037 100644 --- a/bin/configs/unmaintained/spring-cloud-oas3.yaml +++ b/bin/configs/unmaintained/spring-cloud-oas3.yaml @@ -1,10 +1,10 @@ generatorName: spring library: spring-cloud outputDir: samples/openapi3/client/petstore/spring-cloud -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaSpring +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaSpring additionalProperties: - groupId: org.openapitools.openapi3 + groupId: org.openapijsonschematools.openapi3 documentationProvider: springdoc artifactId: spring-cloud-oas3 interfaceOnly: "true" diff --git a/bin/configs/unmaintained/spring-cloud-petstore-feign-spring-pageable-oas3.yaml b/bin/configs/unmaintained/spring-cloud-petstore-feign-spring-pageable-oas3.yaml index 02c96627b64..65a6d15cce4 100644 --- a/bin/configs/unmaintained/spring-cloud-petstore-feign-spring-pageable-oas3.yaml +++ b/bin/configs/unmaintained/spring-cloud-petstore-feign-spring-pageable-oas3.yaml @@ -1,10 +1,10 @@ generatorName: spring outputDir: samples/openapi3/client/petstore/spring-cloud-spring-pageable library: spring-cloud -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-spring-pageable.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaSpring +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-spring-pageable.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaSpring additionalProperties: - groupId: org.openapitools.openapi3 + groupId: org.openapijsonschematools.openapi3 documentationProvider: springdoc artifactId: spring-cloud-spring-pageable hideGenerationTimestamp: 'true' diff --git a/bin/configs/unmaintained/spring-cloud-petstore-feign-spring-pageable.yaml b/bin/configs/unmaintained/spring-cloud-petstore-feign-spring-pageable.yaml index 506a1c53be6..4205ad47dfb 100644 --- a/bin/configs/unmaintained/spring-cloud-petstore-feign-spring-pageable.yaml +++ b/bin/configs/unmaintained/spring-cloud-petstore-feign-spring-pageable.yaml @@ -1,8 +1,8 @@ generatorName: spring outputDir: samples/client/petstore/spring-cloud-spring-pageable library: spring-cloud -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-spring-pageable.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaSpring +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-spring-pageable.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaSpring additionalProperties: documentationProvider: springfox artifactId: spring-cloud-spring-pageable diff --git a/bin/configs/unmaintained/spring-cloud-petstore-feign-without-url-param.yaml b/bin/configs/unmaintained/spring-cloud-petstore-feign-without-url-param.yaml index 9b86ed155ed..205b92bc184 100644 --- a/bin/configs/unmaintained/spring-cloud-petstore-feign-without-url-param.yaml +++ b/bin/configs/unmaintained/spring-cloud-petstore-feign-without-url-param.yaml @@ -1,8 +1,8 @@ generatorName: spring outputDir: samples/client/petstore/spring-cloud-feign-without-url library: spring-cloud -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaSpring +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaSpring additionalProperties: documentationProvider: springfox artifactId: petstore-spring-cloud diff --git a/bin/configs/unmaintained/spring-cloud.yaml b/bin/configs/unmaintained/spring-cloud.yaml index cd207cd64cd..5ef4970272e 100644 --- a/bin/configs/unmaintained/spring-cloud.yaml +++ b/bin/configs/unmaintained/spring-cloud.yaml @@ -1,8 +1,8 @@ generatorName: spring outputDir: samples/client/petstore/spring-cloud library: spring-cloud -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaSpring +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaSpring additionalProperties: documentationProvider: springfox artifactId: petstore-spring-cloud diff --git a/bin/configs/unmaintained/spring-nullable-set.yaml b/bin/configs/unmaintained/spring-nullable-set.yaml index 64122c7cf3c..d695c4d6d7d 100644 --- a/bin/configs/unmaintained/spring-nullable-set.yaml +++ b/bin/configs/unmaintained/spring-nullable-set.yaml @@ -1,8 +1,8 @@ generatorName: spring library: spring-boot outputDir: samples/server/petstore/spring-boot-nullable-set -inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/10167-nullable-set.yml -templateDir: modules/openapi-generator/src/main/resources/JavaSpring +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/spring/10167-nullable-set.yml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaSpring additionalProperties: artifactId: spring-boot-nullable-set interfaceOnly: "true" diff --git a/bin/configs/unmaintained/spring-stubs-oas3.yaml b/bin/configs/unmaintained/spring-stubs-oas3.yaml index d5149f28adc..9c46d9985e8 100644 --- a/bin/configs/unmaintained/spring-stubs-oas3.yaml +++ b/bin/configs/unmaintained/spring-stubs-oas3.yaml @@ -1,9 +1,9 @@ generatorName: spring outputDir: samples/openapi3/client/petstore/spring-stubs -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaSpring +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaSpring additionalProperties: - groupId: org.openapitools.openapi3 + groupId: org.openapijsonschematools.openapi3 documentationProvider: springdoc artifactId: spring-stubs interfaceOnly: "true" diff --git a/bin/configs/unmaintained/spring-stubs-skip-default-interface.yaml b/bin/configs/unmaintained/spring-stubs-skip-default-interface.yaml index bb107e0bd2a..4e2be190dbd 100644 --- a/bin/configs/unmaintained/spring-stubs-skip-default-interface.yaml +++ b/bin/configs/unmaintained/spring-stubs-skip-default-interface.yaml @@ -1,9 +1,9 @@ generatorName: spring outputDir: samples/openapi3/client/petstore/spring-stubs-skip-default-interface -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaSpring +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaSpring additionalProperties: - groupId: org.openapitools.openapi3 + groupId: org.openapijsonschematools.openapi3 documentationProvider: springdoc artifactId: spring-stubs interfaceOnly: "true" diff --git a/bin/configs/unmaintained/spring-stubs.yaml b/bin/configs/unmaintained/spring-stubs.yaml index 349c5e229c7..3fb8f650aae 100644 --- a/bin/configs/unmaintained/spring-stubs.yaml +++ b/bin/configs/unmaintained/spring-stubs.yaml @@ -1,7 +1,7 @@ generatorName: spring outputDir: samples/server/petstore/spring-stubs -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaSpring +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaSpring additionalProperties: documentationProvider: springfox artifactId: spring-stubs diff --git a/bin/configs/unmaintained/springboot-petstore-server-spring-pageable-delegatePattern-without-j8.yaml b/bin/configs/unmaintained/springboot-petstore-server-spring-pageable-delegatePattern-without-j8.yaml index 7d16b4a1e76..72c85acae0c 100644 --- a/bin/configs/unmaintained/springboot-petstore-server-spring-pageable-delegatePattern-without-j8.yaml +++ b/bin/configs/unmaintained/springboot-petstore-server-spring-pageable-delegatePattern-without-j8.yaml @@ -1,8 +1,8 @@ generatorName: spring outputDir: samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8 library: spring-boot -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing-with-spring-pageable.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaSpring +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing-with-spring-pageable.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaSpring delegatePattern: true java8: false additionalProperties: diff --git a/bin/configs/unmaintained/springboot-petstore-server-spring-pageable-delegatePattern.yaml b/bin/configs/unmaintained/springboot-petstore-server-spring-pageable-delegatePattern.yaml index c4d1eb5b687..a32b6fc4930 100644 --- a/bin/configs/unmaintained/springboot-petstore-server-spring-pageable-delegatePattern.yaml +++ b/bin/configs/unmaintained/springboot-petstore-server-spring-pageable-delegatePattern.yaml @@ -1,8 +1,8 @@ generatorName: spring outputDir: samples/server/petstore/springboot-spring-pageable-delegatePattern library: spring-boot -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing-with-spring-pageable.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaSpring +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing-with-spring-pageable.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaSpring delegatePattern: true additionalProperties: documentationProvider: springfox diff --git a/bin/configs/unmaintained/springboot-petstore-server-spring-pageable-without-j8.yaml b/bin/configs/unmaintained/springboot-petstore-server-spring-pageable-without-j8.yaml index 87c63968490..56f56d6d55d 100644 --- a/bin/configs/unmaintained/springboot-petstore-server-spring-pageable-without-j8.yaml +++ b/bin/configs/unmaintained/springboot-petstore-server-spring-pageable-without-j8.yaml @@ -1,8 +1,8 @@ generatorName: spring outputDir: samples/server/petstore/springboot-spring-pageable-without-j8 library: spring-boot -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing-with-spring-pageable.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaSpring +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing-with-spring-pageable.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaSpring java8: false additionalProperties: documentationProvider: springfox diff --git a/bin/configs/unmaintained/springboot-petstore-server-spring-pageable.yaml b/bin/configs/unmaintained/springboot-petstore-server-spring-pageable.yaml index db518c22604..8ec43c40222 100644 --- a/bin/configs/unmaintained/springboot-petstore-server-spring-pageable.yaml +++ b/bin/configs/unmaintained/springboot-petstore-server-spring-pageable.yaml @@ -1,8 +1,8 @@ generatorName: spring outputDir: samples/server/petstore/springboot-spring-pageable library: spring-boot -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing-with-spring-pageable.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaSpring +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing-with-spring-pageable.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/JavaSpring additionalProperties: documentationProvider: springfox artifactId: springboot-spring-pageable diff --git a/bin/configs/unmaintained/swift5-alamofireLibrary.yaml b/bin/configs/unmaintained/swift5-alamofireLibrary.yaml index 4c248326d53..3fdb3adbd1a 100644 --- a/bin/configs/unmaintained/swift5-alamofireLibrary.yaml +++ b/bin/configs/unmaintained/swift5-alamofireLibrary.yaml @@ -1,11 +1,11 @@ generatorName: swift5 outputDir: samples/client/petstore/swift5/alamofireLibrary library: alamofire -inputSpec: modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/swift5 +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/swift5 generateAliasAsModel: true additionalProperties: podAuthors: "" podSummary: PetstoreClient projectName: PetstoreClient - podHomepage: https://github.com/openapitools/openapi-generator + podHomepage: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator diff --git a/bin/configs/unmaintained/swift5-asyncAwaitLibrary.yaml b/bin/configs/unmaintained/swift5-asyncAwaitLibrary.yaml index fed714a2d68..ce39b971df0 100644 --- a/bin/configs/unmaintained/swift5-asyncAwaitLibrary.yaml +++ b/bin/configs/unmaintained/swift5-asyncAwaitLibrary.yaml @@ -1,11 +1,11 @@ generatorName: swift5 outputDir: samples/client/petstore/swift5/asyncAwaitLibrary -inputSpec: modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/swift5 +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/swift5 generateAliasAsModel: true additionalProperties: responseAs: AsyncAwait podAuthors: "" podSummary: PetstoreClient projectName: PetstoreClient - podHomepage: https://github.com/openapitools/openapi-generator + podHomepage: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator diff --git a/bin/configs/unmaintained/swift5-combineLibrary.yaml b/bin/configs/unmaintained/swift5-combineLibrary.yaml index 9456638acf9..0bad19615f3 100644 --- a/bin/configs/unmaintained/swift5-combineLibrary.yaml +++ b/bin/configs/unmaintained/swift5-combineLibrary.yaml @@ -1,11 +1,11 @@ generatorName: swift5 outputDir: samples/client/petstore/swift5/combineLibrary -inputSpec: modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/swift5 +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/swift5 generateAliasAsModel: true additionalProperties: responseAs: Combine podAuthors: "" podSummary: PetstoreClient projectName: PetstoreClient - podHomepage: https://github.com/openapitools/openapi-generator + podHomepage: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator diff --git a/bin/configs/unmaintained/swift5-default.yaml b/bin/configs/unmaintained/swift5-default.yaml index fffd318be1a..0475ee2d102 100644 --- a/bin/configs/unmaintained/swift5-default.yaml +++ b/bin/configs/unmaintained/swift5-default.yaml @@ -1,10 +1,10 @@ generatorName: swift5 outputDir: samples/client/petstore/swift5/default -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/swift5 +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/swift5 generateAliasAsModel: true additionalProperties: podAuthors: "" podSummary: PetstoreClient projectName: PetstoreClient - podHomepage: https://github.com/openapitools/openapi-generator + podHomepage: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator diff --git a/bin/configs/unmaintained/swift5-deprecated.yaml b/bin/configs/unmaintained/swift5-deprecated.yaml index 0b020673134..8223592cb48 100644 --- a/bin/configs/unmaintained/swift5-deprecated.yaml +++ b/bin/configs/unmaintained/swift5-deprecated.yaml @@ -1,10 +1,10 @@ generatorName: swift5 outputDir: samples/client/petstore/swift5/deprecated -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-depreacted-fields.yaml -templateDir: modules/openapi-generator/src/main/resources/swift5 +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore-with-depreacted-fields.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/swift5 generateAliasAsModel: true additionalProperties: podAuthors: "" podSummary: PetstoreClient projectName: PetstoreClient - podHomepage: https://github.com/openapitools/openapi-generator + podHomepage: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator diff --git a/bin/configs/unmaintained/swift5-frozenEnums.yaml b/bin/configs/unmaintained/swift5-frozenEnums.yaml index 38ca413f350..cec59ef4552 100644 --- a/bin/configs/unmaintained/swift5-frozenEnums.yaml +++ b/bin/configs/unmaintained/swift5-frozenEnums.yaml @@ -1,7 +1,7 @@ generatorName: swift5 outputDir: samples/client/petstore/swift5/frozenEnums -inputSpec: modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/swift5 +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/swift5 generateAliasAsModel: true additionalProperties: podAuthors: "" @@ -9,4 +9,4 @@ additionalProperties: sortParamsByRequiredFlag: false enumUnknownDefaultCase: true projectName: PetstoreClient - podHomepage: https://github.com/openapitools/openapi-generator + podHomepage: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator diff --git a/bin/configs/unmaintained/swift5-nonPublicApi.yaml b/bin/configs/unmaintained/swift5-nonPublicApi.yaml index 1aec2c3bb16..12089d0d2f8 100644 --- a/bin/configs/unmaintained/swift5-nonPublicApi.yaml +++ b/bin/configs/unmaintained/swift5-nonPublicApi.yaml @@ -1,7 +1,7 @@ generatorName: swift5 outputDir: samples/client/petstore/swift5/nonPublicApi -inputSpec: modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/swift5 +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/swift5 generateAliasAsModel: true additionalProperties: podAuthors: "" @@ -9,4 +9,4 @@ additionalProperties: sortParamsByRequiredFlag: false nonPublicApi: true projectName: PetstoreClient - podHomepage: https://github.com/openapitools/openapi-generator + podHomepage: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator diff --git a/bin/configs/unmaintained/swift5-objcCompatible.yaml b/bin/configs/unmaintained/swift5-objcCompatible.yaml index deb33907cc4..6246e7409ec 100644 --- a/bin/configs/unmaintained/swift5-objcCompatible.yaml +++ b/bin/configs/unmaintained/swift5-objcCompatible.yaml @@ -1,11 +1,11 @@ generatorName: swift5 outputDir: samples/client/petstore/swift5/objcCompatible -inputSpec: modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/swift5 +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/swift5 generateAliasAsModel: true additionalProperties: podAuthors: "" podSummary: PetstoreClient objcCompatible: true projectName: PetstoreClient - podHomepage: https://github.com/openapitools/openapi-generator + podHomepage: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator diff --git a/bin/configs/unmaintained/swift5-oneOf.yaml b/bin/configs/unmaintained/swift5-oneOf.yaml index 975892b340c..01975eb8fd6 100644 --- a/bin/configs/unmaintained/swift5-oneOf.yaml +++ b/bin/configs/unmaintained/swift5-oneOf.yaml @@ -1,10 +1,10 @@ generatorName: swift5 outputDir: samples/client/petstore/swift5/oneOf -inputSpec: modules/openapi-generator/src/test/resources/3_0/oneOf.yaml -templateDir: modules/openapi-generator/src/main/resources/swift5 +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/oneOf.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/swift5 generateAliasAsModel: true additionalProperties: podAuthors: "" podSummary: PetstoreClient projectName: PetstoreClient - podHomepage: https://github.com/openapitools/openapi-generator + podHomepage: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator diff --git a/bin/configs/unmaintained/swift5-promisekitLibrary.yaml b/bin/configs/unmaintained/swift5-promisekitLibrary.yaml index 5cdeb02ad29..5e5a06d2650 100644 --- a/bin/configs/unmaintained/swift5-promisekitLibrary.yaml +++ b/bin/configs/unmaintained/swift5-promisekitLibrary.yaml @@ -1,11 +1,11 @@ generatorName: swift5 outputDir: samples/client/petstore/swift5/promisekitLibrary -inputSpec: modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/swift5 +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/swift5 generateAliasAsModel: true additionalProperties: responseAs: PromiseKit podAuthors: "" podSummary: PetstoreClient projectName: PetstoreClient - podHomepage: https://github.com/openapitools/openapi-generator + podHomepage: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator diff --git a/bin/configs/unmaintained/swift5-readonlyProperties.yaml b/bin/configs/unmaintained/swift5-readonlyProperties.yaml index 0bb8b9d6f57..057e34de947 100644 --- a/bin/configs/unmaintained/swift5-readonlyProperties.yaml +++ b/bin/configs/unmaintained/swift5-readonlyProperties.yaml @@ -1,11 +1,11 @@ generatorName: swift5 outputDir: samples/client/petstore/swift5/readonlyProperties -inputSpec: modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/swift5 +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/swift5 generateAliasAsModel: true additionalProperties: podAuthors: "" podSummary: PetstoreClient readonlyProperties: true projectName: PetstoreClient - podHomepage: https://github.com/openapitools/openapi-generator + podHomepage: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator diff --git a/bin/configs/unmaintained/swift5-resultLibrary.yaml b/bin/configs/unmaintained/swift5-resultLibrary.yaml index 01de8b1d98e..00f8e14580f 100644 --- a/bin/configs/unmaintained/swift5-resultLibrary.yaml +++ b/bin/configs/unmaintained/swift5-resultLibrary.yaml @@ -1,12 +1,12 @@ generatorName: swift5 outputDir: samples/client/petstore/swift5/resultLibrary -inputSpec: modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/swift5 +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/swift5 generateAliasAsModel: true additionalProperties: responseAs: Result podAuthors: "" podSummary: PetstoreClient projectName: PetstoreClient - podHomepage: https://github.com/openapitools/openapi-generator + podHomepage: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator removeMigrationProjectNameClass: true diff --git a/bin/configs/unmaintained/swift5-rxswiftLibrary.yaml b/bin/configs/unmaintained/swift5-rxswiftLibrary.yaml index 8751d347912..7e19284f064 100644 --- a/bin/configs/unmaintained/swift5-rxswiftLibrary.yaml +++ b/bin/configs/unmaintained/swift5-rxswiftLibrary.yaml @@ -1,13 +1,13 @@ generatorName: swift5 outputDir: samples/client/petstore/swift5/rxswiftLibrary -inputSpec: modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/swift5 +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/swift5 generateAliasAsModel: true additionalProperties: responseAs: RxSwift podAuthors: "" podSummary: PetstoreClient projectName: PetstoreClient - podHomepage: https://github.com/openapitools/openapi-generator + podHomepage: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator useBacktickEscapes: true generateModelAdditionalProperties: false diff --git a/bin/configs/unmaintained/swift5-urlsessionLibrary.yaml b/bin/configs/unmaintained/swift5-urlsessionLibrary.yaml index 1520a7c1ea9..1ec29023d1c 100644 --- a/bin/configs/unmaintained/swift5-urlsessionLibrary.yaml +++ b/bin/configs/unmaintained/swift5-urlsessionLibrary.yaml @@ -1,14 +1,14 @@ generatorName: swift5 outputDir: samples/client/petstore/swift5/urlsessionLibrary library: urlsession -inputSpec: modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/swift5 +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/swift5 generateAliasAsModel: true additionalProperties: podAuthors: "" podSummary: PetstoreClient projectName: PetstoreClient - podHomepage: https://github.com/openapitools/openapi-generator + podHomepage: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator useSPMFileStructure: true useClasses: true swiftUseApiNamespace: true diff --git a/bin/configs/unmaintained/swift5-vapor.yaml b/bin/configs/unmaintained/swift5-vapor.yaml index 5f1d2067969..a9cae263d6e 100644 --- a/bin/configs/unmaintained/swift5-vapor.yaml +++ b/bin/configs/unmaintained/swift5-vapor.yaml @@ -1,8 +1,8 @@ generatorName: swift5 outputDir: samples/client/petstore/swift5/vaporLibrary library: vapor -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/swift5 +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/swift5 generateAliasAsModel: true additionalProperties: projectName: PetstoreClient diff --git a/bin/configs/unmaintained/swift5-x-swift-hashable.yaml b/bin/configs/unmaintained/swift5-x-swift-hashable.yaml index c07937d5336..021eba5b37f 100644 --- a/bin/configs/unmaintained/swift5-x-swift-hashable.yaml +++ b/bin/configs/unmaintained/swift5-x-swift-hashable.yaml @@ -1,11 +1,11 @@ generatorName: swift5 outputDir: samples/client/petstore/swift5/x-swift-hashable -inputSpec: modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/swift5 +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/swift5 generateAliasAsModel: true additionalProperties: podAuthors: "" podSummary: PetstoreClient projectName: PetstoreClient - podHomepage: https://github.com/openapitools/openapi-generator + podHomepage: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator hashableModels: false diff --git a/bin/configs/unmaintained/typescript-angular-v12-oneOf.yaml b/bin/configs/unmaintained/typescript-angular-v12-oneOf.yaml index 7d355b753cb..f9705177a2b 100644 --- a/bin/configs/unmaintained/typescript-angular-v12-oneOf.yaml +++ b/bin/configs/unmaintained/typescript-angular-v12-oneOf.yaml @@ -1,6 +1,6 @@ generatorName: typescript-angular outputDir: samples/client/petstore/typescript-angular-v12-oneOf/builds/default -inputSpec: modules/openapi-generator/src/test/resources/3_0/oneOfArrayMapImport.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-angular +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/oneOfArrayMapImport.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript-angular additionalProperties: ngVersion: 12.2.0 diff --git a/bin/configs/unmaintained/typescript-angular-v12-provided-in-any.yaml b/bin/configs/unmaintained/typescript-angular-v12-provided-in-any.yaml index 3cc0d756b33..817fceb168d 100644 --- a/bin/configs/unmaintained/typescript-angular-v12-provided-in-any.yaml +++ b/bin/configs/unmaintained/typescript-angular-v12-provided-in-any.yaml @@ -1,7 +1,7 @@ generatorName: typescript-angular outputDir: samples/client/petstore/typescript-angular-v12-provided-in-any/builds/default -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-angular +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript-angular additionalProperties: ngVersion: 12.2.0 providedIn: any diff --git a/bin/configs/unmaintained/typescript-angular-v12-provided-in-root-with-npm.yaml b/bin/configs/unmaintained/typescript-angular-v12-provided-in-root-with-npm.yaml index 35ae77b6f82..2faf5f83d23 100644 --- a/bin/configs/unmaintained/typescript-angular-v12-provided-in-root-with-npm.yaml +++ b/bin/configs/unmaintained/typescript-angular-v12-provided-in-root-with-npm.yaml @@ -1,10 +1,10 @@ generatorName: typescript-angular outputDir: samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-angular +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript-angular additionalProperties: ngVersion: 12.2.0 npmVersion: 1.0.0 - npmName: '@openapitools/typescript-angular-petstore' + npmName: '@openapijsonschematools/typescript-angular-petstore' npmRepository: https://skimdb.npmjs.com/registry snapshot: false diff --git a/bin/configs/unmaintained/typescript-angular-v12-provided-in-root.yaml b/bin/configs/unmaintained/typescript-angular-v12-provided-in-root.yaml index 746de9795ec..9e0571e9eeb 100644 --- a/bin/configs/unmaintained/typescript-angular-v12-provided-in-root.yaml +++ b/bin/configs/unmaintained/typescript-angular-v12-provided-in-root.yaml @@ -1,6 +1,6 @@ generatorName: typescript-angular outputDir: samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-angular +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript-angular additionalProperties: ngVersion: 12.2.0 diff --git a/bin/configs/unmaintained/typescript-angular-v13-oneOf.yaml b/bin/configs/unmaintained/typescript-angular-v13-oneOf.yaml index 7bc65fcbddc..2eeb76377bb 100644 --- a/bin/configs/unmaintained/typescript-angular-v13-oneOf.yaml +++ b/bin/configs/unmaintained/typescript-angular-v13-oneOf.yaml @@ -1,6 +1,6 @@ generatorName: typescript-angular outputDir: samples/client/petstore/typescript-angular-v13-oneOf/builds/default -inputSpec: modules/openapi-generator/src/test/resources/3_0/oneOfArrayMapImport.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-angular +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/oneOfArrayMapImport.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript-angular additionalProperties: ngVersion: 13.0.1 diff --git a/bin/configs/unmaintained/typescript-angular-v13-provided-in-any.yaml b/bin/configs/unmaintained/typescript-angular-v13-provided-in-any.yaml index 5cf16a7e0ea..ac44d7aeecc 100644 --- a/bin/configs/unmaintained/typescript-angular-v13-provided-in-any.yaml +++ b/bin/configs/unmaintained/typescript-angular-v13-provided-in-any.yaml @@ -1,7 +1,7 @@ generatorName: typescript-angular outputDir: samples/client/petstore/typescript-angular-v13-provided-in-any/builds/default -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-angular +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript-angular additionalProperties: ngVersion: 13.0.1 providedIn: any diff --git a/bin/configs/unmaintained/typescript-angular-v13-provided-in-root-with-npm.yaml b/bin/configs/unmaintained/typescript-angular-v13-provided-in-root-with-npm.yaml index dcf4d96d4dd..7a3915f0a54 100644 --- a/bin/configs/unmaintained/typescript-angular-v13-provided-in-root-with-npm.yaml +++ b/bin/configs/unmaintained/typescript-angular-v13-provided-in-root-with-npm.yaml @@ -1,11 +1,11 @@ generatorName: typescript-angular outputDir: samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-angular +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript-angular additionalProperties: ngVersion: 13.0.1 npmVersion: 1.0.0 - npmName: '@openapitools/typescript-angular-petstore' + npmName: '@openapijsonschematools/typescript-angular-petstore' npmRepository: https://skimdb.npmjs.com/registry snapshot: false supportsES6: true diff --git a/bin/configs/unmaintained/typescript-angular-v13-provided-in-root.yaml b/bin/configs/unmaintained/typescript-angular-v13-provided-in-root.yaml index 564081b45e9..3c10f05f7b2 100644 --- a/bin/configs/unmaintained/typescript-angular-v13-provided-in-root.yaml +++ b/bin/configs/unmaintained/typescript-angular-v13-provided-in-root.yaml @@ -1,7 +1,7 @@ generatorName: typescript-angular outputDir: samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-angular +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript-angular additionalProperties: ngVersion: 13.0.1 supportsES6: true diff --git a/bin/configs/unmaintained/typescript-angular-v14-provided-in-root.yaml b/bin/configs/unmaintained/typescript-angular-v14-provided-in-root.yaml index d125554b053..380c9765261 100644 --- a/bin/configs/unmaintained/typescript-angular-v14-provided-in-root.yaml +++ b/bin/configs/unmaintained/typescript-angular-v14-provided-in-root.yaml @@ -1,7 +1,7 @@ generatorName: typescript-angular outputDir: samples/client/petstore/typescript-angular-v14-provided-in-root/builds/default -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-angular +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript-angular additionalProperties: ngVersion: 14.0.5 supportsES6: true diff --git a/bin/configs/unmaintained/typescript-angular-v14-query-param-object-format.yaml b/bin/configs/unmaintained/typescript-angular-v14-query-param-object-format.yaml index f347fe53177..c56fbb45ef5 100644 --- a/bin/configs/unmaintained/typescript-angular-v14-query-param-object-format.yaml +++ b/bin/configs/unmaintained/typescript-angular-v14-query-param-object-format.yaml @@ -1,7 +1,7 @@ generatorName: typescript-angular outputDir: samples/client/petstore/typescript-angular-v14-query-param-object-format -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-angular +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript-angular additionalProperties: ngVersion: 14.0.5 supportsES6: true diff --git a/bin/configs/unmaintained/typescript-aurelia-default.yaml b/bin/configs/unmaintained/typescript-aurelia-default.yaml index 1d93065379c..78d42c8fa99 100644 --- a/bin/configs/unmaintained/typescript-aurelia-default.yaml +++ b/bin/configs/unmaintained/typescript-aurelia-default.yaml @@ -1,4 +1,4 @@ generatorName: typescript-aurelia outputDir: samples/client/petstore/typescript-aurelia/default -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-aurelia +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript-aurelia diff --git a/bin/configs/unmaintained/typescript-axios-composed-schemas.yaml b/bin/configs/unmaintained/typescript-axios-composed-schemas.yaml index cb51a976cbf..65e7eec6282 100644 --- a/bin/configs/unmaintained/typescript-axios-composed-schemas.yaml +++ b/bin/configs/unmaintained/typescript-axios-composed-schemas.yaml @@ -1,4 +1,4 @@ generatorName: typescript-axios outputDir: samples/client/petstore/typescript-axios/builds/composed-schemas -inputSpec: modules/openapi-generator/src/test/resources/3_0/composed-schemas.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-axios +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/composed-schemas.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript-axios diff --git a/bin/configs/unmaintained/typescript-axios-default.yaml b/bin/configs/unmaintained/typescript-axios-default.yaml index 8f04fba8c70..0e4791ecefe 100644 --- a/bin/configs/unmaintained/typescript-axios-default.yaml +++ b/bin/configs/unmaintained/typescript-axios-default.yaml @@ -1,4 +1,4 @@ generatorName: typescript-axios outputDir: samples/client/petstore/typescript-axios/builds/default -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-axios +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript-axios diff --git a/bin/configs/unmaintained/typescript-axios-es6-target.yaml b/bin/configs/unmaintained/typescript-axios-es6-target.yaml index 06ff80e7249..5d41c073647 100644 --- a/bin/configs/unmaintained/typescript-axios-es6-target.yaml +++ b/bin/configs/unmaintained/typescript-axios-es6-target.yaml @@ -1,10 +1,10 @@ generatorName: typescript-axios outputDir: samples/client/petstore/typescript-axios/builds/es6-target -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-axios +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript-axios additionalProperties: npmVersion: 1.0.0 supportsES6: true - npmName: '@openapitools/typescript-axios-petstore' + npmName: '@openapijsonschematools/typescript-axios-petstore' npmRepository: https://skimdb.npmjs.com/registry snapshot: false diff --git a/bin/configs/unmaintained/typescript-axios-test-petstore.yaml b/bin/configs/unmaintained/typescript-axios-test-petstore.yaml index 7873b2854fe..2bdf6679ce5 100644 --- a/bin/configs/unmaintained/typescript-axios-test-petstore.yaml +++ b/bin/configs/unmaintained/typescript-axios-test-petstore.yaml @@ -1,4 +1,4 @@ generatorName: typescript-axios outputDir: samples/client/petstore/typescript-axios/builds/test-petstore -inputSpec: modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-axios \ No newline at end of file +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript-axios \ No newline at end of file diff --git a/bin/configs/unmaintained/typescript-axios-with-complex-headers.yaml b/bin/configs/unmaintained/typescript-axios-with-complex-headers.yaml index e4eeee792ad..8f11550f478 100644 --- a/bin/configs/unmaintained/typescript-axios-with-complex-headers.yaml +++ b/bin/configs/unmaintained/typescript-axios-with-complex-headers.yaml @@ -1,4 +1,4 @@ generatorName: typescript-axios outputDir: samples/client/petstore/typescript-axios/builds/with-complex-headers -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-complex-headers.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-axios +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore-with-complex-headers.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript-axios diff --git a/bin/configs/unmaintained/typescript-axios-with-fake-endpoints-models-for-testing-with-http-signature.yaml b/bin/configs/unmaintained/typescript-axios-with-fake-endpoints-models-for-testing-with-http-signature.yaml index 65e913fc06e..0b2be0979d7 100644 --- a/bin/configs/unmaintained/typescript-axios-with-fake-endpoints-models-for-testing-with-http-signature.yaml +++ b/bin/configs/unmaintained/typescript-axios-with-fake-endpoints-models-for-testing-with-http-signature.yaml @@ -1,4 +1,4 @@ generatorName: typescript-axios outputDir: samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-axios +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript-axios diff --git a/bin/configs/unmaintained/typescript-axios-with-interfaces.yaml b/bin/configs/unmaintained/typescript-axios-with-interfaces.yaml index a1d792a5c2a..029f3cf0ec8 100644 --- a/bin/configs/unmaintained/typescript-axios-with-interfaces.yaml +++ b/bin/configs/unmaintained/typescript-axios-with-interfaces.yaml @@ -1,6 +1,6 @@ generatorName: typescript-axios outputDir: samples/client/petstore/typescript-axios/builds/with-interfaces -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-axios +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript-axios additionalProperties: withInterfaces: "true" diff --git a/bin/configs/unmaintained/typescript-axios-with-node-imports.yaml b/bin/configs/unmaintained/typescript-axios-with-node-imports.yaml index 1ed732421d2..d80bc7e33e3 100644 --- a/bin/configs/unmaintained/typescript-axios-with-node-imports.yaml +++ b/bin/configs/unmaintained/typescript-axios-with-node-imports.yaml @@ -1,7 +1,7 @@ generatorName: typescript-axios outputDir: samples/client/petstore/typescript-axios/builds/with-node-imports -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-operations-without-required-params.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-axios +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-operations-without-required-params.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript-axios additionalProperties: withNodeImports: "true" multipartFormData: "true" diff --git a/bin/configs/unmaintained/typescript-axios-with-npm-version-and-separate-models-and-api.yaml b/bin/configs/unmaintained/typescript-axios-with-npm-version-and-separate-models-and-api.yaml index 5967dd11e1c..7268de95f09 100644 --- a/bin/configs/unmaintained/typescript-axios-with-npm-version-and-separate-models-and-api.yaml +++ b/bin/configs/unmaintained/typescript-axios-with-npm-version-and-separate-models-and-api.yaml @@ -1,12 +1,12 @@ generatorName: typescript-axios outputDir: samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-axios +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript-axios additionalProperties: npmVersion: 1.0.0 apiPackage: api.another.level modelPackage: model.some.levels.deep withSeparateModelsAndApi: true - npmName: '@openapitools/typescript-axios-petstore' + npmName: '@openapijsonschematools/typescript-axios-petstore' npmRepository: https://skimdb.npmjs.com/registry snapshot: false diff --git a/bin/configs/unmaintained/typescript-axios-with-npm-version.yaml b/bin/configs/unmaintained/typescript-axios-with-npm-version.yaml index af18edee14f..57fe5cf1f05 100644 --- a/bin/configs/unmaintained/typescript-axios-with-npm-version.yaml +++ b/bin/configs/unmaintained/typescript-axios-with-npm-version.yaml @@ -1,9 +1,9 @@ generatorName: typescript-axios outputDir: samples/client/petstore/typescript-axios/builds/with-npm-version -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-axios +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript-axios additionalProperties: npmVersion: 1.0.0 - npmName: '@openapitools/typescript-axios-petstore' + npmName: '@openapijsonschematools/typescript-axios-petstore' npmRepository: https://skimdb.npmjs.com/registry snapshot: false diff --git a/bin/configs/unmaintained/typescript-axios-with-separate-models-and-api-inheritance.yaml b/bin/configs/unmaintained/typescript-axios-with-separate-models-and-api-inheritance.yaml index 155f7f435ff..c65f7886b4c 100644 --- a/bin/configs/unmaintained/typescript-axios-with-separate-models-and-api-inheritance.yaml +++ b/bin/configs/unmaintained/typescript-axios-with-separate-models-and-api-inheritance.yaml @@ -1,7 +1,7 @@ generatorName: typescript-axios outputDir: samples/client/others/typescript-axios/with-separate-models-and-api-inheritance -inputSpec: modules/openapi-generator/src/test/resources/3_0/typescript-axios/with-separate-models-and-api-inheritance.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-axios +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/typescript-axios/with-separate-models-and-api-inheritance.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript-axios additionalProperties: apiPackage: api modelPackage: model diff --git a/bin/configs/unmaintained/typescript-axios-with-single-request-parameters.yaml b/bin/configs/unmaintained/typescript-axios-with-single-request-parameters.yaml index a06f70ebd6c..88b0b82897c 100644 --- a/bin/configs/unmaintained/typescript-axios-with-single-request-parameters.yaml +++ b/bin/configs/unmaintained/typescript-axios-with-single-request-parameters.yaml @@ -1,6 +1,6 @@ generatorName: typescript-axios outputDir: samples/client/petstore/typescript-axios/builds/with-single-request-parameters -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-operations-without-required-params.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-axios +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-operations-without-required-params.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript-axios additionalProperties: useSingleRequestParameter: "true" diff --git a/bin/configs/unmaintained/typescript-axios-with-string-enums.yaml b/bin/configs/unmaintained/typescript-axios-with-string-enums.yaml index 4ea5a08e30d..3f1b34438ab 100644 --- a/bin/configs/unmaintained/typescript-axios-with-string-enums.yaml +++ b/bin/configs/unmaintained/typescript-axios-with-string-enums.yaml @@ -1,6 +1,6 @@ generatorName: typescript-axios outputDir: samples/client/petstore/typescript-axios/builds/with-string-enums -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-axios +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript-axios additionalProperties: stringEnums: true diff --git a/bin/configs/unmaintained/typescript-consolidated-browser.yaml b/bin/configs/unmaintained/typescript-consolidated-browser.yaml index 8ea49d065b2..17fe860212b 100644 --- a/bin/configs/unmaintained/typescript-consolidated-browser.yaml +++ b/bin/configs/unmaintained/typescript-consolidated-browser.yaml @@ -1,7 +1,7 @@ generatorName: typescript outputDir: samples/openapi3/client/petstore/typescript/builds/browser -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript additionalProperties: framework: fetch-api npmName: ts-petstore-client diff --git a/bin/configs/unmaintained/typescript-consolidated-composed-schemas.yaml b/bin/configs/unmaintained/typescript-consolidated-composed-schemas.yaml index 0da510f5bfc..5c88fce7a7d 100644 --- a/bin/configs/unmaintained/typescript-consolidated-composed-schemas.yaml +++ b/bin/configs/unmaintained/typescript-consolidated-composed-schemas.yaml @@ -1,6 +1,6 @@ generatorName: typescript outputDir: samples/openapi3/client/petstore/typescript/builds/composed-schemas -inputSpec: modules/openapi-generator/src/test/resources/3_0/composed-schemas.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/composed-schemas.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript additionalProperties: npmName: ts-petstore-client diff --git a/bin/configs/unmaintained/typescript-consolidated-deno.yaml b/bin/configs/unmaintained/typescript-consolidated-deno.yaml index b3317884609..7cceb05222d 100644 --- a/bin/configs/unmaintained/typescript-consolidated-deno.yaml +++ b/bin/configs/unmaintained/typescript-consolidated-deno.yaml @@ -1,7 +1,7 @@ generatorName: typescript outputDir: samples/openapi3/client/petstore/typescript/builds/deno -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript additionalProperties: platform: deno npmName: ts-petstore-client diff --git a/bin/configs/unmaintained/typescript-consolidated-inversify.yaml b/bin/configs/unmaintained/typescript-consolidated-inversify.yaml index 5d230cb88ea..35052217bda 100644 --- a/bin/configs/unmaintained/typescript-consolidated-inversify.yaml +++ b/bin/configs/unmaintained/typescript-consolidated-inversify.yaml @@ -1,7 +1,7 @@ generatorName: typescript outputDir: samples/openapi3/client/petstore/typescript/builds/inversify -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript additionalProperties: platform: node npmName: ts-petstore-client diff --git a/bin/configs/unmaintained/typescript-consolidated-jquery.yaml b/bin/configs/unmaintained/typescript-consolidated-jquery.yaml index 7e9669984c2..a2ddf236b4b 100644 --- a/bin/configs/unmaintained/typescript-consolidated-jquery.yaml +++ b/bin/configs/unmaintained/typescript-consolidated-jquery.yaml @@ -1,7 +1,7 @@ generatorName: typescript outputDir: samples/openapi3/client/petstore/typescript/builds/jquery -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript additionalProperties: framework: jquery npmName: ts-petstore-client diff --git a/bin/configs/unmaintained/typescript-consolidated-node-object-parameters.yaml b/bin/configs/unmaintained/typescript-consolidated-node-object-parameters.yaml index 5e4e13a7ec7..378461e1bf9 100644 --- a/bin/configs/unmaintained/typescript-consolidated-node-object-parameters.yaml +++ b/bin/configs/unmaintained/typescript-consolidated-node-object-parameters.yaml @@ -1,7 +1,7 @@ generatorName: typescript outputDir: samples/openapi3/client/petstore/typescript/builds/object_params -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript additionalProperties: platform: node npmName: ts-petstore-client diff --git a/bin/configs/unmaintained/typescript-consolidated-node.yaml b/bin/configs/unmaintained/typescript-consolidated-node.yaml index 9fb5f9a0553..ac5ad6569a4 100644 --- a/bin/configs/unmaintained/typescript-consolidated-node.yaml +++ b/bin/configs/unmaintained/typescript-consolidated-node.yaml @@ -1,7 +1,7 @@ generatorName: typescript outputDir: samples/openapi3/client/petstore/typescript/builds/default -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript additionalProperties: platform: node npmName: ts-petstore-client diff --git a/bin/configs/unmaintained/typescript-consolidated-with-unique-items.yaml b/bin/configs/unmaintained/typescript-consolidated-with-unique-items.yaml index ee21407df53..41413955372 100644 --- a/bin/configs/unmaintained/typescript-consolidated-with-unique-items.yaml +++ b/bin/configs/unmaintained/typescript-consolidated-with-unique-items.yaml @@ -1,4 +1,4 @@ generatorName: typescript outputDir: samples/client/others/typescript/builds/with-unique-items -inputSpec: modules/openapi-generator/src/test/resources/3_0/typescript/unique_items.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/typescript/unique_items.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript diff --git a/bin/configs/unmaintained/typescript-fetch-allOf-readonly.yaml b/bin/configs/unmaintained/typescript-fetch-allOf-readonly.yaml index f872c77267e..b365c15ab62 100644 --- a/bin/configs/unmaintained/typescript-fetch-allOf-readonly.yaml +++ b/bin/configs/unmaintained/typescript-fetch-allOf-readonly.yaml @@ -1,4 +1,4 @@ generatorName: typescript-fetch outputDir: samples/client/petstore/typescript-fetch/builds/allOf-readonly -inputSpec: modules/openapi-generator/src/test/resources/3_0/allOf-readonly.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-fetch +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/allOf-readonly.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript-fetch diff --git a/bin/configs/unmaintained/typescript-fetch-default-v3.0.yaml b/bin/configs/unmaintained/typescript-fetch-default-v3.0.yaml index 1fbde1d4a43..7560c70d7ff 100644 --- a/bin/configs/unmaintained/typescript-fetch-default-v3.0.yaml +++ b/bin/configs/unmaintained/typescript-fetch-default-v3.0.yaml @@ -1,4 +1,4 @@ generatorName: typescript-fetch outputDir: samples/client/petstore/typescript-fetch/builds/default-v3.0 -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-fetch +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript-fetch diff --git a/bin/configs/unmaintained/typescript-fetch-default.yaml b/bin/configs/unmaintained/typescript-fetch-default.yaml index 1a61fc45e01..5b60ca15177 100644 --- a/bin/configs/unmaintained/typescript-fetch-default.yaml +++ b/bin/configs/unmaintained/typescript-fetch-default.yaml @@ -1,4 +1,4 @@ generatorName: typescript-fetch outputDir: samples/client/petstore/typescript-fetch/builds/default -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-fetch +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript-fetch diff --git a/bin/configs/unmaintained/typescript-fetch-enum.yaml b/bin/configs/unmaintained/typescript-fetch-enum.yaml index 609b45160fa..1068b27fdab 100644 --- a/bin/configs/unmaintained/typescript-fetch-enum.yaml +++ b/bin/configs/unmaintained/typescript-fetch-enum.yaml @@ -1,4 +1,4 @@ generatorName: typescript-fetch outputDir: samples/client/petstore/typescript-fetch/builds/enum -inputSpec: modules/openapi-generator/src/test/resources/3_0/typescript-fetch/enum.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-fetch +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/typescript-fetch/enum.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript-fetch diff --git a/bin/configs/unmaintained/typescript-fetch-es6-target.yaml b/bin/configs/unmaintained/typescript-fetch-es6-target.yaml index 929fd29d1ce..5a47ecdc680 100644 --- a/bin/configs/unmaintained/typescript-fetch-es6-target.yaml +++ b/bin/configs/unmaintained/typescript-fetch-es6-target.yaml @@ -1,10 +1,10 @@ generatorName: typescript-fetch outputDir: samples/client/petstore/typescript-fetch/builds/es6-target -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-fetch +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript-fetch additionalProperties: npmVersion: 1.0.0 supportsES6: true - npmName: '@openapitools/typescript-fetch-petstore' + npmName: '@openapijsonschematools/typescript-fetch-petstore' npmRepository: https://skimdb.npmjs.com/registry snapshot: false diff --git a/bin/configs/unmaintained/typescript-fetch-multiple-parameters.yaml b/bin/configs/unmaintained/typescript-fetch-multiple-parameters.yaml index c0711f3baba..fd3e31f70e6 100644 --- a/bin/configs/unmaintained/typescript-fetch-multiple-parameters.yaml +++ b/bin/configs/unmaintained/typescript-fetch-multiple-parameters.yaml @@ -1,7 +1,7 @@ generatorName: typescript-fetch outputDir: samples/client/petstore/typescript-fetch/builds/multiple-parameters -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-fetch +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript-fetch additionalProperties: useSingleRequestParameter: false snapshot: false diff --git a/bin/configs/unmaintained/typescript-fetch-prefix-parameter-interfaces.yaml b/bin/configs/unmaintained/typescript-fetch-prefix-parameter-interfaces.yaml index ccb7b51eb7a..44fdfacbc27 100644 --- a/bin/configs/unmaintained/typescript-fetch-prefix-parameter-interfaces.yaml +++ b/bin/configs/unmaintained/typescript-fetch-prefix-parameter-interfaces.yaml @@ -1,10 +1,10 @@ generatorName: typescript-fetch outputDir: samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-fetch +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript-fetch additionalProperties: npmVersion: 1.0.0 - npmName: '@openapitools/typescript-fetch-petstore' + npmName: '@openapijsonschematools/typescript-fetch-petstore' npmRepository: https://skimdb.npmjs.com/registry prefixParameterInterfaces: true snapshot: false diff --git a/bin/configs/unmaintained/typescript-fetch-sagas-and-records.yaml b/bin/configs/unmaintained/typescript-fetch-sagas-and-records.yaml index 7852f487742..4f67d98d14d 100644 --- a/bin/configs/unmaintained/typescript-fetch-sagas-and-records.yaml +++ b/bin/configs/unmaintained/typescript-fetch-sagas-and-records.yaml @@ -1,10 +1,10 @@ generatorName: typescript-fetch outputDir: samples/client/petstore/typescript-fetch/builds/sagas-and-records -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing-saga-and-records.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-fetch +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing-saga-and-records.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript-fetch additionalProperties: npmVersion: 1.0.0 - npmName: '@openapitools/typescript-fetch-petstore' + npmName: '@openapijsonschematools/typescript-fetch-petstore' npmRepository: https://skimdb.npmjs.com/registry useSingleRequestParameter: false supportsES6: true diff --git a/bin/configs/unmaintained/typescript-fetch-with-interfaces.yaml b/bin/configs/unmaintained/typescript-fetch-with-interfaces.yaml index 926edb431d9..39ce0f3b5b7 100644 --- a/bin/configs/unmaintained/typescript-fetch-with-interfaces.yaml +++ b/bin/configs/unmaintained/typescript-fetch-with-interfaces.yaml @@ -1,6 +1,6 @@ generatorName: typescript-fetch outputDir: samples/client/petstore/typescript-fetch/builds/with-interfaces -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-fetch +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript-fetch additionalProperties: withInterfaces: "true" diff --git a/bin/configs/unmaintained/typescript-fetch-with-npm-version.yaml b/bin/configs/unmaintained/typescript-fetch-with-npm-version.yaml index cd669c5e0d2..8084b095b02 100644 --- a/bin/configs/unmaintained/typescript-fetch-with-npm-version.yaml +++ b/bin/configs/unmaintained/typescript-fetch-with-npm-version.yaml @@ -1,9 +1,9 @@ generatorName: typescript-fetch outputDir: samples/client/petstore/typescript-fetch/builds/with-npm-version -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-fetch +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript-fetch additionalProperties: npmVersion: 1.0.0 - npmName: '@openapitools/typescript-fetch-petstore' + npmName: '@openapijsonschematools/typescript-fetch-petstore' npmRepository: https://skimdb.npmjs.com/registry snapshot: false diff --git a/bin/configs/unmaintained/typescript-fetch-with-string-enums.yaml b/bin/configs/unmaintained/typescript-fetch-with-string-enums.yaml index 5b88cbda1a0..67d06c6e851 100644 --- a/bin/configs/unmaintained/typescript-fetch-with-string-enums.yaml +++ b/bin/configs/unmaintained/typescript-fetch-with-string-enums.yaml @@ -1,6 +1,6 @@ generatorName: typescript-fetch outputDir: samples/client/petstore/typescript-fetch/builds/with-string-enums -inputSpec: modules/openapi-generator/src/test/resources/3_0/typescript-fetch/enum.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-fetch +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/typescript-fetch/enum.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript-fetch additionalProperties: stringEnums: true diff --git a/bin/configs/unmaintained/typescript-fetch-without-runtime-checks.yaml b/bin/configs/unmaintained/typescript-fetch-without-runtime-checks.yaml index 75b9744fd34..81181c3937c 100644 --- a/bin/configs/unmaintained/typescript-fetch-without-runtime-checks.yaml +++ b/bin/configs/unmaintained/typescript-fetch-without-runtime-checks.yaml @@ -1,10 +1,10 @@ generatorName: typescript-fetch outputDir: samples/client/petstore/typescript-fetch/builds/without-runtime-checks -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-fetch +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript-fetch additionalProperties: npmVersion: 1.0.0 - npmName: '@openapitools/typescript-fetch-petstore' + npmName: '@openapijsonschematools/typescript-fetch-petstore' npmRepository: https://skimdb.npmjs.com/registry withoutRuntimeChecks: true snapshot: false diff --git a/bin/configs/unmaintained/typescript-inversify.yaml b/bin/configs/unmaintained/typescript-inversify.yaml index 5c18d8533f8..4251b94de26 100644 --- a/bin/configs/unmaintained/typescript-inversify.yaml +++ b/bin/configs/unmaintained/typescript-inversify.yaml @@ -1,4 +1,4 @@ generatorName: typescript-inversify outputDir: samples/client/petstore/typescript-inversify -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-inversify +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript-inversify diff --git a/bin/configs/unmaintained/typescript-jquery-default.yaml b/bin/configs/unmaintained/typescript-jquery-default.yaml index 088647a8adc..ca2573f8388 100644 --- a/bin/configs/unmaintained/typescript-jquery-default.yaml +++ b/bin/configs/unmaintained/typescript-jquery-default.yaml @@ -1,4 +1,4 @@ generatorName: typescript-jquery outputDir: samples/client/petstore/typescript-jquery/default -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-jquery +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript-jquery diff --git a/bin/configs/unmaintained/typescript-jquery-npm.yaml b/bin/configs/unmaintained/typescript-jquery-npm.yaml index 387da120f3f..a5d4f8e4284 100644 --- a/bin/configs/unmaintained/typescript-jquery-npm.yaml +++ b/bin/configs/unmaintained/typescript-jquery-npm.yaml @@ -1,9 +1,9 @@ generatorName: typescript-jquery outputDir: samples/client/petstore/typescript-jquery/npm -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-jquery +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript-jquery additionalProperties: npmVersion: 0.0.1 - npmName: '@openapitools/jquery-typescript-petstore' + npmName: '@openapijsonschematools/jquery-typescript-petstore' npmRepository: https://skimdb.npmjs.com/registry snapshot: false diff --git a/bin/configs/unmaintained/typescript-nestjs-v6-provided-in-root.yaml b/bin/configs/unmaintained/typescript-nestjs-v6-provided-in-root.yaml index d5ca0d52431..dd3ef920b85 100644 --- a/bin/configs/unmaintained/typescript-nestjs-v6-provided-in-root.yaml +++ b/bin/configs/unmaintained/typescript-nestjs-v6-provided-in-root.yaml @@ -1,10 +1,10 @@ generatorName: typescript-nestjs outputDir: samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-nestjs +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript-nestjs additionalProperties: nestVersion: 6.0.0 - "npmName": "@openapitools/typescript-nestjs-petstore" + "npmName": "@openapijsonschematools/typescript-nestjs-petstore" "npmVersion": "1.0.0" "npmRepository" : "https://skimdb.npmjs.com/registry" "snapshot" : false diff --git a/bin/configs/unmaintained/typescript-nestjs-v8-provided-in-root.yaml b/bin/configs/unmaintained/typescript-nestjs-v8-provided-in-root.yaml index 16a957708c6..1e790563078 100644 --- a/bin/configs/unmaintained/typescript-nestjs-v8-provided-in-root.yaml +++ b/bin/configs/unmaintained/typescript-nestjs-v8-provided-in-root.yaml @@ -1,10 +1,10 @@ generatorName: typescript-nestjs outputDir: samples/client/petstore/typescript-nestjs-v8-provided-in-root/builds/default -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-nestjs +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript-nestjs additionalProperties: nestVersion: 8.0.0 - "npmName": "@openapitools/typescript-nestjs-petstore" + "npmName": "@openapijsonschematools/typescript-nestjs-petstore" "npmVersion": "1.0.0" "npmRepository" : "https://skimdb.npmjs.com/registry" "snapshot" : false diff --git a/bin/configs/unmaintained/typescript-node-default.yaml b/bin/configs/unmaintained/typescript-node-default.yaml index bdd6eea3cb5..70e68c948ce 100644 --- a/bin/configs/unmaintained/typescript-node-default.yaml +++ b/bin/configs/unmaintained/typescript-node-default.yaml @@ -1,4 +1,4 @@ generatorName: typescript-node outputDir: samples/client/petstore/typescript-node/default -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-node +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript-node diff --git a/bin/configs/unmaintained/typescript-node-npm.yaml b/bin/configs/unmaintained/typescript-node-npm.yaml index b61450c0671..b24266543ba 100644 --- a/bin/configs/unmaintained/typescript-node-npm.yaml +++ b/bin/configs/unmaintained/typescript-node-npm.yaml @@ -1,9 +1,9 @@ generatorName: typescript-node outputDir: samples/client/petstore/typescript-node/npm -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-node +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript-node additionalProperties: npmVersion: 0.0.1 - npmName: '@openapitools/node-typescript-petstore' + npmName: '@openapijsonschematools/node-typescript-petstore' npmRepository: https://skimdb.npmjs.com/registry snapshot: false diff --git a/bin/configs/unmaintained/typescript-redux-query-default.yaml b/bin/configs/unmaintained/typescript-redux-query-default.yaml index 2cfab47ae96..f1c7fedd403 100644 --- a/bin/configs/unmaintained/typescript-redux-query-default.yaml +++ b/bin/configs/unmaintained/typescript-redux-query-default.yaml @@ -1,4 +1,4 @@ generatorName: typescript-redux-query outputDir: samples/client/petstore/typescript-redux-query/builds/default -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-redux-query +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript-redux-query diff --git a/bin/configs/unmaintained/typescript-redux-query-with-npm-version.yaml b/bin/configs/unmaintained/typescript-redux-query-with-npm-version.yaml index 1db6557857d..e0cf2cf7761 100644 --- a/bin/configs/unmaintained/typescript-redux-query-with-npm-version.yaml +++ b/bin/configs/unmaintained/typescript-redux-query-with-npm-version.yaml @@ -1,9 +1,9 @@ generatorName: typescript-redux-query outputDir: samples/client/petstore/typescript-redux-query/builds/with-npm-version -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-redux-query +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript-redux-query additionalProperties: npmVersion: 1.0.0 - npmName: '@openapitools/typescript-redux-query-petstore' + npmName: '@openapijsonschematools/typescript-redux-query-petstore' npmRepository: https://skimdb.npmjs.com/registry snapshot: false diff --git a/bin/configs/unmaintained/typescript-rxjs-default.yaml b/bin/configs/unmaintained/typescript-rxjs-default.yaml index 9c68513400d..4ba6584d082 100644 --- a/bin/configs/unmaintained/typescript-rxjs-default.yaml +++ b/bin/configs/unmaintained/typescript-rxjs-default.yaml @@ -1,4 +1,4 @@ generatorName: typescript-rxjs outputDir: samples/client/petstore/typescript-rxjs/builds/default -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-rxjs +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript-rxjs diff --git a/bin/configs/unmaintained/typescript-rxjs-es6-target.yaml b/bin/configs/unmaintained/typescript-rxjs-es6-target.yaml index 4889de95854..7cafaab3c17 100644 --- a/bin/configs/unmaintained/typescript-rxjs-es6-target.yaml +++ b/bin/configs/unmaintained/typescript-rxjs-es6-target.yaml @@ -1,10 +1,10 @@ generatorName: typescript-rxjs outputDir: samples/client/petstore/typescript-rxjs/builds/es6-target -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-rxjs +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript-rxjs additionalProperties: npmVersion: 1.0.0 supportsES6: true - npmName: '@openapitools/typescript-rxjs-petstore' + npmName: '@openapijsonschematools/typescript-rxjs-petstore' npmRepository: https://skimdb.npmjs.com/registry snapshot: false diff --git a/bin/configs/unmaintained/typescript-rxjs-with-npm-version.yaml b/bin/configs/unmaintained/typescript-rxjs-with-npm-version.yaml index 6b528e60d87..f44475e9e86 100644 --- a/bin/configs/unmaintained/typescript-rxjs-with-npm-version.yaml +++ b/bin/configs/unmaintained/typescript-rxjs-with-npm-version.yaml @@ -1,9 +1,9 @@ generatorName: typescript-rxjs outputDir: samples/client/petstore/typescript-rxjs/builds/with-npm-version -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-rxjs +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript-rxjs additionalProperties: npmVersion: 1.0.0 - npmName: '@openapitools/typescript-rxjs-petstore' + npmName: '@openapijsonschematools/typescript-rxjs-petstore' npmRepository: https://skimdb.npmjs.com/registry snapshot: false diff --git a/bin/configs/unmaintained/typescript-rxjs-with-progress-subscriber.yaml b/bin/configs/unmaintained/typescript-rxjs-with-progress-subscriber.yaml index b33f917ca44..5e5d3f844c5 100644 --- a/bin/configs/unmaintained/typescript-rxjs-with-progress-subscriber.yaml +++ b/bin/configs/unmaintained/typescript-rxjs-with-progress-subscriber.yaml @@ -1,6 +1,6 @@ generatorName: typescript-rxjs outputDir: samples/client/petstore/typescript-rxjs/builds/with-progress-subscriber -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-rxjs +inputSpec: modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/typescript-rxjs additionalProperties: withProgressSubscriber: "true" diff --git a/bin/configs/unmaintained/wsdl-schema.yaml b/bin/configs/unmaintained/wsdl-schema.yaml index 29484b39dfe..1179c00b2ee 100644 --- a/bin/configs/unmaintained/wsdl-schema.yaml +++ b/bin/configs/unmaintained/wsdl-schema.yaml @@ -1,6 +1,6 @@ generatorName: wsdl-schema outputDir: samples/schema/petstore/wsdl-schema -inputSpec: modules/openapi-generator/src/test/resources/3_0/wsdl/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/wsdl-schema +inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/wsdl/petstore.yaml +templateDir: modules/openapi-json-schema-generator/src/main/resources/wsdl-schema additionalProperties: hideGenerationTimestamp: "true" diff --git a/bin/meta-codegen-kotlin.sh b/bin/meta-codegen-kotlin.sh index 905334f5f9f..55a487fabec 100755 --- a/bin/meta-codegen-kotlin.sh +++ b/bin/meta-codegen-kotlin.sh @@ -35,6 +35,6 @@ fi cd "${root}"/samples/meta-codegen-kotlin/lib && \ ./gradlew --no-daemon shadowJar) -ags2="generate -g myClientCodegen -i modules/openapi-generator/src/test/resources/2_0/petstore.json -o samples/meta-codegen-kotlin/usage $@" +ags2="generate -g myClientCodegen -i modules/openapi-json-schema-generator/src/test/resources/2_0/petstore.json -o samples/meta-codegen-kotlin/usage $@" -java $JAVA_OPTS -cp ${root}/samples/meta-codegen-kotlin/lib/build/libs/my-client-codegen-openapi-generator-1.0-SNAPSHOT-all.jar:$executable org.openapitools.codegen.OpenAPIGenerator $ags2 \ No newline at end of file +java $JAVA_OPTS -cp ${root}/samples/meta-codegen-kotlin/lib/build/libs/my-client-codegen-openapi-generator-1.0-SNAPSHOT-all.jar:$executable org.openapijsonschematools.codegen.OpenAPIGenerator $ags2 \ No newline at end of file diff --git a/bin/meta-codegen.sh b/bin/meta-codegen.sh index 84aab1ce6fe..80e86041ba3 100755 --- a/bin/meta-codegen.sh +++ b/bin/meta-codegen.sh @@ -24,4 +24,4 @@ java $JAVA_OPTS -jar $executable $ags ags2="generate -g myClientCodegen -i modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.json -o samples/meta-codegen/usage $@" -java $JAVA_OPTS -cp ${root}/samples/meta-codegen/lib/target/myClientCodegen-openapi-generator-1.0.0.jar:$executable org.openapitools.codegen.OpenAPIGenerator $ags2 +java $JAVA_OPTS -cp ${root}/samples/meta-codegen/lib/target/myClientCodegen-openapi-generator-1.0.0.jar:$executable org.openapijsonschematools.codegen.OpenAPIGenerator $ags2 diff --git a/bin/tests/test-debug-supporting-files.sh b/bin/tests/test-debug-supporting-files.sh index cd130225b4a..7cc5028c7e4 100755 --- a/bin/tests/test-debug-supporting-files.sh +++ b/bin/tests/test-debug-supporting-files.sh @@ -27,7 +27,7 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties -DdebugSupportingFiles=true" -ags="generate -t modules/openapi-generator/src/main/resources/python -i modules/openapi-generator/src/test/resources/3_0/issue_241.yaml -g python -o /tmp/test-debug-supporting-files/ --additional-properties packageName=petstore_api $@" +ags="generate -t modules/openapi-json-schema-generator/src/main/resources/python -i modules/openapi-json-schema-generator/src/test/resources/3_0/issue_241.yaml -g python -o /tmp/test-debug-supporting-files/ --additional-properties packageName=petstore_api $@" if [[ $(java $JAVA_OPTS -jar $executable $ags 2>&1 | grep "StackOverflowError") ]]; then echo "There are StackOverflowError. Please check the result." diff --git a/bin/utils/detect_carriage_return.sh b/bin/utils/detect_carriage_return.sh index d3281f58468..7548ac7ef9d 100755 --- a/bin/utils/detect_carriage_return.sh +++ b/bin/utils/detect_carriage_return.sh @@ -1,7 +1,7 @@ #!/bin/bash # grep for \r in the templates -grep -RUIl $'\r$' modules/openapi-generator/src/main/resources/* +grep -RUIl $'\r$' modules/openapi-json-schema-generator/src/main/resources/* if [ $? -ne 1 ]; then echo "Templates contain carriage return '/r'. Please remove it and try again." @@ -10,7 +10,7 @@ fi # grep for \r in the generators -grep -RUIl $'\r$' modules/openapi-generator/src/main/java/org/openapitools/codegen/*.java +grep -RUIl $'\r$' modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/*.java if [ $? -ne 1 ]; then echo "Generators contain carriage return '/r'. Please remove it and try again." diff --git a/bin/utils/detect_merge_conflict.sh b/bin/utils/detect_merge_conflict.sh index 84e4d3c42d4..c40b64ae1cf 100755 --- a/bin/utils/detect_merge_conflict.sh +++ b/bin/utils/detect_merge_conflict.sh @@ -1,10 +1,10 @@ #!/bin/bash # grep for '<<<<<<< HEAD' in openapi-generator -grep -RUIl '<<<<<<< HEAD' modules/openapi-generator/src +grep -RUIl '<<<<<<< HEAD' modules/openapi-json-schema-generator/src if [ $? -ne 1 ]; then - echo "modules/openapi-generator/src contain merge conflicts '<<<<<<< HEAD'. Please remove it and try again." + echo "modules/openapi-json-schema-generator/src contain merge conflicts '<<<<<<< HEAD'. Please remove it and try again." exit 1; fi diff --git a/bin/utils/detect_tab_in_templates.sh b/bin/utils/detect_tab_in_templates.sh index e3ac60b104d..5499e089c31 100755 --- a/bin/utils/detect_tab_in_templates.sh +++ b/bin/utils/detect_tab_in_templates.sh @@ -4,13 +4,13 @@ # as these tabs should be replaced with 4-space instead ## declare an array of folders -declare -a samples=("modules/openapi-generator/src/main/resources/kotlin-server" - "modules/openapi-generator/src/main/resources/kotlin-spring" - "modules/openapi-generator/src/main/resources/dart-dio" - "modules/openapi-generator/src/main/resources/dart" - "modules/openapi-generator/src/main/resources/dart2" - "modules/openapi-generator/src/main/resources/aspnetcore" - "modules/openapi-generator/src/main/resources/powershell" +declare -a samples=("modules/openapi-json-schema-generator/src/main/resources/kotlin-server" + "modules/openapi-json-schema-generator/src/main/resources/kotlin-spring" + "modules/openapi-json-schema-generator/src/main/resources/dart-dio" + "modules/openapi-json-schema-generator/src/main/resources/dart" + "modules/openapi-json-schema-generator/src/main/resources/dart2" + "modules/openapi-json-schema-generator/src/main/resources/aspnetcore" + "modules/openapi-json-schema-generator/src/main/resources/powershell" ) ## now loop through the above array diff --git a/bin/utils/openapi-generator-cli.sh b/bin/utils/openapi-generator-cli.sh index ca65f20b5df..3f8d3402c6a 100644 --- a/bin/utils/openapi-generator-cli.sh +++ b/bin/utils/openapi-generator-cli.sh @@ -36,8 +36,8 @@ function latest.tag { echo $ver } -ghrepo=openapitools/openapi-generator -groupid=org.openapitools +ghrepo=openapi-json-schema-tools/openapi-json-schema-generator +groupid=org.openapijsonschematools artifactid=openapi-generator-cli ver=${OPENAPI_GENERATOR_VERSION:-$(latest.tag $ghrepo)} diff --git a/bin/utils/release/release_version_update.sh b/bin/utils/release/release_version_update.sh index 9026c07afbd..bcefcc51452 100755 --- a/bin/utils/release/release_version_update.sh +++ b/bin/utils/release/release_version_update.sh @@ -76,8 +76,7 @@ declare -a xml_files=( "${root}/modules/openapi-generator-gradle-plugin/pom.xml" "${root}/modules/openapi-generator-core/pom.xml" "${root}/modules/openapi-generator-maven-plugin/pom.xml" - "${root}/modules/openapi-generator-online/pom.xml" - "${root}/modules/openapi-generator/pom.xml" + "${root}/modules/openapi-json-schema-generator/pom.xml" "${root}/modules/openapi-generator-gradle-plugin/gradle.properties" "${root}/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties" "${root}/modules/openapi-generator-maven-plugin/examples/multi-module/java-client/pom.xml" diff --git a/bin/utils/release_checkout.rb b/bin/utils/release_checkout.rb index 83e0fd832a0..32eca3aab34 100755 --- a/bin/utils/release_checkout.rb +++ b/bin/utils/release_checkout.rb @@ -6,73 +6,10 @@ require 'open-uri' require 'net/http' -def check_sbt_openapi_generator - print "Checking sbt-openapi-generator... " - - url = "https://raw.githubusercontent.com/OpenAPITools/sbt-openapi-generator/master/build.sbt" - open(url) do |f| - content = f.read - if !content.nil? && content.include?($version) - puts "[OK]" - else - puts "[ERROR]" - puts "> #{url} not yet updated with #{$version}" - end - end -end - -def check_npmjs - print "Checking npmjs... " - - url = "https://www.npmjs.com/package/@openapitools/openapi-generator-cli?activeTab=versions" - open(url) do |f| - content = f.read - if !content.nil? && content.include?($version) - puts "[OK]" - else - puts "[ERROR]" - puts "> #{url} not yet updated with #{$version}" - end - end -end - -def check_homebrew - print "Checking homebrew formula ... " - - url = "https://raw.githubusercontent.com/Homebrew/homebrew-core/master/Formula/openapi-generator.rb" - new_maven_url = "https://search.maven.org/remotecontent?filepath=org/openapitools/openapi-generator-cli/#{$version}/openapi-generator-cli-#{$version}.jar" - open(url) do |f| - content = f.read - if !content.nil? && content.include?(new_maven_url) - puts "[OK]" - else - puts "[ERROR]" - puts "> #{url} not yet updated with #{new_maven_url}" - end - end -end - -def check_openapi_generator_online_docker - print "Checking openapi-generator-online docker ... " - - url = "https://hub.docker.com/v2/repositories/openapitools/openapi-generator-online/tags/?page_size=25&page=1" - - docker_tag = "v#{$version}" - open(url) do |f| - content = f.read - if !content.nil? && content.include?(docker_tag) - puts "[OK]" - else - puts "[ERROR]" - puts "> #{url} does not have tag #{docker_tag}" - end - end -end - def check_openapi_generator_cli_docker print "Checking openapi-generator-cli docker ... " - url = "https://hub.docker.com/v2/repositories/openapitools/openapi-generator-cli/tags/?page_size=25&page=1" + url = "https://hub.docker.com/v2/repositories/openapi-json-schema-tools/openapi-json-schema-generator-cli/tags/?page_size=25&page=1" docker_tag = "v#{$version}" open(url) do |f| content = f.read @@ -85,112 +22,6 @@ def check_openapi_generator_cli_docker end end -def check_readme - print "Checking openapi-generator README.md ... " - - url = "https://raw.githubusercontent.com/OpenAPITools/openapi-generator/master/README.md" - matches = ["[#{$version}](https://github.com/OpenAPITools/openapi-generator/releases/tag/v#{$version})", - "JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/#{$version}/openapi-generator-cli-#{$version}.jar`", - "wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/#{$version}/openapi-generator-cli-#{$version}.jar -O openapi-generator-cli.jar", - "Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/#{$version}/openapi-generator-cli-#{$version}.jar"] - open(url) do |f| - content = f.read - has_outdated = false - not_matched = [] - matches.each do |match| - if !content.nil? && content.include?(match) - # matched - else - has_outdated = true - not_matched << match - end - end - - if has_outdated - puts "[ERROR]" - not_matched.each do |str| - puts "> '#{str}' not found in README.md" - end - else - puts "[OK]" - end - end -end - -def check_openapi_generator_jar - print "Checking openapi-generator JAR ... " - url = "https://repo1.maven.org/maven2/org/openapitools/openapi-generator/#{$version}/openapi-generator-#{$version}.jar" - - if check_url(url) - puts "[OK]" - else - puts "[ERROR]" - puts "> #{url} not found" - end - -end - - -def check_openapi_generator_cli_jar - print "Checking openapi-generator-cli JAR ... " - url = "https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/#{$version}/openapi-generator-cli-#{$version}.jar" - - if check_url(url) - puts "[OK]" - else - puts "[ERROR]" - puts "> #{url} not found" - end -end - -def check_openapi_generator_maven_plugin_jar - print "Checking openapi-generator-maven-plugin JAR ... " - url = "https://repo1.maven.org/maven2/org/openapitools/openapi-generator-maven-plugin/#{$version}/openapi-generator-maven-plugin-#{$version}.jar" - - if check_url(url) - puts "[OK]" - else - puts "[ERROR]" - puts "> #{url} not found" - end -end - -def check_openapi_generator_gradle_plugin_jar - print "Checking openapi-generator-gradle-plugin JAR ... " - url = "https://repo1.maven.org/maven2/org/openapitools/openapi-generator-gradle-plugin/#{$version}/openapi-generator-gradle-plugin-#{$version}.jar" - - if check_url(url) - puts "[OK]" - else - puts "[ERROR]" - puts "> #{url} not found" - end -end - -def check_openapi_generator_online_jar - print "Checking openapi-generator-online JAR ... " - url = "https://repo1.maven.org/maven2/org/openapitools/openapi-generator-online/#{$version}/openapi-generator-online-#{$version}.jar" - - if check_url(url) - puts "[OK]" - else - puts "[ERROR]" - puts "> #{url} not found" - end -end - -def check_openapi_generator_project_pom - print "Checking openapi-generator-project pom.xml ... " - url = "https://repo1.maven.org/maven2/org/openapitools/openapi-generator-project/#{$version}/openapi-generator-project-#{$version}.pom" - - if check_url(url) - puts "[OK]" - else - puts "[ERROR]" - puts "> #{url} not found" - end -end - def check_url url content = Net::HTTP.get(URI.parse(url)) url = URI.parse(url) @@ -219,15 +50,4 @@ def usage puts "Running checkout on OpenAPI Generator release #{$version}" -check_sbt_openapi_generator -check_openapi_generator_online_docker check_openapi_generator_cli_docker -check_npmjs -check_homebrew -check_openapi_generator_jar -check_openapi_generator_cli_jar -check_openapi_generator_maven_plugin_jar -check_openapi_generator_gradle_plugin_jar -check_openapi_generator_online_jar -check_openapi_generator_project_pom -check_readme diff --git a/bin/utils/test-fake-petstore-for-all.sh b/bin/utils/test-fake-petstore-for-all.sh index 1ec62890c3b..0a3bc219478 100755 --- a/bin/utils/test-fake-petstore-for-all.sh +++ b/bin/utils/test-fake-petstore-for-all.sh @@ -12,21 +12,21 @@ logfile="/tmp/generator-fake-petstore-output.log" for GENERATOR in $(java -jar ${executable} list --short | sed -e 's/,/\'$'\n''/g') do # no longer test 2.0 spec as we migrated to 3.0 spec - #if eval java -jar ${executable} generate -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g ${GENERATOR} -o /tmp/openapi-generator-test-fake-petstore/2.0/${GENERATOR} > ${logfile} 2>&1; then + #if eval java -jar ${executable} generate -i modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g ${GENERATOR} -o /tmp/openapi-generator-test-fake-petstore/2.0/${GENERATOR} > ${logfile} 2>&1; then # echo "[OAS 2.0] Executed ${GENERATOR} successfully!" #else # echo "ERROR: Failed to run '${GENERATOR}' generator. The command was:" - # echo "java -jar ${executable} generate -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g ${GENERATOR} -o /tmp/openapi-generator-test-fake-petstore/2.0/${GENERATOR}" + # echo "java -jar ${executable} generate -i modules/openapi-json-schema-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g ${GENERATOR} -o /tmp/openapi-generator-test-fake-petstore/2.0/${GENERATOR}" # echo "ERROR: The output of the command was:" # cat ${logfile} # exit 1 #fi - if eval java -jar ${executable} generate -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g ${GENERATOR} -o /tmp/openapi-generator-test-fake-petstore/3.0/${GENERATOR} > ${logfile} 2>&1; then + if eval java -jar ${executable} generate -i modules/openapi-json-schema-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g ${GENERATOR} -o /tmp/openapi-generator-test-fake-petstore/3.0/${GENERATOR} > ${logfile} 2>&1; then echo "[OAS 3.0] Executed ${GENERATOR} successfully!" else echo "ERROR: Failed to run '${GENERATOR}' generator. The command was:" - echo "java -jar ${executable} generate -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g ${GENERATOR} -o /tmp/openapi-generator-test-fake-petstore/3.0/${GENERATOR}" + echo "java -jar ${executable} generate -i modules/openapi-json-schema-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g ${GENERATOR} -o /tmp/openapi-generator-test-fake-petstore/3.0/${GENERATOR}" echo "ERROR: The output of the command was:" cat ${logfile} exit 1 diff --git a/docs/building.md b/docs/building.md index 9e91349812c..e8ae653b571 100644 --- a/docs/building.md +++ b/docs/building.md @@ -31,7 +31,7 @@ in the docker container. It also maps `~/.m2/repository` to the appropriate cont To execute `mvn package`: ```bash -git clone https://github.com/openapitools/openapi-generator +git clone https://github.com/openapi-json-schema-tools/openapi-json-schema-generator cd openapi-generator ./run-in-docker.sh mvn package ``` @@ -53,7 +53,7 @@ Once built, `run-in-docker.sh` will act as an executable for openapi-generator-c Prerequisite: install [Vagrant](https://www.vagrantup.com/downloads.html) and [VirtualBox](https://www.virtualbox.org/wiki/Downloads). ```bash -git clone https://github.com/openapitools/openapi-generator.git +git clone https://github.com/openapi-json-schema-tools/openapi-json-schema-generator.git cd openapi-generator vagrant up vagrant ssh diff --git a/docs/conduct.md b/docs/conduct.md index dfaf2b72b7d..d2fcc83749e 100644 --- a/docs/conduct.md +++ b/docs/conduct.md @@ -37,7 +37,7 @@ This Code of Conduct applies both within project spaces and in public spaces whe ## Enforcement -Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at team@openapitools.org. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at team@openapijsonschematools.org. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. diff --git a/docs/contributing.md b/docs/contributing.md index d7ed41b04d9..660902e2f78 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -6,16 +6,16 @@ sidebar_label: Guidelines ## Before submitting an issue - - If you're not using the latest master to generate API clients or server stubs, please give it another try by pulling the latest master as the issue may have already been addressed. Ref: [Getting Started](https://github.com/openapitools/openapi-generator#getting-started) - - Search the [open issue](https://github.com/openapitools/openapi-generator/issues) and [closed issue](https://github.com/openapitools/openapi-generator/issues?q=is%3Aissue+is%3Aclosed) to ensure no one else has reported something similar before. - - File an [issue ticket](https://github.com/openapitools/openapi-generator/issues/new) by providing all the required information. Failure to provide enough detail may result in slow response from the community. + - If you're not using the latest master to generate API clients or server stubs, please give it another try by pulling the latest master as the issue may have already been addressed. Ref: [Getting Started](https://github.com/openapi-json-schema-tools/openapi-json-schema-generator#getting-started) + - Search the [open issue](https://github.com/openapi-json-schema-tools/openapi-json-schema-generator/issues) and [closed issue](https://github.com/openapi-json-schema-tools/openapi-json-schema-generator/issues?q=is%3Aissue+is%3Aclosed) to ensure no one else has reported something similar before. + - File an [issue ticket](https://github.com/openapi-json-schema-tools/openapi-json-schema-generator/issues/new) by providing all the required information. Failure to provide enough detail may result in slow response from the community. - Test with the latest master by building the JAR locally to see if the issue has already been addressed. - You can also make a suggestion or ask a question by opening an "issue". ## Before submitting a PR - - Search the [open issue](https://github.com/openapitools/openapi-generator/issues) to ensure no one else has reported something similar and no one is actively working on similar proposed change. - - If no one has suggested something similar, open an ["issue"](https://github.com/openapitools/openapi-generator/issues) with your suggestion to gather feedback from the community. + - Search the [open issue](https://github.com/openapi-json-schema-tools/openapi-json-schema-generator/issues) to ensure no one else has reported something similar and no one is actively working on similar proposed change. + - If no one has suggested something similar, open an ["issue"](https://github.com/openapi-json-schema-tools/openapi-json-schema-generator/issues) with your suggestion to gather feedback from the community. - If you're adding a new option to a generator, please consider using the `-t` option with customized templates instead or start a discussion first by opening an issue as we want to avoid adding too many options to the generator. - It's recommended to **create a new git branch** for the change so that the merge commit message looks nicer in the commit history. @@ -25,7 +25,7 @@ sidebar_label: Guidelines If you're new to git, you may find the following FAQs useful: -https://github.com/openapitools/openapi-generator/wiki/FAQ#git +https://github.com/openapi-json-schema-tools/openapi-json-schema-generator/wiki/FAQ#git ### Branches @@ -33,15 +33,15 @@ Please file the pull request against the correct branch, e.g. `master` for non-b ### Code generators -All the code generators can be found in [modules/openapi-generator/src/main/java/org/openapitools/codegen/languages](https://github.com/openapitools/openapi-generator/tree/master/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages) +All the code generators can be found in [modules/openapi-generator/src/main/java/org/openapijsonschematools/codegen/languages](https://github.com/openapi-json-schema-tools/openapi-json-schema-generator/tree/master/modules/openapi-generator/src/main/java/org/openapijsonschematools/codegen/languages) If you want to add a new generator, follow the [new-generator](https://openapi-generator.tech/docs/new-generator) guide. ### Templates -All the templates ([mustache](https://mustache.github.io/)) can be found in [modules/openapi-generator/src/main/resources](https://github.com/openapitools/openapi-generator/tree/master/modules/openapi-generator/src/main/resources). +All the templates ([mustache](https://mustache.github.io/)) can be found in [modules/openapi-generator/src/main/resources](https://github.com/openapi-json-schema-tools/openapi-json-schema-generator/tree/master/modules/openapi-generator/src/main/resources). -For a list of variables available in the template, please refer to this [page](https://github.com/openapitools/openapi-generator/wiki/Mustache-Template-Variables) +For a list of variables available in the template, please refer to this [page](https://github.com/openapi-json-schema-tools/openapi-json-schema-generator/wiki/Mustache-Template-Variables) ### Style guide @@ -84,15 +84,15 @@ You may find the current code base not 100% conform to the coding style and we w For [Vendor Extensions](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#vendorExtensions), please follow the naming convention below: - For general vendor extension, use lower case and hyphen. e.g. `x-is-unique`, `x-content-type` - For language-specified vendor extension, put it in the form of `x-{lang}-{extension-name}`. e.g. `x-objc-operation-id`, `x-java-feign-retry-limit` -- For a list of existing vendor extensions in use, please refer to https://github.com/openapitools/openapi-generator/wiki/Vendor-Extensions. If you've added new vendor extensions as part of your PR, please update the wiki page. +- For a list of existing vendor extensions in use, please refer to https://github.com/openapi-json-schema-tools/openapi-json-schema-generator/wiki/Vendor-Extensions. If you've added new vendor extensions as part of your PR, please update the wiki page. ### Testing -To add test cases (optional) covering the change in the code generator, please refer to [modules/openapi-generator/src/test/java/org/openapitools/codegen](https://github.com/openapitools/openapi-generator/tree/master/modules/openapi-generator/src/test/java/org/openapitools/codegen) +To add test cases (optional) covering the change in the code generator, please refer to [modules/openapi-generator/src/test/java/org/openapijsonschematools/codegen](https://github.com/openapi-json-schema-tools/openapi-json-schema-generator/tree/master/modules/openapi-generator/src/test/java/org/openapijsonschematools/codegen) To test the templates, please perform the following: -- Update the Petstore sample by running the shell scripts under the `bin` folder. For example, run `./bin/generate-samples.sh ./bin/configs/python*` to update the Python-related samples under [`samples`](https://github.com/openapitools/openapi-generator/tree/master/samples). For Windows, please install [GIT bash](https://gitforwindows.org/). (If you find that there are new files generated or unexpected changes as a result of the update, that's not unusual as the test cases are added to the OpenAPI spec from time to time. If you've questions or concerns, please open a ticket to start a discussion) +- Update the Petstore sample by running the shell scripts under the `bin` folder. For example, run `./bin/generate-samples.sh ./bin/configs/python*` to update the Python-related samples under [`samples`](https://github.com/openapi-json-schema-tools/openapi-json-schema-generator/tree/master/samples). For Windows, please install [GIT bash](https://gitforwindows.org/). (If you find that there are new files generated or unexpected changes as a result of the update, that's not unusual as the test cases are added to the OpenAPI spec from time to time. If you've questions or concerns, please open a ticket to start a discussion) - During development, it can be helpful to quickly regenerate the samples without recompiling all of openapi-generator, e.g. when you have only updated the mustache templates. This can be done by passing the `-t` parameter: `-t modules/openapi-generator/src/main/resources/python`. - Run the tests in the sample folder using maven `mvn integration-test -f /path/to/pom.xml`, e.g. `mvn integration-test -f samples/client/petstore/python/pom.xml`. (some languages may not contain unit testing for Petstore and we're looking for contribution from the community to implement those tests). __Please notice:__ you must run a local instance of the Petstore server in order to perform the tests, as running them against petstore.swagger.io is not supported anymore. Please refer to item 3 of [Integration Tests - How to add integration tests for new Petstore samples](https://github.com/OpenAPITools/openapi-generator/wiki/Integration-Tests#how-to-add-integration-tests-for-new-petstore-samples) to learn how to quickly configure and run it. - Finally, git commit the updated samples files: `git commit -a` (`git add -A` if added files with new test cases) diff --git a/docs/customization.md b/docs/customization.md index 39d45c3834e..3401930dd38 100644 --- a/docs/customization.md +++ b/docs/customization.md @@ -99,28 +99,28 @@ If you are running a Windows Subsystem for Linux or a shell such as gitbash, and Now, execute the generator: ```sh -java -cp out/generators/my-codegen/target/my-codegen-openapi-generator-1.0.0.jar:modules/openapi-generator-cli/target/openapi-generator-cli.jar org.openapitools.codegen.OpenAPIGenerator +java -cp out/generators/my-codegen/target/my-codegen-openapi-generator-1.0.0.jar:modules/openapi-generator-cli/target/openapi-generator-cli.jar OpenAPIGenerator ``` For Windows users, you will need to use `;` instead of `:` in the classpath, e.g. ``` -java -cp "out/generators/my-codegen/target/my-codegen-openapi-generator-1.0.0.jar;modules/openapi-generator-cli/target/openapi-generator-cli.jar" org.openapitools.codegen.OpenAPIGenerator +java -cp "out/generators/my-codegen/target/my-codegen-openapi-generator-1.0.0.jar;modules/openapi-generator-cli/target/openapi-generator-cli.jar" OpenAPIGenerator ``` Note the `my-codegen` is an option for `-g` now, and you can use the usual arguments for generating your code: ```sh java -cp out/generators/my-codegen/target/my-codegen-openapi-generator-1.0.0.jar:modules/openapi-generator-cli/target/openapi-generator-cli.jar \ - org.openapitools.codegen.OpenAPIGenerator generate -g my-codegen \ - -i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml \ + OpenAPIGenerator generate -g my-codegen \ + -i https://raw.githubusercontent.com/openapi-json-schema-tools/openapi-json-schema-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml \ -o ./out/myClient ``` For Windows users: ``` java -cp "out/codegens/customCodegen/target/my-codegen-openapi-generator-1.0.0.jar;modules/openapi-generator-cli/target/openapi-generator-cli.jar" \ - org.openapitools.codegen.OpenAPIGenerator generate -g my-codegen \ - -i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml \ + OpenAPIGenerator generate -g my-codegen \ + -i https://raw.githubusercontent.com/openapi-json-schema-tools/openapi-json-schema-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml \ -o ./out/myClient ``` @@ -132,13 +132,13 @@ Install your library to your local maven repository by running: mvn clean install -f out/generators/my-codegen ``` -This will install `org.openapitools:my-codegen-openapi-generator:1.0.0` to your local maven repository. +This will install `org.openapijsonschematools:my-codegen-openapi-generator:1.0.0` to your local maven repository. You can use this as additional dependency of the `openapi-generator-maven-plugin` plugin and use `my-codegen` as `generatorName` value: ```xml - org.openapitools + org.openapijsonschematools openapi-generator-maven-plugin ${openapi-generator-version} @@ -155,7 +155,7 @@ You can use this as additional dependency of the `openapi-generator-maven-plugin - org.openapitools + org.openapijsonschematools my-codegen-openapi-generator 1.0.0 @@ -271,7 +271,7 @@ Editor support for `.openapi-generator-ignore` files is available in IntelliJ vi There are different aspects of customizing the code generator beyond just creating or modifying templates. Each language has a supporting configuration file to handle different type mappings, etc: ```sh -$ ls -1 modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ +$ ls -1 modules/openapi-generator/src/main/java/org/openapijsonschematools/codegen/languages/ AbstractJavaJAXRSServerCodegen.java AbstractTypeScriptClientCodegen.java ... (results omitted) @@ -283,7 +283,7 @@ Each of these files creates reasonable defaults so you can get running quickly. ```sh java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate \ - -i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml \ + -i https://raw.githubusercontent.com/openapi-json-schema-tools/openapi-json-schema-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml \ -g java \ -o samples/client/petstore/java \ -c path/to/config.json @@ -300,7 +300,7 @@ apiPackage: "petstore" ``` Supported config options can be different per language. Running `config-help -g {lang}` will show available options. -**These options are applied via configuration file (e.g. config.json or config.yml) or by passing them with `-p {optionName}={optionValue}`**. (If `-p {optionName}` does not work, please open a [ticket](https://github.com/openapitools/openapi-generator/issues/new) and we'll look into it) +**These options are applied via configuration file (e.g. config.json or config.yml) or by passing them with `-p {optionName}={optionValue}`**. (If `-p {optionName}` does not work, please open a [ticket](https://github.com/openapi-json-schema-tools/openapi-json-schema-generator/issues/new) and we'll look into it) ```sh java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar config-help -g java @@ -354,9 +354,7 @@ Another way to override default options is to extend the config class for the sp To change, for example, the prefix for the Objective-C generated files, simply subclass the `ObjcClientCodegen.java`: ```java -package com.mycompany.openapitools.codegen; - -import org.openapitools.codegen.languages.*; +package com.mycompany.openapijsonschematools.codegen; public class MyObjcCodegen extends ObjcClientCodegen { static { @@ -368,7 +366,7 @@ public class MyObjcCodegen extends ObjcClientCodegen { and specify the `classname` when running the generator: ``` --g com.mycompany.openapitools.codegen.MyObjcCodegen +-g com.mycompany.openapijsonschematools.codegen.MyObjcCodegen ``` Your subclass will now be loaded and overrides the `PREFIX` value in the superclass. diff --git a/docs/debugging.md b/docs/debugging.md index bdf7e992c6e..5ab496788ac 100644 --- a/docs/debugging.md +++ b/docs/debugging.md @@ -216,7 +216,7 @@ openapi-generator generate -g go ... ... ... -[main] DEBUG o.o.codegen.DefaultCodegen - debugging fromProperty for files : class Schema { +[main] DEBUG o.o.codegen.DefaultCodegen - debugging fromSchema for files : class Schema { type: null format: null $ref: #/components/schemas/File diff --git a/docs/faq-contributing.md b/docs/faq-contributing.md index 704758bb443..c200eb497eb 100644 --- a/docs/faq-contributing.md +++ b/docs/faq-contributing.md @@ -29,7 +29,7 @@ Then add the following to your local [hosts](https://en.wikipedia.org/wiki/Hosts ## Who should I report a security vulnerability to? -Please contact team@openapitools.org with the details and we'll follow up with you. +Please contact team@openapijsonschematools.org with the details and we'll follow up with you. ## How can I rebase my PR on the latest master? @@ -43,7 +43,7 @@ Please refer to http://rypress.com/tutorials/git/rebasing, or follow the steps b 5. Resolve merge conflicts, if any, and run "git commit -a" 6. Rebase done (you may need to add --force when doing `git push`) -(To setup `upstream` pointing to the official repo, please run `git remote add upstream https://github.com/openapitools/openapi-generator.git`) +(To setup `upstream` pointing to the official repo, please run `git remote add upstream https://github.com/openapi-json-schema-tools/openapi-json-schema-generator.git`) ## How can I update commits that are not linked to my GitHub account? @@ -55,7 +55,7 @@ Yes, http://www.alexkras.com/19-git-tips-for-everyday-use/ ## How can I submit a PR to fix bugs or make enhancements? -Visit https://github.com/openapitools/openapi-generator and then click on the "Fork" button in the upper right corner. Then in your local machine, run the following (assuming your github ID is "your_user_id") +Visit https://github.com/openapi-json-schema-tools/openapi-json-schema-generator and then click on the "Fork" button in the upper right corner. Then in your local machine, run the following (assuming your github ID is "your_user_id") 1) git clone https://github.com/your_user_id/openapi-generator.git 2) cd openapi-generator @@ -63,4 +63,4 @@ Visit https://github.com/openapitools/openapi-generator and then click on the "F 4) make changes 5) git commit -a (you may need to use `git add filename` to add new files) 6) git push origin fix_issue9999 -7) Visit https://github.com/openapitools/openapi-generator in your browser and click on the button to file a new PR based on fix_issue9999 +7) Visit https://github.com/openapi-json-schema-tools/openapi-json-schema-generator in your browser and click on the button to file a new PR based on fix_issue9999 diff --git a/docs/faq-generators.md b/docs/faq-generators.md index 370130dbe11..8a001bf6cb6 100644 --- a/docs/faq-generators.md +++ b/docs/faq-generators.md @@ -75,7 +75,7 @@ The warning has no impact on the build process so you should be able to build th Here are the steps: ``` -git clone https://github.com/openapitools/openapi-generator.git +git clone https://github.com/openapi-json-schema-tools/openapi-json-schema-generator.git cd openapi-generator/samples/client/petstore/objc/default/OpenAPIClientTests mvn integration-test ``` @@ -88,13 +88,13 @@ Besides `default` (folder) ObjC API client, there's also `core-data` for another Here are the steps: ``` -git clone https://github.com/openapitools/openapi-generator.git +git clone https://github.com/openapi-json-schema-tools/openapi-json-schema-generator.git cd openapi-generator/samples/client/petstore/swift/default/OpenAPIClientTests mvn integration-test ``` Besides `default` (folder), there's another folder `promisekit` for Swift API client with [PromiseKit support](https://github.com/mxcl/PromiseKit) ``` -git clone https://github.com/openapitools/openapi-generator.git +git clone https://github.com/openapi-json-schema-tools/openapi-json-schema-generator.git cd openapi-generator/samples/client/petstore/swift/promisekit/OpenAPIClientTests mvn integration-test ``` diff --git a/docs/file-post-processing.md b/docs/file-post-processing.md index a23845adae2..cc63b5c7c41 100644 --- a/docs/file-post-processing.md +++ b/docs/file-post-processing.md @@ -48,7 +48,7 @@ Let's see how to pass Ruby generated files to Rubocop, a static code analysis/li # First, export the required environment variable export RUBY_POST_PROCESS_FILE="/usr/local/bin/rubocop -a" -export OPENAPI_DOC="https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml" +export OPENAPI_DOC="https://raw.githubusercontent.com/openapi-json-schema-tools/openapi-json-schema-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml" # Invoke the generator with --enable-post-process-file openapi-generator generate --enable-post-process-file -i $OPENAPI_DOC -g ruby -o .out-ruby/ diff --git a/docs/generators/java.md b/docs/generators/java.md index d755225ec40..f9fada54409 100644 --- a/docs/generators/java.md +++ b/docs/generators/java.md @@ -21,10 +21,10 @@ These options may be applied as additional-properties (cli) or configOptions (pl |additionalEnumTypeAnnotations|Additional annotations for enum type(class level annotations)| |null| |additionalModelTypeAnnotations|Additional annotations for model type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)| |null| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|apiPackage|package for generated api classes| |org.openapitools.client.api| +|apiPackage|package for generated api classes| |org.openapijsonschematools.client.api| |artifactDescription|artifact description in generated pom.xml| |OpenAPI Java| |artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-java-client| -|artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| +|artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapi-json-schema-tools/openapi-json-schema-generator| |artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| |asyncNative|If true, async handlers will be used, instead of the sync version| |false| |bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| @@ -32,10 +32,10 @@ These options may be applied as additional-properties (cli) or configOptions (pl |caseInsensitiveResponseHeaders|Make API response's headers case-insensitive. Available on okhttp-gson, jersey2 libraries| |false| |configKey|Config key in @RegisterRestClient. Default to none. Only `microprofile` supports this option.| |null| |dateLibrary|Option. Date library to use|
**joda**
Joda (for legacy app only)
**legacy**
Legacy java.util.Date
**java8-localdatetime**
Java 8 using LocalDateTime (for legacy app only)
**java8**
Java 8 native JSR310 (preferred for jdk 1.8+)
|java8| -|developerEmail|developer email in generated pom.xml| |team@openapitools.org| +|developerEmail|developer email in generated pom.xml| |team@openapijsonschematools.org| |developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| |developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org| -|developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org| +|developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapijsonschematools.org| |disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
|true| |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| @@ -45,19 +45,19 @@ These options may be applied as additional-properties (cli) or configOptions (pl |errorObjectType|Error Object type. (This option is for okhttp-gson-next-gen only)| |null| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| |gradleProperties|Append additional Gradle properties to the gradle.properties file| |null| -|groupId|groupId in generated pom.xml| |org.openapitools| +|groupId|groupId in generated pom.xml| |org.openapijsonschematools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| |ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| |implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false| |implicitHeadersRegex|Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true| |null| -|invokerPackage|root package for generated code| |org.openapitools.client| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| +|invokerPackage|root package for generated code| |org.openapijsonschematools.client| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
**true**
The mapping in the discriminator includes descendant schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendant schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| |library|library template (sub-template) to use|
**jersey1**
HTTP client: Jersey client 1.19.x. JSON processing: Jackson 2.9.x. Enable gzip request encoding using '-DuseGzipFeature=true'. IMPORTANT NOTE: jersey 1.x is no longer actively maintained so please upgrade to 'jersey3' or other HTTP libraries instead.
**jersey2**
HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.9.x
**jersey3**
HTTP client: Jersey client 3.x. JSON processing: Jackson 2.x
**feign**
HTTP client: OpenFeign 10.x. JSON processing: Jackson 2.9.x.
**okhttp-gson**
[DEFAULT] HTTP client: OkHttp 3.x. JSON processing: Gson 2.8.x. Enable Parcelable models on Android using '-DparcelableModel=true'. Enable gzip request encoding using '-DuseGzipFeature=true'.
**retrofit2**
HTTP client: OkHttp 3.x. JSON processing: Gson 2.x (Retrofit 2.3.0). Enable the RxJava adapter using '-DuseRxJava[2/3]=true'. (RxJava 1.x or 2.x or 3.x)
**resttemplate**
HTTP client: Spring RestTemplate 4.x. JSON processing: Jackson 2.9.x
**webclient**
HTTP client: Spring WebClient 5.x. JSON processing: Jackson 2.9.x
**resteasy**
HTTP client: Resteasy client 3.x. JSON processing: Jackson 2.9.x
**vertx**
HTTP client: VertX client 3.x. JSON processing: Jackson 2.9.x
**google-api-client**
HTTP client: Google API client 1.x. JSON processing: Jackson 2.9.x
**rest-assured**
HTTP client: rest-assured : 4.x. JSON processing: Gson 2.x or Jackson 2.10.x. Only for Java 8
**native**
HTTP client: Java native HttpClient. JSON processing: Jackson 2.9.x. Only for Java11+
**microprofile**
HTTP client: Microprofile client 1.x. JSON processing: JSON-B
**apache-httpclient**
HTTP client: Apache httpclient 4.x
|okhttp-gson| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| |microprofileFramework|Framework for microprofile. Possible values "kumuluzee"| |null| |microprofileRestClientVersion|Version of MicroProfile Rest Client API.| |null| -|modelPackage|package for generated models| |org.openapitools.client.model| +|modelPackage|package for generated models| |org.openapijsonschematools.client.model| |openApiNullable|Enable OpenAPI Jackson Nullable library| |true| |parcelableModel|Whether to generate models for Android that implement Parcelable with the okhttp-gson library.| |false| |parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| @@ -65,9 +65,9 @@ These options may be applied as additional-properties (cli) or configOptions (pl |parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |performBeanValidation|Perform BeanValidation| |false| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| -|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| -|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| +|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapi-json-schema-tools/openapi-json-schema-generator.git| +|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapi-json-schema-tools/openapi-json-schema-generator.git| +|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapi-json-schema-tools/openapi-json-schema-generator| |serializableModel|boolean - toggle "implements Serializable" for generated models| |false| |serializationLibrary|Serialization library, default depends on value of the option library|
**jsonb**
Use JSON-B as serialization library
**jackson**
Use Jackson as serialization library
**gson**
Use Gson as serialization library
|null| |snapshotVersion|Uses a SNAPSHOT version.|
**true**
Use a SnapShot Version
**false**
Use a Release Version
|null| @@ -103,29 +103,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl |x-webclient-blocking|Specifies if method for specific operation should be blocking or non-blocking(ex: return `Mono/Flux` or `return T/List/Set` & execute `.block()` inside generated method)|OPERATION|false -## IMPORT MAPPING - -| Type/Alias | Imports | -| ---------- | ------- | -|Array|java.util.List| -|ArrayList|java.util.ArrayList| -|BigDecimal|java.math.BigDecimal| -|Date|java.util.Date| -|DateTime|org.joda.time.*| -|File|java.io.File| -|HashMap|java.util.HashMap| -|LinkedHashSet|java.util.LinkedHashSet| -|List|java.util.*| -|LocalDate|org.joda.time.*| -|LocalDateTime|org.joda.time.*| -|LocalTime|org.joda.time.*| -|Map|java.util.Map| -|Set|java.util.*| -|Timestamp|java.sql.Timestamp| -|URI|java.net.URI| -|UUID|java.util.UUID| - - ## INSTANTIATION TYPES | Type/Alias | Instantiated By | @@ -237,15 +214,30 @@ These options may be applied as additional-properties (cli) or configOptions (pl |UserAgent|✗|ToolingExtension |MockServer|✗|ToolingExtension +### Components Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|schemas|✗|OAS3 +|responses|✗|OAS3 +|parameters|✗|OAS3 +|examples|✗|OAS3 +|requestBodies|✗|OAS3 +|headers|✗|OAS3 +|securitySchemes|✗|OAS3 +|links|✗|OAS3 +|callbacks|✗|OAS3 +|pathItems|✗|OAS3 + ### Data Type Feature | Name | Supported | Defined By | | ---- | --------- | ---------- | |Custom|✗|OAS2,OAS3 |Int32|✓|OAS2,OAS3 |Int64|✓|OAS2,OAS3 +|Integer|✗|OAS2,OAS3 |Float|✓|OAS2,OAS3 |Double|✓|OAS2,OAS3 -|Decimal|✓|ToolingExtension +|Number|✗|OAS2,OAS3 |String|✓|OAS2,OAS3 |Byte|✓|OAS2,OAS3 |Binary|✓|OAS2,OAS3 @@ -254,82 +246,109 @@ These options may be applied as additional-properties (cli) or configOptions (pl |DateTime|✓|OAS2,OAS3 |Password|✓|OAS2,OAS3 |File|✓|OAS2 -|Uuid|✗| +|Uuid|✗|OAS2,OAS3 |Array|✓|OAS2,OAS3 |Null|✗|OAS3 |AnyType|✗|OAS2,OAS3 |Object|✓|OAS2,OAS3 -|Maps|✓|ToolingExtension -|CollectionFormat|✓|OAS2 -|CollectionFormatMulti|✓|OAS2 |Enum|✓|OAS2,OAS3 -|ArrayOfEnum|✓|ToolingExtension -|ArrayOfModel|✓|ToolingExtension -|ArrayOfCollectionOfPrimitives|✓|ToolingExtension -|ArrayOfCollectionOfModel|✓|ToolingExtension -|ArrayOfCollectionOfEnum|✓|ToolingExtension -|MapOfEnum|✓|ToolingExtension -|MapOfModel|✓|ToolingExtension -|MapOfCollectionOfPrimitives|✓|ToolingExtension -|MapOfCollectionOfModel|✓|ToolingExtension -|MapOfCollectionOfEnum|✓|ToolingExtension ### Documentation Feature | Name | Supported | Defined By | | ---- | --------- | ---------- | |Readme|✓|ToolingExtension -|Model|✓|ToolingExtension +|Servers|✗|OAS3 +|Security|✗|OAS2,OAS3 +|ComponentSchemas|✓|OAS3 +|ComponentResponses|✗|OAS3 +|ComponentParameters|✗|OAS3 +|ComponentRequestBodies|✗|OAS3 +|ComponentHeaders|✗|OAS3 +|ComponentSecuritySchemes|✗|OAS3 +|ComponentLinks|✗|OAS3 +|ComponentCallbacks|✗|OAS3 +|ComponentPathItems|✗|OAS3 |Api|✓|ToolingExtension ### Global Feature | Name | Supported | Defined By | | ---- | --------- | ---------- | -|Host|✓|OAS2,OAS3 -|BasePath|✓|OAS2,OAS3 |Info|✓|OAS2,OAS3 -|Schemes|✗|OAS2,OAS3 -|PartialSchemes|✓|OAS2,OAS3 -|Consumes|✓|OAS2 -|Produces|✓|OAS2 -|ExternalDocumentation|✓|OAS2,OAS3 -|Examples|✓|OAS2,OAS3 -|XMLStructureDefinitions|✗|OAS2,OAS3 -|MultiServer|✗|OAS3 -|ParameterizedServer|✓|OAS3 -|ParameterStyling|✗|OAS3 -|Callbacks|✗|OAS3 -|LinkObjects|✗|OAS3 +|Servers|✗|OAS3 +|Paths|✗|OAS2,OAS3 +|Webhooks|✗|OAS3 +|Components|✓|OAS3 +|Security|✗|OAS2,OAS3 +|Tags|✗|OAS2,OAS3 +|ExternalDocs|✗|OAS2,OAS3 + +### Operation Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Responses_HttpStatusCode|✓|OAS3 +|Responses_RangedResponseCodes|✗|OAS3 +|Responses_Default|✓|OAS3 +|Responses_RedirectionResponse|✗|OAS3 ### Parameter Feature | Name | Supported | Defined By | | ---- | --------- | ---------- | -|Path|✓|OAS2,OAS3 -|Query|✓|OAS2,OAS3 -|Header|✓|OAS2,OAS3 -|Body|✓|OAS2 -|FormUnencoded|✓|OAS2 -|FormMultipart|✓|OAS2 -|Cookie|✓|OAS3 +|Name|✗|OAS2,OAS3 +|Required|✗|OAS2,OAS3 +|In_Path|✓|OAS2,OAS3 +|In_Query|✓|OAS2,OAS3 +|In_Header|✓|OAS2,OAS3 +|In_Cookie|✓|OAS3 +|Style_Matrix|✗|OAS3 +|Style_Label|✗|OAS3 +|Style_Form|✗|OAS3 +|Style_Simple|✗|OAS3 +|Style_SpaceDelimited|✗|OAS3 +|Style_PipeDelimited|✗|OAS3 +|Style_DeepObject|✗|OAS3 +|Explode|✗|OAS3 +|Schema|✗|OAS3 +|Content|✗|OAS3 -### Schema Support Feature +### Schema Feature | Name | Supported | Defined By | | ---- | --------- | ---------- | -|Simple|✓|OAS2,OAS3 -|Composite|✓|OAS2,OAS3 -|Polymorphism|✗|OAS2,OAS3 -|Union|✗|OAS3 -|allOf|✗|OAS2,OAS3 -|anyOf|✗|OAS3 -|oneOf|✗|OAS3 -|not|✗|OAS3 +|AdditionalProperties|✗|OAS2,OAS3 +|AllOf|✗|OAS2,OAS3 +|AnyOf|✗|OAS3 +|Default|✗|OAS2,OAS3 +|Discriminator|✓|OAS2,OAS3 +|Enum|✓|OAS2,OAS3 +|ExclusiveMinimum|✓|OAS2,OAS3 +|ExclusiveMaximum|✓|OAS2,OAS3 +|Format|✓|OAS2,OAS3 +|Items|✓|OAS2,OAS3 +|MaxItems|✓|OAS2,OAS3 +|MaxLength|✓|OAS2,OAS3 +|MaxProperties|✓|OAS2,OAS3 +|Maximum|✓|OAS2,OAS3 +|MinItems|✓|OAS2,OAS3 +|MinLength|✓|OAS2,OAS3 +|MinProperties|✓|OAS2,OAS3 +|Minimum|✓|OAS2,OAS3 +|MultipleOf|✓|OAS2,OAS3 +|Not|✗|OAS3 +|Nullable|✗|OAS3 +|OneOf|✗|OAS3 +|Pattern|✓|OAS2,OAS3 +|Properties|✓|OAS2,OAS3 +|Required|✓|OAS2,OAS3 +|Type|✓|OAS2,OAS3 +|UniqueItems|✓|OAS2,OAS3 +|Xml|✗|OAS2,OAS3 ### Security Feature | Name | Supported | Defined By | | ---- | --------- | ---------- | -|BasicAuth|✗|OAS2,OAS3 +|HTTP_Basic|✗|OAS2,OAS3 |ApiKey|✗|OAS2,OAS3 |OpenIDConnect|✗|OAS3 -|BearerToken|✗|OAS3 +|HTTP_Bearer|✗|OAS2,OAS3 |OAuth2_Implicit|✗|OAS2,OAS3 |OAuth2_Password|✗|OAS2,OAS3 |OAuth2_ClientCredentials|✗|OAS2,OAS3 diff --git a/docs/generators/jaxrs-jersey.md b/docs/generators/jaxrs-jersey.md index 995d4e2a884..a04452cd13f 100644 --- a/docs/generators/jaxrs-jersey.md +++ b/docs/generators/jaxrs-jersey.md @@ -21,44 +21,44 @@ These options may be applied as additional-properties (cli) or configOptions (pl |additionalEnumTypeAnnotations|Additional annotations for enum type(class level annotations)| |null| |additionalModelTypeAnnotations|Additional annotations for model type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)| |null| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|apiPackage|package for generated api classes| |org.openapitools.api| +|apiPackage|package for generated api classes| |org.openapijsonschematools.api| |artifactDescription|artifact description in generated pom.xml| |OpenAPI Java| |artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-jaxrs-server| -|artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| +|artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapi-json-schema-tools/openapi-json-schema-generator| |artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| |bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| |booleanGetterPrefix|Set booleanGetterPrefix| |get| |dateLibrary|Option. Date library to use|
**joda**
Joda (for legacy app only)
**legacy**
Legacy java.util.Date
**java8-localdatetime**
Java 8 using LocalDateTime (for legacy app only)
**java8**
Java 8 native JSR310 (preferred for jdk 1.8+)
|legacy| -|developerEmail|developer email in generated pom.xml| |team@openapitools.org| +|developerEmail|developer email in generated pom.xml| |team@openapijsonschematools.org| |developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| |developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org| -|developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org| +|developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapijsonschematools.org| |disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
|true| |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| -|groupId|groupId in generated pom.xml| |org.openapitools| +|groupId|groupId in generated pom.xml| |org.openapijsonschematools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| |ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| |implFolder|folder for generated implementation code| |src/main/java| |implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false| |implicitHeadersRegex|Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true| |null| -|invokerPackage|root package for generated code| |org.openapitools.api| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| +|invokerPackage|root package for generated code| |org.openapijsonschematools.api| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
**true**
The mapping in the discriminator includes descendant schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendant schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| |library|library template (sub-template)|
**jersey1**
Jersey core 1.x
**jersey2**
Jersey core 2.x
|jersey2| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| -|modelPackage|package for generated models| |org.openapitools.model| +|modelPackage|package for generated models| |org.openapijsonschematools.model| |openApiNullable|Enable OpenAPI Jackson Nullable library| |true| |parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| -|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| -|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| +|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapi-json-schema-tools/openapi-json-schema-generator.git| +|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapi-json-schema-tools/openapi-json-schema-generator.git| +|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapi-json-schema-tools/openapi-json-schema-generator| |serializableModel|boolean - toggle "implements Serializable" for generated models| |false| |serverPort|The port on which the server should be started| |8080| |snapshotVersion|Uses a SNAPSHOT version.|
**true**
Use a SnapShot Version
**false**
Use a Release Version
|null| @@ -86,29 +86,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl |x-field-extra-annotation|List of custom annotations to be added to property|FIELD|null -## IMPORT MAPPING - -| Type/Alias | Imports | -| ---------- | ------- | -|Array|java.util.List| -|ArrayList|java.util.ArrayList| -|BigDecimal|java.math.BigDecimal| -|Date|java.util.Date| -|DateTime|org.joda.time.*| -|File|java.io.File| -|HashMap|java.util.HashMap| -|LinkedHashSet|java.util.LinkedHashSet| -|List|java.util.*| -|LocalDate|org.joda.time.*| -|LocalDateTime|org.joda.time.*| -|LocalTime|org.joda.time.*| -|Map|java.util.Map| -|Set|java.util.*| -|Timestamp|java.sql.Timestamp| -|URI|java.net.URI| -|UUID|java.util.UUID| - - ## INSTANTIATION TYPES | Type/Alias | Instantiated By | @@ -220,15 +197,30 @@ These options may be applied as additional-properties (cli) or configOptions (pl |UserAgent|✗|ToolingExtension |MockServer|✗|ToolingExtension +### Components Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|schemas|✗|OAS3 +|responses|✗|OAS3 +|parameters|✗|OAS3 +|examples|✗|OAS3 +|requestBodies|✗|OAS3 +|headers|✗|OAS3 +|securitySchemes|✗|OAS3 +|links|✗|OAS3 +|callbacks|✗|OAS3 +|pathItems|✗|OAS3 + ### Data Type Feature | Name | Supported | Defined By | | ---- | --------- | ---------- | |Custom|✗|OAS2,OAS3 |Int32|✓|OAS2,OAS3 |Int64|✓|OAS2,OAS3 +|Integer|✗|OAS2,OAS3 |Float|✓|OAS2,OAS3 |Double|✓|OAS2,OAS3 -|Decimal|✓|ToolingExtension +|Number|✗|OAS2,OAS3 |String|✓|OAS2,OAS3 |Byte|✓|OAS2,OAS3 |Binary|✓|OAS2,OAS3 @@ -237,82 +229,109 @@ These options may be applied as additional-properties (cli) or configOptions (pl |DateTime|✓|OAS2,OAS3 |Password|✓|OAS2,OAS3 |File|✓|OAS2 -|Uuid|✗| +|Uuid|✗|OAS2,OAS3 |Array|✓|OAS2,OAS3 |Null|✗|OAS3 |AnyType|✗|OAS2,OAS3 |Object|✓|OAS2,OAS3 -|Maps|✓|ToolingExtension -|CollectionFormat|✓|OAS2 -|CollectionFormatMulti|✓|OAS2 |Enum|✓|OAS2,OAS3 -|ArrayOfEnum|✓|ToolingExtension -|ArrayOfModel|✓|ToolingExtension -|ArrayOfCollectionOfPrimitives|✓|ToolingExtension -|ArrayOfCollectionOfModel|✓|ToolingExtension -|ArrayOfCollectionOfEnum|✓|ToolingExtension -|MapOfEnum|✓|ToolingExtension -|MapOfModel|✓|ToolingExtension -|MapOfCollectionOfPrimitives|✓|ToolingExtension -|MapOfCollectionOfModel|✓|ToolingExtension -|MapOfCollectionOfEnum|✓|ToolingExtension ### Documentation Feature | Name | Supported | Defined By | | ---- | --------- | ---------- | |Readme|✓|ToolingExtension -|Model|✓|ToolingExtension +|Servers|✗|OAS3 +|Security|✗|OAS2,OAS3 +|ComponentSchemas|✓|OAS3 +|ComponentResponses|✗|OAS3 +|ComponentParameters|✗|OAS3 +|ComponentRequestBodies|✗|OAS3 +|ComponentHeaders|✗|OAS3 +|ComponentSecuritySchemes|✗|OAS3 +|ComponentLinks|✗|OAS3 +|ComponentCallbacks|✗|OAS3 +|ComponentPathItems|✗|OAS3 |Api|✓|ToolingExtension ### Global Feature | Name | Supported | Defined By | | ---- | --------- | ---------- | -|Host|✓|OAS2,OAS3 -|BasePath|✓|OAS2,OAS3 |Info|✓|OAS2,OAS3 -|Schemes|✗|OAS2,OAS3 -|PartialSchemes|✓|OAS2,OAS3 -|Consumes|✓|OAS2 -|Produces|✓|OAS2 -|ExternalDocumentation|✓|OAS2,OAS3 -|Examples|✓|OAS2,OAS3 -|XMLStructureDefinitions|✗|OAS2,OAS3 -|MultiServer|✗|OAS3 -|ParameterizedServer|✗|OAS3 -|ParameterStyling|✗|OAS3 -|Callbacks|✗|OAS3 -|LinkObjects|✗|OAS3 +|Servers|✗|OAS3 +|Paths|✗|OAS2,OAS3 +|Webhooks|✗|OAS3 +|Components|✓|OAS3 +|Security|✗|OAS2,OAS3 +|Tags|✗|OAS2,OAS3 +|ExternalDocs|✗|OAS2,OAS3 + +### Operation Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Responses_HttpStatusCode|✓|OAS3 +|Responses_RangedResponseCodes|✗|OAS3 +|Responses_Default|✓|OAS3 +|Responses_RedirectionResponse|✗|OAS3 ### Parameter Feature | Name | Supported | Defined By | | ---- | --------- | ---------- | -|Path|✓|OAS2,OAS3 -|Query|✓|OAS2,OAS3 -|Header|✓|OAS2,OAS3 -|Body|✓|OAS2 -|FormUnencoded|✓|OAS2 -|FormMultipart|✓|OAS2 -|Cookie|✓|OAS3 +|Name|✗|OAS2,OAS3 +|Required|✗|OAS2,OAS3 +|In_Path|✓|OAS2,OAS3 +|In_Query|✓|OAS2,OAS3 +|In_Header|✓|OAS2,OAS3 +|In_Cookie|✓|OAS3 +|Style_Matrix|✗|OAS3 +|Style_Label|✗|OAS3 +|Style_Form|✗|OAS3 +|Style_Simple|✗|OAS3 +|Style_SpaceDelimited|✗|OAS3 +|Style_PipeDelimited|✗|OAS3 +|Style_DeepObject|✗|OAS3 +|Explode|✗|OAS3 +|Schema|✗|OAS3 +|Content|✗|OAS3 -### Schema Support Feature +### Schema Feature | Name | Supported | Defined By | | ---- | --------- | ---------- | -|Simple|✓|OAS2,OAS3 -|Composite|✓|OAS2,OAS3 -|Polymorphism|✗|OAS2,OAS3 -|Union|✗|OAS3 -|allOf|✗|OAS2,OAS3 -|anyOf|✗|OAS3 -|oneOf|✗|OAS3 -|not|✗|OAS3 +|AdditionalProperties|✗|OAS2,OAS3 +|AllOf|✗|OAS2,OAS3 +|AnyOf|✗|OAS3 +|Default|✗|OAS2,OAS3 +|Discriminator|✓|OAS2,OAS3 +|Enum|✓|OAS2,OAS3 +|ExclusiveMinimum|✓|OAS2,OAS3 +|ExclusiveMaximum|✓|OAS2,OAS3 +|Format|✓|OAS2,OAS3 +|Items|✓|OAS2,OAS3 +|MaxItems|✓|OAS2,OAS3 +|MaxLength|✓|OAS2,OAS3 +|MaxProperties|✓|OAS2,OAS3 +|Maximum|✓|OAS2,OAS3 +|MinItems|✓|OAS2,OAS3 +|MinLength|✓|OAS2,OAS3 +|MinProperties|✓|OAS2,OAS3 +|Minimum|✓|OAS2,OAS3 +|MultipleOf|✓|OAS2,OAS3 +|Not|✗|OAS3 +|Nullable|✗|OAS3 +|OneOf|✗|OAS3 +|Pattern|✓|OAS2,OAS3 +|Properties|✓|OAS2,OAS3 +|Required|✓|OAS2,OAS3 +|Type|✓|OAS2,OAS3 +|UniqueItems|✓|OAS2,OAS3 +|Xml|✗|OAS2,OAS3 ### Security Feature | Name | Supported | Defined By | | ---- | --------- | ---------- | -|BasicAuth|✗|OAS2,OAS3 +|HTTP_Basic|✗|OAS2,OAS3 |ApiKey|✗|OAS2,OAS3 |OpenIDConnect|✗|OAS3 -|BearerToken|✗|OAS3 +|HTTP_Bearer|✗|OAS2,OAS3 |OAuth2_Implicit|✗|OAS2,OAS3 |OAuth2_Password|✗|OAS2,OAS3 |OAuth2_ClientCredentials|✗|OAS2,OAS3 diff --git a/docs/generators/jmeter.md b/docs/generators/jmeter.md index 90ee80172ab..37838528eb6 100644 --- a/docs/generators/jmeter.md +++ b/docs/generators/jmeter.md @@ -22,17 +22,11 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
|true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
**true**
The mapping in the discriminator includes descendant schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendant schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -## IMPORT MAPPING - -| Type/Alias | Imports | -| ---------- | ------- | - - ## INSTANTIATION TYPES | Type/Alias | Instantiated By | @@ -62,15 +56,30 @@ These options may be applied as additional-properties (cli) or configOptions (pl |UserAgent|✗|ToolingExtension |MockServer|✗|ToolingExtension +### Components Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|schemas|✗|OAS3 +|responses|✗|OAS3 +|parameters|✗|OAS3 +|examples|✗|OAS3 +|requestBodies|✗|OAS3 +|headers|✗|OAS3 +|securitySchemes|✗|OAS3 +|links|✗|OAS3 +|callbacks|✗|OAS3 +|pathItems|✗|OAS3 + ### Data Type Feature | Name | Supported | Defined By | | ---- | --------- | ---------- | |Custom|✗|OAS2,OAS3 |Int32|✓|OAS2,OAS3 |Int64|✓|OAS2,OAS3 +|Integer|✗|OAS2,OAS3 |Float|✓|OAS2,OAS3 |Double|✓|OAS2,OAS3 -|Decimal|✓|ToolingExtension +|Number|✗|OAS2,OAS3 |String|✓|OAS2,OAS3 |Byte|✓|OAS2,OAS3 |Binary|✓|OAS2,OAS3 @@ -79,82 +88,109 @@ These options may be applied as additional-properties (cli) or configOptions (pl |DateTime|✓|OAS2,OAS3 |Password|✓|OAS2,OAS3 |File|✓|OAS2 -|Uuid|✗| +|Uuid|✗|OAS2,OAS3 |Array|✓|OAS2,OAS3 |Null|✗|OAS3 |AnyType|✗|OAS2,OAS3 |Object|✓|OAS2,OAS3 -|Maps|✓|ToolingExtension -|CollectionFormat|✓|OAS2 -|CollectionFormatMulti|✓|OAS2 |Enum|✓|OAS2,OAS3 -|ArrayOfEnum|✓|ToolingExtension -|ArrayOfModel|✓|ToolingExtension -|ArrayOfCollectionOfPrimitives|✓|ToolingExtension -|ArrayOfCollectionOfModel|✓|ToolingExtension -|ArrayOfCollectionOfEnum|✓|ToolingExtension -|MapOfEnum|✓|ToolingExtension -|MapOfModel|✓|ToolingExtension -|MapOfCollectionOfPrimitives|✓|ToolingExtension -|MapOfCollectionOfModel|✓|ToolingExtension -|MapOfCollectionOfEnum|✓|ToolingExtension ### Documentation Feature | Name | Supported | Defined By | | ---- | --------- | ---------- | |Readme|✗|ToolingExtension -|Model|✓|ToolingExtension +|Servers|✗|OAS3 +|Security|✗|OAS2,OAS3 +|ComponentSchemas|✓|OAS3 +|ComponentResponses|✗|OAS3 +|ComponentParameters|✗|OAS3 +|ComponentRequestBodies|✗|OAS3 +|ComponentHeaders|✗|OAS3 +|ComponentSecuritySchemes|✗|OAS3 +|ComponentLinks|✗|OAS3 +|ComponentCallbacks|✗|OAS3 +|ComponentPathItems|✗|OAS3 |Api|✓|ToolingExtension ### Global Feature | Name | Supported | Defined By | | ---- | --------- | ---------- | -|Host|✓|OAS2,OAS3 -|BasePath|✓|OAS2,OAS3 |Info|✓|OAS2,OAS3 -|Schemes|✗|OAS2,OAS3 -|PartialSchemes|✓|OAS2,OAS3 -|Consumes|✓|OAS2 -|Produces|✓|OAS2 -|ExternalDocumentation|✓|OAS2,OAS3 -|Examples|✓|OAS2,OAS3 -|XMLStructureDefinitions|✗|OAS2,OAS3 -|MultiServer|✗|OAS3 -|ParameterizedServer|✗|OAS3 -|ParameterStyling|✗|OAS3 -|Callbacks|✗|OAS3 -|LinkObjects|✗|OAS3 +|Servers|✗|OAS3 +|Paths|✗|OAS2,OAS3 +|Webhooks|✗|OAS3 +|Components|✓|OAS3 +|Security|✗|OAS2,OAS3 +|Tags|✗|OAS2,OAS3 +|ExternalDocs|✗|OAS2,OAS3 + +### Operation Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Responses_HttpStatusCode|✓|OAS3 +|Responses_RangedResponseCodes|✗|OAS3 +|Responses_Default|✓|OAS3 +|Responses_RedirectionResponse|✗|OAS3 ### Parameter Feature | Name | Supported | Defined By | | ---- | --------- | ---------- | -|Path|✓|OAS2,OAS3 -|Query|✓|OAS2,OAS3 -|Header|✓|OAS2,OAS3 -|Body|✓|OAS2 -|FormUnencoded|✓|OAS2 -|FormMultipart|✓|OAS2 -|Cookie|✓|OAS3 - -### Schema Support Feature +|Name|✗|OAS2,OAS3 +|Required|✗|OAS2,OAS3 +|In_Path|✓|OAS2,OAS3 +|In_Query|✓|OAS2,OAS3 +|In_Header|✓|OAS2,OAS3 +|In_Cookie|✓|OAS3 +|Style_Matrix|✗|OAS3 +|Style_Label|✗|OAS3 +|Style_Form|✗|OAS3 +|Style_Simple|✗|OAS3 +|Style_SpaceDelimited|✗|OAS3 +|Style_PipeDelimited|✗|OAS3 +|Style_DeepObject|✗|OAS3 +|Explode|✗|OAS3 +|Schema|✗|OAS3 +|Content|✗|OAS3 + +### Schema Feature | Name | Supported | Defined By | | ---- | --------- | ---------- | -|Simple|✓|OAS2,OAS3 -|Composite|✓|OAS2,OAS3 -|Polymorphism|✗|OAS2,OAS3 -|Union|✗|OAS3 -|allOf|✗|OAS2,OAS3 -|anyOf|✗|OAS3 -|oneOf|✗|OAS3 -|not|✗|OAS3 +|AdditionalProperties|✗|OAS2,OAS3 +|AllOf|✗|OAS2,OAS3 +|AnyOf|✗|OAS3 +|Default|✗|OAS2,OAS3 +|Discriminator|✓|OAS2,OAS3 +|Enum|✓|OAS2,OAS3 +|ExclusiveMinimum|✓|OAS2,OAS3 +|ExclusiveMaximum|✓|OAS2,OAS3 +|Format|✓|OAS2,OAS3 +|Items|✓|OAS2,OAS3 +|MaxItems|✓|OAS2,OAS3 +|MaxLength|✓|OAS2,OAS3 +|MaxProperties|✓|OAS2,OAS3 +|Maximum|✓|OAS2,OAS3 +|MinItems|✓|OAS2,OAS3 +|MinLength|✓|OAS2,OAS3 +|MinProperties|✓|OAS2,OAS3 +|Minimum|✓|OAS2,OAS3 +|MultipleOf|✓|OAS2,OAS3 +|Not|✗|OAS3 +|Nullable|✗|OAS3 +|OneOf|✗|OAS3 +|Pattern|✓|OAS2,OAS3 +|Properties|✓|OAS2,OAS3 +|Required|✓|OAS2,OAS3 +|Type|✓|OAS2,OAS3 +|UniqueItems|✓|OAS2,OAS3 +|Xml|✗|OAS2,OAS3 ### Security Feature | Name | Supported | Defined By | | ---- | --------- | ---------- | -|BasicAuth|✓|OAS2,OAS3 +|HTTP_Basic|✓|OAS2,OAS3 |ApiKey|✓|OAS2,OAS3 |OpenIDConnect|✗|OAS3 -|BearerToken|✗|OAS3 +|HTTP_Bearer|✗|OAS2,OAS3 |OAuth2_Implicit|✓|OAS2,OAS3 |OAuth2_Password|✗|OAS2,OAS3 |OAuth2_ClientCredentials|✗|OAS2,OAS3 diff --git a/docs/generators/kotlin.md b/docs/generators/kotlin.md index 9604691912b..d6f01c02453 100644 --- a/docs/generators/kotlin.md +++ b/docs/generators/kotlin.md @@ -25,14 +25,14 @@ These options may be applied as additional-properties (cli) or configOptions (pl |dateLibrary|Option. Date library to use|
**threetenbp-localdatetime**
Threetenbp - Backport of JSR310 (jvm only, for legacy app only)
**string**
String
**java8-localdatetime**
Java 8 native JSR310 (jvm only, for legacy app only)
**java8**
Java 8 native JSR310 (jvm only, preferred for jdk 1.8+)
**threetenbp**
Threetenbp - Backport of JSR310 (jvm only, preferred for jdk < 1.8)
|java8| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |camelCase| |generateRoomModels|Generate Android Room database models in addition to API models (JVM Volley library only)| |false| -|groupId|Generated artifact package's organization (i.e. maven groupId).| |org.openapitools| +|groupId|Generated artifact package's organization (i.e. maven groupId).| |org.openapijsonschematools| |idea|Add IntellJ Idea plugin and mark Kotlin main and test folders as source folders.| |false| |library|Library template (sub-template) to use|
**jvm-ktor**
Platform: Java Virtual Machine. HTTP client: Ktor 1.6.7. JSON processing: Gson, Jackson (default).
**jvm-okhttp4**
[DEFAULT] Platform: Java Virtual Machine. HTTP client: OkHttp 4.2.0 (Android 5.0+ and Java 8+). JSON processing: Moshi 1.8.0.
**jvm-okhttp3**
Platform: Java Virtual Machine. HTTP client: OkHttp 3.12.4 (Android 2.3+ and Java 7+). JSON processing: Moshi 1.8.0.
**jvm-retrofit2**
Platform: Java Virtual Machine. HTTP client: Retrofit 2.6.2.
**multiplatform**
Platform: Kotlin multiplatform. HTTP client: Ktor 1.6.7. JSON processing: Kotlinx Serialization: 1.2.1.
**jvm-volley**
Platform: JVM for Android. HTTP client: Volley 1.2.1. JSON processing: gson 2.8.9
|jvm-okhttp4| |modelMutable|Create mutable models| |false| |moshiCodeGen|Whether to enable codegen with the Moshi library. Refer to the [official Moshi doc](https://github.com/square/moshi#codegen) for more info.| |false| |omitGradlePluginVersions|Whether to declare Gradle plugin versions in build files.| |false| |omitGradleWrapper|Whether to omit Gradle wrapper for creating a sub project.| |false| -|packageName|Generated artifact package name.| |org.openapitools.client| +|packageName|Generated artifact package name.| |org.openapijsonschematools.client| |parcelizeModels|toggle "@Parcelize" for generated models| |null| |requestDateConverter|JVM-Option. Defines in how to handle date-time objects that are used for a request (as query or parameter)|
**toJson**
[DEFAULT] Date formatter option using a json converter.
**toString**
Use the 'toString'-method of the date-time object to retrieve the related string representation.
|toJson| |serializableModel|boolean - toggle "implements Serializable" for generated models| |null| @@ -46,22 +46,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl |useRxJava2|Whether to use the RxJava2 adapter with the retrofit2 library. IMPORTANT: this option has been deprecated. Please use `useRxJava3` instead.| |false| |useRxJava3|Whether to use the RxJava3 adapter with the retrofit2 library.| |false| -## IMPORT MAPPING - -| Type/Alias | Imports | -| ---------- | ------- | -|BigDecimal|java.math.BigDecimal| -|Date|java.time.LocalDate| -|DateTime|java.time.OffsetDateTime| -|File|java.io.File| -|LocalDate|java.time.LocalDate| -|LocalDateTime|java.time.LocalDateTime| -|LocalTime|java.time.LocalTime| -|Timestamp|java.sql.Timestamp| -|URI|java.net.URI| -|UUID|java.util.UUID| - - ## INSTANTIATION TYPES | Type/Alias | Instantiated By | @@ -182,15 +166,30 @@ These options may be applied as additional-properties (cli) or configOptions (pl |UserAgent|✗|ToolingExtension |MockServer|✗|ToolingExtension +### Components Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|schemas|✗|OAS3 +|responses|✗|OAS3 +|parameters|✗|OAS3 +|examples|✗|OAS3 +|requestBodies|✗|OAS3 +|headers|✗|OAS3 +|securitySchemes|✗|OAS3 +|links|✗|OAS3 +|callbacks|✗|OAS3 +|pathItems|✗|OAS3 + ### Data Type Feature | Name | Supported | Defined By | | ---- | --------- | ---------- | |Custom|✗|OAS2,OAS3 |Int32|✓|OAS2,OAS3 |Int64|✓|OAS2,OAS3 +|Integer|✗|OAS2,OAS3 |Float|✓|OAS2,OAS3 |Double|✓|OAS2,OAS3 -|Decimal|✓|ToolingExtension +|Number|✗|OAS2,OAS3 |String|✓|OAS2,OAS3 |Byte|✓|OAS2,OAS3 |Binary|✓|OAS2,OAS3 @@ -199,82 +198,109 @@ These options may be applied as additional-properties (cli) or configOptions (pl |DateTime|✓|OAS2,OAS3 |Password|✓|OAS2,OAS3 |File|✓|OAS2 -|Uuid|✗| +|Uuid|✗|OAS2,OAS3 |Array|✓|OAS2,OAS3 |Null|✗|OAS3 |AnyType|✗|OAS2,OAS3 |Object|✓|OAS2,OAS3 -|Maps|✓|ToolingExtension -|CollectionFormat|✓|OAS2 -|CollectionFormatMulti|✓|OAS2 |Enum|✓|OAS2,OAS3 -|ArrayOfEnum|✓|ToolingExtension -|ArrayOfModel|✓|ToolingExtension -|ArrayOfCollectionOfPrimitives|✓|ToolingExtension -|ArrayOfCollectionOfModel|✓|ToolingExtension -|ArrayOfCollectionOfEnum|✓|ToolingExtension -|MapOfEnum|✓|ToolingExtension -|MapOfModel|✓|ToolingExtension -|MapOfCollectionOfPrimitives|✓|ToolingExtension -|MapOfCollectionOfModel|✓|ToolingExtension -|MapOfCollectionOfEnum|✓|ToolingExtension ### Documentation Feature | Name | Supported | Defined By | | ---- | --------- | ---------- | |Readme|✓|ToolingExtension -|Model|✓|ToolingExtension +|Servers|✗|OAS3 +|Security|✗|OAS2,OAS3 +|ComponentSchemas|✓|OAS3 +|ComponentResponses|✗|OAS3 +|ComponentParameters|✗|OAS3 +|ComponentRequestBodies|✗|OAS3 +|ComponentHeaders|✗|OAS3 +|ComponentSecuritySchemes|✗|OAS3 +|ComponentLinks|✗|OAS3 +|ComponentCallbacks|✗|OAS3 +|ComponentPathItems|✗|OAS3 |Api|✓|ToolingExtension ### Global Feature | Name | Supported | Defined By | | ---- | --------- | ---------- | -|Host|✓|OAS2,OAS3 -|BasePath|✓|OAS2,OAS3 |Info|✓|OAS2,OAS3 -|Schemes|✗|OAS2,OAS3 -|PartialSchemes|✓|OAS2,OAS3 -|Consumes|✓|OAS2 -|Produces|✓|OAS2 -|ExternalDocumentation|✓|OAS2,OAS3 -|Examples|✓|OAS2,OAS3 -|XMLStructureDefinitions|✗|OAS2,OAS3 -|MultiServer|✗|OAS3 -|ParameterizedServer|✗|OAS3 -|ParameterStyling|✗|OAS3 -|Callbacks|✗|OAS3 -|LinkObjects|✗|OAS3 +|Servers|✗|OAS3 +|Paths|✗|OAS2,OAS3 +|Webhooks|✗|OAS3 +|Components|✓|OAS3 +|Security|✗|OAS2,OAS3 +|Tags|✗|OAS2,OAS3 +|ExternalDocs|✗|OAS2,OAS3 + +### Operation Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Responses_HttpStatusCode|✓|OAS3 +|Responses_RangedResponseCodes|✗|OAS3 +|Responses_Default|✓|OAS3 +|Responses_RedirectionResponse|✗|OAS3 ### Parameter Feature | Name | Supported | Defined By | | ---- | --------- | ---------- | -|Path|✓|OAS2,OAS3 -|Query|✓|OAS2,OAS3 -|Header|✓|OAS2,OAS3 -|Body|✓|OAS2 -|FormUnencoded|✓|OAS2 -|FormMultipart|✓|OAS2 -|Cookie|✗|OAS3 +|Name|✗|OAS2,OAS3 +|Required|✗|OAS2,OAS3 +|In_Path|✓|OAS2,OAS3 +|In_Query|✓|OAS2,OAS3 +|In_Header|✓|OAS2,OAS3 +|In_Cookie|✗|OAS3 +|Style_Matrix|✗|OAS3 +|Style_Label|✗|OAS3 +|Style_Form|✗|OAS3 +|Style_Simple|✗|OAS3 +|Style_SpaceDelimited|✗|OAS3 +|Style_PipeDelimited|✗|OAS3 +|Style_DeepObject|✗|OAS3 +|Explode|✗|OAS3 +|Schema|✗|OAS3 +|Content|✗|OAS3 -### Schema Support Feature +### Schema Feature | Name | Supported | Defined By | | ---- | --------- | ---------- | -|Simple|✓|OAS2,OAS3 -|Composite|✓|OAS2,OAS3 -|Polymorphism|✗|OAS2,OAS3 -|Union|✗|OAS3 -|allOf|✗|OAS2,OAS3 -|anyOf|✗|OAS3 -|oneOf|✗|OAS3 -|not|✗|OAS3 +|AdditionalProperties|✗|OAS2,OAS3 +|AllOf|✗|OAS2,OAS3 +|AnyOf|✗|OAS3 +|Default|✗|OAS2,OAS3 +|Discriminator|✓|OAS2,OAS3 +|Enum|✓|OAS2,OAS3 +|ExclusiveMinimum|✓|OAS2,OAS3 +|ExclusiveMaximum|✓|OAS2,OAS3 +|Format|✓|OAS2,OAS3 +|Items|✓|OAS2,OAS3 +|MaxItems|✓|OAS2,OAS3 +|MaxLength|✓|OAS2,OAS3 +|MaxProperties|✓|OAS2,OAS3 +|Maximum|✓|OAS2,OAS3 +|MinItems|✓|OAS2,OAS3 +|MinLength|✓|OAS2,OAS3 +|MinProperties|✓|OAS2,OAS3 +|Minimum|✓|OAS2,OAS3 +|MultipleOf|✓|OAS2,OAS3 +|Not|✗|OAS3 +|Nullable|✗|OAS3 +|OneOf|✗|OAS3 +|Pattern|✓|OAS2,OAS3 +|Properties|✓|OAS2,OAS3 +|Required|✓|OAS2,OAS3 +|Type|✓|OAS2,OAS3 +|UniqueItems|✓|OAS2,OAS3 +|Xml|✗|OAS2,OAS3 ### Security Feature | Name | Supported | Defined By | | ---- | --------- | ---------- | -|BasicAuth|✓|OAS2,OAS3 +|HTTP_Basic|✓|OAS2,OAS3 |ApiKey|✓|OAS2,OAS3 |OpenIDConnect|✗|OAS3 -|BearerToken|✓|OAS3 +|HTTP_Bearer|✓|OAS2,OAS3 |OAuth2_Implicit|✗|OAS2,OAS3 |OAuth2_Password|✗|OAS2,OAS3 |OAuth2_ClientCredentials|✗|OAS2,OAS3 diff --git a/docs/generators/python.md b/docs/generators/python.md index f3cb2163115..abd88895215 100644 --- a/docs/generators/python.md +++ b/docs/generators/python.md @@ -28,20 +28,19 @@ These options may be applied as additional-properties (cli) or configOptions (pl |packageVersion|python package version.| |1.0.0| |projectName|python project name in setup.py (e.g. petstore-api).| |null| |recursionLimit|Set the recursion limit. If not set, use the system default value.| |null| -|useInlineModelResolver|use the inline model resolver, if true inline complex models will be extracted into components and $refs to them will be used| |false| |useNose|use the nose test framework| |false| -## IMPORT MAPPING - -| Type/Alias | Imports | -| ---------- | ------- | - - ## INSTANTIATION TYPES | Type/Alias | Instantiated By | | ---------- | --------------- | -|map|dict| +|array|tuple| +|boolean|schemas.BoolClass| +|integer|decimal.Decimal| +|null|schemas.NoneClass| +|number|decimal.Decimal| +|object|frozendict.frozendict| +|string|str| ## LANGUAGE PRIMITIVES @@ -65,14 +64,11 @@ These options may be applied as additional-properties (cli) or configOptions (pl ## RESERVED WORDS
    -
  • all_params
  • and
  • as
  • assert
  • async
  • -
  • auth_settings
  • await
  • -
  • body_params
  • bool
  • break
  • class
  • @@ -85,15 +81,12 @@ These options may be applied as additional-properties (cli) or configOptions (pl
  • except
  • exec
  • false
  • -
  • file_type
  • finally
  • float
  • for
  • -
  • form_params
  • from
  • frozendict
  • global
  • -
  • header_params
  • if
  • import
  • in
  • @@ -101,19 +94,14 @@ These options may be applied as additional-properties (cli) or configOptions (pl
  • is
  • lambda
  • list
  • -
  • local_var_files
  • none
  • -
  • none_type
  • nonlocal
  • not
  • or
  • pass
  • -
  • path_params
  • print
  • property
  • -
  • query_params
  • raise
  • -
  • resource_path
  • return
  • self
  • str
  • @@ -136,100 +124,142 @@ These options may be applied as additional-properties (cli) or configOptions (pl |UserAgent|✗|ToolingExtension |MockServer|✗|ToolingExtension +### Components Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|schemas|✓|OAS3 +|responses|✓|OAS3 +|parameters|✓|OAS3 +|examples|✗|OAS3 +|requestBodies|✓|OAS3 +|headers|✓|OAS3 +|securitySchemes|✓|OAS3 +|links|✗|OAS3 +|callbacks|✗|OAS3 +|pathItems|✗|OAS3 + ### Data Type Feature | Name | Supported | Defined By | | ---- | --------- | ---------- | |Custom|✗|OAS2,OAS3 |Int32|✓|OAS2,OAS3 |Int64|✓|OAS2,OAS3 +|Integer|✓|OAS2,OAS3 |Float|✓|OAS2,OAS3 |Double|✓|OAS2,OAS3 -|Decimal|✓|ToolingExtension +|Number|✓|OAS2,OAS3 |String|✓|OAS2,OAS3 -|Byte|✓|OAS2,OAS3 +|Byte|✗|OAS2,OAS3 |Binary|✓|OAS2,OAS3 |Boolean|✓|OAS2,OAS3 |Date|✓|OAS2,OAS3 |DateTime|✓|OAS2,OAS3 -|Password|✓|OAS2,OAS3 +|Password|✗|OAS2,OAS3 |File|✓|OAS2 -|Uuid|✓| +|Uuid|✓|OAS2,OAS3 |Array|✓|OAS2,OAS3 |Null|✓|OAS3 |AnyType|✓|OAS2,OAS3 |Object|✓|OAS2,OAS3 -|Maps|✓|ToolingExtension -|CollectionFormat|✓|OAS2 -|CollectionFormatMulti|✓|OAS2 |Enum|✓|OAS2,OAS3 -|ArrayOfEnum|✓|ToolingExtension -|ArrayOfModel|✓|ToolingExtension -|ArrayOfCollectionOfPrimitives|✓|ToolingExtension -|ArrayOfCollectionOfModel|✓|ToolingExtension -|ArrayOfCollectionOfEnum|✓|ToolingExtension -|MapOfEnum|✓|ToolingExtension -|MapOfModel|✓|ToolingExtension -|MapOfCollectionOfPrimitives|✓|ToolingExtension -|MapOfCollectionOfModel|✓|ToolingExtension -|MapOfCollectionOfEnum|✓|ToolingExtension ### Documentation Feature | Name | Supported | Defined By | | ---- | --------- | ---------- | |Readme|✓|ToolingExtension -|Model|✓|ToolingExtension +|Servers|✓|OAS3 +|Security|✓|OAS2,OAS3 +|ComponentSchemas|✓|OAS3 +|ComponentResponses|✓|OAS3 +|ComponentParameters|✓|OAS3 +|ComponentRequestBodies|✓|OAS3 +|ComponentHeaders|✓|OAS3 +|ComponentSecuritySchemes|✓|OAS3 +|ComponentLinks|✗|OAS3 +|ComponentCallbacks|✗|OAS3 +|ComponentPathItems|✗|OAS3 |Api|✓|ToolingExtension ### Global Feature | Name | Supported | Defined By | | ---- | --------- | ---------- | -|Host|✓|OAS2,OAS3 -|BasePath|✓|OAS2,OAS3 |Info|✓|OAS2,OAS3 -|Schemes|✗|OAS2,OAS3 -|PartialSchemes|✓|OAS2,OAS3 -|Consumes|✓|OAS2 -|Produces|✓|OAS2 -|ExternalDocumentation|✓|OAS2,OAS3 -|Examples|✓|OAS2,OAS3 -|XMLStructureDefinitions|✗|OAS2,OAS3 -|MultiServer|✗|OAS3 -|ParameterizedServer|✓|OAS3 -|ParameterStyling|✓|OAS3 -|Callbacks|✗|OAS3 -|LinkObjects|✗|OAS3 +|Servers|✓|OAS3 +|Paths|✓|OAS2,OAS3 +|Webhooks|✗|OAS3 +|Components|✓|OAS3 +|Security|✓|OAS2,OAS3 +|Tags|✓|OAS2,OAS3 +|ExternalDocs|✗|OAS2,OAS3 + +### Operation Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Responses_HttpStatusCode|✓|OAS3 +|Responses_RangedResponseCodes|✓|OAS3 +|Responses_Default|✓|OAS3 +|Responses_RedirectionResponse|✓|OAS3 ### Parameter Feature | Name | Supported | Defined By | | ---- | --------- | ---------- | -|Path|✓|OAS2,OAS3 -|Query|✓|OAS2,OAS3 -|Header|✓|OAS2,OAS3 -|Body|✓|OAS2 -|FormUnencoded|✓|OAS2 -|FormMultipart|✓|OAS2 -|Cookie|✗|OAS3 - -### Schema Support Feature +|Name|✓|OAS2,OAS3 +|Required|✓|OAS2,OAS3 +|In_Path|✓|OAS2,OAS3 +|In_Query|✓|OAS2,OAS3 +|In_Header|✓|OAS2,OAS3 +|In_Cookie|✗|OAS3 +|Style_Matrix|✓|OAS3 +|Style_Label|✓|OAS3 +|Style_Form|✓|OAS3 +|Style_Simple|✓|OAS3 +|Style_SpaceDelimited|✓|OAS3 +|Style_PipeDelimited|✓|OAS3 +|Style_DeepObject|✗|OAS3 +|Explode|✓|OAS3 +|Schema|✓|OAS3 +|Content|✓|OAS3 + +### Schema Feature | Name | Supported | Defined By | | ---- | --------- | ---------- | -|Simple|✓|OAS2,OAS3 -|Composite|✓|OAS2,OAS3 -|Polymorphism|✓|OAS2,OAS3 -|Union|✓|OAS3 -|allOf|✓|OAS2,OAS3 -|anyOf|✓|OAS3 -|oneOf|✓|OAS3 -|not|✓|OAS3 +|AdditionalProperties|✓|OAS2,OAS3 +|AllOf|✓|OAS2,OAS3 +|AnyOf|✓|OAS3 +|Default|✓|OAS2,OAS3 +|Discriminator|✓|OAS2,OAS3 +|Enum|✓|OAS2,OAS3 +|ExclusiveMinimum|✓|OAS2,OAS3 +|ExclusiveMaximum|✓|OAS2,OAS3 +|Format|✓|OAS2,OAS3 +|Items|✓|OAS2,OAS3 +|MaxItems|✓|OAS2,OAS3 +|MaxLength|✓|OAS2,OAS3 +|MaxProperties|✓|OAS2,OAS3 +|Maximum|✓|OAS2,OAS3 +|MinItems|✓|OAS2,OAS3 +|MinLength|✓|OAS2,OAS3 +|MinProperties|✓|OAS2,OAS3 +|Minimum|✓|OAS2,OAS3 +|MultipleOf|✓|OAS2,OAS3 +|Not|✓|OAS3 +|Nullable|✓|OAS3 +|OneOf|✓|OAS3 +|Pattern|✓|OAS2,OAS3 +|Properties|✓|OAS2,OAS3 +|Required|✓|OAS2,OAS3 +|Type|✓|OAS2,OAS3 +|UniqueItems|✓|OAS2,OAS3 +|Xml|✗|OAS2,OAS3 ### Security Feature | Name | Supported | Defined By | | ---- | --------- | ---------- | -|BasicAuth|✓|OAS2,OAS3 +|HTTP_Basic|✓|OAS2,OAS3 |ApiKey|✓|OAS2,OAS3 |OpenIDConnect|✗|OAS3 -|BearerToken|✓|OAS3 -|OAuth2_Implicit|✓|OAS2,OAS3 +|HTTP_Bearer|✓|OAS2,OAS3 +|OAuth2_Implicit|✗|OAS2,OAS3 |OAuth2_Password|✗|OAS2,OAS3 |OAuth2_ClientCredentials|✗|OAS2,OAS3 |OAuth2_AuthorizationCode|✗|OAS2,OAS3 diff --git a/docs/global-properties.md b/docs/global-properties.md index c2c0aab6478..543d9d2f986 100644 --- a/docs/global-properties.md +++ b/docs/global-properties.md @@ -13,7 +13,7 @@ title: Global Properties | debugSupportingFiles | Dumps JSON formatted Supporting File information during generation | none | | verbose | Defines the verbosity | `true` or `false` | | generateAliasAsModel | Defines whether primitive types defined at the model/schema level will be wrapped in a model | `true` or `false` | -| org.openapitools.codegen.utils.oncelogger.enabled | Enable/disable the "OnceLogger" which reduces noise for select repeated logs | `true` or `false` | +| org.openapijsonschematools.codegen.utils.oncelogger.enabled | Enable/disable the "OnceLogger" which reduces noise for select repeated logs | `true` or `false` | | supportingFiles | Allows the user to define which supporting files will be generated. Prefer using the more robust `.openapi-generator-ignore`. | no value, or a comma-separated string of file names | | models | Allows the user to define which models will be generated. Prefer using the more robust `.openapi-generator-ignore`. | no value, or a comma-separated string of model names | | apis | Allows the user to define which apis will be generated. Prefer using the more robust `.openapi-generator-ignore`. | no value, or a comma-separated string of api names | diff --git a/docs/installation.md b/docs/installation.md index cd30e07eb75..7a2188dbd91 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -12,11 +12,11 @@ Some of the following are cross-platform options and some are not, these are cal > **Platform(s)**: Linux, macOS, Windows -The [npm package wrapper](https://github.com/openapitools/openapi-generator-cli) is cross-platform wrapper around the .jar artifact. It works by providing a CLI wrapper atop the JAR's command line options. This gives a simple interface layer which normalizes usage of the command line across operating systems, removing some differences in how options or switches are passed to the tool (depending on OS). +The [npm package wrapper](https://github.com/openapi-json-schema-tools/openapi-json-schema-generator-cli) is cross-platform wrapper around the .jar artifact. It works by providing a CLI wrapper atop the JAR's command line options. This gives a simple interface layer which normalizes usage of the command line across operating systems, removing some differences in how options or switches are passed to the tool (depending on OS). **Install** the latest version of the tool globally, exposing the CLI on the command line: ```bash -npm install @openapitools/openapi-generator-cli -g +npm install @openapi-json-schema-tools/openapi-json-schema-generator-cli -g ``` To install a specific version of the tool, pass the version during installation: @@ -28,12 +28,12 @@ openapi-generator-cli version-manager set 5.3.0 To install the tool as a dev dependency in your current project: ```bash -npm install @openapitools/openapi-generator-cli -D +npm install @openapi-json-schema-tools/openapi-json-schema-generator-cli -D ``` -Then, **generate** a ruby client from a valid [petstore.yaml](https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml) doc: +Then, **generate** a ruby client from a valid [petstore.yaml](https://raw.githubusercontent.com/openapi-json-schema-tools/openapi-json-schema-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml) doc: ```bash -npx @openapitools/openapi-generator-cli generate -i petstore.yaml -g ruby -o /tmp/test/ +npx @openapi-json-schema-tools/openapi-json-schema-generator-cli generate -i petstore.yaml -g ruby -o /tmp/test/ ``` > `npx` will execute a globally available `openapi-generator`, and if not found it will fall back to project-local commands. The result is that the above command will work regardless of which installation method you've chosen. @@ -48,7 +48,7 @@ npx @openapitools/openapi-generator-cli generate -i petstore.yaml -g ruby -o /tm brew install openapi-generator ``` -Then, **generate** a ruby client from a valid [petstore.yaml](https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml) doc: +Then, **generate** a ruby client from a valid [petstore.yaml](https://raw.githubusercontent.com/openapi-json-schema-tools/openapi-json-schema-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml) doc: ```bash openapi-generator generate -i petstore.yaml -g ruby -o /tmp/test/ @@ -71,7 +71,7 @@ scoop bucket add java scoop install openjdk ``` -Then, **generate** a ruby client from a valid [petstore.yaml](https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml) doc: +Then, **generate** a ruby client from a valid [petstore.yaml](https://raw.githubusercontent.com/openapi-json-schema-tools/openapi-json-schema-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml) doc: ``` openapi-generator-cli generate -i petstore.yaml -g ruby @@ -83,14 +83,14 @@ openapi-generator-cli generate -i petstore.yaml -g ruby The OpenAPI Generator Docker image acts as a standalone executable. It can be used as an alternative to installing via homebrew, or for developers who are unable to install Java or upgrade the installed version. -To generate code from a valid [petstore.yaml](https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml) doc with this image, you'll need to mount a local location as a volume. +To generate code from a valid [petstore.yaml](https://raw.githubusercontent.com/openapi-json-schema-tools/openapi-json-schema-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml) doc with this image, you'll need to mount a local location as a volume. You'll then need to output the generated code to this mapped volume. Everything else works the same as if you ran the command on your host machine. Here's an example generating a Go client: ```bash docker run --rm \ - -v ${PWD}:/local openapitools/openapi-generator-cli generate \ + -v ${PWD}:/local openapi-json-schema-tools/openapi-json-schema-generator-cli generate \ -i /local/petstore.yaml \ -g go \ -o /local/out/go @@ -103,18 +103,18 @@ docker run --rm \ If you're looking for the latest stable version, you can grab it directly from Maven.org (Java 8 runtime at a minimum): -JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/6.1.0/openapi-generator-cli-6.1.0.jar` +JAR location: `https://repo1.maven.org/maven2/org/openapi-json-schema-tools/openapi-json-schema-generator-cli/6.1.0/openapi-generator-cli-6.1.0.jar` For **Mac/Linux** users: ```bash -wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/6.1.0/openapi-generator-cli-6.1.0.jar -O openapi-generator-cli.jar +wget https://repo1.maven.org/maven2/org/openapi-json-schema-tools/openapi-json-schema-generator-cli/6.1.0/openapi-generator-cli-6.1.0.jar -O openapi-generator-cli.jar ``` For **Windows** users, you will need to install [wget](http://gnuwin32.sourceforge.net/packages/wget.htm) or you can use Invoke-WebRequest in PowerShell (3.0+), e.g. ```powershell -Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/6.1.0/openapi-generator-cli-6.1.0.jar +Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapi-json-schema-tools/openapi-json-schema-generator-cli/6.1.0/openapi-generator-cli-6.1.0.jar ``` @@ -138,10 +138,10 @@ To install the launcher script, copy the contents of the script to a location on An example of setting this up (NOTE: Always evaluate scripts curled from external systems before executing them). ```bash -mkdir -p ~/bin/openapitools -curl https://raw.githubusercontent.com/OpenAPITools/openapi-generator/master/bin/utils/openapi-generator-cli.sh > ~/bin/openapitools/openapi-generator-cli -chmod u+x ~/bin/openapitools/openapi-generator-cli -export PATH=$PATH:~/bin/openapitools/ +mkdir -p ~/bin/openapijsonschematools +curl https://raw.githubusercontent.com/OpenAPITools/openapi-generator/master/bin/utils/openapi-generator-cli.sh > ~/bin/openapi-json-schema-tools/openapi-json-schema-generator-cli +chmod u+x ~/bin/openapi-json-schema-tools/openapi-json-schema-generator-cli +export PATH=$PATH:~/bin/openapijsonschematools/ ``` Now, `openapi-generator-cli` is "installed". On invocation, it will query the GitHub repository for the most recently released version. If this matches the last downloaded jar, diff --git a/docs/integration.md b/docs/integration.md index e96b62321cf..a00c2856a96 100644 --- a/docs/integration.md +++ b/docs/integration.md @@ -55,4 +55,4 @@ cd /var/tmp/perl/petstore Some generators also generate CI/CD configuration files (.travis.yml) so that the output will be ready to be tested by the CI (e.g. Travis) -If you're looking for the configuration files of a particular CI that is not yet supported, please open an [issue](https://github.com/openapitools/openapi-generator/issues/new) to let us know. +If you're looking for the configuration files of a particular CI that is not yet supported, please open an [issue](https://github.com/openapi-json-schema-tools/openapi-json-schema-generator/issues/new) to let us know. diff --git a/docs/migration-from-swagger-codegen.md b/docs/migration-from-swagger-codegen.md index 85232ebb91b..748f88e90eb 100644 --- a/docs/migration-from-swagger-codegen.md +++ b/docs/migration-from-swagger-codegen.md @@ -26,7 +26,7 @@ This guide explains the major differences in order to help you with the migratio ## New docker images -The docker images are available on DockerHub: https://hub.docker.com/u/openapitools/ +The docker images are available on DockerHub: https://hub.docker.com/u/openapijsonschematools/ **CLI for OpenAPI Generator** @@ -34,15 +34,7 @@ Image to run OpenAPI Generator in the command line (see [OpenAPI Generator CLI D Old: `swaggerapi/swagger-codegen-cli` -New: `openapitools/openapi-generator-cli` - -**OpenAPI Generator as web service** - -Image to run OpenAPI Generator as a web service (see [OpenAPI Generator Online Docker Image](https://github.com/OpenAPITools/openapi-generator/blob/master/README.md#openapi-generator-online-docker-image)) - -Old: `swaggerapi/swagger-generator` - -New: `openapitools/openapi-generator-online` +New: `openapi-json-schema-tools/openapi-json-schema-generator-cli` ## New maven coordinates @@ -64,7 +56,7 @@ New: ```xml - org.openapitools + org.openapijsonschematools openapi-generator ``` @@ -82,7 +74,7 @@ New: ```xml - org.openapitools + org.openapijsonschematools openapi-generator-cli ``` @@ -100,7 +92,7 @@ New: ```xml - org.openapitools + org.openapijsonschematools openapi-generator-maven-plugin ``` @@ -173,17 +165,17 @@ The metadata folder (to store the `VERSION` file for example) is now called `.op If you use a generator without specifying each parameter, you might see some differences in the generated code. As example the default package name used in the generated code has changed. -You need to have a look at the specific value, depending of your target language, but often `Swagger` îs replaced by `OpenAPITools` and `io.swagger` is replaced by `org.openapitools`. -Concretely if you did not specify anything when you are generating java code, a file `org/openapitools/api/PetApi.java` might be generated instead of `io/swagger/api/PetApi.java`. +You need to have a look at the specific value, depending of your target language, but often `Swagger` îs replaced by `OpenAPITools` and `io.swagger` is replaced by `org.openapijsonschematools`. +Concretely if you did not specify anything when you are generating java code, a file `org/openapijsonschematools/api/PetApi.java` might be generated instead of `io/swagger/api/PetApi.java`. If this is a problem for you, you need to explicitly set the the parameter value in order to match with the `swagger-codgen` default value (`apiPackage` == `io.swagger` in the previous example with the java generator). ## New fully qualified name for the classes -If you have extended some generators in your project, and you are looking for a specific class, replace the `io.swagger.codegen` package (old name) with `org.openapitools.codegen` package (new name). +If you have extended some generators in your project, and you are looking for a specific class, replace the `io.swagger.codegen` package (old name) with `org.openapijsonschematools.codegen` package (new name). -Example: `org.openapitools.codegen.DefaultGenerator` +Example: `DefaultGenerator` ## Body parameter name diff --git a/docs/migration-guide.adoc b/docs/migration-guide.adoc index 91c5b074bb1..26f88c3fa2d 100644 --- a/docs/migration-guide.adoc +++ b/docs/migration-guide.adoc @@ -59,7 +59,7 @@ If you want to switch back to the `3.1.x` behavior you can use: ==== Model (all languages) -In `CodegenModel` and in `CodegenOperation` we use now our own class `org.openapitools.codegen.CodegenDiscriminator` instead of `io.swagger.v3.oas.models.media.Discriminator`. +In `CodegenModel` and in `CodegenOperation` we use now our own class `CodegenDiscriminator` instead of `io.swagger.v3.oas.models.media.Discriminator`. For the templates, this is not an API change, because the same values are available. diff --git a/docs/new-generator.md b/docs/new-generator.md index ad1f77039d4..a4ab8c3016c 100644 --- a/docs/new-generator.md +++ b/docs/new-generator.md @@ -10,13 +10,13 @@ Creating a new generator which will become a part of the officially supported ge The minimum set of files required to create a new generator are: * A "Codegen" file - - exists under `modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/` + - exists under `modules/openapi-generator/src/main/java/org/openapijsonschematools/codegen/languages/` - defines language options - defines framework options - determines OpenAPI feature set - extends the generation workflow * SPI registration - - Above class must be referenced in `modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig` + - Above class must be referenced in `modules/openapi-generator/src/main/resources/META-INF/services/CodegenConfig` - Tells the generator that this class exists - Allows for classpath extension (addition) of generators * A minimal template @@ -53,7 +53,7 @@ Examples: ./new.sh -n kotlin -s Creates: - modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinServerCodegen.java + modules/openapi-generator/src/main/java/org/openapijsonschematools/codegen/languages/KotlinServerCodegen.java modules/openapi-generator/src/main/resources/kotlin-server/README.mustache modules/openapi-generator/src/main/resources/kotlin-server/model.mustache modules/openapi-generator/src/main/resources/kotlin-server/api.mustache @@ -62,15 +62,15 @@ Examples: Create a generic C# server generator: ./new.sh -n csharp -s -t Creates: - modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CsharpServerCodegen.java + modules/openapi-generator/src/main/java/org/openapijsonschematools/codegen/languages/CsharpServerCodegen.java modules/openapi-generator/src/main/resources/csharp-server/README.mustache modules/openapi-generator/src/main/resources/csharp-server/model.mustache modules/openapi-generator/src/main/resources/csharp-server/api.mustache bin/configs/csharp-server-petstore-new.yaml - modules/openapi-generator/src/test/java/org/openapitools/codegen/csharp/CsharpServerCodegenTest.java - modules/openapi-generator/src/test/java/org/openapitools/codegen/csharp/CsharpServerCodegenModelTest.java - modules/openapi-generator/src/test/java/org/openapitools/codegen/csharp/CsharpServerCodegenOptionsTest.java - modules/openapi-generator/src/test/java/org/openapitools/codegen/options/CsharpServerCodegenOptionsProvider.java + modules/openapi-generator/src/test/java/org/openapijsonschematools/codegen/csharp/CsharpServerCodegenTest.java + modules/openapi-generator/src/test/java/org/openapijsonschematools/codegen/csharp/CsharpServerCodegenModelTest.java + modules/openapi-generator/src/test/java/org/openapijsonschematools/codegen/csharp/CsharpServerCodegenOptionsTest.java + modules/openapi-generator/src/test/java/org/openapijsonschematools/codegen/options/CsharpServerCodegenOptionsProvider.java ``` This script allows us to define a client, server, schema, or documentation generator. We'll focus on the simplest generator (documentation). The other generator types may require heavy extension of the "Config" base class, and these docs could very quickly become outdated. When creating a new generator, please review existing generators as a guideline for implementation. @@ -84,7 +84,7 @@ Create a new Markdown generator, specifying CommonMark as the name to avoid conf You should see output similar to the following: ```bash -Creating modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CommonMarkDocumentationCodegen.java +Creating modules/openapi-generator/src/main/java/org/openapijsonschematools/codegen/languages/CommonMarkDocumentationCodegen.java Creating modules/openapi-generator/src/main/resources/common-mark-documentation/README.mustache Creating modules/openapi-generator/src/main/resources/common-mark-documentation/model.mustache Creating modules/openapi-generator/src/main/resources/common-mark-documentation/api.mustache @@ -309,10 +309,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- {{#parent}} {{#parentVars}} -**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#readOnly}}[readonly] {{/readOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} +**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{refClass}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#readOnly}}[readonly] {{/readOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} {{/parentVars}} {{/parent}} -{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#readOnly}}[readonly] {{/readOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} +{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{refClass}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#readOnly}}[readonly] {{/readOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} {{/vars}} [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/online.md b/docs/online.md deleted file mode 100644 index 3c86b1acd14..00000000000 --- a/docs/online.md +++ /dev/null @@ -1,142 +0,0 @@ ---- -id: online -title: Online ---- - -## Hosted - -We offer online services, publicly and free of charge: - -- latest stable version: http://api.openapi-generator.tech -- latest master: http://api-latest-master.openapi-generator.tech (updated with latest master every hour) - -> **Hosting Sponsor** -> [![Linode Logo](https://www.linode.com/media/images/logos/standard/light/linode-logo_standard_light_small.png)](https://www.linode.com/) - -These services are beta and do not have any guarantee on service level - -## Docker Image - -The openapi-generator-online Docker image can act as a self-hosted web application and API for generating code. This container can be incorporated into a CI pipeline, and requires at least two HTTP requests and some docker orchestration to access generated code. - -Example usage: - -```bash -# Start container at port 8888 and save the container id -CID=$(docker run -d -p 8888:8080 openapitools/openapi-generator-online) - -# allow for startup -sleep 10 - -# Get the IP of the running container (optional) -GEN_IP=$(docker inspect --format '{{.NetworkSettings.IPAddress}}' ${CID}) - -# Execute an HTTP request to generate a Ruby client -curl -X POST --header 'Content-Type: application/json' \ - --header 'Accept: application/json' \ - -d '{"openAPIUrl": "https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml"}' \ - 'http://localhost:8888/api/gen/clients/ruby' - -# Example output: -# {"code":"c2d483.3.4672-40e9-91df-b9ffd18d22b8","link":"http://localhost:8888/api/gen/download/c2d483.3.4672-40e9-91df-b9ffd18d22b8"} - -# Download the generated zip file (using "code" provided from your output) -wget http://localhost:8888/api/gen/download/c2d483.3.4672-40e9-91df-b9ffd18d22b8 - -# Unzip the file -unzip c2d483.3.4672-40e9-91df-b9ffd18d22b8 - -# Shutdown the openapi generator image -docker stop ${CID} && docker rm ${CID} -``` - -## Local/Self-hosting - -If you prefer to run the service locally, here are the steps: - -```bash -mvn clean install -cd modules/openapi-generator-online -mvn spring-boot:run -``` - -> The online openapi-generator can be run via [Docker](#docker-image) as well. - -For example, to generate Ruby API client, simply send the following HTTP request using curl: - -```bash -curl -X POST -H "content-type:application/json" -d '{"openAPIUrl":"https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml"}' \ - http://localhost:8080/api/gen/clients/ruby -``` -Then you will receive a JSON response with the URL to download the zipped code. - -To customize the SDK, you can `POST` to `http://localhost:8080/gen/clients/{generator}` with the following HTTP body: - -```json -{ - "options": {}, - "openAPIUrl": "https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml" -} -``` - -Here, the `options` for a language can be obtained by submitting a `GET` request to `http://locahost:8080/api/gen/clients/{generator}`: - -For example, `curl http://localhost:8080/api/gen/clients/python` returns - -```json - "packageName":{ - "opt":"packageName", - "description":"python package name (convention: snake_case).", - "type":"string", - "default":"openapi_client" - }, - "packageVersion":{ - "opt":"packageVersion", - "description":"python package version.", - "type":"string", - "default":"1.0.0" - }, - "sortParamsByRequiredFlag":{ - "opt":"sortParamsByRequiredFlag", - "description":"Sort method arguments to place required parameters before optional parameters.", - "type":"boolean", - "default":"true" - } - -{} -``` - -To set package name to `pet_store`, the HTTP body of the request is as follows: - -```json -{ - "options": { - "packageName": "pet_store" - }, - "openAPIUrl": "https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml" -} -``` - -and here is the curl command: -```bash -curl -H "Content-type: application/json" \ - -X POST \ - -d '{"options": {"packageName": "pet_store"},"openAPIUrl": "https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml"}' \ - http://localhost:8080/api/gen/clients/python -``` - -Instead of using `openAPIUrl` with an URL to the OpenAPI spec, one can include the spec in the JSON payload with `spec`: - -```json -{ - "options": {}, - "spec": { - "swagger": "2.0", - "info": { - "version": "1.0.0", - "title": "Test API" - }, - ... - } -} -``` diff --git a/docs/plugins.md b/docs/plugins.md index f4586135cdb..e9acacb50f0 100644 --- a/docs/plugins.md +++ b/docs/plugins.md @@ -13,7 +13,7 @@ Add to your `build->plugins` section (default phase is `generate-sources` phase) ```xml - org.openapitools + org.openapijsonschematools openapi-generator-maven-plugin 6.0.0 @@ -78,7 +78,7 @@ buildscript { maven { url "https://repo1.maven.org/maven2" } } dependencies { - classpath "org.openapitools:openapi-generator-gradle-plugin:5.0.0" + classpath "org.openapijsonschematools:openapi-generator-gradle-plugin:5.0.0" } } diff --git a/docs/templating.md b/docs/templating.md index d1bdd81a738..e0f9d8c5bfd 100644 --- a/docs/templating.md +++ b/docs/templating.md @@ -7,11 +7,11 @@ It's easy to work with templates for codegen! For maybe 90% of use cases, you will only need to modify the mustache template files to create your own custom generated code. If you need to include additional files in your generated output, manipulate the OpenAPI document inputs, or implement your own vendor extensions or other logic, you'll want to read [customization](./customization.md) after you read this document. Be sure to start here first, because templating is the easier concept and you'll need it for more advanced use cases. -The generator workflow has [transforming logic](https://github.com/openapitools/openapi-generator/tree/master/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages) as well as templates for each generation of code. +The generator workflow has [transforming logic](https://github.com/openapi-json-schema-tools/openapi-json-schema-generator/tree/master/modules/openapi-generator/src/main/java/org/openapijsonschematools/codegen/languages) as well as templates for each generation of code. -Each generator will create a data structure from the OpenAPI document; OpenAPI 2.0 and OpenAPI 3.x documents are normalized into the same API model within the generator. This model is then applied to the templates. While generators do not need to perform transformations, it's often necessary in order to add more advanced support for your language or framework. You may need to refer to the generator implementation to understand some of the logic while creating or customizing templates (see [ScalaFinchServerCodegen.java](https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaFinchServerCodegen.java) for an advanced example). +Each generator will create a data structure from the OpenAPI document; OpenAPI 2.0 and OpenAPI 3.x documents are normalized into the same API model within the generator. This model is then applied to the templates. While generators do not need to perform transformations, it's often necessary in order to add more advanced support for your language or framework. You may need to refer to the generator implementation to understand some of the logic while creating or customizing templates (see [ScalaFinchServerCodegen.java](https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/java/org/openapijsonschematools/codegen/languages/ScalaFinchServerCodegen.java) for an advanced example). -The transform logic needs to implement [CodegenConfig.java](https://github.com/openapitools/openapi-generator/blob/master/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConfig.java) and is most easily done by extending [DefaultCodegen.java](https://github.com/openapitools/openapi-generator/blob/master/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java). Take a look at the various implementations as a guideline while the instructions get more complete. +The transform logic needs to implement [CodegenConfig.java](https://github.com/openapi-json-schema-tools/openapi-json-schema-generator/blob/master/modules/openapi-generator/src/main/java/org/openapijsonschematools/codegen/CodegenConfig.java) and is most easily done by extending [DefaultCodegen.java](https://github.com/openapi-json-schema-tools/openapi-json-schema-generator/blob/master/modules/openapi-generator/src/main/java/org/openapijsonschematools/codegen/DefaultCodegen.java). Take a look at the various implementations as a guideline while the instructions get more complete. ## Modifying Templates @@ -39,11 +39,11 @@ OpenAPI Generator not only supports local files for templating, but also templat │   └── style.css.mustache ``` -You can define your classpath to contain your JAR and the openapi-generator-cli _fat jar_, then invoke main class `org.openapitools.codegen.OpenAPIGenerator`. For instance, +You can define your classpath to contain your JAR and the openapi-generator-cli _fat jar_, then invoke main class `OpenAPIGenerator`. For instance, ```bash java -cp /path/totemplate-classpath-example-1.0-SNAPSHOT.jar:modules/openapi-generator-cli/target/openapi-generator-cli.jar \ - org.openapitools.codegen.OpenAPIGenerator generate \ + OpenAPIGenerator generate \ -i https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v3.0/petstore.yaml \ -g html -o template-example -t templates/htmlDocs ``` @@ -247,7 +247,7 @@ Now we're ready to generate the client with our simple changes. When we pass the openapi-generator generate -g java --library resteasy \ -t ~/.openapi-generator/templates/Java \ -o ~/.openapi-generator/example \ - -i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml + -i https://raw.githubusercontent.com/openapi-json-schema-tools/openapi-json-schema-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml ``` Make sure your custom template compiles: @@ -302,7 +302,7 @@ appender.rolling.policies.size.size=100MB appender.rolling.strategy.type = DefaultRolloverStrategy appender.rolling.strategy.max = 5 -logger.rolling.name = org.openapitools.client.api.PetApi +logger.rolling.name = org.openapijsonschematools.client.api.PetApi logger.rolling.level = debug logger.rolling.additivity = false logger.rolling.appenderRef.rolling.ref = RollingFile @@ -330,7 +330,7 @@ This example: * requires Gradle 5.0+ * provides project setup instructions for IntelliJ -To begin, create a [new Gradle project](https://www.jetbrains.com/help/idea/getting-started-with-gradle.html) with Kotlin support. To do this, go to `File` ➞ `New` ➞ `Project`, choose "Gradle" and "Kotlin". Specify groupId `org.openapitools.examples` and artifactId `pebble-template-adapter`. +To begin, create a [new Gradle project](https://www.jetbrains.com/help/idea/getting-started-with-gradle.html) with Kotlin support. To do this, go to `File` ➞ `New` ➞ `Project`, choose "Gradle" and "Kotlin". Specify groupId `org.openapijsonschematools.examples` and artifactId `pebble-template-adapter`. Ensure the new project uses Gradle 5.0. Navigate to the newly created directory and execute: @@ -350,7 +350,7 @@ Modifications to the new project's `build.gradle` should be made in the `plugins dependencies { compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8" - compile "org.openapitools:openapi-generator-core:4.0.0-SNAPSHOT" + compile "org.openapijsonschematools:openapi-generator-core:4.0.0-SNAPSHOT" compile "io.pebbletemplates:pebble:3.0.8" } ``` @@ -363,9 +363,9 @@ The class in its simplest form looks like this (with inline comments): ```kotlin // Allows specifying engine by class name -// e.g. -e org.openapitools.examples.templating.PebbleTemplateAdapter +// e.g. -e org.openapijsonschematools.examples.templating.PebbleTemplateAdapter @file:JvmName("PebbleTemplateAdapter") -package org.openapitools.examples.templating +package org.openapijsonschematools.examples.templating // imports @@ -402,10 +402,10 @@ class PebbleTemplateAdapter : AbstractTemplatingEngineAdapter() { } ``` -Lastly, create a file `resources/META-INF/services/org.openapitools.codegen.api.TemplatingEngineAdapter`, containing the full class path to the above class: +Lastly, create a file `resources/META-INF/services/TemplatingEngineAdapter`, containing the full class path to the above class: ``` -org.openapitools.examples.templating.PebbleTemplateAdapter +org.openapijsonschematools.examples.templating.PebbleTemplateAdapter ``` This allows the adapter to load via ServiceLoader, and to be referenced via the identifier `pebble`. This is optional; if you don't provide the above file and contents, you'll only be able to load the engine via full class name (explained in a bit). @@ -462,7 +462,7 @@ Finally, we can compile some code by explicitly defining our classpath and jar e ```bash java $JAVA_OPTS -cp /your/path/build/libs/pebble-template-adapter-1.0-SNAPSHOT-all.jar:modules/openapi-generator-cli/target/openapi-generator-cli.jar \ - org.openapitools.codegen.OpenAPIGenerator \ + OpenAPIGenerator \ generate \ -g go \ -i https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v2.0/json/petstore-minimal.json \ @@ -474,7 +474,7 @@ java $JAVA_OPTS -cp /your/path/build/libs/pebble-template-adapter-1.0-SNAPSHOT-a **NOTE** Running your custom generator requires adding it to the classpath. This differs on [Windows](https://docs.oracle.com/javase/8/docs/technotes/tools/windows/classpath.html) slightly from [unix](https://docs.oracle.com/javase/8/docs/technotes/tools/unix/classpath.html). -In the above example, we've targeted our custom template engine adapter via `-e pebble`. If you don't include the SPI file under `META-INF/services`, you'll need to specify the exact classpath: `org.openapitools.examples.templating.PebbleTemplateAdapter`. Notice that the target class here matches the Kotlin class name. This is because of the `@file:JvmName` annotation. +In the above example, we've targeted our custom template engine adapter via `-e pebble`. If you don't include the SPI file under `META-INF/services`, you'll need to specify the exact classpath: `org.openapijsonschematools.examples.templating.PebbleTemplateAdapter`. Notice that the target class here matches the Kotlin class name. This is because of the `@file:JvmName` annotation. Congratulations on creating a custom templating engine adapter! @@ -807,7 +807,7 @@ Supporting files can either be processed through the templating engine or copied > This is a very limited list of variable name explanations. Feel free to [open a pull request](https://github.com/OpenAPITools/openapi-generator/pull/new/master) to add to this documentation! -- **complexType**: stores the name of the model (e.g. Pet) +- **refClass**: stores the name of the model (e.g. Pet) - **isContainer**: true if the parameter or property is an array or a map. - **isPrimitiveType**: true if the parameter or property type is a primitive type (e.g. string, integer, etc) as defined in the spec. diff --git a/docs/usage.md b/docs/usage.md index d6a976fa30a..dc5b649b414 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -206,7 +206,7 @@ OPTIONS -p , --package the package to put the main class into (defaults to - org.openapitools.codegen) + org.openapijsonschematools.codegen) -t , --type the type of generator that is created @@ -384,7 +384,7 @@ OPTIONS Git repo ID, e.g. openapi-generator. --git-user-id - Git user ID, e.g. openapitools. + Git user ID, e.g. openapijsonschematools. --global-property sets specified global properties (previously called 'system @@ -520,7 +520,7 @@ At a minimum, `generate` requires: ### Examples -The following examples use [petstore.yaml](https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml). +The following examples use [petstore.yaml](https://raw.githubusercontent.com/openapi-json-schema-tools/openapi-json-schema-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml). #### Additional Properties @@ -560,7 +560,7 @@ openapi-generator-cli generate \ --type-mappings=DateTime=java.time.LocalDateTime ``` -> NOTE: mappings are applied to `DateTime`, as this is the representation of the primitive type. See [DefaultCodegen](https://github.com/OpenAPITools/openapi-generator/blob/7cee999543fcc00b7c1eb9f70f0456b707c7f9e2/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java#L1431). +> NOTE: mappings are applied to `DateTime`, as this is the representation of the primitive type. See [DefaultCodegen](https://github.com/OpenAPITools/openapi-generator/blob/7cee999543fcc00b7c1eb9f70f0456b707c7f9e2/modules/openapi-generator/src/main/java/org/openapijsonschematools/codegen/DefaultCodegen.java#L1431). #### File Post-Processing diff --git a/modules/openapi-json-schema-generator-cli/pom.xml b/modules/openapi-json-schema-generator-cli/pom.xml index 586c505c6ac..d47a802d896 100644 --- a/modules/openapi-json-schema-generator-cli/pom.xml +++ b/modules/openapi-json-schema-generator-cli/pom.xml @@ -1,7 +1,7 @@ - org.openapitools + org.openapijsonschematools openapi-json-schema-generator-project ${revision} ../.. @@ -38,7 +38,7 @@ - org.openapitools.codegen.OpenAPIGenerator + org.openapijsonschematools.codegen.OpenAPIGenerator @@ -109,7 +109,7 @@ - org.openapitools + org.openapijsonschematools openapi-json-schema-generator ${project.version} diff --git a/modules/openapi-json-schema-generator-cli/src/main/java/org/openapijsonschematools/codegen/Constants.java b/modules/openapi-json-schema-generator-cli/src/main/java/org/openapijsonschematools/codegen/Constants.java new file mode 100644 index 00000000000..0049af363bb --- /dev/null +++ b/modules/openapi-json-schema-generator-cli/src/main/java/org/openapijsonschematools/codegen/Constants.java @@ -0,0 +1,9 @@ +package org.openapijsonschematools.codegen; + +public class Constants { + private Constants(){ } + + public static final String CLI_NAME = "openapi-generator-cli"; + public static final String GIT_REPO = "https://github.com/openapi-json-schema-tools/openapi-json-schema-generator"; + public static final String SITE = "https://openapi-generator.tech/"; +} diff --git a/modules/openapi-json-schema-generator-cli/src/main/java/org/openapitools/codegen/OpenAPIGenerator.java b/modules/openapi-json-schema-generator-cli/src/main/java/org/openapijsonschematools/codegen/OpenAPIGenerator.java similarity index 76% rename from modules/openapi-json-schema-generator-cli/src/main/java/org/openapitools/codegen/OpenAPIGenerator.java rename to modules/openapi-json-schema-generator-cli/src/main/java/org/openapijsonschematools/codegen/OpenAPIGenerator.java index 335b1232de6..d40877ce816 100644 --- a/modules/openapi-json-schema-generator-cli/src/main/java/org/openapitools/codegen/OpenAPIGenerator.java +++ b/modules/openapi-json-schema-generator-cli/src/main/java/org/openapijsonschematools/codegen/OpenAPIGenerator.java @@ -15,33 +15,42 @@ * limitations under the License. */ -package org.openapitools.codegen; +package org.openapijsonschematools.codegen; import io.airlift.airline.Cli; import io.airlift.airline.ParseArgumentsUnexpectedException; import io.airlift.airline.ParseOptionMissingException; import io.airlift.airline.ParseOptionMissingValueException; -import org.openapitools.codegen.cmd.*; +import org.openapijsonschematools.codegen.cmd.AuthorTemplate; +import org.openapijsonschematools.codegen.cmd.BuildInfo; +import org.openapijsonschematools.codegen.cmd.CompletionCommand; +import org.openapijsonschematools.codegen.cmd.ConfigHelp; +import org.openapijsonschematools.codegen.cmd.Generate; +import org.openapijsonschematools.codegen.cmd.GenerateBatch; +import org.openapijsonschematools.codegen.cmd.HelpCommand; +import org.openapijsonschematools.codegen.cmd.ListGenerators; +import org.openapijsonschematools.codegen.cmd.Meta; +import org.openapijsonschematools.codegen.cmd.OpenApiGeneratorCommand; +import org.openapijsonschematools.codegen.cmd.Validate; +import org.openapijsonschematools.codegen.cmd.Version; import java.util.Locale; -import static org.openapitools.codegen.Constants.CLI_NAME; - /** * User: lanwen Date: 24.03.15 Time: 17:56 *

    - * Command line interface for OpenAPI Generator use `openapi-generator-cli.jar help` for more info + * Command line interface for OpenAPI JSON Schema Generator use `openapi-generator-cli.jar help` for more info */ public class OpenAPIGenerator { public static void main(String[] args) { BuildInfo buildInfo = new BuildInfo(); Cli.CliBuilder builder = - Cli.builder(CLI_NAME) + Cli.builder(Constants.CLI_NAME) .withDescription( String.format( Locale.ROOT, - "OpenAPI Generator CLI %s (%s).", + "OpenAPI JSON Schema Generator CLI %s (%s).", buildInfo.getVersion(), buildInfo.getSha())) .withDefaultCommand(HelpCommand.class) @@ -76,7 +85,7 @@ public static void main(String[] args) { System.exit(1); } } catch (ParseArgumentsUnexpectedException e) { - System.err.printf(Locale.ROOT, "[error] %s%n%nSee '%s help' for usage.%n", e.getMessage(), CLI_NAME); + System.err.printf(Locale.ROOT, "[error] %s%n%nSee '%s help' for usage.%n", e.getMessage(), Constants.CLI_NAME); System.exit(1); } catch (ParseOptionMissingException | ParseOptionMissingValueException e) { System.err.printf(Locale.ROOT, "[error] %s%n", e.getMessage()); diff --git a/modules/openapi-json-schema-generator-cli/src/main/java/org/openapitools/codegen/cmd/AuthorTemplate.java b/modules/openapi-json-schema-generator-cli/src/main/java/org/openapijsonschematools/codegen/cmd/AuthorTemplate.java similarity index 96% rename from modules/openapi-json-schema-generator-cli/src/main/java/org/openapitools/codegen/cmd/AuthorTemplate.java rename to modules/openapi-json-schema-generator-cli/src/main/java/org/openapijsonschematools/codegen/cmd/AuthorTemplate.java index da02a602463..1c496f1ddd0 100644 --- a/modules/openapi-json-schema-generator-cli/src/main/java/org/openapitools/codegen/cmd/AuthorTemplate.java +++ b/modules/openapi-json-schema-generator-cli/src/main/java/org/openapijsonschematools/codegen/cmd/AuthorTemplate.java @@ -1,11 +1,11 @@ -package org.openapitools.codegen.cmd; +package org.openapijsonschematools.codegen.cmd; import io.airlift.airline.Command; import io.airlift.airline.Option; import org.apache.commons.lang3.StringUtils; -import org.openapitools.codegen.CodegenConfig; -import org.openapitools.codegen.CodegenConfigLoader; -import org.openapitools.codegen.CodegenConstants; +import org.openapijsonschematools.codegen.CodegenConfig; +import org.openapijsonschematools.codegen.CodegenConfigLoader; +import org.openapijsonschematools.codegen.CodegenConstants; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/modules/openapi-json-schema-generator-cli/src/main/java/org/openapitools/codegen/cmd/BuildInfo.java b/modules/openapi-json-schema-generator-cli/src/main/java/org/openapijsonschematools/codegen/cmd/BuildInfo.java similarity index 96% rename from modules/openapi-json-schema-generator-cli/src/main/java/org/openapitools/codegen/cmd/BuildInfo.java rename to modules/openapi-json-schema-generator-cli/src/main/java/org/openapijsonschematools/codegen/cmd/BuildInfo.java index 4058d1208ec..c47581b81bd 100644 --- a/modules/openapi-json-schema-generator-cli/src/main/java/org/openapitools/codegen/cmd/BuildInfo.java +++ b/modules/openapi-json-schema-generator-cli/src/main/java/org/openapijsonschematools/codegen/cmd/BuildInfo.java @@ -1,4 +1,4 @@ -package org.openapitools.codegen.cmd; +package org.openapijsonschematools.codegen.cmd; import java.io.IOException; import java.io.InputStream; @@ -9,7 +9,7 @@ import java.util.Locale; import java.util.Properties; -import static org.openapitools.codegen.Constants.*; +import static org.openapijsonschematools.codegen.Constants.*; /** * Presents build-time information diff --git a/modules/openapi-json-schema-generator-cli/src/main/java/org/openapitools/codegen/cmd/CompletionCommand.java b/modules/openapi-json-schema-generator-cli/src/main/java/org/openapijsonschematools/codegen/cmd/CompletionCommand.java similarity index 98% rename from modules/openapi-json-schema-generator-cli/src/main/java/org/openapitools/codegen/cmd/CompletionCommand.java rename to modules/openapi-json-schema-generator-cli/src/main/java/org/openapijsonschematools/codegen/cmd/CompletionCommand.java index bd67596fa9b..08663e7fda8 100644 --- a/modules/openapi-json-schema-generator-cli/src/main/java/org/openapitools/codegen/cmd/CompletionCommand.java +++ b/modules/openapi-json-schema-generator-cli/src/main/java/org/openapijsonschematools/codegen/cmd/CompletionCommand.java @@ -19,7 +19,7 @@ * https://github.com/airlift/airline/blob/fc7a55e34b6361cb97235de5a1b21cba9b508f4b/src/main/java/io/airlift/airline/SuggestCommand.java#L1 * Modifications have been made to fit the needs of OpenAPI Tools CLI. */ -package org.openapitools.codegen.cmd; +package org.openapijsonschematools.codegen.cmd; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Joiner; diff --git a/modules/openapi-json-schema-generator-cli/src/main/java/org/openapitools/codegen/cmd/ConfigHelp.java b/modules/openapi-json-schema-generator-cli/src/main/java/org/openapijsonschematools/codegen/cmd/ConfigHelp.java similarity index 92% rename from modules/openapi-json-schema-generator-cli/src/main/java/org/openapitools/codegen/cmd/ConfigHelp.java rename to modules/openapi-json-schema-generator-cli/src/main/java/org/openapijsonschematools/codegen/cmd/ConfigHelp.java index 63064146c23..e81eb6e9274 100644 --- a/modules/openapi-json-schema-generator-cli/src/main/java/org/openapitools/codegen/cmd/ConfigHelp.java +++ b/modules/openapi-json-schema-generator-cli/src/main/java/org/openapijsonschematools/codegen/cmd/ConfigHelp.java @@ -15,17 +15,17 @@ * limitations under the License. */ -package org.openapitools.codegen.cmd; +package org.openapijsonschematools.codegen.cmd; import io.airlift.airline.Command; import io.airlift.airline.Option; import org.apache.commons.lang3.StringUtils; -import org.openapitools.codegen.CliOption; -import org.openapitools.codegen.CodegenConfig; -import org.openapitools.codegen.CodegenConfigLoader; -import org.openapitools.codegen.GeneratorNotFoundException; -import org.openapitools.codegen.VendorExtension; -import org.openapitools.codegen.meta.FeatureSet; +import org.openapijsonschematools.codegen.CliOption; +import org.openapijsonschematools.codegen.CodegenConfig; +import org.openapijsonschematools.codegen.CodegenConfigLoader; +import org.openapijsonschematools.codegen.GeneratorNotFoundException; +import org.openapijsonschematools.codegen.VendorExtension; +import org.openapijsonschematools.codegen.meta.FeatureSet; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -68,9 +68,6 @@ public class ConfigHelp extends OpenApiGeneratorCommand { FORMAT_TEXT, FORMAT_MARKDOWN, FORMAT_YAMLSAMPLE}) private String format; - @Option(name = {"--import-mappings"}, title = "import mappings", description = "displays the default import mappings (types and aliases, and what imports they will pull into the template)") - private Boolean importMappings; - @Option(name = {"--schema-mappings"}, title = "schema mappings", description = "display the schema mappings (none)") private Boolean schemaMappings; @@ -119,7 +116,6 @@ public void execute() { instantiationTypes = Boolean.TRUE; reservedWords = Boolean.TRUE; languageSpecificPrimitives = Boolean.TRUE; - importMappings = Boolean.TRUE; featureSets = Boolean.TRUE; metadata = Boolean.TRUE; supportedVendorExtensions = Boolean.TRUE; @@ -234,24 +230,6 @@ private void generateMdSupportedVendorExtensions(StringBuilder sb, CodegenConfig sb.append(newline); } - private void generateMdImportMappings(StringBuilder sb, CodegenConfig config) { - sb.append(newline).append("## IMPORT MAPPING").append(newline).append(newline); - - sb.append("| Type/Alias | Imports |").append(newline); - sb.append("| ---------- | ------- |").append(newline); - - config.importMapping() - .entrySet() - .stream() - .sorted(Map.Entry.comparingByKey()) - .forEachOrdered(kvp -> { - sb.append("|").append(escapeHtml4(kvp.getKey())).append("|").append(escapeHtml4(kvp.getValue())).append("|"); - sb.append(newline); - }); - - sb.append(newline); - } - private void generateMdInstantiationTypes(StringBuilder sb, CodegenConfig config) { sb.append(newline).append("## INSTANTIATION TYPES").append(newline).append(newline); @@ -372,10 +350,6 @@ private void generateMarkdownHelp(StringBuilder sb, CodegenConfig config) { generateMdSupportedVendorExtensions(sb, config); } - if (Boolean.TRUE.equals(importMappings)) { - generateMdImportMappings(sb, config); - } - if (Boolean.TRUE.equals(instantiationTypes)) { generateMdInstantiationTypes(sb, config); } @@ -446,18 +420,6 @@ private void generatePlainTextHelp(StringBuilder sb, CodegenConfig config) { sb.append(newline).append(newline); }); - if (Boolean.TRUE.equals(importMappings)) { - sb.append(newline).append("IMPORT MAPPING").append(newline).append(newline); - Map map = config.importMapping() - .entrySet() - .stream() - .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (a, b) -> { - throw new IllegalStateException(String.format(Locale.ROOT, "Duplicated options! %s and %s", a, b)); - }, TreeMap::new)); - writePlainTextFromMap(sb, map, optIndent, optNestedIndent, "Type/Alias", "Imports"); - sb.append(newline); - } - if (Boolean.TRUE.equals(schemaMappings)) { sb.append(newline).append("SCHEMA MAPPING").append(newline).append(newline); Map map = config.schemaMapping() diff --git a/modules/openapi-json-schema-generator-cli/src/main/java/org/openapitools/codegen/cmd/Generate.java b/modules/openapi-json-schema-generator-cli/src/main/java/org/openapijsonschematools/codegen/cmd/Generate.java similarity index 92% rename from modules/openapi-json-schema-generator-cli/src/main/java/org/openapitools/codegen/cmd/Generate.java rename to modules/openapi-json-schema-generator-cli/src/main/java/org/openapijsonschematools/codegen/cmd/Generate.java index 02f6f99f613..2aa3646c770 100644 --- a/modules/openapi-json-schema-generator-cli/src/main/java/org/openapitools/codegen/cmd/Generate.java +++ b/modules/openapi-json-schema-generator-cli/src/main/java/org/openapijsonschematools/codegen/cmd/Generate.java @@ -15,10 +15,9 @@ * limitations under the License. */ -package org.openapitools.codegen.cmd; +package org.openapijsonschematools.codegen.cmd; import static org.apache.commons.lang3.StringUtils.isNotEmpty; -import static org.openapitools.codegen.config.CodegenConfiguratorUtils.*; import ch.qos.logback.classic.LoggerContext; import ch.qos.logback.core.spi.FilterAttachable; @@ -30,8 +29,13 @@ import java.util.stream.Stream; import org.apache.commons.lang3.StringUtils; -import org.openapitools.codegen.*; -import org.openapitools.codegen.config.CodegenConfigurator; +import org.openapijsonschematools.codegen.ClientOptInput; +import org.openapijsonschematools.codegen.CodegenConstants; +import org.openapijsonschematools.codegen.DefaultGenerator; +import org.openapijsonschematools.codegen.Generator; +import org.openapijsonschematools.codegen.GeneratorNotFoundException; +import org.openapijsonschematools.codegen.config.CodegenConfigurator; +import org.openapijsonschematools.codegen.config.CodegenConfiguratorUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -263,9 +267,6 @@ public class Generate extends OpenApiGeneratorCommand { @Option(name = {"--enable-post-process-file"}, title = "enable post-processing of files (in generators supporting it)", description = CodegenConstants.ENABLE_POST_PROCESS_FILE_DESC) private Boolean enablePostProcessFile; - @Option(name = {"--generate-alias-as-model"}, title = "generate alias (array, map) as model", description = CodegenConstants.GENERATE_ALIAS_AS_MODEL_DESC) - private Boolean generateAliasAsModel; - @Option(name = {"--legacy-discriminator-behavior"}, title = "Support legacy logic for evaluating discriminators", description = CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR_DESC) private Boolean legacyDiscriminatorBehavior; @@ -278,7 +279,7 @@ public class Generate extends OpenApiGeneratorCommand { public void execute() { if (logToStderr != null) { LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory(); - Stream.of(Logger.ROOT_LOGGER_NAME, "io.swagger", "org.openapitools") + Stream.of(Logger.ROOT_LOGGER_NAME, "io.swagger", "org.openapijsonschematools") .map(lc::getLogger) .peek(logger -> logger.detachAppender("STDOUT")) .reduce((logger, next) -> logger.getName().equals(Logger.ROOT_LOGGER_NAME) ? logger : next) @@ -427,10 +428,6 @@ public void execute() { configurator.setEnablePostProcessFile(enablePostProcessFile); } - if (generateAliasAsModel != null) { - configurator.setGenerateAliasAsModel(generateAliasAsModel); - } - if (minimalUpdate != null) { configurator.setEnableMinimalUpdate(minimalUpdate); } @@ -440,18 +437,18 @@ public void execute() { } if (globalProperties != null && !globalProperties.isEmpty()) { - applyGlobalPropertiesKvpList(globalProperties, configurator); - } - applyInstantiationTypesKvpList(instantiationTypes, configurator); - applyImportMappingsKvpList(importMappings, configurator); - applySchemaMappingsKvpList(schemaMappings, configurator); - applyInlineSchemaNameMappingsKvpList(inlineSchemaNameMappings, configurator); - applyInlineSchemaNameDefaultsKvpList(inlineSchemaNameDefaults, configurator); - applyTypeMappingsKvpList(typeMappings, configurator); - applyAdditionalPropertiesKvpList(additionalProperties, configurator); - applyLanguageSpecificPrimitivesCsvList(languageSpecificPrimitives, configurator); - applyReservedWordsMappingsKvpList(reservedWordsMappings, configurator); - applyServerVariablesKvpList(serverVariableOverrides, configurator); + CodegenConfiguratorUtils.applyGlobalPropertiesKvpList(globalProperties, configurator); + } + CodegenConfiguratorUtils.applyInstantiationTypesKvpList(instantiationTypes, configurator); + CodegenConfiguratorUtils.applyImportMappingsKvpList(importMappings, configurator); + CodegenConfiguratorUtils.applySchemaMappingsKvpList(schemaMappings, configurator); + CodegenConfiguratorUtils.applyInlineSchemaNameMappingsKvpList(inlineSchemaNameMappings, configurator); + CodegenConfiguratorUtils.applyInlineSchemaNameDefaultsKvpList(inlineSchemaNameDefaults, configurator); + CodegenConfiguratorUtils.applyTypeMappingsKvpList(typeMappings, configurator); + CodegenConfiguratorUtils.applyAdditionalPropertiesKvpList(additionalProperties, configurator); + CodegenConfiguratorUtils.applyLanguageSpecificPrimitivesCsvList(languageSpecificPrimitives, configurator); + CodegenConfiguratorUtils.applyReservedWordsMappingsKvpList(reservedWordsMappings, configurator); + CodegenConfiguratorUtils.applyServerVariablesKvpList(serverVariableOverrides, configurator); try { final ClientOptInput clientOptInput = configurator.toClientOptInput(); diff --git a/modules/openapi-json-schema-generator-cli/src/main/java/org/openapitools/codegen/cmd/GenerateBatch.java b/modules/openapi-json-schema-generator-cli/src/main/java/org/openapijsonschematools/codegen/cmd/GenerateBatch.java similarity index 96% rename from modules/openapi-json-schema-generator-cli/src/main/java/org/openapitools/codegen/cmd/GenerateBatch.java rename to modules/openapi-json-schema-generator-cli/src/main/java/org/openapijsonschematools/codegen/cmd/GenerateBatch.java index 7c8cc543bcd..759500d2356 100644 --- a/modules/openapi-json-schema-generator-cli/src/main/java/org/openapitools/codegen/cmd/GenerateBatch.java +++ b/modules/openapi-json-schema-generator-cli/src/main/java/org/openapijsonschematools/codegen/cmd/GenerateBatch.java @@ -14,21 +14,17 @@ * limitations under the License. */ -package org.openapitools.codegen.cmd; +package org.openapijsonschematools.codegen.cmd; import ch.qos.logback.classic.Level; import ch.qos.logback.classic.LoggerContext; -import com.fasterxml.jackson.core.JsonFactory; -import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonToken; -import com.fasterxml.jackson.core.TreeNode; import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.databind.deser.BeanDeserializerModifier; import com.fasterxml.jackson.databind.deser.std.DelegatingDeserializer; import com.fasterxml.jackson.databind.module.SimpleModule; -import com.fasterxml.jackson.databind.node.ObjectNode; import com.fasterxml.jackson.databind.util.TokenBuffer; import io.airlift.airline.Arguments; @@ -36,12 +32,12 @@ import io.airlift.airline.Option; import org.apache.commons.io.FileUtils; import org.apache.commons.lang3.StringUtils; -import org.openapitools.codegen.ClientOptInput; -import org.openapitools.codegen.CodegenConfig; -import org.openapitools.codegen.DefaultGenerator; -import org.openapitools.codegen.config.CodegenConfigurator; -import org.openapitools.codegen.config.DynamicSettings; -import org.openapitools.codegen.config.GlobalSettings; +import org.openapijsonschematools.codegen.ClientOptInput; +import org.openapijsonschematools.codegen.CodegenConfig; +import org.openapijsonschematools.codegen.DefaultGenerator; +import org.openapijsonschematools.codegen.config.CodegenConfigurator; +import org.openapijsonschematools.codegen.config.DynamicSettings; +import org.openapijsonschematools.codegen.config.GlobalSettings; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -147,7 +143,7 @@ public void execute() { // it doesn't make sense to interleave INFO level logs, so limit these to only ERROR. LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory(); - Stream.of(Logger.ROOT_LOGGER_NAME, "io.swagger", "org.openapitools") + Stream.of(Logger.ROOT_LOGGER_NAME, "io.swagger", "org.openapijsonschematools") .map(lc::getLogger) .forEach(logger -> logger.setLevel(Level.ERROR)); diff --git a/modules/openapi-json-schema-generator-cli/src/main/java/org/openapitools/codegen/cmd/GlobalOptions.java b/modules/openapi-json-schema-generator-cli/src/main/java/org/openapijsonschematools/codegen/cmd/GlobalOptions.java similarity index 88% rename from modules/openapi-json-schema-generator-cli/src/main/java/org/openapitools/codegen/cmd/GlobalOptions.java rename to modules/openapi-json-schema-generator-cli/src/main/java/org/openapijsonschematools/codegen/cmd/GlobalOptions.java index 3333d30b08e..4290172bcdd 100644 --- a/modules/openapi-json-schema-generator-cli/src/main/java/org/openapitools/codegen/cmd/GlobalOptions.java +++ b/modules/openapi-json-schema-generator-cli/src/main/java/org/openapijsonschematools/codegen/cmd/GlobalOptions.java @@ -1,4 +1,4 @@ -package org.openapitools.codegen.cmd; +package org.openapijsonschematools.codegen.cmd; import io.airlift.airline.Option; diff --git a/modules/openapi-json-schema-generator-cli/src/main/java/org/openapitools/codegen/cmd/HelpCommand.java b/modules/openapi-json-schema-generator-cli/src/main/java/org/openapijsonschematools/codegen/cmd/HelpCommand.java similarity index 88% rename from modules/openapi-json-schema-generator-cli/src/main/java/org/openapitools/codegen/cmd/HelpCommand.java rename to modules/openapi-json-schema-generator-cli/src/main/java/org/openapijsonschematools/codegen/cmd/HelpCommand.java index aab582beb3a..dd3e1bf05d0 100644 --- a/modules/openapi-json-schema-generator-cli/src/main/java/org/openapitools/codegen/cmd/HelpCommand.java +++ b/modules/openapi-json-schema-generator-cli/src/main/java/org/openapijsonschematools/codegen/cmd/HelpCommand.java @@ -1,4 +1,4 @@ -package org.openapitools.codegen.cmd; +package org.openapijsonschematools.codegen.cmd; import io.airlift.airline.Command; import io.airlift.airline.Help; diff --git a/modules/openapi-json-schema-generator-cli/src/main/java/org/openapitools/codegen/cmd/ListGenerators.java b/modules/openapi-json-schema-generator-cli/src/main/java/org/openapijsonschematools/codegen/cmd/ListGenerators.java similarity index 93% rename from modules/openapi-json-schema-generator-cli/src/main/java/org/openapitools/codegen/cmd/ListGenerators.java rename to modules/openapi-json-schema-generator-cli/src/main/java/org/openapijsonschematools/codegen/cmd/ListGenerators.java index 8a178193240..e98aaf5879b 100644 --- a/modules/openapi-json-schema-generator-cli/src/main/java/org/openapitools/codegen/cmd/ListGenerators.java +++ b/modules/openapi-json-schema-generator-cli/src/main/java/org/openapijsonschematools/codegen/cmd/ListGenerators.java @@ -1,4 +1,4 @@ -package org.openapitools.codegen.cmd; +package org.openapijsonschematools.codegen.cmd; import com.google.common.base.Objects; @@ -6,11 +6,11 @@ import io.airlift.airline.Option; import org.apache.commons.lang3.StringUtils; -import org.openapitools.codegen.CodegenConfig; -import org.openapitools.codegen.CodegenConfigLoader; -import org.openapitools.codegen.CodegenType; -import org.openapitools.codegen.meta.GeneratorMetadata; -import org.openapitools.codegen.meta.Stability; +import org.openapijsonschematools.codegen.CodegenConfig; +import org.openapijsonschematools.codegen.CodegenConfigLoader; +import org.openapijsonschematools.codegen.CodegenType; +import org.openapijsonschematools.codegen.meta.GeneratorMetadata; +import org.openapijsonschematools.codegen.meta.Stability; import java.util.*; import java.util.stream.Collectors; diff --git a/modules/openapi-json-schema-generator-cli/src/main/java/org/openapitools/codegen/cmd/Meta.java b/modules/openapi-json-schema-generator-cli/src/main/java/org/openapijsonschematools/codegen/cmd/Meta.java similarity index 93% rename from modules/openapi-json-schema-generator-cli/src/main/java/org/openapitools/codegen/cmd/Meta.java rename to modules/openapi-json-schema-generator-cli/src/main/java/org/openapijsonschematools/codegen/cmd/Meta.java index 52043e2ce0c..e34b6e2b1bf 100644 --- a/modules/openapi-json-schema-generator-cli/src/main/java/org/openapitools/codegen/cmd/Meta.java +++ b/modules/openapi-json-schema-generator-cli/src/main/java/org/openapijsonschematools/codegen/cmd/Meta.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.openapitools.codegen.cmd; +package org.openapijsonschematools.codegen.cmd; import static ch.lambdaj.collection.LambdaCollections.with; import static com.google.common.base.Joiner.on; @@ -27,20 +27,18 @@ import io.airlift.airline.Command; import io.airlift.airline.Option; import org.apache.commons.io.FileUtils; -import org.openapitools.codegen.CodegenConfig; -import org.openapitools.codegen.DefaultGenerator; -import org.openapitools.codegen.SupportingFile; -import org.openapitools.codegen.TemplateManager; -import org.openapitools.codegen.api.TemplatePathLocator; -import org.openapitools.codegen.templating.MustacheEngineAdapter; -import org.openapitools.codegen.templating.TemplateManagerOptions; -import org.openapitools.codegen.templating.CommonTemplateContentLocator; +import org.openapijsonschematools.codegen.CodegenConfig; +import org.openapijsonschematools.codegen.SupportingFile; +import org.openapijsonschematools.codegen.TemplateManager; +import org.openapijsonschematools.codegen.templating.CommonTemplateContentLocator; +import org.openapijsonschematools.codegen.templating.MustacheEngineAdapter; +import org.openapijsonschematools.codegen.templating.TemplateManagerOptions; +import org.openapijsonschematools.codegen.api.TemplatePathLocator; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.File; import java.io.IOException; -import java.io.Reader; import java.nio.charset.StandardCharsets; import java.util.List; import java.util.Map; @@ -70,8 +68,8 @@ public class Meta extends OpenApiGeneratorCommand { private String name = "default"; @Option(name = {"-p", "--package"}, title = "package", - description = "the package to put the main class into (defaults to org.openapitools.codegen)") - private String targetPackage = "org.openapitools.codegen"; + description = "the package to put the main class into (defaults to org.openapijsonschematools.codegen)") + private String targetPackage = "org.openapijsonschematools.codegen"; @Option(name = {"-t", "--type"}, title = "type", description = "the type of generator that is created", diff --git a/modules/openapi-json-schema-generator-cli/src/main/java/org/openapitools/codegen/cmd/OpenApiGeneratorCommand.java b/modules/openapi-json-schema-generator-cli/src/main/java/org/openapijsonschematools/codegen/cmd/OpenApiGeneratorCommand.java similarity index 94% rename from modules/openapi-json-schema-generator-cli/src/main/java/org/openapitools/codegen/cmd/OpenApiGeneratorCommand.java rename to modules/openapi-json-schema-generator-cli/src/main/java/org/openapijsonschematools/codegen/cmd/OpenApiGeneratorCommand.java index 47ee715d3dc..0a44803ee14 100644 --- a/modules/openapi-json-schema-generator-cli/src/main/java/org/openapitools/codegen/cmd/OpenApiGeneratorCommand.java +++ b/modules/openapi-json-schema-generator-cli/src/main/java/org/openapijsonschematools/codegen/cmd/OpenApiGeneratorCommand.java @@ -1,4 +1,4 @@ -package org.openapitools.codegen.cmd; +package org.openapijsonschematools.codegen.cmd; import io.airlift.airline.Help; import io.airlift.airline.model.GlobalMetadata; diff --git a/modules/openapi-json-schema-generator-cli/src/main/java/org/openapitools/codegen/cmd/Validate.java b/modules/openapi-json-schema-generator-cli/src/main/java/org/openapijsonschematools/codegen/cmd/Validate.java similarity index 93% rename from modules/openapi-json-schema-generator-cli/src/main/java/org/openapitools/codegen/cmd/Validate.java rename to modules/openapi-json-schema-generator-cli/src/main/java/org/openapijsonschematools/codegen/cmd/Validate.java index 726aaf300d6..e1fa4caf294 100644 --- a/modules/openapi-json-schema-generator-cli/src/main/java/org/openapitools/codegen/cmd/Validate.java +++ b/modules/openapi-json-schema-generator-cli/src/main/java/org/openapijsonschematools/codegen/cmd/Validate.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.openapitools.codegen.cmd; +package org.openapijsonschematools.codegen.cmd; import io.airlift.airline.Command; import io.airlift.airline.Option; @@ -25,9 +25,9 @@ import io.swagger.v3.parser.core.models.ParseOptions; import io.swagger.v3.parser.core.models.SwaggerParseResult; import org.apache.commons.text.WordUtils; -import org.openapitools.codegen.validation.ValidationResult; -import org.openapitools.codegen.validations.oas.OpenApiEvaluator; -import org.openapitools.codegen.validations.oas.RuleConfiguration; +import org.openapijsonschematools.codegen.validations.oas.OpenApiEvaluator; +import org.openapijsonschematools.codegen.validations.oas.RuleConfiguration; +import org.openapijsonschematools.codegen.validation.ValidationResult; import java.util.HashSet; import java.util.List; diff --git a/modules/openapi-json-schema-generator-cli/src/main/java/org/openapitools/codegen/cmd/Version.java b/modules/openapi-json-schema-generator-cli/src/main/java/org/openapijsonschematools/codegen/cmd/Version.java similarity index 96% rename from modules/openapi-json-schema-generator-cli/src/main/java/org/openapitools/codegen/cmd/Version.java rename to modules/openapi-json-schema-generator-cli/src/main/java/org/openapijsonschematools/codegen/cmd/Version.java index 3c47fc2cbc6..7228f8c22d8 100644 --- a/modules/openapi-json-schema-generator-cli/src/main/java/org/openapitools/codegen/cmd/Version.java +++ b/modules/openapi-json-schema-generator-cli/src/main/java/org/openapijsonschematools/codegen/cmd/Version.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.openapitools.codegen.cmd; +package org.openapijsonschematools.codegen.cmd; import io.airlift.airline.Command; import io.airlift.airline.Option; diff --git a/modules/openapi-json-schema-generator-cli/src/main/java/org/openapitools/codegen/Constants.java b/modules/openapi-json-schema-generator-cli/src/main/java/org/openapitools/codegen/Constants.java deleted file mode 100644 index 863f1783828..00000000000 --- a/modules/openapi-json-schema-generator-cli/src/main/java/org/openapitools/codegen/Constants.java +++ /dev/null @@ -1,9 +0,0 @@ -package org.openapitools.codegen; - -public class Constants { - private Constants(){ } - - public static final String CLI_NAME = "openapi-generator-cli"; - public static final String GIT_REPO = "https://github.com/openapitools/openapi-generator"; - public static final String SITE = "https://openapi-generator.tech/"; -} diff --git a/modules/openapi-json-schema-generator-cli/src/main/resources/logback.xml b/modules/openapi-json-schema-generator-cli/src/main/resources/logback.xml index 0577ae5e15d..f6a72cfc9d8 100644 --- a/modules/openapi-json-schema-generator-cli/src/main/resources/logback.xml +++ b/modules/openapi-json-schema-generator-cli/src/main/resources/logback.xml @@ -67,7 +67,7 @@ - + diff --git a/modules/openapi-json-schema-generator-cli/src/test/java/org/openapitools/codegen/cmd/AuthorTemplateTest.java b/modules/openapi-json-schema-generator-cli/src/test/java/org/openapijsonschematools/codegen/cmd/AuthorTemplateTest.java similarity index 97% rename from modules/openapi-json-schema-generator-cli/src/test/java/org/openapitools/codegen/cmd/AuthorTemplateTest.java rename to modules/openapi-json-schema-generator-cli/src/test/java/org/openapijsonschematools/codegen/cmd/AuthorTemplateTest.java index 4826464ad91..bf7a200fe19 100644 --- a/modules/openapi-json-schema-generator-cli/src/test/java/org/openapitools/codegen/cmd/AuthorTemplateTest.java +++ b/modules/openapi-json-schema-generator-cli/src/test/java/org/openapijsonschematools/codegen/cmd/AuthorTemplateTest.java @@ -1,4 +1,4 @@ -package org.openapitools.codegen.cmd; +package org.openapijsonschematools.codegen.cmd; import io.airlift.airline.Cli; import org.testng.Assert; @@ -9,7 +9,6 @@ import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; -import java.util.Arrays; public class AuthorTemplateTest { Path outputDirectory; diff --git a/modules/openapi-json-schema-generator-cli/src/test/java/org/openapitools/codegen/cmd/GenerateBatchTest.java b/modules/openapi-json-schema-generator-cli/src/test/java/org/openapijsonschematools/codegen/cmd/GenerateBatchTest.java similarity index 94% rename from modules/openapi-json-schema-generator-cli/src/test/java/org/openapitools/codegen/cmd/GenerateBatchTest.java rename to modules/openapi-json-schema-generator-cli/src/test/java/org/openapijsonschematools/codegen/cmd/GenerateBatchTest.java index ce446523f1e..88d4af49128 100644 --- a/modules/openapi-json-schema-generator-cli/src/test/java/org/openapitools/codegen/cmd/GenerateBatchTest.java +++ b/modules/openapi-json-schema-generator-cli/src/test/java/org/openapijsonschematools/codegen/cmd/GenerateBatchTest.java @@ -1,12 +1,11 @@ -package org.openapitools.codegen.cmd; +package org.openapijsonschematools.codegen.cmd; import com.fasterxml.jackson.databind.module.SimpleModule; -import org.openapitools.codegen.config.CodegenConfigurator; -import org.openapitools.codegen.config.Context; -import org.openapitools.codegen.config.GeneratorSettings; -import org.openapitools.codegen.config.WorkflowSettings; +import org.openapijsonschematools.codegen.config.CodegenConfigurator; +import org.openapijsonschematools.codegen.config.Context; +import org.openapijsonschematools.codegen.config.GeneratorSettings; +import org.openapijsonschematools.codegen.config.WorkflowSettings; import org.testng.ITestContext; -import org.testng.TestRunner; import org.testng.annotations.BeforeTest; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; diff --git a/modules/openapi-json-schema-generator-cli/src/test/java/org/openapitools/codegen/cmd/GenerateTest.java b/modules/openapi-json-schema-generator-cli/src/test/java/org/openapijsonschematools/codegen/cmd/GenerateTest.java similarity index 96% rename from modules/openapi-json-schema-generator-cli/src/test/java/org/openapitools/codegen/cmd/GenerateTest.java rename to modules/openapi-json-schema-generator-cli/src/test/java/org/openapijsonschematools/codegen/cmd/GenerateTest.java index 5b013006739..71a3df0e6cd 100644 --- a/modules/openapi-json-schema-generator-cli/src/test/java/org/openapitools/codegen/cmd/GenerateTest.java +++ b/modules/openapi-json-schema-generator-cli/src/test/java/org/openapijsonschematools/codegen/cmd/GenerateTest.java @@ -15,16 +15,14 @@ * limitations under the License. */ -package org.openapitools.codegen.cmd; +package org.openapijsonschematools.codegen.cmd; import io.airlift.airline.Cli; import org.apache.commons.lang3.ArrayUtils; import org.mockito.MockSettings; -import org.openapitools.codegen.DefaultGenerator; -import org.openapitools.codegen.Generator; -import org.openapitools.codegen.SpecValidationException; -import org.openapitools.codegen.config.CodegenConfigurator; -import org.testng.TestException; +import org.openapijsonschematools.codegen.DefaultGenerator; +import org.openapijsonschematools.codegen.Generator; +import org.openapijsonschematools.codegen.config.CodegenConfigurator; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; @@ -433,11 +431,12 @@ public void testVerboseShort() { verifyNoMoreInteractions(configurator); } - /** - * This test ensures that when the - */ - @Test(expectedExceptions = SpecValidationException.class) - public void testNPEWithInvalidSpecFile() { - setupAndRunTest("-i", "src/test/resources/npe-test.yaml", "-g", "java", "-o", "src/main/java", false, null); - } +// /** +// * This test ensures that a NPE is thrown +// * Test stopped passing when swagger-parser setResolve was switched to false +// */ +// @Test(expectedExceptions = SpecValidationException.class) +// public void testNPEWithInvalidSpecFile() { +// setupAndRunTest("-i", "src/test/resources/npe-test.yaml", "-g", "java", "-o", "src/main/java", false, null); +// } } diff --git a/modules/openapi-json-schema-generator-cli/src/test/java/org/openapitools/codegen/cmd/utils/OptionUtilsTest.java b/modules/openapi-json-schema-generator-cli/src/test/java/org/openapijsonschematools/codegen/cmd/utils/OptionUtilsTest.java similarity index 96% rename from modules/openapi-json-schema-generator-cli/src/test/java/org/openapitools/codegen/cmd/utils/OptionUtilsTest.java rename to modules/openapi-json-schema-generator-cli/src/test/java/org/openapijsonschematools/codegen/cmd/utils/OptionUtilsTest.java index 37c4039423b..b83da92b592 100644 --- a/modules/openapi-json-schema-generator-cli/src/test/java/org/openapitools/codegen/cmd/utils/OptionUtilsTest.java +++ b/modules/openapi-json-schema-generator-cli/src/test/java/org/openapijsonschematools/codegen/cmd/utils/OptionUtilsTest.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.openapitools.codegen.cmd.utils; +package org.openapijsonschematools.codegen.cmd.utils; -import org.openapitools.codegen.utils.OptionUtils; +import org.openapijsonschematools.codegen.utils.OptionUtils; import org.apache.commons.lang3.tuple.Pair; import org.testng.annotations.Test; diff --git a/modules/openapi-json-schema-generator-core/pom.xml b/modules/openapi-json-schema-generator-core/pom.xml index 99de23801b2..46882a785ed 100644 --- a/modules/openapi-json-schema-generator-core/pom.xml +++ b/modules/openapi-json-schema-generator-core/pom.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> openapi-json-schema-generator-project - org.openapitools + org.openapijsonschematools ${revision} ../.. @@ -12,7 +12,7 @@ openapi-json-schema-generator-core openapi-json-schema-generator-core - https://github.com/openapitools/openapi-json-schema-generator + https://github.com/openapi-json-schema-tools/openapi-json-schema-generator diff --git a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/api/AbstractTemplatingEngineAdapter.java b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/api/AbstractTemplatingEngineAdapter.java similarity index 97% rename from modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/api/AbstractTemplatingEngineAdapter.java rename to modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/api/AbstractTemplatingEngineAdapter.java index 6c568f6ad3b..83081fe4799 100644 --- a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/api/AbstractTemplatingEngineAdapter.java +++ b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/api/AbstractTemplatingEngineAdapter.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.openapitools.codegen.api; +package org.openapijsonschematools.codegen.api; import java.util.Locale; diff --git a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/api/TemplateDefinition.java b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/api/TemplateDefinition.java similarity index 98% rename from modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/api/TemplateDefinition.java rename to modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/api/TemplateDefinition.java index 51d6c929e03..745130322b9 100644 --- a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/api/TemplateDefinition.java +++ b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/api/TemplateDefinition.java @@ -1,4 +1,4 @@ -package org.openapitools.codegen.api; +package org.openapijsonschematools.codegen.api; import java.util.Objects; import java.util.StringJoiner; diff --git a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/api/TemplateFileType.java b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/api/TemplateFileType.java similarity index 97% rename from modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/api/TemplateFileType.java rename to modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/api/TemplateFileType.java index 68ff5610fe3..b94992b2565 100644 --- a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/api/TemplateFileType.java +++ b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/api/TemplateFileType.java @@ -1,4 +1,4 @@ -package org.openapitools.codegen.api; +package org.openapijsonschematools.codegen.api; import java.util.StringJoiner; diff --git a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/api/TemplatePathLocator.java b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/api/TemplatePathLocator.java similarity index 88% rename from modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/api/TemplatePathLocator.java rename to modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/api/TemplatePathLocator.java index 9bcd4e2cc8b..60021d55c51 100644 --- a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/api/TemplatePathLocator.java +++ b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/api/TemplatePathLocator.java @@ -1,4 +1,4 @@ -package org.openapitools.codegen.api; +package org.openapijsonschematools.codegen.api; /** * Provides means for searching for "actual" template location based on relative template file. diff --git a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/api/TemplateProcessor.java b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/api/TemplateProcessor.java similarity index 97% rename from modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/api/TemplateProcessor.java rename to modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/api/TemplateProcessor.java index 536d2d89ac9..0c848ded59d 100644 --- a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/api/TemplateProcessor.java +++ b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/api/TemplateProcessor.java @@ -1,4 +1,4 @@ -package org.openapitools.codegen.api; +package org.openapijsonschematools.codegen.api; import java.io.File; import java.io.IOException; diff --git a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/api/TemplatingEngineAdapter.java b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/api/TemplatingEngineAdapter.java similarity index 98% rename from modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/api/TemplatingEngineAdapter.java rename to modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/api/TemplatingEngineAdapter.java index 34666bf7a2c..f7474949b10 100644 --- a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/api/TemplatingEngineAdapter.java +++ b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/api/TemplatingEngineAdapter.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.openapitools.codegen.api; +package org.openapijsonschematools.codegen.api; import java.io.FileInputStream; import java.io.IOException; diff --git a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/api/TemplatingExecutor.java b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/api/TemplatingExecutor.java similarity index 94% rename from modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/api/TemplatingExecutor.java rename to modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/api/TemplatingExecutor.java index d0fbb86b5db..a0ba2813c50 100644 --- a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/api/TemplatingExecutor.java +++ b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/api/TemplatingExecutor.java @@ -1,4 +1,4 @@ -package org.openapitools.codegen.api; +package org.openapijsonschematools.codegen.api; import java.nio.file.Path; diff --git a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/api/TemplatingGenerator.java b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/api/TemplatingGenerator.java similarity index 95% rename from modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/api/TemplatingGenerator.java rename to modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/api/TemplatingGenerator.java index 86f306a790b..03d71b88f8a 100644 --- a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/api/TemplatingGenerator.java +++ b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/api/TemplatingGenerator.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.openapitools.codegen.api; +package org.openapijsonschematools.codegen.api; // TODO: 6.0 Remove /** diff --git a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/config/Context.java b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/config/Context.java similarity index 97% rename from modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/config/Context.java rename to modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/config/Context.java index 4aceaacb2c4..01cc07f71d9 100644 --- a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/config/Context.java +++ b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/config/Context.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.openapitools.codegen.config; +package org.openapijsonschematools.codegen.config; /** * The Context used for generation. diff --git a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/config/GeneratorSettings.java b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/config/GeneratorSettings.java similarity index 99% rename from modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/config/GeneratorSettings.java rename to modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/config/GeneratorSettings.java index c14a06721e8..e2430e049a6 100644 --- a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/config/GeneratorSettings.java +++ b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/config/GeneratorSettings.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.openapitools.codegen.config; +package org.openapijsonschematools.codegen.config; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -315,7 +315,7 @@ public String getGitHost() { } /** - * Gets git user id. e.g. openapitools. + * Gets git user id. e.g. openapijsonschematools. *

    * Generally used by git_push.sh in generated sources which support it. * This value may also be used by templates in maven style references, READMEs, or other documentation. diff --git a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/config/WorkflowSettings.java b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/config/WorkflowSettings.java similarity index 94% rename from modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/config/WorkflowSettings.java rename to modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/config/WorkflowSettings.java index 020dad9e507..30deab3fab3 100644 --- a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/config/WorkflowSettings.java +++ b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/config/WorkflowSettings.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.openapitools.codegen.config; +package org.openapijsonschematools.codegen.config; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -45,7 +45,6 @@ public class WorkflowSettings { public static final boolean DEFAULT_ENABLE_POST_PROCESS_FILE = false; public static final boolean DEFAULT_ENABLE_MINIMAL_UPDATE = false; public static final boolean DEFAULT_STRICT_SPEC_BEHAVIOR = true; - public static final boolean DEFAULT_GENERATE_ALIAS_AS_MODEL = false; public static final String DEFAULT_TEMPLATING_ENGINE_NAME = null; // this is set by the generator public static final Map DEFAULT_GLOBAL_PROPERTIES = Collections.unmodifiableMap(new HashMap<>()); @@ -60,7 +59,6 @@ public class WorkflowSettings { private boolean enablePostProcessFile = DEFAULT_ENABLE_POST_PROCESS_FILE; private boolean enableMinimalUpdate = DEFAULT_ENABLE_MINIMAL_UPDATE; private boolean strictSpecBehavior = DEFAULT_STRICT_SPEC_BEHAVIOR; - private boolean generateAliasAsModel = DEFAULT_GENERATE_ALIAS_AS_MODEL; private String templateDir; private String templatingEngineName = DEFAULT_TEMPLATING_ENGINE_NAME; private String ignoreFileOverride; @@ -82,7 +80,6 @@ private WorkflowSettings(Builder builder) { this.templatingEngineName = builder.templatingEngineName; this.ignoreFileOverride = builder.ignoreFileOverride; this.globalProperties = Collections.unmodifiableMap(builder.globalProperties); - this.generateAliasAsModel = builder.generateAliasAsModel; } /** @@ -109,7 +106,6 @@ public static Builder newBuilder(WorkflowSettings copy) { builder.validateSpec = copy.isValidateSpec(); builder.enablePostProcessFile = copy.isEnablePostProcessFile(); builder.enableMinimalUpdate = copy.isEnableMinimalUpdate(); - builder.generateAliasAsModel = copy.isGenerateAliasAsModel(); builder.strictSpecBehavior = copy.isStrictSpecBehavior(); builder.templatingEngineName = copy.getTemplatingEngineName(); builder.ignoreFileOverride = copy.getIgnoreFileOverride(); @@ -227,15 +223,6 @@ public boolean isEnableMinimalUpdate() { return enableMinimalUpdate; } - /** - * Indicates whether or not the generation should convert aliases (primitives defined as schema for use within documents) as models. - * - * @return true if generate-alias-as-model is enabled, otherwise false. - */ - public boolean isGenerateAliasAsModel() { - return generateAliasAsModel; - } - /** * Indicates whether or not 'MUST' and 'SHALL' wording in the api specification is strictly adhered to. * For example, when false, no automatic 'fixes' will be applied to documents which pass validation but don't follow the spec. @@ -308,7 +295,6 @@ public static final class Builder { private Boolean enablePostProcessFile = DEFAULT_ENABLE_POST_PROCESS_FILE; private Boolean enableMinimalUpdate = DEFAULT_ENABLE_MINIMAL_UPDATE; private Boolean strictSpecBehavior = DEFAULT_STRICT_SPEC_BEHAVIOR; - private Boolean generateAliasAsModel = DEFAULT_GENERATE_ALIAS_AS_MODEL; private String templateDir; private String templatingEngineName = DEFAULT_TEMPLATING_ENGINE_NAME; private String ignoreFileOverride; @@ -447,18 +433,6 @@ public Builder withStrictSpecBehavior(Boolean strictSpecBehavior) { return this; } - /** - * Sets the {@code generateAliasAsModel} and returns a reference to this Builder so that the methods can be chained together. - * An 'alias' is a primitive type defined as a schema, and this option will attempt to construct a model for that primitive. - * - * @param generateAliasAsModel the {@code generateAliasAsModel} to set - * @return a reference to this Builder - */ - public Builder withGenerateAliasAsModel(Boolean generateAliasAsModel) { - this.generateAliasAsModel = generateAliasAsModel != null ? generateAliasAsModel : Boolean.valueOf(DEFAULT_GENERATE_ALIAS_AS_MODEL); - return this; - } - /** * Sets the {@code templateDir} and returns a reference to this Builder so that the methods can be chained together. * @@ -586,7 +560,6 @@ public String toString() { ", templatingEngineName='" + templatingEngineName + '\'' + ", ignoreFileOverride='" + ignoreFileOverride + '\'' + ", globalProperties=" + globalProperties + - ", generateAliasAsModel=" + generateAliasAsModel + '}'; } @@ -604,7 +577,6 @@ public boolean equals(Object o) { isEnablePostProcessFile() == that.isEnablePostProcessFile() && isEnableMinimalUpdate() == that.isEnableMinimalUpdate() && isStrictSpecBehavior() == that.isStrictSpecBehavior() && - isGenerateAliasAsModel() == that.isGenerateAliasAsModel() && Objects.equals(getInputSpec(), that.getInputSpec()) && Objects.equals(getOutputDir(), that.getOutputDir()) && Objects.equals(getTemplateDir(), that.getTemplateDir()) && @@ -624,7 +596,6 @@ public int hashCode() { isSkipOperationExample(), isLogToStderr(), isValidateSpec(), - isGenerateAliasAsModel(), isEnablePostProcessFile(), isEnableMinimalUpdate(), isStrictSpecBehavior(), diff --git a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/meta/FeatureSet.java b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/meta/FeatureSet.java similarity index 79% rename from modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/meta/FeatureSet.java rename to modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/meta/FeatureSet.java index db98fe2be7b..16829b176be 100644 --- a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/meta/FeatureSet.java +++ b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/meta/FeatureSet.java @@ -14,10 +14,19 @@ * limitations under the License. */ -package org.openapitools.codegen.meta; - -import org.openapitools.codegen.meta.features.*; -import org.openapitools.codegen.meta.features.annotations.AnnotationType; +package org.openapijsonschematools.codegen.meta; + +import org.openapijsonschematools.codegen.meta.features.ClientModificationFeature; +import org.openapijsonschematools.codegen.meta.features.ComponentsFeature; +import org.openapijsonschematools.codegen.meta.features.DataTypeFeature; +import org.openapijsonschematools.codegen.meta.features.DocumentationFeature; +import org.openapijsonschematools.codegen.meta.features.GlobalFeature; +import org.openapijsonschematools.codegen.meta.features.OperationFeature; +import org.openapijsonschematools.codegen.meta.features.ParameterFeature; +import org.openapijsonschematools.codegen.meta.features.SchemaFeature; +import org.openapijsonschematools.codegen.meta.features.SecurityFeature; +import org.openapijsonschematools.codegen.meta.features.WireFormatFeature; +import org.openapijsonschematools.codegen.meta.features.annotations.AnnotationType; import java.lang.annotation.Annotation; import java.util.*; @@ -32,11 +41,13 @@ public class FeatureSet { private EnumSet clientModificationFeatures; private EnumSet dataTypeFeatures; + private EnumSet componentsFeatures; private EnumSet documentationFeatures; private EnumSet globalFeatures; - private EnumSet schemaSupportFeatures; + private EnumSet schemaFeatures; private EnumSet parameterFeatures; private EnumSet securityFeatures; + private EnumSet operationFeatures; private EnumSet wireFormatFeatures; private FeatureSet(Builder builder) { @@ -44,11 +55,13 @@ private FeatureSet(Builder builder) { clientModificationFeatures = builder.clientModificationFeatures; dataTypeFeatures = builder.dataTypeFeatures; documentationFeatures = builder.documentationFeatures; - schemaSupportFeatures = builder.schemaSupportFeatures; + schemaFeatures = builder.schemaFeatures; + componentsFeatures = builder.componentsFeatures; globalFeatures = builder.globalFeatures; parameterFeatures = builder.parameterFeatures; securityFeatures = builder.securityFeatures; wireFormatFeatures = builder.wireFormatFeatures; + operationFeatures = builder.operationFeatures; } } @@ -66,15 +79,24 @@ public static Builder newBuilder(FeatureSet copy) { builder.clientModificationFeatures = copy.getClientModificationFeatures(); builder.dataTypeFeatures = copy.getDataTypeFeatures(); builder.documentationFeatures = copy.getDocumentationFeatures(); - builder.schemaSupportFeatures = copy.getSchemaSupportFeatures(); + builder.schemaFeatures = copy.getSchemaSupportFeatures(); builder.globalFeatures = copy.getGlobalFeatures(); builder.parameterFeatures = copy.getParameterFeatures(); builder.securityFeatures = copy.getSecurityFeatures(); builder.wireFormatFeatures = copy.getWireFormatFeatures(); + builder.operationFeatures = copy.getOperationFeatures(); } return builder; } + public EnumSet getOperationFeatures() { + if (operationFeatures != null) { + return EnumSet.copyOf(operationFeatures); + } else { + return EnumSet.noneOf(OperationFeature.class); + } + } + /** * Returns the set of client modification features supported by the generator. * @@ -119,11 +141,19 @@ public EnumSet getDocumentationFeatures() { * * @return A new copy of the defined feature set. Changes to this instance are not promoted. */ - public EnumSet getSchemaSupportFeatures() { - if (schemaSupportFeatures != null) { - return EnumSet.copyOf(schemaSupportFeatures); + public EnumSet getSchemaSupportFeatures() { + if (schemaFeatures != null) { + return EnumSet.copyOf(schemaFeatures); } else { - return EnumSet.noneOf(SchemaSupportFeature.class); + return EnumSet.noneOf(SchemaFeature.class); + } + } + + public EnumSet getComponentsFeatures() { + if (componentsFeatures != null) { + return EnumSet.copyOf(componentsFeatures); + } else { + return EnumSet.noneOf(ComponentsFeature.class); } } @@ -256,14 +286,14 @@ public List flatten() { states.add(state); }); - EnumSet.allOf(SchemaSupportFeature.class).forEach(feat -> { + EnumSet.allOf(SchemaFeature.class).forEach(feat -> { FeatureSetFlattened state = new FeatureSetFlattened(); - state.featureCategory = SchemaSupportFeature.class.getSimpleName(); + state.featureCategory = SchemaFeature.class.getSimpleName(); state.featureName = feat.name(); - state.isSupported = this.schemaSupportFeatures.contains(feat); + state.isSupported = this.schemaFeatures.contains(feat); try { - for (Annotation an : SchemaSupportFeature.class.getField(feat.name()).getAnnotations()) { + for (Annotation an : SchemaFeature.class.getField(feat.name()).getAnnotations()) { state.source.add(AnnotationType.fromAnnotation(an.annotationType())); } } catch (NoSuchFieldException e) { @@ -288,6 +318,22 @@ public List flatten() { states.add(state); }); + EnumSet.allOf(ComponentsFeature.class).forEach(feat -> { + FeatureSetFlattened state = new FeatureSetFlattened(); + state.featureCategory = ComponentsFeature.class.getSimpleName(); + state.featureName = feat.name(); + state.isSupported = this.componentsFeatures.contains(feat); + + try { + for (Annotation an : ComponentsFeature.class.getField(feat.name()).getAnnotations()) { + state.source.add(AnnotationType.fromAnnotation(an.annotationType())); + } + } catch (NoSuchFieldException e) { + e.printStackTrace(); + } + + states.add(state); + }); EnumSet.allOf(ParameterFeature.class).forEach(feat -> { FeatureSetFlattened state = new FeatureSetFlattened(); state.featureCategory = ParameterFeature.class.getSimpleName(); @@ -320,6 +366,22 @@ public List flatten() { states.add(state); }); + EnumSet.allOf(OperationFeature.class).forEach(feat -> { + FeatureSetFlattened state = new FeatureSetFlattened(); + state.featureCategory = OperationFeature.class.getSimpleName(); + state.featureName = feat.name(); + state.isSupported = this.operationFeatures.contains(feat); + + try { + for (Annotation an : OperationFeature.class.getField(feat.name()).getAnnotations()) { + state.source.add(AnnotationType.fromAnnotation(an.annotationType())); + } + } catch (NoSuchFieldException e) { + e.printStackTrace(); + } + + states.add(state); + }); EnumSet.allOf(WireFormatFeature.class).forEach(feat -> { FeatureSetFlattened state = new FeatureSetFlattened(); state.featureCategory = WireFormatFeature.class.getSimpleName(); @@ -347,21 +409,46 @@ public static final class Builder { private EnumSet clientModificationFeatures; private EnumSet dataTypeFeatures; private EnumSet documentationFeatures; - private EnumSet schemaSupportFeatures; + private EnumSet schemaFeatures; + + private EnumSet componentsFeatures; private EnumSet globalFeatures; private EnumSet parameterFeatures; private EnumSet securityFeatures; private EnumSet wireFormatFeatures; + private EnumSet operationFeatures; + private Builder() { this.clientModificationFeatures = EnumSet.noneOf(ClientModificationFeature.class); this.dataTypeFeatures = EnumSet.noneOf(DataTypeFeature.class); this.documentationFeatures = EnumSet.noneOf(DocumentationFeature.class); - this.schemaSupportFeatures = EnumSet.noneOf(SchemaSupportFeature.class); + this.schemaFeatures = EnumSet.noneOf(SchemaFeature.class); this.parameterFeatures = EnumSet.noneOf(ParameterFeature.class); this.securityFeatures = EnumSet.noneOf(SecurityFeature.class); this.globalFeatures = EnumSet.noneOf(GlobalFeature.class); + this.componentsFeatures = EnumSet.noneOf(ComponentsFeature.class); this.wireFormatFeatures = EnumSet.noneOf(WireFormatFeature.class); + this.operationFeatures = EnumSet.noneOf(OperationFeature.class); + } + + public Builder operationFeatures(EnumSet operationFeatures) { + if (operationFeatures != null) { + this.operationFeatures = operationFeatures; + } else { + this.operationFeatures = EnumSet.noneOf(OperationFeature.class); + } + return this; + } + + public Builder includeOperationFeatures(OperationFeature... operationFeature) { + this.operationFeatures.addAll(Arrays.stream(operationFeature).collect(Collectors.toList())); + return this; + } + + public Builder excludeOperationFeatures(OperationFeature... operationFeature) { + this.operationFeatures.removeAll(Arrays.stream(operationFeature).collect(Collectors.toList())); + return this; } /** @@ -484,39 +571,39 @@ public Builder excludeDocumentationFeatures(DocumentationFeature... documentatio /** * Sets the {@code schemaSupportFeature} and returns a reference to this Builder so that the methods can be chained together. * - * @param schemaSupportFeatures the {@code schemaSupportFeature} to set + * @param schemaFeatures the {@code schemaSupportFeature} to set * @return a reference to this Builder */ - public Builder schemaSupportFeatures(EnumSet schemaSupportFeatures) { - if (schemaSupportFeatures != null) { - this.schemaSupportFeatures = schemaSupportFeatures; + public Builder schemaFeatures(EnumSet schemaFeatures) { + if (schemaFeatures != null) { + this.schemaFeatures = schemaFeatures; } else { - this.schemaSupportFeatures = EnumSet.noneOf(SchemaSupportFeature.class); + this.schemaFeatures = EnumSet.noneOf(SchemaFeature.class); } return this; } /** - * Includes the defined {@link SchemaSupportFeature} to the new/existing set of supported features. + * Includes the defined {@link SchemaFeature} to the new/existing set of supported features. * - * @param schemaSupportFeature One or more {@code schemaSupportFeature} to ensure are included in the set. + * @param schemaFeature One or more {@code schemaFeature} to ensure are included in the set. * * @return a reference to this Builder */ - public Builder includeSchemaSupportFeatures(SchemaSupportFeature... schemaSupportFeature) { - this.schemaSupportFeatures.addAll(Arrays.stream(schemaSupportFeature).collect(Collectors.toList())); + public Builder includeSchemaFeatures(SchemaFeature... schemaFeature) { + this.schemaFeatures.addAll(Arrays.stream(schemaFeature).collect(Collectors.toList())); return this; } /** - * Excludes the defined {@link SchemaSupportFeature} from the set of supported features. + * Excludes the defined {@link SchemaFeature} from the set of supported features. * - * @param schemaSupportFeature One or more {@code schemaSupportFeature} to ensure are excluded from the set. + * @param schemaFeature One or more {@code schemaFeature} to ensure are excluded from the set. * * @return a reference to this Builder */ - public Builder excludeSchemaSupportFeatures(SchemaSupportFeature... schemaSupportFeature) { - this.schemaSupportFeatures.removeAll(Arrays.stream(schemaSupportFeature).collect(Collectors.toList())); + public Builder excludeSchemaFeatures(SchemaFeature... schemaFeature) { + this.schemaFeatures.removeAll(Arrays.stream(schemaFeature).collect(Collectors.toList())); return this; } @@ -598,6 +685,25 @@ public Builder excludeSecurityFeatures(SecurityFeature... securityFeature) { return this; } + public Builder componentsFeatures(EnumSet componentsFeatures) { + if (componentsFeatures != null) { + this.componentsFeatures = componentsFeatures; + } else { + this.componentsFeatures = EnumSet.noneOf(ComponentsFeature.class); + } + return this; + } + + public Builder includeComponentsFeatures(ComponentsFeature... componentsFeature) { + this.componentsFeatures.addAll(Arrays.stream(componentsFeature).collect(Collectors.toList())); + return this; + } + + public Builder excludeComponentsFeatures(ComponentsFeature... componentsFeature) { + this.componentsFeatures.removeAll(Arrays.stream(componentsFeature).collect(Collectors.toList())); + return this; + } + /** * Sets the {@code globalFeatures} and return a reference to this Builder so that the methods can be chained together. * diff --git a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/meta/GeneratorMetadata.java b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/meta/GeneratorMetadata.java similarity index 99% rename from modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/meta/GeneratorMetadata.java rename to modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/meta/GeneratorMetadata.java index 6916e2c7307..4564c67b148 100644 --- a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/meta/GeneratorMetadata.java +++ b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/meta/GeneratorMetadata.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.openapitools.codegen.meta; +package org.openapijsonschematools.codegen.meta; import java.util.HashMap; import java.util.Map; diff --git a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/meta/Stability.java b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/meta/Stability.java similarity index 97% rename from modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/meta/Stability.java rename to modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/meta/Stability.java index bc79af24309..e236cb384c7 100644 --- a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/meta/Stability.java +++ b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/meta/Stability.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.openapitools.codegen.meta; +package org.openapijsonschematools.codegen.meta; /** * Represents the "stability index" of a generator or feature, based on the stability indexes defined in the node.js ecosystem. diff --git a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/meta/features/ClientModificationFeature.java b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/meta/features/ClientModificationFeature.java similarity index 89% rename from modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/meta/features/ClientModificationFeature.java rename to modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/meta/features/ClientModificationFeature.java index a53c354a6db..9534629eae0 100644 --- a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/meta/features/ClientModificationFeature.java +++ b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/meta/features/ClientModificationFeature.java @@ -14,9 +14,9 @@ * limitations under the License. */ -package org.openapitools.codegen.meta.features; +package org.openapijsonschematools.codegen.meta.features; -import org.openapitools.codegen.meta.features.annotations.ToolingExtension; +import org.openapijsonschematools.codegen.meta.features.annotations.ToolingExtension; /** * Defines a general set of modifications supported by a generated client. diff --git a/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/meta/features/ComponentsFeature.java b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/meta/features/ComponentsFeature.java new file mode 100644 index 00000000000..c16e3ac63c0 --- /dev/null +++ b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/meta/features/ComponentsFeature.java @@ -0,0 +1,51 @@ +/* + * Copyright 2023 OpenAPI-Json-Schema-Generator Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapijsonschematools.codegen.meta.features; + +import org.openapijsonschematools.codegen.meta.features.annotations.OAS3; + +public enum ComponentsFeature { + @OAS3 + schemas, + + @OAS3 + responses, + + @OAS3 + parameters, + + @OAS3 + examples, + + @OAS3 + requestBodies, + + @OAS3 + headers, + + @OAS3 + securitySchemes, + + @OAS3 + links, + + @OAS3 + callbacks, + + @OAS3 + pathItems +} diff --git a/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/meta/features/DataTypeFeature.java b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/meta/features/DataTypeFeature.java new file mode 100644 index 00000000000..12dd7c09df2 --- /dev/null +++ b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/meta/features/DataTypeFeature.java @@ -0,0 +1,181 @@ +/* + * Copyright 2019 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapijsonschematools.codegen.meta.features; + +import org.openapijsonschematools.codegen.meta.features.annotations.OAS2; +import org.openapijsonschematools.codegen.meta.features.annotations.OAS3; +import org.openapijsonschematools.codegen.meta.features.annotations.ToolingExtension; + +/** + * Defines common data types supported by a generator. + * Some of these features are defined in specs, and some are specific to the tool. + * + * Where data types are listed as tool-specific, this either indicates that the data type is common enough that it is an officially + * supported custom data type by the toolset, or that the consideration of a special type isn't + * explicitly mentioned by the specification(s) but differs enough across languages that it warrants a special callout. + */ +public enum DataTypeFeature { + /** + * Supports a generator-specific support usually via type=string's format property (e.g. email, uuid, etc), should be documented in generator README. + * + *

    Loosely described in OpenAPI Specification(s). Generally means a custom "format" option applied to a string-typed property.

    + */ + @OAS2 @OAS3 + Custom, + + /** + * Supports integer/int32 + */ + @OAS2 @OAS3 + Int32, + + /** + * Supports integer/int64 + */ + @OAS2 @OAS3 + Int64, + + /** + * Supports integer without format + */ + @OAS2 @OAS3 + Integer, + + /** + * Supports type: number, format:float + */ + @OAS2 @OAS3 + Float, + + /** + * Supports type: number, format: double + */ + @OAS2 @OAS3 + Double, + + /** + * Supports type: number, no format + * + */ + @OAS2 @OAS3 + Number, + + /** + * Supports string + */ + @OAS2 @OAS3 + String, + + /** + * Supports type:string format:byte, base64 encoded + */ + @OAS2 @OAS3 + Byte, + + /** + * Supports type:string format:binary: any collection of octets + */ + @OAS2 @OAS3 + Binary, + + /** + * Supports boolean + */ + @OAS2 @OAS3 + Boolean, + + /** + * Supports string/date: full-date RFC3339 + * + * @see RFC3339 + */ + @OAS2 @OAS3 + Date, + + /** + * Supports string/date-time: date-time RFC3339 + * + * @see RFC3339 + */ + @OAS2 @OAS3 + DateTime, + + /** + * Supports string/password: A hint to UIs to obscure input. + * + * + *

    + * This should be used as an indicator for password best practices, such as assigning a variable to + * a character array rather than string, avoiding logging the variable in clear text, and masking the value + * in any user inputs. See OWASP for best practices. + *

    + */ + @OAS2 @OAS3 + Password, + + /** + * Supports file inputs (e.g. multipart support). + * + *

    OAS 3.x defines files differently.

    + *

    + * OAS 3.x does not have an explicit "file" type and instead relies on ContentType or response types. + * That's not to say a generator doesn't support files, only that there's no direct + * "file" type defined in the spec document. + *

    + *

    + * NOTE: The default workflow may provide an "isFile" helper or synthesize the assumptions around files in the case of OAS 3.x. + *

    + */ + @OAS2 + File, + + /** + * String uuid data + */ + @OAS2 @OAS3 + Uuid, + + /** + * Supports arrays of data + */ + @OAS2 @OAS3 + Array, + + /** + * A JSON "null" value added in openapi v3.1.0 + */ + @OAS3 + Null, + + /** + * When no type is defined, any data type is accepted + */ + @OAS2 @OAS3 + AnyType, + + /** + * An unordered set of properties mapping a string to an instance + */ + @OAS2 @OAS3 + Object, + + /** + * Supports enum properties + */ + @OAS2 @OAS3 + Enum +} diff --git a/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/meta/features/DocumentationFeature.java b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/meta/features/DocumentationFeature.java new file mode 100644 index 00000000000..d42a1747a6f --- /dev/null +++ b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/meta/features/DocumentationFeature.java @@ -0,0 +1,71 @@ +/* + * Copyright 2019 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapijsonschematools.codegen.meta.features; + +import org.openapijsonschematools.codegen.meta.features.annotations.OAS2; +import org.openapijsonschematools.codegen.meta.features.annotations.OAS3; +import org.openapijsonschematools.codegen.meta.features.annotations.ToolingExtension; + +/** + * Defines the documentation type available in generated output. + */ +public enum DocumentationFeature { + /** + * Generated output includes a README. + */ + @ToolingExtension + Readme, + + @OAS3 + Servers, + + @OAS2 @OAS3 + Security, + + @OAS3 + ComponentSchemas, + + @OAS3 + ComponentResponses, + + @OAS3 + ComponentParameters, + + @OAS3 + ComponentRequestBodies, + + @OAS3 + ComponentHeaders, + + @OAS3 + ComponentSecuritySchemes, + + @OAS3 + ComponentLinks, + + @OAS3 + ComponentCallbacks, + + @OAS3 + ComponentPathItems, + + /** + * Generated output includes documentation for all generated APIs. + */ + @ToolingExtension + Api +} diff --git a/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/meta/features/GlobalFeature.java b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/meta/features/GlobalFeature.java new file mode 100644 index 00000000000..e9b076bf4ee --- /dev/null +++ b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/meta/features/GlobalFeature.java @@ -0,0 +1,49 @@ +/* + * Copyright 2019 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapijsonschematools.codegen.meta.features; + +import org.openapijsonschematools.codegen.meta.features.annotations.OAS2; +import org.openapijsonschematools.codegen.meta.features.annotations.OAS3; + +/** + * Defines a set of globally available features. That is, support of these are defined at the top-level of the spec + */ +public enum GlobalFeature { + @OAS2 @OAS3 + Info, + + @OAS3 + Servers, + + @OAS2 @OAS3 + Paths, + + @OAS3 + Webhooks, + + @OAS3 + Components, + + @OAS2 @OAS3 + Security, + + @OAS2 @OAS3 + Tags, + + @OAS2 @OAS3 + ExternalDocs, +} diff --git a/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/meta/features/OperationFeature.java b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/meta/features/OperationFeature.java new file mode 100644 index 00000000000..7c6faf8beaa --- /dev/null +++ b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/meta/features/OperationFeature.java @@ -0,0 +1,37 @@ +/* + * Copyright 2019 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapijsonschematools.codegen.meta.features; + +import org.openapijsonschematools.codegen.meta.features.annotations.OAS2; +import org.openapijsonschematools.codegen.meta.features.annotations.OAS3; + +/** + * Defines Operation features supported in the generated code. + */ +public enum OperationFeature { + @OAS3 + Responses_HttpStatusCode, + + @OAS3 + Responses_RangedResponseCodes, + + @OAS3 + Responses_Default, + + @OAS3 + Responses_RedirectionResponse, +} diff --git a/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/meta/features/ParameterFeature.java b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/meta/features/ParameterFeature.java new file mode 100644 index 00000000000..62b34c725da --- /dev/null +++ b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/meta/features/ParameterFeature.java @@ -0,0 +1,73 @@ +/* + * Copyright 2019 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapijsonschematools.codegen.meta.features; + +import org.openapijsonschematools.codegen.meta.features.annotations.OAS2; +import org.openapijsonschematools.codegen.meta.features.annotations.OAS3; + +/** + * Defines parameters supported by endpoints in the generated code. + */ +public enum ParameterFeature { + @OAS2 @OAS3 + Name, + + @OAS2 @OAS3 + Required, + + @OAS2 @OAS3 + In_Path, + + @OAS2 @OAS3 + In_Query, + + @OAS2 @OAS3 + In_Header, + + @OAS3 + In_Cookie, + + @OAS3 + Style_Matrix, + + @OAS3 + Style_Label, + + @OAS3 + Style_Form, + + @OAS3 + Style_Simple, + + @OAS3 + Style_SpaceDelimited, + + @OAS3 + Style_PipeDelimited, + + @OAS3 + Style_DeepObject, + + @OAS3 + Explode, + + @OAS3 + Schema, + + @OAS3 + Content, +} diff --git a/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/meta/features/SchemaFeature.java b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/meta/features/SchemaFeature.java new file mode 100644 index 00000000000..fc149c5574b --- /dev/null +++ b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/meta/features/SchemaFeature.java @@ -0,0 +1,117 @@ +/* + * Copyright 2019 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapijsonschematools.codegen.meta.features; + +import org.openapijsonschematools.codegen.meta.features.annotations.OAS2; +import org.openapijsonschematools.codegen.meta.features.annotations.OAS3; + +/** + * Defines special circumstances handled by the generator. + */ +public enum SchemaFeature { + @OAS2 @OAS3 + AdditionalProperties, + + /** + * The json schema Composition allOf keyword + * If a composed schema uses the allOf keyword, then payloads must be valid against all the given allOf schemas + */ + @OAS2 @OAS3 + AllOf, + + /** + * The json schema Composition anyOf keyword + * If a composed schema uses the anyOf keyword, then payloads must be valid against any of the given anyOf schemas + */ + @OAS3 + AnyOf, + + @OAS2 @OAS3 + Default, + + @OAS2 @OAS3 + Discriminator, + + @OAS2 @OAS3 + Enum, + + @OAS2 @OAS3 + ExclusiveMinimum, + + @OAS2 @OAS3 + ExclusiveMaximum, + + @OAS2 @OAS3 + Format, + + @OAS2 @OAS3 + Items, + + @OAS2 @OAS3 + MaxItems, + + @OAS2 @OAS3 + MaxLength, + + @OAS2 @OAS3 + MaxProperties, + + @OAS2 @OAS3 + Maximum, + + @OAS2 @OAS3 + MinItems, + + @OAS2 @OAS3 + MinLength, + + @OAS2 @OAS3 + MinProperties, + + @OAS2 @OAS3 + Minimum, + + @OAS2 @OAS3 + MultipleOf, + + @OAS3 + Not, + + @OAS3 + Nullable, + + @OAS3 + OneOf, + + @OAS2 @OAS3 + Pattern, + + @OAS2 @OAS3 + Properties, + + @OAS2 @OAS3 + Required, + + @OAS2 @OAS3 + Type, + + @OAS2 @OAS3 + UniqueItems, + + @OAS2 @OAS3 + Xml +} diff --git a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/meta/features/SecurityFeature.java b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/meta/features/SecurityFeature.java similarity index 87% rename from modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/meta/features/SecurityFeature.java rename to modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/meta/features/SecurityFeature.java index 194141e8d33..a05b649ce96 100644 --- a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/meta/features/SecurityFeature.java +++ b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/meta/features/SecurityFeature.java @@ -14,10 +14,10 @@ * limitations under the License. */ -package org.openapitools.codegen.meta.features; +package org.openapijsonschematools.codegen.meta.features; -import org.openapitools.codegen.meta.features.annotations.OAS2; -import org.openapitools.codegen.meta.features.annotations.OAS3; +import org.openapijsonschematools.codegen.meta.features.annotations.OAS2; +import org.openapijsonschematools.codegen.meta.features.annotations.OAS3; /** * Defines security features supported in the generated code. @@ -27,7 +27,7 @@ public enum SecurityFeature { * Supports header-based basic http auth. */ @OAS2 @OAS3 - BasicAuth, + HTTP_Basic, /** * Supports header-based api-key http auth. @@ -44,8 +44,8 @@ public enum SecurityFeature { /** * Supports header-based bearer auth (e.g. header + bearer format). */ - @OAS3 - BearerToken, + @OAS2 @OAS3 + HTTP_Bearer, /** * Supports authorization via OAuth2 implicit flow. diff --git a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/meta/features/WireFormatFeature.java b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/meta/features/WireFormatFeature.java similarity index 79% rename from modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/meta/features/WireFormatFeature.java rename to modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/meta/features/WireFormatFeature.java index d7b888e12b6..86c5260a0ff 100644 --- a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/meta/features/WireFormatFeature.java +++ b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/meta/features/WireFormatFeature.java @@ -14,11 +14,11 @@ * limitations under the License. */ -package org.openapitools.codegen.meta.features; +package org.openapijsonschematools.codegen.meta.features; -import org.openapitools.codegen.meta.features.annotations.OAS2; -import org.openapitools.codegen.meta.features.annotations.OAS3; -import org.openapitools.codegen.meta.features.annotations.ToolingExtension; +import org.openapijsonschematools.codegen.meta.features.annotations.OAS2; +import org.openapijsonschematools.codegen.meta.features.annotations.OAS3; +import org.openapijsonschematools.codegen.meta.features.annotations.ToolingExtension; /** * Defines wire formats explicitly defined in spec or supported by the tool. diff --git a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/meta/features/annotations/AnnotationType.java b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/meta/features/annotations/AnnotationType.java similarity index 83% rename from modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/meta/features/annotations/AnnotationType.java rename to modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/meta/features/annotations/AnnotationType.java index 82e3886d6be..d3eb16ee21a 100644 --- a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/meta/features/annotations/AnnotationType.java +++ b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/meta/features/annotations/AnnotationType.java @@ -1,4 +1,4 @@ -package org.openapitools.codegen.meta.features.annotations; +package org.openapijsonschematools.codegen.meta.features.annotations; public enum AnnotationType { OAS2, OAS3, ToolingExtension; diff --git a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/meta/features/annotations/OAS2.java b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/meta/features/annotations/OAS2.java similarity index 92% rename from modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/meta/features/annotations/OAS2.java rename to modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/meta/features/annotations/OAS2.java index 3926cfa7971..8ceb90178b4 100644 --- a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/meta/features/annotations/OAS2.java +++ b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/meta/features/annotations/OAS2.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.openapitools.codegen.meta.features.annotations; +package org.openapijsonschematools.codegen.meta.features.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; diff --git a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/meta/features/annotations/OAS3.java b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/meta/features/annotations/OAS3.java similarity index 92% rename from modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/meta/features/annotations/OAS3.java rename to modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/meta/features/annotations/OAS3.java index 75f5b2fc343..59f5acd410b 100644 --- a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/meta/features/annotations/OAS3.java +++ b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/meta/features/annotations/OAS3.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.openapitools.codegen.meta.features.annotations; +package org.openapijsonschematools.codegen.meta.features.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; diff --git a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/meta/features/annotations/ToolingExtension.java b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/meta/features/annotations/ToolingExtension.java similarity index 92% rename from modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/meta/features/annotations/ToolingExtension.java rename to modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/meta/features/annotations/ToolingExtension.java index 5751417bf01..9e7b8aba685 100644 --- a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/meta/features/annotations/ToolingExtension.java +++ b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/meta/features/annotations/ToolingExtension.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.openapitools.codegen.meta.features.annotations; +package org.openapijsonschematools.codegen.meta.features.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; diff --git a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/validation/GenericValidator.java b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/validation/GenericValidator.java similarity index 97% rename from modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/validation/GenericValidator.java rename to modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/validation/GenericValidator.java index 00e4e00e463..64f922fc26e 100644 --- a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/validation/GenericValidator.java +++ b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/validation/GenericValidator.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.openapitools.codegen.validation; +package org.openapijsonschematools.codegen.validation; import java.util.List; diff --git a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/validation/Invalid.java b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/validation/Invalid.java similarity index 97% rename from modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/validation/Invalid.java rename to modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/validation/Invalid.java index 131e7a73465..f1469a03ba1 100644 --- a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/validation/Invalid.java +++ b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/validation/Invalid.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.openapitools.codegen.validation; +package org.openapijsonschematools.codegen.validation; /** * Represents a {@link Validated} state which is "Invalid" to some degree of {@link Severity}. diff --git a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/validation/Severity.java b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/validation/Severity.java similarity index 95% rename from modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/validation/Severity.java rename to modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/validation/Severity.java index e03d0f68c55..9be63d0f536 100644 --- a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/validation/Severity.java +++ b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/validation/Severity.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.openapitools.codegen.validation; +package org.openapijsonschematools.codegen.validation; /** * Defines different levels of severity to be used during validation. diff --git a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/validation/Valid.java b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/validation/Valid.java similarity index 96% rename from modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/validation/Valid.java rename to modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/validation/Valid.java index 350f118ed0d..0803dcb62ac 100644 --- a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/validation/Valid.java +++ b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/validation/Valid.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.openapitools.codegen.validation; +package org.openapijsonschematools.codegen.validation; /** * Represents a {@link Validated} state which is "valid" according to the defined rule. diff --git a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/validation/Validated.java b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/validation/Validated.java similarity index 98% rename from modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/validation/Validated.java rename to modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/validation/Validated.java index 05f9df833e4..d98f68d4611 100644 --- a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/validation/Validated.java +++ b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/validation/Validated.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.openapitools.codegen.validation; +package org.openapijsonschematools.codegen.validation; /** * Provides details about the state of a completed validation. diff --git a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/validation/ValidationResult.java b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/validation/ValidationResult.java similarity index 98% rename from modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/validation/ValidationResult.java rename to modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/validation/ValidationResult.java index 628a11a225c..45b98a857bf 100644 --- a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/validation/ValidationResult.java +++ b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/validation/ValidationResult.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.openapitools.codegen.validation; +package org.openapijsonschematools.codegen.validation; import java.util.ArrayList; import java.util.Collections; diff --git a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/validation/ValidationRule.java b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/validation/ValidationRule.java similarity index 99% rename from modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/validation/ValidationRule.java rename to modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/validation/ValidationRule.java index c20773364b3..1cebb01ee30 100644 --- a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/validation/ValidationRule.java +++ b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/validation/ValidationRule.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.openapitools.codegen.validation; +package org.openapijsonschematools.codegen.validation; import java.util.function.Function; diff --git a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/validation/Validator.java b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/validation/Validator.java similarity index 95% rename from modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/validation/Validator.java rename to modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/validation/Validator.java index fdf23fb3661..6dd15ec88dc 100644 --- a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/validation/Validator.java +++ b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/validation/Validator.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.openapitools.codegen.validation; +package org.openapijsonschematools.codegen.validation; /** * Defines a contract allowing some input to be validated. diff --git a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/meta/features/DataTypeFeature.java b/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/meta/features/DataTypeFeature.java deleted file mode 100644 index d684a6ce6df..00000000000 --- a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/meta/features/DataTypeFeature.java +++ /dev/null @@ -1,262 +0,0 @@ -/* - * Copyright 2019 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen.meta.features; - -import org.openapitools.codegen.meta.features.annotations.OAS2; -import org.openapitools.codegen.meta.features.annotations.OAS3; -import org.openapitools.codegen.meta.features.annotations.ToolingExtension; - -/** - * Defines common data types supported by a generator. - * Some of these features are defined in specs, and some are specific to the tool. - * - * Where data types are listed as tool-specific, this either indicates that the data type is common enough that it is an officially - * supported custom data type by the toolset (see {@link DataTypeFeature#Decimal}), or that the consideration of a special type isn't - * explicitly mentioned by the specification(s) but differs enough across languages that it warrants a special callout (see {@link DataTypeFeature#ArrayOfModel}). - */ -public enum DataTypeFeature { - /** - * Supports a generator-specific support usually via type=string's format property (e.g. email, uuid, etc), should be documented in generator README. - * - *

    Loosely described in OpenAPI Specification(s). Generally means a custom "format" option applied to a string-typed property.

    - */ - @OAS2 @OAS3 - Custom, - - /** - * Supports integer/int32 - */ - @OAS2 @OAS3 - Int32, - - /** - * Supports integer/int64 - */ - @OAS2 @OAS3 - Int64, - - /** - * Supports number/float - */ - @OAS2 @OAS3 - Float, - - /** - * Supports number/double - */ - @OAS2 @OAS3 - Double, - - /** - * Supports number/decimal (a special case for some languages) - * - *

    Decimal is not a type defined by OAS 2.0 specification

    - */ - @ToolingExtension - Decimal, - - /** - * Supports string - */ - @OAS2 @OAS3 - String, - - /** - * Supports string/byte: base64 encoded - */ - @OAS2 @OAS3 - Byte, - - /** - * Supports string/binary: any collection of octets - */ - @OAS2 @OAS3 - Binary, - - /** - * Supports boolean - */ - @OAS2 @OAS3 - Boolean, - - /** - * Supports string/date: full-date RFC3339 - * - * @see RFC3339 - */ - @OAS2 @OAS3 - Date, - - /** - * Supports string/date-time: date-time RFC3339 - * - * @see RFC3339 - */ - @OAS2 @OAS3 - DateTime, - - /** - * Supports string/password: A hint to UIs to obscure input. - * - * - *

    - * This should be used as an indicator for password best practices, such as assigning a variable to - * a character array rather than string, avoiding logging the variable in clear text, and masking the value - * in any user inputs. See OWASP for best practices. - *

    - */ - @OAS2 @OAS3 - Password, - - /** - * Supports file inputs (e.g. multipart support). - * - *

    OAS 3.x defines files differently.

    - *

    - * OAS 3.x does not have an explicit "file" type and instead relies on ContentType or response types. - * That's not to say a generator doesn't support files, only that there's no direct - * "file" type defined in the spec document. - *

    - *

    - * NOTE: The default workflow may provide an "isFile" helper or synthesize the assumptions around files in the case of OAS 3.x. - *

    - */ - @OAS2 - File, - - /** - * String uuid data - */ - Uuid, - - /** - * Supports arrays of data - */ - @OAS2 @OAS3 - Array, - - /** - * A JSON "null" value added in openapi v3.1.0 - */ - @OAS3 - Null, - - /** - * When no type is defined, any data type is accepted - */ - @OAS2 @OAS3 - AnyType, - - /** - * An unordered set of properties mapping a string to an instance - */ - @OAS2 @OAS3 - Object, - - /** - * Supports map of data - */ - @ToolingExtension - Maps, - - /** - * Supports specifying the format of the array if type array is used (one of: csv, ssv, tsv, pipes). - * - *

    - * For multi support, check {@link DataTypeFeature#CollectionFormatMulti}. OAS 3.x removes collectionFormat in favor of Style properties. - *

    - */ - @OAS2 - CollectionFormat, - - /** - * Supports collection format=multi. - * - *

    - * This is special cased because it is not as easily implemented as a delimiter as with CollectionFormat. - * OAS 3.x removes collectionFormat for style properties. - *

    - */ - @OAS2 - CollectionFormatMulti, - - /** - * Supports enum properties - */ - @OAS2 @OAS3 - Enum, - - /** - * Supports an array of enum - */ - @ToolingExtension - ArrayOfEnum, - - /** - * Supports an array of models - */ - @ToolingExtension - ArrayOfModel, - - /** - * Supports an array of arrays (primitives) - */ - @ToolingExtension - ArrayOfCollectionOfPrimitives, - - /** - * Supports an array of arrays (models) - */ - @ToolingExtension - ArrayOfCollectionOfModel, - - /** - * Supports an array of arrays (enums) - */ - @ToolingExtension - ArrayOfCollectionOfEnum, - - /** - * Supports a map of enums - */ - @ToolingExtension - MapOfEnum, - - /** - * Supports a map of models - */ - @ToolingExtension - MapOfModel, - - /** - * Supports a map of arrays (primitives) - */ - @ToolingExtension - MapOfCollectionOfPrimitives, - - /** - * Supports a map of arrays (models) - */ - @ToolingExtension - MapOfCollectionOfModel, - - /** - * Supports a map of arrays (enums) - */ - @ToolingExtension - MapOfCollectionOfEnum, -} diff --git a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/meta/features/DocumentationFeature.java b/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/meta/features/DocumentationFeature.java deleted file mode 100644 index dda611e4740..00000000000 --- a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/meta/features/DocumentationFeature.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2019 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen.meta.features; - -import org.openapitools.codegen.meta.features.annotations.ToolingExtension; - -/** - * Defines the documentation type available in generated output. - */ -public enum DocumentationFeature { - /** - * Generated output includes a README. - */ - @ToolingExtension - Readme, - - /** - * Generated output includes documentation for all generated models. - */ - @ToolingExtension - Model, - - /** - * Generated output includes documentation for all generated APIs. - */ - @ToolingExtension - Api; -} diff --git a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/meta/features/GlobalFeature.java b/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/meta/features/GlobalFeature.java deleted file mode 100644 index f8b2a6d0b6a..00000000000 --- a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/meta/features/GlobalFeature.java +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Copyright 2019 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen.meta.features; - -import org.openapitools.codegen.meta.features.annotations.OAS2; -import org.openapitools.codegen.meta.features.annotations.OAS3; - -/** - * Defines a set of globally available features. That is, support of these are often defined at the top-level of the spec, or - * defines general support of a feature (e.g. Examples, XMLStructureDefinitions). - */ -public enum GlobalFeature { - /** - * Supports specifying the host or ip of the target system. If not defined, this should fall back to the - * host/ip (and optional port) of the server which delivered the spec document. - */ - @OAS2 @OAS3 - Host, - - /** - * Supports providing an API prefix, appended to the host. - * - *

    OAS 3.x supports this indirectly via servers with template variables.

    - */ - @OAS2 @OAS3 - BasePath, - - /** - * Supports passing information about the target server to the client. - * - *

    - * Information passed to generated code should be explicitly documented in a generator's README. - *

    - */ - @OAS2 @OAS3 - Info, - - /** - * Supports customization of the scheme "http", "https", "ws", "wss". - * - *

    - * If a generator only supports partial schemes, please choose the PartialSchemes option. - *

    - * - *

    OAS 3.x supports this indirectly via servers with template variables.

    - */ - @OAS2 @OAS3 - Schemes, - - /** - * Supports fewer than all schemes supported by OpenAPI Specification. - * - *

    - * Support should be explicitly documented in a generator's README. - *

    - * - *

    OAS 3.x supports this indirectly via servers with template variables.

    - */ - @OAS2 @OAS3 - PartialSchemes, - - /** - * Supports a globally defined array of consumable MimeTypes. - * - *

    Global support is undefined in OAS 3.x.

    - */ - @OAS2 - Consumes, - - /** - * Supports a globally defined array of produced MimeTypes. - * - *

    Global support is undefined in OAS 3.x.

    - */ - @OAS2 - Produces, - - /** - * Exposes external documentation defined in the specification document to generated code. - */ - @OAS2 @OAS3 - ExternalDocumentation, - - /** - * Allows the ability to provide example input/output structures, usually in JSON format. - */ - @OAS2 @OAS3 - Examples, - - /** - * Differs from supporting the MimeType.XML feature, in that this option indicates whether XML structures can be defined by spec document and honored by the caller. - */ - @OAS2 @OAS3 - XMLStructureDefinitions, - - /** - * Supports targeting one or more servers. - * - *

    - * That is, server is not hard-coded (although there may be a default). - * This option is valid only for "servers" without open-ended values. - *

    - */ - @OAS3 - MultiServer, - - /** - * Supports targeting one or more servers, PLUS the ability to provide values for templated server parts - */ - @OAS3 - ParameterizedServer, - - /** - * Supports OAS 3.x "style" for parameters. - * - *

    - * NOTE: This option is more relevant for documentation generators which support HTML stylesheets, but may be used - * to determine structural characteristics of a property (as with OAS 3.x lack of collectionFormat). - *

    - */ - @OAS3 - ParameterStyling, - - /** - * Supports OAS 3.x callbacks. - */ - @OAS3 - Callbacks, - - /** - * Supports OAS 3.x link objects, but does *NOT* suggest generated clients auto-follow links. - */ - @OAS3 - LinkObjects -} diff --git a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/meta/features/ParameterFeature.java b/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/meta/features/ParameterFeature.java deleted file mode 100644 index 6c9a3d6b883..00000000000 --- a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/meta/features/ParameterFeature.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright 2019 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen.meta.features; - -import org.openapitools.codegen.meta.features.annotations.OAS2; -import org.openapitools.codegen.meta.features.annotations.OAS3; - -/** - * Defines parameters supported by endpoints in the generated code. - */ -public enum ParameterFeature { - /** - * Supports path parameters. - */ - @OAS2 @OAS3 - Path, - - /** - * Supports query parameters. - */ - @OAS2 @OAS3 - Query, - - /** - * Supports header parameters. - */ - @OAS2 @OAS3 - Header, - - /** - * Supports body parameters. - * - *

    - * OAS 3.x specification supports this structurally rather than as an "in" parameter. - *

    - */ - @OAS2 - Body, - - /** - * Supports form encoded parameters. - * - * OAS 3.x specification supports this structurally via content types rather than as an "in" parameter. - */ - @OAS2 - FormUnencoded, - - /** - * Supports multipart parameters. - * - *

    OAS 3.x specification supports this structurally via content types rather than as an "in" parameter.

    - */ - @OAS2 - FormMultipart, - - /** - * Supports Cookie parameters. - * - *

    Not defined in OAS 2.0 and no tooling extensions currently supported for OAS 2.0 support.

    - */ - @OAS3 - Cookie -} diff --git a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/meta/features/SchemaSupportFeature.java b/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/meta/features/SchemaSupportFeature.java deleted file mode 100644 index 6f453d12e65..00000000000 --- a/modules/openapi-json-schema-generator-core/src/main/java/org/openapitools/codegen/meta/features/SchemaSupportFeature.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright 2019 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen.meta.features; - -import org.openapitools.codegen.meta.features.annotations.OAS2; -import org.openapitools.codegen.meta.features.annotations.OAS3; - -/** - * Defines special circumstances handled by the generator. - */ -public enum SchemaSupportFeature { - /** - * Support of simple schemas (those which define properties directly). - */ - @OAS2 @OAS3 - Simple, - - /** - * Support of complex schemas (those which refer to the properties of another model). - * - *

    In OpenAPI Specification, this indicates support of AllOf/OneOf.

    - */ - @OAS2 @OAS3 - Composite, - - /** - * Support for polymorphic classes. - * - *

    - * This suggests Composite support, but may not always be the case and is therefore separate. - *

    - * - *

    In OpenAPI Specification, this indicates support of AllOf with a discriminator property on the derived schema.

    - */ - @OAS2 @OAS3 - Polymorphism, - - /** - * Support for a union type. - * - *

    - * This means that a single "Type" in generated code may refer to one of any type in a set of 2 or more types. - * - * This is defined as a union as "OneOf" support is not explicitly limited to physical boundaries in OpenAPI Specification. The - * implementation of such a type is easily represented dynamically (a JSON object), but requires explicit language support and - * potentially a custom implementation (typed instances). - * - * Note that a generator may support "Unions" very loosely by returning an Object/Any/ref/interface{} type, leaving onus - * on type determination to the consumer. This does *NOT* suggest generated code implements a "Union Type". - *

    - * - *

    This suggests support of OneOf in OpenAPI Specification with a discriminator.

    - */ - @OAS3 - Union, - - /** - * The json schema Composition allOf keyword - * If a composed schema uses the allOf keyword, then payloads must be valid against all the given allOf schemas - */ - @OAS2 @OAS3 - allOf, - - /** - * The json schema Composition anyOf keyword - * If a composed schema uses the anyOf keyword, then payloads must be valid against any of the given anyOf schemas - */ - @OAS3 - anyOf, - - /** - * The json schema Composition oneOf keyword - * If a composed schema uses the oneOf keyword, then payloads must be valid against one of the given oneOf schemas - */ - @OAS3 - oneOf, - - /** - * The json schema Composition not keyword - * If a composed schema uses the not keyword, then payloads must not be valid against the given not schema - */ - @OAS3 - not -} diff --git a/modules/openapi-json-schema-generator-core/src/test/java/org/openapitools/codegen/config/WorkflowSettingsTest.java b/modules/openapi-json-schema-generator-core/src/test/java/org/openapijsonschematools/codegen/config/WorkflowSettingsTest.java similarity index 98% rename from modules/openapi-json-schema-generator-core/src/test/java/org/openapitools/codegen/config/WorkflowSettingsTest.java rename to modules/openapi-json-schema-generator-core/src/test/java/org/openapijsonschematools/codegen/config/WorkflowSettingsTest.java index 33638f76735..f6bc0c685e6 100644 --- a/modules/openapi-json-schema-generator-core/src/test/java/org/openapitools/codegen/config/WorkflowSettingsTest.java +++ b/modules/openapi-json-schema-generator-core/src/test/java/org/openapijsonschematools/codegen/config/WorkflowSettingsTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.openapitools.codegen.config; +package org.openapijsonschematools.codegen.config; import org.testng.annotations.Test; diff --git a/modules/openapi-json-schema-generator-core/src/test/java/org/openapitools/codegen/meta/FeatureSetTest.java b/modules/openapi-json-schema-generator-core/src/test/java/org/openapijsonschematools/codegen/meta/FeatureSetTest.java similarity index 75% rename from modules/openapi-json-schema-generator-core/src/test/java/org/openapitools/codegen/meta/FeatureSetTest.java rename to modules/openapi-json-schema-generator-core/src/test/java/org/openapijsonschematools/codegen/meta/FeatureSetTest.java index 7378903d471..2c80f4e664b 100644 --- a/modules/openapi-json-schema-generator-core/src/test/java/org/openapitools/codegen/meta/FeatureSetTest.java +++ b/modules/openapi-json-schema-generator-core/src/test/java/org/openapijsonschematools/codegen/meta/FeatureSetTest.java @@ -1,7 +1,13 @@ -package org.openapitools.codegen.meta; - -import org.openapitools.codegen.meta.features.*; -import org.openapitools.codegen.meta.features.annotations.AnnotationType; +package org.openapijsonschematools.codegen.meta; + +import org.openapijsonschematools.codegen.meta.features.ClientModificationFeature; +import org.openapijsonschematools.codegen.meta.features.DataTypeFeature; +import org.openapijsonschematools.codegen.meta.features.DocumentationFeature; +import org.openapijsonschematools.codegen.meta.features.GlobalFeature; +import org.openapijsonschematools.codegen.meta.features.ParameterFeature; +import org.openapijsonschematools.codegen.meta.features.SchemaFeature; +import org.openapijsonschematools.codegen.meta.features.SecurityFeature; +import org.openapijsonschematools.codegen.meta.features.annotations.AnnotationType; import org.testng.annotations.Test; import java.util.ArrayList; @@ -34,11 +40,11 @@ public void flattenOnMultipleFeatures() { FeatureSet featureSet = FeatureSet.newBuilder() .includeClientModificationFeatures(ClientModificationFeature.BasePath) .includeDataTypeFeatures(DataTypeFeature.Int32, DataTypeFeature.Array) - .includeGlobalFeatures(GlobalFeature.Consumes, GlobalFeature.Examples) - .includeParameterFeatures(ParameterFeature.Body, ParameterFeature.Query) - .includeSecurityFeatures(SecurityFeature.BearerToken, SecurityFeature.BasicAuth, SecurityFeature.OAuth2_Implicit) - .includeDocumentationFeatures(DocumentationFeature.Model) - .includeSchemaSupportFeatures(SchemaSupportFeature.Composite) + .includeGlobalFeatures(GlobalFeature.Security, GlobalFeature.Info) + .includeParameterFeatures(ParameterFeature.In_Header, ParameterFeature.In_Query) + .includeSecurityFeatures(SecurityFeature.HTTP_Bearer, SecurityFeature.HTTP_Basic, SecurityFeature.OAuth2_Implicit) + .includeDocumentationFeatures(DocumentationFeature.ComponentSchemas) + .includeSchemaFeatures(SchemaFeature.OneOf) .build(); List flattened = featureSet.flatten(); @@ -79,36 +85,36 @@ public void flattenOnMultipleFeatures() { assertEquals(new HashSet<>(supported.get(2).source), bothSpecs); assertEquals(supported.get(3).featureCategory, DocumentationFeature.class.getSimpleName()); - assertEquals(supported.get(3).featureName, DocumentationFeature.Model.name()); - assertEquals(new HashSet<>(supported.get(3).source), toolingOnly); + assertEquals(supported.get(3).featureName, DocumentationFeature.ComponentSchemas.name()); + assertEquals(new HashSet<>(supported.get(3).source), oas3Only); - assertEquals(supported.get(4).featureCategory, SchemaSupportFeature.class.getSimpleName()); - assertEquals(supported.get(4).featureName, SchemaSupportFeature.Composite.name()); - assertEquals(new HashSet<>(supported.get(4).source), bothSpecs); + assertEquals(supported.get(4).featureCategory, SchemaFeature.class.getSimpleName()); + assertEquals(supported.get(4).featureName, SchemaFeature.OneOf.name()); + assertEquals(new HashSet<>(supported.get(4).source), oas3Only); assertEquals(supported.get(5).featureCategory, GlobalFeature.class.getSimpleName()); - assertEquals(supported.get(5).featureName, GlobalFeature.Consumes.name()); - assertEquals(new HashSet<>(supported.get(5).source), oas2Only); + assertEquals(supported.get(5).featureName, GlobalFeature.Info.name()); + assertEquals(new HashSet<>(supported.get(5).source), bothSpecs); assertEquals(supported.get(6).featureCategory, GlobalFeature.class.getSimpleName()); - assertEquals(supported.get(6).featureName, GlobalFeature.Examples.name()); + assertEquals(supported.get(6).featureName, GlobalFeature.Security.name()); assertEquals(new HashSet<>(supported.get(6).source), bothSpecs); assertEquals(supported.get(7).featureCategory, ParameterFeature.class.getSimpleName()); - assertEquals(supported.get(7).featureName, ParameterFeature.Query.name()); + assertEquals(supported.get(7).featureName, ParameterFeature.In_Query.name()); assertEquals(new HashSet<>(supported.get(7).source), bothSpecs); assertEquals(supported.get(8).featureCategory, ParameterFeature.class.getSimpleName()); - assertEquals(supported.get(8).featureName, ParameterFeature.Body.name()); - assertEquals(new HashSet<>(supported.get(8).source), oas2Only); + assertEquals(supported.get(8).featureName, ParameterFeature.In_Header.name()); + assertEquals(new HashSet<>(supported.get(8).source), bothSpecs); assertEquals(supported.get(9).featureCategory, SecurityFeature.class.getSimpleName()); - assertEquals(supported.get(9).featureName, SecurityFeature.BasicAuth.name()); + assertEquals(supported.get(9).featureName, SecurityFeature.HTTP_Basic.name()); assertEquals(new HashSet<>(supported.get(9).source), bothSpecs); assertEquals(supported.get(10).featureCategory, SecurityFeature.class.getSimpleName()); - assertEquals(supported.get(10).featureName, SecurityFeature.BearerToken.name()); - assertEquals(new HashSet<>(supported.get(10).source), oas3Only); + assertEquals(supported.get(10).featureName, SecurityFeature.HTTP_Bearer.name()); + assertEquals(new HashSet<>(supported.get(10).source), bothSpecs); assertEquals(supported.get(11).featureCategory, SecurityFeature.class.getSimpleName()); assertEquals(supported.get(11).featureName, SecurityFeature.OAuth2_Implicit.name()); diff --git a/modules/openapi-json-schema-generator-core/src/test/java/org/openapitools/codegen/validation/GenericValidatorTest.java b/modules/openapi-json-schema-generator-core/src/test/java/org/openapijsonschematools/codegen/validation/GenericValidatorTest.java similarity index 99% rename from modules/openapi-json-schema-generator-core/src/test/java/org/openapitools/codegen/validation/GenericValidatorTest.java rename to modules/openapi-json-schema-generator-core/src/test/java/org/openapijsonschematools/codegen/validation/GenericValidatorTest.java index 3fa8874ff19..75120247608 100644 --- a/modules/openapi-json-schema-generator-core/src/test/java/org/openapitools/codegen/validation/GenericValidatorTest.java +++ b/modules/openapi-json-schema-generator-core/src/test/java/org/openapijsonschematools/codegen/validation/GenericValidatorTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.openapitools.codegen.validation; +package org.openapijsonschematools.codegen.validation; import org.testng.annotations.Test; diff --git a/modules/openapi-json-schema-generator-core/src/test/java/org/openapitools/codegen/validation/ValidatedTest.java b/modules/openapi-json-schema-generator-core/src/test/java/org/openapijsonschematools/codegen/validation/ValidatedTest.java similarity index 95% rename from modules/openapi-json-schema-generator-core/src/test/java/org/openapitools/codegen/validation/ValidatedTest.java rename to modules/openapi-json-schema-generator-core/src/test/java/org/openapijsonschematools/codegen/validation/ValidatedTest.java index 44cf125f5c7..ddc780c3e2c 100644 --- a/modules/openapi-json-schema-generator-core/src/test/java/org/openapitools/codegen/validation/ValidatedTest.java +++ b/modules/openapi-json-schema-generator-core/src/test/java/org/openapijsonschematools/codegen/validation/ValidatedTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.openapitools.codegen.validation; +package org.openapijsonschematools.codegen.validation; import org.testng.annotations.Test; diff --git a/modules/openapi-json-schema-generator-core/src/test/java/org/openapitools/codegen/validation/ValidationRuleTest.java b/modules/openapi-json-schema-generator-core/src/test/java/org/openapijsonschematools/codegen/validation/ValidationRuleTest.java similarity index 97% rename from modules/openapi-json-schema-generator-core/src/test/java/org/openapitools/codegen/validation/ValidationRuleTest.java rename to modules/openapi-json-schema-generator-core/src/test/java/org/openapijsonschematools/codegen/validation/ValidationRuleTest.java index f75389aafa5..d6149067cc0 100644 --- a/modules/openapi-json-schema-generator-core/src/test/java/org/openapitools/codegen/validation/ValidationRuleTest.java +++ b/modules/openapi-json-schema-generator-core/src/test/java/org/openapijsonschematools/codegen/validation/ValidationRuleTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.openapitools.codegen.validation; +package org.openapijsonschematools.codegen.validation; import org.testng.annotations.Test; diff --git a/modules/openapi-json-schema-generator-online/.openapi-generator/VERSION b/modules/openapi-json-schema-generator-online/.openapi-generator/VERSION deleted file mode 100644 index ad121e8340e..00000000000 --- a/modules/openapi-json-schema-generator-online/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -3.0.1-SNAPSHOT \ No newline at end of file diff --git a/modules/openapi-json-schema-generator-online/Dockerfile b/modules/openapi-json-schema-generator-online/Dockerfile deleted file mode 100644 index 6552a9175c7..00000000000 --- a/modules/openapi-json-schema-generator-online/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -FROM openjdk:8-jre-alpine - -WORKDIR /generator - -COPY target/openapi-jsons-schema-generator-online.jar /generator/openapi-json-schema-generator-online.jar - -# GENERATOR_HOST can be used to determine the target location of a download link. -# The default value assumes binding to host via: docker -p 8080:8080 image_name -# Generally, this "just works" without GENERATOR_HOST, and this is provided only as -# a workaround if all else fails. -ENV GENERATOR_HOST="" - -EXPOSE 8080 - -CMD ["java", "-jar", "/generator/openapi-json-schema-generator-online.jar" ] diff --git a/modules/openapi-json-schema-generator-online/README.md b/modules/openapi-json-schema-generator-online/README.md deleted file mode 100644 index 2c77fa3c69c..00000000000 --- a/modules/openapi-json-schema-generator-online/README.md +++ /dev/null @@ -1,57 +0,0 @@ -# OpenAPI generated server - -A Spring Boot Server application which hosts a client/server generator API. - - -## Overview - -This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. -By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub or one of 100+ client packages. - -This is an example of building a OpenAPI-enabled server in Java using the SpringBoot framework. - -The underlying library integrating OpenAPI to SpringBoot is [springfox](https://github.com/springfox/springfox) - -## Building - -Refer to [root README](../../README.md) for build directions. - -## Running - -### Via command line - -Running is as simple as: - -``` -java -jar ./target/openapi-generator-online.jar -``` - -This exposes the API on local port 8080. - -Springfox supports configuration of the "host" value in the output OpenAPI document by setting the `Host` HTTP header in the request. -To set this explicitly, pass the system property `springfox.documentation.swagger.v2.host` with the desired host. For example: - -``` -java -Dspringfox.documentation.swagger.v2.host=example.com:8888 -jar ./target/openapi-generator-online.jar -``` - -### Via Docker - -After building from source, change to this module directory (`cd modules/openapi-generator-online`) and build the docker image: - -``` -docker build -t openapitools/openapi-generator-online:latest . -``` - -Now, run the docker image: - -``` -docker run -d -p 8888:8080 openapitools/openapi-generator-online -``` - -The `GENERATOR_HOST` variable is used here to ensure download links generated by the API refer to the proper API location. - -## Environment - -`GENERATOR_HOST` can be set to force the scheme/host/port used for download link generation. In most cases, this environment variable is not -necessary to be set and the download link will be generated to match the originating request. The variable is provided simply as a fallback. \ No newline at end of file diff --git a/modules/openapi-json-schema-generator-online/pom.xml b/modules/openapi-json-schema-generator-online/pom.xml deleted file mode 100644 index 05ab87087bc..00000000000 --- a/modules/openapi-json-schema-generator-online/pom.xml +++ /dev/null @@ -1,144 +0,0 @@ - - 4.0.0 - - org.openapitools - openapi-json-schema-generator-project - ${revision} - ../.. - - openapi-json-schema-generator-online - jar - openapi-json-schema-generator-online - - 2.5.5 - 3.0.0 - **/org/openapitools/codegen/online/**/* - - - - - org.springframework.boot - spring-boot-dependencies - ${spring-boot.version} - pom - import - - - - - openapi-json-schema-generator-online - src/main/java - - - src/main/resources - true - - - - - - - org.apache.maven.plugins - maven-checkstyle-plugin - - ${project.parent.basedir}${file.separator}google_checkstyle.xml - - - - org.springframework.boot - spring-boot-maven-plugin - ${spring-boot.version} - - - - repackage - - - - - - - - - - static-analysis - - - - com.github.spotbugs - spotbugs-maven-plugin - - ${project.parent.basedir}${file.separator}spotbugs-exclude.xml - - - - org.apache.maven.plugins - maven-pmd-plugin - - - se.bjurr.violations - violations-maven-plugin - - - 3 - - - - - - - - - org.springframework.boot - spring-boot-starter-web - - - - io.springfox - springfox-swagger2 - ${springfox-version} - - - io.swagger - swagger-annotations - - - io.swagger - swagger-models - - - com.google.guava - guava - - - - - - - jakarta.validation - jakarta.validation-api - - - org.openapitools - openapi-json-schema-generator - ${project.parent.version} - - - - junit - junit - ${junit.version} - test - - - org.springframework.boot - spring-boot-starter-test - test - - - org.springframework.boot - spring-boot-test - test - - - diff --git a/modules/openapi-json-schema-generator-online/sample.json b/modules/openapi-json-schema-generator-online/sample.json deleted file mode 100644 index 22194e36a96..00000000000 --- a/modules/openapi-json-schema-generator-online/sample.json +++ /dev/null @@ -1,479 +0,0 @@ -{ - "opts": {}, - "spec": { - "swagger": "2.0", - "title": "Petstore Sample API", - "info": { - "description": "A sample API that uses a petstore as an example to demonstrate features in the OpenAPI-2.0 specification", - "title": "Petstore Sample API", - "contact": { - "name": "Wordnik API Team" - }, - "license": { - "name": "MIT", - "url": "http://github.com/gruntjs/grunt/blob/master/LICENSE-MIT" - } - }, - "host": "petstore.swagger.io", - "basePath": "/api", - "paths": { - "/pet": { - "put": { - "tags": [ - "pet" - ], - "parameters": [ - { - "name": "body", - "in": "body", - "description": "Pet object that needs to be added to the store", - "required": false, - "schema": { - "$ref": "#/definitions/Pet" - } - } - ], - "responses": { - "405": { - "description": "Validation exception" - }, - "404": { - "description": "Pet not found" - }, - "400": { - "description": "Invalid ID supplied" - } - } - }, - "post": { - "tags": [ - "pet" - ], - "parameters": [ - { - "name": "body", - "in": "body", - "description": "Pet object that needs to be added to the store", - "required": false, - "schema": { - "$ref": "#/definitions/Tag" - } - } - ], - "responses": { - "405": { - "description": "Invalid input" - } - } - } - }, - "/user/createWithList": { - "post": { - "tags": [ - "user" - ], - "parameters": [ - { - "name": "body", - "in": "body", - "description": "List of user object", - "required": false - } - ] - } - }, - "/store/order/{orderId}": { - "get": { - "tags": [ - "store" - ], - "parameters": [ - { - "name": "orderId", - "in": "path", - "description": "ID of pet that needs to be fetched", - "required": true, - "type": "string" - } - ], - "responses": { - "404": { - "description": "Order not found" - }, - "400": { - "description": "Invalid ID supplied" - } - } - }, - "delete": { - "tags": [ - "store" - ], - "parameters": [ - { - "name": "orderId", - "in": "path", - "description": "ID of the order that needs to be deleted", - "required": true, - "type": "string" - } - ], - "responses": { - "404": { - "description": "Order not found" - }, - "400": { - "description": "Invalid ID supplied" - } - } - } - }, - "/user/createWithArray": { - "post": { - "tags": [ - "user" - ], - "parameters": [ - { - "name": "body", - "in": "body", - "description": "List of user object", - "required": false, - "schema": { - "$ref": "#/definitions/User" - } - } - ] - } - }, - "/store/order": { - "post": { - "tags": [ - "store" - ], - "parameters": [ - { - "name": "body", - "in": "body", - "description": "order placed for purchasing the pet", - "required": false, - "schema": { - "$ref": "#/definitions/Order" - } - } - ], - "responses": { - "400": { - "description": "Invalid Order" - } - } - } - }, - "/pet/findByStatus": { - "get": { - "tags": [ - "pet" - ], - "parameters": [ - { - "name": "status", - "in": "query", - "description": "Status values that need to be considered for filter", - "required": false, - "type": "string" - } - ], - "responses": { - "400": { - "description": "Invalid status value" - } - } - } - }, - "/user/{username}": { - "get": { - "tags": [ - "user" - ], - "parameters": [ - { - "name": "username", - "in": "path", - "description": "The name that needs to be fetched. Use user1 for testing. ", - "required": true, - "type": "string" - } - ], - "responses": { - "404": { - "description": "User not found" - }, - "400": { - "description": "Invalid username supplied" - } - } - }, - "put": { - "tags": [ - "user" - ], - "parameters": [ - { - "name": "username", - "in": "path", - "description": "name that need to be deleted", - "required": true, - "type": "string" - }, - { - "name": "body", - "in": "body", - "description": "Updated user object", - "required": false, - "schema": { - "$ref": "#/definitions/User" - } - } - ], - "responses": { - "404": { - "description": "User not found" - }, - "400": { - "description": "Invalid user supplied" - } - } - }, - "delete": { - "tags": [ - "user" - ], - "parameters": [ - { - "name": "username", - "in": "path", - "description": "The name that needs to be deleted", - "required": true, - "type": "string" - } - ], - "responses": { - "404": { - "description": "User not found" - }, - "400": { - "description": "Invalid username supplied" - } - } - } - }, - "/pet/findByTags": { - "get": { - "tags": [ - "pet" - ], - "parameters": [ - { - "name": "tags", - "in": "query", - "description": "Tags to filter by", - "required": false, - "type": "string" - } - ], - "responses": { - "400": { - "description": "Invalid tag value" - } - } - } - }, - "/user": { - "post": { - "tags": [ - "user" - ], - "parameters": [ - { - "name": "body", - "in": "body", - "description": "Created user object", - "required": false, - "schema": { - "$ref": "#/definitions/User" - } - } - ] - } - }, - "/pet/{petId}": { - "get": { - "tags": [ - "pet" - ], - "parameters": [ - { - "name": "petId", - "in": "path", - "description": "ID of pet that needs to be fetched", - "required": true, - "type": "string" - } - ], - "responses": { - "404": { - "description": "Pet not found" - }, - "400": { - "description": "Invalid ID supplied" - } - } - } - }, - "/user/logout": { - "get": { - "tags": [ - "user" - ] - } - }, - "/user/login": { - "get": { - "tags": [ - "user" - ], - "parameters": [ - { - "name": "username", - "in": "query", - "description": "The user name for login", - "required": false, - "type": "string" - }, - { - "name": "password", - "in": "query", - "description": "The password for login in clear text", - "required": false, - "type": "string" - } - ], - "responses": { - "400": { - "description": "Invalid username/password supplied" - } - } - } - } - }, - "definitions": { - "User": { - "properties": { - "id": { - "type": "integer", - "format": "int32" - }, - "lastName": { - "type": "string" - }, - "username": { - "type": "string" - }, - "phone": { - "type": "string" - }, - "email": { - "type": "string" - }, - "userStatus": { - "type": "integer", - "format": "int32" - }, - "firstName": { - "type": "string" - }, - "password": { - "type": "string" - } - } - }, - "Category": { - "properties": { - "id": { - "type": "integer", - "format": "int32" - }, - "name": { - "type": "string" - } - } - }, - "Pet": { - "properties": { - "id": { - "type": "integer", - "format": "int32" - }, - "tags": { - "type": "array", - "items": { - "$ref": "#/definitions/Tag" - } - }, - "category": { - "$ref": "#/definitions/Category" - }, - "status": { - "type": "string" - }, - "name": { - "type": "string" - }, - "photoUrls": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "Tag": { - "properties": { - "id": { - "type": "integer", - "format": "int32" - }, - "name": { - "type": "string" - } - } - }, - "Order": { - "properties": { - "id": { - "type": "integer", - "format": "int32" - }, - "petId": { - "type": "integer", - "format": "int32" - }, - "status": { - "type": "string" - }, - "complete": { - "type": "boolean" - }, - "quantity": { - "type": "integer", - "format": "int32" - }, - "shipDate": { - "type": "string", - "format": "date-time" - } - } - } - } - } -} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator-online/src/main/java/org/openapitools/codegen/online/OpenAPI2SpringBoot.java b/modules/openapi-json-schema-generator-online/src/main/java/org/openapitools/codegen/online/OpenAPI2SpringBoot.java deleted file mode 100644 index c81012e09f6..00000000000 --- a/modules/openapi-json-schema-generator-online/src/main/java/org/openapitools/codegen/online/OpenAPI2SpringBoot.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen.online; - -import org.springframework.boot.CommandLineRunner; -import org.springframework.boot.ExitCodeGenerator; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.web.filter.ForwardedHeaderFilter; -import org.springframework.web.servlet.config.annotation.CorsRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; - -@SpringBootApplication -@ComponentScan(basePackages = { "org.openapitools.codegen.online", "org.openapitools.codegen.online.api", "org.openapitools.codegen.online.configuration"}) -public class OpenAPI2SpringBoot implements CommandLineRunner { - - @Override - public void run(String... arg0) { - if (arg0.length > 0 && arg0[0].equals("exitcode")) { - throw new ExitException(); - } - } - - public static void main(String[] args) { - new SpringApplication(OpenAPI2SpringBoot.class).run(args); - } - - static class ExitException extends RuntimeException implements ExitCodeGenerator { - private static final long serialVersionUID = 1L; - - @Override - public int getExitCode() { - return 10; - } - - } - - @Bean - public WebMvcConfigurer corsConfigurer() { - return new WebMvcConfigurer() { - @Override - public void addCorsMappings(CorsRegistry registry) { - registry.addMapping("/**").allowedOrigins("*").allowedHeaders("Content-Type"); - } - }; - } - - @Bean - ForwardedHeaderFilter forwardedHeaderFilter() { - return new ForwardedHeaderFilter(); - } -} diff --git a/modules/openapi-json-schema-generator-online/src/main/java/org/openapitools/codegen/online/RFC3339DateFormat.java b/modules/openapi-json-schema-generator-online/src/main/java/org/openapitools/codegen/online/RFC3339DateFormat.java deleted file mode 100644 index fa2752bd6f8..00000000000 --- a/modules/openapi-json-schema-generator-online/src/main/java/org/openapitools/codegen/online/RFC3339DateFormat.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen.online; - -import com.fasterxml.jackson.databind.util.ISO8601DateFormat; -import com.fasterxml.jackson.databind.util.ISO8601Utils; - -import java.text.FieldPosition; -import java.util.Date; - - -public class RFC3339DateFormat extends ISO8601DateFormat { - - private static final long serialVersionUID = 1L; - - // Same as ISO8601DateFormat but serializing milliseconds. - @Override - public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { - String value = ISO8601Utils.format(date, true); - toAppendTo.append(value); - return toAppendTo; - } - -} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator-online/src/main/java/org/openapitools/codegen/online/api/ApiOriginFilter.java b/modules/openapi-json-schema-generator-online/src/main/java/org/openapitools/codegen/online/api/ApiOriginFilter.java deleted file mode 100644 index fe721809dc3..00000000000 --- a/modules/openapi-json-schema-generator-online/src/main/java/org/openapitools/codegen/online/api/ApiOriginFilter.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen.online.api; - -import java.io.IOException; - -import javax.servlet.*; -import javax.servlet.http.HttpServletResponse; - - -public class ApiOriginFilter implements javax.servlet.Filter { - @Override - public void doFilter(ServletRequest request, ServletResponse response, - FilterChain chain) throws IOException, ServletException { - HttpServletResponse res = (HttpServletResponse) response; - res.addHeader("Access-Control-Allow-Origin", "*"); - res.addHeader("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT"); - res.addHeader("Access-Control-Allow-Headers", "Content-Type"); - chain.doFilter(request, response); - } - - @Override - public void destroy() { - } - - @Override - public void init(FilterConfig filterConfig) throws ServletException { - } -} diff --git a/modules/openapi-json-schema-generator-online/src/main/java/org/openapitools/codegen/online/api/ApiUtil.java b/modules/openapi-json-schema-generator-online/src/main/java/org/openapitools/codegen/online/api/ApiUtil.java deleted file mode 100644 index f6b510480a2..00000000000 --- a/modules/openapi-json-schema-generator-online/src/main/java/org/openapitools/codegen/online/api/ApiUtil.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen.online.api; - -import org.springframework.web.context.request.NativeWebRequest; - -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; - -public class ApiUtil { - public static void setExampleResponse(NativeWebRequest req, String contentType, String example) { - try { - req.getNativeResponse(HttpServletResponse.class).addHeader("Content-Type", contentType); - req.getNativeResponse(HttpServletResponse.class).getOutputStream().print(example); - } catch (IOException e) { - throw new RuntimeException(e); - } - } -} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator-online/src/main/java/org/openapitools/codegen/online/api/GenApi.java b/modules/openapi-json-schema-generator-online/src/main/java/org/openapitools/codegen/online/api/GenApi.java deleted file mode 100644 index 220a2274459..00000000000 --- a/modules/openapi-json-schema-generator-online/src/main/java/org/openapitools/codegen/online/api/GenApi.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.codegen.online.api; - -import io.swagger.annotations.*; -import org.openapitools.codegen.CliOption; -import org.openapitools.codegen.online.model.GeneratorInput; -import org.openapitools.codegen.online.model.ResponseCode; -import org.springframework.core.io.Resource; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.Valid; -import java.util.List; -import java.util.Map; - -@Api(value = "gen", description = "the gen API") -public interface GenApi { - GenApiDelegate getDelegate(); - - @ApiOperation(value = "Gets languages supported by the client generator", nickname = "clientOptions", notes = "", response = String.class, responseContainer = "List", tags={ "clients", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = String.class, responseContainer = "List") }) - @RequestMapping(value = "/gen/clients", - method = RequestMethod.GET) - default ResponseEntity> clientOptions() { - return getDelegate().clientOptions(); - } - - - @ApiOperation(value = "Downloads a pre-generated file", nickname = "downloadFile", notes = "A valid `fileId` is generated by the `/clients/{language}` or `/servers/{language}` POST operations. The fileId code can be used just once, after which a new `fileId` will need to be requested.", response = MultipartFile.class, tags={ "clients","servers", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = MultipartFile.class) }) - @RequestMapping(value = "/gen/download/{fileId}", - produces = { "application/octet-stream" }, - method = RequestMethod.GET) - default ResponseEntity downloadFile(@ApiParam(value = "",required=true) @PathVariable("fileId") String fileId) { - return getDelegate().downloadFile(fileId); - } - - - @ApiOperation(value = "Generates a client library", nickname = "generateClient", notes = "Accepts a `GeneratorInput` options map for spec location and generation options", response = ResponseCode.class, tags={ "clients", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = ResponseCode.class) }) - @RequestMapping(value = "/gen/clients/{language}", - method = RequestMethod.POST) - default ResponseEntity generateClient(@ApiParam(value = "The target language for the client library",required=true) @PathVariable("language") String language,@ApiParam(value = "Configuration for building the client library" ,required=true ) @Valid @RequestBody GeneratorInput generatorInput) { - return getDelegate().generateClient(language, generatorInput); - } - - - @ApiOperation(value = "Generates a server library", nickname = "generateServerForLanguage", notes = "Accepts a `GeneratorInput` options map for spec location and generation options.", response = ResponseCode.class, tags={ "servers", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = ResponseCode.class) }) - @RequestMapping(value = "/gen/servers/{framework}", - method = RequestMethod.POST) - default ResponseEntity generateServerForLanguage(@ApiParam(value = "framework",required=true) @PathVariable("framework") String framework,@ApiParam(value = "parameters" ,required=true ) @Valid @RequestBody GeneratorInput generatorInput) { - return getDelegate().generateServerForLanguage(framework, generatorInput); - } - - - @ApiOperation(value = "Returns options for a client library", nickname = "getClientOptions", notes = "", tags={ "clients", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/gen/clients/{language}", - produces = { "application/json" }, - method = RequestMethod.GET) - default ResponseEntity> getClientOptions(@ApiParam(value = "The target language for the client library",required=true) @PathVariable("language") String language) { - return getDelegate().getClientOptions(language); - } - - - @ApiOperation(value = "Returns options for a server framework", nickname = "getServerOptions", notes = "", tags={ "servers", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/gen/servers/{framework}", - produces = { "application/json" }, - method = RequestMethod.GET) - default ResponseEntity> getServerOptions(@ApiParam(value = "The target language for the server framework",required=true) @PathVariable("framework") String framework) { - return getDelegate().getServerOptions(framework); - } - - - @ApiOperation(value = "Gets languages supported by the server generator", nickname = "serverOptions", notes = "", response = String.class, responseContainer = "List", tags={ "servers", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = String.class, responseContainer = "List") }) - @RequestMapping(value = "/gen/servers", - method = RequestMethod.GET) - default ResponseEntity> serverOptions() { - return getDelegate().serverOptions(); - } - -} diff --git a/modules/openapi-json-schema-generator-online/src/main/java/org/openapitools/codegen/online/api/GenApiController.java b/modules/openapi-json-schema-generator-online/src/main/java/org/openapitools/codegen/online/api/GenApiController.java deleted file mode 100644 index 190cc107ed2..00000000000 --- a/modules/openapi-json-schema-generator-online/src/main/java/org/openapitools/codegen/online/api/GenApiController.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen.online.api; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; - -@Controller -@RequestMapping("/api") -public class GenApiController implements GenApi { - - private final GenApiDelegate delegate; - - @Autowired - public GenApiController(GenApiDelegate delegate) { - this.delegate = delegate; - } - - @Override - public GenApiDelegate getDelegate() { - return delegate; - } -} diff --git a/modules/openapi-json-schema-generator-online/src/main/java/org/openapitools/codegen/online/api/GenApiDelegate.java b/modules/openapi-json-schema-generator-online/src/main/java/org/openapitools/codegen/online/api/GenApiDelegate.java deleted file mode 100644 index e2f6be0dae2..00000000000 --- a/modules/openapi-json-schema-generator-online/src/main/java/org/openapitools/codegen/online/api/GenApiDelegate.java +++ /dev/null @@ -1,148 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen.online.api; - -import org.openapitools.codegen.CliOption; -import org.openapitools.codegen.online.model.GeneratorInput; -import org.openapitools.codegen.online.model.ResponseCode; -import org.springframework.core.io.Resource; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.web.context.request.NativeWebRequest; - -import java.util.List; -import java.util.Map; -import java.util.Optional; - -/** - * A delegate to be called by the {@link GenApiController}}. - * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. - */ - -public interface GenApiDelegate { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * @see GenApi#clientOptions - * @return A {@link ResponseEntity} listing options for the target client generator. - */ - default ResponseEntity> clientOptions() { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - ApiUtil.setExampleResponse(request, "*/*", "\"\""); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * @param fileId The unique id of the file, provided in a {@link ResponseCode} response. - * @see GenApi#downloadFile - * @return A {@link ResponseEntity} of the requested {@link Resource}. - */ - default ResponseEntity downloadFile(String fileId) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * @param language The target generator (language is a misnomer here, but kept for API consistency). - * @param generatorInput The configuration settings to be used during client generation. - * @see GenApi#generateClient - * @return A {@link ResponseEntity} referencing the unique download id and a link to download the requested client code. - */ - default ResponseEntity generateClient( String language, - GeneratorInput generatorInput) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - ApiUtil.setExampleResponse(request, "*/*", "{ \"code\" : \"d40029be-eda6-4d62-b1ef-d05e2e91a72a\", \"link\" : \"http://localhost:80/api/gen/download/d40029be-eda6-4d62-b1ef-d05e2e91a72a\"}"); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * @param framework The target generator name (framework is a slight misnomer here, as we may have a framework like Spring implemented in multiple languages). - * @param generatorInput The configuration settings to be used during server generation. - * @see GenApi#generateServerForLanguage - * @return A {@link ResponseEntity} referencing the unique download id and a link to download the requested server code. - */ - default ResponseEntity generateServerForLanguage( String framework, - GeneratorInput generatorInput) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - ApiUtil.setExampleResponse(request, "*/*", "{ \"code\" : \"d40029be-eda6-4d62-b1ef-d05e2e91a72a\", \"link\" : \"http://localhost:80/api/gen/download/d40029be-eda6-4d62-b1ef-d05e2e91a72a\"}"); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * @param language The target generator (language is a misnomer here, but kept for API consistency). - * @see GenApi#getClientOptions - * @return A {@link ResponseEntity} of {@link CliOption}, grouped by language (generator name). - */ - default ResponseEntity> getClientOptions(String language) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * @param framework The target generator name (framework is a slight misnomer here, as we may have a framework like Spring implemented in multiple languages). - * @see GenApi#getServerOptions - * @return A {@link ResponseEntity} of {@link CliOption}, grouped by framework (generator name). - */ - default ResponseEntity> getServerOptions( String framework) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * @see GenApi#serverOptions - * @return A {@link ResponseEntity} listing options for the target server generator. - */ - default ResponseEntity> serverOptions() { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - ApiUtil.setExampleResponse(request, "*/*", "\"\""); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - -} diff --git a/modules/openapi-json-schema-generator-online/src/main/java/org/openapitools/codegen/online/configuration/HomeController.java b/modules/openapi-json-schema-generator-online/src/main/java/org/openapitools/codegen/online/configuration/HomeController.java deleted file mode 100644 index e1e10377ca6..00000000000 --- a/modules/openapi-json-schema-generator-online/src/main/java/org/openapitools/codegen/online/configuration/HomeController.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen.online.configuration; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; - -/** - * Home redirection to api documentation - */ -@Controller -public class HomeController { - @RequestMapping("/") - public String index() { - return "redirect:index.html"; - } - - -} diff --git a/modules/openapi-json-schema-generator-online/src/main/java/org/openapitools/codegen/online/configuration/OpenAPIDocumentationConfig.java b/modules/openapi-json-schema-generator-online/src/main/java/org/openapitools/codegen/online/configuration/OpenAPIDocumentationConfig.java deleted file mode 100644 index 3169c5e8739..00000000000 --- a/modules/openapi-json-schema-generator-online/src/main/java/org/openapitools/codegen/online/configuration/OpenAPIDocumentationConfig.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen.online.configuration; - -import com.fasterxml.jackson.databind.JsonNode; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.core.io.Resource; -import springfox.documentation.builders.ApiInfoBuilder; -import springfox.documentation.builders.RequestHandlerSelectors; -import springfox.documentation.service.ApiInfo; -import springfox.documentation.service.Contact; -import springfox.documentation.spi.DocumentationType; -import springfox.documentation.spring.web.plugins.Docket; -import springfox.documentation.swagger2.annotations.EnableSwagger2; -import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.IOException; -import java.io.InputStream; -import java.net.URI; -import java.net.URISyntaxException; -import java.util.Properties; -import java.util.Set; -import java.util.HashSet; - - -@Configuration -@EnableSwagger2 -public class OpenAPIDocumentationConfig { - private final Logger LOGGER = LoggerFactory.getLogger(OpenAPIDocumentationConfig.class); - - ApiInfo apiInfo() { - final Properties properties = new Properties(); - try (InputStream stream = this.getClass().getResourceAsStream("/version.properties")) { - if (stream != null) { - properties.load(stream); - } - } catch (IOException ex) { - // ignore - } - - String version = properties.getProperty("version", "unknown"); - - return new ApiInfoBuilder() - .title("OpenAPI Generator Online") - .description("This is an online openapi generator server. You can find out more at https://github.com/OpenAPITools/openapi-generator.") - .license("Apache 2.0") - .licenseUrl("https://www.apache.org/licenses/LICENSE-2.0.html") - .termsOfServiceUrl("") - .version(version) - .contact(new Contact("","", "")) - .build(); - } - - @Bean - public Docket customImplementation(){ - Docket docket = new Docket(DocumentationType.SWAGGER_2) - .select() - .apis(RequestHandlerSelectors.basePackage("org.openapitools.codegen.online.api")) - .build() - .forCodeGeneration(true) - .directModelSubstitute(java.time.LocalDate.class, java.sql.Date.class) - .directModelSubstitute(java.time.OffsetDateTime.class, java.util.Date.class) - .directModelSubstitute(JsonNode.class, java.lang.Object.class) - .ignoredParameterTypes(Resource.class) - .ignoredParameterTypes(InputStream.class) - .apiInfo(apiInfo()); - - String hostString = System.getenv("GENERATOR_HOST"); - if (!StringUtils.isBlank(hostString)) { - try { - URI hostURI = new URI(hostString); - String scheme = hostURI.getScheme(); - if (scheme != null) { - Set protocols = new HashSet(); - protocols.add(scheme); - docket.protocols(protocols); - } - String authority = hostURI.getAuthority(); - if (authority != null) { - // In OpenAPI `host` refers to host _and_ port, a.k.a. the URI authority - docket.host(authority); - } - docket.pathMapping(hostURI.getPath()); - } catch(URISyntaxException e) { - LOGGER.warn("Could not parse configured GENERATOR_HOST '" + hostString + "': " + e.getMessage()); - } - } - - return docket; - } - -} diff --git a/modules/openapi-json-schema-generator-online/src/main/java/org/openapitools/codegen/online/configuration/ParameterAllowableValuesPlugin.java b/modules/openapi-json-schema-generator-online/src/main/java/org/openapitools/codegen/online/configuration/ParameterAllowableValuesPlugin.java deleted file mode 100644 index 00014f5ab9b..00000000000 --- a/modules/openapi-json-schema-generator-online/src/main/java/org/openapitools/codegen/online/configuration/ParameterAllowableValuesPlugin.java +++ /dev/null @@ -1,54 +0,0 @@ -package org.openapitools.codegen.online.configuration; - -import org.openapitools.codegen.CodegenConfig; -import org.openapitools.codegen.CodegenConfigLoader; -import org.openapitools.codegen.CodegenType; -import org.springframework.stereotype.Component; -import springfox.documentation.service.AllowableListValues; -import springfox.documentation.spi.DocumentationType; -import springfox.documentation.spi.service.ParameterBuilderPlugin; -import springfox.documentation.spi.service.contexts.ParameterContext; - -import java.util.ArrayList; -import java.util.List; - -@Component -public class ParameterAllowableValuesPlugin implements ParameterBuilderPlugin { - - private static List clients = new ArrayList<>(); - private static List servers = new ArrayList<>(); - - static { - List extensions = CodegenConfigLoader.getAll(); - for (CodegenConfig config : extensions) { - if (config.getTag().equals(CodegenType.CLIENT) - || config.getTag().equals(CodegenType.DOCUMENTATION)) { - clients.add(config.getName()); - } else if (config.getTag().equals(CodegenType.SERVER)) { - servers.add(config.getName()); - } - } - - clients.sort(String.CASE_INSENSITIVE_ORDER); - servers.sort(String.CASE_INSENSITIVE_ORDER); - } - - @Override - public void apply(ParameterContext parameterContext) { - String name = parameterContext.getOperationContext().getName(); - switch (name) { - case "getClientOptions": - case "generateClient": - parameterContext.parameterBuilder().allowableValues(new AllowableListValues(clients, "string")); - break; - case "getServerOptions": - case "generateServerForLanguage": - parameterContext.parameterBuilder().allowableValues(new AllowableListValues(servers, "string")); - } - } - - @Override - public boolean supports(DocumentationType documentationType) { - return true; - } -} diff --git a/modules/openapi-json-schema-generator-online/src/main/java/org/openapitools/codegen/online/model/ApiResponse.java b/modules/openapi-json-schema-generator-online/src/main/java/org/openapitools/codegen/online/model/ApiResponse.java deleted file mode 100644 index b1a1938200b..00000000000 --- a/modules/openapi-json-schema-generator-online/src/main/java/org/openapitools/codegen/online/model/ApiResponse.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen.online.model; - -import javax.xml.bind.annotation.XmlTransient; - -@javax.xml.bind.annotation.XmlRootElement -public class ApiResponse { - public static final int ERROR = 1; - public static final int WARNING = 2; - public static final int INFO = 3; - public static final int OK = 4; - public static final int TOO_BUSY = 5; - - int code; - String type; - String message; - - public ApiResponse() {} - - public ApiResponse(int code, String message) { - this.code = code; - switch (code) { - case ERROR: - setType("error"); - break; - case WARNING: - setType("warning"); - break; - case INFO: - setType("info"); - break; - case OK: - setType("ok"); - break; - case TOO_BUSY: - setType("too busy"); - break; - default: - setType("unknown"); - break; - } - this.message = message; - } - - @XmlTransient - public int getCode() { - return code; - } - - public void setCode(int code) { - this.code = code; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } -} diff --git a/modules/openapi-json-schema-generator-online/src/main/java/org/openapitools/codegen/online/model/Generated.java b/modules/openapi-json-schema-generator-online/src/main/java/org/openapitools/codegen/online/model/Generated.java deleted file mode 100644 index 832e178caf9..00000000000 --- a/modules/openapi-json-schema-generator-online/src/main/java/org/openapitools/codegen/online/model/Generated.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen.online.model; - -public class Generated { - private String filename; - private String friendlyName; - - public String getFilename() { - return filename; - } - - public void setFilename(String filename) { - this.filename = filename; - } - - public String getFriendlyName() { - return friendlyName; - } - - public void setFriendlyName(String friendlyName) { - this.friendlyName = friendlyName; - } -} diff --git a/modules/openapi-json-schema-generator-online/src/main/java/org/openapitools/codegen/online/model/GeneratorInput.java b/modules/openapi-json-schema-generator-online/src/main/java/org/openapitools/codegen/online/model/GeneratorInput.java deleted file mode 100644 index 15c71a60c2c..00000000000 --- a/modules/openapi-json-schema-generator-online/src/main/java/org/openapitools/codegen/online/model/GeneratorInput.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen.online.model; - -import com.fasterxml.jackson.databind.JsonNode; -import io.swagger.annotations.ApiModelProperty; -import io.swagger.v3.parser.core.models.AuthorizationValue; - -import java.util.Map; - -public class GeneratorInput { - private JsonNode spec; - private Map options; - private String openAPIUrl; - private AuthorizationValue authorizationValue; - - public AuthorizationValue getAuthorizationValue() { - return authorizationValue; - } - - public void setAuthorizationValue(AuthorizationValue authorizationValue) { - this.authorizationValue = authorizationValue; - } - - public JsonNode getSpec() { - return spec; - } - - public void setSpec(JsonNode spec) { - this.spec = spec; - } - - public Map getOptions() { - return options; - } - - public void setOptions(Map options) { - this.options = options; - } - - @ApiModelProperty(example = "https://raw.githubusercontent.com/OpenAPITools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml") - public String getOpenAPIUrl() { - return openAPIUrl; - } - - public void setOpenAPIUrl(String url) { - this.openAPIUrl = url; - } -} diff --git a/modules/openapi-json-schema-generator-online/src/main/java/org/openapitools/codegen/online/model/ResponseCode.java b/modules/openapi-json-schema-generator-online/src/main/java/org/openapitools/codegen/online/model/ResponseCode.java deleted file mode 100644 index a8af9ab76ff..00000000000 --- a/modules/openapi-json-schema-generator-online/src/main/java/org/openapitools/codegen/online/model/ResponseCode.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen.online.model; - -import io.swagger.annotations.ApiModelProperty; - -public class ResponseCode { - private String code; - private String link; - - public ResponseCode() {} - - public ResponseCode(String code, String link) { - setCode(code); - setLink(link); - } - - @ApiModelProperty(value = "File download code", - example = "d40029be-eda6-4d62-b1ef-d05e2e91a72a") - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - @ApiModelProperty( - value = "URL for fetching the generated client", - example = "http://localhost:8080/api/gen/download/d40029be-eda6-4d62-b1ef-d05e2e91a72a") - public String getLink() { - return link; - } - - public void setLink(String link) { - this.link = link; - } -} diff --git a/modules/openapi-json-schema-generator-online/src/main/java/org/openapitools/codegen/online/service/GenApiService.java b/modules/openapi-json-schema-generator-online/src/main/java/org/openapitools/codegen/online/service/GenApiService.java deleted file mode 100644 index f10599b5937..00000000000 --- a/modules/openapi-json-schema-generator-online/src/main/java/org/openapitools/codegen/online/service/GenApiService.java +++ /dev/null @@ -1,184 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen.online.service; - -import org.apache.commons.io.FileUtils; -import org.apache.commons.lang3.StringUtils; -import org.openapitools.codegen.CliOption; -import org.openapitools.codegen.CodegenConfig; -import org.openapitools.codegen.CodegenConfigLoader; -import org.openapitools.codegen.CodegenType; -import org.openapitools.codegen.online.api.GenApiDelegate; -import org.openapitools.codegen.online.model.Generated; -import org.openapitools.codegen.online.model.GeneratorInput; -import org.openapitools.codegen.online.model.ResponseCode; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.core.io.ByteArrayResource; -import org.springframework.core.io.Resource; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Service; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.server.ResponseStatusException; -import org.springframework.web.servlet.support.ServletUriComponentsBuilder; -import org.springframework.web.util.UriComponentsBuilder; - -import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.*; - -@Service -public class GenApiService implements GenApiDelegate { - - private static List clients = new ArrayList<>(); - private static List servers = new ArrayList<>(); - private static Map fileMap = new HashMap<>(); - - static { - List extensions = CodegenConfigLoader.getAll(); - for (CodegenConfig config : extensions) { - if (config.getTag().equals(CodegenType.CLIENT) - || config.getTag().equals(CodegenType.DOCUMENTATION)) { - clients.add(config.getName()); - } else if (config.getTag().equals(CodegenType.SERVER)) { - servers.add(config.getName()); - } - } - - clients.sort(String.CASE_INSENSITIVE_ORDER); - servers.sort(String.CASE_INSENSITIVE_ORDER); - } - - @Autowired - private NativeWebRequest request; - - @Override - public Optional getRequest() { - return Optional.ofNullable(request); - } - - @Override - public ResponseEntity downloadFile(String fileId) { - Generated g = fileMap.get(fileId); - System.out.println("looking for fileId " + fileId); - System.out.println("got filename " + g.getFilename()); - - File file = new File(g.getFilename()); - Path path = Paths.get(file.getAbsolutePath()); - ByteArrayResource resource; - try { - resource = new ByteArrayResource(Files.readAllBytes(path)); - } catch (FileNotFoundException e) { - throw new ResponseStatusException(HttpStatus.NOT_FOUND, "File not found", e); - } catch (IOException e) { - throw new ResponseStatusException(HttpStatus.INTERNAL_SERVER_ERROR, "I/O error while reading file", e); - } - try { - FileUtils.deleteDirectory(file.getParentFile()); - } catch (IOException e) { - System.out.println("failed to delete file " + file.getAbsolutePath()); - } - return ResponseEntity - .ok() - .contentType(MediaType.valueOf("application/zip")) - .header("Content-Disposition", - "attachment; filename=\"" + g.getFriendlyName() + "-generated.zip\"") - .header("Accept-Range", "bytes") - //.header("Content-Length", bytes.length) - .body(resource); - } - - @Override - public ResponseEntity generateClient(String language, GeneratorInput generatorInput) { - String filename = Generator.generateClient(language, generatorInput); - return getResponse(filename, language + "-client"); - } - - @Override - public ResponseEntity> getClientOptions(String language) { - Map opts = Generator.getOptions(language); - - if (opts != null) { - return ResponseEntity.ok().body(opts); - } else { - return ResponseEntity.notFound().build(); - } - } - - @Override - public ResponseEntity> getServerOptions(String framework) { - Map opts = Generator.getOptions(framework); - - if (opts != null) { - return ResponseEntity.ok().body(opts); - } else { - return ResponseEntity.notFound().build(); - } - } - - @Override - public ResponseEntity> clientOptions() { - return ResponseEntity.ok().body(clients); - } - - @Override - public ResponseEntity> serverOptions() { - return ResponseEntity.ok().body(servers); - } - - @Override - public ResponseEntity generateServerForLanguage(String framework, GeneratorInput generatorInput) { - if (framework == null) { - throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "Framework is required"); - } - String filename = Generator.generateServer(framework, generatorInput); - System.out.println("generated name: " + filename); - - return getResponse(filename, framework + "-server"); - } - - private ResponseEntity getResponse(String filename, String friendlyName) { - String host = System.getenv("GENERATOR_HOST"); - - UriComponentsBuilder uriBuilder; - if (!StringUtils.isBlank(host)) { - uriBuilder = UriComponentsBuilder.fromUriString(host); - } else { - uriBuilder = ServletUriComponentsBuilder.fromCurrentContextPath(); - } - - if (filename != null) { - String code = UUID.randomUUID().toString(); - Generated g = new Generated(); - g.setFilename(filename); - g.setFriendlyName(friendlyName); - fileMap.put(code, g); - System.out.println(code + ", " + filename); - String link = uriBuilder.path("/api/gen/download/").path(code).toUriString(); - return ResponseEntity.ok().body(new ResponseCode(code, link)); - } else { - return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).build(); - } - } - -} diff --git a/modules/openapi-json-schema-generator-online/src/main/java/org/openapitools/codegen/online/service/Generator.java b/modules/openapi-json-schema-generator-online/src/main/java/org/openapitools/codegen/online/service/Generator.java deleted file mode 100644 index 7cf052e3083..00000000000 --- a/modules/openapi-json-schema-generator-online/src/main/java/org/openapitools/codegen/online/service/Generator.java +++ /dev/null @@ -1,192 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen.online.service; - -import com.fasterxml.jackson.databind.JsonNode; -import io.swagger.parser.OpenAPIParser; -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.parser.core.models.AuthorizationValue; -import io.swagger.v3.parser.core.models.ParseOptions; -import org.openapitools.codegen.CliOption; -import org.openapitools.codegen.ClientOptInput; -import org.openapitools.codegen.CodegenConfig; -import org.openapitools.codegen.CodegenConfigLoader; -import org.openapitools.codegen.DefaultGenerator; -import org.openapitools.codegen.online.model.GeneratorInput; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.http.HttpStatus; -import org.springframework.web.server.ResponseStatusException; - -import java.io.File; -import java.nio.file.Files; -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Locale; -import java.util.Map; - -public class Generator { - private static Logger LOGGER = LoggerFactory.getLogger(Generator.class); - - public static Map getOptions(String language) { - CodegenConfig config; - try { - config = CodegenConfigLoader.forName(language); - } catch (Exception e) { - throw new ResponseStatusException(HttpStatus.NOT_FOUND, String.format(Locale.ROOT,"Unsupported target %s supplied. %s", - language, e)); - } - Map map = new LinkedHashMap<>(); - for (CliOption option : config.cliOptions()) { - map.put(option.getOpt(), option); - } - return map; - } - - public enum Type { - CLIENT("client"), SERVER("server"); - - private String name; - - Type(String name) { - this.name = name; - } - - String getTypeName() { - return name; - } - } - - public static String generateClient(String language, GeneratorInput opts) { - return generate(language, opts, Type.CLIENT); - } - - public static String generateServer(String language, GeneratorInput opts) { - return generate(language, opts, Type.SERVER); - } - - private static String generate(String language, GeneratorInput opts, Type type) { - LOGGER.debug(String.format(Locale.ROOT,"generate %s for %s", type.getTypeName(), language)); - if (opts == null) { - throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "No options were supplied"); - } - JsonNode node = opts.getSpec(); - if (node != null && "{}".equals(node.toString())) { - LOGGER.debug("ignoring empty spec"); - node = null; - } - OpenAPI openapi; - ParseOptions parseOptions = new ParseOptions(); - parseOptions.setResolve(true); - if (node == null) { - if (opts.getOpenAPIUrl() != null) { - if (opts.getAuthorizationValue() != null) { - List authorizationValues = new ArrayList<>(); - authorizationValues.add(opts.getAuthorizationValue()); - openapi = new OpenAPIParser().readLocation(opts.getOpenAPIUrl(), authorizationValues, parseOptions).getOpenAPI(); - } else { - openapi = new OpenAPIParser().readLocation(opts.getOpenAPIUrl(), null, parseOptions).getOpenAPI(); - } - } else { - throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "No OpenAPI specification was supplied"); - } - } else if (opts.getAuthorizationValue() != null) { - List authorizationValues = new ArrayList<>(); - authorizationValues.add(opts.getAuthorizationValue()); - openapi = new OpenAPIParser().readContents(node.toString(), authorizationValues, parseOptions).getOpenAPI(); - - } else { - openapi = new OpenAPIParser().readContents(node.toString(), null, parseOptions).getOpenAPI(); - } - if (openapi == null) { - throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The OpenAPI specification supplied was not valid"); - } - - String destPath = null; - - if (opts.getOptions() != null) { - destPath = opts.getOptions().get("outputFolder"); - } - if (destPath == null) { - destPath = language + "-" + type.getTypeName(); - } - - ClientOptInput clientOptInput = new ClientOptInput(); - String outputFolder = getTmpFolder().getAbsolutePath() + File.separator + destPath; - String outputFilename = outputFolder + "-bundle.zip"; - - clientOptInput.openAPI(openapi); - - CodegenConfig codegenConfig; - try { - codegenConfig = CodegenConfigLoader.forName(language); - } catch (RuntimeException e) { - throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "Unsupported target " + language + " supplied"); - } - - if (opts.getOptions() != null) { - codegenConfig.additionalProperties().putAll(opts.getOptions()); - codegenConfig.additionalProperties().put("openAPI", openapi); - } - - codegenConfig.setOutputDir(outputFolder); - - clientOptInput.config(codegenConfig); - - try { - List files = new DefaultGenerator().opts(clientOptInput).generate(); - if (files.size() > 0) { - List filesToAdd = new ArrayList<>(); - LOGGER.debug("adding to {}", outputFolder); - filesToAdd.add(new File(outputFolder)); - ZipUtil zip = new ZipUtil(); - zip.compressFiles(filesToAdd, outputFilename); - } else { - throw new ResponseStatusException(HttpStatus.BAD_REQUEST, - "A target generation was attempted, but no files were created!"); - } - for (File file : files) { - try { - file.delete(); - } catch (Exception e) { - LOGGER.error("unable to delete file " + file.getAbsolutePath(), e); - } - } - try { - new File(outputFolder).delete(); - } catch (Exception e) { - LOGGER.error("unable to delete output folder " + outputFolder, e); - } - } catch (Exception e) { - throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "Unable to build target: " + e.getMessage(), e); - } - return outputFilename; - } - - private static File getTmpFolder() { - try { - File outputFolder = Files.createTempDirectory("codegen-tmp").toFile(); - outputFolder.deleteOnExit(); - return outputFolder; - } catch (Exception e) { - e.printStackTrace(); - throw new RuntimeException("Cannot access tmp folder"); - } - } -} diff --git a/modules/openapi-json-schema-generator-online/src/main/java/org/openapitools/codegen/online/service/ZipUtil.java b/modules/openapi-json-schema-generator-online/src/main/java/org/openapitools/codegen/online/service/ZipUtil.java deleted file mode 100644 index 25d1aad7edb..00000000000 --- a/modules/openapi-json-schema-generator-online/src/main/java/org/openapitools/codegen/online/service/ZipUtil.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen.online.service; - -import java.io.BufferedInputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.util.List; -import java.util.zip.ZipEntry; -import java.util.zip.ZipOutputStream; - -/** - * This utility compresses a list of files to standard ZIP format file. It is able to compresses all - * sub files and sub directories, recursively. - * - * @author Ha Minh Nam - * - */ -public class ZipUtil { - /** - * A constants for buffer size used to read/write data. - */ - private static final int BUFFER_SIZE = 4096; - - /** - * Compresses a collection of files to a destination zip file. - * - * @param listFiles A collection of files and directories - * @param destZipFile The path of the destination zip file - * @throws FileNotFoundException if file not found - * @throws IOException if IO exception occurs - */ - public void compressFiles(List listFiles, String destZipFile) - throws IOException { - - try (FileOutputStream fileOutputStream = new FileOutputStream(destZipFile); - ZipOutputStream zos = new ZipOutputStream(fileOutputStream)) { - - for (File file : listFiles) { - if (file.isDirectory()) { - addFolderToZip(file, file.getName(), zos); - } else { - addFileToZip(file, zos); - } - } - - zos.flush(); - } - } - - /** - * Adds a directory to the current zip output stream. - * - * @param folder the directory to be added - * @param parentFolder the path of parent directory - * @param zos the current zip output stream - * @throws FileNotFoundException if file not found - * @throws IOException if IO exception occurs - */ - private void addFolderToZip(File folder, String parentFolder, ZipOutputStream zos) - throws FileNotFoundException, IOException { - for (File file : folder.listFiles()) { - if (file.isDirectory()) { - addFolderToZip(file, parentFolder + "/" + file.getName(), zos); - continue; - } - - zos.putNextEntry(new ZipEntry(parentFolder + "/" + file.getName())); - - try (FileInputStream fileInputStream = new FileInputStream(file); - BufferedInputStream bis = new BufferedInputStream(fileInputStream)) { - byte[] bytesIn = new byte[BUFFER_SIZE]; - int read; - while ((read = bis.read(bytesIn)) != -1) { - zos.write(bytesIn, 0, read); - } - } - - zos.closeEntry(); - - } - } - - /** - * Adds a file to the current zip output stream. - * - * @param file the file to be added - * @param zos the current zip output stream - * @throws FileNotFoundException if file not found - * @throws IOException if IO exception occurs - */ - private static void addFileToZip(File file, ZipOutputStream zos) throws FileNotFoundException, - IOException { - zos.putNextEntry(new ZipEntry(file.getName())); - - try (FileInputStream fileInputStream = new FileInputStream(file); - BufferedInputStream bis = new BufferedInputStream(fileInputStream)) { - byte[] bytesIn = new byte[BUFFER_SIZE]; - int read; - while ((read = bis.read(bytesIn)) != -1) { - zos.write(bytesIn, 0, read); - } - } - - zos.closeEntry(); - } -} diff --git a/modules/openapi-json-schema-generator-online/src/main/resources/application.properties b/modules/openapi-json-schema-generator-online/src/main/resources/application.properties deleted file mode 100644 index 98e89561856..00000000000 --- a/modules/openapi-json-schema-generator-online/src/main/resources/application.properties +++ /dev/null @@ -1,5 +0,0 @@ -springfox.documentation.swagger.v2.path=/api-docs -server.port=8080 -spring.jackson.date-format=org.openapitools.codegen.online.RFC3339DateFormat -spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false -spring.resources.static-locations=classpath:/META-INF/resources/,classpath:/resources/,classpath:/static/,classpath:/public/ diff --git a/modules/openapi-json-schema-generator-online/src/main/resources/static/index.html b/modules/openapi-json-schema-generator-online/src/main/resources/static/index.html deleted file mode 100755 index 8efc1fd4509..00000000000 --- a/modules/openapi-json-schema-generator-online/src/main/resources/static/index.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/modules/openapi-json-schema-generator-online/src/main/resources/static/logo.png b/modules/openapi-json-schema-generator-online/src/main/resources/static/logo.png deleted file mode 100644 index b57b94a6f10..00000000000 Binary files a/modules/openapi-json-schema-generator-online/src/main/resources/static/logo.png and /dev/null differ diff --git a/modules/openapi-json-schema-generator-online/src/main/resources/static/rapidoc-min.js b/modules/openapi-json-schema-generator-online/src/main/resources/static/rapidoc-min.js deleted file mode 100644 index c0178bca82e..00000000000 --- a/modules/openapi-json-schema-generator-online/src/main/resources/static/rapidoc-min.js +++ /dev/null @@ -1,182 +0,0 @@ -!function(t){var e=window.webpackHotUpdate;window.webpackHotUpdate=function(t,n){!function(t,e){if(!_[t]||!w[t])return;for(var n in w[t]=!1,e)Object.prototype.hasOwnProperty.call(e,n)&&(v[n]=e[n]);0==--y&&0===m&&O()}(t,n),e&&e(t,n)};var n,r=!0,i="895d8bc296aeeee37223",o=1e4,s={},u=[],a=[];function c(t){var e=E[t];if(!e)return U;var r=function(r){return e.hot.active?(E[r]?-1===E[r].parents.indexOf(t)&&E[r].parents.push(t):(u=[t],n=r),-1===e.children.indexOf(r)&&e.children.push(r)):(console.warn("[HMR] unexpected require("+r+") from disposed module "+t),u=[]),U(r)},i=function(t){return{configurable:!0,enumerable:!0,get:function(){return U[t]},set:function(e){U[t]=e}}};for(var o in U)Object.prototype.hasOwnProperty.call(U,o)&&"e"!==o&&"t"!==o&&Object.defineProperty(r,o,i(o));return r.e=function(t){return"ready"===p&&h("prepare"),m++,U.e(t).then(e,function(t){throw e(),t});function e(){m--,"prepare"===p&&(b[t]||A(t),0===m&&0===y&&O())}},r.t=function(t,e){return 1&e&&(t=r(t)),U.t(t,-2&e)},r}function l(t){var e={_acceptedDependencies:{},_declinedDependencies:{},_selfAccepted:!1,_selfDeclined:!1,_disposeHandlers:[],_main:n!==t,active:!0,accept:function(t,n){if(void 0===t)e._selfAccepted=!0;else if("function"==typeof t)e._selfAccepted=t;else if("object"==typeof t)for(var r=0;r=0&&e._disposeHandlers.splice(n,1)},check:S,apply:C,status:function(t){if(!t)return p;f.push(t)},addStatusHandler:function(t){f.push(t)},removeStatusHandler:function(t){var e=f.indexOf(t);e>=0&&f.splice(e,1)},data:s[t]};return n=void 0,e}var f=[],p="idle";function h(t){p=t;for(var e=0;e0;){var i=r.pop(),o=i.id,s=i.chain;if((a=E[o])&&!a.hot._selfAccepted){if(a.hot._selfDeclined)return{type:"self-declined",chain:s,moduleId:o};if(a.hot._main)return{type:"unaccepted",chain:s,moduleId:o};for(var u=0;u ")),S.type){case"self-declined":e.onDeclined&&e.onDeclined(S),e.ignoreDeclined||(A=new Error("Aborted because of self decline: "+S.moduleId+R));break;case"declined":e.onDeclined&&e.onDeclined(S),e.ignoreDeclined||(A=new Error("Aborted because of declined dependency: "+S.moduleId+" in "+S.parentId+R));break;case"unaccepted":e.onUnaccepted&&e.onUnaccepted(S),e.ignoreUnaccepted||(A=new Error("Aborted because "+c+" is not accepted"+R));break;case"accepted":e.onAccepted&&e.onAccepted(S),O=!0;break;case"disposed":e.onDisposed&&e.onDisposed(S),C=!0;break;default:throw new Error("Unexception type "+S.type)}if(A)return h("abort"),Promise.reject(A);if(O)for(c in m[c]=v[c],f(y,S.outdatedModules),S.outdatedDependencies)Object.prototype.hasOwnProperty.call(S.outdatedDependencies,c)&&(d[c]||(d[c]=[]),f(d[c],S.outdatedDependencies[c]));C&&(f(y,[S.moduleId]),m[c]=b)}var T,q=[];for(r=0;r0;)if(c=D.pop(),a=E[c]){var M={},j=a.hot._disposeHandlers;for(o=0;o=0&&k.parents.splice(T,1))}}for(c in d)if(Object.prototype.hasOwnProperty.call(d,c)&&(a=E[c]))for(z=d[c],o=0;o=0&&a.children.splice(T,1);for(c in h("apply"),i=g,m)Object.prototype.hasOwnProperty.call(m,c)&&(t[c]=m[c]);var F=null;for(c in d)if(Object.prototype.hasOwnProperty.call(d,c)&&(a=E[c])){z=d[c];var L=[];for(r=0;r ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|\\n*|\\n*|)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,table:g,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading| {0,3}>|<\/?(?:tag)(?: +|\n|\/?>)|<(?:script|pre|style|!--))[^\n]+)*)/,text:/^[^\n]+/};function r(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||_.defaults,this.rules=n.normal,this.options.pedantic?this.rules=n.pedantic:this.options.gfm&&(this.options.tables?this.rules=n.tables:this.rules=n.gfm)}n._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,n._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,n.def=p(n.def).replace("label",n._label).replace("title",n._title).getRegex(),n.bullet=/(?:[*+-]|\d{1,9}\.)/,n.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,n.item=p(n.item,"gm").replace(/bull/g,n.bullet).getRegex(),n.list=p(n.list).replace(/bull/g,n.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+n.def.source+")").getRegex(),n._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",n._comment=//,n.html=p(n.html,"i").replace("comment",n._comment).replace("tag",n._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),n.paragraph=p(n.paragraph).replace("hr",n.hr).replace("heading",n.heading).replace("lheading",n.lheading).replace("tag",n._tag).getRegex(),n.blockquote=p(n.blockquote).replace("paragraph",n.paragraph).getRegex(),n.normal=y({},n),n.gfm=y({},n.normal,{fences:/^ {0,3}(`{3,}|~{3,})([^`\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),n.gfm.paragraph=p(n.paragraph).replace("(?!","(?!"+n.gfm.fences.source.replace("\\1","\\2")+"|"+n.list.source.replace("\\1","\\3")+"|").getRegex(),n.tables=y({},n.gfm,{nptable:/^ *([^|\n ].*\|.*)\n *([-:]+ *\|[-| :]*)(?:\n((?:.*[^>\n ].*(?:\n|$))*)\n*|$)/,table:/^ *\|(.+)\n *\|?( *[-:]+[-| :]*)(?:\n((?: *[^>\n ].*(?:\n|$))*)\n*|$)/}),n.pedantic=y({},n.normal,{html:p("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",n._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/}),r.rules=n,r.lex=function(t,e){return new r(e).lex(t)},r.prototype.lex=function(t){return t=t.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(t,!0)},r.prototype.token=function(t,e){var r,i,o,s,u,a,c,l,f,p,h,d,v,g,y,w;for(t=t.replace(/^ +$/gm,"");t;)if((o=this.rules.newline.exec(t))&&(t=t.substring(o[0].length),o[0].length>1&&this.tokens.push({type:"space"})),o=this.rules.code.exec(t))t=t.substring(o[0].length),o=o[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?o:b(o,"\n")});else if(o=this.rules.fences.exec(t))t=t.substring(o[0].length),this.tokens.push({type:"code",lang:o[2]?o[2].trim():o[2],text:o[3]||""});else if(o=this.rules.heading.exec(t))t=t.substring(o[0].length),this.tokens.push({type:"heading",depth:o[1].length,text:o[2]});else if((o=this.rules.nptable.exec(t))&&(a={type:"table",header:m(o[1].replace(/^ *| *\| *$/g,"")),align:o[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:o[3]?o[3].replace(/\n$/,"").split("\n"):[]}).header.length===a.align.length){for(t=t.substring(o[0].length),h=0;h ?/gm,""),this.token(o,e),this.tokens.push({type:"blockquote_end"});else if(o=this.rules.list.exec(t)){for(t=t.substring(o[0].length),c={type:"list_start",ordered:g=(s=o[2]).length>1,start:g?+s:"",loose:!1},this.tokens.push(c),l=[],r=!1,v=(o=o[0].match(this.rules.item)).length,h=0;h1?1===u.length:u.length>1||this.options.smartLists&&u!==s)&&(t=o.slice(h+1).join("\n")+t,h=v-1)),i=r||/\n\n(?!\s*$)/.test(a),h!==v-1&&(r="\n"===a.charAt(a.length-1),i||(i=r)),i&&(c.loose=!0),w=void 0,(y=/^\[[ xX]\] /.test(a))&&(w=" "!==a[1],a=a.replace(/^\[[ xX]\] +/,"")),f={type:"list_item_start",task:y,checked:w,loose:i},l.push(f),this.tokens.push(f),this.token(a,!1),this.tokens.push({type:"list_item_end"});if(c.loose)for(v=l.length,h=0;h?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:g,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(href(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,strong:/^__([^\s_])__(?!_)|^\*\*([^\s*])\*\*(?!\*)|^__([^\s][\s\S]*?[^\s])__(?!_)|^\*\*([^\s][\s\S]*?[^\s])\*\*(?!\*)/,em:/^_([^\s_])_(?!_)|^\*([^\s*"<\[])\*(?!\*)|^_([^\s][\s\S]*?[^\s_])_(?!_|[^\spunctuation])|^_([^\s_][\s\S]*?[^\s])_(?!_|[^\spunctuation])|^\*([^\s"<\[][\s\S]*?[^\s*])\*(?!\*)|^\*([^\s*"<\[][\s\S]*?[^\s])\*(?!\*)/,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:g,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[^_{|}~",i.em=p(i.em).replace(/punctuation/g,i._punctuation).getRegex(),i._escapes=/\\([!"#$%&'()*+,\-.\/:;<=>?@\[\]\\^_`{|}~])/g,i._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,i._email=/[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,i.autolink=p(i.autolink).replace("scheme",i._scheme).replace("email",i._email).getRegex(),i._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,i.tag=p(i.tag).replace("comment",n._comment).replace("attribute",i._attribute).getRegex(),i._label=/(?:\[[^\[\]]*\]|\\[\[\]]?|`[^`]*`|`(?!`)|[^\[\]\\`])*?/,i._href=/\s*(<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*)/,i._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,i.link=p(i.link).replace("label",i._label).replace("href",i._href).replace("title",i._title).getRegex(),i.reflink=p(i.reflink).replace("label",i._label).getRegex(),i.normal=y({},i),i.pedantic=y({},i.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/,link:p(/^!?\[(label)\]\((.*?)\)/).replace("label",i._label).getRegex(),reflink:p(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",i._label).getRegex()}),i.gfm=y({},i.normal,{escape:p(i.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\/i.test(s[0])&&(this.inLink=!1),!this.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(s[0])?this.inRawBlock=!0:this.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(s[0])&&(this.inRawBlock=!1),t=t.substring(s[0].length),a+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(s[0]):l(s[0]):s[0];else if(s=this.rules.link.exec(t)){var c=w(s[2],"()");if(c>-1){var f=s[0].length-(s[2].length-c)-(s[3]||"").length;s[2]=s[2].substring(0,c),s[0]=s[0].substring(0,f).trim(),s[3]=""}t=t.substring(s[0].length),this.inLink=!0,r=s[2],this.options.pedantic?(e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(r))?(r=e[1],i=e[3]):i="":i=s[3]?s[3].slice(1,-1):"",r=r.trim().replace(/^<([\s\S]*)>$/,"$1"),a+=this.outputLink(s,{href:o.escapes(r),title:o.escapes(i)}),this.inLink=!1}else if((s=this.rules.reflink.exec(t))||(s=this.rules.nolink.exec(t))){if(t=t.substring(s[0].length),e=(s[2]||s[1]).replace(/\s+/g," "),!(e=this.links[e.toLowerCase()])||!e.href){a+=s[0].charAt(0),t=s[0].substring(1)+t;continue}this.inLink=!0,a+=this.outputLink(s,e),this.inLink=!1}else if(s=this.rules.strong.exec(t))t=t.substring(s[0].length),a+=this.renderer.strong(this.output(s[4]||s[3]||s[2]||s[1]));else if(s=this.rules.em.exec(t))t=t.substring(s[0].length),a+=this.renderer.em(this.output(s[6]||s[5]||s[4]||s[3]||s[2]||s[1]));else if(s=this.rules.code.exec(t))t=t.substring(s[0].length),a+=this.renderer.codespan(l(s[2].trim(),!0));else if(s=this.rules.br.exec(t))t=t.substring(s[0].length),a+=this.renderer.br();else if(s=this.rules.del.exec(t))t=t.substring(s[0].length),a+=this.renderer.del(this.output(s[1]));else if(s=this.rules.autolink.exec(t))t=t.substring(s[0].length),r="@"===s[2]?"mailto:"+(n=l(this.mangle(s[1]))):n=l(s[1]),a+=this.renderer.link(r,null,n);else if(this.inLink||!(s=this.rules.url.exec(t))){if(s=this.rules.text.exec(t))t=t.substring(s[0].length),this.inRawBlock?a+=this.renderer.text(s[0]):a+=this.renderer.text(l(this.smartypants(s[0])));else if(t)throw new Error("Infinite loop on byte: "+t.charCodeAt(0))}else{if("@"===s[2])r="mailto:"+(n=l(s[0]));else{do{u=s[0],s[0]=this.rules._backpedal.exec(s[0])[0]}while(u!==s[0]);n=l(s[0]),r="www."===s[1]?"http://"+n:n}t=t.substring(s[0].length),a+=this.renderer.link(r,null,n)}return a},o.escapes=function(t){return t?t.replace(o.rules._escapes,"$1"):t},o.prototype.outputLink=function(t,e){var n=e.href,r=e.title?l(e.title):null;return"!"!==t[0].charAt(0)?this.renderer.link(n,r,this.output(t[1])):this.renderer.image(n,r,l(t[1]))},o.prototype.smartypants=function(t){return this.options.smartypants?t.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014\/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014\/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):t},o.prototype.mangle=function(t){if(!this.options.mangle)return t;for(var e,n="",r=t.length,i=0;i.5&&(e="x"+e.toString(16)),n+="&#"+e+";";return n},s.prototype.code=function(t,e,n){var r=(e||"").match(/\S*/)[0];if(this.options.highlight){var i=this.options.highlight(t,r);null!=i&&i!==t&&(n=!0,t=i)}return r?'
    '+(n?t:l(t,!0))+"
    \n":"
    "+(n?t:l(t,!0))+"
    "},s.prototype.blockquote=function(t){return"
    \n"+t+"
    \n"},s.prototype.html=function(t){return t},s.prototype.heading=function(t,e,n,r){return this.options.headerIds?"'+t+"\n":""+t+"\n"},s.prototype.hr=function(){return this.options.xhtml?"
    \n":"
    \n"},s.prototype.list=function(t,e,n){var r=e?"ol":"ul";return"<"+r+(e&&1!==n?' start="'+n+'"':"")+">\n"+t+"\n"},s.prototype.listitem=function(t){return"
  • "+t+"
  • \n"},s.prototype.checkbox=function(t){return" "},s.prototype.paragraph=function(t){return"

    "+t+"

    \n"},s.prototype.table=function(t,e){return e&&(e=""+e+""),"\n\n"+t+"\n"+e+"
    \n"},s.prototype.tablerow=function(t){return"\n"+t+"\n"},s.prototype.tablecell=function(t,e){var n=e.header?"th":"td";return(e.align?"<"+n+' align="'+e.align+'">':"<"+n+">")+t+"\n"},s.prototype.strong=function(t){return""+t+""},s.prototype.em=function(t){return""+t+""},s.prototype.codespan=function(t){return""+t+""},s.prototype.br=function(){return this.options.xhtml?"
    ":"
    "},s.prototype.del=function(t){return""+t+""},s.prototype.link=function(t,e,n){if(null===(t=h(this.options.sanitize,this.options.baseUrl,t)))return n;var r='"},s.prototype.image=function(t,e,n){if(null===(t=h(this.options.sanitize,this.options.baseUrl,t)))return n;var r=''+n+'":">"},s.prototype.text=function(t){return t},u.prototype.strong=u.prototype.em=u.prototype.codespan=u.prototype.del=u.prototype.text=function(t){return t},u.prototype.link=u.prototype.image=function(t,e,n){return""+n},u.prototype.br=function(){return""},a.parse=function(t,e){return new a(e).parse(t)},a.prototype.parse=function(t){this.inline=new o(t.links,this.options),this.inlineText=new o(t.links,y({},this.options,{renderer:new u})),this.tokens=t.reverse();for(var e="";this.next();)e+=this.tok();return e},a.prototype.next=function(){return this.token=this.tokens.pop()},a.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},a.prototype.parseText=function(){for(var t=this.token.text;"text"===this.peek().type;)t+="\n"+this.next().text;return this.inline.output(t)},a.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,f(this.inlineText.output(this.token.text)),this.slugger);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var t,e,n,r,i="",o="";for(n="",t=0;t?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(e)){var n=e;do{this.seen[n]++,e=n+"-"+this.seen[n]}while(this.seen.hasOwnProperty(e))}return this.seen[e]=0,e},l.escapeTest=/[&<>"']/,l.escapeReplace=/[&<>"']/g,l.replacements={"&":"&","<":"<",">":">",'"':""","'":"'"},l.escapeTestNoEncode=/[<>"']|&(?!#?\w+;)/,l.escapeReplaceNoEncode=/[<>"']|&(?!#?\w+;)/g;var d={},v=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function g(){}function y(t){for(var e,n,r=1;r=0&&"\\"===n[i];)r=!r;return r?"|":" |"}).split(/ \|/),r=0;if(n.length>e)n.splice(e);else for(;n.lengthAn error occurred:

    "+l(t.message+"",!0)+"
    ";throw t}}g.exec=g,_.options=_.setOptions=function(t){return y(_.defaults,t),_},_.getDefaults=function(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:new s,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tables:!0,xhtml:!1}},_.defaults=_.getDefaults(),_.Parser=a,_.parser=a.parse,_.Renderer=s,_.TextRenderer=u,_.Lexer=r,_.lexer=r.lex,_.InlineLexer=o,_.inlineLexer=o.output,_.Slugger=c,_.parse=_,t.exports=_}(this||"undefined"!=typeof window&&window)}).call(this,n(3))},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e){var n,r,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function u(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(t){r=s}}();var a,c=[],l=!1,f=-1;function p(){l&&a&&(l=!1,a.length?c=a.concat(c):f=-1,c.length&&h())}function h(){if(!l){var t=u(p);l=!0;for(var e=c.length;e;){for(a=c,c=[];++f1)for(var n=1;n - * @license MIT - */ -var r=n(299),i=n(300),o=n(109);function s(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(t,e){if(s()=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function d(t,e){if(a.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return N(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return I(t).length;default:if(r)return N(t).length;e=(""+e).toLowerCase(),r=!0}}function v(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function g(t,e,n,r,i){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=a.from(e,r)),a.isBuffer(e))return 0===e.length?-1:y(t,e,n,r,i);if("number"==typeof e)return e&=255,a.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):y(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function y(t,e,n,r,i){var o,s=1,u=t.length,a=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;s=2,u/=2,a/=2,n/=2}function c(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){var l=-1;for(o=n;ou&&(n=u-a),o=n;o>=0;o--){for(var f=!0,p=0;pi&&(r=i):r=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var s=0;s>8,i=n%256,o.push(i),o.push(r);return o}(e,t.length-n),t,n,r)}function A(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function O(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;i239?4:c>223?3:c>191?2:1;if(i+f<=n)switch(f){case 1:c<128&&(l=c);break;case 2:128==(192&(o=t[i+1]))&&(a=(31&c)<<6|63&o)>127&&(l=a);break;case 3:o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&(a=(15&c)<<12|(63&o)<<6|63&s)>2047&&(a<55296||a>57343)&&(l=a);break;case 4:o=t[i+1],s=t[i+2],u=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&u)&&(a=(15&c)<<18|(63&o)<<12|(63&s)<<6|63&u)>65535&&a<1114112&&(l=a)}null===l?(l=65533,f=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),i+=f}return function(t){var e=t.length;if(e<=C)return String.fromCharCode.apply(String,t);var n="",r=0;for(;rthis.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return R(this,e,n);case"utf8":case"utf-8":return O(this,e,n);case"ascii":return E(this,e,n);case"latin1":case"binary":return U(this,e,n);case"base64":return A(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}.apply(this,arguments)},a.prototype.equals=function(t){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===a.compare(this,t)},a.prototype.inspect=function(){var t="",n=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),""},a.prototype.compare=function(t,e,n,r,i){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),e<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&e>=n)return 0;if(r>=i)return-1;if(e>=n)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(r>>>=0),s=(n>>>=0)-(e>>>=0),u=Math.min(o,s),c=this.slice(r,i),l=t.slice(e,n),f=0;fi)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return m(this,t,e,n);case"utf8":case"utf-8":return b(this,t,e,n);case"ascii":return w(this,t,e,n);case"latin1":case"binary":return _(this,t,e,n);case"base64":return x(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var C=4096;function E(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;ir)&&(n=r);for(var i="",o=e;on)throw new RangeError("Trying to access beyond buffer length")}function P(t,e,n,r,i,o){if(!a.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function z(t,e,n,r){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-n,2);i>>8*(r?i:1-i)}function D(t,e,n,r){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-n,4);i>>8*(r?i:3-i)&255}function M(t,e,n,r,i,o){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function j(t,e,n,r,o){return o||M(t,0,n,4),i.write(t,e,n,r,23,4),n+4}function k(t,e,n,r,o){return o||M(t,0,n,8),i.write(t,e,n,r,52,8),n+8}a.prototype.slice=function(t,e){var n,r=this.length;if((t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e0&&(i*=256);)r+=this[t+--e]*i;return r},a.prototype.readUInt8=function(t,e){return e||q(t,1,this.length),this[t]},a.prototype.readUInt16LE=function(t,e){return e||q(t,2,this.length),this[t]|this[t+1]<<8},a.prototype.readUInt16BE=function(t,e){return e||q(t,2,this.length),this[t]<<8|this[t+1]},a.prototype.readUInt32LE=function(t,e){return e||q(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},a.prototype.readUInt32BE=function(t,e){return e||q(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},a.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||q(t,e,this.length);for(var r=this[t],i=1,o=0;++o=(i*=128)&&(r-=Math.pow(2,8*e)),r},a.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||q(t,e,this.length);for(var r=e,i=1,o=this[t+--r];r>0&&(i*=256);)o+=this[t+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},a.prototype.readInt8=function(t,e){return e||q(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},a.prototype.readInt16LE=function(t,e){e||q(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},a.prototype.readInt16BE=function(t,e){e||q(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},a.prototype.readInt32LE=function(t,e){return e||q(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},a.prototype.readInt32BE=function(t,e){return e||q(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},a.prototype.readFloatLE=function(t,e){return e||q(t,4,this.length),i.read(this,t,!0,23,4)},a.prototype.readFloatBE=function(t,e){return e||q(t,4,this.length),i.read(this,t,!1,23,4)},a.prototype.readDoubleLE=function(t,e){return e||q(t,8,this.length),i.read(this,t,!0,52,8)},a.prototype.readDoubleBE=function(t,e){return e||q(t,8,this.length),i.read(this,t,!1,52,8)},a.prototype.writeUIntLE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||P(this,t,e,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[e]=255&t;++o=0&&(o*=256);)this[e+i]=t/o&255;return e+n},a.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,1,255,0),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},a.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):z(this,t,e,!0),e+2},a.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):z(this,t,e,!1),e+2},a.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):D(this,t,e,!0),e+4},a.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):D(this,t,e,!1),e+4},a.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);P(this,t,e,n,i-1,-i)}var o=0,s=1,u=0;for(this[e]=255&t;++o>0)-u&255;return e+n},a.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);P(this,t,e,n,i-1,-i)}var o=n-1,s=1,u=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===u&&0!==this[e+o+1]&&(u=1),this[e+o]=(t/s>>0)-u&255;return e+n},a.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,1,127,-128),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},a.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):z(this,t,e,!0),e+2},a.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):z(this,t,e,!1),e+2},a.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):D(this,t,e,!0),e+4},a.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):D(this,t,e,!1),e+4},a.prototype.writeFloatLE=function(t,e,n){return j(this,t,e,!0,n)},a.prototype.writeFloatBE=function(t,e,n){return j(this,t,e,!1,n)},a.prototype.writeDoubleLE=function(t,e,n){return k(this,t,e,!0,n)},a.prototype.writeDoubleBE=function(t,e,n){return k(this,t,e,!1,n)},a.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e=0;--i)t[i+e]=this[i+n];else if(o<1e3||!a.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(o=e;o55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===r){(e-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function I(t){return r.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(F,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function $(t,e,n,r){for(var i=0;i=e.length||i>=t.length);++i)e[i+n]=t[i];return i}}).call(this,n(3))},function(t,e,n){"use strict";var r=n(39),i=Object.keys||function(t){var e=[];for(var n in t)e.push(n);return e};t.exports=f;var o=n(24);o.inherits=n(8);var s=n(116),u=n(120);o.inherits(f,s);for(var a=i(u.prototype),c=0;ca){var c=u;u=a,a=c}return u+s+a+s+(r.isUndefined(o)?i:o)}function f(t,e){return l(t,e.v,e.w,e.name)}u.prototype._nodeCount=0,u.prototype._edgeCount=0,u.prototype.isDirected=function(){return this._isDirected},u.prototype.isMultigraph=function(){return this._isMultigraph},u.prototype.isCompound=function(){return this._isCompound},u.prototype.setGraph=function(t){return this._label=t,this},u.prototype.graph=function(){return this._label},u.prototype.setDefaultNodeLabel=function(t){return r.isFunction(t)||(t=r.constant(t)),this._defaultNodeLabelFn=t,this},u.prototype.nodeCount=function(){return this._nodeCount},u.prototype.nodes=function(){return r.keys(this._nodes)},u.prototype.sources=function(){var t=this;return r.filter(this.nodes(),function(e){return r.isEmpty(t._in[e])})},u.prototype.sinks=function(){var t=this;return r.filter(this.nodes(),function(e){return r.isEmpty(t._out[e])})},u.prototype.setNodes=function(t,e){var n=arguments,i=this;return r.each(t,function(t){n.length>1?i.setNode(t,e):i.setNode(t)}),this},u.prototype.setNode=function(t,e){return r.has(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=e),this):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=o,this._children[t]={},this._children[o][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)},u.prototype.node=function(t){return this._nodes[t]},u.prototype.hasNode=function(t){return r.has(this._nodes,t)},u.prototype.removeNode=function(t){var e=this;if(r.has(this._nodes,t)){var n=function(t){e.removeEdge(e._edgeObjs[t])};delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],r.each(this.children(t),function(t){e.setParent(t)}),delete this._children[t]),r.each(r.keys(this._in[t]),n),delete this._in[t],delete this._preds[t],r.each(r.keys(this._out[t]),n),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this},u.prototype.setParent=function(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(r.isUndefined(e))e=o;else{for(var n=e+="";!r.isUndefined(n);n=this.parent(n))if(n===t)throw new Error("Setting "+e+" as parent of "+t+" would create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this},u.prototype._removeFromParentsChildList=function(t){delete this._children[this._parent[t]][t]},u.prototype.parent=function(t){if(this._isCompound){var e=this._parent[t];if(e!==o)return e}},u.prototype.children=function(t){if(r.isUndefined(t)&&(t=o),this._isCompound){var e=this._children[t];if(e)return r.keys(e)}else{if(t===o)return this.nodes();if(this.hasNode(t))return[]}},u.prototype.predecessors=function(t){var e=this._preds[t];if(e)return r.keys(e)},u.prototype.successors=function(t){var e=this._sucs[t];if(e)return r.keys(e)},u.prototype.neighbors=function(t){var e=this.predecessors(t);if(e)return r.union(e,this.successors(t))},u.prototype.isLeaf=function(t){return 0===(this.isDirected()?this.successors(t):this.neighbors(t)).length},u.prototype.filterNodes=function(t){var e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph());var n=this;r.each(this._nodes,function(n,r){t(r)&&e.setNode(r,n)}),r.each(this._edgeObjs,function(t){e.hasNode(t.v)&&e.hasNode(t.w)&&e.setEdge(t,n.edge(t))});var i={};return this._isCompound&&r.each(e.nodes(),function(t){e.setParent(t,function t(r){var o=n.parent(r);return void 0===o||e.hasNode(o)?(i[r]=o,o):o in i?i[o]:t(o)}(t))}),e},u.prototype.setDefaultEdgeLabel=function(t){return r.isFunction(t)||(t=r.constant(t)),this._defaultEdgeLabelFn=t,this},u.prototype.edgeCount=function(){return this._edgeCount},u.prototype.edges=function(){return r.values(this._edgeObjs)},u.prototype.setPath=function(t,e){var n=this,i=arguments;return r.reduce(t,function(t,r){return i.length>1?n.setEdge(t,r,e):n.setEdge(t,r),r}),this},u.prototype.setEdge=function(){var t,e,n,i,o=!1,s=arguments[0];"object"==typeof s&&null!==s&&"v"in s?(t=s.v,e=s.w,n=s.name,2===arguments.length&&(i=arguments[1],o=!0)):(t=s,e=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],o=!0)),t=""+t,e=""+e,r.isUndefined(n)||(n=""+n);var u=l(this._isDirected,t,e,n);if(r.has(this._edgeLabels,u))return o&&(this._edgeLabels[u]=i),this;if(!r.isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[u]=o?i:this._defaultEdgeLabelFn(t,e,n);var c=function(t,e,n,r){var i=""+e,o=""+n;if(!t&&i>o){var s=i;i=o,o=s}var u={v:i,w:o};r&&(u.name=r);return u}(this._isDirected,t,e,n);return t=c.v,e=c.w,Object.freeze(c),this._edgeObjs[u]=c,a(this._preds[e],t),a(this._sucs[t],e),this._in[e][u]=c,this._out[t][u]=c,this._edgeCount++,this},u.prototype.edge=function(t,e,n){var r=1===arguments.length?f(this._isDirected,arguments[0]):l(this._isDirected,t,e,n);return this._edgeLabels[r]},u.prototype.hasEdge=function(t,e,n){var i=1===arguments.length?f(this._isDirected,arguments[0]):l(this._isDirected,t,e,n);return r.has(this._edgeLabels,i)},u.prototype.removeEdge=function(t,e,n){var r=1===arguments.length?f(this._isDirected,arguments[0]):l(this._isDirected,t,e,n),i=this._edgeObjs[r];return i&&(t=i.v,e=i.w,delete this._edgeLabels[r],delete this._edgeObjs[r],c(this._preds[e],t),c(this._sucs[t],e),delete this._in[e][r],delete this._out[t][r],this._edgeCount--),this},u.prototype.inEdges=function(t,e){var n=this._in[t];if(n){var i=r.values(n);return e?r.filter(i,function(t){return t.v===e}):i}},u.prototype.outEdges=function(t,e){var n=this._out[t];if(n){var i=r.values(n);return e?r.filter(i,function(t){return t.w===e}):i}},u.prototype.nodeEdges=function(t,e){var n=this.inEdges(t,e);if(n)return n.concat(this.outEdges(t,e))}},function(t,e,n){var r=n(25),i=n(143),o=n(144),s=n(145),u=n(146),a=n(147);function c(t){var e=this.__data__=new r(t);this.size=e.size}c.prototype.clear=i,c.prototype.delete=o,c.prototype.get=s,c.prototype.has=u,c.prototype.set=a,t.exports=c},function(t,e){t.exports=function(t,e){return t===e||t!=t&&e!=e}},function(t,e,n){var r=n(9)(n(6),"Map");t.exports=r},function(t,e,n){var r=n(154),i=n(161),o=n(163),s=n(164),u=n(165);function a(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e-1&&t%1==0&&t<=n}},function(t,e){t.exports=function(t){return function(e){return t(e)}}},function(t,e,n){(function(t){var r=n(66),i=e&&!e.nodeType&&e,o=i&&"object"==typeof t&&t&&!t.nodeType&&t,s=o&&o.exports===i&&r.process,u=function(){try{var t=o&&o.require&&o.require("util").types;return t||s&&s.binding&&s.binding("util")}catch(t){}}();t.exports=u}).call(this,n(20)(t))},function(t,e,n){var r=n(33),i=n(171),o=Object.prototype.hasOwnProperty;t.exports=function(t){if(!r(t))return i(t);var e=[];for(var n in Object(t))o.call(t,n)&&"constructor"!=n&&e.push(n);return e}},function(t,e,n){var r=n(75),i=n(76),o=Object.prototype.propertyIsEnumerable,s=Object.getOwnPropertySymbols,u=s?function(t){return null==t?[]:(t=Object(t),r(s(t),function(e){return o.call(t,e)}))}:i;t.exports=u},function(t,e){t.exports=function(t,e){for(var n=-1,r=e.length,i=t.length;++n=0;r--){var i=t[r];"."===i?t.splice(r,1):".."===i?(t.splice(r,1),n++):n&&(t.splice(r,1),n--)}if(e)for(;n--;n)t.unshift("..");return t}var r=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,i=function(t){return r.exec(t).slice(1)};function o(t,e){if(t.filter)return t.filter(e);for(var n=[],r=0;r=-1&&!r;i--){var s=i>=0?arguments[i]:t.cwd();if("string"!=typeof s)throw new TypeError("Arguments to path.resolve must be strings");s&&(e=s+"/"+e,r="/"===s.charAt(0))}return(r?"/":"")+(e=n(o(e.split("/"),function(t){return!!t}),!r).join("/"))||"."},e.normalize=function(t){var r=e.isAbsolute(t),i="/"===s(t,-1);return(t=n(o(t.split("/"),function(t){return!!t}),!r).join("/"))||r||(t="."),t&&i&&(t+="/"),(r?"/":"")+t},e.isAbsolute=function(t){return"/"===t.charAt(0)},e.join=function(){var t=Array.prototype.slice.call(arguments,0);return e.normalize(o(t,function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},e.relative=function(t,n){function r(t){for(var e=0;e=0&&""===t[n];n--);return e>n?[]:t.slice(e,n-e+1)}t=e.resolve(t).substr(1),n=e.resolve(n).substr(1);for(var i=r(t.split("/")),o=r(n.split("/")),s=Math.min(i.length,o.length),u=s,a=0;a",'"',"`"," ","\r","\n","\t"]),l=["'"].concat(c),f=["%","/","?",";","#"].concat(l),p=["/","?","#"],h=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,v={javascript:!0,"javascript:":!0},g={javascript:!0,"javascript:":!0},y={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},m=n(103);function b(t,e,n){if(t&&i.isObject(t)&&t instanceof o)return t;var r=new o;return r.parse(t,e,n),r}o.prototype.parse=function(t,e,n){if(!i.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var o=t.indexOf("?"),u=-1!==o&&o127?z+="x":z+=P[D];if(!z.match(h)){var j=T.slice(0,E),k=T.slice(E+1),F=P.match(d);F&&(j.push(F[1]),k.unshift(F[2])),k.length&&(b="/"+k.join(".")+b),this.hostname=j.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),R||(this.hostname=r.toASCII(this.hostname));var L=this.port?":"+this.port:"",N=this.hostname||"";this.host=N+L,this.href+=this.host,R&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!v[x])for(E=0,q=l.length;E0)&&n.host.split("@"))&&(n.auth=R.shift(),n.host=n.hostname=R.shift());return n.search=t.search,n.query=t.query,i.isNull(n.pathname)&&i.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!S.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var O=S.slice(-1)[0],C=(n.host||t.host||S.length>1)&&("."===O||".."===O)||""===O,E=0,U=S.length;U>=0;U--)"."===(O=S[U])?S.splice(U,1):".."===O?(S.splice(U,1),E++):E&&(S.splice(U,1),E--);if(!_&&!x)for(;E--;E)S.unshift("..");!_||""===S[0]||S[0]&&"/"===S[0].charAt(0)||S.unshift(""),C&&"/"!==S.join("/").substr(-1)&&S.push("");var R,T=""===S[0]||S[0]&&"/"===S[0].charAt(0);A&&(n.hostname=n.host=T?"":S.length?S.shift():"",(R=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=R.shift(),n.host=n.hostname=R.shift()));return(_=_||n.host&&S.length)&&!T&&S.unshift(""),S.length?n.pathname=S.join("/"):(n.pathname=null,n.path=null),i.isNull(n.pathname)&&i.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=t.auth||n.auth,n.slashes=n.slashes||t.slashes,n.href=n.format(),n},o.prototype.parseHost=function(){var t=this.host,e=u.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},function(t,e,n){"use strict";var r=n(17);t.exports=new r({explicit:[n(289),n(290),n(291)]})},function(t,e,n){"use strict";function r(t){return t=(t=t.split("~1").join("/")).split("~0").join("~")}t.exports={jptr:function(t,e,n){if(void 0===t)return!1;if(!e||"#"===e)return void 0!==n?n:t;if(e.indexOf("#")>=0){let t=e.split("#");if(t[0])return!1;e=t[1],e=decodeURIComponent(e.slice(1).split("+").join(" "))}e.startsWith("/")&&(e=e.slice(1));let i=e.split("/");for(let e=0;e0?i[e-1]:"",-1!=s||t.hasOwnProperty(i[e]))if(s>=0)o&&(t[s]=n),t=t[s];else{if(-2===s)return o?(Array.isArray(t)&&t.push(n),n):void 0;o&&(t[i[e]]=n),t=t[i[e]]}else{if(void 0===n||"object"!=typeof t||Array.isArray(t))return!1;t[i[e]]=o?n:"0"===i[e+1]||"-"===i[e+1]?[]:{},t=t[i[e]]}}return t},jpescape:function(t){return t=(t=t.split("~").join("~0")).split("/").join("~1")},jpunescape:r}},function(t,e,n){"use strict";t.exports={nop:function(t){return t},clone:function(t){return JSON.parse(JSON.stringify(t))},shallowClone:function(t){let e={};for(let n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e},deepClone:function t(e){let n=Array.isArray(e)?[]:{};for(let r in e)(e.hasOwnProperty(r)||Array.isArray(e))&&(n[r]="object"==typeof e[r]?t(e[r]):e[r]);return n},fastClone:function(t){return Object.assign({},t)},circularClone:function t(e,n){if(n||(n=new WeakMap),Object(e)!==e||e instanceof Function)return e;if(n.has(e))return n.get(e);try{var r=new e.constructor}catch(t){r=Object.create(Object.getPrototypeOf(e))}return n.set(e,r),Object.assign(r,...Object.keys(e).map(r=>({[r]:t(e[r],n)})))}}},function(t,e,n){"use strict";const r=n(104),i=n(61),o=(n(60),n(285)),s=n(105),u=n(106),a=n(63),c=a.jptr,l=n(110).isRef,f=n(64).clone,p=n(64).circularClone,h=n(111).recurse,d=n(309),v=n(313),g=n(112),y=n(314).statusCodes,m=n(327).version,b="3.0.0";let w;class _ extends Error{constructor(t){super(t),this.name="S2OError"}}function x(t,e){let n=new _(t);if(n.options=e,!e.promise)throw n;e.promise.reject(n)}function S(t,e,n){n.warnOnly?e[n.warnProperty||"x-s2o-warning"]=t:x(t,n)}function A(t,e){v.walkSchema(t,{},{},function(t,n,r){!function(t,e){if(t["x-required"]&&Array.isArray(t["x-required"])&&(t.required||(t.required=[]),t.required=t.required.concat(t["x-required"]),delete t["x-required"]),t["x-anyOf"]&&(t.anyOf=t["x-anyOf"],delete t["x-anyOf"]),t["x-oneOf"]&&(t.oneOf=t["x-oneOf"],delete t["x-oneOf"]),t["x-not"]&&(t.not=t["x-not"],delete t["x-not"]),"boolean"==typeof t["x-nullable"]&&(t.nullable=t["x-nullable"],delete t["x-nullable"]),"object"==typeof t["x-discriminator"]&&"string"==typeof t["x-discriminator"].propertyName){t.discriminator=t["x-discriminator"],delete t["x-discriminator"];for(let e in t.discriminator.mapping){let n=t.discriminator.mapping[e];n.startsWith("#/definitions/")&&(t.discriminator.mapping[e]=n.replace("#/definitions/","#/components/schemas/"))}}}(t),function(t,e,n){if(t.discriminator&&"string"==typeof t.discriminator&&(t.discriminator={propertyName:t.discriminator}),t.items&&Array.isArray(t.items)&&(0===t.items.length?t.items={}:1===t.items.length?t.items=t.items[0]:t.items={anyOf:t.items}),t.type&&Array.isArray(t.type))if(n.patch){if(0===t.type.length)delete t.type;else{t.oneOf||(t.oneOf=[]);for(let e of t.type){let n={};if("null"===e)t.nullable=!0;else{n.type=e;for(let e of g.arrayProperties)void 0!==t.prop&&(n[e]=t[e],delete t[e])}n.type&&t.oneOf.push(n)}delete t.type,0===t.oneOf.length?delete t.oneOf:t.oneOf.length<2&&(t.type=t.oneOf[0].type,Object.keys(t.oneOf[0]).length>1&&S("Lost properties from oneOf",t,n),delete t.oneOf)}t.type&&Array.isArray(t.type)&&1===t.type.length&&(t.type=t.type[0])}else x("(Patchable) schema type must not be an array",n);t.type&&"null"===t.type&&(delete t.type,t.nullable=!0),"array"!==t.type||t.items||(t.items={}),"boolean"==typeof t.required&&(t.required&&t.name&&(void 0===e.required&&(e.required=[]),Array.isArray(e.required)&&e.required.push(t.name)),delete t.required),t.xml&&"string"==typeof t.xml.namespace&&(t.xml.namespace||delete t.xml.namespace)}(t,n,e)})}function O(t,e,n){let r=n.payload.options;if(l(t,e)){if(t[e].startsWith("#/components/")) ;else if("#/consumes"===t[e])delete t[e],n.parent[n.pkey]=f(r.openapi.consumes);else if("#/produces"===t[e])delete t[e],n.parent[n.pkey]=f(r.openapi.produces);else if(t[e].startsWith("#/definitions/")){let n=t[e].replace("#/definitions/","").split("/"),i=w.schemas[decodeURIComponent(n[0])];i?n[0]=i:S("Could not resolve reference "+t[e],t,r),t[e]="#/components/schemas/"+n.join("/")}else if(t[e].startsWith("#/parameters/"))t[e]="#/components/parameters/"+g.sanitise(t[e].replace("#/parameters/",""));else if(t[e].startsWith("#/responses/"))t[e]="#/components/responses/"+g.sanitise(t[e].replace("#/responses/",""));else if(t[e].startsWith("#")){let n=f(a.jptr(r.openapi,t[e]));if(!1===n)S("direct $ref not found "+t[e],t,r);else if(r.refmap[t[e]])t[e]=r.refmap[t[e]];else{let o=t[e],s="schemas",u=(o=(o=(o=(o=o.replace("/properties/headers/","")).replace("/properties/responses/","")).replace("/properties/parameters/","")).replace("/properties/schemas/","")).lastIndexOf("/schema");if("schemas"===(s=o.indexOf("/headers/")>u?"headers":o.indexOf("/responses/")>u?"responses":o.indexOf("/example")>u?"examples":o.indexOf("/parameters/")>u?"parameters":"schemas")&&A(n,r),"responses"!==s){let o=s.substr(0,s.length-1);"parameter"===o&&n.name&&n.name===g.sanitise(n.name)&&(o=encodeURIComponent(n.name));let u=1;for(t["x-miro"]&&(i=(i=t["x-miro"]).indexOf("#")>=0?i.split("#")[1].split("/").pop():i.split("/").pop().split(".")[0],o=encodeURIComponent(g.sanitise(i)),u="");a.jptr(r.openapi,"#/components/"+s+"/"+o+u);)u=""===u?2:++u;let c="#/components/"+s+"/"+o+u,l="";"examples"===s&&(n={value:n},l="/value"),a.jptr(r.openapi,c,n),r.refmap[t[e]]=c+l,t[e]=c+l}}}if(delete t["x-miro"],Object.keys(t).length>1){let r=t[e];delete t[e],n.parent[n.pkey]={allOf:[{$ref:r},t]}}}var i;if("x-ms-odata"===e&&"string"==typeof t[e]&&t[e].startsWith("#/")){let n=t[e].replace("#/definitions/","").replace("#/components/schemas/","").split("/"),i=w.schemas[decodeURIComponent(n[0])];i?n[0]=i:S("Could not resolve reference "+t[e],t,r),t[e]="#/components/schemas/"+n.join("/")}}function C(t){for(let e in t)for(let n in t[e]){let r=g.sanitise(n);n!=r&&(t[e][r]=t[e][n],delete t[e][n])}}function E(t,e){if("basic"===t.type&&(t.type="http",t.scheme="basic"),"oauth2"===t.type){let n={},r=t.flow;"application"===t.flow&&(r="clientCredentials"),"accessCode"===t.flow&&(r="authorizationCode"),void 0!==t.authorizationUrl&&(n.authorizationUrl=t.authorizationUrl.split("?")[0].trim()||"/"),"string"==typeof t.tokenUrl&&(n.tokenUrl=t.tokenUrl.split("?")[0].trim()||"/"),n.scopes=t.scopes||{},t.flows={},t.flows[r]=n,delete t.flow,delete t.authorizationUrl,delete t.tokenUrl,delete t.scopes,void 0!==t.name&&(e.patch?delete t.name:x("(Patchable) oauth2 securitySchemes should not have name property",e))}}function U(t){return t&&!t["x-s2o-delete"]}function R(t,e){if(t.$ref)t.$ref=t.$ref.replace("#/responses/","#/components/responses/");else{t.type&&!t.schema&&(t.schema={}),t.type&&(t.schema.type=t.type),t.items&&t.items.collectionFormat&&t.items.type&&"array"!=t.items.type&&(t.items.collectionFormat!=t.collectionFormat&&S("Nested collectionFormats are not supported",t,e),delete t.items.collectionFormat),void 0!==t.collectionFormat&&("array"!=t.type&&(e.patch?delete t.collectionFormat:x("(Patchable) collectionFormat is only applicable to header.type array",e)),"csv"===t.collectionFormat&&(t.style="simple"),"ssv"===t.collectionFormat&&S("collectionFormat:ssv is no longer supported for headers",t,e),"pipes"===t.collectionFormat&&S("collectionFormat:pipes is no longer supported for headers",t,e),"multi"===t.collectionFormat&&(t.explode=!0),"tsv"===t.collectionFormat&&(S("collectionFormat:tsv is no longer supported",t,e),t["x-collectionFormat"]="tsv"),delete t.collectionFormat),delete t.type;for(let e of g.parameterTypeProperties)void 0!==t[e]&&(t.schema[e]=t[e],delete t[e]);for(let e of g.arrayProperties)void 0!==t[e]&&(t.schema[e]=t[e],delete t[e])}}function T(t,e){if(t.$ref.indexOf("#/parameters/")>=0){let e=t.$ref.split("#/parameters/");t.$ref=e[0]+"#/components/parameters/"+g.sanitise(e[1])}t.$ref.indexOf("#/definitions/")>=0&&S("Definition used as parameter",t,e)}function q(t,e,n,r,i,o){let s,u={},a=!0;if(e&&e.consumes&&"string"==typeof e.consumes){if(!o.patch)return x("(Patchable) operation.consumes must be an array",o);e.consumes=[e.consumes]}Array.isArray(i.consumes)||delete i.consumes;let l=((e?e.consumes:null)||i.consumes||[]).filter(g.uniqueOnly);if(t&&t.$ref&&"string"==typeof t.$ref){T(t,o);let e=decodeURIComponent(t.$ref.replace("#/components/parameters/","")),n=!1,r=i.components.parameters[e];if(r&&!r["x-s2o-delete"]||!t.$ref.startsWith("#/")||(t["x-s2o-delete"]=!0,n=!0),n){let e=t.$ref,n=c(i,t.$ref);!n&&e.startsWith("#/")?S("Could not resolve reference "+e,t,o):n&&(t=n)}}if(t&&(t.name||t.in)){"boolean"==typeof t["x-deprecated"]&&(t.deprecated=t["x-deprecated"],delete t["x-deprecated"]),void 0!==t["x-example"]&&(t.example=t["x-example"],delete t["x-example"]),"body"==t.in||t.type||(o.patch?t.type="string":x("(Patchable) parameter.type is mandatory for non-body parameters",o)),t.type&&"object"==typeof t.type&&t.type.$ref&&(t.type=c(i,t.type.$ref)),"file"===t.type&&(t["x-s2o-originalType"]=t.type,s=t.type),t.description&&"object"==typeof t.description&&t.description.$ref&&(t.description=c(i,t.description.$ref)),null===t.description&&delete t.description;let e=t.collectionFormat;if(t.collectionFormat&&("array"!=t.type&&(o.patch?delete t.collectionFormat:x("(Patchable) collectionFormat is only applicable to param.type array",o)),"csv"!==t.collectionFormat||"query"!==t.in&&"cookie"!==t.in||(t.style="form",t.explode=!1),"csv"!==t.collectionFormat||"path"!==t.in&&"header"!==t.in||(t.style="simple"),"ssv"===t.collectionFormat&&("query"===t.in?t.style="spaceDelimited":S("collectionFormat:ssv is no longer supported except for in:query parameters",t,o)),"pipes"===t.collectionFormat&&("query"===t.in?t.style="pipeDelimited":S("collectionFormat:pipes is no longer supported except for in:query parameters",t,o)),"multi"===t.collectionFormat&&(t.explode=!0),"tsv"===t.collectionFormat&&(S("collectionFormat:tsv is no longer supported",t,o),t["x-collectionFormat"]="tsv"),delete t.collectionFormat),t.type&&"object"!=t.type&&"body"!=t.type&&"formData"!=t.in)if(t.items&&t.schema)S("parameter has array,items and schema",t,o);else{t.schema&&"object"==typeof t.schema||(t.schema={}),t.schema.type=t.type,t.items&&(t.schema.items=t.items,delete t.items,h(t.schema.items,null,function(n,r,i){"collectionFormat"===r&&"string"==typeof n[r]&&(e&&n[r]!==e&&S("Nested collectionFormats are not supported",t,o),delete n[r])}));for(let e of g.parameterTypeProperties)void 0!==t[e]&&(t.schema[e]=t[e]),delete t[e]}t.schema&&A(t.schema,o),t["x-ms-skip-url-encoding"]&&"query"===t.in&&(t.allowReserved=!0,delete t["x-ms-skip-url-encoding"])}if(t&&"formData"===t.in){a=!1,u.content={};let e="application/x-www-form-urlencoded";if(l.length&&l.indexOf("multipart/form-data")>=0&&(e="multipart/form-data"),u.content[e]={},t.schema)u.content[e].schema=t.schema,t.schema.$ref&&(u["x-s2o-name"]=decodeURIComponent(t.schema.$ref.replace("#/components/schemas/","")));else{u.content[e].schema={},u.content[e].schema.type="object",u.content[e].schema.properties={},u.content[e].schema.properties[t.name]={};let n=u.content[e].schema,r=u.content[e].schema.properties[t.name];t.description&&(r.description=t.description),t.example&&(r.example=t.example),t.type&&(r.type=t.type);for(let e of g.parameterTypeProperties)void 0!==t[e]&&(r[e]=t[e]);!0===t.required&&(n.required||(n.required=[]),n.required.push(t.name)),void 0!==t.default&&(r.default=t.default),r.properties&&(r.properties=t.properties),t.allOf&&(r.allOf=t.allOf),"array"===t.type&&t.items&&(r.items=t.items,r.items.collectionFormat&&delete r.items.collectionFormat),"file"!==s&&"file"!==t["x-s2o-originalType"]||(r.type="string",r.format="binary"),P(t,r)}}else t&&"file"===t.type&&(t.required&&(u.required=t.required),u.content={},u.content["application/octet-stream"]={},u.content["application/octet-stream"].schema={},u.content["application/octet-stream"].schema.type="string",u.content["application/octet-stream"].schema.format="binary",P(t,u));if(t&&"body"===t.in){u.content={},t.name&&(u["x-s2o-name"]=(e&&e.operationId?g.sanitiseAll(e.operationId):"")+("_"+t.name).toCamelCase()),t.description&&(u.description=t.description),t.required&&(u.required=t.required),e&&o.rbname&&t.name&&(e[o.rbname]=t.name),t.schema&&t.schema.$ref?u["x-s2o-name"]=decodeURIComponent(t.schema.$ref.replace("#/components/schemas/","")):t.schema&&"array"===t.schema.type&&t.schema.items&&t.schema.items.$ref&&(u["x-s2o-name"]=decodeURIComponent(t.schema.items.$ref.replace("#/components/schemas/",""))+"Array"),l.length||l.push("application/json");for(let e of l)u.content[e]={},u.content[e].schema=f(t.schema||{}),A(u.content[e].schema,o);P(t,u)}if(Object.keys(u).length>0&&(t["x-s2o-delete"]=!0,e))if(e.requestBody&&a){e.requestBody["x-s2o-overloaded"]=!0,S("Operation "+(e.operationId||r)+" has multiple requestBodies",e,o)}else e.requestBody=Object.assign({},e.requestBody),e.requestBody.content&&e.requestBody.content["multipart/form-data"]&&e.requestBody.content["multipart/form-data"].schema&&e.requestBody.content["multipart/form-data"].schema.properties&&u.content["multipart/form-data"]&&u.content["multipart/form-data"].schema&&u.content["multipart/form-data"].schema.properties?(e.requestBody.content["multipart/form-data"].schema.properties=Object.assign(e.requestBody.content["multipart/form-data"].schema.properties,u.content["multipart/form-data"].schema.properties),e.requestBody.content["multipart/form-data"].schema.required=(e.requestBody.content["multipart/form-data"].schema.required||[]).concat(u.content["multipart/form-data"].schema.required||[]),e.requestBody.content["multipart/form-data"].schema.required.length||delete e.requestBody.content["multipart/form-data"].schema.required):e.requestBody.content&&e.requestBody.content["application/x-www-form-urlencoded"]&&e.requestBody.content["application/x-www-form-urlencoded"].schema&&e.requestBody.content["application/x-www-form-urlencoded"].schema.properties&&u.content["application/x-www-form-urlencoded"]&&u.content["application/x-www-form-urlencoded"].schema&&u.content["application/x-www-form-urlencoded"].schema.properties?(e.requestBody.content["application/x-www-form-urlencoded"].schema.properties=Object.assign(e.requestBody.content["application/x-www-form-urlencoded"].schema.properties,u.content["application/x-www-form-urlencoded"].schema.properties),e.requestBody.content["application/x-www-form-urlencoded"].schema.required=(e.requestBody.content["application/x-www-form-urlencoded"].schema.required||[]).concat(u.content["application/x-www-form-urlencoded"].schema.required||[]),e.requestBody.content["application/x-www-form-urlencoded"].schema.required.length||delete e.requestBody.content["application/x-www-form-urlencoded"].schema.required):(e.requestBody=Object.assign(e.requestBody,u),e.requestBody["x-s2o-name"]||(e.requestBody.schema&&e.requestBody.schema.$ref?e.requestBody["x-s2o-name"]=decodeURIComponent(e.requestBody.schema.$ref.replace("#/components/schemas/","")).split("/").join(""):e.operationId&&(e.requestBody["x-s2o-name"]=g.sanitiseAll(e.operationId))));if(t){delete t.type;for(let e of g.parameterTypeProperties)delete t[e];"path"!==t.in||void 0!==t.required&&!0===t.required||(o.patch?t.required=!0:x("(Patchable) path parameters must be required:true",o))}return u}function P(t,e){for(let n in t)n.startsWith("x-")&&!n.startsWith("x-s2o")&&(e[n]=t[n])}function z(t,e,n,r,i){if(!t)return!1;if(t.$ref&&"string"==typeof t.$ref)t.$ref.indexOf("#/definitions/")>=0?S("definition used as response: "+t.$ref,t,i):t.$ref.startsWith("#/responses/")&&(t.$ref="#/components/responses/"+g.sanitise(decodeURIComponent(t.$ref.replace("#/responses/",""))));else{if((void 0===t.description||null===t.description||""===t.description&&i.patch)&&(i.patch?"object"!=typeof t||Array.isArray(t)||(t.description=y[t]||""):x("(Patchable) response.description is mandatory",i)),t.schema){if(A(t.schema,i),t.schema.$ref&&"string"==typeof t.schema.$ref&&t.schema.$ref.startsWith("#/responses/")&&(t.schema.$ref="#/components/responses/"+g.sanitise(decodeURIComponent(t.schema.$ref.replace("#/responses/","")))),n&&n.produces&&"string"==typeof n.produces){if(!i.patch)return x("(Patchable) operation.produces must be an array",i);n.produces=[n.produces]}r.produces&&!Array.isArray(r.produces)&&delete r.produces;let e=((n?n.produces:null)||r.produces||[]).filter(g.uniqueOnly);e.length||e.push("*/*"),t.content={};for(let n of e){if(t.content[n]={},t.content[n].schema=f(t.schema),t.examples&&t.examples[n]){let e={};e.value=t.examples[n],t.content[n].examples={},t.content[n].examples.response=e,delete t.examples[n]}"file"===t.content[n].schema.type&&(t.content[n].schema={type:"string",format:"binary"})}delete t.schema}for(let e in t.examples)t.content||(t.content={}),t.content[e]||(t.content[e]={}),t.content[e].examples={},t.content[e].examples.response={},t.content[e].examples.response.value=t.examples[e];if(delete t.examples,t.headers)for(let e in t.headers)"status code"===e.toLowerCase()?i.patch?delete t.headers[e]:x('(Patchable) "Status Code" is not a valid header',i):R(t.headers[e],i)}}function D(t,e,n,r,o){for(let s in t){let u=t[s];u&&u["x-trace"]&&"object"==typeof u["x-trace"]&&(u.trace=u["x-trace"],delete u["x-trace"]),u&&u["x-summary"]&&"string"==typeof u["x-summary"]&&(u.summary=u["x-summary"],delete u["x-summary"]),u&&u["x-description"]&&"string"==typeof u["x-description"]&&(u.description=u["x-description"],delete u["x-description"]),u&&u["x-servers"]&&Array.isArray(u["x-servers"])&&(u.servers=u["x-servers"],delete u["x-servers"]);for(let t in u)if(g.httpMethods.indexOf(t)>=0||"x-amazon-apigateway-any-method"===t){let l=u[t];if(l&&l.parameters&&Array.isArray(l.parameters)){if(u.parameters)for(let t of u.parameters){"string"==typeof t.$ref&&(T(t,n),t=c(o,t.$ref)),l.parameters.find(function(e,n,r){return e.name===t.name&&e.in===t.in})||"formData"!==t.in&&"body"!==t.in&&"file"!==t.type||q(t,l,0,s,o,n)}for(let e of l.parameters)q(e,l,0,t+":"+s,o,n);n.debug||(l.parameters=l.parameters.filter(U))}if(l&&l.security&&C(l.security),"object"==typeof l){if(!l.responses){let t={description:"Default response"};l.responses={default:t}}for(let t in l.responses){z(l.responses[t],0,l,o,n)}}if(l&&l["x-servers"]&&Array.isArray(l["x-servers"]))l.servers=l["x-servers"],delete l["x-servers"];else if(l&&l.schemes&&l.schemes.length)for(let t of l.schemes)if((!o.schemes||o.schemes.indexOf(t)<0)&&(l.servers||(l.servers=[]),Array.isArray(o.servers)))for(let e of o.servers){let n=f(e),r=i.parse(n.url);r.protocol=t,n.url=r.format(),l.servers.push(n)}if(n.debug&&(l["x-s2o-consumes"]=l.consumes||[],l["x-s2o-produces"]=l.produces||[]),l){if(delete l.consumes,delete l.produces,delete l.schemes,l["x-ms-examples"]){for(let t in l["x-ms-examples"]){let e=l["x-ms-examples"][t],n=g.sanitiseAll(t);if(e.parameters)for(let n in e.parameters){let r=e.parameters[n];for(let e of(l.parameters||[]).concat(u.parameters||[]))e.$ref&&(e=a.jptr(o,e.$ref)),e.name!==n||e.example||(e.examples||(e.examples={}),e.examples[t]={value:r})}if(e.responses)for(let r in e.responses){if(e.responses[r].headers)for(let t in e.responses[r].headers){let n=e.responses[r].headers[t];for(let e in l.responses[r].headers)if(e===t){l.responses[r].headers[e].example=n}}if(e.responses[r].body&&(o.components.examples[n]={value:f(e.responses[r].body)},l.responses[r]&&l.responses[r].content))for(let e in l.responses[r].content){let i=l.responses[r].content[e];i.examples||(i.examples={}),i.examples[t]={$ref:"#/components/examples/"+n}}}}delete l["x-ms-examples"]}if(l.parameters&&0===l.parameters.length&&delete l.parameters,l.requestBody){let n=l.operationId?g.sanitiseAll(l.operationId):g.sanitiseAll(t+s).toCamelCase(),i=g.sanitise(l.requestBody["x-s2o-name"]||n||"");delete l.requestBody["x-s2o-name"];let o=JSON.stringify(l.requestBody),u=g.hash(o);if(!r[u]){let t={};t.name=i,t.body=l.requestBody,t.refs=[],r[u]=t}let c="#/"+e+"/"+encodeURIComponent(a.jpescape(s))+"/"+t+"/requestBody";r[u].refs.push(c)}}}if(u&&u.parameters){for(let t in u.parameters){q(u.parameters[t],null,0,s,o,n)}!n.debug&&Array.isArray(u.parameters)&&(u.parameters=u.parameters.filter(U))}}}function M(t,e){let n={};w={schemas:{}},t.security&&C(t.security);for(let n in t.components.securitySchemes){let r=g.sanitise(n);n!=r&&(t.components.securitySchemes[r]&&x("Duplicate sanitised securityScheme name "+r,e),t.components.securitySchemes[r]=t.components.securitySchemes[n],delete t.components.securitySchemes[n]),E(t.components.securitySchemes[r],e)}for(let n in t.components.schemas){let r=g.sanitiseAll(n),i="";if(n!=r){for(;t.components.schemas[r+i];)i=i?++i:2;t.components.schemas[r+i]=t.components.schemas[n],delete t.components.schemas[n]}w.schemas[n]=r+i,A(t.components.schemas[r+i],e)}e.refmap={},h(t,{payload:{options:e}},O),function(t,e){for(let n in e.refmap)a.jptr(t,n,{$ref:e.refmap[n]})}(t,e);for(let n in t.components.parameters){let r=g.sanitise(n);n!=r&&(t.components.parameters[r]&&x("Duplicate sanitised parameter name "+r,e),t.components.parameters[r]=t.components.parameters[n],delete t.components.parameters[n]),q(t.components.parameters[r],null,0,r,t,e)}for(let n in t.components.responses){let r=g.sanitise(n);n!=r&&(t.components.responses[r]&&x("Duplicate sanitised response name "+r,e),t.components.responses[r]=t.components.responses[n],delete t.components.responses[n]);let i=t.components.responses[r];if(z(i,0,null,t,e),i.headers)for(let t in i.headers)"status code"===t.toLowerCase()?e.patch?delete i.headers[t]:x('(Patchable) "Status Code" is not a valid header',e):R(i.headers[t],e)}for(let e in t.components.requestBodies){let r=t.components.requestBodies[e],i=JSON.stringify(r),o=g.hash(i),s={};s.name=e,s.body=r,s.refs=[],n[o]=s}if(D(t.paths,"paths",e,n,t),t["x-ms-paths"]&&D(t["x-ms-paths"],"x-ms-paths",e,n,t),!e.debug)for(let e in t.components.parameters){t.components.parameters[e]["x-s2o-delete"]&&delete t.components.parameters[e]}e.debug&&(t["x-s2o-consumes"]=t.consumes||[],t["x-s2o-produces"]=t.produces||[]),delete t.consumes,delete t.produces,delete t.schemes;let r=[];t.components.requestBodies={};let i=1;for(let e in n){let o=n[e];if(o.refs.length>1){let e="";for(o.name||(o.name="requestBody",e=i++);r.indexOf(o.name+e)>=0;)e=e?++e:2;o.name=o.name+e,r.push(o.name),t.components.requestBodies[o.name]=f(o.body);for(let e in o.refs){let n={};n.$ref="#/components/requestBodies/"+o.name,a.jptr(t,o.refs[e],n)}}}return t.components.responses&&0===Object.keys(t.components.responses).length&&delete t.components.responses,t.components.parameters&&0===Object.keys(t.components.parameters).length&&delete t.components.parameters,t.components.examples&&0===Object.keys(t.components.examples).length&&delete t.components.examples,t.components.requestBodies&&0===Object.keys(t.components.requestBodies).length&&delete t.components.requestBodies,t.components.securitySchemes&&0===Object.keys(t.components.securitySchemes).length&&delete t.components.securitySchemes,t.components.headers&&0===Object.keys(t.components.headers).length&&delete t.components.headers,t.components.schemas&&0===Object.keys(t.components.schemas).length&&delete t.components.schemas,t.components&&0===Object.keys(t.components).length&&delete t.components,t}function j(t){return t&&t.url&&"string"==typeof t.url?(t.url=t.url.split("{{").join("{"),t.url=t.url.split("}}").join("}"),t.url.replace(/\{(.+?)\}/g,function(e,n){t.variables||(t.variables={}),t.variables[n]={default:"unknown"}}),t):t}function k(t,e,n){if(void 0===t.info||null===t.info){if(!e.patch)return n(new _("(Patchable) info object is mandatory"));t.info={version:"",title:""}}if("object"!=typeof t.info||Array.isArray(t.info))return n(new _("info must be an object"));if(void 0===t.info.title||null===t.info.title){if(!e.patch)return n(new _("(Patchable) info.title cannot be null"));t.info.title=""}if(void 0===t.info.version||null===t.info.version){if(!e.patch)return n(new _("(Patchable) info.version cannot be null"));t.info.version=""}if("string"!=typeof t.info.version){if(!e.patch)return n(new _("(Patchable) info.version must be a string"));t.info.version=t.info.version.toString()}if(void 0!==t.info.logo){if(!e.patch)return n(new _("(Patchable) info should not have logo property"));t.info["x-logo"]=t.info.logo,delete t.info.logo}if(void 0!==t.info.termsOfService){if(null===t.info.termsOfService){if(!e.patch)return n(new _("(Patchable) info.termsOfService cannot be null"));t.info.termsOfService=""}if(i.URL&&e.whatwg)try{i.URL.parse(t.info.termsOfService)}catch(r){if(!e.patch)return n(new _("(Patchable) info.termsOfService must be a URL"));delete t.info.termsOfService}}}function F(t,e,n){if(void 0===t.paths){if(!e.patch)return n(new _("(Patchable) paths object is mandatory"));t.paths={}}}function L(t,e,n){return o(n,new Promise(function(n,r){if(t||(t={}),e.original=t,e.externals=[],e.externalRefs={},e.rewriteRefs=!0,e.preserveMiro=!0,e.promise={},e.promise.resolve=n,e.promise.reject=r,e.cache||(e.cache={}),e.source&&(e.cache[e.source]=e.original),t.openapi&&"string"==typeof t.openapi&&t.openapi.startsWith("3."))return e.openapi=p(t),k(e.openapi,e,r),F(e.openapi,e,r),void d.optionalResolve(e).then(function(){return e.direct?n(e.openapi):n(e)}).catch(function(t){console.warn(t),r(t)});if(!t.swagger||"2.0"!=t.swagger)return r(new _("Unsupported swagger/OpenAPI version: "+(t.openapi?t.openapi:t.swagger)));let i=e.openapi={};if(i.openapi="string"==typeof e.targetVersion&&e.targetVersion.startsWith("3.")?e.targetVersion:b,e.origin){i["x-origin"]||(i["x-origin"]=[]);let n={};n.url=e.source||e.origin,n.format="swagger",n.version=t.swagger,n.converter={},n.converter.url="https://github.com/mermade/oas-kit",n.converter.version=m,i["x-origin"].push(n)}if(delete(i=Object.assign(i,p(t))).swagger,h(i,{},function(t,e,n){null!==t[e]||e.startsWith("x-")||delete t[e]}),t.host)for(let e of Array.isArray(t.schemes)?t.schemes:[""]){let n={};n.url=(e?e+":":"")+"//"+t.host+(t.basePath?t.basePath:""),j(n),i.servers||(i.servers=[]),i.servers.push(n)}else if(t.basePath){let e={};e.url=t.basePath,j(e),i.servers||(i.servers=[]),i.servers.push(e)}if(delete i.host,delete i.basePath,i["x-servers"]&&Array.isArray(i["x-servers"])&&(i.servers=i["x-servers"],delete i["x-servers"]),t["x-ms-parameterized-host"]){let e=t["x-ms-parameterized-host"],n={};n.url=e.hostTemplate,n.variables={};for(let t in e.parameters){let r=e.parameters[t];r.$ref&&(r=f(c(i,r.$ref))),t.startsWith("x-")||(delete r.required,delete r.type,delete r.in,void 0===r.default&&(r.enum?r.default=r.enum[0]:r.default=""),n.variables[r.name]=r,delete r.name)}i.servers||(i.servers=[]),i.servers.push(n),delete i["x-ms-parameterized-host"]}k(i,e,r),F(i,e,r),"string"==typeof i.consumes&&(i.consumes=[i.consumes]),"string"==typeof i.produces&&(i.produces=[i.produces]),i.components={},i["x-callbacks"]&&(i.components.callbacks=i["x-callbacks"],delete i["x-callbacks"]),i.components.examples={},i.components.headers={},i["x-links"]&&(i.components.links=i["x-links"],delete i["x-links"]),i.components.parameters=i.parameters||{},i.components.responses=i.responses||{},i.components.requestBodies={},i.components.securitySchemes=i.securityDefinitions||{},i.components.schemas=i.definitions||{},delete i.definitions,delete i.responses,delete i.parameters,delete i.securityDefinitions,d.optionalResolve(e).then(function(){M(i,e),e.direct?n(e.openapi):n(e)}).catch(function(t){console.warn(t),r(t)})}))}function N(t,e,n){return o(n,new Promise(function(n,r){let i=null;try{i=JSON.parse(t)}catch(n){try{i=u.safeLoad(t,{json:!0}),e.sourceYaml=!0}catch(t){}}i?L(i,e).then(t=>n(t)).catch(t=>r(t)):r(new _("Could not parse string"))}))}t.exports={S2OError:_,targetVersion:b,convert:L,convertObj:L,convertUrl:function(t,e,n){return o(n,new Promise(function(n,r){e.origin=!0,e.source||(e.source=t),e.verbose&&console.log("GET "+t),s(t,{agent:e.agent}).then(function(t){if(200!==t.status)throw new _(`Received status code ${t.status}`);return t.text()}).then(function(t){N(t,e).then(t=>n(t)).catch(t=>r(t))}).catch(function(t){r(t)})}))},convertStr:N,convertFile:function(t,e,n){return o(n,new Promise(function(n,i){r.readFile(t,e.encoding||"utf8",function(r,o){r?i(r):(e.sourceFile=t,N(o,e).then(t=>n(t)).catch(t=>i(t)))})}))},convertStream:function(t,e,n){return o(n,new Promise(function(n,r){let i="";t.on("data",function(t){i+=t}).on("end",function(){N(i,e).then(t=>n(t)).catch(t=>r(t))})}))}}},function(t,e,n){(function(e){var n="object"==typeof e&&e&&e.Object===Object&&e;t.exports=n}).call(this,n(3))},function(t,e){var n=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return n.call(t)}catch(t){}try{return t+""}catch(t){}}return""}},function(t,e,n){var r=n(69),i=n(44),o=Object.prototype.hasOwnProperty;t.exports=function(t,e,n){var s=t[e];o.call(t,e)&&i(s,n)&&(void 0!==n||e in t)||r(t,e,n)}},function(t,e,n){var r=n(70);t.exports=function(t,e,n){"__proto__"==e&&r?r(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}},function(t,e,n){var r=n(9),i=function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();t.exports=i},function(t,e,n){var r=n(167),i=n(31),o=n(0),s=n(21),u=n(72),a=n(32),c=Object.prototype.hasOwnProperty;t.exports=function(t,e){var n=o(t),l=!n&&i(t),f=!n&&!l&&s(t),p=!n&&!l&&!f&&a(t),h=n||l||f||p,d=h?r(t.length,String):[],v=d.length;for(var g in t)!e&&!c.call(t,g)||h&&("length"==g||f&&("offset"==g||"parent"==g)||p&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||u(g,v))||d.push(g);return d}},function(t,e){var n=9007199254740991,r=/^(?:0|[1-9]\d*)$/;t.exports=function(t,e){var i=typeof t;return!!(e=null==e?n:e)&&("number"==i||"symbol"!=i&&r.test(t))&&t>-1&&t%1==0&&tp))return!1;var d=l.get(t);if(d&&l.get(e))return d==e;var v=-1,g=!0,y=n&u?new r:void 0;for(l.set(t,e),l.set(e,t);++v0&&(o=a.removeMin(),(s=u[o]).distance!==Number.POSITIVE_INFINITY);)r(o).forEach(c);return u}(t,String(e),n||o,r||function(e){return t.outEdges(e)})};var o=r.constant(1)},function(t,e,n){var r=n(5);function i(){this._arr=[],this._keyIndices={}}t.exports=i,i.prototype.size=function(){return this._arr.length},i.prototype.keys=function(){return this._arr.map(function(t){return t.key})},i.prototype.has=function(t){return r.has(this._keyIndices,t)},i.prototype.priority=function(t){var e=this._keyIndices[t];if(void 0!==e)return this._arr[e].priority},i.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},i.prototype.add=function(t,e){var n=this._keyIndices;if(t=String(t),!r.has(n,t)){var i=this._arr,o=i.length;return n[t]=o,i.push({key:t,priority:e}),this._decrease(o),!0}return!1},i.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key},i.prototype.decrease=function(t,e){var n=this._keyIndices[t];if(e>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[n].priority+" New: "+e);this._arr[n].priority=e,this._decrease(n)},i.prototype._heapify=function(t){var e=this._arr,n=2*t,r=n+1,i=t;n>1].priorityt._pos){var o=n.substr(t._pos);if("x-user-defined"===t._charset){for(var s=new r(o.length),u=0;ut._pos&&(t.push(new r(new Uint8Array(c.result.slice(t._pos)))),t._pos=c.result.byteLength)},c.onload=function(){t.push(null)},c.readAsArrayBuffer(n)}t._xhr.readyState===a.DONE&&"ms-stream"!==t._mode&&t.push(null)}}).call(this,n(4),n(18).Buffer,n(3))},function(t,e,n){(e=t.exports=n(116)).Stream=e,e.Readable=e,e.Writable=n(120),e.Duplex=n(19),e.Transform=n(122),e.PassThrough=n(323)},function(t,e,n){"use strict";(function(e,r){var i=n(39);t.exports=b;var o,s=n(109);b.ReadableState=m;n(117).EventEmitter;var u=function(t,e){return t.listeners(e).length},a=n(118),c=n(40).Buffer,l=e.Uint8Array||function(){};var f=n(24);f.inherits=n(8);var p=n(317),h=void 0;h=p&&p.debuglog?p.debuglog("stream"):function(){};var d,v=n(318),g=n(119);f.inherits(b,a);var y=["error","close","destroy","pause","resume"];function m(t,e){t=t||{};var r=e instanceof(o=o||n(19));this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var i=t.highWaterMark,s=t.readableHighWaterMark,u=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:r&&(s||0===s)?s:u,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new v,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(d||(d=n(121).StringDecoder),this.decoder=new d(t.encoding),this.encoding=t.encoding)}function b(t){if(o=o||n(19),!(this instanceof b))return new b(t);this._readableState=new m(t,this),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),a.call(this)}function w(t,e,n,r,i){var o,s=t._readableState;null===e?(s.reading=!1,function(t,e){if(e.ended)return;if(e.decoder){var n=e.decoder.end();n&&n.length&&(e.buffer.push(n),e.length+=e.objectMode?1:n.length)}e.ended=!0,A(t)}(t,s)):(i||(o=function(t,e){var n;r=e,c.isBuffer(r)||r instanceof l||"string"==typeof e||void 0===e||t.objectMode||(n=new TypeError("Invalid non-string/buffer chunk"));var r;return n}(s,e)),o?t.emit("error",o):s.objectMode||e&&e.length>0?("string"==typeof e||s.objectMode||Object.getPrototypeOf(e)===c.prototype||(e=function(t){return c.from(t)}(e)),r?s.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):_(t,s,e,!0):s.ended?t.emit("error",new Error("stream.push() after EOF")):(s.reading=!1,s.decoder&&!n?(e=s.decoder.write(e),s.objectMode||0!==e.length?_(t,s,e,!1):C(t,s)):_(t,s,e,!1))):r||(s.reading=!1));return function(t){return!t.ended&&(t.needReadable||t.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=x?t=x:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function A(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(h("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?i.nextTick(O,t):O(t))}function O(t){h("emit readable"),t.emit("readable"),T(t)}function C(t,e){e.readingMore||(e.readingMore=!0,i.nextTick(E,t,e))}function E(t,e){for(var n=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length=e.length?(n=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):n=function(t,e,n){var r;to.length?o.length:t;if(s===o.length?i+=o:i+=o.slice(0,t),0===(t-=s)){s===o.length?(++r,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n,n.data=o.slice(s));break}++r}return e.length-=r,i}(t,e):function(t,e){var n=c.allocUnsafe(t),r=e.head,i=1;r.data.copy(n),t-=r.data.length;for(;r=r.next;){var o=r.data,s=t>o.length?o.length:t;if(o.copy(n,n.length-t,0,s),0===(t-=s)){s===o.length?(++i,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=o.slice(s));break}++i}return e.length-=i,n}(t,e);return r}(t,e.buffer,e.decoder),n);var n}function P(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,i.nextTick(z,e,t))}function z(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function D(t,e){for(var n=0,r=t.length;n=e.highWaterMark||e.ended))return h("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?P(this):A(this),null;if(0===(t=S(t,e))&&e.ended)return 0===e.length&&P(this),null;var r,i=e.needReadable;return h("need readable",i),(0===e.length||e.length-t0?q(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),n!==t&&e.ended&&P(this)),null!==r&&this.emit("data",r),r},b.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},b.prototype.pipe=function(t,e){var n=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=t;break;case 1:o.pipes=[o.pipes,t];break;default:o.pipes.push(t)}o.pipesCount+=1,h("pipe count=%d opts=%j",o.pipesCount,e);var a=(!e||!1!==e.end)&&t!==r.stdout&&t!==r.stderr?l:b;function c(e,r){h("onunpipe"),e===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,h("cleanup"),t.removeListener("close",y),t.removeListener("finish",m),t.removeListener("drain",f),t.removeListener("error",g),t.removeListener("unpipe",c),n.removeListener("end",l),n.removeListener("end",b),n.removeListener("data",v),p=!0,!o.awaitDrain||t._writableState&&!t._writableState.needDrain||f())}function l(){h("onend"),t.end()}o.endEmitted?i.nextTick(a):n.once("end",a),t.on("unpipe",c);var f=function(t){return function(){var e=t._readableState;h("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&u(t,"data")&&(e.flowing=!0,T(t))}}(n);t.on("drain",f);var p=!1;var d=!1;function v(e){h("ondata"),d=!1,!1!==t.write(e)||d||((1===o.pipesCount&&o.pipes===t||o.pipesCount>1&&-1!==D(o.pipes,t))&&!p&&(h("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,d=!0),n.pause())}function g(e){h("onerror",e),b(),t.removeListener("error",g),0===u(t,"error")&&t.emit("error",e)}function y(){t.removeListener("finish",m),b()}function m(){h("onfinish"),t.removeListener("close",y),b()}function b(){h("unpipe"),n.unpipe(t)}return n.on("data",v),function(t,e,n){if("function"==typeof t.prependListener)return t.prependListener(e,n);t._events&&t._events[e]?s(t._events[e])?t._events[e].unshift(n):t._events[e]=[n,t._events[e]]:t.on(e,n)}(t,"error",g),t.once("close",y),t.once("finish",m),t.emit("pipe",n),o.flowing||(h("pipe resume"),n.resume()),t},b.prototype.unpipe=function(t){var e=this._readableState,n={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,n),this);if(!t){var r=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o0&&s.length>i&&!s.warned){s.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=s.length,u=a,console&&console.warn&&console.warn(u)}return t}function f(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},i=function(){for(var t=[],e=0;e0&&(s=e[0]),s instanceof Error)throw s;var u=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw u.context=s,u}var a=i[t];if(void 0===a)return!1;if("function"==typeof a)o(a,this,e);else{var c=a.length,l=d(a,c);for(n=0;n=0;o--)if(n[o]===e||n[o].listener===e){s=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(t,e){for(;e+1=0;r--)this.removeListener(t,e[r]);return this},u.prototype.listeners=function(t){return p(this,t,!0)},u.prototype.rawListeners=function(t){return p(this,t,!1)},u.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):h.call(t,e)},u.prototype.listenerCount=h,u.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(t,e,n){t.exports=n(117).EventEmitter},function(t,e,n){"use strict";var r=n(39);function i(t,e){t.emit("error",e)}t.exports={destroy:function(t,e){var n=this,o=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return o||s?(e?e(t):!t||this._writableState&&this._writableState.errorEmitted||r.nextTick(i,this,t),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(t){!e&&t?(r.nextTick(i,n,t),n._writableState&&(n._writableState.errorEmitted=!0)):e&&e(t)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},function(t,e,n){"use strict";(function(e,r,i){var o=n(39);function s(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,n){var r=t.entry;t.entry=null;for(;r;){var i=r.callback;e.pendingcb--,i(n),r=r.next}e.corkedRequestsFree?e.corkedRequestsFree.next=t:e.corkedRequestsFree=t}(e,t)}}t.exports=m;var u,a=!e.browser&&["v0.10","v0.9."].indexOf(e.version.slice(0,5))>-1?r:o.nextTick;m.WritableState=y;var c=n(24);c.inherits=n(8);var l={deprecate:n(322)},f=n(118),p=n(40).Buffer,h=i.Uint8Array||function(){};var d,v=n(119);function g(){}function y(t,e){u=u||n(19),t=t||{};var r=e instanceof u;this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var i=t.highWaterMark,c=t.writableHighWaterMark,l=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:r&&(c||0===c)?c:l,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var f=!1===t.decodeStrings;this.decodeStrings=!f,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var n=t._writableState,r=n.sync,i=n.writecb;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(n),e)!function(t,e,n,r,i){--e.pendingcb,n?(o.nextTick(i,r),o.nextTick(A,t,e),t._writableState.errorEmitted=!0,t.emit("error",r)):(i(r),t._writableState.errorEmitted=!0,t.emit("error",r),A(t,e))}(t,n,r,e,i);else{var s=x(n);s||n.corked||n.bufferProcessing||!n.bufferedRequest||_(t,n),r?a(w,t,n,s,i):w(t,n,s,i)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new s(this)}function m(t){if(u=u||n(19),!(d.call(m,this)||this instanceof u))return new m(t);this._writableState=new y(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),f.call(this)}function b(t,e,n,r,i,o,s){e.writelen=r,e.writecb=s,e.writing=!0,e.sync=!0,n?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function w(t,e,n,r){n||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,r(),A(t,e)}function _(t,e){e.bufferProcessing=!0;var n=e.bufferedRequest;if(t._writev&&n&&n.next){var r=e.bufferedRequestCount,i=new Array(r),o=e.corkedRequestsFree;o.entry=n;for(var u=0,a=!0;n;)i[u]=n,n.isBuf||(a=!1),n=n.next,u+=1;i.allBuffers=a,b(t,e,!0,e.length,i,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new s(e),e.bufferedRequestCount=0}else{for(;n;){var c=n.chunk,l=n.encoding,f=n.callback;if(b(t,e,!1,e.objectMode?1:c.length,c,l,f),n=n.next,e.bufferedRequestCount--,e.writing)break}null===n&&(e.lastBufferedRequest=null)}e.bufferedRequest=n,e.bufferProcessing=!1}function x(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function S(t,e){t._final(function(n){e.pendingcb--,n&&t.emit("error",n),e.prefinished=!0,t.emit("prefinish"),A(t,e)})}function A(t,e){var n=x(e);return n&&(!function(t,e){e.prefinished||e.finalCalled||("function"==typeof t._final?(e.pendingcb++,e.finalCalled=!0,o.nextTick(S,t,e)):(e.prefinished=!0,t.emit("prefinish")))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"))),n}c.inherits(m,f),y.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(y.prototype,"buffer",{get:l.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(d=Function.prototype[Symbol.hasInstance],Object.defineProperty(m,Symbol.hasInstance,{value:function(t){return!!d.call(this,t)||this===m&&(t&&t._writableState instanceof y)}})):d=function(t){return t instanceof this},m.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},m.prototype.write=function(t,e,n){var r,i=this._writableState,s=!1,u=!i.objectMode&&(r=t,p.isBuffer(r)||r instanceof h);return u&&!p.isBuffer(t)&&(t=function(t){return p.from(t)}(t)),"function"==typeof e&&(n=e,e=null),u?e="buffer":e||(e=i.defaultEncoding),"function"!=typeof n&&(n=g),i.ended?function(t,e){var n=new Error("write after end");t.emit("error",n),o.nextTick(e,n)}(this,n):(u||function(t,e,n,r){var i=!0,s=!1;return null===n?s=new TypeError("May not write null values to stream"):"string"==typeof n||void 0===n||e.objectMode||(s=new TypeError("Invalid non-string/buffer chunk")),s&&(t.emit("error",s),o.nextTick(r,s),i=!1),i}(this,i,t,n))&&(i.pendingcb++,s=function(t,e,n,r,i,o){if(!n){var s=function(t,e,n){t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=p.from(e,n));return e}(e,r,i);r!==s&&(n=!0,i="buffer",r=s)}var u=e.objectMode?1:r.length;e.length+=u;var a=e.length-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(m.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),m.prototype._write=function(t,e,n){n(new Error("_write() is not implemented"))},m.prototype._writev=null,m.prototype.end=function(t,e,n){var r=this._writableState;"function"==typeof t?(n=t,t=null,e=null):"function"==typeof e&&(n=e,e=null),null!=t&&this.write(t,e),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||function(t,e,n){e.ending=!0,A(t,e),n&&(e.finished?o.nextTick(n):t.once("finish",n));e.ended=!0,t.writable=!1}(this,r,n)},Object.defineProperty(m.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),m.prototype.destroy=v.destroy,m.prototype._undestroy=v.undestroy,m.prototype._destroy=function(t,e){this.end(),e(t)}}).call(this,n(4),n(320).setImmediate,n(3))},function(t,e,n){"use strict";var r=n(40).Buffer,i=r.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(r.isEncoding===i||!i(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=a,this.end=c,e=4;break;case"utf8":this.fillLast=u,e=4;break;case"base64":this.text=l,this.end=f,e=3;break;default:return this.write=p,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(e)}function s(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function u(t){var e=this.lastTotal-this.lastNeed,n=function(t,e,n){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==n?n:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function a(t,e){if((t.length-e)%2==0){var n=t.toString("utf16le",e);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function c(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,n)}return e}function l(t,e){var n=(t.length-e)%3;return 0===n?t.toString("base64",e):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-n))}function f(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function p(t){return t.toString(this.encoding)}function h(t){return t&&t.length?this.write(t):""}e.StringDecoder=o,o.prototype.write=function(t){if(0===t.length)return"";var e,n;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n=0)return i>0&&(t.lastNeed=i-1),i;if(--r=0)return i>0&&(t.lastNeed=i-2),i;if(--r=0)return i>0&&(2===i?i=0:t.lastNeed=i-3),i;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=n;var r=t.length-(n-this.lastNeed);return t.copy(this.lastChar,0,r),t.toString("utf8",e,r)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},function(t,e,n){"use strict";t.exports=s;var r=n(19),i=n(24);function o(t,e){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(!r)return this.emit("error",new Error("write callback called multiple times"));n.writechunk=null,n.writecb=null,null!=e&&this.push(e),r(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length-1?i=s:(n=r.isUndefined(t)?void 0:O(t),r.isUndefined(n)?i=s:((i=n).path=a(o.join(n.path,s.path)),i.query=function(t,e){var n={};function i(t){r.forOwn(t,function(t,e){n[e]=t})}return i(u.parse(t||"")),i(u.parse(e||"")),0===Object.keys(n).length?void 0:u.stringify(n)}(n.query,s.query))),i.fragment=void 0,(-1===h.indexOf(i.reference)&&0===i.path.indexOf("../")?"../":"")+c.serialize(i)}function g(t){return p.indexOf(w(t))>-1}function y(t){return r.isUndefined(t.error)&&"invalid"!==t.type}function m(t,e){var n=t;return e.forEach(function(t){if(!(t in n))throw Error("JSON Pointer points to missing location: "+z(e));n=n[t]}),n}function b(t){return Object.keys(t).filter(function(t){return"$ref"!==t})}function w(t){var e;switch(t.uriDetails.reference){case"absolute":case"uri":e="remote";break;case"same-document":e="local";break;default:e=t.uriDetails.reference}return e}function _(t,e){var n=f[t],i=Promise.resolve(),o=r.cloneDeep(e.loaderOptions||{});return r.isUndefined(n)?(r.isUndefined(o.processContent)&&(o.processContent=function(t,e){e(void 0,JSON.parse(t.text))}),i=(i=s.load(decodeURI(t),o)).then(function(e){return f[t]={value:e},e}).catch(function(e){throw f[t]={error:e},e})):i=i.then(function(){if(r.isError(n.error))throw n.error;return n.value}),i=i.then(function(t){return r.cloneDeep(t)})}function x(t,e){var n=!0;try{if(!r.isPlainObject(t))throw new Error("obj is not an Object");if(!r.isString(t.$ref))throw new Error("obj.$ref is not a String")}catch(t){if(e)throw t;n=!1}return n}function S(t){return-1!==t.indexOf("://")||o.isAbsolute(t)?t:o.resolve(e.cwd(),t)}function A(t,e){t.error=e.message,t.missing=!0}function O(t){return c.parse(t)}function C(t,e){var n,i;if(t=r.isUndefined(t)?{}:r.cloneDeep(t),!r.isObject(t))throw new TypeError("options must be an Object");if(!r.isUndefined(t.resolveCirculars)&&!r.isBoolean(t.resolveCirculars))throw new TypeError("options.resolveCirculars must be a Boolean");if(!(r.isUndefined(t.filter)||r.isArray(t.filter)||r.isFunction(t.filter)||r.isString(t.filter)))throw new TypeError("options.filter must be an Array, a Function of a String");if(!r.isUndefined(t.includeInvalid)&&!r.isBoolean(t.includeInvalid))throw new TypeError("options.includeInvalid must be a Boolean");if(!r.isUndefined(t.location)&&!r.isString(t.location))throw new TypeError("options.location must be a String");if(!r.isUndefined(t.refPreProcessor)&&!r.isFunction(t.refPreProcessor))throw new TypeError("options.refPreProcessor must be a Function");if(!r.isUndefined(t.refPostProcessor)&&!r.isFunction(t.refPostProcessor))throw new TypeError("options.refPostProcessor must be a Function");if(!r.isUndefined(t.subDocPath)&&!r.isArray(t.subDocPath)&&!q(t.subDocPath))throw new TypeError("options.subDocPath must be an Array of path segments or a valid JSON Pointer");if(r.isUndefined(t.resolveCirculars)&&(t.resolveCirculars=!1),t.filter=function(t){var e,n;return r.isArray(t.filter)||r.isString(t.filter)?(n=r.isString(t.filter)?[t.filter]:t.filter,e=function(t){return n.indexOf(t.type)>-1||n.indexOf(w(t))>-1}):r.isFunction(t.filter)?e=t.filter:r.isUndefined(t.filter)&&(e=function(){return!0}),function(n,r){return("invalid"!==n.type||!0===t.includeInvalid)&&e(n,r)}}(t),r.isUndefined(t.location)&&(t.location=S("./root.json")),(n=t.location.split("#")).length>1&&(t.subDocPath="#"+n[1]),i=decodeURI(t.location)===t.location,t.location=v(t.location,void 0),i&&(t.location=decodeURI(t.location)),t.subDocPath=function(t){var e;return r.isArray(t.subDocPath)?e=t.subDocPath:r.isString(t.subDocPath)?e=P(t.subDocPath):r.isUndefined(t.subDocPath)&&(e=[]),e}(t),!r.isUndefined(e))try{m(e,t.subDocPath)}catch(t){throw t.message=t.message.replace("JSON Pointer","options.subDocPath"),t}return t}function E(t){if(!r.isArray(t))throw new TypeError("path must be an array");return t.map(function(t){return r.isString(t)||(t=JSON.stringify(t)),t.replace(/~1/g,"/").replace(/~0/g,"~")})}function U(t){if(!r.isArray(t))throw new TypeError("path must be an array");return t.map(function(t){return r.isString(t)||(t=JSON.stringify(t)),t.replace(/~/g,"~0").replace(/\//g,"~1")})}function R(t,e){var n={};if(!r.isArray(t)&&!r.isObject(t))throw new TypeError("obj must be an Array or an Object");return function t(e,n,i,o){var s=!0;function u(n,r){i.push(r),t(e,n,i,o),i.pop()}r.isFunction(o)&&(s=o(e,n,i)),-1===e.indexOf(n)&&(e.push(n),!1!==s&&(r.isArray(n)?n.forEach(function(t,e){u(t,e.toString())}):r.isObject(n)&&r.forOwn(n,function(t,e){u(t,e)})),e.pop())}(function(t,e){var n,r=[];return e.length>0&&(n=t,e.slice(0,e.length-1).forEach(function(t){t in n&&(n=n[t],r.push(n))})),r}(t,(e=C(e,t)).subDocPath),m(t,e.subDocPath),r.cloneDeep(e.subDocPath),function(t,i,o){var s,u,a=!0;return x(i)&&(r.isUndefined(e.refPreProcessor)||(i=e.refPreProcessor(r.cloneDeep(i),o)),s=T(i),r.isUndefined(e.refPostProcessor)||(s=e.refPostProcessor(s,o)),e.filter(s,o)&&(u=z(o),n[u]=s),b(i).length>0&&(a=!1)),a}),n}function T(t){var e,n,i,o={def:t};try{if(x(t,!0)){if(e=t.$ref,i=d[e],r.isUndefined(i)&&(i=d[e]=O(e)),o.uri=e,o.uriDetails=i,r.isUndefined(i.error)){o.type=w(o);try{["#","/"].indexOf(e[0])>-1?q(e,!0):e.indexOf("#")>-1&&q(i.fragment,!0)}catch(t){o.error=t.message,o.type="invalid"}}else o.error=o.uriDetails.error,o.type="invalid";(n=b(t)).length>0&&(o.warning="Extra JSON Reference properties will be ignored: "+n.join(", "))}else o.type="invalid"}catch(t){o.error=t.message,o.type="invalid"}return o}function q(t,e){var n,i=!0;try{if(!r.isString(t))throw new Error("ptr is not a String");if(""!==t){if(n=t.charAt(0),-1===["#","/"].indexOf(n))throw new Error("ptr must start with a / or #/");if("#"===n&&"#"!==t&&"/"!==t.charAt(1))throw new Error("ptr must start with a / or #/");if(t.match(l))throw new Error("ptr has invalid token(s)")}}catch(t){if(!0===e)throw t;i=!1}return i}function P(t){try{q(t,!0)}catch(t){throw new Error("ptr must be a JSON Pointer: "+t.message)}var e=t.split("/");return e.shift(),E(e)}function z(t,e){if(!r.isArray(t))throw new Error("path must be an Array");return(!1!==e?"#":"")+(t.length>0?"/":"")+U(t).join("/")}function D(t,e){var n=Promise.resolve();return n=n.then(function(){if(!r.isArray(t)&&!r.isObject(t))throw new TypeError("obj must be an Array or an Object");e=C(e,t),t=r.cloneDeep(t)}).then(function(){var n={deps:{},docs:{},refs:{}};return function t(e,n,i){var s,u,a=Promise.resolve(),c=z(n.subDocPath),l=S(n.location),f=o.dirname(n.location),p=l+c;return r.isUndefined(i.docs[l])&&(i.docs[l]=e),r.isUndefined(i.deps[p])&&(i.deps[p]={},s=R(e,n),r.forOwn(s,function(o,s){var l,h,d=S(n.location)+s,m=o.refdId=decodeURI(S(g(o)?v(f,o.uri):n.location)+"#"+(o.uri.indexOf("#")>-1?o.uri.split("#")[1]:""));i.refs[d]=o,y(o)&&(o.fqURI=m,i.deps[p][s===c?"#":s.replace(c+"/","#/")]=m,0!==d.indexOf(m+"/")?((u=r.cloneDeep(n)).subDocPath=r.isUndefined(o.uriDetails.fragment)?[]:P(decodeURI(o.uriDetails.fragment)),g(o)?(delete u.filter,u.location=m.split("#")[0],a=a.then((l=i,h=u,function(){var t=S(h.location),e=l.docs[t];return r.isUndefined(e)?_(t,h).catch(function(e){return l.docs[t]=e,e}):Promise.resolve().then(function(){return e})}))):a=a.then(function(){return e}),a=a.then(function(e,n,i){return function(o){if(r.isError(o))A(i,o);else try{return t(o,n,e).catch(function(t){A(i,t)})}catch(t){A(i,t)}}}(i,u,o))):o.circular=!0)})),a}(t,e,n).then(function(){return n})}).then(function(t){var n={},s=[],u=[],a=new i.Graph,c=S(e.location),l=c+z(e.subDocPath),f=o.dirname(c);return Object.keys(t.deps).forEach(function(t){a.setNode(t)}),r.forOwn(t.deps,function(t,e){r.forOwn(t,function(t){a.setEdge(e,t)})}),(s=i.alg.findCycles(a)).forEach(function(t){t.forEach(function(t){-1===u.indexOf(t)&&u.push(t)})}),r.forOwn(t.deps,function(e,n){r.forOwn(e,function(e,r){var i,o=!1,a=n+r.slice(1),c=t.refs[n+r.slice(1)],l=g(c);u.indexOf(e)>-1&&s.forEach(function(t){o||(i=t.indexOf(e))>-1&&t.forEach(function(n){o||0===a.indexOf(n+"/")&&(l&&i!==t.length-1&&"#"===e[e.length-1]||(o=!0))})}),o&&(c.circular=!0)})}),r.forOwn(Object.keys(t.deps).reverse(),function(n){var i=t.deps[n],o=n.split("#"),s=t.docs[o[0]],u=P(o[1]);r.forOwn(i,function(n,i){var a,c,l,f=n.split("#"),p=t.docs[f[0]],h=u.concat(P(i)),d=t.refs[o[0]+z(h)];if(r.isUndefined(d.error)&&r.isUndefined(d.missing))if(!e.resolveCirculars&&d.circular)d.value=d.def;else{try{d.value=m(p,P(f[1]))}catch(t){return void A(d,t)}""===o[1]&&"#"===i?t.docs[o[0]]=d.value:(a=s,c=h,l=d.value,m(a,c.slice(0,c.length-1))[c[c.length-1]]=l)}})}),Object.keys(t.refs).forEach(function(i){var o,s,u=t.refs[i];"invalid"!==u.type&&("#"===u.fqURI[u.fqURI.length-1]&&"#"!==u.uri[u.uri.length-1]&&(u.fqURI=u.fqURI.substr(0,u.fqURI.length-1)),o=u.fqURI.split("/"),s=u.uri.split("/"),r.times(s.length-1,function(t){var e=s[s.length-t-1],n=o.length-t-1,r=o[n];"."!==e&&".."!==e||(e=r),o[n]=e}),u.fqURI=o.join("/"),0===u.fqURI.indexOf(c)?u.fqURI=u.fqURI.replace(c,""):0===u.fqURI.indexOf(f)&&(u.fqURI=u.fqURI.replace(f,"")),"/"===u.fqURI[0]&&(u.fqURI="."+u.fqURI)),0===i.indexOf(l)&&function r(i,o,s){var u,a=o.split("#"),c=t.refs[o];n[a[0]===e.location?"#"+a[1]:z(e.subDocPath.concat(s))]=c,!c.circular&&y(c)?(u=t.deps[c.refdId],0!==c.refdId.indexOf(i)&&Object.keys(u).forEach(function(t){r(c.refdId,c.refdId+t.substr(1),s.concat(P(t)))})):!c.circular&&c.error&&(c.error=c.error.replace("options.subDocPath","JSON Pointer"),c.error.indexOf("#")>-1&&(c.error=c.error.replace(c.uri.substr(c.uri.indexOf("#")),c.uri)),0!==c.error.indexOf("ENOENT:")&&0!==c.error.indexOf("Not Found")||(c.error="JSON Pointer points to missing location: "+c.uri))}(l,i,P(i.substr(l.length)))}),r.forOwn(t.refs,function(t){delete t.refdId,t.missing&&(t.error=t.error.split(": ")[0]+": "+t.def.$ref)}),{refs:n,resolved:t.docs[c]}})}"undefined"==typeof Promise&&n(102),t.exports.clearCache=function(){f={}},t.exports.decodePath=function(t){return E(t)},t.exports.encodePath=function(t){return U(t)},t.exports.findRefs=function(t,e){return R(t,e)},t.exports.findRefsAt=function(t,e){return function(t,e){var n=Promise.resolve();return n=n.then(function(){if(!r.isString(t))throw new TypeError("location must be a string");return r.isUndefined(e)&&(e={}),r.isObject(e)&&(e.location=t),_((e=C(e)).location,e)}).then(function(t){var n=r.cloneDeep(f[e.location]),i=r.cloneDeep(e),o=O(e.location);return r.isUndefined(n.refs)&&(delete i.filter,delete i.subDocPath,i.includeInvalid=!0,f[e.location].refs=R(t,i)),r.isUndefined(e.filter)||(i.filter=e.filter),r.isUndefined(o.fragment)?r.isUndefined(o.subDocPath)||(i.subDocPath=e.subDocPath):i.subDocPath=P(decodeURI(o.fragment)),{refs:R(t,i),value:t}})}(t,e)},t.exports.getRefDetails=function(t){return T(t)},t.exports.isPtr=function(t,e){return q(t,e)},t.exports.isRef=function(t,e){return function(t,e){return x(t,e)&&"invalid"!==T(t).type}(t,e)},t.exports.pathFromPtr=function(t){return P(t)},t.exports.pathToPtr=function(t,e){return z(t,e)},t.exports.resolveRefs=function(t,e){return D(t,e)},t.exports.resolveRefsAt=function(t,e){return function(t,e){var n=Promise.resolve();return n=n.then(function(){if(!r.isString(t))throw new TypeError("location must be a string");return r.isUndefined(e)&&(e={}),r.isObject(e)&&(e.location=t),_((e=C(e)).location,e)}).then(function(t){var n=r.cloneDeep(e),i=O(e.location);return r.isUndefined(i.fragment)||(n.subDocPath=P(decodeURI(i.fragment))),D(t,n).then(function(e){return{refs:e.refs,resolved:e.resolved,value:t}})})}(t,e)}}).call(this,n(4))},function(t,e,n){var r=n(41);"string"==typeof r&&(r=[[t.i,r,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0},o=n(131)(r,i);r.locals&&(t.exports=r.locals),t.hot.accept(41,function(){var e=n(41);if("string"==typeof e&&(e=[[t.i,e,""]]),!function(t,e){var n,r=0;for(n in t){if(!e||t[n]!==e[n])return!1;r++}for(n in e)r--;return 0===r}(r.locals,e.locals))throw new Error("Aborting CSS HMR due to changed css-modules locals.");o(e)}),t.hot.dispose(function(){o()})},function(t,e,n){"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map(function(e){var n=function(t,e){var n=t[1]||"",r=t[3];if(!r)return n;if(e&&"function"==typeof btoa){var i=(s=r,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(s))))+" */"),o=r.sources.map(function(t){return"/*# sourceURL="+r.sourceRoot+t+" */"});return[n].concat(o).concat([i]).join("\n")}var s;return[n].join("\n")}(e,t);return e[2]?"@media "+e[2]+"{"+n+"}":n}).join("")},e.i=function(t,n){"string"==typeof t&&(t=[[null,t,""]]);for(var r={},i=0;i=0&&l.splice(e,1)}function g(t){var e=document.createElement("style");if(void 0===t.attrs.type&&(t.attrs.type="text/css"),void 0===t.attrs.nonce){var r=function(){0;return n.nc}();r&&(t.attrs.nonce=r)}return y(e,t.attrs),d(t,e),e}function y(t,e){Object.keys(e).forEach(function(n){t.setAttribute(n,e[n])})}function m(t,e){var n,r,i,o;if(e.transform&&t.css){if(!(o="function"==typeof e.transform?e.transform(t.css):e.transform.default(t.css)))return function(){};t.css=o}if(e.singleton){var s=c++;n=a||(a=g(e)),r=_.bind(null,n,s,!1),i=_.bind(null,n,s,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(t){var e=document.createElement("link");return void 0===t.attrs.type&&(t.attrs.type="text/css"),t.attrs.rel="stylesheet",y(e,t.attrs),d(t,e),e}(e),r=function(t,e,n){var r=n.css,i=n.sourceMap,o=void 0===e.convertToAbsoluteUrls&&i;(e.convertToAbsoluteUrls||o)&&(r=f(r));i&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */");var s=new Blob([r],{type:"text/css"}),u=t.href;t.href=URL.createObjectURL(s),u&&URL.revokeObjectURL(u)}.bind(null,n,e),i=function(){v(n),n.href&&URL.revokeObjectURL(n.href)}):(n=g(e),r=function(t,e){var n=e.css,r=e.media;r&&t.setAttribute("media",r);if(t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}.bind(null,n),i=function(){v(n)});return r(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;r(t=e)}else i()}}t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(e=e||{}).attrs="object"==typeof e.attrs?e.attrs:{},e.singleton||"boolean"==typeof e.singleton||(e.singleton=s()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var n=h(t,e);return p(n,e),function(t){for(var r=[],i=0;i - * Copyright JS Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */(function(){var o,s=200,u="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",c="__lodash_hash_undefined__",l=500,f="__lodash_placeholder__",p=1,h=2,d=4,v=1,g=2,y=1,m=2,b=4,w=8,_=16,x=32,S=64,A=128,O=256,C=512,E=30,U="...",R=800,T=16,q=1,P=2,z=1/0,D=9007199254740991,M=1.7976931348623157e308,j=NaN,k=4294967295,F=k-1,L=k>>>1,N=[["ary",A],["bind",y],["bindKey",m],["curry",w],["curryRight",_],["flip",C],["partial",x],["partialRight",S],["rearg",O]],I="[object Arguments]",$="[object Array]",B="[object AsyncFunction]",H="[object Boolean]",Y="[object Date]",Z="[object DOMException]",X="[object Error]",W="[object Function]",J="[object GeneratorFunction]",G="[object Map]",Q="[object Number]",V="[object Null]",K="[object Object]",tt="[object Proxy]",et="[object RegExp]",nt="[object Set]",rt="[object String]",it="[object Symbol]",ot="[object Undefined]",st="[object WeakMap]",ut="[object WeakSet]",at="[object ArrayBuffer]",ct="[object DataView]",lt="[object Float32Array]",ft="[object Float64Array]",pt="[object Int8Array]",ht="[object Int16Array]",dt="[object Int32Array]",vt="[object Uint8Array]",gt="[object Uint8ClampedArray]",yt="[object Uint16Array]",mt="[object Uint32Array]",bt=/\b__p \+= '';/g,wt=/\b(__p \+=) '' \+/g,_t=/(__e\(.*?\)|\b__t\)) \+\n'';/g,xt=/&(?:amp|lt|gt|quot|#39);/g,St=/[&<>"']/g,At=RegExp(xt.source),Ot=RegExp(St.source),Ct=/<%-([\s\S]+?)%>/g,Et=/<%([\s\S]+?)%>/g,Ut=/<%=([\s\S]+?)%>/g,Rt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Tt=/^\w*$/,qt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Pt=/[\\^$.*+?()[\]{}|]/g,zt=RegExp(Pt.source),Dt=/^\s+|\s+$/g,Mt=/^\s+/,jt=/\s+$/,kt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ft=/\{\n\/\* \[wrapped with (.+)\] \*/,Lt=/,? & /,Nt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,It=/\\(\\)?/g,$t=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Bt=/\w*$/,Ht=/^[-+]0x[0-9a-f]+$/i,Yt=/^0b[01]+$/i,Zt=/^\[object .+?Constructor\]$/,Xt=/^0o[0-7]+$/i,Wt=/^(?:0|[1-9]\d*)$/,Jt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Gt=/($^)/,Qt=/['\n\r\u2028\u2029\\]/g,Vt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Kt="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",te="[\\ud800-\\udfff]",ee="["+Kt+"]",ne="["+Vt+"]",re="\\d+",ie="[\\u2700-\\u27bf]",oe="[a-z\\xdf-\\xf6\\xf8-\\xff]",se="[^\\ud800-\\udfff"+Kt+re+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",ue="\\ud83c[\\udffb-\\udfff]",ae="[^\\ud800-\\udfff]",ce="(?:\\ud83c[\\udde6-\\uddff]){2}",le="[\\ud800-\\udbff][\\udc00-\\udfff]",fe="[A-Z\\xc0-\\xd6\\xd8-\\xde]",pe="(?:"+oe+"|"+se+")",he="(?:"+fe+"|"+se+")",de="(?:"+ne+"|"+ue+")"+"?",ve="[\\ufe0e\\ufe0f]?"+de+("(?:\\u200d(?:"+[ae,ce,le].join("|")+")[\\ufe0e\\ufe0f]?"+de+")*"),ge="(?:"+[ie,ce,le].join("|")+")"+ve,ye="(?:"+[ae+ne+"?",ne,ce,le,te].join("|")+")",me=RegExp("['’]","g"),be=RegExp(ne,"g"),we=RegExp(ue+"(?="+ue+")|"+ye+ve,"g"),_e=RegExp([fe+"?"+oe+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[ee,fe,"$"].join("|")+")",he+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[ee,fe+pe,"$"].join("|")+")",fe+"?"+pe+"+(?:['’](?:d|ll|m|re|s|t|ve))?",fe+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",re,ge].join("|"),"g"),xe=RegExp("[\\u200d\\ud800-\\udfff"+Vt+"\\ufe0e\\ufe0f]"),Se=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Ae=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Oe=-1,Ce={};Ce[lt]=Ce[ft]=Ce[pt]=Ce[ht]=Ce[dt]=Ce[vt]=Ce[gt]=Ce[yt]=Ce[mt]=!0,Ce[I]=Ce[$]=Ce[at]=Ce[H]=Ce[ct]=Ce[Y]=Ce[X]=Ce[W]=Ce[G]=Ce[Q]=Ce[K]=Ce[et]=Ce[nt]=Ce[rt]=Ce[st]=!1;var Ee={};Ee[I]=Ee[$]=Ee[at]=Ee[ct]=Ee[H]=Ee[Y]=Ee[lt]=Ee[ft]=Ee[pt]=Ee[ht]=Ee[dt]=Ee[G]=Ee[Q]=Ee[K]=Ee[et]=Ee[nt]=Ee[rt]=Ee[it]=Ee[vt]=Ee[gt]=Ee[yt]=Ee[mt]=!0,Ee[X]=Ee[W]=Ee[st]=!1;var Ue={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Re=parseFloat,Te=parseInt,qe="object"==typeof t&&t&&t.Object===Object&&t,Pe="object"==typeof self&&self&&self.Object===Object&&self,ze=qe||Pe||Function("return this")(),De=e&&!e.nodeType&&e,Me=De&&"object"==typeof r&&r&&!r.nodeType&&r,je=Me&&Me.exports===De,ke=je&&qe.process,Fe=function(){try{var t=Me&&Me.require&&Me.require("util").types;return t||ke&&ke.binding&&ke.binding("util")}catch(t){}}(),Le=Fe&&Fe.isArrayBuffer,Ne=Fe&&Fe.isDate,Ie=Fe&&Fe.isMap,$e=Fe&&Fe.isRegExp,Be=Fe&&Fe.isSet,He=Fe&&Fe.isTypedArray;function Ye(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function Ze(t,e,n,r){for(var i=-1,o=null==t?0:t.length;++i-1}function Ve(t,e,n){for(var r=-1,i=null==t?0:t.length;++r-1;);return n}function _n(t,e){for(var n=t.length;n--&&an(e,t[n],0)>-1;);return n}var xn=hn({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),Sn=hn({"&":"&","<":"<",">":">",'"':""","'":"'"});function An(t){return"\\"+Ue[t]}function On(t){return xe.test(t)}function Cn(t){var e=-1,n=Array(t.size);return t.forEach(function(t,r){n[++e]=[r,t]}),n}function En(t,e){return function(n){return t(e(n))}}function Un(t,e){for(var n=-1,r=t.length,i=0,o=[];++n",""":'"',"'":"'"});var Dn=function t(e){var n,r=(e=null==e?ze:Dn.defaults(ze.Object(),e,Dn.pick(ze,Ae))).Array,i=e.Date,Vt=e.Error,Kt=e.Function,te=e.Math,ee=e.Object,ne=e.RegExp,re=e.String,ie=e.TypeError,oe=r.prototype,se=Kt.prototype,ue=ee.prototype,ae=e["__core-js_shared__"],ce=se.toString,le=ue.hasOwnProperty,fe=0,pe=(n=/[^.]+$/.exec(ae&&ae.keys&&ae.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",he=ue.toString,de=ce.call(ee),ve=ze._,ge=ne("^"+ce.call(le).replace(Pt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ye=je?e.Buffer:o,we=e.Symbol,xe=e.Uint8Array,Ue=ye?ye.allocUnsafe:o,qe=En(ee.getPrototypeOf,ee),Pe=ee.create,De=ue.propertyIsEnumerable,Me=oe.splice,ke=we?we.isConcatSpreadable:o,Fe=we?we.iterator:o,on=we?we.toStringTag:o,hn=function(){try{var t=Lo(ee,"defineProperty");return t({},"",{}),t}catch(t){}}(),Mn=e.clearTimeout!==ze.clearTimeout&&e.clearTimeout,jn=i&&i.now!==ze.Date.now&&i.now,kn=e.setTimeout!==ze.setTimeout&&e.setTimeout,Fn=te.ceil,Ln=te.floor,Nn=ee.getOwnPropertySymbols,In=ye?ye.isBuffer:o,$n=e.isFinite,Bn=oe.join,Hn=En(ee.keys,ee),Yn=te.max,Zn=te.min,Xn=i.now,Wn=e.parseInt,Jn=te.random,Gn=oe.reverse,Qn=Lo(e,"DataView"),Vn=Lo(e,"Map"),Kn=Lo(e,"Promise"),tr=Lo(e,"Set"),er=Lo(e,"WeakMap"),nr=Lo(ee,"create"),rr=er&&new er,ir={},or=fs(Qn),sr=fs(Vn),ur=fs(Kn),ar=fs(tr),cr=fs(er),lr=we?we.prototype:o,fr=lr?lr.valueOf:o,pr=lr?lr.toString:o;function hr(t){if(Uu(t)&&!yu(t)&&!(t instanceof yr)){if(t instanceof gr)return t;if(le.call(t,"__wrapped__"))return ps(t)}return new gr(t)}var dr=function(){function t(){}return function(e){if(!Eu(e))return{};if(Pe)return Pe(e);t.prototype=e;var n=new t;return t.prototype=o,n}}();function vr(){}function gr(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=o}function yr(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=k,this.__views__=[]}function mr(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e=e?t:e)),t}function Mr(t,e,n,r,i,s){var u,a=e&p,c=e&h,l=e&d;if(n&&(u=i?n(t,r,i,s):n(t)),u!==o)return u;if(!Eu(t))return t;var f=yu(t);if(f){if(u=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&le.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(t),!a)return no(t,u)}else{var v=$o(t),g=v==W||v==J;if(_u(t))return Gi(t,a);if(v==K||v==I||g&&!i){if(u=c||g?{}:Ho(t),!a)return c?function(t,e){return ro(t,Io(t),e)}(t,function(t,e){return t&&ro(e,oa(e),t)}(u,t)):function(t,e){return ro(t,No(t),e)}(t,qr(u,t))}else{if(!Ee[v])return i?t:{};u=function(t,e,n){var r,i,o,s=t.constructor;switch(e){case at:return Qi(t);case H:case Y:return new s(+t);case ct:return function(t,e){var n=e?Qi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case lt:case ft:case pt:case ht:case dt:case vt:case gt:case yt:case mt:return Vi(t,n);case G:return new s;case Q:case rt:return new s(t);case et:return(o=new(i=t).constructor(i.source,Bt.exec(i))).lastIndex=i.lastIndex,o;case nt:return new s;case it:return r=t,fr?ee(fr.call(r)):{}}}(t,v,a)}}s||(s=new xr);var y=s.get(t);if(y)return y;if(s.set(t,u),zu(t))return t.forEach(function(r){u.add(Mr(r,e,n,r,t,s))}),u;if(Ru(t))return t.forEach(function(r,i){u.set(i,Mr(r,e,n,i,t,s))}),u;var m=f?o:(l?c?Po:qo:c?oa:ia)(t);return Xe(m||t,function(r,i){m&&(r=t[i=r]),Ur(u,i,Mr(r,e,n,i,t,s))}),u}function jr(t,e,n){var r=n.length;if(null==t)return!r;for(t=ee(t);r--;){var i=n[r],s=e[i],u=t[i];if(u===o&&!(i in t)||!s(u))return!1}return!0}function kr(t,e,n){if("function"!=typeof t)throw new ie(a);return is(function(){t.apply(o,n)},e)}function Fr(t,e,n,r){var i=-1,o=Qe,u=!0,a=t.length,c=[],l=e.length;if(!a)return c;n&&(e=Ke(e,yn(n))),r?(o=Ve,u=!1):e.length>=s&&(o=bn,u=!1,e=new _r(e));t:for(;++i-1},br.prototype.set=function(t,e){var n=this.__data__,r=Rr(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},wr.prototype.clear=function(){this.size=0,this.__data__={hash:new mr,map:new(Vn||br),string:new mr}},wr.prototype.delete=function(t){var e=ko(this,t).delete(t);return this.size-=e?1:0,e},wr.prototype.get=function(t){return ko(this,t).get(t)},wr.prototype.has=function(t){return ko(this,t).has(t)},wr.prototype.set=function(t,e){var n=ko(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},_r.prototype.add=_r.prototype.push=function(t){return this.__data__.set(t,c),this},_r.prototype.has=function(t){return this.__data__.has(t)},xr.prototype.clear=function(){this.__data__=new br,this.size=0},xr.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},xr.prototype.get=function(t){return this.__data__.get(t)},xr.prototype.has=function(t){return this.__data__.has(t)},xr.prototype.set=function(t,e){var n=this.__data__;if(n instanceof br){var r=n.__data__;if(!Vn||r.length0&&n(u)?e>1?Hr(u,e-1,n,r,i):tn(i,u):r||(i[i.length]=u)}return i}var Yr=uo(),Zr=uo(!0);function Xr(t,e){return t&&Yr(t,e,ia)}function Wr(t,e){return t&&Zr(t,e,ia)}function Jr(t,e){return Ge(e,function(e){return Au(t[e])})}function Gr(t,e){for(var n=0,r=(e=Zi(e,t)).length;null!=t&&ne}function ti(t,e){return null!=t&&le.call(t,e)}function ei(t,e){return null!=t&&e in ee(t)}function ni(t,e,n){for(var i=n?Ve:Qe,s=t[0].length,u=t.length,a=u,c=r(u),l=1/0,f=[];a--;){var p=t[a];a&&e&&(p=Ke(p,yn(e))),l=Zn(p.length,l),c[a]=!n&&(e||s>=120&&p.length>=120)?new _r(a&&p):o}p=t[0];var h=-1,d=c[0];t:for(;++h=u)return a;var c=n[r];return a*("desc"==c?-1:1)}}return t.index-e.index}(t,e,n)})}function mi(t,e,n){for(var r=-1,i=e.length,o={};++r-1;)u!==t&&Me.call(u,a,1),Me.call(t,a,1);return t}function wi(t,e){for(var n=t?e.length:0,r=n-1;n--;){var i=e[n];if(n==r||i!==o){var o=i;Zo(i)?Me.call(t,i,1):Fi(t,i)}}return t}function _i(t,e){return t+Ln(Jn()*(e-t+1))}function xi(t,e){var n="";if(!t||e<1||e>D)return n;do{e%2&&(n+=t),(e=Ln(e/2))&&(t+=t)}while(e);return n}function Si(t,e){return os(ts(t,e,Ta),t+"")}function Ai(t){return Ar(ha(t))}function Oi(t,e){var n=ha(t);return as(n,Dr(e,0,n.length))}function Ci(t,e,n,r){if(!Eu(t))return t;for(var i=-1,s=(e=Zi(e,t)).length,u=s-1,a=t;null!=a&&++io?0:o+e),(n=n>o?o:n)<0&&(n+=o),o=e>n?0:n-e>>>0,e>>>=0;for(var s=r(o);++i>>1,s=t[o];null!==s&&!Mu(s)&&(n?s<=e:s=s){var l=e?null:So(t);if(l)return Rn(l);u=!1,i=bn,c=new _r}else c=e?[]:a;t:for(;++r=r?t:Ti(t,e,n)}var Ji=Mn||function(t){return ze.clearTimeout(t)};function Gi(t,e){if(e)return t.slice();var n=t.length,r=Ue?Ue(n):new t.constructor(n);return t.copy(r),r}function Qi(t){var e=new t.constructor(t.byteLength);return new xe(e).set(new xe(t)),e}function Vi(t,e){var n=e?Qi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function Ki(t,e){if(t!==e){var n=t!==o,r=null===t,i=t==t,s=Mu(t),u=e!==o,a=null===e,c=e==e,l=Mu(e);if(!a&&!l&&!s&&t>e||s&&u&&c&&!a&&!l||r&&u&&c||!n&&c||!i)return 1;if(!r&&!s&&!l&&t1?n[i-1]:o,u=i>2?n[2]:o;for(s=t.length>3&&"function"==typeof s?(i--,s):o,u&&Xo(n[0],n[1],u)&&(s=i<3?o:s,i=1),e=ee(e);++r-1?i[s?e[u]:u]:o}}function po(t){return To(function(e){var n=e.length,r=n,i=gr.prototype.thru;for(t&&e.reverse();r--;){var s=e[r];if("function"!=typeof s)throw new ie(a);if(i&&!u&&"wrapper"==Do(s))var u=new gr([],!0)}for(r=u?r:n;++r1&&w.reverse(),p&&la))return!1;var l=s.get(t);if(l&&s.get(e))return l==e;var f=-1,p=!0,h=n&g?new _r:o;for(s.set(t,e),s.set(e,t);++f-1&&t%1==0&&t1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(kt,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return Xe(N,function(n){var r="_."+n[0];e&n[1]&&!Qe(t,r)&&t.push(r)}),t.sort()}(function(t){var e=t.match(Ft);return e?e[1].split(Lt):[]}(r),n)))}function us(t){var e=0,n=0;return function(){var r=Xn(),i=T-(r-n);if(n=r,i>0){if(++e>=R)return arguments[0]}else e=0;return t.apply(o,arguments)}}function as(t,e){var n=-1,r=t.length,i=r-1;for(e=e===o?r:e;++n1?t[e-1]:o;return n="function"==typeof n?(t.pop(),n):o,Ps(t,n)});function Ls(t){var e=hr(t);return e.__chain__=!0,e}function Ns(t,e){return e(t)}var Is=To(function(t){var e=t.length,n=e?t[0]:0,r=this.__wrapped__,i=function(e){return zr(e,t)};return!(e>1||this.__actions__.length)&&r instanceof yr&&Zo(n)?((r=r.slice(n,+n+(e?1:0))).__actions__.push({func:Ns,args:[i],thisArg:o}),new gr(r,this.__chain__).thru(function(t){return e&&!t.length&&t.push(o),t})):this.thru(i)});var $s=io(function(t,e,n){le.call(t,n)?++t[n]:Pr(t,n,1)});var Bs=fo(gs),Hs=fo(ys);function Ys(t,e){return(yu(t)?Xe:Lr)(t,jo(e,3))}function Zs(t,e){return(yu(t)?We:Nr)(t,jo(e,3))}var Xs=io(function(t,e,n){le.call(t,n)?t[n].push(e):Pr(t,n,[e])});var Ws=Si(function(t,e,n){var i=-1,o="function"==typeof e,s=bu(t)?r(t.length):[];return Lr(t,function(t){s[++i]=o?Ye(e,t,n):ri(t,e,n)}),s}),Js=io(function(t,e,n){Pr(t,n,e)});function Gs(t,e){return(yu(t)?Ke:pi)(t,jo(e,3))}var Qs=io(function(t,e,n){t[n?0:1].push(e)},function(){return[[],[]]});var Vs=Si(function(t,e){if(null==t)return[];var n=e.length;return n>1&&Xo(t,e[0],e[1])?e=[]:n>2&&Xo(e[0],e[1],e[2])&&(e=[e[0]]),yi(t,Hr(e,1),[])}),Ks=jn||function(){return ze.Date.now()};function tu(t,e,n){return e=n?o:e,e=t&&null==e?t.length:e,Oo(t,A,o,o,o,o,e)}function eu(t,e){var n;if("function"!=typeof e)throw new ie(a);return t=Iu(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=o),n}}var nu=Si(function(t,e,n){var r=y;if(n.length){var i=Un(n,Mo(nu));r|=x}return Oo(t,r,e,n,i)}),ru=Si(function(t,e,n){var r=y|m;if(n.length){var i=Un(n,Mo(ru));r|=x}return Oo(e,r,t,n,i)});function iu(t,e,n){var r,i,s,u,c,l,f=0,p=!1,h=!1,d=!0;if("function"!=typeof t)throw new ie(a);function v(e){var n=r,s=i;return r=i=o,f=e,u=t.apply(s,n)}function g(t){var n=t-l;return l===o||n>=e||n<0||h&&t-f>=s}function y(){var t=Ks();if(g(t))return m(t);c=is(y,function(t){var n=e-(t-l);return h?Zn(n,s-(t-f)):n}(t))}function m(t){return c=o,d&&r?v(t):(r=i=o,u)}function b(){var t=Ks(),n=g(t);if(r=arguments,i=this,l=t,n){if(c===o)return function(t){return f=t,c=is(y,e),p?v(t):u}(l);if(h)return c=is(y,e),v(l)}return c===o&&(c=is(y,e)),u}return e=Bu(e)||0,Eu(n)&&(p=!!n.leading,s=(h="maxWait"in n)?Yn(Bu(n.maxWait)||0,e):s,d="trailing"in n?!!n.trailing:d),b.cancel=function(){c!==o&&Ji(c),f=0,r=l=i=c=o},b.flush=function(){return c===o?u:m(Ks())},b}var ou=Si(function(t,e){return kr(t,1,e)}),su=Si(function(t,e,n){return kr(t,Bu(e)||0,n)});function uu(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new ie(a);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=t.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(uu.Cache||wr),n}function au(t){if("function"!=typeof t)throw new ie(a);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}uu.Cache=wr;var cu=Xi(function(t,e){var n=(e=1==e.length&&yu(e[0])?Ke(e[0],yn(jo())):Ke(Hr(e,1),yn(jo()))).length;return Si(function(r){for(var i=-1,o=Zn(r.length,n);++i=e}),gu=ii(function(){return arguments}())?ii:function(t){return Uu(t)&&le.call(t,"callee")&&!De.call(t,"callee")},yu=r.isArray,mu=Le?yn(Le):function(t){return Uu(t)&&Vr(t)==at};function bu(t){return null!=t&&Cu(t.length)&&!Au(t)}function wu(t){return Uu(t)&&bu(t)}var _u=In||Ba,xu=Ne?yn(Ne):function(t){return Uu(t)&&Vr(t)==Y};function Su(t){if(!Uu(t))return!1;var e=Vr(t);return e==X||e==Z||"string"==typeof t.message&&"string"==typeof t.name&&!qu(t)}function Au(t){if(!Eu(t))return!1;var e=Vr(t);return e==W||e==J||e==B||e==tt}function Ou(t){return"number"==typeof t&&t==Iu(t)}function Cu(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=D}function Eu(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Uu(t){return null!=t&&"object"==typeof t}var Ru=Ie?yn(Ie):function(t){return Uu(t)&&$o(t)==G};function Tu(t){return"number"==typeof t||Uu(t)&&Vr(t)==Q}function qu(t){if(!Uu(t)||Vr(t)!=K)return!1;var e=qe(t);if(null===e)return!0;var n=le.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&ce.call(n)==de}var Pu=$e?yn($e):function(t){return Uu(t)&&Vr(t)==et};var zu=Be?yn(Be):function(t){return Uu(t)&&$o(t)==nt};function Du(t){return"string"==typeof t||!yu(t)&&Uu(t)&&Vr(t)==rt}function Mu(t){return"symbol"==typeof t||Uu(t)&&Vr(t)==it}var ju=He?yn(He):function(t){return Uu(t)&&Cu(t.length)&&!!Ce[Vr(t)]};var ku=wo(fi),Fu=wo(function(t,e){return t<=e});function Lu(t){if(!t)return[];if(bu(t))return Du(t)?Pn(t):no(t);if(Fe&&t[Fe])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[Fe]());var e=$o(t);return(e==G?Cn:e==nt?Rn:ha)(t)}function Nu(t){return t?(t=Bu(t))===z||t===-z?(t<0?-1:1)*M:t==t?t:0:0===t?t:0}function Iu(t){var e=Nu(t),n=e%1;return e==e?n?e-n:e:0}function $u(t){return t?Dr(Iu(t),0,k):0}function Bu(t){if("number"==typeof t)return t;if(Mu(t))return j;if(Eu(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Eu(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(Dt,"");var n=Yt.test(t);return n||Xt.test(t)?Te(t.slice(2),n?2:8):Ht.test(t)?j:+t}function Hu(t){return ro(t,oa(t))}function Yu(t){return null==t?"":ji(t)}var Zu=oo(function(t,e){if(Qo(e)||bu(e))ro(e,ia(e),t);else for(var n in e)le.call(e,n)&&Ur(t,n,e[n])}),Xu=oo(function(t,e){ro(e,oa(e),t)}),Wu=oo(function(t,e,n,r){ro(e,oa(e),t,r)}),Ju=oo(function(t,e,n,r){ro(e,ia(e),t,r)}),Gu=To(zr);var Qu=Si(function(t,e){t=ee(t);var n=-1,r=e.length,i=r>2?e[2]:o;for(i&&Xo(e[0],e[1],i)&&(r=1);++n1),e}),ro(t,Po(t),n),r&&(n=Mr(n,p|h|d,Uo));for(var i=e.length;i--;)Fi(n,e[i]);return n});var ca=To(function(t,e){return null==t?{}:function(t,e){return mi(t,e,function(e,n){return ta(t,n)})}(t,e)});function la(t,e){if(null==t)return{};var n=Ke(Po(t),function(t){return[t]});return e=jo(e),mi(t,n,function(t,n){return e(t,n[0])})}var fa=Ao(ia),pa=Ao(oa);function ha(t){return null==t?[]:mn(t,ia(t))}var da=co(function(t,e,n){return e=e.toLowerCase(),t+(n?va(e):e)});function va(t){return Sa(Yu(t).toLowerCase())}function ga(t){return(t=Yu(t))&&t.replace(Jt,xn).replace(be,"")}var ya=co(function(t,e,n){return t+(n?"-":"")+e.toLowerCase()}),ma=co(function(t,e,n){return t+(n?" ":"")+e.toLowerCase()}),ba=ao("toLowerCase");var wa=co(function(t,e,n){return t+(n?"_":"")+e.toLowerCase()});var _a=co(function(t,e,n){return t+(n?" ":"")+Sa(e)});var xa=co(function(t,e,n){return t+(n?" ":"")+e.toUpperCase()}),Sa=ao("toUpperCase");function Aa(t,e,n){return t=Yu(t),(e=n?o:e)===o?function(t){return Se.test(t)}(t)?function(t){return t.match(_e)||[]}(t):function(t){return t.match(Nt)||[]}(t):t.match(e)||[]}var Oa=Si(function(t,e){try{return Ye(t,o,e)}catch(t){return Su(t)?t:new Vt(t)}}),Ca=To(function(t,e){return Xe(e,function(e){e=ls(e),Pr(t,e,nu(t[e],t))}),t});function Ea(t){return function(){return t}}var Ua=po(),Ra=po(!0);function Ta(t){return t}function qa(t){return ai("function"==typeof t?t:Mr(t,p))}var Pa=Si(function(t,e){return function(n){return ri(n,t,e)}}),za=Si(function(t,e){return function(n){return ri(t,n,e)}});function Da(t,e,n){var r=ia(e),i=Jr(e,r);null!=n||Eu(e)&&(i.length||!r.length)||(n=e,e=t,t=this,i=Jr(e,ia(e)));var o=!(Eu(n)&&"chain"in n&&!n.chain),s=Au(t);return Xe(i,function(n){var r=e[n];t[n]=r,s&&(t.prototype[n]=function(){var e=this.__chain__;if(o||e){var n=t(this.__wrapped__);return(n.__actions__=no(this.__actions__)).push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,tn([this.value()],arguments))})}),t}function Ma(){}var ja=yo(Ke),ka=yo(Je),Fa=yo(rn);function La(t){return Wo(t)?pn(ls(t)):function(t){return function(e){return Gr(e,t)}}(t)}var Na=bo(),Ia=bo(!0);function $a(){return[]}function Ba(){return!1}var Ha=go(function(t,e){return t+e},0),Ya=xo("ceil"),Za=go(function(t,e){return t/e},1),Xa=xo("floor");var Wa,Ja=go(function(t,e){return t*e},1),Ga=xo("round"),Qa=go(function(t,e){return t-e},0);return hr.after=function(t,e){if("function"!=typeof e)throw new ie(a);return t=Iu(t),function(){if(--t<1)return e.apply(this,arguments)}},hr.ary=tu,hr.assign=Zu,hr.assignIn=Xu,hr.assignInWith=Wu,hr.assignWith=Ju,hr.at=Gu,hr.before=eu,hr.bind=nu,hr.bindAll=Ca,hr.bindKey=ru,hr.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return yu(t)?t:[t]},hr.chain=Ls,hr.chunk=function(t,e,n){e=(n?Xo(t,e,n):e===o)?1:Yn(Iu(e),0);var i=null==t?0:t.length;if(!i||e<1)return[];for(var s=0,u=0,a=r(Fn(i/e));si?0:i+n),(r=r===o||r>i?i:Iu(r))<0&&(r+=i),r=n>r?0:$u(r);n>>0)?(t=Yu(t))&&("string"==typeof e||null!=e&&!Pu(e))&&!(e=ji(e))&&On(t)?Wi(Pn(t),0,n):t.split(e,n):[]},hr.spread=function(t,e){if("function"!=typeof t)throw new ie(a);return e=null==e?0:Yn(Iu(e),0),Si(function(n){var r=n[e],i=Wi(n,0,e);return r&&tn(i,r),Ye(t,this,i)})},hr.tail=function(t){var e=null==t?0:t.length;return e?Ti(t,1,e):[]},hr.take=function(t,e,n){return t&&t.length?Ti(t,0,(e=n||e===o?1:Iu(e))<0?0:e):[]},hr.takeRight=function(t,e,n){var r=null==t?0:t.length;return r?Ti(t,(e=r-(e=n||e===o?1:Iu(e)))<0?0:e,r):[]},hr.takeRightWhile=function(t,e){return t&&t.length?Ni(t,jo(e,3),!1,!0):[]},hr.takeWhile=function(t,e){return t&&t.length?Ni(t,jo(e,3)):[]},hr.tap=function(t,e){return e(t),t},hr.throttle=function(t,e,n){var r=!0,i=!0;if("function"!=typeof t)throw new ie(a);return Eu(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),iu(t,e,{leading:r,maxWait:e,trailing:i})},hr.thru=Ns,hr.toArray=Lu,hr.toPairs=fa,hr.toPairsIn=pa,hr.toPath=function(t){return yu(t)?Ke(t,ls):Mu(t)?[t]:no(cs(Yu(t)))},hr.toPlainObject=Hu,hr.transform=function(t,e,n){var r=yu(t),i=r||_u(t)||ju(t);if(e=jo(e,4),null==n){var o=t&&t.constructor;n=i?r?new o:[]:Eu(t)&&Au(o)?dr(qe(t)):{}}return(i?Xe:Xr)(t,function(t,r,i){return e(n,t,r,i)}),n},hr.unary=function(t){return tu(t,1)},hr.union=Us,hr.unionBy=Rs,hr.unionWith=Ts,hr.uniq=function(t){return t&&t.length?ki(t):[]},hr.uniqBy=function(t,e){return t&&t.length?ki(t,jo(e,2)):[]},hr.uniqWith=function(t,e){return e="function"==typeof e?e:o,t&&t.length?ki(t,o,e):[]},hr.unset=function(t,e){return null==t||Fi(t,e)},hr.unzip=qs,hr.unzipWith=Ps,hr.update=function(t,e,n){return null==t?t:Li(t,e,Yi(n))},hr.updateWith=function(t,e,n,r){return r="function"==typeof r?r:o,null==t?t:Li(t,e,Yi(n),r)},hr.values=ha,hr.valuesIn=function(t){return null==t?[]:mn(t,oa(t))},hr.without=zs,hr.words=Aa,hr.wrap=function(t,e){return lu(Yi(e),t)},hr.xor=Ds,hr.xorBy=Ms,hr.xorWith=js,hr.zip=ks,hr.zipObject=function(t,e){return Bi(t||[],e||[],Ur)},hr.zipObjectDeep=function(t,e){return Bi(t||[],e||[],Ci)},hr.zipWith=Fs,hr.entries=fa,hr.entriesIn=pa,hr.extend=Xu,hr.extendWith=Wu,Da(hr,hr),hr.add=Ha,hr.attempt=Oa,hr.camelCase=da,hr.capitalize=va,hr.ceil=Ya,hr.clamp=function(t,e,n){return n===o&&(n=e,e=o),n!==o&&(n=(n=Bu(n))==n?n:0),e!==o&&(e=(e=Bu(e))==e?e:0),Dr(Bu(t),e,n)},hr.clone=function(t){return Mr(t,d)},hr.cloneDeep=function(t){return Mr(t,p|d)},hr.cloneDeepWith=function(t,e){return Mr(t,p|d,e="function"==typeof e?e:o)},hr.cloneWith=function(t,e){return Mr(t,d,e="function"==typeof e?e:o)},hr.conformsTo=function(t,e){return null==e||jr(t,e,ia(e))},hr.deburr=ga,hr.defaultTo=function(t,e){return null==t||t!=t?e:t},hr.divide=Za,hr.endsWith=function(t,e,n){t=Yu(t),e=ji(e);var r=t.length,i=n=n===o?r:Dr(Iu(n),0,r);return(n-=e.length)>=0&&t.slice(n,i)==e},hr.eq=hu,hr.escape=function(t){return(t=Yu(t))&&Ot.test(t)?t.replace(St,Sn):t},hr.escapeRegExp=function(t){return(t=Yu(t))&&zt.test(t)?t.replace(Pt,"\\$&"):t},hr.every=function(t,e,n){var r=yu(t)?Je:Ir;return n&&Xo(t,e,n)&&(e=o),r(t,jo(e,3))},hr.find=Bs,hr.findIndex=gs,hr.findKey=function(t,e){return sn(t,jo(e,3),Xr)},hr.findLast=Hs,hr.findLastIndex=ys,hr.findLastKey=function(t,e){return sn(t,jo(e,3),Wr)},hr.floor=Xa,hr.forEach=Ys,hr.forEachRight=Zs,hr.forIn=function(t,e){return null==t?t:Yr(t,jo(e,3),oa)},hr.forInRight=function(t,e){return null==t?t:Zr(t,jo(e,3),oa)},hr.forOwn=function(t,e){return t&&Xr(t,jo(e,3))},hr.forOwnRight=function(t,e){return t&&Wr(t,jo(e,3))},hr.get=Ku,hr.gt=du,hr.gte=vu,hr.has=function(t,e){return null!=t&&Bo(t,e,ti)},hr.hasIn=ta,hr.head=bs,hr.identity=Ta,hr.includes=function(t,e,n,r){t=bu(t)?t:ha(t),n=n&&!r?Iu(n):0;var i=t.length;return n<0&&(n=Yn(i+n,0)),Du(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&an(t,e,n)>-1},hr.indexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:Iu(n);return i<0&&(i=Yn(r+i,0)),an(t,e,i)},hr.inRange=function(t,e,n){return e=Nu(e),n===o?(n=e,e=0):n=Nu(n),function(t,e,n){return t>=Zn(e,n)&&t=-D&&t<=D},hr.isSet=zu,hr.isString=Du,hr.isSymbol=Mu,hr.isTypedArray=ju,hr.isUndefined=function(t){return t===o},hr.isWeakMap=function(t){return Uu(t)&&$o(t)==st},hr.isWeakSet=function(t){return Uu(t)&&Vr(t)==ut},hr.join=function(t,e){return null==t?"":Bn.call(t,e)},hr.kebabCase=ya,hr.last=Ss,hr.lastIndexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=r;return n!==o&&(i=(i=Iu(n))<0?Yn(r+i,0):Zn(i,r-1)),e==e?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(t,e,i):un(t,ln,i,!0)},hr.lowerCase=ma,hr.lowerFirst=ba,hr.lt=ku,hr.lte=Fu,hr.max=function(t){return t&&t.length?$r(t,Ta,Kr):o},hr.maxBy=function(t,e){return t&&t.length?$r(t,jo(e,2),Kr):o},hr.mean=function(t){return fn(t,Ta)},hr.meanBy=function(t,e){return fn(t,jo(e,2))},hr.min=function(t){return t&&t.length?$r(t,Ta,fi):o},hr.minBy=function(t,e){return t&&t.length?$r(t,jo(e,2),fi):o},hr.stubArray=$a,hr.stubFalse=Ba,hr.stubObject=function(){return{}},hr.stubString=function(){return""},hr.stubTrue=function(){return!0},hr.multiply=Ja,hr.nth=function(t,e){return t&&t.length?gi(t,Iu(e)):o},hr.noConflict=function(){return ze._===this&&(ze._=ve),this},hr.noop=Ma,hr.now=Ks,hr.pad=function(t,e,n){t=Yu(t);var r=(e=Iu(e))?qn(t):0;if(!e||r>=e)return t;var i=(e-r)/2;return mo(Ln(i),n)+t+mo(Fn(i),n)},hr.padEnd=function(t,e,n){t=Yu(t);var r=(e=Iu(e))?qn(t):0;return e&&re){var r=t;t=e,e=r}if(n||t%1||e%1){var i=Jn();return Zn(t+i*(e-t+Re("1e-"+((i+"").length-1))),e)}return _i(t,e)},hr.reduce=function(t,e,n){var r=yu(t)?en:dn,i=arguments.length<3;return r(t,jo(e,4),n,i,Lr)},hr.reduceRight=function(t,e,n){var r=yu(t)?nn:dn,i=arguments.length<3;return r(t,jo(e,4),n,i,Nr)},hr.repeat=function(t,e,n){return e=(n?Xo(t,e,n):e===o)?1:Iu(e),xi(Yu(t),e)},hr.replace=function(){var t=arguments,e=Yu(t[0]);return t.length<3?e:e.replace(t[1],t[2])},hr.result=function(t,e,n){var r=-1,i=(e=Zi(e,t)).length;for(i||(i=1,t=o);++rD)return[];var n=k,r=Zn(t,k);e=jo(e),t-=k;for(var i=gn(r,e);++n=s)return t;var a=n-qn(r);if(a<1)return r;var c=u?Wi(u,0,a).join(""):t.slice(0,a);if(i===o)return c+r;if(u&&(a+=c.length-a),Pu(i)){if(t.slice(a).search(i)){var l,f=c;for(i.global||(i=ne(i.source,Yu(Bt.exec(i))+"g")),i.lastIndex=0;l=i.exec(f);)var p=l.index;c=c.slice(0,p===o?a:p)}}else if(t.indexOf(ji(i),a)!=a){var h=c.lastIndexOf(i);h>-1&&(c=c.slice(0,h))}return c+r},hr.unescape=function(t){return(t=Yu(t))&&At.test(t)?t.replace(xt,zn):t},hr.uniqueId=function(t){var e=++fe;return Yu(t)+e},hr.upperCase=xa,hr.upperFirst=Sa,hr.each=Ys,hr.eachRight=Zs,hr.first=bs,Da(hr,(Wa={},Xr(hr,function(t,e){le.call(hr.prototype,e)||(Wa[e]=t)}),Wa),{chain:!1}),hr.VERSION="4.17.11",Xe(["bind","bindKey","curry","curryRight","partial","partialRight"],function(t){hr[t].placeholder=hr}),Xe(["drop","take"],function(t,e){yr.prototype[t]=function(n){n=n===o?1:Yn(Iu(n),0);var r=this.__filtered__&&!e?new yr(this):this.clone();return r.__filtered__?r.__takeCount__=Zn(n,r.__takeCount__):r.__views__.push({size:Zn(n,k),type:t+(r.__dir__<0?"Right":"")}),r},yr.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}}),Xe(["filter","map","takeWhile"],function(t,e){var n=e+1,r=n==q||3==n;yr.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:jo(t,3),type:n}),e.__filtered__=e.__filtered__||r,e}}),Xe(["head","last"],function(t,e){var n="take"+(e?"Right":"");yr.prototype[t]=function(){return this[n](1).value()[0]}}),Xe(["initial","tail"],function(t,e){var n="drop"+(e?"":"Right");yr.prototype[t]=function(){return this.__filtered__?new yr(this):this[n](1)}}),yr.prototype.compact=function(){return this.filter(Ta)},yr.prototype.find=function(t){return this.filter(t).head()},yr.prototype.findLast=function(t){return this.reverse().find(t)},yr.prototype.invokeMap=Si(function(t,e){return"function"==typeof t?new yr(this):this.map(function(n){return ri(n,t,e)})}),yr.prototype.reject=function(t){return this.filter(au(jo(t)))},yr.prototype.slice=function(t,e){t=Iu(t);var n=this;return n.__filtered__&&(t>0||e<0)?new yr(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==o&&(n=(e=Iu(e))<0?n.dropRight(-e):n.take(e-t)),n)},yr.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},yr.prototype.toArray=function(){return this.take(k)},Xr(yr.prototype,function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),i=hr[r?"take"+("last"==e?"Right":""):e],s=r||/^find/.test(e);i&&(hr.prototype[e]=function(){var e=this.__wrapped__,u=r?[1]:arguments,a=e instanceof yr,c=u[0],l=a||yu(e),f=function(t){var e=i.apply(hr,tn([t],u));return r&&p?e[0]:e};l&&n&&"function"==typeof c&&1!=c.length&&(a=l=!1);var p=this.__chain__,h=!!this.__actions__.length,d=s&&!p,v=a&&!h;if(!s&&l){e=v?e:new yr(this);var g=t.apply(e,u);return g.__actions__.push({func:Ns,args:[f],thisArg:o}),new gr(g,p)}return d&&v?t.apply(this,u):(g=this.thru(f),d?r?g.value()[0]:g.value():g)})}),Xe(["pop","push","shift","sort","splice","unshift"],function(t){var e=oe[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);hr.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var i=this.value();return e.apply(yu(i)?i:[],t)}return this[n](function(n){return e.apply(yu(n)?n:[],t)})}}),Xr(yr.prototype,function(t,e){var n=hr[e];if(n){var r=n.name+"";(ir[r]||(ir[r]=[])).push({name:e,func:n})}}),ir[ho(o,m).name]=[{name:"wrapper",func:o}],yr.prototype.clone=function(){var t=new yr(this.__wrapped__);return t.__actions__=no(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=no(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=no(this.__views__),t},yr.prototype.reverse=function(){if(this.__filtered__){var t=new yr(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},yr.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=yu(t),r=e<0,i=n?t.length:0,o=function(t,e,n){for(var r=-1,i=n.length;++r=this.__values__.length;return{done:t,value:t?o:this.__values__[this.__index__++]}},hr.prototype.plant=function(t){for(var e,n=this;n instanceof vr;){var r=ps(n);r.__index__=0,r.__values__=o,e?i.__wrapped__=r:e=r;var i=r;n=n.__wrapped__}return i.__wrapped__=t,e},hr.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof yr){var e=t;return this.__actions__.length&&(e=new yr(this)),(e=e.reverse()).__actions__.push({func:Ns,args:[Es],thisArg:o}),new gr(e,this.__chain__)}return this.thru(Es)},hr.prototype.toJSON=hr.prototype.valueOf=hr.prototype.value=function(){return Ii(this.__wrapped__,this.__actions__)},hr.prototype.first=hr.prototype.head,Fe&&(hr.prototype[Fe]=function(){return this}),hr}();ze._=Dn,(i=function(){return Dn}.call(e,n,e,r))===o||(r.exports=i)}).call(this)}).call(this,n(3),n(20)(t))},function(t,e,n){var r=n(135);t.exports={Graph:r.Graph,json:n(261),alg:n(262),version:r.version}},function(t,e,n){t.exports={Graph:n(42),version:n(260)}},function(t,e,n){var r=n(137),i=4;t.exports=function(t){return r(t,i)}},function(t,e,n){var r=n(43),i=n(47),o=n(68),s=n(166),u=n(172),a=n(175),c=n(176),l=n(177),f=n(178),p=n(78),h=n(179),d=n(15),v=n(183),g=n(184),y=n(189),m=n(0),b=n(21),w=n(190),_=n(10),x=n(192),S=n(11),A=1,O=2,C=4,E="[object Arguments]",U="[object Function]",R="[object GeneratorFunction]",T="[object Object]",q={};q[E]=q["[object Array]"]=q["[object ArrayBuffer]"]=q["[object DataView]"]=q["[object Boolean]"]=q["[object Date]"]=q["[object Float32Array]"]=q["[object Float64Array]"]=q["[object Int8Array]"]=q["[object Int16Array]"]=q["[object Int32Array]"]=q["[object Map]"]=q["[object Number]"]=q[T]=q["[object RegExp]"]=q["[object Set]"]=q["[object String]"]=q["[object Symbol]"]=q["[object Uint8Array]"]=q["[object Uint8ClampedArray]"]=q["[object Uint16Array]"]=q["[object Uint32Array]"]=!0,q["[object Error]"]=q[U]=q["[object WeakMap]"]=!1,t.exports=function t(e,n,P,z,D,M){var j,k=n&A,F=n&O,L=n&C;if(P&&(j=D?P(e,z,D,M):P(e)),void 0!==j)return j;if(!_(e))return e;var N=m(e);if(N){if(j=v(e),!k)return c(e,j)}else{var I=d(e),$=I==U||I==R;if(b(e))return a(e,k);if(I==T||I==E||$&&!D){if(j=F||$?{}:y(e),!k)return F?f(e,u(j,e)):l(e,s(j,e))}else{if(!q[I])return D?e:{};j=g(e,I,k)}}M||(M=new r);var B=M.get(e);if(B)return B;if(M.set(e,j),x(e))return e.forEach(function(r){j.add(t(r,n,P,r,e,M))}),j;if(w(e))return e.forEach(function(r,i){j.set(i,t(r,n,P,i,e,M))}),j;var H=L?F?h:p:F?keysIn:S,Y=N?void 0:H(e);return i(Y||e,function(r,i){Y&&(r=e[i=r]),o(j,i,t(r,n,P,i,e,M))}),j}},function(t,e){t.exports=function(){this.__data__=[],this.size=0}},function(t,e,n){var r=n(26),i=Array.prototype.splice;t.exports=function(t){var e=this.__data__,n=r(e,t);return!(n<0||(n==e.length-1?e.pop():i.call(e,n,1),--this.size,0))}},function(t,e,n){var r=n(26);t.exports=function(t){var e=this.__data__,n=r(e,t);return n<0?void 0:e[n][1]}},function(t,e,n){var r=n(26);t.exports=function(t){return r(this.__data__,t)>-1}},function(t,e,n){var r=n(26);t.exports=function(t,e){var n=this.__data__,i=r(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this}},function(t,e,n){var r=n(25);t.exports=function(){this.__data__=new r,this.size=0}},function(t,e){t.exports=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}},function(t,e){t.exports=function(t){return this.__data__.get(t)}},function(t,e){t.exports=function(t){return this.__data__.has(t)}},function(t,e,n){var r=n(25),i=n(45),o=n(46),s=200;t.exports=function(t,e){var n=this.__data__;if(n instanceof r){var u=n.__data__;if(!i||u.length0&&o(l)?n>1?t(l,n-1,o,s,u):r(u,l):s||(u[u.length]=l)}return u}},function(t,e,n){var r=n(14),i=n(31),o=n(0),s=r?r.isConcatSpreadable:void 0;t.exports=function(t){return o(t)||i(t)||!!(s&&t&&t[s])}},function(t,e,n){var r=n(35),i=n(243),o=n(245);t.exports=function(t,e){return o(i(t,e,r),t+"")}},function(t,e,n){var r=n(244),i=Math.max;t.exports=function(t,e,n){return e=i(void 0===e?t.length-1:e,0),function(){for(var o=arguments,s=-1,u=i(o.length-e,0),a=Array(u);++s0){if(++e>=n)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}},function(t,e,n){var r=n(87),i=n(249),o=n(254),s=n(88),u=n(255),a=n(56),c=200;t.exports=function(t,e,n){var l=-1,f=i,p=t.length,h=!0,d=[],v=d;if(n)h=!1,f=o;else if(p>=c){var g=e?null:u(t);if(g)return a(g);h=!1,f=s,v=new r}else v=e?[]:d;t:for(;++l-1}},function(t,e,n){var r=n(251),i=n(252),o=n(253);t.exports=function(t,e,n){return e==e?o(t,e,n):r(t,i,n)}},function(t,e){t.exports=function(t,e,n,r){for(var i=t.length,o=n+(r?1:-1);r?o--:++o1||1===e.length&&t.hasEdge(e[0],e[0])})}},function(t,e,n){var r=n(5);t.exports=function(t,e,n){return function(t,e,n){var r={},i=t.nodes();return i.forEach(function(t){r[t]={},r[t][t]={distance:0},i.forEach(function(e){t!==e&&(r[t][e]={distance:Number.POSITIVE_INFINITY})}),n(t).forEach(function(n){var i=n.v===t?n.w:n.v,o=e(n);r[t][i]={distance:o,predecessor:t}})}),i.forEach(function(t){var e=r[t];i.forEach(function(n){var o=r[n];i.forEach(function(n){var r=o[t],i=e[n],s=o[n],u=r.distance+i.distance;u0;){if(n=a.removeMin(),r.has(u,n))s.setEdge(n,u[n]);else{if(l)throw new Error("Input graph is not connected: "+t);l=!0}t.nodeEdges(n).forEach(c)}return s}},function(t,e,n){"use strict";var r={file:n(272),http:n(100),https:n(100)},i="object"==typeof window||"function"==typeof importScripts?r.http:r.file;"undefined"==typeof Promise&&n(102),t.exports.load=function(t,e){var n=Promise.resolve();return void 0===e&&(e={}),n=(n=n.then(function(){if(void 0===t)throw new TypeError("location is required");if("string"!=typeof t)throw new TypeError("location must be a string");if(void 0!==e){if("object"!=typeof e)throw new TypeError("options must be an object");if(void 0!==e.processContent&&"function"!=typeof e.processContent)throw new TypeError("options.processContent must be a function")}})).then(function(){return new Promise(function(n,o){(function(t){var e=function(t){return void 0!==t&&(t=-1===t.indexOf("://")?"":t.split("://")[0]),t}(t),n=r[e];if(void 0===n){if(""!==e)throw new Error("Unsupported scheme: "+e);n=i}return n})(t).load(t,e||{},function(t,e){t?o(t):n(e)})})}).then(function(n){return e.processContent?new Promise(function(r,i){"object"!=typeof n&&(n={text:n}),n.location=t,e.processContent(n,function(t,e){t?i(t):r(e)})}):"object"==typeof n?n.text:n})}},function(t,e,n){"use strict";var r=new TypeError("The 'file' scheme is not supported in the browser");t.exports.getBase=function(){throw r},t.exports.load=function(){var t=arguments[arguments.length-1];if("function"!=typeof t)throw r;t(r)}},function(t,e,n){var r;"undefined"!=typeof window?r=window:"undefined"!=typeof self?r=self:(console.warn("Using browser-only version of superagent in non-browser environment"),r=this);var i=n(274),o=n(275),s=n(101),u=n(276),a=n(278);function c(){}var l=e=t.exports=function(t,n){return"function"==typeof n?new e.Request("GET",t).end(n):1==arguments.length?new e.Request("GET",t):new e.Request(t,n)};e.Request=y,l.getXHR=function(){if(!(!r.XMLHttpRequest||r.location&&"file:"==r.location.protocol&&r.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(t){}throw Error("Browser-only version of superagent could not find XHR")};var f="".trim?function(t){return t.trim()}:function(t){return t.replace(/(^\s*|\s*$)/g,"")};function p(t){if(!s(t))return t;var e=[];for(var n in t)h(e,n,t[n]);return e.join("&")}function h(t,e,n){if(null!=n)if(Array.isArray(n))n.forEach(function(n){h(t,e,n)});else if(s(n))for(var r in n)h(t,e+"["+r+"]",n[r]);else t.push(encodeURIComponent(e)+"="+encodeURIComponent(n));else null===n&&t.push(encodeURIComponent(e))}function d(t){for(var e,n,r={},i=t.split("&"),o=0,s=i.length;o=2&&t._responseTimeoutTimer&&clearTimeout(t._responseTimeoutTimer),4==n){var r;try{r=e.status}catch(t){r=0}if(!r){if(t.timedout||t._aborted)return;return t.crossDomainError()}t.emit("end")}};var r=function(e,n){n.total>0&&(n.percent=n.loaded/n.total*100),n.direction=e,t.emit("progress",n)};if(this.hasListeners("progress"))try{e.onprogress=r.bind(null,"download"),e.upload&&(e.upload.onprogress=r.bind(null,"upload"))}catch(t){}try{this.username&&this.password?e.open(this.method,this.url,!0,this.username,this.password):e.open(this.method,this.url,!0)}catch(t){return this.callback(t)}if(this._withCredentials&&(e.withCredentials=!0),!this._formData&&"GET"!=this.method&&"HEAD"!=this.method&&"string"!=typeof n&&!this._isHost(n)){var i=this._header["content-type"],o=this._serializer||l.serialize[i?i.split(";")[0]:""];!o&&v(i)&&(o=l.serialize["application/json"]),o&&(n=o(n))}for(var s in this.header)null!=this.header[s]&&this.header.hasOwnProperty(s)&&e.setRequestHeader(s,this.header[s]);return this._responseType&&(e.responseType=this._responseType),this.emit("request",this),e.send(void 0!==n?n:null),this},l.agent=function(){return new a},["GET","POST","OPTIONS","PATCH","PUT","DELETE"].forEach(function(t){a.prototype[t.toLowerCase()]=function(e,n){var r=new l.Request(t,e);return this._setDefaults(r),n&&r.end(n),r}}),a.prototype.del=a.prototype.delete,l.get=function(t,e,n){var r=l("GET",t);return"function"==typeof e&&(n=e,e=null),e&&r.query(e),n&&r.end(n),r},l.head=function(t,e,n){var r=l("HEAD",t);return"function"==typeof e&&(n=e,e=null),e&&r.query(e),n&&r.end(n),r},l.options=function(t,e,n){var r=l("OPTIONS",t);return"function"==typeof e&&(n=e,e=null),e&&r.send(e),n&&r.end(n),r},l.del=m,l.delete=m,l.patch=function(t,e,n){var r=l("PATCH",t);return"function"==typeof e&&(n=e,e=null),e&&r.send(e),n&&r.end(n),r},l.post=function(t,e,n){var r=l("POST",t);return"function"==typeof e&&(n=e,e=null),e&&r.send(e),n&&r.end(n),r},l.put=function(t,e,n){var r=l("PUT",t);return"function"==typeof e&&(n=e,e=null),e&&r.send(e),n&&r.end(n),r}},function(t,e,n){function r(t){if(t)return function(t){for(var e in r.prototype)t[e]=r.prototype[e];return t}(t)}t.exports=r,r.prototype.on=r.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},r.prototype.once=function(t,e){function n(){this.off(t,n),e.apply(this,arguments)}return n.fn=e,this.on(t,n),this},r.prototype.off=r.prototype.removeListener=r.prototype.removeAllListeners=r.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+t];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var i=0;i=this._maxRetries)return!1;if(this._retryCallback)try{var n=this._retryCallback(t,e);if(!0===n)return!0;if(!1===n)return!1}catch(t){console.error(t)}if(e&&e.status&&e.status>=500&&501!=e.status)return!0;if(t){if(t.code&&~o.indexOf(t.code))return!0;if(t.timeout&&"ECONNABORTED"==t.code)return!0;if(t.crossDomain)return!0}return!1},i.prototype._retry=function(){return this.clearTimeout(),this.req&&(this.req=null,this.req=this.request()),this._aborted=!1,this.timedout=!1,this._end()},i.prototype.then=function(t,e){if(!this._fullfilledPromise){var n=this;this._endCalled&&console.warn("Warning: superagent request was sent twice, because both .end() and .then() were called. Never call .end() if you use promises"),this._fullfilledPromise=new Promise(function(t,e){n.end(function(n,r){n?e(n):t(r)})})}return this._fullfilledPromise.then(t,e)},i.prototype.catch=function(t){return this.then(void 0,t)},i.prototype.use=function(t){return t(this),this},i.prototype.ok=function(t){if("function"!=typeof t)throw Error("Callback required");return this._okCallback=t,this},i.prototype._isResponseOK=function(t){return!!t&&(this._okCallback?this._okCallback(t):t.status>=200&&t.status<300)},i.prototype.get=function(t){return this._header[t.toLowerCase()]},i.prototype.getHeader=i.prototype.get,i.prototype.set=function(t,e){if(r(t)){for(var n in t)this.set(n,t[n]);return this}return this._header[t.toLowerCase()]=e,this.header[t]=e,this},i.prototype.unset=function(t){return delete this._header[t.toLowerCase()],delete this.header[t],this},i.prototype.field=function(t,e){if(null==t)throw new Error(".field(name, val) name can not be empty");if(this._data&&console.error(".field() can't be used if .send() is used. Please use only .send() or only .field() & .attach()"),r(t)){for(var n in t)this.field(n,t[n]);return this}if(Array.isArray(e)){for(var i in e)this.field(t,e[i]);return this}if(null==e)throw new Error(".field(name, val) val can not be empty");return"boolean"==typeof e&&(e=""+e),this._getFormData().append(t,e),this},i.prototype.abort=function(){return this._aborted?this:(this._aborted=!0,this.xhr&&this.xhr.abort(),this.req&&this.req.abort(),this.clearTimeout(),this.emit("abort"),this)},i.prototype._auth=function(t,e,n,r){switch(n.type){case"basic":this.set("Authorization","Basic "+r(t+":"+e));break;case"auto":this.username=t,this.password=e;break;case"bearer":this.set("Authorization","Bearer "+t)}return this},i.prototype.withCredentials=function(t){return null==t&&(t=!0),this._withCredentials=t,this},i.prototype.redirects=function(t){return this._maxRedirects=t,this},i.prototype.maxResponseSize=function(t){if("number"!=typeof t)throw TypeError("Invalid argument");return this._maxResponseSize=t,this},i.prototype.toJSON=function(){return{method:this.method,url:this.url,data:this._data,headers:this._header}},i.prototype.send=function(t){var e=r(t),n=this._header["content-type"];if(this._formData&&console.error(".send() can't be used if .attach() or .field() is used. Please use only .send() or only .field() & .attach()"),e&&!this._data)Array.isArray(t)?this._data=[]:this._isHost(t)||(this._data={});else if(t&&this._data&&this._isHost(this._data))throw Error("Can't merge these send calls");if(e&&r(this._data))for(var i in t)this._data[i]=t[i];else"string"==typeof t?(n||this.type("form"),n=this._header["content-type"],this._data="application/x-www-form-urlencoded"==n?this._data?this._data+"&"+t:t:(this._data||"")+t):this._data=t;return!e||this._isHost(t)?this:(n||this.type("json"),this)},i.prototype.sortQuery=function(t){return this._sort=void 0===t||t,this},i.prototype._finalizeQueryString=function(){var t=this._query.join("&");if(t&&(this.url+=(this.url.indexOf("?")>=0?"&":"?")+t),this._query.length=0,this._sort){var e=this.url.indexOf("?");if(e>=0){var n=this.url.substring(e+1).split("&");"function"==typeof this._sort?n.sort(this._sort):n.sort(),this.url=this.url.substring(0,e)+"?"+n.join("&")}}},i.prototype._appendQueryString=function(){console.trace("Unsupported")},i.prototype._timeoutError=function(t,e,n){if(!this._aborted){var r=new Error(t+e+"ms exceeded");r.timeout=e,r.code="ECONNABORTED",r.errno=n,this.timedout=!0,this.abort(),this.callback(r)}},i.prototype._setTimeouts=function(){var t=this;this._timeout&&!this._timer&&(this._timer=setTimeout(function(){t._timeoutError("Timeout of ",t._timeout,"ETIME")},this._timeout)),this._responseTimeout&&!this._responseTimeoutTimer&&(this._responseTimeoutTimer=setTimeout(function(){t._timeoutError("Response timeout of ",t._responseTimeout,"ETIMEDOUT")},this._responseTimeout))}},function(t,e,n){"use strict";var r=n(277);function i(t){if(t)return function(t){for(var e in i.prototype)t[e]=i.prototype[e];return t}(t)}t.exports=i,i.prototype.get=function(t){return this.header[t.toLowerCase()]},i.prototype._setHeaderProperties=function(t){var e=t["content-type"]||"";this.type=r.type(e);var n=r.params(e);for(var i in n)this[i]=n[i];this.links={};try{t.link&&(this.links=r.parseLinks(t.link))}catch(t){}},i.prototype._setStatusProperties=function(t){var e=t/100|0;this.status=this.statusCode=t,this.statusType=e,this.info=1==e,this.ok=2==e,this.redirect=3==e,this.clientError=4==e,this.serverError=5==e,this.error=(4==e||5==e)&&this.toError(),this.created=201==t,this.accepted=202==t,this.noContent=204==t,this.badRequest=400==t,this.unauthorized=401==t,this.notAcceptable=406==t,this.forbidden=403==t,this.notFound=404==t,this.unprocessableEntity=422==t}},function(t,e,n){"use strict";e.type=function(t){return t.split(/ *; */).shift()},e.params=function(t){return t.split(/ *; */).reduce(function(t,e){var n=e.split(/ *= */),r=n.shift(),i=n.shift();return r&&i&&(t[r]=i),t},{})},e.parseLinks=function(t){return t.split(/ *, */).reduce(function(t,e){var n=e.split(/ *; */),r=n[0].slice(1,-1);return t[n[1].split(/ *= */)[1].slice(1,-1)]=r,t},{})},e.cleanHeader=function(t,e){return delete t["content-type"],delete t["content-length"],delete t["transfer-encoding"],delete t.host,e&&(delete t.authorization,delete t.cookie),t}},function(t,e){function n(){this._defaults=[]}["use","on","once","set","query","type","accept","auth","withCredentials","sortQuery","retry","ok","redirects","timeout","buffer","serialize","parse","ca","key","pfx","cert"].forEach(function(t){n.prototype[t]=function(){return this._defaults.push({fn:t,arguments:arguments}),this}}),n.prototype._setDefaults=function(t){this._defaults.forEach(function(e){t[e.fn].apply(t,e.arguments)})},t.exports=n},function(t,e,n){"use strict";function r(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.exports=function(t,e,n,o){e=e||"&",n=n||"=";var s={};if("string"!=typeof t||0===t.length)return s;var u=/\+/g;t=t.split(e);var a=1e3;o&&"number"==typeof o.maxKeys&&(a=o.maxKeys);var c=t.length;a>0&&c>a&&(c=a);for(var l=0;l=0?(f=v.substr(0,g),p=v.substr(g+1)):(f=v,p=""),h=decodeURIComponent(f),d=decodeURIComponent(p),r(s,h)?i(s[h])?s[h].push(d):s[h]=[s[h],d]:s[h]=d}return s};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},function(t,e,n){"use strict";var r=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};t.exports=function(t,e,n,u){return e=e||"&",n=n||"=",null===t&&(t=void 0),"object"==typeof t?o(s(t),function(s){var u=encodeURIComponent(r(s))+n;return i(t[s])?o(t[s],function(t){return u+encodeURIComponent(r(t))}).join(e):u+encodeURIComponent(r(t[s]))}).join(e):u?encodeURIComponent(r(u))+n+encodeURIComponent(r(t)):""};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function o(t,e){if(t.map)return t.map(e);for(var n=[],r=0;r{const e=/^\\\\\?\\/.test(t),n=/[^\u0000-\u0080]+/.test(t);return e||n?t:t.replace(/\\/g,"/")})},function(t,e,n){ -/** @license URI.js v4.2.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */ -!function(t){"use strict";function e(){for(var t=arguments.length,e=Array(t),n=0;n1){e[0]=e[0].slice(0,-1);for(var r=e.length-1,i=1;i= 0x80 (not a basic code point)","invalid-input":"Invalid input"},d=Math.floor,v=String.fromCharCode;function g(t){throw new RangeError(h[t])}function y(t,e){var n=t.split("@"),r="";n.length>1&&(r=n[0]+"@",t=n[1]);var i=(t=t.replace(p,".")).split("."),o=function(t,e){for(var n=[],r=t.length;r--;)n[r]=e(t[r]);return n}(i,e).join(".");return r+o}function m(t){for(var e=[],n=0,r=t.length;n=55296&&i<=56319&&n>1,t+=d(t/e);t>455;r+=36)t=d(t/35);return d(r+36*t/(t+38))},_=function(t){var e,n=[],r=t.length,i=0,o=128,s=72,u=t.lastIndexOf("-");u<0&&(u=0);for(var a=0;a=128&&g("not-basic"),n.push(t.charCodeAt(a));for(var l=u>0?u+1:0;l=r&&g("invalid-input");var v=(e=t.charCodeAt(l++))-48<10?e-22:e-65<26?e-65:e-97<26?e-97:36;(v>=36||v>d((c-i)/p))&&g("overflow"),i+=v*p;var y=h<=s?1:h>=s+26?26:h-s;if(vd(c/m)&&g("overflow"),p*=m}var b=n.length+1;s=w(i-f,b,0==f),d(i/b)>c-o&&g("overflow"),o+=d(i/b),i%=b,n.splice(i++,0,o)}return String.fromCodePoint.apply(String,n)},x=function(t){var e=[],n=(t=m(t)).length,r=128,i=0,o=72,s=!0,u=!1,a=void 0;try{for(var l,f=t[Symbol.iterator]();!(s=(l=f.next()).done);s=!0){var p=l.value;p<128&&e.push(v(p))}}catch(t){u=!0,a=t}finally{try{!s&&f.return&&f.return()}finally{if(u)throw a}}var h=e.length,y=h;for(h&&e.push("-");y=r&&E<_&&(_=E)}}catch(t){S=!0,A=t}finally{try{!x&&C.return&&C.return()}finally{if(S)throw A}}var U=y+1;_-r>d((c-i)/U)&&g("overflow"),i+=(_-r)*U,r=_;var R=!0,T=!1,q=void 0;try{for(var P,z=t[Symbol.iterator]();!(R=(P=z.next()).done);R=!0){var D=P.value;if(Dc&&g("overflow"),D==r){for(var M=i,j=36;;j+=36){var k=j<=o?1:j>=o+26?26:j-o;if(M>6|192).toString(16).toUpperCase()+"%"+(63&e|128).toString(16).toUpperCase():"%"+(e>>12|224).toString(16).toUpperCase()+"%"+(e>>6&63|128).toString(16).toUpperCase()+"%"+(63&e|128).toString(16).toUpperCase()}function C(t){for(var e="",n=0,r=t.length;n=194&&i<224){if(r-n>=6){var o=parseInt(t.substr(n+4,2),16);e+=String.fromCharCode((31&i)<<6|63&o)}else e+=t.substr(n,6);n+=6}else if(i>=224){if(r-n>=9){var s=parseInt(t.substr(n+4,2),16),u=parseInt(t.substr(n+7,2),16);e+=String.fromCharCode((15&i)<<12|(63&s)<<6|63&u)}else e+=t.substr(n,9);n+=9}else e+=t.substr(n,3),n+=3}return e}function E(t,e){function n(t){var n=C(t);return n.match(e.UNRESERVED)?n:t}return t.scheme&&(t.scheme=String(t.scheme).replace(e.PCT_ENCODED,n).toLowerCase().replace(e.NOT_SCHEME,"")),void 0!==t.userinfo&&(t.userinfo=String(t.userinfo).replace(e.PCT_ENCODED,n).replace(e.NOT_USERINFO,O).replace(e.PCT_ENCODED,i)),void 0!==t.host&&(t.host=String(t.host).replace(e.PCT_ENCODED,n).toLowerCase().replace(e.NOT_HOST,O).replace(e.PCT_ENCODED,i)),void 0!==t.path&&(t.path=String(t.path).replace(e.PCT_ENCODED,n).replace(t.scheme?e.NOT_PATH:e.NOT_PATH_NOSCHEME,O).replace(e.PCT_ENCODED,i)),void 0!==t.query&&(t.query=String(t.query).replace(e.PCT_ENCODED,n).replace(e.NOT_QUERY,O).replace(e.PCT_ENCODED,i)),void 0!==t.fragment&&(t.fragment=String(t.fragment).replace(e.PCT_ENCODED,n).replace(e.NOT_FRAGMENT,O).replace(e.PCT_ENCODED,i)),t}function U(t){return t.replace(/^0*(.*)/,"$1")||"0"}function R(t,e){var n=t.match(e.IPV4ADDRESS)||[],r=a(n,2),i=r[1];return i?i.split(".").map(U).join("."):t}function T(t,e){var n=t.match(e.IPV6ADDRESS)||[],r=a(n,3),i=r[1],o=r[2];if(i){for(var s=i.toLowerCase().split("::").reverse(),u=a(s,2),c=u[0],l=u[1],f=l?l.split(":").map(U):[],p=c.split(":").map(U),h=e.IPV4ADDRESS.test(p[p.length-1]),d=h?7:8,v=p.length-d,g=Array(d),y=0;y1){var _=g.slice(0,b.index),x=g.slice(b.index+b.length);w=_.join(":")+"::"+x.join(":")}else w=g.join(":");return o&&(w+="%"+o),w}return t}var q=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,P=void 0==="".match(/(){0}/)[1];function z(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={},r=!1!==e.iri?u:s;"suffix"===e.reference&&(t=(e.scheme?e.scheme+":":"")+"//"+t);var i=t.match(q);if(i){P?(n.scheme=i[1],n.userinfo=i[3],n.host=i[4],n.port=parseInt(i[5],10),n.path=i[6]||"",n.query=i[7],n.fragment=i[8],isNaN(n.port)&&(n.port=i[5])):(n.scheme=i[1]||void 0,n.userinfo=-1!==t.indexOf("@")?i[3]:void 0,n.host=-1!==t.indexOf("//")?i[4]:void 0,n.port=parseInt(i[5],10),n.path=i[6]||"",n.query=-1!==t.indexOf("?")?i[7]:void 0,n.fragment=-1!==t.indexOf("#")?i[8]:void 0,isNaN(n.port)&&(n.port=t.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?i[4]:void 0)),n.host&&(n.host=T(R(n.host,r),r)),void 0!==n.scheme||void 0!==n.userinfo||void 0!==n.host||void 0!==n.port||n.path||void 0!==n.query?void 0===n.scheme?n.reference="relative":void 0===n.fragment?n.reference="absolute":n.reference="uri":n.reference="same-document",e.reference&&"suffix"!==e.reference&&e.reference!==n.reference&&(n.error=n.error||"URI is not a "+e.reference+" reference.");var o=A[(e.scheme||n.scheme||"").toLowerCase()];if(e.unicodeSupport||o&&o.unicodeSupport)E(n,r);else{if(n.host&&(e.domainHost||o&&o.domainHost))try{n.host=S.toASCII(n.host.replace(r.PCT_ENCODED,C).toLowerCase())}catch(t){n.error=n.error||"Host's domain name can not be converted to ASCII via punycode: "+t}E(n,s)}o&&o.parse&&o.parse(n,e)}else n.error=n.error||"URI can not be parsed.";return n}var D=/^\.\.?\//,M=/^\/\.(\/|$)/,j=/^\/\.\.(\/|$)/,k=/^\/?(?:.|\n)*?(?=\/|$)/;function F(t){for(var e=[];t.length;)if(t.match(D))t=t.replace(D,"");else if(t.match(M))t=t.replace(M,"/");else if(t.match(j))t=t.replace(j,"/"),e.pop();else if("."===t||".."===t)t="";else{var n=t.match(k);if(!n)throw new Error("Unexpected dot segment condition");var r=n[0];t=t.slice(r.length),e.push(r)}return e.join("")}function L(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.iri?u:s,r=[],i=A[(e.scheme||t.scheme||"").toLowerCase()];if(i&&i.serialize&&i.serialize(t,e),t.host)if(n.IPV6ADDRESS.test(t.host)) ;else if(e.domainHost||i&&i.domainHost)try{t.host=e.iri?S.toUnicode(t.host):S.toASCII(t.host.replace(n.PCT_ENCODED,C).toLowerCase())}catch(n){t.error=t.error||"Host's domain name can not be converted to "+(e.iri?"Unicode":"ASCII")+" via punycode: "+n}E(t,n),"suffix"!==e.reference&&t.scheme&&(r.push(t.scheme),r.push(":"));var o=function(t,e){var n=!1!==e.iri?u:s,r=[];return void 0!==t.userinfo&&(r.push(t.userinfo),r.push("@")),void 0!==t.host&&r.push(T(R(String(t.host),n),n).replace(n.IPV6ADDRESS,function(t,e,n){return"["+e+(n?"%25"+n:"")+"]"})),"number"==typeof t.port&&(r.push(":"),r.push(t.port.toString(10))),r.length?r.join(""):void 0}(t,e);if(void 0!==o&&("suffix"!==e.reference&&r.push("//"),r.push(o),t.path&&"/"!==t.path.charAt(0)&&r.push("/")),void 0!==t.path){var a=t.path;e.absolutePath||i&&i.absolutePath||(a=F(a)),void 0===o&&(a=a.replace(/^\/\//,"/%2F")),r.push(a)}return void 0!==t.query&&(r.push("?"),r.push(t.query)),void 0!==t.fragment&&(r.push("#"),r.push(t.fragment)),r.join("")}function N(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments[3],i={};return r||(t=z(L(t,n),n),e=z(L(e,n),n)),!(n=n||{}).tolerant&&e.scheme?(i.scheme=e.scheme,i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=F(e.path||""),i.query=e.query):(void 0!==e.userinfo||void 0!==e.host||void 0!==e.port?(i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=F(e.path||""),i.query=e.query):(e.path?("/"===e.path.charAt(0)?i.path=F(e.path):(void 0===t.userinfo&&void 0===t.host&&void 0===t.port||t.path?t.path?i.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:i.path=e.path:i.path="/"+e.path,i.path=F(i.path)),i.query=e.query):(i.path=t.path,void 0!==e.query?i.query=e.query:i.query=t.query),i.userinfo=t.userinfo,i.host=t.host,i.port=t.port),i.scheme=t.scheme),i.fragment=e.fragment,i}function I(t,e){return t&&t.toString().replace(e&&e.iri?u.PCT_ENCODED:s.PCT_ENCODED,C)}var $={scheme:"http",domainHost:!0,parse:function(t,e){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t},serialize:function(t,e){return t.port!==("https"!==String(t.scheme).toLowerCase()?80:443)&&""!==t.port||(t.port=void 0),t.path||(t.path="/"),t}},B={scheme:"https",domainHost:$.domainHost,parse:$.parse,serialize:$.serialize},H={},Y="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",Z="[0-9A-Fa-f]",X=n(n("%[EFef][0-9A-Fa-f]%"+Z+Z+"%"+Z+Z)+"|"+n("%[89A-Fa-f][0-9A-Fa-f]%"+Z+Z)+"|"+n("%"+Z+Z)),W=e("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),J=new RegExp(Y,"g"),G=new RegExp(X,"g"),Q=new RegExp(e("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',W),"g"),V=new RegExp(e("[^]",Y,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),K=V;function tt(t){var e=C(t);return e.match(J)?e:t}var et={scheme:"mailto",parse:function(t,e){var n=t,r=n.to=n.path?n.path.split(","):[];if(n.path=void 0,n.query){for(var i=!1,o={},s=n.query.split("&"),u=0,a=s.length;u= 0x80 (not a basic code point)","invalid-input":"Invalid input"},_=c-l,x=Math.floor,S=String.fromCharCode;function A(t){throw new RangeError(w[t])}function O(t,e){for(var n=t.length,r=[];n--;)r[n]=e(t[n]);return r}function C(t,e){var n=t.split("@"),r="";return n.length>1&&(r=n[0]+"@",t=n[1]),r+O((t=t.replace(b,".")).split("."),e).join(".")}function E(t){for(var e,n,r=[],i=0,o=t.length;i=55296&&e<=56319&&i65535&&(e+=S((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=S(t)}).join("")}function R(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function T(t,e,n){var r=0;for(t=n?x(t/h):t>>1,t+=x(t/e);t>_*f>>1;r+=c)t=x(t/_);return x(r+(_+1)*t/(t+p))}function q(t){var e,n,r,i,o,s,u,p,h,y,m,b=[],w=t.length,_=0,S=v,O=d;for((n=t.lastIndexOf(g))<0&&(n=0),r=0;r=128&&A("not-basic"),b.push(t.charCodeAt(r));for(i=n>0?n+1:0;i=w&&A("invalid-input"),((p=(m=t.charCodeAt(i++))-48<10?m-22:m-65<26?m-65:m-97<26?m-97:c)>=c||p>x((a-_)/s))&&A("overflow"),_+=p*s,!(p<(h=u<=O?l:u>=O+f?f:u-O));u+=c)s>x(a/(y=c-h))&&A("overflow"),s*=y;O=T(_-o,e=b.length+1,0==o),x(_/e)>a-S&&A("overflow"),S+=x(_/e),_%=e,b.splice(_++,0,S)}return U(b)}function P(t){var e,n,r,i,o,s,u,p,h,y,m,b,w,_,O,C=[];for(b=(t=E(t)).length,e=v,n=0,o=d,s=0;s=e&&mx((a-n)/(w=r+1))&&A("overflow"),n+=(u-e)*w,e=u,s=0;sa&&A("overflow"),m==e){for(p=n,h=c;!(p<(y=h<=o?l:h>=o+f?f:h-o));h+=c)O=p-y,_=c-y,C.push(S(R(y+O%_,0))),p=x(O/_);C.push(S(R(p,0))),o=T(n,w,r==i),n=0,++r}++n,++e}return C.join("")}u={version:"1.4.1",ucs2:{decode:E,encode:U},decode:q,encode:P,toASCII:function(t){return C(t,function(t){return m.test(t)?"xn--"+P(t):t})},toUnicode:function(t){return C(t,function(t){return y.test(t)?q(t.slice(4).toLowerCase()):t})}},void 0===(i=function(){return u}.call(e,n,e,t))||(t.exports=i)}()}).call(this,n(20)(t),n(3))},function(t,e,n){"use strict";t.exports={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}}},function(t,e,n){"use strict";(function(e,n){var r=e.process&&n.nextTick||e.setImmediate||function(t){setTimeout(t,0)};t.exports=function(t,e){return t?void e.then(function(e){r(function(){t(null,e)})},function(e){r(function(){t(e)})}):e}}).call(this,n(3),n(4))},function(t,e,n){"use strict";var r=n(287),i=n(308);function o(t){return function(){throw new Error("Function "+t+" is deprecated and cannot be used.")}}t.exports.Type=n(1),t.exports.Schema=n(17),t.exports.FAILSAFE_SCHEMA=n(62),t.exports.JSON_SCHEMA=n(108),t.exports.CORE_SCHEMA=n(107),t.exports.DEFAULT_SAFE_SCHEMA=n(23),t.exports.DEFAULT_FULL_SCHEMA=n(38),t.exports.load=r.load,t.exports.loadAll=r.loadAll,t.exports.safeLoad=r.safeLoad,t.exports.safeLoadAll=r.safeLoadAll,t.exports.dump=i.dump,t.exports.safeDump=i.safeDump,t.exports.YAMLException=n(22),t.exports.MINIMAL_SCHEMA=n(62),t.exports.SAFE_SCHEMA=n(23),t.exports.DEFAULT_SCHEMA=n(38),t.exports.scan=o("scan"),t.exports.parse=o("parse"),t.exports.compose=o("compose"),t.exports.addConstructor=o("addConstructor")},function(t,e,n){"use strict";var r=n(16),i=n(22),o=n(288),s=n(23),u=n(38),a=Object.prototype.hasOwnProperty,c=1,l=2,f=3,p=4,h=1,d=2,v=3,g=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,y=/[\x85\u2028\u2029]/,m=/[,\[\]\{\}]/,b=/^(?:!|!!|![a-z\-]+!)$/i,w=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function _(t){return 10===t||13===t}function x(t){return 9===t||32===t}function S(t){return 9===t||32===t||10===t||13===t}function A(t){return 44===t||91===t||93===t||123===t||125===t}function O(t){var e;return 48<=t&&t<=57?t-48:97<=(e=32|t)&&e<=102?e-97+10:-1}function C(t){return 48===t?"\0":97===t?"":98===t?"\b":116===t?"\t":9===t?"\t":110===t?"\n":118===t?"\v":102===t?"\f":114===t?"\r":101===t?"":32===t?" ":34===t?'"':47===t?"/":92===t?"\\":78===t?"…":95===t?" ":76===t?"\u2028":80===t?"\u2029":""}function E(t){return t<=65535?String.fromCharCode(t):String.fromCharCode(55296+(t-65536>>10),56320+(t-65536&1023))}for(var U=new Array(256),R=new Array(256),T=0;T<256;T++)U[T]=C(T)?1:0,R[T]=C(T);function q(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||u,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function P(t,e){return new i(e,new o(t.filename,t.input,t.position,t.line,t.position-t.lineStart))}function z(t,e){throw P(t,e)}function D(t,e){t.onWarning&&t.onWarning.call(null,P(t,e))}var M={YAML:function(t,e,n){var r,i,o;null!==t.version&&z(t,"duplication of %YAML directive"),1!==n.length&&z(t,"YAML directive accepts exactly one argument"),null===(r=/^([0-9]+)\.([0-9]+)$/.exec(n[0]))&&z(t,"ill-formed argument of the YAML directive"),i=parseInt(r[1],10),o=parseInt(r[2],10),1!==i&&z(t,"unacceptable YAML version of the document"),t.version=n[0],t.checkLineBreaks=o<2,1!==o&&2!==o&&D(t,"unsupported YAML version of the document")},TAG:function(t,e,n){var r,i;2!==n.length&&z(t,"TAG directive accepts exactly two arguments"),r=n[0],i=n[1],b.test(r)||z(t,"ill-formed tag handle (first argument) of the TAG directive"),a.call(t.tagMap,r)&&z(t,'there is a previously declared suffix for "'+r+'" tag handle'),w.test(i)||z(t,"ill-formed tag prefix (second argument) of the TAG directive"),t.tagMap[r]=i}};function j(t,e,n,r){var i,o,s,u;if(e1&&(t.result+=r.repeat("\n",e-1))}function B(t,e){var n,r,i=t.tag,o=t.anchor,s=[],u=!1;for(null!==t.anchor&&(t.anchorMap[t.anchor]=s),r=t.input.charCodeAt(t.position);0!==r&&45===r&&S(t.input.charCodeAt(t.position+1));)if(u=!0,t.position++,N(t,!0,-1)&&t.lineIndent<=e)s.push(null),r=t.input.charCodeAt(t.position);else if(n=t.line,Z(t,e,f,!1,!0),s.push(t.result),N(t,!0,-1),r=t.input.charCodeAt(t.position),(t.line===n||t.lineIndent>e)&&0!==r)z(t,"bad indentation of a sequence entry");else if(t.lineIndente?T=1:t.lineIndent===e?T=0:t.lineIndente?T=1:t.lineIndent===e?T=0:t.lineIndente)&&(Z(t,e,p,!0,i)&&(y?v=t.result:g=t.result),y||(F(t,f,h,d,v,g,o,s),d=v=g=null),N(t,!0,-1),u=t.input.charCodeAt(t.position)),t.lineIndent>e&&0!==u)z(t,"bad indentation of a mapping entry");else if(t.lineIndent=0))break;0===o?z(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):l?z(t,"repeat of an indentation width identifier"):(f=e+o-1,l=!0)}if(x(s)){do{s=t.input.charCodeAt(++t.position)}while(x(s));if(35===s)do{s=t.input.charCodeAt(++t.position)}while(!_(s)&&0!==s)}for(;0!==s;){for(L(t),t.lineIndent=0,s=t.input.charCodeAt(t.position);(!l||t.lineIndentf&&(f=t.lineIndent),_(s))p++;else{if(t.lineIndent0){for(i=s,o=0;i>0;i--)(s=O(u=t.input.charCodeAt(++t.position)))>=0?o=(o<<4)+s:z(t,"expected hexadecimal character");t.result+=E(o),t.position++}else z(t,"unknown escape sequence");n=r=t.position}else _(u)?(j(t,n,r,!0),$(t,N(t,!1,e)),n=r=t.position):t.position===t.lineStart&&I(t)?z(t,"unexpected end of the document within a double quoted scalar"):(t.position++,r=t.position)}z(t,"unexpected end of the stream within a double quoted scalar")}(t,w)?P=!0:!function(t){var e,n,r;if(42!==(r=t.input.charCodeAt(t.position)))return!1;for(r=t.input.charCodeAt(++t.position),e=t.position;0!==r&&!S(r)&&!A(r);)r=t.input.charCodeAt(++t.position);return t.position===e&&z(t,"name of an alias node must contain at least one character"),n=t.input.slice(e,t.position),t.anchorMap.hasOwnProperty(n)||z(t,'unidentified alias "'+n+'"'),t.result=t.anchorMap[n],N(t,!0,-1),!0}(t)?function(t,e,n){var r,i,o,s,u,a,c,l,f=t.kind,p=t.result;if(S(l=t.input.charCodeAt(t.position))||A(l)||35===l||38===l||42===l||33===l||124===l||62===l||39===l||34===l||37===l||64===l||96===l)return!1;if((63===l||45===l)&&(S(r=t.input.charCodeAt(t.position+1))||n&&A(r)))return!1;for(t.kind="scalar",t.result="",i=o=t.position,s=!1;0!==l;){if(58===l){if(S(r=t.input.charCodeAt(t.position+1))||n&&A(r))break}else if(35===l){if(S(t.input.charCodeAt(t.position-1)))break}else{if(t.position===t.lineStart&&I(t)||n&&A(l))break;if(_(l)){if(u=t.line,a=t.lineStart,c=t.lineIndent,N(t,!1,-1),t.lineIndent>=e){s=!0,l=t.input.charCodeAt(t.position);continue}t.position=o,t.line=u,t.lineStart=a,t.lineIndent=c;break}}s&&(j(t,i,o,!1),$(t,t.line-u),i=o=t.position,s=!1),x(l)||(o=t.position+1),l=t.input.charCodeAt(++t.position)}return j(t,i,o,!1),!!t.result||(t.kind=f,t.result=p,!1)}(t,w,c===n)&&(P=!0,null===t.tag&&(t.tag="?")):(P=!0,null===t.tag&&null===t.anchor||z(t,"alias node should not have any properties")),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):0===T&&(P=g&&B(t,C))),null!==t.tag&&"!"!==t.tag)if("?"===t.tag){for(y=0,m=t.implicitTypes.length;y tag; it should be "'+b.kind+'", not "'+t.kind+'"'),b.resolve(t.result)?(t.result=b.construct(t.result),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):z(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")):z(t,"unknown tag !<"+t.tag+">");return null!==t.listener&&t.listener("close",t),null!==t.tag||null!==t.anchor||P}function X(t){var e,n,r,i,o=t.position,s=!1;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap={},t.anchorMap={};0!==(i=t.input.charCodeAt(t.position))&&(N(t,!0,-1),i=t.input.charCodeAt(t.position),!(t.lineIndent>0||37!==i));){for(s=!0,i=t.input.charCodeAt(++t.position),e=t.position;0!==i&&!S(i);)i=t.input.charCodeAt(++t.position);for(r=[],(n=t.input.slice(e,t.position)).length<1&&z(t,"directive name must not be less than one character in length");0!==i;){for(;x(i);)i=t.input.charCodeAt(++t.position);if(35===i){do{i=t.input.charCodeAt(++t.position)}while(0!==i&&!_(i));break}if(_(i))break;for(e=t.position;0!==i&&!S(i);)i=t.input.charCodeAt(++t.position);r.push(t.input.slice(e,t.position))}0!==i&&L(t),a.call(M,n)?M[n](t,n,r):D(t,'unknown document directive "'+n+'"')}N(t,!0,-1),0===t.lineIndent&&45===t.input.charCodeAt(t.position)&&45===t.input.charCodeAt(t.position+1)&&45===t.input.charCodeAt(t.position+2)?(t.position+=3,N(t,!0,-1)):s&&z(t,"directives end mark is expected"),Z(t,t.lineIndent-1,p,!1,!0),N(t,!0,-1),t.checkLineBreaks&&y.test(t.input.slice(o,t.position))&&D(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&I(t)?46===t.input.charCodeAt(t.position)&&(t.position+=3,N(t,!0,-1)):t.position0&&-1==="\0\r\n…\u2028\u2029".indexOf(this.buffer.charAt(i-1));)if(i-=1,this.position-i>e/2-1){n=" ... ",i+=5;break}for(o="",s=this.position;se/2-1){o=" ... ",s-=5;break}return u=this.buffer.slice(i,s),r.repeat(" ",t)+n+u+o+"\n"+r.repeat(" ",t+this.position-i+n.length)+"^"},i.prototype.toString=function(t){var e,n="";return this.name&&(n+='in "'+this.name+'" '),n+="at line "+(this.line+1)+", column "+(this.column+1),t||(e=this.getSnippet())&&(n+=":\n"+e),n},t.exports=i},function(t,e,n){"use strict";var r=n(1);t.exports=new r("tag:yaml.org,2002:str",{kind:"scalar",construct:function(t){return null!==t?t:""}})},function(t,e,n){"use strict";var r=n(1);t.exports=new r("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(t){return null!==t?t:[]}})},function(t,e,n){"use strict";var r=n(1);t.exports=new r("tag:yaml.org,2002:map",{kind:"mapping",construct:function(t){return null!==t?t:{}}})},function(t,e,n){"use strict";var r=n(1);t.exports=new r("tag:yaml.org,2002:null",{kind:"scalar",resolve:function(t){if(null===t)return!0;var e=t.length;return 1===e&&"~"===t||4===e&&("null"===t||"Null"===t||"NULL"===t)},construct:function(){return null},predicate:function(t){return null===t},represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"})},function(t,e,n){"use strict";var r=n(1);t.exports=new r("tag:yaml.org,2002:bool",{kind:"scalar",resolve:function(t){if(null===t)return!1;var e=t.length;return 4===e&&("true"===t||"True"===t||"TRUE"===t)||5===e&&("false"===t||"False"===t||"FALSE"===t)},construct:function(t){return"true"===t||"True"===t||"TRUE"===t},predicate:function(t){return"[object Boolean]"===Object.prototype.toString.call(t)},represent:{lowercase:function(t){return t?"true":"false"},uppercase:function(t){return t?"TRUE":"FALSE"},camelcase:function(t){return t?"True":"False"}},defaultStyle:"lowercase"})},function(t,e,n){"use strict";var r=n(16),i=n(1);function o(t){return 48<=t&&t<=55}function s(t){return 48<=t&&t<=57}t.exports=new i("tag:yaml.org,2002:int",{kind:"scalar",resolve:function(t){if(null===t)return!1;var e,n,r=t.length,i=0,u=!1;if(!r)return!1;if("-"!==(e=t[i])&&"+"!==e||(e=t[++i]),"0"===e){if(i+1===r)return!0;if("b"===(e=t[++i])){for(i++;i=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},octal:function(t){return t>=0?"0"+t.toString(8):"-0"+t.toString(8).slice(1)},decimal:function(t){return t.toString(10)},hexadecimal:function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})},function(t,e,n){"use strict";var r=n(16),i=n(1),o=new RegExp("^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");var s=/^[-+]?[0-9]+e/;t.exports=new i("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(t){return null!==t&&!(!o.test(t)||"_"===t[t.length-1])},construct:function(t){var e,n,r,i;return n="-"===(e=t.replace(/_/g,"").toLowerCase())[0]?-1:1,i=[],"+-".indexOf(e[0])>=0&&(e=e.slice(1)),".inf"===e?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===e?NaN:e.indexOf(":")>=0?(e.split(":").forEach(function(t){i.unshift(parseFloat(t,10))}),e=0,r=1,i.forEach(function(t){e+=t*r,r*=60}),n*e):n*parseFloat(e,10)},predicate:function(t){return"[object Number]"===Object.prototype.toString.call(t)&&(t%1!=0||r.isNegativeZero(t))},represent:function(t,e){var n;if(isNaN(t))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(r.isNegativeZero(t))return"-0.0";return n=t.toString(10),s.test(n)?n.replace("e",".e"):n},defaultStyle:"lowercase"})},function(t,e,n){"use strict";var r=n(1),i=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),o=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");t.exports=new r("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(t){return null!==t&&(null!==i.exec(t)||null!==o.exec(t))},construct:function(t){var e,n,r,s,u,a,c,l,f=0,p=null;if(null===(e=i.exec(t))&&(e=o.exec(t)),null===e)throw new Error("Date resolve error");if(n=+e[1],r=+e[2]-1,s=+e[3],!e[4])return new Date(Date.UTC(n,r,s));if(u=+e[4],a=+e[5],c=+e[6],e[7]){for(f=e[7].slice(0,3);f.length<3;)f+="0";f=+f}return e[9]&&(p=6e4*(60*+e[10]+ +(e[11]||0)),"-"===e[9]&&(p=-p)),l=new Date(Date.UTC(n,r,s,u,a,c,f)),p&&l.setTime(l.getTime()-p),l},instanceOf:Date,represent:function(t){return t.toISOString()}})},function(t,e,n){"use strict";var r=n(1);t.exports=new r("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(t){return"<<"===t||null===t}})},function(t,e,n){"use strict";var r;try{r=n(18).Buffer}catch(t){}var i=n(1),o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";t.exports=new i("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(t){if(null===t)return!1;var e,n,r=0,i=t.length,s=o;for(n=0;n64)){if(e<0)return!1;r+=6}return r%8==0},construct:function(t){var e,n,i=t.replace(/[\r\n=]/g,""),s=i.length,u=o,a=0,c=[];for(e=0;e>16&255),c.push(a>>8&255),c.push(255&a)),a=a<<6|u.indexOf(i.charAt(e));return 0==(n=s%4*6)?(c.push(a>>16&255),c.push(a>>8&255),c.push(255&a)):18===n?(c.push(a>>10&255),c.push(a>>2&255)):12===n&&c.push(a>>4&255),r?r.from?r.from(c):new r(c):c},predicate:function(t){return r&&r.isBuffer(t)},represent:function(t){var e,n,r="",i=0,s=t.length,u=o;for(e=0;e>18&63],r+=u[i>>12&63],r+=u[i>>6&63],r+=u[63&i]),i=(i<<8)+t[e];return 0==(n=s%3)?(r+=u[i>>18&63],r+=u[i>>12&63],r+=u[i>>6&63],r+=u[63&i]):2===n?(r+=u[i>>10&63],r+=u[i>>4&63],r+=u[i<<2&63],r+=u[64]):1===n&&(r+=u[i>>2&63],r+=u[i<<4&63],r+=u[64],r+=u[64]),r}})},function(t,e,n){"use strict";e.byteLength=function(t){var e=c(t),n=e[0],r=e[1];return 3*(n+r)/4-r},e.toByteArray=function(t){for(var e,n=c(t),r=n[0],s=n[1],u=new o(function(t,e,n){return 3*(e+n)/4-n}(0,r,s)),a=0,l=s>0?r-4:r,f=0;f>16&255,u[a++]=e>>8&255,u[a++]=255&e;2===s&&(e=i[t.charCodeAt(f)]<<2|i[t.charCodeAt(f+1)]>>4,u[a++]=255&e);1===s&&(e=i[t.charCodeAt(f)]<<10|i[t.charCodeAt(f+1)]<<4|i[t.charCodeAt(f+2)]>>2,u[a++]=e>>8&255,u[a++]=255&e);return u},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],s=0,u=n-i;su?u:s+16383));1===i?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"="));return o.join("")};for(var r=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,a=s.length;u0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function l(t,e,n){for(var i,o,s=[],u=e;u>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,n,r,i){var o,s,u=8*i-r-1,a=(1<>1,l=-7,f=n?i-1:0,p=n?-1:1,h=t[e+f];for(f+=p,o=h&(1<<-l)-1,h>>=-l,l+=u;l>0;o=256*o+t[e+f],f+=p,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=r;l>0;s=256*s+t[e+f],f+=p,l-=8);if(0===o)o=1-c;else{if(o===a)return s?NaN:1/0*(h?-1:1);s+=Math.pow(2,r),o-=c}return(h?-1:1)*s*Math.pow(2,o-r)},e.write=function(t,e,n,r,i,o){var s,u,a,c=8*o-i-1,l=(1<>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:o-1,d=r?1:-1,v=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,s=l):(s=Math.floor(Math.log(e)/Math.LN2),e*(a=Math.pow(2,-s))<1&&(s--,a*=2),(e+=s+f>=1?p/a:p*Math.pow(2,1-f))*a>=2&&(s++,a/=2),s+f>=l?(u=0,s=l):s+f>=1?(u=(e*a-1)*Math.pow(2,i),s+=f):(u=e*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;t[n+h]=255&u,h+=d,u/=256,i-=8);for(s=s<0;t[n+h]=255&s,h+=d,s/=256,c-=8);t[n+h-d]|=128*v}},function(t,e,n){"use strict";var r=n(1),i=Object.prototype.hasOwnProperty,o=Object.prototype.toString;t.exports=new r("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(t){if(null===t)return!0;var e,n,r,s,u,a=[],c=t;for(e=0,n=c.length;e3)return!1;if("/"!==e[e.length-r.length-1])return!1}return!0},construct:function(t){var e=t,n=/\/([gim]*)$/.exec(t),r="";return"/"===e[0]&&(n&&(r=n[1]),e=e.slice(1,e.length-r.length-1)),new RegExp(e,r)},predicate:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},represent:function(t){var e="/"+t.source+"/";return t.global&&(e+="g"),t.multiline&&(e+="m"),t.ignoreCase&&(e+="i"),e}})},function(t,e,n){"use strict";var r;try{r=n(307)}catch(t){"undefined"!=typeof window&&(r=window.esprima)}var i=n(1);t.exports=new i("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:function(t){if(null===t)return!1;try{var e="("+t+")",n=r.parse(e,{range:!0});return"Program"===n.type&&1===n.body.length&&"ExpressionStatement"===n.body[0].type&&("ArrowFunctionExpression"===n.body[0].expression.type||"FunctionExpression"===n.body[0].expression.type)}catch(t){return!1}},construct:function(t){var e,n="("+t+")",i=r.parse(n,{range:!0}),o=[];if("Program"!==i.type||1!==i.body.length||"ExpressionStatement"!==i.body[0].type||"ArrowFunctionExpression"!==i.body[0].expression.type&&"FunctionExpression"!==i.body[0].expression.type)throw new Error("Failed to resolve function");return i.body[0].expression.params.forEach(function(t){o.push(t.name)}),e=i.body[0].expression.body.range,"BlockStatement"===i.body[0].expression.body.type?new Function(o,n.slice(e[0]+1,e[1]-1)):new Function(o,"return "+n.slice(e[0],e[1]))},predicate:function(t){return"[object Function]"===Object.prototype.toString.call(t)},represent:function(t){return t.toString()}})},function(t,e){if("undefined"==typeof esprima){var n=new Error("Cannot find module 'esprima'");throw n.code="MODULE_NOT_FOUND",n}t.exports=esprima},function(t,e,n){"use strict";var r=n(16),i=n(22),o=n(38),s=n(23),u=Object.prototype.toString,a=Object.prototype.hasOwnProperty,c=9,l=10,f=32,p=33,h=34,d=35,v=37,g=38,y=39,m=42,b=44,w=45,_=58,x=62,S=63,A=64,O=91,C=93,E=96,U=123,R=124,T=125,q={0:"\\0",7:"\\a",8:"\\b",9:"\\t",10:"\\n",11:"\\v",12:"\\f",13:"\\r",27:"\\e",34:'\\"',92:"\\\\",133:"\\N",160:"\\_",8232:"\\L",8233:"\\P"},P=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];function z(t){var e,n,o;if(e=t.toString(16).toUpperCase(),t<=255)n="x",o=2;else if(t<=65535)n="u",o=4;else{if(!(t<=4294967295))throw new i("code point within a string may not be greater than 0xFFFFFFFF");n="U",o=8}return"\\"+n+r.repeat("0",o-e.length)+e}function D(t){this.schema=t.schema||o,this.indent=Math.max(1,t.indent||2),this.noArrayIndent=t.noArrayIndent||!1,this.skipInvalid=t.skipInvalid||!1,this.flowLevel=r.isNothing(t.flowLevel)?-1:t.flowLevel,this.styleMap=function(t,e){var n,r,i,o,s,u,c;if(null===e)return{};for(n={},i=0,o=(r=Object.keys(e)).length;ir&&" "!==t[q+1],q=o);else if(!F(s))return Y;P=P&&L(s)}c=c||f&&o-q-1>r&&" "!==t[q+1]}return a||c?n>9&&N(t)?Y:c?H:B:P&&!i(t)?I:$}function X(t,e,n,r){t.dump=function(){if(0===e.length)return"''";if(!t.noCompatMode&&-1!==P.indexOf(e))return"'"+e+"'";var o=t.indent*Math.max(1,n),s=-1===t.lineWidth?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-o),u=r||t.flowLevel>-1&&n>=t.flowLevel;switch(Z(e,u,t.indent,s,function(e){return function(t,e){var n,r;for(n=0,r=t.implicitTypes.length;n"+W(e,t.indent)+J(M(function(t,e){var n,r,i=/(\n+)([^\n]*)/g,o=(u=t.indexOf("\n"),u=-1!==u?u:t.length,i.lastIndex=u,G(t.slice(0,u),e)),s="\n"===t[0]||" "===t[0];var u;for(;r=i.exec(t);){var a=r[1],c=r[2];n=" "===c[0],o+=a+(s||n||""===c?"":"\n")+G(c,e),s=n}return o}(e,s),o));case Y:return'"'+function(t){for(var e,n,r,i="",o=0;o=55296&&e<=56319&&(n=t.charCodeAt(o+1))>=56320&&n<=57343?(i+=z(1024*(e-55296)+n-56320+65536),o++):(r=q[e],i+=!r&&F(e)?t[o]:r||z(e));return i}(e)+'"';default:throw new i("impossible error: invalid scalar style")}}()}function W(t,e){var n=N(t)?String(e):"",r="\n"===t[t.length-1];return n+(r&&("\n"===t[t.length-2]||"\n"===t)?"+":r?"":"-")+"\n"}function J(t){return"\n"===t[t.length-1]?t.slice(0,-1):t}function G(t,e){if(""===t||" "===t[0])return t;for(var n,r,i=/ [^ ]/g,o=0,s=0,u=0,a="";n=i.exec(t);)(u=n.index)-o>e&&(r=s>o?s:u,a+="\n"+t.slice(o,r),o=r+1),s=u;return a+="\n",t.length-o>e&&s>o?a+=t.slice(o,s)+"\n"+t.slice(s+1):a+=t.slice(o),a.slice(1)}function Q(t,e,n){var r,o,s,c,l,f;for(s=0,c=(o=n?t.explicitTypes:t.implicitTypes).length;s tag resolver accepts not "'+f+'" style');r=l.represent[f](e,f)}t.dump=r}return!0}return!1}function V(t,e,n,r,o,s){t.tag=null,t.dump=n,Q(t,n,!1)||Q(t,n,!0);var a=u.call(t.dump);r&&(r=t.flowLevel<0||t.flowLevel>e);var c,f,p="[object Object]"===a||"[object Array]"===a;if(p&&(f=-1!==(c=t.duplicates.indexOf(n))),(null!==t.tag&&"?"!==t.tag||f||2!==t.indent&&e>0)&&(o=!1),f&&t.usedDuplicates[c])t.dump="*ref_"+c;else{if(p&&f&&!t.usedDuplicates[c]&&(t.usedDuplicates[c]=!0),"[object Object]"===a)r&&0!==Object.keys(t.dump).length?(!function(t,e,n,r){var o,s,u,a,c,f,p="",h=t.tag,d=Object.keys(n);if(!0===t.sortKeys)d.sort();else if("function"==typeof t.sortKeys)d.sort(t.sortKeys);else if(t.sortKeys)throw new i("sortKeys must be a boolean or a function");for(o=0,s=d.length;o1024)&&(t.dump&&l===t.dump.charCodeAt(0)?f+="?":f+="? "),f+=t.dump,c&&(f+=j(t,e)),V(t,e+1,a,!0,c)&&(t.dump&&l===t.dump.charCodeAt(0)?f+=":":f+=": ",p+=f+=t.dump));t.tag=h,t.dump=p||"{}"}(t,e,t.dump,o),f&&(t.dump="&ref_"+c+t.dump)):(!function(t,e,n){var r,i,o,s,u,a="",c=t.tag,l=Object.keys(n);for(r=0,i=l.length;r1024&&(u+="? "),u+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),V(t,e,s,!1,!1)&&(a+=u+=t.dump));t.tag=c,t.dump="{"+a+"}"}(t,e,t.dump),f&&(t.dump="&ref_"+c+" "+t.dump));else if("[object Array]"===a){var h=t.noArrayIndent&&e>0?e-1:e;r&&0!==t.dump.length?(!function(t,e,n,r){var i,o,s="",u=t.tag;for(i=0,o=n.length;i "+t.dump)}return!0}function K(t,e){var n,r,i=[],o=[];for(function t(e,n,r){var i,o,s;if(null!==e&&"object"==typeof e)if(-1!==(o=n.indexOf(e)))-1===r.indexOf(o)&&r.push(o);else if(n.push(e),Array.isArray(e))for(o=0,s=e.length;o1&&console.log("Replacing with",e),v++}}else{let i=l(a(e,t[n]));if(s.verbose>1&&console.log((!1===i?p.colour.red:p.colour.green)+"Internal resolution",t[n],p.colour.normal),!1===i){if(r.parent[r.pkey]={},s.fatal){let e=new Error("Internal $ref resolution failed "+t[n]);if(!s.promise)throw e;s.promise.reject(e)}}else v++,r.parent[r.pkey]=i,d[t[n]]=r.path.replace("/%24ref","")}else if(h.protocol){let e=o.resolve(i,t[n]).toString();s.verbose>1&&console.log(p.colour.yellow+"Rewriting external url ref",t[n],"as",e,p.colour.normal),t["x-miro"]=t[n],t[n]=e}else if(!t["x-miro"]){let e=o.resolve(i,t[n]).toString();s.verbose>1&&console.log(p.colour.yellow+"Rewriting external ref",t[n],"as",e,p.colour.normal),t["x-miro"]=t[n],t[n]=e}});return c(t,{},function(t,e,n){f(t,e)&&(void 0!==t.$fixed&&delete t.$fixed,s.preserveMiro||delete t["x-miro"])}),s.verbose>1&&console.log("Finished internal resolution"),t}function d(t,e){if(!e.filters||!e.filters.length)return t;for(let n of e.filters)t=n(t,e);return t}function v(t,e,n,c){var f=o.parse(n.source),p=n.source.split("\\").join("/").split("/");p.pop()||p.pop();let v="",g=e.split("#");g.length>1&&(v="#"+g[1],e=g[0]),p=p.join("/");let y,m=o.parse(e),b=m.protocol?m.protocol:f.protocol?f.protocol:"file:";if(y="file:"===b?i.resolve(p?p+"/":"",e):o.resolve(p?p+"/":"",e),n.cache[y]){n.verbose&&console.log("CACHED",y,v);let t=l(n.cache[y]),r=t;if(v&&!1===(r=a(r,v))&&(r={},n.fatal)){let t=new Error("Cached $ref resolution failed "+y+v);if(!n.promise)throw t;n.promise.reject(t)}return r=d(r=h(r,t,e,v,y,n),n),c(l(r),y,n),Promise.resolve(r)}return n.verbose&&console.log("GET",y,v),n.handlers&&n.handlers[b]?n.handlers[b](p,e,v,n).then(function(t){return t=d(t,n),n.cache[y]=t,c(t,y,n),t}).catch(function(t){throw n.verbose&&console.warn(t),t}):b&&b.startsWith("http")?s(y,{agent:n.agent}).then(function(t){if(200!==t.status)throw new Error(`Received status code ${t.status}`);return t.text()}).then(function(t){try{let r=u.safeLoad(t,{json:!0});if(t=r,n.cache[y]=l(t),v&&!1===(t=a(t,v))&&(t={},n.fatal)){let t=new Error("Remote $ref resolution failed "+y+v);if(!n.promise)throw t;n.promise.reject(t)}t=d(t=h(t,r,e,v,y,n),n)}catch(t){if(n.verbose&&console.warn(t),!n.promise||!n.fatal)throw t;n.promise.reject(t)}return c(t,y,n),t}).catch(function(t){if(n.verbose&&console.warn(t),n.cache[y]={},!n.promise||!n.fatal)throw t;n.promise.reject(t)}):(w=y,_=n.encoding||"utf8",new Promise(function(t,e){r.readFile(w,_,function(n,r){n?e(n):t(r)})})).then(function(t){try{let r=u.safeLoad(t,{json:!0});if(t=r,n.cache[y]=l(t),v&&!1===(t=a(t,v))&&(t={},n.fatal)){let t=new Error("File $ref resolution failed "+y+v);if(!n.promise)throw t;n.promise.reject(t)}t=d(t=h(t,r,e,v,y,n),n)}catch(t){if(n.verbose&&console.warn(t),!n.promise||!n.fatal)throw t;n.promise.reject(t)}return c(t,y,n),t}).catch(function(t){if(n.verbose&&console.warn(t),!n.promise||!n.fatal)throw t;n.promise.reject(t)});var w,_}function g(t){return new Promise(function(e,n){(function(t){return new Promise(function(e,n){function r(e,n,r){if(e[n]&&f(e[n],"$ref")){let o=e[n].$ref;if(!o.startsWith("#")){let s="";if(!i[o]){let e=Object.keys(i).find(function(t,e,n){return o.startsWith(t+"/")});e&&(t.verbose&&console.warn("Found potential subschema at",e),s=(s="/"+(o.split("#")[1]||"").replace(e.split("#")[1]||"")).split("/undefined").join(""),o=e)}if(i[o]||(i[o]={resolved:!1,paths:[],extras:{},description:e[n].description}),i[o].resolved)if(t.rewriteRefs){let r=i[o].resolvedAt;t.verbose>1&&console.log("Rewriting ref",o,r),e[n]["x-miro"]=o,e[n].$ref=r+s}else e[n]=l(i[o].data);else i[o].paths.push(r.path),i[o].extras[r.path]=s}}}let i=t.externalRefs;if(t.resolver.depth>0&&t.source===t.resolver.base)return e(i);c(t.openapi.definitions,{identityDetection:!0,path:"#/definitions"},r),c(t.openapi.components,{identityDetection:!0,path:"#/components"},r),c(t.openapi,{identityDetection:!0},r),e(i)})})(t).then(function(e){for(let n in e)if(!e[n].resolved){let r=t.resolver.depth;r>0&&r++,t.resolver.actions[r].push(function(){return v(t.openapi,n,t,function(t,r,i){if(!e[n].resolved){let o={};o.context=e[n],o.$ref=n,o.original=l(t),o.updated=t,o.source=r,i.externals.push(o),e[n].resolved=!0}let o=Object.assign({},i,{source:"",resolver:{actions:i.resolver.actions,depth:i.resolver.actions.length-1,base:i.resolver.base}});i.patch&&e[n].description&&!t.description&&"object"==typeof t&&(t.description=e[n].description),e[n].data=t;let s=(u=e[n].paths,[...new Set(u)]);var u;s=s.sort(function(t,e){const n=t.startsWith("#/components/")||t.startsWith("#/definitions/"),r=e.startsWith("#/components/")||e.startsWith("#/definitions/");return n&&!r?-1:r&&!n?1:0});for(let r of s)if(e[n].resolvedAt&&r!==e[n].resolvedAt&&r.indexOf("x-ms-examples/")<0)i.verbose>1&&console.log("Creating pointer to data at",r),a(i.openapi,r,{$ref:e[n].resolvedAt+e[n].extras[r],"x-miro":n+e[n].extras[r]});else{e[n].resolvedAt?i.verbose>1&&console.log("Avoiding circular reference"):(e[n].resolvedAt=r,i.verbose>1&&console.log("Creating initial clone of data at",r));let o=l(t);a(i.openapi,r,o)}0===i.resolver.actions[o.resolver.depth].length&&i.resolver.actions[o.resolver.depth].push(function(){return g(o)})})})}}).catch(function(e){t.verbose&&console.warn(e),n(e)});let r={options:t};r.actions=t.resolver.actions[t.resolver.depth],e(r)})}const y=t=>t.reduce((t,e)=>t.then(t=>e().then(Array.prototype.concat.bind(t))),Promise.resolve([]));function m(t,e,n){t.resolver.actions.push([]),g(t).then(function(r){y(r.actions).then(function(){if(t.resolver.depth>=t.resolver.actions.length)return console.warn("Ran off the end of resolver actions"),e(!0);t.resolver.depth++,t.resolver.actions[t.resolver.depth].length?setTimeout(function(){m(r.options,e,n)},0):(t.verbose>1&&console.log(p.colour.yellow+"Finished resolution!",p.colour.normal),e(t))}).catch(function(e){t.verbose&&console.warn(e),n(e)})}).catch(function(e){t.verbose&&console.warn(e),n(e)})}function b(t){if(t.cache||(t.cache={}),t.source){o.parse(t.source).protocol||(t.source=i.resolve(t.source))}t.externals||(t.externals=[]),t.externalRefs||(t.externalRefs=[]),t.rewriteRefs=!0,t.resolver={},t.resolver.depth=0,t.resolver.base=t.source,t.resolver.actions=[[]]}t.exports={optionalResolve:function(t){return b(t),new Promise(function(e,n){t.resolve?m(t,e,n):e(t)})},resolve:function(t,e,n){return n||(n={}),n.openapi=t,n.source=e,n.resolve=!0,b(n),new Promise(function(t,e){m(n,t,e)})}}},function(t,e,n){(function(t){var r=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),n={},r=0;r=o)return t;switch(t){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(t){return"[Circular]"}default:return t}}),a=r[n];n=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),d(n)?r.showHidden=n:n&&e._extend(r,n),m(r.showHidden)&&(r.showHidden=!1),m(r.depth)&&(r.depth=2),m(r.colors)&&(r.colors=!1),m(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=a),l(r,t,r.depth)}function a(t,e){var n=u.styles[e];return n?"["+u.colors[n][0]+"m"+t+"["+u.colors[n][1]+"m":t}function c(t,e){return t}function l(t,n,r){if(t.customInspect&&n&&S(n.inspect)&&n.inspect!==e.inspect&&(!n.constructor||n.constructor.prototype!==n)){var i=n.inspect(r,t);return y(i)||(i=l(t,i,r)),i}var o=function(t,e){if(m(e))return t.stylize("undefined","undefined");if(y(e)){var n="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(n,"string")}if(g(e))return t.stylize(""+e,"number");if(d(e))return t.stylize(""+e,"boolean");if(v(e))return t.stylize("null","null")}(t,n);if(o)return o;var s=Object.keys(n),u=function(t){var e={};return t.forEach(function(t,n){e[t]=!0}),e}(s);if(t.showHidden&&(s=Object.getOwnPropertyNames(n)),x(n)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return f(n);if(0===s.length){if(S(n)){var a=n.name?": "+n.name:"";return t.stylize("[Function"+a+"]","special")}if(b(n))return t.stylize(RegExp.prototype.toString.call(n),"regexp");if(_(n))return t.stylize(Date.prototype.toString.call(n),"date");if(x(n))return f(n)}var c,w="",A=!1,O=["{","}"];(h(n)&&(A=!0,O=["[","]"]),S(n))&&(w=" [Function"+(n.name?": "+n.name:"")+"]");return b(n)&&(w=" "+RegExp.prototype.toString.call(n)),_(n)&&(w=" "+Date.prototype.toUTCString.call(n)),x(n)&&(w=" "+f(n)),0!==s.length||A&&0!=n.length?r<0?b(n)?t.stylize(RegExp.prototype.toString.call(n),"regexp"):t.stylize("[Object]","special"):(t.seen.push(n),c=A?function(t,e,n,r,i){for(var o=[],s=0,u=e.length;s=0&&0,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60)return n[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+n[1];return n[0]+e+" "+t.join(", ")+" "+n[1]}(c,w,O)):O[0]+w+O[1]}function f(t){return"["+Error.prototype.toString.call(t)+"]"}function p(t,e,n,r,i,o){var s,u,a;if((a=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?u=a.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):a.set&&(u=t.stylize("[Setter]","special")),E(r,i)||(s="["+i+"]"),u||(t.seen.indexOf(a.value)<0?(u=v(n)?l(t,a.value,null):l(t,a.value,n-1)).indexOf("\n")>-1&&(u=o?u.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+u.split("\n").map(function(t){return" "+t}).join("\n")):u=t.stylize("[Circular]","special")),m(s)){if(o&&i.match(/^\d+$/))return u;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=t.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=t.stylize(s,"string"))}return s+": "+u}function h(t){return Array.isArray(t)}function d(t){return"boolean"==typeof t}function v(t){return null===t}function g(t){return"number"==typeof t}function y(t){return"string"==typeof t}function m(t){return void 0===t}function b(t){return w(t)&&"[object RegExp]"===A(t)}function w(t){return"object"==typeof t&&null!==t}function _(t){return w(t)&&"[object Date]"===A(t)}function x(t){return w(t)&&("[object Error]"===A(t)||t instanceof Error)}function S(t){return"function"==typeof t}function A(t){return Object.prototype.toString.call(t)}function O(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(n){if(m(o)&&(o=t.env.NODE_DEBUG||""),n=n.toUpperCase(),!s[n])if(new RegExp("\\b"+n+"\\b","i").test(o)){var r=t.pid;s[n]=function(){var t=e.format.apply(e,arguments);console.error("%s %d: %s",n,r,t)}}else s[n]=function(){};return s[n]},e.inspect=u,u.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},u.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.isArray=h,e.isBoolean=d,e.isNull=v,e.isNullOrUndefined=function(t){return null==t},e.isNumber=g,e.isString=y,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=m,e.isRegExp=b,e.isObject=w,e.isDate=_,e.isError=x,e.isFunction=S,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=n(311);var C=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function E(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){var t,n;console.log("%s - %s",(t=new Date,n=[O(t.getHours()),O(t.getMinutes()),O(t.getSeconds())].join(":"),[t.getDate(),C[t.getMonth()],n].join(" ")),e.format.apply(e,arguments))},e.inherits=n(8),e._extend=function(t,e){if(!e||!w(e))return t;for(var n=Object.keys(e),r=n.length;r--;)t[n[r]]=e[n[r]];return t};var U="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function R(t,e){if(!t){var n=new Error("Promise was rejected with a falsy value");n.reason=t,t=n}return e(t)}e.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(U&&t[U]){var e;if("function"!=typeof(e=t[U]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,U,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,n,r=new Promise(function(t,r){e=t,n=r}),i=[],o=0;o0?this.tail.next=e:this.head=e,this.tail=e,++this.length},t.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},t.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},t.prototype.clear=function(){this.head=this.tail=null,this.length=0},t.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,n=""+e.data;e=e.next;)n+=t+e.data;return n},t.prototype.concat=function(t){if(0===this.length)return r.alloc(0);if(1===this.length)return this.head.data;for(var e,n,i,o=r.allocUnsafe(t>>>0),s=this.head,u=0;s;)e=s.data,n=o,i=u,e.copy(n,i),u+=s.data.length,s=s.next;return o},t}(),i&&i.inspect&&i.inspect.custom&&(t.exports.prototype[i.inspect.custom]=function(){var t=i.inspect({length:this.length});return this.constructor.name+" "+t})},function(t,e){},function(t,e,n){(function(t){var r=void 0!==t&&t||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function o(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new o(i.call(setTimeout,r,arguments),clearTimeout)},e.setInterval=function(){return new o(i.call(setInterval,r,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(r,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},n(321),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,n(3))},function(t,e,n){(function(t,e){!function(t,n){"use strict";if(!t.setImmediate){var r,i,o,s,u,a=1,c={},l=!1,f=t.document,p=Object.getPrototypeOf&&Object.getPrototypeOf(t);p=p&&p.setTimeout?p:t,"[object process]"==={}.toString.call(t.process)?r=function(t){e.nextTick(function(){d(t)})}:!function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?t.MessageChannel?((o=new MessageChannel).port1.onmessage=function(t){d(t.data)},r=function(t){o.port2.postMessage(t)}):f&&"onreadystatechange"in f.createElement("script")?(i=f.documentElement,r=function(t){var e=f.createElement("script");e.onreadystatechange=function(){d(t),e.onreadystatechange=null,i.removeChild(e),e=null},i.appendChild(e)}):r=function(t){setTimeout(d,0,t)}:(s="setImmediate$"+Math.random()+"$",u=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(s)&&d(+e.data.slice(s.length))},t.addEventListener?t.addEventListener("message",u,!1):t.attachEvent("onmessage",u),r=function(e){t.postMessage(s+e,"*")}),p.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n",license:"BSD-3-Clause",dependencies:{"better-ajv-errors":"^0.6.1","call-me-maybe":"^1.0.1","js-yaml":"^3.12.0","node-fetch-h2":"^2.3.0","node-readfiles":"^0.2.0","oas-kit-common":"^1.0.6","oas-resolver":"^1.1.1","oas-schema-walker":"^1.1.2","oas-validator":"^2.0.2",reftools:"^1.0.4",yargs:"^12.0.2"},keywords:["swagger","openapi","openapi2","openapi3","converter","conversion","validator","validation","resolver","lint","linter"],gitHead:"90c589f40cb9869c94ebc06a275a4a9a0f6c6c69"}},function(t,e,n){"use strict";n.r(e);n(124); -/** - * @license - * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. - * This code may only be used under the BSD style license found at - * http://polymer.github.io/LICENSE.txt - * The complete set of authors may be found at - * http://polymer.github.io/AUTHORS.txt - * The complete set of contributors may be found at - * http://polymer.github.io/CONTRIBUTORS.txt - * Code distributed by Google as part of the polymer project is also - * subject to an additional IP rights grant found at - * http://polymer.github.io/PATENTS.txt - */const r=new WeakMap,i=t=>"function"==typeof t&&r.has(t),o=void 0!==window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,s=(t,e,n=null)=>{let r=e;for(;r!==n;){const e=r.nextSibling;t.removeChild(r),r=e}},u={},a={},c=`{{lit-${String(Math.random()).slice(2)}}}`,l=`\x3c!--${c}--\x3e`,f=new RegExp(`${c}|${l}`),p="$lit$";class h{constructor(t,e){this.parts=[],this.element=e;let n=-1,r=0;const i=[],o=e=>{const s=e.content,u=document.createTreeWalker(s,133,null,!1);let a=0;for(;u.nextNode();){n++;const e=u.currentNode;if(1===e.nodeType){if(e.hasAttributes()){const i=e.attributes;let o=0;for(let t=0;t=0&&o++;for(;o-- >0;){const i=t.strings[r],o=g.exec(i)[2],s=o.toLowerCase()+p,u=e.getAttribute(s).split(f);this.parts.push({type:"attribute",index:n,name:o,strings:u}),e.removeAttribute(s),r+=u.length-1}}"TEMPLATE"===e.tagName&&o(e)}else if(3===e.nodeType){const t=e.data;if(t.indexOf(c)>=0){const o=e.parentNode,s=t.split(f),u=s.length-1;for(let t=0;t-1!==t.index,v=()=>document.createComment(""),g=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F \x09\x0a\x0c\x0d"'>=\/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/; -/** - * @license - * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. - * This code may only be used under the BSD style license found at - * http://polymer.github.io/LICENSE.txt - * The complete set of authors may be found at - * http://polymer.github.io/AUTHORS.txt - * The complete set of contributors may be found at - * http://polymer.github.io/CONTRIBUTORS.txt - * Code distributed by Google as part of the polymer project is also - * subject to an additional IP rights grant found at - * http://polymer.github.io/PATENTS.txt - */ -class y{constructor(t,e,n){this._parts=[],this.template=t,this.processor=e,this.options=n}update(t){let e=0;for(const n of this._parts)void 0!==n&&n.setValue(t[e]),e++;for(const t of this._parts)void 0!==t&&t.commit()}_clone(){const t=o?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),e=this.template.parts;let n=0,r=0;const i=t=>{const o=document.createTreeWalker(t,133,null,!1);let s=o.nextNode();for(;nnull===t||!("object"==typeof t||"function"==typeof t);class w{constructor(t,e,n){this.dirty=!0,this.element=t,this.name=e,this.strings=n,this.parts=[];for(let t=0;tthis.handleEvent(t))}setValue(t){this._pendingValue=t}commit(){for(;i(this._pendingValue);){const t=this._pendingValue;this._pendingValue=u,t(this)}if(this._pendingValue===u)return;const t=this._pendingValue,e=this.value,n=null==t||null!=e&&(t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive),r=null!=t&&(null==e||n);n&&this.element.removeEventListener(this.eventName,this._boundHandleEvent,this._options),r&&(this._options=U(t),this.element.addEventListener(this.eventName,this._boundHandleEvent,this._options)),this.value=t,this._pendingValue=u}handleEvent(t){"function"==typeof this.value?this.value.call(this.eventContext||this.element,t):this.value.handleEvent(t)}}const U=t=>t&&(C?{capture:t.capture,passive:t.passive,once:t.once}:t.capture); -/** - * @license - * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. - * This code may only be used under the BSD style license found at - * http://polymer.github.io/LICENSE.txt - * The complete set of authors may be found at - * http://polymer.github.io/AUTHORS.txt - * The complete set of contributors may be found at - * http://polymer.github.io/CONTRIBUTORS.txt - * Code distributed by Google as part of the polymer project is also - * subject to an additional IP rights grant found at - * http://polymer.github.io/PATENTS.txt - */const R=new class{handleAttributeExpressions(t,e,n,r){const i=e[0];return"."===i?new A(t,e.slice(1),n).parts:"@"===i?[new E(t,e.slice(1),r.eventContext)]:"?"===i?[new S(t,e.slice(1),n)]:new w(t,e,n).parts}handleTextExpression(t){return new x(t)}}; -/** - * @license - * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. - * This code may only be used under the BSD style license found at - * http://polymer.github.io/LICENSE.txt - * The complete set of authors may be found at - * http://polymer.github.io/AUTHORS.txt - * The complete set of contributors may be found at - * http://polymer.github.io/CONTRIBUTORS.txt - * Code distributed by Google as part of the polymer project is also - * subject to an additional IP rights grant found at - * http://polymer.github.io/PATENTS.txt - */function T(t){let e=q.get(t.type);void 0===e&&(e={stringsArray:new WeakMap,keyString:new Map},q.set(t.type,e));let n=e.stringsArray.get(t.strings);if(void 0!==n)return n;const r=t.strings.join(c);return void 0===(n=e.keyString.get(r))&&(n=new h(t,t.getTemplateElement()),e.keyString.set(r,n)),e.stringsArray.set(t.strings,n),n}const q=new Map,P=new WeakMap; -/** - * @license - * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. - * This code may only be used under the BSD style license found at - * http://polymer.github.io/LICENSE.txt - * The complete set of authors may be found at - * http://polymer.github.io/AUTHORS.txt - * The complete set of contributors may be found at - * http://polymer.github.io/CONTRIBUTORS.txt - * Code distributed by Google as part of the polymer project is also - * subject to an additional IP rights grant found at - * http://polymer.github.io/PATENTS.txt - */ -/** - * @license - * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. - * This code may only be used under the BSD style license found at - * http://polymer.github.io/LICENSE.txt - * The complete set of authors may be found at - * http://polymer.github.io/AUTHORS.txt - * The complete set of contributors may be found at - * http://polymer.github.io/CONTRIBUTORS.txt - * Code distributed by Google as part of the polymer project is also - * subject to an additional IP rights grant found at - * http://polymer.github.io/PATENTS.txt - */ -(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.0.0");const z=(t,...e)=>new m(t,e,"html",R),D=133;function M(t,e){const{element:{content:n},parts:r}=t,i=document.createTreeWalker(n,D,null,!1);let o=k(r),s=r[o],u=-1,a=0;const c=[];let l=null;for(;i.nextNode();){u++;const t=i.currentNode;for(t.previousSibling===l&&(l=null),e.has(t)&&(c.push(t),null===l&&(l=t)),null!==l&&a++;void 0!==s&&s.index===u;)s.index=null!==l?-1:s.index-a,s=r[o=k(r,o)]}c.forEach(t=>t.parentNode.removeChild(t))}const j=t=>{let e=11===t.nodeType?0:1;const n=document.createTreeWalker(t,D,null,!1);for(;n.nextNode();)e++;return e},k=(t,e=-1)=>{for(let n=e+1;n`${t}--${e}`;let L=!0;void 0===window.ShadyCSS?L=!1:void 0===window.ShadyCSS.prepareTemplateDom&&(console.warn("Incompatible ShadyCSS version detected.Please update to at least @webcomponents/webcomponentsjs@2.0.2 and@webcomponents/shadycss@1.3.1."),L=!1);const N=t=>e=>{const n=F(e.type,t);let r=q.get(n);void 0===r&&(r={stringsArray:new WeakMap,keyString:new Map},q.set(n,r));let i=r.stringsArray.get(e.strings);if(void 0!==i)return i;const o=e.strings.join(c);if(void 0===(i=r.keyString.get(o))){const n=e.getTemplateElement();L&&window.ShadyCSS.prepareTemplateDom(n,t),i=new h(e,n),r.keyString.set(o,i)}return r.stringsArray.set(e.strings,i),i},I=["html","svg"],$=new Set,B=(t,e,n)=>{$.add(n);const r=t.querySelectorAll("style");if(0===r.length)return void window.ShadyCSS.prepareTemplateStyles(e.element,n);const i=document.createElement("style");for(let t=0;t{I.forEach(e=>{const n=q.get(F(e,t));void 0!==n&&n.keyString.forEach(t=>{const{element:{content:e}}=t,n=new Set;Array.from(e.querySelectorAll("style")).forEach(t=>{n.add(t)}),M(t,n)})})})(n),function(t,e,n=null){const{element:{content:r},parts:i}=t;if(null==n)return void r.appendChild(e);const o=document.createTreeWalker(r,D,null,!1);let s=k(i),u=0,a=-1;for(;o.nextNode();)for(a++,o.currentNode===n&&(u=j(e),n.parentNode.insertBefore(e,n));-1!==s&&i[s].index===a;){if(u>0){for(;-1!==s;)i[s].index+=u,s=k(i,s);return}s=k(i,s)}}(e,i,e.element.content.firstChild),window.ShadyCSS.prepareTemplateStyles(e.element,n),window.ShadyCSS.nativeShadow){const n=e.element.content.querySelector("style");t.insertBefore(n.cloneNode(!0),t.firstChild)}else{e.element.content.insertBefore(i,e.element.content.firstChild);const t=new Set;t.add(i),M(e,t)}}; -/** - * @license - * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. - * This code may only be used under the BSD style license found at - * http://polymer.github.io/LICENSE.txt - * The complete set of authors may be found at - * http://polymer.github.io/AUTHORS.txt - * The complete set of contributors may be found at - * http://polymer.github.io/CONTRIBUTORS.txt - * Code distributed by Google as part of the polymer project is also - * subject to an additional IP rights grant found at - * http://polymer.github.io/PATENTS.txt - */ -window.JSCompiler_renameProperty=((t,e)=>t);const H={toAttribute(t,e){switch(e){case Boolean:return t?"":null;case Object:case Array:return null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){switch(e){case Boolean:return null!==t;case Number:return null===t?null:Number(t);case Object:case Array:return JSON.parse(t)}return t}},Y=(t,e)=>e!==t&&(e==e||t==t),Z={attribute:!0,type:String,converter:H,reflect:!1,hasChanged:Y},X=Promise.resolve(!0),W=1,J=4,G=8,Q=16,V=32;class K extends HTMLElement{constructor(){super(),this._updateState=0,this._instanceProperties=void 0,this._updatePromise=X,this._hasConnectedResolver=void 0,this._changedProperties=new Map,this._reflectingProperties=void 0,this.initialize()}static get observedAttributes(){this.finalize();const t=[];return this._classProperties.forEach((e,n)=>{const r=this._attributeNameForProperty(n,e);void 0!==r&&(this._attributeToPropertyMap.set(r,n),t.push(r))}),t}static _ensureClassProperties(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_classProperties",this))){this._classProperties=new Map;const t=Object.getPrototypeOf(this)._classProperties;void 0!==t&&t.forEach((t,e)=>this._classProperties.set(e,t))}}static createProperty(t,e=Z){if(this._ensureClassProperties(),this._classProperties.set(t,e),e.noAccessor||this.prototype.hasOwnProperty(t))return;const n="symbol"==typeof t?Symbol():`__${t}`;Object.defineProperty(this.prototype,t,{get(){return this[n]},set(e){const r=this[t];this[n]=e,this._requestUpdate(t,r)},configurable:!0,enumerable:!0})}static finalize(){if(this.hasOwnProperty(JSCompiler_renameProperty("finalized",this))&&this.finalized)return;const t=Object.getPrototypeOf(this);if("function"==typeof t.finalize&&t.finalize(),this.finalized=!0,this._ensureClassProperties(),this._attributeToPropertyMap=new Map,this.hasOwnProperty(JSCompiler_renameProperty("properties",this))){const t=this.properties,e=[...Object.getOwnPropertyNames(t),..."function"==typeof Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t):[]];for(const n of e)this.createProperty(n,t[n])}}static _attributeNameForProperty(t,e){const n=e.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof t?t.toLowerCase():void 0}static _valueHasChanged(t,e,n=Y){return n(t,e)}static _propertyValueFromAttribute(t,e){const n=e.type,r=e.converter||H,i="function"==typeof r?r:r.fromAttribute;return i?i(t,n):t}static _propertyValueToAttribute(t,e){if(void 0===e.reflect)return;const n=e.type,r=e.converter;return(r&&r.toAttribute||H.toAttribute)(t,n)}initialize(){this._saveInstanceProperties(),this._requestUpdate()}_saveInstanceProperties(){this.constructor._classProperties.forEach((t,e)=>{if(this.hasOwnProperty(e)){const t=this[e];delete this[e],this._instanceProperties||(this._instanceProperties=new Map),this._instanceProperties.set(e,t)}})}_applyInstanceProperties(){this._instanceProperties.forEach((t,e)=>this[e]=t),this._instanceProperties=void 0}connectedCallback(){this._updateState=this._updateState|V,this._hasConnectedResolver&&(this._hasConnectedResolver(),this._hasConnectedResolver=void 0)}disconnectedCallback(){}attributeChangedCallback(t,e,n){e!==n&&this._attributeToProperty(t,n)}_propertyToAttribute(t,e,n=Z){const r=this.constructor,i=r._attributeNameForProperty(t,n);if(void 0!==i){const t=r._propertyValueToAttribute(e,n);if(void 0===t)return;this._updateState=this._updateState|G,null==t?this.removeAttribute(i):this.setAttribute(i,t),this._updateState=this._updateState&~G}}_attributeToProperty(t,e){if(this._updateState&G)return;const n=this.constructor,r=n._attributeToPropertyMap.get(t);if(void 0!==r){const t=n._classProperties.get(r)||Z;this._updateState=this._updateState|Q,this[r]=n._propertyValueFromAttribute(e,t),this._updateState=this._updateState&~Q}}_requestUpdate(t,e){let n=!0;if(void 0!==t){const r=this.constructor,i=r._classProperties.get(t)||Z;r._valueHasChanged(this[t],e,i.hasChanged)?(this._changedProperties.has(t)||this._changedProperties.set(t,e),!0!==i.reflect||this._updateState&Q||(void 0===this._reflectingProperties&&(this._reflectingProperties=new Map),this._reflectingProperties.set(t,i))):n=!1}!this._hasRequestedUpdate&&n&&this._enqueueUpdate()}requestUpdate(t,e){return this._requestUpdate(t,e),this.updateComplete}async _enqueueUpdate(){let t,e;this._updateState=this._updateState|J;const n=this._updatePromise;this._updatePromise=new Promise((n,r)=>{t=n,e=r});try{await n}catch(t){}this._hasConnected||await new Promise(t=>this._hasConnectedResolver=t);try{const t=this.performUpdate();null!=t&&await t}catch(t){e(t)}t(!this._hasRequestedUpdate)}get _hasConnected(){return this._updateState&V}get _hasRequestedUpdate(){return this._updateState&J}get hasUpdated(){return this._updateState&W}performUpdate(){this._instanceProperties&&this._applyInstanceProperties();let t=!1;const e=this._changedProperties;try{(t=this.shouldUpdate(e))&&this.update(e)}catch(e){throw t=!1,e}finally{this._markUpdated()}t&&(this._updateState&W||(this._updateState=this._updateState|W,this.firstUpdated(e)),this.updated(e))}_markUpdated(){this._changedProperties=new Map,this._updateState=this._updateState&~J}get updateComplete(){return this._updatePromise}shouldUpdate(t){return!0}update(t){void 0!==this._reflectingProperties&&this._reflectingProperties.size>0&&(this._reflectingProperties.forEach((t,e)=>this._propertyToAttribute(e,this[e],t)),this._reflectingProperties=void 0)}updated(t){}firstUpdated(t){}}K.finalized=!0;const tt="adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,et=Symbol();class nt{constructor(t,e){if(e!==et)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t}get styleSheet(){return void 0===this._styleSheet&&(tt?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}toString(){return this.cssText}}const rt=(t,...e)=>{const n=e.reduce((e,n,r)=>e+(t=>{if(t instanceof nt)return t.cssText;throw new Error(`Value passed to 'css' function must be a 'css' function result: ${t}. Use 'unsafeCSS' to pass non-literal values, but\n take care to ensure page security.`)})(n)+t[r+1],t[0]);return new nt(n,et)}; -/** - * @license - * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. - * This code may only be used under the BSD style license found at - * http://polymer.github.io/LICENSE.txt - * The complete set of authors may be found at - * http://polymer.github.io/AUTHORS.txt - * The complete set of contributors may be found at - * http://polymer.github.io/CONTRIBUTORS.txt - * Code distributed by Google as part of the polymer project is also - * subject to an additional IP rights grant found at - * http://polymer.github.io/PATENTS.txt - */ -(window.litElementVersions||(window.litElementVersions=[])).push("2.0.1");const it=t=>t.flat?t.flat(1/0):function t(e,n=[]){for(let r=0,i=e.length;r(t.add(e),t),new Set).forEach(t=>e.unshift(t))}else t&&e.push(t);return e}initialize(){super.initialize(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow({mode:"open"})}adoptStyles(){const t=this.constructor._styles;0!==t.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?tt?this.renderRoot.adoptedStyleSheets=t.map(t=>t.styleSheet):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(t.map(t=>t.cssText),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)}update(t){super.update(t);const e=this.render();e instanceof m&&this.constructor.render(e,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach(t=>{const e=document.createElement("style");e.textContent=t.cssText,this.renderRoot.appendChild(e)}))}render(){}}ot.finalized=!0,ot.render=((t,e,n)=>{const r=n.scopeName,i=P.has(e),o=e instanceof ShadowRoot&&L&&t instanceof m,u=o&&!$.has(r),a=u?document.createDocumentFragment():e;if(((t,e,n)=>{let r=P.get(e);void 0===r&&(s(e,e.firstChild),P.set(e,r=new x(Object.assign({templateFactory:T},n))),r.appendInto(e)),r.setValue(t),r.commit()})(t,a,Object.assign({templateFactory:N(r)},n)),u){const t=P.get(a);P.delete(a),t.value instanceof y&&B(a,t.value.template,r),s(e,e.firstChild),e.appendChild(a),P.set(e,t)}!i&&o&&window.ShadyCSS.styleElement(e.host)}); -/** - * @license - * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. - * This code may only be used under the BSD style license found at - * http://polymer.github.io/LICENSE.txt - * The complete set of authors may be found at - * http://polymer.github.io/AUTHORS.txt - * The complete set of contributors may be found at - * http://polymer.github.io/CONTRIBUTORS.txt - * Code distributed by Google as part of the polymer project is also - * subject to an additional IP rights grant found at - * http://polymer.github.io/PATENTS.txt - */ -const st=new WeakMap,ut=(t=>(...e)=>{const n=t(...e);return r.set(n,!0),n})(t=>e=>{if(!(e instanceof x))throw new Error("unsafeHTML can only be used in text bindings");const n=st.get(e);if(void 0!==n&&b(t)&&t===n.value&&e.value===n.fragment)return;const r=document.createElement("template");r.innerHTML=t;const i=document.importNode(r.content,!0);e.setValue(i),st.set(e,{value:t,fragment:i})});function at(){const t=function(t,e){e||(e=t.slice(0));return Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}(['']);return at=function(){return t},t}customElements.define("m-logo",class extends ot{render(){return z(at())}});var ct={color:{inputReverseFg:"#fff",inputReverseBg:"#333",headerBg:"#444",getRgb:function(t){if(0===t.indexOf("#")&&(t=t.slice(1)),3===t.length&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),6!==t.length)throw new Error("Invalid HEX color.");return{r:parseInt(t.slice(0,2),16),g:parseInt(t.slice(2,4),16),b:parseInt(t.slice(4,6),16)}},invert:function(t){let e=this.getRgb(t);return.299*e.r+.587*e.g+.114*e.b>186?"#333":"#fff"},opacity:function(t,e){let n=this.getRgb(t);return"rgba(".concat(n.r,", ").concat(n.r,", ").concat(n.r,", ").concat(e,")")},brightness(t,e){let n=this.getRgb(t);return n.r=n.r+e,n.g=n.g+e,n.b=n.b+e,n.r>255?n.r=255:n.r<0&&(n.r=0),n.g>255?n.g=255:n.g<0&&(n.g=0),n.b>255?n.b=255:n.b<0&&(n.b=0),"#".concat(n.r.toString(16).padStart(2,"0")).concat(n.g.toString(16).padStart(2,"0")).concat(n.b.toString(16).padStart(2,"0"))}}},lt=n(2),ft=n.n(lt);function pt(){const t=function(t,e){e||(e=t.slice(0));return Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}([""]);return pt=function(){return t},t}var ht=z(pt());function dt(){const t=xt(['',""]);return dt=function(){return t},t}function vt(){const t=xt(['"','"']);return vt=function(){return t},t}function gt(){const t=xt(["",":"]);return gt=function(){return t},t}function yt(){const t=xt(['
    ',"","
    "]);return yt=function(){return t},t}function mt(){const t=xt(['
    ','
    ','
    ',"
    "]);return mt=function(){return t},t}function bt(){const t=xt(["",""]);return bt=function(){return t},t}function wt(){const t=xt(['
    null
    ']);return wt=function(){return t},t}function _t(){const t=xt(["",'
    ',"
    "]);return _t=function(){return t},t}function xt(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}function St(){const t=Lt(["",""]);return St=function(){return t},t}function At(){const t=Lt(["",""]);return At=function(){return t},t}function Ot(){const t=Lt(['
    ',"
    "]);return Ot=function(){return t},t}function Ct(){const t=Lt(["",""]);return Ct=function(){return t},t}function Et(){const t=Lt(["",""]);return Et=function(){return t},t}function Ut(){const t=Lt(['',""]);return Ut=function(){return t},t}function Rt(){const t=Lt(["",":"]);return Rt=function(){return t},t}function Tt(){const t=Lt(['
    '," ","
    "]);return Tt=function(){return t},t}function qt(){const t=Lt(["",""]);return qt=function(){return t},t}function Pt(){const t=Lt(['',""]);return Pt=function(){return t},t}function zt(){const t=Lt(['
    ',"
    ",'
    ','
    ',"
    "]);return zt=function(){return t},t}function Dt(){const t=Lt(["[ ]"]);return Dt=function(){return t},t}function Mt(){const t=Lt(['{ } ',""]);return Mt=function(){return t},t}function jt(){const t=Lt(["",""]);return jt=function(){return t},t}function kt(){const t=Lt(['
    null
    ']);return kt=function(){return t},t}function Ft(){const t=Lt(["",'
    ',"
    "]);return Ft=function(){return t},t}function Lt(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}customElements.define("json-tree",class extends ot{render(){return z(_t(),ht,this.generateTree(this.data))}static get properties(){return{data:{type:Object}}}generateTree(t){if(null===t)return z(wt());if("object"==typeof t){let e=Array.isArray(t)?"array":"pure_object";return 0===Object.keys(t).length?z(bt(),Array.isArray(t)?"[ ]":"{ }"):z(mt(),"array"===e?"array":"object",this.toggleExpand,"array"===e?"[":"{",Object.keys(t).map(n=>z(yt(),"pure_object"===e?z(gt(),n):"",this.generateTree(t[n]))),"array"===e?"]":"}")}return z("string"==typeof t?vt():dt(),typeof t,t)}toggleExpand(t){t.target.classList.contains("expanded")?(t.target.classList.add("collapsed"),t.target.classList.remove("expanded"),t.target.innerHTML=t.target.classList.contains("array")?"[...]":"{...}",t.target.nextElementSibling.style.display="none",t.target.nextElementSibling.nextElementSibling.style.display="none"):(t.target.classList.remove("collapsed"),t.target.classList.add("expanded"),t.target.innerHTML=t.target.classList.contains("array")?"[":"{",t.target.nextElementSibling.style.display="block",t.target.nextElementSibling.nextElementSibling.style.display="block")}});function Nt(){const t=$t([".tags{\n display:flex;\n flex-wrap: wrap;\n outline: none;\n padding:0;\n border-radius:var(--border-radius);\n border:1px solid var(--input-border-color);\n cursor:text;\n overflow:hidden;\n }\n .tag, .editor{\n padding:3px;\n margin:2px;\n }\n .tag{\n border:1px solid var(--border-color);\n background-color:var(--bg2);\n color:var(--fg2);\n border-radius:var(--border-radius);\n word-break: break-all;\n cursor: none;\n }\n .tag:hover ~ #cursor {\n display: block;\n }\n .editor{\n flex:1;\n border:1px solid transparent;\n background:var(--input-bg);\n color:var(--fg);\n min-width:60px;\n outline: none;\n line-height: inherit;\n font-family:inherit;\n font-size:inherit;\n }\n .editor::placeholder {\n color: var(--placeholder-color);\n opacity:1;\n }"]);return Nt=function(){return t},t}function It(){const t=$t(['
    ']);return It=function(){return t},t}function $t(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}customElements.define("schema-tree",class extends ot{render(){return z(Ft(),ht,this.generateTree(this.data))}static get properties(){return{data:{type:Object}}}generateTree(t){if(null===t)return z(kt());if("object"==typeof t){let e=Array.isArray(t)?"array":"pure_object";return 0===Object.keys(t).length?z(jt(),Array.isArray(t)?"[ ]":"{ }"):1===Object.keys(t).length&&":description"===Object.keys(t)[0]?z(Mt(),t[":description"]):"array"===e&&"~|~"===t[0]?z(Dt()):z(zt(),"array"===e?"array":"object",this.toggleExpand,"array"===e?"[":"{",t[":description"]?z(Pt(),t[":description"]):"",Object.keys(t).map(n=>z(qt(),":description"!==n?z(Tt(),"pure_object"===e?z(Rt(),n):"",this.generateTree(t[n])):"")),"array"===e?"]":"}")}return z(Ut(),t?z(Et(),t.split("~|~").map((t,e)=>z(Ct(),t?z(Ot(),0==e?"item-type "+t.substring(0,4):"m-markdown-small item-descr",0==e?z(At(),t):z(St(),ut(ft()(t)))):""))):"")}toggleExpand(t){t.target.classList.contains("expanded")?(t.target.classList.add("collapsed"),t.target.classList.remove("expanded"),t.target.innerHTML=t.target.classList.contains("array")?"[...]":"{...}",t.target.parentNode.querySelectorAll(":scope > .obj-content-part").forEach(t=>t.style.display="none")):(t.target.classList.remove("collapsed"),t.target.classList.add("expanded"),t.target.innerHTML=t.target.classList.contains("array")?"[":"{",t.target.parentNode.querySelectorAll(":scope > .obj-content-part").forEach(t=>t.style.display=t.classList.contains("obj-descr")?"inline":"block"))}});function Bt(){const t=function(t,e){e||(e=t.slice(0));return Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}([""]);return Bt=function(){return t},t}customElements.define("tag-input",class extends ot{render(){return z(It(),this.afterPaste,this.afterKeyDown,this.placeholder)}static get styles(){return[rt(Nt())]}static get properties(){return{placeholder:{type:String}}}afterPaste(t){let e=(t.clipboardData||window.clipboardData).getData("Text");console.log(e)}afterKeyDown(t){if(13===t.keyCode){t.stopPropagation(),t.preventDefault();let e=document.createElement("span");""!==t.target.value.trim()&&(e.innerText=t.target.value,t.target.value="",e.classList.add("tag"),e.setAttribute("contenteditable","false"),this.shadowRoot.querySelector(".tags").insertBefore(e,t.target))}else 8===t.keyCode&&0===t.target.selectionStart&&t.target.previousSibling&&t.target.previousSibling.remove()}getValues(){let t=[],e=this.shadowRoot.querySelectorAll(".tag");for(let n of e)t.push(n.innerText);return t}});var Ht=z(Bt());function Yt(){const t=function(t,e){e||(e=t.slice(0));return Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}([""]);return Yt=function(){return t},t}var Zt=z(Yt());function Xt(){const t=function(t,e){e||(e=t.slice(0));return Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}(['']);return Xt=function(){return t},t}var Wt=z(Xt(),ct.color.inputReverseBg,ct.color.inputReverseFg);function Jt(){const t=function(t,e){e||(e=t.slice(0));return Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}([""]);return Jt=function(){return t},t}var Gt=z(Jt());function Qt(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!t)return;let n={hasCircularRefs:"circular"===t.type,format:t.format?t.format:"",pattern:t.pattern&&!t.enum?t.pattern:"",readOnly:t.readOnly?"🆁 ":"",writeOnly:t.writeOnly?"🆆 ":"",depricated:t.deprecated?"❌ ":"",default:0==t.default?"0 ":t.default?t.default:"",type:"",arrayType:"",allowedValues:"",constrain:"",html:""};if(n.hasCircularRefs)return n;if(t.enum){let e="";t.enum.map(function(t){e+="".concat(t,", ")}),n.type="enum",n.allowedValues=e.slice(0,-2)}else t.type&&(n.type=t.type);if("array"===t.type&&t.items){let e=t.items;if(n.arrayType="".concat(t.type," of ").concat(e.type),n.default=0==e.default?"0 ":e.default?e.default:"",e.enum){let t="";e.enum.map(function(e){t+="".concat(e,", ")}),n.allowedValues=t.slice(0,-2)}}else"integer"===t.type||"number"===t.type?(void 0!==t.minimum&&void 0!==t.maximum?n.constrain="".concat(t.exclusiveMinimum?">":"").concat(t.minimum," ⋯ ").concat(t.exclusiveMaximum?"<":""," ").concat(t.maximum):void 0!==t.minimum&&void 0===t.maximum?n.constrain="".concat(t.exclusiveMinimum?">":"≥").concat(t.minimum):void 0===t.minimum&&void 0!==t.maximum&&(n.constrain="".concat(t.exclusiveMaximum?"<":"≤").concat(t.maximum)),void 0!==t.multipleOf&&(n.constrain="(multiple of ".concat(t.multipleOf,")"))):"string"===t.type&&(void 0!==t.minLength&&void 0!==t.maxLength?n.constrain="(".concat(t.minLength," to ").concat(t.maxLength," chars)"):void 0!==t.minLength&&void 0===t.maxLength?n.constrain="(min:".concat(t.minLength," chars)"):void 0===t.minLength&&void 0!==t.maxLength&&(n.constrain="(max:".concat(t.maxLength," chars)")));e&&(e.readOnly&&(n.readOnly="🆁 "),e.writeOnly&&(n.writeOnly="🆆 "),e.deprecated&&(n.deprecated="❌ "));let r="".concat(n.type);return n.allowedValues&&(r+=":(".concat(n.allowedValues,")")),n.readOnly&&(r+=" 🆁"),n.writeOnly&&(r+=" 🆆"),n.deprecated&&(r+=" ❌"),n.constrain&&(r+=" ".concat(n.constrain)),n.format&&(r+=" ".concat(n.format)),n.pattern&&(r+=" ".concat(n.pattern)),n.html=r,n}function Vt(t,e){if(null!=t){if("object"===t.type||t.properties){t.description&&(e[":description"]=t.description);for(let n in t.properties)t.required&&t.required.includes(n)?e[n+"*"]=Vt(t.properties[n],{}):e[n]=Vt(t.properties[n],{})}else if("array"===t.type||t.items)e=[Vt(t.items,{})];else{if(!t.allOf)return"".concat(Qt(t).html,"~|~").concat(t.description?t.description:"");{if(1===t.allOf.length){if(t.allOf[0]){let e={readOnly:t.readOnly,writeOnly:t.writeOnly,deprecated:t.deprecated};return"".concat(Qt(t.allOf[0],e).html,"~|~").concat(t.description?t.description:"")}return"string~|~".concat(t.description?t.description:"")}let n={};t.allOf.map(function(t){if(t&&t.properties){let e=Vt(t,{});Object.assign(n,e)}}),e=n}}return e}}function Kt(t,e,n,r,i){let o=[];if(t)for(let e in t){let n="";n=r.toLowerCase().includes("json")&&"text"===i?JSON.stringify(t[e].value,void 0,2):t[e].value,o.push({exampleType:r,exampleValue:n})}else if(e){let t="";t=r.toLowerCase().includes("json")&&"text"===i?JSON.stringify(e,void 0,2):e,o.push({exampleType:r,exampleValue:t})}if(0==o.length)if(n)if(r.toLowerCase().includes("json")||r.toLowerCase().includes("*/*")){let t=function t(e,n){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null==e)return;if("object"===e.type||e.properties)for(let i in e.properties)e.properties[i].deprecated||e.properties[i].readOnly&&!r.includeReadOnly||e.properties[i].writeOnly&&!r.includeWriteOnly||(n[i]=t(e.properties[i],{},r));else if("array"===e.type||e.items)n=[t(e.items,{},r)];else{if(!e.allOf)return te(e);{if(1===e.allOf.length)return e.allOf[0]?te(e.allOf[0]):"string";let i={};e.allOf.map(function(e){if(e&&e.type){let n=t(e,{},r);Object.assign(i,n)}}),n=i}}return n}(n,{},{includeReadOnly:!0,includeWriteOnly:!0,deprecated:!0});o.push({exampleType:r,exampleValue:"text"===i?JSON.stringify(t,void 0,2):t})}else o.push({exampleType:r,exampleValue:""});else o.push({exampleType:r,exampleValue:""});return o}function te(t){if(t.example)return t.example;if(0===Object.keys(t).length)return null;switch(t.format||t.type||(t.enum?"enum":null)){case"int32":case"int64":case"integer":return 0;case"float":case"double":case"number":return.5;case"string":return t.enum?t.enum[0]:t.pattern?t.pattern:"string";case"byte":return btoa("string");case"binary":return"binary";case"boolean":return!1;case"date":return new Date(0).toISOString().split("T")[0];case"date-time":case"dateTime":return new Date(0).toISOString();case"password":return"password";case"enum":return t.enum[0];case"uri":return"http://example.com";case"uuid":return"3fa85f64-5717-4562-b3fc-2c963f66afa6";case"email":return"user@example.com";case"hostname":return"example.com";case"ipv4":return"198.51.100.42";case"ipv6":return"2001:0db8:5b96:0000:0000:426f:8e17:642a";case"circular":return"CIRCULAR REF";default:return t.nullable?null:t.$ref?"data of type ".concat(t.$ref):(console.warn("Unknown schema value",t),"?")}}function ee(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;const e=new WeakSet;return(n,r)=>{if("object"==typeof r&&null!==r){if(e.has(r)){if(t>0)return{};{let n=JSON.parse(JSON.stringify(r,ee(t+1)));return e.add(n),n}}e.add(r)}return r}}function ne(){const t=ze(['"]);return ne=function(){return t},t}function re(){const t=ze(['
    ']);return re=function(){return t},t}function ie(){const t=ze(['
    Response Status: ','
    ','
    "]);return ie=function(){return t},t}function oe(){const t=ze(['
    No Authentication Token provided
    ']);return oe=function(){return t},t}function se(){const t=ze(['
    Authentication:  
    send
    \'',"'
    in
    '","'
    with value
    '","'
    "]);return se=function(){return t},t}function ue(){const t=ze(['
    Not Set
    ']);return ue=function(){return t},t}function ae(){const t=ze(["",""]);return ae=function(){return t},t}function ce(){const t=ze(['
    API_Server:
    ','
    ','
    ',""]);return ce=function(){return t},t}function le(){const t=ze(['']);return le=function(){return t},t}function fe(){const t=ze(['']);return fe=function(){return t},t}function pe(){const t=ze([""," ",""]);return pe=function(){return t},t}function he(){const t=ze(["",""]);return he=function(){return t},t}function de(){const t=ze(['
    ','
    ','
    ']);return de=function(){return t},t}function ve(){const t=ze(["",""]);return ve=function(){return t},t}function ge(){const t=ze(['
    '," DATA ","
    "," ",""]);return ge=function(){return t},t}function ye(){const t=ze(['
    ',"
    "]);return ye=function(){return t},t}function me(){const t=ze(['',""]);return me=function(){return t},t}function be(){const t=ze(['']);return be=function(){return t},t}function we(){const t=ze([''],['']);return we=function(){return t},t}function _e(){const t=ze(['
    ','
    ','
    ','
    ',""]);return _e=function(){return t},t}function xe(){const t=ze(['
    ',"
    "]);return xe=function(){return t},t}function Se(){const t=ze(['
    ','
    ',"
    "]);return Se=function(){return t},t}function Ae(){const t=ze(['',""]);return Ae=function(){return t},t}function Oe(){const t=ze(["",""]);return Oe=function(){return t},t}function Ce(){const t=ze(["","
    "]);return Ce=function(){return t},t}function Ee(){const t=ze(['']);return Ee=function(){return t},t}function Ue(){const t=ze([''],['']);return Ue=function(){return t},t}function Re(){const t=ze(['*']);return Re=function(){return t},t}function Te(){const t=ze(['
    ',"",'
    ','
    ','
    '," ","
    ",""]);return Te=function(){return t},t}function qe(){const t=ze(["",""]);return qe=function(){return t},t}function Pe(){const t=ze([""," "," "," "," ",'
    REQUEST
    '," "," "," "," "," ","
    "]);return Pe=function(){return t},t}function ze(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}function De(){const t=He(['
    ','
    ']);return De=function(){return t},t}function Me(){const t=He(['
    Content-Type: '," (Binary Data)
    "]);return Me=function(){return t},t}function je(){const t=He(['
    EXAMPLE: ',""]);return je=function(){return t},t}function ke(){const t=He(['',''," ",""]);return ke=function(){return t},t}function Fe(){const t=He(['
    Response Headers:
    ',"
    "]);return Fe=function(){return t},t}function Le(){const t=He(['
    ',': '," ","
    ",""]);return Le=function(){return t},t}function Ne(){const t=He(["",""]);return Ne=function(){return t},t}function Ie(t){for(var e=1;e.title{\n font-family:var(--font-regular);\n font-size:var(--title-font-size);\n font-weight:bold;\n margin-bottom:8px;\n }\n .resp-head{\n vertical-align: middle;\n padding:16px 0 8px;\n }\n .resp-head.divider{\n border-top: 1px solid var(--border-color);\n margin-top:10px;\n }\n .resp-status{ \n font-weight:bold;\n font-size:calc(var(--small-font-size) + 1px);\n }\n .resp-descr{\n font-size:calc(var(--small-font-size) + 1px);\n color:var(--light-fg);\n }\n .top-gap{margin-top:16px;}\n .tab-buttons{\n height:30px;\n border-bottom: 1px solid var(--light-border-color) ;\n align-items: stretch;\n }\n .tab-btn{\n color:var(--fg);\n border:none;\n background-color:transparent;\n cursor:pointer;\n padding:1px;\n outline:none;\n font-size:var(--small-font-size);\n margin-right:16px;\n padding:1px;\n }\n .tab-btn.active{\n border-bottom: 3px solid var(--primary-color);\n font-weight:bold;\n color:var(--primary-color);\n }\n\n .tab-btn:hover{\n color:var(--primary-color);\n }\n .tab-content{\n margin:-1px 0 0 0;\n }\n .descr-text{\n color:var(--light-fg);\n font-family:var(--font-regular);\n }\n .tree{\n padding:16px 2px;\n }\n @media only screen and (min-width: 768px){\n .tree {\n padding:16px;\n }\n }
    RESPONSE
    ',"
    "]);return Be=function(){return t},t}function He(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}customElements.define("api-request",class extends ot{render(){return z(Pe(),Ht,Wt,ht,Zt,Gt,this.inputParametersTemplate("path"),this.inputParametersTemplate("query"),this.requestBodyTemplate(),this.inputParametersTemplate("header"),this.inputParametersTemplate("cookie"),"false"===this.allowTry?"":z(qe(),this.apiCallTemplate()))}constructor(){super(),this.responseMessage="",this.responseStatus="success",this.responseHeaders="",this.responseText="",this.responseUrl="",this.curlSyntax=""}static get properties(){return{apiKeyName:{type:String,attribute:"api-key-name"},apiKeyValue:{type:String,attribute:"api-key-value"},apiKeyLocation:{type:String,attribute:"api-key-location"},selectedServer:{type:String,attribute:"selected-server"},method:{type:String},path:{type:String},parameters:{type:Array},request_body:{type:Object},parser:{type:Object},accept:{type:String},responseMessage:{type:String,attribute:!1},responseText:{type:String,attribute:!1},responseHeaders:{type:String,attribute:!1},responseStatus:{type:String,attribute:!1},responseUrl:{type:String,attribute:!1},allowTry:{type:String,attribute:"allow-try"}}}inputParametersTemplate(t){let e="",n=this.parameters?this.parameters.filter(e=>e.in===t):[];if(0==n.length)return"";"path"===t?e="PATH PARAMETERS":"query"===t?e="QUERY-STRING PARAMETERS":"header"===t?e="REQUEST HEADERS":"cookie"===t&&(e="COOKIES");const r=[];for(const e of n){if(!e.schema)continue;let n=Qt(e.schema),i="";i=e.example?"0"==e.example||0==e.example?"0":e.example:n.default,r.push(z(Te(),e.required?z(Re()):"",e.name,"array"===n.type?"".concat(n.arrayType):"".concat(n.type).concat(n.format?" (".concat(n.format,")"):""),"array"===n.type?z(Ue(),t,e.name):z(Ee(),e.name,t,i),n.constrain?z(Ce(),n.constrain):"",n.allowedValues?z(Oe(),n.allowedValues):"",e.description?z(Ae(),ut(ft()(e.description))):""))}return z(Se(),e,r)}requestBodyTemplate(){if(!this.request_body)return"";if(0==Object.keys(this.request_body).length)return"";let t=0,e={},n=this.request_body.description?z(xe(),ut(ft()(this.request_body.description))):"",r="",i="";const o=[];let s=!1,u="",a=this.request_body.content;for(let n in a){n.includes("json")?e[n]="json":n.includes("xml")?e[n]="xml":n.includes("text/plain")?e[n]="text":n.includes("form-urlencoded")?e[n]="form-urlencoded":n.includes("multipart/form-data")&&(e[n]="multipart-form-data");let c=a[n],l="";if(n.includes("json")||n.includes("xml")||n.includes("text/plain")){try{c.schema=JSON.parse(JSON.stringify(c.schema,ee()))}catch(t){return void console.error("Unable to resolve circular refs in schema",c.schema)}u=Vt(c.schema,{}),l=Kt(c.schema?c.schema.examples:"",c.schema?c.schema.example:"",c.schema,n,"text"),r+='\n ")}else if(n.includes("form")||n.includes("multipart-form")){s=!0;for(const t in c.schema.properties){const e=c.schema.properties[t],n=e.type,r="array"===e.type?e.items.type:"";o.push(z(_e(),t,"array"===n?"".concat(n," of ").concat(r):"".concat(n," ").concat(e.format?" (".concat(e.format,")"):""),"array"===n?z(we(),n,t):z(be(),"binary"===e.format?"file":"text",t,n),e.description?z(me(),ut(ft()(e.description))):""))}i=z(ye(),e[n],o)}t++}return z(ge(),s?"form_data":"body_data",s?"FORM":"BODY",this.request_body.required?"(required)":"",n,s?z(ve(),i):z(de(),this.activateTab,1==t?"\n ".concat(Object.keys(e)[0],"\n "):z(he(),Object.keys(e).map(t=>z(pe(),"json"===e[t]?z(fe(),e[t],this.onMimeTypeChange):z(le(),e[t],this.onMimeTypeChange),e[t]))),ut(r),u))}apiCallTemplate(){return z(ce(),this.selectedServer?z(ae(),this.selectedServer):z(ue()),this.apiKeyValue&&this.apiKeyName?z(se(),this.apiKeyName,this.apiKeyLocation,this.apiKeyValue.substring(0,3)+"***"):z(oe()),this.onTryClick,""===this.responseMessage?"":z(ie(),this.responseStatus,this.responseMessage,this.clearResponseData,this.activateTab,this.responseIsBlob?z(re(),this.downloadResponseBlob):z(ne(),this.responseText),this.responseHeaders,this.curlSyntax))}activateTab(t){if(t.target.classList.contains("active")||!1===t.target.classList.contains("tab-btn"))return;let e=t.currentTarget.parentNode.querySelector(".tab-btn.active"),n=t.target;e.classList.remove("active"),t.target.classList.add("active");let r=this.shadowRoot.getElementById(n.attributes.content_id.value),i=t.currentTarget.parentNode.querySelectorAll(".tab-content");r&&(r.style.display="flex",i.forEach(function(t){t.attributes.id.value!==n.attributes.content_id.value&&(t.style.display="none")}))}onMimeTypeChange(t){[...t.target.closest(".tab-panel").querySelectorAll("textarea.request-body-param")].map(function(e){e.style.display=e.classList.contains(t.target.value)?"block":"none"})}onTryClick(t){let e,n,r,i=this,o="",s="",u="",a="",c=t.target.closest(".request-panel"),l=[...c.querySelectorAll(".request-param[data-ptype='path']")],f=[...c.querySelectorAll(".request-param[data-ptype='query']")],p=[...c.querySelectorAll(".request-param[data-ptype='header']")],h=[...c.querySelectorAll(".request-form-param")],d=[...c.querySelectorAll(".request-body-param")];if(e=i.path,n={mode:"cors",method:this.method.toUpperCase(),headers:{}},l.map(function(t){e=e.replace("{"+t.dataset.pname+"}",encodeURIComponent(t.value))}),f.length>0){let t=new URLSearchParams("");f.map(function(e){if("false"===e.dataset.array)""!==e.value&&t.append(e.dataset.pname,encodeURIComponent(e.value));else{let n=e.getValues();for(let r of n)t.append(e.dataset.pname,encodeURIComponent(r))}}),e="".concat(e,"?").concat(t.toString())}if(this.apiKeyValue&&this.apiKeyName&&"query"===this.apiKeyLocation&&(e="".concat(e,"&").concat(this.apiKeyName,"=").concat(encodeURIComponent(this.apiKeyValue))),r=!1===(e="".concat(this.selectedServer.replace(/\/$/,"")).concat(e)).startsWith("http")?new URL(e,location.href).href:e,o="curl -X ".concat(this.method.toUpperCase(),' "').concat(r,'" '),this.accept&&(n.headers.Accept=this.accept,s+=' -H "Accept: '.concat(this.accept,'"')),p.map(function(t){t.value&&(n.headers[t.dataset.pname]=t.value,s+=' -H "'.concat(n.headers[t.dataset.pname],": ").concat(t.value,'"'))}),this.apiKeyValue&&this.apiKeyName&&"header"===this.apiKeyLocation&&(n.headers[this.apiKeyName]=this.apiKeyValue,s+=' -H "'.concat(this.apiKeyName,": ").concat(this.apiKeyValue,'"')),h.length>=1){let t=c.querySelector("form");const e=new URLSearchParams,r=new FormData;h.map(function(t){if("false"===t.dataset.array)"file"!==t.type?""!==t.value&&(e.append(t.dataset.pname,t.value),r.append(t.dataset.pname,t.value),a+=' -F "'.concat(t.dataset.pname,"=").concat(t.value,'"')):t.files[0]&&(e.append(t.dataset.pname,t.files[0]),r.append(t.dataset.pname,t.files[0]),a+=' -F "'.concat(t.dataset.pname,"=@").concat(t.value,'"'));else{let n=t.getValues();for(let i of n)e.append(t.dataset.pname,i),r.append(t.dataset.pname,i),a+=' -F "'.concat(t.dataset.pname,"=").concat(i,'"')}}),t.classList.contains("form-urlencoded")?(n.headers["Content-Type"]="application/x-www-form-urlencoded; charset=utf-8",s+=' -H "Content-Type: application/x-www-form-urlencoded"',n.body=e):(s+=' -H "Content-Type: multipart/form-data"',n.body=r)}if(d.length>=1)if(1===d.length)n.headers["Content-Type"]=d[0].dataset.ptype,s+=' -H "Content-Type: '.concat(d[0].dataset.ptype,'"'),n.body=d[0].value,u=" -d ".concat(JSON.stringify(d[0].value.replace(/(\r\n|\n|\r)/gm,"")));else{let e=t.target.closest(".request-panel").querySelector("input[name='request_body_type']:checked"),r=null===e?"json":e.value,i="";"json"===r?(i=c.querySelector(".request-body-param.json").value,n.headers["Content-Type"]="application/json; charset=utf-8",s+=' -H "Content-Type: application/json"'):"xml"===r?(i=c.querySelector(".request-body-param.xml").value,n.headers["Content-Type"]="application/xml; charset=utf-8",s+=' -H "Content-Type: application/xml"'):"text"===r&&(i=c.querySelector(".request-body-param.text").value,n.headers["Content-Type"]="text/plain; charset=utf-8",s+=' -H "Content-Type: text/plain"'),n.body=i,u=" -d ".concat(JSON.stringify(i.replace(/(\r\n|\n|\r)/gm,"")))}i.responseUrl="",i.responseHeaders="",i.curlSyntax="",i.responseStatus="success",i.responseIsBlob=!1,i.respContentDisposition="",i.responseBlobUrl&&(URL.revokeObjectURL(i.responseBlobUrl),i.responseBlobUrl=""),i.curlSyntax="".concat(o," ").concat(s," ").concat(u," ").concat(a),fetch(e,n).then(function(t){i.responseStatus=t.ok?"success":"error",i.responseMessage="".concat(t.statusText,":").concat(t.status),i.responseUrl=t.url,t.headers.forEach(function(t,e){i.responseHeaders=i.responseHeaders+"".concat(e.trim(),": ").concat(t)+"\n"});let e=t.headers.get("content-type");if(e)if(e.includes("json"))t.json().then(function(t){i.responseText=JSON.stringify(t,null,2)});else if(e.includes("octet-stream")){i.responseIsBlob=!0;let e=t.headers.get("content-disposition");i.respContentDisposition=e?e.split("filename=")[1]:"filename",t.blob().then(function(t){i.responseBlobUrl=URL.createObjectURL(t)})}else t.text().then(function(t){i.responseText=t});else t.text().then(function(t){i.responseText=t})}).catch(function(t){i.responseMessage=t.message+" (CORS or Network Issue)"})}downloadResponseBlob(){if(this.responseBlobUrl){let t=document.createElement("a");document.body.appendChild(t),t.style="display: none",t.href=this.responseBlobUrl,t.download=this.respContentDisposition,t.click(),t.remove()}}clearResponseData(){this.responseUrl="",this.responseHeaders="",this.responseText="",this.responseStatus="success",this.responseMessage="",this.responseIsBlob=!1,this.respContentDisposition="",this.responseBlobUrl&&(URL.revokeObjectURL(this.responseBlobUrl),this.responseBlobUrl="")}disconnectedCallback(){this.responseBlobUrl&&(URL.revokeObjectURL(this.responseBlobUrl),this.responseBlobUrl="")}});function Ye(){const t=tn([".only-large-screen {\n display:none;\n }\n\n .head .path{\n display: flex;\n font-family:var(--font-mono);\n font-size: var(--small-font-size);\n align-items: center;\n overflow-wrap: break-word;\n word-break: break-all;\n }\n\n .head .descr{\n font-size: var(--small-font-size);\n color:var(--light-fg);\n font-weight:400;\n align-items: center;\n overflow-wrap: break-word;\n word-break: break-all;\n display:none;\n }\n\n .m-endpoint.expanded{margin-bottom:16px; }\n .m-endpoint > .head{\n border-width:1px 1px 1px 5px;\n border-style:solid;\n border-color:transparent;\n border-top-color:var(--light-border-color);\n display:flex;\n padding:6px 16px;\n align-items: center;\n cursor: pointer;\n }\n .m-endpoint > .head.put:hover,\n .m-endpoint > .head.put.expanded{\n border-color:var(--put-color); \n background-color:var(--light-put-color); \n }\n .m-endpoint > .head.post:hover,\n .m-endpoint > .head.post.expanded{\n border-color:var(--post-color); \n background-color:var(--light-post-color); \n }\n .m-endpoint > .head.get:hover,\n .m-endpoint > .head.get.expanded{\n border-color:var(--get-color); \n background-color:var(--light-get-color); \n }\n .m-endpoint > .head.delete:hover,\n .m-endpoint > .head.delete.expanded{\n border-color:var(--delete-color); \n background-color:var(--light-delete-color); \n }\n .m-endpoint > .head.patch:hover,\n .m-endpoint > .head.patch.expanded{\n border-color:var(--patch-color); \n background-color:var(--light-patch-color); \n }\n .m-endpoint .body {\n flex-wrap:wrap;\n padding:16px 0px 0 0px;\n border-width:0px 1px 1px 5px;\n border-style:solid;\n box-shadow: 0px 4px 3px -3px rgba(0, 0, 0, 0.15);\n }\n .m-endpoint .body.delete{ border-color:var(--delete-color); }\n .m-endpoint .body.patch{ border-color:var(--patch-color); }\n .m-endpoint .body.put{ border-color:var(--put-color); }\n .m-endpoint .body.post{border-color:var(--post-color);}\n .m-endpoint .body.get{ border-color:var(--get-color); }\n\n .head .deprecated{\n text-decoration: line-through red;\n }\n\n .summary{\n padding:8px 8px;\n }\n .summary .title{\n font-size:calc(var(--title-font-size) + 2px);\n margin-bottom: 6px;\n word-break: break-all;\n }\n\n .method{\n padding:2px 5px;\n vertical-align: middle;\n height: 20px;\n line-height: 20px;\n min-width: 48px;\n border-radius: 2px;\n display:inline-block;\n font-size:var(--small-font-size);\n text-align: center;\n font-weight: bold;\n text-transform:uppercase;\n margin-right:5px;\n }\n .method.delete{ border: 2px solid var(--delete-color);}\n .method.patch{ border: 2px solid var(--patch-color); }\n .method.put{ border: 2px solid var(--put-color); }\n .method.post{ border: 2px solid var(--post-color); }\n .method.get{ border: 2px solid var(--get-color); }\n\n .req-resp-container{\n display: flex;\n margin-top:16px;\n align-items: stretch;\n flex-wrap: wrap;\n flex-direction: column;\n border-top:1px solid var(--light-border-color);\n }\n .request,\n .response{\n flex:1; \n min-height:100px;\n padding:16px 8px;\n overflow:hidden;\n }\n .request{\n border-width:0 0 1px 0;\n border-style:dashed;\n }\n .patch .request{ \n border-color:var(--patch-color); \n }\n .put .request{ \n border-color:var(--put-color); \n }\n .post .request{ \n border-color:var(--post-color); \n }\n .get .request{ \n border-color:var(--get-color); \n }\n .delete .request{ \n border-color:var(--delete-color); \n }\n\n\n @media only screen and (min-width: 768px){\n .head .path{\n font-size: var(--regular-font-size);\n min-width:400px;\n }\n .head .descr{\n display: flex;\n }\n .head .m-markdown-small,\n .descr .m-markdown-small{\n display:block;\n }\n .only-large-screen{\n display:block;\n }\n .req-resp-container{\n flex-direction: var(--layout, row);\n }\n .request{\n border-width:0 1px 0 0;\n padding:16px 24px;\n }\n .response{\n padding:16px 24px;\n } \n .summary{\n padding:8px 24px;\n }\n }"]);return Ye=function(){return t},t}function Ze(){const t=tn(['
    ',"
    "]);return Ze=function(){return t},t}function Xe(){const t=tn(['
    ',"
    ","
    "]);return Xe=function(){return t},t}function We(){const t=tn(['
    ','
    ']);return We=function(){return t},t}function Je(){const t=tn(['deprecated']);return Je=function(){return t},t}function Ge(){const t=tn([""]);return Ge=function(){return t},t}function Qe(){const t=tn([""]);return Qe=function(){return t},t}function Ve(){const t=tn(["",""]);return Ve=function(){return t},t}function Ke(){const t=tn(["","",'
    \x3c!-- Endpoint Head --\x3e
    ','
    ',"
    ",'
    ',"
    \x3c!-- Endpoint Body --\x3e ","
    "]);return Ke=function(){return t},t}function tn(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}customElements.define("api-response",class extends ot{render(){return z(Be(),ht,Zt,Ht,Wt,this.responseTemplate())}static get properties(){return{responses:{type:Object},parser:{type:Object}}}responseTemplate(){let t={},e={},n="",r={};for(let i in this.responses){let o={},s=0;for(let e in this.responses[i].content){let r=this.responses[i].content[e],u=Vt(r.schema,{}),a=Kt(r.schema?r.schema.examples:"",r.schema?r.schema.example:"",r.schema,e,"json");o[e]={description:this.responses[i].description,examples:a,schemaTree:u},e.includes("json")&&(n=e),t[i]=e,s++}let u=[];for(let t in this.responses[i].headers)u.push(Ie({name:t},this.responses[i].headers[t]));e[i]=u,r[i]=o}return z(Ne(),Object.keys(this.responses).map((t,n)=>z(Le(),0===n?"top-gap":"divider",t,this.responses[t].description,e[t]&&e[t].length>0?z(Fe(),e[t].map(t=>z(ke(),t.name,ut(ft()(t.description)),t.schema&&t.schema.example?z(je(),t.schema.example):""))):"",Object.keys(r[t]).map(e=>e.includes("octet-stream")?z(Me(),e):z(De(),t,e,this.activateTab,t,e,t,e,e,t,e,r[t][e].examples[0].exampleValue,t,e,r[t][e].schemaTree)))))}activateTab(t){if(t.target.classList.contains("active")||!1===t.target.classList.contains("tab-btn"))return;t.currentTarget.parentNode.querySelector(".tab-btn.active").classList.remove("active"),t.target.classList.add("active");let e=t.target.attributes.content_id.value,n=t.currentTarget.parentNode.querySelectorAll(".tab-content");e&&n.forEach(function(t){t.style.display=t.attributes.id.value===e?"flex":"none"})}});function en(){const t=rn(['']);return en=function(){return t},t}function nn(){const t=rn(["",""]);return nn=function(){return t},t}function rn(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}customElements.define("end-point",class extends ot{render(){return z(Ke(),ht,window.innerWidth>=768?z(Ve(),"row"===this.layout?z(Qe()):z(Ge())):"",this.path.method,this.path.expanded?"expanded":"collapsed",this.toggleExpand,this.path.method,this.path.expanded?"expanded":"collapsed",this.path.method,this.path.method,this.path.deprecated?"deprecated":"",this.path.path,this.path.deprecated?z(Je()):"",ut(ft()(this.path.summary)),this.path.expanded?z(We(),this.path.method,this.path.summary||this.path.description?z(Xe(),ut(ft()(this.path.summary)),this.path.summary!==this.path.description?z(Ze(),ut(ft()(this.path.description?this.path.description:""))):""):"",this.path.method,this.path.path,this.apiKeyName,this.apiKeyValue,this.apiKeyLocation,this.selectedServer,this.path.parameters,this.path.requestBody,this.allowTry,this.accept,this.path.responses):"")}static get styles(){return[rt(Ye())]}constructor(){super(),this.accept=""}static get properties(){return{apiKeyName:{type:String,attribute:"api-key-name"},apiKeyValue:{type:String,attribute:"api-key-value"},apiKeyLocation:{type:String,attribute:"api-key-location"},selectedServer:{type:String,attribute:"selected-server"},layout:{type:String},path:{type:Object},allowTry:{type:String,attribute:"allow-try"}}}toggleExpand(){if(this.path.expanded)this.path.expanded=!1;else{this.path.expanded=!0;let t="";for(let e in this.path.responses)for(let n in this.path.responses[e].content)t=t+n+", ";t=t.replace(/,\s*$/,""),this.accept=t}this.requestUpdate()}});function on(){const t=gn(['
    Refresh URL: ',"
    "]);return on=function(){return t},t}function sn(){const t=gn(['
    Token URL: ',"
    "]);return sn=function(){return t},t}function un(){const t=gn(['
    Auth URL: ',"
    "]);return un=function(){return t},t}function an(){const t=gn([""," "," ",'
    ']);return an=function(){return t},t}function cn(){const t=gn(["
    ","
    "]);return cn=function(){return t},t}function ln(){const t=gn(["Send 'Authorization' in header which will contains the word 'Bearer' followed by a space and a Token String.
    "]);return ln=function(){return t},t}function fn(){const t=gn(["Send 'Authorization' in header which will contains the word 'Basic' followed by a space and a base64-encoded string username:password.
    "]);return fn=function(){return t},t}function pn(){const t=gn(["Send '","' in '","' with the given value
    "]);return pn=function(){return t},t}function hn(){const t=gn(['
    ',"
    "]);return hn=function(){return t},t}function dn(){const t=gn(['
    ',": "," ","
    "," "," "," ",""]);return dn=function(){return t},t}function vn(){const t=gn([""," "," ",'
    AUTHENTICATION
    ',"
    TypeAuthentication Procedure
    "]);return vn=function(){return t},t}function gn(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}customElements.define("end-points",class extends ot{render(){return z(nn(),this.paths.filter(t=>!this.matchPaths||"".concat(t.method," ").concat(t.path).includes(this.matchPaths)).map(t=>z(en(),this.selectedServer,this.apiKeyName?this.apiKeyName:"",this.apiKeyValue?this.apiKeyValue:"",this.apiKeyLocation,this.layout,t,this.allowTry?this.allowTry:"true")))}static get properties(){return{apiKeyName:{type:String,attribute:"api-key-name"},apiKeyValue:{type:String,attribute:"api-key-value"},apiKeyLocation:{type:String,attribute:"api-key-location"},selectedServer:{type:String,attribute:"selected-server"},layout:{type:String},paths:{type:Object},matchPaths:{type:String,attribute:"match-paths"},allowTry:{type:String,attribute:"allow-try"}}}});customElements.define("security-schemes",class extends ot{render(){return z(vn(),ht,Ht,Wt,Object.keys(this.schemes).map(t=>z(dn(),this.schemes[t].type,this.schemes[t].scheme,this.schemes[t].description?z(hn(),ut(ft()(this.schemes[t].description))):"","apiKey"===this.schemes[t].type?z(pn(),this.schemes[t].name,this.schemes[t].in,t,this.schemes[t].type,this.schemes[t].in,this.schemes[t].name,t,t,t,t,this.selectedApiKeyValue?"CLEAR":"SET",this.dispatchChange,this.selectedApiKeyValue?"CLEAR":"SET"):"","http"===this.schemes[t].type&&"basic"===this.schemes[t].scheme?z(fn(),t,this.schemes[t].type,this.schemes[t].scheme,t,t,t,t,t,this.selectedApiKeyValue?"CLEAR":"SET",this.dispatchChange,this.selectedApiKeyValue?"CLEAR":"SET"):"","http"===this.schemes[t].type&&"bearer"===this.schemes[t].scheme?z(ln(),t,this.schemes[t].type,this.schemes[t].scheme,t,t,t,t,this.selectedApiKeyValue?"CLEAR":"SET",this.dispatchChange,this.selectedApiKeyValue?"CLEAR":"SET"):"","oauth2"===this.schemes[t].type?z(cn(),Object.keys(this.schemes[t].flows).map(e=>z(an(),this.schemes[t].flows[e].authorizationUrl?z(un(),this.schemes[t].flows[e].authorizationUrl):"",this.schemes[t].flows[e].tokenUrl?z(sn(),this.schemes[t].flows[e].tokenUrl):"",this.schemes[t].flows[e].refreshUrl?z(on(),this.schemes[t].flows[e].refreshUrl):"",t,t))):"")))}static get properties(){return{schemes:{type:Object},selectedApiKeyName:{type:String,attribute:"selected-api-key-name"},selectedApiKeyValue:{type:String,attribute:"selected-api-key-value"}}}dispatchChange(t){let e=t.target.closest(".".concat(t.target.dataset.class));if(!e)return;let n=e.dataset.type,r=e.dataset.in,i=e.dataset.name,o=e.dataset.inputname,s="";if("CLEAR"===t.target.dataset.action){let t=e.querySelector("input[name=".concat(o,"-token]"));t&&(t.value="")}else if("apiKey"===n){let t=e.querySelector("input[name=".concat(o,"-token]"));t&&(s=t.value)}else if("http"===n){let t=e.dataset.scheme;if("basic"===t){let t=e.querySelector("input[name=".concat(o,"-username]")),n=e.querySelector("input[name=".concat(o,"-password]"));t&&n&&(s="Basic "+btoa(t.value+":"+n.value))}else if("bearer"===t){let t=e.querySelector("input[name=".concat(o,"-bearer-token]"));t&&(s="Bearer "+t.value)}}let u=new CustomEvent("change",{detail:{keyType:n,keyName:i,keyValue:s,keyLocation:r}});this.dispatchEvent(u)}});var yn=n(123),mn=n.n(yn),bn=n(65),wn=n.n(bn);function _n(t,e,n,r,i,o,s){try{var u=t[o](s),a=u.value}catch(t){return void n(t)}u.done?e(a):Promise.resolve(a).then(r,i)}function xn(){var t;return t=function*(t){let e,n,r,i,o,s,u="";i={patch:!0,warnOnly:!0};try{(u=(n="string"==typeof t?yield wn.a.convertUrl(t,i):yield wn.a.convertObj(t,i)).source.trim()).startsWith("/")&&(u=(s=new URL("."+u,location.href)).pathname),o={resolveCirculars:!1,location:u},e=(r=yield mn.a.resolveRefs(n.openapi,o)).resolved}catch(t){console.info("%c There was an issue while parsing the spec %o ","color:orangered",t)}console.info("%c Spec Conversion - Success !!! ","color:cornflowerblue");let a=e,c=["get","put","post","delete","patch","options","head"],l=[],f=0;for(let t in a.paths){let e=a.paths[t].parameters,n={summary:a.paths[t].summary,description:a.paths[t].description,servers:a.paths[t].servers?a.paths[t].servers:[],parameters:a.paths[t].parameters?a.paths[t].parameters:[]};c.forEach(function(r){let i,o,s;if(a.paths[t][r]){let u=a.paths[t][r];if(u.tags)o=u.tags[0],a.tags&&(s=a.tags.find(function(t){return t.name===o}));else{let e=t.indexOf("/",1);-1===e?e=t.length-1:e-=1,o=t.substr(1,e)}(i=l.find(t=>t.name==o))||(i={show:!0,name:o,description:s?s.description:"",paths:[]},l.push(i));let c=u.summary?u.summary:"",p=u.description?u.description:"";if(!c&&p)if(p.length>100){let t=-1;(-1===(t=p.indexOf("\n"))||t>100)&&(t=p.indexOf(". ")),(-1===t||t>100)&&(t=p.indexOf(".")),c=-1===t||t>100?p:p.substr(0,t)}else c=p;let h=[];h=e?u.parameters?e.filter(t=>{if(!u.parameters.some(e=>t.name===e.name&&t.in===e.in))return t}).concat(u.parameters):e.slice(0):u.parameters?u.parameters.slice(0):[],i.paths.push({show:!0,expanded:!1,expandedAtLeastOnce:!1,summary:c,method:r,description:u.description,path:t,operationId:u.operationId,requestBody:u.requestBody,parameters:h,servers:u.servers?n.servers.concat(u.servers):n.servers,responses:u.responses,deprecated:u.deprecated,security:u.security,commonSummary:n.summary,commonDescription:n.description}),f++}})}let p={},h=[];return p=a.components?a.components.securitySchemes:{},a.servers?a.servers.map(function(t){let e=t.url.trim().toLowerCase();t.url&&"http"!==e.substr(0,4)&&("//"==e.substr(0,2)?t.url=location.protocol+t.url:t.url=location.origin+t.url)}):a.servers=[{url:location.origin}],h=a.servers,l.sort((t,e)=>t.namee.name?1:0),{info:a.info,tags:l,externalDocs:a.externalDocs,securitySchemes:p,servers:h,basePath:a.basePath,totalPathCount:f}},(xn=function(){var e=this,n=arguments;return new Promise(function(r,i){var o=t.apply(e,n);function s(t){_n(o,r,i,s,u,"next",t)}function u(t){_n(o,r,i,s,u,"throw",t)}s(void 0)})}).apply(this,arguments)}function Sn(){const t=In(['
    ','
    ','
    ']);return Sn=function(){return t},t}function An(){const t=In(["",""]);return An=function(){return t},t}function On(){const t=In(['
    ']);return On=function(){return t},t}function Cn(){const t=In([' ',"
    "]);return Cn=function(){return t},t}function En(){const t=In([' ',"
    "]);return En=function(){return t},t}function Un(){const t=In(["",""]);return Un=function(){return t},t}function Rn(){const t=In(['
    "]);return Rn=function(){return t},t}function Tn(){const t=In(["",""]);return Tn=function(){return t},t}function qn(){const t=In(['',""]);return qn=function(){return t},t}function Pn(){const t=In(['
    '," ","
    ","
    "]);return Pn=function(){return t},t}function zn(){const t=In(['
    Loading ...
    ']);return zn=function(){return t},t}function Dn(){const t=In(['
    ']);return Dn=function(){return t},t}function Mn(){const t=In([' ']);return Mn=function(){return t},t}function jn(){const t=In(['
    ']);return jn=function(){return t},t}function kn(){const t=In(['
    ','
    '," ",'',"
    "]);return kn=function(){return t},t}function Fn(){const t=In([""]);return Fn=function(){return t},t}function Ln(){const t=In([""]);return Ln=function(){return t},t}function Nn(){const t=In([""," "," "," "," ","",'
    '," "," "," "," ",'
    ']);return Nn=function(){return t},t}function In(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}class $n extends ot{render(){return z(Nn(),ht,Wt,Zt,Ht,"dark"===this.theme?z(Ln()):z(Fn()),this.primaryColor?"".concat(this.primaryColor):"#FF791A",ct.color.brightness(this.primaryColor?this.primaryColor:"#FF791A",-30),this.primaryColor?"".concat(ct.color.invert(this.primaryColor)):"#ffffff",this.headerColor?"".concat(this.headerColor):"#444",this.headerColor?"".concat(ct.color.invert(this.headerColor)):"#ccc",this.layout?"".concat(this.layout):"row",this.monoFont?"".concat(this.monoFont):"Monaco, 'Andale Mono', 'Roboto Mono', Consolas",this.regularFont?"".concat(this.regularFont):"rapidoc, Helvetica, Arial",this.headerColor?ct.color.brightness(this.headerColor,-20):ct.color.inputReverseBg,"false"===this.showHeader?"":z(kn(),this.headingText,"false"===this.allowSpecUrlLoad?"":z(jn(),this.specUrl?this.specUrl:"",this.onSepcUrlChange),"false"===this.allowSpecFileLoad?"":z(Mn(),this.specFile?this.specFile:"",this.onSepcFileChange,this.onFileLoadClick),"false"===this.allowSearch?"":z(Dn(),this.onSearchChange)),!0===this.loading?z(zn()):"","false"!==this.showInfo&&this.resolvedSpec&&this.resolvedSpec.info?z(Pn(),this.resolvedSpec.info.title,this.resolvedSpec.info.version?z(qn(),this.resolvedSpec.info.version):"",this.resolvedSpec.info.description?z(Tn(),ut("
    ".concat(ft()(this.resolvedSpec.info.description),"
    "))):""):"","false"!==this.allowTry&&this.resolvedSpec?z(Rn(),this.resolvedSpec.servers&&0!==this.resolvedSpec.servers.length?z(Un(),this.resolvedSpec.servers.map(t=>z(En(),t.url,this.onApiServerChange,t.url))):"",this.serverUrl?z(Cn(),this.serverUrl,this.onApiServerChange,this.serverUrl):""):"","false"!==this.allowAuthentication&&this.resolvedSpec&&this.resolvedSpec.securitySchemes?z(On(),this.resolvedSpec.securitySchemes,this.apiKeyName?this.apiKeyName:"",this.apiKeyValue?this.apiKeyValue:"",this.onSecurityChange):"",this.resolvedSpec&&this.resolvedSpec.tags?z(An(),this.resolvedSpec.tags.map(t=>z(Sn(),t.name,ut("
    ".concat(ft()(t.description?t.description:""),"
    ")),this.selectedServer?this.selectedServer:"",this.apiKeyName?this.apiKeyName:"",this.apiKeyValue?this.apiKeyValue:"",this.apiKeyLocation?this.apiKeyLocation:"",this.layout?this.layout:"row",t.paths,this.allowTry?this.allowTry:"true",this.matchPaths))):"")}static get properties(){return{specUrl:{type:String,attribute:"spec-url"},specFile:{type:String,attribute:!1},serverUrl:{type:String,attribute:"server-url"},matchPaths:{type:String,attribute:"match-paths"},headingText:{type:String,attribute:"heading-text"},headerColor:{type:String,attribute:"header-color"},primaryColor:{type:String,attribute:"primary-color"},regularFont:{type:String,attribute:"regular-font"},monoFont:{type:String,attribute:"mono-font"},showHeader:{type:String,attribute:"show-header"},showInfo:{type:String,attribute:"show-info"},allowAuthentication:{type:String,attribute:"allow-authentication"},allowTry:{type:String,attribute:"allow-try"},allowSpecUrlLoad:{type:String,attribute:"allow-spec-url-load"},allowSpecFileLoad:{type:String,attribute:"allow-spec-file-load"},allowSearch:{type:String,attribute:"allow-search"},layout:{type:String},theme:{type:String},logoUrl:{type:String,attribute:"logo-url"},apiKeyName:{type:String,attribute:"api-key-name"},apiKeyValue:{type:String,attribute:"api-key-value"},apiKeyLocation:{type:String,attribute:"api-key-location"}}}attributeChangedCallback(t,e,n){"spec-url"==t&&e!==n&&this.loadSpec(n),super.attributeChangedCallback(t,e,n)}onSepcUrlChange(t){this.setAttribute("spec-url",this.shadowRoot.getElementById("spec-url").value)}onSepcFileChange(t){let e=this;this.setAttribute("spec-file",this.shadowRoot.getElementById("spec-file").value);let n=t.target.files[0],r=new FileReader;r.onload=function(t){try{let t=JSON.parse(r.result);e.loadSpec(t),e.shadowRoot.getElementById("spec-url").value=""}catch(t){alert("Unable to read or parse json"),console.log("Unable to read or parse json")}},r.readAsText(n)}onFileLoadClick(){this.shadowRoot.getElementById("spec-file").click()}onApiServerChange(){let t=this.shadowRoot.querySelector("input[name='api_server']:checked");null!==t&&(this.selectedServer=t.value,this.requestUpdate())}onSecurityChange(t){this.apiKeyName=t.detail.keyName,this.apiKeyValue=t.detail.keyValue,this.apiKeyLocation=t.detail.keyLocation}onSearchChange(t){this.matchPaths=t.target.value}loadSpec(t){let e=this;t&&(this.loading=!0,this.apiKeyName="",this.apiKeyValue="",this.apiKeyLocation="",this.selectedServer="",this.matchPaths="",function(t){return xn.apply(this,arguments)}(t).then(function(t){e.loading=!1,null==t&&console.error("Unable to resolve the API spec. "),console.log(t),e.afterSpecParsedAndValidated(t)}).catch(function(t){e.loading=!1,console.error("Unable to resolve the API spec.. "+t.message)}))}afterSpecParsedAndValidated(t){arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.resolvedSpec=t,this.requestUpdate(),window.setTimeout(()=>{this.onApiServerChange()},0)}}customElements.define("rapi-doc",$n);e.default={RapiDoc:$n}}]); -//# sourceMappingURL=rapidoc-min.js.map \ No newline at end of file diff --git a/modules/openapi-json-schema-generator-online/src/test/java/org/openapitools/codegen/online/api/GenApiControllerTest.java b/modules/openapi-json-schema-generator-online/src/test/java/org/openapitools/codegen/online/api/GenApiControllerTest.java deleted file mode 100644 index 262e0eba660..00000000000 --- a/modules/openapi-json-schema-generator-online/src/test/java/org/openapitools/codegen/online/api/GenApiControllerTest.java +++ /dev/null @@ -1,128 +0,0 @@ -package org.openapitools.codegen.online.api; - -import com.fasterxml.jackson.databind.ObjectMapper; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.openapitools.codegen.online.model.ResponseCode; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; -import org.springframework.http.HttpHeaders; -import org.springframework.http.MediaType; -import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.test.web.servlet.MockMvc; - -import static org.hamcrest.Matchers.hasItem; -import static org.hamcrest.Matchers.not; -import static org.hamcrest.text.MatchesPattern.matchesPattern; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; - -@RunWith(SpringRunner.class) -@WebMvcTest(GenApiController.class) -public class GenApiControllerTest { - - private static final String OPENAPI_URL = "https://raw.githubusercontent.com/OpenAPITools/openapi-generator/v4.3.1/modules/openapi-generator/src/test/resources/petstore.json"; - private static final String UUID_REGEX = "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[89aAbB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}"; - - @Autowired - private MockMvc mockMvc; - - @Test - public void clientLanguages() throws Exception { - getLanguages("clients", "java"); - } - - @Test - public void serverFrameworks() throws Exception { - getLanguages("servers", "spring"); - } - - - public void getLanguages(String type, String expected) throws Exception { - mockMvc.perform(get("/api/gen/" + type)) - .andExpect(status().isOk()) - .andExpect(content().contentType(MediaType.APPLICATION_JSON)) - .andExpect(jsonPath("$.[*]").value(hasItem(expected))); - } - - @Test - public void clientOptions() throws Exception { - getOptions("clients", "java"); - } - - @Test - public void clientOptionsUnknown() throws Exception { - mockMvc.perform(get("/api/gen/clients/unknown")) - .andExpect(status().isNotFound()); - } - - @Test - public void serverOptions() throws Exception { - getOptions("servers", "spring"); - } - - @Test - public void serverOptionsUnknown() throws Exception { - mockMvc.perform(get("/api/gen/servers/unknown")) - .andExpect(status().isNotFound()); - } - - private void getOptions(String type, String name) throws Exception { - mockMvc.perform(get("/api/gen/" + type + "/" + name)) - .andExpect(status().isOk()) - .andExpect(content().contentType(MediaType.APPLICATION_JSON)) - .andExpect(jsonPath("$.sortParamsByRequiredFlag.opt").value("sortParamsByRequiredFlag")); - } - - @Test - public void generateClient() throws Exception { - generateAndDownload("clients", "java"); - } - - @Test - public void generateServer() throws Exception { - generateAndDownload("servers", "spring"); - } - - private void generateAndDownload(String type, String name) throws Exception { - String result = mockMvc.perform(post("http://test.com:1234/api/gen/" + type + "/" + name) - .contentType(MediaType.APPLICATION_JSON) - .content("{\"openAPIUrl\": \"" + OPENAPI_URL + "\"}")) - .andExpect(status().isOk()) - .andExpect(content().contentType(MediaType.APPLICATION_JSON)) - .andExpect(jsonPath("$.code").value(matchesPattern(UUID_REGEX))) - .andExpect(jsonPath("$.link").value(matchesPattern("http\\:\\/\\/test.com\\:1234\\/api\\/gen\\/download\\/" + UUID_REGEX))) - .andReturn().getResponse().getContentAsString(); - - String code = new ObjectMapper().readValue(result, ResponseCode.class).getCode(); - - mockMvc.perform(get("http://test.com:1234/api/gen/download/" + code)) - .andExpect(content().contentType("application/zip")) - .andExpect(status().isOk()) - .andExpect(header().string(HttpHeaders.CONTENT_LENGTH, not(0))); - } - - @Test - public void generateWIthForwardedHeaders() throws Exception { - String result = mockMvc.perform(post("http://test.com:1234/api/gen/clients/java") - .contentType(MediaType.APPLICATION_JSON) - .header("X-Forwarded-Proto", "https") - .header("X-Forwarded-Host", "forwarded.com") - .header("X-Forwarded-Port", "5678") - .content("{\"openAPIUrl\": \"" + OPENAPI_URL + "\"}")) - .andExpect(status().isOk()) - .andExpect(content().contentType(MediaType.APPLICATION_JSON)) - .andExpect(jsonPath("$.code").value(matchesPattern(UUID_REGEX))) - .andExpect(jsonPath("$.link").value(matchesPattern("https\\:\\/\\/forwarded.com\\:5678\\/api\\/gen\\/download\\/" + UUID_REGEX))) - .andReturn().getResponse().getContentAsString(); - - String code = new ObjectMapper().readValue(result, ResponseCode.class).getCode(); - - mockMvc.perform(get("http://test.com:1234/api/gen/download/" + code)) - .andExpect(content().contentType("application/zip")) - .andExpect(status().isOk()) - .andExpect(header().string(HttpHeaders.CONTENT_LENGTH, not(0))); - } - -} diff --git a/modules/openapi-json-schema-generator/pom.xml b/modules/openapi-json-schema-generator/pom.xml index 61314cc0dbe..17fec32895e 100644 --- a/modules/openapi-json-schema-generator/pom.xml +++ b/modules/openapi-json-schema-generator/pom.xml @@ -1,7 +1,7 @@ - org.openapitools + org.openapijsonschematools openapi-json-schema-generator-project ${revision} ../.. @@ -388,7 +388,7 @@ ${jackson-threetenbp.version}
    - org.openapitools + org.openapijsonschematools openapi-json-schema-generator-core ${project.parent.version} diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CliOption.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/CliOption.java similarity index 98% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CliOption.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/CliOption.java index 6851f0cb5fe..ed409d810cf 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CliOption.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/CliOption.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.openapitools.codegen; +package org.openapijsonschematools.codegen; import com.fasterxml.jackson.annotation.JsonIgnore; import io.swagger.v3.parser.util.SchemaTypeUtil; diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/ClientOptInput.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/ClientOptInput.java similarity index 94% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/ClientOptInput.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/ClientOptInput.java index 0d95bb4aef9..5503caa1416 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/ClientOptInput.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/ClientOptInput.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.openapitools.codegen; +package org.openapijsonschematools.codegen; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.parser.core.models.AuthorizationValue; -import org.openapitools.codegen.api.TemplateDefinition; -import org.openapitools.codegen.auth.AuthParser; +import org.openapijsonschematools.codegen.auth.AuthParser; +import org.openapijsonschematools.codegen.api.TemplateDefinition; import java.util.List; diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenCallback.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/CodegenCallback.java similarity index 96% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenCallback.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/CodegenCallback.java index 194e0234cc0..a88c86f57b9 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenCallback.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/CodegenCallback.java @@ -15,7 +15,9 @@ * limitations under the License. */ -package org.openapitools.codegen; +package org.openapijsonschematools.codegen; + +import org.openapijsonschematools.codegen.model.CodegenOperation; import java.util.*; diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/CodegenConfig.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/CodegenConfig.java new file mode 100644 index 00000000000..47f98400c6a --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/CodegenConfig.java @@ -0,0 +1,337 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * Copyright 2018 SmartBear Software + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapijsonschematools.codegen; + +import com.samskivert.mustache.Mustache.Compiler; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.Operation; +import io.swagger.v3.oas.models.PathItem; +import io.swagger.v3.oas.models.Paths; +import io.swagger.v3.oas.models.headers.Header; +import io.swagger.v3.oas.models.media.Schema; +import io.swagger.v3.oas.models.parameters.Parameter; +import io.swagger.v3.oas.models.parameters.RequestBody; +import io.swagger.v3.oas.models.responses.ApiResponse; +import io.swagger.v3.oas.models.security.SecurityRequirement; +import io.swagger.v3.oas.models.security.SecurityScheme; +import io.swagger.v3.oas.models.servers.Server; +import io.swagger.v3.oas.models.servers.ServerVariable; +import org.openapijsonschematools.codegen.model.CodegenHeader; +import org.openapijsonschematools.codegen.model.CodegenKey; +import org.openapijsonschematools.codegen.model.CodegenOperation; +import org.openapijsonschematools.codegen.model.CodegenParameter; +import org.openapijsonschematools.codegen.model.CodegenPathItem; +import org.openapijsonschematools.codegen.model.CodegenPatternInfo; +import org.openapijsonschematools.codegen.model.CodegenRequestBody; +import org.openapijsonschematools.codegen.model.CodegenResponse; +import org.openapijsonschematools.codegen.model.CodegenSchema; +import org.openapijsonschematools.codegen.model.CodegenSecurityRequirementValue; +import org.openapijsonschematools.codegen.model.CodegenSecurityScheme; +import org.openapijsonschematools.codegen.model.CodegenServer; +import org.openapijsonschematools.codegen.api.TemplatingEngineAdapter; +import org.openapijsonschematools.codegen.meta.FeatureSet; +import org.openapijsonschematools.codegen.meta.GeneratorMetadata; +import org.openapijsonschematools.codegen.model.CodegenTag; + +import java.io.File; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.TreeMap; + +public interface CodegenConfig { + String getFilesMetadataFilename(); + + String getVersionMetadataFilename(); + + GeneratorMetadata getGeneratorMetadata(); + + CodegenType getTag(); + + String getName(); + + String getHelp(); + + Map additionalProperties(); + + Map serverVariableOverrides(); + + Map vendorExtensions(); + + String testPackage(); + + String apiPackage(); + + String apiFileFolder(); + + String apiTestFileFolder(); + + String apiDocFileFolder(); + + String outputFolder(); + + String templateDir(); + + String embeddedTemplateDir(); + + String modelTestFileFolder(); + + String modelPackage(); + + String modelPackagePathFragment(); + + String packageName(); + + String toApiName(String name); + + String toApiVarName(String name); + + String toModelName(String name, String jsonPath); + + String toParamName(String name); + + String escapeText(String text); + + String escapeTextWhileAllowingNewLines(String text); + + String encodePath(String text); + + String escapeUnsafeCharacters(String input); + + String escapeReservedWord(String name); + + String escapeQuotationMark(String input); + + void processOpts(); + + List cliOptions(); + + Set reservedWords(); + + List supportingFiles(); + + String getInputSpec(); + + void setInputSpec(String inputSpec); + + String getOutputDir(); + + String packagePath(); + + void setOutputDir(String dir); + + CodegenSchema fromSchema(Schema schema, String sourceJsonPath, String currentJsonPath); + + CodegenTag fromTag(String name, String description); + + List> fromSecurity(List security, String jsonPath); + + CodegenOperation fromOperation(Operation operation, String jsonPath); + + CodegenKey getKey(String key); + + CodegenSecurityScheme fromSecurityScheme(SecurityScheme securityScheme, String jsonPath); + + HashMap fromSecurityRequirement(SecurityRequirement securityScheme, String jsonPath); + + TreeMap fromPaths(Paths paths); + + CodegenPathItem fromPathItem(PathItem pathItem, String jsonPath); + + List fromServers(List servers, String jsonPath); + + HashMap fromServerVariables(Map variables, String jsonPath); + + Map typeMapping(); + + Map instantiationTypes(); + + Map schemaMapping(); + + Map inlineSchemaNameMapping(); + + Map inlineSchemaNameDefault(); + + HashMap> jsonPathTemplateFiles(); + + HashMap> jsonPathDocTemplateFiles(); + + Set pathEndpointTestTemplateFiles(); + + Map apiTestTemplateFiles(); + + Map modelTestTemplateFiles(); + + Set languageSpecificPrimitives(); + + Map reservedWordsMappings(); + + void preprocessOpenAPI(OpenAPI openAPI); + + void processOpenAPI(OpenAPI openAPI); + + Compiler processCompiler(Compiler compiler); + + String sanitizeTag(String tag); + + String toApiFilename(String name); + + String toModelFilename(String name, String jsonPath); + + String toModuleFilename(String name, String jsonPath); + + String toApiTestFilename(String name); + + String toModelTestFilename(String name); + + String toApiDocFilename(String name); + + String toRequestBodyFilename(String componentName); + + String toHeaderFilename(String componentName, String jsonPath); + + String toPathFilename(String path, String jsonPath); + + String toParameterFilename(String baseName, String jsonPath); + + String toSecuritySchemeFilename(String baseName, String jsonPath); + + String toServerFilename(String baseName, String jsonPath); + + String toSecurityRequirementObjectFilename(String baseName, String jsonPath); + + String getCamelCaseServer(String baseName); + + String toModelImport(String refClass); + + Map toModelImportMap(String name); + + String toApiImport(String name); + + void addOperationToGroup(String tag, String resourcePath, Operation operation, CodegenOperation co, Map> operations); + + TreeMap updateAllModels(TreeMap models); + + void postProcess(); + + TreeMap postProcessAllModels(TreeMap schemas); + + TreeMap postProcessModels(TreeMap models); + + Map postProcessSupportingFileData(Map data); + + void postProcessModelProperty(CodegenSchema model, CodegenSchema property); + + // handles almost all files to be written + String getFilepath(String jsonPath); + + String getDocsFilepath(String jsonPath); + + String apiTestFilename(String templateName, String tag); + + boolean isSkipOverwrite(); + + void setSkipOverwrite(boolean skipOverwrite); + + void setRemoveOperationIdPrefix(boolean removeOperationIdPrefix); + + void setSkipOperationExample(boolean skipOperationExample); + + boolean isHideGenerationTimestamp(); + + void setHideGenerationTimestamp(boolean hideGenerationTimestamp); + + void setLibrary(String library); + + /** + * Library template (sub-template). + * + * @return library template + */ + String getLibrary(); + + void setHttpUserAgent(String httpUserAgent); + + String getHttpUserAgent(); + + void setDocExtension(String docExtension); + + String getDocExtension(); + + void setIgnoreFilePathOverride(String ignoreFileOverride); + + String getIgnoreFilePathOverride(); + + String sanitizeName(String name); + + void postProcessFile(File file, String fileType); + + boolean isEnablePostProcessFile(); + + void setEnablePostProcessFile(boolean isEnablePostProcessFile); + + /** + * Set the OpenAPI instance. This method needs to be called right after the instantiation of the Codegen class. + * + * @param openAPI specification being generated + */ + void setOpenAPI(OpenAPI openAPI); + + void setTemplatingEngine(TemplatingEngineAdapter s); + + TemplatingEngineAdapter getTemplatingEngine(); + + boolean isEnableMinimalUpdate(); + + void setEnableMinimalUpdate(boolean isEnableMinimalUpdate); + + boolean isStrictSpecBehavior(); + + void setStrictSpecBehavior(boolean strictSpecBehavior); + + FeatureSet getFeatureSet(); + + CodegenPatternInfo getPatternInfo(String pattern); + + boolean isRemoveEnumValuePrefix(); + + void setRemoveEnumValuePrefix(boolean removeEnumValuePrefix); + + String defaultTemplatingEngine(); + + GeneratorLanguage generatorLanguage(); + + /* + the version of the language that the generator implements + For python 3.9.0, generatorLanguageVersion would be "3.9.0" + */ + String generatorLanguageVersion(); + + List getSupportedVendorExtensions(); + + String toRefClass(String ref, String sourceJsonPath, String expectedComponentType); + + CodegenRequestBody fromRequestBody(RequestBody body, String sourceJsonPath); + + CodegenResponse fromResponse(ApiResponse response, String sourceJsonPath); + + CodegenHeader fromHeader(Header parameter, String sourceJsonPath); + + CodegenParameter fromParameter(Parameter parameter, String sourceJsonPath); +} diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenConfigLoader.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/CodegenConfigLoader.java similarity index 98% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenConfigLoader.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/CodegenConfigLoader.java index 64cd2fe921e..3cd61577ae1 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenConfigLoader.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/CodegenConfigLoader.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.openapitools.codegen; +package org.openapijsonschematools.codegen; import java.util.ArrayList; import java.util.List; diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/CodegenConstants.java similarity index 95% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/CodegenConstants.java index e0441943e38..54ee6cd0aad 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/CodegenConstants.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.openapitools.codegen; +package org.openapijsonschematools.codegen; /** * A class for storing constants that are used throughout the project. @@ -23,8 +23,29 @@ public class CodegenConstants { /* System Properties */ // NOTE: We may want to move these to a separate class to avoid confusion or modification. + public static final String SERVERS = "servers"; + + public static final String SECURITY = "security"; public static final String APIS = "apis"; public static final String MODELS = "models"; + public static final String CONTENT = "content"; + public static final String REQUEST_BODIES = "requestBodies"; + public static final String REQUEST_BODY_DOCS = "requestBodyDocs"; + + public static final String RESPONSES = "responses"; + public static final String RESPONSE_DOCS = "responseDocs"; + + public static final String COMPONENTS = "components"; + + public static final String HEADERS = "headers"; + public static final String HEADER_DOCS = "headerDocs"; + + public static final String PARAMETERS = "parameters"; + + public static final String SECURITY_SCHEMES = "securitySchemes"; + public static final String SECURITY_SCHEME_DOCS = "securitySchemeDocs"; + + public static final String PARAMETER_DOCS = "parameterDocs"; public static final String SUPPORTING_FILES = "supportingFiles"; public static final String MODEL_TESTS = "modelTests"; public static final String MODEL_DOCS = "modelDocs"; @@ -224,6 +245,8 @@ public class CodegenConstants { public static enum PARAM_NAMING_TYPE {camelCase, PascalCase, snake_case, original} + public static enum JSON_PATH_LOCATION_TYPE {SCHEMA, REQUEST_BODY, PARAMETER, RESPONSE, HEADER, CONTENT, CONTENT_TYPE, HEADERS, PARAMETERS, RESPONSES, REQUEST_BODIES, SCHEMAS, PATHS, PATH, COMPONENTS, OPERATION, SECURITY_SCHEMES, SECURITY_SCHEME, SERVERS, SERVER, API_ROOT_FOLDER, API_PATH, API_TAG, API_PATHS, API_TAGS, SECURITY, SECURITIES} + public static enum MODEL_PROPERTY_NAMING_TYPE {camelCase, PascalCase, snake_case, original} public static enum ENUM_PROPERTY_NAMING_TYPE {camelCase, PascalCase, snake_case, original, UPPERCASE} @@ -257,7 +280,7 @@ public static enum ENUM_PROPERTY_NAMING_TYPE {camelCase, PascalCase, snake_case, public static final String GIT_HOST_DESC = "Git host, e.g. gitlab.com."; public static final String GIT_USER_ID = "gitUserId"; - public static final String GIT_USER_ID_DESC = "Git user ID, e.g. openapitools."; + public static final String GIT_USER_ID_DESC = "Git user ID, e.g. openapijsonschematools."; public static final String GIT_REPO_ID = "gitRepoId"; public static final String GIT_REPO_ID_DESC = "Git repo ID, e.g. openapi-generator."; @@ -354,12 +377,6 @@ public static enum ENUM_PROPERTY_NAMING_TYPE {camelCase, PascalCase, snake_case, public static final String OPEN_API_SPEC_NAME = "openAPISpecName"; - public static final String GENERATE_ALIAS_AS_MODEL = "generateAliasAsModel"; - public static final String GENERATE_ALIAS_AS_MODEL_DESC = "Generate model implementation for aliases to map and array schemas. " + - "An 'alias' is an array, map, or list which is defined inline in a OpenAPI document and becomes a model in the generated code. " + - "A 'map' schema is an object that can have undeclared properties, i.e. the 'additionalproperties' attribute is set on that object. " + - "An 'array' schema is a list of sub schemas in a OAS document"; - public static final String USE_COMPARE_NET_OBJECTS = "useCompareNetObjects"; public static final String USE_COMPARE_NET_OBJECTS_DESC = "Use KellermanSoftware.CompareNetObjects for deep recursive object comparison. WARNING: this option incurs potential performance impact."; diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenType.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/CodegenType.java similarity index 97% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenType.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/CodegenType.java index bf4c9c4d7c3..b65bb2784cc 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenType.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/CodegenType.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.openapitools.codegen; +package org.openapijsonschematools.codegen; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/DefaultCodegen.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/DefaultCodegen.java new file mode 100644 index 00000000000..06d4a8119f0 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/DefaultCodegen.java @@ -0,0 +1,4810 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * Copyright 2018 SmartBear Software + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapijsonschematools.codegen; + +import com.github.benmanes.caffeine.cache.Cache; +import com.github.benmanes.caffeine.cache.Caffeine; +import com.github.benmanes.caffeine.cache.Ticker; +import com.google.common.collect.ImmutableMap; +import com.samskivert.mustache.Mustache; +import com.samskivert.mustache.Mustache.Compiler; +import com.samskivert.mustache.Mustache.Lambda; + +import io.swagger.v3.oas.models.ExternalDocumentation; +import io.swagger.v3.oas.models.PathItem; +import io.swagger.v3.oas.models.Paths; +import io.swagger.v3.oas.models.security.OAuthFlow; +import io.swagger.v3.oas.models.security.SecurityRequirement; +import org.apache.commons.text.StringEscapeUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.tuple.Pair; +import org.openapijsonschematools.codegen.config.GlobalSettings; +import org.openapijsonschematools.codegen.meta.features.ComponentsFeature; +import org.openapijsonschematools.codegen.meta.features.DataTypeFeature; +import org.openapijsonschematools.codegen.meta.features.DocumentationFeature; +import org.openapijsonschematools.codegen.meta.features.GlobalFeature; +import org.openapijsonschematools.codegen.meta.features.OperationFeature; +import org.openapijsonschematools.codegen.meta.features.ParameterFeature; +import org.openapijsonschematools.codegen.meta.features.SchemaFeature; +import org.openapijsonschematools.codegen.meta.features.SecurityFeature; +import org.openapijsonschematools.codegen.meta.features.WireFormatFeature; +import org.openapijsonschematools.codegen.model.CodegenDiscriminator; +import org.openapijsonschematools.codegen.model.CodegenEncoding; +import org.openapijsonschematools.codegen.model.CodegenHeader; +import org.openapijsonschematools.codegen.model.CodegenKey; +import org.openapijsonschematools.codegen.model.CodegenMediaType; +import org.openapijsonschematools.codegen.model.CodegenOauthFlow; +import org.openapijsonschematools.codegen.model.CodegenOauthFlows; +import org.openapijsonschematools.codegen.model.CodegenOperation; +import org.openapijsonschematools.codegen.model.CodegenParameter; +import org.openapijsonschematools.codegen.model.CodegenPathItem; +import org.openapijsonschematools.codegen.model.CodegenPatternInfo; +import org.openapijsonschematools.codegen.model.CodegenRefInfo; +import org.openapijsonschematools.codegen.model.CodegenRequestBody; +import org.openapijsonschematools.codegen.model.CodegenResponse; +import org.openapijsonschematools.codegen.model.CodegenSchema; +import org.openapijsonschematools.codegen.model.CodegenSecurityRequirementValue; +import org.openapijsonschematools.codegen.model.CodegenSecurityScheme; +import org.openapijsonschematools.codegen.model.CodegenServer; +import org.openapijsonschematools.codegen.model.CodegenTag; +import org.openapijsonschematools.codegen.model.CodegenXml; +import org.openapijsonschematools.codegen.model.EnumValue; +import org.openapijsonschematools.codegen.model.PairCacheKey; +import org.openapijsonschematools.codegen.model.SchemaTestCase; +import org.openapijsonschematools.codegen.serializer.SerializerUtils; +import org.openapijsonschematools.codegen.templating.MustacheEngineAdapter; +import org.openapijsonschematools.codegen.templating.mustache.CamelCaseLambda; +import org.openapijsonschematools.codegen.templating.mustache.IndentedLambda; +import org.openapijsonschematools.codegen.templating.mustache.LowercaseLambda; +import org.openapijsonschematools.codegen.templating.mustache.SnakecaseLambda; +import org.openapijsonschematools.codegen.templating.mustache.TitlecaseLambda; +import org.openapijsonschematools.codegen.templating.mustache.UppercaseLambda; +import org.openapijsonschematools.codegen.utils.ModelUtils; +import org.openapijsonschematools.codegen.model.CodegenDiscriminator.MappedModel; +import org.openapijsonschematools.codegen.api.TemplatingEngineAdapter; +import org.openapijsonschematools.codegen.meta.FeatureSet; +import org.openapijsonschematools.codegen.meta.GeneratorMetadata; +import org.openapijsonschematools.codegen.meta.Stability; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; +import java.math.BigDecimal; +import java.util.*; +import java.util.Map.Entry; +import java.util.concurrent.ConcurrentSkipListSet; +import java.util.concurrent.TimeUnit; +import java.util.function.Consumer; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import io.swagger.v3.core.util.Json; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.Operation; +import io.swagger.v3.oas.models.callbacks.Callback; +import io.swagger.v3.oas.models.examples.Example; +import io.swagger.v3.oas.models.headers.Header; +import io.swagger.v3.oas.models.media.*; +import io.swagger.v3.oas.models.parameters.*; +import io.swagger.v3.oas.models.responses.ApiResponse; +import io.swagger.v3.oas.models.security.OAuthFlows; +import io.swagger.v3.oas.models.security.SecurityScheme; +import io.swagger.v3.oas.models.servers.Server; +import io.swagger.v3.oas.models.servers.ServerVariable; + +@SuppressWarnings("rawtypes") +public class DefaultCodegen implements CodegenConfig { + private final Logger LOGGER = LoggerFactory.getLogger(DefaultCodegen.class); + + public static FeatureSet DefaultFeatureSet; + + // A cache of sanitized words. The sanitizeName() method is invoked many times with the same + // arguments, this cache is used to optimized performance. + private static final Cache sanitizedNameCache; + private static final String xSchemaTestExamplesKey = "x-schema-test-examples"; + private static final String xSchemaTestExamplesRefPrefix = "#/components/x-schema-test-examples/"; + protected static Schema falseSchema; + protected static Schema trueSchema = new Schema(); + + static { + DefaultFeatureSet = FeatureSet.newBuilder() + .includeDataTypeFeatures( + DataTypeFeature.Int32, DataTypeFeature.Int64, DataTypeFeature.Float, DataTypeFeature.Double, + DataTypeFeature.String, DataTypeFeature.Byte, DataTypeFeature.Binary, + DataTypeFeature.Boolean, DataTypeFeature.Date, DataTypeFeature.DateTime, DataTypeFeature.Password, + DataTypeFeature.File, DataTypeFeature.Array, DataTypeFeature.Object, DataTypeFeature.Enum + // Custom types are template specific + ) + .includeDocumentationFeatures( + DocumentationFeature.Api, DocumentationFeature.ComponentSchemas + // README is template specific + ) + .includeComponentsFeatures( + ComponentsFeature.schemas + ) + .includeGlobalFeatures( + GlobalFeature.Info, + GlobalFeature.Components + ) + .includeSchemaFeatures( + SchemaFeature.Discriminator, SchemaFeature.Enum, + SchemaFeature.ExclusiveMaximum, SchemaFeature.ExclusiveMinimum, + SchemaFeature.Format, SchemaFeature.Items, + SchemaFeature.MaxItems, SchemaFeature.MaxLength, + SchemaFeature.MaxProperties, SchemaFeature.Maximum, + SchemaFeature.MinItems, SchemaFeature.MinLength, + SchemaFeature.MinProperties, SchemaFeature.Minimum, + SchemaFeature.MultipleOf, + SchemaFeature.Pattern, SchemaFeature.Properties, + SchemaFeature.Required, SchemaFeature.Type, + SchemaFeature.UniqueItems + // Union (OneOf) not 100% yet. + ) + .includeParameterFeatures( + ParameterFeature.In_Path, ParameterFeature.In_Query, ParameterFeature.In_Header, + ParameterFeature.In_Cookie + ) + .includeOperationFeatures( + OperationFeature.Responses_Default, OperationFeature.Responses_HttpStatusCode + ) + .includeSecurityFeatures( + SecurityFeature.ApiKey, SecurityFeature.HTTP_Basic, SecurityFeature.HTTP_Bearer, + SecurityFeature.OAuth2_Implicit, SecurityFeature.OAuth2_Password, + SecurityFeature.OAuth2_ClientCredentials, SecurityFeature.OAuth2_AuthorizationCode + // OpenIDConnect not yet supported + ) + .includeWireFormatFeatures( + WireFormatFeature.JSON, WireFormatFeature.XML + // PROTOBUF and Custom are generator specific + ) + .build(); + + int cacheSize = Integer.parseInt(GlobalSettings.getProperty(org.openapijsonschematools.codegen.utils.StringUtils.NAME_CACHE_SIZE_PROPERTY, "500")); + int cacheExpiry = Integer.parseInt(GlobalSettings.getProperty(org.openapijsonschematools.codegen.utils.StringUtils.NAME_CACHE_EXPIRY_PROPERTY, "10")); + sanitizedNameCache = Caffeine.newBuilder() + .maximumSize(cacheSize) + .expireAfterAccess(cacheExpiry, TimeUnit.SECONDS) + .ticker(Ticker.systemTicker()) + .build(); + falseSchema = new Schema(); + falseSchema.setNot(new Schema()); + } + + protected GeneratorMetadata generatorMetadata; + protected String inputSpec; + protected String outputFolder = ""; + protected Set defaultIncludes; + protected Map typeMapping; + // instantiationTypes map from container types only: set, map, and array to the in language-type + protected Map instantiationTypes; + protected Set reservedWords; + protected Set languageSpecificPrimitives = new HashSet<>(); + // a map to store the mapping between a schema and the new one + protected Map schemaMapping = new HashMap<>(); + // a map to store the mapping between inline schema and the name provided by the user + protected Map inlineSchemaNameMapping = new HashMap<>(); + // a map to store the inline schema naming conventions + protected Map inlineSchemaNameDefault = new HashMap<>(); + protected String modelPackage = "", apiPackage = ""; + protected String modelNamePrefix = "", modelNameSuffix = ""; + protected String apiNamePrefix = "", apiNameSuffix = "Api"; + protected String testPackage = ""; + protected String filesMetadataFilename = "FILES"; + protected String versionMetadataFilename = "VERSION"; + + protected String packageName = "src.main.java"; + + protected String docsFolder = "docs"; + // for writing api files + protected HashMap> jsonPathTemplateFiles = new HashMap<>(); + // for writing doc files + protected HashMap> jsonPathDocTemplateFiles = new HashMap<>(); + protected Set pathEndpointTestTemplateFiles = new HashSet<>(); + protected Map apiTestTemplateFiles = new HashMap<>(); + protected Map modelTestTemplateFiles = new HashMap<>(); + protected Map reservedWordsMappings = new HashMap<>(); + protected String templateDir; + protected String embeddedTemplateDir; + protected Map additionalProperties = new HashMap<>(); + protected Map serverVariables = new HashMap<>(); + protected Map vendorExtensions = new HashMap<>(); + /* + Supporting files are those which aren't models, APIs, or docs. + These get a different map of data bound to the templates. Supporting files are written once. + */ + protected List supportingFiles = new ArrayList<>(); + protected List cliOptions = new ArrayList<>(); + protected boolean skipOverwrite; + protected boolean removeOperationIdPrefix; + protected String removeOperationIdPrefixDelimiter = "_"; + protected int removeOperationIdPrefixCount = 1; + protected boolean skipOperationExample; + + protected final static Pattern JSON_MIME_PATTERN = Pattern.compile("(?i)application/json(;.*)?"); + protected final static Pattern JSON_VENDOR_MIME_PATTERN = Pattern.compile("(?i)application/vnd.(.*)+json(;.*)?"); + private static final Pattern COMMON_PREFIX_ENUM_NAME = Pattern.compile("[a-zA-Z\\d]+\\z"); + + /** + * True if the code generator supports multiple class inheritance. + * This is used to model the parent hierarchy based on the 'allOf' composed schemas. + */ + protected boolean supportsMultipleInheritance; + /** + * True if the code generator supports single class inheritance. + * This is used to model the parent hierarchy based on the 'allOf' composed schemas. + * Note: the single-class inheritance technique has inherent limitations because + * a 'allOf' composed schema may have multiple $ref child schemas, each one + * potentially representing a "parent" in the class inheritance hierarchy. + * Some language generators also use class inheritance to implement the `additionalProperties` + * keyword. For example, the Java code generator may generate 'extends HashMap'. + */ + protected boolean supportsInheritance; + /** + * True if the language generator supports the 'additionalProperties' keyword + * as sibling of a composed (allOf/anyOf/oneOf) schema. + * Note: all language generators should support this to comply with the OAS specification. + */ + protected boolean supportsAdditionalPropertiesWithComposedSchema = true; + protected Map supportedLibraries = new LinkedHashMap<>(); + protected String library; + protected Boolean sortParamsByRequiredFlag = true; + protected Boolean sortModelPropertiesByRequiredFlag = false; + protected Boolean ensureUniqueParams = true; + protected Boolean allowUnicodeIdentifiers = false; + protected String httpUserAgent; + protected Boolean hideGenerationTimestamp = true; + // How to encode special characters like $ + // They are translated to words like "Dollar" and prefixed with ' + // Then translated back during JSON encoding and decoding + protected Map specialCharReplacements = new LinkedHashMap<>(); + // The extension of the generated documentation files (defaults to markdown .md) + protected String docExtension; + protected String ignoreFilePathOverride; + // flag to indicate whether to use environment variable to post process file + protected boolean enablePostProcessFile = false; + private TemplatingEngineAdapter templatingEngine = new MustacheEngineAdapter(); + + // flag to indicate whether to only update files whose contents have changed + protected boolean enableMinimalUpdate = false; + + // acts strictly upon a spec, potentially modifying it to have consistent behavior across generators. + protected boolean strictSpecBehavior = true; + // flag to indicate whether enum value prefixes are removed + protected boolean removeEnumValuePrefix = true; + + // Support legacy logic for evaluating discriminators + protected boolean legacyDiscriminatorBehavior = true; + + // Specify what to do if the 'additionalProperties' keyword is not present in a schema. + // See CodegenConstants.java for more details. + // This should be false for generators that support openapi + json schema + protected boolean disallowAdditionalPropertiesIfNotPresent = false; + + // If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response. + // With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fall back to this case. + protected boolean enumUnknownDefaultCase = false; + + // make openapi available to all methods + protected OpenAPI openAPI; + + // A cache to efficiently look up a Schema instance based on the return value of `toModelName()`. + private Map modelNameToSchemaCache; + + // A cache to efficiently lookup schema `toModelName()` based on the schema Key + private final Map schemaKeyToModelNameCache = new HashMap<>(); + + protected boolean loadDeepObjectIntoItems = true; + + // if true then baseTypes will be imported + protected boolean importBaseType = true; + + // if True codegenParameter and codegenResponse imports will come + // from deeper schema defined locations + protected boolean addSchemaImportsFromV3SpecLocations = false; + + @Override + public List cliOptions() { + return cliOptions; + } + + @Override + public void processOpts() { + + if (additionalProperties.containsKey(CodegenConstants.TEMPLATE_DIR)) { + this.setTemplateDir((String) additionalProperties.get(CodegenConstants.TEMPLATE_DIR)); + } + + if (additionalProperties.containsKey(CodegenConstants.MODEL_PACKAGE)) { + this.setModelPackage((String) additionalProperties.get(CodegenConstants.MODEL_PACKAGE)); + } + + if (additionalProperties.containsKey(CodegenConstants.API_PACKAGE)) { + this.setApiPackage((String) additionalProperties.get(CodegenConstants.API_PACKAGE)); + } + + if (additionalProperties.containsKey(CodegenConstants.HIDE_GENERATION_TIMESTAMP)) { + setHideGenerationTimestamp(convertPropertyToBooleanAndWriteBack(CodegenConstants.HIDE_GENERATION_TIMESTAMP)); + } else { + additionalProperties.put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, hideGenerationTimestamp); + } + + if (additionalProperties.containsKey(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG)) { + this.setSortParamsByRequiredFlag(Boolean.valueOf(additionalProperties + .get(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG).toString())); + } + + if (additionalProperties.containsKey(CodegenConstants.SORT_MODEL_PROPERTIES_BY_REQUIRED_FLAG)) { + this.setSortModelPropertiesByRequiredFlag(Boolean.valueOf(additionalProperties + .get(CodegenConstants.SORT_MODEL_PROPERTIES_BY_REQUIRED_FLAG).toString())); + } + + if (additionalProperties.containsKey(CodegenConstants.ENSURE_UNIQUE_PARAMS)) { + this.setEnsureUniqueParams(Boolean.valueOf(additionalProperties + .get(CodegenConstants.ENSURE_UNIQUE_PARAMS).toString())); + } + + if (additionalProperties.containsKey(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS)) { + this.setAllowUnicodeIdentifiers(Boolean.valueOf(additionalProperties + .get(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS).toString())); + } + + if (additionalProperties.containsKey(CodegenConstants.API_NAME_PREFIX)) { + this.setApiNamePrefix((String) additionalProperties.get(CodegenConstants.API_NAME_PREFIX)); + } + + if (additionalProperties.containsKey(CodegenConstants.API_NAME_SUFFIX)) { + this.setApiNameSuffix((String) additionalProperties.get(CodegenConstants.API_NAME_SUFFIX)); + } + + if (additionalProperties.containsKey(CodegenConstants.MODEL_NAME_PREFIX)) { + this.setModelNamePrefix((String) additionalProperties.get(CodegenConstants.MODEL_NAME_PREFIX)); + } + + if (additionalProperties.containsKey(CodegenConstants.MODEL_NAME_SUFFIX)) { + this.setModelNameSuffix((String) additionalProperties.get(CodegenConstants.MODEL_NAME_SUFFIX)); + } + + if (additionalProperties.containsKey(CodegenConstants.REMOVE_OPERATION_ID_PREFIX)) { + this.setRemoveOperationIdPrefix(Boolean.parseBoolean(additionalProperties + .get(CodegenConstants.REMOVE_OPERATION_ID_PREFIX).toString())); + } + + if (additionalProperties.containsKey(CodegenConstants.REMOVE_OPERATION_ID_PREFIX_DELIMITER)) { + this.setRemoveOperationIdPrefixDelimiter(additionalProperties + .get(CodegenConstants.REMOVE_OPERATION_ID_PREFIX_DELIMITER).toString()); + } + + if (additionalProperties.containsKey(CodegenConstants.REMOVE_OPERATION_ID_PREFIX_COUNT)) { + this.setRemoveOperationIdPrefixCount(Integer.parseInt(additionalProperties + .get(CodegenConstants.REMOVE_OPERATION_ID_PREFIX_COUNT).toString())); + } + + if (additionalProperties.containsKey(CodegenConstants.SKIP_OPERATION_EXAMPLE)) { + this.setSkipOperationExample(Boolean.parseBoolean(additionalProperties + .get(CodegenConstants.SKIP_OPERATION_EXAMPLE).toString())); + } + + if (additionalProperties.containsKey(CodegenConstants.DOCEXTENSION)) { + this.setDocExtension(String.valueOf(additionalProperties + .get(CodegenConstants.DOCEXTENSION).toString())); + } + + if (additionalProperties.containsKey(CodegenConstants.ENABLE_POST_PROCESS_FILE)) { + this.setEnablePostProcessFile(Boolean.parseBoolean(additionalProperties + .get(CodegenConstants.ENABLE_POST_PROCESS_FILE).toString())); + } + + if (additionalProperties.containsKey(CodegenConstants.REMOVE_ENUM_VALUE_PREFIX)) { + this.setRemoveEnumValuePrefix(Boolean.parseBoolean(additionalProperties + .get(CodegenConstants.REMOVE_ENUM_VALUE_PREFIX).toString())); + } + + if (additionalProperties.containsKey(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR)) { + this.setLegacyDiscriminatorBehavior(Boolean.parseBoolean(additionalProperties + .get(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR).toString())); + } + if (additionalProperties.containsKey(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT)) { + this.setDisallowAdditionalPropertiesIfNotPresent(Boolean.parseBoolean(additionalProperties + .get(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT).toString())); + } + if (additionalProperties.containsKey(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE)) { + this.setEnumUnknownDefaultCase(Boolean.parseBoolean(additionalProperties + .get(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE).toString())); + } + } + + /*** + * Preset map builder with commonly used Mustache lambdas. + * + * To extend the map, override addMustacheLambdas(), call parent method + * first and then add additional lambdas to the returned builder. + * + * If common lambdas are not desired, override addMustacheLambdas() method + * and return empty builder. + * + * @return map with common lambdas + */ + @SuppressWarnings("SpellCheckingInspection") + protected ImmutableMap.Builder addMustacheLambdas() { + + return new ImmutableMap.Builder() + .put("lowercase", new LowercaseLambda().generator(this)) + .put("uppercase", new UppercaseLambda()) + .put("snakecase", new SnakecaseLambda()) + .put("titlecase", new TitlecaseLambda()) + .put("camelcase", new CamelCaseLambda(true).generator(this)) + .put("pascalcase", new CamelCaseLambda(false).generator(this)) + .put("indented", new IndentedLambda()) + .put("indented_8", new IndentedLambda(8, " ")) + .put("indented_12", new IndentedLambda(12, " ")) + .put("indented_16", new IndentedLambda(16, " ")); + } + + private void registerMustacheLambdas() { + ImmutableMap lambdas = addMustacheLambdas().build(); + + if (lambdas.size() == 0) { + return; + } + + if (additionalProperties.containsKey("lambda")) { + LOGGER.error("A property called 'lambda' already exists in additionalProperties"); + throw new RuntimeException("A property called 'lambda' already exists in additionalProperties"); + } + additionalProperties.put("lambda", lambdas); + } + + // override with any special post-processing for all models + @Override + @SuppressWarnings("static-method") + public TreeMap postProcessAllModels(TreeMap schemas) { + return schemas; + } + + /** + * Return a map from model name to Schema for efficient lookup. + * + * @return map from model name to Schema. + */ + protected Map getModelNameToSchemaCache() { + if (modelNameToSchemaCache == null) { + // Create a cache to efficiently lookup schema based on model name. + Map m = new HashMap<>(); + ModelUtils.getSchemas(openAPI).forEach((key, schema) -> m.put(toModelName(key, null), schema)); + modelNameToSchemaCache = Collections.unmodifiableMap(m); + } + return modelNameToSchemaCache; + } + + @Override + public String packageName() { + // used to generate imports + return packageName; + } + + public String packagePath() { + return packageName.replace('.', File.separatorChar); + } + + /** + * Loop through all models to update different flags (e.g. isSelfReference), children models, etc + * + * @param models Map of models + * @return maps of models with various updates + */ + @Override + public TreeMap updateAllModels(TreeMap models) { + return models; + } + + // override with any special post-processing + @Override + @SuppressWarnings("static-method") + public TreeMap postProcessModels(TreeMap models) { + return models; + } + + /** + * Returns the common prefix of variables for enum naming if + * two or more variables are present + * + * @param vars List of variable names + * @return the common prefix for naming + */ + public String findCommonPrefixOfVars(List vars) { + if (!(vars.size() > 1)) { + return ""; + } + ArrayList stringVars = new ArrayList<>(); + for (Object var: vars) { + if (var instanceof String) { + stringVars.add((String) var); + } else { + return ""; + } + } + String[] stringVarsArray = Arrays.copyOf( + stringVars.toArray(), stringVars.size(), String[].class); + String prefix = StringUtils.getCommonPrefix(stringVarsArray); + if (prefix == null || prefix.isEmpty()) { + return ""; + } + // exclude trailing characters that should be part of a valid variable + // e.g. ["status-on", "status-off"] => "status-" (not "status-o") + final Matcher matcher = COMMON_PREFIX_ENUM_NAME.matcher(prefix); + return matcher.replaceAll(""); + } + + /** + * Return the sanitized variable name for enum + * + * @param value enum variable name + * @param prop the property that holds the data type booleans + * @return the sanitized variable name for enum + */ + public String toEnumVarName(String value, Schema prop) { + if (value.length() == 0) { + return "EMPTY"; + } + + String var = value.replaceAll("\\W+", "_").toUpperCase(Locale.ROOT); + if (var.matches("\\d.*")) { + return "_" + var; + } else { + return var; + } + } + + /** + * Set the OpenAPI document. + * This method is invoked when the input OpenAPI document has been parsed and validated. + */ + @Override + public void setOpenAPI(OpenAPI openAPI) { + String originalSpecVersion; + String xOriginalSwaggerVersion = "x-original-swagger-version"; + if (openAPI.getExtensions() != null && !openAPI.getExtensions().isEmpty() && openAPI.getExtensions().containsValue(xOriginalSwaggerVersion)) { + originalSpecVersion = (String) openAPI.getExtensions().get(xOriginalSwaggerVersion); + } else { + originalSpecVersion = openAPI.getOpenapi(); + } + int specMajorVersion = Integer.parseInt(originalSpecVersion.substring(0, 1)); + int specMinorVersion = Integer.parseInt(originalSpecVersion.substring(2, 3)); + boolean specVersionGreaterThanOrEqualTo310 = (specMajorVersion == 3 && specMinorVersion >= 1); + if (specVersionGreaterThanOrEqualTo310) { + LOGGER.warn(CodegenConstants.UNSUPPORTED_V310_SPEC_MSG); + } + this.openAPI = openAPI; + // Set global settings such that helper functions in ModelUtils can look up the value + // of the CLI option. + ModelUtils.setDisallowAdditionalPropertiesIfNotPresent(getDisallowAdditionalPropertiesIfNotPresent()); + } + + // override with any message to be shown right before the process finishes + @Override + @SuppressWarnings("static-method") + public void postProcess() { + System.out.println("################################################################################"); + System.out.println("# Thanks for using OpenAPI JSON Schema Generator. #"); + System.out.println("# Please consider donation to help us maintain this project \uD83D\uDE4F #"); + System.out.println("# https://github.com/sponsors/spacether #"); + System.out.println("################################################################################"); + } + + // override with any special post-processing + @Override + @SuppressWarnings("static-method") + public Map postProcessSupportingFileData(Map data) { + return data; + } + + // override to post-process any model properties + @Override + @SuppressWarnings("unused") + public void postProcessModelProperty(CodegenSchema model, CodegenSchema property) { + } + + private void preprocessOpenAPIPaths(Paths paths) { + if (paths == null) { + return; + } + Set pathsToFix = new HashSet<>(); + for (String path: paths.keySet()) { + if (!path.startsWith("/")) { + pathsToFix.add(path); + } + } + for(String path: pathsToFix) { + LOGGER.warn("Per the openapi spec, paths must begin with a slash; adding a slash onto " + path); + PathItem pathItem = paths.remove(path); + paths.put("/" + path, pathItem); + } + } + + //override with any special handling of the entire OpenAPI spec document + @Override + @SuppressWarnings("unused") + public void preprocessOpenAPI(OpenAPI openAPI) { + preprocessOpenAPIPaths(openAPI.getPaths()); + } + + // override with any special handling of the entire OpenAPI spec document + @Override + @SuppressWarnings("unused") + public void processOpenAPI(OpenAPI openAPI) { + } + + // override with any special handling of the JMustache compiler + @Override + @SuppressWarnings("unused") + public Compiler processCompiler(Compiler compiler) { + return compiler; + } + + // override with any special text escaping logic + @Override + @SuppressWarnings("static-method") + public String escapeText(String input) { + if (input == null) { + return null; + } + + // remove \t, \n, \r + // replace \ with \\ + // replace " with \" + // outer unescape to retain the original multibyte characters + // finally escalate characters avoiding code injection + return escapeUnsafeCharacters( + StringEscapeUtils.unescapeJava( + StringEscapeUtils.escapeJava(input) + .replace("\\/", "/")) + .replaceAll("[\\t\\n\\r]", " ") + .replace("\\", "\\\\") + .replace("\"", "\\\"")); + } + + /** + * Escape characters while allowing new lines + * + * @param input String to be escaped + * @return escaped string + */ + @Override + public String escapeTextWhileAllowingNewLines(String input) { + if (input == null) { + return null; + } + + // remove \t + // replace \ with \\ + // replace " with \" + // outer unescape to retain the original multibyte characters + // finally escalate characters avoiding code injection + return escapeUnsafeCharacters( + StringEscapeUtils.unescapeJava( + StringEscapeUtils.escapeJava(input) + .replace("\\/", "/")) + .replaceAll("\\t", " ") + .replace("\\", "\\\\") + .replace("\"", "\\\"")); + } + + // override with any special encoding and escaping logic + @Override + @SuppressWarnings("static-method") + public String encodePath(String input) { + return escapeText(input); + } + + /** + * override with any special text escaping logic to handle unsafe + * characters to avoid code injection + * + * @param input String to be cleaned up + * @return string with unsafe characters removed or escaped + */ + @Override + public String escapeUnsafeCharacters(String input) { + LOGGER.warn("escapeUnsafeCharacters should be overridden in the code generator with proper logic to escape " + + "unsafe characters"); + // doing nothing by default and code generator should implement + // the logic to prevent code injection + // later we'll make this method abstract to make sure + // code generator implements this method + return input; + } + + /** + * Escape single and/or double quote to avoid code injection + * + * @param input String to be cleaned up + * @return string with quotation mark removed or escaped + */ + @Override + public String escapeQuotationMark(String input) { + LOGGER.warn("escapeQuotationMark should be overridden in the code generator with proper logic to escape " + + "single/double quote"); + return input.replace("\"", "\\\""); + } + + @Override + public Map typeMapping() { + return typeMapping; + } + + @Override + public Map instantiationTypes() { + return instantiationTypes; + } + + @Override + public Set reservedWords() { + return reservedWords; + } + + @Override + public Set languageSpecificPrimitives() { + return languageSpecificPrimitives; + } + + @Override + public Map schemaMapping() { + return schemaMapping; + } + + @Override + public Map inlineSchemaNameMapping() { + return inlineSchemaNameMapping; + } + + @Override + public Map inlineSchemaNameDefault() { + return inlineSchemaNameDefault; + } + + @Override + public String testPackage() { + return testPackage; + } + + @Override + public String modelPackage() { + return modelPackage; + } + + @Override + public String apiPackage() { + return apiPackage; + } + + @Override + public String templateDir() { + return templateDir; + } + + @Override + public String embeddedTemplateDir() { + if (embeddedTemplateDir != null) { + return embeddedTemplateDir; + } else { + return templateDir; + } + } + + @Override + public Map reservedWordsMappings() { + return reservedWordsMappings; + } + + @Override + public Map apiTestTemplateFiles() { + return apiTestTemplateFiles; + } + + @Override + public Map modelTestTemplateFiles() { + return modelTestTemplateFiles; + } + + @Override + public HashMap> jsonPathTemplateFiles() { + return jsonPathTemplateFiles; + } + + @Override + public HashMap> jsonPathDocTemplateFiles() { + return jsonPathDocTemplateFiles; + } + + @Override + public Set pathEndpointTestTemplateFiles() { return pathEndpointTestTemplateFiles; } + + public String toResponseModuleName(String componentName, String jsonPath) { return toModuleFilename(componentName, jsonPath); } + + public String getCamelCaseResponse(String componentName) { return toModelName(componentName, null); } + + public String toHeaderFilename(String componentName, String jsonPath) { return toModuleFilename(componentName, jsonPath); } + + @Override + public String apiFileFolder() { + return outputFolder + File.separator + apiPackage().replace('.', File.separatorChar); + } + + @Override + public String apiTestFileFolder() { + return outputFolder + File.separator + testPackage().replace('.', File.separatorChar); + } + + @Override + public String modelTestFileFolder() { + return outputFolder + File.separator + testPackage().replace('.', File.separatorChar); + } + + @Override + public String apiDocFileFolder() { + return outputFolder; + } + + @Override + public Map additionalProperties() { + return additionalProperties; + } + + @Override + public Map serverVariableOverrides() { + return serverVariables; + } + + @Override + public Map vendorExtensions() { + return vendorExtensions; + } + + @Override + public List supportingFiles() { + return supportingFiles; + } + + @Override + public String outputFolder() { + return outputFolder; + } + + @Override + public void setOutputDir(String dir) { + this.outputFolder = dir; + } + + @Override + public String getOutputDir() { + return outputFolder(); + } + + @Override + public String getInputSpec() { + return inputSpec; + } + + @Override + public void setInputSpec(String inputSpec) { + this.inputSpec = inputSpec; + } + + @Override + public String getFilesMetadataFilename() { + return filesMetadataFilename; + } + + @Override + public String getVersionMetadataFilename() { + return versionMetadataFilename; + } + + public void setTemplateDir(String templateDir) { + this.templateDir = templateDir; + } + + public void setModelPackage(String modelPackage) { + this.modelPackage = modelPackage; + } + + public void setModelNamePrefix(String modelNamePrefix) { + this.modelNamePrefix = modelNamePrefix; + } + + public void setModelNameSuffix(String modelNameSuffix) { + this.modelNameSuffix = modelNameSuffix; + } + + public void setApiNameSuffix(String apiNameSuffix) { + this.apiNameSuffix = apiNameSuffix; + } + + public void setApiNamePrefix(String apiNamePrefix) { + this.apiNamePrefix = apiNamePrefix; + } + + public void setApiPackage(String apiPackage) { + this.apiPackage = apiPackage; + } + + public Boolean getSortParamsByRequiredFlag() { + return sortParamsByRequiredFlag; + } + + public void setSortParamsByRequiredFlag(Boolean sortParamsByRequiredFlag) { + this.sortParamsByRequiredFlag = sortParamsByRequiredFlag; + } + + public Boolean getSortModelPropertiesByRequiredFlag() { + return sortModelPropertiesByRequiredFlag; + } + + public void setSortModelPropertiesByRequiredFlag(Boolean sortModelPropertiesByRequiredFlag) { + this.sortModelPropertiesByRequiredFlag = sortModelPropertiesByRequiredFlag; + } + public void setEnsureUniqueParams(Boolean ensureUniqueParams) { + this.ensureUniqueParams = ensureUniqueParams; + } + + public Boolean getLegacyDiscriminatorBehavior() { + return legacyDiscriminatorBehavior; + } + + public void setLegacyDiscriminatorBehavior(boolean val) { + this.legacyDiscriminatorBehavior = val; + } + + public Boolean getDisallowAdditionalPropertiesIfNotPresent() { + return disallowAdditionalPropertiesIfNotPresent; + } + + public void setDisallowAdditionalPropertiesIfNotPresent(boolean val) { + this.disallowAdditionalPropertiesIfNotPresent = val; + } + + public Boolean getEnumUnknownDefaultCase() { + return enumUnknownDefaultCase; + } + + public void setEnumUnknownDefaultCase(boolean val) { + this.enumUnknownDefaultCase = val; + } + + public void setAllowUnicodeIdentifiers(Boolean allowUnicodeIdentifiers) { + this.allowUnicodeIdentifiers = allowUnicodeIdentifiers; + } + + /** + * Return the regular expression/JSON schema pattern h... * + * @param pattern the pattern (regular expression) + * @return properly-escaped pattern + */ + @Override + public CodegenPatternInfo getPatternInfo(String pattern) { + if (pattern == null) { + return null; + } + return addRegularExpressionDelimiter(escapeText(pattern)); + } + + /** + * Return the file name of the Api Test + * + * @param name the file name of the Api + * @return the file name of the Api + */ + @Override + public String toApiFilename(String name) { + return toApiName(name); + } + + /** + * Return the file name of the Api Documentation + * + * @param name the file name of the Api + * @return the file name of the Api + */ + @Override + public String toApiDocFilename(String name) { + return toApiName(name); + } + + /** + * Return the file name of the Api Test + * + * @param name the file name of the Api + * @return the file name of the Api + */ + @Override + public String toApiTestFilename(String name) { + return toApiName(name) + "Test"; + } + + /** + * Return the variable name in the Api + * + * @param name the variable name of the Api + * @return the snake-cased variable name + */ + @Override + public String toApiVarName(String name) { + return lowerCamelCase(name); + } + + /** + * Return the capitalized file name of the model + * + * @param name the model name + * @return the file name of the model + */ + @Override + public String toModelFilename(String name, String jsonPath) { + return toModuleFilename(name, jsonPath); + } + + @Override + public String toModuleFilename(String name, String jsonPath) { + return org.openapijsonschematools.codegen.utils.StringUtils.camelize(name); + } + + public String toPathFilename(String name, String jsonPath) { + return toModuleFilename(name, jsonPath); + } + + @Override + public String toParameterFilename(String basename, String jsonPath) { + return toModuleFilename(basename, jsonPath); + } + + @Override + public String toSecuritySchemeFilename(String basename, String jsonPath) { + return toModuleFilename(basename, jsonPath); + } + + @Override + public String toServerFilename(String basename, String jsonPath) { + return toModuleFilename(basename, jsonPath); + } + + @Override + public String toSecurityRequirementObjectFilename(String basename, String jsonPath) { + return toModuleFilename(basename, jsonPath); + } + + @Override + public String getCamelCaseServer(String basename) { + return toModelName(basename, null); + } + + public String getCamelCaseParameter(String basename) { + return toModelName(basename, null); + } + + /** + * Return the capitalized file name of the model test + * + * @param name the model name + * @return the file name of the model + */ + @Override + public String toModelTestFilename(String name) { + return org.openapijsonschematools.codegen.utils.StringUtils.camelize(name) + "Test"; + } + + /** + * Returns metadata about the generator. + * + * @return A provided {@link GeneratorMetadata} instance + */ + @Override + public GeneratorMetadata getGeneratorMetadata() { + return generatorMetadata; + } + + /** + * Return the variable name by removing invalid characters and proper escaping if + * it's a reserved word. + * + * @param name the variable name + * @return the sanitized variable name + */ + public String toVarName(final String name) { + if (reservedWords.contains(name)) { + return escapeReservedWord(name); + } else if (name.chars().anyMatch(character -> specialCharReplacements.containsKey(String.valueOf((char) character)))) { + return org.openapijsonschematools.codegen.utils.StringUtils.escape(name, specialCharReplacements, null, null); + } + return name; + } + + /** + * Return the parameter name by removing invalid characters and proper escaping if + * it's a reserved word. + * + * @param name Codegen property object + * @return the sanitized parameter name + */ + @Override + public String toParamName(String name) { + name = removeNonNameElementToCamelCase(name); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'. + if (reservedWords.contains(name)) { + return escapeReservedWord(name); + } else if (name.chars().anyMatch(character -> specialCharReplacements.containsKey(String.valueOf((char) character)))) { + return org.openapijsonschematools.codegen.utils.StringUtils.escape(name, specialCharReplacements, null, null); + } + return name; + + } + + /** + * Return the escaped name of the reserved word + * + * @param name the name to be escaped + * @return the escaped reserved word + *

    + * throws Runtime exception as reserved word is not allowed (default behavior) + */ + @Override + @SuppressWarnings("static-method") + public String escapeReservedWord(String name) { + throw new RuntimeException("reserved word " + name + " not allowed"); + } + + /** + * Return the fully-qualified "Model" name for import + * + * @param refClass the name of the "Model" + * @return the fully-qualified "Model" name for import + */ + @Override + public String toModelImport(String refClass) { + if ("".equals(modelPackage())) { + return refClass; + } else { + return modelPackage() + "." + refClass; + } + } + + /** + * Returns the same content as [[toModelImport]] with key the fully-qualified Model name and value the initial input. + * In case of union types this method has a key for each separate model and import. + * + * @param name the name of the "Model" + * @return Map of fully-qualified models. + */ + @Override + public Map toModelImportMap(String name) { + return Collections.singletonMap(this.toModelImport(name), name); + } + + /** + * Return the fully-qualified "Api" name for import + * + * @param name the name of the "Api" + * @return the fully-qualified "Api" name for import + */ + @Override + public String toApiImport(String name) { + return apiPackage() + "." + name; + } + + /** + * Default constructor. + * This method will map between OAS type and language-specified type, as well as mapping + * between OAS type and the corresponding import statement for the language. This will + * also add some language specified CLI options, if any. + * returns string presentation of the example path (it's a constructor) + */ + public DefaultCodegen() { + CodegenType codegenType = getTag(); + if (codegenType == null) { + codegenType = CodegenType.OTHER; + } + + generatorMetadata = GeneratorMetadata.newBuilder() + .stability(Stability.STABLE) + .featureSet(DefaultFeatureSet) + .generationMessage(String.format(Locale.ROOT, "OpenAPI JSON Schema Generator: %s (%s)", getName(), codegenType.toValue())) + .build(); + + defaultIncludes = new HashSet<>( + Arrays.asList("double", + "int", + "long", + "short", + "char", + "float", + "String", + "boolean", + "Boolean", + "Double", + "Void", + "Integer", + "Long", + "Float") + ); + + typeMapping = new HashMap<>(); + typeMapping.put("array", "List"); + typeMapping.put("set", "Set"); + typeMapping.put("map", "Map"); + typeMapping.put("boolean", "Boolean"); + typeMapping.put("string", "String"); + typeMapping.put("int", "Integer"); + typeMapping.put("float", "Float"); + typeMapping.put("double", "Double"); + typeMapping.put("number", "BigDecimal"); + typeMapping.put("decimal", "BigDecimal"); + typeMapping.put("DateTime", "Date"); + typeMapping.put("long", "Long"); + typeMapping.put("short", "Short"); + typeMapping.put("char", "String"); + typeMapping.put("object", "Object"); + typeMapping.put("integer", "Integer"); + // FIXME: java specific type should be in Java Based Abstract Implementations + typeMapping.put("ByteArray", "byte[]"); + typeMapping.put("binary", "File"); + typeMapping.put("file", "File"); + typeMapping.put("UUID", "UUID"); + typeMapping.put("URI", "URI"); + typeMapping.put("AnyType", "oas_any_type_not_mapped"); + + instantiationTypes = new HashMap<>(); + + reservedWords = new HashSet<>(); + + cliOptions.add(CliOption.newBoolean(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, + CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG_DESC).defaultValue(Boolean.TRUE.toString())); + cliOptions.add(CliOption.newBoolean(CodegenConstants.SORT_MODEL_PROPERTIES_BY_REQUIRED_FLAG, + CodegenConstants.SORT_MODEL_PROPERTIES_BY_REQUIRED_FLAG_DESC).defaultValue(Boolean.TRUE.toString())); + cliOptions.add(CliOption.newBoolean(CodegenConstants.ENSURE_UNIQUE_PARAMS, CodegenConstants + .ENSURE_UNIQUE_PARAMS_DESC).defaultValue(Boolean.TRUE.toString())); + // name formatting options + cliOptions.add(CliOption.newBoolean(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, CodegenConstants + .ALLOW_UNICODE_IDENTIFIERS_DESC).defaultValue(Boolean.FALSE.toString())); + // option to change the order of form/body parameter + cliOptions.add(CliOption.newBoolean(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, + CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS_DESC).defaultValue(Boolean.FALSE.toString())); + + // option to change how we process + set the data in the discriminator mapping + CliOption legacyDiscriminatorBehaviorOpt = CliOption.newBoolean(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR_DESC).defaultValue(Boolean.TRUE.toString()); + Map legacyDiscriminatorBehaviorOpts = new HashMap<>(); + legacyDiscriminatorBehaviorOpts.put("true", "The mapping in the discriminator includes descendant schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document."); + legacyDiscriminatorBehaviorOpts.put("false", "The mapping in the discriminator includes any descendant schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing."); + legacyDiscriminatorBehaviorOpt.setEnum(legacyDiscriminatorBehaviorOpts); + cliOptions.add(legacyDiscriminatorBehaviorOpt); + + // option to change how we process + set the data in the 'additionalProperties' keyword. + CliOption disallowAdditionalPropertiesIfNotPresentOpt = CliOption.newBoolean( + CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, + CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT_DESC).defaultValue(Boolean.TRUE.toString()); + Map disallowAdditionalPropertiesIfNotPresentOpts = new HashMap<>(); + disallowAdditionalPropertiesIfNotPresentOpts.put("false", + "The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications."); + disallowAdditionalPropertiesIfNotPresentOpts.put("true", + "Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default."); + disallowAdditionalPropertiesIfNotPresentOpt.setEnum(disallowAdditionalPropertiesIfNotPresentOpts); + cliOptions.add(disallowAdditionalPropertiesIfNotPresentOpt); + + CliOption enumUnknownDefaultCaseOpt = CliOption.newBoolean( + CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, + CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE_DESC).defaultValue(Boolean.FALSE.toString()); + Map enumUnknownDefaultCaseOpts = new HashMap<>(); + enumUnknownDefaultCaseOpts.put("false", + "No changes to the enum's are made, this is the default option."); + enumUnknownDefaultCaseOpts.put("true", + "With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case."); + enumUnknownDefaultCaseOpt.setEnum(enumUnknownDefaultCaseOpts); + cliOptions.add(enumUnknownDefaultCaseOpt); + this.setEnumUnknownDefaultCase(false); + + // initialize special character mapping + initializeSpecialCharacterMapping(); + + // Register common Mustache lambdas. + registerMustacheLambdas(); + } + + /** + * Initialize special character mapping + */ + protected void initializeSpecialCharacterMapping() { + // Initialize special characters + specialCharReplacements.put("$", "Dollar"); + specialCharReplacements.put("^", "Caret"); + specialCharReplacements.put("|", "Pipe"); + specialCharReplacements.put("=", "Equal"); + specialCharReplacements.put("*", "Star"); + specialCharReplacements.put("-", "Minus"); + specialCharReplacements.put("&", "Ampersand"); + specialCharReplacements.put("%", "Percent"); + specialCharReplacements.put("#", "Hash"); + specialCharReplacements.put("@", "At"); + specialCharReplacements.put("!", "Exclamation"); + specialCharReplacements.put("+", "Plus"); + specialCharReplacements.put(":", "Colon"); + specialCharReplacements.put(";", "Semicolon"); + specialCharReplacements.put(">", "Greater_Than"); + specialCharReplacements.put("<", "Less_Than"); + specialCharReplacements.put(".", "Period"); + specialCharReplacements.put("_", "Underscore"); + specialCharReplacements.put("?", "Question_Mark"); + specialCharReplacements.put(",", "Comma"); + specialCharReplacements.put("'", "Quote"); + specialCharReplacements.put("\"", "Double_Quote"); + specialCharReplacements.put("/", "Slash"); + specialCharReplacements.put("\\", "Back_Slash"); + specialCharReplacements.put("(", "Left_Parenthesis"); + specialCharReplacements.put(")", "Right_Parenthesis"); + specialCharReplacements.put("{", "Left_Curly_Bracket"); + specialCharReplacements.put("}", "Right_Curly_Bracket"); + specialCharReplacements.put("[", "Left_Square_Bracket"); + specialCharReplacements.put("]", "Right_Square_Bracket"); + specialCharReplacements.put("~", "Tilde"); + specialCharReplacements.put("`", "Backtick"); + + specialCharReplacements.put("<=", "Less_Than_Or_Equal_To"); + specialCharReplacements.put(">=", "Greater_Than_Or_Equal_To"); + specialCharReplacements.put("!=", "Not_Equal"); + specialCharReplacements.put("<>", "Not_Equal"); + specialCharReplacements.put("~=", "Tilde_Equal"); + } + + /** + * Return the symbol name of a symbol + * + * @param input Symbol (e.g. $) + * @return Symbol name (e.g. Dollar) + */ + protected String getSymbolName(String input) { + return specialCharReplacements.get(input); + } + + public String toExampleValue(Schema schema, Object objExample) { + return null; + } + + + /** + * Return the example value of the parameter. + * + * @param header Header + * @return string example + */ + public String getHeaderExampleValue(Header header) { + if (header.getExample() != null) { + return header.getExample().toString(); + } + + if (header.getExamples() != null && !header.getExamples().isEmpty()) { + Example example = header.getExamples().values().iterator().next(); + if (example.getValue() != null) { + return example.getValue().toString(); + } + } + + Schema schema = header.getSchema(); + if (schema != null && schema.getExample() != null) { + return schema.getExample().toString(); + } + // TODO add content-type + // TODO add calculated example from CodegenHeader.schema + return null; + } + + /** + * Return the example value of the parameter. + * + * @param parameter Parameter + * @return string example + */ + public String getParameterExampleValue(Parameter parameter) { + if (parameter.getExample() != null) { + return parameter.getExample().toString(); + } + + if (parameter.getExamples() != null && !parameter.getExamples().isEmpty()) { + Example example = parameter.getExamples().values().iterator().next(); + if (example.getValue() != null) { + return example.getValue().toString(); + } + } + + Schema schema = parameter.getSchema(); + if (schema != null && schema.getExample() != null) { + return schema.getExample().toString(); + } + + if (parameter.getExtensions() != null && parameter.getExtensions().containsKey("x-example")) { + return Json.pretty(parameter.getExtensions().get("x-example")); + } + return null; + } + + /** + * Return the example value of the property + * + * @param schema Property schema + * @return string presentation of the example value of the property + */ + public String toExampleValue(Schema schema) { + if (schema.getExample() != null) { + return schema.getExample().toString(); + } + + return getPropertyDefaultValue(schema); + } + + /** + * Return the default value of the property + *

    + * Return null if you do NOT want a default value. + * Any non-null value will cause {{#defaultValue} check to pass. + * + * @param schema Property schema + * @return string presentation of the default value of the property + */ + @SuppressWarnings("static-method") + public EnumValue toDefaultValue(Schema schema) { + if (schema.getDefault() != null) { + return getEnumValue(schema.getDefault(), null); + } + + return null; + } + + /** + * Return property value depending on property type. + * + * @param schema property type + * @return property value + */ + @SuppressWarnings("squid:S3923") + private String getPropertyDefaultValue(Schema schema) { + /* + * Although all branches return null, this is left intentionally as examples for new contributors + */ + if (ModelUtils.isBooleanSchema(schema)) { + return "null"; + } else if (ModelUtils.isDateSchema(schema)) { + return "null"; + } else if (ModelUtils.isDateTimeSchema(schema)) { + return "null"; + } else if (ModelUtils.isNumberSchema(schema)) { + return "null"; + } else if (ModelUtils.isIntegerSchema(schema)) { + return "null"; + } else if (ModelUtils.isStringSchema(schema)) { + return "null"; + } else if (ModelUtils.isObjectSchema(schema)) { + return "null"; + } else { + return "null"; + } + } + + /** + * Return the lowerCamelCase of the string + * + * @param name string to be lowerCamelCased + * @return lowerCamelCase string + */ + @SuppressWarnings("static-method") + public String lowerCamelCase(String name) { + return (name.length() > 0) ? (Character.toLowerCase(name.charAt(0)) + name.substring(1)) : ""; + } + + /** + * Output the API (class) name (capitalized) ending with the specified or default suffix + * Return DefaultApi if name is empty + * + * @param name the name of the Api + * @return capitalized Api name + */ + @Override + public String toApiName(String name) { + if (name.length() == 0) { + return "DefaultApi"; + } + return org.openapijsonschematools.codegen.utils.StringUtils.camelize(apiNamePrefix + "_" + name + "_" + apiNameSuffix); + } + + /** + * Converts the OpenAPI schema name to a model name suitable for the current code generator. + * May be overridden for each programming language. + * In case the name belongs to the TypeSystem it won't be renamed. + * + * @param name the name of the model + * @return capitalized model name + */ + @Override + public String toModelName(final String name, String jsonPath) { + if (schemaKeyToModelNameCache.containsKey(name)) { + return schemaKeyToModelNameCache.get(name); + } + + String camelCaseName = org.openapijsonschematools.codegen.utils.StringUtils.camelize(modelNamePrefix + "_" + name + "_" + modelNameSuffix); + schemaKeyToModelNameCache.put(name, camelCaseName); + return camelCaseName; + } + + Map codegenSchemaCache = new HashMap<>(); + // json path to instance + Map codegenResponseCache = new HashMap<>(); + Map codegenHeaderCache = new HashMap<>(); + Map codegenRequestBodyCache = new HashMap<>(); + Map codegenSecuritySchemeCache = new HashMap<>(); + Map codegenSecurityRequirementCache = new HashMap<>(); + + Map codegenParameterCache = new HashMap<>(); + Map codegenTagCache = new HashMap<>(); + private final CodegenSchema requiredAddPropUnsetSchema = fromSchema(new Schema(), null, null); + + protected void updateModelForComposedSchema(CodegenSchema m, Schema schema, String sourceJsonPath) { + final ComposedSchema composed = (ComposedSchema) schema; + + // TODO revise the logic below to set discriminator + if (composed.getAllOf() != null) { + int modelImplCnt = 0; // only one inline object allowed in a ComposedModel + int modelDiscriminators = 0; // only one discriminator allowed in a ComposedModel + for (Schema innerSchema : composed.getAllOf()) { // TODO need to work with anyOf, oneOf as well + if (m.discriminator == null && innerSchema.getDiscriminator() != null) { + LOGGER.debug("discriminator is set to null (not correctly set earlier): {}", m.jsonPathPiece); + m.discriminator = createDiscriminator(m.jsonPathPiece.original, innerSchema, this.openAPI, sourceJsonPath); + modelDiscriminators++; + } + + if (modelDiscriminators > 1) { + LOGGER.error("allOf composed schema is inheriting >1 discriminator. Only use one discriminator: {}", composed); + } + + if (modelImplCnt++ > 1) { + LOGGER.warn("More than one inline schema specified in allOf:. Only the first one is recognized. All others are ignored."); + break; // only one schema with discriminator allowed in allOf + } + } + } + } + + protected String toTestCaseName(String specTestCaseName) { + return specTestCaseName; + } + + protected EnumValue getEnumValue(Object value, String description) { + Object usedValue = value; + String type = null; + if (value instanceof Integer){ + type = "integer"; + } else if (value instanceof Double || value instanceof Float || value instanceof BigDecimal){ + type = "number"; + } else if (value instanceof String) { + type = "string"; + usedValue = handleSpecialCharacters((String) value); + } else if (value instanceof LinkedHashMap) { + LinkedHashMap castMap = new LinkedHashMap<>(); + for (Map.Entry entry: ((LinkedHashMap) value).entrySet()) { + String entryKey = handleSpecialCharacters((String) entry.getKey()); + Object entryValue = entry.getValue(); + EnumValue castValue = getEnumValue(entryValue, null); + castMap.put(entryKey, castValue); + } + type = "object"; + usedValue = castMap; + } else if (value instanceof ArrayList) { + ArrayList castList = new ArrayList<>(); + for (Object item: (ArrayList) value) { + EnumValue castItem = getEnumValue(item, null); + castList.add(castItem); + } + type = "array"; + usedValue = castList; + } else if (value instanceof Boolean) { + type = "boolean"; + } else if (value == null) { + type = "null"; + } + return new EnumValue(usedValue, type, description); + } + + /** + * Processes any test cases if they exist in the components.x-test-examples vendor extensions + * If they exist then cast them to java class instances and return them back in a map + * @param refToTestCases the component schema name that the test cases are for + */ + private HashMap extractSchemaTestCases(String refToTestCases) { + // schemaName to a map of test case name to test case + HashMap vendorExtensions = (HashMap) openAPI.getComponents().getExtensions(); + if (vendorExtensions == null || !vendorExtensions.containsKey(xSchemaTestExamplesKey)) { + return null; + } + if (!refToTestCases.startsWith(xSchemaTestExamplesRefPrefix)) { + return null; + } + String schemaName = refToTestCases.substring(xSchemaTestExamplesRefPrefix.length()); + HashMap schemaTestCases = new HashMap<>(); + Object rawData = vendorExtensions.get(xSchemaTestExamplesKey); + LinkedHashMap schemaNameToTestCases = new LinkedHashMap<>(); + if (rawData instanceof LinkedHashMap) { + for (Entry entry: ((LinkedHashMap) rawData).entrySet()) { + String key = (String) entry.getKey(); + Object value = entry.getValue(); + schemaNameToTestCases.put(key, value); + } + } else { + return null; + } + + if (!schemaNameToTestCases.containsKey(schemaName)) { + return null; + } + rawData = schemaNameToTestCases.get(schemaName); + if (!(rawData instanceof LinkedHashMap)) { + return null; + } + for (Entry entry: ((LinkedHashMap) rawData).entrySet()) { + String nameInSnakeCase = toTestCaseName((String) entry.getKey()); + Object testExample = entry.getValue(); + if (!(testExample instanceof LinkedHashMap)) { + continue; + } + LinkedHashMap castTestExample = (LinkedHashMap) testExample; + Object data = castTestExample.get("data"); + String description = (String) castTestExample.get("description"); + boolean valid = (boolean) castTestExample.get("valid"); + SchemaTestCase testCase = new SchemaTestCase( + description, + getEnumValue(data, null), + valid + ); + schemaTestCases.put(nameInSnakeCase, testCase); + } + return schemaTestCases; + } + + protected CodegenSchema getAdditionalProperties(Schema schema, String sourceJsonPath, String currentJsonPath) { + if (schema.getAdditionalProperties() == null) { + return null; + } + String additionalPropertiesJsonPath = currentJsonPath + "/additionalProperties"; + if (schema.getAdditionalProperties() instanceof Boolean) { + Schema usedSchema = getSchemaFromBooleanOrSchema(schema.getAdditionalProperties()); + return fromSchema(usedSchema, sourceJsonPath, additionalPropertiesJsonPath); + } else { + return fromSchema((Schema) schema.getAdditionalProperties(), sourceJsonPath, additionalPropertiesJsonPath); + } + } + + /** + * Recursively look in Schema sc for the discriminator discPropName + * and return a CodegenSchema with the dataType and required params set + * the returned CodegenSchema may not be required, and it may not be of type string + * + * @param composedSchemaName The name of the sc Schema + * @param sc The Schema that may contain the discriminator + * @param discPropName The String that is the discriminator propertyName in the schema + */ + private CodegenSchema discriminatorFound(String composedSchemaName, Schema sc, String discPropName, OpenAPI openAPI) { + Schema refSchema = ModelUtils.getReferencedSchema(openAPI, sc); + if (refSchema.getProperties() != null && refSchema.getProperties().get(discPropName) != null) { + return new CodegenSchema(); + } + if (ModelUtils.isComposedSchema(refSchema)) { + ComposedSchema composedSchema = (ComposedSchema) refSchema; + if (composedSchema.getAllOf() != null) { + // If our discriminator is in one of the allOf schemas break when we find it + for (Schema allOf : composedSchema.getAllOf()) { + CodegenSchema cp = discriminatorFound(composedSchemaName, allOf, discPropName, openAPI); + if (cp != null) { + return cp; + } + } + } + if (composedSchema.getOneOf() != null && composedSchema.getOneOf().size() != 0) { + // All oneOf definitions must contain the discriminator + CodegenSchema cp = new CodegenSchema(); + for (Schema oneOf : composedSchema.getOneOf()) { + String modelName = ModelUtils.getSimpleRef(oneOf.get$ref()); + CodegenSchema thisCp = discriminatorFound(composedSchemaName, oneOf, discPropName, openAPI); + if (thisCp == null) { + LOGGER.warn( + "'{}' defines discriminator '{}', but the referenced OneOf schema '{}' is missing {}", + composedSchemaName, discPropName, modelName, discPropName); + } + if (cp != null && cp.refInfo == null) { + cp = thisCp; + continue; + } + if (cp != thisCp) { + LOGGER.warn( + "'{}' defines discriminator '{}', but the OneOf schema '{}' has a different {} definition than the prior OneOf schema's. Make sure the {} type and required values are the same", + composedSchemaName, discPropName, modelName, discPropName, discPropName); + } + } + return cp; + } + if (composedSchema.getAnyOf() != null && composedSchema.getAnyOf().size() != 0) { + // All anyOf definitions must contain the discriminator because a min of one must be selected + CodegenSchema cp = new CodegenSchema(); + for (Schema anyOf : composedSchema.getAnyOf()) { + String modelName = ModelUtils.getSimpleRef(anyOf.get$ref()); + CodegenSchema thisCp = discriminatorFound(composedSchemaName, anyOf, discPropName, openAPI); + if (thisCp == null) { + LOGGER.warn( + "'{}' defines discriminator '{}', but the referenced AnyOf schema '{}' is missing {}", + composedSchemaName, discPropName, modelName, discPropName); + } + if (cp != null && cp.refInfo == null) { + cp = thisCp; + continue; + } + if (cp != thisCp) { + LOGGER.warn( + "'{}' defines discriminator '{}', but the AnyOf schema '{}' has a different {} definition than the prior AnyOf schema's. Make sure the {} type and required values are the same", + composedSchemaName, discPropName, modelName, discPropName, discPropName); + } + } + return cp; + + } + } + return null; + } + + /** + * Recursively look in Schema sc for the discriminator and return it + * Schema sc location + * + * @param sc The Schema that may contain the discriminator + * @param openAPI the spec that is used + */ + private Discriminator recursiveGetDiscriminator(Schema sc, OpenAPI openAPI) { + Schema refSchema = ModelUtils.getReferencedSchema(openAPI, sc); + Discriminator foundDisc = refSchema.getDiscriminator(); + if (foundDisc != null) { + return foundDisc; + } + + if (this.getLegacyDiscriminatorBehavior()) { + return null; + } + Discriminator disc = new Discriminator(); + if (ModelUtils.isComposedSchema(refSchema)) { + ComposedSchema composedSchema = (ComposedSchema) refSchema; + if (composedSchema.getAllOf() != null) { + // If our discriminator is in one of the allOf schemas break when we find it + for (Schema allOf : composedSchema.getAllOf()) { + foundDisc = recursiveGetDiscriminator(allOf, openAPI); + if (foundDisc != null) { + disc.setPropertyName(foundDisc.getPropertyName()); + disc.setMapping(foundDisc.getMapping()); + return disc; + } + } + } + if (composedSchema.getOneOf() != null && composedSchema.getOneOf().size() != 0) { + // All oneOf definitions must contain the discriminator + Integer hasDiscriminatorCnt = 0; + Integer hasNullTypeCnt = 0; + Set discriminatorsPropNames = new HashSet<>(); + for (Schema oneOf : composedSchema.getOneOf()) { + if (ModelUtils.isNullType(oneOf)) { + // The null type does not have a discriminator. Skip. + hasNullTypeCnt++; + continue; + } + foundDisc = recursiveGetDiscriminator(oneOf, openAPI); + if (foundDisc != null) { + discriminatorsPropNames.add(foundDisc.getPropertyName()); + hasDiscriminatorCnt++; + } + } + if (foundDisc != null && (hasDiscriminatorCnt + hasNullTypeCnt) == composedSchema.getOneOf().size() && discriminatorsPropNames.size() == 1) { + disc.setPropertyName(foundDisc.getPropertyName()); + disc.setMapping(foundDisc.getMapping()); + return disc; + } + // If the scenario when oneOf has two children and one of them is the 'null' type, + // there is no need for a discriminator. + } + if (composedSchema.getAnyOf() != null && composedSchema.getAnyOf().size() != 0) { + // All anyOf definitions must contain the discriminator because a min of one must be selected + Integer hasDiscriminatorCnt = 0; + Integer hasNullTypeCnt = 0; + Set discriminatorsPropNames = new HashSet<>(); + for (Schema anyOf : composedSchema.getAnyOf()) { + if (ModelUtils.isNullType(anyOf)) { + // The null type does not have a discriminator. Skip. + hasNullTypeCnt++; + continue; + } + foundDisc = recursiveGetDiscriminator(anyOf, openAPI); + if (foundDisc != null) { + discriminatorsPropNames.add(foundDisc.getPropertyName()); + hasDiscriminatorCnt++; + } + } + if (foundDisc != null && (hasDiscriminatorCnt + hasNullTypeCnt) == composedSchema.getAnyOf().size() && discriminatorsPropNames.size() == 1) { + disc.setPropertyName(foundDisc.getPropertyName()); + disc.setMapping(foundDisc.getMapping()); + return disc; + } + // If the scenario when anyOf has two children and one of them is the 'null' type, + // there is no need for a discriminator. + } + } + return null; + } + + /** + * This function is only used for composed schemas which have a discriminator + * Process oneOf and anyOf models in a composed schema and adds them into + * a list if the oneOf and anyOf models contain + * the required discriminator. If they don't contain the required + * discriminator or the discriminator is the wrong type then an error is + * thrown + * + * @param composedSchemaName The String model name of the composed schema where we are setting the discriminator map + * @param discPropName The String that is the discriminator propertyName in the schema + * @param c The ComposedSchema that contains the discriminator and oneOf/anyOf schemas + * @param openAPI The OpenAPI spec that we are using + * @param sourceJsonPath The json path location being examined + * @return the list of oneOf and anyOf MappedModel that need to be added to the discriminator map + */ + protected List getOneOfAnyOfDescendants(String composedSchemaName, String discPropName, ComposedSchema c, OpenAPI openAPI, String sourceJsonPath) { + ArrayList> listOLists = new ArrayList<>(); + listOLists.add(c.getOneOf()); + listOLists.add(c.getAnyOf()); + List descendantSchemas = new ArrayList<>(); + for (List schemaList : listOLists) { + if (schemaList == null) { + continue; + } + for (Schema sc : schemaList) { + if (ModelUtils.isNullType(sc)) { + continue; + } + String ref = sc.get$ref(); + if (ref == null) { + // for schemas with no ref, it is not possible to build the discriminator map + // because ref is how we get the model name + // we only hit this use case for a schema with inline composed schemas, and one of those + // schemas also has inline composed schemas + // Note: if it is only inline one level, then the inline model resolver will move it into its own + // schema and make it a $ref schema in the oneOf/anyOf location + LOGGER.warn( + "Invalid inline schema defined in oneOf/anyOf in '{}'. Per the OpenApi spec, for this case when a composed schema defines a discriminator, the oneOf/anyOf schemas must use $ref. Change this inline definition to a $ref definition", + composedSchemaName); + continue; + } + CodegenSchema df = discriminatorFound(composedSchemaName, sc, discPropName, openAPI); + String modelName = ModelUtils.getSimpleRef(ref); + if (df == null || df.types != null && !df.types.contains("string")) { + String msgSuffix = ""; + if (df == null) { + msgSuffix += discPropName + " is missing from the schema, define it as required and type string"; + } else { + if (!df.types.contains("string")) { + msgSuffix += "invalid type for " + discPropName + ", set it to string"; + } + } + LOGGER.warn("'{}' defines discriminator '{}', but the referenced schema '{}' is incorrect. {}", + composedSchemaName, discPropName, modelName, msgSuffix); + } + String refClass = getRefClassWithModule("#/components/schemas/" + modelName, sourceJsonPath); + MappedModel mm = new MappedModel(modelName, refClass); + descendantSchemas.add(mm); + Schema cs = ModelUtils.getSchema(openAPI, modelName); + if (cs == null) { // cannot look up the model based on the name + LOGGER.error("Failed to lookup the schema '{}' when processing oneOf/anyOf. Please check to ensure it's defined properly.", modelName); + } else { + Map vendorExtensions = cs.getExtensions(); + if (vendorExtensions != null && !vendorExtensions.isEmpty() && vendorExtensions.containsKey("x-discriminator-value")) { + String xDiscriminatorValue = (String) vendorExtensions.get("x-discriminator-value"); + refClass = getRefClassWithModule("#/components/schemas/" + modelName, sourceJsonPath); + mm = new MappedModel(xDiscriminatorValue, refClass); + descendantSchemas.add(mm); + } + } + } + } + return descendantSchemas; + } + + protected List getAllOfDescendants(String thisSchemaName, OpenAPI openAPI, String sourceJsonPath) { + ArrayList queue = new ArrayList<>(); + List descendantSchemas = new ArrayList<>(); + Map schemas = ModelUtils.getSchemas(openAPI); + String currentSchemaName = thisSchemaName; + Set keys = schemas.keySet(); + + int count = 0; + // hack: avoid infinite loop on potential self-references in event our checks fail. + while (100000 > count++) { + for (String childName : keys) { + if (childName.equals(thisSchemaName)) { + // skip the source schema + continue; + } + Schema child = schemas.get(childName); + if (ModelUtils.isComposedSchema(child)) { + ComposedSchema composedChild = (ComposedSchema) child; + List parents = composedChild.getAllOf(); + if (parents != null) { + for (Schema parent : parents) { + String ref = parent.get$ref(); + if (ref == null) { + // for schemas with no ref, it is not possible to build the discriminator map + // because ref is how we get the model name + // we hit this use case when an allOf composed schema contains an inline schema + continue; + } + String parentName = ModelUtils.getSimpleRef(ref); + if (parentName != null && parentName.equals(currentSchemaName)) { + if (queue.contains(childName) || descendantSchemas.stream().anyMatch(i -> childName.equals(i.mappingName))) { + throw new RuntimeException("Stack overflow hit when looking for " + thisSchemaName + " an infinite loop starting and ending at " + childName + " was seen"); + } + queue.add(childName); + break; + } + } + } + } + } + if (queue.size() == 0) { + break; + } + currentSchemaName = queue.remove(0); + String refClass = getRefClassWithModule("#/components/schemas/" + currentSchemaName, sourceJsonPath); + MappedModel mm = new MappedModel(currentSchemaName, refClass); + descendantSchemas.add(mm); + Schema cs = schemas.get(currentSchemaName); + Map vendorExtensions = cs.getExtensions(); + if (vendorExtensions != null && !vendorExtensions.isEmpty() && vendorExtensions.containsKey("x-discriminator-value")) { + String xDiscriminatorValue = (String) vendorExtensions.get("x-discriminator-value"); + refClass = getRefClassWithModule("#/components/schemas/" + currentSchemaName, sourceJsonPath); + mm = new MappedModel(xDiscriminatorValue, refClass); + descendantSchemas.add(mm); + } + } + return descendantSchemas; + } + + protected String getRefClassWithModule(String ref, String sourceJsonPath) { + return toRefClass(ref, sourceJsonPath, "schemas"); + } + + protected CodegenDiscriminator createDiscriminator(String schemaName, Schema schema, OpenAPI openAPI, String sourceJsonPath) { + Discriminator sourceDiscriminator = recursiveGetDiscriminator(schema, openAPI); + if (sourceDiscriminator == null) { + return null; + } + String discPropName = sourceDiscriminator.getPropertyName(); + CodegenKey propertyName = getKey(discPropName); + Map mapping = sourceDiscriminator.getMapping(); + + TreeSet mappedModels = new TreeSet<>(); + if (sourceDiscriminator.getMapping() != null && !sourceDiscriminator.getMapping().isEmpty()) { + for (Entry e : sourceDiscriminator.getMapping().entrySet()) { + String name; + String value = e.getValue(); + String modelName = null; + if (value.indexOf('/') >= 0) { + name = ModelUtils.getSimpleRef(value); + if (ModelUtils.getSchema(openAPI, name) == null) { + LOGGER.error("Failed to lookup the schema '{}' when processing the discriminator mapping of oneOf/anyOf. Please check to ensure it's defined properly.", name); + } else { + modelName = getRefClassWithModule(e.getValue(), sourceJsonPath); + } + } else { + String ref = "#/components/schemas/" + value; + modelName = getRefClassWithModule(ref, sourceJsonPath); + } + if (modelName != null) { + mappedModels.add(new MappedModel(e.getKey(), modelName)); + } + } + } + + boolean legacyUseCase = (this.getLegacyDiscriminatorBehavior() && mappedModels.isEmpty()); + if (!this.getLegacyDiscriminatorBehavior() || legacyUseCase) { + // for schemas that allOf inherit from this schema, add those descendants to this discriminator map + List otherDescendants = getAllOfDescendants(schemaName, openAPI, sourceJsonPath); + for (MappedModel otherDescendant : otherDescendants) { + // add only if the mapping names are not the same + boolean matched = false; + for (MappedModel uniqueDescendant : mappedModels) { + if (uniqueDescendant.mappingName.equals(otherDescendant.mappingName)) { + matched = true; + break; + } + } + + if (!matched) { + mappedModels.add(otherDescendant); + } + } + } + // if there are composed oneOf/anyOf schemas, add them to this discriminator + if (ModelUtils.isComposedSchema(schema) && !this.getLegacyDiscriminatorBehavior()) { + List otherDescendants = getOneOfAnyOfDescendants(schemaName, discPropName, (ComposedSchema) schema, openAPI, sourceJsonPath); + mappedModels.addAll(otherDescendants); + } + + return new CodegenDiscriminator(propertyName, mapping, mappedModels); + } + + protected boolean isValid(String name) { + return !isReservedWord(name); + } + + protected String getImport(CodegenRefInfo refInfo) { + String prefix = "from " + packageName + ".components."; + if (refInfo.ref instanceof CodegenRequestBody) { + return prefix + "request_bodies import " + refInfo.refModule; + } else if (refInfo.ref instanceof CodegenHeader) { + return prefix + "headers import " + refInfo.refModule; + } else if (refInfo.ref instanceof CodegenResponse) { + return prefix + "responses import " + refInfo.refModule; + } else if (refInfo.ref instanceof CodegenParameter) { + return prefix + "parameters import " + refInfo.refModule; + } else if (refInfo.ref instanceof CodegenSecurityScheme) { + return prefix + "security_schemes import " + refInfo.refModule; + } + return null; + } + + protected String getImport(String className, CodegenSchema schema) { + if (className == null) { + return schema.refInfo.refClass; + } + return className; + } + + /** + * Recursively collect all necessary imports to include so that the type may be resolved. + * + * @param featureSet the generator feature set, used to determine if composed schemas should be added + * @return all the imports + */ + private Set getImports(CodegenSchema schema, FeatureSet featureSet) { + Set imports = new HashSet<>(); + if (schema.discriminator != null && schema.discriminator.mappedModels != null) { + CodegenDiscriminator disc = schema.discriminator; + for (CodegenDiscriminator.MappedModel mm : disc.mappedModels) { + if (!"".equals(mm.modelName)) { + String complexType = mm.modelName; + if (shouldAddImport(complexType)) { + imports.add(getImport(complexType, null)); + } + } + } + } + if (schema.allOf != null || schema.anyOf != null || schema.oneOf != null || schema.not != null) { + List allOfs = Collections.emptyList(); + List oneOfs = Collections.emptyList(); + List anyOfs = Collections.emptyList(); + List notSchemas = Collections.emptyList(); + if (schema.allOf != null && featureSet.getSchemaSupportFeatures().contains(SchemaFeature.AllOf)) { + allOfs = schema.allOf; + } + if (schema.oneOf != null && featureSet.getSchemaSupportFeatures().contains(SchemaFeature.OneOf)) { + oneOfs = schema.oneOf; + } + if (schema.anyOf != null && featureSet.getSchemaSupportFeatures().contains(SchemaFeature.AnyOf)) { + anyOfs = schema.anyOf; + } + if (schema.not != null && featureSet.getSchemaSupportFeatures().contains(SchemaFeature.Not)) { + notSchemas = Collections.singletonList(schema.not); + } + Stream allSchemas = Stream.of( + allOfs.stream(), anyOfs.stream(), oneOfs.stream(), notSchemas.stream()).flatMap(i -> i); + for (CodegenSchema cs: allSchemas.collect(Collectors.toList())) { + imports.addAll(getImports(cs, featureSet)); + } + } + // items can exist for AnyType and type array + if (schema.items != null && schema.types != null && schema.types.contains("array")) { + imports.addAll(getImports(schema.items, featureSet)); + } + // additionalProperties can exist for AnyType and type object + if (schema.additionalProperties != null) { + imports.addAll(getImports(schema.additionalProperties, featureSet)); + } + // vars can exist for AnyType and type object + if (schema.properties != null && !schema.properties.isEmpty()) { + for (CodegenSchema cs: schema.properties.values()) { + imports.addAll(getImports(cs, featureSet)); + } + } + // referenced or inline schemas + if (schema.refInfo != null && schema.refInfo.refModule != null) { + // self reference classes do not contain refModule + imports.add(getImport(null, schema)); + } + return imports; + } + + protected LinkedHashSet getTypes(Schema schema) { + if (schema.getType() == null && schema.getTypes() == null) { + return null; + } + LinkedHashSet types = new LinkedHashSet<>(); + // TODO when does nullable False apply? Only AnyTypeSchema? + // TODO limit this to v3-3.0.03 schemas only + Boolean nullable = schema.getNullable(); + if (Boolean.TRUE.equals(nullable) && schema.get$ref() == null) { + types.add("null"); + } + if (schema.getType() != null) { + types.add(schema.getType()); + } + if (schema.getTypes() != null) { + // NoneFrozenDictTupleStrDecimalBoolFileBytes + if (types.contains("null")) { + types.add("null"); + } + if (types.contains("object")) { + types.add("object"); + } + if (types.contains("array")) { + types.add("array"); + } + if (types.contains("string")) { + types.add("string"); + } + if (types.contains("number")) { + types.add("number"); + } + if (types.contains("integer")) { + types.add("integer"); + } + if (types.contains("boolean")) { + types.add("boolean"); + } + // the above order used so mixins will stay the same + } + return types; + } + + /** + * Convert OAS Property object to Codegen Property object. + *

    + * The return value is cached. An internal cache is looked up to determine + * if the CodegenSchema return value has already been instantiated for + * the (String name, Schema p) arguments. + * Any subsequent processing of the CodegenSchema return value must be idempotent + * for a given (String name, Schema schema). + * + * @param p OAS property schema + * @param sourceJsonPath the path when the schema started being created + * @param currentJsonPath the current json path + * @return Codegen Property object + */ + public CodegenSchema fromSchema(Schema p, String sourceJsonPath, String currentJsonPath) { + if (p == null) { + LOGGER.error("Undefined property/schema at `{}`", currentJsonPath); + return null; + } + LOGGER.debug("debugging fromSchema for {} {} : {}", sourceJsonPath, currentJsonPath, p); + + PairCacheKey ck = new PairCacheKey(sourceJsonPath, currentJsonPath); + CodegenSchema property = codegenSchemaCache.computeIfAbsent(ck, s -> new CodegenSchema()); + + String ref = p.get$ref(); + setSchemaLocationInfo(ref, sourceJsonPath, currentJsonPath, property); + // put toExampleValue in a try-catch block to log the error as example values are not critical + try { + property.example = toExampleValue(p); + } catch (Exception e) { + LOGGER.error("Error in generating `example` for the property {}. Default to ERROR_TO_EXAMPLE_VALUE. Enable debugging for more info.", sourceJsonPath); + LOGGER.debug("Exception from toExampleValue: {}", e.getMessage()); + property.example = "ERROR_TO_EXAMPLE_VALUE"; + } + if (ref != null) { + if (addSchemaImportsFromV3SpecLocations && sourceJsonPath != null && sourceJsonPath.equals(currentJsonPath)) { + // import from $ref + property.imports = new TreeSet<>(); + assert generatorMetadata != null; + addImports(property.imports, getImports(property, generatorMetadata.getFeatureSet())); + } + // TODO with 3.1.0 schemas continue processing + return property; + } + + if (p.equals(trueSchema)) { + property.isBooleanSchemaTrue = true; + } else if (p.equals(falseSchema)) { + property.isBooleanSchemaFalse = true; + } + property.enumValueToName = getEnumValueToName(p); + property.type = p.getType(); + property.types = getTypes(p); + + ModelUtils.syncValidationProperties(p, property); + property.format = p.getFormat(); + property.externalDocumentation = p.getExternalDocs(); + + if (currentJsonPath != null) { + String[] pathPieces = currentJsonPath.split("/"); + if (pathPieces.length >= 4) { + // component schemas + properties/items/additionalProperties use case + String lastPathFragment = pathPieces[pathPieces.length-1]; + String usedName = ModelUtils.decodeSlashes(lastPathFragment); + if (pathPieces.length >= 5) { + // properties/items/additionalProperties use case + // # components schemas someSchema additionalProperties/items + if (lastPathFragment.equals("additionalProperties")) { + String priorFragment = pathPieces[pathPieces.length-2]; + if (!"properties".equals(priorFragment)) { + property.schemaIsFromAdditionalProperties = true; + } + } + } else { + // component schema use case + // TODO set discriminator on any schema instances in the future not just these + if (!currentJsonPath.startsWith("#/components/schemas/")) { + throw new RuntimeException("Invalid currentJsonPath "+ currentJsonPath); + } + + property.discriminator = createDiscriminator(usedName, p, this.openAPI, currentJsonPath); + if (p instanceof ComposedSchema) { + updateModelForComposedSchema(property, p, currentJsonPath); + } + + if (openAPI != null) { + property.testCases = extractSchemaTestCases(xSchemaTestExamplesRefPrefix + usedName); + } + + } + } + } + property.description = escapeText(p.getDescription()); + property.unescapedDescription = p.getDescription(); + property.title = p.getTitle(); + property.defaultValue = toDefaultValue(p); + + property.deprecated = p.getDeprecated(); + property.readOnly = p.getReadOnly(); + property.writeOnly = p.getWriteOnly(); + property.nullable = p.getNullable(); + + CodegenXml xml = null; + if (p.getXml() != null) { + xml = new CodegenXml( + p.getXml().getName(), + p.getXml().getNamespace(), + p.getXml().getPrefix(), + p.getXml().getAttribute(), + p.getXml().getWrapped() + ); + } + property.xml = xml; + if (((Schema) p).getExtensions() != null && !((Schema) p).getExtensions().isEmpty()) { + property.vendorExtensions = ((Schema) p).getExtensions(); + } + + Schema notSchema = p.getNot(); + if (notSchema != null) { + property.not = fromSchema(notSchema, sourceJsonPath, currentJsonPath + "/not"); + } + List allOfs = ((Schema) p).getAllOf(); + if (allOfs != null && !allOfs.isEmpty()) { + property.allOf = getComposedProperties(allOfs, "allOf", sourceJsonPath, currentJsonPath); + } + List anyOfs = ((Schema) p).getAnyOf(); + if (anyOfs != null && !anyOfs.isEmpty()) { + property.anyOf = getComposedProperties(anyOfs, "anyOf", sourceJsonPath, currentJsonPath); + } + List oneOfs = ((Schema) p).getOneOf(); + if (oneOfs != null && !oneOfs.isEmpty()) { + property.oneOf = getComposedProperties(oneOfs, "oneOf", sourceJsonPath, currentJsonPath); + } + if (ModelUtils.isAnyType(p)) { + // The 'null' value is allowed when the OAS schema is 'any type'. + // See https://github.com/OAI/OpenAPI-Specification/issues/1389 + if (Boolean.FALSE.equals(p.getNullable())) { + LOGGER.warn("Schema '{}' is any type, which includes the 'null' value. 'nullable' cannot be set to 'false'", p.getName()); + } + } + property.patternInfo = getPatternInfo(p.getPattern()); + // handle inner property + if (p.getItems() != null) { + property.items = fromSchema( + p.getItems(), sourceJsonPath, currentJsonPath + "/items"); + } + property.additionalProperties = getAdditionalProperties(p, sourceJsonPath, currentJsonPath); + property.properties = getProperties(((Schema) p).getProperties(), sourceJsonPath, currentJsonPath); + LinkedHashSet required = p.getRequired() == null ? new LinkedHashSet<>() + : new LinkedHashSet<>(((Schema) p).getRequired()); + property.optionalProperties = getOptionalProperties(property.properties, required); + property.requiredProperties = getRequiredProperties(required, property.properties, p.getAdditionalProperties(), property.additionalProperties); + + property.example = toExampleValue(p); + if (addSchemaImportsFromV3SpecLocations && sourceJsonPath != null && sourceJsonPath.equals(currentJsonPath)) { + // imports from properties/items/additionalProperties/oneOf/anyOf/allOf/not + property.imports = new TreeSet<>(); + assert generatorMetadata != null; + addImports(property.imports, getImports(property, generatorMetadata.getFeatureSet())); + } + + LOGGER.debug("debugging fromSchema return: {}", property); + return property; + } + + @Override + public String toRefClass(String ref, String sourceJsonPath, String expectedComponentType) { + if (ref == null) { + return null; + } + String[] refPieces = ref.split("/"); + return toModelName(refPieces[refPieces.length-1], ref); + } + + protected String getOperationIdSnakeCase(String operationId) { + if (StringUtils.isEmpty(operationId)) { + throw new RuntimeException("Empty method name (operationId) not allowed"); + } + return org.openapijsonschematools.codegen.utils.StringUtils.underscore(operationId); + } + + protected CodegenKey getOperationId(Operation operation, String path, String httpMethod) { + String operationId = getOrGenerateOperationId(operation, path, httpMethod); + + // remove prefix in operationId + if (removeOperationIdPrefix) { + // The prefix is everything before the removeOperationIdPrefixCount occurrence of removeOperationIdPrefixDelimiter + String[] components = operationId.split("[" + removeOperationIdPrefixDelimiter + "]"); + if (components.length > 1) { + // If removeOperationIdPrefixCount is -1 or bigger that the number of occurrences, uses the last one + int component_number = removeOperationIdPrefixCount == -1 ? components.length - 1 : removeOperationIdPrefixCount; + component_number = Math.min(component_number, components.length - 1); + // Reconstruct the operationId from its split elements and the delimiter + operationId = String.join(removeOperationIdPrefixDelimiter, Arrays.copyOfRange(components, component_number, components.length)); + } + } + String camelCase = toModelName(operationId, null); + String anchorPiece = camelCase.toLowerCase(Locale.ROOT); + return new CodegenKey( + operationId, + isValid(operationId), + getOperationIdSnakeCase(operationId), + camelCase, + anchorPiece + ); + } + + /** + * Convert OAS Operation object to Codegen Operation object + * + * @param operation OAS operation object + * @param jsonPath the json path of the operation + * @return Codegen Operation object + */ + @Override + public CodegenOperation fromOperation(Operation operation, String jsonPath) { + LOGGER.debug("fromOperation => operation: {}", operation); + if (operation == null) { + throw new RuntimeException("operation cannot be null in fromOperation"); + } + + Map vendorExtensions = null; + if (operation.getExtensions() != null && !operation.getExtensions().isEmpty()) { + vendorExtensions = new HashMap<>(operation.getExtensions()); + } + + // tags + List operationTagNames = operation.getTags(); + Map tags = new HashMap<>(); + if (operationTagNames != null) { + for (String tagName: operationTagNames) { + CodegenTag codegenTag = fromTag(tagName, null); + tags.put(tagName, codegenTag); + } + } else { + String tagName = "default"; + CodegenTag codegenTag = fromTag(tagName, "operations that lack tags are assigned this default tag"); + tags.put(tagName, codegenTag); + } + + String[] pathPieces = jsonPath.split("/"); + String httpMethod = pathPieces[pathPieces.length-1]; + String path = ModelUtils.decodeSlashes(pathPieces[pathPieces.length-2]); + CodegenKey operationId = getOperationId(operation, path, httpMethod); + + // servers setting + List codegenServers = null; + if (operation.getServers() != null && !operation.getServers().isEmpty()) { + // use operation-level servers first if defined + codegenServers = fromServers(operation.getServers(), jsonPath + "/servers"); + } + + String summary = escapeText(operation.getSummary()); + String unescapedDescription = operation.getDescription(); + String description = escapeText(operation.getDescription()); + Boolean deprecated = operation.getDeprecated(); + + TreeMap responses = null; + LinkedHashSet produces = null; + CodegenResponse defaultResponse = null; + TreeMap nonDefaultResponses = null; + TreeMap wildcardCodeResponses = null; + TreeMap statusCodeResponses = null; + boolean hasErrorResponseObject = false; + if (operation.getResponses() != null && !operation.getResponses().isEmpty()) { + responses = new TreeMap<>(); + for (Map.Entry operationGetResponsesEntry : operation.getResponses().entrySet()) { + String key = operationGetResponsesEntry.getKey(); + ApiResponse response = operationGetResponsesEntry.getValue(); + LinkedHashSet responseProduces = getProducesInfo(response); + if (responseProduces!= null) { + if (produces == null) { + produces = new LinkedHashSet<>(); + } + produces.addAll(responseProduces); + } + String usedSourceJsonPath = jsonPath + "/responses/" + key; + CodegenResponse r = fromResponse(response, usedSourceJsonPath); + + responses.put(key, r); + if ("default".equals(key)) { + defaultResponse = r; + continue; + } + if (nonDefaultResponses == null) { + nonDefaultResponses = new TreeMap<>(); + } + nonDefaultResponses.put(key, r); + if (key.endsWith("XX") && key.length() == 3) { + if (wildcardCodeResponses == null) { + wildcardCodeResponses = new TreeMap<>(); + } + int firstNumber = Integer.parseInt(key.substring(0, 1)); + wildcardCodeResponses.put(firstNumber, r); + if (firstNumber > 3 && r.content != null) { + for (CodegenMediaType cm: r.content.values()) { + if (cm.schema != null) { + hasErrorResponseObject = true; + break; + } + } + } + continue; + } + if (statusCodeResponses == null) { + statusCodeResponses = new TreeMap<>(); + } + int statusCode = Integer.parseInt(key); + statusCodeResponses.put(statusCode, r); + if (statusCode > 299 && r.content != null) { + for (CodegenMediaType cm: r.content.values()) { + if (cm.schema != null) { + hasErrorResponseObject = true; + break; + } + } + } + } + + // sort them + responses = new TreeMap<>(responses); + if (nonDefaultResponses != null) { + nonDefaultResponses = new TreeMap<>(nonDefaultResponses); + } + if (statusCodeResponses != null) { + statusCodeResponses = new TreeMap<>(statusCodeResponses); + } + if (wildcardCodeResponses != null) { + wildcardCodeResponses = new TreeMap<>(wildcardCodeResponses); + } + } + + List callbacks = null; +// if (operation.getCallbacks() != null && !operation.getCallbacks().isEmpty()) { +// List foundCallbacks = new ArrayList<>(); +// operation.getCallbacks().forEach((name, callback) -> { +// CodegenCallback c = fromCallback(name, callback, servers); +// foundCallbacks.add(c); +// }); +// callbacks = foundCallbacks; +// } + + List parameters = operation.getParameters(); + List allParams = new ArrayList<>(); + List pathParams = new ArrayList<>(); + List queryParams = new ArrayList<>(); + List headerParams = new ArrayList<>(); + List cookieParams = new ArrayList<>(); + boolean hasRequiredParamOrBody = false; + boolean hasOptionalParamOrBody = false; + + RequestBody opRequestBody = operation.getRequestBody(); + CodegenRequestBody requestBody = null; + if (opRequestBody != null) { + requestBody = fromRequestBody(opRequestBody, jsonPath + "/requestBody"); + if (requestBody.refInfo != null) { + if (Boolean.TRUE.equals(requestBody.getDeepestRef().required)) { + hasRequiredParamOrBody = true; + } else { + hasOptionalParamOrBody = true; + } + } else { + if (Boolean.TRUE.equals(requestBody.required)) { + hasRequiredParamOrBody = true; + } else { + hasOptionalParamOrBody = true; + } + } + } + + if (parameters != null) { + int i = 0; + for (Parameter param : parameters) { + String usedSourceJsonPath = jsonPath + "/parameters/" + i; + CodegenParameter p = fromParameter(param, usedSourceJsonPath); + allParams.add(p); + i++; + + CodegenParameter paramOrRef = p; + if (p.refInfo != null) { + paramOrRef = p.getDeepestRef(); + } + switch (paramOrRef.in) { + case "query": + queryParams.add(p); + break; + case "path": + pathParams.add(p); + break; + case "header": + headerParams.add(p); + break; + case "cookie": + cookieParams.add(p); + break; + default: + LOGGER.warn("Unknown parameter type for {}", p.name); + break; + } + + } + } + + // create optional, required parameters + for (CodegenParameter cp : allParams) { + if (cp.refInfo != null) { + if (Boolean.TRUE.equals(cp.getDeepestRef().required)) { //required parameters + hasRequiredParamOrBody = true; + } else { // optional parameters + hasOptionalParamOrBody = true; + } + } else { + if (Boolean.TRUE.equals(cp.required)) { //required parameters + hasRequiredParamOrBody = true; + } else { // optional parameters + hasOptionalParamOrBody = true; + } + } + } + // move "required" parameters in front of "optional" parameters + if (sortParamsByRequiredFlag) { + allParams.sort((one, another) -> { + if (one.required == another.required) + return 0; + else if (one.required) + return -1; + else + return 1; + }); + } + List> security = fromSecurity(operation.getSecurity(), jsonPath + "/security"); + + ExternalDocumentation externalDocs = operation.getExternalDocs(); + CodegenKey jsonPathPiece = getKey(pathPieces[pathPieces.length-1]); + return new CodegenOperation( + deprecated, + hasErrorResponseObject, + summary, + unescapedDescription, + description, + produces, + codegenServers, + requestBody, + allParams, + pathParams, + queryParams, + headerParams, + cookieParams, + hasRequiredParamOrBody, + hasOptionalParamOrBody, + security, + tags, + responses, + statusCodeResponses, + wildcardCodeResponses, + nonDefaultResponses, + defaultResponse, + callbacks, + externalDocs, + vendorExtensions, + operationId, + jsonPathPiece); + } + + @Override + public List> fromSecurity(List security, String jsonPath) { + if (security == null) { + return null; + } + List> securityRequirements = new ArrayList<>(); + int i = 0; + for (SecurityRequirement specSecurityRequirement: security) { + HashMap securityRequirement = fromSecurityRequirement(specSecurityRequirement, jsonPath+ "/" + i); + securityRequirements.add(securityRequirement); + i++; + } + return securityRequirements; + } + + /** + * Convert OAS Response object to Codegen Response object + * + * @param response OAS Response object + * @return Codegen Response object + */ + @Override + public CodegenResponse fromResponse(ApiResponse response, String sourceJsonPath) { + if (response == null) { + String msg = "response in fromResponse cannot be null!"; + LOGGER.error(msg); + throw new RuntimeException(msg); + } + + CodegenResponse r = codegenResponseCache.getOrDefault(sourceJsonPath, null); + if (r != null) { + return r; + } + + String description = escapeText(response.getDescription()); + Map vendorExtensions = null; + if (response.getExtensions() != null && !response.getExtensions().isEmpty()) { + vendorExtensions = response.getExtensions(); + } + + Map responseHeaders = response.getHeaders(); + Map headers = null; + if (responseHeaders != null && !responseHeaders.isEmpty()) { + headers = new HashMap<>(); + for (Entry entry : responseHeaders.entrySet()) { + String headerName = entry.getKey(); + Header header = entry.getValue(); + String headerSourceJsonPath = sourceJsonPath + "/headers/" + headerName; + CodegenHeader responseHeader = fromHeader(header, headerSourceJsonPath); + headers.put(headerName, responseHeader); + } + } + LinkedHashMap content = getContent(response.getContent(), sourceJsonPath + "/content"); + String expectedComponentType = "responses"; + String ref = response.get$ref(); + CodegenRefInfo refInfo = null; + TreeSet imports = null; + if (ref != null) { + String refModule = toRefModule(ref, sourceJsonPath, expectedComponentType); + String refClass = toRefClass(ref, sourceJsonPath, expectedComponentType); + CodegenResponse rb = fromResponse(ModelUtils.getReferencedApiResponse(openAPI, response), ref); + refInfo = new CodegenRefInfo<>(rb, refClass, refModule); + imports = new TreeSet<>(); + imports.add(getImport(refInfo)); + } + CodegenKey jsonPathPiece = getJsonPathPiece(expectedComponentType, sourceJsonPath); + String[] pathPieces = sourceJsonPath.split("/"); + // #/components/responses/A + boolean componentModule = false; + if (pathPieces.length == 4 && sourceJsonPath.startsWith("#/components/"+expectedComponentType+"/")) { + componentModule = true; + } + + Map finalHeaders = headers; + Map finalVendorExtensions = vendorExtensions; + TreeSet finalImports = imports; + r = new CodegenResponse(jsonPathPiece, finalHeaders, description, finalVendorExtensions, content, refInfo, finalImports, componentModule); + codegenResponseCache.put(sourceJsonPath, r); + return r; + } + + /** + * Convert OAS Callback object to Codegen Callback object + * + * @param name callback name + * @param callback OAS Callback object + * @param servers list of servers + * @return Codegen Response object + */ + public CodegenCallback fromCallback(String name, Callback callback, List servers) { + CodegenCallback c = new CodegenCallback(); + c.name = name; + + if (callback.getExtensions() != null && !callback.getExtensions().isEmpty()) { + c.vendorExtensions.putAll(callback.getExtensions()); + } + + callback.forEach((expression, pi) -> { + CodegenCallback.Url u = new CodegenCallback.Url(); + u.expression = expression; + + if (pi.getExtensions() != null && !pi.getExtensions().isEmpty()) { + u.vendorExtensions.putAll(pi.getExtensions()); + } + + Stream.of( + Pair.of("get", pi.getGet()), + Pair.of("head", pi.getHead()), + Pair.of("put", pi.getPut()), + Pair.of("post", pi.getPost()), + Pair.of("delete", pi.getDelete()), + Pair.of("patch", pi.getPatch()), + Pair.of("options", pi.getOptions())) + .filter(p -> p.getValue() != null) + .forEach(p -> { + String method = p.getKey(); + Operation op = p.getValue(); + + boolean genId = op.getOperationId() == null; + if (genId) { + op.setOperationId(getOrGenerateOperationId(op, c.name + "_" + expression.replaceAll("\\{\\$.*}", ""), method)); + } + + if (op.getExtensions() == null) { + op.setExtensions(new HashMap<>()); + } + // This extension will be removed later by `fromOperation()` as it is only needed here to + // distinguish between normal operations and callback requests + op.getExtensions().put("x-callback-request", true); + + // CodegenOperation co = fromOperation(expression, method, op, servers); + CodegenOperation co = null; + u.requests.add(co); + }); + + c.urls.add(u); + }); + + return c; + } + + public CodegenTag fromTag(String name, String description) { + CodegenTag tag = codegenTagCache.getOrDefault(name, null); + if (tag != null) { + return tag; + } + tag = new CodegenTag(name, toApiFilename(name), toApiName(name), description); + codegenTagCache.put(name, tag); + return tag; + } + + public CodegenHeader fromHeader(Header header, String sourceJsonPath) { + if (header == null) { + String msg = "header in fromHeader cannot be null!"; + LOGGER.error(msg); + throw new RuntimeException(msg); + } + CodegenHeader codegenHeader = codegenHeaderCache.getOrDefault(sourceJsonPath, null); + if (codegenHeader != null) { + return codegenHeader; + } + + String ref = header.get$ref(); + String expectedComponentType = "headers"; + CodegenRefInfo refInfo = null; + TreeSet imports = null; + if (ref != null) { + String refModule = toRefModule(ref, sourceJsonPath, expectedComponentType); + String refClass = toRefClass(ref, sourceJsonPath, expectedComponentType); + CodegenHeader rb = fromHeader(ModelUtils.getReferencedHeader(openAPI, header), ref); + refInfo = new CodegenRefInfo<>(rb, refClass, refModule); + imports = new TreeSet<>(); + imports.add(getImport(refInfo)); + } + CodegenKey jsonPathPiece = getJsonPathPiece(expectedComponentType, sourceJsonPath); + String[] pathPieces = sourceJsonPath.split("/"); + // #/components/headers/A + boolean componentModule = false; + if (pathPieces.length == 4 && sourceJsonPath.startsWith("#/components/"+expectedComponentType+"/")) { + componentModule = true; + } + + String description = escapeText(header.getDescription()); + String unescapedDescription = header.getDescription(); + Map vendorExtensions = null; + if (header.getExtensions() != null && !header.getExtensions().isEmpty()) { + vendorExtensions = header.getExtensions(); + } + Boolean required = header.getRequired(); + LinkedHashMap content = null; + if (header.getContent() != null) { + content = getContent(header.getContent(), sourceJsonPath + "/content"); + } + Boolean deprecated = header.getDeprecated(); + + // the parameter model name is obtained from the schema $ref + // e.g. #/components/schemas/list_pageQuery_parameter => toModelName(list_pageQuery_parameter) + CodegenSchema schema = null; + if (header.getSchema() != null) { + String usedSourceJsonPath = sourceJsonPath + "/schema"; + schema = fromSchema( + header.getSchema(), + usedSourceJsonPath, + usedSourceJsonPath + ); + } + + Boolean explode = header.getExplode(); + + String style = null; + if (header.getStyle() != null) { + style = header.getStyle().toString(); + } + TreeSet finalImports = imports; + String finalStyle = style; + Map finalVendorExtensions = vendorExtensions; + LinkedHashMap finalContent = content; + CodegenSchema finalSchema = schema; + String example = getHeaderExampleValue(header); + codegenHeader = new CodegenHeader(description, unescapedDescription, example, finalVendorExtensions, required, finalContent, finalImports, componentModule, jsonPathPiece, explode, finalStyle, deprecated, finalSchema, refInfo); + codegenHeaderCache.put(sourceJsonPath, codegenHeader); + return codegenHeader; + } + + /** + * Convert OAS Parameter object to Codegen Parameter object + * + * @param parameter OAS parameter object + * @param sourceJsonPath the json path to the parameter + * @return Codegen Parameter object + */ + public CodegenParameter fromParameter(Parameter parameter, String sourceJsonPath) { + if (parameter == null) { + String msg = "parameter in fromParameter cannot be null!"; + LOGGER.error(msg); + throw new RuntimeException(msg); + } + if (GlobalSettings.getProperty("debugParser") != null) { + LOGGER.info("working on Parameter {}", parameter.getName()); + LOGGER.info("jsonPath: {}", sourceJsonPath); + } + CodegenParameter codegenParameter = codegenParameterCache.getOrDefault(sourceJsonPath, null); + if (codegenParameter != null) { + return codegenParameter; + } + + String ref = parameter.get$ref(); + String expectedComponentType = "parameters"; + CodegenRefInfo refInfo = null; + TreeSet imports = null; + if (ref != null) { + String refModule = toRefModule(ref, sourceJsonPath, expectedComponentType); + String refClass = toRefClass(ref, sourceJsonPath, expectedComponentType); + CodegenParameter rb = fromParameter(ModelUtils.getReferencedParameter(openAPI, parameter), ref); + refInfo = new CodegenRefInfo<>(rb, refClass, refModule); + imports = new TreeSet<>(); + imports.add(getImport(refInfo)); + } + CodegenKey jsonPathPiece = getJsonPathPiece(expectedComponentType, sourceJsonPath); + String[] pathPieces = sourceJsonPath.split("/"); + // #/components/parameters/A + boolean componentModule = false; + if (pathPieces.length == 4 && sourceJsonPath.startsWith("#/components/"+expectedComponentType+"/")) { + componentModule = true; + } + + String description = escapeText(parameter.getDescription()); + String unescapedDescription = parameter.getDescription(); + Map vendorExtensions = null; + if (parameter.getExtensions() != null && !parameter.getExtensions().isEmpty()) { + vendorExtensions = parameter.getExtensions(); + } + Boolean required = parameter.getRequired(); + LinkedHashMap content = null; + if (parameter.getContent() != null) { + content = getContent(parameter.getContent(), sourceJsonPath + "/content"); + } + + Boolean deprecated = parameter.getDeprecated(); + + // the parameter model name is obtained from the schema $ref + // e.g. #/components/schemas/list_pageQuery_parameter => toModelName(list_pageQuery_parameter) + CodegenSchema schema = null; + if (parameter.getSchema() != null) { + String usedSourceJsonPath = sourceJsonPath + "/schema"; + schema = fromSchema( + parameter.getSchema(), + usedSourceJsonPath, + usedSourceJsonPath + ); + } + + Boolean explode = parameter.getExplode(); + + String style = null; + if (parameter.getStyle() != null) { + style = parameter.getStyle().toString(); + } + String baseName = parameter.getName(); + + String in = parameter.getIn(); + Boolean allowEmptyValue = parameter.getAllowEmptyValue(); + if (parameter instanceof PathParameter || "path".equalsIgnoreCase(parameter.getIn())) { + required = Boolean.TRUE; + } + + // set the parameter example value + // should be overridden by lang codegen + String example = getParameterExampleValue(parameter); + + String finalStyle = style; + TreeSet finalImports = imports; + Map finalVendorExtensions = vendorExtensions; + LinkedHashMap finalContent = content; + CodegenSchema finalSchema = schema; + Boolean allowReserved = parameter.getAllowReserved(); + codegenParameter = new CodegenParameter(description, unescapedDescription, example, finalVendorExtensions, required, finalContent, finalImports, componentModule, jsonPathPiece, explode, finalStyle, deprecated, finalSchema, in, allowEmptyValue, baseName, refInfo, allowReserved); + codegenParameterCache.put(sourceJsonPath, codegenParameter); + LOGGER.debug("debugging codegenParameter return: {}", codegenParameter); + return codegenParameter; + } + + @Override + @SuppressWarnings("static-method") + public HashMap fromSecurityRequirement(SecurityRequirement securityRequirement, String sourceJsonPath) { + if (securityRequirement == null) { + String msg = "securityRequirement in fromSecurityRequirement cannot be null!"; + LOGGER.error(msg); + throw new RuntimeException(msg); + } + HashMap securityRequirements = new HashMap<>(); + for (Entry> entry: securityRequirement.entrySet()) { + String securitySchemeComponentName = entry.getKey(); + String jsonPath = sourceJsonPath + "/" + securitySchemeComponentName; + CodegenSecurityRequirementValue codegenSecurityRequirementValue = codegenSecurityRequirementCache.getOrDefault(jsonPath, null); + if (codegenSecurityRequirementValue != null) { + securityRequirements.put(securitySchemeComponentName, codegenSecurityRequirementValue); + continue; + } + String ref = "#/components/securitySchemes/" + securitySchemeComponentName; + String expectedComponentType = "securitySchemes"; + String refModule = toRefModule(ref, jsonPath, expectedComponentType); + String refClass = toRefClass(ref, jsonPath, expectedComponentType); + SecurityScheme ss = new SecurityScheme(); + ss.set$ref(ref); + CodegenSecurityScheme refCs = fromSecurityScheme(ModelUtils.getReferencedSecurityScheme(openAPI, ss), ref); + CodegenRefInfo refInfo = new CodegenRefInfo<>(refCs, refClass, refModule); + TreeSet imports = new TreeSet<>(); + imports.add(getImport(refInfo)); + ArrayList scopeNames = (ArrayList) entry.getValue(); + + codegenSecurityRequirementValue = new CodegenSecurityRequirementValue( + imports, + refInfo, + scopeNames + ); + codegenSecurityRequirementCache.put(jsonPath, codegenSecurityRequirementValue); + securityRequirements.put(securitySchemeComponentName, codegenSecurityRequirementValue); + } + return securityRequirements; + } + + /** + * Convert map of OAS SecurityScheme objects to a list of Codegen Security objects + * + * @param securityScheme the object being ingested + * @param jsonPath the json path location being handled + * @return a list of Codegen Security objects + */ + @Override + @SuppressWarnings("static-method") + public CodegenSecurityScheme fromSecurityScheme(SecurityScheme securityScheme, String jsonPath) { + if (securityScheme == null) { + String msg = "securityScheme in fromSecurityScheme cannot be null!"; + LOGGER.error(msg); + throw new RuntimeException(msg); + } + CodegenSecurityScheme codegenRequestBody = codegenSecuritySchemeCache.getOrDefault(jsonPath, null); + if (codegenRequestBody != null) { + return codegenRequestBody; + } + + String ref = securityScheme.get$ref(); + String expectedComponentType = "securitySchemes"; + CodegenRefInfo refInfo = null; + TreeSet imports = null; + if (ref != null) { + String refModule = toRefModule(ref, jsonPath, expectedComponentType); + String refClass = toRefClass(ref, jsonPath, expectedComponentType); + CodegenSecurityScheme refCs = fromSecurityScheme(ModelUtils.getReferencedSecurityScheme(openAPI, securityScheme), ref); + refInfo = new CodegenRefInfo<>(refCs, refClass, refModule); + imports = new TreeSet<>(); + imports.add(getImport(refInfo)); + } + CodegenOauthFlows flows = null; + OAuthFlows sourceFlows = securityScheme.getFlows(); + if (sourceFlows != null) { + CodegenOauthFlow implicit = null; + CodegenOauthFlow password = null; + CodegenOauthFlow clientCredentials = null; + CodegenOauthFlow authorizationCode = null; + Map flowsVendorExtensions = sourceFlows.getExtensions(); + OAuthFlow sourceFlow = sourceFlows.getImplicit(); + if (sourceFlow != null) { + implicit = new CodegenOauthFlow( + sourceFlow.getAuthorizationUrl(), + sourceFlow.getTokenUrl(), + sourceFlow.getRefreshUrl(), + sourceFlow.getScopes(), + sourceFlow.getExtensions() + ); + } + sourceFlow = sourceFlows.getPassword(); + if (sourceFlow != null) { + password = new CodegenOauthFlow( + sourceFlow.getAuthorizationUrl(), + sourceFlow.getTokenUrl(), + sourceFlow.getRefreshUrl(), + sourceFlow.getScopes(), + sourceFlow.getExtensions() + ); + } + sourceFlow = sourceFlows.getClientCredentials(); + if (sourceFlow != null) { + clientCredentials = new CodegenOauthFlow( + sourceFlow.getAuthorizationUrl(), + sourceFlow.getTokenUrl(), + sourceFlow.getRefreshUrl(), + sourceFlow.getScopes(), + sourceFlow.getExtensions() + ); + } + sourceFlow = sourceFlows.getAuthorizationCode(); + if (sourceFlow != null) { + authorizationCode = new CodegenOauthFlow( + sourceFlow.getAuthorizationUrl(), + sourceFlow.getTokenUrl(), + sourceFlow.getRefreshUrl(), + sourceFlow.getScopes(), + sourceFlow.getExtensions() + ); + } + flows = new CodegenOauthFlows( + implicit, + password, + clientCredentials, + authorizationCode, + flowsVendorExtensions + ); + } + CodegenKey jsonPathPiece = getJsonPathPiece(expectedComponentType, jsonPath); + String[] pathPieces = jsonPath.split("/"); + // #/components/requestBodies/A + boolean componentModule = false; + if (pathPieces.length == 4 && jsonPath.startsWith("#/components/"+expectedComponentType+"/")) { + componentModule = true; + } + + String type = securityScheme.getType().toString(); + String description = securityScheme.getDescription(); + String name = securityScheme.getName(); + String in = null; + if (securityScheme.getIn() != null) { + in = securityScheme.getIn().toString(); + } + String scheme = securityScheme.getScheme(); + String bearerFormat = securityScheme.getBearerFormat(); + String openIdConnectUrl = securityScheme.getOpenIdConnectUrl(); + Map vendorExtensions = null; + if (securityScheme.getExtensions() != null) { + vendorExtensions = securityScheme.getExtensions(); + } + final CodegenSecurityScheme cs = new CodegenSecurityScheme( + type, + description, + name, + in, + scheme, + bearerFormat, + flows, + openIdConnectUrl, + imports, + componentModule, + jsonPathPiece, + refInfo, + vendorExtensions + ); + codegenSecuritySchemeCache.put(jsonPath, cs); + return cs; + } + + protected void setReservedWordsLowerCase(List words) { + reservedWords = new HashSet<>(); + for (String word : words) { + reservedWords.add(word.toLowerCase(Locale.ROOT)); + } + } + + protected boolean isReservedWord(String word) { + return word != null && reservedWords.contains(word.toLowerCase(Locale.ROOT)); + } + + /** + * Get operationId from the operation object, and if it's blank, generate a new one from the given parameters. + * + * @param operation the operation object + * @param path the path of the operation + * @param httpMethod the HTTP method of the operation + * @return the (generated) operationId + */ + protected String getOrGenerateOperationId(Operation operation, String path, String httpMethod) { + String operationId = operation.getOperationId(); + if (!StringUtils.isBlank(operationId)) { + return operationId; + } + String tmpPath = path; + tmpPath = tmpPath.replaceAll("\\{", ""); + tmpPath = tmpPath.replaceAll("}", ""); + String[] parts = (tmpPath + "/" + httpMethod).split("/"); + StringBuilder builder = new StringBuilder(); + if ("/".equals(tmpPath)) { + // must be root tmpPath + builder.append("root"); + } + for (String part : parts) { + if (part.length() > 0) { + if (builder.toString().length() == 0) { + part = Character.toLowerCase(part.charAt(0)) + part.substring(1); + } else { + part = org.openapijsonschematools.codegen.utils.StringUtils.camelize(part); + } + builder.append(part); + } + } + operationId = sanitizeName(builder.toString()); + LOGGER.warn("Empty operationId found for path: {} {}. Renamed to auto-generated operationId: {}", httpMethod, path, operationId); + return operationId; + } + + /** + * Check the type to see if it needs import the library/module/package + * + * @param type name of the type + * @return true if the library/module/package of the corresponding type needs to be imported + */ + protected boolean needToImport(String type) { + return StringUtils.isNotBlank(type) && !defaultIncludes.contains(type) + && !languageSpecificPrimitives.contains(type); + } + + /** + * Add operation to group + * + * @param tag name of the tag + * @param resourcePath path of the resource + * @param operation OAS Operation object + * @param co Codegen Operation object + * @param operations map of Codegen operations + */ + @Override + @SuppressWarnings("static-method") + public void addOperationToGroup(String tag, String resourcePath, Operation operation, CodegenOperation + co, Map> operations) { + List opList = operations.computeIfAbsent(tag, k -> new ArrayList<>()); + // check for operationId uniqueness + String operationId = co.operationId.original; + int counter = 0; + for (CodegenOperation op : opList) { + if (operationId.equals(op.operationId.original)) { + counter++; + if (counter > 1) { + LOGGER.error("Invalid spec contains multiple operations with the same operationId=`{}` in tag='{}'.Update your spec to use unique operationIds.", operationId, tag); + } + } + } + opList.add(co); + } + + protected void addImports(Set importsToBeAddedTo, Set importsToAdd) { + importsToAdd.forEach(i -> addImport(importsToBeAddedTo, i)); + } + + protected void addImport(Set importsToBeAddedTo, String type) { + if (shouldAddImport(type)) { + importsToBeAddedTo.add(type); + } + } + + protected boolean shouldAddImport(String type) { + return type != null && needToImport(type); + } + + /** + * Add variables (properties) to codegen model (list of properties, various flags, etc) + * + * @param properties a map of properties (schema) + * @param sourceJsonPath the source json path + * @param currentJsonPath the current json path + * @return the properties + */ + protected LinkedHashMap getProperties(Map properties, String sourceJsonPath, String currentJsonPath) { + if (properties == null || properties.isEmpty()) { + return null; + } + + LinkedHashMap propertiesMap = new LinkedHashMap<>(); + + for (Map.Entry entry : properties.entrySet()) { + final String propertyName = entry.getKey(); + final Schema prop = entry.getValue(); + if (prop == null) { + LOGGER.warn("Please report the issue. There shouldn't be null property for {}", propertyName); + } else { + final CodegenSchema cp; + + String propertyJsonPath = currentJsonPath + "/properties/" + ModelUtils.encodeSlashes(propertyName); + cp = fromSchema(prop, sourceJsonPath, propertyJsonPath); + + CodegenKey key = getKey(propertyName); + propertiesMap.put(key, cp); + } + } + return propertiesMap; + } + + /** + * Add variables (properties) to codegen model (list of properties, various flags, etc) + * + * @param properties a map of properties (schema) + * @param mandatory a set of required properties' name + * @return the optional properties + */ + protected LinkedHashMap getOptionalProperties(LinkedHashMap properties, Set mandatory) { + if (properties == null) { + return null; + } + if (mandatory.size() == properties.size()) { + return null; + } + if (mandatory.isEmpty()) { + return properties; + } + + LinkedHashMap optionalProperties = new LinkedHashMap<>(); + for (Map.Entry entry : properties.entrySet()) { + final CodegenKey key = entry.getKey(); + if (mandatory.contains(key.original)) { + continue; + } + final CodegenSchema prop = entry.getValue(); + optionalProperties.put(key, prop); + } + return optionalProperties; + } + + /** + * Remove characters not suitable for variable or method name from the input and camel case it + * + * @param name string to be camel case + * @return camel case string + */ + @SuppressWarnings("static-method") + public String removeNonNameElementToCamelCase(String name) { + return removeNonNameElementToCamelCase(name, "[-_:;#" + removeOperationIdPrefixDelimiter + "]"); + } + + /** + * Remove characters that is not good to be included in method name from the input and camel case it + * + * @param name string to be camel case + * @param nonNameElementPattern a regex pattern of the characters that is not good to be included in name + * @return camel case string + */ + protected String removeNonNameElementToCamelCase(final String name, final String nonNameElementPattern) { + String result = Arrays.stream(name.split(nonNameElementPattern)) + .map(StringUtils::capitalize) + .collect(Collectors.joining("")); + if (result.length() > 0) { + result = result.substring(0, 1).toLowerCase(Locale.ROOT) + result.substring(1); + } + return result; + } + + @Override + public String modelPackagePathFragment() { + return modelPackage.replace('.', File.separatorChar); + } + + private void updateComponentsFilepath(String[] pathPieces) { + if (pathPieces.length < 3) { + return; + } + String requestBodiesIdentifier = "request_bodies"; + String securitySchemesIdentifier = "security_schemes"; + // rename schemas + requestBodies + if (pathPieces[2].equals("schemas")) { + // modelPackage replaces pathPieces[1] + pathPieces[2] + pathPieces[1] = modelPackagePathFragment(); + pathPieces[2] = null; + if (pathPieces.length == 4) { + // #/components/schemas/SomeSchema + pathPieces[3] = getKey(pathPieces[3]).snakeCase; + } + return; + } else if (pathPieces[2].equals("requestBodies")) { + pathPieces[2] = requestBodiesIdentifier; + } else if (pathPieces[2].equals("securitySchemes")) { + pathPieces[2] = securitySchemesIdentifier; + } + if (pathPieces.length < 4) { + return; + } + if (pathPieces[2].equals("headers")) { + pathPieces[3] = toHeaderFilename(pathPieces[3], null); + if (pathPieces.length >= 6 && pathPieces[4].equals("content")) { + // #/components/headers/someHeader/content/application-json -> length 6 + String contentType = ModelUtils.decodeSlashes(pathPieces[5]); + pathPieces[5] = getKey(contentType).snakeCase; + } + } else if (pathPieces[2].equals("parameters")) { + pathPieces[3] = toParameterFilename(pathPieces[3], null); + if (pathPieces.length >= 6 && pathPieces[4].equals("content")) { + // #/components/parameters/someParam/content/application-json -> length 6 + String contentType = ModelUtils.decodeSlashes(pathPieces[5]); + pathPieces[5] = getKey(contentType).snakeCase; + } + } else if (pathPieces[2].equals(requestBodiesIdentifier)) { + pathPieces[3] = toRequestBodyFilename(pathPieces[3]); + if (pathPieces.length >= 6 && pathPieces[4].equals("content")) { + // #/components/requestBodies/someBody/content/application-json -> length 6 + String contentType = ModelUtils.decodeSlashes(pathPieces[5]); + pathPieces[5] = getKey(contentType).snakeCase; + } + } else if (pathPieces[2].equals("responses")) { + // #/components/responses/SuccessWithJsonApiResponse/headers + String responseJsonPath = "#/components/responses/" + pathPieces[3]; + pathPieces[3] = toResponseModuleName(pathPieces[3], responseJsonPath); + + if (pathPieces.length < 6) { + return; + } + if (pathPieces[4].equals("headers")) { + // #/components/responses/someResponse/headers/SomeHeader-> length 6 + pathPieces[5] = toHeaderFilename(pathPieces[5], null); + if (pathPieces.length >= 8 && pathPieces[6].equals("content")) { + // #/components/responses/someResponse/headers/SomeHeader/content/application-json -> length 8 + String contentType = ModelUtils.decodeSlashes(pathPieces[7]); + pathPieces[7] = getKey(contentType).snakeCase; + } + } else if (pathPieces[4].equals("content")) { + // #/components/responses/someResponse/content/application-json -> length 6 + String contentType = ModelUtils.decodeSlashes(pathPieces[5]); + pathPieces[5] = getKey(contentType).snakeCase; + } + } else if (pathPieces[2].equals(securitySchemesIdentifier)) { + pathPieces[3] = toSecuritySchemeFilename(pathPieces[3], null); + } + } + + private void updatePathsFilepath(String[] pathPieces) { + if (pathPieces.length < 3) { + return; + } + // #/paths/somePath + String path = pathPieces[2]; + pathPieces[2] = toPathFilename(ModelUtils.decodeSlashes(pathPieces[2]), null); + if (pathPieces.length < 4) { + return; + } + String requestBodyIdentifier = "request_body"; + if (pathPieces.length < 5) { + return; + } + if (pathPieces[4].equals("requestBody")) { + // #/paths/somePath/get/requestBody + pathPieces[4] = requestBodyIdentifier; + } + if (pathPieces[3].equals("servers")) { + // #/paths/somePath/servers/0 + pathPieces[4] = toServerFilename(pathPieces[4], null); + } + if (pathPieces.length < 6) { + return; + } + if (pathPieces[4].equals("servers")) { + // #/paths/somePath/get/servers/someServer + pathPieces[5] = toServerFilename(pathPieces[5], null); + } else if (pathPieces[4].equals("security")) { + // #/paths/somePath/get/security/0 + pathPieces[5] = toSecurityRequirementObjectFilename(pathPieces[5], null); + } else if (pathPieces[4].equals("responses")) { + // #/paths/user_login/get/responses/200 -> 200 -> response_200 -> length 6 + String responseJsonPath = "#/paths/" + path + "/" + pathPieces[3] + "/responses/" + pathPieces[5]; + pathPieces[5] = toResponseModuleName(pathPieces[5], responseJsonPath); + if (pathPieces.length < 8) { + return; + } + if (pathPieces[6].equals("content")) { + // #/paths/somePath/get/responses/200/content/application-json -> length 8 + String contentType = ModelUtils.decodeSlashes(pathPieces[7]); + pathPieces[7] = getKey(contentType).snakeCase; + } else if (pathPieces[6].equals("headers")) { + // #/paths/somePath/get/responses/200/headers/someHeader -> length 8 + pathPieces[7] = toHeaderFilename(pathPieces[7], null); + + if (pathPieces.length >= 10 && pathPieces[8].equals("content")) { + // #/paths/somePath/get/responses/200/headers/someHeader/content/application-json -> length 10 + String contentType = ModelUtils.decodeSlashes(pathPieces[9]); + pathPieces[9] = getKey(contentType).snakeCase; + } + } + } else if (pathPieces[4].equals("parameters")) { + // #/paths/somePath/get/parameters/0 -> length 6 + pathPieces[5] = toParameterFilename(pathPieces[5], null); + + if (pathPieces.length >= 8 && pathPieces[6].equals("content")) { + // #/paths/somePath/get/parameters/1/content/application-json -> length 8 + String contentType = ModelUtils.decodeSlashes(pathPieces[7]); + pathPieces[7] = getKey(contentType).snakeCase; + } + } else if (pathPieces[4].equals(requestBodyIdentifier)) { + if (pathPieces.length >= 7 && pathPieces[5].equals("content")) { + // #/paths/somePath/get/requestBody/content/application-json -> length 7 + String contentType = ModelUtils.decodeSlashes(pathPieces[6]); + pathPieces[6] = getKey(contentType).snakeCase; + } + } + } + + private void updateServersFilepath(String[] pathPieces) { + if (pathPieces.length < 3) { + return; + } + pathPieces[2] = toServerFilename(pathPieces[2], null); + } + + private void updateSecurityFilepath(String[] pathPieces) { + if (pathPieces.length < 3) { + return; + } + pathPieces[2] = toSecurityRequirementObjectFilename(pathPieces[2], null); + } + + private void updateApisFilepath(String[] pathPieces) { + // #/apis + // #/apis/tags + // #/apis/tags/someTag + // #/apis/paths + // #/apis/paths/somePath + pathPieces[1] = apiPackage.replace('.', File.separatorChar); + if (pathPieces.length < 4) { + return; + } + if (pathPieces[2].equals("tags")) { + pathPieces[3] = toApiFilename(pathPieces[3]); + } else if (pathPieces[2].equals("paths")) { + pathPieces[3] = toPathFilename(ModelUtils.decodeSlashes(pathPieces[3]), null); + } + } + + @Override + public String getFilepath(String jsonPath) { + String[] pathPieces = jsonPath.split("/"); + pathPieces[0] = outputFolder + File.separatorChar + packagePath(); + if (jsonPath.startsWith("#/components")) { + updateComponentsFilepath(pathPieces); + } else if (jsonPath.startsWith("#/paths")) { + updatePathsFilepath(pathPieces); + } else if (jsonPath.startsWith("#/servers")) { + updateServersFilepath(pathPieces); + } else if (jsonPath.startsWith("#/security")) { + updateSecurityFilepath(pathPieces); + } else if (jsonPath.startsWith("#/apis")) { + // this is a fake json path that the code generates and uses to generate apis + updateApisFilepath(pathPieces); + } + List finalPathPieces = Arrays.stream(pathPieces) + .filter(Objects::nonNull) + .collect(Collectors.toList()); + return String.join(File.separator, finalPathPieces); + } + + @Override + public String getDocsFilepath(String jsonPath) { + String[] pathPieces = jsonPath.split("/"); + pathPieces[0] = outputFolder + File.separatorChar + docsFolder; + if (jsonPath.startsWith("#/components")) { + updateComponentsFilepath(pathPieces); + } else if (jsonPath.startsWith("#/paths")) { + updatePathsFilepath(pathPieces); + } else if (jsonPath.startsWith("#/servers")) { + updateServersFilepath(pathPieces); + } else if (jsonPath.startsWith("#/apis")) { + // this is a fake json path that the code generates and uses to generate apis + updateApisFilepath(pathPieces); + } + List finalPathPieces = Arrays.stream(pathPieces) + .filter(Objects::nonNull) + .collect(Collectors.toList()); + return String.join(File.separator, finalPathPieces); + } + + /** + * Return the full path and API test file + * + * @param templateName template name + * @param tag tag + * @return the API test file name with full path + */ + @Override + public String apiTestFilename(String templateName, String tag) { + String suffix = apiTestTemplateFiles().get(templateName); + return apiTestFileFolder() + File.separator + toApiTestFilename(tag) + suffix; + } + + @Override + public boolean isSkipOverwrite() { + return skipOverwrite; + } + + @Override + public void setSkipOverwrite(boolean skipOverwrite) { + this.skipOverwrite = skipOverwrite; + } + + @Override + public void setRemoveOperationIdPrefix(boolean removeOperationIdPrefix) { + this.removeOperationIdPrefix = removeOperationIdPrefix; + } + + public void setRemoveOperationIdPrefixDelimiter(String removeOperationIdPrefixDelimiter) { + this.removeOperationIdPrefixDelimiter = removeOperationIdPrefixDelimiter; + } + + public void setRemoveOperationIdPrefixCount(int removeOperationIdPrefixCount) { + this.removeOperationIdPrefixCount = removeOperationIdPrefixCount; + } + + @Override + public void setSkipOperationExample(boolean skipOperationExample) { + this.skipOperationExample = skipOperationExample; + } + + @Override + public boolean isHideGenerationTimestamp() { + return hideGenerationTimestamp; + } + + @Override + public void setHideGenerationTimestamp(boolean hideGenerationTimestamp) { + this.hideGenerationTimestamp = hideGenerationTimestamp; + } + + /** + * Set library template (sub-template). + * + * @param library Library template + */ + @Override + public void setLibrary(String library) { + if (library != null && !supportedLibraries.containsKey(library)) { + StringBuilder sb = new StringBuilder("Unknown library: " + library + "\nAvailable libraries:"); + if (supportedLibraries.size() == 0) { + sb.append("\n ").append("NONE"); + } else { + for (String lib : supportedLibraries.keySet()) { + sb.append("\n ").append(lib); + } + } + throw new RuntimeException(sb.toString()); + } + this.library = library; + } + + /** + * Library template (sub-template). + * + * @return Library template + */ + @Override + public String getLibrary() { + return library; + } + + /** + * check if current active library equals to passed + * + * @param library - library to be compared with + * @return {@code true} if passed library is active, {@code false} otherwise + */ + public final boolean isLibrary(String library) { + return library.equals(this.library); + } + + /** + * Documentation files extension + * + * @return Documentation files extension + */ + @Override + public String getDocExtension() { + return docExtension; + } + + /** + * Set Documentation files extension + * + * @param userDocExtension documentation files extension + */ + @Override + public void setDocExtension(String userDocExtension) { + this.docExtension = userDocExtension; + } + + /** + * Set HTTP user agent. + * + * @param httpUserAgent HTTP user agent + */ + @Override + public void setHttpUserAgent(String httpUserAgent) { + this.httpUserAgent = httpUserAgent; + } + + /** + * HTTP user agent + * + * @return HTTP user agent + */ + @Override + public String getHttpUserAgent() { + return httpUserAgent; + } + + /** + * Sanitize name (parameter, property, method, etc) + * + * @param name string to be sanitize + * @return sanitized string + */ + @Override + @SuppressWarnings("static-method") + public String sanitizeName(String name) { + return sanitizeName(name, "\\W"); + } + + @Override + public void setTemplatingEngine(TemplatingEngineAdapter templatingEngine) { + this.templatingEngine = templatingEngine; + } + + @Override + public TemplatingEngineAdapter getTemplatingEngine() { + return this.templatingEngine; + } + + /** + * Sanitize name (parameter, property, method, etc) + * + * @param name string to be sanitize + * @param removeCharRegEx a regex containing all char that will be removed + * @return sanitized string + */ + public String sanitizeName(String name, String removeCharRegEx) { + return sanitizeName(name, removeCharRegEx, new ArrayList<>()); + } + + /** + * Sanitize name (parameter, property, method, etc) + * + * @param name string to be sanitize + * @param removeCharRegEx a regex containing all char that will be removed + * @param exceptionList a list of matches which should not be sanitized (i.e. exception) + * @return sanitized string + */ + @SuppressWarnings("static-method") + public String sanitizeName(final String name, String removeCharRegEx, ArrayList exceptionList) { + // NOTE: performance wise, we should have written with 2 replaceAll to replace desired + // character with _ or empty character. Below aims to spell out different cases we've + // encountered so far and hopefully make it easier for others to add more special + // cases in the future. + + // better error handling when map/array type is invalid + if (name == null) { + LOGGER.error("String to be sanitized is null. Default to ERROR_UNKNOWN"); + return "ERROR_UNKNOWN"; + } + + // if the name is just '$', map it to 'value' for the time being. + if ("$".equals(name)) { + return "value"; + } + + SanitizeNameOptions opts = new SanitizeNameOptions(name, removeCharRegEx, exceptionList); + + return sanitizedNameCache.get(opts, sanitizeNameOptions -> { + String modifiable = sanitizeNameOptions.getName(); + List exceptions = sanitizeNameOptions.getExceptions(); + // input[] => input + modifiable = this.sanitizeValue(modifiable, "\\[\\]", "", exceptions); + + // input[a][b] => input_a_b + modifiable = this.sanitizeValue(modifiable, "\\[", "_", exceptions); + modifiable = this.sanitizeValue(modifiable, "\\]", "", exceptions); + + // input(a)(b) => input_a_b + modifiable = this.sanitizeValue(modifiable, "\\(", "_", exceptions); + modifiable = this.sanitizeValue(modifiable, "\\)", "", exceptions); + + // input.name => input_name + modifiable = this.sanitizeValue(modifiable, "\\.", "_", exceptions); + + // input-name => input_name + modifiable = this.sanitizeValue(modifiable, "-", "_", exceptions); + + // a|b => a_b + modifiable = this.sanitizeValue(modifiable, "\\|", "_", exceptions); + + // input name and age => input_name_and_age + modifiable = this.sanitizeValue(modifiable, " ", "_", exceptions); + + // /api/films/get => _api_films_get + // \api\films\get => _api_films_get + modifiable = modifiable.replaceAll("/", "_"); + modifiable = modifiable.replaceAll("\\\\", "_"); + + // remove everything else other than word, number and _ + // $php_variable => php_variable + if (allowUnicodeIdentifiers) { //could be converted to a single line with ?: operator + modifiable = Pattern.compile(sanitizeNameOptions.getRemoveCharRegEx(), Pattern.UNICODE_CHARACTER_CLASS).matcher(modifiable).replaceAll(""); + } else { + modifiable = modifiable.replaceAll(sanitizeNameOptions.getRemoveCharRegEx(), ""); + } + return modifiable; + }); + } + + private String sanitizeValue(String value, String replaceMatch, String replaceValue, List exceptionList) { + if (exceptionList.size() == 0 || !exceptionList.contains(replaceMatch)) { + return value.replaceAll(replaceMatch, replaceValue); + } + return value; + } + + /** + * Sanitize tag + * + * @param tag Tag + * @return Sanitized tag + */ + @Override + public String sanitizeTag(String tag) { + tag = org.openapijsonschematools.codegen.utils.StringUtils.camelize(sanitizeName(tag)); + + // tag starts with numbers + if (tag.matches("^\\d.*")) { + tag = "Class" + tag; + } + + return tag; + } + + protected LinkedHashMap getEnumValueToName(Schema schema) { + if (schema.getEnum() == null) { + return null; + } + + ArrayList values = new ArrayList<>(((Schema) schema).getEnum()); + LinkedHashMap enumValueToName = new LinkedHashMap<>(); + LinkedHashMap enumNameToValue = new LinkedHashMap<>(); + int truncateIdx = 0; + + if (isRemoveEnumValuePrefix()) { + String commonPrefix = findCommonPrefixOfVars(values); + truncateIdx = commonPrefix.length(); + } + + List xEnumVariableNames = null; + List xEnumDescriptions = null; + // noinspection SpellCheckingInspection + String xEnumVariablenamesKey = "x-enum-varnames"; + String xEnumDescriptionsKey = "x-enum-descriptions"; + if (schema.getExtensions() != null) { + if (schema.getExtensions().containsKey(xEnumVariablenamesKey)) { + xEnumVariableNames = new ArrayList<>(); + Object result = schema.getExtensions().get(xEnumVariablenamesKey); + if (result instanceof List) { + for (Object item: (List) result) { + if (item instanceof String) { + xEnumVariableNames.add((String) item); + } + } + } + } + if (schema.getExtensions().containsKey(xEnumDescriptionsKey)) { + xEnumDescriptions = new ArrayList<>(); + Object result = schema.getExtensions().get(xEnumDescriptionsKey); + if (result instanceof List) { + for (Object item: (List) result) { + if (item instanceof String) { + xEnumDescriptions.add((String) item); + } + } + } + } + } + + int i = 0; + for (Object value : values) { + String description = null; + if (xEnumDescriptions != null && xEnumDescriptions.size() > i) { + description = xEnumDescriptions.get(i); + } + + String enumName; + if (xEnumVariableNames != null && xEnumVariableNames.size() > i) { + enumName = xEnumVariableNames.get(i); + } else { + if (truncateIdx == 0) { + enumName = String.valueOf(value); + } else { + enumName = value.toString().substring(truncateIdx); + if (enumName.isEmpty()) { + enumName = value.toString(); + } + } + } + + String usedName = toEnumVarName(enumName, schema); + EnumValue enumValue = getEnumValue(value, description); + enumValueToName.put(enumValue, usedName); + + if (!enumNameToValue.containsKey(usedName)) { + enumNameToValue.put(usedName, enumValue); + } else { + LOGGER.error( + "Enum error: two generated enum variable names collide. The values {} and {} generate variable name {} . Please file an issue at https://github.com/openapi-json-schema-tools/openapi-json-schema-generator/issues", + enumNameToValue.get(usedName).value, + enumValue.value, + usedName); + } + i += 1; + } + + return enumValueToName; + } + + /** + * If the pattern misses the delimiter, add "/" to the beginning and end + * Otherwise, return the original pattern + * + * @param pattern the pattern (regular expression) + * @return the pattern with delimiter + */ + public CodegenPatternInfo addRegularExpressionDelimiter(String pattern) { + if (StringUtils.isEmpty(pattern)) { + return new CodegenPatternInfo(pattern, null); + } + + String usedPattern = pattern; + if (!pattern.matches("^/.*")) { + usedPattern = "/" + pattern.replaceAll("/", "\\\\/") + "/"; + } + + return new CodegenPatternInfo(usedPattern, null); + } + + /** + * reads propertyKey from additionalProperties, converts it to a boolean and + * writes it back to additionalProperties to be usable as a boolean in + * mustache files. + * + * @param propertyKey property key + * @return property value as boolean + */ + public boolean convertPropertyToBooleanAndWriteBack(String propertyKey) { + boolean result = convertPropertyToBoolean(propertyKey); + writePropertyBack(propertyKey, result); + return result; + } + + /** + * Provides an override location, if any is specified, for the .openapi-generator-ignore. + *

    + * This is originally intended for the first generation only. + * + * @return a string of the full path to an override ignore file. + */ + @Override + public String getIgnoreFilePathOverride() { + return ignoreFilePathOverride; + } + + /** + * Sets an override location for the '.openapi-generator-ignore' location for the first code generation. + * + * @param ignoreFileOverride The full path to an ignore file + */ + @Override + public void setIgnoreFilePathOverride(final String ignoreFileOverride) { + this.ignoreFilePathOverride = ignoreFileOverride; + } + + public boolean convertPropertyToBoolean(String propertyKey) { + final Object booleanValue = additionalProperties.get(propertyKey); + boolean result = Boolean.FALSE; + if (booleanValue instanceof Boolean) { + result = (Boolean) booleanValue; + } else if (booleanValue instanceof String) { + result = Boolean.parseBoolean((String) booleanValue); + } else { + LOGGER.warn("The value (generator's option) must be either boolean or string. Default to `false`."); + } + return result; + } + + public void writePropertyBack(String propertyKey, boolean value) { + additionalProperties.put(propertyKey, value); + } + +// private List> getScopes(Scopes scopes) { +// if (scopes != null && !scopes.isEmpty()) { +// List> newScopes = new ArrayList<>(); +// for (Map.Entry scopeEntry : scopes.entrySet()) { +// Map scope = new HashMap<>(); +// scope.put("scope", scopeEntry.getKey()); +// scope.put("description", escapeText(scopeEntry.getValue())); +// newScopes.add(scope); +// } +// return newScopes; +// } +// return null; +// } + + public static Set getConsumesInfo(OpenAPI openAPI, Operation operation) { + RequestBody requestBody = ModelUtils.getReferencedRequestBody(openAPI, operation.getRequestBody()); + + if (requestBody == null || requestBody.getContent() == null || requestBody.getContent().isEmpty()) { + return Collections.emptySet(); // return empty set + } + return requestBody.getContent().keySet(); + } + + public boolean hasFormParameter(OpenAPI openAPI, Operation operation) { + Set consumesInfo = getConsumesInfo(openAPI, operation); + + if (consumesInfo == null || consumesInfo.isEmpty()) { + return false; + } + + for (String consume : consumesInfo) { + if (consume != null && + (consume.toLowerCase(Locale.ROOT).startsWith("application/x-www-form-urlencoded") || + consume.toLowerCase(Locale.ROOT).startsWith("multipart"))) { + return true; + } + } + + return false; + } + + public boolean hasBodyParameter(OpenAPI openAPI, Operation operation) { + RequestBody requestBody = ModelUtils.getReferencedRequestBody(openAPI, operation.getRequestBody()); + if (requestBody == null) { + return false; + } + + Schema schema = ModelUtils.getSchemaFromRequestBody(requestBody); + return ModelUtils.getReferencedSchema(openAPI, schema) != null; + } + + private LinkedHashSet getProducesInfo(ApiResponse inputResponse) { + ApiResponse response = ModelUtils.getReferencedApiResponse(this.openAPI, inputResponse); + if (response == null || response.getContent() == null || response.getContent().isEmpty()) { + return null; + } + + Set contentKeys = response.getContent().keySet(); + if (contentKeys.isEmpty()) { + return null; + } + LinkedHashSet produces = new LinkedHashSet<>(); + for (String key : contentKeys) { + // escape quotation to avoid code injection, "*/*" is a special case, do nothing + String encodedKey = "*/*".equals(key) ? key : escapeQuotationMark(key); + produces.add(encodedKey); + } + return produces; + } + + /** + * returns the list of MIME types the APIs can produce + * + * @param openAPI current specification instance + * @param operation Operation + * @return a set of MIME types + */ + public static Set getProducesInfo(final OpenAPI openAPI, final Operation operation) { + if (operation.getResponses() == null || operation.getResponses().isEmpty()) { + return null; + } + + Set produces = new ConcurrentSkipListSet<>(); + + for (ApiResponse r : operation.getResponses().values()) { + ApiResponse response = ModelUtils.getReferencedApiResponse(openAPI, r); + if (response.getContent() != null) { + produces.addAll(response.getContent().keySet()); + } + } + + return produces; + } + + @Override + public CodegenType getTag() { + return null; + } + + @Override + public String getName() { + return null; + } + + @Override + public String getHelp() { + return null; + } + + protected LinkedHashMap getContent(Content content, String sourceJsonPath) { + if (content == null) { + return null; + } + LinkedHashMap cmtContent = new LinkedHashMap<>(); + for (Entry contentEntry : content.entrySet()) { + String contentType = contentEntry.getKey(); + MediaType mt = contentEntry.getValue(); + LinkedHashMap ceMap = null; + if (mt.getEncoding() != null) { + ceMap = new LinkedHashMap<>(); + Map encMap = mt.getEncoding(); + for (Entry encodingEntry : encMap.entrySet()) { + String encodingPropertyName = encodingEntry.getKey(); + Encoding enc = encodingEntry.getValue(); + Map headers = new HashMap<>(); + if (enc.getHeaders() != null) { + Map encHeaders = enc.getHeaders(); + for (Entry headerEntry : encHeaders.entrySet()) { + String headerName = headerEntry.getKey(); + Header header = headerEntry.getValue(); + String usedSourceJsonPath = sourceJsonPath + "/" + ModelUtils.encodeSlashes(contentType) + "/encoding/" + encodingPropertyName + "/headers/" + headerName; + CodegenHeader codegenHeader = fromHeader(header, usedSourceJsonPath); + headers.put(headerName, codegenHeader); + } + } + CodegenEncoding ce = new CodegenEncoding( + enc.getContentType(), + headers, + enc.getStyle().toString(), + enc.getExplode(), + enc.getAllowReserved() + ); + ceMap.put(encodingPropertyName, ce); + } + } + CodegenSchema schemaProp = null; + if (mt.getSchema() != null) { + String usedSourceJsonPath = sourceJsonPath + "/" + ModelUtils.encodeSlashes(contentType) + "/schema"; + schemaProp = fromSchema(mt.getSchema(), usedSourceJsonPath, usedSourceJsonPath); + } + HashMap schemaTestCases = null; + if (mt.getExtensions() != null && mt.getExtensions().containsKey(xSchemaTestExamplesKey)) { + Object objNodeWithRef = mt.getExtensions().get(xSchemaTestExamplesKey); + if (objNodeWithRef instanceof LinkedHashMap) { + String refKey = "$ref"; + Object refToTestCases = ((LinkedHashMap) objNodeWithRef).getOrDefault(refKey, null); + if (refToTestCases instanceof String) { + schemaTestCases = extractSchemaTestCases((String) refToTestCases); + } + } + } + + CodegenMediaType codegenMt = new CodegenMediaType(schemaProp, ceMap, schemaTestCases); + CodegenKey ck = getKey(contentType); + cmtContent.put(ck, codegenMt); + } + return cmtContent; + } + + public String toRequestBodyFilename(String componentName) { + return toModuleFilename(componentName, null); + } + + protected String toRefModule(String ref, String sourceJsonPath, String expectedComponentType) { + if (ref == null) { + return null; + } + // ref #/components/schemas/SomeModel -> some_model + // ref #/components/requestBodies/SomeBody -> some_body + // ref #/components/parameters/SomeParam -> some_param + // ref #/components/headers/SomeHeader -> some_header + + String[] refPieces = ref.split("/"); + if (!ref.startsWith("#/components/")) { + throw new RuntimeException("The ref must be to a component"); + } + if (refPieces.length != 4) { + throw new RuntimeException("The ref must be to a named key in one of the components"); + } + if (!refPieces[2].equals(expectedComponentType)) { + throw new RuntimeException("Incorrect component type in ref, expected "+expectedComponentType+" and saw "+refPieces[2]); + } + switch (expectedComponentType) { + case "requestBodies": + return toRequestBodyFilename(refPieces[3]); + case "responses": + return toResponseModuleName(refPieces[3], ref); + case "headers": + return toHeaderFilename(refPieces[3], ref); + case "parameters": + return toParameterFilename(refPieces[3], ref); + case "schemas": + if (ref.equals(sourceJsonPath)) { + // property is of type self + return null; + } + return getKey(refPieces[3]).snakeCase; + case "securitySchemes": + return toSecuritySchemeFilename(refPieces[3], ref); + } + return null; + } + + private CodegenKey getJsonPathPiece(String expectedComponentType, String currentJsonPath) { + // last fragment info + // requestBody -> requestBody + // headers -> headerName + // parameters/i -> i + // components/parameters/someParam -> someParam + String usedName = currentJsonPath.substring(currentJsonPath.lastIndexOf("/") + 1); + return getKey(usedName, expectedComponentType, currentJsonPath); + } + + private void setSchemaLocationInfo(String ref, String sourceJsonPath, String currentJsonPath, CodegenSchema instance) { + String expectedComponentType = "schemas"; + if (ref != null) { + String refModule = toRefModule(ref, sourceJsonPath, expectedComponentType); + String refClass = toRefClass(ref, sourceJsonPath, expectedComponentType); + PairCacheKey ck = new PairCacheKey(ref, ref); + CodegenSchema cs = codegenSchemaCache.computeIfAbsent(ck, s -> new CodegenSchema()); + instance.refInfo = new CodegenRefInfo<>(cs, refClass, refModule); + } + if (currentJsonPath == null) { + return; + } + instance.jsonPathPiece = getJsonPathPiece(expectedComponentType, currentJsonPath); + String[] pathPieces = currentJsonPath.split("/"); + // #/components/schemas/A + if (pathPieces.length == 4 && currentJsonPath.startsWith("#/components/"+expectedComponentType+"/")) { + instance.componentModule = true; + } + } + + public CodegenRequestBody fromRequestBody(RequestBody requestBody, String sourceJsonPath) { + // process body parameter + if (requestBody == null) { + String msg = "body in fromRequestBody cannot be null!"; + LOGGER.error(msg); + throw new RuntimeException(msg); + } + CodegenRequestBody codegenRequestBody = codegenRequestBodyCache.getOrDefault(sourceJsonPath, null); + if (codegenRequestBody != null) { + return codegenRequestBody; + } + + String ref = requestBody.get$ref(); + String expectedComponentType = "requestBodies"; + CodegenRefInfo refInfo = null; + TreeSet imports = null; + if (ref != null) { + String refModule = toRefModule(ref, sourceJsonPath, expectedComponentType); + String refClass = toRefClass(ref, sourceJsonPath, expectedComponentType); + CodegenRequestBody rb = fromRequestBody(ModelUtils.getReferencedRequestBody(openAPI, requestBody), ref); + refInfo = new CodegenRefInfo<>(rb, refClass, refModule); + imports = new TreeSet<>(); + imports.add(getImport(refInfo)); + } + CodegenKey jsonPathPiece = getJsonPathPiece(expectedComponentType, sourceJsonPath); + String[] pathPieces = sourceJsonPath.split("/"); + // #/components/requestBodies/A + boolean componentModule = false; + if (pathPieces.length == 4 && sourceJsonPath.startsWith("#/components/"+expectedComponentType+"/")) { + componentModule = true; + } + + String description = escapeText(requestBody.getDescription()); + String unescapedDescription = requestBody.getDescription(); + Map vendorExtensions = null; + if (requestBody.getExtensions() != null && !requestBody.getExtensions().isEmpty()) { + vendorExtensions = requestBody.getExtensions(); + } + Boolean required = requestBody.getRequired(); + LinkedHashMap content = null; + if (requestBody.getContent() != null) { + content = getContent(requestBody.getContent(), sourceJsonPath + "/content"); + } + // set the parameter's example value + // should be overridden by lang codegen + TreeSet finalImports = imports; + Map finalVendorExtensions = vendorExtensions; + LinkedHashMap finalContent = content; + codegenRequestBody = new CodegenRequestBody(description, unescapedDescription, finalVendorExtensions, required, finalContent, finalImports, componentModule, jsonPathPiece, refInfo); + codegenRequestBodyCache.put(sourceJsonPath, codegenRequestBody); + return codegenRequestBody; + } + + public CodegenKey getKey(String key, String expectedComponentType) { + return getKey(key, expectedComponentType, null); + } + + public CodegenKey getKey(String key, String expectedComponentType, String jsonPath) { + String usedKey = handleSpecialCharacters(key); + boolean isValid = isValid(usedKey); + String snakeCaseName = null; + String camelCaseName = null; + String anchorPiece = null; + switch (expectedComponentType) { + case "schemas": + snakeCaseName = toModelFilename(usedKey, jsonPath); + camelCaseName = toModelName(usedKey, jsonPath); + break; + case "parameters": + snakeCaseName = toParameterFilename(usedKey, jsonPath); + camelCaseName = getCamelCaseParameter(usedKey); + break; + case "requestBodies": + snakeCaseName = toRequestBodyFilename(usedKey); + camelCaseName = toModelName(usedKey, jsonPath); + break; + case "headers": + snakeCaseName = toHeaderFilename(usedKey, jsonPath); + camelCaseName = toModelName(usedKey, jsonPath); + break; + case "responses": + snakeCaseName = toResponseModuleName(usedKey, jsonPath); + camelCaseName = getCamelCaseResponse(usedKey); + break; + case "securitySchemes": + snakeCaseName = toSecuritySchemeFilename(usedKey, jsonPath); + camelCaseName = toModelName(usedKey, jsonPath); + break; + case "servers": + snakeCaseName = toServerFilename(usedKey, jsonPath); + camelCaseName = getCamelCaseServer(usedKey); + break; + } + if (camelCaseName != null) { + anchorPiece = camelCaseName.toLowerCase(Locale.ROOT); + } + return new CodegenKey( + usedKey, + isValid, + snakeCaseName, + camelCaseName, + anchorPiece + ); + } + + @Override + public CodegenKey getKey(String key) { + String usedKey = handleSpecialCharacters(key); + boolean isValid = isValid(usedKey); + String camelCase = toModelName(usedKey, null); + String anchorPiece = camelCase.toLowerCase(Locale.ROOT); + return new CodegenKey( + usedKey, + isValid, + toModelFilename(usedKey, null), + camelCase, + anchorPiece + ); + } + + protected LinkedHashMap getRequiredProperties(LinkedHashSet required, LinkedHashMap properties, Object schemaAdditionalProperties, CodegenSchema additionalProperties) { + if (required.isEmpty()) { + return null; + } + /* + this should be called after vars and additionalProperties are set + Features added by storing codegenProperty values: + - refClass stores reference to additionalProperties definition + - baseName stores original name (can be invalid in a programming language) + - nameInSnakeCase can store valid name for a programming language + */ + LinkedHashMap requiredProperties = new LinkedHashMap<>(); + for (String requiredPropertyName: required) { + // required property is defined in properties, value is that CodegenSchema + CodegenKey key = getKey(requiredPropertyName); + if (properties != null && properties.containsKey(key)) { + // get cp from property + CodegenSchema prop = properties.get(key); + if (prop != null) { + requiredProperties.put(key, prop); + } else { + throw new RuntimeException("Property " + requiredPropertyName + " is missing from getVars"); + } + } else if (schemaAdditionalProperties instanceof Boolean && Boolean.FALSE.equals(schemaAdditionalProperties)) { + // required property is not defined in properties, and additionalProperties is false, value is null + requiredProperties.put(key, null); + } else { + // required property is not defined in properties, and additionalProperties is true or unset value is CodegenSchema made from empty schema + // required property is not defined in properties, and additionalProperties is schema, value is CodegenSchema made from schema + if (supportsAdditionalPropertiesWithComposedSchema && !disallowAdditionalPropertiesIfNotPresent) { + CodegenSchema prop; + if (schemaAdditionalProperties == null) { + // additionalProperties is null + // there is NO schema definition for this so the json paths are null + prop = requiredAddPropUnsetSchema; + } else if (schemaAdditionalProperties instanceof Boolean && Boolean.TRUE.equals(schemaAdditionalProperties)) { + // additionalProperties is True + prop = additionalProperties; + } else { + // additionalProperties is schema + prop = additionalProperties; + } + requiredProperties.put(key, prop); + } + } + } + return requiredProperties; + } + + protected void addOption(String key, String description, String defaultValue) { + CliOption option = new CliOption(key, description); + if (defaultValue != null) + option.defaultValue(defaultValue); + cliOptions.add(option); + } + + protected void updateOption(String key, String defaultValue) { + for (CliOption cliOption : cliOptions) { + if (cliOption.getOpt().equals(key)) { + cliOption.setDefault(defaultValue); + break; + } + } + } + + /** + * generates OpenAPI specification file in YAML format + * + * @param data map of object + */ + public void generateYAMLSpecFile(Map data) { + OpenAPI openAPI = (OpenAPI) data.get("openAPI"); + String yaml = SerializerUtils.toYamlString(openAPI); + if (yaml != null) { + data.put("openapi-yaml", yaml); + } + } + + private String removeTrailingSlash(String value) { + return StringUtils.removeEnd(value, "/"); + } + + @Override + public TreeMap fromPaths(Paths paths){ + if (paths == null) { + return null; + } + String jsonPath = "#/paths/"; + TreeMap codegenPaths = new TreeMap<>(); + for (Map.Entry entry: paths.entrySet()) { + String path = entry.getKey(); + PathItem pathItem = entry.getValue(); + String pathItemJsonPath = jsonPath + ModelUtils.encodeSlashes(path); + CodegenPathItem codegenPathItem = fromPathItem(pathItem, pathItemJsonPath); + CodegenKey pathKey = getKey(path); + codegenPaths.put(pathKey, codegenPathItem); + } + // sort them + codegenPaths = new TreeMap<>(codegenPaths); + return codegenPaths; + } + + @Override + public CodegenPathItem fromPathItem(PathItem pathItem, String jsonPath) { + String summary = pathItem.getSummary(); + String description = pathItem.getDescription(); + TreeMap operations = new TreeMap<>(); + Operation specOperation = pathItem.getGet(); + String httpMethod = "get"; + if (specOperation != null) { + operations.put(getKey(httpMethod), fromOperation(specOperation, jsonPath + "/" + httpMethod)); + } + specOperation = pathItem.getPut(); + httpMethod = "put"; + if (specOperation != null) { + operations.put(getKey(httpMethod), fromOperation(specOperation, jsonPath + "/" + httpMethod)); + } + specOperation = pathItem.getPost(); + httpMethod = "post"; + if (specOperation != null) { + operations.put(getKey(httpMethod), fromOperation(specOperation, jsonPath + "/" + httpMethod)); + } + specOperation = pathItem.getDelete(); + httpMethod = "delete"; + if (specOperation != null) { + operations.put(getKey(httpMethod), fromOperation(specOperation, jsonPath + "/" + httpMethod)); + } + specOperation = pathItem.getOptions(); + httpMethod = "options"; + if (specOperation != null) { + operations.put(getKey(httpMethod), fromOperation(specOperation, jsonPath + "/" + httpMethod)); + } + specOperation = pathItem.getHead(); + httpMethod = "head"; + if (specOperation != null) { + operations.put(getKey(httpMethod), fromOperation(specOperation, jsonPath + "/" + httpMethod)); + } + specOperation = pathItem.getPatch(); + httpMethod = "patch"; + if (specOperation != null) { + operations.put(getKey(httpMethod), fromOperation(specOperation, jsonPath + "/" + httpMethod)); + } + specOperation = pathItem.getTrace(); + httpMethod = "trace"; + if (specOperation != null) { + operations.put(getKey(httpMethod), fromOperation(specOperation, jsonPath + "/" + httpMethod)); + } + if (operations != null) + // sort them + operations = new TreeMap<>(operations); + List specServers = pathItem.getServers(); + List servers = fromServers(specServers, jsonPath + "/servers"); + + return new CodegenPathItem( + summary, + description, + operations, + servers, + null + ); + } + + @Override + public List fromServers(List servers, String jsonPath) { + if (servers == null) { + return null; + } + List codegenServers = new LinkedList<>(); + int i = 0; + boolean rootServer = jsonPath.equals("#/servers"); + for (Server server : servers) { + String serverJsonPath = jsonPath + "/" + i; + CodegenKey jsonPathPiece = getKey(String.valueOf(i), "servers"); + CodegenServer cs = new CodegenServer( + removeTrailingSlash(server.getUrl()), // because trailing slash has no impact on server and path needs slash as first char + escapeText(server.getDescription()), + fromServerVariables(server.getVariables(), serverJsonPath + "/variables"), + jsonPathPiece, + rootServer + ); + codegenServers.add(cs); + i ++; + } + return codegenServers; + } + + @Override + public LinkedHashMap fromServerVariables(Map serverVariables, String jsonPath) { + if (serverVariables == null) { + return null; + } + + LinkedHashMap variables = new LinkedHashMap<>(); + for (Entry entry: serverVariables.entrySet()) { + String variableName = entry.getKey(); + ServerVariable variable = entry.getValue(); + StringSchema schema = new StringSchema(); + if (variable.getDescription() != null) { + schema.setDescription(variable.getDescription()); + } + schema.setDefault(variable.getDefault()); + if (variable.getEnum() != null) { + schema.setEnum(variable.getEnum()); + } + String schemaJsonPath = jsonPath + "/" + variableName; + CodegenSchema codegenSchema = fromSchema(schema, jsonPath, schemaJsonPath); + CodegenKey key = getKey(variableName); + variables.put(key, codegenSchema); + } + return variables; + } + + /** + * Post-process the auto-generated file, e.g. using go-fmt to format the Go code. The file type can be "model-test", + * "model-doc", "model", "api", "api-test", "api-doc", "supporting-mustache", "supporting-common", + * "openapi-generator-ignore", "openapi-generator-version" + *

    + * TODO: store these values in enum instead + * + * @param file file to be processed + * @param fileType file type + */ + @Override + public void postProcessFile(File file, String fileType) { + LOGGER.debug("Post processing file {} ({})", file, fileType); + } + + /** + * Boolean value indicating the state of the option for post-processing file using environment variables. + * + * @return true if the option is enabled + */ + @Override + public boolean isEnablePostProcessFile() { + return enablePostProcessFile; + } + + /** + * Set the boolean value indicating the state of the option for post-processing file using environment variables. + * + * @param enablePostProcessFile true to enable post-processing file + */ + @Override + public void setEnablePostProcessFile(boolean enablePostProcessFile) { + this.enablePostProcessFile = enablePostProcessFile; + } + + /** + * Get the boolean value indicating the state of the option for updating only changed files + */ + @Override + public boolean isEnableMinimalUpdate() { + return enableMinimalUpdate; + } + + /** + * Set the boolean value indicating the state of the option for updating only changed files + * + * @param enableMinimalUpdate true to enable minimal update + */ + @Override + public void setEnableMinimalUpdate(boolean enableMinimalUpdate) { + this.enableMinimalUpdate = enableMinimalUpdate; + } + + /** + * Indicates whether the codegen configuration should treat documents as strictly defined by the OpenAPI specification. + * + * @return true to act strictly upon spec documents, potentially modifying the spec to strictly fit the spec. + */ + @Override + public boolean isStrictSpecBehavior() { + return this.strictSpecBehavior; + } + + /** + * Sets the boolean valid indicating whether generation will work strictly against the specification, potentially making + * minor changes to the input document. + * + * @param strictSpecBehavior true if we will behave strictly, false to allow specification documents which pass validation to be loosely interpreted against the spec. + */ + @Override + public void setStrictSpecBehavior(final boolean strictSpecBehavior) { + this.strictSpecBehavior = strictSpecBehavior; + } + + @Override + public FeatureSet getFeatureSet() { + return this.generatorMetadata.getFeatureSet(); + } + + /** + * Get the boolean value indicating whether to remove enum value prefixes + */ + @Override + public boolean isRemoveEnumValuePrefix() { + return this.removeEnumValuePrefix; + } + + /** + * Set the boolean value indicating whether to remove enum value prefixes + * + * @param removeEnumValuePrefix true to enable enum value prefix removal + */ + @Override + public void setRemoveEnumValuePrefix(final boolean removeEnumValuePrefix) { + this.removeEnumValuePrefix = removeEnumValuePrefix; + } + + protected void modifyFeatureSet(Consumer processor) { + FeatureSet.Builder builder = getFeatureSet().modify(); + processor.accept(builder); + this.generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata) + .featureSet(builder.build()).build(); + } + + /** + * A map entry for cached sanitized names. + */ + private static class SanitizeNameOptions { + public SanitizeNameOptions(String name, String removeCharRegEx, List exceptions) { + this.name = name; + this.removeCharRegEx = removeCharRegEx; + if (exceptions != null) { + this.exceptions = Collections.unmodifiableList(exceptions); + } else { + this.exceptions = Collections.emptyList(); + } + } + + public String getName() { + return name; + } + + public String getRemoveCharRegEx() { + return removeCharRegEx; + } + + public List getExceptions() { + return exceptions; + } + + private final String name; + private final String removeCharRegEx; + private final List exceptions; + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + SanitizeNameOptions that = (SanitizeNameOptions) o; + return Objects.equals(getName(), that.getName()) && + Objects.equals(getRemoveCharRegEx(), that.getRemoveCharRegEx()) && + Objects.equals(getExceptions(), that.getExceptions()); + } + + @Override + public int hashCode() { + return Objects.hash(getName(), getRemoveCharRegEx(), getExceptions()); + } + } + + /** + * Returns the additionalProperties Schema for the specified input schema. + *

    + * The additionalProperties keyword is used to control the handling of additional, undeclared + * properties, that is, properties whose names are not listed in (json schema) properties (keyword). + * The additionalProperties keyword may be either a boolean or an object. + * If additionalProperties is a boolean and set to false, no additional properties are allowed. + * By default, when the additionalProperties keyword is not specified in the input schema, + * any additional properties are allowed. This is equivalent to setting additionalProperties + * to the boolean value True or setting additionalProperties: {} + * + * @param schema the input schema that may or may not have the additionalProperties keyword. + * @return the Schema of the additionalProperties. The null value is returned if no additional + * properties are allowed. + */ + protected Schema getAdditionalProperties(Schema schema) { + return ModelUtils.getAdditionalProperties(openAPI, schema); + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * + * @param mime MIME string + * @return true if the input matches the JSON MIME + */ + protected static boolean isJsonMimeType(String mime) { + return mime != null && (JSON_MIME_PATTERN.matcher(mime).matches()); + } + + /** + * Check if the given MIME is a JSON Vendor MIME. + * JSON MIME examples: + * application/vnd.company+json + * application/vnd.company.resourceA.version1+json + * + * @param mime MIME string + * @return true if the input matches the JSON vendor MIME + */ + protected static boolean isJsonVendorMimeType(String mime) { + return mime != null && JSON_VENDOR_MIME_PATTERN.matcher(mime).matches(); + } + + private List getComposedProperties(List xOfCollection, String collectionName, String sourceJsonPath, String currentJsonPath) { + if (xOfCollection == null) { + return null; + } + List xOf = new ArrayList<>(); + int i = 0; + for (Schema xOfSchema : xOfCollection) { + CodegenSchema cp = fromSchema(xOfSchema, sourceJsonPath, currentJsonPath + "/" + collectionName + "/" + i); + xOf.add(cp); + i += 1; + } + return xOf; + } + + @Override + public String defaultTemplatingEngine() { + return "mustache"; + } + + @Override + public GeneratorLanguage generatorLanguage() { + return GeneratorLanguage.JAVA; + } + + @Override + public String generatorLanguageVersion() { + return null; + } + + @Override + public List getSupportedVendorExtensions() { + return new ArrayList<>(); + } + + /* + A function to convert yaml or json ingested strings like property names + And convert special characters like newline, tab, carriage return + Into strings that can be rendered in the language that the generator will output to + */ + protected String handleSpecialCharacters(String name) { return name; } + + /** + * Used to ensure that null or Schema is returned given an input Boolean/Schema/null + * This will be used in openapi 3.1.0 spec processing to ensure that Booleans become Schemas + * Because our generators only understand Schemas + * Note: use getIsBooleanSchemaTrue or getIsBooleanSchemaFalse on the OpenApiSchema + * if you need to be able to detect if the original schema's value was true or false + * + * @param schema the input Boolean or Schema data to convert to a Schema + * @return Schema the input data converted to a Schema if possible + */ + protected Schema getSchemaFromBooleanOrSchema(Object schema) { + if (schema instanceof Boolean) { + if (Boolean.TRUE.equals(schema)) { + return trueSchema; + } else if (Boolean.FALSE.equals(schema)) { + return falseSchema; + } + // null case + return null; + } else if (schema instanceof Schema) { + return (Schema) schema; + } else if (schema == null) { + return null; + } + throw new IllegalArgumentException("Invalid schema type; type must be Boolean or Schema"); + } +} diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/DefaultGenerator.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/DefaultGenerator.java new file mode 100644 index 00000000000..606351e2db8 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/DefaultGenerator.java @@ -0,0 +1,1690 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * Copyright 2018 SmartBear Software + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapijsonschematools.codegen; + +import io.swagger.v3.core.util.Json; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.headers.Header; +import io.swagger.v3.oas.models.info.Contact; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.info.License; +import io.swagger.v3.oas.models.media.Schema; +import io.swagger.v3.oas.models.parameters.Parameter; +import io.swagger.v3.oas.models.parameters.RequestBody; +import io.swagger.v3.oas.models.responses.ApiResponse; +import io.swagger.v3.oas.models.security.*; +import io.swagger.v3.oas.models.tags.Tag; +import org.apache.commons.io.FilenameUtils; +import org.apache.commons.io.comparator.PathFileComparator; +import org.apache.commons.lang3.StringUtils; +import org.openapijsonschematools.codegen.config.GlobalSettings; +import org.openapijsonschematools.codegen.ignore.CodegenIgnoreProcessor; +import org.openapijsonschematools.codegen.model.CodegenHeader; +import org.openapijsonschematools.codegen.model.CodegenKey; +import org.openapijsonschematools.codegen.model.CodegenMediaType; +import org.openapijsonschematools.codegen.model.CodegenOperation; +import org.openapijsonschematools.codegen.model.CodegenParameter; +import org.openapijsonschematools.codegen.model.CodegenPathItem; +import org.openapijsonschematools.codegen.model.CodegenRequestBody; +import org.openapijsonschematools.codegen.model.CodegenResponse; +import org.openapijsonschematools.codegen.model.CodegenSchema; +import org.openapijsonschematools.codegen.model.CodegenSecurityRequirementValue; +import org.openapijsonschematools.codegen.model.CodegenSecurityScheme; +import org.openapijsonschematools.codegen.model.CodegenServer; +import org.openapijsonschematools.codegen.model.CodegenTag; +import org.openapijsonschematools.codegen.serializer.SerializerUtils; +import org.openapijsonschematools.codegen.templating.CommonTemplateContentLocator; +import org.openapijsonschematools.codegen.templating.GeneratorTemplateContentLocator; +import org.openapijsonschematools.codegen.templating.MustacheEngineAdapter; +import org.openapijsonschematools.codegen.templating.TemplateManagerOptions; +import org.openapijsonschematools.codegen.utils.ImplementationVersion; +import org.openapijsonschematools.codegen.utils.ModelUtils; +import org.openapijsonschematools.codegen.utils.OnceLogger; +import org.openapijsonschematools.codegen.utils.URLPathUtils; +import org.openapijsonschematools.codegen.api.TemplateDefinition; +import org.openapijsonschematools.codegen.api.TemplatePathLocator; +import org.openapijsonschematools.codegen.api.TemplateProcessor; +import org.openapijsonschematools.codegen.api.TemplatingEngineAdapter; +import org.openapijsonschematools.codegen.api.TemplateFileType; +import org.openapijsonschematools.codegen.meta.GeneratorMetadata; +import org.openapijsonschematools.codegen.meta.Stability; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.*; +import java.net.URL; +import java.nio.charset.StandardCharsets; +import java.nio.file.Path; +import java.time.ZonedDateTime; +import java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; + +import static org.apache.commons.lang3.StringUtils.removeStart; + +@SuppressWarnings("rawtypes") +public class DefaultGenerator implements Generator { + private static final String METADATA_DIR = ".openapi-generator"; + protected final Logger LOGGER = LoggerFactory.getLogger(DefaultGenerator.class); + private final boolean dryRun; + protected CodegenConfig config; + protected ClientOptInput opts; + protected OpenAPI openAPI; + protected CodegenIgnoreProcessor ignoreProcessor; + private Boolean generateApis = null; + private Boolean generateModels = null; + private Boolean generateSupportingFiles = null; + private Boolean generateApiTests = null; + private Boolean generateApiDocumentation = null; + private Boolean generateModelTests = null; + private Boolean generateModelDocumentation = null; + private Boolean generateMetadata = true; + private String contextPath; + private Map generatorPropertyDefaults = new HashMap<>(); + protected TemplateProcessor templateProcessor = null; + + private List userDefinedTemplates = new ArrayList<>(); + + + public DefaultGenerator() { + this(false); + } + + public DefaultGenerator(Boolean dryRun) { + this.dryRun = Boolean.TRUE.equals(dryRun); + LOGGER.info("Generating with dryRun={}", this.dryRun); + } + + @SuppressWarnings("deprecation") + @Override + public Generator opts(ClientOptInput opts) { + this.opts = opts; + this.openAPI = opts.getOpenAPI(); + this.config = opts.getConfig(); + List userFiles = opts.getUserDefinedTemplates(); + if (userFiles != null) { + this.userDefinedTemplates = Collections.unmodifiableList(userFiles); + } + + TemplateManagerOptions templateManagerOptions = new TemplateManagerOptions(this.config.isEnableMinimalUpdate(), this.config.isSkipOverwrite()); + + if (this.dryRun) { + this.templateProcessor = new DryRunTemplateManager(templateManagerOptions); + } else { + TemplatingEngineAdapter templatingEngine = this.config.getTemplatingEngine(); + + if (templatingEngine instanceof MustacheEngineAdapter) { + MustacheEngineAdapter mustacheEngineAdapter = (MustacheEngineAdapter) templatingEngine; + mustacheEngineAdapter.setCompiler(this.config.processCompiler(mustacheEngineAdapter.getCompiler())); + } + + TemplatePathLocator commonTemplateLocator = new CommonTemplateContentLocator(); + TemplatePathLocator generatorTemplateLocator = new GeneratorTemplateContentLocator(this.config); + this.templateProcessor = new TemplateManager( + templateManagerOptions, + templatingEngine, + new TemplatePathLocator[]{generatorTemplateLocator, commonTemplateLocator} + ); + } + + String ignoreFileLocation = this.config.getIgnoreFilePathOverride(); + if (ignoreFileLocation != null) { + final File ignoreFile = new File(ignoreFileLocation); + if (ignoreFile.exists() && ignoreFile.canRead()) { + this.ignoreProcessor = new CodegenIgnoreProcessor(ignoreFile); + } else { + LOGGER.warn("Ignore file specified at {} is not valid. This will fall back to an existing ignore file if present in the output directory.", ignoreFileLocation); + } + } + + if (this.ignoreProcessor == null) { + this.ignoreProcessor = new CodegenIgnoreProcessor(this.config.getOutputDir()); + } + + return this; + } + + /** + * Retrieves an instance to the configured template processor, available after user-defined options are + * applied via {@link DefaultGenerator#opts(ClientOptInput)}. + * + * @return A configured {@link TemplateProcessor}, or null. + */ + public TemplateProcessor getTemplateProcessor() { + return templateProcessor; + } + + /** + * Programmatically disable the output of .openapi-generator/VERSION, .openapi-generator-ignore, + * or other metadata files used by OpenAPI JSON Schema Generator. + * + * @param generateMetadata true: enable outputs, false: disable outputs + */ + @SuppressWarnings("WeakerAccess") + public void setGenerateMetadata(Boolean generateMetadata) { + this.generateMetadata = generateMetadata; + } + + /** + * Set generator properties otherwise pulled from system properties. + * Useful for running tests in parallel without relying on System.properties. + * + * @param key The system property key + * @param value The system property value + */ + @SuppressWarnings("WeakerAccess") + public void setGeneratorPropertyDefault(final String key, final String value) { + this.generatorPropertyDefaults.put(key, value); + } + + private Boolean getGeneratorPropertyDefaultSwitch(final String key, final Boolean defaultValue) { + String result = null; + if (this.generatorPropertyDefaults.containsKey(key)) { + result = this.generatorPropertyDefaults.get(key); + } + if (result != null) { + return Boolean.valueOf(result); + } + return defaultValue; + } + + void configureGeneratorProperties() { + // allows generating only models by specifying a CSV of models to generate, or empty for all + // NOTE: Boolean.TRUE is required below rather than `true` because of JVM boxing constraints and type inference. + generateApis = GlobalSettings.getProperty(CodegenConstants.APIS) != null ? Boolean.TRUE : getGeneratorPropertyDefaultSwitch(CodegenConstants.APIS, null); + generateModels = GlobalSettings.getProperty(CodegenConstants.MODELS) != null ? Boolean.TRUE : getGeneratorPropertyDefaultSwitch(CodegenConstants.MODELS, null); + generateSupportingFiles = GlobalSettings.getProperty(CodegenConstants.SUPPORTING_FILES) != null ? Boolean.TRUE : getGeneratorPropertyDefaultSwitch(CodegenConstants.SUPPORTING_FILES, null); + + if (generateApis == null && generateModels == null && generateSupportingFiles == null) { + // no specifics are set, generate everything + generateApis = generateModels = generateSupportingFiles = true; + } else { + if (generateApis == null) { + generateApis = false; + } + if (generateModels == null) { + generateModels = false; + } + if (generateSupportingFiles == null) { + generateSupportingFiles = false; + } + } + // model/api tests and documentation options rely on parent generate options (api or model) and no other options. + // They default to true in all scenarios and can only be marked false explicitly + generateModelTests = GlobalSettings.getProperty(CodegenConstants.MODEL_TESTS) != null ? Boolean.valueOf(GlobalSettings.getProperty(CodegenConstants.MODEL_TESTS)) : getGeneratorPropertyDefaultSwitch(CodegenConstants.MODEL_TESTS, true); + generateModelDocumentation = GlobalSettings.getProperty(CodegenConstants.MODEL_DOCS) != null ? Boolean.valueOf(GlobalSettings.getProperty(CodegenConstants.MODEL_DOCS)) : getGeneratorPropertyDefaultSwitch(CodegenConstants.MODEL_DOCS, true); + generateApiTests = GlobalSettings.getProperty(CodegenConstants.API_TESTS) != null ? Boolean.valueOf(GlobalSettings.getProperty(CodegenConstants.API_TESTS)) : getGeneratorPropertyDefaultSwitch(CodegenConstants.API_TESTS, true); + generateApiDocumentation = GlobalSettings.getProperty(CodegenConstants.API_DOCS) != null ? Boolean.valueOf(GlobalSettings.getProperty(CodegenConstants.API_DOCS)) : getGeneratorPropertyDefaultSwitch(CodegenConstants.API_DOCS, true); + + // Additional properties added for tests to exclude references in project related files + config.additionalProperties().put(CodegenConstants.GENERATE_API_TESTS, generateApiTests); + config.additionalProperties().put(CodegenConstants.GENERATE_MODEL_TESTS, generateModelTests); + + config.additionalProperties().put(CodegenConstants.GENERATE_API_DOCS, generateApiDocumentation); + config.additionalProperties().put(CodegenConstants.GENERATE_MODEL_DOCS, generateModelDocumentation); + + config.additionalProperties().put(CodegenConstants.GENERATE_APIS, generateApis); + config.additionalProperties().put(CodegenConstants.GENERATE_MODELS, generateModels); + + if (!generateApiTests && !generateModelTests) { + config.additionalProperties().put(CodegenConstants.EXCLUDE_TESTS, true); + } + + if (GlobalSettings.getProperty("debugOpenAPI") != null) { + System.out.println(SerializerUtils.toJsonString(openAPI)); + } else if (GlobalSettings.getProperty("debugSwagger") != null) { + // This exists for backward compatibility + // We fall to this block only if debugOpenAPI is null. No need to dump this twice. + LOGGER.info("Please use system property 'debugOpenAPI' instead of 'debugSwagger'."); + System.out.println(SerializerUtils.toJsonString(openAPI)); + } + + config.processOpts(); + config.preprocessOpenAPI(openAPI); + + // set OpenAPI to make these available to all methods + config.setOpenAPI(openAPI); + + config.additionalProperties().put("generatorVersion", ImplementationVersion.read()); + config.additionalProperties().put("generatedDate", ZonedDateTime.now().toString()); + config.additionalProperties().put("generatedYear", String.valueOf(ZonedDateTime.now().getYear())); + config.additionalProperties().put("generatorClass", config.getClass().getSimpleName()); + config.additionalProperties().put("inputSpec", config.getInputSpec()); + + if (openAPI.getExtensions() != null) { + config.vendorExtensions().putAll(openAPI.getExtensions()); + } + + // TODO: Allow user to define _which_ servers object in the array to target. + // Configures contextPath/basePath according to api document's servers + URL url = URLPathUtils.getServerURL(openAPI, config.serverVariableOverrides()); + contextPath = removeTrailingSlash(config.escapeText(url.getPath())); // for backward compatibility + } + + private void configureOpenAPIInfo() { + Info info = this.openAPI.getInfo(); + if (info == null) { + return; + } + if (info.getTitle() != null) { + config.additionalProperties().put("appName", config.escapeText(info.getTitle())); + } + if (info.getVersion() != null) { + config.additionalProperties().put("appVersion", config.escapeText(info.getVersion())); + } else { + LOGGER.error("Missing required field info version. Default appVersion set to 1.0.0"); + config.additionalProperties().put("appVersion", "1.0.0"); + } + + if (StringUtils.isEmpty(info.getDescription())) { + // set a default description if none if provided + config.additionalProperties().put("appDescription", + "No description provided (generated by Openapi JSON Schema Generator https://github.com/openapi-json-schema-tools/openapi-json-schema-generator)"); + config.additionalProperties().put("appDescriptionWithNewLines", config.additionalProperties().get("appDescription")); + config.additionalProperties().put("unescapedAppDescription", "No description provided (generated by Openapi JSON Schema Generator https://github.com/openapi-json-schema-tools/openapi-json-schema-generator)"); + } else { + config.additionalProperties().put("appDescription", config.escapeText(info.getDescription())); + config.additionalProperties().put("appDescriptionWithNewLines", config.escapeTextWhileAllowingNewLines(info.getDescription())); + config.additionalProperties().put("unescapedAppDescription", info.getDescription()); + } + + if (info.getContact() != null) { + Contact contact = info.getContact(); + if (contact.getEmail() != null) { + config.additionalProperties().put("infoEmail", config.escapeText(contact.getEmail())); + } + if (contact.getName() != null) { + config.additionalProperties().put("infoName", config.escapeText(contact.getName())); + } + if (contact.getUrl() != null) { + config.additionalProperties().put("infoUrl", config.escapeText(contact.getUrl())); + } + } + + if (info.getLicense() != null) { + License license = info.getLicense(); + if (license.getName() != null) { + config.additionalProperties().put("licenseInfo", config.escapeText(license.getName())); + } + if (license.getUrl() != null) { + config.additionalProperties().put("licenseUrl", config.escapeText(license.getUrl())); + } + } + + if (info.getVersion() != null) { + config.additionalProperties().put("version", config.escapeText(info.getVersion())); + } else { + LOGGER.error("Missing required field info version. Default version set to 1.0.0"); + config.additionalProperties().put("version", "1.0.0"); + } + + if (info.getTermsOfService() != null) { + config.additionalProperties().put("termsOfService", config.escapeText(info.getTermsOfService())); + } + } + + private void generateSchemaTests(List files, Map modelData, String modelName) throws IOException { + // to generate model test files + for (Map.Entry configModelTestTemplateFilesEntry : config.modelTestTemplateFiles().entrySet()) { + String templateName = configModelTestTemplateFilesEntry.getKey(); + String suffix = configModelTestTemplateFilesEntry.getValue(); + String filename = config.modelTestFileFolder() + File.separator + config.toModelTestFilename(modelName) + suffix; + + if (generateModelTests) { + // do not overwrite test file that already exists (regardless of config's skipOverwrite setting) + File modelTestFile = new File(filename); + if (modelTestFile.exists()) { + this.templateProcessor.skip(modelTestFile.toPath(), "Test files never overwrite an existing file of the same name."); + } else { + File written = processTemplateToFile(modelData, templateName, filename, generateModelTests, CodegenConstants.MODEL_TESTS, config.modelTestFileFolder()); + if (written != null) { + files.add(written); + if (config.isEnablePostProcessFile() && !dryRun) { + config.postProcessFile(written, "model-test"); + } + } + } + } else if (dryRun) { + Path skippedPath = java.nio.file.Paths.get(filename); + this.templateProcessor.skip(skippedPath, "Skipped by modelTests option supplied by user."); + } + } + } + + private void generateSchemaDocumentation(List files, Map modelData, String jsonPath) throws IOException { + modelData.put("headerSize", "#"); + generateXDocs(files, jsonPath, CodegenConstants.JSON_PATH_LOCATION_TYPE.SCHEMA, CodegenConstants.MODEL_DOCS, modelData, generateModelDocumentation); + } + + private void generateSchema(List files, CodegenSchema schema, String jsonPath) { + Map schemaData = new HashMap<>(); + schemaData.put("packageName", config.packageName()); + schemaData.put("schema", schema); + schemaData.put("identifierPieces", Collections.unmodifiableList(new ArrayList<>())); + schemaData.putAll(config.additionalProperties()); + generateXs(files, jsonPath, CodegenConstants.JSON_PATH_LOCATION_TYPE.SCHEMA, CodegenConstants.MODELS, schemaData, generateModels); + } + + @Override + public String requestBodyFileFolder() { + return ""; + } + + private String packageFilename(List pathSegments) { + String prefix = config.getOutputDir() + File.separatorChar + config.packagePath() + File.separatorChar; + String suffix = pathSegments.stream().collect(Collectors.joining(File.separator)); + return prefix + suffix; + } + + private String filenameFromRoot(List pathSegments) { + String prefix = config.getOutputDir() + File.separatorChar; + String suffix = pathSegments.stream().collect(Collectors.joining(File.separator)); + return prefix + suffix; + } + + private void generateFile(Map templateData, String templateName, String outputFilename, List files, boolean shouldGenerate, String skippedByOption) { + try { + File written = processTemplateToFile(templateData, templateName, outputFilename, shouldGenerate, skippedByOption); + if (written != null) { + files.add(written); + if (config.isEnablePostProcessFile() && !dryRun) { + config.postProcessFile(written, skippedByOption); + } + } + } catch (IOException e) { + LOGGER.error("Error when writing template file {}", e.toString()); + } + } + + private void generateFiles(List> processTemplateToFileInfos, boolean shouldGenerate, String skippedByOption, List files) { + for (List processTemplateToFileInfo: processTemplateToFileInfos) { + Map templateData = (Map) processTemplateToFileInfo.get(0); + String templateName = (String) processTemplateToFileInfo.get(1); + String outputFilename = (String) processTemplateToFileInfo.get(2); + try { + File written = processTemplateToFile(templateData, templateName, outputFilename, shouldGenerate, skippedByOption); + if (written != null) { + files.add(written); + if (config.isEnablePostProcessFile() && !dryRun) { + config.postProcessFile(written, skippedByOption); + } + } + } catch (IOException e) { + LOGGER.error("Error when writing template file {}", e.toString()); + } + } + } + + private void generatePathItem(List files, CodegenKey pathKey, CodegenPathItem pathItem, String jsonPath, List servers, List> security) { + Map pathTemplateInfo = new HashMap<>(); + pathTemplateInfo.put("pathModule", pathKey.snakeCase); + pathTemplateInfo.put("apiClassName", pathKey.camelCase); + pathTemplateInfo.put("path", pathKey.original); + generateXs(files, jsonPath, CodegenConstants.JSON_PATH_LOCATION_TYPE.PATH, CodegenConstants.APIS, pathTemplateInfo, true); + + if (pathItem.servers != null) { + generateServers(files, pathItem.servers, jsonPath + "/servers"); + } + + if (pathItem.operations != null) { + String testInitFilename = filenameFromRoot(Arrays.asList("test", "test_paths", "test_" + pathKey.snakeCase, "__init__.py")); + generateFile(new HashMap<>(), "__init__.hbs", testInitFilename, files, true, CodegenConstants.API_TESTS); + + for (Map.Entry entry: pathItem.operations.entrySet()) { + CodegenKey httpMethod = entry.getKey(); + CodegenOperation operation = entry.getValue(); + String operationJsonPath = jsonPath + "/" + httpMethod.original; + + Map endpointMap = new HashMap<>(); + endpointMap.put("operation", operation); + endpointMap.put("pathItem", pathItem); + endpointMap.put("httpMethod", httpMethod); + endpointMap.put("security", security); + generateXs(files, operationJsonPath, CodegenConstants.JSON_PATH_LOCATION_TYPE.OPERATION, CodegenConstants.APIS, endpointMap, true); + + // operation docs + Map endpointInfo = new HashMap<>(); + endpointInfo.put("operation", operation); + endpointInfo.put("httpMethod", httpMethod); + endpointInfo.put("path", pathKey); + endpointInfo.put("pathItem", pathItem); + endpointInfo.put("servers", servers); + endpointInfo.put("security", security); + endpointInfo.put("packageName", config.packageName()); + endpointInfo.put("apiPackage", config.apiPackage()); + endpointInfo.put("headerSize", "#"); + endpointInfo.put("complexTypePrefix", "../../components/schema/"); + endpointInfo.put("identifierPieces", Collections.unmodifiableList(new ArrayList<>())); + generateXDocs(files, operationJsonPath, CodegenConstants.JSON_PATH_LOCATION_TYPE.OPERATION, CodegenConstants.APIS, endpointInfo, true); + + // paths.some_path.security.security_requirement_0.py + if (operation.security != null) { + String securityJsonPath = operationJsonPath + "/security"; + generateSecurity(files, operation.security, securityJsonPath); + } + + // paths.some_path.post.request_body.py, only written if there is no refModule + if (operation.requestBody != null) { + String requestBodyJsonPath = operationJsonPath + "/requestBody"; + generateRequestBody(files, operation.requestBody, requestBodyJsonPath); + } + + if (operation.servers != null) { + generateServers(files, operation.servers, operationJsonPath + "/servers"); + } + + // paths.some_path.post.parameters.parameter_0.py + if (operation.allParams != null && !operation.allParams.isEmpty()) { + String parametersJsonPath = operationJsonPath + "/parameters"; + generateXs(files, parametersJsonPath, CodegenConstants.JSON_PATH_LOCATION_TYPE.PARAMETERS, CodegenConstants.PARAMETERS, null, true); + Integer i = 0; + for (CodegenParameter cp: operation.allParams) { + String parameterJsonPath = parametersJsonPath + "/" + i.toString(); + generateParameter(files, cp, parameterJsonPath); + i++; + } + } + + if (operation.responses != null && !operation.responses.isEmpty()) { + String responsesJsonPath = operationJsonPath + "/responses"; + generateXs(files, responsesJsonPath, CodegenConstants.JSON_PATH_LOCATION_TYPE.RESPONSES, CodegenConstants.RESPONSES, null, true); + for (Map.Entry responseEntry: operation.responses.entrySet()) { + // paths.some_path.post.responses.response_200.__init__.py (file per response) + // response is a package because responses have Headers which can be refed + // so each inline header should be a module in the response package + String code = responseEntry.getKey(); + CodegenResponse response = responseEntry.getValue(); + String responseJsonPath = responsesJsonPath + "/" + code; + generateResponse(files, response, responseJsonPath); + } + } + + Set endpointTestTemplateFiles = config.pathEndpointTestTemplateFiles(); + if (endpointTestTemplateFiles != null && !endpointTestTemplateFiles.isEmpty()) { + String outputFilename = filenameFromRoot(Arrays.asList("test", "test_paths", "__init__.py")); + generateFile(new HashMap<>(), "__init__test_paths.hbs", outputFilename, files, true, CodegenConstants.API_TESTS); + + for (String templateFile: config.pathEndpointTestTemplateFiles()) { + Map endpointTestMap = new HashMap<>(); + endpointTestMap.put("operation", operation); + endpointTestMap.put("httpMethod", httpMethod); + endpointTestMap.put("path", pathKey); + endpointTestMap.put("packageName", config.packageName()); + outputFilename = filenameFromRoot(Arrays.asList("test", "test_paths", "test_" + pathKey.snakeCase, "test_" + httpMethod.original + ".py")); + generateFile(endpointTestMap, templateFile, outputFilename, files, true, CodegenConstants.API_TESTS); + } + } + } + } + } + + private void generatePaths(List files, TreeMap paths, List servers, List> security) { + if (paths == null || paths.isEmpty()) { + LOGGER.info("Skipping generation of paths because the specification document lacks them."); + return; + } + if (!generateApis) { + LOGGER.info("Skipping generation of paths because generateApis is set to false."); + return; + } + + String pathsJsonPath = "#/paths"; + generateXs(files, pathsJsonPath, CodegenConstants.JSON_PATH_LOCATION_TYPE.PATHS, CodegenConstants.APIS, null, true); + + for (Map.Entry entry: paths.entrySet()) { + CodegenKey pathKey = entry.getKey(); + CodegenPathItem pathItem = entry.getValue(); + String jsonPath = "#/paths/" + ModelUtils.encodeSlashes(pathKey.original); + + generatePathItem(files, pathKey, pathItem, jsonPath, servers, security); + } + } + + private void generateContent(List files, LinkedHashMap content, String jsonPath) { + String contentJsonPath = jsonPath + "/content"; + boolean schemaExists = false; + + // content-type + schema generation + for (Map.Entry contentInfo: content.entrySet()) { + String contentType = contentInfo.getKey().original; + CodegenMediaType codegenMediaType = contentInfo.getValue(); + CodegenSchema schema = codegenMediaType.schema; + if (schema != null) { + schemaExists = true; + String contentTypeJsonPath = contentJsonPath + "/" + ModelUtils.encodeSlashes(contentType); + + // schema + String schemaJsonPath = contentTypeJsonPath + "/schema"; + generateSchema(files, schema, schemaJsonPath); + + Map contentTypeTemplateInfo = config.jsonPathTemplateFiles().get(CodegenConstants.JSON_PATH_LOCATION_TYPE.CONTENT_TYPE); + if (contentTypeTemplateInfo == null || contentTypeTemplateInfo.isEmpty()) { + continue; + } + // content-type + for (Map.Entry contentTypeEntry: contentTypeTemplateInfo.entrySet()) { + String templateFile = contentTypeEntry.getKey(); + String outputFile = contentTypeEntry.getValue(); + String outputFilepath = config.getFilepath(contentTypeJsonPath) + File.separatorChar + outputFile; + try { + File written = processTemplateToFile(new HashMap<>(), templateFile, outputFilepath, true, CodegenConstants.CONTENT); + if (written != null) { + files.add(written); + if (config.isEnablePostProcessFile() && !dryRun) { + config.postProcessFile(written, "content"); + } + } + } catch (IOException e) { + throw new RuntimeException("Could not generate schema for jsonPath '" + jsonPath + "'", e); + } + } + } + } + + Map contentTemplateInfo = config.jsonPathTemplateFiles().get(CodegenConstants.JSON_PATH_LOCATION_TYPE.CONTENT); + if (schemaExists && contentTemplateInfo != null && !contentTemplateInfo.isEmpty()) { + for (Map.Entry contentEntry: contentTemplateInfo.entrySet()) { + String contentTemplateFile = contentEntry.getKey(); + String outputFile = contentEntry.getValue(); + String outputFilepath = config.getFilepath(contentJsonPath) + File.separatorChar + outputFile; + try { + File written = processTemplateToFile(new HashMap<>(), contentTemplateFile, outputFilepath, true, CodegenConstants.CONTENT); + if (written != null) { + files.add(written); + if (config.isEnablePostProcessFile() && !dryRun) { + config.postProcessFile(written, "content"); + } + } + } catch (IOException e) { + throw new RuntimeException("Could not generate schema for jsonPath '" + jsonPath + "'", e); + } + } + } + } + + private void generateResponse(List files, CodegenResponse response, String jsonPath) { + Map templateData = new HashMap<>(); + templateData.put("packageName", config.packageName()); + templateData.put("response", response); + generateXs(files, jsonPath, CodegenConstants.JSON_PATH_LOCATION_TYPE.RESPONSE, CodegenConstants.RESPONSES, templateData, true); + + // headers + if (response.headers != null && !response.headers.isEmpty()) { + String headersJsonPath = jsonPath + "/headers"; + generateXs(files, headersJsonPath, CodegenConstants.JSON_PATH_LOCATION_TYPE.HEADERS, CodegenConstants.HEADERS, null, true); + for (Map.Entry headerInfo: response.headers.entrySet()) { + String headerName = headerInfo.getKey(); + CodegenHeader header = headerInfo.getValue(); + String headerJsonPath = headersJsonPath + "/" + headerName; + generateHeader(files, header, headerJsonPath); + } + } + LinkedHashMap content = response.content; + if (content != null && !content.isEmpty()) { + generateContent(files, content, jsonPath); + } + } + + private TreeMap generateResponses(List files) { + final Map specResponses = this.openAPI.getComponents().getResponses(); + if (specResponses == null) { + LOGGER.warn("Skipping generation of component responses because the specification document lacks them."); + return null; + } + TreeMap responses = new TreeMap<>(); + String responsesJsonPath = "#/components/responses"; + generateXs(files, responsesJsonPath, CodegenConstants.JSON_PATH_LOCATION_TYPE.RESPONSES, CodegenConstants.RESPONSES, null, true); + for (Map.Entry responseEntry: specResponses.entrySet()) { + String componentName = responseEntry.getKey(); + ApiResponse apiResponse = responseEntry.getValue(); + String sourceJsonPath = responsesJsonPath + "/" + componentName; + CodegenResponse response = config.fromResponse(apiResponse, sourceJsonPath); + responses.put(componentName, response); + generateResponse(files, response, sourceJsonPath); + + Map templateData = new HashMap<>(); + templateData.put("packageName", config.packageName()); + templateData.put("complexTypePrefix", "../../components/schema/"); + templateData.put("headerSize", "#"); + templateData.put("identifierPieces", Collections.unmodifiableList(new ArrayList<>())); + templateData.put("response", response); + // TODO make this a property that can be turned off and on + generateXDocs(files, sourceJsonPath, CodegenConstants.JSON_PATH_LOCATION_TYPE.RESPONSE, CodegenConstants.RESPONSE_DOCS, templateData, true); + } + return responses; + } + + private void generateRequestBody(List files, CodegenRequestBody requestBody, String jsonPath) { + Map templateData = new HashMap<>(); + templateData.put("packageName", config.packageName()); + templateData.put("requestBody", requestBody); + generateXs(files, jsonPath, CodegenConstants.JSON_PATH_LOCATION_TYPE.REQUEST_BODY, CodegenConstants.REQUEST_BODIES, templateData, true); + + // schemas + LinkedHashMap content = requestBody.content; + if (content != null && !content.isEmpty()) { + generateContent(files, content, jsonPath); + } + } + + private void generateSecurityScheme(List files, CodegenSecurityScheme securityScheme, String jsonPath) { + Map templateData = new HashMap<>(); + templateData.put("packageName", config.packageName()); + templateData.put("securityScheme", securityScheme); + generateXs(files, jsonPath, CodegenConstants.JSON_PATH_LOCATION_TYPE.SECURITY_SCHEME, CodegenConstants.SECURITY_SCHEMES, templateData, true); + } + + private TreeMap generateSecuritySchemes(List files) { + final Map specSecuritySchemes = this.openAPI.getComponents().getSecuritySchemes(); + if (specSecuritySchemes == null) { + LOGGER.warn("Skipping generation of component requestBodies because the specification document lacks them."); + return null; + } + TreeMap securitySchemes = new TreeMap<>(); + String jsonPath = "#/components/securitySchemes"; + generateXs(files, jsonPath, CodegenConstants.JSON_PATH_LOCATION_TYPE.SECURITY_SCHEMES, CodegenConstants.SECURITY_SCHEMES, null, true); + for (Map.Entry entry: specSecuritySchemes.entrySet()) { + String componentName = entry.getKey(); + SecurityScheme specSecurityScheme = entry.getValue(); + String sourceJsonPath = jsonPath + "/" + componentName; + CodegenSecurityScheme securityScheme = config.fromSecurityScheme(specSecurityScheme, sourceJsonPath); + securitySchemes.put(componentName, securityScheme); + + generateSecurityScheme(files, securityScheme, sourceJsonPath); + + // doc generation + Map templateData = new HashMap<>(); + templateData.put("packageName", config.packageName()); + templateData.put("securityScheme", securityScheme); + templateData.put("headerSize", "#"); + templateData.put("identifierPieces", Collections.unmodifiableList(new ArrayList<>())); + templateData.put("complexTypePrefix", "../../components/schema/"); + // TODO add a flag to turn this off + generateXDocs(files, sourceJsonPath, CodegenConstants.JSON_PATH_LOCATION_TYPE.SECURITY_SCHEME, CodegenConstants.SECURITY_SCHEME_DOCS, templateData, true); + } + // sort them + securitySchemes = new TreeMap<>(securitySchemes); + return securitySchemes; + } + + private TreeMap generateRequestBodies(List files) { + final Map specRequestBodies = this.openAPI.getComponents().getRequestBodies(); + if (specRequestBodies == null) { + LOGGER.warn("Skipping generation of component requestBodies because the specification document lacks them."); + return null; + } + TreeMap requestBodies = new TreeMap<>(); + String requestBodiesJsonPath = "#/components/requestBodies"; + generateXs(files, requestBodiesJsonPath, CodegenConstants.JSON_PATH_LOCATION_TYPE.REQUEST_BODIES, CodegenConstants.REQUEST_BODIES, null, true); + for (Map.Entry entry: specRequestBodies.entrySet()) { + String componentName = entry.getKey(); + RequestBody specRequestBody = entry.getValue(); + String sourceJsonPath = requestBodiesJsonPath + "/" + componentName; + CodegenRequestBody requestBody = config.fromRequestBody(specRequestBody, sourceJsonPath); + requestBodies.put(componentName, requestBody); + + generateRequestBody(files, requestBody, sourceJsonPath); + + // doc generation + Map templateData = new HashMap<>(); + templateData.put("packageName", config.packageName()); + templateData.put("requestBody", requestBody); + templateData.put("headerSize", "#"); + templateData.put("identifierPieces", Collections.unmodifiableList(new ArrayList<>())); + templateData.put("complexTypePrefix", "../../components/schema/"); + // todo add flag to turn this off + generateXDocs(files, sourceJsonPath, CodegenConstants.JSON_PATH_LOCATION_TYPE.REQUEST_BODY, CodegenConstants.REQUEST_BODY_DOCS, templateData, true); + } + // sort them + requestBodies = new TreeMap<>(requestBodies); + return requestBodies; + } + + private void generateParameter(List files, CodegenParameter parameter, String jsonPath) { + Map templateData = new HashMap<>(); + templateData.put("packageName", config.packageName()); + templateData.put("parameter", parameter); + generateXs(files, jsonPath, CodegenConstants.JSON_PATH_LOCATION_TYPE.PARAMETER, CodegenConstants.PARAMETERS, templateData, true); + + // schema + CodegenSchema schema = parameter.schema; + if (schema != null) { + String schemaJsonPath = parameter.getSetSchemaJsonPath(jsonPath); + generateSchema(files, schema, schemaJsonPath); + } + LinkedHashMap content = parameter.content; + if (schema == null && content != null && !content.isEmpty()) { + generateContent(files, content, jsonPath); + } + } + + private TreeMap generateParameters(List files) { + final Map specParameters = this.openAPI.getComponents().getParameters(); + if (specParameters == null || specParameters.isEmpty()) { + LOGGER.warn("Skipping generation of component parameters because the specification document lacks them."); + return null; + } + TreeMap parameters = new TreeMap<>(); + String parametersJsonPath = "#/components/parameters"; + generateXs(files, parametersJsonPath, CodegenConstants.JSON_PATH_LOCATION_TYPE.PARAMETERS, CodegenConstants.PARAMETERS, null, true); + for (Map.Entry entry: specParameters.entrySet()) { + String componentName = entry.getKey(); + Parameter specParameter = entry.getValue(); + String parameterJsonPath = parametersJsonPath + "/" + componentName; + CodegenParameter parameter = config.fromParameter(specParameter, parameterJsonPath); + parameters.put(componentName, parameter); + generateParameter(files, parameter, parameterJsonPath); + + Map templateData = new HashMap<>(); + templateData.put("packageName", config.packageName()); + templateData.put("parameter", parameter); + templateData.put("headerSize", "#"); + templateData.put("identifierPieces", Collections.unmodifiableList(new ArrayList<>())); + templateData.put("complexTypePrefix", "../../components/schema/"); + // todo add flag to turn this off + generateXDocs(files, parameterJsonPath, CodegenConstants.JSON_PATH_LOCATION_TYPE.PARAMETER, CodegenConstants.PARAMETER_DOCS, templateData, true); + } + return parameters; + } + + private void generateHeader(List files, CodegenHeader header, String jsonPath) { + Map headertTemplateData = new HashMap<>(); + headertTemplateData.put("packageName", config.packageName()); + headertTemplateData.put("header", header); + + // header + generateXs(files, jsonPath, CodegenConstants.JSON_PATH_LOCATION_TYPE.HEADER, CodegenConstants.HEADERS, headertTemplateData, true); + + // schema + CodegenSchema schema = header.schema; + if (schema != null) { + String schemaJsonPath = header.getSetSchemaJsonPath(jsonPath); + generateSchema(files, schema, schemaJsonPath); + } + LinkedHashMap content = header.content; + if (schema == null && content != null && !content.isEmpty()) { + generateContent(files, content, jsonPath); + } + } + + private void generateXDocs(List files, String jsonPath, CodegenConstants.JSON_PATH_LOCATION_TYPE type, String skippedByOption, Map templateInfo, boolean shouldGenerate) { + Map templateFileToOutputFile = config.jsonPathDocTemplateFiles().get(type); + if (templateFileToOutputFile == null || templateFileToOutputFile.isEmpty()) { + return; + } + for (Map.Entry entry : templateFileToOutputFile.entrySet()) { + String templateFile = entry.getKey(); + String suffix = entry.getValue(); + String filename = config.getDocsFilepath(jsonPath) + suffix; + + HashMap templateData = new HashMap<>(); + templateData.put("packageName", config.packageName()); + templateData.put("modelPackage", config.modelPackage()); + if (templateInfo != null && !templateInfo.isEmpty()) { + templateData.putAll(templateInfo); + } + try { + File written = processTemplateToFile(templateData, templateFile, filename, shouldGenerate, skippedByOption); + if (written != null) { + files.add(written); + if (config.isEnablePostProcessFile() && !dryRun) { + config.postProcessFile(written, skippedByOption); + } + } + } catch (Exception e) { + throw new RuntimeException("Could not generate file '" + filename + "'", e); + } + } + } + + private void generateXs(List files, String jsonPath, CodegenConstants.JSON_PATH_LOCATION_TYPE type, String skippedByOption, Map templateInfo, boolean shouldGenerate) { + Map templateFileToOutputFile = config.jsonPathTemplateFiles().get(type); + if (templateFileToOutputFile == null || templateFileToOutputFile.isEmpty()) { + return; + } + for (Map.Entry entry : templateFileToOutputFile.entrySet()) { + String templateFile = entry.getKey(); + String suffix = entry.getValue(); + String filename = config.getFilepath(jsonPath) + suffix; + + HashMap templateData = new HashMap<>(); + templateData.put("packageName", config.packageName()); + templateData.put("modelPackage", config.modelPackage()); + if (templateInfo != null && !templateInfo.isEmpty()) { + templateData.putAll(templateInfo); + } + try { + File written = processTemplateToFile(templateData, templateFile, filename, shouldGenerate, skippedByOption); + if (written != null) { + files.add(written); + if (config.isEnablePostProcessFile() && !dryRun) { + config.postProcessFile(written, skippedByOption); + } + } + } catch (Exception e) { + throw new RuntimeException("Could not generate file '" + filename + "'", e); + } + } + } + + private TreeMap generateHeaders(List files) { + final Map specHeaders = this.openAPI.getComponents().getHeaders(); + if (specHeaders == null || specHeaders.isEmpty()) { + LOGGER.warn("Skipping generation of component headers because the specification document lacks them."); + return null; + } + TreeMap headers = new TreeMap<>(); + String headersJsonPath = "#/components/headers"; + generateXs(files, headersJsonPath, CodegenConstants.JSON_PATH_LOCATION_TYPE.HEADERS, CodegenConstants.HEADERS, null, true); + for (Map.Entry entry: specHeaders.entrySet()) { + String componentName = entry.getKey(); + Header specHeader = entry.getValue(); + String sourceJsonPath = headersJsonPath + "/" + componentName; + CodegenHeader header = config.fromHeader(specHeader, sourceJsonPath); + headers.put(componentName, header); + + generateHeader(files, header, sourceJsonPath); + + // documentation + Map templateData = new HashMap<>(); + templateData.put("packageName", config.packageName()); + templateData.put("header", header); + templateData.put("headerSize", "#"); + templateData.put("complexTypePrefix", "../../components/schema/"); + templateData.put("docRoot", "../../"); + templateData.put("identifierPieces", Collections.unmodifiableList(new ArrayList<>())); + // TODO add flag to turn this off + generateXDocs(files, sourceJsonPath, CodegenConstants.JSON_PATH_LOCATION_TYPE.HEADER, CodegenConstants.HEADER_DOCS, templateData, true); + } + // sort them + headers = new TreeMap<>(headers); + return headers; + } + + protected TreeMap generateSchemas(List files) { + if (!generateModels) { + LOGGER.info("Skipping generation of component schemas."); + return null; + } + + final Map specSchemas = ModelUtils.getSchemas(this.openAPI); + if (specSchemas == null || specSchemas.isEmpty()) { + LOGGER.warn("Skipping generation of component schemas because the specification document lacks them."); + return null; + } + + TreeMap schemas = new TreeMap<>(); + String modelNames = GlobalSettings.getProperty("models"); + Set modelsToGenerate = null; + if (modelNames != null && !modelNames.isEmpty()) { + modelsToGenerate = new HashSet<>(Arrays.asList(modelNames.split(","))); + } + + // limit to only the specified models + Set componentNames = specSchemas.keySet(); + if (modelsToGenerate != null && !modelsToGenerate.isEmpty()) { + Set updatedKeys = new HashSet<>(); + for (String componentName: componentNames) { + if (modelsToGenerate.contains(componentName)) { + updatedKeys.add(componentName); + } + } + componentNames = updatedKeys; + } + + // create model instances + for (String componentName : componentNames) { + try { + Schema specSchema = specSchemas.get(componentName); + + String sourceJsonPath = "#/components/schemas/" + componentName; + CodegenSchema codegenSchema = config.fromSchema(specSchema, sourceJsonPath, sourceJsonPath); + schemas.put(componentName, codegenSchema); + + } catch (Exception e) { + throw new RuntimeException("Could not process model '" + componentName + "'" + ".Please make sure that your schema is correct!", e); + } + } + + String schemasJsonPath = "#/components/schemas"; + generateXs(files, schemasJsonPath, CodegenConstants.JSON_PATH_LOCATION_TYPE.SCHEMAS, CodegenConstants.MODELS, null, true); + // generate files based on processed models + for (Map.Entry entry: schemas.entrySet()) { + String componentName = entry.getKey(); + CodegenSchema schema = entry.getValue(); + try { + // to generate model files + String jsonPath = schemasJsonPath + "/" + componentName; + generateSchema(files, schema, jsonPath); + + // to generate model test files + Map schemaData = new HashMap<>(); + schemaData.put("packageName", config.packageName()); + schemaData.put("schema", schema); + schemaData.putAll(config.additionalProperties()); + schemaData.put("complexTypePrefix", ""); + if (generateModelTests) { + generateSchemaTests(files, schemaData, componentName); + } + + // to generate model documentation files + if (generateModelDocumentation) { + schemaData.put("identifierPieces", Collections.unmodifiableList(new ArrayList<>())); + generateSchemaDocumentation(files, schemaData, jsonPath); + } + + } catch (Exception e) { + throw new RuntimeException("Could not generate model '" + componentName + "'", e); + } + } + if (GlobalSettings.getProperty("debugModels") != null) { + LOGGER.info("############ Model info ############"); + Json.prettyPrint(schemas); + } + // sort them + schemas = new TreeMap<>(schemas); + return schemas; + } + + @SuppressWarnings("unchecked") + void generateApis(List files, TreeMap paths) { + if (!generateApis) { + LOGGER.info("Skipping generation of APIs."); + return; + } + // accumulate tag to operations + Set allowListedTags = null; + String apiNames = GlobalSettings.getProperty("apis"); + if (apiNames != null && !apiNames.isEmpty()) { + allowListedTags = new HashSet<>(Arrays.asList(apiNames.split(","))); + } + String jsonPath = "#/apis"; + Map apiPathsTemplates = config.jsonPathTemplateFiles().get(CodegenConstants.JSON_PATH_LOCATION_TYPE.API_PATHS); + if (apiPathsTemplates != null) { + for (Map.Entry apiPathEntry: apiPathsTemplates.entrySet()) { + String templateFile = apiPathEntry.getKey(); + String apiFileName = apiPathEntry.getValue(); + String thisJsonPath = jsonPath + "/paths"; + Map apiData = new HashMap<>(); + String packageName = config.packageName(); + apiData.put("packageName", packageName); + String outputFile = config.getFilepath(thisJsonPath) + apiFileName; + generateFile(apiData, templateFile, outputFile, files, true, CodegenConstants.APIS); + } + } + + HashMap>> tagToPathToOperations = new HashMap<>(); + HashMap>> tagToOperationIdToPathToOperation = new HashMap<>(); + Map apiPathTemplates = config.jsonPathTemplateFiles().get(CodegenConstants.JSON_PATH_LOCATION_TYPE.API_PATH); + for(Map.Entry entry: paths.entrySet()) { + CodegenKey path = entry.getKey(); + CodegenPathItem pathItem = entry.getValue(); + + if (apiPathTemplates != null) { + for (Map.Entry apiPathEntry: apiPathTemplates.entrySet()) { + String templateFile = apiPathEntry.getKey(); + String suffix = apiPathEntry.getValue(); + Map apiData = new HashMap<>(); + String packageName = config.packageName(); + apiData.put("packageName", packageName); + apiData.put("path", path); + apiData.put("pathItem", pathItem); + String thisJsonPath = jsonPath + "/paths/" + ModelUtils.encodeSlashes(path.original); + String outputFile = config.getFilepath(thisJsonPath) + suffix; + generateFile(apiData, templateFile, outputFile, files, true, CodegenConstants.APIS); + } + } + + // store operations by tag + path + for(CodegenOperation op: pathItem.operations.values()) { + for(CodegenTag tag: op.tags.values()) { + if (allowListedTags != null && !allowListedTags.contains(tag.name)) { + continue; + } + if (!tagToPathToOperations.containsKey(tag)) { + tagToPathToOperations.put(tag, new HashMap<>()); + tagToOperationIdToPathToOperation.put(tag, new TreeMap<>()); + } + HashMap> pathToOperations = tagToPathToOperations.get(tag); + if (!pathToOperations.containsKey(path)) { + pathToOperations.put(path, new ArrayList<>()); + } + pathToOperations.get(path).add(op); + TreeMap> operationIdToPathToOperation = tagToOperationIdToPathToOperation.get(tag); + if (!operationIdToPathToOperation.containsKey(op.operationId)) { + HashMap pathToOperation = new HashMap<>(); + pathToOperation.put(path, op); + operationIdToPathToOperation.put(op.operationId, pathToOperation); + } + } + } + } + + // files in the apiPackage root folder + Map apiRootTemplates = config.jsonPathTemplateFiles().get(CodegenConstants.JSON_PATH_LOCATION_TYPE.API_ROOT_FOLDER); + if (apiRootTemplates != null) { + for (Map.Entry entry: apiRootTemplates.entrySet()) { + String templateFile = entry.getKey(); + String fileName = entry.getValue(); + Map apiData = new HashMap<>(); + String packageName = config.packageName(); + apiData.put("packageName", packageName); + apiData.put("apiClassname", "Api"); + apiData.put("tagToPathToOperations", tagToPathToOperations); + apiData.put("paths", paths); + String outputFile = config.getFilepath(jsonPath) + fileName; + + generateFile(apiData, templateFile, outputFile, files, true, CodegenConstants.APIS); + } + } + + Map apiTagsTemplates = config.jsonPathTemplateFiles().get(CodegenConstants.JSON_PATH_LOCATION_TYPE.API_TAGS); + if (apiTagsTemplates != null) { + for (Map.Entry apiPathEntry: apiTagsTemplates.entrySet()) { + String templateFile = apiPathEntry.getKey(); + String fileName = apiPathEntry.getValue(); + Map apiData = new HashMap<>(); + String packageName = config.packageName(); + apiData.put("packageName", packageName); + String thisJsonPath = jsonPath + "/tags"; + String outputFile = config.getFilepath(thisJsonPath) + fileName; + generateFile(apiData, templateFile, outputFile, files, true, CodegenConstants.APIS); + } + } + + Map apiTagTemplates = config.jsonPathTemplateFiles().get(CodegenConstants.JSON_PATH_LOCATION_TYPE.API_TAG); + Map apiDocTagTemplates = config.jsonPathDocTemplateFiles().get(CodegenConstants.JSON_PATH_LOCATION_TYPE.API_TAG); + for(Map.Entry>> entry: tagToPathToOperations.entrySet()) { + CodegenTag tag = entry.getKey(); + HashMap> pathToOperations = entry.getValue(); + + Map apiData = new HashMap<>(); + String packageName = config.packageName(); + apiData.put("packageName", packageName); + apiData.put("tag", tag); + apiData.put("pathToOperations", pathToOperations); + apiData.put("apiPackage", config.apiPackage()); + + class OperationIdComparator implements Comparator{ + @Override + public int compare(CodegenKey e1, CodegenKey e2) { + return e1.snakeCase.compareTo(e2.snakeCase); + } + } + + TreeMap> operationIdToPathToOperation = new TreeMap<>(new OperationIdComparator()); + operationIdToPathToOperation.putAll(tagToOperationIdToPathToOperation.get(tag)); + apiData.put("operationIdToPathToOperation", operationIdToPathToOperation); + + if (apiTagTemplates != null) { + for (Map.Entry apiPathEntry: apiTagTemplates.entrySet()) { + String templateFile = apiPathEntry.getKey(); + String fileName = apiPathEntry.getValue(); + String thisJsonPath = jsonPath + "/tags/" + tag.name; + String outputFile = config.getFilepath(thisJsonPath) + fileName; + generateFile(apiData, templateFile, outputFile, files, true, CodegenConstants.APIS); + } + } + // api docs + if (generateApiDocumentation && apiDocTagTemplates != null) { + for (Map.Entry apiPathEntry: apiDocTagTemplates.entrySet()) { + String templateFile = apiPathEntry.getKey(); + String fileName = apiPathEntry.getValue(); + String thisJsonPath = jsonPath + "/tags/" + tag.name; + String outputFile = config.getDocsFilepath(thisJsonPath) + fileName; + generateFile(apiData, templateFile, outputFile, files, true, CodegenConstants.APIS); + } + } + } + } + + private void generateSupportingFiles(List files, Map bundle) { + if (!generateSupportingFiles) { + // TODO: process these anyway and report via dryRun? + LOGGER.info("Skipping generation of supporting files."); + return; + } + Set supportingFilesToGenerate = null; + String supportingFiles = GlobalSettings.getProperty(CodegenConstants.SUPPORTING_FILES); + if (supportingFiles != null && !supportingFiles.isEmpty()) { + supportingFilesToGenerate = new HashSet<>(Arrays.asList(supportingFiles.split(","))); + } + + for (SupportingFile support : config.supportingFiles()) { + try { + String outputFolder = config.outputFolder(); + if (StringUtils.isNotEmpty(support.getFolder())) { + outputFolder += File.separator + support.getFolder(); + } + File of = new File(outputFolder); + if (!of.isDirectory()) { + if (!dryRun && !of.mkdirs()) { + OnceLogger.once(LOGGER).debug("Output directory {} not created. It {}.", outputFolder, of.exists() ? "already exists." : "may not have appropriate permissions."); + } + } + String outputFilename = new File(support.getDestinationFilename()).isAbsolute() // split + ? support.getDestinationFilename() + : outputFolder + File.separator + support.getDestinationFilename().replace('/', File.separatorChar); + + boolean shouldGenerate = true; + if (supportingFilesToGenerate != null && !supportingFilesToGenerate.isEmpty()) { + shouldGenerate = supportingFilesToGenerate.contains(support.getDestinationFilename()); + } + + File written = processTemplateToFile(bundle, support.getTemplateFile(), outputFilename, shouldGenerate, CodegenConstants.SUPPORTING_FILES); + if (written != null) { + files.add(written); + if (config.isEnablePostProcessFile() && !dryRun) { + config.postProcessFile(written, "supporting-file"); + } + } + } catch (Exception e) { + throw new RuntimeException("Could not generate supporting file '" + support + "'", e); + } + } + + // Consider .openapi-generator-ignore a supporting file + // Output .openapi-generator-ignore if it doesn't exist and wasn't explicitly created by a generator + final String openapiGeneratorIgnore = ".openapi-generator-ignore"; + String ignoreFileNameTarget = config.outputFolder() + File.separator + openapiGeneratorIgnore; + File ignoreFile = new File(ignoreFileNameTarget); + if (generateMetadata) { + try { + boolean shouldGenerate = !ignoreFile.exists(); + if (shouldGenerate && supportingFilesToGenerate != null && !supportingFilesToGenerate.isEmpty()) { + shouldGenerate = supportingFilesToGenerate.contains(openapiGeneratorIgnore); + } + File written = processTemplateToFile(bundle, openapiGeneratorIgnore, ignoreFileNameTarget, shouldGenerate, CodegenConstants.SUPPORTING_FILES); + if (written != null) { + files.add(written); + if (config.isEnablePostProcessFile() && !dryRun) { + config.postProcessFile(written, "openapi-generator-ignore"); + } + } + } catch (Exception e) { + throw new RuntimeException("Could not generate supporting file '" + ignoreFileNameTarget + "'", e); + } + } else { + this.templateProcessor.skip(ignoreFile.toPath(), "Skipped by generateMetadata option supplied by user."); + } + + generateVersionMetadata(files); + } + + Map buildSupportFileBundle( + TreeMap schemas, + TreeMap requestBodies, + TreeMap responses, + TreeMap headers, + TreeMap parameters, + TreeMap securitySchemes, + List servers, + TreeMap paths, + List> security) { + + Map bundle = new HashMap<>(config.additionalProperties()); + bundle.put("apiPackage", config.apiPackage()); + + URL url = URLPathUtils.getServerURL(openAPI, config.serverVariableOverrides()); + boolean hasServers = false; + if (servers != null) { + hasServers = true; + } else if (paths != null) { + for (CodegenPathItem pathItem: paths.values()) { + if (pathItem.servers != null) { + hasServers = true; + break; + } + if (pathItem.operations != null) { + for (CodegenOperation operation: pathItem.operations.values()) { + if (operation.servers != null) { + hasServers = true; + break; + } + } + if (hasServers) { + break; + } + } + } + } + + bundle.put("openAPI", openAPI); + bundle.put("scheme", URLPathUtils.getScheme(url, config)); + bundle.put("contextPath", contextPath); + bundle.put("requestBodies", requestBodies); + bundle.put("responses", responses); + bundle.put("headers", headers); + bundle.put("parameters", parameters); + bundle.put("schemas", schemas); + bundle.put("securitySchemes", securitySchemes); + bundle.put("servers", servers); + bundle.put("hasServers", hasServers); // also true if there are no root servers but there are pathItem/operation servers + bundle.put("paths", paths); + bundle.put("security", security); + bundle.put("apiFolder", config.apiPackage().replace('.', File.separatorChar)); + bundle.put("modelPackage", config.modelPackage()); + bundle.put("library", config.getLibrary()); + if (securitySchemes == null) { + bundle.put("hasHttpSignatureSecurityScheme", false); + } else { + for (CodegenSecurityScheme ss: securitySchemes.values()) { + if (ss.type.equals("http") && ss.scheme.equals("signature")) { + bundle.put("hasHttpSignatureSecurityScheme", true); + } + } + } + bundle.put("generatorLanguageVersion", config.generatorLanguageVersion()); + // todo verify support and operation bundles have access to the common variables + + if (openAPI.getExternalDocs() != null) { + bundle.put("externalDocs", openAPI.getExternalDocs()); + } + + config.postProcessSupportingFileData(bundle); + + if (GlobalSettings.getProperty("debugSupportingFiles") != null) { + LOGGER.info("############ Supporting file info ############"); + Json.prettyPrint(bundle); + } + return bundle; + } + + private void generateServers(List files, List servers, String jsonPath) { + if (servers == null && servers.isEmpty()) { + return; + } + generateXs(files, jsonPath, CodegenConstants.JSON_PATH_LOCATION_TYPE.SERVERS, CodegenConstants.SERVERS, null, true); + + int i = 0; + for (CodegenServer server: servers) { + Map templateData = new HashMap<>(); + templateData.put("packageName", config.packageName()); + templateData.put("server", server); + String serverJsonPath = jsonPath + "/" + i; + generateXs(files, serverJsonPath, CodegenConstants.JSON_PATH_LOCATION_TYPE.SERVER, CodegenConstants.SERVERS, templateData, true); + + // doc generation + if (server.rootServer) { + templateData.put("headerSize", "#"); + templateData.put("identifierPieces", Collections.unmodifiableList(new ArrayList<>())); + generateXDocs(files, serverJsonPath, CodegenConstants.JSON_PATH_LOCATION_TYPE.SERVER, CodegenConstants.SERVERS, templateData, true); + } + i++; + } + } + + private TreeMap getTags() { + List specTags = openAPI.getTags(); + if (specTags == null) { + return null; + } + + TreeMap tags = new TreeMap<>(); + for(Tag specTag: specTags) { + String name = specTag.getName(); + CodegenTag tag = config.fromTag(name, specTag.getDescription()); + tags.put(name, tag); + } + return tags; + } + + private void generateSecurity(List files, List> security, String jsonPath) { + if (security == null || security.isEmpty()) { + return; + } + if (!generateApis) { + LOGGER.info("Skipping generation of security because generateApis is set to false."); + return; + } + generateXs(files, jsonPath, CodegenConstants.JSON_PATH_LOCATION_TYPE.SECURITIES, CodegenConstants.SECURITY, null, true); + + int i = 0; + for (HashMap securityRequirementObject: security) { + Map templateData = new HashMap<>(); + templateData.put("packageName", config.packageName()); + templateData.put("securityRequirementObject", securityRequirementObject); + String serverJsonPath = jsonPath + "/" + i; + generateXs(files, serverJsonPath, CodegenConstants.JSON_PATH_LOCATION_TYPE.SECURITY, CodegenConstants.SECURITY, templateData, true); + i++; + } + } + + @Override + public List generate() { + if (openAPI == null) { + throw new RuntimeException("Issues with the OpenAPI input. Possible causes: invalid/missing spec, malformed JSON/YAML files, etc."); + } + + if (config == null) { + throw new RuntimeException("missing config!"); + } + + if (config.getGeneratorMetadata() == null) { + LOGGER.warn("Generator '{}' is missing generator metadata!", config.getName()); + } else { + GeneratorMetadata generatorMetadata = config.getGeneratorMetadata(); + if (StringUtils.isNotEmpty(generatorMetadata.getGenerationMessage())) { + LOGGER.info(generatorMetadata.getGenerationMessage()); + } + + Stability stability = generatorMetadata.getStability(); + String stabilityMessage = String.format(Locale.ROOT, "Generator '%s' is considered %s.", config.getName(), stability.value()); + if (stability == Stability.DEPRECATED) { + LOGGER.warn(stabilityMessage); + } else { + LOGGER.info(stabilityMessage); + } + } + + configureGeneratorProperties(); + configureOpenAPIInfo(); + + config.processOpenAPI(openAPI); + + processUserDefinedTemplates(); + + List files = new ArrayList<>(); + // tags + TreeMap tags = getTags(); + // components.schemas / models + TreeMap schemas = generateSchemas(files); + // components.requestBodies + TreeMap requestBodies = generateRequestBodies(files); + // components.headers, must be before generateResponses, because those can $ref these + TreeMap headers = generateHeaders(files); + // components.responses + TreeMap responses = generateResponses(files); + // components.parameters, must be before processPaths, because those can $ref these + TreeMap parameters = generateParameters(files); + // components.securitySchemes + TreeMap securitySchemes = generateSecuritySchemes(files); + // security + List> security = config.fromSecurity(openAPI.getSecurity(), "#/security"); + generateSecurity(files, security, "#/security"); + + boolean schemasExist = (schemas != null && !schemas.isEmpty()); + boolean requestBodiesExist = (requestBodies != null && !requestBodies.isEmpty()); + boolean headersExist = (headers != null && !headers.isEmpty()); + boolean responsesExist = (responses != null && !responses.isEmpty()); + boolean parametersExist = (parameters != null && !parameters.isEmpty()); + if (schemasExist || requestBodiesExist || headersExist || responsesExist || parametersExist) { + generateXs(files, "#/components", CodegenConstants.JSON_PATH_LOCATION_TYPE.COMPONENTS, CodegenConstants.COMPONENTS, null, true); + } + + // servers + String serversJsonPath = "#/servers"; + List servers = config.fromServers(openAPI.getServers(), serversJsonPath); + // paths + TreeMap paths = config.fromPaths(openAPI.getPaths()); + generatePaths(files, paths, servers, security); + generateServers(files, servers, serversJsonPath); + // apis + generateApis(files, paths); + + // supporting files + Map bundle = buildSupportFileBundle(schemas, requestBodies, responses, headers, parameters, securitySchemes, servers, paths, security); + generateSupportingFiles(files, bundle); + + if (dryRun) { + boolean verbose = Boolean.parseBoolean(GlobalSettings.getProperty("verbose")); + StringBuilder sb = new StringBuilder(); + + sb.append(System.lineSeparator()).append(System.lineSeparator()); + sb.append("Dry Run Results:"); + sb.append(System.lineSeparator()).append(System.lineSeparator()); + + Map dryRunStatusMap = ((DryRunTemplateManager) this.templateProcessor).getDryRunStatusMap(); + + dryRunStatusMap.entrySet().stream().sorted(Map.Entry.comparingByKey()).forEach(entry -> { + DryRunStatus status = entry.getValue(); + try { + status.appendTo(sb); + sb.append(System.lineSeparator()); + if (verbose) { + sb.append(" ") + .append(StringUtils.rightPad(status.getState().getDescription(), 20, ".")) + .append(" ").append(status.getReason()) + .append(System.lineSeparator()); + } + } catch (IOException e) { + LOGGER.debug("Unable to document dry run status for {}.", entry.getKey()); + } + }); + + sb.append(System.lineSeparator()).append(System.lineSeparator()); + sb.append("States:"); + sb.append(System.lineSeparator()).append(System.lineSeparator()); + + for (DryRunStatus.State state : DryRunStatus.State.values()) { + sb.append(" - ").append(state.getShortDisplay()).append(" ").append(state.getDescription()).append(System.lineSeparator()); + } + + sb.append(System.lineSeparator()); + + LOGGER.error(sb.toString()); + } else { + // This exists here rather than in the method which generates supporting files to avoid accidentally adding files after this metadata. + if (generateSupportingFiles) { + generateFilesMetadata(files); + } + } + + // post-process + config.postProcess(); + + // reset GlobalSettings, so that the running thread can be reused for another generator-run + GlobalSettings.reset(); + + return files; + } + + private void processUserDefinedTemplates() { + // TODO: initial behavior is "merge" user defined with built-in templates. consider offering user a "replace" option. + if (userDefinedTemplates != null && !userDefinedTemplates.isEmpty()) { + Map supportingFilesMap = config.supportingFiles().stream() + .collect(Collectors.toMap(TemplateDefinition::getTemplateFile, Function.identity(), (oldValue, newValue) -> oldValue)); + + // TemplateFileType.SupportingFiles + userDefinedTemplates.stream() + .filter(i -> i.getTemplateType().equals(TemplateFileType.SupportingFiles)) + .forEach(userDefinedTemplate -> { + SupportingFile newFile = new SupportingFile( + userDefinedTemplate.getTemplateFile(), + userDefinedTemplate.getFolder(), + userDefinedTemplate.getDestinationFilename() + ); + if (supportingFilesMap.containsKey(userDefinedTemplate.getTemplateFile())) { + SupportingFile f = supportingFilesMap.get(userDefinedTemplate.getTemplateFile()); + config.supportingFiles().remove(f); + + if (!f.isCanOverwrite()) { + newFile.doNotOverwrite(); + } + } + config.supportingFiles().add(newFile); + }); + + // Others, excluding TemplateFileType.SupportingFiles + userDefinedTemplates.stream() + .filter(i -> !i.getTemplateType().equals(TemplateFileType.SupportingFiles)) + .forEach(userDefinedTemplate -> { + // determine file extension… + // if template is in format api.ts.mustache, we'll extract .ts + // if user has provided an example destination filename, we'll use that extension + String templateFile = userDefinedTemplate.getTemplateFile(); + int lastSeparator = templateFile.lastIndexOf('.'); + String templateExt = FilenameUtils.getExtension(templateFile.substring(0, lastSeparator)); + if (StringUtils.isBlank(templateExt)) { + // hack: destination filename in this scenario might be a suffix like Impl.java + templateExt = userDefinedTemplate.getDestinationFilename(); + } else { + templateExt = StringUtils.prependIfMissing(templateExt, "."); + } + + switch (userDefinedTemplate.getTemplateType()) { + case API: + Map apiTemplateFiles = config.jsonPathTemplateFiles().getOrDefault(CodegenConstants.JSON_PATH_LOCATION_TYPE.API_ROOT_FOLDER, new HashMap<>()); + apiTemplateFiles.put(templateFile, templateExt); + break; + case Model: + Map schemaTemplateToSuffix = config.jsonPathTemplateFiles().getOrDefault(CodegenConstants.JSON_PATH_LOCATION_TYPE.SCHEMA, new HashMap<>()); + schemaTemplateToSuffix.put(templateFile, templateExt); + break; + case APIDocs: + Map apiDocTemplateToSuffix = config.jsonPathDocTemplateFiles().getOrDefault(CodegenConstants.JSON_PATH_LOCATION_TYPE.API_ROOT_FOLDER, new HashMap<>()); + apiDocTemplateToSuffix.put(templateFile, templateExt); + break; + case ModelDocs: + Map schemaDocTemplateToSuffix = config.jsonPathDocTemplateFiles().getOrDefault(CodegenConstants.JSON_PATH_LOCATION_TYPE.SCHEMA, new HashMap<>()); + schemaDocTemplateToSuffix.put(templateFile, templateExt); + break; + case APITests: + config.apiTestTemplateFiles().put(templateFile, templateExt); + break; + case ModelTests: + config.modelTestTemplateFiles().put(templateFile, templateExt); + break; + case SupportingFiles: + // excluded by filter + break; + } + }); + } + } + + protected File processTemplateToFile(Map templateData, String templateName, String outputFilename, boolean shouldGenerate, String skippedByOption) throws IOException { + return processTemplateToFile(templateData, templateName, outputFilename, shouldGenerate, skippedByOption, this.config.getOutputDir()); + } + + private File processTemplateToFile(Map templateData, String templateName, String outputFilename, boolean shouldGenerate, String skippedByOption, String intendedOutputDir) throws IOException { + String adjustedOutputFilename = outputFilename.replaceAll("//", "/").replace('/', File.separatorChar); + File target = new File(adjustedOutputFilename); + if (ignoreProcessor.allowsFile(target)) { + if (shouldGenerate) { + Path outDir = java.nio.file.Paths.get(intendedOutputDir).toAbsolutePath(); + Path absoluteTarget = target.toPath().toAbsolutePath(); + if (!absoluteTarget.startsWith(outDir)) { + throw new RuntimeException(String.format(Locale.ROOT, "Target files must be generated within the output directory; absoluteTarget=%s outDir=%s", absoluteTarget, outDir)); + } + return this.templateProcessor.write(templateData, templateName, target); + } else { + this.templateProcessor.skip(target.toPath(), String.format(Locale.ROOT, "Skipped by %s options supplied by user.", skippedByOption)); + return null; + } + } else { + this.templateProcessor.ignore(target.toPath(), "Ignored by rule in ignore file."); + return null; + } + } + + private static String generateParameterId(Parameter parameter) { + return parameter.getName() + ":" + parameter.getIn(); + } + + /** + * Generates a file at .openapi-generator/VERSION to track the version of user's latest run. + * + * @param files The list tracking generated files + */ + private void generateVersionMetadata(List files) { + String versionMetadata = config.outputFolder() + File.separator + METADATA_DIR + File.separator + config.getVersionMetadataFilename(); + if (generateMetadata) { + File versionMetadataFile = new File(versionMetadata); + try { + File written = this.templateProcessor.writeToFile(versionMetadata, ImplementationVersion.read().getBytes(StandardCharsets.UTF_8)); + if (written != null) { + files.add(versionMetadataFile); + if (config.isEnablePostProcessFile() && !dryRun) { + config.postProcessFile(written, "openapi-generator-version"); + } + } + } catch (IOException e) { + throw new RuntimeException("Could not generate supporting file '" + versionMetadata + "'", e); + } + } else { + Path metadata = java.nio.file.Paths.get(versionMetadata); + this.templateProcessor.skip(metadata, "Skipped by generateMetadata option supplied by user."); + } + } + + private Path absPath(File input) { + // intentionally creates a new absolute path instance, disconnected from underlying FileSystem provider of File + return java.nio.file.Paths.get(input.getAbsolutePath()); + } + + /** + * Generates a file at .openapi-generator/FILES to track the files created by the user's latest run. + * This is ideal for CI and regeneration of code without stale/unused files from older generations. + * + * @param files The list tracking generated files + */ + private void generateFilesMetadata(List files) { + if (generateMetadata) { + try { + StringBuilder sb = new StringBuilder(); + Path outDir = absPath(new File(this.config.getOutputDir())); + + List filesToSort = new ArrayList<>(); + + // Avoid side-effecting sort in this path when generateMetadata=true + files.forEach(f -> { + // We have seen NPE on CI for getPath() returning null, so guard against this (to be fixed in 5.0 template management refactor) + //noinspection ConstantConditions + if (f != null && f.getPath() != null) { + filesToSort.add(outDir.relativize(absPath(f)).normalize().toFile()); + } + }); + + // NOTE: Don't use File.separator here as we write linux-style paths to FILES, and File.separator will + // result in incorrect match on Windows machines. + String relativeMeta = METADATA_DIR + "/VERSION"; + filesToSort.sort(PathFileComparator.PATH_COMPARATOR); + filesToSort.forEach(f -> { + // some Java implementations don't honor .relativize documentation fully. + // When outDir is /a/b and the input is /a/b/c/d, the result should be c/d. + // Some implementations make the output ./c/d which seems to mix the logic + // as documented for symlinks. So we need to trim any / or ./ from the start, + // as nobody should be generating into system root and our expectation is no ./ + String relativePath = removeStart(removeStart(f.toString(), "." + File.separator), File.separator); + if (File.separator.equals("\\")) { + // ensure that windows outputs same FILES format + relativePath = relativePath.replace(File.separator, "/"); + } + if (!relativePath.equals(relativeMeta)) { + sb.append(relativePath).append(System.lineSeparator()); + } + }); + + String targetFile = config.outputFolder() + File.separator + METADATA_DIR + File.separator + config.getFilesMetadataFilename(); + + File filesFile = this.templateProcessor.writeToFile(targetFile, sb.toString().getBytes(StandardCharsets.UTF_8)); + if (filesFile != null) { + files.add(filesFile); + } + } catch (Exception e) { + LOGGER.warn("Failed to write FILES metadata to track generated files."); + } + } + } + + private String removeTrailingSlash(String value) { + return StringUtils.removeEnd(value, "/"); + } + +} diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/DryRunStatus.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/DryRunStatus.java similarity index 99% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/DryRunStatus.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/DryRunStatus.java index bd755e3a83d..df2add3b6cd 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/DryRunStatus.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/DryRunStatus.java @@ -1,4 +1,4 @@ -package org.openapitools.codegen; +package org.openapijsonschematools.codegen; import java.io.IOException; import java.nio.file.Path; diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/DryRunTemplateManager.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/DryRunTemplateManager.java similarity index 94% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/DryRunTemplateManager.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/DryRunTemplateManager.java index aa8f8ef56ec..820c5df06ad 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/DryRunTemplateManager.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/DryRunTemplateManager.java @@ -1,7 +1,7 @@ -package org.openapitools.codegen; +package org.openapijsonschematools.codegen; -import org.openapitools.codegen.api.TemplateProcessor; -import org.openapitools.codegen.templating.TemplateManagerOptions; +import org.openapijsonschematools.codegen.templating.TemplateManagerOptions; +import org.openapijsonschematools.codegen.api.TemplateProcessor; import java.io.File; import java.io.IOException; diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/Generator.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/Generator.java new file mode 100644 index 00000000000..47251601f01 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/Generator.java @@ -0,0 +1,29 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * Copyright 2018 SmartBear Software + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapijsonschematools.codegen; + +import java.io.File; +import java.util.List; + +public interface Generator { + Generator opts(ClientOptInput opts); + + String requestBodyFileFolder(); + + List generate(); +} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/GeneratorLanguage.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/GeneratorLanguage.java similarity index 97% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/GeneratorLanguage.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/GeneratorLanguage.java index b7248350253..533f222dc08 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/GeneratorLanguage.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/GeneratorLanguage.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.openapitools.codegen; +package org.openapijsonschematools.codegen; public enum GeneratorLanguage { /* diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/GeneratorNotFoundException.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/GeneratorNotFoundException.java similarity index 98% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/GeneratorNotFoundException.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/GeneratorNotFoundException.java index 6554adf8d0a..839af8d37ab 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/GeneratorNotFoundException.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/GeneratorNotFoundException.java @@ -1,4 +1,4 @@ -package org.openapitools.codegen; +package org.openapijsonschematools.codegen; /** * Typed exception exposing issues with loading generators (e.g. by name). diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/SpecValidationException.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/SpecValidationException.java similarity index 99% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/SpecValidationException.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/SpecValidationException.java index f8b7371c10c..7282122712e 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/SpecValidationException.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/SpecValidationException.java @@ -1,4 +1,4 @@ -package org.openapitools.codegen; +package org.openapijsonschematools.codegen; import java.util.Optional; import java.util.Set; diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/SupportingFile.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/SupportingFile.java similarity index 94% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/SupportingFile.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/SupportingFile.java index 2d72fa2f216..d861982962c 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/SupportingFile.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/SupportingFile.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.openapitools.codegen; +package org.openapijsonschematools.codegen; -import org.openapitools.codegen.api.TemplateDefinition; -import org.openapitools.codegen.api.TemplateFileType; +import org.openapijsonschematools.codegen.api.TemplateDefinition; +import org.openapijsonschematools.codegen.api.TemplateFileType; import java.util.Objects; import java.util.StringJoiner; diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/TemplateManager.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/TemplateManager.java similarity index 95% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/TemplateManager.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/TemplateManager.java index 691096b39f6..780b12627e0 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/TemplateManager.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/TemplateManager.java @@ -1,13 +1,13 @@ -package org.openapitools.codegen; +package org.openapijsonschematools.codegen; import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.StringUtils; -import org.openapitools.codegen.api.TemplatePathLocator; -import org.openapitools.codegen.api.TemplateProcessor; -import org.openapitools.codegen.api.TemplatingEngineAdapter; -import org.openapitools.codegen.api.TemplatingExecutor; -import org.openapitools.codegen.templating.TemplateManagerOptions; -import org.openapitools.codegen.templating.TemplateNotFoundException; +import org.openapijsonschematools.codegen.templating.TemplateManagerOptions; +import org.openapijsonschematools.codegen.templating.TemplateNotFoundException; +import org.openapijsonschematools.codegen.api.TemplatePathLocator; +import org.openapijsonschematools.codegen.api.TemplateProcessor; +import org.openapijsonschematools.codegen.api.TemplatingEngineAdapter; +import org.openapijsonschematools.codegen.api.TemplatingExecutor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/TemplatingEngineLoader.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/TemplatingEngineLoader.java similarity index 94% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/TemplatingEngineLoader.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/TemplatingEngineLoader.java index ea471a5a5da..5cff2c5e28f 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/TemplatingEngineLoader.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/TemplatingEngineLoader.java @@ -14,9 +14,9 @@ * limitations under the License. */ -package org.openapitools.codegen; +package org.openapijsonschematools.codegen; -import org.openapitools.codegen.api.TemplatingEngineAdapter; +import org.openapijsonschematools.codegen.api.TemplatingEngineAdapter; import java.util.Locale; import java.util.ServiceLoader; diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/VendorExtension.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/VendorExtension.java similarity index 98% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/VendorExtension.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/VendorExtension.java index b662fe0006c..6d01ba12c8f 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/VendorExtension.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/VendorExtension.java @@ -1,4 +1,4 @@ -package org.openapitools.codegen; +package org.openapijsonschematools.codegen; import java.util.Collections; import java.util.List; diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/auth/AuthMethod.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/auth/AuthMethod.java similarity index 94% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/auth/AuthMethod.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/auth/AuthMethod.java index 136a3b3b64a..d90a47b8b17 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/auth/AuthMethod.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/auth/AuthMethod.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.openapitools.codegen.auth; +package org.openapijsonschematools.codegen.auth; public interface AuthMethod { String getType(); diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/auth/AuthParser.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/auth/AuthParser.java similarity index 98% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/auth/AuthParser.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/auth/AuthParser.java index a18d8bdcfde..b6c856b8aae 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/auth/AuthParser.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/auth/AuthParser.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.openapitools.codegen.auth; +package org.openapijsonschematools.codegen.auth; import io.swagger.v3.parser.core.models.AuthorizationValue; import org.slf4j.Logger; diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/config/CodegenConfigurator.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/config/CodegenConfigurator.java similarity index 96% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/config/CodegenConfigurator.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/config/CodegenConfigurator.java index 3d2d9c3aaac..c95cb8a7df6 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/config/CodegenConfigurator.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/config/CodegenConfigurator.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.openapitools.codegen.config; +package org.openapijsonschematools.codegen.config; import com.fasterxml.jackson.databind.Module; import com.fasterxml.jackson.databind.ObjectMapper; @@ -30,11 +30,16 @@ import org.apache.commons.io.FilenameUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.Validate; -import org.openapitools.codegen.*; -import org.openapitools.codegen.api.TemplateDefinition; -import org.openapitools.codegen.api.TemplatingEngineAdapter; -import org.openapitools.codegen.auth.AuthParser; -import org.openapitools.codegen.utils.ModelUtils; +import org.openapijsonschematools.codegen.ClientOptInput; +import org.openapijsonschematools.codegen.CodegenConfig; +import org.openapijsonschematools.codegen.CodegenConfigLoader; +import org.openapijsonschematools.codegen.CodegenConstants; +import org.openapijsonschematools.codegen.SpecValidationException; +import org.openapijsonschematools.codegen.TemplatingEngineLoader; +import org.openapijsonschematools.codegen.api.TemplateDefinition; +import org.openapijsonschematools.codegen.api.TemplatingEngineAdapter; +import org.openapijsonschematools.codegen.auth.AuthParser; +import org.openapijsonschematools.codegen.utils.ModelUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -292,12 +297,6 @@ public CodegenConfigurator setEnablePostProcessFile(boolean enablePostProcessFil return this; } - public CodegenConfigurator setGenerateAliasAsModel(boolean generateAliasAsModel) { - workflowSettingsBuilder.withGenerateAliasAsModel(generateAliasAsModel); - ModelUtils.setGenerateAliasAsModel(generateAliasAsModel); - return this; - } - /** * Sets the name of the target generator. *

    @@ -563,13 +562,13 @@ public Context toContext() { GlobalSettings.setProperty(entry.getKey(), entry.getValue()); } - // if caller resets GlobalSettings, we'll need to reset generateAliasAsModel. As noted in this method, this should be moved. - ModelUtils.setGenerateAliasAsModel(workflowSettings.isGenerateAliasAsModel()); - // TODO: Support custom spec loader implementations (https://github.com/OpenAPITools/openapi-generator/issues/844) final List authorizationValues = AuthParser.parse(this.auth); ParseOptions options = new ParseOptions(); - options.setResolve(true); + // if setResolve is True then responses will not keep their refs + // https://github.com/swagger-api/swagger-parser/issues/1860 + // TODO parse with setResolve false and true, then fix the true results to keep response refs + options.setResolve(false); SwaggerParseResult result = new OpenAPIParser().readLocation(inputSpec, authorizationValues, options); // TODO: Move custom validations to a separate type as part of a "Workflow" @@ -657,7 +656,6 @@ public ClientOptInput toClientOptInput() { // TODO: Work toward CodegenConfig having a "GeneratorSettings" property. config.instantiationTypes().putAll(generatorSettings.getInstantiationTypes()); config.typeMapping().putAll(generatorSettings.getTypeMappings()); - config.importMapping().putAll(generatorSettings.getImportMappings()); config.schemaMapping().putAll(generatorSettings.getSchemaMappings()); config.inlineSchemaNameMapping().putAll(generatorSettings.getInlineSchemaNameMappings()); config.inlineSchemaNameDefault().putAll(generatorSettings.getInlineSchemaNameDefaults()); diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/config/CodegenConfiguratorUtils.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/config/CodegenConfiguratorUtils.java similarity index 98% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/config/CodegenConfiguratorUtils.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/config/CodegenConfiguratorUtils.java index fb708d4b2f5..044c9af0517 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/config/CodegenConfiguratorUtils.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/config/CodegenConfiguratorUtils.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.openapitools.codegen.config; +package org.openapijsonschematools.codegen.config; import org.apache.commons.lang3.tuple.Pair; -import org.openapitools.codegen.utils.OptionUtils; +import org.openapijsonschematools.codegen.utils.OptionUtils; import java.util.*; diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/config/DynamicSettings.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/config/DynamicSettings.java similarity index 81% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/config/DynamicSettings.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/config/DynamicSettings.java index 2dcedc0f7c7..a8fda1e8228 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/config/DynamicSettings.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/config/DynamicSettings.java @@ -1,4 +1,4 @@ -package org.openapitools.codegen.config; +package org.openapijsonschematools.codegen.config; import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonCreator; @@ -6,17 +6,17 @@ import com.fasterxml.jackson.annotation.JsonUnwrapped; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import org.apache.commons.lang3.StringUtils; -import org.openapitools.codegen.api.TemplateDefinition; -import org.openapitools.codegen.api.TemplateFileType; +import org.openapijsonschematools.codegen.api.TemplateDefinition; +import org.openapijsonschematools.codegen.api.TemplateFileType; import java.lang.reflect.Field; import java.util.*; import java.util.stream.Collectors; /** - * Represents a serialization helper of {@link org.openapitools.codegen.config.GeneratorSettings} and {@link org.openapitools.codegen.config.WorkflowSettings}. When used to deserialize any available Jackson binding input, - * this will accumulate any "unknown properties" into {@link org.openapitools.codegen.config.GeneratorSettings#getAdditionalProperties()} as a side effect of calling - * {@link org.openapitools.codegen.config.DynamicSettings#getGeneratorSettings()}. + * Represents a serialization helper of {@link GeneratorSettings} and {@link WorkflowSettings}. When used to deserialize any available Jackson binding input, + * this will accumulate any "unknown properties" into {@link GeneratorSettings#getAdditionalProperties()} as a side effect of calling + * {@link DynamicSettings#getGeneratorSettings()}. */ @SuppressWarnings({"unused", "WeakerAccess"}) public class DynamicSettings { @@ -58,7 +58,7 @@ public List getFiles() { private Map files; /** - * Gets the {@link org.openapitools.codegen.config.GeneratorSettings} included in the config object. + * Gets the {@link GeneratorSettings} included in the config object. * * @return A new instance of settings */ @@ -75,7 +75,7 @@ public GeneratorSettings getGeneratorSettings() { } /** - * Gets the {@link org.openapitools.codegen.config.WorkflowSettings} included in the config object. + * Gets the {@link WorkflowSettings} included in the config object. * * @return A new instance of settings */ diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/config/GlobalSettings.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/config/GlobalSettings.java similarity index 97% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/config/GlobalSettings.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/config/GlobalSettings.java index 1bf89faabbb..62005ff719e 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/config/GlobalSettings.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/config/GlobalSettings.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.openapitools.codegen.config; +package org.openapijsonschematools.codegen.config; import java.util.Properties; diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/examples/ExampleGenerator.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/examples/ExampleGenerator.java similarity index 99% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/examples/ExampleGenerator.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/examples/ExampleGenerator.java index a1b973e7ea7..67ff7532227 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/examples/ExampleGenerator.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/examples/ExampleGenerator.java @@ -15,14 +15,14 @@ * limitations under the License. */ -package org.openapitools.codegen.examples; +package org.openapijsonschematools.codegen.examples; import io.swagger.v3.core.util.Json; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; import org.apache.commons.lang3.StringUtils; -import org.openapitools.codegen.utils.ModelUtils; +import org.openapijsonschematools.codegen.utils.ModelUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/examples/XmlExampleGenerator.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/examples/XmlExampleGenerator.java similarity index 98% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/examples/XmlExampleGenerator.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/examples/XmlExampleGenerator.java index bee395a1d6a..1eabf2a9125 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/examples/XmlExampleGenerator.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/examples/XmlExampleGenerator.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.openapitools.codegen.examples; +package org.openapijsonschematools.codegen.examples; import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.media.XML; import org.apache.commons.lang3.StringUtils; -import org.openapitools.codegen.utils.ModelUtils; +import org.openapijsonschematools.codegen.utils.ModelUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/exceptions/ProtoBufIndexComputationException.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/exceptions/ProtoBufIndexComputationException.java new file mode 100644 index 00000000000..8c2c47deef4 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/exceptions/ProtoBufIndexComputationException.java @@ -0,0 +1,9 @@ +package org.openapijsonschematools.codegen.exceptions; + +public class ProtoBufIndexComputationException extends Exception { + + public ProtoBufIndexComputationException(String reason) { + super(reason); + } + +} diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/ignore/CodegenIgnoreProcessor.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/ignore/CodegenIgnoreProcessor.java similarity index 98% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/ignore/CodegenIgnoreProcessor.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/ignore/CodegenIgnoreProcessor.java index c33d4fbb44a..762c2d65feb 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/ignore/CodegenIgnoreProcessor.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/ignore/CodegenIgnoreProcessor.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.openapitools.codegen.ignore; +package org.openapijsonschematools.codegen.ignore; -import org.openapitools.codegen.ignore.rules.DirectoryRule; -import org.openapitools.codegen.ignore.rules.Rule; +import org.openapijsonschematools.codegen.ignore.rules.DirectoryRule; +import org.openapijsonschematools.codegen.ignore.rules.Rule; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/ignore/rules/DirectoryRule.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/ignore/rules/DirectoryRule.java similarity index 96% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/ignore/rules/DirectoryRule.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/ignore/rules/DirectoryRule.java index 6081fc4c13b..191b29e7b99 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/ignore/rules/DirectoryRule.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/ignore/rules/DirectoryRule.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.openapitools.codegen.ignore.rules; +package org.openapijsonschematools.codegen.ignore.rules; import java.nio.file.FileSystems; import java.nio.file.PathMatcher; diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/ignore/rules/EverythingRule.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/ignore/rules/EverythingRule.java similarity index 95% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/ignore/rules/EverythingRule.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/ignore/rules/EverythingRule.java index b50222f0206..aa4a81da04f 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/ignore/rules/EverythingRule.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/ignore/rules/EverythingRule.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.openapitools.codegen.ignore.rules; +package org.openapijsonschematools.codegen.ignore.rules; import java.util.List; diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/ignore/rules/FileRule.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/ignore/rules/FileRule.java similarity index 95% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/ignore/rules/FileRule.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/ignore/rules/FileRule.java index c5f731f597a..edb5220ef34 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/ignore/rules/FileRule.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/ignore/rules/FileRule.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.openapitools.codegen.ignore.rules; +package org.openapijsonschematools.codegen.ignore.rules; import java.nio.file.FileSystems; import java.nio.file.PathMatcher; diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/ignore/rules/IgnoreLineParser.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/ignore/rules/IgnoreLineParser.java similarity index 99% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/ignore/rules/IgnoreLineParser.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/ignore/rules/IgnoreLineParser.java index 7bdb44b525b..17e940b8fa1 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/ignore/rules/IgnoreLineParser.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/ignore/rules/IgnoreLineParser.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.openapitools.codegen.ignore.rules; +package org.openapijsonschematools.codegen.ignore.rules; import java.util.ArrayList; import java.util.List; diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/ignore/rules/InvalidRule.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/ignore/rules/InvalidRule.java similarity index 95% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/ignore/rules/InvalidRule.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/ignore/rules/InvalidRule.java index 841a4ff7c0f..292df4feb09 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/ignore/rules/InvalidRule.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/ignore/rules/InvalidRule.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.openapitools.codegen.ignore.rules; +package org.openapijsonschematools.codegen.ignore.rules; import java.util.List; diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/ignore/rules/ParserException.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/ignore/rules/ParserException.java similarity index 95% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/ignore/rules/ParserException.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/ignore/rules/ParserException.java index 19cf3ac18b2..2c69a8c2df5 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/ignore/rules/ParserException.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/ignore/rules/ParserException.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.openapitools.codegen.ignore.rules; +package org.openapijsonschematools.codegen.ignore.rules; public class ParserException extends Exception { /** diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/ignore/rules/Part.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/ignore/rules/Part.java similarity index 95% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/ignore/rules/Part.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/ignore/rules/Part.java index eeb47acea50..88f7e7922c9 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/ignore/rules/Part.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/ignore/rules/Part.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.openapitools.codegen.ignore.rules; +package org.openapijsonschematools.codegen.ignore.rules; class Part { private final IgnoreLineParser.Token token; diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/ignore/rules/RootedFileRule.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/ignore/rules/RootedFileRule.java similarity index 98% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/ignore/rules/RootedFileRule.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/ignore/rules/RootedFileRule.java index 9ac1d3825a1..5b45e7bda5e 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/ignore/rules/RootedFileRule.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/ignore/rules/RootedFileRule.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.openapitools.codegen.ignore.rules; +package org.openapijsonschematools.codegen.ignore.rules; import java.util.List; import java.util.regex.Pattern; diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/ignore/rules/Rule.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/ignore/rules/Rule.java similarity index 99% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/ignore/rules/Rule.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/ignore/rules/Rule.java index fd56a053293..4e01d639d0b 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/ignore/rules/Rule.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/ignore/rules/Rule.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.openapitools.codegen.ignore.rules; +package org.openapijsonschematools.codegen.ignore.rules; import java.util.List; diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/AbstractJavaCodegen.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/AbstractJavaCodegen.java new file mode 100644 index 00000000000..af02b9468b5 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/AbstractJavaCodegen.java @@ -0,0 +1,1560 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * Copyright 2018 SmartBear Software + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapijsonschematools.codegen.languages; + +import com.google.common.base.Strings; +import com.google.common.collect.Sets; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.Operation; +import io.swagger.v3.oas.models.PathItem; +import io.swagger.v3.oas.models.examples.Example; +import io.swagger.v3.oas.models.media.*; +import io.swagger.v3.oas.models.parameters.Parameter; +import org.apache.commons.io.FilenameUtils; +import org.apache.commons.lang3.StringUtils; +import org.openapijsonschematools.codegen.CliOption; +import org.openapijsonschematools.codegen.CodegenConfig; +import org.openapijsonschematools.codegen.CodegenConstants; +import org.openapijsonschematools.codegen.meta.features.SchemaFeature; +import org.openapijsonschematools.codegen.model.CodegenPatternInfo; +import org.openapijsonschematools.codegen.model.CodegenSchema; +import org.openapijsonschematools.codegen.DefaultCodegen; +import org.openapijsonschematools.codegen.VendorExtension; +import org.openapijsonschematools.codegen.languages.features.DocumentationProviderFeatures; +import org.openapijsonschematools.codegen.meta.features.ClientModificationFeature; +import org.openapijsonschematools.codegen.meta.features.DocumentationFeature; +import org.openapijsonschematools.codegen.meta.features.SecurityFeature; +import org.openapijsonschematools.codegen.meta.features.WireFormatFeature; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; +import java.io.IOException; +import java.util.*; +import java.util.regex.Pattern; +import java.util.stream.Stream; + +import static org.openapijsonschematools.codegen.utils.StringUtils.*; + +public abstract class AbstractJavaCodegen extends DefaultCodegen implements CodegenConfig, + DocumentationProviderFeatures { + + private final Logger LOGGER = LoggerFactory.getLogger(AbstractJavaCodegen.class); + private static final String ARTIFACT_VERSION_DEFAULT_VALUE = "1.0.0"; + + public static final String FULL_JAVA_UTIL = "fullJavaUtil"; + public static final String DEFAULT_LIBRARY = ""; + public static final String DATE_LIBRARY = "dateLibrary"; + public static final String SUPPORT_ASYNC = "supportAsync"; + public static final String WITH_XML = "withXml"; + public static final String SUPPORT_JAVA6 = "supportJava6"; + public static final String DISABLE_HTML_ESCAPING = "disableHtmlEscaping"; + public static final String BOOLEAN_GETTER_PREFIX = "booleanGetterPrefix"; + public static final String IGNORE_ANYOF_IN_ENUM = "ignoreAnyOfInEnum"; + public static final String ADDITIONAL_MODEL_TYPE_ANNOTATIONS = "additionalModelTypeAnnotations"; + public static final String ADDITIONAL_ENUM_TYPE_ANNOTATIONS = "additionalEnumTypeAnnotations"; + public static final String DISCRIMINATOR_CASE_SENSITIVE = "discriminatorCaseSensitive"; + public static final String OPENAPI_NULLABLE = "openApiNullable"; + public static final String JACKSON = "jackson"; + public static final String TEST_OUTPUT = "testOutput"; + public static final String IMPLICIT_HEADERS = "implicitHeaders"; + public static final String IMPLICIT_HEADERS_REGEX = "implicitHeadersRegex"; + + public static final String DEFAULT_TEST_FOLDER = "${project.build.directory}/generated-test-sources/openapi"; + + protected String dateLibrary = "java8"; + protected boolean supportAsync = false; + protected boolean withXml = false; + protected String invokerPackage = "org.openapijsonschematools"; + protected String groupId = "org.openapijsonschematools"; + protected String artifactId = "openapi-java"; + protected String artifactVersion = null; + protected String artifactUrl = "https://github.com/openapi-json-schema-tools/openapi-json-schema-generator"; + protected String artifactDescription = "OpenAPI Java"; + protected String developerName = "OpenAPI-Generator Contributors"; + protected String developerEmail = "team@openapijsonschematools.org"; + protected String developerOrganization = "OpenAPITools.org"; + protected String developerOrganizationUrl = "http://openapijsonschematools.org"; + protected String scmConnection = "scm:git:git@github.com:openapi-json-schema-tools/openapi-json-schema-generator.git"; + protected String scmDeveloperConnection = "scm:git:git@github.com:openapi-json-schema-tools/openapi-json-schema-generator.git"; + protected String scmUrl = "https://github.com/openapi-json-schema-tools/openapi-json-schema-generator"; + protected String licenseName = "Unlicense"; + protected String licenseUrl = "http://unlicense.org"; + protected String projectFolder = "src/main"; + protected String projectTestFolder = "src/test"; + // this must not be OS-specific + protected String sourceFolder = projectFolder + "/java"; + protected String testFolder = projectTestFolder + "/java"; + protected boolean fullJavaUtil; + protected boolean discriminatorCaseSensitive = true; // True if the discriminator value lookup should be case-sensitive. + protected String javaUtilPrefix = ""; + protected Boolean serializableModel = false; + protected boolean serializeBigDecimalAsString = false; + protected String apiDocPath = "docs/"; + protected String modelDocPath = "docs/"; + protected boolean supportJava6 = false; + protected boolean disableHtmlEscaping = false; + protected String booleanGetterPrefix = "get"; + protected boolean ignoreAnyOfInEnum = false; + protected String parentGroupId = ""; + protected String parentArtifactId = ""; + protected String parentVersion = ""; + protected boolean parentOverridden = false; + protected List additionalModelTypeAnnotations = new LinkedList<>(); + protected List additionalEnumTypeAnnotations = new LinkedList<>(); + protected boolean openApiNullable = true; + protected String outputTestFolder = ""; + protected DocumentationProvider documentationProvider; + protected AnnotationLibrary annotationLibrary; + protected boolean implicitHeaders = false; + protected String implicitHeadersRegex = null; + + private Map schemaKeyToModelNameCache = new HashMap<>(); + + public AbstractJavaCodegen() { + super(); + + modifyFeatureSet(features -> features + .includeDocumentationFeatures(DocumentationFeature.Readme) + .wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML)) + .securityFeatures(EnumSet.noneOf( + SecurityFeature.class + )) + .excludeSchemaFeatures( + SchemaFeature.Not + ) + .includeClientModificationFeatures( + ClientModificationFeature.BasePath + ) + ); + + supportsInheritance = true; + jsonPathTemplateFiles.put( + CodegenConstants.JSON_PATH_LOCATION_TYPE.SCHEMA, + new HashMap() {{ + put("model.mustache", ".java"); + }} + ); + jsonPathTemplateFiles.put( + CodegenConstants.JSON_PATH_LOCATION_TYPE.API_TAG, + new HashMap() {{ + put("api.mustache", ".java"); + }} + ); + apiTestTemplateFiles.put("api_test.mustache", ".java"); + HashMap schemaDocs = new HashMap<>(); + schemaDocs.put("model_doc.mustache", ".md"); + jsonPathDocTemplateFiles.put( + CodegenConstants.JSON_PATH_LOCATION_TYPE.SCHEMA, + schemaDocs + ); + jsonPathDocTemplateFiles.put( + CodegenConstants.JSON_PATH_LOCATION_TYPE.API_TAG, + new HashMap() {{ + put("api_doc.mustache", ".java"); + }} + ); + + hideGenerationTimestamp = false; + + setReservedWordsLowerCase( + Arrays.asList( + // special words + "object", "list", "file", + // used as internal variables, can collide with parameter names + "localVarPath", "localVarQueryParams", "localVarCollectionQueryParams", + "localVarHeaderParams", "localVarCookieParams", "localVarFormParams", "localVarPostBody", + "localVarAccepts", "localVarAccept", "localVarContentTypes", + "localVarContentType", "localVarAuthNames", "localReturnType", + "ApiClient", "ApiException", "ApiResponse", "Configuration", "StringUtil", + + // language reserved words + "abstract", "continue", "for", "new", "switch", "assert", + "default", "if", "package", "synchronized", "boolean", "do", "goto", "private", + "this", "break", "double", "implements", "protected", "throw", "byte", "else", + "import", "public", "throws", "case", "enum", "instanceof", "return", "transient", + "catch", "extends", "int", "short", "try", "char", "final", "interface", "static", + "void", "class", "finally", "long", "strictfp", "volatile", "const", "float", + "native", "super", "while", "null") + ); + + languageSpecificPrimitives = Sets.newHashSet("String", + "boolean", + "Boolean", + "Double", + "Integer", + "Long", + "Float", + "Object", + "byte[]" + ); + instantiationTypes.put("array", "ArrayList"); + instantiationTypes.put("set", "LinkedHashSet"); + instantiationTypes.put("map", "HashMap"); + typeMapping.put("date", "Date"); + typeMapping.put("file", "File"); + typeMapping.put("AnyType", "Object"); + + cliOptions.add(new CliOption(CodegenConstants.MODEL_PACKAGE, CodegenConstants.MODEL_PACKAGE_DESC)); + cliOptions.add(new CliOption(CodegenConstants.API_PACKAGE, CodegenConstants.API_PACKAGE_DESC)); + cliOptions.add(new CliOption(CodegenConstants.INVOKER_PACKAGE, CodegenConstants.INVOKER_PACKAGE_DESC).defaultValue(this.getInvokerPackage())); + cliOptions.add(new CliOption(CodegenConstants.GROUP_ID, CodegenConstants.GROUP_ID_DESC).defaultValue(this.getGroupId())); + cliOptions.add(new CliOption(CodegenConstants.ARTIFACT_ID, CodegenConstants.ARTIFACT_ID_DESC).defaultValue(this.getArtifactId())); + cliOptions.add(new CliOption(CodegenConstants.ARTIFACT_VERSION, CodegenConstants.ARTIFACT_VERSION_DESC).defaultValue(ARTIFACT_VERSION_DEFAULT_VALUE)); + cliOptions.add(new CliOption(CodegenConstants.ARTIFACT_URL, CodegenConstants.ARTIFACT_URL_DESC).defaultValue(this.getArtifactUrl())); + cliOptions.add(new CliOption(CodegenConstants.ARTIFACT_DESCRIPTION, CodegenConstants.ARTIFACT_DESCRIPTION_DESC).defaultValue(this.getArtifactDescription())); + cliOptions.add(new CliOption(CodegenConstants.SCM_CONNECTION, CodegenConstants.SCM_CONNECTION_DESC).defaultValue(this.getScmConnection())); + cliOptions.add(new CliOption(CodegenConstants.SCM_DEVELOPER_CONNECTION, CodegenConstants.SCM_DEVELOPER_CONNECTION_DESC).defaultValue(this.getScmDeveloperConnection())); + cliOptions.add(new CliOption(CodegenConstants.SCM_URL, CodegenConstants.SCM_URL_DESC).defaultValue(this.getScmUrl())); + cliOptions.add(new CliOption(CodegenConstants.DEVELOPER_NAME, CodegenConstants.DEVELOPER_NAME_DESC).defaultValue(this.getDeveloperName())); + cliOptions.add(new CliOption(CodegenConstants.DEVELOPER_EMAIL, CodegenConstants.DEVELOPER_EMAIL_DESC).defaultValue(this.getDeveloperEmail())); + cliOptions.add(new CliOption(CodegenConstants.DEVELOPER_ORGANIZATION, CodegenConstants.DEVELOPER_ORGANIZATION_DESC).defaultValue(this.getDeveloperOrganization())); + cliOptions.add(new CliOption(CodegenConstants.DEVELOPER_ORGANIZATION_URL, CodegenConstants.DEVELOPER_ORGANIZATION_URL_DESC).defaultValue(this.getDeveloperOrganizationUrl())); + cliOptions.add(new CliOption(CodegenConstants.LICENSE_NAME, CodegenConstants.LICENSE_NAME_DESC).defaultValue(this.getLicenseName())); + cliOptions.add(new CliOption(CodegenConstants.LICENSE_URL, CodegenConstants.LICENSE_URL_DESC).defaultValue(this.getLicenseUrl())); + cliOptions.add(new CliOption(CodegenConstants.SOURCE_FOLDER, CodegenConstants.SOURCE_FOLDER_DESC).defaultValue(this.getSourceFolder())); + cliOptions.add(CliOption.newBoolean(CodegenConstants.SERIALIZABLE_MODEL, CodegenConstants.SERIALIZABLE_MODEL_DESC, this.getSerializableModel())); + cliOptions.add(CliOption.newBoolean(CodegenConstants.SERIALIZE_BIG_DECIMAL_AS_STRING, CodegenConstants.SERIALIZE_BIG_DECIMAL_AS_STRING_DESC, serializeBigDecimalAsString)); + cliOptions.add(CliOption.newBoolean(FULL_JAVA_UTIL, "whether to use fully qualified name for classes under java.util. This option only works for Java API client", fullJavaUtil)); + cliOptions.add(CliOption.newBoolean(DISCRIMINATOR_CASE_SENSITIVE, "Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client", discriminatorCaseSensitive)); + cliOptions.add(CliOption.newBoolean(CodegenConstants.HIDE_GENERATION_TIMESTAMP, CodegenConstants.HIDE_GENERATION_TIMESTAMP_DESC, this.isHideGenerationTimestamp())); + cliOptions.add(CliOption.newBoolean(WITH_XML, "whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)")); + + CliOption dateLibrary = new CliOption(DATE_LIBRARY, "Option. Date library to use").defaultValue(this.getDateLibrary()); + Map dateOptions = new HashMap<>(); + dateOptions.put("java8", "Java 8 native JSR310 (preferred for jdk 1.8+)"); + dateOptions.put("java8-localdatetime", "Java 8 using LocalDateTime (for legacy app only)"); + dateOptions.put("joda", "Joda (for legacy app only)"); + dateOptions.put("legacy", "Legacy java.util.Date"); + dateLibrary.setEnum(dateOptions); + cliOptions.add(dateLibrary); + + cliOptions.add(CliOption.newBoolean(DISABLE_HTML_ESCAPING, "Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)", disableHtmlEscaping)); + cliOptions.add(CliOption.newString(BOOLEAN_GETTER_PREFIX, "Set booleanGetterPrefix").defaultValue(this.getBooleanGetterPrefix())); + cliOptions.add(CliOption.newBoolean(IGNORE_ANYOF_IN_ENUM, "Ignore anyOf keyword in enum", ignoreAnyOfInEnum)); + cliOptions.add(CliOption.newString(ADDITIONAL_ENUM_TYPE_ANNOTATIONS, "Additional annotations for enum type(class level annotations)")); + cliOptions.add(CliOption.newString(ADDITIONAL_MODEL_TYPE_ANNOTATIONS, "Additional annotations for model type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)")); + cliOptions.add(CliOption.newBoolean(OPENAPI_NULLABLE, "Enable OpenAPI Jackson Nullable library", this.openApiNullable)); + cliOptions.add(CliOption.newBoolean(IMPLICIT_HEADERS, "Skip header parameters in the generated API methods using @ApiImplicitParams annotation.", implicitHeaders)); + cliOptions.add(CliOption.newString(IMPLICIT_HEADERS_REGEX, "Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true")); + + cliOptions.add(CliOption.newString(CodegenConstants.PARENT_GROUP_ID, CodegenConstants.PARENT_GROUP_ID_DESC)); + cliOptions.add(CliOption.newString(CodegenConstants.PARENT_ARTIFACT_ID, CodegenConstants.PARENT_ARTIFACT_ID_DESC)); + cliOptions.add(CliOption.newString(CodegenConstants.PARENT_VERSION, CodegenConstants.PARENT_VERSION_DESC)); + CliOption snapShotVersion = CliOption.newString(CodegenConstants.SNAPSHOT_VERSION, CodegenConstants.SNAPSHOT_VERSION_DESC); + Map snapShotVersionOptions = new HashMap<>(); + snapShotVersionOptions.put("true", "Use a SnapShot Version"); + snapShotVersionOptions.put("false", "Use a Release Version"); + snapShotVersion.setEnum(snapShotVersionOptions); + cliOptions.add(snapShotVersion); + cliOptions.add(CliOption.newString(TEST_OUTPUT, "Set output folder for models and APIs tests").defaultValue(DEFAULT_TEST_FOLDER)); + + if (null != defaultDocumentationProvider()) { + CliOption documentationProviderCliOption = new CliOption(DOCUMENTATION_PROVIDER, + "Select the OpenAPI documentation provider.") + .defaultValue(defaultDocumentationProvider().toCliOptValue()); + supportedDocumentationProvider().forEach(dp -> + documentationProviderCliOption.addEnum(dp.toCliOptValue(), dp.getDescription())); + cliOptions.add(documentationProviderCliOption); + + CliOption annotationLibraryCliOption = new CliOption(ANNOTATION_LIBRARY, + "Select the complementary documentation annotation library.") + .defaultValue(defaultDocumentationProvider().getPreferredAnnotationLibrary().toCliOptValue()); + supportedAnnotationLibraries().forEach(al -> + annotationLibraryCliOption.addEnum(al.toCliOptValue(), al.getDescription())); + cliOptions.add(annotationLibraryCliOption); + } + } + + @Override + public void processOpts() { + super.processOpts(); + + if (null != defaultDocumentationProvider()) { + documentationProvider = DocumentationProvider.ofCliOption( + (String) additionalProperties.getOrDefault(DOCUMENTATION_PROVIDER, + defaultDocumentationProvider().toCliOptValue()) + ); + + if (!supportedDocumentationProvider().contains(documentationProvider)) { + String msg = String.format(Locale.ROOT, + "The [%s] Documentation Provider is not supported by this generator", + documentationProvider.toCliOptValue()); + throw new IllegalArgumentException(msg); + } + + annotationLibrary = AnnotationLibrary.ofCliOption( + (String) additionalProperties.getOrDefault(ANNOTATION_LIBRARY, + documentationProvider.getPreferredAnnotationLibrary().toCliOptValue()) + ); + + if (!supportedAnnotationLibraries().contains(annotationLibrary)) { + String msg = String.format(Locale.ROOT, "The Annotation Library [%s] is not supported by this generator", + annotationLibrary.toCliOptValue()); + throw new IllegalArgumentException(msg); + } + + if (!documentationProvider.supportedAnnotationLibraries().contains(annotationLibrary)) { + String msg = String.format(Locale.ROOT, + "The [%s] documentation provider does not support [%s] as complementary annotation library", + documentationProvider.toCliOptValue(), annotationLibrary.toCliOptValue()); + throw new IllegalArgumentException(msg); + } + + additionalProperties.put(DOCUMENTATION_PROVIDER, documentationProvider.toCliOptValue()); + additionalProperties.put(documentationProvider.getPropertyName(), true); + additionalProperties.put(ANNOTATION_LIBRARY, annotationLibrary.toCliOptValue()); + additionalProperties.put(annotationLibrary.getPropertyName(), true); + } else { + additionalProperties.put(DOCUMENTATION_PROVIDER, DocumentationProvider.NONE); + additionalProperties.put(ANNOTATION_LIBRARY, AnnotationLibrary.NONE); + } + + + if (StringUtils.isEmpty(System.getenv("JAVA_POST_PROCESS_FILE"))) { + LOGGER.info("Environment variable JAVA_POST_PROCESS_FILE not defined so the Java code may not be properly formatted. To define it, try 'export JAVA_POST_PROCESS_FILE=\"/usr/local/bin/clang-format -i\"' (Linux/Mac)"); + LOGGER.info("NOTE: To enable file post-processing, 'enablePostProcessFile' must be set to `true` (--enable-post-process-file for CLI)."); + } + + if (additionalProperties.containsKey(SUPPORT_JAVA6)) { + this.setSupportJava6(Boolean.parseBoolean(additionalProperties.get(SUPPORT_JAVA6).toString())); + } + additionalProperties.put(SUPPORT_JAVA6, supportJava6); + + if (additionalProperties.containsKey(DISABLE_HTML_ESCAPING)) { + this.setDisableHtmlEscaping(Boolean.parseBoolean(additionalProperties.get(DISABLE_HTML_ESCAPING).toString())); + } + additionalProperties.put(DISABLE_HTML_ESCAPING, disableHtmlEscaping); + + if (additionalProperties.containsKey(BOOLEAN_GETTER_PREFIX)) { + this.setBooleanGetterPrefix(additionalProperties.get(BOOLEAN_GETTER_PREFIX).toString()); + } + additionalProperties.put(BOOLEAN_GETTER_PREFIX, booleanGetterPrefix); + + if (additionalProperties.containsKey(IGNORE_ANYOF_IN_ENUM)) { + this.setIgnoreAnyOfInEnum(Boolean.parseBoolean(additionalProperties.get(IGNORE_ANYOF_IN_ENUM).toString())); + } + additionalProperties.put(IGNORE_ANYOF_IN_ENUM, ignoreAnyOfInEnum); + + if (additionalProperties.containsKey(ADDITIONAL_MODEL_TYPE_ANNOTATIONS)) { + String additionalAnnotationsList = additionalProperties.get(ADDITIONAL_MODEL_TYPE_ANNOTATIONS).toString(); + this.setAdditionalModelTypeAnnotations(Arrays.asList(additionalAnnotationsList.trim().split("\\s*(;|\\r?\\n)\\s*"))); + } + + if (additionalProperties.containsKey(ADDITIONAL_ENUM_TYPE_ANNOTATIONS)) { + String additionalAnnotationsList = additionalProperties.get(ADDITIONAL_ENUM_TYPE_ANNOTATIONS).toString(); + + this.setAdditionalEnumTypeAnnotations(Arrays.asList(additionalAnnotationsList.split(";"))); + } + + if (additionalProperties.containsKey(CodegenConstants.INVOKER_PACKAGE)) { + this.setInvokerPackage((String) additionalProperties.get(CodegenConstants.INVOKER_PACKAGE)); + } else if (additionalProperties.containsKey(CodegenConstants.API_PACKAGE)) { + // guess from api package + String derivedInvokerPackage = deriveInvokerPackageName((String) additionalProperties.get(CodegenConstants.API_PACKAGE)); + this.additionalProperties.put(CodegenConstants.INVOKER_PACKAGE, derivedInvokerPackage); + this.setInvokerPackage((String) additionalProperties.get(CodegenConstants.INVOKER_PACKAGE)); + LOGGER.info("Invoker Package Name, originally not set, is now derived from api package name: {}", derivedInvokerPackage); + } else if (additionalProperties.containsKey(CodegenConstants.MODEL_PACKAGE)) { + // guess from model package + String derivedInvokerPackage = deriveInvokerPackageName((String) additionalProperties.get(CodegenConstants.MODEL_PACKAGE)); + this.additionalProperties.put(CodegenConstants.INVOKER_PACKAGE, derivedInvokerPackage); + this.setInvokerPackage((String) additionalProperties.get(CodegenConstants.INVOKER_PACKAGE)); + LOGGER.info("Invoker Package Name, originally not set, is now derived from model package name: {}", + derivedInvokerPackage); + } else { + //not set, use default to be passed to template + additionalProperties.put(CodegenConstants.INVOKER_PACKAGE, invokerPackage); + } + + if (!additionalProperties.containsKey(CodegenConstants.MODEL_PACKAGE)) { + additionalProperties.put(CodegenConstants.MODEL_PACKAGE, modelPackage); + } + + if (!additionalProperties.containsKey(CodegenConstants.API_PACKAGE)) { + additionalProperties.put(CodegenConstants.API_PACKAGE, apiPackage); + } + + if (additionalProperties.containsKey(CodegenConstants.GROUP_ID)) { + this.setGroupId((String) additionalProperties.get(CodegenConstants.GROUP_ID)); + } else { + //not set, use to be passed to template + additionalProperties.put(CodegenConstants.GROUP_ID, groupId); + } + + if (additionalProperties.containsKey(CodegenConstants.ARTIFACT_ID)) { + this.setArtifactId((String) additionalProperties.get(CodegenConstants.ARTIFACT_ID)); + } else { + //not set, use to be passed to template + additionalProperties.put(CodegenConstants.ARTIFACT_ID, artifactId); + } + + if (additionalProperties.containsKey(CodegenConstants.ARTIFACT_URL)) { + this.setArtifactUrl((String) additionalProperties.get(CodegenConstants.ARTIFACT_URL)); + } else { + additionalProperties.put(CodegenConstants.ARTIFACT_URL, artifactUrl); + } + + if (additionalProperties.containsKey(CodegenConstants.ARTIFACT_DESCRIPTION)) { + this.setArtifactDescription((String) additionalProperties.get(CodegenConstants.ARTIFACT_DESCRIPTION)); + } else { + additionalProperties.put(CodegenConstants.ARTIFACT_DESCRIPTION, artifactDescription); + } + + if (additionalProperties.containsKey(CodegenConstants.SCM_CONNECTION)) { + this.setScmConnection((String) additionalProperties.get(CodegenConstants.SCM_CONNECTION)); + } else { + additionalProperties.put(CodegenConstants.SCM_CONNECTION, scmConnection); + } + + if (additionalProperties.containsKey(CodegenConstants.SCM_DEVELOPER_CONNECTION)) { + this.setScmDeveloperConnection((String) additionalProperties.get(CodegenConstants.SCM_DEVELOPER_CONNECTION)); + } else { + additionalProperties.put(CodegenConstants.SCM_DEVELOPER_CONNECTION, scmDeveloperConnection); + } + + if (additionalProperties.containsKey(CodegenConstants.SCM_URL)) { + this.setScmUrl((String) additionalProperties.get(CodegenConstants.SCM_URL)); + } else { + additionalProperties.put(CodegenConstants.SCM_URL, scmUrl); + } + + if (additionalProperties.containsKey(CodegenConstants.DEVELOPER_NAME)) { + this.setDeveloperName((String) additionalProperties.get(CodegenConstants.DEVELOPER_NAME)); + } else { + additionalProperties.put(CodegenConstants.DEVELOPER_NAME, developerName); + } + + if (additionalProperties.containsKey(CodegenConstants.DEVELOPER_EMAIL)) { + this.setDeveloperEmail((String) additionalProperties.get(CodegenConstants.DEVELOPER_EMAIL)); + } else { + additionalProperties.put(CodegenConstants.DEVELOPER_EMAIL, developerEmail); + } + + if (additionalProperties.containsKey(CodegenConstants.DEVELOPER_ORGANIZATION)) { + this.setDeveloperOrganization((String) additionalProperties.get(CodegenConstants.DEVELOPER_ORGANIZATION)); + } else { + additionalProperties.put(CodegenConstants.DEVELOPER_ORGANIZATION, developerOrganization); + } + + if (additionalProperties.containsKey(CodegenConstants.DEVELOPER_ORGANIZATION_URL)) { + this.setDeveloperOrganizationUrl((String) additionalProperties.get(CodegenConstants.DEVELOPER_ORGANIZATION_URL)); + } else { + additionalProperties.put(CodegenConstants.DEVELOPER_ORGANIZATION_URL, developerOrganizationUrl); + } + + if (additionalProperties.containsKey(CodegenConstants.LICENSE_NAME)) { + this.setLicenseName((String) additionalProperties.get(CodegenConstants.LICENSE_NAME)); + } else { + additionalProperties.put(CodegenConstants.LICENSE_NAME, licenseName); + } + + if (additionalProperties.containsKey(CodegenConstants.LICENSE_URL)) { + this.setLicenseUrl((String) additionalProperties.get(CodegenConstants.LICENSE_URL)); + } else { + additionalProperties.put(CodegenConstants.LICENSE_URL, licenseUrl); + } + + if (additionalProperties.containsKey(CodegenConstants.SOURCE_FOLDER)) { + this.setSourceFolder((String) additionalProperties.get(CodegenConstants.SOURCE_FOLDER)); + } + additionalProperties.put(CodegenConstants.SOURCE_FOLDER, sourceFolder); + + if (additionalProperties.containsKey(CodegenConstants.SERIALIZABLE_MODEL)) { + this.setSerializableModel(Boolean.valueOf(additionalProperties.get(CodegenConstants.SERIALIZABLE_MODEL).toString())); + } + + if (additionalProperties.containsKey(CodegenConstants.LIBRARY)) { + this.setLibrary((String) additionalProperties.get(CodegenConstants.LIBRARY)); + } + + if (additionalProperties.containsKey(CodegenConstants.SERIALIZE_BIG_DECIMAL_AS_STRING)) { + this.setSerializeBigDecimalAsString(Boolean.parseBoolean(additionalProperties.get(CodegenConstants.SERIALIZE_BIG_DECIMAL_AS_STRING).toString())); + } + + // need to put back serializableModel (boolean) into additionalProperties as value in additionalProperties is string + additionalProperties.put(CodegenConstants.SERIALIZABLE_MODEL, serializableModel); + + if (additionalProperties.containsKey(FULL_JAVA_UTIL)) { + this.setFullJavaUtil(Boolean.parseBoolean(additionalProperties.get(FULL_JAVA_UTIL).toString())); + } + if (additionalProperties.containsKey(DISCRIMINATOR_CASE_SENSITIVE)) { + this.setDiscriminatorCaseSensitive(Boolean.parseBoolean(additionalProperties.get(DISCRIMINATOR_CASE_SENSITIVE).toString())); + } else { + // By default, the discriminator lookup should be case sensitive. There is nothing in the OpenAPI specification + // that indicates the lookup should be case insensitive. However, some implementations perform + // a case-insensitive lookup. + this.setDiscriminatorCaseSensitive(Boolean.TRUE); + } + additionalProperties.put(DISCRIMINATOR_CASE_SENSITIVE, this.discriminatorCaseSensitive); + + if (fullJavaUtil) { + javaUtilPrefix = "java.util."; + } + additionalProperties.put(FULL_JAVA_UTIL, fullJavaUtil); + additionalProperties.put("javaUtilPrefix", javaUtilPrefix); + + if (additionalProperties.containsKey(WITH_XML)) { + this.setWithXml(Boolean.parseBoolean(additionalProperties.get(WITH_XML).toString())); + } + additionalProperties.put(WITH_XML, withXml); + + if (additionalProperties.containsKey(OPENAPI_NULLABLE)) { + this.setOpenApiNullable(Boolean.parseBoolean(additionalProperties.get(OPENAPI_NULLABLE).toString())); + } + additionalProperties.put(OPENAPI_NULLABLE, openApiNullable); + + if (additionalProperties.containsKey(CodegenConstants.PARENT_GROUP_ID)) { + this.setParentGroupId((String) additionalProperties.get(CodegenConstants.PARENT_GROUP_ID)); + } + + if (additionalProperties.containsKey(CodegenConstants.PARENT_ARTIFACT_ID)) { + this.setParentArtifactId((String) additionalProperties.get(CodegenConstants.PARENT_ARTIFACT_ID)); + } + + if (additionalProperties.containsKey(CodegenConstants.PARENT_VERSION)) { + this.setParentVersion((String) additionalProperties.get(CodegenConstants.PARENT_VERSION)); + } + + if (additionalProperties.containsKey(IMPLICIT_HEADERS)) { + this.setImplicitHeaders(Boolean.parseBoolean(additionalProperties.get(IMPLICIT_HEADERS).toString())); + } + + if (additionalProperties.containsKey(IMPLICIT_HEADERS_REGEX)) { + this.setImplicitHeadersRegex(additionalProperties.get(IMPLICIT_HEADERS_REGEX).toString()); + } + + if (!StringUtils.isEmpty(parentGroupId) && !StringUtils.isEmpty(parentArtifactId) && !StringUtils.isEmpty(parentVersion)) { + additionalProperties.put("parentOverridden", true); + } + + // make api and model doc path available in mustache template + additionalProperties.put("apiDocPath", apiDocPath); + additionalProperties.put("modelDocPath", modelDocPath); + + if (fullJavaUtil) { + typeMapping.put("array", "java.util.List"); + typeMapping.put("set", "java.util.Set"); + typeMapping.put("map", "java.util.Map"); + typeMapping.put("DateTime", "java.util.Date"); + typeMapping.put("UUID", "java.util.UUID"); + typeMapping.remove("List"); + instantiationTypes.put("array", "java.util.ArrayList"); + instantiationTypes.put("set", "java.util.LinkedHashSet"); + instantiationTypes.put("map", "java.util.HashMap"); + } + + this.sanitizeConfig(); + + + // imports for pojos + // import JsonCreator if JsonProperty is imported + // used later in recursive import in postProcessingModels + + if (additionalProperties.containsKey(SUPPORT_ASYNC)) { + setSupportAsync(Boolean.parseBoolean(additionalProperties.get(SUPPORT_ASYNC).toString())); + if (supportAsync) { + additionalProperties.put(SUPPORT_ASYNC, "true"); + } + } + + if (additionalProperties.containsKey(DATE_LIBRARY)) { + setDateLibrary(additionalProperties.get("dateLibrary").toString()); + } + + if ("joda".equals(dateLibrary)) { + additionalProperties.put("joda", "true"); + typeMapping.put("date", "LocalDate"); + typeMapping.put("DateTime", "DateTime"); + } else if (dateLibrary.startsWith("java8")) { + additionalProperties.put("java8", "true"); + additionalProperties.put("jsr310", "true"); + typeMapping.put("date", "LocalDate"); + if ("java8-localdatetime".equals(dateLibrary)) { + typeMapping.put("DateTime", "LocalDateTime"); + } else { + typeMapping.put("DateTime", "OffsetDateTime"); + } + } else if (dateLibrary.equals("legacy")) { + additionalProperties.put("legacyDates", "true"); + } + + if (additionalProperties.containsKey(TEST_OUTPUT)) { + setOutputTestFolder(additionalProperties.get(TEST_OUTPUT).toString()); + } + } + + @Override + public TreeMap postProcessAllModels(TreeMap objs) { + objs = super.postProcessAllModels(objs); + objs = super.updateAllModels(objs); + + if (!additionalModelTypeAnnotations.isEmpty()) { + for (String modelName : objs.keySet()) { + Map models = (Map) objs.get(modelName); + models.put(ADDITIONAL_MODEL_TYPE_ANNOTATIONS, additionalModelTypeAnnotations); + } + } + + if (!additionalEnumTypeAnnotations.isEmpty()) { + for (String modelName : objs.keySet()) { + Map models = (Map) objs.get(modelName); + models.put(ADDITIONAL_ENUM_TYPE_ANNOTATIONS, additionalEnumTypeAnnotations); + } + } + + return objs; + } + + private void sanitizeConfig() { + // Sanitize any config options here. We also have to update the additionalProperties because + // the whole additionalProperties object is injected into the main object passed to the mustache layer + + this.setApiPackage(sanitizePackageName(apiPackage)); + if (additionalProperties.containsKey(CodegenConstants.API_PACKAGE)) { + this.additionalProperties.put(CodegenConstants.API_PACKAGE, apiPackage); + } + + this.setModelPackage(sanitizePackageName(modelPackage)); + if (additionalProperties.containsKey(CodegenConstants.MODEL_PACKAGE)) { + this.additionalProperties.put(CodegenConstants.MODEL_PACKAGE, modelPackage); + } + + this.setInvokerPackage(sanitizePackageName(invokerPackage)); + if (additionalProperties.containsKey(CodegenConstants.INVOKER_PACKAGE)) { + this.additionalProperties.put(CodegenConstants.INVOKER_PACKAGE, invokerPackage); + } + } + + @Override + public String escapeReservedWord(String name) { + if (this.reservedWordsMappings().containsKey(name)) { + return this.reservedWordsMappings().get(name); + } + return "_" + name; + } + + @Override + public String apiFileFolder() { + return (outputFolder + File.separator + sourceFolder + File.separator + apiPackage().replace('.', File.separatorChar)).replace('/', File.separatorChar); + } + + @Override + public String apiTestFileFolder() { + return (outputTestFolder + File.separator + testFolder + File.separator + apiPackage().replace('.', File.separatorChar)).replace('/', File.separatorChar); + } + + @Override + public String modelTestFileFolder() { + return (outputTestFolder + File.separator + testFolder + File.separator + modelPackage().replace('.', File.separatorChar)).replace('/', File.separatorChar); + } + + @Override + public String apiDocFileFolder() { + return (outputFolder + File.separator + apiDocPath).replace('/', File.separatorChar); + } + + @Override + public String toApiDocFilename(String name) { + return toApiName(name); + } + + @Override + public String toApiTestFilename(String name) { + return toApiName(name) + "Test"; + } + + @Override + public String toModelTestFilename(String name) { + return toModelName(name, null) + "Test"; + } + + @Override + public String toApiFilename(String name) { + return toApiName(name); + } + + @Override + public String toVarName(String name) { + // sanitize name + name = sanitizeName(name, "\\W-[\\$]"); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'. + + if (name.toLowerCase(Locale.ROOT).matches("^_*class$")) { + return "propertyClass"; + } + + if ("_".equals(name)) { + name = "_u"; + } + + // numbers are not allowed at the beginning + if (name.matches("^\\d.*")) { + name = "_" + name; + } + + // if it's all upper case, do nothing + if (name.matches("^[A-Z0-9_]*$")) { + return name; + } + + if (startsWithTwoUppercaseLetters(name)) { + name = name.substring(0, 2).toLowerCase(Locale.ROOT) + name.substring(2); + } + + // If name contains special chars -> replace them. + if ((((CharSequence) name).chars().anyMatch(character -> specialCharReplacements.containsKey(String.valueOf((char) character))))) { + List allowedCharacters = new ArrayList<>(); + allowedCharacters.add("_"); + allowedCharacters.add("$"); + name = escape(name, specialCharReplacements, allowedCharacters, "_"); + } + + // camelize (lower first character) the variable name + // pet_id => petId + name = camelize(name, true); + + // for reserved word or word starting with number, append _ + if (isReservedWord(name) || name.matches("^\\d.*")) { + name = escapeReservedWord(name); + } + + return name; + } + + private boolean startsWithTwoUppercaseLetters(String name) { + boolean startsWithTwoUppercaseLetters = false; + if (name.length() > 1) { + startsWithTwoUppercaseLetters = name.substring(0, 2).equals(name.substring(0, 2).toUpperCase(Locale.ROOT)); + } + return startsWithTwoUppercaseLetters; + } + + @Override + public String toParamName(String name) { + // to avoid conflicts with 'callback' parameter for async call + if ("callback".equals(name)) { + return "paramCallback"; + } + + // should be the same as variable name + return toVarName(name); + } + + @Override + public String toModelName(final String name, String jsonPath) { + // We need to check if schema-mapping has a different model for this class, so we use it + // instead of the auto-generated one. + if (schemaMapping.containsKey(name)) { + return schemaMapping.get(name); + } + + // memoization + String origName = name; + if (schemaKeyToModelNameCache.containsKey(origName)) { + return schemaKeyToModelNameCache.get(origName); + } + + final String sanitizedName = sanitizeName(name); + + String nameWithPrefixSuffix = sanitizedName; + if (!StringUtils.isEmpty(modelNamePrefix)) { + // add '_' so that model name can be camelized correctly + nameWithPrefixSuffix = modelNamePrefix + "_" + nameWithPrefixSuffix; + } + + if (!StringUtils.isEmpty(modelNameSuffix)) { + // add '_' so that model name can be camelized correctly + nameWithPrefixSuffix = nameWithPrefixSuffix + "_" + modelNameSuffix; + } + + // camelize the model name + // phone_number => PhoneNumber + final String camelizedName = camelize(nameWithPrefixSuffix); + + // model name cannot use reserved keyword, e.g. return + if (isReservedWord(camelizedName)) { + final String modelName = "Model" + camelizedName; + schemaKeyToModelNameCache.put(origName, modelName); + LOGGER.warn("{} (reserved word) cannot be used as model name. Renamed to {}", camelizedName, modelName); + return modelName; + } + + // model name starts with number + if (camelizedName.matches("^\\d.*")) { + final String modelName = "Model" + camelizedName; // e.g. 200Response => Model200Response (after camelize) + schemaKeyToModelNameCache.put(origName, modelName); + LOGGER.warn("{} (model name starts with number) cannot be used as model name. Renamed to {}", name, + modelName); + return modelName; + } + + schemaKeyToModelNameCache.put(origName, camelizedName); + + return camelizedName; + } + + @Override + public String toModelFilename(String name, String jsonPath) { + // should be the same as the model name + return toModelName(name, jsonPath); + } + + /** + * Return the example value of the parameter. Overrides the + * getParameterExampleValue(Parameter) method in + * DefaultCodegen to always call setParameterExampleValue(CodegenParameter) + * in this class, which adds single quotes around strings from the + * x-example property. + * + * @param parameter Parameter + */ + @Override + public String getParameterExampleValue(Parameter parameter) { + String example = null; + if (parameter.getExample() != null) { + example = parameter.getExample().toString(); + } else if (parameter.getExamples() != null && !parameter.getExamples().isEmpty()) { + Example examplesExample = parameter.getExamples().values().iterator().next(); + if (examplesExample.getValue() != null) { + example = examplesExample.getValue().toString(); + } + } + + Schema schema = parameter.getSchema(); + + if (schema == null) { + String contentType = (String) parameter.getContent().keySet().toArray()[0]; + schema = parameter.getContent().get(contentType).getSchema(); + } + + if (schema.getExample() != null) { + example = schema.getExample().toString(); + } else if (schema.getExamples() != null && !schema.getExamples().isEmpty()) { + example = schema.getExamples().get(0).toString(); + } + + boolean hasAllowableValues = schema.getEnum() != null && !schema.getEnum().isEmpty(); + if (hasAllowableValues) { + //support examples for inline enums + final List values = (List) schema.getEnum(); + example = String.valueOf(values.get(0)); + } else if (schema.getDefault() != null) { + example = schema.getDefault().toString(); + } else if (schema.getExample() != null) { + example = schema.getExample().toString(); + } else if (schema.getExamples() != null && !schema.getExamples().isEmpty()) { + example = schema.getExamples().get(0).toString(); + } + + Set types = schema.getTypes(); + if (types == null) { + types = new HashSet<>(); + if (schema.getType() != null) { + types.add(schema.getType()); + } + } + if (types.contains("string")) { + String format = schema.getFormat(); + if (format != null) { + if (format.equals("uuid")) { + if (example == null) { + example = "UUID.randomUUID()"; + } else { + example = "UUID.fromString(\"" + example + "\")"; + } + } else if (format.equals("binary")) { + if (example == null) { + example = "/path/to/file"; + } + example = "new File(\"" + escapeText(example) + "\")"; + } else if (format.equals("date")) { + example = "new Date()"; + } else if (format.equals("date-time")) { + if (example == null) { + example = "LocalDate.now()"; + } else { + example = "LocalDate.parse(\"" + example + "\")"; + } + } else if (format.equals("number")) { + if (example == null) { + example = "new BigDecimal(78)"; + } else { + example = "new BigDecimal(\"" + example + "\")"; + } + } + } else { + if (example == null) { + example = parameter.getName() + "_example"; + } + example = "\"" + escapeText(example) + "\""; + } + } else if (types.contains("integer")) { + if (example == null) { + example = "56"; + } + if (schema.getFormat().equals("int64")) { + example = StringUtils.appendIfMissingIgnoreCase(example, "L"); + } + } else if (types.contains("number")) { + if (example == null) { + example = "3.4"; + } + if (schema.getFormat().equals("float")) { + example = StringUtils.appendIfMissingIgnoreCase(example, "F"); + } else if (schema.getFormat().equals("double")) { + example = StringUtils.appendIfMissingIgnoreCase(example, "D"); + } + } else if (types.contains("boolean")) { + if (example == null) { + example = "true"; + } + } else if (types.contains("array")) { + if (example == null) { + example = "Arrays.asList()"; + } + } else if (types.contains("object")) { + if (example == null) { + example = "new HashMap()"; + } + } else if (types.contains("null")) { + if (example == null) { + example = "null"; + } + } else if (hasAllowableValues) { + //parameter is enum defined as a schema component + example = ".fromValue(\"" + example + "\")"; + } + + if (example == null) { + example = "null"; + } + + return example; + } + + @Override + public String toExampleValue(Schema p) { + if (p.getExample() != null) { + return escapeText(p.getExample().toString()); + } else { + return null; + } + } + + @Override + public void postProcessModelProperty(CodegenSchema model, CodegenSchema property) { + if (additionalProperties.containsKey(JACKSON)) { + model.imports.add("JsonTypeName"); + } + + if (serializeBigDecimalAsString) { + if (property.types.contains("string") && property.format.equals("number")) { + // we serialize BigDecimal as `string` to avoid precision loss + property.vendorExtensions.put("x-extra-annotation", "@JsonSerialize(using = ToStringSerializer.class)"); + + // this requires some more imports to be added for this model... + model.imports.add("ToStringSerializer"); + model.imports.add("JsonSerialize"); + } + } + + if (!fullJavaUtil) { + if (property.types != null && property.types.contains("array") && !property.uniqueItems) { + model.imports.add("ArrayList"); + } else if (property.types != null && property.types.contains("array") && property.uniqueItems) { + model.imports.add("LinkedHashSet"); + boolean canNotBeWrappedToNullable = !openApiNullable || Boolean.FALSE.equals(property.nullable); + if (canNotBeWrappedToNullable) { + model.imports.add("JsonDeserialize"); + property.vendorExtensions.put("x-setter-extra-annotation", "@JsonDeserialize(as = LinkedHashSet.class)"); + } + } else if (property.types != null && property.types.contains("object")) { + model.imports.add("HashMap"); + } + } + + if (model.enumValueToName == null) { + // needed by all pojos, but not enums + model.imports.add("ApiModelProperty"); + model.imports.add("ApiModel"); + } + + if (openApiNullable) { + if (Boolean.TRUE.equals(property.nullable)) { + model.imports.add("JsonNullable"); + model.vendorExtensions.put("x-jackson-optional-nullable-helpers", true); + } + } + + if (property.readOnly) { + model.vendorExtensions.put("x-has-readonly-properties", true); + } + } + + @Override + public void preprocessOpenAPI(OpenAPI openAPI) { + super.preprocessOpenAPI(openAPI); + if (openAPI == null) { + return; + } + if (openAPI.getPaths() != null) { + for (Map.Entry openAPIGetPathsEntry : openAPI.getPaths().entrySet()) { + String pathname = openAPIGetPathsEntry.getKey(); + PathItem path = openAPIGetPathsEntry.getValue(); + if (path.readOperations() == null) { + continue; + } + for (Operation operation : path.readOperations()) { + LOGGER.info("Processing operation {}", operation.getOperationId()); + if (hasBodyParameter(openAPI, operation) || hasFormParameter(openAPI, operation)) { + String defaultContentType = hasFormParameter(openAPI, operation) ? "application/x-www-form-urlencoded" : "application/json"; + List consumes = new ArrayList<>(getConsumesInfo(openAPI, operation)); + String contentType = consumes.isEmpty() ? defaultContentType : consumes.get(0); + operation.addExtension("x-content-type", contentType); + } + String accepts = getAccept(openAPI, operation); + operation.addExtension("x-accepts", accepts); + } + } + } + + // TODO: Setting additionalProperties is not the responsibility of this method. These side-effects should be moved elsewhere to prevent unexpected behaviors. + if (artifactVersion == null) { + // If no artifactVersion is provided in additional properties, version from API specification is used. + // If none of them is provided then fallbacks to default version + if (additionalProperties.containsKey(CodegenConstants.ARTIFACT_VERSION) && additionalProperties.get(CodegenConstants.ARTIFACT_VERSION) != null) { + this.setArtifactVersion((String) additionalProperties.get(CodegenConstants.ARTIFACT_VERSION)); + } else if (openAPI.getInfo() != null && openAPI.getInfo().getVersion() != null) { + this.setArtifactVersion(openAPI.getInfo().getVersion()); + } else { + this.setArtifactVersion(ARTIFACT_VERSION_DEFAULT_VALUE); + } + } + additionalProperties.put(CodegenConstants.ARTIFACT_VERSION, artifactVersion); + + if (additionalProperties.containsKey(CodegenConstants.SNAPSHOT_VERSION)) { + if (convertPropertyToBooleanAndWriteBack(CodegenConstants.SNAPSHOT_VERSION)) { + this.setArtifactVersion(this.buildSnapshotVersion(this.getArtifactVersion())); + } + } + additionalProperties.put(CodegenConstants.ARTIFACT_VERSION, artifactVersion); + + if (ignoreAnyOfInEnum) { + // Alter OpenAPI schemas ignore anyOf keyword if it consist of an enum. Example: + // anyOf: + // - type: string + // enum: + // - ENUM_A + // - ENUM_B + Stream.concat( + Stream.of(openAPI.getComponents().getSchemas()), + openAPI.getComponents().getSchemas().values().stream() + .filter(schema -> schema.getProperties() != null) + .map(Schema::getProperties)) + .forEach(schemas -> schemas.replaceAll( + (name, s) -> Stream.of(s) + .filter(schema -> schema instanceof ComposedSchema) + .map(schema -> (ComposedSchema) schema) + .filter(schema -> Objects.nonNull(schema.getAnyOf())) + .flatMap(schema -> schema.getAnyOf().stream()) + .filter(schema -> Objects.nonNull(schema.getEnum())) + .findFirst() + .orElse((Schema) s))); + } + } + + private static String getAccept(OpenAPI openAPI, Operation operation) { + String accepts = null; + String defaultContentType = "application/json"; + Set producesInfo = getProducesInfo(openAPI, operation); + if (producesInfo != null && !producesInfo.isEmpty()) { + ArrayList produces = new ArrayList<>(producesInfo); + StringBuilder sb = new StringBuilder(); + for (String produce : produces) { + if (defaultContentType.equalsIgnoreCase(produce)) { + accepts = defaultContentType; + break; + } else { + if (sb.length() > 0) { + sb.append(","); + } + sb.append(produce); + } + } + if (accepts == null) { + accepts = sb.toString(); + } + } else { + accepts = defaultContentType; + } + + return accepts; + } + + @Override + protected boolean needToImport(String type) { + return super.needToImport(type) && !type.contains("."); + } + + @Override + public String toEnumVarName(String value, Schema prop) { + if (value.length() == 0) { + return "EMPTY"; + } + + // for symbol, e.g. $, # + if (getSymbolName(value) != null) { + return getSymbolName(value).toUpperCase(Locale.ROOT); + } + + if (" ".equals(value)) { + return "SPACE"; + } + + // number + if (prop.getType().equals("integer") || prop.getType().equals("float")) { + String varName = "NUMBER_" + value; + varName = varName.replaceAll("-", "MINUS_"); + varName = varName.replaceAll("\\+", "PLUS_"); + varName = varName.replaceAll("\\.", "_DOT_"); + return varName; + } + + // string + String var = value.replaceAll("\\W+", "_").toUpperCase(Locale.ROOT); + if (var.matches("\\d.*")) { + return "_" + var; + } else { + return var; + } + } + + private static String sanitizePackageName(String packageName) { + packageName = packageName.trim(); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'. + packageName = packageName.replaceAll("[^a-zA-Z0-9_\\.]", "_"); + if (Strings.isNullOrEmpty(packageName)) { + return "invalidPackageName"; + } + return packageName; + } + + public String getInvokerPackage() { + return invokerPackage; + } + + public void setInvokerPackage(String invokerPackage) { + this.invokerPackage = invokerPackage; + } + + public String getGroupId() { + return groupId; + } + + public void setGroupId(String groupId) { + this.groupId = groupId; + } + + public String getArtifactId() { + return artifactId; + } + + public void setArtifactId(String artifactId) { + this.artifactId = artifactId; + } + + public String getArtifactVersion() { + return artifactVersion; + } + + public void setArtifactVersion(String artifactVersion) { + this.artifactVersion = artifactVersion; + } + + public String getArtifactUrl() { + return artifactUrl; + } + + public void setArtifactUrl(String artifactUrl) { + this.artifactUrl = artifactUrl; + } + + public String getArtifactDescription() { + return artifactDescription; + } + + public void setArtifactDescription(String artifactDescription) { + this.artifactDescription = artifactDescription; + } + + public String getScmConnection() { + return scmConnection; + } + + public void setScmConnection(String scmConnection) { + this.scmConnection = scmConnection; + } + + public String getScmDeveloperConnection() { + return scmDeveloperConnection; + } + + public void setScmDeveloperConnection(String scmDeveloperConnection) { + this.scmDeveloperConnection = scmDeveloperConnection; + } + + public String getScmUrl() { + return scmUrl; + } + + public void setScmUrl(String scmUrl) { + this.scmUrl = scmUrl; + } + + public String getDeveloperName() { + return developerName; + } + + public void setDeveloperName(String developerName) { + this.developerName = developerName; + } + + public String getDeveloperEmail() { + return developerEmail; + } + + public void setDeveloperEmail(String developerEmail) { + this.developerEmail = developerEmail; + } + + public String getDeveloperOrganization() { + return developerOrganization; + } + + public void setDeveloperOrganization(String developerOrganization) { + this.developerOrganization = developerOrganization; + } + + public String getDeveloperOrganizationUrl() { + return developerOrganizationUrl; + } + + public void setDeveloperOrganizationUrl(String developerOrganizationUrl) { + this.developerOrganizationUrl = developerOrganizationUrl; + } + + public String getLicenseName() { + return licenseName; + } + + public void setLicenseName(String licenseName) { + this.licenseName = licenseName; + } + + public String getLicenseUrl() { + return licenseUrl; + } + + public void setLicenseUrl(String licenseUrl) { + this.licenseUrl = licenseUrl; + } + + public String getSourceFolder() { + return sourceFolder; + } + + public void setSourceFolder(String sourceFolder) { + this.sourceFolder = sourceFolder; + } + + public String getTestFolder() { + return testFolder; + } + + public void setTestFolder(String testFolder) { + this.testFolder = testFolder; + } + + public void setSerializeBigDecimalAsString(boolean s) { + this.serializeBigDecimalAsString = s; + } + + public Boolean getSerializableModel() { + return serializableModel; + } + + public void setSerializableModel(Boolean serializableModel) { + this.serializableModel = serializableModel; + } + + private String sanitizePath(String p) { + //prefer replace a ", instead of a fuLL URL encode for readability + return p.replaceAll("\"", "%22"); + } + + public void setFullJavaUtil(boolean fullJavaUtil) { + this.fullJavaUtil = fullJavaUtil; + } + + /** + * Set whether discriminator value lookup is case-sensitive or not. + * + * @param discriminatorCaseSensitive true if the discriminator value lookup should be case sensitive. + */ + public void setDiscriminatorCaseSensitive(boolean discriminatorCaseSensitive) { + this.discriminatorCaseSensitive = discriminatorCaseSensitive; + } + + public void setWithXml(boolean withXml) { + this.withXml = withXml; + } + + public String getDateLibrary() { + return dateLibrary; + } + + public void setDateLibrary(String library) { + this.dateLibrary = library; + } + + public void setSupportAsync(boolean enabled) { + this.supportAsync = enabled; + } + + public void setDisableHtmlEscaping(boolean disabled) { + this.disableHtmlEscaping = disabled; + } + + public String getBooleanGetterPrefix() { + return booleanGetterPrefix; + } + + public void setBooleanGetterPrefix(String booleanGetterPrefix) { + this.booleanGetterPrefix = booleanGetterPrefix; + } + + public void setIgnoreAnyOfInEnum(boolean ignoreAnyOfInEnum) { + this.ignoreAnyOfInEnum = ignoreAnyOfInEnum; + } + + public boolean isOpenApiNullable() { + return openApiNullable; + } + + public void setOpenApiNullable(final boolean openApiNullable) { + this.openApiNullable = openApiNullable; + } + + @Override + public void setOutputDir(String dir) { + super.setOutputDir(dir); + if (this.outputTestFolder.isEmpty()) { + setOutputTestFolder(dir); + } + } + + public String getOutputTestFolder() { + if (outputTestFolder.isEmpty()) { + return DEFAULT_TEST_FOLDER; + } + return outputTestFolder; + } + + public void setOutputTestFolder(String outputTestFolder) { + this.outputTestFolder = outputTestFolder; + } + + @Override + public DocumentationProvider getDocumentationProvider() { + return documentationProvider; + } + + @Override + public void setDocumentationProvider(DocumentationProvider documentationProvider) { + this.documentationProvider = documentationProvider; + } + + @Override + public AnnotationLibrary getAnnotationLibrary() { + return annotationLibrary; + } + + @Override + public void setAnnotationLibrary(AnnotationLibrary annotationLibrary) { + this.annotationLibrary = annotationLibrary; + } + + public void setImplicitHeaders(boolean implicitHeaders) { + this.implicitHeaders = implicitHeaders; + } + + public void setImplicitHeadersRegex(String implicitHeadersRegex) { + this.implicitHeadersRegex = implicitHeadersRegex; + } + + @Override + public String escapeQuotationMark(String input) { + // remove " to avoid code injection + return input.replace("\"", ""); + } + + @Override + public String escapeUnsafeCharacters(String input) { + return input.replace("*/", "*_/").replace("/*", "/_*"); + } + + /* + * Derive invoker package name based on the input + * e.g. foo.bar.model => foo.bar + * + * @param input API package/model name + * @return Derived invoker package name based on API package/model name + */ + private String deriveInvokerPackageName(String input) { + String[] parts = input.split(Pattern.quote(".")); // Split on period. + + StringBuilder sb = new StringBuilder(); + String delim = ""; + for (String p : Arrays.copyOf(parts, parts.length - 1)) { + sb.append(delim).append(p); + delim = "."; + } + return sb.toString(); + } + + /** + * Builds a SNAPSHOT version from a given version. + * + * @param version + * @return SNAPSHOT version + */ + private String buildSnapshotVersion(String version) { + if (version.endsWith("-SNAPSHOT")) { + return version; + } + return version + "-SNAPSHOT"; + } + + public void setSupportJava6(boolean value) { + this.supportJava6 = value; + } + + @Override + public CodegenPatternInfo getPatternInfo(String pattern) { + return new CodegenPatternInfo(escapeText(pattern), null); + } + + @Override + public String sanitizeTag(String tag) { + tag = camelize(underscore(sanitizeName(tag))); + + // tag starts with numbers + if (tag.matches("^\\d.*")) { + tag = "Class" + tag; + } + return tag; + } + + @Override + public void postProcessFile(File file, String fileType) { + if (file == null) { + return; + } + + String javaPostProcessFile = System.getenv("JAVA_POST_PROCESS_FILE"); + if (StringUtils.isEmpty(javaPostProcessFile)) { + return; // skip if JAVA_POST_PROCESS_FILE env variable is not defined + } + + // only process files with java extension + if ("java".equals(FilenameUtils.getExtension(file.toString()))) { + String command = javaPostProcessFile + " " + file; + try { + Process p = Runtime.getRuntime().exec(command); + p.waitFor(); + int exitValue = p.exitValue(); + if (exitValue != 0) { + LOGGER.error("Error running the command ({}). Exit value: {}", command, exitValue); + } else { + LOGGER.info("Successfully executed: {}", command); + } + } catch (InterruptedException | IOException e) { + LOGGER.error("Error running the command ({}). Exception: {}", command, e.getMessage()); + // Restore interrupted state + Thread.currentThread().interrupt(); + } + } + } + + public void setParentGroupId(final String parentGroupId) { + this.parentGroupId = parentGroupId; + } + + public void setParentArtifactId(final String parentArtifactId) { + this.parentArtifactId = parentArtifactId; + } + + public void setParentVersion(final String parentVersion) { + this.parentVersion = parentVersion; + } + + public void setParentOverridden(final boolean parentOverridden) { + this.parentOverridden = parentOverridden; + } + + public List getAdditionalModelTypeAnnotations() { + return additionalModelTypeAnnotations; + } + + public void setAdditionalModelTypeAnnotations(final List additionalModelTypeAnnotations) { + this.additionalModelTypeAnnotations = additionalModelTypeAnnotations; + } + + public void setAdditionalEnumTypeAnnotations(final List additionalEnumTypeAnnotations) { + this.additionalEnumTypeAnnotations = additionalEnumTypeAnnotations; + } + + /** + * Search for property by {@link CodegenSchema#jsonPathPiece} + * @param name - name to search for + * @param properties - list of properties + * @return either found property or {@link Optional#empty()} if nothing has been found + */ + protected Optional findByName(String name, List properties) { + if (properties == null || properties.isEmpty()) { + return Optional.empty(); + } + + return properties.stream() + .filter(p -> p.jsonPathPiece.original.equals(name)) + .findFirst(); + } + + @Override + public List getSupportedVendorExtensions() { + List extensions = super.getSupportedVendorExtensions(); + extensions.add(VendorExtension.X_DISCRIMINATOR_VALUE); + extensions.add(VendorExtension.X_IMPLEMENTS); + extensions.add(VendorExtension.X_SETTER_EXTRA_ANNOTATION); + extensions.add(VendorExtension.X_TAGS); + extensions.add(VendorExtension.X_ACCEPTS); + extensions.add(VendorExtension.X_CONTENT_TYPE); + extensions.add(VendorExtension.X_CLASS_EXTRA_ANNOTATION); + extensions.add(VendorExtension.X_FIELD_EXTRA_ANNOTATION); + return extensions; + } +} diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/AbstractJavaJAXRSServerCodegen.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/AbstractJavaJAXRSServerCodegen.java new file mode 100644 index 00000000000..e2211b02073 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/AbstractJavaJAXRSServerCodegen.java @@ -0,0 +1,198 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * Copyright 2018 SmartBear Software + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapijsonschematools.codegen.languages; + +import com.google.common.annotations.VisibleForTesting; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.Operation; +import io.swagger.v3.oas.models.PathItem; +import org.apache.commons.lang3.StringUtils; +import org.openapijsonschematools.codegen.CliOption; +import org.openapijsonschematools.codegen.CodegenConstants; +import org.openapijsonschematools.codegen.model.CodegenOperation; +import org.openapijsonschematools.codegen.model.CodegenSchema; +import org.openapijsonschematools.codegen.CodegenType; +import org.openapijsonschematools.codegen.languages.features.BeanValidationFeatures; +import org.openapijsonschematools.codegen.utils.URLPathUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; +import java.net.URL; +import java.util.*; + +public abstract class AbstractJavaJAXRSServerCodegen extends AbstractJavaCodegen implements BeanValidationFeatures { + public static final String SERVER_PORT = "serverPort"; + public static final String USE_TAGS = "useTags"; + + /** + * Name of the sub-directory in "src/main/resource" where to find the + * Mustache template for the JAX-RS Codegen. + */ + protected static final String JAXRS_TEMPLATE_DIRECTORY_NAME = "JavaJaxRS"; + protected String implFolder = "src/main/java"; + protected String testResourcesFolder = "src/test/resources"; + protected String title = "OpenAPI Server"; + protected String serverPort = "8080"; + + protected boolean useBeanValidation = true; + protected boolean useTags = false; + + private final Logger LOGGER = LoggerFactory.getLogger(AbstractJavaJAXRSServerCodegen.class); + + public AbstractJavaJAXRSServerCodegen() { + super(); + + sourceFolder = "src/gen/java"; + invokerPackage = "org.openapijsonschematools.api"; + artifactId = "openapi-jaxrs-server"; + dateLibrary = "legacy"; //TODO: add joda support to all jax-rs + apiPackage = "org.openapijsonschematools.api"; + modelPackage = "org.openapijsonschematools.model"; + + // clioOptions default redefinition need to be updated + updateOption(CodegenConstants.INVOKER_PACKAGE, this.getInvokerPackage()); + updateOption(CodegenConstants.ARTIFACT_ID, this.getArtifactId()); + updateOption(CodegenConstants.API_PACKAGE, apiPackage); + updateOption(CodegenConstants.MODEL_PACKAGE, modelPackage); + updateOption(DATE_LIBRARY, this.getDateLibrary()); + updateOption(CodegenConstants.SOURCE_FOLDER, this.getSourceFolder()); + + additionalProperties.put("title", title); + // java inflector uses the jackson lib + additionalProperties.put(JACKSON, "true"); + + cliOptions.add(new CliOption(CodegenConstants.IMPL_FOLDER, CodegenConstants.IMPL_FOLDER_DESC).defaultValue(implFolder)); + cliOptions.add(new CliOption("title", "a title describing the application").defaultValue(title)); + cliOptions.add(CliOption.newBoolean(USE_BEANVALIDATION, "Use BeanValidation API annotations",useBeanValidation)); + cliOptions.add(new CliOption(SERVER_PORT, "The port on which the server should be started").defaultValue(serverPort)); + cliOptions.add(CliOption.newBoolean(USE_TAGS, "use tags for creating interface and controller classnames")); + } + + + // =============== + // COMMONS METHODS + // =============== + + @Override + public CodegenType getTag() { + return CodegenType.SERVER; + } + + @Override + public void processOpts() { + super.processOpts(); + + if (additionalProperties.containsKey(CodegenConstants.IMPL_FOLDER)) { + implFolder = (String) additionalProperties.get(CodegenConstants.IMPL_FOLDER); + } + + if (additionalProperties.containsKey(USE_BEANVALIDATION)) { + setUseBeanValidation(convertPropertyToBoolean(USE_BEANVALIDATION)); + } + + if (additionalProperties.containsKey(USE_TAGS)) { + setUseTags(convertPropertyToBoolean(USE_TAGS)); + } + + writePropertyBack(USE_BEANVALIDATION, useBeanValidation); + } + + @Override + public void addOperationToGroup(String tag, String resourcePath, Operation operation, CodegenOperation co, Map> operations) { + if (useTags) { + super.addOperationToGroup(tag, resourcePath, operation, co, operations); + } + } + + @Override + public void preprocessOpenAPI(OpenAPI openAPI) { + super.preprocessOpenAPI(openAPI); + /* TODO there should be no need for the following logic + if ("/".equals(swagger.getBasePath())) { + swagger.setBasePath(""); + } + */ + + if (!this.additionalProperties.containsKey(SERVER_PORT)) { + URL url = URLPathUtils.getServerURL(openAPI, serverVariableOverrides()); + // 8080 is the default value for a JEE Server: + this.additionalProperties.put(SERVER_PORT, URLPathUtils.getPort(url, serverPort)); + } + + if (openAPI.getPaths() != null) { + for (Map.Entry openAPIGetPathsEntry : openAPI.getPaths().entrySet()) { + String pathname = openAPIGetPathsEntry.getKey(); + PathItem path = openAPIGetPathsEntry.getValue(); + if (path.readOperations() != null) { + for (Operation operation : path.readOperations()) { + if (operation.getTags() != null) { + List> tags = new ArrayList>(); + for (String tag : operation.getTags()) { + Map value = new HashMap(); + value.put("tag", tag); + tags.add(value); + } + if (operation.getTags().size() > 0) { + String tag = operation.getTags().get(0); + operation.setTags(Arrays.asList(tag)); + } + operation.addExtension("x-tags", tags); + } + } + } + } + } + } + + @Override + public String toApiName(final String name) { + String computed = name; + if (computed.length() > 0) { + computed = sanitizeName(computed); + } + return super.toApiName(computed); + } + + private static String getCommonPath(String path1, String path2) { + final String[] parts1 = StringUtils.split(path1, "/"); + final String[] parts2 = StringUtils.split(path2, "/"); + StringBuilder builder = new StringBuilder(); + for (int i = 0; i < Math.min(parts1.length, parts2.length); i++) { + if (!parts1[i].equals(parts2[i])) { + break; + } + builder.append("/").append(parts1[i]); + } + return builder.toString(); + } + + private String implFileFolder(String output) { + return outputFolder + "/" + output + "/" + apiPackage().replace('.', '/'); + } + + @Override + public void setUseBeanValidation(boolean useBeanValidation) { + this.useBeanValidation = useBeanValidation; + } + + @VisibleForTesting + public void setUseTags(boolean useTags) { + this.useTags = useTags; + } +} diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/AbstractKotlinCodegen.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/AbstractKotlinCodegen.java new file mode 100644 index 00000000000..58331f5b102 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/AbstractKotlinCodegen.java @@ -0,0 +1,862 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * Copyright 2018 SmartBear Software + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapijsonschematools.codegen.languages; + +import com.fasterxml.jackson.databind.node.ArrayNode; +import io.swagger.v3.oas.models.media.ArraySchema; +import io.swagger.v3.oas.models.media.Schema; +import org.apache.commons.io.FilenameUtils; +import org.apache.commons.lang3.StringUtils; +import org.openapijsonschematools.codegen.CliOption; +import org.openapijsonschematools.codegen.CodegenConfig; +import org.openapijsonschematools.codegen.CodegenConstants; +import org.openapijsonschematools.codegen.model.CodegenPatternInfo; +import org.openapijsonschematools.codegen.model.CodegenSchema; +import org.openapijsonschematools.codegen.DefaultCodegen; +import org.openapijsonschematools.codegen.GeneratorLanguage; +import org.openapijsonschematools.codegen.utils.ModelUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; +import java.io.IOException; +import java.util.*; +import java.util.regex.Pattern; + +import static org.openapijsonschematools.codegen.utils.StringUtils.*; + +public abstract class AbstractKotlinCodegen extends DefaultCodegen implements CodegenConfig { + + public static final String SERIALIZATION_LIBRARY_DESC = "What serialization library to use: 'moshi' (default), or 'gson' or 'jackson'"; + + public enum SERIALIZATION_LIBRARY_TYPE {moshi, gson, jackson, kotlinx_serialization} + + public static final String MODEL_MUTABLE = "modelMutable"; + public static final String MODEL_MUTABLE_DESC = "Create mutable models"; + + private final Logger LOGGER = LoggerFactory.getLogger(AbstractKotlinCodegen.class); + + protected String artifactId; + protected String artifactVersion = "1.0.0"; + protected String groupId = "org.openapijsonschematools"; + protected String packageName = "org.openapijsonschematools"; + protected String apiSuffix = "Api"; + + protected String sourceFolder = "src/main/kotlin"; + protected String testFolder = "src/test/kotlin"; + + protected String apiDocPath = "docs/"; + protected String modelDocPath = "docs/"; + protected boolean parcelizeModels = false; + protected boolean serializableModel = false; + protected boolean needsDataClassBody = false; + + protected boolean nonPublicApi = false; + + protected CodegenConstants.ENUM_PROPERTY_NAMING_TYPE enumPropertyNaming = CodegenConstants.ENUM_PROPERTY_NAMING_TYPE.camelCase; + protected SERIALIZATION_LIBRARY_TYPE serializationLibrary = SERIALIZATION_LIBRARY_TYPE.moshi; + + // model classes cannot use the same property names defined in HashMap + // ref: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-hash-map/ + protected Set propertyAdditionalKeywords = new HashSet<>(Arrays.asList("entries", "keys", "size", "values")); + + private Map schemaKeyToModelNameCache = new HashMap<>(); + + public AbstractKotlinCodegen() { + super(); + + supportsInheritance = true; + setSortModelPropertiesByRequiredFlag(true); + + languageSpecificPrimitives = new HashSet<>(Arrays.asList( + "kotlin.Byte", + "kotlin.ByteArray", + "kotlin.Short", + "kotlin.Int", + "kotlin.Long", + "kotlin.Float", + "kotlin.Double", + "kotlin.Boolean", + "kotlin.Char", + "kotlin.String", + "kotlin.Array", + "kotlin.collections.List", + "kotlin.collections.MutableList", + "kotlin.collections.Map", + "kotlin.collections.MutableMap", + "kotlin.collections.Set", + "kotlin.collections.MutableSet" + )); + + // this includes hard reserved words defined by https://github.com/JetBrains/kotlin/blob/master/core/descriptors/src/org/jetbrains/kotlin/renderer/KeywordStringsGenerated.java + // as well as keywords from https://kotlinlang.org/docs/reference/keyword-reference.html + reservedWords = new HashSet<>(Arrays.asList( + "ApiResponse", // Used in the auto-generated api client + "abstract", + "actual", + "annotation", + "as", + "break", + "class", + "companion", + "const", + "constructor", + "continue", + "contract", + "crossinline", + "data", + "delegate", + "do", + "dynamic", + "else", + "enum", + "expect", + "external", + "false", + "field", + "final", + "finally", + "for", + "fun", + "if", + "import", + "in", + "infix", + "init", + "inline", + "inner", + "interface", + "internal", + "is", + "it", + "lateinit", + "noinline", + "null", + "object", + "open", + "operator", + "out", + "override", + "package", + "param", + "private", + "property", + "protected", + "public", + "receiver", + "reified", + "return", + "sealed", + "setparam", + "super", + "suspend", + "tailrec", + "this", + "throw", + "true", + "try", + "typealias", + "typeof", + "val", + "value", + "var", + "vararg", + "when", + "where", + "while" + )); + + defaultIncludes = new HashSet<>(Arrays.asList( + "kotlin.Byte", + "kotlin.ByteArray", + "kotlin.Short", + "kotlin.Int", + "kotlin.Long", + "kotlin.Float", + "kotlin.Double", + "kotlin.Boolean", + "kotlin.Char", + "kotlin.Array", + "kotlin.collections.List", + "kotlin.collections.MutableList", + "kotlin.collections.Set", + "kotlin.collections.MutableSet", + "kotlin.collections.Map", + "kotlin.collections.MutableMap" + )); + + typeMapping = new HashMap<>(); + typeMapping.put("string", "kotlin.String"); + typeMapping.put("boolean", "kotlin.Boolean"); + typeMapping.put("integer", "kotlin.Int"); + typeMapping.put("float", "kotlin.Float"); + typeMapping.put("long", "kotlin.Long"); + typeMapping.put("double", "kotlin.Double"); + typeMapping.put("ByteArray", "kotlin.ByteArray"); + typeMapping.put("number", "java.math.BigDecimal"); + typeMapping.put("decimal", "java.math.BigDecimal"); + typeMapping.put("date-time", "java.time.OffsetDateTime"); + typeMapping.put("date", "java.time.LocalDate"); + typeMapping.put("file", "java.io.File"); + typeMapping.put("array", "kotlin.Array"); + typeMapping.put("list", "kotlin.collections.List"); + typeMapping.put("set", "kotlin.collections.Set"); + typeMapping.put("map", "kotlin.collections.Map"); + typeMapping.put("object", "kotlin.Any"); + typeMapping.put("binary", "kotlin.ByteArray"); + typeMapping.put("Date", "java.time.LocalDate"); + typeMapping.put("DateTime", "java.time.OffsetDateTime"); + typeMapping.put("AnyType", "kotlin.Any"); + + instantiationTypes.put("array", "kotlin.collections.ArrayList"); + instantiationTypes.put("list", "kotlin.collections.ArrayList"); + instantiationTypes.put("map", "kotlin.collections.HashMap"); + + specialCharReplacements.put(";", "Semicolon"); + + cliOptions.clear(); + addOption(CodegenConstants.SOURCE_FOLDER, CodegenConstants.SOURCE_FOLDER_DESC, sourceFolder); + addOption(CodegenConstants.PACKAGE_NAME, "Generated artifact package name.", packageName); + addOption(CodegenConstants.API_SUFFIX, CodegenConstants.API_SUFFIX_DESC, apiSuffix); + addOption(CodegenConstants.GROUP_ID, "Generated artifact package's organization (i.e. maven groupId).", groupId); + addOption(CodegenConstants.ARTIFACT_ID, "Generated artifact id (name of jar).", artifactId); + addOption(CodegenConstants.ARTIFACT_VERSION, "Generated artifact's package version.", artifactVersion); + + CliOption enumPropertyNamingOpt = new CliOption(CodegenConstants.ENUM_PROPERTY_NAMING, CodegenConstants.ENUM_PROPERTY_NAMING_DESC); + cliOptions.add(enumPropertyNamingOpt.defaultValue(enumPropertyNaming.name())); + + CliOption serializationLibraryOpt = new CliOption(CodegenConstants.SERIALIZATION_LIBRARY, SERIALIZATION_LIBRARY_DESC); + cliOptions.add(serializationLibraryOpt.defaultValue(serializationLibrary.name())); + + cliOptions.add(new CliOption(CodegenConstants.PARCELIZE_MODELS, CodegenConstants.PARCELIZE_MODELS_DESC)); + cliOptions.add(new CliOption(CodegenConstants.SERIALIZABLE_MODEL, CodegenConstants.SERIALIZABLE_MODEL_DESC)); + cliOptions.add(new CliOption(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG_DESC)); + cliOptions.add(new CliOption(CodegenConstants.SORT_MODEL_PROPERTIES_BY_REQUIRED_FLAG, CodegenConstants.SORT_MODEL_PROPERTIES_BY_REQUIRED_FLAG_DESC)); + + cliOptions.add(CliOption.newBoolean(MODEL_MUTABLE, MODEL_MUTABLE_DESC, false)); + } + + @Override + public String apiDocFileFolder() { + return (outputFolder + File.separator + apiDocPath).replace('/', File.separatorChar); + } + + @Override + public String apiFileFolder() { + return (outputFolder + File.separator + sourceFolder + File.separator + apiPackage().replace('.', File.separatorChar)).replace('/', File.separatorChar); + } + + @Override + public String apiTestFileFolder() { + return (outputFolder + File.separator + testFolder + File.separator + apiPackage().replace('.', File.separatorChar)).replace('/', File.separatorChar); + } + + @Override + public String escapeQuotationMark(String input) { + // remove " to avoid code injection + return input.replace("\"", ""); + } + + @Override + public String escapeReservedWord(String name) { + // TODO: Allow enum escaping as an option (e.g. backticks vs append/prepend underscore vs match model property escaping). + return String.format(Locale.ROOT, "`%s`", name); + } + + @Override + public String escapeUnsafeCharacters(String input) { + return input.replace("*/", "*_/").replace("/*", "/_*"); + } + + public CodegenConstants.ENUM_PROPERTY_NAMING_TYPE getEnumPropertyNaming() { + return this.enumPropertyNaming; + } + + public SERIALIZATION_LIBRARY_TYPE getSerializationLibrary() { + return this.serializationLibrary; + } + + /** + * Sets the naming convention for Kotlin enum properties + * + * @param enumPropertyNamingType The string representation of the naming convention, as defined by CodegenConstants.ENUM_PROPERTY_NAMING_TYPE + */ + public void setEnumPropertyNaming(final String enumPropertyNamingType) { + try { + this.enumPropertyNaming = CodegenConstants.ENUM_PROPERTY_NAMING_TYPE.valueOf(enumPropertyNamingType); + } catch (IllegalArgumentException ex) { + StringBuilder sb = new StringBuilder(enumPropertyNamingType + " is an invalid enum property naming option. Please choose from:"); + for (CodegenConstants.ENUM_PROPERTY_NAMING_TYPE t : CodegenConstants.ENUM_PROPERTY_NAMING_TYPE.values()) { + sb.append("\n ").append(t.name()); + } + throw new RuntimeException(sb.toString()); + } + } + + /** + * Sets the serialization engine for Kotlin + * + * @param enumSerializationLibrary The string representation of the serialization library as defined by + * {@link AbstractKotlinCodegen.SERIALIZATION_LIBRARY_TYPE} + */ + public void setSerializationLibrary(final String enumSerializationLibrary) { + try { + this.serializationLibrary = SERIALIZATION_LIBRARY_TYPE.valueOf(enumSerializationLibrary); + } catch (IllegalArgumentException ex) { + StringBuilder sb = new StringBuilder(enumSerializationLibrary + " is an invalid enum property naming option. Please choose from:"); + for (SERIALIZATION_LIBRARY_TYPE t : SERIALIZATION_LIBRARY_TYPE.values()) { + sb.append("\n ").append(t.name()); + } + throw new RuntimeException(sb.toString()); + } + } + + @Override + public TreeMap postProcessModels(TreeMap models) { + for (CodegenSchema cm : models.values()) { + if (cm.discriminator != null) { + cm.vendorExtensions.put("x-has-data-class-body", true); + break; + } + + for (CodegenSchema var : cm.properties.values()) { + if (var.enumValueToName != null || isSerializableModel()) { + cm.vendorExtensions.put("x-has-data-class-body", true); + break; + } + } + } + return models; + } + + @Override + public void processOpts() { + super.processOpts(); + + if (StringUtils.isEmpty(System.getenv("KOTLIN_POST_PROCESS_FILE"))) { + LOGGER.info("Environment variable KOTLIN_POST_PROCESS_FILE not defined so the Kotlin code may not be properly formatted. To define it, try 'export KOTLIN_POST_PROCESS_FILE=\"/usr/local/bin/ktlint -F\"' (Linux/Mac)"); + LOGGER.info("NOTE: To enable file post-processing, 'enablePostProcessFile' must be set to `true` (--enable-post-process-file for CLI)."); + } + + if (additionalProperties.containsKey(MODEL_MUTABLE)) { + additionalProperties.put(MODEL_MUTABLE, Boolean.parseBoolean(additionalProperties.get(MODEL_MUTABLE).toString())); + } + + if (additionalProperties.containsKey(CodegenConstants.ENUM_PROPERTY_NAMING)) { + setEnumPropertyNaming((String) additionalProperties.get(CodegenConstants.ENUM_PROPERTY_NAMING)); + } + + if (additionalProperties.containsKey(CodegenConstants.SERIALIZATION_LIBRARY)) { + setSerializationLibrary((String) additionalProperties.get(CodegenConstants.SERIALIZATION_LIBRARY)); + additionalProperties.put(this.serializationLibrary.name(), true); + } else { + additionalProperties.put(this.serializationLibrary.name(), true); + } + + if (additionalProperties.containsKey(CodegenConstants.SOURCE_FOLDER)) { + this.setSourceFolder((String) additionalProperties.get(CodegenConstants.SOURCE_FOLDER)); + } else { + additionalProperties.put(CodegenConstants.SOURCE_FOLDER, sourceFolder); + } + + if (additionalProperties.containsKey(CodegenConstants.PACKAGE_NAME)) { + this.setPackageName((String) additionalProperties.get(CodegenConstants.PACKAGE_NAME)); + if (!additionalProperties.containsKey(CodegenConstants.MODEL_PACKAGE)) + this.setModelPackage(packageName + ".models"); + if (!additionalProperties.containsKey(CodegenConstants.API_PACKAGE)) + this.setApiPackage(packageName + ".apis"); + } else { + additionalProperties.put(CodegenConstants.PACKAGE_NAME, packageName); + } + + if (additionalProperties.containsKey(CodegenConstants.API_SUFFIX)) { + this.setApiSuffix((String) additionalProperties.get(CodegenConstants.API_SUFFIX)); + } + + if (additionalProperties.containsKey(CodegenConstants.ARTIFACT_ID)) { + this.setArtifactId((String) additionalProperties.get(CodegenConstants.ARTIFACT_ID)); + } else { + additionalProperties.put(CodegenConstants.ARTIFACT_ID, artifactId); + } + + if (additionalProperties.containsKey(CodegenConstants.GROUP_ID)) { + this.setGroupId((String) additionalProperties.get(CodegenConstants.GROUP_ID)); + } else { + additionalProperties.put(CodegenConstants.GROUP_ID, groupId); + } + + if (additionalProperties.containsKey(CodegenConstants.ARTIFACT_VERSION)) { + this.setArtifactVersion((String) additionalProperties.get(CodegenConstants.ARTIFACT_VERSION)); + } else { + additionalProperties.put(CodegenConstants.ARTIFACT_VERSION, artifactVersion); + } + + if (additionalProperties.containsKey(CodegenConstants.INVOKER_PACKAGE)) { + LOGGER.warn("{} with {} generator is ignored. Use {}.", CodegenConstants.INVOKER_PACKAGE, this.getName(), CodegenConstants.PACKAGE_NAME); + } + + if (additionalProperties.containsKey(CodegenConstants.SERIALIZABLE_MODEL)) { + this.setSerializableModel(convertPropertyToBooleanAndWriteBack(CodegenConstants.SERIALIZABLE_MODEL)); + } else { + additionalProperties.put(CodegenConstants.SERIALIZABLE_MODEL, serializableModel); + } + + if (additionalProperties.containsKey(CodegenConstants.LIBRARY)) { + this.setLibrary((String) additionalProperties.get(CodegenConstants.LIBRARY)); + } + + if (additionalProperties.containsKey(CodegenConstants.PARCELIZE_MODELS)) { + this.setParcelizeModels(convertPropertyToBooleanAndWriteBack(CodegenConstants.PARCELIZE_MODELS)); + } else { + additionalProperties.put(CodegenConstants.PARCELIZE_MODELS, parcelizeModels); + } + + if (additionalProperties.containsKey(CodegenConstants.NON_PUBLIC_API)) { + this.setNonPublicApi(convertPropertyToBooleanAndWriteBack(CodegenConstants.NON_PUBLIC_API)); + } else { + additionalProperties.put(CodegenConstants.NON_PUBLIC_API, nonPublicApi); + } + + additionalProperties.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, getSortParamsByRequiredFlag()); + additionalProperties.put(CodegenConstants.SORT_MODEL_PROPERTIES_BY_REQUIRED_FLAG, getSortModelPropertiesByRequiredFlag()); + + additionalProperties.put(CodegenConstants.API_PACKAGE, apiPackage()); + additionalProperties.put(CodegenConstants.MODEL_PACKAGE, modelPackage()); + + additionalProperties.put("apiDocPath", apiDocPath); + additionalProperties.put("modelDocPath", modelDocPath); + + if (isModelMutable()) { + typeMapping.put("list", "kotlin.collections.MutableList"); + typeMapping.put("set", "kotlin.collections.MutableSet"); + typeMapping.put("map", "kotlin.collections.MutableMap"); + } + } + + protected boolean isModelMutable() { + return Boolean.TRUE.equals(additionalProperties.get(MODEL_MUTABLE)); + } + + public void setArtifactId(String artifactId) { + this.artifactId = artifactId; + } + + public void setArtifactVersion(String artifactVersion) { + this.artifactVersion = artifactVersion; + } + + public void setGroupId(String groupId) { + this.groupId = groupId; + } + + public void setPackageName(String packageName) { + this.packageName = packageName; + } + + public void setApiSuffix(String apiSuffix) { + this.apiSuffix = apiSuffix; + } + + public void setSourceFolder(String sourceFolder) { + this.sourceFolder = sourceFolder; + } + + public void setTestFolder(String testFolder) { + this.testFolder = testFolder; + } + + public Boolean getParcelizeModels() { + return parcelizeModels; + } + + public void setParcelizeModels(Boolean parcelizeModels) { + this.parcelizeModels = parcelizeModels; + } + + public boolean isSerializableModel() { + return serializableModel; + } + + public void setSerializableModel(boolean serializableModel) { + this.serializableModel = serializableModel; + } + + public boolean nonPublicApi() { + return nonPublicApi; + } + + public void setNonPublicApi(boolean nonPublicApi) { + this.nonPublicApi = nonPublicApi; + } + + public boolean isNeedsDataClassBody() { + return needsDataClassBody; + } + + public void setNeedsDataClassBody(boolean needsDataClassBody) { + this.needsDataClassBody = needsDataClassBody; + } + + /** + * Return the sanitized variable name for enum + * + * @param value enum variable name + * @param prop property + * @return the sanitized variable name for enum + */ + @Override + public String toEnumVarName(String value, Schema prop) { + String modified; + if (value.length() == 0) { + modified = "EMPTY"; + } else { + modified = value; + modified = sanitizeKotlinSpecificNames(modified); + } + + switch (getEnumPropertyNaming()) { + case original: + // NOTE: This is provided as a last-case allowance, but will still result in reserved words being escaped. + modified = value; + break; + case camelCase: + // NOTE: Removes hyphens and underscores + modified = camelize(modified, true); + break; + case PascalCase: + // NOTE: Removes hyphens and underscores + String result = camelize(modified); + modified = titleCase(result); + break; + case snake_case: + // NOTE: Removes hyphens + modified = underscore(modified); + break; + case UPPERCASE: + modified = underscore(modified).toUpperCase(Locale.ROOT); + break; + } + + if (reservedWords.contains(modified)) { + return escapeReservedWord(modified); + } + // NOTE: another sanitize because camelize can create an invalid name + return sanitizeKotlinSpecificNames(modified); + } + + @Override + public String toApiName(String name) { + if (name.length() == 0) { + return "DefaultApi"; + } + return (this.apiSuffix.isEmpty() ? camelize(name) : camelize(name) + this.apiSuffix); + } + + /** + * Return the fully-qualified "Model" name for import + * + * @param name the name of the "Model" + * @return the fully-qualified "Model" name for import + */ + @Override + public String toModelImport(String name) { + // toModelImport is called while processing operations, but DefaultCodegen doesn't + // define imports correctly with fully qualified primitives and models as defined in this generator. + if (needToImport(name)) { + return super.toModelImport(name); + } + + return name; + } + + /** + * Output the proper model name (capitalized). + * In case the name belongs to the TypeSystem it won't be renamed. + * + * @param name the name of the model + * @return capitalized model name + */ + @Override + public String toModelName(final String name, String jsonPath) { + // memoization + String origName = name; + if (schemaKeyToModelNameCache.containsKey(origName)) { + return schemaKeyToModelNameCache.get(origName); + } + + // Allow for explicitly configured kotlin.* and java.* types + if (name.startsWith("kotlin.") || name.startsWith("java.")) { + return name; + } + + // If schemaMapping contains name, assume this is a legitimate model name. + if (schemaMapping.containsKey(name)) { + return schemaMapping.get(name); + } + + String modifiedName = name.replaceAll("\\.", ""); + String sanitizedName = sanitizeKotlinSpecificNames(modifiedName); + + String nameWithPrefixSuffix = sanitizedName; + if (!StringUtils.isEmpty(modelNamePrefix)) { + // add '_' so that model name can be camelized correctly + nameWithPrefixSuffix = modelNamePrefix + "_" + nameWithPrefixSuffix; + } + + if (!StringUtils.isEmpty(modelNameSuffix)) { + // add '_' so that model name can be camelized correctly + nameWithPrefixSuffix = nameWithPrefixSuffix + "_" + modelNameSuffix; + } + + // Camelize name of nested properties + modifiedName = camelize(nameWithPrefixSuffix); + + // model name cannot use reserved keyword, e.g. return + if (isReservedWord(modifiedName)) { + final String modelName = "Model" + modifiedName; + LOGGER.warn("{} (reserved word) cannot be used as model name. Renamed to {}", modifiedName, modelName); + return modelName; + } + + // model name starts with number + if (modifiedName.matches("^\\d.*")) { + final String modelName = "Model" + modifiedName; // e.g. 200Response => Model200Response (after camelize) + LOGGER.warn("{} (model name starts with number) cannot be used as model name. Renamed to {}", name, + modelName); + return modelName; + } + + schemaKeyToModelNameCache.put(origName, titleCase(modifiedName)); + return schemaKeyToModelNameCache.get(origName); + } + + @Override + public String toModelFilename(String name, String jsonPath) { + // Should be the same as the model name + return toModelName(name, jsonPath); + } + + /** + * Sanitize against Kotlin specific naming conventions, which may differ from those required by {@link DefaultCodegen#sanitizeName}. + * + * @param name string to be sanitize + * @return sanitized string + */ + private String sanitizeKotlinSpecificNames(final String name) { + String word = name; + for (Map.Entry specialCharacters : specialCharReplacements.entrySet()) { + word = replaceSpecialCharacters(word, specialCharacters); + } + + // Fallback, replace unknowns with underscore. + word = Pattern.compile("\\W+", Pattern.UNICODE_CHARACTER_CLASS).matcher(word).replaceAll("_"); + if (word.matches("\\d.*")) { + word = "_" + word; + } + + // _, __, and ___ are reserved in Kotlin. Treat all names with only underscores consistently, regardless of count. + if (word.matches("^_*$")) { + word = word.replaceAll("\\Q_\\E", "Underscore"); + } + + return word; + } + + private String replaceSpecialCharacters(String word, Map.Entry specialCharacters) { + String specialChar = specialCharacters.getKey(); + String replacementChar = specialCharacters.getValue(); + // Underscore is the only special character we'll allow + if (!specialChar.equals("_") && word.contains(specialChar)) { + return replaceCharacters(word, specialChar, replacementChar); + } + return word; + } + + private String replaceCharacters(String word, String oldValue, String newValue) { + if (!word.contains(oldValue)) { + return word; + } + if (word.equals(oldValue)) { + return newValue; + } + int i = word.indexOf(oldValue); + String start = word.substring(0, i); + String end = recurseOnEndOfWord(word, oldValue, newValue, i); + return start + newValue + end; + } + + private String recurseOnEndOfWord(String word, String oldValue, String newValue, int lastReplacedValue) { + String end = word.substring(lastReplacedValue + 1); + if (!end.isEmpty()) { + end = titleCase(end); + end = replaceCharacters(end, oldValue, newValue); + } + return end; + } + + private String titleCase(final String input) { + return input.substring(0, 1).toUpperCase(Locale.ROOT) + input.substring(1); + } + + @Override + protected boolean isReservedWord(String word) { + // We want case-sensitive escaping, to avoid unnecessary backtick-escaping. + return reservedWords.contains(word); + } + + /** + * Check the type to see if it needs import the library/module/package + * + * @param type name of the type + * @return true if the library/module/package of the corresponding type needs to be imported + */ + @Override + protected boolean needToImport(String type) { + // provides extra protection against improperly trying to import language primitives and java types + boolean imports = !type.startsWith("kotlin.") && !type.startsWith("java.") && + !defaultIncludes.contains(type) && !languageSpecificPrimitives.contains(type) && + !type.contains("."); + return imports; + } + + @Override + public String toParamName(String name) { + // to avoid conflicts with 'callback' parameter for async call + if ("callback".equals(name)) { + return "paramCallback"; + } + + // should be the same as variable name + return toVariableName(name); + } + + @Override + public String toVarName(String name) { + name = toVariableName(name); + if (propertyAdditionalKeywords.contains(name)) { + return camelize("property_" + name, true); + } else { + return name; + } + } + + protected String toVariableName(String name) { + // sanitize name + name = sanitizeName(name, "\\W-[\\$]"); + name = sanitizeKotlinSpecificNames(name); + + if (name.toLowerCase(Locale.ROOT).matches("^_*class$")) { + return "propertyClass"; + } + + if ("_".equals(name)) { + name = "_u"; + } + + // if it's all upper case, do nothing + if (name.matches("^[A-Z0-9_]*$")) { + return name; + } + + if (startsWithTwoUppercaseLetters(name)) { + name = name.substring(0, 2).toLowerCase(Locale.ROOT) + name.substring(2); + } + + // If name contains special chars -> replace them. + if ((name.chars().anyMatch(character -> specialCharReplacements.keySet().contains(String.valueOf((char) character))))) { + List allowedCharacters = new ArrayList<>(); + allowedCharacters.add("_"); + allowedCharacters.add("$"); + name = escape(name, specialCharReplacements, allowedCharacters, "_"); + } + + // camelize (lower first character) the variable name + // pet_id => petId + name = camelize(name, true); + + // for reserved word or word starting with number or containing dollar symbol, escape it + if (isReservedWord(name) || name.matches("(^\\d.*)|(.*[$].*)")) { + name = escapeReservedWord(name); + } + + return name; + } + + @Override + public CodegenPatternInfo getPatternInfo(String pattern) { + return new CodegenPatternInfo(escapeText(pattern), null); + } + + private boolean startsWithTwoUppercaseLetters(String name) { + boolean startsWithTwoUppercaseLetters = false; + if (name.length() > 1) { + startsWithTwoUppercaseLetters = name.substring(0, 2).equals(name.substring(0, 2).toUpperCase(Locale.ROOT)); + } + return startsWithTwoUppercaseLetters; + } + + @Override + public void postProcessFile(File file, String fileType) { + if (file == null) { + return; + } + + String kotlinPostProcessFile = System.getenv("KOTLIN_POST_PROCESS_FILE"); + if (StringUtils.isEmpty(kotlinPostProcessFile)) { + return; // skip if KOTLIN_POST_PROCESS_FILE env variable is not defined + } + + // only process files with kt extension + if ("kt".equals(FilenameUtils.getExtension(file.toString()))) { + String command = kotlinPostProcessFile + " " + file; + try { + Process p = Runtime.getRuntime().exec(command); + p.waitFor(); + int exitValue = p.exitValue(); + if (exitValue != 0) { + LOGGER.error("Error running the command ({}). Exit value: {}", command, exitValue); + } else { + LOGGER.info("Successfully executed: {}", command); + } + } catch (InterruptedException | IOException e) { + LOGGER.error("Error running the command ({}). Exception: {}", command, e.getMessage()); + // Restore interrupted state + Thread.currentThread().interrupt(); + } + } + } + + private String fixNumberValue(String number, Schema p) { + if (ModelUtils.isFloatSchema(p)) { + return number + "f"; + } else if (ModelUtils.isDoubleSchema(p)) { + if (number.contains(".")) { + return number; + } + return number + ".0"; + } else if (ModelUtils.isLongSchema(p)) { + return number + "L"; + } + return number; + } + + @Override + public GeneratorLanguage generatorLanguage() { + return GeneratorLanguage.KOTLIN; + } +} diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/AbstractPythonCodegen.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/AbstractPythonCodegen.java new file mode 100644 index 00000000000..ed9d12bf8ca --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/AbstractPythonCodegen.java @@ -0,0 +1,497 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapijsonschematools.codegen.languages; + +import com.github.curiousoddman.rgxgen.RgxGen; +import io.swagger.v3.oas.models.examples.Example; +import io.swagger.v3.oas.models.media.ArraySchema; +import io.swagger.v3.oas.models.media.Schema; +import io.swagger.v3.oas.models.parameters.Parameter; +import org.apache.commons.io.FilenameUtils; +import org.apache.commons.lang3.StringUtils; +import org.openapijsonschematools.codegen.CodegenConfig; +import org.openapijsonschematools.codegen.CodegenConstants; +import org.openapijsonschematools.codegen.model.CodegenParameter; +import org.openapijsonschematools.codegen.DefaultCodegen; +import org.openapijsonschematools.codegen.GeneratorLanguage; +import org.openapijsonschematools.codegen.utils.ModelUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; +import java.io.IOException; +import java.util.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.stream.Collectors; + +import static org.openapijsonschematools.codegen.utils.StringUtils.camelize; +import static org.openapijsonschematools.codegen.utils.StringUtils.underscore; + +public abstract class AbstractPythonCodegen extends DefaultCodegen implements CodegenConfig { + private final Logger LOGGER = LoggerFactory.getLogger(AbstractPythonCodegen.class); + + protected String packageVersion = "1.0.0"; + protected String projectName; // for setup.py, e.g. petstore-api + + public AbstractPythonCodegen() { + super(); + + packageName = "openapi_client"; + + // from https://docs.python.org/3/reference/lexical_analysis.html#keywords + setReservedWordsLowerCase( + Arrays.asList( + // local variable name used in API methods (endpoints) + "all_params", "resource_path", "path_params", "query_params", + "header_params", "form_params", "local_var_files", "body_params", "auth_settings", + // @property + "property", + // python reserved words + "and", "del", "from", "not", "while", "as", "elif", "global", "or", "with", + "assert", "else", "if", "pass", "yield", "break", "except", "import", + "print", "class", "exec", "in", "raise", "continue", "finally", "is", + "return", "def", "for", "lambda", "try", "self", "nonlocal", "None", "True", + "False", "async", "await", + // imports, imports_schema_types.handlebars, include these to prevent name collision + "datetime", "decimal", "functools", "io", "re", + "typing", "typing_extensions", "uuid", "frozendict", "schemas" + )); + + languageSpecificPrimitives.clear(); + languageSpecificPrimitives.add("int"); + languageSpecificPrimitives.add("float"); + languageSpecificPrimitives.add("list"); + languageSpecificPrimitives.add("dict"); + languageSpecificPrimitives.add("bool"); + languageSpecificPrimitives.add("str"); + languageSpecificPrimitives.add("datetime"); + languageSpecificPrimitives.add("date"); + languageSpecificPrimitives.add("object"); + // TODO file and binary is mapped as `file` + languageSpecificPrimitives.add("file"); + languageSpecificPrimitives.add("bytes"); + + typeMapping.clear(); + typeMapping.put("integer", "int"); + typeMapping.put("float", "float"); + typeMapping.put("number", "float"); + typeMapping.put("long", "int"); + typeMapping.put("double", "float"); + typeMapping.put("array", "list"); + typeMapping.put("set", "list"); + typeMapping.put("map", "dict"); + typeMapping.put("boolean", "bool"); + typeMapping.put("string", "str"); + typeMapping.put("date", "date"); + typeMapping.put("DateTime", "datetime"); + typeMapping.put("object", "object"); + typeMapping.put("AnyType", "object"); + typeMapping.put("file", "file"); + // TODO binary should be mapped to byte array + // mapped to String as a workaround + typeMapping.put("binary", "str"); + typeMapping.put("ByteArray", "str"); + // map uuid to string for the time being + typeMapping.put("UUID", "str"); + typeMapping.put("URI", "str"); + typeMapping.put("null", "none_type"); + } + + @Override + public void processOpts() { + super.processOpts(); + + if (StringUtils.isEmpty(System.getenv("PYTHON_POST_PROCESS_FILE"))) { + LOGGER.info("Environment variable PYTHON_POST_PROCESS_FILE not defined so the Python code may not be properly formatted. To define it, try 'export PYTHON_POST_PROCESS_FILE=\"/usr/local/bin/yapf -i\"' (Linux/Mac)"); + LOGGER.info("NOTE: To enable file post-processing, 'enablePostProcessFile' must be set to `true` (--enable-post-process-file for CLI)."); + } + } + + @Override + public String escapeReservedWord(String name) { + if (this.reservedWordsMappings().containsKey(name)) { + return this.reservedWordsMappings().get(name); + } + return "_" + name; + } + + @Override + public String toVarName(String name) { + // sanitize name + name = sanitizeName(name); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'. + + // remove dollar sign + name = name.replaceAll("$", ""); + + // if it's all upper case, convert to lower case + if (name.matches("^[A-Z_]*$")) { + name = name.toLowerCase(Locale.ROOT); + } + + // underscore the variable name + // petId => pet_id + name = underscore(name); + + // remove leading underscore + name = name.replaceAll("^_*", ""); + + // for reserved word or word starting with number, append _ + if (isReservedWord(name) || name.matches("^\\d.*")) { + name = escapeReservedWord(name); + } + + return name; + } + + @Override + public String toParamName(String name) { + // to avoid conflicts with 'callback' parameter for async call + if ("callback".equals(name)) { + return "param_callback"; + } + + // should be the same as variable name + return toVarName(name); + } + + @Override + public String escapeQuotationMark(String input) { + // remove ' to avoid code injection + return input.replace("'", ""); + } + + @Override + public String escapeUnsafeCharacters(String input) { + // remove multiline comment + return input.replace("'''", "'_'_'"); + } + + @Override + public void postProcessFile(File file, String fileType) { + if (file == null) { + return; + } + String pythonPostProcessFile = System.getenv("PYTHON_POST_PROCESS_FILE"); + if (StringUtils.isEmpty(pythonPostProcessFile)) { + return; // skip if PYTHON_POST_PROCESS_FILE env variable is not defined + } + + // only process files with py extension + if ("py".equals(FilenameUtils.getExtension(file.toString()))) { + String command = pythonPostProcessFile + " " + file; + try { + Process p = Runtime.getRuntime().exec(command); + int exitValue = p.waitFor(); + if (exitValue != 0) { + LOGGER.error("Error running the command ({}). Exit value: {}", command, exitValue); + } else { + LOGGER.info("Successfully executed: {}", command); + } + } catch (InterruptedException | IOException e) { + LOGGER.error("Error running the command ({}). Exception: {}", command, e.getMessage()); + // Restore interrupted state + Thread.currentThread().interrupt(); + } + } + } + + @Override + public String toExampleValue(Schema schema) { + return toExampleValueRecursive(schema, new ArrayList<>(), 5); + } + + private String toExampleValueRecursive(Schema schema, List includedSchemas, int indentation) { + boolean cycleFound = includedSchemas.stream().filter(s->schema.equals(s)).count() > 1; + if (cycleFound) { + return ""; + } + String indentationString = ""; + for (int i = 0; i < indentation; i++) indentationString += " "; + String example = null; + if (schema.getExample() != null) { + example = schema.getExample().toString(); + } + + if (ModelUtils.isNullType(schema) && null != example) { + // The 'null' type is allowed in OAS 3.1 and above. It is not supported by OAS 3.0.x, + // though this tooling supports it. + return "None"; + } + // correct "true"s into "True"s, since super.toExampleValue uses "toString()" on Java booleans + if (ModelUtils.isBooleanSchema(schema) && null != example) { + if ("false".equalsIgnoreCase(example)) example = "False"; + else example = "True"; + } + + // correct "'"s into "'"s after toString() + if (ModelUtils.isStringSchema(schema) && schema.getDefault() != null && !ModelUtils.isDateSchema(schema) && !ModelUtils.isDateTimeSchema(schema)) { + example = (String) schema.getDefault(); + } + + if (StringUtils.isNotBlank(example) && !"null".equals(example)) { + if (ModelUtils.isStringSchema(schema)) { + example = "'" + example + "'"; + } + return example; + } + + if (schema.getEnum() != null && !schema.getEnum().isEmpty()) { + // Enum case: + example = schema.getEnum().get(0).toString(); + if (ModelUtils.isStringSchema(schema)) { + example = "'" + escapeText(example) + "'"; + } + if (null == example) + LOGGER.warn("Empty enum. Cannot built an example!"); + + return example; + } else if (null != schema.get$ref()) { + // $ref case: + Map allDefinitions = ModelUtils.getSchemas(this.openAPI); + String ref = ModelUtils.getSimpleRef(schema.get$ref()); + if (allDefinitions != null) { + Schema refSchema = allDefinitions.get(ref); + if (null == refSchema) { + return "None"; + } else { + String refTitle = refSchema.getTitle(); + if (StringUtils.isBlank(refTitle) || "null".equals(refTitle)) { + refSchema.setTitle(ref); + } + if (StringUtils.isNotBlank(schema.getTitle()) && !"null".equals(schema.getTitle())) { + includedSchemas.add(schema); + } + return toExampleValueRecursive(refSchema, includedSchemas, indentation); + } + } else { + LOGGER.warn("allDefinitions not defined in toExampleValue!\n"); + } + } + if (ModelUtils.isDateSchema(schema)) { + example = "datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date()"; + return example; + } else if (ModelUtils.isDateTimeSchema(schema)) { + example = "datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f')"; + return example; + } else if (ModelUtils.isBinarySchema(schema)) { + example = "bytes(b'blah')"; + return example; + } else if (ModelUtils.isByteArraySchema(schema)) { + example = "YQ=="; + } else if (ModelUtils.isStringSchema(schema)) { + // a BigDecimal: + if ("Number".equalsIgnoreCase(schema.getFormat())) { + return "1"; + } + if (StringUtils.isNotBlank(schema.getPattern())) { + String pattern = schema.getPattern(); + RgxGen rgxGen = new RgxGen(patternCorrection(pattern)); + // this seed makes it so if we have [a-z] we pick a + Random random = new Random(18); + String sample = rgxGen.generate(random); + // omit leading / and trailing /, omit trailing /i + Pattern valueExtractor = Pattern.compile("^/\\^?(.+?)\\$?/.?$"); + Matcher m = valueExtractor.matcher(sample); + if (m.find()) { + example = m.group(m.groupCount()); + } else { + example = sample; + } + } + if (example == null) { + example = ""; + } + int len = 0; + if (null != schema.getMinLength()) { + len = schema.getMinLength().intValue(); + if (len < 1) { + example = ""; + } else { + for (int i = 0; i < len; i++) example += i; + } + } + } else if (ModelUtils.isIntegerSchema(schema)) { + if (schema.getMinimum() != null) + example = schema.getMinimum().toString(); + else + example = "56"; + } else if (ModelUtils.isNumberSchema(schema)) { + if (schema.getMinimum() != null) + example = schema.getMinimum().toString(); + else + example = "1.337"; + } else if (ModelUtils.isBooleanSchema(schema)) { + example = "True"; + } else if (ModelUtils.isArraySchema(schema)) { + if (StringUtils.isNotBlank(schema.getTitle()) && !"null".equals(schema.getTitle())) { + includedSchemas.add(schema); + } + ArraySchema arrayschema = (ArraySchema) schema; + example = "[\n" + indentationString + toExampleValueRecursive(arrayschema.getItems(), includedSchemas, indentation + 1) + "\n" + indentationString + "]"; + } else if (ModelUtils.isMapSchema(schema)) { + if (StringUtils.isNotBlank(schema.getTitle()) && !"null".equals(schema.getTitle())) { + includedSchemas.add(schema); + } + Object additionalObject = schema.getAdditionalProperties(); + if (additionalObject instanceof Schema) { + Schema additional = (Schema) additionalObject; + String theKey = "'key'"; + if (additional.getEnum() != null && !additional.getEnum().isEmpty()) { + theKey = additional.getEnum().get(0).toString(); + if (ModelUtils.isStringSchema(additional)) { + theKey = "'" + escapeText(theKey) + "'"; + } + } + example = "{\n" + indentationString + theKey + " : " + toExampleValueRecursive(additional, includedSchemas, indentation + 1) + "\n" + indentationString + "}"; + } else { + example = "{ }"; + } + } else if (ModelUtils.isObjectSchema(schema)) { + if (StringUtils.isBlank(schema.getTitle())) { + example = "None"; + return example; + } + + // I remove any property that is a discriminator, since it is not well supported by the python generator + String toExclude = null; + if (schema.getDiscriminator() != null) { + toExclude = schema.getDiscriminator().getPropertyName(); + } + + example = packageName + ".models." + underscore(schema.getTitle()) + "." + schema.getTitle() + "("; + + // if required only: + // List reqs = schema.getRequired(); + + // if required and optionals + List reqs = new ArrayList<>(); + if (schema.getProperties() != null && !schema.getProperties().isEmpty()) { + for (Object toAdd : schema.getProperties().keySet()) { + reqs.add((String) toAdd); + } + + Map properties = schema.getProperties(); + Set propkeys = null; + if (properties != null) propkeys = properties.keySet(); + if (toExclude != null && reqs.contains(toExclude)) { + reqs.remove(toExclude); + } + for (String toRemove : includedSchemas.stream().map(Schema::getTitle).collect(Collectors.toList())) { + if (reqs.contains(toRemove)) { + reqs.remove(toRemove); + } + } + if (StringUtils.isNotBlank(schema.getTitle()) && !"null".equals(schema.getTitle())) { + includedSchemas.add(schema); + } + if (null != schema.getRequired()) for (Object toAdd : schema.getRequired()) { + reqs.add((String) toAdd); + } + if (null != propkeys) for (String propname : propkeys) { + Schema schema2 = properties.get(propname); + if (reqs.contains(propname)) { + String refTitle = schema2.getTitle(); + if (StringUtils.isBlank(refTitle) || "null".equals(refTitle)) { + schema2.setTitle(propname); + } + example += "\n" + indentationString + underscore(propname) + " = " + + toExampleValueRecursive(schema2, includedSchemas, indentation + 1) + ", "; + } + } + } + example += ")"; + } else { + LOGGER.warn("Type {} not handled properly in toExampleValue", schema.getType()); + } + + if (ModelUtils.isStringSchema(schema)) { + example = "'" + escapeText(example) + "'"; + } + + return example; + } + + @Override + public String sanitizeTag(String tag) { + return sanitizeName(tag); + } + + public String patternCorrection(String pattern) { + // Java does not recognize starting and ending forward slashes and mode modifiers + // It considers them as characters with no special meaning and tries to find them in the match string + boolean checkEnding = pattern.endsWith("/i") || pattern.endsWith("/g") || pattern.endsWith("/m"); + if (checkEnding) pattern = pattern.substring(0, pattern.length() - 2); + if (pattern.endsWith("/")) pattern = pattern.substring(0, pattern.length() - 1); + if (pattern.startsWith("/")) pattern = pattern.substring(1); + return pattern; + } + + public void setPackageName(String packageName) { + this.packageName = packageName; + additionalProperties.put(CodegenConstants.PACKAGE_NAME, this.packageName); + } + + public void setProjectName(String projectName) { + this.projectName = projectName; + } + + public void setPackageVersion(String packageVersion) { + this.packageVersion = packageVersion; + } + + @Override + public String toModelFilename(String name, String jsonPath) { + // underscore the model file name + // PhoneNumber => phone_number + return toModuleFilename(name, jsonPath); + } + + + @Override + public String toModelTestFilename(String name) { + return "test_" + toModelFilename(name, null); + } + + @Override + public String toApiFilename(String name) { + // e.g. PhoneNumberApi.py => phone_number_api.py + return underscore(toApiName(name)); + } + + @Override + public String toApiTestFilename(String name) { + return "test_" + toApiFilename(name); + } + + @Override + public String toApiName(String name) { + return super.toApiName(name); + } + + @Override + public String toApiVarName(String name) { + return underscore(toApiName(name)); + } + + protected static String dropDots(String str) { + return str.replaceAll("\\.", "_"); + } + + @Override + public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.PYTHON; } +} diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/JMeterClientCodegen.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/JMeterClientCodegen.java new file mode 100644 index 00000000000..7c9bcc7f092 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/JMeterClientCodegen.java @@ -0,0 +1,190 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * Copyright 2018 SmartBear Software + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapijsonschematools.codegen.languages; + +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.Operation; +import io.swagger.v3.oas.models.PathItem; +import org.openapijsonschematools.codegen.CodegenConfig; +import org.openapijsonschematools.codegen.CodegenType; +import org.openapijsonschematools.codegen.DefaultCodegen; +import org.openapijsonschematools.codegen.meta.features.ClientModificationFeature; +import org.openapijsonschematools.codegen.meta.features.ParameterFeature; +import org.openapijsonschematools.codegen.meta.features.SchemaFeature; +import org.openapijsonschematools.codegen.meta.features.SecurityFeature; +import org.openapijsonschematools.codegen.meta.features.WireFormatFeature; + +import java.io.File; +import java.util.Arrays; +import java.util.EnumSet; +import java.util.HashSet; +import java.util.Map; + +public class JMeterClientCodegen extends DefaultCodegen implements CodegenConfig { + + // source folder where to write the files + protected String sourceFolder = ""; + protected String apiVersion = "1.0.0"; + + /** + * Configures the type of generator. + * + * @return the CodegenType for this generator + * @see CodegenType + */ + @Override + public CodegenType getTag() { + return CodegenType.CLIENT; + } + + /** + * Configures a friendly name for the generator. This will be used by the generator + * to select the library with the -g flag. + * + * @return the friendly name for the generator + */ + @Override + public String getName() { + return "jmeter"; + } + + /** + * Returns human-friendly help for the generator. Provide the consumer with help + * tips, parameters here + * + * @return A string value for the help message + */ + @Override + public String getHelp() { + return "Generates a JMeter .jmx file."; + } + + public JMeterClientCodegen() { + super(); + + modifyFeatureSet(features -> features + .wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML)) + .securityFeatures(EnumSet.of( + SecurityFeature.HTTP_Basic, + SecurityFeature.ApiKey, + SecurityFeature.OAuth2_Implicit + )) + .excludeSchemaFeatures( + SchemaFeature.Not + ) + .includeParameterFeatures( + ParameterFeature.In_Cookie + ) + .includeClientModificationFeatures( + ClientModificationFeature.BasePath + ) + ); + + // set the output folder here + outputFolder = "generated-code/JMeterClientCodegen"; + + /* + * Api classes. You can write classes for each Api file with the apiTemplateFiles map. + * as with models, add multiple entries with different extensions for multiple files per + * class + */ + + /* + * Template Location. This is the location which templates will be read from. The generator + * will use the resource stream to attempt to read the templates. + */ + embeddedTemplateDir = templateDir = "jmeter-client"; + + /* + * Api Package. Optional, if needed, this can be used in templates + */ + apiPackage = ""; + + /* + * Model Package. Optional, if needed, this can be used in templates + */ + modelPackage = ""; + + /* + * Reserved words. Override this with reserved words specific to your language + */ + reservedWords = new HashSet<>( + Arrays.asList( + "sample1", // replace with static values + "sample2") + ); + + /* + * Additional Properties. These values can be passed to the templates and + * are available in models, apis, and supporting files + */ + additionalProperties.put("apiVersion", apiVersion); + // supportingFiles.add(new SupportingFile("testdata-localhost.mustache", "input", "testdata-localhost.csv")); + } + + @Override + public void preprocessOpenAPI(OpenAPI openAPI) { + if (openAPI != null && openAPI.getPaths() != null) { + for (Map.Entry openAPIGetPathsEntry : openAPI.getPaths().entrySet()) { + String pathname = openAPIGetPathsEntry.getKey(); + PathItem path = openAPIGetPathsEntry.getValue(); + if (path.readOperations() != null) { + for (Operation operation : path.readOperations()) { + String pathWithDollars = pathname.replaceAll("\\{", "\\$\\{"); + operation.addExtension("x-path", pathWithDollars); + } + } + } + } + } + + /** + * Escapes a reserved word as defined in the `reservedWords` array. Handle escaping + * those terms here. This logic is only called if a variable matches the reserved words + * + * @return the escaped term + */ + @Override + public String escapeReservedWord(String name) { + if (this.reservedWordsMappings().containsKey(name)) { + return this.reservedWordsMappings().get(name); + } + return "_" + name; + } + + /** + * Location to write api files. You can use the apiPackage() as defined when the class is + * instantiated + */ + @Override + public String apiFileFolder() { + return outputFolder + File.separator + sourceFolder + File.separator + apiPackage().replace('.', File.separatorChar); + } + + @Override + public String escapeQuotationMark(String input) { + // remove ' to avoid code injection + return input.replace("'", ""); + } + + @Override + public String escapeUnsafeCharacters(String input) { + return input.replace("*/", "*_/").replace("/*", "/_*"); + } + +} diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/JavaClientCodegen.java similarity index 78% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/JavaClientCodegen.java index cedd19cfafb..4799774fbe6 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/JavaClientCodegen.java @@ -15,36 +15,32 @@ * limitations under the License. */ -package org.openapitools.codegen.languages; +package org.openapijsonschematools.codegen.languages; -import io.swagger.v3.oas.models.Operation; -import io.swagger.v3.oas.models.media.Schema; -import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.lang3.StringUtils; -import org.openapitools.codegen.*; -import org.openapitools.codegen.languages.features.BeanValidationFeatures; -import org.openapitools.codegen.languages.features.GzipFeatures; -import org.openapitools.codegen.languages.features.PerformBeanValidationFeatures; -import org.openapitools.codegen.meta.features.DocumentationFeature; -import org.openapitools.codegen.meta.features.GlobalFeature; -import org.openapitools.codegen.model.ModelMap; -import org.openapitools.codegen.model.ModelsMap; -import org.openapitools.codegen.model.OperationMap; -import org.openapitools.codegen.model.OperationsMap; -import org.openapitools.codegen.templating.mustache.CaseFormatLambda; -import org.openapitools.codegen.utils.ProcessUtils; +import org.openapijsonschematools.codegen.CliOption; +import org.openapijsonschematools.codegen.CodegenConstants; +import org.openapijsonschematools.codegen.model.CodegenSchema; +import org.openapijsonschematools.codegen.CodegenType; +import org.openapijsonschematools.codegen.SupportingFile; +import org.openapijsonschematools.codegen.VendorExtension; +import org.openapijsonschematools.codegen.languages.features.BeanValidationFeatures; +import org.openapijsonschematools.codegen.languages.features.GzipFeatures; +import org.openapijsonschematools.codegen.languages.features.PerformBeanValidationFeatures; +import org.openapijsonschematools.codegen.templating.mustache.CaseFormatLambda; +import org.openapijsonschematools.codegen.meta.features.DocumentationFeature; +import org.openapijsonschematools.codegen.meta.features.GlobalFeature; +import org.openapijsonschematools.codegen.utils.ProcessUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.File; import java.util.*; -import java.util.regex.Matcher; -import java.util.regex.Pattern; import static com.google.common.base.CaseFormat.LOWER_CAMEL; import static com.google.common.base.CaseFormat.UPPER_UNDERSCORE; import static java.util.Collections.sort; -import static org.openapitools.codegen.utils.StringUtils.camelize; +import static org.openapijsonschematools.codegen.utils.StringUtils.camelize; public class JavaClientCodegen extends AbstractJavaCodegen implements BeanValidationFeatures, PerformBeanValidationFeatures, GzipFeatures { @@ -142,15 +138,14 @@ public JavaClientCodegen() { // TODO: Move GlobalFeature.ParameterizedServer to library: jersey after moving featureSet to generatorMetadata modifyFeatureSet(features -> features .includeDocumentationFeatures(DocumentationFeature.Readme) - .includeGlobalFeatures(GlobalFeature.ParameterizedServer) ); outputFolder = "generated-code" + File.separator + "java"; embeddedTemplateDir = templateDir = "Java"; - invokerPackage = "org.openapitools.client"; + invokerPackage = "org.openapijsonschematools.client"; artifactId = "openapi-java-client"; - apiPackage = "org.openapitools.client.api"; - modelPackage = "org.openapitools.client.model"; + apiPackage = "org.openapijsonschematools.client.api"; + modelPackage = "org.openapijsonschematools.client.model"; rootJavaEEPackage = MICROPROFILE_REST_CLIENT_DEFAULT_ROOT_PACKAGE; // cliOptions default redefinition need to be updated @@ -243,14 +238,6 @@ public String getHelp() { return "Generates a Java client library (HTTP lib: Jersey (1.x, 2.x), Retrofit (2.x), OpenFeign (10.x) and more."; } - @Override - public void addOperationToGroup(String tag, String resourcePath, Operation operation, CodegenOperation co, Map> operations) { - super.addOperationToGroup(tag, resourcePath, operation, co, operations); - if (MICROPROFILE.equals(getLibrary())) { - co.subresourceOperation = !co.path.isEmpty(); - } - } - @Override public void processOpts() { if (WEBCLIENT.equals(getLibrary()) || NATIVE.equals(getLibrary())) { @@ -453,8 +440,12 @@ public void processOpts() { //TODO: add auto-generated doc to feign if (FEIGN.equals(getLibrary())) { - modelDocTemplateFiles.remove("model_doc.mustache"); - apiDocTemplateFiles.remove("api_doc.mustache"); + jsonPathDocTemplateFiles.get( + CodegenConstants.JSON_PATH_LOCATION_TYPE.SCHEMA + ).remove("model_doc.mustache"); + jsonPathDocTemplateFiles.get( + CodegenConstants.JSON_PATH_LOCATION_TYPE.API_TAG + ).remove("api_doc.mustache"); //Templates to decode response headers supportingFiles.add(new SupportingFile("model/ApiResponse.mustache", modelsFolder, "ApiResponse.java")); supportingFiles.add(new SupportingFile("ApiResponseDecoder.mustache", invokerFolder, "ApiResponseDecoder.java")); @@ -561,10 +552,7 @@ public void processOpts() { forceSerializationLibrary(SERIALIZATION_LIBRARY_JACKSON); } else if (VERTX.equals(getLibrary())) { typeMapping.put("file", "AsyncFile"); - importMapping.put("AsyncFile", "io.vertx.core.file.AsyncFile"); forceSerializationLibrary(SERIALIZATION_LIBRARY_JACKSON); - apiTemplateFiles.put("apiImpl.mustache", "Impl.java"); - apiTemplateFiles.put("rxApiImpl.mustache", ".java"); supportingFiles.remove(new SupportingFile("manifest.mustache", projectFolder, "AndroidManifest.xml")); } else if (GOOGLE_API_CLIENT.equals(getLibrary())) { forceSerializationLibrary(SERIALIZATION_LIBRARY_JACKSON); @@ -582,7 +570,12 @@ public void processOpts() { } supportingFiles.add(new SupportingFile("Oper.mustache", apiFolder, "Oper.java")); additionalProperties.put("convert", new CaseFormatLambda(LOWER_CAMEL, UPPER_UNDERSCORE)); - apiTemplateFiles.put("api.mustache", ".java"); + jsonPathTemplateFiles.put( + CodegenConstants.JSON_PATH_LOCATION_TYPE.API_ROOT_FOLDER, + new HashMap() {{ + put("api.mustache", ".java"); + }} + ); supportingFiles.add(new SupportingFile("ResponseSpecBuilders.mustache", invokerFolder, "ResponseSpecBuilders.java")); } else if (MICROPROFILE.equals(getLibrary())) { supportingFiles.clear(); // Don't need extra files provided by Java Codegen @@ -620,9 +613,6 @@ public void processOpts() { } } - apiTemplateFiles.remove("api.mustache"); - apiTemplateFiles.put("play26/api.mustache", ".java"); - supportingFiles.add(new SupportingFile("play26/ApiClient.mustache", invokerFolder, "ApiClient.java")); supportingFiles.add(new SupportingFile("play26/Play26CallFactory.mustache", invokerFolder, "Play26CallFactory.java")); supportingFiles.add(new SupportingFile("play26/Play26CallAdapterFactory.mustache", invokerFolder, @@ -665,7 +655,7 @@ public void processOpts() { // authentication related files // has OAuth defined - if (ProcessUtils.hasOAuthMethods(openAPI)) { + if (true) { // for okhttp-gson (default), check to see if OAuth is defined and included OAuth-related files accordingly if ((OKHTTP_GSON.equals(getLibrary()) || StringUtils.isEmpty(getLibrary()))) { supportingFiles.add(new SupportingFile("auth/OAuthOkHttpClient.mustache", authFolder, "OAuthOkHttpClient.java")); @@ -688,112 +678,6 @@ public void processOpts() { } } - @Override - public OperationsMap postProcessOperationsWithModels(OperationsMap objs, List allModels) { - super.postProcessOperationsWithModels(objs, allModels); - - if (useSingleRequestParameter && (JERSEY2.equals(getLibrary()) || JERSEY3.equals(getLibrary()) || OKHTTP_GSON.equals(getLibrary()))) { - // loop through operations to set x-group-parameters extenion to true if useSingleRequestParameter option is enabled - OperationMap operations = objs.getOperations(); - if (operations != null) { - List ops = operations.getOperation(); - for (CodegenOperation operation : ops) { - if (!operation.vendorExtensions.containsKey("x-group-parameters")) { - operation.vendorExtensions.put("x-group-parameters", true); - } - } - } - } - - if (RETROFIT_2.equals(getLibrary())) { - OperationMap operations = objs.getOperations(); - if (operations != null) { - List ops = operations.getOperation(); - for (CodegenOperation operation : ops) { - if (operation.hasConsumes == Boolean.TRUE) { - if (isMultipartType(operation.consumes)) { - operation.isMultipart = Boolean.TRUE; - } else { - operation.prioritizedContentTypes = prioritizeContentTypes(operation.consumes); - } - } - - if (StringUtils.isNotEmpty(operation.path) && operation.path.startsWith("/")) { - operation.path = operation.path.substring(1); - } - - // sorting operation parameters to make sure path params are parsed before query params - if (operation.allParams != null) { - sort(operation.allParams, new Comparator() { - @Override - public int compare(CodegenParameter one, CodegenParameter another) { - if (one.isPathParam && another.isQueryParam) { - return -1; - } - if (one.isQueryParam && another.isPathParam) { - return 1; - } - return 0; - } - }); - } - } - } - } - - // camelize path variables for Feign client - if (FEIGN.equals(getLibrary())) { - OperationMap operations = objs.getOperations(); - List operationList = operations.getOperation(); - Pattern methodPattern = Pattern.compile("^(.*):([^:]*)$"); - for (CodegenOperation op : operationList) { - String path = op.path; - String method = ""; - - // if a custom method is found at the end of the path, cut it off for later - Matcher m = methodPattern.matcher(path); - if (m.find()) { - path = m.group(1); - method = m.group(2); - } - - String[] items = path.split("/", -1); - - for (int i = 0; i < items.length; ++i) { - if (items[i].matches("^\\{(.*)\\}$")) { // wrap in {} - // camelize path variable - items[i] = "{" + camelize(items[i].substring(1, items[i].length() - 1), true) + "}"; - } - } - op.path = StringUtils.join(items, "/"); - // Replace the custom method on the path if one was found earlier - if (!method.isEmpty()) { - op.path += ":" + method; - } - } - } - - if (MICROPROFILE.equals(getLibrary())) { - objs = AbstractJavaJAXRSServerCodegen.jaxrsPostProcessOperations(objs); - } - - return objs; - } - - @Override - public String apiFilename(String templateName, String tag) { - if (VERTX.equals(getLibrary())) { - String suffix = apiTemplateFiles().get(templateName); - String subFolder = ""; - if (templateName.startsWith("rx")) { - subFolder = "/rxjava"; - } - return apiFileFolder() + subFolder + '/' + toApiFilename(tag) + suffix; - } else { - return super.apiFilename(templateName, tag); - } - } - /** * Prioritizes consumes mime-type list by moving json-vendor and json mime-types up front, but * otherwise preserves original consumes definition order. @@ -836,9 +720,9 @@ private static boolean isMultipartType(List> consumes) { } @Override - public void postProcessModelProperty(CodegenModel model, CodegenProperty property) { + public void postProcessModelProperty(CodegenSchema model, CodegenSchema property) { super.postProcessModelProperty(model, property); - if (!BooleanUtils.toBoolean(model.isEnum)) { + if (model.enumValueToName == null) { //final String lib = getLibrary(); //Needed imports for Jackson based libraries if (additionalProperties.containsKey(SERIALIZATION_LIBRARY_JACKSON)) { @@ -869,134 +753,13 @@ public void postProcessModelProperty(CodegenModel model, CodegenProperty propert model.imports.remove("ToStringSerializer"); } - if ("set".equals(property.containerType) && !JACKSON.equals(serializationLibrary)) { + if (property.types != null && property.types.contains("array") && property.uniqueItems && !JACKSON.equals(serializationLibrary)) { // clean-up model.imports.remove("JsonDeserialize"); property.vendorExtensions.remove("x-setter-extra-annotation"); } } - @Override - public CodegenModel fromModel(String name, Schema model) { - CodegenModel codegenModel = super.fromModel(name, model); - if (MICROPROFILE.equals(getLibrary())) { - if (codegenModel.imports.contains("ApiModel")) { - // Remove io.swagger.annotations.ApiModel import - codegenModel.imports.remove("ApiModel"); - } - } - return codegenModel; - } - - @Override - public ModelsMap postProcessModelsEnum(ModelsMap objs) { - objs = super.postProcessModelsEnum(objs); - //Needed import for Gson based libraries - if (additionalProperties.containsKey(SERIALIZATION_LIBRARY_GSON)) { - List> imports = objs.getImports(); - for (ModelMap mo : objs.getModels()) { - CodegenModel cm = mo.getModel(); - // for enum model - if (Boolean.TRUE.equals(cm.isEnum) && cm.allowableValues != null) { - cm.imports.add(importMapping.get("SerializedName")); - Map item = new HashMap(); - item.put("import", importMapping.get("SerializedName")); - imports.add(item); - } - } - } - return objs; - } - - @SuppressWarnings("unchecked") - @Override - public ModelsMap postProcessModels(ModelsMap objs) { - objs = super.postProcessModels(objs); - List models = objs.getModels(); - - if (additionalProperties.containsKey(SERIALIZATION_LIBRARY_JACKSON) && !JERSEY1.equals(getLibrary())) { - List> imports = objs.getImports(); - for (ModelMap mo : models) { - CodegenModel cm = mo.getModel(); - boolean addImports = false; - - for (CodegenProperty var : cm.vars) { - if (this.openApiNullable) { - boolean isOptionalNullable = Boolean.FALSE.equals(var.required) && Boolean.TRUE.equals(var.isNullable); - // only add JsonNullable and related imports to optional and nullable values - addImports |= isOptionalNullable; - var.getVendorExtensions().put("x-is-jackson-optional-nullable", isOptionalNullable); - findByName(var.name, cm.readOnlyVars) - .ifPresent(p -> p.getVendorExtensions().put("x-is-jackson-optional-nullable", isOptionalNullable)); - } - - if (Boolean.TRUE.equals(var.getVendorExtensions().get("x-enum-as-string"))) { - // treat enum string as just string - var.datatypeWithEnum = var.dataType; - - if (StringUtils.isNotEmpty(var.defaultValue)) { // has default value - String defaultValue = var.defaultValue.substring(var.defaultValue.lastIndexOf('.') + 1); - for (Map enumVars : (List>) var.getAllowableValues().get("enumVars")) { - if (defaultValue.equals(enumVars.get("name"))) { - // update default to use the string directly instead of enum string - var.defaultValue = (String) enumVars.get("value"); - } - } - } - - // add import for Set, HashSet - cm.imports.add("Set"); - Map importsSet = new HashMap<>(); - importsSet.put("import", "java.util.Set"); - imports.add(importsSet); - Map importsHashSet = new HashMap<>(); - importsHashSet.put("import", "java.util.HashSet"); - imports.add(importsHashSet); - } - - } - - if (addImports) { - Map imports2Classnames = new HashMap<>(); - imports2Classnames.put("JsonNullable", "org.openapitools.jackson.nullable.JsonNullable"); - imports2Classnames.put("NoSuchElementException", "java.util.NoSuchElementException"); - imports2Classnames.put("JsonIgnore", "com.fasterxml.jackson.annotation.JsonIgnore"); - for (Map.Entry entry : imports2Classnames.entrySet()) { - cm.imports.add(entry.getKey()); - Map importsItem = new HashMap<>(); - importsItem.put("import", entry.getValue()); - imports.add(importsItem); - } - } - } - } - - // add implements for serializable/parcelable to all models - for (ModelMap mo : models) { - CodegenModel cm = mo.getModel(); - - cm.getVendorExtensions().putIfAbsent("x-implements", new ArrayList()); - if (JERSEY2.equals(getLibrary()) || JERSEY3.equals(getLibrary()) || NATIVE.equals(getLibrary()) || OKHTTP_GSON.equals(getLibrary())) { - if (cm.oneOf != null && !cm.oneOf.isEmpty() && cm.oneOf.contains("ModelNull")) { - // if oneOf contains "null" type - cm.isNullable = true; - cm.oneOf.remove("ModelNull"); - } - - if (cm.anyOf != null && !cm.anyOf.isEmpty() && cm.anyOf.contains("ModelNull")) { - // if anyOf contains "null" type - cm.isNullable = true; - cm.anyOf.remove("ModelNull"); - } - } - if (this.parcelableModel) { - ((ArrayList) cm.getVendorExtensions().get("x-implements")).add("Parcelable"); - } - } - - return objs; - } - public void setUseOneOfDiscriminatorLookup(boolean useOneOfDiscriminatorLookup) { this.useOneOfDiscriminatorLookup = useOneOfDiscriminatorLookup; } @@ -1127,9 +890,9 @@ public void forceSerializationLibrary(String serializationLibrary) { } @Override - public Map postProcessSupportingFileData(Map objs) { - generateYAMLSpecFile(objs); - return super.postProcessSupportingFileData(objs); + public Map postProcessSupportingFileData(Map data) { + generateYAMLSpecFile(data); + return super.postProcessSupportingFileData(data); } @Override @@ -1141,17 +904,6 @@ public String toApiVarName(String name) { return apiVarName; } - @Override - public void addImportsToOneOfInterface(List> imports) { - for (String i : Arrays.asList("JsonSubTypes", "JsonTypeInfo", "JsonIgnoreProperties")) { - Map oneImport = new HashMap<>(); - oneImport.put("import", importMapping.get(i)); - if (!imports.contains(oneImport)) { - imports.add(oneImport); - } - } - } - @Override public List getSupportedVendorExtensions() { List extensions = super.getSupportedVendorExtensions(); diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/JavaJerseyServerCodegen.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/JavaJerseyServerCodegen.java similarity index 77% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/JavaJerseyServerCodegen.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/JavaJerseyServerCodegen.java index 9f92940ae97..f3a33ab3134 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/JavaJerseyServerCodegen.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/JavaJerseyServerCodegen.java @@ -15,16 +15,18 @@ * limitations under the License. */ -package org.openapitools.codegen.languages; +package org.openapijsonschematools.codegen.languages; -import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.lang3.StringUtils; -import org.openapitools.codegen.*; -import org.openapitools.codegen.meta.features.DocumentationFeature; -import org.openapitools.codegen.model.ModelMap; -import org.openapitools.codegen.model.ModelsMap; +import org.openapijsonschematools.codegen.CliOption; +import org.openapijsonschematools.codegen.CodegenConstants; +import org.openapijsonschematools.codegen.model.CodegenSchema; +import org.openapijsonschematools.codegen.SupportingFile; +import org.openapijsonschematools.codegen.meta.features.DocumentationFeature; -import java.util.*; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; public class JavaJerseyServerCodegen extends AbstractJavaJAXRSServerCodegen { @@ -43,17 +45,21 @@ public JavaJerseyServerCodegen() { outputFolder = "generated-code/JavaJaxRS-Jersey"; - apiTemplateFiles.put("apiService.mustache", ".java"); - apiTemplateFiles.put("apiServiceImpl.mustache", ".java"); - apiTemplateFiles.put("apiServiceFactory.mustache", ".java"); apiTestTemplateFiles.clear(); // TODO: add test template // clear model and api doc template as this codegen // does not support auto-generated markdown doc at the moment //TODO: add doc templates - modelDocTemplateFiles.remove("model_doc.mustache"); - apiDocTemplateFiles.remove("api_doc.mustache"); - + Map modelDocTemplates = jsonPathDocTemplateFiles.get( + CodegenConstants.JSON_PATH_LOCATION_TYPE.SCHEMA + ); + if (modelDocTemplates != null) { + modelDocTemplates.remove("model_doc.mustache"); + } + HashMap temp = (HashMap) jsonPathDocTemplateFiles.get( + CodegenConstants.JSON_PATH_LOCATION_TYPE.API_TAG + ); + temp.remove("api_doc.mustache"); embeddedTemplateDir = templateDir = JAXRS_TEMPLATE_DIRECTORY_NAME; CliOption library = new CliOption(CodegenConstants.LIBRARY, CodegenConstants.LIBRARY_DESC).defaultValue(DEFAULT_JERSEY_LIBRARY); @@ -76,19 +82,15 @@ public String getHelp() { } @Override - public void postProcessModelProperty(CodegenModel model, CodegenProperty property) { + public void postProcessModelProperty(CodegenSchema model, CodegenSchema property) { super.postProcessModelProperty(model, property); if ("null".equals(property.example)) { property.example = null; } //Add imports for Jackson - if (!BooleanUtils.toBoolean(model.isEnum)) { + if (model.enumValueToName == null) { model.imports.add("JsonProperty"); - - if (BooleanUtils.toBoolean(model.hasEnums)) { - model.imports.add("JsonValue"); - } } } @@ -133,25 +135,4 @@ public void processOpts() { openApiNullable = false; } - - @Override - public ModelsMap postProcessModelsEnum(ModelsMap objs) { - objs = super.postProcessModelsEnum(objs); - - //Add imports for Jackson - List> imports = objs.getImports(); - for (ModelMap mo : objs.getModels()) { - CodegenModel cm = mo.getModel(); - // for enum model - if (Boolean.TRUE.equals(cm.isEnum) && cm.allowableValues != null) { - cm.imports.add(importMapping.get("JsonValue")); - Map item = new HashMap(); - item.put("import", importMapping.get("JsonValue")); - imports.add(item); - } - } - - return objs; - } - } diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/KotlinClientCodegen.java similarity index 80% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/KotlinClientCodegen.java index 6b9dd53321d..5b7ece1f7d6 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/KotlinClientCodegen.java @@ -15,37 +15,28 @@ * limitations under the License. */ -package org.openapitools.codegen.languages; +package org.openapijsonschematools.codegen.languages; import java.io.File; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.function.Predicate; +import java.util.TreeMap; import java.util.stream.Collectors; import java.util.stream.Stream; -import org.apache.commons.lang3.StringUtils; -import org.openapitools.codegen.CliOption; -import org.openapitools.codegen.CodegenConstants; -import org.openapitools.codegen.CodegenModel; -import org.openapitools.codegen.CodegenOperation; -import org.openapitools.codegen.CodegenParameter; -import org.openapitools.codegen.CodegenProperty; -import org.openapitools.codegen.CodegenType; -import org.openapitools.codegen.SupportingFile; -import org.openapitools.codegen.meta.features.ClientModificationFeature; -import org.openapitools.codegen.meta.features.DocumentationFeature; -import org.openapitools.codegen.meta.features.GlobalFeature; -import org.openapitools.codegen.meta.features.ParameterFeature; -import org.openapitools.codegen.meta.features.SchemaSupportFeature; -import org.openapitools.codegen.meta.features.SecurityFeature; -import org.openapitools.codegen.meta.features.WireFormatFeature; -import org.openapitools.codegen.model.ModelMap; -import org.openapitools.codegen.model.ModelsMap; -import org.openapitools.codegen.model.OperationMap; -import org.openapitools.codegen.model.OperationsMap; -import org.openapitools.codegen.utils.ProcessUtils; +import org.openapijsonschematools.codegen.CliOption; +import org.openapijsonschematools.codegen.CodegenConstants; +import org.openapijsonschematools.codegen.meta.features.SchemaFeature; +import org.openapijsonschematools.codegen.model.CodegenSchema; +import org.openapijsonschematools.codegen.CodegenType; +import org.openapijsonschematools.codegen.SupportingFile; +import org.openapijsonschematools.codegen.meta.features.ClientModificationFeature; +import org.openapijsonschematools.codegen.meta.features.DocumentationFeature; +import org.openapijsonschematools.codegen.meta.features.ParameterFeature; +import org.openapijsonschematools.codegen.meta.features.SecurityFeature; +import org.openapijsonschematools.codegen.meta.features.WireFormatFeature; +import org.openapijsonschematools.codegen.utils.ProcessUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -156,36 +147,46 @@ public KotlinClientCodegen() { SecurityFeature.OAuth2_ClientCredentials, SecurityFeature.OAuth2_Implicit ) - .excludeGlobalFeatures( - GlobalFeature.XMLStructureDefinitions, - GlobalFeature.Callbacks, - GlobalFeature.LinkObjects, - GlobalFeature.ParameterStyling - ) - .excludeSchemaSupportFeatures( - SchemaSupportFeature.Polymorphism + .excludeSchemaFeatures( + SchemaFeature.Not ) .excludeParameterFeatures( - ParameterFeature.Cookie + ParameterFeature.In_Cookie ) .includeClientModificationFeatures(ClientModificationFeature.BasePath) ); artifactId = "kotlin-client"; - packageName = "org.openapitools.client"; + packageName = "org.openapijsonschematools.client"; // cliOptions default redefinition need to be updated updateOption(CodegenConstants.ARTIFACT_ID, this.artifactId); updateOption(CodegenConstants.PACKAGE_NAME, this.packageName); outputFolder = "generated-code" + File.separator + "kotlin-client"; - modelTemplateFiles.put("model.mustache", ".kt"); + jsonPathTemplateFiles.put( + CodegenConstants.JSON_PATH_LOCATION_TYPE.SCHEMA, + new HashMap() {{ + put("model.mustache", ".kt"); + }} + ); if (generateRoomModels) { - modelTemplateFiles.put("model_room.mustache", ".kt"); - } - apiTemplateFiles.put("api.mustache", ".kt"); - modelDocTemplateFiles.put("model_doc.mustache", ".md"); - apiDocTemplateFiles.put("api_doc.mustache", ".md"); + jsonPathTemplateFiles.get(CodegenConstants.JSON_PATH_LOCATION_TYPE.SCHEMA).put( + "model_room.mustache", ".kt" + ); + } + jsonPathDocTemplateFiles.put( + CodegenConstants.JSON_PATH_LOCATION_TYPE.SCHEMA, + new HashMap() {{ + put("model_doc.mustache", ".md"); + }} + ); + jsonPathDocTemplateFiles.put( + CodegenConstants.JSON_PATH_LOCATION_TYPE.API_TAG, + new HashMap() {{ + put("api_doc.mustache", ".md"); + }} + ); embeddedTemplateDir = templateDir = "kotlin-client"; apiPackage = packageName + ".apis"; modelPackage = packageName + ".models"; @@ -332,17 +333,6 @@ public void setRoomModelPackage(String roomModelPackage) { this.roomModelPackage = roomModelPackage; } - @Override - public String modelFilename(String templateName, String modelName) { - String suffix = modelTemplateFiles().get(templateName); - // If this was a proper template method, i wouldn't have to make myself throw up by doing this.... - if (getGenerateRoomModels() && suffix.startsWith("RoomModel")) { - return roomModelFileFolder() + File.separator + toModelFilename(modelName) + suffix; - } else { - return modelFileFolder() + File.separator + toModelFilename(modelName) + suffix; - } - } - public String roomModelFileFolder() { return outputFolder + File.separator + sourceFolder + File.separator + roomModelPackage.replace('.', File.separatorChar); } @@ -464,7 +454,7 @@ public void processOpts() { } if (usesRetrofit2Library()) { - boolean hasOAuthMethods = ProcessUtils.hasOAuthMethods(openAPI); + boolean hasOAuthMethods = true; if (hasOAuthMethods) { supportingFiles.add(new SupportingFile("auth/OAuth.kt.mustache", authFolder, "OAuth.kt")); @@ -507,18 +497,15 @@ private void processRequestDateConverter() { private void processThreeTenBpDate(String dateLibrary) { additionalProperties.put(DateLibrary.THREETENBP.value, true); typeMapping.put("date", "LocalDate"); - importMapping.put("LocalDate", "org.threeten.bp.LocalDate"); defaultIncludes.add("org.threeten.bp.LocalDate"); if (dateLibrary.equals(DateLibrary.THREETENBP.value)) { typeMapping.put("date-time", "org.threeten.bp.OffsetDateTime"); typeMapping.put("DateTime", "OffsetDateTime"); - importMapping.put("OffsetDateTime", "org.threeten.bp.OffsetDateTime"); defaultIncludes.add("org.threeten.bp.OffsetDateTime"); } else if (dateLibrary.equals(DateLibrary.THREETENBP_LOCALDATETIME.value)) { typeMapping.put("date-time", "org.threeten.bp.LocalDateTime"); typeMapping.put("DateTime", "LocalDateTime"); - importMapping.put("LocalDateTime", "org.threeten.bp.LocalDateTime"); defaultIncludes.add("org.threeten.bp.LocalDateTime"); } } @@ -536,11 +523,9 @@ private void processJava8Date(String dateLibrary) { if (dateLibrary.equals(DateLibrary.JAVA8.value)) { typeMapping.put("date-time", "java.time.OffsetDateTime"); typeMapping.put("DateTime", "OffsetDateTime"); - importMapping.put("OffsetDateTime", "java.time.OffsetDateTime"); } else if (dateLibrary.equals(DateLibrary.JAVA8_LOCALDATETIME.value)) { typeMapping.put("date-time", "java.time.LocalDateTime"); typeMapping.put("DateTime", "LocalDateTime"); - importMapping.put("LocalDateTime", "java.time.LocalDateTime"); } } @@ -562,7 +547,9 @@ private void processJVMVolleyLibrary(String infrastructureFolder, String request this.setGenerateRoomModels(convertPropertyToBooleanAndWriteBack(GENERATE_ROOM_MODELS)); // Hide this option behind a property getter and setter in case we need to check it elsewhere if (getGenerateRoomModels()) { - modelTemplateFiles.put("model_room.mustache", "RoomModel.kt"); + jsonPathTemplateFiles.get(CodegenConstants.JSON_PATH_LOCATION_TYPE.SCHEMA).put( + "model_room.mustache", "RoomModel.kt" + ); supportingFiles.add(new SupportingFile("infrastructure/ITransformForStorage.mustache", infrastructureFolder, "ITransformForStorage.kt")); } @@ -651,8 +638,6 @@ private void processJVMKtorLibrary(final String infrastructureFolder) { defaultIncludes.add("io.ktor.client.request.forms.InputProvider"); - importMapping.put("InputProvider", "io.ktor.client.request.forms.InputProvider"); - supportingFiles.add(new SupportingFile("infrastructure/ApiAbstractions.kt.mustache", infrastructureFolder, "ApiAbstractions.kt")); supportingFiles.add(new SupportingFile("infrastructure/ApiClient.kt.mustache", infrastructureFolder, "ApiClient.kt")); supportingFiles.add(new SupportingFile("infrastructure/HttpResponse.kt.mustache", infrastructureFolder, "HttpResponse.kt")); @@ -706,19 +691,6 @@ private void processMultiplatformLibrary(final String infrastructureFolder) { typeMapping.put("ByteArray", "Base64ByteArray"); typeMapping.put("object", "kotlin.String"); // kotlin.Any not serializable - // multiplatform import mapping - importMapping.put("BigDecimal", "kotlin.Double"); - importMapping.put("UUID", "kotlin.String"); - importMapping.put("URI", "kotlin.String"); - importMapping.put("InputProvider", "io.ktor.client.request.forms.InputProvider"); - importMapping.put("File", packageName + ".infrastructure.OctetByteArray"); - importMapping.put("Timestamp", "kotlin.String"); - importMapping.put("LocalDateTime", "kotlin.String"); - importMapping.put("LocalDate", "kotlin.String"); - importMapping.put("LocalTime", "kotlin.String"); - importMapping.put("Base64ByteArray", packageName + ".infrastructure.Base64ByteArray"); - importMapping.put("OctetByteArray", packageName + ".infrastructure.OctetByteArray"); - // multiplatform specific supporting files supportingFiles.add(new SupportingFile("infrastructure/Base64ByteArray.kt.mustache", infrastructureFolder, "Base64ByteArray.kt")); supportingFiles.add(new SupportingFile("infrastructure/Bytes.kt.mustache", infrastructureFolder, "Bytes.kt")); @@ -771,30 +743,26 @@ private void commonSupportingFiles() { } @Override - public ModelsMap postProcessModels(ModelsMap objs) { - ModelsMap objects = super.postProcessModels(objs); + public TreeMap postProcessModels(TreeMap models) { + TreeMap objects = super.postProcessModels(models); - for (ModelMap mo : objects.getModels()) { - CodegenModel cm = mo.getModel(); + for (CodegenSchema cm: objects.values()) { if (getGenerateRoomModels()) { cm.vendorExtensions.put("x-has-data-class-body", true); } // escape the variable base name for use as a string literal - List vars = Stream.of( - cm.vars, - cm.allVars, - cm.optionalVars, - cm.requiredVars, - cm.readOnlyVars, - cm.readWriteVars, - cm.parentVars + List vars = Stream.of( + cm.optionalProperties.values().stream().collect(Collectors.toList()), + cm.requiredProperties.values().stream().collect(Collectors.toList()) ) .flatMap(List::stream) .collect(Collectors.toList()); - for (CodegenProperty var : vars) { - var.vendorExtensions.put(VENDOR_EXTENSION_BASE_NAME_LITERAL, var.baseName.replace("$", "\\$")); + for (CodegenSchema var : vars) { + if (var.jsonPathPiece != null) { + var.vendorExtensions.put(VENDOR_EXTENSION_BASE_NAME_LITERAL, var.jsonPathPiece.original.replace("$", "\\$")); + } } } @@ -805,92 +773,6 @@ private boolean usesRetrofit2Library() { return getLibrary() != null && getLibrary().contains(JVM_RETROFIT2); } - @Override - public OperationsMap postProcessOperationsWithModels(OperationsMap objs, List allModels) { - super.postProcessOperationsWithModels(objs, allModels); - OperationMap operations = objs.getOperations(); - if (operations != null) { - List ops = operations.getOperation(); - for (CodegenOperation operation : ops) { - - if (JVM_RETROFIT2.equals(getLibrary()) && StringUtils.isNotEmpty(operation.path) && operation.path.startsWith("/")) { - operation.path = operation.path.substring(1); - } - - if (JVM_OKHTTP.equals(getLibrary()) || JVM_OKHTTP3.equals(getLibrary()) || JVM_OKHTTP4.equals(getLibrary())) { - // Ideally we would do content negotiation to choose the best mediatype, but that would be a next step. - // For now we take the first mediatype we can parse and send that. - Predicate> isSerializable = typeMapping -> { - String mediaTypeValue = typeMapping.get("mediaType"); - if (mediaTypeValue == null) - return false; - // match on first part in mediaTypes like 'application/json; charset=utf-8' - int endIndex = mediaTypeValue.indexOf(';'); - String mediaType = (endIndex == -1 - ? mediaTypeValue - : mediaTypeValue.substring(0, endIndex) - ).trim(); - return "multipart/form-data".equals(mediaType) - || "application/x-www-form-urlencoded".equals(mediaType) - || (mediaType.startsWith("application/") && mediaType.endsWith("json")); - }; - operation.consumes = operation.consumes == null ? null : operation.consumes.stream() - .filter(isSerializable) - .limit(1) - .collect(Collectors.toList()); - operation.hasConsumes = operation.consumes != null && !operation.consumes.isEmpty(); - - operation.produces = operation.produces == null ? null : operation.produces.stream() - .filter(isSerializable) - .collect(Collectors.toList()); - operation.hasProduces = operation.produces != null && !operation.produces.isEmpty(); - } - - // set multipart against all relevant operations - if (operation.hasConsumes == Boolean.TRUE) { - if (isMultipartType(operation.consumes)) { - operation.isMultipart = Boolean.TRUE; - } - } - - // import okhttp3.MultipartBody if any parameter is a file - for (CodegenParameter param : operation.allParams) { - if (Boolean.TRUE.equals(param.isFile)) { - operations.put("x-kotlin-multipart-import", true); - } - } - - if (usesRetrofit2Library() && StringUtils.isNotEmpty(operation.path) && operation.path.startsWith("/")) { - operation.path = operation.path.substring(1); - } - - // sorting operation parameters to make sure path params are parsed before query params - if (operation.allParams != null) { - sort(operation.allParams, (one, another) -> { - if (one.isPathParam && another.isQueryParam) { - return -1; - } - if (one.isQueryParam && another.isPathParam) { - return 1; - } - - return 0; - }); - } - - // modify the data type of binary form parameters to a more friendly type for ktor builds - if ((JVM_KTOR.equals(getLibrary()) || MULTIPLATFORM.equals(getLibrary())) && operation.allParams != null) { - for (CodegenParameter param : operation.allParams) { - if (param.dataFormat != null && param.dataFormat.equals("binary")) { - param.baseType = param.dataType = "io.ktor.client.request.forms.InputProvider"; - } - } - } - } - } - return objs; - } - private static boolean isMultipartType(List> consumes) { Map firstType = consumes.get(0); if (firstType != null) { @@ -902,9 +784,9 @@ private static boolean isMultipartType(List> consumes) { @Override public void postProcess() { System.out.println("################################################################################"); - System.out.println("# Thanks for using OpenAPI Generator. #"); + System.out.println("# Thanks for using OpenAPI JSON Schema Generator. #"); System.out.println("# Please consider donation to help us maintain this project \uD83D\uDE4F #"); - System.out.println("# https://opencollective.com/openapi_generator/donate #"); + System.out.println("# https://github.com/sponsors/spacether #"); System.out.println("# #"); System.out.println("# This generator's contributed by Jim Schubert (https://github.com/jimschubert)#"); System.out.println("# Please support his work directly via https://patreon.com/jimschubert \uD83D\uDE4F #"); diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/PythonClientCodegen.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/PythonClientCodegen.java new file mode 100644 index 00000000000..2777b6a983a --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/PythonClientCodegen.java @@ -0,0 +1,2050 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapijsonschematools.codegen.languages; + +import com.github.curiousoddman.rgxgen.RgxGen; +import com.github.curiousoddman.rgxgen.config.RgxGenOption; +import com.github.curiousoddman.rgxgen.config.RgxGenProperties; +import com.google.common.base.CaseFormat; +import io.swagger.v3.oas.models.OpenAPI; + +import org.apache.commons.io.FileUtils; +import org.openapijsonschematools.codegen.CliOption; +import org.openapijsonschematools.codegen.CodegenConstants; +import org.openapijsonschematools.codegen.meta.features.ComponentsFeature; +import org.openapijsonschematools.codegen.meta.features.OperationFeature; +import org.openapijsonschematools.codegen.meta.features.SchemaFeature; +import org.openapijsonschematools.codegen.model.CodegenDiscriminator; +import org.openapijsonschematools.codegen.model.CodegenPatternInfo; +import org.openapijsonschematools.codegen.model.CodegenSchema; +import org.openapijsonschematools.codegen.CodegenType; +import org.openapijsonschematools.codegen.SupportingFile; +import org.openapijsonschematools.codegen.TemplateManager; +import org.openapijsonschematools.codegen.meta.features.DataTypeFeature; +import org.openapijsonschematools.codegen.meta.features.DocumentationFeature; +import org.openapijsonschematools.codegen.meta.features.GlobalFeature; +import org.openapijsonschematools.codegen.meta.features.ParameterFeature; +import org.openapijsonschematools.codegen.meta.features.SecurityFeature; +import org.openapijsonschematools.codegen.meta.features.WireFormatFeature; +import org.openapijsonschematools.codegen.model.PairCacheKey; +import org.openapijsonschematools.codegen.templating.CommonTemplateContentLocator; +import org.openapijsonschematools.codegen.templating.GeneratorTemplateContentLocator; +import org.openapijsonschematools.codegen.templating.HandlebarsEngineAdapter; +import org.openapijsonschematools.codegen.templating.TemplateManagerOptions; +import org.openapijsonschematools.codegen.api.TemplatePathLocator; +import org.openapijsonschematools.codegen.config.GlobalSettings; +import org.openapijsonschematools.codegen.ignore.CodegenIgnoreProcessor; +import io.swagger.v3.oas.models.media.*; +import io.swagger.v3.oas.models.parameters.Parameter; +import io.swagger.v3.oas.models.security.SecurityScheme; +import org.apache.commons.lang3.StringUtils; +import org.openapijsonschematools.codegen.model.CodegenDiscriminator.MappedModel; +import org.openapijsonschematools.codegen.api.TemplatingEngineAdapter; +import org.openapijsonschematools.codegen.meta.GeneratorMetadata; +import org.openapijsonschematools.codegen.meta.Stability; +import org.openapijsonschematools.codegen.utils.ModelUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.openapijsonschematools.codegen.api.TemplateProcessor; + +import java.io.File; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.ZoneOffset; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static org.openapijsonschematools.codegen.utils.StringUtils.camelize; +import static org.openapijsonschematools.codegen.utils.StringUtils.underscore; + +@SuppressWarnings("rawtypes") +public class PythonClientCodegen extends AbstractPythonCodegen { + private final Logger LOGGER = LoggerFactory.getLogger(PythonClientCodegen.class); + + public static final String PACKAGE_URL = "packageUrl"; + public static final String DEFAULT_LIBRARY = "urllib3"; + // nose is a python testing framework, we use pytest if USE_NOSE is unset + public static final String USE_NOSE = "useNose"; + public static final String RECURSION_LIMIT = "recursionLimit"; + private final Pattern patternRegex = Pattern.compile("^/?(.+?)/?([simu]{0,4})$"); + + protected String packageUrl; + protected String apiDocPath = "docs/apis/tags/"; + // keep this in case the user has provided a custom model path + // todo connect that custom path in here + protected String modelDocPath = "docs/components/schema/"; + protected boolean useNose = false; + + protected Map regexModifiers; + + private final String testFolder; + + // A cache to efficiently look up a Schema instance based on the return value of `toModelName()`. + private Map modelNameToSchemaCache; + private final DateTimeFormatter iso8601Date = DateTimeFormatter.ISO_DATE; + private final DateTimeFormatter iso8601DateTime = DateTimeFormatter.ISO_DATE_TIME; + + protected CodegenIgnoreProcessor ignoreProcessor; + protected TemplateProcessor templateProcessor = null; + private boolean nonCompliantUseDiscrIfCompositionFails = false; + private final HashMap modelNameCache = new HashMap<>(); + + public PythonClientCodegen() { + super(); + loadDeepObjectIntoItems = false; + importBaseType = false; + addSchemaImportsFromV3SpecLocations = true; + sortModelPropertiesByRequiredFlag = Boolean.TRUE; + // this must be false for parameter numbers to stay the same as the ones in the spec + // if another schema $refs a schema in a parameter, the json path + // and generated module must have the same parameter index as the spec + sortParamsByRequiredFlag = Boolean.FALSE; + removeEnumValuePrefix = false; + + modifyFeatureSet(features -> features + .includeDataTypeFeatures( + DataTypeFeature.Int32, + DataTypeFeature.Int64, + DataTypeFeature.Integer, + DataTypeFeature.Float, + DataTypeFeature.Double, + DataTypeFeature.Number, + DataTypeFeature.String, + DataTypeFeature.Binary, + DataTypeFeature.Boolean, + DataTypeFeature.Date, + DataTypeFeature.DateTime, + DataTypeFeature.Uuid, + DataTypeFeature.File, + DataTypeFeature.Array, + DataTypeFeature.Object, + DataTypeFeature.Null, + DataTypeFeature.AnyType, + DataTypeFeature.Enum + ) + .excludeDataTypeFeatures( + DataTypeFeature.Byte, + DataTypeFeature.Password + ) + .includeSchemaFeatures( + SchemaFeature.AdditionalProperties, + SchemaFeature.AllOf, + SchemaFeature.AnyOf, + SchemaFeature.Default, + SchemaFeature.Discriminator, + SchemaFeature.Enum, + SchemaFeature.ExclusiveMaximum, + SchemaFeature.ExclusiveMinimum, + SchemaFeature.Format, + SchemaFeature.Items, + SchemaFeature.MaxItems, + SchemaFeature.MaxLength, + SchemaFeature.MaxProperties, + SchemaFeature.Maximum, + SchemaFeature.MinItems, + SchemaFeature.MinLength, + SchemaFeature.MinProperties, + SchemaFeature.Minimum, + SchemaFeature.MultipleOf, + SchemaFeature.Not, + SchemaFeature.Nullable, + SchemaFeature.OneOf, + SchemaFeature.Pattern, + SchemaFeature.Properties, + SchemaFeature.Required, + SchemaFeature.Type, + SchemaFeature.UniqueItems + ) + .includeDocumentationFeatures( + DocumentationFeature.Readme, + DocumentationFeature.Servers, + DocumentationFeature.Security, + DocumentationFeature.ComponentSchemas, + DocumentationFeature.ComponentResponses, + DocumentationFeature.ComponentParameters, + DocumentationFeature.ComponentRequestBodies, + DocumentationFeature.ComponentHeaders, + DocumentationFeature.ComponentSecuritySchemes, + DocumentationFeature.Api + ) + .wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.Custom)) + .securityFeatures(EnumSet.of( + SecurityFeature.ApiKey, + SecurityFeature.HTTP_Basic, + SecurityFeature.HTTP_Bearer + )) + .excludeSecurityFeatures( + SecurityFeature.OAuth2_Implicit, SecurityFeature.OAuth2_Password, + SecurityFeature.OAuth2_ClientCredentials, SecurityFeature.OAuth2_AuthorizationCode + ) + .includeGlobalFeatures( + GlobalFeature.Info, + GlobalFeature.Servers, + GlobalFeature.Paths, + GlobalFeature.Components, + GlobalFeature.Security, + GlobalFeature.Tags + ) + .includeComponentsFeatures( + ComponentsFeature.schemas, + ComponentsFeature.responses, + ComponentsFeature.parameters, + ComponentsFeature.requestBodies, + ComponentsFeature.headers, + ComponentsFeature.securitySchemes + ) + .includeParameterFeatures( + ParameterFeature.Name, + ParameterFeature.Required, + ParameterFeature.In_Path, + ParameterFeature.In_Query, + ParameterFeature.In_Header, + ParameterFeature.Style_Matrix, + ParameterFeature.Style_Label, + ParameterFeature.Style_Form, + ParameterFeature.Style_Simple, + ParameterFeature.Style_PipeDelimited, + ParameterFeature.Style_SpaceDelimited, + ParameterFeature.Explode, + ParameterFeature.Schema, + ParameterFeature.Content + ) + .includeOperationFeatures( + OperationFeature.Responses_RangedResponseCodes, + OperationFeature.Responses_RedirectionResponse + ) + .excludeParameterFeatures( + ParameterFeature.In_Cookie + ) + ); + + modelPackage = "components.schema"; + apiPackage = "apis"; + outputFolder = "generated-code" + File.separatorChar + "python"; + + embeddedTemplateDir = templateDir = "python"; + + testFolder = "test"; + + // default HIDE_GENERATION_TIMESTAMP to true + hideGenerationTimestamp = Boolean.TRUE; + + // from https://docs.python.org/3/reference/lexical_analysis.html#keywords + setReservedWordsLowerCase( + Arrays.asList( + // @property + "property", + // python reserved words + "and", "del", "from", "not", "while", "as", "elif", "global", "or", "with", + "assert", "else", "if", "pass", "yield", "break", "except", "import", + "print", "class", "exec", "in", "raise", "continue", "finally", "is", + "return", "def", "for", "lambda", "try", "self", "nonlocal", "None", "True", + "False", "async", "await", + // types + "float", "int", "str", "bool", "dict", "frozendict", "list", "tuple")); + + regexModifiers = new HashMap<>(); + regexModifiers.put('i', "IGNORECASE"); + regexModifiers.put('l', "LOCALE"); + regexModifiers.put('m', "MULTILINE"); + regexModifiers.put('s', "DOTALL"); + regexModifiers.put('u', "UNICODE"); + + cliOptions.clear(); + cliOptions.add(new CliOption(CodegenConstants.PACKAGE_NAME, "python package name (convention: snake_case).") + .defaultValue("openapi_client")); + cliOptions.add(new CliOption(CodegenConstants.PROJECT_NAME, "python project name in setup.py (e.g. petstore-api).")); + cliOptions.add(new CliOption(CodegenConstants.PACKAGE_VERSION, "python package version.") + .defaultValue("1.0.0")); + cliOptions.add(new CliOption(PACKAGE_URL, "python package URL.")); + // this generator does not use SORT_PARAMS_BY_REQUIRED_FLAG + // this generator uses the following order for endpoint parameters and model properties + // required params + // optional params which are set to unset as their default for method signatures only + // optional params as **kwargs + cliOptions.add(new CliOption(CodegenConstants.HIDE_GENERATION_TIMESTAMP, CodegenConstants.HIDE_GENERATION_TIMESTAMP_DESC) + .defaultValue(Boolean.TRUE.toString())); + cliOptions.add(new CliOption(CodegenConstants.SOURCECODEONLY_GENERATION, CodegenConstants.SOURCECODEONLY_GENERATION_DESC) + .defaultValue(Boolean.FALSE.toString())); + cliOptions.add(CliOption.newBoolean(USE_NOSE, "use the nose test framework"). + defaultValue(Boolean.FALSE.toString())); + cliOptions.add(new CliOption(RECURSION_LIMIT, "Set the recursion limit. If not set, use the system default value.")); + CliOption nonCompliantUseDiscrIfCompositionFails = CliOption.newBoolean(CodegenConstants.NON_COMPLIANT_USE_DISCR_IF_COMPOSITION_FAILS, CodegenConstants.NON_COMPLIANT_USE_DISCR_IF_COMPOSITION_FAILS_DESC); + Map nonCompliantUseDiscrIfCompositionFailsOpts = new HashMap<>(); + nonCompliantUseDiscrIfCompositionFailsOpts.put("true", "If composition fails and a discriminator exists, the composition errors will be ignored and validation will be attempted with the discriminator"); + nonCompliantUseDiscrIfCompositionFailsOpts.put("false", "Composition validation must succeed. Discriminator validation must succeed."); + nonCompliantUseDiscrIfCompositionFails.setEnum(nonCompliantUseDiscrIfCompositionFailsOpts); + + cliOptions.add(nonCompliantUseDiscrIfCompositionFails); + + supportedLibraries.put("urllib3", "urllib3-based client"); + CliOption libraryOption = new CliOption(CodegenConstants.LIBRARY, "library template (sub-template) to use: urllib3"); + libraryOption.setDefault(DEFAULT_LIBRARY); + cliOptions.add(libraryOption); + setLibrary(DEFAULT_LIBRARY); + + // Composed schemas can have the 'additionalProperties' keyword, as specified in JSON schema. + // In principle, this should be enabled by default for all code generators. However, due to limitations + // in other code generators, support needs to be enabled on a case-by-case basis. + supportsAdditionalPropertiesWithComposedSchema = true; + + // When the 'additionalProperties' keyword is not present in an OAS schema, allow + // undeclared properties. This is compliant with the JSON schema specification. + this.setDisallowAdditionalPropertiesIfNotPresent(false); + GlobalSettings.setProperty("x-disallow-additional-properties-if-not-present", "false"); + + // this tells users what openapi types turn in to + instantiationTypes.put("object", "frozendict.frozendict"); + instantiationTypes.put("array", "tuple"); + instantiationTypes.put("string", "str"); + instantiationTypes.put("number", "decimal.Decimal"); + instantiationTypes.put("integer", "decimal.Decimal"); + instantiationTypes.put("boolean", "schemas.BoolClass"); + instantiationTypes.put("null", "schemas.NoneClass"); + + languageSpecificPrimitives.add("file_type"); + languageSpecificPrimitives.add("none_type"); + + generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata) + .stability(Stability.STABLE) + .build(); + } + + @Override + public void processOpts() { + this.setLegacyDiscriminatorBehavior(false); + + super.processOpts(); + + TemplatingEngineAdapter te = getTemplatingEngine(); + if (te instanceof HandlebarsEngineAdapter) { + HandlebarsEngineAdapter hea = (HandlebarsEngineAdapter) te; + hea.infiniteLoops(true); + hea.setPrettyPrint(true); + } else { + throw new RuntimeException("Only the HandlebarsEngineAdapter is supported for this generator"); + } + + TemplatePathLocator commonTemplateLocator = new CommonTemplateContentLocator(); + TemplatePathLocator generatorTemplateLocator = new GeneratorTemplateContentLocator(this); + TemplateManagerOptions templateManagerOptions = new TemplateManagerOptions(this.isEnableMinimalUpdate(),this.isSkipOverwrite()); + templateProcessor = new TemplateManager( + templateManagerOptions, + te, + new TemplatePathLocator[]{generatorTemplateLocator, commonTemplateLocator} + ); + + String ignoreFileLocation = this.getIgnoreFilePathOverride(); + if (ignoreFileLocation != null) { + final File ignoreFile = new File(ignoreFileLocation); + if (ignoreFile.exists() && ignoreFile.canRead()) { + this.ignoreProcessor = new CodegenIgnoreProcessor(ignoreFile); + } else { + LOGGER.warn("Ignore file specified at {} is not valid. This will fall back to an existing ignore file if present in the output directory.", ignoreFileLocation); + } + } + + if (this.ignoreProcessor == null) { + this.ignoreProcessor = new CodegenIgnoreProcessor(this.getOutputDir()); + } + + /* + The pyi stub files exists to allow pycharm to read and use typing.overload decorators for it to see that + dict_instance["someProp"] is of type SomeClass.properties.someProp + See https://youtrack.jetbrains.com/issue/PY-42137/PyCharm-type-hinting-doesnt-work-well-with-overload-decorator + */ + pathEndpointTestTemplateFiles.add("paths/path/verb/operation_test.hbs"); + modelTestTemplateFiles.put("components/schemas/schema_test.hbs", ".py"); + + jsonPathDocTemplateFiles.put( + CodegenConstants.JSON_PATH_LOCATION_TYPE.API_TAG, + new HashMap() {{ + put("apis/tags/api_doc.hbs", ".md"); + }} + ); + + HashMap apiRootTemplates = new HashMap<>(); + apiRootTemplates.put("apis/apis_tag_to_api.hbs", File.separatorChar + "tag_to_api.py"); + apiRootTemplates.put("apis/apis_path_to_api.hbs", File.separatorChar + "path_to_api.py"); + apiRootTemplates.put("apis/__init__.hbs", File.separatorChar + "__init__.py"); + + jsonPathTemplateFiles.put( + CodegenConstants.JSON_PATH_LOCATION_TYPE.API_ROOT_FOLDER, + apiRootTemplates + ); + jsonPathTemplateFiles.put( + CodegenConstants.JSON_PATH_LOCATION_TYPE.API_PATH, + new HashMap() {{ + put("apis/paths/api.hbs", ".py"); + }} + ); + jsonPathTemplateFiles.put( + CodegenConstants.JSON_PATH_LOCATION_TYPE.API_PATHS, + new HashMap() {{ + put("apis/paths/__init__.hbs", File.separatorChar + "__init__.py"); + }} + ); + jsonPathTemplateFiles.put( + CodegenConstants.JSON_PATH_LOCATION_TYPE.API_TAG, + new HashMap() {{ + put("apis/tags/api.hbs", ".py"); + }} + ); + jsonPathTemplateFiles.put( + CodegenConstants.JSON_PATH_LOCATION_TYPE.API_TAGS, + new HashMap() {{ + put("apis/tags/__init__.hbs", File.separatorChar + "__init__.py"); + }} + ); + + jsonPathDocTemplateFiles.put( + CodegenConstants.JSON_PATH_LOCATION_TYPE.OPERATION, + new HashMap() {{ + put("paths/path/verb/operation_doc.hbs", ".md"); + }} + ); + jsonPathDocTemplateFiles.put( + CodegenConstants.JSON_PATH_LOCATION_TYPE.SCHEMA, + new HashMap() {{ + put("components/schemas/schema_doc.hbs", ".md"); + }} + ); + jsonPathDocTemplateFiles.put( + CodegenConstants.JSON_PATH_LOCATION_TYPE.REQUEST_BODY, + new HashMap() {{ + put("components/request_bodies/request_body_doc.hbs", ".md"); + }} + ); + jsonPathDocTemplateFiles.put( + CodegenConstants.JSON_PATH_LOCATION_TYPE.PARAMETER, + new HashMap() {{ + put("components/parameters/parameter_doc.hbs", ".md"); + }} + ); + jsonPathDocTemplateFiles.put( + CodegenConstants.JSON_PATH_LOCATION_TYPE.RESPONSE, + new HashMap() {{ + put("components/responses/response_doc.hbs", ".md"); + }} + ); + jsonPathDocTemplateFiles.put( + CodegenConstants.JSON_PATH_LOCATION_TYPE.HEADER, + new HashMap() {{ + put("components/headers/header_doc.hbs", ".md"); + }} + ); + jsonPathDocTemplateFiles.put( + CodegenConstants.JSON_PATH_LOCATION_TYPE.SECURITY_SCHEME, + new HashMap() {{ + put("components/security_schemes/security_scheme_doc.hbs", ".md"); + }} + ); + jsonPathDocTemplateFiles.put( + CodegenConstants.JSON_PATH_LOCATION_TYPE.SERVER, + new HashMap() {{ + put("servers/server_doc.hbs", ".md"); + }} + ); + + HashMap schemaTemplates = new HashMap<>(); + schemaTemplates.put("components/schemas/schema.hbs", ".py"); + jsonPathTemplateFiles.put( + CodegenConstants.JSON_PATH_LOCATION_TYPE.SCHEMA, + schemaTemplates + ); + // there is no deeper info so the filenames can be individually generated + jsonPathTemplateFiles.put( + CodegenConstants.JSON_PATH_LOCATION_TYPE.SECURITY_SCHEME, + new HashMap() {{ + put("components/security_schemes/security_scheme.hbs", ".py"); + }} + ); + jsonPathTemplateFiles.put( + CodegenConstants.JSON_PATH_LOCATION_TYPE.SECURITY_SCHEMES, + new HashMap() {{ + put("__init__.hbs", File.separatorChar + "__init__.py"); + }} + ); + jsonPathTemplateFiles.put( + CodegenConstants.JSON_PATH_LOCATION_TYPE.HEADERS, + new HashMap() {{ + put("__init__.hbs", File.separatorChar + "__init__.py"); + }} + ); + jsonPathTemplateFiles.put( + CodegenConstants.JSON_PATH_LOCATION_TYPE.HEADER, + new HashMap() {{ + put("components/headers/header.hbs", File.separatorChar + "__init__.py"); + }} + ); + jsonPathTemplateFiles.put( + CodegenConstants.JSON_PATH_LOCATION_TYPE.PARAMETERS, + new HashMap() {{ + put("__init__.hbs", File.separatorChar + "__init__.py"); + }} + ); + jsonPathTemplateFiles.put( + CodegenConstants.JSON_PATH_LOCATION_TYPE.PARAMETER, + new HashMap() {{ + put("components/parameters/parameter.hbs", File.separatorChar + "__init__.py"); + }} + ); + jsonPathTemplateFiles.put( + CodegenConstants.JSON_PATH_LOCATION_TYPE.REQUEST_BODIES, + new HashMap() {{ + put("__init__.hbs", File.separatorChar + "__init__.py"); + }} + ); + jsonPathTemplateFiles.put( + CodegenConstants.JSON_PATH_LOCATION_TYPE.REQUEST_BODY, + new HashMap() {{ + put("components/request_bodies/request_body.hbs", File.separatorChar + "__init__.py"); + }} + ); + jsonPathTemplateFiles.put( + CodegenConstants.JSON_PATH_LOCATION_TYPE.RESPONSES, + new HashMap() {{ + put("__init__.hbs", File.separatorChar + "__init__.py"); + }} + ); + jsonPathTemplateFiles.put( + CodegenConstants.JSON_PATH_LOCATION_TYPE.RESPONSE, + new HashMap() {{ + put("components/responses/response.hbs", File.separatorChar + "__init__.py"); + }} + ); + if (openAPI.getServers() != null) { + jsonPathTemplateFiles.put( + CodegenConstants.JSON_PATH_LOCATION_TYPE.SERVERS, + new HashMap() {{ + put("__init__.hbs", File.separatorChar + "__init__.py"); + }} + ); + jsonPathTemplateFiles.put( + CodegenConstants.JSON_PATH_LOCATION_TYPE.SERVER, + new HashMap() {{ + put("servers/server.hbs", ".py"); + }} + ); + + } + jsonPathTemplateFiles.put( + CodegenConstants.JSON_PATH_LOCATION_TYPE.SCHEMAS, + new HashMap() {{ + put("components/schemas/__init__schema.hbs", File.separatorChar + "__init__.py"); + }} + ); + jsonPathTemplateFiles.put( + CodegenConstants.JSON_PATH_LOCATION_TYPE.SECURITIES, + new HashMap() {{ + put("__init__.hbs", File.separatorChar + "__init__.py"); + }} + ); + jsonPathTemplateFiles.put( + CodegenConstants.JSON_PATH_LOCATION_TYPE.SECURITY, + new HashMap() {{ + put("security/security.hbs", ".py"); + }} + ); + + jsonPathTemplateFiles.put( + CodegenConstants.JSON_PATH_LOCATION_TYPE.PATHS, + new HashMap() {{ + put("paths/__init__paths.hbs", File.separatorChar + "__init__.py"); + }} + ); + jsonPathTemplateFiles.put( + CodegenConstants.JSON_PATH_LOCATION_TYPE.PATH, + new HashMap() {{ + put("paths/path/__init__path.hbs", File.separatorChar + "__init__.py"); + }} + ); + HashMap operationTemplates = new HashMap<>(); + operationTemplates.put("__init__.hbs", File.separatorChar + "__init__.py"); + operationTemplates.put("paths/path/verb/operation.hbs", File.separatorChar + "operation.py"); + jsonPathTemplateFiles.put( + CodegenConstants.JSON_PATH_LOCATION_TYPE.OPERATION, + operationTemplates + ); + + jsonPathTemplateFiles.put( + CodegenConstants.JSON_PATH_LOCATION_TYPE.COMPONENTS, + new HashMap() {{ + put("__init__.hbs", File.separatorChar + "__init__.py"); + }} + ); + jsonPathTemplateFiles.put( + CodegenConstants.JSON_PATH_LOCATION_TYPE.CONTENT, + new HashMap() {{ + put("__init__.hbs", File.separatorChar + "__init__.py"); + }} + ); + jsonPathTemplateFiles.put( + CodegenConstants.JSON_PATH_LOCATION_TYPE.CONTENT_TYPE, + new HashMap() {{ + put("__init__.hbs", File.separatorChar + "__init__.py"); + }} + ); + + if (StringUtils.isEmpty(System.getenv("PYTHON_POST_PROCESS_FILE"))) { + LOGGER.info("Environment variable PYTHON_POST_PROCESS_FILE not defined so the Python code may not be properly formatted. To define it, try 'export PYTHON_POST_PROCESS_FILE=\"/usr/local/bin/yapf -i\"' (Linux/Mac)"); + LOGGER.info("NOTE: To enable file post-processing, 'enablePostProcessFile' must be set to `true` (--enable-post-process-file for CLI)."); + } + + boolean excludeTests = false; + + if (additionalProperties.containsKey(CodegenConstants.PACKAGE_NAME)) { + setPackageName((String) additionalProperties.get(CodegenConstants.PACKAGE_NAME)); + } + + if (additionalProperties.containsKey(CodegenConstants.PROJECT_NAME)) { + setProjectName((String) additionalProperties.get(CodegenConstants.PROJECT_NAME)); + } else { + // default: set project based on package name + // e.g. petstore_api (package name) => petstore-api (project name) + setProjectName(packageName.replaceAll("_", "-")); + } + + if (additionalProperties.containsKey(CodegenConstants.PACKAGE_VERSION)) { + setPackageVersion((String) additionalProperties.get(CodegenConstants.PACKAGE_VERSION)); + } + + additionalProperties.put(CodegenConstants.PROJECT_NAME, projectName); + additionalProperties.put(CodegenConstants.PACKAGE_NAME, packageName); + additionalProperties.put(CodegenConstants.PACKAGE_VERSION, packageVersion); + + if (additionalProperties.containsKey(CodegenConstants.EXCLUDE_TESTS)) { + excludeTests = Boolean.parseBoolean(additionalProperties.get(CodegenConstants.EXCLUDE_TESTS).toString()); + } + + boolean generateSourceCodeOnly = false; + if (additionalProperties.containsKey(CodegenConstants.SOURCECODEONLY_GENERATION)) { + generateSourceCodeOnly = Boolean.parseBoolean(additionalProperties.get(CodegenConstants.SOURCECODEONLY_GENERATION).toString()); + } + + // make api and model doc path available in templates + additionalProperties.put("apiDocPath", apiDocPath); + additionalProperties.put("modelDocPath", modelDocPath); + + if (additionalProperties.containsKey(PACKAGE_URL)) { + setPackageUrl((String) additionalProperties.get(PACKAGE_URL)); + } + + if (additionalProperties.containsKey(USE_NOSE)) { + setUseNose((String) additionalProperties.get(USE_NOSE)); + } + + // check to see if setRecursionLimit is set and whether it's an integer + if (additionalProperties.containsKey(RECURSION_LIMIT)) { + try { + Integer.parseInt((String) additionalProperties.get(RECURSION_LIMIT)); + } catch (NumberFormatException | NullPointerException e) { + throw new IllegalArgumentException("recursionLimit must be an integer, e.g. 2000."); + } + } + + if (additionalProperties.containsKey(CodegenConstants.NON_COMPLIANT_USE_DISCR_IF_COMPOSITION_FAILS)) { + nonCompliantUseDiscrIfCompositionFails = Boolean.parseBoolean( + additionalProperties.get(CodegenConstants.NON_COMPLIANT_USE_DISCR_IF_COMPOSITION_FAILS).toString() + ); + } + + String readmePath = "README.md"; + String readmeTemplate = "README.hbs"; + if (generateSourceCodeOnly) { + readmePath = packagePath() + "_" + readmePath; + readmeTemplate = "README_onlypackage.hbs"; + } + supportingFiles.add(new SupportingFile(readmeTemplate, "", readmePath)); + supportingFiles.add(new SupportingFile("migration_2_0_0.hbs", "", "migration_2_0_0.md")); + supportingFiles.add(new SupportingFile("migration_other_python_generators.hbs", "", "migration_other_python_generators.md")); + supportingFiles.add(new SupportingFile("__init__package.hbs", packagePath(), "__init__.py")); + + if (!generateSourceCodeOnly) { + supportingFiles.add(new SupportingFile("tox.hbs", "", "tox.ini")); + supportingFiles.add(new SupportingFile("test-requirements.hbs", "", "test-requirements.txt")); + + supportingFiles.add(new SupportingFile("git_push.hbs", "", "git_push.sh")); + supportingFiles.add(new SupportingFile("gitignore.hbs", "", ".gitignore")); + supportingFiles.add(new SupportingFile("travis.hbs", "", ".travis.yml")); + supportingFiles.add(new SupportingFile("gitlab-ci.hbs", "", ".gitlab-ci.yml")); + supportingFiles.add(new SupportingFile("pyproject.hbs", "", "pyproject.toml")); + } + // configurations package + supportingFiles.add(new SupportingFile("__init__.hbs", packagePath() + File.separatorChar + "configurations", "__init__.py")); + supportingFiles.add(new SupportingFile("configurations" + File.separatorChar + "schema_configuration.hbs", packagePath() + File.separatorChar + "configurations", "schema_configuration.py")); + supportingFiles.add(new SupportingFile("configurations" + File.separatorChar + "api_configuration.hbs", packagePath() + File.separatorChar + "configurations", "api_configuration.py")); + + // If the package name consists of dots(openapi.client), then we need to create the directory structure like openapi/client with __init__ files. + String[] packageNameSplits = packageName.split("\\."); + String currentPackagePath = ""; + for (int i = 0; i < packageNameSplits.length - 1; i++) { + if (i > 0) { + currentPackagePath = currentPackagePath + File.separatorChar; + } + currentPackagePath = currentPackagePath + packageNameSplits[i]; + supportingFiles.add(new SupportingFile("__init__.hbs", currentPackagePath, "__init__.py")); + } + + supportingFiles.add(new SupportingFile("exceptions.hbs", packagePath(), "exceptions.py")); + + if (Boolean.FALSE.equals(excludeTests)) { + supportingFiles.add(new SupportingFile("__init__.hbs", testFolder, "__init__.py")); + supportingFiles.add(new SupportingFile("__init__.hbs", testFolder + File.separator + modelPackage.replace('.', File.separatorChar), "__init__.py")); + supportingFiles.add(new SupportingFile("__init__.hbs", testFolder + File.separator + "components", "__init__.py")); + } + + supportingFiles.add(new SupportingFile("api_client.hbs", packagePath(), "api_client.py")); + supportingFiles.add(new SupportingFile("rest.hbs", packagePath(), "rest.py")); + supportingFiles.add(new SupportingFile("schemas.hbs", packagePath(), "schemas.py")); + supportingFiles.add(new SupportingFile("security_schemes.hbs", packagePath(), "security_schemes.py")); + supportingFiles.add(new SupportingFile("server.hbs", packagePath(), "server.py")); + + // add the models and apis folders + String modelPackages = modelPackage + "s"; + boolean generateModels = (boolean) additionalProperties().get(CodegenConstants.GENERATE_MODELS); + if (generateModels) { + supportingFiles.add(new SupportingFile("components/schemas/__init__schemas.hbs", packagePath() + File.separatorChar + modelPackages.replace('.', File.separatorChar), "__init__.py")); + } + // Generate the 'signing.py' module, but only if the 'HTTP signature' security scheme is specified in the OAS. + Map securitySchemeMap = openAPI != null ? + (openAPI.getComponents() != null ? openAPI.getComponents().getSecuritySchemes() : null) : null; + if (securitySchemeMap != null) { + for (SecurityScheme securityScheme: securitySchemeMap.values()) { + if (securityScheme.getType() == SecurityScheme.Type.HTTP && securityScheme.getScheme().equals("signature")) { + supportingFiles.add(new SupportingFile("signing.hbs", packagePath(), "signing.py")); + break; + } + } + } + + // check library option to ensure only urllib3 is supported + if (!DEFAULT_LIBRARY.equals(getLibrary())) { + throw new RuntimeException("Only the `urllib3` library is supported in the refactored `python` client generator at the moment. Please fall back to `python-legacy` client generator for the time being. We welcome contributions to add back `asyncio`, `tornado` support to the `python` client generator."); + } + } + + @Override + public String toApiName(String name) { + if (name.length() == 0) { + return "DefaultApi"; + } + return toModelName(name, null) + apiNameSuffix; + } + + @Override + public String toModuleFilename(String name, String jsonPath) { + // underscore the model file name + // PhoneNumber => phone_number + return underscore(dropDots(toModelName(name, jsonPath))); + } + + @Override + public String toModelName(String name, String jsonPath) { + PairCacheKey key = new PairCacheKey(name, jsonPath); + if (modelNameCache.containsKey(key)) { + return modelNameCache.get(key); + } + String sanitizedName = sanitizeName(name); + // remove dollar sign + sanitizedName = sanitizedName.replaceAll("$", ""); + // remove whitespace + sanitizedName = sanitizedName.replaceAll("\\s+", ""); + + String nameWithPrefixSuffix = sanitizedName; + if (!StringUtils.isEmpty(modelNamePrefix)) { + // add '_' so that model name can be camelized correctly + nameWithPrefixSuffix = modelNamePrefix + "_" + nameWithPrefixSuffix; + } + + if (!StringUtils.isEmpty(modelNameSuffix)) { + // add '_' so that model name can be camelized correctly + nameWithPrefixSuffix = nameWithPrefixSuffix + "_" + modelNameSuffix; + } + + // camelize the model name + // phone_number => PhoneNumber + String camelizedName = camelize(nameWithPrefixSuffix); + + String[] pathPieces; + boolean isComponent = false; + if (jsonPath != null) { + pathPieces = jsonPath.split("/"); + // #/components/schemas/blah -> size 4 + if (pathPieces.length == 4 && jsonPath.startsWith("#/components/")) { + isComponent = true; + } + } + + // model name cannot use reserved keyword, e.g. return + if (isReservedWord(camelizedName)) { + String modelName = "_" + camelizedName; // e.g. return => ModelReturn (after camelize) + if (isComponent) { + LOGGER.warn("{} (reserved word) cannot be used as component name. Renamed to {}", camelizedName, modelName); + } + modelNameCache.put(key, modelName); + return modelName; + } + + + // model name starts with number + if (camelizedName.matches("^\\d.*")) { + String modelName = "_" + camelizedName; // e.g. return => ModelReturn (after camelize) + if (isComponent) { + LOGGER.warn("{} (component name starts with number) cannot be used as name. Renamed to {}", camelizedName, modelName); + } + modelNameCache.put(key, modelName); + return modelName; + } + + modelNameCache.put(key, camelizedName); + return camelizedName; + } + + /** + * Configures a friendly name for the generator. This will be used by the + * generator to select the library with the -g flag. + * + * @return the friendly name for the generator + */ + @Override + public String getName() { + return "python"; + } + + @Override + public String getHelp() { + return String.join("
    ", + "Generates a Python client library", + "", + "Features in this generator:", + "- type hints on endpoints and model creation", + "- model parameter names use the spec defined keys and cases", + "- robust composition (oneOf/anyOf/allOf/not) where payload data is stored in one instance only", + "- endpoint parameter names use the spec defined keys and cases", + "- inline schemas are supported at any location including composition", + "- multiple content types supported in request body and response bodies", + "- run time type checking", + "- Sending/receiving decimals as strings supported with type:string format: number -> DecimalSchema", + "- Sending/receiving uuids as strings supported with type:string format: uuid -> UUIDSchema", + "- quicker load time for python modules (a single endpoint can be imported and used without loading others)", + "- all instances of schemas dynamically inherit from all matching schemas so one can use isinstance to check if validation passed", + "- composed schemas with type constraints supported (type:object + oneOf/anyOf/allOf)", + "- schemas are not coerced/cast. For example string + date are both stored as string, and there is a date accessor", + " - Exceptions: int/float is stored as Decimal, When receiving data from headers it will start as str and may need to be cast for example to int"); + } + + public String pythonDate(Object dateValue) { + String strValue; + if (dateValue instanceof OffsetDateTime) { + OffsetDateTime date; + try { + date = (OffsetDateTime) dateValue; + } catch (ClassCastException e) { + LOGGER.warn("Invalid `date` format for value {}", dateValue.toString()); + date = ((Date) dateValue).toInstant().atOffset(ZoneOffset.UTC); + } + strValue = date.format(iso8601Date); + } else { + strValue = dateValue.toString(); + } + return strValue; + } + + public String pythonDateTime(Object dateTimeValue) { + String strValue; + if (dateTimeValue instanceof OffsetDateTime) { + OffsetDateTime dateTime; + try { + dateTime = (OffsetDateTime) dateTimeValue; + } catch (ClassCastException e) { + LOGGER.warn("Invalid `date-time` format for value {}", dateTimeValue.toString()); + dateTime = ((Date) dateTimeValue).toInstant().atOffset(ZoneOffset.UTC); + } + strValue = dateTime.format(iso8601DateTime); + } else { + strValue = dateTimeValue.toString(); + } + return strValue; + } + + @Override + public String toModelImport(String refClass) { + // name looks like cat.Cat + String[] refClassPieces = refClass.split("\\."); + if (refClassPieces.length != 2) { + return null; + } + String modelModule = refClassPieces[0]; + return "from " + packageName + "." + modelPackage() + " import " + modelModule; + } + + /*** + * Override with special post-processing for all models. + * we have a custom version of this method to: + * - remove any primitive models that do not contain validations + * these models are unaliased as inline definitions wherever the spec has them as refs + * this means that the generated client does not use these models + * because they are not used we do not write them + * - fix the model imports, go from model name to the full import string with toModelImport + globalImportFixer + * Also cleans the test folder if test cases exist and the testFolder is set because the tests are autogenerated + * + * @param models a map going from the model name to an object holding the model info + * @return the updated models + */ + @Override + public TreeMap postProcessAllModels(TreeMap models) { + super.postProcessAllModels(models); + + boolean anyModelContainsTestCases = false; + for (CodegenSchema cm : models.values()) { + if (cm.testCases != null && !cm.testCases.isEmpty()) { + anyModelContainsTestCases = true; + break; + } + } + boolean testFolderSet = testFolder != null; + if (testFolderSet && anyModelContainsTestCases) { + // delete the test folder because tests there will be autogenerated + String testPath = outputFolder + File.separatorChar + testFolder; + File testDirectory = new File(testPath); + try { + FileUtils.cleanDirectory(testDirectory); + } catch (IOException e) { + LOGGER.info("Unable to delete the test folder because of exception=" + e); + } + + } + + return models; + } + + protected boolean isValid(String name) { + boolean isValid = super.isValid(name); + if (!isValid) { + return false; + } + return name.matches("^[_a-zA-Z]\\w*$"); + } + + /** + * Convert OAS Property object to Codegen Property object + * We have a custom version of this method to always set allowableValues.enumVars on all enum variables + * Together with unaliasSchema this sets primitive types with validations as models + * This method is used by fromResponse + * + * @param p OAS property schema + * @return Codegen Property object + */ + @Override + public CodegenSchema fromSchema(Schema p, String sourceJsonPath, String currentJsonPath) { + // fix needed for values with /n /t etc. in them + CodegenSchema cp = super.fromSchema(p, sourceJsonPath, currentJsonPath); + if (cp.types != null && cp.types.contains("integer") && cp.format == null) { + // this generator treats integers as type number + // this is done so type int + float has the same base class (decimal.Decimal) + // so integer validation info must be set using formatting + cp.format = "int"; + } + return cp; + } + + /** + * Return the sanitized variable name for enum + * + * @param value enum variable name + * @param prop property + * @return the sanitized variable name for enum + */ + @Override + public String toEnumVarName(String value, Schema prop) { + // our enum var names are keys in a python dict, so change spaces to underscores + if (value.length() == 0) { + return "EMPTY"; + } + if (value.equals("null")) { + return "NONE"; + } + + // value is int or float + String intPattern = "^[-+]?\\d+$"; + String floatPattern = "^[-+]?\\d+\\.\\d+$"; + Boolean intMatch = Pattern.matches(intPattern, value); + Boolean floatMatch = Pattern.matches(floatPattern, value); + if (intMatch || floatMatch) { + String plusSign = "^\\+.+"; + String negSign = "^-.+"; + String enumVarName; + if (Pattern.matches(plusSign, value)) { + enumVarName = value.replace("+", "POSITIVE_"); + } else if (Pattern.matches(negSign, value)) { + enumVarName = value.replace("-", "NEGATIVE_"); + } else { + enumVarName = "POSITIVE_" + value; + } + if (floatMatch) { + enumVarName = enumVarName.replace(".", "_PT_"); + } + return enumVarName; + } + + // every character in value is not allowed + String valueWithAllowedCharsOnly = value.replaceAll("^\\W+", ""); + if (valueWithAllowedCharsOnly.isEmpty()) { + StringBuilder usedValueBuilder = new StringBuilder(); + for (int i = 0; i < value.length(); i++){ + char c = value.charAt(i); + String charName = Character.getName(Character.hashCode(c)); + if (usedValueBuilder.length() > 0) { + usedValueBuilder.append("_"); + } + usedValueBuilder.append(charNameToVarName(charName)); + } + return usedValueBuilder.toString(); + } + + String usedValue = value; + // Replace " " with _ + usedValue = usedValue.replaceAll("[ ]+", "_"); + + // replace all invalid characters with their character name descriptions + Pattern nonWordCharPattern = Pattern.compile("\\W+"); + Matcher matcher = nonWordCharPattern.matcher(usedValue); + Stack> matchStartToGroup = new Stack<>(); + while (matcher.find()) { + matchStartToGroup.add(new AbstractMap.SimpleEntry<>(matcher.start(), matcher.group())); + } + char underscore = "_".charAt(0); + while (!matchStartToGroup.isEmpty()) { + AbstractMap.SimpleEntry entry = matchStartToGroup.pop(); + Integer startIndex = entry.getKey(); + String match = entry.getValue(); + String prefix = ""; + String suffix = ""; + if (startIndex > 0 && usedValue.charAt(startIndex-1) != underscore) { + prefix = "_"; + } + int indexAfter = startIndex + match.length(); + if (startIndex + match.length() < usedValue.length() && usedValue.charAt(indexAfter) != underscore) { + suffix = "_"; + } + StringBuilder convertedMatch = new StringBuilder(); + for (int i = 0; i < match.length(); i++) { + String charName = charNameToVarName(Character.getName(Character.hashCode(match.charAt(i)))); + convertedMatch.append(charName); + if (i != match.length() - 1) { + convertedMatch.append("_"); + } + } + String replacement = prefix + convertedMatch + suffix; + usedValue = usedValue.substring(0, startIndex) + replacement + usedValue.substring(indexAfter); + } + + // add camel case underscore + String regex = "([a-z])([A-Z]+)"; + String regexReplacement = "$1_$2"; + usedValue = usedValue.replaceAll(regex, regexReplacement); + + // uppercase + usedValue = usedValue.toUpperCase(Locale.ROOT); + + if (usedValue.length() > 1) { + // remove trailing _ + usedValue = usedValue.replaceAll("_$", ""); + } + return usedValue; + } + + /** + * Replace - and " " with _ + * + * @param charName the input + * @return the variable name + */ + private String charNameToVarName(String charName) { + // - and " " -> _ + String result = charName.replaceAll("[\\-\\s]", "_"); + // remove parentheses + return result.replaceAll("[()]", ""); + } + + protected String toTestCaseName(String specTestCaseName) { + return CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, specTestCaseName); + } + + protected String handleSpecialCharacters(String value) { + // handles escape characters and the like + String stringValue = value; + String backslash = "\\"; + if (stringValue.contains(backslash)) { + stringValue = stringValue.replace(backslash, "\\\\"); + } + String nullChar = "\0"; + if (stringValue.contains(nullChar)) { + stringValue = stringValue.replace(nullChar, "\\x00"); + } + String doubleQuoteChar = "\""; + if (stringValue.contains(doubleQuoteChar)) { + stringValue = stringValue.replace(doubleQuoteChar, "\\\""); + } + String lineSep = System.lineSeparator(); + if (stringValue.contains(lineSep)) { + stringValue = stringValue.replace(lineSep, "\\n"); + } + String carriageReturn = "\r"; + if (stringValue.contains(carriageReturn)) { + stringValue = stringValue.replace(carriageReturn, "\\r"); + } + String tab = "\t"; + if (stringValue.contains(tab)) { + stringValue = stringValue.replace(tab, "\\t"); + } + String formFeed = "\f"; + if (stringValue.contains(formFeed)) { + stringValue = stringValue.replace(formFeed, "\\f"); + } + return stringValue; + } + + public String getRefClassWithRefModule(Schema sc) { + String ref = sc.get$ref(); + if (ref != null) { + return toRefModule(ref, null, "schemas") + "." + toRefClass(ref, null, "schemas"); + } + return null; + } + + /** + * Gets an example if it exists + * + * @param sc input schema + * @return the example value + */ + protected Object getObjectExample(Schema sc) { + Schema schema = sc; + String ref = sc.get$ref(); + if (ref != null) { + schema = ModelUtils.getSchema(this.openAPI, ModelUtils.getSimpleRef(ref)); + } + if (schema == null) { + return null; + } + // TODO handle examples in object models in the future + boolean objectModel = (ModelUtils.isObjectSchema(schema) || ModelUtils.isMapSchema(schema) || ModelUtils.isComposedSchema(schema)); + if (objectModel) { + return null; + } + if (schema.getExample() != null) { + return schema.getExample(); + } + if (schema.getDefault() != null) { + return schema.getDefault(); + } else if (schema.getEnum() != null && !schema.getEnum().isEmpty()) { + return schema.getEnum().get(0); + } + return null; + } + + /*** + * Ensures that the string has a leading and trailing quote + * + * @param in input string + * @return quoted string + */ + private String ensureQuotes(String in) { + String strPattern = "^['\"].*?['\"]$"; + if (in.matches(strPattern)) { + return in; + } + return "\"" + in + "\""; + } + + @Override + public String toExampleValue(Schema schema) { + String modelName = getRefClassWithRefModule(schema); + Object objExample = getObjectExample(schema); + return toExampleValueRecursive(modelName, schema, objExample, 1, "", 0, new ArrayList<>()); + } + + @Override + public String toExampleValue(Schema schema, Object objExample) { + String modelName = getRefClassWithRefModule(schema); + return toExampleValueRecursive(modelName, schema, objExample, 1, "", 0, new ArrayList<>()); + } + + private Boolean simpleStringSchema(Schema schema) { + Schema sc = schema; + String ref = schema.get$ref(); + if (ref != null) { + sc = ModelUtils.getSchema(this.openAPI, ModelUtils.getSimpleRef(ref)); + } + if (sc == null) { + return Boolean.FALSE; + } + return ModelUtils.isStringSchema(sc) && !ModelUtils.isDateSchema(sc) && !ModelUtils.isDateTimeSchema(sc) && !"Number".equalsIgnoreCase(sc.getFormat()) && !ModelUtils.isByteArraySchema(sc) && !ModelUtils.isBinarySchema(sc) && schema.getPattern() == null; + } + + private String getSchemaName(String complexType) { + String[] packageNameSplits = complexType.split("\\."); + if (packageNameSplits.length == 1) { + return packageNameSplits[0]; + } + return packageNameSplits[1]; + } + + private MappedModel getDiscriminatorMappedModel(CodegenDiscriminator disc) { + for (MappedModel mm : disc.mappedModels) { + String complexType = mm.modelName; + String schemaName = getSchemaName(complexType); + Schema modelSchema = getModelNameToSchemaCache().get(schemaName); + if (ModelUtils.isObjectSchema(modelSchema)) { + return mm; + } + } + return null; + } + + /*** + * Recursively generates string examples for schemas + * + * @param modelName the string name of the refed model that will be generated for the schema or null + * @param schema the schema that we need an example for + * @param objExample the example that applies to this schema, for now only string example are used + * @param indentationLevel integer indentation level that we are currently at + * we assume the indentation amount is 4 spaces times this integer + * @param prefix the string prefix that we will use when assigning an example for this line + * this is used when setting key: value, pairs "key: " is the prefix + * and this is used when setting properties like some_property='some_property_example' + * @param exampleLine this is the current line that we are generating an example for, starts at 0 + * we don't indent in the 0th line because using the example value looks like: + * prop = ModelName( line 0 + * some_property='some_property_example' line 1 + * ) line 2 + * and our example value is: + * ModelName( line 0 + * some_property='some_property_example' line 1 + * ) line 2 + * @param includedSchemas are a list of schemas that we have moved through to get here. If the new schemas that we + * are looking at is in includedSchemas then we have hit a cycle. + * @return the string example + */ + private String toExampleValueRecursive(String modelName, Schema schema, Object objExample, int indentationLevel, String prefix, Integer exampleLine, List includedSchemas) { + boolean couldHaveCycle = includedSchemas.size() > 0 && potentiallySelfReferencingSchema(schema); + // If we have seen the ContextAwareSchemaNode more than once before, we must be in a cycle. + boolean cycleFound = false; + if (couldHaveCycle) { + cycleFound = includedSchemas.subList(0, includedSchemas.size()-1).stream().anyMatch(schema::equals); + } + final String indentionConst = " "; + StringBuilder currentIndentation = new StringBuilder(); + String closingIndentation; + for (int i = 0; i < indentationLevel; i++) currentIndentation.append(indentionConst); + if (exampleLine.equals(0)) { + closingIndentation = currentIndentation.toString(); + currentIndentation = new StringBuilder(); + } else { + closingIndentation = currentIndentation.toString(); + } + String openChars = ""; + String closeChars = ""; + if (modelName != null) { + openChars = modelName + "("; + closeChars = ")"; + } + + String fullPrefix = currentIndentation + prefix + openChars; + + String example = null; + if (objExample != null) { + example = objExample.toString(); + } + if (null != schema.get$ref()) { + Map allDefinitions = ModelUtils.getSchemas(this.openAPI); + String ref = ModelUtils.getSimpleRef(schema.get$ref()); + Schema refSchema = allDefinitions.get(ref); + if (null == refSchema) { + LOGGER.warn("Unable to find referenced schema " + schema.get$ref() + "\n"); + return fullPrefix + "None" + closeChars; + } + String refModelName = getRefClassWithRefModule(schema); + return toExampleValueRecursive(refModelName, refSchema, objExample, indentationLevel, prefix, exampleLine, includedSchemas); + } else if (ModelUtils.isNullType(schema)) { + // The 'null' type is allowed in OAS 3.1 and above. It is not supported by OAS 3.0.x, + // though this tooling supports it. + return fullPrefix + "None" + closeChars; + } else if (ModelUtils.isAnyType(schema)) { + /* + This schema may be a composed schema + TODO generate examples for some of these use cases in the future like + only oneOf without a discriminator + */ + if (cycleFound) { + return ""; + } + boolean hasProperties = (schema.getProperties() != null && !schema.getProperties().isEmpty()); + CodegenDiscriminator disc = createDiscriminator(modelName, schema, openAPI, ""); + if (ModelUtils.isComposedSchema(schema)) { + if(includedSchemas.contains(schema)) { + return ""; + } + includedSchemas.add(schema); + // complex composed object type schemas not yet handled and the code returns early + if (hasProperties) { + // what if this composed schema defined properties + allOf? + // or items + properties, both a list and a dict could be accepted as payloads + return fullPrefix + "{}" + closeChars; + } + ComposedSchema cs = (ComposedSchema) schema; + int allOfExists = 0; + if (cs.getAllOf() != null && !cs.getAllOf().isEmpty()) { + allOfExists = 1; + } + int anyOfExists = 0; + if (cs.getAnyOf() != null && !cs.getAnyOf().isEmpty()) { + anyOfExists = 1; + } + int oneOfExists = 0; + if (cs.getOneOf() != null && !cs.getOneOf().isEmpty()) { + oneOfExists = 1; + } + if (allOfExists + anyOfExists + oneOfExists > 1) { + // what if it needs one oneOf schema, one anyOf schema, and two allOf schemas? + return fullPrefix + "None" + closeChars; + } + // for now only oneOf with discriminator is supported + if (!(oneOfExists == 1 && disc != null)) { + return fullPrefix + "None" + closeChars; + } + } + if (disc != null) { + // a discriminator means that this is object type + MappedModel mm = getDiscriminatorMappedModel(disc); + if (mm == null) { + return fullPrefix + "None" + closeChars; + } + String discPropNameValue = mm.mappingName; + String schemaName = getSchemaName(mm.modelName); + Schema modelSchema = getModelNameToSchemaCache().get(schemaName); + CodegenSchema cp = new CodegenSchema(); + cp.jsonPathPiece = getKey(disc.propertyName.original); + cp.example = discPropNameValue; + return exampleForObjectModel(modelSchema, fullPrefix, closeChars, cp, indentationLevel, exampleLine, closingIndentation, includedSchemas); + } + return fullPrefix + "None" + closeChars; + } else if (ModelUtils.isBooleanSchema(schema)) { + if (example == null) { + example = "True"; + } else { + if ("false".equalsIgnoreCase(objExample.toString())) { + example = "False"; + } else { + example = "True"; + } + } + return fullPrefix + example + closeChars; + } else if (ModelUtils.isStringSchema(schema)) { + if (example != null) { + return fullPrefix + ensureQuotes(handleSpecialCharacters(example)) + closeChars; + } + if (ModelUtils.isDateSchema(schema)) { + if (objExample == null) { + example = pythonDate("1970-01-01"); + } else { + example = pythonDate(objExample); + } + } else if (ModelUtils.isDateTimeSchema(schema)) { + if (objExample == null) { + example = pythonDateTime("1970-01-01T00:00:00.00Z"); + } else { + example = pythonDateTime(objExample); + } + } else if (ModelUtils.isBinarySchema(schema)) { + if (objExample == null) { + example = "/path/to/file"; + } + example = "open('" + example + "', 'rb')"; + return fullPrefix + example + closeChars; + } else if (ModelUtils.isByteArraySchema(schema)) { + if (objExample == null) { + example = "'YQ=='"; + } + } else if ("Number".equalsIgnoreCase(schema.getFormat())) { + // a BigDecimal: + example = "2"; + } else if (StringUtils.isNotBlank(schema.getPattern())) { + String pattern = schema.getPattern(); + CodegenPatternInfo results = getPatternInfo(pattern); + String extractedPattern = results.pattern; + LinkedHashSet regexFlags = results.flags; + /* + RxGen does not support our ECMA dialect https://github.com/curious-odd-man/RgxGen/issues/56 + So strip off the leading / and trailing / and turn on ignore case if we have it + */ + RgxGen rgxGen; + if (regexFlags != null && regexFlags.contains("i")) { + rgxGen = new RgxGen(extractedPattern); + RgxGenProperties properties = new RgxGenProperties(); + RgxGenOption.CASE_INSENSITIVE.setInProperties(properties, true); + rgxGen.setProperties(properties); + } else { + rgxGen = new RgxGen(extractedPattern); + } + + // this seed makes it so if we have [a-z] we pick a + Random random = new Random(18); + example = rgxGen.generate(random); + } else if (schema.getMinLength() != null) { + example = ""; + int len = schema.getMinLength(); + StringBuilder exampleBuilder = new StringBuilder(example); + for (int i = 0; i < len; i++) exampleBuilder.append("a"); + example = exampleBuilder.toString(); + } else if (ModelUtils.isUUIDSchema(schema)) { + example = "046b6c7f-0b8a-43b9-b35d-6489e6daee91"; + } else { + example = "string_example"; + } + assert example != null; + return fullPrefix + ensureQuotes(example) + closeChars; + } else if (ModelUtils.isIntegerSchema(schema)) { + if (objExample == null) { + if (schema.getMinimum() != null) { + example = schema.getMinimum().toString(); + } else { + example = "1"; + } + } + return fullPrefix + example + closeChars; + } else if (ModelUtils.isNumberSchema(schema)) { + if (objExample == null) { + if (schema.getMinimum() != null) { + example = schema.getMinimum().toString(); + } else { + example = "3.14"; + } + } + return fullPrefix + example + closeChars; + } else if (ModelUtils.isArraySchema(schema)) { + if (objExample instanceof Iterable) { + // If the example is already a list, return it directly instead of wrongly wrap it in another list + return fullPrefix + objExample + closeChars; + } + if (ModelUtils.isComposedSchema(schema)) { + // complex composed array type schemas not yet handled and the code returns early + return fullPrefix + "[]" + closeChars; + } + ArraySchema arrayschema = (ArraySchema) schema; + Schema itemSchema = arrayschema.getItems(); + String itemModelName = getRefClassWithRefModule(itemSchema); + if(includedSchemas.contains(schema)) { + return ""; + } + includedSchemas.add(schema); + String itemExample = toExampleValueRecursive(itemModelName, itemSchema, objExample, indentationLevel + 1, "", exampleLine + 1, includedSchemas); + if (StringUtils.isEmpty(itemExample) || cycleFound) { + return fullPrefix + "[]" + closeChars; + } else { + return fullPrefix + "[" + "\n" + itemExample + "\n" + closingIndentation + "]" + closeChars; + } + } else if (ModelUtils.isTypeObjectSchema(schema)) { + if (modelName == null) { + fullPrefix += "dict("; + closeChars = ")"; + } + if (cycleFound) { + return fullPrefix + closeChars; + } + boolean hasProperties = (schema.getProperties() != null && !schema.getProperties().isEmpty()); + CodegenDiscriminator disc = createDiscriminator(modelName, schema, openAPI, ""); + if (ModelUtils.isComposedSchema(schema)) { + // complex composed object type schemas not yet handled and the code returns early + if (hasProperties) { + // what if this composed schema defined properties + allOf? + return fullPrefix + closeChars; + } + ComposedSchema cs = (ComposedSchema) schema; + int allOfExists = 0; + if (cs.getAllOf() != null && !cs.getAllOf().isEmpty()) { + allOfExists = 1; + } + int anyOfExists = 0; + if (cs.getAnyOf() != null && !cs.getAnyOf().isEmpty()) { + anyOfExists = 1; + } + int oneOfExists = 0; + if (cs.getOneOf() != null && !cs.getOneOf().isEmpty()) { + oneOfExists = 1; + } + if (allOfExists + anyOfExists + oneOfExists > 1) { + // what if it needs one oneOf schema, one anyOf schema, and two allOf schemas? + return fullPrefix + closeChars; + } + // for now only oneOf with discriminator is supported + if (!(oneOfExists == 1 && disc != null)) { + return fullPrefix + closeChars; + } + } + if (disc != null) { + MappedModel mm = getDiscriminatorMappedModel(disc); + if (mm == null) { + return fullPrefix + closeChars; + } + String discPropNameValue = mm.mappingName; + String schemaName = getSchemaName(mm.modelName); + Schema modelSchema = getModelNameToSchemaCache().get(schemaName); + CodegenSchema cp = new CodegenSchema(); + cp.jsonPathPiece = getKey(disc.propertyName.original); + cp.example = discPropNameValue; + return exampleForObjectModel(modelSchema, fullPrefix, closeChars, cp, indentationLevel, exampleLine, closingIndentation, includedSchemas); + } + Object addPropsObj = schema.getAdditionalProperties(); + if (hasProperties) { + return exampleForObjectModel(schema, fullPrefix, closeChars, null, indentationLevel, exampleLine, closingIndentation, includedSchemas); + } else if (addPropsObj instanceof Schema) { + // TODO handle true case for additionalProperties + Schema addPropsSchema = (Schema) addPropsObj; + String key = "key"; + Object addPropsExample = getObjectExample(addPropsSchema); + if (addPropsSchema.getEnum() != null && !addPropsSchema.getEnum().isEmpty()) { + key = addPropsSchema.getEnum().get(0).toString(); + } + addPropsExample = exampleFromStringOrArraySchema(addPropsSchema, addPropsExample, key); + String addPropPrefix = key + "="; + if (modelName == null) { + addPropPrefix = ensureQuotes(key) + ": "; + } + String addPropsModelName = getRefClassWithRefModule(addPropsSchema); + if(includedSchemas.contains(schema)) { + return ""; + } + includedSchemas.add(schema); + + example = fullPrefix + "\n" + toExampleValueRecursive(addPropsModelName, addPropsSchema, addPropsExample, indentationLevel + 1, addPropPrefix, exampleLine + 1, includedSchemas) + ",\n" + closingIndentation + closeChars; + } else { + example = fullPrefix + closeChars; + } + } else { + LOGGER.warn("Type " + schema.getType() + " not handled properly in toExampleValue"); + } + + return example; + } + + private boolean potentiallySelfReferencingSchema(Schema schema) { + return null != schema.get$ref() || ModelUtils.isArraySchema(schema) || ModelUtils.isMapSchema(schema) || ModelUtils.isObjectSchema(schema) || ModelUtils.isComposedSchema(schema); + } + + private String exampleForObjectModel(Schema schema, String fullPrefix, String closeChars, CodegenSchema discProp, int indentationLevel, int exampleLine, String closingIndentation, List includedSchemas) { + + Map requiredAndOptionalProps = ((Schema) schema).getProperties(); + if (requiredAndOptionalProps == null || requiredAndOptionalProps.isEmpty()) { + return fullPrefix + closeChars; + } + + if(includedSchemas.contains(schema)) { + return ""; + } + includedSchemas.add(schema); + + StringBuilder exampleBuilder = new StringBuilder(fullPrefix + "\n"); + for (Map.Entry entry : requiredAndOptionalProps.entrySet()) { + String propName = entry.getKey(); + Schema propSchema = entry.getValue(); + propName = toVarName(propName); + String propModelName = null; + Object propExample; + if (discProp != null && propName.equals(discProp.jsonPathPiece.original)) { + propExample = discProp.example; + } else { + propModelName = getRefClassWithRefModule(propSchema); + propExample = exampleFromStringOrArraySchema( + propSchema, + null, + propName); + } + + exampleBuilder.append(toExampleValueRecursive(propModelName, + propSchema, + propExample, + indentationLevel + 1, + propName + "=", + exampleLine + 1, + includedSchemas)).append(",\n"); + } + String example = exampleBuilder.toString(); + + // TODO handle additionalProperties also + example += closingIndentation + closeChars; + return example; + + } + + private Object exampleFromStringOrArraySchema(Schema sc, Object currentExample, String propName) { + if (currentExample != null) { + return currentExample; + } + Schema schema = sc; + if (sc == null) { + return null; + } + String ref = sc.get$ref(); + if (ref != null) { + schema = ModelUtils.getSchema(this.openAPI, ModelUtils.getSimpleRef(ref)); + } + if (schema == null) { + return null; + } + Object example = getObjectExample(schema); + if (example != null) { + return example; + } else if (simpleStringSchema(schema)) { + return propName + "_example"; + } else if (ModelUtils.isArraySchema(schema)) { + ArraySchema arraySchema = (ArraySchema) schema; + Schema itemSchema = arraySchema.getItems(); + example = getObjectExample(itemSchema); + if (example != null) { + return example; + } else if (simpleStringSchema(itemSchema)) { + return propName + "_example"; + } + } + return null; + } + + + /*** + * + * Set the codegenParameter example value + * We have a custom version of this function, so we can invoke toExampleValue + * + * @param parameter the base parameter that came from the spec + */ + @Override + public String getParameterExampleValue(Parameter parameter) { + Schema schema = parameter.getSchema(); + if (schema == null) { + LOGGER.warn("CodegenParameter.example defaulting to null because parameter lacks a schema"); + return null; + } + + Object example; + if (parameter.getExtensions() != null && parameter.getExtensions().containsKey("x-example")) { + example = parameter.getExtensions().get("x-example"); + } else if (parameter.getExample() != null) { + example = parameter.getExample(); + } else if (parameter.getExamples() != null && !parameter.getExamples().isEmpty() && parameter.getExamples().values().iterator().next().getValue() != null) { + example = parameter.getExamples().values().iterator().next().getValue(); + } else { + example = getObjectExample(schema); + } + example = exampleFromStringOrArraySchema(schema, example, parameter.getName()); + return toExampleValue(schema, example); + } + + /** + * Return a map from model name to Schema for efficient lookup. + * + * @return map from model name to Schema. + */ + protected Map getModelNameToSchemaCache() { + if (modelNameToSchemaCache == null) { + // Create a cache to efficiently lookup schema based on model name. + Map m = new HashMap<>(); + ModelUtils.getSchemas(openAPI).forEach((key, schema) -> m.put(toModelName(key, null), schema)); + modelNameToSchemaCache = Collections.unmodifiableMap(m); + } + return modelNameToSchemaCache; + } + + /** + * Notes: + * RgxGen does not support our ECMA dialect + * ... + * So strip off the leading / and trailing / and turn on ignore case if we have it + * + * json schema test cases omit the leading and trailing /s, so make sure that the regex allows that + * + * Flags: + * ... + * d hasIndices: indicates that the result of a regular expression match should contain the start and end indices of the substrings of each capture group + * g global: the regular expression should be tested against all possible matches in a string + * i ignoreCase: case should be ignored while attempting a match in a string + * m multiline: a multiline input string should be treated as multiple lines + * s dotAll: the dot special character (.) should additionally match 4 line terminator ("newline") characters in a string + * u unicode: enables various Unicode-related features such as unicode code point escapes + * y sticky: the regex attempts to match the target string only from the index indicated by the lastIndex property + * + * Python flags: + * ... + * i, m, s u + * + * @param pattern the pattern (regular expression) + * @return the resultant regex for python + */ + @Override + public CodegenPatternInfo getPatternInfo(String pattern) { + if (pattern == null) { + return null; + } + Matcher m = patternRegex.matcher(pattern); + if (m.find()) { + int groupCount = m.groupCount(); + if (groupCount == 1) { + // only pattern found + String isolatedPattern = m.group(1); + return new CodegenPatternInfo(isolatedPattern, null); + } else if (groupCount == 2) { + // patterns and flag found + String isolatedPattern = m.group(1); + String foundFlags = m.group(2); + if (foundFlags.isEmpty()) { + return new CodegenPatternInfo(isolatedPattern, null); + } + LinkedHashSet flags = new LinkedHashSet<>(); + for (Character c: foundFlags.toCharArray()) { + flags.add(c.toString()); + } + return new CodegenPatternInfo(isolatedPattern, flags); + } + } + return new CodegenPatternInfo(pattern, null); + } + + @Override + public CodegenType getTag() { + return CodegenType.CLIENT; + } + + @Override + public String apiDocFileFolder() { + return (outputFolder + File.separator + apiDocPath); + } + + @Override + public String toApiDocFilename(String name) { + return toApiName(name); + } + + @Override + public String toResponseModuleName(String componentName, String jsonPath) { + if (!jsonPath.startsWith("#/components/responses/")) { + return "response_" + componentName.toLowerCase(Locale.ROOT); + } + String suffix = toModuleFilename(componentName, jsonPath); + String spacer = ""; + if (!suffix.startsWith("_")) { + spacer = "_"; + } + return "response" + spacer + suffix; + } + + @Override + public String toRequestBodyFilename(String componentName) { + return toModuleFilename("request_body_" + componentName, null); + } + + public String toHeaderFilename(String componentName, String jsonPath) { return toModuleFilename("header_" + componentName, null); } + + @Override + public String apiFileFolder() { + return outputFolder + File.separatorChar + packagePath() + File.separatorChar + apiPackage() + File.separatorChar + "tags"; + } + + @Override + public String apiTestFileFolder() { + return outputFolder + File.separatorChar + testFolder; + } + + @Override + public String modelTestFileFolder() { + return outputFolder + File.separatorChar + testFolder + File.separatorChar + modelPackage.replace('.', File.separatorChar); + } + + public void setUseNose(String val) { + this.useNose = Boolean.parseBoolean(val); + } + + public void setPackageUrl(String packageUrl) { + this.packageUrl = packageUrl; + } + + public String packagePath() { + // src is needed for modern packaging per + // https://packaging.python.org/en/latest/tutorials/packaging-projects/ + return "src" + File.separatorChar + packageName.replace('.', File.separatorChar); } + + @Override + public String packageName() { + return packageName; + } + + protected boolean needToImport(String refClass) { + return refClass.contains("."); + } + + @Override + public String defaultTemplatingEngine() { + return "handlebars"; + } + + @Override + public String generatorLanguageVersion() { return ">=3.7"; } + + @Override + public void preprocessOpenAPI(OpenAPI openAPI) { + String originalSpecVersion; + String xOriginalSwaggerVersion = "x-original-swagger-version"; + if (openAPI.getExtensions() != null && !openAPI.getExtensions().isEmpty() && openAPI.getExtensions().containsKey(xOriginalSwaggerVersion)) { + originalSpecVersion = (String) openAPI.getExtensions().get(xOriginalSwaggerVersion); + } else { + originalSpecVersion = openAPI.getOpenapi(); + } + int specMajorVersion = Integer.parseInt(originalSpecVersion.substring(0, 1)); + if (specMajorVersion < 3) { + throw new RuntimeException("Your spec version of "+originalSpecVersion+" is too low. " + getName() + " only works with specs with version >= 3.X.X. Please use a tool like Swagger Editor or Swagger Converter to convert your spec to v3"); + } + } + + /** + * Note: a custom version of this function is used so the original tag value can be used + * + * @param tag Tag + * @return the tag to use + */ + @Override + public String sanitizeTag(String tag) { + return tag; + } + + public Map postProcessSupportingFileData(Map data) { + data.put(CodegenConstants.NON_COMPLIANT_USE_DISCR_IF_COMPOSITION_FAILS, nonCompliantUseDiscrIfCompositionFails); + return data; + } + + @Override + protected String getImport(String className, CodegenSchema schema) { + if (className == null) { + return "from " + packageName() + ".components.schema import " + schema.refInfo.refModule; + } + String[] classPieces = className.split("\\."); + return "from " + packageName() + ".components.schema import " + classPieces[0]; + } + + @Override + protected String getRefClassWithModule(String ref, String sourceJsonPath) { + String refModule = toRefModule(ref, sourceJsonPath, "schemas"); + String refClass = toRefClass(ref, sourceJsonPath, "schemas"); + if (refModule == null) { + return refClass; + } + return refModule + "." + refClass; + } + + @Override + public String toParameterFilename(String name, String jsonPath) { + // adds prefix parameter_ onto the result so modules do not start with _ + try { + Integer.parseInt(name); + // for parameters in path, or an endpoint + return "parameter_" + name; + } catch (NumberFormatException nfe) { + // for header parameters in responses + return "parameter_" + toModuleFilename(name, null); + } + } + + @Override + public String toSecuritySchemeFilename(String basename, String jsonPath) { + return "security_scheme_" + toModuleFilename(basename, null); + } + + @Override + public String toServerFilename(String basename, String jsonPath) { + return "server_" + basename; + } + + @Override + public String toSecurityRequirementObjectFilename(String basename, String jsonPath) { + return "security_requirement_object_" + basename; + } + + @Override + public String getCamelCaseServer(String basename) { + return "Server" + basename; + } + + @Override + public String getCamelCaseParameter(String name) { + try { + Integer.parseInt(name); + // for parameters in path, or an endpoint + return "Parameter" + name; + } catch (NumberFormatException nfe) { + // for header parameters in responses + return toModelName(name, null); + } + } + + public String getCamelCaseResponse(String name) { + if (name.matches("^\\d[X\\d]{2}$")) { + // 200 or 2XX + return "ResponseFor" + name; + } + return toModelName(name, null); + } + + @Override + public String toParamName(String basename) { + return toParameterFilename(basename, null); + } + + private String toSchemaRefClass(String ref, String sourceJsonPath) { + String[] refPieces = ref.split("/"); + if (ref.equals(sourceJsonPath)) { + // self reference, no import needed + if (ref.startsWith("#/components/schemas/") && refPieces.length == 4) { + return toModelName(refPieces[3], ref); + } + Set httpMethods = new HashSet<>(Arrays.asList("post", "put", "patch", "get", "delete", "trace", "options")); + boolean requestBodyCase = ( + refPieces.length == 8 && + refPieces[1].equals("paths") && + httpMethods.contains(refPieces[3]) && + refPieces[4].equals("requestBody") && + refPieces[5].equals("content") && + refPieces[7].equals("schema") + ); + if (requestBodyCase) { + String contentType = ModelUtils.decodeSlashes(refPieces[6]); + // the code knows that content-type are never valid python names + return toVarName(contentType); + } + return null; + } + if (sourceJsonPath != null && ref.startsWith(sourceJsonPath + "/")) { + // internal in-schema reference, no import needed + // TODO handle this in the future + return null; + } + // reference is external, import needed + // module info is stored in refModule + if (ref.startsWith("#/components/schemas/") && refPieces.length == 4) { + String schemaName = refPieces[3]; + return toModelName(schemaName, ref); + } + return null; + } + + private String toRequestBodyRefClass(String ref) { + String[] refPieces = ref.split("/"); + if (ref.startsWith("#/components/requestBodies/") && refPieces.length == 4) { + return toModelName(refPieces[3], ref); + } + return null; + } + + private String toResponseRefClass(String ref) { + String[] refPieces = ref.split("/"); + if (ref.startsWith("#/components/responses/") && refPieces.length == 4) { + return toModelName(refPieces[3], ref); + } + return null; + } + + private String toHeaderRefClass(String ref) { + String[] refPieces = ref.split("/"); + if (ref.startsWith("#/components/headers/") && refPieces.length == 4) { + return toModelName(refPieces[3], ref); + } + return null; + } + + private String toParameterRefClass(String ref) { + String[] refPieces = ref.split("/"); + if (ref.startsWith("#/components/parameters/") && refPieces.length == 4) { + return toModelName(refPieces[3], ref); + } + return null; + } + + private String toSecuritySchemesRefClass(String ref) { + String[] refPieces = ref.split("/"); + if (ref.startsWith("#/components/securitySchemes/") && refPieces.length == 4) { + return toModelName(refPieces[3], ref); + } + return null; + } + + @Override + public String toRefClass(String ref, String sourceJsonPath, String expectedComponentType) { + if (ref == null) { + return null; + } + switch (expectedComponentType) { + case "schemas": + return toSchemaRefClass(ref, sourceJsonPath); + case "requestBodies": + return toRequestBodyRefClass(ref); + case "responses": + return toResponseRefClass(ref); + case "headers": + return toHeaderRefClass(ref); + case "parameters": + return toParameterRefClass(ref); + case "securitySchemes": + return toSecuritySchemesRefClass(ref); + } + return null; + } + + @Override + public String getOperationIdSnakeCase(String operationId) { + // throw exception if method name is empty (should not occur as an auto-generated method name will be used) + if (StringUtils.isEmpty(operationId)) { + throw new RuntimeException("Empty method name (operationId) not allowed"); + } + + // method name cannot use reserved keyword, e.g. return + if (isReservedWord(operationId)) { + LOGGER.warn("{} (reserved word) cannot be used as method name. Renamed to {}", operationId, underscore(sanitizeName("call_" + operationId))); + operationId = "call_" + operationId; + } + + // operationId starts with a number + if (operationId.matches("^\\d.*")) { + LOGGER.warn("{} (starting with a number) cannot be used as method name. Renamed to {}", operationId, underscore(sanitizeName("call_" + operationId))); + operationId = "call_" + operationId; + } + + return underscore(sanitizeName(operationId)); + } + + @Override + public void postProcess() { + System.out.println("################################################################################"); + System.out.println("# Thanks for using OpenAPI JSON Schema Generator. #"); + System.out.println("# Please consider donation to help us maintain this project \uD83D\uDE4F #"); + System.out.println("# https://github.com/sponsors/spacether #"); + System.out.println("# #"); + System.out.println("# This generator was written by Justin Black (https://github.com/spacether) #"); + System.out.println("# Please support his work directly via https://github.com/sponsors/spacether \uD83D\uDE4F#"); + System.out.println("################################################################################"); + } +} diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/features/BeanValidationExtendedFeatures.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/features/BeanValidationExtendedFeatures.java similarity index 93% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/features/BeanValidationExtendedFeatures.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/features/BeanValidationExtendedFeatures.java index adfa20dc46d..ce4007954c2 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/features/BeanValidationExtendedFeatures.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/features/BeanValidationExtendedFeatures.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.openapitools.codegen.languages.features; +package org.openapijsonschematools.codegen.languages.features; public interface BeanValidationExtendedFeatures { diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/features/BeanValidationFeatures.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/features/BeanValidationFeatures.java similarity index 93% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/features/BeanValidationFeatures.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/features/BeanValidationFeatures.java index cc895613bc9..8a3abc60786 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/features/BeanValidationFeatures.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/features/BeanValidationFeatures.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.openapitools.codegen.languages.features; +package org.openapijsonschematools.codegen.languages.features; public interface BeanValidationFeatures { diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/features/CXFExtServerFeatures.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/features/CXFExtServerFeatures.java similarity index 90% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/features/CXFExtServerFeatures.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/features/CXFExtServerFeatures.java index 679ec0a24c2..84c4a6ddd48 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/features/CXFExtServerFeatures.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/features/CXFExtServerFeatures.java @@ -1,4 +1,4 @@ -package org.openapitools.codegen.languages.features; +package org.openapijsonschematools.codegen.languages.features; import java.io.File; diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/features/CXFFeatures.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/features/CXFFeatures.java similarity index 93% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/features/CXFFeatures.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/features/CXFFeatures.java index 2564ea05f89..ceaef2a387e 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/features/CXFFeatures.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/features/CXFFeatures.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.openapitools.codegen.languages.features; +package org.openapijsonschematools.codegen.languages.features; /** * Features supported by CXF 3 (client + server) diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/features/CXFServerFeatures.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/features/CXFServerFeatures.java similarity index 96% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/features/CXFServerFeatures.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/features/CXFServerFeatures.java index ff6561f3f80..c54f33988e9 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/features/CXFServerFeatures.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/features/CXFServerFeatures.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.openapitools.codegen.languages.features; +package org.openapijsonschematools.codegen.languages.features; /** * Features supported by CXF 3 server diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/features/DocumentationProviderFeatures.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/features/DocumentationProviderFeatures.java similarity index 98% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/features/DocumentationProviderFeatures.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/features/DocumentationProviderFeatures.java index b4edcaea5df..9912e9ebd02 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/features/DocumentationProviderFeatures.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/features/DocumentationProviderFeatures.java @@ -1,4 +1,4 @@ -package org.openapitools.codegen.languages.features; +package org.openapijsonschematools.codegen.languages.features; import java.util.ArrayList; import java.util.Arrays; diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/features/GzipFeatures.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/features/GzipFeatures.java similarity index 92% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/features/GzipFeatures.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/features/GzipFeatures.java index f8683233094..8a277192067 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/features/GzipFeatures.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/features/GzipFeatures.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.openapitools.codegen.languages.features; +package org.openapijsonschematools.codegen.languages.features; public interface GzipFeatures { diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/features/GzipTestFeatures.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/features/GzipTestFeatures.java similarity index 93% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/features/GzipTestFeatures.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/features/GzipTestFeatures.java index 5f036dd6880..1c47c1b2659 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/features/GzipTestFeatures.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/features/GzipTestFeatures.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.openapitools.codegen.languages.features; +package org.openapijsonschematools.codegen.languages.features; public interface GzipTestFeatures { diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/features/JbossFeature.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/features/JbossFeature.java similarity index 93% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/features/JbossFeature.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/features/JbossFeature.java index c022ef8cea6..c5258a79ad6 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/features/JbossFeature.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/features/JbossFeature.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.openapitools.codegen.languages.features; +package org.openapijsonschematools.codegen.languages.features; public interface JbossFeature { diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/features/LoggingFeatures.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/features/LoggingFeatures.java similarity index 93% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/features/LoggingFeatures.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/features/LoggingFeatures.java index e7b75a898dd..fabf006bcaf 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/features/LoggingFeatures.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/features/LoggingFeatures.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.openapitools.codegen.languages.features; +package org.openapijsonschematools.codegen.languages.features; public interface LoggingFeatures extends BeanValidationFeatures { diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/features/LoggingTestFeatures.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/features/LoggingTestFeatures.java similarity index 93% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/features/LoggingTestFeatures.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/features/LoggingTestFeatures.java index c342f127c2c..1e34168d020 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/features/LoggingTestFeatures.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/features/LoggingTestFeatures.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.openapitools.codegen.languages.features; +package org.openapijsonschematools.codegen.languages.features; public interface LoggingTestFeatures { diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/features/OptionalFeatures.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/features/OptionalFeatures.java similarity index 93% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/features/OptionalFeatures.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/features/OptionalFeatures.java index 39c1746f09e..d2015ba8df5 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/features/OptionalFeatures.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/features/OptionalFeatures.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.openapitools.codegen.languages.features; +package org.openapijsonschematools.codegen.languages.features; public interface OptionalFeatures { diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/features/PerformBeanValidationFeatures.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/features/PerformBeanValidationFeatures.java similarity index 93% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/features/PerformBeanValidationFeatures.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/features/PerformBeanValidationFeatures.java index f2b5369f544..0a82891db3c 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/features/PerformBeanValidationFeatures.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/features/PerformBeanValidationFeatures.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.openapitools.codegen.languages.features; +package org.openapijsonschematools.codegen.languages.features; public interface PerformBeanValidationFeatures { diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/features/SpringFeatures.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/features/SpringFeatures.java similarity index 95% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/features/SpringFeatures.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/features/SpringFeatures.java index 7976b39c272..430f794958e 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/features/SpringFeatures.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/features/SpringFeatures.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.openapitools.codegen.languages.features; +package org.openapijsonschematools.codegen.languages.features; public interface SpringFeatures extends BeanValidationFeatures { diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/features/SwaggerFeatures.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/features/SwaggerFeatures.java similarity index 93% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/features/SwaggerFeatures.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/features/SwaggerFeatures.java index c37135d2958..9ad9d484591 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/features/SwaggerFeatures.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/features/SwaggerFeatures.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.openapitools.codegen.languages.features; +package org.openapijsonschematools.codegen.languages.features; public interface SwaggerFeatures { diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/features/SwaggerUIFeatures.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/features/SwaggerUIFeatures.java similarity index 92% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/features/SwaggerUIFeatures.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/features/SwaggerUIFeatures.java index e3e73d29ea2..e780305de65 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/features/SwaggerUIFeatures.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/features/SwaggerUIFeatures.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.openapitools.codegen.languages.features; +package org.openapijsonschematools.codegen.languages.features; public interface SwaggerUIFeatures { diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/features/UseGenericResponseFeatures.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/features/UseGenericResponseFeatures.java similarity index 93% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/features/UseGenericResponseFeatures.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/features/UseGenericResponseFeatures.java index c035bffc432..62296b5d15e 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/features/UseGenericResponseFeatures.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/features/UseGenericResponseFeatures.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.openapitools.codegen.languages.features; +package org.openapijsonschematools.codegen.languages.features; public interface UseGenericResponseFeatures { diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/CodegenDiscriminator.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/CodegenDiscriminator.java new file mode 100644 index 00000000000..182be939bed --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/CodegenDiscriminator.java @@ -0,0 +1,120 @@ +package org.openapijsonschematools.codegen.model; + +import java.util.LinkedHashSet; +import java.util.Map; +import java.util.Objects; +import java.util.TreeSet; + +/** + * This class encapsulates the OpenAPI discriminator construct, as specified at + * https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.3.md#discriminatorObject. + * + * When request bodies or response payloads may be one of a number of different schemas, + * a discriminator object can be used to aid in serialization, deserialization, and validation. + * The discriminator is a specific object in a schema which is used to inform the consumer of + * the specification of an alternative schema based on the value associated with it. + */ +public class CodegenDiscriminator { + // The name of the property in the payload that will hold the discriminator value. + // This is the propertyName as specified in the OpenAPI discriminator object. + public final CodegenKey propertyName; + public final Map mapping; + + // mappedModels is populated differently if legacyDiscriminatorBehavior is + // True or False. When: + // + // legacyDiscriminatorBehavior == False, this contains: + // - the name to schema map info in the discriminator mapping entry in your openapi spec OR + // - child schemas that allOf inherit self schema + // + // legacyDiscriminatorBehavior == True, this contains: + // - the name to schema map info in the discriminMappedModelator mapping entry in your openapi spec AND + // - x-discriminator-value mappings in child oneOf + anyOf schemas + descendant schemas that allOf inherit self schema AND + // - descendant schemas that allOf inherit self schema AND + // - child oneOf + anyOf schemas + // + // see the method createDiscriminator in DefaultCodegen.java + + public final TreeSet mappedModels; + + public CodegenDiscriminator(CodegenKey propertyName, Map mapping, TreeSet mappedModels) { + this.propertyName = propertyName; + this.mapping = mapping; + this.mappedModels = mappedModels; + } + + + /** + * An object to hold discriminator mappings between payload values and schema names or + * references. + * + * In the OpenAPI document, the discriminator "mapping" attribute is optional. + * In scenarios where the value of the discriminator field does not match the schema name + * or implicit mapping is not possible, an optional mapping definition MAY be used. + * In OpenAPITools codegen, the MappedModel is the union of all the discriminator mappings, + * both explicitly defined in the OpenAPI document and inherited from oneOf/allOf/anyOf. + */ + public static class MappedModel implements Comparable{ + // The value of the discriminator property in the payload. + public final String mappingName; + // The OAS schema name. It is obtained from the OAS document, and the string value + // is converted to a sanitized, internal representation within codegen. + public final String modelName; + + public MappedModel(String mappingName, String modelName) { + this.mappingName = mappingName; + this.modelName = modelName; + } + + @Override + public int compareTo(MappedModel other) { + if (mappingName == null && other.mappingName == null) { + return 0; + } else if (mappingName == null) { + return 1; + } else if (other.mappingName == null) { + return -1; + } + return mappingName.compareTo(other.mappingName); + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + MappedModel that = (MappedModel) o; + return Objects.equals(mappingName, that.mappingName) && + Objects.equals(modelName, that.modelName); + } + + @Override + public int hashCode() { + return Objects.hash(mappingName, modelName); + } + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + CodegenDiscriminator that = (CodegenDiscriminator) o; + return Objects.equals(propertyName, that.propertyName) && + Objects.equals(mapping, that.mapping) && + Objects.equals(mappedModels, that.mappedModels); + } + + @Override + public int hashCode() { + return Objects.hash(propertyName, mapping, mappedModels); + } + + @Override + public String toString() { + final StringBuffer sb = new StringBuffer("CodegenDiscriminator{"); + sb.append("propertyName='").append(propertyName).append('\''); + sb.append(", mapping=").append(mapping); + sb.append(", mappedModels=").append(mappedModels); + sb.append('}'); + return sb.toString(); + } +} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/CodegenEncoding.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/CodegenEncoding.java new file mode 100644 index 00000000000..e196d6196dc --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/CodegenEncoding.java @@ -0,0 +1,47 @@ +package org.openapijsonschematools.codegen.model; + +import java.util.Map; +import java.util.Objects; + +public class CodegenEncoding { + public final String contentType; + public final Map headers; + public final String style; + public final Boolean explode; + public final Boolean allowReserved; + + public CodegenEncoding(String contentType, Map headers, String style, Boolean explode, Boolean allowReserved) { + this.contentType = contentType; + this.headers = headers; + this.style = style; + this.explode = explode; + this.allowReserved = allowReserved; + } + + public String toString() { + final StringBuilder sb = new StringBuilder("CodegenEncoding{"); + sb.append("contentType=").append(contentType); + sb.append(", headers=").append(headers); + sb.append(", style=").append(style); + sb.append(", explode=").append(explode); + sb.append(", allowReserved=").append(allowReserved); + sb.append('}'); + return sb.toString(); + } + + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + CodegenEncoding that = (CodegenEncoding) o; + return contentType == that.contentType && + Objects.equals(headers, that.headers) && + style == that.style && + explode == that.explode && + allowReserved == that.allowReserved; + } + + @Override + public int hashCode() { + return Objects.hash(contentType, headers, style, explode, allowReserved); + } +} diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/CodegenHeader.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/CodegenHeader.java new file mode 100644 index 00000000000..730366c8c4f --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/CodegenHeader.java @@ -0,0 +1,154 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * Copyright 2018 SmartBear Software + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapijsonschematools.codegen.model; + +import org.openapijsonschematools.codegen.utils.ModelUtils; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Objects; +import java.util.TreeSet; + +/** + * Describes a single operation parameter in the OAS specification. + * A unique parameter is defined by a combination of a name and location. + * Parameters may be located in a path, query, header or cookie. + */ +public class CodegenHeader { + public final String description; + public final String unescapedDescription; + public final String example; // example value (x-example) + public final Map vendorExtensions; + public final Boolean required; + public final LinkedHashMap content; + public final TreeSet imports; + public final boolean componentModule; + public final CodegenKey jsonPathPiece; + public final Boolean explode; + public final String style; + public final Boolean deprecated; + public final CodegenSchema schema; + public final CodegenRefInfo refInfo; + + public CodegenHeader(String description, String unescapedDescription, String example, Map vendorExtensions, Boolean required, LinkedHashMap content, TreeSet imports, boolean componentModule, CodegenKey jsonPathPiece, Boolean explode, String style, Boolean deprecated, CodegenSchema schema, CodegenRefInfo refInfo) { + this.description = description; + this.unescapedDescription = unescapedDescription; + this.example = example; + this.vendorExtensions = vendorExtensions; + this.required = required; + this.content = content; + this.imports = imports; + this.componentModule = componentModule; + this.jsonPathPiece = jsonPathPiece; + this.explode = explode; + this.style = style; + this.deprecated = deprecated; + this.schema = schema; + this.refInfo = refInfo; + } + + @Override + public int hashCode() { + return Objects.hash(jsonPathPiece, explode, description, unescapedDescription, style, example, vendorExtensions, deprecated, required, schema, content, refInfo, imports, componentModule); + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (!(o instanceof CodegenHeader)) return false; + CodegenHeader that = (CodegenHeader) o; + return required == that.required && + Objects.equals(jsonPathPiece, that.jsonPathPiece) && + Objects.equals(componentModule, that.componentModule) && + Objects.equals(imports, that.imports) && + Objects.equals(content, that.content) && + Objects.equals(description, that.description) && + Objects.equals(unescapedDescription, that.unescapedDescription) && + Objects.equals(example, that.example) && + Objects.equals(vendorExtensions, that.vendorExtensions) && + explode == that.explode && + deprecated == that.deprecated && + Objects.equals(schema, that.schema) && + Objects.equals(style, that.style) && + Objects.equals(refInfo, that.refInfo); + } + + protected void addInstanceInfo(StringBuilder sb) { + sb.append("name='").append(jsonPathPiece).append('\''); + sb.append(", description='").append(description).append('\''); + sb.append(", unescapedDescription='").append(unescapedDescription).append('\''); + sb.append(", example='").append(example).append('\''); + sb.append(", vendorExtensions=").append(vendorExtensions); + sb.append(", required=").append(required); + sb.append(", content=").append(content); + sb.append(", imports=").append(imports); + sb.append(", componentModule=").append(componentModule); + sb.append(", explode=").append(explode); + sb.append(", style='").append(style).append('\''); + sb.append(", deprecated=").append(deprecated); + sb.append(", schema=").append(schema); + sb.append(", refInfo=").append(refInfo); + } + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder("CodegenHeader{"); + addInstanceInfo(sb); + sb.append('}'); + return sb.toString(); + } + + public CodegenHeader getDeepestRef() { + if (refInfo == null) { + return null; + } + CodegenHeader refObject = refInfo.ref; + while (refObject.refInfo != null) { + refObject = refObject.refInfo.ref; + } + return refObject; + } + + public CodegenSchema getSetSchema() { + if (schema != null) { + return schema; + } + if (content != null) { + for (CodegenMediaType codegenMediaType: content.values()) { + return codegenMediaType.schema; + } + } + return null; + } + + public String getSetSchemaJsonPath(String jsonPath) { + if (schema != null) { + return jsonPath + "/schema"; + } + if (content != null) { + for (Map.Entry entry: content.entrySet()) { + if (entry.getValue().schema != null) { + String contentType = entry.getKey().original; + return jsonPath + "/content/" + ModelUtils.encodeSlashes(contentType) + "/schema"; + } + } + } + return null; + } +} + diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/CodegenKey.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/CodegenKey.java new file mode 100644 index 00000000000..ce0d460ae62 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/CodegenKey.java @@ -0,0 +1,41 @@ +package org.openapijsonschematools.codegen.model; + +import java.util.Objects; + +public class CodegenKey implements Comparable { + public final String original; + public final boolean isValid; + public final String snakeCase; + public final String camelCase; + public final String anchorPiece; + + public CodegenKey(String original, boolean isValid, String snakeCase, String camelCase, String anchorPiece) { + this.original = original; + this.isValid = isValid; + this.snakeCase = snakeCase; + this.camelCase = camelCase; + this.anchorPiece = anchorPiece; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + CodegenKey that = (CodegenKey) o; + return Objects.equals(original, that.original) && + Objects.equals(isValid, that.isValid) && + Objects.equals(snakeCase, that.snakeCase) && + Objects.equals(camelCase, that.camelCase) && + Objects.equals(anchorPiece, that.anchorPiece); + } + + @Override + public int hashCode() { + return Objects.hash(original, isValid, snakeCase, camelCase, anchorPiece); + } + + @Override + public int compareTo(CodegenKey other) { + return original.compareTo(other.original); + } +} diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/CodegenMediaType.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/CodegenMediaType.java new file mode 100644 index 00000000000..9574dcebae9 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/CodegenMediaType.java @@ -0,0 +1,40 @@ +package org.openapijsonschematools.codegen.model; + +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Objects; + +public class CodegenMediaType { + public final CodegenSchema schema; + public final LinkedHashMap encoding; + public final HashMap testCases; + + public CodegenMediaType(CodegenSchema schema, LinkedHashMap encoding, HashMap testCases) { + this.schema = schema; + this.encoding = encoding; + this.testCases = testCases; + } + + public String toString() { + final StringBuilder sb = new StringBuilder("CodegenMediaType{"); + sb.append("schema=").append(schema); + sb.append(", encoding=").append(encoding); + sb.append('}'); + return sb.toString(); + } + + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + CodegenMediaType that = (CodegenMediaType) o; + return Objects.equals(schema,that.schema) && + Objects.equals(encoding, that.encoding); + } + + @Override + public int hashCode() { + return Objects.hash(schema, encoding); + } +} + + diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/CodegenOauthFlow.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/CodegenOauthFlow.java new file mode 100644 index 00000000000..e7dbf925748 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/CodegenOauthFlow.java @@ -0,0 +1,21 @@ +package org.openapijsonschematools.codegen.model; + +import io.swagger.v3.oas.models.security.Scopes; + +import java.util.Map; + +public class CodegenOauthFlow { + public final String authorizationUrl; + public final String tokenUrl; + public final String refreshUrl; + public final Scopes scopes; + public final Map vendorExtensions; + + public CodegenOauthFlow(String authorizationUrl, String tokenUrl, String refreshUrl, Scopes scopes, Map vendorExtensions) { + this.authorizationUrl = authorizationUrl; + this.tokenUrl = tokenUrl; + this.refreshUrl = refreshUrl; + this.scopes = scopes; + this.vendorExtensions = vendorExtensions; + } +} diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/CodegenOauthFlows.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/CodegenOauthFlows.java new file mode 100644 index 00000000000..04dd8f0128f --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/CodegenOauthFlows.java @@ -0,0 +1,21 @@ +package org.openapijsonschematools.codegen.model; + +import io.swagger.v3.oas.models.security.OAuthFlow; + +import java.util.Map; + +public class CodegenOauthFlows { + public final CodegenOauthFlow implicit; + public final CodegenOauthFlow password; + public final CodegenOauthFlow clientCredentials; + public final CodegenOauthFlow authorizationCode; + public final Map vendorExtensions; + + public CodegenOauthFlows(CodegenOauthFlow implicit, CodegenOauthFlow password, CodegenOauthFlow clientCredentials, CodegenOauthFlow authorizationCode, Map vendorExtensions) { + this.implicit = implicit; + this.password = password; + this.clientCredentials = clientCredentials; + this.authorizationCode = authorizationCode; + this.vendorExtensions = vendorExtensions; + } +} diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/CodegenOperation.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/CodegenOperation.java new file mode 100644 index 00000000000..0067bdd9b51 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/CodegenOperation.java @@ -0,0 +1,237 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * Copyright 2018 SmartBear Software + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapijsonschematools.codegen.model; + +import io.swagger.v3.oas.models.ExternalDocumentation; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapijsonschematools.codegen.CodegenCallback; + +import java.util.*; + +public class CodegenOperation { + public final Boolean deprecated; + public final boolean hasErrorResponseObject; // if 4xx, 5xx responses have at least one error object defined + public final String summary, unescapedDescription, description; + public final LinkedHashSet produces; + public final List servers; + public final CodegenRequestBody requestBody; + public final List allParams; + public final List pathParams; + public final List queryParams; + public final List headerParams; + public final List cookieParams; + public final boolean hasRequiredParamOrBody; + public final boolean hasOptionalParamOrBody; + public final List> security; + public final Map tags; + public final TreeMap responses; + public final TreeMap statusCodeResponses; + public final TreeMap wildcardCodeResponses; + public final TreeMap nonDefaultResponses; + public final CodegenResponse defaultResponse; + public final List callbacks; + public final ExternalDocumentation externalDocs; + public final Map vendorExtensions; + public final CodegenKey operationId; + public final CodegenKey jsonPathPiece; + + public CodegenOperation(Boolean deprecated, boolean hasErrorResponseObject, String summary, String unescapedDescription, String description, LinkedHashSet produces, List servers, CodegenRequestBody requestBody, List allParams, List pathParams, List queryParams, List headerParams, List cookieParams, boolean hasRequiredParamOrBody, boolean hasOptionalParamOrBody, List> security, Map tags, TreeMap responses, TreeMap statusCodeResponses, TreeMap wildcardCodeResponses, TreeMap nonDefaultResponses, CodegenResponse defaultResponse, List callbacks, ExternalDocumentation externalDocs, Map vendorExtensions, CodegenKey operationId, CodegenKey jsonPathPiece) { + this.deprecated = deprecated; + this.hasErrorResponseObject = hasErrorResponseObject; + this.summary = summary; + this.unescapedDescription = unescapedDescription; + this.description = description; + this.produces = produces; + this.servers = servers; + this.requestBody = requestBody; + this.allParams = allParams; + this.pathParams = pathParams; + this.queryParams = queryParams; + this.headerParams = headerParams; + this.cookieParams = cookieParams; + this.hasRequiredParamOrBody = hasRequiredParamOrBody; + this.hasOptionalParamOrBody = hasOptionalParamOrBody; + this.security = security; + this.tags = tags; + this.responses = responses; + this.statusCodeResponses = statusCodeResponses; + this.wildcardCodeResponses = wildcardCodeResponses; + this.nonDefaultResponses = nonDefaultResponses; + this.defaultResponse = defaultResponse; + this.callbacks = callbacks; + this.externalDocs = externalDocs; + this.vendorExtensions = vendorExtensions; + this.operationId = operationId; + this.jsonPathPiece = jsonPathPiece; + } + + // used by operation templates + public Map getNonErrorResponses() { + HashMap nonErrorResponses = new HashMap<>(); + if (statusCodeResponses != null) { + for (Map.Entry entry: statusCodeResponses.entrySet()) { + if (entry.getKey() >= 200 && entry.getKey() <= 399) { + nonErrorResponses.put(entry.getKey().toString(), entry.getValue()); + } + } + } + if (wildcardCodeResponses != null) { + for (Map.Entry entry: wildcardCodeResponses.entrySet()) { + if (entry.getKey() == 2 || entry.getKey() == 3) { + nonErrorResponses.put(entry.getKey().toString(), entry.getValue()); + } + } + } + if (defaultResponse != null) { + if (nonErrorResponses.isEmpty()) { + /* default response should be non-error because + The Responses Object MUST contain at least one response code, and if only one response code + is provided it SHOULD be the response for a successful operation call. + */ + nonErrorResponses.put("default", defaultResponse); + } else { + // the code does not know if this is an error response or non-error + // TODO add generation option that specifies it? + nonErrorResponses.put("default", defaultResponse); + } + } + if (nonErrorResponses.isEmpty()) { + return null; + } + return nonErrorResponses; + } + + public boolean getAllResponsesAreErrors() { + if (responses.size() == 1 && defaultResponse != null) { + return false; + } + for (String code: nonDefaultResponses.keySet()) { + String firstNumber = code.substring(0, 1); + switch (firstNumber) { + case "1": case "2": case "3": + return false; + } + } + if (defaultResponse != null) { + // 404 + default, unable to tell if default is a success or an error status code + return false; + } + return true; + } + + /** + * @return contentTypeToOperation + * returns a map where the key is the request body content type and the value is the current CodegenOperation + * this is needed by templates when a different signature is needed for each request body content type + */ + @JsonIgnore + public Map getContentTypeToOperation() { + LinkedHashMap contentTypeToOperation = new LinkedHashMap<>(); + if (requestBody == null) { + return null; + } + LinkedHashMap content = null; + if (requestBody.refInfo != null) { + content = requestBody.getDeepestRef().content; + } else { + content = requestBody.content; + } + for (CodegenKey contentKey: content.keySet()) { + contentTypeToOperation.put(contentKey.original, this); + } + return contentTypeToOperation; + } + + @Override + public String toString() { + final StringBuffer sb = new StringBuffer("CodegenOperation{"); + sb.append(", deprecated=").append(deprecated); + sb.append(", operationId='").append(operationId).append('\''); + sb.append(", summary='").append(summary).append('\''); + sb.append(", unescapedNotes='").append(unescapedDescription).append('\''); + sb.append(", notes='").append(description).append('\''); + sb.append(", defaultResponse='").append(defaultResponse).append('\''); + sb.append(", produces=").append(produces); + sb.append(", servers=").append(servers); + sb.append(", requestBody=").append(requestBody); + sb.append(", allParams=").append(allParams); + sb.append(", pathParams=").append(pathParams); + sb.append(", queryParams=").append(queryParams); + sb.append(", headerParams=").append(headerParams); + sb.append(", cookieParams=").append(cookieParams); + sb.append(", hasRequiredParamOrBody=").append(hasRequiredParamOrBody); + sb.append(", hasOptionalParamOrBody=").append(hasOptionalParamOrBody); + sb.append(", security=").append(security); + sb.append(", tags=").append(tags); + sb.append(", responses=").append(responses); + sb.append(", statusCodeResponses=").append(statusCodeResponses); + sb.append(", wildcardCodeResponses=").append(wildcardCodeResponses); + sb.append(", nonDefaultResponses=").append(nonDefaultResponses); + sb.append(", callbacks=").append(callbacks); + sb.append(", externalDocs=").append(externalDocs); + sb.append(", vendorExtensions=").append(vendorExtensions); + sb.append(", jsonPathPiece=").append(jsonPathPiece); + sb.append('}'); + return sb.toString(); + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + CodegenOperation that = (CodegenOperation) o; + return deprecated == that.deprecated && + Objects.equals(operationId, that.operationId) && + Objects.equals(summary, that.summary) && + Objects.equals(unescapedDescription, that.unescapedDescription) && + Objects.equals(description, that.description) && + Objects.equals(defaultResponse, that.defaultResponse) && + Objects.equals(produces, that.produces) && + Objects.equals(servers, that.servers) && + Objects.equals(requestBody, that.requestBody) && + Objects.equals(allParams, that.allParams) && + Objects.equals(pathParams, that.pathParams) && + Objects.equals(queryParams, that.queryParams) && + Objects.equals(headerParams, that.headerParams) && + Objects.equals(cookieParams, that.cookieParams) && + Objects.equals(hasRequiredParamOrBody, that.hasRequiredParamOrBody) && + Objects.equals(hasOptionalParamOrBody, that.hasOptionalParamOrBody) && + Objects.equals(security, that.security) && + Objects.equals(tags, that.tags) && + Objects.equals(responses, that.responses) && + Objects.equals(statusCodeResponses, that.statusCodeResponses) && + Objects.equals(wildcardCodeResponses, that.wildcardCodeResponses) && + Objects.equals(nonDefaultResponses, that.nonDefaultResponses) && + Objects.equals(callbacks, that.callbacks) && + Objects.equals(externalDocs, that.externalDocs) && + Objects.equals(jsonPathPiece, that.jsonPathPiece) && + Objects.equals(vendorExtensions, that.vendorExtensions); + } + + @Override + public int hashCode() { + + return Objects.hash(deprecated, operationId, + summary, unescapedDescription, description, defaultResponse, + produces, servers, requestBody, allParams, + pathParams, queryParams, headerParams, cookieParams, hasRequiredParamOrBody, hasOptionalParamOrBody, + security, tags, responses, callbacks, externalDocs, + vendorExtensions, statusCodeResponses, wildcardCodeResponses, + nonDefaultResponses, jsonPathPiece); + } +} diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/CodegenParameter.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/CodegenParameter.java new file mode 100644 index 00000000000..87659d2bcaa --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/CodegenParameter.java @@ -0,0 +1,163 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * Copyright 2018 SmartBear Software + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapijsonschematools.codegen.model; + +import org.openapijsonschematools.codegen.utils.ModelUtils; + +import java.util.*; + +/** + * Describes a single operation parameter in the OAS specification. + * A unique parameter is defined by a combination of a name and location. + * Parameters may be located in a path, query, header or cookie. + */ +public class CodegenParameter { + public final String description; + public final String unescapedDescription; + public final String example; // example value (x-example) + public final Map vendorExtensions; + public final Boolean required; + public final LinkedHashMap content; + public final Set imports; + public final boolean componentModule; + public final CodegenKey jsonPathPiece; + public final Boolean explode; + public final String style; + public final Boolean deprecated; + public final CodegenSchema schema; + public final String in; + public final Boolean allowEmptyValue; + // stores the openapi name property + public final String name; + public final CodegenRefInfo refInfo; + public final Boolean allowReserved; + + public CodegenParameter(String description, String unescapedDescription, String example, Map vendorExtensions, Boolean required, LinkedHashMap content, Set imports, boolean componentModule, CodegenKey jsonPathPiece, Boolean explode, String style, Boolean deprecated, CodegenSchema schema, String in, Boolean allowEmptyValue, String name, CodegenRefInfo refInfo, Boolean allowReserved) { + this.description = description; + this.unescapedDescription = unescapedDescription; + this.example = example; + this.vendorExtensions = vendorExtensions; + this.required = required; + this.content = content; + this.imports = imports; + this.componentModule = componentModule; + this.jsonPathPiece = jsonPathPiece; + this.explode = explode; + this.style = style; + this.deprecated = deprecated; + this.schema = schema; + this.in = in; + this.allowEmptyValue = allowEmptyValue; + this.name = name; + this.refInfo = refInfo; + this.allowReserved = allowReserved; + } + + public CodegenParameter getDeepestRef() { + if (refInfo == null) { + return null; + } + CodegenParameter refObject = refInfo.ref; + while (refObject.refInfo != null) { + refObject = refObject.refInfo.ref; + } + return refObject; + } + + public CodegenSchema getSetSchema() { + if (schema != null) { + return schema; + } + if (content != null) { + for (CodegenMediaType codegenMediaType: content.values()) { + return codegenMediaType.schema; + } + } + return null; + } + + public String getSetSchemaJsonPath(String jsonPath) { + if (schema != null) { + return jsonPath + "/schema"; + } + if (content != null) { + for (Map.Entry entry: content.entrySet()) { + if (entry.getValue().schema != null) { + String contentType = entry.getKey().original; + return jsonPath + "/content/" + ModelUtils.encodeSlashes(contentType) + "/schema"; + } + } + } + return null; + } + + @Override + public int hashCode() { + return Objects.hash(jsonPathPiece, in, explode, name, description, unescapedDescription, style, allowEmptyValue, example, vendorExtensions, deprecated, required, schema, content, refInfo, imports, componentModule, allowReserved); + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (!(o instanceof CodegenParameter)) return false; + CodegenParameter that = (CodegenParameter) o; + return required == that.required && + Objects.equals(jsonPathPiece, that.jsonPathPiece) && + Objects.equals(componentModule, that.componentModule) && + Objects.equals(imports, that.imports) && + Objects.equals(content, that.content) && + Objects.equals(description, that.description) && + Objects.equals(unescapedDescription, that.unescapedDescription) && + Objects.equals(example, that.example) && + Objects.equals(vendorExtensions, that.vendorExtensions) && + explode == that.explode && + deprecated == that.deprecated && + Objects.equals(schema, that.schema) && + Objects.equals(allowReserved, that.allowReserved) && + Objects.equals(style, that.style) && + Objects.equals(in, that.in) && + Objects.equals(refInfo, that.refInfo) && + Objects.equals(name, that.name); + } + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder("CodegenParameter{"); + sb.append(", name='").append(jsonPathPiece).append('\''); + sb.append(", description='").append(description).append('\''); + sb.append(", unescapedDescription='").append(unescapedDescription).append('\''); + sb.append(", example='").append(example).append('\''); + sb.append(", vendorExtensions=").append(vendorExtensions); + sb.append(", required=").append(required); + sb.append(", content=").append(content); + sb.append(", imports=").append(imports); + sb.append(", componentModule=").append(componentModule); + sb.append(", explode=").append(explode); + sb.append(", style='").append(style).append('\''); + sb.append(", deprecated=").append(deprecated); + sb.append(", schema=").append(schema); + sb.append(", in=").append(in); + sb.append(", allowEmptyValue='").append(allowEmptyValue).append('\''); + sb.append(", baseName='").append(name).append('\''); + sb.append(", refInfo='").append(refInfo).append('\''); + sb.append(", allowReserved=").append(allowReserved).append('\''); + sb.append('}'); + return sb.toString(); + } +} + diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/CodegenPathItem.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/CodegenPathItem.java new file mode 100644 index 00000000000..a070194110f --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/CodegenPathItem.java @@ -0,0 +1,20 @@ +package org.openapijsonschematools.codegen.model; + +import java.util.List; +import java.util.TreeMap; + +public class CodegenPathItem { + public final String summary; + public final String description; + public final TreeMap operations; + public final List servers; + public final List parameters; + + public CodegenPathItem(String summary, String description, TreeMap operations, List servers, List parameters) { + this.summary = summary; + this.description = description; + this.operations = operations; + this.servers = servers; + this.parameters = parameters; + } +} diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/CodegenPatternInfo.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/CodegenPatternInfo.java new file mode 100644 index 00000000000..df320db4d8f --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/CodegenPatternInfo.java @@ -0,0 +1,13 @@ +package org.openapijsonschematools.codegen.model; + +import java.util.LinkedHashSet; + +public class CodegenPatternInfo { + public final String pattern; + public final LinkedHashSet flags; + + public CodegenPatternInfo(String pattern, LinkedHashSet flags) { + this.pattern = pattern; + this.flags = flags; + } +} diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/CodegenRefInfo.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/CodegenRefInfo.java new file mode 100644 index 00000000000..c86641668a6 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/CodegenRefInfo.java @@ -0,0 +1,47 @@ +package org.openapijsonschematools.codegen.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + +import java.util.Objects; + +@JsonIgnoreProperties({"ref"}) +public class CodegenRefInfo { + final public T ref; + final public String refClass; + final public String refModule; + + protected void addInstanceInfo(StringBuilder sb) { + sb.append("refModule=").append(refModule); + sb.append(", refClass=").append(refClass); + } + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder("CodegenRefInfo{"); + addInstanceInfo(sb); + sb.append('}'); + return sb.toString(); + } + + @Override + public int hashCode() { + // ref must be omitted here for generation to work + return Objects.hash(refClass, refModule); + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (!(o instanceof CodegenRefInfo)) return false; + CodegenRefInfo that = (CodegenRefInfo) o; + return Objects.equals(refModule, that.refModule) && + Objects.equals(refClass, that.refClass) && + Objects.equals(ref, that.ref); + } + + public CodegenRefInfo(T ref, String refClass, String refModule) { + this.ref = ref; + this.refClass = refClass; + this.refModule = refModule ; + } +} diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/CodegenRequestBody.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/CodegenRequestBody.java new file mode 100644 index 00000000000..9563f78e73c --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/CodegenRequestBody.java @@ -0,0 +1,134 @@ +package org.openapijsonschematools.codegen.model; + +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeSet; + +/** + * Describes a single operation parameter in the OAS specification. + * A unique parameter is defined by a combination of a name and location. + * Parameters may be located in a path, query, header or cookie. + */ +public class CodegenRequestBody { + public final String description; + public final String unescapedDescription; + public final Map vendorExtensions; + public final Boolean required; + public final LinkedHashMap content; + public final TreeSet imports; + public final boolean componentModule; + public final CodegenKey jsonPathPiece; + public final CodegenRefInfo refInfo; + + /* + A method that returns all content schemas + This only works on the RequestBody that contains a CodegenMediaType with a schema definition + */ + public Set getContentSchemas() { + if (content == null) { + return null; + } + LinkedHashSet schemas = new LinkedHashSet<>(); + LinkedHashSet anyTypeSchemas = new LinkedHashSet<>(); + for (CodegenMediaType mediaType: content.values()) { + if (mediaType == null) { + continue; + } + if (mediaType.schema == null) { + continue; + } + CodegenSchema schema = new CodegenSchema(); + if (mediaType.schema.refInfo != null) { + // TODO adjust this for 3.1.0 + // in 3.1.0 ref can be combined with other constraints + // so types and format should come from + // the first schema then, not the deepest ref + CodegenSchema deepest = mediaType.schema.getDeepestRef(); + schema.types = deepest.types; + schema.format = deepest.format; + } else { + schema.types = mediaType.schema.types; + schema.format = mediaType.schema.format; + } + if (schema.types == null && schema.format == null) { + // return only anyType if it exists because it covers all use cases + anyTypeSchemas.add(schema); + return anyTypeSchemas; + } + schemas.add(schema); + } + if (schemas.isEmpty()) { + return null; + } + return schemas; + } + + public CodegenRequestBody(String description, String unescapedDescription, Map vendorExtensions, Boolean required, LinkedHashMap content, TreeSet imports, boolean componentModule, CodegenKey jsonPathPiece, CodegenRefInfo refInfo) { + this.description = description; + this.unescapedDescription = unescapedDescription; + this.vendorExtensions = vendorExtensions; + this.required = required; + this.content = content; + this.imports = imports; + this.componentModule = componentModule; + this.jsonPathPiece = jsonPathPiece; + this.refInfo = refInfo; + } + + @Override + public int hashCode() { + return Objects.hash(description, unescapedDescription, jsonPathPiece, vendorExtensions, required, content, refInfo, imports, componentModule); + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (!(o instanceof CodegenRequestBody)) return false; + CodegenRequestBody that = (CodegenRequestBody) o; + return required == that.required && + Objects.equals(jsonPathPiece, that.jsonPathPiece) && + Objects.equals(componentModule, that.componentModule) && + Objects.equals(imports, that.imports) && + Objects.equals(content, that.content) && + Objects.equals(description, that.description) && + Objects.equals(unescapedDescription, that.unescapedDescription) && + Objects.equals(vendorExtensions, that.vendorExtensions) && + Objects.equals(refInfo, that.refInfo); + } + + protected void addInstanceInfo(StringBuilder sb) { + sb.append("name='").append(jsonPathPiece).append('\''); + sb.append(", description='").append(description).append('\''); + sb.append(", unescapedDescription='").append(unescapedDescription).append('\''); + sb.append(", vendorExtensions=").append(vendorExtensions); + sb.append(", required=").append(required); + sb.append(", content=").append(content); + sb.append(", imports=").append(imports); + sb.append(", componentModule=").append(componentModule); + sb.append(", refInfo=").append(refInfo); + } + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder("CodegenRequestBody{"); + addInstanceInfo(sb); + sb.append('}'); + return sb.toString(); + } + + public CodegenRequestBody getDeepestRef() { + if (refInfo == null) { + return null; + } + CodegenRequestBody refObject = refInfo.ref; + while (refObject.refInfo != null) { + refObject = refObject.refInfo.ref; + } + return refObject; + } +} + diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/CodegenResponse.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/CodegenResponse.java new file mode 100644 index 00000000000..c88a8a4f070 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/CodegenResponse.java @@ -0,0 +1,126 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * Copyright 2018 SmartBear Software + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapijsonschematools.codegen.model; + +import java.util.*; + +public class CodegenResponse { + public final String description; + public final Map headers; + public final LinkedHashMap content; + public final CodegenRefInfo refInfo; + // TODO add links in the future + public final CodegenKey jsonPathPiece; + public final Map vendorExtensions; + public final TreeSet imports; + public final boolean componentModule; + + public CodegenResponse(CodegenKey jsonPathPiece, Map headers, String description, Map vendorExtensions, LinkedHashMap content, CodegenRefInfo refInfo, TreeSet imports, boolean componentModule) { + this.jsonPathPiece = jsonPathPiece; + this.headers = headers; + this.description = description; + this.vendorExtensions = vendorExtensions; + this.content = content; + this.refInfo = refInfo; + this.imports = imports; + this.componentModule = componentModule; + } + + /** + * Used by templates to only render body details if there is a schema defined for a content type + * @return true if there is an inline header + */ + public boolean hasContentSchema() { + if (content == null) { + return false; + } + for (CodegenMediaType mediaType: content.values()) { + if (mediaType == null) { + continue; + } + if (mediaType.schema != null) { + return true; + } + } + return false; + } + + /** + * Used by templates to only render header details if there is an inline header + * @return true if there is an inline header + */ + public boolean hasInlineHeader() { + if (headers == null) { + return false; + } + for (CodegenHeader header: headers.values()) { + if (header.refInfo == null) { + return true; + } + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash(jsonPathPiece, description, + vendorExtensions, headers, content, + refInfo, imports, componentModule); + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (!(o instanceof CodegenResponse)) return false; + CodegenResponse that = (CodegenResponse) o; + return Objects.equals(jsonPathPiece, that.jsonPathPiece) && + Objects.equals(imports, that.imports) && + Objects.equals(refInfo, that.refInfo) && + Objects.equals(content, that.content) && + Objects.equals(headers, that.headers) && + Objects.equals(description, that.description) && + Objects.equals(vendorExtensions, that.vendorExtensions) && + Objects.equals(componentModule, that.componentModule); + } + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder("CodegenResponse{"); + sb.append(", name='").append(jsonPathPiece).append('\''); + sb.append(", message='").append(description).append('\''); + sb.append(", vendorExtensions=").append(vendorExtensions); + sb.append(", headers=").append(headers); + sb.append(", content=").append(content); + sb.append(", refInfo=").append(refInfo); + sb.append(", imports=").append(imports); + sb.append(", componentModule=").append(componentModule); + sb.append('}'); + return sb.toString(); + } + + public CodegenResponse getDeepestRef() { + if (refInfo == null) { + return null; + } + CodegenResponse refObject = refInfo.ref; + while (refObject.refInfo != null) { + refObject = refObject.refInfo.ref; + } + return refObject; + } +} diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/CodegenSchema.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/CodegenSchema.java new file mode 100644 index 00000000000..e1ee503fe62 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/CodegenSchema.java @@ -0,0 +1,266 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * Copyright 2018 SmartBear Software + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapijsonschematools.codegen.model; + +import io.swagger.v3.oas.models.ExternalDocumentation; + +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.TreeSet; + +public class CodegenSchema { + // 3.0.0 + public String title; + public Number multipleOf; + public String maximum; + public Boolean exclusiveMaximum; + public String minimum; + public Boolean exclusiveMinimum; + public Integer maxLength; + public Integer minLength; + public CodegenPatternInfo patternInfo; + public Integer maxItems; + public Integer minItems; + public Boolean uniqueItems; + public Integer maxProperties; + public Integer minProperties; + public LinkedHashMap requiredProperties; // used to store required info + public LinkedHashMap enumValueToName; // enum info + public String type; + public List allOf = null; + public List anyOf = null; + public List oneOf = null; + public CodegenSchema not = null; + public CodegenSchema items; + public LinkedHashMap properties; + public CodegenSchema additionalProperties; + public String description; + public String format; + public EnumValue defaultValue; + public CodegenRefInfo refInfo; // $ref + + // openapi 3.0.0 + // note: null is added to types when nullable is true + public Boolean nullable; + public CodegenDiscriminator discriminator; + public Boolean readOnly; + public Boolean writeOnly; + public CodegenXml xml; + public ExternalDocumentation externalDocumentation; + public String example; + public Boolean deprecated; + // openapi Specification Extensions + public Map vendorExtensions; + + // 3.1.0 + public LinkedHashSet types; + public CodegenSchema contains; + public LinkedHashMap> dependentRequired; + public boolean isBooleanSchemaTrue; // supports boolean schemas + public boolean isBooleanSchemaFalse; // supports boolean schemas + + // Extra needed fields + public boolean componentModule; + public TreeSet imports; + public CodegenKey jsonPathPiece; + public String unescapedDescription; + public LinkedHashMap optionalProperties; + public boolean schemaIsFromAdditionalProperties; + public HashMap testCases = new HashMap<>(); + + public boolean hasValidation() { + return maxItems != null || minItems != null || minProperties != null || maxProperties != null || minLength != null || maxLength != null || multipleOf != null || patternInfo != null || minimum != null || maximum != null || exclusiveMinimum != null || exclusiveMaximum != null || uniqueItems != null; + } + + public boolean hasMultipleTypes() { + return (types != null && types.size() > 1); + } + + public boolean hasDiscriminatorWithNonEmptyMapping() { + if (discriminator == null) { + return false; + } + if (discriminator.mappedModels == null) { + return false; + } else return !discriminator.mappedModels.isEmpty(); + } + + public CodegenSchema getDeepestRef() { + if (refInfo == null) { + return null; + } + CodegenSchema refObject = refInfo.ref; + while (refObject.refInfo != null) { + refObject = refObject.refInfo.ref; + } + return refObject; + } + + public CodegenSchema getSelfOrDeepestRef() { + if (refInfo == null) { + return this; + } + CodegenSchema refObject = refInfo.ref; + while (refObject.refInfo != null) { + refObject = refObject.refInfo.ref; + } + return refObject; + } + + public boolean isComplicated() { + // used by templates + + if (allOf != null || anyOf != null || oneOf != null || not != null) { + return true; + } + return types != null && (types.contains("array") || types.contains("object")); + } + + protected void addInstanceInfo(StringBuilder sb) { + sb.append(", description='").append(description).append('\''); + sb.append(", name='").append(jsonPathPiece).append('\''); + sb.append(", defaultValue='").append(defaultValue).append('\''); + sb.append(", title='").append(title).append('\''); + sb.append(", unescapedDescription='").append(unescapedDescription).append('\''); + sb.append(", maxLength=").append(maxLength); + sb.append(", minLength=").append(minLength); + sb.append(", patternInfo='").append(patternInfo).append('\''); + sb.append(", example='").append(example).append('\''); + sb.append(", minimum='").append(minimum).append('\''); + sb.append(", maximum='").append(maximum).append('\''); + sb.append(", exclusiveMinimum=").append(exclusiveMinimum); + sb.append(", exclusiveMaximum=").append(exclusiveMaximum); + sb.append(", deprecated=").append(deprecated); + sb.append(", types=").append(types); + sb.append(", hasMultipleTypes=").append(hasMultipleTypes()); + sb.append(", readOnly=").append(readOnly); + sb.append(", writeOnly=").append(writeOnly); + sb.append(", nullable=").append(nullable); + sb.append(", allowableValues=").append(enumValueToName); + sb.append(", items=").append(items); + sb.append(", additionalProperties=").append(additionalProperties); + sb.append(", vendorExtensions=").append(vendorExtensions); + sb.append(", hasValidation=").append(hasValidation()); + sb.append(", maxItems=").append(maxItems); + sb.append(", minItems=").append(minItems); + sb.append(", maxProperties=").append(maxProperties); + sb.append(", minProperties=").append(minProperties); + sb.append(", uniqueItems=").append(uniqueItems); + sb.append(", multipleOf=").append(multipleOf); + sb.append(", xml=").append(xml); + sb.append(", requiredProperties=").append(requiredProperties); + sb.append(", optionalProperties=").append(optionalProperties); + sb.append(", properties=").append(properties); + sb.append(", refInfo=").append(refInfo); + sb.append(", schemaIsFromAdditionalProperties=").append(schemaIsFromAdditionalProperties); + sb.append(", isBooleanSchemaTrue=").append(isBooleanSchemaTrue); + sb.append(", isBooleanSchemaFalse=").append(isBooleanSchemaFalse); + sb.append(", format=").append(format); + sb.append(", dependentRequired=").append(dependentRequired); + sb.append(", contains=").append(contains); + sb.append(", allOf=").append(allOf); + sb.append(", anyOf=").append(anyOf); + sb.append(", oneOf=").append(oneOf); + sb.append(", not=").append(not); + sb.append(", externalDocumentation=").append(externalDocumentation); + sb.append(", discriminator=").append(discriminator); + sb.append(", imports=").append(imports); + sb.append(", componentModule=").append(componentModule); + sb.append(", testCases=").append(testCases); + } + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder("CodegenSchema{"); + addInstanceInfo(sb); + sb.append('}'); + return sb.toString(); + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + CodegenSchema that = (CodegenSchema) o; + return exclusiveMinimum == that.exclusiveMinimum && + exclusiveMaximum == that.exclusiveMaximum && + deprecated == that.deprecated && + readOnly == that.readOnly && + writeOnly == that.writeOnly && + nullable == that.nullable && + isBooleanSchemaTrue == that.isBooleanSchemaTrue && + isBooleanSchemaFalse == that.isBooleanSchemaFalse && + schemaIsFromAdditionalProperties == that.schemaIsFromAdditionalProperties && + Objects.equals(xml, that.xml) && + Objects.equals(types, that.types) && + Objects.equals(testCases, that.testCases) && + Objects.equals(componentModule, that.componentModule) && + Objects.equals(imports, that.imports) && + Objects.equals(discriminator, that.discriminator) && + Objects.equals(externalDocumentation, that.externalDocumentation) && + Objects.equals(allOf, that.allOf) && + Objects.equals(anyOf, that.anyOf) && + Objects.equals(oneOf, that.oneOf) && + Objects.equals(not, that.not) && + Objects.equals(contains, that.contains) && + Objects.equals(dependentRequired, that.dependentRequired) && + Objects.equals(format, that.format) && + Objects.equals(refInfo, that.refInfo) && + Objects.equals(requiredProperties, that.requiredProperties) && + Objects.equals(optionalProperties, that.optionalProperties) && + Objects.equals(properties, that.properties) && + Objects.equals(description, that.description) && + Objects.equals(jsonPathPiece, that.jsonPathPiece) && + Objects.equals(defaultValue, that.defaultValue) && + Objects.equals(title, that.title) && + Objects.equals(unescapedDescription, that.unescapedDescription) && + Objects.equals(maxLength, that.maxLength) && + Objects.equals(minLength, that.minLength) && + Objects.equals(patternInfo, that.patternInfo) && + Objects.equals(example, that.example) && + Objects.equals(minimum, that.minimum) && + Objects.equals(maximum, that.maximum) && + Objects.equals(enumValueToName, that.enumValueToName) && + Objects.equals(items, that.items) && + Objects.equals(additionalProperties, that.additionalProperties) && + Objects.equals(vendorExtensions, that.vendorExtensions) && + Objects.equals(maxItems, that.maxItems) && + Objects.equals(minItems, that.minItems) && + Objects.equals(multipleOf, that.multipleOf); + } + + @Override + public int hashCode() { + return Objects.hash(description, + jsonPathPiece, defaultValue, + title, unescapedDescription, + maxLength, minLength, patternInfo, example, minimum, maximum, + exclusiveMinimum, exclusiveMaximum, deprecated, types, + readOnly, writeOnly, nullable, + enumValueToName, items, additionalProperties, + vendorExtensions, maxItems, minItems, xml, + schemaIsFromAdditionalProperties, isBooleanSchemaTrue, isBooleanSchemaFalse, + format, dependentRequired, contains, allOf, anyOf, oneOf, not, + properties, optionalProperties, requiredProperties, externalDocumentation, + discriminator, imports, componentModule, testCases, refInfo); + } +} diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/CodegenSecurityRequirementValue.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/CodegenSecurityRequirementValue.java new file mode 100644 index 00000000000..1b37a35af18 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/CodegenSecurityRequirementValue.java @@ -0,0 +1,16 @@ +package org.openapijsonschematools.codegen.model; + +import java.util.ArrayList; +import java.util.TreeSet; + +public class CodegenSecurityRequirementValue { + public final TreeSet imports; + public final CodegenRefInfo refInfo; + public final ArrayList scopeNames; + + public CodegenSecurityRequirementValue(TreeSet imports, CodegenRefInfo refInfo, ArrayList scopeNames) { + this.imports = imports; + this.refInfo = refInfo; + this.scopeNames = scopeNames; + } +} diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/CodegenSecurityScheme.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/CodegenSecurityScheme.java new file mode 100644 index 00000000000..d7dd5e77ccb --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/CodegenSecurityScheme.java @@ -0,0 +1,99 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * Copyright 2018 SmartBear Software + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapijsonschematools.codegen.model; + +import java.util.Map; +import java.util.Objects; +import java.util.TreeSet; + +public class CodegenSecurityScheme { + public final String type; + public final String description; + public final String name; + public final String in; + public final String scheme; + public final String bearerFormat; + public final CodegenOauthFlows flows; + public final String openIdConnectUrl; + public final TreeSet imports; + public final boolean componentModule; + public final CodegenKey jsonPathPiece; + public final CodegenRefInfo refInfo; + public final Map vendorExtensions; + + public CodegenSecurityScheme(String type, String description, String name, String in, String scheme, String bearerFormat, CodegenOauthFlows flows, String openIdConnectUrl, TreeSet imports, boolean componentModule, CodegenKey jsonPathPiece, CodegenRefInfo refInfo, Map vendorExtensions) { + this.type = type; + this.description = description; + this.name = name; + this.in = in; + this.scheme = scheme; + this.bearerFormat = bearerFormat; + this.flows = flows; + this.openIdConnectUrl = openIdConnectUrl; + this.imports = imports; + this.componentModule = componentModule; + this.jsonPathPiece = jsonPathPiece; + this.refInfo = refInfo; + this.vendorExtensions = vendorExtensions; + } + + public CodegenSecurityScheme getDeepestRef() { + if (refInfo == null) { + return null; + } + CodegenSecurityScheme refObject = refInfo.ref; + while (refObject.refInfo != null) { + refObject = refObject.refInfo.ref; + } + return refObject; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + CodegenSecurityScheme that = (CodegenSecurityScheme) o; + return Objects.equals(type, that.type) && + Objects.equals(description, that.description) && + Objects.equals(name, that.name) && + Objects.equals(in, that.in) && + Objects.equals(scheme, that.scheme) && + Objects.equals(bearerFormat, that.bearerFormat) && + Objects.equals(flows, that.flows) && + Objects.equals(openIdConnectUrl, that.openIdConnectUrl) && + Objects.equals(vendorExtensions, that.vendorExtensions); + } + + @Override + public int hashCode() { + return Objects.hash(type, description, name, in, scheme, bearerFormat, flows, openIdConnectUrl, vendorExtensions); + } + + @Override + public String toString() { + return "CodegenSecurityScheme{" + "type='" + type + '\'' + + ", description='" + description + '\'' + + ", name='" + name + '\'' + + ", in='" + in + '\'' + + ", scheme='" + scheme + '\'' + + ", bearerFormat='" + bearerFormat + '\'' + + ", flows='" + flows + '\'' + + ", vendorExtensions=" + vendorExtensions + + '}'; + } +} diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/CodegenServer.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/CodegenServer.java new file mode 100644 index 00000000000..bb738454c82 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/CodegenServer.java @@ -0,0 +1,61 @@ +package org.openapijsonschematools.codegen.model; + +import java.util.LinkedHashMap; +import java.util.Objects; + +public class CodegenServer { + public final String url; + public final String defaultUrl; + public final String description; + public final LinkedHashMap variables; + public final CodegenKey jsonPathPiece; + public final boolean rootServer; + + public CodegenServer(String url, String description, LinkedHashMap variables, CodegenKey jsonPathPiece, boolean rootServer) { + this.url = url; + this.description = description; + this.variables = variables; + this.jsonPathPiece = jsonPathPiece; + this.rootServer = rootServer; + if (this.variables == null) { + this.defaultUrl = url; + } else { + String defaultUrl = url; + for (CodegenSchema variable: variables.values()) { + defaultUrl = defaultUrl.replace("{" + variable.jsonPathPiece.original + "}", (String) variable.defaultValue.value); + } + this.defaultUrl = defaultUrl; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + CodegenServer that = (CodegenServer) o; + return Objects.equals(url, that.url) && + Objects.equals(description, that.description) && + Objects.equals(variables, that.variables) && + Objects.equals(jsonPathPiece, that.jsonPathPiece) && + Objects.equals(rootServer, that.rootServer) && + Objects.equals(defaultUrl, that.defaultUrl); + } + + @Override + public int hashCode() { + return Objects.hash(url, description, variables, jsonPathPiece, rootServer, defaultUrl); + } + + @Override + public String toString() { + final StringBuffer sb = new StringBuffer("CodegenServer{"); + sb.append("url='").append(url).append('\''); + sb.append(", description='").append(description).append('\''); + sb.append(", variables=").append(variables); + sb.append(", jsonPathPiece=").append(jsonPathPiece); + sb.append(", rootServer=").append(rootServer); + sb.append(", defaultUrl=").append(defaultUrl); + sb.append('}'); + return sb.toString(); + } +} diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/CodegenTag.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/CodegenTag.java new file mode 100644 index 00000000000..22e048a101c --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/CodegenTag.java @@ -0,0 +1,33 @@ +package org.openapijsonschematools.codegen.model; + +import java.util.Objects; + +public class CodegenTag { + public final String name; + public final String moduleName; + public final String className; + public final String description; + + public CodegenTag(String name, String moduleName, String className, String description) { + this.name = name; + this.moduleName = moduleName; + this.className = className; + this.description = description; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + CodegenTag that = (CodegenTag) o; + return Objects.equals(name, that.name) && + Objects.equals(moduleName, that.moduleName) && + Objects.equals(className, that.className) && + Objects.equals(description, that.description); + } + + @Override + public int hashCode() { + return Objects.hash(name, moduleName, className, description); + } +} diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/CodegenXml.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/CodegenXml.java new file mode 100644 index 00000000000..16e5f1c1052 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/CodegenXml.java @@ -0,0 +1,17 @@ +package org.openapijsonschematools.codegen.model; + +public class CodegenXml { + public final String name; + public final String namespace; + public final String prefix; + public final Boolean attribute; + public final Boolean wrapped; + + public CodegenXml(String name, String namespace, String prefix, Boolean attribute, Boolean wrapped) { + this.name = name; + this.namespace = namespace; + this.prefix = prefix; + this.attribute = attribute; + this.wrapped = wrapped; + } +} diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/EnumValue.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/EnumValue.java new file mode 100644 index 00000000000..48364670381 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/EnumValue.java @@ -0,0 +1,34 @@ +package org.openapijsonschematools.codegen.model; + +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Objects; + +public class EnumValue { + public final String type; // null (unset) "integer" "number" "string" "object" "array" "boolean" "null" + public final Object value; + public final String description; + + public EnumValue(Object value, String type, String description) { + this.value = value; + this.type = type; + this.description = description; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + EnumValue that = (EnumValue) o; + return Objects.equals(value, that.value) && + Objects.equals(type, that.type) && + Objects.equals(description, that.description); + } + + @Override + public int hashCode() { + return Objects.hash(value, type, description); + } +} + diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/PairCacheKey.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/PairCacheKey.java new file mode 100644 index 00000000000..137ddc9cb4c --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/PairCacheKey.java @@ -0,0 +1,27 @@ +package org.openapijsonschematools.codegen.model; + +import java.util.Objects; + +public class PairCacheKey { + public PairCacheKey(String sourceJsonPath, String currentJsonPath) { + this.sourceJsonPath = sourceJsonPath; + this.currentJsonPath = currentJsonPath; + } + + private final String sourceJsonPath; + private final String currentJsonPath; + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + PairCacheKey that = (PairCacheKey) o; + return Objects.equals(sourceJsonPath, that.sourceJsonPath) && + Objects.equals(currentJsonPath, that.currentJsonPath); + } + + @Override + public int hashCode() { + return Objects.hash(sourceJsonPath, currentJsonPath); + } +} diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/SchemaTestCase.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/SchemaTestCase.java new file mode 100644 index 00000000000..ad193c0644a --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/SchemaTestCase.java @@ -0,0 +1,14 @@ +package org.openapijsonschematools.codegen.model; + +public class SchemaTestCase { + public final String description; + public final EnumValue data; + // true means the test case should pass, false means it should fail + public final boolean valid; + + public SchemaTestCase(String description, EnumValue data, boolean valid) { + this.description = description; + this.data = data; + this.valid = valid; + } +} diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/serializer/OpenAPISerializer.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/serializer/OpenAPISerializer.java similarity index 96% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/serializer/OpenAPISerializer.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/serializer/OpenAPISerializer.java index 5ca92e81480..6de9a1009f2 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/serializer/OpenAPISerializer.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/serializer/OpenAPISerializer.java @@ -1,4 +1,4 @@ -package org.openapitools.codegen.serializer; +package org.openapijsonschematools.codegen.serializer; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.JsonSerializer; diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/serializer/SerializerUtils.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/serializer/SerializerUtils.java similarity index 94% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/serializer/SerializerUtils.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/serializer/SerializerUtils.java index 833ad2e2418..eae4727738a 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/serializer/SerializerUtils.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/serializer/SerializerUtils.java @@ -1,4 +1,4 @@ -package org.openapitools.codegen.serializer; +package org.openapijsonschematools.codegen.serializer; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.MapperFeature; @@ -9,13 +9,13 @@ import io.swagger.v3.core.util.Json; import io.swagger.v3.core.util.Yaml; import io.swagger.v3.oas.models.OpenAPI; -import org.openapitools.codegen.config.GlobalSettings; +import org.openapijsonschematools.codegen.config.GlobalSettings; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class SerializerUtils { private static final Logger LOGGER = LoggerFactory.getLogger(SerializerUtils.class); - private static final String YAML_MINIMIZE_QUOTES_PROPERTY = "org.openapitools.codegen.utils.yaml.minimize.quotes"; + private static final String YAML_MINIMIZE_QUOTES_PROPERTY = "org.openapijsonschematools.codegen.utils.yaml.minimize.quotes"; private static final boolean minimizeYamlQuotes = Boolean.parseBoolean(GlobalSettings.getProperty(YAML_MINIMIZE_QUOTES_PROPERTY, "true")); public static String toYamlString(OpenAPI openAPI) { diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/templating/CommonTemplateContentLocator.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/CommonTemplateContentLocator.java similarity index 88% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/templating/CommonTemplateContentLocator.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/CommonTemplateContentLocator.java index 7c0b7cabaef..4be61ea8e0f 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/templating/CommonTemplateContentLocator.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/CommonTemplateContentLocator.java @@ -1,8 +1,8 @@ -package org.openapitools.codegen.templating; +package org.openapijsonschematools.codegen.templating; import org.apache.commons.lang3.StringUtils; -import org.openapitools.codegen.TemplateManager; -import org.openapitools.codegen.api.TemplatePathLocator; +import org.openapijsonschematools.codegen.TemplateManager; +import org.openapijsonschematools.codegen.api.TemplatePathLocator; import java.io.File; import java.net.URL; diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/templating/GeneratorTemplateContentLocator.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/GeneratorTemplateContentLocator.java similarity index 94% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/templating/GeneratorTemplateContentLocator.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/GeneratorTemplateContentLocator.java index 861b9bc3a3d..01cbc2342fd 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/templating/GeneratorTemplateContentLocator.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/GeneratorTemplateContentLocator.java @@ -1,9 +1,9 @@ -package org.openapitools.codegen.templating; +package org.openapijsonschematools.codegen.templating; import org.apache.commons.lang3.StringUtils; -import org.openapitools.codegen.CodegenConfig; -import org.openapitools.codegen.TemplateManager; -import org.openapitools.codegen.api.TemplatePathLocator; +import org.openapijsonschematools.codegen.CodegenConfig; +import org.openapijsonschematools.codegen.TemplateManager; +import org.openapijsonschematools.codegen.api.TemplatePathLocator; import java.io.File; import java.nio.file.Paths; diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/templating/HandlebarsEngineAdapter.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/HandlebarsEngineAdapter.java similarity index 88% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/templating/HandlebarsEngineAdapter.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/HandlebarsEngineAdapter.java index 64ce72b5cf2..0d51d07eefa 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/templating/HandlebarsEngineAdapter.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/HandlebarsEngineAdapter.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.openapitools.codegen.templating; +package org.openapijsonschematools.codegen.templating; import com.github.jknack.handlebars.Context; import com.github.jknack.handlebars.Handlebars; @@ -30,8 +30,9 @@ import com.github.jknack.handlebars.io.StringTemplateSource; import com.github.jknack.handlebars.io.TemplateLoader; import com.github.jknack.handlebars.io.TemplateSource; -import org.openapitools.codegen.api.AbstractTemplatingEngineAdapter; -import org.openapitools.codegen.api.TemplatingExecutor; +import org.openapijsonschematools.codegen.api.AbstractTemplatingEngineAdapter; +import org.openapijsonschematools.codegen.api.TemplatingExecutor; +import org.openapijsonschematools.codegen.templating.handlebars.CustomHelpers; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -71,10 +72,11 @@ public TemplateSource sourceAt(String location) { Context context = Context .newBuilder(bundle) .resolver( - MapValueResolver.INSTANCE, + MapValueResolver.INSTANCE, // access map values JavaBeanValueResolver.INSTANCE, - FieldValueResolver.INSTANCE, - MethodValueResolver.INSTANCE) + MethodValueResolver.INSTANCE, // access to public methods + FieldValueResolver.INSTANCE // access to instance fields (private or public). + ) .build(); Handlebars handlebars = new Handlebars(loader); @@ -85,7 +87,8 @@ public TemplateSource sourceAt(String location) { handlebars.registerHelper("json", Jackson2Helper.INSTANCE); StringHelpers.register(handlebars); handlebars.registerHelpers(ConditionalHelpers.class); - handlebars.registerHelpers(org.openapitools.codegen.templating.handlebars.StringHelpers.class); + handlebars.registerHelpers(org.openapijsonschematools.codegen.templating.handlebars.StringHelpers.class); + handlebars.registerHelpers(CustomHelpers.class); handlebars.setInfiniteLoops(infiniteLoops); handlebars.setPrettyPrint(prettyPrint); Template tmpl = handlebars.compile(templateFile); diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/templating/MustacheEngineAdapter.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/MustacheEngineAdapter.java similarity index 94% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/templating/MustacheEngineAdapter.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/MustacheEngineAdapter.java index b7819988056..02ea31e2bc0 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/templating/MustacheEngineAdapter.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/MustacheEngineAdapter.java @@ -14,12 +14,12 @@ * limitations under the License. */ -package org.openapitools.codegen.templating; +package org.openapijsonschematools.codegen.templating; import com.samskivert.mustache.Mustache; import com.samskivert.mustache.Template; -import org.openapitools.codegen.api.TemplatingEngineAdapter; -import org.openapitools.codegen.api.TemplatingExecutor; +import org.openapijsonschematools.codegen.api.TemplatingEngineAdapter; +import org.openapijsonschematools.codegen.api.TemplatingExecutor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/templating/TemplateManagerOptions.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/TemplateManagerOptions.java similarity index 96% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/templating/TemplateManagerOptions.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/TemplateManagerOptions.java index d5e8238f6b9..c12772ddac0 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/templating/TemplateManagerOptions.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/TemplateManagerOptions.java @@ -1,4 +1,4 @@ -package org.openapitools.codegen.templating; +package org.openapijsonschematools.codegen.templating; /** * Holds the options relevant to template management and execution. diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/templating/TemplateNotFoundException.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/TemplateNotFoundException.java similarity index 98% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/templating/TemplateNotFoundException.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/TemplateNotFoundException.java index c620f5a0545..0f423c5437a 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/templating/TemplateNotFoundException.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/TemplateNotFoundException.java @@ -1,4 +1,4 @@ -package org.openapitools.codegen.templating; +package org.openapijsonschematools.codegen.templating; public class TemplateNotFoundException extends RuntimeException { /** diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/handlebars/CustomHelpers.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/handlebars/CustomHelpers.java new file mode 100644 index 00000000000..10edac0dd7e --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/handlebars/CustomHelpers.java @@ -0,0 +1,89 @@ +package org.openapijsonschematools.codegen.templating.handlebars; + +import com.github.jknack.handlebars.Helper; +import com.github.jknack.handlebars.Options; +import com.github.jknack.handlebars.TagType; +import org.openapijsonschematools.codegen.model.CodegenKey; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +public enum CustomHelpers implements Helper { + /** + * Indicates the set or map contains the given key + * For example: + * + *
    +     * {{#contains someMap "someKey"}}
    +     * {{/contains}}
    +     * 
    + * + *
    +     * {{#contains someSet "someItem"}}
    +     * {{/contains}}
    +     * 
    + */ + contains { + @Override public Object apply(final Object a, final Options options) throws IOException { + Object b = options.param(0, null); + boolean result = false; + if (a instanceof Map) { + Map mapA = (Map) a; + result = mapA.containsKey(b); + } else if (a instanceof Set) { + Set setA = (Set) a; + result = setA.contains(b); + } + if (options.tagType == TagType.SECTION) { + return result ? options.fn() : options.inverse(); + } + return result + ? options.hash("yes", true) + : options.hash("no", false); + } + }, + + /** + * Makes an empty array of strings + */ + newArray { + @Override public Object apply(final Object a, final Options options) throws IOException { + return Collections.unmodifiableList(new ArrayList<>()); + } + }, + + /** + * Adds items on to an immutable List + * + *
    +     * {{join value " // " [prefix=""] [suffix=""]}}
    +     * 
    + * + *

    + * If value is the list ['a', 'b', 'c'], the output will be the string "a // b // c". + *

    + * Or: + * + *
    +     * {{join "a" "b" "c" " // " [prefix=""] [suffix=""]}}
    +     * Join the "a", "b", "c", the output will be the string "a // b // c".
    +     * 
    + */ + append { + @Override + public Object apply(final Object context, final Options options) { + if (context instanceof List) { + ArrayList newContext = new ArrayList<>((Collection) context); + Collections.addAll(newContext, options.params); + return Collections.unmodifiableList(newContext); + } + return null; + } + }, +} diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/handlebars/StringHelpers.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/handlebars/StringHelpers.java new file mode 100644 index 00000000000..84453bf1c8c --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/handlebars/StringHelpers.java @@ -0,0 +1,121 @@ +package org.openapijsonschematools.codegen.templating.handlebars; + +import com.github.jknack.handlebars.Helper; +import com.github.jknack.handlebars.Options; +import com.github.jknack.handlebars.TagType; + +import java.io.IOException; +import java.util.Locale; +import static org.apache.commons.lang3.Validate.isTrue; +import static org.apache.commons.lang3.Validate.notNull; +import org.apache.commons.lang3.StringUtils; +import java.util.Iterator; + +public enum StringHelpers implements Helper { + /** + * Custom version of this helper written to allow strings to be joined to empty string + * Joins an array, iterator or an iterable with a string. + * For example: + * + *
    +     * {{join value " // " [prefix=""] [suffix=""]}}
    +     * 
    + * + *

    + * If value is the list ['a', 'b', 'c'], the output will be the string "a // b // c". + *

    + * Or: + * + *
    +     * {{join "a" "b" "c" " // " [prefix=""] [suffix=""]}}
    +     * Join the "a", "b", "c", the output will be the string "a // b // c".
    +     * 
    + */ + join { + @Override + public Object apply(final Object context, final Options options) { + if (!(context instanceof String)) { + return ""; + } + return safeApply(context, options); + } + + protected CharSequence safeApply(final Object context, final Options options) { + int separatorIdx = options.params.length - 1; + Object separator = options.param(separatorIdx, null); + notNull(separator, "found 'null', expected 'separator' at param[%s]", separatorIdx); + isTrue(separator instanceof String, + "found '%s', expected 'separator' at param[%s]", separator, separatorIdx); + String prefix = options.hash("prefix", ""); + String suffix = options.hash("suffix", ""); + if (context instanceof Iterable) { + return prefix + StringUtils.join((Iterable) context, (String) separator) + suffix; + } + if (context instanceof Iterator) { + return prefix + StringUtils.join((Iterator) context, (String) separator) + suffix; + } + if (context.getClass().isArray()) { + return prefix + StringUtils.join((Object[]) context, (String) separator) + suffix; + } + // join everything as single values + Object[] values = new Object[options.params.length]; + System.arraycopy(options.params, 0, values, 1, separatorIdx); + values[0] = context; + return prefix + StringUtils.join(values, (String) separator) + suffix; + } + }, + + /** + * Indicates the string starts with the defined value. + * For example: + * + *
    +     * {{startsWith a b ["insensitive"]}}
    +     * 
    + * + *
    +     * {{startsWith a text='b' [insensitive=true]}}
    +     * 
    + * + * Render 'yes' or 'no': + *
    +     *   {{#startsWith a b}}
    +     *     yes
    +     *   {{else}}
    +     *     no
    +     *   {{/startsWith}}
    +     * 
    + * + * Render 'true' or 'false': + *
    +     *   {{startsWith a b}}
    +     * 
    + * + * Render 'y' or 'n': + *
    +     *   {{startsWith a b yes='y' no='n'}}
    +     * 
    + * + * If value is "handlebars.java", the output will be "Handlebars.java". + */ + startsWith { + @Override + public Object apply(Object value, Options options) throws IOException { + String match = options.param(0, options.hash("text", "")); + if (match.length() < 1) { + return false; + } + + boolean caseInsensitive = options.hash("insensitive", false); + boolean result = caseInsensitive ? value.toString().toLowerCase(Locale.ROOT).startsWith(match.toLowerCase(Locale.ROOT)) : value.toString().startsWith(match); + + if (options.tagType == TagType.SECTION) { + return result ? options.fn() : options.inverse(); + } + + return result + ? options.hash("yes", true) + : options.hash("no", false); + } + } +} diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/templating/mustache/CamelCaseLambda.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/mustache/CamelCaseLambda.java similarity index 92% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/templating/mustache/CamelCaseLambda.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/mustache/CamelCaseLambda.java index 034d0cee76d..439c9d79887 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/templating/mustache/CamelCaseLambda.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/mustache/CamelCaseLambda.java @@ -15,16 +15,16 @@ * limitations under the License. */ -package org.openapitools.codegen.templating.mustache; +package org.openapijsonschematools.codegen.templating.mustache; import com.samskivert.mustache.Mustache; import com.samskivert.mustache.Template; -import org.openapitools.codegen.CodegenConfig; +import org.openapijsonschematools.codegen.CodegenConfig; import java.io.IOException; import java.io.Writer; -import static org.openapitools.codegen.utils.StringUtils.camelize; +import static org.openapijsonschematools.codegen.utils.StringUtils.camelize; /** * Converts text in a fragment to camelCase. diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/templating/mustache/CaseFormatLambda.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/mustache/CaseFormatLambda.java similarity index 91% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/templating/mustache/CaseFormatLambda.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/mustache/CaseFormatLambda.java index a925525380b..0a9a3f91485 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/templating/mustache/CaseFormatLambda.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/mustache/CaseFormatLambda.java @@ -1,9 +1,9 @@ -package org.openapitools.codegen.templating.mustache; +package org.openapijsonschematools.codegen.templating.mustache; import com.google.common.base.CaseFormat; import com.samskivert.mustache.Mustache; import com.samskivert.mustache.Template; -import org.openapitools.codegen.CodegenConfig; +import org.openapijsonschematools.codegen.CodegenConfig; import java.io.IOException; import java.io.Writer; diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/templating/mustache/IndentedLambda.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/mustache/IndentedLambda.java similarity index 98% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/templating/mustache/IndentedLambda.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/mustache/IndentedLambda.java index ffd1269516f..b62a23d44cc 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/templating/mustache/IndentedLambda.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/mustache/IndentedLambda.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.openapitools.codegen.templating.mustache; +package org.openapijsonschematools.codegen.templating.mustache; import com.samskivert.mustache.Mustache; import com.samskivert.mustache.Template; diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/templating/mustache/JoinWithCommaLambda.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/mustache/JoinWithCommaLambda.java similarity index 92% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/templating/mustache/JoinWithCommaLambda.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/mustache/JoinWithCommaLambda.java index 2c6e80e2625..37e6e218f6f 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/templating/mustache/JoinWithCommaLambda.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/mustache/JoinWithCommaLambda.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.openapitools.codegen.templating.mustache; +package org.openapijsonschematools.codegen.templating.mustache; import com.samskivert.mustache.Mustache; import com.samskivert.mustache.Template; -import org.openapitools.codegen.CodegenConfig; +import org.openapijsonschematools.codegen.CodegenConfig; import java.io.IOException; import java.io.Writer; diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/templating/mustache/LowercaseLambda.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/mustache/LowercaseLambda.java similarity index 93% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/templating/mustache/LowercaseLambda.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/mustache/LowercaseLambda.java index f930eaa2c00..b30643fe92d 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/templating/mustache/LowercaseLambda.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/mustache/LowercaseLambda.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.openapitools.codegen.templating.mustache; +package org.openapijsonschematools.codegen.templating.mustache; import com.samskivert.mustache.Mustache; import com.samskivert.mustache.Template; -import org.openapitools.codegen.CodegenConfig; +import org.openapijsonschematools.codegen.CodegenConfig; import java.io.IOException; import java.io.Writer; diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/templating/mustache/OnChangeLambda.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/mustache/OnChangeLambda.java similarity index 93% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/templating/mustache/OnChangeLambda.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/mustache/OnChangeLambda.java index b40840f3669..555ed78f186 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/templating/mustache/OnChangeLambda.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/mustache/OnChangeLambda.java @@ -1,4 +1,4 @@ -package org.openapitools.codegen.templating.mustache; +package org.openapijsonschematools.codegen.templating.mustache; import java.io.IOException; import java.io.Writer; diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/templating/mustache/OptionalParameterLambda.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/mustache/OptionalParameterLambda.java similarity index 88% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/templating/mustache/OptionalParameterLambda.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/mustache/OptionalParameterLambda.java index 4f8dbeaa845..0a7f980b6cf 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/templating/mustache/OptionalParameterLambda.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/mustache/OptionalParameterLambda.java @@ -15,16 +15,16 @@ * limitations under the License. */ -package org.openapitools.codegen.templating.mustache; +package org.openapijsonschematools.codegen.templating.mustache; import com.samskivert.mustache.Mustache; import com.samskivert.mustache.Template; -import org.openapitools.codegen.CodegenConfig; +import org.openapijsonschematools.codegen.CodegenConfig; import java.io.IOException; import java.io.Writer; -import static org.openapitools.codegen.utils.StringUtils.camelize; +import static org.openapijsonschematools.codegen.utils.StringUtils.camelize; /** * Appends trailing ? to a text fragement if not already present diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/templating/mustache/PrefixWithHashLambda.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/mustache/PrefixWithHashLambda.java similarity index 95% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/templating/mustache/PrefixWithHashLambda.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/mustache/PrefixWithHashLambda.java index c3418de09b7..9be8f3f808f 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/templating/mustache/PrefixWithHashLambda.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/mustache/PrefixWithHashLambda.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.openapitools.codegen.templating.mustache; +package org.openapijsonschematools.codegen.templating.mustache; import com.samskivert.mustache.Mustache; import com.samskivert.mustache.Template.Fragment; diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/templating/mustache/RequiredParameterLambda.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/mustache/RequiredParameterLambda.java similarity index 89% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/templating/mustache/RequiredParameterLambda.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/mustache/RequiredParameterLambda.java index 54b5fad703b..f736ed3c652 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/templating/mustache/RequiredParameterLambda.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/mustache/RequiredParameterLambda.java @@ -15,16 +15,16 @@ * limitations under the License. */ -package org.openapitools.codegen.templating.mustache; +package org.openapijsonschematools.codegen.templating.mustache; import com.samskivert.mustache.Mustache; import com.samskivert.mustache.Template; -import org.openapitools.codegen.CodegenConfig; +import org.openapijsonschematools.codegen.CodegenConfig; import java.io.IOException; import java.io.Writer; -import static org.openapitools.codegen.utils.StringUtils.camelize; +import static org.openapijsonschematools.codegen.utils.StringUtils.camelize; /** * Strips trailing ? from a text fragement diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/templating/mustache/SnakecaseLambda.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/mustache/SnakecaseLambda.java similarity index 89% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/templating/mustache/SnakecaseLambda.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/mustache/SnakecaseLambda.java index 55aeb161382..30fc7390db7 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/templating/mustache/SnakecaseLambda.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/mustache/SnakecaseLambda.java @@ -14,16 +14,15 @@ * limitations under the License. */ -package org.openapitools.codegen.templating.mustache; +package org.openapijsonschematools.codegen.templating.mustache; import com.samskivert.mustache.Mustache; import com.samskivert.mustache.Template; import java.io.IOException; import java.io.Writer; -import java.util.Locale; -import static org.openapitools.codegen.utils.StringUtils.underscore; +import static org.openapijsonschematools.codegen.utils.StringUtils.underscore; /** * Converts text in a fragment to snake case. diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/templating/mustache/SplitStringLambda.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/mustache/SplitStringLambda.java similarity index 98% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/templating/mustache/SplitStringLambda.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/mustache/SplitStringLambda.java index 70c7e5ee15a..49b04d93e17 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/templating/mustache/SplitStringLambda.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/mustache/SplitStringLambda.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.openapitools.codegen.templating.mustache; +package org.openapijsonschematools.codegen.templating.mustache; import java.io.IOException; import java.io.Writer; diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/templating/mustache/TitlecaseLambda.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/mustache/TitlecaseLambda.java similarity index 97% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/templating/mustache/TitlecaseLambda.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/mustache/TitlecaseLambda.java index 2d94a5ad7b8..f04996cf9fb 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/templating/mustache/TitlecaseLambda.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/mustache/TitlecaseLambda.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.openapitools.codegen.templating.mustache; +package org.openapijsonschematools.codegen.templating.mustache; import com.samskivert.mustache.Mustache; import com.samskivert.mustache.Template; diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/templating/mustache/TrimWhitespaceLambda.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/mustache/TrimWhitespaceLambda.java similarity index 95% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/templating/mustache/TrimWhitespaceLambda.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/mustache/TrimWhitespaceLambda.java index 29e2e36c35e..1873a04a1bf 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/templating/mustache/TrimWhitespaceLambda.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/mustache/TrimWhitespaceLambda.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.openapitools.codegen.templating.mustache; +package org.openapijsonschematools.codegen.templating.mustache; import java.io.IOException; import java.io.Writer; diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/templating/mustache/UppercaseLambda.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/mustache/UppercaseLambda.java similarity index 95% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/templating/mustache/UppercaseLambda.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/mustache/UppercaseLambda.java index 4063f3a842a..b7a9e2bae8c 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/templating/mustache/UppercaseLambda.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/templating/mustache/UppercaseLambda.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.openapitools.codegen.templating.mustache; +package org.openapijsonschematools.codegen.templating.mustache; import com.samskivert.mustache.Mustache; import com.samskivert.mustache.Template; diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/utils/ImplementationVersion.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/utils/ImplementationVersion.java similarity index 90% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/utils/ImplementationVersion.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/utils/ImplementationVersion.java index 6c5c5839b66..c61084529f3 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/utils/ImplementationVersion.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/utils/ImplementationVersion.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.openapitools.codegen.utils; +package org.openapijsonschematools.codegen.utils; public class ImplementationVersion { public static String read() { @@ -27,6 +27,6 @@ public static String read() { // When running non-JARed class within an IDE the implementation version is not available, so we provide a means // to set it externally via a system property so that generated artefacts contain the correct version. - return System.getProperty("openapitools.implementation.version", "unset"); + return System.getProperty("openapijsonschematools.implementation.version", "unset"); } } diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/utils/JsonCache.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/utils/JsonCache.java similarity index 99% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/utils/JsonCache.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/utils/JsonCache.java index ac5873ee567..7105a387418 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/utils/JsonCache.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/utils/JsonCache.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.openapitools.codegen.utils; +package org.openapijsonschematools.codegen.utils; import java.io.File; import java.io.InputStream; diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/utils/JsonCacheImpl.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/utils/JsonCacheImpl.java similarity index 99% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/utils/JsonCacheImpl.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/utils/JsonCacheImpl.java index cb02519d507..b983abd9dbe 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/utils/JsonCacheImpl.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/utils/JsonCacheImpl.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.openapitools.codegen.utils; +package org.openapijsonschematools.codegen.utils; import java.io.File; import java.io.FileInputStream; diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/utils/Markdown.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/utils/Markdown.java similarity index 97% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/utils/Markdown.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/utils/Markdown.java index c713bea34d1..6479f53fca4 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/utils/Markdown.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/utils/Markdown.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.openapitools.codegen.utils; +package org.openapijsonschematools.codegen.utils; import org.commonmark.node.Node; import org.commonmark.parser.Parser; diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/utils/ModelUtils.java similarity index 86% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/utils/ModelUtils.java index 18066b3a076..12a32f12e06 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/utils/ModelUtils.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.openapitools.codegen.utils; +package org.openapijsonschematools.codegen.utils; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; @@ -28,17 +28,15 @@ import io.swagger.v3.oas.models.parameters.Parameter; import io.swagger.v3.oas.models.parameters.RequestBody; import io.swagger.v3.oas.models.responses.ApiResponse; +import io.swagger.v3.oas.models.security.SecurityScheme; import io.swagger.v3.parser.core.models.AuthorizationValue; import io.swagger.v3.parser.util.ClasspathHelper; import io.swagger.v3.parser.ObjectMapperFactory; import io.swagger.v3.parser.util.RemoteUrl; import io.swagger.v3.parser.util.SchemaTypeUtil; import org.apache.commons.lang3.StringUtils; -import org.openapitools.codegen.CodegenModel; -import org.openapitools.codegen.IJsonSchemaValidationProperties; -import org.openapitools.codegen.config.GlobalSettings; -import org.openapitools.codegen.model.ModelMap; -import org.openapitools.codegen.model.ModelsMap; +import org.openapijsonschematools.codegen.model.CodegenSchema; +import org.openapijsonschematools.codegen.config.GlobalSettings; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.apache.commons.io.FileUtils; @@ -54,15 +52,11 @@ import java.nio.file.Path; import java.nio.file.Paths; -import static org.openapitools.codegen.utils.OnceLogger.once; - public class ModelUtils { private static final Logger LOGGER = LoggerFactory.getLogger(ModelUtils.class); private static final String URI_FORMAT = "uri"; - private static final String generateAliasAsModelKey = "generateAliasAsModel"; - // A vendor extension to track the value of the 'swagger' field in a 2.0 doc, if applicable. private static final String openapiDocVersion = "x-original-swagger-version"; @@ -86,41 +80,6 @@ public static boolean isDisallowAdditionalPropertiesIfNotPresent() { return Boolean.parseBoolean(GlobalSettings.getProperty(disallowAdditionalPropertiesIfNotPresent, "true")); } - public static void setGenerateAliasAsModel(boolean value) { - GlobalSettings.setProperty(generateAliasAsModelKey, Boolean.toString(value)); - } - - public static boolean isGenerateAliasAsModel() { - return Boolean.parseBoolean(GlobalSettings.getProperty(generateAliasAsModelKey, "false")); - } - - public static boolean isGenerateAliasAsModel(Schema schema) { - return isGenerateAliasAsModel() || (schema.getExtensions() != null && schema.getExtensions().getOrDefault("x-generate-alias-as-model", false).equals(true)); - } - - /** - * Searches for the model by name in the map of models and returns it - * - * @param name Name of the model - * @param models Map of models - * @return model - */ - public static CodegenModel getModelByName(final String name, final Map models) { - final ModelsMap data = models.get(name); - if (data != null) { - final List dataModelsList = data.getModels(); - if (dataModelsList != null) { - for (final ModelMap entryMap : dataModelsList) { - final CodegenModel model = entryMap.getModel(); - if (model != null) { - return model; - } - } - } - } - return null; - } - /** * Return the list of all schemas in the 'components/schemas' section used in the openAPI specification * @@ -186,34 +145,9 @@ public static List getUnusedSchemas(OpenAPI openAPI) { return unusedSchemas; } - /** - * Return the list of schemas in the 'components/schemas' used only in a 'application/x-www-form-urlencoded' or 'multipart/form-data' mime time - * - * @param openAPI specification - * @return schemas a list of schemas - */ - public static List getSchemasUsedOnlyInFormParam(OpenAPI openAPI) { - List schemasUsedInFormParam = new ArrayList(); - List schemasUsedInOtherCases = new ArrayList(); - - visitOpenAPI(openAPI, (s, t) -> { - if (s.get$ref() != null) { - String ref = getSimpleRef(s.get$ref()); - if ("application/x-www-form-urlencoded".equalsIgnoreCase(t) || - "multipart/form-data".equalsIgnoreCase(t)) { - schemasUsedInFormParam.add(ref); - } else { - schemasUsedInOtherCases.add(ref); - } - } - }); - return schemasUsedInFormParam.stream().filter(n -> !schemasUsedInOtherCases.contains(n)).collect(Collectors.toList()); - } - /** * Private method used by several methods ({@link #getAllUsedSchemas(OpenAPI)}, * {@link #getUnusedSchemas(OpenAPI)}, - * {@link #getSchemasUsedOnlyInFormParam(OpenAPI)}, ...) to traverse all paths of an * OpenAPI instance and call the visitor functional interface when a schema is found. * * @param openAPI specification @@ -290,7 +224,7 @@ private static void visitParameters(OpenAPI openAPI, List parameters, } visitContent(openAPI, parameter.getContent(), visitor, visitedSchemas); } else { - once(LOGGER).warn("Unreferenced parameter(s) found."); + OnceLogger.once(LOGGER).warn("Unreferenced parameter(s) found."); } } } @@ -379,7 +313,7 @@ private static interface OpenAPISchemaVisitor { public static String getSimpleRef(String ref) { if (ref == null) { - once(LOGGER).warn("Failed to get the schema name: null"); + OnceLogger.once(LOGGER).warn("Failed to get the schema name: null"); //throw new RuntimeException("Failed to get the schema: null"); return null; } else if (ref.startsWith("#/components/")) { @@ -387,7 +321,7 @@ public static String getSimpleRef(String ref) { } else if (ref.startsWith("#/definitions/")) { ref = ref.substring(ref.lastIndexOf("/") + 1); } else { - once(LOGGER).warn("Failed to get the schema name: {}", ref); + OnceLogger.once(LOGGER).warn("Failed to get the schema name: {}", ref); //throw new RuntimeException("Failed to get the schema: " + ref); return null; } @@ -395,7 +329,7 @@ public static String getSimpleRef(String ref) { try { ref = URLDecoder.decode(ref, "UTF-8"); } catch (UnsupportedEncodingException ignored) { - once(LOGGER).warn("Found UnsupportedEncodingException: {}", ref); + OnceLogger.once(LOGGER).warn("Found UnsupportedEncodingException: {}", ref); } // see https://tools.ietf.org/html/rfc6901#section-3 @@ -770,91 +704,6 @@ public static boolean hasValidation(Schema sc) { ); } - /** - * Check to see if the schema is a free form object. - * - * A free form object is an object (i.e. 'type: object' in a OAS document) that: - * 1) Does not define properties, and - * 2) Is not a composed schema (no anyOf, oneOf, allOf), and - * 3) additionalproperties is not defined, or additionalproperties: true, or additionalproperties: {}. - * - * Examples: - * - * components: - * schemas: - * arbitraryObject: - * type: object - * description: This is a free-form object. - * The value must be a map of strings to values. The value cannot be 'null'. - * It cannot be array, string, integer, number. - * arbitraryNullableObject: - * type: object - * description: This is a free-form object. - * The value must be a map of strings to values. The value can be 'null', - * It cannot be array, string, integer, number. - * nullable: true - * arbitraryTypeValue: - * description: This is NOT a free-form object. - * The value can be any type except the 'null' value. - * - * @param openAPI the object that encapsulates the OAS document. - * @param schema potentially containing a '$ref' - * @return true if it's a free-form object - */ - public static boolean isFreeFormObject(OpenAPI openAPI, Schema schema) { - if (schema == null) { - // TODO: Is this message necessary? A null schema is not a free-form object, so the result is correct. - once(LOGGER).error("Schema cannot be null in isFreeFormObject check"); - return false; - } - - // not free-form if allOf, anyOf, oneOf is not empty - if (schema instanceof ComposedSchema) { - ComposedSchema cs = (ComposedSchema) schema; - List interfaces = ModelUtils.getInterfaces(cs); - if (interfaces != null && !interfaces.isEmpty()) { - return false; - } - } - - // has at least one property - if ("object".equals(schema.getType())) { - // no properties - if ((schema.getProperties() == null || schema.getProperties().isEmpty())) { - Schema addlProps = getAdditionalProperties(openAPI, schema); - - if (schema.getExtensions() != null && schema.getExtensions().containsKey(freeFormExplicit)) { - // User has hard-coded vendor extension to handle free-form evaluation. - boolean isFreeFormExplicit = Boolean.parseBoolean(String.valueOf(schema.getExtensions().get(freeFormExplicit))); - if (!isFreeFormExplicit && addlProps != null && addlProps.getProperties() != null && !addlProps.getProperties().isEmpty()) { - once(LOGGER).error(String.format(Locale.ROOT, "Potentially confusing usage of %s within model which defines additional properties", freeFormExplicit)); - } - return isFreeFormExplicit; - } - - // additionalProperties not defined - if (addlProps == null) { - return true; - } else { - if (addlProps instanceof ObjectSchema) { - ObjectSchema objSchema = (ObjectSchema) addlProps; - // additionalProperties defined as {} - if (objSchema.getProperties() == null || objSchema.getProperties().isEmpty()) { - return true; - } - } else if (addlProps instanceof Schema) { - // additionalProperties defined as {} - if (addlProps.getType() == null && addlProps.get$ref() == null && (addlProps.getProperties() == null || addlProps.getProperties().isEmpty())) { - return true; - } - } - } - } - } - - return false; - } - /** * If a Schema contains a reference to another Schema with '$ref', returns the referenced Schema if it is found or the actual Schema in the other cases. * @@ -934,6 +783,24 @@ public static RequestBody getReferencedRequestBody(OpenAPI openAPI, RequestBody return requestBody; } + /** + * If a SecurityScheme contains a reference to an other SecurityScheme with '$ref', returns the referenced SecurityScheme if it is found or the actual SecurityScheme in the other cases. + * + * @param openAPI specification being checked + * @param securityScheme potentially containing a '$ref' + * @return securityScheme without '$ref' + */ + public static SecurityScheme getReferencedSecurityScheme(OpenAPI openAPI, SecurityScheme securityScheme) { + if (securityScheme != null && StringUtils.isNotEmpty(securityScheme.get$ref())) { + String name = getSimpleRef(securityScheme.get$ref()); + SecurityScheme refSecurityScheme = openAPI.getComponents().getSecuritySchemes().get(name); + if (refSecurityScheme != null) { + return refSecurityScheme; + } + } + return securityScheme; + } + public static RequestBody getRequestBody(OpenAPI openAPI, String name) { if (name == null) { return null; @@ -1207,31 +1074,20 @@ public static Schema unaliasSchema(OpenAPI openAPI, } Schema ref = allSchemas.get(simpleRef); if (ref == null) { - once(LOGGER).warn("{} is not defined", schema.get$ref()); + OnceLogger.once(LOGGER).warn("{} is not defined", schema.get$ref()); return schema; } else if (ref.getEnum() != null && !ref.getEnum().isEmpty()) { // top-level enum class return schema; } else if (isArraySchema(ref)) { - if (isGenerateAliasAsModel(ref)) { - return schema; // generate a model extending array - } else { - return unaliasSchema(openAPI, allSchemas.get(ModelUtils.getSimpleRef(schema.get$ref())), - schemaMappings); - } + return schema; // generate a model extending array } else if (isComposedSchema(ref)) { return schema; } else if (isMapSchema(ref)) { if (ref.getProperties() != null && !ref.getProperties().isEmpty()) // has at least one property return schema; // treat it as model else { - if (isGenerateAliasAsModel(ref)) { - return schema; // generate a model extending map - } else { - // treat it as a typical map - return unaliasSchema(openAPI, allSchemas.get(ModelUtils.getSimpleRef(schema.get$ref())), - schemaMappings); - } + return schema; // generate a model extending map } } else if (isObjectSchema(ref)) { // model if (ref.getProperties() != null && !ref.getProperties().isEmpty()) { // has at least one property @@ -1623,8 +1479,8 @@ public static boolean isAnyType(Schema schema) { return (schema.get$ref() == null && schema.getType() == null); } - public static void syncValidationProperties(Schema schema, IJsonSchemaValidationProperties target) { - // TODO move this method to IJsonSchemaValidationProperties + public static void syncValidationProperties(Schema schema, CodegenSchema target) { + // TODO move this method to OpenApiSchema if (schema != null && target != null) { if (isNullType(schema) || schema.get$ref() != null || isBooleanSchema(schema)) { return; @@ -1661,48 +1517,42 @@ public static void syncValidationProperties(Schema schema, IJsonSchemaValidation setStringValidations(minLength, maxLength, pattern, target); setNumericValidations(schema, multipleOf, minimum, maximum, exclusiveMinimum, exclusiveMaximum, target); } - - if (maxItems != null || minItems != null || minProperties != null || maxProperties != null || minLength != null || maxLength != null || multipleOf != null || pattern != null || minimum != null || maximum != null || exclusiveMinimum != null || exclusiveMaximum != null || uniqueItems != null) { - target.setHasValidation(true); - } } } - private static void setArrayValidations(Integer minItems, Integer maxItems, Boolean uniqueItems, IJsonSchemaValidationProperties target) { - if (minItems != null) target.setMinItems(minItems); - if (maxItems != null) target.setMaxItems(maxItems); - if (uniqueItems != null) target.setUniqueItems(uniqueItems); - if (uniqueItems != null) target.setUniqueItemsBoolean(uniqueItems); + private static void setArrayValidations(Integer minItems, Integer maxItems, Boolean uniqueItems, CodegenSchema target) { + if (minItems != null) target.minItems = minItems; + if (maxItems != null) target.maxItems = maxItems; + if (uniqueItems != null) target.uniqueItems = uniqueItems; } - private static void setObjectValidations(Integer minProperties, Integer maxProperties, IJsonSchemaValidationProperties target) { - if (minProperties != null) target.setMinProperties(minProperties); - if (maxProperties != null) target.setMaxProperties(maxProperties); + private static void setObjectValidations(Integer minProperties, Integer maxProperties, CodegenSchema target) { + if (minProperties != null) target.minProperties = minProperties; + if (maxProperties != null) target.maxProperties = maxProperties; } - private static void setStringValidations(Integer minLength, Integer maxLength, String pattern, IJsonSchemaValidationProperties target) { - if (minLength != null) target.setMinLength(minLength); - if (maxLength != null) target.setMaxLength(maxLength); - if (pattern != null) target.setPattern(pattern); + private static void setStringValidations(Integer minLength, Integer maxLength, String pattern, CodegenSchema target) { + if (minLength != null) target.minLength = minLength; + if (maxLength != null) target.maxLength = maxLength; } - private static void setNumericValidations(Schema schema, BigDecimal multipleOf, BigDecimal minimum, BigDecimal maximum, Boolean exclusiveMinimum, Boolean exclusiveMaximum, IJsonSchemaValidationProperties target) { - if (multipleOf != null) target.setMultipleOf(multipleOf); + private static void setNumericValidations(Schema schema, BigDecimal multipleOf, BigDecimal minimum, BigDecimal maximum, Boolean exclusiveMinimum, Boolean exclusiveMaximum, CodegenSchema target) { + if (multipleOf != null) target.multipleOf = multipleOf; if (minimum != null) { if (isIntegerSchema(schema)) { - target.setMinimum(String.valueOf(minimum.longValue())); + target.minimum = String.valueOf(minimum.longValue()); } else { - target.setMinimum(String.valueOf(minimum)); + target.minimum = String.valueOf(minimum); } - if (exclusiveMinimum != null) target.setExclusiveMinimum(exclusiveMinimum); + if (exclusiveMinimum != null) target.exclusiveMinimum = exclusiveMinimum; } if (maximum != null) { if (isIntegerSchema(schema)) { - target.setMaximum(String.valueOf(maximum.longValue())); + target.maximum = String.valueOf(maximum.longValue()); } else { - target.setMaximum(String.valueOf(maximum)); + target.maximum = String.valueOf(maximum); } - if (exclusiveMaximum != null) target.setExclusiveMaximum(exclusiveMaximum); + if (exclusiveMaximum != null) target.exclusiveMaximum = exclusiveMaximum; } } @@ -1783,4 +1633,12 @@ public static SemVer getOpenApiVersion(OpenAPI openAPI, String location, List models, int initialIndex) { + for (CodegenSchema cm : models.values()) { + int i = initialIndex; + for (CodegenSchema var : cm.properties.values()) { + var.vendorExtensions.put("x-index", i); + i++; + } + } + } + + /** + * Add x-index extension to the model's properties + * + * @param models List of models + */ + public static void addIndexToProperties(TreeMap models) { + addIndexToProperties(models, 0); + } + + /** + * Returns true if the specified OAS model has at least one operation with HTTP bearer authentication. + * + * @param openAPI An instance of OpenAPI + * @return True if at least one operation has HTTP bearer security scheme defined + */ + public static boolean hasHttpBearerMethods(OpenAPI openAPI) { + final Map securitySchemes = getSecuritySchemes(openAPI); + if (securitySchemes != null) { + for (Map.Entry scheme : securitySchemes.entrySet()) { + if (SecurityScheme.Type.HTTP.equals(scheme.getValue().getType()) && "bearer".equals(scheme.getValue().getScheme())) { + return true; + } + } + } + + return false; + } + + /** + * Returns true if the specified OAS model has at least one operation with HTTP basic authentication. + * + * @param openAPI An instance of OpenAPI + * @return True if at least one operation has HTTP basic security scheme defined + */ + public static boolean hasHttpBasicMethods(OpenAPI openAPI) { + final Map securitySchemes = getSecuritySchemes(openAPI); + if (securitySchemes != null) { + for (Map.Entry scheme : securitySchemes.entrySet()) { + if (SecurityScheme.Type.HTTP.equals(scheme.getValue().getType()) && "basic".equals(scheme.getValue().getScheme())) { + return true; + } + } + } + + return false; + } + + /** + * Returns true if the specified OAS model has at least one operation with HTTP signature authentication. + * + * @param openAPI An instance of OpenAPI + * @return True if at least one operation has HTTP signature security scheme defined + */ + public static boolean hasHttpSignatureMethods(OpenAPI openAPI) { + final Map securitySchemes = getSecuritySchemes(openAPI); + if (securitySchemes != null) { + for (Map.Entry scheme : securitySchemes.entrySet()) { + if (SecurityScheme.Type.HTTP.equals(scheme.getValue().getType()) && "signature".equals(scheme.getValue().getScheme())) { + return true; + } + } + } + + return false; + } + + /** + * Returns true if the specified OAS model has at least one operation with API key authentication. + * + * @param openAPI An instance of OpenAPI + * @return True if at least one operation has API key security scheme defined + */ + public static boolean hasApiKeyMethods(OpenAPI openAPI) { + final Map securitySchemes = getSecuritySchemes(openAPI); + if (securitySchemes != null) { + for (Map.Entry scheme : securitySchemes.entrySet()) { + if (SecurityScheme.Type.APIKEY.equals(scheme.getValue().getType())) { + return true; + } + } + } + + return false; + } + + public static Map getSecuritySchemes(OpenAPI openAPI) { + if (openAPI == null) { + return null; + } else { + return openAPI.getComponents() != null ? openAPI.getComponents().getSecuritySchemes() : null; + } + } +} + diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/utils/SemVer.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/utils/SemVer.java similarity index 97% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/utils/SemVer.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/utils/SemVer.java index 0dc35067779..05c91a689fd 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/utils/SemVer.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/utils/SemVer.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.openapitools.codegen.utils; +package org.openapijsonschematools.codegen.utils; public class SemVer implements Comparable { diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/utils/StringUtils.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/utils/StringUtils.java similarity index 97% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/utils/StringUtils.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/utils/StringUtils.java index afd23f24cd7..f1f4ee44abf 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/utils/StringUtils.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/utils/StringUtils.java @@ -1,11 +1,11 @@ -package org.openapitools.codegen.utils; +package org.openapijsonschematools.codegen.utils; import com.github.benmanes.caffeine.cache.Cache; import com.github.benmanes.caffeine.cache.Caffeine; import com.github.benmanes.caffeine.cache.Ticker; import org.apache.commons.lang3.tuple.ImmutablePair; import org.apache.commons.lang3.tuple.Pair; -import org.openapitools.codegen.config.GlobalSettings; +import org.openapijsonschematools.codegen.config.GlobalSettings; import java.util.Collections; import java.util.List; @@ -22,11 +22,11 @@ public class StringUtils { /** * Set the cache size (entry count) of the sanitizedNameCache, camelizedWordsCache and underscoreWordsCache. */ - public static final String NAME_CACHE_SIZE_PROPERTY = "org.openapitools.codegen.utils.namecache.cachesize"; + public static final String NAME_CACHE_SIZE_PROPERTY = "org.openapijsonschematools.codegen.utils.namecache.cachesize"; /** * Set the cache expiry (in seconds) of the sanitizedNameCache, camelizedWordsCache and underscoreWordsCache. */ - public static final String NAME_CACHE_EXPIRY_PROPERTY = "org.openapitools.codegen.utils.namecache.expireafter.seconds"; + public static final String NAME_CACHE_EXPIRY_PROPERTY = "org.openapijsonschematools.codegen.utils.namecache.expireafter.seconds"; // A cache of camelized words. The camelize() method is invoked many times with the same // arguments, this cache is used to optimized performance. diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/utils/URLPathUtils.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/utils/URLPathUtils.java similarity index 98% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/utils/URLPathUtils.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/utils/URLPathUtils.java index 7bdaac0d04f..59f67e28086 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/utils/URLPathUtils.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/utils/URLPathUtils.java @@ -15,14 +15,14 @@ * limitations under the License. */ -package org.openapitools.codegen.utils; +package org.openapijsonschematools.codegen.utils; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.servers.Server; import io.swagger.v3.oas.models.servers.ServerVariable; import io.swagger.v3.oas.models.servers.ServerVariables; import org.apache.commons.lang3.StringUtils; -import org.openapitools.codegen.CodegenConfig; +import org.openapijsonschematools.codegen.CodegenConfig; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -32,7 +32,7 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -import static org.openapitools.codegen.utils.OnceLogger.once; +import static org.openapijsonschematools.codegen.utils.OnceLogger.once; public class URLPathUtils { diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/validations/oas/OpenApiEvaluator.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/validations/oas/OpenApiEvaluator.java similarity index 93% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/validations/oas/OpenApiEvaluator.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/validations/oas/OpenApiEvaluator.java index 56097b74d0f..e95c59bb672 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/validations/oas/OpenApiEvaluator.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/validations/oas/OpenApiEvaluator.java @@ -1,4 +1,4 @@ -package org.openapitools.codegen.validations.oas; +package org.openapijsonschematools.codegen.validations.oas; import io.swagger.v3.oas.models.Components; import io.swagger.v3.oas.models.OpenAPI; @@ -7,8 +7,12 @@ import io.swagger.v3.oas.models.parameters.Parameter; import io.swagger.v3.oas.models.security.SecurityScheme; import io.swagger.v3.oas.models.tags.Tag; -import org.openapitools.codegen.utils.ModelUtils; -import org.openapitools.codegen.validation.*; +import org.openapijsonschematools.codegen.utils.ModelUtils; +import org.openapijsonschematools.codegen.validation.Severity; +import org.openapijsonschematools.codegen.validation.Validated; +import org.openapijsonschematools.codegen.validation.ValidationResult; +import org.openapijsonschematools.codegen.validation.ValidationRule; +import org.openapijsonschematools.codegen.validation.Validator; import java.util.*; diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/validations/oas/OpenApiOperationValidations.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/validations/oas/OpenApiOperationValidations.java similarity index 94% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/validations/oas/OpenApiOperationValidations.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/validations/oas/OpenApiOperationValidations.java index 9b1de83e524..c68be46d049 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/validations/oas/OpenApiOperationValidations.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/validations/oas/OpenApiOperationValidations.java @@ -1,10 +1,10 @@ -package org.openapitools.codegen.validations.oas; +package org.openapijsonschematools.codegen.validations.oas; import io.swagger.v3.oas.models.PathItem; import io.swagger.v3.oas.models.parameters.RequestBody; import org.apache.commons.lang3.StringUtils; -import org.openapitools.codegen.validation.GenericValidator; -import org.openapitools.codegen.validation.ValidationRule; +import org.openapijsonschematools.codegen.validation.GenericValidator; +import org.openapijsonschematools.codegen.validation.ValidationRule; import java.util.ArrayList; import java.util.Locale; diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/validations/oas/OpenApiParameterValidations.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/validations/oas/OpenApiParameterValidations.java similarity index 91% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/validations/oas/OpenApiParameterValidations.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/validations/oas/OpenApiParameterValidations.java index 17dd08c4333..63cd574e842 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/validations/oas/OpenApiParameterValidations.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/validations/oas/OpenApiParameterValidations.java @@ -1,10 +1,10 @@ -package org.openapitools.codegen.validations.oas; +package org.openapijsonschematools.codegen.validations.oas; import io.swagger.v3.oas.models.parameters.HeaderParameter; import io.swagger.v3.oas.models.parameters.Parameter; import org.apache.commons.lang3.StringUtils; -import org.openapitools.codegen.validation.GenericValidator; -import org.openapitools.codegen.validation.ValidationRule; +import org.openapijsonschematools.codegen.validation.GenericValidator; +import org.openapijsonschematools.codegen.validation.ValidationRule; import java.util.ArrayList; import java.util.Locale; diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/validations/oas/OpenApiSchemaValidations.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/validations/oas/OpenApiSchemaValidations.java similarity index 96% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/validations/oas/OpenApiSchemaValidations.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/validations/oas/OpenApiSchemaValidations.java index af784363e29..9f359dd015f 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/validations/oas/OpenApiSchemaValidations.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/validations/oas/OpenApiSchemaValidations.java @@ -1,12 +1,12 @@ -package org.openapitools.codegen.validations.oas; +package org.openapijsonschematools.codegen.validations.oas; import io.swagger.v3.oas.models.media.ComposedSchema; import io.swagger.v3.oas.models.media.Schema; -import org.openapitools.codegen.utils.ModelUtils; -import org.openapitools.codegen.utils.SemVer; -import org.openapitools.codegen.validation.GenericValidator; -import org.openapitools.codegen.validation.ValidationRule; +import org.openapijsonschematools.codegen.utils.ModelUtils; +import org.openapijsonschematools.codegen.utils.SemVer; +import org.openapijsonschematools.codegen.validation.GenericValidator; +import org.openapijsonschematools.codegen.validation.ValidationRule; import java.util.ArrayList; import java.util.Locale; diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/validations/oas/OpenApiSecuritySchemeValidations.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/validations/oas/OpenApiSecuritySchemeValidations.java similarity index 90% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/validations/oas/OpenApiSecuritySchemeValidations.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/validations/oas/OpenApiSecuritySchemeValidations.java index 3ce59ff3f16..eebf322268d 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/validations/oas/OpenApiSecuritySchemeValidations.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/validations/oas/OpenApiSecuritySchemeValidations.java @@ -1,9 +1,9 @@ -package org.openapitools.codegen.validations.oas; +package org.openapijsonschematools.codegen.validations.oas; import io.swagger.v3.oas.models.security.SecurityScheme; import org.apache.commons.lang3.StringUtils; -import org.openapitools.codegen.validation.GenericValidator; -import org.openapitools.codegen.validation.ValidationRule; +import org.openapijsonschematools.codegen.validation.GenericValidator; +import org.openapijsonschematools.codegen.validation.ValidationRule; import java.util.ArrayList; import java.util.Locale; diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/validations/oas/OperationWrapper.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/validations/oas/OperationWrapper.java similarity index 95% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/validations/oas/OperationWrapper.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/validations/oas/OperationWrapper.java index 5e4cbce630b..79dbb08b42f 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/validations/oas/OperationWrapper.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/validations/oas/OperationWrapper.java @@ -1,4 +1,4 @@ -package org.openapitools.codegen.validations.oas; +package org.openapijsonschematools.codegen.validations.oas; import io.swagger.v3.oas.models.Operation; import io.swagger.v3.oas.models.PathItem; diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/validations/oas/ParameterWrapper.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/validations/oas/ParameterWrapper.java similarity index 93% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/validations/oas/ParameterWrapper.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/validations/oas/ParameterWrapper.java index 7d74d5aae90..0b6416b4518 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/validations/oas/ParameterWrapper.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/validations/oas/ParameterWrapper.java @@ -1,4 +1,4 @@ -package org.openapitools.codegen.validations.oas; +package org.openapijsonschematools.codegen.validations.oas; import io.swagger.v3.oas.models.parameters.Parameter; import io.swagger.v3.oas.models.OpenAPI; diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/validations/oas/RuleConfiguration.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/validations/oas/RuleConfiguration.java similarity index 99% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/validations/oas/RuleConfiguration.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/validations/oas/RuleConfiguration.java index 56f254cfbac..a1e09b89935 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/validations/oas/RuleConfiguration.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/validations/oas/RuleConfiguration.java @@ -1,4 +1,4 @@ -package org.openapitools.codegen.validations.oas; +package org.openapijsonschematools.codegen.validations.oas; /** * Allows for configuration of validation rules which will be applied to a specification. diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/validations/oas/SchemaWrapper.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/validations/oas/SchemaWrapper.java similarity index 93% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/validations/oas/SchemaWrapper.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/validations/oas/SchemaWrapper.java index 5b500035b0e..27664ec8f68 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/validations/oas/SchemaWrapper.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/validations/oas/SchemaWrapper.java @@ -1,4 +1,4 @@ -package org.openapitools.codegen.validations.oas; +package org.openapijsonschematools.codegen.validations.oas; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.OpenAPI; diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/validations/oas/SecuritySchemeWrapper.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/validations/oas/SecuritySchemeWrapper.java similarity index 94% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/validations/oas/SecuritySchemeWrapper.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/validations/oas/SecuritySchemeWrapper.java index c089eeba946..8684eb18916 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/validations/oas/SecuritySchemeWrapper.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/validations/oas/SecuritySchemeWrapper.java @@ -1,4 +1,4 @@ -package org.openapitools.codegen.validations.oas; +package org.openapijsonschematools.codegen.validations.oas; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.security.SecurityScheme; diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/validations/oas/ValidationConstants.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/validations/oas/ValidationConstants.java similarity index 86% rename from modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/validations/oas/ValidationConstants.java rename to modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/validations/oas/ValidationConstants.java index 9571f1bedcd..790b1bf0d1d 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/validations/oas/ValidationConstants.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/validations/oas/ValidationConstants.java @@ -1,4 +1,4 @@ -package org.openapitools.codegen.validations.oas; +package org.openapijsonschematools.codegen.validations.oas; final class ValidationConstants { static String ApacheNginxUnderscoreDescription = "Apache and Nginx may fail on headers keys with underscore!"; diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenComposedSchemas.java b/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenComposedSchemas.java deleted file mode 100644 index e53ecf8a4cd..00000000000 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenComposedSchemas.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen; - -import java.util.*; - -public class CodegenComposedSchemas { - private List allOf; - private List oneOf; - private List anyOf; - private CodegenProperty not = null; - - public CodegenComposedSchemas(List allOf, List oneOf, List anyOf, CodegenProperty not) { - this.allOf = allOf; - this.oneOf = oneOf; - this.anyOf = anyOf; - this.not = not; - } - - public List getAllOf() { - return allOf; - } - - public List getOneOf() { - return oneOf; - } - - public List getAnyOf() { - return anyOf; - } - - public CodegenProperty getNot() { - return not; - } - - public String toString() { - final StringBuilder sb = new StringBuilder("CodegenComposedSchemas{"); - sb.append("oneOf=").append(oneOf); - sb.append(", anyOf=").append(anyOf); - sb.append(", allOf=").append(allOf); - sb.append(", not=").append(not); - sb.append('}'); - return sb.toString(); - } - - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - CodegenComposedSchemas that = (CodegenComposedSchemas) o; - return Objects.equals(oneOf, that.oneOf) && - Objects.equals(anyOf, that.anyOf) && - Objects.equals(allOf, that.allOf) && - Objects.equals(not, that.not); - } - - @Override - public int hashCode() { - return Objects.hash(oneOf, anyOf, allOf, not); - } -} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenConfig.java b/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenConfig.java deleted file mode 100644 index 2917c2ee0a9..00000000000 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenConfig.java +++ /dev/null @@ -1,333 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen; - -import com.samskivert.mustache.Mustache.Compiler; -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.Operation; -import io.swagger.v3.oas.models.media.Schema; -import io.swagger.v3.oas.models.security.SecurityScheme; -import io.swagger.v3.oas.models.servers.Server; -import io.swagger.v3.oas.models.servers.ServerVariable; -import org.openapitools.codegen.api.TemplatingEngineAdapter; -import org.openapitools.codegen.meta.FeatureSet; -import org.openapitools.codegen.meta.GeneratorMetadata; -import org.openapitools.codegen.model.ModelMap; -import org.openapitools.codegen.model.ModelsMap; -import org.openapitools.codegen.model.OperationsMap; - -import java.io.File; -import java.util.List; -import java.util.Map; -import java.util.Set; - -public interface CodegenConfig { - String getFilesMetadataFilename(); - - String getVersionMetadataFilename(); - - GeneratorMetadata getGeneratorMetadata(); - - CodegenType getTag(); - - String getName(); - - String getHelp(); - - Map additionalProperties(); - - Map serverVariableOverrides(); - - Map vendorExtensions(); - - String testPackage(); - - String apiPackage(); - - String apiFileFolder(); - - String apiTestFileFolder(); - - String apiDocFileFolder(); - - String fileSuffix(); - - String outputFolder(); - - String templateDir(); - - String embeddedTemplateDir(); - - String modelFileFolder(); - - String modelTestFileFolder(); - - String modelDocFileFolder(); - - String modelPackage(); - - String toApiName(String name); - - String toApiVarName(String name); - - String toModelName(String name); - - String toParamName(String name); - - String escapeText(String text); - - String escapeTextWhileAllowingNewLines(String text); - - String encodePath(String text); - - String escapeUnsafeCharacters(String input); - - String escapeReservedWord(String name); - - String escapeQuotationMark(String input); - - String getTypeDeclaration(Schema schema); - - String getTypeDeclaration(String name); - - void processOpts(); - - List cliOptions(); - - String generateExamplePath(String path, Operation operation); - - Set reservedWords(); - - List supportingFiles(); - - String getInputSpec(); - - void setInputSpec(String inputSpec); - - String getOutputDir(); - - void setOutputDir(String dir); - - CodegenModel fromModel(String name, Schema schema); - - CodegenOperation fromOperation(String resourcePath, String httpMethod, Operation operation, List servers); - - List fromSecurity(Map schemas); - - List fromServers(List servers); - - List fromServerVariables(Map variables); - - Set defaultIncludes(); - - Map typeMapping(); - - Map instantiationTypes(); - - Map importMapping(); - - Map schemaMapping(); - - Map inlineSchemaNameMapping(); - - Map inlineSchemaNameDefault(); - - Map apiTemplateFiles(); - - Map modelTemplateFiles(); - - Map apiTestTemplateFiles(); - - Map modelTestTemplateFiles(); - - Map apiDocTemplateFiles(); - - Map modelDocTemplateFiles(); - - Set languageSpecificPrimitives(); - - Map reservedWordsMappings(); - - void preprocessOpenAPI(OpenAPI openAPI); - - void processOpenAPI(OpenAPI openAPI); - - Compiler processCompiler(Compiler compiler); - - TemplatingEngineAdapter processTemplatingEngine(TemplatingEngineAdapter templatingEngine); - - String sanitizeTag(String tag); - - String toApiFilename(String name); - - String toModelFilename(String name); - - String toApiTestFilename(String name); - - String toModelTestFilename(String name); - - String toApiDocFilename(String name); - - String toModelDocFilename(String name); - - String toModelImport(String name); - - Map toModelImportMap(String name); - - String toApiImport(String name); - - void addOperationToGroup(String tag, String resourcePath, Operation operation, CodegenOperation co, Map> operations); - - Map updateAllModels(Map objs); - - void postProcess(); - - Map postProcessAllModels(Map objs); - - ModelsMap postProcessModels(ModelsMap objs); - - OperationsMap postProcessOperationsWithModels(OperationsMap objs, List allModels); - - Map postProcessSupportingFileData(Map objs); - - void postProcessModelProperty(CodegenModel model, CodegenProperty property); - - void postProcessParameter(CodegenParameter parameter); - - String modelFilename(String templateName, String modelName); - - String apiFilename(String templateName, String tag); - - String apiTestFilename(String templateName, String tag); - - String apiDocFilename(String templateName, String tag); - - boolean shouldOverwrite(String filename); - - boolean isSkipOverwrite(); - - void setSkipOverwrite(boolean skipOverwrite); - - boolean isRemoveOperationIdPrefix(); - - void setRemoveOperationIdPrefix(boolean removeOperationIdPrefix); - - boolean isSkipOperationExample(); - - void setSkipOperationExample(boolean skipOperationExample); - - public boolean isHideGenerationTimestamp(); - - public void setHideGenerationTimestamp(boolean hideGenerationTimestamp); - - Map supportedLibraries(); - - void setLibrary(String library); - - /** - * Library template (sub-template). - * - * @return library template - */ - String getLibrary(); - - void setGitHost(String gitHost); - - String getGitHost(); - - void setGitUserId(String gitUserId); - - String getGitUserId(); - - void setGitRepoId(String gitRepoId); - - String getGitRepoId(); - - void setReleaseNote(String releaseNote); - - String getReleaseNote(); - - void setHttpUserAgent(String httpUserAgent); - - String getHttpUserAgent(); - - void setDocExtension(String docExtension); - - String getDocExtension(); - - void setIgnoreFilePathOverride(String ignoreFileOverride); - - String getIgnoreFilePathOverride(); - - String toBooleanGetter(String name); - - String toSetter(String name); - - String toGetter(String name); - - String sanitizeName(String name); - - void postProcessFile(File file, String fileType); - - boolean isEnablePostProcessFile(); - - void setEnablePostProcessFile(boolean isEnablePostProcessFile); - - /** - * Set the OpenAPI instance. This method needs to be called right after the instantiation of the Codegen class. - * - * @param openAPI specification being generated - */ - void setOpenAPI(OpenAPI openAPI); - - void setTemplatingEngine(TemplatingEngineAdapter s); - - TemplatingEngineAdapter getTemplatingEngine(); - - public boolean isEnableMinimalUpdate(); - - public void setEnableMinimalUpdate(boolean isEnableMinimalUpdate); - - boolean isStrictSpecBehavior(); - - void setStrictSpecBehavior(boolean strictSpecBehavior); - - FeatureSet getFeatureSet(); - - boolean isRemoveEnumValuePrefix(); - - void setRemoveEnumValuePrefix(boolean removeEnumValuePrefix); - - Schema unaliasSchema(Schema schema); - - String defaultTemplatingEngine(); - - GeneratorLanguage generatorLanguage(); - - /* - the version of the language that the generator implements - For python 3.9.0, generatorLanguageVersion would be "3.9.0" - */ - String generatorLanguageVersion(); - - List getSupportedVendorExtensions(); - - boolean getUseInlineModelResolver(); - - boolean getAddSuffixToDuplicateOperationNicknames(); -} diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenDiscriminator.java b/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenDiscriminator.java deleted file mode 100644 index 6cef953b7d6..00000000000 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenDiscriminator.java +++ /dev/null @@ -1,192 +0,0 @@ -package org.openapitools.codegen; - -import java.util.TreeSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** - * This class encapsulates the OpenAPI discriminator construct, as specified at - * https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.3.md#discriminatorObject. - * - * When request bodies or response payloads may be one of a number of different schemas, - * a discriminator object can be used to aid in serialization, deserialization, and validation. - * The discriminator is a specific object in a schema which is used to inform the consumer of - * the specification of an alternative schema based on the value associated with it. - */ -public class CodegenDiscriminator { - // The name of the property in the payload that will hold the discriminator value. - // This is the propertyName as specified in the OpenAPI discriminator object. - private String propertyName; - private String propertyBaseName; - private String propertyGetter; - private String propertyType; - private Map mapping; - private boolean isEnum; - - // mappedModels is populated differently if legacyDiscriminatorBehavior is - // True or False. When: - // - // legacyDiscriminatorBehavior == False, this contains: - // - the name to schema map info in the discriminator mapping entry in your openapi spec OR - // - child schemas that allOf inherit self schema - // - // legacyDiscriminatorBehavior == True, this contains: - // - the name to schema map info in the discriminMappedModelator mapping entry in your openapi spec AND - // - x-discriminator-value mappings in child oneOf + anyOf schemas + descendant schemas that allOf inherit self schema AND - // - descendant schemas that allOf inherit self schema AND - // - child oneOf + anyOf schemas - // - // see the method createDiscriminator in DefaultCodegen.java - - private Set mappedModels = new TreeSet<>(); - - public String getPropertyName() { - return propertyName; - } - - public void setPropertyName(String propertyName) { - this.propertyName = propertyName; - } - - public String getPropertyGetter() { - return propertyGetter; - } - - public void setPropertyGetter(String propertyGetter) { - this.propertyGetter = propertyGetter; - } - - public String getPropertyBaseName() { - return propertyBaseName; - } - - public void setPropertyBaseName(String propertyBaseName) { - this.propertyBaseName = propertyBaseName; - } - - public String getPropertyType() { - return propertyType; - } - - public void setPropertyType(String propertyType) { - this.propertyType = propertyType; - } - - public Map getMapping() { - return mapping; - } - - public void setMapping(Map mapping) { - this.mapping = mapping; - } - - public Set getMappedModels() { - return mappedModels; - } - - public void setMappedModels(Set mappedModels) { - this.mappedModels = mappedModels; - } - - public boolean getIsEnum() { - return isEnum; - } - - public void setIsEnum(boolean isEnum) { - this.isEnum = isEnum; - } - - /** - * An object to hold discriminator mappings between payload values and schema names or - * references. - * - * In the OpenAPI document, the discriminator "mapping" attribute is optional. - * In scenarios where the value of the discriminator field does not match the schema name - * or implicit mapping is not possible, an optional mapping definition MAY be used. - * In OpenAPITools codegen, the MappedModel is the union of all the discriminator mappings, - * both explicitly defined in the OpenAPI document and inherited from oneOf/allOf/anyOf. - */ - public static class MappedModel implements Comparable{ - // The value of the discriminator property in the payload. - private String mappingName; - // The OAS schema name. It is obtained from the OAS document, and the string value - // is converted to a sanitized, internal representation within codegen. - private String modelName; - - public MappedModel(String mappingName, String modelName) { - this.mappingName = mappingName; - this.modelName = modelName; - } - - @Override - public int compareTo(MappedModel other) { - if (getMappingName() == null && other.getMappingName() == null) { - return 0; - } else if (getMappingName() == null) { - return 1; - } else if (other.getMappingName() == null) { - return -1; - } - return getMappingName().compareTo(other.getMappingName()); - } - - public String getMappingName() { - return mappingName; - } - - public void setMappingName(String mappingName) { - this.mappingName = mappingName; - } - - public String getModelName() { - return modelName; - } - - public void setModelName(String modelName) { - this.modelName = modelName; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - MappedModel that = (MappedModel) o; - return Objects.equals(mappingName, that.mappingName) && - Objects.equals(modelName, that.modelName); - } - - @Override - public int hashCode() { - return Objects.hash(mappingName, modelName); - } - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - CodegenDiscriminator that = (CodegenDiscriminator) o; - return Objects.equals(propertyName, that.propertyName) && - Objects.equals(propertyBaseName, that.propertyBaseName) && - Objects.equals(mapping, that.mapping) && - Objects.equals(mappedModels, that.mappedModels); - } - - @Override - public int hashCode() { - - return Objects.hash(propertyName, propertyBaseName, mapping, mappedModels); - } - - @Override - public String toString() { - final StringBuffer sb = new StringBuffer("CodegenDiscriminator{"); - sb.append("propertyName='").append(propertyName).append('\''); - sb.append(", propertyBaseName='").append(propertyBaseName).append('\''); - sb.append(", mapping=").append(mapping); - sb.append(", mappedModels=").append(mappedModels); - sb.append('}'); - return sb.toString(); - } -} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenEncoding.java b/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenEncoding.java deleted file mode 100644 index efd5b0f16ab..00000000000 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenEncoding.java +++ /dev/null @@ -1,67 +0,0 @@ -package org.openapitools.codegen; - -import java.util.List; -import java.util.Objects; - -public class CodegenEncoding { - private String contentType; - private List headers; - private String style; - private boolean explode; - private boolean allowReserved; - - public CodegenEncoding(String contentType, List headers, String style, boolean explode, boolean allowReserved) { - this.contentType = contentType; - this.headers = headers; - this.style = style; - this.explode = explode; - this.allowReserved = allowReserved; - } - - public String getContentType() { - return contentType; - } - - public List getHeaders() { - return headers; - } - - public String getStyle() { - return style; - } - - public boolean getExplode() { - return explode; - } - - public boolean getAllowReserved() { - return allowReserved; - } - - public String toString() { - final StringBuilder sb = new StringBuilder("CodegenEncoding{"); - sb.append("contentType=").append(contentType); - sb.append(", headers=").append(headers); - sb.append(", style=").append(style); - sb.append(", explode=").append(explode); - sb.append(", allowReserved=").append(allowReserved); - sb.append('}'); - return sb.toString(); - } - - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - CodegenEncoding that = (CodegenEncoding) o; - return contentType == that.getContentType() && - Objects.equals(headers, that.getHeaders()) && - style == that.getStyle() && - explode == that.getExplode() && - allowReserved == that.getAllowReserved(); - } - - @Override - public int hashCode() { - return Objects.hash(contentType, headers, style, explode, allowReserved); - } -} diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenMediaType.java b/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenMediaType.java deleted file mode 100644 index 2728bc632fa..00000000000 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenMediaType.java +++ /dev/null @@ -1,52 +0,0 @@ -package org.openapitools.codegen; - -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.Objects; - -public class CodegenMediaType { - private CodegenProperty schema; - private LinkedHashMap encoding; - private HashMap testCases = new HashMap<>(); - - public CodegenMediaType(CodegenProperty schema, LinkedHashMap encoding, HashMap testCases) { - this.schema = schema; - this.encoding = encoding; - if (testCases != null) { - this.testCases = testCases; - } - } - - public CodegenProperty getSchema() { - return schema; - } - - public LinkedHashMap getEncoding() { - return encoding; - } - - public HashMap getTestCases() { return testCases; } - - public String toString() { - final StringBuilder sb = new StringBuilder("CodegenMediaType{"); - sb.append("schema=").append(schema); - sb.append(", encoding=").append(encoding); - sb.append('}'); - return sb.toString(); - } - - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - CodegenMediaType that = (CodegenMediaType) o; - return Objects.equals(schema,that.getSchema()) && - Objects.equals(encoding, that.getEncoding()); - } - - @Override - public int hashCode() { - return Objects.hash(schema, encoding); - } -} - - diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenModel.java b/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenModel.java deleted file mode 100644 index 26d06d5fbb6..00000000000 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenModel.java +++ /dev/null @@ -1,1297 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import io.swagger.v3.oas.models.ExternalDocumentation; - -import java.util.*; - -import org.apache.commons.lang3.StringUtils; - -/** - * CodegenModel represents a schema object in a OpenAPI document. - */ -@JsonIgnoreProperties({"parentModel", "interfaceModels"}) -public class CodegenModel implements IJsonSchemaValidationProperties { - // The parent model name from the schemas. The parent is determined by inspecting the allOf, anyOf and - // oneOf attributes in the OAS. First codegen inspects 'allOf', then 'anyOf', then 'oneOf'. - // If there are multiple object references in the attribute ('allOf', 'anyOf', 'oneOf'), and one of the - // object is a discriminator, that object is set as the parent. If no discriminator is specified, - // codegen returns the first one in the list, i.e. there is no obvious parent in the OpenAPI specification. - // When possible, the mustache templates should use 'allParents' to handle multiple parents. - public String parent, parentSchema; - public List interfaces; - // The list of parent model name from the schemas. In order of preference, the parent is obtained - // from the 'allOf' attribute, then 'anyOf', and finally 'oneOf'. - public List allParents; - - // References to parent and interface CodegenModels. Only set when code generator supports inheritance. - public CodegenModel parentModel; - public List interfaceModels; - public List children; - - // anyOf, oneOf, allOf - public Set anyOf = new TreeSet<>(); - public Set oneOf = new TreeSet<>(); - public Set allOf = new TreeSet<>(); - - // The schema name as written in the OpenAPI document. - public String name; - // The language-specific name of the class that implements this schema. - // The name of the class is derived from the OpenAPI schema name with formatting rules applied. - // The classname is derived from the OpenAPI schema name, with sanitization and escaping rules applied. - public String classname; - // The value of the 'title' attribute in the OpenAPI document. - public String title; - public String description, classVarName, modelJson, dataType, xmlPrefix, xmlNamespace, xmlName; - public String classFilename; // store the class file name, mainly used for import - public String unescapedDescription; - public CodegenDiscriminator discriminator; - public String defaultValue; - public String arrayModelType; - public boolean isAlias; // Is this effectively an alias of another simple type - public boolean isString, isInteger, isLong, isNumber, isNumeric, isFloat, isDouble, isDate, isDateTime, isDecimal, isShort, isUnboundedInteger, isPrimitiveType, isBoolean; - private boolean additionalPropertiesIsAnyType; - public List vars = new ArrayList<>(); // all properties (without parent's properties) - public List allVars = new ArrayList<>(); // all properties (with parent's properties) - public List requiredVars = new ArrayList<>(); // a list of required properties - public List optionalVars = new ArrayList<>(); // a list of optional properties - public List readOnlyVars = new ArrayList<>(); // a list of read-only properties - public List readWriteVars = new ArrayList<>(); // a list of properties for read, write - public List parentVars = new ArrayList<>(); - public List nonNullableVars = new ArrayList<>(); // a list of non-nullable properties - public Map allowableValues; - - // Sorted sets of required parameters. - public Set mandatory = new TreeSet<>(); // without parent's required properties - public Set allMandatory = new TreeSet<>(); // with parent's required properties - - public Set imports = new TreeSet<>(); - public boolean hasVars, emptyVars, hasMoreModels, hasEnums, isEnum, hasValidation; - /** - * Indicates the OAS schema specifies "nullable: true". - */ - public boolean isNullable; - /** - * Indicates the type has at least one required property. - */ - public boolean hasRequired; - /** - * Indicates the type has at least one optional property. - */ - public boolean hasOptional; - public boolean isArray; - public boolean hasChildren; - public boolean isMap; - public boolean isNull; - /** - * Indicates the OAS schema specifies "deprecated: true". - */ - public boolean isDeprecated; - public boolean hasOnlyReadOnly = true; // true if all properties are read-only - public ExternalDocumentation externalDocumentation; - - public Map vendorExtensions = new HashMap<>(); - private CodegenComposedSchemas composedSchemas; - private boolean hasMultipleTypes = false; - public HashMap testCases = new HashMap<>(); - private boolean schemaIsFromAdditionalProperties; - private boolean isBooleanSchemaTrue; - private boolean isBooleanSchemaFalse; - private String format; - private LinkedHashMap> dependentRequired; - private CodegenProperty contains; - - /** - * The type of the value for the additionalProperties keyword in the OAS document. - * Used in map like objects, including composed schemas. - * - * In most programming languages, the additional (undeclared) properties are stored - * in a map data structure, such as HashMap in Java, map in golang, or a dict in Python. - * There are multiple ways to implement the additionalProperties keyword, depending - * on the programming language and mustache template. - * One way is to use class inheritance. For example in the generated Java code, the - * generated model class may extend from HashMap to store the additional properties. - * In that case 'CodegenModel.parent' is set to represent the class hierarchy. - * Another way is to use CodegenModel.additionalPropertiesType. A code generator - * such as Python does not use class inheritance to model additional properties. - * - * For example, in the OAS schema below, the schema has a declared 'id' property - * and additional, undeclared properties of type 'integer' are allowed. - * - * type: object - * properties: - * id: - * type: integer - * additionalProperties: - * type: integer - * - */ - public String additionalPropertiesType; - - /** - * True if additionalProperties is set to true (boolean value) - */ - public boolean isAdditionalPropertiesTrue; - - private Integer maxProperties; - private Integer minProperties; - private boolean uniqueItems; - private Boolean uniqueItemsBoolean; - private Integer maxItems; - private Integer minItems; - private Integer maxLength; - private Integer minLength; - private boolean exclusiveMinimum; - private boolean exclusiveMaximum; - private String minimum; - private String maximum; - private String pattern; - private Number multipleOf; - private CodegenProperty items; - private CodegenProperty additionalProperties; - private boolean isModel; - private boolean hasRequiredVars; - private boolean hasDiscriminatorWithNonEmptyMapping; - private boolean isAnyType; - private boolean isUuid; - private Map requiredVarsMap; - private String ref; - - public String getAdditionalPropertiesType() { - return additionalPropertiesType; - } - - public void setAdditionalPropertiesType(String additionalPropertiesType) { - this.additionalPropertiesType = additionalPropertiesType; - } - - @Override - public CodegenProperty getContains() { - return contains; - } - - @Override - public void setContains(CodegenProperty contains) { - this.contains = contains; - } - - @Override - public LinkedHashMap> getDependentRequired() { - return dependentRequired; - } - - @Override - public void setDependentRequired(LinkedHashMap> dependentRequired) { - this.dependentRequired = dependentRequired; - } - - @Override - public boolean getIsBooleanSchemaTrue() { - return isBooleanSchemaTrue; - } - - @Override - public void setIsBooleanSchemaTrue(boolean isBooleanSchemaTrue) { - this.isBooleanSchemaTrue = isBooleanSchemaTrue; - } - - @Override - public boolean getIsBooleanSchemaFalse() { - return isBooleanSchemaFalse; - } - - @Override - public void setIsBooleanSchemaFalse(boolean isBooleanSchemaFalse) { - this.isBooleanSchemaFalse = isBooleanSchemaFalse; - } - - @Override - public String getFormat() { - return format; - } - - @Override - public void setFormat(String format) { - this.format = format; - } - - @Override - public String getRef() { - return ref; - } - - @Override - public void setRef(String ref) { - this.ref = ref; - } - - @Override - public boolean getSchemaIsFromAdditionalProperties() { - return schemaIsFromAdditionalProperties; - } - - @Override - public void setSchemaIsFromAdditionalProperties(boolean schemaIsFromAdditionalProperties) { - this.schemaIsFromAdditionalProperties = schemaIsFromAdditionalProperties; - } - - public Set getAllMandatory() { - return allMandatory; - } - - public void setAllMandatory(Set allMandatory) { - this.allMandatory = allMandatory; - } - - public List getAllParents() { - return allParents; - } - - public void setAllParents(List allParents) { - this.allParents = allParents; - } - - public List getAllVars() { - return allVars; - } - - public void setAllVars(List allVars) { - this.allVars = allVars; - } - - public List getNonNullableVars() { - return nonNullableVars; - } - - public void setNonNullableVars(List nonNullableVars) { - this.nonNullableVars = nonNullableVars; - } - - public Map getAllowableValues() { - return allowableValues; - } - - public void setAllowableValues(Map allowableValues) { - this.allowableValues = allowableValues; - } - - public String getArrayModelType() { - return arrayModelType; - } - - public void setArrayModelType(String arrayModelType) { - this.arrayModelType = arrayModelType; - } - - public List getChildren() { - return children; - } - - public void setChildren(List children) { - this.children = children; - } - - public String getClassFilename() { - return classFilename; - } - - public void setClassFilename(String classFilename) { - this.classFilename = classFilename; - } - - public String getClassVarName() { - return classVarName; - } - - public void setClassVarName(String classVarName) { - this.classVarName = classVarName; - } - - /** - * Return true if the classname property is sanitized, false if it is the same as the OpenAPI schema name. - * The OpenAPI schema name may be any valid JSON schema name, including non-ASCII characters. - * The name of the class may have to be sanitized with character escaping. - * - * @return true if the classname property is sanitized - */ - public boolean getIsClassnameSanitized() { - return !StringUtils.equals(classname, name); - } - - public String getClassname() { - return classname; - } - - public void setClassname(String classname) { - this.classname = classname; - } - - public String getDataType() { - return dataType; - } - - public void setDataType(String dataType) { - this.dataType = dataType; - } - - public String getDefaultValue() { - return defaultValue; - } - - public void setDefaultValue(String defaultValue) { - this.defaultValue = defaultValue; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - /** - * Returns the discriminator for this schema object, or null if no discriminator has been specified. - * - * The list of all possible schema discriminator mapping values is obtained - * from explicit discriminator mapping values in the OpenAPI document, and from - * inherited discriminators through oneOf, allOf, anyOf. - * For example, a discriminator may be defined in a 'Pet' schema as shown below. - * The Dog and Cat schemas inherit the discriminator through the allOf reference. - * In the 'Pet' schema, the supported discriminator mapping values for the - * 'objectType' properties are 'Dog' and 'Cat'. - * The allowed discriminator mapping value for the Dog schema is 'Dog'. - * The allowed discriminator mapping value for the Cat schema is 'Dog'. - * - * Pet: - * type: object - * discriminator: - * propertyName: objectType - * required: - * - objectType - * properties: - * objectType: - * type: string - * Dog: - * allOf: - * - $ref: '#/components/schemas/Pet' - * - type: object - * properties: - * p1: - * type: string - * Cat: - * allOf: - * - $ref: '#/components/schemas/Pet' - * - type: object - * properties: - * p2: - * type: string - * - * @return the discriminator. - */ - public CodegenDiscriminator getDiscriminator() { - return discriminator; - } - - public void setDiscriminator(CodegenDiscriminator discriminator) { - this.discriminator = discriminator; - if (discriminator != null && !discriminator.getMappedModels().isEmpty()) { - this.hasDiscriminatorWithNonEmptyMapping = true; - } - } - - /** - * Returns the name of the discriminator property for this schema in the OpenAPI document. - * In the OpenAPI document, the discriminator may be specified in the local schema or - * it may be inherited, such as through a 'allOf' schema which references another schema - * that has a discriminator, recursively. - * - * @return the name of the discriminator property. - */ - public String getDiscriminatorName() { - return discriminator == null ? null : discriminator.getPropertyName(); - } - - public ExternalDocumentation getExternalDocumentation() { - return externalDocumentation; - } - - public void setExternalDocumentation(ExternalDocumentation externalDocumentation) { - this.externalDocumentation = externalDocumentation; - } - - public Set getImports() { - return imports; - } - - public void setImports(Set imports) { - this.imports = imports; - } - - public List getInterfaceModels() { - return interfaceModels; - } - - public void setInterfaceModels(List interfaceModels) { - this.interfaceModels = interfaceModels; - } - - public List getInterfaces() { - return interfaces; - } - - public void setInterfaces(List interfaces) { - this.interfaces = interfaces; - } - - public Set getMandatory() { - return mandatory; - } - - public void setMandatory(Set mandatory) { - this.mandatory = mandatory; - } - - public String getModelJson() { - return modelJson; - } - - public void setModelJson(String modelJson) { - this.modelJson = modelJson; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public List getOptionalVars() { - return optionalVars; - } - - public void setOptionalVars(List optionalVars) { - this.optionalVars = optionalVars; - } - - public String getParent() { - return parent; - } - - public void setParent(String parent) { - this.parent = parent; - } - - public CodegenModel getParentModel() { - return parentModel; - } - - public void setParentModel(CodegenModel parentModel) { - this.parentModel = parentModel; - } - - public String getParentSchema() { - return parentSchema; - } - - public void setParentSchema(String parentSchema) { - this.parentSchema = parentSchema; - } - - public List getParentVars() { - return parentVars; - } - - public void setParentVars(List parentVars) { - this.parentVars = parentVars; - } - - @Override - public String getPattern() { - return pattern; - } - - @Override - public void setPattern(String pattern) { - this.pattern = pattern; - } - - @Override - public String getMaximum() { - return maximum; - } - - @Override - public void setMaximum(String maximum) { - this.maximum = maximum; - } - - @Override - public String getMinimum() { - return minimum; - } - - @Override - public void setMinimum(String minimum) { - this.minimum = minimum; - } - - @Override - public boolean getExclusiveMaximum() { - return exclusiveMaximum; - } - - @Override - public void setExclusiveMaximum(boolean exclusiveMaximum) { - this.exclusiveMaximum = exclusiveMaximum; - } - - @Override - public boolean getExclusiveMinimum() { - return exclusiveMinimum; - } - - @Override - public void setExclusiveMinimum(boolean exclusiveMinimum) { - this.exclusiveMinimum = exclusiveMinimum; - } - - @Override - public Integer getMinLength() { - return minLength; - } - - @Override - public void setMinLength(Integer minLength) { - this.minLength = minLength; - } - - @Override - public Integer getMaxLength() { - return maxLength; - } - - @Override - public void setMaxLength(Integer maxLength) { - this.maxLength = maxLength; - } - - @Override - public Integer getMinItems() { - return minItems; - } - - @Override - public void setMinItems(Integer minItems) { - this.minItems = minItems; - } - - @Override - public Integer getMaxItems() { - return maxItems; - } - - @Override - public void setMaxItems(Integer maxItems) { - this.maxItems = maxItems; - } - - @Override - public boolean getUniqueItems() { - return uniqueItems; - } - - @Override - public void setUniqueItems(boolean uniqueItems) { - this.uniqueItems = uniqueItems; - } - - @Override - public Boolean getUniqueItemsBoolean() { - return uniqueItemsBoolean; - } - - @Override - public void setUniqueItemsBoolean(Boolean uniqueItemsBoolean) { - this.uniqueItemsBoolean = uniqueItemsBoolean; - } - - @Override - public Integer getMinProperties() { - return minProperties; - } - - @Override - public void setMinProperties(Integer minProperties) { - this.minProperties = minProperties; - } - - @Override - public Integer getMaxProperties() { - return maxProperties; - } - - @Override - public void setMaxProperties(Integer maxProperties) { - this.maxProperties = maxProperties; - } - - @Override - public Number getMultipleOf() { - return multipleOf; - } - - @Override - public void setMultipleOf(Number multipleOf) { - this.multipleOf = multipleOf; - } - - @Override - public CodegenProperty getItems() { - return items; - } - - @Override - public void setItems(CodegenProperty items) { - this.items = items; - } - - @Override - public boolean getIsModel() { - return isModel; - } - - @Override - public void setIsModel(boolean isModel) { - this.isModel = isModel; - } - - @Override - public boolean getIsDate() { - return isDate; - } - - @Override - public void setIsDate(boolean isDate) { - this.isDate = isDate; - } - - @Override - public boolean getIsDateTime() { - return isDateTime; - } - - @Override - public void setIsDateTime(boolean isDateTime) { - this.isDateTime = isDateTime; - } - - @Override - public boolean getIsMap() { - return isMap; - } - - @Override - public void setIsMap(boolean isMap) { - this.isMap = isMap; - } - - @Override - public boolean getIsArray() { - return isArray; - } - - @Override - public void setIsArray(boolean isArray) { - this.isArray = isArray; - } - - @Override - public boolean getIsShort() { - return isShort; - } - - @Override - public void setIsShort(boolean isShort) { - this.isShort = isShort; - } - - @Override - public boolean getIsBoolean() { - return isBoolean; - } - - @Override - public void setIsBoolean(boolean isBoolean) { - this.isBoolean = isBoolean; - } - - @Override - public boolean getIsUnboundedInteger() { - return isUnboundedInteger; - } - - @Override - public void setIsUnboundedInteger(boolean isUnboundedInteger) { - this.isUnboundedInteger = isUnboundedInteger; - } - - @Override - public boolean getIsPrimitiveType() { - return isPrimitiveType; - } - - @Override - public void setIsPrimitiveType(boolean isPrimitiveType) { - this.isPrimitiveType = isPrimitiveType; - } - - @Override - public CodegenProperty getAdditionalProperties() { - return additionalProperties; - } - - @Override - public void setAdditionalProperties(CodegenProperty additionalProperties) { - this.additionalProperties = additionalProperties; - } - - @Override - public boolean getHasValidation() { - return hasValidation; - } - - @Override - public void setHasValidation(boolean hasValidation) { - this.hasValidation = hasValidation; - } - - public List getReadOnlyVars() { - return readOnlyVars; - } - - public void setReadOnlyVars(List readOnlyVars) { - this.readOnlyVars = readOnlyVars; - } - - public List getReadWriteVars() { - return readWriteVars; - } - - public void setReadWriteVars(List readWriteVars) { - this.readWriteVars = readWriteVars; - } - - @Override - public List getRequiredVars() { - return requiredVars; - } - - @Override - public void setRequiredVars(List requiredVars) { - this.requiredVars = requiredVars; - } - - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getUnescapedDescription() { - return unescapedDescription; - } - - public void setUnescapedDescription(String unescapedDescription) { - this.unescapedDescription = unescapedDescription; - } - - @Override - public List getVars() { - return vars; - } - - @Override - public void setVars(List vars) { - this.vars = vars; - } - - public Map getVendorExtensions() { - return vendorExtensions; - } - - public void setVendorExtensions(Map vendorExtensions) { - this.vendorExtensions = vendorExtensions; - } - - public String getXmlName() { - return xmlName; - } - - public void setXmlName(String xmlName) { - this.xmlName = xmlName; - } - - public String getXmlNamespace() { - return xmlNamespace; - } - - public void setXmlNamespace(String xmlNamespace) { - this.xmlNamespace = xmlNamespace; - } - - public String getXmlPrefix() { - return xmlPrefix; - } - - public void setXmlPrefix(String xmlPrefix) { - this.xmlPrefix = xmlPrefix; - } - - @Override - public boolean getIsNull() { - return isNull; - } - - @Override - public void setIsNull(boolean isNull) { - this.isNull = isNull; - } - - @Override - public boolean getAdditionalPropertiesIsAnyType() { - return additionalPropertiesIsAnyType; - } - - @Override - public void setAdditionalPropertiesIsAnyType(boolean additionalPropertiesIsAnyType) { - this.additionalPropertiesIsAnyType = additionalPropertiesIsAnyType; - } - - @Override - public boolean getHasVars() { - return this.hasVars; - } - - @Override - public void setHasVars(boolean hasVars) { - this.hasVars = hasVars; - } - - @Override - public boolean getHasRequired() { - return this.hasRequired; - } - - @Override - public void setHasRequired(boolean hasRequired) { - this.hasRequired = hasRequired; - } - - @Override - public boolean getHasDiscriminatorWithNonEmptyMapping() { - return hasDiscriminatorWithNonEmptyMapping; - } - - @Override - public void setHasDiscriminatorWithNonEmptyMapping(boolean hasDiscriminatorWithNonEmptyMapping) { - this.hasDiscriminatorWithNonEmptyMapping = hasDiscriminatorWithNonEmptyMapping; - } - - @Override - public boolean getIsString() { - return isString; - } - - @Override - public void setIsString(boolean isString) { - this.isString = isString; - } - - @Override - public boolean getIsNumber() { - return isNumber; - } - - @Override - public void setIsNumber(boolean isNumber) { - this.isNumber = isNumber; - } - - @Override - public boolean getIsAnyType() { - return isAnyType; - } - - @Override - public void setIsAnyType(boolean isAnyType) { - this.isAnyType = isAnyType; - } - - public boolean getIsUuid() { return isUuid; } - - public void setIsUuid(boolean isUuid) { this.isUuid = isUuid; } - - @Override - public void setComposedSchemas(CodegenComposedSchemas composedSchemas) { - this.composedSchemas = composedSchemas; - } - - @Override - public CodegenComposedSchemas getComposedSchemas() { - return composedSchemas; - } - - @Override - public boolean getHasMultipleTypes() { - return hasMultipleTypes; - } - - @Override - public void setHasMultipleTypes(boolean hasMultipleTypes) { - this.hasMultipleTypes = hasMultipleTypes; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (!(o instanceof CodegenModel)) return false; - CodegenModel that = (CodegenModel) o; - return isAlias == that.isAlias && - isString == that.isString && - isInteger == that.isInteger && - isShort == that.isShort && - isLong == that.isLong && - isUnboundedInteger == that.isUnboundedInteger && - isBoolean == that.isBoolean && - isNumber == that.isNumber && - isNumeric == that.isNumeric && - isFloat == that.isFloat && - isDouble == that.isDouble && - isDate == that.isDate && - isDateTime == that.isDateTime && - hasVars == that.hasVars && - emptyVars == that.emptyVars && - hasMoreModels == that.hasMoreModels && - hasEnums == that.hasEnums && - isEnum == that.isEnum && - isNullable == that.isNullable && - hasRequired == that.hasRequired && - hasOptional == that.hasOptional && - isArray == that.isArray && - hasChildren == that.hasChildren && - isMap == that.isMap && - isDeprecated == that.isDeprecated && - hasOnlyReadOnly == that.hasOnlyReadOnly && - isNull == that.isNull && - hasValidation == that.hasValidation && - isDecimal == that.isDecimal && - hasMultipleTypes == that.getHasMultipleTypes() && - hasDiscriminatorWithNonEmptyMapping == that.getHasDiscriminatorWithNonEmptyMapping() && - isUuid == that.getIsUuid() && - isBooleanSchemaTrue == that.getIsBooleanSchemaTrue() && - isBooleanSchemaFalse == that.getIsBooleanSchemaFalse() && - getSchemaIsFromAdditionalProperties() == that.getSchemaIsFromAdditionalProperties() && - getIsAnyType() == that.getIsAnyType() && - getAdditionalPropertiesIsAnyType() == that.getAdditionalPropertiesIsAnyType() && - getUniqueItems() == that.getUniqueItems() && - getExclusiveMinimum() == that.getExclusiveMinimum() && - getExclusiveMaximum() == that.getExclusiveMaximum() && - Objects.equals(contains, that.getContains()) && - Objects.equals(dependentRequired, that.getDependentRequired()) && - Objects.equals(format, that.getFormat()) && - Objects.equals(uniqueItemsBoolean, that.getUniqueItemsBoolean()) && - Objects.equals(ref, that.getRef()) && - Objects.equals(requiredVarsMap, that.getRequiredVarsMap()) && - Objects.equals(composedSchemas, that.composedSchemas) && - Objects.equals(parent, that.parent) && - Objects.equals(parentSchema, that.parentSchema) && - Objects.equals(interfaces, that.interfaces) && - Objects.equals(allParents, that.allParents) && - Objects.equals(parentModel, that.parentModel) && - Objects.equals(interfaceModels, that.interfaceModels) && - Objects.equals(children, that.children) && - Objects.equals(anyOf, that.anyOf) && - Objects.equals(oneOf, that.oneOf) && - Objects.equals(allOf, that.allOf) && - Objects.equals(name, that.name) && - Objects.equals(classname, that.classname) && - Objects.equals(title, that.title) && - Objects.equals(description, that.description) && - Objects.equals(classVarName, that.classVarName) && - Objects.equals(modelJson, that.modelJson) && - Objects.equals(dataType, that.dataType) && - Objects.equals(xmlPrefix, that.xmlPrefix) && - Objects.equals(xmlNamespace, that.xmlNamespace) && - Objects.equals(xmlName, that.xmlName) && - Objects.equals(classFilename, that.classFilename) && - Objects.equals(unescapedDescription, that.unescapedDescription) && - Objects.equals(discriminator, that.discriminator) && - Objects.equals(defaultValue, that.defaultValue) && - Objects.equals(arrayModelType, that.arrayModelType) && - Objects.equals(vars, that.vars) && - Objects.equals(allVars, that.allVars) && - Objects.equals(nonNullableVars, that.nonNullableVars) && - Objects.equals(requiredVars, that.requiredVars) && - Objects.equals(optionalVars, that.optionalVars) && - Objects.equals(readOnlyVars, that.readOnlyVars) && - Objects.equals(readWriteVars, that.readWriteVars) && - Objects.equals(parentVars, that.parentVars) && - Objects.equals(allowableValues, that.allowableValues) && - Objects.equals(mandatory, that.mandatory) && - Objects.equals(allMandatory, that.allMandatory) && - Objects.equals(imports, that.imports) && - Objects.equals(externalDocumentation, that.externalDocumentation) && - Objects.equals(vendorExtensions, that.vendorExtensions) && - Objects.equals(additionalPropertiesType, that.additionalPropertiesType) && - Objects.equals(getMaxProperties(), that.getMaxProperties()) && - Objects.equals(getMinProperties(), that.getMinProperties()) && - Objects.equals(getMaxItems(), that.getMaxItems()) && - Objects.equals(getMinItems(), that.getMinItems()) && - Objects.equals(getMaxLength(), that.getMaxLength()) && - Objects.equals(getMinLength(), that.getMinLength()) && - Objects.equals(getMinimum(), that.getMinimum()) && - Objects.equals(getMaximum(), that.getMaximum()) && - Objects.equals(getPattern(), that.getPattern()) && - Objects.equals(getItems(), that.getItems()) && - Objects.equals(getAdditionalProperties(), that.getAdditionalProperties()) && - Objects.equals(getIsModel(), that.getIsModel()) && - Objects.equals(getMultipleOf(), that.getMultipleOf()); - } - - @Override - public int hashCode() { - return Objects.hash(getParent(), getParentSchema(), getInterfaces(), getAllParents(), getParentModel(), - getInterfaceModels(), getChildren(), anyOf, oneOf, allOf, getName(), getClassname(), getTitle(), - getDescription(), getClassVarName(), getModelJson(), getDataType(), getXmlPrefix(), getXmlNamespace(), - getXmlName(), getClassFilename(), getUnescapedDescription(), getDiscriminator(), getDefaultValue(), - getArrayModelType(), isAlias, isString, isInteger, isLong, isNumber, isNumeric, isFloat, isDouble, - isDate, isDateTime, isNull, hasValidation, isShort, isUnboundedInteger, isBoolean, - getVars(), getAllVars(), getNonNullableVars(), getRequiredVars(), getOptionalVars(), getReadOnlyVars(), getReadWriteVars(), - getParentVars(), getAllowableValues(), getMandatory(), getAllMandatory(), getImports(), hasVars, - isEmptyVars(), hasMoreModels, hasEnums, isEnum, isNullable, hasRequired, hasOptional, isArray, - hasChildren, isMap, isDeprecated, hasOnlyReadOnly, getExternalDocumentation(), getVendorExtensions(), - getAdditionalPropertiesType(), getMaxProperties(), getMinProperties(), getUniqueItems(), getMaxItems(), - getMinItems(), getMaxLength(), getMinLength(), getExclusiveMinimum(), getExclusiveMaximum(), getMinimum(), - getMaximum(), getPattern(), getMultipleOf(), getItems(), getAdditionalProperties(), getIsModel(), - getAdditionalPropertiesIsAnyType(), hasDiscriminatorWithNonEmptyMapping, - isAnyType, getComposedSchemas(), hasMultipleTypes, isDecimal, isUuid, requiredVarsMap, ref, - uniqueItemsBoolean, schemaIsFromAdditionalProperties, isBooleanSchemaTrue, isBooleanSchemaFalse, - format, dependentRequired, contains); - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder("CodegenModel{"); - sb.append("name='").append(name).append('\''); - sb.append(", parent='").append(parent).append('\''); - sb.append(", parentSchema='").append(parentSchema).append('\''); - sb.append(", interfaces=").append(interfaces); - sb.append(", interfaceModels=").append(interfaceModels !=null ? interfaceModels.size() : "[]"); - sb.append(", allParents=").append(allParents); - sb.append(", parentModel=").append(parentModel); - sb.append(", children=").append(children != null ? children.size() : "[]"); - sb.append(", anyOf=").append(anyOf); - sb.append(", oneOf=").append(oneOf); - sb.append(", allOf=").append(allOf); - sb.append(", classname='").append(classname).append('\''); - sb.append(", title='").append(title).append('\''); - sb.append(", description='").append(description).append('\''); - sb.append(", classVarName='").append(classVarName).append('\''); - sb.append(", modelJson='").append(modelJson).append('\''); - sb.append(", dataType='").append(dataType).append('\''); - sb.append(", xmlPrefix='").append(xmlPrefix).append('\''); - sb.append(", xmlNamespace='").append(xmlNamespace).append('\''); - sb.append(", xmlName='").append(xmlName).append('\''); - sb.append(", classFilename='").append(classFilename).append('\''); - sb.append(", unescapedDescription='").append(unescapedDescription).append('\''); - sb.append(", discriminator=").append(discriminator); - sb.append(", defaultValue='").append(defaultValue).append('\''); - sb.append(", arrayModelType='").append(arrayModelType).append('\''); - sb.append(", isAlias=").append(isAlias); - sb.append(", isString=").append(isString); - sb.append(", isInteger=").append(isInteger); - sb.append(", isShort=").append(isShort); - sb.append(", isLong=").append(isLong); - sb.append(", isUnboundedInteger=").append(isUnboundedInteger); - sb.append(", isBoolean=").append(isBoolean); - sb.append(", isNumber=").append(isNumber); - sb.append(", isNumeric=").append(isNumeric); - sb.append(", isFloat=").append(isFloat); - sb.append(", isDouble=").append(isDouble); - sb.append(", isDate=").append(isDate); - sb.append(", isDateTime=").append(isDateTime); - sb.append(", vars=").append(vars); - sb.append(", allVars=").append(allVars); - sb.append(", nonNullableVars=").append(nonNullableVars); - sb.append(", requiredVars=").append(requiredVars); - sb.append(", optionalVars=").append(optionalVars); - sb.append(", readOnlyVars=").append(readOnlyVars); - sb.append(", readWriteVars=").append(readWriteVars); - sb.append(", parentVars=").append(parentVars); - sb.append(", allowableValues=").append(allowableValues); - sb.append(", mandatory=").append(mandatory); - sb.append(", allMandatory=").append(allMandatory); - sb.append(", imports=").append(imports); - sb.append(", hasVars=").append(hasVars); - sb.append(", emptyVars=").append(emptyVars); - sb.append(", hasMoreModels=").append(hasMoreModels); - sb.append(", hasEnums=").append(hasEnums); - sb.append(", isEnum=").append(isEnum); - sb.append(", isNullable=").append(isNullable); - sb.append(", hasRequired=").append(hasRequired); - sb.append(", hasOptional=").append(hasOptional); - sb.append(", isArray=").append(isArray); - sb.append(", hasChildren=").append(hasChildren); - sb.append(", isMap=").append(isMap); - sb.append(", isDeprecated=").append(isDeprecated); - sb.append(", hasOnlyReadOnly=").append(hasOnlyReadOnly); - sb.append(", externalDocumentation=").append(externalDocumentation); - sb.append(", vendorExtensions=").append(vendorExtensions); - sb.append(", additionalPropertiesType='").append(additionalPropertiesType).append('\''); - sb.append(", maxProperties=").append(maxProperties); - sb.append(", minProperties=").append(minProperties); - sb.append(", uniqueItems=").append(uniqueItems); - sb.append(", uniqueItemsBoolean=").append(uniqueItemsBoolean); - sb.append(", maxItems=").append(maxItems); - sb.append(", minItems=").append(minItems); - sb.append(", maxLength=").append(maxLength); - sb.append(", minLength=").append(minLength); - sb.append(", exclusiveMinimum=").append(exclusiveMinimum); - sb.append(", exclusiveMaximum=").append(exclusiveMaximum); - sb.append(", minimum='").append(minimum).append('\''); - sb.append(", maximum='").append(maximum).append('\''); - sb.append(", pattern='").append(pattern).append('\''); - sb.append(", multipleOf='").append(multipleOf).append('\''); - sb.append(", items='").append(items).append('\''); - sb.append(", additionalProperties='").append(additionalProperties).append('\''); - sb.append(", isModel='").append(isModel).append('\''); - sb.append(", isNull='").append(isNull); - sb.append(", hasValidation='").append(hasValidation); - sb.append(", getAdditionalPropertiesIsAnyType=").append(getAdditionalPropertiesIsAnyType()); - sb.append(", getHasDiscriminatorWithNonEmptyMapping=").append(hasDiscriminatorWithNonEmptyMapping); - sb.append(", getIsAnyType=").append(getIsAnyType()); - sb.append(", composedSchemas=").append(composedSchemas); - sb.append(", hasMultipleTypes=").append(hasMultipleTypes); - sb.append(", isDecimal=").append(isDecimal); - sb.append(", isUUID=").append(isUuid); - sb.append(", requiredVarsMap=").append(requiredVarsMap); - sb.append(", ref=").append(ref); - sb.append(", schemaIsFromAdditionalProperties=").append(schemaIsFromAdditionalProperties); - sb.append(", isBooleanSchemaTrue=").append(isBooleanSchemaTrue); - sb.append(", isBooleanSchemaFalse=").append(isBooleanSchemaFalse); - sb.append(", format=").append(format); - sb.append(", dependentRequired=").append(dependentRequired); - sb.append(", contains=").append(contains); - sb.append('}'); - return sb.toString(); - } - - public void addDiscriminatorMappedModelsImports() { - if (discriminator == null || discriminator.getMappedModels() == null) { - return; - } - for (CodegenDiscriminator.MappedModel mm : discriminator.getMappedModels()) { - if (!"".equals(mm.getModelName())) { - imports.add(mm.getModelName()); - } - } - } - - public boolean isEmptyVars() { - return emptyVars; - } - - public void setEmptyVars(boolean emptyVars) { - this.emptyVars = emptyVars; - } - - public boolean getHasItems() { - return this.items != null; - } - - @Override - public Map getRequiredVarsMap() { return requiredVarsMap; } - - @Override - public void setRequiredVarsMap(Map requiredVarsMap) { this.requiredVarsMap=requiredVarsMap; } - - /** - * Remove duplicated properties in all variable list - */ - public void removeAllDuplicatedProperty() { - // remove duplicated properties - vars = removeDuplicatedProperty(vars); - optionalVars = removeDuplicatedProperty(optionalVars); - requiredVars = removeDuplicatedProperty(requiredVars); - parentVars = removeDuplicatedProperty(parentVars); - allVars = removeDuplicatedProperty(allVars); - nonNullableVars = removeDuplicatedProperty(nonNullableVars); - readOnlyVars = removeDuplicatedProperty(readOnlyVars); - readWriteVars = removeDuplicatedProperty(readWriteVars); - } - - private List removeDuplicatedProperty(List vars) { - // clone the list first - List newList = new ArrayList<>(); - for (CodegenProperty cp : vars) { - newList.add(cp.clone()); - } - - Set propertyNames = new TreeSet<>(); - Set duplicatedNames = new TreeSet<>(); - - ListIterator iterator = newList.listIterator(); - while (iterator.hasNext()) { - CodegenProperty element = iterator.next(); - - if (propertyNames.contains(element.baseName)) { - duplicatedNames.add(element.baseName); - iterator.remove(); - } else { - propertyNames.add(element.baseName); - } - } - - return newList; - } - - /** - * Remove self reference import - */ - public void removeSelfReferenceImport() { - for (CodegenProperty cp : allVars) { - if (cp == null) { - // TODO cp shouldn't be null. Show a warning message instead - } else { - // detect self import - if (this.classname.equalsIgnoreCase(cp.dataType) || - (cp.isContainer && cp.items != null && this.classname.equalsIgnoreCase(cp.items.dataType))) { - this.imports.remove(this.classname); // remove self import - cp.isSelfReference = true; - } - } - } - } -} diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenModelFactory.java b/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenModelFactory.java deleted file mode 100644 index 580cc1e77f1..00000000000 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenModelFactory.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen; - -import java.lang.reflect.InvocationTargetException; - -public final class CodegenModelFactory { - @SuppressWarnings("unchecked") - public static T newInstance(CodegenModelType type) { - try { - return (T) type.getDefaultImplementation().getDeclaredConstructor().newInstance(); - } catch (IllegalAccessException | InstantiationException | NoSuchMethodException | InvocationTargetException e) { - throw new RuntimeException(e); - } - } -} diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenModelType.java b/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenModelType.java deleted file mode 100644 index 6d85bcf2c2e..00000000000 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenModelType.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen; - -public enum CodegenModelType { - - MODEL(CodegenModel.class), - OPERATION(CodegenOperation.class), - PARAMETER(CodegenParameter.class), - PROPERTY(CodegenProperty.class), - RESPONSE(CodegenResponse.class), - SECURITY(CodegenSecurity.class); - - private final Class defaultImplementation; - - private CodegenModelType(Class defaultImplementation) { - this.defaultImplementation = defaultImplementation; - } - - public Class getDefaultImplementation() { - return defaultImplementation; - } -} diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenOperation.java b/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenOperation.java deleted file mode 100644 index 2672a1709a3..00000000000 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenOperation.java +++ /dev/null @@ -1,476 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen; - -import io.swagger.v3.oas.models.ExternalDocumentation; -import io.swagger.v3.oas.models.tags.Tag; - -import java.util.*; - -public class CodegenOperation { - public final List responseHeaders = new ArrayList(); - public boolean hasAuthMethods, hasConsumes, hasProduces, hasParams, hasOptionalParams, hasRequiredParams, - returnTypeIsPrimitive, returnSimpleType, subresourceOperation, isMap, - isArray, isMultipart, - isResponseBinary = false, isResponseFile = false, isResponseOptional = false, hasReference = false, defaultReturnType = false, - isRestfulIndex, isRestfulShow, isRestfulCreate, isRestfulUpdate, isRestfulDestroy, - isRestful, isDeprecated, isCallbackRequest, uniqueItems, hasDefaultResponse = false, - hasErrorResponseObject; // if 4xx, 5xx responses have at least one error object defined - public CodegenProperty returnProperty; - public String path, operationId, returnType, returnFormat, httpMethod, returnBaseType, - returnContainer, summary, unescapedNotes, notes, baseName, defaultResponse; - public CodegenDiscriminator discriminator; - public List> consumes, produces, prioritizedContentTypes; - public List servers = new ArrayList(); - public CodegenParameter bodyParam; - public List allParams = new ArrayList(); - public List bodyParams = new ArrayList(); - public List pathParams = new ArrayList(); - public List queryParams = new ArrayList(); - public List headerParams = new ArrayList(); - public List implicitHeadersParams = new ArrayList(); - public List formParams = new ArrayList(); - public List cookieParams = new ArrayList(); - public List requiredParams = new ArrayList(); - public List optionalParams = new ArrayList(); - public List authMethods; - public List tags; - public List responses = new ArrayList(); - public List callbacks = new ArrayList<>(); - public Set imports = new HashSet(); - public List> examples; - public List> requestBodyExamples; - public ExternalDocumentation externalDocs; - public Map vendorExtensions = new HashMap(); - public String nickname; // legacy support - public String operationIdOriginal; // for plug-in - public String operationIdLowerCase; // for markdown documentation - public String operationIdCamelCase; // for class names - public String operationIdSnakeCase; - - /** - * Check if there's at least one parameter - * - * @return true if parameter exists, false otherwise - */ - private static boolean nonEmpty(List params) { - return params != null && !params.isEmpty(); - } - - private static boolean nonEmpty(Map params) { - return params != null && !params.isEmpty(); - } - - /** - * Check if there's at least one body parameter - * - * @return true if body parameter exists, false otherwise - */ - public boolean getHasBodyParam() { - return nonEmpty(bodyParams); - } - - /** - * Check if there's at least one query parameter - * - * @return true if query parameter exists, false otherwise - */ - public boolean getHasQueryParams() { - return nonEmpty(queryParams); - } - - /** - * Check if there's at least one query parameter or passing API keys in query - * - * @return true if query parameter exists or passing API keys in query, false otherwise - */ - public boolean getHasQueryParamsOrAuth() { - return getHasQueryParams() || (authMethods != null && authMethods.stream().anyMatch(authMethod -> authMethod.isKeyInQuery)); - } - - /** - * Check if there's at least one header parameter - * - * @return true if header parameter exists, false otherwise - */ - public boolean getHasHeaderParams() { - return nonEmpty(headerParams); - } - - /** - * Check if there's at least one path parameter - * - * @return true if path parameter exists, false otherwise - */ - public boolean getHasPathParams() { - return nonEmpty(pathParams); - } - - /** - * Check if there's at least one form parameter - * - * @return true if any form parameter exists, false otherwise - */ - public boolean getHasFormParams() { - return nonEmpty(formParams); - } - - /** - * Check if there's at least one body parameter or at least one form parameter - * - * @return true if body or form parameter exists, false otherwise - */ - public boolean getHasBodyOrFormParams() { - return getHasBodyParam() || getHasFormParams(); - } - - /** - * Check if there's at least one form parameter - * - * @return true if any cookie parameter exists, false otherwise - */ - public boolean getHasCookieParams() { - return nonEmpty(cookieParams); - } - - /** - * Check if there's at least one optional parameter - * - * @return true if any optional parameter exists, false otherwise - */ - public boolean getHasOptionalParams() { - return nonEmpty(optionalParams); - } - - /** - * Check if there's at least one required parameter - * - * @return true if any optional parameter exists, false otherwise - */ - public boolean getHasRequiredParams() { - return nonEmpty(requiredParams); - } - - /** - * Check if there's at least one response header - * - * @return true if header response exists, false otherwise - */ - public boolean getHasResponseHeaders() { - return nonEmpty(responseHeaders); - } - - /** - * Check if there's at least one example parameter - * - * @return true if examples parameter exists, false otherwise - */ - public boolean getHasExamples() { - return nonEmpty(examples); - } - - /** - * Check if there's a default response - * - * @return true if responses contain a default response, false otherwise - */ - public boolean getHasDefaultResponse() { - return responses.stream().anyMatch(response -> response.isDefault); - } - - public boolean getAllResponsesAreErrors() { - return responses.stream().allMatch(response -> response.is4xx || response.is5xx); - } - - /** - * @return contentTypeToOperation - * returns a map where the key is the request body content type and the value is the current CodegenOperation - * this is needed by templates when a different signature is needed for each request body content type - */ - public Map getContentTypeToOperation() { - LinkedHashMap contentTypeToOperation = new LinkedHashMap<>(); - if (bodyParam == null) { - return null; - } - LinkedHashMap content = bodyParam.getContent(); - for (String contentType: content.keySet()) { - contentTypeToOperation.put(contentType, this); - } - return contentTypeToOperation; - } - - /** - * Check if there's at least one vendor extension - * - * @return true if vendor extensions exists, false otherwise - */ - public boolean getHasVendorExtensions() { - return nonEmpty(vendorExtensions); - } - - /** - * Check if act as Restful index method - * - * @return true if act as Restful index method, false otherwise - */ - public boolean isRestfulIndex() { - return "GET".equalsIgnoreCase(httpMethod) && "".equals(pathWithoutBaseName()); - } - - /** - * Check if act as Restful show method - * - * @return true if act as Restful show method, false otherwise - */ - public boolean isRestfulShow() { - return "GET".equalsIgnoreCase(httpMethod) && isMemberPath(); - } - - /** - * Check if act as Restful create method - * - * @return true if act as Restful create method, false otherwise - */ - public boolean isRestfulCreate() { - return "POST".equalsIgnoreCase(httpMethod) && "".equals(pathWithoutBaseName()); - } - - /** - * Check if act as Restful update method - * - * @return true if act as Restful update method, false otherwise - */ - public boolean isRestfulUpdate() { - return Arrays.asList("PUT", "PATCH").contains(httpMethod.toUpperCase(Locale.ROOT)) && isMemberPath(); - } - - /** - * Check if body param is allowed for the request method - * - * @return true request method is PUT, PATCH or POST; false otherwise - */ - public boolean isBodyAllowed() { - return Arrays.asList("PUT", "PATCH", "POST").contains(httpMethod.toUpperCase(Locale.ROOT)); - } - - /** - * Check if act as Restful destroy method - * - * @return true if act as Restful destroy method, false otherwise - */ - public boolean isRestfulDestroy() { - return "DELETE".equalsIgnoreCase(httpMethod) && isMemberPath(); - } - - /** - * Check if Restful-style - * - * @return true if Restful-style, false otherwise - */ - public boolean isRestful() { - return isRestfulIndex() || isRestfulShow() || isRestfulCreate() || isRestfulUpdate() || isRestfulDestroy(); - } - - /** - * Get the substring except baseName from path - * - * @return the substring - */ - private String pathWithoutBaseName() { - return baseName != null ? path.replace("/" + baseName.toLowerCase(Locale.ROOT), "") : path; - } - - /** - * Check if the path match format /xxx/:id - * - * @return true if path act as member - */ - private boolean isMemberPath() { - if (pathParams.size() != 1) return false; - String id = pathParams.get(0).baseName; - return ("/{" + id + "}").equals(pathWithoutBaseName()); - } - - @Override - public String toString() { - final StringBuffer sb = new StringBuffer("CodegenOperation{"); - sb.append("responseHeaders=").append(responseHeaders); - sb.append(", hasAuthMethods=").append(hasAuthMethods); - sb.append(", hasConsumes=").append(hasConsumes); - sb.append(", hasProduces=").append(hasProduces); - sb.append(", hasParams=").append(hasParams); - sb.append(", hasOptionalParams=").append(hasOptionalParams); - sb.append(", hasRequiredParams=").append(hasRequiredParams); - sb.append(", returnTypeIsPrimitive=").append(returnTypeIsPrimitive); - sb.append(", returnSimpleType=").append(returnSimpleType); - sb.append(", subresourceOperation=").append(subresourceOperation); - sb.append(", isMap=").append(isMap); - sb.append(", returnProperty=").append(returnProperty); - sb.append(", isArray=").append(isArray); - sb.append(", isMultipart=").append(isMultipart); - sb.append(", isResponseBinary=").append(isResponseBinary); - sb.append(", isResponseFile=").append(isResponseFile); - sb.append(", isResponseFile=").append(isResponseOptional); - sb.append(", hasReference=").append(hasReference); - sb.append(", hasDefaultResponse=").append(hasDefaultResponse); - sb.append(", hasErrorResponseObject=").append(hasErrorResponseObject); - sb.append(", isRestfulIndex=").append(isRestfulIndex); - sb.append(", isRestfulShow=").append(isRestfulShow); - sb.append(", isRestfulCreate=").append(isRestfulCreate); - sb.append(", isRestfulUpdate=").append(isRestfulUpdate); - sb.append(", isRestfulDestroy=").append(isRestfulDestroy); - sb.append(", isRestful=").append(isRestful); - sb.append(", isDeprecated=").append(isDeprecated); - sb.append(", isCallbackRequest=").append(isCallbackRequest); - sb.append(", uniqueItems='").append(uniqueItems); - sb.append(", path='").append(path).append('\''); - sb.append(", operationId='").append(operationId).append('\''); - sb.append(", returnType='").append(returnType).append('\''); - sb.append(", httpMethod='").append(httpMethod).append('\''); - sb.append(", returnBaseType='").append(returnBaseType).append('\''); - sb.append(", returnContainer='").append(returnContainer).append('\''); - sb.append(", summary='").append(summary).append('\''); - sb.append(", unescapedNotes='").append(unescapedNotes).append('\''); - sb.append(", notes='").append(notes).append('\''); - sb.append(", baseName='").append(baseName).append('\''); - sb.append(", defaultResponse='").append(defaultResponse).append('\''); - sb.append(", discriminator=").append(discriminator); - sb.append(", consumes=").append(consumes); - sb.append(", produces=").append(produces); - sb.append(", prioritizedContentTypes=").append(prioritizedContentTypes); - sb.append(", servers=").append(servers); - sb.append(", bodyParam=").append(bodyParam); - sb.append(", allParams=").append(allParams); - sb.append(", bodyParams=").append(bodyParams); - sb.append(", pathParams=").append(pathParams); - sb.append(", queryParams=").append(queryParams); - sb.append(", headerParams=").append(headerParams); - sb.append(", formParams=").append(formParams); - sb.append(", cookieParams=").append(cookieParams); - sb.append(", requiredParams=").append(requiredParams); - sb.append(", optionalParams=").append(optionalParams); - sb.append(", authMethods=").append(authMethods); - sb.append(", tags=").append(tags); - sb.append(", responses=").append(responses); - sb.append(", callbacks=").append(callbacks); - sb.append(", imports=").append(imports); - sb.append(", examples=").append(examples); - sb.append(", requestBodyExamples=").append(requestBodyExamples); - sb.append(", externalDocs=").append(externalDocs); - sb.append(", vendorExtensions=").append(vendorExtensions); - sb.append(", nickname='").append(nickname).append('\''); - sb.append(", operationIdOriginal='").append(operationIdOriginal).append('\''); - sb.append(", operationIdLowerCase='").append(operationIdLowerCase).append('\''); - sb.append(", operationIdCamelCase='").append(operationIdCamelCase).append('\''); - sb.append(", operationIdSnakeCase='").append(operationIdSnakeCase).append('\''); - sb.append('}'); - return sb.toString(); - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - CodegenOperation that = (CodegenOperation) o; - return hasAuthMethods == that.hasAuthMethods && - hasConsumes == that.hasConsumes && - hasProduces == that.hasProduces && - hasParams == that.hasParams && - hasOptionalParams == that.hasOptionalParams && - hasRequiredParams == that.hasRequiredParams && - returnTypeIsPrimitive == that.returnTypeIsPrimitive && - returnSimpleType == that.returnSimpleType && - subresourceOperation == that.subresourceOperation && - isMap == that.isMap && - isArray == that.isArray && - isMultipart == that.isMultipart && - isResponseBinary == that.isResponseBinary && - isResponseFile == that.isResponseFile && - isResponseOptional == that.isResponseOptional && - hasReference == that.hasReference && - hasDefaultResponse == that.hasDefaultResponse && - hasErrorResponseObject == that.hasErrorResponseObject && - isRestfulIndex == that.isRestfulIndex && - isRestfulShow == that.isRestfulShow && - isRestfulCreate == that.isRestfulCreate && - isRestfulUpdate == that.isRestfulUpdate && - isRestfulDestroy == that.isRestfulDestroy && - isRestful == that.isRestful && - isDeprecated == that.isDeprecated && - isCallbackRequest == that.isCallbackRequest && - uniqueItems == that.uniqueItems && - Objects.equals(returnProperty, that.returnProperty) && - Objects.equals(responseHeaders, that.responseHeaders) && - Objects.equals(path, that.path) && - Objects.equals(operationId, that.operationId) && - Objects.equals(returnType, that.returnType) && - Objects.equals(httpMethod, that.httpMethod) && - Objects.equals(returnBaseType, that.returnBaseType) && - Objects.equals(returnContainer, that.returnContainer) && - Objects.equals(summary, that.summary) && - Objects.equals(unescapedNotes, that.unescapedNotes) && - Objects.equals(notes, that.notes) && - Objects.equals(baseName, that.baseName) && - Objects.equals(defaultResponse, that.defaultResponse) && - Objects.equals(discriminator, that.discriminator) && - Objects.equals(consumes, that.consumes) && - Objects.equals(produces, that.produces) && - Objects.equals(prioritizedContentTypes, that.prioritizedContentTypes) && - Objects.equals(servers, that.servers) && - Objects.equals(bodyParam, that.bodyParam) && - Objects.equals(allParams, that.allParams) && - Objects.equals(bodyParams, that.bodyParams) && - Objects.equals(pathParams, that.pathParams) && - Objects.equals(queryParams, that.queryParams) && - Objects.equals(headerParams, that.headerParams) && - Objects.equals(formParams, that.formParams) && - Objects.equals(cookieParams, that.cookieParams) && - Objects.equals(requiredParams, that.requiredParams) && - Objects.equals(optionalParams, that.optionalParams) && - Objects.equals(authMethods, that.authMethods) && - Objects.equals(tags, that.tags) && - Objects.equals(responses, that.responses) && - Objects.equals(callbacks, that.callbacks) && - Objects.equals(imports, that.imports) && - Objects.equals(examples, that.examples) && - Objects.equals(requestBodyExamples, that.requestBodyExamples) && - Objects.equals(externalDocs, that.externalDocs) && - Objects.equals(vendorExtensions, that.vendorExtensions) && - Objects.equals(nickname, that.nickname) && - Objects.equals(operationIdOriginal, that.operationIdOriginal) && - Objects.equals(operationIdLowerCase, that.operationIdLowerCase) && - Objects.equals(operationIdCamelCase, that.operationIdCamelCase) && - Objects.equals(operationIdSnakeCase, that.operationIdSnakeCase); - } - - @Override - public int hashCode() { - - return Objects.hash(responseHeaders, hasAuthMethods, hasConsumes, hasProduces, hasParams, hasOptionalParams, - hasRequiredParams, returnTypeIsPrimitive, returnSimpleType, subresourceOperation, isMap, - isArray, isMultipart, isResponseBinary, isResponseFile, isResponseOptional, hasReference, - hasDefaultResponse, isRestfulIndex, isRestfulShow, isRestfulCreate, isRestfulUpdate, isRestfulDestroy, - isRestful, isDeprecated, isCallbackRequest, uniqueItems, path, operationId, returnType, httpMethod, - returnBaseType, returnContainer, summary, unescapedNotes, notes, baseName, defaultResponse, - discriminator, consumes, produces, prioritizedContentTypes, servers, bodyParam, allParams, bodyParams, - pathParams, queryParams, headerParams, formParams, cookieParams, requiredParams, returnProperty, optionalParams, - authMethods, tags, responses, callbacks, imports, examples, requestBodyExamples, externalDocs, - vendorExtensions, nickname, operationIdOriginal, operationIdLowerCase, operationIdCamelCase, - operationIdSnakeCase, hasErrorResponseObject); - } -} diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenParameter.java b/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenParameter.java deleted file mode 100644 index ca8ac29eb31..00000000000 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenParameter.java +++ /dev/null @@ -1,925 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen; - -import java.util.*; - -/** - * Describes a single operation parameter in the OAS specification. - * A unique parameter is defined by a combination of a name and location. - * Parameters may be located in a path, query, header or cookie. - */ -public class CodegenParameter implements IJsonSchemaValidationProperties { - public boolean isFormParam, isQueryParam, isPathParam, isHeaderParam, - isCookieParam, isBodyParam, isContainer, - isCollectionFormatMulti, isPrimitiveType, isModel, isExplode, isDeepObject, isAllowEmptyValue; - public String baseName, paramName, dataType, datatypeWithEnum, dataFormat, contentType, - collectionFormat, description, unescapedDescription, baseType, defaultValue, enumDefaultValue, enumName, style; - - public String nameInLowerCase; // property name in lower case - public String example; // example value (x-example) - public String jsonSchema; - public boolean isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isDecimal, isByteArray, isBinary, - isBoolean, isDate, isDateTime, isUuid, isUri, isEmail, isFreeFormObject, isAnyType, isShort, isUnboundedInteger; - public boolean isArray, isMap; - public boolean isFile; - public boolean isEnum; - private boolean additionalPropertiesIsAnyType; - private boolean hasVars; - public List _enum; - public Map allowableValues; - public CodegenProperty items; - public CodegenProperty additionalProperties; - public List vars = new ArrayList(); // all properties (without parent's properties) - public List requiredVars = new ArrayList(); - public CodegenProperty mostInnerItems; - public Map vendorExtensions = new HashMap(); - public boolean hasValidation; - public boolean isNullable; - public boolean isDeprecated; - private CodegenProperty schema; - /** - * Determines whether this parameter is mandatory. If the parameter is in "path", - * this property is required and its value MUST be true. Otherwise, the property - * MAY be included and its default value is false. - */ - public boolean required; - /** - * See http://json-schema.org/latest/json-schema-validation.html#anchor17. - */ - public String maximum; - /** - * See http://json-schema.org/latest/json-schema-validation.html#anchor17 - */ - public boolean exclusiveMaximum; - /** - * See http://json-schema.org/latest/json-schema-validation.html#anchor21 - */ - public String minimum; - /** - * See http://json-schema.org/latest/json-schema-validation.html#anchor21 - */ - public boolean exclusiveMinimum; - /** - * See http://json-schema.org/latest/json-schema-validation.html#anchor26 - */ - public Integer maxLength; - /** - * See http://json-schema.org/latest/json-schema-validation.html#anchor29 - */ - public Integer minLength; - /** - * See http://json-schema.org/latest/json-schema-validation.html#anchor33 - */ - public String pattern; - /** - * See http://json-schema.org/latest/json-schema-validation.html#anchor42 - */ - public Integer maxItems; - /** - * See http://json-schema.org/latest/json-schema-validation.html#anchor45 - */ - public Integer minItems; - /** - * See http://json-schema.org/latest/json-schema-validation.html#anchor49 - */ - public boolean uniqueItems; - private Boolean uniqueItemsBoolean; - /** - * See http://json-schema.org/latest/json-schema-validation.html#anchor14 - */ - public Number multipleOf; - private Integer maxProperties; - private Integer minProperties; - public boolean isNull; - private boolean hasRequired; - private boolean hasDiscriminatorWithNonEmptyMapping; - private CodegenComposedSchemas composedSchemas; - private boolean hasMultipleTypes = false; - private LinkedHashMap content; - private Map requiredVarsMap; - private String ref; - - private boolean schemaIsFromAdditionalProperties; - - public CodegenParameter copy() { - CodegenParameter output = new CodegenParameter(); - output.isFile = this.isFile; - output.isContainer = this.isContainer; - output.baseName = this.baseName; - output.paramName = this.paramName; - output.dataType = this.dataType; - output.datatypeWithEnum = this.datatypeWithEnum; - output.enumName = this.enumName; - output.dataFormat = this.dataFormat; - output.collectionFormat = this.collectionFormat; - output.isCollectionFormatMulti = this.isCollectionFormatMulti; - output.isPrimitiveType = this.isPrimitiveType; - output.isModel = this.isModel; - output.description = this.description; - output.unescapedDescription = this.unescapedDescription; - output.baseType = this.baseType; - output.isFormParam = this.isFormParam; - output.isQueryParam = this.isQueryParam; - output.isPathParam = this.isPathParam; - output.isHeaderParam = this.isHeaderParam; - output.isCookieParam = this.isCookieParam; - output.isBodyParam = this.isBodyParam; - output.required = this.required; - output.maximum = this.maximum; - output.exclusiveMaximum = this.exclusiveMaximum; - output.minimum = this.minimum; - output.exclusiveMinimum = this.exclusiveMinimum; - output.maxLength = this.maxLength; - output.minLength = this.minLength; - output.pattern = this.pattern; - output.maxItems = this.maxItems; - output.minItems = this.minItems; - output.uniqueItems = this.uniqueItems; - output.setUniqueItemsBoolean(this.uniqueItemsBoolean); - output.multipleOf = this.multipleOf; - output.jsonSchema = this.jsonSchema; - output.defaultValue = this.defaultValue; - output.enumDefaultValue = this.enumDefaultValue; - output.example = this.example; - output.isEnum = this.isEnum; - output.maxProperties = this.maxProperties; - output.minProperties = this.minProperties; - output.maximum = this.maximum; - output.minimum = this.minimum; - output.pattern = this.pattern; - output.additionalProperties = this.additionalProperties; - output.isNull = this.isNull; - output.setAdditionalPropertiesIsAnyType(this.getAdditionalPropertiesIsAnyType()); - output.setHasVars(this.hasVars); - output.setHasRequired(this.hasRequired); - output.setHasDiscriminatorWithNonEmptyMapping(this.hasDiscriminatorWithNonEmptyMapping); - output.setHasMultipleTypes(this.hasMultipleTypes); - output.setSchemaIsFromAdditionalProperties(this.schemaIsFromAdditionalProperties); - - if (this.content != null) { - output.setContent(this.content); - } - if (this.schema != null) { - output.setSchema(this.schema); - } - if (this.composedSchemas != null) { - output.setComposedSchemas(this.getComposedSchemas()); - } - if (this._enum != null) { - output._enum = new ArrayList(this._enum); - } - if (this.allowableValues != null) { - output.allowableValues = new HashMap(this.allowableValues); - } - if (this.items != null) { - output.items = this.items; - } - if (this.vars != null) { - output.vars = this.vars; - } - if (this.requiredVars != null) { - output.requiredVars = this.requiredVars; - } - if (this.mostInnerItems != null) { - output.mostInnerItems = this.mostInnerItems; - } - if (this.vendorExtensions != null) { - output.vendorExtensions = new HashMap(this.vendorExtensions); - } - if (this.requiredVarsMap != null) { - output.setRequiredVarsMap(this.requiredVarsMap); - } - if (this.ref != null) { - output.setRef(this.ref); - } - output.hasValidation = this.hasValidation; - output.isNullable = this.isNullable; - output.isDeprecated = this.isDeprecated; - output.isBinary = this.isBinary; - output.isByteArray = this.isByteArray; - output.isString = this.isString; - output.isNumeric = this.isNumeric; - output.isInteger = this.isInteger; - output.isShort = this.isShort; - output.isLong = this.isLong; - output.isUnboundedInteger = this.isUnboundedInteger; - output.isDouble = this.isDouble; - output.isDecimal = this.isDecimal; - output.isFloat = this.isFloat; - output.isNumber = this.isNumber; - output.isBoolean = this.isBoolean; - output.isDate = this.isDate; - output.isDateTime = this.isDateTime; - output.isUuid = this.isUuid; - output.isUri = this.isUri; - output.isEmail = this.isEmail; - output.isFreeFormObject = this.isFreeFormObject; - output.isAnyType = this.isAnyType; - output.isArray = this.isArray; - output.isMap = this.isMap; - output.isExplode = this.isExplode; - output.style = this.style; - output.isDeepObject = this.isDeepObject; - output.isAllowEmptyValue = this.isAllowEmptyValue; - output.contentType = this.contentType; - - return output; - } - - @Override - public int hashCode() { - return Objects.hash(isFormParam, isQueryParam, isPathParam, isHeaderParam, isCookieParam, isBodyParam, isContainer, isCollectionFormatMulti, isPrimitiveType, isModel, isExplode, baseName, paramName, dataType, datatypeWithEnum, dataFormat, collectionFormat, description, unescapedDescription, baseType, defaultValue, enumDefaultValue, enumName, style, isDeepObject, isAllowEmptyValue, example, jsonSchema, isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isDecimal, isByteArray, isBinary, isBoolean, isDate, isDateTime, isUuid, isUri, isEmail, isFreeFormObject, isAnyType, isArray, isMap, isFile, isEnum, _enum, allowableValues, items, mostInnerItems, additionalProperties, vars, requiredVars, vendorExtensions, hasValidation, getMaxProperties(), getMinProperties(), isNullable, isDeprecated, required, getMaximum(), getExclusiveMaximum(), getMinimum(), getExclusiveMinimum(), getMaxLength(), getMinLength(), getPattern(), getMaxItems(), getMinItems(), getUniqueItems(), contentType, multipleOf, isNull, additionalPropertiesIsAnyType, hasVars, hasRequired, isShort, isUnboundedInteger, hasDiscriminatorWithNonEmptyMapping, composedSchemas, hasMultipleTypes, schema, content, requiredVarsMap, ref, uniqueItemsBoolean, schemaIsFromAdditionalProperties); - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (!(o instanceof CodegenParameter)) return false; - CodegenParameter that = (CodegenParameter) o; - return isFormParam == that.isFormParam && - isQueryParam == that.isQueryParam && - isPathParam == that.isPathParam && - isHeaderParam == that.isHeaderParam && - isCookieParam == that.isCookieParam && - isBodyParam == that.isBodyParam && - isContainer == that.isContainer && - isCollectionFormatMulti == that.isCollectionFormatMulti && - isPrimitiveType == that.isPrimitiveType && - isModel == that.isModel && - isExplode == that.isExplode && - isString == that.isString && - isNumeric == that.isNumeric && - isInteger == that.isInteger && - isShort == that.isShort && - isLong == that.isLong && - isUnboundedInteger == that.isUnboundedInteger && - isNumber == that.isNumber && - isFloat == that.isFloat && - isDouble == that.isDouble && - isDecimal == that.isDecimal && - isByteArray == that.isByteArray && - isBinary == that.isBinary && - isBoolean == that.isBoolean && - isDate == that.isDate && - isDateTime == that.isDateTime && - isUuid == that.isUuid && - isUri == that.isUri && - isEmail == that.isEmail && - isFreeFormObject == that.isFreeFormObject && - isAnyType == that.isAnyType && - isArray == that.isArray && - isMap == that.isMap && - isFile == that.isFile && - isEnum == that.isEnum && - hasValidation == that.hasValidation && - isNullable == that.isNullable && - isDeprecated == that.isDeprecated && - required == that.required && - isNull == that.isNull && - hasDiscriminatorWithNonEmptyMapping == that.getHasDiscriminatorWithNonEmptyMapping() && - getAdditionalPropertiesIsAnyType() == that.getAdditionalPropertiesIsAnyType() && - hasMultipleTypes == that.getHasMultipleTypes() && - getSchemaIsFromAdditionalProperties() == that.getSchemaIsFromAdditionalProperties() && - getHasVars() == that.getHasVars() && - getHasRequired() == that.getHasRequired() && - getExclusiveMaximum() == that.getExclusiveMaximum() && - getExclusiveMinimum() == that.getExclusiveMinimum() && - getUniqueItems() == that.getUniqueItems() && - Objects.equals(uniqueItemsBoolean, that.getUniqueItemsBoolean()) && - Objects.equals(ref, that.getRef()) && - Objects.equals(requiredVarsMap, that.getRequiredVarsMap()) && - Objects.equals(content, that.getContent()) && - Objects.equals(schema, that.getSchema()) && - Objects.equals(composedSchemas, that.getComposedSchemas()) && - Objects.equals(baseName, that.baseName) && - Objects.equals(paramName, that.paramName) && - Objects.equals(dataType, that.dataType) && - Objects.equals(datatypeWithEnum, that.datatypeWithEnum) && - Objects.equals(dataFormat, that.dataFormat) && - Objects.equals(collectionFormat, that.collectionFormat) && - Objects.equals(description, that.description) && - Objects.equals(unescapedDescription, that.unescapedDescription) && - Objects.equals(baseType, that.baseType) && - Objects.equals(defaultValue, that.defaultValue) && - Objects.equals(enumDefaultValue, that.enumDefaultValue) && - Objects.equals(enumName, that.enumName) && - Objects.equals(style, that.style) && - Objects.equals(isDeepObject, that.isDeepObject) && - Objects.equals(isAllowEmptyValue, that.isAllowEmptyValue) && - Objects.equals(example, that.example) && - Objects.equals(jsonSchema, that.jsonSchema) && - Objects.equals(_enum, that._enum) && - Objects.equals(allowableValues, that.allowableValues) && - Objects.equals(items, that.items) && - Objects.equals(additionalProperties, that.additionalProperties) && - Objects.equals(vars, that.vars) && - Objects.equals(requiredVars, that.requiredVars) && - Objects.equals(mostInnerItems, that.mostInnerItems) && - Objects.equals(vendorExtensions, that.vendorExtensions) && - Objects.equals(getMaxProperties(), that.getMaxProperties()) && - Objects.equals(getMinProperties(), that.getMinProperties()) && - Objects.equals(getMaximum(), that.getMaximum()) && - Objects.equals(getMinimum(), that.getMinimum()) && - Objects.equals(getMaxLength(), that.getMaxLength()) && - Objects.equals(getMinLength(), that.getMinLength()) && - Objects.equals(getPattern(), that.getPattern()) && - Objects.equals(getMaxItems(), that.getMaxItems()) && - Objects.equals(getMinItems(), that.getMinItems()) && - Objects.equals(contentType, that.contentType) && - Objects.equals(multipleOf, that.multipleOf); - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder("CodegenParameter{"); - sb.append("isFormParam=").append(isFormParam); - sb.append(", isQueryParam=").append(isQueryParam); - sb.append(", isPathParam=").append(isPathParam); - sb.append(", isHeaderParam=").append(isHeaderParam); - sb.append(", isCookieParam=").append(isCookieParam); - sb.append(", isBodyParam=").append(isBodyParam); - sb.append(", isContainer=").append(isContainer); - sb.append(", isCollectionFormatMulti=").append(isCollectionFormatMulti); - sb.append(", isPrimitiveType=").append(isPrimitiveType); - sb.append(", isModel=").append(isModel); - sb.append(", isExplode=").append(isExplode); - sb.append(", baseName='").append(baseName).append('\''); - sb.append(", paramName='").append(paramName).append('\''); - sb.append(", dataType='").append(dataType).append('\''); - sb.append(", datatypeWithEnum='").append(datatypeWithEnum).append('\''); - sb.append(", dataFormat='").append(dataFormat).append('\''); - sb.append(", collectionFormat='").append(collectionFormat).append('\''); - sb.append(", description='").append(description).append('\''); - sb.append(", unescapedDescription='").append(unescapedDescription).append('\''); - sb.append(", baseType='").append(baseType).append('\''); - sb.append(", defaultValue='").append(defaultValue).append('\''); - sb.append(", enumDefaultValue='").append(enumDefaultValue).append('\''); - sb.append(", enumName='").append(enumName).append('\''); - sb.append(", style='").append(style).append('\''); - sb.append(", deepObject='").append(isDeepObject).append('\''); - sb.append(", allowEmptyValue='").append(isAllowEmptyValue).append('\''); - sb.append(", example='").append(example).append('\''); - sb.append(", jsonSchema='").append(jsonSchema).append('\''); - sb.append(", isString=").append(isString); - sb.append(", isNumeric=").append(isNumeric); - sb.append(", isInteger=").append(isInteger); - sb.append(", isShort=").append(isShort); - sb.append(", isLong=").append(isLong); - sb.append(", isUnboundedInteger=").append(isUnboundedInteger); - sb.append(", isNumber=").append(isNumber); - sb.append(", isFloat=").append(isFloat); - sb.append(", isDouble=").append(isDouble); - sb.append(", isDecimal=").append(isDecimal); - sb.append(", isByteArray=").append(isByteArray); - sb.append(", isBinary=").append(isBinary); - sb.append(", isBoolean=").append(isBoolean); - sb.append(", isDate=").append(isDate); - sb.append(", isDateTime=").append(isDateTime); - sb.append(", isUuid=").append(isUuid); - sb.append(", isUri=").append(isUri); - sb.append(", isEmail=").append(isEmail); - sb.append(", isFreeFormObject=").append(isFreeFormObject); - sb.append(", isAnyType=").append(isAnyType); - sb.append(", isArray=").append(isArray); - sb.append(", isMap=").append(isMap); - sb.append(", isFile=").append(isFile); - sb.append(", isEnum=").append(isEnum); - sb.append(", _enum=").append(_enum); - sb.append(", allowableValues=").append(allowableValues); - sb.append(", items=").append(items); - sb.append(", mostInnerItems=").append(mostInnerItems); - sb.append(", additionalProperties=").append(additionalProperties); - sb.append(", vars=").append(vars); - sb.append(", requiredVars=").append(requiredVars); - sb.append(", vendorExtensions=").append(vendorExtensions); - sb.append(", hasValidation=").append(hasValidation); - sb.append(", maxProperties=").append(maxProperties); - sb.append(", minProperties=").append(minProperties); - sb.append(", isNullable=").append(isNullable); - sb.append(", isDeprecated=").append(isDeprecated); - sb.append(", required=").append(required); - sb.append(", maximum='").append(maximum).append('\''); - sb.append(", exclusiveMaximum=").append(exclusiveMaximum); - sb.append(", minimum='").append(minimum).append('\''); - sb.append(", exclusiveMinimum=").append(exclusiveMinimum); - sb.append(", maxLength=").append(maxLength); - sb.append(", minLength=").append(minLength); - sb.append(", pattern='").append(pattern).append('\''); - sb.append(", maxItems=").append(maxItems); - sb.append(", minItems=").append(minItems); - sb.append(", uniqueItems=").append(uniqueItems); - sb.append(", uniqueItemsBoolean=").append(uniqueItemsBoolean); - sb.append(", contentType=").append(contentType); - sb.append(", multipleOf=").append(multipleOf); - sb.append(", isNull=").append(isNull); - sb.append(", getAdditionalPropertiesIsAnyType=").append(additionalPropertiesIsAnyType); - sb.append(", getHasVars=").append(hasVars); - sb.append(", getHasRequired=").append(hasRequired); - sb.append(", getHasDiscriminatorWithNonEmptyMapping=").append(hasDiscriminatorWithNonEmptyMapping); - sb.append(", composedSchemas=").append(composedSchemas); - sb.append(", hasMultipleTypes=").append(hasMultipleTypes); - sb.append(", schema=").append(schema); - sb.append(", content=").append(content); - sb.append(", requiredVarsMap=").append(requiredVarsMap); - sb.append(", ref=").append(ref); - sb.append(", schemaIsFromAdditionalProperties=").append(schemaIsFromAdditionalProperties); - sb.append('}'); - return sb.toString(); - } - - // use schema.getContains or content.mediaType.schema.getContains instead of this - @Override - public CodegenProperty getContains() { - return null; - } - - // use schema.setContains or content.mediaType.schema.setContains instead of this - @Override - public void setContains(CodegenProperty contains) {} - - // use schema.getDependentRequired or content.mediaType.schema.getDependentRequired instead of this - @Override - public LinkedHashMap> getDependentRequired() { - return null; - } - - // use schema.setDependentRequired or content.mediaType.schema.setDependentRequired instead of this - @Override - public void setDependentRequired(LinkedHashMap> dependentRequired) {} - - // use schema.getIsBooleanSchemaTrue or content.mediaType.schema.getIsBooleanSchemaTrue instead of this - @Override - public boolean getIsBooleanSchemaTrue() { - return false; - } - - // use schema.setIsBooleanSchemaTrue or content.mediaType.schema.setIsBooleanSchemaTrue instead of this - @Override - public void setIsBooleanSchemaTrue(boolean isBooleanSchemaTrue) {} - - // use schema.getIsBooleanSchemaFalse or content.mediaType.schema.getIsBooleanSchemaFalse instead of this - @Override - public boolean getIsBooleanSchemaFalse() { - return false; - } - - // use schema.setIsBooleanSchemaFalse or content.mediaType.schema.setIsBooleanSchemaFalse instead of this - @Override - public void setIsBooleanSchemaFalse(boolean isBooleanSchemaFalse) {} - - // use schema.getFormat or content.mediaType.schema.getFormat instead of this - @Override - public String getFormat() { - return null; - } - - // use schema.setFormat or content.mediaType.schema.setFormat instead of this - @Override - public void setFormat(String format) {} - - @Override - public String getPattern() { - return pattern; - } - - @Override - public void setPattern(String pattern) { - this.pattern = pattern; - } - - @Override - public String getMaximum() { - return maximum; - } - - @Override - public void setMaximum(String maximum) { - this.maximum = maximum; - } - - @Override - public String getMinimum() { - return minimum; - } - - @Override - public void setMinimum(String minimum) { - this.minimum = minimum; - } - - @Override - public boolean getExclusiveMaximum() { - return exclusiveMaximum; - } - - @Override - public void setExclusiveMaximum(boolean exclusiveMaximum) { - this.exclusiveMaximum = exclusiveMaximum; - } - - @Override - public boolean getExclusiveMinimum() { - return exclusiveMinimum; - } - - @Override - public void setExclusiveMinimum(boolean exclusiveMinimum) { - this.exclusiveMinimum = exclusiveMinimum; - } - - @Override - public Integer getMinLength() { - return minLength; - } - - @Override - public void setMinLength(Integer minLength) { - this.minLength = minLength; - } - - @Override - public Integer getMaxLength() { - return maxLength; - } - - @Override - public void setMaxLength(Integer maxLength) { - this.maxLength = maxLength; - } - - @Override - public Integer getMinItems() { - return minItems; - } - - @Override - public void setMinItems(Integer minItems) { - this.minItems = minItems; - } - - @Override - public Integer getMaxItems() { - return maxItems; - } - - @Override - public void setMaxItems(Integer maxItems) { - this.maxItems = maxItems; - } - - @Override - public boolean getUniqueItems() { - return uniqueItems; - } - - @Override - public void setUniqueItems(boolean uniqueItems) { - this.uniqueItems = uniqueItems; - } - - @Override - public Boolean getUniqueItemsBoolean() { - return uniqueItemsBoolean; - } - - @Override - public void setUniqueItemsBoolean(Boolean uniqueItemsBoolean) { - this.uniqueItemsBoolean = uniqueItemsBoolean; - } - - @Override - public Integer getMinProperties() { - return minProperties; - } - - @Override - public void setMinProperties(Integer minProperties) { - this.minProperties = minProperties; - } - - @Override - public Integer getMaxProperties() { - return maxProperties; - } - - @Override - public void setMaxProperties(Integer maxProperties) { - this.maxProperties = maxProperties; - } - - @Override - public Number getMultipleOf() { - return multipleOf; - } - - @Override - public void setMultipleOf(Number multipleOf) { - this.multipleOf = multipleOf; - } - - @Override - public CodegenProperty getItems() { - return items; - } - - @Override - public void setItems(CodegenProperty items) { - this.items = items; - } - - @Override - public boolean getIsModel() { - return isModel; - } - - @Override - public void setIsModel(boolean isModel) { - this.isModel = isModel; - } - - @Override - public boolean getIsDate() { - return isDate; - } - - @Override - public void setIsDate(boolean isDate) { - this.isDate = isDate; - } - - @Override - public boolean getIsDateTime() { - return isDateTime; - } - - @Override - public void setIsDateTime(boolean isDateTime) { - this.isDateTime = isDateTime; - } - - @Override - public boolean getIsMap() { - return isMap; - } - - @Override - public void setIsMap(boolean isMap) { - this.isMap = isMap; - } - - @Override - public boolean getIsArray() { - return isArray; - } - - @Override - public void setIsArray(boolean isArray) { - this.isArray = isArray; - } - - @Override - public boolean getIsShort() { - return isShort; - } - - @Override - public void setIsShort(boolean isShort) { - this.isShort = isShort; - } - - @Override - public boolean getIsBoolean() { - return isBoolean; - } - - @Override - public void setIsBoolean(boolean isBoolean) { - this.isBoolean = isBoolean; - } - - @Override - public boolean getIsUnboundedInteger() { - return isUnboundedInteger; - } - - @Override - public void setIsUnboundedInteger(boolean isUnboundedInteger) { - this.isUnboundedInteger = isUnboundedInteger; - } - - @Override - public boolean getIsPrimitiveType() { - return isPrimitiveType; - } - - @Override - public void setIsPrimitiveType(boolean isPrimitiveType) { - this.isPrimitiveType = isPrimitiveType; - } - - @Override - public CodegenProperty getAdditionalProperties() { - return additionalProperties; - } - - @Override - public void setAdditionalProperties(CodegenProperty additionalProperties) { - this.additionalProperties = additionalProperties; - } - - @Override - public List getVars() { - return vars; - } - - @Override - public void setVars(List vars) { - this.vars = vars; - } - - @Override - public List getRequiredVars() { - return requiredVars; - } - - @Override - public void setRequiredVars(List requiredVars) { - this.requiredVars = requiredVars; - } - - public boolean compulsory(){ - return required && !isNullable; - } - - @Override - public boolean getIsNull() { - return isNull; - } - - @Override - public void setIsNull(boolean isNull) { - this.isNull = isNull; - } - - @Override - public boolean getHasValidation() { - return hasValidation; - } - - @Override - public void setHasValidation(boolean hasValidation) { - this.hasValidation = hasValidation; - } - - @Override - public boolean getAdditionalPropertiesIsAnyType() { - return additionalPropertiesIsAnyType; - } - - @Override - public void setAdditionalPropertiesIsAnyType(boolean additionalPropertiesIsAnyType) { - this.additionalPropertiesIsAnyType = additionalPropertiesIsAnyType; - } - - @Override - public boolean getHasVars() { - return this.hasVars; - } - - @Override - public void setHasVars(boolean hasVars) { - this.hasVars = hasVars; - } - - @Override - public boolean getHasRequired() { - return this.hasRequired; - } - - @Override - public void setHasRequired(boolean hasRequired) { - this.hasRequired = hasRequired; - } - - @Override - public boolean getHasDiscriminatorWithNonEmptyMapping() { - return hasDiscriminatorWithNonEmptyMapping; - } - - ; - - @Override - public void setHasDiscriminatorWithNonEmptyMapping(boolean hasDiscriminatorWithNonEmptyMapping) { - this.hasDiscriminatorWithNonEmptyMapping = hasDiscriminatorWithNonEmptyMapping; - } - - @Override - public boolean getIsString() { - return isString; - } - - @Override - public void setIsString(boolean isString) { - this.isString = isString; - } - - @Override - public boolean getIsNumber() { - return isNumber; - } - - @Override - public void setIsNumber(boolean isNumber) { - this.isNumber = isNumber; - } - - @Override - public boolean getIsAnyType() { - return isAnyType; - } - - @Override - public void setIsAnyType(boolean isAnyType) { - this.isAnyType = isAnyType; - } - - @Override - public void setComposedSchemas(CodegenComposedSchemas composedSchemas) { - this.composedSchemas = composedSchemas; - } - - @Override - public CodegenComposedSchemas getComposedSchemas() { - return composedSchemas; - } - - @Override - public boolean getHasMultipleTypes() { - return hasMultipleTypes; - } - - @Override - public void setHasMultipleTypes(boolean hasMultipleTypes) { - this.hasMultipleTypes = hasMultipleTypes; - } - - public CodegenProperty getSchema() { - return schema; - } - - public void setSchema(CodegenProperty schema) { - this.schema = schema; - } - - public LinkedHashMap getContent() { - return content; - } - - public void setContent(LinkedHashMap content) { - this.content = content; - } - - @Override - public String getBaseType() { - return baseType; - } - - @Override - public Map getRequiredVarsMap() { return requiredVarsMap; } - - @Override - public void setRequiredVarsMap(Map requiredVarsMap) { this.requiredVarsMap=requiredVarsMap; } - - @Override - public String getRef() { return ref; } - - @Override - public void setRef(String ref) { this.ref=ref; } - - @Override - public boolean getSchemaIsFromAdditionalProperties() { - return schemaIsFromAdditionalProperties; - } - - @Override - public void setSchemaIsFromAdditionalProperties(boolean schemaIsFromAdditionalProperties) { - this.schemaIsFromAdditionalProperties = schemaIsFromAdditionalProperties; - } -} - diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenProperty.java b/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenProperty.java deleted file mode 100644 index e5fe46954bf..00000000000 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenProperty.java +++ /dev/null @@ -1,1218 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen; - -import java.util.*; - -public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperties { - /** - * The value of the 'type' attribute in the OpenAPI schema. - * The per-language codegen logic may change to a language-specific type. - */ - public String openApiType; - public String baseName; - public String complexType; - public String getter; - public String setter; - /** - * The value of the 'description' attribute in the OpenAPI schema. - */ - public String description; - /** - * The language-specific data type for this property. For example, the OpenAPI type 'integer' - * may be represented as 'int', 'int32', 'Integer', etc, depending on the programming language. - */ - public String dataType; - public String datatypeWithEnum; - public String dataFormat; - /** - * The name of this property in the OpenAPI schema. - */ - public String name; - public String min; // TODO: is this really used? - public String max; // TODO: is this really used? - public String defaultValue; - public String defaultValueWithParam; - public String baseType; - public String containerType; - /** - * The value of the 'title' attribute in the OpenAPI schema. - */ - public String title; - - /** - * The 'description' string without escape characters needed by some programming languages/targets - */ - public String unescapedDescription; - - /** - * maxLength validation for strings, see http://json-schema.org/latest/json-schema-validation.html#rfc.section.5.2.1 - */ - public Integer maxLength; - /** - * minLength validation for strings, see http://json-schema.org/latest/json-schema-validation.html#rfc.section.5.2.2 - */ - public Integer minLength; - /** - * pattern validation for strings, see http://json-schema.org/latest/json-schema-validation.html#rfc.section.5.2.3 - */ - public String pattern; - /** - * A free-form property to include an example of an instance for this schema. - */ - public String example; - - public String jsonSchema; - /** - * The value of the 'minimum' attribute in the OpenAPI schema. - * The value of "minimum" MUST be a number, representing an inclusive lower limit for a numeric instance. - */ - public String minimum; - /** - * The value of the 'maximum' attribute in the OpenAPI schema. - * The value of "maximum" MUST be a number, representing an inclusive upper limit for a numeric instance. - */ - public String maximum; - /** - * The value of the 'multipleOf' attribute in the OpenAPI schema. - * The value of "multipleOf" MUST be a number, strictly greater than 0. - */ - public Number multipleOf; - /** - * The value of the 'exclusiveMinimum' attribute in the OpenAPI schema. - * The value of "exclusiveMinimum" MUST be number, representing an exclusive lower limit for a numeric instance. - */ - public boolean exclusiveMinimum; - /** - * The value of the 'exclusiveMaximum' attribute in the OpenAPI schema. - * The value of "exclusiveMaximum" MUST be number, representing an exclusive upper limit for a numeric instance. - */ - public boolean exclusiveMaximum; - public boolean required; - public boolean deprecated; - public boolean hasMoreNonReadOnly; // for model constructor, true if next property is not readonly - public boolean isPrimitiveType; - public boolean isModel; - /** - * True if this property is an array of items or a map container. - * See: - * - ModelUtils.isArraySchema() - * - ModelUtils.isMapSchema() - */ - public boolean isContainer; - public boolean isString; - public boolean isNumeric; - public boolean isInteger; - public boolean isShort; - public boolean isLong; - public boolean isUnboundedInteger; - public boolean isNumber; - public boolean isFloat; - public boolean isDouble; - public boolean isDecimal; - public boolean isByteArray; - public boolean isBinary; - public boolean isFile; - public boolean isBoolean; - public boolean isDate; // full-date notation as defined by RFC 3339, section 5.6, for example, 2017-07-21 - public boolean isDateTime; // the date-time notation as defined by RFC 3339, section 5.6, for example, 2017-07-21T17:32:28Z - public boolean isUuid; - public boolean isUri; - public boolean isEmail; - public boolean isNull; - /** - * The type is a free-form object, i.e. it is a map of string to values with no declared properties. - * A OAS free-form schema may include the 'additionalProperties' attribute, which puts a constraint - * on the type of the undeclared properties. - */ - public boolean isFreeFormObject; - /** - * The 'type' in the OAS schema is unspecified (i.e. not set). The value can be number, integer, string, object or array. - * If the nullable attribute is set to true, the 'null' value is valid. - */ - public boolean isAnyType; - public boolean isArray; - public boolean isMap; - public boolean isEnum; - public boolean isInnerEnum; // Enums declared inline will be located inside the generic model, changing how the enum is referenced in some cases. - public boolean isReadOnly; - public boolean isWriteOnly; - public boolean isNullable; - public boolean isSelfReference; - public boolean isCircularReference; - public boolean isDiscriminator; - public List _enum; - public Map allowableValues; - // If 'additionalProperties' is not set, items is null. - // If 'additionalProperties' is set to a type or refers to a type, 'items' provides the type information for - // the undeclared properties. - public CodegenProperty items; - public CodegenProperty additionalProperties; - public List vars = new ArrayList(); // all properties (without parent's properties) - public List requiredVars = new ArrayList<>(); - public CodegenProperty mostInnerItems; - public Map vendorExtensions = new HashMap(); - public boolean hasValidation; // true if pattern, maximum, etc are set (only used in the mustache template) - public boolean isInherited; - public String discriminatorValue; - public String nameInLowerCase; // property name in lower case - public String nameInCamelCase; // property name in camel case - public String nameInSnakeCase; // property name in upper snake case - // enum name based on the property name, usually use as a prefix (e.g. VAR_NAME) for enum name (e.g. VAR_NAME_VALUE1) - public String enumName; - public Integer maxItems; - public Integer minItems; - - private Integer maxProperties; - private Integer minProperties; - private boolean uniqueItems; - private Boolean uniqueItemsBoolean; - - // XML - public boolean isXmlAttribute = false; - public String xmlPrefix; - public String xmlName; - public String xmlNamespace; - public boolean isXmlWrapped = false; - private boolean additionalPropertiesIsAnyType; - private boolean hasVars; - private boolean hasRequired; - private boolean hasDiscriminatorWithNonEmptyMapping; - private CodegenComposedSchemas composedSchemas = null; - private boolean hasMultipleTypes = false; - private Map requiredVarsMap; - private String ref; - private boolean schemaIsFromAdditionalProperties; - private boolean isBooleanSchemaTrue; - private boolean isBooleanSchemaFalse; - private String format; - private LinkedHashMap> dependentRequired; - private CodegenProperty contains; - - @Override - public CodegenProperty getContains() { - return contains; - } - - @Override - public void setContains(CodegenProperty contains) { - this.contains = contains; - } - - @Override - public LinkedHashMap> getDependentRequired() { - return dependentRequired; - } - - @Override - public void setDependentRequired(LinkedHashMap> dependentRequired) { - this.dependentRequired = dependentRequired; - } - - @Override - public void setFormat(String format) { this.format = format; } - - @Override - public String getFormat() { return format; } - - @Override - public boolean getIsBooleanSchemaTrue() { - return isBooleanSchemaTrue; - } - - @Override - public void setIsBooleanSchemaTrue(boolean isBooleanSchemaTrue) { - this.isBooleanSchemaTrue = true; - } - - @Override - public boolean getIsBooleanSchemaFalse() { - return isBooleanSchemaFalse; - } - - @Override - public void setIsBooleanSchemaFalse(boolean isBooleanSchemaFalse) { - this.isBooleanSchemaFalse = isBooleanSchemaFalse; - } - - public String getBaseName() { - return baseName; - } - - public void setBaseName(String baseName) { - this.baseName = baseName; - } - - public String getComplexType() { - return complexType; - } - - public void setComplexType(String complexType) { - this.complexType = complexType; - } - - public String getGetter() { - return getter; - } - - public void setGetter(String getter) { - this.getter = getter; - } - - public String getSetter() { - return setter; - } - - public void setSetter(String setter) { - this.setter = setter; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - /** - * @return dataType - * @deprecated since version 3.0.0, use {@link #getDataType()} instead.
    - * May be removed with the next major release (4.0) - */ - @Deprecated - public String getDatatype() { - return getDataType(); - } - - public String getDataType() { - return dataType; - } - - public void setDatatype(String datatype) { - this.dataType = datatype; - } - - public String getDatatypeWithEnum() { - return datatypeWithEnum; - } - - public void setDatatypeWithEnum(String datatypeWithEnum) { - this.datatypeWithEnum = datatypeWithEnum; - } - - public String getDataFormat() { - return dataFormat; - } - - public void setDataFormat(String dataFormat) { - this.dataFormat = dataFormat; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getMin() { - return min; - } - - public void setMin(String min) { - this.min = min; - } - - public String getMax() { - return max; - } - - public void setMax(String max) { - this.max = max; - } - - public String getDefaultValue() { - return defaultValue; - } - - public void setDefaultValue(String defaultValue) { - this.defaultValue = defaultValue; - } - - public String getDefaultValueWithParam() { - return defaultValueWithParam; - } - - public void setDefaultValueWithParam(String defaultValueWithParam) { - this.defaultValueWithParam = defaultValueWithParam; - } - - public String getBaseType() { - return baseType; - } - - public void setBaseType(String baseType) { - this.baseType = baseType; - } - - public String getContainerType() { - return containerType; - } - - public void setContainerType(String containerType) { - this.containerType = containerType; - } - - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getUnescapedDescription() { - return unescapedDescription; - } - - public void setUnescapedDescription(String unescapedDescription) { - this.unescapedDescription = unescapedDescription; - } - - @Override - public boolean getSchemaIsFromAdditionalProperties() { - return schemaIsFromAdditionalProperties; - } - - @Override - public void setSchemaIsFromAdditionalProperties(boolean schemaIsFromAdditionalProperties) { - this.schemaIsFromAdditionalProperties = schemaIsFromAdditionalProperties; - } - - @Override - public Integer getMaxLength() { - return maxLength; - } - - @Override - public void setMaxLength(Integer maxLength) { - this.maxLength = maxLength; - } - - @Override - public Integer getMinLength() { - return minLength; - } - - @Override - public void setMinLength(Integer minLength) { - this.minLength = minLength; - } - - @Override - public String getPattern() { - return pattern; - } - - @Override - public void setPattern(String pattern) { - this.pattern = pattern; - } - - public String getExample() { - return example; - } - - public void setExample(String example) { - this.example = example; - } - - public String getJsonSchema() { - return jsonSchema; - } - - public void setJsonSchema(String jsonSchema) { - this.jsonSchema = jsonSchema; - } - - @Override - public String getMinimum() { - return minimum; - } - - @Override - public void setMinimum(String minimum) { - this.minimum = minimum; - } - - @Override - public boolean getExclusiveMaximum() { - return this.exclusiveMaximum; - } - - @Override - public String getMaximum() { - return maximum; - } - - @Override - public void setMaximum(String maximum) { - this.maximum = maximum; - } - - @Override - public boolean getExclusiveMinimum() { - return exclusiveMinimum; - } - - @Override - public void setExclusiveMinimum(boolean exclusiveMinimum) { - this.exclusiveMinimum = exclusiveMinimum; - } - - public boolean getIExclusiveMaximum() { - return exclusiveMaximum; - } - - @Override - public void setExclusiveMaximum(boolean exclusiveMaximum) { - this.exclusiveMaximum = exclusiveMaximum; - } - - public boolean getRequired() { - return required; - } - - public boolean compulsory(){ - return getRequired() && !isNullable; - } - - public void setRequired(boolean required) { - this.required = required; - } - - public List get_enum() { - return _enum; - } - - public void set_enum(List _enum) { - this._enum = _enum; - } - - public Map getAllowableValues() { - return allowableValues; - } - - public void setAllowableValues(Map allowableValues) { - this.allowableValues = allowableValues; - } - - @Override - public CodegenProperty getItems() { - return items; - } - - @Override - public void setItems(CodegenProperty items) { - this.items = items; - } - - @Override - public CodegenProperty getAdditionalProperties() { - return additionalProperties; - } - - @Override - public void setAdditionalProperties(CodegenProperty additionalProperties) { - this.additionalProperties = additionalProperties; - } - - @Override - public boolean getIsModel() { - return isModel; - } - - @Override - public void setIsModel(boolean isModel) { - this.isModel = isModel; - } - - @Override - public boolean getIsDate() { - return isDate; - } - - @Override - public void setIsDate(boolean isDate) { - this.isDate = isDate; - } - - @Override - public boolean getIsDateTime() { - return isDateTime; - } - - @Override - public void setIsDateTime(boolean isDateTime) { - this.isDateTime = isDateTime; - } - - @Override - public boolean getIsMap() { - return isMap; - } - - @Override - public void setIsMap(boolean isMap) { - this.isMap = isMap; - } - - @Override - public boolean getIsArray() { - return isArray; - } - - @Override - public void setIsArray(boolean isArray) { - this.isArray = isArray; - } - - @Override - public boolean getIsShort() { - return isShort; - } - - @Override - public void setIsShort(boolean isShort) { - this.isShort = isShort; - } - - @Override - public boolean getIsBoolean() { - return isBoolean; - } - - @Override - public void setIsBoolean(boolean isBoolean) { - this.isBoolean = isBoolean; - } - - @Override - public boolean getIsUnboundedInteger() { - return isUnboundedInteger; - } - - @Override - public void setIsUnboundedInteger(boolean isUnboundedInteger) { - this.isUnboundedInteger = isUnboundedInteger; - } - - @Override - public boolean getIsPrimitiveType() { - return isPrimitiveType; - } - - @Override - public void setIsPrimitiveType(boolean isPrimitiveType) { - this.isPrimitiveType = isPrimitiveType; - } - - public Map getVendorExtensions() { - return vendorExtensions; - } - - public void setVendorExtensions(Map vendorExtensions) { - this.vendorExtensions = vendorExtensions; - } - - public String getNameInLowerCase() { - return nameInLowerCase; - } - - public void setNameInLowerCase(String nameInLowerCase) { - this.nameInLowerCase = nameInLowerCase; - } - - public String getNameInCamelCase() { - return nameInCamelCase; - } - - public void setNameInCamelCase(String nameInCamelCase) { - this.nameInCamelCase = nameInCamelCase; - } - - public String getNameInSnakeCase() { - return nameInSnakeCase; - } - - public String getEnumName() { - return enumName; - } - - public void setEnumName(String enumName) { - this.enumName = enumName; - } - - @Override - public Integer getMaxItems() { - return maxItems; - } - - @Override - public void setMaxItems(Integer maxItems) { - this.maxItems = maxItems; - } - - @Override - public Integer getMinItems() { - return minItems; - } - - @Override - public void setMinItems(Integer minItems) { - this.minItems = minItems; - } - - public String getXmlPrefix() { - return xmlPrefix; - } - - public void setXmlPrefix(String xmlPrefix) { - this.xmlPrefix = xmlPrefix; - } - - public String getXmlName() { - return xmlName; - } - - public void setXmlName(String xmlName) { - this.xmlName = xmlName; - } - - public String getXmlNamespace() { - return xmlNamespace; - } - - public void setXmlNamespace(String xmlNamespace) { - this.xmlNamespace = xmlNamespace; - } - - @Override - public void setComposedSchemas(CodegenComposedSchemas composedSchemas) { - this.composedSchemas = composedSchemas; - } - - @Override - public CodegenComposedSchemas getComposedSchemas() { - return composedSchemas; - } - - @Override - public void setRef(String ref) { - this.ref = ref; - } - - @Override - public String getRef() { - return ref; - } - - @Override - public CodegenProperty clone() { - try { - CodegenProperty cp = (CodegenProperty) super.clone(); - if (this._enum != null) { - cp._enum = new ArrayList(this._enum); - } - if (this.allowableValues != null) { - cp.allowableValues = new HashMap(this.allowableValues); - } - if (this.items != null) { - cp.items = this.items; - } - if (this.additionalProperties != null) { - cp.additionalProperties = this.additionalProperties; - } - if (this.vars != null) { - cp.vars = this.vars; - } - if (this.requiredVars != null) { - cp.requiredVars = this.requiredVars; - } - if (this.mostInnerItems != null) { - cp.mostInnerItems = this.mostInnerItems; - } - if (this.vendorExtensions != null) { - cp.vendorExtensions = new HashMap(this.vendorExtensions); - } - if (this.composedSchemas != null) { - cp.composedSchemas = this.composedSchemas; - } - if (this.requiredVarsMap != null) { - cp.setRequiredVarsMap(this.requiredVarsMap); - } - if (this.ref != null) { - cp.setRef(this.ref); - } - if (this.format != null) { - cp.setFormat(this.format); - } - if (this.dependentRequired != null) { - cp.setDependentRequired(this.dependentRequired); - } - if (this.contains != null) { - cp.setContains(this.contains); - } - - return cp; - } catch (CloneNotSupportedException e) { - throw new IllegalStateException(e); - } - } - - @Override - public boolean getUniqueItems() { - return uniqueItems; - } - - @Override - public void setUniqueItems(boolean uniqueItems) { - this.uniqueItems = uniqueItems; - } - - @Override - public Boolean getUniqueItemsBoolean() { - return uniqueItemsBoolean; - } - - @Override - public void setUniqueItemsBoolean(Boolean uniqueItemsBoolean) { - this.uniqueItemsBoolean = uniqueItemsBoolean; - } - - @Override - public Integer getMinProperties() { - return minProperties; - } - - @Override - public void setMinProperties(Integer minProperties) { - this.minProperties = minProperties; - } - - @Override - public Integer getMaxProperties() { - return maxProperties; - } - - @Override - public void setMaxProperties(Integer maxProperties) { - this.maxProperties = maxProperties; - } - - @Override - public Number getMultipleOf() { - return multipleOf; - } - - @Override - public void setMultipleOf(Number multipleOf) { - this.multipleOf = multipleOf; - } - - @Override - public List getVars() { - return vars; - } - - @Override - public void setVars(List vars) { - this.vars = vars; - } - - @Override - public List getRequiredVars() { - return requiredVars; - } - - @Override - public void setRequiredVars(List requiredVars) { - this.requiredVars = requiredVars; - } - - @Override - public boolean getIsNull() { - return isNull; - } - - @Override - public void setIsNull(boolean isNull) { - this.isNull = isNull; - } - - @Override - public boolean getHasValidation() { - return hasValidation; - } - - @Override - public void setHasValidation(boolean hasValidation) { - this.hasValidation = hasValidation; - } - - @Override - public boolean getAdditionalPropertiesIsAnyType() { - return additionalPropertiesIsAnyType; - } - - @Override - public void setAdditionalPropertiesIsAnyType(boolean additionalPropertiesIsAnyType) { - this.additionalPropertiesIsAnyType = additionalPropertiesIsAnyType; - } - - @Override - public boolean getHasVars() { - return this.hasVars; - } - - @Override - public void setHasVars(boolean hasVars) { - this.hasVars = hasVars; - } - - @Override - public boolean getHasRequired() { - return this.hasRequired; - } - - @Override - public void setHasRequired(boolean hasRequired) { - this.hasRequired = hasRequired; - } - - @Override - public boolean getHasDiscriminatorWithNonEmptyMapping() { - return hasDiscriminatorWithNonEmptyMapping; - } - - ; - - @Override - public void setHasDiscriminatorWithNonEmptyMapping(boolean hasDiscriminatorWithNonEmptyMapping) { - this.hasDiscriminatorWithNonEmptyMapping = hasDiscriminatorWithNonEmptyMapping; - } - - public boolean getHasItems() { - return this.items != null; - } - - @Override - public boolean getIsString() { - return isString; - } - - @Override - public void setIsString(boolean isString) { - this.isString = isString; - } - - @Override - public boolean getIsNumber() { - return isNumber; - } - - @Override - public void setIsNumber(boolean isNumber) { - this.isNumber = isNumber; - } - - @Override - public boolean getIsAnyType() { - return isAnyType; - } - - @Override - public void setIsAnyType(boolean isAnyType) { - this.isAnyType = isAnyType; - } - - @Override - public boolean getHasMultipleTypes() { - return hasMultipleTypes; - } - - @Override - public void setHasMultipleTypes(boolean hasMultipleTypes) { - this.hasMultipleTypes = hasMultipleTypes; - } - - public boolean getIsUuid() { return isUuid; } - - public void setIsUuid(boolean isUuid) { this.isUuid = isUuid; } - - @Override - public Map getRequiredVarsMap() { return requiredVarsMap; } - - @Override - public void setRequiredVarsMap(Map requiredVarsMap) { this.requiredVarsMap=requiredVarsMap; } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder("CodegenProperty{"); - sb.append("openApiType='").append(openApiType).append('\''); - sb.append(", baseName='").append(baseName).append('\''); - sb.append(", complexType='").append(complexType).append('\''); - sb.append(", getter='").append(getter).append('\''); - sb.append(", setter='").append(setter).append('\''); - sb.append(", description='").append(description).append('\''); - sb.append(", dataType='").append(dataType).append('\''); - sb.append(", datatypeWithEnum='").append(datatypeWithEnum).append('\''); - sb.append(", dataFormat='").append(dataFormat).append('\''); - sb.append(", name='").append(name).append('\''); - sb.append(", min='").append(min).append('\''); - sb.append(", max='").append(max).append('\''); - sb.append(", defaultValue='").append(defaultValue).append('\''); - sb.append(", defaultValueWithParam='").append(defaultValueWithParam).append('\''); - sb.append(", baseType='").append(baseType).append('\''); - sb.append(", containerType='").append(containerType).append('\''); - sb.append(", title='").append(title).append('\''); - sb.append(", unescapedDescription='").append(unescapedDescription).append('\''); - sb.append(", maxLength=").append(maxLength); - sb.append(", minLength=").append(minLength); - sb.append(", pattern='").append(pattern).append('\''); - sb.append(", example='").append(example).append('\''); - sb.append(", jsonSchema='").append(jsonSchema).append('\''); - sb.append(", minimum='").append(minimum).append('\''); - sb.append(", maximum='").append(maximum).append('\''); - sb.append(", exclusiveMinimum=").append(exclusiveMinimum); - sb.append(", exclusiveMaximum=").append(exclusiveMaximum); - sb.append(", required=").append(required); - sb.append(", deprecated=").append(deprecated); - sb.append(", hasMoreNonReadOnly=").append(hasMoreNonReadOnly); - sb.append(", isPrimitiveType=").append(isPrimitiveType); - sb.append(", isModel=").append(isModel); - sb.append(", isContainer=").append(isContainer); - sb.append(", isString=").append(isString); - sb.append(", isNumeric=").append(isNumeric); - sb.append(", isInteger=").append(isInteger); - sb.append(", isShort=").append(isShort); - sb.append(", isLong=").append(isLong); - sb.append(", isUnboundedInteger=").append(isUnboundedInteger); - sb.append(", isNumber=").append(isNumber); - sb.append(", isFloat=").append(isFloat); - sb.append(", isDouble=").append(isDouble); - sb.append(", isDecimal=").append(isDecimal); - sb.append(", isByteArray=").append(isByteArray); - sb.append(", isBinary=").append(isBinary); - sb.append(", isFile=").append(isFile); - sb.append(", isBoolean=").append(isBoolean); - sb.append(", isDate=").append(isDate); - sb.append(", isDateTime=").append(isDateTime); - sb.append(", isUuid=").append(isUuid); - sb.append(", isUri=").append(isUri); - sb.append(", isEmail=").append(isEmail); - sb.append(", isFreeFormObject=").append(isFreeFormObject); - sb.append(", isArray=").append(isArray); - sb.append(", isMap=").append(isMap); - sb.append(", isEnum=").append(isEnum); - sb.append(", isInnerEnum=").append(isInnerEnum); - sb.append(", isAnyType=").append(isAnyType); - sb.append(", isReadOnly=").append(isReadOnly); - sb.append(", isWriteOnly=").append(isWriteOnly); - sb.append(", isNullable=").append(isNullable); - sb.append(", isSelfReference=").append(isSelfReference); - sb.append(", isCircularReference=").append(isCircularReference); - sb.append(", isDiscriminator=").append(isDiscriminator); - sb.append(", _enum=").append(_enum); - sb.append(", allowableValues=").append(allowableValues); - sb.append(", items=").append(items); - sb.append(", additionalProperties=").append(additionalProperties); - sb.append(", vars=").append(vars); - sb.append(", requiredVars=").append(requiredVars); - sb.append(", mostInnerItems=").append(mostInnerItems); - sb.append(", vendorExtensions=").append(vendorExtensions); - sb.append(", hasValidation=").append(hasValidation); - sb.append(", isInherited=").append(isInherited); - sb.append(", discriminatorValue='").append(discriminatorValue).append('\''); - sb.append(", nameInCamelCase='").append(nameInCamelCase).append('\''); - sb.append(", nameInSnakeCase='").append(nameInSnakeCase).append('\''); - sb.append(", enumName='").append(enumName).append('\''); - sb.append(", maxItems=").append(maxItems); - sb.append(", minItems=").append(minItems); - sb.append(", maxProperties=").append(maxProperties); - sb.append(", minProperties=").append(minProperties); - sb.append(", uniqueItems=").append(uniqueItems); - sb.append(", uniqueItemsBoolean=").append(uniqueItemsBoolean); - sb.append(", multipleOf=").append(multipleOf); - sb.append(", isXmlAttribute=").append(isXmlAttribute); - sb.append(", xmlPrefix='").append(xmlPrefix).append('\''); - sb.append(", xmlName='").append(xmlName).append('\''); - sb.append(", xmlNamespace='").append(xmlNamespace).append('\''); - sb.append(", isXmlWrapped=").append(isXmlWrapped); - sb.append(", isNull=").append(isNull); - sb.append(", getAdditionalPropertiesIsAnyType=").append(getAdditionalPropertiesIsAnyType()); - sb.append(", getHasVars=").append(getHasVars()); - sb.append(", getHasRequired=").append(getHasRequired()); - sb.append(", getHasDiscriminatorWithNonEmptyMapping=").append(hasDiscriminatorWithNonEmptyMapping); - sb.append(", composedSchemas=").append(composedSchemas); - sb.append(", hasMultipleTypes=").append(hasMultipleTypes); - sb.append(", requiredVarsMap=").append(requiredVarsMap); - sb.append(", ref=").append(ref); - sb.append(", schemaIsFromAdditionalProperties=").append(schemaIsFromAdditionalProperties); - sb.append(", isBooleanSchemaTrue=").append(isBooleanSchemaTrue); - sb.append(", isBooleanSchemaFalse=").append(isBooleanSchemaFalse); - sb.append(", format=").append(format); - sb.append(", dependentRequired=").append(dependentRequired); - sb.append(", contains=").append(contains); - sb.append('}'); - return sb.toString(); - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - CodegenProperty that = (CodegenProperty) o; - return exclusiveMinimum == that.exclusiveMinimum && - exclusiveMaximum == that.exclusiveMaximum && - required == that.required && - deprecated == that.deprecated && - hasMoreNonReadOnly == that.hasMoreNonReadOnly && - isPrimitiveType == that.isPrimitiveType && - isModel == that.isModel && - isContainer == that.isContainer && - isString == that.isString && - isNumeric == that.isNumeric && - isInteger == that.isInteger && - isShort == that.isShort && - isLong == that.isLong && - isUnboundedInteger == that.isUnboundedInteger && - isNumber == that.isNumber && - isFloat == that.isFloat && - isDouble == that.isDouble && - isDecimal == that.isDecimal && - isByteArray == that.isByteArray && - isBinary == that.isBinary && - isFile == that.isFile && - isBoolean == that.isBoolean && - isDate == that.isDate && - isDateTime == that.isDateTime && - isUuid == that.isUuid && - isUri == that.isUri && - isEmail == that.isEmail && - isFreeFormObject == that.isFreeFormObject && - isArray == that.isArray && - isMap == that.isMap && - isEnum == that.isEnum && - isInnerEnum == that.isInnerEnum && - isAnyType == that.isAnyType && - isReadOnly == that.isReadOnly && - isWriteOnly == that.isWriteOnly && - isNullable == that.isNullable && - isSelfReference == that.isSelfReference && - isCircularReference == that.isCircularReference && - isDiscriminator == that.isDiscriminator && - hasValidation == that.hasValidation && - isInherited == that.isInherited && - isXmlAttribute == that.isXmlAttribute && - isXmlWrapped == that.isXmlWrapped && - isNull == that.isNull && - hasMultipleTypes == that.getHasMultipleTypes() && - hasDiscriminatorWithNonEmptyMapping == that.hasDiscriminatorWithNonEmptyMapping && - isBooleanSchemaTrue == that.getIsBooleanSchemaTrue() && - isBooleanSchemaFalse == that.getIsBooleanSchemaFalse() && - getSchemaIsFromAdditionalProperties() == that.getSchemaIsFromAdditionalProperties() && - getAdditionalPropertiesIsAnyType() == that.getAdditionalPropertiesIsAnyType() && - getHasVars() == that.getHasVars() && - getHasRequired() == that.getHasRequired() && - Objects.equals(contains, that.getContains()) && - Objects.equals(dependentRequired, that.getDependentRequired()) && - Objects.equals(format, that.getFormat()) && - Objects.equals(uniqueItemsBoolean, that.getUniqueItemsBoolean()) && - Objects.equals(ref, that.getRef()) && - Objects.equals(requiredVarsMap, that.getRequiredVarsMap()) && - Objects.equals(composedSchemas, that.composedSchemas) && - Objects.equals(openApiType, that.openApiType) && - Objects.equals(baseName, that.baseName) && - Objects.equals(complexType, that.complexType) && - Objects.equals(getter, that.getter) && - Objects.equals(setter, that.setter) && - Objects.equals(description, that.description) && - Objects.equals(dataType, that.dataType) && - Objects.equals(datatypeWithEnum, that.datatypeWithEnum) && - Objects.equals(dataFormat, that.dataFormat) && - Objects.equals(name, that.name) && - Objects.equals(min, that.min) && - Objects.equals(max, that.max) && - Objects.equals(defaultValue, that.defaultValue) && - Objects.equals(defaultValueWithParam, that.defaultValueWithParam) && - Objects.equals(baseType, that.baseType) && - Objects.equals(containerType, that.containerType) && - Objects.equals(title, that.title) && - Objects.equals(unescapedDescription, that.unescapedDescription) && - Objects.equals(maxLength, that.maxLength) && - Objects.equals(minLength, that.minLength) && - Objects.equals(pattern, that.pattern) && - Objects.equals(example, that.example) && - Objects.equals(jsonSchema, that.jsonSchema) && - Objects.equals(minimum, that.minimum) && - Objects.equals(maximum, that.maximum) && - Objects.equals(_enum, that._enum) && - Objects.equals(allowableValues, that.allowableValues) && - Objects.equals(items, that.items) && - Objects.equals(additionalProperties, that.additionalProperties) && - Objects.equals(vars, that.vars) && - Objects.equals(requiredVars, that.requiredVars) && - Objects.equals(mostInnerItems, that.mostInnerItems) && - Objects.equals(vendorExtensions, that.vendorExtensions) && - Objects.equals(discriminatorValue, that.discriminatorValue) && - Objects.equals(nameInCamelCase, that.nameInCamelCase) && - Objects.equals(nameInSnakeCase, that.nameInSnakeCase) && - Objects.equals(enumName, that.enumName) && - Objects.equals(maxItems, that.maxItems) && - Objects.equals(minItems, that.minItems) && - Objects.equals(xmlPrefix, that.xmlPrefix) && - Objects.equals(xmlName, that.xmlName) && - Objects.equals(xmlNamespace, that.xmlNamespace) && - Objects.equals(multipleOf, that.multipleOf); - } - - @Override - public int hashCode() { - - return Objects.hash(openApiType, baseName, complexType, getter, setter, description, - dataType, datatypeWithEnum, dataFormat, name, min, max, defaultValue, - defaultValueWithParam, baseType, containerType, title, unescapedDescription, - maxLength, minLength, pattern, example, jsonSchema, minimum, maximum, - exclusiveMinimum, exclusiveMaximum, required, deprecated, - hasMoreNonReadOnly, isPrimitiveType, isModel, isContainer, isString, isNumeric, - isInteger, isLong, isNumber, isFloat, isDouble, isDecimal, isByteArray, isBinary, isFile, - isBoolean, isDate, isDateTime, isUuid, isUri, isEmail, isFreeFormObject, - isArray, isMap, isEnum, isInnerEnum, isAnyType, isReadOnly, isWriteOnly, isNullable, isShort, - isUnboundedInteger, isSelfReference, isCircularReference, isDiscriminator, _enum, - allowableValues, items, mostInnerItems, additionalProperties, vars, requiredVars, - vendorExtensions, hasValidation, isInherited, discriminatorValue, nameInCamelCase, - nameInSnakeCase, enumName, maxItems, minItems, isXmlAttribute, xmlPrefix, xmlName, - xmlNamespace, isXmlWrapped, isNull, additionalPropertiesIsAnyType, hasVars, hasRequired, - hasDiscriminatorWithNonEmptyMapping, composedSchemas, hasMultipleTypes, requiredVarsMap, - ref, uniqueItemsBoolean, schemaIsFromAdditionalProperties, isBooleanSchemaTrue, isBooleanSchemaFalse, - format, dependentRequired, contains); - } -} diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenResponse.java b/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenResponse.java deleted file mode 100644 index aa6b103b77c..00000000000 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenResponse.java +++ /dev/null @@ -1,764 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen; - -import java.util.*; - -public class CodegenResponse implements IJsonSchemaValidationProperties { - public final List headers = new ArrayList(); - private List responseHeaders = new ArrayList(); - public String code; - public boolean is1xx; - public boolean is2xx; - public boolean is3xx; - public boolean is4xx; - public boolean is5xx; - public String message; - public List> examples; - public String dataType; - public String baseType; - public String containerType; - public boolean hasHeaders; - public boolean isString; - public boolean isNumeric; - public boolean isInteger; - public boolean isShort; - public boolean isLong; - public boolean isUnboundedInteger; - public boolean isNumber; - public boolean isFloat; - public boolean isDouble; - public boolean isDecimal; - public boolean isByteArray; - public boolean isBoolean; - public boolean isDate; - public boolean isDateTime; - public boolean isUuid; - public boolean isEmail; - public boolean isModel; - public boolean isFreeFormObject; - public boolean isAnyType; - public boolean isDefault; - public boolean simpleType; - public boolean primitiveType; - public boolean isMap; - public boolean isArray; - public boolean isBinary = false; - public boolean isFile = false; - public boolean isNull; - public Object schema; - public String jsonSchema; - public Map vendorExtensions = new HashMap(); - private Integer maxProperties; - private Integer minProperties; - private boolean uniqueItems; - private Boolean uniqueItemsBoolean; - private Integer maxItems; - private Integer minItems; - private Integer maxLength; - private Integer minLength; - private boolean exclusiveMinimum; - private boolean exclusiveMaximum; - private String minimum; - private String maximum; - public String pattern; - public Number multipleOf; - public CodegenProperty items; - public CodegenProperty additionalProperties; - public List vars = new ArrayList(); // all properties (without parent's properties) - public List requiredVars = new ArrayList(); - private boolean hasValidation; - private boolean additionalPropertiesIsAnyType; - private boolean hasVars; - private boolean hasRequired; - private boolean hasDiscriminatorWithNonEmptyMapping; - private CodegenComposedSchemas composedSchemas; - private boolean hasMultipleTypes = false; - private LinkedHashMap content; - private Map requiredVarsMap; - private String ref; - private boolean schemaIsFromAdditionalProperties; - - @Override - public int hashCode() { - return Objects.hash(headers, code, message, examples, dataType, baseType, containerType, hasHeaders, - isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isDecimal, isByteArray, isBoolean, isDate, - isDateTime, isUuid, isEmail, isModel, isFreeFormObject, isAnyType, isDefault, simpleType, primitiveType, - isMap, isArray, isBinary, isFile, schema, jsonSchema, vendorExtensions, items, additionalProperties, - vars, requiredVars, isNull, hasValidation, isShort, isUnboundedInteger, - getMaxProperties(), getMinProperties(), uniqueItems, getMaxItems(), getMinItems(), getMaxLength(), - getMinLength(), exclusiveMinimum, exclusiveMaximum, getMinimum(), getMaximum(), getPattern(), - is1xx, is2xx, is3xx, is4xx, is5xx, additionalPropertiesIsAnyType, hasVars, hasRequired, - hasDiscriminatorWithNonEmptyMapping, composedSchemas, hasMultipleTypes, responseHeaders, content, - requiredVarsMap, ref, uniqueItemsBoolean, schemaIsFromAdditionalProperties); - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (!(o instanceof CodegenResponse)) return false; - CodegenResponse that = (CodegenResponse) o; - return hasHeaders == that.hasHeaders && - isString == that.isString && - isNumeric == that.isNumeric && - isInteger == that.isInteger && - isShort == that.isShort && - isLong == that.isLong && - isUnboundedInteger == that.isUnboundedInteger && - isNumber == that.isNumber && - isFloat == that.isFloat && - isDouble == that.isDouble && - isDecimal == that.isDecimal && - isByteArray == that.isByteArray && - isBoolean == that.isBoolean && - isDate == that.isDate && - isDateTime == that.isDateTime && - isUuid == that.isUuid && - isEmail == that.isEmail && - isModel == that.isModel && - isFreeFormObject == that.isFreeFormObject && - isAnyType == that.isAnyType && - isDefault == that.isDefault && - simpleType == that.simpleType && - primitiveType == that.primitiveType && - isMap == that.isMap && - isArray == that.isArray && - isBinary == that.isBinary && - isFile == that.isFile && - items == that.items && - additionalProperties == that.additionalProperties && - isNull == that.isNull && - hasValidation == that.hasValidation && - is1xx == that.is1xx && - is2xx == that.is2xx && - is3xx == that.is3xx && - is4xx == that.is4xx && - is5xx == that.is5xx && - hasDiscriminatorWithNonEmptyMapping == that.getHasDiscriminatorWithNonEmptyMapping() && - hasMultipleTypes == that.getHasMultipleTypes() && - getSchemaIsFromAdditionalProperties() == that.getSchemaIsFromAdditionalProperties() && - getAdditionalPropertiesIsAnyType() == that.getAdditionalPropertiesIsAnyType() && - getHasVars() == that.getHasVars() && - getHasRequired() == that.getHasRequired() && - Objects.equals(uniqueItemsBoolean, that.getUniqueItemsBoolean()) && - Objects.equals(ref, that.getRef()) && - Objects.equals(requiredVarsMap, that.getRequiredVarsMap()) && - Objects.equals(content, that.getContent()) && - Objects.equals(responseHeaders, that.getResponseHeaders()) && - Objects.equals(composedSchemas, that.getComposedSchemas()) && - Objects.equals(vars, that.vars) && - Objects.equals(requiredVars, that.requiredVars) && - Objects.equals(headers, that.headers) && - Objects.equals(code, that.code) && - Objects.equals(message, that.message) && - Objects.equals(examples, that.examples) && - Objects.equals(dataType, that.dataType) && - Objects.equals(baseType, that.baseType) && - Objects.equals(containerType, that.containerType) && - Objects.equals(schema, that.schema) && - Objects.equals(jsonSchema, that.jsonSchema) && - Objects.equals(vendorExtensions, that.vendorExtensions) && - Objects.equals(getMaxProperties(), that.getMaxProperties()) && - Objects.equals(getMinProperties(), that.getMinProperties()) && - Objects.equals(uniqueItems, that.uniqueItems) && - Objects.equals(getMaxItems(), that.getMaxItems()) && - Objects.equals(getMinItems(), that.getMinItems()) && - Objects.equals(getMaxLength(), that.getMaxLength()) && - Objects.equals(getMinLength(), that.getMinLength()) && - Objects.equals(exclusiveMinimum, that.exclusiveMinimum) && - Objects.equals(exclusiveMaximum, that.exclusiveMaximum) && - Objects.equals(getMinimum(), that.getMinimum()) && - Objects.equals(getMaximum(), that.getMaximum()) && - Objects.equals(getPattern(), that.getPattern()) && - Objects.equals(getMultipleOf(), that.getMultipleOf()); - - } - - // use content.mediaType.schema.getContains instead of this - @Override - public CodegenProperty getContains() { - return null; - } - - // use content.mediaType.schema.setContains instead of this - @Override - public void setContains(CodegenProperty contains) {} - - // use content.mediaType.schema.getDependentRequired instead of this - @Override - public LinkedHashMap> getDependentRequired() { - return null; - } - - // use content.mediaType.schema.setDependentRequired instead of this - @Override - public void setDependentRequired(LinkedHashMap> dependentRequired) {} - - // use content.mediaType.schema.getIsBooleanSchemaTrue instead of this - @Override - public boolean getIsBooleanSchemaTrue() { - return false; - } - - // use content.mediaType.schema.setIsBooleanSchemaTrue instead of this - @Override - public void setIsBooleanSchemaTrue(boolean isBooleanSchemaTrue) {} - - // use content.mediaType.schema.getIsBooleanSchemaFalse instead of this - @Override - public boolean getIsBooleanSchemaFalse() { - return false; - } - - // use content.mediaType.schema.setIsBooleanSchemaFalse instead of this - @Override - public void setIsBooleanSchemaFalse(boolean isBooleanSchemaFalse) {} - - // use content.mediaType.schema.getFormat instead of this - @Override - public String getFormat() { - return null; - } - - // use content.mediaType.schema.setFormat instead of this - @Override - public void setFormat(String format) {} - - public LinkedHashMap getContent() { - return content; - } - - public void setContent(LinkedHashMap content) { - this.content = content; - } - - public List getResponseHeaders() { - return responseHeaders; - } - - public void setResponseHeaders(List responseHeaders) { - this.responseHeaders = responseHeaders; - } - - @Override - public String getPattern() { - return pattern; - } - - @Override - public void setPattern(String pattern) { - this.pattern = pattern; - } - - @Override - public String getMaximum() { - return maximum; - } - - @Override - public void setMaximum(String maximum) { - this.maximum = maximum; - } - - @Override - public String getMinimum() { - return minimum; - } - - @Override - public void setMinimum(String minimum) { - this.minimum = minimum; - } - - @Override - public boolean getExclusiveMaximum() { - return exclusiveMaximum; - } - - @Override - public void setExclusiveMaximum(boolean exclusiveMaximum) { - this.exclusiveMaximum = exclusiveMaximum; - } - - @Override - public boolean getExclusiveMinimum() { - return exclusiveMinimum; - } - - @Override - public void setExclusiveMinimum(boolean exclusiveMinimum) { - this.exclusiveMinimum = exclusiveMinimum; - } - - @Override - public Integer getMinLength() { - return minLength; - } - - @Override - public void setMinLength(Integer minLength) { - this.minLength = minLength; - } - - @Override - public Integer getMaxLength() { - return maxLength; - } - - @Override - public void setMaxLength(Integer maxLength) { - this.maxLength = maxLength; - } - - @Override - public Integer getMinItems() { - return minItems; - } - - @Override - public void setMinItems(Integer minItems) { - this.minItems = minItems; - } - - @Override - public Integer getMaxItems() { - return maxItems; - } - - @Override - public void setMaxItems(Integer maxItems) { - this.maxItems = maxItems; - } - - @Override - public boolean getUniqueItems() { - return uniqueItems; - } - - @Override - public void setUniqueItems(boolean uniqueItems) { - this.uniqueItems = uniqueItems; - } - - @Override - public Boolean getUniqueItemsBoolean() { - return uniqueItemsBoolean; - } - - @Override - public void setUniqueItemsBoolean(Boolean uniqueItemsBoolean) { - this.uniqueItemsBoolean = uniqueItemsBoolean; - } - - - @Override - public Integer getMinProperties() { - return minProperties; - } - - @Override - public void setMinProperties(Integer minProperties) { - this.minProperties = minProperties; - } - - @Override - public Integer getMaxProperties() { - return maxProperties; - } - - @Override - public void setMaxProperties(Integer maxProperties) { - this.maxProperties = maxProperties; - } - - @Override - public Number getMultipleOf() { - return multipleOf; - } - - @Override - public void setMultipleOf(Number multipleOf) { - this.multipleOf = multipleOf; - } - - @Override - public CodegenProperty getItems() { - return items; - } - - @Override - public void setItems(CodegenProperty items) { - this.items = items; - } - - @Override - public boolean getIsModel() { - return isModel; - } - - @Override - public boolean getIsArray() { - return isArray; - } - - @Override - public void setIsArray(boolean isArray) { - this.isArray = isArray; - } - - @Override - public boolean getIsShort() { - return isShort; - } - - @Override - public void setIsShort(boolean isShort) { - this.isShort = isShort; - } - - @Override - public boolean getIsBoolean() { - return isBoolean; - } - - @Override - public void setIsBoolean(boolean isBoolean) { - this.isBoolean = isBoolean; - } - - @Override - public boolean getIsUnboundedInteger() { - return isUnboundedInteger; - } - - @Override - public void setIsUnboundedInteger(boolean isUnboundedInteger) { - this.isUnboundedInteger = isUnboundedInteger; - } - - @Override - public boolean getIsPrimitiveType() { - return primitiveType; - } - - @Override - public void setIsPrimitiveType(boolean isPrimitiveType) { - this.primitiveType = isPrimitiveType; - } - - @Override - public void setIsModel(boolean isModel) { - this.isModel = isModel; - } - - @Override - public boolean getIsDate() { - return isDate; - } - - @Override - public void setIsDate(boolean isDate) { - this.isDate = isDate; - } - - @Override - public boolean getIsDateTime() { - return isDateTime; - } - - @Override - public void setIsDateTime(boolean isDateTime) { - this.isDateTime = isDateTime; - } - - @Override - public boolean getIsMap() { - return isMap; - } - - @Override - public void setIsMap(boolean isMap) { - this.isMap = isMap; - } - - @Override - public CodegenProperty getAdditionalProperties() { - return additionalProperties; - } - - @Override - public void setAdditionalProperties(CodegenProperty additionalProperties) { - this.additionalProperties = additionalProperties; - } - - @Override - public List getVars() { - return vars; - } - - @Override - public void setVars(List vars) { - this.vars = vars; - } - - @Override - public List getRequiredVars() { - return requiredVars; - } - - @Override - public void setRequiredVars(List requiredVars) { - this.requiredVars = requiredVars; - } - - @Override - public boolean getHasRequired() { - return this.hasRequired; - } - - @Override - public void setHasRequired(boolean hasRequired) { - this.hasRequired = hasRequired; - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder("CodegenResponse{"); - sb.append("headers=").append(headers); - sb.append(", code='").append(code).append('\''); - sb.append(", is1xx='").append(is1xx).append('\''); - sb.append(", is2xx='").append(is2xx).append('\''); - sb.append(", is3xx='").append(is3xx).append('\''); - sb.append(", is4xx='").append(is4xx).append('\''); - sb.append(", is5xx='").append(is5xx).append('\''); - sb.append(", message='").append(message).append('\''); - sb.append(", examples=").append(examples); - sb.append(", dataType='").append(dataType).append('\''); - sb.append(", baseType='").append(baseType).append('\''); - sb.append(", containerType='").append(containerType).append('\''); - sb.append(", hasHeaders=").append(hasHeaders); - sb.append(", isString=").append(isString); - sb.append(", isNumeric=").append(isNumeric); - sb.append(", isInteger=").append(isInteger); - sb.append(", isShort=").append(isShort); - sb.append(", isLong=").append(isLong); - sb.append(", isUnboundedInteger=").append(isUnboundedInteger); - sb.append(", isNumber=").append(isNumber); - sb.append(", isFloat=").append(isFloat); - sb.append(", isDouble=").append(isDouble); - sb.append(", isDecimal=").append(isDecimal); - sb.append(", isByteArray=").append(isByteArray); - sb.append(", isBoolean=").append(isBoolean); - sb.append(", isDate=").append(isDate); - sb.append(", isDateTime=").append(isDateTime); - sb.append(", isUuid=").append(isUuid); - sb.append(", isEmail=").append(isEmail); - sb.append(", isModel=").append(isModel); - sb.append(", isFreeFormObject=").append(isFreeFormObject); - sb.append(", isAnyType=").append(isAnyType); - sb.append(", isDefault=").append(isDefault); - sb.append(", simpleType=").append(simpleType); - sb.append(", primitiveType=").append(primitiveType); - sb.append(", isMap=").append(isMap); - sb.append(", isArray=").append(isArray); - sb.append(", isBinary=").append(isBinary); - sb.append(", isFile=").append(isFile); - sb.append(", schema=").append(schema); - sb.append(", jsonSchema='").append(jsonSchema).append('\''); - sb.append(", vendorExtensions=").append(vendorExtensions); - sb.append(", maxProperties=").append(maxProperties); - sb.append(", minProperties=").append(minProperties); - sb.append(", uniqueItems=").append(uniqueItems); - sb.append(", uniqueItemsBoolean=").append(uniqueItemsBoolean); - sb.append(", maxItems=").append(maxItems); - sb.append(", minItems=").append(minItems); - sb.append(", maxLength=").append(maxLength); - sb.append(", minLength=").append(minLength); - sb.append(", exclusiveMinimum=").append(exclusiveMinimum); - sb.append(", exclusiveMaximum=").append(exclusiveMaximum); - sb.append(", minimum='").append(minimum).append('\''); - sb.append(", maximum='").append(maximum).append('\''); - sb.append(", pattern='").append(pattern).append('\''); - sb.append(", multipleOf='").append(multipleOf).append('\''); - sb.append(", items='").append(items).append('\''); - sb.append(", additionalProperties='").append(additionalProperties).append('\''); - sb.append(", vars='").append(vars).append('\''); - sb.append(", requiredVars='").append(requiredVars).append('\''); - sb.append(", isNull='").append(isNull); - sb.append(", hasValidation='").append(hasValidation); - sb.append(", getAdditionalPropertiesIsAnyType=").append(additionalPropertiesIsAnyType); - sb.append(", getHasVars=").append(hasVars); - sb.append(", getHasRequired=").append(hasRequired); - sb.append(", getHasDiscriminatorWithNonEmptyMapping=").append(hasDiscriminatorWithNonEmptyMapping); - sb.append(", composedSchemas=").append(composedSchemas); - sb.append(", hasMultipleTypes=").append(hasMultipleTypes); - sb.append(", responseHeaders=").append(responseHeaders); - sb.append(", content=").append(content); - sb.append(", requiredVarsMap=").append(requiredVarsMap); - sb.append(", ref=").append(ref); - sb.append(", schemaIsFromAdditionalProperties=").append(schemaIsFromAdditionalProperties); - sb.append('}'); - return sb.toString(); - } - - // this is used in templates. Do not remove it. - @SuppressWarnings("unused") - public boolean isWildcard() { - return "0".equals(code) || "default".equals(code); - } - - /* - * Boolean value indicating whether the status code is a range - * - * @return True if the status code is a range (e.g. 2XX) - */ - public boolean isRange() { - if (code != null && code.length() == 3 && "XX".equalsIgnoreCase(code.substring(1))) - return true; - return false; - } - - @Override - public boolean getIsNull() { - return isNull; - } - - @Override - public void setIsNull(boolean isNull) { - this.isNull = isNull; - } - - @Override - public boolean getHasValidation() { - return hasValidation; - } - - @Override - public void setHasValidation(boolean hasValidation) { - this.hasValidation = hasValidation; - } - - @Override - public boolean getAdditionalPropertiesIsAnyType() { - return additionalPropertiesIsAnyType; - } - - @Override - public void setAdditionalPropertiesIsAnyType(boolean additionalPropertiesIsAnyType) { - this.additionalPropertiesIsAnyType = additionalPropertiesIsAnyType; - } - - @Override - public boolean getHasVars() { - return this.hasVars; - } - - @Override - public void setHasVars(boolean hasVars) { - this.hasVars = hasVars; - } - - @Override - public boolean getHasDiscriminatorWithNonEmptyMapping() { - return hasDiscriminatorWithNonEmptyMapping; - } - - ; - - @Override - public void setHasDiscriminatorWithNonEmptyMapping(boolean hasDiscriminatorWithNonEmptyMapping) { - this.hasDiscriminatorWithNonEmptyMapping = hasDiscriminatorWithNonEmptyMapping; - } - - @Override - public boolean getIsString() { - return isString; - } - - @Override - public void setIsString(boolean isString) { - this.isString = isString; - } - - @Override - public boolean getIsNumber() { - return isNumber; - } - - @Override - public void setIsNumber(boolean isNumber) { - this.isNumber = isNumber; - } - - @Override - public boolean getIsAnyType() { - return isAnyType; - } - - @Override - public void setIsAnyType(boolean isAnyType) { - this.isAnyType = isAnyType; - } - - @Override - public void setComposedSchemas(CodegenComposedSchemas composedSchemas) { - this.composedSchemas = composedSchemas; - } - - @Override - public CodegenComposedSchemas getComposedSchemas() { - return composedSchemas; - } - - @Override - public boolean getHasMultipleTypes() { - return hasMultipleTypes; - } - - @Override - public void setHasMultipleTypes(boolean hasMultipleTypes) { - this.hasMultipleTypes = hasMultipleTypes; - } - - @Override - public String getBaseType() { - return baseType; - } - - @Override - public Map getRequiredVarsMap() { return requiredVarsMap; } - - @Override - public void setRequiredVarsMap(Map requiredVarsMap) { this.requiredVarsMap=requiredVarsMap; } - - @Override - public String getRef() { return ref; } - - @Override - public void setRef(String ref) { this.ref=ref; } - - @Override - public boolean getSchemaIsFromAdditionalProperties() { - return schemaIsFromAdditionalProperties; - } - - @Override - public void setSchemaIsFromAdditionalProperties(boolean schemaIsFromAdditionalProperties) { - this.schemaIsFromAdditionalProperties = schemaIsFromAdditionalProperties; - } -} diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenSecurity.java b/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenSecurity.java deleted file mode 100644 index a5d5bd4ce85..00000000000 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenSecurity.java +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -public class CodegenSecurity { - public String name; - public String type; - public String scheme; - public Boolean isBasic, isOAuth, isApiKey; - // is Basic is true for all http authentication type. - // Those are to differentiate basic and bearer authentication - // isHttpSignature is to support HTTP signature authorization scheme. - // https://datatracker.ietf.org/doc/draft-cavage-http-signatures/ - public Boolean isBasicBasic, isBasicBearer, isHttpSignature; - public String bearerFormat; - public Map vendorExtensions = new HashMap(); - // ApiKey specific - public String keyParamName; - public Boolean isKeyInQuery, isKeyInHeader, isKeyInCookie; - // Oauth specific - public String flow, authorizationUrl, tokenUrl, refreshUrl; - public List> scopes; - public Boolean isCode, isPassword, isApplication, isImplicit; - - // Return a copy of the security object, filtering out any scopes from the passed-in list. - public CodegenSecurity filterByScopeNames(List filterScopes) { - CodegenSecurity filteredSecurity = new CodegenSecurity(); - // Copy all fields except the scopes. - filteredSecurity.name = name; - filteredSecurity.type = type; - filteredSecurity.isBasic = isBasic; - filteredSecurity.isBasicBasic = isBasicBasic; - filteredSecurity.isHttpSignature = isHttpSignature; - filteredSecurity.isBasicBearer = isBasicBearer; - filteredSecurity.isApiKey = isApiKey; - filteredSecurity.isOAuth = isOAuth; - filteredSecurity.keyParamName = keyParamName; - filteredSecurity.isCode = isCode; - filteredSecurity.isImplicit = isImplicit; - filteredSecurity.isApplication = isApplication; - filteredSecurity.isPassword = isPassword; - filteredSecurity.isKeyInCookie = isKeyInCookie; - filteredSecurity.isKeyInHeader = isKeyInHeader; - filteredSecurity.isKeyInQuery = isKeyInQuery; - filteredSecurity.flow = flow; - filteredSecurity.tokenUrl = tokenUrl; - filteredSecurity.authorizationUrl = authorizationUrl; - filteredSecurity.refreshUrl = refreshUrl; - // It is not possible to deep copy the extensions, as we have no idea what types they are. - // So the filtered method *will* refer to the original extensions, if any. - filteredSecurity.vendorExtensions = new HashMap(vendorExtensions); - List> returnedScopes = new ArrayList>(); - Map lastScope = null; - for (String filterScopeName : filterScopes) { - for (Map scope : scopes) { - String name = (String) scope.get("scope"); - if (filterScopeName.equals(name)) { - returnedScopes.add(scope); - lastScope = scope; - break; - } - } - } - filteredSecurity.scopes = returnedScopes; - - return filteredSecurity; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - CodegenSecurity that = (CodegenSecurity) o; - return Objects.equals(name, that.name) && - Objects.equals(type, that.type) && - Objects.equals(scheme, that.scheme) && - Objects.equals(isBasic, that.isBasic) && - Objects.equals(isOAuth, that.isOAuth) && - Objects.equals(isApiKey, that.isApiKey) && - Objects.equals(isBasicBasic, that.isBasicBasic) && - Objects.equals(isHttpSignature, that.isHttpSignature) && - Objects.equals(isBasicBearer, that.isBasicBearer) && - Objects.equals(bearerFormat, that.bearerFormat) && - Objects.equals(vendorExtensions, that.vendorExtensions) && - Objects.equals(keyParamName, that.keyParamName) && - Objects.equals(isKeyInQuery, that.isKeyInQuery) && - Objects.equals(isKeyInHeader, that.isKeyInHeader) && - Objects.equals(isKeyInCookie, that.isKeyInCookie) && - Objects.equals(flow, that.flow) && - Objects.equals(authorizationUrl, that.authorizationUrl) && - Objects.equals(tokenUrl, that.tokenUrl) && - Objects.equals(refreshUrl, that.refreshUrl) && - Objects.equals(scopes, that.scopes) && - Objects.equals(isCode, that.isCode) && - Objects.equals(isPassword, that.isPassword) && - Objects.equals(isApplication, that.isApplication) && - Objects.equals(isImplicit, that.isImplicit); - } - - @Override - public int hashCode() { - - return Objects.hash(name, type, scheme, isBasic, isOAuth, isApiKey, - isBasicBasic, isHttpSignature, isBasicBearer, bearerFormat, vendorExtensions, - keyParamName, isKeyInQuery, isKeyInHeader, isKeyInCookie, flow, - authorizationUrl, tokenUrl, refreshUrl, scopes, isCode, isPassword, isApplication, isImplicit); - } - - @Override - public String toString() { - final StringBuffer sb = new StringBuffer("CodegenSecurity{"); - sb.append("name='").append(name).append('\''); - sb.append(", type='").append(type).append('\''); - sb.append(", scheme='").append(scheme).append('\''); - sb.append(", isBasic=").append(isBasic); - sb.append(", isOAuth=").append(isOAuth); - sb.append(", isApiKey=").append(isApiKey); - sb.append(", isBasicBasic=").append(isBasicBasic); - sb.append(", isHttpSignature=").append(isHttpSignature); - sb.append(", isBasicBearer=").append(isBasicBearer); - sb.append(", bearerFormat='").append(bearerFormat).append('\''); - sb.append(", vendorExtensions=").append(vendorExtensions); - sb.append(", keyParamName='").append(keyParamName).append('\''); - sb.append(", isKeyInQuery=").append(isKeyInQuery); - sb.append(", isKeyInHeader=").append(isKeyInHeader); - sb.append(", isKeyInCookie=").append(isKeyInCookie); - sb.append(", flow='").append(flow).append('\''); - sb.append(", authorizationUrl='").append(authorizationUrl).append('\''); - sb.append(", tokenUrl='").append(tokenUrl).append('\''); - sb.append(", refreshUrl='").append(refreshUrl).append('\''); - sb.append(", scopes=").append(scopes); - sb.append(", isCode=").append(isCode); - sb.append(", isPassword=").append(isPassword); - sb.append(", isApplication=").append(isApplication); - sb.append(", isImplicit=").append(isImplicit); - sb.append('}'); - return sb.toString(); - } -} diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenServer.java b/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenServer.java deleted file mode 100644 index f1116546028..00000000000 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenServer.java +++ /dev/null @@ -1,36 +0,0 @@ -package org.openapitools.codegen; - -import java.util.List; -import java.util.Objects; - -public class CodegenServer { - public String url; - public String description; - public List variables; - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - CodegenServer that = (CodegenServer) o; - return Objects.equals(url, that.url) && - Objects.equals(description, that.description) && - Objects.equals(variables, that.variables); - } - - @Override - public int hashCode() { - - return Objects.hash(url, description, variables); - } - - @Override - public String toString() { - final StringBuffer sb = new StringBuffer("CodegenServer{"); - sb.append("url='").append(url).append('\''); - sb.append(", description='").append(description).append('\''); - sb.append(", variables=").append(variables); - sb.append('}'); - return sb.toString(); - } -} diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenServerVariable.java b/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenServerVariable.java deleted file mode 100644 index 0cd643e2723..00000000000 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenServerVariable.java +++ /dev/null @@ -1,42 +0,0 @@ -package org.openapitools.codegen; - -import java.util.List; -import java.util.Objects; - -public class CodegenServerVariable { - public String name; - public String defaultValue; - public String description; - public List enumValues; - public String value; - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - CodegenServerVariable that = (CodegenServerVariable) o; - return Objects.equals(name, that.name) && - Objects.equals(defaultValue, that.defaultValue) && - Objects.equals(description, that.description) && - Objects.equals(enumValues, that.enumValues) && - Objects.equals(value, that.value); - } - - @Override - public int hashCode() { - - return Objects.hash(name, defaultValue, description, enumValues, value); - } - - @Override - public String toString() { - final StringBuffer sb = new StringBuffer("CodegenServerVariable{"); - sb.append("name='").append(name).append('\''); - sb.append(", defaultValue='").append(defaultValue).append('\''); - sb.append(", description='").append(description).append('\''); - sb.append(", enumValues=").append(enumValues); - sb.append(", value='").append(value).append('\''); - sb.append('}'); - return sb.toString(); - } -} diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java deleted file mode 100644 index 1a4aaa9fc5e..00000000000 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ /dev/null @@ -1,7952 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen; - -import com.github.benmanes.caffeine.cache.Cache; -import com.github.benmanes.caffeine.cache.Caffeine; -import com.github.benmanes.caffeine.cache.Ticker; -import com.google.common.base.CaseFormat; -import com.google.common.collect.ImmutableMap; -import com.samskivert.mustache.Mustache; -import com.samskivert.mustache.Mustache.Compiler; -import com.samskivert.mustache.Mustache.Lambda; - -import org.apache.commons.lang3.ObjectUtils; -import org.apache.commons.text.StringEscapeUtils; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.tuple.Pair; -import org.openapitools.codegen.CodegenDiscriminator.MappedModel; -import org.openapitools.codegen.api.TemplatingEngineAdapter; -import org.openapitools.codegen.config.GlobalSettings; -import org.openapitools.codegen.examples.ExampleGenerator; -import org.openapitools.codegen.meta.FeatureSet; -import org.openapitools.codegen.meta.GeneratorMetadata; -import org.openapitools.codegen.meta.Stability; -import org.openapitools.codegen.meta.features.*; -import org.openapitools.codegen.model.ModelMap; -import org.openapitools.codegen.model.ModelsMap; -import org.openapitools.codegen.model.OperationsMap; -import org.openapitools.codegen.serializer.SerializerUtils; -import org.openapitools.codegen.templating.MustacheEngineAdapter; -import org.openapitools.codegen.templating.mustache.*; -import org.openapitools.codegen.utils.ModelUtils; -import org.openapitools.codegen.utils.OneOfImplementorAdditionalData; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.File; -import java.util.*; -import java.util.Map.Entry; -import java.util.concurrent.ConcurrentSkipListSet; -import java.util.concurrent.TimeUnit; -import java.util.function.Consumer; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import io.swagger.v3.core.util.Json; -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.Operation; -import io.swagger.v3.oas.models.PathItem; -import io.swagger.v3.oas.models.callbacks.Callback; -import io.swagger.v3.oas.models.examples.Example; -import io.swagger.v3.oas.models.headers.Header; -import io.swagger.v3.oas.models.media.*; -import io.swagger.v3.oas.models.parameters.*; -import io.swagger.v3.oas.models.responses.ApiResponse; -import io.swagger.v3.oas.models.responses.ApiResponses; -import io.swagger.v3.oas.models.security.OAuthFlow; -import io.swagger.v3.oas.models.security.OAuthFlows; -import io.swagger.v3.oas.models.security.SecurityScheme; -import io.swagger.v3.oas.models.servers.Server; -import io.swagger.v3.oas.models.servers.ServerVariable; -import io.swagger.v3.parser.util.SchemaTypeUtil; - -import static org.openapitools.codegen.CodegenConstants.UNSUPPORTED_V310_SPEC_MSG; -import static org.openapitools.codegen.utils.OnceLogger.once; -import static org.openapitools.codegen.utils.StringUtils.*; - -public class DefaultCodegen implements CodegenConfig { - private final Logger LOGGER = LoggerFactory.getLogger(DefaultCodegen.class); - - public static FeatureSet DefaultFeatureSet; - - // A cache of sanitized words. The sanitizeName() method is invoked many times with the same - // arguments, this cache is used to optimized performance. - private static Cache sanitizedNameCache; - private static final String xSchemaTestExamplesKey = "x-schema-test-examples"; - private static final String xSchemaTestExamplesRefPrefix = "#/components/x-schema-test-examples/"; - protected static Schema falseSchema; - protected static Schema trueSchema = new Schema(); - - static { - DefaultFeatureSet = FeatureSet.newBuilder() - .includeDataTypeFeatures( - DataTypeFeature.Int32, DataTypeFeature.Int64, DataTypeFeature.Float, DataTypeFeature.Double, - DataTypeFeature.Decimal, DataTypeFeature.String, DataTypeFeature.Byte, DataTypeFeature.Binary, - DataTypeFeature.Boolean, DataTypeFeature.Date, DataTypeFeature.DateTime, DataTypeFeature.Password, - DataTypeFeature.File, DataTypeFeature.Array, DataTypeFeature.Object, DataTypeFeature.Maps, DataTypeFeature.CollectionFormat, - DataTypeFeature.CollectionFormatMulti, DataTypeFeature.Enum, DataTypeFeature.ArrayOfEnum, DataTypeFeature.ArrayOfModel, - DataTypeFeature.ArrayOfCollectionOfPrimitives, DataTypeFeature.ArrayOfCollectionOfModel, DataTypeFeature.ArrayOfCollectionOfEnum, - DataTypeFeature.MapOfEnum, DataTypeFeature.MapOfModel, DataTypeFeature.MapOfCollectionOfPrimitives, - DataTypeFeature.MapOfCollectionOfModel, DataTypeFeature.MapOfCollectionOfEnum - // Custom types are template specific - ) - .includeDocumentationFeatures( - DocumentationFeature.Api, DocumentationFeature.Model - // README is template specific - ) - .includeGlobalFeatures( - GlobalFeature.Host, GlobalFeature.BasePath, GlobalFeature.Info, GlobalFeature.PartialSchemes, - GlobalFeature.Consumes, GlobalFeature.Produces, GlobalFeature.ExternalDocumentation, GlobalFeature.Examples, - GlobalFeature.Callbacks - // TODO: xml structures, styles, link objects, parameterized servers, full schemes for OAS 2.0 - ) - .includeSchemaSupportFeatures( - SchemaSupportFeature.Simple, SchemaSupportFeature.Composite, - SchemaSupportFeature.Polymorphism - // Union (OneOf) not 100% yet. - ) - .includeParameterFeatures( - ParameterFeature.Path, ParameterFeature.Query, ParameterFeature.Header, ParameterFeature.Body, - ParameterFeature.FormUnencoded, ParameterFeature.FormMultipart, ParameterFeature.Cookie - ) - .includeSecurityFeatures( - SecurityFeature.BasicAuth, SecurityFeature.ApiKey, SecurityFeature.BearerToken, - SecurityFeature.OAuth2_Implicit, SecurityFeature.OAuth2_Password, - SecurityFeature.OAuth2_ClientCredentials, SecurityFeature.OAuth2_AuthorizationCode - // OpenIDConnect not yet supported - ) - .includeWireFormatFeatures( - WireFormatFeature.JSON, WireFormatFeature.XML - // PROTOBUF and Custom are generator specific - ) - .build(); - - int cacheSize = Integer.parseInt(GlobalSettings.getProperty(NAME_CACHE_SIZE_PROPERTY, "500")); - int cacheExpiry = Integer.parseInt(GlobalSettings.getProperty(NAME_CACHE_EXPIRY_PROPERTY, "10")); - sanitizedNameCache = Caffeine.newBuilder() - .maximumSize(cacheSize) - .expireAfterAccess(cacheExpiry, TimeUnit.SECONDS) - .ticker(Ticker.systemTicker()) - .build(); - falseSchema = new Schema(); - falseSchema.setNot(new Schema()); - } - - protected GeneratorMetadata generatorMetadata; - protected String inputSpec; - protected String outputFolder = ""; - protected Set defaultIncludes; - protected Map typeMapping; - // instantiationTypes map from container types only: set, map, and array to the in language-type - protected Map instantiationTypes; - protected Set reservedWords; - protected Set languageSpecificPrimitives = new HashSet<>(); - protected Map importMapping = new HashMap<>(); - // a map to store the mappping between a schema and the new one - protected Map schemaMapping = new HashMap<>(); - // a map to store the mappping between inline schema and the name provided by the user - protected Map inlineSchemaNameMapping = new HashMap<>(); - // a map to store the inline schema naming conventions - protected Map inlineSchemaNameDefault = new HashMap<>(); - protected String modelPackage = "", apiPackage = "", fileSuffix; - protected String modelNamePrefix = "", modelNameSuffix = ""; - protected String apiNamePrefix = "", apiNameSuffix = "Api"; - protected String testPackage = ""; - protected String filesMetadataFilename = "FILES"; - protected String versionMetadataFilename = "VERSION"; - /* - apiTemplateFiles are for API outputs only (controllers/handlers). - API templates may be written multiple times; APIs are grouped by tag and the file is written once per tag group. - */ - protected Map apiTemplateFiles = new HashMap<>(); - protected Map modelTemplateFiles = new HashMap<>(); - protected Map apiTestTemplateFiles = new HashMap<>(); - protected Map modelTestTemplateFiles = new HashMap<>(); - protected Map apiDocTemplateFiles = new HashMap<>(); - protected Map modelDocTemplateFiles = new HashMap<>(); - protected Map reservedWordsMappings = new HashMap<>(); - protected String templateDir; - protected String embeddedTemplateDir; - protected Map additionalProperties = new HashMap<>(); - protected Map serverVariables = new HashMap<>(); - protected Map vendorExtensions = new HashMap<>(); - /* - Supporting files are those which aren't models, APIs, or docs. - These get a different map of data bound to the templates. Supporting files are written once. - See also 'apiTemplateFiles'. - */ - protected List supportingFiles = new ArrayList<>(); - protected List cliOptions = new ArrayList<>(); - protected boolean skipOverwrite; - protected boolean removeOperationIdPrefix; - protected String removeOperationIdPrefixDelimiter = "_"; - protected int removeOperationIdPrefixCount = 1; - protected boolean skipOperationExample; - - protected final static Pattern JSON_MIME_PATTERN = Pattern.compile("(?i)application\\/json(;.*)?"); - protected final static Pattern JSON_VENDOR_MIME_PATTERN = Pattern.compile("(?i)application\\/vnd.(.*)+json(;.*)?"); - private static final Pattern COMMON_PREFIX_ENUM_NAME = Pattern.compile("[a-zA-Z0-9]+\\z"); - - /** - * True if the code generator supports multiple class inheritance. - * This is used to model the parent hierarchy based on the 'allOf' composed schemas. - */ - protected boolean supportsMultipleInheritance; - /** - * True if the code generator supports single class inheritance. - * This is used to model the parent hierarchy based on the 'allOf' composed schemas. - * Note: the single-class inheritance technique has inherent limitations because - * a 'allOf' composed schema may have multiple $ref child schemas, each one - * potentially representing a "parent" in the class inheritance hierarchy. - * Some language generators also use class inheritance to implement the `additionalProperties` - * keyword. For example, the Java code generator may generate 'extends HashMap'. - */ - protected boolean supportsInheritance; - /** - * True if the language generator supports the 'additionalProperties' keyword - * as sibling of a composed (allOf/anyOf/oneOf) schema. - * Note: all language generators should support this to comply with the OAS specification. - */ - protected boolean supportsAdditionalPropertiesWithComposedSchema; - protected boolean supportsMixins; - protected Map supportedLibraries = new LinkedHashMap<>(); - protected String library; - protected Boolean sortParamsByRequiredFlag = true; - protected Boolean sortModelPropertiesByRequiredFlag = false; - protected Boolean ensureUniqueParams = true; - protected Boolean allowUnicodeIdentifiers = false; - protected String gitHost, gitUserId, gitRepoId, releaseNote; - protected String httpUserAgent; - protected Boolean hideGenerationTimestamp = true; - // How to encode special characters like $ - // They are translated to words like "Dollar" and prefixed with ' - // Then translated back during JSON encoding and decoding - protected Map specialCharReplacements = new LinkedHashMap<>(); - // When a model is an alias for a simple type - protected Map typeAliases = null; - protected Boolean prependFormOrBodyParameters = false; - // The extension of the generated documentation files (defaults to markdown .md) - protected String docExtension; - protected String ignoreFilePathOverride; - // flag to indicate whether to use environment variable to post process file - protected boolean enablePostProcessFile = false; - private TemplatingEngineAdapter templatingEngine = new MustacheEngineAdapter(); - // flag to indicate whether to use the utils.OneOfImplementorAdditionalData related logic - protected boolean useOneOfInterfaces = false; - // whether or not the oneOf imports machinery should add oneOf interfaces as imports in implementing classes - protected boolean addOneOfInterfaceImports = false; - protected List addOneOfInterfaces = new ArrayList<>(); - - // flag to indicate whether to only update files whose contents have changed - protected boolean enableMinimalUpdate = false; - - // acts strictly upon a spec, potentially modifying it to have consistent behavior across generators. - protected boolean strictSpecBehavior = true; - // flag to indicate whether enum value prefixes are removed - protected boolean removeEnumValuePrefix = true; - - // Support legacy logic for evaluating discriminators - protected boolean legacyDiscriminatorBehavior = true; - - // Specify what to do if the 'additionalProperties' keyword is not present in a schema. - // See CodegenConstants.java for more details. - protected boolean disallowAdditionalPropertiesIfNotPresent = true; - - // If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response. - // With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case. - protected boolean enumUnknownDefaultCase = false; - protected String enumUnknownDefaultCaseName = "unknown_default_open_api"; - - // make openapi available to all methods - protected OpenAPI openAPI; - - // A cache to efficiently lookup a Schema instance based on the return value of `toModelName()`. - private Map modelNameToSchemaCache; - - // A cache to efficiently lookup schema `toModelName()` based on the schema Key - private final Map schemaKeyToModelNameCache = new HashMap<>(); - - protected boolean loadDeepObjectIntoItems = true; - - // if true then baseTypes will be imported - protected boolean importBaseType = true; - - // if true then container types will be imported - protected boolean importContainerType = true; - - // if True codegenParameter and codegenResponse imports will come - // from deeper schema defined locations - protected boolean addSchemaImportsFromV3SpecLocations = false; - - protected boolean addSuffixToDuplicateOperationNicknames = true; - - public boolean getAddSuffixToDuplicateOperationNicknames() { - return addSuffixToDuplicateOperationNicknames; - } - - @Override - public List cliOptions() { - return cliOptions; - } - - @Override - public void processOpts() { - - if (additionalProperties.containsKey(CodegenConstants.TEMPLATE_DIR)) { - this.setTemplateDir((String) additionalProperties.get(CodegenConstants.TEMPLATE_DIR)); - } - - if (additionalProperties.containsKey(CodegenConstants.MODEL_PACKAGE)) { - this.setModelPackage((String) additionalProperties.get(CodegenConstants.MODEL_PACKAGE)); - } - - if (additionalProperties.containsKey(CodegenConstants.API_PACKAGE)) { - this.setApiPackage((String) additionalProperties.get(CodegenConstants.API_PACKAGE)); - } - - if (additionalProperties.containsKey(CodegenConstants.HIDE_GENERATION_TIMESTAMP)) { - setHideGenerationTimestamp(convertPropertyToBooleanAndWriteBack(CodegenConstants.HIDE_GENERATION_TIMESTAMP)); - } else { - additionalProperties.put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, hideGenerationTimestamp); - } - - if (additionalProperties.containsKey(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG)) { - this.setSortParamsByRequiredFlag(Boolean.valueOf(additionalProperties - .get(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG).toString())); - } - - if (additionalProperties.containsKey(CodegenConstants.SORT_MODEL_PROPERTIES_BY_REQUIRED_FLAG)) { - this.setSortModelPropertiesByRequiredFlag(Boolean.valueOf(additionalProperties - .get(CodegenConstants.SORT_MODEL_PROPERTIES_BY_REQUIRED_FLAG).toString())); - } - - if (additionalProperties.containsKey(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS)) { - this.setPrependFormOrBodyParameters(Boolean.valueOf(additionalProperties - .get(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS).toString())); - } - - if (additionalProperties.containsKey(CodegenConstants.ENSURE_UNIQUE_PARAMS)) { - this.setEnsureUniqueParams(Boolean.valueOf(additionalProperties - .get(CodegenConstants.ENSURE_UNIQUE_PARAMS).toString())); - } - - if (additionalProperties.containsKey(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS)) { - this.setAllowUnicodeIdentifiers(Boolean.valueOf(additionalProperties - .get(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS).toString())); - } - - if (additionalProperties.containsKey(CodegenConstants.API_NAME_PREFIX)) { - this.setApiNamePrefix((String) additionalProperties.get(CodegenConstants.API_NAME_PREFIX)); - } - - if (additionalProperties.containsKey(CodegenConstants.API_NAME_SUFFIX)) { - this.setApiNameSuffix((String) additionalProperties.get(CodegenConstants.API_NAME_SUFFIX)); - } - - if (additionalProperties.containsKey(CodegenConstants.MODEL_NAME_PREFIX)) { - this.setModelNamePrefix((String) additionalProperties.get(CodegenConstants.MODEL_NAME_PREFIX)); - } - - if (additionalProperties.containsKey(CodegenConstants.MODEL_NAME_SUFFIX)) { - this.setModelNameSuffix((String) additionalProperties.get(CodegenConstants.MODEL_NAME_SUFFIX)); - } - - if (additionalProperties.containsKey(CodegenConstants.REMOVE_OPERATION_ID_PREFIX)) { - this.setRemoveOperationIdPrefix(Boolean.parseBoolean(additionalProperties - .get(CodegenConstants.REMOVE_OPERATION_ID_PREFIX).toString())); - } - - if (additionalProperties.containsKey(CodegenConstants.REMOVE_OPERATION_ID_PREFIX_DELIMITER)) { - this.setRemoveOperationIdPrefixDelimiter(additionalProperties - .get(CodegenConstants.REMOVE_OPERATION_ID_PREFIX_DELIMITER).toString()); - } - - if (additionalProperties.containsKey(CodegenConstants.REMOVE_OPERATION_ID_PREFIX_COUNT)) { - this.setRemoveOperationIdPrefixCount(Integer.parseInt(additionalProperties - .get(CodegenConstants.REMOVE_OPERATION_ID_PREFIX_COUNT).toString())); - } - - if (additionalProperties.containsKey(CodegenConstants.SKIP_OPERATION_EXAMPLE)) { - this.setSkipOperationExample(Boolean.parseBoolean(additionalProperties - .get(CodegenConstants.SKIP_OPERATION_EXAMPLE).toString())); - } - - if (additionalProperties.containsKey(CodegenConstants.DOCEXTENSION)) { - this.setDocExtension(String.valueOf(additionalProperties - .get(CodegenConstants.DOCEXTENSION).toString())); - } - - if (additionalProperties.containsKey(CodegenConstants.ENABLE_POST_PROCESS_FILE)) { - this.setEnablePostProcessFile(Boolean.parseBoolean(additionalProperties - .get(CodegenConstants.ENABLE_POST_PROCESS_FILE).toString())); - } - - if (additionalProperties.containsKey(CodegenConstants.GENERATE_ALIAS_AS_MODEL)) { - ModelUtils.setGenerateAliasAsModel(Boolean.parseBoolean(additionalProperties - .get(CodegenConstants.GENERATE_ALIAS_AS_MODEL).toString())); - } - - if (additionalProperties.containsKey(CodegenConstants.REMOVE_ENUM_VALUE_PREFIX)) { - this.setRemoveEnumValuePrefix(Boolean.parseBoolean(additionalProperties - .get(CodegenConstants.REMOVE_ENUM_VALUE_PREFIX).toString())); - } - - if (additionalProperties.containsKey(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR)) { - this.setLegacyDiscriminatorBehavior(Boolean.parseBoolean(additionalProperties - .get(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR).toString())); - } - if (additionalProperties.containsKey(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT)) { - this.setDisallowAdditionalPropertiesIfNotPresent(Boolean.parseBoolean(additionalProperties - .get(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT).toString())); - } - if (additionalProperties.containsKey(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE)) { - this.setEnumUnknownDefaultCase(Boolean.parseBoolean(additionalProperties - .get(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE).toString())); - } - } - - /*** - * Preset map builder with commonly used Mustache lambdas. - * - * To extend the map, override addMustacheLambdas(), call parent method - * first and then add additional lambdas to the returned builder. - * - * If common lambdas are not desired, override addMustacheLambdas() method - * and return empty builder. - * - * @return preinitialized map with common lambdas - */ - protected ImmutableMap.Builder addMustacheLambdas() { - - return new ImmutableMap.Builder() - .put("lowercase", new LowercaseLambda().generator(this)) - .put("uppercase", new UppercaseLambda()) - .put("snakecase", new SnakecaseLambda()) - .put("titlecase", new TitlecaseLambda()) - .put("camelcase", new CamelCaseLambda(true).generator(this)) - .put("pascalcase", new CamelCaseLambda(false).generator(this)) - .put("indented", new IndentedLambda()) - .put("indented_8", new IndentedLambda(8, " ")) - .put("indented_12", new IndentedLambda(12, " ")) - .put("indented_16", new IndentedLambda(16, " ")); - } - - private void registerMustacheLambdas() { - ImmutableMap lambdas = addMustacheLambdas().build(); - - if (lambdas.size() == 0) { - return; - } - - if (additionalProperties.containsKey("lambda")) { - LOGGER.error("A property called 'lambda' already exists in additionalProperties"); - throw new RuntimeException("A property called 'lambda' already exists in additionalProperties"); - } - additionalProperties.put("lambda", lambdas); - } - - // override with any special post-processing for all models - @Override - @SuppressWarnings("static-method") - public Map postProcessAllModels(Map objs) { - if (this.useOneOfInterfaces) { - // First, add newly created oneOf interfaces - for (CodegenModel cm : addOneOfInterfaces) { - ModelMap modelMapValue = new ModelMap(additionalProperties()); - modelMapValue.setModel(cm); - - List> importsValue = new ArrayList<>(); - ModelsMap objsValue = new ModelsMap(); - objsValue.setModels(Collections.singletonList(modelMapValue)); - objsValue.put("package", modelPackage()); - objsValue.setImports(importsValue); - objsValue.put("classname", cm.classname); - objsValue.putAll(additionalProperties); - objs.put(cm.name, objsValue); - } - - // Gather data from all the models that contain oneOf into OneOfImplementorAdditionalData classes - // (see docstring of that class to find out what information is gathered and why) - Map additionalDataMap = new HashMap<>(); - for (ModelsMap modelsAttrs : objs.values()) { - List> modelsImports = modelsAttrs.getImportsOrEmpty(); - for (ModelMap mo : modelsAttrs.getModels()) { - CodegenModel cm = mo.getModel(); - if (cm.oneOf.size() > 0) { - cm.vendorExtensions.put("x-is-one-of-interface", true); - for (String one : cm.oneOf) { - if (!additionalDataMap.containsKey(one)) { - additionalDataMap.put(one, new OneOfImplementorAdditionalData(one)); - } - additionalDataMap.get(one).addFromInterfaceModel(cm, modelsImports); - } - // if this is oneOf interface, make sure we include the necessary imports for it - addImportsToOneOfInterface(modelsImports); - } - } - } - - // Add all the data from OneOfImplementorAdditionalData classes to the implementing models - for (Map.Entry modelsEntry : objs.entrySet()) { - ModelsMap modelsAttrs = modelsEntry.getValue(); - List> imports = modelsAttrs.getImports(); - for (ModelMap implmo : modelsAttrs.getModels()) { - CodegenModel implcm = implmo.getModel(); - String modelName = toModelName(implcm.name); - if (additionalDataMap.containsKey(modelName)) { - additionalDataMap.get(modelName).addToImplementor(this, implcm, imports, addOneOfInterfaceImports); - } - } - } - } - - return objs; - } - - /** - * Return a map from model name to Schema for efficient lookup. - * - * @return map from model name to Schema. - */ - protected Map getModelNameToSchemaCache() { - if (modelNameToSchemaCache == null) { - // Create a cache to efficiently lookup schema based on model name. - Map m = new HashMap<>(); - ModelUtils.getSchemas(openAPI).forEach((key, schema) -> m.put(toModelName(key), schema)); - modelNameToSchemaCache = Collections.unmodifiableMap(m); - } - return modelNameToSchemaCache; - } - - /** - * Index all CodegenModels by model name. - * - * @param objs Map of models - * @return map of all models indexed by names - */ - public Map getAllModels(Map objs) { - Map allModels = new LinkedHashMap<>(); - for (Entry entry : objs.entrySet()) { - String modelName = toModelName(entry.getKey()); - List models = entry.getValue().getModels(); - for (ModelMap mo : models) { - CodegenModel cm = mo.getModel(); - allModels.put(modelName, cm); - } - } - return allModels; - } - - /** - * Loop through all models to update different flags (e.g. isSelfReference), children models, etc - * - * @param objs Map of models - * @return maps of models with various updates - */ - @Override - public Map updateAllModels(Map objs) { - Map allModels = getAllModels(objs); - - // Fix up all parent and interface CodegenModel references. - for (CodegenModel cm : allModels.values()) { - if (cm.getParent() != null) { - cm.setParentModel(allModels.get(cm.getParent())); - } - if (cm.getInterfaces() != null && !cm.getInterfaces().isEmpty()) { - cm.setInterfaceModels(new ArrayList<>(cm.getInterfaces().size())); - for (String intf : cm.getInterfaces()) { - CodegenModel intfModel = allModels.get(intf); - if (intfModel != null) { - cm.getInterfaceModels().add(intfModel); - } - } - } - } - - // Let parent know about all its children - for (Map.Entry allModelsEntry : allModels.entrySet()) { - String name = allModelsEntry.getKey(); - CodegenModel cm = allModelsEntry.getValue(); - CodegenModel parent = allModels.get(cm.getParent()); - // if a discriminator exists on the parent, don't add this child to the inheritance hierarchy - // TODO Determine what to do if the parent discriminator name == the grandparent discriminator name - while (parent != null) { - if (parent.getChildren() == null) { - parent.setChildren(new ArrayList<>()); - } - parent.getChildren().add(cm); - parent.hasChildren = true; - Schema parentSchema = this.openAPI.getComponents().getSchemas().get(parent.name); - if (parentSchema == null) { - throw new NullPointerException(parent.name+" in "+this.openAPI.getComponents().getSchemas()); - } - if (parentSchema.getDiscriminator() == null) { - parent = allModels.get(parent.getParent()); - } else { - parent = null; - } - } - } - - // loop through properties of each model to detect self-reference - for (ModelsMap entry : objs.values()) { - for (ModelMap mo : entry.getModels()) { - CodegenModel cm = mo.getModel(); - removeSelfReferenceImports(cm); - } - } - setCircularReferences(allModels); - - return objs; - } - - /** - * Removes imports from the model that points to itself - * Marks a self referencing property, if detected - * - * @param model Self imports will be removed from this model.imports collection - */ - protected void removeSelfReferenceImports(CodegenModel model) { - for (CodegenProperty cp : model.allVars) { - // detect self import - if (cp.dataType.equalsIgnoreCase(model.classname) || - (cp.isContainer && cp.items != null && cp.items.dataType.equalsIgnoreCase(model.classname))) { - model.imports.remove(model.classname); // remove self import - cp.isSelfReference = true; - } - } - } - - public void setCircularReferences(Map models) { - final Map> dependencyMap = models.entrySet().stream() - .collect(Collectors.toMap(Entry::getKey, entry -> getModelDependencies(entry.getValue()))); - - models.keySet().forEach(name -> setCircularReferencesOnProperties(name, dependencyMap)); - } - - private List getModelDependencies(CodegenModel model) { - return model.getAllVars().stream() - .map(prop -> { - if (prop.isContainer) { - return prop.items.dataType == null ? null : prop; - } - return prop.dataType == null ? null : prop; - }) - .filter(Objects::nonNull) - .collect(Collectors.toList()); - } - - private void setCircularReferencesOnProperties(final String root, - final Map> dependencyMap) { - dependencyMap.getOrDefault(root, new ArrayList<>()) - .forEach(prop -> { - final List unvisited = - Collections.singletonList(prop.isContainer ? prop.items.dataType : prop.dataType); - prop.isCircularReference = isCircularReference(root, - new HashSet<>(), - new ArrayList<>(unvisited), - dependencyMap); - }); - } - - private boolean isCircularReference(final String root, - final Set visited, - final List unvisited, - final Map> dependencyMap) { - for (int i = 0; i < unvisited.size(); i++) { - final String next = unvisited.get(i); - if (!visited.contains(next)) { - if (next.equals(root)) { - return true; - } - dependencyMap.getOrDefault(next, new ArrayList<>()) - .forEach(prop -> unvisited.add(prop.isContainer ? prop.items.dataType : prop.dataType)); - visited.add(next); - } - } - return false; - } - - // override with any special post-processing - @Override - @SuppressWarnings("static-method") - public ModelsMap postProcessModels(ModelsMap objs) { - return objs; - } - - /** - * post process enum defined in model's properties - * - * @param objs Map of models - * @return maps of models with better enum support - */ - public ModelsMap postProcessModelsEnum(ModelsMap objs) { - for (ModelMap mo : objs.getModels()) { - CodegenModel cm = mo.getModel(); - - // for enum model - if (Boolean.TRUE.equals(cm.isEnum) && cm.allowableValues != null) { - Map allowableValues = cm.allowableValues; - List values = (List) allowableValues.get("values"); - List> enumVars = buildEnumVars(values, cm.dataType); - // if "x-enum-varnames" or "x-enum-descriptions" defined, update varnames - updateEnumVarsWithExtensions(enumVars, cm.getVendorExtensions(), cm.dataType); - cm.allowableValues.put("enumVars", enumVars); - } - - // update codegen property enum with proper naming convention - // and handling of numbers, special characters - for (CodegenProperty var : cm.vars) { - updateCodegenPropertyEnum(var); - } - - for (CodegenProperty var : cm.allVars) { - updateCodegenPropertyEnum(var); - } - - for (CodegenProperty var : cm.nonNullableVars) { - updateCodegenPropertyEnum(var); - } - - for (CodegenProperty var : cm.requiredVars) { - updateCodegenPropertyEnum(var); - } - - for (CodegenProperty var : cm.optionalVars) { - updateCodegenPropertyEnum(var); - } - - for (CodegenProperty var : cm.parentVars) { - updateCodegenPropertyEnum(var); - } - - for (CodegenProperty var : cm.readOnlyVars) { - updateCodegenPropertyEnum(var); - } - - for (CodegenProperty var : cm.readWriteVars) { - updateCodegenPropertyEnum(var); - } - - } - return objs; - } - - /** - * Returns the common prefix of variables for enum naming if - * two or more variables are present - * - * @param vars List of variable names - * @return the common prefix for naming - */ - public String findCommonPrefixOfVars(List vars) { - if (vars.size() > 1) { - try { - String[] listStr = vars.toArray(new String[vars.size()]); - String prefix = StringUtils.getCommonPrefix(listStr); - // exclude trailing characters that should be part of a valid variable - // e.g. ["status-on", "status-off"] => "status-" (not "status-o") - final Matcher matcher = COMMON_PREFIX_ENUM_NAME.matcher(prefix); - return matcher.replaceAll(""); - } catch (ArrayStoreException e) { - // do nothing, just return default value - } - } - return ""; - } - - /** - * Return the enum default value in the language specified format - * - * @param value enum variable name - * @param datatype data type - * @return the default value for the enum - */ - public String toEnumDefaultValue(String value, String datatype) { - return datatype + "." + value; - } - - /** - * Return the enum value in the language specified format - * e.g. status becomes "status" - * - * @param value enum variable name - * @param datatype data type - * @return the sanitized value for enum - */ - public String toEnumValue(String value, String datatype) { - if ("number".equalsIgnoreCase(datatype) || "boolean".equalsIgnoreCase(datatype)) { - return value; - } else { - return "\"" + escapeText(value) + "\""; - } - } - - /** - * Return the sanitized variable name for enum - * - * @param value enum variable name - * @param datatype data type - * @return the sanitized variable name for enum - */ - public String toEnumVarName(String value, String datatype) { - if (value.length() == 0) { - return "EMPTY"; - } - - String var = value.replaceAll("\\W+", "_").toUpperCase(Locale.ROOT); - if (var.matches("\\d.*")) { - return "_" + var; - } else { - return var; - } - } - - /** - * Set the OpenAPI document. - * This method is invoked when the input OpenAPI document has been parsed and validated. - */ - @Override - public void setOpenAPI(OpenAPI openAPI) { - String originalSpecVersion; - String xOriginalSwaggerVersion = "x-original-swagger-version"; - if (openAPI.getExtensions() != null && !openAPI.getExtensions().isEmpty() && openAPI.getExtensions().containsValue(xOriginalSwaggerVersion)) { - originalSpecVersion = (String) openAPI.getExtensions().get(xOriginalSwaggerVersion); - } else { - originalSpecVersion = openAPI.getOpenapi(); - } - Integer specMajorVersion = Integer.parseInt(originalSpecVersion.substring(0, 1)); - Integer specMinorVersion = Integer.parseInt(originalSpecVersion.substring(2, 3)); - boolean specVersionGreaterThanOrEqualTo310 = (specMajorVersion == 3 && specMinorVersion >= 1); - if (specVersionGreaterThanOrEqualTo310) { - LOGGER.warn(UNSUPPORTED_V310_SPEC_MSG); - } - this.openAPI = openAPI; - // Set global settings such that helper functions in ModelUtils can lookup the value - // of the CLI option. - ModelUtils.setDisallowAdditionalPropertiesIfNotPresent(getDisallowAdditionalPropertiesIfNotPresent()); - } - - // override with any message to be shown right before the process finishes - @Override - @SuppressWarnings("static-method") - public void postProcess() { - System.out.println("################################################################################"); - System.out.println("# Thanks for using OpenAPI Generator. #"); - System.out.println("# Please consider donation to help us maintain this project \uD83D\uDE4F #"); - System.out.println("# https://opencollective.com/openapi_generator/donate #"); - System.out.println("################################################################################"); - } - - // override with any special post-processing - @Override - @SuppressWarnings("static-method") - public OperationsMap postProcessOperationsWithModels(OperationsMap objs, List allModels) { - return objs; - } - - // override with any special post-processing - @Override - @SuppressWarnings("static-method") - public Map postProcessSupportingFileData(Map objs) { - return objs; - } - - // override to post-process any model properties - @Override - @SuppressWarnings("unused") - public void postProcessModelProperty(CodegenModel model, CodegenProperty property) { - } - - // override to post-process any parameters - @Override - @SuppressWarnings("unused") - public void postProcessParameter(CodegenParameter parameter) { - } - - //override with any special handling of the entire OpenAPI spec document - @Override - @SuppressWarnings("unused") - public void preprocessOpenAPI(OpenAPI openAPI) { - if (useOneOfInterfaces && openAPI.getComponents() != null) { - // we process the openapi schema here to find oneOf schemas and create interface models for them - Map schemas = new HashMap<>(openAPI.getComponents().getSchemas()); - if (schemas == null) { - schemas = new HashMap<>(); - } - Map pathItems = openAPI.getPaths(); - - // we need to add all request and response bodies to processed schemas - if (pathItems != null) { - for (Map.Entry e : pathItems.entrySet()) { - for (Map.Entry op : e.getValue().readOperationsMap().entrySet()) { - String opId = getOrGenerateOperationId(op.getValue(), e.getKey(), op.getKey().toString()); - // process request body - RequestBody b = ModelUtils.getReferencedRequestBody(openAPI, op.getValue().getRequestBody()); - Schema requestSchema = null; - if (b != null) { - requestSchema = ModelUtils.getSchemaFromRequestBody(b); - } - if (requestSchema != null) { - schemas.put(opId, requestSchema); - } - // process all response bodies - if (op.getValue().getResponses() != null) { - for (Map.Entry ar : op.getValue().getResponses().entrySet()) { - ApiResponse a = ModelUtils.getReferencedApiResponse(openAPI, ar.getValue()); - Schema responseSchema = ModelUtils.getSchemaFromResponse(a); - if (responseSchema != null) { - schemas.put(opId + ar.getKey(), responseSchema); - } - } - } - } - } - } - - // also add all properties of all schemas to be checked for oneOf - Map propertySchemas = new HashMap<>(); - for (Map.Entry e : schemas.entrySet()) { - Schema s = e.getValue(); - Map props = s.getProperties(); - if (props == null) { - props = new HashMap<>(); - } - for (Map.Entry p : props.entrySet()) { - propertySchemas.put(e.getKey() + "/" + p.getKey(), p.getValue()); - } - } - schemas.putAll(propertySchemas); - - // go through all gathered schemas and add them as interfaces to be created - for (Map.Entry e : schemas.entrySet()) { - String n = toModelName(e.getKey()); - Schema s = e.getValue(); - String nOneOf = toModelName(n + "OneOf"); - if (ModelUtils.isComposedSchema(s)) { - if (e.getKey().contains("/")) { - // if this is property schema, we also need to generate the oneOf interface model - addOneOfNameExtension((ComposedSchema) s, nOneOf); - addOneOfInterfaceModel((ComposedSchema) s, nOneOf, openAPI); - } else { - // else this is a component schema, so we will just use that as the oneOf interface model - addOneOfNameExtension((ComposedSchema) s, n); - } - } else if (ModelUtils.isArraySchema(s)) { - Schema items = ((ArraySchema) s).getItems(); - if (ModelUtils.isComposedSchema(items)) { - addOneOfNameExtension((ComposedSchema) items, nOneOf); - addOneOfInterfaceModel((ComposedSchema) items, nOneOf, openAPI); - } - } else if (ModelUtils.isMapSchema(s)) { - Schema addProps = getAdditionalProperties(s); - if (addProps != null && ModelUtils.isComposedSchema(addProps)) { - addOneOfNameExtension((ComposedSchema) addProps, nOneOf); - addOneOfInterfaceModel((ComposedSchema) addProps, nOneOf, openAPI); - } - } - } - } - } - - // override with any special handling of the entire OpenAPI spec document - @Override - @SuppressWarnings("unused") - public void processOpenAPI(OpenAPI openAPI) { - } - - // override with any special handling of the JMustache compiler - @Override - @SuppressWarnings("unused") - public Compiler processCompiler(Compiler compiler) { - return compiler; - } - - // override with any special handling for the templating engine - @Override - @SuppressWarnings("unused") - public TemplatingEngineAdapter processTemplatingEngine(TemplatingEngineAdapter templatingEngine) { - return templatingEngine; - } - - // override with any special text escaping logic - @Override - @SuppressWarnings("static-method") - public String escapeText(String input) { - if (input == null) { - return input; - } - - // remove \t, \n, \r - // replace \ with \\ - // replace " with \" - // outer unescape to retain the original multi-byte characters - // finally escalate characters avoiding code injection - return escapeUnsafeCharacters( - StringEscapeUtils.unescapeJava( - StringEscapeUtils.escapeJava(input) - .replace("\\/", "/")) - .replaceAll("[\\t\\n\\r]", " ") - .replace("\\", "\\\\") - .replace("\"", "\\\"")); - } - - /** - * Escape characters while allowing new lines - * - * @param input String to be escaped - * @return escaped string - */ - @Override - public String escapeTextWhileAllowingNewLines(String input) { - if (input == null) { - return input; - } - - // remove \t - // replace \ with \\ - // replace " with \" - // outer unescape to retain the original multi-byte characters - // finally escalate characters avoiding code injection - return escapeUnsafeCharacters( - StringEscapeUtils.unescapeJava( - StringEscapeUtils.escapeJava(input) - .replace("\\/", "/")) - .replaceAll("[\\t]", " ") - .replace("\\", "\\\\") - .replace("\"", "\\\"")); - } - - // override with any special encoding and escaping logic - @Override - @SuppressWarnings("static-method") - public String encodePath(String input) { - return escapeText(input); - } - - /** - * override with any special text escaping logic to handle unsafe - * characters so as to avoid code injection - * - * @param input String to be cleaned up - * @return string with unsafe characters removed or escaped - */ - @Override - public String escapeUnsafeCharacters(String input) { - LOGGER.warn("escapeUnsafeCharacters should be overridden in the code generator with proper logic to escape " + - "unsafe characters"); - // doing nothing by default and code generator should implement - // the logic to prevent code injection - // later we'll make this method abstract to make sure - // code generator implements this method - return input; - } - - /** - * Escape single and/or double quote to avoid code injection - * - * @param input String to be cleaned up - * @return string with quotation mark removed or escaped - */ - @Override - public String escapeQuotationMark(String input) { - LOGGER.warn("escapeQuotationMark should be overridden in the code generator with proper logic to escape " + - "single/double quote"); - return input.replace("\"", "\\\""); - } - - @Override - public Set defaultIncludes() { - return defaultIncludes; - } - - @Override - public Map typeMapping() { - return typeMapping; - } - - @Override - public Map instantiationTypes() { - return instantiationTypes; - } - - @Override - public Set reservedWords() { - return reservedWords; - } - - @Override - public Set languageSpecificPrimitives() { - return languageSpecificPrimitives; - } - - @Override - public Map importMapping() { - return importMapping; - } - - @Override - public Map schemaMapping() { - return schemaMapping; - } - - @Override - public Map inlineSchemaNameMapping() { - return inlineSchemaNameMapping; - } - - @Override - public Map inlineSchemaNameDefault() { - return inlineSchemaNameDefault; - } - - @Override - public String testPackage() { - return testPackage; - } - - @Override - public String modelPackage() { - return modelPackage; - } - - @Override - public String apiPackage() { - return apiPackage; - } - - @Override - public String fileSuffix() { - return fileSuffix; - } - - @Override - public String templateDir() { - return templateDir; - } - - @Override - public String embeddedTemplateDir() { - if (embeddedTemplateDir != null) { - return embeddedTemplateDir; - } else { - return templateDir; - } - } - - @Override - public Map apiDocTemplateFiles() { - return apiDocTemplateFiles; - } - - @Override - public Map modelDocTemplateFiles() { - return modelDocTemplateFiles; - } - - @Override - public Map reservedWordsMappings() { - return reservedWordsMappings; - } - - @Override - public Map apiTestTemplateFiles() { - return apiTestTemplateFiles; - } - - @Override - public Map modelTestTemplateFiles() { - return modelTestTemplateFiles; - } - - @Override - public Map apiTemplateFiles() { - return apiTemplateFiles; - } - - @Override - public Map modelTemplateFiles() { - return modelTemplateFiles; - } - - @Override - public String apiFileFolder() { - return outputFolder + File.separator + apiPackage().replace('.', File.separatorChar); - } - - @Override - public String modelFileFolder() { - return outputFolder + File.separator + modelPackage().replace('.', File.separatorChar); - } - - @Override - public String apiTestFileFolder() { - return outputFolder + File.separator + testPackage().replace('.', File.separatorChar); - } - - @Override - public String modelTestFileFolder() { - return outputFolder + File.separator + testPackage().replace('.', File.separatorChar); - } - - @Override - public String apiDocFileFolder() { - return outputFolder; - } - - @Override - public String modelDocFileFolder() { - return outputFolder; - } - - @Override - public Map additionalProperties() { - return additionalProperties; - } - - @Override - public Map serverVariableOverrides() { - return serverVariables; - } - - @Override - public Map vendorExtensions() { - return vendorExtensions; - } - - @Override - public List supportingFiles() { - return supportingFiles; - } - - @Override - public String outputFolder() { - return outputFolder; - } - - @Override - public void setOutputDir(String dir) { - this.outputFolder = dir; - } - - @Override - public String getOutputDir() { - return outputFolder(); - } - - @Override - public String getInputSpec() { - return inputSpec; - } - - @Override - public void setInputSpec(String inputSpec) { - this.inputSpec = inputSpec; - } - - @Override - public String getFilesMetadataFilename() { - return filesMetadataFilename; - } - - public void setFilesMetadataFilename(String filesMetadataFilename) { - this.filesMetadataFilename = filesMetadataFilename; - } - - @Override - public String getVersionMetadataFilename() { - return versionMetadataFilename; - } - - public void setVersionMetadataFilename(String versionMetadataFilename) { - this.versionMetadataFilename = versionMetadataFilename; - } - - public void setTemplateDir(String templateDir) { - this.templateDir = templateDir; - } - - public void setModelPackage(String modelPackage) { - this.modelPackage = modelPackage; - } - - public String getModelNamePrefix() { - return modelNamePrefix; - } - - public void setModelNamePrefix(String modelNamePrefix) { - this.modelNamePrefix = modelNamePrefix; - } - - public String getModelNameSuffix() { - return modelNameSuffix; - } - - public void setModelNameSuffix(String modelNameSuffix) { - this.modelNameSuffix = modelNameSuffix; - } - - public String getApiNameSuffix() { - return apiNameSuffix; - } - - public void setApiNameSuffix(String apiNameSuffix) { - this.apiNameSuffix = apiNameSuffix; - } - - public String getApiNamePrefix() { - return apiNamePrefix; - } - - public void setApiNamePrefix(String apiNamePrefix) { - this.apiNamePrefix = apiNamePrefix; - } - - public void setApiPackage(String apiPackage) { - this.apiPackage = apiPackage; - } - - public Boolean getSortParamsByRequiredFlag() { - return sortParamsByRequiredFlag; - } - - public void setSortParamsByRequiredFlag(Boolean sortParamsByRequiredFlag) { - this.sortParamsByRequiredFlag = sortParamsByRequiredFlag; - } - - public Boolean getSortModelPropertiesByRequiredFlag() { - return sortModelPropertiesByRequiredFlag; - } - - public void setSortModelPropertiesByRequiredFlag(Boolean sortModelPropertiesByRequiredFlag) { - this.sortModelPropertiesByRequiredFlag = sortModelPropertiesByRequiredFlag; - } - - public Boolean getPrependFormOrBodyParameters() { - return prependFormOrBodyParameters; - } - - public void setPrependFormOrBodyParameters(Boolean prependFormOrBodyParameters) { - this.prependFormOrBodyParameters = prependFormOrBodyParameters; - } - - public Boolean getEnsureUniqueParams() { - return ensureUniqueParams; - } - - public void setEnsureUniqueParams(Boolean ensureUniqueParams) { - this.ensureUniqueParams = ensureUniqueParams; - } - - public Boolean getLegacyDiscriminatorBehavior() { - return legacyDiscriminatorBehavior; - } - - public void setLegacyDiscriminatorBehavior(boolean val) { - this.legacyDiscriminatorBehavior = val; - } - - public Boolean getDisallowAdditionalPropertiesIfNotPresent() { - return disallowAdditionalPropertiesIfNotPresent; - } - - public void setDisallowAdditionalPropertiesIfNotPresent(boolean val) { - this.disallowAdditionalPropertiesIfNotPresent = val; - } - - public Boolean getEnumUnknownDefaultCase() { - return enumUnknownDefaultCase; - } - - public void setEnumUnknownDefaultCase(boolean val) { - this.enumUnknownDefaultCase = val; - } - - public Boolean getAllowUnicodeIdentifiers() { - return allowUnicodeIdentifiers; - } - - public void setAllowUnicodeIdentifiers(Boolean allowUnicodeIdentifiers) { - this.allowUnicodeIdentifiers = allowUnicodeIdentifiers; - } - - public Boolean getUseOneOfInterfaces() { - return useOneOfInterfaces; - } - - public void setUseOneOfInterfaces(Boolean useOneOfInterfaces) { - this.useOneOfInterfaces = useOneOfInterfaces; - } - - /** - * Return the regular expression/JSON schema pattern (http://json-schema.org/latest/json-schema-validation.html#anchor33) - * - * @param pattern the pattern (regular expression) - * @return properly-escaped pattern - */ - public String toRegularExpression(String pattern) { - return addRegularExpressionDelimiter(escapeText(pattern)); - } - - /** - * Return the file name of the Api Test - * - * @param name the file name of the Api - * @return the file name of the Api - */ - @Override - public String toApiFilename(String name) { - return toApiName(name); - } - - /** - * Return the file name of the Api Documentation - * - * @param name the file name of the Api - * @return the file name of the Api - */ - @Override - public String toApiDocFilename(String name) { - return toApiName(name); - } - - /** - * Return the file name of the Api Test - * - * @param name the file name of the Api - * @return the file name of the Api - */ - @Override - public String toApiTestFilename(String name) { - return toApiName(name) + "Test"; - } - - /** - * Return the variable name in the Api - * - * @param name the variable name of the Api - * @return the snake-cased variable name - */ - @Override - public String toApiVarName(String name) { - return lowerCamelCase(name); - } - - /** - * Return the capitalized file name of the model - * - * @param name the model name - * @return the file name of the model - */ - @Override - public String toModelFilename(String name) { - return camelize(name); - } - - /** - * Return the capitalized file name of the model test - * - * @param name the model name - * @return the file name of the model - */ - @Override - public String toModelTestFilename(String name) { - return camelize(name) + "Test"; - } - - /** - * Return the capitalized file name of the model documentation - * - * @param name the model name - * @return the file name of the model - */ - @Override - public String toModelDocFilename(String name) { - return camelize(name); - } - - /** - * Returns metadata about the generator. - * - * @return A provided {@link GeneratorMetadata} instance - */ - @Override - public GeneratorMetadata getGeneratorMetadata() { - return generatorMetadata; - } - - /** - * Return the operation ID (method name) - * - * @param operationId operation ID - * @return the sanitized method name - */ - @SuppressWarnings("static-method") - public String toOperationId(String operationId) { - // throw exception if method name is empty - if (StringUtils.isEmpty(operationId)) { - throw new RuntimeException("Empty method name (operationId) not allowed"); - } - - return operationId; - } - - /** - * Return the variable name by removing invalid characters and proper escaping if - * it's a reserved word. - * - * @param name the variable name - * @return the sanitized variable name - */ - public String toVarName(final String name) { - if (reservedWords.contains(name)) { - return escapeReservedWord(name); - } else if (name.chars().anyMatch(character -> specialCharReplacements.containsKey(String.valueOf((char) character)))) { - return escape(name, specialCharReplacements, null, null); - } - return name; - } - - /** - * Return the parameter name by removing invalid characters and proper escaping if - * it's a reserved word. - * - * @param name Codegen property object - * @return the sanitized parameter name - */ - @Override - public String toParamName(String name) { - name = removeNonNameElementToCamelCase(name); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'. - if (reservedWords.contains(name)) { - return escapeReservedWord(name); - } else if (name.chars().anyMatch(character -> specialCharReplacements.containsKey(String.valueOf((char) character)))) { - return escape(name, specialCharReplacements, null, null); - } - return name; - - } - - /** - * Return the parameter name of array of model - * - * @param name name of the array model - * @return the sanitized parameter name - */ - public String toArrayModelParamName(String name) { - return toParamName(name); - } - - /** - * Return the Enum name (e.g. StatusEnum given 'status') - * - * @param property Codegen property - * @return the Enum name - */ - @SuppressWarnings("static-method") - public String toEnumName(CodegenProperty property) { - return StringUtils.capitalize(property.name) + "Enum"; - } - - /** - * Return the escaped name of the reserved word - * - * @param name the name to be escaped - * @return the escaped reserved word - *

    - * throws Runtime exception as reserved word is not allowed (default behavior) - */ - @Override - @SuppressWarnings("static-method") - public String escapeReservedWord(String name) { - throw new RuntimeException("reserved word " + name + " not allowed"); - } - - /** - * Return the fully-qualified "Model" name for import - * - * @param name the name of the "Model" - * @return the fully-qualified "Model" name for import - */ - @Override - public String toModelImport(String name) { - if ("".equals(modelPackage())) { - return name; - } else { - return modelPackage() + "." + name; - } - } - - /** - * Returns the same content as [[toModelImport]] with key the fully-qualified Model name and value the initial input. - * In case of union types this method has a key for each separate model and import. - * - * @param name the name of the "Model" - * @return Map of fully-qualified models. - */ - @Override - public Map toModelImportMap(String name) { - return Collections.singletonMap(this.toModelImport(name), name); - } - - /** - * Return the fully-qualified "Api" name for import - * - * @param name the name of the "Api" - * @return the fully-qualified "Api" name for import - */ - @Override - public String toApiImport(String name) { - return apiPackage() + "." + name; - } - - /** - * Default constructor. - * This method will map between OAS type and language-specified type, as well as mapping - * between OAS type and the corresponding import statement for the language. This will - * also add some language specified CLI options, if any. - * returns string presentation of the example path (it's a constructor) - */ - public DefaultCodegen() { - CodegenType codegenType = getTag(); - if (codegenType == null) { - codegenType = CodegenType.OTHER; - } - - generatorMetadata = GeneratorMetadata.newBuilder() - .stability(Stability.STABLE) - .featureSet(DefaultFeatureSet) - .generationMessage(String.format(Locale.ROOT, "OpenAPI Generator: %s (%s)", getName(), codegenType.toValue())) - .build(); - - defaultIncludes = new HashSet<>( - Arrays.asList("double", - "int", - "long", - "short", - "char", - "float", - "String", - "boolean", - "Boolean", - "Double", - "Void", - "Integer", - "Long", - "Float") - ); - - typeMapping = new HashMap<>(); - typeMapping.put("array", "List"); - typeMapping.put("set", "Set"); - typeMapping.put("map", "Map"); - typeMapping.put("boolean", "Boolean"); - typeMapping.put("string", "String"); - typeMapping.put("int", "Integer"); - typeMapping.put("float", "Float"); - typeMapping.put("double", "Double"); - typeMapping.put("number", "BigDecimal"); - typeMapping.put("decimal", "BigDecimal"); - typeMapping.put("DateTime", "Date"); - typeMapping.put("long", "Long"); - typeMapping.put("short", "Short"); - typeMapping.put("char", "String"); - typeMapping.put("object", "Object"); - typeMapping.put("integer", "Integer"); - // FIXME: java specific type should be in Java Based Abstract Impl's - typeMapping.put("ByteArray", "byte[]"); - typeMapping.put("binary", "File"); - typeMapping.put("file", "File"); - typeMapping.put("UUID", "UUID"); - typeMapping.put("URI", "URI"); - typeMapping.put("AnyType", "oas_any_type_not_mapped"); - - instantiationTypes = new HashMap<>(); - - reservedWords = new HashSet<>(); - - cliOptions.add(CliOption.newBoolean(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, - CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG_DESC).defaultValue(Boolean.TRUE.toString())); - cliOptions.add(CliOption.newBoolean(CodegenConstants.SORT_MODEL_PROPERTIES_BY_REQUIRED_FLAG, - CodegenConstants.SORT_MODEL_PROPERTIES_BY_REQUIRED_FLAG_DESC).defaultValue(Boolean.TRUE.toString())); - cliOptions.add(CliOption.newBoolean(CodegenConstants.ENSURE_UNIQUE_PARAMS, CodegenConstants - .ENSURE_UNIQUE_PARAMS_DESC).defaultValue(Boolean.TRUE.toString())); - // name formatting options - cliOptions.add(CliOption.newBoolean(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, CodegenConstants - .ALLOW_UNICODE_IDENTIFIERS_DESC).defaultValue(Boolean.FALSE.toString())); - // option to change the order of form/body parameter - cliOptions.add(CliOption.newBoolean(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, - CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS_DESC).defaultValue(Boolean.FALSE.toString())); - - // option to change how we process + set the data in the discriminator mapping - CliOption legacyDiscriminatorBehaviorOpt = CliOption.newBoolean(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR_DESC).defaultValue(Boolean.TRUE.toString()); - Map legacyDiscriminatorBehaviorOpts = new HashMap<>(); - legacyDiscriminatorBehaviorOpts.put("true", "The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document."); - legacyDiscriminatorBehaviorOpts.put("false", "The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing."); - legacyDiscriminatorBehaviorOpt.setEnum(legacyDiscriminatorBehaviorOpts); - cliOptions.add(legacyDiscriminatorBehaviorOpt); - - // option to change how we process + set the data in the 'additionalProperties' keyword. - CliOption disallowAdditionalPropertiesIfNotPresentOpt = CliOption.newBoolean( - CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, - CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT_DESC).defaultValue(Boolean.TRUE.toString()); - Map disallowAdditionalPropertiesIfNotPresentOpts = new HashMap<>(); - disallowAdditionalPropertiesIfNotPresentOpts.put("false", - "The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications."); - disallowAdditionalPropertiesIfNotPresentOpts.put("true", - "Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default."); - disallowAdditionalPropertiesIfNotPresentOpt.setEnum(disallowAdditionalPropertiesIfNotPresentOpts); - cliOptions.add(disallowAdditionalPropertiesIfNotPresentOpt); - this.setDisallowAdditionalPropertiesIfNotPresent(true); - - CliOption enumUnknownDefaultCaseOpt = CliOption.newBoolean( - CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, - CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE_DESC).defaultValue(Boolean.FALSE.toString()); - Map enumUnknownDefaultCaseOpts = new HashMap<>(); - enumUnknownDefaultCaseOpts.put("false", - "No changes to the enum's are made, this is the default option."); - enumUnknownDefaultCaseOpts.put("true", - "With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case."); - enumUnknownDefaultCaseOpt.setEnum(enumUnknownDefaultCaseOpts); - cliOptions.add(enumUnknownDefaultCaseOpt); - this.setEnumUnknownDefaultCase(false); - - // initialize special character mapping - initializeSpecialCharacterMapping(); - - // Register common Mustache lambdas. - registerMustacheLambdas(); - } - - /** - * Initialize special character mapping - */ - protected void initializeSpecialCharacterMapping() { - // Initialize special characters - specialCharReplacements.put("$", "Dollar"); - specialCharReplacements.put("^", "Caret"); - specialCharReplacements.put("|", "Pipe"); - specialCharReplacements.put("=", "Equal"); - specialCharReplacements.put("*", "Star"); - specialCharReplacements.put("-", "Minus"); - specialCharReplacements.put("&", "Ampersand"); - specialCharReplacements.put("%", "Percent"); - specialCharReplacements.put("#", "Hash"); - specialCharReplacements.put("@", "At"); - specialCharReplacements.put("!", "Exclamation"); - specialCharReplacements.put("+", "Plus"); - specialCharReplacements.put(":", "Colon"); - specialCharReplacements.put(";", "Semicolon"); - specialCharReplacements.put(">", "Greater_Than"); - specialCharReplacements.put("<", "Less_Than"); - specialCharReplacements.put(".", "Period"); - specialCharReplacements.put("_", "Underscore"); - specialCharReplacements.put("?", "Question_Mark"); - specialCharReplacements.put(",", "Comma"); - specialCharReplacements.put("'", "Quote"); - specialCharReplacements.put("\"", "Double_Quote"); - specialCharReplacements.put("/", "Slash"); - specialCharReplacements.put("\\", "Back_Slash"); - specialCharReplacements.put("(", "Left_Parenthesis"); - specialCharReplacements.put(")", "Right_Parenthesis"); - specialCharReplacements.put("{", "Left_Curly_Bracket"); - specialCharReplacements.put("}", "Right_Curly_Bracket"); - specialCharReplacements.put("[", "Left_Square_Bracket"); - specialCharReplacements.put("]", "Right_Square_Bracket"); - specialCharReplacements.put("~", "Tilde"); - specialCharReplacements.put("`", "Backtick"); - - specialCharReplacements.put("<=", "Less_Than_Or_Equal_To"); - specialCharReplacements.put(">=", "Greater_Than_Or_Equal_To"); - specialCharReplacements.put("!=", "Not_Equal"); - specialCharReplacements.put("<>", "Not_Equal"); - specialCharReplacements.put("~=", "Tilde_Equal"); - } - - /** - * Return the symbol name of a symbol - * - * @param input Symbol (e.g. $) - * @return Symbol name (e.g. Dollar) - */ - protected String getSymbolName(String input) { - return specialCharReplacements.get(input); - } - - /** - * Return the example path - * - * @param path the path of the operation - * @param operation OAS operation object - * @return string presentation of the example path - */ - @Override - @SuppressWarnings("static-method") - public String generateExamplePath(String path, Operation operation) { - StringBuilder sb = new StringBuilder(); - sb.append(path); - - if (operation.getParameters() != null) { - int count = 0; - - for (Parameter param : operation.getParameters()) { - if (param instanceof QueryParameter) { - StringBuilder paramPart = new StringBuilder(); - QueryParameter qp = (QueryParameter) param; - - if (count == 0) { - paramPart.append("?"); - } else { - paramPart.append(","); - } - count += 1; - if (!param.getRequired()) { - paramPart.append("["); - } - paramPart.append(param.getName()).append("="); - paramPart.append("{"); - - // TODO support for multi, tsv? - if (qp.getStyle() != null) { - paramPart.append(param.getName()).append("1"); - if (Parameter.StyleEnum.FORM.equals(qp.getStyle())) { - if (qp.getExplode() != null && qp.getExplode()) { - paramPart.append(","); - } else { - paramPart.append("&").append(param.getName()).append("="); - paramPart.append(param.getName()).append("2"); - } - } else if (Parameter.StyleEnum.PIPEDELIMITED.equals(qp.getStyle())) { - paramPart.append("|"); - } else if (Parameter.StyleEnum.SPACEDELIMITED.equals(qp.getStyle())) { - paramPart.append("%20"); - } else { - LOGGER.warn("query parameter '{}' style not support: {}", param.getName(), qp.getStyle()); - } - } else { - paramPart.append(param.getName()); - } - - paramPart.append("}"); - if (!param.getRequired()) { - paramPart.append("]"); - } - sb.append(paramPart); - } - } - } - - return sb.toString(); - } - - /** - * Return the instantiation type of the property, especially for map and array - * - * @param schema property schema - * @return string presentation of the instantiation type of the property - */ - public String toInstantiationType(Schema schema) { - if (ModelUtils.isMapSchema(schema)) { - Schema additionalProperties = getAdditionalProperties(schema); - String inner = getSchemaType(additionalProperties); - return instantiationTypes.get("map") + ""; - } else if (ModelUtils.isArraySchema(schema)) { - ArraySchema arraySchema = (ArraySchema) schema; - String inner = getSchemaType(getSchemaItems(arraySchema)); - String parentType; - if (ModelUtils.isSet(schema)) { - parentType = "set"; - } else { - parentType = "array"; - } - return instantiationTypes.get(parentType) + "<" + inner + ">"; - } else { - return null; - } - } - - /** - * Return the example value of the parameter. - * - * @param codegenParameter Codegen parameter - */ - public void setParameterExampleValue(CodegenParameter codegenParameter) { - - // set the example value - // if not specified in x-example, generate a default value - // TODO need to revise how to obtain the example value - if (codegenParameter.vendorExtensions != null && codegenParameter.vendorExtensions.containsKey("x-example")) { - codegenParameter.example = Json.pretty(codegenParameter.vendorExtensions.get("x-example")); - } else if (Boolean.TRUE.equals(codegenParameter.isBoolean)) { - codegenParameter.example = "true"; - } else if (Boolean.TRUE.equals(codegenParameter.isLong)) { - codegenParameter.example = "789"; - } else if (Boolean.TRUE.equals(codegenParameter.isInteger)) { - codegenParameter.example = "56"; - } else if (Boolean.TRUE.equals(codegenParameter.isFloat)) { - codegenParameter.example = "3.4"; - } else if (Boolean.TRUE.equals(codegenParameter.isDouble)) { - codegenParameter.example = "1.2"; - } else if (Boolean.TRUE.equals(codegenParameter.isNumber)) { - codegenParameter.example = "8.14"; - } else if (Boolean.TRUE.equals(codegenParameter.isBinary)) { - codegenParameter.example = "BINARY_DATA_HERE"; - } else if (Boolean.TRUE.equals(codegenParameter.isByteArray)) { - codegenParameter.example = "BYTE_ARRAY_DATA_HERE"; - } else if (Boolean.TRUE.equals(codegenParameter.isFile)) { - codegenParameter.example = "/path/to/file.txt"; - } else if (Boolean.TRUE.equals(codegenParameter.isDate)) { - codegenParameter.example = "2013-10-20"; - } else if (Boolean.TRUE.equals(codegenParameter.isDateTime)) { - codegenParameter.example = "2013-10-20T19:20:30+01:00"; - } else if (Boolean.TRUE.equals(codegenParameter.isUuid)) { - codegenParameter.example = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; - } else if (Boolean.TRUE.equals(codegenParameter.isUri)) { - codegenParameter.example = "https://openapi-generator.tech"; - } else if (Boolean.TRUE.equals(codegenParameter.isString)) { - codegenParameter.example = codegenParameter.paramName + "_example"; - } else if (Boolean.TRUE.equals(codegenParameter.isFreeFormObject)) { - codegenParameter.example = "Object"; - } - - } - - /** - * Return the example value of the parameter. - * - * @param codegenParameter Codegen parameter - * @param parameter Parameter - */ - public void setParameterExampleValue(CodegenParameter codegenParameter, Parameter parameter) { - if (parameter.getExample() != null) { - codegenParameter.example = parameter.getExample().toString(); - return; - } - - if (parameter.getExamples() != null && !parameter.getExamples().isEmpty()) { - Example example = parameter.getExamples().values().iterator().next(); - if (example.getValue() != null) { - codegenParameter.example = example.getValue().toString(); - return; - } - } - - Schema schema = parameter.getSchema(); - if (schema != null && schema.getExample() != null) { - codegenParameter.example = schema.getExample().toString(); - return; - } - - setParameterExampleValue(codegenParameter); - } - - /** - * Return the example value of the parameter. - * - * @param codegenParameter Codegen parameter - * @param requestBody Request body - */ - public void setParameterExampleValue(CodegenParameter codegenParameter, RequestBody requestBody) { - Content content = requestBody.getContent(); - - if (content.size() > 1) { - // @see ModelUtils.getSchemaFromContent() - once(LOGGER).warn("Multiple MediaTypes found, using only the first one"); - } - - MediaType mediaType = content.values().iterator().next(); - if (mediaType.getExample() != null) { - codegenParameter.example = mediaType.getExample().toString(); - return; - } - - if (mediaType.getExamples() != null && !mediaType.getExamples().isEmpty()) { - Example example = mediaType.getExamples().values().iterator().next(); - if (example.getValue() != null) { - codegenParameter.example = example.getValue().toString(); - return; - } - } - - setParameterExampleValue(codegenParameter); - } - - /** - * Sets the content type, style, and explode of the parameter based on the encoding specified - * in the request body. - * - * @param codegenParameter Codegen parameter - * @param mediaType MediaType from the request body - */ - public void setParameterEncodingValues(CodegenParameter codegenParameter, MediaType mediaType) { - if (mediaType != null && mediaType.getEncoding() != null) { - Encoding encoding = mediaType.getEncoding().get(codegenParameter.baseName); - if (encoding != null) { - boolean styleGiven = true; - Encoding.StyleEnum style = encoding.getStyle(); - if(style == null || style == Encoding.StyleEnum.FORM) { - // (Unfortunately, swagger-parser-v3 will always provide 'form' - // when style is not specified, so we can't detect that) - style = Encoding.StyleEnum.FORM; - styleGiven = false; - } - boolean explodeGiven = true; - Boolean explode = encoding.getExplode(); - if(explode == null) { - explode = style == Encoding.StyleEnum.FORM; // Default to True when form, False otherwise - explodeGiven = false; - } - - if(!styleGiven && !explodeGiven) { - // Ignore contentType if style or explode are specified. - codegenParameter.contentType = encoding.getContentType(); - } - - codegenParameter.style = style.toString(); - codegenParameter.isDeepObject = Encoding.StyleEnum.DEEP_OBJECT == style; - - if(codegenParameter.isContainer) { - codegenParameter.isExplode = explode; - String collectionFormat = getCollectionFormat(codegenParameter); - codegenParameter.collectionFormat = StringUtils.isEmpty(collectionFormat) ? "csv" : collectionFormat; - codegenParameter.isCollectionFormatMulti = "multi".equals(collectionFormat); - } else { - codegenParameter.isExplode = false; - codegenParameter.collectionFormat = null; - codegenParameter.isCollectionFormatMulti = false; - } - } else { - LOGGER.debug("encoding not specified for {}", codegenParameter.baseName); - } - } - } - - /** - * Return the example value of the property - * - * @param schema Property schema - * @return string presentation of the example value of the property - */ - public String toExampleValue(Schema schema) { - if (schema.getExample() != null) { - return schema.getExample().toString(); - } - - return getPropertyDefaultValue(schema); - } - - /** - * Return the default value of the property - *

    - * Return null if you do NOT want a default value. - * Any non-null value will cause {{#defaultValue} check to pass. - * - * @param schema Property schema - * @return string presentation of the default value of the property - */ - @SuppressWarnings("static-method") - public String toDefaultValue(Schema schema) { - if (schema.getDefault() != null) { - return schema.getDefault().toString(); - } - - return getPropertyDefaultValue(schema); - } - - /** - * Return the default value of the parameter - *

    - * Return null if you do NOT want a default value. - * Any non-null value will cause {{#defaultValue} check to pass. - * - * @param schema Parameter schema - * @return string presentation of the default value of the parameter - */ - public String toDefaultParameterValue(Schema schema) { - // by default works as original method to be backward compatible - return toDefaultValue(schema); - } - - /** - * Return property value depending on property type. - * - * @param schema property type - * @return property value - */ - @SuppressWarnings("squid:S3923") - private String getPropertyDefaultValue(Schema schema) { - /* - * Although all branches return null, this is left intentionally as examples for new contributors - */ - if (ModelUtils.isBooleanSchema(schema)) { - return "null"; - } else if (ModelUtils.isDateSchema(schema)) { - return "null"; - } else if (ModelUtils.isDateTimeSchema(schema)) { - return "null"; - } else if (ModelUtils.isNumberSchema(schema)) { - return "null"; - } else if (ModelUtils.isIntegerSchema(schema)) { - return "null"; - } else if (ModelUtils.isStringSchema(schema)) { - return "null"; - } else if (ModelUtils.isObjectSchema(schema)) { - return "null"; - } else { - return "null"; - } - } - - /** - * Return the property initialized from a data object - * Useful for initialization with a plain object in Javascript - * - * @param name Name of the property object - * @param schema Property schema - * @return string presentation of the default value of the property - */ - @SuppressWarnings("static-method") - public String toDefaultValueWithParam(String name, Schema schema) { - return " = data." + name + ";"; - } - - /** - * returns the OpenAPI type for the property. Use getAlias to handle $ref of primitive type - * - * @param schema property schema - * @return string presentation of the type - **/ - @SuppressWarnings("static-method") - public String getSchemaType(Schema schema) { - if (schema instanceof ComposedSchema) { // composed schema - ComposedSchema cs = (ComposedSchema) schema; - // Get the interfaces, i.e. the set of elements under 'allOf', 'anyOf' or 'oneOf'. - List schemas = ModelUtils.getInterfaces(cs); - - List names = new ArrayList<>(); - // Build a list of the schema types under each interface. - // For example, if a 'allOf' composed schema has $ref children, - // add the type of each child to the list of names. - for (Schema s : schemas) { - names.add(getSingleSchemaType(s)); - } - - if (cs.getAllOf() != null) { - return toAllOfName(names, cs); - } else if (cs.getAnyOf() != null) { // anyOf - return toAnyOfName(names, cs); - } else if (cs.getOneOf() != null) { // oneOf - return toOneOfName(names, cs); - } - } - - return getSingleSchemaType(schema); - - } - - protected Schema getSchemaItems(ArraySchema schema) { - Schema items = schema.getItems(); - if (items == null) { - LOGGER.error("Undefined array inner type for `{}`. Default to String.", schema.getName()); - items = new StringSchema().description("TODO default missing array inner type to string"); - schema.setItems(items); - } - return items; - } - - protected Schema getSchemaAdditionalProperties(Schema schema) { - Schema inner = getAdditionalProperties(schema); - if (inner == null) { - LOGGER.error("`{}` (map property) does not have a proper inner type defined. Default to type:string", schema.getName()); - inner = new StringSchema().description("TODO default missing map inner type to string"); - schema.setAdditionalProperties(inner); - } - return inner; - } - - /** - * Return the name of the 'allOf' composed schema. - * - * @param names List of names - * @param composedSchema composed schema - * @return name of the allOf schema - */ - @SuppressWarnings("static-method") - public String toAllOfName(List names, ComposedSchema composedSchema) { - Map exts = composedSchema.getExtensions(); - if (exts != null && exts.containsKey("x-all-of-name")) { - return (String) exts.get("x-all-of-name"); - } - if (names.size() == 0) { - LOGGER.error("allOf has no member defined: {}. Default to ERROR_ALLOF_SCHEMA", composedSchema); - return "ERROR_ALLOF_SCHEMA"; - } else if (names.size() == 1) { - return names.get(0); - } else { - LOGGER.warn("allOf with multiple schemas defined. Using only the first one: {}", names.get(0)); - return names.get(0); - } - } - - /** - * Return the name of the anyOf schema - * - * @param names List of names - * @param composedSchema composed schema - * @return name of the anyOf schema - */ - @SuppressWarnings("static-method") - public String toAnyOfName(List names, ComposedSchema composedSchema) { - return "anyOf<" + String.join(",", names) + ">"; - } - - /** - * Return the name of the oneOf schema. - *

    - * This name is used to set the value of CodegenProperty.openApiType. - *

    - * If the 'x-one-of-name' extension is specified in the OAS document, return that value. - * Otherwise, a name is constructed by creating a comma-separated list of all the names - * of the oneOf schemas. - * - * @param names List of names - * @param composedSchema composed schema - * @return name of the oneOf schema - */ - @SuppressWarnings("static-method") - public String toOneOfName(List names, ComposedSchema composedSchema) { - Map exts = composedSchema.getExtensions(); - if (exts != null && exts.containsKey("x-one-of-name")) { - return (String) exts.get("x-one-of-name"); - } - return "oneOf<" + String.join(",", names) + ">"; - } - - @Override - public Schema unaliasSchema(Schema schema) { - return ModelUtils.unaliasSchema(this.openAPI, schema, schemaMapping); - } - - /** - * Return a string representation of the schema type, resolving aliasing and references if necessary. - * - * @param schema input - * @return the string representation of the schema type. - */ - protected String getSingleSchemaType(Schema schema) { - Schema unaliasSchema = unaliasSchema(schema); - - if (StringUtils.isNotBlank(unaliasSchema.get$ref())) { // reference to another definition/schema - // get the schema/model name from $ref - String schemaName = ModelUtils.getSimpleRef(unaliasSchema.get$ref()); - if (StringUtils.isNotEmpty(schemaName)) { - if (schemaMapping.containsKey(schemaName)) { - return schemaName; - } - return getAlias(schemaName); - } else { - LOGGER.warn("Error obtaining the datatype from ref: {}. Default to 'object'", unaliasSchema.get$ref()); - return "object"; - } - } else { // primitive type or model - return getAlias(getPrimitiveType(unaliasSchema)); - } - } - - /** - * Return the OAI type (e.g. integer, long, etc) corresponding to a schema. - *

    $ref
    is not taken into account by this method. - *

    - * If the schema is free-form (i.e. 'type: object' with no properties) or inline - * schema, the returned OAI type is 'object'. - * - * @param schema - * @return type - */ - private String getPrimitiveType(Schema schema) { - if (schema == null) { - throw new RuntimeException("schema cannot be null in getPrimitiveType"); - } else if (typeMapping.containsKey(schema.getType() + "+" + schema.getFormat())) { - // allows custom type_format mapping. - // use {type}+{format} - return typeMapping.get(schema.getType() + "+" + schema.getFormat()); - } else if (ModelUtils.isNullType(schema)) { - // The 'null' type is allowed in OAS 3.1 and above. It is not supported by OAS 3.0.x, - // though this tooling supports it. - return "null"; - } else if (ModelUtils.isDecimalSchema(schema)) { - // special handle of type: string, format: number - return "decimal"; - } else if (ModelUtils.isByteArraySchema(schema)) { - return "ByteArray"; - } else if (ModelUtils.isFileSchema(schema)) { - return "file"; - } else if (ModelUtils.isBinarySchema(schema)) { - return SchemaTypeUtil.BINARY_FORMAT; - } else if (ModelUtils.isBooleanSchema(schema)) { - return SchemaTypeUtil.BOOLEAN_TYPE; - } else if (ModelUtils.isDateSchema(schema)) { - return SchemaTypeUtil.DATE_FORMAT; - } else if (ModelUtils.isDateTimeSchema(schema)) { - return "DateTime"; - } else if (ModelUtils.isNumberSchema(schema)) { - if (schema.getFormat() == null) { // no format defined - return "number"; - } else if (ModelUtils.isFloatSchema(schema)) { - return SchemaTypeUtil.FLOAT_FORMAT; - } else if (ModelUtils.isDoubleSchema(schema)) { - return SchemaTypeUtil.DOUBLE_FORMAT; - } else { - LOGGER.warn("Unknown `format` {} detected for type `number`. Defaulting to `number`", schema.getFormat()); - return "number"; - } - } else if (ModelUtils.isIntegerSchema(schema)) { - if (ModelUtils.isLongSchema(schema)) { - return "long"; - } else { - return schema.getType(); // integer - } - } else if (ModelUtils.isMapSchema(schema)) { - return "map"; - } else if (ModelUtils.isArraySchema(schema)) { - if (ModelUtils.isSet(schema)) { - return "set"; - } else { - return "array"; - } - } else if (ModelUtils.isUUIDSchema(schema)) { - return "UUID"; - } else if (ModelUtils.isURISchema(schema)) { - return "URI"; - } else if (ModelUtils.isStringSchema(schema)) { - if (typeMapping.containsKey(schema.getFormat())) { - // If the format matches a typeMapping (supplied with the --typeMappings flag) - // then treat the format as a primitive type. - // This allows the typeMapping flag to add a new custom type which can then - // be used in the format field. - return schema.getFormat(); - } - return "string"; - } else if (isFreeFormObject(schema)) { - // Note: the value of a free-form object cannot be an arbitrary type. Per OAS specification, - // it must be a map of string to values. - return "object"; - } else if (schema.getProperties() != null && !schema.getProperties().isEmpty()) { // having property implies it's a model - return "object"; - } else if (ModelUtils.isAnyType(schema)) { - return "AnyType"; - } else if (StringUtils.isNotEmpty(schema.getType())) { - if (!schemaMapping.containsKey(schema.getType())) { - LOGGER.warn("Unknown type found in the schema: {}. To map it, please use the schema mapping option (e.g. --schema-mappings in CLI)", schema.getType()); - } - return schema.getType(); - } - // The 'type' attribute has not been set in the OAS schema, which means the value - // can be an arbitrary type, e.g. integer, string, object, array, number... - // TODO: we should return a different value to distinguish between free-form object - // and arbitrary type. - return "object"; - } - - /** - * Return the lowerCamelCase of the string - * - * @param name string to be lowerCamelCased - * @return lowerCamelCase string - */ - @SuppressWarnings("static-method") - public String lowerCamelCase(String name) { - return (name.length() > 0) ? (Character.toLowerCase(name.charAt(0)) + name.substring(1)) : ""; - } - - /** - * Output the language-specific type declaration of a given OAS name. - * - * @param name name - * @return a string presentation of the type - */ - @Override - @SuppressWarnings("static-method") - public String getTypeDeclaration(String name) { - return name; - } - - /** - * Output the language-specific type declaration of the property. - * - * @param schema property schema - * @return a string presentation of the property type - */ - @Override - public String getTypeDeclaration(Schema schema) { - if (schema == null) { - LOGGER.warn("Null schema found. Default type to `NULL_SCHEMA_ERR`"); - return "NULL_SCHEMA_ERR"; - } - - String oasType = getSchemaType(schema); - if (typeMapping.containsKey(oasType)) { - return typeMapping.get(oasType); - } - - return oasType; - } - - /** - * Determine the type alias for the given type if it exists. This feature - * was originally developed for Java because the language does not have an aliasing - * mechanism of its own but later extends to handle other languages - * - * @param name The type name. - * @return The alias of the given type, if it exists. If there is no alias - * for this type, then returns the input type name. - */ - public String getAlias(String name) { - if (typeAliases != null && typeAliases.containsKey(name)) { - return typeAliases.get(name); - } - return name; - } - - /** - * Output the Getter name for boolean property, e.g. getActive - * - * @param name the name of the property - * @return getter name based on naming convention - */ - @Override - public String toBooleanGetter(String name) { - return "get" + getterAndSetterCapitalize(name); - } - - /** - * Output the Getter name, e.g. getSize - * - * @param name the name of the property - * @return getter name based on naming convention - */ - @Override - public String toGetter(String name) { - return "get" + getterAndSetterCapitalize(name); - } - - /** - * Output the Setter name, e.g. setSize - * - * @param name the name of the property - * @return setter name based on naming convention - */ - @Override - public String toSetter(String name) { - return "set" + getterAndSetterCapitalize(name); - } - - /** - * Output the API (class) name (capitalized) ending with the specified or default suffix - * Return DefaultApi if name is empty - * - * @param name the name of the Api - * @return capitalized Api name - */ - @Override - public String toApiName(String name) { - if (name.length() == 0) { - return "DefaultApi"; - } - return camelize(apiNamePrefix + "_" + name + "_" + apiNameSuffix); - } - - /** - * Converts the OpenAPI schema name to a model name suitable for the current code generator. - * May be overridden for each programming language. - * In case the name belongs to the TypeSystem it won't be renamed. - * - * @param name the name of the model - * @return capitalized model name - */ - @Override - public String toModelName(final String name) { - if (schemaKeyToModelNameCache.containsKey(name)) { - return schemaKeyToModelNameCache.get(name); - } - - String camelizedName = camelize(modelNamePrefix + "_" + name + "_" + modelNameSuffix); - schemaKeyToModelNameCache.put(name, camelizedName); - return camelizedName; - } - - private static class NamedSchema { - private NamedSchema(String name, Schema s, boolean required, boolean schemaIsFromAdditionalProperties) { - this.name = name; - this.schema = s; - this.required = required; - this.schemaIsFromAdditionalProperties = schemaIsFromAdditionalProperties; - } - - private String name; - private Schema schema; - private boolean required; - private boolean schemaIsFromAdditionalProperties; - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - NamedSchema that = (NamedSchema) o; - return Objects.equals(required, that.required) && - Objects.equals(name, that.name) && - Objects.equals(schema, that.schema) && - Objects.equals(schemaIsFromAdditionalProperties, that.schemaIsFromAdditionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(name, schema, required, schemaIsFromAdditionalProperties); - } - } - - Map schemaCodegenPropertyCache = new HashMap<>(); - - protected void updateModelForComposedSchema(CodegenModel m, Schema schema, Map allDefinitions) { - final ComposedSchema composed = (ComposedSchema) schema; - Map properties = new LinkedHashMap<>(); - List required = new ArrayList<>(); - Map allProperties = new LinkedHashMap<>(); - List allRequired = new ArrayList<>(); - - // if schema has properties outside of allOf/oneOf/anyOf also add them to m - if (composed.getProperties() != null && !composed.getProperties().isEmpty()) { - if (composed.getOneOf() != null && !composed.getOneOf().isEmpty()) { - LOGGER.warn("'oneOf' is intended to include only the additional optional OAS extension discriminator object. " + - "For more details, see https://json-schema.org/draft/2019-09/json-schema-core.html#rfc.section.9.2.1.3 and the OAS section on 'Composition and Inheritance'."); - } - addVars(m, unaliasPropertySchema(composed.getProperties()), composed.getRequired(), null, null); - } - - // parent model - final String parentName = ModelUtils.getParentName(composed, allDefinitions); - final List allParents = ModelUtils.getAllParentsName(composed, allDefinitions, false); - final Schema parent = StringUtils.isBlank(parentName) || allDefinitions == null ? null : allDefinitions.get(parentName); - - // TODO revise the logic below to set discriminator, xml attributes - if (supportsInheritance || supportsMixins) { - m.allVars = new ArrayList<>(); - if (composed.getAllOf() != null) { - int modelImplCnt = 0; // only one inline object allowed in a ComposedModel - int modelDiscriminators = 0; // only one discriminator allowed in a ComposedModel - for (Schema innerSchema : composed.getAllOf()) { // TODO need to work with anyOf, oneOf as well - if (m.discriminator == null && innerSchema.getDiscriminator() != null) { - LOGGER.debug("discriminator is set to null (not correctly set earlier): {}", m.name); - m.setDiscriminator(createDiscriminator(m.name, innerSchema, this.openAPI)); - if (!this.getLegacyDiscriminatorBehavior()) { - m.addDiscriminatorMappedModelsImports(); - } - modelDiscriminators++; - } - - if (innerSchema.getXml() != null) { - m.xmlPrefix = innerSchema.getXml().getPrefix(); - m.xmlNamespace = innerSchema.getXml().getNamespace(); - m.xmlName = innerSchema.getXml().getName(); - } - if (modelDiscriminators > 1) { - LOGGER.error("Allof composed schema is inheriting >1 discriminator. Only use one discriminator: {}", composed); - } - - if (modelImplCnt++ > 1) { - LOGGER.warn("More than one inline schema specified in allOf:. Only the first one is recognized. All others are ignored."); - break; // only one schema with discriminator allowed in allOf - } - } - } - } - - // interfaces (schemas defined in allOf, anyOf, oneOf) - List interfaces = ModelUtils.getInterfaces(composed); - if (!interfaces.isEmpty()) { - // m.interfaces is for backward compatibility - if (m.interfaces == null) - m.interfaces = new ArrayList<>(); - - for (Schema interfaceSchema : interfaces) { - interfaceSchema = unaliasSchema(interfaceSchema); - - if (StringUtils.isBlank(interfaceSchema.get$ref())) { - // primitive type - String languageType = getTypeDeclaration(interfaceSchema); - CodegenProperty interfaceProperty = fromProperty(languageType, interfaceSchema, false); - if (ModelUtils.isArraySchema(interfaceSchema) || ModelUtils.isMapSchema(interfaceSchema)) { - while (interfaceProperty != null) { - addImport(m, interfaceProperty.complexType); - interfaceProperty = interfaceProperty.items; - } - } - - if (composed.getAnyOf() != null) { - if (m.anyOf.contains(languageType)) { - LOGGER.warn("{} (anyOf schema) already has `{}` defined and therefore it's skipped.", m.name, languageType); - } else { - m.anyOf.add(languageType); - - } - } else if (composed.getOneOf() != null) { - if (m.oneOf.contains(languageType)) { - LOGGER.warn("{} (oneOf schema) already has `{}` defined and therefore it's skipped.", m.name, languageType); - } else { - m.oneOf.add(languageType); - } - } else if (composed.getAllOf() != null) { - // no need to add primitive type to allOf, which should comprise of schemas (models) only - } else { - LOGGER.error("Composed schema has incorrect anyOf, allOf, oneOf defined: {}", composed); - } - continue; - } - - // the rest of the section is for model - Schema refSchema = null; - String ref = ModelUtils.getSimpleRef(interfaceSchema.get$ref()); - if (allDefinitions != null) { - refSchema = allDefinitions.get(ref); - } - final String modelName = toModelName(ref); - CodegenProperty interfaceProperty = fromProperty(modelName, interfaceSchema, false); - m.interfaces.add(modelName); - addImport(composed, refSchema, m, modelName); - - if (allDefinitions != null && refSchema != null) { - if (allParents.contains(ref) && supportsMultipleInheritance) { - // multiple inheritance - addProperties(allProperties, allRequired, refSchema, new HashSet<>()); - } else if (parentName != null && parentName.equals(ref) && supportsInheritance) { - // single inheritance - addProperties(allProperties, allRequired, refSchema, new HashSet<>()); - } else { - // composition - addProperties(properties, required, refSchema, new HashSet<>()); - addProperties(allProperties, allRequired, refSchema, new HashSet<>()); - } - } - - if (composed.getAnyOf() != null) { - m.anyOf.add(modelName); - } else if (composed.getOneOf() != null) { - m.oneOf.add(modelName); - } else if (composed.getAllOf() != null) { - m.allOf.add(modelName); - } else { - LOGGER.error("Composed schema has incorrect anyOf, allOf, oneOf defined: {}", composed); - } - } - } - - if (parent != null && composed.getAllOf() != null) { // set parent for allOf only - m.parentSchema = parentName; - m.parent = toModelName(parentName); - - if (supportsMultipleInheritance) { - m.allParents = new ArrayList<>(); - for (String pname : allParents) { - String pModelName = toModelName(pname); - m.allParents.add(pModelName); - addImport(m, pModelName); - } - } else { // single inheritance - addImport(m, m.parent); - } - } - - // child schema (properties owned by the schema itself) - for (Schema component : interfaces) { - if (component.get$ref() == null) { - if (component != null) { - // component is the child schema - addProperties(properties, required, component, new HashSet<>()); - - // includes child's properties (all, required) in allProperties, allRequired - addProperties(allProperties, allRequired, component, new HashSet<>()); - } - break; // at most one child only - } - } - - if (composed.getRequired() != null) { - required.addAll(composed.getRequired()); - allRequired.addAll(composed.getRequired()); - } - - addVars(m, unaliasPropertySchema(properties), required, unaliasPropertySchema(allProperties), allRequired); - - // Per OAS specification, composed schemas may use the 'additionalProperties' keyword. - if (supportsAdditionalPropertiesWithComposedSchema) { - // Process the schema specified with the 'additionalProperties' keyword. - // This will set the 'CodegenModel.additionalPropertiesType' field - // and potentially 'Codegen.parent'. - // - // Note: it's not a good idea to use single class inheritance to implement - // the 'additionalProperties' keyword. Code generators that use single class - // inheritance sometimes use the 'Codegen.parent' field to implement the - // 'additionalProperties' keyword. However, that would be in conflict with - // 'allOf' composed schemas, because these code generators also want to set - // 'Codegen.parent' to the first child schema of the 'allOf' schema. - addAdditionPropertiesToCodeGenModel(m, schema); - } - - if (Boolean.TRUE.equals(schema.getNullable())) { - m.isNullable = Boolean.TRUE; - } - // end of code block for composed schema - } - - protected void updateModelForObject(CodegenModel m, Schema schema) { - if (schema.getProperties() != null || schema.getRequired() != null && !(schema instanceof ComposedSchema)) { - // passing null to allProperties and allRequired as there's no parent - addVars(m, unaliasPropertySchema(schema.getProperties()), schema.getRequired(), null, null); - } - if (ModelUtils.isMapSchema(schema)) { - // an object or anyType composed schema that has additionalProperties set - addAdditionPropertiesToCodeGenModel(m, schema); - } else if (ModelUtils.isFreeFormObject(openAPI, schema)) { - // non-composed object type with no properties + additionalProperties - // additionalProperties must be null, ObjectSchema, or empty Schema - addAdditionPropertiesToCodeGenModel(m, schema); - } - // process 'additionalProperties' - setAddProps(schema, m); - addRequiredVarsMap(schema, m); - } - - protected void updateModelForAnyType(CodegenModel m, Schema schema) { - // The 'null' value is allowed when the OAS schema is 'any type'. - // See https://github.com/OAI/OpenAPI-Specification/issues/1389 - if (Boolean.FALSE.equals(schema.getNullable())) { - LOGGER.error("Schema '{}' is any type, which includes the 'null' value. 'nullable' cannot be set to 'false'", m.name); - } - // m.isNullable = true; - if (ModelUtils.isMapSchema(schema)) { - // an object or anyType composed schema that has additionalProperties set - addAdditionPropertiesToCodeGenModel(m, schema); - m.isMap = true; - } - if (schema.getProperties() != null || schema.getRequired() != null && !(schema instanceof ComposedSchema)) { - // passing null to allProperties and allRequired as there's no parent - addVars(m, unaliasPropertySchema(schema.getProperties()), schema.getRequired(), null, null); - } - // process 'additionalProperties' - setAddProps(schema, m); - addRequiredVarsMap(schema, m); - } - - protected String toTestCaseName(String specTestCaseName) { - return specTestCaseName; - } - - /** - * A method that allows generators to pre-process test example payloads - * This can be useful if one needs to change how values like null in string are represnted - * @param data the test data payload - * @return the updated test data payload - */ - protected Object processTestExampleData(Object data) { - return data; - } - - /** - * Processes any test cases if they exist in the components.x-test-examples vendor extensions - * If they exist then cast them to java class instances and return them back in a map - * @param refToTestCases the component schema name that the test cases are for - */ - private HashMap extractSchemaTestCases(String refToTestCases) { - // schemaName to a map of test case name to test case - HashMap vendorExtensions = (HashMap) openAPI.getComponents().getExtensions(); - if (vendorExtensions == null || !vendorExtensions.containsKey(xSchemaTestExamplesKey)) { - return null; - } - if (!refToTestCases.startsWith(xSchemaTestExamplesRefPrefix)) { - return null; - } - String schemaName = refToTestCases.substring(xSchemaTestExamplesRefPrefix.length()); - HashMap schemaTestCases = new HashMap<>(); - LinkedHashMap schemaNameToTestCases = (LinkedHashMap) vendorExtensions.get(xSchemaTestExamplesKey); - - if (!schemaNameToTestCases.containsKey(schemaName)) { - return null; - } - LinkedHashMap> testNameToTesCase = (LinkedHashMap>) schemaNameToTestCases.get(schemaName); - for (Entry> entry: testNameToTesCase.entrySet()) { - LinkedHashMap testExample = (LinkedHashMap) entry.getValue(); - String nameInSnakeCase = toTestCaseName(entry.getKey()); - Object data = processTestExampleData(testExample.get("data")); - SchemaTestCase testCase = new SchemaTestCase( - (String) testExample.getOrDefault("description", ""), - new ObjectWithTypeBooleans(data), - (boolean) testExample.get("valid") - ); - schemaTestCases.put(nameInSnakeCase, testCase); - } - return schemaTestCases; - } - - /** - * Sets the booleans that define the model's type - * - * @param model the model to update - * @param schema the model's schema - */ - protected void updateModelForString(CodegenModel model, Schema schema) { - // NOTE: String schemas as CodegenModel is a rare use case and may be removed at a later date. - if (ModelUtils.isDateTimeSchema(schema)) { - // NOTE: DateTime schemas as CodegenModel is a rare use case and may be removed at a later date. - model.setIsString(false); // for backward compatibility with 2.x - model.isDateTime = Boolean.TRUE; - } else if (ModelUtils.isDateSchema(schema)) { - // NOTE: Date schemas as CodegenModel is a rare use case and may be removed at a later date. - model.setIsString(false); // for backward compatibility with 2.x - model.isDate = Boolean.TRUE; - } else if (ModelUtils.isUUIDSchema(schema)) { - // NOTE: UUID schemas as CodegenModel is a rare use case and may be removed at a later date. - model.setIsString(false); - model.setIsUuid(true); - } - } - - protected void updateModelForNumber(CodegenModel model, Schema schema) { - // NOTE: Number schemas as CodegenModel is a rare use case and may be removed at a later date. - model.isNumeric = Boolean.TRUE; - if (ModelUtils.isFloatSchema(schema)) { // float - model.isFloat = Boolean.TRUE; - } else if (ModelUtils.isDoubleSchema(schema)) { // double - model.isDouble = Boolean.TRUE; - } - } - - protected void updateModelForInteger(CodegenModel model, Schema schema) { - // NOTE: Integral schemas as CodegenModel is a rare use case and may be removed at a later date. - model.isNumeric = Boolean.TRUE; - if (ModelUtils.isLongSchema(schema)) { // int64/long format - model.isLong = Boolean.TRUE; - } else { - model.isInteger = Boolean.TRUE; // older use case, int32 and unbounded int - if (ModelUtils.isShortSchema(schema)) { // int32 - model.setIsShort(Boolean.TRUE); - } - } - } - - /** - * Convert OAS Model object to Codegen Model object. - * - * @param name the name of the model - * @param schema OAS Model object - * @return Codegen Model object - */ - @Override - public CodegenModel fromModel(String name, Schema schema) { - Map allDefinitions = ModelUtils.getSchemas(this.openAPI); - if (typeAliases == null) { - // Only do this once during first call - typeAliases = getAllAliases(allDefinitions); - } - - CodegenModel m = CodegenModelFactory.newInstance(CodegenModelType.MODEL); - if (schema.equals(trueSchema)) { - m.setIsBooleanSchemaTrue(true); - } else if (schema.equals(falseSchema)) { - m.setIsBooleanSchemaFalse(true); - } - // unalias schema - schema = unaliasSchema(schema); - if (schema == null) { - LOGGER.warn("Schema {} not found", name); - return null; - } - - ModelUtils.syncValidationProperties(schema, m); - if (openAPI != null) { - HashMap schemaTestCases = extractSchemaTestCases(xSchemaTestExamplesRefPrefix + name); - m.testCases = schemaTestCases; - } - - if (reservedWords.contains(name)) { - m.name = escapeReservedWord(name); - } else { - m.name = name; - } - m.title = escapeText(schema.getTitle()); - m.description = escapeText(schema.getDescription()); - m.unescapedDescription = schema.getDescription(); - m.classname = toModelName(name); - m.classVarName = toVarName(name); - m.classFilename = toModelFilename(name); - m.modelJson = Json.pretty(schema); - m.externalDocumentation = schema.getExternalDocs(); - if (schema.getExtensions() != null && !schema.getExtensions().isEmpty()) { - m.getVendorExtensions().putAll(schema.getExtensions()); - } - m.isAlias = (typeAliases.containsKey(name) - || isAliasOfSimpleTypes(schema)); // check if the unaliased schema is an alias of simple OAS types - m.setDiscriminator(createDiscriminator(name, schema, this.openAPI)); - if (!this.getLegacyDiscriminatorBehavior()) { - m.addDiscriminatorMappedModelsImports(); - } - - if (schema.getDeprecated() != null) { - m.isDeprecated = schema.getDeprecated(); - } - - if (schema.getXml() != null) { - m.xmlPrefix = schema.getXml().getPrefix(); - m.xmlNamespace = schema.getXml().getNamespace(); - m.xmlName = schema.getXml().getName(); - } - if (!ModelUtils.isAnyType(schema) && !ModelUtils.isTypeObjectSchema(schema) && !ModelUtils.isArraySchema(schema) && schema.get$ref() == null && schema.getEnum() != null && !schema.getEnum().isEmpty()) { - // TODO remove the anyType check here in the future ANyType models can have enums defined - m.isEnum = true; - // comment out below as allowableValues is not set in post processing model enum - m.allowableValues = new HashMap<>(); - m.allowableValues.put("values", schema.getEnum()); - } - if (!ModelUtils.isArraySchema(schema)) { - m.dataType = getSchemaType(schema); - } - if (!ModelUtils.isAnyType(schema) && Boolean.TRUE.equals(schema.getNullable())) { - m.isNullable = Boolean.TRUE; - } - - m.setTypeProperties(schema); - m.setFormat(schema.getFormat()); - m.setComposedSchemas(getComposedSchemas(schema)); - if (ModelUtils.isArraySchema(schema)) { - CodegenProperty arrayProperty = fromProperty(name, schema, false); - m.setItems(arrayProperty.items); - m.arrayModelType = arrayProperty.complexType; - addParentContainer(m, name, schema); - } else if (ModelUtils.isIntegerSchema(schema)) { // integer type - updateModelForInteger(m, schema); - } else if (ModelUtils.isStringSchema(schema)) { - updateModelForString(m, schema); - } else if (ModelUtils.isNumberSchema(schema)) { - updateModelForNumber(m, schema); - } else if (ModelUtils.isAnyType(schema)) { - updateModelForAnyType(m, schema); - } else if (ModelUtils.isTypeObjectSchema(schema)) { - updateModelForObject(m, schema); - } else if (!ModelUtils.isNullType(schema)) { - // referenced models here, component that refs another component which is a model - // if a component references a schema which is not a generated model, the refed schema will be loaded into - // schema by unaliasSchema and one of the above code paths will be taken - ; - } - if (schema.get$ref() != null) { - m.setRef(schema.get$ref()); - } - - if (schema instanceof ComposedSchema) { - updateModelForComposedSchema(m, schema, allDefinitions); - } - - // remove duplicated properties - m.removeAllDuplicatedProperty(); - - // set isDiscriminator on the discriminator property - if (m.discriminator != null) { - String discPropName = m.discriminator.getPropertyBaseName(); - List> listOLists = new ArrayList<>(); - listOLists.add(m.requiredVars); - listOLists.add(m.vars); - listOLists.add(m.allVars); - for (List theseVars : listOLists) { - for (CodegenProperty requiredVar : theseVars) { - if (discPropName.equals(requiredVar.baseName)) { - requiredVar.isDiscriminator = true; - } - } - } - } - - if (m.requiredVars != null && m.requiredVars.size() > 0) { - m.setHasRequired(true); - } - - if (sortModelPropertiesByRequiredFlag) { - Comparator comparator = new Comparator() { - @Override - public int compare(CodegenProperty one, CodegenProperty another) { - if (one.required == another.required) return 0; - else if (one.required) return -1; - else return 1; - } - }; - Collections.sort(m.vars, comparator); - Collections.sort(m.allVars, comparator); - } - - // post process model properties - if (m.vars != null) { - for (CodegenProperty prop : m.vars) { - postProcessModelProperty(m, prop); - } - m.hasVars = m.vars.size() > 0; - } - if (m.allVars != null) { - for (CodegenProperty prop : m.allVars) { - postProcessModelProperty(m, prop); - } - } - - if (addSchemaImportsFromV3SpecLocations) { - addImports(m.imports, m.getImports(importContainerType, importBaseType, generatorMetadata.getFeatureSet())); - } - return m; - } - - protected void setAddProps(Schema schema, IJsonSchemaValidationProperties property) { - if (schema.equals(new Schema())) { - // if we are trying to set additionalProperties on an empty schema stop recursing - return; - } - boolean additionalPropertiesIsAnyType = false; - CodegenModel m = null; - if (property instanceof CodegenModel) { - m = (CodegenModel) property; - } - CodegenProperty addPropProp = null; - boolean isAdditionalPropertiesTrue = false; - if (schema.getAdditionalProperties() == null) { - if (!disallowAdditionalPropertiesIfNotPresent) { - isAdditionalPropertiesTrue = true; - addPropProp = fromProperty(getAdditionalPropertiesName(), new Schema(), false); - additionalPropertiesIsAnyType = true; - } - } else if (schema.getAdditionalProperties() instanceof Boolean) { - if (Boolean.TRUE.equals(schema.getAdditionalProperties())) { - isAdditionalPropertiesTrue = true; - addPropProp = fromProperty(getAdditionalPropertiesName(), new Schema(), false); - additionalPropertiesIsAnyType = true; - } - } else { - addPropProp = fromProperty(getAdditionalPropertiesName(), (Schema) schema.getAdditionalProperties(), false); - if (ModelUtils.isAnyType((Schema) schema.getAdditionalProperties())) { - additionalPropertiesIsAnyType = true; - } - } - if (additionalPropertiesIsAnyType) { - property.setAdditionalPropertiesIsAnyType(true); - } - if (m != null && isAdditionalPropertiesTrue) { - m.isAdditionalPropertiesTrue = true; - } - if (ModelUtils.isComposedSchema(schema) && !supportsAdditionalPropertiesWithComposedSchema) { - return; - } - if (addPropProp != null) { - property.setAdditionalProperties(addPropProp); - } - } - - /** - * Recursively look in Schema sc for the discriminator discPropName - * and return a CodegenProperty with the dataType and required params set - * the returned CodegenProperty may not be required and it may not be of type string - * - * @param composedSchemaName The name of the sc Schema - * @param sc The Schema that may contain the discriminator - * @param discPropName The String that is the discriminator propertyName in the schema - */ - private CodegenProperty discriminatorFound(String composedSchemaName, Schema sc, String discPropName, OpenAPI openAPI) { - Schema refSchema = ModelUtils.getReferencedSchema(openAPI, sc); - if (refSchema.getProperties() != null && refSchema.getProperties().get(discPropName) != null) { - Schema discSchema = (Schema) refSchema.getProperties().get(discPropName); - CodegenProperty cp = new CodegenProperty(); - if (ModelUtils.isStringSchema(discSchema)) { - cp.isString = true; - } - cp.setRequired(false); - if (refSchema.getRequired() != null && refSchema.getRequired().contains(discPropName)) { - cp.setRequired(true); - } - return cp; - } - if (ModelUtils.isComposedSchema(refSchema)) { - ComposedSchema composedSchema = (ComposedSchema) refSchema; - if (composedSchema.getAllOf() != null) { - // If our discriminator is in one of the allOf schemas break when we find it - for (Schema allOf : composedSchema.getAllOf()) { - CodegenProperty cp = discriminatorFound(composedSchemaName, allOf, discPropName, openAPI); - if (cp != null) { - return cp; - } - } - } - if (composedSchema.getOneOf() != null && composedSchema.getOneOf().size() != 0) { - // All oneOf definitions must contain the discriminator - CodegenProperty cp = new CodegenProperty(); - for (Schema oneOf : composedSchema.getOneOf()) { - String modelName = ModelUtils.getSimpleRef(oneOf.get$ref()); - CodegenProperty thisCp = discriminatorFound(composedSchemaName, oneOf, discPropName, openAPI); - if (thisCp == null) { - LOGGER.warn( - "'{}' defines discriminator '{}', but the referenced OneOf schema '{}' is missing {}", - composedSchemaName, discPropName, modelName, discPropName); - } - if (cp != null && cp.dataType == null) { - cp = thisCp; - continue; - } - if (cp != thisCp) { - LOGGER.warn( - "'{}' defines discriminator '{}', but the OneOf schema '{}' has a different {} definition than the prior OneOf schema's. Make sure the {} type and required values are the same", - composedSchemaName, discPropName, modelName, discPropName, discPropName); - } - } - return cp; - } - if (composedSchema.getAnyOf() != null && composedSchema.getAnyOf().size() != 0) { - // All anyOf definitions must contain the discriminator because a min of one must be selected - CodegenProperty cp = new CodegenProperty(); - for (Schema anyOf : composedSchema.getAnyOf()) { - String modelName = ModelUtils.getSimpleRef(anyOf.get$ref()); - CodegenProperty thisCp = discriminatorFound(composedSchemaName, anyOf, discPropName, openAPI); - if (thisCp == null) { - LOGGER.warn( - "'{}' defines discriminator '{}', but the referenced AnyOf schema '{}' is missing {}", - composedSchemaName, discPropName, modelName, discPropName); - } - if (cp != null && cp.dataType == null) { - cp = thisCp; - continue; - } - if (cp != thisCp) { - LOGGER.warn( - "'{}' defines discriminator '{}', but the AnyOf schema '{}' has a different {} definition than the prior AnyOf schema's. Make sure the {} type and required values are the same", - composedSchemaName, discPropName, modelName, discPropName, discPropName); - } - } - return cp; - - } - } - return null; - } - - /** - * Recursively look in Schema sc for the discriminator and return it - * Schema sc location - * OpenAPI openAPI the spec where we are searching for the discriminator - * - * @param sc The Schema that may contain the discriminator - */ - private Discriminator recursiveGetDiscriminator(Schema sc, OpenAPI openAPI) { - Schema refSchema = ModelUtils.getReferencedSchema(openAPI, sc); - Discriminator foundDisc = refSchema.getDiscriminator(); - if (foundDisc != null) { - return foundDisc; - } - - if (this.getLegacyDiscriminatorBehavior()) { - return null; - } - Discriminator disc = new Discriminator(); - if (ModelUtils.isComposedSchema(refSchema)) { - ComposedSchema composedSchema = (ComposedSchema) refSchema; - if (composedSchema.getAllOf() != null) { - // If our discriminator is in one of the allOf schemas break when we find it - for (Schema allOf : composedSchema.getAllOf()) { - foundDisc = recursiveGetDiscriminator(allOf, openAPI); - if (foundDisc != null) { - disc.setPropertyName(foundDisc.getPropertyName()); - disc.setMapping(foundDisc.getMapping()); - return disc; - } - } - } - if (composedSchema.getOneOf() != null && composedSchema.getOneOf().size() != 0) { - // All oneOf definitions must contain the discriminator - Integer hasDiscriminatorCnt = 0; - Integer hasNullTypeCnt = 0; - Set discriminatorsPropNames = new HashSet<>(); - for (Schema oneOf : composedSchema.getOneOf()) { - if (ModelUtils.isNullType(oneOf)) { - // The null type does not have a discriminator. Skip. - hasNullTypeCnt++; - continue; - } - foundDisc = recursiveGetDiscriminator(oneOf, openAPI); - if (foundDisc != null) { - discriminatorsPropNames.add(foundDisc.getPropertyName()); - hasDiscriminatorCnt++; - } - } - if (discriminatorsPropNames.size() > 1) { - LOGGER.warn("The oneOf schemas have conflicting discriminator property names. " + - "oneOf schemas must have the same property name, but found " + String.join(", ", discriminatorsPropNames)); - } - if (foundDisc != null && (hasDiscriminatorCnt + hasNullTypeCnt) == composedSchema.getOneOf().size() && discriminatorsPropNames.size() == 1) { - disc.setPropertyName(foundDisc.getPropertyName()); - disc.setMapping(foundDisc.getMapping()); - return disc; - } - // If the scenario when oneOf has two children and one of them is the 'null' type, - // there is no need for a discriminator. - } - if (composedSchema.getAnyOf() != null && composedSchema.getAnyOf().size() != 0) { - // All anyOf definitions must contain the discriminator because a min of one must be selected - Integer hasDiscriminatorCnt = 0; - Integer hasNullTypeCnt = 0; - Set discriminatorsPropNames = new HashSet<>(); - for (Schema anyOf : composedSchema.getAnyOf()) { - if (ModelUtils.isNullType(anyOf)) { - // The null type does not have a discriminator. Skip. - hasNullTypeCnt++; - continue; - } - foundDisc = recursiveGetDiscriminator(anyOf, openAPI); - if (foundDisc != null) { - discriminatorsPropNames.add(foundDisc.getPropertyName()); - hasDiscriminatorCnt++; - } - } - if (discriminatorsPropNames.size() > 1) { - LOGGER.warn("The anyOf schemas have conflicting discriminator property names. " + - "anyOf schemas must have the same property name, but found " + String.join(", ", discriminatorsPropNames)); - } - if (foundDisc != null && (hasDiscriminatorCnt + hasNullTypeCnt) == composedSchema.getAnyOf().size() && discriminatorsPropNames.size() == 1) { - disc.setPropertyName(foundDisc.getPropertyName()); - disc.setMapping(foundDisc.getMapping()); - return disc; - } - // If the scenario when anyOf has two children and one of them is the 'null' type, - // there is no need for a discriminator. - } - } - return null; - } - - /** - * This function is only used for composed schemas which have a discriminator - * Process oneOf and anyOf models in a composed schema and adds them into - * a list if the oneOf and anyOf models contain - * the required discriminator. If they don't contain the required - * discriminator or the discriminator is the wrong type then an error is - * thrown - * - * @param composedSchemaName The String model name of the composed schema where we are setting the discriminator map - * @param discPropName The String that is the discriminator propertyName in the schema - * @param c The ComposedSchema that contains the discriminator and oneOf/anyOf schemas - * @param openAPI The OpenAPI spec that we are using - * @return the list of oneOf and anyOf MappedModel that need to be added to the discriminator map - */ - protected List getOneOfAnyOfDescendants(String composedSchemaName, String discPropName, ComposedSchema c, OpenAPI openAPI) { - ArrayList> listOLists = new ArrayList<>(); - listOLists.add(c.getOneOf()); - listOLists.add(c.getAnyOf()); - List descendentSchemas = new ArrayList<>(); - for (List schemaList : listOLists) { - if (schemaList == null) { - continue; - } - for (Schema sc : schemaList) { - if (ModelUtils.isNullType(sc)) { - continue; - } - String ref = sc.get$ref(); - if (ref == null) { - // for schemas with no ref, it is not possible to build the discriminator map - // because ref is how we get the model name - // we only hit this use case for a schema with inline composed schemas, and one of those - // schemas also has inline composed schemas - // Note: if it is only inline one level, then the inline model resolver will move it into its own - // schema and make it a $ref schema in the oneOf/anyOf location - LOGGER.warn( - "Invalid inline schema defined in oneOf/anyOf in '{}'. Per the OpenApi spec, for this case when a composed schema defines a discriminator, the oneOf/anyOf schemas must use $ref. Change this inline definition to a $ref definition", - composedSchemaName); - } - CodegenProperty df = discriminatorFound(composedSchemaName, sc, discPropName, openAPI); - String modelName = ModelUtils.getSimpleRef(ref); - if (df == null || !df.isString || df.required != true) { - String msgSuffix = ""; - if (df == null) { - msgSuffix += discPropName + " is missing from the schema, define it as required and type string"; - } else { - if (!df.isString) { - msgSuffix += "invalid type for " + discPropName + ", set it to string"; - } - if (df.required != true) { - String spacer = ""; - if (msgSuffix.length() != 0) { - spacer = ". "; - } - msgSuffix += spacer + "invalid optional definition of " + discPropName + ", include it in required"; - } - } - LOGGER.warn("'{}' defines discriminator '{}', but the referenced schema '{}' is incorrect. {}", - composedSchemaName, discPropName, modelName, msgSuffix); - } - MappedModel mm = new MappedModel(modelName, toModelName(modelName)); - descendentSchemas.add(mm); - Schema cs = ModelUtils.getSchema(openAPI, modelName); - if (cs == null) { // cannot lookup the model based on the name - LOGGER.error("Failed to lookup the schema '{}' when processing oneOf/anyOf. Please check to ensure it's defined properly.", modelName); - } else { - Map vendorExtensions = cs.getExtensions(); - if (vendorExtensions != null && !vendorExtensions.isEmpty() && vendorExtensions.containsKey("x-discriminator-value")) { - String xDiscriminatorValue = (String) vendorExtensions.get("x-discriminator-value"); - mm = new MappedModel(xDiscriminatorValue, toModelName(modelName)); - descendentSchemas.add(mm); - } - } - } - } - return descendentSchemas; - } - - protected List getAllOfDescendants(String thisSchemaName, OpenAPI openAPI) { - ArrayList queue = new ArrayList(); - List descendentSchemas = new ArrayList(); - Map schemas = ModelUtils.getSchemas(openAPI); - String currentSchemaName = thisSchemaName; - Set keys = schemas.keySet(); - - int count = 0; - // hack: avoid infinite loop on potential self-references in event our checks fail. - while (100000 > count++) { - for (String childName : keys) { - if (childName.equals(thisSchemaName)) { - continue; - } - Schema child = schemas.get(childName); - if (ModelUtils.isComposedSchema(child)) { - ComposedSchema composedChild = (ComposedSchema) child; - List parents = composedChild.getAllOf(); - if (parents != null) { - for (Schema parent : parents) { - String ref = parent.get$ref(); - if (ref == null) { - // for schemas with no ref, it is not possible to build the discriminator map - // because ref is how we get the model name - // we hit this use case when an allOf composed schema contains an inline schema - continue; - } - String parentName = ModelUtils.getSimpleRef(ref); - if (parentName != null && parentName.equals(currentSchemaName)) { - if (queue.contains(childName) || descendentSchemas.stream().anyMatch(i -> childName.equals(i.getMappingName()))) { - throw new RuntimeException("Stack overflow hit when looking for " + thisSchemaName + " an infinite loop starting and ending at " + childName + " was seen"); - } - queue.add(childName); - break; - } - } - } - } - } - if (queue.size() == 0) { - break; - } - currentSchemaName = queue.remove(0); - MappedModel mm = new MappedModel(currentSchemaName, toModelName(currentSchemaName)); - descendentSchemas.add(mm); - Schema cs = schemas.get(currentSchemaName); - Map vendorExtensions = cs.getExtensions(); - if (vendorExtensions != null && !vendorExtensions.isEmpty() && vendorExtensions.containsKey("x-discriminator-value")) { - String xDiscriminatorValue = (String) vendorExtensions.get("x-discriminator-value"); - mm = new MappedModel(xDiscriminatorValue, toModelName(currentSchemaName)); - descendentSchemas.add(mm); - } - } - return descendentSchemas; - } - - protected CodegenDiscriminator createDiscriminator(String schemaName, Schema schema, OpenAPI openAPI) { - Discriminator sourceDiscriminator = recursiveGetDiscriminator(schema, openAPI); - if (sourceDiscriminator == null) { - return null; - } - CodegenDiscriminator discriminator = new CodegenDiscriminator(); - String discPropName = sourceDiscriminator.getPropertyName(); - discriminator.setPropertyName(toVarName(discPropName)); - discriminator.setPropertyBaseName(sourceDiscriminator.getPropertyName()); - discriminator.setPropertyGetter(toGetter(discriminator.getPropertyName())); - - // FIXME: for now, we assume that the discriminator property is String - discriminator.setPropertyType(typeMapping.get("string")); - - // check to see if the discriminator property is an enum string - if (schema.getProperties() != null && - schema.getProperties().get(discPropName) instanceof StringSchema) { - StringSchema s = (StringSchema) schema.getProperties().get(discPropName); - if (s.getEnum() != null && !s.getEnum().isEmpty()) { // it's an enum string - discriminator.setIsEnum(true); - } - } - - discriminator.setMapping(sourceDiscriminator.getMapping()); - List uniqueDescendants = new ArrayList<>(); - if (sourceDiscriminator.getMapping() != null && !sourceDiscriminator.getMapping().isEmpty()) { - for (Entry e : sourceDiscriminator.getMapping().entrySet()) { - String name; - if (e.getValue().indexOf('/') >= 0) { - name = ModelUtils.getSimpleRef(e.getValue()); - if (ModelUtils.getSchema(openAPI, name) == null) { - LOGGER.error("Failed to lookup the schema '{}' when processing the discriminator mapping of oneOf/anyOf. Please check to ensure it's defined properly.", name); - } - } else { - name = e.getValue(); - } - uniqueDescendants.add(new MappedModel(e.getKey(), toModelName(name))); - } - } - - boolean legacyUseCase = (this.getLegacyDiscriminatorBehavior() && uniqueDescendants.isEmpty()); - if (!this.getLegacyDiscriminatorBehavior() || legacyUseCase) { - // for schemas that allOf inherit from this schema, add those descendants to this discriminator map - List otherDescendants = getAllOfDescendants(schemaName, openAPI); - for (MappedModel otherDescendant : otherDescendants) { - // add only if the mapping names are not the same - boolean matched = false; - for (MappedModel uniqueDescendant : uniqueDescendants) { - if (uniqueDescendant.getMappingName().equals(otherDescendant.getMappingName())) { - matched = true; - break; - } - } - - if (matched == false) { - uniqueDescendants.add(otherDescendant); - } - } - } - // if there are composed oneOf/anyOf schemas, add them to this discriminator - if (ModelUtils.isComposedSchema(schema) && !this.getLegacyDiscriminatorBehavior()) { - List otherDescendants = getOneOfAnyOfDescendants(schemaName, discPropName, (ComposedSchema) schema, openAPI); - for (MappedModel otherDescendant : otherDescendants) { - if (!uniqueDescendants.contains(otherDescendant)) { - uniqueDescendants.add(otherDescendant); - } - } - } - if (!this.getLegacyDiscriminatorBehavior()) { - Collections.sort(uniqueDescendants); - } - discriminator.getMappedModels().addAll(uniqueDescendants); - - return discriminator; - } - - /** - * Handle the model for the 'additionalProperties' keyword in the OAS schema. - * - * @param codegenModel The codegen representation of the schema. - * @param schema The input OAS schema. - */ - protected void addAdditionPropertiesToCodeGenModel(CodegenModel codegenModel, Schema schema) { - addParentContainer(codegenModel, codegenModel.name, schema); - } - - /** - * Add schema's properties to "properties" and "required" list - * - * @param properties all properties - * @param required required property only - * @param schema schema in which the properties will be added to the lists - * @param visitedSchemas circuit-breaker - the schemas with which the method was called before for recursive structures - */ - protected void addProperties(Map properties, List required, Schema schema, Set visitedSchemas) { - if (!visitedSchemas.add(schema)) { - return; - } - if (schema instanceof ComposedSchema) { - ComposedSchema composedSchema = (ComposedSchema) schema; - - if (composedSchema.getAllOf() != null) { - for (Schema component : composedSchema.getAllOf()) { - addProperties(properties, required, component, visitedSchemas); - } - } - - if (schema.getRequired() != null) { - required.addAll(schema.getRequired()); - } - - if (composedSchema.getOneOf() != null) { - for (Schema component : composedSchema.getOneOf()) { - addProperties(properties, required, component, visitedSchemas); - } - } - - if (composedSchema.getAnyOf() != null) { - for (Schema component : composedSchema.getAnyOf()) { - addProperties(properties, required, component, visitedSchemas); - } - } - - return; - } - - if (StringUtils.isNotBlank(schema.get$ref())) { - Schema interfaceSchema = ModelUtils.getReferencedSchema(this.openAPI, schema); - addProperties(properties, required, interfaceSchema, visitedSchemas); - return; - } - if (schema.getProperties() != null) { - properties.putAll(schema.getProperties()); - } - if (schema.getRequired() != null) { - required.addAll(schema.getRequired()); - } - } - - /** - * Camelize the method name of the getter and setter - * - * @param name string to be camelized - * @return Camelized string - */ - public String getterAndSetterCapitalize(String name) { - if (name == null || name.length() == 0) { - return name; - } - return camelize(toVarName(name)); - } - - protected void updatePropertyForMap(CodegenProperty property, Schema p) { - property.isContainer = true; - property.containerType = "map"; - // TODO remove this hack in the future, code should use minProperties and maxProperties for object schemas - property.minItems = p.getMinProperties(); - property.maxItems = p.getMaxProperties(); - - // handle inner property - Schema innerSchema = unaliasSchema(getAdditionalProperties(p)); - if (innerSchema == null) { - LOGGER.error("Undefined map inner type for `{}`. Default to String.", p.getName()); - innerSchema = new StringSchema().description("//TODO automatically added by openapi-generator due to undefined type"); - p.setAdditionalProperties(innerSchema); - } - CodegenProperty cp = fromProperty("inner", innerSchema, false); - updatePropertyForMap(property, cp); - } - - protected void updatePropertyForObject(CodegenProperty property, Schema p) { - if (isFreeFormObject(p)) { - // non-composed object type with no properties + additionalProperties - // additionalProperties must be null, ObjectSchema, or empty Schema - property.isFreeFormObject = true; - if (languageSpecificPrimitives.contains(property.dataType)) { - property.isPrimitiveType = true; - } - if (ModelUtils.isMapSchema(p)) { - // an object or anyType composed schema that has additionalProperties set - updatePropertyForMap(property, p); - } else { - // ObjectSchema with additionalProperties = null, can be nullable - property.setIsMap(false); - } - } else if (ModelUtils.isMapSchema(p)) { - // an object or anyType composed schema that has additionalProperties set - updatePropertyForMap(property, p); - } - addVarsRequiredVarsAdditionalProps(p, property); - } - - protected void updatePropertyForAnyType(CodegenProperty property, Schema p) { - // The 'null' value is allowed when the OAS schema is 'any type'. - // See https://github.com/OAI/OpenAPI-Specification/issues/1389 - if (Boolean.FALSE.equals(p.getNullable())) { - LOGGER.warn("Schema '{}' is any type, which includes the 'null' value. 'nullable' cannot be set to 'false'", p.getName()); - } - ComposedSchema composedSchema = p instanceof ComposedSchema - ? (ComposedSchema) p - : null; - property.isNullable = property.isNullable || composedSchema == null || composedSchema.getAllOf() == null || composedSchema.getAllOf().size() == 0; - if (languageSpecificPrimitives.contains(property.dataType)) { - property.isPrimitiveType = true; - } - if (ModelUtils.isMapSchema(p)) { - // an object or anyType composed schema that has additionalProperties set - // some of our code assumes that any type schema with properties defined will be a map - // even though it should allow in any type and have map constraints for properties - updatePropertyForMap(property, p); - } - addVarsRequiredVarsAdditionalProps(p, property); - } - - protected void updatePropertyForString(CodegenProperty property, Schema p) { - if (ModelUtils.isByteArraySchema(p)) { - property.setIsString(false); - property.isByteArray = true; - } else if (ModelUtils.isBinarySchema(p)) { - property.isBinary = true; - property.isFile = true; // file = binary in OAS3 - } else if (ModelUtils.isUUIDSchema(p)) { - property.isUuid = true; - } else if (ModelUtils.isURISchema(p)) { - property.isUri = true; - } else if (ModelUtils.isEmailSchema(p)) { - property.isEmail = true; - } else if (ModelUtils.isDateSchema(p)) { // date format - property.setIsString(false); // for backward compatibility with 2.x - property.isDate = true; - } else if (ModelUtils.isDateTimeSchema(p)) { // date-time format - property.setIsString(false); // for backward compatibility with 2.x - property.isDateTime = true; - } else if (ModelUtils.isDecimalSchema(p)) { // type: string, format: number - property.isDecimal = true; - property.setIsString(false); - } - property.pattern = toRegularExpression(p.getPattern()); - } - - protected void updatePropertyForNumber(CodegenProperty property, Schema p) { - property.isNumeric = Boolean.TRUE; - if (ModelUtils.isFloatSchema(p)) { // float - property.isFloat = Boolean.TRUE; - } else if (ModelUtils.isDoubleSchema(p)) { // double - property.isDouble = Boolean.TRUE; - } - } - - protected void updatePropertyForInteger(CodegenProperty property, Schema p) { - property.isNumeric = Boolean.TRUE; - if (ModelUtils.isLongSchema(p)) { // int64/long format - property.isLong = Boolean.TRUE; - } else { - property.isInteger = Boolean.TRUE; // older use case, int32 and unbounded int - if (ModelUtils.isShortSchema(p)) { // int32 - property.setIsShort(Boolean.TRUE); - } - } - } - - /** - * TODO remove this in 7.0.0 as a breaking change - * This method was kept when required was added to the fromProperty signature - * to ensure that the change was non-breaking - * - * @param name name of the property - * @param p OAS property schema - * @param required true if the property is required in the next higher object schema, false otherwise - * @return Codegen Property object - */ - public CodegenProperty fromProperty(String name, Schema p, boolean required) { - return fromProperty(name, p, required, false); - } - - - /** - * TODO remove this in 7.0.0 as a breaking change - * This method was kept when required was added to the fromProperty signature - * to ensure that the change was non-breaking - * - * @param name name of the property - * @param p OAS property schema - * @return Codegen Property object - */ - public CodegenProperty fromProperty(String name, Schema p) { - return fromProperty(name, p, false, false); - } - - /** - * Convert OAS Property object to Codegen Property object. - *

    - * The return value is cached. An internal cache is looked up to determine - * if the CodegenProperty return value has already been instantiated for - * the (String name, Schema p) arguments. - * Any subsequent processing of the CodegenModel return value must be idempotent - * for a given (String name, Schema schema). - * - * @param name name of the property - * @param p OAS property schema - * @param required true if the property is required in the next higher object schema, false otherwise - * @param schemaIsFromAdditionalProperties true if the property is a required property defined by additional properties schema - * If this is the actual additionalProperties schema not defining a required property, then - * the value should be false - * @return Codegen Property object - */ - public CodegenProperty fromProperty(String name, Schema p, boolean required, boolean schemaIsFromAdditionalProperties) { - if (p == null) { - LOGGER.error("Undefined property/schema for `{}`. Default to type:string.", name); - return null; - } - LOGGER.debug("debugging fromProperty for {} : {}", name, p); - NamedSchema ns = new NamedSchema(name, p, required, schemaIsFromAdditionalProperties); - CodegenProperty cpc = schemaCodegenPropertyCache.get(ns); - if (cpc != null) { - LOGGER.debug("Cached fromProperty for {} : {} required={}", name, p.getName(), required); - return cpc; - } - - CodegenProperty property = CodegenModelFactory.newInstance(CodegenModelType.PROPERTY); - if (p.equals(trueSchema)) { - property.setIsBooleanSchemaTrue(true); - } else if (p.equals(falseSchema)) { - property.setIsBooleanSchemaFalse(true); - } - - // unalias schema - p = unaliasSchema(p); - - property.setSchemaIsFromAdditionalProperties(schemaIsFromAdditionalProperties); - property.required = required; - ModelUtils.syncValidationProperties(p, property); - property.setFormat(p.getFormat()); - - property.name = toVarName(name); - property.baseName = name; - if (p.getType() == null) { - property.openApiType = getSchemaType(p); - } else { - property.openApiType = p.getType(); - } - property.nameInCamelCase = camelize(property.name, false); - property.nameInSnakeCase = CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, property.nameInCamelCase); - property.description = escapeText(p.getDescription()); - property.unescapedDescription = p.getDescription(); - property.title = p.getTitle(); - property.getter = toGetter(name); - property.setter = toSetter(name); - // put toExampleValue in a try-catch block to log the error as example values are not critical - try { - property.example = toExampleValue(p); - } catch (Exception e) { - LOGGER.error("Error in generating `example` for the property {}. Default to ERROR_TO_EXAMPLE_VALUE. Enable debugging for more info.", property.baseName); - LOGGER.debug("Exception from toExampleValue: {}", e.getMessage()); - property.example = "ERROR_TO_EXAMPLE_VALUE"; - } - property.defaultValue = toDefaultValue(p); - property.defaultValueWithParam = toDefaultValueWithParam(name, p); - property.jsonSchema = Json.pretty(p); - - if (p.getDeprecated() != null) { - property.deprecated = p.getDeprecated(); - } else if (p.get$ref() != null) { - // Since $ref should be replaced with the model it refers - // to, $ref'ing a model with 'deprecated' set should cause - // the property to reflect the model's 'deprecated' value. - String ref = ModelUtils.getSimpleRef(p.get$ref()); - if (ref != null) { - Schema referencedSchema = ModelUtils.getSchemas(this.openAPI).get(ref); - if (referencedSchema != null && referencedSchema.getDeprecated() != null) { - property.deprecated = referencedSchema.getDeprecated(); - } - } - } - if (p.getReadOnly() != null) { - property.isReadOnly = p.getReadOnly(); - } - if (p.getWriteOnly() != null) { - property.isWriteOnly = p.getWriteOnly(); - } - if (p.getNullable() != null) { - property.isNullable = p.getNullable(); - } - - if (p.getXml() != null) { - if (p.getXml().getAttribute() != null) { - property.isXmlAttribute = p.getXml().getAttribute(); - } - property.xmlPrefix = p.getXml().getPrefix(); - property.xmlName = p.getXml().getName(); - property.xmlNamespace = p.getXml().getNamespace(); - } - if (p.getExtensions() != null && !p.getExtensions().isEmpty()) { - property.getVendorExtensions().putAll(p.getExtensions()); - } else if (p.get$ref() != null) { - Schema referencedSchema = ModelUtils.getReferencedSchema(this.openAPI, p); - if (referencedSchema.getExtensions() != null && !referencedSchema.getExtensions().isEmpty()) { - property.getVendorExtensions().putAll(referencedSchema.getExtensions()); - } - } - - //Inline enum case: - if (p.getEnum() != null && !p.getEnum().isEmpty()) { - List _enum = p.getEnum(); - property._enum = new ArrayList<>(); - for (Object i : _enum) { - property._enum.add(String.valueOf(i)); - } - property.isEnum = true; - property.isInnerEnum = true; - - Map allowableValues = new HashMap<>(); - allowableValues.put("values", _enum); - if (allowableValues.size() > 0) { - property.allowableValues = allowableValues; - } - } - - Schema referencedSchema = ModelUtils.getReferencedSchema(this.openAPI, p); - - //Referenced enum case: - if (referencedSchema.getEnum() != null && !referencedSchema.getEnum().isEmpty()) { - List _enum = referencedSchema.getEnum(); - - Map allowableValues = new HashMap<>(); - allowableValues.put("values", _enum); - if (allowableValues.size() > 0) { - property.allowableValues = allowableValues; - } - } - - if (referencedSchema.getNullable() != null) { - property.isNullable = referencedSchema.getNullable(); - } - - property.dataType = getTypeDeclaration(p); - property.dataFormat = p.getFormat(); - property.baseType = getSchemaType(p); - - // this can cause issues for clients which don't support enums - if (property.isEnum) { - property.datatypeWithEnum = toEnumName(property); - property.enumName = toEnumName(property); - } else { - property.datatypeWithEnum = property.dataType; - } - - property.setTypeProperties(p); - property.setComposedSchemas(getComposedSchemas(p)); - if (ModelUtils.isIntegerSchema(p)) { // integer type - updatePropertyForInteger(property, p); - } else if (ModelUtils.isBooleanSchema(p)) { // boolean type - property.getter = toBooleanGetter(name); - } else if (ModelUtils.isFileSchema(p) && !ModelUtils.isStringSchema(p)) { - // swagger v2 only, type file - property.isFile = true; - } else if (ModelUtils.isStringSchema(p)) { - updatePropertyForString(property, p); - } else if (ModelUtils.isNumberSchema(p)) { - updatePropertyForNumber(property, p); - } else if (ModelUtils.isArraySchema(p)) { - // default to string if inner item is undefined - property.isContainer = true; - if (ModelUtils.isSet(p)) { - property.containerType = "set"; - } else { - property.containerType = "array"; - } - property.baseType = getSchemaType(p); - if (p.getXml() != null) { - property.isXmlWrapped = p.getXml().getWrapped() == null ? false : p.getXml().getWrapped(); - property.xmlPrefix = p.getXml().getPrefix(); - property.xmlNamespace = p.getXml().getNamespace(); - property.xmlName = p.getXml().getName(); - } - - // handle inner property - String itemName = getItemsName(p, name); - ArraySchema arraySchema = (ArraySchema) p; - Schema innerSchema = unaliasSchema(getSchemaItems(arraySchema)); - CodegenProperty cp = fromProperty(itemName, innerSchema, false); - updatePropertyForArray(property, cp); - } else if (ModelUtils.isTypeObjectSchema(p)) { - updatePropertyForObject(property, p); - } else if (ModelUtils.isAnyType(p)) { - updatePropertyForAnyType(property, p); - } else if (!ModelUtils.isNullType(p)) { - // referenced model - ; - } - if (p.get$ref() != null) { - property.setRef(p.get$ref()); - } - - boolean isAnyTypeWithNothingElseSet = (ModelUtils.isAnyType(p) && - (p.getProperties() == null || p.getProperties().isEmpty()) && - !ModelUtils.isComposedSchema(p) && - p.getAdditionalProperties() == null && p.getNot() == null && p.getEnum() == null); - - if (!ModelUtils.isArraySchema(p) && !ModelUtils.isMapSchema(p) && !isFreeFormObject(p) && !isAnyTypeWithNothingElseSet) { - /* schemas that are not Array, not ModelUtils.isMapSchema, not isFreeFormObject, not AnyType with nothing else set - * so primitive schemas int, str, number, referenced schemas, AnyType schemas with properties, enums, or composition - */ - String type = getSchemaType(p); - setNonArrayMapProperty(property, type); - property.isModel = (ModelUtils.isComposedSchema(referencedSchema) || ModelUtils.isObjectSchema(referencedSchema)) && ModelUtils.isModel(referencedSchema); - } - - LOGGER.debug("debugging from property return: {}", property); - schemaCodegenPropertyCache.put(ns, property); - return property; - } - - /** - * Update property for array(list) container - * - * @param property Codegen property - * @param innerProperty Codegen inner property of map or list - */ - protected void updatePropertyForArray(CodegenProperty property, CodegenProperty innerProperty) { - if (innerProperty == null) { - if (LOGGER.isWarnEnabled()) { - LOGGER.warn("skipping invalid array property {}", Json.pretty(property)); - } - return; - } - property.dataFormat = innerProperty.dataFormat; - if (!languageSpecificPrimitives.contains(innerProperty.baseType)) { - property.complexType = innerProperty.baseType; - } else { - property.isPrimitiveType = true; - } - property.items = innerProperty; - property.mostInnerItems = getMostInnerItems(innerProperty); - // inner item is Enum - if (isPropertyInnerMostEnum(property)) { - // isEnum is set to true when the type is an enum - // or the inner type of an array/map is an enum - property.isEnum = true; - property.isInnerEnum = true; - // update datatypeWithEnum and default value for array - // e.g. List => List - updateDataTypeWithEnumForArray(property); - // set allowable values to enum values (including array/map of enum) - property.allowableValues = getInnerEnumAllowableValues(property); - } - - } - - /** - * Update property for map container - * - * @param property Codegen property - * @param innerProperty Codegen inner property of map or list - */ - protected void updatePropertyForMap(CodegenProperty property, CodegenProperty innerProperty) { - if (innerProperty == null) { - if (LOGGER.isWarnEnabled()) { - LOGGER.warn("skipping invalid map property {}", Json.pretty(property)); - } - return; - } - if (!languageSpecificPrimitives.contains(innerProperty.baseType)) { - property.complexType = innerProperty.baseType; - } else { - property.isPrimitiveType = true; - } - // TODO fix this, map should not be assigning properties to items - property.items = innerProperty; - property.mostInnerItems = getMostInnerItems(innerProperty); - property.dataFormat = innerProperty.dataFormat; - // inner item is Enum - if (isPropertyInnerMostEnum(property)) { - // isEnum is set to true when the type is an enum - // or the inner type of an array/map is an enum - property.isEnum = true; - property.isInnerEnum = true; - // update datatypeWithEnum and default value for map - // e.g. Dictionary => Dictionary - updateDataTypeWithEnumForMap(property); - // set allowable values to enum values (including array/map of enum) - property.allowableValues = getInnerEnumAllowableValues(property); - } - - } - - /** - * Update property for map container - * - * @param property Codegen property - * @return True if the inner most type is enum - */ - protected Boolean isPropertyInnerMostEnum(CodegenProperty property) { - CodegenProperty currentProperty = getMostInnerItems(property); - - return currentProperty != null && currentProperty.isEnum; - } - - protected CodegenProperty getMostInnerItems(CodegenProperty property) { - CodegenProperty currentProperty = property; - while (currentProperty != null && (Boolean.TRUE.equals(currentProperty.isMap) - || Boolean.TRUE.equals(currentProperty.isArray)) && currentProperty.items != null) { - currentProperty = currentProperty.items; - } - return currentProperty; - } - - protected Map getInnerEnumAllowableValues(CodegenProperty property) { - CodegenProperty currentProperty = getMostInnerItems(property); - - return currentProperty == null ? new HashMap<>() : currentProperty.allowableValues; - } - - /** - * Update datatypeWithEnum for array container - * - * @param property Codegen property - */ - protected void updateDataTypeWithEnumForArray(CodegenProperty property) { - CodegenProperty baseItem = property.items; - while (baseItem != null && (Boolean.TRUE.equals(baseItem.isMap) - || Boolean.TRUE.equals(baseItem.isArray))) { - baseItem = baseItem.items; - } - if (baseItem != null) { - // set both datatype and datetypeWithEnum as only the inner type is enum - property.datatypeWithEnum = property.datatypeWithEnum.replace(baseItem.baseType, toEnumName(baseItem)); - - // naming the enum with respect to the language enum naming convention - // e.g. remove [], {} from array/map of enum - property.enumName = toEnumName(property); - - // set default value for variable with inner enum - if (property.defaultValue != null) { - property.defaultValue = property.defaultValue.replace(baseItem.baseType, toEnumName(baseItem)); - } - - updateCodegenPropertyEnum(property); - } - } - - /** - * Update datatypeWithEnum for map container - * - * @param property Codegen property - */ - protected void updateDataTypeWithEnumForMap(CodegenProperty property) { - CodegenProperty baseItem = property.items; - while (baseItem != null && (Boolean.TRUE.equals(baseItem.isMap) - || Boolean.TRUE.equals(baseItem.isArray))) { - baseItem = baseItem.items; - } - - if (baseItem != null) { - // set both datatype and datetypeWithEnum as only the inner type is enum - property.datatypeWithEnum = property.datatypeWithEnum.replace(", " + baseItem.baseType, ", " + toEnumName(baseItem)); - - // naming the enum with respect to the language enum naming convention - // e.g. remove [], {} from array/map of enum - property.enumName = toEnumName(property); - - // set default value for variable with inner enum - if (property.defaultValue != null) { - property.defaultValue = property.defaultValue.replace(", " + property.items.baseType, ", " + toEnumName(property.items)); - } - - updateCodegenPropertyEnum(property); - } - } - - protected void setNonArrayMapProperty(CodegenProperty property, String type) { - property.isContainer = false; - if (languageSpecificPrimitives().contains(type)) { - property.isPrimitiveType = true; - } else { - property.complexType = property.baseType; - property.isModel = true; - } - } - - /** - * Override with any special handling of response codes - * - * @param responses OAS Operation's responses - * @return default method response or null if not found - */ - protected ApiResponse findMethodResponse(ApiResponses responses) { - String code = null; - for (String responseCode : responses.keySet()) { - if (responseCode.startsWith("2") || responseCode.equals("default")) { - if (code == null || code.compareTo(responseCode) > 0) { - code = responseCode; - } - } - } - if (code == null) { - return null; - } - return responses.get(code); - } - - /** - * Set op's returnBaseType, returnType, examples etc. - * - * @param operation endpoint Operation - * @param schemas a map of the schemas in the openapi spec - * @param op endpoint CodegenOperation - * @param methodResponse the default ApiResponse for the endpoint - */ - protected void handleMethodResponse(Operation operation, - Map schemas, - CodegenOperation op, - ApiResponse methodResponse) { - handleMethodResponse(operation, schemas, op, methodResponse, Collections.emptyMap()); - } - - /** - * Set op's returnBaseType, returnType, examples etc. - * - * @param operation endpoint Operation - * @param schemas a map of the schemas in the openapi spec - * @param op endpoint CodegenOperation - * @param methodResponse the default ApiResponse for the endpoint - * @param schemaMappings mappings of external types to be omitted by unaliasing - */ - protected void handleMethodResponse(Operation operation, - Map schemas, - CodegenOperation op, - ApiResponse methodResponse, - Map schemaMappings) { - Schema responseSchema = unaliasSchema(ModelUtils.getSchemaFromResponse(methodResponse)); - - if (responseSchema != null) { - CodegenProperty cm = fromProperty("response", responseSchema, false); - - if (ModelUtils.isArraySchema(responseSchema)) { - ArraySchema as = (ArraySchema) responseSchema; - CodegenProperty innerProperty = fromProperty("response", getSchemaItems(as), false); - op.returnBaseType = innerProperty.baseType; - } else if (ModelUtils.isMapSchema(responseSchema)) { - CodegenProperty innerProperty = fromProperty("response", getAdditionalProperties(responseSchema), false); - op.returnBaseType = innerProperty.baseType; - } else { - if (cm.complexType != null) { - op.returnBaseType = cm.complexType; - } else { - op.returnBaseType = cm.baseType; - } - } - - // check skipOperationExample, which can be set to true to avoid out of memory errors for large spec - if (!isSkipOperationExample()) { - // generate examples - String exampleStatusCode = "200"; - for (String key : operation.getResponses().keySet()) { - if (operation.getResponses().get(key) == methodResponse && !key.equals("default")) { - exampleStatusCode = key; - } - } - op.examples = new ExampleGenerator(schemas, this.openAPI).generateFromResponseSchema(exampleStatusCode, responseSchema, getProducesInfo(this.openAPI, operation)); - } - - op.defaultResponse = toDefaultValue(responseSchema); - op.returnType = cm.dataType; - op.returnFormat = cm.dataFormat; - op.hasReference = schemas != null && schemas.containsKey(op.returnBaseType); - - // lookup discriminator - Schema schema = null; - if (schemas != null) { - schema = schemas.get(op.returnBaseType); - } - if (schema != null) { - CodegenModel cmod = fromModel(op.returnBaseType, schema); - op.discriminator = cmod.discriminator; - } - - if (cm.isContainer) { - op.returnContainer = cm.containerType; - if ("map".equals(cm.containerType)) { - op.isMap = true; - } else if ("list".equalsIgnoreCase(cm.containerType)) { - op.isArray = true; - } else if ("array".equalsIgnoreCase(cm.containerType)) { - op.isArray = true; - } else if ("set".equalsIgnoreCase(cm.containerType)) { - op.isArray = true; - } - } else { - op.returnSimpleType = true; - } - if (languageSpecificPrimitives().contains(op.returnBaseType) || op.returnBaseType == null) { - op.returnTypeIsPrimitive = true; - } - op.returnProperty = cm; - } - addHeaders(methodResponse, op.responseHeaders); - } - - /** - * Convert OAS Operation object to Codegen Operation object - * - * @param httpMethod HTTP method - * @param operation OAS operation object - * @param path the path of the operation - * @param servers list of servers - * @return Codegen Operation object - */ - @Override - public CodegenOperation fromOperation(String path, - String httpMethod, - Operation operation, - List servers) { - LOGGER.debug("fromOperation => operation: {}", operation); - if (operation == null) - throw new RuntimeException("operation cannot be null in fromOperation"); - - Map schemas = ModelUtils.getSchemas(this.openAPI); - CodegenOperation op = CodegenModelFactory.newInstance(CodegenModelType.OPERATION); - Set imports = new HashSet<>(); - if (operation.getExtensions() != null && !operation.getExtensions().isEmpty()) { - op.vendorExtensions.putAll(operation.getExtensions()); - - Object isCallbackRequest = op.vendorExtensions.remove("x-callback-request"); - op.isCallbackRequest = Boolean.TRUE.equals(isCallbackRequest); - } - - // servers setting - if (operation.getServers() != null && !operation.getServers().isEmpty()) { - // use operation-level servers first if defined - op.servers = fromServers(operation.getServers()); - } else if (servers != null && !servers.isEmpty()) { - // use path-level servers - op.servers = fromServers(servers); - } - - // store the original operationId for plug-in - op.operationIdOriginal = operation.getOperationId(); - - String operationId = getOrGenerateOperationId(operation, path, httpMethod); - // remove prefix in operationId - if (removeOperationIdPrefix) { - // The prefix is everything before the removeOperationIdPrefixCount occurrence of removeOperationIdPrefixDelimiter - String[] components = operationId.split("[" + removeOperationIdPrefixDelimiter + "]"); - if (components.length > 1) { - // If removeOperationIdPrefixCount is -1 or bigger that the number of occurrences, uses the last one - int component_number = removeOperationIdPrefixCount == -1 ? components.length - 1 : removeOperationIdPrefixCount; - component_number = Math.min(component_number, components.length - 1); - // Reconstruct the operationId from its split elements and the delimiter - operationId = String.join(removeOperationIdPrefixDelimiter, Arrays.copyOfRange(components, component_number, components.length)); - } - } - operationId = removeNonNameElementToCamelCase(operationId); - - if (isStrictSpecBehavior() && !path.startsWith("/")) { - // modifies an operation.path to strictly conform to OpenAPI Spec - op.path = "/" + path; - } else { - op.path = path; - } - - op.operationId = toOperationId(operationId); - op.summary = escapeText(operation.getSummary()); - op.unescapedNotes = operation.getDescription(); - op.notes = escapeText(operation.getDescription()); - op.hasConsumes = false; - op.hasProduces = false; - if (operation.getDeprecated() != null) { - op.isDeprecated = operation.getDeprecated(); - } - - addConsumesInfo(operation, op); - - if (operation.getResponses() != null && !operation.getResponses().isEmpty()) { - ApiResponse methodResponse = findMethodResponse(operation.getResponses()); - for (Map.Entry operationGetResponsesEntry : operation.getResponses().entrySet()) { - String key = operationGetResponsesEntry.getKey(); - ApiResponse response = operationGetResponsesEntry.getValue(); - addProducesInfo(response, op); - CodegenResponse r = fromResponse(key, response); - Map headers = response.getHeaders(); - if (headers != null) { - List responseHeaders = new ArrayList<>(); - for (Entry entry : headers.entrySet()) { - String headerName = entry.getKey(); - Header header = ModelUtils.getReferencedHeader(this.openAPI, entry.getValue()); - CodegenParameter responseHeader = headerToCodegenParameter(header, headerName, imports, String.format(Locale.ROOT, "%sResponseParameter", r.code)); - responseHeaders.add(responseHeader); - } - r.setResponseHeaders(responseHeaders); - } - String mediaTypeSchemaSuffix = String.format(Locale.ROOT, "%sResponseBody", r.code); - r.setContent(getContent(response.getContent(), imports, mediaTypeSchemaSuffix)); - - if (!addSchemaImportsFromV3SpecLocations) { - if (r.baseType != null && - !defaultIncludes.contains(r.baseType) && - !languageSpecificPrimitives.contains(r.baseType)) { - imports.add(r.baseType); - } - if ("set".equals(r.containerType) && typeMapping.containsKey(r.containerType)) { - op.uniqueItems = true; - imports.add(typeMapping.get(r.containerType)); - } - } - - op.responses.add(r); - if (Boolean.TRUE.equals(r.isBinary) && Boolean.TRUE.equals(r.is2xx) && Boolean.FALSE.equals(op.isResponseBinary)) { - op.isResponseBinary = Boolean.TRUE; - } - if (Boolean.TRUE.equals(r.isFile) && Boolean.TRUE.equals(r.is2xx) && Boolean.FALSE.equals(op.isResponseFile)) { - op.isResponseFile = Boolean.TRUE; - } - if (Boolean.TRUE.equals(r.isDefault)) { - op.defaultReturnType = Boolean.TRUE; - } - - // check if any 4xx or 5xx response has an error response object defined - if ((Boolean.TRUE.equals(r.is4xx) || Boolean.TRUE.equals(r.is5xx)) && - Boolean.FALSE.equals(r.primitiveType) && Boolean.FALSE.equals(r.simpleType)) { - op.hasErrorResponseObject = Boolean.TRUE; - } - } - - // check if the operation can both return a 2xx response with a body and without - if (op.responses.stream().anyMatch(response -> response.is2xx && response.dataType != null) && - op.responses.stream().anyMatch(response -> response.is2xx && response.dataType == null)) { - op.isResponseOptional = Boolean.TRUE; - } - - op.responses.sort((a, b) -> { - int aScore = a.isWildcard() ? 2 : a.isRange() ? 1 : 0; - int bScore = b.isWildcard() ? 2 : b.isRange() ? 1 : 0; - return Integer.compare(aScore, bScore); - }); - - if (methodResponse != null) { - handleMethodResponse(operation, schemas, op, methodResponse, importMapping); - } - } - - if (operation.getCallbacks() != null && !operation.getCallbacks().isEmpty()) { - operation.getCallbacks().forEach((name, callback) -> { - CodegenCallback c = fromCallback(name, callback, servers); - op.callbacks.add(c); - }); - } - - List parameters = operation.getParameters(); - List allParams = new ArrayList<>(); - List bodyParams = new ArrayList<>(); - List pathParams = new ArrayList<>(); - List queryParams = new ArrayList<>(); - List headerParams = new ArrayList<>(); - List cookieParams = new ArrayList<>(); - List formParams = new ArrayList<>(); - List requiredParams = new ArrayList<>(); - List optionalParams = new ArrayList<>(); - - CodegenParameter bodyParam = null; - RequestBody requestBody = operation.getRequestBody(); - if (requestBody != null) { - String contentType = getContentType(requestBody); - if (contentType != null) { - contentType = contentType.toLowerCase(Locale.ROOT); - } - if (contentType != null && - (contentType.startsWith("application/x-www-form-urlencoded") || - contentType.startsWith("multipart"))) { - // process form parameters - formParams = fromRequestBodyToFormParameters(requestBody, imports); - op.isMultipart = contentType.startsWith("multipart"); - for (CodegenParameter cp : formParams) { - setParameterEncodingValues(cp, requestBody.getContent().get(contentType)); - postProcessParameter(cp); - } - // add form parameters to the beginning of all parameter list - if (prependFormOrBodyParameters) { - for (CodegenParameter cp : formParams) { - allParams.add(cp.copy()); - } - } - } else { - // process body parameter - requestBody = ModelUtils.getReferencedRequestBody(this.openAPI, requestBody); - - String bodyParameterName = ""; - if (op.vendorExtensions != null && op.vendorExtensions.containsKey("x-codegen-request-body-name")) { - bodyParameterName = (String) op.vendorExtensions.get("x-codegen-request-body-name"); - } - bodyParam = fromRequestBody(requestBody, imports, bodyParameterName); - bodyParam.description = escapeText(requestBody.getDescription()); - postProcessParameter(bodyParam); - - bodyParams.add(bodyParam); - - if (prependFormOrBodyParameters) { - allParams.add(bodyParam); - } - - // add example - if (schemas != null && !isSkipOperationExample()) { - op.requestBodyExamples = new ExampleGenerator(schemas, this.openAPI).generate(null, new ArrayList<>(getConsumesInfo(this.openAPI, operation)), bodyParam.baseType); - } - } - } - - if (parameters != null) { - for (Parameter param : parameters) { - param = ModelUtils.getReferencedParameter(this.openAPI, param); - - CodegenParameter p = fromParameter(param, imports); - p.setContent(getContent(param.getContent(), imports, "RequestParameter" + toModelName(param.getName()))); - - // ensure unique params - if (ensureUniqueParams) { - while (!isParameterNameUnique(p, allParams)) { - p.paramName = generateNextName(p.paramName); - } - } - - allParams.add(p); - - if (param instanceof QueryParameter || "query".equalsIgnoreCase(param.getIn())) { - queryParams.add(p.copy()); - } else if (param instanceof PathParameter || "path".equalsIgnoreCase(param.getIn())) { - pathParams.add(p.copy()); - } else if (param instanceof HeaderParameter || "header".equalsIgnoreCase(param.getIn())) { - headerParams.add(p.copy()); - } else if (param instanceof CookieParameter || "cookie".equalsIgnoreCase(param.getIn())) { - cookieParams.add(p.copy()); - } else { - LOGGER.warn("Unknown parameter type {} for {}", p.baseType, p.baseName); - } - - } - } - - // add form/body parameter (if any) to the end of all parameter list - if (!prependFormOrBodyParameters) { - for (CodegenParameter cp : formParams) { - if (ensureUniqueParams) { - while (!isParameterNameUnique(cp, allParams)) { - cp.paramName = generateNextName(cp.paramName); - } - } - allParams.add(cp.copy()); - } - - for (CodegenParameter cp : bodyParams) { - if (ensureUniqueParams) { - while (!isParameterNameUnique(cp, allParams)) { - cp.paramName = generateNextName(cp.paramName); - } - } - allParams.add(cp.copy()); - } - } - - // create optional, required parameters - for (CodegenParameter cp : allParams) { - if (cp.required) { //required parameters - requiredParams.add(cp.copy()); - } else { // optional parameters - optionalParams.add(cp.copy()); - op.hasOptionalParams = true; - } - } - - // add imports to operation import tag - for (String i : imports) { - if (needToImport(i)) { - op.imports.add(i); - } - } - - op.bodyParam = bodyParam; - op.httpMethod = httpMethod.toUpperCase(Locale.ROOT); - - // move "required" parameters in front of "optional" parameters - if (sortParamsByRequiredFlag) { - Collections.sort(allParams, new Comparator() { - @Override - public int compare(CodegenParameter one, CodegenParameter another) { - if (one.required == another.required) - return 0; - else if (one.required) - return -1; - else - return 1; - } - }); - } - - op.allParams = allParams; - op.bodyParams = bodyParams; - op.pathParams = pathParams; - op.queryParams = queryParams; - op.headerParams = headerParams; - op.cookieParams = cookieParams; - op.formParams = formParams; - op.requiredParams = requiredParams; - op.optionalParams = optionalParams; - op.externalDocs = operation.getExternalDocs(); - // legacy support - op.nickname = op.operationId; - - if (op.allParams.size() > 0) { - op.hasParams = true; - } - op.hasRequiredParams = op.requiredParams.size() > 0; - - // set Restful Flag - op.isRestfulShow = op.isRestfulShow(); - op.isRestfulIndex = op.isRestfulIndex(); - op.isRestfulCreate = op.isRestfulCreate(); - op.isRestfulUpdate = op.isRestfulUpdate(); - op.isRestfulDestroy = op.isRestfulDestroy(); - op.isRestful = op.isRestful(); - - return op; - } - - public boolean isParameterNameUnique(CodegenParameter p, List parameters) { - for (CodegenParameter parameter : parameters) { - if (System.identityHashCode(p) == System.identityHashCode(parameter)) { - continue; // skip itself - } - - if (p.paramName.equals(parameter.paramName)) { - return false; - } - } - - return true; - } - - /** - * Convert OAS Response object to Codegen Response object - * - * @param responseCode HTTP response code - * @param response OAS Response object - * @return Codegen Response object - */ - public CodegenResponse fromResponse(String responseCode, ApiResponse response) { - CodegenResponse r = CodegenModelFactory.newInstance(CodegenModelType.RESPONSE); - - if ("default".equals(responseCode) || "defaultResponse".equals(responseCode)) { - r.code = "0"; - r.isDefault = true; - } else { - r.code = responseCode; - switch (r.code.charAt(0)) { - case '1': - r.is1xx = true; - break; - case '2': - r.is2xx = true; - break; - case '3': - r.is3xx = true; - break; - case '4': - r.is4xx = true; - break; - case '5': - r.is5xx = true; - break; - default: - throw new RuntimeException("Invalid response code " + responseCode); - } - } - - Schema responseSchema; - if (this.openAPI != null && this.openAPI.getComponents() != null) { - responseSchema = unaliasSchema(ModelUtils.getSchemaFromResponse(response)); - } else { // no model/alias defined - responseSchema = ModelUtils.getSchemaFromResponse(response); - } - r.schema = responseSchema; - - r.message = escapeText(response.getDescription()); - // TODO need to revise and test examples in responses - // ApiResponse does not support examples at the moment - //r.examples = toExamples(response.getExamples()); - r.jsonSchema = Json.pretty(response); - if (response.getExtensions() != null && !response.getExtensions().isEmpty()) { - r.vendorExtensions.putAll(response.getExtensions()); - } - addHeaders(response, r.headers); - r.hasHeaders = !r.headers.isEmpty(); - - if (r.schema == null) { - r.primitiveType = true; - r.simpleType = true; - return r; - } - - ModelUtils.syncValidationProperties(responseSchema, r); - if (responseSchema.getPattern() != null) { - r.setPattern(toRegularExpression(responseSchema.getPattern())); - } - - CodegenProperty cp = fromProperty("response", responseSchema, false); - r.dataType = getTypeDeclaration(responseSchema); - - if (!ModelUtils.isArraySchema(responseSchema)) { - if (cp.complexType != null) { - if (cp.items != null) { - r.baseType = cp.items.complexType; - } else { - r.baseType = cp.complexType; - } - r.isModel = true; - } else { - r.baseType = cp.baseType; - } - } - - r.setTypeProperties(responseSchema); - r.setComposedSchemas(getComposedSchemas(responseSchema)); - if (ModelUtils.isArraySchema(responseSchema)) { - r.simpleType = false; - r.isArray = true; - r.containerType = cp.containerType; - ArraySchema as = (ArraySchema) responseSchema; - CodegenProperty items = fromProperty("response", getSchemaItems(as), false); - r.setItems(items); - CodegenProperty innerCp = items; - - while (innerCp != null) { - r.baseType = innerCp.baseType; - innerCp = innerCp.items; - } - } else if (ModelUtils.isFileSchema(responseSchema) && !ModelUtils.isStringSchema(responseSchema)) { - // swagger v2 only, type file - r.isFile = true; - } else if (ModelUtils.isStringSchema(responseSchema)) { - if (ModelUtils.isEmailSchema(responseSchema)) { - r.isEmail = true; - } else if (ModelUtils.isUUIDSchema(responseSchema)) { - r.isUuid = true; - } else if (ModelUtils.isByteArraySchema(responseSchema)) { - r.setIsString(false); - r.isByteArray = true; - } else if (ModelUtils.isBinarySchema(responseSchema)) { - r.isFile = true; // file = binary in OAS3 - r.isBinary = true; - } else if (ModelUtils.isDateSchema(responseSchema)) { - r.setIsString(false); // for backward compatibility with 2.x - r.isDate = true; - } else if (ModelUtils.isDateTimeSchema(responseSchema)) { - r.setIsString(false); // for backward compatibility with 2.x - r.isDateTime = true; - } else if (ModelUtils.isDecimalSchema(responseSchema)) { // type: string, format: number - r.isDecimal = true; - r.setIsString(false); - r.isNumeric = true; - } - } else if (ModelUtils.isIntegerSchema(responseSchema)) { // integer type - r.isNumeric = Boolean.TRUE; - if (ModelUtils.isLongSchema(responseSchema)) { // int64/long format - r.isLong = Boolean.TRUE; - } else { - r.isInteger = Boolean.TRUE; // older use case, int32 and unbounded int - if (ModelUtils.isShortSchema(responseSchema)) { // int32 - r.setIsShort(Boolean.TRUE); - } - } - } else if (ModelUtils.isNumberSchema(responseSchema)) { - r.isNumeric = Boolean.TRUE; - if (ModelUtils.isFloatSchema(responseSchema)) { // float - r.isFloat = Boolean.TRUE; - } else if (ModelUtils.isDoubleSchema(responseSchema)) { // double - r.isDouble = Boolean.TRUE; - } - } else if (ModelUtils.isTypeObjectSchema(responseSchema)) { - if (ModelUtils.isFreeFormObject(openAPI, responseSchema)) { - r.isFreeFormObject = true; - } else { - r.isModel = true; - } - r.simpleType = false; - r.containerType = cp.containerType; - addVarsRequiredVarsAdditionalProps(responseSchema, r); - } else if (ModelUtils.isAnyType(responseSchema)) { - addVarsRequiredVarsAdditionalProps(responseSchema, r); - } else if (!ModelUtils.isBooleanSchema(responseSchema)) { - // referenced schemas - LOGGER.debug("Property type is not primitive: {}", cp.dataType); - } - - r.primitiveType = (r.baseType == null || languageSpecificPrimitives().contains(r.baseType)); - - if (r.baseType == null) { - r.isMap = false; - r.isArray = false; - r.primitiveType = true; - r.simpleType = true; - } - - return r; - } - - /** - * Convert OAS Callback object to Codegen Callback object - * - * @param name callback name - * @param callback OAS Callback object - * @param servers list of servers - * @return Codegen Response object - */ - public CodegenCallback fromCallback(String name, Callback callback, List servers) { - CodegenCallback c = new CodegenCallback(); - c.name = name; - - if (callback.getExtensions() != null && !callback.getExtensions().isEmpty()) { - c.vendorExtensions.putAll(callback.getExtensions()); - } - - callback.forEach((expression, pi) -> { - CodegenCallback.Url u = new CodegenCallback.Url(); - u.expression = expression; - - if (pi.getExtensions() != null && !pi.getExtensions().isEmpty()) { - u.vendorExtensions.putAll(pi.getExtensions()); - } - - Stream.of( - Pair.of("get", pi.getGet()), - Pair.of("head", pi.getHead()), - Pair.of("put", pi.getPut()), - Pair.of("post", pi.getPost()), - Pair.of("delete", pi.getDelete()), - Pair.of("patch", pi.getPatch()), - Pair.of("options", pi.getOptions())) - .filter(p -> p.getValue() != null) - .forEach(p -> { - String method = p.getKey(); - Operation op = p.getValue(); - - boolean genId = op.getOperationId() == null; - if (genId) { - op.setOperationId(getOrGenerateOperationId(op, c.name + "_" + expression.replaceAll("\\{\\$.*}", ""), method)); - } - - if (op.getExtensions() == null) { - op.setExtensions(new HashMap<>()); - } - // This extension will be removed later by `fromOperation()` as it is only needed here to - // distinguish between normal operations and callback requests - op.getExtensions().put("x-callback-request", true); - - CodegenOperation co = fromOperation(expression, method, op, servers); - if (genId) { - co.operationIdOriginal = null; - // legacy (see `fromOperation()`) - co.nickname = co.operationId; - } - u.requests.add(co); - }); - - c.urls.add(u); - }); - - return c; - } - - private void finishUpdatingParameter(CodegenParameter codegenParameter, Parameter parameter) { - // default to UNKNOWN_PARAMETER_NAME if paramName is null - if (codegenParameter.paramName == null) { - LOGGER.warn("Parameter name not defined properly. Default to UNKNOWN_PARAMETER_NAME"); - codegenParameter.paramName = "UNKNOWN_PARAMETER_NAME"; - } - - // set the parameter example value - // should be overridden by lang codegen - setParameterExampleValue(codegenParameter, parameter); - - postProcessParameter(codegenParameter); - LOGGER.debug("debugging codegenParameter return: {}", codegenParameter); - } - - - private void updateParameterForMap(CodegenParameter codegenParameter, Schema parameterSchema, Set imports) { - CodegenProperty codegenProperty = fromProperty("inner", getAdditionalProperties(parameterSchema), false); - codegenParameter.items = codegenProperty; - codegenParameter.mostInnerItems = codegenProperty.mostInnerItems; - codegenParameter.baseType = codegenProperty.dataType; - codegenParameter.isContainer = true; - codegenParameter.isMap = true; - - if (!addSchemaImportsFromV3SpecLocations) { - // recursively add import - while (codegenProperty != null) { - imports.add(codegenProperty.baseType); - codegenProperty = codegenProperty.items; - } - } - } - - protected void updateParameterForString(CodegenParameter codegenParameter, Schema parameterSchema) { - if (ModelUtils.isEmailSchema(parameterSchema)) { - codegenParameter.isEmail = true; - } else if (ModelUtils.isUUIDSchema(parameterSchema)) { - codegenParameter.isUuid = true; - } else if (ModelUtils.isByteArraySchema(parameterSchema)) { - codegenParameter.setIsString(false); - codegenParameter.isByteArray = true; - codegenParameter.isPrimitiveType = true; - } else if (ModelUtils.isBinarySchema(parameterSchema)) { - codegenParameter.isBinary = true; - codegenParameter.isFile = true; // file = binary in OAS3 - codegenParameter.isPrimitiveType = true; - } else if (ModelUtils.isDateSchema(parameterSchema)) { - codegenParameter.setIsString(false); // for backward compatibility with 2.x - codegenParameter.isDate = true; - codegenParameter.isPrimitiveType = true; - } else if (ModelUtils.isDateTimeSchema(parameterSchema)) { - codegenParameter.setIsString(false); // for backward compatibility with 2.x - codegenParameter.isDateTime = true; - codegenParameter.isPrimitiveType = true; - } else if (ModelUtils.isDecimalSchema(parameterSchema)) { // type: string, format: number - codegenParameter.setIsString(false); - codegenParameter.isDecimal = true; - codegenParameter.isPrimitiveType = true; - } - if (Boolean.TRUE.equals(codegenParameter.isString)) { - codegenParameter.isPrimitiveType = true; - } - } - - /** - * Convert OAS Parameter object to Codegen Parameter object - * - * @param parameter OAS parameter object - * @param imports set of imports for library/package/module - * @return Codegen Parameter object - */ - public CodegenParameter fromParameter(Parameter parameter, Set imports) { - CodegenParameter codegenParameter = CodegenModelFactory.newInstance(CodegenModelType.PARAMETER); - - codegenParameter.baseName = parameter.getName(); - codegenParameter.description = escapeText(parameter.getDescription()); - codegenParameter.unescapedDescription = parameter.getDescription(); - if (parameter.getRequired() != null) { - codegenParameter.required = parameter.getRequired(); - } - if (parameter.getDeprecated() != null) { - codegenParameter.isDeprecated = parameter.getDeprecated(); - } - codegenParameter.jsonSchema = Json.pretty(parameter); - - if (GlobalSettings.getProperty("debugParser") != null) { - LOGGER.info("working on Parameter {}", parameter.getName()); - LOGGER.info("JSON schema: {}", codegenParameter.jsonSchema); - } - - if (parameter.getExtensions() != null && !parameter.getExtensions().isEmpty()) { - codegenParameter.vendorExtensions.putAll(parameter.getExtensions()); - } - - Schema parameterSchema; - - // the parameter model name is obtained from the schema $ref - // e.g. #/components/schemas/list_pageQuery_parameter => toModelName(list_pageQuery_parameter) - String parameterModelName = null; - - if (parameter.getSchema() != null) { - parameterSchema = unaliasSchema(parameter.getSchema()); - parameterModelName = getParameterDataType(parameter, parameterSchema); - CodegenProperty prop; - if (getUseInlineModelResolver()) { - prop = fromProperty(parameter.getName(), getReferencedSchemaWhenNotEnum(parameterSchema), false); - } else { - prop = fromProperty(parameter.getName(), parameterSchema, false); - } - codegenParameter.setSchema(prop); - if (addSchemaImportsFromV3SpecLocations) { - addImports(imports, prop.getImports(importContainerType, importBaseType, generatorMetadata.getFeatureSet())); - } - } else if (parameter.getContent() != null) { - Content content = parameter.getContent(); - if (content.size() > 1) { - once(LOGGER).warn("Multiple schemas found in content, returning only the first one"); - } - Map.Entry entry = content.entrySet().iterator().next(); - codegenParameter.contentType = entry.getKey(); - parameterSchema = entry.getValue().getSchema(); - parameterModelName = getParameterDataType(parameter, parameterSchema); - } else { - parameterSchema = null; - } - - if (parameter instanceof QueryParameter || "query".equalsIgnoreCase(parameter.getIn())) { - codegenParameter.isQueryParam = true; - codegenParameter.isAllowEmptyValue = parameter.getAllowEmptyValue() != null && parameter.getAllowEmptyValue(); - } else if (parameter instanceof PathParameter || "path".equalsIgnoreCase(parameter.getIn())) { - codegenParameter.required = true; - codegenParameter.isPathParam = true; - } else if (parameter instanceof HeaderParameter || "header".equalsIgnoreCase(parameter.getIn())) { - codegenParameter.isHeaderParam = true; - } else if (parameter instanceof CookieParameter || "cookie".equalsIgnoreCase(parameter.getIn())) { - codegenParameter.isCookieParam = true; - } else { - LOGGER.warn("Unknown parameter type: {}", parameter.getName()); - } - - if (parameterSchema == null) { - LOGGER.error("Not handling {} as Body Parameter at the moment", parameter); - finishUpdatingParameter(codegenParameter, parameter); - return codegenParameter; - } - - // TODO need to review replacing empty map with schemaMapping instead - parameterSchema = unaliasSchema(parameterSchema); - if (parameterSchema == null) { - LOGGER.warn("warning! Schema not found for parameter \" {} \"", parameter.getName()); - finishUpdatingParameter(codegenParameter, parameter); - return codegenParameter; - } - - if (getUseInlineModelResolver()) { - parameterSchema = getReferencedSchemaWhenNotEnum(parameterSchema); - } - - ModelUtils.syncValidationProperties(parameterSchema, codegenParameter); - codegenParameter.setTypeProperties(parameterSchema); - codegenParameter.setComposedSchemas(getComposedSchemas(parameterSchema)); - - if (Boolean.TRUE.equals(parameterSchema.getNullable())) { // use nullable defined in the spec - codegenParameter.isNullable = true; - } - - // set default value - codegenParameter.defaultValue = toDefaultParameterValue(parameterSchema); - - if (parameter.getStyle() != null) { - codegenParameter.style = parameter.getStyle().toString(); - codegenParameter.isDeepObject = Parameter.StyleEnum.DEEPOBJECT == parameter.getStyle(); - } - - // the default value is false - // https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#user-content-parameterexplode - codegenParameter.isExplode = parameter.getExplode() == null ? false : parameter.getExplode(); - - // TODO revise collectionFormat, default collection format in OAS 3 appears to multi at least for query parameters - // https://swagger.io/docs/specification/serialization/ - String collectionFormat = null; - - if (ModelUtils.isFileSchema(parameterSchema) && !ModelUtils.isStringSchema(parameterSchema)) { - // swagger v2 only, type file - codegenParameter.isFile = true; - } else if (ModelUtils.isStringSchema(parameterSchema)) { - updateParameterForString(codegenParameter, parameterSchema); - } else if (ModelUtils.isBooleanSchema(parameterSchema)) { - codegenParameter.isPrimitiveType = true; - } else if (ModelUtils.isNumberSchema(parameterSchema)) { - codegenParameter.isPrimitiveType = true; - if (ModelUtils.isFloatSchema(parameterSchema)) { // float - codegenParameter.isFloat = true; - } else if (ModelUtils.isDoubleSchema(parameterSchema)) { // double - codegenParameter.isDouble = true; - } - } else if (ModelUtils.isIntegerSchema(parameterSchema)) { // integer type - codegenParameter.isPrimitiveType = true; - if (ModelUtils.isLongSchema(parameterSchema)) { // int64/long format - codegenParameter.isLong = true; - } else { - codegenParameter.isInteger = true; - if (ModelUtils.isShortSchema(parameterSchema)) { // int32/short format - codegenParameter.isShort = true; - } else { // unbounded integer - ; - } - } - } else if (ModelUtils.isTypeObjectSchema(parameterSchema)) { - if (ModelUtils.isMapSchema(parameterSchema)) { // for map parameter - updateParameterForMap(codegenParameter, parameterSchema, imports); - } - if (ModelUtils.isFreeFormObject(openAPI, parameterSchema)) { - codegenParameter.isFreeFormObject = true; - } - addVarsRequiredVarsAdditionalProps(parameterSchema, codegenParameter); - } else if (ModelUtils.isNullType(parameterSchema)) { - ; - } else if (ModelUtils.isAnyType(parameterSchema)) { - // any schema with no type set, composed schemas often do this - if (ModelUtils.isMapSchema(parameterSchema)) { // for map parameter - updateParameterForMap(codegenParameter, parameterSchema, imports); - } - addVarsRequiredVarsAdditionalProps(parameterSchema, codegenParameter); - } else if (ModelUtils.isArraySchema(parameterSchema)) { - final ArraySchema arraySchema = (ArraySchema) parameterSchema; - Schema inner = getSchemaItems(arraySchema); - - collectionFormat = getCollectionFormat(parameter); - // default to csv: - collectionFormat = StringUtils.isEmpty(collectionFormat) ? "csv" : collectionFormat; - CodegenProperty itemsProperty = fromProperty("inner", inner, false); - codegenParameter.items = itemsProperty; - codegenParameter.mostInnerItems = itemsProperty.mostInnerItems; - codegenParameter.baseType = itemsProperty.dataType; - codegenParameter.isContainer = true; - if (!addSchemaImportsFromV3SpecLocations) { - // recursively add import - while (itemsProperty != null) { - imports.add(itemsProperty.baseType); - itemsProperty = itemsProperty.items; - } - } - } else { - // referenced schemas - ; - } - - CodegenProperty codegenProperty = fromProperty(parameter.getName(), parameterSchema, false); - if (Boolean.TRUE.equals(codegenProperty.isModel)) { - codegenParameter.isModel = true; - } - - if (parameterModelName != null) { - codegenParameter.dataType = parameterModelName; - if (ModelUtils.isObjectSchema(parameterSchema)) { - codegenProperty.complexType = codegenParameter.dataType; - } - } else { - codegenParameter.dataType = codegenProperty.dataType; - } - if (!addSchemaImportsFromV3SpecLocations) { - if (ModelUtils.isSet(parameterSchema)) { - imports.add(codegenProperty.baseType); - } - } - codegenParameter.dataFormat = codegenProperty.dataFormat; - if (parameter.getRequired() != null) { - codegenParameter.required = parameter.getRequired().booleanValue(); - } - - // enum - updateCodegenPropertyEnum(codegenProperty); - codegenParameter.isEnum = codegenProperty.isEnum; - codegenParameter._enum = codegenProperty._enum; - codegenParameter.allowableValues = codegenProperty.allowableValues; - - if (codegenProperty.isEnum) { - codegenParameter.datatypeWithEnum = codegenProperty.datatypeWithEnum; - codegenParameter.enumName = codegenProperty.enumName; - if (codegenProperty.defaultValue != null) { - codegenParameter.enumDefaultValue = codegenProperty.defaultValue.replace(codegenProperty.enumName + ".", ""); - } - } - - if (codegenProperty.items != null && codegenProperty.items.isEnum) { - codegenParameter.datatypeWithEnum = codegenProperty.datatypeWithEnum; - codegenParameter.enumName = codegenProperty.enumName; - codegenParameter.items = codegenProperty.items; - codegenParameter.mostInnerItems = codegenProperty.mostInnerItems; - } - - codegenParameter.collectionFormat = collectionFormat; - if ("multi".equals(collectionFormat)) { - codegenParameter.isCollectionFormatMulti = true; - } - codegenParameter.paramName = toParamName(parameter.getName()); - if (!addSchemaImportsFromV3SpecLocations) { - // import - if (codegenProperty.complexType != null) { - imports.add(codegenProperty.complexType); - } - } - codegenParameter.pattern = toRegularExpression(parameterSchema.getPattern()); - - if (codegenParameter.isQueryParam && codegenParameter.isDeepObject && loadDeepObjectIntoItems) { - Schema schema = parameterSchema; - if (schema.get$ref() != null) { - schema = ModelUtils.getReferencedSchema(openAPI, schema); - } - codegenParameter.items = fromProperty(codegenParameter.paramName, schema, false); - // https://swagger.io/docs/specification/serialization/ - if (schema != null) { - Map> properties = schema.getProperties(); - List requiredVarNames = new ArrayList<>(); - if (schema.getRequired() != null) { - requiredVarNames.addAll(schema.getRequired()); - } - if (properties != null) { - codegenParameter.items.vars = - properties.entrySet().stream() - .map(entry -> { - CodegenProperty property = fromProperty(entry.getKey(), entry.getValue(), requiredVarNames.contains(entry.getKey())); - property.baseName = codegenParameter.baseName + "[" + entry.getKey() + "]"; - return property; - }).collect(Collectors.toList()); - } else { - //LOGGER.error("properties is null: {}", schema); - } - } else { - LOGGER.warn( - "No object schema found for deepObject parameter{} deepObject won't have specific properties", - codegenParameter); - } - } - - finishUpdatingParameter(codegenParameter, parameter); - return codegenParameter; - } - - private Schema getReferencedSchemaWhenNotEnum(Schema parameterSchema) { - Schema referencedSchema = ModelUtils.getReferencedSchema(openAPI, parameterSchema); - if (referencedSchema.getEnum() != null && !referencedSchema.getEnum().isEmpty()) { - referencedSchema = parameterSchema; - } - return referencedSchema; - } - - /** - * Returns the data type of parameter. - * Returns null by default to use the CodegenProperty.datatype value - * - * @param parameter Parameter - * @param schema Schema - * @return data type - */ - protected String getParameterDataType(Parameter parameter, Schema schema) { - Schema unaliasSchema = unaliasSchema(schema); - if (unaliasSchema.get$ref() != null) { - return toModelName(ModelUtils.getSimpleRef(unaliasSchema.get$ref())); - } - return null; - } - - // TODO revise below as it should be replaced by ModelUtils.isByteArraySchema(parameterSchema) - public boolean isDataTypeBinary(String dataType) { - if (dataType != null) { - return dataType.toLowerCase(Locale.ROOT).startsWith("byte"); - } else { - return false; - } - } - - // TODO revise below as it should be replaced by ModelUtils.isFileSchema(parameterSchema) - public boolean isDataTypeFile(String dataType) { - if (dataType != null) { - return dataType.toLowerCase(Locale.ROOT).equals("file"); - } else { - return false; - } - } - - /** - * Convert map of OAS SecurityScheme objects to a list of Codegen Security objects - * - * @param securitySchemeMap a map of OAS SecuritySchemeDefinition object - * @return a list of Codegen Security objects - */ - @Override - @SuppressWarnings("static-method") - public List fromSecurity(Map securitySchemeMap) { - if (securitySchemeMap == null) { - return Collections.emptyList(); - } - - List codegenSecurities = new ArrayList<>(securitySchemeMap.size()); - for (String key : securitySchemeMap.keySet()) { - final SecurityScheme securityScheme = securitySchemeMap.get(key); - if (SecurityScheme.Type.APIKEY.equals(securityScheme.getType())) { - final CodegenSecurity cs = defaultCodegenSecurity(key, securityScheme); - cs.isBasic = cs.isOAuth = false; - cs.isApiKey = true; - cs.keyParamName = securityScheme.getName(); - cs.isKeyInHeader = securityScheme.getIn() == SecurityScheme.In.HEADER; - cs.isKeyInQuery = securityScheme.getIn() == SecurityScheme.In.QUERY; - cs.isKeyInCookie = securityScheme.getIn() == SecurityScheme.In.COOKIE; //it assumes a validation step prior to generation. (cookie-auth supported from OpenAPI 3.0.0) - codegenSecurities.add(cs); - } else if (SecurityScheme.Type.HTTP.equals(securityScheme.getType())) { - final CodegenSecurity cs = defaultCodegenSecurity(key, securityScheme); - cs.isKeyInHeader = cs.isKeyInQuery = cs.isKeyInCookie = cs.isApiKey = cs.isOAuth = false; - cs.isBasic = true; - if ("basic".equalsIgnoreCase(securityScheme.getScheme())) { - cs.isBasicBasic = true; - } else if ("bearer".equalsIgnoreCase(securityScheme.getScheme())) { - cs.isBasicBearer = true; - cs.bearerFormat = securityScheme.getBearerFormat(); - } else if ("signature".equalsIgnoreCase(securityScheme.getScheme())) { - // HTTP signature as defined in https://datatracker.ietf.org/doc/draft-cavage-http-signatures/ - // The registry of security schemes is maintained by IANA. - // https://www.iana.org/assignments/http-authschemes/http-authschemes.xhtml - // As of January 2020, the "signature" scheme has not been registered with IANA yet. - // This scheme may have to be changed when it is officially registered with IANA. - cs.isHttpSignature = true; - once(LOGGER).warn("Security scheme 'HTTP signature' is a draft IETF RFC and subject to change."); - } else { - once(LOGGER).warn("Unknown scheme `{}` found in the HTTP security definition.", securityScheme.getScheme()); - } - codegenSecurities.add(cs); - } else if (SecurityScheme.Type.OAUTH2.equals(securityScheme.getType())) { - final OAuthFlows flows = securityScheme.getFlows(); - boolean isFlowEmpty = true; - if (securityScheme.getFlows() == null) { - throw new RuntimeException("missing oauth flow in " + key); - } - if (flows.getPassword() != null) { - final CodegenSecurity cs = defaultOauthCodegenSecurity(key, securityScheme); - setOauth2Info(cs, flows.getPassword()); - cs.isPassword = true; - cs.flow = "password"; - codegenSecurities.add(cs); - isFlowEmpty = false; - } - if (flows.getImplicit() != null) { - final CodegenSecurity cs = defaultOauthCodegenSecurity(key, securityScheme); - setOauth2Info(cs, flows.getImplicit()); - cs.isImplicit = true; - cs.flow = "implicit"; - codegenSecurities.add(cs); - isFlowEmpty = false; - } - if (flows.getClientCredentials() != null) { - final CodegenSecurity cs = defaultOauthCodegenSecurity(key, securityScheme); - setOauth2Info(cs, flows.getClientCredentials()); - cs.isApplication = true; - cs.flow = "application"; - codegenSecurities.add(cs); - isFlowEmpty = false; - } - if (flows.getAuthorizationCode() != null) { - final CodegenSecurity cs = defaultOauthCodegenSecurity(key, securityScheme); - setOauth2Info(cs, flows.getAuthorizationCode()); - cs.isCode = true; - cs.flow = "accessCode"; - codegenSecurities.add(cs); - isFlowEmpty = false; - } - - if (isFlowEmpty) { - once(LOGGER).error("Invalid flow definition defined in the security scheme: {}", flows); - } - } else { - once(LOGGER).error("Unknown type `{}` found in the security definition `{}`.", securityScheme.getType(), securityScheme.getName()); - } - } - - // sort auth methods to maintain the same order - Collections.sort(codegenSecurities, new Comparator() { - @Override - public int compare(CodegenSecurity one, CodegenSecurity another) { - return ObjectUtils.compare(one.name, another.name); - } - }); - - return codegenSecurities; - } - - private CodegenSecurity defaultCodegenSecurity(String key, SecurityScheme securityScheme) { - final CodegenSecurity cs = CodegenModelFactory.newInstance(CodegenModelType.SECURITY); - cs.name = key; - cs.type = securityScheme.getType().toString(); - cs.isCode = cs.isPassword = cs.isApplication = cs.isImplicit = false; - cs.isHttpSignature = false; - cs.isBasicBasic = cs.isBasicBearer = false; - cs.scheme = securityScheme.getScheme(); - if (securityScheme.getExtensions() != null) { - cs.vendorExtensions.putAll(securityScheme.getExtensions()); - } - return cs; - } - - private CodegenSecurity defaultOauthCodegenSecurity(String key, SecurityScheme securityScheme) { - final CodegenSecurity cs = defaultCodegenSecurity(key, securityScheme); - cs.isKeyInHeader = cs.isKeyInQuery = cs.isKeyInCookie = cs.isApiKey = cs.isBasic = false; - cs.isOAuth = true; - return cs; - } - - protected void setReservedWordsLowerCase(List words) { - reservedWords = new HashSet<>(); - for (String word : words) { - reservedWords.add(word.toLowerCase(Locale.ROOT)); - } - } - - protected boolean isReservedWord(String word) { - return word != null && reservedWords.contains(word.toLowerCase(Locale.ROOT)); - } - - /** - * Get operationId from the operation object, and if it's blank, generate a new one from the given parameters. - * - * @param operation the operation object - * @param path the path of the operation - * @param httpMethod the HTTP method of the operation - * @return the (generated) operationId - */ - protected String getOrGenerateOperationId(Operation operation, String path, String httpMethod) { - String operationId = operation.getOperationId(); - if (StringUtils.isBlank(operationId)) { - String tmpPath = path; - tmpPath = tmpPath.replaceAll("\\{", ""); - tmpPath = tmpPath.replaceAll("\\}", ""); - String[] parts = (tmpPath + "/" + httpMethod).split("/"); - StringBuilder builder = new StringBuilder(); - if ("/".equals(tmpPath)) { - // must be root tmpPath - builder.append("root"); - } - for (String part : parts) { - if (part.length() > 0) { - if (builder.toString().length() == 0) { - part = Character.toLowerCase(part.charAt(0)) + part.substring(1); - } else { - part = camelize(part); - } - builder.append(part); - } - } - operationId = sanitizeName(builder.toString()); - LOGGER.warn("Empty operationId found for path: {} {}. Renamed to auto-generated operationId: {}", httpMethod, path, operationId); - } - return operationId; - } - - /** - * Check the type to see if it needs import the library/module/package - * - * @param type name of the type - * @return true if the library/module/package of the corresponding type needs to be imported - */ - protected boolean needToImport(String type) { - return StringUtils.isNotBlank(type) && !defaultIncludes.contains(type) - && !languageSpecificPrimitives.contains(type); - } - - @SuppressWarnings("static-method") - protected List> toExamples(Map examples) { - if (examples == null) { - return null; - } - - final List> output = new ArrayList<>(examples.size()); - for (Map.Entry entry : examples.entrySet()) { - final Map kv = new HashMap<>(); - kv.put("contentType", entry.getKey()); - kv.put("example", entry.getValue()); - output.add(kv); - } - return output; - } - - /** - * Add headers to codegen property - * - * @param response API response - * @param properties list of codegen property - */ - protected void addHeaders(ApiResponse response, List properties) { - if (response.getHeaders() != null) { - for (Map.Entry headerEntry : response.getHeaders().entrySet()) { - String description = headerEntry.getValue().getDescription(); - // follow the $ref - Header header = ModelUtils.getReferencedHeader(this.openAPI, headerEntry.getValue()); - - Schema schema; - if (header.getSchema() == null) { - LOGGER.warn("No schema defined for Header '{}', using a String schema", headerEntry.getKey()); - schema = new StringSchema(); - } else { - schema = header.getSchema(); - } - CodegenProperty cp = fromProperty(headerEntry.getKey(), schema, false); - cp.setDescription(escapeText(description)); - cp.setUnescapedDescription(description); - if (header.getRequired() != null) { - cp.setRequired(header.getRequired()); - } else { - cp.setRequired(false); - } - properties.add(cp); - } - } - } - - /** - * Add operation to group - * - * @param tag name of the tag - * @param resourcePath path of the resource - * @param operation OAS Operation object - * @param co Codegen Operation object - * @param operations map of Codegen operations - */ - @Override - @SuppressWarnings("static-method") - public void addOperationToGroup(String tag, String resourcePath, Operation operation, CodegenOperation - co, Map> operations) { - List opList = operations.get(tag); - if (opList == null) { - opList = new ArrayList<>(); - operations.put(tag, opList); - } - // check for operationId uniqueness - String uniqueName = co.operationId; - int counter = 0; - for (CodegenOperation op : opList) { - if (uniqueName.equals(op.operationId)) { - uniqueName = co.operationId + "_" + counter; - counter++; - } - } - if (!co.operationId.equals(uniqueName)) { - LOGGER.warn("generated unique operationId `{}`", uniqueName); - } - co.operationId = uniqueName; - co.operationIdLowerCase = uniqueName.toLowerCase(Locale.ROOT); - co.operationIdCamelCase = camelize(uniqueName); - co.operationIdSnakeCase = underscore(uniqueName); - opList.add(co); - co.baseName = tag; - } - - /** - * Sets the value of the 'model.parent' property in CodegenModel, based on the value - * of the 'additionalProperties' keyword. Some language generator use class inheritance - * to implement additional properties. For example, in Java the generated model class - * has 'extends HashMap' to represent the additional properties. - *

    - * TODO: it's not a good idea to use single class inheritance to implement - * additionalProperties. That may work for non-composed schemas, but that does not - * work for composed 'allOf' schemas. For example, in Java, if additionalProperties - * is set to true (which it should be by default, per OAS spec), then the generated - * code has extends HashMap. That wouldn't work for composed 'allOf' schemas. - * - * @param model the codegen representation of the OAS schema. - * @param name the name of the model. - * @param schema the input OAS schema. - */ - protected void addParentContainer(CodegenModel model, String name, Schema schema) { - final CodegenProperty property = fromProperty(name, schema, false); - addImport(model, property.complexType); - model.parent = toInstantiationType(schema); - if (!addSchemaImportsFromV3SpecLocations) { - final String containerType = property.containerType; - final String instantiationType = instantiationTypes.get(containerType); - if (instantiationType != null) { - addImport(model, instantiationType); - } - - final String mappedType = typeMapping.get(containerType); - if (mappedType != null) { - addImport(model, mappedType); - } - } - } - - /** - * Generate the next name for the given name, i.e. append "2" to the base name if not ending with a number, - * otherwise increase the number by 1. For example: - * status => status2 - * status2 => status3 - * myName100 => myName101 - * - * @param name The base name - * @return The next name for the base name - */ - private static String generateNextName(String name) { - Pattern pattern = Pattern.compile("\\d+\\z"); - Matcher matcher = pattern.matcher(name); - if (matcher.find()) { - String numStr = matcher.group(); - int num = Integer.parseInt(numStr) + 1; - return name.substring(0, name.length() - numStr.length()) + num; - } else { - return name + "2"; - } - } - - protected void addImports(CodegenModel m, IJsonSchemaValidationProperties type) { - addImports(m.imports, type); - } - - protected void addImports(Set importsToBeAddedTo, IJsonSchemaValidationProperties type) { - addImports(importsToBeAddedTo, type.getImports(importContainerType, importBaseType, generatorMetadata.getFeatureSet())); - } - - protected void addImports(Set importsToBeAddedTo, Set importsToAdd) { - importsToAdd.stream().forEach(i -> addImport(importsToBeAddedTo, i)); - } - - protected void addImport(CodegenModel m, String type) { - addImport(m.imports, type); - } - - protected void addImport(Set importsToBeAddedTo, String type) { - if (shouldAddImport(type)) { - importsToBeAddedTo.add(type); - } - } - - /** - * Add the model name of the child schema in a composed schema to the set of imports - * - * @param composed composed schema - * @param childSchema composed schema - * @param model codegen model - * @param modelName model name - */ - protected void addImport(ComposedSchema composed, Schema childSchema, CodegenModel model, String modelName ) { - // import only if it's not allOf composition schema (without discriminator) - if (!(composed.getAllOf() != null && childSchema.getDiscriminator() == null)) { - addImport(model, modelName); - } else { - LOGGER.debug("Skipped import for allOf composition schema {}", modelName); - } - } - - protected boolean shouldAddImport(String type) { - return type != null && needToImport(type); - } - - /** - * Loop through properties and unalias the reference if $ref (reference) is defined - * - * @param properties model properties (schemas) - * @return model properties with direct reference to schemas - */ - protected Map unaliasPropertySchema(Map properties) { - if (properties != null) { - for (String key : properties.keySet()) { - properties.put(key, unaliasSchema(properties.get(key))); - - } - } - - return properties; - } - - protected void addVars(CodegenModel m, Map properties, List required, - Map allProperties, List allRequired) { - - m.hasRequired = false; - if (properties != null && !properties.isEmpty()) { - m.hasVars = true; - - Set mandatory = required == null ? Collections.emptySet() - : new TreeSet<>(required); - - // update "vars" without parent's properties (all, required) - addVars(m, m.vars, properties, mandatory); - m.allMandatory = m.mandatory = mandatory; - } else { - m.emptyVars = true; - m.hasVars = false; - m.hasEnums = false; - } - - if (allProperties != null) { - Set allMandatory = allRequired == null ? Collections.emptySet() - : new TreeSet<>(allRequired); - // update "allVars" with parent's properties (all, required) - addVars(m, m.allVars, allProperties, allMandatory); - m.allMandatory = allMandatory; - } else { // without parent, allVars and vars are the same - m.allVars = m.vars; - m.allMandatory = m.mandatory; - } - - // loop through list to update property name with toVarName - Set renamedMandatory = new ConcurrentSkipListSet<>(); - Iterator mandatoryIterator = m.mandatory.iterator(); - while (mandatoryIterator.hasNext()) { - renamedMandatory.add(toVarName(mandatoryIterator.next())); - } - m.mandatory = renamedMandatory; - - Set renamedAllMandatory = new ConcurrentSkipListSet<>(); - Iterator allMandatoryIterator = m.allMandatory.iterator(); - while (allMandatoryIterator.hasNext()) { - renamedAllMandatory.add(toVarName(allMandatoryIterator.next())); - } - m.allMandatory = renamedAllMandatory; - } - - /** - * Add variables (properties) to codegen model (list of properties, various flags, etc) - * - * @param m Must be an instance of IJsonSchemaValidationProperties, may be model or property... - * @param vars list of codegen properties (e.g. vars, allVars) to be updated with the new properties - * @param properties a map of properties (schema) - * @param mandatory a set of required properties' name - */ - protected void addVars(IJsonSchemaValidationProperties m, List vars, Map properties, Set mandatory) { - if (properties == null) { - return; - } - - HashMap varsMap = new HashMap<>(); - CodegenModel cm = null; - if (m instanceof CodegenModel) { - cm = (CodegenModel) m; - - if (cm.allVars == vars) { // processing allVars - for (CodegenProperty var : cm.vars) { - // create a map of codegen properties for lookup later - varsMap.put(var.baseName, var); - } - } - } - - for (Map.Entry entry : properties.entrySet()) { - final String key = entry.getKey(); - final Schema prop = entry.getValue(); - if (prop == null) { - LOGGER.warn("Please report the issue. There shouldn't be null property for {}", key); - } else { - final CodegenProperty cp; - - if (cm != null && cm.allVars == vars && varsMap.keySet().contains(key)) { - // when updating allVars, reuse the codegen property from the child model if it's already present - // the goal is to avoid issues when the property is defined in both child, parent but the - // definition is not identical, e.g. required vs optional, integer vs string - LOGGER.debug("The property `{}` already defined in the child model. Using the one from child.", - key); - cp = varsMap.get(key); - } else { - // properties in the parent model only - cp = fromProperty(key, prop, mandatory.contains(key)); - } - - vars.add(cp); - m.setHasVars(true); - - if (cp.required) { - m.setHasRequired(true); - m.getRequiredVars().add(cp); - } - - if (cm == null) { - continue; - } - cm.hasOptional = cm.hasOptional || !cp.required; - if (cp.isEnum) { - // FIXME: if supporting inheritance, when called a second time for allProperties it is possible for - // m.hasEnums to be set incorrectly if allProperties has enumerations but properties does not. - cm.hasEnums = true; - } - - // set model's hasOnlyReadOnly to false if the property is read-only - if (!Boolean.TRUE.equals(cp.isReadOnly)) { - cm.hasOnlyReadOnly = false; - } - if (!addSchemaImportsFromV3SpecLocations) { - addImportsForPropertyType(cm, cp); - } - - // if required, add to the list "requiredVars" - if (Boolean.FALSE.equals(cp.required)) { - cm.optionalVars.add(cp); - } - - // if readonly, add to readOnlyVars (list of properties) - if (Boolean.TRUE.equals(cp.isReadOnly)) { - cm.readOnlyVars.add(cp); - } else { // else add to readWriteVars (list of properties) - // duplicated properties will be removed by removeAllDuplicatedProperty later - cm.readWriteVars.add(cp); - } - - if (Boolean.FALSE.equals(cp.isNullable)){ - cm.nonNullableVars.add(cp); - } - } - } - return; - } - - /** - * For a given property, adds all needed imports to the model - * This includes a flat property type (e.g. property type: ReferencedModel) - * as well as container type (property type: array of ReferencedModel's) - * - * @param model The codegen representation of the OAS schema. - * @param property The codegen representation of the OAS schema's property. - */ - protected void addImportsForPropertyType(CodegenModel model, CodegenProperty property) { - if (property.isArray) { - if (Boolean.TRUE.equals(property.getUniqueItemsBoolean())) { // set - addImport(model.imports, typeMapping.get("set")); - } else { // array - addImport(model.imports, typeMapping.get("array")); - } - } - - if (property.isMap) { // map - addImport(model.imports, typeMapping.get("map")); - } - - addImports(model, property); - } - - /** - * Determine all of the types in the model definitions (schemas) that are aliases of - * simple types. - * - * @param schemas The complete set of model definitions (schemas). - * @return A mapping from model name to type alias - */ - Map getAllAliases(Map schemas) { - if (schemas == null || schemas.isEmpty()) { - return new HashMap<>(); - } - - Map aliases = new HashMap<>(); - for (Map.Entry entry : schemas.entrySet()) { - Schema schema = entry.getValue(); - if (isAliasOfSimpleTypes(schema)) { - String oasName = entry.getKey(); - String schemaType = getPrimitiveType(schema); - aliases.put(oasName, schemaType); - } - - } - - return aliases; - } - - private static Boolean isAliasOfSimpleTypes(Schema schema) { - return (!ModelUtils.isObjectSchema(schema) - && !ModelUtils.isArraySchema(schema) - && !ModelUtils.isMapSchema(schema) - && !ModelUtils.isComposedSchema(schema) - && schema.getEnum() == null); - } - - /** - * Remove characters not suitable for variable or method name from the input and camelize it - * - * @param name string to be camelize - * @return camelized string - */ - @SuppressWarnings("static-method") - public String removeNonNameElementToCamelCase(String name) { - return removeNonNameElementToCamelCase(name, "[-_:;#" + removeOperationIdPrefixDelimiter + "]"); - } - - /** - * Remove characters that is not good to be included in method name from the input and camelize it - * - * @param name string to be camelize - * @param nonNameElementPattern a regex pattern of the characters that is not good to be included in name - * @return camelized string - */ - protected String removeNonNameElementToCamelCase(final String name, final String nonNameElementPattern) { - String result = Arrays.stream(name.split(nonNameElementPattern)) - .map(StringUtils::capitalize) - .collect(Collectors.joining("")); - if (result.length() > 0) { - result = result.substring(0, 1).toLowerCase(Locale.ROOT) + result.substring(1); - } - return result; - } - - @Override - public String apiFilename(String templateName, String tag) { - String suffix = apiTemplateFiles().get(templateName); - return apiFileFolder() + File.separator + toApiFilename(tag) + suffix; - } - - @Override - public String modelFilename(String templateName, String modelName) { - String suffix = modelTemplateFiles().get(templateName); - return modelFileFolder() + File.separator + toModelFilename(modelName) + suffix; - } - - /** - * Return the full path and API documentation file - * - * @param templateName template name - * @param tag tag - * @return the API documentation file name with full path - */ - @Override - public String apiDocFilename(String templateName, String tag) { - String docExtension = getDocExtension(); - String suffix = docExtension != null ? docExtension : apiDocTemplateFiles().get(templateName); - return apiDocFileFolder() + File.separator + toApiDocFilename(tag) + suffix; - } - - /** - * Return the full path and API test file - * - * @param templateName template name - * @param tag tag - * @return the API test file name with full path - */ - @Override - public String apiTestFilename(String templateName, String tag) { - String suffix = apiTestTemplateFiles().get(templateName); - return apiTestFileFolder() + File.separator + toApiTestFilename(tag) + suffix; - } - - @Override - public boolean shouldOverwrite(String filename) { - return !(skipOverwrite && new File(filename).exists()); - } - - @Override - public boolean isSkipOverwrite() { - return skipOverwrite; - } - - @Override - public void setSkipOverwrite(boolean skipOverwrite) { - this.skipOverwrite = skipOverwrite; - } - - @Override - public boolean isRemoveOperationIdPrefix() { - return removeOperationIdPrefix; - } - - @Override - public boolean isSkipOperationExample() { - return skipOperationExample; - } - - @Override - public void setRemoveOperationIdPrefix(boolean removeOperationIdPrefix) { - this.removeOperationIdPrefix = removeOperationIdPrefix; - } - - public String getRemoveOperationIdPrefixDelimiter() { - return removeOperationIdPrefixDelimiter; - } - - public void setRemoveOperationIdPrefixDelimiter(String removeOperationIdPrefixDelimiter) { - this.removeOperationIdPrefixDelimiter = removeOperationIdPrefixDelimiter; - } - - public int getRemoveOperationIdPrefixCount() { - return removeOperationIdPrefixCount; - } - - public void setRemoveOperationIdPrefixCount(int removeOperationIdPrefixCount) { - this.removeOperationIdPrefixCount = removeOperationIdPrefixCount; - } - - @Override - public void setSkipOperationExample(boolean skipOperationExample) { - this.skipOperationExample = skipOperationExample; - } - - @Override - public boolean isHideGenerationTimestamp() { - return hideGenerationTimestamp; - } - - @Override - public void setHideGenerationTimestamp(boolean hideGenerationTimestamp) { - this.hideGenerationTimestamp = hideGenerationTimestamp; - } - - /** - * All library templates supported. - * (key: library name, value: library description) - * - * @return the supported libraries - */ - @Override - public Map supportedLibraries() { - return supportedLibraries; - } - - /** - * Set library template (sub-template). - * - * @param library Library template - */ - @Override - public void setLibrary(String library) { - if (library != null && !supportedLibraries.containsKey(library)) { - StringBuilder sb = new StringBuilder("Unknown library: " + library + "\nAvailable libraries:"); - if (supportedLibraries.size() == 0) { - sb.append("\n ").append("NONE"); - } else { - for (String lib : supportedLibraries.keySet()) { - sb.append("\n ").append(lib); - } - } - throw new RuntimeException(sb.toString()); - } - this.library = library; - } - - /** - * Library template (sub-template). - * - * @return Library template - */ - @Override - public String getLibrary() { - return library; - } - - /** - * check if current active library equals to passed - * - * @param library - library to be compared with - * @return {@code true} if passed library is active, {@code false} otherwise - */ - public final boolean isLibrary(String library) { - return library.equals(this.library); - } - - /** - * Set Git host. - * - * @param gitHost Git host - */ - @Override - public void setGitHost(String gitHost) { - this.gitHost = gitHost; - } - - /** - * Git host. - * - * @return Git host - */ - @Override - public String getGitHost() { - return gitHost; - } - - /** - * Set Git user ID. - * - * @param gitUserId Git user ID - */ - @Override - public void setGitUserId(String gitUserId) { - this.gitUserId = gitUserId; - } - - /** - * Git user ID - * - * @return Git user ID - */ - @Override - public String getGitUserId() { - return gitUserId; - } - - /** - * Set Git repo ID. - * - * @param gitRepoId Git repo ID - */ - @Override - public void setGitRepoId(String gitRepoId) { - this.gitRepoId = gitRepoId; - } - - /** - * Git repo ID - * - * @return Git repo ID - */ - @Override - public String getGitRepoId() { - return gitRepoId; - } - - /** - * Set release note. - * - * @param releaseNote Release note - */ - @Override - public void setReleaseNote(String releaseNote) { - this.releaseNote = releaseNote; - } - - /** - * Release note - * - * @return Release note - */ - @Override - public String getReleaseNote() { - return releaseNote; - } - - /** - * Documentation files extension - * - * @return Documentation files extension - */ - @Override - public String getDocExtension() { - return docExtension; - } - - /** - * Set Documentation files extension - * - * @param userDocExtension documentation files extension - */ - @Override - public void setDocExtension(String userDocExtension) { - this.docExtension = userDocExtension; - } - - /** - * Set HTTP user agent. - * - * @param httpUserAgent HTTP user agent - */ - @Override - public void setHttpUserAgent(String httpUserAgent) { - this.httpUserAgent = httpUserAgent; - } - - /** - * HTTP user agent - * - * @return HTTP user agent - */ - @Override - public String getHttpUserAgent() { - return httpUserAgent; - } - - @SuppressWarnings("static-method") - protected CliOption buildLibraryCliOption(Map supportedLibraries) { - StringBuilder sb = new StringBuilder("library template (sub-template) to use:"); - for (String lib : supportedLibraries.keySet()) { - sb.append("\n").append(lib).append(" - ").append(supportedLibraries.get(lib)); - } - return new CliOption(CodegenConstants.LIBRARY, sb.toString()); - } - - /** - * Sanitize name (parameter, property, method, etc) - * - * @param name string to be sanitize - * @return sanitized string - */ - @Override - @SuppressWarnings("static-method") - public String sanitizeName(String name) { - return sanitizeName(name, "\\W"); - } - - @Override - public void setTemplatingEngine(TemplatingEngineAdapter templatingEngine) { - this.templatingEngine = templatingEngine; - } - - @Override - public TemplatingEngineAdapter getTemplatingEngine() { - return this.templatingEngine; - } - - /** - * Sanitize name (parameter, property, method, etc) - * - * @param name string to be sanitize - * @param removeCharRegEx a regex containing all char that will be removed - * @return sanitized string - */ - public String sanitizeName(String name, String removeCharRegEx) { - return sanitizeName(name, removeCharRegEx, new ArrayList<>()); - } - - /** - * Sanitize name (parameter, property, method, etc) - * - * @param name string to be sanitize - * @param removeCharRegEx a regex containing all char that will be removed - * @param exceptionList a list of matches which should not be sanitized (i.e exception) - * @return sanitized string - */ - @SuppressWarnings("static-method") - public String sanitizeName(final String name, String removeCharRegEx, ArrayList exceptionList) { - // NOTE: performance wise, we should have written with 2 replaceAll to replace desired - // character with _ or empty character. Below aims to spell out different cases we've - // encountered so far and hopefully make it easier for others to add more special - // cases in the future. - - // better error handling when map/array type is invalid - if (name == null) { - LOGGER.error("String to be sanitized is null. Default to ERROR_UNKNOWN"); - return "ERROR_UNKNOWN"; - } - - // if the name is just '$', map it to 'value' for the time being. - if ("$".equals(name)) { - return "value"; - } - - SanitizeNameOptions opts = new SanitizeNameOptions(name, removeCharRegEx, exceptionList); - - return sanitizedNameCache.get(opts, sanitizeNameOptions -> { - String modifiable = sanitizeNameOptions.getName(); - List exceptions = sanitizeNameOptions.getExceptions(); - // input[] => input - modifiable = this.sanitizeValue(modifiable, "\\[\\]", "", exceptions); - - // input[a][b] => input_a_b - modifiable = this.sanitizeValue(modifiable, "\\[", "_", exceptions); - modifiable = this.sanitizeValue(modifiable, "\\]", "", exceptions); - - // input(a)(b) => input_a_b - modifiable = this.sanitizeValue(modifiable, "\\(", "_", exceptions); - modifiable = this.sanitizeValue(modifiable, "\\)", "", exceptions); - - // input.name => input_name - modifiable = this.sanitizeValue(modifiable, "\\.", "_", exceptions); - - // input-name => input_name - modifiable = this.sanitizeValue(modifiable, "-", "_", exceptions); - - // a|b => a_b - modifiable = this.sanitizeValue(modifiable, "\\|", "_", exceptions); - - // input name and age => input_name_and_age - modifiable = this.sanitizeValue(modifiable, " ", "_", exceptions); - - // /api/films/get => _api_films_get - // \api\films\get => _api_films_get - modifiable = modifiable.replaceAll("/", "_"); - modifiable = modifiable.replaceAll("\\\\", "_"); - - // remove everything else other than word, number and _ - // $php_variable => php_variable - if (allowUnicodeIdentifiers) { //could be converted to a single line with ?: operator - modifiable = Pattern.compile(sanitizeNameOptions.getRemoveCharRegEx(), Pattern.UNICODE_CHARACTER_CLASS).matcher(modifiable).replaceAll(""); - } else { - modifiable = modifiable.replaceAll(sanitizeNameOptions.getRemoveCharRegEx(), ""); - } - return modifiable; - }); - } - - private String sanitizeValue(String value, String replaceMatch, String replaceValue, List exceptionList) { - if (exceptionList.size() == 0 || !exceptionList.contains(replaceMatch)) { - return value.replaceAll(replaceMatch, replaceValue); - } - return value; - } - - /** - * Sanitize tag - * - * @param tag Tag - * @return Sanitized tag - */ - @Override - public String sanitizeTag(String tag) { - tag = camelize(sanitizeName(tag)); - - // tag starts with numbers - if (tag.matches("^\\d.*")) { - tag = "Class" + tag; - } - - return tag; - } - - /** - * Set CodegenParameter boolean flag using CodegenProperty. - * NOTE: This is deprecated and can be removed in 6.0.0 - * This logic has been folded into the original call sites and long term will be moved into - * IJsonSchemaValidationProperties.setTypeProperties and overrides like updateModelForObject - * - * @param parameter Codegen Parameter - * @param property Codegen property - */ - public void setParameterBooleanFlagWithCodegenProperty(CodegenParameter parameter, CodegenProperty property) { - if (parameter == null) { - LOGGER.error("Codegen Parameter cannot be null."); - return; - } - - if (property == null) { - LOGGER.error("Codegen Property cannot be null."); - return; - } - if (Boolean.TRUE.equals(property.isEmail) && Boolean.TRUE.equals(property.isString)) { - parameter.isEmail = true; - } else if (Boolean.TRUE.equals(property.isUuid) && Boolean.TRUE.equals(property.isString)) { - parameter.isUuid = true; - } else if (Boolean.TRUE.equals(property.isByteArray)) { - parameter.isByteArray = true; - parameter.isPrimitiveType = true; - } else if (Boolean.TRUE.equals(property.isBinary)) { - parameter.isBinary = true; - parameter.isPrimitiveType = true; - } else if (Boolean.TRUE.equals(property.isString)) { - parameter.isString = true; - parameter.isPrimitiveType = true; - } else if (Boolean.TRUE.equals(property.isBoolean)) { - parameter.isBoolean = true; - parameter.isPrimitiveType = true; - } else if (Boolean.TRUE.equals(property.isLong)) { - parameter.isLong = true; - parameter.isPrimitiveType = true; - } else if (Boolean.TRUE.equals(property.isInteger)) { - parameter.isInteger = true; - parameter.isPrimitiveType = true; - if (Boolean.TRUE.equals(property.isShort)) { - parameter.isShort = true; - } else if (Boolean.TRUE.equals(property.isUnboundedInteger)) { - parameter.isUnboundedInteger = true; - } - } else if (Boolean.TRUE.equals(property.isDouble)) { - parameter.isDouble = true; - parameter.isPrimitiveType = true; - } else if (Boolean.TRUE.equals(property.isFloat)) { - parameter.isFloat = true; - parameter.isPrimitiveType = true; - } else if (Boolean.TRUE.equals(property.isDecimal)) { - parameter.isDecimal = true; - parameter.isPrimitiveType = true; - } else if (Boolean.TRUE.equals(property.isNumber)) { - parameter.isNumber = true; - parameter.isPrimitiveType = true; - } else if (Boolean.TRUE.equals(property.isDate)) { - parameter.isDate = true; - parameter.isPrimitiveType = true; - } else if (Boolean.TRUE.equals(property.isDateTime)) { - parameter.isDateTime = true; - parameter.isPrimitiveType = true; - } else if (Boolean.TRUE.equals(property.isFreeFormObject)) { - parameter.isFreeFormObject = true; - } else if (Boolean.TRUE.equals(property.isAnyType)) { - parameter.isAnyType = true; - } else { - LOGGER.debug("Property type is not primitive: {}", property.dataType); - } - - if (Boolean.TRUE.equals(property.isFile)) { - parameter.isFile = true; - } - if (Boolean.TRUE.equals(property.isModel)) { - parameter.isModel = true; - } - } - - /** - * Update codegen property's enum by adding "enumVars" (with name and value) - * - * @param var list of CodegenProperty - */ - public void updateCodegenPropertyEnum(CodegenProperty var) { - Map allowableValues = var.allowableValues; - - // handle array - if (var.mostInnerItems != null) { - allowableValues = var.mostInnerItems.allowableValues; - } - - if (allowableValues == null) { - return; - } - - List values = (List) allowableValues.get("values"); - if (values == null) { - return; - } - - String varDataType = var.mostInnerItems != null ? var.mostInnerItems.dataType : var.dataType; - Optional referencedSchema = ModelUtils.getSchemas(openAPI).entrySet().stream() - .filter(entry -> Objects.equals(varDataType, toModelName(entry.getKey()))) - .map(Map.Entry::getValue) - .findFirst(); - String dataType = (referencedSchema.isPresent()) ? getTypeDeclaration(referencedSchema.get()) : varDataType; - List> enumVars = buildEnumVars(values, dataType); - - // if "x-enum-varnames" or "x-enum-descriptions" defined, update varnames - Map extensions = var.mostInnerItems != null ? var.mostInnerItems.getVendorExtensions() : var.getVendorExtensions(); - if (referencedSchema.isPresent()) { - extensions = referencedSchema.get().getExtensions(); - } - updateEnumVarsWithExtensions(enumVars, extensions, dataType); - allowableValues.put("enumVars", enumVars); - - // handle default value for enum, e.g. available => StatusEnum.AVAILABLE - if (var.defaultValue != null) { - final String enumDefaultValue = getEnumDefaultValue(var.defaultValue, dataType); - - String enumName = null; - for (Map enumVar : enumVars) { - if (enumDefaultValue.equals(enumVar.get("value"))) { - enumName = (String) enumVar.get("name"); - break; - } - } - if (enumName != null) { - var.defaultValue = toEnumDefaultValue(enumName, var.datatypeWithEnum); - } - } - } - - protected String getEnumDefaultValue(String defaultValue, String dataType) { - final String enumDefaultValue; - if (isDataTypeString(dataType)) { - enumDefaultValue = toEnumValue(defaultValue, dataType); - } else { - enumDefaultValue = defaultValue; - } - return enumDefaultValue; - } - - protected List> buildEnumVars(List values, String dataType) { - List> enumVars = new ArrayList<>(); - int truncateIdx = 0; - - if (isRemoveEnumValuePrefix()) { - String commonPrefix = findCommonPrefixOfVars(values); - truncateIdx = commonPrefix.length(); - } - - for (Object value : values) { - Map enumVar = new HashMap<>(); - String enumName; - if (truncateIdx == 0) { - enumName = String.valueOf(value); - } else { - enumName = value.toString().substring(truncateIdx); - if (enumName.isEmpty()) { - enumName = value.toString(); - } - } - - enumVar.put("name", toEnumVarName(enumName, dataType)); - enumVar.put("value", toEnumValue(String.valueOf(value), dataType)); - enumVar.put("isString", isDataTypeString(dataType)); - enumVars.add(enumVar); - } - - if (enumUnknownDefaultCase) { - // If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response. - // With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case. - Map enumVar = new HashMap<>(); - String enumName = enumUnknownDefaultCaseName; - - String enumValue; - if (isDataTypeString(dataType)) { - enumValue = enumUnknownDefaultCaseName; - } else { - // This is a dummy value that attempts to avoid collisions with previously specified cases. - // Int.max / 192 - // The number 192 that is used to calculate this random value, is the Swift Evolution proposal for frozen/non-frozen enums. - // [SE-0192](https://github.com/apple/swift-evolution/blob/master/proposals/0192-non-exhaustive-enums.md) - // Since this functionality was born in the Swift 5 generator and latter on broth to all generators - // https://github.com/OpenAPITools/openapi-generator/pull/11013 - enumValue = String.valueOf(11184809); - } - - enumVar.put("name", toEnumVarName(enumName, dataType)); - enumVar.put("value", toEnumValue(enumValue, dataType)); - enumVar.put("isString", isDataTypeString(dataType)); - enumVars.add(enumVar); - } - - return enumVars; - } - - protected void updateEnumVarsWithExtensions(List> enumVars, Map vendorExtensions, String dataType) { - if (vendorExtensions != null) { - updateEnumVarsWithExtensions(enumVars, vendorExtensions, "x-enum-varnames", "name"); - updateEnumVarsWithExtensions(enumVars, vendorExtensions, "x-enum-descriptions", "enumDescription"); - } - } - - private void updateEnumVarsWithExtensions(List> enumVars, Map vendorExtensions, String extensionKey, String key) { - if (vendorExtensions.containsKey(extensionKey)) { - List values = (List) vendorExtensions.get(extensionKey); - int size = Math.min(enumVars.size(), values.size()); - for (int i = 0; i < size; i++) { - enumVars.get(i).put(key, values.get(i)); - } - } - } - - /** - * If the pattern misses the delimiter, add "/" to the beginning and end - * Otherwise, return the original pattern - * - * @param pattern the pattern (regular expression) - * @return the pattern with delimiter - */ - public String addRegularExpressionDelimiter(String pattern) { - if (StringUtils.isEmpty(pattern)) { - return pattern; - } - - if (!pattern.matches("^/.*")) { - return "/" + pattern.replaceAll("/", "\\\\/") + "/"; - } - - return pattern; - } - - /** - * reads propertyKey from additionalProperties, converts it to a boolean and - * writes it back to additionalProperties to be usable as a boolean in - * mustache files. - * - * @param propertyKey property key - * @return property value as boolean - */ - public boolean convertPropertyToBooleanAndWriteBack(String propertyKey) { - boolean result = convertPropertyToBoolean(propertyKey); - writePropertyBack(propertyKey, result); - return result; - } - - /** - * Provides an override location, if any is specified, for the .openapi-generator-ignore. - *

    - * This is originally intended for the first generation only. - * - * @return a string of the full path to an override ignore file. - */ - @Override - public String getIgnoreFilePathOverride() { - return ignoreFilePathOverride; - } - - /** - * Sets an override location for the '.openapi-generator-ignore' location for the first code generation. - * - * @param ignoreFileOverride The full path to an ignore file - */ - @Override - public void setIgnoreFilePathOverride(final String ignoreFileOverride) { - this.ignoreFilePathOverride = ignoreFileOverride; - } - - public boolean convertPropertyToBoolean(String propertyKey) { - final Object booleanValue = additionalProperties.get(propertyKey); - boolean result = Boolean.FALSE; - if (booleanValue instanceof Boolean) { - result = (Boolean) booleanValue; - } else if (booleanValue instanceof String) { - result = Boolean.parseBoolean((String) booleanValue); - } else { - LOGGER.warn("The value (generator's option) must be either boolean or string. Default to `false`."); - } - return result; - } - - public void writePropertyBack(String propertyKey, boolean value) { - additionalProperties.put(propertyKey, value); - } - - protected String getContentType(RequestBody requestBody) { - if (requestBody == null || requestBody.getContent() == null || requestBody.getContent().isEmpty()) { - LOGGER.debug("Cannot determine the content type. Returning null."); - return null; - } - return new ArrayList<>(requestBody.getContent().keySet()).get(0); - } - - private void setOauth2Info(CodegenSecurity codegenSecurity, OAuthFlow flow) { - codegenSecurity.authorizationUrl = flow.getAuthorizationUrl(); - codegenSecurity.tokenUrl = flow.getTokenUrl(); - codegenSecurity.refreshUrl = flow.getRefreshUrl(); - - if (flow.getScopes() != null && !flow.getScopes().isEmpty()) { - List> scopes = new ArrayList<>(); - for (Map.Entry scopeEntry : flow.getScopes().entrySet()) { - Map scope = new HashMap<>(); - scope.put("scope", scopeEntry.getKey()); - scope.put("description", escapeText(scopeEntry.getValue())); - scopes.add(scope); - } - codegenSecurity.scopes = scopes; - } - } - - private void addConsumesInfo(Operation operation, CodegenOperation codegenOperation) { - RequestBody requestBody = ModelUtils.getReferencedRequestBody(this.openAPI, operation.getRequestBody()); - if (requestBody == null || requestBody.getContent() == null || requestBody.getContent().isEmpty()) { - return; - } - - Set consumes = requestBody.getContent().keySet(); - List> mediaTypeList = new ArrayList<>(); - for (String key : consumes) { - Map mediaType = new HashMap<>(); - if ("*/*".equals(key)) { - // skip as it implies `consumes` in OAS2 is not defined - continue; - } else { - mediaType.put("mediaType", escapeQuotationMark(key)); - } - mediaTypeList.add(mediaType); - } - - if (!mediaTypeList.isEmpty()) { - codegenOperation.consumes = mediaTypeList; - codegenOperation.hasConsumes = true; - } - } - - public static Set getConsumesInfo(OpenAPI openAPI, Operation operation) { - RequestBody requestBody = ModelUtils.getReferencedRequestBody(openAPI, operation.getRequestBody()); - - if (requestBody == null || requestBody.getContent() == null || requestBody.getContent().isEmpty()) { - return Collections.emptySet(); // return empty set - } - return requestBody.getContent().keySet(); - } - - public boolean hasFormParameter(OpenAPI openAPI, Operation operation) { - Set consumesInfo = getConsumesInfo(openAPI, operation); - - if (consumesInfo == null || consumesInfo.isEmpty()) { - return false; - } - - for (String consume : consumesInfo) { - if (consume != null && - (consume.toLowerCase(Locale.ROOT).startsWith("application/x-www-form-urlencoded") || - consume.toLowerCase(Locale.ROOT).startsWith("multipart"))) { - return true; - } - } - - return false; - } - - public boolean hasBodyParameter(OpenAPI openAPI, Operation operation) { - RequestBody requestBody = ModelUtils.getReferencedRequestBody(openAPI, operation.getRequestBody()); - if (requestBody == null) { - return false; - } - - Schema schema = ModelUtils.getSchemaFromRequestBody(requestBody); - return ModelUtils.getReferencedSchema(openAPI, schema) != null; - } - - private void addProducesInfo(ApiResponse inputResponse, CodegenOperation codegenOperation) { - ApiResponse response = ModelUtils.getReferencedApiResponse(this.openAPI, inputResponse); - if (response == null || response.getContent() == null || response.getContent().isEmpty()) { - return; - } - - Set produces = response.getContent().keySet(); - if (codegenOperation.produces == null) { - codegenOperation.produces = new ArrayList<>(); - } - - Set existingMediaTypes = new HashSet<>(); - for (Map mediaType : codegenOperation.produces) { - existingMediaTypes.add(mediaType.get("mediaType")); - } - - for (String key : produces) { - // escape quotation to avoid code injection, "*/*" is a special case, do nothing - String encodedKey = "*/*".equals(key) ? key : escapeQuotationMark(key); - //Only unique media types should be added to "produces" - if (!existingMediaTypes.contains(encodedKey)) { - Map mediaType = new HashMap<>(); - mediaType.put("mediaType", encodedKey); - codegenOperation.produces.add(mediaType); - codegenOperation.hasProduces = Boolean.TRUE; - } - } - } - - /** - * returns the list of MIME types the APIs can produce - * - * @param openAPI current specification instance - * @param operation Operation - * @return a set of MIME types - */ - public static Set getProducesInfo(final OpenAPI openAPI, final Operation operation) { - if (operation.getResponses() == null || operation.getResponses().isEmpty()) { - return null; - } - - Set produces = new ConcurrentSkipListSet<>(); - - for (ApiResponse r : operation.getResponses().values()) { - ApiResponse response = ModelUtils.getReferencedApiResponse(openAPI, r); - if (response.getContent() != null) { - produces.addAll(response.getContent().keySet()); - } - } - - return produces; - } - - protected String getCollectionFormat(Parameter parameter) { - if (Parameter.StyleEnum.FORM.equals(parameter.getStyle())) { - // Ref: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md#style-values - if (Boolean.TRUE.equals(parameter.getExplode())) { // explode is true (default) - return "multi"; - } else { - return "csv"; - } - } else if (Parameter.StyleEnum.SIMPLE.equals(parameter.getStyle())) { - return "csv"; - } else if (Parameter.StyleEnum.PIPEDELIMITED.equals(parameter.getStyle())) { - return "pipes"; - } else if (Parameter.StyleEnum.SPACEDELIMITED.equals(parameter.getStyle())) { - return "ssv"; - } else { - return null; - } - } - - @Override - public CodegenType getTag() { - return null; - } - - @Override - public String getName() { - return null; - } - - @Override - public String getHelp() { - return null; - } - - public List fromRequestBodyToFormParameters(RequestBody body, Set imports) { - List parameters = new ArrayList<>(); - LOGGER.debug("debugging fromRequestBodyToFormParameters= {}", body); - Schema schema = ModelUtils.getSchemaFromRequestBody(body); - schema = ModelUtils.getReferencedSchema(this.openAPI, schema); - List allRequired = new ArrayList<>(); - Map properties = new LinkedHashMap<>(); - // this traverses a composed schema and extracts all properties in each schema into properties - // TODO in the future have this return one codegenParameter of type object or composed which includes all definition - // that will be needed for complex composition use cases - // https://github.com/OpenAPITools/openapi-generator/issues/10415 - addProperties(properties, allRequired, schema, new HashSet<>()); - - if (!properties.isEmpty()) { - for (Map.Entry entry : properties.entrySet()) { - CodegenParameter codegenParameter; - // key => property name - // value => property schema - String propertyName = entry.getKey(); - Schema propertySchema = entry.getValue(); - if (ModelUtils.isMapSchema(propertySchema)) { - LOGGER.error("Map of form parameters not supported. Please report the issue to https://github.com/openapitools/openapi-generator if you need help."); - continue; - } - codegenParameter = fromFormProperty(propertyName, propertySchema, imports); - - // Set 'required' flag defined in the schema element - if (!codegenParameter.required && schema.getRequired() != null) { - codegenParameter.required = schema.getRequired().contains(entry.getKey()); - } - - parameters.add(codegenParameter); - } - } - - return parameters; - } - - public CodegenParameter fromFormProperty(String name, Schema propertySchema, Set imports) { - CodegenParameter codegenParameter = CodegenModelFactory.newInstance(CodegenModelType.PARAMETER); - - LOGGER.debug("Debugging fromFormProperty {}: {}", name, propertySchema); - CodegenProperty codegenProperty = fromProperty(name, propertySchema, false); - - Schema ps = unaliasSchema(propertySchema); - ModelUtils.syncValidationProperties(ps, codegenParameter); - codegenParameter.setTypeProperties(ps); - codegenParameter.setComposedSchemas(getComposedSchemas(ps)); - if (ps.getPattern() != null) { - codegenParameter.pattern = toRegularExpression(ps.getPattern()); - } - - codegenParameter.baseType = codegenProperty.baseType; - codegenParameter.dataType = codegenProperty.dataType; - codegenParameter.defaultValue = toDefaultParameterValue(propertySchema); - codegenParameter.baseName = codegenProperty.baseName; - codegenParameter.paramName = toParamName(codegenParameter.baseName); - codegenParameter.dataFormat = codegenProperty.dataFormat; - // non-array/map - updateCodegenPropertyEnum(codegenProperty); - codegenParameter.isEnum = codegenProperty.isEnum; - codegenParameter._enum = codegenProperty._enum; - codegenParameter.allowableValues = codegenProperty.allowableValues; - - if (ModelUtils.isFileSchema(ps) && !ModelUtils.isStringSchema(ps)) { - // swagger v2 only, type file - codegenParameter.isFile = true; - } else if (ModelUtils.isStringSchema(ps)) { - if (ModelUtils.isEmailSchema(ps)) { - codegenParameter.isEmail = true; - } else if (ModelUtils.isUUIDSchema(ps)) { - codegenParameter.isUuid = true; - } else if (ModelUtils.isByteArraySchema(ps)) { - codegenParameter.setIsString(false); - codegenParameter.isByteArray = true; - codegenParameter.isPrimitiveType = true; - } else if (ModelUtils.isBinarySchema(ps)) { - codegenParameter.isBinary = true; - codegenParameter.isFile = true; // file = binary in OAS3 - codegenParameter.isPrimitiveType = true; - } else if (ModelUtils.isDateSchema(ps)) { - codegenParameter.setIsString(false); // for backward compatibility with 2.x - codegenParameter.isDate = true; - codegenParameter.isPrimitiveType = true; - } else if (ModelUtils.isDateTimeSchema(ps)) { - codegenParameter.setIsString(false); // for backward compatibility with 2.x - codegenParameter.isDateTime = true; - codegenParameter.isPrimitiveType = true; - } else if (ModelUtils.isDecimalSchema(ps)) { // type: string, format: number - codegenParameter.setIsString(false); - codegenParameter.isDecimal = true; - codegenParameter.isPrimitiveType = true; - } - if (Boolean.TRUE.equals(codegenParameter.isString)) { - codegenParameter.isPrimitiveType = true; - } - } else if (ModelUtils.isBooleanSchema(ps)) { - codegenParameter.isPrimitiveType = true; - } else if (ModelUtils.isNumberSchema(ps)) { - codegenParameter.isPrimitiveType = true; - if (ModelUtils.isFloatSchema(ps)) { // float - codegenParameter.isFloat = true; - } else if (ModelUtils.isDoubleSchema(ps)) { // double - codegenParameter.isDouble = true; - } - } else if (ModelUtils.isIntegerSchema(ps)) { // integer type - codegenParameter.isPrimitiveType = true; - if (ModelUtils.isLongSchema(ps)) { // int64/long format - codegenParameter.isLong = true; - } else { - codegenParameter.isInteger = true; - if (ModelUtils.isShortSchema(ps)) { // int32/short format - codegenParameter.isShort = true; - } else { // unbounded integer - ; - } - } - } else if (ModelUtils.isTypeObjectSchema(ps)) { - if (ModelUtils.isFreeFormObject(openAPI, ps)) { - codegenParameter.isFreeFormObject = true; - } - } else if (ModelUtils.isNullType(ps)) { - ; - } else if (ModelUtils.isAnyType(ps)) { - // any schema with no type set, composed schemas often do this - ; - } else if (ModelUtils.isArraySchema(ps)) { - Schema inner = getSchemaItems((ArraySchema) ps); - CodegenProperty arrayInnerProperty = fromProperty("inner", inner, false); - codegenParameter.items = arrayInnerProperty; - codegenParameter.mostInnerItems = arrayInnerProperty.mostInnerItems; - codegenParameter.isPrimitiveType = false; - codegenParameter.isContainer = true; - // hoist items data into the array property - // TODO this hoisting code is generator specific and should be isolated into updateFormPropertyForArray - codegenParameter.baseType = arrayInnerProperty.dataType; - codegenParameter.defaultValue = arrayInnerProperty.getDefaultValue(); - if (codegenParameter.items.isFile) { - codegenParameter.isFile = true; - codegenParameter.dataFormat = codegenParameter.items.dataFormat; - } - if (arrayInnerProperty._enum != null) { - codegenParameter._enum = arrayInnerProperty._enum; - } - if (arrayInnerProperty.baseType != null && arrayInnerProperty.enumName != null) { - codegenParameter.datatypeWithEnum = codegenParameter.dataType.replace(arrayInnerProperty.baseType, arrayInnerProperty.enumName); - } else { - LOGGER.warn("Could not compute datatypeWithEnum from {}, {}", arrayInnerProperty.baseType, arrayInnerProperty.enumName); - } - // end of hoisting - - // collectionFormat for form parameter does not consider - // style and explode from encoding at this point - String collectionFormat = getCollectionFormat(codegenParameter); - codegenParameter.collectionFormat = StringUtils.isEmpty(collectionFormat) ? "csv" : collectionFormat; - codegenParameter.isCollectionFormatMulti = "multi".equals(collectionFormat); - - if (!addSchemaImportsFromV3SpecLocations) { - // recursively add import - while (arrayInnerProperty != null) { - imports.add(arrayInnerProperty.baseType); - arrayInnerProperty = arrayInnerProperty.items; - } - } - } else { - // referenced schemas - ; - } - - if (Boolean.TRUE.equals(codegenProperty.isModel)) { - codegenParameter.isModel = true; - } - - codegenParameter.isFormParam = Boolean.TRUE; - codegenParameter.description = escapeText(codegenProperty.description); - codegenParameter.unescapedDescription = codegenProperty.getDescription(); - codegenParameter.jsonSchema = Json.pretty(propertySchema); - - if (codegenProperty.getVendorExtensions() != null && !codegenProperty.getVendorExtensions().isEmpty()) { - codegenParameter.vendorExtensions = codegenProperty.getVendorExtensions(); - } - if (propertySchema.getRequired() != null && !propertySchema.getRequired().isEmpty() && propertySchema.getRequired().contains(codegenProperty.baseName)) { - codegenParameter.required = Boolean.TRUE; - } - - if (codegenProperty.isEnum) { - codegenParameter.datatypeWithEnum = codegenProperty.datatypeWithEnum; - codegenParameter.enumName = codegenProperty.enumName; - if (codegenProperty.defaultValue != null) { - codegenParameter.enumDefaultValue = codegenProperty.defaultValue.replace(codegenProperty.enumName + ".", ""); - } - } - - if (!addSchemaImportsFromV3SpecLocations) { - // import - if (codegenProperty.complexType != null) { - imports.add(codegenProperty.complexType); - } - } - setParameterExampleValue(codegenParameter); - // set nullable - setParameterNullable(codegenParameter, codegenProperty); - - return codegenParameter; - } - - protected void addBodyModelSchema(CodegenParameter codegenParameter, String name, Schema schema, Set imports, String bodyParameterName, boolean forceSimpleRef) { - CodegenModel codegenModel = null; - if (StringUtils.isNotBlank(name)) { - schema.setName(name); - codegenModel = fromModel(name, schema); - } - if (codegenModel != null) { - codegenParameter.isModel = true; - } - - if (codegenModel != null && (codegenModel.hasVars || forceSimpleRef)) { - if (StringUtils.isEmpty(bodyParameterName)) { - codegenParameter.baseName = codegenModel.classname; - } else { - codegenParameter.baseName = bodyParameterName; - } - codegenParameter.paramName = toParamName(codegenParameter.baseName); - codegenParameter.baseType = codegenModel.classname; - codegenParameter.dataType = getTypeDeclaration(codegenModel.classname); - codegenParameter.description = codegenModel.description; - codegenParameter.isNullable = codegenModel.isNullable; - if (!addSchemaImportsFromV3SpecLocations) { - imports.add(codegenParameter.baseType); - } - } else { - CodegenProperty codegenProperty = fromProperty("property", schema, false); - - if (codegenProperty != null && codegenProperty.getComplexType() != null && codegenProperty.getComplexType().contains(" | ")) { - if (!addSchemaImportsFromV3SpecLocations) { - // TODO move this splitting logic to the generator that needs it only - List parts = Arrays.asList(codegenProperty.getComplexType().split(" \\| ")); - imports.addAll(parts); - } - String codegenModelName = codegenProperty.getComplexType(); - codegenParameter.baseName = codegenModelName; - codegenParameter.paramName = toParamName(codegenParameter.baseName); - codegenParameter.baseType = codegenParameter.baseName; - codegenParameter.dataType = getTypeDeclaration(codegenModelName); - codegenParameter.description = codegenProperty.getDescription(); - codegenParameter.isNullable = codegenProperty.isNullable; - } else { - if (ModelUtils.isMapSchema(schema)) {// http body is map - LOGGER.error("Map should be supported. Please report to openapi-generator github repo about the issue."); - } else if (codegenProperty != null) { - String codegenModelName, codegenModelDescription; - - if (codegenModel != null) { - codegenModelName = codegenModel.classname; - codegenModelDescription = codegenModel.description; - } else { - LOGGER.warn("The following schema has undefined (null) baseType. " + - "It could be due to form parameter defined in OpenAPI v2 spec with incorrect consumes. " + - "A correct 'consumes' for form parameters should be " + - "'application/x-www-form-urlencoded' or 'multipart/?'"); - LOGGER.warn("schema: {}", schema); - LOGGER.warn("codegenModel is null. Default to UNKNOWN_BASE_TYPE"); - codegenModelName = "UNKNOWN_BASE_TYPE"; - codegenModelDescription = "UNKNOWN_DESCRIPTION"; - } - - if (StringUtils.isEmpty(bodyParameterName)) { - codegenParameter.baseName = codegenModelName; - } else { - codegenParameter.baseName = bodyParameterName; - } - - codegenParameter.paramName = toParamName(codegenParameter.baseName); - codegenParameter.baseType = codegenModelName; - codegenParameter.dataType = getTypeDeclaration(codegenModelName); - codegenParameter.description = codegenModelDescription; - if (!addSchemaImportsFromV3SpecLocations) { - imports.add(codegenParameter.baseType); - - if (codegenProperty.complexType != null) { - imports.add(codegenProperty.complexType); - } - } - } - } - - // set nullable - setParameterNullable(codegenParameter, codegenProperty); - } - } - - protected void updateRequestBodyForMap(CodegenParameter codegenParameter, Schema schema, String name, Set imports, String bodyParameterName) { - if (ModelUtils.isGenerateAliasAsModel(schema) && StringUtils.isNotBlank(name)) { - this.addBodyModelSchema(codegenParameter, name, schema, imports, bodyParameterName, true); - } else { - Schema inner = getAdditionalProperties(schema); - if (inner == null) { - LOGGER.error("No inner type supplied for map parameter `{}`. Default to type:string", schema.getName()); - inner = new StringSchema().description("//TODO automatically added by openapi-generator"); - schema.setAdditionalProperties(inner); - } - CodegenProperty codegenProperty = fromProperty("property", schema, false); - - if (!addSchemaImportsFromV3SpecLocations) { - imports.add(codegenProperty.baseType); - CodegenProperty innerCp = codegenProperty; - while (innerCp != null) { - if (innerCp.complexType != null) { - imports.add(innerCp.complexType); - } - innerCp = innerCp.items; - } - } - - if (StringUtils.isEmpty(bodyParameterName)) { - codegenParameter.baseName = "request_body"; - } else { - codegenParameter.baseName = bodyParameterName; - } - codegenParameter.paramName = toParamName(codegenParameter.baseName); - codegenParameter.items = codegenProperty.items; - codegenParameter.mostInnerItems = codegenProperty.mostInnerItems; - codegenParameter.dataType = getTypeDeclaration(schema); - codegenParameter.baseType = getSchemaType(inner); - codegenParameter.isContainer = Boolean.TRUE; - codegenParameter.isMap = Boolean.TRUE; - codegenParameter.isNullable = codegenProperty.isNullable; - - // set nullable - setParameterNullable(codegenParameter, codegenProperty); - } - } - - protected void updateRequestBodyForPrimitiveType(CodegenParameter codegenParameter, Schema schema, String bodyParameterName, Set imports) { - CodegenProperty codegenProperty = fromProperty("PRIMITIVE_REQUEST_BODY", schema, false); - if (codegenProperty != null) { - if (StringUtils.isEmpty(bodyParameterName)) { - codegenParameter.baseName = "body"; // default to body - } else { - codegenParameter.baseName = bodyParameterName; - } - codegenParameter.isPrimitiveType = true; - codegenParameter.baseType = codegenProperty.baseType; - codegenParameter.dataType = codegenProperty.dataType; - codegenParameter.description = codegenProperty.description; - codegenParameter.paramName = toParamName(codegenParameter.baseName); - codegenParameter.pattern = codegenProperty.pattern; - codegenParameter.isNullable = codegenProperty.isNullable; - - if (!addSchemaImportsFromV3SpecLocations) { - if (codegenProperty.complexType != null) { - imports.add(codegenProperty.complexType); - } - } - } - // set nullable - setParameterNullable(codegenParameter, codegenProperty); - } - - protected void updateRequestBodyForObject(CodegenParameter codegenParameter, Schema schema, String name, Set imports, String bodyParameterName) { - if (ModelUtils.isMapSchema(schema)) { - // Schema with additionalproperties: true (including composed schemas with additionalproperties: true) - updateRequestBodyForMap(codegenParameter, schema, name, imports, bodyParameterName); - } else if (isFreeFormObject(schema)) { - // non-composed object type with no properties + additionalProperties - // additionalProperties must be null, ObjectSchema, or empty Schema - codegenParameter.isFreeFormObject = true; - - // HTTP request body is free form object - CodegenProperty codegenProperty = fromProperty("FREE_FORM_REQUEST_BODY", schema, false); - if (codegenProperty != null) { - if (StringUtils.isEmpty(bodyParameterName)) { - codegenParameter.baseName = "body"; // default to body - } else { - codegenParameter.baseName = bodyParameterName; - } - codegenParameter.isPrimitiveType = true; - codegenParameter.baseType = codegenProperty.baseType; - codegenParameter.dataType = codegenProperty.dataType; - codegenParameter.description = codegenProperty.description; - codegenParameter.isNullable = codegenProperty.isNullable; - codegenParameter.paramName = toParamName(codegenParameter.baseName); - } - // set nullable - setParameterNullable(codegenParameter, codegenProperty); - } else if (ModelUtils.isObjectSchema(schema)) { - // object type schema or composed schema with properties defined - this.addBodyModelSchema(codegenParameter, name, schema, imports, bodyParameterName, false); - } - addVarsRequiredVarsAdditionalProps(schema, codegenParameter); - } - - protected void updateRequestBodyForArray(CodegenParameter codegenParameter, Schema schema, String name, Set imports, String bodyParameterName) { - if (ModelUtils.isGenerateAliasAsModel(schema) && StringUtils.isNotBlank(name)) { - this.addBodyModelSchema(codegenParameter, name, schema, imports, bodyParameterName, true); - } else { - final ArraySchema arraySchema = (ArraySchema) schema; - Schema inner = getSchemaItems(arraySchema); - CodegenProperty codegenProperty = fromProperty("property", arraySchema, false); - if (codegenProperty == null) { - throw new RuntimeException("CodegenProperty cannot be null. arraySchema for debugging: " + arraySchema); - } - - if (!addSchemaImportsFromV3SpecLocations) { - imports.add(codegenProperty.baseType); - } - CodegenProperty innerCp = codegenProperty; - CodegenProperty mostInnerItem = innerCp; - // loop through multidimensional array to add proper import - // also find the most inner item - while (innerCp != null) { - if (!addSchemaImportsFromV3SpecLocations) { - if (innerCp.complexType != null) { - imports.add(innerCp.complexType); - } - } - mostInnerItem = innerCp; - innerCp = innerCp.items; - } - - if (mostInnerItem == null) { - throw new RuntimeException("mostInnerItem (codegen property of array item) cannot be null. " + arraySchema); - } - - if (StringUtils.isEmpty(bodyParameterName)) { - if (StringUtils.isEmpty(mostInnerItem.complexType)) { - codegenParameter.baseName = "request_body"; - } else { - codegenParameter.baseName = mostInnerItem.complexType; - } - } else { - codegenParameter.baseName = bodyParameterName; - } - codegenParameter.paramName = toArrayModelParamName(codegenParameter.baseName); - codegenParameter.items = codegenProperty.items; - codegenParameter.mostInnerItems = codegenProperty.mostInnerItems; - codegenParameter.dataType = getTypeDeclaration(arraySchema); - codegenParameter.baseType = getSchemaType(inner); - codegenParameter.isContainer = Boolean.TRUE; - codegenParameter.isNullable = codegenProperty.isNullable; - - // set nullable - setParameterNullable(codegenParameter, codegenProperty); - - if (!addSchemaImportsFromV3SpecLocations) { - while (codegenProperty != null) { - imports.add(codegenProperty.baseType); - codegenProperty = codegenProperty.items; - } - } - } - } - - protected void updateRequestBodyForString(CodegenParameter codegenParameter, Schema schema, Set imports, String bodyParameterName) { - updateRequestBodyForPrimitiveType(codegenParameter, schema, bodyParameterName, imports); - if (ModelUtils.isByteArraySchema(schema)) { - codegenParameter.setIsString(false); - codegenParameter.isByteArray = true; - } else if (ModelUtils.isBinarySchema(schema)) { - codegenParameter.isBinary = true; - codegenParameter.isFile = true; // file = binary in OAS3 - } else if (ModelUtils.isUUIDSchema(schema)) { - codegenParameter.isUuid = true; - } else if (ModelUtils.isURISchema(schema)) { - codegenParameter.isUri = true; - } else if (ModelUtils.isEmailSchema(schema)) { - codegenParameter.isEmail = true; - } else if (ModelUtils.isDateSchema(schema)) { // date format - codegenParameter.setIsString(false); // for backward compatibility with 2.x - codegenParameter.isDate = true; - } else if (ModelUtils.isDateTimeSchema(schema)) { // date-time format - codegenParameter.setIsString(false); // for backward compatibility with 2.x - codegenParameter.isDateTime = true; - } else if (ModelUtils.isDecimalSchema(schema)) { // type: string, format: number - codegenParameter.isDecimal = true; - codegenParameter.setIsString(false); - } - codegenParameter.pattern = toRegularExpression(schema.getPattern()); - } - - protected String toMediaTypeSchemaName(String contentType, String mediaTypeSchemaSuffix) { - return "SchemaFor" + mediaTypeSchemaSuffix + toModelName(contentType); - } - - private CodegenParameter headerToCodegenParameter(Header header, String headerName, Set imports, String mediaTypeSchemaSuffix) { - if (header == null) { - return null; - } - Parameter headerParam = new Parameter(); - headerParam.setName(headerName); - headerParam.setIn("header"); - headerParam.setDescription(header.getDescription()); - headerParam.setRequired(header.getRequired()); - headerParam.setDeprecated(header.getDeprecated()); - Header.StyleEnum style = header.getStyle(); - if (style != null) { - headerParam.setStyle(Parameter.StyleEnum.valueOf(style.name())); - } - headerParam.setExplode(header.getExplode()); - headerParam.setSchema(header.getSchema()); - headerParam.setExamples(header.getExamples()); - headerParam.setExample(header.getExample()); - headerParam.setContent(header.getContent()); - headerParam.setExtensions(header.getExtensions()); - CodegenParameter param = fromParameter(headerParam, imports); - param.setContent(getContent(headerParam.getContent(), imports, mediaTypeSchemaSuffix)); - return param; - } - - protected LinkedHashMap getContent(Content content, Set imports, String mediaTypeSchemaSuffix) { - if (content == null) { - return null; - } - LinkedHashMap cmtContent = new LinkedHashMap<>(); - for (Entry contentEntry : content.entrySet()) { - MediaType mt = contentEntry.getValue(); - LinkedHashMap ceMap = null; - if (mt.getEncoding() != null) { - ceMap = new LinkedHashMap<>(); - Map encMap = mt.getEncoding(); - for (Entry encodingEntry : encMap.entrySet()) { - Encoding enc = encodingEntry.getValue(); - List headers = new ArrayList<>(); - if (enc.getHeaders() != null) { - Map encHeaders = enc.getHeaders(); - for (Entry headerEntry : encHeaders.entrySet()) { - String headerName = headerEntry.getKey(); - Header header = ModelUtils.getReferencedHeader(this.openAPI, headerEntry.getValue()); - CodegenParameter param = headerToCodegenParameter(header, headerName, imports, mediaTypeSchemaSuffix); - headers.add(param); - } - } - CodegenEncoding ce = new CodegenEncoding( - enc.getContentType(), - headers, - enc.getStyle().toString(), - enc.getExplode() == null ? false : enc.getExplode().booleanValue(), - enc.getAllowReserved() == null ? false : enc.getAllowReserved().booleanValue() - ); - String propName = encodingEntry.getKey(); - ceMap.put(propName, ce); - } - } - String contentType = contentEntry.getKey(); - CodegenProperty schemaProp = null; - if (mt.getSchema() != null) { - schemaProp = fromProperty(toMediaTypeSchemaName(contentType, mediaTypeSchemaSuffix), mt.getSchema(), false); - } - HashMap schemaTestCases = null; - if (mt.getExtensions() != null && mt.getExtensions().containsKey(xSchemaTestExamplesKey)) { - Object objNodeWithRef = mt.getExtensions().get(xSchemaTestExamplesKey); - if (objNodeWithRef instanceof LinkedHashMap) { - LinkedHashMap nodeWithRef = (LinkedHashMap) objNodeWithRef; - String refKey = "$ref"; - String refToTestCases = nodeWithRef.getOrDefault(refKey, null); - if (refToTestCases != null) { - schemaTestCases = extractSchemaTestCases(refToTestCases); - } - } - } - - CodegenMediaType codegenMt = new CodegenMediaType(schemaProp, ceMap, schemaTestCases); - cmtContent.put(contentType, codegenMt); - if (schemaProp != null) { - if (addSchemaImportsFromV3SpecLocations) { - addImports(imports, schemaProp.getImports(importContainerType, importBaseType, generatorMetadata.getFeatureSet())); - } else { - addImports(imports, schemaProp.getImports(false, importBaseType, generatorMetadata.getFeatureSet())); - } - } - } - return cmtContent; - } - - public CodegenParameter fromRequestBody(RequestBody body, Set imports, String bodyParameterName) { - if (body == null) { - LOGGER.error("body in fromRequestBody cannot be null!"); - throw new RuntimeException("body in fromRequestBody cannot be null!"); - } - CodegenParameter codegenParameter = CodegenModelFactory.newInstance(CodegenModelType.PARAMETER); - codegenParameter.baseName = "UNKNOWN_BASE_NAME"; - codegenParameter.paramName = "UNKNOWN_PARAM_NAME"; - codegenParameter.description = escapeText(body.getDescription()); - codegenParameter.required = body.getRequired() != null ? body.getRequired() : Boolean.FALSE; - codegenParameter.isBodyParam = Boolean.TRUE; - if (body.getExtensions() != null) { - codegenParameter.vendorExtensions.putAll(body.getExtensions()); - } - - String name = null; - LOGGER.debug("Request body = {}", body); - Schema schema = ModelUtils.getSchemaFromRequestBody(body); - if (schema == null) { - throw new RuntimeException("Request body cannot be null. Possible cause: missing schema in body parameter (OAS v2): " + body); - } - codegenParameter.setContent(getContent(body.getContent(), imports, "RequestBody")); - - if (StringUtils.isNotBlank(schema.get$ref())) { - name = ModelUtils.getSimpleRef(schema.get$ref()); - } - - Schema unaliasedSchema = unaliasSchema(schema); - schema = ModelUtils.getReferencedSchema(this.openAPI, schema); - - ModelUtils.syncValidationProperties(unaliasedSchema, codegenParameter); - codegenParameter.setTypeProperties(unaliasedSchema); - codegenParameter.setComposedSchemas(getComposedSchemas(unaliasedSchema)); - // TODO in the future switch al the below schema usages to unaliasedSchema - // because it keeps models as refs and will not get their referenced schemas - if (ModelUtils.isArraySchema(schema)) { - updateRequestBodyForArray(codegenParameter, schema, name, imports, bodyParameterName); - } else if (ModelUtils.isTypeObjectSchema(schema)) { - updateRequestBodyForObject(codegenParameter, schema, name, imports, bodyParameterName); - } else if (ModelUtils.isIntegerSchema(schema)) { // integer type - updateRequestBodyForPrimitiveType(codegenParameter, schema, bodyParameterName, imports); - codegenParameter.isNumeric = Boolean.TRUE; - if (ModelUtils.isLongSchema(schema)) { // int64/long format - codegenParameter.isLong = Boolean.TRUE; - } else { - codegenParameter.isInteger = Boolean.TRUE; // older use case, int32 and unbounded int - if (ModelUtils.isShortSchema(schema)) { // int32 - codegenParameter.setIsShort(Boolean.TRUE); - } - } - } else if (ModelUtils.isBooleanSchema(schema)) { // boolean type - updateRequestBodyForPrimitiveType(codegenParameter, schema, bodyParameterName, imports); - } else if (ModelUtils.isFileSchema(schema) && !ModelUtils.isStringSchema(schema)) { - // swagger v2 only, type file - codegenParameter.isFile = true; - } else if (ModelUtils.isStringSchema(schema)) { - updateRequestBodyForString(codegenParameter, schema, imports, bodyParameterName); - } else if (ModelUtils.isNumberSchema(schema)) { - updateRequestBodyForPrimitiveType(codegenParameter, schema, bodyParameterName, imports); - codegenParameter.isNumeric = Boolean.TRUE; - if (ModelUtils.isFloatSchema(schema)) { // float - codegenParameter.isFloat = Boolean.TRUE; - } else if (ModelUtils.isDoubleSchema(schema)) { // double - codegenParameter.isDouble = Boolean.TRUE; - } - } else if (ModelUtils.isNullType(schema)) { - updateRequestBodyForPrimitiveType(codegenParameter, schema, bodyParameterName, imports); - } else if (ModelUtils.isAnyType(schema)) { - if (ModelUtils.isMapSchema(schema)) { - // Schema with additionalproperties: true (including composed schemas with additionalproperties: true) - updateRequestBodyForMap(codegenParameter, schema, name, imports, bodyParameterName); - } else if (ModelUtils.isComposedSchema(schema)) { - this.addBodyModelSchema(codegenParameter, name, schema, imports, bodyParameterName, false); - } else if (ModelUtils.isObjectSchema(schema)) { - // object type schema OR (AnyType schema with properties defined) - this.addBodyModelSchema(codegenParameter, name, schema, imports, bodyParameterName, false); - } else { - updateRequestBodyForPrimitiveType(codegenParameter, schema, bodyParameterName, imports); - } - addVarsRequiredVarsAdditionalProps(schema, codegenParameter); - } else { - // referenced schemas - updateRequestBodyForPrimitiveType(codegenParameter, schema, bodyParameterName, imports); - } - - - addJsonSchemaForBodyRequestInCaseItsNotPresent(codegenParameter, body); - - // set the parameter's example value - // should be overridden by lang codegen - setParameterExampleValue(codegenParameter, body); - - return codegenParameter; - } - - protected void addRequiredVarsMap(Schema schema, IJsonSchemaValidationProperties property) { - /* - this should be called after vars and additionalProperties are set - Features added by storing codegenProperty values: - - complexType stores reference to additionalProperties definition - - baseName stores original name (can be invalid in a programming language) - - nameInSnakeCase can store valid name for a programming language - */ - Map properties = schema.getProperties(); - Map requiredVarsMap = new HashMap<>(); - List requiredPropertyNames = schema.getRequired(); - if (requiredPropertyNames == null) { - return; - } - for (String requiredPropertyName: requiredPropertyNames) { - // required property is defined in properties, value is that CodegenProperty - String usedRequiredPropertyName = handleSpecialCharacters(requiredPropertyName); - if (properties != null && properties.containsKey(requiredPropertyName)) { - // get cp from property - boolean found = false; - for (CodegenProperty cp: property.getVars()) { - if (cp.baseName.equals(requiredPropertyName)) { - found = true; - requiredVarsMap.put(requiredPropertyName, cp); - break; - } - } - if (found == false) { - throw new RuntimeException("Property " + requiredPropertyName + " is missing from getVars"); - } - } else if (schema.getAdditionalProperties() instanceof Boolean && Boolean.FALSE.equals(schema.getAdditionalProperties())) { - // TODO add processing for requiredPropertyName - // required property is not defined in properties, and additionalProperties is false, value is null - requiredVarsMap.put(usedRequiredPropertyName, null); - } else { - // required property is not defined in properties, and additionalProperties is true or unset value is CodegenProperty made from empty schema - // required property is not defined in properties, and additionalProperties is schema, value is CodegenProperty made from schema - if (supportsAdditionalPropertiesWithComposedSchema && !disallowAdditionalPropertiesIfNotPresent) { - CodegenProperty cp; - if (schema.getAdditionalProperties() == null) { - // additionalProperties is null - cp = fromProperty(usedRequiredPropertyName, new Schema(), true, true); - } else if (schema.getAdditionalProperties() instanceof Boolean && Boolean.TRUE.equals(schema.getAdditionalProperties())) { - // additionalProperties is True - cp = fromProperty(requiredPropertyName, new Schema(), true, true); - } else { - // additionalProperties is schema - cp = fromProperty(requiredPropertyName, (Schema) schema.getAdditionalProperties(), true, true); - } - requiredVarsMap.put(usedRequiredPropertyName, cp); - } - } - } - if (!requiredVarsMap.isEmpty()) { - property.setRequiredVarsMap(requiredVarsMap); - } - } - - protected void addVarsRequiredVarsAdditionalProps(Schema schema, IJsonSchemaValidationProperties property) { - setAddProps(schema, property); - Set mandatory = schema.getRequired() == null ? Collections.emptySet() - : new TreeSet<>(schema.getRequired()); - addVars(property, property.getVars(), schema.getProperties(), mandatory); - addRequiredVarsMap(schema, property); - } - - private void addJsonSchemaForBodyRequestInCaseItsNotPresent(CodegenParameter codegenParameter, RequestBody body) { - if (codegenParameter.jsonSchema == null) - codegenParameter.jsonSchema = Json.pretty(body); - } - - protected void addOption(String key, String description, String defaultValue) { - CliOption option = new CliOption(key, description); - if (defaultValue != null) - option.defaultValue(defaultValue); - cliOptions.add(option); - } - - protected void updateOption(String key, String defaultValue) { - for (CliOption cliOption : cliOptions) { - if (cliOption.getOpt().equals(key)) { - cliOption.setDefault(defaultValue); - break; - } - } - } - - protected void removeOption(String key) { - for (int i = 0; i < cliOptions.size(); i++) { - if (key.equals(cliOptions.get(i).getOpt())) { - cliOptions.remove(i); - break; - } - } - } - - protected void addSwitch(String key, String description, Boolean defaultValue) { - CliOption option = CliOption.newBoolean(key, description); - if (defaultValue != null) - option.defaultValue(defaultValue.toString()); - cliOptions.add(option); - } - - /** - * generates OpenAPI specification file in JSON format - * - * @param objs map of object - */ - protected void generateJSONSpecFile(Map objs) { - OpenAPI openAPI = (OpenAPI) objs.get("openAPI"); - if (openAPI != null) { - objs.put("openapi-json", SerializerUtils.toJsonString(openAPI)); - } - } - - /** - * generates OpenAPI specification file in YAML format - * - * @param objs map of object - */ - public void generateYAMLSpecFile(Map objs) { - OpenAPI openAPI = (OpenAPI) objs.get("openAPI"); - String yaml = SerializerUtils.toYamlString(openAPI); - if (yaml != null) { - objs.put("openapi-yaml", yaml); - } - } - - /** - * checks if the data should be classified as "string" in enum - * e.g. double in C# needs to be double-quoted (e.g. "2.8") by treating it as a string - * In the future, we may rename this function to "isEnumString" - * - * @param dataType data type - * @return true if it's a enum string - */ - public boolean isDataTypeString(String dataType) { - return "String".equals(dataType); - } - - @Override - public List fromServers(List servers) { - if (servers == null) { - return Collections.emptyList(); - } - List codegenServers = new LinkedList<>(); - for (Server server : servers) { - CodegenServer cs = new CodegenServer(); - cs.description = escapeText(server.getDescription()); - cs.url = server.getUrl(); - cs.variables = this.fromServerVariables(server.getVariables()); - codegenServers.add(cs); - } - return codegenServers; - } - - @Override - public List fromServerVariables(Map variables) { - if (variables == null) { - return Collections.emptyList(); - } - - Map variableOverrides = serverVariableOverrides(); - - List codegenServerVariables = new LinkedList<>(); - for (Entry variableEntry : variables.entrySet()) { - CodegenServerVariable codegenServerVariable = new CodegenServerVariable(); - ServerVariable variable = variableEntry.getValue(); - List enums = variable.getEnum(); - - codegenServerVariable.defaultValue = variable.getDefault(); - codegenServerVariable.description = escapeText(variable.getDescription()); - codegenServerVariable.enumValues = enums; - codegenServerVariable.name = variableEntry.getKey(); - - // Sets the override value for a server variable pattern. - // NOTE: OpenAPI Specification doesn't prevent multiple server URLs with variables. If multiple objects have the same - // variables pattern, user overrides will apply to _all_ of these patterns. We may want to consider indexed overrides. - if (variableOverrides != null && !variableOverrides.isEmpty()) { - String value = variableOverrides.getOrDefault(variableEntry.getKey(), variable.getDefault()); - codegenServerVariable.value = value; - - if (enums != null && !enums.isEmpty() && !enums.contains(value)) { - if (LOGGER.isWarnEnabled()) { // prevents calculating StringUtils.join when debug isn't enabled - LOGGER.warn("Variable override of '{}' is not listed in the enum of allowed values ({}).", value, StringUtils.join(enums, ",")); - } - } - } else { - codegenServerVariable.value = variable.getDefault(); - } - - codegenServerVariables.add(codegenServerVariable); - } - return codegenServerVariables; - } - - protected void setParameterNullable(CodegenParameter parameter, CodegenProperty property) { - if (parameter == null || property == null) { - return; - } - parameter.isNullable = property.isNullable; - } - - /** - * Post-process the auto-generated file, e.g. using go-fmt to format the Go code. The file type can be "model-test", - * "model-doc", "model", "api", "api-test", "api-doc", "supporting-mustache", "supporting-common", - * "openapi-generator-ignore", "openapi-generator-version" - *

    - * TODO: store these values in enum instead - * - * @param file file to be processed - * @param fileType file type - */ - @Override - public void postProcessFile(File file, String fileType) { - LOGGER.debug("Post processing file {} ({})", file, fileType); - } - - /** - * Boolean value indicating the state of the option for post-processing file using environment variables. - * - * @return true if the option is enabled - */ - @Override - public boolean isEnablePostProcessFile() { - return enablePostProcessFile; - } - - /** - * Set the boolean value indicating the state of the option for post-processing file using environment variables. - * - * @param enablePostProcessFile true to enable post-processing file - */ - @Override - public void setEnablePostProcessFile(boolean enablePostProcessFile) { - this.enablePostProcessFile = enablePostProcessFile; - } - - /** - * Get the boolean value indicating the state of the option for updating only changed files - */ - @Override - public boolean isEnableMinimalUpdate() { - return enableMinimalUpdate; - } - - /** - * Set the boolean value indicating the state of the option for updating only changed files - * - * @param enableMinimalUpdate true to enable minimal update - */ - @Override - public void setEnableMinimalUpdate(boolean enableMinimalUpdate) { - this.enableMinimalUpdate = enableMinimalUpdate; - } - - /** - * Indicates whether the codegen configuration should treat documents as strictly defined by the OpenAPI specification. - * - * @return true to act strictly upon spec documents, potentially modifying the spec to strictly fit the spec. - */ - @Override - public boolean isStrictSpecBehavior() { - return this.strictSpecBehavior; - } - - /** - * Sets the boolean valid indicating whether generation will work strictly against the specification, potentially making - * minor changes to the input document. - * - * @param strictSpecBehavior true if we will behave strictly, false to allow specification documents which pass validation to be loosely interpreted against the spec. - */ - @Override - public void setStrictSpecBehavior(final boolean strictSpecBehavior) { - this.strictSpecBehavior = strictSpecBehavior; - } - - @Override - public FeatureSet getFeatureSet() { - return this.generatorMetadata.getFeatureSet(); - } - - /** - * Get the boolean value indicating whether to remove enum value prefixes - */ - @Override - public boolean isRemoveEnumValuePrefix() { - return this.removeEnumValuePrefix; - } - - /** - * Set the boolean value indicating whether to remove enum value prefixes - * - * @param removeEnumValuePrefix true to enable enum value prefix removal - */ - @Override - public void setRemoveEnumValuePrefix(final boolean removeEnumValuePrefix) { - this.removeEnumValuePrefix = removeEnumValuePrefix; - } - - //// Following methods are related to the "useOneOfInterfaces" feature - - /** - * Add "x-one-of-name" extension to a given oneOf schema (assuming it has at least 1 oneOf elements) - * - * @param s schema to add the extension to - * @param name name of the parent oneOf schema - */ - public void addOneOfNameExtension(ComposedSchema s, String name) { - if (s.getOneOf() != null && s.getOneOf().size() > 0) { - s.addExtension("x-one-of-name", name); - } - } - - /** - * Add a given ComposedSchema as an interface model to be generated, assuming it has `oneOf` defined - * - * @param cs ComposedSchema object to create as interface model - * @param type name to use for the generated interface model - * @param openAPI OpenAPI spec that we are using - */ - public void addOneOfInterfaceModel(ComposedSchema cs, String type, OpenAPI openAPI) { - if (cs.getOneOf() == null) { - return; - } - - CodegenModel cm = new CodegenModel(); - - cm.setDiscriminator(createDiscriminator("", cs, openAPI)); - if (!this.getLegacyDiscriminatorBehavior()) { - cm.addDiscriminatorMappedModelsImports(); - } - for (Schema o : Optional.ofNullable(cs.getOneOf()).orElse(Collections.emptyList())) { - if (o.get$ref() == null) { - if (cm.discriminator != null && o.get$ref() == null) { - // OpenAPI spec states that inline objects should not be considered when discriminator is used - // https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#discriminatorObject - LOGGER.warn("Ignoring inline object in oneOf definition of {}, since discriminator is used", type); - } else { - LOGGER.warn("Inline models are not supported in oneOf definition right now"); - } - continue; - } - cm.oneOf.add(toModelName(ModelUtils.getSimpleRef(o.get$ref()))); - } - cm.name = type; - cm.classname = type; - cm.vendorExtensions.put("x-is-one-of-interface", true); - cm.interfaceModels = new ArrayList<>(); - - addOneOfInterfaces.add(cm); - } - - public void addImportsToOneOfInterface(List> imports) { - } - //// End of methods related to the "useOneOfInterfaces" feature - - protected void modifyFeatureSet(Consumer processor) { - FeatureSet.Builder builder = getFeatureSet().modify(); - processor.accept(builder); - this.generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata) - .featureSet(builder.build()).build(); - } - - /** - * An map entry for cached sanitized names. - */ - private static class SanitizeNameOptions { - public SanitizeNameOptions(String name, String removeCharRegEx, List exceptions) { - this.name = name; - this.removeCharRegEx = removeCharRegEx; - if (exceptions != null) { - this.exceptions = Collections.unmodifiableList(exceptions); - } else { - this.exceptions = Collections.emptyList(); - } - } - - public String getName() { - return name; - } - - public String getRemoveCharRegEx() { - return removeCharRegEx; - } - - public List getExceptions() { - return exceptions; - } - - private String name; - private String removeCharRegEx; - private List exceptions; - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - SanitizeNameOptions that = (SanitizeNameOptions) o; - return Objects.equals(getName(), that.getName()) && - Objects.equals(getRemoveCharRegEx(), that.getRemoveCharRegEx()) && - Objects.equals(getExceptions(), that.getExceptions()); - } - - @Override - public int hashCode() { - return Objects.hash(getName(), getRemoveCharRegEx(), getExceptions()); - } - } - - /** - * This method has been kept to keep the introduction of ModelUtils.isAnyType as a non-breaking change - * this way, existing forks of our generator can continue to use this method - * TODO in 6.0.0 replace this method with ModelUtils.isAnyType - * Return true if the schema value can be any type, i.e. it can be - * the null value, integer, number, string, object or array. - * One use case is when the "type" attribute in the OAS schema is unspecified. - * - * Examples: - * - * arbitraryTypeValue: - * description: This is an arbitrary type schema. - * It is not a free-form object. - * The value can be any type except the 'null' value. - * arbitraryTypeNullableValue: - * description: This is an arbitrary type schema. - * It is not a free-form object. - * The value can be any type, including the 'null' value. - * nullable: true - * - * @param schema the OAS schema. - * @return true if the schema value can be an arbitrary type. - */ - public boolean isAnyTypeSchema(Schema schema) { - if (schema == null) { - once(LOGGER).error("Schema cannot be null in isAnyTypeSchema check"); - return false; - } - - if (isFreeFormObject(schema)) { - // make sure it's not free form object - return false; - } - - if (schema.getClass().equals(Schema.class) && schema.get$ref() == null && schema.getType() == null && - (schema.getProperties() == null || schema.getProperties().isEmpty()) && - schema.getAdditionalProperties() == null && schema.getNot() == null && - schema.getEnum() == null) { - return true; - // If and when type arrays are supported in a future OAS specification, - // we could return true if the type array includes all possible JSON schema types. - } - return false; - } - - /** - * Check to see if the schema is a free form object. - * - * A free form object is an object (i.e. 'type: object' in a OAS document) that: - * 1) Does not define properties, and - * 2) Is not a composed schema (no anyOf, oneOf, allOf), and - * 3) additionalproperties is not defined, or additionalproperties: true, or additionalproperties: {}. - * - * Examples: - * - * components: - * schemas: - * arbitraryObject: - * type: object - * description: This is a free-form object. - * The value must be a map of strings to values. The value cannot be 'null'. - * It cannot be array, string, integer, number. - * arbitraryNullableObject: - * type: object - * description: This is a free-form object. - * The value must be a map of strings to values. The value can be 'null', - * It cannot be array, string, integer, number. - * nullable: true - * arbitraryTypeValue: - * description: This is NOT a free-form object. - * The value can be any type except the 'null' value. - * - * @param schema potentially containing a '$ref' - * @return true if it's a free-form object - */ - protected boolean isFreeFormObject(Schema schema) { - // TODO remove this method and replace all usages with ModelUtils.isFreeFormObject - return ModelUtils.isFreeFormObject(this.openAPI, schema); - } - - /** - * Returns the additionalProperties Schema for the specified input schema. - *

    - * The additionalProperties keyword is used to control the handling of additional, undeclared - * properties, that is, properties whose names are not listed in the properties keyword. - * The additionalProperties keyword may be either a boolean or an object. - * If additionalProperties is a boolean and set to false, no additional properties are allowed. - * By default when the additionalProperties keyword is not specified in the input schema, - * any additional properties are allowed. This is equivalent to setting additionalProperties - * to the boolean value True or setting additionalProperties: {} - * - * @param schema the input schema that may or may not have the additionalProperties keyword. - * @return the Schema of the additionalProperties. The null value is returned if no additional - * properties are allowed. - */ - protected Schema getAdditionalProperties(Schema schema) { - return ModelUtils.getAdditionalProperties(openAPI, schema); - } - - /** - * Check if the given MIME is a JSON MIME. - * JSON MIME examples: - * application/json - * application/json; charset=UTF8 - * APPLICATION/JSON - * - * @param mime MIME string - * @return true if the input matches the JSON MIME - */ - protected static boolean isJsonMimeType(String mime) { - return mime != null && (JSON_MIME_PATTERN.matcher(mime).matches()); - } - - /** - * Check if the given MIME is a JSON Vendor MIME. - * JSON MIME examples: - * application/vnd.mycompany+json - * application/vnd.mycompany.resourceA.version1+json - * - * @param mime MIME string - * @return true if the input matches the JSON vendor MIME - */ - protected static boolean isJsonVendorMimeType(String mime) { - return mime != null && JSON_VENDOR_MIME_PATTERN.matcher(mime).matches(); - } - - /** - * Builds OAPI 2.0 collectionFormat value based on style and explode values - * for the {@link CodegenParameter}. - * - * @param codegenParameter parameter - * @return string for a collectionFormat. - */ - protected String getCollectionFormat(CodegenParameter codegenParameter) { - if ("form".equals(codegenParameter.style)) { - // Ref: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md#style-values - if (codegenParameter.isExplode) { - return "multi"; - } else { - return "csv"; - } - } else if ("simple".equals(codegenParameter.style)) { - return "csv"; - } else if ("pipeDelimited".equals(codegenParameter.style)) { - return "pipes"; - } else if ("spaceDelimited".equals(codegenParameter.style)) { - return "ssv"; - } else { - // Doesn't map to any of the collectionFormat strings - return null; - } - } - - private CodegenComposedSchemas getComposedSchemas(Schema schema) { - if (!(schema instanceof ComposedSchema) && schema.getNot()==null) { - return null; - } - Schema notSchema = schema.getNot(); - CodegenProperty notProperty = null; - if (notSchema != null) { - notProperty = fromProperty("not_schema", notSchema, false); - } - List allOf = new ArrayList<>(); - List oneOf = new ArrayList<>(); - List anyOf = new ArrayList<>(); - if (schema instanceof ComposedSchema) { - ComposedSchema cs = (ComposedSchema) schema; - allOf = getComposedProperties(cs.getAllOf(), "all_of"); - oneOf = getComposedProperties(cs.getOneOf(), "one_of"); - anyOf = getComposedProperties(cs.getAnyOf(), "any_of"); - } - return new CodegenComposedSchemas( - allOf, - oneOf, - anyOf, - notProperty - ); - } - - private List getComposedProperties(List xOfCollection, String collectionName) { - if (xOfCollection == null) { - return null; - } - List xOf = new ArrayList<>(); - int i = 0; - for (Schema xOfSchema : xOfCollection) { - CodegenProperty cp = fromProperty(collectionName + "_" + i, xOfSchema, false); - xOf.add(cp); - i += 1; - } - return xOf; - } - - @Override - public String defaultTemplatingEngine() { - return "mustache"; - } - - @Override - public GeneratorLanguage generatorLanguage() { - return GeneratorLanguage.JAVA; - } - - @Override - public String generatorLanguageVersion() { - return null; - } - - @Override - public List getSupportedVendorExtensions() { - return new ArrayList<>(); - } - - @Override - public boolean getUseInlineModelResolver() { return true; } - - /* - A function to convert yaml or json ingested strings like property names - And convert special characters like newline, tab, carriage return - Into strings that can be rendered in the language that the generator will output to - */ - protected String handleSpecialCharacters(String name) { return name; } - - public String getItemsName(Schema containingSchema, String containingSchemaName) { - if (containingSchema.getExtensions() != null && containingSchema.getExtensions().get("x-item-name") != null) { - return containingSchema.getExtensions().get("x-item-name").toString(); - } - return toVarName(containingSchemaName); - } - - public String getAdditionalPropertiesName() { - return "additional_properties"; - } - - - /** - * Used to ensure that null or Schema is returned given an input Boolean/Schema/null - * This will be used in openapi 3.1.0 spec processing to ensure that Booleans become Schemas - * Because our generators only understand Schemas - * Note: use getIsBooleanSchemaTrue or getIsBooleanSchemaFalse on the IJsonSchemaValidationProperties - * if you need to be able to detect if the original schema's value was true or false - * - * @param schema the input Boolean or Schema data to convert to a Schema - * @return Schema the input data converted to a Schema if possible - */ - protected Schema getSchemaFromBooleanOrSchema(Object schema) { - if (schema instanceof Boolean) { - if (Boolean.TRUE.equals(schema)) { - return trueSchema; - } else if (Boolean.FALSE.equals(schema)) { - return falseSchema; - } - // null case - return null; - } else if (schema instanceof Schema) { - if (schema == null) { - return null; - } - return (Schema) schema; - } else if (schema == null) { - return null; - } - throw new IllegalArgumentException("Invalid schema type; type must be Boolean or Schema"); - } -} diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java b/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java deleted file mode 100644 index ef3ef2f2f98..00000000000 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java +++ /dev/null @@ -1,1530 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen; - -import io.swagger.v3.core.util.Json; -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.Operation; -import io.swagger.v3.oas.models.PathItem; -import io.swagger.v3.oas.models.Paths; -import io.swagger.v3.oas.models.info.Contact; -import io.swagger.v3.oas.models.info.Info; -import io.swagger.v3.oas.models.info.License; -import io.swagger.v3.oas.models.media.Schema; -import io.swagger.v3.oas.models.parameters.Parameter; -import io.swagger.v3.oas.models.security.*; -import io.swagger.v3.oas.models.tags.Tag; -import org.apache.commons.io.FilenameUtils; -import org.apache.commons.io.comparator.PathFileComparator; -import org.apache.commons.lang3.ObjectUtils; -import org.apache.commons.lang3.StringUtils; -import org.openapitools.codegen.api.TemplateDefinition; -import org.openapitools.codegen.api.TemplatePathLocator; -import org.openapitools.codegen.api.TemplateProcessor; -import org.openapitools.codegen.config.GlobalSettings; -import org.openapitools.codegen.api.TemplatingEngineAdapter; -import org.openapitools.codegen.api.TemplateFileType; -import org.openapitools.codegen.ignore.CodegenIgnoreProcessor; -import org.openapitools.codegen.languages.PythonClientCodegen; -import org.openapitools.codegen.meta.GeneratorMetadata; -import org.openapitools.codegen.meta.Stability; -import org.openapitools.codegen.model.ApiInfoMap; -import org.openapitools.codegen.model.ModelMap; -import org.openapitools.codegen.model.ModelsMap; -import org.openapitools.codegen.model.OperationMap; -import org.openapitools.codegen.model.OperationsMap; -import org.openapitools.codegen.serializer.SerializerUtils; -import org.openapitools.codegen.templating.CommonTemplateContentLocator; -import org.openapitools.codegen.templating.GeneratorTemplateContentLocator; -import org.openapitools.codegen.templating.MustacheEngineAdapter; -import org.openapitools.codegen.templating.TemplateManagerOptions; -import org.openapitools.codegen.utils.ImplementationVersion; -import org.openapitools.codegen.utils.ModelUtils; -import org.openapitools.codegen.utils.ProcessUtils; -import org.openapitools.codegen.utils.URLPathUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.*; -import java.net.URL; -import java.nio.charset.StandardCharsets; -import java.nio.file.Path; -import java.time.ZonedDateTime; -import java.util.*; -import java.util.concurrent.ConcurrentSkipListSet; -import java.util.function.Function; -import java.util.stream.Collectors; - -import static org.apache.commons.lang3.StringUtils.removeStart; -import static org.openapitools.codegen.utils.OnceLogger.once; - -@SuppressWarnings("rawtypes") -public class DefaultGenerator implements Generator { - private static final String METADATA_DIR = ".openapi-generator"; - protected final Logger LOGGER = LoggerFactory.getLogger(DefaultGenerator.class); - private final boolean dryRun; - protected CodegenConfig config; - protected ClientOptInput opts; - protected OpenAPI openAPI; - protected CodegenIgnoreProcessor ignoreProcessor; - private Boolean generateApis = null; - private Boolean generateModels = null; - private Boolean generateSupportingFiles = null; - private Boolean generateApiTests = null; - private Boolean generateApiDocumentation = null; - private Boolean generateModelTests = null; - private Boolean generateModelDocumentation = null; - private Boolean generateMetadata = true; - private String basePath; - private String basePathWithoutHost; - private String contextPath; - private Map generatorPropertyDefaults = new HashMap<>(); - protected TemplateProcessor templateProcessor = null; - - private List userDefinedTemplates = new ArrayList<>(); - - - public DefaultGenerator() { - this(false); - } - - public DefaultGenerator(Boolean dryRun) { - this.dryRun = Boolean.TRUE.equals(dryRun); - LOGGER.info("Generating with dryRun={}", this.dryRun); - } - - @SuppressWarnings("deprecation") - @Override - public Generator opts(ClientOptInput opts) { - this.opts = opts; - this.openAPI = opts.getOpenAPI(); - this.config = opts.getConfig(); - List userFiles = opts.getUserDefinedTemplates(); - if (userFiles != null) { - this.userDefinedTemplates = Collections.unmodifiableList(userFiles); - } - - TemplateManagerOptions templateManagerOptions = new TemplateManagerOptions(this.config.isEnableMinimalUpdate(), this.config.isSkipOverwrite()); - - if (this.dryRun) { - this.templateProcessor = new DryRunTemplateManager(templateManagerOptions); - } else { - TemplatingEngineAdapter templatingEngine = this.config.getTemplatingEngine(); - - if (templatingEngine instanceof MustacheEngineAdapter) { - MustacheEngineAdapter mustacheEngineAdapter = (MustacheEngineAdapter) templatingEngine; - mustacheEngineAdapter.setCompiler(this.config.processCompiler(mustacheEngineAdapter.getCompiler())); - } - - TemplatePathLocator commonTemplateLocator = new CommonTemplateContentLocator(); - TemplatePathLocator generatorTemplateLocator = new GeneratorTemplateContentLocator(this.config); - this.templateProcessor = new TemplateManager( - templateManagerOptions, - templatingEngine, - new TemplatePathLocator[]{generatorTemplateLocator, commonTemplateLocator} - ); - } - - String ignoreFileLocation = this.config.getIgnoreFilePathOverride(); - if (ignoreFileLocation != null) { - final File ignoreFile = new File(ignoreFileLocation); - if (ignoreFile.exists() && ignoreFile.canRead()) { - this.ignoreProcessor = new CodegenIgnoreProcessor(ignoreFile); - } else { - LOGGER.warn("Ignore file specified at {} is not valid. This will fall back to an existing ignore file if present in the output directory.", ignoreFileLocation); - } - } - - if (this.ignoreProcessor == null) { - this.ignoreProcessor = new CodegenIgnoreProcessor(this.config.getOutputDir()); - } - - return this; - } - - /** - * Retrieves an instance to the configured template processor, available after user-defined options are - * applied via {@link DefaultGenerator#opts(ClientOptInput)}. - * - * @return A configured {@link TemplateProcessor}, or null. - */ - public TemplateProcessor getTemplateProcessor() { - return templateProcessor; - } - - /** - * Programmatically disable the output of .openapi-generator/VERSION, .openapi-generator-ignore, - * or other metadata files used by OpenAPI Generator. - * - * @param generateMetadata true: enable outputs, false: disable outputs - */ - @SuppressWarnings("WeakerAccess") - public void setGenerateMetadata(Boolean generateMetadata) { - this.generateMetadata = generateMetadata; - } - - /** - * Set generator properties otherwise pulled from system properties. - * Useful for running tests in parallel without relying on System.properties. - * - * @param key The system property key - * @param value The system property value - */ - @SuppressWarnings("WeakerAccess") - public void setGeneratorPropertyDefault(final String key, final String value) { - this.generatorPropertyDefaults.put(key, value); - } - - private Boolean getGeneratorPropertyDefaultSwitch(final String key, final Boolean defaultValue) { - String result = null; - if (this.generatorPropertyDefaults.containsKey(key)) { - result = this.generatorPropertyDefaults.get(key); - } - if (result != null) { - return Boolean.valueOf(result); - } - return defaultValue; - } - - void configureGeneratorProperties() { - // allows generating only models by specifying a CSV of models to generate, or empty for all - // NOTE: Boolean.TRUE is required below rather than `true` because of JVM boxing constraints and type inference. - generateApis = GlobalSettings.getProperty(CodegenConstants.APIS) != null ? Boolean.TRUE : getGeneratorPropertyDefaultSwitch(CodegenConstants.APIS, null); - generateModels = GlobalSettings.getProperty(CodegenConstants.MODELS) != null ? Boolean.TRUE : getGeneratorPropertyDefaultSwitch(CodegenConstants.MODELS, null); - generateSupportingFiles = GlobalSettings.getProperty(CodegenConstants.SUPPORTING_FILES) != null ? Boolean.TRUE : getGeneratorPropertyDefaultSwitch(CodegenConstants.SUPPORTING_FILES, null); - - if (generateApis == null && generateModels == null && generateSupportingFiles == null) { - // no specifics are set, generate everything - generateApis = generateModels = generateSupportingFiles = true; - } else { - if (generateApis == null) { - generateApis = false; - } - if (generateModels == null) { - generateModels = false; - } - if (generateSupportingFiles == null) { - generateSupportingFiles = false; - } - } - // model/api tests and documentation options rely on parent generate options (api or model) and no other options. - // They default to true in all scenarios and can only be marked false explicitly - generateModelTests = GlobalSettings.getProperty(CodegenConstants.MODEL_TESTS) != null ? Boolean.valueOf(GlobalSettings.getProperty(CodegenConstants.MODEL_TESTS)) : getGeneratorPropertyDefaultSwitch(CodegenConstants.MODEL_TESTS, true); - generateModelDocumentation = GlobalSettings.getProperty(CodegenConstants.MODEL_DOCS) != null ? Boolean.valueOf(GlobalSettings.getProperty(CodegenConstants.MODEL_DOCS)) : getGeneratorPropertyDefaultSwitch(CodegenConstants.MODEL_DOCS, true); - generateApiTests = GlobalSettings.getProperty(CodegenConstants.API_TESTS) != null ? Boolean.valueOf(GlobalSettings.getProperty(CodegenConstants.API_TESTS)) : getGeneratorPropertyDefaultSwitch(CodegenConstants.API_TESTS, true); - generateApiDocumentation = GlobalSettings.getProperty(CodegenConstants.API_DOCS) != null ? Boolean.valueOf(GlobalSettings.getProperty(CodegenConstants.API_DOCS)) : getGeneratorPropertyDefaultSwitch(CodegenConstants.API_DOCS, true); - - // Additional properties added for tests to exclude references in project related files - config.additionalProperties().put(CodegenConstants.GENERATE_API_TESTS, generateApiTests); - config.additionalProperties().put(CodegenConstants.GENERATE_MODEL_TESTS, generateModelTests); - - config.additionalProperties().put(CodegenConstants.GENERATE_API_DOCS, generateApiDocumentation); - config.additionalProperties().put(CodegenConstants.GENERATE_MODEL_DOCS, generateModelDocumentation); - - config.additionalProperties().put(CodegenConstants.GENERATE_APIS, generateApis); - config.additionalProperties().put(CodegenConstants.GENERATE_MODELS, generateModels); - - if (!generateApiTests && !generateModelTests) { - config.additionalProperties().put(CodegenConstants.EXCLUDE_TESTS, true); - } - - if (GlobalSettings.getProperty("debugOpenAPI") != null) { - System.out.println(SerializerUtils.toJsonString(openAPI)); - } else if (GlobalSettings.getProperty("debugSwagger") != null) { - // This exists for backward compatibility - // We fall to this block only if debugOpenAPI is null. No need to dump this twice. - LOGGER.info("Please use system property 'debugOpenAPI' instead of 'debugSwagger'."); - System.out.println(SerializerUtils.toJsonString(openAPI)); - } - - config.processOpts(); - - // resolve inline models - if (config.getUseInlineModelResolver()) { - InlineModelResolver inlineModelResolver = new InlineModelResolver(); - inlineModelResolver.setInlineSchemaNameMapping(config.inlineSchemaNameMapping()); - inlineModelResolver.setInlineSchemaNameDefaults(config.inlineSchemaNameDefault()); - inlineModelResolver.flatten(openAPI); - } - - config.preprocessOpenAPI(openAPI); - - // set OpenAPI to make these available to all methods - config.setOpenAPI(openAPI); - - config.additionalProperties().put("generatorVersion", ImplementationVersion.read()); - config.additionalProperties().put("generatedDate", ZonedDateTime.now().toString()); - config.additionalProperties().put("generatedYear", String.valueOf(ZonedDateTime.now().getYear())); - config.additionalProperties().put("generatorClass", config.getClass().getName()); - config.additionalProperties().put("inputSpec", config.getInputSpec()); - - if (openAPI.getExtensions() != null) { - config.vendorExtensions().putAll(openAPI.getExtensions()); - } - - // TODO: Allow user to define _which_ servers object in the array to target. - // Configures contextPath/basePath according to api document's servers - URL url = URLPathUtils.getServerURL(openAPI, config.serverVariableOverrides()); - contextPath = removeTrailingSlash(config.escapeText(url.getPath())); // for backward compatibility - basePathWithoutHost = contextPath; - if (URLPathUtils.isRelativeUrl(openAPI.getServers())) { - basePath = removeTrailingSlash(basePathWithoutHost); - } else { - basePath = removeTrailingSlash(config.escapeText(URLPathUtils.getHost(openAPI, config.serverVariableOverrides()))); - } - } - - private void configureOpenAPIInfo() { - Info info = this.openAPI.getInfo(); - if (info == null) { - return; - } - if (info.getTitle() != null) { - config.additionalProperties().put("appName", config.escapeText(info.getTitle())); - } - if (info.getVersion() != null) { - config.additionalProperties().put("appVersion", config.escapeText(info.getVersion())); - } else { - LOGGER.error("Missing required field info version. Default appVersion set to 1.0.0"); - config.additionalProperties().put("appVersion", "1.0.0"); - } - - if (StringUtils.isEmpty(info.getDescription())) { - // set a default description if none if provided - config.additionalProperties().put("appDescription", - "No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)"); - config.additionalProperties().put("appDescriptionWithNewLines", config.additionalProperties().get("appDescription")); - config.additionalProperties().put("unescapedAppDescription", "No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)"); - } else { - config.additionalProperties().put("appDescription", config.escapeText(info.getDescription())); - config.additionalProperties().put("appDescriptionWithNewLines", config.escapeTextWhileAllowingNewLines(info.getDescription())); - config.additionalProperties().put("unescapedAppDescription", info.getDescription()); - } - - if (info.getContact() != null) { - Contact contact = info.getContact(); - if (contact.getEmail() != null) { - config.additionalProperties().put("infoEmail", config.escapeText(contact.getEmail())); - } - if (contact.getName() != null) { - config.additionalProperties().put("infoName", config.escapeText(contact.getName())); - } - if (contact.getUrl() != null) { - config.additionalProperties().put("infoUrl", config.escapeText(contact.getUrl())); - } - } - - if (info.getLicense() != null) { - License license = info.getLicense(); - if (license.getName() != null) { - config.additionalProperties().put("licenseInfo", config.escapeText(license.getName())); - } - if (license.getUrl() != null) { - config.additionalProperties().put("licenseUrl", config.escapeText(license.getUrl())); - } - } - - if (info.getVersion() != null) { - config.additionalProperties().put("version", config.escapeText(info.getVersion())); - } else { - LOGGER.error("Missing required field info version. Default version set to 1.0.0"); - config.additionalProperties().put("version", "1.0.0"); - } - - if (info.getTermsOfService() != null) { - config.additionalProperties().put("termsOfService", config.escapeText(info.getTermsOfService())); - } - } - - private void generateModelTests(List files, Map models, String modelName) throws IOException { - // to generate model test files - for (Map.Entry configModelTestTemplateFilesEntry : config.modelTestTemplateFiles().entrySet()) { - String templateName = configModelTestTemplateFilesEntry.getKey(); - String suffix = configModelTestTemplateFilesEntry.getValue(); - String filename = config.modelTestFileFolder() + File.separator + config.toModelTestFilename(modelName) + suffix; - - if (generateModelTests) { - // do not overwrite test file that already exists (regardless of config's skipOverwrite setting) - File modelTestFile = new File(filename); - if (modelTestFile.exists()) { - this.templateProcessor.skip(modelTestFile.toPath(), "Test files never overwrite an existing file of the same name."); - } else { - File written = processTemplateToFile(models, templateName, filename, generateModelTests, CodegenConstants.MODEL_TESTS, config.modelTestFileFolder()); - if (written != null) { - files.add(written); - if (config.isEnablePostProcessFile() && !dryRun) { - config.postProcessFile(written, "model-test"); - } - } - } - } else if (dryRun) { - Path skippedPath = java.nio.file.Paths.get(filename); - this.templateProcessor.skip(skippedPath, "Skipped by modelTests option supplied by user."); - } - } - } - - private void generateModelDocumentation(List files, Map models, String modelName) throws IOException { - for (String templateName : config.modelDocTemplateFiles().keySet()) { - String docExtension = config.getDocExtension(); - String suffix = docExtension != null ? docExtension : config.modelDocTemplateFiles().get(templateName); - String filename = config.modelDocFileFolder() + File.separator + config.toModelDocFilename(modelName) + suffix; - - File written = processTemplateToFile(models, templateName, filename, generateModelDocumentation, CodegenConstants.MODEL_DOCS); - if (written != null) { - files.add(written); - if (config.isEnablePostProcessFile() && !dryRun) { - config.postProcessFile(written, "model-doc"); - } - } - } - } - - private void generateModel(List files, Map models, String modelName) throws IOException { - for (String templateName : config.modelTemplateFiles().keySet()) { - String filename = config.modelFilename(templateName, modelName); - File written = processTemplateToFile(models, templateName, filename, generateModels, CodegenConstants.MODELS); - if (written != null) { - files.add(written); - if (config.isEnablePostProcessFile() && !dryRun) { - config.postProcessFile(written, "model"); - } - } - } - } - - void generateModels(List files, List allModels, List unusedModels) { - if (!generateModels) { - // TODO: Process these anyway and add to dryRun info - LOGGER.info("Skipping generation of models."); - return; - } - - final Map schemas = ModelUtils.getSchemas(this.openAPI); - if (schemas == null) { - LOGGER.warn("Skipping generation of models because specification document has no schemas."); - return; - } - - String modelNames = GlobalSettings.getProperty("models"); - Set modelsToGenerate = null; - if (modelNames != null && !modelNames.isEmpty()) { - modelsToGenerate = new HashSet<>(Arrays.asList(modelNames.split(","))); - } - - Set modelKeys = schemas.keySet(); - if (modelsToGenerate != null && !modelsToGenerate.isEmpty()) { - Set updatedKeys = new HashSet<>(); - for (String m : modelKeys) { - if (modelsToGenerate.contains(m)) { - updatedKeys.add(m); - } - } - - modelKeys = updatedKeys; - } - - // store all processed models - Map allProcessedModels = new TreeMap<>((o1, o2) -> ObjectUtils.compare(config.toModelName(o1), config.toModelName(o2))); - - Boolean skipFormModel = GlobalSettings.getProperty(CodegenConstants.SKIP_FORM_MODEL) != null ? - Boolean.valueOf(GlobalSettings.getProperty(CodegenConstants.SKIP_FORM_MODEL)) : - getGeneratorPropertyDefaultSwitch(CodegenConstants.SKIP_FORM_MODEL, true); - - // process models only - for (String name : modelKeys) { - try { - //don't generate models that have an import mapping - if (config.schemaMapping().containsKey(name)) { - LOGGER.debug("Model {} not imported due to import mapping", name); - - for (String templateName : config.modelTemplateFiles().keySet()) { - // HACK: Because this returns early, could lead to some invalid model reporting. - String filename = config.modelFilename(templateName, name); - Path path = java.nio.file.Paths.get(filename); - this.templateProcessor.skip(path,"Skipped prior to model processing due to schema mapping." ); - } - continue; - } - - // don't generate models that are not used as object (e.g. form parameters) - if (unusedModels.contains(name)) { - if (Boolean.FALSE.equals(skipFormModel)) { - // if skipFormModel sets to true, still generate the model and log the result - LOGGER.info("Model {} (marked as unused due to form parameters) is generated due to the global property `skipFormModel` set to false", name); - } else { - LOGGER.info("Model {} not generated since it's marked as unused (due to form parameters) and `skipFormModel` (global property) set to true (default)", name); - // TODO: Should this be added to dryRun? If not, this seems like a weird place to return early from processing. - continue; - } - } - - Schema schema = schemas.get(name); - - if (ModelUtils.isFreeFormObject(this.openAPI, schema)) { // check to see if it's a free-form object - // there are 3 free form use cases - // 1. free form with no validation that is not allOf included in any composed schemas - // 2. free form with validation - // 3. free form that is allOf included in any composed schemas - // this use case arises when using interface schemas - // generators may choose to make models for use case 2 + 3 - Schema refSchema = new Schema(); - refSchema.set$ref("#/components/schemas/" + name); - Schema unaliasedSchema = config.unaliasSchema(refSchema); - if (unaliasedSchema.get$ref() == null) { - LOGGER.info("Model {} not generated since it's a free-form object", name); - continue; - } - } else if (ModelUtils.isMapSchema(schema)) { // check to see if it's a "map" model - // A composed schema (allOf, oneOf, anyOf) is considered a Map schema if the additionalproperties attribute is set - // for that composed schema. However, in the case of a composed schema, the properties are defined or referenced - // in the inner schemas, and the outer schema does not have properties. - if (!ModelUtils.isGenerateAliasAsModel(schema) && !ModelUtils.isComposedSchema(schema) && (schema.getProperties() == null || schema.getProperties().isEmpty())) { - // schema without property, i.e. alias to map - LOGGER.info("Model {} not generated since it's an alias to map (without property) and `generateAliasAsModel` is set to false (default)", name); - continue; - } - } else if (ModelUtils.isArraySchema(schema)) { // check to see if it's an "array" model - if (!ModelUtils.isGenerateAliasAsModel(schema) && (schema.getProperties() == null || schema.getProperties().isEmpty())) { - // schema without property, i.e. alias to array - LOGGER.info("Model {} not generated since it's an alias to array (without property) and `generateAliasAsModel` is set to false (default)", name); - continue; - } - } - - Map schemaMap = new HashMap<>(); - schemaMap.put(name, schema); - ModelsMap models = processModels(config, schemaMap); - models.put("classname", config.toModelName(name)); - models.putAll(config.additionalProperties()); - allProcessedModels.put(name, models); - } catch (Exception e) { - throw new RuntimeException("Could not process model '" + name + "'" + ".Please make sure that your schema is correct!", e); - } - } - - // loop through all models to update children models, isSelfReference, isCircularReference, etc - allProcessedModels = config.updateAllModels(allProcessedModels); - - // post process all processed models - allProcessedModels = config.postProcessAllModels(allProcessedModels); - - // generate files based on processed models - for (String modelName : allProcessedModels.keySet()) { - ModelsMap models = allProcessedModels.get(modelName); - models.put("modelPackage", config.modelPackage()); - try { - //don't generate models that have a schema mapping - if (config.schemaMapping().containsKey(modelName)) { - continue; - } - - // TODO revise below as we've already performed unaliasing so that the isAlias check may be removed - List modelList = models.getModels(); - if (modelList != null && !modelList.isEmpty()) { - ModelMap modelTemplate = modelList.get(0); - if (modelTemplate != null && modelTemplate.getModel() != null) { - CodegenModel m = modelTemplate.getModel(); - if (m.isAlias && !(config instanceof PythonClientCodegen)) { - // alias to number, string, enum, etc, which should not be generated as model - // for PythonClientCodegen, all aliases are generated as models - continue; // Don't create user-defined classes for aliases - } - } - allModels.add(modelTemplate); - } - - // to generate model files - generateModel(files, models, modelName); - - // to generate model test files - generateModelTests(files, models, modelName); - - // to generate model documentation files - generateModelDocumentation(files, models, modelName); - - } catch (Exception e) { - throw new RuntimeException("Could not generate model '" + modelName + "'", e); - } - } - if (GlobalSettings.getProperty("debugModels") != null) { - LOGGER.info("############ Model info ############"); - Json.prettyPrint(allModels); - } - - } - - @SuppressWarnings("unchecked") - void generateApis(List files, List allOperations, List allModels) { - if (!generateApis) { - // TODO: Process these anyway and present info via dryRun? - LOGGER.info("Skipping generation of APIs."); - return; - } - Map> paths = processPaths(this.openAPI.getPaths()); - Set apisToGenerate = null; - String apiNames = GlobalSettings.getProperty("apis"); - if (apiNames != null && !apiNames.isEmpty()) { - apisToGenerate = new HashSet<>(Arrays.asList(apiNames.split(","))); - } - if (apisToGenerate != null && !apisToGenerate.isEmpty()) { - Map> updatedPaths = new TreeMap<>(); - for (String m : paths.keySet()) { - if (apisToGenerate.contains(m)) { - updatedPaths.put(m, paths.get(m)); - } - } - paths = updatedPaths; - } - for (String tag : paths.keySet()) { - try { - List ops = paths.get(tag); - ops.sort((one, another) -> ObjectUtils.compare(one.operationId, another.operationId)); - OperationsMap operation = processOperations(config, tag, ops, allModels); - URL url = URLPathUtils.getServerURL(openAPI, config.serverVariableOverrides()); - operation.put("basePath", basePath); - operation.put("basePathWithoutHost", removeTrailingSlash(config.encodePath(url.getPath()))); - operation.put("contextPath", contextPath); - operation.put("baseName", tag); - operation.put("apiPackage", config.apiPackage()); - operation.put("modelPackage", config.modelPackage()); - operation.putAll(config.additionalProperties()); - operation.put("classname", config.toApiName(tag)); - operation.put("classVarName", config.toApiVarName(tag)); - operation.put("importPath", config.toApiImport(tag)); - operation.put("classFilename", config.toApiFilename(tag)); - operation.put("strictSpecBehavior", config.isStrictSpecBehavior()); - - if (allModels == null || allModels.isEmpty()) { - operation.put("hasModel", false); - } else { - operation.put("hasModel", true); - } - - if (!config.vendorExtensions().isEmpty()) { - operation.put("vendorExtensions", config.vendorExtensions()); - } - - // process top-level x-group-parameters - if (config.vendorExtensions().containsKey("x-group-parameters")) { - boolean isGroupParameters = Boolean.parseBoolean(config.vendorExtensions().get("x-group-parameters").toString()); - - OperationMap objectMap = operation.getOperations(); - List operations = objectMap.getOperation(); - for (CodegenOperation op : operations) { - if (isGroupParameters && !op.vendorExtensions.containsKey("x-group-parameters")) { - op.vendorExtensions.put("x-group-parameters", Boolean.TRUE); - } - } - } - - // Pass sortParamsByRequiredFlag through to the Mustache template... - boolean sortParamsByRequiredFlag = true; - if (this.config.additionalProperties().containsKey(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG)) { - sortParamsByRequiredFlag = Boolean.parseBoolean(this.config.additionalProperties().get(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG).toString()); - } - operation.put("sortParamsByRequiredFlag", sortParamsByRequiredFlag); - - /* consumes, produces are no longer defined in OAS3.0 - processMimeTypes(swagger.getConsumes(), operation, "consumes"); - processMimeTypes(swagger.getProduces(), operation, "produces"); - */ - - allOperations.add(operation); - - addAuthenticationSwitches(operation); - - for (String templateName : config.apiTemplateFiles().keySet()) { - String filename = config.apiFilename(templateName, tag); - File written = processTemplateToFile(operation, templateName, filename, generateApis, CodegenConstants.APIS); - if (written != null) { - files.add(written); - if (config.isEnablePostProcessFile() && !dryRun) { - config.postProcessFile(written, "api"); - } - } - } - - // to generate api test files - for (String templateName : config.apiTestTemplateFiles().keySet()) { - String filename = config.apiTestFilename(templateName, tag); - File apiTestFile = new File(filename); - // do not overwrite test file that already exists - if (apiTestFile.exists()) { - this.templateProcessor.skip(apiTestFile.toPath(), "Test files never overwrite an existing file of the same name."); - } else { - File written = processTemplateToFile(operation, templateName, filename, generateApiTests, CodegenConstants.API_TESTS, config.apiTestFileFolder()); - if (written != null) { - files.add(written); - if (config.isEnablePostProcessFile() && !dryRun) { - config.postProcessFile(written, "api-test"); - } - } - } - } - - // to generate api documentation files - for (String templateName : config.apiDocTemplateFiles().keySet()) { - String filename = config.apiDocFilename(templateName, tag); - File written = processTemplateToFile(operation, templateName, filename, generateApiDocumentation, CodegenConstants.API_DOCS); - if (written != null) { - files.add(written); - if (config.isEnablePostProcessFile() && !dryRun) { - config.postProcessFile(written, "api-doc"); - } - } - } - - } catch (Exception e) { - throw new RuntimeException("Could not generate api file for '" + tag + "'", e); - } - } - if (GlobalSettings.getProperty("debugOperations") != null) { - LOGGER.info("############ Operation info ############"); - Json.prettyPrint(allOperations); - } - - } - - private void generateSupportingFiles(List files, Map bundle) { - if (!generateSupportingFiles) { - // TODO: process these anyway and report via dryRun? - LOGGER.info("Skipping generation of supporting files."); - return; - } - Set supportingFilesToGenerate = null; - String supportingFiles = GlobalSettings.getProperty(CodegenConstants.SUPPORTING_FILES); - if (supportingFiles != null && !supportingFiles.isEmpty()) { - supportingFilesToGenerate = new HashSet<>(Arrays.asList(supportingFiles.split(","))); - } - - for (SupportingFile support : config.supportingFiles()) { - try { - String outputFolder = config.outputFolder(); - if (StringUtils.isNotEmpty(support.getFolder())) { - outputFolder += File.separator + support.getFolder(); - } - File of = new File(outputFolder); - if (!of.isDirectory()) { - if (!dryRun && !of.mkdirs()) { - once(LOGGER).debug("Output directory {} not created. It {}.", outputFolder, of.exists() ? "already exists." : "may not have appropriate permissions."); - } - } - String outputFilename = new File(support.getDestinationFilename()).isAbsolute() // split - ? support.getDestinationFilename() - : outputFolder + File.separator + support.getDestinationFilename().replace('/', File.separatorChar); - - boolean shouldGenerate = true; - if (supportingFilesToGenerate != null && !supportingFilesToGenerate.isEmpty()) { - shouldGenerate = supportingFilesToGenerate.contains(support.getDestinationFilename()); - } - - File written = processTemplateToFile(bundle, support.getTemplateFile(), outputFilename, shouldGenerate, CodegenConstants.SUPPORTING_FILES); - if (written != null) { - files.add(written); - if (config.isEnablePostProcessFile() && !dryRun) { - config.postProcessFile(written, "supporting-file"); - } - } - } catch (Exception e) { - throw new RuntimeException("Could not generate supporting file '" + support + "'", e); - } - } - - // Consider .openapi-generator-ignore a supporting file - // Output .openapi-generator-ignore if it doesn't exist and wasn't explicitly created by a generator - final String openapiGeneratorIgnore = ".openapi-generator-ignore"; - String ignoreFileNameTarget = config.outputFolder() + File.separator + openapiGeneratorIgnore; - File ignoreFile = new File(ignoreFileNameTarget); - if (generateMetadata) { - try { - boolean shouldGenerate = !ignoreFile.exists(); - if (shouldGenerate && supportingFilesToGenerate != null && !supportingFilesToGenerate.isEmpty()) { - shouldGenerate = supportingFilesToGenerate.contains(openapiGeneratorIgnore); - } - File written = processTemplateToFile(bundle, openapiGeneratorIgnore, ignoreFileNameTarget, shouldGenerate, CodegenConstants.SUPPORTING_FILES); - if (written != null) { - files.add(written); - if (config.isEnablePostProcessFile() && !dryRun) { - config.postProcessFile(written, "openapi-generator-ignore"); - } - } - } catch (Exception e) { - throw new RuntimeException("Could not generate supporting file '" + ignoreFileNameTarget + "'", e); - } - } else { - this.templateProcessor.skip(ignoreFile.toPath(), "Skipped by generateMetadata option supplied by user."); - } - - generateVersionMetadata(files); - } - - Map buildSupportFileBundle(List allOperations, List allModels) { - - Map bundle = new HashMap<>(config.additionalProperties()); - bundle.put("apiPackage", config.apiPackage()); - - ApiInfoMap apis = new ApiInfoMap(); - apis.setApis(allOperations); - - URL url = URLPathUtils.getServerURL(openAPI, config.serverVariableOverrides()); - - bundle.put("openAPI", openAPI); - bundle.put("basePath", basePath); - bundle.put("basePathWithoutHost", basePathWithoutHost); - bundle.put("scheme", URLPathUtils.getScheme(url, config)); - bundle.put("host", url.getHost()); - if (url.getPort() != 80 && url.getPort() != 443 && url.getPort() != -1) { - bundle.put("port", url.getPort()); - } - bundle.put("contextPath", contextPath); - bundle.put("apiInfo", apis); - bundle.put("models", allModels); - bundle.put("apiFolder", config.apiPackage().replace('.', File.separatorChar)); - bundle.put("modelPackage", config.modelPackage()); - bundle.put("library", config.getLibrary()); - bundle.put("generatorLanguageVersion", config.generatorLanguageVersion()); - // todo verify support and operation bundles have access to the common variables - - addAuthenticationSwitches(bundle); - - List servers = config.fromServers(openAPI.getServers()); - if (servers != null && !servers.isEmpty()) { - servers.forEach(server -> server.url = removeTrailingSlash(server.url)); - bundle.put("servers", servers); - bundle.put("hasServers", true); - } - - if (openAPI.getExternalDocs() != null) { - bundle.put("externalDocs", openAPI.getExternalDocs()); - } - - for (int i = 0; i < allModels.size() - 1; i++) { - CodegenModel m = allModels.get(i).getModel(); - m.hasMoreModels = true; - } - - config.postProcessSupportingFileData(bundle); - - if (GlobalSettings.getProperty("debugSupportingFiles") != null) { - LOGGER.info("############ Supporting file info ############"); - Json.prettyPrint(bundle); - } - return bundle; - } - - /** - * Add authentication methods to the given map - * This adds a boolean and a collection for each authentication type to the map. - *

    - * Examples: - *

    - * boolean hasOAuthMethods - *

    - * List<CodegenSecurity> oauthMethods - * - * @param bundle the map which the booleans and collections will be added - */ - void addAuthenticationSwitches(Map bundle) { - Map securitySchemeMap = openAPI.getComponents() != null ? openAPI.getComponents().getSecuritySchemes() : null; - List authMethods = config.fromSecurity(securitySchemeMap); - if (authMethods != null && !authMethods.isEmpty()) { - bundle.put("authMethods", authMethods); - bundle.put("hasAuthMethods", true); - - if (ProcessUtils.hasOAuthMethods(authMethods)) { - bundle.put("hasOAuthMethods", true); - bundle.put("oauthMethods", ProcessUtils.getOAuthMethods(authMethods)); - } - if (ProcessUtils.hasHttpBearerMethods(authMethods)) { - bundle.put("hasHttpBearerMethods", true); - bundle.put("httpBearerMethods", ProcessUtils.getHttpBearerMethods(authMethods)); - } - if (ProcessUtils.hasHttpSignatureMethods(authMethods)) { - bundle.put("hasHttpSignatureMethods", true); - bundle.put("httpSignatureMethods", ProcessUtils.getHttpSignatureMethods(authMethods)); - } - if (ProcessUtils.hasHttpBasicMethods(authMethods)) { - bundle.put("hasHttpBasicMethods", true); - bundle.put("httpBasicMethods", ProcessUtils.getHttpBasicMethods(authMethods)); - } - if (ProcessUtils.hasApiKeyMethods(authMethods)) { - bundle.put("hasApiKeyMethods", true); - bundle.put("apiKeyMethods", ProcessUtils.getApiKeyMethods(authMethods)); - } - } - } - - @Override - public List generate() { - if (openAPI == null) { - throw new RuntimeException("Issues with the OpenAPI input. Possible causes: invalid/missing spec, malformed JSON/YAML files, etc."); - } - - if (config == null) { - throw new RuntimeException("missing config!"); - } - - if (config.getGeneratorMetadata() == null) { - LOGGER.warn("Generator '{}' is missing generator metadata!", config.getName()); - } else { - GeneratorMetadata generatorMetadata = config.getGeneratorMetadata(); - if (StringUtils.isNotEmpty(generatorMetadata.getGenerationMessage())) { - LOGGER.info(generatorMetadata.getGenerationMessage()); - } - - Stability stability = generatorMetadata.getStability(); - String stabilityMessage = String.format(Locale.ROOT, "Generator '%s' is considered %s.", config.getName(), stability.value()); - if (stability == Stability.DEPRECATED) { - LOGGER.warn(stabilityMessage); - } else { - LOGGER.info(stabilityMessage); - } - } - - configureGeneratorProperties(); - configureOpenAPIInfo(); - - config.processOpenAPI(openAPI); - - processUserDefinedTemplates(); - - List files = new ArrayList<>(); - // models - List filteredSchemas = ModelUtils.getSchemasUsedOnlyInFormParam(openAPI); - List allModels = new ArrayList<>(); - generateModels(files, allModels, filteredSchemas); - // apis - List allOperations = new ArrayList<>(); - generateApis(files, allOperations, allModels); - - // supporting files - Map bundle = buildSupportFileBundle(allOperations, allModels); - generateSupportingFiles(files, bundle); - - if (dryRun) { - boolean verbose = Boolean.parseBoolean(GlobalSettings.getProperty("verbose")); - StringBuilder sb = new StringBuilder(); - - sb.append(System.lineSeparator()).append(System.lineSeparator()); - sb.append("Dry Run Results:"); - sb.append(System.lineSeparator()).append(System.lineSeparator()); - - Map dryRunStatusMap = ((DryRunTemplateManager) this.templateProcessor).getDryRunStatusMap(); - - dryRunStatusMap.entrySet().stream().sorted(Map.Entry.comparingByKey()).forEach(entry -> { - DryRunStatus status = entry.getValue(); - try { - status.appendTo(sb); - sb.append(System.lineSeparator()); - if (verbose) { - sb.append(" ") - .append(StringUtils.rightPad(status.getState().getDescription(), 20, ".")) - .append(" ").append(status.getReason()) - .append(System.lineSeparator()); - } - } catch (IOException e) { - LOGGER.debug("Unable to document dry run status for {}.", entry.getKey()); - } - }); - - sb.append(System.lineSeparator()).append(System.lineSeparator()); - sb.append("States:"); - sb.append(System.lineSeparator()).append(System.lineSeparator()); - - for (DryRunStatus.State state : DryRunStatus.State.values()) { - sb.append(" - ").append(state.getShortDisplay()).append(" ").append(state.getDescription()).append(System.lineSeparator()); - } - - sb.append(System.lineSeparator()); - - LOGGER.error(sb.toString()); - } else { - // This exists here rather than in the method which generates supporting files to avoid accidentally adding files after this metadata. - if (generateSupportingFiles) { - generateFilesMetadata(files); - } - } - - // post-process - config.postProcess(); - - // reset GlobalSettings, so that the running thread can be reused for another generator-run - GlobalSettings.reset(); - - return files; - } - - private void processUserDefinedTemplates() { - // TODO: initial behavior is "merge" user defined with built-in templates. consider offering user a "replace" option. - if (userDefinedTemplates != null && !userDefinedTemplates.isEmpty()) { - Map supportingFilesMap = config.supportingFiles().stream() - .collect(Collectors.toMap(TemplateDefinition::getTemplateFile, Function.identity(), (oldValue, newValue) -> oldValue)); - - // TemplateFileType.SupportingFiles - userDefinedTemplates.stream() - .filter(i -> i.getTemplateType().equals(TemplateFileType.SupportingFiles)) - .forEach(userDefinedTemplate -> { - SupportingFile newFile = new SupportingFile( - userDefinedTemplate.getTemplateFile(), - userDefinedTemplate.getFolder(), - userDefinedTemplate.getDestinationFilename() - ); - if (supportingFilesMap.containsKey(userDefinedTemplate.getTemplateFile())) { - SupportingFile f = supportingFilesMap.get(userDefinedTemplate.getTemplateFile()); - config.supportingFiles().remove(f); - - if (!f.isCanOverwrite()) { - newFile.doNotOverwrite(); - } - } - config.supportingFiles().add(newFile); - }); - - // Others, excluding TemplateFileType.SupportingFiles - userDefinedTemplates.stream() - .filter(i -> !i.getTemplateType().equals(TemplateFileType.SupportingFiles)) - .forEach(userDefinedTemplate -> { - // determine file extension… - // if template is in format api.ts.mustache, we'll extract .ts - // if user has provided an example destination filename, we'll use that extension - String templateFile = userDefinedTemplate.getTemplateFile(); - int lastSeparator = templateFile.lastIndexOf('.'); - String templateExt = FilenameUtils.getExtension(templateFile.substring(0, lastSeparator)); - if (StringUtils.isBlank(templateExt)) { - // hack: destination filename in this scenario might be a suffix like Impl.java - templateExt = userDefinedTemplate.getDestinationFilename(); - } else { - templateExt = StringUtils.prependIfMissing(templateExt, "."); - } - - switch (userDefinedTemplate.getTemplateType()) { - case API: - config.apiTemplateFiles().put(templateFile, templateExt); - break; - case Model: - config.modelTemplateFiles().put(templateFile, templateExt); - break; - case APIDocs: - config.apiDocTemplateFiles().put(templateFile, templateExt); - break; - case ModelDocs: - config.modelDocTemplateFiles().put(templateFile, templateExt); - break; - case APITests: - config.apiTestTemplateFiles().put(templateFile, templateExt); - break; - case ModelTests: - config.modelTestTemplateFiles().put(templateFile, templateExt); - break; - case SupportingFiles: - // excluded by filter - break; - } - }); - } - } - - protected File processTemplateToFile(Map templateData, String templateName, String outputFilename, boolean shouldGenerate, String skippedByOption) throws IOException { - return processTemplateToFile(templateData, templateName, outputFilename, shouldGenerate, skippedByOption, this.config.getOutputDir()); - } - - private File processTemplateToFile(Map templateData, String templateName, String outputFilename, boolean shouldGenerate, String skippedByOption, String intendedOutputDir) throws IOException { - String adjustedOutputFilename = outputFilename.replaceAll("//", "/").replace('/', File.separatorChar); - File target = new File(adjustedOutputFilename); - if (ignoreProcessor.allowsFile(target)) { - if (shouldGenerate) { - Path outDir = java.nio.file.Paths.get(intendedOutputDir).toAbsolutePath(); - Path absoluteTarget = target.toPath().toAbsolutePath(); - if (!absoluteTarget.startsWith(outDir)) { - throw new RuntimeException(String.format(Locale.ROOT, "Target files must be generated within the output directory; absoluteTarget=%s outDir=%s", absoluteTarget, outDir)); - } - return this.templateProcessor.write(templateData, templateName, target); - } else { - this.templateProcessor.skip(target.toPath(), String.format(Locale.ROOT, "Skipped by %s options supplied by user.", skippedByOption)); - return null; - } - } else { - this.templateProcessor.ignore(target.toPath(), "Ignored by rule in ignore file."); - return null; - } - } - - public Map> processPaths(Paths paths) { - Map> ops = new TreeMap<>(); - // when input file is not valid and doesn't contain any paths - if (paths == null) { - return ops; - } - for (Map.Entry pathsEntry : paths.entrySet()) { - String resourcePath = pathsEntry.getKey(); - PathItem path = pathsEntry.getValue(); - processOperation(resourcePath, "get", path.getGet(), ops, path); - processOperation(resourcePath, "head", path.getHead(), ops, path); - processOperation(resourcePath, "put", path.getPut(), ops, path); - processOperation(resourcePath, "post", path.getPost(), ops, path); - processOperation(resourcePath, "delete", path.getDelete(), ops, path); - processOperation(resourcePath, "patch", path.getPatch(), ops, path); - processOperation(resourcePath, "options", path.getOptions(), ops, path); - processOperation(resourcePath, "trace", path.getTrace(), ops, path); - } - return ops; - } - - private void processOperation(String resourcePath, String httpMethod, Operation operation, Map> operations, PathItem path) { - if (operation == null) { - return; - } - - if (GlobalSettings.getProperty("debugOperations") != null) { - LOGGER.info("processOperation: resourcePath= {}\t;{} {}\n", resourcePath, httpMethod, operation); - } - - List tags = new ArrayList<>(); - List tagNames = operation.getTags(); - List swaggerTags = openAPI.getTags(); - if (tagNames != null) { - if (swaggerTags == null) { - for (String tagName : tagNames) { - tags.add(new Tag().name(tagName)); - } - } else { - for (String tagName : tagNames) { - boolean foundTag = false; - for (Tag tag : swaggerTags) { - if (tag.getName().equals(tagName)) { - tags.add(tag); - foundTag = true; - break; - } - } - - if (!foundTag) { - tags.add(new Tag().name(tagName)); - } - } - } - } - - if (tags.isEmpty()) { - tags.add(new Tag().name("default")); - } - - /* - build up a set of parameter "ids" defined at the operation level - per the swagger 2.0 spec "A unique parameter is defined by a combination of a name and location" - i'm assuming "location" == "in" - */ - Set operationParameters = new HashSet<>(); - if (operation.getParameters() != null) { - for (Parameter parameter : operation.getParameters()) { - operationParameters.add(generateParameterId(parameter)); - } - } - - //need to propagate path level down to the operation - if (path.getParameters() != null) { - for (Parameter parameter : path.getParameters()) { - //skip propagation if a parameter with the same name is already defined at the operation level - if (!operationParameters.contains(generateParameterId(parameter))) { - operation.addParametersItem(parameter); - } - } - } - - final Map securitySchemes = openAPI.getComponents() != null ? openAPI.getComponents().getSecuritySchemes() : null; - final List globalSecurities = openAPI.getSecurity(); - for (Tag tag : tags) { - try { - CodegenOperation codegenOperation = config.fromOperation(resourcePath, httpMethod, operation, path.getServers()); - codegenOperation.tags = new ArrayList<>(tags); - config.addOperationToGroup(config.sanitizeTag(tag.getName()), resourcePath, operation, codegenOperation, operations); - - List securities = operation.getSecurity(); - if (securities != null && securities.isEmpty()) { - continue; - } - - Map authMethods = getAuthMethods(securities, securitySchemes); - - if (authMethods != null && !authMethods.isEmpty()) { - List fullAuthMethods = config.fromSecurity(authMethods); - codegenOperation.authMethods = filterAuthMethods(fullAuthMethods, securities); - codegenOperation.hasAuthMethods = true; - } else { - authMethods = getAuthMethods(globalSecurities, securitySchemes); - - if (authMethods != null && !authMethods.isEmpty()) { - List fullAuthMethods = config.fromSecurity(authMethods); - codegenOperation.authMethods = filterAuthMethods(fullAuthMethods, globalSecurities); - codegenOperation.hasAuthMethods = true; - } - } - - } catch (Exception ex) { - String msg = "Could not process operation:\n" // - + " Tag: " + tag + "\n"// - + " Operation: " + operation.getOperationId() + "\n" // - + " Resource: " + httpMethod + " " + resourcePath + "\n"// - + " Schemas: " + openAPI.getComponents().getSchemas() + "\n" // - + " Exception: " + ex.getMessage(); - throw new RuntimeException(msg, ex); - } - } - - } - - private static String generateParameterId(Parameter parameter) { - return parameter.getName() + ":" + parameter.getIn(); - } - - private OperationsMap processOperations(CodegenConfig config, String tag, List ops, List allModels) { - OperationsMap operations = new OperationsMap(); - OperationMap objs = new OperationMap(); - objs.setClassname(config.toApiName(tag)); - objs.setPathPrefix(config.toApiVarName(tag)); - - // check for nickname uniqueness - if (config.getAddSuffixToDuplicateOperationNicknames()) { - Set opIds = new HashSet<>(); - int counter = 0; - for (CodegenOperation op : ops) { - String opId = op.nickname; - if (opIds.contains(opId)) { - counter++; - op.nickname += "_" + counter; - } - opIds.add(opId); - } - } - objs.setOperation(ops); - - operations.setOperation(objs); - operations.put("package", config.apiPackage()); - - Set allImports = new ConcurrentSkipListSet<>(); - for (CodegenOperation op : ops) { - allImports.addAll(op.imports); - } - - Map mappings = getAllImportsMappings(allImports); - Set> imports = toImportsObjects(mappings); - - //Some codegen implementations rely on a list interface for the imports - operations.setImports(new ArrayList<>(imports)); - - // add a flag to indicate whether there's any {{import}} - if (!imports.isEmpty()) { - operations.put("hasImport", true); - } - - config.postProcessOperationsWithModels(operations, allModels); - return operations; - } - - /** - * Transforms a set of imports to a map with key config.toModelImport(import) and value the import string. - * - * @param allImports - Set of imports - * @return Map of fully qualified import path and initial import. - */ - private Map getAllImportsMappings(Set allImports) { - Map result = new HashMap<>(); - allImports.forEach(nextImport -> { - String mapping = config.importMapping().get(nextImport); - if (mapping != null) { - result.put(mapping, nextImport); - } else { - result.putAll(config.toModelImportMap(nextImport)); - } - }); - return result; - } - - /** - * Using an import map created via {@link #getAllImportsMappings(Set)} to build a list import objects. - * The import objects have two keys: import and classname which hold the key and value of the initial map entry. - * - * @param mappedImports Map of fully qualified import and import - * @return The set of unique imports - */ - private Set> toImportsObjects(Map mappedImports) { - Set> result = new TreeSet<>( - Comparator.comparing(o -> o.get("classname")) - ); - - mappedImports.forEach((key, value) -> { - Map im = new LinkedHashMap<>(); - im.put("import", key); - im.put("classname", value); - result.add(im); - }); - return result; - } - - private ModelsMap processModels(CodegenConfig config, Map definitions) { - ModelsMap objs = new ModelsMap(); - objs.put("package", config.modelPackage()); - List modelMaps = new ArrayList<>(); - Set allImports = new LinkedHashSet<>(); - for (Map.Entry definitionsEntry : definitions.entrySet()) { - String key = definitionsEntry.getKey(); - Schema schema = definitionsEntry.getValue(); - if (schema == null) - throw new RuntimeException("schema cannot be null in processModels"); - CodegenModel cm = config.fromModel(key, schema); - ModelMap mo = new ModelMap(); - mo.setModel(cm); - mo.put("importPath", config.toModelImport(cm.classname)); - modelMaps.add(mo); - - cm.removeSelfReferenceImport(); - - allImports.addAll(cm.imports); - } - objs.setModels(modelMaps); - Set importSet = new ConcurrentSkipListSet<>(); - for (String nextImport : allImports) { - String mapping = config.importMapping().get(nextImport); - if (mapping == null) { - mapping = config.toModelImport(nextImport); - } - if (mapping != null && !config.defaultIncludes().contains(mapping)) { - importSet.add(mapping); - } - // add instantiation types - mapping = config.instantiationTypes().get(nextImport); - if (mapping != null && !config.defaultIncludes().contains(mapping)) { - importSet.add(mapping); - } - } - List> imports = new ArrayList<>(); - for (String s : importSet) { - Map item = new HashMap<>(); - item.put("import", s); - imports.add(item); - } - objs.setImports(imports); - config.postProcessModels(objs); - return objs; - } - - private Map getAuthMethods(List securities, Map securitySchemes) { - if (securities == null || (securitySchemes == null || securitySchemes.isEmpty())) { - return null; - } - final Map authMethods = new HashMap<>(); - for (SecurityRequirement requirement : securities) { - for (Map.Entry> entry : requirement.entrySet()) { - final String key = entry.getKey(); - SecurityScheme securityScheme = securitySchemes.get(key); - if (securityScheme != null) { - - if (securityScheme.getType().equals(SecurityScheme.Type.OAUTH2)) { - OAuthFlows oauthUpdatedFlows = new OAuthFlows(); - oauthUpdatedFlows.extensions(securityScheme.getFlows().getExtensions()); - - SecurityScheme oauthUpdatedScheme = new SecurityScheme() - .type(securityScheme.getType()) - .description(securityScheme.getDescription()) - .name(securityScheme.getName()) - .$ref(securityScheme.get$ref()) - .in(securityScheme.getIn()) - .scheme(securityScheme.getScheme()) - .bearerFormat(securityScheme.getBearerFormat()) - .openIdConnectUrl(securityScheme.getOpenIdConnectUrl()) - .extensions(securityScheme.getExtensions()) - .flows(oauthUpdatedFlows); - - // Ensure inserted AuthMethod only contains scopes of actual operation, and not all of them defined in the Security Component - // have to iterate through and create new SecurityScheme objects with the scopes 'fixed/updated' - final OAuthFlows securitySchemeFlows = securityScheme.getFlows(); - - - if (securitySchemeFlows.getAuthorizationCode() != null) { - OAuthFlow updatedFlow = cloneOAuthFlow(securitySchemeFlows.getAuthorizationCode(), entry.getValue()); - - oauthUpdatedFlows.setAuthorizationCode(updatedFlow); - } - if (securitySchemeFlows.getImplicit() != null) { - OAuthFlow updatedFlow = cloneOAuthFlow(securitySchemeFlows.getImplicit(), entry.getValue()); - - oauthUpdatedFlows.setImplicit(updatedFlow); - } - if (securitySchemeFlows.getPassword() != null) { - OAuthFlow updatedFlow = cloneOAuthFlow(securitySchemeFlows.getPassword(), entry.getValue()); - - oauthUpdatedFlows.setPassword(updatedFlow); - } - if (securitySchemeFlows.getClientCredentials() != null) { - OAuthFlow updatedFlow = cloneOAuthFlow(securitySchemeFlows.getClientCredentials(), entry.getValue()); - - oauthUpdatedFlows.setClientCredentials(updatedFlow); - } - - authMethods.put(key, oauthUpdatedScheme); - } else { - authMethods.put(key, securityScheme); - } - } - } - } - return authMethods; - } - - private static OAuthFlow cloneOAuthFlow(OAuthFlow originFlow, List operationScopes) { - Scopes newScopes = new Scopes(); - for (String operationScope : operationScopes) { - if (originFlow.getScopes().containsKey(operationScope)) { - newScopes.put(operationScope, originFlow.getScopes().get(operationScope)); - } - } - - return new OAuthFlow() - .authorizationUrl(originFlow.getAuthorizationUrl()) - .tokenUrl(originFlow.getTokenUrl()) - .refreshUrl(originFlow.getRefreshUrl()) - .extensions(originFlow.getExtensions()) - .scopes(newScopes); - } - - private List filterAuthMethods(List authMethods, List securities) { - if (securities == null || securities.isEmpty() || authMethods == null) { - return authMethods; - } - - List result = new ArrayList<>(); - - for (CodegenSecurity security : authMethods) { - boolean filtered = false; - if (security != null && security.scopes != null) { - for (SecurityRequirement requirement : securities) { - List opScopes = requirement.get(security.name); - if (opScopes != null) { - // We have operation-level scopes for this method, so filter the auth method to - // describe the operation auth method with only the scopes that it requires. - // We have to create a new auth method instance because the original object must - // not be modified. - CodegenSecurity opSecurity = security.filterByScopeNames(opScopes); - result.add(opSecurity); - filtered = true; - break; - } - } - } - - // If we didn't get a filtered version, then we can keep the original auth method. - if (!filtered) { - result.add(security); - } - } - - return result; - } - - /** - * Generates a file at .openapi-generator/VERSION to track the version of user's latest run. - * - * @param files The list tracking generated files - */ - private void generateVersionMetadata(List files) { - String versionMetadata = config.outputFolder() + File.separator + METADATA_DIR + File.separator + config.getVersionMetadataFilename(); - if (generateMetadata) { - File versionMetadataFile = new File(versionMetadata); - try { - File written = this.templateProcessor.writeToFile(versionMetadata, ImplementationVersion.read().getBytes(StandardCharsets.UTF_8)); - if (written != null) { - files.add(versionMetadataFile); - if (config.isEnablePostProcessFile() && !dryRun) { - config.postProcessFile(written, "openapi-generator-version"); - } - } - } catch (IOException e) { - throw new RuntimeException("Could not generate supporting file '" + versionMetadata + "'", e); - } - } else { - Path metadata = java.nio.file.Paths.get(versionMetadata); - this.templateProcessor.skip(metadata, "Skipped by generateMetadata option supplied by user."); - } - } - - private Path absPath(File input) { - // intentionally creates a new absolute path instance, disconnected from underlying FileSystem provider of File - return java.nio.file.Paths.get(input.getAbsolutePath()); - } - - /** - * Generates a file at .openapi-generator/FILES to track the files created by the user's latest run. - * This is ideal for CI and regeneration of code without stale/unused files from older generations. - * - * @param files The list tracking generated files - */ - private void generateFilesMetadata(List files) { - if (generateMetadata) { - try { - StringBuilder sb = new StringBuilder(); - Path outDir = absPath(new File(this.config.getOutputDir())); - - List filesToSort = new ArrayList<>(); - - // Avoid side-effecting sort in this path when generateMetadata=true - files.forEach(f -> { - // We have seen NPE on CI for getPath() returning null, so guard against this (to be fixed in 5.0 template management refactor) - //noinspection ConstantConditions - if (f != null && f.getPath() != null) { - filesToSort.add(outDir.relativize(absPath(f)).normalize().toFile()); - } - }); - - // NOTE: Don't use File.separator here as we write linux-style paths to FILES, and File.separator will - // result in incorrect match on Windows machines. - String relativeMeta = METADATA_DIR + "/VERSION"; - filesToSort.sort(PathFileComparator.PATH_COMPARATOR); - filesToSort.forEach(f -> { - // some Java implementations don't honor .relativize documentation fully. - // When outDir is /a/b and the input is /a/b/c/d, the result should be c/d. - // Some implementations make the output ./c/d which seems to mix the logic - // as documented for symlinks. So we need to trim any / or ./ from the start, - // as nobody should be generating into system root and our expectation is no ./ - String relativePath = removeStart(removeStart(f.toString(), "." + File.separator), File.separator); - if (File.separator.equals("\\")) { - // ensure that windows outputs same FILES format - relativePath = relativePath.replace(File.separator, "/"); - } - if (!relativePath.equals(relativeMeta)) { - sb.append(relativePath).append(System.lineSeparator()); - } - }); - - String targetFile = config.outputFolder() + File.separator + METADATA_DIR + File.separator + config.getFilesMetadataFilename(); - - File filesFile = this.templateProcessor.writeToFile(targetFile, sb.toString().getBytes(StandardCharsets.UTF_8)); - if (filesFile != null) { - files.add(filesFile); - } - } catch (Exception e) { - LOGGER.warn("Failed to write FILES metadata to track generated files."); - } - } - } - - private String removeTrailingSlash(String value) { - return StringUtils.removeEnd(value, "/"); - } - -} diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/Generator.java b/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/Generator.java deleted file mode 100644 index a38ce189e72..00000000000 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/Generator.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen; - -import java.io.File; -import java.util.List; - -public interface Generator { - Generator opts(ClientOptInput opts); - - List generate(); -} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/IJsonSchemaValidationProperties.java b/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/IJsonSchemaValidationProperties.java deleted file mode 100644 index d5e8f7faa1f..00000000000 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/IJsonSchemaValidationProperties.java +++ /dev/null @@ -1,378 +0,0 @@ -package org.openapitools.codegen; - -import java.util.Arrays; -import java.util.Collections; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.stream.Stream; - -import io.swagger.v3.oas.models.media.Schema; -import org.openapitools.codegen.meta.FeatureSet; -import org.openapitools.codegen.meta.features.SchemaSupportFeature; -import org.openapitools.codegen.utils.ModelUtils; - -public interface IJsonSchemaValidationProperties { - CodegenProperty getContains(); - - void setContains(CodegenProperty contains); - - LinkedHashMap> getDependentRequired(); - - void setDependentRequired(LinkedHashMap> dependentRequired); - - String getPattern(); - - void setPattern(String pattern); - - String getMaximum(); - - void setMaximum(String maximum); - - String getMinimum(); - - void setMinimum(String minimum); - - boolean getExclusiveMaximum(); - - void setExclusiveMaximum(boolean exclusiveMaximum); - - boolean getExclusiveMinimum(); - - void setExclusiveMinimum(boolean exclusiveMinimum); - - Integer getMinLength(); - - void setMinLength(Integer minLength); - - Integer getMaxLength(); - - void setMaxLength(Integer maxLength); - - Integer getMinItems(); - - void setMinItems(Integer minItems); - - Integer getMaxItems(); - - void setMaxItems(Integer maxItems); - - // TODO update this value to Boolean in 7.0.0 - boolean getUniqueItems(); - - // TODO update this value to Boolean in 7.0.0 - void setUniqueItems(boolean uniqueItems); - - // TODO remove in 7.0.0 - Boolean getUniqueItemsBoolean(); - - // TODO remove in 7.0.0 - void setUniqueItemsBoolean(Boolean uniqueItems); - - Integer getMinProperties(); - - void setMinProperties(Integer minProperties); - - Integer getMaxProperties(); - - void setMaxProperties(Integer maxProperties); - - Number getMultipleOf(); - - void setMultipleOf(Number multipleOf); - - CodegenProperty getItems(); - - void setItems(CodegenProperty items); - - boolean getIsModel(); - - void setIsModel(boolean isModel); - - boolean getIsDate(); - - void setIsDate(boolean isDate); - - boolean getIsDateTime(); - - void setIsDateTime(boolean isDateTime); - - // true when the schema type is object - boolean getIsMap(); - - void setIsMap(boolean isMap); - - boolean getIsArray(); - - void setIsArray(boolean isShort); - - boolean getIsShort(); - - void setIsShort(boolean isShort); - - boolean getIsBoolean(); - - void setIsBoolean(boolean isBoolean); - - boolean getIsUnboundedInteger(); - - void setIsUnboundedInteger(boolean isUnboundedInteger); - - boolean getIsPrimitiveType(); - - void setIsPrimitiveType(boolean isPrimitiveType); - - CodegenProperty getAdditionalProperties(); - - void setAdditionalProperties(CodegenProperty additionalProperties); - - List getVars(); - - void setVars(List vars); - - List getRequiredVars(); - - void setRequiredVars(List requiredVars); - - Map getRequiredVarsMap(); - - // goes from required propertyName to its CodegenProperty - // Use Cases: - // 1. required property is defined in properties, value is that CodegenProperty - // 2. required property is not defined in properties, and additionalProperties is true or unset value is CodegenProperty made from empty schema - // 3. required property is not defined in properties, and additionalProperties is schema, value is CodegenProperty made from schema - // 4. required property is not defined in properties, and additionalProperties is false, value is null - void setRequiredVarsMap(Map requiredVarsMap); - - - boolean getIsNull(); - - void setIsNull(boolean isNull); - - boolean getHasValidation(); - - void setHasValidation(boolean hasValidation); - - boolean getAdditionalPropertiesIsAnyType(); - - void setAdditionalPropertiesIsAnyType(boolean additionalPropertiesIsAnyType); - - boolean getHasVars(); - - void setHasVars(boolean hasVars); - - boolean getHasRequired(); - - void setHasRequired(boolean hasRequired); - - // discriminators are only supported in request bodies and response payloads per OpenApi - boolean getHasDiscriminatorWithNonEmptyMapping(); - - // discriminators are only supported in request bodies and response payloads per OpenApi - void setHasDiscriminatorWithNonEmptyMapping(boolean hasDiscriminatorWithNonEmptyMapping); - - boolean getIsString(); - - void setIsString(boolean isNumber); - - boolean getIsNumber(); - - void setIsNumber(boolean isNumber); - - boolean getIsAnyType(); - - void setIsAnyType(boolean isAnyType); - - String getRef(); - - void setRef(String ref); - - CodegenComposedSchemas getComposedSchemas(); - - void setComposedSchemas(CodegenComposedSchemas composedSchemas); - - boolean getHasMultipleTypes(); - - void setHasMultipleTypes(boolean hasMultipleTypes); - - // for when the schema is just the boolean true in a spec - boolean getIsBooleanSchemaTrue(); - - void setIsBooleanSchemaTrue(boolean isBooleanSchemaTrue); - - // for when the schema is just the boolean false in a spec - boolean getIsBooleanSchemaFalse(); - - void setIsBooleanSchemaFalse(boolean isBooleanSchemaFalse); - - boolean getSchemaIsFromAdditionalProperties(); - - void setSchemaIsFromAdditionalProperties(boolean schemaIsFromAdditionalProperties); - - void setFormat(String format); - - String getFormat(); - - /** - * Syncs all the schema's type properties into the IJsonSchemaValidationProperties instance - * for now this only supports types without format information - * TODO: in the future move the format handling in here too - * @param p the schema which contains the type info - */ - default void setTypeProperties(Schema p) { - if (ModelUtils.isTypeObjectSchema(p)) { - setIsMap(true); - if (ModelUtils.isModelWithPropertiesOnly(p)) { - setIsModel(true); - } - } else if (ModelUtils.isArraySchema(p)) { - setIsArray(true); - } else if (ModelUtils.isFileSchema(p) && !ModelUtils.isStringSchema(p)) { - // swagger v2 only, type file - ; - } else if (ModelUtils.isStringSchema(p)) { - setIsString(true); - if (ModelUtils.isByteArraySchema(p)) { - ; - } else if (ModelUtils.isBinarySchema(p)) { - // openapi v3 way of representing binary + file data - // for backward compatibility with 2.x file type - setIsString(false); - } else if (ModelUtils.isUUIDSchema(p)) { - // keep isString to true to make it backward compatible - ; - } else if (ModelUtils.isURISchema(p)) { - ; - } else if (ModelUtils.isEmailSchema(p)) { - ; - } else if (ModelUtils.isDateSchema(p)) { - ; - } else if (ModelUtils.isDateTimeSchema(p)) { - ; - } else if (ModelUtils.isDecimalSchema(p)) { // type: string, format: number - ; - } - } else if (ModelUtils.isNumberSchema(p)) { - if (ModelUtils.isFloatSchema(p)) { // float - ; - } else if (ModelUtils.isDoubleSchema(p)) { // double - ; - } else { // type is number and without format - setIsNumber(true); - } - } else if (ModelUtils.isIntegerSchema(p)) { // integer type - if (ModelUtils.isLongSchema(p)) { // int64/long format - ; - } else if (ModelUtils.isShortSchema(p)) { // int32/short format - ; - } else { // unbounded integer - setIsUnboundedInteger(true); - } - } else if (ModelUtils.isBooleanSchema(p)) { // boolean type - setIsBoolean(true); - } else if (ModelUtils.isNullType(p)) { - setIsNull(true); - } else if (ModelUtils.isAnyType(p)) { - setIsAnyType(true); - if (ModelUtils.isModelWithPropertiesOnly(p)) { - setIsModel(true); - } - } - } - - /** - * @return basic type - no generics supported. - */ - default String getBaseType() { - return null; - }; - - /** - * @return complex type that can contain type parameters - like {@code List} for Java - */ - default String getComplexType() { - return getBaseType(); - }; - - /** - * Recursively collect all necessary imports to include so that the type may be resolved. - * - * @param importContainerType whether or not to include the container types in the returned imports. - * @param importBaseType whether or not to include the base types in the returned imports. - * @param featureSet the generator feature set, used to determine if composed schemas should be added - * @return all of the imports - */ - default Set getImports(boolean importContainerType, boolean importBaseType, FeatureSet featureSet) { - Set imports = new HashSet<>(); - if (this.getComposedSchemas() != null) { - CodegenComposedSchemas composed = this.getComposedSchemas(); - List allOfs = Collections.emptyList(); - List oneOfs = Collections.emptyList(); - List anyOfs = Collections.emptyList(); - List nots = Collections.emptyList(); - if (composed.getAllOf() != null && featureSet.getSchemaSupportFeatures().contains(SchemaSupportFeature.allOf)) { - allOfs = composed.getAllOf(); - } - if (composed.getOneOf() != null && featureSet.getSchemaSupportFeatures().contains(SchemaSupportFeature.oneOf)) { - oneOfs = composed.getOneOf(); - } - if (composed.getAnyOf() != null && featureSet.getSchemaSupportFeatures().contains(SchemaSupportFeature.anyOf)) { - anyOfs = composed.getAnyOf(); - } - if (composed.getNot() != null && featureSet.getSchemaSupportFeatures().contains(SchemaSupportFeature.not)) { - nots = Arrays.asList(composed.getNot()); - } - Stream innerTypes = Stream.of( - allOfs.stream(), anyOfs.stream(), oneOfs.stream(), nots.stream()) - .flatMap(i -> i); - innerTypes.flatMap(cp -> cp.getImports(importContainerType, importBaseType, featureSet).stream()).forEach(s -> imports.add(s)); - } - // items can exist for AnyType and type array - if (this.getItems() != null && this.getIsArray()) { - imports.addAll(this.getItems().getImports(importContainerType, importBaseType, featureSet)); - } - // additionalProperties can exist for AnyType and type object - if (this.getAdditionalProperties() != null) { - imports.addAll(this.getAdditionalProperties().getImports(importContainerType, importBaseType, featureSet)); - } - // vars can exist for AnyType and type object - if (this.getVars() != null && !this.getVars().isEmpty()) { - this.getVars().stream().flatMap(v -> v.getImports(importContainerType, importBaseType, featureSet).stream()).forEach(s -> imports.add(s)); - } - if (this.getIsArray() || this.getIsMap()) { - if (importContainerType) { - /* - use-case for this complexType block: - DefaultCodegenTest.objectQueryParamIdentifyAsObject - DefaultCodegenTest.mapParamImportInnerObject - */ - String complexType = this.getComplexType(); - if (complexType != null) { - imports.add(complexType); - } - /* - use-case: - Adding List/Map etc, Java uses this - */ - String baseType = this.getBaseType(); - if (importBaseType && baseType != null) { - imports.add(baseType); - } - } - } else { - // referenced or inline schemas - String complexType = this.getComplexType(); - if (complexType != null) { - imports.add(complexType); - } - String baseType = this.getBaseType(); - if (importBaseType && baseType != null) { - imports.add(baseType); - } - return imports; - } - return imports; - } -} diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/InlineModelResolver.java b/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/InlineModelResolver.java deleted file mode 100644 index ef684023d35..00000000000 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/InlineModelResolver.java +++ /dev/null @@ -1,915 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.core.util.DefaultPrettyPrinter; -import com.fasterxml.jackson.databind.MapperFeature; -import com.fasterxml.jackson.databind.ObjectMapper; -import io.swagger.v3.core.util.Json; -import io.swagger.v3.oas.models.*; -import io.swagger.v3.oas.models.callbacks.Callback; -import io.swagger.v3.oas.models.media.*; -import io.swagger.v3.oas.models.parameters.Parameter; -import io.swagger.v3.oas.models.parameters.RequestBody; -import io.swagger.v3.oas.models.responses.ApiResponse; -import io.swagger.v3.oas.models.responses.ApiResponses; -import org.openapitools.codegen.utils.ModelUtils; -import org.openapitools.codegen.utils.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.*; -import java.util.stream.Collectors; - -public class InlineModelResolver { - private OpenAPI openAPI; - private Map addedModels = new HashMap<>(); - private Map generatedSignature = new HashMap<>(); - private Map inlineSchemaNameMapping = new HashMap<>(); - private Map inlineSchemaNameDefaults = new HashMap<>(); - private Set inlineSchemaNameMappingValues = new HashSet<>(); - public boolean resolveInlineEnums = false; - - // structure mapper sorts properties alphabetically on write to ensure models are - // serialized consistently for lookup of existing models - private static ObjectMapper structureMapper; - - // a set to keep track of names generated for inline schemas - private Set uniqueNames = new HashSet<>(); - - static { - structureMapper = Json.mapper().copy(); - structureMapper.configure(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY, true); - structureMapper.writer(new DefaultPrettyPrinter()); - } - - final Logger LOGGER = LoggerFactory.getLogger(InlineModelResolver.class); - - public InlineModelResolver() { - this.inlineSchemaNameDefaults.put("arrayItemSuffix", "_inner"); - this.inlineSchemaNameDefaults.put("mapItemSuffix", "_value"); - } - - public void setInlineSchemaNameMapping(Map inlineSchemaNameMapping) { - this.inlineSchemaNameMapping = inlineSchemaNameMapping; - this.inlineSchemaNameMappingValues = new HashSet<>(inlineSchemaNameMapping.values()); - } - - public void setInlineSchemaNameDefaults(Map inlineSchemaNameDefaults) { - this.inlineSchemaNameDefaults.putAll(inlineSchemaNameDefaults); - } - - void flatten(OpenAPI openAPI) { - this.openAPI = openAPI; - - if (this.openAPI.getComponents() == null) { - this.openAPI.setComponents(new Components()); - } - - if (this.openAPI.getComponents().getSchemas() == null) { - this.openAPI.getComponents().setSchemas(new HashMap()); - } - - flattenPaths(); - flattenComponents(); - } - - /** - * Flatten inline models in Paths - */ - private void flattenPaths() { - Paths paths = openAPI.getPaths(); - if (paths == null) { - return; - } - - for (Map.Entry pathsEntry : paths.entrySet()) { - PathItem path = pathsEntry.getValue(); - List operations = new ArrayList<>(path.readOperations()); - - // use path name (e.g. /foo/bar) and HTTP verb to come up with a name - // in case operationId is not defined later in other methods - String pathname = pathsEntry.getKey(); - String name = pathname; - if (path.getDelete() != null) { - name = pathname + "_delete"; - } else if (path.getGet() != null) { - name = pathname + "_get"; - } else if (path.getHead() != null) { - name = pathname + "_head"; - } else if (path.getOptions() != null) { - name = pathname + "_options"; - } else if (path.getPatch() != null) { - name = pathname + "_patch"; - } else if (path.getPost() != null) { - name = pathname + "_post"; - } else if (path.getPut() != null) { - name = pathname + "_put"; - } else if (path.getTrace() != null) { - name = pathname + "_trace"; - } else { - // no HTTP verb defined? - //throw new RuntimeException("No HTTP verb found/detected in the inline model resolver"); - } - - // Include callback operation as well - for (Operation operation : path.readOperations()) { - Map callbacks = operation.getCallbacks(); - if (callbacks != null) { - operations.addAll(callbacks.values().stream() - .flatMap(callback -> callback.values().stream()) - .flatMap(pathItem -> pathItem.readOperations().stream()) - .collect(Collectors.toList())); - } - } - - for (Operation operation : operations) { - flattenRequestBody(name, operation); - flattenParameters(name, operation); - flattenResponses(name, operation); - } - } - } - - /** - * Return false if model can be represented by primitives e.g. string, object - * without properties, array or map of other model (model contanier), etc. - *

    - * Return true if a model should be generated e.g. object with properties, - * enum, oneOf, allOf, anyOf, etc. - * - * @param schema target schema - */ - private boolean isModelNeeded(Schema schema) { - return isModelNeeded(schema, new HashSet<>()); - } - - /** - * Return false if model can be represented by primitives e.g. string, object - * without properties, array or map of other model (model contanier), etc. - *

    - * Return true if a model should be generated e.g. object with properties, - * enum, oneOf, allOf, anyOf, etc. - * - * @param schema target schema - * @param visitedSchemas Visited schemas - */ - private boolean isModelNeeded(Schema schema, Set visitedSchemas) { - if (visitedSchemas.contains(schema)) { // circular reference - return true; - } else { - visitedSchemas.add(schema); - } - - if (resolveInlineEnums && schema.getEnum() != null && schema.getEnum().size() > 0) { - return true; - } - if (schema.getType() == null || "object".equals(schema.getType())) { - // object or undeclared type with properties - if (schema.getProperties() != null && schema.getProperties().size() > 0) { - return true; - } - } - if (schema instanceof ComposedSchema) { - // allOf, anyOf, oneOf - ComposedSchema m = (ComposedSchema) schema; - - if (m.getAllOf() != null && m.getAllOf().size() == 1 && m.getReadOnly() != null && m.getReadOnly()) { - // Check if this composed schema only contains an allOf and a readOnly. - ComposedSchema c = new ComposedSchema(); - c.setAllOf(m.getAllOf()); - c.setReadOnly(true); - if (m.equals(c)) { - return isModelNeeded(m.getAllOf().get(0), visitedSchemas); - } - } - - if (m.getAllOf() != null && !m.getAllOf().isEmpty()) { - // check to ensure at least of the allOf item is model - for (Schema inner : m.getAllOf()) { - if (isModelNeeded(ModelUtils.getReferencedSchema(openAPI, inner), visitedSchemas)) { - return true; - } - } - // allOf items are all non-model (e.g. type: string) only - return false; - } - if (m.getAnyOf() != null && !m.getAnyOf().isEmpty()) { - return true; - } - if (m.getOneOf() != null && !m.getOneOf().isEmpty()) { - return true; - } - } - - return false; - } - - /** - * Recursively gather inline models that need to be generated and - * replace inline schemas with $ref to schema to-be-generated. - * - * @param schema target schema - * @param modelPrefix model name (usually the prefix of the inline model name) - */ - private void gatherInlineModels(Schema schema, String modelPrefix) { - if (schema.get$ref() != null) { - // if ref already, no inline schemas should be present but check for - // any to catch OpenAPI violations - if (isModelNeeded(schema) || "object".equals(schema.getType()) || - schema.getProperties() != null || schema.getAdditionalProperties() != null || - schema instanceof ComposedSchema) { - LOGGER.error("Illegal schema found with $ref combined with other properties," + - " no properties should be defined alongside a $ref:\n " + schema.toString()); - } - return; - } - // Check object models / any type models / composed models for properties, - // if the schema has a type defined that is not "object" it should not define - // any properties - if (schema.getType() == null || "object".equals(schema.getType())) { - // Check properties and recurse, each property could be its own inline model - Map props = schema.getProperties(); - if (props != null) { - for (String propName : props.keySet()) { - Schema prop = props.get(propName); - String schemaName = resolveModelName(prop.getTitle(), modelPrefix + "_" + propName); - // Recurse to create $refs for inner models - gatherInlineModels(prop, schemaName); - if (isModelNeeded(prop)) { - // If this schema should be split into its own model, do so - Schema refSchema = this.makeSchemaInComponents(schemaName, prop); - props.put(propName, refSchema); - } else if (prop instanceof ComposedSchema) { - ComposedSchema m = (ComposedSchema) prop; - if (m.getAllOf() != null && m.getAllOf().size() == 1 && - !(m.getAllOf().get(0).getType() == null || "object".equals(m.getAllOf().get(0).getType()))) { - // allOf with only 1 type (non-model) - LOGGER.info("allOf schema used by the property `{}` replaced by its only item (a type)", propName); - props.put(propName, m.getAllOf().get(0)); - } - } - } - } - // Check additionalProperties for inline models - if (schema.getAdditionalProperties() != null) { - if (schema.getAdditionalProperties() instanceof Schema) { - Schema inner = (Schema) schema.getAdditionalProperties(); - String schemaName = resolveModelName(schema.getTitle(), modelPrefix + this.inlineSchemaNameDefaults.get("mapItemSuffix")); - // Recurse to create $refs for inner models - gatherInlineModels(inner, schemaName); - if (isModelNeeded(inner)) { - // If this schema should be split into its own model, do so - Schema refSchema = this.makeSchemaInComponents(schemaName, inner); - schema.setAdditionalProperties(refSchema); - } - } - } - } else if (schema.getProperties() != null) { - // If non-object type is specified but also properties - LOGGER.error("Illegal schema found with non-object type combined with properties," + - " no properties should be defined:\n " + schema.toString()); - return; - } else if (schema.getAdditionalProperties() != null) { - // If non-object type is specified but also additionalProperties - LOGGER.error("Illegal schema found with non-object type combined with" + - " additionalProperties, no additionalProperties should be defined:\n " + - schema.toString()); - return; - } - // Check array items - if (schema instanceof ArraySchema) { - ArraySchema array = (ArraySchema) schema; - Schema items = array.getItems(); - /*if (items.getTitle() != null) { - LOGGER.info("schema title {}", items); - throw new RuntimeException("getTitle for array item is not null"); - }*/ - if (items == null) { - LOGGER.error("Illegal schema found with array type but no items," + - " items must be defined for array schemas:\n " + schema.toString()); - return; - } - String schemaName = resolveModelName(items.getTitle(), modelPrefix + this.inlineSchemaNameDefaults.get("arrayItemSuffix")); - - // Recurse to create $refs for inner models - gatherInlineModels(items, schemaName); - - if (isModelNeeded(items)) { - // If this schema should be split into its own model, do so - Schema refSchema = this.makeSchemaInComponents(schemaName, items); - array.setItems(refSchema); - } - } - // Check allOf, anyOf, oneOf for inline models - if (schema instanceof ComposedSchema) { - ComposedSchema m = (ComposedSchema) schema; - if (m.getAllOf() != null) { - List newAllOf = new ArrayList(); - boolean atLeastOneModel = false; - for (Schema inner : m.getAllOf()) { - String schemaName = resolveModelName(inner.getTitle(), modelPrefix + "_allOf"); - // Recurse to create $refs for inner models - gatherInlineModels(inner, schemaName); - if (isModelNeeded(inner)) { - Schema refSchema = this.makeSchemaInComponents(schemaName, inner); - newAllOf.add(refSchema); // replace with ref - atLeastOneModel = true; - } else { - newAllOf.add(inner); - } - } - if (atLeastOneModel) { - m.setAllOf(newAllOf); - } else { - // allOf is just one or more types only so do not generate the inline allOf model - if (m.getAllOf().size() == 1) { - // handle earlier in this function when looping through properites - } else if (m.getAllOf().size() > 1) { - LOGGER.warn("allOf schema `{}` containing multiple types (not model) is not supported at the moment.", schema.getName()); - } else { - LOGGER.error("allOf schema `{}` contains no items.", schema.getName()); - } - } - } - if (m.getAnyOf() != null) { - List newAnyOf = new ArrayList(); - for (Schema inner : m.getAnyOf()) { - String schemaName = resolveModelName(inner.getTitle(), modelPrefix + "_anyOf"); - // Recurse to create $refs for inner models - gatherInlineModels(inner, schemaName); - if (isModelNeeded(inner)) { - Schema refSchema = this.makeSchemaInComponents(schemaName, inner); - newAnyOf.add(refSchema); // replace with ref - } else { - newAnyOf.add(inner); - } - } - m.setAnyOf(newAnyOf); - } - if (m.getOneOf() != null) { - List newOneOf = new ArrayList(); - for (Schema inner : m.getOneOf()) { - String schemaName = resolveModelName(inner.getTitle(), modelPrefix + "_oneOf"); - // Recurse to create $refs for inner models - gatherInlineModels(inner, schemaName); - if (isModelNeeded(inner)) { - Schema refSchema = this.makeSchemaInComponents(schemaName, inner); - newOneOf.add(refSchema); // replace with ref - } else { - newOneOf.add(inner); - } - } - m.setOneOf(newOneOf); - } - } - // Check not schema - if (schema.getNot() != null) { - Schema not = schema.getNot(); - String schemaName = resolveModelName(schema.getTitle(), modelPrefix + "_not"); - // Recurse to create $refs for inner models - gatherInlineModels(not, schemaName); - if (isModelNeeded(not)) { - Schema refSchema = this.makeSchemaInComponents(schemaName, not); - schema.setNot(refSchema); - } - } - } - - /** - * Flatten inline models in content - * - * @param content target content - * @param name backup name if no title is found - */ - private void flattenContent(Content content, String name) { - if (content == null || content.isEmpty()) { - return; - } - - for (String contentType : content.keySet()) { - MediaType mediaType = content.get(contentType); - if (mediaType == null) { - continue; - } - Schema schema = mediaType.getSchema(); - if (schema == null) { - continue; - } - String schemaName = resolveModelName(schema.getTitle(), name); // name example: testPost_request - // Recursively gather/make inline models within this schema if any - gatherInlineModels(schema, schemaName); - if (isModelNeeded(schema)) { - // If this schema should be split into its own model, do so - //Schema refSchema = this.makeSchema(schemaName, schema); - Schema refSchema = this.makeSchemaInComponents(schemaName, schema); - mediaType.setSchema(refSchema); - } - } - } - - /** - * Flatten inline models in RequestBody - * - * @param modelName inline model name prefix - * @param operation target operation - */ - private void flattenRequestBody(String modelName, Operation operation) { - RequestBody requestBody = operation.getRequestBody(); - if (requestBody == null) { - return; - } - - // unalias $ref - if (requestBody.get$ref() != null) { - String ref = ModelUtils.getSimpleRef(requestBody.get$ref()); - requestBody = openAPI.getComponents().getRequestBodies().get(ref); - - if (requestBody == null) { - return; - } - } - - flattenContent(requestBody.getContent(), - (operation.getOperationId() == null ? modelName : operation.getOperationId()) + "_request"); - } - - /** - * Flatten inline models in parameters - * - * @param modelName model name - * @param operation target operation - */ - private void flattenParameters(String modelName, Operation operation) { - List parameters = operation.getParameters(); - if (parameters == null) { - return; - } - - for (Parameter parameter : parameters) { - if (parameter.getSchema() == null) { - continue; - } - - Schema parameterSchema = parameter.getSchema(); - - if (parameterSchema == null) { - continue; - } - String schemaName = resolveModelName(parameterSchema.getTitle(), - (operation.getOperationId() == null ? modelName : operation.getOperationId()) + "_" + parameter.getName() + "_parameter"); - // Recursively gather/make inline models within this schema if any - gatherInlineModels(parameterSchema, schemaName); - if (isModelNeeded(parameterSchema)) { - // If this schema should be split into its own model, do so - Schema refSchema = this.makeSchemaInComponents(schemaName, parameterSchema); - parameter.setSchema(refSchema); - } - } - } - - /** - * Flatten inline models in ApiResponses - * - * @param modelName model name prefix - * @param operation target operation - */ - private void flattenResponses(String modelName, Operation operation) { - ApiResponses responses = operation.getResponses(); - if (responses == null) { - return; - } - - for (Map.Entry responsesEntry : responses.entrySet()) { - String key = responsesEntry.getKey(); - ApiResponse response = responsesEntry.getValue(); - - flattenContent(response.getContent(), - (operation.getOperationId() == null ? modelName : operation.getOperationId()) + "_" + key + "_response"); - } - } - - /** - * Flattens properties of inline object schemas that belong to a composed schema into a - * single flat list of properties. This is useful to generate a single or multiple - * inheritance model. - *

    - * In the example below, codegen may generate a 'Dog' class that extends from the - * generated 'Animal' class. 'Dog' has additional properties 'name', 'age' and 'breed' that - * are flattened as a single list of properties. - *

    - * Dog: - * allOf: - * - $ref: '#/components/schemas/Animal' - * - type: object - * properties: - * name: - * type: string - * age: - * type: string - * - type: object - * properties: - * breed: - * type: string - * - * @param key a unique name ofr the composed schema. - * @param children the list of nested schemas within a composed schema (allOf, anyOf, oneOf). - */ - private void flattenComposedChildren(String key, List children) { - if (children == null || children.isEmpty()) { - return; - } - ListIterator listIterator = children.listIterator(); - while (listIterator.hasNext()) { - Schema component = listIterator.next(); - if ((component != null) && - (component.get$ref() == null) && - ((component.getProperties() != null && !component.getProperties().isEmpty()) || - (component.getEnum() != null && !component.getEnum().isEmpty()))) { - // If a `title` attribute is defined in the inline schema, codegen uses it to name the - // inline schema. Otherwise, we'll use the default naming such as InlineObject1, etc. - // We know that this is not the best way to name the model. - // - // Such naming strategy may result in issues. If the value of the 'title' attribute - // happens to match a schema defined elsewhere in the specification, 'innerModelName' - // will be the same as that other schema. - // - // To have complete control of the model naming, one can define the model separately - // instead of inline. - String innerModelName = resolveModelName(component.getTitle(), key); - Schema innerModel = modelFromProperty(openAPI, component, innerModelName); - String existing = matchGenerated(innerModel); - if (existing == null) { - innerModelName = addSchemas(innerModelName, innerModel); - Schema schema = new Schema().$ref(innerModelName); - schema.setRequired(component.getRequired()); - listIterator.set(schema); - } else { - Schema schema = new Schema().$ref(existing); - schema.setRequired(component.getRequired()); - listIterator.set(schema); - } - } - } - } - - /** - * Flatten inline models in components - */ - private void flattenComponents() { - Map models = openAPI.getComponents().getSchemas(); - if (models == null) { - return; - } - - List modelNames = new ArrayList(models.keySet()); - for (String modelName : modelNames) { - Schema model = models.get(modelName); - if (ModelUtils.isComposedSchema(model)) { - ComposedSchema m = (ComposedSchema) model; - // inline child schemas - flattenComposedChildren(modelName + "_allOf", m.getAllOf()); - flattenComposedChildren(modelName + "_anyOf", m.getAnyOf()); - flattenComposedChildren(modelName + "_oneOf", m.getOneOf()); - } else if (model instanceof Schema) { - gatherInlineModels(model, modelName); - } - } - } - - /** - * This function fix models that are string (mostly enum). Before this fix, the - * example would look something like that in the doc: "\"example from def\"" - * - * @param m Schema implementation - */ - private void fixStringModel(Schema m) { - if (schemaIsOfType(m, "string") && schemaContainsExample(m)) { - String example = m.getExample().toString(); - if (example.startsWith("\"") && example.endsWith("\"")) { - m.setExample(example.substring(1, example.length() - 1)); - } - } - } - - private boolean schemaIsOfType(Schema m, String type) { - return m.getType() != null && m.getType().equals(type); - } - - private boolean schemaContainsExample(Schema m) { - return m.getExample() != null && m.getExample() != ""; - } - - /** - * Generates a unique model name. Non-alphanumeric characters will be replaced - * with underscores - *

    - * e.g. io.schema.User_name => io_schema_User_name - * - * @param title String title field in the schema if present - * @param modelName String model name - * @return if provided the sanitized {@code title}, else the sanitized {@code key} - */ - private String resolveModelName(String title, String modelName) { - if (title == null) { - if (modelName == null) { - return uniqueName("inline_object"); - } - return uniqueName(sanitizeName(modelName)); - } else { - return uniqueName(sanitizeName(title)); - } - } - - private String matchGenerated(Schema model) { - try { - String json = structureMapper.writeValueAsString(model); - if (generatedSignature.containsKey(json)) { - return generatedSignature.get(json); - } - } catch (JsonProcessingException e) { - e.printStackTrace(); - } - - return null; - } - - private void addGenerated(String name, Schema model) { - try { - String json = structureMapper.writeValueAsString(model); - generatedSignature.put(json, name); - } catch (JsonProcessingException e) { - e.printStackTrace(); - } - } - - /** - * Sanitizes the input so that it's valid name for a class or interface - *

    - * e.g. 12.schema.User name => _2_schema_User_name - * - * @param name name to be processed to make sure it's sanitized - */ - private String sanitizeName(final String name) { - return name - .replaceAll("^[0-9]", "_$0") // e.g. 12object => _12object - .replaceAll("[^A-Za-z0-9]", "_"); // e.g. io.schema.User name => io_schema_User_name - } - - /** - * Generate a unique name for the input - * - * @param name name to be processed to make sure it's unique - */ - private String uniqueName(final String name) { - if (openAPI.getComponents().getSchemas() == null) { // no schema has been created - return name; - } - - String uniqueName = name; - int count = 0; - while (true) { - if (!openAPI.getComponents().getSchemas().containsKey(uniqueName) && !uniqueNames.contains(uniqueName)) { - return uniqueName; - } - uniqueName = name + "_" + ++count; - } - } - - private void flattenProperties(OpenAPI openAPI, Map properties, String path) { - if (properties == null) { - return; - } - Map propsToUpdate = new HashMap(); - Map modelsToAdd = new HashMap(); - for (Map.Entry propertiesEntry : properties.entrySet()) { - String key = propertiesEntry.getKey(); - Schema property = propertiesEntry.getValue(); - if (property instanceof ObjectSchema && ((ObjectSchema) property).getProperties() != null - && ((ObjectSchema) property).getProperties().size() > 0) { - ObjectSchema op = (ObjectSchema) property; - String modelName = resolveModelName(op.getTitle(), path + "_" + key); - Schema model = modelFromProperty(openAPI, op, modelName); - String existing = matchGenerated(model); - if (existing != null) { - Schema schema = new Schema().$ref(existing); - schema.setRequired(op.getRequired()); - propsToUpdate.put(key, schema); - } else { - modelName = addSchemas(modelName, model); - Schema schema = new Schema().$ref(modelName); - schema.setRequired(op.getRequired()); - propsToUpdate.put(key, schema); - modelsToAdd.put(modelName, model); - } - } else if (property instanceof ArraySchema) { - ArraySchema ap = (ArraySchema) property; - Schema inner = ap.getItems(); - if (inner instanceof ObjectSchema) { - ObjectSchema op = (ObjectSchema) inner; - if (op.getProperties() != null && op.getProperties().size() > 0) { - flattenProperties(openAPI, op.getProperties(), path); - String modelName = resolveModelName(op.getTitle(), path + "_" + key); - Schema innerModel = modelFromProperty(openAPI, op, modelName); - String existing = matchGenerated(innerModel); - if (existing != null) { - Schema schema = new Schema().$ref(existing); - schema.setRequired(op.getRequired()); - ap.setItems(schema); - } else { - modelName = addSchemas(modelName, innerModel); - Schema schema = new Schema().$ref(modelName); - schema.setRequired(op.getRequired()); - ap.setItems(schema); - } - } - } - } - if (ModelUtils.isMapSchema(property)) { - Schema inner = ModelUtils.getAdditionalProperties(openAPI, property); - if (inner instanceof ObjectSchema) { - ObjectSchema op = (ObjectSchema) inner; - if (op.getProperties() != null && op.getProperties().size() > 0) { - flattenProperties(openAPI, op.getProperties(), path); - String modelName = resolveModelName(op.getTitle(), path + "_" + key); - Schema innerModel = modelFromProperty(openAPI, op, modelName); - String existing = matchGenerated(innerModel); - if (existing != null) { - Schema schema = new Schema().$ref(existing); - schema.setRequired(op.getRequired()); - property.setAdditionalProperties(schema); - } else { - modelName = addSchemas(modelName, innerModel); - Schema schema = new Schema().$ref(modelName); - schema.setRequired(op.getRequired()); - property.setAdditionalProperties(schema); - } - } - } - } - } - if (propsToUpdate.size() > 0) { - for (String key : propsToUpdate.keySet()) { - properties.put(key, propsToUpdate.get(key)); - } - } - for (String key : modelsToAdd.keySet()) { - openAPI.getComponents().addSchemas(key, modelsToAdd.get(key)); - this.addedModels.put(key, modelsToAdd.get(key)); - } - } - - private Schema modelFromProperty(OpenAPI openAPI, Schema object, String path) { - String description = object.getDescription(); - String example = null; - Object obj = object.getExample(); - if (obj != null) { - example = obj.toString(); - } - XML xml = object.getXml(); - Map properties = object.getProperties(); - - // NOTE: - // No need to null check setters below. All defaults in the new'd Schema are null, so setting to null would just be a noop. - Schema model = new Schema(); - model.setType(object.getType()); - - // Even though the `format` keyword typically applies to primitive types only, - // the JSON schema specification states `format` can be used for any model type instance - // including object types. - model.setFormat(object.getFormat()); - - model.setDescription(description); - model.setExample(example); - model.setName(object.getName()); - model.setXml(xml); - model.setRequired(object.getRequired()); - model.setNullable(object.getNullable()); - model.setEnum(object.getEnum()); - model.setType(object.getType()); - model.setDiscriminator(object.getDiscriminator()); - model.setWriteOnly(object.getWriteOnly()); - model.setUniqueItems(object.getUniqueItems()); - model.setTitle(object.getTitle()); - model.setReadOnly(object.getReadOnly()); - model.setPattern(object.getPattern()); - model.setNot(object.getNot()); - model.setMinProperties(object.getMinProperties()); - model.setMinLength(object.getMinLength()); - model.setMinItems(object.getMinItems()); - model.setMinimum(object.getMinimum()); - model.setMaxProperties(object.getMaxProperties()); - model.setMaxLength(object.getMaxLength()); - model.setMaxItems(object.getMaxItems()); - model.setMaximum(object.getMaximum()); - model.setExternalDocs(object.getExternalDocs()); - model.setExtensions(object.getExtensions()); - model.setExclusiveMinimum(object.getExclusiveMinimum()); - model.setExclusiveMaximum(object.getExclusiveMaximum()); - // no need to set it again as it's set earlier - //model.setExample(object.getExample()); - model.setDeprecated(object.getDeprecated()); - - if (properties != null) { - flattenProperties(openAPI, properties, path); - model.setProperties(properties); - } - return model; - } - - /** - * Move schema to components (if new) and return $ref to schema or - * existing schema. - * - * @param name new schema name - * @param schema schema to move to components or find existing ref - * @return {@link Schema} $ref schema to new or existing schema - */ - private Schema makeSchemaInComponents(String name, Schema schema) { - String existing = matchGenerated(schema); - Schema refSchema; - if (existing != null) { - refSchema = new Schema().$ref(existing); - } else { - if (resolveInlineEnums && schema.getEnum() != null && schema.getEnum().size() > 0) { - LOGGER.warn("Model " + name + " promoted to its own schema due to resolveInlineEnums=true"); - } - name = addSchemas(name, schema); - refSchema = new Schema().$ref(name); - } - this.copyVendorExtensions(schema, refSchema); - - return refSchema; - } - - /** - * Make a Schema - * - * @param ref new property name - * @param property Schema - * @return {@link Schema} A constructed OpenAPI property - */ - private Schema makeSchema(String ref, Schema property) { - Schema newProperty = new Schema().$ref(ref); - this.copyVendorExtensions(property, newProperty); - return newProperty; - } - - /** - * Copy vendor extensions from Model to another Model - * - * @param source source property - * @param target target property - */ - private void copyVendorExtensions(Schema source, Schema target) { - Map vendorExtensions = source.getExtensions(); - if (vendorExtensions == null) { - return; - } - for (String extName : vendorExtensions.keySet()) { - target.addExtension(extName, vendorExtensions.get(extName)); - } - } - - /** - * Add the schemas to the components - * - * @param name name of the inline schema - * @param schema inilne schema - * @return the actual model name (based on inlineSchemaNameMapping if provied) - */ - private String addSchemas(String name, Schema schema) { - //check inlineSchemaNameMapping - if (inlineSchemaNameMapping.containsKey(name)) { - name = inlineSchemaNameMapping.get(name); - } - - addGenerated(name, schema); - openAPI.getComponents().addSchemas(name, schema); - if (!name.equals(schema.getTitle()) && !inlineSchemaNameMappingValues.contains(name)) { - LOGGER.info("Inline schema created as {}. To have complete control of the model name, set the `title` field or use the inlineSchemaNameMapping option (--inline-schema-name-mapping in CLI).", name); - } - - uniqueNames.add(name); - - return name; - } - - -} diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/ObjectWithTypeBooleans.java b/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/ObjectWithTypeBooleans.java deleted file mode 100644 index 28038f46912..00000000000 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/ObjectWithTypeBooleans.java +++ /dev/null @@ -1,62 +0,0 @@ -package org.openapitools.codegen; - -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.Map; - -public class ObjectWithTypeBooleans { - public boolean isUnboundedInteger; - public boolean isNumber; - public boolean isString; - public boolean isMap; - public boolean isArray; - public boolean isBoolean; - public boolean isNull; - public Object value; - - /** - * A wrapper class that is used to store payloads to be ingested by schemas - * This class includes the payload value in the value property - * Other booleans: isUnboundedInteger/isNumber/isString/isMap/isArray/isBoolean/isNull - * allow generator templates to decide how to render each payload into code - * based upon what type it is. The booleans isX describe the value in value. - * @param value the input payload that is stored - */ - public ObjectWithTypeBooleans(Object value) { - Object usedValue = null; - if (value instanceof Integer){ - this.isUnboundedInteger = true; - this.value = value; - } else if (value instanceof Double || value instanceof Float){ - this.isNumber = true; - this.value = value; - } else if (value instanceof String) { - this.isString = true; - this.value = value; - } else if (value instanceof LinkedHashMap) { - LinkedHashMap castValue = (LinkedHashMap) value; - LinkedHashMap castMap = new LinkedHashMap<>(); - for (Map.Entry entry: castValue.entrySet()) { - ObjectWithTypeBooleans entryKey = new ObjectWithTypeBooleans(entry.getKey()); - ObjectWithTypeBooleans entryValue = new ObjectWithTypeBooleans(entry.getValue()); - castMap.put(entryKey, entryValue); - } - this.value = castMap; - this.isMap = true; - } else if (value instanceof ArrayList) { - ArrayList castList = new ArrayList<>(); - for (Object item: (ArrayList) value) { - castList.add(new ObjectWithTypeBooleans(item)); - } - this.value = castList; - this.isArray = true; - } else if (value instanceof Boolean) { - this.isBoolean = true; - this.value = value; - } else if (value == null) { - this.isNull = true; - this.value = value; - } - } -} - diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/SchemaTestCase.java b/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/SchemaTestCase.java deleted file mode 100644 index c377fe704e2..00000000000 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/SchemaTestCase.java +++ /dev/null @@ -1,14 +0,0 @@ -package org.openapitools.codegen; - -public class SchemaTestCase { - public String description; - public ObjectWithTypeBooleans data; - // true means the test case should pass, false means it should fail - public boolean valid; - - public SchemaTestCase(String description, ObjectWithTypeBooleans data, boolean valid) { - this.description = description; - this.data = data; - this.valid = valid; - } -} diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/exceptions/ProtoBufIndexComputationException.java b/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/exceptions/ProtoBufIndexComputationException.java deleted file mode 100644 index 132eb147c86..00000000000 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/exceptions/ProtoBufIndexComputationException.java +++ /dev/null @@ -1,9 +0,0 @@ -package org.openapitools.codegen.exceptions; - -public class ProtoBufIndexComputationException extends Exception { - - public ProtoBufIndexComputationException(String reason) { - super(reason); - } - -} diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java b/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java deleted file mode 100644 index 25437042937..00000000000 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java +++ /dev/null @@ -1,2140 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen.languages; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.ArrayNode; -import com.google.common.base.Strings; -import com.google.common.collect.Sets; -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.Operation; -import io.swagger.v3.oas.models.PathItem; -import io.swagger.v3.oas.models.examples.Example; -import io.swagger.v3.oas.models.media.*; -import io.swagger.v3.oas.models.parameters.Parameter; -import io.swagger.v3.oas.models.parameters.RequestBody; -import io.swagger.v3.oas.models.servers.Server; -import io.swagger.v3.parser.util.SchemaTypeUtil; -import org.apache.commons.io.FilenameUtils; -import org.apache.commons.lang3.BooleanUtils; -import org.apache.commons.lang3.StringUtils; -import org.openapitools.codegen.*; -import org.openapitools.codegen.languages.features.DocumentationProviderFeatures; -import org.openapitools.codegen.meta.features.*; -import org.openapitools.codegen.model.ModelMap; -import org.openapitools.codegen.model.ModelsMap; -import org.openapitools.codegen.model.OperationMap; -import org.openapitools.codegen.model.OperationsMap; -import org.openapitools.codegen.utils.ModelUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.File; -import java.io.IOException; -import java.time.LocalDate; -import java.time.ZoneId; -import java.util.*; -import java.util.concurrent.ConcurrentSkipListSet; -import java.util.regex.Pattern; -import java.util.stream.Collectors; -import java.util.stream.Stream; -import java.util.stream.StreamSupport; - -import static org.openapitools.codegen.utils.StringUtils.*; - -public abstract class AbstractJavaCodegen extends DefaultCodegen implements CodegenConfig, - DocumentationProviderFeatures { - - private final Logger LOGGER = LoggerFactory.getLogger(AbstractJavaCodegen.class); - private static final String ARTIFACT_VERSION_DEFAULT_VALUE = "1.0.0"; - - public static final String FULL_JAVA_UTIL = "fullJavaUtil"; - public static final String DEFAULT_LIBRARY = ""; - public static final String DATE_LIBRARY = "dateLibrary"; - public static final String SUPPORT_ASYNC = "supportAsync"; - public static final String WITH_XML = "withXml"; - public static final String SUPPORT_JAVA6 = "supportJava6"; - public static final String DISABLE_HTML_ESCAPING = "disableHtmlEscaping"; - public static final String BOOLEAN_GETTER_PREFIX = "booleanGetterPrefix"; - public static final String IGNORE_ANYOF_IN_ENUM = "ignoreAnyOfInEnum"; - public static final String ADDITIONAL_MODEL_TYPE_ANNOTATIONS = "additionalModelTypeAnnotations"; - public static final String ADDITIONAL_ENUM_TYPE_ANNOTATIONS = "additionalEnumTypeAnnotations"; - public static final String DISCRIMINATOR_CASE_SENSITIVE = "discriminatorCaseSensitive"; - public static final String OPENAPI_NULLABLE = "openApiNullable"; - public static final String JACKSON = "jackson"; - public static final String TEST_OUTPUT = "testOutput"; - public static final String IMPLICIT_HEADERS = "implicitHeaders"; - public static final String IMPLICIT_HEADERS_REGEX = "implicitHeadersRegex"; - - public static final String DEFAULT_TEST_FOLDER = "${project.build.directory}/generated-test-sources/openapi"; - - protected String dateLibrary = "java8"; - protected boolean supportAsync = false; - protected boolean withXml = false; - protected String invokerPackage = "org.openapitools"; - protected String groupId = "org.openapitools"; - protected String artifactId = "openapi-java"; - protected String artifactVersion = null; - protected String artifactUrl = "https://github.com/openapitools/openapi-generator"; - protected String artifactDescription = "OpenAPI Java"; - protected String developerName = "OpenAPI-Generator Contributors"; - protected String developerEmail = "team@openapitools.org"; - protected String developerOrganization = "OpenAPITools.org"; - protected String developerOrganizationUrl = "http://openapitools.org"; - protected String scmConnection = "scm:git:git@github.com:openapitools/openapi-generator.git"; - protected String scmDeveloperConnection = "scm:git:git@github.com:openapitools/openapi-generator.git"; - protected String scmUrl = "https://github.com/openapitools/openapi-generator"; - protected String licenseName = "Unlicense"; - protected String licenseUrl = "http://unlicense.org"; - protected String projectFolder = "src/main"; - protected String projectTestFolder = "src/test"; - // this must not be OS-specific - protected String sourceFolder = projectFolder + "/java"; - protected String testFolder = projectTestFolder + "/java"; - protected boolean fullJavaUtil; - protected boolean discriminatorCaseSensitive = true; // True if the discriminator value lookup should be case-sensitive. - protected String javaUtilPrefix = ""; - protected Boolean serializableModel = false; - protected boolean serializeBigDecimalAsString = false; - protected String apiDocPath = "docs/"; - protected String modelDocPath = "docs/"; - protected boolean supportJava6 = false; - protected boolean disableHtmlEscaping = false; - protected String booleanGetterPrefix = "get"; - protected boolean ignoreAnyOfInEnum = false; - protected String parentGroupId = ""; - protected String parentArtifactId = ""; - protected String parentVersion = ""; - protected boolean parentOverridden = false; - protected List additionalModelTypeAnnotations = new LinkedList<>(); - protected List additionalEnumTypeAnnotations = new LinkedList<>(); - protected boolean openApiNullable = true; - protected String outputTestFolder = ""; - protected DocumentationProvider documentationProvider; - protected AnnotationLibrary annotationLibrary; - protected boolean implicitHeaders = false; - protected String implicitHeadersRegex = null; - - private Map schemaKeyToModelNameCache = new HashMap<>(); - - public AbstractJavaCodegen() { - super(); - - modifyFeatureSet(features -> features - .includeDocumentationFeatures(DocumentationFeature.Readme) - .wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML)) - .securityFeatures(EnumSet.noneOf( - SecurityFeature.class - )) - .excludeGlobalFeatures( - GlobalFeature.XMLStructureDefinitions, - GlobalFeature.Callbacks, - GlobalFeature.LinkObjects, - GlobalFeature.ParameterStyling - ) - .excludeSchemaSupportFeatures( - SchemaSupportFeature.Polymorphism - ) - .includeClientModificationFeatures( - ClientModificationFeature.BasePath - ) - ); - - supportsInheritance = true; - modelTemplateFiles.put("model.mustache", ".java"); - apiTemplateFiles.put("api.mustache", ".java"); - apiTestTemplateFiles.put("api_test.mustache", ".java"); - modelDocTemplateFiles.put("model_doc.mustache", ".md"); - apiDocTemplateFiles.put("api_doc.mustache", ".md"); - - hideGenerationTimestamp = false; - - setReservedWordsLowerCase( - Arrays.asList( - // special words - "object", "list", "file", - // used as internal variables, can collide with parameter names - "localVarPath", "localVarQueryParams", "localVarCollectionQueryParams", - "localVarHeaderParams", "localVarCookieParams", "localVarFormParams", "localVarPostBody", - "localVarAccepts", "localVarAccept", "localVarContentTypes", - "localVarContentType", "localVarAuthNames", "localReturnType", - "ApiClient", "ApiException", "ApiResponse", "Configuration", "StringUtil", - - // language reserved words - "abstract", "continue", "for", "new", "switch", "assert", - "default", "if", "package", "synchronized", "boolean", "do", "goto", "private", - "this", "break", "double", "implements", "protected", "throw", "byte", "else", - "import", "public", "throws", "case", "enum", "instanceof", "return", "transient", - "catch", "extends", "int", "short", "try", "char", "final", "interface", "static", - "void", "class", "finally", "long", "strictfp", "volatile", "const", "float", - "native", "super", "while", "null") - ); - - languageSpecificPrimitives = Sets.newHashSet("String", - "boolean", - "Boolean", - "Double", - "Integer", - "Long", - "Float", - "Object", - "byte[]" - ); - instantiationTypes.put("array", "ArrayList"); - instantiationTypes.put("set", "LinkedHashSet"); - instantiationTypes.put("map", "HashMap"); - typeMapping.put("date", "Date"); - typeMapping.put("file", "File"); - typeMapping.put("AnyType", "Object"); - - importMapping.put("BigDecimal", "java.math.BigDecimal"); - importMapping.put("UUID", "java.util.UUID"); - importMapping.put("URI", "java.net.URI"); - importMapping.put("File", "java.io.File"); - importMapping.put("Date", "java.util.Date"); - importMapping.put("Timestamp", "java.sql.Timestamp"); - importMapping.put("Map", "java.util.Map"); - importMapping.put("HashMap", "java.util.HashMap"); - importMapping.put("Array", "java.util.List"); - importMapping.put("ArrayList", "java.util.ArrayList"); - importMapping.put("List", "java.util.*"); - importMapping.put("Set", "java.util.*"); - importMapping.put("LinkedHashSet", "java.util.LinkedHashSet"); - importMapping.put("DateTime", "org.joda.time.*"); - importMapping.put("LocalDateTime", "org.joda.time.*"); - importMapping.put("LocalDate", "org.joda.time.*"); - importMapping.put("LocalTime", "org.joda.time.*"); - - cliOptions.add(new CliOption(CodegenConstants.MODEL_PACKAGE, CodegenConstants.MODEL_PACKAGE_DESC)); - cliOptions.add(new CliOption(CodegenConstants.API_PACKAGE, CodegenConstants.API_PACKAGE_DESC)); - cliOptions.add(new CliOption(CodegenConstants.INVOKER_PACKAGE, CodegenConstants.INVOKER_PACKAGE_DESC).defaultValue(this.getInvokerPackage())); - cliOptions.add(new CliOption(CodegenConstants.GROUP_ID, CodegenConstants.GROUP_ID_DESC).defaultValue(this.getGroupId())); - cliOptions.add(new CliOption(CodegenConstants.ARTIFACT_ID, CodegenConstants.ARTIFACT_ID_DESC).defaultValue(this.getArtifactId())); - cliOptions.add(new CliOption(CodegenConstants.ARTIFACT_VERSION, CodegenConstants.ARTIFACT_VERSION_DESC).defaultValue(ARTIFACT_VERSION_DEFAULT_VALUE)); - cliOptions.add(new CliOption(CodegenConstants.ARTIFACT_URL, CodegenConstants.ARTIFACT_URL_DESC).defaultValue(this.getArtifactUrl())); - cliOptions.add(new CliOption(CodegenConstants.ARTIFACT_DESCRIPTION, CodegenConstants.ARTIFACT_DESCRIPTION_DESC).defaultValue(this.getArtifactDescription())); - cliOptions.add(new CliOption(CodegenConstants.SCM_CONNECTION, CodegenConstants.SCM_CONNECTION_DESC).defaultValue(this.getScmConnection())); - cliOptions.add(new CliOption(CodegenConstants.SCM_DEVELOPER_CONNECTION, CodegenConstants.SCM_DEVELOPER_CONNECTION_DESC).defaultValue(this.getScmDeveloperConnection())); - cliOptions.add(new CliOption(CodegenConstants.SCM_URL, CodegenConstants.SCM_URL_DESC).defaultValue(this.getScmUrl())); - cliOptions.add(new CliOption(CodegenConstants.DEVELOPER_NAME, CodegenConstants.DEVELOPER_NAME_DESC).defaultValue(this.getDeveloperName())); - cliOptions.add(new CliOption(CodegenConstants.DEVELOPER_EMAIL, CodegenConstants.DEVELOPER_EMAIL_DESC).defaultValue(this.getDeveloperEmail())); - cliOptions.add(new CliOption(CodegenConstants.DEVELOPER_ORGANIZATION, CodegenConstants.DEVELOPER_ORGANIZATION_DESC).defaultValue(this.getDeveloperOrganization())); - cliOptions.add(new CliOption(CodegenConstants.DEVELOPER_ORGANIZATION_URL, CodegenConstants.DEVELOPER_ORGANIZATION_URL_DESC).defaultValue(this.getDeveloperOrganizationUrl())); - cliOptions.add(new CliOption(CodegenConstants.LICENSE_NAME, CodegenConstants.LICENSE_NAME_DESC).defaultValue(this.getLicenseName())); - cliOptions.add(new CliOption(CodegenConstants.LICENSE_URL, CodegenConstants.LICENSE_URL_DESC).defaultValue(this.getLicenseUrl())); - cliOptions.add(new CliOption(CodegenConstants.SOURCE_FOLDER, CodegenConstants.SOURCE_FOLDER_DESC).defaultValue(this.getSourceFolder())); - cliOptions.add(CliOption.newBoolean(CodegenConstants.SERIALIZABLE_MODEL, CodegenConstants.SERIALIZABLE_MODEL_DESC, this.getSerializableModel())); - cliOptions.add(CliOption.newBoolean(CodegenConstants.SERIALIZE_BIG_DECIMAL_AS_STRING, CodegenConstants.SERIALIZE_BIG_DECIMAL_AS_STRING_DESC, serializeBigDecimalAsString)); - cliOptions.add(CliOption.newBoolean(FULL_JAVA_UTIL, "whether to use fully qualified name for classes under java.util. This option only works for Java API client", fullJavaUtil)); - cliOptions.add(CliOption.newBoolean(DISCRIMINATOR_CASE_SENSITIVE, "Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client", discriminatorCaseSensitive)); - cliOptions.add(CliOption.newBoolean(CodegenConstants.HIDE_GENERATION_TIMESTAMP, CodegenConstants.HIDE_GENERATION_TIMESTAMP_DESC, this.isHideGenerationTimestamp())); - cliOptions.add(CliOption.newBoolean(WITH_XML, "whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)")); - - CliOption dateLibrary = new CliOption(DATE_LIBRARY, "Option. Date library to use").defaultValue(this.getDateLibrary()); - Map dateOptions = new HashMap<>(); - dateOptions.put("java8", "Java 8 native JSR310 (preferred for jdk 1.8+)"); - dateOptions.put("java8-localdatetime", "Java 8 using LocalDateTime (for legacy app only)"); - dateOptions.put("joda", "Joda (for legacy app only)"); - dateOptions.put("legacy", "Legacy java.util.Date"); - dateLibrary.setEnum(dateOptions); - cliOptions.add(dateLibrary); - - cliOptions.add(CliOption.newBoolean(DISABLE_HTML_ESCAPING, "Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)", disableHtmlEscaping)); - cliOptions.add(CliOption.newString(BOOLEAN_GETTER_PREFIX, "Set booleanGetterPrefix").defaultValue(this.getBooleanGetterPrefix())); - cliOptions.add(CliOption.newBoolean(IGNORE_ANYOF_IN_ENUM, "Ignore anyOf keyword in enum", ignoreAnyOfInEnum)); - cliOptions.add(CliOption.newString(ADDITIONAL_ENUM_TYPE_ANNOTATIONS, "Additional annotations for enum type(class level annotations)")); - cliOptions.add(CliOption.newString(ADDITIONAL_MODEL_TYPE_ANNOTATIONS, "Additional annotations for model type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)")); - cliOptions.add(CliOption.newBoolean(OPENAPI_NULLABLE, "Enable OpenAPI Jackson Nullable library", this.openApiNullable)); - cliOptions.add(CliOption.newBoolean(IMPLICIT_HEADERS, "Skip header parameters in the generated API methods using @ApiImplicitParams annotation.", implicitHeaders)); - cliOptions.add(CliOption.newString(IMPLICIT_HEADERS_REGEX, "Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true")); - - cliOptions.add(CliOption.newString(CodegenConstants.PARENT_GROUP_ID, CodegenConstants.PARENT_GROUP_ID_DESC)); - cliOptions.add(CliOption.newString(CodegenConstants.PARENT_ARTIFACT_ID, CodegenConstants.PARENT_ARTIFACT_ID_DESC)); - cliOptions.add(CliOption.newString(CodegenConstants.PARENT_VERSION, CodegenConstants.PARENT_VERSION_DESC)); - CliOption snapShotVersion = CliOption.newString(CodegenConstants.SNAPSHOT_VERSION, CodegenConstants.SNAPSHOT_VERSION_DESC); - Map snapShotVersionOptions = new HashMap<>(); - snapShotVersionOptions.put("true", "Use a SnapShot Version"); - snapShotVersionOptions.put("false", "Use a Release Version"); - snapShotVersion.setEnum(snapShotVersionOptions); - cliOptions.add(snapShotVersion); - cliOptions.add(CliOption.newString(TEST_OUTPUT, "Set output folder for models and APIs tests").defaultValue(DEFAULT_TEST_FOLDER)); - - if (null != defaultDocumentationProvider()) { - CliOption documentationProviderCliOption = new CliOption(DOCUMENTATION_PROVIDER, - "Select the OpenAPI documentation provider.") - .defaultValue(defaultDocumentationProvider().toCliOptValue()); - supportedDocumentationProvider().forEach(dp -> - documentationProviderCliOption.addEnum(dp.toCliOptValue(), dp.getDescription())); - cliOptions.add(documentationProviderCliOption); - - CliOption annotationLibraryCliOption = new CliOption(ANNOTATION_LIBRARY, - "Select the complementary documentation annotation library.") - .defaultValue(defaultDocumentationProvider().getPreferredAnnotationLibrary().toCliOptValue()); - supportedAnnotationLibraries().forEach(al -> - annotationLibraryCliOption.addEnum(al.toCliOptValue(), al.getDescription())); - cliOptions.add(annotationLibraryCliOption); - } - } - - @Override - public void processOpts() { - super.processOpts(); - - if (null != defaultDocumentationProvider()) { - documentationProvider = DocumentationProvider.ofCliOption( - (String) additionalProperties.getOrDefault(DOCUMENTATION_PROVIDER, - defaultDocumentationProvider().toCliOptValue()) - ); - - if (!supportedDocumentationProvider().contains(documentationProvider)) { - String msg = String.format(Locale.ROOT, - "The [%s] Documentation Provider is not supported by this generator", - documentationProvider.toCliOptValue()); - throw new IllegalArgumentException(msg); - } - - annotationLibrary = AnnotationLibrary.ofCliOption( - (String) additionalProperties.getOrDefault(ANNOTATION_LIBRARY, - documentationProvider.getPreferredAnnotationLibrary().toCliOptValue()) - ); - - if (!supportedAnnotationLibraries().contains(annotationLibrary)) { - String msg = String.format(Locale.ROOT, "The Annotation Library [%s] is not supported by this generator", - annotationLibrary.toCliOptValue()); - throw new IllegalArgumentException(msg); - } - - if (!documentationProvider.supportedAnnotationLibraries().contains(annotationLibrary)) { - String msg = String.format(Locale.ROOT, - "The [%s] documentation provider does not support [%s] as complementary annotation library", - documentationProvider.toCliOptValue(), annotationLibrary.toCliOptValue()); - throw new IllegalArgumentException(msg); - } - - additionalProperties.put(DOCUMENTATION_PROVIDER, documentationProvider.toCliOptValue()); - additionalProperties.put(documentationProvider.getPropertyName(), true); - additionalProperties.put(ANNOTATION_LIBRARY, annotationLibrary.toCliOptValue()); - additionalProperties.put(annotationLibrary.getPropertyName(), true); - } else { - additionalProperties.put(DOCUMENTATION_PROVIDER, DocumentationProvider.NONE); - additionalProperties.put(ANNOTATION_LIBRARY, AnnotationLibrary.NONE); - } - - - if (StringUtils.isEmpty(System.getenv("JAVA_POST_PROCESS_FILE"))) { - LOGGER.info("Environment variable JAVA_POST_PROCESS_FILE not defined so the Java code may not be properly formatted. To define it, try 'export JAVA_POST_PROCESS_FILE=\"/usr/local/bin/clang-format -i\"' (Linux/Mac)"); - LOGGER.info("NOTE: To enable file post-processing, 'enablePostProcessFile' must be set to `true` (--enable-post-process-file for CLI)."); - } - - if (additionalProperties.containsKey(SUPPORT_JAVA6)) { - this.setSupportJava6(Boolean.parseBoolean(additionalProperties.get(SUPPORT_JAVA6).toString())); - } - additionalProperties.put(SUPPORT_JAVA6, supportJava6); - - if (additionalProperties.containsKey(DISABLE_HTML_ESCAPING)) { - this.setDisableHtmlEscaping(Boolean.parseBoolean(additionalProperties.get(DISABLE_HTML_ESCAPING).toString())); - } - additionalProperties.put(DISABLE_HTML_ESCAPING, disableHtmlEscaping); - - if (additionalProperties.containsKey(BOOLEAN_GETTER_PREFIX)) { - this.setBooleanGetterPrefix(additionalProperties.get(BOOLEAN_GETTER_PREFIX).toString()); - } - additionalProperties.put(BOOLEAN_GETTER_PREFIX, booleanGetterPrefix); - - if (additionalProperties.containsKey(IGNORE_ANYOF_IN_ENUM)) { - this.setIgnoreAnyOfInEnum(Boolean.parseBoolean(additionalProperties.get(IGNORE_ANYOF_IN_ENUM).toString())); - } - additionalProperties.put(IGNORE_ANYOF_IN_ENUM, ignoreAnyOfInEnum); - - if (additionalProperties.containsKey(ADDITIONAL_MODEL_TYPE_ANNOTATIONS)) { - String additionalAnnotationsList = additionalProperties.get(ADDITIONAL_MODEL_TYPE_ANNOTATIONS).toString(); - this.setAdditionalModelTypeAnnotations(Arrays.asList(additionalAnnotationsList.trim().split("\\s*(;|\\r?\\n)\\s*"))); - } - - if (additionalProperties.containsKey(ADDITIONAL_ENUM_TYPE_ANNOTATIONS)) { - String additionalAnnotationsList = additionalProperties.get(ADDITIONAL_ENUM_TYPE_ANNOTATIONS).toString(); - - this.setAdditionalEnumTypeAnnotations(Arrays.asList(additionalAnnotationsList.split(";"))); - } - - if (additionalProperties.containsKey(CodegenConstants.INVOKER_PACKAGE)) { - this.setInvokerPackage((String) additionalProperties.get(CodegenConstants.INVOKER_PACKAGE)); - } else if (additionalProperties.containsKey(CodegenConstants.API_PACKAGE)) { - // guess from api package - String derivedInvokerPackage = deriveInvokerPackageName((String) additionalProperties.get(CodegenConstants.API_PACKAGE)); - this.additionalProperties.put(CodegenConstants.INVOKER_PACKAGE, derivedInvokerPackage); - this.setInvokerPackage((String) additionalProperties.get(CodegenConstants.INVOKER_PACKAGE)); - LOGGER.info("Invoker Package Name, originally not set, is now derived from api package name: {}", derivedInvokerPackage); - } else if (additionalProperties.containsKey(CodegenConstants.MODEL_PACKAGE)) { - // guess from model package - String derivedInvokerPackage = deriveInvokerPackageName((String) additionalProperties.get(CodegenConstants.MODEL_PACKAGE)); - this.additionalProperties.put(CodegenConstants.INVOKER_PACKAGE, derivedInvokerPackage); - this.setInvokerPackage((String) additionalProperties.get(CodegenConstants.INVOKER_PACKAGE)); - LOGGER.info("Invoker Package Name, originally not set, is now derived from model package name: {}", - derivedInvokerPackage); - } else { - //not set, use default to be passed to template - additionalProperties.put(CodegenConstants.INVOKER_PACKAGE, invokerPackage); - } - - if (!additionalProperties.containsKey(CodegenConstants.MODEL_PACKAGE)) { - additionalProperties.put(CodegenConstants.MODEL_PACKAGE, modelPackage); - } - - if (!additionalProperties.containsKey(CodegenConstants.API_PACKAGE)) { - additionalProperties.put(CodegenConstants.API_PACKAGE, apiPackage); - } - - if (additionalProperties.containsKey(CodegenConstants.GROUP_ID)) { - this.setGroupId((String) additionalProperties.get(CodegenConstants.GROUP_ID)); - } else { - //not set, use to be passed to template - additionalProperties.put(CodegenConstants.GROUP_ID, groupId); - } - - if (additionalProperties.containsKey(CodegenConstants.ARTIFACT_ID)) { - this.setArtifactId((String) additionalProperties.get(CodegenConstants.ARTIFACT_ID)); - } else { - //not set, use to be passed to template - additionalProperties.put(CodegenConstants.ARTIFACT_ID, artifactId); - } - - if (additionalProperties.containsKey(CodegenConstants.ARTIFACT_URL)) { - this.setArtifactUrl((String) additionalProperties.get(CodegenConstants.ARTIFACT_URL)); - } else { - additionalProperties.put(CodegenConstants.ARTIFACT_URL, artifactUrl); - } - - if (additionalProperties.containsKey(CodegenConstants.ARTIFACT_DESCRIPTION)) { - this.setArtifactDescription((String) additionalProperties.get(CodegenConstants.ARTIFACT_DESCRIPTION)); - } else { - additionalProperties.put(CodegenConstants.ARTIFACT_DESCRIPTION, artifactDescription); - } - - if (additionalProperties.containsKey(CodegenConstants.SCM_CONNECTION)) { - this.setScmConnection((String) additionalProperties.get(CodegenConstants.SCM_CONNECTION)); - } else { - additionalProperties.put(CodegenConstants.SCM_CONNECTION, scmConnection); - } - - if (additionalProperties.containsKey(CodegenConstants.SCM_DEVELOPER_CONNECTION)) { - this.setScmDeveloperConnection((String) additionalProperties.get(CodegenConstants.SCM_DEVELOPER_CONNECTION)); - } else { - additionalProperties.put(CodegenConstants.SCM_DEVELOPER_CONNECTION, scmDeveloperConnection); - } - - if (additionalProperties.containsKey(CodegenConstants.SCM_URL)) { - this.setScmUrl((String) additionalProperties.get(CodegenConstants.SCM_URL)); - } else { - additionalProperties.put(CodegenConstants.SCM_URL, scmUrl); - } - - if (additionalProperties.containsKey(CodegenConstants.DEVELOPER_NAME)) { - this.setDeveloperName((String) additionalProperties.get(CodegenConstants.DEVELOPER_NAME)); - } else { - additionalProperties.put(CodegenConstants.DEVELOPER_NAME, developerName); - } - - if (additionalProperties.containsKey(CodegenConstants.DEVELOPER_EMAIL)) { - this.setDeveloperEmail((String) additionalProperties.get(CodegenConstants.DEVELOPER_EMAIL)); - } else { - additionalProperties.put(CodegenConstants.DEVELOPER_EMAIL, developerEmail); - } - - if (additionalProperties.containsKey(CodegenConstants.DEVELOPER_ORGANIZATION)) { - this.setDeveloperOrganization((String) additionalProperties.get(CodegenConstants.DEVELOPER_ORGANIZATION)); - } else { - additionalProperties.put(CodegenConstants.DEVELOPER_ORGANIZATION, developerOrganization); - } - - if (additionalProperties.containsKey(CodegenConstants.DEVELOPER_ORGANIZATION_URL)) { - this.setDeveloperOrganizationUrl((String) additionalProperties.get(CodegenConstants.DEVELOPER_ORGANIZATION_URL)); - } else { - additionalProperties.put(CodegenConstants.DEVELOPER_ORGANIZATION_URL, developerOrganizationUrl); - } - - if (additionalProperties.containsKey(CodegenConstants.LICENSE_NAME)) { - this.setLicenseName((String) additionalProperties.get(CodegenConstants.LICENSE_NAME)); - } else { - additionalProperties.put(CodegenConstants.LICENSE_NAME, licenseName); - } - - if (additionalProperties.containsKey(CodegenConstants.LICENSE_URL)) { - this.setLicenseUrl((String) additionalProperties.get(CodegenConstants.LICENSE_URL)); - } else { - additionalProperties.put(CodegenConstants.LICENSE_URL, licenseUrl); - } - - if (additionalProperties.containsKey(CodegenConstants.SOURCE_FOLDER)) { - this.setSourceFolder((String) additionalProperties.get(CodegenConstants.SOURCE_FOLDER)); - } - additionalProperties.put(CodegenConstants.SOURCE_FOLDER, sourceFolder); - - if (additionalProperties.containsKey(CodegenConstants.SERIALIZABLE_MODEL)) { - this.setSerializableModel(Boolean.valueOf(additionalProperties.get(CodegenConstants.SERIALIZABLE_MODEL).toString())); - } - - if (additionalProperties.containsKey(CodegenConstants.LIBRARY)) { - this.setLibrary((String) additionalProperties.get(CodegenConstants.LIBRARY)); - } - - if (additionalProperties.containsKey(CodegenConstants.SERIALIZE_BIG_DECIMAL_AS_STRING)) { - this.setSerializeBigDecimalAsString(Boolean.parseBoolean(additionalProperties.get(CodegenConstants.SERIALIZE_BIG_DECIMAL_AS_STRING).toString())); - } - - // need to put back serializableModel (boolean) into additionalProperties as value in additionalProperties is string - additionalProperties.put(CodegenConstants.SERIALIZABLE_MODEL, serializableModel); - - if (additionalProperties.containsKey(FULL_JAVA_UTIL)) { - this.setFullJavaUtil(Boolean.parseBoolean(additionalProperties.get(FULL_JAVA_UTIL).toString())); - } - if (additionalProperties.containsKey(DISCRIMINATOR_CASE_SENSITIVE)) { - this.setDiscriminatorCaseSensitive(Boolean.parseBoolean(additionalProperties.get(DISCRIMINATOR_CASE_SENSITIVE).toString())); - } else { - // By default, the discriminator lookup should be case sensitive. There is nothing in the OpenAPI specification - // that indicates the lookup should be case insensitive. However, some implementations perform - // a case-insensitive lookup. - this.setDiscriminatorCaseSensitive(Boolean.TRUE); - } - additionalProperties.put(DISCRIMINATOR_CASE_SENSITIVE, this.discriminatorCaseSensitive); - - if (fullJavaUtil) { - javaUtilPrefix = "java.util."; - } - additionalProperties.put(FULL_JAVA_UTIL, fullJavaUtil); - additionalProperties.put("javaUtilPrefix", javaUtilPrefix); - - if (additionalProperties.containsKey(WITH_XML)) { - this.setWithXml(Boolean.parseBoolean(additionalProperties.get(WITH_XML).toString())); - } - additionalProperties.put(WITH_XML, withXml); - - if (additionalProperties.containsKey(OPENAPI_NULLABLE)) { - this.setOpenApiNullable(Boolean.parseBoolean(additionalProperties.get(OPENAPI_NULLABLE).toString())); - } - additionalProperties.put(OPENAPI_NULLABLE, openApiNullable); - - if (additionalProperties.containsKey(CodegenConstants.PARENT_GROUP_ID)) { - this.setParentGroupId((String) additionalProperties.get(CodegenConstants.PARENT_GROUP_ID)); - } - - if (additionalProperties.containsKey(CodegenConstants.PARENT_ARTIFACT_ID)) { - this.setParentArtifactId((String) additionalProperties.get(CodegenConstants.PARENT_ARTIFACT_ID)); - } - - if (additionalProperties.containsKey(CodegenConstants.PARENT_VERSION)) { - this.setParentVersion((String) additionalProperties.get(CodegenConstants.PARENT_VERSION)); - } - - if (additionalProperties.containsKey(IMPLICIT_HEADERS)) { - this.setImplicitHeaders(Boolean.parseBoolean(additionalProperties.get(IMPLICIT_HEADERS).toString())); - } - - if (additionalProperties.containsKey(IMPLICIT_HEADERS_REGEX)) { - this.setImplicitHeadersRegex(additionalProperties.get(IMPLICIT_HEADERS_REGEX).toString()); - } - - if (!StringUtils.isEmpty(parentGroupId) && !StringUtils.isEmpty(parentArtifactId) && !StringUtils.isEmpty(parentVersion)) { - additionalProperties.put("parentOverridden", true); - } - - // make api and model doc path available in mustache template - additionalProperties.put("apiDocPath", apiDocPath); - additionalProperties.put("modelDocPath", modelDocPath); - - importMapping.put("List", "java.util.List"); - importMapping.put("Set", "java.util.Set"); - - if (fullJavaUtil) { - typeMapping.put("array", "java.util.List"); - typeMapping.put("set", "java.util.Set"); - typeMapping.put("map", "java.util.Map"); - typeMapping.put("DateTime", "java.util.Date"); - typeMapping.put("UUID", "java.util.UUID"); - typeMapping.remove("List"); - importMapping.remove("Date"); - importMapping.remove("Map"); - importMapping.remove("HashMap"); - importMapping.remove("Array"); - importMapping.remove("ArrayList"); - importMapping.remove("List"); - importMapping.remove("Set"); - importMapping.remove("DateTime"); - importMapping.remove("UUID"); - instantiationTypes.put("array", "java.util.ArrayList"); - instantiationTypes.put("set", "java.util.LinkedHashSet"); - instantiationTypes.put("map", "java.util.HashMap"); - } - - this.sanitizeConfig(); - - // optional jackson mappings for BigDecimal support - importMapping.put("ToStringSerializer", "com.fasterxml.jackson.databind.ser.std.ToStringSerializer"); - importMapping.put("JsonSerialize", "com.fasterxml.jackson.databind.annotation.JsonSerialize"); - importMapping.put("JsonDeserialize", "com.fasterxml.jackson.databind.annotation.JsonDeserialize"); - - // imports for pojos - importMapping.put("ApiModelProperty", "io.swagger.annotations.ApiModelProperty"); - importMapping.put("ApiModel", "io.swagger.annotations.ApiModel"); - importMapping.put("BigDecimal", "java.math.BigDecimal"); - importMapping.put("JsonProperty", "com.fasterxml.jackson.annotation.JsonProperty"); - importMapping.put("JsonSubTypes", "com.fasterxml.jackson.annotation.JsonSubTypes"); - importMapping.put("JsonTypeInfo", "com.fasterxml.jackson.annotation.JsonTypeInfo"); - importMapping.put("JsonTypeName", "com.fasterxml.jackson.annotation.JsonTypeName"); - importMapping.put("JsonCreator", "com.fasterxml.jackson.annotation.JsonCreator"); - importMapping.put("JsonValue", "com.fasterxml.jackson.annotation.JsonValue"); - importMapping.put("JsonIgnore", "com.fasterxml.jackson.annotation.JsonIgnore"); - importMapping.put("JsonIgnoreProperties", "com.fasterxml.jackson.annotation.JsonIgnoreProperties"); - importMapping.put("JsonInclude", "com.fasterxml.jackson.annotation.JsonInclude"); - importMapping.put("JsonNullable", "org.openapitools.jackson.nullable.JsonNullable"); - importMapping.put("SerializedName", "com.google.gson.annotations.SerializedName"); - importMapping.put("TypeAdapter", "com.google.gson.TypeAdapter"); - importMapping.put("JsonAdapter", "com.google.gson.annotations.JsonAdapter"); - importMapping.put("JsonReader", "com.google.gson.stream.JsonReader"); - importMapping.put("JsonWriter", "com.google.gson.stream.JsonWriter"); - importMapping.put("IOException", "java.io.IOException"); - importMapping.put("Arrays", "java.util.Arrays"); - importMapping.put("Objects", "java.util.Objects"); - importMapping.put("StringUtil", invokerPackage + ".StringUtil"); - // import JsonCreator if JsonProperty is imported - // used later in recursive import in postProcessingModels - importMapping.put("com.fasterxml.jackson.annotation.JsonProperty", "com.fasterxml.jackson.annotation.JsonCreator"); - - if (additionalProperties.containsKey(SUPPORT_ASYNC)) { - setSupportAsync(Boolean.parseBoolean(additionalProperties.get(SUPPORT_ASYNC).toString())); - if (supportAsync) { - additionalProperties.put(SUPPORT_ASYNC, "true"); - } - } - - if (additionalProperties.containsKey(DATE_LIBRARY)) { - setDateLibrary(additionalProperties.get("dateLibrary").toString()); - } - - if ("joda".equals(dateLibrary)) { - additionalProperties.put("joda", "true"); - typeMapping.put("date", "LocalDate"); - typeMapping.put("DateTime", "DateTime"); - importMapping.put("LocalDate", "org.joda.time.LocalDate"); - importMapping.put("DateTime", "org.joda.time.DateTime"); - } else if (dateLibrary.startsWith("java8")) { - additionalProperties.put("java8", "true"); - additionalProperties.put("jsr310", "true"); - typeMapping.put("date", "LocalDate"); - importMapping.put("LocalDate", "java.time.LocalDate"); - if ("java8-localdatetime".equals(dateLibrary)) { - typeMapping.put("DateTime", "LocalDateTime"); - importMapping.put("LocalDateTime", "java.time.LocalDateTime"); - } else { - typeMapping.put("DateTime", "OffsetDateTime"); - importMapping.put("OffsetDateTime", "java.time.OffsetDateTime"); - } - } else if (dateLibrary.equals("legacy")) { - additionalProperties.put("legacyDates", "true"); - } - - if (additionalProperties.containsKey(TEST_OUTPUT)) { - setOutputTestFolder(additionalProperties.get(TEST_OUTPUT).toString()); - } - } - - @Override - public Map postProcessAllModels(Map objs) { - objs = super.postProcessAllModels(objs); - objs = super.updateAllModels(objs); - - if (!additionalModelTypeAnnotations.isEmpty()) { - for (String modelName : objs.keySet()) { - Map models = (Map) objs.get(modelName); - models.put(ADDITIONAL_MODEL_TYPE_ANNOTATIONS, additionalModelTypeAnnotations); - } - } - - if (!additionalEnumTypeAnnotations.isEmpty()) { - for (String modelName : objs.keySet()) { - Map models = (Map) objs.get(modelName); - models.put(ADDITIONAL_ENUM_TYPE_ANNOTATIONS, additionalEnumTypeAnnotations); - } - } - - return objs; - } - - private void sanitizeConfig() { - // Sanitize any config options here. We also have to update the additionalProperties because - // the whole additionalProperties object is injected into the main object passed to the mustache layer - - this.setApiPackage(sanitizePackageName(apiPackage)); - if (additionalProperties.containsKey(CodegenConstants.API_PACKAGE)) { - this.additionalProperties.put(CodegenConstants.API_PACKAGE, apiPackage); - } - - this.setModelPackage(sanitizePackageName(modelPackage)); - if (additionalProperties.containsKey(CodegenConstants.MODEL_PACKAGE)) { - this.additionalProperties.put(CodegenConstants.MODEL_PACKAGE, modelPackage); - } - - this.setInvokerPackage(sanitizePackageName(invokerPackage)); - if (additionalProperties.containsKey(CodegenConstants.INVOKER_PACKAGE)) { - this.additionalProperties.put(CodegenConstants.INVOKER_PACKAGE, invokerPackage); - } - } - - @Override - public String escapeReservedWord(String name) { - if (this.reservedWordsMappings().containsKey(name)) { - return this.reservedWordsMappings().get(name); - } - return "_" + name; - } - - @Override - public String apiFileFolder() { - return (outputFolder + File.separator + sourceFolder + File.separator + apiPackage().replace('.', File.separatorChar)).replace('/', File.separatorChar); - } - - @Override - public String apiTestFileFolder() { - return (outputTestFolder + File.separator + testFolder + File.separator + apiPackage().replace('.', File.separatorChar)).replace('/', File.separatorChar); - } - - @Override - public String modelTestFileFolder() { - return (outputTestFolder + File.separator + testFolder + File.separator + modelPackage().replace('.', File.separatorChar)).replace('/', File.separatorChar); - } - - @Override - public String modelFileFolder() { - return (outputFolder + File.separator + sourceFolder + File.separator + modelPackage().replace('.', File.separatorChar)).replace('/', File.separatorChar); - } - - @Override - public String apiDocFileFolder() { - return (outputFolder + File.separator + apiDocPath).replace('/', File.separatorChar); - } - - @Override - public String modelDocFileFolder() { - return (outputFolder + File.separator + modelDocPath).replace('/', File.separatorChar); - } - - @Override - public String toApiDocFilename(String name) { - return toApiName(name); - } - - @Override - public String toModelDocFilename(String name) { - return toModelName(name); - } - - @Override - public String toApiTestFilename(String name) { - return toApiName(name) + "Test"; - } - - @Override - public String toModelTestFilename(String name) { - return toModelName(name) + "Test"; - } - - @Override - public String toApiFilename(String name) { - return toApiName(name); - } - - @Override - public String toVarName(String name) { - // sanitize name - name = sanitizeName(name, "\\W-[\\$]"); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'. - - if (name.toLowerCase(Locale.ROOT).matches("^_*class$")) { - return "propertyClass"; - } - - if ("_".equals(name)) { - name = "_u"; - } - - // numbers are not allowed at the beginning - if (name.matches("^\\d.*")) { - name = "_" + name; - } - - // if it's all upper case, do nothing - if (name.matches("^[A-Z0-9_]*$")) { - return name; - } - - if (startsWithTwoUppercaseLetters(name)) { - name = name.substring(0, 2).toLowerCase(Locale.ROOT) + name.substring(2); - } - - // If name contains special chars -> replace them. - if ((((CharSequence) name).chars().anyMatch(character -> specialCharReplacements.containsKey(String.valueOf((char) character))))) { - List allowedCharacters = new ArrayList<>(); - allowedCharacters.add("_"); - allowedCharacters.add("$"); - name = escape(name, specialCharReplacements, allowedCharacters, "_"); - } - - // camelize (lower first character) the variable name - // pet_id => petId - name = camelize(name, true); - - // for reserved word or word starting with number, append _ - if (isReservedWord(name) || name.matches("^\\d.*")) { - name = escapeReservedWord(name); - } - - return name; - } - - private boolean startsWithTwoUppercaseLetters(String name) { - boolean startsWithTwoUppercaseLetters = false; - if (name.length() > 1) { - startsWithTwoUppercaseLetters = name.substring(0, 2).equals(name.substring(0, 2).toUpperCase(Locale.ROOT)); - } - return startsWithTwoUppercaseLetters; - } - - @Override - public String toParamName(String name) { - // to avoid conflicts with 'callback' parameter for async call - if ("callback".equals(name)) { - return "paramCallback"; - } - - // should be the same as variable name - return toVarName(name); - } - - @Override - public String toModelName(final String name) { - // We need to check if schema-mapping has a different model for this class, so we use it - // instead of the auto-generated one. - if (schemaMapping.containsKey(name)) { - return schemaMapping.get(name); - } - - // memoization - String origName = name; - if (schemaKeyToModelNameCache.containsKey(origName)) { - return schemaKeyToModelNameCache.get(origName); - } - - final String sanitizedName = sanitizeName(name); - - String nameWithPrefixSuffix = sanitizedName; - if (!StringUtils.isEmpty(modelNamePrefix)) { - // add '_' so that model name can be camelized correctly - nameWithPrefixSuffix = modelNamePrefix + "_" + nameWithPrefixSuffix; - } - - if (!StringUtils.isEmpty(modelNameSuffix)) { - // add '_' so that model name can be camelized correctly - nameWithPrefixSuffix = nameWithPrefixSuffix + "_" + modelNameSuffix; - } - - // camelize the model name - // phone_number => PhoneNumber - final String camelizedName = camelize(nameWithPrefixSuffix); - - // model name cannot use reserved keyword, e.g. return - if (isReservedWord(camelizedName)) { - final String modelName = "Model" + camelizedName; - schemaKeyToModelNameCache.put(origName, modelName); - LOGGER.warn("{} (reserved word) cannot be used as model name. Renamed to {}", camelizedName, modelName); - return modelName; - } - - // model name starts with number - if (camelizedName.matches("^\\d.*")) { - final String modelName = "Model" + camelizedName; // e.g. 200Response => Model200Response (after camelize) - schemaKeyToModelNameCache.put(origName, modelName); - LOGGER.warn("{} (model name starts with number) cannot be used as model name. Renamed to {}", name, - modelName); - return modelName; - } - - schemaKeyToModelNameCache.put(origName, camelizedName); - - return camelizedName; - } - - @Override - public String toModelFilename(String name) { - // should be the same as the model name - return toModelName(name); - } - - @Override - public String getTypeDeclaration(Schema p) { - Schema schema = unaliasSchema(p); - Schema target = ModelUtils.isGenerateAliasAsModel() ? p : schema; - if (ModelUtils.isArraySchema(target)) { - Schema items = getSchemaItems((ArraySchema) schema); - return getSchemaType(target) + "<" + getTypeDeclaration(items) + ">"; - } else if (ModelUtils.isMapSchema(target)) { - // Note: ModelUtils.isMapSchema(p) returns true when p is a composed schema that also defines - // additionalproperties: true - Schema inner = getAdditionalProperties(target); - if (inner == null) { - LOGGER.error("`{}` (map property) does not have a proper inner type defined. Default to type:string", p.getName()); - inner = new StringSchema().description("TODO default missing map inner type to string"); - p.setAdditionalProperties(inner); - } - return getSchemaType(target) + ""; - } - return super.getTypeDeclaration(target); - } - - @Override - public String getAlias(String name) { - if (typeAliases != null && typeAliases.containsKey(name)) { - return typeAliases.get(name); - } - return name; - } - - @Override - public String toDefaultValue(Schema schema) { - schema = ModelUtils.getReferencedSchema(this.openAPI, schema); - if (ModelUtils.isArraySchema(schema)) { - final String pattern; - if (ModelUtils.isSet(schema)) { - String mapInstantiationType = instantiationTypes().getOrDefault("set", "LinkedHashSet"); - pattern = "new " + mapInstantiationType + "<%s>()"; - } else { - String arrInstantiationType = instantiationTypes().getOrDefault("array", "ArrayList"); - pattern = "new " + arrInstantiationType + "<%s>()"; - } - - return String.format(Locale.ROOT, pattern, ""); - } else if (ModelUtils.isMapSchema(schema) && !(schema instanceof ComposedSchema)) { - if (schema.getProperties() != null && schema.getProperties().size() > 0) { - // object is complex object with free-form additional properties - if (schema.getDefault() != null) { - return super.toDefaultValue(schema); - } - return null; - } - - String mapInstantiationType = instantiationTypes().getOrDefault("map", "HashMap"); - final String pattern = "new " + mapInstantiationType + "<%s>()"; - - if (getAdditionalProperties(schema) == null) { - return null; - } - - return String.format(Locale.ROOT, pattern, ""); - } else if (ModelUtils.isIntegerSchema(schema)) { - if (schema.getDefault() != null) { - if (SchemaTypeUtil.INTEGER64_FORMAT.equals(schema.getFormat())) { - return schema.getDefault().toString() + "l"; - } else { - return schema.getDefault().toString(); - } - } - return null; - } else if (ModelUtils.isNumberSchema(schema)) { - if (schema.getDefault() != null) { - if (SchemaTypeUtil.FLOAT_FORMAT.equals(schema.getFormat())) { - return schema.getDefault().toString() + "f"; - } else if (SchemaTypeUtil.DOUBLE_FORMAT.equals(schema.getFormat())) { - return schema.getDefault().toString() + "d"; - } else { - return "new BigDecimal(\"" + schema.getDefault().toString() + "\")"; - } - } - return null; - } else if (ModelUtils.isBooleanSchema(schema)) { - if (schema.getDefault() != null) { - return schema.getDefault().toString(); - } - return null; - } else if (ModelUtils.isURISchema(schema)) { - if (schema.getDefault() != null) { - return "URI.create(\"" + escapeText((String) schema.getDefault()) + "\")"; - } - return null; - } else if (ModelUtils.isStringSchema(schema)) { - if (schema.getDefault() != null) { - String _default; - if (schema.getDefault() instanceof Date) { - if ("java8".equals(getDateLibrary())) { - Date date = (Date) schema.getDefault(); - LocalDate localDate = date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); - return String.format(Locale.ROOT, "LocalDate.parse(\"%s\")", localDate.toString()); - } else { - return null; - } - } else if (schema.getDefault() instanceof java.time.OffsetDateTime) { - if ("java8".equals(getDateLibrary())) { - return String.format(Locale.ROOT, "OffsetDateTime.parse(\"%s\", %s)", - ((java.time.OffsetDateTime) schema.getDefault()).atZoneSameInstant(ZoneId.systemDefault()), - "java.time.format.DateTimeFormatter.ISO_ZONED_DATE_TIME.withZone(java.time.ZoneId.systemDefault())"); - } else { - return null; - } - } else { - _default = (String) schema.getDefault(); - } - - if (schema.getEnum() == null) { - return "\"" + escapeText(_default) + "\""; - } else { - // convert to enum var name later in postProcessModels - return _default; - } - } - return null; - } else if (ModelUtils.isObjectSchema(schema)) { - if (schema.getDefault() != null) { - return super.toDefaultValue(schema); - } - return null; - } else if (ModelUtils.isComposedSchema(schema)) { - if (schema.getDefault() != null) { - return super.toDefaultValue(schema); - } - return null; - } - - return super.toDefaultValue(schema); - } - - @Override - public String toDefaultParameterValue(final Schema schema) { - Object defaultValue = schema.get$ref() != null ? ModelUtils.getReferencedSchema(openAPI, schema).getDefault() : schema.getDefault(); - if (defaultValue == null) { - return null; - } - if (defaultValue instanceof Date) { - Date date = (Date) schema.getDefault(); - LocalDate localDate = date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); - return localDate.toString(); - } - if (ModelUtils.isArraySchema(schema)) { - if (defaultValue instanceof ArrayNode) { - ArrayNode array = (ArrayNode) defaultValue; - return StreamSupport.stream(array.spliterator(), false) - .map(JsonNode::toString) - // remove wrapper quotes - .map(item -> StringUtils.removeStart(item, "\"")) - .map(item -> StringUtils.removeEnd(item, "\"")) - .collect(Collectors.joining(",")); - } - } - // escape quotes - return defaultValue.toString().replace("\"", "\\\""); - } - - /** - * Return the example value of the parameter. Overrides the - * setParameterExampleValue(CodegenParameter, Parameter) method in - * DefaultCodegen to always call setParameterExampleValue(CodegenParameter) - * in this class, which adds single quotes around strings from the - * x-example property. - * - * @param codegenParameter Codegen parameter - * @param parameter Parameter - */ - @Override - public void setParameterExampleValue(CodegenParameter codegenParameter, Parameter parameter) { - if (parameter.getExample() != null) { - codegenParameter.example = parameter.getExample().toString(); - } - - if (parameter.getExamples() != null && !parameter.getExamples().isEmpty()) { - Example example = parameter.getExamples().values().iterator().next(); - if (example.getValue() != null) { - codegenParameter.example = example.getValue().toString(); - } - } - - Schema schema = parameter.getSchema(); - if (schema != null && schema.getExample() != null) { - codegenParameter.example = schema.getExample().toString(); - } - - setParameterExampleValue(codegenParameter); - } - - /** - * Return the example value of the parameter. Overrides the parent method in DefaultCodegen - * to not set examples on complex models, as they don't compile properly. - * - * @param codegenParameter Codegen parameter - * @param requestBody Request body - */ - @Override - public void setParameterExampleValue(CodegenParameter codegenParameter, RequestBody requestBody) { - boolean isModel = (codegenParameter.isModel || (codegenParameter.isContainer && codegenParameter.getItems().isModel)); - - Content content = requestBody.getContent(); - - if (content.size() > 1) { - // @see ModelUtils.getSchemaFromContent() - LOGGER.warn("Multiple MediaTypes found, using only the first one"); - } - - MediaType mediaType = content.values().iterator().next(); - if (mediaType.getExample() != null) { - if (isModel) { - LOGGER.warn("Ignoring complex example on request body"); - } else { - codegenParameter.example = mediaType.getExample().toString(); - return; - } - } - - if (mediaType.getExamples() != null && !mediaType.getExamples().isEmpty()) { - Example example = mediaType.getExamples().values().iterator().next(); - if (example.getValue() != null) { - if (isModel) { - LOGGER.warn("Ignoring complex example on request body"); - } else { - codegenParameter.example = example.getValue().toString(); - return; - } - } - } - - setParameterExampleValue(codegenParameter); - } - - @Override - public void setParameterExampleValue(CodegenParameter p) { - String example; - - boolean hasAllowableValues = p.allowableValues != null && !p.allowableValues.isEmpty(); - if (hasAllowableValues) { - //support examples for inline enums - final List values = (List) p.allowableValues.get("values"); - example = String.valueOf(values.get(0)); - } else if (p.defaultValue == null) { - example = p.example; - } else { - example = p.defaultValue; - } - - String type = p.baseType; - if (type == null) { - type = p.dataType; - } - - if ("String".equals(type)) { - if (example == null) { - example = p.paramName + "_example"; - } - example = "\"" + escapeText(example) + "\""; - } else if ("Integer".equals(type) || "Short".equals(type)) { - if (example == null) { - example = "56"; - } - } else if ("Long".equals(type)) { - if (example == null) { - example = "56"; - } - example = StringUtils.appendIfMissingIgnoreCase(example, "L"); - } else if ("Float".equals(type)) { - if (example == null) { - example = "3.4"; - } - example = StringUtils.appendIfMissingIgnoreCase(example, "F"); - } else if ("Double".equals(type)) { - if (example == null) { - example = "3.4"; - } - example = StringUtils.appendIfMissingIgnoreCase(example, "D"); - } else if ("Boolean".equals(type)) { - if (example == null) { - example = "true"; - } - } else if ("File".equals(type)) { - if (example == null) { - example = "/path/to/file"; - } - example = "new File(\"" + escapeText(example) + "\")"; - } else if ("Date".equals(type)) { - example = "new Date()"; - } else if ("LocalDate".equals(type)) { - if (example == null) { - example = "LocalDate.now()"; - } else { - example = "LocalDate.parse(\"" + example + "\")"; - } - } else if ("OffsetDateTime".equals(type)) { - if (example == null) { - example = "OffsetDateTime.now()"; - } else { - example = "OffsetDateTime.parse(\"" + example + "\")"; - } - } else if ("BigDecimal".equals(type)) { - if (example == null) { - example = "new BigDecimal(78)"; - } else { - example = "new BigDecimal(\"" + example + "\")"; - } - } else if ("UUID".equals(type)) { - if (example == null) { - example = "UUID.randomUUID()"; - } else { - example = "UUID.fromString(\"" + example + "\")"; - } - } else if (hasAllowableValues) { - //parameter is enum defined as a schema component - example = type + ".fromValue(\"" + example + "\")"; - } else if (!languageSpecificPrimitives.contains(type)) { - // type is a model class, e.g. User - example = "new " + type + "()"; - } - - if (example == null) { - example = "null"; - } else if (Boolean.TRUE.equals(p.isArray)) { - - if (p.items.defaultValue != null) { - String innerExample; - if ("String".equals(p.items.dataType)) { - innerExample = "\"" + p.items.defaultValue + "\""; - } else { - innerExample = p.items.defaultValue; - } - example = "Arrays.asList(" + innerExample + ")"; - } else { - example = "Arrays.asList()"; - } - } else if (Boolean.TRUE.equals(p.isMap)) { - example = "new HashMap()"; - } - - p.example = example; - } - - @Override - public String toExampleValue(Schema p) { - if (p.getExample() != null) { - return escapeText(p.getExample().toString()); - } else { - return null; - } - } - - @Override - public String getSchemaType(Schema p) { - String openAPIType = super.getSchemaType(p); - - // don't apply renaming on types from the typeMapping - if (typeMapping.containsKey(openAPIType)) { - return typeMapping.get(openAPIType); - } - - if (null == openAPIType) { - LOGGER.error("No Type defined for Schema {}", p); - } - return toModelName(openAPIType); - } - - @Override - public String toOperationId(String operationId) { - // throw exception if method name is empty - if (StringUtils.isEmpty(operationId)) { - throw new RuntimeException("Empty method/operation name (operationId) not allowed"); - } - - operationId = camelize(sanitizeName(operationId), true); - - // method name cannot use reserved keyword, e.g. return - if (isReservedWord(operationId)) { - String newOperationId = camelize("call_" + operationId, true); - LOGGER.warn("{} (reserved word) cannot be used as method name. Renamed to {}", operationId, newOperationId); - return newOperationId; - } - - // operationId starts with a number - if (operationId.matches("^\\d.*")) { - LOGGER.warn(operationId + " (starting with a number) cannot be used as method name. Renamed to " + camelize("call_" + operationId), true); - operationId = camelize("call_" + operationId, true); - } - - return operationId; - } - - @Override - public CodegenModel fromModel(String name, Schema model) { - Map allDefinitions = ModelUtils.getSchemas(this.openAPI); - CodegenModel codegenModel = super.fromModel(name, model); - if (codegenModel.description != null) { - codegenModel.imports.add("ApiModel"); - } - if (codegenModel.discriminator != null && additionalProperties.containsKey(JACKSON)) { - codegenModel.imports.add("JsonSubTypes"); - codegenModel.imports.add("JsonTypeInfo"); - codegenModel.imports.add("JsonIgnoreProperties"); - } - if (allDefinitions != null && codegenModel.parentSchema != null && codegenModel.hasEnums) { - final Schema parentModel = allDefinitions.get(codegenModel.parentSchema); - final CodegenModel parentCodegenModel = super.fromModel(codegenModel.parent, parentModel); - codegenModel = AbstractJavaCodegen.reconcileInlineEnums(codegenModel, parentCodegenModel); - } - if ("BigDecimal".equals(codegenModel.dataType)) { - codegenModel.imports.add("BigDecimal"); - } - return codegenModel; - } - - @Override - public void postProcessModelProperty(CodegenModel model, CodegenProperty property) { - if (model.getIsClassnameSanitized() && additionalProperties.containsKey(JACKSON)) { - model.imports.add("JsonTypeName"); - } - - if (serializeBigDecimalAsString) { - if ("decimal".equals(property.baseType)) { - // we serialize BigDecimal as `string` to avoid precision loss - property.vendorExtensions.put("x-extra-annotation", "@JsonSerialize(using = ToStringSerializer.class)"); - - // this requires some more imports to be added for this model... - model.imports.add("ToStringSerializer"); - model.imports.add("JsonSerialize"); - } - } - - if (!fullJavaUtil) { - if ("array".equals(property.containerType)) { - model.imports.add("ArrayList"); - } else if ("set".equals(property.containerType)) { - model.imports.add("LinkedHashSet"); - boolean canNotBeWrappedToNullable = !openApiNullable || !property.isNullable; - if (canNotBeWrappedToNullable) { - model.imports.add("JsonDeserialize"); - property.vendorExtensions.put("x-setter-extra-annotation", "@JsonDeserialize(as = LinkedHashSet.class)"); - } - } else if ("map".equals(property.containerType)) { - model.imports.add("HashMap"); - } - } - - if (!BooleanUtils.toBoolean(model.isEnum)) { - // needed by all pojos, but not enums - model.imports.add("ApiModelProperty"); - model.imports.add("ApiModel"); - } - - if (openApiNullable) { - if (Boolean.FALSE.equals(property.required) && Boolean.TRUE.equals(property.isNullable)) { - model.imports.add("JsonNullable"); - model.getVendorExtensions().put("x-jackson-optional-nullable-helpers", true); - } - } - - if (property.isReadOnly) { - model.getVendorExtensions().put("x-has-readonly-properties", true); - } - - // if data type happens to be the same as the property name and both are upper case - if (property.dataType != null && property.dataType.equals(property.name) && property.dataType.toUpperCase(Locale.ROOT).equals(property.name)) { - property.name = property.name.toLowerCase(Locale.ROOT); - } - } - - @Override - public ModelsMap postProcessModels(ModelsMap objs) { - // recursively add import for mapping one type to multiple imports - List> recursiveImports = objs.getImports(); - if (recursiveImports == null) - return objs; - - ListIterator> listIterator = recursiveImports.listIterator(); - while (listIterator.hasNext()) { - String _import = listIterator.next().get("import"); - // if the import package happens to be found in the importMapping (key) - // add the corresponding import package to the list - if (importMapping.containsKey(_import)) { - Map newImportMap = new HashMap<>(); - newImportMap.put("import", importMapping.get(_import)); - listIterator.add(newImportMap); - } - } - - // add x-implements for serializable to all models - for (ModelMap mo : objs.getModels()) { - CodegenModel cm = mo.getModel(); - if (this.serializableModel) { - cm.getVendorExtensions().putIfAbsent("x-implements", new ArrayList()); - ((ArrayList) cm.getVendorExtensions().get("x-implements")).add("Serializable"); - } - } - - return postProcessModelsEnum(objs); - } - - @Override - public OperationsMap postProcessOperationsWithModels(OperationsMap objs, List allModels) { - // Remove imports of List, ArrayList, Map and HashMap as they are - // imported in the template already. - List> imports = objs.getImports(); - Pattern pattern = Pattern.compile("java\\.util\\.(List|ArrayList|Map|HashMap)"); - for (Iterator> itr = imports.iterator(); itr.hasNext(); ) { - String itrImport = itr.next().get("import"); - if (pattern.matcher(itrImport).matches()) { - itr.remove(); - } - } - - OperationMap operations = objs.getOperations(); - List operationList = operations.getOperation(); - for (CodegenOperation op : operationList) { - Collection operationImports = new ConcurrentSkipListSet<>(); - for (CodegenParameter p : op.allParams) { - if (importMapping.containsKey(p.dataType)) { - operationImports.add(importMapping.get(p.dataType)); - } - } - op.vendorExtensions.put("x-java-import", operationImports); - - handleImplicitHeaders(op); - } - return objs; - } - - @Override - public void preprocessOpenAPI(OpenAPI openAPI) { - super.preprocessOpenAPI(openAPI); - if (openAPI == null) { - return; - } - if (openAPI.getPaths() != null) { - for (Map.Entry openAPIGetPathsEntry : openAPI.getPaths().entrySet()) { - String pathname = openAPIGetPathsEntry.getKey(); - PathItem path = openAPIGetPathsEntry.getValue(); - if (path.readOperations() == null) { - continue; - } - for (Operation operation : path.readOperations()) { - LOGGER.info("Processing operation {}", operation.getOperationId()); - if (hasBodyParameter(openAPI, operation) || hasFormParameter(openAPI, operation)) { - String defaultContentType = hasFormParameter(openAPI, operation) ? "application/x-www-form-urlencoded" : "application/json"; - List consumes = new ArrayList<>(getConsumesInfo(openAPI, operation)); - String contentType = consumes.isEmpty() ? defaultContentType : consumes.get(0); - operation.addExtension("x-content-type", contentType); - } - String accepts = getAccept(openAPI, operation); - operation.addExtension("x-accepts", accepts); - } - } - } - - // TODO: Setting additionalProperties is not the responsibility of this method. These side-effects should be moved elsewhere to prevent unexpected behaviors. - if (artifactVersion == null) { - // If no artifactVersion is provided in additional properties, version from API specification is used. - // If none of them is provided then fallbacks to default version - if (additionalProperties.containsKey(CodegenConstants.ARTIFACT_VERSION) && additionalProperties.get(CodegenConstants.ARTIFACT_VERSION) != null) { - this.setArtifactVersion((String) additionalProperties.get(CodegenConstants.ARTIFACT_VERSION)); - } else if (openAPI.getInfo() != null && openAPI.getInfo().getVersion() != null) { - this.setArtifactVersion(openAPI.getInfo().getVersion()); - } else { - this.setArtifactVersion(ARTIFACT_VERSION_DEFAULT_VALUE); - } - } - additionalProperties.put(CodegenConstants.ARTIFACT_VERSION, artifactVersion); - - if (additionalProperties.containsKey(CodegenConstants.SNAPSHOT_VERSION)) { - if (convertPropertyToBooleanAndWriteBack(CodegenConstants.SNAPSHOT_VERSION)) { - this.setArtifactVersion(this.buildSnapshotVersion(this.getArtifactVersion())); - } - } - additionalProperties.put(CodegenConstants.ARTIFACT_VERSION, artifactVersion); - - if (ignoreAnyOfInEnum) { - // Alter OpenAPI schemas ignore anyOf keyword if it consist of an enum. Example: - // anyOf: - // - type: string - // enum: - // - ENUM_A - // - ENUM_B - Stream.concat( - Stream.of(openAPI.getComponents().getSchemas()), - openAPI.getComponents().getSchemas().values().stream() - .filter(schema -> schema.getProperties() != null) - .map(Schema::getProperties)) - .forEach(schemas -> schemas.replaceAll( - (name, s) -> Stream.of(s) - .filter(schema -> schema instanceof ComposedSchema) - .map(schema -> (ComposedSchema) schema) - .filter(schema -> Objects.nonNull(schema.getAnyOf())) - .flatMap(schema -> schema.getAnyOf().stream()) - .filter(schema -> Objects.nonNull(schema.getEnum())) - .findFirst() - .orElse((Schema) s))); - } - } - - private static String getAccept(OpenAPI openAPI, Operation operation) { - String accepts = null; - String defaultContentType = "application/json"; - Set producesInfo = getProducesInfo(openAPI, operation); - if (producesInfo != null && !producesInfo.isEmpty()) { - ArrayList produces = new ArrayList<>(producesInfo); - StringBuilder sb = new StringBuilder(); - for (String produce : produces) { - if (defaultContentType.equalsIgnoreCase(produce)) { - accepts = defaultContentType; - break; - } else { - if (sb.length() > 0) { - sb.append(","); - } - sb.append(produce); - } - } - if (accepts == null) { - accepts = sb.toString(); - } - } else { - accepts = defaultContentType; - } - - return accepts; - } - - @Override - protected boolean needToImport(String type) { - return super.needToImport(type) && !type.contains("."); - } - - @Override - public String toEnumName(CodegenProperty property) { - return sanitizeName(camelize(property.name)) + "Enum"; - } - - @Override - public String toEnumVarName(String value, String datatype) { - if (value.length() == 0) { - return "EMPTY"; - } - - // for symbol, e.g. $, # - if (getSymbolName(value) != null) { - return getSymbolName(value).toUpperCase(Locale.ROOT); - } - - if (" ".equals(value)) { - return "SPACE"; - } - - // number - if ("Integer".equals(datatype) || "Long".equals(datatype) || - "Float".equals(datatype) || "Double".equals(datatype) || "BigDecimal".equals(datatype)) { - String varName = "NUMBER_" + value; - varName = varName.replaceAll("-", "MINUS_"); - varName = varName.replaceAll("\\+", "PLUS_"); - varName = varName.replaceAll("\\.", "_DOT_"); - return varName; - } - - // string - String var = value.replaceAll("\\W+", "_").toUpperCase(Locale.ROOT); - if (var.matches("\\d.*")) { - return "_" + var; - } else { - return var; - } - } - - @Override - public String toEnumValue(String value, String datatype) { - if ("Integer".equals(datatype) || "Double".equals(datatype)) { - return value; - } else if ("Long".equals(datatype)) { - // add l to number, e.g. 2048 => 2048l - return value + "l"; - } else if ("Float".equals(datatype)) { - // add f to number, e.g. 3.14 => 3.14f - return value + "f"; - } else if ("BigDecimal".equals(datatype)) { - // use BigDecimal String constructor - return "new BigDecimal(\"" + value + "\")"; - } else { - return "\"" + escapeText(value) + "\""; - } - } - - @Override - public CodegenOperation fromOperation(String path, String httpMethod, Operation operation, List servers) { - CodegenOperation op = super.fromOperation(path, httpMethod, operation, servers); - op.path = sanitizePath(op.path); - return op; - } - - private static CodegenModel reconcileInlineEnums(CodegenModel codegenModel, CodegenModel parentCodegenModel) { - // This generator uses inline classes to define enums, which breaks when - // dealing with models that have subTypes. To clean this up, we will analyze - // the parent and child models, look for enums that match, and remove - // them from the child models and leave them in the parent. - // Because the child models extend the parents, the enums will be available via the parent. - - // Only bother with reconciliation if the parent model has enums. - if (!parentCodegenModel.hasEnums) { - return codegenModel; - } - - // Get the properties for the parent and child models - final List parentModelCodegenProperties = parentCodegenModel.vars; - List codegenProperties = codegenModel.vars; - - // Iterate over all of the parent model properties - boolean removedChildEnum = false; - for (CodegenProperty parentModelCodegenProperty : parentModelCodegenProperties) { - // Look for enums - if (parentModelCodegenProperty.isEnum) { - // Now that we have found an enum in the parent class, - // and search the child class for the same enum. - Iterator iterator = codegenProperties.iterator(); - while (iterator.hasNext()) { - CodegenProperty codegenProperty = iterator.next(); - if (codegenProperty.isEnum && codegenProperty.equals(parentModelCodegenProperty)) { - // We found an enum in the child class that is - // a duplicate of the one in the parent, so remove it. - iterator.remove(); - removedChildEnum = true; - } - } - } - } - - if (removedChildEnum) { - codegenModel.vars = codegenProperties; - } - return codegenModel; - } - - private static String sanitizePackageName(String packageName) { - packageName = packageName.trim(); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'. - packageName = packageName.replaceAll("[^a-zA-Z0-9_\\.]", "_"); - if (Strings.isNullOrEmpty(packageName)) { - return "invalidPackageName"; - } - return packageName; - } - - public String getInvokerPackage() { - return invokerPackage; - } - - public void setInvokerPackage(String invokerPackage) { - this.invokerPackage = invokerPackage; - } - - public String getGroupId() { - return groupId; - } - - public void setGroupId(String groupId) { - this.groupId = groupId; - } - - public String getArtifactId() { - return artifactId; - } - - public void setArtifactId(String artifactId) { - this.artifactId = artifactId; - } - - public String getArtifactVersion() { - return artifactVersion; - } - - public void setArtifactVersion(String artifactVersion) { - this.artifactVersion = artifactVersion; - } - - public String getArtifactUrl() { - return artifactUrl; - } - - public void setArtifactUrl(String artifactUrl) { - this.artifactUrl = artifactUrl; - } - - public String getArtifactDescription() { - return artifactDescription; - } - - public void setArtifactDescription(String artifactDescription) { - this.artifactDescription = artifactDescription; - } - - public String getScmConnection() { - return scmConnection; - } - - public void setScmConnection(String scmConnection) { - this.scmConnection = scmConnection; - } - - public String getScmDeveloperConnection() { - return scmDeveloperConnection; - } - - public void setScmDeveloperConnection(String scmDeveloperConnection) { - this.scmDeveloperConnection = scmDeveloperConnection; - } - - public String getScmUrl() { - return scmUrl; - } - - public void setScmUrl(String scmUrl) { - this.scmUrl = scmUrl; - } - - public String getDeveloperName() { - return developerName; - } - - public void setDeveloperName(String developerName) { - this.developerName = developerName; - } - - public String getDeveloperEmail() { - return developerEmail; - } - - public void setDeveloperEmail(String developerEmail) { - this.developerEmail = developerEmail; - } - - public String getDeveloperOrganization() { - return developerOrganization; - } - - public void setDeveloperOrganization(String developerOrganization) { - this.developerOrganization = developerOrganization; - } - - public String getDeveloperOrganizationUrl() { - return developerOrganizationUrl; - } - - public void setDeveloperOrganizationUrl(String developerOrganizationUrl) { - this.developerOrganizationUrl = developerOrganizationUrl; - } - - public String getLicenseName() { - return licenseName; - } - - public void setLicenseName(String licenseName) { - this.licenseName = licenseName; - } - - public String getLicenseUrl() { - return licenseUrl; - } - - public void setLicenseUrl(String licenseUrl) { - this.licenseUrl = licenseUrl; - } - - public String getSourceFolder() { - return sourceFolder; - } - - public void setSourceFolder(String sourceFolder) { - this.sourceFolder = sourceFolder; - } - - public String getTestFolder() { - return testFolder; - } - - public void setTestFolder(String testFolder) { - this.testFolder = testFolder; - } - - public void setSerializeBigDecimalAsString(boolean s) { - this.serializeBigDecimalAsString = s; - } - - public Boolean getSerializableModel() { - return serializableModel; - } - - public void setSerializableModel(Boolean serializableModel) { - this.serializableModel = serializableModel; - } - - private String sanitizePath(String p) { - //prefer replace a ", instead of a fuLL URL encode for readability - return p.replaceAll("\"", "%22"); - } - - public void setFullJavaUtil(boolean fullJavaUtil) { - this.fullJavaUtil = fullJavaUtil; - } - - /** - * Set whether discriminator value lookup is case-sensitive or not. - * - * @param discriminatorCaseSensitive true if the discriminator value lookup should be case sensitive. - */ - public void setDiscriminatorCaseSensitive(boolean discriminatorCaseSensitive) { - this.discriminatorCaseSensitive = discriminatorCaseSensitive; - } - - public void setWithXml(boolean withXml) { - this.withXml = withXml; - } - - public String getDateLibrary() { - return dateLibrary; - } - - public void setDateLibrary(String library) { - this.dateLibrary = library; - } - - public void setSupportAsync(boolean enabled) { - this.supportAsync = enabled; - } - - public void setDisableHtmlEscaping(boolean disabled) { - this.disableHtmlEscaping = disabled; - } - - public String getBooleanGetterPrefix() { - return booleanGetterPrefix; - } - - public void setBooleanGetterPrefix(String booleanGetterPrefix) { - this.booleanGetterPrefix = booleanGetterPrefix; - } - - public void setIgnoreAnyOfInEnum(boolean ignoreAnyOfInEnum) { - this.ignoreAnyOfInEnum = ignoreAnyOfInEnum; - } - - public boolean isOpenApiNullable() { - return openApiNullable; - } - - public void setOpenApiNullable(final boolean openApiNullable) { - this.openApiNullable = openApiNullable; - } - - @Override - public void setOutputDir(String dir) { - super.setOutputDir(dir); - if (this.outputTestFolder.isEmpty()) { - setOutputTestFolder(dir); - } - } - - public String getOutputTestFolder() { - if (outputTestFolder.isEmpty()) { - return DEFAULT_TEST_FOLDER; - } - return outputTestFolder; - } - - public void setOutputTestFolder(String outputTestFolder) { - this.outputTestFolder = outputTestFolder; - } - - @Override - public DocumentationProvider getDocumentationProvider() { - return documentationProvider; - } - - @Override - public void setDocumentationProvider(DocumentationProvider documentationProvider) { - this.documentationProvider = documentationProvider; - } - - @Override - public AnnotationLibrary getAnnotationLibrary() { - return annotationLibrary; - } - - @Override - public void setAnnotationLibrary(AnnotationLibrary annotationLibrary) { - this.annotationLibrary = annotationLibrary; - } - - public void setImplicitHeaders(boolean implicitHeaders) { - this.implicitHeaders = implicitHeaders; - } - - public void setImplicitHeadersRegex(String implicitHeadersRegex) { - this.implicitHeadersRegex = implicitHeadersRegex; - } - - @Override - public String escapeQuotationMark(String input) { - // remove " to avoid code injection - return input.replace("\"", ""); - } - - @Override - public String escapeUnsafeCharacters(String input) { - return input.replace("*/", "*_/").replace("/*", "/_*"); - } - - /* - * Derive invoker package name based on the input - * e.g. foo.bar.model => foo.bar - * - * @param input API package/model name - * @return Derived invoker package name based on API package/model name - */ - private String deriveInvokerPackageName(String input) { - String[] parts = input.split(Pattern.quote(".")); // Split on period. - - StringBuilder sb = new StringBuilder(); - String delim = ""; - for (String p : Arrays.copyOf(parts, parts.length - 1)) { - sb.append(delim).append(p); - delim = "."; - } - return sb.toString(); - } - - /** - * Builds a SNAPSHOT version from a given version. - * - * @param version - * @return SNAPSHOT version - */ - private String buildSnapshotVersion(String version) { - if (version.endsWith("-SNAPSHOT")) { - return version; - } - return version + "-SNAPSHOT"; - } - - public void setSupportJava6(boolean value) { - this.supportJava6 = value; - } - - @Override - public String toRegularExpression(String pattern) { - return escapeText(pattern); - } - - /** - * Output the Getter name for boolean property, e.g. isActive - * - * @param name the name of the property - * @return getter name based on naming convention - */ - @Override - public String toBooleanGetter(String name) { - return booleanGetterPrefix + getterAndSetterCapitalize(name); - } - - @Override - public String sanitizeTag(String tag) { - tag = camelize(underscore(sanitizeName(tag))); - - // tag starts with numbers - if (tag.matches("^\\d.*")) { - tag = "Class" + tag; - } - return tag; - } - - /** - * Camelize the method name of the getter and setter - * - * @param name string to be camelized - * @return Camelized string - */ - @Override - public String getterAndSetterCapitalize(String name) { - boolean lowercaseFirstLetter = false; - if (name == null || name.length() == 0) { - return name; - } - name = toVarName(name); - // - // Let the property name capitalized - // except when the first letter of the property name is lowercase and the second letter is uppercase - // Refer to section 8.8: Capitalization of inferred names of the JavaBeans API specification - // http://download.oracle.com/otn-pub/jcp/7224-javabeans-1.01-fr-spec-oth-JSpec/beans.101.pdf) - // - if (name.length() > 1 && Character.isLowerCase(name.charAt(0)) && Character.isUpperCase(name.charAt(1))) { - lowercaseFirstLetter = true; - } - return camelize(name, lowercaseFirstLetter); - } - - @Override - public void postProcessFile(File file, String fileType) { - if (file == null) { - return; - } - - String javaPostProcessFile = System.getenv("JAVA_POST_PROCESS_FILE"); - if (StringUtils.isEmpty(javaPostProcessFile)) { - return; // skip if JAVA_POST_PROCESS_FILE env variable is not defined - } - - // only process files with java extension - if ("java".equals(FilenameUtils.getExtension(file.toString()))) { - String command = javaPostProcessFile + " " + file; - try { - Process p = Runtime.getRuntime().exec(command); - p.waitFor(); - int exitValue = p.exitValue(); - if (exitValue != 0) { - LOGGER.error("Error running the command ({}). Exit value: {}", command, exitValue); - } else { - LOGGER.info("Successfully executed: {}", command); - } - } catch (InterruptedException | IOException e) { - LOGGER.error("Error running the command ({}). Exception: {}", command, e.getMessage()); - // Restore interrupted state - Thread.currentThread().interrupt(); - } - } - } - - public void setParentGroupId(final String parentGroupId) { - this.parentGroupId = parentGroupId; - } - - public void setParentArtifactId(final String parentArtifactId) { - this.parentArtifactId = parentArtifactId; - } - - public void setParentVersion(final String parentVersion) { - this.parentVersion = parentVersion; - } - - public void setParentOverridden(final boolean parentOverridden) { - this.parentOverridden = parentOverridden; - } - - public List getAdditionalModelTypeAnnotations() { - return additionalModelTypeAnnotations; - } - - public void setAdditionalModelTypeAnnotations(final List additionalModelTypeAnnotations) { - this.additionalModelTypeAnnotations = additionalModelTypeAnnotations; - } - - public void setAdditionalEnumTypeAnnotations(final List additionalEnumTypeAnnotations) { - this.additionalEnumTypeAnnotations = additionalEnumTypeAnnotations; - } - - @Override - protected void addAdditionPropertiesToCodeGenModel(CodegenModel codegenModel, Schema schema) { - if (!supportsAdditionalPropertiesWithComposedSchema) { - // The additional (undeclared) properties are modeled in Java as a HashMap. - // - // 1. supportsAdditionalPropertiesWithComposedSchema is set to false: - // The generated model class extends from the HashMap. That does not work - // with composed schemas that also use a discriminator because the model class - // is supposed to extend from the generated parent model class. - // 2. supportsAdditionalPropertiesWithComposedSchema is set to true: - // The HashMap is a field. - super.addAdditionPropertiesToCodeGenModel(codegenModel, schema); - } - - // See https://github.com/OpenAPITools/openapi-generator/pull/1729#issuecomment-449937728 - Schema s = getAdditionalProperties(schema); - // 's' may be null if 'additionalProperties: false' in the OpenAPI schema. - if (s != null) { - codegenModel.additionalPropertiesType = getSchemaType(s); - addImport(codegenModel, codegenModel.additionalPropertiesType); - } - } - - /** - * Search for property by {@link CodegenProperty#name} - * @param name - name to search for - * @param properties - list of properties - * @return either found property or {@link Optional#empty()} if nothing has been found - */ - protected Optional findByName(String name, List properties) { - if (properties == null || properties.isEmpty()) { - return Optional.empty(); - } - - return properties.stream() - .filter(p -> p.name.equals(name)) - .findFirst(); - } - - /** - * This method removes all implicit header parameters from the list of parameters - * - * @param operation - operation to be processed - */ - protected void handleImplicitHeaders(CodegenOperation operation) { - if (operation.allParams.isEmpty()) { - return; - } - final ArrayList copy = new ArrayList<>(operation.allParams); - operation.allParams.clear(); - - for (CodegenParameter p : copy) { - if (p.isHeaderParam && (implicitHeaders || shouldBeImplicitHeader(p))) { - operation.implicitHeadersParams.add(p); - operation.headerParams.removeIf(header -> header.baseName.equals(p.baseName)); - LOGGER.info("Update operation [{}]. Remove header [{}] because it's marked to be implicit", operation.operationId, p.baseName); - } else { - operation.allParams.add(p); - } - } - } - - private boolean shouldBeImplicitHeader(CodegenParameter parameter) { - return StringUtils.isNotBlank(implicitHeadersRegex) && parameter.baseName.matches(implicitHeadersRegex); - } - - @Override - public void addImportsToOneOfInterface(List> imports) { - if (additionalProperties.containsKey(JACKSON)) { - for (String i : Arrays.asList("JsonSubTypes", "JsonTypeInfo")) { - Map oneImport = new HashMap<>(); - oneImport.put("import", importMapping.get(i)); - if (!imports.contains(oneImport)) { - imports.add(oneImport); - } - } - } - } - @Override - public List getSupportedVendorExtensions() { - List extensions = super.getSupportedVendorExtensions(); - extensions.add(VendorExtension.X_DISCRIMINATOR_VALUE); - extensions.add(VendorExtension.X_IMPLEMENTS); - extensions.add(VendorExtension.X_SETTER_EXTRA_ANNOTATION); - extensions.add(VendorExtension.X_TAGS); - extensions.add(VendorExtension.X_ACCEPTS); - extensions.add(VendorExtension.X_CONTENT_TYPE); - extensions.add(VendorExtension.X_CLASS_EXTRA_ANNOTATION); - extensions.add(VendorExtension.X_FIELD_EXTRA_ANNOTATION); - return extensions; - } -} diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaJAXRSServerCodegen.java b/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaJAXRSServerCodegen.java deleted file mode 100644 index b2b25af540b..00000000000 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaJAXRSServerCodegen.java +++ /dev/null @@ -1,328 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen.languages; - -import com.google.common.annotations.VisibleForTesting; -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.Operation; -import io.swagger.v3.oas.models.PathItem; -import org.apache.commons.lang3.StringUtils; -import org.openapitools.codegen.*; -import org.openapitools.codegen.languages.features.BeanValidationFeatures; -import org.openapitools.codegen.model.ModelMap; -import org.openapitools.codegen.model.OperationMap; -import org.openapitools.codegen.model.OperationsMap; -import org.openapitools.codegen.utils.URLPathUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.File; -import java.net.URL; -import java.util.*; - -public abstract class AbstractJavaJAXRSServerCodegen extends AbstractJavaCodegen implements BeanValidationFeatures { - public static final String SERVER_PORT = "serverPort"; - public static final String USE_TAGS = "useTags"; - - /** - * Name of the sub-directory in "src/main/resource" where to find the - * Mustache template for the JAX-RS Codegen. - */ - protected static final String JAXRS_TEMPLATE_DIRECTORY_NAME = "JavaJaxRS"; - protected String implFolder = "src/main/java"; - protected String testResourcesFolder = "src/test/resources"; - protected String title = "OpenAPI Server"; - protected String serverPort = "8080"; - - protected boolean useBeanValidation = true; - protected boolean useTags = false; - - private final Logger LOGGER = LoggerFactory.getLogger(AbstractJavaJAXRSServerCodegen.class); - - public AbstractJavaJAXRSServerCodegen() { - super(); - - sourceFolder = "src/gen/java"; - invokerPackage = "org.openapitools.api"; - artifactId = "openapi-jaxrs-server"; - dateLibrary = "legacy"; //TODO: add joda support to all jax-rs - apiPackage = "org.openapitools.api"; - modelPackage = "org.openapitools.model"; - - // clioOptions default redefinition need to be updated - updateOption(CodegenConstants.INVOKER_PACKAGE, this.getInvokerPackage()); - updateOption(CodegenConstants.ARTIFACT_ID, this.getArtifactId()); - updateOption(CodegenConstants.API_PACKAGE, apiPackage); - updateOption(CodegenConstants.MODEL_PACKAGE, modelPackage); - updateOption(DATE_LIBRARY, this.getDateLibrary()); - updateOption(CodegenConstants.SOURCE_FOLDER, this.getSourceFolder()); - - additionalProperties.put("title", title); - // java inflector uses the jackson lib - additionalProperties.put(JACKSON, "true"); - - cliOptions.add(new CliOption(CodegenConstants.IMPL_FOLDER, CodegenConstants.IMPL_FOLDER_DESC).defaultValue(implFolder)); - cliOptions.add(new CliOption("title", "a title describing the application").defaultValue(title)); - cliOptions.add(CliOption.newBoolean(USE_BEANVALIDATION, "Use BeanValidation API annotations",useBeanValidation)); - cliOptions.add(new CliOption(SERVER_PORT, "The port on which the server should be started").defaultValue(serverPort)); - cliOptions.add(CliOption.newBoolean(USE_TAGS, "use tags for creating interface and controller classnames")); - } - - - // =============== - // COMMONS METHODS - // =============== - - @Override - public CodegenType getTag() { - return CodegenType.SERVER; - } - - @Override - public void processOpts() { - super.processOpts(); - - if (additionalProperties.containsKey(CodegenConstants.IMPL_FOLDER)) { - implFolder = (String) additionalProperties.get(CodegenConstants.IMPL_FOLDER); - } - - if (additionalProperties.containsKey(USE_BEANVALIDATION)) { - setUseBeanValidation(convertPropertyToBoolean(USE_BEANVALIDATION)); - } - - if (additionalProperties.containsKey(USE_TAGS)) { - setUseTags(convertPropertyToBoolean(USE_TAGS)); - } - - writePropertyBack(USE_BEANVALIDATION, useBeanValidation); - } - - @Override - public void addOperationToGroup(String tag, String resourcePath, Operation operation, CodegenOperation co, Map> operations) { - final String basePath = StringUtils.substringBefore(StringUtils.removeStart(resourcePath, "/"), "/"); - if (!StringUtils.isEmpty(basePath)) { - co.subresourceOperation = !co.path.isEmpty(); - } - if (useTags) { - super.addOperationToGroup(tag, resourcePath, operation, co, operations); - } else { - co.baseName = basePath; - if (StringUtils.isEmpty(co.baseName) || StringUtils.containsAny(co.baseName, "{", "}")) { - co.baseName = "default"; - } - final List opList = operations.computeIfAbsent(co.baseName, k -> new ArrayList<>()); - opList.add(co); - } - } - - @Override - public void preprocessOpenAPI(OpenAPI openAPI) { - super.preprocessOpenAPI(openAPI); - /* TODO there should be no need for the following logic - if ("/".equals(swagger.getBasePath())) { - swagger.setBasePath(""); - } - */ - - if (!this.additionalProperties.containsKey(SERVER_PORT)) { - URL url = URLPathUtils.getServerURL(openAPI, serverVariableOverrides()); - // 8080 is the default value for a JEE Server: - this.additionalProperties.put(SERVER_PORT, URLPathUtils.getPort(url, serverPort)); - } - - if (openAPI.getPaths() != null) { - for (Map.Entry openAPIGetPathsEntry : openAPI.getPaths().entrySet()) { - String pathname = openAPIGetPathsEntry.getKey(); - PathItem path = openAPIGetPathsEntry.getValue(); - if (path.readOperations() != null) { - for (Operation operation : path.readOperations()) { - if (operation.getTags() != null) { - List> tags = new ArrayList>(); - for (String tag : operation.getTags()) { - Map value = new HashMap(); - value.put("tag", tag); - tags.add(value); - } - if (operation.getTags().size() > 0) { - String tag = operation.getTags().get(0); - operation.setTags(Arrays.asList(tag)); - } - operation.addExtension("x-tags", tags); - } - } - } - } - } - } - - @Override - public OperationsMap postProcessOperationsWithModels(OperationsMap objs, List allModels) { - OperationsMap updatedObjs = jaxrsPostProcessOperations(objs); - OperationMap operations = updatedObjs.getOperations(); - if (operations != null) { - List ops = operations.getOperation(); - for (CodegenOperation co : ops) { - handleImplicitHeaders(co); - } - } - return updatedObjs; - } - - static OperationsMap jaxrsPostProcessOperations(OperationsMap objs) { - OperationMap operations = objs.getOperations(); - String commonPath = null; - if (operations != null) { - List ops = operations.getOperation(); - for (CodegenOperation operation : ops) { - if (operation.hasConsumes == Boolean.TRUE) { - Map firstType = operation.consumes.get(0); - if (firstType != null) { - if ("multipart/form-data".equals(firstType.get("mediaType"))) { - operation.isMultipart = Boolean.TRUE; - } - } - } - - boolean isMultipartPost = false; - List> consumes = operation.consumes; - if (consumes != null) { - for (Map consume : consumes) { - String mt = consume.get("mediaType"); - if (mt != null) { - if (mt.startsWith("multipart/form-data")) { - isMultipartPost = true; - } - } - } - } - - for (CodegenParameter parameter : operation.allParams) { - if (isMultipartPost) { - parameter.vendorExtensions.put("x-multipart", "true"); - } - } - - List responses = operation.responses; - if (responses != null) { - for (CodegenResponse resp : responses) { - if ("0".equals(resp.code)) { - resp.code = "200"; - } - - if (resp.baseType == null) { - resp.dataType = "void"; - resp.baseType = "Void"; - // set vendorExtensions.x-java-is-response-void to true as baseType is set to "Void" - resp.vendorExtensions.put("x-java-is-response-void", true); - } - - if ("array".equals(resp.containerType)) { - resp.containerType = "List"; - } else if ("set".equals(resp.containerType)) { - resp.containerType = "Set"; - } else if ("map".equals(resp.containerType)) { - resp.containerType = "Map"; - } - } - } - - if (operation.returnBaseType == null) { - operation.returnType = "void"; - operation.returnBaseType = "Void"; - // set vendorExtensions.x-java-is-response-void to true as returnBaseType is set to "Void" - operation.vendorExtensions.put("x-java-is-response-void", true); - } - - if ("array".equals(operation.returnContainer)) { - operation.returnContainer = "List"; - } else if ("set".equals(operation.returnContainer)) { - operation.returnContainer = "Set"; - } else if ("map".equals(operation.returnContainer)) { - operation.returnContainer = "Map"; - } - - if (commonPath == null) { - commonPath = operation.path; - } else { - commonPath = getCommonPath(commonPath, operation.path); - } - } - for (CodegenOperation co : ops) { - co.path = StringUtils.removeStart(co.path, commonPath); - co.subresourceOperation = co.path.length() > 1; - } - objs.put("commonPath", "/".equals(commonPath) ? StringUtils.EMPTY : commonPath); - } - return objs; - } - - @Override - public String toApiName(final String name) { - String computed = name; - if (computed.length() > 0) { - computed = sanitizeName(computed); - } - return super.toApiName(computed); - } - - @Override - public String apiFilename(String templateName, String tag) { - String result = super.apiFilename(templateName, tag); - - if (templateName.endsWith("Impl.mustache")) { - int ix = result.lastIndexOf(File.separator); - result = result.substring(0, ix) + "/impl" + result.substring(ix, result.length() - 5) + "ServiceImpl.java"; - result = result.replace(apiFileFolder(), implFileFolder(implFolder)); - } else if (templateName.endsWith("Factory.mustache")) { - int ix = result.lastIndexOf(File.separator); - result = result.substring(0, ix) + "/factories" + result.substring(ix, result.length() - 5) + "ServiceFactory.java"; - result = result.replace(apiFileFolder(), implFileFolder(implFolder)); - } else if (templateName.endsWith("Service.mustache")) { - int ix = result.lastIndexOf('.'); - result = result.substring(0, ix) + "Service.java"; - } - return result; - } - - private static String getCommonPath(String path1, String path2) { - final String[] parts1 = StringUtils.split(path1, "/"); - final String[] parts2 = StringUtils.split(path2, "/"); - StringBuilder builder = new StringBuilder(); - for (int i = 0; i < Math.min(parts1.length, parts2.length); i++) { - if (!parts1[i].equals(parts2[i])) { - break; - } - builder.append("/").append(parts1[i]); - } - return builder.toString(); - } - - private String implFileFolder(String output) { - return outputFolder + "/" + output + "/" + apiPackage().replace('.', '/'); - } - - @Override - public void setUseBeanValidation(boolean useBeanValidation) { - this.useBeanValidation = useBeanValidation; - } - - @VisibleForTesting - public void setUseTags(boolean useTags) { - this.useTags = useTags; - } -} diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java b/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java deleted file mode 100644 index fbcfed48106..00000000000 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java +++ /dev/null @@ -1,1108 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen.languages; - -import com.fasterxml.jackson.databind.node.ArrayNode; -import io.swagger.v3.oas.models.media.ArraySchema; -import io.swagger.v3.oas.models.media.ComposedSchema; -import io.swagger.v3.oas.models.media.Schema; -import io.swagger.v3.oas.models.media.StringSchema; -import org.apache.commons.io.FilenameUtils; -import org.apache.commons.lang3.StringUtils; -import org.openapitools.codegen.*; -import org.openapitools.codegen.model.ModelMap; -import org.openapitools.codegen.model.ModelsMap; -import org.openapitools.codegen.utils.ModelUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.File; -import java.io.IOException; -import java.util.*; -import java.util.function.Function; -import java.util.regex.Pattern; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import static org.openapitools.codegen.utils.StringUtils.*; - -public abstract class AbstractKotlinCodegen extends DefaultCodegen implements CodegenConfig { - - public static final String SERIALIZATION_LIBRARY_DESC = "What serialization library to use: 'moshi' (default), or 'gson' or 'jackson'"; - - public enum SERIALIZATION_LIBRARY_TYPE {moshi, gson, jackson, kotlinx_serialization} - - public static final String MODEL_MUTABLE = "modelMutable"; - public static final String MODEL_MUTABLE_DESC = "Create mutable models"; - - private final Logger LOGGER = LoggerFactory.getLogger(AbstractKotlinCodegen.class); - - protected String artifactId; - protected String artifactVersion = "1.0.0"; - protected String groupId = "org.openapitools"; - protected String packageName = "org.openapitools"; - protected String apiSuffix = "Api"; - - protected String sourceFolder = "src/main/kotlin"; - protected String testFolder = "src/test/kotlin"; - - protected String apiDocPath = "docs/"; - protected String modelDocPath = "docs/"; - protected boolean parcelizeModels = false; - protected boolean serializableModel = false; - protected boolean needsDataClassBody = false; - - protected boolean nonPublicApi = false; - - protected CodegenConstants.ENUM_PROPERTY_NAMING_TYPE enumPropertyNaming = CodegenConstants.ENUM_PROPERTY_NAMING_TYPE.camelCase; - protected SERIALIZATION_LIBRARY_TYPE serializationLibrary = SERIALIZATION_LIBRARY_TYPE.moshi; - - // model classes cannot use the same property names defined in HashMap - // ref: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-hash-map/ - protected Set propertyAdditionalKeywords = new HashSet<>(Arrays.asList("entries", "keys", "size", "values")); - - private Map schemaKeyToModelNameCache = new HashMap<>(); - - public AbstractKotlinCodegen() { - super(); - - supportsInheritance = true; - setSortModelPropertiesByRequiredFlag(true); - - languageSpecificPrimitives = new HashSet<>(Arrays.asList( - "kotlin.Byte", - "kotlin.ByteArray", - "kotlin.Short", - "kotlin.Int", - "kotlin.Long", - "kotlin.Float", - "kotlin.Double", - "kotlin.Boolean", - "kotlin.Char", - "kotlin.String", - "kotlin.Array", - "kotlin.collections.List", - "kotlin.collections.MutableList", - "kotlin.collections.Map", - "kotlin.collections.MutableMap", - "kotlin.collections.Set", - "kotlin.collections.MutableSet" - )); - - // this includes hard reserved words defined by https://github.com/JetBrains/kotlin/blob/master/core/descriptors/src/org/jetbrains/kotlin/renderer/KeywordStringsGenerated.java - // as well as keywords from https://kotlinlang.org/docs/reference/keyword-reference.html - reservedWords = new HashSet<>(Arrays.asList( - "ApiResponse", // Used in the auto-generated api client - "abstract", - "actual", - "annotation", - "as", - "break", - "class", - "companion", - "const", - "constructor", - "continue", - "contract", - "crossinline", - "data", - "delegate", - "do", - "dynamic", - "else", - "enum", - "expect", - "external", - "false", - "field", - "final", - "finally", - "for", - "fun", - "if", - "import", - "in", - "infix", - "init", - "inline", - "inner", - "interface", - "internal", - "is", - "it", - "lateinit", - "noinline", - "null", - "object", - "open", - "operator", - "out", - "override", - "package", - "param", - "private", - "property", - "protected", - "public", - "receiver", - "reified", - "return", - "sealed", - "setparam", - "super", - "suspend", - "tailrec", - "this", - "throw", - "true", - "try", - "typealias", - "typeof", - "val", - "value", - "var", - "vararg", - "when", - "where", - "while" - )); - - defaultIncludes = new HashSet<>(Arrays.asList( - "kotlin.Byte", - "kotlin.ByteArray", - "kotlin.Short", - "kotlin.Int", - "kotlin.Long", - "kotlin.Float", - "kotlin.Double", - "kotlin.Boolean", - "kotlin.Char", - "kotlin.Array", - "kotlin.collections.List", - "kotlin.collections.MutableList", - "kotlin.collections.Set", - "kotlin.collections.MutableSet", - "kotlin.collections.Map", - "kotlin.collections.MutableMap" - )); - - typeMapping = new HashMap<>(); - typeMapping.put("string", "kotlin.String"); - typeMapping.put("boolean", "kotlin.Boolean"); - typeMapping.put("integer", "kotlin.Int"); - typeMapping.put("float", "kotlin.Float"); - typeMapping.put("long", "kotlin.Long"); - typeMapping.put("double", "kotlin.Double"); - typeMapping.put("ByteArray", "kotlin.ByteArray"); - typeMapping.put("number", "java.math.BigDecimal"); - typeMapping.put("decimal", "java.math.BigDecimal"); - typeMapping.put("date-time", "java.time.OffsetDateTime"); - typeMapping.put("date", "java.time.LocalDate"); - typeMapping.put("file", "java.io.File"); - typeMapping.put("array", "kotlin.Array"); - typeMapping.put("list", "kotlin.collections.List"); - typeMapping.put("set", "kotlin.collections.Set"); - typeMapping.put("map", "kotlin.collections.Map"); - typeMapping.put("object", "kotlin.Any"); - typeMapping.put("binary", "kotlin.ByteArray"); - typeMapping.put("Date", "java.time.LocalDate"); - typeMapping.put("DateTime", "java.time.OffsetDateTime"); - typeMapping.put("AnyType", "kotlin.Any"); - - instantiationTypes.put("array", "kotlin.collections.ArrayList"); - instantiationTypes.put("list", "kotlin.collections.ArrayList"); - instantiationTypes.put("map", "kotlin.collections.HashMap"); - - importMapping = new HashMap<>(); - importMapping.put("BigDecimal", "java.math.BigDecimal"); - importMapping.put("UUID", "java.util.UUID"); - importMapping.put("URI", "java.net.URI"); - importMapping.put("File", "java.io.File"); - importMapping.put("Date", "java.time.LocalDate"); - importMapping.put("Timestamp", "java.sql.Timestamp"); - importMapping.put("DateTime", "java.time.OffsetDateTime"); - importMapping.put("LocalDateTime", "java.time.LocalDateTime"); - importMapping.put("LocalDate", "java.time.LocalDate"); - importMapping.put("LocalTime", "java.time.LocalTime"); - - specialCharReplacements.put(";", "Semicolon"); - - cliOptions.clear(); - addOption(CodegenConstants.SOURCE_FOLDER, CodegenConstants.SOURCE_FOLDER_DESC, sourceFolder); - addOption(CodegenConstants.PACKAGE_NAME, "Generated artifact package name.", packageName); - addOption(CodegenConstants.API_SUFFIX, CodegenConstants.API_SUFFIX_DESC, apiSuffix); - addOption(CodegenConstants.GROUP_ID, "Generated artifact package's organization (i.e. maven groupId).", groupId); - addOption(CodegenConstants.ARTIFACT_ID, "Generated artifact id (name of jar).", artifactId); - addOption(CodegenConstants.ARTIFACT_VERSION, "Generated artifact's package version.", artifactVersion); - - CliOption enumPropertyNamingOpt = new CliOption(CodegenConstants.ENUM_PROPERTY_NAMING, CodegenConstants.ENUM_PROPERTY_NAMING_DESC); - cliOptions.add(enumPropertyNamingOpt.defaultValue(enumPropertyNaming.name())); - - CliOption serializationLibraryOpt = new CliOption(CodegenConstants.SERIALIZATION_LIBRARY, SERIALIZATION_LIBRARY_DESC); - cliOptions.add(serializationLibraryOpt.defaultValue(serializationLibrary.name())); - - cliOptions.add(new CliOption(CodegenConstants.PARCELIZE_MODELS, CodegenConstants.PARCELIZE_MODELS_DESC)); - cliOptions.add(new CliOption(CodegenConstants.SERIALIZABLE_MODEL, CodegenConstants.SERIALIZABLE_MODEL_DESC)); - cliOptions.add(new CliOption(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG_DESC)); - cliOptions.add(new CliOption(CodegenConstants.SORT_MODEL_PROPERTIES_BY_REQUIRED_FLAG, CodegenConstants.SORT_MODEL_PROPERTIES_BY_REQUIRED_FLAG_DESC)); - - cliOptions.add(CliOption.newBoolean(MODEL_MUTABLE, MODEL_MUTABLE_DESC, false)); - } - - @Override - public String apiDocFileFolder() { - return (outputFolder + File.separator + apiDocPath).replace('/', File.separatorChar); - } - - @Override - public String apiFileFolder() { - return (outputFolder + File.separator + sourceFolder + File.separator + apiPackage().replace('.', File.separatorChar)).replace('/', File.separatorChar); - } - - @Override - public String apiTestFileFolder() { - return (outputFolder + File.separator + testFolder + File.separator + apiPackage().replace('.', File.separatorChar)).replace('/', File.separatorChar); - } - - @Override - public String escapeQuotationMark(String input) { - // remove " to avoid code injection - return input.replace("\"", ""); - } - - @Override - public String escapeReservedWord(String name) { - // TODO: Allow enum escaping as an option (e.g. backticks vs append/prepend underscore vs match model property escaping). - return String.format(Locale.ROOT, "`%s`", name); - } - - @Override - public String escapeUnsafeCharacters(String input) { - return input.replace("*/", "*_/").replace("/*", "/_*"); - } - - public CodegenConstants.ENUM_PROPERTY_NAMING_TYPE getEnumPropertyNaming() { - return this.enumPropertyNaming; - } - - public SERIALIZATION_LIBRARY_TYPE getSerializationLibrary() { - return this.serializationLibrary; - } - - /** - * Sets the naming convention for Kotlin enum properties - * - * @param enumPropertyNamingType The string representation of the naming convention, as defined by {@link org.openapitools.codegen.CodegenConstants.ENUM_PROPERTY_NAMING_TYPE} - */ - public void setEnumPropertyNaming(final String enumPropertyNamingType) { - try { - this.enumPropertyNaming = CodegenConstants.ENUM_PROPERTY_NAMING_TYPE.valueOf(enumPropertyNamingType); - } catch (IllegalArgumentException ex) { - StringBuilder sb = new StringBuilder(enumPropertyNamingType + " is an invalid enum property naming option. Please choose from:"); - for (CodegenConstants.ENUM_PROPERTY_NAMING_TYPE t : CodegenConstants.ENUM_PROPERTY_NAMING_TYPE.values()) { - sb.append("\n ").append(t.name()); - } - throw new RuntimeException(sb.toString()); - } - } - - /** - * Sets the serialization engine for Kotlin - * - * @param enumSerializationLibrary The string representation of the serialization library as defined by - * {@link org.openapitools.codegen.languages.AbstractKotlinCodegen.SERIALIZATION_LIBRARY_TYPE} - */ - public void setSerializationLibrary(final String enumSerializationLibrary) { - try { - this.serializationLibrary = SERIALIZATION_LIBRARY_TYPE.valueOf(enumSerializationLibrary); - } catch (IllegalArgumentException ex) { - StringBuilder sb = new StringBuilder(enumSerializationLibrary + " is an invalid enum property naming option. Please choose from:"); - for (SERIALIZATION_LIBRARY_TYPE t : SERIALIZATION_LIBRARY_TYPE.values()) { - sb.append("\n ").append(t.name()); - } - throw new RuntimeException(sb.toString()); - } - } - - /** - * returns the OpenAPI type for the property - * - * @param p OpenAPI property object - * @return string presentation of the type - **/ - @Override - public String getSchemaType(Schema p) { - String openAPIType = super.getSchemaType(p); - String type; - // This maps, for example, long -> kotlin.Long based on hashes in this type's constructor - if (typeMapping.containsKey(openAPIType)) { - type = typeMapping.get(openAPIType); - if (languageSpecificPrimitives.contains(type)) { - return toModelName(type); - } - } else { - type = openAPIType; - } - return toModelName(type); - } - - /** - * Output the type declaration of the property - * - * @param p OpenAPI Property object - * @return a string presentation of the property type - */ - @Override - public String getTypeDeclaration(Schema p) { - Schema schema = unaliasSchema(p); - Schema target = ModelUtils.isGenerateAliasAsModel() ? p : schema; - if (ModelUtils.isArraySchema(target)) { - Schema items = getSchemaItems((ArraySchema) schema); - return getSchemaType(target) + "<" + getTypeDeclaration(items) + ">"; - } else if (ModelUtils.isMapSchema(target)) { - // Note: ModelUtils.isMapSchema(p) returns true when p is a composed schema that also defines - // additionalproperties: true - Schema inner = getAdditionalProperties(target); - if (inner == null) { - LOGGER.error("`{}` (map property) does not have a proper inner type defined. Default to type:string", p.getName()); - inner = new StringSchema().description("TODO default missing map inner type to string"); - p.setAdditionalProperties(inner); - } - return getSchemaType(target) + ""; - } - return super.getTypeDeclaration(target); - } - - @Override - public String modelDocFileFolder() { - return (outputFolder + "/" + modelDocPath).replace('/', File.separatorChar); - } - - @Override - public String modelFileFolder() { - return outputFolder + File.separator + sourceFolder + File.separator + modelPackage().replace('.', File.separatorChar); - } - - @Override - public ModelsMap postProcessModels(ModelsMap objs) { - objs = super.postProcessModelsEnum(objs); - for (ModelMap mo : objs.getModels()) { - CodegenModel cm = mo.getModel(); - if (cm.getDiscriminator() != null) { - cm.vendorExtensions.put("x-has-data-class-body", true); - break; - } - - for (CodegenProperty var : cm.vars) { - if (var.isEnum || isSerializableModel()) { - cm.vendorExtensions.put("x-has-data-class-body", true); - break; - } - } - } - return postProcessModelsEnum(objs); - } - - @Override - public void processOpts() { - super.processOpts(); - - if (StringUtils.isEmpty(System.getenv("KOTLIN_POST_PROCESS_FILE"))) { - LOGGER.info("Environment variable KOTLIN_POST_PROCESS_FILE not defined so the Kotlin code may not be properly formatted. To define it, try 'export KOTLIN_POST_PROCESS_FILE=\"/usr/local/bin/ktlint -F\"' (Linux/Mac)"); - LOGGER.info("NOTE: To enable file post-processing, 'enablePostProcessFile' must be set to `true` (--enable-post-process-file for CLI)."); - } - - if (additionalProperties.containsKey(MODEL_MUTABLE)) { - additionalProperties.put(MODEL_MUTABLE, Boolean.parseBoolean(additionalProperties.get(MODEL_MUTABLE).toString())); - } - - if (additionalProperties.containsKey(CodegenConstants.ENUM_PROPERTY_NAMING)) { - setEnumPropertyNaming((String) additionalProperties.get(CodegenConstants.ENUM_PROPERTY_NAMING)); - } - - if (additionalProperties.containsKey(CodegenConstants.SERIALIZATION_LIBRARY)) { - setSerializationLibrary((String) additionalProperties.get(CodegenConstants.SERIALIZATION_LIBRARY)); - additionalProperties.put(this.serializationLibrary.name(), true); - } else { - additionalProperties.put(this.serializationLibrary.name(), true); - } - - if (additionalProperties.containsKey(CodegenConstants.SOURCE_FOLDER)) { - this.setSourceFolder((String) additionalProperties.get(CodegenConstants.SOURCE_FOLDER)); - } else { - additionalProperties.put(CodegenConstants.SOURCE_FOLDER, sourceFolder); - } - - if (additionalProperties.containsKey(CodegenConstants.PACKAGE_NAME)) { - this.setPackageName((String) additionalProperties.get(CodegenConstants.PACKAGE_NAME)); - if (!additionalProperties.containsKey(CodegenConstants.MODEL_PACKAGE)) - this.setModelPackage(packageName + ".models"); - if (!additionalProperties.containsKey(CodegenConstants.API_PACKAGE)) - this.setApiPackage(packageName + ".apis"); - } else { - additionalProperties.put(CodegenConstants.PACKAGE_NAME, packageName); - } - - if (additionalProperties.containsKey(CodegenConstants.API_SUFFIX)) { - this.setApiSuffix((String) additionalProperties.get(CodegenConstants.API_SUFFIX)); - } - - if (additionalProperties.containsKey(CodegenConstants.ARTIFACT_ID)) { - this.setArtifactId((String) additionalProperties.get(CodegenConstants.ARTIFACT_ID)); - } else { - additionalProperties.put(CodegenConstants.ARTIFACT_ID, artifactId); - } - - if (additionalProperties.containsKey(CodegenConstants.GROUP_ID)) { - this.setGroupId((String) additionalProperties.get(CodegenConstants.GROUP_ID)); - } else { - additionalProperties.put(CodegenConstants.GROUP_ID, groupId); - } - - if (additionalProperties.containsKey(CodegenConstants.ARTIFACT_VERSION)) { - this.setArtifactVersion((String) additionalProperties.get(CodegenConstants.ARTIFACT_VERSION)); - } else { - additionalProperties.put(CodegenConstants.ARTIFACT_VERSION, artifactVersion); - } - - if (additionalProperties.containsKey(CodegenConstants.INVOKER_PACKAGE)) { - LOGGER.warn("{} with {} generator is ignored. Use {}.", CodegenConstants.INVOKER_PACKAGE, this.getName(), CodegenConstants.PACKAGE_NAME); - } - - if (additionalProperties.containsKey(CodegenConstants.SERIALIZABLE_MODEL)) { - this.setSerializableModel(convertPropertyToBooleanAndWriteBack(CodegenConstants.SERIALIZABLE_MODEL)); - } else { - additionalProperties.put(CodegenConstants.SERIALIZABLE_MODEL, serializableModel); - } - - if (additionalProperties.containsKey(CodegenConstants.LIBRARY)) { - this.setLibrary((String) additionalProperties.get(CodegenConstants.LIBRARY)); - } - - if (additionalProperties.containsKey(CodegenConstants.PARCELIZE_MODELS)) { - this.setParcelizeModels(convertPropertyToBooleanAndWriteBack(CodegenConstants.PARCELIZE_MODELS)); - } else { - additionalProperties.put(CodegenConstants.PARCELIZE_MODELS, parcelizeModels); - } - - if (additionalProperties.containsKey(CodegenConstants.NON_PUBLIC_API)) { - this.setNonPublicApi(convertPropertyToBooleanAndWriteBack(CodegenConstants.NON_PUBLIC_API)); - } else { - additionalProperties.put(CodegenConstants.NON_PUBLIC_API, nonPublicApi); - } - - additionalProperties.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, getSortParamsByRequiredFlag()); - additionalProperties.put(CodegenConstants.SORT_MODEL_PROPERTIES_BY_REQUIRED_FLAG, getSortModelPropertiesByRequiredFlag()); - - additionalProperties.put(CodegenConstants.API_PACKAGE, apiPackage()); - additionalProperties.put(CodegenConstants.MODEL_PACKAGE, modelPackage()); - - additionalProperties.put("apiDocPath", apiDocPath); - additionalProperties.put("modelDocPath", modelDocPath); - - if (isModelMutable()) { - typeMapping.put("list", "kotlin.collections.MutableList"); - typeMapping.put("set", "kotlin.collections.MutableSet"); - typeMapping.put("map", "kotlin.collections.MutableMap"); - } - } - - protected boolean isModelMutable() { - return Boolean.TRUE.equals(additionalProperties.get(MODEL_MUTABLE)); - } - - public void setArtifactId(String artifactId) { - this.artifactId = artifactId; - } - - public void setArtifactVersion(String artifactVersion) { - this.artifactVersion = artifactVersion; - } - - public void setGroupId(String groupId) { - this.groupId = groupId; - } - - public void setPackageName(String packageName) { - this.packageName = packageName; - } - - public void setApiSuffix(String apiSuffix) { - this.apiSuffix = apiSuffix; - } - - public void setSourceFolder(String sourceFolder) { - this.sourceFolder = sourceFolder; - } - - public void setTestFolder(String testFolder) { - this.testFolder = testFolder; - } - - public Boolean getParcelizeModels() { - return parcelizeModels; - } - - public void setParcelizeModels(Boolean parcelizeModels) { - this.parcelizeModels = parcelizeModels; - } - - public boolean isSerializableModel() { - return serializableModel; - } - - public void setSerializableModel(boolean serializableModel) { - this.serializableModel = serializableModel; - } - - public boolean nonPublicApi() { - return nonPublicApi; - } - - public void setNonPublicApi(boolean nonPublicApi) { - this.nonPublicApi = nonPublicApi; - } - - public boolean isNeedsDataClassBody() { - return needsDataClassBody; - } - - public void setNeedsDataClassBody(boolean needsDataClassBody) { - this.needsDataClassBody = needsDataClassBody; - } - - /** - * Return the sanitized variable name for enum - * - * @param value enum variable name - * @param datatype data type - * @return the sanitized variable name for enum - */ - @Override - public String toEnumVarName(String value, String datatype) { - String modified; - if (value.length() == 0) { - modified = "EMPTY"; - } else { - modified = value; - modified = sanitizeKotlinSpecificNames(modified); - } - - switch (getEnumPropertyNaming()) { - case original: - // NOTE: This is provided as a last-case allowance, but will still result in reserved words being escaped. - modified = value; - break; - case camelCase: - // NOTE: Removes hyphens and underscores - modified = camelize(modified, true); - break; - case PascalCase: - // NOTE: Removes hyphens and underscores - String result = camelize(modified); - modified = titleCase(result); - break; - case snake_case: - // NOTE: Removes hyphens - modified = underscore(modified); - break; - case UPPERCASE: - modified = underscore(modified).toUpperCase(Locale.ROOT); - break; - } - - if (reservedWords.contains(modified)) { - return escapeReservedWord(modified); - } - // NOTE: another sanitize because camelize can create an invalid name - return sanitizeKotlinSpecificNames(modified); - } - - @Override - public String toEnumName(CodegenProperty property) { - return property.nameInCamelCase; - } - - @Override - public String toApiName(String name) { - if (name.length() == 0) { - return "DefaultApi"; - } - return (this.apiSuffix.isEmpty() ? camelize(name) : camelize(name) + this.apiSuffix); - } - - /** - * Return the fully-qualified "Model" name for import - * - * @param name the name of the "Model" - * @return the fully-qualified "Model" name for import - */ - @Override - public String toModelImport(String name) { - // toModelImport is called while processing operations, but DefaultCodegen doesn't - // define imports correctly with fully qualified primitives and models as defined in this generator. - if (needToImport(name)) { - return super.toModelImport(name); - } - - return name; - } - - /** - * Output the proper model name (capitalized). - * In case the name belongs to the TypeSystem it won't be renamed. - * - * @param name the name of the model - * @return capitalized model name - */ - @Override - public String toModelName(final String name) { - // memoization - String origName = name; - if (schemaKeyToModelNameCache.containsKey(origName)) { - return schemaKeyToModelNameCache.get(origName); - } - - // Allow for explicitly configured kotlin.* and java.* types - if (name.startsWith("kotlin.") || name.startsWith("java.")) { - return name; - } - - // If schemaMapping contains name, assume this is a legitimate model name. - if (schemaMapping.containsKey(name)) { - return schemaMapping.get(name); - } - - // TODO review importMapping below as we've added schema mapping support - // If importMapping contains name, assume this is a legitimate model name. - if (importMapping.containsKey(name)) { - return importMapping.get(name); - } - - String modifiedName = name.replaceAll("\\.", ""); - String sanitizedName = sanitizeKotlinSpecificNames(modifiedName); - - String nameWithPrefixSuffix = sanitizedName; - if (!StringUtils.isEmpty(modelNamePrefix)) { - // add '_' so that model name can be camelized correctly - nameWithPrefixSuffix = modelNamePrefix + "_" + nameWithPrefixSuffix; - } - - if (!StringUtils.isEmpty(modelNameSuffix)) { - // add '_' so that model name can be camelized correctly - nameWithPrefixSuffix = nameWithPrefixSuffix + "_" + modelNameSuffix; - } - - // Camelize name of nested properties - modifiedName = camelize(nameWithPrefixSuffix); - - // model name cannot use reserved keyword, e.g. return - if (isReservedWord(modifiedName)) { - final String modelName = "Model" + modifiedName; - LOGGER.warn("{} (reserved word) cannot be used as model name. Renamed to {}", modifiedName, modelName); - return modelName; - } - - // model name starts with number - if (modifiedName.matches("^\\d.*")) { - final String modelName = "Model" + modifiedName; // e.g. 200Response => Model200Response (after camelize) - LOGGER.warn("{} (model name starts with number) cannot be used as model name. Renamed to {}", name, - modelName); - return modelName; - } - - schemaKeyToModelNameCache.put(origName, titleCase(modifiedName)); - return schemaKeyToModelNameCache.get(origName); - } - - /** - * Return the operation ID (method name) - * - * @param operationId operation ID - * @return the sanitized method name - */ - @Override - public String toOperationId(String operationId) { - // throw exception if method name is empty - if (StringUtils.isEmpty(operationId)) - throw new RuntimeException("Empty method/operation name (operationId) not allowed"); - - operationId = camelize(sanitizeName(operationId), true); - - // method name cannot use reserved keyword, e.g. return - if (isReservedWord(operationId)) { - String newOperationId = camelize("call_" + operationId, true); - LOGGER.warn("{} (reserved word) cannot be used as method name. Renamed to {}", operationId, newOperationId); - return newOperationId; - } - - // operationId starts with a number - if (operationId.matches("^\\d.*")) { - LOGGER.warn(operationId + " (starting with a number) cannot be used as method sname. Renamed to " + camelize("call_" + operationId), true); - operationId = camelize("call_" + operationId, true); - } - - return operationId; - } - - @Override - public String toModelFilename(String name) { - // Should be the same as the model name - return toModelName(name); - } - - /** - * Sanitize against Kotlin specific naming conventions, which may differ from those required by {@link DefaultCodegen#sanitizeName}. - * - * @param name string to be sanitize - * @return sanitized string - */ - private String sanitizeKotlinSpecificNames(final String name) { - String word = name; - for (Map.Entry specialCharacters : specialCharReplacements.entrySet()) { - word = replaceSpecialCharacters(word, specialCharacters); - } - - // Fallback, replace unknowns with underscore. - word = Pattern.compile("\\W+", Pattern.UNICODE_CHARACTER_CLASS).matcher(word).replaceAll("_"); - if (word.matches("\\d.*")) { - word = "_" + word; - } - - // _, __, and ___ are reserved in Kotlin. Treat all names with only underscores consistently, regardless of count. - if (word.matches("^_*$")) { - word = word.replaceAll("\\Q_\\E", "Underscore"); - } - - return word; - } - - private String replaceSpecialCharacters(String word, Map.Entry specialCharacters) { - String specialChar = specialCharacters.getKey(); - String replacementChar = specialCharacters.getValue(); - // Underscore is the only special character we'll allow - if (!specialChar.equals("_") && word.contains(specialChar)) { - return replaceCharacters(word, specialChar, replacementChar); - } - return word; - } - - private String replaceCharacters(String word, String oldValue, String newValue) { - if (!word.contains(oldValue)) { - return word; - } - if (word.equals(oldValue)) { - return newValue; - } - int i = word.indexOf(oldValue); - String start = word.substring(0, i); - String end = recurseOnEndOfWord(word, oldValue, newValue, i); - return start + newValue + end; - } - - private String recurseOnEndOfWord(String word, String oldValue, String newValue, int lastReplacedValue) { - String end = word.substring(lastReplacedValue + 1); - if (!end.isEmpty()) { - end = titleCase(end); - end = replaceCharacters(end, oldValue, newValue); - } - return end; - } - - private String titleCase(final String input) { - return input.substring(0, 1).toUpperCase(Locale.ROOT) + input.substring(1); - } - - @Override - protected boolean isReservedWord(String word) { - // We want case-sensitive escaping, to avoid unnecessary backtick-escaping. - return reservedWords.contains(word); - } - - /** - * Check the type to see if it needs import the library/module/package - * - * @param type name of the type - * @return true if the library/module/package of the corresponding type needs to be imported - */ - @Override - protected boolean needToImport(String type) { - // provides extra protection against improperly trying to import language primitives and java types - boolean imports = !type.startsWith("kotlin.") && !type.startsWith("java.") && - !defaultIncludes.contains(type) && !languageSpecificPrimitives.contains(type) && - !type.contains("."); - return imports; - } - - @Override - public CodegenModel fromModel(String name, Schema schema) { - CodegenModel m = super.fromModel(name, schema); - m.optionalVars = m.optionalVars.stream().distinct().collect(Collectors.toList()); - // Update allVars/requiredVars/optionalVars with isInherited - // Each of these lists contains elements that are similar, but they are all cloned - // via CodegenModel.removeAllDuplicatedProperty and therefore need to be updated - // separately. - // First find only the parent vars via baseName matching - Map allVarsMap = m.allVars.stream() - .collect(Collectors.toMap(CodegenProperty::getBaseName, Function.identity())); - allVarsMap.keySet() - .removeAll(m.vars.stream().map(CodegenProperty::getBaseName).collect(Collectors.toSet())); - // Update the allVars - allVarsMap.values().forEach(p -> p.isInherited = true); - // Update any other vars (requiredVars, optionalVars) - Stream.of(m.requiredVars, m.optionalVars) - .flatMap(List::stream) - .filter(p -> allVarsMap.containsKey(p.baseName)) - .forEach(p -> p.isInherited = true); - return m; - } - - @Override - public String toEnumValue(String value, String datatype) { - if ("kotlin.Int".equals(datatype) || "kotlin.Long".equals(datatype)) { - return value; - } else if ("kotlin.Double".equals(datatype)) { - if (value.contains(".")) { - return value; - } else { - return value + ".0"; // Float and double must have .0 - } - } else if ("kotlin.Float".equals(datatype)) { - return value + "f"; - } else { - return "\"" + escapeText(value) + "\""; - } - } - - @Override - public boolean isDataTypeString(final String dataType) { - return "String".equals(dataType) || "kotlin.String".equals(dataType); - } - - @Override - public String toParamName(String name) { - // to avoid conflicts with 'callback' parameter for async call - if ("callback".equals(name)) { - return "paramCallback"; - } - - // should be the same as variable name - return toVariableName(name); - } - - @Override - public String toVarName(String name) { - name = toVariableName(name); - if (propertyAdditionalKeywords.contains(name)) { - return camelize("property_" + name, true); - } else { - return name; - } - } - - protected String toVariableName(String name) { - // sanitize name - name = sanitizeName(name, "\\W-[\\$]"); - name = sanitizeKotlinSpecificNames(name); - - if (name.toLowerCase(Locale.ROOT).matches("^_*class$")) { - return "propertyClass"; - } - - if ("_".equals(name)) { - name = "_u"; - } - - // if it's all upper case, do nothing - if (name.matches("^[A-Z0-9_]*$")) { - return name; - } - - if (startsWithTwoUppercaseLetters(name)) { - name = name.substring(0, 2).toLowerCase(Locale.ROOT) + name.substring(2); - } - - // If name contains special chars -> replace them. - if ((name.chars().anyMatch(character -> specialCharReplacements.keySet().contains(String.valueOf((char) character))))) { - List allowedCharacters = new ArrayList<>(); - allowedCharacters.add("_"); - allowedCharacters.add("$"); - name = escape(name, specialCharReplacements, allowedCharacters, "_"); - } - - // camelize (lower first character) the variable name - // pet_id => petId - name = camelize(name, true); - - // for reserved word or word starting with number or containing dollar symbol, escape it - if (isReservedWord(name) || name.matches("(^\\d.*)|(.*[$].*)")) { - name = escapeReservedWord(name); - } - - return name; - } - - @Override - public String toRegularExpression(String pattern) { - return escapeText(pattern); - } - - private boolean startsWithTwoUppercaseLetters(String name) { - boolean startsWithTwoUppercaseLetters = false; - if (name.length() > 1) { - startsWithTwoUppercaseLetters = name.substring(0, 2).equals(name.substring(0, 2).toUpperCase(Locale.ROOT)); - } - return startsWithTwoUppercaseLetters; - } - - @Override - public void postProcessFile(File file, String fileType) { - if (file == null) { - return; - } - - String kotlinPostProcessFile = System.getenv("KOTLIN_POST_PROCESS_FILE"); - if (StringUtils.isEmpty(kotlinPostProcessFile)) { - return; // skip if KOTLIN_POST_PROCESS_FILE env variable is not defined - } - - // only process files with kt extension - if ("kt".equals(FilenameUtils.getExtension(file.toString()))) { - String command = kotlinPostProcessFile + " " + file; - try { - Process p = Runtime.getRuntime().exec(command); - p.waitFor(); - int exitValue = p.exitValue(); - if (exitValue != 0) { - LOGGER.error("Error running the command ({}). Exit value: {}", command, exitValue); - } else { - LOGGER.info("Successfully executed: {}", command); - } - } catch (InterruptedException | IOException e) { - LOGGER.error("Error running the command ({}). Exception: {}", command, e.getMessage()); - // Restore interrupted state - Thread.currentThread().interrupt(); - } - } - } - - private String fixNumberValue(String number, Schema p) { - if (ModelUtils.isFloatSchema(p)) { - return number + "f"; - } else if (ModelUtils.isDoubleSchema(p)) { - if (number.contains(".")) { - return number; - } - return number + ".0"; - } else if (ModelUtils.isLongSchema(p)) { - return number + "L"; - } - return number; - } - - @Override - public String toDefaultValue(Schema schema) { - Schema p = ModelUtils.getReferencedSchema(this.openAPI, schema); - if (ModelUtils.isBooleanSchema(p)) { - if (p.getDefault() != null) { - return p.getDefault().toString(); - } - } else if (ModelUtils.isDateSchema(p)) { - // TODO - } else if (ModelUtils.isDateTimeSchema(p)) { - // TODO - } else if (ModelUtils.isNumberSchema(p)) { - if (p.getDefault() != null) { - return fixNumberValue(p.getDefault().toString(), p); - } - } else if (ModelUtils.isIntegerSchema(p)) { - if (p.getDefault() != null) { - return fixNumberValue(p.getDefault().toString(), p); - } - } else if (ModelUtils.isURISchema(p)) { - if (p.getDefault() != null) { - return importMapping.get("URI") + ".create(\"" + p.getDefault() + "\")"; - } - } else if (ModelUtils.isArraySchema(p)) { - if (p.getDefault() != null) { - String arrInstantiationType = ModelUtils.isSet(p) ? "set" : "arrayList"; - - if (!(p.getDefault() instanceof ArrayNode)) { - return null; - } - ArrayNode _default = (ArrayNode) p.getDefault(); - if (_default.isEmpty()) { - return arrInstantiationType + "Of()"; - } - - StringBuilder defaultContent = new StringBuilder(); - Schema itemsSchema = getSchemaItems((ArraySchema) schema); - _default.elements().forEachRemaining((element) -> { - itemsSchema.setDefault(element.asText()); - defaultContent.append(toDefaultValue(itemsSchema)).append(","); - }); - defaultContent.deleteCharAt(defaultContent.length() - 1); // remove trailing comma - return arrInstantiationType + "Of(" + defaultContent + ")"; - } - } else if (ModelUtils.isStringSchema(p)) { - if (p.getDefault() != null) { - String _default = (String) p.getDefault(); - if (p.getEnum() == null) { - return "\"" + escapeText(_default) + "\""; - } else { - // convert to enum var name later in postProcessModels - return _default; - } - } - return null; - } - - return null; - } - - @Override - public GeneratorLanguage generatorLanguage() { - return GeneratorLanguage.KOTLIN; - } - - @Override - protected void updateModelForObject(CodegenModel m, Schema schema) { - /** - * we have a custom version of this function so we only set isMap to true if - * ModelUtils.isMapSchema - * In other generators, isMap is true for all type object schemas - */ - if (schema.getProperties() != null || schema.getRequired() != null && !(schema instanceof ComposedSchema)) { - // passing null to allProperties and allRequired as there's no parent - addVars(m, unaliasPropertySchema(schema.getProperties()), schema.getRequired(), null, null); - } - if (ModelUtils.isMapSchema(schema)) { - // an object or anyType composed schema that has additionalProperties set - addAdditionPropertiesToCodeGenModel(m, schema); - } else { - m.setIsMap(false); - if (ModelUtils.isFreeFormObject(openAPI, schema)) { - // non-composed object type with no properties + additionalProperties - // additionalProperties must be null, ObjectSchema, or empty Schema - addAdditionPropertiesToCodeGenModel(m, schema); - } - } - // process 'additionalProperties' - setAddProps(schema, m); - } -} diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonCodegen.java b/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonCodegen.java deleted file mode 100644 index fa38462af85..00000000000 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonCodegen.java +++ /dev/null @@ -1,714 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen.languages; - -import com.github.curiousoddman.rgxgen.RgxGen; -import io.swagger.v3.oas.models.examples.Example; -import io.swagger.v3.oas.models.media.ArraySchema; -import io.swagger.v3.oas.models.media.Schema; -import io.swagger.v3.oas.models.parameters.Parameter; -import org.apache.commons.io.FilenameUtils; -import org.apache.commons.lang3.StringUtils; -import org.openapitools.codegen.*; -import org.openapitools.codegen.utils.ModelUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.File; -import java.io.IOException; -import java.util.*; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import java.util.stream.Collectors; - -import static org.openapitools.codegen.utils.StringUtils.camelize; -import static org.openapitools.codegen.utils.StringUtils.underscore; - -public abstract class AbstractPythonCodegen extends DefaultCodegen implements CodegenConfig { - private final Logger LOGGER = LoggerFactory.getLogger(AbstractPythonCodegen.class); - - protected String packageName = "openapi_client"; - protected String packageVersion = "1.0.0"; - protected String projectName; // for setup.py, e.g. petstore-api - - public AbstractPythonCodegen() { - super(); - - // from https://docs.python.org/3/reference/lexical_analysis.html#keywords - setReservedWordsLowerCase( - Arrays.asList( - // local variable name used in API methods (endpoints) - "all_params", "resource_path", "path_params", "query_params", - "header_params", "form_params", "local_var_files", "body_params", "auth_settings", - // @property - "property", - // python reserved words - "and", "del", "from", "not", "while", "as", "elif", "global", "or", "with", - "assert", "else", "if", "pass", "yield", "break", "except", "import", - "print", "class", "exec", "in", "raise", "continue", "finally", "is", - "return", "def", "for", "lambda", "try", "self", "nonlocal", "None", "True", - "False", "async", "await")); - - languageSpecificPrimitives.clear(); - languageSpecificPrimitives.add("int"); - languageSpecificPrimitives.add("float"); - languageSpecificPrimitives.add("list"); - languageSpecificPrimitives.add("dict"); - languageSpecificPrimitives.add("bool"); - languageSpecificPrimitives.add("str"); - languageSpecificPrimitives.add("datetime"); - languageSpecificPrimitives.add("date"); - languageSpecificPrimitives.add("object"); - // TODO file and binary is mapped as `file` - languageSpecificPrimitives.add("file"); - languageSpecificPrimitives.add("bytes"); - - typeMapping.clear(); - typeMapping.put("integer", "int"); - typeMapping.put("float", "float"); - typeMapping.put("number", "float"); - typeMapping.put("long", "int"); - typeMapping.put("double", "float"); - typeMapping.put("array", "list"); - typeMapping.put("set", "list"); - typeMapping.put("map", "dict"); - typeMapping.put("boolean", "bool"); - typeMapping.put("string", "str"); - typeMapping.put("date", "date"); - typeMapping.put("DateTime", "datetime"); - typeMapping.put("object", "object"); - typeMapping.put("AnyType", "object"); - typeMapping.put("file", "file"); - // TODO binary should be mapped to byte array - // mapped to String as a workaround - typeMapping.put("binary", "str"); - typeMapping.put("ByteArray", "str"); - // map uuid to string for the time being - typeMapping.put("UUID", "str"); - typeMapping.put("URI", "str"); - typeMapping.put("null", "none_type"); - } - - @Override - public void processOpts() { - super.processOpts(); - - if (StringUtils.isEmpty(System.getenv("PYTHON_POST_PROCESS_FILE"))) { - LOGGER.info("Environment variable PYTHON_POST_PROCESS_FILE not defined so the Python code may not be properly formatted. To define it, try 'export PYTHON_POST_PROCESS_FILE=\"/usr/local/bin/yapf -i\"' (Linux/Mac)"); - LOGGER.info("NOTE: To enable file post-processing, 'enablePostProcessFile' must be set to `true` (--enable-post-process-file for CLI)."); - } - } - - @Override - public String escapeReservedWord(String name) { - if (this.reservedWordsMappings().containsKey(name)) { - return this.reservedWordsMappings().get(name); - } - return "_" + name; - } - - @Override - public String getTypeDeclaration(Schema p) { - if (ModelUtils.isArraySchema(p)) { - ArraySchema ap = (ArraySchema) p; - Schema inner = ap.getItems(); - return getSchemaType(p) + "[" + getTypeDeclaration(inner) + "]"; - } else if (ModelUtils.isMapSchema(p)) { - Schema inner = getAdditionalProperties(p); - - return getSchemaType(p) + "(str, " + getTypeDeclaration(inner) + ")"; - } - return super.getTypeDeclaration(p); - } - - /** - * Return the default value of the property - * - * @param p OpenAPI property object - * @return string presentation of the default value of the property - */ - @Override - public String toDefaultValue(Schema p) { - if (ModelUtils.isBooleanSchema(p)) { - if (p.getDefault() != null) { - if (!Boolean.valueOf(p.getDefault().toString())) - return "False"; - else - return "True"; - } - } else if (ModelUtils.isDateSchema(p)) { - // TODO - } else if (ModelUtils.isDateTimeSchema(p)) { - // TODO - } else if (ModelUtils.isNumberSchema(p)) { - if (p.getDefault() != null) { - return p.getDefault().toString(); - } - } else if (ModelUtils.isIntegerSchema(p)) { - if (p.getDefault() != null) { - return p.getDefault().toString(); - } - } else if (ModelUtils.isStringSchema(p)) { - if (p.getDefault() != null) { - if (Pattern.compile("\r\n|\r|\n").matcher((String) p.getDefault()).find()) - return "'''" + p.getDefault() + "'''"; - else - return "'" + ((String) p.getDefault()).replace("'", "\'") + "'"; - } - } else if (ModelUtils.isArraySchema(p)) { - if (p.getDefault() != null) { - return p.getDefault().toString(); - } else { - return null; - } - } - - return null; - } - - - @Override - public String toVarName(String name) { - // sanitize name - name = sanitizeName(name); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'. - - // remove dollar sign - name = name.replaceAll("$", ""); - - // if it's all upper case, convert to lower case - if (name.matches("^[A-Z_]*$")) { - name = name.toLowerCase(Locale.ROOT); - } - - // underscore the variable name - // petId => pet_id - name = underscore(name); - - // remove leading underscore - name = name.replaceAll("^_*", ""); - - // for reserved word or word starting with number, append _ - if (isReservedWord(name) || name.matches("^\\d.*")) { - name = escapeReservedWord(name); - } - - return name; - } - - @Override - public String toRegularExpression(String pattern) { - return addRegularExpressionDelimiter(pattern); - } - - @Override - public String toParamName(String name) { - // to avoid conflicts with 'callback' parameter for async call - if ("callback".equals(name)) { - return "param_callback"; - } - - // should be the same as variable name - return toVarName(name); - } - - @Override - public String toOperationId(String operationId) { - // throw exception if method name is empty (should not occur as an auto-generated method name will be used) - if (StringUtils.isEmpty(operationId)) { - throw new RuntimeException("Empty method name (operationId) not allowed"); - } - - // method name cannot use reserved keyword, e.g. return - if (isReservedWord(operationId)) { - LOGGER.warn("{} (reserved word) cannot be used as method name. Renamed to {}", operationId, underscore(sanitizeName("call_" + operationId))); - operationId = "call_" + operationId; - } - - // operationId starts with a number - if (operationId.matches("^\\d.*")) { - LOGGER.warn("{} (starting with a number) cannot be used as method name. Renamed to {}", operationId, underscore(sanitizeName("call_" + operationId))); - operationId = "call_" + operationId; - } - - return underscore(sanitizeName(operationId)); - } - - @Override - public String escapeQuotationMark(String input) { - // remove ' to avoid code injection - return input.replace("'", ""); - } - - @Override - public String escapeUnsafeCharacters(String input) { - // remove multiline comment - return input.replace("'''", "'_'_'"); - } - - @Override - public void postProcessFile(File file, String fileType) { - if (file == null) { - return; - } - String pythonPostProcessFile = System.getenv("PYTHON_POST_PROCESS_FILE"); - if (StringUtils.isEmpty(pythonPostProcessFile)) { - return; // skip if PYTHON_POST_PROCESS_FILE env variable is not defined - } - - // only process files with py extension - if ("py".equals(FilenameUtils.getExtension(file.toString()))) { - String command = pythonPostProcessFile + " " + file; - try { - Process p = Runtime.getRuntime().exec(command); - int exitValue = p.waitFor(); - if (exitValue != 0) { - LOGGER.error("Error running the command ({}). Exit value: {}", command, exitValue); - } else { - LOGGER.info("Successfully executed: {}", command); - } - } catch (InterruptedException | IOException e) { - LOGGER.error("Error running the command ({}). Exception: {}", command, e.getMessage()); - // Restore interrupted state - Thread.currentThread().interrupt(); - } - } - } - - @Override - public String toExampleValue(Schema schema) { - return toExampleValueRecursive(schema, new ArrayList<>(), 5); - } - - private String toExampleValueRecursive(Schema schema, List includedSchemas, int indentation) { - boolean cycleFound = includedSchemas.stream().filter(s->schema.equals(s)).count() > 1; - if (cycleFound) { - return ""; - } - String indentationString = ""; - for (int i = 0; i < indentation; i++) indentationString += " "; - String example = null; - if (schema.getExample() != null) { - example = schema.getExample().toString(); - } - - if (ModelUtils.isNullType(schema) && null != example) { - // The 'null' type is allowed in OAS 3.1 and above. It is not supported by OAS 3.0.x, - // though this tooling supports it. - return "None"; - } - // correct "true"s into "True"s, since super.toExampleValue uses "toString()" on Java booleans - if (ModelUtils.isBooleanSchema(schema) && null != example) { - if ("false".equalsIgnoreCase(example)) example = "False"; - else example = "True"; - } - - // correct "'"s into "'"s after toString() - if (ModelUtils.isStringSchema(schema) && schema.getDefault() != null && !ModelUtils.isDateSchema(schema) && !ModelUtils.isDateTimeSchema(schema)) { - example = (String) schema.getDefault(); - } - - if (StringUtils.isNotBlank(example) && !"null".equals(example)) { - if (ModelUtils.isStringSchema(schema)) { - example = "'" + example + "'"; - } - return example; - } - - if (schema.getEnum() != null && !schema.getEnum().isEmpty()) { - // Enum case: - example = schema.getEnum().get(0).toString(); - if (ModelUtils.isStringSchema(schema)) { - example = "'" + escapeText(example) + "'"; - } - if (null == example) - LOGGER.warn("Empty enum. Cannot built an example!"); - - return example; - } else if (null != schema.get$ref()) { - // $ref case: - Map allDefinitions = ModelUtils.getSchemas(this.openAPI); - String ref = ModelUtils.getSimpleRef(schema.get$ref()); - if (allDefinitions != null) { - Schema refSchema = allDefinitions.get(ref); - if (null == refSchema) { - return "None"; - } else { - String refTitle = refSchema.getTitle(); - if (StringUtils.isBlank(refTitle) || "null".equals(refTitle)) { - refSchema.setTitle(ref); - } - if (StringUtils.isNotBlank(schema.getTitle()) && !"null".equals(schema.getTitle())) { - includedSchemas.add(schema); - } - return toExampleValueRecursive(refSchema, includedSchemas, indentation); - } - } else { - LOGGER.warn("allDefinitions not defined in toExampleValue!\n"); - } - } - if (ModelUtils.isDateSchema(schema)) { - example = "datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date()"; - return example; - } else if (ModelUtils.isDateTimeSchema(schema)) { - example = "datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f')"; - return example; - } else if (ModelUtils.isBinarySchema(schema)) { - example = "bytes(b'blah')"; - return example; - } else if (ModelUtils.isByteArraySchema(schema)) { - example = "YQ=="; - } else if (ModelUtils.isStringSchema(schema)) { - // a BigDecimal: - if ("Number".equalsIgnoreCase(schema.getFormat())) { - return "1"; - } - if (StringUtils.isNotBlank(schema.getPattern())) { - String pattern = schema.getPattern(); - RgxGen rgxGen = new RgxGen(patternCorrection(pattern)); - // this seed makes it so if we have [a-z] we pick a - Random random = new Random(18); - String sample = rgxGen.generate(random); - // omit leading / and trailing /, omit trailing /i - Pattern valueExtractor = Pattern.compile("^/\\^?(.+?)\\$?/.?$"); - Matcher m = valueExtractor.matcher(sample); - if (m.find()) { - example = m.group(m.groupCount()); - } else { - example = sample; - } - } - if (example == null) { - example = ""; - } - int len = 0; - if (null != schema.getMinLength()) { - len = schema.getMinLength().intValue(); - if (len < 1) { - example = ""; - } else { - for (int i = 0; i < len; i++) example += i; - } - } - } else if (ModelUtils.isIntegerSchema(schema)) { - if (schema.getMinimum() != null) - example = schema.getMinimum().toString(); - else - example = "56"; - } else if (ModelUtils.isNumberSchema(schema)) { - if (schema.getMinimum() != null) - example = schema.getMinimum().toString(); - else - example = "1.337"; - } else if (ModelUtils.isBooleanSchema(schema)) { - example = "True"; - } else if (ModelUtils.isArraySchema(schema)) { - if (StringUtils.isNotBlank(schema.getTitle()) && !"null".equals(schema.getTitle())) { - includedSchemas.add(schema); - } - ArraySchema arrayschema = (ArraySchema) schema; - example = "[\n" + indentationString + toExampleValueRecursive(arrayschema.getItems(), includedSchemas, indentation + 1) + "\n" + indentationString + "]"; - } else if (ModelUtils.isMapSchema(schema)) { - if (StringUtils.isNotBlank(schema.getTitle()) && !"null".equals(schema.getTitle())) { - includedSchemas.add(schema); - } - Object additionalObject = schema.getAdditionalProperties(); - if (additionalObject instanceof Schema) { - Schema additional = (Schema) additionalObject; - String theKey = "'key'"; - if (additional.getEnum() != null && !additional.getEnum().isEmpty()) { - theKey = additional.getEnum().get(0).toString(); - if (ModelUtils.isStringSchema(additional)) { - theKey = "'" + escapeText(theKey) + "'"; - } - } - example = "{\n" + indentationString + theKey + " : " + toExampleValueRecursive(additional, includedSchemas, indentation + 1) + "\n" + indentationString + "}"; - } else { - example = "{ }"; - } - } else if (ModelUtils.isObjectSchema(schema)) { - if (StringUtils.isBlank(schema.getTitle())) { - example = "None"; - return example; - } - - // I remove any property that is a discriminator, since it is not well supported by the python generator - String toExclude = null; - if (schema.getDiscriminator() != null) { - toExclude = schema.getDiscriminator().getPropertyName(); - } - - example = packageName + ".models." + underscore(schema.getTitle()) + "." + schema.getTitle() + "("; - - // if required only: - // List reqs = schema.getRequired(); - - // if required and optionals - List reqs = new ArrayList<>(); - if (schema.getProperties() != null && !schema.getProperties().isEmpty()) { - for (Object toAdd : schema.getProperties().keySet()) { - reqs.add((String) toAdd); - } - - Map properties = schema.getProperties(); - Set propkeys = null; - if (properties != null) propkeys = properties.keySet(); - if (toExclude != null && reqs.contains(toExclude)) { - reqs.remove(toExclude); - } - for (String toRemove : includedSchemas.stream().map(Schema::getTitle).collect(Collectors.toList())) { - if (reqs.contains(toRemove)) { - reqs.remove(toRemove); - } - } - if (StringUtils.isNotBlank(schema.getTitle()) && !"null".equals(schema.getTitle())) { - includedSchemas.add(schema); - } - if (null != schema.getRequired()) for (Object toAdd : schema.getRequired()) { - reqs.add((String) toAdd); - } - if (null != propkeys) for (String propname : propkeys) { - Schema schema2 = properties.get(propname); - if (reqs.contains(propname)) { - String refTitle = schema2.getTitle(); - if (StringUtils.isBlank(refTitle) || "null".equals(refTitle)) { - schema2.setTitle(propname); - } - example += "\n" + indentationString + underscore(propname) + " = " + - toExampleValueRecursive(schema2, includedSchemas, indentation + 1) + ", "; - } - } - } - example += ")"; - } else { - LOGGER.warn("Type {} not handled properly in toExampleValue", schema.getType()); - } - - if (ModelUtils.isStringSchema(schema)) { - example = "'" + escapeText(example) + "'"; - } - - return example; - } - - @Override - public void setParameterExampleValue(CodegenParameter p) { - String example; - - if (p.defaultValue == null) { - example = p.example; - } else { - p.example = p.defaultValue; - return; - } - - String type = p.baseType; - if (type == null) { - type = p.dataType; - } - - if ("String".equalsIgnoreCase(type) || "str".equalsIgnoreCase(type)) { - if (example == null) { - example = p.paramName + "_example"; - } - example = "'" + escapeText(example) + "'"; - } else if ("Integer".equals(type) || "int".equals(type)) { - if (example == null) { - example = "56"; - } - } else if ("Float".equalsIgnoreCase(type) || "Double".equalsIgnoreCase(type)) { - if (example == null) { - example = "3.4"; - } - } else if ("BOOLEAN".equalsIgnoreCase(type) || "bool".equalsIgnoreCase(type)) { - if (example == null) { - example = "True"; - } - } else if ("file".equalsIgnoreCase(type)) { - if (example == null) { - example = "/path/to/file"; - } - example = "'" + escapeText(example) + "'"; - } else if ("Date".equalsIgnoreCase(type)) { - if (example == null) { - example = "2013-10-20"; - } - example = "'" + escapeText(example) + "'"; - } else if ("DateTime".equalsIgnoreCase(type)) { - if (example == null) { - example = "2013-10-20T19:20:30+01:00"; - } - example = "'" + escapeText(example) + "'"; - } else if (!languageSpecificPrimitives.contains(type)) { - // type is a model class, e.g. User - example = this.packageName + "." + type + "()"; - } else { - LOGGER.warn("Type {} not handled properly in setParameterExampleValue", type); - } - - if (example == null) { - example = "None"; - } else if (Boolean.TRUE.equals(p.isArray)) { - example = "[" + example + "]"; - } else if (Boolean.TRUE.equals(p.isMap)) { - example = "{'key': " + example + "}"; - } - - p.example = example; - } - - @Override - public void setParameterExampleValue(CodegenParameter codegenParameter, Parameter parameter) { - Schema schema = parameter.getSchema(); - - if (parameter.getExample() != null) { - codegenParameter.example = parameter.getExample().toString(); - } else if (parameter.getExamples() != null && !parameter.getExamples().isEmpty()) { - Example example = parameter.getExamples().values().iterator().next(); - if (example.getValue() != null) { - codegenParameter.example = example.getValue().toString(); - } - } else if (schema != null && schema.getExample() != null) { - codegenParameter.example = schema.getExample().toString(); - } - - setParameterExampleValue(codegenParameter); - } - - @Override - public String sanitizeTag(String tag) { - return sanitizeName(tag); - } - - public String patternCorrection(String pattern) { - // Java does not recognize starting and ending forward slashes and mode modifiers - // It considers them as characters with no special meaning and tries to find them in the match string - boolean checkEnding = pattern.endsWith("/i") || pattern.endsWith("/g") || pattern.endsWith("/m"); - if (checkEnding) pattern = pattern.substring(0, pattern.length() - 2); - if (pattern.endsWith("/")) pattern = pattern.substring(0, pattern.length() - 1); - if (pattern.startsWith("/")) pattern = pattern.substring(1); - return pattern; - } - - public void setPackageName(String packageName) { - this.packageName = packageName; - additionalProperties.put(CodegenConstants.PACKAGE_NAME, this.packageName); - } - - public void setProjectName(String projectName) { - this.projectName = projectName; - } - - public void setPackageVersion(String packageVersion) { - this.packageVersion = packageVersion; - } - - @Override - public String getSchemaType(Schema p) { - String openAPIType = super.getSchemaType(p); - String type = null; - if (typeMapping.containsKey(openAPIType)) { - type = typeMapping.get(openAPIType); - if (languageSpecificPrimitives.contains(type)) { - return type; - } - } else { - type = toModelName(openAPIType); - } - return type; - } - - - @Override - public String toModelName(String name) { - String sanitizedName = sanitizeName(name); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'. - // remove dollar sign - sanitizedName = sanitizedName.replaceAll("$", ""); - // remove whitespace - sanitizedName = sanitizedName.replaceAll("\\s+", ""); - - String nameWithPrefixSuffix = sanitizedName; - if (!StringUtils.isEmpty(modelNamePrefix)) { - // add '_' so that model name can be camelized correctly - nameWithPrefixSuffix = modelNamePrefix + "_" + nameWithPrefixSuffix; - } - - if (!StringUtils.isEmpty(modelNameSuffix)) { - // add '_' so that model name can be camelized correctly - nameWithPrefixSuffix = nameWithPrefixSuffix + "_" + modelNameSuffix; - } - - // camelize the model name - // phone_number => PhoneNumber - String camelizedName = camelize(nameWithPrefixSuffix); - - // model name cannot use reserved keyword, e.g. return - if (isReservedWord(camelizedName)) { - String modelName = "Model" + camelizedName; // e.g. return => ModelReturn (after camelize) - LOGGER.warn("{} (reserved word) cannot be used as model name. Renamed to {}", camelizedName, modelName); - return modelName; - } - - // model name starts with number - if (camelizedName.matches("^\\d.*")) { - String modelName = "Model" + camelizedName; // e.g. return => ModelReturn (after camelize) - LOGGER.warn("{} (model name starts with number) cannot be used as model name. Renamed to {}", camelizedName, modelName); - return modelName; - } - - return camelizedName; - } - - @Override - public String toModelFilename(String name) { - // underscore the model file name - // PhoneNumber => phone_number - return underscore(dropDots(toModelName(name))); - } - - @Override - public String toModelTestFilename(String name) { - return "test_" + toModelFilename(name); - } - - @Override - public String toApiFilename(String name) { - // e.g. PhoneNumberApi.py => phone_number_api.py - return underscore(toApiName(name)); - } - - @Override - public String toApiTestFilename(String name) { - return "test_" + toApiFilename(name); - } - - @Override - public String toApiName(String name) { - return super.toApiName(name); - } - - @Override - public String toApiVarName(String name) { - return underscore(toApiName(name)); - } - - protected static String dropDots(String str) { - return str.replaceAll("\\.", "_"); - } - - @Override - public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.PYTHON; } -} diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/JMeterClientCodegen.java b/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/JMeterClientCodegen.java deleted file mode 100644 index bad912d9a8f..00000000000 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/JMeterClientCodegen.java +++ /dev/null @@ -1,247 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen.languages; - -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.Operation; -import io.swagger.v3.oas.models.PathItem; -import io.swagger.v3.oas.models.media.ArraySchema; -import io.swagger.v3.oas.models.media.Schema; -import org.openapitools.codegen.CodegenConfig; -import org.openapitools.codegen.CodegenType; -import org.openapitools.codegen.DefaultCodegen; -import org.openapitools.codegen.meta.features.*; -import org.openapitools.codegen.utils.ModelUtils; - -import java.io.File; -import java.util.Arrays; -import java.util.EnumSet; -import java.util.HashSet; -import java.util.Map; - -public class JMeterClientCodegen extends DefaultCodegen implements CodegenConfig { - - // source folder where to write the files - protected String sourceFolder = ""; - protected String apiVersion = "1.0.0"; - - /** - * Configures the type of generator. - * - * @return the CodegenType for this generator - * @see org.openapitools.codegen.CodegenType - */ - @Override - public CodegenType getTag() { - return CodegenType.CLIENT; - } - - /** - * Configures a friendly name for the generator. This will be used by the generator - * to select the library with the -g flag. - * - * @return the friendly name for the generator - */ - @Override - public String getName() { - return "jmeter"; - } - - /** - * Returns human-friendly help for the generator. Provide the consumer with help - * tips, parameters here - * - * @return A string value for the help message - */ - @Override - public String getHelp() { - return "Generates a JMeter .jmx file."; - } - - public JMeterClientCodegen() { - super(); - - modifyFeatureSet(features -> features - .wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML)) - .securityFeatures(EnumSet.of( - SecurityFeature.BasicAuth, - SecurityFeature.ApiKey, - SecurityFeature.OAuth2_Implicit - )) - .excludeGlobalFeatures( - GlobalFeature.XMLStructureDefinitions, - GlobalFeature.Callbacks, - GlobalFeature.LinkObjects, - GlobalFeature.ParameterStyling - ) - .excludeSchemaSupportFeatures( - SchemaSupportFeature.Polymorphism - ) - .includeParameterFeatures( - ParameterFeature.Cookie - ) - .includeClientModificationFeatures( - ClientModificationFeature.BasePath - ) - ); - - // set the output folder here - outputFolder = "generated-code/JMeterClientCodegen"; - - /* - * Api classes. You can write classes for each Api file with the apiTemplateFiles map. - * as with models, add multiple entries with different extensions for multiple files per - * class - */ - apiTemplateFiles.put( - "api.mustache", // the template to use - ".jmx"); // the extension for each file to write - - apiTemplateFiles.put("testdata-localhost.mustache", ".csv"); - - /* - * Template Location. This is the location which templates will be read from. The generator - * will use the resource stream to attempt to read the templates. - */ - embeddedTemplateDir = templateDir = "jmeter-client"; - - /* - * Api Package. Optional, if needed, this can be used in templates - */ - apiPackage = ""; - - /* - * Model Package. Optional, if needed, this can be used in templates - */ - modelPackage = ""; - - /* - * Reserved words. Override this with reserved words specific to your language - */ - reservedWords = new HashSet<>( - Arrays.asList( - "sample1", // replace with static values - "sample2") - ); - - /* - * Additional Properties. These values can be passed to the templates and - * are available in models, apis, and supporting files - */ - additionalProperties.put("apiVersion", apiVersion); - // supportingFiles.add(new SupportingFile("testdata-localhost.mustache", "input", "testdata-localhost.csv")); - } - - @Override - public void preprocessOpenAPI(OpenAPI openAPI) { - if (openAPI != null && openAPI.getPaths() != null) { - for (Map.Entry openAPIGetPathsEntry : openAPI.getPaths().entrySet()) { - String pathname = openAPIGetPathsEntry.getKey(); - PathItem path = openAPIGetPathsEntry.getValue(); - if (path.readOperations() != null) { - for (Operation operation : path.readOperations()) { - String pathWithDollars = pathname.replaceAll("\\{", "\\$\\{"); - operation.addExtension("x-path", pathWithDollars); - } - } - } - } - } - - /** - * Escapes a reserved word as defined in the `reservedWords` array. Handle escaping - * those terms here. This logic is only called if a variable matches the reserved words - * - * @return the escaped term - */ - @Override - public String escapeReservedWord(String name) { - if (this.reservedWordsMappings().containsKey(name)) { - return this.reservedWordsMappings().get(name); - } - return "_" + name; - } - - /** - * Location to write model files. You can use the modelPackage() as defined when the class is - * instantiated - */ - @Override - public String modelFileFolder() { - return outputFolder + File.separator + sourceFolder + File.separator + modelPackage().replace('.', File.separatorChar); - } - - /** - * Location to write api files. You can use the apiPackage() as defined when the class is - * instantiated - */ - @Override - public String apiFileFolder() { - return outputFolder + File.separator + sourceFolder + File.separator + apiPackage().replace('.', File.separatorChar); - } - - /** - * Optional - type declaration. This is a String which is used by the templates to instantiate your - * types. There is typically special handling for different property types - * - * @return a string value used as the `dataType` field for model templates, `returnType` for api templates - */ - @Override - public String getTypeDeclaration(Schema p) { - if (ModelUtils.isArraySchema(p)) { - ArraySchema ap = (ArraySchema) p; - Schema inner = ap.getItems(); - return getSchemaType(p) + "[" + getTypeDeclaration(inner) + "]"; - } else if (ModelUtils.isMapSchema(p)) { - Schema inner = getAdditionalProperties(p); - return getSchemaType(p) + "[String, " + getTypeDeclaration(inner) + "]"; - } - return super.getTypeDeclaration(p); - } - - /** - * Optional - OpenAPI type conversion. This is used to map OpenAPI types in a `Schema` into - * either language specific types via `typeMapping` or into complex models if there is not a mapping. - * - * @return a string value of the type or complex model for this property - */ - @Override - public String getSchemaType(Schema p) { - String openAPIType = super.getSchemaType(p); - String type = null; - if (typeMapping.containsKey(openAPIType)) { - type = typeMapping.get(openAPIType); - if (languageSpecificPrimitives.contains(type)) - return toModelName(type); - } else - type = openAPIType; - return toModelName(type); - } - - @Override - public String escapeQuotationMark(String input) { - // remove ' to avoid code injection - return input.replace("'", ""); - } - - @Override - public String escapeUnsafeCharacters(String input) { - return input.replace("*/", "*_/").replace("/*", "/_*"); - } - -} diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java b/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java deleted file mode 100644 index 686b1720671..00000000000 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java +++ /dev/null @@ -1,2795 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen.languages; - -import com.github.curiousoddman.rgxgen.RgxGen; -import com.github.curiousoddman.rgxgen.config.RgxGenOption; -import com.github.curiousoddman.rgxgen.config.RgxGenProperties; -import com.google.common.base.CaseFormat; -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.Operation; -import io.swagger.v3.oas.models.PathItem; -import io.swagger.v3.oas.models.Paths; -import io.swagger.v3.oas.models.servers.Server; -import io.swagger.v3.oas.models.tags.Tag; - -import org.apache.commons.io.FileUtils; -import org.openapitools.codegen.api.TemplatePathLocator; -import org.openapitools.codegen.config.GlobalSettings; -import org.openapitools.codegen.ignore.CodegenIgnoreProcessor; -import org.openapitools.codegen.model.ModelMap; -import org.openapitools.codegen.model.ModelsMap; -import org.openapitools.codegen.model.OperationMap; -import org.openapitools.codegen.model.OperationsMap; -import org.openapitools.codegen.templating.*; -import io.swagger.v3.core.util.Json; -import io.swagger.v3.oas.models.media.*; -import io.swagger.v3.oas.models.parameters.Parameter; -import io.swagger.v3.oas.models.parameters.RequestBody; -import io.swagger.v3.oas.models.security.SecurityScheme; -import org.apache.commons.lang3.StringUtils; -import org.openapitools.codegen.*; -import org.openapitools.codegen.CodegenDiscriminator.MappedModel; -import org.openapitools.codegen.api.TemplatingEngineAdapter; -import org.openapitools.codegen.meta.GeneratorMetadata; -import org.openapitools.codegen.meta.Stability; -import org.openapitools.codegen.meta.features.*; -import org.openapitools.codegen.utils.ModelUtils; -import org.openapitools.codegen.utils.ProcessUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.openapitools.codegen.api.TemplateProcessor; - -import java.io.File; -import java.io.IOException; -import java.math.BigDecimal; -import java.nio.file.Path; -import java.time.OffsetDateTime; -import java.time.ZoneOffset; -import java.time.format.DateTimeFormatter; -import java.util.*; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import java.util.stream.Collectors; - -import static org.openapitools.codegen.utils.OnceLogger.once; -import static org.openapitools.codegen.utils.StringUtils.camelize; -import static org.openapitools.codegen.utils.StringUtils.underscore; - -public class PythonClientCodegen extends AbstractPythonCodegen { - private final Logger LOGGER = LoggerFactory.getLogger(PythonClientCodegen.class); - - public static final String PACKAGE_URL = "packageUrl"; - public static final String DEFAULT_LIBRARY = "urllib3"; - // nose is a python testing framework, we use pytest if USE_NOSE is unset - public static final String USE_NOSE = "useNose"; - public static final String RECURSION_LIMIT = "recursionLimit"; - public static final String USE_INLINE_MODEL_RESOLVER = "useInlineModelResolver"; - - protected String packageUrl; - protected String apiDocPath = "docs/apis/tags/"; - protected String modelDocPath = "docs/models/"; - protected boolean useNose = false; - protected boolean useInlineModelResolver = false; - - protected Map regexModifiers; - - private String testFolder; - - // A cache to efficiently lookup a Schema instance based on the return value of `toModelName()`. - private Map modelNameToSchemaCache; - private DateTimeFormatter iso8601Date = DateTimeFormatter.ISO_DATE; - private DateTimeFormatter iso8601DateTime = DateTimeFormatter.ISO_DATE_TIME; - - private String templateExtension; - protected CodegenIgnoreProcessor ignoreProcessor; - protected TemplateProcessor templateProcessor = null; - - // for apis.tags imports - private Map tagModuleNameToApiClassname = new LinkedHashMap<>(); - // for apis.tags enum tag definition - private Map enumToTag = new LinkedHashMap<>(); - // for apis.tags tag api definition - private Map tagEnumToApiClassname = new LinkedHashMap<>(); - - private boolean nonCompliantUseDiscrIfCompositionFails = false; - - public PythonClientCodegen() { - super(); - loadDeepObjectIntoItems = false; - importBaseType = false; - addSchemaImportsFromV3SpecLocations = true; - sortModelPropertiesByRequiredFlag = Boolean.TRUE; - sortParamsByRequiredFlag = Boolean.TRUE; - addSuffixToDuplicateOperationNicknames = false; - - modifyFeatureSet(features -> features - .includeSchemaSupportFeatures( - SchemaSupportFeature.Simple, - SchemaSupportFeature.Composite, - SchemaSupportFeature.Polymorphism, - SchemaSupportFeature.Union, - SchemaSupportFeature.allOf, - SchemaSupportFeature.anyOf, - SchemaSupportFeature.oneOf, - SchemaSupportFeature.not - ) - .includeDocumentationFeatures(DocumentationFeature.Readme) - .wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.Custom)) - .securityFeatures(EnumSet.of( - SecurityFeature.BasicAuth, - SecurityFeature.BearerToken, - SecurityFeature.ApiKey, - SecurityFeature.OAuth2_Implicit - )) - .includeDataTypeFeatures( - DataTypeFeature.Null, - DataTypeFeature.AnyType, - DataTypeFeature.Uuid - ) - .includeGlobalFeatures( - GlobalFeature.ParameterizedServer, - GlobalFeature.ParameterStyling - ) - .excludeGlobalFeatures( - GlobalFeature.XMLStructureDefinitions, - GlobalFeature.Callbacks, - GlobalFeature.LinkObjects - ) - .excludeSchemaSupportFeatures( - ) - .excludeParameterFeatures( - ParameterFeature.Cookie - ) - ); - - // clear import mapping (from default generator) as python does not use it - // at the moment - importMapping.clear(); - - modelPackage = "model"; - apiPackage = "apis"; - outputFolder = "generated-code" + File.separatorChar + "python"; - - embeddedTemplateDir = templateDir = "python"; - - testFolder = "test"; - - // default HIDE_GENERATION_TIMESTAMP to true - hideGenerationTimestamp = Boolean.TRUE; - - // from https://docs.python.org/3/reference/lexical_analysis.html#keywords - setReservedWordsLowerCase( - Arrays.asList( - // local variable name used in API methods (endpoints) - "all_params", "resource_path", "path_params", "query_params", - "header_params", "form_params", "local_var_files", "body_params", "auth_settings", - // @property - "property", - // python reserved words - "and", "del", "from", "not", "while", "as", "elif", "global", "or", "with", - "assert", "else", "if", "pass", "yield", "break", "except", "import", - "print", "class", "exec", "in", "raise", "continue", "finally", "is", - "return", "def", "for", "lambda", "try", "self", "nonlocal", "None", "True", - "False", "async", "await", - // types - "float", "int", "str", "bool", "none_type", "dict", "frozendict", "list", "tuple", "file_type")); - - regexModifiers = new HashMap(); - regexModifiers.put('i', "IGNORECASE"); - regexModifiers.put('l', "LOCALE"); - regexModifiers.put('m', "MULTILINE"); - regexModifiers.put('s', "DOTALL"); - regexModifiers.put('u', "UNICODE"); - regexModifiers.put('x', "VERBOSE"); - - cliOptions.clear(); - cliOptions.add(new CliOption(CodegenConstants.PACKAGE_NAME, "python package name (convention: snake_case).") - .defaultValue("openapi_client")); - cliOptions.add(new CliOption(CodegenConstants.PROJECT_NAME, "python project name in setup.py (e.g. petstore-api).")); - cliOptions.add(new CliOption(CodegenConstants.PACKAGE_VERSION, "python package version.") - .defaultValue("1.0.0")); - cliOptions.add(new CliOption(PACKAGE_URL, "python package URL.")); - // this generator does not use SORT_PARAMS_BY_REQUIRED_FLAG - // this generator uses the following order for endpoint paramters and model properties - // required params - // optional params which are set to unset as their default for method signatures only - // optional params as **kwargs - cliOptions.add(new CliOption(CodegenConstants.HIDE_GENERATION_TIMESTAMP, CodegenConstants.HIDE_GENERATION_TIMESTAMP_DESC) - .defaultValue(Boolean.TRUE.toString())); - cliOptions.add(new CliOption(CodegenConstants.SOURCECODEONLY_GENERATION, CodegenConstants.SOURCECODEONLY_GENERATION_DESC) - .defaultValue(Boolean.FALSE.toString())); - cliOptions.add(CliOption.newBoolean(USE_NOSE, "use the nose test framework"). - defaultValue(Boolean.FALSE.toString())); - cliOptions.add(new CliOption(RECURSION_LIMIT, "Set the recursion limit. If not set, use the system default value.")); - cliOptions.add(CliOption.newBoolean(USE_INLINE_MODEL_RESOLVER, "use the inline model resolver, if true inline complex models will be extracted into components and $refs to them will be used"). - defaultValue(Boolean.FALSE.toString())); - CliOption nonCompliantUseDiscrIfCompositionFails = CliOption.newBoolean(CodegenConstants.NON_COMPLIANT_USE_DISCR_IF_COMPOSITION_FAILS, CodegenConstants.NON_COMPLIANT_USE_DISCR_IF_COMPOSITION_FAILS_DESC); - Map nonCompliantUseDiscrIfCompositionFailsOpts = new HashMap<>(); - nonCompliantUseDiscrIfCompositionFailsOpts.put("true", "If composition fails and a discriminator exists, the composition errors will be ignored and validation will be attempted with the discriminator"); - nonCompliantUseDiscrIfCompositionFailsOpts.put("false", "Composition validation must succeed. Discriminator validation must succeed."); - nonCompliantUseDiscrIfCompositionFails.setEnum(nonCompliantUseDiscrIfCompositionFailsOpts); - - cliOptions.add(nonCompliantUseDiscrIfCompositionFails); - - supportedLibraries.put("urllib3", "urllib3-based client"); - CliOption libraryOption = new CliOption(CodegenConstants.LIBRARY, "library template (sub-template) to use: urllib3"); - libraryOption.setDefault(DEFAULT_LIBRARY); - cliOptions.add(libraryOption); - setLibrary(DEFAULT_LIBRARY); - - // Composed schemas can have the 'additionalProperties' keyword, as specified in JSON schema. - // In principle, this should be enabled by default for all code generators. However due to limitations - // in other code generators, support needs to be enabled on a case-by-case basis. - supportsAdditionalPropertiesWithComposedSchema = true; - - // When the 'additionalProperties' keyword is not present in a OAS schema, allow - // undeclared properties. This is compliant with the JSON schema specification. - this.setDisallowAdditionalPropertiesIfNotPresent(false); - GlobalSettings.setProperty("x-disallow-additional-properties-if-not-present", "false"); - - // this may set datatype right for additional properties - instantiationTypes.put("map", "dict"); - - languageSpecificPrimitives.add("file_type"); - languageSpecificPrimitives.add("none_type"); - typeMapping.put("decimal", "str"); - - generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata) - .stability(Stability.STABLE) - .build(); - } - - @Override - public void processOpts() { - this.setLegacyDiscriminatorBehavior(false); - - super.processOpts(); - - TemplatingEngineAdapter te = getTemplatingEngine(); - if (te instanceof HandlebarsEngineAdapter) { - HandlebarsEngineAdapter hea = (HandlebarsEngineAdapter) te; - hea.infiniteLoops(true); - hea.setPrettyPrint(true); - } else { - throw new RuntimeException("Only the HandlebarsEngineAdapter is supported for this generator"); - } - - TemplatePathLocator commonTemplateLocator = new CommonTemplateContentLocator(); - TemplatePathLocator generatorTemplateLocator = new GeneratorTemplateContentLocator(this); - TemplateManagerOptions templateManagerOptions = new TemplateManagerOptions(this.isEnableMinimalUpdate(),this.isSkipOverwrite()); - templateProcessor = new TemplateManager( - templateManagerOptions, - te, - new TemplatePathLocator[]{generatorTemplateLocator, commonTemplateLocator} - ); - templateExtension = te.getIdentifier(); - - String ignoreFileLocation = this.getIgnoreFilePathOverride(); - if (ignoreFileLocation != null) { - final File ignoreFile = new File(ignoreFileLocation); - if (ignoreFile.exists() && ignoreFile.canRead()) { - this.ignoreProcessor = new CodegenIgnoreProcessor(ignoreFile); - } else { - LOGGER.warn("Ignore file specified at {} is not valid. This will fall back to an existing ignore file if present in the output directory.", ignoreFileLocation); - } - } - - if (this.ignoreProcessor == null) { - this.ignoreProcessor = new CodegenIgnoreProcessor(this.getOutputDir()); - } - - modelTemplateFiles.put("model." + templateExtension, ".py"); - /* - This stub file exists to allow pycharm to read and use typing.overload decorators for it to see that - dict_instance["someProp"] is of type SomeClass.properties.someProp - See https://youtrack.jetbrains.com/issue/PY-42137/PyCharm-type-hinting-doesnt-work-well-with-overload-decorator - */ - modelTemplateFiles.put("model_stub." + templateExtension, ".pyi"); - apiTemplateFiles.put("api." + templateExtension, ".py"); - modelTestTemplateFiles.put("model_test." + templateExtension, ".py"); - modelDocTemplateFiles.put("model_doc." + templateExtension, ".md"); - apiDocTemplateFiles.put("api_doc." + templateExtension, ".md"); - - if (StringUtils.isEmpty(System.getenv("PYTHON_POST_PROCESS_FILE"))) { - LOGGER.info("Environment variable PYTHON_POST_PROCESS_FILE not defined so the Python code may not be properly formatted. To define it, try 'export PYTHON_POST_PROCESS_FILE=\"/usr/local/bin/yapf -i\"' (Linux/Mac)"); - LOGGER.info("NOTE: To enable file post-processing, 'enablePostProcessFile' must be set to `true` (--enable-post-process-file for CLI)."); - } - - Boolean excludeTests = false; - - if (additionalProperties.containsKey(CodegenConstants.PACKAGE_NAME)) { - setPackageName((String) additionalProperties.get(CodegenConstants.PACKAGE_NAME)); - } - - if (additionalProperties.containsKey(CodegenConstants.PROJECT_NAME)) { - setProjectName((String) additionalProperties.get(CodegenConstants.PROJECT_NAME)); - } else { - // default: set project based on package name - // e.g. petstore_api (package name) => petstore-api (project name) - setProjectName(packageName.replaceAll("_", "-")); - } - - if (additionalProperties.containsKey(CodegenConstants.PACKAGE_VERSION)) { - setPackageVersion((String) additionalProperties.get(CodegenConstants.PACKAGE_VERSION)); - } - - additionalProperties.put(CodegenConstants.PROJECT_NAME, projectName); - additionalProperties.put(CodegenConstants.PACKAGE_NAME, packageName); - additionalProperties.put(CodegenConstants.PACKAGE_VERSION, packageVersion); - - if (additionalProperties.containsKey(CodegenConstants.EXCLUDE_TESTS)) { - excludeTests = Boolean.valueOf(additionalProperties.get(CodegenConstants.EXCLUDE_TESTS).toString()); - } - - Boolean generateSourceCodeOnly = false; - if (additionalProperties.containsKey(CodegenConstants.SOURCECODEONLY_GENERATION)) { - generateSourceCodeOnly = Boolean.valueOf(additionalProperties.get(CodegenConstants.SOURCECODEONLY_GENERATION).toString()); - } - - if (generateSourceCodeOnly) { - // tests in test - testFolder = packagePath() + File.separatorChar + testFolder; - // api docs in /docs/apis/tags/ - apiDocPath = packagePath() + File.separatorChar + apiDocPath; - // model docs in /docs/models/ - modelDocPath = packagePath() + File.separatorChar + modelDocPath; - } - // make api and model doc path available in templates - additionalProperties.put("apiDocPath", apiDocPath); - additionalProperties.put("modelDocPath", modelDocPath); - - if (additionalProperties.containsKey(PACKAGE_URL)) { - setPackageUrl((String) additionalProperties.get(PACKAGE_URL)); - } - - if (additionalProperties.containsKey(USE_NOSE)) { - setUseNose((String) additionalProperties.get(USE_NOSE)); - } - - if (additionalProperties.containsKey(USE_INLINE_MODEL_RESOLVER)) { - setUseInlineModelResolver((String) additionalProperties.get(USE_INLINE_MODEL_RESOLVER)); - } - - // check to see if setRecursionLimit is set and whether it's an integer - if (additionalProperties.containsKey(RECURSION_LIMIT)) { - try { - Integer.parseInt((String) additionalProperties.get(RECURSION_LIMIT)); - } catch (NumberFormatException | NullPointerException e) { - throw new IllegalArgumentException("recursionLimit must be an integer, e.g. 2000."); - } - } - - if (additionalProperties.containsKey(CodegenConstants.NON_COMPLIANT_USE_DISCR_IF_COMPOSITION_FAILS)) { - nonCompliantUseDiscrIfCompositionFails = Boolean.parseBoolean( - additionalProperties.get(CodegenConstants.NON_COMPLIANT_USE_DISCR_IF_COMPOSITION_FAILS).toString() - ); - } - - String readmePath = "README.md"; - String readmeTemplate = "README." + templateExtension; - if (generateSourceCodeOnly) { - readmePath = packagePath() + "_" + readmePath; - readmeTemplate = "README_onlypackage." + templateExtension; - } - supportingFiles.add(new SupportingFile(readmeTemplate, "", readmePath)); - - if (!generateSourceCodeOnly) { - supportingFiles.add(new SupportingFile("tox." + templateExtension, "", "tox.ini")); - supportingFiles.add(new SupportingFile("test-requirements." + templateExtension, "", "test-requirements.txt")); - supportingFiles.add(new SupportingFile("requirements." + templateExtension, "", "requirements.txt")); - supportingFiles.add(new SupportingFile("setup_cfg." + templateExtension, "", "setup.cfg")); - - supportingFiles.add(new SupportingFile("git_push.sh." + templateExtension, "", "git_push.sh")); - supportingFiles.add(new SupportingFile("gitignore." + templateExtension, "", ".gitignore")); - supportingFiles.add(new SupportingFile("travis." + templateExtension, "", ".travis.yml")); - supportingFiles.add(new SupportingFile("gitlab-ci." + templateExtension, "", ".gitlab-ci.yml")); - supportingFiles.add(new SupportingFile("setup." + templateExtension, "", "setup.py")); - } - supportingFiles.add(new SupportingFile("configuration." + templateExtension, packagePath(), "configuration.py")); - supportingFiles.add(new SupportingFile("__init__package." + templateExtension, packagePath(), "__init__.py")); - - // If the package name consists of dots(openapi.client), then we need to create the directory structure like openapi/client with __init__ files. - String[] packageNameSplits = packageName.split("\\."); - String currentPackagePath = ""; - for (int i = 0; i < packageNameSplits.length - 1; i++) { - if (i > 0) { - currentPackagePath = currentPackagePath + File.separatorChar; - } - currentPackagePath = currentPackagePath + packageNameSplits[i]; - supportingFiles.add(new SupportingFile("__init__." + templateExtension, currentPackagePath, "__init__.py")); - } - - supportingFiles.add(new SupportingFile("exceptions." + templateExtension, packagePath(), "exceptions.py")); - - if (Boolean.FALSE.equals(excludeTests)) { - supportingFiles.add(new SupportingFile("__init__." + templateExtension, testFolder, "__init__.py")); - supportingFiles.add(new SupportingFile("__init__." + templateExtension, testFolder + File.separator + "test_models", "__init__.py")); - } - - supportingFiles.add(new SupportingFile("api_client." + templateExtension, packagePath(), "api_client.py")); - - if ("asyncio".equals(getLibrary())) { - supportingFiles.add(new SupportingFile("asyncio/rest." + templateExtension, packagePath(), "rest.py")); - additionalProperties.put("asyncio", "true"); - } else if ("tornado".equals(getLibrary())) { - supportingFiles.add(new SupportingFile("tornado/rest." + templateExtension, packagePath(), "rest.py")); - additionalProperties.put("tornado", "true"); - } else { - supportingFiles.add(new SupportingFile("rest." + templateExtension, packagePath(), "rest.py")); - } - - supportingFiles.add(new SupportingFile("schemas." + templateExtension, packagePath(), "schemas.py")); - - // add the models and apis folders - supportingFiles.add(new SupportingFile("__init__models." + templateExtension, packagePath() + File.separatorChar + "models", "__init__.py")); - supportingFiles.add(new SupportingFile("__init__model." + templateExtension, packagePath() + File.separatorChar + modelPackage, "__init__.py")); - supportingFiles.add(new SupportingFile("__init__apis." + templateExtension, packagePath() + File.separatorChar + apiPackage, "__init__.py")); - // Generate the 'signing.py' module, but only if the 'HTTP signature' security scheme is specified in the OAS. - Map securitySchemeMap = openAPI != null ? - (openAPI.getComponents() != null ? openAPI.getComponents().getSecuritySchemes() : null) : null; - List authMethods = fromSecurity(securitySchemeMap); - if (ProcessUtils.hasHttpSignatureMethods(authMethods)) { - supportingFiles.add(new SupportingFile("signing." + templateExtension, packagePath(), "signing.py")); - } - - // default this to true so the python ModelSimple models will be generated - ModelUtils.setGenerateAliasAsModel(true); - LOGGER.info(CodegenConstants.GENERATE_ALIAS_AS_MODEL + " is hard coded to true in this generator. Alias models will only be generated if they contain validations or enums"); - - // check library option to ensure only urllib3 is supported - if (!DEFAULT_LIBRARY.equals(getLibrary())) { - throw new RuntimeException("Only the `urllib3` library is supported in the refactored `python` client generator at the moment. Please fall back to `python-legacy` client generator for the time being. We welcome contributions to add back `asyncio`, `tornado` support to the `python` client generator."); - } - } - - public String packageFilename(List pathSegments) { - String prefix = outputFolder + File.separatorChar + packagePath() + File.separatorChar; - String suffix = pathSegments.stream().collect(Collectors.joining(File.separator)); - return prefix + suffix; - } - - public String filenameFromRoot(List pathSegments) { - String prefix = outputFolder + File.separatorChar; - String suffix = pathSegments.stream().collect(Collectors.joining(File.separator)); - return prefix + suffix; - } - - protected File processTemplateToFile(Map templateData, String templateName, String outputFilename, boolean shouldGenerate, String skippedByOption) throws IOException { - String adjustedOutputFilename = outputFilename.replaceAll("//", "/").replace('/', File.separatorChar); - File target = new File(adjustedOutputFilename); - if (ignoreProcessor.allowsFile(target)) { - if (shouldGenerate) { - Path outDir = java.nio.file.Paths.get(this.getOutputDir()).toAbsolutePath(); - Path absoluteTarget = target.toPath().toAbsolutePath(); - if (!absoluteTarget.startsWith(outDir)) { - throw new RuntimeException(String.format(Locale.ROOT, "Target files must be generated within the output directory; absoluteTarget=%s outDir=%s", absoluteTarget, outDir)); - } - return this.templateProcessor.write(templateData,templateName, target); - } else { - this.templateProcessor.skip(target.toPath(), String.format(Locale.ROOT, "Skipped by %s options supplied by user.", skippedByOption)); - return null; - } - } else { - this.templateProcessor.ignore(target.toPath(), "Ignored by rule in ignore file."); - return null; - } - } - - @Override - public String apiFilename(String templateName, String tag) { - String suffix = apiTemplateFiles().get(templateName); - return apiFileFolder() + File.separator + toApiFilename(tag) + suffix; - } - - private void generateFiles(List> processTemplateToFileInfos, boolean shouldGenerate, String skippedByOption) { - for (List processTemplateToFileInfo: processTemplateToFileInfos) { - Map templateData = (Map) processTemplateToFileInfo.get(0); - String templateName = (String) processTemplateToFileInfo.get(1); - String outputFilename = (String) processTemplateToFileInfo.get(2); - try { - processTemplateToFile(templateData, templateName, outputFilename, shouldGenerate, skippedByOption); - } catch (IOException e) { - LOGGER.error("Error when writing template file {}", e.toString()); - } - } - } - - @Override - public String toApiName(String name) { - if (name.length() == 0) { - return "DefaultApi"; - } - return toModelName(name) + apiNameSuffix; - } - - /* - I made this method because endpoint parameters not contain a lot of needed metadata - It is very verbose to write all of this info into the api template - This ingests all operations under a tag in the objs input and writes out one file for each endpoint - */ - protected void generateEndpoints(OperationsMap objs) { - if (!(Boolean) additionalProperties.get(CodegenConstants.GENERATE_APIS)) { - return; - } - Paths paths = openAPI.getPaths(); - if (paths == null) { - return; - } - List> pathsFiles = new ArrayList<>(); - List> apisFiles = new ArrayList<>(); - List> testFiles = new ArrayList<>(); - String outputFilename; - - // endpoint tags may not exist in the root of the spec file - // this is allowed per openapi - // because spec tags may be empty ro incomplete, tags are also accumulated from endpoints - List tags = openAPI.getTags(); - if (tags != null) { - for (Tag tag: tags) { - String tagName = tag.getName(); - String tagModuleName = toApiFilename(tagName); - String apiClassname = toApiName(tagName); - tagModuleNameToApiClassname.put(tagModuleName, apiClassname); - String tagEnum = toEnumVarName(tagName, "str"); - enumToTag.put(tagEnum, tagName); - tagEnumToApiClassname.put(tagEnum, apiClassname); - } - } - - OperationMap operations = objs.getOperations(); - List codegenOperations = operations.getOperation(); - HashMap pathModuleToPath = new HashMap<>(); - // paths.some_path.post.py (single endpoint definition) - for (CodegenOperation co: codegenOperations) { - if (co.tags != null) { - for (Tag tag: co.tags) { - String tagName = tag.getName(); - String tagModuleName = toApiFilename(tagName); - String apiClassname = toApiName(tagName); - tagModuleNameToApiClassname.put(tagModuleName, apiClassname); - String tagEnum = toEnumVarName(tagName, "str"); - enumToTag.put(tagEnum, tagName); - tagEnumToApiClassname.put(tagEnum, apiClassname); - } - } - String path = co.path; - String pathModuleName = co.nickname; - if (!pathModuleToPath.containsKey(pathModuleName)) { - pathModuleToPath.put(pathModuleName, path); - } - Map endpointMap = new HashMap<>(); - endpointMap.put("operation", co); - endpointMap.put("imports", co.imports); - endpointMap.put("packageName", packageName); - outputFilename = packageFilename(Arrays.asList("paths", pathModuleName, co.httpMethod + ".py")); - pathsFiles.add(Arrays.asList(endpointMap, "endpoint.handlebars", outputFilename)); - /* - This stub file exists to allow pycharm to read and use typing.overload decorators for it to see that - dict_instance["someProp"] is of type SomeClass.properties.someProp - See https://youtrack.jetbrains.com/issue/PY-42137/PyCharm-type-hinting-doesnt-work-well-with-overload-decorator - */ - String stubOutputFilename = packageFilename(Arrays.asList("paths", pathModuleName, co.httpMethod + ".pyi")); - pathsFiles.add(Arrays.asList(endpointMap, "endpoint_stub.handlebars", stubOutputFilename)); - - Map endpointTestMap = new HashMap<>(); - endpointTestMap.put("operation", co); - endpointTestMap.put("packageName", packageName); - outputFilename = filenameFromRoot(Arrays.asList("test", "test_paths", "test_" + pathModuleName, "test_" + co.httpMethod + ".py")); - testFiles.add(Arrays.asList(endpointTestMap, "api_test.handlebars", outputFilename)); - outputFilename = filenameFromRoot(Arrays.asList("test", "test_paths", "test_" + pathModuleName, "__init__.py")); - testFiles.add(Arrays.asList(new HashMap<>(), "__init__.handlebars", outputFilename)); - } - outputFilename = filenameFromRoot(Arrays.asList("test", "test_paths", "__init__.py")); - testFiles.add(Arrays.asList(new HashMap<>(), "__init__test_paths.handlebars", outputFilename)); - - Map pathValToVar = new LinkedHashMap<>(); - Map pathModuleToApiClassname = new LinkedHashMap<>(); - Map pathEnumToApiClassname = new LinkedHashMap<>(); - for (Map.Entry pathsEntry : paths.entrySet()) { - String path = pathsEntry.getKey(); - String pathEnumVar = toEnumVarName(path, "str"); - pathValToVar.put(path, pathEnumVar); - String apiClassName = toModelName(path); - pathEnumToApiClassname.put(pathEnumVar, apiClassName); - pathModuleToApiClassname.put(toVarName(path), apiClassName); - } - // Note: __init__apis.handlebars is generated as a supporting file - // apis.tag_to_api.py - Map tagToApiMap = new HashMap<>(); - tagToApiMap.put("packageName", packageName); - tagToApiMap.put("apiClassname", "Api"); - tagToApiMap.put("tagModuleNameToApiClassname", tagModuleNameToApiClassname); - tagToApiMap.put("tagEnumToApiClassname", tagEnumToApiClassname); - outputFilename = packageFilename(Arrays.asList("apis", "tag_to_api.py")); - apisFiles.add(Arrays.asList(tagToApiMap, "apis_tag_to_api.handlebars", outputFilename)); - // apis.path_to_api.py - Map allByPathsFileMap = new HashMap<>(); - allByPathsFileMap.put("packageName", packageName); - allByPathsFileMap.put("apiClassname", "Api"); - allByPathsFileMap.put("pathModuleToApiClassname", pathModuleToApiClassname); - allByPathsFileMap.put("pathEnumToApiClassname", pathEnumToApiClassname); - outputFilename = packageFilename(Arrays.asList("apis", "path_to_api.py")); - apisFiles.add(Arrays.asList(allByPathsFileMap, "apis_path_to_api.handlebars", outputFilename)); - // apis.paths.__init__.py - Map initApiTagsMap = new HashMap<>(); - initApiTagsMap.put("packageName", packageName); - initApiTagsMap.put("enumToTag", enumToTag); - outputFilename = packageFilename(Arrays.asList("apis", "tags", "__init__.py")); - apisFiles.add(Arrays.asList(initApiTagsMap, "__init__apis_tags.handlebars", outputFilename)); - - // paths.__init__.py (contains path str enum) - Map initOperationMap = new HashMap<>(); - initOperationMap.put("packageName", packageName); - initOperationMap.put("apiClassname", "Api"); - initOperationMap.put("pathValToVar", pathValToVar); - outputFilename = packageFilename(Arrays.asList("paths", "__init__.py")); - pathsFiles.add(Arrays.asList(initOperationMap, "__init__paths_enum.handlebars", outputFilename)); - // apis.paths.__init__.py - outputFilename = packageFilename(Arrays.asList("apis", "paths", "__init__.py")); - apisFiles.add(Arrays.asList(initOperationMap, "__init__paths.handlebars", outputFilename)); - // paths.some_path.__init__.py - // apis.paths.some_path.py - for (Map.Entry entry: pathModuleToPath.entrySet()) { - String pathModule = entry.getKey(); - String path = entry.getValue(); - String pathVar = pathValToVar.get(path); - Map pathApiMap = new HashMap<>(); - pathApiMap.put("packageName", packageName); - pathApiMap.put("pathModule", pathModule); - pathApiMap.put("apiClassName", "Api"); - pathApiMap.put("pathVar", pathVar); - outputFilename = packageFilename(Arrays.asList("paths", pathModule, "__init__.py")); - pathsFiles.add(Arrays.asList(pathApiMap, "__init__paths_x.handlebars", outputFilename)); - - PathItem pi = openAPI.getPaths().get(path); - String apiClassName = pathEnumToApiClassname.get(pathVar); - Map operationMap = new HashMap<>(); - operationMap.put("packageName", packageName); - operationMap.put("pathModule", pathModule); - operationMap.put("apiClassName", apiClassName); - operationMap.put("pathItem", pi); - outputFilename = packageFilename(Arrays.asList("apis", "paths", pathModule + ".py")); - apisFiles.add(Arrays.asList(operationMap, "apis_path_module.handlebars", outputFilename)); - } - boolean shouldGenerateApis = (boolean) additionalProperties().get(CodegenConstants.GENERATE_APIS); - boolean shouldGenerateApiTests = (boolean) additionalProperties().get(CodegenConstants.GENERATE_API_TESTS); - generateFiles(pathsFiles, shouldGenerateApis, CodegenConstants.APIS); - generateFiles(apisFiles, shouldGenerateApis, CodegenConstants.APIS); - generateFiles(testFiles, shouldGenerateApiTests, CodegenConstants.API_TESTS); - } - - /* - We have a custom version of this method so for composed schemas and object schemas we add properties only if they - are defined in that schema (x.properties). We do this because validation should be done independently in each schema - If properties are hosted into composed schemas, they can collide or incorrectly list themself as required when - they are not. - */ - @Override - protected void addVarsRequiredVarsAdditionalProps(Schema schema, IJsonSchemaValidationProperties property){ - setAddProps(schema, property); - if (ModelUtils.isAnyType(schema) && supportsAdditionalPropertiesWithComposedSchema) { - // if anyType schema has properties then add them - if (schema.getProperties() != null && !schema.getProperties().isEmpty()) { - if (schema instanceof ComposedSchema) { - ComposedSchema cs = (ComposedSchema) schema; - if (cs.getOneOf() != null && !cs.getOneOf().isEmpty()) { - LOGGER.warn("'oneOf' is intended to include only the additional optional OAS extension discriminator object. " + - "For more details, see https://json-schema.org/draft/2019-09/json-schema-core.html#rfc.section.9.2.1.3 and the OAS section on 'Composition and Inheritance'."); - } - } - HashSet requiredVars = new HashSet<>(); - if (schema.getRequired() != null) { - requiredVars.addAll(schema.getRequired()); - } - addVars(property, property.getVars(), schema.getProperties(), requiredVars); - } - addRequiredVarsMap(schema, property); - return; - } else if (ModelUtils.isTypeObjectSchema(schema)) { - HashSet requiredVars = new HashSet<>(); - if (schema.getRequired() != null) { - requiredVars.addAll(schema.getRequired()); - property.setHasRequired(true); - } - addVars(property, property.getVars(), schema.getProperties(), requiredVars); - if (property.getVars() != null && !property.getVars().isEmpty()) { - property.setHasVars(true); - } - } - addRequiredVarsMap(schema, property); - return; - } - - /** - * Configures a friendly name for the generator. This will be used by the - * generator to select the library with the -g flag. - * - * @return the friendly name for the generator - */ - @Override - public String getName() { - return "python"; - } - - @Override - public String getHelp() { - String newLine = System.getProperty("line.separator"); - return String.join("
    ", - "Generates a Python client library", - "", - "Features in this generator:", - "- type hints on endpoints and model creation", - "- model parameter names use the spec defined keys and cases", - "- robust composition (oneOf/anyOf/allOf/not) where payload data is stored in one instance only", - "- endpoint parameter names use the spec defined keys and cases", - "- inline schemas are supported at any location including composition", - "- multiple content types supported in request body and response bodies", - "- run time type checking", - "- Sending/receiving decimals as strings supported with type:string format: number -> DecimalSchema", - "- Sending/receiving uuids as strings supported with type:string format: uuid -> UUIDSchema", - "- quicker load time for python modules (a single endpoint can be imported and used without loading others)", - "- all instances of schemas dynamically inherit from all matching schemas so one can use isinstance to check if validation passed", - "- composed schemas with type constraints supported (type:object + oneOf/anyOf/allOf)", - "- schemas are not coerced/cast. For example string + date are both stored as string, and there is a date accessor", - " - Exceptions: int/float is stored as Decimal, When receiving data from headers it will start as str and may need to be cast for example to int"); - } - - @Override - public Schema unaliasSchema(Schema schema) { - Map allSchemas = ModelUtils.getSchemas(openAPI); - if (allSchemas == null || allSchemas.isEmpty()) { - // skip the warning as the spec can have no model defined - //LOGGER.warn("allSchemas cannot be null/empty in unaliasSchema. Returned 'schema'"); - return schema; - } - - if (schema != null && StringUtils.isNotEmpty(schema.get$ref())) { - String simpleRef = ModelUtils.getSimpleRef(schema.get$ref()); - if (schemaMapping.containsKey(simpleRef)) { - LOGGER.debug("Schema unaliasing of {} omitted because aliased class is to be mapped to {}", simpleRef, schemaMapping.get(simpleRef)); - return schema; - } - Schema ref = allSchemas.get(simpleRef); - if (ref == null) { - once(LOGGER).warn("{} is not defined", schema.get$ref()); - return schema; - } else if (ref.getEnum() != null && !ref.getEnum().isEmpty()) { - // top-level enum class - return schema; - } else if (ModelUtils.isArraySchema(ref)) { - if (ModelUtils.isGenerateAliasAsModel(ref)) { - return schema; // generate a model extending array - } else { - return unaliasSchema(allSchemas.get(ModelUtils.getSimpleRef(schema.get$ref()))); - } - } else if (ModelUtils.isComposedSchema(ref)) { - return schema; - } else if (ModelUtils.isMapSchema(ref)) { - if (ref.getProperties() != null && !ref.getProperties().isEmpty()) // has at least one property - return schema; // treat it as model - else { - if (ModelUtils.isGenerateAliasAsModel(ref)) { - return schema; // generate a model extending map - } else { - // treat it as a typical map - return unaliasSchema(allSchemas.get(ModelUtils.getSimpleRef(schema.get$ref()))); - } - } - } else if (ModelUtils.isObjectSchema(ref)) { // model - if (ref.getProperties() != null && !ref.getProperties().isEmpty()) { // has at least one property - return schema; - } else { - // free form object (type: object) - if (ModelUtils.hasValidation(ref)) { - return schema; - } else if (getAllOfDescendants(simpleRef, openAPI).size() > 0) { - return schema; - } - return unaliasSchema(allSchemas.get(ModelUtils.getSimpleRef(schema.get$ref()))); - } - } else if (ModelUtils.hasValidation(ref)) { - // non object non array non map schemas that have validations - // are returned so we can generate those schemas as models - // we do this to: - // - preserve the validations in that model class in python - // - use those validations when we use this schema in composed oneOf schemas - return schema; - } else if (Boolean.TRUE.equals(ref.getNullable()) && ref.getEnum() == null) { - // non enum primitive with nullable True - // we make these models so instances of this will be subclasses of this model - return schema; - } else { - return unaliasSchema(allSchemas.get(ModelUtils.getSimpleRef(schema.get$ref()))); - } - } - return schema; - } - - public String pythonDate(Object dateValue) { - String strValue = null; - if (dateValue instanceof OffsetDateTime) { - OffsetDateTime date = null; - try { - date = (OffsetDateTime) dateValue; - } catch (ClassCastException e) { - LOGGER.warn("Invalid `date` format for value {}", dateValue.toString()); - date = ((Date) dateValue).toInstant().atOffset(ZoneOffset.UTC); - } - strValue = date.format(iso8601Date); - } else { - strValue = dateValue.toString(); - } - return strValue; - } - - public String pythonDateTime(Object dateTimeValue) { - String strValue = null; - if (dateTimeValue instanceof OffsetDateTime) { - OffsetDateTime dateTime = null; - try { - dateTime = (OffsetDateTime) dateTimeValue; - } catch (ClassCastException e) { - LOGGER.warn("Invalid `date-time` format for value {}", dateTimeValue.toString()); - dateTime = ((Date) dateTimeValue).toInstant().atOffset(ZoneOffset.UTC); - } - strValue = dateTime.format(iso8601DateTime); - } else { - strValue = dateTimeValue.toString(); - } - return strValue; - } - - /** - * Return the default value of the property - * - * @param p OpenAPI property object - * @return string presentation of the default value of the property - */ - @Override - public String toDefaultValue(Schema p) { - Object defaultObject = null; - if (p.getDefault() != null) { - defaultObject = p.getDefault(); - } - - if (defaultObject == null) { - return null; - } - - String defaultValue = defaultObject.toString(); - if (ModelUtils.isDateSchema(p)) { - defaultValue = pythonDate(defaultObject); - } else if (ModelUtils.isDateTimeSchema(p)) { - defaultValue = pythonDateTime(defaultObject); - } else if (ModelUtils.isStringSchema(p) && !ModelUtils.isByteArraySchema(p) && !ModelUtils.isBinarySchema(p) && !ModelUtils.isFileSchema(p) && !ModelUtils.isUUIDSchema(p) && !ModelUtils.isEmailSchema(p)) { - defaultValue = ensureQuotes(defaultValue); - } else if (ModelUtils.isBooleanSchema(p)) { - if (Boolean.valueOf(defaultValue) == false) { - defaultValue = "False"; - } else { - defaultValue = "True"; - } - } - return defaultValue; - } - - @Override - public String toModelImport(String name) { - // name looks like Cat - return "from " + packageName + "." + modelPackage() + "." + toModelFilename(name) + " import " + toModelName(name); - } - - @Override - @SuppressWarnings("static-method") - public OperationsMap postProcessOperationsWithModels(OperationsMap objs, List allModels) { - // fix the imports that each model has, add the module reference to the model - // loops through imports and converts them all - // from 'Pet' to 'from petstore_api.model.pet import Pet' - - OperationMap val = objs.getOperations(); - List operations = val.getOperation(); - for (CodegenOperation operation : operations) { - if (operation.imports.size() == 0) { - continue; - } - String[] modelNames = operation.imports.toArray(new String[0]); - operation.imports.clear(); - for (String modelName : modelNames) { - operation.imports.add(toModelImport(modelName)); - } - } - generateEndpoints(objs); - return objs; - } - - /*** - * Override with special post-processing for all models. - * we have a custom version of this method to: - * - remove any primitive models that do not contain validations - * these models are unaliased as inline definitions wherever the spec has them as refs - * this means that the generated client does not use these models - * because they are not used we do not write them - * - fix the model imports, go from model name to the full import string with toModelImport + globalImportFixer - * Also cleans the test folder if test cases exist and the testFolder is set because the tests are autogenerated - * - * @param objs a map going from the model name to a object hoding the model info - * @return the updated objs - */ - @Override - public Map postProcessAllModels(Map objs) { - super.postProcessAllModels(objs); - - boolean anyModelContainsTestCases = false; - Map allDefinitions = ModelUtils.getSchemas(this.openAPI); - for (String schemaName : allDefinitions.keySet()) { - String modelName = toModelName(schemaName); - ModelsMap objModel = objs.get(modelName); - if (objModel == null) { - // to avoid form parameter's models that are not generated (skipFormModel=true) - continue; - } - for (ModelMap model : objModel.getModels()) { - CodegenModel cm = model.getModel(); - if (cm.testCases != null && !cm.testCases.isEmpty()) { - anyModelContainsTestCases = true; - } - String[] importModelNames = cm.imports.toArray(new String[0]); - cm.imports.clear(); - for (String importModelName : importModelNames) { - cm.imports.add(toModelImport(importModelName)); - } - } - } - boolean testFolderSet = testFolder != null; - if (testFolderSet && anyModelContainsTestCases) { - // delete the test folder because tests there will be autogenerated - String testPath = outputFolder + File.separatorChar + testFolder; - File testDirectory = new File(testPath); - try { - FileUtils.cleanDirectory(testDirectory); - } catch (IOException e) { - LOGGER.info("Unable to delete the test folder because of exception=" + e.toString()); - } - - } - - return objs; - } - - public CodegenParameter fromParameter(Parameter parameter, Set imports) { - CodegenParameter cp = super.fromParameter(parameter, imports); - if (parameter.getStyle() != null) { - switch(parameter.getStyle()) { - case MATRIX: - cp.style = "MATRIX"; - break; - case LABEL: - cp.style = "LABEL"; - break; - case FORM: - cp.style = "FORM"; - break; - case SIMPLE: - cp.style = "SIMPLE"; - break; - case SPACEDELIMITED: - cp.style = "SPACE_DELIMITED"; - break; - case PIPEDELIMITED: - cp.style = "PIPE_DELIMITED"; - break; - case DEEPOBJECT: - cp.style = "DEEP_OBJECT"; - break; - } - } - // clone this so we can change some properties on it - CodegenProperty schemaProp = cp.getSchema(); - // parameters may have valid python names like some_val or invalid ones like Content-Type - // we always set nameInSnakeCase to null so special handling will not be done for these names - // invalid python names will be handled in python by using a TypedDict which will allow us to have a type hint - // for keys that cannot be variable names to the schema baseName - if (schemaProp != null) { - schemaProp = schemaProp.clone(); - schemaProp.nameInSnakeCase = null; - schemaProp.baseName = toModelName(cp.baseName) + "Schema"; - cp.setSchema(schemaProp); - } - return cp; - } - - private boolean isValidPythonVarOrClassName(String name) { - return name.matches("^[_a-zA-Z][_a-zA-Z0-9]*$"); - } - - - /** - * Convert OAS Property object to Codegen Property object - * We have a custom version of this method to always set allowableValues.enumVars on all enum variables - * Together with unaliasSchema this sets primitive types with validations as models - * This method is used by fromResponse - * - * @param name name of the property - * @param p OAS property schema - * @param required true if the property is required in the next higher object schema, false otherwise - * @param schemaIsFromAdditionalProperties true if the property is defined by additional properties schema - * @return Codegen Property object - */ - @Override - public CodegenProperty fromProperty(String name, Schema p, boolean required, boolean schemaIsFromAdditionalProperties) { - // fix needed for values with /n /t etc in them - String fixedName = handleSpecialCharacters(name); - CodegenProperty cp = super.fromProperty(fixedName, p, required, schemaIsFromAdditionalProperties); - - if (cp.isAnyType && cp.isNullable) { - cp.isNullable = false; - } - if (cp.isNullable && cp.complexType == null) { - cp.setIsNull(true); - cp.isNullable = false; - cp.setHasMultipleTypes(true); - } - if (p.getPattern() != null) { - postProcessPattern(p.getPattern(), cp.vendorExtensions); - } - // if we have a property that has a difficult name, either: - // 1. name is reserved, like class int float - // 2. name is invalid in python like '3rd' or 'Content-Type' - // set cp.nameInSnakeCase to a value so we can tell that we are in this use case - // we handle this in the schema templates - // templates use its presence to handle these badly named variables / keys - if ((isReservedWord(cp.baseName) || !isValidPythonVarOrClassName(cp.baseName)) && !cp.baseName.equals(cp.name)) { - cp.nameInSnakeCase = cp.name; - } else { - cp.nameInSnakeCase = null; - } - if (cp.isEnum) { - updateCodegenPropertyEnum(cp); - } - Schema unaliasedSchema = unaliasSchema(p); - if (cp.isPrimitiveType && unaliasedSchema.get$ref() != null) { - cp.complexType = cp.dataType; - } - return cp; - } - - /** - * checks if the data should be classified as "string" in enum - * e.g. double in C# needs to be double-quoted (e.g. "2.8") by treating it as a string - * In the future, we may rename this function to "isEnumString" - * - * @param dataType data type - * @return true if it's a enum string - */ - @Override - public boolean isDataTypeString(String dataType) { - return "str".equals(dataType); - } - - public String getItemsName(Schema containingSchema, String containingSchemaName) { - return "items"; - } - - /** - * Update codegen property's enum by adding "enumVars" (with name and value) - * - * @param var list of CodegenProperty - */ - @Override - public void updateCodegenPropertyEnum(CodegenProperty var) { - // we have a custom version of this method to omit overwriting the defaultValue - Map allowableValues = var.allowableValues; - - // handle array - if (var.mostInnerItems != null) { - allowableValues = var.mostInnerItems.allowableValues; - } - - if (allowableValues == null) { - return; - } - - List values = (List) allowableValues.get("values"); - if (values == null) { - return; - } - - String varDataType = var.mostInnerItems != null ? var.mostInnerItems.dataType : var.dataType; - Schema referencedSchema = getModelNameToSchemaCache().get(varDataType); - String dataType = (referencedSchema != null) ? getTypeDeclaration(referencedSchema) : varDataType; - - // put "enumVars" map into `allowableValues", including `name` and `value` - List> enumVars = buildEnumVars(values, dataType); - - // if "x-enum-varnames" or "x-enum-descriptions" defined, update varnames - Map extensions = var.mostInnerItems != null ? var.mostInnerItems.getVendorExtensions() : var.getVendorExtensions(); - if (referencedSchema != null) { - extensions = referencedSchema.getExtensions(); - } - updateEnumVarsWithExtensions(enumVars, extensions, dataType); - allowableValues.put("enumVars", enumVars); - // overwriting defaultValue omitted from here - } - - /*** - * We have a custom version of this method to produce links to models when they are - * primitive type (not map, not array, not object) and include validations or are enums - * - * @param body requesst body - * @param imports import collection - * @param bodyParameterName body parameter name - * @return the resultant CodegenParameter - */ - @Override - public CodegenParameter fromRequestBody(RequestBody body, Set imports, String bodyParameterName) { - CodegenParameter cp = super.fromRequestBody(body, imports, bodyParameterName); - cp.baseName = "body"; - Schema schema = ModelUtils.getSchemaFromRequestBody(body); - if (schema.get$ref() == null) { - return cp; - } - Schema unaliasedSchema = unaliasSchema(schema); - CodegenProperty unaliasedProp = fromProperty("body", unaliasedSchema, false); - Boolean dataTypeMismatch = !cp.dataType.equals(unaliasedProp.dataType); - Boolean baseTypeMismatch = !cp.baseType.equals(unaliasedProp.complexType) && unaliasedProp.complexType != null; - if (dataTypeMismatch || baseTypeMismatch) { - cp.dataType = unaliasedProp.dataType; - cp.baseType = unaliasedProp.complexType; - } - return cp; - } - - /*** - * Adds the body model schema to the body parameter - * We have a custom version of this method so we can flip forceSimpleRef - * to True based upon the results of unaliasSchema - * With this customization, we ensure that when schemas are passed to getSchemaType - * - if they have ref in them they are a model - * - if they do not have ref in them they are not a model - * and code is also customized to allow anyType request body schemas - * - * @param codegenParameter the body parameter - * @param name model schema ref key in components - * @param schema the model schema (not refed) - * @param imports collection of imports - * @param bodyParameterName body parameter name - * @param forceSimpleRef if true use a model reference - */ - @Override - protected void addBodyModelSchema(CodegenParameter codegenParameter, String name, Schema schema, Set imports, String bodyParameterName, boolean forceSimpleRef) { - if (name != null) { - Schema bodySchema = new Schema().$ref("#/components/schemas/" + name); - Schema unaliased = unaliasSchema(bodySchema); - if (unaliased.get$ref() != null) { - forceSimpleRef = true; - } - } - - CodegenModel codegenModel = null; - if (StringUtils.isNotBlank(name)) { - schema.setName(name); - codegenModel = fromModel(name, schema); - } - - if (codegenModel != null && (codegenModel.hasVars || forceSimpleRef)) { - if (StringUtils.isEmpty(bodyParameterName)) { - codegenParameter.baseName = codegenModel.classname; - } else { - codegenParameter.baseName = bodyParameterName; - } - codegenParameter.paramName = toParamName(codegenParameter.baseName); - codegenParameter.baseType = codegenModel.classname; - codegenParameter.dataType = getTypeDeclaration(codegenModel.classname); - codegenParameter.description = codegenModel.description; - codegenParameter.isNullable = codegenModel.isNullable; - } else { - CodegenProperty codegenProperty = fromProperty("property", schema, false); - - if (ModelUtils.isMapSchema(schema)) {// http body is map - // LOGGER.error("Map should be supported. Please report to openapi-generator github repo about the issue."); - } else if (codegenProperty != null) { - String codegenModelName, codegenModelDescription; - - if (codegenModel != null) { - codegenModelName = codegenModel.classname; - codegenModelDescription = codegenModel.description; - } else { - codegenModelName = "anyType"; - codegenModelDescription = ""; - } - - if (StringUtils.isEmpty(bodyParameterName)) { - codegenParameter.baseName = codegenModelName; - } else { - codegenParameter.baseName = bodyParameterName; - } - - codegenParameter.paramName = toParamName(codegenParameter.baseName); - codegenParameter.baseType = codegenModelName; - codegenParameter.dataType = getTypeDeclaration(codegenModelName); - codegenParameter.description = codegenModelDescription; - } - - // set nullable - setParameterNullable(codegenParameter, codegenProperty); - } - - } - - - /** - * Return the sanitized variable name for enum - * - * @param value enum variable name - * @param datatype data type - * @return the sanitized variable name for enum - */ - public String toEnumVarName(String value, String datatype) { - // our enum var names are keys in a python dict, so change spaces to underscores - if (value.length() == 0) { - return "EMPTY"; - } else if (value.equals("null")) { - return "NONE"; - } - - String intPattern = "^[-\\+]?\\d+$"; - String floatPattern = "^[-\\+]?\\d+\\.\\d+$"; - Boolean intMatch = Pattern.matches(intPattern, value); - Boolean floatMatch = Pattern.matches(floatPattern, value); - if (intMatch || floatMatch) { - String plusSign = "^\\+.+"; - String negSign = "^-.+"; - if (Pattern.matches(plusSign, value)) { - value = value.replace("+", "POSITIVE_"); - } else if (Pattern.matches(negSign, value)) { - value = value.replace("-", "NEGATIVE_"); - } else { - value = "POSITIVE_" + value; - } - if (floatMatch) { - value = value.replace(".", "_PT_"); - } - return value; - } - // Replace " " with _ - String usedValue = value.replaceAll("\\s+", "_"); - // strip first character if it is invalid - int lengthBeforeFirstCharStrip = usedValue.length(); - Character firstChar = usedValue.charAt(0); - usedValue = usedValue.replaceAll("^[^_a-zA-Z]", ""); - boolean firstCharStripped = usedValue.length() == lengthBeforeFirstCharStrip - 1; - // Replace / with _ for path enums - usedValue = usedValue.replaceAll("/", "_"); - // Replace . with _ for tag enums - usedValue = usedValue.replaceAll("\\.", "_"); - // add underscore at camelCase locations - String regex = "([a-z])([A-Z]+)"; - String replacement = "$1_$2"; - usedValue = usedValue.replaceAll(regex, replacement); - // Replace invalid characters with empty space - usedValue = usedValue.replaceAll("[^_a-zA-Z0-9]*", ""); - // uppercase - usedValue = usedValue.toUpperCase(Locale.ROOT); - - if (usedValue.length() == 0) { - for (int i = 0; i < value.length(); i++){ - Character c = value.charAt(i); - String charName = Character.getName(c.hashCode()); - usedValue += charNameToVarName(charName); - } - // remove trailing _ - usedValue = usedValue.replaceAll("[_]$", ""); - } - // check first character to see if it is valid - // if not then add a valid prefix - boolean validFirstChar = Pattern.matches("^[_a-zA-Z]", usedValue.substring(0,1)); - if (!validFirstChar && firstCharStripped) { - String charName = Character.getName(firstChar.hashCode()); - usedValue = charNameToVarName(charName) + "_" + usedValue; - } - - return usedValue; - } - - /** - * Replace - and " " with _ - * Remove SIGN - * - * @param charName - * @return - */ - private String charNameToVarName(String charName) { - String varName = charName.replaceAll("[\\-\\s]", "_"); - varName = varName.replaceAll("SIGN", ""); - return varName; - } - - protected List> buildEnumVars(List values, String dataType) { - List> enumVars = new ArrayList<>(); - int truncateIdx = 0; - - if (isRemoveEnumValuePrefix()) { - String commonPrefix = findCommonPrefixOfVars(values); - truncateIdx = commonPrefix.length(); - } - - for (Object value : values) { - Map enumVar = new HashMap<>(); - String enumName; - if (truncateIdx == 0) { - enumName = String.valueOf(value); - } else { - enumName = value.toString().substring(truncateIdx); - if (enumName.isEmpty()) { - enumName = value.toString(); - } - } - - enumVar.put("name", toEnumVarName(enumName, dataType)); - if (value instanceof Integer) { - enumVar.put("value", value); - } else if (value instanceof Double) { - enumVar.put("value", value); - } else if (value instanceof Long) { - enumVar.put("value", value); - } else if (value instanceof Float) { - enumVar.put("value", value); - } else if (value instanceof BigDecimal) { - enumVar.put("value", value); - } else if (value == null) { - enumVar.put("value", "schemas.NoneClass.NONE"); - } else if (value instanceof Boolean) { - if (value.equals(Boolean.TRUE)) { - enumVar.put("value", "schemas.BoolClass.TRUE"); - } else { - enumVar.put("value", "schemas.BoolClass.FALSE"); - } - } else { - String fixedValue = (String) processTestExampleData(value); - enumVar.put("value", ensureQuotes(fixedValue)); - } - enumVar.put("isString", isDataTypeString(dataType)); - enumVars.add(enumVar); - } - - if (enumUnknownDefaultCase) { - // If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response. - // With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case. - Map enumVar = new HashMap<>(); - String enumName = enumUnknownDefaultCaseName; - - String enumValue; - if (isDataTypeString(dataType)) { - enumValue = enumUnknownDefaultCaseName; - } else { - // This is a dummy value that attempts to avoid collisions with previously specified cases. - // Int.max / 192 - // The number 192 that is used to calculate this random value, is the Swift Evolution proposal for frozen/non-frozen enums. - // [SE-0192](https://github.com/apple/swift-evolution/blob/master/proposals/0192-non-exhaustive-enums.md) - // Since this functionality was born in the Swift 5 generator and latter on broth to all generators - // https://github.com/OpenAPITools/openapi-generator/pull/11013 - enumValue = String.valueOf(11184809); - } - - enumVar.put("name", toEnumVarName(enumName, dataType)); - enumVar.put("value", toEnumValue(enumValue, dataType)); - enumVar.put("isString", isDataTypeString(dataType)); - enumVars.add(enumVar); - } - - return enumVars; - } - - @Override - public void postProcessParameter(CodegenParameter p) { - postProcessPattern(p.pattern, p.vendorExtensions); - if (p.baseType != null && languageSpecificPrimitives.contains(p.baseType)) { - // set baseType to null so the api docs will not point to a model for languageSpecificPrimitives - p.baseType = null; - } - } - - /** - * Sets the value of the 'model.parent' property in CodegenModel - * We have a custom version of this function so we can add the dataType on the ArrayModel - */ - @Override - protected void addParentContainer(CodegenModel model, String name, Schema schema) { - super.addParentContainer(model, name, schema); - - List referencedModelNames = new ArrayList(); - model.dataType = getTypeString(schema, "", "", referencedModelNames); - } - - protected String toTestCaseName(String specTestCaseName) { - return CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, specTestCaseName); - } - - protected String handleSpecialCharacters(String value) { - // handles escape characters and the like - String stringValue = value; - String backslash = "\\"; - if (stringValue.contains(backslash)) { - stringValue = stringValue.replace(backslash, "\\\\"); - } - String nullChar = "\0"; - if (stringValue.contains(nullChar)) { - stringValue = stringValue.replace(nullChar, "\\x00"); - } - String doubleQuoteChar = "\""; - if (stringValue.contains(doubleQuoteChar)) { - stringValue = stringValue.replace(doubleQuoteChar, "\\\""); - } - String lineSep = System.lineSeparator(); - if (stringValue.contains(lineSep)) { - stringValue = stringValue.replace(lineSep, "\\n"); - } - String carriageReturn = "\r"; - if (stringValue.contains(carriageReturn)) { - stringValue = stringValue.replace(carriageReturn, "\\r"); - } - String tab = "\t"; - if (stringValue.contains(tab)) { - stringValue = stringValue.replace(tab, "\\t"); - } - String formFeed = "\f"; - if (stringValue.contains(formFeed)) { - stringValue = stringValue.replace(formFeed, "\\f"); - } - return stringValue; - } - - protected Object processTestExampleData(Object value) { - if (value instanceof Integer){ - return value; - } else if (value instanceof Double || value instanceof Float || value instanceof Boolean){ - return value; - } else if (value instanceof String) { - return handleSpecialCharacters((String) value); - } else if (value instanceof LinkedHashMap) { - LinkedHashMap fixedValues = new LinkedHashMap(); - for (Map.Entry entry: ((LinkedHashMap) value).entrySet()) { - String entryKey = (String) processTestExampleData(entry.getKey()); - Object entryValue = processTestExampleData(entry.getValue()); - fixedValues.put(entryKey, entryValue); - } - return fixedValues; - } else if (value instanceof ArrayList) { - ArrayList fixedValues = (ArrayList) value; - for (int i = 0; i < fixedValues.size(); i++) { - Object item = processTestExampleData(fixedValues.get(i)); - fixedValues.set(i, item); - } - return fixedValues; - } else if (value == null) { - return value; - } - return value; - } - - /** - * Convert OAS Model object to Codegen Model object - * We have a custom version of this method so we can: - * - set the correct regex values for requiredVars + optionalVars - * - set model.defaultValue and model.hasRequired per the three use cases defined in this method - * - * @param name the name of the model - * @param sc OAS Model object - * @return Codegen Model object - */ - @Override - public CodegenModel fromModel(String name, Schema sc) { - CodegenModel cm = super.fromModel(name, sc); - if (sc.getPattern() != null) { - postProcessPattern(sc.getPattern(), cm.vendorExtensions); - String pattern = (String) cm.vendorExtensions.get("x-regex"); - cm.setPattern(pattern); - } - if (cm.isNullable) { - cm.setIsNull(true); - cm.isNullable = false; - cm.setHasMultipleTypes(true); - } - Boolean isNotPythonModelSimpleModel = (ModelUtils.isComposedSchema(sc) || ModelUtils.isObjectSchema(sc) || ModelUtils.isMapSchema(sc)); - if (isNotPythonModelSimpleModel) { - return cm; - } - String defaultValue = toDefaultValue(sc); - if (sc.getDefault() != null) { - cm.defaultValue = defaultValue; - } - return cm; - } - - /** - * Returns the python type for the property. - * - * @param schema property schema - * @return string presentation of the type - **/ - @SuppressWarnings("static-method") - @Override - public String getSchemaType(Schema schema) { - String openAPIType = getSingleSchemaType(schema); - if (typeMapping.containsKey(openAPIType)) { - String type = typeMapping.get(openAPIType); - return type; - } - return toModelName(openAPIType); - } - - public String getModelName(Schema sc) { - if (sc.get$ref() != null) { - Schema unaliasedSchema = unaliasSchema(sc); - if (unaliasedSchema.get$ref() != null) { - return toModelName(ModelUtils.getSimpleRef(sc.get$ref())); - } - } - return null; - } - - /** - * Return a string representation of the Python types for the specified OAS schema. - * Primitive types in the OAS specification are implemented in Python using the corresponding - * Python primitive types. - * Composed types (e.g. allAll, oneOf, anyOf) are represented in Python using list of types. - *

    - * The caller should set the prefix and suffix arguments to empty string, except when - * getTypeString invokes itself recursively. A non-empty prefix/suffix may be specified - * to wrap the return value in a python dict, list or tuple. - *

    - * Examples: - * - "bool, date, float" The data must be a bool, date or float. - * - "[bool, date]" The data must be an array, and the array items must be a bool or date. - * - * @param p The OAS schema. - * @param prefix prepended to the returned value. - * @param suffix appended to the returned value. - * @param referencedModelNames a list of models that are being referenced while generating the types, - * may be used to generate imports. - * @return a comma-separated string representation of the Python types - */ - private String getTypeString(Schema p, String prefix, String suffix, List referencedModelNames) { - String fullSuffix = suffix; - if (")".equals(suffix)) { - fullSuffix = "," + suffix; - } - if (StringUtils.isNotEmpty(p.get$ref())) { - // The input schema is a reference. If the resolved schema is - // a composed schema, convert the name to a Python class. - Schema unaliasedSchema = unaliasSchema(p); - if (unaliasedSchema.get$ref() != null) { - String modelName = toModelName(ModelUtils.getSimpleRef(p.get$ref())); - if (referencedModelNames != null) { - referencedModelNames.add(modelName); - } - return prefix + modelName + fullSuffix; - } - } - if (ModelUtils.isAnyType(p)) { - return prefix + "bool, date, datetime, dict, float, int, list, str, none_type" + suffix; - } - // Resolve $ref because ModelUtils.isXYZ methods do not automatically resolve references. - if (ModelUtils.isNullable(ModelUtils.getReferencedSchema(this.openAPI, p))) { - fullSuffix = ", none_type" + suffix; - } - if (ModelUtils.isNumberSchema(p)) { - return prefix + "int, float" + fullSuffix; - } else if (ModelUtils.isTypeObjectSchema(p)) { - if (p.getAdditionalProperties() != null && p.getAdditionalProperties().equals(false)) { - if (p.getProperties() == null) { - // type object with no properties and additionalProperties = false, empty dict only - return prefix + "{str: typing.Any}" + fullSuffix; - } else { - // properties only - // TODO add type hints for those properties only as values - return prefix + "{str: typing.Any}" + fullSuffix; - } - } else { - // additionalProperties exists - Schema inner = getAdditionalProperties(p); - return prefix + "{str: " + getTypeString(inner, "(", ")", referencedModelNames) + "}" + fullSuffix; - // TODO add code here to add property values too if they exist - } - } else if (ModelUtils.isArraySchema(p)) { - ArraySchema ap = (ArraySchema) p; - Schema inner = ap.getItems(); - if (inner == null) { - // In OAS 3.0.x, the array "items" attribute is required. - // In OAS >= 3.1, the array "items" attribute is optional such that the OAS - // specification is aligned with the JSON schema specification. - // When "items" is not specified, the elements of the array may be anything at all. - // In that case, the return value should be: - // "[bool, date, datetime, dict, float, int, list, str, none_type]" - // Using recursion to wrap the allowed python types in an array. - Schema anyType = new Schema(); // A Schema without any attribute represents 'any type'. - return getTypeString(anyType, "[", "]", referencedModelNames); - } else { - return prefix + getTypeString(inner, "[", "]", referencedModelNames) + fullSuffix; - } - } else if (ModelUtils.isFileSchema(p)) { - return prefix + "file_type" + fullSuffix; - } - String baseType = getSchemaType(p); - return prefix + baseType + fullSuffix; - } - - /** - * Output the type declaration of a given name - * - * @param p property schema - * @return a string presentation of the type - */ - @Override - public String getTypeDeclaration(Schema p) { - // this is used to set dataType, which defines a python tuple of classes - // in Python we will wrap this in () to make it a tuple but here we - // will omit the parens so the generated documentation will not include - // them - return getTypeString(p, "", "", null); - } - - @Override - public String toInstantiationType(Schema property) { - if (ModelUtils.isArraySchema(property) || ModelUtils.isMapSchema(property) || property.getAdditionalProperties() != null) { - return getSchemaType(property); - } - return super.toInstantiationType(property); - } - - @Override - protected void addAdditionPropertiesToCodeGenModel(CodegenModel codegenModel, Schema schema) { - } - - /** - * Gets an example if it exists - * - * @param sc input schema - * @return the example value - */ - protected Object getObjectExample(Schema sc) { - Schema schema = sc; - String ref = sc.get$ref(); - if (ref != null) { - schema = ModelUtils.getSchema(this.openAPI, ModelUtils.getSimpleRef(ref)); - } - // TODO handle examples in object models in the future - Boolean objectModel = (ModelUtils.isObjectSchema(schema) || ModelUtils.isMapSchema(schema) || ModelUtils.isComposedSchema(schema)); - if (objectModel) { - return null; - } - if (schema.getExample() != null) { - return schema.getExample(); - } - if (schema.getDefault() != null) { - return schema.getDefault(); - } else if (schema.getEnum() != null && !schema.getEnum().isEmpty()) { - return schema.getEnum().get(0); - } - return null; - } - - /*** - * Ensures that the string has a leading and trailing quote - * - * @param in input string - * @return quoted string - */ - private String ensureQuotes(String in) { - String strPattern = "^['\"].*?['\"]$"; - if (in.matches(strPattern)) { - return in; - } - return "\"" + in + "\""; - } - - @Override - public String toExampleValue(Schema schema) { - String modelName = getModelName(schema); - Object objExample = getObjectExample(schema); - return toExampleValueRecursive(modelName, schema, objExample, 1, "", 0, new ArrayList<>()); - } - - public String toExampleValue(Schema schema, Object objExample) { - String modelName = getModelName(schema); - return toExampleValueRecursive(modelName, schema, objExample, 1, "", 0, new ArrayList<>()); - } - - private Boolean simpleStringSchema(Schema schema) { - Schema sc = schema; - String ref = schema.get$ref(); - if (ref != null) { - sc = ModelUtils.getSchema(this.openAPI, ModelUtils.getSimpleRef(ref)); - } - if (ModelUtils.isStringSchema(sc) && !ModelUtils.isDateSchema(sc) && !ModelUtils.isDateTimeSchema(sc) && !"Number".equalsIgnoreCase(sc.getFormat()) && !ModelUtils.isByteArraySchema(sc) && !ModelUtils.isBinarySchema(sc) && schema.getPattern() == null) { - return true; - } - return false; - } - - private MappedModel getDiscriminatorMappedModel(CodegenDiscriminator disc) { - for (MappedModel mm : disc.getMappedModels()) { - String modelName = mm.getModelName(); - Schema modelSchema = getModelNameToSchemaCache().get(modelName); - if (ModelUtils.isObjectSchema(modelSchema)) { - return mm; - } - } - return null; - } - - /*** - * Recursively generates string examples for schemas - * - * @param modelName the string name of the refed model that will be generated for the schema or null - * @param schema the schema that we need an example for - * @param objExample the example that applies to this schema, for now only string example are used - * @param indentationLevel integer indentation level that we are currently at - * we assume the indentaion amount is 4 spaces times this integer - * @param prefix the string prefix that we will use when assigning an example for this line - * this is used when setting key: value, pairs "key: " is the prefix - * and this is used when setting properties like some_property='some_property_example' - * @param exampleLine this is the current line that we are generatign an example for, starts at 0 - * we don't indentin the 0th line because using the example value looks like: - * prop = ModelName( line 0 - * some_property='some_property_example' line 1 - * ) line 2 - * and our example value is: - * ModelName( line 0 - * some_property='some_property_example' line 1 - * ) line 2 - * @param includedSchemas are a list of schemas that we have moved through to get here. If the new schemas that we - * are looking at is in includedSchemas then we have hit a cycle. - * @return the string example - */ - private String toExampleValueRecursive(String modelName, Schema schema, Object objExample, int indentationLevel, String prefix, Integer exampleLine, List includedSchemas) { - boolean couldHaveCycle = includedSchemas.size() > 0 && potentiallySelfReferencingSchema(schema); - // If we have seen the ContextAwareSchemaNode more than once before, we must be in a cycle. - boolean cycleFound = false; - if (couldHaveCycle) { - cycleFound = includedSchemas.subList(0, includedSchemas.size()-1).stream().anyMatch(s -> schema.equals(s)); - } - final String indentionConst = " "; - String currentIndentation = ""; - String closingIndentation = ""; - for (int i = 0; i < indentationLevel; i++) currentIndentation += indentionConst; - if (exampleLine.equals(0)) { - closingIndentation = currentIndentation; - currentIndentation = ""; - } else { - closingIndentation = currentIndentation; - } - String openChars = ""; - String closeChars = ""; - if (modelName != null) { - openChars = modelName + "("; - closeChars = ")"; - } - - String fullPrefix = currentIndentation + prefix + openChars; - - String example = null; - if (objExample != null) { - example = objExample.toString(); - } - if (null != schema.get$ref()) { - Map allDefinitions = ModelUtils.getSchemas(this.openAPI); - String ref = ModelUtils.getSimpleRef(schema.get$ref()); - Schema refSchema = allDefinitions.get(ref); - if (null == refSchema) { - LOGGER.warn("Unable to find referenced schema " + schema.get$ref() + "\n"); - return fullPrefix + "None" + closeChars; - } - String refModelName = getModelName(schema); - return toExampleValueRecursive(refModelName, refSchema, objExample, indentationLevel, prefix, exampleLine, includedSchemas); - } else if (ModelUtils.isNullType(schema)) { - // The 'null' type is allowed in OAS 3.1 and above. It is not supported by OAS 3.0.x, - // though this tooling supports it. - return fullPrefix + "None" + closeChars; - } else if (ModelUtils.isAnyType(schema)) { - /* - This schema may be a composed schema - TODO generate examples for some of these use cases in the future like - only oneOf without a discriminator - */ - if (cycleFound) { - return ""; - } - Boolean hasProperties = (schema.getProperties() != null && !schema.getProperties().isEmpty()); - CodegenDiscriminator disc = createDiscriminator(modelName, schema, openAPI); - if (ModelUtils.isComposedSchema(schema)) { - if(includedSchemas.contains(schema)) { - return ""; - } - includedSchemas.add(schema); - // complex composed object type schemas not yet handled and the code returns early - if (hasProperties) { - // what if this composed schema defined properties + allOf? - // or items + properties, both a ist and a dict could be accepted as payloads - return fullPrefix + "{}" + closeChars; - } - ComposedSchema cs = (ComposedSchema) schema; - Integer allOfExists = 0; - if (cs.getAllOf() != null && !cs.getAllOf().isEmpty()) { - allOfExists = 1; - } - Integer anyOfExists = 0; - if (cs.getAnyOf() != null && !cs.getAnyOf().isEmpty()) { - anyOfExists = 1; - } - Integer oneOfExists = 0; - if (cs.getOneOf() != null && !cs.getOneOf().isEmpty()) { - oneOfExists = 1; - } - if (allOfExists + anyOfExists + oneOfExists > 1) { - // what if it needs one oneOf schema, one anyOf schema, and two allOf schemas? - return fullPrefix + "None" + closeChars; - } - // for now only oneOf with discriminator is supported - if (oneOfExists == 1 && disc != null) { - ; - } else { - return fullPrefix + "None" + closeChars; - } - } - if (disc != null) { - // a discriminator means that the type must be object - MappedModel mm = getDiscriminatorMappedModel(disc); - if (mm == null) { - return fullPrefix + "None" + closeChars; - } - String discPropNameValue = mm.getMappingName(); - String chosenModelName = mm.getModelName(); - Schema modelSchema = getModelNameToSchemaCache().get(chosenModelName); - CodegenProperty cp = new CodegenProperty(); - cp.setName(disc.getPropertyName()); - cp.setExample(discPropNameValue); - return exampleForObjectModel(modelSchema, fullPrefix, closeChars, cp, indentationLevel, exampleLine, closingIndentation, includedSchemas); - } - return fullPrefix + "None" + closeChars; - } else if (ModelUtils.isBooleanSchema(schema)) { - if (example == null) { - example = "True"; - } else { - if ("false".equalsIgnoreCase(objExample.toString())) { - example = "False"; - } else { - example = "True"; - } - } - return fullPrefix + example + closeChars; - } else if (ModelUtils.isStringSchema(schema)) { - if (example != null) { - return fullPrefix + ensureQuotes(handleSpecialCharacters(example)) + closeChars; - } - if (ModelUtils.isDateSchema(schema)) { - if (objExample == null) { - example = pythonDate("1970-01-01"); - } else { - example = pythonDate(objExample); - } - } else if (ModelUtils.isDateTimeSchema(schema)) { - if (objExample == null) { - example = pythonDateTime("1970-01-01T00:00:00.00Z"); - } else { - example = pythonDateTime(objExample); - } - } else if (ModelUtils.isBinarySchema(schema)) { - if (example == null) { - example = "/path/to/file"; - } - example = "open('" + example + "', 'rb')"; - return fullPrefix + example + closeChars; - } else if (ModelUtils.isByteArraySchema(schema)) { - if (objExample == null) { - example = "'YQ=='"; - } - } else if ("Number".equalsIgnoreCase(schema.getFormat())) { - // a BigDecimal: - example = "2"; - } else if (StringUtils.isNotBlank(schema.getPattern())) { - String pattern = schema.getPattern(); - List results = getPatternAndModifiers(pattern); - String extractedPattern = (String) results.get(0); - List regexFlags = (List) results.get(1); - /* - RxGen does not support our ECMA dialect https://github.com/curious-odd-man/RgxGen/issues/56 - So strip off the leading / and trailing / and turn on ignore case if we have it - */ - RgxGen rgxGen = null; - if (regexFlags.size() > 0 && regexFlags.contains("i")) { - rgxGen = new RgxGen(extractedPattern); - RgxGenProperties properties = new RgxGenProperties(); - RgxGenOption.CASE_INSENSITIVE.setInProperties(properties, true); - rgxGen.setProperties(properties); - } else { - rgxGen = new RgxGen(extractedPattern); - } - - // this seed makes it so if we have [a-z] we pick a - Random random = new Random(18); - if (rgxGen != null) { - example = rgxGen.generate(random); - } else { - throw new RuntimeException("rgxGen cannot be null. Please open an issue in the openapi-generator github repo."); - } - } else if (schema.getMinLength() != null) { - example = ""; - int len = schema.getMinLength().intValue(); - for (int i = 0; i < len; i++) example += "a"; - } else if (ModelUtils.isUUIDSchema(schema)) { - example = "046b6c7f-0b8a-43b9-b35d-6489e6daee91"; - } else { - example = "string_example"; - } - return fullPrefix + ensureQuotes(example) + closeChars; - } else if (ModelUtils.isIntegerSchema(schema)) { - if (objExample == null) { - if (schema.getMinimum() != null) { - example = schema.getMinimum().toString(); - } else { - example = "1"; - } - } - return fullPrefix + example + closeChars; - } else if (ModelUtils.isNumberSchema(schema)) { - if (objExample == null) { - if (schema.getMinimum() != null) { - example = schema.getMinimum().toString(); - } else { - example = "3.14"; - } - } - return fullPrefix + example + closeChars; - } else if (ModelUtils.isArraySchema(schema)) { - if (objExample instanceof Iterable) { - // If the example is already a list, return it directly instead of wrongly wrap it in another list - return fullPrefix + objExample.toString() + closeChars; - } - if (ModelUtils.isComposedSchema(schema)) { - // complex composed array type schemas not yet handled and the code returns early - return fullPrefix + "[]" + closeChars; - } - ArraySchema arrayschema = (ArraySchema) schema; - Schema itemSchema = arrayschema.getItems(); - String itemModelName = getModelName(itemSchema); - if(includedSchemas.contains(schema)) { - return ""; - } - includedSchemas.add(schema); - String itemExample = toExampleValueRecursive(itemModelName, itemSchema, objExample, indentationLevel + 1, "", exampleLine + 1, includedSchemas); - if (StringUtils.isEmpty(itemExample) || cycleFound) { - return fullPrefix + "[]" + closeChars; - } else { - return fullPrefix + "[" + "\n" + itemExample + "\n" + closingIndentation + "]" + closeChars; - } - } else if (ModelUtils.isTypeObjectSchema(schema)) { - if (modelName == null) { - fullPrefix += "dict("; - closeChars = ")"; - } - if (cycleFound) { - return fullPrefix + closeChars; - } - Boolean hasProperties = (schema.getProperties() != null && !schema.getProperties().isEmpty()); - CodegenDiscriminator disc = createDiscriminator(modelName, schema, openAPI); - if (ModelUtils.isComposedSchema(schema)) { - // complex composed object type schemas not yet handled and the code returns early - if (hasProperties) { - // what if this composed schema defined properties + allOf? - return fullPrefix + closeChars; - } - ComposedSchema cs = (ComposedSchema) schema; - Integer allOfExists = 0; - if (cs.getAllOf() != null && !cs.getAllOf().isEmpty()) { - allOfExists = 1; - } - Integer anyOfExists = 0; - if (cs.getAnyOf() != null && !cs.getAnyOf().isEmpty()) { - anyOfExists = 1; - } - Integer oneOfExists = 0; - if (cs.getOneOf() != null && !cs.getOneOf().isEmpty()) { - oneOfExists = 1; - } - if (allOfExists + anyOfExists + oneOfExists > 1) { - // what if it needs one oneOf schema, one anyOf schema, and two allOf schemas? - return fullPrefix + closeChars; - } - // for now only oneOf with discriminator is supported - if (oneOfExists == 1 && disc != null) { - ; - } else { - return fullPrefix + closeChars; - } - } - if (disc != null) { - MappedModel mm = getDiscriminatorMappedModel(disc); - if (mm == null) { - return fullPrefix + closeChars; - } - String discPropNameValue = mm.getMappingName(); - String chosenModelName = mm.getModelName(); - Schema modelSchema = getModelNameToSchemaCache().get(chosenModelName); - CodegenProperty cp = new CodegenProperty(); - cp.setName(disc.getPropertyName()); - cp.setExample(discPropNameValue); - return exampleForObjectModel(modelSchema, fullPrefix, closeChars, cp, indentationLevel, exampleLine, closingIndentation, includedSchemas); - } - Object addPropsObj = schema.getAdditionalProperties(); - if (hasProperties) { - return exampleForObjectModel(schema, fullPrefix, closeChars, null, indentationLevel, exampleLine, closingIndentation, includedSchemas); - } else if (addPropsObj instanceof Schema) { - // TODO handle true case for additionalProperties - Schema addPropsSchema = (Schema) addPropsObj; - String key = "key"; - Object addPropsExample = getObjectExample(addPropsSchema); - if (addPropsSchema.getEnum() != null && !addPropsSchema.getEnum().isEmpty()) { - key = addPropsSchema.getEnum().get(0).toString(); - } - addPropsExample = exampleFromStringOrArraySchema(addPropsSchema, addPropsExample, key); - String addPropPrefix = key + "="; - if (modelName == null) { - addPropPrefix = ensureQuotes(key) + ": "; - } - String addPropsModelName = getModelName(addPropsSchema); - if(includedSchemas.contains(schema)) { - return ""; - } - includedSchemas.add(schema); - - example = fullPrefix + "\n" + toExampleValueRecursive(addPropsModelName, addPropsSchema, addPropsExample, indentationLevel + 1, addPropPrefix, exampleLine + 1, includedSchemas) + ",\n" + closingIndentation + closeChars; - } else { - example = fullPrefix + closeChars; - } - } else { - LOGGER.warn("Type " + schema.getType() + " not handled properly in toExampleValue"); - } - - return example; - } - - private boolean potentiallySelfReferencingSchema(Schema schema) { - return null != schema.get$ref() || ModelUtils.isArraySchema(schema) || ModelUtils.isMapSchema(schema) || ModelUtils.isObjectSchema(schema) || ModelUtils.isComposedSchema(schema); - } - - private String exampleForObjectModel(Schema schema, String fullPrefix, String closeChars, CodegenProperty discProp, int indentationLevel, int exampleLine, String closingIndentation, List includedSchemas) { - - Map requiredAndOptionalProps = schema.getProperties(); - if (requiredAndOptionalProps == null || requiredAndOptionalProps.isEmpty()) { - return fullPrefix + closeChars; - } - - if(includedSchemas.contains(schema)) { - return ""; - } - includedSchemas.add(schema); - - String example = fullPrefix + "\n"; - - for (Map.Entry entry : requiredAndOptionalProps.entrySet()) { - String propName = entry.getKey(); - Schema propSchema = entry.getValue(); - propName = toVarName(propName); - String propModelName = null; - Object propExample = null; - if (discProp != null && propName.equals(discProp.name)) { - propModelName = null; - propExample = discProp.example; - } else { - propModelName = getModelName(propSchema); - propExample = exampleFromStringOrArraySchema( - propSchema, - null, - propName); - } - - example += toExampleValueRecursive(propModelName, - propSchema, - propExample, - indentationLevel + 1, - propName + "=", - exampleLine + 1, - includedSchemas) + ",\n"; - } - - // TODO handle additionalProperties also - example += closingIndentation + closeChars; - return example; - - } - - private Object exampleFromStringOrArraySchema(Schema sc, Object currentExample, String propName) { - if (currentExample != null) { - return currentExample; - } - Schema schema = sc; - String ref = sc.get$ref(); - if (ref != null) { - schema = ModelUtils.getSchema(this.openAPI, ModelUtils.getSimpleRef(ref)); - } - Object example = getObjectExample(schema); - if (example != null) { - return example; - } else if (simpleStringSchema(schema)) { - return propName + "_example"; - } else if (ModelUtils.isArraySchema(schema)) { - ArraySchema arraySchema = (ArraySchema) schema; - Schema itemSchema = arraySchema.getItems(); - example = getObjectExample(itemSchema); - if (example != null) { - return example; - } else if (simpleStringSchema(itemSchema)) { - return propName + "_example"; - } - } - return null; - } - - - /*** - * - * Set the codegenParameter example value - * We have a custom version of this function so we can invoke toExampleValue - * - * @param codegenParameter the item we are setting the example on - * @param parameter the base parameter that came from the spec - */ - @Override - public void setParameterExampleValue(CodegenParameter codegenParameter, Parameter parameter) { - Schema schema = parameter.getSchema(); - if (schema == null) { - LOGGER.warn("CodegenParameter.example defaulting to null because parameter lacks a schema"); - return; - } - - Object example = null; - if (codegenParameter.vendorExtensions != null && codegenParameter.vendorExtensions.containsKey("x-example")) { - example = codegenParameter.vendorExtensions.get("x-example"); - } else if (parameter.getExample() != null) { - example = parameter.getExample(); - } else if (parameter.getExamples() != null && !parameter.getExamples().isEmpty() && parameter.getExamples().values().iterator().next().getValue() != null) { - example = parameter.getExamples().values().iterator().next().getValue(); - } else { - example = getObjectExample(schema); - } - example = exampleFromStringOrArraySchema(schema, example, parameter.getName()); - String finalExample = toExampleValue(schema, example); - codegenParameter.example = finalExample; - } - - /** - * Return the example value of the parameter. - * - * @param codegenParameter Codegen parameter - * @param requestBody Request body - */ - @Override - public void setParameterExampleValue(CodegenParameter codegenParameter, RequestBody requestBody) { - if (codegenParameter.vendorExtensions != null && codegenParameter.vendorExtensions.containsKey("x-example")) { - codegenParameter.example = Json.pretty(codegenParameter.vendorExtensions.get("x-example")); - } - - Content content = requestBody.getContent(); - - if (content.size() > 1) { - // @see ModelUtils.getSchemaFromContent() - once(LOGGER).warn("Multiple MediaTypes found, using only the first one"); - } - - MediaType mediaType = content.values().iterator().next(); - Schema schema = mediaType.getSchema(); - if (schema == null) { - LOGGER.warn("CodegenParameter.example defaulting to null because requestBody content lacks a schema"); - return; - } - - Object example = null; - if (mediaType.getExample() != null) { - example = mediaType.getExample(); - } else if (mediaType.getExamples() != null && !mediaType.getExamples().isEmpty() && mediaType.getExamples().values().iterator().next().getValue() != null) { - example = mediaType.getExamples().values().iterator().next().getValue(); - } else { - example = getObjectExample(schema); - } - example = exampleFromStringOrArraySchema(schema, example, codegenParameter.paramName); - codegenParameter.example = toExampleValue(schema, example); - } - - /** - * Create a CodegenParameter for a Form Property - * We have a custom version of this method so we can invoke - * setParameterExampleValue(codegenParameter, parameter) - * rather than setParameterExampleValue(codegenParameter) - * This ensures that all of our samples are generated in - * toExampleValueRecursive - * - * @param name the property name - * @param propertySchema the property schema - * @param imports our import set - * @return the resultant CodegenParameter - */ - @Override - public CodegenParameter fromFormProperty(String name, Schema propertySchema, Set imports) { - CodegenParameter cp = super.fromFormProperty(name, propertySchema, imports); - Parameter p = new Parameter(); - p.setSchema(propertySchema); - p.setName(cp.paramName); - setParameterExampleValue(cp, p); - return cp; - } - - /** - * Return a map from model name to Schema for efficient lookup. - * - * @return map from model name to Schema. - */ - protected Map getModelNameToSchemaCache() { - if (modelNameToSchemaCache == null) { - // Create a cache to efficiently lookup schema based on model name. - Map m = new HashMap(); - ModelUtils.getSchemas(openAPI).forEach((key, schema) -> { - m.put(toModelName(key), schema); - }); - modelNameToSchemaCache = Collections.unmodifiableMap(m); - } - return modelNameToSchemaCache; - } - - /** - * Use cases: - * additional properties is unset: do nothing - * additional properties is true: add definiton to property - * additional properties is false: add definiton to property - * additional properties is schema: add definiton to property - * - * @param schema the schema that may contain an additional property schema - * @param property the property for the above schema - */ - @Override - protected void setAddProps(Schema schema, IJsonSchemaValidationProperties property){ - Schema addPropsSchema = getSchemaFromBooleanOrSchema(schema.getAdditionalProperties()); - if (addPropsSchema == null) { - return; - } - CodegenProperty addPropProp = fromProperty(getAdditionalPropertiesName(), addPropsSchema, false, false); - property.setAdditionalProperties(addPropProp); - } - - /** - * Update property for array(list) container - * - * @param property Codegen property - * @param innerProperty Codegen inner property of map or list - */ - @Override - protected void updatePropertyForArray(CodegenProperty property, CodegenProperty innerProperty) { - if (innerProperty == null) { - if(LOGGER.isWarnEnabled()) { - LOGGER.warn("skipping invalid array property {}", Json.pretty(property)); - } - return; - } - property.dataFormat = innerProperty.dataFormat; - if (languageSpecificPrimitives.contains(innerProperty.baseType)) { - property.isPrimitiveType = true; - } - property.items = innerProperty; - property.mostInnerItems = getMostInnerItems(innerProperty); - // inner item is Enum - if (isPropertyInnerMostEnum(property)) { - // isEnum is set to true when the type is an enum - // or the inner type of an array/map is an enum - property.isEnum = true; - // update datatypeWithEnum and default value for array - // e.g. List => List - updateDataTypeWithEnumForArray(property); - // set allowable values to enum values (including array/map of enum) - property.allowableValues = getInnerEnumAllowableValues(property); - } - - } - - /** - * Sets the booleans that define the model's type - * - * @param model the model to update - * @param schema the model's schema - */ - protected void updateModelForString(CodegenModel model, Schema schema) { - if (ModelUtils.isDateTimeSchema(schema)) { - // isString stays true, format stores that this is a date-time - } else if (ModelUtils.isDateSchema(schema)) { - // isString stays true, format stores that this is a date - } else if (ModelUtils.isUUIDSchema(schema)) { - // isString stays true, format stores that this is a uuid - } else if (ModelUtils.isDecimalSchema(schema)) { - // isString stays true, format stores that this is a uuid - } else if (ModelUtils.isBinarySchema(schema)) { - // format stores that this is binary - model.isString = true; - } - } - - protected void updateModelForNumber(CodegenModel model, Schema schema) { - model.setIsNumber(true); - // float vs double info is stored in format - } - - protected void updateModelForInteger(CodegenModel model, Schema schema) { - model.isInteger = true; - // int32 int64 info is stored in format - } - - protected void updatePropertyForString(CodegenProperty property, Schema p) { - if (ModelUtils.isByteArraySchema(p)) { - // isString stays true, format stores that this is a byte - } else if (ModelUtils.isBinarySchema(p)) { - // format stores that this is binary - property.isString = true; - } else if (ModelUtils.isUUIDSchema(p)) { - // isString stays true, format stores that this is a uuid - } else if (ModelUtils.isURISchema(p)) { - property.isUri = true; - } else if (ModelUtils.isEmailSchema(p)) { - property.isEmail = true; - } else if (ModelUtils.isDateSchema(p)) { // date format - // isString stays true, format stores that this is a date - } else if (ModelUtils.isDateTimeSchema(p)) { // date-time format - // isString stays true, format stores that this is a date-time - } else if (ModelUtils.isDecimalSchema(p)) { // type: string, format: number - // isString stays true, format stores that this is a number - } - property.pattern = toRegularExpression(p.getPattern()); - } - - @Override - public String toRegularExpression(String pattern) { - if (pattern == null) { - return null; - } - List results = getPatternAndModifiers(pattern); - String extractedPattern = (String) results.get(0); - return extractedPattern; - } - - protected void updatePropertyForNumber(CodegenProperty property, Schema p) { - property.setIsNumber(true); - // float and double differentiation is determined with format info - } - - protected void updatePropertyForInteger(CodegenProperty property, Schema p) { - property.isInteger = true; - // int32 and int64 differentiation is determined with format info - } - - - @Override - protected void updatePropertyForObject(CodegenProperty property, Schema p) { - addVarsRequiredVarsAdditionalProps(p, property); - } - - @Override - protected void updatePropertyForAnyType(CodegenProperty property, Schema p) { - // The 'null' value is allowed when the OAS schema is 'any type'. - // See https://github.com/OAI/OpenAPI-Specification/issues/1389 - if (Boolean.FALSE.equals(p.getNullable())) { - LOGGER.warn("Schema '{}' is any type, which includes the 'null' value. 'nullable' cannot be set to 'false'", p.getName()); - } - addVarsRequiredVarsAdditionalProps(p, property); - } - - @Override - protected void updateModelForObject(CodegenModel m, Schema schema) { - // custom version of this method so properties are always added with addVars - if (schema.getProperties() != null || schema.getRequired() != null) { - // passing null to allProperties and allRequired as there's no parent - addVars(m, unaliasPropertySchema(schema.getProperties()), schema.getRequired(), null, null); - } - // an object or anyType composed schema that has additionalProperties set - addAdditionPropertiesToCodeGenModel(m, schema); - // process 'additionalProperties' - setAddProps(schema, m); - addRequiredVarsMap(schema, m); - } - - @Override - protected void updateModelForAnyType(CodegenModel m, Schema schema) { - // The 'null' value is allowed when the OAS schema is 'any type'. - // See https://github.com/OAI/OpenAPI-Specification/issues/1389 - if (Boolean.FALSE.equals(schema.getNullable())) { - LOGGER.error("Schema '{}' is any type, which includes the 'null' value. 'nullable' cannot be set to 'false'", m.name); - } - // todo add items support here in the future - if (schema.getProperties() != null || schema.getRequired() != null) { - // passing null to allProperties and allRequired as there's no parent - addVars(m, unaliasPropertySchema(schema.getProperties()), schema.getRequired(), null, null); - } - addAdditionPropertiesToCodeGenModel(m, schema); - // process 'additionalProperties' - setAddProps(schema, m); - addRequiredVarsMap(schema, m); - } - - @Override - protected void updateModelForComposedSchema(CodegenModel m, Schema schema, Map allDefinitions) { - final ComposedSchema composed = (ComposedSchema) schema; - - // TODO revise the logic below to set discriminator, xml attributes - if (composed.getAllOf() != null) { - int modelImplCnt = 0; // only one inline object allowed in a ComposedModel - int modelDiscriminators = 0; // only one discriminator allowed in a ComposedModel - for (Schema innerSchema : composed.getAllOf()) { // TODO need to work with anyOf, oneOf as well - if (m.discriminator == null && innerSchema.getDiscriminator() != null) { - LOGGER.debug("discriminator is set to null (not correctly set earlier): {}", m.name); - m.setDiscriminator(createDiscriminator(m.name, innerSchema, this.openAPI)); - if (!this.getLegacyDiscriminatorBehavior()) { - m.addDiscriminatorMappedModelsImports(); - } - modelDiscriminators++; - } - - if (innerSchema.getXml() != null) { - m.xmlPrefix = innerSchema.getXml().getPrefix(); - m.xmlNamespace = innerSchema.getXml().getNamespace(); - m.xmlName = innerSchema.getXml().getName(); - } - if (modelDiscriminators > 1) { - LOGGER.error("Allof composed schema is inheriting >1 discriminator. Only use one discriminator: {}", composed); - } - - if (modelImplCnt++ > 1) { - LOGGER.warn("More than one inline schema specified in allOf:. Only the first one is recognized. All others are ignored."); - break; // only one schema with discriminator allowed in allOf - } - } - } - - CodegenComposedSchemas cs = m.getComposedSchemas(); - if (cs != null) { - if (cs.getAllOf() != null && !cs.getAllOf().isEmpty()) { - for (CodegenProperty cp: cs.getAllOf()) { - if (cp.complexType != null) { - addImport(m, cp.complexType); - } - } - } - if (cs.getOneOf() != null && !cs.getOneOf().isEmpty()) { - for (CodegenProperty cp: cs.getOneOf()) { - if (cp.complexType != null) { - addImport(m, cp.complexType); - } - } - } - if (cs.getAnyOf() != null && !cs.getAnyOf().isEmpty()) { - for (CodegenProperty cp: cs.getAnyOf()) { - if (cp.complexType != null) { - addImport(m, cp.complexType); - } - } - } - } - } - - @Override - public ModelsMap postProcessModels(ModelsMap objs) { - // process enum in models - return postProcessModelsEnum(objs); - } - - /** - * @param pattern the regex pattern - * @return List> - */ - private List getPatternAndModifiers(String pattern) { - /* - Notes: - RxGen does not support our ECMA dialect https://github.com/curious-odd-man/RgxGen/issues/56 - So strip off the leading / and trailing / and turn on ignore case if we have it - - json schema test cases omit the leading and trailing /s, so make sure that the regex allows that - */ - Pattern valueExtractor = Pattern.compile("^/?(.+?)/?([simu]{0,4})$"); - Matcher m = valueExtractor.matcher(pattern); - if (m.find()) { - int groupCount = m.groupCount(); - if (groupCount == 1) { - // only pattern found - String isolatedPattern = m.group(1); - return Arrays.asList(isolatedPattern, null); - } else if (groupCount == 2) { - List modifiers = new ArrayList(); - // patterns and flag found - String isolatedPattern = m.group(1); - String flags = m.group(2); - if (flags.contains("s")) { - modifiers.add("DOTALL"); - } - if (flags.contains("i")) { - modifiers.add("IGNORECASE"); - } - if (flags.contains("m")) { - modifiers.add("MULTILINE"); - } - return Arrays.asList(isolatedPattern, modifiers); - } - } - return Arrays.asList(pattern, new ArrayList()); - } - - /* - * The OpenAPI pattern spec follows the Perl convention and style of modifiers. Python - * does not support this in as natural a way so it needs to convert it. See - * https://docs.python.org/2/howto/regex.html#compilation-flags for details. - */ - public void postProcessPattern(String pattern, Map vendorExtensions) { - if (pattern != null) { - List results = getPatternAndModifiers(pattern); - String extractedPattern = (String) results.get(0); - List modifiers = (List) results.get(1); - - vendorExtensions.put("x-regex", extractedPattern); - if (modifiers.size() > 0) { - vendorExtensions.put("x-modifiers", modifiers); - } - } - } - - @Override - public CodegenType getTag() { - return CodegenType.CLIENT; - } - - @Override - public String apiDocFileFolder() { - return (outputFolder + "/" + apiDocPath); - } - - @Override - public String modelDocFileFolder() { - return (outputFolder + "/" + modelDocPath); - } - - @Override - public String toModelDocFilename(String name) { - return toModelName(name); - } - - @Override - public String toApiDocFilename(String name) { - return toApiName(name); - } - - @Override - public String addRegularExpressionDelimiter(String pattern) { - if (StringUtils.isEmpty(pattern)) { - return pattern; - } - - if (!pattern.matches("^/.*")) { - // Perform a negative lookbehind on each `/` to ensure that it is escaped. - return "/" + pattern.replaceAll("(? - * (PEP 0008) Python packages should also have short, all-lowercase names, - * although the use of underscores is discouraged. - * - * @param packageName Package name - * @return Python package name that conforms to PEP 0008 - */ - @SuppressWarnings("static-method") - public String generatePackageName(String packageName) { - return underscore(packageName.replaceAll("[^\\w]+", "")); - } - - /** - * A custom version of this method is needed to ensure that the form object parameter is kept as-is - * as an object and is not exploded into separate parameters - * @param body the body that is being handled - * @param imports the imports for this body - * @return the list of length one containing a single type object CodegenParameter - */ - @Override - public List fromRequestBodyToFormParameters(RequestBody body, Set imports) { - List parameters = new ArrayList<>(); - LOGGER.debug("debugging fromRequestBodyToFormParameters= {}", body); - Schema schema = ModelUtils.getSchemaFromRequestBody(body); - schema = ModelUtils.getReferencedSchema(this.openAPI, schema); - CodegenParameter cp = fromFormProperty("body", schema, imports); - cp.setContent(getContent(body.getContent(), imports, "RequestBody")); - cp.isFormParam = false; - cp.isBodyParam = true; - parameters.add(cp); - return parameters; - } - - /** - * Custom version of this method so we can move the body parameter into bodyParam - * - * @param path the path of the operation - * @param httpMethod HTTP method - * @param operation OAS operation object - * @param servers list of servers - * @return the resultant CodegenOperation instance - */ - @Override - public CodegenOperation fromOperation(String path, - String httpMethod, - Operation operation, - List servers) { - CodegenOperation co = super.fromOperation(path, httpMethod, operation, servers); - co.httpMethod = httpMethod.toLowerCase(Locale.ROOT); - // smuggle the path enum variable name in operationIdLowerCase - co.operationIdLowerCase = toEnumVarName(co.path, "str"); - // smuggle pathModuleName in nickname - String pathModuleName = toVarName(path); - co.nickname = pathModuleName; - // smuggle path Api class name ins operationIdSnakeCase - co.operationIdSnakeCase = toModelName(path); - - if (co.bodyParam == null) { - for (CodegenParameter cp: co.allParams) { - if (cp.isBodyParam) { - co.bodyParam = cp; - co.bodyParams.add(cp); - } - } - } - return co; - } - - /** - * Custom version of this method to prevent mutation of - * codegenOperation.operationIdLowerCase/operationIdSnakeCase - * Property Usages: - * - operationId: endpoint method name when using tagged apis - * - httpMethod: endpoint method name when using path apis - * - operationIdCamelCase: Api class name containing single endpoint for tagged apis - * - operationIdLowerCase: (smuggled) path enum variable name - * - nickname: (smuggled) path module name for path apis - * - operationIdSnakeCase: (smuggled) path Api class name when using path apis - * - * @param tag name of the tag - * @param resourcePath path of the resource - * @param operation OAS Operation object - * @param co Codegen Operation object - * @param operations map of Codegen operations - */ - @Override - @SuppressWarnings("static-method") - public void addOperationToGroup(String tag, String resourcePath, Operation operation, CodegenOperation - co, Map> operations) { - List opList = operations.get(tag); - if (opList == null) { - opList = new ArrayList<>(); - operations.put(tag, opList); - } - // check for operationId uniqueness - String uniqueName = co.operationId; - int counter = 0; - for (CodegenOperation op : opList) { - if (uniqueName.equals(op.operationId)) { - uniqueName = co.operationId + "_" + counter; - counter++; - } - } - if (!co.operationId.equals(uniqueName)) { - LOGGER.warn("generated unique operationId `{}`", uniqueName); - } - co.operationId = uniqueName; - co.operationIdCamelCase = camelize(uniqueName); - opList.add(co); - co.baseName = tag; - } - - @Override - public String defaultTemplatingEngine() { - return "handlebars"; - } - - @Override - public String generatorLanguageVersion() { return ">=3.7"; }; - - @Override - public void preprocessOpenAPI(OpenAPI openAPI) { - String originalSpecVersion; - String xOriginalSwaggerVersion = "x-original-swagger-version"; - if (openAPI.getExtensions() != null && !openAPI.getExtensions().isEmpty() && openAPI.getExtensions().containsKey(xOriginalSwaggerVersion)) { - originalSpecVersion = (String) openAPI.getExtensions().get(xOriginalSwaggerVersion); - } else { - originalSpecVersion = openAPI.getOpenapi(); - } - Integer specMajorVersion = Integer.parseInt(originalSpecVersion.substring(0, 1)); - if (specMajorVersion < 3) { - throw new RuntimeException("Your spec version of "+originalSpecVersion+" is too low. " + getName() + " only works with specs with version >= 3.X.X. Please use a tool like Swagger Editor or Swagger Converter to convert your spec to v3"); - } - } - - /** - * Note: a custom version of this function is used so the original tag value can be used - * - * @param tag Tag - * @return the tag to use - */ - @Override - public String sanitizeTag(String tag) { - return tag; - } - - public Map postProcessSupportingFileData(Map objs) { - objs.put(CodegenConstants.NON_COMPLIANT_USE_DISCR_IF_COMPOSITION_FAILS, nonCompliantUseDiscrIfCompositionFails); - return objs; - } - - @Override - public void postProcess() { - System.out.println("################################################################################"); - System.out.println("# Thanks for using OpenAPI Generator. #"); - System.out.println("# Please consider donation to help us maintain this project \uD83D\uDE4F #"); - System.out.println("# https://opencollective.com/openapi_generator/donate #"); - System.out.println("# #"); - System.out.println("# This generator was written by Justin Black (https://github.com/spacether) #"); - System.out.println("# Please support his work directly via https://github.com/sponsors/spacether \uD83D\uDE4F#"); - System.out.println("################################################################################"); - } -} diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/model/ApiInfoMap.java b/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/model/ApiInfoMap.java deleted file mode 100644 index 249ef9b437f..00000000000 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/model/ApiInfoMap.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.openapitools.codegen.model; - -import java.util.HashMap; -import java.util.List; - -public class ApiInfoMap extends HashMap { - - public void setApis(List apis) { - put("apis", apis); - } - - @SuppressWarnings("unchecked") - public List getApis() { - return (List) get("apis"); - } - -} diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/model/ModelMap.java b/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/model/ModelMap.java deleted file mode 100644 index 10ae306276b..00000000000 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/model/ModelMap.java +++ /dev/null @@ -1,25 +0,0 @@ -package org.openapitools.codegen.model; - -import java.util.HashMap; -import java.util.Map; - -import org.openapitools.codegen.CodegenModel; - -public class ModelMap extends HashMap { - - public ModelMap() { - - } - - public ModelMap(Map init) { - putAll(init); - } - - public void setModel(CodegenModel model) { - put("model", model); - } - - public CodegenModel getModel() { - return (CodegenModel) get("model"); - } -} diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/model/ModelsMap.java b/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/model/ModelsMap.java deleted file mode 100644 index e43fa200b58..00000000000 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/model/ModelsMap.java +++ /dev/null @@ -1,35 +0,0 @@ -package org.openapitools.codegen.model; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class ModelsMap extends HashMap { - - public ModelsMap() {} - - public void setModels(List modelMaps) { - put("models", modelMaps); - } - - @SuppressWarnings("unchecked") - public List getModels() { - return (List) get("models"); - } - - public void setImports(List> imports) { - put("imports", imports); - } - - @SuppressWarnings("unchecked") - public List> getImports() { - return (List>) get("imports"); - } - - @SuppressWarnings("unchecked") - public List> getImportsOrEmpty() { - return (List>) getOrDefault("imports", new ArrayList<>()); - } - -} diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/model/OperationMap.java b/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/model/OperationMap.java deleted file mode 100644 index 1d8806508e3..00000000000 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/model/OperationMap.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.openapitools.codegen.model; - -import java.util.Collections; -import java.util.HashMap; -import java.util.List; - -import org.openapitools.codegen.CodegenOperation; - -public class OperationMap extends HashMap { - - public void setOperation(CodegenOperation ops) { - put("operation", Collections.singletonList(ops)); - } - - public void setOperation(List ops) { - put("operation", ops); - } - - @SuppressWarnings("unchecked") - public List getOperation() { - return (List) get("operation"); - } - - public void setClassname(String classname) { - put("classname", classname); - } - - public String getClassname() { - return (String) get("classname"); - } - - public void setPathPrefix(String pathPrefix) { - put("pathPrefix", pathPrefix); - } - - public String getPathPrefix() { - return (String) get("pathPrefix"); - } - -} diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/model/OperationsMap.java b/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/model/OperationsMap.java deleted file mode 100644 index 2a24644cbfc..00000000000 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/model/OperationsMap.java +++ /dev/null @@ -1,30 +0,0 @@ -package org.openapitools.codegen.model; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.openapitools.codegen.CodegenOperation; - -public class OperationsMap extends HashMap { - - public void setOperation(OperationMap objs) { - put("operations", objs); - } - - public OperationMap getOperations() { - return (OperationMap) get("operations"); - } - - public void setImports(List> imports) { - put("imports", imports); - } - - @SuppressWarnings("unchecked") - public List> getImports() { - return (List>) get("imports"); - } - -} diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/templating/handlebars/StringHelpers.java b/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/templating/handlebars/StringHelpers.java deleted file mode 100644 index c8a8170ca96..00000000000 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/templating/handlebars/StringHelpers.java +++ /dev/null @@ -1,65 +0,0 @@ -package org.openapitools.codegen.templating.handlebars; - -import com.github.jknack.handlebars.Helper; -import com.github.jknack.handlebars.Options; -import com.github.jknack.handlebars.TagType; - -import java.io.IOException; -import java.util.Locale; - -public enum StringHelpers implements Helper { - - /** - * Indicates the string starts with the defined value. - * For example: - * - *
    -     * {{startsWith a b ["insensitive"]}}
    -     * 
    - * - *
    -     * {{startsWith a text='b' [insensitive=true]}}
    -     * 
    - * - * Render 'yes' or 'no': - *
    -     *   {{#startsWith a b}}
    -     *     yes
    -     *   {{else}}
    -     *     no
    -     *   {{/startsWith}}
    -     * 
    - * - * Render 'true' or 'false': - *
    -     *   {{startsWith a b}}
    -     * 
    - * - * Render 'y' or 'n': - *
    -     *   {{startsWith a b yes='y' no='n'}}
    -     * 
    - * - * If value is "handlebars.java", the output will be "Handlebars.java". - */ - startsWith { - @Override - public Object apply(Object value, Options options) throws IOException { - String match = options.param(0, options.hash("text", "")); - if (match.length() < 1) { - return false; - } - - boolean caseInsensitive = options.hash("insensitive", false); - boolean result = caseInsensitive ? value.toString().toLowerCase(Locale.ROOT).startsWith(match.toLowerCase(Locale.ROOT)) : value.toString().startsWith(match); - - if (options.tagType == TagType.SECTION) { - return result ? options.fn() : options.inverse(); - } - - return result - ? options.hash("yes", true) - : options.hash("no", false); - } - } -} diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/utils/OneOfImplementorAdditionalData.java b/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/utils/OneOfImplementorAdditionalData.java deleted file mode 100644 index 556f696c783..00000000000 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/utils/OneOfImplementorAdditionalData.java +++ /dev/null @@ -1,148 +0,0 @@ -package org.openapitools.codegen.utils; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import org.openapitools.codegen.CodegenConfig; -import org.openapitools.codegen.CodegenModel; -import org.openapitools.codegen.CodegenProperty; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * This class holds data to add to `oneOf` members. Let's consider this example: - * - * Foo: - * properties: - * x: - * oneOf: - * - $ref: "#/components/schemas/One - * - $ref: "#/components/schemas/Two - * y: - * type: string - * One: - * properties: - * z: - * type: string - * Two: - * properties: - * a: - * type: string - * - * In codegens that use this mechanism, `Foo` will become an interface and `One` will - * become its implementing class. This class carries all data necessary to properly modify - * the implementing class model. Specifically: - * - * * Interfaces that the implementing classes have to implement (in the example above, `One` and `Two` will implement `Foo`) - * * Properties that need to be added to implementing classes (as `Foo` is interface, the `y` property will get pushed - * to implementing classes `One` and `Two`) - * * Imports that need to be added to implementing classes (e.g. if type of property `y` needs a specific import, it - * needs to be added to `One` and `Two` because of the above point) - */ -public class OneOfImplementorAdditionalData { - private String implementorName; - private List additionalInterfaces = new ArrayList(); - private List additionalProps = new ArrayList(); - private List> additionalImports = new ArrayList>(); - private final Logger LOGGER = LoggerFactory.getLogger(OneOfImplementorAdditionalData.class); - - public OneOfImplementorAdditionalData(String implementorName) { - this.implementorName = implementorName; - } - - public String getImplementorName() { - return implementorName; - } - - /** - * Add data from a given CodegenModel that the oneOf implementor should implement. For example: - * - * @param cm model that the implementor should implement - * @param modelsImports imports of the given `cm` - */ - public void addFromInterfaceModel(CodegenModel cm, List> modelsImports) { - // Add cm as implemented interface - additionalInterfaces.add(cm.classname); - - // Add all vars defined on cm - // a "oneOf" model (cm) by default inherits all properties from its "interfaceModels", - // but we only want to add properties defined on cm itself - List toAdd = new ArrayList<>(cm.vars); - - // note that we can't just toAdd.removeAll(m.vars) for every interfaceModel, - // as they might have different value of `hasMore` and thus are not equal - Set omitAdding = new HashSet<>(); - if (cm.interfaceModels != null) { - for (CodegenModel m : cm.interfaceModels) { - for (CodegenProperty v : m.vars) { - omitAdding.add(v.baseName); - } - for (CodegenProperty v : m.allVars) { - omitAdding.add(v.baseName); - } - } - } - for (CodegenProperty v : toAdd) { - if (!omitAdding.contains(v.baseName)) { - additionalProps.add(v.clone()); - } - } - - // Add all imports of cm - for (Map importMap : modelsImports) { - // we're ok with shallow clone here, because imports are strings only - additionalImports.add(new HashMap<>(importMap)); - } - } - - /** - * Adds stored data to given implementing model - * - * @param cc CodegenConfig running this operation - * @param implcm the implementing model - * @param implImports imports of the implementing model - * @param addInterfaceImports whether or not to add the interface model as import (will vary by language) - */ - @SuppressWarnings("unchecked") - public void addToImplementor(CodegenConfig cc, CodegenModel implcm, List> implImports, boolean addInterfaceImports) { - implcm.getVendorExtensions().putIfAbsent("x-implements", new ArrayList()); - - // Add implemented interfaces - for (String intf : additionalInterfaces) { - List impl = (List) implcm.getVendorExtensions().get("x-implements"); - impl.add(intf); - if (addInterfaceImports) { - // Add imports for interfaces - implcm.imports.add(intf); - Map importsItem = new HashMap(); - importsItem.put("import", cc.toModelImport(intf)); - implImports.add(importsItem); - } - } - - // Add oneOf-containing models properties - we need to properly set the hasMore values to make rendering correct - implcm.vars.addAll(additionalProps); - implcm.hasVars = ! implcm.vars.isEmpty(); - - // Add imports - for (Map oneImport : additionalImports) { - // exclude imports from this package - these are imports that only the oneOf interface needs - if (!implImports.contains(oneImport) && !oneImport.getOrDefault("import", "").startsWith(cc.modelPackage())) { - implImports.add(oneImport); - } - } - } - - @Override - public String toString() { - return "OneOfImplementorAdditionalData{" + - "implementorName='" + implementorName + '\'' + - ", additionalInterfaces=" + additionalInterfaces + - ", additionalProps=" + additionalProps + - ", additionalImports=" + additionalImports + - '}'; - } -} diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/utils/ProcessUtils.java b/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/utils/ProcessUtils.java deleted file mode 100644 index 724db194867..00000000000 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/utils/ProcessUtils.java +++ /dev/null @@ -1,328 +0,0 @@ -package org.openapitools.codegen.utils; - -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.security.SecurityScheme; -import org.openapitools.codegen.CodegenModel; -import org.openapitools.codegen.CodegenProperty; -import org.openapitools.codegen.CodegenSecurity; -import org.openapitools.codegen.model.ModelMap; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -public class ProcessUtils { - /** - * Add x-index extension to the model's properties - * - * @param models List of models - * @param initialIndex starting index to use - */ - public static void addIndexToProperties(List models, int initialIndex) { - for (ModelMap mo : models) { - CodegenModel cm = mo.getModel(); - - int i = initialIndex; - for (CodegenProperty var : cm.vars) { - var.vendorExtensions.put("x-index", i); - i++; - } - - int j = initialIndex; - for (CodegenProperty var : cm.allVars) { - var.vendorExtensions.put("x-index", j); - j++; - } - } - } - - /** - * Add x-index extension to the model's properties - * - * @param models List of models - */ - public static void addIndexToProperties(List models) { - addIndexToProperties(models, 0); - } - - /** - * Returns true if the specified OAS model has at least one operation with the HTTP basic - * security scheme. - * - * @param authMethods List of auth methods. - * @return True if at least one operation has HTTP basic security scheme defined - */ - public static boolean hasHttpBasicMethods(List authMethods) { - if (authMethods != null && !authMethods.isEmpty()) { - for (CodegenSecurity cs : authMethods) { - if (Boolean.TRUE.equals(cs.isBasicBasic)) { - return true; - } - } - } - return false; - } - - /** - * Returns a list of OAS Codegen security objects - * - * @param authMethods List of auth methods. - * @return A list of OAS Codegen security objects - */ - public static List getHttpBasicMethods(List authMethods) { - List httpBasicMethods = new ArrayList<>(); - - for (CodegenSecurity cs : authMethods) { - if (Boolean.TRUE.equals(cs.isBasicBasic)) { - httpBasicMethods.add(cs); - } - } - - return httpBasicMethods; - } - - /** - * Returns true if the specified OAS model has at least one operation with API keys. - * - * @param authMethods List of auth methods. - * @return True if at least one operation has API key security scheme defined - */ - public static boolean hasApiKeyMethods(List authMethods) { - if (authMethods != null && !authMethods.isEmpty()) { - for (CodegenSecurity cs : authMethods) { - if (Boolean.TRUE.equals(cs.isApiKey)) { - return true; - } - } - } - return false; - } - - /** - * Returns a list of OAS Codegen security objects - * - * @param authMethods List of auth methods. - * @return A list of OAS Codegen security objects - */ - public static List getApiKeyMethods(List authMethods) { - List apiKeyMethods = new ArrayList<>(); - - for (CodegenSecurity cs : authMethods) { - if (Boolean.TRUE.equals(cs.isApiKey)) { - apiKeyMethods.add(cs); - } - } - - return apiKeyMethods; - } - - /** - * Returns true if the specified OAS model has at least one operation with the HTTP basic - * security scheme. - * The HTTP signature scheme is defined in https://datatracker.ietf.org/doc/draft-cavage-http-signatures/ - * - * @param authMethods List of auth methods. - * @return True if at least one operation has HTTP signature security scheme defined - */ - public static boolean hasHttpSignatureMethods(List authMethods) { - if (authMethods != null && !authMethods.isEmpty()) { - for (CodegenSecurity cs : authMethods) { - if (Boolean.TRUE.equals(cs.isHttpSignature)) { - return true; - } - } - } - return false; - } - - /** - * Returns a list of OAS Codegen security objects - * - * @param authMethods List of auth methods. - * @return A list of OAS Codegen security objects - */ - public static List getHttpSignatureMethods(List authMethods) { - List httpSignatureMethods = new ArrayList<>(); - - for (CodegenSecurity cs : authMethods) { - if (Boolean.TRUE.equals(cs.isHttpSignature)) { - httpSignatureMethods.add(cs); - } - } - - return httpSignatureMethods; - } - - /** - * Returns true if the specified OAS model has at least one operation with HTTP bearer. - * - * @param authMethods List of auth methods. - * @return True if at least one operation has HTTP bearer security scheme defined - */ - public static boolean hasHttpBearerMethods(List authMethods) { - if (authMethods != null && !authMethods.isEmpty()) { - for (CodegenSecurity cs : authMethods) { - if (Boolean.TRUE.equals(cs.isBasicBearer)) { - return true; - } - } - } - return false; - } - - /** - * Returns a list of Bearer Codegen security objects - * - * @param authMethods List of auth methods. - * @return A list of Bearer Codegen security objects - */ - public static List getHttpBearerMethods(List authMethods) { - List httpBearerMethods = new ArrayList<>(); - - for (CodegenSecurity cs : authMethods) { - if (Boolean.TRUE.equals(cs.isBasicBearer)) { - httpBearerMethods.add(cs); - } - } - - return httpBearerMethods; - } - - /** - * Returns true if the specified OAS model has at least one operation with OAuth. - * - * @param authMethods List of auth methods. - * @return True if at least one operation has OAuth security scheme defined - */ - public static boolean hasOAuthMethods(List authMethods) { - for (CodegenSecurity cs : authMethods) { - if (Boolean.TRUE.equals(cs.isOAuth)) { - return true; - } - } - return false; - } - - /** - * Returns a list of OAuth Codegen security objects - * - * @param authMethods List of auth methods. - * @return A list of OAuth Codegen security objects - */ - public static List getOAuthMethods(List authMethods) { - List oauthMethods = new ArrayList<>(); - - for (CodegenSecurity cs : authMethods) { - if (Boolean.TRUE.equals(cs.isOAuth)) { - oauthMethods.add(cs); - } - } - - return oauthMethods; - } - - - /** - * Returns true if the specified OAS model has at least one operation with OAuth authentication. - * - * @param openAPI An instance of OpenAPI - * @return True if at least one operation has OAuth security scheme defined - */ - public static boolean hasOAuthMethods(OpenAPI openAPI) { - final Map securitySchemes = getSecuritySchemes(openAPI); - if (securitySchemes != null) { - for (Map.Entry scheme : securitySchemes.entrySet()) { - if (SecurityScheme.Type.OAUTH2.equals(scheme.getValue().getType())) { - return true; - } - } - } - - return false; - } - - /** - * Returns true if the specified OAS model has at least one operation with HTTP bearer authentication. - * - * @param openAPI An instance of OpenAPI - * @return True if at least one operation has HTTP bearer security scheme defined - */ - public static boolean hasHttpBearerMethods(OpenAPI openAPI) { - final Map securitySchemes = getSecuritySchemes(openAPI); - if (securitySchemes != null) { - for (Map.Entry scheme : securitySchemes.entrySet()) { - if (SecurityScheme.Type.HTTP.equals(scheme.getValue().getType()) && "bearer".equals(scheme.getValue().getScheme())) { - return true; - } - } - } - - return false; - } - - /** - * Returns true if the specified OAS model has at least one operation with HTTP basic authentication. - * - * @param openAPI An instance of OpenAPI - * @return True if at least one operation has HTTP basic security scheme defined - */ - public static boolean hasHttpBasicMethods(OpenAPI openAPI) { - final Map securitySchemes = getSecuritySchemes(openAPI); - if (securitySchemes != null) { - for (Map.Entry scheme : securitySchemes.entrySet()) { - if (SecurityScheme.Type.HTTP.equals(scheme.getValue().getType()) && "basic".equals(scheme.getValue().getScheme())) { - return true; - } - } - } - - return false; - } - - /** - * Returns true if the specified OAS model has at least one operation with HTTP signature authentication. - * - * @param openAPI An instance of OpenAPI - * @return True if at least one operation has HTTP signature security scheme defined - */ - public static boolean hasHttpSignatureMethods(OpenAPI openAPI) { - final Map securitySchemes = getSecuritySchemes(openAPI); - if (securitySchemes != null) { - for (Map.Entry scheme : securitySchemes.entrySet()) { - if (SecurityScheme.Type.HTTP.equals(scheme.getValue().getType()) && "signature".equals(scheme.getValue().getScheme())) { - return true; - } - } - } - - return false; - } - - /** - * Returns true if the specified OAS model has at least one operation with API key authentication. - * - * @param openAPI An instance of OpenAPI - * @return True if at least one operation has API key security scheme defined - */ - public static boolean hasApiKeyMethods(OpenAPI openAPI) { - final Map securitySchemes = getSecuritySchemes(openAPI); - if (securitySchemes != null) { - for (Map.Entry scheme : securitySchemes.entrySet()) { - if (SecurityScheme.Type.APIKEY.equals(scheme.getValue().getType())) { - return true; - } - } - } - - return false; - } - - public static Map getSecuritySchemes(OpenAPI openAPI) { - if (openAPI == null) { - return null; - } else { - return openAPI.getComponents() != null ? openAPI.getComponents().getSecuritySchemes() : null; - } - } -} - diff --git a/modules/openapi-json-schema-generator/src/main/resources/Java/build.gradle.mustache b/modules/openapi-json-schema-generator/src/main/resources/Java/build.gradle.mustache index d3760936834..c9b93fbe9ea 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/Java/build.gradle.mustache +++ b/modules/openapi-json-schema-generator/src/main/resources/Java/build.gradle.mustache @@ -135,7 +135,7 @@ dependencies { implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" implementation "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:$jackson_version" {{#openApiNullable}} - implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" + implementation "org.openapijsonschematools:jackson-databind-nullable:$jackson_databind_nullable_version" {{/openApiNullable}} {{#joda}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version" diff --git a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/apache-httpclient/build.gradle.mustache b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/apache-httpclient/build.gradle.mustache index 84589d91afd..cd516b4c13c 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/apache-httpclient/build.gradle.mustache +++ b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/apache-httpclient/build.gradle.mustache @@ -135,7 +135,7 @@ dependencies { implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" implementation "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:$jackson_version" {{#openApiNullable}} - implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" + implementation "org.openapijsonschematools:jackson-databind-nullable:$jackson_databind_nullable_version" {{/openApiNullable}} {{#joda}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version" diff --git a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/feign/ApiClient.mustache b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/feign/ApiClient.mustache index cc9599940f9..d95e5cb7bcd 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/feign/ApiClient.mustache +++ b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/feign/ApiClient.mustache @@ -11,7 +11,7 @@ import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; {{#openApiNullable}} -import org.openapitools.jackson.nullable.JsonNullableModule; +import org.openapijsonschematools.jackson.nullable.JsonNullableModule; {{/openApiNullable}} {{#joda}} import com.fasterxml.jackson.datatype.joda.JodaModule; diff --git a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/feign/build.gradle.mustache b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/feign/build.gradle.mustache index 6d320edcc9a..1833df0aeb4 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/feign/build.gradle.mustache +++ b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/feign/build.gradle.mustache @@ -126,7 +126,7 @@ dependencies { implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" {{#openApiNullable}} - implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" + implementation "org.openapijsonschematools:jackson-databind-nullable:$jackson_databind_nullable_version" {{/openApiNullable}} {{#joda}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version" diff --git a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/feign/pom.mustache b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/feign/pom.mustache index 2e9e1be46a3..933d5dc1822 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/feign/pom.mustache +++ b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/feign/pom.mustache @@ -271,7 +271,7 @@ {{#openApiNullable}} - org.openapitools + org.openapijsonschematools jackson-databind-nullable ${jackson-databind-nullable-version} diff --git a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/google-api-client/ApiClient.mustache b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/google-api-client/ApiClient.mustache index c1b8e1fdd35..21b9d5d90ce 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/google-api-client/ApiClient.mustache +++ b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/google-api-client/ApiClient.mustache @@ -5,7 +5,7 @@ import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; {{#openApiNullable}} -import org.openapitools.jackson.nullable.JsonNullableModule; +import org.openapijsonschematools.jackson.nullable.JsonNullableModule; {{/openApiNullable}} {{#joda}} import com.fasterxml.jackson.datatype.joda.JodaModule; diff --git a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/google-api-client/build.gradle.mustache b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/google-api-client/build.gradle.mustache index 629facf2582..6b371866cb3 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/google-api-client/build.gradle.mustache +++ b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/google-api-client/build.gradle.mustache @@ -120,7 +120,7 @@ dependencies { implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" implementation "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:$jackson_version" {{#openApiNullable}} - implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" + implementation "org.openapijsonschematools:jackson-databind-nullable:$jackson_databind_nullable_version" {{/openApiNullable}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" {{#joda}} diff --git a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/google-api-client/pom.mustache b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/google-api-client/pom.mustache index e1d06d235e7..574ee93a767 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/google-api-client/pom.mustache +++ b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/google-api-client/pom.mustache @@ -247,7 +247,7 @@ {{#openApiNullable}} - org.openapitools + org.openapijsonschematools jackson-databind-nullable ${jackson-databind-nullable-version} diff --git a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache index bf9545f34f4..372efc2d77f 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache +++ b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache @@ -261,7 +261,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { *

    Setter for the field httpClient.

    * * @param httpClient a {@link javax.ws.rs.client.Client} object. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link org.openapijsonschematools.client.ApiClient} object. */ public ApiClient setHttpClient(Client httpClient) { this.httpClient = httpClient; @@ -281,7 +281,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Sets the base URL to the location where the OpenAPI document is being served. * * @param basePath The base URL to the target host. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link org.openapijsonschematools.client.ApiClient} object. */ public ApiClient setBasePath(String basePath) { this.basePath = basePath; @@ -304,7 +304,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { *

    Setter for the field servers.

    * * @param servers a {@link java.util.List} of servers. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link org.openapijsonschematools.client.ApiClient} object. */ public ApiClient setServers(List servers) { this.servers = servers; @@ -325,7 +325,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { *

    Setter for the field serverIndex.

    * * @param serverIndex the server index - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link org.openapijsonschematools.client.ApiClient} object. */ public ApiClient setServerIndex(Integer serverIndex) { this.serverIndex = serverIndex; @@ -346,7 +346,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { *

    Setter for the field serverVariables.

    * * @param serverVariables a {@link java.util.Map} of server variables. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link org.openapijsonschematools.client.ApiClient} object. */ public ApiClient setServerVariables(Map serverVariables) { this.serverVariables = serverVariables; @@ -393,7 +393,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set username for the first HTTP basic authentication. * * @param username Username - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link org.openapijsonschematools.client.ApiClient} object. */ public ApiClient setUsername(String username) { for (Authentication auth : authentications.values()) { @@ -409,7 +409,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set password for the first HTTP basic authentication. * * @param password Password - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link org.openapijsonschematools.client.ApiClient} object. */ public ApiClient setPassword(String password) { for (Authentication auth : authentications.values()) { @@ -425,7 +425,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set API key value for the first API key authentication. * * @param apiKey API key - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link org.openapijsonschematools.client.ApiClient} object. */ public ApiClient setApiKey(String apiKey) { for (Authentication auth : authentications.values()) { @@ -441,7 +441,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to configure authentications which respects aliases of API keys. * * @param secrets Hash map from authentication name to its secret. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link org.openapijsonschematools.client.ApiClient} object. */ public ApiClient configureApiKeys(Map secrets) { for (Map.Entry authEntry : authentications.entrySet()) { @@ -462,7 +462,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set API key prefix for the first API key authentication. * * @param apiKeyPrefix API key prefix - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link org.openapijsonschematools.client.ApiClient} object. */ public ApiClient setApiKeyPrefix(String apiKeyPrefix) { for (Authentication auth : authentications.values()) { @@ -478,7 +478,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set bearer token for the first Bearer authentication. * * @param bearerToken Bearer token - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link org.openapijsonschematools.client.ApiClient} object. */ public ApiClient setBearerToken(String bearerToken) { for (Authentication auth : authentications.values()) { @@ -495,7 +495,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set access token for the first OAuth2 authentication. * * @param accessToken Access token - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link org.openapijsonschematools.client.ApiClient} object. */ public ApiClient setAccessToken(String accessToken) { for (Authentication auth : authentications.values()) { @@ -512,7 +512,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * * @param clientId the client ID * @param clientSecret the client secret - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link org.openapijsonschematools.client.ApiClient} object. */ public ApiClient setOauthCredentials(String clientId, String clientSecret) { for (Authentication auth : authentications.values()) { @@ -529,7 +529,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * * @param username the user name * @param password the user password - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link org.openapijsonschematools.client.ApiClient} object. */ public ApiClient setOauthPasswordFlow(String username, String password) { for (Authentication auth : authentications.values()) { @@ -545,7 +545,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set the authorization code flow for the first OAuth2 authentication. * * @param code the authorization code - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link org.openapijsonschematools.client.ApiClient} object. */ public ApiClient setOauthAuthorizationCodeFlow(String code) { for (Authentication auth : authentications.values()) { @@ -561,7 +561,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set the scopes for the first OAuth2 authentication. * * @param scope the oauth scope - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link org.openapijsonschematools.client.ApiClient} object. */ public ApiClient setOauthScope(String scope) { for (Authentication auth : authentications.values()) { @@ -578,7 +578,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Set the User-Agent header's value (by adding to the default header map). * * @param userAgent Http user agent - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link org.openapijsonschematools.client.ApiClient} object. */ public ApiClient setUserAgent(String userAgent) { this.userAgent = userAgent; @@ -600,7 +600,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * * @param key The header's key * @param value The header's value - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link org.openapijsonschematools.client.ApiClient} object. */ public ApiClient addDefaultHeader(String key, String value) { defaultHeaderMap.put(key, value); @@ -612,7 +612,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * * @param key The cookie's key * @param value The cookie's value - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link org.openapijsonschematools.client.ApiClient} object. */ public ApiClient addDefaultCookie(String key, String value) { defaultCookieMap.put(key, value); @@ -632,7 +632,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Set the client config. * * @param clientConfig Set the client config - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link org.openapijsonschematools.client.ApiClient} object. */ public ApiClient setClientConfig(ClientConfig clientConfig) { this.clientConfig = clientConfig; @@ -654,7 +654,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Enable/disable debugging for this API client. * * @param debugging To enable (true) or disable (false) debugging - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link org.openapijsonschematools.client.ApiClient} object. */ public ApiClient setDebugging(boolean debugging) { this.debugging = debugging; @@ -678,7 +678,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Set temp folder path * * @param tempFolderPath Temp folder path - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link org.openapijsonschematools.client.ApiClient} object. */ public ApiClient setTempFolderPath(String tempFolderPath) { this.tempFolderPath = tempFolderPath; @@ -700,7 +700,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * {@link Integer#MAX_VALUE}. * * @param connectionTimeout Connection timeout in milliseconds - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link org.openapijsonschematools.client.ApiClient} object. */ public ApiClient setConnectTimeout(int connectionTimeout) { this.connectionTimeout = connectionTimeout; @@ -723,7 +723,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * {@link Integer#MAX_VALUE}. * * @param readTimeout Read timeout in milliseconds - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link org.openapijsonschematools.client.ApiClient} object. */ public ApiClient setReadTimeout(int readTimeout) { this.readTimeout = readTimeout; @@ -744,7 +744,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Set the date format used to parse/format date parameters. * * @param dateFormat Date format - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link org.openapijsonschematools.client.ApiClient} object. */ public ApiClient setDateFormat(DateFormat dateFormat) { this.dateFormat = dateFormat; diff --git a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/jersey2/JSON.mustache b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/jersey2/JSON.mustache index 8de585519bf..8013303c442 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/jersey2/JSON.mustache +++ b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/jersey2/JSON.mustache @@ -4,7 +4,7 @@ import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.databind.json.JsonMapper; {{#openApiNullable}} -import org.openapitools.jackson.nullable.JsonNullableModule; +import org.openapijsonschematools.jackson.nullable.JsonNullableModule; {{/openApiNullable}} import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; {{#joda}} diff --git a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache index e12528af751..43a933cbb8c 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache +++ b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache @@ -127,7 +127,7 @@ dependencies { implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" {{#openApiNullable}} - implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" + implementation "org.openapijsonschematools:jackson-databind-nullable:$jackson_databind_nullable_version" {{/openApiNullable}} {{#joda}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version" diff --git a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/jersey2/build.sbt.mustache b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/jersey2/build.sbt.mustache index 5ff4b1b0285..c579911ebdd 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/jersey2/build.sbt.mustache +++ b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/jersey2/build.sbt.mustache @@ -24,7 +24,7 @@ lazy val root = (project in file(".")). {{/joda}} "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.13.2" % "compile", {{#openApiNullable}} - "org.openapitools" % "jackson-databind-nullable" % "0.2.3" % "compile", + "org.openapijsonschematools" % "jackson-databind-nullable" % "0.2.3" % "compile", {{/openApiNullable}} {{#hasOAuthMethods}} "com.github.scribejava" % "scribejava-apis" % "8.3.1" % "compile", diff --git a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/jersey2/pojo.mustache b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/jersey2/pojo.mustache index 9faeed2eaf3..747ad0af7d4 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/jersey2/pojo.mustache +++ b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/jersey2/pojo.mustache @@ -371,7 +371,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{name}} = ({{{datatypeWithEnum}}})in.readValue(null); {{/isPrimitiveType}} {{^isPrimitiveType}} - {{name}} = ({{{datatypeWithEnum}}})in.readValue({{complexType}}.class.getClassLoader()); + {{name}} = ({{{datatypeWithEnum}}})in.readValue({{refClass}}.class.getClassLoader()); {{/isPrimitiveType}} {{/vars}} {{/isArray}} diff --git a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/jersey2/pom.mustache b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/jersey2/pom.mustache index dc5a3f4a71a..82aac4a9b8e 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/jersey2/pom.mustache +++ b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/jersey2/pom.mustache @@ -311,7 +311,7 @@ {{#openApiNullable}} - org.openapitools + org.openapijsonschematools jackson-databind-nullable ${jackson-databind-nullable-version} diff --git a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/jersey3/ApiClient.mustache b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/jersey3/ApiClient.mustache index baaa6037fab..199f40404ef 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/jersey3/ApiClient.mustache +++ b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/jersey3/ApiClient.mustache @@ -261,7 +261,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { *

    Setter for the field httpClient.

    * * @param httpClient a {@link jakarta.ws.rs.client.Client} object. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link org.openapijsonschematools.client.ApiClient} object. */ public ApiClient setHttpClient(Client httpClient) { this.httpClient = httpClient; @@ -281,7 +281,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Sets the base URL to the location where the OpenAPI document is being served. * * @param basePath The base URL to the target host. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link org.openapijsonschematools.client.ApiClient} object. */ public ApiClient setBasePath(String basePath) { this.basePath = basePath; @@ -304,7 +304,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { *

    Setter for the field servers.

    * * @param servers a {@link java.util.List} of servers. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link org.openapijsonschematools.client.ApiClient} object. */ public ApiClient setServers(List servers) { this.servers = servers; @@ -325,7 +325,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { *

    Setter for the field serverIndex.

    * * @param serverIndex the server index - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link org.openapijsonschematools.client.ApiClient} object. */ public ApiClient setServerIndex(Integer serverIndex) { this.serverIndex = serverIndex; @@ -346,7 +346,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { *

    Setter for the field serverVariables.

    * * @param serverVariables a {@link java.util.Map} of server variables. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link org.openapijsonschematools.client.ApiClient} object. */ public ApiClient setServerVariables(Map serverVariables) { this.serverVariables = serverVariables; @@ -393,7 +393,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set username for the first HTTP basic authentication. * * @param username Username - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link org.openapijsonschematools.client.ApiClient} object. */ public ApiClient setUsername(String username) { for (Authentication auth : authentications.values()) { @@ -409,7 +409,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set password for the first HTTP basic authentication. * * @param password Password - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link org.openapijsonschematools.client.ApiClient} object. */ public ApiClient setPassword(String password) { for (Authentication auth : authentications.values()) { @@ -425,7 +425,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set API key value for the first API key authentication. * * @param apiKey API key - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link org.openapijsonschematools.client.ApiClient} object. */ public ApiClient setApiKey(String apiKey) { for (Authentication auth : authentications.values()) { @@ -441,7 +441,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to configure authentications which respects aliases of API keys. * * @param secrets Hash map from authentication name to its secret. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link org.openapijsonschematools.client.ApiClient} object. */ public ApiClient configureApiKeys(Map secrets) { for (Map.Entry authEntry : authentications.entrySet()) { @@ -462,7 +462,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set API key prefix for the first API key authentication. * * @param apiKeyPrefix API key prefix - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link org.openapijsonschematools.client.ApiClient} object. */ public ApiClient setApiKeyPrefix(String apiKeyPrefix) { for (Authentication auth : authentications.values()) { @@ -478,7 +478,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set bearer token for the first Bearer authentication. * * @param bearerToken Bearer token - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link org.openapijsonschematools.client.ApiClient} object. */ public ApiClient setBearerToken(String bearerToken) { for (Authentication auth : authentications.values()) { @@ -495,7 +495,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set access token for the first OAuth2 authentication. * * @param accessToken Access token - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link org.openapijsonschematools.client.ApiClient} object. */ public ApiClient setAccessToken(String accessToken) { for (Authentication auth : authentications.values()) { @@ -512,7 +512,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * * @param clientId the client ID * @param clientSecret the client secret - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link org.openapijsonschematools.client.ApiClient} object. */ public ApiClient setOauthCredentials(String clientId, String clientSecret) { for (Authentication auth : authentications.values()) { @@ -529,7 +529,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * * @param username the user name * @param password the user password - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link org.openapijsonschematools.client.ApiClient} object. */ public ApiClient setOauthPasswordFlow(String username, String password) { for (Authentication auth : authentications.values()) { @@ -545,7 +545,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set the authorization code flow for the first OAuth2 authentication. * * @param code the authorization code - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link org.openapijsonschematools.client.ApiClient} object. */ public ApiClient setOauthAuthorizationCodeFlow(String code) { for (Authentication auth : authentications.values()) { @@ -561,7 +561,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set the scopes for the first OAuth2 authentication. * * @param scope the oauth scope - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link org.openapijsonschematools.client.ApiClient} object. */ public ApiClient setOauthScope(String scope) { for (Authentication auth : authentications.values()) { @@ -578,7 +578,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Set the User-Agent header's value (by adding to the default header map). * * @param userAgent Http user agent - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link org.openapijsonschematools.client.ApiClient} object. */ public ApiClient setUserAgent(String userAgent) { this.userAgent = userAgent; @@ -600,7 +600,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * * @param key The header's key * @param value The header's value - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link org.openapijsonschematools.client.ApiClient} object. */ public ApiClient addDefaultHeader(String key, String value) { defaultHeaderMap.put(key, value); @@ -612,7 +612,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * * @param key The cookie's key * @param value The cookie's value - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link org.openapijsonschematools.client.ApiClient} object. */ public ApiClient addDefaultCookie(String key, String value) { defaultCookieMap.put(key, value); @@ -632,7 +632,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Set the client config. * * @param clientConfig Set the client config - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link org.openapijsonschematools.client.ApiClient} object. */ public ApiClient setClientConfig(ClientConfig clientConfig) { this.clientConfig = clientConfig; @@ -654,7 +654,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Enable/disable debugging for this API client. * * @param debugging To enable (true) or disable (false) debugging - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link org.openapijsonschematools.client.ApiClient} object. */ public ApiClient setDebugging(boolean debugging) { this.debugging = debugging; @@ -678,7 +678,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Set temp folder path * * @param tempFolderPath Temp folder path - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link org.openapijsonschematools.client.ApiClient} object. */ public ApiClient setTempFolderPath(String tempFolderPath) { this.tempFolderPath = tempFolderPath; @@ -700,7 +700,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * {@link Integer#MAX_VALUE}. * * @param connectionTimeout Connection timeout in milliseconds - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link org.openapijsonschematools.client.ApiClient} object. */ public ApiClient setConnectTimeout(int connectionTimeout) { this.connectionTimeout = connectionTimeout; @@ -723,7 +723,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * {@link Integer#MAX_VALUE}. * * @param readTimeout Read timeout in milliseconds - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link org.openapijsonschematools.client.ApiClient} object. */ public ApiClient setReadTimeout(int readTimeout) { this.readTimeout = readTimeout; @@ -744,7 +744,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Set the date format used to parse/format date parameters. * * @param dateFormat Date format - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link org.openapijsonschematools.client.ApiClient} object. */ public ApiClient setDateFormat(DateFormat dateFormat) { this.dateFormat = dateFormat; diff --git a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/jersey3/JSON.mustache b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/jersey3/JSON.mustache index aea0628ac37..8b57a58cc38 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/jersey3/JSON.mustache +++ b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/jersey3/JSON.mustache @@ -4,7 +4,7 @@ import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.databind.json.JsonMapper; {{#openApiNullable}} -import org.openapitools.jackson.nullable.JsonNullableModule; +import org.openapijsonschematools.jackson.nullable.JsonNullableModule; {{/openApiNullable}} import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; {{#joda}} diff --git a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/jersey3/build.gradle.mustache b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/jersey3/build.gradle.mustache index 8c555046415..545183aea7a 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/jersey3/build.gradle.mustache +++ b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/jersey3/build.gradle.mustache @@ -127,7 +127,7 @@ dependencies { implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" {{#openApiNullable}} - implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" + implementation "org.openapijsonschematools:jackson-databind-nullable:$jackson_databind_nullable_version" {{/openApiNullable}} {{#joda}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version" diff --git a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/jersey3/build.sbt.mustache b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/jersey3/build.sbt.mustache index 1574b6e6df7..fbf3223a1ab 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/jersey3/build.sbt.mustache +++ b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/jersey3/build.sbt.mustache @@ -24,7 +24,7 @@ lazy val root = (project in file(".")). {{/joda}} "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.13.2" % "compile", {{#openApiNullable}} - "org.openapitools" % "jackson-databind-nullable" % "0.2.3" % "compile", + "org.openapijsonschematools" % "jackson-databind-nullable" % "0.2.3" % "compile", {{/openApiNullable}} {{#hasOAuthMethods}} "com.github.scribejava" % "scribejava-apis" % "8.3.1" % "compile", diff --git a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/jersey3/pojo.mustache b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/jersey3/pojo.mustache index 156cc4cd5cc..29476fedbdb 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/jersey3/pojo.mustache +++ b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/jersey3/pojo.mustache @@ -371,7 +371,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{name}} = ({{{datatypeWithEnum}}})in.readValue(null); {{/isPrimitiveType}} {{^isPrimitiveType}} - {{name}} = ({{{datatypeWithEnum}}})in.readValue({{complexType}}.class.getClassLoader()); + {{name}} = ({{{datatypeWithEnum}}})in.readValue({{refClass}}.class.getClassLoader()); {{/isPrimitiveType}} {{/vars}} {{/isArray}} diff --git a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/jersey3/pom.mustache b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/jersey3/pom.mustache index 9427390e9e2..16842c236da 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/jersey3/pom.mustache +++ b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/jersey3/pom.mustache @@ -311,7 +311,7 @@ {{#openApiNullable}} - org.openapitools + org.openapijsonschematools jackson-databind-nullable ${jackson-databind-nullable-version} diff --git a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/native/ApiClient.mustache b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/native/ApiClient.mustache index 14add046a0b..ebb2254b214 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/native/ApiClient.mustache +++ b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/native/ApiClient.mustache @@ -7,7 +7,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; {{#openApiNullable}} -import org.openapitools.jackson.nullable.JsonNullableModule; +import org.openapijsonschematools.jackson.nullable.JsonNullableModule; {{/openApiNullable}} import java.io.InputStream; diff --git a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/native/JSON.mustache b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/native/JSON.mustache index a13bf2fdf3e..60351dd960a 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/native/JSON.mustache +++ b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/native/JSON.mustache @@ -3,7 +3,7 @@ package {{invokerPackage}}; import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.*; {{#openApiNullable}} -import org.openapitools.jackson.nullable.JsonNullableModule; +import org.openapijsonschematools.jackson.nullable.JsonNullableModule; {{/openApiNullable}} import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; {{#joda}} diff --git a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/native/build.gradle.mustache b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/native/build.gradle.mustache index abeb66295a9..ffcb620f014 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/native/build.gradle.mustache +++ b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/native/build.gradle.mustache @@ -75,7 +75,7 @@ dependencies { implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_version" implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" - implementation "org.openapitools:jackson-databind-nullable:0.2.1" + implementation "org.openapijsonschematools:jackson-databind-nullable:0.2.1" implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" testImplementation "junit:junit:$junit_version" } diff --git a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/native/pojo.mustache b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/native/pojo.mustache index 804a2154e0e..6147777f578 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/native/pojo.mustache +++ b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/native/pojo.mustache @@ -371,7 +371,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{name}} = ({{{datatypeWithEnum}}})in.readValue(null); {{/isPrimitiveType}} {{^isPrimitiveType}} - {{name}} = ({{{datatypeWithEnum}}})in.readValue({{complexType}}.class.getClassLoader()); + {{name}} = ({{{datatypeWithEnum}}})in.readValue({{refClass}}.class.getClassLoader()); {{/isPrimitiveType}} {{/vars}} {{/isArray}} diff --git a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/native/pom.mustache b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/native/pom.mustache index 2b7635be357..8f4f7d40ec5 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/native/pom.mustache +++ b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/native/pom.mustache @@ -189,7 +189,7 @@ ${jackson-version} - org.openapitools + org.openapijsonschematools jackson-databind-nullable ${jackson-databind-nullable-version} diff --git a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache index 17258d13e7a..22791e00ca5 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache +++ b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache @@ -119,7 +119,7 @@ dependencies { implementation 'javax.ws.rs:jsr311-api:1.1.1' implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' {{#openApiNullable}} - implementation 'org.openapitools:jackson-databind-nullable:0.2.3' + implementation 'org.openapijsonschematools:jackson-databind-nullable:0.2.3' {{/openApiNullable}} {{#hasOAuthMethods}} implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.1' diff --git a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/okhttp-gson/build.sbt.mustache b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/okhttp-gson/build.sbt.mustache index e3612cb5d9f..322802f07a4 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/okhttp-gson/build.sbt.mustache +++ b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/okhttp-gson/build.sbt.mustache @@ -17,7 +17,7 @@ lazy val root = (project in file(".")). "javax.ws.rs" % "jsr311-api" % "1.1.1", "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", {{#openApiNullable}} - "org.openapitools" % "jackson-databind-nullable" % "0.2.3", + "org.openapijsonschematools" % "jackson-databind-nullable" % "0.2.3", {{/openApiNullable}} {{#hasOAuthMethods}} "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1", diff --git a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/okhttp-gson/pojo.mustache b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/okhttp-gson/pojo.mustache index 48962a371e2..c76e0dfaace 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/okhttp-gson/pojo.mustache +++ b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/okhttp-gson/pojo.mustache @@ -382,7 +382,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{name}} = ({{{datatypeWithEnum}}})in.readValue(null); {{/isPrimitiveType}} {{^isPrimitiveType}} - {{name}} = ({{{datatypeWithEnum}}})in.readValue({{complexType}}.class.getClassLoader()); + {{name}} = ({{{datatypeWithEnum}}})in.readValue({{refClass}}.class.getClassLoader()); {{/isPrimitiveType}} {{/vars}} {{/isArray}} diff --git a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/okhttp-gson/pom.mustache b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/okhttp-gson/pom.mustache index 992436ede09..4289e53894f 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/okhttp-gson/pom.mustache +++ b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/okhttp-gson/pom.mustache @@ -360,7 +360,7 @@ {{#openApiNullable}} - org.openapitools + org.openapijsonschematools jackson-databind-nullable ${jackson-databind-nullable-version} diff --git a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/rest-assured/JacksonObjectMapper.mustache b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/rest-assured/JacksonObjectMapper.mustache index 8919eda30e9..bc20f0ac737 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/rest-assured/JacksonObjectMapper.mustache +++ b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/rest-assured/JacksonObjectMapper.mustache @@ -5,7 +5,7 @@ package {{invokerPackage}}; import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.*; {{#openApiNullable}} -import org.openapitools.jackson.nullable.JsonNullableModule; +import org.openapijsonschematools.jackson.nullable.JsonNullableModule; {{/openApiNullable}} import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; {{#joda}} diff --git a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/rest-assured/build.gradle.mustache b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/rest-assured/build.gradle.mustache index 4c9801cfdc4..b3f4bfa0f50 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/rest-assured/build.gradle.mustache +++ b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/rest-assured/build.gradle.mustache @@ -128,7 +128,7 @@ dependencies { implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" implementation "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:$jackson_version" {{#openApiNullable}} - implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" + implementation "org.openapijsonschematools:jackson-databind-nullable:$jackson_databind_nullable_version" {{/openApiNullable}} {{#withXml}} implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-xml:$jackson_version" diff --git a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/rest-assured/build.sbt.mustache b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/rest-assured/build.sbt.mustache index 47acb40b9c5..50b5d2e4c9b 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/rest-assured/build.sbt.mustache +++ b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/rest-assured/build.sbt.mustache @@ -18,7 +18,7 @@ lazy val root = (project in file(".")). "com.fasterxml.jackson.core" % "jackson-annotations" % "2.12.5", "com.fasterxml.jackson.core" % "jackson-databind" % "2.12.6.1", {{#openApiNullable}} - "org.openapitools" % "jackson-databind-nullable" % "0.2.3", + "org.openapijsonschematools" % "jackson-databind-nullable" % "0.2.3", {{/openApiNullable}} {{#withXml}} "com.fasterxml.jackson.dataformat" % "jackson-dataformat-xml" % "2.12.6.1", diff --git a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/rest-assured/pom.mustache b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/rest-assured/pom.mustache index b1d15a0dc80..bcf23460741 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/rest-assured/pom.mustache +++ b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/rest-assured/pom.mustache @@ -277,7 +277,7 @@ jackson-databind - org.openapitools + org.openapijsonschematools jackson-databind-nullable ${jackson-databind-nullable-version} diff --git a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/resteasy/JSON.mustache b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/resteasy/JSON.mustache index 71bd624f7ed..86ce1563d35 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/resteasy/JSON.mustache +++ b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/resteasy/JSON.mustache @@ -3,7 +3,7 @@ package {{invokerPackage}}; import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.*; {{#openApiNullable}} -import org.openapitools.jackson.nullable.JsonNullableModule; +import org.openapijsonschematools.jackson.nullable.JsonNullableModule; {{/openApiNullable}} import com.fasterxml.jackson.datatype.jsr310.*; diff --git a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/resteasy/build.gradle.mustache b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/resteasy/build.gradle.mustache index 1ab85d70556..38c3cc2a468 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/resteasy/build.gradle.mustache +++ b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/resteasy/build.gradle.mustache @@ -120,7 +120,7 @@ dependencies { implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" implementation "com.github.joschi.jackson:jackson-datatype-threetenbp:$threetenbp_version" {{#openApiNullable}} - implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" + implementation "org.openapijsonschematools:jackson-databind-nullable:$jackson_databind_nullable_version" {{/openApiNullable}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" diff --git a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/resteasy/pom.mustache b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/resteasy/pom.mustache index 12f66fe0852..8273f6c47c4 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/resteasy/pom.mustache +++ b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/resteasy/pom.mustache @@ -226,7 +226,7 @@ {{#openApiNullable}} - org.openapitools + org.openapijsonschematools jackson-databind-nullable ${jackson-databind-nullable-version} diff --git a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache index b5de6ce3a19..a5e370a8fda 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache +++ b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache @@ -36,7 +36,7 @@ import org.springframework.web.client.RestTemplate; import org.springframework.web.util.UriComponentsBuilder; import org.springframework.web.util.DefaultUriBuilderFactory; {{#openApiNullable}} -import org.openapitools.jackson.nullable.JsonNullableModule; +import org.openapijsonschematools.jackson.nullable.JsonNullableModule; {{/openApiNullable}} diff --git a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/resttemplate/build.gradle.mustache b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/resttemplate/build.gradle.mustache index edf70a6237a..65b29ea2459 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/resttemplate/build.gradle.mustache +++ b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/resttemplate/build.gradle.mustache @@ -119,7 +119,7 @@ dependencies { implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" implementation "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:$jackson_version" {{#openApiNullable}} - implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" + implementation "org.openapijsonschematools:jackson-databind-nullable:$jackson_databind_nullable_version" {{/openApiNullable}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" {{#joda}} diff --git a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/resttemplate/pom.mustache b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/resttemplate/pom.mustache index 5ed113c4bdc..a3ffe3321f2 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/resttemplate/pom.mustache +++ b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/resttemplate/pom.mustache @@ -252,7 +252,7 @@ ${jackson-version} - org.openapitools + org.openapijsonschematools jackson-databind-nullable ${jackson-databind-nullable-version} diff --git a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache index 7f2b0569ae8..f8b54d0450e 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache +++ b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache @@ -151,7 +151,7 @@ dependencies { implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" {{#openApiNullable}} - implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" + implementation "org.openapijsonschematools:jackson-databind-nullable:$jackson_databind_nullable_version" {{/openApiNullable}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" {{/usePlayWS}} diff --git a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/retrofit2/play24/ApiClient.mustache b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/retrofit2/play24/ApiClient.mustache index c43f800a42c..fe0060524ff 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/retrofit2/play24/ApiClient.mustache +++ b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/retrofit2/play24/ApiClient.mustache @@ -10,7 +10,7 @@ import retrofit2.converter.scalars.ScalarsConverterFactory; import retrofit2.converter.jackson.JacksonConverterFactory; import com.fasterxml.jackson.databind.ObjectMapper; {{#openApiNullable}} -import org.openapitools.jackson.nullable.JsonNullableModule; +import org.openapijsonschematools.jackson.nullable.JsonNullableModule; {{/openApiNullable}} import play.libs.Json; diff --git a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/retrofit2/play25/ApiClient.mustache b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/retrofit2/play25/ApiClient.mustache index 849e0665e8c..65e8f4f961b 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/retrofit2/play25/ApiClient.mustache +++ b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/retrofit2/play25/ApiClient.mustache @@ -10,7 +10,7 @@ import retrofit2.converter.scalars.ScalarsConverterFactory; import retrofit2.converter.jackson.JacksonConverterFactory; import com.fasterxml.jackson.databind.ObjectMapper; {{#openApiNullable}} -import org.openapitools.jackson.nullable.JsonNullableModule; +import org.openapijsonschematools.jackson.nullable.JsonNullableModule; {{/openApiNullable}} import play.libs.Json; diff --git a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/retrofit2/play26/ApiClient.mustache b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/retrofit2/play26/ApiClient.mustache index b752b433d05..83bfd34c8dc 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/retrofit2/play26/ApiClient.mustache +++ b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/retrofit2/play26/ApiClient.mustache @@ -15,7 +15,7 @@ import retrofit2.Retrofit; import retrofit2.converter.scalars.ScalarsConverterFactory; import retrofit2.converter.jackson.JacksonConverterFactory; {{#openApiNullable}} -import org.openapitools.jackson.nullable.JsonNullableModule; +import org.openapijsonschematools.jackson.nullable.JsonNullableModule; {{/openApiNullable}} import play.libs.Json; diff --git a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/retrofit2/pom.mustache b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/retrofit2/pom.mustache index ce5a737fd40..a65a101574c 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/retrofit2/pom.mustache +++ b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/retrofit2/pom.mustache @@ -303,7 +303,7 @@ {{#openApiNullable}} - org.openapitools + org.openapijsonschematools jackson-databind-nullable ${jackson-databind-nullable-version} diff --git a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/vertx/ApiClient.mustache b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/vertx/ApiClient.mustache index 68253df0bde..ffbe28f7576 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/vertx/ApiClient.mustache +++ b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/vertx/ApiClient.mustache @@ -16,7 +16,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; {{#openApiNullable}} -import org.openapitools.jackson.nullable.JsonNullableModule; +import org.openapijsonschematools.jackson.nullable.JsonNullableModule; {{/openApiNullable}} import io.vertx.core.*; import io.vertx.core.buffer.Buffer; diff --git a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/vertx/build.gradle.mustache b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/vertx/build.gradle.mustache index 8e8a20e422d..f51e08d21ad 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/vertx/build.gradle.mustache +++ b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/vertx/build.gradle.mustache @@ -53,7 +53,7 @@ dependencies { {{/joda}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" {{#openApiNullable}} - implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" + implementation "org.openapijsonschematools:jackson-databind-nullable:$jackson_databind_nullable_version" {{/openApiNullable}} implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" testImplementation "junit:junit:$junit_version" diff --git a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/vertx/pom.mustache b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/vertx/pom.mustache index c32d1152404..47f677cf5b8 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/vertx/pom.mustache +++ b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/vertx/pom.mustache @@ -249,7 +249,7 @@ {{#openApiNullable}} - org.openapitools + org.openapijsonschematools jackson-databind-nullable ${jackson-databind-nullable-version} diff --git a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/webclient/ApiClient.mustache b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/webclient/ApiClient.mustache index aeed99cbc1e..f2a7140f49b 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/webclient/ApiClient.mustache +++ b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/webclient/ApiClient.mustache @@ -4,7 +4,7 @@ import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; {{#openApiNullable}} -import org.openapitools.jackson.nullable.JsonNullableModule; +import org.openapijsonschematools.jackson.nullable.JsonNullableModule; {{/openApiNullable}} import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; diff --git a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/webclient/build.gradle.mustache b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/webclient/build.gradle.mustache index 25b48657357..2c1eb77e26a 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/webclient/build.gradle.mustache +++ b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/webclient/build.gradle.mustache @@ -137,7 +137,7 @@ dependencies { implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" implementation "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:$jackson_version" {{#openApiNullable}} - implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" + implementation "org.openapijsonschematools:jackson-databind-nullable:$jackson_databind_nullable_version" {{/openApiNullable}} {{#joda}} implementation "joda-time:joda-time:$jodatime_version" diff --git a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/webclient/pom.mustache b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/webclient/pom.mustache index e64caffb31f..5fa0147ab1c 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/webclient/pom.mustache +++ b/modules/openapi-json-schema-generator/src/main/resources/Java/libraries/webclient/pom.mustache @@ -106,7 +106,7 @@ {{#openApiNullable}} - org.openapitools + org.openapijsonschematools jackson-databind-nullable ${jackson-databind-nullable-version} diff --git a/modules/openapi-json-schema-generator/src/main/resources/Java/oneof_interface.mustache b/modules/openapi-json-schema-generator/src/main/resources/Java/oneof_interface.mustache index 02deb483d5f..47240cbe8c6 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/Java/oneof_interface.mustache +++ b/modules/openapi-json-schema-generator/src/main/resources/Java/oneof_interface.mustache @@ -1,6 +1,6 @@ {{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{>typeInfoAnnotation}}{{>xmlAnnotation}} public interface {{classname}} {{#vendorExtensions.x-implements}}{{#-first}}extends {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{/vendorExtensions.x-implements}} { {{#discriminator}} - public {{propertyType}} {{propertyGetter}}(); + public String {{propertyGetter}}(); {{/discriminator}} } diff --git a/modules/openapi-json-schema-generator/src/main/resources/Java/pojo.mustache b/modules/openapi-json-schema-generator/src/main/resources/Java/pojo.mustache index 5972ac9f29e..e59d7995d6b 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/Java/pojo.mustache +++ b/modules/openapi-json-schema-generator/src/main/resources/Java/pojo.mustache @@ -359,7 +359,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{name}} = ({{{datatypeWithEnum}}})in.readValue(null); {{/isPrimitiveType}} {{^isPrimitiveType}} - {{name}} = ({{{datatypeWithEnum}}})in.readValue({{complexType}}.class.getClassLoader()); + {{name}} = ({{{datatypeWithEnum}}})in.readValue({{refClass}}.class.getClassLoader()); {{/isPrimitiveType}} {{/vars}} {{/isArray}} diff --git a/modules/openapi-json-schema-generator/src/main/resources/META-INF/services/org.openapijsonschematools.codegen.CodegenConfig b/modules/openapi-json-schema-generator/src/main/resources/META-INF/services/org.openapijsonschematools.codegen.CodegenConfig new file mode 100644 index 00000000000..32cd07b3ccd --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/META-INF/services/org.openapijsonschematools.codegen.CodegenConfig @@ -0,0 +1,5 @@ +org.openapijsonschematools.codegen.languages.KotlinClientCodegen +org.openapijsonschematools.codegen.languages.JavaClientCodegen +org.openapijsonschematools.codegen.languages.JavaJerseyServerCodegen +org.openapijsonschematools.codegen.languages.JMeterClientCodegen +org.openapijsonschematools.codegen.languages.PythonClientCodegen diff --git a/modules/openapi-json-schema-generator/src/main/resources/META-INF/services/org.openapijsonschematools.codegen.api.TemplatingEngineAdapter b/modules/openapi-json-schema-generator/src/main/resources/META-INF/services/org.openapijsonschematools.codegen.api.TemplatingEngineAdapter new file mode 100644 index 00000000000..6c579a5d558 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/META-INF/services/org.openapijsonschematools.codegen.api.TemplatingEngineAdapter @@ -0,0 +1,2 @@ +org.openapijsonschematools.codegen.templating.MustacheEngineAdapter +org.openapijsonschematools.codegen.templating.HandlebarsEngineAdapter diff --git a/modules/openapi-json-schema-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig b/modules/openapi-json-schema-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig deleted file mode 100644 index 28cfdfa0ffa..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig +++ /dev/null @@ -1,5 +0,0 @@ -org.openapitools.codegen.languages.KotlinClientCodegen -org.openapitools.codegen.languages.JavaClientCodegen -org.openapitools.codegen.languages.JavaJerseyServerCodegen -org.openapitools.codegen.languages.JMeterClientCodegen -org.openapitools.codegen.languages.PythonClientCodegen diff --git a/modules/openapi-json-schema-generator/src/main/resources/META-INF/services/org.openapitools.codegen.api.TemplatingEngineAdapter b/modules/openapi-json-schema-generator/src/main/resources/META-INF/services/org.openapitools.codegen.api.TemplatingEngineAdapter deleted file mode 100644 index f642b74596e..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/META-INF/services/org.openapitools.codegen.api.TemplatingEngineAdapter +++ /dev/null @@ -1,2 +0,0 @@ -org.openapitools.codegen.templating.MustacheEngineAdapter -org.openapitools.codegen.templating.HandlebarsEngineAdapter diff --git a/modules/openapi-json-schema-generator/src/main/resources/_common/.openapi-generator-ignore b/modules/openapi-json-schema-generator/src/main/resources/_common/.openapi-generator-ignore index 7484ee590a3..d24a2da8ae5 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/_common/.openapi-generator-ignore +++ b/modules/openapi-json-schema-generator/src/main/resources/_common/.openapi-generator-ignore @@ -1,5 +1,5 @@ # OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator +# Generated by openapi-generator https://github.com/openapi-json-schema-tools/openapi-json-schema-generator # Use this file to prevent files from being overwritten by the generator. # The patterns follow closely to .gitignore or .dockerignore. diff --git a/modules/openapi-json-schema-generator/src/main/resources/codegen/README.mustache b/modules/openapi-json-schema-generator/src/main/resources/codegen/README.mustache index 0ab1584ea15..8ac401d8e6a 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/codegen/README.mustache +++ b/modules/openapi-json-schema-generator/src/main/resources/codegen/README.mustache @@ -27,7 +27,7 @@ At this point, you've likely generated a client setup. It will include somethin |----- {{name}} // template files |----- META-INF |------ services -|------- org.openapitools.codegen.CodegenConfig +|------- CodegenConfig ``` You _will_ need to make changes in at least the following: @@ -48,13 +48,13 @@ In your generator project. A single jar file will be produced in `target`. You c For mac/linux: ``` -java -cp /path/to/openapi-generator-cli.jar:/path/to/your.jar org.openapitools.codegen.OpenAPIGenerator generate -g {{name}} -i /path/to/openapi.yaml -o ./test +java -cp /path/to/openapi-generator-cli.jar:/path/to/your.jar OpenAPIGenerator generate -g {{name}} -i /path/to/openapi.yaml -o ./test ``` (Do not forget to replace the values `/path/to/openapi-generator-cli.jar`, `/path/to/your.jar` and `/path/to/openapi.yaml` in the previous command) For Windows users, you will need to use `;` instead of `:` in the classpath, e.g. ``` -java -cp /path/to/openapi-generator-cli.jar;/path/to/your.jar org.openapitools.codegen.OpenAPIGenerator generate -g {{name}} -i /path/to/openapi.yaml -o ./test +java -cp /path/to/openapi-generator-cli.jar;/path/to/your.jar OpenAPIGenerator generate -g {{name}} -i /path/to/openapi.yaml -o ./test ``` Now your templates are available to the client generator and you can write output values @@ -78,7 +78,7 @@ the object you have available during client generation: # -DdebugOperations prints operations passed to the template engine # -DdebugSupportingFiles prints additional data passed to the template engine -java -DdebugOperations -cp /path/to/openapi-generator-cli.jar:/path/to/your.jar org.openapitools.codegen.OpenAPIGenerator generate -g {{name}} -i /path/to/openapi.yaml -o ./test +java -DdebugOperations -cp /path/to/openapi-generator-cli.jar:/path/to/your.jar OpenAPIGenerator generate -g {{name}} -i /path/to/openapi.yaml -o ./test ``` Will, for example, output the debug info for operations. diff --git a/modules/openapi-json-schema-generator/src/main/resources/codegen/generatorClass.mustache b/modules/openapi-json-schema-generator/src/main/resources/codegen/generatorClass.mustache index 4f89b0f502a..cee2e7d26a7 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/codegen/generatorClass.mustache +++ b/modules/openapi-json-schema-generator/src/main/resources/codegen/generatorClass.mustache @@ -1,7 +1,7 @@ package {{generatorPackage}}; -import org.openapitools.codegen.*; -import org.openapitools.codegen.model.*; +import org.openapijsonschematools.codegen.*; +import org.openapijsonschematools.codegen.model.*; import io.swagger.models.properties.*; import java.util.*; @@ -17,7 +17,7 @@ public class {{generatorClass}} extends DefaultCodegen implements CodegenConfig * Configures the type of generator. * * @return the CodegenType for this generator - * @see org.openapitools.codegen.CodegenType + * @see CodegenType */ public CodegenType getTag() { return CodegenType.{{generatorType}}; @@ -101,12 +101,12 @@ public class {{generatorClass}} extends DefaultCodegen implements CodegenConfig /** * Api Package. Optional, if needed, this can be used in templates */ - apiPackage = "org.openapitools.api"; + apiPackage = "org.openapijsonschematools.api"; /** * Model Package. Optional, if needed, this can be used in templates */ - modelPackage = "org.openapitools.model"; + modelPackage = "org.openapijsonschematools.model"; /** * Reserved words. Override this with reserved words specific to your language diff --git a/modules/openapi-json-schema-generator/src/main/resources/codegen/generatorClassTest.mustache b/modules/openapi-json-schema-generator/src/main/resources/codegen/generatorClassTest.mustache index d4773b14f81..21235713d69 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/codegen/generatorClassTest.mustache +++ b/modules/openapi-json-schema-generator/src/main/resources/codegen/generatorClassTest.mustache @@ -1,9 +1,9 @@ package {{generatorPackage}}; import org.junit.Test; -import org.openapitools.codegen.ClientOptInput; -import org.openapitools.codegen.DefaultGenerator; -import org.openapitools.codegen.config.CodegenConfigurator; +import ClientOptInput; +import DefaultGenerator; +import CodegenConfigurator; /*** * This test allows you to easily launch your code generation software under a debugger. @@ -22,11 +22,11 @@ public class {{generatorClass}}Test { @Test public void launchCodeGenerator() { // to understand how the 'openapi-generator-cli' module is using 'CodegenConfigurator', have a look at the 'Generate' class: - // https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/Generate.java + // https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator-cli/src/main/java/org/openapijsonschematools/codegen/cmd/Generate.java final CodegenConfigurator configurator = new CodegenConfigurator() .setGeneratorName("{{name}}") // use this codegen library .setInputSpec("../../../modules/openapi-generator/src/test/resources/2_0/petstore.yaml") // sample OpenAPI file - // .setInputSpec("https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml") // or from the server + // .setInputSpec("https://raw.githubusercontent.com/openapi-json-schema-tools/openapi-json-schema-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml") // or from the server .setOutputDir("out/{{name}}"); // output directory final ClientOptInput clientOptInput = configurator.toClientOptInput(); diff --git a/modules/openapi-json-schema-generator/src/main/resources/codegen/kotlin/README.mustache b/modules/openapi-json-schema-generator/src/main/resources/codegen/kotlin/README.mustache index 1c026bed904..cb8edb7e73d 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/codegen/kotlin/README.mustache +++ b/modules/openapi-json-schema-generator/src/main/resources/codegen/kotlin/README.mustache @@ -49,10 +49,10 @@ To build as a shadowJar, run: To list generators via OpenAPI Generator CLI, you must refer to the CLI jar explicitly. We add a custom copy task which includes the CLI jar in the build output directory: ```bash -java -cp build/libs/openapi-generator-cli-4.1.3.jar:build/libs/{{kebabName}}-openapi-generator-1.0-SNAPSHOT-all.jar org.openapitools.codegen.OpenAPIGenerator list +java -cp build/libs/openapi-generator-cli-4.1.3.jar:build/libs/{{kebabName}}-openapi-generator-1.0-SNAPSHOT-all.jar OpenAPIGenerator list ``` -Notice that this command _must_ pass classpath via `-cp` and include OpenAPI Generator CLI as well as the artifact built from this project. Also notice that the manifest class must be passed explicitly as `org.openapitools.codegen.OpenAPIGenerator`. +Notice that this command _must_ pass classpath via `-cp` and include OpenAPI Generator CLI as well as the artifact built from this project. Also notice that the manifest class must be passed explicitly as `OpenAPIGenerator`. ## See Also diff --git a/modules/openapi-json-schema-generator/src/main/resources/codegen/kotlin/build_gradle.mustache b/modules/openapi-json-schema-generator/src/main/resources/codegen/kotlin/build_gradle.mustache index 2a61f06ce2a..25d52121fc0 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/codegen/kotlin/build_gradle.mustache +++ b/modules/openapi-json-schema-generator/src/main/resources/codegen/kotlin/build_gradle.mustache @@ -6,7 +6,7 @@ plugins { id("com.github.johnrengelman.shadow") version("5.0.0") } -group = "org.openapitools" +group = "org.openapijsonschematools" version = "1.0-SNAPSHOT" repositories { @@ -18,9 +18,9 @@ dependencies { val openapiGeneratorVersion = "4.1.3" implementation(kotlin("stdlib-jdk8")) - implementation("org.openapitools:openapi-generator:$openapiGeneratorVersion") + implementation("org.openapijsonschematools:openapi-generator:$openapiGeneratorVersion") - runtime("org.openapitools:openapi-generator-cli:$openapiGeneratorVersion") + runtime("org.openapijsonschematools:openapi-generator-cli:$openapiGeneratorVersion") testImplementation("org.junit.jupiter:junit-jupiter:5.5.2") } @@ -48,7 +48,7 @@ tasks.register("standalone") { mergeServiceFiles() - manifest.attributes(mapOf("Main-Class" to "org.openapitools.codegen.OpenAPIGenerator")) + manifest.attributes(mapOf("Main-Class" to "OpenAPIGenerator")) } tasks.withType { diff --git a/modules/openapi-json-schema-generator/src/main/resources/codegen/kotlin/generatorClass.mustache b/modules/openapi-json-schema-generator/src/main/resources/codegen/kotlin/generatorClass.mustache index 17384f2f95d..3e3c5ca3416 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/codegen/kotlin/generatorClass.mustache +++ b/modules/openapi-json-schema-generator/src/main/resources/codegen/kotlin/generatorClass.mustache @@ -1,8 +1,8 @@ @file:JvmName("{{generatorClass}}") package {{generatorPackage}} -import org.openapitools.codegen.* -import org.openapitools.codegen.model.*; +import org.openapijsonschematools.codegen.* +import org.openapijsonschematools.codegen.model.*; import java.util.* import java.io.File @@ -17,7 +17,7 @@ open class {{generatorClass}}() : DefaultCodegen(), CodegenConfig { * Configures the type of generator. * * @return the CodegenType for this generator - * @see org.openapitools.codegen.CodegenType + * @see CodegenType */ override fun getTag(): CodegenType { return CodegenType.{{generatorType}} @@ -90,12 +90,12 @@ open class {{generatorClass}}() : DefaultCodegen(), CodegenConfig { /** * Api Package. Optional, if needed, this can be used in templates */ - apiPackage = "org.openapitools.api" + apiPackage = "org.openapijsonschematools.api" /** * Model Package. Optional, if needed, this can be used in templates */ - modelPackage = "org.openapitools.model" + modelPackage = "org.openapijsonschematools.model" /** * Reserved words. Override this with reserved words specific to your language diff --git a/modules/openapi-json-schema-generator/src/main/resources/codegen/kotlin/generatorClassTest.mustache b/modules/openapi-json-schema-generator/src/main/resources/codegen/kotlin/generatorClassTest.mustache index c1276791bcc..3f61403a587 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/codegen/kotlin/generatorClassTest.mustache +++ b/modules/openapi-json-schema-generator/src/main/resources/codegen/kotlin/generatorClassTest.mustache @@ -2,9 +2,9 @@ package {{generatorPackage}} import org.junit.jupiter.api.Assertions.* import org.junit.jupiter.api.Test -import org.openapitools.codegen.ClientOptInput -import org.openapitools.codegen.DefaultGenerator -import org.openapitools.codegen.config.CodegenConfigurator +import ClientOptInput +import DefaultGenerator +import CodegenConfigurator internal class {{generatorClass}}Test { @@ -13,10 +13,10 @@ internal class {{generatorClass}}Test { @Test fun launchCodeGenerator() { // to understand how the 'openapi-generator-cli' module is using 'CodegenConfigurator', have a look at the 'Generate' class: - // https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/Generate.java + // https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator-cli/src/main/java/org/openapijsonschematools/codegen/cmd/Generate.java val configurator: CodegenConfigurator = CodegenConfigurator() .setGeneratorName("{{name}}") - .setInputSpec("https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml") // or from the server + .setInputSpec("https://raw.githubusercontent.com/openapi-json-schema-tools/openapi-json-schema-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml") // or from the server .setOutputDir("out/{{name}}") val clientOptInput: ClientOptInput = configurator.toClientOptInput() diff --git a/modules/openapi-json-schema-generator/src/main/resources/codegen/pom.mustache b/modules/openapi-json-schema-generator/src/main/resources/codegen/pom.mustache index 1815c0115a7..75667e95ed9 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/codegen/pom.mustache +++ b/modules/openapi-json-schema-generator/src/main/resources/codegen/pom.mustache @@ -1,7 +1,7 @@ 4.0.0 - org.openapitools + org.openapijsonschematools {{name}}-openapi-generator jar {{name}}-openapi-generator @@ -108,7 +108,7 @@ - org.openapitools + org.openapijsonschematools openapi-generator ${openapi-generator-version} provided diff --git a/modules/openapi-json-schema-generator/src/main/resources/kotlin-client/class_doc.mustache b/modules/openapi-json-schema-generator/src/main/resources/kotlin-client/class_doc.mustache index a3405b25c84..623e317aa5f 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/kotlin-client/class_doc.mustache +++ b/modules/openapi-json-schema-generator/src/main/resources/kotlin-client/class_doc.mustache @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -{{#vars}}**{{name}}** | {{#isEnum}}[**inline**](#{{datatypeWithEnum}}){{/isEnum}}{{^isEnum}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}}{{/isEnum}} | {{description}} | {{^required}} [optional]{{/required}}{{#isReadOnly}} [readonly]{{/isReadOnly}} +{{#vars}}**{{name}}** | {{#isEnum}}[**inline**](#{{datatypeWithEnum}}){{/isEnum}}{{^isEnum}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{refClass}}.md){{/isPrimitiveType}}{{/isEnum}} | {{description}} | {{^required}} [optional]{{/required}}{{#isReadOnly}} [readonly]{{/isReadOnly}} {{/vars}} {{#vars}}{{#isEnum}} diff --git a/modules/openapi-json-schema-generator/src/main/resources/kotlin-client/libraries/jvm-ktor/infrastructure/ApiClient.kt.mustache b/modules/openapi-json-schema-generator/src/main/resources/kotlin-client/libraries/jvm-ktor/infrastructure/ApiClient.kt.mustache index 51a0a5f504e..fad229d7836 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/kotlin-client/libraries/jvm-ktor/infrastructure/ApiClient.kt.mustache +++ b/modules/openapi-json-schema-generator/src/main/resources/kotlin-client/libraries/jvm-ktor/infrastructure/ApiClient.kt.mustache @@ -34,11 +34,11 @@ import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule import com.fasterxml.jackson.core.util.DefaultIndenter import com.fasterxml.jackson.core.util.DefaultPrettyPrinter {{/jackson}} -import org.openapitools.client.auth.ApiKeyAuth -import org.openapitools.client.auth.Authentication -import org.openapitools.client.auth.HttpBasicAuth -import org.openapitools.client.auth.HttpBearerAuth -import org.openapitools.client.auth.OAuth +import org.openapijsonschematools.client.auth.ApiKeyAuth +import org.openapijsonschematools.client.auth.Authentication +import org.openapijsonschematools.client.auth.HttpBasicAuth +import org.openapijsonschematools.client.auth.HttpBearerAuth +import org.openapijsonschematools.client.auth.OAuth import {{packageName}}.auth.* {{#nonPublicApi}}internal {{/nonPublicApi}}open class ApiClient( diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/README.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/README.handlebars deleted file mode 100644 index b8819d21161..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/README.handlebars +++ /dev/null @@ -1,146 +0,0 @@ -# {{{projectName}}} -{{#if appDescriptionWithNewLines}} -{{{appDescriptionWithNewLines}}} -{{/if}} - -This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - -- API version: {{appVersion}} -- Package version: {{packageVersion}} -{{#unless hideGenerationTimestamp}} -- Build date: {{generatedDate}} -{{/unless}} -- Build package: {{generatorClass}} -{{#if infoUrl}} -For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) -{{/if}} - -## Requirements. - -Python {{generatorLanguageVersion}} - -## Migration from other generators like python and python-legacy - -### Changes -1. This generator uses spec case for all (object) property names and parameter names. - - So if the spec has a property name like camelCase, it will use camelCase rather than camel_case - - So you will need to update how you input and read properties to use spec case -2. Endpoint parameters are stored in dictionaries to prevent collisions (explanation below) - - So you will need to update how you pass data in to endpoints -3. Endpoint responses now include the original response, the deserialized response body, and (todo)the deserialized headers - - So you will need to update your code to use response.body to access deserialized data -4. All validated data is instantiated in an instance that subclasses all validated Schema classes and Decimal/str/list/tuple/frozendict/NoneClass/BoolClass/bytes/io.FileIO - - This means that you can use isinstance to check if a payload validated against a schema class - - This means that no data will be of type None/True/False - - ingested None will subclass NoneClass - - ingested True will subclass BoolClass - - ingested False will subclass BoolClass - - So if you need to check is True/False/None, instead use instance.is_true_oapg()/.is_false_oapg()/.is_none_oapg() -5. All validated class instances are immutable except for ones based on io.File - - This is because if properties were changed after validation, that validation would no longer apply - - So no changing values or property values after a class has been instantiated -6. String + Number types with formats - - String type data is stored as a string and if you need to access types based on its format like date, - date-time, uuid, number etc then you will need to use accessor functions on the instance - - type string + format: See .as_date_oapg, .as_datetime_oapg, .as_decimal_oapg, .as_uuid_oapg - - type number + format: See .as_float_oapg, .as_int_oapg - - this was done because openapi/json-schema defines constraints. string data may be type string with no format - keyword in one schema, and include a format constraint in another schema - - So if you need to access a string format based type, use as_date_oapg/as_datetime_oapg/as_decimal_oapg/as_uuid_oapg - - So if you need to access a number format based type, use as_int_oapg/as_float_oapg -7. Property access on AnyType(type unset) or object(dict) schemas - - Only required keys with valid python names are properties like .someProp and have type hints - - All optional keys may not exist, so properties are not defined for them - - One can access optional values with dict_instance['optionalProp'] and KeyError will be raised if it does not exist - - Use get_item_oapg if you need a way to always get a value whether or not the key exists - - If the key does not exist, schemas.unset is returned from calling dict_instance.get_item_oapg('optionalProp') - - All required and optional keys have type hints for this method, and @typing.overload is used - - A type hint is also generated for additionalProperties accessed using this method - - So you will need to update you code to use some_instance['optionalProp'] to access optional property - and additionalProperty values -8. The location of the api classes has changed - - Api classes are located in your_package.apis.tags.some_api - - This change was made to eliminate redundant code generation - - Legacy generators generated the same endpoint twice if it had > 1 tag on it - - This generator defines an endpoint in one class, then inherits that class to generate - apis by tags and by paths - - This change reduces code and allows quicker run time if you use the path apis - - path apis are at your_package.apis.paths.some_path - - Those apis will only load their needed models, which is less to load than all of the resources needed in a tag api - - So you will need to update your import paths to the api classes - -### Why are Oapg and _oapg used in class and method names? -Classes can have arbitrarily named properties set on them -Endpoints can have arbitrary operationId method names set -For those reasons, I use the prefix Oapg and _oapg to greatly reduce the likelihood of collisions -on protected + public classes/methods. -oapg stands for OpenApi Python Generator. - -### Object property spec case -This was done because when payloads are ingested, they can be validated against N number of schemas. -If the input signature used a different property name then that has mutated the payload. -So SchemaA and SchemaB must both see the camelCase spec named variable. -Also it is possible to send in two properties, named camelCase and camel_case in the same payload. -That use case should be support so spec case is used. - -### Parameter spec case -Parameters can be included in different locations including: -- query -- path -- header -- cookie - -Any of those parameters could use the same parameter names, so if every parameter -was included as an endpoint parameter in a function signature, they would collide. -For that reason, each of those inputs have been separated out into separate typed dictionaries: -- query_params -- path_params -- header_params -- cookie_params - -So when updating your code, you will need to pass endpoint parameters in using those -dictionaries. - -### Endpoint responses -Endpoint responses have been enriched to now include more information. -Any response reom an endpoint will now include the following properties: -response: urllib3.HTTPResponse -body: typing.Union[Unset, Schema] -headers: typing.Union[Unset, TODO] -Note: response header deserialization has not yet been added - - -## Installation & Usage -### pip install - -If the python package is hosted on a repository, you can install directly using: - -```sh -pip install git+https://{{gitHost}}/{{{gitUserId}}}/{{{gitRepoId}}}.git -``` -(you may need to run `pip` with root permission: `sudo pip install git+https://{{gitHost}}/{{{gitUserId}}}/{{{gitRepoId}}}.git`) - -Then import the package: -```python -import {{{packageName}}} -``` - -### Setuptools - -Install via [Setuptools](http://pypi.python.org/pypi/setuptools). - -```sh -python setup.py install --user -``` -(or `sudo python setup.py install` to install the package for all users) - -Then import the package: -```python -import {{{packageName}}} -``` - -## Getting Started - -Please follow the [installation procedure](#installation--usage) and then run the following: - -{{> README_common }} diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/README.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/README.hbs new file mode 100644 index 00000000000..fd36b419592 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/README.hbs @@ -0,0 +1,182 @@ +# {{{projectName}}} +{{#if appDescriptionWithNewLines}} +{{{appDescriptionWithNewLines}}} +{{/if}} + +This Python package is automatically generated by the [OpenAPI JSON Schema Generator](https://github.com/openapi-json-schema-tools/openapi-json-schema-generator) project: + +- API version: {{appVersion}} +- Package version: {{packageVersion}} +{{#unless hideGenerationTimestamp}} +- Build date: {{generatedDate}} +{{/unless}} +- Build package: {{generatorClass}} +{{#if infoUrl}} +For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) +{{/if}} + +## Requirements + +Python {{generatorLanguageVersion}} + +## Migration Guides +- [2.0.0 Migration Guide](migration_2_0_0.md) +- [Migration from Other Python Generators](migration_other_python_generators.md) + + +## Installation +### pip install + +If the python package is hosted on a repository, you can install directly using: + +```sh +pip install git+https://{{gitHost}}/{{{gitUserId}}}/{{{gitRepoId}}}.git +``` +(you may need to run `pip` with root permission: `sudo pip install git+https://{{gitHost}}/{{{gitUserId}}}/{{{gitRepoId}}}.git`) + +Then import the package: +```python +import {{{packageName}}} +``` + +### Setuptools + +Install via [Setuptools](http://pypi.python.org/pypi/setuptools). + +```sh +python -m pip install . --user +``` +(or `python -m pip install .` to install the package for all users) + +Then import the package: +```python +import {{{packageName}}} +``` + +## Usage Notes +### Validation, Immutability, and Data Type +This python code validates data to schema classes and return back an immutable instance containing the data +which subclasses all validated schema classes. This ensure that +- valid data cannot be mutated and become invalid to a set of schemas + - the one exception is that files are not immutable, so schema instances storing/sending/receiving files are not immutable +- one can use isinstance to check if a instance or property is valid to a schema class + - this means that expensive validation does not need to be run twice + +
    + Reason + +To do that, some changes had to be made. Python bool and NoneType cannot be subclassed, +so to be able to meet the above design goals, I implemented BoolClass and NoneClass classes +to allow schemas to subclass them. + +In python 0 == False and 1 == True. This is a problem for json schema which is language independent. +The [json schema test suite](https://github.com/json-schema-org/JSON-Schema-Test-Suite) has +[explicit tests that require that 0 != False and 1 != True](https://github.com/json-schema-org/JSON-Schema-Test-Suite/blob/main/tests/draft2020-12/type.json#L260-L267) +Using the above described BoolClass and NoneClasses allows those tests to pass. +- Another example of a package using it's own boolean class is [numpy's bool_](https://numpy.org/doc/stable/reference/arrays.scalars.html#numpy.bool_) +
    + +If you need to check is True/False/None, instead use instance.is_true_()/.is_false_()/.is_none_() + +Here is the mapping from json schema types to python subclassed types: +| Json Schema Type | Python Base Class | +| ---------------- | ----------------- | +| object | frozendict.frozendict | +| array | tuple | +| string | str | +| number | decimal.Decimal | +| integer | decimal.Decimal | +| boolean | BoolClass | +| null | NoneClass | +| AnyType (unset) | typing.Union[frozendict.frozendict, tuple, str, decimal.Decimal, BoolClass, NoneClass] | + +### Storage of Json Schema Definition in Python Classes +In openapi v3.0.3 there are ~ 28 json schema keywords. Almost all of them can apply if +type is unset. This data could be stored as +1. class properties +2. in a container in the class like in a dict or in a nested class + +This data is stored in a nested class named Schema_. +Storing this data as a nested class ensures that the data is encapsulated, does not collide with +class properties, and allows for deeper complex inline definitions. + +
    + Reason + +If the data were stored at the class property level, then the keywords could collide with +type object property names. To avoid that, one could make the properties semi or fully private with +a single or double underscore prefix, but that it a lot of data to put there. +Better to separate out json schema data from type object properties at the class property level. + +If the data were stored in a container that would segregate the different data which is good. +But json schemas can be inlined to any depth. Those complex deeper schemas would need to be included. +One could define them higher in the class file and then refer to them in the dict. That would required +iterating over schemas and adding all of the inner into a collection, and then generate that collection. + +The schema definitions are already nested from the json schema definition. The easiest solution is +to use a nested json schema definition class which holds that data. That way: +- the data is separated from class properties +- deeper complicated schemas can still be stored + +So a nested class was chosen to store json schema data, this class is named Schema_. +- The [django project uses this same pattern to store model class metadata in a Meta class](https://docs.djangoproject.com/en/4.1/topics/db/models/#meta-options) +
    + +### Json Schema Type Object +Most component schemas (models) are probably of type object. Which is a map data structure. +Json schema allows string keys in this map, which means schema properties can have key names that are +invalid python variable names. Names like: +- "hi-there" +- "1variable" +- "@now" +- " " +- "from" + +To allow these use cases to work, frozendict.frozendict is used as the base class of type object schemas. +This means that one can use normal dict methods on instances of these classes. + +
    + Other Details + +- optional properties which were not set will not exist in the instance +- None is only allowed in as a value if type: "null" was included or nullable: true was set +- type hints are written for accessing values by key literals like instance["hi-there"] +- and there is a method instance.get_item_["hi-there"] which returns an schemas.Unset value if the key was not set +- required properties with valid python names are accessible with instance.SomeRequiredProp + which uses the exact key from the openapi document + - preserving the original key names is required to properly validate a payload to multiple json schemas +
    + +### Json Schema Type + Format, Validated Data Storage +N schemas can be validated on the same payload. +To allow multiple schemas to validate, the data must be stored using one base class whether or not +a json schema format constraint exists in the schema. +See te below accessors for string data: +- type string + format: See .as_date_, .as_datetime_, .as_decimal_, .as_uuid_ + +In json schema, type: number with no format validates both integers and floats, so decimal.Decimal is used to store them. +See te below accessors for number data: +- type number + format: See .as_float_, .as_int_ + +
    + String + Date Example + +For example the string payload '2023-12-20' is validates to both of these schemas: +1. string only +``` +- type: string +``` +2. string and date format +``` +- type: string + format: date +``` +Because of use cases like this, a datetime.date is allowed as an input to this schema, but the data +is stored as a string, with a date accessor, instance.as_date_ +
    + +## Getting Started + +Please follow the [installation procedure](#installation) and then run the following: + +{{> _helper_readme_common }} diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/README_common.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/README_common.handlebars deleted file mode 100644 index bb33cc728d5..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/README_common.handlebars +++ /dev/null @@ -1,111 +0,0 @@ -```python -{{#with apiInfo}}{{#each apis}}{{#unless hasMore}}{{#if hasHttpSignatureMethods}}import datetime{{/if}}{{/unless}}{{/each}}{{/with}} -import time -import {{{packageName}}} -from pprint import pprint -{{#with apiInfo}} -{{#each apis}} -{{#if @first}} -from {{packageName}}.{{apiPackage}}.tags import {{classFilename}} -{{#each imports}} -{{{import}}} -{{/each}} -{{#with operations}} -{{#each operation}} -{{#if @first}} -{{> doc_auth_partial}} - -# Enter a context with an instance of the API client -with {{{packageName}}}.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = {{classFilename}}.{{{classname}}}(api_client) - {{#each allParams}}{{paramName}} = {{{example}}} # {{{dataType}}} | {{{description}}}{{#unless required}} (optional){{/unless}}{{#if defaultValue}} (default to {{{.}}}){{/if}} - {{/each}} - - try: - {{#if summary}} # {{{summary}}} - {{/if}} {{#if returnType}}api_response = {{/if}}api_instance.{{{operationId}}}({{#each allParams}}{{#if required}}{{paramName}}{{/if}}{{#unless required}}{{paramName}}={{paramName}}{{/unless}}{{#if hasMore}}, {{/if}}{{/each}}){{#if returnType}} - pprint(api_response){{/if}} - except {{{packageName}}}.ApiException as e: - print("Exception when calling {{classname}}->{{operationId}}: %s\n" % e) -{{/if}} -{{/each}} -{{/with}} -{{/if}} -{{/each}} -{{/with}} -``` - -## Documentation for API Endpoints - -All URIs are relative to *{{basePath}}* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -{{#with apiInfo}}{{#each apis}}{{#with operations}}{{#each operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#if summary}}{{summary}}{{/if}} -{{/each}}{{/with}}{{/each}}{{/with}} - -## Documentation For Models - -{{#each models}}{{#with model}} - [{{{classname}}}]({{modelDocPath}}{{{classname}}}.md) -{{/with}}{{/each}} - -## Documentation For Authorization - -{{#unless authMethods}} - All endpoints do not require authorization. -{{/unless}} -{{#each authMethods}} -{{#if @last}} Authentication schemes defined for the API:{{/if}} -## {{{name}}} - -{{#if isApiKey}} -- **Type**: API key -- **API key parameter name**: {{{keyParamName}}} -- **Location**: {{#if isKeyInQuery}}URL query string{{/if}}{{#if isKeyInHeader}}HTTP header{{/if}} -{{/if}} -{{#if isBasic}} -{{#if isBasicBasic}} -- **Type**: HTTP basic authentication -{{/if}} -{{#if isBasicBearer}} -- **Type**: Bearer authentication{{#if bearerFormat}} ({{{bearerFormat}}}){{/if}} -{{/if}} -{{#if isHttpSignature}} -- **Type**: HTTP signature authentication -{{/if}} -{{/if}} -{{#if isOAuth}} -- **Type**: OAuth -- **Flow**: {{{flow}}} -- **Authorization URL**: {{{authorizationUrl}}} -- **Scopes**: {{#unless scopes}}N/A{{/unless}} -{{#each scopes}} - **{{{scope}}}**: {{{description}}} -{{/each}} -{{/if}} - -{{/each}} - -## Author - -{{#with apiInfo}}{{#each apis}}{{#unless hasMore}}{{#if infoEmail}}{{infoEmail}}{{/if}} -{{/unless}}{{/each}}{{/with}} - -## Notes for Large OpenAPI documents -If the OpenAPI document is large, imports in {{{packageName}}}.apis and {{{packageName}}}.models may fail with a -RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions: - -Solution 1: -Use specific imports for apis and models like: -- `from {{{packageName}}}.{{apiPackage}}.default_api import DefaultApi` -- `from {{{packageName}}}.{{modelPackage}}.pet import Pet` - -Solution 1: -Before importing the package, adjust the maximum recursion limit as shown below: -``` -import sys -sys.setrecursionlimit(1500) -import {{{packageName}}} -from {{{packageName}}}.apis import * -from {{{packageName}}}.models import * -``` diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/README_onlypackage.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/README_onlypackage.handlebars deleted file mode 100644 index 63f959375b0..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/README_onlypackage.handlebars +++ /dev/null @@ -1,43 +0,0 @@ -# {{{projectName}}} -{{#if appDescription}} -{{{appDescription}}} -{{/if}} - -The `{{packageName}}` package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - -- API version: {{appVersion}} -- Package version: {{packageVersion}} -{{#unless hideGenerationTimestamp}} -- Build date: {{generatedDate}} -{{/unless}} -- Build package: {{generatorClass}} -{{#if infoUrl}} -For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) -{{/if}} - -## Requirements. - -Python {{generatorLanguageVersion}} - -## Installation & Usage - -This python library package is generated without supporting files like setup.py or requirements files - -To be able to use it, you will need these dependencies in your own package that uses this library: - -* urllib3 >= 1.15 -* certifi -* python-dateutil -{{#if asyncio}} -* aiohttp -{{/if}} -{{#if tornado}} -* tornado>=4.2,<5 -{{/if}} - -## Getting Started - -In your own code, to use this library to connect and interact with {{{projectName}}}, -you can run the following: - -{{> README_common }} diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/README_onlypackage.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/README_onlypackage.hbs new file mode 100644 index 00000000000..28d967ed804 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/README_onlypackage.hbs @@ -0,0 +1,43 @@ +# {{{projectName}}} +{{#if appDescription}} +{{{appDescription}}} +{{/if}} + +The `{{packageName}}` package is automatically generated by the [OpenAPI JSON Schema Generator](https://github.com/openapi-json-schema-tools/openapi-json-schema-generator) project: + +- API version: {{appVersion}} +- Package version: {{packageVersion}} +{{#unless hideGenerationTimestamp}} +- Build date: {{generatedDate}} +{{/unless}} +- Build package: {{generatorClass}} +{{#if infoUrl}} +For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) +{{/if}} + +## Requirements. + +Python {{generatorLanguageVersion}} + +## Installation & Usage + +This python library package is generated without supporting files like setup.py or requirements files + +To be able to use it, you will need these dependencies in your own package that uses this library: + +* urllib3 >= 1.15 +* certifi +* python-dateutil +{{#if asyncio}} +* aiohttp +{{/if}} +{{#if tornado}} +* tornado>=4.2,<5 +{{/if}} + +## Getting Started + +In your own code, to use this library to connect and interact with {{{projectName}}}, +you can run the following: + +{{> _helper_readme_common }} diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/__init__.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/__init__.hbs similarity index 100% rename from modules/openapi-json-schema-generator/src/main/resources/python/__init__.handlebars rename to modules/openapi-json-schema-generator/src/main/resources/python/__init__.hbs diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/__init__apis_tags.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/__init__apis_tags.handlebars deleted file mode 100644 index 7a6fa76d6b4..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/__init__apis_tags.handlebars +++ /dev/null @@ -1,11 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from {{packageName}}.apis.tag_to_api import tag_to_api - -import enum - - -class TagValues(str, enum.Enum): -{{#each enumToTag}} - {{@key}} = "{{this}}" -{{/each}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/__init__model.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/__init__model.handlebars deleted file mode 100644 index b6b698b0452..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/__init__model.handlebars +++ /dev/null @@ -1,5 +0,0 @@ -# we can not import model classes here because that would create a circular -# reference which would not work in python2 -# do not import all models into this module because that uses a lot of memory and stack frames -# if you need the ability to import all models from one package, import them with -# from {{packageName}}.models import ModelA, ModelB diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/__init__models.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/__init__models.handlebars deleted file mode 100644 index 31eac9cd544..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/__init__models.handlebars +++ /dev/null @@ -1,18 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -# import all models into this package -# if you have many models here with many references from one model to another this may -# raise a RecursionError -# to avoid this, import only the models that you directly need like: -# from from {{packageName}}.{{modelPackage}}.pet import Pet -# or import this package, but before doing it, use: -# import sys -# sys.setrecursionlimit(n) - -{{#each models}} -{{#with model}} -from {{packageName}}.{{modelPackage}}.{{classFilename}} import {{classname}} -{{/with}} -{{/each}} diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/__init__package.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/__init__package.handlebars deleted file mode 100644 index 26350c7252d..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/__init__package.handlebars +++ /dev/null @@ -1,28 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -{{>partial_header}} - -__version__ = "{{packageVersion}}" - -# import ApiClient -from {{packageName}}.api_client import ApiClient - -# import Configuration -from {{packageName}}.configuration import Configuration -{{#if hasHttpSignatureMethods}} -from {{packageName}}.signing import HttpSigningConfiguration -{{/if}} - -# import exceptions -from {{packageName}}.exceptions import OpenApiException -from {{packageName}}.exceptions import ApiAttributeError -from {{packageName}}.exceptions import ApiTypeError -from {{packageName}}.exceptions import ApiValueError -from {{packageName}}.exceptions import ApiKeyError -from {{packageName}}.exceptions import ApiException -{{#if recursionLimit}} - -__import__('sys').setrecursionlimit({{recursionLimit}}) -{{/if}} diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/__init__package.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/__init__package.hbs new file mode 100644 index 00000000000..774de0bffd9 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/__init__package.hbs @@ -0,0 +1,28 @@ +# coding: utf-8 + +# flake8: noqa + +{{> _helper_header }} + +__version__ = "{{packageVersion}}" + +# import ApiClient +from {{packageName}}.api_client import ApiClient + +# import Configuration +from {{packageName}}.configurations.api_configuration import ApiConfiguration +{{#if hasHttpSignatureSecurityScheme}} +from {{packageName}}.signing import HttpSigningConfiguration +{{/if}} + +# import exceptions +from {{packageName}}.exceptions import OpenApiException +from {{packageName}}.exceptions import ApiAttributeError +from {{packageName}}.exceptions import ApiTypeError +from {{packageName}}.exceptions import ApiValueError +from {{packageName}}.exceptions import ApiKeyError +from {{packageName}}.exceptions import ApiException +{{#if recursionLimit}} + +__import__('sys').setrecursionlimit({{recursionLimit}}) +{{/if}} diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/__init__paths.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/__init__paths.handlebars deleted file mode 100644 index 3d3103913db..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/__init__paths.handlebars +++ /dev/null @@ -1,3 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from {{packageName}}.apis.path_to_api import path_to_api diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/__init__paths_enum.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/__init__paths_enum.handlebars deleted file mode 100644 index ba97a8cd836..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/__init__paths_enum.handlebars +++ /dev/null @@ -1,11 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from {{packageName}}.apis.path_to_api import path_to_api - -import enum - - -class PathValues(str, enum.Enum): -{{#each pathValToVar}} - {{this}} = "{{@key}}" -{{/each}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/__init__paths_x.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/__init__paths_x.handlebars deleted file mode 100644 index 64d1977b67e..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/__init__paths_x.handlebars +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from {{packageName}}.paths.{{pathModule}} import {{apiClassName}} - -from {{packageName}}.paths import PathValues - -path = PathValues.{{{pathVar}}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/__init__test_paths.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/__init__test_paths.handlebars deleted file mode 100644 index 1309632d3d5..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/__init__test_paths.handlebars +++ /dev/null @@ -1,68 +0,0 @@ -import json -import typing - -import urllib3 -from urllib3._collections import HTTPHeaderDict - - -class ApiTestMixin: - json_content_type = 'application/json' - user_agent = 'OpenAPI-Generator/1.0.0/python' - - @classmethod - def assert_pool_manager_request_called_with( - cls, - mock_request, - url: str, - method: str = 'POST', - body: typing.Optional[bytes] = None, - content_type: typing.Optional[str] = None, - accept_content_type: typing.Optional[str] = None, - stream: bool = False, - ): - headers = { - 'User-Agent': cls.user_agent - } - if accept_content_type: - headers['Accept'] = accept_content_type - if content_type: - headers['Content-Type'] = content_type - kwargs = dict( - headers=HTTPHeaderDict(headers), - preload_content=not stream, - timeout=None, - ) - if content_type and method != 'GET': - kwargs['body'] = body - mock_request.assert_called_with( - method, - url, - **kwargs - ) - - @staticmethod - def headers_for_content_type(content_type: str) -> typing.Dict[str, str]: - return {'content-type': content_type} - - @classmethod - def response( - cls, - body: typing.Union[str, bytes], - status: int = 200, - content_type: str = json_content_type, - headers: typing.Optional[typing.Dict[str, str]] = None, - preload_content: bool = True - ) -> urllib3.HTTPResponse: - if headers is None: - headers = {} - headers.update(cls.headers_for_content_type(content_type)) - return urllib3.HTTPResponse( - body, - headers=headers, - status=status, - preload_content=preload_content - ) - - @staticmethod - def json_bytes(in_data: typing.Any) -> bytes: - return json.dumps(in_data, separators=(",", ":"), ensure_ascii=False).encode('utf-8') diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/__init__test_paths.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/__init__test_paths.hbs new file mode 100644 index 00000000000..bcc864a1738 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/__init__test_paths.hbs @@ -0,0 +1,68 @@ +import json +import typing + +import urllib3 +from urllib3._collections import HTTPHeaderDict + + +class ApiTestMixin: + json_content_type = 'application/json' + user_agent = 'OpenAPI-JSON-Schema-Generator/1.0.0/python' + + @classmethod + def assert_pool_manager_request_called_with( + cls, + mock_request, + url: str, + method: str = 'POST', + body: typing.Optional[bytes] = None, + content_type: typing.Optional[str] = None, + accept_content_type: typing.Optional[str] = None, + stream: bool = False, + ): + headers = { + 'User-Agent': cls.user_agent + } + if accept_content_type: + headers['Accept'] = accept_content_type + if content_type: + headers['Content-Type'] = content_type + kwargs = dict( + headers=HTTPHeaderDict(headers), + preload_content=not stream, + timeout=None, + ) + if content_type and method != 'GET': + kwargs['body'] = body + mock_request.assert_called_with( + method, + url, + **kwargs + ) + + @staticmethod + def headers_for_content_type(content_type: str) -> typing.Dict[str, str]: + return {'content-type': content_type} + + @classmethod + def response( + cls, + body: typing.Union[str, bytes], + status: int = 200, + content_type: str = json_content_type, + headers: typing.Optional[typing.Dict[str, str]] = None, + preload_content: bool = True + ) -> urllib3.HTTPResponse: + if headers is None: + headers = {} + headers.update(cls.headers_for_content_type(content_type)) + return urllib3.HTTPResponse( + body, + headers=headers, + status=status, + preload_content=preload_content + ) + + @staticmethod + def json_bytes(in_data: typing.Any) -> bytes: + return json.dumps(in_data, separators=(",", ":"), ensure_ascii=False).encode('utf-8') diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/_helper_footer_links.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/_helper_footer_links.hbs new file mode 100644 index 00000000000..034a0373b9f --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/_helper_footer_links.hbs @@ -0,0 +1 @@ +{{#if serversLink}}[[Back to Servers]]({{readmePath}}README.md#Servers) {{/if}}{{#if securitySchemesLink}}[[Back to Component Security Schemes]]({{readmePath}}README.md#Component-SecuritySchemes) {{/if}}{{#if endpointsLink}}[[Back to Endpoints]]({{readmePath}}README.md#Endpoints) {{/if}}{{#if schemasLink}}[[Back to Component Schemas]]({{readmePath}}README.md#Component-Schemas) {{/if}}{{#if responsesLink}}[[Back to Component Responses]]({{readmePath}}README.md#Component-Responses) {{/if}}{{#if requestBodiesLink}}[[Back to Component RequestBodies]]({{readmePath}}README.md#Component-RequestBodies) {{/if}}{{#if headersLink}}[[Back to Component Headers]]({{readmePath}}README.md#Component-Headers) {{/if}}{{#if parametersLink}}[[Back to Component Parameters]]({{readmePath}}README.md#Component-Parameters) {{/if}}[[Back to README]]({{readmePath}}README.md) \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/_helper_header.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/_helper_header.hbs new file mode 100644 index 00000000000..b6a4f125444 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/_helper_header.hbs @@ -0,0 +1,17 @@ +""" +{{#if appName}} + {{{appName}}} +{{/if}} + +{{#if appDescription}} + {{{appDescription}}} # noqa: E501 +{{/if}} + +{{#if version}} + The version of the OpenAPI document: {{{version}}} +{{/if}} +{{#if infoEmail}} + Contact: {{{infoEmail}}} +{{/if}} + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/_helper_imports.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/_helper_imports.hbs new file mode 100644 index 00000000000..617b31f6acc --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/_helper_imports.hbs @@ -0,0 +1,3 @@ +{{#each imports}} +{{{.}}} +{{/each}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/_helper_imports_schema_types.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/_helper_imports_schema_types.hbs new file mode 100644 index 00000000000..2afa2ac72bb --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/_helper_imports_schema_types.hbs @@ -0,0 +1,12 @@ +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from {{packageName}} import schemas # noqa: F401 diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/_helper_readme_common.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/_helper_readme_common.hbs new file mode 100644 index 00000000000..5f11c6f33f1 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/_helper_readme_common.hbs @@ -0,0 +1,149 @@ +{{#each paths}} + {{#if @first}} + {{#each operations}} + {{#if @first}} +{{> paths/path/verb/_helper_operation_doc_example }} + {{/if}} + {{/each}} + {{/if}} +{{/each}} +{{#if servers}} + +## Servers +server_index | Class | Description +------------ | ----- | ------------ +{{#each servers}} +{{@key}} | [{{jsonPathPiece.camelCase}}](docs/servers/{{jsonPathPiece.snakeCase}}.md) |{{#if description}} {{description}}{{/if}} +{{/each}} +{{/if}} +{{#if security}} + +## Security + +Set auth info by setting ApiConfiguration.security_scheme_info to a dict where the +key is the below security scheme quoted name, and the value is an instance of the linked +component security scheme class. See how to do this in the endpoint code sample. + +| Security Index | Security Scheme to Scope Names | +| -------------- | ------------------------------ | + {{#each security}} +| {{@key}} | {{#eq this.size 0}}no security{{else}}{{#each this}}["{{{@key}}}"](docs/components/security_schemes/{{this.refInfo.refModule}}.md) {{this.scopeNames}}
    {{/each}}{{/eq}} | + {{/each}} +{{/if}} +{{#if paths}} + +## Endpoints + +All URIs are relative to the selected server +- The server is selected by passing in server_info and server_index into api_configuration.ApiConfiguration +- Code samples in endpoints documents show how to do this +- server_index can also be passed in to endpoint calls, see endpoint documentation + +HTTP request | Method | Description +------------ | ------ | ------------- +{{#each paths}} +{{#each operations}} +{{../@key.original}} **{{@key.original}}** | {{#each tags}}[{{className}}]({{apiDocPath}}{{moduleName}}.md).[{{operationId.snakeCase}}](docs/paths/{{../../@key.snakeCase}}/{{../@key.original}}.md) {{/each}} | {{#if summary}}{{summary}}{{/if}} +{{/each}} +{{/each}} +{{/if}} +{{#if schemas}} + +## Component Schemas + +Class | Description +----- | ------------ +{{#each schemas}} + {{#with this}} +[{{jsonPathPiece.camelCase}}]({{modelDocPath}}{{jsonPathPiece.snakeCase}}.md) |{{#if description}} {{description}}{{/if}} + {{/with}} +{{/each}} +{{/if}} +{{#if requestBodies}} + +## Component RequestBodies + +Class | Description +----- | ------------ +{{#each requestBodies}} + {{#with this}} +[{{jsonPathPiece.camelCase}}](docs/components/request_bodies/{{jsonPathPiece.snakeCase}}.md) |{{#if description}} {{description}}{{/if}} + {{/with}} +{{/each}} +{{/if}} +{{#if responses}} + +## Component Responses + +Class | Description +----- | ------------ +{{#each responses}} + {{#with this}} +[{{jsonPathPiece.camelCase}}](docs/components/responses/{{jsonPathPiece.snakeCase}}.md) |{{#if description}} {{description}}{{/if}} + {{/with}} +{{/each}} +{{/if}} +{{#if headers}} + +## Component Headers + +Class | Description +----- | ------------ +{{#each headers}} + {{#with this}} +[{{jsonPathPiece.camelCase}}](docs/components/headers/{{jsonPathPiece.snakeCase}}.md) |{{#if description}} {{description}}{{/if}} + {{/with}} +{{/each}} +{{/if}} +{{#if parameters}} + +## Component Parameters + +Class | Description +----- | ------------ +{{#each parameters}} + {{#with this}} +[{{jsonPathPiece.camelCase}}](docs/components/parameters/{{jsonPathPiece.snakeCase}}.md) |{{#if description}} {{description}}{{/if}} + {{/with}} +{{/each}} +{{/if}} +{{#if securitySchemes}} + +## Component SecuritySchemes + +Class | Description +----- | ------------ + {{#each securitySchemes}} + {{#with this}} +[{{jsonPathPiece.camelCase}}](docs/components/security_schemes/{{jsonPathPiece.snakeCase}}.md) |{{#if description}} {{description}}{{/if}} + {{/with}} + {{/each}} + +{{/if}} +{{#if infoEmail}} + +## Author + +{{infoEmail}} +{{/if}} + +## Notes for Large OpenAPI documents +If the OpenAPI document is large, imports in {{{packageName}}}.{{apiPackage}}.tags.tag_to_api and {{{packageName}}}.{{modelPackage}}s may fail with a +RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions: + +Solution 1: +Use specific imports for apis and models like: +- tagged api: `from {{{packageName}}}.{{apiPackage}}.tags.default_api import DefaultApi` +- api for one path: `from {{{packageName}}}.{{apiPackage}}.paths.some_path import SomePath` +- api for one operation (path + verb): `from {{{packageName}}}.paths.some_path.get import ApiForget` +- single model import: `from {{{packageName}}}.{{modelPackage}}.pet import Pet` + +Solution 2: +Before importing the package, adjust the maximum recursion limit as shown below: +``` +import sys +sys.setrecursionlimit(1500) +import {{{packageName}}} +from {{{packageName}}}.{{apiPackage}}.tags.tag_to_api import * +from {{{packageName}}}.{{modelPackage}}s import * +``` diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/_helper_required_libraries.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/_helper_required_libraries.hbs new file mode 100644 index 00000000000..9abadfbca02 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/_helper_required_libraries.hbs @@ -0,0 +1,16 @@ +{{#if asyncio}} +{{#if quoted}}"{{/if}}aiohttp >= 3.0.0{{#if quoted}}",{{/if}} +{{/if}} +{{#if quoted}}"{{/if}}certifi >= 14.5.14{{#if quoted}}",{{/if}} +{{#if quoted}}"{{/if}}frozendict ~= 2.3.4{{#if quoted}}",{{/if}} +{{#if hasHttpSignatureSecurityScheme}} +{{#if quoted}}"{{/if}}pem >= 19.3.0{{#if quoted}}",{{/if}} +{{#if quoted}}"{{/if}}pycryptodome >= 3.9.0{{#if quoted}}",{{/if}} +{{/if}} +{{#if quoted}}"{{/if}}python-dateutil ~= 2.7.0{{#if quoted}}",{{/if}} +{{#if quoted}}"{{/if}}setuptools >= 61.0{{#if quoted}}",{{/if}} +{{#if tornado}} +{{#if quoted}}"{{/if}}tornado >= 4.2{{#if quoted}}",{{/if}} +{{/if}} +{{#if quoted}}"{{/if}}typing_extensions ~= 4.5.0{{#if quoted}}",{{/if}} +{{#if quoted}}"{{/if}}urllib3 ~= 2.0.a3{{#if quoted}}",{{/if}} diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/_helper_schema_python_types.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/_helper_schema_python_types.hbs new file mode 100644 index 00000000000..dab87c105b3 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/_helper_schema_python_types.hbs @@ -0,0 +1 @@ +{{#eq types null}}dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader{{else}}{{#each types}}{{#unless @first}}, {{/unless}}{{#eq this "array"}}list, tuple{{/eq}}{{#eq this "object"}}dict, frozendict.frozendict{{/eq}}{{#eq this "null"}}None{{/eq}}{{#eq this "string" }}{{#neq ../format "binary"}}str{{/neq}}{{#eq ../format "date"}}, datetime.date{{/eq}}{{#eq ../format "date-time"}}, datetime.datetime{{/eq}}{{#eq ../format "uuid"}}, uuid.UUID{{/eq}}{{#eq ../format "binary"}}bytes, io.FileIO, io.BufferedReader{{/eq}}{{/eq}}{{#eq this "integer"}}decimal.Decimal, int{{/eq}}{{#eq this "number"}}decimal.Decimal, int, float{{/eq}}{{#eq this "boolean"}}bool{{/eq}}{{/each}}{{/eq}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/_helper_schema_python_types_newline.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/_helper_schema_python_types_newline.hbs new file mode 100644 index 00000000000..0f9b18b8eae --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/_helper_schema_python_types_newline.hbs @@ -0,0 +1,72 @@ +{{#eq types null}} +dict, +frozendict.frozendict, +str, +datetime.date, +datetime.datetime, +uuid.UUID, +int, +float, +decimal.Decimal, +bool, +None, +list, +tuple, +bytes, +io.FileIO, +io.BufferedReader +{{else}} + {{#each types}} + {{#eq this "array"}} +list, +tuple{{#unless @last}},{{/unless}} + {{/eq}} + {{#eq this "object"}} +dict, +frozendict.frozendict{{#unless @last}},{{/unless}} + {{/eq}} + {{#eq this "null"}} +None{{#unless @last}},{{/unless}} + {{/eq}} + {{#eq this "string" }} + {{#eq ../format null}} +str{{#unless @last}},{{/unless}} + {{else}} + {{#eq ../format "date"}} +str, +datetime.date{{#unless @last}},{{/unless}} + {{else}} + {{#eq ../format "date-time"}} +str, +datetime.datetime{{#unless @last}},{{/unless}} + {{else}} + {{#eq ../format "uuid"}} +str, +uuid.UUID{{#unless @last}},{{/unless}} + {{else}} + {{#eq ../format "binary"}} +bytes, +io.FileIO, +io.BufferedReader{{#unless @last}},{{/unless}} + {{else}} +str{{#unless @last}},{{/unless}} + {{/eq}} + {{/eq}} + {{/eq}} + {{/eq}} + {{/eq}} + {{/eq}} + {{#eq this "integer"}} +decimal.Decimal, +int{{#unless @last}},{{/unless}} + {{/eq}} + {{#eq this "number"}} +decimal.Decimal, +int, +float{{#unless @last}},{{/unless}} + {{/eq}} + {{#eq this "boolean"}} +bool{{#unless @last}},{{/unless}} + {{/eq}} + {{/each}} +{{/eq}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/_helper_types_all_accessed.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/_helper_types_all_accessed.hbs new file mode 100644 index 00000000000..5cc59a2beef --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/_helper_types_all_accessed.hbs @@ -0,0 +1,8 @@ +frozendict.frozendict, +tuple, +decimal.Decimal, +str, +bytes, +BoolClass, +NoneClass, +FileIO \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/_helper_types_all_incl_schema.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/_helper_types_all_incl_schema.hbs new file mode 100644 index 00000000000..a4bb03bfb60 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/_helper_types_all_incl_schema.hbs @@ -0,0 +1,17 @@ +dict, +frozendict.frozendict, +list, +tuple, +decimal.Decimal, +float, +int, +str, +datetime.date, +datetime.datetime, +uuid.UUID, +bool, +None, +bytes, +io.FileIO, +io.BufferedReader, +'Schema', \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/api.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/api.handlebars deleted file mode 100644 index da9b50150d9..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/api.handlebars +++ /dev/null @@ -1,24 +0,0 @@ -# coding: utf-8 - -{{>partial_header}} - -{{#with operations}} -{{#each operation}} -from {{packageName}}.paths.{{nickname}}.{{httpMethod}} import {{operationIdCamelCase}} -{{/each}} -{{/with}} - - -{{#with operations}} -class {{classname}}( -{{#each operation}} - {{operationIdCamelCase}}, -{{/each}} -): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - pass -{{/with}} diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/api_client.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/api_client.handlebars deleted file mode 100644 index 041520a2c33..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/api_client.handlebars +++ /dev/null @@ -1,1509 +0,0 @@ -# coding: utf-8 -{{>partial_header}} - -from dataclasses import dataclass -from decimal import Decimal -import enum -import email -import json -import os -import io -import atexit -from multiprocessing.pool import ThreadPool -import re -import tempfile -import typing -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict -from urllib.parse import urlparse, quote -from urllib3.fields import RequestField as RequestFieldBase - -{{#if tornado}} -import tornado.gen -{{/if}} -import frozendict - -from {{packageName}} import rest -from {{packageName}}.configuration import Configuration -from {{packageName}}.exceptions import ApiTypeError, ApiValueError -from {{packageName}}.schemas import ( - NoneClass, - BoolClass, - Schema, - FileIO, - BinarySchema, - date, - datetime, - none_type, - Unset, - unset, -) - - -class RequestField(RequestFieldBase): - def __eq__(self, other): - if not isinstance(other, RequestField): - return False - return self.__dict__ == other.__dict__ - - -class JSONEncoder(json.JSONEncoder): - compact_separators = (',', ':') - - def default(self, obj): - if isinstance(obj, str): - return str(obj) - elif isinstance(obj, float): - return float(obj) - elif isinstance(obj, int): - return int(obj) - elif isinstance(obj, Decimal): - if obj.as_tuple().exponent >= 0: - return int(obj) - return float(obj) - elif isinstance(obj, NoneClass): - return None - elif isinstance(obj, BoolClass): - return bool(obj) - elif isinstance(obj, (dict, frozendict.frozendict)): - return {key: self.default(val) for key, val in obj.items()} - elif isinstance(obj, (list, tuple)): - return [self.default(item) for item in obj] - raise ApiValueError('Unable to prepare type {} for serialization'.format(obj.__class__.__name__)) - - -class ParameterInType(enum.Enum): - QUERY = 'query' - HEADER = 'header' - PATH = 'path' - COOKIE = 'cookie' - - -class ParameterStyle(enum.Enum): - MATRIX = 'matrix' - LABEL = 'label' - FORM = 'form' - SIMPLE = 'simple' - SPACE_DELIMITED = 'spaceDelimited' - PIPE_DELIMITED = 'pipeDelimited' - DEEP_OBJECT = 'deepObject' - - -class PrefixSeparatorIterator: - # A class to store prefixes and separators for rfc6570 expansions - - def __init__(self, prefix: str, separator: str): - self.prefix = prefix - self.separator = separator - self.first = True - if separator in {'.', '|', '%20'}: - item_separator = separator - else: - item_separator = ',' - self.item_separator = item_separator - - def __iter__(self): - return self - - def __next__(self): - if self.first: - self.first = False - return self.prefix - return self.separator - - -class ParameterSerializerBase: - @classmethod - def _get_default_explode(cls, style: ParameterStyle) -> bool: - return False - - @staticmethod - def __ref6570_item_value(in_data: typing.Any, percent_encode: bool): - """ - Get representation if str/float/int/None/items in list/ values in dict - None is returned if an item is undefined, use cases are value= - - None - - [] - - {} - - [None, None None] - - {'a': None, 'b': None} - """ - if type(in_data) in {str, float, int}: - if percent_encode: - return quote(str(in_data)) - return str(in_data) - elif isinstance(in_data, none_type): - # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 - return None - elif isinstance(in_data, list) and not in_data: - # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 - return None - elif isinstance(in_data, dict) and not in_data: - # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 - return None - raise ApiValueError('Unable to generate a ref6570 item representation of {}'.format(in_data)) - - @staticmethod - def _to_dict(name: str, value: str): - return {name: value} - - @classmethod - def __ref6570_str_float_int_expansion( - cls, - variable_name: str, - in_data: typing.Any, - explode: bool, - percent_encode: bool, - prefix_separator_iterator: PrefixSeparatorIterator, - var_name_piece: str, - named_parameter_expansion: bool - ) -> str: - item_value = cls.__ref6570_item_value(in_data, percent_encode) - if item_value is None or (item_value == '' and prefix_separator_iterator.separator == ';'): - return next(prefix_separator_iterator) + var_name_piece - value_pair_equals = '=' if named_parameter_expansion else '' - return next(prefix_separator_iterator) + var_name_piece + value_pair_equals + item_value - - @classmethod - def __ref6570_list_expansion( - cls, - variable_name: str, - in_data: typing.Any, - explode: bool, - percent_encode: bool, - prefix_separator_iterator: PrefixSeparatorIterator, - var_name_piece: str, - named_parameter_expansion: bool - ) -> str: - item_values = [cls.__ref6570_item_value(v, percent_encode) for v in in_data] - item_values = [v for v in item_values if v is not None] - if not item_values: - # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 - return "" - value_pair_equals = '=' if named_parameter_expansion else '' - if not explode: - return ( - next(prefix_separator_iterator) + - var_name_piece + - value_pair_equals + - prefix_separator_iterator.item_separator.join(item_values) - ) - # exploded - return next(prefix_separator_iterator) + next(prefix_separator_iterator).join( - [var_name_piece + value_pair_equals + val for val in item_values] - ) - - @classmethod - def __ref6570_dict_expansion( - cls, - variable_name: str, - in_data: typing.Any, - explode: bool, - percent_encode: bool, - prefix_separator_iterator: PrefixSeparatorIterator, - var_name_piece: str, - named_parameter_expansion: bool - ) -> str: - in_data_transformed = {key: cls.__ref6570_item_value(val, percent_encode) for key, val in in_data.items()} - in_data_transformed = {key: val for key, val in in_data_transformed.items() if val is not None} - if not in_data_transformed: - # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 - return "" - value_pair_equals = '=' if named_parameter_expansion else '' - if not explode: - return ( - next(prefix_separator_iterator) + - var_name_piece + value_pair_equals + - prefix_separator_iterator.item_separator.join( - prefix_separator_iterator.item_separator.join( - item_pair - ) for item_pair in in_data_transformed.items() - ) - ) - # exploded - return next(prefix_separator_iterator) + next(prefix_separator_iterator).join( - [key + '=' + val for key, val in in_data_transformed.items()] - ) - - @classmethod - def _ref6570_expansion( - cls, - variable_name: str, - in_data: typing.Any, - explode: bool, - percent_encode: bool, - prefix_separator_iterator: PrefixSeparatorIterator - ) -> str: - """ - Separator is for separate variables like dict with explode true, not for array item separation - """ - named_parameter_expansion = prefix_separator_iterator.separator in {'&', ';'} - var_name_piece = variable_name if named_parameter_expansion else '' - if type(in_data) in {str, float, int}: - return cls.__ref6570_str_float_int_expansion( - variable_name, - in_data, - explode, - percent_encode, - prefix_separator_iterator, - var_name_piece, - named_parameter_expansion - ) - elif isinstance(in_data, none_type): - # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 - return "" - elif isinstance(in_data, list): - return cls.__ref6570_list_expansion( - variable_name, - in_data, - explode, - percent_encode, - prefix_separator_iterator, - var_name_piece, - named_parameter_expansion - ) - elif isinstance(in_data, dict): - return cls.__ref6570_dict_expansion( - variable_name, - in_data, - explode, - percent_encode, - prefix_separator_iterator, - var_name_piece, - named_parameter_expansion - ) - # bool, bytes, etc - raise ApiValueError('Unable to generate a ref6570 representation of {}'.format(in_data)) - - -class StyleFormSerializer(ParameterSerializerBase): - @classmethod - def _get_default_explode(cls, style: ParameterStyle) -> bool: - if style is ParameterStyle.FORM: - return True - return super()._get_default_explode(style) - - def _serialize_form( - self, - in_data: typing.Union[None, int, float, str, bool, dict, list], - name: str, - explode: bool, - percent_encode: bool, - prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] = None - ) -> str: - if prefix_separator_iterator is None: - prefix_separator_iterator = PrefixSeparatorIterator('', '&') - return self._ref6570_expansion( - variable_name=name, - in_data=in_data, - explode=explode, - percent_encode=percent_encode, - prefix_separator_iterator=prefix_separator_iterator - ) - - -class StyleSimpleSerializer(ParameterSerializerBase): - - def _serialize_simple( - self, - in_data: typing.Union[None, int, float, str, bool, dict, list], - name: str, - explode: bool, - percent_encode: bool - ) -> str: - prefix_separator_iterator = PrefixSeparatorIterator('', ',') - return self._ref6570_expansion( - variable_name=name, - in_data=in_data, - explode=explode, - percent_encode=percent_encode, - prefix_separator_iterator=prefix_separator_iterator - ) - - -class JSONDetector: - """ - Works for: - application/json - application/json; charset=UTF-8 - application/json-patch+json - application/geo+json - """ - __json_content_type_pattern = re.compile("application/[^+]*[+]?(json);?.*") - - @classmethod - def _content_type_is_json(cls, content_type: str) -> bool: - if cls.__json_content_type_pattern.match(content_type): - return True - return False - - -@dataclass -class ParameterBase(JSONDetector): - name: str - in_type: ParameterInType - required: bool - style: typing.Optional[ParameterStyle] - explode: typing.Optional[bool] - allow_reserved: typing.Optional[bool] - schema: typing.Optional[typing.Type[Schema]] - content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] - - __style_to_in_type = { - ParameterStyle.MATRIX: {ParameterInType.PATH}, - ParameterStyle.LABEL: {ParameterInType.PATH}, - ParameterStyle.FORM: {ParameterInType.QUERY, ParameterInType.COOKIE}, - ParameterStyle.SIMPLE: {ParameterInType.PATH, ParameterInType.HEADER}, - ParameterStyle.SPACE_DELIMITED: {ParameterInType.QUERY}, - ParameterStyle.PIPE_DELIMITED: {ParameterInType.QUERY}, - ParameterStyle.DEEP_OBJECT: {ParameterInType.QUERY}, - } - __in_type_to_default_style = { - ParameterInType.QUERY: ParameterStyle.FORM, - ParameterInType.PATH: ParameterStyle.SIMPLE, - ParameterInType.HEADER: ParameterStyle.SIMPLE, - ParameterInType.COOKIE: ParameterStyle.FORM, - } - __disallowed_header_names = {'Accept', 'Content-Type', 'Authorization'} - _json_encoder = JSONEncoder() - - @classmethod - def __verify_style_to_in_type(cls, style: typing.Optional[ParameterStyle], in_type: ParameterInType): - if style is None: - return - in_type_set = cls.__style_to_in_type[style] - if in_type not in in_type_set: - raise ValueError( - 'Invalid style and in_type combination. For style={} only in_type={} are allowed'.format( - style, in_type_set - ) - ) - - def __init__( - self, - name: str, - in_type: ParameterInType, - required: bool = False, - style: typing.Optional[ParameterStyle] = None, - explode: bool = False, - allow_reserved: typing.Optional[bool] = None, - schema: typing.Optional[typing.Type[Schema]] = None, - content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None - ): - if schema is None and content is None: - raise ValueError('Value missing; Pass in either schema or content') - if schema and content: - raise ValueError('Too many values provided. Both schema and content were provided. Only one may be input') - if name in self.__disallowed_header_names and in_type is ParameterInType.HEADER: - raise ValueError('Invalid name, name may not be one of {}'.format(self.__disallowed_header_names)) - self.__verify_style_to_in_type(style, in_type) - if content is None and style is None: - style = self.__in_type_to_default_style[in_type] - if content is not None and in_type in self.__in_type_to_default_style and len(content) != 1: - raise ValueError('Invalid content length, content length must equal 1') - self.in_type = in_type - self.name = name - self.required = required - self.style = style - self.explode = explode - self.allow_reserved = allow_reserved - self.schema = schema - self.content = content - - def _serialize_json( - self, - in_data: typing.Union[None, int, float, str, bool, dict, list], - eliminate_whitespace: bool = False - ) -> str: - if eliminate_whitespace: - return json.dumps(in_data, separators=self._json_encoder.compact_separators) - return json.dumps(in_data) - - -class PathParameter(ParameterBase, StyleSimpleSerializer): - - def __init__( - self, - name: str, - required: bool = False, - style: typing.Optional[ParameterStyle] = None, - explode: bool = False, - allow_reserved: typing.Optional[bool] = None, - schema: typing.Optional[typing.Type[Schema]] = None, - content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None - ): - super().__init__( - name, - in_type=ParameterInType.PATH, - required=required, - style=style, - explode=explode, - allow_reserved=allow_reserved, - schema=schema, - content=content - ) - - def __serialize_label( - self, - in_data: typing.Union[None, int, float, str, bool, dict, list] - ) -> typing.Dict[str, str]: - prefix_separator_iterator = PrefixSeparatorIterator('.', '.') - value = self._ref6570_expansion( - variable_name=self.name, - in_data=in_data, - explode=self.explode, - percent_encode=True, - prefix_separator_iterator=prefix_separator_iterator - ) - return self._to_dict(self.name, value) - - def __serialize_matrix( - self, - in_data: typing.Union[None, int, float, str, bool, dict, list] - ) -> typing.Dict[str, str]: - prefix_separator_iterator = PrefixSeparatorIterator(';', ';') - value = self._ref6570_expansion( - variable_name=self.name, - in_data=in_data, - explode=self.explode, - percent_encode=True, - prefix_separator_iterator=prefix_separator_iterator - ) - return self._to_dict(self.name, value) - - def __serialize_simple( - self, - in_data: typing.Union[None, int, float, str, bool, dict, list], - ) -> typing.Dict[str, str]: - value = self._serialize_simple( - in_data=in_data, - name=self.name, - explode=self.explode, - percent_encode=True - ) - return self._to_dict(self.name, value) - - def serialize( - self, - in_data: typing.Union[ - Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict] - ) -> typing.Dict[str, str]: - if self.schema: - cast_in_data = self.schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) - """ - simple -> path - path: - returns path_params: dict - label -> path - returns path_params - matrix -> path - returns path_params - """ - if self.style: - if self.style is ParameterStyle.SIMPLE: - return self.__serialize_simple(cast_in_data) - elif self.style is ParameterStyle.LABEL: - return self.__serialize_label(cast_in_data) - elif self.style is ParameterStyle.MATRIX: - return self.__serialize_matrix(cast_in_data) - # self.content will be length one - for content_type, schema in self.content.items(): - cast_in_data = schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) - if self._content_type_is_json(content_type): - value = self._serialize_json(cast_in_data) - return self._to_dict(self.name, value) - raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) - - -class QueryParameter(ParameterBase, StyleFormSerializer): - - def __init__( - self, - name: str, - required: bool = False, - style: typing.Optional[ParameterStyle] = None, - explode: typing.Optional[bool] = None, - allow_reserved: typing.Optional[bool] = None, - schema: typing.Optional[typing.Type[Schema]] = None, - content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None - ): - used_style = ParameterStyle.FORM if style is None else style - used_explode = self._get_default_explode(used_style) if explode is None else explode - - super().__init__( - name, - in_type=ParameterInType.QUERY, - required=required, - style=used_style, - explode=used_explode, - allow_reserved=allow_reserved, - schema=schema, - content=content - ) - - def __serialize_space_delimited( - self, - in_data: typing.Union[None, int, float, str, bool, dict, list], - prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] - ) -> typing.Dict[str, str]: - if prefix_separator_iterator is None: - prefix_separator_iterator = self.get_prefix_separator_iterator() - value = self._ref6570_expansion( - variable_name=self.name, - in_data=in_data, - explode=self.explode, - percent_encode=True, - prefix_separator_iterator=prefix_separator_iterator - ) - return self._to_dict(self.name, value) - - def __serialize_pipe_delimited( - self, - in_data: typing.Union[None, int, float, str, bool, dict, list], - prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] - ) -> typing.Dict[str, str]: - if prefix_separator_iterator is None: - prefix_separator_iterator = self.get_prefix_separator_iterator() - value = self._ref6570_expansion( - variable_name=self.name, - in_data=in_data, - explode=self.explode, - percent_encode=True, - prefix_separator_iterator=prefix_separator_iterator - ) - return self._to_dict(self.name, value) - - def __serialize_form( - self, - in_data: typing.Union[None, int, float, str, bool, dict, list], - prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] - ) -> typing.Dict[str, str]: - if prefix_separator_iterator is None: - prefix_separator_iterator = self.get_prefix_separator_iterator() - value = self._serialize_form( - in_data, - name=self.name, - explode=self.explode, - percent_encode=True, - prefix_separator_iterator=prefix_separator_iterator - ) - return self._to_dict(self.name, value) - - def get_prefix_separator_iterator(self) -> typing.Optional[PrefixSeparatorIterator]: - if self.style is ParameterStyle.FORM: - return PrefixSeparatorIterator('?', '&') - elif self.style is ParameterStyle.SPACE_DELIMITED: - return PrefixSeparatorIterator('', '%20') - elif self.style is ParameterStyle.PIPE_DELIMITED: - return PrefixSeparatorIterator('', '|') - - def serialize( - self, - in_data: typing.Union[ - Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict], - prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] = None - ) -> typing.Dict[str, str]: - if self.schema: - cast_in_data = self.schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) - """ - form -> query - query: - - GET/HEAD/DELETE: could use fields - - PUT/POST: must use urlencode to send parameters - returns fields: tuple - spaceDelimited -> query - returns fields - pipeDelimited -> query - returns fields - deepObject -> query, https://github.com/OAI/OpenAPI-Specification/issues/1706 - returns fields - """ - if self.style: - # TODO update query ones to omit setting values when [] {} or None is input - if self.style is ParameterStyle.FORM: - return self.__serialize_form(cast_in_data, prefix_separator_iterator) - elif self.style is ParameterStyle.SPACE_DELIMITED: - return self.__serialize_space_delimited(cast_in_data, prefix_separator_iterator) - elif self.style is ParameterStyle.PIPE_DELIMITED: - return self.__serialize_pipe_delimited(cast_in_data, prefix_separator_iterator) - # self.content will be length one - if prefix_separator_iterator is None: - prefix_separator_iterator = self.get_prefix_separator_iterator() - for content_type, schema in self.content.items(): - cast_in_data = schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) - if self._content_type_is_json(content_type): - value = self._serialize_json(cast_in_data, eliminate_whitespace=True) - return self._to_dict( - self.name, - next(prefix_separator_iterator) + self.name + '=' + quote(value) - ) - raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) - - -class CookieParameter(ParameterBase, StyleFormSerializer): - - def __init__( - self, - name: str, - required: bool = False, - style: typing.Optional[ParameterStyle] = None, - explode: typing.Optional[bool] = None, - allow_reserved: typing.Optional[bool] = None, - schema: typing.Optional[typing.Type[Schema]] = None, - content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None - ): - used_style = ParameterStyle.FORM if style is None and content is None and schema else style - used_explode = self._get_default_explode(used_style) if explode is None else explode - - super().__init__( - name, - in_type=ParameterInType.COOKIE, - required=required, - style=used_style, - explode=used_explode, - allow_reserved=allow_reserved, - schema=schema, - content=content - ) - - def serialize( - self, - in_data: typing.Union[ - Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict] - ) -> typing.Dict[str, str]: - if self.schema: - cast_in_data = self.schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) - """ - form -> cookie - returns fields: tuple - """ - if self.style: - """ - TODO add escaping of comma, space, equals - or turn encoding on - """ - value = self._serialize_form( - cast_in_data, - explode=self.explode, - name=self.name, - percent_encode=False, - prefix_separator_iterator=PrefixSeparatorIterator('', '&') - ) - return self._to_dict(self.name, value) - # self.content will be length one - for content_type, schema in self.content.items(): - cast_in_data = schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) - if self._content_type_is_json(content_type): - value = self._serialize_json(cast_in_data) - return self._to_dict(self.name, value) - raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) - - -class HeaderParameter(ParameterBase, StyleSimpleSerializer): - def __init__( - self, - name: str, - required: bool = False, - style: typing.Optional[ParameterStyle] = None, - explode: bool = False, - allow_reserved: typing.Optional[bool] = None, - schema: typing.Optional[typing.Type[Schema]] = None, - content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None - ): - super().__init__( - name, - in_type=ParameterInType.HEADER, - required=required, - style=style, - explode=explode, - allow_reserved=allow_reserved, - schema=schema, - content=content - ) - - @staticmethod - def __to_headers(in_data: typing.Tuple[typing.Tuple[str, str], ...]) -> HTTPHeaderDict: - data = tuple(t for t in in_data if t) - headers = HTTPHeaderDict() - if not data: - return headers - headers.extend(data) - return headers - - def serialize( - self, - in_data: typing.Union[ - Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict] - ) -> HTTPHeaderDict: - if self.schema: - cast_in_data = self.schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) - """ - simple -> header - headers: PoolManager needs a mapping, tuple is close - returns headers: dict - """ - if self.style: - value = self._serialize_simple(cast_in_data, self.name, self.explode, False) - return self.__to_headers(((self.name, value),)) - # self.content will be length one - for content_type, schema in self.content.items(): - cast_in_data = schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) - if self._content_type_is_json(content_type): - value = self._serialize_json(cast_in_data) - return self.__to_headers(((self.name, value),)) - raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) - - -class Encoding: - def __init__( - self, - content_type: str, - headers: typing.Optional[typing.Dict[str, HeaderParameter]] = None, - style: typing.Optional[ParameterStyle] = None, - explode: bool = False, - allow_reserved: bool = False, - ): - self.content_type = content_type - self.headers = headers - self.style = style - self.explode = explode - self.allow_reserved = allow_reserved - - -@dataclass -class MediaType: - """ - Used to store request and response body schema information - encoding: - A map between a property name and its encoding information. - The key, being the property name, MUST exist in the schema as a property. - The encoding object SHALL only apply to requestBody objects when the media type is - multipart or application/x-www-form-urlencoded. - """ - schema: typing.Optional[typing.Type[Schema]] = None - encoding: typing.Optional[typing.Dict[str, Encoding]] = None - - -@dataclass -class ApiResponse: - response: urllib3.HTTPResponse - body: typing.Union[Unset, Schema] = unset - headers: typing.Union[Unset, typing.Dict[str, Schema]] = unset - - def __init__( - self, - response: urllib3.HTTPResponse, - body: typing.Union[Unset, Schema] = unset, - headers: typing.Union[Unset, typing.Dict[str, Schema]] = unset - ): - """ - pycharm needs this to prevent 'Unexpected argument' warnings - """ - self.response = response - self.body = body - self.headers = headers - - -@dataclass -class ApiResponseWithoutDeserialization(ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[Unset, typing.Type[Schema]] = unset - headers: typing.Union[Unset, typing.List[HeaderParameter]] = unset - - -class OpenApiResponse(JSONDetector): - __filename_content_disposition_pattern = re.compile('filename="(.+?)"') - - def __init__( - self, - response_cls: typing.Type[ApiResponse] = ApiResponse, - content: typing.Optional[typing.Dict[str, MediaType]] = None, - headers: typing.Optional[typing.List[HeaderParameter]] = None, - ): - self.headers = headers - if content is not None and len(content) == 0: - raise ValueError('Invalid value for content, the content dict must have >= 1 entry') - self.content = content - self.response_cls = response_cls - - @staticmethod - def __deserialize_json(response: urllib3.HTTPResponse) -> typing.Any: - # python must be >= 3.9 so we can pass in bytes into json.loads - return json.loads(response.data) - - @staticmethod - def __file_name_from_response_url(response_url: typing.Optional[str]) -> typing.Optional[str]: - if response_url is None: - return None - url_path = urlparse(response_url).path - if url_path: - path_basename = os.path.basename(url_path) - if path_basename: - _filename, ext = os.path.splitext(path_basename) - if ext: - return path_basename - return None - - @classmethod - def __file_name_from_content_disposition(cls, content_disposition: typing.Optional[str]) -> typing.Optional[str]: - if content_disposition is None: - return None - match = cls.__filename_content_disposition_pattern.search(content_disposition) - if not match: - return None - return match.group(1) - - def __deserialize_application_octet_stream( - self, response: urllib3.HTTPResponse - ) -> typing.Union[bytes, io.BufferedReader]: - """ - urllib3 use cases: - 1. when preload_content=True (stream=False) then supports_chunked_reads is False and bytes are returned - 2. when preload_content=False (stream=True) then supports_chunked_reads is True and - a file will be written and returned - """ - if response.supports_chunked_reads(): - file_name = ( - self.__file_name_from_content_disposition(response.headers.get('content-disposition')) - or self.__file_name_from_response_url(response.geturl()) - ) - - if file_name is None: - _fd, path = tempfile.mkstemp() - else: - path = os.path.join(tempfile.gettempdir(), file_name) - - with open(path, 'wb') as new_file: - chunk_size = 1024 - while True: - data = response.read(chunk_size) - if not data: - break - new_file.write(data) - # release_conn is needed for streaming connections only - response.release_conn() - new_file = open(path, 'rb') - return new_file - else: - return response.data - - @staticmethod - def __deserialize_multipart_form_data( - response: urllib3.HTTPResponse - ) -> typing.Dict[str, typing.Any]: - msg = email.message_from_bytes(response.data) - return { - part.get_param("name", header="Content-Disposition"): part.get_payload( - decode=True - ).decode(part.get_content_charset()) - if part.get_content_charset() - else part.get_payload() - for part in msg.get_payload() - } - - def deserialize(self, response: urllib3.HTTPResponse, configuration: Configuration) -> ApiResponse: - content_type = response.getheader('content-type') - deserialized_body = unset - streamed = response.supports_chunked_reads() - - deserialized_headers = unset - if self.headers is not None: - # TODO add header deserialiation here - pass - - if self.content is not None: - if content_type not in self.content: - raise ApiValueError( - f"Invalid content_type returned. Content_type='{content_type}' was returned " - f"when only {str(set(self.content))} are defined for status_code={str(response.status)}" - ) - body_schema = self.content[content_type].schema - if body_schema is None: - # some specs do not define response content media type schemas - return self.response_cls( - response=response, - headers=deserialized_headers, - body=unset - ) - - if self._content_type_is_json(content_type): - body_data = self.__deserialize_json(response) - elif content_type == 'application/octet-stream': - body_data = self.__deserialize_application_octet_stream(response) - elif content_type.startswith('multipart/form-data'): - body_data = self.__deserialize_multipart_form_data(response) - content_type = 'multipart/form-data' - else: - raise NotImplementedError('Deserialization of {} has not yet been implemented'.format(content_type)) - deserialized_body = body_schema.from_openapi_data_oapg( - body_data, _configuration=configuration) - elif streamed: - response.release_conn() - - return self.response_cls( - response=response, - headers=deserialized_headers, - body=deserialized_body - ) - - -class ApiClient: - """Generic API client for OpenAPI client library builds. - - OpenAPI generic API client. This client handles the client- - server communication, and is invariant across implementations. Specifics of - the methods and models for each application are generated from the OpenAPI - templates. - - NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - Do not edit the class manually. - - :param configuration: .Configuration object for this client - :param header_name: a header to pass when making calls to the API. - :param header_value: a header value to pass when making calls to - the API. - :param cookie: a cookie to include in the header when making calls - to the API - :param pool_threads: The number of threads to use for async requests - to the API. More threads means more concurrent API requests. - """ - - _pool = None - - def __init__( - self, - configuration: typing.Optional[Configuration] = None, - header_name: typing.Optional[str] = None, - header_value: typing.Optional[str] = None, - cookie: typing.Optional[str] = None, - pool_threads: int = 1 - ): - if configuration is None: - configuration = Configuration() - self.configuration = configuration - self.pool_threads = pool_threads - - self.rest_client = rest.RESTClientObject(configuration) - self.default_headers = HTTPHeaderDict() - if header_name is not None: - self.default_headers[header_name] = header_value - self.cookie = cookie - # Set default User-Agent. - self.user_agent = '{{#if httpUserAgent}}{{{httpUserAgent}}}{{/if}}{{#unless httpUserAgent}}OpenAPI-Generator/{{{packageVersion}}}/python{{/unless}}' - - def __enter__(self): - return self - - def __exit__(self, exc_type, exc_value, traceback): - self.close() - - def close(self): - if self._pool: - self._pool.close() - self._pool.join() - self._pool = None - if hasattr(atexit, 'unregister'): - atexit.unregister(self.close) - - @property - def pool(self): - """Create thread pool on first request - avoids instantiating unused threadpool for blocking clients. - """ - if self._pool is None: - atexit.register(self.close) - self._pool = ThreadPool(self.pool_threads) - return self._pool - - @property - def user_agent(self): - """User agent for this API client""" - return self.default_headers['User-Agent'] - - @user_agent.setter - def user_agent(self, value): - self.default_headers['User-Agent'] = value - - def set_default_header(self, header_name, header_value): - self.default_headers[header_name] = header_value - - {{#if tornado}} - @tornado.gen.coroutine - {{/if}} - {{#if asyncio}}async {{/if}}def __call_api( - self, - resource_path: str, - method: str, - headers: typing.Optional[HTTPHeaderDict] = None, - body: typing.Optional[typing.Union[str, bytes]] = None, - fields: typing.Optional[typing.Tuple[typing.Tuple[str, str], ...]] = None, - auth_settings: typing.Optional[typing.List[str]] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - host: typing.Optional[str] = None, - ) -> urllib3.HTTPResponse: - - # header parameters - used_headers = HTTPHeaderDict(self.default_headers) - if self.cookie: - headers['Cookie'] = self.cookie - - # auth setting - self.update_params_for_auth(used_headers, - auth_settings, resource_path, method, body) - - # must happen after cookie setting and auth setting in case user is overriding those - if headers: - used_headers.update(headers) - - # request url - if host is None: - url = self.configuration.host + resource_path - else: - # use server/host defined in path or operation instead - url = host + resource_path - - # perform request and return response - response = {{#if asyncio}}await {{/if}}{{#if tornado}}yield {{/if}}self.request( - method, - url, - headers=used_headers, - fields=fields, - body=body, - stream=stream, - timeout=timeout, - ) - return response - - def call_api( - self, - resource_path: str, - method: str, - headers: typing.Optional[HTTPHeaderDict] = None, - body: typing.Optional[typing.Union[str, bytes]] = None, - fields: typing.Optional[typing.Tuple[typing.Tuple[str, str], ...]] = None, - auth_settings: typing.Optional[typing.List[str]] = None, - async_req: typing.Optional[bool] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - host: typing.Optional[str] = None, - ) -> urllib3.HTTPResponse: - """Makes the HTTP request (synchronous) and returns deserialized data. - - To make an async_req request, set the async_req parameter. - - :param resource_path: Path to method endpoint. - :param method: Method to call. - :param headers: Header parameters to be - placed in the request header. - :param body: Request body. - :param fields: Request post form parameters, - for `application/x-www-form-urlencoded`, `multipart/form-data`. - :param auth_settings: Auth Settings names for the request. - :param async_req: execute request asynchronously - :type async_req: bool, optional TODO remove, unused - :param stream: if True, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Also when True, if the openapi spec describes a file download, - the data will be written to a local filesystme file and the BinarySchema - instance will also inherit from FileSchema and FileIO - Default is False. - :type stream: bool, optional - :param timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param host: api endpoint host - :return: - If async_req parameter is True, - the request will be called asynchronously. - The method will return the request thread. - If parameter async_req is False or missing, - then the method will return the response directly. - """ - - if not async_req: - return self.__call_api( - resource_path, - method, - headers, - body, - fields, - auth_settings, - stream, - timeout, - host, - ) - - return self.pool.apply_async( - self.__call_api, - ( - resource_path, - method, - headers, - body, - json, - fields, - auth_settings, - stream, - timeout, - host, - ) - ) - - def request( - self, - method: str, - url: str, - headers: typing.Optional[HTTPHeaderDict] = None, - fields: typing.Optional[typing.Tuple[typing.Tuple[str, str], ...]] = None, - body: typing.Optional[typing.Union[str, bytes]] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> urllib3.HTTPResponse: - """Makes the HTTP request using RESTClient.""" - if method == "GET": - return self.rest_client.GET(url, - stream=stream, - timeout=timeout, - headers=headers) - elif method == "HEAD": - return self.rest_client.HEAD(url, - stream=stream, - timeout=timeout, - headers=headers) - elif method == "OPTIONS": - return self.rest_client.OPTIONS(url, - headers=headers, - fields=fields, - stream=stream, - timeout=timeout, - body=body) - elif method == "POST": - return self.rest_client.POST(url, - headers=headers, - fields=fields, - stream=stream, - timeout=timeout, - body=body) - elif method == "PUT": - return self.rest_client.PUT(url, - headers=headers, - fields=fields, - stream=stream, - timeout=timeout, - body=body) - elif method == "PATCH": - return self.rest_client.PATCH(url, - headers=headers, - fields=fields, - stream=stream, - timeout=timeout, - body=body) - elif method == "DELETE": - return self.rest_client.DELETE(url, - headers=headers, - stream=stream, - timeout=timeout, - body=body) - else: - raise ApiValueError( - "http method must be `GET`, `HEAD`, `OPTIONS`," - " `POST`, `PATCH`, `PUT` or `DELETE`." - ) - - def update_params_for_auth(self, headers, auth_settings, - resource_path, method, body): - """Updates header and query params based on authentication setting. - - :param headers: Header parameters dict to be updated. - :param auth_settings: Authentication setting identifiers list. - :param resource_path: A string representation of the HTTP request resource path. - :param method: A string representation of the HTTP request method. - :param body: A object representing the body of the HTTP request. - The object type is the return value of _encoder.default(). - """ - if not auth_settings: - return - - for auth in auth_settings: - auth_setting = self.configuration.auth_settings().get(auth) - if not auth_setting: - continue - if auth_setting['in'] == 'cookie': - headers.add('Cookie', auth_setting['value']) - elif auth_setting['in'] == 'header': - if auth_setting['type'] != 'http-signature': - headers.add(auth_setting['key'], auth_setting['value']) -{{#if hasHttpSignatureMethods}} - else: - # The HTTP signature scheme requires multiple HTTP headers - # that are calculated dynamically. - signing_info = self.configuration.signing_info - querys = tuple() - auth_headers = signing_info.get_http_signature_headers( - resource_path, method, headers, body, querys) - for key, value in auth_headers.items(): - headers.add(key, value) -{{/if}} - elif auth_setting['in'] == 'query': - """ TODO implement auth in query - need to pass in prefix_separator_iterator - and need to output resource_path with query params added - """ - raise ApiValueError("Auth in query not yet implemented") - else: - raise ApiValueError( - 'Authentication token must be in `query` or `header`' - ) - - -class Api: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client: typing.Optional[ApiClient] = None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - @staticmethod - def _verify_typed_dict_inputs_oapg(cls: typing.Type[typing_extensions.TypedDict], data: typing.Dict[str, typing.Any]): - """ - Ensures that: - - required keys are present - - additional properties are not input - - value stored under required keys do not have the value unset - Note: detailed value checking is done in schema classes - """ - missing_required_keys = [] - required_keys_with_unset_values = [] - for required_key in cls.__required_keys__: - if required_key not in data: - missing_required_keys.append(required_key) - continue - value = data[required_key] - if value is unset: - required_keys_with_unset_values.append(required_key) - if missing_required_keys: - raise ApiTypeError( - '{} missing {} required arguments: {}'.format( - cls.__name__, len(missing_required_keys), missing_required_keys - ) - ) - if required_keys_with_unset_values: - raise ApiValueError( - '{} contains invalid unset values for {} required keys: {}'.format( - cls.__name__, len(required_keys_with_unset_values), required_keys_with_unset_values - ) - ) - - disallowed_additional_keys = [] - for key in data: - if key in cls.__required_keys__ or key in cls.__optional_keys__: - continue - disallowed_additional_keys.append(key) - if disallowed_additional_keys: - raise ApiTypeError( - '{} got {} unexpected keyword arguments: {}'.format( - cls.__name__, len(disallowed_additional_keys), disallowed_additional_keys - ) - ) - - def _get_host_oapg( - self, - operation_id: str, - servers: typing.Tuple[typing.Dict[str, str], ...] = tuple(), - host_index: typing.Optional[int] = None - ) -> typing.Optional[str]: - configuration = self.api_client.configuration - try: - if host_index is None: - index = configuration.server_operation_index.get( - operation_id, configuration.server_index - ) - else: - index = host_index - server_variables = configuration.server_operation_variables.get( - operation_id, configuration.server_variables - ) - host = configuration.get_host_from_settings( - index, variables=server_variables, servers=servers - ) - except IndexError: - if servers: - raise ApiValueError( - "Invalid host index. Must be 0 <= index < %s" % - len(servers) - ) - host = None - return host - - -class SerializedRequestBody(typing_extensions.TypedDict, total=False): - body: typing.Union[str, bytes] - fields: typing.Tuple[typing.Union[RequestField, typing.Tuple[str, str]], ...] - - -class RequestBody(StyleFormSerializer, JSONDetector): - """ - A request body parameter - content: content_type to MediaType Schema info - """ - __json_encoder = JSONEncoder() - - def __init__( - self, - content: typing.Dict[str, MediaType], - required: bool = False, - ): - self.required = required - if len(content) == 0: - raise ValueError('Invalid value for content, the content dict must have >= 1 entry') - self.content = content - - def __serialize_json( - self, - in_data: typing.Any - ) -> typing.Dict[str, bytes]: - in_data = self.__json_encoder.default(in_data) - json_str = json.dumps(in_data, separators=(",", ":"), ensure_ascii=False).encode( - "utf-8" - ) - return dict(body=json_str) - - @staticmethod - def __serialize_text_plain(in_data: typing.Any) -> typing.Dict[str, str]: - if isinstance(in_data, frozendict.frozendict): - raise ValueError('Unable to serialize type frozendict.frozendict to text/plain') - elif isinstance(in_data, tuple): - raise ValueError('Unable to serialize type tuple to text/plain') - elif isinstance(in_data, NoneClass): - raise ValueError('Unable to serialize type NoneClass to text/plain') - elif isinstance(in_data, BoolClass): - raise ValueError('Unable to serialize type BoolClass to text/plain') - return dict(body=str(in_data)) - - def __multipart_json_item(self, key: str, value: Schema) -> RequestField: - json_value = self.__json_encoder.default(value) - request_field = RequestField(name=key, data=json.dumps(json_value)) - request_field.make_multipart(content_type='application/json') - return request_field - - def __multipart_form_item(self, key: str, value: Schema) -> RequestField: - if isinstance(value, str): - request_field = RequestField(name=key, data=str(value)) - request_field.make_multipart(content_type='text/plain') - elif isinstance(value, bytes): - request_field = RequestField(name=key, data=value) - request_field.make_multipart(content_type='application/octet-stream') - elif isinstance(value, FileIO): - # TODO use content.encoding to limit allowed content types if they are present - request_field = RequestField.from_tuples(key, (os.path.basename(value.name), value.read())) - value.close() - else: - request_field = self.__multipart_json_item(key=key, value=value) - return request_field - - def __serialize_multipart_form_data( - self, in_data: Schema - ) -> typing.Dict[str, typing.Tuple[RequestField, ...]]: - if not isinstance(in_data, frozendict.frozendict): - raise ValueError(f'Unable to serialize {in_data} to multipart/form-data because it is not a dict of data') - """ - In a multipart/form-data request body, each schema property, or each element of a schema array property, - takes a section in the payload with an internal header as defined by RFC7578. The serialization strategy - for each property of a multipart/form-data request body can be specified in an associated Encoding Object. - - When passing in multipart types, boundaries MAY be used to separate sections of the content being - transferred – thus, the following default Content-Types are defined for multipart: - - If the (object) property is a primitive, or an array of primitive values, the default Content-Type is text/plain - If the property is complex, or an array of complex values, the default Content-Type is application/json - Question: how is the array of primitives encoded? - If the property is a type: string with a contentEncoding, the default Content-Type is application/octet-stream - """ - fields = [] - for key, value in in_data.items(): - if isinstance(value, tuple): - if value: - # values use explode = True, so the code makes a RequestField for each item with name=key - for item in value: - request_field = self.__multipart_form_item(key=key, value=item) - fields.append(request_field) - else: - # send an empty array as json because exploding will not send it - request_field = self.__multipart_json_item(key=key, value=value) - fields.append(request_field) - else: - request_field = self.__multipart_form_item(key=key, value=value) - fields.append(request_field) - - return dict(fields=tuple(fields)) - - def __serialize_application_octet_stream(self, in_data: BinarySchema) -> typing.Dict[str, bytes]: - if isinstance(in_data, bytes): - return dict(body=in_data) - # FileIO type - result = dict(body=in_data.read()) - in_data.close() - return result - - def __serialize_application_x_www_form_data( - self, in_data: typing.Any - ) -> SerializedRequestBody: - """ - POST submission of form data in body - """ - if not isinstance(in_data, frozendict.frozendict): - raise ValueError( - f'Unable to serialize {in_data} to application/x-www-form-urlencoded because it is not a dict of data') - cast_in_data = self.__json_encoder.default(in_data) - value = self._serialize_form(cast_in_data, name='', explode=True, percent_encode=True) - return dict(body=value) - - def serialize( - self, in_data: typing.Any, content_type: str - ) -> SerializedRequestBody: - """ - If a str is returned then the result will be assigned to data when making the request - If a tuple is returned then the result will be used as fields input in encode_multipart_formdata - Return a tuple of - - The key of the return dict is - - body for application/json - - encode_multipart and fields for multipart/form-data - """ - media_type = self.content[content_type] - if isinstance(in_data, media_type.schema): - cast_in_data = in_data - elif isinstance(in_data, (dict, frozendict.frozendict)) and in_data: - cast_in_data = media_type.schema(**in_data) - else: - cast_in_data = media_type.schema(in_data) - # TODO check for and use encoding if it exists - # and content_type is multipart or application/x-www-form-urlencoded - if self._content_type_is_json(content_type): - return self.__serialize_json(cast_in_data) - elif content_type == 'text/plain': - return self.__serialize_text_plain(cast_in_data) - elif content_type == 'multipart/form-data': - return self.__serialize_multipart_form_data(cast_in_data) - elif content_type == 'application/x-www-form-urlencoded': - return self.__serialize_application_x_www_form_data(cast_in_data) - elif content_type == 'application/octet-stream': - return self.__serialize_application_octet_stream(cast_in_data) - raise NotImplementedError('Serialization has not yet been implemented for {}'.format(content_type)) diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/api_client.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/api_client.hbs new file mode 100644 index 00000000000..e346ad8d976 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/api_client.hbs @@ -0,0 +1,1399 @@ +# coding: utf-8 +{{> _helper_header }} + +import datetime +import dataclasses +import decimal +import enum +import email +import json +import os +import io +import atexit +from multiprocessing import pool +import re +import tempfile +import typing +import typing_extensions +from urllib import parse +import urllib3 +from urllib3 import _collections, fields + +{{#if tornado}} +import tornado.gen +{{/if}} +import frozendict + +from {{packageName}} import exceptions, rest, schemas, security_schemes +from {{packageName}}.configurations import schema_configuration, api_configuration + + +class RequestField(fields.RequestField): + def __eq__(self, other): + if not isinstance(other, RequestField): + return False + return self.__dict__ == other.__dict__ + + +class JSONEncoder(json.JSONEncoder): + compact_separators = (',', ':') + + def default(self, obj): + if isinstance(obj, str): + return str(obj) + elif isinstance(obj, float): + return float(obj) + elif isinstance(obj, int): + return int(obj) + elif isinstance(obj, decimal.Decimal): + if obj.as_tuple().exponent >= 0: + return int(obj) + return float(obj) + elif isinstance(obj, schemas.NoneClass): + return None + elif isinstance(obj, schemas.BoolClass): + return bool(obj) + elif isinstance(obj, (dict, frozendict.frozendict)): + return {key: self.default(val) for key, val in obj.items()} + elif isinstance(obj, (list, tuple)): + return [self.default(item) for item in obj] + raise exceptions.ApiValueError('Unable to prepare type {} for serialization'.format(obj.__class__.__name__)) + + +class ParameterInType(enum.Enum): + QUERY = 'query' + HEADER = 'header' + PATH = 'path' + COOKIE = 'cookie' + + +class ParameterStyle(enum.Enum): + MATRIX = 'matrix' + LABEL = 'label' + FORM = 'form' + SIMPLE = 'simple' + SPACE_DELIMITED = 'spaceDelimited' + PIPE_DELIMITED = 'pipeDelimited' + DEEP_OBJECT = 'deepObject' + + +class PrefixSeparatorIterator: + # A class to store prefixes and separators for rfc6570 expansions + + def __init__(self, prefix: str, separator: str): + self.prefix = prefix + self.separator = separator + self.first = True + if separator in {'.', '|', '%20'}: + item_separator = separator + else: + item_separator = ',' + self.item_separator = item_separator + + def __iter__(self): + return self + + def __next__(self): + if self.first: + self.first = False + return self.prefix + return self.separator + + +class ParameterSerializerBase: + @staticmethod + def __ref6570_item_value(in_data: typing.Any, percent_encode: bool): + """ + Get representation if str/float/int/None/items in list/ values in dict + None is returned if an item is undefined, use cases are value= + - None + - [] + - {} + - [None, None None] + - {'a': None, 'b': None} + """ + if type(in_data) in {str, float, int}: + if percent_encode: + return parse.quote(str(in_data)) + return str(in_data) + elif isinstance(in_data, schemas.none_type_): + # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 + return None + elif isinstance(in_data, list) and not in_data: + # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 + return None + elif isinstance(in_data, dict) and not in_data: + # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 + return None + raise exceptions.ApiValueError('Unable to generate a ref6570 item representation of {}'.format(in_data)) + + @staticmethod + def _to_dict(name: str, value: str): + return {name: value} + + @classmethod + def __ref6570_str_float_int_expansion( + cls, + variable_name: str, + in_data: typing.Any, + explode: bool, + percent_encode: bool, + prefix_separator_iterator: PrefixSeparatorIterator, + var_name_piece: str, + named_parameter_expansion: bool + ) -> str: + item_value = cls.__ref6570_item_value(in_data, percent_encode) + if item_value is None or (item_value == '' and prefix_separator_iterator.separator == ';'): + return next(prefix_separator_iterator) + var_name_piece + value_pair_equals = '=' if named_parameter_expansion else '' + return next(prefix_separator_iterator) + var_name_piece + value_pair_equals + item_value + + @classmethod + def __ref6570_list_expansion( + cls, + variable_name: str, + in_data: typing.Any, + explode: bool, + percent_encode: bool, + prefix_separator_iterator: PrefixSeparatorIterator, + var_name_piece: str, + named_parameter_expansion: bool + ) -> str: + item_values = [cls.__ref6570_item_value(v, percent_encode) for v in in_data] + item_values = [v for v in item_values if v is not None] + if not item_values: + # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 + return "" + value_pair_equals = '=' if named_parameter_expansion else '' + if not explode: + return ( + next(prefix_separator_iterator) + + var_name_piece + + value_pair_equals + + prefix_separator_iterator.item_separator.join(item_values) + ) + # exploded + return next(prefix_separator_iterator) + next(prefix_separator_iterator).join( + [var_name_piece + value_pair_equals + val for val in item_values] + ) + + @classmethod + def __ref6570_dict_expansion( + cls, + variable_name: str, + in_data: typing.Any, + explode: bool, + percent_encode: bool, + prefix_separator_iterator: PrefixSeparatorIterator, + var_name_piece: str, + named_parameter_expansion: bool + ) -> str: + in_data_transformed = {key: cls.__ref6570_item_value(val, percent_encode) for key, val in in_data.items()} + in_data_transformed = {key: val for key, val in in_data_transformed.items() if val is not None} + if not in_data_transformed: + # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 + return "" + value_pair_equals = '=' if named_parameter_expansion else '' + if not explode: + return ( + next(prefix_separator_iterator) + + var_name_piece + value_pair_equals + + prefix_separator_iterator.item_separator.join( + prefix_separator_iterator.item_separator.join( + item_pair + ) for item_pair in in_data_transformed.items() + ) + ) + # exploded + return next(prefix_separator_iterator) + next(prefix_separator_iterator).join( + [key + '=' + val for key, val in in_data_transformed.items()] + ) + + @classmethod + def _ref6570_expansion( + cls, + variable_name: str, + in_data: typing.Any, + explode: bool, + percent_encode: bool, + prefix_separator_iterator: PrefixSeparatorIterator + ) -> str: + """ + Separator is for separate variables like dict with explode true, not for array item separation + """ + named_parameter_expansion = prefix_separator_iterator.separator in {'&', ';'} + var_name_piece = variable_name if named_parameter_expansion else '' + if type(in_data) in {str, float, int}: + return cls.__ref6570_str_float_int_expansion( + variable_name, + in_data, + explode, + percent_encode, + prefix_separator_iterator, + var_name_piece, + named_parameter_expansion + ) + elif isinstance(in_data, schemas.none_type_): + # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 + return "" + elif isinstance(in_data, list): + return cls.__ref6570_list_expansion( + variable_name, + in_data, + explode, + percent_encode, + prefix_separator_iterator, + var_name_piece, + named_parameter_expansion + ) + elif isinstance(in_data, dict): + return cls.__ref6570_dict_expansion( + variable_name, + in_data, + explode, + percent_encode, + prefix_separator_iterator, + var_name_piece, + named_parameter_expansion + ) + # bool, bytes, etc + raise exceptions.ApiValueError('Unable to generate a ref6570 representation of {}'.format(in_data)) + + +class StyleFormSerializer(ParameterSerializerBase): + @classmethod + def _serialize_form( + cls, + in_data: typing.Union[None, int, float, str, bool, dict, list], + name: str, + explode: bool, + percent_encode: bool, + prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] = None + ) -> str: + if prefix_separator_iterator is None: + prefix_separator_iterator = PrefixSeparatorIterator('', '&') + return cls._ref6570_expansion( + variable_name=name, + in_data=in_data, + explode=explode, + percent_encode=percent_encode, + prefix_separator_iterator=prefix_separator_iterator + ) + + +class StyleSimpleSerializer(ParameterSerializerBase): + + @classmethod + def _serialize_simple( + cls, + in_data: typing.Union[None, int, float, str, bool, dict, list], + name: str, + explode: bool, + percent_encode: bool + ) -> str: + prefix_separator_iterator = PrefixSeparatorIterator('', ',') + return cls._ref6570_expansion( + variable_name=name, + in_data=in_data, + explode=explode, + percent_encode=percent_encode, + prefix_separator_iterator=prefix_separator_iterator + ) + + @classmethod + def _deserialize_simple( + cls, + in_data: str, + name: str, + explode: bool, + percent_encode: bool + ) -> typing.Union[str, typing.List[str], typing.Dict[str, str]]: + raise NotImplementedError( + "Deserialization of style=simple has not yet been added. " + "If you need this how about you submit a PR adding it?" + ) + + +class JSONDetector: + """ + Works for: + application/json + application/json; charset=UTF-8 + application/json-patch+json + application/geo+json + """ + __json_content_type_pattern = re.compile("application/[^+]*[+]?(json);?.*") + + @classmethod + def _content_type_is_json(cls, content_type: str) -> bool: + if cls.__json_content_type_pattern.match(content_type): + return True + return False + + +class Encoding: + def __init__( + self, + content_type: str, + headers: typing.Optional[typing.Dict[str, 'HeaderParameter']] = None, + style: typing.Optional[ParameterStyle] = None, + explode: bool = False, + allow_reserved: bool = False, + ): + self.content_type = content_type + self.headers = headers + self.style = style + self.explode = explode + self.allow_reserved = allow_reserved + + +@dataclasses.dataclass +class MediaType: + """ + Used to store request and response body schema information + encoding: + A map between a property name and its encoding information. + The key, being the property name, MUST exist in the schema as a property. + The encoding object SHALL only apply to requestBody objects when the media type is + multipart or application/x-www-form-urlencoded. + """ + schema: typing.Optional[typing.Type[schemas.Schema]] = None + encoding: typing.Optional[typing.Dict[str, Encoding]] = None + + +@dataclasses.dataclass +class ParameterBase(JSONDetector): + in_type: ParameterInType + required: bool + style: typing.Optional[ParameterStyle] + explode: typing.Optional[bool] + allow_reserved: typing.Optional[bool] + schema: typing.Optional[typing.Type[schemas.Schema]] + content: typing.Optional[typing.Dict[str, typing.Type[MediaType]]] + + _json_encoder = JSONEncoder() + + def __init_subclass__(cls, **kwargs): + if cls.explode is None: + if cls.style is ParameterStyle.FORM: + cls.explode = True + else: + cls.explode = False + + @classmethod + def _serialize_json( + cls, + in_data: typing.Union[None, int, float, str, bool, dict, list], + eliminate_whitespace: bool = False + ) -> str: + if eliminate_whitespace: + return json.dumps(in_data, separators=cls._json_encoder.compact_separators) + return json.dumps(in_data) + + +class PathParameter(ParameterBase, StyleSimpleSerializer): + name: str + required: bool = False + in_type: ParameterInType = ParameterInType.PATH + style: ParameterStyle = ParameterStyle.SIMPLE + explode: bool = False + allow_reserved: typing.Optional[bool] = None + schema: typing.Optional[typing.Type[schemas.Schema]] = None + content: typing.Optional[typing.Dict[str, typing.Type[schemas.Schema]]] = None + + @classmethod + def __serialize_label( + cls, + in_data: typing.Union[None, int, float, str, bool, dict, list] + ) -> typing.Dict[str, str]: + prefix_separator_iterator = PrefixSeparatorIterator('.', '.') + value = cls._ref6570_expansion( + variable_name=cls.name, + in_data=in_data, + explode=cls.explode, + percent_encode=True, + prefix_separator_iterator=prefix_separator_iterator + ) + return cls._to_dict(cls.name, value) + + @classmethod + def __serialize_matrix( + cls, + in_data: typing.Union[None, int, float, str, bool, dict, list] + ) -> typing.Dict[str, str]: + prefix_separator_iterator = PrefixSeparatorIterator(';', ';') + value = cls._ref6570_expansion( + variable_name=cls.name, + in_data=in_data, + explode=cls.explode, + percent_encode=True, + prefix_separator_iterator=prefix_separator_iterator + ) + return cls._to_dict(cls.name, value) + + @classmethod + def __serialize_simple( + cls, + in_data: typing.Union[None, int, float, str, bool, dict, list], + ) -> typing.Dict[str, str]: + value = cls._serialize_simple( + in_data=in_data, + name=cls.name, + explode=cls.explode, + percent_encode=True + ) + return cls._to_dict(cls.name, value) + + @classmethod + def serialize( + cls, + in_data: typing.Union[ + schemas.Schema, decimal.Decimal, int, float, str, datetime.date, datetime.datetime, None, bool, list, tuple, dict, frozendict.frozendict] + ) -> typing.Dict[str, str]: + if cls.schema: + cast_in_data = cls.schema(in_data) + cast_in_data = cls._json_encoder.default(cast_in_data) + """ + simple -> path + path: + returns path_params: dict + label -> path + returns path_params + matrix -> path + returns path_params + """ + if cls.style: + if cls.style is ParameterStyle.SIMPLE: + return cls.__serialize_simple(cast_in_data) + elif cls.style is ParameterStyle.LABEL: + return cls.__serialize_label(cast_in_data) + elif cls.style is ParameterStyle.MATRIX: + return cls.__serialize_matrix(cast_in_data) + # cls.content will be length one + for content_type, schema in cls.content.items(): + cast_in_data = schema(in_data) + cast_in_data = cls._json_encoder.default(cast_in_data) + if cls._content_type_is_json(content_type): + value = cls._serialize_json(cast_in_data) + return cls._to_dict(cls.name, value) + raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) + + +class QueryParameter(ParameterBase, StyleFormSerializer): + name: str + required: bool = False + in_type: ParameterInType = ParameterInType.QUERY + style: ParameterStyle = ParameterStyle.FORM + explode: typing.Optional[bool] = None + allow_reserved: typing.Optional[bool] = None + schema: typing.Optional[typing.Type[schemas.Schema]] = None + content: typing.Optional[typing.Dict[str, typing.Type[schemas.Schema]]] = None + + @classmethod + def __serialize_space_delimited( + cls, + in_data: typing.Union[None, int, float, str, bool, dict, list], + prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] + ) -> typing.Dict[str, str]: + if prefix_separator_iterator is None: + prefix_separator_iterator = cls.get_prefix_separator_iterator() + value = cls._ref6570_expansion( + variable_name=cls.name, + in_data=in_data, + explode=cls.explode, + percent_encode=True, + prefix_separator_iterator=prefix_separator_iterator + ) + return cls._to_dict(cls.name, value) + + @classmethod + def __serialize_pipe_delimited( + cls, + in_data: typing.Union[None, int, float, str, bool, dict, list], + prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] + ) -> typing.Dict[str, str]: + if prefix_separator_iterator is None: + prefix_separator_iterator = cls.get_prefix_separator_iterator() + value = cls._ref6570_expansion( + variable_name=cls.name, + in_data=in_data, + explode=cls.explode, + percent_encode=True, + prefix_separator_iterator=prefix_separator_iterator + ) + return cls._to_dict(cls.name, value) + + @classmethod + def __serialize_form( + cls, + in_data: typing.Union[None, int, float, str, bool, dict, list], + prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] + ) -> typing.Dict[str, str]: + if prefix_separator_iterator is None: + prefix_separator_iterator = cls.get_prefix_separator_iterator() + value = cls._serialize_form( + in_data, + name=cls.name, + explode=cls.explode, + percent_encode=True, + prefix_separator_iterator=prefix_separator_iterator + ) + return cls._to_dict(cls.name, value) + + @classmethod + def get_prefix_separator_iterator(cls) -> typing.Optional[PrefixSeparatorIterator]: + if cls.style is ParameterStyle.FORM: + return PrefixSeparatorIterator('?', '&') + elif cls.style is ParameterStyle.SPACE_DELIMITED: + return PrefixSeparatorIterator('', '%20') + elif cls.style is ParameterStyle.PIPE_DELIMITED: + return PrefixSeparatorIterator('', '|') + + @classmethod + def serialize( + cls, + in_data: typing.Union[ + schemas.Schema, decimal.Decimal, int, float, str, datetime.date, datetime.datetime, None, bool, list, tuple, dict, frozendict.frozendict], + prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] = None + ) -> typing.Dict[str, str]: + if cls.schema: + cast_in_data = cls.schema(in_data) + cast_in_data = cls._json_encoder.default(cast_in_data) + """ + form -> query + query: + - GET/HEAD/DELETE: could use fields + - PUT/POST: must use urlencode to send parameters + returns fields: tuple + spaceDelimited -> query + returns fields + pipeDelimited -> query + returns fields + deepObject -> query, https://github.com/OAI/OpenAPI-Specification/issues/1706 + returns fields + """ + if cls.style: + # TODO update query ones to omit setting values when [] {} or None is input + if cls.style is ParameterStyle.FORM: + return cls.__serialize_form(cast_in_data, prefix_separator_iterator) + elif cls.style is ParameterStyle.SPACE_DELIMITED: + return cls.__serialize_space_delimited(cast_in_data, prefix_separator_iterator) + elif cls.style is ParameterStyle.PIPE_DELIMITED: + return cls.__serialize_pipe_delimited(cast_in_data, prefix_separator_iterator) + # cls.content will be length one + if prefix_separator_iterator is None: + prefix_separator_iterator = cls.get_prefix_separator_iterator() + for content_type, media_type in cls.content.items(): + cast_in_data = media_type.schema(in_data) + cast_in_data = cls._json_encoder.default(cast_in_data) + if cls._content_type_is_json(content_type): + value = cls._serialize_json(cast_in_data, eliminate_whitespace=True) + return cls._to_dict( + cls.name, + next(prefix_separator_iterator) + cls.name + '=' + parse.quote(value) + ) + raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) + + +class CookieParameter(ParameterBase, StyleFormSerializer): + name: str + required: bool = False + style: ParameterStyle = ParameterStyle.FORM + in_type: ParameterInType = ParameterInType.COOKIE + explode: typing.Optional[bool] = None + allow_reserved: typing.Optional[bool] = None + schema: typing.Optional[typing.Type[schemas.Schema]] = None + content: typing.Optional[typing.Dict[str, typing.Type[schemas.Schema]]] = None + + @classmethod + def serialize( + cls, + in_data: typing.Union[ + schemas.Schema, decimal.Decimal, int, float, str, datetime.date, datetime.datetime, None, bool, list, tuple, dict, frozendict.frozendict] + ) -> typing.Dict[str, str]: + if cls.schema: + cast_in_data = cls.schema(in_data) + cast_in_data = cls._json_encoder.default(cast_in_data) + """ + form -> cookie + returns fields: tuple + """ + if cls.style: + """ + TODO add escaping of comma, space, equals + or turn encoding on + """ + value = cls._serialize_form( + cast_in_data, + explode=cls.explode, + name=cls.name, + percent_encode=False, + prefix_separator_iterator=PrefixSeparatorIterator('', '&') + ) + return cls._to_dict(cls.name, value) + # cls.content will be length one + for content_type, media_type in cls.content.items(): + cast_in_data = media_type.schema(in_data) + cast_in_data = cls._json_encoder.default(cast_in_data) + if cls._content_type_is_json(content_type): + value = cls._serialize_json(cast_in_data) + return cls._to_dict(cls.name, value) + raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) + + +class HeaderParameterWithoutName(ParameterBase, StyleSimpleSerializer): + required: bool = False + style: ParameterStyle = ParameterStyle.SIMPLE + in_type: ParameterInType = ParameterInType.HEADER + explode: bool = False + allow_reserved: typing.Optional[bool] = None + schema: typing.Optional[typing.Type[schemas.Schema]] = None + content: typing.Optional[typing.Dict[str, typing.Type[schemas.Schema]]] = None + + @staticmethod + def __to_headers(in_data: typing.Tuple[typing.Tuple[str, str], ...]) -> _collections.HTTPHeaderDict: + data = tuple(t for t in in_data if t) + headers = _collections.HTTPHeaderDict() + if not data: + return headers + headers.extend(data) + return headers + + @classmethod + def serialize( + cls, + in_data: typing.Union[ + schemas.Schema, decimal.Decimal, int, float, str, datetime.date, datetime.datetime, None, bool, list, tuple, dict, frozendict.frozendict], + name: str + ) -> _collections.HTTPHeaderDict: + if cls.schema: + cast_in_data = cls.schema(in_data) + cast_in_data = cls._json_encoder.default(cast_in_data) + """ + simple -> header + headers: PoolManager needs a mapping, tuple is close + returns headers: dict + """ + if cls.style: + value = cls._serialize_simple(cast_in_data, name, cls.explode, False) + return cls.__to_headers(((name, value),)) + # cls.content will be length one + for content_type, media_type in cls.content.items(): + cast_in_data = media_type.schema(in_data) + cast_in_data = cls._json_encoder.default(cast_in_data) + if cls._content_type_is_json(content_type): + value = cls._serialize_json(cast_in_data) + return cls.__to_headers(((name, value),)) + raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) + + @classmethod + def deserialize( + cls, + in_data: str, + name: str + ) -> schemas.Schema: + if cls.schema: + """ + simple -> header + headers: PoolManager needs a mapping, tuple is close + returns headers: dict + """ + if cls.style: + extracted_data = cls._deserialize_simple(in_data, name, cls.explode, False) + return cls.schema.from_openapi_data_(extracted_data) + # cls.content will be length one + for content_type, media_type in cls.content.items(): + if cls._content_type_is_json(content_type): + cast_in_data = json.loads(in_data) + return media_type.schema.from_openapi_data_(cast_in_data) + raise NotImplementedError('Deserialization of {} has not yet been implemented'.format(content_type)) + + +class HeaderParameter(HeaderParameterWithoutName): + name: str + + @classmethod + def serialize( + cls, + in_data: typing.Union[ + schemas.Schema, decimal.Decimal, int, float, str, datetime.date, datetime.datetime, None, bool, list, tuple, dict, frozendict.frozendict] + ) -> _collections.HTTPHeaderDict: + return super().serialize( + in_data, + cls.name + ) + + +@dataclasses.dataclass +class ApiResponse: + response: urllib3.HTTPResponse + body: typing.Union[schemas.Unset, schemas.Schema] = schemas.unset + headers: typing.Union[schemas.Unset, typing.Dict[str, schemas.Schema]] = schemas.unset + + def __init__( + self, + response: urllib3.HTTPResponse, + body: typing.Union[schemas.Unset, schemas.Schema] = schemas.unset, + headers: typing.Union[schemas.Unset, typing.Dict[str, schemas.Schema]] = schemas.unset + ): + """ + pycharm needs this to prevent 'Unexpected argument' warnings + """ + self.response = response + self.body = body + self.headers = headers + + +@dataclasses.dataclass +class ApiResponseWithoutDeserialization(ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[schemas.Unset, schemas.Schema] = schemas.unset + headers: typing.Union[schemas.Unset, typing.Dict[str, schemas.Schema]] = schemas.unset + + +class TypedDictInputVerifier: + @staticmethod + def _verify_typed_dict_inputs(cls: typing.Type[typing_extensions.TypedDict], data: typing.Dict[str, typing.Any]): + """ + Ensures that: + - required keys are present + - additional properties are not input + - value stored under required keys do not have the value schemas.unset + Note: detailed value checking is done in schema classes + """ + missing_required_keys = [] + required_keys_with_unset_values = [] + for required_key in cls.__required_keys__: + if required_key not in data: + missing_required_keys.append(required_key) + continue + value = data[required_key] + if value is schemas.unset: + required_keys_with_unset_values.append(required_key) + if missing_required_keys: + raise exceptions.ApiTypeError( + '{} missing {} required arguments: {}'.format( + cls.__name__, len(missing_required_keys), missing_required_keys + ) + ) + if required_keys_with_unset_values: + raise exceptions.ApiValueError( + '{} contains invalid unset values for {} required keys: {}'.format( + cls.__name__, len(required_keys_with_unset_values), required_keys_with_unset_values + ) + ) + + disallowed_additional_keys = [] + for key in data: + if key in cls.__required_keys__ or key in cls.__optional_keys__: + continue + disallowed_additional_keys.append(key) + if disallowed_additional_keys: + raise exceptions.ApiTypeError( + '{} got {} unexpected keyword arguments: {}'.format( + cls.__name__, len(disallowed_additional_keys), disallowed_additional_keys + ) + ) + + +T = typing.TypeVar("T") + + +@dataclasses.dataclass +class OpenApiResponse(JSONDetector, TypedDictInputVerifier, typing.Generic[T]): + __filename_content_disposition_pattern = re.compile('filename="(.+?)"') + response_cls: typing.Type[T] + content: typing.Optional[typing.Dict[str, MediaType]] = None + headers: typing.Optional[typing.Dict[str, HeaderParameterWithoutName]] = None + + @staticmethod + def __deserialize_json(response: urllib3.HTTPResponse) -> typing.Any: + # python must be >= 3.9 so we can pass in bytes into json.loads + return json.loads(response.data) + + @staticmethod + def __file_name_from_response_url(response_url: typing.Optional[str]) -> typing.Optional[str]: + if response_url is None: + return None + url_path = parse.urlparse(response_url).path + if url_path: + path_basename = os.path.basename(url_path) + if path_basename: + _filename, ext = os.path.splitext(path_basename) + if ext: + return path_basename + return None + + @classmethod + def __file_name_from_content_disposition(cls, content_disposition: typing.Optional[str]) -> typing.Optional[str]: + if content_disposition is None: + return None + match = cls.__filename_content_disposition_pattern.search(content_disposition) + if not match: + return None + return match.group(1) + + @classmethod + def __deserialize_application_octet_stream( + cls, response: urllib3.HTTPResponse + ) -> typing.Union[bytes, io.BufferedReader]: + """ + urllib3 use cases: + 1. when preload_content=True (stream=False) then supports_chunked_reads is False and bytes are returned + 2. when preload_content=False (stream=True) then supports_chunked_reads is True and + a file will be written and returned + """ + if response.supports_chunked_reads(): + file_name = ( + cls.__file_name_from_content_disposition(response.headers.get('content-disposition')) + or cls.__file_name_from_response_url(response.geturl()) + ) + + if file_name is None: + _fd, path = tempfile.mkstemp() + else: + path = os.path.join(tempfile.gettempdir(), file_name) + + with open(path, 'wb') as new_file: + chunk_size = 1024 + while True: + data = response.read(chunk_size) + if not data: + break + new_file.write(data) + # release_conn is needed for streaming connections only + response.release_conn() + new_file = open(path, 'rb') + return new_file + else: + return response.data + + @staticmethod + def __deserialize_multipart_form_data( + response: urllib3.HTTPResponse + ) -> typing.Dict[str, typing.Any]: + msg = email.message_from_bytes(response.data) + return { + part.get_param("name", header="Content-Disposition"): part.get_payload( + decode=True + ).decode(part.get_content_charset()) + if part.get_content_charset() + else part.get_payload() + for part in msg.get_payload() + } + + @classmethod + def deserialize(cls, response: urllib3.HTTPResponse, configuration: schema_configuration.SchemaConfiguration) -> T: + content_type = response.headers.get('content-type') + deserialized_body = schemas.unset + streamed = response.supports_chunked_reads() + + deserialized_headers = schemas.unset + if cls.headers is not None: + cls._verify_typed_dict_inputs(cls.response_cls.headers, response.headers) + deserialized_headers = {} + for header_name, header_param in cls.headers.items(): + header_value = response.headers.get(header_name) + if header_value is None: + continue + header_value = header_param.deserialize(header_value, header_name) + deserialized_headers[header_name] = header_value + + if cls.content is not None: + if content_type not in cls.content: + raise exceptions.ApiValueError( + f"Invalid content_type returned. Content_type='{content_type}' was returned " + f"when only {str(set(cls.content))} are defined for status_code={str(response.status)}" + ) + body_schema = cls.content[content_type].schema + if body_schema is None: + # some specs do not define response content media type schemas + return cls.response_cls( + response=response, + headers=deserialized_headers, + body=schemas.unset + ) + + if cls._content_type_is_json(content_type): + body_data = cls.__deserialize_json(response) + elif content_type == 'application/octet-stream': + body_data = cls.__deserialize_application_octet_stream(response) + elif content_type.startswith('multipart/form-data'): + body_data = cls.__deserialize_multipart_form_data(response) + content_type = 'multipart/form-data' + else: + raise NotImplementedError('Deserialization of {} has not yet been implemented'.format(content_type)) + deserialized_body = body_schema.from_openapi_data_( + body_data, configuration_=configuration) + elif streamed: + response.release_conn() + + return cls.response_cls( + response=response, + headers=deserialized_headers, + body=deserialized_body + ) + + +class ApiClient: + """Generic API client for OpenAPI client library builds. + + OpenAPI generic API client. This client handles the client- + server communication, and is invariant across implementations. Specifics of + the methods and models for each application are generated from the OpenAPI + templates. + + NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + Do not edit the class manually. + + :param configuration: api_configuration.ApiConfiguration object for this client + :param schema_configuration: schema_configuration.SchemaConfiguration object for this client + :param header_name: a header to pass when making calls to the API. + :param header_value: a header value to pass when making calls to + the API. + :param cookie: a cookie to include in the header when making calls + to the API + :param pool_threads: The number of threads to use for async requests + to the API. More threads means more concurrent API requests. + """ + + _pool = None + + def __init__( + self, + configuration: typing.Optional[api_configuration.ApiConfiguration] = None, + schema_config: typing.Optional[schema_configuration.SchemaConfiguration] = None, + header_name: typing.Optional[str] = None, + header_value: typing.Optional[str] = None, + cookie: typing.Optional[str] = None, + pool_threads: int = 1 + ): + self.configuration: api_configuration.ApiConfiguration = configuration or api_configuration.ApiConfiguration() + self.schema_configuration: schema_configuration.SchemaConfiguration = schema_config or schema_configuration.SchemaConfiguration() + self.pool_threads = pool_threads + self.rest_client = rest.RESTClientObject(self.configuration) + self.default_headers = _collections.HTTPHeaderDict() + if header_name is not None: + self.default_headers[header_name] = header_value + self.cookie = cookie + # Set default User-Agent. + self.user_agent = '{{#if httpUserAgent}}{{{httpUserAgent}}}{{/if}}{{#unless httpUserAgent}}OpenAPI-JSON-Schema-Generator/{{{packageVersion}}}/python{{/unless}}' + + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_value, traceback): + self.close() + + def close(self): + if self._pool: + self._pool.close() + self._pool.join() + self._pool = None + if hasattr(atexit, 'unregister'): + atexit.unregister(self.close) + + @property + def pool(self): + """Create thread pool on first request + avoids instantiating unused threadpool for blocking clients. + """ + if self._pool is None: + atexit.register(self.close) + self._pool = pool.ThreadPool(self.pool_threads) + return self._pool + + @property + def user_agent(self): + """User agent for this API client""" + return self.default_headers['User-Agent'] + + @user_agent.setter + def user_agent(self, value): + self.default_headers['User-Agent'] = value + + def set_default_header(self, header_name, header_value): + self.default_headers[header_name] = header_value + + {{#if tornado}} + @tornado.gen.coroutine + {{/if}} + {{#if asyncio}}async {{/if}}def __call_api( + self, + resource_path: str, + method: str, + host: str, + headers: typing.Optional[_collections.HTTPHeaderDict] = None, + body: typing.Optional[typing.Union[str, bytes]] = None, + fields: typing.Optional[typing.Tuple[typing.Tuple[str, str], ...]] = None, + security_requirement_object: typing.Optional[security_schemes.SecurityRequirementObject] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> urllib3.HTTPResponse: + + # header parameters + used_headers = _collections.HTTPHeaderDict(self.default_headers) + if self.cookie: + headers['Cookie'] = self.cookie + + # auth setting + self.update_params_for_auth( + used_headers, + security_requirement_object, + resource_path, + method, + body + ) + + # must happen after cookie setting and auth setting in case user is overriding those + if headers: + used_headers.update(headers) + + # request url + url = host + resource_path + + # perform request and return response + response = {{#if asyncio}}await {{/if}}{{#if tornado}}yield {{/if}}self.request( + method, + url, + headers=used_headers, + fields=fields, + body=body, + stream=stream, + timeout=timeout, + ) + return response + + def call_api( + self, + resource_path: str, + method: str, + host: str, + headers: typing.Optional[_collections.HTTPHeaderDict] = None, + body: typing.Optional[typing.Union[str, bytes]] = None, + fields: typing.Optional[typing.Tuple[typing.Tuple[str, str], ...]] = None, + security_requirement_object: typing.Optional[security_schemes.SecurityRequirementObject] = None, + async_req: typing.Optional[bool] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> urllib3.HTTPResponse: + """Makes the HTTP request (synchronous) and returns deserialized data. + + To make an async_req request, set the async_req parameter. + + :param resource_path: Path to method endpoint. + :param method: Method to call. + :param headers: Header parameters to be + placed in the request header. + :param body: Request body. + :param fields: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data` + :param security_requirement_object: The security requirement object, used to apply auth when making the call + :param async_req: execute request asynchronously + :type async_req: bool, optional TODO remove, unused + :param stream: if True, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Also when True, if the openapi spec describes a file download, + the data will be written to a local filesystem file and the schemas.BinarySchema + instance will also inherit from FileSchema and schemas.FileIO + Default is False. + :type stream: bool, optional + :param timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param host: api endpoint host + :return: + If async_req parameter is True, + the request will be called asynchronously. + The method will return the request thread. + If parameter async_req is False or missing, + then the method will return the response directly. + """ + + if not async_req: + return self.__call_api( + resource_path, + method, + host, + headers, + body, + fields, + security_requirement_object, + stream, + timeout, + ) + + return self.pool.apply_async( + self.__call_api, + ( + resource_path, + method, + host, + headers, + body, + json, + fields, + security_requirement_object, + stream, + timeout, + ) + ) + + def request( + self, + method: str, + url: str, + headers: typing.Optional[_collections.HTTPHeaderDict] = None, + fields: typing.Optional[typing.Tuple[typing.Tuple[str, str], ...]] = None, + body: typing.Optional[typing.Union[str, bytes]] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> urllib3.HTTPResponse: + """Makes the HTTP request using RESTClient.""" + if method == "get": + return self.rest_client.get(url, + stream=stream, + timeout=timeout, + headers=headers) + elif method == "head": + return self.rest_client.head(url, + stream=stream, + timeout=timeout, + headers=headers) + elif method == "options": + return self.rest_client.options(url, + headers=headers, + fields=fields, + stream=stream, + timeout=timeout, + body=body) + elif method == "post": + return self.rest_client.post(url, + headers=headers, + fields=fields, + stream=stream, + timeout=timeout, + body=body) + elif method == "put": + return self.rest_client.put(url, + headers=headers, + fields=fields, + stream=stream, + timeout=timeout, + body=body) + elif method == "patch": + return self.rest_client.patch(url, + headers=headers, + fields=fields, + stream=stream, + timeout=timeout, + body=body) + elif method == "delete": + return self.rest_client.delete(url, + headers=headers, + stream=stream, + timeout=timeout, + body=body) + else: + raise exceptions.ApiValueError( + "http method must be `GET`, `HEAD`, `OPTIONS`," + " `POST`, `PATCH`, `PUT` or `DELETE`." + ) + + def update_params_for_auth( + self, + headers: _collections.HTTPHeaderDict, + security_requirement_object: typing.Optional[security_schemes.SecurityRequirementObject], + resource_path: str, + method: str, + body: typing.Optional[typing.Union[str, bytes]] = None + ): + """Updates header and query params based on authentication setting. + + :param headers: Header parameters dict to be updated. + :param security_requirement_object: the openapi security requirement object + :param resource_path: A string representation of the HTTP request resource path. + :param method: A string representation of the HTTP request method. + :param body: A object representing the body of the HTTP request. + The object type is the return value of _encoder.default(). + """ + if not security_requirement_object: + # optional auth cause, use no auth + return + for security_scheme_component_name, scope_names in security_requirement_object.items(): + security_scheme_instance = self.configuration.security_scheme_info[security_scheme_component_name] + security_scheme_instance.apply_auth( + headers, + resource_path, + method, + body, + scope_names + ) + + +class Api(TypedDictInputVerifier): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + def __init__(self, api_client: typing.Optional[ApiClient] = None): + self.api_client: ApiClient = api_client or ApiClient() + + +class SerializedRequestBody(typing_extensions.TypedDict, total=False): + body: typing.Union[str, bytes] + fields: typing.Tuple[typing.Union[RequestField, typing.Tuple[str, str]], ...] + + +class RequestBody(StyleFormSerializer, JSONDetector): + """ + A request body parameter + content: content_type to MediaType schemas.Schema info + """ + __json_encoder = JSONEncoder() + content: typing.Dict[str, MediaType] + required: bool = False + + @classmethod + def __serialize_json( + cls, + in_data: typing.Any + ) -> typing.Dict[str, bytes]: + in_data = cls.__json_encoder.default(in_data) + json_str = json.dumps(in_data, separators=(",", ":"), ensure_ascii=False).encode( + "utf-8" + ) + return dict(body=json_str) + + @staticmethod + def __serialize_text_plain(in_data: typing.Any) -> typing.Dict[str, str]: + if isinstance(in_data, frozendict.frozendict): + raise ValueError('Unable to serialize type frozendict.frozendict to text/plain') + elif isinstance(in_data, tuple): + raise ValueError('Unable to serialize type tuple to text/plain') + elif isinstance(in_data, schemas.NoneClass): + raise ValueError('Unable to serialize type NoneClass to text/plain') + elif isinstance(in_data, schemas.BoolClass): + raise ValueError('Unable to serialize type BoolClass to text/plain') + return dict(body=str(in_data)) + + @classmethod + def __multipart_json_item(cls, key: str, value: schemas.Schema) -> RequestField: + json_value = cls.__json_encoder.default(value) + request_field = RequestField(name=key, data=json.dumps(json_value)) + request_field.make_multipart(content_type='application/json') + return request_field + + @classmethod + def __multipart_form_item(cls, key: str, value: schemas.Schema) -> RequestField: + if isinstance(value, str): + request_field = RequestField(name=key, data=str(value)) + request_field.make_multipart(content_type='text/plain') + elif isinstance(value, bytes): + request_field = RequestField(name=key, data=value) + request_field.make_multipart(content_type='application/octet-stream') + elif isinstance(value, schemas.FileIO): + # TODO use content.encoding to limit allowed content types if they are present + request_field = RequestField.from_tuples(key, (os.path.basename(value.name), value.read())) + value.close() + else: + request_field = cls.__multipart_json_item(key=key, value=value) + return request_field + + @classmethod + def __serialize_multipart_form_data( + cls, in_data: schemas.Schema + ) -> typing.Dict[str, typing.Tuple[RequestField, ...]]: + if not isinstance(in_data, frozendict.frozendict): + raise ValueError(f'Unable to serialize {in_data} to multipart/form-data because it is not a dict of data') + """ + In a multipart/form-data request body, each schema property, or each element of a schema array property, + takes a section in the payload with an internal header as defined by RFC7578. The serialization strategy + for each property of a multipart/form-data request body can be specified in an associated Encoding Object. + + When passing in multipart types, boundaries MAY be used to separate sections of the content being + transferred – thus, the following default Content-Types are defined for multipart: + + If the (object) property is a primitive, or an array of primitive values, the default Content-Type is text/plain + If the property is complex, or an array of complex values, the default Content-Type is application/json + Question: how is the array of primitives encoded? + If the property is a type: string with a contentEncoding, the default Content-Type is application/octet-stream + """ + fields = [] + for key, value in in_data.items(): + if isinstance(value, tuple): + if value: + # values use explode = True, so the code makes a RequestField for each item with name=key + for item in value: + request_field = cls.__multipart_form_item(key=key, value=item) + fields.append(request_field) + else: + # send an empty array as json because exploding will not send it + request_field = cls.__multipart_json_item(key=key, value=value) + fields.append(request_field) + else: + request_field = cls.__multipart_form_item(key=key, value=value) + fields.append(request_field) + + return dict(fields=tuple(fields)) + + @staticmethod + def __serialize_application_octet_stream(in_data: schemas.BinarySchema) -> typing.Dict[str, bytes]: + if isinstance(in_data, bytes): + return dict(body=in_data) + # schemas.FileIO type + result = dict(body=in_data.read()) + in_data.close() + return result + + @classmethod + def __serialize_application_x_www_form_data( + cls, in_data: typing.Any + ) -> SerializedRequestBody: + """ + POST submission of form data in body + """ + if not isinstance(in_data, frozendict.frozendict): + raise ValueError( + f'Unable to serialize {in_data} to application/x-www-form-urlencoded because it is not a dict of data') + cast_in_data = cls.__json_encoder.default(in_data) + value = cls._serialize_form(cast_in_data, name='', explode=True, percent_encode=True) + return dict(body=value) + + @classmethod + def serialize( + cls, in_data: typing.Any, content_type: str + ) -> SerializedRequestBody: + """ + If a str is returned then the result will be assigned to data when making the request + If a tuple is returned then the result will be used as fields input in encode_multipart_formdata + Return a tuple of + + The key of the return dict is + - body for application/json + - encode_multipart and fields for multipart/form-data + """ + media_type = cls.content[content_type] + if isinstance(in_data, media_type.schema): + cast_in_data = in_data + elif isinstance(in_data, (dict, frozendict.frozendict)) and in_data: + cast_in_data = media_type.schema(**in_data) + else: + cast_in_data = media_type.schema(in_data) + # TODO check for and use encoding if it exists + # and content_type is multipart or application/x-www-form-urlencoded + if cls._content_type_is_json(content_type): + return cls.__serialize_json(cast_in_data) + elif content_type == 'text/plain': + return cls.__serialize_text_plain(cast_in_data) + elif content_type == 'multipart/form-data': + return cls.__serialize_multipart_form_data(cast_in_data) + elif content_type == 'application/x-www-form-urlencoded': + return cls.__serialize_application_x_www_form_data(cast_in_data) + elif content_type == 'application/octet-stream': + return cls.__serialize_application_octet_stream(cast_in_data) + raise NotImplementedError('Serialization has not yet been implemented for {}'.format(content_type)) diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/api_doc.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/api_doc.handlebars deleted file mode 100644 index 1c279b5a374..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/api_doc.handlebars +++ /dev/null @@ -1,211 +0,0 @@ - -# {{packageName}}.{{apiPackage}}.tags.{{classFilename}}.{{classname}}{{#if description}} -{{description}}{{/if}} - -All URIs are relative to *{{basePath}}* - -Method | HTTP request | Description -------------- | ------------- | ------------- -{{#with operations}}{{#each operation}}[**{{operationId}}**](#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#if summary}}{{summary}}{{/if}} -{{/each}}{{/with}} - -{{#with operations}} -{{#each operation}} -# **{{{operationId}}}** - -> {{#if returnType}}{{{returnType}}} {{/if}}{{{operationId}}}({{#each requiredParams}}{{#unless defaultValue}}{{paramName}}{{#if hasMore}}, {{/if}}{{/unless}}{{/each}}) - -{{#if summary}}{{{summary}}}{{/if}}{{#if notes}} - -{{{notes}}}{{/if}} - -### Example - -{{#if hasAuthMethods}} -{{#each authMethods}} -{{#if isBasic}} -{{#if isBasicBasic}} -* Basic Authentication ({{name}}): -{{/if}} -{{#if isBasicBearer}} -* Bearer{{#if bearerFormat}} ({{{bearerFormat}}}){{/if}} Authentication ({{name}}): -{{/if}} -{{/if}} -{{#if isApiKey}} -* Api Key Authentication ({{name}}): -{{/if}} -{{#if isOAuth}} -* OAuth Authentication ({{name}}): -{{/if}} -{{/each}} -{{/if}} -{{> api_doc_example }} -### Parameters -{{#if allParams}} - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - {{#with bodyParam}} -{{baseName}} | typing.Union[{{#each content}}{{#unless @first}}, {{/unless}}{{this.schema.baseName}}{{/each}}{{#unless required}}, Unset]{{else}}]{{/unless}} | {{#if required}}required{{else}}optional, default is unset{{/if}} | - {{/with}} - {{#if queryParams}} -query_params | RequestQueryParams | | - {{/if}} - {{#if headerParams}} -header_params | RequestHeaderParams | | - {{/if}} - {{#if pathParams}} -path_params | RequestPathParams | | - {{/if}} - {{#if cookieParams}} -cookie_params | RequestCookieParams | | - {{/if}} - {{#with bodyParam}} - {{#each content}} - {{#if @first}} -content_type | str | optional, default is '{{@key}}' | Selects the schema and serialization of the request body - {{/if}} - {{/each}} - {{/with}} - {{#if produces}} -accept_content_types | typing.Tuple[str] | default is ({{#each produces}}'{{this.mediaType}}', {{/each}}) | Tells the server the content type(s) that are accepted by the client - {{/if}} - {{#if servers}} -host_index | typing.Optional[int] | default is None | Allows one to select a different host - {{/if}} -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - {{#with bodyParam}} - -### body - {{#each content}} - {{#with this.schema}} -{{> api_doc_schema_type_hint complexTypePrefix="../../models/" }} - {{/with}} - {{/each}} - {{/with}} - {{#if queryParams}} - -### query_params -#### RequestQueryParams - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - {{#each queryParams}} -{{baseName}} | {{#with schema}}{{baseName}}{{/with}} | | {{#unless required}}optional{{/unless}} - {{/each}} - - {{#each queryParams}} - {{#with schema}} -{{> api_doc_schema_type_hint complexTypePrefix="../../models/" }} - {{/with}} - {{/each}} - {{/if}} - {{#if headerParams}} - -### header_params -#### RequestHeaderParams - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - {{#each headerParams}} -{{baseName}} | {{#with schema}}{{baseName}}{{/with}} | | {{#unless required}}optional{{/unless}} - {{/each}} - {{#each headerParams}} - {{#with schema}} -{{> api_doc_schema_type_hint complexTypePrefix="../../models/" }} - {{/with}} - {{/each}} - {{/if}} - {{#if pathParams}} - -### path_params -#### RequestPathParams - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - {{#each pathParams}} -{{baseName}} | {{#with schema}}{{baseName}}{{/with}} | | {{#unless required}}optional{{/unless}} - {{/each}} - {{#each pathParams}} - {{#with schema}} -{{> api_doc_schema_type_hint complexTypePrefix="../../models/" }} - {{/with}} - {{/each}} - {{/if}} - {{#if cookieParams}} - -### cookie_params -#### RequestCookieParams - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - {{#each cookieParams}} -{{baseName}} | {{#with schema}}{{baseName}}{{/with}} | | {{#unless required}}optional{{/unless}} - {{/each}} - {{#each cookieParams}} - {{#with schema}} -{{> api_doc_schema_type_hint complexTypePrefix="../../models/" }} - {{/with}} - {{/each}} - {{/if}} -{{else}} -This endpoint does not need any parameter. -{{/if}} - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -{{#each responses}} -{{#if isDefault}} -default | [ApiResponseForDefault](#{{operationId}}.ApiResponseForDefault) | {{message}} -{{else}} -{{code}} | [ApiResponseFor{{code}}](#{{operationId}}.ApiResponseFor{{code}}) | {{message}} -{{/if}} -{{/each}} -{{#each responses}} -{{#if isDefault}} - -#### {{operationId}}.ApiResponseForDefault -{{else}} - -#### {{operationId}}.ApiResponseFor{{code}} -{{/if}} -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | {{#unless content}}Unset{{else}}typing.Union[{{#each content}}{{#if this.schema}}{{this.schema.baseName}}{{else}}Unset{{/if}}, {{/each}}]{{/unless}} | {{#unless content}}body was not defined{{/unless}} | -headers | {{#unless responseHeaders}}Unset{{else}}ResponseHeadersFor{{code}}{{/unless}} | {{#unless responseHeaders}}headers were not defined{{/unless}} | -{{#each content}} -{{#with this.schema}} -{{> api_doc_schema_type_hint complexTypePrefix="../../models/" }} -{{/with}} -{{/each}} -{{#if responseHeaders}} -#### ResponseHeadersFor{{code}} - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - {{#each responseHeaders}} -{{baseName}} | {{#with schema}}{{baseName}}{{/with}} | | {{#unless required}}optional{{/unless}} - {{/each}} - {{#each responseHeaders}} - {{#with schema}} -{{> api_doc_schema_type_hint complexTypePrefix="../../models/" }} - {{/with}} - {{/each}} - -{{/if}} -{{/each}} - -### Authorization - -{{#unless authMethods}}No authorization required{{/unless}}{{#each authMethods}}[{{{name}}}](../../../README.md#{{{name}}}){{#unless @last}}, {{/unless}}{{/each}} - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -{{/each}} -{{/with}} diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/api_doc_example.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/api_doc_example.handlebars deleted file mode 100644 index 10661156ce6..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/api_doc_example.handlebars +++ /dev/null @@ -1,163 +0,0 @@ -```python -import {{{packageName}}} -from {{packageName}}.{{apiPackage}}.tags import {{classFilename}} -{{#each imports}} -{{{.}}} -{{/each}} -from pprint import pprint -{{> doc_auth_partial}} -# Enter a context with an instance of the API client -with {{{packageName}}}.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = {{classFilename}}.{{{classname}}}(api_client) -{{#if requiredParams}} - - # example passing only required values which don't have defaults set -{{#if pathParams}} - path_params = { - {{#each pathParams}} - {{#if required}} - '{{baseName}}': {{{example}}}, - {{/if}} - {{/each}} - } -{{/if}} -{{#if queryParams}} - query_params = { - {{#each queryParams}} - {{#if required}} - '{{baseName}}': {{{example}}}, - {{/if}} - {{/each}} - } -{{/if}} -{{#if cookieParams}} - cookie_params = { - {{#each cookieParams}} - {{#if required}} - '{{baseName}}': {{{example}}}, - {{/if}} - {{/each}} - } -{{/if}} -{{#if headerParams}} - header_params = { - {{#each headerParams}} - {{#if required}} - '{{baseName}}': {{{example}}}, - {{/if}} - {{/each}} - } -{{/if}} -{{#with bodyParam}} - {{#if required}} - body = {{{example}}} - {{/if}} -{{/with}} - try: -{{#if summary}} - # {{{summary}}} -{{/if}} - api_response = api_instance.{{{operationId}}}( - {{#if pathParams}} - path_params=path_params, - {{/if}} - {{#if queryParams}} - query_params=query_params, - {{/if}} - {{#if headerParams}} - header_params=header_params, - {{/if}} - {{#if cookieParams}} - cookie_params=cookie_params, - {{/if}} - {{#with bodyParam}} - {{#if required}} - body=body, - {{/if}} - {{/with}} - ) -{{#if returnType}} - pprint(api_response) -{{/if}} - except {{{packageName}}}.ApiException as e: - print("Exception when calling {{classname}}->{{operationId}}: %s\n" % e) -{{/if}} -{{#if optionalParams}} - - # example passing only optional values -{{#if pathParams}} - path_params = { - {{#each pathParams}} - '{{baseName}}': {{{example}}}, - {{/each}} - } -{{/if}} -{{#if queryParams}} - query_params = { - {{#each queryParams}} - '{{baseName}}': {{{example}}}, - {{/each}} - } -{{/if}} -{{#if cookieParams}} - cookie_params = { - {{#each cookieParams}} - '{{baseName}}': {{{example}}}, - {{/each}} - } -{{/if}} -{{#if headerParams}} - header_params = { - {{#each headerParams}} - '{{baseName}}': {{{example}}}, - {{/each}} - } -{{/if}} -{{#with bodyParam}} - body = {{{example}}} -{{/with}} - try: -{{#if summary}} - # {{{summary}}} -{{/if}} - api_response = api_instance.{{{operationId}}}( - {{#if pathParams}} - path_params=path_params, - {{/if}} - {{#if queryParams}} - query_params=query_params, - {{/if}} - {{#if headerParams}} - header_params=header_params, - {{/if}} - {{#if cookieParams}} - cookie_params=cookie_params, - {{/if}} - {{#if bodyParam}} - body=body, - {{/if}} - ) -{{#if returnType}} - pprint(api_response) -{{/if}} - except {{{packageName}}}.ApiException as e: - print("Exception when calling {{classname}}->{{operationId}}: %s\n" % e) -{{/if}} -{{#unless requiredParams}} -{{#unless optionalParams}} - - # example, this endpoint has no required or optional parameters - try: -{{#if summary}} - # {{{summary}}} -{{/if}} - api_response = api_instance.{{{operationId}}}() -{{#if returnType}} - pprint(api_response) -{{/if}} - except {{{packageName}}}.ApiException as e: - print("Exception when calling {{classname}}->{{operationId}}: %s\n" % e) -{{/unless}} -{{/unless}} -``` diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/api_doc_schema_type_hint.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/api_doc_schema_type_hint.handlebars deleted file mode 100644 index 27aa7a499b7..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/api_doc_schema_type_hint.handlebars +++ /dev/null @@ -1,10 +0,0 @@ - -# {{baseName}} -{{#if complexType}} -Type | Description | Notes -------------- | ------------- | ------------- -[**{{dataType}}**]({{complexTypePrefix}}{{complexType}}.md) | {{#if description}}{{description}}{{/if}} | {{#if isReadOnly}}[readonly] {{/if}} - -{{else}} -{{> schema_doc complexTypePrefix="{{complexTypePrefix}}" }} -{{/if}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/api_test.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/api_test.handlebars deleted file mode 100644 index 142ec8b435a..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/api_test.handlebars +++ /dev/null @@ -1,143 +0,0 @@ -# coding: utf-8 - -{{>partial_header}} - -import unittest -from unittest.mock import patch - -import urllib3 - -import {{packageName}} -from {{packageName}}.paths.{{operation.nickname}} import {{operation.httpMethod}} # noqa: E501 -from {{packageName}} import configuration, schemas, api_client - -from .. import ApiTestMixin - - -{{#with operation}} -class Test{{operationIdSnakeCase}}(ApiTestMixin, unittest.TestCase): - """ - {{operationIdSnakeCase}} unit test stubs -{{#if summary}} - {{{summary}}} # noqa: E501 -{{/if}} - """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = {{httpMethod}}.ApiFor{{httpMethod}}(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass - -{{#each responses}} - {{#if @first}} - response_status = {{code}} -{{#if content}} -{{#each content}} - -{{#if this.testCases}} -{{#each testCases}} -{{#with this }} - def test_{{@key}}_{{#if valid}}passes{{else}}fails{{/if}}(self): - # {{description}} - accept_content_type = '{{{../@key}}}' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( -{{#with data}} - {{> model_templates/payload_renderer endChar='' }} -{{/with}} - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) -{{#if valid}} - {{> api_test_partial }} - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, {{httpMethod}}.{{schema.baseName}}) - deserialized_response_body = {{httpMethod}}.{{schema.baseName}}.from_openapi_data_oapg( - payload, - _configuration=self._configuration - ) - assert api_response.body == deserialized_response_body -{{else}} - with self.assertRaises(({{packageName}}.ApiValueError, {{packageName}}.ApiTypeError)): - self.api.{{httpMethod}}( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self._configuration.host + '{{{path}}}', - method='{{httpMethod}}'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) -{{/if}} -{{/with}} - -{{/each}} - -{{/if}} -{{/each}} -{{else}} - response_body = '' -{{/if}} -{{/if}} -{{/each}} -{{#if bodyParam}} -{{#with bodyParam}} -{{#if required}} -{{#each content}} -{{#if this.testCases}} - -{{#each testCases}} -{{#with this }} - def test_{{@key}}_{{#if valid}}passes{{else}}fails{{/if}}(self): - content_type = '{{{../@key}}}' - # {{description}} - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( -{{#with data}} - {{> model_templates/payload_renderer endChar='' }} -{{/with}} - ) -{{#if valid}} - body = {{httpMethod}}.{{schema.baseName}}.from_openapi_data_oapg( - payload, - _configuration=self._configuration - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - {{> api_test_partial }} - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) -{{else}} - with self.assertRaises(({{packageName}}.ApiValueError, {{packageName}}.ApiTypeError)): - body = {{httpMethod}}.{{schema.baseName}}.from_openapi_data_oapg( - payload, - _configuration=self._configuration - ) - self.api.{{httpMethod}}(body=body) -{{/if}} -{{/with}} - -{{/each}} - -{{/if}} -{{/each}} -{{/if}} -{{/with}} -{{else}} - {{/if}} - -{{/with}} - -if __name__ == '__main__': - unittest.main() diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/api_test_partial.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/api_test_partial.handlebars deleted file mode 100644 index e129e34d85a..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/api_test_partial.handlebars +++ /dev/null @@ -1,21 +0,0 @@ -api_response = self.api.{{httpMethod}}( -{{#if bodyParam}} - body=body, - content_type=content_type -{{/if}} -{{#if produces}} - accept_content_types=(accept_content_type,) -{{/if}} -) -self.assert_pool_manager_request_called_with( - mock_request, - self._configuration.host + '{{{path}}}', - method='{{httpMethod}}'.upper(), -{{#if bodyParam}} - body=self.json_bytes(payload), - content_type=content_type, -{{/if}} -{{#if produces}} - accept_content_type=accept_content_type, -{{/if}} -) diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/__init__apis.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/apis/__init__.hbs similarity index 100% rename from modules/openapi-json-schema-generator/src/main/resources/python/__init__apis.handlebars rename to modules/openapi-json-schema-generator/src/main/resources/python/apis/__init__.hbs diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/apis/apis_path_to_api.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/apis/apis_path_to_api.hbs new file mode 100644 index 00000000000..c369c2b0a55 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/apis/apis_path_to_api.hbs @@ -0,0 +1,23 @@ +import typing +import typing_extensions + +{{#each paths}} +from {{packageName}}.apis.paths.{{@key.snakeCase}} import {{@key.camelCase}} +{{/each}} + +PathToApi = typing_extensions.TypedDict( + 'PathToApi', + { +{{#each paths}} + "{{{@key.original}}}": typing.Type[{{@key.camelCase}}], +{{/each}} + } +) + +path_to_api = PathToApi( + { +{{#each paths}} + "{{{@key.original}}}": {{@key.camelCase}}, +{{/each}} + } +) diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/apis/apis_tag_to_api.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/apis/apis_tag_to_api.hbs new file mode 100644 index 00000000000..cb3f7c28b6b --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/apis/apis_tag_to_api.hbs @@ -0,0 +1,23 @@ +import typing +import typing_extensions + +{{#each tagToPathToOperations}} +from {{packageName}}.apis.tags.{{@key.moduleName}} import {{@key.className}} +{{/each}} + +TagToApi = typing_extensions.TypedDict( + 'TagToApi', + { +{{#each tagToPathToOperations}} + "{{{@key.name}}}": typing.Type[{{@key.className}}], +{{/each}} + } +) + +tag_to_api = TagToApi( + { +{{#each tagToPathToOperations}} + "{{{@key.name}}}": {{@key.className}}, +{{/each}} + } +) diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/apis/paths/__init__.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/apis/paths/__init__.hbs new file mode 100644 index 00000000000..bfa8c59de7e --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/apis/paths/__init__.hbs @@ -0,0 +1,3 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from {{packageName}}.apis.path_to_api import path_to_api \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/apis/paths/api.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/apis/paths/api.hbs new file mode 100644 index 00000000000..600452f9861 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/apis/paths/api.hbs @@ -0,0 +1,15 @@ +# coding: utf-8 + +{{> _helper_header }} + +{{#each pathItem.operations}} +from {{packageName}}.paths.{{path.snakeCase}}.{{@key.original}}.operation import ApiFor{{@key.camelCase}} +{{/each}} + + +class {{path.camelCase}}( +{{#each pathItem.operations}} + ApiFor{{@key.camelCase}}, +{{/each}} +): + pass diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/apis/tags/__init__.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/apis/tags/__init__.hbs new file mode 100644 index 00000000000..e2f31f6bbe4 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/apis/tags/__init__.hbs @@ -0,0 +1,3 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from {{packageName}}.apis.tag_to_api import tag_to_api \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/apis/tags/api.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/apis/tags/api.hbs new file mode 100644 index 00000000000..2adaa583e6a --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/apis/tags/api.hbs @@ -0,0 +1,24 @@ +# coding: utf-8 + +{{> _helper_header }} + +{{#each pathToOperations}} + {{#each this}} +from {{packageName}}.paths.{{../@key.snakeCase}}.{{jsonPathPiece.original}}.operation import {{operationId.camelCase}} + {{/each}} +{{/each}} + + +class {{tag.className}}( +{{#each pathToOperations}} + {{#each this}} + {{operationId.camelCase}}, + {{/each}} +{{/each}} +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + pass diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/apis/tags/api_doc.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/apis/tags/api_doc.hbs new file mode 100644 index 00000000000..42d4bd1ac53 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/apis/tags/api_doc.hbs @@ -0,0 +1,25 @@ + +{{packageName}}.{{apiPackage}}.tags.{{tag.moduleName}} +{{#with tag}} +# {{className}} + {{#if description}} + +## Description +{{description}} + {{/if}} +{{/with}} + +All URIs are relative to the selected server +- The server is selected by passing in server_info and server_index into api_configuration.ApiConfiguration +- Code samples in endpoints documents show how to do this +- server_index can also be passed in to endpoint calls, see endpoint documentation + +Method | Description +------ | ------------- +{{#each operationIdToPathToOperation}} + {{#each this}} +[**{{../@key.snakeCase}}**](../../paths/{{@key.snakeCase}}/{{jsonPathPiece.original}}.md) | {{#if summary}}{{summary}}{{/if}} + {{/each}} +{{/each}} + +[[Back to top]](#top) {{> _helper_footer_links readmePath="../../../" endpointsLink=true }} diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/apis_path_module.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/apis_path_module.handlebars deleted file mode 100644 index 226894c62b2..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/apis_path_module.handlebars +++ /dev/null @@ -1,52 +0,0 @@ -{{#if pathItem.get}} -from {{packageName}}.paths.{{pathModule}}.get import ApiForget -{{/if}} -{{#if pathItem.put}} -from {{packageName}}.paths.{{pathModule}}.put import ApiForput -{{/if}} -{{#if pathItem.post}} -from {{packageName}}.paths.{{pathModule}}.post import ApiForpost -{{/if}} -{{#if pathItem.delete}} -from {{packageName}}.paths.{{pathModule}}.delete import ApiFordelete -{{/if}} -{{#if pathItem.options}} -from {{packageName}}.paths.{{pathModule}}.options import ApiForoptions -{{/if}} -{{#if pathItem.head}} -from {{packageName}}.paths.{{pathModule}}.head import ApiForhead -{{/if}} -{{#if pathItem.patch}} -from {{packageName}}.paths.{{pathModule}}.patch import ApiForpatch -{{/if}} -{{#if pathItem.trace}} -from {{packageName}}.paths.{{pathModule}}.trace import ApiFortrace -{{/if}} - - -class {{apiClassName}}( -{{#if pathItem.get}} - ApiForget, -{{/if}} -{{#if pathItem.put}} - ApiForput, -{{/if}} -{{#if pathItem.post}} - ApiForpost, -{{/if}} -{{#if pathItem.delete}} - ApiFordelete, -{{/if}} -{{#if pathItem.options}} - ApiForoptions, -{{/if}} -{{#if pathItem.head}} - ApiForhead, -{{/if}} -{{#if pathItem.patch}} - ApiForpatch, -{{/if}} -{{#if pathItem.trace}} - ApiFortrace, -{{/if}}): - pass diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/apis_path_to_api.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/apis_path_to_api.handlebars deleted file mode 100644 index a52df9cf152..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/apis_path_to_api.handlebars +++ /dev/null @@ -1,23 +0,0 @@ -import typing_extensions - -from {{packageName}}.paths import PathValues -{{#each pathModuleToApiClassname}} -from {{packageName}}.apis.paths.{{@key}} import {{this}} -{{/each}} - -PathToApi = typing_extensions.TypedDict( - 'PathToApi', - { -{{#each pathEnumToApiClassname}} - PathValues.{{@key}}: {{this}}, -{{/each}} - } -) - -path_to_api = PathToApi( - { -{{#each pathEnumToApiClassname}} - PathValues.{{@key}}: {{this}}, -{{/each}} - } -) diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/apis_tag_to_api.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/apis_tag_to_api.handlebars deleted file mode 100644 index dacbc478aab..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/apis_tag_to_api.handlebars +++ /dev/null @@ -1,23 +0,0 @@ -import typing_extensions - -from {{packageName}}.apis.tags import TagValues -{{#each tagModuleNameToApiClassname}} -from {{packageName}}.apis.tags.{{@key}} import {{this}} -{{/each}} - -TagToApi = typing_extensions.TypedDict( - 'TagToApi', - { -{{#each tagEnumToApiClassname}} - TagValues.{{@key}}: {{this}}, -{{/each}} - } -) - -tag_to_api = TagToApi( - { -{{#each tagEnumToApiClassname}} - TagValues.{{@key}}: {{this}}, -{{/each}} - } -) diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/comma.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/comma.handlebars deleted file mode 100644 index 41622b47209..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/comma.handlebars +++ /dev/null @@ -1 +0,0 @@ -, \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/components/_helper_anchor_id.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/components/_helper_anchor_id.hbs new file mode 100644 index 00000000000..5c02c98bbd9 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/components/_helper_anchor_id.hbs @@ -0,0 +1 @@ +{{#each identifierPieces}}{{#if this.anchorPiece}}{{this.anchorPiece}}{{else}}{{this}}{{/if}}{{#unless @last}}-{{/unless}}{{/each}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/components/_helper_header_from_identifier_pieces.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/components/_helper_header_from_identifier_pieces.hbs new file mode 100644 index 00000000000..1c650293bf9 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/components/_helper_header_from_identifier_pieces.hbs @@ -0,0 +1 @@ +{{headerSize}} {{#each identifierPieces}}{{#if this.camelCase}}{{this.camelCase}}{{else}}{{this}}{{/if}}{{#unless @last}} {{/unless}}{{/each}} diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/components/_helper_param_or_header_instance.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/components/_helper_param_or_header_instance.hbs new file mode 100644 index 00000000000..6bb162b7141 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/components/_helper_param_or_header_instance.hbs @@ -0,0 +1,63 @@ +class {{jsonPathPiece.camelCase}}(api_client.{{#if noName}}Header{{/if}}{{#eq in "query"}}Query{{/eq}}{{#eq in "path"}}Path{{/eq}}{{#eq in "header"}}Header{{/eq}}{{#eq in "cookie"}}Cookie{{/eq}}Parameter{{#if noName}}WithoutName{{/if}}): +{{#unless noName}} + name = "{{name}}" +{{/unless}} +{{#if style}} +{{#eq style "matrix"}} + style = api_client.ParameterStyle.MATRIX +{{/eq}} +{{#eq style "label"}} + style = api_client.ParameterStyle.LABEL +{{/eq}} +{{#eq style "form"}} + style = api_client.ParameterStyle.FORM +{{/eq}} +{{#eq style "simple"}} + style = api_client.ParameterStyle.SIMPLE +{{/eq}} +{{#eq style "spaceDelimited"}} + style = api_client.ParameterStyle.SPACE_DELIMITED +{{/eq}} +{{#eq style "pipeDelimited"}} + style=api_client.ParameterStyle.PIPE_DELIMITED +{{/eq}} +{{#eq style "deepObject"}} + style=api_client.ParameterStyle.DEEP_OBJECT +{{/eq}} +{{/if}} +{{#if schema}} + {{#with schema}} + schema = {{jsonPathPiece.snakeCase}}.{{jsonPathPiece.camelCase}} + {{/with}} +{{/if}} +{{#if content}} +{{#each content}} + + + class __{{@key.camelCase}}MediaType(api_client.MediaType): + {{#with this}} + {{#with schema}} + schema: typing.Type[{{../@key.snakeCase}}_{{jsonPathPiece.snakeCase}}.{{jsonPathPiece.camelCase}}] = {{../@key.snakeCase}}_{{jsonPathPiece.snakeCase}}.{{jsonPathPiece.camelCase}} + {{/with}} + {{/with}} +{{/each}} + __Content = typing_extensions.TypedDict( + '__Content', + { +{{#each content}} + '{{{@key.original}}}': typing.Type[__{{@key.camelCase}}MediaType], +{{/each}} + } + ) + content: __Content = { +{{#each content}} + '{{{@key.original}}}': __{{@key.camelCase}}MediaType, +{{/each}} + } +{{/if}} +{{#if required}} + required = True +{{/if}} +{{#if explode}} + explode = True +{{/if}} diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/components/_helper_schema_accessed_types.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/components/_helper_schema_accessed_types.hbs new file mode 100644 index 00000000000..44b4607a2a1 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/components/_helper_schema_accessed_types.hbs @@ -0,0 +1 @@ +{{#eq types null}}frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO{{else}}{{#each types}}{{#unless @first}}, {{/unless}}{{#eq this "array"}}tuple{{/eq}}{{#eq this "object"}}frozendict.frozendict{{/eq}}{{#eq this "null"}}NoneClass{{/eq}}{{#eq this "string" }}{{#neq ../format "binary"}}str{{/neq}}{{#eq ../format "binary"}}bytes, io.FileIO{{/eq}}{{/eq}}{{#eq this "integer"}}decimal.Decimal{{/eq}}{{#eq this "number"}}decimal.Decimal{{/eq}}{{#eq this "boolean"}}BoolClass{{/eq}}{{/each}}{{/eq}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/components/headers/header.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/components/headers/header.hbs new file mode 100644 index 00000000000..557ba62da98 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/components/headers/header.hbs @@ -0,0 +1,36 @@ +# coding: utf-8 + +{{> _helper_header }} + +{{#with header}} +{{#if refInfo}} + {{#if imports}} + + {{/if}} +{{> _helper_imports }} +{{jsonPathPiece.camelCase}} = {{refInfo.refModule}}.{{refInfo.refClass}} +{{else}} +import typing +import typing_extensions + +from {{packageName}} import api_client + {{#if schema}} + {{#with schema}} +from . import {{jsonPathPiece.snakeCase}} + {{/with}} + {{else}} + {{#if content}} + {{#each content}} + {{#with this}} + {{#with schema}} +from .content.{{../@key.snakeCase}} import {{jsonPathPiece.snakeCase}} as {{../@key.snakeCase}}_{{jsonPathPiece.snakeCase}} + {{/with}} + {{/with}} + {{/each}} + {{/if}} + {{/if}} + + +{{> components/_helper_param_or_header_instance noName=true }} +{{/if}} +{{/with}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/components/headers/header_doc.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/components/headers/header_doc.hbs new file mode 100644 index 00000000000..b5caebd9527 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/components/headers/header_doc.hbs @@ -0,0 +1,73 @@ +{{#with header}} + {{#if componentModule}} +{{packageName}}.components.headers.{{jsonPathPiece.snakeCase}} + {{/if}} + {{#eq identifierPieces.size 0}} +{{> components/_helper_header_from_identifier_pieces identifierPieces=(append identifierPieces "Header" jsonPathPiece) }} + {{else}} +{{> components/_helper_header_from_identifier_pieces }} + {{/eq}} + {{#if description}} + +{{headerSize}}# Description +{{description}} + {{/if}} + {{#if refInfo}} + {{#with getDeepestRef}} + {{#if schema}} + {{#with schema}} +{{> components/_helper_header_from_identifier_pieces headerSize=(join headerSize "#" "") identifierPieces=(append (newArray ) jsonPathPiece) }} +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[{{../../refInfo.refClass}}.schema](../../components/headers/{{../../refInfo.refModule}}.md#{{> components/_helper_anchor_id identifierPieces=(append (newArray ) jsonPathPiece) }}) | {{> _helper_schema_python_types }} | {{> components/_helper_schema_accessed_types }} | {{#if ../../description}}{{../../description}}{{/if}} + {{/with}} + {{/if}} + {{#each content}} + {{#if @first}} + +{{headerSize}}# Content Type To Schema +Content-Type | Schema +------------ | ------- + {{/if}} +"{{@key.original}}" | [content.{{@key.snakeCase}}.{{this.schema.jsonPathPiece.camelCase}}](#{{> components/_helper_anchor_id identifierPieces=(append identifierPieces "content" @key this.schema.jsonPathPiece) }}) + {{/each}} + {{#each content}} + {{#with this.schema}} +{{> components/_helper_header_from_identifier_pieces headerSize=(join headerSize "#" "") identifierPieces=(append (newArray ) "content" ../@key jsonPathPiece) }} +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[{{../../../refInfo.refClass}}.content.{{../@key.snakeCase}}.schema](../../components/headers/{{../../../refInfo.refModule}}.md#{{> components/_helper_anchor_id identifierPieces=(append (newArray ) "content" ../@key jsonPathPiece) }}) | {{> _helper_schema_python_types }} | {{> components/_helper_schema_accessed_types }} | {{#if ../../../description}}{{../../../description}}{{/if}} + {{/with}} + {{/each}} + {{/with}} + {{else}} + {{#if schema}} + {{#with schema}} + +{{> components/schemas/schema_doc headerSize=(join headerSize "#" "") identifierPieces=(append identifierPieces jsonPathPiece) }} + {{/with}} + {{else}} + {{#each content}} + {{#if @first}} + +{{headerSize}}# Content Type To Schema +Content-Type | Schema +------------ | ------- + {{/if}} +"{{@key.original}}" | [content.{{@key.snakeCase}}.{{this.schema.jsonPathPiece.camelCase}}](#{{> components/_helper_anchor_id identifierPieces=(append identifierPieces "content" @key this.schema.jsonPathPiece) }}) + {{/each}} + {{#each content}} + {{#with this}} + {{#with schema}} + +{{> components/schemas/schema_doc headerSize=(join headerSize "#" "") identifierPieces=(append identifierPieces "content" ../@key jsonPathPiece) }} + {{/with}} + {{/with}} + {{/each}} + {{/if}} + {{/if}} + {{#if componentModule}} + +[[Back to top]](#top) {{> _helper_footer_links readmePath="../../../" headersLink=true }} + {{/if}} +{{/with}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/components/parameters/parameter.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/components/parameters/parameter.hbs new file mode 100644 index 00000000000..ef127b7d39d --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/components/parameters/parameter.hbs @@ -0,0 +1,37 @@ +# coding: utf-8 + +{{> _helper_header }} + +{{#with parameter}} +{{#if refInfo}} + {{#if imports}} + + {{/if}} +{{> _helper_imports }} +{{jsonPathPiece.camelCase}} = {{refInfo.refModule}}.{{refInfo.refClass}} +{{else}} +import typing +import typing_extensions + +from {{packageName}} import api_client + + {{#if schema}} + {{#with schema}} +from . import {{jsonPathPiece.snakeCase}} + {{/with}} + {{else}} + {{#if content}} + {{#each content}} + {{#with this}} + {{#with schema}} +from .content.{{../@key.snakeCase}} import {{jsonPathPiece.snakeCase}} as {{../@key.snakeCase}}_{{jsonPathPiece.snakeCase}} + {{/with}} + {{/with}} + {{/each}} + {{/if}} + {{/if}} + + +{{> components/_helper_param_or_header_instance }} +{{/if}} +{{/with}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/components/parameters/parameter_doc.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/components/parameters/parameter_doc.hbs new file mode 100644 index 00000000000..546f0249080 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/components/parameters/parameter_doc.hbs @@ -0,0 +1,71 @@ +{{#with parameter}} +{{#if componentModule}} +{{../packageName}}.components.parameters.{{jsonPathPiece.snakeCase}} +{{/if}} +{{#eq identifierPieces.size 0}} +{{> components/_helper_header_from_identifier_pieces identifierPieces=(append identifierPieces "Parameter" jsonPathPiece) }} +{{else}} +{{> components/_helper_header_from_identifier_pieces }} +{{/eq}} +{{#if description}} + +{{headerSize}}# Description +{{description}} +{{/if}} +{{#if refInfo}} + {{#with getDeepestRef}} + {{#if schema}} + {{#with schema}} +{{> components/_helper_header_from_identifier_pieces headerSize=(join headerSize "#" "") identifierPieces=(append (newArray ) jsonPathPiece) }} +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[{{../../refInfo.refClass}}.schema](../../components/parameters/{{../../refInfo.refModule}}.md#{{> components/_helper_anchor_id identifierPieces=(append (newArray ) jsonPathPiece) }}) | {{> _helper_schema_python_types }} | {{> components/_helper_schema_accessed_types }} | {{#if ../../description}}{{../../description}}{{/if}} + {{/with}} + {{else}} + {{#each getDeepestRef.content}} + {{#if @first}} + +{{headerSize}}# Content Type To Schema +Content-Type | Schema +------------ | ------- + {{/if}} +"{{@key.original}}" | [content.{{@key.snakeCase}}.{{this.schema.jsonPathPiece.camelCase}}](#{{> components/_helper_anchor_id identifierPieces=(append identifierPieces "content" @key this.schema.jsonPathPiece) }}) + {{/each}} + {{#each getDeepestRef.content}} + {{#with this.schema}} +{{> components/_helper_header_from_identifier_pieces headerSize=(join headerSize "#" "") identifierPieces=(append (newArray ) "content" ../@key jsonPathPiece) }} +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[{{../../../refInfo.refClass}}.content.{{../@key.snakeCase}}.schema](../../components/parameters/{{../../../refInfo.refModule}}.md#{{> components/_helper_anchor_id identifierPieces=(append (newArray ) "content" ../@key jsonPathPiece) }}) | {{> _helper_schema_python_types }} | {{> components/_helper_schema_accessed_types }} | {{#if ../../../description}}{{../../../description}}{{/if}} + {{/with}} + {{/each}} + {{/if}} + {{/with}} +{{else}} + {{#if schema}} + {{#with schema}} + +{{> components/schemas/schema_doc headerSize=(join headerSize "#" "") identifierPieces=(append identifierPieces jsonPathPiece) }} + {{/with}} + {{else}} + {{#each content}} + {{#if @first}} + +{{headerSize}}# Content Type To Schema +Content-Type | Schema +------------ | ------- + {{/if}} +"{{@key.original}}" | [content.{{@key.snakeCase}}.{{this.schema.jsonPathPiece.camelCase}}](#{{> components/_helper_anchor_id identifierPieces=(append identifierPieces "content" @key this.schema.jsonPathPiece) }}) + {{/each}} + {{#each content}} + {{#with this.schema}} +{{> components/schemas/schema_doc headerSize=(join headerSize "#" "") identifierPieces=(append identifierPieces "content" ../@key jsonPathPiece) }} + {{/with}} + {{/each}} + {{/if}} +{{/if}} +{{#if componentModule}} + +[[Back to top]](#top) {{> _helper_footer_links readmePath="../../../" parametersLink=true}} +{{/if}} +{{/with}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/components/request_bodies/request_body.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/components/request_bodies/request_body.hbs new file mode 100644 index 00000000000..74c2cf42a31 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/components/request_bodies/request_body.hbs @@ -0,0 +1,53 @@ +# coding: utf-8 + +{{> _helper_header }} + +{{#with requestBody}} +{{#if refInfo}} + {{#if imports}} + + {{/if}} +{{> _helper_imports }} +{{jsonPathPiece.camelCase}} = {{refInfo.refModule}}.{{refInfo.refClass}} +{{else}} +import typing +import typing_extensions + +from {{packageName}} import api_client + {{#each content}} + {{#with this}} + {{#with schema}} +from .content.{{../@key.snakeCase}} import {{jsonPathPiece.snakeCase}} as {{../@key.snakeCase}}_{{jsonPathPiece.snakeCase}} + {{/with}} + {{/with}} + {{/each}} + +class {{jsonPathPiece.camelCase}}(api_client.RequestBody): + {{#each content}} + + + class __{{@key.camelCase}}MediaType(api_client.MediaType): + {{#with this}} + {{#with schema}} + schema: typing.Type[{{../@key.snakeCase}}_{{jsonPathPiece.snakeCase}}.{{jsonPathPiece.camelCase}}] = {{../@key.snakeCase}}_{{jsonPathPiece.snakeCase}}.{{jsonPathPiece.camelCase}} + {{/with}} + {{/with}} + {{/each}} + __Content = typing_extensions.TypedDict( + '__Content', + { + {{#each content}} + '{{{@key.original}}}': typing.Type[__{{@key.camelCase}}MediaType], + {{/each}} + } + ) + content: __Content = { + {{#each content}} + '{{{@key.original}}}': __{{@key.camelCase}}MediaType, + {{/each}} + } + {{#if required}} + required = True + {{/if}} +{{/if}} +{{/with}} diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/components/request_bodies/request_body_doc.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/components/request_bodies/request_body_doc.hbs new file mode 100644 index 00000000000..a1a91546198 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/components/request_bodies/request_body_doc.hbs @@ -0,0 +1,57 @@ +{{#with requestBody}} +{{#if componentModule}} +{{packageName}}.components.request_bodies.{{jsonPathPiece.snakeCase}} +{{/if}} +{{#eq identifierPieces.size 0}} +{{> components/_helper_header_from_identifier_pieces identifierPieces=(append identifierPieces "RequestBody" jsonPathPiece) }} +{{else}} +{{> components/_helper_header_from_identifier_pieces }} +{{/eq}} +{{#if description}} + +{{headerSize}}# Description +{{description}} +{{/if}} +{{#if refInfo}} + {{#with getDeepestRef}} + {{#each content}} + {{#if @first}} + +{{headerSize}}# Content Type To Schema +Content-Type | Schema +------------ | ------- + {{/if}} +"{{@key.original}}" | [content.{{@key.snakeCase}}.{{this.schema.jsonPathPiece.camelCase}}](#{{> components/_helper_anchor_id identifierPieces=(append identifierPieces "content" @key this.schema.jsonPathPiece) }}) + {{/each}} + + {{#each content}} + {{#with this.schema}} +{{> components/_helper_header_from_identifier_pieces headerSize=(join headerSize "#" "") identifierPieces=(append (newArray ) "content" ../@key jsonPathPiece) }} +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[{{../../../refInfo.refClass}}.content.{{../@key.snakeCase}}.schema](../../components/request_bodies/{{../../../refInfo.refModule}}.md#{{> components/_helper_anchor_id identifierPieces=(append (newArray ) "content" ../@key jsonPathPiece) }}) | {{> _helper_schema_python_types }} | {{> components/_helper_schema_accessed_types }} | {{#if ../../../description}}{{../../../description}}{{/if}} + {{/with}} + {{/each}} + {{/with}} +{{else}} + {{#each content}} + {{#if @first}} + +{{headerSize}}# Content Type To Schema +Content-Type | Schema +------------ | ------- + {{/if}} +"{{@key.original}}" | [content.{{@key.snakeCase}}.{{this.schema.jsonPathPiece.camelCase}}](#{{> components/_helper_anchor_id identifierPieces=(append identifierPieces "content" @key this.schema.jsonPathPiece) }}) + {{/each}} + + {{#each content}} + {{#with this.schema}} +{{> components/schemas/schema_doc headerSize=(join headerSize "#" "") identifierPieces=(append identifierPieces "content" @key jsonPathPiece) }} + {{/with}} + {{/each}} +{{/if}} +{{#if componentModule}} + +[[Back to top]](#top) {{> _helper_footer_links readmePath="../../../" requestBodiesLink=true}} +{{/if}} +{{/with}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/components/responses/_helper_header_optional_oneline.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/components/responses/_helper_header_optional_oneline.hbs new file mode 100644 index 00000000000..b38aa227e95 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/components/responses/_helper_header_optional_oneline.hbs @@ -0,0 +1,27 @@ +{{#if refInfo}} + {{#with getDeepestRef}} + {{#unless required}} + {{#if schema}} + {{#with schema}} + '{{../@key}}': typing.Union[{{../../jsonPathPiece.snakeCase}}.{{../../jsonPathPiece.camelCase}}.{{jsonPathPiece.snakeCase}}, {{> _helper_schema_python_types }}], + {{/with}} + {{else}} + {{#each content}} + '{{../@key}}': {{#with this}}{{#with schema}}typing.Union[{{../../../jsonPathPiece.snakeCase}}.{{../../../jsonPathPiece.camelCase}}.content["{{{../@key.original}}}"].{{jsonPathPiece.snakeCase}}, {{> _helper_schema_python_types }}],{{/with}}{{/with}} + {{/each}} + {{/if}} + {{/unless}} + {{/with}} +{{else}} + {{#unless required}} + {{#if schema}} + {{#with schema}} + '{{../@key}}': typing.Union[{{../jsonPathPiece.snakeCase}}.{{../jsonPathPiece.camelCase}}.{{jsonPathPiece.snakeCase}}, {{> _helper_schema_python_types }}], + {{/with}} + {{else}} + {{#each content}} + '{{../@key}}': {{#with this}}{{#with schema}}typing.Union[{{../jsonPathPiece.snakeCase}}.{{../jsonPathPiece.camelCase}}.content["{{{../@key.original}}}"].{{jsonPathPiece.snakeCase}}, {{> _helper_schema_python_types }}],{{/with}}{{/with}} + {{/each}} + {{/if}} + {{/unless}} +{{/if}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/components/responses/_helper_header_required_oneline.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/components/responses/_helper_header_required_oneline.hbs new file mode 100644 index 00000000000..22105b24659 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/components/responses/_helper_header_required_oneline.hbs @@ -0,0 +1,27 @@ +{{#if refInfo}} + {{#with getDeepestRef}} + {{#if required}} + {{#if schema}} + {{#with schema}} + '{{../@key}}': typing.Union[{{../../jsonPathPiece.snakeCase}}.{{../../jsonPathPiece.camelCase}}.{{jsonPathPiece.snakeCase}}, {{> _helper_schema_python_types }}], + {{/with}} + {{else}} + {{#each content}} + '{{../@key}}': {{#with this}}{{#with schema}}typing.Union[{{../../../jsonPathPiece.snakeCase}}.{{../../../jsonPathPiece.camelCase}}.content["{{{../@key.original}}}"].{{jsonPathPiece.snakeCase}}, {{> _helper_schema_python_types }}],{{/with}}{{/with}} + {{/each}} + {{/if}} + {{/if}} + {{/with}} +{{else}} + {{#if required}} + {{#if schema}} + {{#with schema}} + '{{../@key}}': typing.Union[{{../jsonPathPiece.snakeCase}}.{{../jsonPathPiece.camelCase}}.{{jsonPathPiece.snakeCase}}, {{> _helper_schema_python_types }}], + {{/with}} + {{else}} + {{#each content}} + '{{../@key}}': {{#with this}}{{#with schema}}typing.Union[{{../jsonPathPiece.snakeCase}}.{{../jsonPathPiece.camelCase}}.content["{{{../@key.original}}}"].{{jsonPathPiece.snakeCase}}, {{> _helper_schema_python_types }}],{{/with}}{{/with}} + {{/each}} + {{/if}} + {{/if}} +{{/if}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/components/responses/_helper_header_schema_and_def.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/components/responses/_helper_header_schema_and_def.hbs new file mode 100644 index 00000000000..12083ddb83b --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/components/responses/_helper_header_schema_and_def.hbs @@ -0,0 +1,31 @@ + + +class {{xParamsName}}: + RequiredParams = typing_extensions.TypedDict( + 'RequiredParams', + { +{{#each xParams}} +{{> components/responses/_helper_header_required_oneline }} +{{/each}} + } + ) + OptionalParams = typing_extensions.TypedDict( + 'OptionalParams', + { +{{#each xParams}} +{{> components/responses/_helper_header_optional_oneline }} +{{/each}} + }, + total=False + ) + + + class Params(RequiredParams, OptionalParams): + pass + + + parameters = [ + {{#each xParams}} + {{jsonPathPiece.snakeCase}}.{{jsonPathPiece.camelCase}}, + {{/each}} + ] \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/components/responses/response.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/components/responses/response.hbs new file mode 100644 index 00000000000..c12d3b39516 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/components/responses/response.hbs @@ -0,0 +1,135 @@ +# coding: utf-8 + +{{> _helper_header }} + +{{#with response}} +{{#if refInfo}} + {{#if imports}} + + {{/if}} +{{> _helper_imports }} +{{jsonPathPiece.camelCase}} = {{refInfo.refModule}}.{{refInfo.refClass}} +{{else}} +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from {{packageName}} import api_client +from {{packageName}} import schemas + {{#if content}} + {{#each content}} + {{#with this.schema}} +from .content.{{../@key.snakeCase}} import {{jsonPathPiece.snakeCase}} as {{../@key.snakeCase}}_{{jsonPathPiece.snakeCase}} + {{/with}} + {{/each}} + {{/if}} + {{#each headers}} +from .headers import {{jsonPathPiece.snakeCase}} + {{/each}} + {{#if headers}} +{{> components/responses/_helper_header_schema_and_def xParams=headers xParamsName="Header" }} + {{/if}} + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + {{#and headers content}} + {{#if hasContentSchema}} + {{#gt content.size 1}} + body: typing.Union[ + {{#each content}} + {{#if this.schema}} + {{#with this.schema}} + {{../@key.snakeCase}}_{{jsonPathPiece.snakeCase}}.{{jsonPathPiece.camelCase}}, + {{/with}} + {{else}} + schemas.Unset, + {{/if}} + {{/each}} + ] + {{else}} + body: {{#each content}}{{#if this.schema}}{{#with this.schema}}{{../@key.snakeCase}}_{{jsonPathPiece.snakeCase}}.{{jsonPathPiece.camelCase}}{{/with}}{{else}}schemas.Unset{{/if}}{{/each}} + {{/gt}} + {{else}} + body: schemas.Unset = schemas.unset + {{/if}} + headers: Header.Params + {{else}} + {{#or headers content}} + {{#if headers}} + headers: Header.Params + body: schemas.Unset = schemas.unset + {{else}} + {{#if hasContentSchema}} + {{#gt content.size 1}} + body: typing.Union[ + {{#each content}} + {{#if this.schema}} + {{#with this.schema}} + {{../@key.snakeCase}}_{{jsonPathPiece.snakeCase}}.{{jsonPathPiece.camelCase}}, + {{/with}} + {{else}} + schemas.Unset, + {{/if}} + {{/each}} + ] + {{else}} + body: {{#each content}}{{#if this.schema}}{{#with this.schema}}{{../@key.snakeCase}}_{{jsonPathPiece.snakeCase}}.{{jsonPathPiece.camelCase}}{{/with}}{{else}}schemas.Unset{{/if}}{{/each}} + {{/gt}} + {{else}} + body: schemas.Unset = schemas.unset + {{/if}} + headers: schemas.Unset = schemas.unset + {{/if}} + {{/or}} + {{/and}} + {{#unless headers}} + {{#unless content}} + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + {{/unless}} + {{/unless}} + + +class {{jsonPathPiece.camelCase}}(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + {{#each content}} + + + class __{{@key.camelCase}}MediaType(api_client.MediaType): + {{#with this}} + {{#with schema}} + schema: typing.Type[{{../@key.snakeCase}}_{{jsonPathPiece.snakeCase}}.{{jsonPathPiece.camelCase}}] = {{../@key.snakeCase}}_{{jsonPathPiece.snakeCase}}.{{jsonPathPiece.camelCase}} + {{else}} + pass + {{/with}} + {{/with}} + {{/each}} + {{#if content}} + __Content = typing_extensions.TypedDict( + '__Content', + { + {{#each content}} + '{{{@key.original}}}': typing.Type[__{{@key.camelCase}}MediaType], + {{/each}} + } + ) + content: __Content = { + {{#each content}} + '{{{@key.original}}}': __{{@key.camelCase}}MediaType, + {{/each}} + } + {{/if}} + {{#if headers}} + headers=Header.parameters + {{/if}} +{{/if}} +{{/with}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/components/responses/response_doc.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/components/responses/response_doc.hbs new file mode 100644 index 00000000000..4f541add6b6 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/components/responses/response_doc.hbs @@ -0,0 +1,105 @@ +{{#with response}} +{{#if componentModule}} +{{packageName}}.components.responses.{{jsonPathPiece.snakeCase}} +{{/if}} +{{#eq identifierPieces.size 0}} +{{> components/_helper_header_from_identifier_pieces identifierPieces=(append identifierPieces "Response" jsonPathPiece) }} +{{else}} +{{> components/_helper_header_from_identifier_pieces }} +{{/eq}} +{{#if description}} + +{{headerSize}}# Description +{{description}} +{{/if}} + +{{> components/_helper_header_from_identifier_pieces headerSize=(join headerSize "#" "") identifierPieces=(append identifierPieces "response_cls") }} +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +{{#if refInfo}} + {{#with getDeepestRef}} +body | {{#unless content}}Unset{{else}}{{#if hasContentSchema}}{{#gt content.size 1}}typing.Union[{{/gt}}{{#each content}}{{#if this.schema}}[{{../../refInfo.refClass}}.content.{{@key.snakeCase}}.schema](../../components/responses/{{../../refInfo.refModule}}.md#{{> components/_helper_anchor_id identifierPieces=(append identifierPieces "content" @key this.schema.jsonPathPiece) }}){{else}}Unset{{/if}}{{#unless @last}}, {{/unless}}{{/each}}{{#gt content.size 1}}]{{/gt}}{{else}}Unset{{/if}}{{/unless}} | {{#unless content}}body was not defined{{else}}{{#unless hasContentSchema}}body was not defined{{/unless}}{{/unless}} | +headers | {{#unless headers}}Unset{{else}}[{{../refInfo.refClass}}.Headers](../../components/responses/{{../refInfo.refModule}}.md#headers){{/unless}} | {{#unless headers}}headers were not defined{{/unless}} | + {{/with}} +{{else}} +{{#if content}} +[body](#{{> components/_helper_anchor_id identifierPieces=(append identifierPieces "body") }}) | {{#if hasContentSchema}}{{#gt content.size 1}}typing.Union[{{/gt}}{{#each content}}{{#if this.schema}}[content.{{@key.snakeCase}}.schema](#{{> components/_helper_anchor_id identifierPieces=(append identifierPieces "content" @key this.schema.jsonPathPiece) }}){{else}}Unset{{/if}}{{#unless @last}}, {{/unless}}{{/each}}{{#gt content.size 1}}]{{/gt}}{{else}}Unset{{/if}} | {{#unless hasContentSchema}}body was not defined{{/unless}} | +{{else}} +body | Unset | body was not defined | +{{/if}} +{{#if headers}}[headers](#headers){{else}}headers{{/if}} | {{#unless headers}}Unset{{else}}[Headers](#headers){{/unless}} | {{#unless headers}}headers were not defined{{/unless}} | + {{#if content}} + +{{> components/_helper_header_from_identifier_pieces headerSize=(join headerSize "#" "") identifierPieces=(append identifierPieces "Body") }} +Content-Type | Schema +------------ | ------- + {{#each content}} +"{{@key.original}}" | {{#if this.schema}}[content.{{@key.snakeCase}}.{{this.schema.jsonPathPiece.camelCase}}](#{{> components/_helper_anchor_id identifierPieces=(append identifierPieces "content" @key this.schema.jsonPathPiece) }}){{else}}no schema defined{{/if}} + {{/each}} + {{/if}} + {{#if headers}} + +{{headerSize}}# Headers +Key | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- + {{#each headers}} + {{#with this}} + {{#if refInfo}} + {{#with getDeepestRef}} + {{#if schema}} + {{#with schema}} +{{../@key}} | [{{../../refInfo.refClass}}.schema]({{#unless ../../../componentModule}}../{{/unless}}../../components/headers/{{../../refInfo.refModule}}.md#schema) | | {{#unless required}}optional{{/unless}} + {{/with}} + {{else}} + {{#each content}} + {{#with this}} + {{#with schema}} +{{../../@key}} | [{{../../../refInfo.refClass}}.content.{{../@key.snakeCase}}.{{jsonPathPiece.snakeCase}}]({{#unless ../../../../componentModule}}../{{/unless}}../../components/headers/{{../../../refInfo.refModule}}.md#content-{{../@key.anchorPiece}}-{{jsonPathPiece.anchorPiece}}) | | {{#unless required}}optional{{/unless}} + {{/with}} + {{/with}} + {{/each}} + {{/if}} + {{/with}} + {{else}} + {{#if schema}} + {{#with schema}} +{{../@key}} | [headers.{{../jsonPathPiece.snakeCase}}.schema](#{{> components/_helper_anchor_id identifierPieces=(append identifierPieces "headers" ../jsonPathPiece jsonPathPiece) }}) | | {{#unless required}}optional{{/unless}} + {{/with}} + {{else}} + {{#each content}} + {{#with this}} + {{#with schema}} +{{../../@key}} | [headers.{{../../jsonPathPiece.snakeCase}}.content.{{../@key.snakeCase}}.{{jsonPathPiece.snakeCase}}](#{{> components/_helper_anchor_id identifierPieces=(append identifierPieces "headers" ../../jsonPathPiece "content" ../@key jsonPathPiece) }}) | | {{#unless required}}optional{{/unless}} + {{/with}} + {{/with}} + {{/each}} + {{/if}} + {{/if}} + {{/with}} + {{/each}} + {{/if}} + {{#and content hasContentSchema}} + +{{headerSize}}# Body Details + {{#each content}} + {{#with this.schema}} +{{> components/schemas/schema_doc headerSize=(join headerSize "##" "") identifierPieces=(append identifierPieces "content" @key jsonPathPiece) }} + {{/with}} + {{/each}} + {{/and}} + {{#and headers hasInlineHeader}} + +{{headerSize}}# Header Details + {{#each headers}} + {{#unless refInfo}} +{{> components/headers/header_doc header=this headerSize=(join headerSize "##" "") identifierPieces=(append identifierPieces "headers" jsonPathPiece) }} + {{/unless}} + {{/each}} + {{/and}} +{{/if}} +{{#if componentModule}} + +[[Back to top]](#top) {{> _helper_footer_links readmePath="../../../" responsesLink=true}} +{{/if}} +{{/with}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/__init__schema.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/__init__schema.hbs new file mode 100644 index 00000000000..c9be30e0f54 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/__init__schema.hbs @@ -0,0 +1,5 @@ +# we can not import model classes here because that would create a circular +# reference which would not work in python2 +# do not import all models into this module because that uses a lot of memory and stack frames +# if you need the ability to import all models from one package, import them with +# from {{packageName}}.{{modelPackage}}s import ModelA, ModelB diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/__init__schemas.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/__init__schemas.hbs new file mode 100644 index 00000000000..49a372fab16 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/__init__schemas.hbs @@ -0,0 +1,18 @@ +# coding: utf-8 + +# flake8: noqa + +# import all models into this package +# if you have many models here with many references from one model to another this may +# raise a RecursionError +# to avoid this, import only the models that you directly need like: +# from from {{packageName}}.{{modelPackage}}.pet import Pet +# or import this package, but before doing it, use: +# import sys +# sys.setrecursionlimit(n) + +{{#each schemas}} +{{#with this}} +from {{packageName}}.{{modelPackage}}.{{jsonPathPiece.snakeCase}} import {{jsonPathPiece.camelCase}} +{{/with}} +{{/each}} diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_composed_schemas.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_composed_schemas.hbs new file mode 100644 index 00000000000..67ebdfaf191 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_composed_schemas.hbs @@ -0,0 +1,73 @@ +{{#if allOf}} + +class AllOf: +{{#each allOf}} +{{#if refInfo.refClass}} + + {{> components/schemas/_helper_refclass_staticmethod }} +{{else}} + {{> components/schemas/_helper_schema_switch_case identifierPieces=(append identifierPieces "AllOf" jsonPathPiece) }} +{{/if}} +{{/each}} + classes = [ +{{#each allOf}} + {{#if refInfo.refClass}} + {{jsonPathPiece.snakeCase}}, + {{else}} + {{jsonPathPiece.camelCase}}, + {{/if}} +{{/each}} + ] +{{/if}} +{{#if oneOf}} + +class OneOf: +{{#each oneOf}} +{{#if refInfo.refClass}} + + {{> components/schemas/_helper_refclass_staticmethod }} +{{else}} + {{> components/schemas/_helper_schema_switch_case identifierPieces=(append identifierPieces "OneOf" jsonPathPiece) }} +{{/if}} +{{/each}} + classes = [ +{{#each oneOf}} + {{#if refInfo.refClass}} + {{jsonPathPiece.snakeCase}}, + {{else}} + {{jsonPathPiece.camelCase}}, + {{/if}} +{{/each}} + ] +{{/if}} +{{#if anyOf}} + +class AnyOf: +{{#each anyOf}} +{{#if refInfo.refClass}} + + {{> components/schemas/_helper_refclass_staticmethod }} +{{else}} + {{> components/schemas/_helper_schema_switch_case identifierPieces=(append identifierPieces "AnyOf" jsonPathPiece) }} +{{/if}} +{{/each}} + classes = [ +{{#each anyOf}} + {{#if refInfo.refClass}} + {{jsonPathPiece.snakeCase}}, + {{else}} + {{jsonPathPiece.camelCase}}, + {{/if}} +{{/each}} + ] +{{/if}} +{{#if not}} +{{#with not}} +{{#if refInfo.refClass}} + +{{> components/schemas/_helper_refclass_staticmethod }} +{{else}} +{{> components/schemas/_helper_schema_switch_case identifierPieces=(append identifierPieces jsonPathPiece) }} +{{/if}} +{{/with}} +{{/if}} diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_dict_partial.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_dict_partial.hbs new file mode 100644 index 00000000000..51f0557904c --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_dict_partial.hbs @@ -0,0 +1,54 @@ +{{#if requiredProperties}} +required = { +{{#each requiredProperties}} + "{{{@key.original}}}", +{{/each}} +} +{{/if}} +{{#if hasDiscriminatorWithNonEmptyMapping}} +{{#with discriminator}} +{{#each mappedModels}} +{{#if @first}} + +@staticmethod +def discriminator(): + return { + '{{{propertyName.original}}}': { +{{/if}} + '{{mappingName}}': {{{modelName}}}, +{{#if @last}} + } + } +{{/if}} +{{/each}} +{{/with}} +{{/if}} +{{#if properties}} + +class Properties: +{{#each properties}} +{{#if refInfo.refClass}} + + {{> components/schemas/_helper_refclass_staticmethod }} +{{else}} + {{> components/schemas/_helper_schema_switch_case identifierPieces=(append identifierPieces "Properties" jsonPathPiece.camelCase) }} +{{/if}} +{{/each}} + __annotations__ = { +{{#each properties}} +{{#if refInfo.refClass}} + "{{{@key.original}}}": {{jsonPathPiece.snakeCase}}, +{{else}} + "{{{@key.original}}}": {{jsonPathPiece.camelCase}}, +{{/if}} +{{/each}} + } +{{/if}} +{{#with additionalProperties}} +{{#if refInfo.refClass}} + +{{> components/schemas/_helper_refclass_staticmethod }} +{{else}} +{{> components/schemas/_helper_schema_switch_case identifierPieces=(append identifierPieces jsonPathPiece) }} +{{/if}} +{{/with}} diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_enums.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_enums.hbs new file mode 100644 index 00000000000..f99bb8664dc --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_enums.hbs @@ -0,0 +1,26 @@ +{{#if enumValueToName}} +{{#each enumValueToName}} + +@schemas.classproperty +def {{this}}(cls): + {{#eq @key.type "string"}} + return cls("{{{@key.value}}}") + {{/eq}} + {{#eq @key.type "number"}} + return cls({{{@key.value}}}) + {{/eq}} + {{#eq @key.type "integer"}} + return cls({{{@key.value}}}) + {{/eq}} + {{#eq @key.type "boolean"}} + {{#if @key.value}} + return cls(True) + {{else}} + return cls(False) + {{/if}} + {{/eq}} + {{#eq @key.type "null"}} + return cls(None) + {{/eq}} +{{/each}} +{{/if}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_getitem.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_getitem.hbs new file mode 100644 index 00000000000..b1341b2cb5c --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_getitem.hbs @@ -0,0 +1,24 @@ +def {{methodName}}( + self, + name: typing.Union[ +{{#each requiredProperties}} + {{#if this}} + typing_extensions.Literal["{{{@key.original}}}"], + {{/if}} +{{/each}} +{{#each optionalProperties}} + typing_extensions.Literal["{{{@key.original}}}"], +{{/each}} +{{#with additionalProperties}} + {{#unless isBooleanSchemaFalse}} + str + {{/unless}} +{{else}} + str +{{/with}} + ] +){{#not properties}}{{#not requiredProperties}}{{#with additionalProperties}}{{#unless isBooleanSchemaFalse}} -> {{#if refInfo.refClass}}'{{> components/schemas/_helper_refclass_with_module }}'{{else}}Schema_.{{jsonPathPiece.original}}{{/if}}{{/unless}}{{/with}}{{/not}}{{/not}}: +{{#eq methodName "__getitem__"}} + # dict_instance[name] accessor +{{/eq}} + return super().{{methodName}}(name) diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_getitems.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_getitems.hbs new file mode 100644 index 00000000000..f0f8088b8f2 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_getitems.hbs @@ -0,0 +1,111 @@ +{{#if requiredProperties}} +{{#each requiredProperties}} +{{#with this}} + +@typing.overload +{{#if refInfo.refClass}} +def __getitem__(self, name: typing_extensions.Literal["{{{@key.original}}}"]) -> '{{> components/schemas/_helper_refclass_with_module }}': ... +{{else}} + {{#if jsonPathPiece}} + {{#if schemaIsFromAdditionalProperties}} +def __getitem__(self, name: typing_extensions.Literal["{{{@key.original}}}"]) -> Schema_.{{jsonPathPiece.camelCase}}: ... + {{else}} +def __getitem__(self, name: typing_extensions.Literal["{{{@key.original}}}"]) -> Schema_.Properties.{{jsonPathPiece.camelCase}}: ... + {{/if}} + {{else}} +def __getitem__(self, name: typing_extensions.Literal["{{{@key.original}}}"]) -> schemas.AnyTypeSchema: ... + {{/if}} +{{/if}} +{{/with}} +{{/each}} +{{/if}} +{{#if optionalProperties}} +{{#each optionalProperties}} + +@typing.overload +{{#if refInfo.refClass}} +def __getitem__(self, name: typing_extensions.Literal["{{{@key.original}}}"]) -> '{{> components/schemas/_helper_refclass_with_module }}': ... +{{else}} +def __getitem__(self, name: typing_extensions.Literal["{{{@key.original}}}"]) -> Schema_.Properties.{{jsonPathPiece.camelCase}}: ... +{{/if}} +{{/each}} +{{/if}} +{{#or properties requiredProperties}} + {{#with additionalProperties}} + {{#unless isBooleanSchemaFalse}} + +@typing.overload +def __getitem__(self, name: str) -> {{#if refInfo.refClass}}'{{> components/schemas/_helper_refclass_with_module }}'{{else}}Schema_.{{jsonPathPiece.camelCase}}{{/if}}: ... + {{/unless}} + {{else}} + +@typing.overload +def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + {{/with}} + +{{> components/schemas/_helper_getitem methodName="__getitem__" }} +{{else}} + {{#with additionalProperties}} + {{#unless isBooleanSchemaFalse}} + +def __getitem__(self, name: str) -> {{#if refInfo.refClass}}'{{> components/schemas/_helper_refclass_with_module }}'{{else}}Schema_.{{jsonPathPiece.camelCase}}{{/if}}: + # dict_instance[name] accessor + return super().__getitem__(name) + {{/unless}} + {{/with}} +{{/or}} +{{#if requiredProperties}} +{{#each requiredProperties}} +{{#with this}} + +@typing.overload +{{#if refInfo.refClass}} +def get_item_(self, name: typing_extensions.Literal["{{{@key.original}}}"]) -> '{{> components/schemas/_helper_refclass_with_module }}': ... +{{else}} + {{#if jsonPathPiece}} + {{#if schemaIsFromAdditionalProperties}} +def get_item_(self, name: typing_extensions.Literal["{{{@key.original}}}"]) -> Schema_.{{jsonPathPiece.camelCase}}: ... + {{else}} +def get_item_(self, name: typing_extensions.Literal["{{{@key.original}}}"]) -> Schema_.Properties.{{jsonPathPiece.camelCase}}: ... + {{/if}} + {{else}} +def get_item_(self, name: typing_extensions.Literal["{{{@key.original}}}"]) -> schemas.AnyTypeSchema: ... + {{/if}} +{{/if}} +{{/with}} +{{/each}} +{{/if}} +{{#if optionalProperties}} +{{#each optionalProperties}} + +@typing.overload +{{#if refInfo.refClass}} +def get_item_(self, name: typing_extensions.Literal["{{{@key.original}}}"]) -> typing.Union['{{> components/schemas/_helper_refclass_with_module }}', schemas.Unset]: ... +{{else}} +def get_item_(self, name: typing_extensions.Literal["{{{@key.original}}}"]) -> typing.Union[Schema_.Properties.{{jsonPathPiece.camelCase}}, schemas.Unset]: ... +{{/if}} +{{/each}} +{{/if}} +{{#or properties requiredProperties}} + {{#with additionalProperties}} + {{#unless isBooleanSchemaFalse}} + +@typing.overload +def get_item_(self, name: str) -> typing.Union[{{#if refInfo.refClass}}'{{> components/schemas/_helper_refclass_with_module }}'{{else}}Schema_.{{jsonPathPiece.camelCase}}{{/if}}, schemas.Unset]: ... + {{/unless}} + {{else}} + +@typing.overload +def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + {{/with}} + +{{> components/schemas/_helper_getitem methodName="get_item_" }} +{{else}} + {{#with additionalProperties}} + {{#unless isBooleanSchemaFalse}} + +def get_item_(self, name: str) -> {{#if refInfo.refClass}}'{{> components/schemas/_helper_refclass_with_module }}'{{else}}Schema_.{{jsonPathPiece.camelCase}}{{/if}}: + return super().get_item_(name) + {{/unless}} + {{/with}} +{{/or}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_identifier_suffix.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_identifier_suffix.hbs new file mode 100644 index 00000000000..44a22967ff0 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_identifier_suffix.hbs @@ -0,0 +1 @@ +{{identifierSuffix}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_list_partial.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_list_partial.hbs new file mode 100644 index 00000000000..b935f94d181 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_list_partial.hbs @@ -0,0 +1,8 @@ +{{#with items}} +{{#if refInfo.refClass}} + +{{> components/schemas/_helper_refclass_staticmethod }} +{{else}} +{{> components/schemas/_helper_schema_switch_case identifierPieces=(append identifierPieces jsonPathPiece) }} +{{/if}} +{{/with}} diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_new.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_new.hbs new file mode 100644 index 00000000000..dc2d22f8ab1 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_new.hbs @@ -0,0 +1,139 @@ +def __new__( + cls, +{{#if types}} + {{#eq types.size 1}} + {{#contains types "array"}} + arg_: typing.Union[ + typing.Tuple[ + {{#with ../items}}{{#if refInfo.refClass}}typing.Union['{{> components/schemas/_helper_refclass_with_module }}', {{#with getDeepestRef}}{{> _helper_schema_python_types }}{{/with}}]{{else}}typing.Union[Schema_.{{jsonPathPiece.camelCase}}, {{> _helper_schema_python_types }}]{{/if}}{{/with}}, ... + ], + typing.List[ + {{#with ../items}}{{#if refInfo.refClass}}typing.Union['{{> components/schemas/_helper_refclass_with_module }}', {{#with getDeepestRef}}{{> _helper_schema_python_types }}{{/with}}]{{else}}typing.Union[Schema_.{{jsonPathPiece.camelCase}}, {{> _helper_schema_python_types }}]{{/if}}{{/with}} + ], + ], + {{/contains}} + {{#contains types "object"}} + *args_: typing.Union[{{> _helper_schema_python_types }}], + {{/contains}} + {{#contains types "string"}} + arg_: {{> _helper_schema_python_types }}, + {{/contains}} + {{#contains types "number"}} + arg_: typing.Union[{{> _helper_schema_python_types }}], + {{/contains}} + {{#contains types "integer"}} + arg_: {{> _helper_schema_python_types }}, + {{/contains}} + {{#contains types "boolean"}} + arg_: {{> _helper_schema_python_types }}, + {{/contains}} + {{#contains types "null"}} + arg_: {{> _helper_schema_python_types }}, + {{/contains}} + {{else}} + {{#contains types "object"}} + *args_: typing.Union[{{> _helper_schema_python_types }}], + {{else}} + arg_: typing.Union[{{> _helper_schema_python_types }}], + {{/contains}} + {{/eq}} +{{else}} + *args_: typing.Union[{{> _helper_schema_python_types }}], +{{/if}} +{{#if types}} + {{#eq types.size 1}} + {{#contains types "object"}} + {{#each requiredProperties}} + {{#if @key.isValid}} + {{#with this}} + {{#if refInfo.refClass}} + {{@key.original}}: typing.Union['{{> components/schemas/_helper_refclass_with_module }}', {{#with getDeepestRef}}{{> _helper_schema_python_types }}{{/with}}], + {{else}} + {{#if jsonPathPiece}} + {{#if schemaIsFromAdditionalProperties}} + {{@key.original}}: typing.Union[Schema_.{{jsonPathPiece.camelCase}}, {{> _helper_schema_python_types }}], + {{else}} + {{@key.original}}: typing.Union[Schema_.Properties.{{jsonPathPiece.camelCase}}, {{> _helper_schema_python_types }}], + {{/if}} + {{else}} + {{@key.original}}: typing.Union[schemas.AnyTypeSchema, {{> _helper_schema_python_types }}], + {{/if}} + {{/if}} + {{/with}} + {{/if}} + {{/each}} + {{/contains}} + {{/eq}} +{{/if}} +{{#each optionalProperties}} + {{#if @key.isValid}} + {{#if refInfo.refClass}} + {{@key.original}}: typing.Union['{{> components/schemas/_helper_refclass_with_module }}', {{#with getDeepestRef}}{{> _helper_schema_python_types }}{{/with}}, schemas.Unset] = schemas.unset, + {{else}} + {{@key.original}}: typing.Union[Schema_.Properties.{{jsonPathPiece.camelCase}}, {{> _helper_schema_python_types }}, schemas.Unset] = schemas.unset, + {{/if}} + {{/if}} +{{/each}} + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, +{{#with additionalProperties}} + {{#unless isBooleanSchemaFalse}} + {{#if refInfo.refClass}} + **kwargs: typing.Union['{{> components/schemas/_helper_refclass_with_module }}', {{#with getDeepestRef}}{{> _helper_schema_python_types }}{{/with}}], + {{else}} + **kwargs: typing.Union[Schema_.{{jsonPathPiece.camelCase}}, {{> _helper_schema_python_types }}], + {{/if}} + {{/unless}} +{{else}} + {{#eq types null}} + **kwargs: typing.Union[{{> components/schemas/_helper_types_all_incl_schema_oneline }}], + {{else}} + {{#contains types "object"}} + **kwargs: typing.Union[{{> components/schemas/_helper_types_all_incl_schema_oneline }}], + {{/contains}} + {{/eq}} +{{/with}} +) -> '{{#each identifierPieces}}{{#if this.camelCase}}{{this.camelCase}}{{else}}{{this}}{{/if}}{{#unless @last}}.{{/unless}}{{/each}}': + return super().__new__( + cls, +{{#eq types null}} + *args_, +{{else}} + {{#contains types "object"}} + *args_, + {{else}} + arg_, + {{/contains}} +{{/eq}} +{{#if types}} + {{#eq types.size 1}} + {{#contains types "object"}} + {{#each requiredProperties}} + {{#if @key.isValid}} + {{#with this}} + {{@key.original}}={{@key.original}}, + {{/with}} + {{/if}} + {{/each}} + {{/contains}} + {{/eq}} +{{/if}} +{{#each optionalProperties}} + {{#if @key.isValid}} + {{@key.original}}={{@key.original}}, + {{/if}} +{{/each}} + configuration_=configuration_, +{{#with additionalProperties}} + {{#unless isBooleanSchemaFalse}} + **kwargs, + {{/unless}} +{{else}} + {{#eq types null}} + **kwargs, + {{else}} + {{#contains types "object"}} + **kwargs, + {{/contains}} + {{/eq}} +{{/with}} + ) diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_notes_msg.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_notes_msg.hbs new file mode 100644 index 00000000000..14ca920672f --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_notes_msg.hbs @@ -0,0 +1 @@ +{{#unless refInfo.refClass}}{{#if enumValueToName}} must be one of [{{#each enumValueToName}}{{#unless @first}}, {{/unless}}{{#eq @key.type "null"}}None{{/eq}}{{#eq @key.type "boolean"}}{{#if @key.value}}True{{else}}False{{/if}}{{/eq}}{{#eq @key.type "string"}}"{{{@key.value}}}"{{/eq}}{{#eq @key.type "number"}}{{{@key.value}}}{{/eq}}{{#eq @key.type "integer"}}{{{@key.value}}}{{/eq}}{{/each}}]{{/if}}{{#if defaultValue}}{{#unless requiredProperties}} if omitted the {{defaultUser}} will use the default value of {{{defaultValue.value}}}{{/unless}}{{/if}}{{#eq format "uuid"}} value must be a uuid{{/eq}}{{#eq format "date"}} value must conform to RFC-3339 full-date YYYY-MM-DD{{/eq}}{{#eq format "date-time"}} value must conform to RFC-3339 date-time{{/eq}}{{#eq format "number"}} value must be numeric and storable in decimal.Decimal{{/eq}}{{#eq format "int32"}} value must be a 32 bit integer{{/eq}}{{#eq format "int64"}} value must be a 64 bit integer{{/eq}}{{#eq format "double"}} value must be a 64 bit float{{/eq}}{{#eq format "float"}} value must be a 32 bit float{{/eq}}{{/unless}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_payload_renderer.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_payload_renderer.hbs new file mode 100644 index 00000000000..67dc5151f22 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_payload_renderer.hbs @@ -0,0 +1,36 @@ +{{#eq type "object"}} +{ + {{#each value}} + "{{{@key}}}": + {{#with this}} + {{> components/schemas/_helper_payload_renderer endChar=','}} + {{/with}} + {{/each}} +}{{endChar}} +{{/eq}} +{{#eq type"array"}} +[ + {{#each value}} + {{> components/schemas/_helper_payload_renderer endChar=','}} + {{/each}} +]{{endChar}} +{{/eq}} +{{#eq type "number"}} +{{value}}{{endChar}} +{{/eq}} +{{#eq type "integer"}} +{{value}}{{endChar}} +{{/eq}} +{{#eq type "boolean"}} + {{#if value}} +True{{endChar}} + {{else}} +False{{endChar}} + {{/if}} +{{/eq}} +{{#eq type "null"}} +None{{endChar}} +{{/eq}} +{{#eq type "string"}} +"{{{value}}}"{{endChar}} +{{/eq}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_property_type_hints.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_property_type_hints.hbs new file mode 100644 index 00000000000..febb3dbc400 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_property_type_hints.hbs @@ -0,0 +1,23 @@ +{{#if requiredProperties}} + + {{#each requiredProperties}} + {{#if @key.isValid}} + {{#with this}} + {{#if refInfo.refClass}} +{{@key.original}}: '{{> components/schemas/_helper_refclass_with_module }}' + {{else}} + {{#if jsonPathPiece}} + {{#if schemaIsFromAdditionalProperties}} +{{@key.original}}: Schema_.{{jsonPathPiece.camelCase}} + {{else}} +{{@key.original}}: Schema_.Properties.{{jsonPathPiece.camelCase}} + {{/if}} + {{else}} +{{@key.original}}: schemas.AnyTypeSchema + {{/if}} + {{/if}} + {{/with}} + {{/if}} + {{/each}} +{{/if}} +{{> components/schemas/_helper_getitems }} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_refclass_partial.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_refclass_partial.hbs new file mode 100644 index 00000000000..c21b330f81d --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_refclass_partial.hbs @@ -0,0 +1 @@ +[**{{refInfo.refClass}}**]({{#eq refInfo.refModule null}}#top{{else}}{{complexTypePrefix}}{{refInfo.refModule}}.md{{/eq}}) \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_refclass_staticmethod.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_refclass_staticmethod.hbs new file mode 100644 index 00000000000..42ab5bbe32d --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_refclass_staticmethod.hbs @@ -0,0 +1,3 @@ +@staticmethod +def {{jsonPathPiece.snakeCase}}() -> typing.Type['{{> components/schemas/_helper_refclass_with_module }}']: + return {{> components/schemas/_helper_refclass_with_module }} diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_refclass_with_module.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_refclass_with_module.hbs new file mode 100644 index 00000000000..cd9f5d94cbb --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_refclass_with_module.hbs @@ -0,0 +1 @@ +{{#if refInfo.refModule}}{{refInfo.refModule}}.{{/if}}{{refInfo.refClass}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_schema_composed_or_anytype.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_schema_composed_or_anytype.hbs new file mode 100644 index 00000000000..ba011468ccc --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_schema_composed_or_anytype.hbs @@ -0,0 +1,70 @@ + + +class {{jsonPathPiece.camelCase}}( +{{#eq types null}} + {{#if format}} + {{#eq format "uuid"}} + schemas.UUIDBase, + {{/eq}} + {{#eq format "date"}} + schemas.DateBase, + {{/eq}} + {{#eq format "date-time"}} + schemas.DateTimeBase, + {{/eq}} + {{#eq format "number"}} + schemas.DecimalBase, + {{/eq}} + {{/if}} + schemas.AnyTypeSchema, +{{else}} + {{#if hasMultipleTypes}} + {{> components/schemas/_helper_xbase_multiple_types }} + {{else}} + {{> components/schemas/_helper_xbase_one_type }} + {{/if}} +{{/eq}} +): +{{#if componentModule}} + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. +{{#if description}} + + {{{unescapedDescription}}} +{{/if}} + """ +{{/if}} + + + class Schema_: +{{#eq types null}} + # any type +{{/eq}} + {{> components/schemas/_helper_types }} +{{#if format}} + format = '{{format}}' +{{/if}} +{{#if enumValueToName}} + {{> components/schemas/_helper_schema_enum }} +{{/if}} +{{#if items}} + {{> components/schemas/_helper_list_partial identifierPieces=(append identifierPieces "Schema_") }} +{{/if}} +{{#or additionalProperties requiredProperties hasDiscriminatorWithNonEmptyMapping properties}} + {{> components/schemas/_helper_dict_partial identifierPieces=(append identifierPieces "Schema_") }} +{{/or}} +{{#if hasValidation}} + {{> components/schemas/_helper_validations }} +{{/if}} +{{#or allOf anyOf oneOf not}} + {{> components/schemas/_helper_composed_schemas identifierPieces=(append identifierPieces "Schema_") }} +{{/or}} +{{#if enumValueToName}} + {{> components/schemas/_helper_enums }} +{{/if}} + + {{> components/schemas/_helper_property_type_hints }} + + {{> components/schemas/_helper_new }} diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_schema_dict.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_schema_dict.hbs new file mode 100644 index 00000000000..c5f2b98e903 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_schema_dict.hbs @@ -0,0 +1,27 @@ + + +class {{jsonPathPiece.camelCase}}( + schemas.DictSchema +): +{{#if componentModule}} + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. +{{#if description}} + + {{{unescapedDescription}}} +{{/if}} + """ +{{/if}} +{{#or additionalProperties requiredProperties hasDiscriminatorWithNonEmptyMapping properties hasValidation}} + + + class Schema_: + types = {frozendict.frozendict} + {{> components/schemas/_helper_dict_partial identifierPieces=(append identifierPieces "Schema_") }} + {{> components/schemas/_helper_validations }} +{{/or}} + {{> components/schemas/_helper_property_type_hints }} + + {{> components/schemas/_helper_new }} diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_schema_enum.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_schema_enum.hbs new file mode 100644 index 00000000000..4cdebbc7e4c --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_schema_enum.hbs @@ -0,0 +1,23 @@ +enum_value_to_name = { +{{#each enumValueToName}} + {{#eq @key.type "string"}} + "{{{@key.value}}}": "{{this}}", + {{/eq}} + {{#eq @key.type "number"}} + {{{@key.value}}}: "{{this}}", + {{/eq}} + {{#eq @key.type "integer"}} + {{{@key.value}}}: "{{this}}", + {{/eq}} + {{#eq @key.type "boolean"}} + {{#if @key.value}} + schemas.BoolClass.TRUE: "{{this}}", + {{else}} + schemas.BoolClass.FALSE: "{{this}}", + {{/if}} + {{/eq}} + {{#eq @key.type "null"}} + schemas.NoneClass.NONE: "{{this}}", + {{/eq}} +{{/each}} +} diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_schema_list.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_schema_list.hbs new file mode 100644 index 00000000000..7498fe2bcf7 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_schema_list.hbs @@ -0,0 +1,31 @@ + + +class {{jsonPathPiece.camelCase}}( + schemas.ListSchema +): +{{#if componentModule}} + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. +{{#if description}} + + {{{unescapedDescription}}} +{{/if}} + """ +{{/if}} +{{#or items hasValidation}} + + + class Schema_: + types = {tuple} +{{#if hasValidation}} + {{> components/schemas/_helper_validations }} +{{/if}} + {{> components/schemas/_helper_list_partial identifierPieces=(append identifierPieces "Schema_") }} +{{/or}} + + {{> components/schemas/_helper_new }} + + def __getitem__(self, i: int) -> {{#with items}}{{#if refInfo.refClass}}'{{> components/schemas/_helper_refclass_with_module }}'{{else}}Schema_.{{jsonPathPiece.camelCase}}{{/if}}{{/with}}: + return super().__getitem__(i) diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_schema_simple.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_schema_simple.hbs new file mode 100644 index 00000000000..3860cd857d5 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_schema_simple.hbs @@ -0,0 +1,62 @@ + + +class {{jsonPathPiece.camelCase}}( +{{#if hasMultipleTypes}} + {{> components/schemas/_helper_xbase_multiple_types }} +{{else}} + {{> components/schemas/_helper_xbase_one_type }} +{{/if}} +): +{{#if componentModule}} + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. +{{#if description}} + + {{{unescapedDescription}}} +{{/if}} + """ +{{/if}} +{{#or hasValidation enumValueToName format defaultValue}} + + + class Schema_: +{{#eq types null}} + # any type +{{/eq}} + {{> components/schemas/_helper_types }} +{{#if format}} + format = '{{format}}' +{{/if}} + {{> components/schemas/_helper_validations }} +{{#if defaultValue}} + {{#with defaultValue}} + {{#eq type "string"}} + default = "{{{value}}}" + {{/eq}} + {{#eq type "number"}} + default = {{{value}}} + {{/eq}} + {{#eq type "integer"}} + default = {{{value}}} + {{/eq}} + {{#eq type "boolean"}} + {{#if value}} + default = schemas.BoolClass.TRUE + {{else}} + default = schemas.BoolClass.FALSE + {{/if}} + {{/eq}} + {{#eq type "null"}} + default = schemas.NoneClass.NONE + {{/eq}} + {{/with}} +{{/if}} +{{#if enumValueToName}} + {{> components/schemas/_helper_schema_enum }} +{{/if}} +{{/or}} +{{#if enumValueToName}} + {{> components/schemas/_helper_enums }} +{{/if}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_schema_switch_case.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_schema_switch_case.hbs new file mode 100644 index 00000000000..6cb6f781dd7 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_schema_switch_case.hbs @@ -0,0 +1,45 @@ +{{#or allOf anyOf oneOf not}} + {{#if isBooleanSchemaFalse}} +{{> components/schemas/_helper_var_equals_cls }} + {{else}} +{{> components/schemas/_helper_schema_composed_or_anytype }} + {{/if}} +{{else}} + {{#if hasMultipleTypes}} +{{> components/schemas/_helper_schema_composed_or_anytype }} + {{else}} + {{#eq types null }} + {{#or enumValueToName properties hasValidation requiredProperties hasDiscriminatorWithNonEmptyMapping items format}} +{{> components/schemas/_helper_schema_composed_or_anytype }} + {{else}} +{{> components/schemas/_helper_var_equals_cls }} + {{/or}} + {{else}} + {{#each types}} + {{#eq this "object"}} + {{#or properties hasValidation requiredProperties hasDiscriminatorWithNonEmptyMapping additionalProperties }} +{{> components/schemas/_helper_schema_dict }} + {{else}} +{{> components/schemas/_helper_var_equals_cls }} + {{/or}} + {{/eq}} + {{#eq this "array"}} + {{#or items hasValidation}} +{{> components/schemas/_helper_schema_list }} + {{else}} +{{> components/schemas/_helper_var_equals_cls }} + {{/or}} + {{/eq}} + {{#neq this "object"}} + {{#neq this "array"}} + {{#or enumValueToName hasValidation defaultValue}} +{{> components/schemas/_helper_schema_simple }} + {{else}} +{{> components/schemas/_helper_var_equals_cls }} + {{/or}} + {{/neq}} + {{/neq}} + {{/each}} + {{/eq}} + {{/if}} +{{/or}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_types.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_types.hbs new file mode 100644 index 00000000000..8961be085fb --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_types.hbs @@ -0,0 +1,32 @@ +{{#if types}} +types = { +{{#each types}} +{{#eq this "null"}} + schemas.NoneClass, +{{/eq}} +{{#eq this "object"}} + frozendict.frozendict, +{{/eq}} +{{#eq this "array"}} + tuple, +{{/eq}} +{{#eq this "string" }} + {{#eq ../format "binary"}} + FileIO, + bytes, + {{else}} + str, + {{/eq}} +{{/eq}} +{{#eq this "integer"}} + decimal.Decimal, +{{/eq}} +{{#eq this "number"}} + decimal.Decimal, +{{/eq}} +{{#eq this "boolean"}} + schemas.BoolClass, +{{/eq}} +{{/each}} +} +{{/if}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_types_all_accessed_oneline.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_types_all_accessed_oneline.hbs new file mode 100644 index 00000000000..2a3aad22e54 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_types_all_accessed_oneline.hbs @@ -0,0 +1 @@ +frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_types_all_incl_schema_oneline.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_types_all_incl_schema_oneline.hbs new file mode 100644 index 00000000000..8d2abaa4c25 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_types_all_incl_schema_oneline.hbs @@ -0,0 +1 @@ +dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_validations.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_validations.hbs new file mode 100644 index 00000000000..894c5ec9b96 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_validations.hbs @@ -0,0 +1,59 @@ +{{#neq uniqueItems null}} +unique_items = {{#if uniqueItems}}True{{else}}False{{/if}} +{{/neq}} +{{#neq maxLength null}} +max_length = {{maxLength}} +{{/neq}} +{{#neq minLength null}} +min_length = {{minLength}} +{{/neq}} +{{#neq maxItems null}} +max_items = {{maxItems}} +{{/neq}} +{{#neq minItems null}} +min_items = {{minItems}} +{{/neq}} +{{#neq maxProperties null }} +max_properties = {{maxProperties}} +{{/neq}} +{{#neq minProperties null}} +min_properties = {{minProperties}} +{{/neq}} +{{#neq maximum null}} +{{#if exclusiveMaximum}}exclusive_maximum{{/if}}inclusive_maximum{{#unless exclusiveMaximum}}{{/unless}} = {{maximum}} +{{/neq}} +{{#neq minimum null}} +{{#if exclusiveMinimum}}exclusive_minimum{{/if}}inclusive_minimum{{#unless exclusiveMinimum}}{{/unless}} = {{minimum}} +{{/neq}} +{{#neq patternInfo null}} +regex={ + {{#with patternInfo}} + 'pattern': r'{{{pattern}}}', # noqa: E501 + {{#if flags}} + {{#eq flags.size 1}} + 'flags': {{#each flags}}re.{{#eq this "i"}}I{{/eq}}{{#eq this "m"}}M{{/eq}}{{#eq this "s"}}S{{/eq}}{{#eq this "u"}}U{{/eq}}{{/each}}, + {{else}} + 'flags': ( + {{#each flags}} + {{#eq this "i"}} + re.I{{#unless @last}} |{{/unless}} + {{/eq}} + {{#eq this "m"}} + re.M{{#unless @last}} |{{/unless}} + {{/eq}} + {{#eq this "s"}} + re.S{{#unless @last}} |{{/unless}} + {{/eq}} + {{#eq this "u"}} + re.U{{#unless @last}} |{{/unless}} + {{/eq}} + {{/each}} + ) + {{/eq}} + {{/if}} + {{/with}} +} +{{/neq}} +{{#neq multipleOf null}} +multiple_of = {{multipleOf}} +{{/neq}} diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_var_equals_cls.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_var_equals_cls.hbs new file mode 100644 index 00000000000..a60b5377366 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_var_equals_cls.hbs @@ -0,0 +1 @@ +{{jsonPathPiece.camelCase}} = {{#or isBooleanSchemaTrue isBooleanSchemaFalse}}{{#if isBooleanSchemaTrue}}schemas.AnyTypeSchema{{else}}schemas.NotAnyTypeSchema{{/if}}{{else}}{{#if refInfo.refClass}}{{> components/schemas/_helper_refclass_with_module }}{{else}}schemas.{{#eq types null}}AnyType{{else}}{{#each types}}{{#eq this "null"}}None{{/eq}}{{#eq this "object"}}Dict{{/eq}}{{#eq this "array"}}List{{/eq}}{{#eq this "boolean"}}Bool{{/eq}}{{#eq this "string"}}{{#eq ../format "date"}}Date{{/eq}}{{#eq ../format "date-time"}}DateTime{{/eq}}{{#eq ../format "uuid"}}UUID{{/eq}}{{#eq ../format "number"}}Decimal{{/eq}}{{#eq ../format "binary"}}Binary{{/eq}}{{#neq ../format "date"}}{{#neq ../format "date-time"}}{{#neq ../format "uuid"}}{{#neq ../format "number"}}{{#neq ../format "binary"}}Str{{/neq}}{{/neq}}{{/neq}}{{/neq}}{{/neq}}{{/eq}}{{#eq this "integer"}}{{#eq ../format "int32"}}Int32{{/eq}}{{#eq ../format "int64"}}Int64{{/eq}}{{#neq ../format "int32"}}{{#neq ../format "int64"}}Int{{/neq}}{{/neq}}{{/eq}}{{#eq this "number"}}{{#eq ../format "float"}}Float32{{/eq}}{{#eq ../format "double"}}Float64{{/eq}}{{#neq ../format "float"}}{{#neq ../format "double"}}Number{{/neq}}{{/neq}}{{/eq}}{{/each}}{{/eq}}Schema{{/if}}{{/or}} diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_xbase_multiple_types.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_xbase_multiple_types.hbs new file mode 100644 index 00000000000..3204de4d617 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_xbase_multiple_types.hbs @@ -0,0 +1,37 @@ +{{# each types}} + {{#eq this "array"}} +schemas.ListBase, + {{/eq}} + {{#eq this "object"}} +schemas.DictBase, + {{/eq}} + {{#eq this "string"}} + {{#eq format "date"}} +schemas.DateBase, + {{/eq}} + {{#eq format "date-time"}} +schemas.DateTimeBase, + {{/eq}} + {{#eq format "uuid"}} +schemas.UUIDBase, + {{/eq}} + {{#eq format "number"}} +schemas.DecimalBase, + {{/eq}} +schemas.StrBase, + {{/eq}} + {{#eq this "number"}} +schemas.NumberBase, + {{/eq}} + {{#eq this "integer"}} +schemas.IntBase, + {{/eq}} + {{#eq this "boolean"}} +schemas.BoolBase, + {{/eq}} + {{#eq this "null"}} +schemas.NoneBase, + {{/eq}} +{{/each}} +schemas.Schema, +schemas.{{#each types}}{{#eq this "null"}}None{{/eq}}{{#eq this "object"}}FrozenDict{{/eq}}{{#eq this "array"}}Tuple{{/eq}}{{#eq this "string"}}Str{{/eq}}{{#eq this "number"}}Decimal{{/eq}}{{#eq this "integer"}}Decimal{{/eq}}{{#eq this "boolean"}}Bool{{/eq}}{{/each}}Mixin diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_xbase_one_type.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_xbase_one_type.hbs new file mode 100644 index 00000000000..dc273981a8d --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_xbase_one_type.hbs @@ -0,0 +1,68 @@ +{{#each types}} + {{#eq this "array"}} +schemas.ListSchema + {{/eq}} + {{#eq this "object"}} +schemas.DictSchema + {{/eq}} + {{#eq this "string"}} + {{#eq ../format "date"}} +schemas.DateSchema + {{/eq}} + {{#eq ../format "date-time"}} +schemas.DateTimeSchema + {{/eq}} + {{#eq ../format "uuid"}} +schemas.UUIDSchema + {{/eq}} + {{#eq ../format "number"}} +schemas.DecimalSchema + {{/eq}} + {{#eq ../format "binary"}} +schemas.BinarySchema + {{/eq}} + {{#neq ../format "date"}} + {{#neq ../format "date-time"}} + {{#neq ../format "uuid"}} + {{#neq ../format "number"}} + {{#neq ../format "binary"}} +schemas.StrSchema + {{/neq}} + {{/neq}} + {{/neq}} + {{/neq}} + {{/neq}} + {{/eq}} + {{#eq this "number"}} + {{#eq ../format "float"}} +schemas.Float32Schema + {{/eq}} + {{#eq ../format "double"}} +schemas.Float64Schema + {{/eq}} + {{#neq ../format "float"}} + {{#neq ../format "double"}} +schemas.NumberSchema + {{/neq}} + {{/neq}} + {{/eq}} + {{#eq this "integer"}} + {{#eq ../format "int32"}} +schemas.Int32Schema + {{/eq}} + {{#eq ../format "int64"}} +schemas.Int64Schema + {{/eq}} + {{#neq ../format "int32"}} + {{#neq ../format "int64"}} +schemas.IntSchema + {{/neq}} + {{/neq}} + {{/eq}} + {{#eq this "boolean"}} +schemas.BoolSchema + {{/eq}} + {{#eq this "null"}} +schemas.NoneSchema + {{/eq}} +{{/each}} diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/schema.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/schema.hbs new file mode 100644 index 00000000000..00efff10d06 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/schema.hbs @@ -0,0 +1,20 @@ +# coding: utf-8 + +{{> _helper_header }} + +{{#with schema}} + {{#if refInfo}} + {{#if imports}} + + {{/if}} +{{> _helper_imports }} +{{> components/schemas/_helper_schema_switch_case identifierPieces=(append identifierPieces jsonPathPiece) }} + {{else}} +{{> _helper_imports_schema_types }} +{{> components/schemas/_helper_schema_switch_case identifierPieces=(append identifierPieces jsonPathPiece) }} + {{#if imports}} + + {{/if}} +{{> _helper_imports }} + {{/if}} +{{/with}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/schema_doc.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/schema_doc.hbs new file mode 100644 index 00000000000..f86c633ce7b --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/schema_doc.hbs @@ -0,0 +1,182 @@ +{{#with schema}} +{{#if componentModule}} +{{packageName}}.components.schema.{{jsonPathPiece.snakeCase}} +{{/if}} +{{#eq identifierPieces.size 0}} +{{> components/_helper_header_from_identifier_pieces identifierPieces=(append identifierPieces "Schema" jsonPathPiece) }} +{{else}} +{{> components/_helper_header_from_identifier_pieces }} +{{/eq}} +{{#if description}} + +{{headerSize}}# Description +{{description}} +{{/if}} + +{{headerSize}}# Type Info +{{#if refInfo}} +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[{{refInfo.refClass}}]({{complexTypePrefix}}{{refInfo.refModule}}.md) | {{#with getDeepestRef}}{{> _helper_schema_python_types }} | {{> components/_helper_schema_accessed_types }}{{/with}} |{{#if description}} {{description}}{{/if}} +{{else}} +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +{{> _helper_schema_python_types }} | {{> components/_helper_schema_accessed_types }} | {{#if description}}{{description}}{{/if}} |{{> components/schemas/_helper_notes_msg defaultUser="server" }} + {{#or properties additionalProperties requiredProperties}} + +{{headerSize}}# Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- + {{#each requiredProperties}} +**{{@key.original}}** | {{#if refInfo.refClass}}{{> components/schemas/_helper_refclass_partial }}{{#with getDeepestRef}}, {{> _helper_schema_python_types }}{{/with}}{{else}}{{> _helper_schema_python_types }}{{/if}} | {{#if refInfo.refClass}}{{> components/schemas/_helper_refclass_partial }}{{else}}{{#if isComplicated}}[properties.{{@key.camelCase}}](#{{> components/_helper_anchor_id identifierPieces=(append identifierPieces "properties" @key.anchorPiece) }}){{else}}{{> components/_helper_schema_accessed_types }}{{/if}}{{/if}} | {{#if description}}{{description}}{{/if}} |{{> components/schemas/_helper_notes_msg defaultUser="server" }} + {{/each}} + {{#each optionalProperties}} +**{{@key.original}}** | {{#if refInfo.refClass}}{{> components/schemas/_helper_refclass_partial }}{{#with getDeepestRef}}, {{> _helper_schema_python_types }}{{/with}}{{else}}{{> _helper_schema_python_types }}{{/if}} | {{#if refInfo.refClass}}{{> components/schemas/_helper_refclass_partial }}{{else}}{{#if isComplicated}}[properties.{{@key.camelCase}}](#{{> components/_helper_anchor_id identifierPieces=(append identifierPieces "properties" @key.anchorPiece) }}){{else}}{{> components/_helper_schema_accessed_types }}{{/if}}{{/if}} | {{#if description}}{{description}}{{/if}} | [optional]{{> components/schemas/_helper_notes_msg defaultUser="server" }} + {{/each}} + {{#with additionalProperties}} + {{#unless isBooleanSchemaFalse}} + {{#if isBooleanSchemaTrue}} +**any_string_name** | {{> _helper_schema_python_types }} | {{> components/_helper_schema_accessed_types }} | any string name can be used but the value must be the correct type{{#if description}} {{description}}{{/if}} | [optional] + {{else}} +**any_string_name** | {{#if refInfo.refClass}}{{> components/schemas/_helper_refclass_partial }}{{#with getDeepestRef}}, {{> _helper_schema_python_types }}{{/with}}{{else}}{{> _helper_schema_python_types }}{{/if}} | {{#if refInfo.refClass}}{{> components/schemas/_helper_refclass_partial }}{{else}}{{#if isComplicated}}[{{@jsonPathPiece.camelCase}}](#{{> components/_helper_anchor_id identifierPieces=(append identifierPieces jsonPathPiece) }}){{else}}{{> components/_helper_schema_accessed_types }}{{/if}}{{/if}} | any string name can be used but the value must be the correct type{{#if description}} {{description}}{{/if}} | [optional]{{> components/schemas/_helper_notes_msg defaultUser="server" }} + {{/if}} + {{/unless}} + {{else}} +**any_string_name** | {{> components/schemas/_helper_types_all_incl_schema_oneline }} | {{> components/schemas/_helper_types_all_accessed_oneline }} | any string name can be used but the value must be the correct type | [optional] + {{/with}} + {{/or}} + {{#if items}} + +{{headerSize}}# List Items +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- + {{#with items}} +{{#unless refInfo.refClass}}{{#if isComplicated}}[{{/if}}{{jsonPathPiece.original}}{{#if isComplicated}}](#{{> components/_helper_anchor_id identifierPieces=(append identifierPieces jsonPathPiece.anchorPiece) }}){{/if}}{{/unless}}{{#if refInfo.refClass}}{{> components/schemas/_helper_refclass_partial }}{{/if}} | {{#unless refInfo.refClass}}{{> _helper_schema_python_types }}{{/unless}}{{#if refInfo.refClass}}{{> components/schemas/_helper_refclass_partial }}{{/if}} | {{#unless refInfo.refClass}}{{> components/_helper_schema_accessed_types }}{{/unless}}{{#if refInfo.refClass}}{{> components/schemas/_helper_refclass_partial }}{{/if}} | {{#if description}}{{description}}{{/if}} |{{> components/schemas/_helper_notes_msg defaultUser="server" }} + {{/with}} + {{/if}} + {{#or allOf anyOf oneOf not}} + +{{headerSize}}# Composed Schemas (allOf/anyOf/oneOf/not) + {{/or}} + {{#if allOf}} +{{headerSize}}# allOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- + {{#each allOf}} +{{#if refInfo.refClass}}{{> components/schemas/_helper_refclass_partial }}{{else}}[{{#if jsonPathPiece.isValid}}{{jsonPathPiece.original}}{{else}}{{jsonPathPiece.snakeCase}}{{/if}}](#{{> components/_helper_anchor_id identifierPieces=(append identifierPieces "allof" jsonPathPiece.anchorPiece) }}){{/if}} | {{#unless refInfo.refClass}}{{> _helper_schema_python_types }}{{/unless}}{{#if refInfo.refClass}}{{> components/schemas/_helper_refclass_partial }}{{/if}} | {{#unless refInfo.refClass}}{{> components/_helper_schema_accessed_types }}{{/unless}}{{#if refInfo.refClass}}{{> components/schemas/_helper_refclass_partial }}{{/if}} | {{#if description}}{{description}}{{/if}} |{{> components/schemas/_helper_notes_msg defaultUser="server" }} + {{/each}} + {{/if}} + {{#if anyOf}} +{{headerSize}}# anyOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- + {{#each anyOf}} +{{#if refInfo.refClass}}{{> components/schemas/_helper_refclass_partial }}{{else}}[{{#if jsonPathPiece.isValid}}{{jsonPathPiece.original}}{{else}}{{jsonPathPiece.snakeCase}}{{/if}}](#{{> components/_helper_anchor_id identifierPieces=(append identifierPieces "anyof" jsonPathPiece.anchorPiece) }}){{/if}} | {{#unless refInfo.refClass}}{{> _helper_schema_python_types }}{{/unless}}{{#if refInfo.refClass}}{{> components/schemas/_helper_refclass_partial }}{{/if}} | {{#unless refInfo.refClass}}{{> components/_helper_schema_accessed_types }}{{/unless}}{{#if refInfo.refClass}}{{> components/schemas/_helper_refclass_partial }}{{/if}} | {{#if description}}{{description}}{{/if}} |{{> components/schemas/_helper_notes_msg defaultUser="server" }} + {{/each}} + {{/if}} + {{#if oneOf}} +{{headerSize}}# oneOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- + {{#each oneOf}} +{{#if refInfo.refClass}}{{> components/schemas/_helper_refclass_partial }}{{else}}[{{#if jsonPathPiece.isValid}}{{jsonPathPiece.original}}{{else}}{{jsonPathPiece.snakeCase}}{{/if}}](#{{> components/_helper_anchor_id identifierPieces=(append identifierPieces "oneof" jsonPathPiece.anchorPiece) }}){{/if}} | {{#unless refInfo.refClass}}{{> _helper_schema_python_types }}{{/unless}}{{#if refInfo.refClass}}{{> components/schemas/_helper_refclass_partial }}{{/if}} | {{#unless refInfo.refClass}}{{> components/_helper_schema_accessed_types }}{{/unless}}{{#if refInfo.refClass}}{{> components/schemas/_helper_refclass_partial }}{{/if}} | {{#if description}}{{description}}{{/if}} |{{> components/schemas/_helper_notes_msg defaultUser="server" }} + {{/each}} + {{/if}} + {{#if not}} +{{headerSize}}# not +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- + {{#with not}} +{{#if refInfo.refClass}}{{> components/schemas/_helper_refclass_partial }}{{else}}[{{#if jsonPathPiece.isValid}}{{jsonPathPiece.original}}{{else}}{{jsonPathPiece.snakeCase}}{{/if}}](#{{> components/_helper_anchor_id identifierPieces=(append identifierPieces jsonPathPiece.anchorPiece) }}){{/if}} | {{#unless refInfo.refClass}}{{> _helper_schema_python_types }}{{/unless}}{{#if refInfo.refClass}}{{> components/schemas/_helper_refclass_partial }}{{/if}} | {{#unless refInfo.refClass}}{{> components/_helper_schema_accessed_types }}{{/unless}}{{#if refInfo.refClass}}{{> components/schemas/_helper_refclass_partial }}{{/if}} | {{#if description}}{{description}}{{/if}} |{{> components/schemas/_helper_notes_msg defaultUser="server" }} + {{/with}} + {{/if}} +{{/if}} +{{! Content after here is the deeper/referenced schemas }} +{{! required properties }} +{{#if requiredProperties}} + {{#each requiredProperties}} + {{#if this}} + {{#unless refInfo.refClass}} + {{#if isComplicated}} + +{{> components/schemas/schema_doc schema=this identifierPieces=(append identifierPieces "properties" jsonPathPiece) }} + {{/if}} + {{/unless}} + {{/if}} + {{/each}} +{{/if}} +{{! optional properties }} +{{#if optionalProperties}} + {{#each optionalProperties}} + {{#unless refInfo.refClass}} + {{#if isComplicated}} + +{{> components/schemas/schema_doc schema=this identifierPieces=(append identifierPieces "properties" jsonPathPiece) }} + {{/if}} + {{/unless}} + {{/each}} +{{/if}} +{{! additionalProperties }} +{{#if additionalProperties}} + {{#with additionalProperties}} + {{#unless isBooleanSchemaFalse}} + {{#unless isBooleanSchemaTrue}} + {{#unless refInfo.refClass}} + {{#if isComplicated}} + +{{> components/schemas/schema_doc schema=this identifierPieces=(append identifierPieces jsonPathPiece) }} + {{/if}} + {{/unless}} + {{/unless}} + {{/unless}} + {{/with}} +{{/if}} +{{! items }} +{{#if items}} + {{#with items}} + {{#unless refInfo.refClass}} + {{#if isComplicated}} + +{{> components/schemas/schema_doc schema=this identifierPieces=(append identifierPieces jsonPathPiece) }} + {{/if}} + {{/unless}} + {{/with}} +{{/if}} +{{! allOf/anyOf/oneOf/not }} +{{#if allOf}} + {{#each allOf}} + {{#unless refInfo.refClass}} + +{{> components/schemas/schema_doc schema=this identifierPieces=(append identifierPieces "allof" jsonPathPiece) }} + {{/unless}} + {{/each}} +{{/if}} +{{#if anyOf}} + {{#each anyOf}} + {{#unless refInfo.refClass}} + +{{> components/schemas/schema_doc schema=this identifierPieces=(append identifierPieces "anyof" jsonPathPiece) }} + {{/unless}} + {{/each}} +{{/if}} +{{#if oneOf}} + {{#each oneOf}} + {{#unless refInfo.refClass}} + +{{> components/schemas/schema_doc schema=this identifierPieces=(append identifierPieces "oneof" jsonPathPiece) }} + {{/unless}} + {{/each}} +{{/if}} +{{#if not}} + {{#with not}} + {{#unless refInfo.refClass}} + +{{> components/schemas/schema_doc schema=this identifierPieces=(append identifierPieces jsonPathPiece) }} + {{/unless}} + {{/with}} +{{/if}} +{{#if componentModule}} + +[[Back to top]](#top) {{> _helper_footer_links readmePath="../../../" schemasLink=true}} +{{/if}} +{{/with}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/schema_test.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/schema_test.hbs new file mode 100644 index 00000000000..dc481868581 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/schema_test.hbs @@ -0,0 +1,43 @@ +# coding: utf-8 + +{{> _helper_header }} + +import unittest + +import {{packageName}} +{{#with schema}} +from {{packageName}}.components.schema.{{jsonPathPiece.snakeCase}} import {{jsonPathPiece.camelCase}} +from {{packageName}}.configurations import schema_configuration + + +class Test{{jsonPathPiece.camelCase}}(unittest.TestCase): + """{{jsonPathPiece.camelCase}} unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + +{{#each testCases}} +{{#with this }} + def test_{{@key}}_{{#if valid}}passes{{else}}fails{{/if}}(self): + # {{description}} +{{#if valid}} + {{jsonPathPiece.camelCase}}.from_openapi_data_( +{{#with data}} + {{> components/schemas/_helper_payload_renderer endChar=',' }} +{{/with}} + configuration_=self.configuration_ + ) +{{else}} + with self.assertRaises(({{packageName}}.ApiValueError, {{packageName}}.ApiTypeError)): + {{jsonPathPiece.camelCase}}.from_openapi_data_( +{{#with data}} + {{> components/schemas/_helper_payload_renderer endChar=','}} +{{/with}} + configuration_=self.configuration_ + ) +{{/if}} +{{/with}} + +{{/each}} +{{/with}} + +if __name__ == '__main__': + unittest.main() diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/components/security_schemes/security_scheme.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/components/security_schemes/security_scheme.hbs new file mode 100644 index 00000000000..8a13bfd482d --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/components/security_schemes/security_scheme.hbs @@ -0,0 +1,144 @@ +# coding: utf-8 + +{{> _helper_header }} + +{{#with securityScheme}} + {{#if refInfo}} + {{#if imports}} + + {{/if}} +{{> _helper_imports }} +{{jsonPathPiece.camelCase}} = {{refInfo.refModule}}.{{refInfo.refClass}} + {{else}} +import dataclasses +import typing +import typing_extensions + +from {{packageName}} import security_schemes + + {{#eq type "apiKey"}} +@dataclasses.dataclass +class {{jsonPathPiece.camelCase}}(security_schemes.ApiKeySecurityScheme): + {{#if description}} + ''' + {{description}} + ''' + {{/if}} + name: str = "{{name}}" + {{#eq in "query"}} + in_location: security_schemes.ApiKeyInLocation = security_schemes.ApiKeyInLocation.QUERY + {{else}} + {{#eq in "header"}} + in_location: security_schemes.ApiKeyInLocation = security_schemes.ApiKeyInLocation.HEADER + {{else}} + {{#eq in "cookie"}} + in_location: security_schemes.ApiKeyInLocation = security_schemes.ApiKeyInLocation.COOKIE + {{/eq}} + {{/eq}} + {{/eq}} + {{else}} + {{#eq type "http"}} +@dataclasses.dataclass +class {{jsonPathPiece.camelCase}}(security_schemes.HTTP{{#eq scheme "basic"}}Basic{{/eq}}{{#eq scheme "bearer"}}Bearer{{/eq}}{{#eq scheme "signature"}}Signature{{/eq}}{{#eq scheme "digest"}}Digest{{/eq}}SecurityScheme): + {{#if description}} + ''' + {{description}} + ''' + {{/if}} + {{#eq scheme "bearer"}} + bearer_format = "{{bearerFormat}}" + {{/eq}} + {{else}} + {{#eq type "mutualTLS"}} +@dataclasses.dataclass +class {{jsonPathPiece.camelCase}}(security_schemes.MutualTLSSecurityScheme): + {{#if description}} + ''' + {{description}} + ''' + {{else}} + pass + {{/if}} + {{else}} + {{#eq type "oauth2"}} +@dataclasses.dataclass +class {{jsonPathPiece.camelCase}}(security_schemes.OAuth2SecurityScheme): + {{#if description}} + ''' + {{description}} + ''' + {{/if}} + flows = security_schemes.OAuthFlows( + {{#with flows}} + {{#with implicit}} + implicit=security_schemes.ImplicitOAuthFlow( + authorization_url="{{authorizationUrl}}", + scopes={ + {{#each scopes}} + "{{@key}}": "{{this}}", + {{/each}} + }, + {{#if refreshUrl}} + refresh_url="{{refreshUrl}}" + {{/if}} + ) + {{/with}} + {{#with password}} + password=security_schemes.TokenUrlOauthFlow( + token_url="{{tokenUrl}}", + scopes={ + {{#each scopes}} + "{{@key}}": "{{this}}", + {{/each}} + }, + {{#if refreshUrl}} + refresh_url="{{refreshUrl}}" + {{/if}} + ) + {{/with}} + {{#with clientCredentials}} + client_credentials=security_schemes.TokenUrlOauthFlow( + token_url="{{tokenUrl}}", + scopes={ + {{#each scopes}} + "{{@key}}": "{{this}}", + {{/each}} + }, + {{#if refreshUrl}} + refresh_url="{{refreshUrl}}", + {{/if}} + ) + {{/with}} + {{#with authorizationCode}} + authorization_code=security_schemes.AuthorizationCodeOauthFlow( + authorization_url="{{authorizationUrl}}", + token_url="{{tokenUrl}}", + scopes={ + {{#each scopes}} + "{{@key}}": "{{this}}", + {{/each}} + }, + {{#if refreshUrl}} + refresh_url="{{refreshUrl}}" + {{/if}} + ) + {{/with}} + {{/with}} + ) + {{else}} + {{#eq type "openIdConnect"}} +@dataclasses.dataclass +class {{jsonPathPiece.camelCase}}(security_schemes.OpenIdConnectSecurityScheme): + {{#if description}} + ''' + {{description}} + ''' + {{/if}} + openid_connect_url = "{{openIdConnectUrl}}" + {{/eq}} + {{/eq}} + {{/eq}} + {{/eq}} + {{/eq}} + {{/if}} +{{/with}} diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/components/security_schemes/security_scheme_doc.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/components/security_schemes/security_scheme_doc.hbs new file mode 100644 index 00000000000..5200faa9855 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/components/security_schemes/security_scheme_doc.hbs @@ -0,0 +1,182 @@ +{{#with securityScheme}} + {{#if componentModule}} +{{packageName}}.components.security_schemes.{{jsonPathPiece.snakeCase}} + {{/if}} + {{#eq identifierPieces.size 0}} +{{> components/_helper_header_from_identifier_pieces identifierPieces=(append identifierPieces "SecurityScheme" jsonPathPiece) }} + {{/eq}} + {{#if description}} + +{{headerSize}}# Description +{{description}} + {{/if}} + {{#if refInfo}} +| Ref Class | Description | +| --------- | ----------- | +| [{{refInfo.refClass}}](../../components/security_schemes/{{refInfo.refModule}}.{{refInfo.refClass}}.md#) |{{#with getDeepestRef}}{{#if description}} {{description}}{{/if}}{{/with}} + {{else}} + +{{headerSize}}# Type + {{#eq type "apiKey"}} +security_schemes.SecuritySchemeType.API_KEY + +{{headerSize}}# Name +"{{name}}" + +{{headerSize}}# api_key +Type | Notes +---- | ------ +str | Set by the developer + +{{headerSize}}# In Location + {{#eq in "query"}} +security_schemes.ApiKeyInLocation.QUERY + {{else}} + {{#eq in "header"}} +security_schemes.ApiKeyInLocation.HEADER + {{else}} + {{#eq in "cookie"}} +security_schemes.ApiKeyInLocation.COOKIE + {{/eq}} + {{/eq}} + {{/eq}} + {{else}} + {{#eq type "http"}} +security_schemes.SecuritySchemeType.HTTP + {{#eq scheme "basic"}} + +{{headerSize}}# Scheme +security_schemes.HTTPSchemeType.BASIC + +{{headerSize}}# user_id +Type | Notes +---- | ------ +str | Set by the developer + +{{headerSize}}# password +Type | Notes +---- | ------ +str | Set by the developer + {{else}} + {{#eq scheme "bearer"}} + +{{headerSize}}# Scheme +security_schemes.HTTPSchemeType.BEARER + {{#if bearerFormat}} + +{{headerSize}}# Bearer Format +"{{bearerFormat}}" + {{/if}} + +{{headerSize}}# access_token +Type | Notes +---- | ------ +str | Set by the developer + {{else}} + {{#eq scheme "digest"}} + +{{headerSize}}# Scheme +security_schemes.HTTPSchemeType.DIGEST + {{else}} + {{#eq scheme "signature"}} + +{{headerSize}}# Scheme +security_schemes.HTTPSchemeType.SIGNATURE + +{{headerSize}}# signing_info +Type | Notes +---- | ------ +{{packageName}}.signing.HttpSigningConfiguration | Set by the developer + {{/eq}} + {{/eq}} + {{/eq}} + {{/eq}} + {{else}} + {{#eq type "mutualTLS"}} +security_schemes.SecuritySchemeType.MUTUAL_TLS + {{else}} + {{#eq type "oauth2"}} +security_schemes.SecuritySchemeType.OAUTH_2 + +{{headerSize}}# Flows + {{#with flows}} + {{#with implicit}} +{{headerSize}}# Implicit Flow + {{#if refreshUrl}} +{{headerSize}}## Refresh Url +"{{refreshUrl}}" + {{/if}} +{{headerSize}}## Scopes +Scope Name | Scope Description +| -------- | ---------------- | + {{#each scopes}} +"{{@key}}" | {{this}} + {{/each}} +{{headerSize}}## Authorization Url +"{{authorizationUrl}}" + {{/with}} + {{#with password}} +{{headerSize}}# Password Flow + {{#if refreshUrl}} +{{headerSize}}## Refresh Url +"{{refreshUrl}}" + {{/if}} +{{headerSize}}## Scopes +Scope Name | Scope Description +| -------- | ---------------- | + {{#each scopes}} +"{{@key}}" | {{this}} + {{/each}} +{{headerSize}}## Token Url +"{{tokenUrl}}" + {{/with}} + {{#with clientCredentials}} +{{headerSize}}# ClientCredentials Flow + {{#if refreshUrl}} +{{headerSize}}## Refresh Url +"{{refreshUrl}}" + {{/if}} +{{headerSize}}## Scopes +Scope Name | Scope Description +| -------- | ---------------- | + {{#each scopes}} +"{{@key}}" | {{this}} + {{/each}} +{{headerSize}}## Token Url +"{{tokenUrl}}" + {{/with}} + {{#with authorizationCode}} +{{headerSize}}# AuthorizationCode Flow + {{#if refreshUrl}} +{{headerSize}}## Refresh Url +"{{refreshUrl}}" + {{/if}} +{{headerSize}}## Scopes +Scope Name | Scope Description +| -------- | ---------------- | + {{#each scopes}} +"{{@key}}" | {{this}} + {{/each}} +{{headerSize}}## Authorization Url +"{{authorizationUrl}}" +{{headerSize}}## Token Url +"{{tokenUrl}}" + {{/with}} + {{/with}} + {{else}} + {{#eq type "openIdConnect"}} +security_schemes.SecuritySchemeType.OPENID_CONNECT + +{{headerSize}}# OpenIdConnect Url +"{{openIdConnectUrl}}" + {{/eq}} + {{/eq}} + {{/eq}} + {{/eq}} + {{/eq}} + {{#if componentModule}} + +[[Back to top]](#top) {{> _helper_footer_links readmePath="../../../" securitySchemesLink=true}} + {{/if}} + {{/if}} +{{/with}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/configuration.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/configuration.handlebars deleted file mode 100644 index 7e311be3bf4..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/configuration.handlebars +++ /dev/null @@ -1,633 +0,0 @@ -# coding: utf-8 - -{{>partial_header}} - -import copy -import logging -{{#unless asyncio}} -import multiprocessing -{{/unless}} -import sys -import urllib3 - -from http import client as http_client -from {{packageName}}.exceptions import ApiValueError - - -JSON_SCHEMA_VALIDATION_KEYWORDS = { - 'multipleOf', 'maximum', 'exclusiveMaximum', - 'minimum', 'exclusiveMinimum', 'maxLength', - 'minLength', 'pattern', 'maxItems', 'minItems', - 'uniqueItems', 'maxProperties', 'minProperties', -} - -class Configuration(object): - """NOTE: This class is auto generated by OpenAPI Generator - - Ref: https://openapi-generator.tech - Do not edit the class manually. - - :param host: Base url - :param api_key: Dict to store API key(s). - Each entry in the dict specifies an API key. - The dict key is the name of the security scheme in the OAS specification. - The dict value is the API key secret. - :param api_key_prefix: Dict to store API prefix (e.g. Bearer) - The dict key is the name of the security scheme in the OAS specification. - The dict value is an API key prefix when generating the auth data. - :param username: Username for HTTP basic authentication - :param password: Password for HTTP basic authentication - :param disabled_client_side_validations (string): Comma-separated list of - JSON schema validation keywords to disable JSON schema structural validation - rules. The following keywords may be specified: multipleOf, maximum, - exclusiveMaximum, minimum, exclusiveMinimum, maxLength, minLength, pattern, - maxItems, minItems. - By default, the validation is performed for data generated locally by the client - and data received from the server, independent of any validation performed by - the server side. If the input data does not satisfy the JSON schema validation - rules specified in the OpenAPI document, an exception is raised. - If disabled_client_side_validations is set, structural validation is - disabled. This can be useful to troubleshoot data validation problem, such as - when the OpenAPI document validation rules do not match the actual API data - received by the server. -{{#if hasHttpSignatureMethods}} - :param signing_info: Configuration parameters for the HTTP signature security scheme. - Must be an instance of {{{packageName}}}.signing.HttpSigningConfiguration -{{/if}} - :param server_index: Index to servers configuration. - :param server_variables: Mapping with string values to replace variables in - templated server configuration. The validation of enums is performed for - variables with defined enum values before. - :param server_operation_index: Mapping from operation ID to an index to server - configuration. - :param server_operation_variables: Mapping from operation ID to a mapping with - string values to replace variables in templated server configuration. - The validation of enums is performed for variables with defined enum values before. - -{{#if hasAuthMethods}} - :Example: -{{#if hasApiKeyMethods}} - - API Key Authentication Example. - Given the following security scheme in the OpenAPI specification: - components: - securitySchemes: - cookieAuth: # name for the security scheme - type: apiKey - in: cookie - name: JSESSIONID # cookie name - - You can programmatically set the cookie: - -conf = {{{packageName}}}.Configuration( - api_key={'cookieAuth': 'abc123'} - api_key_prefix={'cookieAuth': 'JSESSIONID'} -) - - The following cookie will be added to the HTTP request: - Cookie: JSESSIONID abc123 -{{/if}} -{{#if hasHttpBasicMethods}} - - HTTP Basic Authentication Example. - Given the following security scheme in the OpenAPI specification: - components: - securitySchemes: - http_basic_auth: - type: http - scheme: basic - - Configure API client with HTTP basic authentication: - -conf = {{{packageName}}}.Configuration( - username='the-user', - password='the-password', -) - -{{/if}} -{{#if hasHttpSignatureMethods}} - - HTTP Signature Authentication Example. - Given the following security scheme in the OpenAPI specification: - components: - securitySchemes: - http_basic_auth: - type: http - scheme: signature - - Configure API client with HTTP signature authentication. Use the 'hs2019' signature scheme, - sign the HTTP requests with the RSA-SSA-PSS signature algorithm, and set the expiration time - of the signature to 5 minutes after the signature has been created. - Note you can use the constants defined in the {{{packageName}}}.signing module, and you can - also specify arbitrary HTTP headers to be included in the HTTP signature, except for the - 'Authorization' header, which is used to carry the signature. - - One may be tempted to sign all headers by default, but in practice it rarely works. - This is beccause explicit proxies, transparent proxies, TLS termination endpoints or - load balancers may add/modify/remove headers. Include the HTTP headers that you know - are not going to be modified in transit. - -conf = {{{packageName}}}.Configuration( - signing_info = {{{packageName}}}.signing.HttpSigningConfiguration( - key_id = 'my-key-id', - private_key_path = 'rsa.pem', - signing_scheme = {{{packageName}}}.signing.SCHEME_HS2019, - signing_algorithm = {{{packageName}}}.signing.ALGORITHM_RSASSA_PSS, - signed_headers = [{{{packageName}}}.signing.HEADER_REQUEST_TARGET, - {{{packageName}}}.signing.HEADER_CREATED, - {{{packageName}}}.signing.HEADER_EXPIRES, - {{{packageName}}}.signing.HEADER_HOST, - {{{packageName}}}.signing.HEADER_DATE, - {{{packageName}}}.signing.HEADER_DIGEST, - 'Content-Type', - 'User-Agent' - ], - signature_max_validity = datetime.timedelta(minutes=5) - ) -) -{{/if}} -{{/if}} - """ - - _default = None - - def __init__( - self, - host=None, -{{#if hasApiKeyMethods}} - api_key=None, - api_key_prefix=None, -{{/if}} -{{#if hasHttpBasicMethods}} - username=None, - password=None, -{{/if}} - disabled_client_side_validations="", -{{#if hasHttpSignatureMethods}} - signing_info=None, -{{/if}} - server_index=None, - server_variables=None, - server_operation_index=None, - server_operation_variables=None, -{{#or hasOAuthMethods hasBearerMethods}} - access_token=None, -{{/or}} - ): - """Constructor - """ - self._base_path = "{{{basePath}}}" if host is None else host - """Default Base url - """ - self.server_index = 0 if server_index is None and host is None else server_index - self.server_operation_index = server_operation_index or {} - """Default server index - """ - self.server_variables = server_variables or {} - self.server_operation_variables = server_operation_variables or {} - """Default server variables - """ - self.temp_folder_path = None - """Temp file folder for downloading files - """ - # Authentication Settings -{{#if hasApiKeyMethods}} - self.api_key = {} - if api_key: - self.api_key = api_key - """dict to store API key(s) - """ - self.api_key_prefix = {} - if api_key_prefix: - self.api_key_prefix = api_key_prefix - """dict to store API prefix (e.g. Bearer) - """ - self.refresh_api_key_hook = None - """function hook to refresh API key if expired - """ -{{/if}} -{{#if hasHttpBasicMethods}} - self.username = username - """Username for HTTP basic authentication - """ - self.password = password - """Password for HTTP basic authentication - """ -{{/if}} - self.disabled_client_side_validations = disabled_client_side_validations -{{#if hasHttpSignatureMethods}} - if signing_info is not None: - signing_info.host = host - self.signing_info = signing_info - """The HTTP signing configuration - """ -{{/if}} -{{#or hasOAuthMethods hasBearerMethods}} - self.access_token = access_token - """access token for OAuth/Bearer - """ -{{/or}} - self.logger = {} - """Logging Settings - """ - self.logger["package_logger"] = logging.getLogger("{{packageName}}") - self.logger["urllib3_logger"] = logging.getLogger("urllib3") - self.logger_format = '%(asctime)s %(levelname)s %(message)s' - """Log format - """ - self.logger_stream_handler = None - """Log stream handler - """ - self.logger_file_handler = None - """Log file handler - """ - self.logger_file = None - """Debug file location - """ - self.debug = False - """Debug switch - """ - - self.verify_ssl = True - """SSL/TLS verification - Set this to false to skip verifying SSL certificate when calling API - from https server. - """ - self.ssl_ca_cert = None - """Set this to customize the certificate file to verify the peer. - """ - self.cert_file = None - """client certificate file - """ - self.key_file = None - """client key file - """ - self.assert_hostname = None - """Set this to True/False to enable/disable SSL hostname verification. - """ - - {{#if asyncio}} - self.connection_pool_maxsize = 100 - """This value is passed to the aiohttp to limit simultaneous connections. - Default values is 100, None means no-limit. - """ - {{/if}} - {{#unless asyncio}} - self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 - """urllib3 connection pool's maximum number of connections saved - per pool. urllib3 uses 1 connection as default value, but this is - not the best value when you are making a lot of possibly parallel - requests to the same host, which is often the case here. - cpu_count * 5 is used as default value to increase performance. - """ - {{/unless}} - - self.proxy = None - """Proxy URL - """ - self.proxy_headers = None - """Proxy headers - """ - self.safe_chars_for_path_param = '' - """Safe chars for path_param - """ - self.retries = None - """Adding retries to override urllib3 default value 3 - """ - # Enable client side validation - self.client_side_validation = True - - # Options to pass down to the underlying urllib3 socket - self.socket_options = None - - def __deepcopy__(self, memo): - cls = self.__class__ - result = cls.__new__(cls) - memo[id(self)] = result - for k, v in self.__dict__.items(): - if k not in ('logger', 'logger_file_handler'): - setattr(result, k, copy.deepcopy(v, memo)) - # shallow copy of loggers - result.logger = copy.copy(self.logger) - # use setters to configure loggers - result.logger_file = self.logger_file - result.debug = self.debug - return result - - def __setattr__(self, name, value): - object.__setattr__(self, name, value) - if name == 'disabled_client_side_validations': - s = set(filter(None, value.split(','))) - for v in s: - if v not in JSON_SCHEMA_VALIDATION_KEYWORDS: - raise ApiValueError( - "Invalid keyword: '{0}''".format(v)) - self._disabled_client_side_validations = s -{{#if hasHttpSignatureMethods}} - if name == "signing_info" and value is not None: - # Ensure the host paramater from signing info is the same as - # Configuration.host. - value.host = self.host -{{/if}} - - @classmethod - def set_default(cls, default): - """Set default instance of configuration. - - It stores default configuration, which can be - returned by get_default_copy method. - - :param default: object of Configuration - """ - cls._default = copy.deepcopy(default) - - @classmethod - def get_default_copy(cls): - """Return new instance of configuration. - - This method returns newly created, based on default constructor, - object of Configuration class or returns a copy of default - configuration passed by the set_default method. - - :return: The configuration object. - """ - if cls._default is not None: - return copy.deepcopy(cls._default) - return Configuration() - - @property - def logger_file(self): - """The logger file. - - If the logger_file is None, then add stream handler and remove file - handler. Otherwise, add file handler and remove stream handler. - - :param value: The logger_file path. - :type: str - """ - return self.__logger_file - - @logger_file.setter - def logger_file(self, value): - """The logger file. - - If the logger_file is None, then add stream handler and remove file - handler. Otherwise, add file handler and remove stream handler. - - :param value: The logger_file path. - :type: str - """ - self.__logger_file = value - if self.__logger_file: - # If set logging file, - # then add file handler and remove stream handler. - self.logger_file_handler = logging.FileHandler(self.__logger_file) - self.logger_file_handler.setFormatter(self.logger_formatter) - for _, logger in self.logger.items(): - logger.addHandler(self.logger_file_handler) - - @property - def debug(self): - """Debug status - - :param value: The debug status, True or False. - :type: bool - """ - return self.__debug - - @debug.setter - def debug(self, value): - """Debug status - - :param value: The debug status, True or False. - :type: bool - """ - self.__debug = value - if self.__debug: - # if debug status is True, turn on debug logging - for _, logger in self.logger.items(): - logger.setLevel(logging.DEBUG) - # turn on http_client debug - http_client.HTTPConnection.debuglevel = 1 - else: - # if debug status is False, turn off debug logging, - # setting log level to default `logging.WARNING` - for _, logger in self.logger.items(): - logger.setLevel(logging.WARNING) - # turn off http_client debug - http_client.HTTPConnection.debuglevel = 0 - - @property - def logger_format(self): - """The logger format. - - The logger_formatter will be updated when sets logger_format. - - :param value: The format string. - :type: str - """ - return self.__logger_format - - @logger_format.setter - def logger_format(self, value): - """The logger format. - - The logger_formatter will be updated when sets logger_format. - - :param value: The format string. - :type: str - """ - self.__logger_format = value - self.logger_formatter = logging.Formatter(self.__logger_format) - - def get_api_key_with_prefix(self, identifier, alias=None): - """Gets API key (with prefix if set). - - :param identifier: The identifier of apiKey. - :param alias: The alternative identifier of apiKey. - :return: The token for api key authentication. - """ - if self.refresh_api_key_hook is not None: - self.refresh_api_key_hook(self) - key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None) - if key: - prefix = self.api_key_prefix.get(identifier) - if prefix: - return "%s %s" % (prefix, key) - else: - return key - - def get_basic_auth_token(self): - """Gets HTTP basic authentication header (string). - - :return: The token for basic HTTP authentication. - """ - username = "" - if self.username is not None: - username = self.username - password = "" - if self.password is not None: - password = self.password - return urllib3.util.make_headers( - basic_auth=username + ':' + password - ).get('authorization') - - def auth_settings(self): - """Gets Auth Settings dict for api client. - - :return: The Auth Settings information dict. - """ - auth = {} -{{#each authMethods}} -{{#if isApiKey}} - if '{{name}}' in self.api_key{{#each vendorExtensions.x-auth-id-alias}} or '{{.}}' in self.api_key{{/each}}: - auth['{{name}}'] = { - 'type': 'api_key', - 'in': {{#if isKeyInCookie}}'cookie'{{/if}}{{#if isKeyInHeader}}'header'{{/if}}{{#if isKeyInQuery}}'query'{{/if}}, - 'key': '{{keyParamName}}', - 'value': self.get_api_key_with_prefix( - '{{name}}',{{#each vendorExtensions.x-auth-id-alias}} - alias='{{.}}',{{/each}} - ), - } -{{/if}} -{{#if isBasic}} - {{#if isBasicBasic}} - if self.username is not None and self.password is not None: - auth['{{name}}'] = { - 'type': 'basic', - 'in': 'header', - 'key': 'Authorization', - 'value': self.get_basic_auth_token() - } - {{/if}} - {{#if isBasicBearer}} - if self.access_token is not None: - auth['{{name}}'] = { - 'type': 'bearer', - 'in': 'header', - {{#if bearerFormat}} - 'format': '{{{bearerFormat}}}', - {{/if}} - 'key': 'Authorization', - 'value': 'Bearer ' + self.access_token - } - {{/if}} - {{#if isHttpSignature}} - if self.signing_info is not None: - auth['{{name}}'] = { - 'type': 'http-signature', - 'in': 'header', - 'key': 'Authorization', - 'value': None # Signature headers are calculated for every HTTP request - } - {{/if}} -{{/if}} -{{#if isOAuth}} - if self.access_token is not None: - auth['{{name}}'] = { - 'type': 'oauth2', - 'in': 'header', - 'key': 'Authorization', - 'value': 'Bearer ' + self.access_token - } -{{/if}} -{{/each}} - return auth - - def to_debug_report(self): - """Gets the essential information for debugging. - - :return: The report for debugging. - """ - return "Python SDK Debug Report:\n"\ - "OS: {env}\n"\ - "Python Version: {pyversion}\n"\ - "Version of the API: {{version}}\n"\ - "SDK Package Version: {{packageVersion}}".\ - format(env=sys.platform, pyversion=sys.version) - - def get_host_settings(self): - """Gets an array of host settings - - :return: An array of host settings - """ - return [ - {{#each servers}} - { - 'url': "{{{url}}}", - 'description': "{{#unless description}}No description provided{{else}}{{{description}}}{{/unless}}", - {{#each variables}} - {{#if @first}} - 'variables': { - {{/if}} - '{{{name}}}': { - 'description': "{{#unless description}}No description provided{{else}}{{{description}}}{{/unless}}", - 'default_value': "{{{defaultValue}}}", - {{#each enumValues}} - {{#if @first}} - 'enum_values': [ - {{/if}} - "{{{.}}}"{{#unless @last}},{{/unless}} - {{#if @last}} - ] - {{/if}} - {{/each}} - }{{#unless @last}},{{/unless}} - {{#if @last}} - } - {{/if}} - {{/each}} - }{{#unless @last}},{{/unless}} - {{/each}} - ] - - def get_host_from_settings(self, index, variables=None, servers=None): - """Gets host URL based on the index and variables - :param index: array index of the host settings - :param variables: hash of variable and the corresponding value - :param servers: an array of host settings or None - :return: URL based on host settings - """ - if index is None: - return self._base_path - - variables = {} if variables is None else variables - servers = self.get_host_settings() if servers is None else servers - - try: - server = servers[index] - except IndexError: - raise ValueError( - "Invalid index {0} when selecting the host settings. " - "Must be less than {1}".format(index, len(servers))) - - url = server['url'] - - # go through variables and replace placeholders - for variable_name, variable in server.get('variables', {}).items(): - used_value = variables.get( - variable_name, variable['default_value']) - - if 'enum_values' in variable \ - and used_value not in variable['enum_values']: - raise ValueError( - "The variable `{0}` in the host URL has invalid value " - "{1}. Must be {2}.".format( - variable_name, variables[variable_name], - variable['enum_values'])) - - url = url.replace("{" + variable_name + "}", used_value) - - return url - - @property - def host(self): - """Return generated host.""" - return self.get_host_from_settings(self.server_index, variables=self.server_variables) - - @host.setter - def host(self, value): - """Fix base path.""" - self._base_path = value - self.server_index = None diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/configurations/api_configuration.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/configurations/api_configuration.hbs new file mode 100644 index 00000000000..fe1c28fa8f0 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/configurations/api_configuration.hbs @@ -0,0 +1,436 @@ +# coding: utf-8 + +{{> _helper_header }} + +import copy +from http import client as http_client +import logging +{{#unless asyncio}} +import multiprocessing +{{/unless}} +import sys +import typing +{{#or securitySchemes hasServers}} +import typing_extensions +{{/or}} + +import urllib3 + +from {{packageName}} import exceptions +{{#if securitySchemes}} +from {{packageName}} import security_schemes + {{#each securitySchemes}} +from {{packageName}}.components.security_schemes import {{jsonPathPiece.snakeCase}} + {{/each}} +{{/if}} +{{#if hasServers}} + {{#each servers}} +from {{packageName}}.servers import {{jsonPathPiece.snakeCase}} + {{/each}} + {{#each paths}} + {{#if servers}} + {{#each servers}} +from {{packageName}}.paths.{{../@key.snakeCase}}.servers import {{jsonPathPiece.snakeCase}} as {{../@key.snakeCase}}_{{jsonPathPiece.snakeCase}} + {{/each}} + {{/if}} + {{#if operations}} + {{#each operations}} + {{#if servers}} + {{#each servers}} +from {{packageName}}.paths.{{../../@key.snakeCase}}.{{../@key.original}}.servers import {{jsonPathPiece.snakeCase}} as {{../../@key.snakeCase}}_{{../@key.original}}_{{jsonPathPiece.snakeCase}} + {{/each}} + {{/if}} + {{/each}} + {{/if}} + {{/each}} +{{/if}} +{{#if securitySchemes}} + +# security scheme key identifier to security scheme instance +SecuritySchemeInfo = typing_extensions.TypedDict( + 'SecuritySchemeInfo', + { +{{#each securitySchemes}} + "{{{@key}}}": {{jsonPathPiece.snakeCase}}.{{jsonPathPiece.camelCase}}, +{{/each}} + }, + total=False +) + +""" +the default security_index to use at each openapi document json path +the fallback value is stored in the 'security' key +""" +SecurityIndexInfo = typing_extensions.TypedDict( + 'SecurityIndexInfo', + { +{{#if security}} + 'security': typing_extensions.Literal[{{#each security}}{{#unless @first}}, {{/unless}}{{@key}}{{/each}}], +{{else}} + 'security': int, +{{/if}} +{{#each paths}} + {{#if operations}} + {{#each operations}} + {{#if security}} + "paths/{{../@key.original}}/{{@key.original}}/security": typing_extensions.Literal[{{#each security}}{{#unless @first}}, {{/unless}}{{@key}}{{/each}}], + {{/if}} + {{/each}} + {{/if}} +{{/each}} + }, + total=False +) +{{/if}} +{{#if hasServers}} + +# the server to use at each openapi document json path +ServerInfo = typing_extensions.TypedDict( + 'ServerInfo', + { +{{#each servers}} + 'servers/{{@key}}': {{jsonPathPiece.snakeCase}}.{{jsonPathPiece.camelCase}}, +{{/each}} +{{#each paths}} + {{#if servers}} + {{#each servers}} + "paths/{{../@key.original}}/servers/{{@key}}": {{../@key.snakeCase}}_{{jsonPathPiece.snakeCase}}.{{jsonPathPiece.camelCase}}, + {{/each}} + {{/if}} + {{#if operations}} + {{#each operations}} + {{#if servers}} + {{#each servers}} + "paths/{{../../@key.original}}/{{../@key.original}}/servers/{{@key}}": {{../../@key.snakeCase}}_{{../@key.original}}_{{jsonPathPiece.snakeCase}}.{{jsonPathPiece.camelCase}}, + {{/each}} + {{/if}} + {{/each}} + {{/if}} +{{/each}} + }, + total=False +) + +""" +the default server_index to use at each openapi document json path +the fallback value is stored in the 'servers' key +""" +ServerIndexInfo = typing_extensions.TypedDict( + 'ServerIndexInfo', + { +{{#if servers}} + 'servers': typing_extensions.Literal[{{#each servers}}{{#unless @first}}, {{/unless}}{{@key}}{{/each}}], +{{else}} + 'servers': int, +{{/if}} +{{#each paths}} + {{#if servers}} + "paths/{{@key.original}}/servers": typing_extensions.Literal[{{#each servers}}{{#unless @first}}, {{/unless}}{{@key}}{{/each}}], + {{/if}} + {{#if operations}} + {{#each operations}} + {{#if servers}} + "paths/{{../@key.original}}/{{@key.original}}/servers": typing_extensions.Literal[{{#each servers}}{{#unless @first}}, {{/unless}}{{@key}}{{/each}}], + {{/if}} + {{/each}} + {{/if}} +{{/each}} + }, + total=False +) +{{/if}} + + +class ApiConfiguration(object): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator + + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + Do not edit the class manually. + +{{#if securitySchemes}} + :param security_scheme_info: the security scheme auth info that can be used when calling endpoints + The key is a string that identifies the component security scheme that one is adding auth info for + The value is an instance of the component security scheme class for that security scheme + See the SecuritySchemeInfo TypedDict definition + :param security_index_info: path to security_index information +{{/if}} +{{#if hasServers}} + :param server_info: the servers that can be used to make endpoint calls + :param server_index_info: index to servers configuration +{{/if}} + """ + + def __init__( + self, +{{#if securitySchemes}} + security_scheme_info: typing.Optional[SecuritySchemeInfo] = None, + security_index_info: typing.Optional[SecurityIndexInfo] = None, +{{/if}} +{{#if hasServers}} + server_info: typing.Optional[ServerInfo] = None, + server_index_info: typing.Optional[ServerIndexInfo] = None, +{{/if}} + ): + """Constructor + """ + # Authentication Settings +{{#if securitySchemes}} + self.security_scheme_info: SecuritySchemeInfo = security_scheme_info or SecuritySchemeInfo() + self.security_index_info: SecurityIndexInfo = security_index_info or {'security': 0} +{{else}} + self.security_scheme_info: {} + self.security_index_info = {'security': 0} +{{/if}} + # Server Info +{{#if hasServers}} + self.server_info: ServerInfo = server_info or { + {{#each servers}} + 'servers/{{@key}}': {{jsonPathPiece.snakeCase}}.{{jsonPathPiece.camelCase}}(), + {{/each}} + {{#each paths}} + {{#if servers}} + {{#each servers}} + "paths/{{../@key.original}}/servers/{{@key}}": {{../@key.snakeCase}}_{{jsonPathPiece.snakeCase}}.{{jsonPathPiece.camelCase}}(), + {{/each}} + {{/if}} + {{#if operations}} + {{#each operations}} + {{#if servers}} + {{#each servers}} + "paths/{{../../@key.original}}/{{../@key.original}}/servers/{{@key}}": {{../../@key.snakeCase}}_{{../@key.original}}_{{jsonPathPiece.snakeCase}}.{{jsonPathPiece.camelCase}}(), + {{/each}} + {{/if}} + {{/each}} + {{/if}} + {{/each}} + } + self.server_index_info: ServerIndexInfo = server_index_info or {'servers': 0} +{{else}} + self.server_info = {} + self.server_index_info = {'servers': 0} +{{/if}} + self.logger = {} + """Logging Settings + """ + self.logger["package_logger"] = logging.getLogger("{{packageName}}") + self.logger["urllib3_logger"] = logging.getLogger("urllib3") + self.logger_format = '%(asctime)s %(levelname)s %(message)s' + """Log format + """ + self.logger_stream_handler = None + """Log stream handler + """ + self.logger_file_handler = None + """Log file handler + """ + self.logger_file = None + """Debug file location + """ + self.debug = False + """Debug switch + """ + + self.verify_ssl = True + """SSL/TLS verification + Set this to false to skip verifying SSL certificate when calling API + from https server. + """ + self.ssl_ca_cert = None + """Set this to customize the certificate file to verify the peer. + """ + self.cert_file = None + """client certificate file + """ + self.key_file = None + """client key file + """ + self.assert_hostname = None + """Set this to True/False to enable/disable SSL hostname verification. + """ + + {{#if asyncio}} + self.connection_pool_maxsize = 100 + """This value is passed to the aiohttp to limit simultaneous connections. + Default values is 100, None means no-limit. + """ + {{/if}} + {{#unless asyncio}} + self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 + """urllib3 connection pool's maximum number of connections saved + per pool. urllib3 uses 1 connection as default value, but this is + not the best value when you are making a lot of possibly parallel + requests to the same host, which is often the case here. + cpu_count * 5 is used as default value to increase performance. + """ + {{/unless}} + + self.proxy = None + """Proxy URL + """ + self.proxy_headers = None + """Proxy headers + """ + self.safe_chars_for_path_param = '' + """Safe chars for path_param + """ + self.retries = None + """Adding retries to override urllib3 default value 3 + """ + # Enable client side validation + self.client_side_validation = True + + # Options to pass down to the underlying urllib3 socket + self.socket_options = None + + def __deepcopy__(self, memo): + cls = self.__class__ + result = cls.__new__(cls) + memo[id(self)] = result + for k, v in self.__dict__.items(): + if k not in ('logger', 'logger_file_handler'): + setattr(result, k, copy.deepcopy(v, memo)) + # shallow copy of loggers + result.logger = copy.copy(self.logger) + # use setters to configure loggers + result.logger_file = self.logger_file + result.debug = self.debug + return result + + @property + def logger_file(self): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + return self.__logger_file + + @logger_file.setter + def logger_file(self, value): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + self.__logger_file = value + if self.__logger_file: + # If set logging file, + # then add file handler and remove stream handler. + self.logger_file_handler = logging.FileHandler(self.__logger_file) + self.logger_file_handler.setFormatter(self.logger_formatter) + for _, logger in self.logger.items(): + logger.addHandler(self.logger_file_handler) + + @property + def debug(self): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + return self.__debug + + @debug.setter + def debug(self, value): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + self.__debug = value + if self.__debug: + # if debug status is True, turn on debug logging + for _, logger in self.logger.items(): + logger.setLevel(logging.DEBUG) + # turn on http_client debug + http_client.HTTPConnection.debuglevel = 1 + else: + # if debug status is False, turn off debug logging, + # setting log level to default `logging.WARNING` + for _, logger in self.logger.items(): + logger.setLevel(logging.WARNING) + # turn off http_client debug + http_client.HTTPConnection.debuglevel = 0 + + @property + def logger_format(self): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + return self.__logger_format + + @logger_format.setter + def logger_format(self, value): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + self.__logger_format = value + self.logger_formatter = logging.Formatter(self.__logger_format) + + def to_debug_report(self): + """Gets the essential information for debugging. + + :return: The report for debugging. + """ + return "Python SDK Debug Report:\n"\ + "OS: {env}\n"\ + "Python Version: {pyversion}\n"\ + "Version of the API: {{version}}\n"\ + "SDK Package Version: {{packageVersion}}".\ + format(env=sys.platform, pyversion=sys.version) + + def get_server_url( + self, + key_prefix: str, + index: typing.Optional[int], + ) -> str: + """Gets host URL based on the index + :param index: array index of the host settings + :return: URL based on host settings + """ + if index: + used_index = index + else: + try: + used_index = self.server_index_info[key_prefix] + except KeyError: + # fallback and use the default index + used_index = self.server_index_info["servers"] + server = self.server_info[f"{key_prefix}/{used_index}"] + return server.url +{{#if securitySchemes}} + + def get_security_requirement_object( + self, + key_prefix: str, + security_requirement_objects: typing.List[security_schemes.SecurityRequirementObject], + index: typing.Optional[int], + ) -> security_schemes.SecurityRequirementObject: + """Gets security_schemes.SecurityRequirementObject based on the index + :param index: array index of the SecurityRequirementObject + :return: the selected security_schemes.SecurityRequirementObject + """ + if index: + used_index = index + else: + try: + used_index = self.security_index_info[key_prefix] + except KeyError: + # fallback and use the default index + used_index = self.security_index_info["security"] + return security_requirement_objects[used_index] +{{/if}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/configurations/schema_configuration.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/configurations/schema_configuration.hbs new file mode 100644 index 00000000000..5ddb7a4eade --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/configurations/schema_configuration.hbs @@ -0,0 +1,91 @@ +# coding: utf-8 + +{{> _helper_header }} + +import typing + +from {{packageName}} import exceptions + + +PYTHON_KEYWORD_TO_JSON_SCHEMA_KEYWORD = { + 'types': 'type', + 'enum_value_to_name': 'enum', + 'unique_items': 'uniqueItems', + 'min_items': 'minItems', + 'max_items': 'maxItems', + 'min_properties': 'minProperties', + 'max_properties': 'maxProperties', + 'min_length': 'minLength', + 'max_length': 'maxLength', + 'inclusive_minimum': 'minimum', + 'exclusive_minimum': 'exclusiveMinimum', + 'inclusive_maximum': 'maximum', + 'exclusive_maximum': 'exclusiveMaximum', + 'multiple_of': 'multipleOf', + 'regex': 'pattern', + 'format': 'format', + 'required': 'required', + 'items': 'items', + 'Items': 'items', + 'Properties': 'properties', + 'additional_properties': 'additionalProperties', + 'additionalProperties': 'additionalProperties', + 'OneOf': 'oneOf', + 'AnyOf': 'anyOf', + 'AllOf': 'allOf', + '_not': 'not', + '_Not': 'not', + 'discriminator': 'discriminator' +} + +class SchemaConfiguration: + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator + + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + Do not edit the class manually. + + :param disabled_json_schema_keywords (set): Set of + JSON schema validation keywords to disable JSON schema structural validation + rules. The following keywords may be specified: multipleOf, maximum, + exclusiveMaximum, minimum, exclusiveMinimum, maxLength, minLength, pattern, + maxItems, minItems. + By default, the validation is performed for data generated locally by the client + and data received from the server, independent of any validation performed by + the server side. If the input data does not satisfy the JSON schema validation + rules specified in the OpenAPI document, an exception is raised. + If disabled_json_schema_keywords is set, structural validation is + disabled. This can be useful to troubleshoot data validation problem, such as + when the OpenAPI document validation rules do not match the actual API data + received by the server. + :param server_index: Index to servers configuration. + """ + + def __init__( + self, + disabled_json_schema_keywords = frozenset(), + ): + """Constructor + """ + self.disabled_json_schema_keywords = disabled_json_schema_keywords + + @property + def disabled_json_schema_keywords(self) -> typing.Set[str]: + return self.__disabled_json_schema_keywords + + @property + def disabled_json_schema_python_keywords(self) -> typing.Set[str]: + return self.__disabled_json_schema_python_keywords + + @disabled_json_schema_keywords.setter + def disabled_json_schema_keywords(self, json_keywords: typing.Set[str]): + disabled_json_schema_keywords = set() + disabled_json_schema_python_keywords = set() + for k in json_keywords: + python_keywords = {key for key, val in PYTHON_KEYWORD_TO_JSON_SCHEMA_KEYWORD.items() if val == k} + if not python_keywords: + raise exceptions.ApiValueError( + "Invalid keyword: '{0}''".format(k)) + disabled_json_schema_keywords.add(k) + disabled_json_schema_python_keywords.update(python_keywords) + self.__disabled_json_schema_keywords = disabled_json_schema_keywords + self.__disabled_json_schema_python_keywords = disabled_json_schema_python_keywords \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/doc_auth_partial.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/doc_auth_partial.handlebars deleted file mode 100644 index f5d61321c35..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/doc_auth_partial.handlebars +++ /dev/null @@ -1,109 +0,0 @@ -# Defining the host is optional and defaults to {{{basePath}}} -# See configuration.py for a list of all supported configuration parameters. -configuration = {{{packageName}}}.Configuration( - host = "{{{basePath}}}" -) - -{{#if hasAuthMethods}} -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. -{{#each authMethods}} -{{#if isBasic}} -{{#if isBasicBasic}} - -# Configure HTTP basic authorization: {{{name}}} -configuration = {{{packageName}}}.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) -{{/if}} -{{#if isBasicBearer}} - -# Configure Bearer authorization{{#if bearerFormat}} ({{{bearerFormat}}}){{/if}}: {{{name}}} -configuration = {{{packageName}}}.Configuration( - access_token = 'YOUR_BEARER_TOKEN' -) -{{/if}} -{{#if isHttpSignature}} - -# Configure HTTP message signature: {{{name}}} -# The HTTP Signature Header mechanism that can be used by a client to -# authenticate the sender of a message and ensure that particular headers -# have not been modified in transit. -# -# You can specify the signing key-id, private key path, signing scheme, -# signing algorithm, list of signed headers and signature max validity. -# The 'key_id' parameter is an opaque string that the API server can use -# to lookup the client and validate the signature. -# The 'private_key_path' parameter should be the path to a file that -# contains a DER or base-64 encoded private key. -# The 'private_key_passphrase' parameter is optional. Set the passphrase -# if the private key is encrypted. -# The 'signed_headers' parameter is used to specify the list of -# HTTP headers included when generating the signature for the message. -# You can specify HTTP headers that you want to protect with a cryptographic -# signature. Note that proxies may add, modify or remove HTTP headers -# for legitimate reasons, so you should only add headers that you know -# will not be modified. For example, if you want to protect the HTTP request -# body, you can specify the Digest header. In that case, the client calculates -# the digest of the HTTP request body and includes the digest in the message -# signature. -# The 'signature_max_validity' parameter is optional. It is configured as a -# duration to express when the signature ceases to be valid. The client calculates -# the expiration date every time it generates the cryptographic signature -# of an HTTP request. The API server may have its own security policy -# that controls the maximum validity of the signature. The client max validity -# must be lower than the server max validity. -# The time on the client and server must be synchronized, otherwise the -# server may reject the client signature. -# -# The client must use a combination of private key, signing scheme, -# signing algorithm and hash algorithm that matches the security policy of -# the API server. -# -# See {{{packageName}}}.signing for a list of all supported parameters. -configuration = {{{packageName}}}.Configuration( - host = "{{{basePath}}}", - signing_info = {{{packageName}}}.signing.HttpSigningConfiguration( - key_id = 'my-key-id', - private_key_path = 'private_key.pem', - private_key_passphrase = 'YOUR_PASSPHRASE', - signing_scheme = {{{packageName}}}.signing.SCHEME_HS2019, - signing_algorithm = {{{packageName}}}.signing.ALGORITHM_ECDSA_MODE_FIPS_186_3, - hash_algorithm = {{{packageName}}}.signing.SCHEME_RSA_SHA256, - signed_headers = [ - {{{packageName}}}.signing.HEADER_REQUEST_TARGET, - {{{packageName}}}.signing.HEADER_CREATED, - {{{packageName}}}.signing.HEADER_EXPIRES, - {{{packageName}}}.signing.HEADER_HOST, - {{{packageName}}}.signing.HEADER_DATE, - {{{packageName}}}.signing.HEADER_DIGEST, - 'Content-Type', - 'Content-Length', - 'User-Agent' - ], - signature_max_validity = datetime.timedelta(minutes=5) - ) -) -{{/if}} -{{/if}} -{{#if isApiKey}} - -# Configure API key authorization: {{{name}}} -configuration.api_key['{{{name}}}'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['{{name}}'] = 'Bearer' -{{/if}} -{{#if isOAuth}} - -# Configure OAuth2 access token for authorization: {{{name}}} -configuration = {{{packageName}}}.Configuration( - host = "{{{basePath}}}", - access_token = 'YOUR_ACCESS_TOKEN' -) -{{/if}} -{{/each}} -{{/if}} diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/endpoint.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/endpoint.handlebars deleted file mode 100644 index ef06ac56f4b..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/endpoint.handlebars +++ /dev/null @@ -1,467 +0,0 @@ -# coding: utf-8 - -{{>partial_header}} - -from dataclasses import dataclass -import typing_extensions -import urllib3 -{{#with operation}} -{{#or headerParams bodyParam produces}} -from urllib3._collections import HTTPHeaderDict -{{/or}} -{{/with}} - -from {{packageName}} import api_client, exceptions -{{> model_templates/imports_schema_types }} -{{> model_templates/imports_schemas }} - -{{#unless isStub}} -from . import path - -{{/unless}} -{{#with operation}} -{{#if queryParams}} -{{> endpoint_parameter_schema_and_def xParams=queryParams xParamsName="Query" }} -{{/if}} -{{#if headerParams}} -{{> endpoint_parameter_schema_and_def xParams=headerParams xParamsName="Header" }} -{{/if}} -{{#if pathParams}} -{{> endpoint_parameter_schema_and_def xParams=pathParams xParamsName="Path" }} -{{/if}} -{{#if cookieParams}} -{{> endpoint_parameter_schema_and_def xParams=cookieParams xParamsName="Cookie" }} -{{/if}} -{{#with bodyParam}} -# body param -{{#each content}} -{{#with this.schema}} -{{> model_templates/schema }} -{{/with}} -{{/each}} - - -request_body_{{paramName}} = api_client.RequestBody( - content={ -{{#each content}} - '{{{@key}}}': api_client.MediaType({{#if this.schema}} - schema={{this.schema.baseName}}{{/if}}), -{{/each}} - }, -{{#if required}} - required=True, -{{/if}} -) -{{/with}} -{{#unless isStub}} -{{#each authMethods}} -{{#if @first}} -_auth = [ -{{/if}} - '{{name}}', -{{#if @last}} -] -{{/if}} -{{/each}} -{{#each servers}} -{{#if @first}} -_servers = ( -{{/if}} - { - 'url': "{{{url}}}", - 'description': "{{#unless description}}No description provided{{else}}{{{description}}}{{/unless}}", - {{#each variables}} - {{#if @first}} - 'variables': { - {{/if}} - '{{{name}}}': { - 'description': "{{#unless description}}No description provided{{else}}{{{description}}}{{/unless}}", - 'default_value': "{{{defaultValue}}}", - {{#each enumValues}} - {{#if @first}} - 'enum_values': [ - {{/if}} - "{{{.}}}"{{#unless @last}},{{/unless}} - {{#if @last}} - ] - {{/if}} - {{/each}} - }{{#unless @last}},{{/unless}} - {{#if @last}} - } - {{/if}} - {{/each}} - }, -{{#if @last}} -) -{{/if}} -{{/each}} -{{/unless}} -{{#each responses}} -{{#each responseHeaders}} -{{#with schema}} -{{> model_templates/schema }} -{{/with}} -{{#unless isStub}} -{{paramName}}_parameter = api_client.HeaderParameter( - name="{{baseName}}", -{{#if style}} - style=api_client.ParameterStyle.{{style}}, -{{/if}} -{{#if schema}} -{{#with schema}} - schema={{baseName}}, -{{/with}} -{{/if}} -{{#if required}} - required=True, -{{/if}} -{{#if isExplode}} - explode=True, -{{/if}} -) -{{/unless}} -{{/each}} -{{#each content}} -{{#with this.schema}} -{{> model_templates/schema }} -{{/with}} -{{/each}} -{{#if responseHeaders}} -ResponseHeadersFor{{code}} = typing_extensions.TypedDict( - 'ResponseHeadersFor{{code}}', - { -{{#each responseHeaders}} - '{{baseName}}': {{#with schema}}{{baseName}},{{/with}} -{{/each}} - } -) -{{/if}} - - -@dataclass -{{#if isDefault}} -class ApiResponseForDefault(api_client.ApiResponse): -{{else}} -class ApiResponseFor{{code}}(api_client.ApiResponse): -{{/if}} - response: urllib3.HTTPResponse -{{#and responseHeaders content}} - body: typing.Union[ -{{#each content}} -{{#if this.schema}} - {{this.schema.baseName}}, -{{else}} - schemas.Unset, -{{/if}} -{{/each}} - ] - headers: ResponseHeadersFor{{code}} -{{else}} -{{#or responseHeaders content}} -{{#if responseHeaders}} - headers: ResponseHeadersFor{{code}} - body: schemas.Unset = schemas.unset -{{else}} - body: typing.Union[ -{{#each content}} -{{#if this.schema}} - {{this.schema.baseName}}, -{{else}} - schemas.Unset, -{{/if}} -{{/each}} - ] - headers: schemas.Unset = schemas.unset -{{/if}} -{{/or}} -{{/and}} -{{#unless responseHeaders}} -{{#unless content}} - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset -{{/unless}} -{{/unless}} - - -{{#if isDefault}} -_response_for_default = api_client.OpenApiResponse( - response_cls=ApiResponseForDefault, -{{else}} -_response_for_{{code}} = api_client.OpenApiResponse( - response_cls=ApiResponseFor{{code}}, -{{/if}} -{{#each content}} -{{#if @first}} - content={ -{{/if}} - '{{{@key}}}': api_client.MediaType({{#if this.schema}} - schema={{this.schema.baseName}}{{/if}}), -{{#if @last}} - }, -{{/if}} -{{/each}} -{{#if responseHeaders}} - headers=[ -{{#each responseHeaders}} - {{paramName}}_parameter, -{{/each}} - ] -{{/if}} -) -{{/each}} -{{#unless isStub}} -_status_code_to_response = { -{{#each responses}} -{{#if isDefault}} - 'default': _response_for_default, -{{else}} - '{{code}}': _response_for_{{code}}, -{{/if}} -{{/each}} -} -{{/unless}} -{{#each produces}} -{{#if @first}} -_all_accept_content_types = ( -{{/if}} - '{{{this.mediaType}}}', -{{#if @last}} -) -{{/if}} -{{/each}} - - -class BaseApi(api_client.Api): -{{#if bodyParam}} - {{#each getContentTypeToOperation}} - {{> endpoint_args_baseapi_wrapper contentType=@key this=this}} - - {{/each}} - {{> endpoint_args_baseapi_wrapper contentType="null" this=this}} - -{{else}} - @typing.overload - def _{{operationId}}_oapg( - {{> endpoint_args isOverload=true skipDeserialization="False" contentType="null"}} -{{/if}} - - @typing.overload - def _{{operationId}}_oapg( - {{> endpoint_args isOverload=true skipDeserialization="True" contentType="null"}} - - @typing.overload - def _{{operationId}}_oapg( - {{> endpoint_args isOverload=true skipDeserialization="null" contentType="null"}} - - def _{{operationId}}_oapg( - {{> endpoint_args isOverload=false skipDeserialization="null" contentType="null"}} - """ - {{#if summary}} - {{summary}} - {{/if}} - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - {{#if queryParams}} - self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) - {{/if}} - {{#if headerParams}} - self._verify_typed_dict_inputs_oapg(RequestHeaderParams, header_params) - {{/if}} - {{#if pathParams}} - self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) - {{/if}} - {{#if cookieParams}} - self._verify_typed_dict_inputs_oapg(RequestCookieParams, cookie_params) - {{/if}} - used_path = path.value - {{#if pathParams}} - - _path_params = {} - for parameter in ( - {{#each pathParams}} - request_path_{{paramName}}, - {{/each}} - ): - parameter_data = path_params.get(parameter.name, schemas.unset) - if parameter_data is schemas.unset: - continue - serialized_data = parameter.serialize(parameter_data) - _path_params.update(serialized_data) - - for k, v in _path_params.items(): - used_path = used_path.replace('{%s}' % k, v) - {{/if}} - {{#if queryParams}} - - prefix_separator_iterator = None - for parameter in ( - {{#each queryParams}} - request_query_{{paramName}}, - {{/each}} - ): - parameter_data = query_params.get(parameter.name, schemas.unset) - if parameter_data is schemas.unset: - continue - if prefix_separator_iterator is None: - prefix_separator_iterator = parameter.get_prefix_separator_iterator() - serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) - for serialized_value in serialized_data.values(): - used_path += serialized_value - {{/if}} - {{#or headerParams bodyParam produces}} - - _headers = HTTPHeaderDict() - {{else}} - {{/or}} - {{#if headerParams}} - for parameter in ( - {{#each headerParams}} - request_header_{{paramName}}, - {{/each}} - ): - parameter_data = header_params.get(parameter.name, schemas.unset) - if parameter_data is schemas.unset: - continue - serialized_data = parameter.serialize(parameter_data) - _headers.extend(serialized_data) - {{/if}} - # TODO add cookie handling - {{#if produces}} - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - {{/if}} - {{#with bodyParam}} - - {{#if required}} - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - {{/if}} - _fields = None - _body = None - {{#if required}} - {{> endpoint_body_serialization }} - {{else}} - if body is not schemas.unset: - {{> endpoint_body_serialization }} - {{/if}} - {{/with}} - {{#if servers}} - - host = self._get_host_oapg('{{operationId}}', _servers, host_index) - {{/if}} - - response = self.api_client.call_api( - resource_path=used_path, - method='{{httpMethod}}'.upper(), - {{#or headerParams bodyParam produces}} - headers=_headers, - {{/or}} - {{#if bodyParam}} - fields=_fields, - body=_body, - {{/if}} - {{#if hasAuthMethods}} - auth_settings=_auth, - {{/if}} - {{#if servers}} - host=host, - {{/if}} - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - {{#if hasDefaultResponse}} - default_response = _status_code_to_response.get('default') - if default_response: - api_response = default_response.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - {{else}} - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - {{/if}} - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class {{operationIdCamelCase}}(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - -{{#if bodyParam}} - {{#each getContentTypeToOperation}} - {{> endpoint_args_operationid_wrapper contentType=@key this=this}} - - {{/each}} - {{> endpoint_args_operationid_wrapper contentType="null" this=this}} - -{{else}} - @typing.overload - def {{operationId}}( - {{> endpoint_args isOverload=true skipDeserialization="False" contentType="null"}} -{{/if}} - - @typing.overload - def {{operationId}}( - {{> endpoint_args isOverload=true skipDeserialization="True" contentType="null"}} - - @typing.overload - def {{operationId}}( - {{> endpoint_args isOverload=true skipDeserialization="null" contentType="null"}} - - def {{operationId}}( - {{> endpoint_args isOverload=false skipDeserialization="null" contentType="null"}} - return self._{{operationId}}_oapg( - {{> endpoint_args_passed }} - ) - - -class ApiFor{{httpMethod}}(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - -{{#if bodyParam}} - {{#each getContentTypeToOperation}} - {{> endpoint_args_httpmethod_wrapper contentType=@key this=this}} - - {{/each}} - {{> endpoint_args_httpmethod_wrapper contentType="null" this=this}} - -{{else}} - @typing.overload - def {{httpMethod}}( - {{> endpoint_args isOverload=true skipDeserialization="False" contentType="null"}} -{{/if}} - - @typing.overload - def {{httpMethod}}( - {{> endpoint_args isOverload=true skipDeserialization="True" contentType="null"}} - - @typing.overload - def {{httpMethod}}( - {{> endpoint_args isOverload=true skipDeserialization="null" contentType="null"}} - - def {{httpMethod}}( - {{> endpoint_args isOverload=false skipDeserialization="null" contentType="null"}} - return self._{{operationId}}_oapg( - {{> endpoint_args_passed }} - ) - - -{{/with}} diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/endpoint_args.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/endpoint_args.handlebars deleted file mode 100644 index 1eceaf34ad3..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/endpoint_args.handlebars +++ /dev/null @@ -1,147 +0,0 @@ - self, -{{#if bodyParam}} - {{#if bodyParam.required}} - {{#with bodyParam}} - {{#eq ../contentType "null"}} - body: typing.Union[{{#each getContent}}{{#with this.schema}}{{baseName}},{{> model_templates/schema_python_types }}{{/with}}{{/each}}], - {{else}} - body: typing.Union[{{#each getContent}}{{#eq @key ../../contentType }}{{#with this.schema}}{{baseName}},{{> model_templates/schema_python_types }}{{/with}}{{/eq}}{{/each}}], - {{/eq}} - {{/with}} - {{#if isOverload}} - {{#eq skipDeserialization "True"}} - skip_deserialization: typing_extensions.Literal[True], - {{/eq}} - {{#neq contentType "null"}} - {{#with bodyParam}} - {{#each content}} - {{#eq @key ../../contentType}} - {{#if @first}} - content_type: typing_extensions.Literal["{{{@key}}}"] = ..., - {{else}} - content_type: typing_extensions.Literal["{{{@key}}}"], - {{/if}} - {{/eq}} - {{/each}} - {{/with}} - {{else}} - content_type: str = ..., - {{/neq}} - {{else}} - {{#with bodyParam}} - {{#each getContent}} - {{#if @first}} - content_type: str = '{{{@key}}}', - {{/if}} - {{/each}} - {{/with}} - {{/if}} - {{else}} - {{#if isOverload}} - {{#eq skipDeserialization "True"}} - skip_deserialization: typing_extensions.Literal[True], - {{/eq}} - {{#neq contentType "null"}} - {{#with bodyParam}} - {{#each getContent}} - {{#eq @key ../../contentType}} - {{#if @first}} - content_type: typing_extensions.Literal["{{{@key}}}"] = ..., - {{else}} - content_type: typing_extensions.Literal["{{{@key}}}"], - {{/if}} - {{/eq}} - {{/each}} - {{/with}} - {{else}} - content_type: str = ..., - {{/neq}} - {{else}} - {{#with bodyParam}} - {{#each getContent}} - {{#if @first}} - content_type: str = '{{{@key}}}', - {{/if}} - {{/each}} - {{/with}} - {{/if}} - {{#with bodyParam}} - {{#eq ../contentType "null"}} - body: typing.Union[{{#each getContent}}{{#with this.schema}}{{baseName}}, {{> model_templates/schema_python_types }}{{/with}}{{/each}}schemas.Unset] = schemas.unset, - {{else}} - body: typing.Union[{{#each getContent}}{{#eq @key ../../contentType }}{{#with this.schema}}{{baseName}}, {{> model_templates/schema_python_types }}{{/with}}{{/eq}}{{/each}}schemas.Unset] = schemas.unset, - {{/eq}} - {{/with}} - {{/if}} -{{else}} - {{#if isOverload}} - {{#eq skipDeserialization "True"}} - skip_deserialization: typing_extensions.Literal[True], - {{/eq}} - {{/if}} -{{/if}} -{{#if queryParams}} - query_params: RequestQueryParams = frozendict.frozendict(), -{{/if}} -{{#if headerParams}} - header_params: RequestHeaderParams = frozendict.frozendict(), -{{/if}} -{{#if pathParams}} - path_params: RequestPathParams = frozendict.frozendict(), -{{/if}} -{{#if cookieParams}} - cookie_params: RequestCookieParams = frozendict.frozendict(), -{{/if}} -{{#if produces}} - accept_content_types: typing.Tuple[str] = _all_accept_content_types, -{{/if}} -{{#if servers}} - host_index: typing.Optional[int] = None, -{{/if}} - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - {{#if isOverload}} - {{#eq skipDeserialization "False"}} - skip_deserialization: typing_extensions.Literal[False] = ..., - {{/eq}} - {{#eq skipDeserialization "null"}} - skip_deserialization: bool = ..., - {{/eq}} - {{else}} - skip_deserialization: bool = False, - {{/if}} -{{#eq skipDeserialization "True"}} -) -> api_client.ApiResponseWithoutDeserialization: ... -{{/eq}} -{{#eq skipDeserialization "False"}} -) -> {{#if getAllResponsesAreErrors}}api_client.ApiResponseWithoutDeserialization: ...{{else}}typing.Union[ - {{#each responses}} - {{#if isDefault}} - ApiResponseForDefault, - {{else}} - {{#if is2xx}} - ApiResponseFor{{code}}, - {{/if}} - {{/if}} - {{/each}} -]: ... - {{/if}} -{{/eq}} -{{#eq skipDeserialization "null"}} -{{#if isOverload}} -) -> typing.Union[ - {{#each responses}} - {{#if isDefault}} - ApiResponseForDefault, - {{else}} - {{#if is2xx}} - ApiResponseFor{{code}}, - {{/if}} - {{/if}} - {{/each}} - api_client.ApiResponseWithoutDeserialization, -]: ... -{{else}} -): -{{/if}} -{{/eq}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/endpoint_args_baseapi_wrapper.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/endpoint_args_baseapi_wrapper.handlebars deleted file mode 100644 index cd73d02e9c8..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/endpoint_args_baseapi_wrapper.handlebars +++ /dev/null @@ -1,5 +0,0 @@ -@typing.overload -{{#with this}} -def _{{operationId}}_oapg( -{{> endpoint_args isOverload=true skipDeserialization="False" contentType=contentType}} -{{/with}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/endpoint_args_httpmethod_wrapper.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/endpoint_args_httpmethod_wrapper.handlebars deleted file mode 100644 index f28bd735a54..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/endpoint_args_httpmethod_wrapper.handlebars +++ /dev/null @@ -1,5 +0,0 @@ -@typing.overload -{{#with this}} -def {{httpMethod}}( -{{> endpoint_args isOverload=true skipDeserialization="False" contentType=contentType}} -{{/with}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/endpoint_args_operationid_wrapper.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/endpoint_args_operationid_wrapper.handlebars deleted file mode 100644 index 47b5ea64ca5..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/endpoint_args_operationid_wrapper.handlebars +++ /dev/null @@ -1,5 +0,0 @@ -@typing.overload -{{#with this}} -def {{operationId}}( -{{> endpoint_args isOverload=true skipDeserialization="False" contentType=contentType}} -{{/with}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/endpoint_args_passed.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/endpoint_args_passed.handlebars deleted file mode 100644 index 8deb2cd260f..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/endpoint_args_passed.handlebars +++ /dev/null @@ -1,33 +0,0 @@ -{{#if bodyParam}} -{{#with bodyParam}} -body=body, -{{/with}} -{{/if}} -{{#if queryParams}} -query_params=query_params, -{{/if}} -{{#if headerParams}} -header_params=header_params, -{{/if}} -{{#if pathParams}} -path_params=path_params, -{{/if}} -{{#if cookieParams}} -cookie_params=cookie_params, -{{/if}} -{{#with bodyParam}} -{{#each content}} -{{#if @first}} -content_type=content_type, -{{/if}} -{{/each}} -{{/with}} -{{#if produces}} -accept_content_types=accept_content_types, -{{/if}} -{{#if servers}} -host_index=host_index, -{{/if}} -stream=stream, -timeout=timeout, -skip_deserialization=skip_deserialization diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/endpoint_body_serialization.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/endpoint_body_serialization.handlebars deleted file mode 100644 index f00d9f05d27..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/endpoint_body_serialization.handlebars +++ /dev/null @@ -1,6 +0,0 @@ -serialized_data = request_body_{{paramName}}.serialize(body, content_type) -_headers.add('Content-Type', content_type) -if 'fields' in serialized_data: - _fields = serialized_data['fields'] -elif 'body' in serialized_data: - _body = serialized_data['body'] \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/endpoint_parameter.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/endpoint_parameter.handlebars deleted file mode 100644 index 8c18c997e35..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/endpoint_parameter.handlebars +++ /dev/null @@ -1,24 +0,0 @@ -request_{{#if isQueryParam}}query{{/if}}{{#if isPathParam}}path{{/if}}{{#if isHeaderParam}}header{{/if}}{{#if isCookieParam}}cookie{{/if}}_{{paramName}} = api_client.{{#if isQueryParam}}Query{{/if}}{{#if isPathParam}}Path{{/if}}{{#if isHeaderParam}}Header{{/if}}{{#if isCookieParam}}Cookie{{/if}}Parameter( - name="{{baseName}}", -{{#if style}} - style=api_client.ParameterStyle.{{style}}, -{{/if}} -{{#if schema}} - {{#with schema}} - schema={{baseName}}, - {{/with}} -{{/if}} -{{#if getContent}} - content={ -{{#each getContent}} - "{{@key}}": {{#with this}}{{#with schema}}{{baseName}}{{/with}}{{/with}}, -{{/each}} - }, -{{/if}} -{{#if required}} - required=True, -{{/if}} -{{#if isExplode}} - explode=True, -{{/if}} -) diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/endpoint_parameter_schema_and_def.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/endpoint_parameter_schema_and_def.handlebars deleted file mode 100644 index 313a64dc200..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/endpoint_parameter_schema_and_def.handlebars +++ /dev/null @@ -1,56 +0,0 @@ -# {{xParamsName}} params -{{#each xParams}} - {{#if schema}} - {{#with schema}} -{{> model_templates/schema }} - {{/with}} - {{else}} - {{#if getContent}} - {{#each getContent}} - {{#with this}} - {{#with schema}} -{{> model_templates/schema }} - {{/with}} - {{/with}} - {{/each}} - {{/if}} - {{/if}} -{{/each}} -RequestRequired{{xParamsName}}Params = typing_extensions.TypedDict( - 'RequestRequired{{xParamsName}}Params', - { -{{#each xParams}} -{{#if required}} -{{#if schema}} - '{{baseName}}': {{#with schema}}typing.Union[{{baseName}}, {{> model_templates/schema_python_types }}],{{/with}} -{{else}} - '{{baseName}}': {{#each getContent}}{{#with this}}{{#with schema}}typing.Union[{{baseName}}, {{> model_templates/schema_python_types }}],{{/with}}{{/with}}{{/each}} -{{/if}} -{{/if}} -{{/each}} - } -) -RequestOptional{{xParamsName}}Params = typing_extensions.TypedDict( - 'RequestOptional{{xParamsName}}Params', - { -{{#each xParams}} -{{#unless required}} -{{#if schema}} - '{{baseName}}': {{#with schema}}typing.Union[{{baseName}}, {{> model_templates/schema_python_types }}],{{/with}} -{{else}} - '{{baseName}}': {{#each getContent}}{{#with this}}{{#with schema}}typing.Union[{{baseName}}, {{> model_templates/schema_python_types }}],{{/with}}{{/with}}{{/each}} -{{/if}} -{{/unless}} -{{/each}} - }, - total=False -) - - -class Request{{xParamsName}}Params(RequestRequired{{xParamsName}}Params, RequestOptional{{xParamsName}}Params): - pass - - -{{#each xParams}} -{{> endpoint_parameter }} -{{/each}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/endpoint_stub.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/endpoint_stub.handlebars deleted file mode 100644 index b84c7698d36..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/endpoint_stub.handlebars +++ /dev/null @@ -1 +0,0 @@ -{{> endpoint isStub=true }} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/exceptions.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/exceptions.handlebars deleted file mode 100644 index 68306577b35..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/exceptions.handlebars +++ /dev/null @@ -1,140 +0,0 @@ -# coding: utf-8 - -{{>partial_header}} -import dataclasses -import typing - -from urllib3._collections import HTTPHeaderDict - - -class OpenApiException(Exception): - """The base exception class for all OpenAPIExceptions""" - - -class ApiTypeError(OpenApiException, TypeError): - def __init__(self, msg, path_to_item=None, valid_classes=None, - key_type=None): - """ Raises an exception for TypeErrors - - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (list): a list of keys an indices to get to the - current_item - None if unset - valid_classes (tuple): the primitive classes that current item - should be an instance of - None if unset - key_type (bool): False if our value is a value in a dict - True if it is a key in a dict - False if our item is an item in a list - None if unset - """ - self.path_to_item = path_to_item - self.valid_classes = valid_classes - self.key_type = key_type - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiTypeError, self).__init__(full_msg) - - -class ApiValueError(OpenApiException, ValueError): - def __init__(self, msg, path_to_item=None): - """ - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (list) the path to the exception in the - received_data dict. None if unset - """ - - self.path_to_item = path_to_item - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiValueError, self).__init__(full_msg) - - -class ApiAttributeError(OpenApiException, AttributeError): - def __init__(self, msg, path_to_item=None): - """ - Raised when an attribute reference or assignment fails. - - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (None/list) the path to the exception in the - received_data dict - """ - self.path_to_item = path_to_item - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiAttributeError, self).__init__(full_msg) - - -class ApiKeyError(OpenApiException, KeyError): - def __init__(self, msg, path_to_item=None): - """ - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (None/list) the path to the exception in the - received_data dict - """ - self.path_to_item = path_to_item - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiKeyError, self).__init__(full_msg) - - -T = typing.TypeVar("T") - - -@dataclasses.dataclass -class ApiException(OpenApiException, typing.Generic[T]): - status: int - reason: str - api_response: typing.Optional[T] = None - - @property - def body(self) -> typing.Union[str, bytes, None]: - if not self.api_response: - return None - return self.api_response.response.data - - @property - def headers(self) -> typing.Optional[HTTPHeaderDict]: - if not self.api_response: - return None - return self.api_response.response.getheaders() - - def __str__(self): - """Custom error messages for exception""" - error_message = "({0})\n"\ - "Reason: {1}\n".format(self.status, self.reason) - if self.headers: - error_message += "HTTP response headers: {0}\n".format( - self.headers) - - if self.body: - error_message += "HTTP response body: {0}\n".format(self.body) - - return error_message - - -def render_path(path_to_item): - """Returns a string representation of a path""" - result = "" - for pth in path_to_item: - if isinstance(pth, int): - result += "[{0}]".format(pth) - else: - result += "['{0}']".format(pth) - return result diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/exceptions.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/exceptions.hbs new file mode 100644 index 00000000000..5a7caff172b --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/exceptions.hbs @@ -0,0 +1,128 @@ +# coding: utf-8 + +{{> _helper_header }} +import dataclasses +import typing + +from urllib3._collections import HTTPHeaderDict + + +class OpenApiException(Exception): + """The base exception class for all OpenAPIExceptions""" + + +class ApiTypeError(OpenApiException, TypeError): + def __init__(self, msg, path_to_item=None, valid_classes=None, + key_type=None): + """ Raises an exception for TypeErrors + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list): a list of keys an indices to get to the + current_item + None if unset + valid_classes (tuple): the primitive classes that current item + should be an instance of + None if unset + key_type (bool): False if our value is a value in a dict + True if it is a key in a dict + False if our item is an item in a list + None if unset + """ + self.path_to_item = path_to_item + self.valid_classes = valid_classes + self.key_type = key_type + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiTypeError, self).__init__(full_msg) + + +class ApiValueError(OpenApiException, ValueError): + def __init__(self, msg, path_to_item=None): + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list) the path to the exception in the + received_data dict. None if unset + """ + + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiValueError, self).__init__(full_msg) + + +class ApiAttributeError(OpenApiException, AttributeError): + def __init__(self, msg, path_to_item=None): + """ + Raised when an attribute reference or assignment fails. + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiAttributeError, self).__init__(full_msg) + + +class ApiKeyError(OpenApiException, KeyError): + def __init__(self, msg, path_to_item=None): + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiKeyError, self).__init__(full_msg) + + +T = typing.TypeVar("T") + + +@dataclasses.dataclass +class ApiException(OpenApiException, typing.Generic[T]): + status: int + reason: str + api_response: typing.Optional[T] = None + + def __str__(self): + """Custom error messages for exception""" + error_message = "({0})\n"\ + "Reason: {1}\n".format(self.status, self.reason) + if self.api_response: + if self.api_response.response.headers: + error_message += "HTTP response headers: {0}\n".format( + self.api_response.response.headers) + if self.api_response.response.data: + error_message += "HTTP response body: {0}\n".format(self.api_response.response.data) + + return error_message + + +def render_path(path_to_item): + """Returns a string representation of a path""" + result = "" + for pth in path_to_item: + if isinstance(pth, int): + result += "[{0}]".format(pth) + else: + result += "['{0}']".format(pth) + return result diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/git_push.sh.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/git_push.hbs similarity index 100% rename from modules/openapi-json-schema-generator/src/main/resources/python/git_push.sh.handlebars rename to modules/openapi-json-schema-generator/src/main/resources/python/git_push.hbs diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/gitignore.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/gitignore.hbs similarity index 100% rename from modules/openapi-json-schema-generator/src/main/resources/python/gitignore.handlebars rename to modules/openapi-json-schema-generator/src/main/resources/python/gitignore.hbs diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/gitlab-ci.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/gitlab-ci.hbs similarity index 100% rename from modules/openapi-json-schema-generator/src/main/resources/python/gitlab-ci.handlebars rename to modules/openapi-json-schema-generator/src/main/resources/python/gitlab-ci.hbs diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/migration_2_0_0.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/migration_2_0_0.hbs new file mode 100644 index 00000000000..ed19050a503 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/migration_2_0_0.hbs @@ -0,0 +1,203 @@ +# Migration v1.X.X to v2.0.0 + +- [Compatibility note for opeanpi-generator](#compatibility-note-for-opeanpi-generator) +- [Component Generation](#component-generation) +- [Packaging Changes](#packaging-changes) +- [Path Generation](#path-generation) +- [Configuration Info Refactored](#configuration-info-refactored) +- [Servers and Security Generation](#servers-and-security-generation) +- [Java Classes for Openapi Data Refactored](#java-classes-for-openapi-data-refactored) +- [Api Access by Tags and Paths Updated](#api-access-by-tags-and-paths-updated) +- [Some Method/Property/Input/Class Names Updated](#some-methodpropertyinputclass-names-updated) +- [Documentation Updated](#documentation-updated) + +## Compatibility note for opeanpi-generator +The v1.0.4 release is nearly identical to the openapi-generator v6.3.0 release + +Below is a summary of big changes when updating you code from v1.X.X to 2.0.0 + +## Component Generation +Update: +Openapi document components in "#/components/x" are now generated in a components/x packages +Ths applies to: +- headers +- parameters +- request_bodies +- responses +- schemas +- security_schemes + +The generator now writes a class for each of those generated components. + +### Reason +A lot of openapi data is $ref references throughout an openapi document. +With this update, those $ref source locations are generated with file system paths that closely mirror the openapi +document json schema path to that info. $ref definition is then imported in generated python code. +This minimizes the amount of code that is generated, imposes well defined encapsulation and allows templates to be +re-used for many types of data regardless of where the data is in the source openapi document. + +### Action +- Update where you are importing models from, models are now component schemas + - File path change: model/pet.py -> components/schema/pet.py + +## Packaging changes +Code has been updated to use .toml packaging. Code is now distributed in a src directory + +### Reason +These updates follow latest python packaging best practices + +### Action +- if you are suppressing generation of any files, you will need to edit those file paths + - File Path Change: package_name -> src/package_name + +## Path Generation +If paths contain inline descriptions of parameters, request bodies, responses, security, or servers, +then those are now generated in separate files. Those files are imported into the endpoint code. +File locations closely mirror the openapi data json schema path. + +### Reason +Generating those files in paths that closely mirror the json schema paths will allow +the generator to use $ref to any location in the openapi document in the future, not just components. +These could include: +- relative $refs +- a request body $ref referring to the request body in another endpoint + +This also allowed the generation code to work the same way regardless of where the header/requestBody etc +is in the source spec. + +Note: +Operations are now at +paths/somePath/get/operation.py +and not at +paths/somePath/get/__init__.py +to minimize the amount of memory needed when importing the python package. +The configurations.api_configuration.py file imports all servers defined at: +- openapi document root +- pathItem +- pathItem operation +And if servers were defined in pathItem operations, then every operation that contains a server would be imported +in api_configuration.py. Which could be many many files. + +So instead +- operation endpoint definition was moved to paths/somePath/get/operation.py +- paths/somePath/get/__init__.py stays empty and does not need lots of memory when api_configuration.py imports servers +- server information was kept in paths/somePath/get/servers/server_x.py + +### Action +- if you are importing any endpoint form its file, update your import + - File path update: paths/somePath/get.py -> paths/somePath/get/operation.py + +## Configuration Info Refactored +Configuration information was separated into two classes +- configurations/api_configuration.py ApiConfiguration for: + - server info + - security (auth) info + - logging info +- configurations/schema_configuration.py SchemaConfiguration for: + - disabled openapi/json-schema keywords + +### Reason +Schema validation only relies on SchemaConfiguration data and does not need to know about any ApiConfiguration info +General api configuration info was poorly structured in the legacy configuration class which had 13 inputs. +The refactored ApiConfiguration now has 4 inputs which define servers and security info. +Having these separate classes prevents circular imports when the schemas.py file imports its SchemaConfiguration class. + +### Action +- When you instantiate ApiClient, update your code to pass in an instance of SchemaConfiguration + ApiConfiguration + + +## Servers and Security Generation +Servers are now generated as separate files with one class per file wherever they were defined in the openapi document +- servers/server_0.py +- paths/somePath/servers/server_0.py +- paths/somePath/get/servers/server_0.py +Security requirements objects are now generated as separate files with one security requirement object per file +wherever they were defined in the openapi document +- security/security_requirement_object_0.py +- paths/somePath/get/security/security_requirement_object_0.py + +### Reason +Server classes now re-use schema validation code to ensure that inputs to server variables are valid. +Generating these separate files minimizes generated code and maximizes code re-use. + +### Action +- If endpoints need to use specific servers or security not at index 0, pass security_index_info + server_index_info + into ApiConfiguration when instantiating it +- If you use non-default server variable values, then update your code to pass in server_info into ApiConfiguration + +## Java Classes for Openapi Data Refactored +Almost every java class used to store openapi document data at generation time has been re-written or refactored. +The new classes are much shorter and contain only what is needed to generate code and documentation. +This will make it much easier to add new openapi v3.1.0 features like new json schema keywords. +Generator interface methods were also refactored to simplify Java model instantiation and code generation. +Almost all properties are now public static final and are: +- immutable +- publicly accessible to the templates + +### Reason +These updates make the code much more maintainable. +The number of properties that have to be maintained is much smaller +- Component Schema: ~100 properties in CodegenModel.java -> ~50 properties in CodegenSchema.java +- PathItem Operation: ~75 properties CodegenOperation: ~25 properties + +This will reduce bugs like: why can't I access this property in this template +Because instances are mostly immutable it is very clear where the wrong value is being created/assigned. + +### Action +- if you are customizing the python generator, you will need to update your java code + +## Api Access By Tags and Paths Updated +Previously, keys togo from tags and paths to apis were enums. +The code was updated to use a TypedDict and uses strings as the keys. + +### Reason +Making this change allows type hinting to work for the TypedDict with string keys + +### Action +- If you use path_to_api.py or tag_to_api.py, update the key that you use to access the api + +## Some Method/Property/Input/Class Names Updated +- is_true_oapg -> is_true_ +- is_false_oapg -> is_false_ +- is_none_oapg -> is_none_ +- as_date_oapg -> as_date_ +- as_datetime_oapg -> as_datetime_ +- as_decimal_oapg -> as_decimal_ +- as_uuid_oapg -> as_uuid_ +- as_float_oapg -> as_float_ +- as_int_oapg -> as_int_ +- get_item_oapg -> get_item_ +- from_openapi_data_oapg -> from_openapi_data_ +- _verify_typed_dict_inputs_oapg -> _verify_typed_dict_inputs +- _configuration -> configuration_ +- _arg -> arg_ +- _args -> args_ +- MetaOapg -> Schema_ +- JsonSchema -> OpenApiSchema + +### Reason +Classes can have arbitrarily named properties set on them +Endpoints can have arbitrary operationId method names set +For those reasons, I use the prefix and suffix _ to greatly reduce the likelihood of collisions +on protected + public classes/methods. + +### Action +- if you use the above methods/inputs/properties/classes update them to the latest names + +## Documentation Updated +- components now have sections in the readme + - models became component schemas +- one file is now generated for each endpoint + - that file now has a table of contents + - heading indentation levels now are indented correctly in descending order + - endpoint now includes server and security info (if security exists) +- servers section added to readme if servers were defined in the openapi document root +- security section added to readme if security was defined in the openapi document root + +### Reason +Endpoint documentation had indentation and linking bugs before, this fixes them. +When all endpoints docs were written in one file it was difficult to link ot the correct section. +How to set server and security info was unclear before, the new docs and classes should clarify that. + +### Action +- if you link to specific parts of the documentation, update your links \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/migration_other_python_generators.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/migration_other_python_generators.hbs new file mode 100644 index 00000000000..36ab6416ee0 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/migration_other_python_generators.hbs @@ -0,0 +1,92 @@ +# Migration from Other Python Generators + +When switching from other python client generators you will need to make some changes to your code. + +1. This generator uses spec case for all (object) property names and parameter names. + - So if the spec has a property name like camelCase, it will use camelCase rather than camel_case + - So you will need to update how you input and read properties to use spec case + - endpoint calls will need to have their input arguments updated + - schema instance property usage and instantiation will need to be updated +2. Endpoint parameters are stored in dictionaries to prevent collisions (explanation below) + - So you will need to update how you pass data in to endpoints + - update your endpoint calls to pass in parameter data in path_params, query_params, header_params etc dict inputs +3. Endpoint responses now include the original response, the deserialized response body, and (todo)the deserialized headers + - So you will need to update your code to use response.body to access deserialized data +4. All validated data is instantiated in an instance that subclasses all validated Schema classes and Decimal/str/tuple/frozendict/NoneClass/BoolClass/bytes/io.FileIO + - This means that you can use isinstance to check if a payload validated against a schema class + - This means that no data will be of type None/True/False + - ingested None will subclass NoneClass + - ingested True will subclass BoolClass + - ingested False will subclass BoolClass + - So if you need to check is True/False/None, instead use instance.is_true_()/.is_false_()/.is_none_() +5. All validated class instances are immutable except for ones based on io.File + - This is because if properties were changed after validation, that validation would no longer apply + - So no changing values or property values after a class has been instantiated +6. String + Number types with formats + - String type data is stored as a string and if you need to access types based on its format like date, + date-time, uuid, number etc then you will need to use accessor functions on the instance + - type string + format: See .as_date_, .as_datetime_, .as_decimal_, .as_uuid_ + - type number + format: See .as_float_, .as_int_ + - this was done because openapi/json-schema defines constraints. string data may be type string with no format + keyword in one schema, and include a format constraint in another schema + - So if you need to access a string format based type, use as_date_/as_datetime_/as_decimal_/as_uuid_ + - So if you need to access a number format based type, use as_int_/as_float_ +7. Property access on AnyType(type unset) or object(dict) schemas + - Only required keys with valid python names are properties like .someProp and have type hints + - All optional keys may not exist, so properties are not defined for them + - One can access optional values with dict_instance['optionalProp'] and KeyError will be raised if it does not exist + - Use get_item_ if you need a way to always get a value whether or not the key exists + - If the key does not exist, schemas.unset is returned from calling dict_instance.get_item_('optionalProp') + - All required and optional keys have type hints for this method, and @typing.overload is used + - A type hint is also generated for additionalProperties accessed using this method + - So you will need to update you code to use some_instance['optionalProp'] to access optional property + and additionalProperty values +8. The location of the api classes has changed + - Api classes are located in your_package.apis.tags.some_api + - This change was made to eliminate redundant code generation + - Legacy generators generated the same endpoint twice if it had > 1 tag on it + - This generator defines an endpoint in one class, then inherits that class to generate + apis by tags and by paths + - This change reduces code and allows quicker run time if you use the path apis + - path apis are at your_package.apis.paths.some_path + - Those apis will only load their needed models, which is less to load than all of the resources needed in a tag api + - So you will need to update your import paths to the api classes + +### Why are Leading and Trailing Underscores in class and method names? +Classes can have arbitrarily named properties set on them +Endpoints can have arbitrary operationId method names set +For those reasons, I use the prefix and suffix _ to greatly reduce the likelihood of collisions +on protected + public classes/methods. + +### Object property spec case +This was done because when payloads are ingested, they can be validated against N number of schemas. +If the input signature used a different property name then that has mutated the payload. +So SchemaA and SchemaB must both see the camelCase spec named variable. +Also it is possible to send in two properties, named camelCase and camel_case in the same payload. +That use case should work, so spec case is used. + +### Parameter spec case +Parameters can be included in different locations including: +- query +- path +- header +- cookie + +Any of those parameters could use the same parameter names, so if every parameter +was included as an endpoint parameter in a function signature, they would collide. +For that reason, each of those inputs have been separated out into separate typed dictionaries: +- query_params +- path_params +- header_params +- cookie_params + +So when updating your code, you will need to pass endpoint parameters in using those +dictionaries. + +### Endpoint responses +Endpoint responses have been enriched to now include more information. +Any response reom an endpoint will now include the following properties: +response: urllib3.HTTPResponse +body: typing.Union[Unset, Schema] +headers: typing.Union[Unset, TODO] +Note: response header deserialization has not yet been added \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/model.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/model.handlebars deleted file mode 100644 index 54827ce8891..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/model.handlebars +++ /dev/null @@ -1,11 +0,0 @@ -# coding: utf-8 - -{{>partial_header}} - -{{#each models}} -{{#with model}} -{{> model_templates/imports_schema_types }} -{{> model_templates/schema }} -{{> model_templates/imports_schemas }} -{{/with}} -{{/each}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/model_doc.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/model_doc.handlebars deleted file mode 100644 index ae96a37f429..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/model_doc.handlebars +++ /dev/null @@ -1,9 +0,0 @@ -{{#each models}} -{{#with model}} -# {{packageName}}.{{modelPackage}}.{{classFilename}}.{{classname}} -{{> schema_doc complexTypePrefix="" }} -{{/with}} -{{/each}} - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/model_stub.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/model_stub.handlebars deleted file mode 100644 index 50700cf72d0..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/model_stub.handlebars +++ /dev/null @@ -1 +0,0 @@ -{{> model isStub=true }} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/classname.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/classname.handlebars deleted file mode 100644 index fbde863faed..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/classname.handlebars +++ /dev/null @@ -1 +0,0 @@ -{{#if this.classname}}{{classname}}{{else}}{{#if nameInSnakeCase}}{{name}}{{else}}{{baseName}}{{/if}}{{/if}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/composed_schemas.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/composed_schemas.handlebars deleted file mode 100644 index 9deb056577d..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/composed_schemas.handlebars +++ /dev/null @@ -1,109 +0,0 @@ -{{#with composedSchemas}} -{{#each allOf}} -{{#unless complexType}} -{{> model_templates/schema }} -{{/unless}} -{{/each}} -{{#each oneOf}} -{{#unless complexType}} -{{> model_templates/schema }} -{{/unless}} -{{/each}} -{{#each anyOf}} -{{#unless complexType}} -{{> model_templates/schema }} -{{/unless}} -{{/each}} -{{/with}} -{{#with composedSchemas}} -{{#if allOf}} - -@classmethod -@functools.lru_cache() -def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ -{{#each allOf}} -{{#if complexType}} - {{complexType}}, -{{else}} - {{#if nameInSnakeCase}} - cls.{{name}}, - {{else}} - cls.{{baseName}}, - {{/if}} -{{/if}} -{{/each}} - ] -{{/if}} -{{#if oneOf}} - -@classmethod -@functools.lru_cache() -def one_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ -{{#each oneOf}} -{{#if complexType}} - {{complexType}}, -{{else}} - {{#if nameInSnakeCase}} - cls.{{name}}, - {{else}} - cls.{{baseName}}, - {{/if}} -{{/if}} -{{/each}} - ] -{{/if}} -{{#if anyOf}} - -@classmethod -@functools.lru_cache() -def any_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ -{{#each anyOf}} -{{#if complexType}} - {{complexType}}, -{{else}} - {{#if nameInSnakeCase}} - cls.{{name}}, - {{else}} - cls.{{baseName}}, - {{/if}} -{{/if}} -{{/each}} - ] -{{/if}} -{{#if not}} -{{#with not}} -{{#if complexType}} - -@staticmethod -def {{#if nameInSnakeCase}}{{name}}{{else}}{{baseName}}{{/if}}() -> typing.Type['{{complexType}}']: - return {{complexType}} -{{else}} -{{> model_templates/schema }} -{{/if}} -{{/with}} -{{/if}} -{{/with}} diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/dict_partial.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/dict_partial.handlebars deleted file mode 100644 index 9ff3e7c37ea..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/dict_partial.handlebars +++ /dev/null @@ -1,58 +0,0 @@ -{{#if getRequiredVarsMap}} -required = { -{{#each getRequiredVarsMap}} - "{{{@key}}}", -{{/each}} -} -{{/if}} -{{#if getHasDiscriminatorWithNonEmptyMapping}} -{{#with discriminator}} -{{#each mappedModels}} -{{#if @first}} - -@staticmethod -def discriminator(): - return { - '{{{propertyBaseName}}}': { -{{/if}} - '{{mappingName}}': {{{modelName}}}, -{{#if @last}} - } - } -{{/if}} -{{/each}} -{{/with}} -{{/if}} -{{#if vars}} - -class properties: -{{#each vars}} -{{#if complexType}} - - @staticmethod - def {{#if nameInSnakeCase}}{{name}}{{else}}{{baseName}}{{/if}}() -> typing.Type['{{complexType}}']: - return {{complexType}} -{{else}} - {{> model_templates/schema }} -{{/if}} -{{/each}} - __annotations__ = { -{{#each vars}} -{{#if nameInSnakeCase}} - "{{{baseName}}}": {{name}}, -{{else}} - "{{{baseName}}}": {{baseName}}, -{{/if}} -{{/each}} - } -{{/if}} -{{#with additionalProperties}} -{{#if complexType}} - -@staticmethod -def {{baseName}}() -> typing.Type['{{complexType}}']: - return {{complexType}} -{{else}} -{{> model_templates/schema }} -{{/if}} -{{/with}} diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/enums.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/enums.handlebars deleted file mode 100644 index 8c3108e4257..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/enums.handlebars +++ /dev/null @@ -1,20 +0,0 @@ -{{#with allowableValues}} -{{#each enumVars}} - -@schemas.classproperty -def {{name}}(cls): - {{#eq value "schemas.NoneClass.NONE"}} - return cls(None) - {{else}} - {{#eq value "schemas.BoolClass.TRUE"}} - return cls(True) - {{else}} - {{#eq value "schemas.BoolClass.FALSE"}} - return cls(False) - {{else}} - return cls({{{value}}}) - {{/eq}} - {{/eq}} - {{/eq}} -{{/each}} -{{/with}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/format_base.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/format_base.handlebars deleted file mode 100644 index 9bbd87d8c8b..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/format_base.handlebars +++ /dev/null @@ -1,27 +0,0 @@ -{{#eq getFormat "uuid"}} -schemas.UUIDBase, -{{/eq}} -{{#eq getFormat "date"}} -schemas.DateBase, -{{/eq}} -{{#eq getFormat "date-time"}} -schemas.DateTimeBase, -{{/eq}} -{{#eq getFormat "number"}} -schemas.DecimalBase, -{{/eq}} -{{#eq getFormat "binary"}} -schemas.BinaryBase, -{{/eq}} -{{#eq getFormat "int32"}} -schemas.Int32Base, -{{/eq}} -{{#eq getFormat "int64"}} -schemas.Int64Base, -{{/eq}} -{{#eq getFormat "float"}} -schemas.Float32Base, -{{/eq}} -{{#eq getFormat "double"}} -schemas.Float64Base, -{{/eq}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/imports_schema_types.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/imports_schema_types.handlebars deleted file mode 100644 index 522c8f2c93b..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/imports_schema_types.handlebars +++ /dev/null @@ -1,12 +0,0 @@ -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from {{packageName}} import schemas # noqa: F401 diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/imports_schemas.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/imports_schemas.handlebars deleted file mode 100644 index b925cf92c69..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/imports_schemas.handlebars +++ /dev/null @@ -1,6 +0,0 @@ -{{#each imports}} -{{#if @first}} - -{{/if}} -{{{.}}} -{{/each}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/list_partial.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/list_partial.handlebars deleted file mode 100644 index 97c4003fe9b..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/list_partial.handlebars +++ /dev/null @@ -1,10 +0,0 @@ -{{#with items}} -{{#if complexType}} - -@staticmethod -def {{baseName}}() -> typing.Type['{{complexType}}']: - return {{complexType}} -{{else}} -{{> model_templates/schema }} -{{/if}} -{{/with}} diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/new.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/new.handlebars deleted file mode 100644 index 955d6395ec1..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/new.handlebars +++ /dev/null @@ -1,100 +0,0 @@ -def __new__( - cls, -{{#if getHasMultipleTypes}} - *_args: typing.Union[{{> model_templates/schema_python_types }}], -{{else}} -{{#if isArray }} - _arg: typing.Union[typing.Tuple[{{#with items}}{{#if complexType}}'{{complexType}}'{{else}}typing.Union[MetaOapg.{{baseName}}, {{> model_templates/schema_python_types }}]{{/if}}{{/with}}], typing.List[{{#with items}}{{#if complexType}}'{{complexType}}'{{else}}typing.Union[MetaOapg.{{baseName}}, {{> model_templates/schema_python_types }}]{{/if}}{{/with}}]], -{{else}} - *_args: typing.Union[{{> model_templates/schema_python_types }}], -{{/if}} -{{/if}} -{{#unless isNull}} -{{#if getHasRequired}} -{{#each getRequiredVarsMap}} -{{#with this}} -{{#unless nameInSnakeCase}} -{{#if complexType}} - {{baseName}}: '{{complexType}}', -{{else}} - {{#if getSchemaIsFromAdditionalProperties}} - {{#if addPropsUnset}} - {{baseName}}: typing.Union[schemas.AnyTypeSchema, {{> model_templates/schema_python_types }}], - {{else}} - {{baseName}}: typing.Union[MetaOapg.additional_properties, {{> model_templates/schema_python_types }}], - {{/if}} - {{else}} - {{baseName}}: typing.Union[MetaOapg.properties.{{baseName}}, {{> model_templates/schema_python_types }}], - {{/if}} -{{/if}} -{{/unless}} -{{/with}} -{{/each}} -{{/if}} -{{/unless}} -{{#each vars}} -{{#unless nameInSnakeCase}} -{{#unless getRequired}} -{{#if complexType}} - {{baseName}}: typing.Union['{{complexType}}', schemas.Unset] = schemas.unset, -{{else}} - {{baseName}}: typing.Union[MetaOapg.properties.{{baseName}}, {{> model_templates/schema_python_types }}schemas.Unset] = schemas.unset, -{{/if}} -{{/unless}} -{{/unless}} -{{/each}} - _configuration: typing.Optional[schemas.Configuration] = None, -{{#with additionalProperties}} -{{#unless getIsBooleanSchemaFalse}} -{{#if complexType}} - **kwargs: '{{complexType}}', -{{else}} - **kwargs: typing.Union[MetaOapg.additional_properties, {{> model_templates/schema_python_types }}], -{{/if}} -{{/unless}} -{{else}} -{{#or isMap isAnyType}} - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], -{{/or}} -{{/with}} -) -> '{{> model_templates/classname }}': - return super().__new__( - cls, -{{#if getHasMultipleTypes}} - *_args, -{{else}} -{{#if isArray }} - _arg, -{{else}} - *_args, -{{/if}} -{{/if}} -{{#unless isNull}} -{{#if getHasRequired}} -{{#each getRequiredVarsMap}} -{{#with this}} -{{#unless nameInSnakeCase}} - {{baseName}}={{baseName}}, -{{/unless}} -{{/with}} -{{/each}} -{{/if}} -{{/unless}} -{{#each vars}} -{{#unless getRequired}} -{{#unless nameInSnakeCase}} - {{baseName}}={{baseName}}, -{{/unless}} -{{/unless}} -{{/each}} - _configuration=_configuration, -{{#with additionalProperties}} -{{#unless getIsBooleanSchemaFalse}} - **kwargs, -{{/unless}} -{{else}} -{{#or isMap isAnyType}} - **kwargs, -{{/or}} -{{/with}} - ) diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/notes_msg.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/notes_msg.handlebars deleted file mode 100644 index 43d1163b5c0..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/notes_msg.handlebars +++ /dev/null @@ -1 +0,0 @@ -{{#unless isArray}}{{#unless complexType}}{{#with allowableValues}}must be one of [{{#each enumVars}}{{#eq value "schemas.NoneClass.NONE"}}None{{else}}{{#eq value "schemas.BoolClass.TRUE"}}True{{else}}{{#eq value "schemas.BoolClass.FALSE"}}False{{else}}{{{value}}}{{/eq}}{{/eq}}{{/eq}}, {{/each}}] {{/with}}{{#if defaultValue}}{{#unless hasRequired}}if omitted the server will use the default value of {{{defaultValue}}}{{/unless}}{{/if}}{{#eq getFormat "uuid"}}value must be a uuid{{/eq}}{{#eq getFormat "date"}}value must conform to RFC-3339 full-date YYYY-MM-DD{{/eq}}{{#eq getFormat "date-time"}}value must conform to RFC-3339 date-time{{/eq}}{{#eq getFormat "number"}}value must be numeric and storable in decimal.Decimal{{/eq}}{{#eq getFormat "int32"}}value must be a 32 bit integer{{/eq}}{{#eq getFormat "int64"}}value must be a 64 bit integer{{/eq}}{{#eq getFormat "double"}}value must be a 64 bit float{{/eq}}{{#eq getFormat "float"}}value must be a 32 bit float{{/eq}}{{/unless}}{{/unless}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/payload_renderer.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/payload_renderer.handlebars deleted file mode 100644 index cc5451785b0..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/payload_renderer.handlebars +++ /dev/null @@ -1,35 +0,0 @@ -{{#if isMap}} -{ -{{#each value}} -{{#with @key}} - {{> model_templates/payload_renderer endChar=':'}} -{{/with}} -{{#with this}} - {{> model_templates/payload_renderer endChar=','}} -{{/with}} -{{/each}} -}{{endChar}} -{{/if}} -{{#if isArray}} -[ -{{#each value}} - {{> model_templates/payload_renderer endChar=','}} -{{/each}} -]{{endChar}} -{{/if}} -{{#or isNumber isUnboundedInteger}} -{{value}}{{endChar}} -{{/or}} -{{#if isBoolean}} -{{#if value}} -True{{endChar}} -{{else}} -False{{endChar}} -{{/if}} -{{/if}} -{{#if isNull}} -None{{endChar}} -{{/if}} -{{#if isString}} -"{{{value}}}"{{endChar}} -{{/if}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/property_getitems_with_addprops.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/property_getitems_with_addprops.handlebars deleted file mode 100644 index 6fd1d8a3a37..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/property_getitems_with_addprops.handlebars +++ /dev/null @@ -1,108 +0,0 @@ -{{#if getRequiredVarsMap}} -{{#each getRequiredVarsMap}} -{{#with this}} - -@typing.overload -{{#if complexType}} -def __getitem__(self, name: typing_extensions.Literal["{{{baseName}}}"]) -> '{{complexType}}': ... -{{else}} -{{#if schemaIsFromAdditionalProperties}} -def __getitem__(self, name: typing_extensions.Literal["{{{baseName}}}"]) -> MetaOapg.additional_properties: ... -{{else}} -{{#if nameInSnakeCase}} -def __getitem__(self, name: typing_extensions.Literal["{{{baseName}}}"]) -> MetaOapg.properties.{{name}}: ... -{{else}} -def __getitem__(self, name: typing_extensions.Literal["{{{baseName}}}"]) -> MetaOapg.properties.{{baseName}}: ... -{{/if}} -{{/if}} -{{/if}} -{{/with}} -{{/each}} -{{/if}} -{{#if vars}} -{{#each vars}} -{{#unless required}} - -@typing.overload -{{#if complexType}} -def __getitem__(self, name: typing_extensions.Literal["{{{baseName}}}"]) -> '{{complexType}}': ... -{{else}} -{{#if nameInSnakeCase}} -def __getitem__(self, name: typing_extensions.Literal["{{{baseName}}}"]) -> MetaOapg.properties.{{name}}: ... -{{else}} -def __getitem__(self, name: typing_extensions.Literal["{{{baseName}}}"]) -> MetaOapg.properties.{{baseName}}: ... -{{/if}} -{{/if}} -{{/unless}} -{{/each}} -{{/if}} -{{#or vars getRequiredVarsMap}} -{{#with additionalProperties}} -{{#unless getIsBooleanSchemaFalse}} - -@typing.overload -def __getitem__(self, name: str) -> {{#if complexType}}'{{complexType}}'{{else}}MetaOapg.{{baseName}}{{/if}}: ... -{{/unless}} -{{/with}} - -{{> model_templates/property_getitems_with_addprops_getitem methodName="__getitem__" }} -{{else}} -{{#not additionalProperties.getIsBooleanSchemaFalse}} - -{{> model_templates/property_getitems_with_addprops_getitem methodName="__getitem__" }} -{{/not}} -{{/or}} -{{#if getRequiredVarsMap}} -{{#each getRequiredVarsMap}} -{{#with this}} - -@typing.overload -{{#if complexType}} -def get_item_oapg(self, name: typing_extensions.Literal["{{{baseName}}}"]) -> '{{complexType}}': ... -{{else}} -{{#if schemaIsFromAdditionalProperties}} -def get_item_oapg(self, name: typing_extensions.Literal["{{{baseName}}}"]) -> MetaOapg.additional_properties: ... -{{else}} -{{#if nameInSnakeCase}} -def get_item_oapg(self, name: typing_extensions.Literal["{{{baseName}}}"]) -> MetaOapg.properties.{{name}}: ... -{{else}} -def get_item_oapg(self, name: typing_extensions.Literal["{{{baseName}}}"]) -> MetaOapg.properties.{{baseName}}: ... -{{/if}} -{{/if}} -{{/if}} -{{/with}} -{{/each}} -{{/if}} -{{#if vars}} -{{#each vars}} -{{#unless required}} - -@typing.overload -{{#if complexType}} -def get_item_oapg(self, name: typing_extensions.Literal["{{{baseName}}}"]) -> typing.Union['{{complexType}}', schemas.Unset]: ... -{{else}} -{{#if nameInSnakeCase}} -def get_item_oapg(self, name: typing_extensions.Literal["{{{baseName}}}"]) -> typing.Union[MetaOapg.properties.{{name}}, schemas.Unset]: ... -{{else}} -def get_item_oapg(self, name: typing_extensions.Literal["{{{baseName}}}"]) -> typing.Union[MetaOapg.properties.{{baseName}}, schemas.Unset]: ... -{{/if}} -{{/if}} -{{/unless}} -{{/each}} -{{/if}} -{{#or vars getRequiredVarsMap}} -{{#with additionalProperties}} -{{#unless getIsBooleanSchemaFalse}} - -@typing.overload -def get_item_oapg(self, name: str) -> typing.Union[{{#if complexType}}'{{complexType}}'{{else}}MetaOapg.{{baseName}}{{/if}}, schemas.Unset]: ... -{{/unless}} -{{/with}} - -{{> model_templates/property_getitems_with_addprops_getitem methodName="get_item_oapg" }} -{{else}} -{{#not additionalProperties.getIsBooleanSchemaFalse}} - -{{> model_templates/property_getitems_with_addprops_getitem methodName="get_item_oapg" }} -{{/not}} -{{/or}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/property_getitems_with_addprops_getitem.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/property_getitems_with_addprops_getitem.handlebars deleted file mode 100644 index f35667373fc..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/property_getitems_with_addprops_getitem.handlebars +++ /dev/null @@ -1,5 +0,0 @@ -def {{methodName}}(self, name: typing.Union[{{#each getRequiredVarsMap}}{{#with this}}typing_extensions.Literal["{{{baseName}}}"], {{/with}}{{/each}}{{#each vars}}{{#unless required}}typing_extensions.Literal["{{{baseName}}}"], {{/unless}}{{/each}}{{#with additionalProperties}}{{#unless getIsBooleanSchemaFalse}}str, {{/unless}}{{/with}}]){{#not vars}}{{#not getRequiredVarsMap}}{{#with additionalProperties}}{{#unless getIsBooleanSchemaFalse}} -> {{#if complexType}}'{{complexType}}'{{else}}MetaOapg.{{baseName}}{{/if}}{{/unless}}{{/with}}{{/not}}{{/not}}: -{{#eq methodName "__getitem__"}} - # dict_instance[name] accessor -{{/eq}} - return super().{{methodName}}(name) diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/property_getitems_without_addprops.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/property_getitems_without_addprops.handlebars deleted file mode 100644 index efb37d4ca18..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/property_getitems_without_addprops.handlebars +++ /dev/null @@ -1,45 +0,0 @@ -{{#if vars}} -{{#each vars}} - -@typing.overload -{{#if complexType}} -def __getitem__(self, name: typing_extensions.Literal["{{{baseName}}}"]) -> '{{complexType}}': ... -{{else}} -{{#if nameInSnakeCase}} -def __getitem__(self, name: typing_extensions.Literal["{{{baseName}}}"]) -> MetaOapg.properties.{{name}}: ... -{{else}} -def __getitem__(self, name: typing_extensions.Literal["{{{baseName}}}"]) -> MetaOapg.properties.{{baseName}}: ... -{{/if}} -{{/if}} -{{/each}} - -@typing.overload -def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - -def __getitem__(self, name: typing.Union[typing_extensions.Literal[{{#each vars}}"{{{baseName}}}", {{/each}}], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - -{{/if}} -{{#if vars}} -{{#each vars}} - -@typing.overload -{{#if complexType}} -def get_item_oapg(self, name: typing_extensions.Literal["{{{baseName}}}"]) -> {{#unless required}}typing.Union[{{/unless}}'{{complexType}}'{{#unless required}}, schemas.Unset]{{/unless}}: ... -{{else}} -{{#if nameInSnakeCase}} -def get_item_oapg(self, name: typing_extensions.Literal["{{{baseName}}}"]) -> {{#unless required}}typing.Union[{{/unless}}MetaOapg.properties.{{name}}{{#unless required}}, schemas.Unset]{{/unless}}: ... -{{else}} -def get_item_oapg(self, name: typing_extensions.Literal["{{{baseName}}}"]) -> {{#unless required}}typing.Union[{{/unless}}MetaOapg.properties.{{baseName}}{{#unless required}}, schemas.Unset]{{/unless}}: ... -{{/if}} -{{/if}} -{{/each}} - -@typing.overload -def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - -def get_item_oapg(self, name: typing.Union[typing_extensions.Literal[{{#each vars}}"{{{baseName}}}", {{/each}}], str]): - return super().get_item_oapg(name) - -{{/if}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/property_type_hints.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/property_type_hints.handlebars deleted file mode 100644 index 395c6e2aea1..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/property_type_hints.handlebars +++ /dev/null @@ -1,13 +0,0 @@ -{{#if getRequiredVarsMap}} - -{{#if additionalProperties}} -{{> model_templates/property_type_hints_required }} -{{else}} -{{> model_templates/property_type_hints_required addPropsUnset=true }} -{{/if}} -{{/if}} -{{#if additionalProperties}} -{{> model_templates/property_getitems_with_addprops }} -{{else}} -{{> model_templates/property_getitems_without_addprops }} -{{/if}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/property_type_hints_required.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/property_type_hints_required.handlebars deleted file mode 100644 index 2a265d61d77..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/property_type_hints_required.handlebars +++ /dev/null @@ -1,19 +0,0 @@ -{{#each getRequiredVarsMap}} -{{#with this}} -{{#unless nameInSnakeCase}} -{{#if complexType}} -{{baseName}}: '{{complexType}}' -{{else}} -{{#if schemaIsFromAdditionalProperties}} -{{#if addPropsUnset}} -{{baseName}}: schemas.AnyTypeSchema -{{else}} -{{baseName}}: MetaOapg.additional_properties -{{/if}} -{{else}} -{{baseName}}: MetaOapg.properties.{{baseName}} -{{/if}} -{{/if}} -{{/unless}} -{{/with}} -{{/each}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/schema.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/schema.handlebars deleted file mode 100644 index 6f9d565ada3..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/schema.handlebars +++ /dev/null @@ -1,42 +0,0 @@ -{{#if composedSchemas}} - {{#if getIsBooleanSchemaFalse}} -{{> model_templates/var_equals_cls }} - {{else}} -{{> model_templates/schema_composed_or_anytype }} - {{/if}} -{{/if}} -{{#unless composedSchemas}} - {{#if getHasMultipleTypes}} -{{> model_templates/schema_composed_or_anytype }} - {{else}} - {{#or isMap isArray isAnyType}} - {{#if isMap}} - {{#or hasVars hasValidation getRequiredVarsMap getHasDiscriminatorWithNonEmptyMapping additionalProperties }} -{{> model_templates/schema_dict }} - {{else}} -{{> model_templates/var_equals_cls }} - {{/or}} - {{/if}} - {{#if isArray}} - {{#or hasItems hasValidation}} -{{> model_templates/schema_list }} - {{else}} -{{> model_templates/var_equals_cls }} - {{/or}} - {{/if}} - {{#if isAnyType}} - {{#or isEnum hasVars hasValidation getRequiredVarsMap getHasDiscriminatorWithNonEmptyMapping items getFormat}} -{{> model_templates/schema_composed_or_anytype }} - {{else}} -{{> model_templates/var_equals_cls }} - {{/or}} - {{/if}} - {{else}} - {{#or isEnum hasValidation}} -{{> model_templates/schema_simple }} - {{else}} -{{> model_templates/var_equals_cls }} - {{/or}} - {{/or}} - {{/if}} -{{/unless}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/schema_accessed_types.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/schema_accessed_types.handlebars deleted file mode 100644 index 8d0dcc0f4bd..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/schema_accessed_types.handlebars +++ /dev/null @@ -1 +0,0 @@ -{{#if isAnyType}}frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO{{/if}}{{#if isArray}}tuple, {{/if}}{{#if isMap}}frozendict.frozendict, {{/if}}{{#if isNull}}NoneClass, {{/if}}{{#if isString }}{{#neq format "binary"}}str, {{/neq}}{{#eq format "binary"}}bytes, FileIO, {{/eq}}{{/if}}{{#or isInteger isNumber}}decimal.Decimal, {{/or}}{{#if isBoolean}}BoolClass, {{/if}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/schema_composed_or_anytype.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/schema_composed_or_anytype.handlebars deleted file mode 100644 index 7f97830dcf7..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/schema_composed_or_anytype.handlebars +++ /dev/null @@ -1,75 +0,0 @@ - - -class {{#if this.classname}}{{classname}}{{else}}{{#if nameInSnakeCase}}{{name}}{{else}}{{baseName}}{{/if}}{{/if}}( -{{#if getIsAnyType}} - {{#if getFormat}} - {{> model_templates/format_base }} - {{/if}} - {{#if composedSchemas}} - schemas.ComposedSchema, - {{else}} - schemas.AnyTypeSchema, - {{/if}} -{{else}} - {{#if composedSchemas}} - schemas.ComposedBase, - {{/if}} - {{#if isEnum}} - schemas.EnumBase, - {{/if}} - {{> model_templates/xbase_schema }} -{{/if}} -): -{{#if this.classname}} - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. -{{#if description}} - - {{{unescapedDescription}}} -{{/if}} - """ -{{/if}} -{{#or hasValidation composedSchemas getItems additionalProperties getRequiredVarsMap getHasDiscriminatorWithNonEmptyMapping vars getFormat isEnum}} - - - class MetaOapg: -{{#if getFormat}} - format = '{{getFormat}}' -{{/if}} -{{#if isEnum}} -{{#with allowableValues}} - enum_value_to_name = { -{{#each enumVars}} - {{{value}}}: "{{name}}", -{{/each}} - } -{{/with}} -{{/if}} -{{#if getItems}} - {{> model_templates/list_partial }} -{{/if}} -{{#or additionalProperties getRequiredVarsMap getHasDiscriminatorWithNonEmptyMapping vars}} - {{> model_templates/dict_partial }} -{{/or}} -{{#unless isStub}} -{{#if hasValidation}} - {{> model_templates/validations }} -{{/if}} -{{/unless}} -{{#if composedSchemas}} - {{> model_templates/composed_schemas }} -{{/if}} -{{/or}} -{{#if isEnum}} - {{> model_templates/enums }} -{{/if}} - - {{> model_templates/property_type_hints }} - -{{#if additionalProperties}} - {{> model_templates/new }} -{{else}} - {{> model_templates/new addPropsUnset=true }} -{{/if}} diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/schema_dict.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/schema_dict.handlebars deleted file mode 100644 index 284590644f7..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/schema_dict.handlebars +++ /dev/null @@ -1,39 +0,0 @@ - - -class {{> model_templates/classname }}( - schemas.DictSchema -): -{{#if this.classname}} - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. -{{#if description}} - - {{{unescapedDescription}}} -{{/if}} - """ -{{/if}} -{{#if isStub}} -{{#or additionalProperties getRequiredVarsMap getHasDiscriminatorWithNonEmptyMapping vars}} - - - class MetaOapg: - {{> model_templates/dict_partial }} -{{/or}} -{{else}} -{{#or additionalProperties getRequiredVarsMap getHasDiscriminatorWithNonEmptyMapping vars hasValidation}} - - - class MetaOapg: - {{> model_templates/dict_partial }} - {{> model_templates/validations }} -{{/or}} -{{/if}} - {{> model_templates/property_type_hints }} - -{{#if additionalProperties}} - {{> model_templates/new }} -{{else}} - {{> model_templates/new addPropsUnset=true }} -{{/if}} diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/schema_list.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/schema_list.handlebars deleted file mode 100644 index ae52b3e923f..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/schema_list.handlebars +++ /dev/null @@ -1,39 +0,0 @@ - - -class {{> model_templates/classname }}( - schemas.ListSchema -): -{{#if this.classname}} - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. -{{#if description}} - - {{{unescapedDescription}}} -{{/if}} - """ -{{/if}} -{{#if isStub}} -{{#if items}} - - - class MetaOapg: - {{> model_templates/list_partial }} -{{/if}} -{{else}} -{{#or getItems hasValidation}} - - - class MetaOapg: -{{#if hasValidation}} - {{> model_templates/validations }} -{{/if}} - {{> model_templates/list_partial }} -{{/or}} -{{/if}} - - {{> model_templates/new }} - - def __getitem__(self, i: int) -> {{#with items}}{{#if complexType}}'{{complexType}}'{{else}}MetaOapg.items{{/if}}{{/with}}: - return super().__getitem__(i) diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/schema_python_types.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/schema_python_types.handlebars deleted file mode 100644 index 613e5861302..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/schema_python_types.handlebars +++ /dev/null @@ -1 +0,0 @@ -{{#if isAnyType}}dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, {{/if}}{{#if isArray}}list, tuple, {{/if}}{{#if isMap}}dict, frozendict.frozendict, {{/if}}{{#if isNull}}None, {{/if}}{{#if isString }}{{#neq format "binary"}}str, {{/neq}}{{#eq format "date"}}date, {{/eq}}{{#eq format "date-time"}}datetime, {{/eq}}{{#eq format "uuid"}}uuid.UUID, {{/eq}}{{#eq format "binary"}}bytes, io.FileIO, io.BufferedReader, {{/eq}}{{/if}}{{#if isInteger}}decimal.Decimal, int, {{/if}}{{#if isNumber}}decimal.Decimal, int, float, {{/if}}{{#if isBoolean}}bool, {{/if}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/schema_simple.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/schema_simple.handlebars deleted file mode 100644 index 0d880043e4f..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/schema_simple.handlebars +++ /dev/null @@ -1,49 +0,0 @@ - - -class {{#if this.classname}}{{classname}}{{else}}{{#if nameInSnakeCase}}{{name}}{{else}}{{baseName}}{{/if}}{{/if}}( -{{#if isEnum}} - schemas.EnumBase, -{{/if}} - {{> model_templates/xbase_schema }} -): -{{#if this.classname}} - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. -{{#if description}} - - {{{unescapedDescription}}} -{{/if}} - """ -{{/if}} -{{#unless isStub}} -{{#or hasValidation isEnum getFormat}} - - - class MetaOapg: -{{#if getFormat}} - format = '{{getFormat}}' -{{/if}} - {{> model_templates/validations }} -{{#if isEnum}} -{{#with allowableValues}} - enum_value_to_name = { -{{#each enumVars}} - {{{value}}}: "{{name}}", -{{/each}} - } -{{/with}} -{{/if}} -{{/or}} -{{/unless}} -{{#if isEnum}} - {{> model_templates/enums }} -{{/if}} -{{#if isStub}} -{{#if hasValidation}} -{{#unless isEnum}} - pass -{{/unless}} -{{/if}} -{{/if}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/validations.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/validations.handlebars deleted file mode 100644 index 7e4909e1d94..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/validations.handlebars +++ /dev/null @@ -1,48 +0,0 @@ -{{#neq getUniqueItemsBoolean null}} -unique_items = {{#if getUniqueItemsBoolean}}True{{else}}False{{/if}} -{{/neq}} -{{#neq maxLength null}} -max_length = {{maxLength}} -{{/neq}} -{{#neq minLength null}} -min_length = {{minLength}} -{{/neq}} -{{#neq maxItems null}} -max_items = {{maxItems}} -{{/neq}} -{{#neq minItems null}} -min_items = {{minItems}} -{{/neq}} -{{#neq maxProperties null }} -max_properties = {{maxProperties}} -{{/neq}} -{{#neq minProperties null}} -min_properties = {{minProperties}} -{{/neq}} -{{#neq maximum null}} -{{#if exclusiveMaximum}}exclusive_maximum{{/if}}inclusive_maximum{{#unless exclusiveMaximum}}{{/unless}} = {{maximum}} -{{/neq}} -{{#neq minimum null}} -{{#if exclusiveMinimum}}exclusive_minimum{{/if}}inclusive_minimum{{#unless exclusiveMinimum}}{{/unless}} = {{minimum}} -{{/neq}} -{{#neq pattern null}} -regex=[{ -{{#if vendorExtensions.x-regex}} - 'pattern': r'{{{vendorExtensions.x-regex}}}', # noqa: E501 -{{else}} - 'pattern': r'{{{pattern}}}', # noqa: E501 -{{/if}} -{{#each vendorExtensions.x-modifiers}} -{{#if @first}} - 'flags': ( -{{/if}} - {{#unless @first}}| {{/unless}}re.{{.}} -{{#if @last}} - ) -{{/if}} -{{/each}} -}] -{{/neq}} -{{#neq multipleOf null}} -multiple_of = {{multipleOf}} -{{/neq}} diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/var_equals_cls.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/var_equals_cls.handlebars deleted file mode 100644 index 4e1177d37ba..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/var_equals_cls.handlebars +++ /dev/null @@ -1 +0,0 @@ -{{#if this.classname}}{{classname}}{{else}}{{#if nameInSnakeCase}}{{name}}{{else}}{{baseName}}{{/if}}{{/if}} = {{#or getIsBooleanSchemaTrue getIsBooleanSchemaFalse}}{{#if getIsBooleanSchemaTrue}}schemas.AnyTypeSchema{{else}}schemas.NotAnyTypeSchema{{/if}}{{else}}{{#if complexType}}{{complexType}}{{else}}schemas.{{#if isNullable}}Nullable{{/if}}{{#if getIsNull}}None{{/if}}{{#if isAnyType}}AnyType{{/if}}{{#if isMap}}Dict{{/if}}{{#if isArray}}List{{/if}}{{#if isString}}{{#eq format "date"}}Date{{/eq}}{{#eq format "date-time"}}DateTime{{/eq}}{{#eq format "uuid"}}UUID{{/eq}}{{#eq format "number"}}Decimal{{/eq}}{{#eq format "binary"}}Binary{{/eq}}{{#neq format "date"}}{{#neq format "date-time"}}{{#neq format "uuid"}}{{#neq format "number"}}{{#neq format "binary"}}Str{{/neq}}{{/neq}}{{/neq}}{{/neq}}{{/neq}}{{/if}}{{#if isInteger}}{{#eq format "int32"}}Int32{{/eq}}{{#eq format "int64"}}Int64{{/eq}}{{#neq format "int32"}}{{#neq format "int64"}}Int{{/neq}}{{/neq}}{{/if}}{{#if isNumber}}{{#eq format "float"}}Float32{{/eq}}{{#eq format "double"}}Float64{{/eq}}{{#neq format "float"}}{{#neq format "double"}}Number{{/neq}}{{/neq}}{{/if}}{{#if isBoolean}}Bool{{/if}}Schema{{/if}}{{/or}} diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/xbase_schema.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/xbase_schema.handlebars deleted file mode 100644 index d9543507d79..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/model_templates/xbase_schema.handlebars +++ /dev/null @@ -1,109 +0,0 @@ -{{#if isArray}} -schemas.List{{#if getHasMultipleTypes}}Base,{{else}}Schema{{/if}} -{{/if}} -{{#if isMap}} -schemas.Dict{{#if getHasMultipleTypes}}Base,{{else}}Schema{{/if}} -{{/if}} -{{#if isString}} -{{#if getHasMultipleTypes}} -{{#eq format "date"}} -schemas.DateBase, -{{/eq}} -{{#eq format "date-time"}} -schemas.DateTimeBase, -{{/eq}} -{{#eq format "uuid"}} -schemas.UUIDBase, -{{/eq}} -{{#eq format "number"}} -schemas.DecimalBase, -{{/eq}} -{{#eq format "binary"}} -schemas.BinaryBase, -{{/eq}} -schemas.StrBase, -{{else}} -{{#eq format "date"}} -schemas.DateSchema -{{/eq}} -{{#eq format "date-time"}} -schemas.DateTimeSchema -{{/eq}} -{{#eq format "uuid"}} -schemas.UUIDSchema -{{/eq}} -{{#eq format "number"}} -schemas.DecimalSchema -{{/eq}} -{{#eq format "binary"}} -schemas.BinarySchema -{{/eq}} -{{#neq format "date"}} -{{#neq format "date-time"}} -{{#neq format "uuid"}} -{{#neq format "number"}} -{{#neq format "binary"}} -schemas.StrSchema -{{/neq}} -{{/neq}} -{{/neq}} -{{/neq}} -{{/neq}} -{{/if}} -{{/if}} -{{#if isNumber}} -{{#if getHasMultipleTypes}} -{{#eq format "float"}} -schemas.Float32Base, -{{/eq}} -{{#eq format "double"}} -schemas.Float64Base, -{{/eq}} -schemas.NumberBase, -{{else}} -{{#eq format "float"}} -schemas.Float32Schema -{{/eq}} -{{#eq format "double"}} -schemas.Float64Schema -{{/eq}} -{{#neq format "float"}} -{{#neq format "double"}} -schemas.NumberSchema -{{/neq}} -{{/neq}} -{{/if}} -{{/if}} -{{#if isInteger}} -{{#if getHasMultipleTypes}} -{{#eq format "int32"}} -schemas.Int32Base, -{{/eq}} -{{#eq format "int64"}} -schemas.Int64Base, -{{/eq}} -schemas.IntBase, -{{else}} -{{#eq format "int32"}} -schemas.Int32Schema -{{/eq}} -{{#eq format "int64"}} -schemas.Int64Schema -{{/eq}} -{{#neq format "int32"}} -{{#neq format "int64"}} -schemas.IntSchema -{{/neq}} -{{/neq}} -{{/if}} -{{/if}} -{{#if isBoolean}} -schemas.Bool{{#if getHasMultipleTypes}}Base,{{else}}Schema{{/if}} -{{/if}} -{{#if isNull}} -schemas.None{{#if getHasMultipleTypes}}Base,{{else}}Schema{{/if}} -{{/if}} -{{#if getHasMultipleTypes}} -schemas.Schema, -schemas.{{#if isNull}}None{{/if}}{{#if isMap}}FrozenDict{{/if}}{{#if isArray}}Tuple{{/if}}{{#if isString }}Str{{/if}}{{#or isInteger isNumber}}Decimal{{/or}}{{#if isBoolean}}Bool{{/if}}Mixin -{{/if}} diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/model_test.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/model_test.handlebars deleted file mode 100644 index 9f6de3a8352..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/model_test.handlebars +++ /dev/null @@ -1,45 +0,0 @@ -# coding: utf-8 - -{{>partial_header}} - -import unittest - -import {{packageName}} -{{#each models}} -{{#with model}} -from {{packageName}}.{{modelPackage}}.{{classFilename}} import {{classname}} -from {{packageName}} import configuration - - -class Test{{classname}}(unittest.TestCase): - """{{classname}} unit test stubs""" - _configuration = configuration.Configuration() - -{{#each testCases}} -{{#with this }} - def test_{{@key}}_{{#if valid}}passes{{else}}fails{{/if}}(self): - # {{description}} -{{#if valid}} - {{classname}}.from_openapi_data_oapg( -{{#with data}} - {{> model_templates/payload_renderer endChar=',' }} -{{/with}} - _configuration=self._configuration - ) -{{else}} - with self.assertRaises(({{packageName}}.ApiValueError, {{packageName}}.ApiTypeError)): - {{classname}}.from_openapi_data_oapg( -{{#with data}} - {{> model_templates/payload_renderer endChar=','}} -{{/with}} - _configuration=self._configuration - ) -{{/if}} -{{/with}} - -{{/each}} -{{/with}} -{{/each}} - -if __name__ == '__main__': - unittest.main() diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/partial_header.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/partial_header.handlebars deleted file mode 100644 index 19b633be257..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/partial_header.handlebars +++ /dev/null @@ -1,17 +0,0 @@ -""" -{{#if appName}} - {{{appName}}} -{{/if}} - -{{#if appDescription}} - {{{appDescription}}} # noqa: E501 -{{/if}} - - {{#if version}} - The version of the OpenAPI document: {{{version}}} - {{/if}} - {{#if infoEmail}} - Contact: {{{infoEmail}}} - {{/if}} - Generated by: https://openapi-generator.tech -""" diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/paths/__init__paths.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/paths/__init__paths.hbs new file mode 100644 index 00000000000..e1d03ccec8c --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/paths/__init__paths.hbs @@ -0,0 +1,3 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from {{packageName}}.apis import path_to_api diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/__init__path.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/__init__path.hbs new file mode 100644 index 00000000000..ca2e2e84703 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/__init__path.hbs @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from {{packageName}}.apis.paths.{{pathModule}} import {{apiClassName}} + +path = "{{{path}}}" \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/_helper_operation_args.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/_helper_operation_args.hbs new file mode 100644 index 00000000000..eb933783332 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/_helper_operation_args.hbs @@ -0,0 +1,68 @@ + self, +{{#if requestBody}} + {{> paths/path/verb/_helper_operation_args_request_body }} +{{else}} + {{#if isOverload}} + {{#eq skipDeserialization "True"}} + skip_deserialization: typing_extensions.Literal[True], + {{/eq}} + {{/if}} +{{/if}} +{{#if queryParams}} + query_params: RequestQueryParameters.Params = frozendict.frozendict(), +{{/if}} +{{#if headerParams}} + header_params: RequestHeaderParameters.Params = frozendict.frozendict(), +{{/if}} +{{#if pathParams}} + path_params: RequestPathParameters.Params = frozendict.frozendict(), +{{/if}} +{{#if cookieParams}} + cookie_params: RequestCookieParameters.Params = frozendict.frozendict(), +{{/if}} +{{#if produces}} + accept_content_types: typing.Tuple[str] = _all_accept_content_types, +{{/if}} +{{#neq security null}} + {{#gt security.size 0}} + security_index: typing.Optional[int] = None, + {{/gt}} +{{else}} + {{#neq rootSecurity null}} + {{#gt rootSecurity.size 0}} + security_index: typing.Optional[int] = None, + {{/gt}} + {{/neq}} +{{/neq}} + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + {{#if isOverload}} + {{#eq skipDeserialization "False"}} + skip_deserialization: typing_extensions.Literal[False] = ..., + {{/eq}} + {{#eq skipDeserialization "null"}} + skip_deserialization: bool = ..., + {{/eq}} + {{else}} + skip_deserialization: bool = False, + {{/if}} +{{#eq skipDeserialization "True"}} +) -> api_client.ApiResponseWithoutDeserialization: ... +{{/eq}} +{{#eq skipDeserialization "False"}} +) -> {{#if getAllResponsesAreErrors}}api_client.ApiResponseWithoutDeserialization: ...{{else}}{{#gt getNonErrorResponses.size 1}}typing.Union[ + {{> paths/path/verb/_helper_operation_response_type_hint multiple=true }} +]{{else}}{{> paths/path/verb/_helper_operation_response_type_hint multiple=false }}{{/gt}}: ... + {{/if}} +{{/eq}} +{{#eq skipDeserialization "null"}} +{{#if isOverload}} +) -> typing.Union[ + {{> paths/path/verb/_helper_operation_response_type_hint multiple=true }} + api_client.ApiResponseWithoutDeserialization, +]: ... +{{else}} +): +{{/if}} +{{/eq}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/_helper_operation_args_passed.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/_helper_operation_args_passed.hbs new file mode 100644 index 00000000000..a1159840ad6 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/_helper_operation_args_passed.hbs @@ -0,0 +1,50 @@ +{{#if requestBody}} +{{#with requestBody}} +body=body, +{{/with}} +{{/if}} +{{#if queryParams}} +query_params=query_params, +{{/if}} +{{#if headerParams}} +header_params=header_params, +{{/if}} +{{#if pathParams}} +path_params=path_params, +{{/if}} +{{#if cookieParams}} +cookie_params=cookie_params, +{{/if}} +{{#with requestBody}} + {{#if refInfo}} + {{#each getDeepestRef.content}} + {{#if @first}} +content_type=content_type, + {{/if}} + {{/each}} + {{else}} + {{#each content}} + {{#if @first}} +content_type=content_type, + {{/if}} + {{/each}} + {{/if}} +{{/with}} +{{#if produces}} +accept_content_types=accept_content_types, +{{/if}} +{{#neq security null}} + {{#gt security.size 0}} +security_index=security_index, + {{/gt}} +{{else}} + {{#neq rootSecurity null}} + {{#gt rootSecurity.size 0}} +security_index=security_index, + {{/gt}} + {{/neq}} +{{/neq}} +server_index=server_index, +stream=stream, +timeout=timeout, +skip_deserialization=skip_deserialization diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/_helper_operation_args_request_body.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/_helper_operation_args_request_body.hbs new file mode 100644 index 00000000000..97996de9ca6 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/_helper_operation_args_request_body.hbs @@ -0,0 +1,223 @@ +{{#if requestBody.refInfo}} +{{! $ref requestBody }} + {{#if requestBody.getDeepestRef.required}} + {{! required }} + {{#with requestBody.getDeepestRef}} + {{#eq ../contentType "null"}} +body: typing.Union[ + {{#each content}} + request_body.{{../../requestBody.jsonPathPiece.camelCase}}.content["{{{@key.original}}}"].schema, + {{/each}} + {{#each getContentSchemas}} + {{> _helper_schema_python_types_newline }} + {{/each}} +], + {{else}} +body: typing.Union[ + {{#each content}} + {{#eq @key.original ../../contentType }} + request_body.{{../../requestBody.jsonPathPiece.camelCase}}.content["{{{@key.original}}}"].schema, + {{#with this.schema.getSelfOrDeepestRef}} + {{> _helper_schema_python_types_newline }} + {{/with}} + {{/eq}} + {{/each}} +], + {{/eq}} + {{/with}} + {{#if isOverload}} + {{#eq skipDeserialization "True"}} +skip_deserialization: typing_extensions.Literal[True], + {{/eq}} + {{#neq contentType "null"}} + {{#with requestBody.getDeepestRef}} + {{#each content}} + {{#eq @key.original ../../contentType}} + {{#if @first}} +content_type: typing_extensions.Literal["{{{@key.original}}}"] = ..., + {{else}} +content_type: typing_extensions.Literal["{{{@key.original}}}"], + {{/if}} + {{/eq}} + {{/each}} + {{/with}} + {{else}} +content_type: str = ..., + {{/neq}} + {{else}} + {{#with requestBody.getDeepestRef}} + {{#each content}} + {{#if @first}} +content_type: str = '{{{@key.original}}}', + {{/if}} + {{/each}} + {{/with}} + {{/if}} + {{else}} + {{! optional }} + {{#if isOverload}} + {{#eq skipDeserialization "True"}} +skip_deserialization: typing_extensions.Literal[True], + {{/eq}} + {{#neq contentType "null"}} + {{#with requestBody.getDeepestRef}} + {{#each content}} + {{#eq @key.original ../../contentType}} + {{#if @first}} +content_type: typing_extensions.Literal["{{{@key.original}}}"] = ..., + {{else}} +content_type: typing_extensions.Literal["{{{@key.original}}}"], + {{/if}} + {{/eq}} + {{/each}} + {{/with}} + {{else}} +content_type: str = ..., + {{/neq}} + {{else}} + {{#with requestBody.getDeepestRef}} + {{#each content}} + {{#if @first}} +content_type: str = '{{{@key.original}}}', + {{/if}} + {{/each}} + {{/with}} + {{/if}} + {{#with requestBody.getDeepestRef}} + {{#eq ../contentType "null"}} +body: typing.Union[ + {{#each content}} + request_body.{{../../requestBody.jsonPathPiece.camelCase}}.content["{{{@key.original}}}"].schema, + {{/each}} + {{#each getContentSchemas}} + schemas.Unset, + {{> _helper_schema_python_types_newline }} + {{/each}} +] = schemas.unset, + {{else}} +body: typing.Union[ + {{#each content}} + {{#eq @key.original ../../contentType }} + request_body.{{../../requestBody.jsonPathPiece.camelCase}}.content["{{{@key.original}}}"].schema, + schemas.Unset, + {{#with this.schema.getSelfOrDeepestRef}} + {{> _helper_schema_python_types_newline }} + {{/with}} + {{/eq}} + {{/each}} +] = schemas.unset, + {{/eq}} + {{/with}} + {{/if}} +{{else}} +{{! inline requestBody }} + {{#if requestBody.required}} + {{! required }} + {{#with requestBody}} + {{#eq ../contentType "null"}} +body: typing.Union[ + {{#each content}} + request_body.{{../jsonPathPiece.camelCase}}.content["{{{@key.original}}}"].schema, + {{/each}} + {{#each getContentSchemas}} + {{> _helper_schema_python_types_newline }} + {{/each}} +], + {{else}} +body: typing.Union[ + {{#each content}} + {{#eq @key.original ../../contentType }} + request_body.{{../jsonPathPiece.camelCase}}.content["{{{@key.original}}}"].schema, + {{#with this.schema.getSelfOrDeepestRef}} + {{> _helper_schema_python_types_newline }} + {{/with}} + {{/eq}} + {{/each}} +], + {{/eq}} + {{/with}} + {{#if isOverload}} + {{#eq skipDeserialization "True"}} +skip_deserialization: typing_extensions.Literal[True], + {{/eq}} + {{#neq contentType "null"}} + {{#with requestBody}} + {{#each content}} + {{#eq @key.original ../../contentType}} + {{#if @first}} +content_type: typing_extensions.Literal["{{{@key.original}}}"] = ..., + {{else}} +content_type: typing_extensions.Literal["{{{@key.original}}}"], + {{/if}} + {{/eq}} + {{/each}} + {{/with}} + {{else}} +content_type: str = ..., + {{/neq}} + {{else}} + {{#with requestBody}} + {{#each content}} + {{#if @first}} +content_type: str = '{{{@key.original}}}', + {{/if}} + {{/each}} + {{/with}} + {{/if}} + {{else}} + {{! optional }} + {{#if isOverload}} + {{#eq skipDeserialization "True"}} +skip_deserialization: typing_extensions.Literal[True], + {{/eq}} + {{#neq contentType "null"}} + {{#with requestBody}} + {{#each content}} + {{#eq @key.original ../../contentType}} + {{#if @first}} +content_type: typing_extensions.Literal["{{{@key.original}}}"] = ..., + {{else}} +content_type: typing_extensions.Literal["{{{@key.original}}}"], + {{/if}} + {{/eq}} + {{/each}} + {{/with}} + {{else}} +content_type: str = ..., + {{/neq}} + {{else}} + {{#with requestBody}} + {{#each content}} + {{#if @first}} +content_type: str = '{{{@key.original}}}', + {{/if}} + {{/each}} + {{/with}} + {{/if}} + {{#with requestBody}} + {{#eq ../contentType "null"}} +body: typing.Union[ + {{#each content}} + request_body.{{../jsonPathPiece.camelCase}}.content["{{{@key.original}}}"].schema, + {{/each}} + schemas.Unset, + {{#each getContentSchemas}} + {{> _helper_schema_python_types_newline }} + {{/each}} +] = schemas.unset, + {{else}} +body: typing.Union[ + {{#each content}} + {{#eq @key.original ../../contentType }} + request_body.{{../jsonPathPiece.camelCase}}.content["{{{@key.original}}}"].schema, + schemas.Unset, + {{#with this.schema.getSelfOrDeepestRef}} + {{> _helper_schema_python_types_newline }} + {{/with}} + {{/eq}} + {{/each}} +] = schemas.unset, + {{/eq}} + {{/with}} + {{/if}} +{{/if}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/_helper_operation_body_serialization.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/_helper_operation_body_serialization.hbs new file mode 100644 index 00000000000..0d145386074 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/_helper_operation_body_serialization.hbs @@ -0,0 +1,6 @@ +serialized_data = request_body.{{jsonPathPiece.camelCase}}.serialize(body, content_type) +_headers.add('Content-Type', content_type) +if 'fields' in serialized_data: + _fields = serialized_data['fields'] +elif 'body' in serialized_data: + _body = serialized_data['body'] diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/_helper_operation_doc_configuration_partial.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/_helper_operation_doc_configuration_partial.hbs new file mode 100644 index 00000000000..4e121d70b98 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/_helper_operation_doc_configuration_partial.hbs @@ -0,0 +1,49 @@ +{{#neq security null}} + {{#gt security.size 0}} + {{#each security}} + {{#neq this.size 0}} +# security_index {{@key}} + {{#each this}} +from {{packageName}}.components.security_schemes import {{refInfo.refModule}} + {{/each}} + {{/neq}} + {{/each}} + {{/gt}} +{{else}} + {{#neq rootSecurity null}} + {{#gt rootSecurity.size 0}} + {{#each rootSecurity}} + {{#neq this.size 0}} +# security_index {{@key}} + {{#each this}} +from {{packageName}}.components.security_schemes import {{refInfo.refModule}} + {{/each}} + {{/neq}} + {{/each}} + {{/gt}} + {{/neq}} +{{/neq}} +{{#neq security null}} + {{#gt security.size 0}} +{{> paths/path/verb/_helper_operation_doc_security_scheme_info_partial }} + {{/gt}} +{{else}} + {{#neq rootSecurity null}} + {{#gt rootSecurity.size 0}} +{{> paths/path/verb/_helper_operation_doc_security_scheme_info_partial security=rootSecurity }} + {{/gt}} + {{/neq}} +{{/neq}} +used_configuration = api_configuration.ApiConfiguration( +{{#neq security null}} + {{#gt security.size 0}} + security_scheme_info=security_scheme_info + {{/gt}} +{{else}} + {{#neq rootSecurity null}} + {{#gt rootSecurity.size 0}} + security_scheme_info=security_scheme_info + {{/gt}} + {{/neq}} +{{/neq}} +) diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/_helper_operation_doc_example.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/_helper_operation_doc_example.hbs new file mode 100644 index 00000000000..7794cb33ad6 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/_helper_operation_doc_example.hbs @@ -0,0 +1,281 @@ +```python +import {{{packageName}}} +from {{packageName}}.configurations import api_configuration +{{#if tag}} +from {{packageName}}.{{apiPackage}}.tags import {{tag.moduleName}} +{{else}} + {{#each tags}} + {{#if @first}} +from {{packageName}}.{{apiPackage}}.tags import {{moduleName}} + {{/if}} + {{/each}} +{{/if}} +{{#or pathParams queryParams headerParams cookieParams}} +from {{packageName}}.paths.{{path.snakeCase}}.{{jsonPathPiece.original}} import operation +{{/or}} +{{#each imports}} +{{{.}}} +{{/each}} +from pprint import pprint +{{> paths/path/verb/_helper_operation_doc_configuration_partial }} +# Enter a context with an instance of the API client +with {{{packageName}}}.ApiClient(used_configuration) as api_client: + # Create an instance of the API class +{{#if tag}} + api_instance = {{tag.moduleName}}.{{tag.className}}(api_client) +{{else}} +{{#each tags}} +{{#if @first}} + api_instance = {{moduleName}}.{{className}}(api_client) +{{/if}} +{{/each}} +{{/if}} +{{#if hasRequiredParamOrBody}} + + # example passing only required values which don't have defaults set + {{#if pathParams}} + path_params: operation.RequestPathParameters.Params = { + {{#each pathParams}} + {{#if refInfo}} + {{#if getDeepestRef.required}} + '{{getDeepestRef.name}}': {{{getDeepestRef.example}}}, + {{/if}} + {{else}} + {{#if required}} + '{{name}}': {{{example}}}, + {{/if}} + {{/if}} + {{/each}} + } + {{/if}} + {{#if queryParams}} + query_params: operation.RequestQueryParameters.Params = { + {{#each queryParams}} + {{#if refInfo}} + {{#if getDeepestRef.required}} + '{{getDeepestRef.name}}': {{{getDeepestRef.example}}}, + {{/if}} + {{else}} + {{#if required}} + '{{name}}': {{{example}}}, + {{/if}} + {{/if}} + {{/each}} + } + {{/if}} + {{#if cookieParams}} + cookie_params: operation.RequestCookieParameters.Params = { + {{#each cookieParams}} + {{#if refInfo}} + {{#if getDeepestRef.required}} + '{{getDeepestRef.name}}': {{{getDeepestRef.example}}}, + {{/if}} + {{else}} + {{#if required}} + '{{name}}': {{{example}}}, + {{/if}} + {{/if}} + {{/each}} + } + {{/if}} + {{#if headerParams}} + header_params: operation.RequestHeaderParameters.Params = { + {{#each headerParams}} + {{#if refInfo}} + {{#if getDeepestRef.required}} + '{{getDeepestRef.name}}': {{{getDeepestRef.example}}}, + {{/if}} + {{else}} + {{#if required}} + '{{name}}': {{{example}}}, + {{/if}} + {{/if}} + {{/each}} + } + {{/if}} + {{#with requestBody}} + {{#if refInfo}} + {{#if getDeepestRef.required}} + {{#each getDeepestRef.content}} + {{#if @first}} + {{#with this.schema}} + body = {{{example}}} + {{/with}} + {{/if}} + {{/each}} + {{/if}} + {{else}} + {{#if required}} + {{#each content}} + {{#if @first}} + {{#with this.schema}} + body = {{{example}}} + {{/with}} + {{/if}} + {{/each}} + {{/if}} + {{/if}} + {{/with}} + try: + {{#if summary}} + # {{{summary}}} + {{/if}} + api_response = api_instance.{{{operationId.snakeCase}}}( + {{#if pathParams}} + path_params=path_params, + {{/if}} + {{#if queryParams}} + query_params=query_params, + {{/if}} + {{#if headerParams}} + header_params=header_params, + {{/if}} + {{#if cookieParams}} + cookie_params=cookie_params, + {{/if}} + {{#with requestBody}} + {{#if refInfo}} + {{#if getDeepestRef.required}} + body=body, + {{/if}} + {{else}} + {{#if required}} + body=body, + {{/if}} + {{/if}} + {{/with}} + ) + pprint(api_response) + except {{{packageName}}}.ApiException as e: + {{#if tag}} + print("Exception when calling {{tag.className}}->{{operationId.snakeCase}}: %s\n" % e) + {{else}} + {{#each tags}} + {{#if @first}} + print("Exception when calling {{className}}->{{operationId.snakeCase}}: %s\n" % e) + {{/if}} + {{/each}} + {{/if}} +{{/if}} +{{#if hasOptionalParamOrBody}} + + # example passing only optional values + {{#if pathParams}} + path_params = { + {{#each pathParams}} + {{#if refInfo}} + '{{getDeepestRef.name}}': {{{getDeepestRef.example}}}, + {{else}} + '{{name}}': {{{example}}}, + {{/if}} + {{/each}} + } + {{/if}} + {{#if queryParams}} + query_params: operation.RequestQueryParameters.Params = { + {{#each queryParams}} + {{#if refInfo}} + '{{getDeepestRef.name}}': {{{getDeepestRef.example}}}, + {{else}} + '{{name}}': {{{example}}}, + {{/if}} + {{/each}} + } + {{/if}} + {{#if cookieParams}} + cookie_params: operation.RequestCookieParameters.Params = { + {{#each cookieParams}} + {{#if refInfo}} + '{{getDeepestRef.name}}': {{{getDeepestRef.example}}}, + {{else}} + '{{name}}': {{{example}}}, + {{/if}} + {{/each}} + } + {{/if}} + {{#if headerParams}} + header_params: operation.RequestHeaderParameters.Params = { + {{#each headerParams}} + {{#if refInfo}} + '{{getDeepestRef.name}}': {{{getDeepestRef.example}}}, + {{else}} + '{{name}}': {{{example}}}, + {{/if}} + {{/each}} + } + {{/if}} + {{#with requestBody}} + {{#if refInfo}} + {{#each getDeepestRef.content}} + {{#if @first}} + {{#with this.schema}} + body = {{{example}}} + {{/with}} + {{/if}} + {{/each}} + {{else}} + {{#each content}} + {{#if @first}} + {{#with this.schema}} + body = {{{example}}} + {{/with}} + {{/if}} + {{/each}} + {{/if}} + {{/with}} + try: + {{#if summary}} + # {{{summary}}} + {{/if}} + api_response = api_instance.{{{operationId.snakeCase}}}( + {{#if pathParams}} + path_params=path_params, + {{/if}} + {{#if queryParams}} + query_params=query_params, + {{/if}} + {{#if headerParams}} + header_params=header_params, + {{/if}} + {{#if cookieParams}} + cookie_params=cookie_params, + {{/if}} + {{#if requestBody}} + body=body, + {{/if}} + ) + pprint(api_response) + except {{{packageName}}}.ApiException as e: + {{#if tag}} + print("Exception when calling {{tag.className}}->{{operationId.snakeCase}}: %s\n" % e) + {{else}} + {{#each tags}} + {{#if @first}} + print("Exception when calling {{className}}->{{operationId.snakeCase}}: %s\n" % e) + {{/if}} + {{/each}} + {{/if}} +{{/if}} +{{#unless hasRequiredParamOrBody}} +{{#unless hasOptionalParamOrBody}} + + # example, this endpoint has no required or optional parameters + try: + {{#if summary}} + # {{{summary}}} + {{/if}} + api_response = api_instance.{{{operationId.snakeCase}}}() + pprint(api_response) + except {{{packageName}}}.ApiException as e: + {{#if tag}} + print("Exception when calling {{tag.className}}->{{operationId.snakeCase}}: %s\n" % e) + {{else}} + {{#each tags}} + {{#if @first}} + print("Exception when calling {{className}}->{{operationId.snakeCase}}: %s\n" % e) + {{/if}} + {{/each}} + {{/if}} +{{/unless}} +{{/unless}} +``` diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/_helper_operation_doc_security_scheme_info_partial.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/_helper_operation_doc_security_scheme_info_partial.hbs new file mode 100644 index 00000000000..042d4e60328 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/_helper_operation_doc_security_scheme_info_partial.hbs @@ -0,0 +1,53 @@ + {{#each security}} + +# security_scheme_info for security_index {{@key}} + {{#eq this.size 0}} +# no auth required for this security_index +security_scheme_info: api_configuration.SecuritySchemeInfo = {} + {{else}} +security_scheme_info: api_configuration.SecuritySchemeInfo = { + {{#each this}} + "{{{@key}}}": {{refInfo.refModule}}.{{refInfo.refClass}}( + {{#with refInfo.ref}} + {{#eq type "apiKey"}} + api_key='sampleApiKeyValue' + {{else}} + {{#eq type "http"}} + {{#eq scheme "basic"}} + user_id='someUserIdOrName', + password='somePassword', + {{else}} + {{#eq scheme "bearer"}} + access_token='someAccessToken' + {{else}} + {{#eq scheme "signature"}} + signing_info={{packageName}}.signing.HttpSigningConfiguration( + key_id='my-key-id', + private_key_path='rsa.pem', + signing_scheme={{{packageName}}}.signing.SCHEME_HS2019, + signing_algorithm={{{packageName}}}.signing.ALGORITHM_RSASSA_PSS, + signed_headers=[ + {{{packageName}}}.signing.HEADER_REQUEST_TARGET, + {{{packageName}}}.signing.HEADER_CREATED, + {{{packageName}}}.signing.HEADER_EXPIRES, + {{{packageName}}}.signing.HEADER_HOST, + {{{packageName}}}.signing.HEADER_DATE, + {{{packageName}}}.signing.HEADER_DIGEST, + 'Content-Type', + 'User-Agent' + ], + signature_max_validity=datetime.timedelta(minutes=5) + ) + + {{/eq}} + {{/eq}} + {{/eq}} + {{/eq}} + {{/eq}} + ), + {{/with}} + {{/each}} +} + {{/eq}} + + {{/each}} diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/_helper_operation_docs_xparams.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/_helper_operation_docs_xparams.hbs new file mode 100644 index 00000000000..469c50dc9a4 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/_helper_operation_docs_xparams.hbs @@ -0,0 +1,37 @@ +{{#if parameters}} + +{{headerSize}}## {{paramPrefix}}_params +{{headerSize}}### Request{{paramType}}Parameters.Params +This is a TypedDict + +Key | Input Type | Description | Notes +------------- | ------------- | ------------- | ------------- + {{#each parameters}} + {{#if refInfo}} + {{#with getDeepestRef}} + {{#if schema}} +{{name}} | [{{../refInfo.refClass}}.schema](../../../components/parameters/{{../refInfo.refModule}}.md#schema), {{#with schema}}{{> _helper_schema_python_types }}{{/with}} | | {{#unless required}}optional{{/unless}} + {{else}} + {{#each content}} +{{../name}} | [{{../../refInfo.refClass}}.content.{{@key.snakeCase}}.schema](#{{> components/_helper_anchor_id identifierPieces=(append (newArray ) "content" @key this.schema.jsonPathPiece) }}), {{#with schema}}{{> _helper_schema_python_types }}{{/with}} | | {{#unless required}}optional{{/unless}} + {{/each}} + {{/if}} + {{/with}} + {{else}} + {{#if schema}} +{{name}} | [{{jsonPathPiece.camelCase}}.schema](#{{> components/_helper_anchor_id identifierPieces=(append identifierPieces jsonPathPiece schema.jsonPathPiece) }}), {{#with schema}}{{> _helper_schema_python_types }}{{/with}} | | {{#unless required}}optional{{/unless}} + {{else}} + {{#each content}} +{{../name}} | [{{../jsonPathPiece.camelCase}}.content.{{@key.snakeCase}}.schema](#{{> components/_helper_anchor_id identifierPieces=(append identifierPieces ../jsonPathPiece "content" @key this.schema.jsonPathPiece) }}), {{#with schema}}{{> _helper_schema_python_types }}{{/with}} | | {{#unless required}}optional{{/unless}} + {{/each}} + {{/if}} + {{/if}} + {{/each}} + + {{#each parameters as | parameter |}} + {{#unless parameter.refInfo}} + +{{> components/parameters/parameter_doc headerSize=(join headerSize "###" "") identifierPieces=(append identifierPieces jsonPathPiece) }} + {{/unless}} + {{/each}} +{{/if}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/_helper_operation_parameter_schema_and_def.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/_helper_operation_parameter_schema_and_def.hbs new file mode 100644 index 00000000000..f567525a015 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/_helper_operation_parameter_schema_and_def.hbs @@ -0,0 +1,63 @@ + + +class {{xParamsName}}: + RequiredParams = typing_extensions.TypedDict( + 'RequiredParams', + { +{{#each xParams}} +{{#if refInfo}} + {{#if getDeepestRef.required}} + {{#if getDeepestRef.schema}} + '{{getDeepestRef.name}}': typing.Union[{{jsonPathPiece.snakeCase}}.{{jsonPathPiece.camelCase}}.schema, {{#with getDeepestRef.schema}}{{> _helper_schema_python_types }}{{/with}}], + {{else}} + '{{getDeepestRef.name}}': typing.Union[{{jsonPathPiece.snakeCase}}.{{jsonPathPiece.camelCase}}.content["{{#each getDeepestRef.content}}{{{@key.original}}}"].schema, {{#with this}}{{#with schema}}{{> _helper_schema_python_types }}{{/with}}{{/with}}{{/each}}], + {{/if}} + {{/if}} +{{else}} + {{#if required}} + {{#if schema}} + '{{name}}': typing.Union[{{jsonPathPiece.snakeCase}}.{{jsonPathPiece.camelCase}}.schema, {{#with schema}}{{> _helper_schema_python_types }}{{/with}}], + {{else}} + '{{name}}': typing.Union[{{jsonPathPiece.snakeCase}}.{{jsonPathPiece.camelCase}}.content["{{#each content}}{{{@key.original}}}"].schema, {{#with this}}{{#with schema}}{{> _helper_schema_python_types }}{{/with}}{{/with}}{{/each}}], + {{/if}} + {{/if}} +{{/if}} +{{/each}} + } + ) + OptionalParams = typing_extensions.TypedDict( + 'OptionalParams', + { +{{#each xParams}} +{{#if refInfo}} + {{#unless getDeepestRef.required}} + {{#if getDeepestRef.schema}} + '{{getDeepestRef.name}}': typing.Union[{{jsonPathPiece.snakeCase}}.{{jsonPathPiece.camelCase}}.schema, {{#with getDeepestRef.schema}}{{> _helper_schema_python_types }}{{/with}}], + {{else}} + '{{getDeepestRef.name}}': typing.Union[{{jsonPathPiece.snakeCase}}.{{jsonPathPiece.camelCase}}.content["{{#each getDeepestRef.content}}{{{@key.original}}}"].schema, {{#with this}}{{#with schema}}{{> _helper_schema_python_types }}{{/with}}{{/with}}{{/each}}], + {{/if}} + {{/unless}} +{{else}} + {{#unless required}} + {{#if schema}} + '{{name}}': typing.Union[{{jsonPathPiece.snakeCase}}.{{jsonPathPiece.camelCase}}.schema, {{#with schema}}{{> _helper_schema_python_types }}{{/with}}], + {{else}} + '{{name}}': typing.Union[{{jsonPathPiece.snakeCase}}.{{jsonPathPiece.camelCase}}.content["{{#each content}}{{{@key.original}}}"].schema, {{#with this}}{{#with schema}}{{> _helper_schema_python_types }}{{/with}}{{/with}}{{/each}}], + {{/if}} + {{/unless}} +{{/if}} +{{/each}} + }, + total=False + ) + + + class Params(RequiredParams, OptionalParams): + pass + + + parameters = [ + {{#each xParams}} + {{jsonPathPiece.snakeCase}}.{{jsonPathPiece.camelCase}}, + {{/each}} + ] \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/_helper_operation_response_type_hint.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/_helper_operation_response_type_hint.hbs new file mode 100644 index 00000000000..c0f1e989ef2 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/_helper_operation_response_type_hint.hbs @@ -0,0 +1,4 @@ +{{#each getNonErrorResponses}} +{{jsonPathPiece.snakeCase}}.{{jsonPathPiece.camelCase}}.response_cls{{#if multiple}}, +{{/if}} +{{/each}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/_helper_operation_test_partial.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/_helper_operation_test_partial.hbs new file mode 100644 index 00000000000..5f672e74179 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/_helper_operation_test_partial.hbs @@ -0,0 +1,21 @@ +api_response = self.api.{{httpMethod.original}}( +{{#if requestBody}} + body=body, + content_type=content_type +{{/if}} +{{#if produces}} + accept_content_types=(accept_content_type,) +{{/if}} +) +self.assert_pool_manager_request_called_with( + mock_request, + self.api_config.get_server_url('servers', None) + "{{{path.original}}}", + method='{{httpMethod.original}}'.upper(), +{{#if requestBody}} + body=self.json_bytes(payload), + content_type=content_type, +{{/if}} +{{#if produces}} + accept_content_type=accept_content_type, +{{/if}} +) diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/_helper_operation_test_response_content.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/_helper_operation_test_response_content.hbs new file mode 100644 index 00000000000..cdb2886c9ec --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/_helper_operation_test_response_content.hbs @@ -0,0 +1,53 @@ +{{#if content}} +{{#each content}} + {{#if schema}} +response_body_schema = {{httpMethod.original}}.{{responseModuleName}}.{{responseClassName}}.content["{{{@key.original}}}"].schema + {{/if}} +{{#if this.testCases}} +{{#each testCases}} +{{#with this }} + +def test_{{@key}}_{{#if valid}}passes{{else}}fails{{/if}}(self): + # {{description}} + accept_content_type = '{{{../@key.original}}}' + + with patch.object(urllib3.PoolManager, 'request') as mock_request: + payload = ( + {{#with data}} + {{> components/schemas/_helper_payload_renderer endChar='' }} + {{/with}} + ) + mock_request.return_value = self.response( + self.json_bytes(payload), + status=self.response_status + ) + {{#if valid}} + {{> paths/path/verb/_helper_operation_test_partial }} + + assert isinstance(api_response.response, urllib3.HTTPResponse) + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( + payload, + configuration_=self.schema_config + ) + assert api_response.body == deserialized_response_body + {{else}} + with self.assertRaises(({{packageName}}.ApiValueError, {{packageName}}.ApiTypeError)): + self.api.{{httpMethod.original}}( + accept_content_types=(accept_content_type,) + ) + self.assert_pool_manager_request_called_with( + mock_request, + self.api_config.get_server_url('servers', None) + "{{{path.original}}}", + method='{{httpMethod.original}}'.upper(), + content_type=None, + accept_content_type=accept_content_type, + ) + {{/if}} +{{/with}} +{{/each}} +{{/if}} +{{/each}} +{{else}} +response_body = '' +{{/if}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/operation.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/operation.hbs new file mode 100644 index 00000000000..612f3f3c904 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/operation.hbs @@ -0,0 +1,488 @@ +# coding: utf-8 + +{{> _helper_header }} + +from dataclasses import dataclass +import typing_extensions +import urllib3 +{{#with operation}} +{{#or headerParams requestBody produces}} +from urllib3._collections import HTTPHeaderDict +{{/or}} +{{/with}} + +from {{packageName}} import api_client, exceptions{{#neq operation.security null}}{{#gt operation.security.size 0}}, security_schemes{{/gt}}{{else}}{{#neq security null}}{{#gt security.size 0}}, security_schemes{{/gt}}{{/neq}}{{/neq}} +{{#eq operation.security null}} + {{#neq security null}} + {{#gt security.size 0}} + {{#eq security.size 1}} + {{#each security}} +from {{packageName}}.security import security_requirement_object_{{@key}} + {{/each}} + {{else}} +from {{packageName}}.security import ( + {{#each security}} + security_requirement_object_{{@key}}, + {{/each}} +) + {{/eq}} + {{/gt}} + {{/neq}} +{{/eq}} +{{> _helper_imports_schema_types }} +{{#if imports}} + +{{/if}} +{{> _helper_imports }} +{{#with operation}} + +from .. import path +{{#if responses}} + {{#eq responses.size 1}} + {{#each responses}} +from .responses import response_{{@key}} + {{/each}} + {{else}} +from .responses import ( + {{#each responses}} + {{jsonPathPiece.snakeCase}}, + {{/each}} +) + {{/eq}} +{{/if}} +{{#if requestBody}} +from . import request_body +{{/if}} +{{#gt allParams.size 0}} + {{#eq allParams.size 1}} + {{#each allParams}} +from .parameters import {{jsonPathPiece.snakeCase}} + {{/each}} + {{else}} +from .parameters import ( + {{#each allParams}} + {{jsonPathPiece.snakeCase}}, + {{/each}} +) + {{/eq}} +{{/gt}} +{{#neq security null}} + {{#gt security.size 0}} + {{#eq security.size 1}} + {{#each security}} +from .security import security_requirement_object_{{@key}} + {{/each}} + {{else}} +from .security import ( + {{#each security}} + security_requirement_object_{{@key}}, + {{/each}} +) + {{/eq}} + {{/gt}} +{{/neq}} + +{{#or queryParams headerParams pathParams cookieParams}} + {{#if queryParams}} +{{> paths/path/verb/_helper_operation_parameter_schema_and_def xParams=queryParams xParamsName="RequestQueryParameters" }} + {{/if}} + {{#if headerParams}} +{{> paths/path/verb/_helper_operation_parameter_schema_and_def xParams=headerParams xParamsName="RequestHeaderParameters" }} + {{/if}} + {{#if pathParams}} +{{> paths/path/verb/_helper_operation_parameter_schema_and_def xParams=pathParams xParamsName="RequestPathParameters" }} + {{/if}} + {{#if cookieParams}} +{{> paths/path/verb/_helper_operation_parameter_schema_and_def xParams=cookieParams xParamsName="RequestCookieParameters" }} + {{/if}} +{{/or}} +{{#neq security null}} + {{#gt security.size 0}} + +_security: typing.List[security_schemes.SecurityRequirementObject] = [ + {{#each security}} + security_requirement_object_{{@key}}.security_requirement_object, + {{/each}} +] + {{/gt}} +{{else}} + {{#neq ../security null}} + {{#gt ../security.size 0}} + +_security: typing.List[security_schemes.SecurityRequirementObject] = [ + {{#each ../security}} + security_requirement_object_{{@key}}.security_requirement_object, + {{/each}} +] + {{/gt}} + {{/neq}} +{{/neq}} + + + {{#if defaultResponse}} + {{#with defaultResponse}} +default_response = response_default.{{jsonPathPiece.camelCase}} + {{/with}} + {{/if}} + {{#if statusCodeResponses}} +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + {{#each statusCodeResponses}} + '{{@key}}': typing.Type[{{jsonPathPiece.snakeCase}}.{{jsonPathPiece.camelCase}}], + {{/each}} + } +) +_status_code_to_response: __StatusCodeToResponse = { + {{#each statusCodeResponses}} + '{{@key}}': {{jsonPathPiece.snakeCase}}.{{jsonPathPiece.camelCase}}, + {{/each}} +} + {{/if}} + {{#if wildcardCodeResponses}} +__RangedStatusCodeToResponse = typing_extensions.TypedDict( + '__RangedStatusCodeToResponse', + { + {{#each wildcardCodeResponses}} + '{{@key}}': typing.Type[{{jsonPathPiece.snakeCase}}.{{jsonPathPiece.camelCase}}], + {{/each}} + } +) +_ranged_status_code_to_response: __RangedStatusCodeToResponse = { + {{#each wildcardCodeResponses}} + '{{@key}}': {{jsonPathPiece.snakeCase}}.{{jsonPathPiece.camelCase}}, + {{/each}} +} + {{/if}} +{{#each produces}} + {{#if @first}} + +_all_accept_content_types = ( + {{/if}} + "{{{.}}}", + {{#if @last}} +) + {{/if}} +{{/each}} + + +class BaseApi(api_client.Api): +{{#if requestBody}} + {{#each getContentTypeToOperation}} + @typing.overload + def _{{operationId.snakeCase}}( + {{> paths/path/verb/_helper_operation_args rootSecurity=../security isOverload=true skipDeserialization="False" contentType=@key}} + + {{/each}} + @typing.overload + def _{{operationId.snakeCase}}( + {{> paths/path/verb/_helper_operation_args rootSecurity=../security isOverload=true skipDeserialization="False" contentType="null"}} + +{{else}} + @typing.overload + def _{{operationId.snakeCase}}( + {{> paths/path/verb/_helper_operation_args rootSecurity=../security isOverload=true skipDeserialization="False" contentType="null"}} +{{/if}} + + @typing.overload + def _{{operationId.snakeCase}}( + {{> paths/path/verb/_helper_operation_args rootSecurity=../security isOverload=true skipDeserialization="True" contentType="null"}} + + @typing.overload + def _{{operationId.snakeCase}}( + {{> paths/path/verb/_helper_operation_args rootSecurity=../security isOverload=true skipDeserialization="null" contentType="null"}} + + def _{{operationId.snakeCase}}( + {{> paths/path/verb/_helper_operation_args rootSecurity=../security isOverload=false skipDeserialization="null" contentType="null"}} + """ + {{#if summary}} + {{summary}} + {{/if}} + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + {{#if queryParams}} + self._verify_typed_dict_inputs(RequestQueryParameters.Params, query_params) + {{/if}} + {{#if headerParams}} + self._verify_typed_dict_inputs(RequestHeaderParameters.Params, header_params) + {{/if}} + {{#if pathParams}} + self._verify_typed_dict_inputs(RequestPathParameters.Params, path_params) + {{/if}} + {{#if cookieParams}} + self._verify_typed_dict_inputs(RequestCookieParameters.Params, cookie_params) + {{/if}} + used_path = path + {{#if pathParams}} + + _path_params = {} + for parameter in RequestPathParameters.parameters: + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + {{/if}} + {{#if queryParams}} + + prefix_separator_iterator = None + for parameter in RequestQueryParameters.parameters: + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + {{/if}} + {{#or headerParams requestBody produces}} + + _headers = HTTPHeaderDict() + {{else}} + {{/or}} + {{#if headerParams}} + for parameter in RequestHeaderParameters.parameters: + parameter_data = header_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _headers.extend(serialized_data) + {{/if}} + # TODO add cookie handling + {{#if produces}} + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + {{/if}} + {{#with requestBody}} + + {{#if refInfo}} + {{#if getDeepestRef.required}} + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + {{/if}} + {{else}} + {{#if required}} + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + {{/if}} + {{/if}} + _fields = None + _body = None + {{#if refInfo}} + {{#if getDeepestRef.required}} + {{> paths/path/verb/_helper_operation_body_serialization }} + {{else}} + if body is not schemas.unset: + {{> paths/path/verb/_helper_operation_body_serialization }} + {{/if}} + {{else}} + {{#if required}} + {{> paths/path/verb/_helper_operation_body_serialization }} + {{else}} + if body is not schemas.unset: + {{> paths/path/verb/_helper_operation_body_serialization }} + {{/if}} + {{/if}} + {{/with}} + {{#if servers}} + host = self.api_client.configuration.get_server_url( + 'paths/' + path + '/{{httpMethod.original}}/servers', server_index + ) + {{else}} + {{#if pathItem.servers}} + host = self.api_client.configuration.get_server_url( + 'paths/' + path + '/' + '/servers', server_index + ) + {{else}} + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + {{/if}} + {{/if}} + {{#neq security null}} + {{#gt security.size 0}} + security_requirement_object = self.api_client.configuration.get_security_requirement_object( + 'paths/' + path + '/{{httpMethod.original}}/security', + _security, + security_index + ) + {{/gt}} + {{else}} + {{#neq ../security null}} + {{#gt ../security.size 0}} + security_requirement_object = self.api_client.configuration.get_security_requirement_object( + 'servers', + _security, + security_index + ) + {{/gt}} + {{/neq}} + {{/neq}} + + response = self.api_client.call_api( + resource_path=used_path, + method='{{httpMethod.original}}', + host=host, + {{#or headerParams requestBody produces}} + headers=_headers, + {{/or}} + {{#if requestBody}} + fields=_fields, + body=_body, + {{/if}} + {{#neq security null}} + {{#gt security.size 0}} + security_requirement_object=security_requirement_object, + {{/gt}} + {{else}} + {{#neq ../security null}} + {{#gt ../security.size 0}} + security_requirement_object=security_requirement_object, + {{/gt}} + {{/neq}} + {{/neq}} + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: +{{#if nonDefaultResponses}} + status = str(response.status) + {{#if wildcardCodeResponses}} + ranged_response_status_code = status[0] + {{/if}} + {{#if statusCodeResponses}} + if status in _status_code_to_response: + status: typing_extensions.Literal[ + {{#each statusCodeResponses}} + '{{@key}}', + {{/each}} + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + {{#if wildcardCodeResponses}} + elif ranged_response_status_code in _ranged_status_code_to_response: + ranged_response_status_code: typing_extensions.Literal[ + {{#each wildcardCodeResponses}} + '{{@key}}', + {{/each}} + ] + api_response = _ranged_status_code_to_response[ranged_response_status_code].deserialize( + response, self.api_client.schema_configuration) + {{/if}} + {{else}} + if ranged_response_status_code in _ranged_status_code_to_response: + ranged_response_status_code: typing_extensions.Literal[ + {{#each wildcardCodeResponses}} + '{{@key}}', + {{/each}} + ] + api_response = _ranged_status_code_to_response[ranged_response_status_code].deserialize( + response, self.api_client.schema_configuration) + {{/if}} + else: + {{#if defaultResponse}} + api_response = default_response.deserialize(response, self.api_client.schema_configuration) + {{else}} + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + {{/if}} +{{else}} + {{#if defaultResponse}} + api_response = default_response.deserialize(response, self.api_client.schema_configuration) + {{else}} + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + {{/if}} +{{/if}} + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class {{operationId.camelCase}}(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + +{{#if requestBody}} + {{#each getContentTypeToOperation}} + @typing.overload + def {{operationId.snakeCase}}( + {{> paths/path/verb/_helper_operation_args isOverload=true skipDeserialization="False" contentType=@key}} + + {{/each}} + @typing.overload + def {{operationId.snakeCase}}( + {{> paths/path/verb/_helper_operation_args isOverload=true skipDeserialization="False" contentType="null"}} + +{{else}} + @typing.overload + def {{operationId.snakeCase}}( + {{> paths/path/verb/_helper_operation_args isOverload=true skipDeserialization="False" contentType="null"}} +{{/if}} + + @typing.overload + def {{operationId.snakeCase}}( + {{> paths/path/verb/_helper_operation_args isOverload=true skipDeserialization="True" contentType="null"}} + + @typing.overload + def {{operationId.snakeCase}}( + {{> paths/path/verb/_helper_operation_args isOverload=true skipDeserialization="null" contentType="null"}} + + def {{operationId.snakeCase}}( + {{> paths/path/verb/_helper_operation_args isOverload=false skipDeserialization="null" contentType="null"}} + return self._{{operationId.snakeCase}}( + {{> paths/path/verb/_helper_operation_args_passed }} + ) + + +class ApiFor{{httpMethod.camelCase}}(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + +{{#if requestBody}} + {{#each getContentTypeToOperation}} + @typing.overload + def {{httpMethod.original}}( + {{> paths/path/verb/_helper_operation_args rootSecurity=../security isOverload=true skipDeserialization="False" contentType=@key}} + + {{/each}} + @typing.overload + def {{httpMethod.original}}( + {{> paths/path/verb/_helper_operation_args rootSecurity=../security isOverload=true skipDeserialization="False" contentType="null"}} + +{{else}} + @typing.overload + def {{httpMethod.original}}( + {{> paths/path/verb/_helper_operation_args rootSecurity=../security isOverload=true skipDeserialization="False" contentType="null"}} +{{/if}} + + @typing.overload + def {{httpMethod.original}}( + {{> paths/path/verb/_helper_operation_args rootSecurity=../security isOverload=true skipDeserialization="True" contentType="null"}} + + @typing.overload + def {{httpMethod.original}}( + {{> paths/path/verb/_helper_operation_args rootSecurity=../security isOverload=true skipDeserialization="null" contentType="null"}} + + def {{httpMethod.original}}( + {{> paths/path/verb/_helper_operation_args rootSecurity=../security isOverload=false skipDeserialization="null" contentType="null"}} + return self._{{operationId.snakeCase}}( + {{> paths/path/verb/_helper_operation_args_passed rootSecurity=../security }} + ) + + +{{/with}} diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/operation_doc.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/operation_doc.hbs new file mode 100644 index 00000000000..f87a35e5b51 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/operation_doc.hbs @@ -0,0 +1,252 @@ +{{#with operation}} +{{packageName}}.paths.{{path.snakeCase}}.operation +{{headerSize}} Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | + {{#each tags}} +| {{../operationId.snakeCase}} | [{{className}}](../../apis/tags/{{moduleName}}.md) | This api is only for tag={{{name}}} | + {{/each}} +| {{httpMethod.original}} | ApiFor{{httpMethod.camelCase}} | This api is only for this endpoint | +| {{httpMethod.original}} | {{path.camelCase}} | This api is only for path={{{path.original}}} | + +{{headerSize}}# Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +{{#neq security null}} + {{#gt security.size 0}} +- [Security](#security) + {{/gt}} +{{else}} + {{#neq ../security null}} + {{#gt ../security.size 0}} +- [Security](#security) + {{/gt}} + {{/neq}} +{{/neq}} +- [Servers](#servers) +- [Code Sample](#code-sample) + +{{headerSize}}# General Info +| Field | Value | +| ----- | ----- | +{{#if summary}} +| Summary | {{{summary}}} | +{{/if}} +{{#if description}} +| Description | {{{description}}} | +{{/if}} +| Path | "{{{path.original}}}" | +| HTTP Method | {{{httpMethod.original}}} | + +{{headerSize}}# Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + {{#with requestBody}} + {{#if refInfo}} + {{#with getDeepestRef}} + {{#if required}} +[**body**](../../components/request_bodies/{{../refInfo.refModule}}.md) | typing.Union[{{#each content}}{{#with this.schema}}[{{../../../refInfo.refClass}}.content.{{../@key.snakeCase}}.{{jsonPathPiece.snakeCase}}](../../components/request_bodies/{{../../../refInfo.refModule}}.md#{{> components/_helper_anchor_id identifierPieces=(append identifierPieces "content" ../@key jsonPathPiece) }}){{/with}}, {{/each}}{{#each getContentSchemas}}{{> _helper_schema_python_types }}{{#unless @last}}, {{/unless}}{{/each}}] | required | + {{else}} +[**body**](../../components/request_bodies/{{../refInfo.refModule}}.md) | typing.Union[{{#each content}}{{#with this.schema}}[{{../../../refInfo.refClass}}.content.{{../@key.snakeCase}}.{{jsonPathPiece.snakeCase}}](../../components/request_bodies/{{../../../refInfo.refModule}}.md#{{> components/_helper_anchor_id identifierPieces=(append identifierPieces "content" ../@key jsonPathPiece) }}){{/with}}, {{/each}}Unset, {{#each getContentSchemas}}{{> _helper_schema_python_types }}{{#unless @last}}, {{/unless}}{{/each}}] | optional, default is unset | + {{/if}} + {{/with}} + {{else}} + {{#if required}} +[body](#requestbody) | typing.Union[{{#each content}}{{#with this.schema}}[{{../../jsonPathPiece.camelCase}}.content.{{../@key.snakeCase}}.{{#if jsonPathPiece.isValid}}{{jsonPathPiece.original}}{{else}}{{jsonPathPiece.snakeCase}}{{/if}}](#{{> components/_helper_anchor_id identifierPieces=(append identifierPieces "RequestBody" "content" ../@key jsonPathPiece) }}){{/with}}, {{/each}}{{#each getContentSchemas}}{{> _helper_schema_python_types }}{{#unless @last}}, {{/unless}}{{/each}}] | required | + {{else}} +[body](#requestbody) | typing.Union[{{#each content}}{{#with this.schema}}[{{../../jsonPathPiece.camelCase}}.content.{{../@key.snakeCase}}.{{#if jsonPathPiece.isValid}}{{jsonPathPiece.original}}{{else}}{{jsonPathPiece.snakeCase}}{{/if}}](#{{> components/_helper_anchor_id identifierPieces=(append identifierPieces "RequestBody" "content" ../@key jsonPathPiece) }}){{/with}}, {{/each}}Unset, {{#each getContentSchemas}}{{> _helper_schema_python_types }}{{#unless @last}}, {{/unless}}{{/each}}] | optional, default is unset | + {{/if}} + {{/if}} + {{/with}} + {{#if queryParams}} +[query_params](#query_params) | [RequestQueryParameters.Params](#requestqueryparametersparams), dict | | + {{/if}} + {{#if headerParams}} +[header_params](#header_params) | [RequestHeaderParameters.Params](#requestheaderparametersparams), dict | | + {{/if}} + {{#if pathParams}} +[path_params](#path_params) | [RequestPathParameters.Params](#requestpathparametersparams), dict | | + {{/if}} + {{#if cookieParams}} +[cookie_params](#cookie-params) | [RequestCookieParameters.Params](#requestcookieparametersparams), dict | | + {{/if}} + {{#with requestBody}} + {{#if refInfo}} + {{#each getDeepestRef.content}} + {{#if @first}} +content_type | str | optional, default is '{{@key.original}}' | Selects the schema and serialization of the request body + {{/if}} + {{/each}} + {{else}} + {{#each content}} + {{#if @first}} +content_type | str | optional, default is '{{@key.original}}' | Selects the schema and serialization of the request body + {{/if}} + {{/each}} + {{/if}} + {{/with}} + {{#if produces}} +accept_content_types | typing.Tuple[str] | default is ({{#each produces}}"{{{.}}}", {{/each}}) | Tells the server the content type(s) that are accepted by the client + {{/if}} +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + {{#if requestBody}} + {{#unless requestBody.refInfo}} + +{{> components/request_bodies/request_body_doc requestBody=requestBody headerSize=(join headerSize "##" "") identifierPieces=(append identifierPieces requestBody.jsonPathPiece) }} + {{/unless}} + {{/if}} + {{#if queryParams}} +{{> paths/path/verb/_helper_operation_docs_xparams paramPrefix="query" paramType="Query" parameters=queryParams }} + {{/if}} + {{#if headerParams}} +{{> paths/path/verb/_helper_operation_docs_xparams paramPrefix="header" paramType="Header" parameters=headerParams }} + {{/if}} + {{#if pathParams}} +{{> paths/path/verb/_helper_operation_docs_xparams paramPrefix="path" paramType="Path" parameters=pathParams }} + {{/if}} + {{#if cookieParams}} +{{> paths/path/verb/_helper_operation_docs_xparams paramPrefix="cookie" paramType="Cookie" parameters=cookieParams }} + {{/if}} + +{{headerSize}}# Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +{{#if defaultResponse}} + {{#with defaultResponse}} + {{#if refInfo}} +default | [{{refInfo.refClass}}.response_cls](../../components/responses/{{refInfo.refModule}}.md#{{refInfo.refModule}}response_cls) | {{#with getDeepestRef}}{{description}}{{/with}} + {{else}} +default | [{{jsonPathPiece.camelCase}}.response_cls](#{{jsonPathPiece.anchorPiece}}-response_cls) | {{description}} + {{/if}} + {{/with}} +{{/if}} +{{#each nonDefaultResponses}} + {{#if refInfo}} +{{@key}} | [{{refInfo.refClass}}.response_cls](../../components/responses/{{refInfo.refModule}}.md#{{refInfo.refModule}}response_cls) | {{#with getDeepestRef}}{{description}}{{/with}} + {{else}} +{{@key}} | [{{jsonPathPiece.camelCase}}.response_cls](#{{jsonPathPiece.anchorPiece}}-response_cls) | {{description}} + {{/if}} +{{/each}} +{{#each responses}} + {{#unless refInfo.refModule}} + +{{> components/responses/response_doc response=this headerSize=(join headerSize "#" "") identifierPieces=(append identifierPieces jsonPathPiece) }} + {{/unless}} +{{/each}} +{{#neq security null}} + {{#gt security.size 0}} + +{{headerSize}}# Security + +Set auth info by setting ApiConfiguration.security_scheme_info to a dict where the +key is the below security scheme quoted name, and the value is an instance of the linked +component security scheme class. +Select the security index by setting ApiConfiguration.security_index_info or by +passing in security_index into the endpoint method. +See how to do this in the code sample. +- these securities are specific to this to this endpoint + +| Security Index | Security Scheme to Scope Names | +| -------------- | ------------------------------ | + {{#each security}} +| {{@key}} | {{#eq this.size 0}}no security{{else}}{{#each this}}["{{{@key}}}"](../../components/security_schemes/{{this.refInfo.refModule}}.md) {{this.scopeNames}}
    {{/each}}{{/eq}} | + {{/each}} + {{/gt}} +{{else}} + {{#neq ../security null}} + {{#gt ../security.size 0}} + +{{headerSize}}# Security + +Set auth info by setting ApiConfiguration.security_scheme_info to a dict where the +key is the below security scheme quoted name, and the value is an instance of the linked +component security scheme class. +Select the security index by setting ApiConfiguration.security_index_info or by +passing in security_index into the endpoint method. +See how to do this in the code sample. +- these securities are the general api securities + +| Security Index | Security Scheme to Scope Names | +| -------------- | ------------------------------ | + {{#each ../security}} +| {{@key}} | {{#eq this.size 0}}no security{{else}}{{#each this}}["{{{@key}}}"](../../components/security_schemes/{{this.refInfo.refModule}}.md) {{this.scopeNames}}
    {{/each}}{{/eq}} | + {{/each}} + {{/gt}} + {{/neq}} +{{/neq}} + +{{headerSize}}# Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +{{#if servers}} +- these servers are specific to this endpoint + {{#with servers.0}} +- defaults to server_index=0, server.url = {{defaultUrl}} + {{/with}} +{{else}} + {{#if pathItem.servers}} +- these servers are specific to this "{{{path.original}}}" path + {{#with pathItem.servers.0}} +- defaults to server_index=0, server.url = {{defaultUrl}} + {{/with}} + {{else}} +- these servers are the general api servers + {{#each ../servers}} + {{#if @first}} +- defaults to server_index=0, server.url = {{defaultUrl}} + {{/if}} + {{/each}} + {{/if}} +{{/if}} + +server_index | Class | Description +------------ | ----- | ------------ +{{#if servers}} + {{#each servers}} +{{@key}} | [{{jsonPathPiece.camelCase}}](#{{jsonPathPiece.anchorPiece}}) |{{#if description}} {{description}}{{/if}} + {{/each}} +{{else}} + {{#if pathItem.servers}} + {{#each pathItem.servers}} +{{@key}} | [{{jsonPathPiece.camelCase}}](#{{jsonPathPiece.anchorPiece}}) |{{#if description}} {{description}}{{/if}} + {{/each}} + {{else}} + {{#each ../servers}} +{{@key}} | [{{jsonPathPiece.camelCase}}](../../../servers/{{jsonPathPiece.snakeCase}}.md) |{{#if description}} {{description}}{{/if}} + {{/each}} + {{/if}} +{{/if}} +{{#if servers}} + {{#each servers}} + +{{> servers/server_doc server=this headerSize=(join headerSize "##" "") identifierPieces=(append identifierPieces jsonPathPiece) }} + {{/each}} +{{else}} + {{#if pathItem.servers}} + + {{#each pathItem.servers}} +{{> servers/server_doc server=this headerSize=(join headerSize "##" "") identifierPieces=(append identifierPieces jsonPathPiece) }} + {{/each}} + {{/if}} +{{/if}} + +{{headerSize}}# Code Sample + +{{> paths/path/verb/_helper_operation_doc_example rootSecurity=../security }} + +[[Back to top]](#top) + {{#each tags}} +[[Back to {{className}} API]](../../apis/tags/{{moduleName}}.md) + {{/each}} +{{> _helper_footer_links readmePath="../../../" endpointsLink=true}} +{{/with}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/operation_test.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/operation_test.hbs new file mode 100644 index 00000000000..f86e12aabf2 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/operation_test.hbs @@ -0,0 +1,120 @@ +# coding: utf-8 + +{{> _helper_header }} + +import unittest +from unittest.mock import patch + +import urllib3 + +import {{packageName}} +from {{packageName}}.paths.{{path.snakeCase}}.{{httpMethod.original}} import operation as {{httpMethod.original}} # noqa: E501 +from {{packageName}} import schemas, api_client +from {{packageName}}.configurations import api_configuration, schema_configuration + +from .. import ApiTestMixin + + +{{#with operation}} +class Test{{httpMethod.camelCase}}(ApiTestMixin, unittest.TestCase): + """ + {{httpMethod.camelCase}} unit test stubs +{{#if summary}} + {{{summary}}} # noqa: E501 +{{/if}} + """ + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = {{httpMethod.original}}.ApiFor{{httpMethod.camelCase}}(api_client=used_api_client) # noqa: E501 + +{{#if statusCodeResponses}} + {{#each statusCodeResponses}} + {{#if @first}} + response_status = {{@key}} + {{#if refInfo}} + {{#with getDeepestRef}} + {{> paths/path/verb/_helper_operation_test_response_content responseModuleName=../jsonPathPiece.snakeCase responseClassName=../jsonPathPiece.camelCase }} + {{/with}} + {{else}} + {{> paths/path/verb/_helper_operation_test_response_content responseModuleName=jsonPathPiece.snakeCase responseClassName=jsonPathPiece.camelCase }} + {{/if}} + {{/if}} + {{/each}} +{{else}} + {{#if wildcardCodeResponses}} + {{#each wildcardCodeResponses}} + {{#if @first}} + response_status = {{@key}}99 + {{#if refInfo}} + {{#with getDeepestRef}} + {{> paths/path/verb/_helper_operation_test_response_content responseModuleName=../jsonPathPiece.snakeCase responseClassName=../jsonPathPiece.camelCase }} + {{/with}} + {{else}} + {{> paths/path/verb/_helper_operation_test_response_content responseModuleName=jsonPathPiece.snakeCase responseClassName=jsonPathPiece.camelCase }} + {{/if}} + {{/if}} + {{/each}} + {{else}} + {{#with defaultResponse}} + response_status = 200 + {{#if refInfo}} + {{#with getDeepestRef}} + {{> paths/path/verb/_helper_operation_test_response_content responseModuleName=../jsonPathPiece.snakeCase responseClassName=../jsonPathPiece.camelCase }} + {{/with}} + {{else}} + {{> paths/path/verb/_helper_operation_test_response_content responseModuleName=jsonPathPiece.snakeCase responseClassName=jsonPathPiece.camelCase }} + {{/if}} + {{/with}} + {{/if}} +{{/if}} +{{#if requestBody}} +{{#with requestBody}} +{{#if required}} +{{#each content}} +{{#if this.testCases}} +{{#each testCases}} +{{#with this }} + + def test_{{@key}}_{{#if valid}}passes{{else}}fails{{/if}}(self): + content_type = '{{{../@key.original}}}' + # {{description}} + with patch.object(urllib3.PoolManager, 'request') as mock_request: + payload = ( +{{#with data}} + {{> components/schemas/_helper_payload_renderer endChar='' }} +{{/with}} + ) +{{#if valid}} + body = {{httpMethod.original}}.request_body.RequestBody.content["{{{../@key.original}}}"].schema.from_openapi_data_( + payload, + configuration_=self.schema_config + ) + mock_request.return_value = self.response( + self.json_bytes(self.response_body), + status=self.response_status + ) + {{> paths/path/verb/_helper_operation_test_partial }} + + assert isinstance(api_response.response, urllib3.HTTPResponse) + assert isinstance(api_response.body, schemas.Unset) +{{else}} + with self.assertRaises(({{packageName}}.ApiValueError, {{packageName}}.ApiTypeError)): + body = {{httpMethod.original}}.request_body.RequestBody.content["{{{../@key.original}}}"].schema.from_openapi_data_( + payload, + configuration_=self.schema_config + ) + self.api.{{httpMethod.original}}(body=body) +{{/if}} +{{/with}} +{{/each}} +{{/if}} +{{/each}} +{{/if}} +{{/with}} +{{else}} + {{/if}} +{{/with}} + +if __name__ == '__main__': + unittest.main() diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/pyproject.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/pyproject.hbs new file mode 100644 index 00000000000..de2f3c81280 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/pyproject.hbs @@ -0,0 +1,30 @@ +# Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + +[build-system] +requires = ["setuptools>=61.0"] +build-backend = "setuptools.build_meta" + +[project] +name = "{{{projectName}}}" +version = "{{packageVersion}}" +authors = [ + { name="{{#if infoName}}{{infoName}}{{else}}OpenAPI JSON Schema Generator community{{/if}}"{{#if infoEmail}}, email="{{infoEmail}}"{{/if}} }, +] +description = "{{appName}}" +readme = "README.md" +requires-python = "{{{generatorLanguageVersion}}}" +dependencies = [ + {{> _helper_required_libraries quoted=true }} +] +classifiers = [ + "Programming Language :: Python :: 3", + {{#if licenseInfo}}"License :: {{licenseInfo}}",{{/if}} + "Operating System :: OS Independent", + "Topic :: Software Development :: Code Generators" +] + +{{#or packageUrl infoUrl}} +[project.urls] +{{#if packageUrl}}"Homepage" = "{{{packageUrl}}}"{{/if}} +{{#if infoUrl}}"Bug Tracker" = "{{{infoUrl}}}"{{/if}} +{{/or}} diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/required_libraries.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/required_libraries.handlebars deleted file mode 100644 index f8395307a86..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/required_libraries.handlebars +++ /dev/null @@ -1,16 +0,0 @@ -{{#if asyncio}} -{{#if quoted}}"{{/if}}aiohttp >= 3.0.0{{#if quoted}}",{{/if}} -{{/if}} -{{#if quoted}}"{{/if}}certifi >= 14.5.14{{#if quoted}}",{{/if}} -{{#if quoted}}"{{/if}}frozendict ~= 2.3.4{{#if quoted}}",{{/if}} -{{#if hasHttpSignatureMethods}} -{{#if quoted}}"{{/if}}pem >= 19.3.0{{#if quoted}}",{{/if}} -{{#if quoted}}"{{/if}}pycryptodome >= 3.9.0{{#if quoted}}",{{/if}} -{{/if}} -{{#if quoted}}"{{/if}}python-dateutil ~= 2.7.0{{#if quoted}}",{{/if}} -{{#if quoted}}"{{/if}}setuptools >= 21.0.0{{#if quoted}}",{{/if}} -{{#if tornado}} -{{#if quoted}}"{{/if}}tornado >= 4.2{{#if quoted}}",{{/if}} -{{/if}} -{{#if quoted}}"{{/if}}typing_extensions ~= 4.3.0{{#if quoted}}",{{/if}} -{{#if quoted}}"{{/if}}urllib3 ~= 1.26.7{{#if quoted}}",{{/if}} diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/requirements.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/requirements.handlebars deleted file mode 100644 index b1f24de150a..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/requirements.handlebars +++ /dev/null @@ -1 +0,0 @@ -{{> required_libraries quoted=false }} diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/rest.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/rest.handlebars deleted file mode 100644 index d9fcc233391..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/rest.handlebars +++ /dev/null @@ -1,246 +0,0 @@ -# coding: utf-8 - -{{>partial_header}} - -import logging -import ssl -from urllib.parse import urlencode -import typing - -import certifi -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from {{packageName}}.exceptions import ApiException, ApiValueError - - -logger = logging.getLogger(__name__) - - -class RESTClientObject(object): - - def __init__(self, configuration, pools_size=4, maxsize=None): - # urllib3.PoolManager will pass all kw parameters to connectionpool - # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 - # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 - # maxsize is the number of requests to host that are allowed in parallel # noqa: E501 - # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 - - # cert_reqs - if configuration.verify_ssl: - cert_reqs = ssl.CERT_REQUIRED - else: - cert_reqs = ssl.CERT_NONE - - # ca_certs - if configuration.ssl_ca_cert: - ca_certs = configuration.ssl_ca_cert - else: - # if not set certificate file, use Mozilla's root certificates. - ca_certs = certifi.where() - - addition_pool_args = {} - if configuration.assert_hostname is not None: - addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 - - if configuration.retries is not None: - addition_pool_args['retries'] = configuration.retries - - if configuration.socket_options is not None: - addition_pool_args['socket_options'] = configuration.socket_options - - if maxsize is None: - if configuration.connection_pool_maxsize is not None: - maxsize = configuration.connection_pool_maxsize - else: - maxsize = 4 - - # https pool manager - if configuration.proxy: - self.pool_manager = urllib3.ProxyManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=ca_certs, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - proxy_url=configuration.proxy, - proxy_headers=configuration.proxy_headers, - **addition_pool_args - ) - else: - self.pool_manager = urllib3.PoolManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=ca_certs, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - **addition_pool_args - ) - - def request( - self, - method: str, - url: str, - headers: typing.Optional[HTTPHeaderDict] = None, - fields: typing.Optional[typing.Tuple[typing.Tuple[str, typing.Any], ...]] = None, - body: typing.Optional[typing.Union[str, bytes]] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> urllib3.HTTPResponse: - """Perform requests. - - :param method: http request method - :param url: http request url - :param headers: http request headers - :param body: request body, for other types - :param fields: request parameters for - `application/x-www-form-urlencoded` - or `multipart/form-data` - :param stream: if True, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is False. - :param timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - """ - method = method.upper() - assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', - 'PATCH', 'OPTIONS'] - - if fields and body: - raise ApiValueError( - "body parameter cannot be used with fields parameter." - ) - - fields = fields or {} - headers = headers or {} - - if timeout: - if isinstance(timeout, (int, float)): # noqa: E501,F821 - timeout = urllib3.Timeout(total=timeout) - elif (isinstance(timeout, tuple) and - len(timeout) == 2): - timeout = urllib3.Timeout(connect=timeout[0], read=timeout[1]) - - try: - # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` - if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: - if 'Content-Type' not in headers and body is None: - r = self.pool_manager.request( - method, - url, - preload_content=not stream, - timeout=timeout, - headers=headers - ) - elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 - r = self.pool_manager.request( - method, url, - body=body, - encode_multipart=False, - preload_content=not stream, - timeout=timeout, - headers=headers) - elif headers['Content-Type'] == 'multipart/form-data': - # must del headers['Content-Type'], or the correct - # Content-Type which generated by urllib3 will be - # overwritten. - del headers['Content-Type'] - r = self.pool_manager.request( - method, url, - fields=fields, - encode_multipart=True, - preload_content=not stream, - timeout=timeout, - headers=headers) - # Pass a `string` parameter directly in the body to support - # other content types than Json when `body` argument is - # provided in serialized form - elif isinstance(body, str) or isinstance(body, bytes): - request_body = body - r = self.pool_manager.request( - method, url, - body=request_body, - preload_content=not stream, - timeout=timeout, - headers=headers) - else: - # Cannot generate the request from given parameters - msg = """Cannot prepare a request message for provided - arguments. Please check that your arguments match - declared content type.""" - raise ApiException(status=0, reason=msg) - # For `GET`, `HEAD` - else: - r = self.pool_manager.request(method, url, - preload_content=not stream, - timeout=timeout, - headers=headers) - except urllib3.exceptions.SSLError as e: - msg = "{0}\n{1}".format(type(e).__name__, str(e)) - raise ApiException(status=0, reason=msg) - - if not stream: - # log response body - logger.debug("response body: %s", r.data) - - return r - - def GET(self, url, headers=None, stream=False, - timeout=None, fields=None) -> urllib3.HTTPResponse: - return self.request("GET", url, - headers=headers, - stream=stream, - timeout=timeout, - fields=fields) - - def HEAD(self, url, headers=None, stream=False, - timeout=None, fields=None) -> urllib3.HTTPResponse: - return self.request("HEAD", url, - headers=headers, - stream=stream, - timeout=timeout, - fields=fields) - - def OPTIONS(self, url, headers=None, - body=None, stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: - return self.request("OPTIONS", url, - headers=headers, - stream=stream, - timeout=timeout, - body=body, fields=fields) - - def DELETE(self, url, headers=None, body=None, - stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: - return self.request("DELETE", url, - headers=headers, - stream=stream, - timeout=timeout, - body=body, fields=fields) - - def POST(self, url, headers=None, - body=None, stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: - return self.request("POST", url, - headers=headers, - stream=stream, - timeout=timeout, - body=body, fields=fields) - - def PUT(self, url, headers=None, - body=None, stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: - return self.request("PUT", url, - headers=headers, - stream=stream, - timeout=timeout, - body=body, fields=fields) - - def PATCH(self, url, headers=None, - body=None, stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: - return self.request("PATCH", url, - headers=headers, - stream=stream, - timeout=timeout, - body=body, fields=fields) diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/rest.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/rest.hbs new file mode 100644 index 00000000000..0fd76d0fbf3 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/rest.hbs @@ -0,0 +1,245 @@ +# coding: utf-8 + +{{> _helper_header }} + +import logging +import ssl +from urllib.parse import urlencode +import typing + +import certifi +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from {{packageName}}.exceptions import ApiException, ApiValueError + + +logger = logging.getLogger(__name__) + + +class RESTClientObject(object): + + def __init__(self, configuration, pools_size=4, maxsize=None): + # urllib3.PoolManager will pass all kw parameters to connectionpool + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 + # maxsize is the number of requests to host that are allowed in parallel # noqa: E501 + # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 + + # cert_reqs + if configuration.verify_ssl: + cert_reqs = ssl.CERT_REQUIRED + else: + cert_reqs = ssl.CERT_NONE + + # ca_certs + if configuration.ssl_ca_cert: + ca_certs = configuration.ssl_ca_cert + else: + # if not set certificate file, use Mozilla's root certificates. + ca_certs = certifi.where() + + addition_pool_args = {} + if configuration.assert_hostname is not None: + addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 + + if configuration.retries is not None: + addition_pool_args['retries'] = configuration.retries + + if configuration.socket_options is not None: + addition_pool_args['socket_options'] = configuration.socket_options + + if maxsize is None: + if configuration.connection_pool_maxsize is not None: + maxsize = configuration.connection_pool_maxsize + else: + maxsize = 4 + + # https pool manager + if configuration.proxy: + self.pool_manager = urllib3.ProxyManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=ca_certs, + cert_file=configuration.cert_file, + key_file=configuration.key_file, + proxy_url=configuration.proxy, + proxy_headers=configuration.proxy_headers, + **addition_pool_args + ) + else: + self.pool_manager = urllib3.PoolManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=ca_certs, + cert_file=configuration.cert_file, + key_file=configuration.key_file, + **addition_pool_args + ) + + def request( + self, + method: str, + url: str, + headers: typing.Optional[HTTPHeaderDict] = None, + fields: typing.Optional[typing.Tuple[typing.Tuple[str, typing.Any], ...]] = None, + body: typing.Optional[typing.Union[str, bytes]] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> urllib3.HTTPResponse: + """Perform requests. + + :param method: http request method + :param url: http request url + :param headers: http request headers + :param body: request body, for other types + :param fields: request parameters for + `application/x-www-form-urlencoded` + or `multipart/form-data` + :param stream: if True, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is False. + :param timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + """ + assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', + 'PATCH', 'OPTIONS'] + + if fields and body: + raise ApiValueError( + "body parameter cannot be used with fields parameter." + ) + + fields = fields or {} + headers = headers or {} + + if timeout: + if isinstance(timeout, (int, float)): # noqa: E501,F821 + timeout = urllib3.Timeout(total=timeout) + elif (isinstance(timeout, tuple) and + len(timeout) == 2): + timeout = urllib3.Timeout(connect=timeout[0], read=timeout[1]) + + try: + # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` + if method in {'POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE'}: + if 'Content-Type' not in headers and body is None: + r = self.pool_manager.request( + method, + url, + preload_content=not stream, + timeout=timeout, + headers=headers + ) + elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 + r = self.pool_manager.request( + method, url, + body=body, + encode_multipart=False, + preload_content=not stream, + timeout=timeout, + headers=headers) + elif headers['Content-Type'] == 'multipart/form-data': + # must del headers['Content-Type'], or the correct + # Content-Type which generated by urllib3 will be + # overwritten. + del headers['Content-Type'] + r = self.pool_manager.request( + method, url, + fields=fields, + encode_multipart=True, + preload_content=not stream, + timeout=timeout, + headers=headers) + # Pass a `string` parameter directly in the body to support + # other content types than Json when `body` argument is + # provided in serialized form + elif isinstance(body, str) or isinstance(body, bytes): + request_body = body + r = self.pool_manager.request( + method, url, + body=request_body, + preload_content=not stream, + timeout=timeout, + headers=headers) + else: + # Cannot generate the request from given parameters + msg = """Cannot prepare a request message for provided + arguments. Please check that your arguments match + declared content type.""" + raise ApiException(status=0, reason=msg) + # For `GET`, `HEAD` + else: + r = self.pool_manager.request(method, url, + preload_content=not stream, + timeout=timeout, + headers=headers) + except urllib3.exceptions.SSLError as e: + msg = "{0}\n{1}".format(type(e).__name__, str(e)) + raise ApiException(status=0, reason=msg) + + if not stream: + # log response body + logger.debug("response body: %s", r.data) + + return r + + def get(self, url, headers=None, stream=False, + timeout=None, fields=None) -> urllib3.HTTPResponse: + return self.request("GET", url, + headers=headers, + stream=stream, + timeout=timeout, + fields=fields) + + def head(self, url, headers=None, stream=False, + timeout=None, fields=None) -> urllib3.HTTPResponse: + return self.request("HEAD", url, + headers=headers, + stream=stream, + timeout=timeout, + fields=fields) + + def options(self, url, headers=None, + body=None, stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: + return self.request("OPTIONS", url, + headers=headers, + stream=stream, + timeout=timeout, + body=body, fields=fields) + + def delete(self, url, headers=None, body=None, + stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: + return self.request("DELETE", url, + headers=headers, + stream=stream, + timeout=timeout, + body=body, fields=fields) + + def post(self, url, headers=None, + body=None, stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: + return self.request("POST", url, + headers=headers, + stream=stream, + timeout=timeout, + body=body, fields=fields) + + def put(self, url, headers=None, + body=None, stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: + return self.request("PUT", url, + headers=headers, + stream=stream, + timeout=timeout, + body=body, fields=fields) + + def patch(self, url, headers=None, + body=None, stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: + return self.request("PATCH", url, + headers=headers, + stream=stream, + timeout=timeout, + body=body, fields=fields) diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/schema_doc.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/schema_doc.handlebars deleted file mode 100644 index 8e67813ed6e..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/schema_doc.handlebars +++ /dev/null @@ -1,136 +0,0 @@ - -{{#if description}} -{{&description}} - -{{/if}} -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -{{> model_templates/schema_python_types }} | {{> model_templates/schema_accessed_types }} | {{#if description}}{{description}}{{/if}} | {{> model_templates/notes_msg }} -{{#or vars additionalProperties}} - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- - {{#each getRequiredVarsMap}} -**{{#with this}}{{#unless complexType}}{{#or isArray isMap composedSchemas}}[{{/or}}{{/unless}}{{/with}}{{{@key}}}{{#with this}}{{#unless complexType}}{{#or isArray isMap composedSchemas}}](#{{baseName}}){{/or}}{{/unless}}{{/with}}** | {{#with this}}{{#unless complexType}}{{> model_templates/schema_python_types }}{{/unless}}{{#if complexType}}[**{{dataType}}**]({{complexTypePrefix}}{{complexType}}.md){{/if}} | {{#unless complexType}}{{> model_templates/schema_accessed_types }}{{/unless}}{{#if complexType}}[**{{dataType}}**]({{complexTypePrefix}}{{complexType}}.md){{/if}} | {{#if description}}{{description}}{{/if}} | {{> model_templates/notes_msg }}{{/with}} - {{/each}} - {{#each vars}} - {{#unless required}} -**{{#unless complexType}}{{#or isArray isMap composedSchemas}}[{{/or}}{{/unless}}{{baseName}}{{#unless complexType}}{{#or isArray isMap composedSchemas}}](#{{baseName}}){{/or}}{{/unless}}** | {{#unless complexType}}{{> model_templates/schema_python_types }}{{/unless}}{{#if complexType}}[**{{dataType}}**]({{complexTypePrefix}}{{complexType}}.md){{/if}} | {{#unless complexType}}{{> model_templates/schema_accessed_types }}{{/unless}}{{#if complexType}}[**{{dataType}}**]({{complexTypePrefix}}{{complexType}}.md){{/if}} | {{#if description}}{{description}}{{/if}} | [optional] {{> model_templates/notes_msg }} - {{/unless}} - {{/each}} - {{#with additionalProperties}} - {{#unless getIsBooleanSchemaFalse}} - {{#if getIsBooleanSchemaTrue}} -**any_string_name** | {{> model_templates/schema_python_types }} | {{> model_templates/schema_accessed_types }} | any string name can be used but the value must be the correct type{{#if description}} {{description}}{{/if}} | [optional] - {{else}} -**{{#unless complexType}}{{#or isArray isMap composedSchemas}}[{{/or}}{{/unless}}any_string_name{{#unless complexType}}{{#or isArray isMap composedSchemas}}](#any_string_name){{/or}}{{/unless}}** | {{#unless complexType}}{{> model_templates/schema_python_types }}{{/unless}}{{#if complexType}}[**{{dataType}}**]({{complexTypePrefix}}{{complexType}}.md){{/if}} | {{#unless complexType}}{{> model_templates/schema_accessed_types }}{{/unless}}{{#if complexType}}[**{{dataType}}**]({{complexTypePrefix}}{{complexType}}.md){{/if}} | any string name can be used but the value must be the correct type{{#if description}} {{description}}{{/if}} | [optional] {{> model_templates/notes_msg }} - {{/if}} - {{/unless}} - {{else}} -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - {{/with}} -{{/or}} -{{#each vars}} -{{#unless complexType}} -{{#or isArray isMap composedSchemas}} - -# {{baseName}} -{{> schema_doc }} -{{/or}} -{{/unless}} -{{/each}} -{{#with additionalProperties}} -{{#unless getIsBooleanSchemaFalse}} -{{#unless getIsBooleanSchemaTrue}} -{{#unless complexType}} -{{#or isArray isMap composedSchemas}} - -# any_string_name -{{> schema_doc }} -{{/or}} -{{/unless}} -{{/unless}} -{{/unless}} -{{/with}} -{{#if items}} - -### Tuple Items -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -{{#with items}} -{{#unless complexType}}{{#or isArray isMap composedSchemas}}[{{/or}}{{baseName}}{{#or isArray isMap composedSchemas}}](#{{baseName}}){{/or}}{{/unless}}{{#if complexType}}[**{{dataType}}**]({{complexTypePrefix}}{{complexType}}.md){{/if}} | {{#unless complexType}}{{> model_templates/schema_python_types }}{{/unless}}{{#if complexType}}[**{{dataType}}**]({{complexTypePrefix}}{{complexType}}.md){{/if}} | {{#unless complexType}}{{> model_templates/schema_accessed_types }}{{/unless}}{{#if complexType}}[**{{dataType}}**]({{complexTypePrefix}}{{complexType}}.md){{/if}} | {{#if description}}{{description}}{{/if}} | {{> model_templates/notes_msg }} -{{#unless complexType}} -{{#or isArray isMap composedSchemas}} - -# {{baseName}} -{{> schema_doc }} -{{/or}} -{{/unless}} -{{/with}} -{{/if}} -{{#if composedSchemas}} -{{#with composedSchemas}} - -### Composed Schemas (allOf/anyOf/oneOf/not) -{{#if allOf}} -#### allOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -{{#each allOf}} -{{#if complexType}}[{{dataType}}]({{complexTypePrefix}}{{complexType}}.md){{else}}[{{#if nameInSnakeCase}}{{name}}{{else}}{{baseName}}{{/if}}](#{{#if nameInSnakeCase}}{{name}}{{else}}{{baseName}}{{/if}}){{/if}} | {{#unless complexType}}{{> model_templates/schema_python_types }}{{/unless}}{{#if complexType}}[**{{dataType}}**]({{complexTypePrefix}}{{complexType}}.md){{/if}} | {{#unless complexType}}{{> model_templates/schema_accessed_types }}{{/unless}}{{#if complexType}}[**{{dataType}}**]({{complexTypePrefix}}{{complexType}}.md){{/if}} | {{#if description}}{{description}}{{/if}} | {{> model_templates/notes_msg }} -{{/each}} -{{#each allOf}} -{{#unless complexType}} - -# {{#if nameInSnakeCase}}{{name}}{{else}}{{baseName}}{{/if}} -{{> schema_doc }} -{{/unless}} -{{/each}} -{{/if}} -{{#if anyOf}} -#### anyOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -{{#each anyOf}} -{{#if complexType}}[{{dataType}}]({{complexTypePrefix}}{{complexType}}.md){{else}}[{{#if nameInSnakeCase}}{{name}}{{else}}{{baseName}}{{/if}}](#{{#if nameInSnakeCase}}{{name}}{{else}}{{baseName}}{{/if}}){{/if}} | {{#unless complexType}}{{> model_templates/schema_python_types }}{{/unless}}{{#if complexType}}[**{{dataType}}**]({{complexTypePrefix}}{{complexType}}.md){{/if}} | {{#unless complexType}}{{> model_templates/schema_accessed_types }}{{/unless}}{{#if complexType}}[**{{dataType}}**]({{complexTypePrefix}}{{complexType}}.md){{/if}} | {{#if description}}{{description}}{{/if}} | {{> model_templates/notes_msg }} -{{/each}} -{{#each anyOf}} -{{#unless complexType}} - -# {{#if nameInSnakeCase}}{{name}}{{else}}{{baseName}}{{/if}} -{{> schema_doc }} -{{/unless}} -{{/each}} -{{/if}} -{{#if oneOf}} -#### oneOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -{{#each oneOf}} -{{#if complexType}}[{{dataType}}]({{complexTypePrefix}}{{complexType}}.md){{else}}[{{#if nameInSnakeCase}}{{name}}{{else}}{{baseName}}{{/if}}](#{{#if nameInSnakeCase}}{{name}}{{else}}{{baseName}}{{/if}}){{/if}} | {{#unless complexType}}{{> model_templates/schema_python_types }}{{/unless}}{{#if complexType}}[**{{dataType}}**]({{complexTypePrefix}}{{complexType}}.md){{/if}} | {{#unless complexType}}{{> model_templates/schema_accessed_types }}{{/unless}}{{#if complexType}}[**{{dataType}}**]({{complexTypePrefix}}{{complexType}}.md){{/if}} | {{#if description}}{{description}}{{/if}} | {{> model_templates/notes_msg }} -{{/each}} -{{#each oneOf}} -{{#unless complexType}} - -# {{#if nameInSnakeCase}}{{name}}{{else}}{{baseName}}{{/if}} -{{> schema_doc }} -{{/unless}} -{{/each}} -{{/if}} -{{#if not}} -#### not -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -{{#with not}} -{{#if complexType}}[{{dataType}}]({{complexTypePrefix}}{{complexType}}.md){{else}}[{{#if nameInSnakeCase}}{{name}}{{else}}{{baseName}}{{/if}}](#{{#if nameInSnakeCase}}{{name}}{{else}}{{baseName}}{{/if}}){{/if}} | {{#unless complexType}}{{> model_templates/schema_python_types }}{{/unless}}{{#if complexType}}[**{{dataType}}**]({{complexTypePrefix}}{{complexType}}.md){{/if}} | {{#unless complexType}}{{> model_templates/schema_accessed_types }}{{/unless}}{{#if complexType}}[**{{dataType}}**]({{complexTypePrefix}}{{complexType}}.md){{/if}} | {{#if description}}{{description}}{{/if}} | {{> model_templates/notes_msg }} -{{#unless complexType}} - -# {{#if nameInSnakeCase}}{{name}}{{else}}{{baseName}}{{/if}} -{{> schema_doc }} -{{/unless}} -{{/with}} -{{/if}} -{{/with}} -{{/if}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/schemas.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/schemas.handlebars deleted file mode 100644 index de79feab8e0..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/schemas.handlebars +++ /dev/null @@ -1,2508 +0,0 @@ -# coding: utf-8 - -{{>partial_header}} - -from collections import defaultdict -from datetime import date, datetime, timedelta # noqa: F401 -import functools -import decimal -import io -import re -import types -import typing -import uuid - -from dateutil.parser.isoparser import isoparser, _takes_ascii -import frozendict - -from {{packageName}}.exceptions import ( - ApiTypeError, - ApiValueError, -) -from {{packageName}}.configuration import ( - Configuration, -) - - -class Unset(object): - """ - An instance of this class is set as the default value for object type(dict) properties that are optional - When a property has an unset value, that property will not be assigned in the dict - """ - pass - -unset = Unset() - -none_type = type(None) -file_type = io.IOBase - - -class FileIO(io.FileIO): - """ - A class for storing files - Note: this class is not immutable - """ - - def __new__(cls, _arg: typing.Union[io.FileIO, io.BufferedReader]): - if isinstance(_arg, (io.FileIO, io.BufferedReader)): - if _arg.closed: - raise ApiValueError('Invalid file state; file is closed and must be open') - _arg.close() - inst = super(FileIO, cls).__new__(cls, _arg.name) - super(FileIO, inst).__init__(_arg.name) - return inst - raise ApiValueError('FileIO must be passed _arg which contains the open file') - - def __init__(self, _arg: typing.Union[io.FileIO, io.BufferedReader]): - pass - - -def update(d: dict, u: dict): - """ - Adds u to d - Where each dict is defaultdict(set) - """ - if not u: - return d - for k, v in u.items(): - if k not in d: - d[k] = v - else: - d[k] = d[k] | v - - -class ValidationMetadata(frozendict.frozendict): - """ - A class storing metadata that is needed to validate OpenApi Schema payloads - """ - def __new__( - cls, - path_to_item: typing.Tuple[typing.Union[str, int], ...] = tuple(['args[0]']), - from_server: bool = False, - configuration: typing.Optional[Configuration] = None, - seen_classes: typing.FrozenSet[typing.Type] = frozenset(), - validated_path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Type]] = frozendict.frozendict() - ): - """ - Args: - path_to_item: the path to the current data being instantiated. - For {'a': [1]} if the code is handling, 1, then the path is ('args[0]', 'a', 0) - This changes from location to location - from_server: whether or not this data came form the server - True when receiving server data - False when instantiating model with client side data not form the server - This does not change from location to location - configuration: the Configuration instance to use - This is needed because in Configuration: - - one can disable validation checking - This does not change from location to location - seen_classes: when deserializing data that matches multiple schemas, this is used to store - the schemas that have been traversed. This is used to stop processing when a cycle is seen. - This changes from location to location - validated_path_to_schemas: stores the already validated schema classes for a given path location - This does not change from location to location - """ - return super().__new__( - cls, - path_to_item=path_to_item, - from_server=from_server, - configuration=configuration, - seen_classes=seen_classes, - validated_path_to_schemas=validated_path_to_schemas - ) - - def validation_ran_earlier(self, cls: type) -> bool: - validated_schemas = self.validated_path_to_schemas.get(self.path_to_item, set()) - validation_ran_earlier = validated_schemas and cls in validated_schemas - if validation_ran_earlier: - return True - if cls in self.seen_classes: - return True - return False - - @property - def path_to_item(self) -> typing.Tuple[typing.Union[str, int], ...]: - return self.get('path_to_item') - - @property - def from_server(self) -> bool: - return self.get('from_server') - - @property - def configuration(self) -> typing.Optional[Configuration]: - return self.get('configuration') - - @property - def seen_classes(self) -> typing.FrozenSet[typing.Type]: - return self.get('seen_classes') - - @property - def validated_path_to_schemas(self) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Type]]: - return self.get('validated_path_to_schemas') - - -def add_deeper_validated_schemas(validation_metadata: ValidationMetadata, path_to_schemas: dict): - # this is called if validation_ran_earlier and current and deeper locations need to be added - current_path_to_item = validation_metadata.path_to_item - other_path_to_schemas = {} - for path_to_item, schemas in validation_metadata.validated_path_to_schemas.items(): - if len(path_to_item) < len(current_path_to_item): - continue - path_begins_with_current_path = path_to_item[:len(current_path_to_item)] == current_path_to_item - if path_begins_with_current_path: - other_path_to_schemas[path_to_item] = schemas - update(path_to_schemas, other_path_to_schemas) - - -class Singleton: - """ - Enums and singletons are the same - The same instance is returned for a given key of (cls, _arg) - """ - _instances = {} - - def __new__(cls, _arg: typing.Any, **kwargs): - """ - cls base classes: BoolClass, NoneClass, str, decimal.Decimal - The 3rd key is used in the tuple below for a corner case where an enum contains integer 1 - However 1.0 can also be ingested into that enum schema because 1.0 == 1 and - Decimal('1.0') == Decimal('1') - But if we omitted the 3rd value in the key, then Decimal('1.0') would be stored as Decimal('1') - and json serializing that instance would be '1' rather than the expected '1.0' - Adding the 3rd value, the str of _arg ensures that 1.0 -> Decimal('1.0') which is serialized as 1.0 - """ - key = (cls, _arg, str(_arg)) - if key not in cls._instances: - if isinstance(_arg, (none_type, bool, BoolClass, NoneClass)): - inst = super().__new__(cls) - cls._instances[key] = inst - else: - cls._instances[key] = super().__new__(cls, _arg) - return cls._instances[key] - - def __repr__(self): - if isinstance(self, NoneClass): - return f'<{self.__class__.__name__}: None>' - elif isinstance(self, BoolClass): - if bool(self): - return f'<{self.__class__.__name__}: True>' - return f'<{self.__class__.__name__}: False>' - return f'<{self.__class__.__name__}: {super().__repr__()}>' - - -class classproperty: - - def __init__(self, fget): - self.fget = fget - - def __get__(self, owner_self, owner_cls): - return self.fget(owner_cls) - - -class NoneClass(Singleton): - @classproperty - def NONE(cls): - return cls(None) - - def __bool__(self) -> bool: - return False - - -class BoolClass(Singleton): - @classproperty - def TRUE(cls): - return cls(True) - - @classproperty - def FALSE(cls): - return cls(False) - - @functools.lru_cache() - def __bool__(self) -> bool: - for key, instance in self._instances.items(): - if self is instance: - return bool(key[1]) - raise ValueError('Unable to find the boolean value of this instance') - - -class MetaOapgTyped: - exclusive_maximum: typing.Union[int, float] - inclusive_maximum: typing.Union[int, float] - exclusive_minimum: typing.Union[int, float] - inclusive_minimum: typing.Union[int, float] - max_items: int - min_items: int - discriminator: typing.Dict[str, typing.Dict[str, typing.Type['Schema']]] - - - class properties: - # to hold object properties - pass - - additional_properties: typing.Optional[typing.Type['Schema']] - max_properties: int - min_properties: int - all_of: typing.List[typing.Type['Schema']] - one_of: typing.List[typing.Type['Schema']] - any_of: typing.List[typing.Type['Schema']] - not_schema: typing.Type['Schema'] - max_length: int - min_length: int - items: typing.Type['Schema'] - - -class Schema: - """ - the base class of all swagger/openapi schemas/models - """ - __inheritable_primitive_types_set = {decimal.Decimal, str, tuple, frozendict.frozendict, FileIO, bytes, BoolClass, NoneClass} - _types: typing.Set[typing.Type] - MetaOapg = MetaOapgTyped - - @staticmethod - def __get_valid_classes_phrase(input_classes): - """Returns a string phrase describing what types are allowed""" - all_classes = list(input_classes) - all_classes = sorted(all_classes, key=lambda cls: cls.__name__) - all_class_names = [cls.__name__ for cls in all_classes] - if len(all_class_names) == 1: - return "is {0}".format(all_class_names[0]) - return "is one of [{0}]".format(", ".join(all_class_names)) - - @staticmethod - def _get_class_oapg(item_cls: typing.Union[types.FunctionType, staticmethod, typing.Type['Schema']]) -> typing.Type['Schema']: - if isinstance(item_cls, types.FunctionType): - # referenced schema - return item_cls() - elif isinstance(item_cls, staticmethod): - # referenced schema - return item_cls.__func__() - return item_cls - - @classmethod - def __type_error_message( - cls, var_value=None, var_name=None, valid_classes=None, key_type=None - ): - """ - Keyword Args: - var_value (any): the variable which has the type_error - var_name (str): the name of the variable which has the typ error - valid_classes (tuple): the accepted classes for current_item's - value - key_type (bool): False if our value is a value in a dict - True if it is a key in a dict - False if our item is an item in a tuple - """ - key_or_value = "value" - if key_type: - key_or_value = "key" - valid_classes_phrase = cls.__get_valid_classes_phrase(valid_classes) - msg = "Invalid type. Required {1} type {2} and " "passed type was {3}".format( - var_name, - key_or_value, - valid_classes_phrase, - type(var_value).__name__, - ) - return msg - - @classmethod - def __get_type_error(cls, var_value, path_to_item, valid_classes, key_type=False): - error_msg = cls.__type_error_message( - var_name=path_to_item[-1], - var_value=var_value, - valid_classes=valid_classes, - key_type=key_type, - ) - return ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=valid_classes, - key_type=key_type, - ) - - @classmethod - def _validate_oapg( - cls, - arg, - validation_metadata: ValidationMetadata, - ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]]: - """ - Schema _validate_oapg - All keyword validation except for type checking was done in calling stack frames - If those validations passed, the validated classes are collected in path_to_schemas - - Returns: - path_to_schemas: a map of path to schemas - - Raises: - ApiValueError: when a string can't be converted into a date or datetime and it must be one of those classes - ApiTypeError: when the input type is not in the list of allowed spec types - """ - base_class = type(arg) - if base_class not in cls._types: - raise cls.__get_type_error( - arg, - validation_metadata.path_to_item, - cls._types, - key_type=False, - ) - - path_to_schemas = {validation_metadata.path_to_item: set()} - path_to_schemas[validation_metadata.path_to_item].add(cls) - path_to_schemas[validation_metadata.path_to_item].add(base_class) - return path_to_schemas - - @staticmethod - def _process_schema_classes_oapg( - schema_classes: typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]] - ): - """ - Processes and mutates schema_classes - If a SomeSchema is a subclass of DictSchema then remove DictSchema because it is already included - """ - if len(schema_classes) < 2: - return - if len(schema_classes) > 2 and UnsetAnyTypeSchema in schema_classes: - schema_classes.remove(UnsetAnyTypeSchema) - x_schema = schema_type_classes & schema_classes - if not x_schema: - return - x_schema = x_schema.pop() - if any(c is not x_schema and issubclass(c, x_schema) for c in schema_classes): - # needed to not have a mro error in get_new_class - schema_classes.remove(x_schema) - - @classmethod - def __get_new_cls( - cls, - arg, - validation_metadata: ValidationMetadata - ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Type['Schema']]: - """ - Make a new dynamic class and return an instance of that class - We are making an instance of cls, but instead of making cls - make a new class, new_cls - which includes dynamic bases including cls - return an instance of that new class - - Dict property + List Item Assignment Use cases: - 1. value is NOT an instance of the required schema class - the value is validated by _validate_oapg - _validate_oapg returns a key value pair - where the key is the path to the item, and the value will be the required manufactured class - made out of the matching schemas - 2. value is an instance of the correct schema type - the value is NOT validated by _validate_oapg, _validate_oapg only checks that the instance is of the correct schema type - for this value, _validate_oapg does NOT return an entry for it in _path_to_schemas - and in list/dict _get_items_oapg,_get_properties_oapg the value will be directly assigned - because value is of the correct type, and validation was run earlier when the instance was created - """ - _path_to_schemas = {} - if validation_metadata.validation_ran_earlier(cls): - add_deeper_validated_schemas(validation_metadata, _path_to_schemas) - else: - other_path_to_schemas = cls._validate_oapg(arg, validation_metadata=validation_metadata) - update(_path_to_schemas, other_path_to_schemas) - # loop through it make a new class for each entry - # do not modify the returned result because it is cached and we would be modifying the cached value - path_to_schemas = {} - for path, schema_classes in _path_to_schemas.items(): - """ - Use cases - 1. N number of schema classes + enum + type != bool/None, classes in path_to_schemas: tuple/frozendict.frozendict/str/Decimal/bytes/FileIo - needs Singleton added - 2. N number of schema classes + enum + type == bool/None, classes in path_to_schemas: BoolClass/NoneClass - Singleton already added - 3. N number of schema classes, classes in path_to_schemas: BoolClass/NoneClass/tuple/frozendict.frozendict/str/Decimal/bytes/FileIo - """ - cls._process_schema_classes_oapg(schema_classes) - enum_schema = any( - issubclass(this_cls, EnumBase) for this_cls in schema_classes) - inheritable_primitive_type = schema_classes.intersection(cls.__inheritable_primitive_types_set) - chosen_schema_classes = schema_classes - inheritable_primitive_type - suffix = tuple(inheritable_primitive_type) - if enum_schema and suffix[0] not in {NoneClass, BoolClass}: - suffix = (Singleton,) + suffix - - used_classes = tuple(sorted(chosen_schema_classes, key=lambda a_cls: a_cls.__name__)) + suffix - mfg_cls = get_new_class(class_name='DynamicSchema', bases=used_classes) - path_to_schemas[path] = mfg_cls - - return path_to_schemas - - @classmethod - def _get_new_instance_without_conversion_oapg( - cls, - arg: typing.Any, - path_to_item: typing.Tuple[typing.Union[str, int], ...], - path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Type['Schema']] - ): - # We have a Dynamic class and we are making an instance of it - if issubclass(cls, frozendict.frozendict) and issubclass(cls, DictBase): - properties = cls._get_properties_oapg(arg, path_to_item, path_to_schemas) - return super(Schema, cls).__new__(cls, properties) - elif issubclass(cls, tuple) and issubclass(cls, ListBase): - items = cls._get_items_oapg(arg, path_to_item, path_to_schemas) - return super(Schema, cls).__new__(cls, items) - """ - str = openapi str, date, and datetime - decimal.Decimal = openapi int and float - FileIO = openapi binary type and the user inputs a file - bytes = openapi binary type and the user inputs bytes - """ - return super(Schema, cls).__new__(cls, arg) - - @classmethod - def from_openapi_data_oapg( - cls, - arg: typing.Union[ - str, - date, - datetime, - int, - float, - decimal.Decimal, - bool, - None, - 'Schema', - dict, - frozendict.frozendict, - tuple, - list, - io.FileIO, - io.BufferedReader, - bytes - ], - _configuration: typing.Optional[Configuration] - ): - """ - Schema from_openapi_data_oapg - """ - from_server = True - validated_path_to_schemas = {} - arg = cast_to_allowed_types(arg, from_server, validated_path_to_schemas) - validation_metadata = ValidationMetadata( - from_server=from_server, configuration=_configuration, validated_path_to_schemas=validated_path_to_schemas) - path_to_schemas = cls.__get_new_cls(arg, validation_metadata) - new_cls = path_to_schemas[validation_metadata.path_to_item] - new_inst = new_cls._get_new_instance_without_conversion_oapg( - arg, - validation_metadata.path_to_item, - path_to_schemas - ) - return new_inst - - @staticmethod - def __get_input_dict(*args, **kwargs) -> frozendict.frozendict: - input_dict = {} - if args and isinstance(args[0], (dict, frozendict.frozendict)): - input_dict.update(args[0]) - if kwargs: - input_dict.update(kwargs) - return frozendict.frozendict(input_dict) - - @staticmethod - def __remove_unsets(kwargs): - return {key: val for key, val in kwargs.items() if val is not unset} - - def __new__(cls, *_args: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema'], _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema', Unset]): - """ - Schema __new__ - - Args: - _args (int/float/decimal.Decimal/str/list/tuple/dict/frozendict.frozendict/bool/None): the value - kwargs (str, int/float/decimal.Decimal/str/list/tuple/dict/frozendict.frozendict/bool/None): dict values - _configuration: contains the Configuration that enables json schema validation keywords - like minItems, minLength etc - - Note: double underscores are used here because pycharm thinks that these variables - are instance properties if they are named normally :( - """ - __kwargs = cls.__remove_unsets(kwargs) - if not _args and not __kwargs: - raise TypeError( - 'No input given. args or kwargs must be given.' - ) - if not __kwargs and _args and not isinstance(_args[0], dict): - __arg = _args[0] - else: - __arg = cls.__get_input_dict(*_args, **__kwargs) - __from_server = False - __validated_path_to_schemas = {} - __arg = cast_to_allowed_types( - __arg, __from_server, __validated_path_to_schemas) - __validation_metadata = ValidationMetadata( - configuration=_configuration, from_server=__from_server, validated_path_to_schemas=__validated_path_to_schemas) - __path_to_schemas = cls.__get_new_cls(__arg, __validation_metadata) - __new_cls = __path_to_schemas[__validation_metadata.path_to_item] - return __new_cls._get_new_instance_without_conversion_oapg( - __arg, - __validation_metadata.path_to_item, - __path_to_schemas - ) - - def __init__( - self, - *_args: typing.Union[ - dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema'], - _configuration: typing.Optional[Configuration] = None, - **kwargs: typing.Union[ - dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema', Unset - ] - ): - """ - this is needed to fix 'Unexpected argument' warning in pycharm - this code does nothing because all Schema instances are immutable - this means that all input data is passed into and used in new, and after the new instance is made - no new attributes are assigned and init is not used - """ - pass - -""" -import itertools -data_types = ('None', 'FrozenDict', 'Tuple', 'Str', 'Decimal', 'Bool') -type_to_cls = { - 'None': 'NoneClass', - 'FrozenDict': 'frozendict.frozendict', - 'Tuple': 'tuple', - 'Str': 'str', - 'Decimal': 'decimal.Decimal', - 'Bool': 'BoolClass' -} -cls_tuples = [v for v in itertools.combinations(data_types, 5)] -typed_classes = [f"class {''.join(cls_tuple)}Mixin({', '.join(type_to_cls[typ] for typ in cls_tuple)}):\n pass" for cls_tuple in cls_tuples] -for cls in typed_classes: - print(cls) -object_classes = [f"{''.join(cls_tuple)}Mixin = object" for cls_tuple in cls_tuples] -for cls in object_classes: - print(cls) -""" -if typing.TYPE_CHECKING: - # qty 1 - NoneMixin = NoneClass - FrozenDictMixin = frozendict.frozendict - TupleMixin = tuple - StrMixin = str - DecimalMixin = decimal.Decimal - BoolMixin = BoolClass - BytesMixin = bytes - FileMixin = FileIO - # qty 2 - class BinaryMixin(bytes, FileIO): - pass - class NoneFrozenDictMixin(NoneClass, frozendict.frozendict): - pass - class NoneTupleMixin(NoneClass, tuple): - pass - class NoneStrMixin(NoneClass, str): - pass - class NoneDecimalMixin(NoneClass, decimal.Decimal): - pass - class NoneBoolMixin(NoneClass, BoolClass): - pass - class FrozenDictTupleMixin(frozendict.frozendict, tuple): - pass - class FrozenDictStrMixin(frozendict.frozendict, str): - pass - class FrozenDictDecimalMixin(frozendict.frozendict, decimal.Decimal): - pass - class FrozenDictBoolMixin(frozendict.frozendict, BoolClass): - pass - class TupleStrMixin(tuple, str): - pass - class TupleDecimalMixin(tuple, decimal.Decimal): - pass - class TupleBoolMixin(tuple, BoolClass): - pass - class StrDecimalMixin(str, decimal.Decimal): - pass - class StrBoolMixin(str, BoolClass): - pass - class DecimalBoolMixin(decimal.Decimal, BoolClass): - pass - # qty 3 - class NoneFrozenDictTupleMixin(NoneClass, frozendict.frozendict, tuple): - pass - class NoneFrozenDictStrMixin(NoneClass, frozendict.frozendict, str): - pass - class NoneFrozenDictDecimalMixin(NoneClass, frozendict.frozendict, decimal.Decimal): - pass - class NoneFrozenDictBoolMixin(NoneClass, frozendict.frozendict, BoolClass): - pass - class NoneTupleStrMixin(NoneClass, tuple, str): - pass - class NoneTupleDecimalMixin(NoneClass, tuple, decimal.Decimal): - pass - class NoneTupleBoolMixin(NoneClass, tuple, BoolClass): - pass - class NoneStrDecimalMixin(NoneClass, str, decimal.Decimal): - pass - class NoneStrBoolMixin(NoneClass, str, BoolClass): - pass - class NoneDecimalBoolMixin(NoneClass, decimal.Decimal, BoolClass): - pass - class FrozenDictTupleStrMixin(frozendict.frozendict, tuple, str): - pass - class FrozenDictTupleDecimalMixin(frozendict.frozendict, tuple, decimal.Decimal): - pass - class FrozenDictTupleBoolMixin(frozendict.frozendict, tuple, BoolClass): - pass - class FrozenDictStrDecimalMixin(frozendict.frozendict, str, decimal.Decimal): - pass - class FrozenDictStrBoolMixin(frozendict.frozendict, str, BoolClass): - pass - class FrozenDictDecimalBoolMixin(frozendict.frozendict, decimal.Decimal, BoolClass): - pass - class TupleStrDecimalMixin(tuple, str, decimal.Decimal): - pass - class TupleStrBoolMixin(tuple, str, BoolClass): - pass - class TupleDecimalBoolMixin(tuple, decimal.Decimal, BoolClass): - pass - class StrDecimalBoolMixin(str, decimal.Decimal, BoolClass): - pass - # qty 4 - class NoneFrozenDictTupleStrMixin(NoneClass, frozendict.frozendict, tuple, str): - pass - class NoneFrozenDictTupleDecimalMixin(NoneClass, frozendict.frozendict, tuple, decimal.Decimal): - pass - class NoneFrozenDictTupleBoolMixin(NoneClass, frozendict.frozendict, tuple, BoolClass): - pass - class NoneFrozenDictStrDecimalMixin(NoneClass, frozendict.frozendict, str, decimal.Decimal): - pass - class NoneFrozenDictStrBoolMixin(NoneClass, frozendict.frozendict, str, BoolClass): - pass - class NoneFrozenDictDecimalBoolMixin(NoneClass, frozendict.frozendict, decimal.Decimal, BoolClass): - pass - class NoneTupleStrDecimalMixin(NoneClass, tuple, str, decimal.Decimal): - pass - class NoneTupleStrBoolMixin(NoneClass, tuple, str, BoolClass): - pass - class NoneTupleDecimalBoolMixin(NoneClass, tuple, decimal.Decimal, BoolClass): - pass - class NoneStrDecimalBoolMixin(NoneClass, str, decimal.Decimal, BoolClass): - pass - class FrozenDictTupleStrDecimalMixin(frozendict.frozendict, tuple, str, decimal.Decimal): - pass - class FrozenDictTupleStrBoolMixin(frozendict.frozendict, tuple, str, BoolClass): - pass - class FrozenDictTupleDecimalBoolMixin(frozendict.frozendict, tuple, decimal.Decimal, BoolClass): - pass - class FrozenDictStrDecimalBoolMixin(frozendict.frozendict, str, decimal.Decimal, BoolClass): - pass - class TupleStrDecimalBoolMixin(tuple, str, decimal.Decimal, BoolClass): - pass - # qty 5 - class NoneFrozenDictTupleStrDecimalMixin(NoneClass, frozendict.frozendict, tuple, str, decimal.Decimal): - pass - class NoneFrozenDictTupleStrBoolMixin(NoneClass, frozendict.frozendict, tuple, str, BoolClass): - pass - class NoneFrozenDictTupleDecimalBoolMixin(NoneClass, frozendict.frozendict, tuple, decimal.Decimal, BoolClass): - pass - class NoneFrozenDictStrDecimalBoolMixin(NoneClass, frozendict.frozendict, str, decimal.Decimal, BoolClass): - pass - class NoneTupleStrDecimalBoolMixin(NoneClass, tuple, str, decimal.Decimal, BoolClass): - pass - class FrozenDictTupleStrDecimalBoolMixin(frozendict.frozendict, tuple, str, decimal.Decimal, BoolClass): - pass - # qty 6 - class NoneFrozenDictTupleStrDecimalBoolMixin(NoneClass, frozendict.frozendict, tuple, str, decimal.Decimal, BoolClass): - pass - # qty 8 - class NoneFrozenDictTupleStrDecimalBoolFileBytesMixin(NoneClass, frozendict.frozendict, tuple, str, decimal.Decimal, BoolClass, FileIO, bytes): - pass -else: - # qty 1 - class NoneMixin: - _types = {NoneClass} - class FrozenDictMixin: - _types = {frozendict.frozendict} - class TupleMixin: - _types = {tuple} - class StrMixin: - _types = {str} - class DecimalMixin: - _types = {decimal.Decimal} - class BoolMixin: - _types = {BoolClass} - class BytesMixin: - _types = {bytes} - class FileMixin: - _types = {FileIO} - # qty 2 - class BinaryMixin: - _types = {bytes, FileIO} - class NoneFrozenDictMixin: - _types = {NoneClass, frozendict.frozendict} - class NoneTupleMixin: - _types = {NoneClass, tuple} - class NoneStrMixin: - _types = {NoneClass, str} - class NoneDecimalMixin: - _types = {NoneClass, decimal.Decimal} - class NoneBoolMixin: - _types = {NoneClass, BoolClass} - class FrozenDictTupleMixin: - _types = {frozendict.frozendict, tuple} - class FrozenDictStrMixin: - _types = {frozendict.frozendict, str} - class FrozenDictDecimalMixin: - _types = {frozendict.frozendict, decimal.Decimal} - class FrozenDictBoolMixin: - _types = {frozendict.frozendict, BoolClass} - class TupleStrMixin: - _types = {tuple, str} - class TupleDecimalMixin: - _types = {tuple, decimal.Decimal} - class TupleBoolMixin: - _types = {tuple, BoolClass} - class StrDecimalMixin: - _types = {str, decimal.Decimal} - class StrBoolMixin: - _types = {str, BoolClass} - class DecimalBoolMixin: - _types = {decimal.Decimal, BoolClass} - # qty 3 - class NoneFrozenDictTupleMixin: - _types = {NoneClass, frozendict.frozendict, tuple} - class NoneFrozenDictStrMixin: - _types = {NoneClass, frozendict.frozendict, str} - class NoneFrozenDictDecimalMixin: - _types = {NoneClass, frozendict.frozendict, decimal.Decimal} - class NoneFrozenDictBoolMixin: - _types = {NoneClass, frozendict.frozendict, BoolClass} - class NoneTupleStrMixin: - _types = {NoneClass, tuple, str} - class NoneTupleDecimalMixin: - _types = {NoneClass, tuple, decimal.Decimal} - class NoneTupleBoolMixin: - _types = {NoneClass, tuple, BoolClass} - class NoneStrDecimalMixin: - _types = {NoneClass, str, decimal.Decimal} - class NoneStrBoolMixin: - _types = {NoneClass, str, BoolClass} - class NoneDecimalBoolMixin: - _types = {NoneClass, decimal.Decimal, BoolClass} - class FrozenDictTupleStrMixin: - _types = {frozendict.frozendict, tuple, str} - class FrozenDictTupleDecimalMixin: - _types = {frozendict.frozendict, tuple, decimal.Decimal} - class FrozenDictTupleBoolMixin: - _types = {frozendict.frozendict, tuple, BoolClass} - class FrozenDictStrDecimalMixin: - _types = {frozendict.frozendict, str, decimal.Decimal} - class FrozenDictStrBoolMixin: - _types = {frozendict.frozendict, str, BoolClass} - class FrozenDictDecimalBoolMixin: - _types = {frozendict.frozendict, decimal.Decimal, BoolClass} - class TupleStrDecimalMixin: - _types = {tuple, str, decimal.Decimal} - class TupleStrBoolMixin: - _types = {tuple, str, BoolClass} - class TupleDecimalBoolMixin: - _types = {tuple, decimal.Decimal, BoolClass} - class StrDecimalBoolMixin: - _types = {str, decimal.Decimal, BoolClass} - # qty 4 - class NoneFrozenDictTupleStrMixin: - _types = {NoneClass, frozendict.frozendict, tuple, str} - class NoneFrozenDictTupleDecimalMixin: - _types = {NoneClass, frozendict.frozendict, tuple, decimal.Decimal} - class NoneFrozenDictTupleBoolMixin: - _types = {NoneClass, frozendict.frozendict, tuple, BoolClass} - class NoneFrozenDictStrDecimalMixin: - _types = {NoneClass, frozendict.frozendict, str, decimal.Decimal} - class NoneFrozenDictStrBoolMixin: - _types = {NoneClass, frozendict.frozendict, str, BoolClass} - class NoneFrozenDictDecimalBoolMixin: - _types = {NoneClass, frozendict.frozendict, decimal.Decimal, BoolClass} - class NoneTupleStrDecimalMixin: - _types = {NoneClass, tuple, str, decimal.Decimal} - class NoneTupleStrBoolMixin: - _types = {NoneClass, tuple, str, BoolClass} - class NoneTupleDecimalBoolMixin: - _types = {NoneClass, tuple, decimal.Decimal, BoolClass} - class NoneStrDecimalBoolMixin: - _types = {NoneClass, str, decimal.Decimal, BoolClass} - class FrozenDictTupleStrDecimalMixin: - _types = {frozendict.frozendict, tuple, str, decimal.Decimal} - class FrozenDictTupleStrBoolMixin: - _types = {frozendict.frozendict, tuple, str, BoolClass} - class FrozenDictTupleDecimalBoolMixin: - _types = {frozendict.frozendict, tuple, decimal.Decimal, BoolClass} - class FrozenDictStrDecimalBoolMixin: - _types = {frozendict.frozendict, str, decimal.Decimal, BoolClass} - class TupleStrDecimalBoolMixin: - _types = {tuple, str, decimal.Decimal, BoolClass} - # qty 5 - class NoneFrozenDictTupleStrDecimalMixin: - _types = {NoneClass, frozendict.frozendict, tuple, str, decimal.Decimal} - class NoneFrozenDictTupleStrBoolMixin: - _types = {NoneClass, frozendict.frozendict, tuple, str, BoolClass} - class NoneFrozenDictTupleDecimalBoolMixin: - _types = {NoneClass, frozendict.frozendict, tuple, decimal.Decimal, BoolClass} - class NoneFrozenDictStrDecimalBoolMixin: - _types = {NoneClass, frozendict.frozendict, str, decimal.Decimal, BoolClass} - class NoneTupleStrDecimalBoolMixin: - _types = {NoneClass, tuple, str, decimal.Decimal, BoolClass} - class FrozenDictTupleStrDecimalBoolMixin: - _types = {frozendict.frozendict, tuple, str, decimal.Decimal, BoolClass} - # qty 6 - class NoneFrozenDictTupleStrDecimalBoolMixin: - _types = {NoneClass, frozendict.frozendict, tuple, str, decimal.Decimal, BoolClass} - # qty 8 - class NoneFrozenDictTupleStrDecimalBoolFileBytesMixin: - _types = {NoneClass, frozendict.frozendict, tuple, str, decimal.Decimal, BoolClass, FileIO, bytes} - - -class ValidatorBase: - @staticmethod - def _is_json_validation_enabled_oapg(schema_keyword, configuration=None): - """Returns true if JSON schema validation is enabled for the specified - validation keyword. This can be used to skip JSON schema structural validation - as requested in the configuration. - Note: the suffix _oapg stands for openapi python (experimental) generator and - it has been added to prevent collisions with other methods and properties - - Args: - schema_keyword (string): the name of a JSON schema validation keyword. - configuration (Configuration): the configuration class. - """ - - return (configuration is None or - not hasattr(configuration, '_disabled_client_side_validations') or - schema_keyword not in configuration._disabled_client_side_validations) - - @staticmethod - def _raise_validation_error_message_oapg(value, constraint_msg, constraint_value, path_to_item, additional_txt=""): - raise ApiValueError( - "Invalid value `{value}`, {constraint_msg} `{constraint_value}`{additional_txt} at {path_to_item}".format( - value=value, - constraint_msg=constraint_msg, - constraint_value=constraint_value, - additional_txt=additional_txt, - path_to_item=path_to_item, - ) - ) - - -class EnumBase: - @classmethod - def _validate_oapg( - cls, - arg, - validation_metadata: ValidationMetadata, - ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]]: - """ - EnumBase _validate_oapg - Validates that arg is in the enum's allowed values - """ - try: - cls.MetaOapg.enum_value_to_name[arg] - except KeyError: - raise ApiValueError("Invalid value {} passed in to {}, allowed_values={}".format(arg, cls, cls.MetaOapg.enum_value_to_name.keys())) - return super()._validate_oapg(arg, validation_metadata=validation_metadata) - - -class BoolBase: - def is_true_oapg(self) -> bool: - """ - A replacement for x is True - True if the instance is a BoolClass True Singleton - """ - if not issubclass(self.__class__, BoolClass): - return False - return bool(self) - - def is_false_oapg(self) -> bool: - """ - A replacement for x is False - True if the instance is a BoolClass False Singleton - """ - if not issubclass(self.__class__, BoolClass): - return False - return bool(self) is False - - -class NoneBase: - def is_none_oapg(self) -> bool: - """ - A replacement for x is None - True if the instance is a NoneClass None Singleton - """ - if issubclass(self.__class__, NoneClass): - return True - return False - - -class StrBase(ValidatorBase): - MetaOapg: MetaOapgTyped - - @property - def as_str_oapg(self) -> str: - return self - - @property - def as_date_oapg(self) -> date: - raise Exception('not implemented') - - @property - def as_datetime_oapg(self) -> datetime: - raise Exception('not implemented') - - @property - def as_decimal_oapg(self) -> decimal.Decimal: - raise Exception('not implemented') - - @property - def as_uuid_oapg(self) -> uuid.UUID: - raise Exception('not implemented') - - @classmethod - def __check_str_validations( - cls, - arg: str, - validation_metadata: ValidationMetadata - ): - if not hasattr(cls, 'MetaOapg'): - return - if (cls._is_json_validation_enabled_oapg('maxLength', validation_metadata.configuration) and - hasattr(cls.MetaOapg, 'max_length') and - len(arg) > cls.MetaOapg.max_length): - cls._raise_validation_error_message_oapg( - value=arg, - constraint_msg="length must be less than or equal to", - constraint_value=cls.MetaOapg.max_length, - path_to_item=validation_metadata.path_to_item - ) - - if (cls._is_json_validation_enabled_oapg('minLength', validation_metadata.configuration) and - hasattr(cls.MetaOapg, 'min_length') and - len(arg) < cls.MetaOapg.min_length): - cls._raise_validation_error_message_oapg( - value=arg, - constraint_msg="length must be greater than or equal to", - constraint_value=cls.MetaOapg.min_length, - path_to_item=validation_metadata.path_to_item - ) - - if (cls._is_json_validation_enabled_oapg('pattern', validation_metadata.configuration) and - hasattr(cls.MetaOapg, 'regex')): - for regex_dict in cls.MetaOapg.regex: - flags = regex_dict.get('flags', 0) - if not re.search(regex_dict['pattern'], arg, flags=flags): - if flags != 0: - # Don't print the regex flags if the flags are not - # specified in the OAS document. - cls._raise_validation_error_message_oapg( - value=arg, - constraint_msg="must match regular expression", - constraint_value=regex_dict['pattern'], - path_to_item=validation_metadata.path_to_item, - additional_txt=" with flags=`{}`".format(flags) - ) - cls._raise_validation_error_message_oapg( - value=arg, - constraint_msg="must match regular expression", - constraint_value=regex_dict['pattern'], - path_to_item=validation_metadata.path_to_item - ) - - @classmethod - def _validate_oapg( - cls, - arg, - validation_metadata: ValidationMetadata, - ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]]: - """ - StrBase _validate_oapg - Validates that validations pass - """ - if isinstance(arg, str): - cls.__check_str_validations(arg, validation_metadata) - return super()._validate_oapg(arg, validation_metadata=validation_metadata) - - -class UUIDBase: - @property - @functools.lru_cache() - def as_uuid_oapg(self) -> uuid.UUID: - return uuid.UUID(self) - - @classmethod - def __validate_format(cls, arg: typing.Optional[str], validation_metadata: ValidationMetadata): - if isinstance(arg, str): - try: - uuid.UUID(arg) - return True - except ValueError: - raise ApiValueError( - "Invalid value '{}' for type UUID at {}".format(arg, validation_metadata.path_to_item) - ) - - @classmethod - def _validate_oapg( - cls, - arg, - validation_metadata: typing.Optional[ValidationMetadata] = None, - ): - """ - UUIDBase _validate_oapg - """ - cls.__validate_format(arg, validation_metadata=validation_metadata) - return super()._validate_oapg(arg, validation_metadata=validation_metadata) - - -class CustomIsoparser(isoparser): - - @_takes_ascii - def parse_isodatetime(self, dt_str): - components, pos = self._parse_isodate(dt_str) - if len(dt_str) > pos: - if self._sep is None or dt_str[pos:pos + 1] == self._sep: - components += self._parse_isotime(dt_str[pos + 1:]) - else: - raise ValueError('String contains unknown ISO components') - - if len(components) > 3 and components[3] == 24: - components[3] = 0 - return datetime(*components) + timedelta(days=1) - - if len(components) <= 3: - raise ValueError('Value is not a datetime') - - return datetime(*components) - - @_takes_ascii - def parse_isodate(self, datestr): - components, pos = self._parse_isodate(datestr) - - if len(datestr) > pos: - raise ValueError('String contains invalid time components') - - if len(components) > 3: - raise ValueError('String contains invalid time components') - - return date(*components) - - -DEFAULT_ISOPARSER = CustomIsoparser() - - -class DateBase: - @property - @functools.lru_cache() - def as_date_oapg(self) -> date: - return DEFAULT_ISOPARSER.parse_isodate(self) - - @classmethod - def __validate_format(cls, arg: typing.Optional[str], validation_metadata: ValidationMetadata): - if isinstance(arg, str): - try: - DEFAULT_ISOPARSER.parse_isodate(arg) - return True - except ValueError: - raise ApiValueError( - "Value does not conform to the required ISO-8601 date format. " - "Invalid value '{}' for type date at {}".format(arg, validation_metadata.path_to_item) - ) - - @classmethod - def _validate_oapg( - cls, - arg, - validation_metadata: typing.Optional[ValidationMetadata] = None, - ): - """ - DateBase _validate_oapg - """ - cls.__validate_format(arg, validation_metadata=validation_metadata) - return super()._validate_oapg(arg, validation_metadata=validation_metadata) - - -class DateTimeBase: - @property - @functools.lru_cache() - def as_datetime_oapg(self) -> datetime: - return DEFAULT_ISOPARSER.parse_isodatetime(self) - - @classmethod - def __validate_format(cls, arg: typing.Optional[str], validation_metadata: ValidationMetadata): - if isinstance(arg, str): - try: - DEFAULT_ISOPARSER.parse_isodatetime(arg) - return True - except ValueError: - raise ApiValueError( - "Value does not conform to the required ISO-8601 datetime format. " - "Invalid value '{}' for type datetime at {}".format(arg, validation_metadata.path_to_item) - ) - - @classmethod - def _validate_oapg( - cls, - arg, - validation_metadata: ValidationMetadata, - ): - """ - DateTimeBase _validate_oapg - """ - cls.__validate_format(arg, validation_metadata=validation_metadata) - return super()._validate_oapg(arg, validation_metadata=validation_metadata) - - -class DecimalBase: - """ - A class for storing decimals that are sent over the wire as strings - These schemas must remain based on StrBase rather than NumberBase - because picking base classes must be deterministic - """ - - @property - @functools.lru_cache() - def as_decimal_oapg(self) -> decimal.Decimal: - return decimal.Decimal(self) - - @classmethod - def __validate_format(cls, arg: typing.Optional[str], validation_metadata: ValidationMetadata): - if isinstance(arg, str): - try: - decimal.Decimal(arg) - return True - except decimal.InvalidOperation: - raise ApiValueError( - "Value cannot be converted to a decimal. " - "Invalid value '{}' for type decimal at {}".format(arg, validation_metadata.path_to_item) - ) - - @classmethod - def _validate_oapg( - cls, - arg, - validation_metadata: ValidationMetadata, - ): - """ - DecimalBase _validate_oapg - """ - cls.__validate_format(arg, validation_metadata=validation_metadata) - return super()._validate_oapg(arg, validation_metadata=validation_metadata) - - -class NumberBase(ValidatorBase): - MetaOapg: MetaOapgTyped - - @property - def as_int_oapg(self) -> int: - try: - return self._as_int - except AttributeError: - """ - Note: for some numbers like 9.0 they could be represented as an - integer but our code chooses to store them as - >>> Decimal('9.0').as_tuple() - DecimalTuple(sign=0, digits=(9, 0), exponent=-1) - so we can tell that the value came from a float and convert it back to a float - during later serialization - """ - if self.as_tuple().exponent < 0: - # this could be represented as an integer but should be represented as a float - # because that's what it was serialized from - raise ApiValueError(f'{self} is not an integer') - self._as_int = int(self) - return self._as_int - - @property - def as_float_oapg(self) -> float: - try: - return self._as_float - except AttributeError: - if self.as_tuple().exponent >= 0: - raise ApiValueError(f'{self} is not a float') - self._as_float = float(self) - return self._as_float - - @classmethod - def __check_numeric_validations( - cls, - arg, - validation_metadata: ValidationMetadata - ): - if not hasattr(cls, 'MetaOapg'): - return - if cls._is_json_validation_enabled_oapg('multipleOf', - validation_metadata.configuration) and hasattr(cls.MetaOapg, 'multiple_of'): - multiple_of_value = cls.MetaOapg.multiple_of - if (not (float(arg) / multiple_of_value).is_integer()): - # Note 'multipleOf' will be as good as the floating point arithmetic. - cls._raise_validation_error_message_oapg( - value=arg, - constraint_msg="value must be a multiple of", - constraint_value=multiple_of_value, - path_to_item=validation_metadata.path_to_item - ) - - checking_max_or_min_values = any( - hasattr(cls.MetaOapg, validation_key) for validation_key in { - 'exclusive_maximum', - 'inclusive_maximum', - 'exclusive_minimum', - 'inclusive_minimum', - } - ) - if not checking_max_or_min_values: - return - - if (cls._is_json_validation_enabled_oapg('exclusiveMaximum', validation_metadata.configuration) and - hasattr(cls.MetaOapg, 'exclusive_maximum') and - arg >= cls.MetaOapg.exclusive_maximum): - cls._raise_validation_error_message_oapg( - value=arg, - constraint_msg="must be a value less than", - constraint_value=cls.MetaOapg.exclusive_maximum, - path_to_item=validation_metadata.path_to_item - ) - - if (cls._is_json_validation_enabled_oapg('maximum', validation_metadata.configuration) and - hasattr(cls.MetaOapg, 'inclusive_maximum') and - arg > cls.MetaOapg.inclusive_maximum): - cls._raise_validation_error_message_oapg( - value=arg, - constraint_msg="must be a value less than or equal to", - constraint_value=cls.MetaOapg.inclusive_maximum, - path_to_item=validation_metadata.path_to_item - ) - - if (cls._is_json_validation_enabled_oapg('exclusiveMinimum', validation_metadata.configuration) and - hasattr(cls.MetaOapg, 'exclusive_minimum') and - arg <= cls.MetaOapg.exclusive_minimum): - cls._raise_validation_error_message_oapg( - value=arg, - constraint_msg="must be a value greater than", - constraint_value=cls.MetaOapg.exclusive_maximum, - path_to_item=validation_metadata.path_to_item - ) - - if (cls._is_json_validation_enabled_oapg('minimum', validation_metadata.configuration) and - hasattr(cls.MetaOapg, 'inclusive_minimum') and - arg < cls.MetaOapg.inclusive_minimum): - cls._raise_validation_error_message_oapg( - value=arg, - constraint_msg="must be a value greater than or equal to", - constraint_value=cls.MetaOapg.inclusive_minimum, - path_to_item=validation_metadata.path_to_item - ) - - @classmethod - def _validate_oapg( - cls, - arg, - validation_metadata: ValidationMetadata, - ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]]: - """ - NumberBase _validate_oapg - Validates that validations pass - """ - if isinstance(arg, decimal.Decimal): - cls.__check_numeric_validations(arg, validation_metadata) - return super()._validate_oapg(arg, validation_metadata=validation_metadata) - - -class ListBase(ValidatorBase): - MetaOapg: MetaOapgTyped - - @classmethod - def __validate_items(cls, list_items, validation_metadata: ValidationMetadata): - """ - Ensures that: - - values passed in for items are valid - Exceptions will be raised if: - - invalid arguments were passed in - - Args: - list_items: the input list of items - - Raises: - ApiTypeError - for missing required arguments, or for invalid properties - """ - - # if we have definitions for an items schema, use it - # otherwise accept anything - item_cls = getattr(cls.MetaOapg, 'items', UnsetAnyTypeSchema) - item_cls = cls._get_class_oapg(item_cls) - path_to_schemas = {} - for i, value in enumerate(list_items): - item_validation_metadata = ValidationMetadata( - from_server=validation_metadata.from_server, - configuration=validation_metadata.configuration, - path_to_item=validation_metadata.path_to_item+(i,), - validated_path_to_schemas=validation_metadata.validated_path_to_schemas - ) - if item_validation_metadata.validation_ran_earlier(item_cls): - add_deeper_validated_schemas(item_validation_metadata, path_to_schemas) - continue - other_path_to_schemas = item_cls._validate_oapg( - value, validation_metadata=item_validation_metadata) - update(path_to_schemas, other_path_to_schemas) - return path_to_schemas - - @classmethod - def __check_tuple_validations( - cls, arg, - validation_metadata: ValidationMetadata): - if not hasattr(cls, 'MetaOapg'): - return - if (cls._is_json_validation_enabled_oapg('maxItems', validation_metadata.configuration) and - hasattr(cls.MetaOapg, 'max_items') and - len(arg) > cls.MetaOapg.max_items): - cls._raise_validation_error_message_oapg( - value=arg, - constraint_msg="number of items must be less than or equal to", - constraint_value=cls.MetaOapg.max_items, - path_to_item=validation_metadata.path_to_item - ) - - if (cls._is_json_validation_enabled_oapg('minItems', validation_metadata.configuration) and - hasattr(cls.MetaOapg, 'min_items') and - len(arg) < cls.MetaOapg.min_items): - cls._raise_validation_error_message_oapg( - value=arg, - constraint_msg="number of items must be greater than or equal to", - constraint_value=cls.MetaOapg.min_items, - path_to_item=validation_metadata.path_to_item - ) - - if (cls._is_json_validation_enabled_oapg('uniqueItems', validation_metadata.configuration) and - hasattr(cls.MetaOapg, 'unique_items') and cls.MetaOapg.unique_items and arg): - unique_items = set(arg) - if len(arg) > len(unique_items): - cls._raise_validation_error_message_oapg( - value=arg, - constraint_msg="duplicate items were found, and the tuple must not contain duplicates because", - constraint_value='unique_items==True', - path_to_item=validation_metadata.path_to_item - ) - - @classmethod - def _validate_oapg( - cls, - arg, - validation_metadata: ValidationMetadata, - ): - """ - ListBase _validate_oapg - We return dynamic classes of different bases depending upon the inputs - This makes it so: - - the returned instance is always a subclass of our defining schema - - this allows us to check type based on whether an instance is a subclass of a schema - - the returned instance is a serializable type (except for None, True, and False) which are enums - - Returns: - new_cls (type): the new class - - Raises: - ApiValueError: when a string can't be converted into a date or datetime and it must be one of those classes - ApiTypeError: when the input type is not in the list of allowed spec types - """ - if isinstance(arg, tuple): - cls.__check_tuple_validations(arg, validation_metadata) - _path_to_schemas = super()._validate_oapg(arg, validation_metadata=validation_metadata) - if not isinstance(arg, tuple): - return _path_to_schemas - updated_vm = ValidationMetadata( - configuration=validation_metadata.configuration, - from_server=validation_metadata.from_server, - path_to_item=validation_metadata.path_to_item, - seen_classes=validation_metadata.seen_classes | frozenset({cls}), - validated_path_to_schemas=validation_metadata.validated_path_to_schemas - ) - other_path_to_schemas = cls.__validate_items(arg, validation_metadata=updated_vm) - update(_path_to_schemas, other_path_to_schemas) - return _path_to_schemas - - @classmethod - def _get_items_oapg( - cls: 'Schema', - arg: typing.List[typing.Any], - path_to_item: typing.Tuple[typing.Union[str, int], ...], - path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Type['Schema']] - ): - ''' - ListBase _get_items_oapg - ''' - cast_items = [] - - for i, value in enumerate(arg): - item_path_to_item = path_to_item + (i,) - item_cls = path_to_schemas[item_path_to_item] - new_value = item_cls._get_new_instance_without_conversion_oapg( - value, - item_path_to_item, - path_to_schemas - ) - cast_items.append(new_value) - - return cast_items - - -class Discriminable: - MetaOapg: MetaOapgTyped - - @classmethod - def _ensure_discriminator_value_present_oapg(cls, disc_property_name: str, validation_metadata: ValidationMetadata, *args): - if not args or args and disc_property_name not in args[0]: - # The input data does not contain the discriminator property - raise ApiValueError( - "Cannot deserialize input data due to missing discriminator. " - "The discriminator property '{}' is missing at path: {}".format(disc_property_name, validation_metadata.path_to_item) - ) - - @classmethod - def get_discriminated_class_oapg(cls, disc_property_name: str, disc_payload_value: str): - """ - Used in schemas with discriminators - """ - if not hasattr(cls.MetaOapg, 'discriminator'): - return None - disc = cls.MetaOapg.discriminator() - if disc_property_name not in disc: - return None - discriminated_cls = disc[disc_property_name].get(disc_payload_value) - if discriminated_cls is not None: - return discriminated_cls - if not hasattr(cls, 'MetaOapg'): - return None - elif not ( - hasattr(cls.MetaOapg, 'all_of') or - hasattr(cls.MetaOapg, 'one_of') or - hasattr(cls.MetaOapg, 'any_of') - ): - return None - # TODO stop traveling if a cycle is hit - if hasattr(cls.MetaOapg, 'all_of'): - for allof_cls in cls.MetaOapg.all_of(): - discriminated_cls = allof_cls.get_discriminated_class_oapg( - disc_property_name=disc_property_name, disc_payload_value=disc_payload_value) - if discriminated_cls is not None: - return discriminated_cls - if hasattr(cls.MetaOapg, 'one_of'): - for oneof_cls in cls.MetaOapg.one_of(): - discriminated_cls = oneof_cls.get_discriminated_class_oapg( - disc_property_name=disc_property_name, disc_payload_value=disc_payload_value) - if discriminated_cls is not None: - return discriminated_cls - if hasattr(cls.MetaOapg, 'any_of'): - for anyof_cls in cls.MetaOapg.any_of(): - discriminated_cls = anyof_cls.get_discriminated_class_oapg( - disc_property_name=disc_property_name, disc_payload_value=disc_payload_value) - if discriminated_cls is not None: - return discriminated_cls - return None - - -class DictBase(Discriminable, ValidatorBase): - - @classmethod - def __validate_arg_presence(cls, arg): - """ - Ensures that: - - all required arguments are passed in - - the input variable names are valid - - present in properties or - - accepted because additionalProperties exists - Exceptions will be raised if: - - invalid arguments were passed in - - a var_name is invalid if additional_properties == NotAnyTypeSchema - and var_name not in properties.__annotations__ - - required properties were not passed in - - Args: - arg: the input dict - - Raises: - ApiTypeError - for missing required arguments, or for invalid properties - """ - seen_required_properties = set() - invalid_arguments = [] - required_property_names = getattr(cls.MetaOapg, 'required', set()) - additional_properties = getattr(cls.MetaOapg, 'additional_properties', UnsetAnyTypeSchema) - properties = getattr(cls.MetaOapg, 'properties', {}) - property_annotations = getattr(properties, '__annotations__', {}) - for property_name in arg: - if property_name in required_property_names: - seen_required_properties.add(property_name) - elif property_name in property_annotations: - continue - elif additional_properties is not NotAnyTypeSchema: - continue - else: - invalid_arguments.append(property_name) - missing_required_arguments = list(required_property_names - seen_required_properties) - if missing_required_arguments: - missing_required_arguments.sort() - raise ApiTypeError( - "{} is missing {} required argument{}: {}".format( - cls.__name__, - len(missing_required_arguments), - "s" if len(missing_required_arguments) > 1 else "", - missing_required_arguments - ) - ) - if invalid_arguments: - invalid_arguments.sort() - raise ApiTypeError( - "{} was passed {} invalid argument{}: {}".format( - cls.__name__, - len(invalid_arguments), - "s" if len(invalid_arguments) > 1 else "", - invalid_arguments - ) - ) - - @classmethod - def __validate_args(cls, arg, validation_metadata: ValidationMetadata): - """ - Ensures that: - - values passed in for properties are valid - Exceptions will be raised if: - - invalid arguments were passed in - - Args: - arg: the input dict - - Raises: - ApiTypeError - for missing required arguments, or for invalid properties - """ - path_to_schemas = {} - additional_properties = getattr(cls.MetaOapg, 'additional_properties', UnsetAnyTypeSchema) - properties = getattr(cls.MetaOapg, 'properties', {}) - property_annotations = getattr(properties, '__annotations__', {}) - for property_name, value in arg.items(): - path_to_item = validation_metadata.path_to_item+(property_name,) - if property_name in property_annotations: - schema = property_annotations[property_name] - elif additional_properties is not NotAnyTypeSchema: - if additional_properties is UnsetAnyTypeSchema: - """ - If additionalProperties is unset and this path_to_item does not yet have - any validations on it, validate it. - If it already has validations on it, skip this validation. - """ - if path_to_item in path_to_schemas: - continue - schema = additional_properties - else: - raise ApiTypeError('Unable to find schema for value={} in class={} at path_to_item={}'.format( - value, cls, validation_metadata.path_to_item+(property_name,) - )) - schema = cls._get_class_oapg(schema) - arg_validation_metadata = ValidationMetadata( - from_server=validation_metadata.from_server, - configuration=validation_metadata.configuration, - path_to_item=path_to_item, - validated_path_to_schemas=validation_metadata.validated_path_to_schemas - ) - if arg_validation_metadata.validation_ran_earlier(schema): - add_deeper_validated_schemas(arg_validation_metadata, path_to_schemas) - continue - other_path_to_schemas = schema._validate_oapg(value, validation_metadata=arg_validation_metadata) - update(path_to_schemas, other_path_to_schemas) - return path_to_schemas - - @classmethod - def __check_dict_validations( - cls, - arg, - validation_metadata: ValidationMetadata - ): - if not hasattr(cls, 'MetaOapg'): - return - if (cls._is_json_validation_enabled_oapg('maxProperties', validation_metadata.configuration) and - hasattr(cls.MetaOapg, 'max_properties') and - len(arg) > cls.MetaOapg.max_properties): - cls._raise_validation_error_message_oapg( - value=arg, - constraint_msg="number of properties must be less than or equal to", - constraint_value=cls.MetaOapg.max_properties, - path_to_item=validation_metadata.path_to_item - ) - - if (cls._is_json_validation_enabled_oapg('minProperties', validation_metadata.configuration) and - hasattr(cls.MetaOapg, 'min_properties') and - len(arg) < cls.MetaOapg.min_properties): - cls._raise_validation_error_message_oapg( - value=arg, - constraint_msg="number of properties must be greater than or equal to", - constraint_value=cls.MetaOapg.min_properties, - path_to_item=validation_metadata.path_to_item - ) - - @classmethod - def _validate_oapg( - cls, - arg, - validation_metadata: ValidationMetadata, - ): - """ - DictBase _validate_oapg - We return dynamic classes of different bases depending upon the inputs - This makes it so: - - the returned instance is always a subclass of our defining schema - - this allows us to check type based on whether an instance is a subclass of a schema - - the returned instance is a serializable type (except for None, True, and False) which are enums - - Returns: - new_cls (type): the new class - - Raises: - ApiValueError: when a string can't be converted into a date or datetime and it must be one of those classes - ApiTypeError: when the input type is not in the list of allowed spec types - """ - if isinstance(arg, frozendict.frozendict): - cls.__check_dict_validations(arg, validation_metadata) - _path_to_schemas = super()._validate_oapg(arg, validation_metadata=validation_metadata) - if not isinstance(arg, frozendict.frozendict): - return _path_to_schemas - cls.__validate_arg_presence(arg) - other_path_to_schemas = cls.__validate_args(arg, validation_metadata=validation_metadata) - update(_path_to_schemas, other_path_to_schemas) - try: - discriminator = cls.MetaOapg.discriminator() - except AttributeError: - return _path_to_schemas - # discriminator exists - disc_prop_name = list(discriminator.keys())[0] - cls._ensure_discriminator_value_present_oapg(disc_prop_name, validation_metadata, arg) - discriminated_cls = cls.get_discriminated_class_oapg( - disc_property_name=disc_prop_name, disc_payload_value=arg[disc_prop_name]) - if discriminated_cls is None: - raise ApiValueError( - "Invalid discriminator value was passed in to {}.{} Only the values {} are allowed at {}".format( - cls.__name__, - disc_prop_name, - list(discriminator[disc_prop_name].keys()), - validation_metadata.path_to_item + (disc_prop_name,) - ) - ) - updated_vm = ValidationMetadata( - configuration=validation_metadata.configuration, - from_server=validation_metadata.from_server, - path_to_item=validation_metadata.path_to_item, - seen_classes=validation_metadata.seen_classes | frozenset({cls}), - validated_path_to_schemas=validation_metadata.validated_path_to_schemas - ) - if updated_vm.validation_ran_earlier(discriminated_cls): - add_deeper_validated_schemas(updated_vm, _path_to_schemas) - return _path_to_schemas - other_path_to_schemas = discriminated_cls._validate_oapg(arg, validation_metadata=updated_vm) - update(_path_to_schemas, other_path_to_schemas) - return _path_to_schemas - - @classmethod - def _get_properties_oapg( - cls, - arg: typing.Dict[str, typing.Any], - path_to_item: typing.Tuple[typing.Union[str, int], ...], - path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Type['Schema']] - ): - """ - DictBase _get_properties_oapg, this is how properties are set - These values already passed validation - """ - dict_items = {} - - for property_name_js, value in arg.items(): - property_path_to_item = path_to_item + (property_name_js,) - property_cls = path_to_schemas[property_path_to_item] - new_value = property_cls._get_new_instance_without_conversion_oapg( - value, - property_path_to_item, - path_to_schemas - ) - dict_items[property_name_js] = new_value - - return dict_items - - def __setattr__(self, name: str, value: typing.Any): - if not isinstance(self, FileIO): - raise AttributeError('property setting not supported on immutable instances') - - def __getattr__(self, name: str): - """ - for instance.name access - Properties are only type hinted for required properties - so that hasattr(instance, 'optionalProp') is False when that key is not present - """ - if not isinstance(self, frozendict.frozendict): - return super().__getattr__(name) - if name not in self.__class__.__annotations__: - raise AttributeError(f"{self} has no attribute '{name}'") - try: - value = self[name] - return value - except KeyError as ex: - raise AttributeError(str(ex)) - - def __getitem__(self, name: str): - """ - dict_instance[name] accessor - key errors thrown - """ - if not isinstance(self, frozendict.frozendict): - return super().__getattr__(name) - return super().__getitem__(name) - - def get_item_oapg(self, name: str) -> typing.Union['AnyTypeSchema', Unset]: - # dict_instance[name] accessor - if not isinstance(self, frozendict.frozendict): - raise NotImplementedError() - try: - return super().__getitem__(name) - except KeyError: - return unset - - -def cast_to_allowed_types( - arg: typing.Union[str, date, datetime, uuid.UUID, decimal.Decimal, int, float, None, dict, frozendict.frozendict, list, tuple, bytes, Schema, io.FileIO, io.BufferedReader], - from_server: bool, - validated_path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]], - path_to_item: typing.Tuple[typing.Union[str, int], ...] = tuple(['args[0]']), -) -> typing.Union[frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO]: - """ - Casts the input payload arg into the allowed types - The input validated_path_to_schemas is mutated by running this function - - When from_server is False then - - date/datetime is cast to str - - int/float is cast to Decimal - - If a Schema instance is passed in it is converted back to a primitive instance because - One may need to validate that data to the original Schema class AND additional different classes - those additional classes will need to be added to the new manufactured class for that payload - If the code didn't do this and kept the payload as a Schema instance it would fail to validate to other - Schema classes and the code wouldn't be able to mfg a new class that includes all valid schemas - TODO: store the validated schema classes in validation_metadata - - Args: - arg: the payload - from_server: whether this payload came from the server or not - validated_path_to_schemas: a dict that stores the validated classes at any path location in the payload - """ - if isinstance(arg, Schema): - # store the already run validations - schema_classes = set() - for cls in arg.__class__.__bases__: - if cls is Singleton: - # Skip Singleton - continue - schema_classes.add(cls) - validated_path_to_schemas[path_to_item] = schema_classes - - type_error = ApiTypeError(f"Invalid type. Required value type is str and passed type was {type(arg)} at {path_to_item}") - if isinstance(arg, str): - return str(arg) - elif isinstance(arg, (dict, frozendict.frozendict)): - return frozendict.frozendict({key: cast_to_allowed_types(val, from_server, validated_path_to_schemas, path_to_item + (key,)) for key, val in arg.items()}) - elif isinstance(arg, (bool, BoolClass)): - """ - this check must come before isinstance(arg, (int, float)) - because isinstance(True, int) is True - """ - if arg: - return BoolClass.TRUE - return BoolClass.FALSE - elif isinstance(arg, int): - return decimal.Decimal(arg) - elif isinstance(arg, float): - decimal_from_float = decimal.Decimal(arg) - if decimal_from_float.as_integer_ratio()[1] == 1: - # 9.0 -> Decimal('9.0') - # 3.4028234663852886e+38 -> Decimal('340282346638528859811704183484516925440.0') - return decimal.Decimal(str(decimal_from_float)+'.0') - return decimal_from_float - elif isinstance(arg, (tuple, list)): - return tuple([cast_to_allowed_types(item, from_server, validated_path_to_schemas, path_to_item + (i,)) for i, item in enumerate(arg)]) - elif isinstance(arg, (none_type, NoneClass)): - return NoneClass.NONE - elif isinstance(arg, (date, datetime)): - if not from_server: - return arg.isoformat() - raise type_error - elif isinstance(arg, uuid.UUID): - if not from_server: - return str(arg) - raise type_error - elif isinstance(arg, decimal.Decimal): - return decimal.Decimal(arg) - elif isinstance(arg, bytes): - return bytes(arg) - elif isinstance(arg, (io.FileIO, io.BufferedReader)): - return FileIO(arg) - raise ValueError('Invalid type passed in got input={} type={}'.format(arg, type(arg))) - - -class ComposedBase(Discriminable): - - @classmethod - def __get_allof_classes(cls, arg, validation_metadata: ValidationMetadata): - path_to_schemas = defaultdict(set) - for allof_cls in cls.MetaOapg.all_of(): - if validation_metadata.validation_ran_earlier(allof_cls): - add_deeper_validated_schemas(validation_metadata, path_to_schemas) - continue - other_path_to_schemas = allof_cls._validate_oapg(arg, validation_metadata=validation_metadata) - update(path_to_schemas, other_path_to_schemas) - return path_to_schemas - - @classmethod - def __get_oneof_class( - cls, - arg, - discriminated_cls, - validation_metadata: ValidationMetadata, - ): - oneof_classes = [] - path_to_schemas = defaultdict(set) - for oneof_cls in cls.MetaOapg.one_of(): - if oneof_cls in path_to_schemas[validation_metadata.path_to_item]: - oneof_classes.append(oneof_cls) - continue - if validation_metadata.validation_ran_earlier(oneof_cls): - oneof_classes.append(oneof_cls) - add_deeper_validated_schemas(validation_metadata, path_to_schemas) - continue - try: - path_to_schemas = oneof_cls._validate_oapg(arg, validation_metadata=validation_metadata) - except (ApiValueError, ApiTypeError) as ex: - if discriminated_cls is not None and oneof_cls is discriminated_cls: - {{#if nonCompliantUseDiscriminatorIfCompositionFails}} - """ - suppress exception because code was generated with - nonCompliantUseDiscriminatorIfCompositionFails=true - """ - pass - {{else}} - raise ex - {{/if}} - continue - oneof_classes.append(oneof_cls) - if not oneof_classes: - {{#if nonCompliantUseDiscriminatorIfCompositionFails}} - if discriminated_cls: - """ - return without exception because code was generated with - nonCompliantUseDiscriminatorIfCompositionFails=true - """ - return {} - {{/if}} - raise ApiValueError( - "Invalid inputs given to generate an instance of {}. None " - "of the oneOf schemas matched the input data.".format(cls) - ) - elif len(oneof_classes) > 1: - {{#if nonCompliantUseDiscriminatorIfCompositionFails}} - if discriminated_cls: - """ - return without exception because code was generated with - nonCompliantUseDiscriminatorIfCompositionFails=true - """ - return {} - {{/if}} - raise ApiValueError( - "Invalid inputs given to generate an instance of {}. Multiple " - "oneOf schemas {} matched the inputs, but a max of one is allowed.".format(cls, oneof_classes) - ) - # exactly one class matches - return path_to_schemas - - @classmethod - def __get_anyof_classes( - cls, - arg, - discriminated_cls, - validation_metadata: ValidationMetadata - ): - anyof_classes = [] - path_to_schemas = defaultdict(set) - for anyof_cls in cls.MetaOapg.any_of(): - if validation_metadata.validation_ran_earlier(anyof_cls): - anyof_classes.append(anyof_cls) - add_deeper_validated_schemas(validation_metadata, path_to_schemas) - continue - - try: - other_path_to_schemas = anyof_cls._validate_oapg(arg, validation_metadata=validation_metadata) - except (ApiValueError, ApiTypeError) as ex: - if discriminated_cls is not None and anyof_cls is discriminated_cls: - {{#if nonCompliantUseDiscriminatorIfCompositionFails}} - """ - suppress exception because code was generated with - nonCompliantUseDiscriminatorIfCompositionFails=true - """ - pass - {{else}} - raise ex - {{/if}} - continue - anyof_classes.append(anyof_cls) - update(path_to_schemas, other_path_to_schemas) - if not anyof_classes: - {{#if nonCompliantUseDiscriminatorIfCompositionFails}} - if discriminated_cls: - """ - return without exception because code was generated with - nonCompliantUseDiscriminatorIfCompositionFails=true - """ - return {} - {{/if}} - raise ApiValueError( - "Invalid inputs given to generate an instance of {}. None " - "of the anyOf schemas matched the input data.".format(cls) - ) - return path_to_schemas - - @classmethod - def _validate_oapg( - cls, - arg, - validation_metadata: ValidationMetadata, - ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]]: - """ - ComposedBase _validate_oapg - We return dynamic classes of different bases depending upon the inputs - This makes it so: - - the returned instance is always a subclass of our defining schema - - this allows us to check type based on whether an instance is a subclass of a schema - - the returned instance is a serializable type (except for None, True, and False) which are enums - - Returns: - new_cls (type): the new class - - Raises: - ApiValueError: when a string can't be converted into a date or datetime and it must be one of those classes - ApiTypeError: when the input type is not in the list of allowed spec types - """ - # validation checking on types, validations, and enums - path_to_schemas = super()._validate_oapg(arg, validation_metadata=validation_metadata) - - updated_vm = ValidationMetadata( - configuration=validation_metadata.configuration, - from_server=validation_metadata.from_server, - path_to_item=validation_metadata.path_to_item, - seen_classes=validation_metadata.seen_classes | frozenset({cls}), - validated_path_to_schemas=validation_metadata.validated_path_to_schemas - ) - - # process composed schema - discriminator = None - if hasattr(cls, 'MetaOapg') and hasattr(cls.MetaOapg, 'discriminator'): - discriminator = cls.MetaOapg.discriminator() - discriminated_cls = None - if discriminator and arg and isinstance(arg, frozendict.frozendict): - disc_property_name = list(discriminator.keys())[0] - cls._ensure_discriminator_value_present_oapg(disc_property_name, updated_vm, arg) - # get discriminated_cls by looking at the dict in the current class - discriminated_cls = cls.get_discriminated_class_oapg( - disc_property_name=disc_property_name, disc_payload_value=arg[disc_property_name]) - if discriminated_cls is None: - raise ApiValueError( - "Invalid discriminator value '{}' was passed in to {}.{} Only the values {} are allowed at {}".format( - arg[disc_property_name], - cls.__name__, - disc_property_name, - list(discriminator[disc_property_name].keys()), - updated_vm.path_to_item + (disc_property_name,) - ) - ) - - if hasattr(cls, 'MetaOapg') and hasattr(cls.MetaOapg, 'all_of'): - other_path_to_schemas = cls.__get_allof_classes(arg, validation_metadata=updated_vm) - update(path_to_schemas, other_path_to_schemas) - if hasattr(cls, 'MetaOapg') and hasattr(cls.MetaOapg, 'one_of'): - other_path_to_schemas = cls.__get_oneof_class( - arg, - discriminated_cls=discriminated_cls, - validation_metadata=updated_vm - ) - update(path_to_schemas, other_path_to_schemas) - if hasattr(cls, 'MetaOapg') and hasattr(cls.MetaOapg, 'any_of'): - other_path_to_schemas = cls.__get_anyof_classes( - arg, - discriminated_cls=discriminated_cls, - validation_metadata=updated_vm - ) - update(path_to_schemas, other_path_to_schemas) - not_cls = None - if hasattr(cls, 'MetaOapg') and hasattr(cls.MetaOapg, 'not_schema'): - not_cls = cls.MetaOapg.not_schema - not_cls = cls._get_class_oapg(not_cls) - if not_cls: - other_path_to_schemas = None - not_exception = ApiValueError( - "Invalid value '{}' was passed in to {}. Value is invalid because it is disallowed by {}".format( - arg, - cls.__name__, - not_cls.__name__, - ) - ) - if updated_vm.validation_ran_earlier(not_cls): - raise not_exception - - try: - other_path_to_schemas = not_cls._validate_oapg(arg, validation_metadata=updated_vm) - except (ApiValueError, ApiTypeError): - pass - if other_path_to_schemas: - raise not_exception - - if discriminated_cls is not None and not updated_vm.validation_ran_earlier(discriminated_cls): - # TODO use an exception from this package here - add_deeper_validated_schemas(updated_vm, path_to_schemas) - assert discriminated_cls in path_to_schemas[updated_vm.path_to_item] - return path_to_schemas - - -# DictBase, ListBase, NumberBase, StrBase, BoolBase, NoneBase -class ComposedSchema( - ComposedBase, - DictBase, - ListBase, - NumberBase, - StrBase, - BoolBase, - NoneBase, - Schema, - NoneFrozenDictTupleStrDecimalBoolMixin -): - @classmethod - def from_openapi_data_oapg(cls, *args: typing.Any, _configuration: typing.Optional[Configuration] = None, **kwargs): - if not args: - if not kwargs: - raise ApiTypeError('{} is missing required input data in args or kwargs'.format(cls.__name__)) - args = (kwargs, ) - return super().from_openapi_data_oapg(args[0], _configuration=_configuration) - - -class ListSchema( - ListBase, - Schema, - TupleMixin -): - - @classmethod - def from_openapi_data_oapg(cls, arg: typing.List[typing.Any], _configuration: typing.Optional[Configuration] = None): - return super().from_openapi_data_oapg(arg, _configuration=_configuration) - - def __new__(cls, _arg: typing.Union[typing.List[typing.Any], typing.Tuple[typing.Any]], **kwargs: Configuration): - return super().__new__(cls, _arg, **kwargs) - - -class NoneSchema( - NoneBase, - Schema, - NoneMixin -): - - @classmethod - def from_openapi_data_oapg(cls, arg: None, _configuration: typing.Optional[Configuration] = None): - return super().from_openapi_data_oapg(arg, _configuration=_configuration) - - def __new__(cls, _arg: None, **kwargs: Configuration): - return super().__new__(cls, _arg, **kwargs) - - -class NumberSchema( - NumberBase, - Schema, - DecimalMixin -): - """ - This is used for type: number with no format - Both integers AND floats are accepted - """ - - @classmethod - def from_openapi_data_oapg(cls, arg: typing.Union[int, float], _configuration: typing.Optional[Configuration] = None): - return super().from_openapi_data_oapg(arg, _configuration=_configuration) - - def __new__(cls, _arg: typing.Union[decimal.Decimal, int, float], **kwargs: Configuration): - return super().__new__(cls, _arg, **kwargs) - - -class IntBase: - @property - def as_int_oapg(self) -> int: - try: - return self._as_int - except AttributeError: - self._as_int = int(self) - return self._as_int - - @classmethod - def __validate_format(cls, arg: typing.Optional[decimal.Decimal], validation_metadata: ValidationMetadata): - if isinstance(arg, decimal.Decimal): - - denominator = arg.as_integer_ratio()[-1] - if denominator != 1: - raise ApiValueError( - "Invalid value '{}' for type integer at {}".format(arg, validation_metadata.path_to_item) - ) - - @classmethod - def _validate_oapg( - cls, - arg, - validation_metadata: ValidationMetadata, - ): - """ - IntBase _validate_oapg - TODO what about types = (int, number) -> IntBase, NumberBase? We could drop int and keep number only - """ - cls.__validate_format(arg, validation_metadata=validation_metadata) - return super()._validate_oapg(arg, validation_metadata=validation_metadata) - - -class IntSchema(IntBase, NumberSchema): - - @classmethod - def from_openapi_data_oapg(cls, arg: int, _configuration: typing.Optional[Configuration] = None): - return super().from_openapi_data_oapg(arg, _configuration=_configuration) - - def __new__(cls, _arg: typing.Union[decimal.Decimal, int], **kwargs: Configuration): - return super().__new__(cls, _arg, **kwargs) - - -class Int32Base: - __inclusive_minimum = decimal.Decimal(-2147483648) - __inclusive_maximum = decimal.Decimal(2147483647) - - @classmethod - def __validate_format(cls, arg: typing.Optional[decimal.Decimal], validation_metadata: ValidationMetadata): - if isinstance(arg, decimal.Decimal) and arg.as_tuple().exponent == 0: - if not cls.__inclusive_minimum <= arg <= cls.__inclusive_maximum: - raise ApiValueError( - "Invalid value '{}' for type int32 at {}".format(arg, validation_metadata.path_to_item) - ) - - @classmethod - def _validate_oapg( - cls, - arg, - validation_metadata: ValidationMetadata, - ): - """ - Int32Base _validate_oapg - """ - cls.__validate_format(arg, validation_metadata=validation_metadata) - return super()._validate_oapg(arg, validation_metadata=validation_metadata) - - -class Int32Schema( - Int32Base, - IntSchema -): - pass - - -class Int64Base: - __inclusive_minimum = decimal.Decimal(-9223372036854775808) - __inclusive_maximum = decimal.Decimal(9223372036854775807) - - @classmethod - def __validate_format(cls, arg: typing.Optional[decimal.Decimal], validation_metadata: ValidationMetadata): - if isinstance(arg, decimal.Decimal) and arg.as_tuple().exponent == 0: - if not cls.__inclusive_minimum <= arg <= cls.__inclusive_maximum: - raise ApiValueError( - "Invalid value '{}' for type int64 at {}".format(arg, validation_metadata.path_to_item) - ) - - @classmethod - def _validate_oapg( - cls, - arg, - validation_metadata: ValidationMetadata, - ): - """ - Int64Base _validate_oapg - """ - cls.__validate_format(arg, validation_metadata=validation_metadata) - return super()._validate_oapg(arg, validation_metadata=validation_metadata) - - -class Int64Schema( - Int64Base, - IntSchema -): - pass - - -class Float32Base: - __inclusive_minimum = decimal.Decimal(-3.4028234663852886e+38) - __inclusive_maximum = decimal.Decimal(3.4028234663852886e+38) - - @classmethod - def __validate_format(cls, arg: typing.Optional[decimal.Decimal], validation_metadata: ValidationMetadata): - if isinstance(arg, decimal.Decimal): - if not cls.__inclusive_minimum <= arg <= cls.__inclusive_maximum: - raise ApiValueError( - "Invalid value '{}' for type float at {}".format(arg, validation_metadata.path_to_item) - ) - - @classmethod - def _validate_oapg( - cls, - arg, - validation_metadata: ValidationMetadata, - ): - """ - Float32Base _validate_oapg - """ - cls.__validate_format(arg, validation_metadata=validation_metadata) - return super()._validate_oapg(arg, validation_metadata=validation_metadata) - - -class Float32Schema( - Float32Base, - NumberSchema -): - - @classmethod - def from_openapi_data_oapg(cls, arg: float, _configuration: typing.Optional[Configuration] = None): - return super().from_openapi_data_oapg(arg, _configuration=_configuration) - - -class Float64Base: - __inclusive_minimum = decimal.Decimal(-1.7976931348623157E+308) - __inclusive_maximum = decimal.Decimal(1.7976931348623157E+308) - - @classmethod - def __validate_format(cls, arg: typing.Optional[decimal.Decimal], validation_metadata: ValidationMetadata): - if isinstance(arg, decimal.Decimal): - if not cls.__inclusive_minimum <= arg <= cls.__inclusive_maximum: - raise ApiValueError( - "Invalid value '{}' for type double at {}".format(arg, validation_metadata.path_to_item) - ) - - @classmethod - def _validate_oapg( - cls, - arg, - validation_metadata: ValidationMetadata, - ): - """ - Float64Base _validate_oapg - """ - cls.__validate_format(arg, validation_metadata=validation_metadata) - return super()._validate_oapg(arg, validation_metadata=validation_metadata) - -class Float64Schema( - Float64Base, - NumberSchema -): - - @classmethod - def from_openapi_data_oapg(cls, arg: float, _configuration: typing.Optional[Configuration] = None): - # todo check format - return super().from_openapi_data_oapg(arg, _configuration=_configuration) - - -class StrSchema( - StrBase, - Schema, - StrMixin -): - """ - date + datetime string types must inherit from this class - That is because one can validate a str payload as both: - - type: string (format unset) - - type: string, format: date - """ - - @classmethod - def from_openapi_data_oapg(cls, arg: str, _configuration: typing.Optional[Configuration] = None) -> 'StrSchema': - return super().from_openapi_data_oapg(arg, _configuration=_configuration) - - def __new__(cls, _arg: typing.Union[str, date, datetime, uuid.UUID], **kwargs: Configuration): - return super().__new__(cls, _arg, **kwargs) - - -class UUIDSchema(UUIDBase, StrSchema): - - def __new__(cls, _arg: typing.Union[str, uuid.UUID], **kwargs: Configuration): - return super().__new__(cls, _arg, **kwargs) - - -class DateSchema(DateBase, StrSchema): - - def __new__(cls, _arg: typing.Union[str, date], **kwargs: Configuration): - return super().__new__(cls, _arg, **kwargs) - - -class DateTimeSchema(DateTimeBase, StrSchema): - - def __new__(cls, _arg: typing.Union[str, datetime], **kwargs: Configuration): - return super().__new__(cls, _arg, **kwargs) - - -class DecimalSchema(DecimalBase, StrSchema): - - def __new__(cls, _arg: str, **kwargs: Configuration): - """ - Note: Decimals may not be passed in because cast_to_allowed_types is only invoked once for payloads - which can be simple (str) or complex (dicts or lists with nested values) - Because casting is only done once and recursively casts all values prior to validation then for a potential - client side Decimal input if Decimal was accepted as an input in DecimalSchema then one would not know - if one was using it for a StrSchema (where it should be cast to str) or one is using it for NumberSchema - where it should stay as Decimal. - """ - return super().__new__(cls, _arg, **kwargs) - - -class BytesSchema( - Schema, - BytesMixin -): - """ - this class will subclass bytes and is immutable - """ - def __new__(cls, _arg: bytes, **kwargs: Configuration): - return super(Schema, cls).__new__(cls, _arg) - - -class FileSchema( - Schema, - FileMixin -): - """ - This class is NOT immutable - Dynamic classes are built using it for example when AnyType allows in binary data - Al other schema classes ARE immutable - If one wanted to make this immutable one could make this a DictSchema with required properties: - - data = BytesSchema (which would be an immutable bytes based schema) - - file_name = StrSchema - and cast_to_allowed_types would convert bytes and file instances into dicts containing data + file_name - The downside would be that data would be stored in memory which one may not want to do for very large files - - The developer is responsible for closing this file and deleting it - - This class was kept as mutable: - - to allow file reading and writing to disk - - to be able to preserve file name info - """ - - def __new__(cls, _arg: typing.Union[io.FileIO, io.BufferedReader], **kwargs: Configuration): - return super(Schema, cls).__new__(cls, _arg) - - -class BinaryBase: - pass - - -class BinarySchema( - ComposedBase, - BinaryBase, - Schema, - BinaryMixin -): - class MetaOapg: - @staticmethod - def one_of(): - return [ - BytesSchema, - FileSchema, - ] - - def __new__(cls, _arg: typing.Union[io.FileIO, io.BufferedReader, bytes], **kwargs: Configuration): - return super().__new__(cls, _arg) - - -class BoolSchema( - BoolBase, - Schema, - BoolMixin -): - - @classmethod - def from_openapi_data_oapg(cls, arg: bool, _configuration: typing.Optional[Configuration] = None): - return super().from_openapi_data_oapg(arg, _configuration=_configuration) - - def __new__(cls, _arg: bool, **kwargs: ValidationMetadata): - return super().__new__(cls, _arg, **kwargs) - - -class AnyTypeSchema( - DictBase, - ListBase, - NumberBase, - StrBase, - BoolBase, - NoneBase, - Schema, - NoneFrozenDictTupleStrDecimalBoolFileBytesMixin -): - # Python representation of a schema defined as true or {} - pass - - -class UnsetAnyTypeSchema(AnyTypeSchema): - # Used when additionalProperties/items was not explicitly defined and a defining schema is needed - pass - - -class NotAnyTypeSchema( - ComposedSchema, -): - """ - Python representation of a schema defined as false or {'not': {}} - Does not allow inputs in of AnyType - Note: validations on this class are never run because the code knows that no inputs will ever validate - """ - - class MetaOapg: - not_schema = AnyTypeSchema - - def __new__( - cls, - *_args, - _configuration: typing.Optional[Configuration] = None, - ) -> 'NotAnyTypeSchema': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - ) - - -class DictSchema( - DictBase, - Schema, - FrozenDictMixin -): - @classmethod - def from_openapi_data_oapg(cls, arg: typing.Dict[str, typing.Any], _configuration: typing.Optional[Configuration] = None): - return super().from_openapi_data_oapg(arg, _configuration=_configuration) - - def __new__(cls, *_args: typing.Union[dict, frozendict.frozendict], **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, bytes, Schema, Unset, ValidationMetadata]): - return super().__new__(cls, *_args, **kwargs) - - -schema_type_classes = {NoneSchema, DictSchema, ListSchema, NumberSchema, StrSchema, BoolSchema, AnyTypeSchema} - - -@functools.lru_cache() -def get_new_class( - class_name: str, - bases: typing.Tuple[typing.Type[typing.Union[Schema, typing.Any]], ...] -) -> typing.Type[Schema]: - """ - Returns a new class that is made with the subclass bases - """ - new_cls: typing.Type[Schema] = type(class_name, bases, {}) - return new_cls - - -LOG_CACHE_USAGE = False - - -def log_cache_usage(cache_fn): - if LOG_CACHE_USAGE: - print(cache_fn.__name__, cache_fn.cache_info()) diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/schemas.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/schemas.hbs new file mode 100644 index 00000000000..dd540bbf119 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/schemas.hbs @@ -0,0 +1,2488 @@ +# coding: utf-8 + +{{> _helper_header }} + +import collections +import datetime +import functools +import decimal +import io +import re +import types +import typing +import uuid + +from dateutil import parser +from dateutil.parser.isoparser import _takes_ascii +import frozendict + +from {{packageName}} import exceptions +from {{packageName}}.configurations import schema_configuration + + +class Unset(object): + """ + An instance of this class is set as the default value for object type(dict) properties that are optional + When a property has an unset value, that property will not be assigned in the dict + """ + pass + +unset = Unset() + +none_type_ = type(None) + + +class FileIO(io.FileIO): + """ + A class for storing files + Note: this class is not immutable + """ + + def __new__(cls, arg_: typing.Union[io.FileIO, io.BufferedReader]): + if isinstance(arg_, (io.FileIO, io.BufferedReader)): + if arg_.closed: + raise exceptions.ApiValueError('Invalid file state; file is closed and must be open') + arg_.close() + inst = super(FileIO, cls).__new__(cls, arg_.name) + super(FileIO, inst).__init__(arg_.name) + return inst + raise exceptions.ApiValueError('FileIO must be passed arg_ which contains the open file') + + def __init__(self, arg_: typing.Union[io.FileIO, io.BufferedReader]): + pass + + +def update(d: dict, u: dict): + """ + Adds u to d + Where each dict is collections.defaultdict(set) + """ + if not u: + return d + for k, v in u.items(): + if k not in d: + d[k] = v + else: + d[k] = d[k] | v + + +class ValidationMetadata(frozendict.frozendict): + """ + A class storing metadata that is needed to validate OpenApi Schema payloads + """ + def __new__( + cls, + path_to_item: typing.Tuple[typing.Union[str, int], ...], + configuration: schema_configuration.SchemaConfiguration, + seen_classes: typing.FrozenSet[typing.Type] = frozenset(), + validated_path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Type]] = frozendict.frozendict() + ): + """ + Args: + path_to_item: the path to the current data being instantiated. + For {'a': [1]} if the code is handling, 1, then the path is ('args[0]', 'a', 0) + This changes from location to location + configuration: the schema_configuration.SchemaConfiguration instance to use + This is needed because in schema_configuration.SchemaConfiguration: + - one can disable validation checking + This does not change from location to location + seen_classes: when deserializing data that matches multiple schemas, this is used to store + the schemas that have been traversed. This is used to stop processing when a cycle is seen. + This changes from location to location + validated_path_to_schemas: stores the already validated schema classes for a given path location + This does not change from location to location + """ + return super().__new__( + cls, + path_to_item=path_to_item, + configuration=configuration, + seen_classes=seen_classes, + validated_path_to_schemas=validated_path_to_schemas + ) + + def validation_ran_earlier(self, cls: type) -> bool: + validated_schemas = self.validated_path_to_schemas.get(self.path_to_item, set()) + validation_ran_earlier = validated_schemas and cls in validated_schemas + if validation_ran_earlier: + return True + if cls in self.seen_classes: + return True + return False + + @property + def path_to_item(self) -> typing.Tuple[typing.Union[str, int], ...]: + return self['path_to_item'] + + @property + def configuration(self) -> schema_configuration.SchemaConfiguration: + return self['configuration'] + + @property + def seen_classes(self) -> typing.FrozenSet[typing.Type]: + return self['seen_classes'] + + @property + def validated_path_to_schemas(self) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Type]]: + return self['validated_path_to_schemas'] + + +def add_deeper_validated_schemas(validation_metadata: ValidationMetadata, path_to_schemas: dict): + # this is called if validation_ran_earlier and current and deeper locations need to be added + current_path_to_item = validation_metadata.path_to_item + other_path_to_schemas = {} + for path_to_item, schemas in validation_metadata.validated_path_to_schemas.items(): + if len(path_to_item) < len(current_path_to_item): + continue + path_begins_with_current_path = path_to_item[:len(current_path_to_item)] == current_path_to_item + if path_begins_with_current_path: + other_path_to_schemas[path_to_item] = schemas + update(path_to_schemas, other_path_to_schemas) + + +class Singleton: + """ + Enums and singletons are the same + The same instance is returned for a given key of (cls, arg_) + """ + _instances = {} + + def __new__(cls, arg_: typing.Any, **kwargs): + """ + cls base classes: BoolClass, NoneClass, str, decimal.Decimal + The 3rd key is used in the tuple below for a corner case where an enum contains integer 1 + However 1.0 can also be ingested into that enum schema because 1.0 == 1 and + Decimal('1.0') == Decimal('1') + But if we omitted the 3rd value in the key, then Decimal('1.0') would be stored as Decimal('1') + and json serializing that instance would be '1' rather than the expected '1.0' + Adding the 3rd value, the str of arg_ ensures that 1.0 -> Decimal('1.0') which is serialized as 1.0 + """ + key = (cls, arg_, str(arg_)) + if key not in cls._instances: + if isinstance(arg_, (none_type_, bool, BoolClass, NoneClass)): + inst = super().__new__(cls) + cls._instances[key] = inst + else: + cls._instances[key] = super().__new__(cls, arg_) + return cls._instances[key] + + def __repr__(self): + if isinstance(self, NoneClass): + return f'<{self.__class__.__name__}: None>' + elif isinstance(self, BoolClass): + if bool(self): + return f'<{self.__class__.__name__}: True>' + return f'<{self.__class__.__name__}: False>' + return f'<{self.__class__.__name__}: {super().__repr__()}>' + + +class classproperty: + + def __init__(self, fget): + self.fget = fget + + def __get__(self, owner_self, owner_cls): + return self.fget(owner_cls) + + +class NoneClass(Singleton): + @classproperty + def NONE(cls): + return cls(None) + + def __bool__(self) -> bool: + return False + + +class BoolClass(Singleton): + @classproperty + def TRUE(cls): + return cls(True) + + @classproperty + def FALSE(cls): + return cls(False) + + @functools.lru_cache() + def __bool__(self) -> bool: + for key, instance in self._instances.items(): + if self is instance: + return bool(key[1]) + raise ValueError('Unable to find the boolean value of this instance') + + +class SchemaTyped: + types: typing.Optional[typing.Set[typing.Type]] + exclusive_maximum: typing.Union[int, float] + inclusive_maximum: typing.Union[int, float] + exclusive_minimum: typing.Union[int, float] + inclusive_minimum: typing.Union[int, float] + max_items: int + min_items: int + discriminator: typing.Dict[str, typing.Dict[str, typing.Type['Schema']]] + + + class Properties: + # to hold object properties + pass + + additionalProperties: typing.Optional[typing.Type['Schema']] + max_properties: int + min_properties: int + AllOf: typing.List[typing.Type['Schema']] + OneOf: typing.List[typing.Type['Schema']] + AnyOf: typing.List[typing.Type['Schema']] + _not: typing.Type['Schema'] + max_length: int + min_length: int + items: typing.Type['Schema'] + +PathToSchemasType = typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]] + + +def __get_valid_classes_phrase(input_classes): + """Returns a string phrase describing what types are allowed""" + all_classes = list(input_classes) + all_classes = sorted(all_classes, key=lambda cls: cls.__name__) + all_class_names = [cls.__name__ for cls in all_classes] + if len(all_class_names) == 1: + return "is {0}".format(all_class_names[0]) + return "is one of [{0}]".format(", ".join(all_class_names)) + + +def __type_error_message( + var_value=None, var_name=None, valid_classes=None, key_type=None +): + """ + Keyword Args: + var_value (any): the variable which has the type_error + var_name (str): the name of the variable which has the typ error + valid_classes (tuple): the accepted classes for current_item's + value + key_type (bool): False if our value is a value in a dict + True if it is a key in a dict + False if our item is an item in a tuple + """ + key_or_value = "value" + if key_type: + key_or_value = "key" + valid_classes_phrase = __get_valid_classes_phrase(valid_classes) + msg = "Invalid type. Required {1} type {2} and " "passed type was {3}".format( + var_name, + key_or_value, + valid_classes_phrase, + type(var_value).__name__, + ) + return msg + + +def __get_type_error(var_value, path_to_item, valid_classes, key_type=False): + error_msg = __type_error_message( + var_name=path_to_item[-1], + var_value=var_value, + valid_classes=valid_classes, + key_type=key_type, + ) + return exceptions.ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=valid_classes, + key_type=key_type, + ) + + +def validate_types( + arg: typing.Any, + allowed_types: typing.Set[typing.Type], + cls: typing.Type, + validation_metadata: ValidationMetadata, +{{#if nonCompliantUseDiscriminatorIfCompositionFails}} + **kwargs +{{/if}} +) -> None: + if type(arg) not in allowed_types: + raise __get_type_error( + arg, + validation_metadata.path_to_item, + allowed_types, + key_type=False, + ) + return None + +def validate_enum( + arg: typing.Any, + enum_value_to_name: typing.Dict[typing.Any, str], + cls: typing.Type, + validation_metadata: ValidationMetadata, +{{#if nonCompliantUseDiscriminatorIfCompositionFails}} + **kwargs +{{/if}} +) -> None: + if arg not in enum_value_to_name: + raise exceptions.ApiValueError("Invalid value {} passed in to {}, allowed_values={}".format(arg, cls, enum_value_to_name.keys())) + return None + + +def _raise_validation_error_message(value, constraint_msg, constraint_value, path_to_item, additional_txt=""): + raise exceptions.ApiValueError( + "Invalid value `{value}`, {constraint_msg} `{constraint_value}`{additional_txt} at {path_to_item}".format( + value=value, + constraint_msg=constraint_msg, + constraint_value=constraint_value, + additional_txt=additional_txt, + path_to_item=path_to_item, + ) + ) + + +def validate_unique_items( + arg: typing.Any, + unique_items_value: bool, + cls: typing.Type, + validation_metadata: ValidationMetadata, +{{#if nonCompliantUseDiscriminatorIfCompositionFails}} + **kwargs +{{/if}} +) -> None: + if not unique_items_value or not isinstance(arg, tuple): + return None + if len(arg) > len(set(arg)): + _raise_validation_error_message( + value=arg, + constraint_msg="duplicate items were found, and the tuple must not contain duplicates because", + constraint_value='unique_items==True', + path_to_item=validation_metadata.path_to_item + ) + return None + + +def validate_min_items( + arg: typing.Any, + min_items: int, + cls: typing.Type, + validation_metadata: ValidationMetadata, +{{#if nonCompliantUseDiscriminatorIfCompositionFails}} + **kwargs +{{/if}} +) -> None: + if not isinstance(arg, tuple): + return None + if len(arg) < min_items: + _raise_validation_error_message( + value=arg, + constraint_msg="number of items must be greater than or equal to", + constraint_value=min_items, + path_to_item=validation_metadata.path_to_item + ) + return None + + +def validate_max_items( + arg: typing.Any, + max_items: int, + cls: typing.Type, + validation_metadata: ValidationMetadata, +{{#if nonCompliantUseDiscriminatorIfCompositionFails}} + **kwargs +{{/if}} +) -> None: + if not isinstance(arg, tuple): + return None + if len(arg) > max_items: + _raise_validation_error_message( + value=arg, + constraint_msg="number of items must be less than or equal to", + constraint_value=max_items, + path_to_item=validation_metadata.path_to_item + ) + return None + + +def validate_min_properties( + arg: typing.Any, + min_properties: int, + cls: typing.Type, + validation_metadata: ValidationMetadata, +{{#if nonCompliantUseDiscriminatorIfCompositionFails}} + **kwargs +{{/if}} +) -> None: + if not isinstance(arg, frozendict.frozendict): + return None + if len(arg) < min_properties: + _raise_validation_error_message( + value=arg, + constraint_msg="number of properties must be greater than or equal to", + constraint_value=min_properties, + path_to_item=validation_metadata.path_to_item + ) + return None + + +def validate_max_properties( + arg: typing.Any, + max_properties: int, + cls: typing.Type, + validation_metadata: ValidationMetadata, +{{#if nonCompliantUseDiscriminatorIfCompositionFails}} + **kwargs +{{/if}} +) -> None: + if not isinstance(arg, frozendict.frozendict): + return None + if len(arg) > max_properties: + _raise_validation_error_message( + value=arg, + constraint_msg="number of properties must be less than or equal to", + constraint_value=max_properties, + path_to_item=validation_metadata.path_to_item + ) + return None + + +def validate_min_length( + arg: typing.Any, + min_length: int, + cls: typing.Type, + validation_metadata: ValidationMetadata, +{{#if nonCompliantUseDiscriminatorIfCompositionFails}} + **kwargs +{{/if}} +) -> None: + if not isinstance(arg, str): + return None + if len(arg) < min_length: + _raise_validation_error_message( + value=arg, + constraint_msg="length must be greater than or equal to", + constraint_value=min_length, + path_to_item=validation_metadata.path_to_item + ) + return None + + +def validate_max_length( + arg: typing.Any, + max_length: int, + cls: typing.Type, + validation_metadata: ValidationMetadata, +{{#if nonCompliantUseDiscriminatorIfCompositionFails}} + **kwargs +{{/if}} +) -> None: + if not isinstance(arg, str): + return None + if len(arg) > max_length: + _raise_validation_error_message( + value=arg, + constraint_msg="length must be less than or equal to", + constraint_value=max_length, + path_to_item=validation_metadata.path_to_item + ) + return None + + +def validate_inclusive_minimum( + arg: typing.Any, + inclusive_minimum: typing.Union[int, float], + cls: typing.Type, + validation_metadata: ValidationMetadata, +{{#if nonCompliantUseDiscriminatorIfCompositionFails}} + **kwargs +{{/if}} +) -> None: + if not isinstance(arg, decimal.Decimal): + return None + if arg < inclusive_minimum: + _raise_validation_error_message( + value=arg, + constraint_msg="must be a value greater than or equal to", + constraint_value=inclusive_minimum, + path_to_item=validation_metadata.path_to_item + ) + return None + + +def validate_exclusive_minimum( + arg: typing.Any, + exclusive_minimum: typing.Union[int, float], + cls: typing.Type, + validation_metadata: ValidationMetadata, +{{#if nonCompliantUseDiscriminatorIfCompositionFails}} + **kwargs +{{/if}} +) -> None: + if not isinstance(arg, decimal.Decimal): + return None + if arg <= exclusive_minimum: + _raise_validation_error_message( + value=arg, + constraint_msg="must be a value greater than", + constraint_value=exclusive_minimum, + path_to_item=validation_metadata.path_to_item + ) + return None + + +def validate_inclusive_maximum( + arg: typing.Any, + inclusive_maximum: typing.Union[int, float], + cls: typing.Type, + validation_metadata: ValidationMetadata, +{{#if nonCompliantUseDiscriminatorIfCompositionFails}} + **kwargs +{{/if}} +) -> None: + if not isinstance(arg, decimal.Decimal): + return None + if arg > inclusive_maximum: + _raise_validation_error_message( + value=arg, + constraint_msg="must be a value less than or equal to", + constraint_value=inclusive_maximum, + path_to_item=validation_metadata.path_to_item + ) + return None + + +def validate_exclusive_maximum( + arg: typing.Any, + exclusive_maximum: typing.Union[int, float], + cls: typing.Type, + validation_metadata: ValidationMetadata, +{{#if nonCompliantUseDiscriminatorIfCompositionFails}} + **kwargs +{{/if}} +) -> None: + if not isinstance(arg, decimal.Decimal): + return None + if arg >= exclusive_maximum: + _raise_validation_error_message( + value=arg, + constraint_msg="must be a value less than", + constraint_value=exclusive_maximum, + path_to_item=validation_metadata.path_to_item + ) + return None + +def validate_multiple_of( + arg: typing.Any, + multiple_of: typing.Union[int, float], + cls: typing.Type, + validation_metadata: ValidationMetadata, +{{#if nonCompliantUseDiscriminatorIfCompositionFails}} + **kwargs +{{/if}} +) -> None: + if not isinstance(arg, decimal.Decimal): + return None + if (not (float(arg) / multiple_of).is_integer()): + # Note 'multipleOf' will be as good as the floating point arithmetic. + _raise_validation_error_message( + value=arg, + constraint_msg="value must be a multiple of", + constraint_value=multiple_of, + path_to_item=validation_metadata.path_to_item + ) + return None + + +def validate_regex( + arg: typing.Any, + regex_dict: typing.Dict, + cls: typing.Type, + validation_metadata: ValidationMetadata, +{{#if nonCompliantUseDiscriminatorIfCompositionFails}} + **kwargs +{{/if}} +) -> None: + if not isinstance(arg, str): + return None + flags = regex_dict.get('flags', 0) + if not re.search(regex_dict['pattern'], arg, flags=flags): + if flags != 0: + # Don't print the regex flags if the flags are not + # specified in the OAS document. + _raise_validation_error_message( + value=arg, + constraint_msg="must match regular expression", + constraint_value=regex_dict['pattern'], + path_to_item=validation_metadata.path_to_item, + additional_txt=" with flags=`{}`".format(flags) + ) + _raise_validation_error_message( + value=arg, + constraint_msg="must match regular expression", + constraint_value=regex_dict['pattern'], + path_to_item=validation_metadata.path_to_item + ) + return None + + +__int32_inclusive_minimum = decimal.Decimal(-2147483648) +__int32_inclusive_maximum = decimal.Decimal(2147483647) +__int64_inclusive_minimum = decimal.Decimal(-9223372036854775808) +__int64_inclusive_maximum = decimal.Decimal(9223372036854775807) +__float_inclusive_minimum = decimal.Decimal(-3.4028234663852886e+38) +__float_inclusive_maximum = decimal.Decimal(3.4028234663852886e+38) +__double_inclusive_minimum = decimal.Decimal(-1.7976931348623157E+308) +__double_inclusive_maximum = decimal.Decimal(1.7976931348623157E+308) + +def __validate_numeric_format( + arg: decimal.Decimal, + format: str, + validation_metadata: ValidationMetadata +) -> None: + if format[:3] == 'int': + # there is a json schema test where 1.0 validates as an integer + if arg != int(arg): + raise exceptions.ApiValueError( + "Invalid non-integer value '{}' for type {} at {}".format( + arg, format, validation_metadata.path_to_item + ) + ) + if format == 'int32': + if not __int32_inclusive_minimum <= arg <= __int32_inclusive_maximum: + raise exceptions.ApiValueError( + "Invalid value '{}' for type int32 at {}".format(arg, validation_metadata.path_to_item) + ) + return None + elif format == 'int64': + if not __int64_inclusive_minimum <= arg <= __int64_inclusive_maximum: + raise exceptions.ApiValueError( + "Invalid value '{}' for type int64 at {}".format(arg, validation_metadata.path_to_item) + ) + return None + return None + elif format in {'float', 'double'}: + if format == 'float': + if not __float_inclusive_minimum <= arg <= __float_inclusive_maximum: + raise exceptions.ApiValueError( + "Invalid value '{}' for type float at {}".format(arg, validation_metadata.path_to_item) + ) + return None + # double + if not __double_inclusive_minimum <= arg <= __double_inclusive_maximum: + raise exceptions.ApiValueError( + "Invalid value '{}' for type double at {}".format(arg, validation_metadata.path_to_item) + ) + return None + return None + + +class CustomIsoparser(parser.isoparser): + @_takes_ascii + def parse_isodatetime(self, dt_str): + components, pos = self._parse_isodate(dt_str) + if len(dt_str) > pos: + if self._sep is None or dt_str[pos:pos + 1] == self._sep: + components += self._parse_isotime(dt_str[pos + 1:]) + else: + raise ValueError('String contains unknown ISO components') + + if len(components) > 3 and components[3] == 24: + components[3] = 0 + return datetime.datetime(*components) + datetime.timedelta(days=1) + + if len(components) <= 3: + raise ValueError('Value is not a datetime') + + return datetime.datetime(*components) + + @_takes_ascii + def parse_isodate(self, datestr): + components, pos = self._parse_isodate(datestr) + + if len(datestr) > pos: + raise ValueError('String contains invalid time components') + + if len(components) > 3: + raise ValueError('String contains invalid time components') + + return datetime.date(*components) + + +DEFAULT_ISOPARSER = CustomIsoparser() + + +def __validate_string_format( + arg: str, + format: str, + validation_metadata: ValidationMetadata +) -> None: + if format == 'uuid': + try: + uuid.UUID(arg) + return None + except ValueError: + raise exceptions.ApiValueError( + "Invalid value '{}' for type UUID at {}".format(arg, validation_metadata.path_to_item) + ) + elif format == 'number': + try: + decimal.Decimal(arg) + return None + except decimal.InvalidOperation: + raise exceptions.ApiValueError( + "Value cannot be converted to a decimal. " + "Invalid value '{}' for type decimal at {}".format(arg, validation_metadata.path_to_item) + ) + elif format == 'date': + try: + DEFAULT_ISOPARSER.parse_isodate(arg) + return None + except ValueError: + raise exceptions.ApiValueError( + "Value does not conform to the required ISO-8601 date format. " + "Invalid value '{}' for type date at {}".format(arg, validation_metadata.path_to_item) + ) + elif format == 'date-time': + try: + DEFAULT_ISOPARSER.parse_isodatetime(arg) + return None + except ValueError: + raise exceptions.ApiValueError( + "Value does not conform to the required ISO-8601 datetime format. " + "Invalid value '{}' for type datetime at {}".format(arg, validation_metadata.path_to_item) + ) + return None + + +def validate_format( + arg: typing.Any, + format: str, + cls: typing.Type, + validation_metadata: ValidationMetadata, +{{#if nonCompliantUseDiscriminatorIfCompositionFails}} + **kwargs +{{/if}} +) -> None: + # formats work for strings + numbers + if isinstance(arg, decimal.Decimal): + return __validate_numeric_format( + arg, + format, + validation_metadata + ) + elif isinstance(arg, str): + return __validate_string_format( + arg, + format, + validation_metadata + ) + return None + + +def validate_required( + arg: typing.Any, + required: typing.Set[str], + cls: typing.Type, + validation_metadata: ValidationMetadata, +{{#if nonCompliantUseDiscriminatorIfCompositionFails}} + **kwargs +{{/if}} +) -> None: + if not isinstance(arg, frozendict.frozendict): + return None + missing_required_arguments = required - arg.keys() + if missing_required_arguments: + missing_required_arguments = list(missing_required_arguments) + missing_required_arguments.sort() + raise exceptions.ApiTypeError( + "{} is missing {} required argument{}: {}".format( + cls.__name__, + len(missing_required_arguments), + "s" if len(missing_required_arguments) > 1 else "", + missing_required_arguments + ) + ) + return None + + +def _get_class(item_cls: typing.Union[types.FunctionType, staticmethod, typing.Type['Schema']]) -> typing.Type['Schema']: + if isinstance(item_cls, types.FunctionType): + # referenced schema + return item_cls() + elif isinstance(item_cls, staticmethod): + # referenced schema + return item_cls.__func__() + return item_cls + + +def validate_items( + arg: typing.Any, + item_cls: typing.Type, + cls: typing.Type, + validation_metadata: ValidationMetadata, +{{#if nonCompliantUseDiscriminatorIfCompositionFails}} + **kwargs +{{/if}} +) -> PathToSchemasType: + if not isinstance(arg, tuple): + return None + item_cls = _get_class(item_cls) + path_to_schemas = {} + for i, value in enumerate(arg): + item_validation_metadata = ValidationMetadata( + path_to_item=validation_metadata.path_to_item+(i,), + configuration=validation_metadata.configuration, + validated_path_to_schemas=validation_metadata.validated_path_to_schemas + ) + if item_validation_metadata.validation_ran_earlier(item_cls): + add_deeper_validated_schemas(item_validation_metadata, path_to_schemas) + continue + other_path_to_schemas = item_cls._validate( + value, validation_metadata=item_validation_metadata) + update(path_to_schemas, other_path_to_schemas) + return path_to_schemas + + +def validate_properties( + arg: typing.Any, + properties: typing.Type, + cls: typing.Type, + validation_metadata: ValidationMetadata, +{{#if nonCompliantUseDiscriminatorIfCompositionFails}} + **kwargs +{{/if}} +) -> typing.Optional[PathToSchemasType]: + if not isinstance(arg, frozendict.frozendict): + return None + path_to_schemas = {} + present_properties = {k: v for k, v, in arg.items() if k in properties.__annotations__} + for property_name, value in present_properties.items(): + path_to_item = validation_metadata.path_to_item + (property_name,) + schema = properties.__annotations__[property_name] + schema = _get_class(schema) + arg_validation_metadata = ValidationMetadata( + path_to_item=path_to_item, + configuration=validation_metadata.configuration, + validated_path_to_schemas=validation_metadata.validated_path_to_schemas + ) + if arg_validation_metadata.validation_ran_earlier(schema): + add_deeper_validated_schemas(arg_validation_metadata, path_to_schemas) + continue + other_path_to_schemas = schema._validate(value, validation_metadata=arg_validation_metadata) + update(path_to_schemas, other_path_to_schemas) + return path_to_schemas + + +def validate_additional_properties( + arg: typing.Any, + additional_properties_schema: typing.Type, + cls: typing.Type, + validation_metadata: ValidationMetadata, +{{#if nonCompliantUseDiscriminatorIfCompositionFails}} + **kwargs +{{/if}} +) -> typing.Optional[PathToSchemasType]: + if not isinstance(arg, frozendict.frozendict): + return None + schema = _get_class(additional_properties_schema) + path_to_schemas = {} + properties_annotations = cls.Schema_.Properties.__annotations__ if hasattr(cls.Schema_, 'Properties') else {} + present_additional_properties = {k: v for k, v, in arg.items() if k not in properties_annotations} + for property_name, value in present_additional_properties.items(): + path_to_item = validation_metadata.path_to_item + (property_name,) + arg_validation_metadata = ValidationMetadata( + path_to_item=path_to_item, + configuration=validation_metadata.configuration, + validated_path_to_schemas=validation_metadata.validated_path_to_schemas + ) + if arg_validation_metadata.validation_ran_earlier(schema): + add_deeper_validated_schemas(arg_validation_metadata, path_to_schemas) + continue + other_path_to_schemas = schema._validate(value, validation_metadata=arg_validation_metadata) + update(path_to_schemas, other_path_to_schemas) + return path_to_schemas + + +def validate_one_of( + arg: typing.Any, + one_of_container_cls: typing.Type, + cls: 'Schema', + validation_metadata: ValidationMetadata, +{{#if nonCompliantUseDiscriminatorIfCompositionFails}} + discriminated_cls: typing.Optional['Schema'], + **kwargs +{{/if}} +) -> PathToSchemasType: + oneof_classes = [] + path_to_schemas = collections.defaultdict(set) + for one_of_cls in one_of_container_cls.classes: + schema = _get_class(one_of_cls) + if schema in path_to_schemas[validation_metadata.path_to_item]: + oneof_classes.append(schema) + continue + if schema is cls: + """ + optimistically assume that cls schema will pass validation + do not invoke _validate on it because that is recursive + """ + oneof_classes.append(schema) + continue + if validation_metadata.validation_ran_earlier(schema): + oneof_classes.append(schema) + add_deeper_validated_schemas(validation_metadata, path_to_schemas) + continue + try: + path_to_schemas = schema._validate(arg, validation_metadata=validation_metadata) + except (exceptions.ApiValueError, exceptions.ApiTypeError) as ex: + # silence exceptions because the code needs to accumulate oneof_classes + continue + oneof_classes.append(schema) + if not oneof_classes: + {{#if nonCompliantUseDiscriminatorIfCompositionFails}} + if discriminated_cls: + """ + return without exception because code was generated with + nonCompliantUseDiscriminatorIfCompositionFails=true + """ + return {} + {{/if}} + raise exceptions.ApiValueError( + "Invalid inputs given to generate an instance of {}. None " + "of the oneOf schemas matched the input data.".format(cls) + ) + elif len(oneof_classes) > 1: + {{#if nonCompliantUseDiscriminatorIfCompositionFails}} + if discriminated_cls: + """ + return without exception because code was generated with + nonCompliantUseDiscriminatorIfCompositionFails=true + """ + return {} + {{/if}} + raise exceptions.ApiValueError( + "Invalid inputs given to generate an instance of {}. Multiple " + "oneOf schemas {} matched the inputs, but a max of one is allowed.".format(cls, oneof_classes) + ) + # exactly one class matches + return path_to_schemas + + +def validate_any_of( + arg: typing.Any, + any_of_container_cls: typing.Type, + cls: 'Schema', + validation_metadata: ValidationMetadata, +{{#if nonCompliantUseDiscriminatorIfCompositionFails}} + discriminated_cls: typing.Optional['Schema'], + **kwargs +{{/if}} +) -> PathToSchemasType: + anyof_classes = [] + path_to_schemas = collections.defaultdict(set) + for any_of_cls in any_of_container_cls.classes: + schema = _get_class(any_of_cls) + if schema is cls: + """ + optimistically assume that cls schema will pass validation + do not invoke _validate on it because that is recursive + """ + anyof_classes.append(schema) + continue + if validation_metadata.validation_ran_earlier(schema): + anyof_classes.append(schema) + add_deeper_validated_schemas(validation_metadata, path_to_schemas) + continue + + try: + other_path_to_schemas = schema._validate(arg, validation_metadata=validation_metadata) + except (exceptions.ApiValueError, exceptions.ApiTypeError) as ex: + # silence exceptions because the code needs to accumulate anyof_classes + continue + anyof_classes.append(schema) + update(path_to_schemas, other_path_to_schemas) + if not anyof_classes: + {{#if nonCompliantUseDiscriminatorIfCompositionFails}} + if discriminated_cls: + """ + return without exception because code was generated with + nonCompliantUseDiscriminatorIfCompositionFails=true + """ + return {} + {{/if}} + raise exceptions.ApiValueError( + "Invalid inputs given to generate an instance of {}. None " + "of the anyOf schemas matched the input data.".format(cls) + ) + return path_to_schemas + + +def validate_all_of( + arg: typing.Any, + all_of_cls: typing.Type, + cls: typing.Type, + validation_metadata: ValidationMetadata, +{{#if nonCompliantUseDiscriminatorIfCompositionFails}} + **kwargs +{{/if}} +) -> PathToSchemasType: + path_to_schemas = collections.defaultdict(set) + for allof_cls in all_of_cls.classes: + schema = _get_class(allof_cls) + if schema is cls: + """ + optimistically assume that cls schema will pass validation + do not invoke _validate on it because that is recursive + """ + continue + if validation_metadata.validation_ran_earlier(schema): + add_deeper_validated_schemas(validation_metadata, path_to_schemas) + continue + other_path_to_schemas = schema._validate(arg, validation_metadata=validation_metadata) + update(path_to_schemas, other_path_to_schemas) + return path_to_schemas + + +def validate_not( + arg: typing.Any, + not_cls: typing.Type, + cls: typing.Type, + validation_metadata: ValidationMetadata, +{{#if nonCompliantUseDiscriminatorIfCompositionFails}} + **kwargs +{{/if}} +) -> None: + not_schema = _get_class(not_cls) + other_path_to_schemas = None + not_exception = exceptions.ApiValueError( + "Invalid value '{}' was passed in to {}. Value is invalid because it is disallowed by {}".format( + arg, + cls.__name__, + not_schema.__name__, + ) + ) + if validation_metadata.validation_ran_earlier(not_schema): + raise not_exception + + try: + other_path_to_schemas = not_schema._validate(arg, validation_metadata=validation_metadata) + except (exceptions.ApiValueError, exceptions.ApiTypeError): + pass + if other_path_to_schemas: + raise not_exception + return None + + +def __ensure_discriminator_value_present( + disc_property_name: str, + validation_metadata: ValidationMetadata, + arg +): + if disc_property_name not in arg: + # The input data does not contain the discriminator property + raise exceptions.ApiValueError( + "Cannot deserialize input data due to missing discriminator. " + "The discriminator property '{}' is missing at path: {}".format(disc_property_name, validation_metadata.path_to_item) + ) + + +def __get_discriminated_class(cls, disc_property_name: str, disc_payload_value: str): + """ + Used in schemas with discriminators + """ + if not hasattr(cls.Schema_, 'discriminator'): + return None + disc = cls.Schema_.discriminator() + if disc_property_name not in disc: + return None + discriminated_cls = disc[disc_property_name].get(disc_payload_value) + if discriminated_cls is not None: + return discriminated_cls + if not ( + hasattr(cls.Schema_, 'AllOf') or + hasattr(cls.Schema_, 'OneOf') or + hasattr(cls.Schema_, 'AnyOf') + ): + return None + # TODO stop traveling if a cycle is hit + if hasattr(cls.Schema_, 'AllOf'): + for allof_cls in cls.Schema_.AllOf.classes: + allof_cls = _get_class(allof_cls) + discriminated_cls = __get_discriminated_class( + allof_cls, disc_property_name=disc_property_name, disc_payload_value=disc_payload_value) + if discriminated_cls is not None: + return discriminated_cls + if hasattr(cls.Schema_, 'OneOf'): + for oneof_cls in cls.Schema_.OneOf.classes: + oneof_cls = _get_class(oneof_cls) + discriminated_cls = __get_discriminated_class( + oneof_cls, disc_property_name=disc_property_name, disc_payload_value=disc_payload_value) + if discriminated_cls is not None: + return discriminated_cls + if hasattr(cls.Schema_, 'AnyOf'): + for anyof_cls in cls.Schema_.AnyOf.classes: + anyof_cls = _get_class(anyof_cls) + discriminated_cls = __get_discriminated_class( + anyof_cls, disc_property_name=disc_property_name, disc_payload_value=disc_payload_value) + if discriminated_cls is not None: + return discriminated_cls + return None +{{#if nonCompliantUseDiscriminatorIfCompositionFails}} + +def _get_discriminated_class_and_exception( + arg: typing.Any, + cls: 'Schema', + validation_metadata: ValidationMetadata +) -> typing.Tuple[typing.Optional['Schema'], typing.Optional[Exception]]: + if not isinstance(arg, frozendict.frozendict): + return None, None + discriminator = cls.Schema_.discriminator() + disc_prop_name = list(discriminator.keys())[0] + try: + __ensure_discriminator_value_present(disc_prop_name, validation_metadata, arg) + except exceptions.ApiValueError as ex: + return None, ex + return ( + __get_discriminated_class( + cls, disc_property_name=disc_prop_name, disc_payload_value=arg[disc_prop_name] + ), + None + ) +{{/if}} + + +def validate_discriminator( + arg: typing.Any, + discriminator_fn: typing.Type, + cls: typing.Type, + validation_metadata: ValidationMetadata, +{{#if nonCompliantUseDiscriminatorIfCompositionFails}} + discriminated_cls: typing.Optional['Schema'], + ensure_discriminator_value_present_exc: typing.Optional[Exception], +{{/if}} +) -> typing.Optional[PathToSchemasType]: + if not isinstance(arg, frozendict.frozendict): + return None + discriminator = discriminator_fn.__func__() + disc_prop_name = list(discriminator.keys())[0] +{{#if nonCompliantUseDiscriminatorIfCompositionFails}} + if ensure_discriminator_value_present_exc: + raise ensure_discriminator_value_present_exc +{{else}} + __ensure_discriminator_value_present(disc_prop_name, validation_metadata, arg) + discriminated_cls = __get_discriminated_class( + cls, disc_property_name=disc_prop_name, disc_payload_value=arg[disc_prop_name] + ) +{{/if}} + if discriminated_cls is None: + raise exceptions.ApiValueError( + "Invalid discriminator value was passed in to {}.{} Only the values {} are allowed at {}".format( + cls.__name__, + disc_prop_name, + list(discriminator[disc_prop_name].keys()), + validation_metadata.path_to_item + (disc_prop_name,) + ) + ) + if discriminated_cls is cls: + """ + Optimistically assume that cls will pass validation + If the code invoked _validate on cls it would infinitely recurse + """ + return None + if validation_metadata.validation_ran_earlier(discriminated_cls): + path_to_schemas = {} + add_deeper_validated_schemas(validation_metadata, path_to_schemas) + return path_to_schemas + updated_vm = ValidationMetadata( + path_to_item=validation_metadata.path_to_item, + configuration=validation_metadata.configuration, + seen_classes=validation_metadata.seen_classes | frozenset({cls}), + validated_path_to_schemas=validation_metadata.validated_path_to_schemas + ) + return discriminated_cls._validate(arg, validation_metadata=updated_vm) + + +json_schema_keyword_to_validator = { + 'types': validate_types, + 'enum_value_to_name': validate_enum, + 'unique_items': validate_unique_items, + 'min_items': validate_min_items, + 'max_items': validate_max_items, + 'min_properties': validate_min_properties, + 'max_properties': validate_max_properties, + 'min_length': validate_min_length, + 'max_length': validate_max_length, + 'inclusive_minimum': validate_inclusive_minimum, + 'exclusive_minimum': validate_exclusive_minimum, + 'inclusive_maximum': validate_inclusive_maximum, + 'exclusive_maximum': validate_exclusive_maximum, + 'multiple_of': validate_multiple_of, + 'regex': validate_regex, + 'format': validate_format, + 'required': validate_required, + 'items': validate_items, + 'Items': validate_items, + 'Properties': validate_properties, + 'AdditionalProperties': validate_additional_properties, + 'additional_properties': validate_additional_properties, + 'OneOf': validate_one_of, + 'AnyOf': validate_any_of, + 'AllOf': validate_all_of, + '_not': validate_not, + '_Not': validate_not, + 'ModelNot': validate_not, + 'discriminator': validate_discriminator +} + + +class Schema: + """ + the base class of all swagger/openapi schemas/models + """ + __inheritable_primitive_types_set = {decimal.Decimal, str, tuple, frozendict.frozendict, FileIO, bytes, BoolClass, NoneClass} + Schema_: SchemaTyped + __excluded_cls_properties = { + '__module__', + '__dict__', + '__weakref__', + '__doc__', + 'default', # excluded because it has no impact on validation + } + + @classmethod + def _validate( + cls, + arg, + validation_metadata: ValidationMetadata, + ) -> PathToSchemasType: + """ + Schema validate + All keyword validation except for type checking was done in calling stack frames + If those validations passed, the validated classes are collected in path_to_schemas + """ + json_schema_data = { + k: v + for k, v in vars(cls.Schema_).items() + if k not in cls.__excluded_cls_properties + and k + not in validation_metadata.configuration.disabled_json_schema_python_keywords + } +{{#if nonCompliantUseDiscriminatorIfCompositionFails}} + kwargs = {} + if 'discriminator' in json_schema_data: + discriminated_cls, ensure_discriminator_value_present_exc = _get_discriminated_class_and_exception( + arg, + cls, + validation_metadata + ) + kwargs = { + 'discriminated_cls': discriminated_cls, + 'ensure_discriminator_value_present_exc': ensure_discriminator_value_present_exc + } +{{/if}} + path_to_schemas = {} + for keyword, val in json_schema_data.items(): + validator = json_schema_keyword_to_validator[keyword] + + other_path_to_schemas = validator( + arg, + val, + cls, + validation_metadata, +{{#if nonCompliantUseDiscriminatorIfCompositionFails}} + **kwargs +{{/if}} + ) + if other_path_to_schemas: + update(path_to_schemas, other_path_to_schemas) + + base_class = type(arg) + if validation_metadata.path_to_item not in path_to_schemas: + path_to_schemas[validation_metadata.path_to_item] = set() + path_to_schemas[validation_metadata.path_to_item].add(cls) + path_to_schemas[validation_metadata.path_to_item].add(base_class) + return path_to_schemas + + @staticmethod + def _process_schema_classes( + schema_classes: typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]] + ): + """ + Processes and mutates schema_classes + If a SomeSchema is a subclass of DictSchema then remove DictSchema because it is already included + """ + if len(schema_classes) < 2: + return + if len(schema_classes) > 2 and UnsetAnyTypeSchema in schema_classes: + schema_classes.remove(UnsetAnyTypeSchema) + x_schema = schema_type_classes & schema_classes + if not x_schema: + return + # the only way len == 2 is to have one be AnyTypeSchema + x_schema = x_schema.pop() if len(x_schema) == 1 else AnyTypeSchema + if any(c is not x_schema and issubclass(c, x_schema) for c in schema_classes): + # needed to not have a mro error in get_new_class + schema_classes.remove(x_schema) + + @staticmethod + def __bases_by_type(): + return { + str: (UnsetAnyTypeSchema, str), + decimal.Decimal: (UnsetAnyTypeSchema, decimal.Decimal), + BoolClass: (UnsetAnyTypeSchema, BoolClass), + NoneClass: (UnsetAnyTypeSchema, NoneClass), + tuple: (UnsetAnyTypeSchema, tuple), + frozendict.frozendict: (UnsetAnyTypeSchema, frozendict.frozendict), + bytes: (UnsetAnyTypeSchema, bytes), + FileIO: (UnsetAnyTypeSchema, FileIO), + } + + @classmethod + def __get_new_cls( + cls, + arg, + validation_metadata: ValidationMetadata, + path_to_type: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Type] + ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Type['Schema']]: + """ + Make a new dynamic class and return an instance of that class + We are making an instance of cls, but instead of making cls + make a new class, new_cls + which includes dynamic bases including cls + return an instance of that new class + + Dict property + List Item Assignment Use cases: + 1. value is NOT an instance of the required schema class + the value is validated by _validate + _validate returns a key value pair + where the key is the path to the item, and the value will be the required manufactured class + made out of the matching schemas + 2. value is an instance of the correct schema type + the value is NOT validated by _validate, _validate only checks that the instance is of the correct schema type + for this value, _validate does NOT return an entry for it in _path_to_schemas + and in list/dict _get_items,_get_properties the value will be directly assigned + because value is of the correct type, and validation was run earlier when the instance was created + """ + _path_to_schemas = {} + if validation_metadata.validation_ran_earlier(cls): + add_deeper_validated_schemas(validation_metadata, _path_to_schemas) + else: + other_path_to_schemas = cls._validate(arg, validation_metadata=validation_metadata) + update(_path_to_schemas, other_path_to_schemas) + # loop through it make a new class for each entry + # do not modify the returned result because it is cached and we would be modifying the cached value + path_to_schemas = {} + for path, schema_classes in _path_to_schemas.items(): + """ + Use cases + 1. N number of schema classes + enum + type != bool/None, classes in path_to_schemas: tuple/frozendict.frozendict/str/Decimal/bytes/FileIo + needs Singleton added + 2. N number of schema classes + enum + type == bool/None, classes in path_to_schemas: BoolClass/NoneClass + Singleton already added + 3. N number of schema classes, classes in path_to_schemas: BoolClass/NoneClass/tuple/frozendict.frozendict/str/Decimal/bytes/FileIo + """ + cls._process_schema_classes(schema_classes) + enum_schema = any( + issubclass(this_cls, Schema) and hasattr(this_cls.Schema_, "enum_value_to_name") + for this_cls in schema_classes + ) + inheritable_primitive_type = schema_classes.intersection(cls.__inheritable_primitive_types_set) + chosen_schema_classes = schema_classes - inheritable_primitive_type + suffix = tuple(inheritable_primitive_type) + if enum_schema and suffix[0] not in {NoneClass, BoolClass}: + suffix = (Singleton,) + suffix + + used_classes = tuple(sorted(chosen_schema_classes, key=lambda a_cls: a_cls.__name__)) + suffix + mfg_cls = get_new_class(class_name='DynamicSchema', bases=used_classes) + path_to_schemas[path] = mfg_cls + + """ + For locations that validation did not check + the code still needs to mfg a class to hold those values + All of these classes will be based on UnsetAnyTypeSchema + """ + missing_paths = path_to_type.keys() - path_to_schemas.keys() + for missing_path in missing_paths: + value_type = path_to_type[missing_path] + bases = cls.__bases_by_type()[value_type] + mfg_cls = get_new_class(class_name='DynamicSchema', bases=bases) + path_to_schemas[missing_path] = mfg_cls + + return path_to_schemas + + @classmethod + def _get_new_instance_without_conversion( + cls, + arg: typing.Any, + path_to_item: typing.Tuple[typing.Union[str, int], ...], + path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Type['Schema']] + ): + # We have a Dynamic class and we are making an instance of it + if issubclass(cls, frozendict.frozendict) and issubclass(cls, DictBase): + properties = cls._get_properties(arg, path_to_item, path_to_schemas) + return super(Schema, cls).__new__(cls, properties) + elif issubclass(cls, tuple) and issubclass(cls, ListBase): + items = cls._get_items(arg, path_to_item, path_to_schemas) + return super(Schema, cls).__new__(cls, items) + """ + str = openapi str, datetime.date, and datetime.datetime + decimal.Decimal = openapi int and float + FileIO = openapi binary type and the user inputs a file + bytes = openapi binary type and the user inputs bytes + """ + return super(Schema, cls).__new__(cls, arg) + + @classmethod + def from_openapi_data_( + cls, + arg: typing.Union[ + str, + int, + float, + bool, + None, + dict, + list, + io.FileIO, + io.BufferedReader, + bytes + ], + configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None + ): + """ + Schema from_openapi_data_ + """ + from_server = True + validated_path_to_schemas = {} + path_to_type = {} + arg = cast_to_allowed_types(arg, from_server, validated_path_to_schemas, ('args[0]',), path_to_type) + validation_metadata = ValidationMetadata( + path_to_item=('args[0]',), + configuration=configuration_ or schema_configuration.SchemaConfiguration(), + validated_path_to_schemas=frozendict.frozendict(validated_path_to_schemas) + ) + path_to_schemas = cls.__get_new_cls(arg, validation_metadata, path_to_type) + new_cls = path_to_schemas[validation_metadata.path_to_item] + new_inst = new_cls._get_new_instance_without_conversion( + arg, + validation_metadata.path_to_item, + path_to_schemas + ) + return new_inst + + @staticmethod + def __get_input_dict(*args, **kwargs) -> frozendict.frozendict: + input_dict = {} + if args and isinstance(args[0], (dict, frozendict.frozendict)): + input_dict.update(args[0]) + if kwargs: + input_dict.update(kwargs) + return frozendict.frozendict(input_dict) + + @staticmethod + def __remove_unsets(kwargs): + return {key: val for key, val in kwargs.items() if val is not unset} + + def __new__( + cls, + *args_: typing.Union[ + {{> _helper_types_all_incl_schema }} + ], + configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[ + {{> _helper_types_all_incl_schema }} + Unset + ] + ): + """ + Schema __new__ + + Args: + args_ (int/float/decimal.Decimal/str/list/tuple/dict/frozendict.frozendict/bool/None): the value + kwargs (str, int/float/decimal.Decimal/str/list/tuple/dict/frozendict.frozendict/bool/None): dict values + configuration_: contains the schema_configuration.SchemaConfiguration that enables json schema validation keywords + like minItems, minLength etc + + Note: double underscores are used here because pycharm thinks that these variables + are instance properties if they are named normally :( + """ + __kwargs = cls.__remove_unsets(kwargs) + if not args_ and not __kwargs: + raise TypeError( + 'No input given. args or kwargs must be given.' + ) + if not __kwargs and args_ and not isinstance(args_[0], dict): + __arg = args_[0] + else: + __arg = cls.__get_input_dict(*args_, **__kwargs) + __from_server = False + __validated_path_to_schemas = {} + __path_to_type = {} + __arg = cast_to_allowed_types( + __arg, __from_server, __validated_path_to_schemas, ('args[0]',), __path_to_type) + __validation_metadata = ValidationMetadata( + path_to_item=('args[0]',), + configuration=configuration_ or schema_configuration.SchemaConfiguration(), + validated_path_to_schemas=frozendict.frozendict(__validated_path_to_schemas) + ) + __path_to_schemas = cls.__get_new_cls(__arg, __validation_metadata, __path_to_type) + __new_cls = __path_to_schemas[__validation_metadata.path_to_item] + return __new_cls._get_new_instance_without_conversion( + __arg, + __validation_metadata.path_to_item, + __path_to_schemas + ) + + +""" +import itertools +data_types = ('None', 'FrozenDict', 'Tuple', 'Str', 'Decimal', 'Bool') +type_to_cls = { + 'None': 'NoneClass', + 'FrozenDict': 'frozendict.frozendict', + 'Tuple': 'tuple', + 'Str': 'str', + 'Decimal': 'decimal.Decimal', + 'Bool': 'BoolClass' +} +cls_tuples = [v for v in itertools.combinations(data_types, 5)] +typed_classes = [f"class {''.join(cls_tuple)}Mixin({', '.join(type_to_cls[typ] for typ in cls_tuple)}):\n pass" for cls_tuple in cls_tuples] +for cls in typed_classes: + print(cls) +object_classes = [f"{''.join(cls_tuple)}Mixin = object" for cls_tuple in cls_tuples] +for cls in object_classes: + print(cls) +""" +if typing.TYPE_CHECKING: + # qty 1 + NoneMixin = NoneClass + FrozenDictMixin = frozendict.frozendict + TupleMixin = tuple + StrMixin = str + DecimalMixin = decimal.Decimal + BoolMixin = BoolClass + BytesMixin = bytes + FileMixin = FileIO + # qty 2 + class BinaryMixin(bytes, FileIO): + pass + class NoneFrozenDictMixin(NoneClass, frozendict.frozendict): + pass + class NoneTupleMixin(NoneClass, tuple): + pass + class NoneStrMixin(NoneClass, str): + pass + class NoneDecimalMixin(NoneClass, decimal.Decimal): + pass + class NoneBoolMixin(NoneClass, BoolClass): + pass + class FrozenDictTupleMixin(frozendict.frozendict, tuple): + pass + class FrozenDictStrMixin(frozendict.frozendict, str): + pass + class FrozenDictDecimalMixin(frozendict.frozendict, decimal.Decimal): + pass + class FrozenDictBoolMixin(frozendict.frozendict, BoolClass): + pass + class TupleStrMixin(tuple, str): + pass + class TupleDecimalMixin(tuple, decimal.Decimal): + pass + class TupleBoolMixin(tuple, BoolClass): + pass + class StrDecimalMixin(str, decimal.Decimal): + pass + class StrBoolMixin(str, BoolClass): + pass + class DecimalBoolMixin(decimal.Decimal, BoolClass): + pass + # qty 3 + class NoneFrozenDictTupleMixin(NoneClass, frozendict.frozendict, tuple): + pass + class NoneFrozenDictStrMixin(NoneClass, frozendict.frozendict, str): + pass + class NoneFrozenDictDecimalMixin(NoneClass, frozendict.frozendict, decimal.Decimal): + pass + class NoneFrozenDictBoolMixin(NoneClass, frozendict.frozendict, BoolClass): + pass + class NoneTupleStrMixin(NoneClass, tuple, str): + pass + class NoneTupleDecimalMixin(NoneClass, tuple, decimal.Decimal): + pass + class NoneTupleBoolMixin(NoneClass, tuple, BoolClass): + pass + class NoneStrDecimalMixin(NoneClass, str, decimal.Decimal): + pass + class NoneStrBoolMixin(NoneClass, str, BoolClass): + pass + class NoneDecimalBoolMixin(NoneClass, decimal.Decimal, BoolClass): + pass + class FrozenDictTupleStrMixin(frozendict.frozendict, tuple, str): + pass + class FrozenDictTupleDecimalMixin(frozendict.frozendict, tuple, decimal.Decimal): + pass + class FrozenDictTupleBoolMixin(frozendict.frozendict, tuple, BoolClass): + pass + class FrozenDictStrDecimalMixin(frozendict.frozendict, str, decimal.Decimal): + pass + class FrozenDictStrBoolMixin(frozendict.frozendict, str, BoolClass): + pass + class FrozenDictDecimalBoolMixin(frozendict.frozendict, decimal.Decimal, BoolClass): + pass + class TupleStrDecimalMixin(tuple, str, decimal.Decimal): + pass + class TupleStrBoolMixin(tuple, str, BoolClass): + pass + class TupleDecimalBoolMixin(tuple, decimal.Decimal, BoolClass): + pass + class StrDecimalBoolMixin(str, decimal.Decimal, BoolClass): + pass + # qty 4 + class NoneFrozenDictTupleStrMixin(NoneClass, frozendict.frozendict, tuple, str): + pass + class NoneFrozenDictTupleDecimalMixin(NoneClass, frozendict.frozendict, tuple, decimal.Decimal): + pass + class NoneFrozenDictTupleBoolMixin(NoneClass, frozendict.frozendict, tuple, BoolClass): + pass + class NoneFrozenDictStrDecimalMixin(NoneClass, frozendict.frozendict, str, decimal.Decimal): + pass + class NoneFrozenDictStrBoolMixin(NoneClass, frozendict.frozendict, str, BoolClass): + pass + class NoneFrozenDictDecimalBoolMixin(NoneClass, frozendict.frozendict, decimal.Decimal, BoolClass): + pass + class NoneTupleStrDecimalMixin(NoneClass, tuple, str, decimal.Decimal): + pass + class NoneTupleStrBoolMixin(NoneClass, tuple, str, BoolClass): + pass + class NoneTupleDecimalBoolMixin(NoneClass, tuple, decimal.Decimal, BoolClass): + pass + class NoneStrDecimalBoolMixin(NoneClass, str, decimal.Decimal, BoolClass): + pass + class FrozenDictTupleStrDecimalMixin(frozendict.frozendict, tuple, str, decimal.Decimal): + pass + class FrozenDictTupleStrBoolMixin(frozendict.frozendict, tuple, str, BoolClass): + pass + class FrozenDictTupleDecimalBoolMixin(frozendict.frozendict, tuple, decimal.Decimal, BoolClass): + pass + class FrozenDictStrDecimalBoolMixin(frozendict.frozendict, str, decimal.Decimal, BoolClass): + pass + class TupleStrDecimalBoolMixin(tuple, str, decimal.Decimal, BoolClass): + pass + # qty 5 + class NoneFrozenDictTupleStrDecimalMixin(NoneClass, frozendict.frozendict, tuple, str, decimal.Decimal): + pass + class NoneFrozenDictTupleStrBoolMixin(NoneClass, frozendict.frozendict, tuple, str, BoolClass): + pass + class NoneFrozenDictTupleDecimalBoolMixin(NoneClass, frozendict.frozendict, tuple, decimal.Decimal, BoolClass): + pass + class NoneFrozenDictStrDecimalBoolMixin(NoneClass, frozendict.frozendict, str, decimal.Decimal, BoolClass): + pass + class NoneTupleStrDecimalBoolMixin(NoneClass, tuple, str, decimal.Decimal, BoolClass): + pass + class FrozenDictTupleStrDecimalBoolMixin(frozendict.frozendict, tuple, str, decimal.Decimal, BoolClass): + pass + # qty 6 + class NoneFrozenDictTupleStrDecimalBoolMixin(NoneClass, frozendict.frozendict, tuple, str, decimal.Decimal, BoolClass): + pass + # qty 8 + class NoneFrozenDictTupleStrDecimalBoolFileBytesMixin(NoneClass, frozendict.frozendict, tuple, str, decimal.Decimal, BoolClass, FileIO, bytes): + pass +else: + # qty 1 + class NoneMixin: + pass + class FrozenDictMixin: + pass + class TupleMixin: + pass + class StrMixin: + pass + class DecimalMixin: + pass + class BoolMixin: + pass + class BytesMixin: + pass + class FileMixin: + pass + # qty 2 + class BinaryMixin: + pass + class NoneFrozenDictMixin: + pass + class NoneTupleMixin: + pass + class NoneStrMixin: + pass + class NoneDecimalMixin: + pass + class NoneBoolMixin: + pass + class FrozenDictTupleMixin: + pass + class FrozenDictStrMixin: + pass + class FrozenDictDecimalMixin: + pass + class FrozenDictBoolMixin: + pass + class TupleStrMixin: + pass + class TupleDecimalMixin: + pass + class TupleBoolMixin: + pass + class StrDecimalMixin: + pass + class StrBoolMixin: + pass + class DecimalBoolMixin: + pass + # qty 3 + class NoneFrozenDictTupleMixin: + pass + class NoneFrozenDictStrMixin: + pass + class NoneFrozenDictDecimalMixin: + pass + class NoneFrozenDictBoolMixin: + pass + class NoneTupleStrMixin: + pass + class NoneTupleDecimalMixin: + pass + class NoneTupleBoolMixin: + pass + class NoneStrDecimalMixin: + pass + class NoneStrBoolMixin: + pass + class NoneDecimalBoolMixin: + pass + class FrozenDictTupleStrMixin: + pass + class FrozenDictTupleDecimalMixin: + pass + class FrozenDictTupleBoolMixin: + pass + class FrozenDictStrDecimalMixin: + pass + class FrozenDictStrBoolMixin: + pass + class FrozenDictDecimalBoolMixin: + pass + class TupleStrDecimalMixin: + pass + class TupleStrBoolMixin: + pass + class TupleDecimalBoolMixin: + pass + class StrDecimalBoolMixin: + pass + # qty 4 + class NoneFrozenDictTupleStrMixin: + pass + class NoneFrozenDictTupleDecimalMixin: + pass + class NoneFrozenDictTupleBoolMixin: + pass + class NoneFrozenDictStrDecimalMixin: + pass + class NoneFrozenDictStrBoolMixin: + pass + class NoneFrozenDictDecimalBoolMixin: + pass + class NoneTupleStrDecimalMixin: + pass + class NoneTupleStrBoolMixin: + pass + class NoneTupleDecimalBoolMixin: + pass + class NoneStrDecimalBoolMixin: + pass + class FrozenDictTupleStrDecimalMixin: + pass + class FrozenDictTupleStrBoolMixin: + pass + class FrozenDictTupleDecimalBoolMixin: + pass + class FrozenDictStrDecimalBoolMixin: + pass + class TupleStrDecimalBoolMixin: + pass + # qty 5 + class NoneFrozenDictTupleStrDecimalMixin: + pass + class NoneFrozenDictTupleStrBoolMixin: + pass + class NoneFrozenDictTupleDecimalBoolMixin: + pass + class NoneFrozenDictStrDecimalBoolMixin: + pass + class NoneTupleStrDecimalBoolMixin: + pass + class FrozenDictTupleStrDecimalBoolMixin: + pass + # qty 6 + class NoneFrozenDictTupleStrDecimalBoolMixin: + pass + # qty 8 + class NoneFrozenDictTupleStrDecimalBoolFileBytesMixin: + pass + + +class BoolBase: + def is_true_(self) -> bool: + """ + A replacement for x is True + True if the instance is a BoolClass True Singleton + """ + if not issubclass(self.__class__, BoolClass): + return False + return bool(self) + + def is_false_(self) -> bool: + """ + A replacement for x is False + True if the instance is a BoolClass False Singleton + """ + if not issubclass(self.__class__, BoolClass): + return False + return bool(self) is False + + +class NoneBase: + def is_none_(self) -> bool: + """ + A replacement for x is None + True if the instance is a NoneClass None Singleton + """ + if issubclass(self.__class__, NoneClass): + return True + return False + + +class StrBase: + Schema_: SchemaTyped + + @property + def as_str_(self) -> str: + return self + + @property + def as_date_(self) -> datetime.date: + raise Exception('not implemented') + + @property + def as_datetime_(self) -> datetime.datetime: + raise Exception('not implemented') + + @property + def as_decimal_(self) -> decimal.Decimal: + raise Exception('not implemented') + + @property + def as_uuid_(self) -> uuid.UUID: + raise Exception('not implemented') + + +class UUIDBase: + @property + @functools.lru_cache() + def as_uuid_(self) -> uuid.UUID: + return uuid.UUID(self) + + +class DateBase: + @property + @functools.lru_cache() + def as_date_(self) -> datetime.date: + return DEFAULT_ISOPARSER.parse_isodate(self) + + +class DateTimeBase: + @property + @functools.lru_cache() + def as_datetime_(self) -> datetime.datetime: + return DEFAULT_ISOPARSER.parse_isodatetime(self) + + +class DecimalBase: + """ + A class for storing decimals that are sent over the wire as strings + These schemas must remain based on StrBase rather than NumberBase + because picking base classes must be deterministic + """ + + @property + @functools.lru_cache() + def as_decimal_(self) -> decimal.Decimal: + return decimal.Decimal(self) + + +class NumberBase: + Schema_: SchemaTyped + + @property + def as_int_(self) -> int: + try: + return self._as_int + except AttributeError: + """ + Note: for some numbers like 9.0 they could be represented as an + integer but our code chooses to store them as + >>> Decimal('9.0').as_tuple() + DecimalTuple(sign=0, digits=(9, 0), exponent=-1) + so we can tell that the value came from a float and convert it back to a float + during later serialization + """ + if self.as_tuple().exponent < 0: + # this could be represented as an integer but should be represented as a float + # because that's what it was serialized from + raise exceptions.ApiValueError(f'{self} is not an integer') + self._as_int = int(self) + return self._as_int + + @property + def as_float_(self) -> float: + try: + return self._as_float + except AttributeError: + if self.as_tuple().exponent >= 0: + raise exceptions.ApiValueError(f'{self} is not a float') + self._as_float = float(self) + return self._as_float + + +class ListBase: + Schema_: SchemaTyped + + @classmethod + def _get_items( + cls: 'Schema', + arg: typing.List[typing.Any], + path_to_item: typing.Tuple[typing.Union[str, int], ...], + path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Type['Schema']] + ): + ''' + ListBase _get_items + ''' + cast_items = [] + + for i, value in enumerate(arg): + item_path_to_item = path_to_item + (i,) + item_cls = path_to_schemas[item_path_to_item] + new_value = item_cls._get_new_instance_without_conversion( + value, + item_path_to_item, + path_to_schemas + ) + cast_items.append(new_value) + + return cast_items + + +class DictBase: + @classmethod + def _get_properties( + cls, + arg: typing.Dict[str, typing.Any], + path_to_item: typing.Tuple[typing.Union[str, int], ...], + path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Type['Schema']] + ): + """ + DictBase _get_properties, this is how properties are set + These values already passed validation + """ + dict_items = {} + + for property_name_js, value in arg.items(): + property_path_to_item = path_to_item + (property_name_js,) + property_cls = path_to_schemas[property_path_to_item] + new_value = property_cls._get_new_instance_without_conversion( + value, + property_path_to_item, + path_to_schemas + ) + dict_items[property_name_js] = new_value + + return dict_items + + def __setattr__(self, name: str, value: typing.Any): + if not isinstance(self, FileIO): + raise AttributeError('property setting not supported on immutable instances') + + def __getattr__(self, name: str): + """ + for instance.name access + Properties are only type hinted for required properties + so that hasattr(instance, 'optionalProp') is False when that key is not present + """ + if not isinstance(self, frozendict.frozendict): + return super().__getattr__(name) + if name not in self.__class__.__annotations__: + raise AttributeError(f"{self} has no attribute '{name}'") + try: + value = self[name] + return value + except KeyError as ex: + raise AttributeError(str(ex)) + + def get_item_(self, name: str) -> typing.Union['AnyTypeSchema', Unset]: + # dict_instance[name] accessor + if not isinstance(self, frozendict.frozendict): + raise NotImplementedError() + try: + return super().__getitem__(name) + except KeyError: + return unset + + +def cast_to_allowed_types( + arg: typing.Union[ + {{> _helper_types_all_incl_schema }} + ], + from_server: bool, + validated_path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]], + path_to_item: typing.Tuple[typing.Union[str, int], ...], + path_to_type: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Type] +) -> typing.Union[ + {{> _helper_types_all_accessed }} +]: + """ + Casts the input payload arg into the allowed types + The input validated_path_to_schemas is mutated by running this function + + When from_server is False then + - date/datetime is cast to str + - int/float is cast to Decimal + + If a Schema instance is passed in it is converted back to a primitive instance because + One may need to validate that data to the original Schema class AND additional different classes + those additional classes will need to be added to the new manufactured class for that payload + If the code didn't do this and kept the payload as a Schema instance it would fail to validate to other + Schema classes and the code wouldn't be able to mfg a new class that includes all valid schemas + TODO: store the validated schema classes in validation_metadata + + Args: + arg: the payload + from_server: whether this payload came from the server or not + validated_path_to_schemas: a dict that stores the validated classes at any path location in the payload + """ + if isinstance(arg, Schema) and not isinstance(arg, UnsetAnyTypeSchema): + """ + store the already run validations + but omit UnsetAnyTypeSchema instances because they were not validated + """ + schema_classes = set() + for cls in arg.__class__.__bases__: + if cls is Singleton: + # Skip Singleton + continue + schema_classes.add(cls) + validated_path_to_schemas[path_to_item] = schema_classes + + type_error = exceptions.ApiTypeError(f"Invalid type. Required value type is str and passed type was {type(arg)} at {path_to_item}") + if isinstance(arg, str): + path_to_type[path_to_item] = str + return str(arg) + elif isinstance(arg, (dict, frozendict.frozendict)): + path_to_type[path_to_item] = frozendict.frozendict + return frozendict.frozendict( + { + key: cast_to_allowed_types( + val, + from_server, + validated_path_to_schemas, + path_to_item + (key,), + path_to_type, + ) + for key, val in arg.items() + } + ) + elif isinstance(arg, (bool, BoolClass)): + path_to_type[path_to_item] = BoolClass + """ + this check must come before isinstance(arg, (int, float)) + because isinstance(True, int) is True + """ + if arg: + return BoolClass.TRUE + return BoolClass.FALSE + elif isinstance(arg, int): + path_to_type[path_to_item] = decimal.Decimal + return decimal.Decimal(arg) + elif isinstance(arg, float): + path_to_type[path_to_item] = decimal.Decimal + decimal_from_float = decimal.Decimal(arg) + if decimal_from_float.as_integer_ratio()[1] == 1: + # 9.0 -> Decimal('9.0') + # 3.4028234663852886e+38 -> Decimal('340282346638528859811704183484516925440.0') + return decimal.Decimal(str(decimal_from_float)+'.0') + return decimal_from_float + elif isinstance(arg, (tuple, list)): + path_to_type[path_to_item] = tuple + return tuple( + [ + cast_to_allowed_types( + item, + from_server, + validated_path_to_schemas, + path_to_item + (i,), + path_to_type, + ) + for i, item in enumerate(arg) + ] + ) + elif isinstance(arg, (none_type_, NoneClass)): + path_to_type[path_to_item] = NoneClass + return NoneClass.NONE + elif isinstance(arg, (datetime.date, datetime.datetime)): + path_to_type[path_to_item] = str + if not from_server: + return arg.isoformat() + raise type_error + elif isinstance(arg, uuid.UUID): + path_to_type[path_to_item] = str + if not from_server: + return str(arg) + raise type_error + elif isinstance(arg, decimal.Decimal): + path_to_type[path_to_item] = decimal.Decimal + return decimal.Decimal(arg) + elif isinstance(arg, bytes): + path_to_type[path_to_item] = bytes + return bytes(arg) + elif isinstance(arg, (io.FileIO, io.BufferedReader)): + path_to_type[path_to_item] = FileIO + return FileIO(arg) + raise ValueError('Invalid type passed in got input={} type={}'.format(arg, type(arg))) + + +class ListSchema( + ListBase, + Schema, + TupleMixin +): + class Schema_: + types = {tuple} + + @classmethod + def from_openapi_data_(cls, arg: typing.List[typing.Any], configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): + return super().from_openapi_data_(arg, configuration_=configuration_) + + def __new__(cls, arg_: typing.Union[typing.List[typing.Any], typing.Tuple[typing.Any]], **kwargs: schema_configuration.SchemaConfiguration): + return super().__new__(cls, arg_, **kwargs) + + +class NoneSchema( + NoneBase, + Schema, + NoneMixin +): + class Schema_: + types = {NoneClass} + + @classmethod + def from_openapi_data_(cls, arg: None, configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): + return super().from_openapi_data_(arg, configuration_=configuration_) + + def __new__(cls, arg_: None, **kwargs: schema_configuration.SchemaConfiguration): + return super().__new__(cls, arg_, **kwargs) + + +class NumberSchema( + NumberBase, + Schema, + DecimalMixin +): + """ + This is used for type: number with no format + Both integers AND floats are accepted + """ + class Schema_: + types = {decimal.Decimal} + + @classmethod + def from_openapi_data_(cls, arg: typing.Union[int, float], configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): + return super().from_openapi_data_(arg, configuration_=configuration_) + + def __new__(cls, arg_: typing.Union[decimal.Decimal, int, float], **kwargs: schema_configuration.SchemaConfiguration): + return super().__new__(cls, arg_, **kwargs) + + +class IntBase: + @property + def as_int_(self) -> int: + try: + return self._as_int + except AttributeError: + self._as_int = int(self) + return self._as_int + + +class IntSchema(IntBase, NumberSchema): + class Schema_: + types = {decimal.Decimal} + format = 'int' + + @classmethod + def from_openapi_data_(cls, arg: int, configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): + return super().from_openapi_data_(arg, configuration_=configuration_) + + def __new__(cls, arg_: typing.Union[decimal.Decimal, int], **kwargs: schema_configuration.SchemaConfiguration): + return super().__new__(cls, arg_, **kwargs) + + +class Int32Schema( + IntSchema +): + class Schema_: + types = {decimal.Decimal} + format = 'int32' + + +class Int64Schema( + IntSchema +): + class Schema_: + types = {decimal.Decimal} + format = 'int64' + + +class Float32Schema( + NumberSchema +): + class Schema_: + types = {decimal.Decimal} + format = 'float' + + @classmethod + def from_openapi_data_(cls, arg: float, configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): + return super().from_openapi_data_(arg, configuration_=configuration_) + + +class Float64Schema( + NumberSchema +): + class Schema_: + types = {decimal.Decimal} + format = 'double' + + @classmethod + def from_openapi_data_(cls, arg: float, configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): + return super().from_openapi_data_(arg, configuration_=configuration_) + + +class StrSchema( + StrBase, + Schema, + StrMixin +): + """ + date + datetime string types must inherit from this class + That is because one can validate a str payload as both: + - type: string (format unset) + - type: string, format: date + """ + class Schema_: + types = {str} + + @classmethod + def from_openapi_data_(cls, arg: str, configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None) -> 'StrSchema': + return super().from_openapi_data_(arg, configuration_=configuration_) + + def __new__(cls, arg_: typing.Union[str, datetime.date, datetime.datetime, uuid.UUID], **kwargs: schema_configuration.SchemaConfiguration): + return super().__new__(cls, arg_, **kwargs) + + +class UUIDSchema(UUIDBase, StrSchema): + class Schema_: + types = {str} + format = 'uuid' + + def __new__(cls, arg_: typing.Union[str, uuid.UUID], **kwargs: schema_configuration.SchemaConfiguration): + return super().__new__(cls, arg_, **kwargs) + + +class DateSchema(DateBase, StrSchema): + class Schema_: + types = {str} + format = 'date' + + def __new__(cls, arg_: typing.Union[str, datetime.date], **kwargs: schema_configuration.SchemaConfiguration): + return super().__new__(cls, arg_, **kwargs) + + +class DateTimeSchema(DateTimeBase, StrSchema): + class Schema_: + types = {str} + format = 'date-time' + + def __new__(cls, arg_: typing.Union[str, datetime.datetime], **kwargs: schema_configuration.SchemaConfiguration): + return super().__new__(cls, arg_, **kwargs) + + +class DecimalSchema(DecimalBase, StrSchema): + class Schema_: + types = {str} + format = 'number' + + def __new__(cls, arg_: str, **kwargs: schema_configuration.SchemaConfiguration): + """ + Note: Decimals may not be passed in because cast_to_allowed_types is only invoked once for payloads + which can be simple (str) or complex (dicts or lists with nested values) + Because casting is only done once and recursively casts all values prior to validation then for a potential + client side Decimal input if Decimal was accepted as an input in DecimalSchema then one would not know + if one was using it for a StrSchema (where it should be cast to str) or one is using it for NumberSchema + where it should stay as Decimal. + """ + return super().__new__(cls, arg_, **kwargs) + + +class BytesSchema( + Schema, + BytesMixin +): + """ + this class will subclass bytes and is immutable + """ + class Schema_: + types = {bytes} + + def __new__(cls, arg_: bytes, **kwargs: schema_configuration.SchemaConfiguration): + return super(Schema, cls).__new__(cls, arg_) + + +class FileSchema( + Schema, + FileMixin +): + """ + This class is NOT immutable + Dynamic classes are built using it for example when AnyType allows in binary data + Al other schema classes ARE immutable + If one wanted to make this immutable one could make this a DictSchema with required properties: + - data = BytesSchema (which would be an immutable bytes based schema) + - file_name = StrSchema + and cast_to_allowed_types would convert bytes and file instances into dicts containing data + file_name + The downside would be that data would be stored in memory which one may not want to do for very large files + + The developer is responsible for closing this file and deleting it + + This class was kept as mutable: + - to allow file reading and writing to disk + - to be able to preserve file name info + """ + class Schema_: + types = {FileIO} + + def __new__(cls, arg_: typing.Union[io.FileIO, io.BufferedReader], **kwargs: schema_configuration.SchemaConfiguration): + return super(Schema, cls).__new__(cls, arg_) + + +class BinarySchema( + Schema, + BinaryMixin +): + class Schema_: + types = {FileIO, bytes} + format = 'binary' + + class OneOf: + classes = [ + BytesSchema, + FileSchema, + ] + + def __new__(cls, arg_: typing.Union[io.FileIO, io.BufferedReader, bytes], **kwargs: schema_configuration.SchemaConfiguration): + return super().__new__(cls, arg_) + + +class BoolSchema( + BoolBase, + Schema, + BoolMixin +): + class Schema_: + types = {BoolClass} + + @classmethod + def from_openapi_data_(cls, arg: bool, configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): + return super().from_openapi_data_(arg, configuration_=configuration_) + + def __new__(cls, arg_: bool, **kwargs: ValidationMetadata): + return super().__new__(cls, arg_, **kwargs) + + +class AnyTypeSchema( + NoneBase, + DictBase, + ListBase, + StrBase, + NumberBase, + BoolBase, + Schema, + NoneFrozenDictTupleStrDecimalBoolFileBytesMixin +): + # Python representation of a schema defined as true or {} + class Schema_: + pass + + +class UnsetAnyTypeSchema(AnyTypeSchema): + # Used when additionalProperties/items was not explicitly defined and a defining schema is needed + pass + + +class NotAnyTypeSchema(AnyTypeSchema): + """ + Python representation of a schema defined as false or {'not': {}} + Does not allow inputs in of AnyType + Note: validations on this class are never run because the code knows that no inputs will ever validate + """ + + class Schema_: + _not = AnyTypeSchema + + def __new__( + cls, + *args_, + configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None, + ) -> 'NotAnyTypeSchema': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + ) + + +class DictSchema( + DictBase, + Schema, + FrozenDictMixin +): + class Schema_: + types = {frozendict.frozendict} + + @classmethod + def from_openapi_data_(cls, arg: typing.Dict[str, typing.Any], configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): + return super().from_openapi_data_(arg, configuration_=configuration_) + + def __new__(cls, *args_: typing.Union[dict, frozendict.frozendict], **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, bool, None, bytes, Schema, Unset, ValidationMetadata]): + return super().__new__(cls, *args_, **kwargs) + + +schema_type_classes = {NoneSchema, DictSchema, ListSchema, NumberSchema, StrSchema, BoolSchema, AnyTypeSchema} + + +@functools.lru_cache() +def get_new_class( + class_name: str, + bases: typing.Tuple[typing.Type[typing.Union[Schema, typing.Any]], ...] +) -> typing.Type[Schema]: + """ + Returns a new class that is made with the subclass bases + """ + new_cls: typing.Type[Schema] = type(class_name, bases, {}) + return new_cls + + +LOG_CACHE_USAGE = False + + +def log_cache_usage(cache_fn): + if LOG_CACHE_USAGE: + print(cache_fn.__name__, cache_fn.cache_info()) diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/security/security.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/security/security.hbs new file mode 100644 index 00000000000..3eaed22d0d8 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/security/security.hbs @@ -0,0 +1,15 @@ +# coding: utf-8 + +{{> _helper_header }} + +from {{packageName}} import security_schemes + +security_requirement_object: security_schemes.SecurityRequirementObject = { +{{#with securityRequirementObject}} + {{#if this}} + {{#each this}} + "{{@key}}": ({{#each scopeNames}}"{{.}}", {{/each}}), + {{/each}} + {{/if}} +{{/with}} +} diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/security_schemes.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/security_schemes.hbs new file mode 100644 index 00000000000..ee7df087635 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/security_schemes.hbs @@ -0,0 +1,244 @@ +# coding: utf-8 +{{> _helper_header }} + +import abc +import base64 +import dataclasses +import enum +import typing +import typing_extensions + +from urllib3 import _collections +{{#if hasHttpSignatureSecurityScheme}} + +from {{packageName}} import signing +{{/if}} + + +class SecuritySchemeType(enum.Enum): + API_KEY = 'apiKey' + HTTP = 'http' + MUTUAL_TLS = 'mutualTLS' + OAUTH_2 = 'oauth2' + OPENID_CONNECT = 'openIdConnect' + + +class ApiKeyInLocation(enum.Enum): + QUERY = 'query' + HEADER = 'header' + COOKIE = 'cookie' + + +class __SecuritySchemeBase(metaclass=abc.ABCMeta): + @abc.abstractmethod + def apply_auth( + self, + headers: _collections.HTTPHeaderDict, + resource_path: str, + method: str, + body: typing.Optional[typing.Union[str, bytes]], + scope_names: typing.Tuple[str] = (), + ) -> None: + pass + + +@dataclasses.dataclass +class ApiKeySecurityScheme(__SecuritySchemeBase, abc.ABC): + api_key: str # this must be set by the developer + name: str = '' + in_location: ApiKeyInLocation = ApiKeyInLocation.QUERY + type: SecuritySchemeType = SecuritySchemeType.API_KEY + + def apply_auth( + self, + headers: _collections.HTTPHeaderDict, + resource_path: str, + method: str, + body: typing.Optional[typing.Union[str, bytes]], + scope_names: typing.Tuple[str] = (), + ) -> None: + if self.in_location is ApiKeyInLocation.COOKIE: + headers.add('Cookie', self.api_key) + elif self.in_location is ApiKeyInLocation.HEADER: + headers.add(self.name, self.api_key) + elif self.in_location is ApiKeyInLocation.QUERY: + # todo add query handling + raise NotImplementedError("ApiKeySecurityScheme in query not yet implemented") + return + + +class HTTPSchemeType(enum.Enum): + BASIC = 'basic' + BEARER = 'bearer' + DIGEST = 'digest' + SIGNATURE = 'signature' # https://datatracker.ietf.org/doc/draft-cavage-http-signatures/ + + +@dataclasses.dataclass +class HTTPBasicSecurityScheme(__SecuritySchemeBase): + user_id: str # user name + password: str + scheme: HTTPSchemeType = HTTPSchemeType.BASIC + encoding: str = 'utf-8' + type: SecuritySchemeType = SecuritySchemeType.HTTP + """ + https://www.rfc-editor.org/rfc/rfc7617.html + """ + + def apply_auth( + self, + headers: _collections.HTTPHeaderDict, + resource_path: str, + method: str, + body: typing.Optional[typing.Union[str, bytes]], + scope_names: typing.Tuple[str] = (), + ) -> None: + user_pass = f"{self.user_id}:{self.password}" + b64_user_pass = base64.b64encode(user_pass.encode(encoding=self.encoding)) + headers.add('Authorization', f"Basic {b64_user_pass.decode()}") + + +@dataclasses.dataclass +class HTTPBearerSecurityScheme(__SecuritySchemeBase): + access_token: str + bearer_format: typing.Optional[str] = None + scheme: HTTPSchemeType = HTTPSchemeType.BEARER + type: SecuritySchemeType = SecuritySchemeType.HTTP + + def apply_auth( + self, + headers: _collections.HTTPHeaderDict, + resource_path: str, + method: str, + body: typing.Optional[typing.Union[str, bytes]], + scope_names: typing.Tuple[str] = (), + ) -> None: + headers.add('Authorization', f"Bearer {self.access_token}") +{{#if hasHttpSignatureSecurityScheme}} + + +@dataclasses.dataclass +class HTTPSignatureSecurityScheme(__SecuritySchemeBase): + signing_info: signing.HttpSigningConfiguration + scheme: HTTPSchemeType = HTTPSchemeType.SIGNATURE + type: SecuritySchemeType = SecuritySchemeType.HTTP + + def apply_auth( + self, + headers: _collections.HTTPHeaderDict, + resource_path: str, + method: str, + body: typing.Optional[typing.Union[str, bytes]], + scope_names: typing.Tuple[str] = (), + ) -> None: + query_params = tuple() + auth_headers = self.signing_info.get_http_signature_headers( + resource_path, method, headers, body, query_params) + for key, value in auth_headers.items(): + headers.add(key, value) +{{/if}} + + +@dataclasses.dataclass +class HTTPDigestSecurityScheme(__SecuritySchemeBase): + scheme: HTTPSchemeType = HTTPSchemeType.DIGEST + type: SecuritySchemeType = SecuritySchemeType.HTTP + + def apply_auth( + self, + headers: _collections.HTTPHeaderDict, + resource_path: str, + method: str, + body: typing.Optional[typing.Union[str, bytes]], + scope_names: typing.Tuple[str] = (), + ) -> None: + raise NotImplementedError("HTTPDigestSecurityScheme not yet implemented") + + +@dataclasses.dataclass +class MutualTLSSecurityScheme(__SecuritySchemeBase): + type: SecuritySchemeType = SecuritySchemeType.MUTUAL_TLS + + def apply_auth( + self, + headers: _collections.HTTPHeaderDict, + resource_path: str, + method: str, + body: typing.Optional[typing.Union[str, bytes]], + scope_names: typing.Tuple[str] = (), + ) -> None: + raise NotImplementedError("MutualTLSSecurityScheme not yet implemented") + + +@dataclasses.dataclass +class ImplicitOAuthFlow: + authorization_url: str + scopes: typing.Dict[str, str] + refresh_url: typing.Optional[str] = None + + +@dataclasses.dataclass +class TokenUrlOauthFlow: + token_url: str + scopes: typing.Dict[str, str] + refresh_url: typing.Optional[str] = None + + +@dataclasses.dataclass +class AuthorizationCodeOauthFlow: + authorization_url: str + token_url: str + scopes: typing.Dict[str, str] + refresh_url: typing.Optional[str] = None + + +@dataclasses.dataclass +class OAuthFlows: + implicit: typing.Optional[ImplicitOAuthFlow] = None + password: typing.Optional[TokenUrlOauthFlow] = None + client_credentials: typing.Optional[TokenUrlOauthFlow] = None + authorization_code: typing.Optional[AuthorizationCodeOauthFlow] = None + + +class OAuth2SecurityScheme(__SecuritySchemeBase, abc.ABC): + flows: OAuthFlows + type: SecuritySchemeType = SecuritySchemeType.OAUTH_2 + + def apply_auth( + self, + headers: _collections.HTTPHeaderDict, + resource_path: str, + method: str, + body: typing.Optional[typing.Union[str, bytes]], + scope_names: typing.Tuple[str] = (), + ) -> None: + raise NotImplementedError("OAuth2SecurityScheme not yet implemented") + + +class OpenIdConnectSecurityScheme(__SecuritySchemeBase, abc.ABC): + openid_connect_url: str + type: SecuritySchemeType = SecuritySchemeType.OPENID_CONNECT + + def apply_auth( + self, + headers: _collections.HTTPHeaderDict, + resource_path: str, + method: str, + body: typing.Optional[typing.Union[str, bytes]], + scope_names: typing.Tuple[str] = (), + ) -> None: + raise NotImplementedError("OpenIdConnectSecurityScheme not yet implemented") + +""" +Key is the Security scheme class +Value is the list of scopes +""" +SecurityRequirementObject = typing_extensions.TypedDict( + 'SecurityRequirementObject', + { +{{#each securitySchemes}} + '{{@key}}': typing.List[str], +{{/each}} + }, + total=False +) \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/server.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/server.hbs new file mode 100644 index 00000000000..dcbf3de489b --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/server.hbs @@ -0,0 +1,30 @@ +# coding: utf-8 +{{> _helper_header }} + +import abc +import dataclasses +import typing + + +@dataclasses.dataclass +class Server(abc.ABC): + _url: str + variables: typing.Optional[typing.Dict[str, str]] = None + variable_schemas: typing.Optional[typing.Dict[str, typing.Type['schemas.Schema']]] = None + url: str = dataclasses.field(init=False) + + def __post_init__(self): + if not self.variable_schemas: + self.url = self._url + return + url = self._url + for (key, schema) in self.variable_schemas.items(): + if self.variables and key in self.variables: + value = self.variables[key] + cast_value = schema(value) + else: + cast_value = schema.Schema_.default + url = url.replace("{" + key + "}", cast_value) + self.url = url + +from {{packageName}} import schemas diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/servers/server.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/servers/server.hbs new file mode 100644 index 00000000000..ed62dccff64 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/servers/server.hbs @@ -0,0 +1,65 @@ +# coding: utf-8 +{{> _helper_header }} + +import dataclasses +import typing +{{#if server.variables}} +import typing_extensions +{{/if}} +{{#with server}} + +from {{packageName}} import server{{#if variables}}, schemas{{/if}} + {{#if variables}} + + +class _Variables: + {{#each variables}} + {{> components/schemas/_helper_schema_switch_case identifierPieces=(append identifierPieces "_Variables" jsonPathPiece.camelCase) }} + {{/each}} + +_VariablesSchemas = typing_extensions.TypedDict( + '_VariablesSchemas', + { + {{#each variables}} + "{{{@key.original}}}": typing.Type[_Variables.{{jsonPathPiece.camelCase}}], + {{/each}} + }, + total=False +) + +Variables = typing_extensions.TypedDict( + 'Variables', + { + {{#each variables}} + "{{{@key.original}}}": {{#unless enumValueToName}}typing_extensions.Literal["{{defaultValue.value}}"],{{else}}typing_extensions.Literal[ + {{#each enumValueToName}} + "{{{@key.value}}}", + {{/each}} + ],{{/unless}} + {{/each}} + }, + total=False +) + +def _default_variable_schemas(): + return { + {{#each variables}} + "{{{@key.original}}}": _Variables.{{jsonPathPiece.camelCase}}, + {{/each}} + } + {{/if}} + + +@dataclasses.dataclass +class {{jsonPathPiece.camelCase}}(server.Server): + {{#if description}} + ''' + {{description}} + ''' + {{/if}} + _url: str = "{{url}}" + {{#if variables}} + variables: Variables + variable_schemas: _VariablesSchemas = dataclasses.field(default_factory=_default_variable_schemas) + {{/if}} +{{/with}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/servers/server_doc.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/servers/server_doc.hbs new file mode 100644 index 00000000000..b3c962d24d1 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/servers/server_doc.hbs @@ -0,0 +1,37 @@ +{{#with server}} + {{#if rootServer}} +{{packageName}}.servers.{{jsonPathPiece.snakeCase}} + {{/if}} + {{#eq identifierPieces.size 0}} +{{> components/_helper_header_from_identifier_pieces identifierPieces=(append identifierPieces "Server" jsonPathPiece) }} + {{else}} +{{headerSize}} {{jsonPathPiece.camelCase}} + {{/eq}} + {{#if description}} + +{{headerSize}}# Description +{{description}} + {{/if}} + {{#if refInfo}} +| Ref Class | Description | +| --------- | ----------- | +| [{{refInfo.refClass}}](../../servers/{{refInfo.refModule}}.{{refInfo.refClass}}.md#) |{{#with getDeepestRef}}{{#if description}} {{description}}{{/if}}{{/with}} + {{else}} + +{{headerSize}}# Url +{{{url}}} + {{#if variables}} + +{{headerSize}}# Variables +Key | Type | Description | Notes +--- | ---- | ----------- | ------ + {{#each variables}} +**{{@key.original}}** | {{> _helper_schema_python_types }} | {{#if description}}{{description}}{{/if}} | {{> components/schemas/_helper_notes_msg defaultUser="client" }} + {{/each}} + {{/if}} + {{/if}} + {{#if rootServer}} + +[[Back to top]](#top) {{> _helper_footer_links readmePath="../../" serversLink=true}} + {{/if}} +{{/with}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/setup.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/setup.handlebars deleted file mode 100644 index 5cb64ff1e61..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/setup.handlebars +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -{{>partial_header}} - -from setuptools import setup, find_packages # noqa: H301 - -NAME = "{{{projectName}}}" -VERSION = "{{packageVersion}}" -{{#with apiInfo}} -# To install the library, run the following -# -# python setup.py install -# -# prerequisite: setuptools -# http://pypi.python.org/pypi/setuptools - -REQUIRES = [ - {{> required_libraries quoted=true }} -] - -setup( - name=NAME, - version=VERSION, - description="{{appName}}", - author="{{#if infoName}}{{infoName}}{{/if}}{{#unless infoName}}OpenAPI Generator community{{/unless}}", - author_email="{{#if infoEmail}}{{infoEmail}}{{/if}}{{#unless infoEmail}}team@openapitools.org{{/unless}}", - url="{{#if packageUrl}}{{packageUrl}}{{/if}}", - keywords=["OpenAPI", "OpenAPI-Generator", "{{{appName}}}"], - python_requires="{{{generatorLanguageVersion}}}", - install_requires=REQUIRES, - packages=find_packages(exclude=["test", "tests"]), - include_package_data=True, - {{#if licenseInfo}}license="{{licenseInfo}}", - {{/if}}long_description="""\ - {{appDescription}} # noqa: E501 - """ -) -{{/with}} diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/setup_cfg.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/setup_cfg.handlebars deleted file mode 100644 index 8cb28d8c285..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/setup_cfg.handlebars +++ /dev/null @@ -1,13 +0,0 @@ -{{#if useNose}} -[nosetests] -logging-clear-handlers=true -verbosity=2 -randomize=true -exe=true -with-coverage=true -cover-package={{{packageName}}} -cover-erase=true - -{{/if}} -[flake8] -max-line-length=99 diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/signing.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/signing.handlebars deleted file mode 100644 index 26d2b8cb37c..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/signing.handlebars +++ /dev/null @@ -1,409 +0,0 @@ -# coding: utf-8 -{{>partial_header}} - -from base64 import b64encode -from Crypto.IO import PEM, PKCS8 -from Crypto.Hash import SHA256, SHA512 -from Crypto.PublicKey import RSA, ECC -from Crypto.Signature import PKCS1_v1_5, pss, DSS -from email.utils import formatdate -import json -import os -import re -from time import time -from urllib.parse import urlencode, urlparse - -# The constants below define a subset of HTTP headers that can be included in the -# HTTP signature scheme. Additional headers may be included in the signature. - -# The '(request-target)' header is a calculated field that includes the HTTP verb, -# the URL path and the URL query. -HEADER_REQUEST_TARGET = '(request-target)' -# The time when the HTTP signature was generated. -HEADER_CREATED = '(created)' -# The time when the HTTP signature expires. The API server should reject HTTP requests -# that have expired. -HEADER_EXPIRES = '(expires)' -# The 'Host' header. -HEADER_HOST = 'Host' -# The 'Date' header. -HEADER_DATE = 'Date' -# When the 'Digest' header is included in the HTTP signature, the client automatically -# computes the digest of the HTTP request body, per RFC 3230. -HEADER_DIGEST = 'Digest' -# The 'Authorization' header is automatically generated by the client. It includes -# the list of signed headers and a base64-encoded signature. -HEADER_AUTHORIZATION = 'Authorization' - -# The constants below define the cryptographic schemes for the HTTP signature scheme. -SCHEME_HS2019 = 'hs2019' -SCHEME_RSA_SHA256 = 'rsa-sha256' -SCHEME_RSA_SHA512 = 'rsa-sha512' - -# The constants below define the signature algorithms that can be used for the HTTP -# signature scheme. -ALGORITHM_RSASSA_PSS = 'RSASSA-PSS' -ALGORITHM_RSASSA_PKCS1v15 = 'RSASSA-PKCS1-v1_5' - -ALGORITHM_ECDSA_MODE_FIPS_186_3 = 'fips-186-3' -ALGORITHM_ECDSA_MODE_DETERMINISTIC_RFC6979 = 'deterministic-rfc6979' -ALGORITHM_ECDSA_KEY_SIGNING_ALGORITHMS = { - ALGORITHM_ECDSA_MODE_FIPS_186_3, - ALGORITHM_ECDSA_MODE_DETERMINISTIC_RFC6979 -} - -# The cryptographic hash algorithm for the message signature. -HASH_SHA256 = 'sha256' -HASH_SHA512 = 'sha512' - - -class HttpSigningConfiguration(object): - """The configuration parameters for the HTTP signature security scheme. - The HTTP signature security scheme is used to sign HTTP requests with a private key - which is in possession of the API client. - An 'Authorization' header is calculated by creating a hash of select headers, - and optionally the body of the HTTP request, then signing the hash value using - a private key. The 'Authorization' header is added to outbound HTTP requests. - - NOTE: This class is auto generated by OpenAPI Generator - - Ref: https://openapi-generator.tech - Do not edit the class manually. - - :param key_id: A string value specifying the identifier of the cryptographic key, - when signing HTTP requests. - :param signing_scheme: A string value specifying the signature scheme, when - signing HTTP requests. - Supported value are hs2019, rsa-sha256, rsa-sha512. - Avoid using rsa-sha256, rsa-sha512 as they are deprecated. These values are - available for server-side applications that only support the older - HTTP signature algorithms. - :param private_key_path: A string value specifying the path of the file containing - a private key. The private key is used to sign HTTP requests. - :param private_key_passphrase: A string value specifying the passphrase to decrypt - the private key. - :param signed_headers: A list of strings. Each value is the name of a HTTP header - that must be included in the HTTP signature calculation. - The two special signature headers '(request-target)' and '(created)' SHOULD be - included in SignedHeaders. - The '(created)' header expresses when the signature was created. - The '(request-target)' header is a concatenation of the lowercased :method, an - ASCII space, and the :path pseudo-headers. - When signed_headers is not specified, the client defaults to a single value, - '(created)', in the list of HTTP headers. - When SignedHeaders contains the 'Digest' value, the client performs the - following operations: - 1. Calculate a digest of request body, as specified in RFC3230, section 4.3.2. - 2. Set the 'Digest' header in the request body. - 3. Include the 'Digest' header and value in the HTTP signature. - :param signing_algorithm: A string value specifying the signature algorithm, when - signing HTTP requests. - Supported values are: - 1. For RSA keys: RSASSA-PSS, RSASSA-PKCS1-v1_5. - 2. For ECDSA keys: fips-186-3, deterministic-rfc6979. - If None, the signing algorithm is inferred from the private key. - The default signing algorithm for RSA keys is RSASSA-PSS. - The default signing algorithm for ECDSA keys is fips-186-3. - :param hash_algorithm: The hash algorithm for the signature. Supported values are - sha256 and sha512. - If the signing_scheme is rsa-sha256, the hash algorithm must be set - to None or sha256. - If the signing_scheme is rsa-sha512, the hash algorithm must be set - to None or sha512. - :param signature_max_validity: The signature max validity, expressed as - a datetime.timedelta value. It must be a positive value. - """ - def __init__(self, key_id, signing_scheme, private_key_path, - private_key_passphrase=None, - signed_headers=None, - signing_algorithm=None, - hash_algorithm=None, - signature_max_validity=None): - self.key_id = key_id - if signing_scheme not in {SCHEME_HS2019, SCHEME_RSA_SHA256, SCHEME_RSA_SHA512}: - raise Exception("Unsupported security scheme: {0}".format(signing_scheme)) - self.signing_scheme = signing_scheme - if not os.path.exists(private_key_path): - raise Exception("Private key file does not exist") - self.private_key_path = private_key_path - self.private_key_passphrase = private_key_passphrase - self.signing_algorithm = signing_algorithm - self.hash_algorithm = hash_algorithm - if signing_scheme == SCHEME_RSA_SHA256: - if self.hash_algorithm is None: - self.hash_algorithm = HASH_SHA256 - elif self.hash_algorithm != HASH_SHA256: - raise Exception("Hash algorithm must be sha256 when security scheme is %s" % - SCHEME_RSA_SHA256) - elif signing_scheme == SCHEME_RSA_SHA512: - if self.hash_algorithm is None: - self.hash_algorithm = HASH_SHA512 - elif self.hash_algorithm != HASH_SHA512: - raise Exception("Hash algorithm must be sha512 when security scheme is %s" % - SCHEME_RSA_SHA512) - elif signing_scheme == SCHEME_HS2019: - if self.hash_algorithm is None: - self.hash_algorithm = HASH_SHA256 - elif self.hash_algorithm not in {HASH_SHA256, HASH_SHA512}: - raise Exception("Invalid hash algorithm") - if signature_max_validity is not None and signature_max_validity.total_seconds() < 0: - raise Exception("The signature max validity must be a positive value") - self.signature_max_validity = signature_max_validity - # If the user has not provided any signed_headers, the default must be set to '(created)', - # as specified in the 'HTTP signature' standard. - if signed_headers is None or len(signed_headers) == 0: - signed_headers = [HEADER_CREATED] - if self.signature_max_validity is None and HEADER_EXPIRES in signed_headers: - raise Exception( - "Signature max validity must be set when " - "'(expires)' signature parameter is specified") - if len(signed_headers) != len(set(signed_headers)): - raise Exception("Cannot have duplicates in the signed_headers parameter") - if HEADER_AUTHORIZATION in signed_headers: - raise Exception("'Authorization' header cannot be included in signed headers") - self.signed_headers = signed_headers - self.private_key = None - """The private key used to sign HTTP requests. - Initialized when the PEM-encoded private key is loaded from a file. - """ - self.host = None - """The host name, optionally followed by a colon and TCP port number. - """ - self._load_private_key() - - def get_http_signature_headers(self, resource_path, method, headers, body, query_params): - """Create a cryptographic message signature for the HTTP request and add the signed headers. - - :param resource_path : A string representation of the HTTP request resource path. - :param method: A string representation of the HTTP request method, e.g. GET, POST. - :param headers: A dict containing the HTTP request headers. - :param body: The object representing the HTTP request body. - :param query_params: A string representing the HTTP request query parameters. - :return: A dict of HTTP headers that must be added to the outbound HTTP request. - """ - if method is None: - raise Exception("HTTP method must be set") - if resource_path is None: - raise Exception("Resource path must be set") - - signed_headers_list, request_headers_dict = self._get_signed_header_info( - resource_path, method, headers, body, query_params) - - header_items = [ - "{0}: {1}".format(key.lower(), value) for key, value in signed_headers_list] - string_to_sign = "\n".join(header_items) - - digest, digest_prefix = self._get_message_digest(string_to_sign.encode()) - b64_signed_msg = self._sign_digest(digest) - - request_headers_dict[HEADER_AUTHORIZATION] = self._get_authorization_header( - signed_headers_list, b64_signed_msg) - - return request_headers_dict - - def get_public_key(self): - """Returns the public key object associated with the private key. - """ - pubkey = None - if isinstance(self.private_key, RSA.RsaKey): - pubkey = self.private_key.publickey() - elif isinstance(self.private_key, ECC.EccKey): - pubkey = self.private_key.public_key() - return pubkey - - def _load_private_key(self): - """Load the private key used to sign HTTP requests. - The private key is used to sign HTTP requests as defined in - https://datatracker.ietf.org/doc/draft-cavage-http-signatures/. - """ - if self.private_key is not None: - return - with open(self.private_key_path, 'r') as f: - pem_data = f.read() - # Verify PEM Pre-Encapsulation Boundary - r = re.compile(r"\s*-----BEGIN (.*)-----\s+") - m = r.match(pem_data) - if not m: - raise ValueError("Not a valid PEM pre boundary") - pem_header = m.group(1) - if pem_header == 'RSA PRIVATE KEY': - self.private_key = RSA.importKey(pem_data, self.private_key_passphrase) - elif pem_header == 'EC PRIVATE KEY': - self.private_key = ECC.import_key(pem_data, self.private_key_passphrase) - elif pem_header in {'PRIVATE KEY', 'ENCRYPTED PRIVATE KEY'}: - # Key is in PKCS8 format, which is capable of holding many different - # types of private keys, not just EC keys. - (key_binary, pem_header, is_encrypted) = \ - PEM.decode(pem_data, self.private_key_passphrase) - (oid, privkey, params) = \ - PKCS8.unwrap(key_binary, passphrase=self.private_key_passphrase) - if oid == '1.2.840.10045.2.1': - self.private_key = ECC.import_key(pem_data, self.private_key_passphrase) - else: - raise Exception("Unsupported key: {0}. OID: {1}".format(pem_header, oid)) - else: - raise Exception("Unsupported key: {0}".format(pem_header)) - # Validate the specified signature algorithm is compatible with the private key. - if self.signing_algorithm is not None: - supported_algs = None - if isinstance(self.private_key, RSA.RsaKey): - supported_algs = {ALGORITHM_RSASSA_PSS, ALGORITHM_RSASSA_PKCS1v15} - elif isinstance(self.private_key, ECC.EccKey): - supported_algs = ALGORITHM_ECDSA_KEY_SIGNING_ALGORITHMS - if supported_algs is not None and self.signing_algorithm not in supported_algs: - raise Exception( - "Signing algorithm {0} is not compatible with private key".format( - self.signing_algorithm)) - - def _get_signed_header_info(self, resource_path, method, headers, body, query_params): - """Build the HTTP headers (name, value) that need to be included in - the HTTP signature scheme. - - :param resource_path : A string representation of the HTTP request resource path. - :param method: A string representation of the HTTP request method, e.g. GET, POST. - :param headers: A dict containing the HTTP request headers. - :param body: The object (e.g. a dict) representing the HTTP request body. - :param query_params: A string representing the HTTP request query parameters. - :return: A tuple containing two dict objects: - The first dict contains the HTTP headers that are used to calculate - the HTTP signature. - The second dict contains the HTTP headers that must be added to - the outbound HTTP request. - """ - - if body is None: - body = '' - else: - body = json.dumps(body) - - # Build the '(request-target)' HTTP signature parameter. - target_host = urlparse(self.host).netloc - target_path = urlparse(self.host).path - request_target = method.lower() + " " + target_path + resource_path - if query_params: - request_target += "?" + urlencode(query_params) - - # Get UNIX time, e.g. seconds since epoch, not including leap seconds. - now = time() - # Format date per RFC 7231 section-7.1.1.2. An example is: - # Date: Wed, 21 Oct 2015 07:28:00 GMT - cdate = formatdate(timeval=now, localtime=False, usegmt=True) - # The '(created)' value MUST be a Unix timestamp integer value. - # Subsecond precision is not supported. - created = int(now) - if self.signature_max_validity is not None: - expires = now + self.signature_max_validity.total_seconds() - - signed_headers_list = [] - request_headers_dict = {} - for hdr_key in self.signed_headers: - hdr_key = hdr_key.lower() - if hdr_key == HEADER_REQUEST_TARGET: - value = request_target - elif hdr_key == HEADER_CREATED: - value = '{0}'.format(created) - elif hdr_key == HEADER_EXPIRES: - value = '{0}'.format(expires) - elif hdr_key == HEADER_DATE.lower(): - value = cdate - request_headers_dict[HEADER_DATE] = '{0}'.format(cdate) - elif hdr_key == HEADER_DIGEST.lower(): - request_body = body.encode() - body_digest, digest_prefix = self._get_message_digest(request_body) - b64_body_digest = b64encode(body_digest.digest()) - value = digest_prefix + b64_body_digest.decode('ascii') - request_headers_dict[HEADER_DIGEST] = '{0}{1}'.format( - digest_prefix, b64_body_digest.decode('ascii')) - elif hdr_key == HEADER_HOST.lower(): - value = target_host - request_headers_dict[HEADER_HOST] = '{0}'.format(target_host) - else: - value = next((v for k, v in headers.items() if k.lower() == hdr_key), None) - if value is None: - raise Exception( - "Cannot sign HTTP request. " - "Request does not contain the '{0}' header".format(hdr_key)) - signed_headers_list.append((hdr_key, value)) - - return signed_headers_list, request_headers_dict - - def _get_message_digest(self, data): - """Calculates and returns a cryptographic digest of a specified HTTP request. - - :param data: The string representation of the date to be hashed with a cryptographic hash. - :return: A tuple of (digest, prefix). - The digest is a hashing object that contains the cryptographic digest of - the HTTP request. - The prefix is a string that identifies the cryptographc hash. It is used - to generate the 'Digest' header as specified in RFC 3230. - """ - if self.hash_algorithm == HASH_SHA512: - digest = SHA512.new() - prefix = 'SHA-512=' - elif self.hash_algorithm == HASH_SHA256: - digest = SHA256.new() - prefix = 'SHA-256=' - else: - raise Exception("Unsupported hash algorithm: {0}".format(self.hash_algorithm)) - digest.update(data) - return digest, prefix - - def _sign_digest(self, digest): - """Signs a message digest with a private key specified in the signing_info. - - :param digest: A hashing object that contains the cryptographic digest of the HTTP request. - :return: A base-64 string representing the cryptographic signature of the input digest. - """ - sig_alg = self.signing_algorithm - if isinstance(self.private_key, RSA.RsaKey): - if sig_alg is None or sig_alg == ALGORITHM_RSASSA_PSS: - # RSASSA-PSS in Section 8.1 of RFC8017. - signature = pss.new(self.private_key).sign(digest) - elif sig_alg == ALGORITHM_RSASSA_PKCS1v15: - # RSASSA-PKCS1-v1_5 in Section 8.2 of RFC8017. - signature = PKCS1_v1_5.new(self.private_key).sign(digest) - else: - raise Exception("Unsupported signature algorithm: {0}".format(sig_alg)) - elif isinstance(self.private_key, ECC.EccKey): - if sig_alg is None: - sig_alg = ALGORITHM_ECDSA_MODE_FIPS_186_3 - if sig_alg in ALGORITHM_ECDSA_KEY_SIGNING_ALGORITHMS: - # draft-ietf-httpbis-message-signatures-00 does not specify the ECDSA encoding. - # Issue: https://github.com/w3c-ccg/http-signatures/issues/107 - signature = DSS.new(key=self.private_key, mode=sig_alg, - encoding='der').sign(digest) - else: - raise Exception("Unsupported signature algorithm: {0}".format(sig_alg)) - else: - raise Exception("Unsupported private key: {0}".format(type(self.private_key))) - return b64encode(signature) - - def _get_authorization_header(self, signed_headers, signed_msg): - """Calculates and returns the value of the 'Authorization' header when signing HTTP requests. - - :param signed_headers : A list of tuples. Each value is the name of a HTTP header that - must be included in the HTTP signature calculation. - :param signed_msg: A base-64 encoded string representation of the signature. - :return: The string value of the 'Authorization' header, representing the signature - of the HTTP request. - """ - created_ts = None - expires_ts = None - for k, v in signed_headers: - if k == HEADER_CREATED: - created_ts = v - elif k == HEADER_EXPIRES: - expires_ts = v - lower_keys = [k.lower() for k, v in signed_headers] - headers_value = " ".join(lower_keys) - - auth_str = "Signature keyId=\"{0}\",algorithm=\"{1}\",".format( - self.key_id, self.signing_scheme) - if created_ts is not None: - auth_str = auth_str + "created={0},".format(created_ts) - if expires_ts is not None: - auth_str = auth_str + "expires={0},".format(expires_ts) - auth_str = auth_str + "headers=\"{0}\",signature=\"{1}\"".format( - headers_value, signed_msg.decode('ascii')) - - return auth_str diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/signing.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/signing.hbs new file mode 100644 index 00000000000..d044d57cb57 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/signing.hbs @@ -0,0 +1,409 @@ +# coding: utf-8 +{{> _helper_header }} + +from base64 import b64encode +from Crypto.IO import PEM, PKCS8 +from Crypto.Hash import SHA256, SHA512 +from Crypto.PublicKey import RSA, ECC +from Crypto.Signature import PKCS1_v1_5, pss, DSS +from email.utils import formatdate +import json +import os +import re +from time import time +from urllib.parse import urlencode, urlparse + +# The constants below define a subset of HTTP headers that can be included in the +# HTTP signature scheme. Additional headers may be included in the signature. + +# The '(request-target)' header is a calculated field that includes the HTTP verb, +# the URL path and the URL query. +HEADER_REQUEST_TARGET = '(request-target)' +# The time when the HTTP signature was generated. +HEADER_CREATED = '(created)' +# The time when the HTTP signature expires. The API server should reject HTTP requests +# that have expired. +HEADER_EXPIRES = '(expires)' +# The 'Host' header. +HEADER_HOST = 'Host' +# The 'Date' header. +HEADER_DATE = 'Date' +# When the 'Digest' header is included in the HTTP signature, the client automatically +# computes the digest of the HTTP request body, per RFC 3230. +HEADER_DIGEST = 'Digest' +# The 'Authorization' header is automatically generated by the client. It includes +# the list of signed headers and a base64-encoded signature. +HEADER_AUTHORIZATION = 'Authorization' + +# The constants below define the cryptographic schemes for the HTTP signature scheme. +SCHEME_HS2019 = 'hs2019' +SCHEME_RSA_SHA256 = 'rsa-sha256' +SCHEME_RSA_SHA512 = 'rsa-sha512' + +# The constants below define the signature algorithms that can be used for the HTTP +# signature scheme. +ALGORITHM_RSASSA_PSS = 'RSASSA-PSS' +ALGORITHM_RSASSA_PKCS1v15 = 'RSASSA-PKCS1-v1_5' + +ALGORITHM_ECDSA_MODE_FIPS_186_3 = 'fips-186-3' +ALGORITHM_ECDSA_MODE_DETERMINISTIC_RFC6979 = 'deterministic-rfc6979' +ALGORITHM_ECDSA_KEY_SIGNING_ALGORITHMS = { + ALGORITHM_ECDSA_MODE_FIPS_186_3, + ALGORITHM_ECDSA_MODE_DETERMINISTIC_RFC6979 +} + +# The cryptographic hash algorithm for the message signature. +HASH_SHA256 = 'sha256' +HASH_SHA512 = 'sha512' + + +class HttpSigningConfiguration(object): + """The configuration parameters for the HTTP signature security scheme. + The HTTP signature security scheme is used to sign HTTP requests with a private key + which is in possession of the API client. + An 'Authorization' header is calculated by creating a hash of select headers, + and optionally the body of the HTTP request, then signing the hash value using + a private key. The 'Authorization' header is added to outbound HTTP requests. + + NOTE: This class is auto generated by OpenAPI JSON Schema Generator + + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + Do not edit the class manually. + + :param key_id: A string value specifying the identifier of the cryptographic key, + when signing HTTP requests. + :param signing_scheme: A string value specifying the signature scheme, when + signing HTTP requests. + Supported value are hs2019, rsa-sha256, rsa-sha512. + Avoid using rsa-sha256, rsa-sha512 as they are deprecated. These values are + available for server-side applications that only support the older + HTTP signature algorithms. + :param private_key_path: A string value specifying the path of the file containing + a private key. The private key is used to sign HTTP requests. + :param private_key_passphrase: A string value specifying the passphrase to decrypt + the private key. + :param signed_headers: A list of strings. Each value is the name of a HTTP header + that must be included in the HTTP signature calculation. + The two special signature headers '(request-target)' and '(created)' SHOULD be + included in SignedHeaders. + The '(created)' header expresses when the signature was created. + The '(request-target)' header is a concatenation of the lowercased :method, an + ASCII space, and the :path pseudo-headers. + When signed_headers is not specified, the client defaults to a single value, + '(created)', in the list of HTTP headers. + When SignedHeaders contains the 'Digest' value, the client performs the + following operations: + 1. Calculate a digest of request body, as specified in RFC3230, section 4.3.2. + 2. Set the 'Digest' header in the request body. + 3. Include the 'Digest' header and value in the HTTP signature. + :param signing_algorithm: A string value specifying the signature algorithm, when + signing HTTP requests. + Supported values are: + 1. For RSA keys: RSASSA-PSS, RSASSA-PKCS1-v1_5. + 2. For ECDSA keys: fips-186-3, deterministic-rfc6979. + If None, the signing algorithm is inferred from the private key. + The default signing algorithm for RSA keys is RSASSA-PSS. + The default signing algorithm for ECDSA keys is fips-186-3. + :param hash_algorithm: The hash algorithm for the signature. Supported values are + sha256 and sha512. + If the signing_scheme is rsa-sha256, the hash algorithm must be set + to None or sha256. + If the signing_scheme is rsa-sha512, the hash algorithm must be set + to None or sha512. + :param signature_max_validity: The signature max validity, expressed as + a datetime.timedelta value. It must be a positive value. + """ + def __init__(self, key_id, signing_scheme, private_key_path, + private_key_passphrase=None, + signed_headers=None, + signing_algorithm=None, + hash_algorithm=None, + signature_max_validity=None): + self.key_id = key_id + if signing_scheme not in {SCHEME_HS2019, SCHEME_RSA_SHA256, SCHEME_RSA_SHA512}: + raise Exception("Unsupported security scheme: {0}".format(signing_scheme)) + self.signing_scheme = signing_scheme + if not os.path.exists(private_key_path): + raise Exception("Private key file does not exist") + self.private_key_path = private_key_path + self.private_key_passphrase = private_key_passphrase + self.signing_algorithm = signing_algorithm + self.hash_algorithm = hash_algorithm + if signing_scheme == SCHEME_RSA_SHA256: + if self.hash_algorithm is None: + self.hash_algorithm = HASH_SHA256 + elif self.hash_algorithm != HASH_SHA256: + raise Exception("Hash algorithm must be sha256 when security scheme is %s" % + SCHEME_RSA_SHA256) + elif signing_scheme == SCHEME_RSA_SHA512: + if self.hash_algorithm is None: + self.hash_algorithm = HASH_SHA512 + elif self.hash_algorithm != HASH_SHA512: + raise Exception("Hash algorithm must be sha512 when security scheme is %s" % + SCHEME_RSA_SHA512) + elif signing_scheme == SCHEME_HS2019: + if self.hash_algorithm is None: + self.hash_algorithm = HASH_SHA256 + elif self.hash_algorithm not in {HASH_SHA256, HASH_SHA512}: + raise Exception("Invalid hash algorithm") + if signature_max_validity is not None and signature_max_validity.total_seconds() < 0: + raise Exception("The signature max validity must be a positive value") + self.signature_max_validity = signature_max_validity + # If the user has not provided any signed_headers, the default must be set to '(created)', + # as specified in the 'HTTP signature' standard. + if signed_headers is None or len(signed_headers) == 0: + signed_headers = [HEADER_CREATED] + if self.signature_max_validity is None and HEADER_EXPIRES in signed_headers: + raise Exception( + "Signature max validity must be set when " + "'(expires)' signature parameter is specified") + if len(signed_headers) != len(set(signed_headers)): + raise Exception("Cannot have duplicates in the signed_headers parameter") + if HEADER_AUTHORIZATION in signed_headers: + raise Exception("'Authorization' header cannot be included in signed headers") + self.signed_headers = signed_headers + self.private_key = None + """The private key used to sign HTTP requests. + Initialized when the PEM-encoded private key is loaded from a file. + """ + self.host = None + """The host name, optionally followed by a colon and TCP port number. + """ + self._load_private_key() + + def get_http_signature_headers(self, resource_path, method, headers, body, query_params): + """Create a cryptographic message signature for the HTTP request and add the signed headers. + + :param resource_path : A string representation of the HTTP request resource path. + :param method: A string representation of the HTTP request method, e.g. GET, POST. + :param headers: A dict containing the HTTP request headers. + :param body: The object representing the HTTP request body. + :param query_params: A string representing the HTTP request query parameters. + :return: A dict of HTTP headers that must be added to the outbound HTTP request. + """ + if method is None: + raise Exception("HTTP method must be set") + if resource_path is None: + raise Exception("Resource path must be set") + + signed_headers_list, request_headers_dict = self._get_signed_header_info( + resource_path, method, headers, body, query_params) + + header_items = [ + "{0}: {1}".format(key.lower(), value) for key, value in signed_headers_list] + string_to_sign = "\n".join(header_items) + + digest, digest_prefix = self._get_message_digest(string_to_sign.encode()) + b64_signed_msg = self._sign_digest(digest) + + request_headers_dict[HEADER_AUTHORIZATION] = self._get_authorization_header( + signed_headers_list, b64_signed_msg) + + return request_headers_dict + + def get_public_key(self): + """Returns the public key object associated with the private key. + """ + pubkey = None + if isinstance(self.private_key, RSA.RsaKey): + pubkey = self.private_key.publickey() + elif isinstance(self.private_key, ECC.EccKey): + pubkey = self.private_key.public_key() + return pubkey + + def _load_private_key(self): + """Load the private key used to sign HTTP requests. + The private key is used to sign HTTP requests as defined in + https://datatracker.ietf.org/doc/draft-cavage-http-signatures/. + """ + if self.private_key is not None: + return + with open(self.private_key_path, 'r') as f: + pem_data = f.read() + # Verify PEM Pre-Encapsulation Boundary + r = re.compile(r"\s*-----BEGIN (.*)-----\s+") + m = r.match(pem_data) + if not m: + raise ValueError("Not a valid PEM pre boundary") + pem_header = m.group(1) + if pem_header == 'RSA PRIVATE KEY': + self.private_key = RSA.importKey(pem_data, self.private_key_passphrase) + elif pem_header == 'EC PRIVATE KEY': + self.private_key = ECC.import_key(pem_data, self.private_key_passphrase) + elif pem_header in {'PRIVATE KEY', 'ENCRYPTED PRIVATE KEY'}: + # Key is in PKCS8 format, which is capable of holding many different + # types of private keys, not just EC keys. + (key_binary, pem_header, is_encrypted) = \ + PEM.decode(pem_data, self.private_key_passphrase) + (oid, privkey, params) = \ + PKCS8.unwrap(key_binary, passphrase=self.private_key_passphrase) + if oid == '1.2.840.10045.2.1': + self.private_key = ECC.import_key(pem_data, self.private_key_passphrase) + else: + raise Exception("Unsupported key: {0}. OID: {1}".format(pem_header, oid)) + else: + raise Exception("Unsupported key: {0}".format(pem_header)) + # Validate the specified signature algorithm is compatible with the private key. + if self.signing_algorithm is not None: + supported_algs = None + if isinstance(self.private_key, RSA.RsaKey): + supported_algs = {ALGORITHM_RSASSA_PSS, ALGORITHM_RSASSA_PKCS1v15} + elif isinstance(self.private_key, ECC.EccKey): + supported_algs = ALGORITHM_ECDSA_KEY_SIGNING_ALGORITHMS + if supported_algs is not None and self.signing_algorithm not in supported_algs: + raise Exception( + "Signing algorithm {0} is not compatible with private key".format( + self.signing_algorithm)) + + def _get_signed_header_info(self, resource_path, method, headers, body, query_params): + """Build the HTTP headers (name, value) that need to be included in + the HTTP signature scheme. + + :param resource_path : A string representation of the HTTP request resource path. + :param method: A string representation of the HTTP request method, e.g. GET, POST. + :param headers: A dict containing the HTTP request headers. + :param body: The object (e.g. a dict) representing the HTTP request body. + :param query_params: A string representing the HTTP request query parameters. + :return: A tuple containing two dict objects: + The first dict contains the HTTP headers that are used to calculate + the HTTP signature. + The second dict contains the HTTP headers that must be added to + the outbound HTTP request. + """ + + if body is None: + body = '' + else: + body = json.dumps(body) + + # Build the '(request-target)' HTTP signature parameter. + target_host = urlparse(self.host).netloc + target_path = urlparse(self.host).path + request_target = method.lower() + " " + target_path + resource_path + if query_params: + request_target += "?" + urlencode(query_params) + + # Get UNIX time, e.g. seconds since epoch, not including leap seconds. + now = time() + # Format date per RFC 7231 section-7.1.1.2. An example is: + # Date: Wed, 21 Oct 2015 07:28:00 GMT + cdate = formatdate(timeval=now, localtime=False, usegmt=True) + # The '(created)' value MUST be a Unix timestamp integer value. + # Subsecond precision is not supported. + created = int(now) + if self.signature_max_validity is not None: + expires = now + self.signature_max_validity.total_seconds() + + signed_headers_list = [] + request_headers_dict = {} + for hdr_key in self.signed_headers: + hdr_key = hdr_key.lower() + if hdr_key == HEADER_REQUEST_TARGET: + value = request_target + elif hdr_key == HEADER_CREATED: + value = '{0}'.format(created) + elif hdr_key == HEADER_EXPIRES: + value = '{0}'.format(expires) + elif hdr_key == HEADER_DATE.lower(): + value = cdate + request_headers_dict[HEADER_DATE] = '{0}'.format(cdate) + elif hdr_key == HEADER_DIGEST.lower(): + request_body = body.encode() + body_digest, digest_prefix = self._get_message_digest(request_body) + b64_body_digest = b64encode(body_digest.digest()) + value = digest_prefix + b64_body_digest.decode('ascii') + request_headers_dict[HEADER_DIGEST] = '{0}{1}'.format( + digest_prefix, b64_body_digest.decode('ascii')) + elif hdr_key == HEADER_HOST.lower(): + value = target_host + request_headers_dict[HEADER_HOST] = '{0}'.format(target_host) + else: + value = next((v for k, v in headers.items() if k.lower() == hdr_key), None) + if value is None: + raise Exception( + "Cannot sign HTTP request. " + "Request does not contain the '{0}' header".format(hdr_key)) + signed_headers_list.append((hdr_key, value)) + + return signed_headers_list, request_headers_dict + + def _get_message_digest(self, data): + """Calculates and returns a cryptographic digest of a specified HTTP request. + + :param data: The string representation of the date to be hashed with a cryptographic hash. + :return: A tuple of (digest, prefix). + The digest is a hashing object that contains the cryptographic digest of + the HTTP request. + The prefix is a string that identifies the cryptographc hash. It is used + to generate the 'Digest' header as specified in RFC 3230. + """ + if self.hash_algorithm == HASH_SHA512: + digest = SHA512.new() + prefix = 'SHA-512=' + elif self.hash_algorithm == HASH_SHA256: + digest = SHA256.new() + prefix = 'SHA-256=' + else: + raise Exception("Unsupported hash algorithm: {0}".format(self.hash_algorithm)) + digest.update(data) + return digest, prefix + + def _sign_digest(self, digest): + """Signs a message digest with a private key specified in the signing_info. + + :param digest: A hashing object that contains the cryptographic digest of the HTTP request. + :return: A base-64 string representing the cryptographic signature of the input digest. + """ + sig_alg = self.signing_algorithm + if isinstance(self.private_key, RSA.RsaKey): + if sig_alg is None or sig_alg == ALGORITHM_RSASSA_PSS: + # RSASSA-PSS in Section 8.1 of RFC8017. + signature = pss.new(self.private_key).sign(digest) + elif sig_alg == ALGORITHM_RSASSA_PKCS1v15: + # RSASSA-PKCS1-v1_5 in Section 8.2 of RFC8017. + signature = PKCS1_v1_5.new(self.private_key).sign(digest) + else: + raise Exception("Unsupported signature algorithm: {0}".format(sig_alg)) + elif isinstance(self.private_key, ECC.EccKey): + if sig_alg is None: + sig_alg = ALGORITHM_ECDSA_MODE_FIPS_186_3 + if sig_alg in ALGORITHM_ECDSA_KEY_SIGNING_ALGORITHMS: + # draft-ietf-httpbis-message-signatures-00 does not specify the ECDSA encoding. + # Issue: https://github.com/w3c-ccg/http-signatures/issues/107 + signature = DSS.new(key=self.private_key, mode=sig_alg, + encoding='der').sign(digest) + else: + raise Exception("Unsupported signature algorithm: {0}".format(sig_alg)) + else: + raise Exception("Unsupported private key: {0}".format(type(self.private_key))) + return b64encode(signature) + + def _get_authorization_header(self, signed_headers, signed_msg): + """Calculates and returns the value of the 'Authorization' header when signing HTTP requests. + + :param signed_headers : A list of tuples. Each value is the name of a HTTP header that + must be included in the HTTP signature calculation. + :param signed_msg: A base-64 encoded string representation of the signature. + :return: The string value of the 'Authorization' header, representing the signature + of the HTTP request. + """ + created_ts = None + expires_ts = None + for k, v in signed_headers: + if k == HEADER_CREATED: + created_ts = v + elif k == HEADER_EXPIRES: + expires_ts = v + lower_keys = [k.lower() for k, v in signed_headers] + headers_value = " ".join(lower_keys) + + auth_str = "Signature keyId=\"{0}\",algorithm=\"{1}\",".format( + self.key_id, self.signing_scheme) + if created_ts is not None: + auth_str = auth_str + "created={0},".format(created_ts) + if expires_ts is not None: + auth_str = auth_str + "expires={0},".format(expires_ts) + auth_str = auth_str + "headers=\"{0}\",signature=\"{1}\"".format( + headers_value, signed_msg.decode('ascii')) + + return auth_str diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/test-requirements.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/test-requirements.handlebars deleted file mode 100644 index 3529726b16d..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/test-requirements.handlebars +++ /dev/null @@ -1,15 +0,0 @@ -{{#if useNose}} -coverage>=4.0.3 -nose>=1.3.7 -pluggy>=0.3.1 -py>=1.4.31 -randomize>=0.13 -{{/if}} -{{#unless useNose}} -pytest~=4.6.7 # needed for python 3.4 -pytest-cov>=2.8.1 -pytest-randomly==1.2.3 # needed for python 3.4 -{{/unless}} -{{#if hasHttpSignatureMethods}} -pycryptodome>=3.9.0 -{{/if}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/test-requirements.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/test-requirements.hbs new file mode 100644 index 00000000000..c33fa20362b --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/test-requirements.hbs @@ -0,0 +1,13 @@ +{{#if useNose}} +coverage>=4.0.3 +nose>=1.3.7 +pluggy>=0.3.1 +py>=1.4.31 +randomize>=0.13 +{{else}} +pytest ~= 7.2.0 +pytest-cov ~= 4.0.0 +{{/if}} +{{#if hasHttpSignatureSecurityScheme}} +pycryptodome>=3.9.0 +{{/if}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/tox.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/tox.handlebars deleted file mode 100644 index b2544b81d41..00000000000 --- a/modules/openapi-json-schema-generator/src/main/resources/python/tox.handlebars +++ /dev/null @@ -1,10 +0,0 @@ -[tox] -envlist = py37 - -[testenv] -passenv = PYTHON_VERSION -deps=-r{toxinidir}/requirements.txt - -r{toxinidir}/test-requirements.txt - -commands= - {{#unless useNose}}pytest --cov={{{packageName}}}{{/unless}}{{#if useNose}}nosetests{{/if}} diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/tox.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/tox.hbs new file mode 100644 index 00000000000..da4ac2b305e --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/tox.hbs @@ -0,0 +1,10 @@ +[tox] +envlist = py37 +isolated_build = True + +[testenv] +passenv = PYTHON_VERSION +deps=-r{toxinidir}/test-requirements.txt + +commands= + {{#unless useNose}}pytest --cov={{{packageName}}}{{/unless}}{{#if useNose}}nosetests{{/if}} diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/travis.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/travis.hbs similarity index 100% rename from modules/openapi-json-schema-generator/src/main/resources/python/travis.handlebars rename to modules/openapi-json-schema-generator/src/main/resources/python/travis.hbs diff --git a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/AbstractIntegrationTest.java b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/AbstractIntegrationTest.java similarity index 88% rename from modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/AbstractIntegrationTest.java rename to modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/AbstractIntegrationTest.java index 81c4978e787..5e9f086e1ce 100644 --- a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/AbstractIntegrationTest.java +++ b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/AbstractIntegrationTest.java @@ -15,10 +15,11 @@ * limitations under the License. */ -package org.openapitools.codegen; +package org.openapijsonschematools.codegen; import io.swagger.v3.oas.models.OpenAPI; -import org.openapitools.codegen.testutils.IntegrationTestPathsConfig; +import org.openapijsonschematools.codegen.testutils.AssertFile; +import org.openapijsonschematools.codegen.testutils.IntegrationTestPathsConfig; import org.testng.annotations.Test; import org.testng.reporters.Files; @@ -26,8 +27,6 @@ import java.util.HashMap; import java.util.Map; -import static org.openapitools.codegen.testutils.AssertFile.assertPathEqualsRecursively; - public abstract class AbstractIntegrationTest { protected abstract IntegrationTestPathsConfig getIntegrationTestPathsConfig(); @@ -66,6 +65,6 @@ public void generatesCorrectDirectoryStructure() throws IOException { codeGen.opts(opts).generate(); - assertPathEqualsRecursively(integrationTestPathsConfig.getExpectedPath(), integrationTestPathsConfig.getOutputPath()); + AssertFile.assertPathEqualsRecursively(integrationTestPathsConfig.getExpectedPath(), integrationTestPathsConfig.getOutputPath()); } } diff --git a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/AbstractOptionsTest.java b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/AbstractOptionsTest.java similarity index 96% rename from modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/AbstractOptionsTest.java rename to modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/AbstractOptionsTest.java index 4e3b98f69a2..ddf8bf0cbf0 100644 --- a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/AbstractOptionsTest.java +++ b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/AbstractOptionsTest.java @@ -15,12 +15,12 @@ * limitations under the License. */ -package org.openapitools.codegen; +package org.openapijsonschematools.codegen; import com.google.common.base.Function; import org.apache.commons.lang3.StringUtils; import org.mockito.MockSettings; -import org.openapitools.codegen.options.OptionsProvider; +import org.openapijsonschematools.codegen.options.OptionsProvider; import org.testng.Assert; import org.testng.annotations.Test; diff --git a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/ArchUnitRulesTest.java b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/ArchUnitRulesTest.java similarity index 96% rename from modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/ArchUnitRulesTest.java rename to modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/ArchUnitRulesTest.java index 1eb57d9014f..f02cfc4d18e 100644 --- a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/ArchUnitRulesTest.java +++ b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/ArchUnitRulesTest.java @@ -1,4 +1,4 @@ -package org.openapitools.codegen; +package org.openapijsonschematools.codegen; import com.tngtech.archunit.core.domain.JavaClasses; import com.tngtech.archunit.core.domain.JavaModifier; @@ -12,7 +12,7 @@ public class ArchUnitRulesTest { private static final JavaClasses CLASSES = new ClassFileImporter() - .importPackages("org.openapitools.codegen.languages"); + .importPackages("org.openapijsonschematools.codegen.languages"); @Test public void testLoggersAreNotPublicFinalAndNotStatic() { diff --git a/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/DefaultCodegenTest.java b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/DefaultCodegenTest.java new file mode 100644 index 00000000000..b53e4b3d058 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/DefaultCodegenTest.java @@ -0,0 +1,3966 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * Copyright 2018 SmartBear Software + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapijsonschematools.codegen; + +import com.google.common.collect.Sets; +import com.samskivert.mustache.Mustache.Lambda; +import io.swagger.parser.OpenAPIParser; +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.Operation; +import io.swagger.v3.oas.models.PathItem; +import io.swagger.v3.oas.models.headers.Header; +import io.swagger.v3.oas.models.media.ArraySchema; +import io.swagger.v3.oas.models.media.Content; +import io.swagger.v3.oas.models.media.IntegerSchema; +import io.swagger.v3.oas.models.media.MapSchema; +import io.swagger.v3.oas.models.media.MediaType; +import io.swagger.v3.oas.models.media.NumberSchema; +import io.swagger.v3.oas.models.media.ObjectSchema; +import io.swagger.v3.oas.models.media.Schema; +import io.swagger.v3.oas.models.media.StringSchema; +import io.swagger.v3.oas.models.parameters.RequestBody; +import io.swagger.v3.oas.models.responses.ApiResponse; +import io.swagger.v3.oas.models.responses.ApiResponses; +import io.swagger.v3.oas.models.security.SecurityScheme; +import io.swagger.v3.parser.core.models.ParseOptions; +import org.openapijsonschematools.codegen.model.CodegenDiscriminator; +import org.openapijsonschematools.codegen.model.CodegenEncoding; +import org.openapijsonschematools.codegen.model.CodegenHeader; +import org.openapijsonschematools.codegen.model.CodegenKey; +import org.openapijsonschematools.codegen.model.CodegenMediaType; +import org.openapijsonschematools.codegen.model.CodegenOperation; +import org.openapijsonschematools.codegen.model.CodegenParameter; +import org.openapijsonschematools.codegen.model.CodegenPathItem; +import org.openapijsonschematools.codegen.model.CodegenRequestBody; +import org.openapijsonschematools.codegen.model.CodegenResponse; +import org.openapijsonschematools.codegen.model.CodegenSchema; +import org.openapijsonschematools.codegen.model.CodegenSecurityScheme; +import org.openapijsonschematools.codegen.model.EnumValue; +import org.openapijsonschematools.codegen.templating.mustache.CamelCaseLambda; +import org.openapijsonschematools.codegen.templating.mustache.IndentedLambda; +import org.openapijsonschematools.codegen.templating.mustache.LowercaseLambda; +import org.openapijsonschematools.codegen.templating.mustache.TitlecaseLambda; +import org.openapijsonschematools.codegen.templating.mustache.UppercaseLambda; +import org.openapijsonschematools.codegen.utils.ModelUtils; +import org.openapijsonschematools.codegen.utils.SemVer; +import org.testng.Assert; +import org.testng.annotations.Ignore; +import org.testng.annotations.Test; + +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Set; +import java.util.TreeMap; +import java.util.TreeSet; +import java.util.stream.Collectors; + +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertFalse; +import static org.testng.Assert.assertNotNull; +import static org.testng.Assert.assertNull; +import static org.testng.Assert.assertTrue; +import static org.testng.Assert.fail; + + +public class DefaultCodegenTest { + private String getOperationPath(String operationPath, String httpMethod) { + return "#/paths/" + ModelUtils.encodeSlashes(operationPath) + "/" + httpMethod; + } + + @Test + public void testDeeplyNestedAdditionalPropertiesImports() { + final DefaultCodegen codegen = new DefaultCodegen(); + final OpenAPI openApi = TestUtils.parseFlattenSpec("src/test/resources/3_0/additional-properties-deeply-nested.yaml"); + codegen.setOpenAPI(openApi); + PathItem path = openApi.getPaths().get("/ping"); + CodegenOperation operation = codegen.fromOperation(path.getPost(), getOperationPath("/ping", "post")); + Assert.assertEquals(operation.responses.get("default").imports, null); + } + + @Test + public void testRefedEnumParameter() { + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.addSchemaImportsFromV3SpecLocations = true; + final OpenAPI openApi = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_12445.yaml"); + codegen.setOpenAPI(openApi); + PathItem path = openApi.getPaths().get("/pets/petType/{type}"); + codegen.fromSchema( + openApi.getComponents().getSchemas().get("PetByType"), + "#/components/schemas/PetByType", + "#/components/schemas/PetByType" + ); + CodegenOperation operation = codegen.fromOperation(path.getGet(), getOperationPath("/pets/petType/{type}", "get")); + assertEquals(operation.pathParams.get(0).imports, null); + assertEquals(operation.pathParams.get(0).schema.imports.size(), 1); + Assert.assertTrue(operation.pathParams.get(0).schema.refInfo.ref.enumValueToName != null); + } + + @Test + public void testHasBodyParameter() { + final Schema refSchema = new Schema<>().$ref("#/components/schemas/Pet"); + Operation pingOperation = new Operation() + .responses( + new ApiResponses().addApiResponse("204", new ApiResponse() + .description("Ok response"))); + Operation createOperation = new Operation() + .requestBody(new RequestBody() + .content(new Content().addMediaType("application/json", + new MediaType().schema(refSchema)))) + .responses( + new ApiResponses().addApiResponse("201", new ApiResponse() + .description("Created response"))); + OpenAPI openAPI = new OpenAPI(); + openAPI.setComponents(new Components()); + openAPI.getComponents().addSchemas("Pet", new ObjectSchema()); + + final DefaultCodegen codegen = new DefaultCodegen(); + + Assert.assertFalse(codegen.hasBodyParameter(openAPI, pingOperation)); + Assert.assertTrue(codegen.hasBodyParameter(openAPI, createOperation)); + } + + @Test(expectedExceptions = RuntimeException.class) + public void testParameterEmptyDescription() { + DefaultCodegen codegen = new DefaultCodegen(); + + codegen.fromRequestBody(null, null); + } + + @Test + public void testGetConsumesInfoAndGetProducesInfo() throws Exception { + final Schema refSchema = new Schema<>().$ref("#/components/schemas/Pet"); + OpenAPI openAPI = new OpenAPI(); + openAPI.setComponents(new Components()); + openAPI.getComponents().addSchemas("Pet", new ObjectSchema()); + openAPI.getComponents().addRequestBodies("MyRequestBody", new RequestBody() + .content(new Content().addMediaType("application/json", + new MediaType().schema(refSchema)))); + openAPI.getComponents().addResponses("MyResponse", new ApiResponse() + .description("Ok response") + .content(new Content().addMediaType("application/xml", + new MediaType().schema(refSchema)))); + + Operation createOperation = new Operation() + .requestBody(new RequestBody() + .content(new Content() + .addMediaType("application/json", new MediaType().schema(refSchema)) + .addMediaType("application/xml", new MediaType().schema(refSchema)) + )) + .responses( + new ApiResponses().addApiResponse("201", new ApiResponse() + .description("Created response"))); + Set createConsumesInfo = DefaultCodegen.getConsumesInfo(openAPI, createOperation); + Assert.assertEquals(createConsumesInfo.size(), 2); + Assert.assertTrue(createConsumesInfo.contains("application/json"), "contains 'application/json'"); + Assert.assertTrue(createConsumesInfo.contains("application/xml"), "contains 'application/xml'"); + Set createProducesInfo = DefaultCodegen.getProducesInfo(openAPI, createOperation); + Assert.assertEquals(createProducesInfo.size(), 0); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + CodegenOperation coCreate = codegen.fromOperation(createOperation, getOperationPath("somepath", "post")); + Assert.assertTrue(!coCreate.requestBody.content.isEmpty()); + Assert.assertEquals(coCreate.requestBody.content.size(), 2); + Assert.assertNull(coCreate.produces); + + Operation updateOperationWithRef = new Operation() + .requestBody(new RequestBody().$ref("#/components/requestBodies/MyRequestBody")) + .responses(new ApiResponses().addApiResponse("201", new ApiResponse().$ref("#/components/responses/MyResponse"))); + Set updateConsumesInfo = DefaultCodegen.getConsumesInfo(openAPI, updateOperationWithRef); + Assert.assertEquals(updateConsumesInfo.size(), 1); + Assert.assertTrue(updateConsumesInfo.contains("application/json"), "contains 'application/json'"); + Set updateProducesInfo = DefaultCodegen.getProducesInfo(openAPI, updateOperationWithRef); + Assert.assertEquals(updateProducesInfo.size(), 1); + Assert.assertTrue(updateProducesInfo.contains("application/xml"), "contains 'application/xml'"); + + CodegenOperation coUpdate = codegen.fromOperation(updateOperationWithRef, getOperationPath("somepath", "post")); + Assert.assertTrue(!coUpdate.requestBody.content.isEmpty()); + Assert.assertEquals(coUpdate.requestBody.content.size(), 2); + CodegenKey ck = codegen.getKey("application/json"); + Assert.assertTrue(coUpdate.requestBody.content.containsKey(ck)); + Assert.assertTrue(!coUpdate.produces.isEmpty()); + Assert.assertEquals(coUpdate.produces.size(), 1); + Assert.assertTrue(coUpdate.produces.contains("application/xml")); + } + + @Test + public void testGetProducesInfo() throws Exception { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/produces.yaml"); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + + Operation textOperation = openAPI.getPaths().get("/ping/text").getGet(); + CodegenOperation coText = codegen.fromOperation(textOperation, getOperationPath("/ping/text", "get")); + Assert.assertTrue(!coText.produces.isEmpty()); + Assert.assertEquals(coText.produces.size(), 1); + Assert.assertTrue(coText.produces.contains("text/plain")); + + Operation jsonOperation = openAPI.getPaths().get("/ping/json").getGet(); + CodegenOperation coJson = codegen.fromOperation(jsonOperation, getOperationPath("/ping/json", "get")); + Assert.assertTrue(!coJson.produces.isEmpty()); + Assert.assertEquals(coJson.produces.size(), 1); + Assert.assertTrue(coJson.produces.contains("application/json")); + + Operation issue443Operation = openAPI.getPaths().get("/other/issue443").getGet(); + CodegenOperation coIssue443 = codegen.fromOperation(issue443Operation, getOperationPath("/other/issue443", "get")); + Assert.assertTrue(!coIssue443.produces.isEmpty()); + Assert.assertEquals(coIssue443.produces.size(), 2); + Assert.assertTrue(coIssue443.produces.contains("application/json")); + Assert.assertTrue(coIssue443.produces.contains("application/text")); + } + + @Test + public void testInitialConfigValues() throws Exception { + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.processOpts(); + + Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.TRUE); + Assert.assertTrue(codegen.isHideGenerationTimestamp()); + } + + @Test + public void testSettersForConfigValues() throws Exception { + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setHideGenerationTimestamp(false); + codegen.processOpts(); + + Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.FALSE); + Assert.assertFalse(codegen.isHideGenerationTimestamp()); + } + + @Test + public void testAdditionalPropertiesPutForConfigValues() throws Exception { + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.additionalProperties().put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, false); + codegen.processOpts(); + + Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.FALSE); + Assert.assertFalse(codegen.isHideGenerationTimestamp()); + } + + @Test + public void testDateTimeFormParameterHasDefaultValue() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/spring/date-time-parameter-types-for-testing.yml"); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + + RequestBody reqBody = openAPI.getPaths().get("/thingy/{date}").getPost().getRequestBody(); + CodegenRequestBody codegenParameter = codegen.fromRequestBody(reqBody, "#/paths/~1thingy~1{date}/post/requestBody"); + + CodegenKey ck = codegen.getKey("application/x-www-form-urlencoded"); + Assert.assertNull(codegenParameter.content.get(ck).schema.refInfo); + + CodegenKey propertyKey = codegen.getKey("visitDate"); + assertEquals(codegenParameter.content.get(ck).schema.properties.get(propertyKey).defaultValue.value.toString(), "1971-12-19T03:39:57-08:00"); + } + + @Test + public void testOriginalOpenApiDocumentVersion() { + // Test with OAS 2.0 document. + String location = "src/test/resources/2_0/python-prior/petstore-with-fake-endpoints-models-for-testing.yaml"; + OpenAPI openAPI = TestUtils.parseFlattenSpec(location); + SemVer version = ModelUtils.getOpenApiVersion(openAPI, location, null); + Assert.assertEquals(version, new SemVer("2.0.0")); + + // Test with OAS 3.0 document. + location = "src/test/resources/3_0/python/petstore_customized.yaml"; + openAPI = TestUtils.parseFlattenSpec(location); + version = ModelUtils.getOpenApiVersion(openAPI, location, null); + Assert.assertEquals(version, new SemVer("3.0.0")); + } + + @Test + public void testAdditionalPropertiesV3SpecDisallowAdditionalPropertiesIfNotPresentFalse() { + OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/python/petstore_customized.yaml"); + DefaultCodegen codegen = new DefaultCodegen(); + codegen.setDisallowAdditionalPropertiesIfNotPresent(false); + codegen.supportsAdditionalPropertiesWithComposedSchema = true; + codegen.setOpenAPI(openAPI); + + Schema componentSchema = openAPI.getComponents().getSchemas().get("AdditionalPropertiesClass"); + Assert.assertNull(componentSchema.getAdditionalProperties()); + + // When the 'additionalProperties' keyword is not present, the schema may be + // extended with any undeclared properties. + Schema addProps = ModelUtils.getAdditionalProperties(openAPI, componentSchema); + Assert.assertNotNull(addProps); + Assert.assertEquals(addProps, new Schema()); + CodegenSchema cm = codegen.fromSchema( + componentSchema, + "#/components/schemas/AdditionalPropertiesClass", + "#/components/schemas/AdditionalPropertiesClass" + ); + Assert.assertNull(cm.additionalProperties); + + Map modelPropSchemas = componentSchema.getProperties(); + Schema map_with_undeclared_properties_string_sc = modelPropSchemas.get("map_with_undeclared_properties_string"); + CodegenSchema map_with_undeclared_properties_string_cp = null; + Schema map_with_undeclared_properties_anytype_1_sc = modelPropSchemas.get("map_with_undeclared_properties_anytype_1"); + CodegenSchema map_with_undeclared_properties_anytype_1_cp = null; + Schema map_with_undeclared_properties_anytype_2_sc = modelPropSchemas.get("map_with_undeclared_properties_anytype_2"); + CodegenSchema map_with_undeclared_properties_anytype_2_cp = null; + Schema map_with_undeclared_properties_anytype_3_sc = modelPropSchemas.get("map_with_undeclared_properties_anytype_3"); + CodegenSchema map_with_undeclared_properties_anytype_3_cp = null; + Schema empty_map_sc = modelPropSchemas.get("empty_map"); + CodegenSchema empty_map_cp = null; + + for (CodegenSchema cp : cm.properties.values()) { + if ("map_with_undeclared_properties_string".equals(cp.jsonPathPiece.original)) { + map_with_undeclared_properties_string_cp = cp; + } else if ("map_with_undeclared_properties_anytype_1".equals(cp.jsonPathPiece.original)) { + map_with_undeclared_properties_anytype_1_cp = cp; + } else if ("map_with_undeclared_properties_anytype_2".equals(cp.jsonPathPiece.original)) { + map_with_undeclared_properties_anytype_2_cp = cp; + } else if ("map_with_undeclared_properties_anytype_3".equals(cp.jsonPathPiece.original)) { + map_with_undeclared_properties_anytype_3_cp = cp; + } else if ("empty_map".equals(cp.jsonPathPiece.original)) { + empty_map_cp = cp; + } + } + + // map_with_undeclared_properties_string + // This property has the following inline schema. + // additionalProperties: + // type: string + Assert.assertNotNull(map_with_undeclared_properties_string_sc); + Assert.assertNotNull(map_with_undeclared_properties_string_sc.getAdditionalProperties()); + Assert.assertNotNull(map_with_undeclared_properties_string_cp.additionalProperties); + + // map_with_undeclared_properties_anytype_1 + // This property does not use the additionalProperties keyword, + // which means by default undeclared properties are allowed. + Assert.assertNotNull(map_with_undeclared_properties_anytype_1_sc); + Assert.assertNull(map_with_undeclared_properties_anytype_1_sc.getAdditionalProperties()); + addProps = ModelUtils.getAdditionalProperties(openAPI, map_with_undeclared_properties_anytype_1_sc); + Assert.assertNotNull(addProps); + Assert.assertEquals(addProps, new Schema()); + Assert.assertNull(map_with_undeclared_properties_anytype_1_cp.additionalProperties); + + // map_with_undeclared_properties_anytype_2 + // This property does not use the additionalProperties keyword, + // which means by default undeclared properties are allowed. + Assert.assertNotNull(map_with_undeclared_properties_anytype_2_sc); + Assert.assertNull(map_with_undeclared_properties_anytype_2_sc.getAdditionalProperties()); + addProps = ModelUtils.getAdditionalProperties(openAPI, map_with_undeclared_properties_anytype_2_sc); + Assert.assertNotNull(addProps); + Assert.assertEquals(addProps, new Schema()); + Assert.assertNull(map_with_undeclared_properties_anytype_2_cp.additionalProperties); + + // map_with_undeclared_properties_anytype_3 + // This property has the following inline schema. + // additionalProperties: true + Assert.assertNotNull(map_with_undeclared_properties_anytype_3_sc); + // Unlike the V2 spec, in V3 we CAN differentiate between 'additionalProperties' not present and + // additionalProperties: true. + Assert.assertNotNull(map_with_undeclared_properties_anytype_3_sc.getAdditionalProperties()); + Assert.assertEquals(map_with_undeclared_properties_anytype_3_sc.getAdditionalProperties(), Boolean.TRUE); + addProps = ModelUtils.getAdditionalProperties(openAPI, map_with_undeclared_properties_anytype_3_sc); + Assert.assertNotNull(addProps); + Assert.assertEquals(addProps, new Schema()); + Assert.assertNotNull(map_with_undeclared_properties_anytype_3_cp.additionalProperties); + Assert.assertTrue(map_with_undeclared_properties_anytype_3_cp.additionalProperties.isBooleanSchemaTrue); + + // empty_map + // This property has the following inline schema. + // additionalProperties: false + Assert.assertNotNull(empty_map_sc); + // Unlike the V2 spec, in V3 we CAN differentiate between 'additionalProperties' not present and + // additionalProperties: false. + Assert.assertNotNull(empty_map_sc.getAdditionalProperties()); + Assert.assertEquals(empty_map_sc.getAdditionalProperties(), Boolean.FALSE); + addProps = ModelUtils.getAdditionalProperties(openAPI, empty_map_sc); + Assert.assertNull(addProps); + Assert.assertNotNull(empty_map_cp.additionalProperties); + Assert.assertTrue(empty_map_cp.additionalProperties.isBooleanSchemaFalse); + + // check of composed schema model + String schemaName = "SomeObject"; + Schema schema = openAPI.getComponents().getSchemas().get(schemaName); + cm = codegen.fromSchema( + schema, + "#/components/schemas/" + schemaName, + "#/components/schemas/" + schemaName + ); + Assert.assertNull(cm.additionalProperties); + } + + @Test + public void testAdditionalPropertiesV3SpecDisallowAdditionalPropertiesIfNotPresentTrue() { + // As per OAS spec, when the 'additionalProperties' keyword is not present, the schema may be + // extended with any undeclared properties. + // However, in legacy 'additionalProperties' mode, this is interpreted as + // 'no additional properties are allowed'. + OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml"); + DefaultCodegen codegen = new DefaultCodegen(); + codegen.setDisallowAdditionalPropertiesIfNotPresent(true); + codegen.setOpenAPI(openAPI); + + Schema schema = openAPI.getComponents().getSchemas().get("AdditionalPropertiesClass"); + Assert.assertNull(schema.getAdditionalProperties()); + + Schema addProps = ModelUtils.getAdditionalProperties(openAPI, schema); + Assert.assertNull(addProps); + } + + @Test + public void testEnsureNoDuplicateProduces() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/two-responses.yaml"); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + + Operation operation = openAPI.getPaths().get("/test").getGet(); + CodegenOperation co = codegen.fromOperation(operation, getOperationPath("/test", "get")); + + Assert.assertEquals(co.produces.size(), 1); + Assert.assertTrue(co.produces.contains("application/json")); + } + + @Test + public void testComposedSchemaOneOfWithProperties() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/oneOf.yaml"); + final DefaultCodegen codegen = new DefaultCodegen(); + + final Schema schema = openAPI.getComponents().getSchemas().get("fruit"); + codegen.setOpenAPI(openAPI); + CodegenSchema fruit = codegen.fromSchema( + schema, + "#/components/schemas/fruit", + "#/components/schemas/fruit" + ); + + Assert.assertEquals(fruit.oneOf.get(0).refInfo.refClass, "Apple"); + Assert.assertEquals(fruit.oneOf.get(1).refInfo.refClass, "Banana"); + assertEquals(fruit.optionalProperties.size(), 1); + } + + + @Test + public void testEscapeText() { + final DefaultCodegen codegen = new DefaultCodegen(); + + Assert.assertEquals(codegen.escapeText("\n"), " "); + Assert.assertEquals(codegen.escapeText("\r"), " "); + Assert.assertEquals(codegen.escapeText("\t"), " "); + Assert.assertEquals(codegen.escapeText("\\"), "\\\\"); + Assert.assertEquals(codegen.escapeText("\""), "\\\""); + Assert.assertEquals(codegen.escapeText("\\/"), "/"); + } + + @Test + public void testEscapeTextWhileAllowingNewLines() { + final DefaultCodegen codegen = new DefaultCodegen(); + + // allow new lines + Assert.assertEquals(codegen.escapeTextWhileAllowingNewLines("\n"), "\n"); + Assert.assertEquals(codegen.escapeTextWhileAllowingNewLines("\r"), "\r"); + + // escape other special characters + Assert.assertEquals(codegen.escapeTextWhileAllowingNewLines("\t"), " "); + Assert.assertEquals(codegen.escapeTextWhileAllowingNewLines("\\"), "\\\\"); + Assert.assertEquals(codegen.escapeTextWhileAllowingNewLines("\""), "\\\""); + Assert.assertEquals(codegen.escapeTextWhileAllowingNewLines("\\/"), "/"); + } + + @Test + public void updateCodegenPropertyEnum() { + CodegenSchema array = codegenPropertyWithArrayOfIntegerValues(); + + Map enumVars = array.items.enumValueToName; + Assert.assertNotNull(enumVars); + Assert.assertEquals(enumVars.size(), 1); + EnumValue key = new EnumValue(1, "integer", null); + Assert.assertEquals(enumVars.get(key), "_1"); + } + + @Test + public void updateCodegenPropertyEnumWithExtension() { + DefaultCodegen codegen = new DefaultCodegen(); + { + CodegenSchema enumProperty = codegenProperty(codegen, Arrays.asList("dog", "cat"), "updateCodegenPropertyEnumWithExtension1", Arrays.asList("DOGVAR", "CATVAR")); + LinkedHashMap enumVars = enumProperty.items.enumValueToName; + Assert.assertNotNull(enumVars); + Assert.assertEquals(enumVars.get(new EnumValue("dog", "string", null)), "DOGVAR"); + Assert.assertEquals(enumVars.get(new EnumValue("cat", "string", null)), "CATVAR"); + } + { + CodegenSchema enumProperty = codegenProperty(codegen, Arrays.asList("1", "2"), "updateCodegenPropertyEnumWithExtension2", Arrays.asList("ONE", "TWO")); + LinkedHashMap enumVars = enumProperty.items.enumValueToName; + Assert.assertEquals(enumVars.get(new EnumValue("1", "string", null)), "ONE"); + Assert.assertEquals(enumVars.get(new EnumValue("2", "string", null)), "TWO"); + } + { + CodegenSchema enumProperty = codegenProperty(codegen, Arrays.asList("a", "b", "c", "d"), "updateCodegenPropertyEnumWithExtension3", Arrays.asList("FOO", "BAR")); + LinkedHashMap enumVars = enumProperty.items.enumValueToName; + Assert.assertEquals(enumVars.get(new EnumValue("a", "string", null)), "FOO"); + Assert.assertEquals(enumVars.get(new EnumValue("b", "string", null)), "BAR"); + Assert.assertEquals(enumVars.get(new EnumValue("c", "string", null)), "C"); + Assert.assertEquals(enumVars.get(new EnumValue("d", "string", null)), "D"); + } + { + CodegenSchema enumProperty = codegenProperty(codegen, Arrays.asList("a", "b"), "updateCodegenPropertyEnumWithExtension3", Arrays.asList("FOO", "BAR", "BAZ")); + LinkedHashMap enumVars = enumProperty.items.enumValueToName; + Assert.assertEquals(enumVars.get(new EnumValue("a", "string", null)), "FOO"); + Assert.assertEquals(enumVars.get(new EnumValue("b", "string", null)), "BAR"); + Assert.assertEquals(enumVars.size(), 2); + } + } + + @Test + public void updateCodegenPropertyEnumWithPrefixRemoved() { + DefaultCodegen codegen = new DefaultCodegen(); + CodegenSchema enumProperty = codegenProperty(codegen, Arrays.asList("animal_dog", "animal_cat"), "updateCodegenPropertyEnumWithPrefixRemoved", null); + + Map enumVars = enumProperty.items.enumValueToName; + Assert.assertNotNull(enumVars); + Assert.assertEquals(enumVars.get(new EnumValue("animal_dog", "string", null)), "DOG"); + Assert.assertEquals(enumVars.get(new EnumValue("animal_cat", "string", null)), "CAT"); + } + + @Test + public void updateCodegenPropertyEnumWithoutPrefixRemoved() { + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setRemoveEnumValuePrefix(false); + + CodegenSchema enumProperty = codegenProperty(codegen, Arrays.asList("animal_dog", "animal_cat"), "updateCodegenPropertyEnumWithoutPrefixRemoved", null); + + Map enumVars = enumProperty.items.enumValueToName; + Assert.assertNotNull(enumVars); + Assert.assertEquals(enumVars.get(new EnumValue("animal_dog", "string", null)), "ANIMAL_DOG"); + Assert.assertEquals(enumVars.get(new EnumValue("animal_cat", "string", null)), "ANIMAL_CAT"); + } + + @Test + public void postProcessModelsEnumWithPrefixRemoved() { + final DefaultCodegen codegen = new DefaultCodegen(); + TreeMap schemas = codegenModel(codegen, Arrays.asList("animal_dog", "animal_cat"), "postProcessModelsEnumWithPrefixRemoved", null, null); + CodegenSchema cm = schemas.get("model"); + + Map enumVars = cm.enumValueToName; + Assert.assertNotNull(enumVars); + Assert.assertEquals(enumVars.get(new EnumValue("animal_dog", "string", null)), "DOG"); + Assert.assertEquals(enumVars.get(new EnumValue("animal_cat", "string", null)), "CAT"); + } + + @Test + public void postProcessModelsEnumWithoutPrefixRemoved() { + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setRemoveEnumValuePrefix(false); + TreeMap objs = codegenModel(codegen, Arrays.asList("animal_dog", "animal_cat"), "postProcessModelsEnumWithoutPrefixRemoved", null, null); + CodegenSchema cm = objs.get("model"); + + Map enumVars = cm.enumValueToName; + Assert.assertNotNull(enumVars); + Assert.assertEquals(enumVars.get(new EnumValue("animal_dog", "string", null)), "ANIMAL_DOG"); + Assert.assertEquals(enumVars.get(new EnumValue("animal_cat", "string", null)), "ANIMAL_CAT"); + } + + @Test + public void postProcessModelsEnumWithExtension() { + final DefaultCodegen codegen = new DefaultCodegen(); + TreeMap objs = codegenModel(codegen, Arrays.asList("animal_dog", "animal_cat"), "postProcessModelsEnumWithExtension", Arrays.asList("DOGVAR", "CATVAR"), Arrays.asList("This is a dog", "This is a cat")); + CodegenSchema cm = objs.get("model"); + + Map enumVars = cm.enumValueToName; + Assert.assertNotNull(enumVars); + Assert.assertEquals(enumVars.get(new EnumValue("animal_dog", "string", "This is a dog")), "DOGVAR"); + Assert.assertEquals(enumVars.get(new EnumValue("animal_cat", "string", "This is a cat")), "CATVAR"); + } + + @Test + public void testExample1() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/examples.yaml"); + final DefaultCodegen codegen = new DefaultCodegen(); + + PathItem path = openAPI.getPaths().get("/example1/singular"); + CodegenOperation op = codegen.fromOperation(path.getGet(), getOperationPath("/example1/singular", "get")); + assertEquals(op.queryParams.get(0).example, "example1 value"); + + path = openAPI.getPaths().get("/example1/plural"); + op = codegen.fromOperation(path.getGet(), getOperationPath("/example1/plural", "get")); + assertEquals(op.queryParams.get(0).example, "An example1 value"); + } + + @Test + public void testExample2() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/examples.yaml"); + final DefaultCodegen codegen = new DefaultCodegen(); + + PathItem path = openAPI.getPaths().get("/example2/singular"); + CodegenOperation op = codegen.fromOperation(path.getGet(), getOperationPath("/example2/singular", "get")); + assertEquals(op.queryParams.get(0).example, "example2 value"); + } + + @Test + public void testExample3() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/examples.yaml"); + final DefaultCodegen codegen = new DefaultCodegen(); + + PathItem path = openAPI.getPaths().get("/example3/singular"); + CodegenOperation op = codegen.fromOperation(path.getGet(), getOperationPath("/example3/singular", "get")); + assertEquals(op.queryParams.get(0).example, "example3: parameter value"); + + path = openAPI.getPaths().get("/example3/plural"); + op = codegen.fromOperation(path.getGet(), getOperationPath("/example3/plural", "get")); + assertEquals(op.queryParams.get(0).example, "An example3 value"); + } + + @Test + public void testDiscriminator() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml"); + DefaultCodegen codegen = new DefaultCodegen(); + + Schema animal = openAPI.getComponents().getSchemas().get("Animal"); + codegen.setOpenAPI(openAPI); + CodegenSchema animalModel = codegen.fromSchema( + animal, + "#/components/schemas/Animal", + "#/components/schemas/Animal" + ); + CodegenDiscriminator discriminator = animalModel.discriminator; + String propertyName = "className"; + String propertyBaseName = "className"; + TreeSet mappedModels = new TreeSet<>(); + mappedModels.add(new CodegenDiscriminator.MappedModel("BigCat", "BigCat")); + mappedModels.add(new CodegenDiscriminator.MappedModel("Cat", "Cat")); + mappedModels.add(new CodegenDiscriminator.MappedModel("Dog", "Dog")); + + CodegenKey ck = codegen.getKey(propertyName); + CodegenDiscriminator expectedDiscriminator = new CodegenDiscriminator(ck, null, mappedModels); + Assert.assertEquals(discriminator, expectedDiscriminator); + assertEquals(animalModel.hasDiscriminatorWithNonEmptyMapping(), true); + } + + @Test + public void testDiscriminatorWithCustomMapping() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/allOf.yaml"); + DefaultCodegen codegen = new DefaultCodegen(); + codegen.setLegacyDiscriminatorBehavior(false); + codegen.setOpenAPI(openAPI); + + Schema person = openAPI.getComponents().getSchemas().get("Person"); + codegen.setOpenAPI(openAPI); + CodegenSchema personModel = codegen.fromSchema( + person, + "#/components/schemas/Person", + "#/components/schemas/Person" + ); + verifyPersonDiscriminator(personModel.discriminator); + assertEquals(personModel.hasDiscriminatorWithNonEmptyMapping(), true); + } + + @Test + public void testAllOfRequired() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/allOf-required.yaml"); + DefaultCodegen codegen = new DefaultCodegen(); + + Schema child = openAPI.getComponents().getSchemas().get("clubForCreation"); + codegen.setOpenAPI(openAPI); + CodegenSchema childModel = codegen.fromSchema( + child, + "#/components/schemas/clubForCreation", + "#/components/schemas/clubForCreation" + ); + assertEquals(childModel.requiredProperties.size(), 1); + } + + @Test + public void testComposedSchemaAllOfDiscriminatorMap() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/allOf_composition_discriminator.yaml"); + DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + codegen.setLegacyDiscriminatorBehavior(false); + Schema sc; + String modelName; + + String propertyName = "petType"; + String propertyBaseName = propertyName; + CodegenKey ck = codegen.getKey(propertyName); + CodegenDiscriminator emptyMapDisc = new CodegenDiscriminator(ck, null, new TreeSet<>()); + + // all leaf Schemas have discriminators with PropertyName/BaseName + empty discriminator maps + List leafModelNames = Arrays.asList("Cat", "Dog", "Lizard", "Snake"); + for (String leafModelName : leafModelNames) { + Schema leafSc = openAPI.getComponents().getSchemas().get(leafModelName); + CodegenSchema leafCm = codegen.fromSchema( + leafSc, + "#/components/schemas/" + leafModelName, + "#/components/schemas/" + leafModelName + ); + assertEquals(leafCm.discriminator, emptyMapDisc); + assertEquals(leafCm.hasDiscriminatorWithNonEmptyMapping(), false); + } + + // the Pet discriminator map contains all animals + Reptile (children + grandchildren) + TreeSet hs = new TreeSet<>(); + for (String leafModelName : leafModelNames) { + hs.add(new CodegenDiscriminator.MappedModel(leafModelName, codegen.toModelName(leafModelName, null))); + } + hs.add(new CodegenDiscriminator.MappedModel("Reptile", codegen.toModelName("Reptile", null))); + + CodegenKey petDiscPropName = codegen.getKey(propertyName); + CodegenDiscriminator petDisc = new CodegenDiscriminator(petDiscPropName, null, hs); + modelName = "Pet"; + sc = openAPI.getComponents().getSchemas().get(modelName); + CodegenSchema pet = codegen.fromSchema( + sc, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + assertEquals(pet.hasDiscriminatorWithNonEmptyMapping(), true); + assertEquals(pet.discriminator, petDisc); + + // the Reptile discriminator contains both reptiles + List reptileModelNames = Arrays.asList("Lizard", "Snake"); + hs.clear(); + for (String reptileModelName : reptileModelNames) { + hs.add(new CodegenDiscriminator.MappedModel(reptileModelName, codegen.toModelName(reptileModelName, null))); + } + CodegenKey reptileDiscPropName = codegen.getKey(propertyName); + CodegenDiscriminator reptileDisc = new CodegenDiscriminator(reptileDiscPropName, null, hs); + modelName = "Reptile"; + sc = openAPI.getComponents().getSchemas().get(modelName); + CodegenSchema reptile = codegen.fromSchema( + sc, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + assertEquals(reptile.hasDiscriminatorWithNonEmptyMapping(), true); + assertEquals(reptile.discriminator, reptileDisc); + + // the MyPets discriminator contains Cat and Lizard + List myPetNames = Arrays.asList("Cat", "Lizard"); + hs.clear(); + for (String myPetName : myPetNames) { + hs.add(new CodegenDiscriminator.MappedModel(myPetName, codegen.toModelName(myPetName, null))); + } + CodegenKey myPetDiscPropName = codegen.getKey(propertyName); + CodegenDiscriminator myPetDisc = new CodegenDiscriminator(myPetDiscPropName, null, hs); + modelName = "MyPets"; + sc = openAPI.getComponents().getSchemas().get(modelName); + CodegenSchema myPets = codegen.fromSchema( + sc, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + assertEquals(myPets.hasDiscriminatorWithNonEmptyMapping(), true); + assertEquals(myPets.discriminator, myPetDisc); + + // the MyPetsNoDisc discriminator is created because all oneOf classes have the same discriminator + modelName = "MyPetsNoDisc"; + sc = openAPI.getComponents().getSchemas().get(modelName); + CodegenSchema myPetsNoDisc = codegen.fromSchema( + sc, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + assertEquals(myPetsNoDisc.hasDiscriminatorWithNonEmptyMapping(), true); + assertEquals(myPetsNoDisc.discriminator, myPetDisc); + + CodegenSchema cm; + + // the mapping in b is in A + modelName = "A"; + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromSchema( + sc, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + hs.clear(); + hs.add(new CodegenDiscriminator.MappedModel("b", codegen.toModelName("B", null))); + hs.add(new CodegenDiscriminator.MappedModel("B", codegen.toModelName("B", null))); + hs.add(new CodegenDiscriminator.MappedModel("C", codegen.toModelName("C", null))); + assertEquals(cm.hasDiscriminatorWithNonEmptyMapping(), true); + assertEquals(cm.discriminator.mappedModels, hs); + + // the mapping in b is in B + modelName = "B"; + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromSchema( + sc, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + hs.clear(); + hs.add(new CodegenDiscriminator.MappedModel("b", codegen.toModelName("B", null))); + hs.add(new CodegenDiscriminator.MappedModel("C", codegen.toModelName("C", null))); + assertEquals(cm.hasDiscriminatorWithNonEmptyMapping(), true); + assertEquals(cm.discriminator.mappedModels, hs); + + // the mapping in b is in C + modelName = "C"; + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromSchema( + sc, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + hs.clear(); + hs.add(new CodegenDiscriminator.MappedModel("b", codegen.toModelName("B", null))); + assertEquals(cm.hasDiscriminatorWithNonEmptyMapping(), true); + assertEquals(cm.discriminator.mappedModels, hs); + } + + @Test + public void testComposedSchemaAllOfDiscriminatorMapLegacy() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/allOf_composition_discriminator.yaml"); + DefaultCodegen codegen = new DefaultCodegen(); + // codegen.legacyDiscriminatorBehavior remains false in the legacy use case + codegen.setOpenAPI(openAPI); + Schema sc; + String modelName; + + String propertyName = "petType"; + String propertyBaseName = propertyName; + CodegenKey ck = codegen.getKey(propertyName); + CodegenDiscriminator emptyMapDisc = new CodegenDiscriminator(ck, null, null); + + // all leaf Schemas have discriminators with PropertyName/BaseName + empty discriminator maps + List leafModelNames = Arrays.asList("Cat", "Dog", "Lizard", "Snake"); + for (String leafModelName : leafModelNames) { + Schema leafSc = openAPI.getComponents().getSchemas().get(leafModelName); + CodegenSchema leafCm = codegen.fromSchema( + leafSc, + "#/components/schemas/" + leafModelName, + "#/components/schemas/" + leafModelName + ); + Assert.assertNull(leafCm.discriminator); + } + + // the Pet discriminator map contains all animals + Reptile (children + grandchildren) + TreeSet hs = new TreeSet<>(); + for (String leafModelName : leafModelNames) { + hs.add(new CodegenDiscriminator.MappedModel(leafModelName, codegen.toModelName(leafModelName, null))); + } + hs.add(new CodegenDiscriminator.MappedModel("Reptile", codegen.toModelName("Reptile", null))); + CodegenKey petDiscPropName = codegen.getKey(propertyName); + CodegenDiscriminator petDisc = new CodegenDiscriminator(petDiscPropName, null, hs); + modelName = "Pet"; + sc = openAPI.getComponents().getSchemas().get(modelName); + CodegenSchema pet = codegen.fromSchema( + sc, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + assertEquals(pet.discriminator, petDisc); + + // the Reptile discriminator contains both reptiles + List reptileModelNames = Arrays.asList("Lizard", "Snake"); + hs.clear(); + for (String reptileModelName : reptileModelNames) { + hs.add(new CodegenDiscriminator.MappedModel(reptileModelName, codegen.toModelName(reptileModelName, null))); + } + CodegenKey reptileDiscPropName = codegen.getKey(propertyName); + CodegenDiscriminator reptileDisc = new CodegenDiscriminator(reptileDiscPropName, null, hs); + modelName = "Reptile"; + sc = openAPI.getComponents().getSchemas().get(modelName); + CodegenSchema reptile = codegen.fromSchema( + sc, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + Assert.assertNull(reptile.discriminator); + + // the MyPets discriminator contains Cat and Lizard + CodegenKey myPetDiscPropName = codegen.getKey(propertyName); + CodegenDiscriminator myPetDisc = new CodegenDiscriminator(myPetDiscPropName, null, hs); + hs.clear(); + modelName = "MyPets"; + sc = openAPI.getComponents().getSchemas().get(modelName); + CodegenSchema myPets = codegen.fromSchema( + sc, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + assertEquals(myPets.discriminator, myPetDisc); + + // the MyPetsNoDisc discriminator is created because all oneOf classes have the same discriminator + modelName = "MyPetsNoDisc"; + sc = openAPI.getComponents().getSchemas().get(modelName); + CodegenSchema myPetsNoDisc = codegen.fromSchema( + sc, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + Assert.assertNull(myPetsNoDisc.discriminator); + + CodegenSchema cm; + + // the mapping in b is in A + modelName = "A"; + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromSchema( + sc, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + hs.clear(); + hs.add(new CodegenDiscriminator.MappedModel("b", codegen.toModelName("B", null))); + assertEquals(cm.discriminator.mappedModels, hs); + + // the mapping in b is in B + modelName = "B"; + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromSchema( + sc, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + Assert.assertNull(cm.discriminator); + + // the mapping in b is in C + modelName = "C"; + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromSchema( + sc, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + Assert.assertNull(cm.discriminator); + } + + @Test + public void testComposedSchemaOneOfDiscriminatorsInvalid() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/oneOfDiscriminator.yaml"); + DefaultCodegen codegen = new DefaultCodegen(); + codegen.setLegacyDiscriminatorBehavior(false); + codegen.setOpenAPI(openAPI); + + HashMap hm = new HashMap<>(); + hm.put("ComposedDiscMissingNoProperties", "'ComposedDiscMissingNoProperties' defines discriminator 'fruitType', but the referenced schema 'DiscMissingNoProperties' is incorrect. fruitType is missing from the schema, define it as required and type string"); + hm.put("ComposedDiscMissingFromProperties", "'ComposedDiscMissingFromProperties' defines discriminator 'fruitType', but the referenced schema 'DiscMissingFromProperties' is incorrect. fruitType is missing from the schema, define it as required and type string"); + hm.put("ComposedDiscOptionalTypeCorrect", "'ComposedDiscOptionalTypeCorrect' defines discriminator 'fruitType', but the referenced schema 'DiscOptionalTypeCorrect' is incorrect. invalid optional definition of fruitType, include it in required"); + hm.put("ComposedDiscOptionalTypeIncorrect", "'ComposedDiscOptionalTypeIncorrect' defines discriminator 'fruitType', but the referenced schema 'DiscOptionalTypeIncorrect' is incorrect. invalid type for fruitType, set it to string. invalid optional definition of fruitType, include it in required"); + hm.put("ComposedDiscOptionalTypeInconsistent", "'ComposedDiscOptionalTypeInconsistent' defines discriminator 'fruitType', but the referenced schema 'DiscOptionalTypeIncorrect' is incorrect. invalid type for fruitType, set it to string. invalid optional definition of fruitType, include it in required"); + hm.put("ComposedDiscTypeIncorrect", "'ComposedDiscTypeIncorrect' defines discriminator 'fruitType', but the referenced schema 'DiscTypeIncorrect' is incorrect. invalid type for fruitType, set it to string"); + hm.put("ComposedDiscTypeInconsistent", "'ComposedDiscTypeInconsistent' defines discriminator 'fruitType', but the referenced schema 'DiscTypeIncorrect' is incorrect. invalid type for fruitType, set it to string"); + hm.put("ComposedDiscRequiredInconsistent", "'ComposedDiscRequiredInconsistent' defines discriminator 'fruitType', but the referenced schema 'DiscOptionalTypeCorrect' is incorrect. invalid optional definition of fruitType, include it in required"); + + for (Map.Entry entry : hm.entrySet()) { + String modelName = entry.getKey(); + String errorMessageExpected = entry.getValue(); + + Schema sc = openAPI.getComponents().getSchemas().get(modelName); + + /* + // comment out below as we're now showing warnings instead of throwing exceptions + try { + codegen.fromSchema(modelName, sc); + Assert.assertTrue(false, "A RuntimeException should have been thrown when processing "+modelName+ " but it was not"); + } catch (RuntimeException re) { + Assert.assertEquals(re.getMessage(), errorMessageExpected); + } + */ + } + } + + @Test + public void testComposedSchemaAnyOfDiscriminatorsInvalid() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/anyOfDiscriminator.yaml"); + DefaultCodegen codegen = new DefaultCodegen(); + codegen.setLegacyDiscriminatorBehavior(false); + codegen.setOpenAPI(openAPI); + + HashMap hm = new HashMap<>(); + hm.put("ComposedDiscMissingNoProperties", "'ComposedDiscMissingNoProperties' defines discriminator 'fruitType', but the referenced schema 'DiscMissingNoProperties' is incorrect. fruitType is missing from the schema, define it as required and type string"); + hm.put("ComposedDiscMissingFromProperties", "'ComposedDiscMissingFromProperties' defines discriminator 'fruitType', but the referenced schema 'DiscMissingFromProperties' is incorrect. fruitType is missing from the schema, define it as required and type string"); + hm.put("ComposedDiscOptionalTypeCorrect", "'ComposedDiscOptionalTypeCorrect' defines discriminator 'fruitType', but the referenced schema 'DiscOptionalTypeCorrect' is incorrect. invalid optional definition of fruitType, include it in required"); + hm.put("ComposedDiscOptionalTypeIncorrect", "'ComposedDiscOptionalTypeIncorrect' defines discriminator 'fruitType', but the referenced schema 'DiscOptionalTypeIncorrect' is incorrect. invalid type for fruitType, set it to string. invalid optional definition of fruitType, include it in required"); + hm.put("ComposedDiscOptionalTypeInconsistent", "'ComposedDiscOptionalTypeInconsistent' defines discriminator 'fruitType', but the referenced schema 'DiscOptionalTypeIncorrect' is incorrect. invalid type for fruitType, set it to string. invalid optional definition of fruitType, include it in required"); + hm.put("ComposedDiscTypeIncorrect", "'ComposedDiscTypeIncorrect' defines discriminator 'fruitType', but the referenced schema 'DiscTypeIncorrect' is incorrect. invalid type for fruitType, set it to string"); + hm.put("ComposedDiscTypeInconsistent", "'ComposedDiscTypeInconsistent' defines discriminator 'fruitType', but the referenced schema 'DiscTypeIncorrect' is incorrect. invalid type for fruitType, set it to string"); + hm.put("ComposedDiscRequiredInconsistent", "'ComposedDiscRequiredInconsistent' defines discriminator 'fruitType', but the referenced schema 'DiscOptionalTypeCorrect' is incorrect. invalid optional definition of fruitType, include it in required"); + + for (Map.Entry entry : hm.entrySet()) { + String modelName = entry.getKey(); + String errorMessageExpected = entry.getValue(); + + Schema sc = openAPI.getComponents().getSchemas().get(modelName); + + /* + // comment out below as we're now showing warnings instead of throwing exceptions + try { + codegen.fromSchema(modelName, sc); + Assert.assertTrue(false, "A RuntimeException should have been thrown when processing "+modelName+ " but it was not"); + } catch (RuntimeException re) { + Assert.assertEquals(re.getMessage(), errorMessageExpected); + } + */ + } + } + + @Test + public void testComposedSchemaAnyOfDiscriminatorMap() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/anyOfDiscriminator.yaml"); + DefaultCodegen codegen = new DefaultCodegen(); + codegen.setLegacyDiscriminatorBehavior(false); + codegen.setOpenAPI(openAPI); + + String modelName; + Schema sc; + CodegenSchema cm; + java.util.LinkedHashSet hs; + String mn; + + // inline anyOf models work because the inline schemas are turned into $refs + modelName = "FruitInlineDisc"; + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromSchema( + sc, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + assertEquals(cm.discriminator.mapping, null); + assertEquals(cm.discriminator.mappedModels.size(), 0); + + // inline anyOf with inline anyOf model doesn't work because we have null $refs and we throw an exception + final String fmodelName = "FruitInlineInlineDisc"; + final Schema fsc = openAPI.getComponents().getSchemas().get(fmodelName); + // comment out below as we're now showing warnings instead of throwing exceptions + String jsonPath = "#/components/schemas/" + fmodelName; + cm = codegen.fromSchema(fsc, jsonPath, jsonPath); + assertEquals(cm.discriminator.mapping, null); + assertEquals(cm.discriminator.mappedModels.size(), 0); + + // ref anyOf models with discriminator in properties in those models + modelName = "FruitReqDisc"; + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromSchema( + sc, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + hs = new java.util.LinkedHashSet(); + mn = "AppleReqDisc"; + hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); + mn = "BananaReqDisc"; + hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); + assertEquals(cm.discriminator.mappedModels, hs); + + // ref oneOf models with discriminator in allOf in those models + modelName = "FruitAllOfDisc"; + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromSchema( + sc, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + hs = new java.util.LinkedHashSet(); + mn = "AppleAllOfDisc"; + hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); + mn = "BananaAllOfDisc"; + hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); + assertEquals(cm.discriminator.mappedModels, hs); + + // ref oneOf models with discriminator in anyOf in those models + modelName = "FruitAnyOfDisc"; + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromSchema( + sc, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + hs = new java.util.LinkedHashSet(); + mn = "AppleAnyOfDisc"; + hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); + mn = "BananaAnyOfDisc"; + hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); + assertEquals(cm.discriminator.mappedModels, hs); + + // ref oneOf models with discriminator in anyOf in those models + modelName = "FruitAnyOfDisc"; + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromSchema( + sc, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + hs = new java.util.LinkedHashSet(); + mn = "AppleAnyOfDisc"; + hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); + mn = "BananaAnyOfDisc"; + hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); + assertEquals(cm.discriminator.mappedModels, hs); + + // ref oneOf models with discriminator in the grandparent schemas of those anyof models + modelName = "FruitGrandparentDisc"; + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromSchema( + sc, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + hs = new java.util.LinkedHashSet(); + mn = "AppleGrandparentDisc"; + hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); + mn = "BananaGrandparentDisc"; + hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); + assertEquals(cm.discriminator.mappedModels, hs); + } + + @Test + public void testComposedSchemaOneOfDiscriminatorMap() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/oneOfDiscriminator.yaml"); + DefaultCodegen codegen = new DefaultCodegen(); + codegen.setLegacyDiscriminatorBehavior(false); + codegen.setOpenAPI(openAPI); + + String modelName; + Schema sc; + CodegenSchema cm; + java.util.LinkedHashSet hs; + String mn; + + // inline oneOf models work because the inline schemas are turned into $refs + modelName = "FruitInlineDisc"; + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromSchema( + sc, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + assertEquals(cm.discriminator.mapping, null); + assertEquals(cm.discriminator.mappedModels.size(), 0); + + // inline oneOf with inline oneOf model doesn't work because we have null $refs and we throw an exception + final String fmodelName = "FruitInlineInlineDisc"; + final Schema fsc = openAPI.getComponents().getSchemas().get(fmodelName); + String jsonPath = "#/components/schemas/" + fmodelName; + cm = codegen.fromSchema(fsc, jsonPath, jsonPath); + assertEquals(cm.discriminator.mapping, null); + assertEquals(cm.discriminator.mappedModels.size(), 0); + + // ref oneOf models with discriminator in properties in those models + modelName = "FruitReqDisc"; + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromSchema( + sc, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + hs = new java.util.LinkedHashSet(); + mn = "AppleReqDisc"; + hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); + mn = "BananaReqDisc"; + hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); + assertEquals(cm.discriminator.mappedModels, hs); + + // ref oneOf models with discriminator in allOf in those models + modelName = "FruitAllOfDisc"; + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromSchema( + sc, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + hs = new java.util.LinkedHashSet(); + mn = "AppleAllOfDisc"; + hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); + mn = "BananaAllOfDisc"; + hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); + assertEquals(cm.discriminator.mappedModels, hs); + + // ref oneOf models with discriminator in anyOf in those models + modelName = "FruitAnyOfDisc"; + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromSchema( + sc, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + hs = new java.util.LinkedHashSet(); + mn = "AppleAnyOfDisc"; + hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); + mn = "BananaAnyOfDisc"; + hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); + assertEquals(cm.discriminator.mappedModels, hs); + + // ref oneOf models with discriminator in oneOf in those models + modelName = "FruitOneOfDisc"; + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromSchema( + sc, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + hs = new java.util.LinkedHashSet(); + mn = "AppleOneOfDisc"; + hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); + mn = "BananaOneOfDisc"; + hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); + assertEquals(cm.discriminator.mappedModels, hs); + + // ref oneOf models with discriminator in the grandparent schemas of those oneof models + modelName = "FruitGrandparentDisc"; + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromSchema( + sc, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + hs = new java.util.LinkedHashSet(); + mn = "AppleGrandparentDisc"; + hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); + mn = "BananaGrandparentDisc"; + hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); + assertEquals(cm.discriminator.mappedModels, hs); + } + + @Test + public void testComposedSchemaMyPetsOneOfDiscriminatorMap() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/allOf_composition_discriminator.yaml"); + + DefaultCodegen codegen = new DefaultCodegen(); + codegen.setLegacyDiscriminatorBehavior(false); + codegen.setOpenAPI(openAPI); + + Schema pet = openAPI.getComponents().getSchemas().get("MyPets"); + CodegenSchema petModel = codegen.fromSchema( + pet, + "#/components/schemas/MyPets", + "#/components/schemas/MyPets" + ); + verifyMyPetsDiscriminator(petModel.discriminator); + } + + @Test + public void testComposedSchemaAllOfHierarchy() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/allOf_composition_discriminator.yaml"); + + DefaultCodegen codegen = new DefaultCodegen(); + codegen.setLegacyDiscriminatorBehavior(false); + codegen.setOpenAPI(openAPI); + + Schema pet = openAPI.getComponents().getSchemas().get("Lizard"); + CodegenSchema petModel = codegen.fromSchema( + pet, + "#/components/schemas/Lizard", + "#/components/schemas/Lizard" + ); + verifyLizardDiscriminator(petModel.discriminator); + + pet = openAPI.getComponents().getSchemas().get("Reptile"); + petModel = codegen.fromSchema( + pet, + "#/components/schemas/Reptile", + "#/components/schemas/Reptile" + ); + verifyReptileDiscriminator(petModel.discriminator); + } + + private void verifyLizardDiscriminator(CodegenDiscriminator discriminator) { + String prop = "petType"; + String propertyName = prop; + String propertyBaseName = prop; + Map mapping = null; + TreeSet mappedModels = new TreeSet<>(); + CodegenKey testPropName = new DefaultCodegen().getKey(propertyName); + CodegenDiscriminator test = new CodegenDiscriminator(testPropName, mapping, mappedModels); + assertEquals(discriminator, test); + } + + private void verifyReptileDiscriminator(CodegenDiscriminator discriminator) { + String prop = "petType"; + String propertyName = prop; + String propertyBaseName = prop; + Map mapping = null; + TreeSet mappedModels = new TreeSet<>(); + mappedModels.add(new CodegenDiscriminator.MappedModel("Lizard", "Lizard")); + mappedModels.add(new CodegenDiscriminator.MappedModel("Snake", "Snake")); + CodegenKey expectedDiscriminatorPropName = new DefaultCodegen().getKey(propertyName); + CodegenDiscriminator expectedDiscriminator = new CodegenDiscriminator(expectedDiscriminatorPropName, mapping, mappedModels); + assertEquals(discriminator, expectedDiscriminator); + } + + private void verifyMyPetsDiscriminator(CodegenDiscriminator discriminator) { + String prop = "petType"; + String propertyName = prop; + String propertyBaseName = prop; + Map mapping = null; + TreeSet mappedModels = new TreeSet<>(); + mappedModels.add(new CodegenDiscriminator.MappedModel("Cat", "Cat")); + mappedModels.add(new CodegenDiscriminator.MappedModel("Lizard", "Lizard")); + CodegenKey expectedDiscriminatorPropName = new DefaultCodegen().getKey(propertyName); + CodegenDiscriminator expectedDiscriminator = new CodegenDiscriminator(expectedDiscriminatorPropName, mapping, mappedModels); + assertEquals(discriminator, expectedDiscriminator); + } + + @Test + public void verifyXDiscriminatorValue() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/2_0/x-discriminator-value.yaml"); + final DefaultCodegen config = new DefaultCodegen(); + config.setOpenAPI(openAPI); + + String modelName; + CodegenDiscriminator discriminator; + Schema sc; + CodegenSchema cm; + + Boolean dryRun = Boolean.TRUE; + final DefaultGenerator generator = new DefaultGenerator(dryRun); + generator.openAPI = openAPI; + generator.config = config; + generator.configureGeneratorProperties(); + + // check that the model's children contain the x-discriminator-values + modelName = "BaseObj"; + cm = generator.config.fromSchema( + openAPI.getComponents().getSchemas().get(modelName), + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + Assert.assertNotNull(cm); + + // check that the discriminator's MappedModels also contains the x-discriminator-values + String propertyName = "object_type"; + Map mapping = null; + TreeSet mappedModels = new TreeSet<>(); + mappedModels.add(new CodegenDiscriminator.MappedModel("daily", "DailySubObj")); + mappedModels.add(new CodegenDiscriminator.MappedModel("DailySubObj", "DailySubObj")); + mappedModels.add(new CodegenDiscriminator.MappedModel("sub-obj", "SubObj")); + mappedModels.add(new CodegenDiscriminator.MappedModel("SubObj", "SubObj")); + CodegenKey expectedDiscriminatorPropName = new DefaultCodegen().getKey(propertyName); + CodegenDiscriminator expectedDiscriminator = new CodegenDiscriminator(expectedDiscriminatorPropName, mapping, mappedModels); + assertEquals(cm.discriminator, expectedDiscriminator); + } + + + @Test + public void testAllOfSingleRefNoOwnProps() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/2_0/composed-allof.yaml"); + final DefaultCodegen codegen = new CodegenWithMultipleInheritance(); + + Schema schema = openAPI.getComponents().getSchemas().get("NewMessageEventCoreNoOwnProps"); + codegen.setOpenAPI(openAPI); + CodegenSchema model = codegen.fromSchema( + schema, + "#/components/schemas/NewMessageEventCoreNoOwnProps", + "#/components/schemas/NewMessageEventCoreNoOwnProps" + ); + assertEquals( + model.properties, + null + ); + } + + @Test + public void testAllOfParent() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/allOf-required-parent.yaml"); + DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + + Schema person = openAPI.getComponents().getSchemas().get("person"); + CodegenSchema personModel = codegen.fromSchema( + person, + "#/components/schemas/person", + "#/components/schemas/person" + ); + assertEquals(personModel.requiredProperties.size(), 1); + + Schema personForCreation = openAPI.getComponents().getSchemas().get("personForCreation"); + CodegenSchema personForCreationModel = codegen.fromSchema( + personForCreation, + "#/components/schemas/personForCreation", + "#/components/schemas/personForCreation" + ); + assertEquals(personForCreationModel.requiredProperties.size(), 3); + + Schema personForUpdate = openAPI.getComponents().getSchemas().get("personForUpdate"); + CodegenSchema personForUpdateModel = codegen.fromSchema( + personForUpdate, + "#/components/schemas/personForUpdate", + "#/components/schemas/personForUpdate" + ); + assertEquals(personForUpdateModel.requiredProperties, null); + } + + private List getRequiredVars(CodegenSchema model) { + return model.requiredProperties.keySet().stream().map(ck -> ck.original).collect(Collectors.toList()); + } + + @Test + public void testLeadingSlashIsAddedIfMissing() { + OpenAPI openAPI = TestUtils.createOpenAPI(); + Operation operation1 = new Operation().operationId("op1").responses(new ApiResponses().addApiResponse("201", new ApiResponse().description("OK"))); + openAPI.path("/here", new PathItem().get(operation1)); + Operation operation2 = new Operation().operationId("op2").responses(new ApiResponses().addApiResponse("201", new ApiResponse().description("OK"))); + openAPI.path("some/path", new PathItem().get(operation2)); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.preprocessOpenAPI(openAPI); + codegen.setOpenAPI(openAPI); + + TreeMap paths = codegen.fromPaths(openAPI.getPaths()); + CodegenKey path1 = codegen.getKey("/here"); + Assert.assertTrue(paths.containsKey(path1)); + CodegenKey path2 = codegen.getKey("/some/path"); + Assert.assertTrue(paths.containsKey(path2)); + } + + @Test + public void testDefaultResponseShouldBeLast() { + OpenAPI openAPI = TestUtils.createOpenAPI(); + Operation myOperation = new Operation().operationId("myOperation").responses( + new ApiResponses() + .addApiResponse( + "default", new ApiResponse().description("Default")) + .addApiResponse( + "422", new ApiResponse().description("Error")) + ); + openAPI.path("/here", new PathItem().get(myOperation)); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + + CodegenOperation co = codegen.fromOperation(myOperation, getOperationPath("/here", "get")); + Assert.assertEquals(co.responses.get("422").description, "Error"); + Assert.assertEquals(co.responses.get("default").description, "Default"); + } + + @Test + public void testResponseWithNoSchemaInHeaders() { + OpenAPI openAPI = TestUtils.createOpenAPI(); + ApiResponse response2XX = new ApiResponse() + .description("OK") + .addHeaderObject("x-custom-header", new Header() + .description("a custom header") + .style(Header.StyleEnum.SIMPLE)); + Operation operation1 = new Operation().operationId("op1").responses(new ApiResponses().addApiResponse("2XX", response2XX)); + openAPI.path("/here", new PathItem().get(operation1)); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + + CodegenResponse cr = codegen.fromResponse(response2XX, ""); + Assert.assertNotNull(cr); + Assert.assertNotNull(cr.headers); + } + + @Test + public void testNullableProperty() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/examples.yaml"); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + + CodegenSchema userModel = codegen.fromSchema( + (Schema) openAPI.getComponents().getSchemas().get("User"), + "#/components/schemas/User", + "#/components/schemas/User" + ); + CodegenKey key = codegen.getKey("address"); + Assert.assertTrue(userModel.properties.get(key).nullable); + } + + @Test + public void testDeprecatedModel() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/component-deprecated.yml"); + final DefaultCodegen codegen = new DefaultCodegen(); + + CodegenSchema codegenPetModel = codegen.fromSchema( + openAPI.getComponents().getSchemas().get("Pet"), + "#/components/schemas/Pet", + "#/components/schemas/Pet" + ); + Assert.assertTrue(codegenPetModel.deprecated); + + CodegenSchema codegenFoodModel = codegen.fromSchema( + openAPI.getComponents().getSchemas().get("Food"), + "#/components/schemas/Food", + "#/components/schemas/Food" + ); + Assert.assertTrue(codegenFoodModel.deprecated); + } + + @Test + public void testDeprecatedProperty() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/property-deprecated.yaml"); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + + final Map responseProperties = Collections.unmodifiableMap(openAPI.getComponents().getSchemas().get("Response").getProperties()); + final Map requestProperties = Collections.unmodifiableMap(openAPI.getComponents().getSchemas().get("Request").getProperties()); + + Assert.assertTrue(codegen.fromSchema( + (Schema) responseProperties.get("firstName"), + "#/components/schemas/Response", + "#/components/schemas/Response/properties/firstName" + ).deprecated); + assertNull(codegen.fromSchema( + (Schema) responseProperties.get("customerCode"), + "#/components/schemas/Response", + "#/components/schemas/Response/properties/customerCode" + ).deprecated); + Assert.assertTrue(codegen.fromSchema( + (Schema) requestProperties.get("firstName"), + "#/components/schemas/Request", + "#/components/schemas/Request/properties/firstName" + ).deprecated); + assertNull(codegen.fromSchema( + (Schema) requestProperties.get("customerCode"), + "#/components/schemas/Request", + "#/components/schemas/Request/properties/customerCode" + ).deprecated); + } + + @Test + public void testDeprecatedRef() { + final OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/model-deprecated.yaml"); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + + final Map requestProperties = openAPI.getComponents().getSchemas().get("complex").getProperties(); + + codegen.fromSchema( + openAPI.getComponents().getSchemas().get("deprecated"), + "#/components/schemas/deprecated", + "#/components/schemas/deprecated" + ); + Assert.assertTrue(codegen.fromSchema( + requestProperties.get("deprecated"), + "#/components/schemas/complex", + "#/components/schemas/complex/properties/deprecated" + ).refInfo.ref.deprecated); + assertNull(codegen.fromSchema( + requestProperties.get("current"), + "#/components/schemas/complex", + "#/components/schemas/complex/properties/current" + ).deprecated); + } + + @Test + public void integerSchemaPropertyAndModelTest() { + OpenAPI openAPI = TestUtils.createOpenAPI(); + final Schema schema = new IntegerSchema().format("int32"); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + + //Property: + final CodegenSchema cp = codegen.fromSchema( + schema, + "#/components/schemas/A", + "#/components/schemas/A/properties/someProperty" + ); + Assert.assertEquals(cp.jsonPathPiece.original, "someProperty"); + Assert.assertTrue(cp.types.size() == 1); + Assert.assertTrue(cp.types.contains("integer")); + + //Model: + final CodegenSchema cm = codegen.fromSchema( + schema, + "#/components/schemas/someModel", + "#/components/schemas/someModel" + ); + Assert.assertEquals(cm.jsonPathPiece.original, "someModel"); + Assert.assertTrue(cm.types.contains("integer")); + Assert.assertTrue(cm.types.size() == 1); + } + + @Test + public void longSchemaPropertyAndModelTest() { + OpenAPI openAPI = TestUtils.createOpenAPI(); + final Schema schema = new IntegerSchema().format("int64"); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + + //Property: + final CodegenSchema cp = codegen.fromSchema( + schema, + "#/components/schemas/A/properties/someProperty", + "#/components/schemas/A/properties/someProperty" + ); + Assert.assertEquals(cp.jsonPathPiece.original, "someProperty"); + Assert.assertTrue(cp.types.size() == 1); + Assert.assertTrue(cp.types.contains("integer")); + Assert.assertTrue(cp.format.equals("int64")); + + //Model: + final CodegenSchema cm = codegen.fromSchema( + schema, + "#/components/schemas/someModel", + "#/components/schemas/someModel" + ); + Assert.assertEquals(cm.jsonPathPiece.original, "someModel"); + Assert.assertTrue(cm.types.size() == 1); + Assert.assertTrue(cm.types.contains("integer")); + Assert.assertTrue(cm.format.equals("int64")); + } + + @Test + public void numberSchemaPropertyAndModelTest() { + OpenAPI openAPI = TestUtils.createOpenAPI(); + final Schema schema = new NumberSchema(); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + + //Property: + final CodegenSchema cp = codegen.fromSchema( + schema, + "#/components/schemas/A/properties/someProperty", + "#/components/schemas/A/properties/someProperty" + ); + Assert.assertEquals(cp.jsonPathPiece.original, "someProperty"); + Assert.assertTrue(cp.types.size() == 1); + Assert.assertTrue(cp.types.contains("number")); + + //Model: + final CodegenSchema cm = codegen.fromSchema( + schema, + "#/components/schemas/someModel", + "#/components/schemas/someModel" + ); + Assert.assertEquals(cm.jsonPathPiece.original, "someModel"); + Assert.assertTrue(cp.types.size() == 1); + Assert.assertTrue(cp.types.contains("number")); + } + + @Test + public void numberFloatSchemaPropertyAndModelTest() { + OpenAPI openAPI = TestUtils.createOpenAPI(); + final Schema schema = new NumberSchema().format("float"); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + + //Property: + final CodegenSchema cp = codegen.fromSchema( + schema, + "#/components/schemas/A", + "#/components/schemas/A/properties/someProperty" + ); + Assert.assertEquals(cp.jsonPathPiece.original, "someProperty"); + Assert.assertTrue(cp.types.size() == 1); + Assert.assertTrue(cp.types.contains("number")); + Assert.assertTrue(cp.format.equals("float")); + + //Model: + final CodegenSchema cm = codegen.fromSchema( + schema, + "#/components/schemas/someModel", + "#/components/schemas/someModel" + ); + Assert.assertEquals(cm.jsonPathPiece.original, "someModel"); + assertEquals(cm.types.size(), 1); + Assert.assertTrue(cm.types.contains("number")); + assertEquals(cm.format, "float"); + } + + @Test + public void numberDoubleSchemaPropertyAndModelTest() { + OpenAPI openAPI = TestUtils.createOpenAPI(); + final Schema schema = new NumberSchema().format("double"); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + + //Property: + final CodegenSchema cp = codegen.fromSchema( + schema, + "#/components/schemas/A", + "#/components/schemas/A/properties/someProperty" + ); + Assert.assertEquals(cp.jsonPathPiece.original, "someProperty"); + Assert.assertTrue(cp.types.size() == 1); + Assert.assertTrue(cp.types.contains("number")); + Assert.assertTrue(cp.format.equals("double")); + + //Model: + final CodegenSchema cm = codegen.fromSchema( + schema, + "#/components/schemas/someModel", + "#/components/schemas/someModel" + ); + Assert.assertEquals(cm.jsonPathPiece.original, "someModel"); + Assert.assertTrue(cm.types.size() == 1); + Assert.assertTrue(cm.types.contains("number")); + Assert.assertTrue(cm.format.equals("double")); + } + + @Test + public void testAlias() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/type_alias.yaml"); + + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + + codegen.fromSchema( + openAPI.getComponents().getSchemas().get("TypeAliasToString"), + "#/components/schemas/TypeAliasToString", + "#/components/schemas/TypeAliasToString" + ); + CodegenSchema typeAliasModel = codegen.fromSchema( + openAPI.getComponents().getSchemas().get("MyParameterTextField"), + "#/components/schemas/MyParameterTextField", + "#/components/schemas/MyParameterTextField" + ); + assertTrue(typeAliasModel.refInfo.ref.types.size() == 1); + assertTrue(typeAliasModel.refInfo.ref.types.contains("string")); + } + + private void verifyPersonDiscriminator(CodegenDiscriminator discriminator) { + String propertyName = "$_type"; + HashMap mapping = new HashMap<>(); + mapping.put("a", "#/components/schemas/Adult"); + mapping.put("c", "Child"); + + TreeSet mappedModels = new TreeSet<>(); + mappedModels.add(new CodegenDiscriminator.MappedModel("a", "Adult")); + mappedModels.add(new CodegenDiscriminator.MappedModel("c", "Child")); + mappedModels.add(new CodegenDiscriminator.MappedModel("Adult", "Adult")); + mappedModels.add(new CodegenDiscriminator.MappedModel("Child", "Child")); + CodegenKey expectedDiscriminatorPropName = new DefaultCodegen().getKey(propertyName); + CodegenDiscriminator expectedDiscriminator = new CodegenDiscriminator(expectedDiscriminatorPropName, mapping, mappedModels); + Assert.assertEquals(discriminator, expectedDiscriminator); + } + + private CodegenSchema codegenPropertyWithArrayOfIntegerValues() { + IntegerSchema itemsSchema = new IntegerSchema(); + itemsSchema.setEnum(Arrays.asList(1)); + ArraySchema arraySchema = new ArraySchema(); + arraySchema.setItems(itemsSchema); + + final DefaultCodegen codegen = new DefaultCodegen(); + String jsonPath = "#/components/schemas/codegenPropertyWithArrayOfIntegerValues"; + return codegen.fromSchema(arraySchema, jsonPath, jsonPath); + } + + private CodegenSchema codegenProperty(DefaultCodegen codegen, List values, String identifier, List xEnumVarnames) { + StringSchema itemsSchema = new StringSchema(); + itemsSchema.setEnum(values); + if (xEnumVarnames != null) { + HashMap extensions = new HashMap<>(); + extensions.put("x-enum-varnames", xEnumVarnames); + itemsSchema.setExtensions(extensions); + } + ArraySchema arraySchema = new ArraySchema(); + arraySchema.setItems(itemsSchema); + String jsonPath = "#/components/schemas/ModelWithProp/properties/" + identifier; + return codegen.fromSchema(arraySchema, jsonPath, jsonPath); + } + + private TreeMap codegenModel(DefaultCodegen codegen, List values, String identifier, List xEnumVarnames, List xEnumDescriptions) { + StringSchema itemsSchema = new StringSchema(); + itemsSchema.setEnum(values); + if (xEnumVarnames != null || xEnumDescriptions != null) { + HashMap extensions = new HashMap<>(); + if (xEnumVarnames != null) { + extensions.put("x-enum-varnames", xEnumVarnames); + } + if (xEnumVarnames != null) { + extensions.put("x-enum-descriptions", xEnumDescriptions); + } + itemsSchema.setExtensions(extensions); + } + String jsonPath = "#/components/schemas/" + identifier; + CodegenSchema cm = codegen.fromSchema(itemsSchema, jsonPath, jsonPath); + TreeMap schemas = new TreeMap<>(); + schemas.put("model", cm); + return schemas; + } + + @Test + public void modelDoNotContainInheritedVars() { + DefaultCodegen codegen = new DefaultCodegen(); + codegen.supportsInheritance = true; + + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/generic.yaml"); + codegen.setOpenAPI(openAPI); + + CodegenSchema codegenModel = codegen.fromSchema( + openAPI.getComponents().getSchemas().get("Dog"), + "#/components/schemas/Dog", + "#/components/schemas/Dog" + ); + + assertEquals(codegenModel.properties, null); + } + + @Test + public void schemaMapping() { + DefaultCodegen codegen = new DefaultCodegen(); + codegen.schemaMapping.put("TypeAlias", "foo.bar.TypeAlias"); + + OpenAPI openAPI = new OpenAPIParser() + .readLocation("src/test/resources/3_0/type-alias.yaml", null, new ParseOptions()).getOpenAPI(); + codegen.setOpenAPI(openAPI); + + CodegenSchema codegenModel = codegen.fromSchema( + openAPI.getComponents().getSchemas().get("ParentType"), + "#/components/schemas/ParentType", + "#/components/schemas/ParentType" + ); + + assertEquals(codegenModel.properties.size(), 1); + + Assert.assertEquals(codegenModel.properties.get(codegen.getKey("typeAlias")).refInfo.refClass, "TypeAlias"); + } + + @Test + public void modelWithPrefixDoNotContainInheritedVars() { + DefaultCodegen codegen = new DefaultCodegen(); + codegen.supportsInheritance = true; + codegen.setModelNamePrefix("prefix"); + + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/generic.yaml"); + codegen.setOpenAPI(openAPI); + + CodegenSchema codegenModel = codegen.fromSchema( + openAPI.getComponents().getSchemas().get("Dog"), + "#/components/schemas/Dog", + "#/components/schemas/Dog" + ); + + assertEquals(codegenModel.properties, null); + } + + @Test + public void modelWithSuffixDoNotContainInheritedVars() { + DefaultCodegen codegen = new DefaultCodegen(); + codegen.supportsInheritance = true; + codegen.setModelNameSuffix("suffix"); + + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/generic.yaml"); + codegen.setOpenAPI(openAPI); + + CodegenSchema codegenModel = codegen.fromSchema( + openAPI.getComponents().getSchemas().get("Dog"), + "#/components/schemas/Dog", + "#/components/schemas/Dog" + ); + + assertEquals(codegenModel.properties, null); + } + + @Test + public void arrayInnerReferencedSchemaMarkedAsModel_30() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/arrayRefBody.yaml"); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + + RequestBody body = openAPI.getPaths().get("/examples").getPost().getRequestBody(); + + CodegenRequestBody codegenParameter = codegen.fromRequestBody(body, "#/paths/~1examples/post/requestBody"); + + CodegenKey ck = codegen.getKey("application/json"); + Assert.assertTrue(codegenParameter.content.get(ck).schema.types.contains("array")); + Assert.assertTrue(codegenParameter.content.get(ck).schema.items.refInfo != null); + Assert.assertTrue(codegenParameter.content.get(ck).schema.items.refInfo.refClass != null); + } + + @Test + @SuppressWarnings("unchecked") + public void commonLambdasRegistrationTest() { + + DefaultCodegen codegen = new DefaultCodegen(); + Object lambdasObj = codegen.additionalProperties.get("lambda"); + + assertNotNull(lambdasObj, "Expecting lambda in additionalProperties"); + + Map lambdas = (Map) lambdasObj; + + assertTrue(lambdas.get("lowercase") instanceof LowercaseLambda, "Expecting LowercaseLambda class"); + assertTrue(lambdas.get("uppercase") instanceof UppercaseLambda, "Expecting UppercaseLambda class"); + assertTrue(lambdas.get("titlecase") instanceof TitlecaseLambda, "Expecting TitlecaseLambda class"); + assertTrue(lambdas.get("camelcase") instanceof CamelCaseLambda, "Expecting CamelCaseLambda class"); + assertTrue(lambdas.get("indented") instanceof IndentedLambda, "Expecting IndentedLambda class"); + assertTrue(lambdas.get("indented_8") instanceof IndentedLambda, "Expecting IndentedLambda class"); + assertTrue(lambdas.get("indented_12") instanceof IndentedLambda, "Expecting IndentedLambda class"); + assertTrue(lambdas.get("indented_16") instanceof IndentedLambda, "Expecting IndentedLambda class"); + } + + @Test + public void convertApiNameWithEmptySuffix() { + DefaultCodegen codegen = new DefaultCodegen(); + assertEquals(codegen.toApiName("Fake"), "FakeApi"); + assertEquals(codegen.toApiName(""), "DefaultApi"); + } + + @Test + public void convertApiNameWithSuffix() { + DefaultCodegen codegen = new DefaultCodegen(); + codegen.setApiNameSuffix("Test"); + assertEquals(codegen.toApiName("Fake"), "FakeTest"); + assertEquals(codegen.toApiName(""), "DefaultApi"); + } + + @Test + public void testFormComposedSchema() { + OpenAPI openAPI = TestUtils.parseContent("openapi: 3.0.1\n" + + "info:\n" + + " version: '1.0.0'\n" + + " title: the title\n" + + "\n" + + "paths:\n" + + " '/users/me':\n" + + " post:\n" + + " description: Change user password.\n" + + " operationId: changeCurrentUserPassword\n" + + " requestBody:\n" + + " required: true\n" + + " content:\n" + + " multipart/form-data:\n" + + " schema:\n" + + " $ref: '#/components/schemas/ChangePasswordRequest'\n" + + " responses:\n" + + " '200':\n" + + " description: Successful operation\n" + + " content: {}\n" + + "\n" + + "components:\n" + + " schemas:\n" + + " CommonPasswordRequest:\n" + + " type: object\n" + + " required: [ password, passwordConfirmation ]\n" + + " properties:\n" + + " password:\n" + + " type: string\n" + + " format: password\n" + + " passwordConfirmation:\n" + + " type: string\n" + + " format: password\n" + + "\n" + + " ChangePasswordRequest:\n" + + " type: object\n" + + " allOf:\n" + + " - $ref: '#/components/schemas/CommonPasswordRequest'\n" + + " - type: object\n" + + " required: [ oldPassword ]\n" + + " properties:\n" + + " oldPassword:\n" + + " type: string\n" + + " format: password\n"); + + final DefaultCodegen cg = new DefaultCodegen(); + cg.setOpenAPI(openAPI); + cg.preprocessOpenAPI(openAPI); + + final PathItem path = openAPI.getPaths().get("/users/me"); + final CodegenOperation operation = cg.fromOperation( + path.getPost(), + getOperationPath("/users/me", "post")); + assertEquals(operation.allParams.size(), 0); + assertNotNull(operation.requestBody); + } + + @Test + public void inlineAllOfSchemaDoesNotThrowException() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue7262.yaml"); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + + String modelName = "UserTimeBase"; + Schema sc = openAPI.getComponents().getSchemas().get(modelName); + CodegenSchema cm = codegen.fromSchema( + sc, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + + final Set expectedMappedModels = Sets.newHashSet(new CodegenDiscriminator.MappedModel("UserSleep", "UserSleep")); + final Set mappedModels = cm.discriminator.mappedModels; + assertEquals(mappedModels, expectedMappedModels); + + modelName = "UserSleep"; + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromSchema( + sc, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + assertEquals(cm.allOf.get(0).refInfo.refClass, "UserTimeBase"); + assertEquals(openAPI.getComponents().getSchemas().size(), 2); + assertNull(cm.discriminator); + } + + @Test + public void arrayModelHasValidation() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue7356.yaml"); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + + String modelName = "ArrayWithValidations"; + Schema sc = openAPI.getComponents().getSchemas().get(modelName); + CodegenSchema cm = codegen.fromSchema( + sc, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + assertEquals((int) cm.minItems, 1); + } + + @Test + public void testOauthMultipleFlows() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_7193.yaml"); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + + final Map securitySchemes = openAPI.getComponents().getSecuritySchemes(); + HashMap securities = new HashMap<>(); + for (Map.Entry entry: securitySchemes.entrySet()) { + String componentName = entry.getKey(); + CodegenSecurityScheme cs = codegen.fromSecurityScheme(entry.getValue(), "#/components/securitySchemes/" + componentName); + securities.put(componentName, cs); + assertNotNull(cs.flows.password); + assertNotNull(cs.flows.clientCredentials); + } + assertEquals(securities.size(), 1); + } + + @Test + public void testItemsPresent() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_7613.yaml"); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + + String modelName; + Schema sc; + CodegenSchema cm; + + modelName = "ArrayWithValidationsInItems"; + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromSchema( + sc, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + assertEquals(cm.items.maximum, "7"); + + modelName = "ObjectWithValidationsInArrayPropItems"; + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromSchema( + sc, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + CodegenKey ck = codegen.getKey("arrayProp"); + assertEquals(cm.properties.get(ck).items.maximum, "7"); + + String path; + Operation operation; + CodegenOperation co; + + path = "/ref_array_with_validations_in_items/{items}"; + operation = openAPI.getPaths().get(path).getPost(); + co = codegen.fromOperation(operation, getOperationPath(path, "post")); + assertEquals(co.pathParams.get(0).schema.refInfo.ref.items.maximum, "7"); // disabled because refed + CodegenKey applicationJson = codegen.getKey("application/json"); + assertEquals(co.requestBody.content.get(applicationJson).schema.refInfo.ref.items.maximum, "7"); // disabled because refed + assertEquals(co.responses.get("200").content.get(applicationJson).schema.refInfo.ref.items.maximum, "7"); // disabled because refed + + path = "/array_with_validations_in_items/{items}"; + operation = openAPI.getPaths().get(path).getPost(); + co = codegen.fromOperation(operation, getOperationPath(path, "post")); + assertEquals(co.pathParams.get(0).schema.items.maximum, "7"); + assertEquals(co.requestBody.content.get(applicationJson).schema.items.maximum, "7"); + assertEquals(co.responses.get("200").content.get(applicationJson).schema.items.maximum, "7"); + } + + @Test + public void testAdditionalPropertiesPresentInModels() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_7613.yaml"); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + codegen.setDisallowAdditionalPropertiesIfNotPresent(false); + + String modelName; + Schema sc; + CodegenSchema cm; + CodegenSchema anyTypeSchema = codegen.fromSchema( + new Schema(), + "#/components/schemas/AdditionalPropertiesTrue", + "#/components/schemas/AdditionalPropertiesTrue/additionalProperties" + ); + + modelName = "AdditionalPropertiesUnset"; + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromSchema( + sc, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + assertEquals(cm.additionalProperties, null); + + modelName = "AdditionalPropertiesTrue"; + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromSchema( + sc, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + assertEquals(cm.additionalProperties, anyTypeSchema); + assertTrue(cm.additionalProperties.isBooleanSchemaTrue); + + modelName = "AdditionalPropertiesFalse"; + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromSchema( + sc, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + assertTrue(cm.additionalProperties.isBooleanSchemaFalse); + + modelName = "AdditionalPropertiesSchema"; + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromSchema( + sc, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + CodegenSchema stringCp = codegen.fromSchema( + new Schema().type("string"), + "#/components/schemas/AdditionalPropertiesSchema", + "#/components/schemas/AdditionalPropertiesSchema/additionalProperties" + ); + assertEquals(cm.additionalProperties, stringCp); + } + + @Test + public void testAdditionalPropertiesPresentInModelProperties() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_7613.yaml"); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + codegen.setDisallowAdditionalPropertiesIfNotPresent(false); + + String modelName; + Schema sc; + CodegenSchema cm; + CodegenSchema anyTypeSchema = codegen.fromSchema( + new Schema(), + "#/components/schemas/AdditionalPropertiesTrue", + "#/components/schemas/AdditionalPropertiesTrue/properties/child/additionalProperties" + ); + CodegenSchema stringCp = codegen.fromSchema( + new Schema().type("string"), + "#/components/schemas/ObjectModelWithAddPropsInProps", + "#/components/schemas/ObjectModelWithAddPropsInProps/properties/map_with_additional_properties_schema/additionalProperties" + ); + CodegenSchema mapWithAddPropsUnset; + CodegenSchema mapWithAddPropsTrue; + CodegenSchema mapWithAddPropsFalse; + CodegenSchema mapWithAddPropsSchema; + + modelName = "ObjectModelWithRefAddPropsInProps"; + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromSchema( + sc, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + CodegenKey ck = codegen.getKey("map_with_additional_properties_unset"); + mapWithAddPropsUnset = cm.properties.get(ck); + assertEquals(mapWithAddPropsUnset.additionalProperties, null); + assertEquals(mapWithAddPropsUnset.refInfo.refClass, "AdditionalPropertiesUnset"); + + mapWithAddPropsTrue = cm.properties.get(codegen.getKey("map_with_additional_properties_true")); + assertEquals(mapWithAddPropsTrue.additionalProperties, null); + assertEquals(mapWithAddPropsTrue.refInfo.refClass, "AdditionalPropertiesTrue"); + + mapWithAddPropsFalse = cm.properties.get(codegen.getKey("map_with_additional_properties_false")); + assertEquals(mapWithAddPropsFalse.additionalProperties, null); + assertEquals(mapWithAddPropsFalse.refInfo.refClass, "AdditionalPropertiesFalse"); + + mapWithAddPropsSchema = cm.properties.get(codegen.getKey("map_with_additional_properties_schema")); + assertEquals(mapWithAddPropsSchema.additionalProperties, null); + assertEquals(mapWithAddPropsSchema.refInfo.refClass, "AdditionalPropertiesSchema"); + + modelName = "ObjectModelWithAddPropsInProps"; + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromSchema( + sc, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + + mapWithAddPropsUnset = cm.properties.get(codegen.getKey("map_with_additional_properties_unset")); + assertEquals(mapWithAddPropsUnset.additionalProperties, null); + + mapWithAddPropsTrue = cm.properties.get(codegen.getKey("map_with_additional_properties_true")); + assertEquals(mapWithAddPropsTrue.additionalProperties, anyTypeSchema); + assertTrue(mapWithAddPropsTrue.additionalProperties.isBooleanSchemaTrue); + + mapWithAddPropsFalse = cm.properties.get(codegen.getKey("map_with_additional_properties_false")); + assertNotNull(mapWithAddPropsFalse.additionalProperties); + assertTrue(mapWithAddPropsFalse.additionalProperties.isBooleanSchemaFalse); + + mapWithAddPropsSchema = cm.properties.get(codegen.getKey("map_with_additional_properties_schema")); + assertEquals(mapWithAddPropsSchema.additionalProperties, stringCp); + } + + @Test + public void testAdditionalPropertiesPresentInParameters() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_7613.yaml"); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + codegen.setDisallowAdditionalPropertiesIfNotPresent(false); + + String path; + Operation operation; + CodegenOperation co; + + codegen.fromSchema( + openAPI.getComponents().getSchemas().get("AdditionalPropertiesUnset"), + "#/components/schemas/AdditionalPropertiesUnset", + "#/components/schemas/AdditionalPropertiesUnset" + ); + codegen.fromSchema( + openAPI.getComponents().getSchemas().get("AdditionalPropertiesTrue"), + "#/components/schemas/AdditionalPropertiesTrue", + "#/components/schemas/AdditionalPropertiesTrue" + ); + codegen.fromSchema( + openAPI.getComponents().getSchemas().get("AdditionalPropertiesFalse"), + "#/components/schemas/AdditionalPropertiesFalse", + "#/components/schemas/AdditionalPropertiesFalse" + ); + codegen.fromSchema( + openAPI.getComponents().getSchemas().get("AdditionalPropertiesSchema"), + "#/components/schemas/AdditionalPropertiesSchema", + "#/components/schemas/AdditionalPropertiesSchema" + ); + CodegenParameter mapWithAddPropsUnset; + CodegenParameter mapWithAddPropsTrue; + CodegenParameter mapWithAddPropsFalse; + CodegenParameter mapWithAddPropsSchema; + + path = "/ref_additional_properties/"; + operation = openAPI.getPaths().get(path).getPost(); + co = codegen.fromOperation(operation, getOperationPath(path, "post")); + mapWithAddPropsUnset = co.queryParams.get(0); + assertEquals(mapWithAddPropsUnset.schema.refInfo.ref.additionalProperties, null); + mapWithAddPropsTrue = co.queryParams.get(1); + assertNotNull(mapWithAddPropsTrue.schema.refInfo); + assertTrue(mapWithAddPropsTrue.schema.refInfo.ref.additionalProperties.isBooleanSchemaTrue); + mapWithAddPropsFalse = co.queryParams.get(2); + assertNotNull(mapWithAddPropsFalse.schema.refInfo.ref.additionalProperties); + assertTrue(mapWithAddPropsFalse.schema.refInfo.ref.additionalProperties.isBooleanSchemaFalse); + mapWithAddPropsSchema = co.queryParams.get(3); + assertNotNull(mapWithAddPropsSchema.schema.refInfo); + + path = "/additional_properties/"; + operation = openAPI.getPaths().get(path).getPost(); + co = codegen.fromOperation(operation, getOperationPath(path, "post")); + mapWithAddPropsUnset = co.queryParams.get(0); + assertEquals(mapWithAddPropsUnset.schema.additionalProperties, null); + mapWithAddPropsTrue = co.queryParams.get(1); + assertTrue(mapWithAddPropsTrue.schema.additionalProperties.isBooleanSchemaTrue); + mapWithAddPropsFalse = co.queryParams.get(2); + assertTrue(mapWithAddPropsFalse.schema.additionalProperties.isBooleanSchemaFalse); + mapWithAddPropsSchema = co.queryParams.get(3); + assertTrue(mapWithAddPropsSchema.schema.additionalProperties.types.contains("string")); + } + + @Test + public void testAdditionalPropertiesPresentInResponses() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_7613.yaml"); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + codegen.setDisallowAdditionalPropertiesIfNotPresent(false); + + String path; + Operation operation; + CodegenOperation co; + + CodegenResponse mapWithAddPropsUnset; + CodegenResponse mapWithAddPropsTrue; + CodegenResponse mapWithAddPropsFalse; + CodegenResponse mapWithAddPropsSchema; + + codegen.fromSchema( + openAPI.getComponents().getSchemas().get("AdditionalPropertiesUnset"), + "#/components/schemas/AdditionalPropertiesUnset", + "#/components/schemas/AdditionalPropertiesUnset" + ); + codegen.fromSchema( + openAPI.getComponents().getSchemas().get("AdditionalPropertiesTrue"), + "#/components/schemas/AdditionalPropertiesTrue", + "#/components/schemas/AdditionalPropertiesTrue" + ); + codegen.fromSchema( + openAPI.getComponents().getSchemas().get("AdditionalPropertiesFalse"), + "#/components/schemas/AdditionalPropertiesFalse", + "#/components/schemas/AdditionalPropertiesFalse" + ); + codegen.fromSchema( + openAPI.getComponents().getSchemas().get("AdditionalPropertiesSchema"), + "#/components/schemas/AdditionalPropertiesSchema", + "#/components/schemas/AdditionalPropertiesSchema" + ); + + path = "/ref_additional_properties/"; + operation = openAPI.getPaths().get(path).getPost(); + co = codegen.fromOperation(operation, getOperationPath(path, "post")); + mapWithAddPropsUnset = co.responses.get("200"); + CodegenKey ck = codegen.getKey("application/json"); + assertEquals(mapWithAddPropsUnset.content.get(ck).schema.refInfo.ref.additionalProperties, null); + mapWithAddPropsTrue = co.responses.get("201"); + ck = codegen.getKey("application/xml"); + assertNotNull(mapWithAddPropsTrue.content.get(ck).schema.refInfo.ref.additionalProperties); + assertTrue(mapWithAddPropsTrue.content.get(ck).schema.refInfo.ref.additionalProperties.isBooleanSchemaTrue); + mapWithAddPropsFalse = co.responses.get("202"); + ck = codegen.getKey("application/x-www-form-urlencoded"); + assertNotNull(mapWithAddPropsFalse.content.get(ck).schema.refInfo.ref.additionalProperties); + assertTrue(mapWithAddPropsFalse.content.get(ck).schema.refInfo.ref.additionalProperties.isBooleanSchemaFalse); + mapWithAddPropsSchema = co.responses.get("203"); + ck = codegen.getKey("application/*"); + assertNotNull(mapWithAddPropsSchema.content.get(ck).schema.refInfo); + + path = "/additional_properties/"; + operation = openAPI.getPaths().get(path).getPost(); + co = codegen.fromOperation(operation, getOperationPath(path, "post")); + mapWithAddPropsUnset = co.responses.get("200"); + ck = codegen.getKey("application/json"); + assertEquals(mapWithAddPropsUnset.content.get(ck).schema.additionalProperties, null); + mapWithAddPropsTrue = co.responses.get("201"); + ck = codegen.getKey("application/xml"); + assertNotNull(mapWithAddPropsTrue.content.get(ck).schema.additionalProperties); + assertTrue(mapWithAddPropsTrue.content.get(ck).schema.additionalProperties.isBooleanSchemaTrue); + mapWithAddPropsFalse = co.responses.get("202"); + ck = codegen.getKey("application/x-www-form-urlencoded"); + assertNotNull(mapWithAddPropsFalse.content.get(ck).schema.additionalProperties); + assertTrue(mapWithAddPropsFalse.content.get(ck).schema.additionalProperties.isBooleanSchemaFalse); + mapWithAddPropsSchema = co.responses.get("203"); + ck = codegen.getKey("application/*"); + assertTrue(mapWithAddPropsSchema.content.get(ck).schema.additionalProperties.types.contains("string")); + } + + @Test + public void testAdditionalPropertiesAnyType() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_9282.yaml"); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + + CodegenSchema anyTypeSchema = codegen.fromSchema( + new Schema(), + "#/components/schemas/AdditionalPropertiesTrue", + "#/components/schemas/AdditionalPropertiesTrue/properties/child/additionalProperties" + ); + + Schema sc; + CodegenSchema cm; + + sc = openAPI.getComponents().getSchemas().get("AdditionalPropertiesTrue"); + cm = codegen.fromSchema( + sc, + "#/components/schemas/AdditionalPropertiesTrue", + "#/components/schemas/AdditionalPropertiesTrue" + ); + CodegenKey ck = codegen.getKey("child"); + assertEquals(cm.properties.get(ck).additionalProperties, anyTypeSchema); + + sc = openAPI.getComponents().getSchemas().get("AdditionalPropertiesAnyType"); + cm = codegen.fromSchema( + sc, + "#/components/schemas/AdditionalPropertiesAnyType", + "#/components/schemas/AdditionalPropertiesAnyType" + ); + assertEquals(cm.properties.get(ck).additionalProperties, anyTypeSchema); + } + + @Test + public void testIsXPresence() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_7651.yaml"); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + + String modelName; + Schema sc; + CodegenSchema cm; + + modelName = "DateWithValidation"; + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromSchema( + sc, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + assertTrue(cm.types.contains("string")); + assertEquals(cm.format, "date"); + + modelName = "NullModel"; + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromSchema( + sc, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + assertTrue(cm.types.contains("null")); + + modelName = "ObjectWithTypeNullProperties"; + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromSchema( + sc, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + CodegenKey ck = codegen.getKey("nullProp"); + assertTrue(cm.properties.get(ck).types.contains("null")); + assertTrue(cm.properties.get(codegen.getKey("listOfNulls")).items.types.contains("null")); + assertTrue(cm.additionalProperties.types.contains("null")); + + modelName = "ArrayOfNulls"; + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromSchema( + sc, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + assertTrue(cm.items.types.contains("null")); + + modelName = "ObjectWithDateWithValidation"; + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromSchema( + sc, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + ck = codegen.getKey("dateWithValidation"); + assertTrue(cm.properties.get(ck).types.contains("string")); + assertEquals(cm.properties.get(ck).format, "date"); + + String path; + Operation operation; + CodegenOperation co; + + path = "/ref_date_with_validation/{date}"; + operation = openAPI.getPaths().get(path).getPost(); + co = codegen.fromOperation(operation, getOperationPath(path, "post")); + assertTrue(co.pathParams.get(0).schema.refInfo.ref.types.contains("string")); + assertEquals(co.pathParams.get(0).schema.refInfo.ref.format, "date"); + CodegenKey applicationJson = codegen.getKey("application/json"); + assertTrue(co.requestBody.content.get(applicationJson).schema.refInfo.ref.types.contains("string")); + assertEquals(co.requestBody.content.get(applicationJson).schema.refInfo.ref.format, "date"); + assertTrue(co.responses.get("200").content.get(applicationJson).schema.refInfo.ref.types.contains("string")); + assertEquals(co.responses.get("200").content.get(applicationJson).schema.refInfo.ref.format, "date"); + + path = "/date_with_validation/{date}"; + operation = openAPI.getPaths().get(path).getPost(); + co = codegen.fromOperation(operation, getOperationPath(path, "post")); + assertTrue(co.pathParams.get(0).schema.types.contains("string")); + assertEquals(co.pathParams.get(0).schema.format, "date"); + assertTrue(co.requestBody.content.get(applicationJson).schema.types.contains("string")); + assertEquals(co.requestBody.content.get(applicationJson).schema.format, "date"); + assertTrue(co.responses.get("200").content.get(applicationJson).schema.types.contains("string")); + assertEquals(co.responses.get("200").content.get(applicationJson).schema.format, "date"); + + modelName = "DateTimeWithValidation"; + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromSchema( + sc, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + assertTrue(cm.types.contains("string")); + assertEquals(cm.format, "date-time"); + + modelName = "ObjectWithDateTimeWithValidation"; + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromSchema( + sc, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + ck = codegen.getKey("dateWithValidation"); + assertTrue(cm.properties.get(ck).types.contains("string")); + assertEquals(cm.properties.get(ck).format, "date-time"); + + path = "/ref_date_time_with_validation/{dateTime}"; + operation = openAPI.getPaths().get(path).getPost(); + co = codegen.fromOperation(operation, getOperationPath(path, "post")); + assertTrue(co.pathParams.get(0).schema.refInfo.ref.types.contains("string")); + assertEquals(co.pathParams.get(0).schema.refInfo.ref.format, "date-time"); + assertTrue(co.requestBody.content.get(applicationJson).schema.refInfo.ref.types.contains("string")); + assertEquals(co.requestBody.content.get(applicationJson).schema.refInfo.ref.format, "date-time"); + assertTrue(co.responses.get("200").content.get(applicationJson).schema.refInfo.ref.types.contains("string")); + assertEquals(co.responses.get("200").content.get(applicationJson).schema.refInfo.ref.format, "date-time"); + + path = "/date_time_with_validation/{dateTime}"; + operation = openAPI.getPaths().get(path).getPost(); + co = codegen.fromOperation(operation, getOperationPath(path, "post")); + assertTrue(co.pathParams.get(0).schema.types.contains("string")); + assertEquals(co.pathParams.get(0).schema.format, "date-time"); + assertTrue(co.requestBody.content.get(applicationJson).schema.types.contains("string")); + assertEquals(co.requestBody.content.get(applicationJson).schema.format, "date-time"); + assertTrue(co.responses.get("200").content.get(applicationJson).schema.types.contains("string")); + assertEquals(co.responses.get("200").content.get(applicationJson).schema.format, "date-time"); + + path = "/null/{param}"; + operation = openAPI.getPaths().get(path).getPost(); + co = codegen.fromOperation(operation, getOperationPath(path, "post")); + assertTrue(co.pathParams.get(0).schema.types.contains("null")); + assertTrue(co.requestBody.content.get(applicationJson).schema.types.contains("null")); + assertTrue(co.responses.get("200").content.get(applicationJson).schema.types.contains("null")); + + path = "/ref_null/{param}"; + operation = openAPI.getPaths().get(path).getPost(); + co = codegen.fromOperation(operation, getOperationPath(path, "post")); + assertTrue(co.pathParams.get(0).schema.refInfo.ref.types.contains("null")); + assertTrue(co.requestBody.content.get(applicationJson).schema.refInfo.ref.types.contains("null")); + assertTrue(co.responses.get("200").content.get(applicationJson).schema.refInfo.ref.types.contains("null")); + } + + @Test + public void testModelGetHasValidation() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_7651.yaml"); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + + Schema sc; + CodegenSchema cm; + + List modelNames = Arrays.asList( + "ArrayWithMaxItems", + "ArrayWithMinItems", + "ArrayWithUniqueItems", + "ObjectWithMinProperties", + "ObjectWithMaxProperties", + "StringWithMinLength", + "DateWithMinLength", + "DateTimeWithMinLength", + "ByteWithMinLength", + "BinaryWithMinLength", + "StringWithMaxLength", + "DateWithMaxLength", + "DateTimeWithMaxLength", + "ByteWithMaxLength", + "BinaryWithMaxLength", + "IntegerWithMultipleOf", + "Integer32WithMultipleOf", + "Integer64WithMultipleOf", + "NumberWithMultipleOf", + "NumberFloatWithMultipleOf", + "NumberDoubleWithMultipleOf", + "StringWithPattern", + "DateWithPattern", + "DateTimeWithPattern", + "ByteWithPattern", + "BinaryWithPattern", + "IntegerWithMinimum", + "Integer32WithMinimum", + "Integer64WithMinimum", + "NumberWithMinimum", + "NumberFloatWithMinimum", + "NumberDoubleWithMinimum", + "IntegerWithMaximum", + "Integer32WithMaximum", + "Integer64WithMaximum", + "NumberWithMaximum", + "NumberFloatWithMaximum", + "NumberDoubleWithMaximum", + "IntegerWithExclusiveMaximum", + "Integer32WithExclusiveMaximum", + "Integer64WithExclusiveMaximum", + "NumberWithExclusiveMaximum", + "NumberFloatWithExclusiveMaximum", + "NumberDoubleWithExclusiveMaximum", + "IntegerWithExclusiveMinimum", + "Integer32WithExclusiveMinimum", + "Integer64WithExclusiveMinimum", + "NumberWithExclusiveMinimum", + "NumberFloatWithExclusiveMinimum", + "NumberDoubleWithExclusiveMinimum" + ); + for (String modelName : modelNames) { + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromSchema( + sc, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + assertTrue(cm.hasValidation()); + } + } + + @Test + public void testPropertyGetHasValidation() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_7651.yaml"); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + + String modelName = "ObjectWithPropertiesThatHaveValidations"; + Schema sc = openAPI.getComponents().getSchemas().get(modelName); + CodegenSchema cm = codegen.fromSchema( + sc, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + + List props = cm.properties.values().stream().collect(Collectors.toList()); + assertEquals(props.size(), 50); + for (CodegenSchema prop : props) { + assertTrue(prop.hasValidation()); + } + } + + @Test + public void testQueryParametersGetHasValidation() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_7651.yaml"); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + + String path = "/queryParametersWithValidation"; + Operation operation = openAPI.getPaths().get(path).getPost(); + CodegenOperation co = codegen.fromOperation(operation, getOperationPath(path, "post")); + List params = co.queryParams; + assertEquals(params.size(), 50); + for (CodegenParameter param : params) { + assertTrue(param.schema.hasValidation()); + } + } + + @Test + public void testHeaderParametersGetHasValidation() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_7651.yaml"); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + + String path = "/headerParametersWithValidation"; + Operation operation = openAPI.getPaths().get(path).getPost(); + CodegenOperation co = codegen.fromOperation(operation, getOperationPath(path, "post")); + List params = co.headerParams; + assertEquals(params.size(), 50); + for (CodegenParameter param : params) { + assertTrue(param.schema.hasValidation()); + } + } + + @Test + public void testCookieParametersGetHasValidation() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_7651.yaml"); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + + String path = "/cookieParametersWithValidation"; + Operation operation = openAPI.getPaths().get(path).getPost(); + CodegenOperation co = codegen.fromOperation(operation, getOperationPath(path, "post")); + List params = co.cookieParams; + assertEquals(params.size(), 50); + for (CodegenParameter param : params) { + assertTrue(param.schema.hasValidation()); + } + } + + @Test + public void testPathParametersGetHasValidation() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_7651.yaml"); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + + String path = "/pathParametersWithValidation"; + Operation operation = openAPI.getPaths().get(path).getPost(); + CodegenOperation co = codegen.fromOperation(operation, getOperationPath(path, "post")); + List params = co.pathParams; + assertEquals(params.size(), 50); + for (CodegenParameter param : params) { + assertTrue(param.schema.hasValidation()); + } + } + + @Test + public void testBodyAndResponseGetHasValidation() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_7651.yaml"); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + + List modelNames = Arrays.asList( + "ArrayWithMaxItems", + "ArrayWithMinItems", + "ArrayWithUniqueItems", + "ObjectWithMinProperties", + "ObjectWithMaxProperties", + "StringWithMinLength", + "DateWithMinLength", + "DateTimeWithMinLength", + "ByteWithMinLength", + "BinaryWithMinLength", + "StringWithMaxLength", + "DateWithMaxLength", + "DateTimeWithMaxLength", + "ByteWithMaxLength", + "BinaryWithMaxLength", + "StringWithPattern", + "DateWithPattern", + "DateTimeWithPattern", + "ByteWithPattern", + "BinaryWithPattern", + "IntegerWithMultipleOf", + "Integer32WithMultipleOf", + "Integer64WithMultipleOf", + "NumberWithMultipleOf", + "NumberFloatWithMultipleOf", + "NumberDoubleWithMultipleOf", + "IntegerWithMinimum", + "Integer32WithMinimum", + "Integer64WithMinimum", + "NumberWithMinimum", + "NumberFloatWithMinimum", + "NumberDoubleWithMinimum", + "IntegerWithMaximum", + "Integer32WithMaximum", + "Integer64WithMaximum", + "NumberWithMaximum", + "NumberFloatWithMaximum", + "NumberDoubleWithMaximum", + "IntegerWithExclusiveMaximum", + "Integer32WithExclusiveMaximum", + "Integer64WithExclusiveMaximum", + "NumberWithExclusiveMaximum", + "NumberFloatWithExclusiveMaximum", + "NumberDoubleWithExclusiveMaximum", + "IntegerWithExclusiveMinimum", + "Integer32WithExclusiveMinimum", + "Integer64WithExclusiveMinimum", + "NumberWithExclusiveMinimum", + "NumberFloatWithExclusiveMinimum", + "NumberDoubleWithExclusiveMinimum" + ); + + String path; + Operation operation; + CodegenOperation co; + + for (String modelName : modelNames) { + path = "/" + modelName; + operation = openAPI.getPaths().get(path).getPost(); + co = codegen.fromOperation(operation, getOperationPath(path, "post")); + CodegenKey ck = codegen.getKey("application/json"); + assertTrue(co.requestBody.content.get(ck).schema.hasValidation()); + assertTrue(co.responses.get("200").content.get(ck).schema.hasValidation()); + } + } + + @Test + public void testVarsAndRequiredVarsPresent() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_7613.yaml"); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + codegen.setDisallowAdditionalPropertiesIfNotPresent(false); + + String modelName; + Schema sc; + CodegenSchema cm; + modelName = "ObjectWithOptionalAndRequiredProps"; + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromSchema( + sc, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + assertEquals(cm.properties.size(), 3); + assertEquals(cm.requiredProperties.size(), 2); + + String path; + Operation operation; + CodegenOperation co; + + path = "/object_with_optional_and_required_props/{objectData}"; + operation = openAPI.getPaths().get(path).getPost(); + co = codegen.fromOperation(operation, getOperationPath(path, "post")); + + assertEquals(co.pathParams.get(0).schema.properties.size(), 3); + assertEquals(co.pathParams.get(0).schema.requiredProperties.size(), 2); + CodegenKey applicationJson = codegen.getKey("application/json"); + assertEquals(co.requestBody.content.get(applicationJson).schema.properties.size(), 3); + assertEquals(co.requestBody.content.get(applicationJson).schema.requiredProperties.size(), 2); + + assertEquals(co.responses.get("200").content.get(applicationJson).schema.properties.size(), 3); + assertEquals(co.responses.get("200").content.get(applicationJson).schema.requiredProperties.size(), 2); + + // CodegenSchema puts the inline schema into schemas and refs it + modelName = "ObjectPropContainsProps"; + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromSchema( + sc, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + CodegenKey ck = codegen.getKey("a"); + CodegenSchema cp = cm.properties.get(ck); + assertEquals(cp.properties.size(), 3); + assertEquals(cp.requiredProperties.size(), 2); + } + + @Test + public void testHasVarsInModel() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_7613.yaml"); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + codegen.setDisallowAdditionalPropertiesIfNotPresent(false); + + Schema sc; + CodegenSchema cm; + List modelNames; + + modelNames = Arrays.asList( + "ArrayWithValidationsInItems", + "ObjectWithValidationsInAdditionalProperties", + "AdditionalPropertiesUnset", + "AdditionalPropertiesTrue", + "AdditionalPropertiesFalse", + "AdditionalPropertiesSchema" + ); + for (String modelName : modelNames) { + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromSchema( + sc, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + assertTrue(cm.properties == null); + } + + modelNames = Arrays.asList( + "ObjectModelWithRefAddPropsInProps", + "ObjectModelWithAddPropsInProps", + "ObjectWithOptionalAndRequiredProps", + "ObjectPropContainsProps" + ); + for (String modelName : modelNames) { + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromSchema( + sc, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + assertTrue(cm.properties.size() > 0); + } + } + + @Test + public void testHasVarsInProperty() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_7613.yaml"); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + codegen.setDisallowAdditionalPropertiesIfNotPresent(false); + + Schema sc; + CodegenSchema cm; + List modelNames; + + modelNames = Arrays.asList( + "ObjectWithValidationsInArrayPropItems", + "ObjectModelWithRefAddPropsInProps", + "ObjectModelWithAddPropsInProps", + "ObjectWithOptionalAndRequiredProps" + ); + HashMap hm = new HashMap<>(); + hm.put("ObjectWithValidationsInArrayPropItems", "arrayProp"); + hm.put("ObjectModelWithRefAddPropsInProps", "map_with_additional_properties_unset"); + hm.put("ObjectModelWithAddPropsInProps", "map_with_additional_properties_unset"); + hm.put("ObjectWithOptionalAndRequiredProps", "a"); + for (String modelName : modelNames) { + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromSchema( + sc, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + CodegenKey ck = codegen.getKey(hm.get(modelName)); + assertTrue(cm.properties.get(ck).properties == null); + } + + String modelName; + modelName = "ArrayWithObjectWithPropsInItems"; + ArraySchema as = (ArraySchema) openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromSchema( + as, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + assertTrue(cm.items.properties.size() > 0); + + modelName = "ObjectWithObjectWithPropsInAdditionalProperties"; + MapSchema ms = (MapSchema) openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromSchema( + ms, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + assertTrue(cm.additionalProperties.properties.size() > 0); + } + + @Test + public void testHasVarsInParameter() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_7613.yaml"); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + codegen.setDisallowAdditionalPropertiesIfNotPresent(false); + + String path; + Operation operation; + CodegenOperation co; + + path = "/array_with_validations_in_items/{items}"; + operation = openAPI.getPaths().get(path).getPost(); + co = codegen.fromOperation(operation, getOperationPath(path, "post")); + assertTrue(co.pathParams.get(0).schema.properties == null); + CodegenKey ck = codegen.getKey("application/json"); + assertTrue(co.requestBody.content.get(ck).schema.properties == null); + + path = "/object_with_optional_and_required_props/{objectData}"; + operation = openAPI.getPaths().get(path).getPost(); + co = codegen.fromOperation(operation, getOperationPath(path, "post")); + + assertTrue(co.pathParams.get(0).schema.properties.size() == 3); + assertTrue(co.requestBody.content.get(ck).schema.properties.size() == 3); + } + + @Test + public void testHasVarsInResponse() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_7613.yaml"); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + codegen.setDisallowAdditionalPropertiesIfNotPresent(false); + + String path; + Operation operation; + CodegenOperation co; + + path = "/additional_properties/"; + operation = openAPI.getPaths().get(path).getPost(); + co = codegen.fromOperation(operation, getOperationPath(path, "post")); + CodegenKey applicationJson = codegen.getKey("application/json"); + assertTrue(co.responses.get("200").content.get(applicationJson).schema.properties == null); + + path = "/object_with_optional_and_required_props/{objectData}"; + operation = openAPI.getPaths().get(path).getPost(); + co = codegen.fromOperation(operation, getOperationPath(path, "post")); + + assertTrue(co.responses.get("200").content.get(applicationJson).schema.properties.size() == 3); + } + + @Test + public void testHasRequiredInModel() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_8906.yaml"); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + codegen.setDisallowAdditionalPropertiesIfNotPresent(false); + + Schema sc; + CodegenSchema cm; + + List modelNamesWithoutRequired = Arrays.asList( + "EmptyObject", + "ObjectWithOptionalB", + "AnyTypeNoPropertiesNoRequired", + "AnyTypeHasPropertiesNoRequired", + "ObjectNoPropertiesNoRequired", + "ObjectHasPropertiesNoRequired", + "ComposedNoAllofPropsNoPropertiesNoRequired", + "ComposedNoAllofPropsHasPropertiesNoRequired", + "ComposedHasAllofOptPropNoPropertiesNoRequired", + "ComposedHasAllofOptPropHasPropertiesNoRequired", + "ComposedHasAllofReqPropNoPropertiesNoRequired", + "ComposedHasAllofReqPropHasPropertiesNoRequired" + ); + for (String modelName : modelNamesWithoutRequired) { + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromSchema( + sc, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + LinkedHashMap requiredProps = cm.requiredProperties; + assertNull(requiredProps); + } + + List modelNamesWithRequired = Arrays.asList( + "AnyTypeHasPropertiesHasRequired", + "ObjectHasPropertiesHasRequired", + "AnyTypeNoPropertiesHasRequired", + "ComposedNoAllofPropsHasPropertiesHasRequired", + "ComposedHasAllofOptPropHasPropertiesHasRequired", + "ComposedHasAllofReqPropHasPropertiesHasRequired", + "ComposedNoAllofPropsNoPropertiesHasRequired", + "ComposedHasAllofOptPropNoPropertiesHasRequired", + "ComposedHasAllofReqPropNoPropertiesHasRequired" + ); + for (String modelName : modelNamesWithRequired) { + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromSchema( + sc, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + LinkedHashMap requiredProps = cm.requiredProperties; + assertNotNull(requiredProps); + assertTrue(requiredProps.size() > 0); + } + } + + @Test + public void testHasRequiredInProperties() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_8906.yaml"); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + codegen.setDisallowAdditionalPropertiesIfNotPresent(false); + + String modelName = "CodegenPropertiesModel"; + Schema sc = openAPI.getComponents().getSchemas().get(modelName); + CodegenSchema cm = codegen.fromSchema( + sc, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + + HashSet propertyNamesWithoutRequired = new HashSet(Arrays.asList( + "EmptyObject", + "ObjectWithOptionalB", + "AnyTypeNoPropertiesNoRequired", + "AnyTypeHasPropertiesNoRequired", + "ObjectNoPropertiesNoRequired", + "ObjectHasPropertiesNoRequired", + "ComposedNoAllofPropsNoPropertiesNoRequired", + "ComposedNoAllofPropsHasPropertiesNoRequired", + "ComposedHasAllofOptPropNoPropertiesNoRequired", + "ComposedHasAllofOptPropHasPropertiesNoRequired", + "ComposedHasAllofReqPropNoPropertiesNoRequired", + "ComposedHasAllofReqPropHasPropertiesNoRequired" + )); + for (CodegenKey key: cm.properties.keySet()) { + CodegenSchema prop = cm.properties.get(key); + if (propertyNamesWithoutRequired.contains(key.original)) { + assertNull(prop.requiredProperties); + } else { + assertNotNull(prop.requiredProperties); + assertTrue(!prop.requiredProperties.isEmpty()); + } + } + } + + @Test + public void testHasRequiredInParameters() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_8906.yaml"); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + codegen.setDisallowAdditionalPropertiesIfNotPresent(false); + + String path = "/schemasInQueryParamsAndResponses"; + Operation operation = openAPI.getPaths().get(path).getPost(); + CodegenOperation co = codegen.fromOperation(operation, getOperationPath(path, "post")); + + HashSet modelNamesWithoutRequired = new HashSet(Arrays.asList( + "EmptyObject", + "ObjectWithOptionalB", + "AnyTypeNoPropertiesNoRequired", + "AnyTypeHasPropertiesNoRequired", + "AnyTypeNoPropertiesHasRequired", // TODO: hasRequired should be true, fix this + "AnyTypeHasPropertiesHasRequired", // TODO: hasRequired should be true, fix this + "ObjectNoPropertiesNoRequired", + "ObjectHasPropertiesNoRequired", // Note: this is extracted into another component and is a ref + "ObjectNoPropertiesHasRequired", // TODO: hasRequired should be true, fix this + "ComposedNoAllofPropsNoPropertiesNoRequired", + "ComposedNoAllofPropsHasPropertiesNoRequired", + "ComposedNoAllofPropsNoPropertiesHasRequired", // TODO: hasRequired should be true, fix this + "ComposedHasAllofOptPropNoPropertiesNoRequired", + "ComposedHasAllofOptPropHasPropertiesNoRequired", + "ComposedHasAllofOptPropNoPropertiesHasRequired", // TODO: hasRequired should be true, fix this + "ObjectHasPropertiesHasRequired", // False because this is extracted into another component and is a ref + "ComposedNoAllofPropsHasPropertiesHasRequired", // False because this is extracted into another component and is a ref + "ComposedHasAllofOptPropHasPropertiesHasRequired", // TODO: hasRequired should be true, fix this + "ComposedHasAllofReqPropNoPropertiesNoRequired", + "ComposedHasAllofReqPropHasPropertiesNoRequired", + "ComposedHasAllofReqPropNoPropertiesHasRequired", // TODO: hasRequired should be true, fix this + "ComposedHasAllofReqPropHasPropertiesHasRequired" // TODO: hasRequired should be true, fix this + )); + for (CodegenParameter param : co.pathParams) { + if (!modelNamesWithoutRequired.contains(param.name)) { + // All variables must be in the above sets + fail(); + } + } + } + + @Test + public void testHasRequiredInResponses() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_8906.yaml"); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + codegen.setDisallowAdditionalPropertiesIfNotPresent(false); + + String path = "/schemasInQueryParamsAndResponses"; + Operation operation = openAPI.getPaths().get(path).getPost(); + CodegenOperation co = codegen.fromOperation(operation, getOperationPath(path, "post")); + + HashSet modelNamesWithoutRequired = new HashSet(Arrays.asList( + "EmptyObject", + "ObjectWithOptionalB", + "AnyTypeNoPropertiesNoRequired", + "AnyTypeHasPropertiesNoRequired", + "ObjectNoPropertiesNoRequired", + "ObjectHasPropertiesNoRequired", + "ComposedNoAllofPropsNoPropertiesNoRequired", + "ComposedNoAllofPropsHasPropertiesNoRequired", + "ComposedHasAllofOptPropNoPropertiesNoRequired", + "ComposedHasAllofOptPropHasPropertiesNoRequired", + "ComposedHasAllofReqPropNoPropertiesNoRequired", + "ComposedHasAllofReqPropHasPropertiesNoRequired" + )); + CodegenKey ck = codegen.getKey("application/json"); + for (CodegenResponse cr : co.responses.values()) { + LinkedHashMap reqProps = cr.content.get(ck).schema.requiredProperties; + if (modelNamesWithoutRequired.contains(cr.description)) { + assertNull(reqProps); + } else { + assertNotNull(reqProps); + assertTrue(!reqProps.isEmpty()); + } + } + } + + @Test + public void testBooleansSetForIntSchemas() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_9447.yaml"); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + codegen.setDisallowAdditionalPropertiesIfNotPresent(false); + + String modelName; + Schema sc; + CodegenSchema cm; + + modelName = "UnboundedInteger"; + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromSchema( + sc, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + assertTrue(cm.types.contains("integer")); + assertTrue(cm.format == null); + + modelName = "Int32"; + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromSchema( + sc, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + assertTrue(cm.types.contains("integer")); + assertEquals(cm.format, "int32"); + + modelName = "Int64"; + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromSchema( + sc, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + assertTrue(cm.types.contains("integer")); + assertTrue(cm.format.equals("int64")); + + modelName = "ObjectModelWithIntegerProps"; + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromSchema( + sc, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + assertTrue(cm.types.contains("object")); + + CodegenSchema cp; + CodegenKey ck = codegen.getKey("UnboundedInteger"); + cp = cm.properties.get(ck); + assertTrue(cp.types.contains("integer")); + assertNull(cp.format); + + ck = codegen.getKey("Int32"); + cp = cm.properties.get(ck); + assertTrue(cp.types.contains("integer")); + assertEquals(cp.format, "int32"); + + ck = codegen.getKey("Int64"); + cp = cm.properties.get(ck); + assertTrue(cp.types.contains("integer")); + assertEquals(cp.format, "int64"); + + String path; + Operation operation; + CodegenOperation co; + CodegenParameter cpa; + CodegenResponse cr; + + path = "/UnboundedInteger"; + operation = openAPI.getPaths().get(path).getPost(); + co = codegen.fromOperation(operation, getOperationPath(path, "post")); + cpa = co.pathParams.get(0); + assertTrue(cpa.schema.types.contains("integer")); + assertNull(cpa.schema.format); + CodegenRequestBody crb = co.requestBody; + ck = codegen.getKey("application/json"); + assertTrue(crb.content.get(ck).schema.types.contains("integer")); + assertNull(crb.content.get(ck).schema.format); + cr = co.responses.get("200"); + assertTrue(cr.content.get(ck).schema.types.contains("integer")); + assertNull(cr.content.get(ck).schema.format); + + path = "/Int32"; + operation = openAPI.getPaths().get(path).getPost(); + co = codegen.fromOperation(operation, getOperationPath(path, "post")); + cpa = co.pathParams.get(0); + assertTrue(cpa.schema.types.contains("integer")); + assertEquals(cpa.schema.format, "int32"); + crb = co.requestBody; + assertTrue(crb.content.get(ck).schema.types.contains("integer")); + assertEquals(crb.content.get(ck).schema.format, "int32"); + cr = co.responses.get("200"); + assertTrue(cr.content.get(ck).schema.types.contains("integer")); + assertEquals(cr.content.get(ck).schema.format, "int32"); + + path = "/Int64"; + operation = openAPI.getPaths().get(path).getPost(); + co = codegen.fromOperation(operation, getOperationPath(path, "post")); + cpa = co.pathParams.get(0); + assertTrue(cpa.schema.types.contains("integer")); + assertEquals(cpa.schema.format, "int64"); + crb = co.requestBody; + assertTrue(crb.content.get(ck).schema.types.contains("integer")); + assertEquals(crb.content.get(ck).schema.format, "int64"); + cr = co.responses.get("200"); + assertTrue(cr.content.get(ck).schema.types.contains("integer")); + assertEquals(cr.content.get(ck).schema.format, "int64"); + } + + @Test + public void testRemoveOperationIdPrefix() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/bugs/issue_9719.yaml"); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + codegen.setDisallowAdditionalPropertiesIfNotPresent(false); + + String path; + Operation operation; + CodegenOperation co; + + codegen.additionalProperties().put(CodegenConstants.REMOVE_OPERATION_ID_PREFIX, "True"); + codegen.additionalProperties().put(CodegenConstants.REMOVE_OPERATION_ID_PREFIX_DELIMITER, "."); + codegen.additionalProperties().put(CodegenConstants.REMOVE_OPERATION_ID_PREFIX_COUNT, 2); + codegen.processOpts(); + path = "/dotDelimiter"; + operation = openAPI.getPaths().get(path).getGet(); + co = codegen.fromOperation(operation, getOperationPath(path, "get")); + assertEquals(co.operationId.camelCase, "UsersGetAll"); + + codegen.additionalProperties().put(CodegenConstants.REMOVE_OPERATION_ID_PREFIX, "True"); + codegen.additionalProperties().put(CodegenConstants.REMOVE_OPERATION_ID_PREFIX_DELIMITER, "."); + codegen.additionalProperties().put(CodegenConstants.REMOVE_OPERATION_ID_PREFIX_COUNT, -1); + codegen.processOpts(); + path = "/dotDelimiter"; + operation = openAPI.getPaths().get(path).getGet(); + co = codegen.fromOperation(operation, getOperationPath(path, "get")); + assertEquals(co.operationId.camelCase, "GetAll"); + + codegen.additionalProperties().put(CodegenConstants.REMOVE_OPERATION_ID_PREFIX, "True"); + codegen.additionalProperties().put(CodegenConstants.REMOVE_OPERATION_ID_PREFIX_DELIMITER, "."); + codegen.additionalProperties().put(CodegenConstants.REMOVE_OPERATION_ID_PREFIX_COUNT, 10); + codegen.processOpts(); + path = "/dotDelimiter"; + operation = openAPI.getPaths().get(path).getGet(); + co = codegen.fromOperation(operation, getOperationPath(path, "get")); + assertEquals(co.operationId.camelCase, "GetAll"); + + codegen.additionalProperties().put(CodegenConstants.REMOVE_OPERATION_ID_PREFIX, "True"); + codegen.additionalProperties().put(CodegenConstants.REMOVE_OPERATION_ID_PREFIX_DELIMITER, "_"); + codegen.additionalProperties().put(CodegenConstants.REMOVE_OPERATION_ID_PREFIX_COUNT, 2); + codegen.processOpts(); + path = "/underscoreDelimiter"; + operation = openAPI.getPaths().get(path).getGet(); + co = codegen.fromOperation(operation, getOperationPath(path, "get")); + assertEquals(co.operationId.camelCase, "UsersGetAll"); + + codegen.additionalProperties().put(CodegenConstants.REMOVE_OPERATION_ID_PREFIX, "True"); + codegen.additionalProperties().put(CodegenConstants.REMOVE_OPERATION_ID_PREFIX_DELIMITER, "_"); + codegen.additionalProperties().put(CodegenConstants.REMOVE_OPERATION_ID_PREFIX_COUNT, -1); + codegen.processOpts(); + path = "/underscoreDelimiter"; + operation = openAPI.getPaths().get(path).getGet(); + co = codegen.fromOperation(operation, getOperationPath(path, "get")); + assertEquals(co.operationId.camelCase, "GetAll"); + + codegen.additionalProperties().put(CodegenConstants.REMOVE_OPERATION_ID_PREFIX, "True"); + codegen.additionalProperties().put(CodegenConstants.REMOVE_OPERATION_ID_PREFIX_DELIMITER, "_"); + codegen.additionalProperties().put(CodegenConstants.REMOVE_OPERATION_ID_PREFIX_COUNT, 10); + codegen.processOpts(); + path = "/underscoreDelimiter"; + operation = openAPI.getPaths().get(path).getGet(); + co = codegen.fromOperation(operation, getOperationPath(path, "get")); + assertEquals(co.operationId.camelCase, "GetAll"); + } + + @Test + @Ignore + public void testComposedPropertyTypes() { + DefaultCodegen codegen = new DefaultCodegen(); + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_10330.yaml"); + codegen.setOpenAPI(openAPI); + String modelName; + + modelName = "ObjectWithComposedProperties"; + CodegenSchema m = codegen.fromSchema( + openAPI.getComponents().getSchemas().get(modelName), + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + /* TODO inline allOf schema are created as separate models and the following assumptions that + the properties are non-model are no longer valid and need to be revised + assertTrue(m.vars.get(0).getIsMap()); + assertTrue(m.vars.get(1).getIsNumber()); + assertTrue(m.vars.get(2).getIsUnboundedInteger()); + assertTrue(m.vars.get(3).getIsString()); + assertTrue(m.vars.get(4).getIsBoolean()); + assertTrue(m.vars.get(5).getIsArray()); + assertTrue(m.vars.get(6).getIsNull()); + assertTrue(m.vars.get(7).getIsAnyType()); + */ + } + + @Test + public void testComposedModelTypes() { + DefaultCodegen codegen = new DefaultCodegen(); + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_10330.yaml"); + codegen.setOpenAPI(openAPI); + String modelName; + CodegenSchema m; + + modelName = "ComposedObject"; + m = codegen.fromSchema( + openAPI.getComponents().getSchemas().get(modelName), + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + assertTrue(m.types.contains("object")); + + modelName = "ComposedNumber"; + m = codegen.fromSchema( + openAPI.getComponents().getSchemas().get(modelName), + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + assertTrue(m.types.contains("number")); + + modelName = "ComposedInteger"; + m = codegen.fromSchema( + openAPI.getComponents().getSchemas().get(modelName), + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + assertTrue(m.types.contains("integer")); + + modelName = "ComposedString"; + m = codegen.fromSchema( + openAPI.getComponents().getSchemas().get(modelName), + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + assertTrue(m.types.contains("string")); + + modelName = "ComposedBool"; + m = codegen.fromSchema( + openAPI.getComponents().getSchemas().get(modelName), + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + assertTrue(m.types.contains("boolean")); + + modelName = "ComposedArray"; + m = codegen.fromSchema(openAPI.getComponents().getSchemas().get(modelName), + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + assertTrue(m.types.contains("array")); + + modelName = "ComposedNone"; + m = codegen.fromSchema( + openAPI.getComponents().getSchemas().get(modelName), + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + assertTrue(m.types.contains("null")); + + modelName = "ComposedAnyType"; + m = codegen.fromSchema( + openAPI.getComponents().getSchemas().get(modelName), + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + assertTrue(m.types == null); + } + + @Test + public void testComposedResponseTypes() { + DefaultCodegen codegen = new DefaultCodegen(); + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_10330.yaml"); + codegen.setOpenAPI(openAPI); + String path; + CodegenOperation co; + CodegenResponse cr; + + path = "/ComposedObject"; + co = codegen.fromOperation(openAPI.getPaths().get(path).getGet(), getOperationPath(path, "get")); + cr = co.responses.get("200"); + CodegenKey ck = codegen.getKey("application/json"); + assertTrue(cr.content.get(ck).schema.types.contains("object")); + + path = "/ComposedNumber"; + co = codegen.fromOperation(openAPI.getPaths().get(path).getGet(), getOperationPath(path, "get")); + cr = co.responses.get("200"); + assertTrue(cr.content.get(ck).schema.types.contains("number")); + + path = "/ComposedInteger"; + co = codegen.fromOperation(openAPI.getPaths().get(path).getGet(), getOperationPath(path, "get")); + cr = co.responses.get("200"); + assertTrue(cr.content.get(ck).schema.types.contains("integer")); + + path = "/ComposedString"; + co = codegen.fromOperation(openAPI.getPaths().get(path).getGet(), getOperationPath(path, "get")); + cr = co.responses.get("200"); + assertTrue(cr.content.get(ck).schema.types.contains("string")); + + path = "/ComposedBool"; + co = codegen.fromOperation(openAPI.getPaths().get(path).getGet(), getOperationPath(path, "get")); + cr = co.responses.get("200"); + assertTrue(cr.content.get(ck).schema.types.contains("boolean")); + + path = "/ComposedArray"; + co = codegen.fromOperation(openAPI.getPaths().get(path).getGet(), getOperationPath(path, "get")); + cr = co.responses.get("200"); + assertTrue(cr.content.get(ck).schema.types.contains("array")); + + path = "/ComposedNone"; + co = codegen.fromOperation(openAPI.getPaths().get(path).getGet(), getOperationPath(path, "get")); + cr = co.responses.get("200"); + assertTrue(cr.content.get(ck).schema.types.contains("null")); + + path = "/ComposedAnyType"; + co = codegen.fromOperation(openAPI.getPaths().get(path).getGet(), getOperationPath(path, "get")); + cr = co.responses.get("200"); + assertTrue(cr.content.get(ck).schema.types == null); + } + + @Test + public void testComposedRequestBodyTypes() { + DefaultCodegen codegen = new DefaultCodegen(); + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_10330.yaml"); + codegen.setOpenAPI(openAPI); + String path; + CodegenOperation co; + CodegenRequestBody crb; + + path = "/ComposedObject"; + co = codegen.fromOperation(openAPI.getPaths().get(path).getGet(), getOperationPath(path, "get")); + crb = co.requestBody; + CodegenKey ck = codegen.getKey("application/json"); + assertTrue(crb.content.get(ck).schema.types.contains("object")); + + path = "/ComposedNumber"; + co = codegen.fromOperation(openAPI.getPaths().get(path).getGet(), getOperationPath(path, "get")); + crb = co.requestBody; + assertTrue(crb.content.get(ck).schema.types.contains("number")); + + path = "/ComposedInteger"; + co = codegen.fromOperation(openAPI.getPaths().get(path).getGet(), getOperationPath(path, "get")); + crb = co.requestBody; + assertTrue(crb.content.get(ck).schema.types.contains("integer")); + + path = "/ComposedString"; + co = codegen.fromOperation(openAPI.getPaths().get(path).getGet(), getOperationPath(path, "get")); + crb = co.requestBody; + assertTrue(crb.content.get(ck).schema.types.contains("string")); + + path = "/ComposedBool"; + co = codegen.fromOperation(openAPI.getPaths().get(path).getGet(), getOperationPath(path, "get")); + crb = co.requestBody; + assertTrue(crb.content.get(ck).schema.types.contains("boolean")); + + path = "/ComposedArray"; + co = codegen.fromOperation(openAPI.getPaths().get(path).getGet(), getOperationPath(path, "get")); + crb = co.requestBody; + assertTrue(crb.content.get(ck).schema.types.contains("array")); + + path = "/ComposedNone"; + co = codegen.fromOperation(openAPI.getPaths().get(path).getGet(), getOperationPath(path, "get")); + crb = co.requestBody; + assertTrue(crb.content.get(ck).schema.types.contains("null")); + + path = "/ComposedAnyType"; + co = codegen.fromOperation(openAPI.getPaths().get(path).getGet(), getOperationPath(path, "get")); + crb = co.requestBody; + assertTrue(crb.content.get(ck).schema.types == null); + } + + @Test + public void testComposedRequestQueryParamTypes() { + DefaultCodegen codegen = new DefaultCodegen(); + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_10330.yaml"); + codegen.setOpenAPI(openAPI); + String path; + CodegenOperation co; + CodegenParameter cp; + + path = "/ComposedObject"; + co = codegen.fromOperation(openAPI.getPaths().get(path).getGet(), getOperationPath(path, "get")); + cp = co.queryParams.get(0); + assertTrue(cp.schema.types.contains("object")); + + path = "/ComposedNumber"; + co = codegen.fromOperation(openAPI.getPaths().get(path).getGet(), getOperationPath(path, "get")); + cp = co.queryParams.get(0); + assertTrue(cp.schema.types.contains("number")); + + path = "/ComposedInteger"; + co = codegen.fromOperation(openAPI.getPaths().get(path).getGet(), getOperationPath(path, "get")); + cp = co.queryParams.get(0); + assertTrue(cp.schema.types.contains("integer")); + + path = "/ComposedString"; + co = codegen.fromOperation(openAPI.getPaths().get(path).getGet(), getOperationPath(path, "get")); + cp = co.queryParams.get(0); + assertTrue(cp.schema.types.contains("string")); + + path = "/ComposedBool"; + co = codegen.fromOperation(openAPI.getPaths().get(path).getGet(), getOperationPath(path, "get")); + cp = co.queryParams.get(0); + assertTrue(cp.schema.types.contains("boolean")); + + path = "/ComposedArray"; + co = codegen.fromOperation(openAPI.getPaths().get(path).getGet(), getOperationPath(path, "get")); + cp = co.queryParams.get(0); + assertTrue(cp.schema.types.contains("array")); + + path = "/ComposedNone"; + co = codegen.fromOperation(openAPI.getPaths().get(path).getGet(), getOperationPath(path, "get")); + cp = co.queryParams.get(0); + assertTrue(cp.schema.types.contains("null")); + + path = "/ComposedAnyType"; + co = codegen.fromOperation(openAPI.getPaths().get(path).getGet(), getOperationPath(path, "get")); + cp = co.queryParams.get(0); + assertTrue(cp.schema.types == null); + } + + @Test + public void testByteArrayTypeInSchemas() { + DefaultCodegen codegen = new DefaultCodegen(); + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_10725.yaml"); + codegen.setOpenAPI(openAPI); + String path; + CodegenOperation co; + CodegenRequestBody crb; + + path = "/TxRxByteArray"; + co = codegen.fromOperation(openAPI.getPaths().get(path).getPost(), getOperationPath(path, "post")); + crb = co.requestBody; + CodegenKey ck = codegen.getKey("application/json"); + assertTrue(crb.content.get(ck).schema.types.contains("string")); + assertEquals(crb.content.get(ck).schema.format, "byte"); + CodegenResponse cr = co.responses.get("200"); + assertTrue(cr.content.get(ck).schema.types.contains("string")); + assertEquals(cr.content.get(ck).schema.format, "byte"); + + String modelName = "ObjectContainingByteArray"; + CodegenSchema m = codegen.fromSchema( + openAPI.getComponents().getSchemas().get(modelName), + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + ck = codegen.getKey("byteArray"); + CodegenSchema pr = m.properties.get(ck); + assertTrue(pr.types.contains("string")); + assertEquals(pr.format, "byte"); + } + + @Test + public void testResponses() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/response-tests.yaml"); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + codegen.setDisallowAdditionalPropertiesIfNotPresent(false); + + String path; + Operation operation; + CodegenOperation co; + CodegenResponse cr; + + path = "/pet/{petId}"; + operation = openAPI.getPaths().get(path).getGet(); + co = codegen.fromOperation(operation, getOperationPath(path, "get")); + //assertTrue(co.hasErrorResponseObject); + cr = co.responses.get("200"); + CodegenKey applicationJson = codegen.getKey("application/json"); + assertTrue(cr.content.get(applicationJson).schema.refInfo.refClass != null); + cr = co.responses.get("500"); + CodegenKey applicationApplication = codegen.getKey("application/application"); + assertTrue(cr.content.get(applicationApplication).schema.refInfo.refClass != null); + + path = "/pet"; + operation = openAPI.getPaths().get(path).getPut(); + co = codegen.fromOperation(operation, getOperationPath(path, "put")); + assertTrue(co.hasErrorResponseObject); + + cr = co.responses.get("200"); + assertTrue(cr.content.get(applicationJson).schema.refInfo.refClass != null); + + cr = co.responses.get("400"); + assertTrue(cr.content.get(applicationJson).schema.refInfo.refClass != null); + + path = "/pet/findByTags"; + operation = openAPI.getPaths().get(path).getGet(); + co = codegen.fromOperation(operation, getOperationPath(path, "get")); + assertFalse(co.hasErrorResponseObject); + cr = co.responses.get("200"); + assertNotNull(cr.content.get(applicationJson).schema.items.refInfo.refClass); + } + + @Test + public void testRequestParameterContent() { + DefaultCodegen codegen = new DefaultCodegen(); + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/content-data.yaml"); + codegen.setOpenAPI(openAPI); + String path; + CodegenOperation co; + + String jsonPath = "#/components/schemas/coordinates"; + codegen.fromSchema(openAPI.getComponents().getSchemas().get("coordinates"), jsonPath, jsonPath); + + path = "/jsonQueryParams"; + co = codegen.fromOperation(openAPI.getPaths().get(path).getGet(), getOperationPath(path, "get")); + CodegenParameter coordinatesInlineSchema = co.queryParams.get(0); + LinkedHashMap content = coordinatesInlineSchema.content; + assertNotNull(content); + CodegenKey ck = codegen.getKey("application/json"); + assertEquals(content.keySet(), new HashSet<>(Arrays.asList(ck))); + CodegenMediaType mt = content.get(ck); + assertNull(mt.encoding); + CodegenSchema cp = mt.schema; + assertTrue(cp.types.contains("object")); + assertEquals(cp.refInfo, null); + assertEquals(cp.jsonPathPiece.original, "schema"); + + CodegenParameter coordinatesReferencedSchema = co.queryParams.get(1); + content = coordinatesReferencedSchema.content; + mt = content.get(ck); + assertNull(mt.encoding); + cp = mt.schema; + assertTrue(cp.refInfo.ref.types.contains("object")); // because it is a referenced schema + assertEquals(cp.refInfo.refClass, "Coordinates"); + assertEquals(cp.jsonPathPiece.original, "schema"); + } + + @Test + public void testRequestBodyContent() { + DefaultCodegen codegen = new DefaultCodegen(); + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/content-data.yaml"); + codegen.setOpenAPI(openAPI); + String path; + CodegenOperation co; + + path = "/inlineRequestBodySchemasDifferingByContentType"; + co = codegen.fromOperation(openAPI.getPaths().get(path).getPost(), getOperationPath(path, "post")); + CodegenRequestBody bodyParameter = co.requestBody; + LinkedHashMap content = bodyParameter.content; + assertNotNull(content); + CodegenKey jsonKey = codegen.getKey("application/json"); + CodegenKey textKey = codegen.getKey("text/plain"); + assertEquals(content.keySet(), new HashSet<>(Arrays.asList(jsonKey, textKey))); + CodegenMediaType mt = content.get(jsonKey); + assertNull(mt.encoding); + CodegenSchema cp = mt.schema; + assertEquals(cp.jsonPathPiece.original, "schema"); + assertNotNull(cp); + + mt = content.get(textKey); + assertNull(mt.encoding); + cp = mt.schema; + assertEquals(cp.jsonPathPiece.original, "schema"); + assertNotNull(cp); + // Note: the inline model resolver has a bug for this use case; it extracts an inline request body into a component + // but the schema it references is not string type + + path = "/refRequestBodySchemasDifferingByContentType"; + co = codegen.fromOperation(openAPI.getPaths().get(path).getPost(), getOperationPath(path, "post")); + bodyParameter = co.requestBody; + content = bodyParameter.content; + assertNotNull(content); + CodegenKey applicationJson = codegen.getKey("application/json"); + CodegenKey textPlain = codegen.getKey("text/plain"); + assertEquals(content.keySet(), new HashSet<>(Arrays.asList(applicationJson, textPlain))); + mt = content.get(applicationJson); + assertNull(mt.encoding); + cp = mt.schema; + assertEquals(cp.jsonPathPiece.original, "schema"); + assertEquals(cp.refInfo.refClass, "Coordinates"); + + codegen.fromSchema( + openAPI.getComponents().getSchemas().get("stringWithMinLength"), + "#/components/schemas/stringWithMinLength", + "#/components/schemas/stringWithMinLength" + ); + + mt = content.get(textPlain); + assertNull(mt.encoding); + cp = mt.schema; + assertEquals(cp.jsonPathPiece.original, "schema"); + assertTrue(cp.refInfo.ref.types.contains("string")); + + codegen.fromSchema( + openAPI.getComponents().getSchemas().get("_requestBodyWithEncodingTypes_post_request"), + "#/components/schemas/_requestBodyWithEncodingTypes_post_request", + "#/components/schemas/_requestBodyWithEncodingTypes_post_request" + ); + + path = "/requestBodyWithEncodingTypes"; + co = codegen.fromOperation(openAPI.getPaths().get(path).getPost(), getOperationPath(path, "post")); + CodegenKey applicationXWwwFormUrlencoded = codegen.getKey("application/x-www-form-urlencoded"); + CodegenSchema formSchema = co.requestBody.content.get(applicationXWwwFormUrlencoded).schema; + assertEquals(formSchema.properties.size(), 6); + + LinkedHashMap encoding = co.requestBody.content.get(applicationXWwwFormUrlencoded).encoding; + assertEquals(encoding.get("int-param").explode, true); + assertEquals(encoding.get("explode-false").explode, false); + } + + @Test + public void testResponseContentAndHeader() { + DefaultCodegen codegen = new DefaultCodegen(); + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/content-data.yaml"); + codegen.setOpenAPI(openAPI); + String path; + CodegenOperation co; + + String jsonPath = "#/components/schemas/coordinates"; + codegen.fromSchema(openAPI.getComponents().getSchemas().get("coordinates"), jsonPath, jsonPath); + + path = "/jsonQueryParams"; + co = codegen.fromOperation(openAPI.getPaths().get(path).getGet(), getOperationPath(path, "get")); + CodegenParameter coordinatesInlineSchema = co.queryParams.get(0); + LinkedHashMap content = coordinatesInlineSchema.content; + assertNotNull(content); + CodegenKey ck = codegen.getKey("application/json"); + assertEquals(content.keySet(), new HashSet<>(Arrays.asList(ck))); + + CodegenParameter schemaParam = co.queryParams.get(2); + assertEquals(schemaParam.schema.jsonPathPiece.original, "schema"); + + CodegenResponse cr = co.responses.get("200"); + Map responseHeaders = cr.headers; + assertEquals(2, responseHeaders.size()); + CodegenHeader header1 = responseHeaders.get("X-Rate-Limit"); + assertTrue(header1.schema.types.contains("integer")); + assertEquals(header1.schema.jsonPathPiece.original, "schema"); + + codegen.fromHeader( + openAPI.getComponents().getHeaders().get("X-Rate-Limit"), + "#/components/headers/X-Rate-Limit" + ); + + CodegenHeader header2 = responseHeaders.get("X-Rate-Limit-Ref"); + assertTrue(header2.refInfo.ref.schema.types.contains("integer")); + assertEquals(header2.refInfo.ref.schema.jsonPathPiece.original, "schema"); + + content = cr.content; + CodegenKey applicationJson = codegen.getKey("application/json"); + CodegenKey textPlain = codegen.getKey("text/plain"); + assertEquals(content.keySet(), new HashSet<>(Arrays.asList(applicationJson, textPlain))); + CodegenMediaType mt = content.get(applicationJson); + assertNull(mt.encoding); + CodegenSchema cp = mt.schema; + assertTrue(cp.refInfo.ref.types.contains("object")); + assertEquals(cp.refInfo.refClass, "Coordinates"); + assertEquals(cp.jsonPathPiece.original, "schema"); + + codegen.fromSchema( + openAPI.getComponents().getSchemas().get("stringWithMinLength"), + "#/components/schemas/stringWithMinLength", + "#/components/schemas/stringWithMinLength" + ); + + mt = content.get(textPlain); + assertNull(mt.encoding); + cp = mt.schema; + assertEquals(cp.jsonPathPiece.original, "schema"); + assertTrue(cp.refInfo.ref.types.contains("string")); + + codegen.fromSchema( + openAPI.getComponents().getSchemas().get("coordinates"), + "#/components/schemas/coordinates", + "#/components/schemas/coordinates" + ); + + cr = co.responses.get("201"); + content = cr.content; + assertEquals(content.keySet(), new HashSet<>(Arrays.asList(applicationJson, textPlain))); + mt = content.get(applicationJson); + assertNull(mt.encoding); + cp = mt.schema; + assertTrue(cp.refInfo.ref.types.contains("object")); + assertEquals(cp.refInfo.refClass, "Coordinates"); + assertEquals(cp.jsonPathPiece.original, "schema"); + + mt = content.get(textPlain); + assertNull(mt.encoding); + cp = mt.schema; + assertEquals(cp.jsonPathPiece.original, "schema"); + assertTrue(cp.refInfo.ref.types.contains("string")); + } + + @Test + public void testUnalias() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/schema-unalias-test.yml"); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + + Schema requestBodySchema = ModelUtils.getSchemaFromRequestBody( + openAPI.getPaths().get("/thingy/{date}").getPost().getRequestBody()); + Assert.assertEquals(requestBodySchema.get$ref(), "#/components/schemas/updatePetWithForm_request"); + Assert.assertEquals(ModelUtils.getSimpleRef(requestBodySchema.get$ref()), "updatePetWithForm_request"); + Assert.assertNotNull(openAPI.getComponents().getSchemas().get(ModelUtils.getSimpleRef(requestBodySchema.get$ref()))); + + Schema requestBodySchema2 = ModelUtils.unaliasSchema(openAPI, requestBodySchema); + // get$ref is not null as unaliasSchem returns the schema with the last $ref to the actual schema + Assert.assertNotNull(requestBodySchema2.get$ref()); + Assert.assertEquals(requestBodySchema2.get$ref(), "#/components/schemas/updatePetWithForm_request"); + + RequestBody reqBody = openAPI.getPaths().get("/thingy/{date}").getPost().getRequestBody(); + CodegenRequestBody codegenParameter = codegen.fromRequestBody(reqBody, "#/paths/~1thingy~1{date}/post/requestBody"); + + CodegenKey ck = codegen.getKey("application/x-www-form-urlencoded"); + Assert.assertNotNull(codegenParameter.content.get(ck).schema.refInfo); + } + + @Test + public void testFromPropertyRequiredAndOptional() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_12857.yaml"); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + codegen.setDisallowAdditionalPropertiesIfNotPresent(false); + + String modelName = "FooRequired"; + Schema sc = openAPI.getComponents().getSchemas().get(modelName); + CodegenSchema fooRequired = codegen.fromSchema( + sc, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + modelName = "FooOptional"; + sc = openAPI.getComponents().getSchemas().get(modelName); + CodegenSchema fooOptional = codegen.fromSchema( + sc, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + CodegenKey ck = codegen.getKey("foo"); + Assert.assertEquals(fooRequired.properties.get(ck).jsonPathPiece.original, "foo"); + + assertEquals(fooRequired.requiredProperties.size(), 1); + Assert.assertEquals(fooRequired.requiredProperties.get(ck).jsonPathPiece.original, "foo"); + + Assert.assertEquals(fooOptional.properties.get(ck).jsonPathPiece.original, "foo"); + assertEquals(fooOptional.requiredProperties, null); + } + + @Test + public void testAssigning310SpecWorks() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_1/petstore.yaml"); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + assertEquals(openAPI, codegen.openAPI); + } + + public static class FromParameter { + private CodegenParameter codegenParameter(String path) { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/fromParameter.yaml"); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + + return codegen + .fromParameter( + openAPI + .getPaths() + .get(path) + .getGet() + .getParameters() + .get(0), + "#/paths/" + ModelUtils.encodeSlashes(path) + "/get/parameters/0" + ); + } + + @Test + public void setStyle() { + CodegenParameter parameter = codegenParameter("/set_style"); + assertEquals(parameter.style, "form"); + } + + @Test + public void setShouldExplode() { + CodegenParameter parameter = codegenParameter("/set_should_explode"); + assertTrue(parameter.explode); + } + + @Test + public void testConvertPropertyToBooleanAndWriteBack_Boolean_true() { + final DefaultCodegen codegen = new DefaultCodegen(); + Map additionalProperties = codegen.additionalProperties(); + additionalProperties.put(CodegenConstants.SERIALIZABLE_MODEL, true); + boolean result = codegen.convertPropertyToBooleanAndWriteBack(CodegenConstants.SERIALIZABLE_MODEL); + Assert.assertTrue(result); + } + + @Test + public void testConvertPropertyToBooleanAndWriteBack_Boolean_false() { + final DefaultCodegen codegen = new DefaultCodegen(); + Map additionalProperties = codegen.additionalProperties(); + additionalProperties.put(CodegenConstants.SERIALIZABLE_MODEL, false); + boolean result = codegen.convertPropertyToBooleanAndWriteBack(CodegenConstants.SERIALIZABLE_MODEL); + Assert.assertFalse(result); + } + + @Test + public void testConvertPropertyToBooleanAndWriteBack_String_true() { + final DefaultCodegen codegen = new DefaultCodegen(); + Map additionalProperties = codegen.additionalProperties(); + additionalProperties.put(CodegenConstants.SERIALIZABLE_MODEL, "true"); + boolean result = codegen.convertPropertyToBooleanAndWriteBack(CodegenConstants.SERIALIZABLE_MODEL); + Assert.assertTrue(result); + } + + @Test + public void testConvertPropertyToBooleanAndWriteBack_String_false() { + final DefaultCodegen codegen = new DefaultCodegen(); + Map additionalProperties = codegen.additionalProperties(); + additionalProperties.put(CodegenConstants.SERIALIZABLE_MODEL, "false"); + boolean result = codegen.convertPropertyToBooleanAndWriteBack(CodegenConstants.SERIALIZABLE_MODEL); + Assert.assertFalse(result); + } + + @Test + public void testConvertPropertyToBooleanAndWriteBack_String_blibb() { + final DefaultCodegen codegen = new DefaultCodegen(); + Map additionalProperties = codegen.additionalProperties(); + additionalProperties.put(CodegenConstants.SERIALIZABLE_MODEL, "blibb"); + boolean result = codegen.convertPropertyToBooleanAndWriteBack(CodegenConstants.SERIALIZABLE_MODEL); + Assert.assertFalse(result); + } + } + + class CodegenWithMultipleInheritance extends DefaultCodegen { + public CodegenWithMultipleInheritance() { + super(); + supportsInheritance = true; + supportsMultipleInheritance = true; + } + } +} diff --git a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/DefaultGeneratorTest.java b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/DefaultGeneratorTest.java similarity index 78% rename from modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/DefaultGeneratorTest.java rename to modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/DefaultGeneratorTest.java index 778d1d889bb..65625a286c4 100644 --- a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/DefaultGeneratorTest.java +++ b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/DefaultGeneratorTest.java @@ -1,4 +1,4 @@ -package org.openapitools.codegen; +package org.openapijsonschematools.codegen; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.Operation; @@ -11,11 +11,16 @@ import io.swagger.v3.oas.models.parameters.RequestBody; import io.swagger.v3.oas.models.responses.ApiResponse; import io.swagger.v3.oas.models.responses.ApiResponses; -import org.openapitools.codegen.config.CodegenConfigurator; -import org.openapitools.codegen.config.GlobalSettings; -import org.openapitools.codegen.model.ModelMap; -import org.openapitools.codegen.model.OperationsMap; -import org.openapitools.codegen.utils.ModelUtils; +import org.openapijsonschematools.codegen.config.CodegenConfigurator; +import org.openapijsonschematools.codegen.config.GlobalSettings; +import org.openapijsonschematools.codegen.model.CodegenKey; +import org.openapijsonschematools.codegen.model.CodegenOperation; +import org.openapijsonschematools.codegen.model.CodegenPathItem; +import org.openapijsonschematools.codegen.model.CodegenRequestBody; +import org.openapijsonschematools.codegen.model.CodegenResponse; +import org.openapijsonschematools.codegen.model.CodegenSchema; +import org.openapijsonschematools.codegen.model.CodegenServer; +import org.openapijsonschematools.codegen.utils.ModelUtils; import org.testng.Assert; import org.testng.annotations.Test; @@ -40,7 +45,7 @@ public void testIgnoreFileProcessing() throws IOException { "src/main/AndroidManifest.xml", "pom.xml", "src/test/**", - "src/main/java/org/openapitools/client/api/UserApi.java" + "src/main/java/org/openapijsonschematools/client/api/tags/UserApi.java" ); File ignorePath = new File(output, ".openapi-generator-ignore"); Files.write(ignorePath.toPath(), @@ -66,19 +71,19 @@ public void testIgnoreFileProcessing() throws IOException { List files = generator.opts(clientOptInput).generate(); - Assert.assertEquals(files.size(), 44); + Assert.assertEquals(files.size(), 89); // Check expected generated files // api sanity check - TestUtils.ensureContainsFile(files, output, "src/main/java/org/openapitools/client/api/PetApi.java"); - Assert.assertTrue(new File(output, "src/main/java/org/openapitools/client/api/PetApi.java").exists()); + TestUtils.ensureContainsFile(files, output, "src/main/java/org/openapijsonschematools/client/api/tags/PetApi.java"); + Assert.assertTrue(new File(output, "src/main/java/org/openapijsonschematools/client/api/tags/PetApi.java").exists()); // model sanity check - TestUtils.ensureContainsFile(files, output, "src/main/java/org/openapitools/client/model/Category.java"); - Assert.assertTrue(new File(output, "src/main/java/org/openapitools/client/model/Category.java").exists()); + TestUtils.ensureContainsFile(files, output, "src/main/java/org/openapijsonschematools/client/model/Category.java"); + Assert.assertTrue(new File(output, "src/main/java/org/openapijsonschematools/client/model/Category.java").exists()); - TestUtils.ensureContainsFile(files, output, "src/main/java/org/openapitools/client/model/ModelApiResponse.java"); - Assert.assertTrue(new File(output, "src/main/java/org/openapitools/client/model/ModelApiResponse.java").exists()); + TestUtils.ensureContainsFile(files, output, "src/main/java/org/openapijsonschematools/client/model/ModelApiResponse.java"); + Assert.assertTrue(new File(output, "src/main/java/org/openapijsonschematools/client/model/ModelApiResponse.java").exists()); // supporting files sanity check TestUtils.ensureContainsFile(files, output, "build.gradle"); @@ -100,11 +105,11 @@ public void testIgnoreFileProcessing() throws IOException { TestUtils.ensureDoesNotContainsFile(files, output, "pom.xml"); Assert.assertFalse(new File(output, "pom.xml").exists()); - TestUtils.ensureDoesNotContainsFile(files, output, "src/test/java/org/openapitools/client/model/CategoryTest.java"); - Assert.assertFalse(new File(output, "src/test/java/org/openapitools/client/model/CategoryTest.java").exists()); + TestUtils.ensureDoesNotContainsFile(files, output, "src/test/java/org/openapijsonschematools/client/model/CategoryTest.java"); + Assert.assertFalse(new File(output, "src/test/java/org/openapijsonschematools/client/model/CategoryTest.java").exists()); - TestUtils.ensureDoesNotContainsFile(files, output, "src/main/java/org/openapitools/client/api/UserApi.java"); - Assert.assertFalse(new File(output, "src/main/java/org/openapitools/client/api/UserApi.java").exists()); + TestUtils.ensureDoesNotContainsFile(files, output, "src/main/java/org/openapijsonschematools/client/api/tags/UserApi.java"); + Assert.assertFalse(new File(output, "src/main/java/org/openapijsonschematools/client/api/tags/UserApi.java").exists()); } finally { output.delete(); } @@ -123,8 +128,8 @@ public void testFilesAreNeverOverwritten() throws IOException { .setOutputDir(target.toAbsolutePath().toString()); // Create "existing" files - String apiTestRelativePath = "src/test/java/org/openapitools/client/api/PetApiTest.java"; - String modelTestRelativePath = "src/test/java/org/openapitools/client/model/CategoryTest.java"; + String apiTestRelativePath = "src/test/java/org/openapijsonschematools/client/api/tags/PetApiTest.java"; + String modelTestRelativePath = "src/test/java/org/openapijsonschematools/client/model/CategoryTest.java"; File apiTestFile = new File(output, apiTestRelativePath); new File(apiTestFile.getParent()).mkdirs(); @@ -151,11 +156,11 @@ public void testFilesAreNeverOverwritten() throws IOException { List files = generator.opts(clientOptInput).generate(); - Assert.assertEquals(files.size(), 16); + Assert.assertEquals(files.size(), 59); // Check API is written and Test is not - TestUtils.ensureContainsFile(files, output, "src/main/java/org/openapitools/client/api/PetApi.java"); - Assert.assertTrue(new File(output, "src/main/java/org/openapitools/client/api/PetApi.java").exists()); + TestUtils.ensureContainsFile(files, output, "src/main/java/org/openapijsonschematools/client/api/tags/PetApi.java"); + Assert.assertTrue(new File(output, "src/main/java/org/openapijsonschematools/client/api/tags/PetApi.java").exists()); TestUtils.ensureDoesNotContainsFile(files, output, apiTestRelativePath); Assert.assertTrue(apiTestFile.exists()); @@ -163,8 +168,8 @@ public void testFilesAreNeverOverwritten() throws IOException { Assert.assertEquals(apiTestContents, "empty", "Expected test file to retain original contents."); // Check Model is written and Test is not - TestUtils.ensureContainsFile(files, output, "src/main/java/org/openapitools/client/model/Category.java"); - Assert.assertTrue(new File(output, "src/test/java/org/openapitools/client/model/CategoryTest.java").exists()); + TestUtils.ensureContainsFile(files, output, "src/main/java/org/openapijsonschematools/client/model/Category.java"); + Assert.assertTrue(new File(output, "src/test/java/org/openapijsonschematools/client/model/CategoryTest.java").exists()); TestUtils.ensureDoesNotContainsFile(files, output, modelTestRelativePath); Assert.assertTrue(modelTestFile.exists()); @@ -199,8 +204,8 @@ public void dryRunWithApisOnly() throws IOException { List files = generator.opts(clientOptInput).generate(); - Assert.assertEquals(files.size(), 1); - TestUtils.ensureContainsFile(files, output, "src/main/java/org/openapitools/client/api/PingApi.java"); + Assert.assertEquals(files.size(), 2); + TestUtils.ensureContainsFile(files, output, "src/main/java/org/openapijsonschematools/client/api/tags/PingApi.java"); } finally { output.delete(); } @@ -231,7 +236,7 @@ public void dryRunWithModelsOnly() throws IOException { List files = generator.opts(clientOptInput).generate(); Assert.assertEquals(files.size(), 1); - TestUtils.ensureContainsFile(files, output, "src/main/java/org/openapitools/client/model/SomeObj.java"); + TestUtils.ensureContainsFile(files, output, "src/main/java/org/openapijsonschematools/client/model/SomeObj.java"); } finally { output.delete(); } @@ -283,66 +288,10 @@ public void dryRunWithSupportFilesSelections() throws IOException { } @Test - public void supportCustomTemplateEngine() throws IOException { - Path target = Files.createTempDirectory("test"); - File templateDir = new File(target.toFile(), "template"); - Files.createDirectory(templateDir.toPath()); - File output = new File(target.toFile(), "out"); - Files.createDirectory(output.toPath()); - - try { - final CodegenConfigurator configurator = new CodegenConfigurator() - .setGeneratorName("jmeter") - .setInputSpec("src/test/resources/3_0/pingSomeObj.yaml") - .setSkipOverwrite(false) - .setTemplateDir(templateDir.toPath().toAbsolutePath().toString()) - .setTemplatingEngineName("handlebars") - .setOutputDir(output.toPath().toAbsolutePath().toString()); - - // Create custom template directory - Files.copy( - Objects.requireNonNull(this.getClass().getClassLoader().getResourceAsStream("templating/templates/jmeter/api.hbs")), - new File(templateDir, "api.hbs").toPath()); - Files.copy( - Objects.requireNonNull(this.getClass().getClassLoader().getResourceAsStream("templating/templates/jmeter/testdata-localhost.hbs")), - new File(templateDir, "testdata-localhost.hbs").toPath()); - - final ClientOptInput clientOptInput = configurator.toClientOptInput(); - DefaultGenerator generator = new DefaultGenerator(false); - - List files = generator.opts(clientOptInput).generate(); - - Assert.assertEquals(files.size(), 5); - - // Check API is written and Test is not - TestUtils.ensureContainsFile(files, output, "PingApi.jmx"); - Assert.assertTrue(new File(output, "PingApi.jmx").exists()); - - TestUtils.ensureContainsFile(files, output, "PingApi.csv"); - Assert.assertTrue(new File(output, "PingApi.csv").exists()); - - TestUtils.ensureContainsFile(files, output, ".openapi-generator-ignore"); - Assert.assertTrue(new File(output, ".openapi-generator-ignore").exists()); - - TestUtils.ensureContainsFile(files, output, ".openapi-generator/VERSION"); - Assert.assertTrue(new File(output, ".openapi-generator/VERSION").exists()); - - TestUtils.ensureContainsFile(files, output, ".openapi-generator/FILES"); - Assert.assertTrue(new File(output, ".openapi-generator/FILES").exists()); - - TestUtils.assertFileContains(java.nio.file.Paths.get(output + "/PingApi.jmx"), "PingApi Test Plan via Handlebars"); - TestUtils.assertFileContains(java.nio.file.Paths.get(output + "/PingApi.csv"), - "testCase,httpStatusCode,someObj", - "Success,200,0"); - } finally { - output.delete(); - } - } - - @Test - public void testNonStrictProcessPaths() throws Exception { + public void testNonStrictFromPaths() throws Exception { OpenAPI openAPI = TestUtils.createOpenAPI(); openAPI.setPaths(new Paths()); + PathItem pathItem1 = new PathItem(); openAPI.getPaths().addPathItem("path1/", new PathItem().get(new Operation().operationId("op1").responses(new ApiResponses().addApiResponse("201", new ApiResponse().description("OK"))))); openAPI.getPaths().addPathItem("path2/", new PathItem().get(new Operation().operationId("op2").addParametersItem(new QueryParameter().name("p1").schema(new StringSchema())).responses(new ApiResponses().addApiResponse("201", new ApiResponse().description("OK"))))); @@ -354,18 +303,19 @@ public void testNonStrictProcessPaths() throws Exception { DefaultGenerator generator = new DefaultGenerator(); generator.opts(opts); - Map> result = generator.processPaths(openAPI.getPaths()); - Assert.assertEquals(result.size(), 1); - List defaultList = result.get("Default"); - Assert.assertEquals(defaultList.size(), 2); - Assert.assertEquals(defaultList.get(0).path, "path1/"); - Assert.assertEquals(defaultList.get(0).allParams.size(), 0); - Assert.assertEquals(defaultList.get(1).path, "path2/"); - Assert.assertEquals(defaultList.get(1).allParams.size(), 1); + TreeMap paths = config.fromPaths(openAPI.getPaths()); + Assert.assertEquals(paths.size(), 2); + CodegenKey firstPathKey = config.getKey("path1/"); + CodegenKey getKey = config.getKey("get"); + Assert.assertEquals(firstPathKey.original, "path1/"); + Assert.assertEquals(paths.get(firstPathKey).operations.get(getKey).allParams.size(), 0); + CodegenKey secondPathKey = config.getKey("path2/"); + Assert.assertEquals(secondPathKey.original, "path2/"); + Assert.assertEquals(paths.get(secondPathKey).operations.get(getKey).allParams.size(), 1); } @Test - public void testProcessPaths() throws Exception { + public void testFromPaths() throws Exception { OpenAPI openAPI = TestUtils.createOpenAPI(); openAPI.setPaths(new Paths()); openAPI.getPaths().addPathItem("/path1", new PathItem().get(new Operation().operationId("op1").responses(new ApiResponses().addApiResponse("201", new ApiResponse().description("OK"))))); @@ -375,22 +325,23 @@ public void testProcessPaths() throws Exception { ClientOptInput opts = new ClientOptInput(); opts.openAPI(openAPI); - opts.config(new DefaultCodegen()); + CodegenConfig config = new DefaultCodegen(); + opts.config(config); DefaultGenerator generator = new DefaultGenerator(); generator.opts(opts); - Map> result = generator.processPaths(openAPI.getPaths()); - Assert.assertEquals(result.size(), 1); - List defaultList = result.get("Default"); - Assert.assertEquals(defaultList.size(), 4); - Assert.assertEquals(defaultList.get(0).path, "/path1"); - Assert.assertEquals(defaultList.get(0).allParams.size(), 0); - Assert.assertEquals(defaultList.get(1).path, "/path2"); - Assert.assertEquals(defaultList.get(1).allParams.size(), 1); - Assert.assertEquals(defaultList.get(2).path, "/path3"); - Assert.assertEquals(defaultList.get(2).allParams.size(), 2); - Assert.assertEquals(defaultList.get(3).path, "/path4"); - Assert.assertEquals(defaultList.get(3).allParams.size(), 1); + TreeMap paths = config.fromPaths(openAPI.getPaths()); +// Assert.assertEquals(result.size(), 1); +// List defaultList = result.get("Default"); +// Assert.assertEquals(defaultList.size(), 4); +// Assert.assertEquals(defaultList.get(0).path.original, "/path1"); +// Assert.assertEquals(defaultList.get(0).allParams.size(), 0); +// Assert.assertEquals(defaultList.get(1).path.original, "/path2"); +// Assert.assertEquals(defaultList.get(1).allParams.size(), 1); +// Assert.assertEquals(defaultList.get(2).path.original, "/path3"); +// Assert.assertEquals(defaultList.get(2).allParams.size(), 2); +// Assert.assertEquals(defaultList.get(3).path.original, "/path4"); +// Assert.assertEquals(defaultList.get(3).allParams.size(), 1); } @Test @@ -407,7 +358,7 @@ public void testRefModelValidationProperties() { String expectedPattern = "^\\d{3}-\\d{2}-\\d{4}$"; // NOTE: double-escaped regex for when the value is intended to be dumped in template into a String location. - String escapedPattern = config.toRegularExpression(expectedPattern); + String escapedPattern = config.getPatternInfo(expectedPattern).pattern; Schema stringRegex = openAPI.getComponents().getSchemas().get("StringRegex"); // Sanity check. @@ -418,22 +369,38 @@ public void testRefModelValidationProperties() { Assert.assertEquals(unaliasedStringRegex.getPattern(), expectedPattern); // Validate when converting to property - CodegenProperty stringRegexProperty = config.fromProperty("stringRegex", stringRegex); - Assert.assertEquals(stringRegexProperty.pattern, escapedPattern); + CodegenSchema stringRegexProperty = config.fromSchema( + stringRegex, + "#/components/schemas/A", + "#/components/schemas/A" + ); + Assert.assertEquals(stringRegexProperty.patternInfo.pattern, escapedPattern); + + config.fromSchema( + openAPI.getComponents().getSchemas().get("StringRegex"), + "#/components/schemas/StringRegex", + "#/components/schemas/StringRegex" + ); + config.fromSchema( + openAPI.getComponents().getSchemas().get("ObjectModelWithRefs"), + "#/components/schemas/ObjectModelWithRefs", + "#/components/schemas/ObjectModelWithRefs" + ); // Validate when converting to parameter Operation operation = openAPI.getPaths().get("/fake/StringRegex").getPost(); RequestBody body = operation.getRequestBody(); - CodegenParameter codegenParameter = config.fromRequestBody(body, new HashSet<>(), "body"); + CodegenRequestBody codegenParameter = config.fromRequestBody( + body, "#/paths/~1fake~1StringRegex/post/requestBody"); - Assert.assertEquals(codegenParameter.pattern, escapedPattern); + CodegenKey ck = config.getKey("*/*"); + Assert.assertEquals(codegenParameter.content.get(ck).schema.refInfo.ref.patternInfo.pattern, escapedPattern); // Validate when converting to response ApiResponse response = operation.getResponses().get("200"); - CodegenResponse codegenResponse = config.fromResponse("200", response); + CodegenResponse codegenResponse = config.fromResponse(response, "#/paths/~1fake~1StringRegex/post/responses/200"); - Assert.assertEquals(((Schema) codegenResponse.schema).getPattern(), expectedPattern); - Assert.assertEquals(codegenResponse.pattern, escapedPattern); + Assert.assertEquals(codegenResponse.content.get(ck).schema.refInfo.ref.patternInfo.pattern, escapedPattern); } @Test @@ -464,14 +431,14 @@ public void testBuiltinLibraryTemplates() throws IOException { Assert.assertEquals(files.size(), 27); // Generator should report a library templated file as a generated file - TestUtils.ensureContainsFile(files, output, "src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt"); + TestUtils.ensureContainsFile(files, output, "src/main/kotlin/org/openapijsonschematools/client/infrastructure/Errors.kt"); // Generated file should exist on the filesystem after generation - File generatedFile = new File(output, "src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt"); + File generatedFile = new File(output, "src/main/kotlin/org/openapijsonschematools/client/infrastructure/Errors.kt"); Assert.assertTrue(generatedFile.exists()); // Generated file should contain some expected text - TestUtils.assertFileContains(generatedFile.toPath(), "package org.openapitools.client.infrastructure", + TestUtils.assertFileContains(generatedFile.toPath(), "package org.openapijsonschematools.client.infrastructure", "open class ClientException", "open class ServerException"); } finally { @@ -513,7 +480,7 @@ public void testBuiltinNonLibraryTemplates() throws IOException { Assert.assertTrue(readme.exists()); // README.md should contain some expected text - TestUtils.assertFileContains(readme.toPath(), "# org.openapitools.client - Kotlin client library for OpenAPI Petstore", + TestUtils.assertFileContains(readme.toPath(), "# org.openapijsonschematools.client - Kotlin client library for OpenAPI Petstore", "## Requires", "## Build", "## Features/Implementation Notes"); @@ -534,7 +501,7 @@ public void testCustomLibraryTemplates() throws IOException { StringBuilder sb = new StringBuilder(); sb.append("// {{someKey}}").append("\n"); sb.append("@file:Suppress(\"unused\")").append("\n"); - sb.append("package org.openapitools.client.infrastructure").append("\n"); + sb.append("package org.openapijsonschematools.client.infrastructure").append("\n"); sb.append("import java.lang.RuntimeException").append("\n"); sb.append("open class CustomException(").append("\n"); sb.append(" message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) {").append("\n"); @@ -571,15 +538,15 @@ public void testCustomLibraryTemplates() throws IOException { Assert.assertEquals(files.size(), 27); // Generator should report a library templated file as a generated file - TestUtils.ensureContainsFile(files, output, "src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt"); + TestUtils.ensureContainsFile(files, output, "src/main/kotlin/org/openapijsonschematools/client/infrastructure/Errors.kt"); // Generated file should exist on the filesystem after generation - File readme = new File(output, "src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt"); + File readme = new File(output, "src/main/kotlin/org/openapijsonschematools/client/infrastructure/Errors.kt"); Assert.assertTrue(readme.exists()); // Generated file should contain our custom templated text TestUtils.assertFileContains(readme.toPath(), "// testCustomLibraryTemplates", - "package org.openapitools.client.infrastructure", + "package org.openapijsonschematools.client.infrastructure", "open class CustomException(", "private const val serialVersionUID: Long = 789L"); } finally { @@ -651,18 +618,14 @@ public void testHandlesTrailingSlashInServers() { generator.opts(opts); generator.configureGeneratorProperties(); - List files = new ArrayList<>(); - List filteredSchemas = ModelUtils.getSchemasUsedOnlyInFormParam(openAPI); - List allModels = new ArrayList<>(); - generator.generateModels(files, allModels, filteredSchemas); - List allOperations = new ArrayList<>(); - generator.generateApis(files, allOperations, allModels); - - Map bundle = generator.buildSupportFileBundle(allOperations, allModels); - LinkedList servers = (LinkedList) bundle.get("servers"); - Assert.assertEquals(servers.get(0).url, ""); - Assert.assertEquals(servers.get(1).url, "http://trailingshlash.io:80/v1"); - Assert.assertEquals(servers.get(2).url, "http://notrailingslash.io:80/v2"); + List servers = config.fromServers(openAPI.getServers(), "#/servers"); + + Map bundle = generator.buildSupportFileBundle( + null, null, null, null, null, null, servers, null, null); + LinkedList bundleServers = (LinkedList) bundle.get("servers"); + Assert.assertEquals(bundleServers.get(0).url, ""); + Assert.assertEquals(bundleServers.get(1).url, "http://trailingshlash.io:80/v1"); + Assert.assertEquals(bundleServers.get(2).url, "http://notrailingslash.io:80/v2"); } @Test @@ -678,15 +641,13 @@ public void testHandlesRelativeUrlsInServers() { generator.configureGeneratorProperties(); List files = new ArrayList<>(); - List filteredSchemas = ModelUtils.getSchemasUsedOnlyInFormParam(openAPI); - List allModels = new ArrayList<>(); - generator.generateModels(files, allModels, filteredSchemas); - List allOperations = new ArrayList<>(); - generator.generateApis(files, allOperations, allModels); - - Map bundle = generator.buildSupportFileBundle(allOperations, allModels); - LinkedList servers = (LinkedList) bundle.get("servers"); - Assert.assertEquals(servers.get(0).url, "/relative/url"); + + List servers = config.fromServers(openAPI.getServers(), "#/servers"); + Map bundle = generator.buildSupportFileBundle( + null, null, null, null, null, null, servers, null, null); + + LinkedList bundleServers = (LinkedList) bundle.get("servers"); + Assert.assertEquals(bundleServers.get(0).url, "/relative/url"); } @Test @@ -731,15 +692,15 @@ public void testProcessUserDefinedTemplatesWithConfig() throws IOException { // Assert.assertTrue(new File(output, "sampleConfig.json").exists()); // Generator should report api_client.py as a generated file - TestUtils.ensureContainsFile(files, output, "io/something/api_client.py"); + TestUtils.ensureContainsFile(files, output, "src/io/something/api_client.py"); // Generated file should exist on the filesystem after generation - File apiClient = new File(output, "io/something/api_client.py"); + File apiClient = new File(output, "src/io/something/api_client.py"); Assert.assertTrue(apiClient.exists()); // Generated file should contain our custom packageName TestUtils.assertFileContains(apiClient.toPath(), - "from io.something import rest" + "from io.something import exceptions, rest, schemas" ); } finally { output.delete(); @@ -760,10 +721,8 @@ public void testRecursionBug4650() { generator.configureGeneratorProperties(); List files = new ArrayList<>(); - List filteredSchemas = ModelUtils.getSchemasUsedOnlyInFormParam(openAPI); - List allModels = new ArrayList<>(); // The bug causes a StackOverflowError when calling generateModels - generator.generateModels(files, allModels, filteredSchemas); + generator.generateSchemas(files); // all fine, we have passed } } diff --git a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/ExampleGeneratorTest.java b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/ExampleGeneratorTest.java similarity index 94% rename from modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/ExampleGeneratorTest.java rename to modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/ExampleGeneratorTest.java index 661ddb2fb65..b5a6d59906e 100644 --- a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/ExampleGeneratorTest.java +++ b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/ExampleGeneratorTest.java @@ -1,7 +1,7 @@ -package org.openapitools.codegen; +package org.openapijsonschematools.codegen; import io.swagger.v3.oas.models.OpenAPI; -import org.openapitools.codegen.examples.ExampleGenerator; +import org.openapijsonschematools.codegen.examples.ExampleGenerator; import org.testng.annotations.Test; import java.util.*; @@ -14,8 +14,6 @@ public class ExampleGeneratorTest { public void generateFromResponseSchemaWithPrimitiveType() { OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/example_generator_test.yaml"); - new InlineModelResolver().flatten(openAPI); - ExampleGenerator exampleGenerator = new ExampleGenerator(openAPI.getComponents().getSchemas(), openAPI); Set mediaTypeKeys = new TreeSet<>(); mediaTypeKeys.add("application/json"); @@ -43,8 +41,6 @@ public void generateFromResponseSchemaWithPrimitiveType() { public void generateFromResponseSchemaWithNoExample() { OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/example_generator_test.yaml"); - new InlineModelResolver().flatten(openAPI); - ExampleGenerator exampleGenerator = new ExampleGenerator(openAPI.getComponents().getSchemas(), openAPI); Set mediaTypeKeys = new TreeSet<>(); mediaTypeKeys.add("application/json"); @@ -69,8 +65,6 @@ public void generateFromResponseSchemaWithNoExample() { public void generateFromResponseSchemaWithArrayOfModel() { OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/example_generator_test.yaml"); - new InlineModelResolver().flatten(openAPI); - ExampleGenerator exampleGenerator = new ExampleGenerator(openAPI.getComponents().getSchemas(), openAPI); Set mediaTypeKeys = new TreeSet<>(); mediaTypeKeys.add("application/json"); @@ -98,8 +92,6 @@ public void generateFromResponseSchemaWithArrayOfModel() { public void generateFromResponseSchemaWithArrayOfPrimitiveTypes() { OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/example_generator_test.yaml"); - new InlineModelResolver().flatten(openAPI); - ExampleGenerator exampleGenerator = new ExampleGenerator(openAPI.getComponents().getSchemas(), openAPI); Set mediaTypeKeys = new TreeSet<>(); mediaTypeKeys.add("application/json"); @@ -127,8 +119,6 @@ public void generateFromResponseSchemaWithArrayOfPrimitiveTypes() { public void generateFromResponseSchemaWithModel() { OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/example_generator_test.yaml"); - new InlineModelResolver().flatten(openAPI); - ExampleGenerator exampleGenerator = new ExampleGenerator(openAPI.getComponents().getSchemas(), openAPI); Set mediaTypeKeys = new TreeSet<>(); mediaTypeKeys.add("application/json"); diff --git a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/MockDefaultGenerator.java b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/MockDefaultGenerator.java similarity index 97% rename from modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/MockDefaultGenerator.java rename to modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/MockDefaultGenerator.java index c9a1cbf4878..8395454aec6 100644 --- a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/MockDefaultGenerator.java +++ b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/MockDefaultGenerator.java @@ -14,8 +14,8 @@ * limitations under the License. */ -package org.openapitools.codegen; -import org.openapitools.codegen.templating.TemplateManagerOptions; +package org.openapijsonschematools.codegen; +import org.openapijsonschematools.codegen.templating.TemplateManagerOptions; import java.io.File; import java.io.IOException; diff --git a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/SpecValidationExceptionTest.java b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/SpecValidationExceptionTest.java similarity index 92% rename from modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/SpecValidationExceptionTest.java rename to modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/SpecValidationExceptionTest.java index 5acf2d1a136..9d1f4d7959b 100644 --- a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/SpecValidationExceptionTest.java +++ b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/SpecValidationExceptionTest.java @@ -1,4 +1,4 @@ -package org.openapitools.codegen; +package org.openapijsonschematools.codegen; import org.testng.Assert; import org.testng.annotations.Test; diff --git a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/TemplateManagerTest.java b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/TemplateManagerTest.java similarity index 96% rename from modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/TemplateManagerTest.java rename to modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/TemplateManagerTest.java index 1a15f28bbef..562702e672d 100644 --- a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/TemplateManagerTest.java +++ b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/TemplateManagerTest.java @@ -1,9 +1,9 @@ -package org.openapitools.codegen; +package org.openapijsonschematools.codegen; -import org.openapitools.codegen.api.TemplatePathLocator; -import org.openapitools.codegen.templating.HandlebarsEngineAdapter; -import org.openapitools.codegen.templating.MustacheEngineAdapter; -import org.openapitools.codegen.templating.TemplateManagerOptions; +import org.openapijsonschematools.codegen.templating.HandlebarsEngineAdapter; +import org.openapijsonschematools.codegen.templating.MustacheEngineAdapter; +import org.openapijsonschematools.codegen.templating.TemplateManagerOptions; +import org.openapijsonschematools.codegen.api.TemplatePathLocator; import org.testng.annotations.Test; import java.io.File; diff --git a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/TestUtils.java b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/TestUtils.java similarity index 91% rename from modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/TestUtils.java rename to modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/TestUtils.java index 9b53ebe6266..b788b2d46f3 100644 --- a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/TestUtils.java +++ b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/TestUtils.java @@ -1,4 +1,4 @@ -package org.openapitools.codegen; +package org.openapijsonschematools.codegen; import static org.testng.Assert.assertNotNull; import static org.testng.Assert.fail; @@ -19,11 +19,8 @@ import io.swagger.v3.parser.core.models.ParseOptions; import org.apache.commons.io.IOUtils; -import org.openapitools.codegen.MockDefaultGenerator.WrittenTemplateBasedFile; -import org.openapitools.codegen.java.assertions.JavaFileAssert; -import org.openapitools.codegen.model.ModelMap; -import org.openapitools.codegen.model.ModelsMap; -import org.openapitools.codegen.utils.ModelUtils; +import org.openapijsonschematools.codegen.java.assertions.JavaFileAssert; +import org.openapijsonschematools.codegen.utils.ModelUtils; import org.openrewrite.maven.internal.RawPom; import org.testng.Assert; @@ -34,7 +31,6 @@ import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; -import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Map; @@ -52,16 +48,14 @@ public class TestUtils { */ public static OpenAPI parseFlattenSpec(String specFilePath) { OpenAPI openAPI = parseSpec(specFilePath); - InlineModelResolver inlineModelResolver = new InlineModelResolver(); - inlineModelResolver.flatten(openAPI); return openAPI; } /** * Helper method for parsing specs into an intermediary OpenAPI structure for pre-processing. * - * Use this method only for tests targeting processing helpers such as {@link org.openapitools.codegen.utils.ModelUtils} - * or {@link InlineModelResolver}. Using this for testing generators will mean you're not testing the OpenAPI document + * Use this method only for tests targeting processing helpers such as {@link ModelUtils} + * Using this for testing generators will mean you're not testing the OpenAPI document * in a state the generator will be presented at runtime. * * @param specFilePath The path to the specification file @@ -114,13 +108,13 @@ public static OpenAPI createOpenAPIWithOneSchema(String name, Schema schema) { * @param root root path * @param filename filename under root * - * @return a {@link WrittenTemplateBasedFile} + * @return a {@link MockDefaultGenerator.WrittenTemplateBasedFile} * @deprecated Since 5.0. Please avoid this method and usage of {@link MockDefaultGenerator}, prefer {@link DefaultGenerator#DefaultGenerator(Boolean)} with dryRun=true. */ @Deprecated - public static WrittenTemplateBasedFile getTemplateBasedFile(MockDefaultGenerator generator, File root, String filename) { + public static MockDefaultGenerator.WrittenTemplateBasedFile getTemplateBasedFile(MockDefaultGenerator generator, File root, String filename) { String defaultApiFilename = new File(root, filename).getAbsolutePath().replace("\\", "/"); - Optional optional = generator.getTemplateBasedFiles().stream().filter(f -> defaultApiFilename.equals(f.getOutputFilename())).findFirst(); + Optional optional = generator.getTemplateBasedFiles().stream().filter(f -> defaultApiFilename.equals(f.getOutputFilename())).findFirst(); Assert.assertTrue(optional.isPresent()); return optional.get(); } @@ -338,14 +332,4 @@ public static void assertExtraAnnotationFiles(String baseOutputPath) { .toProperty() .toType(); } - - public static ModelsMap createCodegenModelWrapper(CodegenModel cm) { - ModelsMap objs = new ModelsMap(); - List modelMaps = new ArrayList<>(); - ModelMap modelMap = new ModelMap(); - modelMap.setModel(cm); - modelMaps.add(modelMap); - objs.setModels(modelMaps); - return objs; - } } diff --git a/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/java/AbstractJavaCodegenExampleValuesTest.java b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/java/AbstractJavaCodegenExampleValuesTest.java new file mode 100644 index 00000000000..e9f4d1787e2 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/java/AbstractJavaCodegenExampleValuesTest.java @@ -0,0 +1,158 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * Copyright 2018 SmartBear Software + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapijsonschematools.codegen.java; + +import io.swagger.v3.oas.models.media.ArraySchema; +import io.swagger.v3.oas.models.media.Schema; +import io.swagger.v3.oas.models.parameters.Parameter; +import org.openapijsonschematools.codegen.model.CodegenParameter; +import org.openapijsonschematools.codegen.CodegenType; +import org.openapijsonschematools.codegen.languages.AbstractJavaCodegen; +import org.testng.Assert; +import org.testng.annotations.Test; + +import java.util.Arrays; + +public class AbstractJavaCodegenExampleValuesTest { + + private final AbstractJavaCodegen fakeJavaCodegen = new P_AbstractJavaCodegen(); + + @Test + void inlineEnum() { + Schema sc = new Schema(); + sc.setType("string"); + sc.setEnum( + Arrays.asList("first", "second") + ); + Parameter parameter = new Parameter(); + parameter.setSchema(sc); + final CodegenParameter p = fakeJavaCodegen.fromParameter(parameter, "#/components/parameters/inlineEnum"); + Assert.assertEquals(p.example, "\"first\""); + } + + @Test + void inlineEnumArray() { + Schema sc = new ArraySchema(); + Schema items = new Schema(); + items.setType("string"); + items.setEnum( + Arrays.asList("first", "second") + ); + sc.setItems(items); + Parameter parameter = new Parameter(); + parameter.setSchema(sc); + final CodegenParameter p = fakeJavaCodegen.fromParameter(parameter, "#/components/parameters/inlineEnumArray"); + Assert.assertEquals(p.example, "Arrays.asList()"); + } + + @Test + void dateDefault() { + Schema sc = new Schema(); + sc.setType("string"); + sc.setFormat("date"); + Parameter parameter = new Parameter(); + parameter.setSchema(sc); + final CodegenParameter p = fakeJavaCodegen.fromParameter(parameter, "#/components/parameters/dateDefault"); + Assert.assertEquals(p.example, "new Date()"); + } + + @Test + void dateGivenExample() { + Schema sc = new Schema(); + sc.setType("string"); + sc.setFormat("date"); + sc.setExample("2017-03-30"); + Parameter parameter = new Parameter(); + parameter.setSchema(sc); + final CodegenParameter p = fakeJavaCodegen.fromParameter(parameter, "#/components/parameters/dateGivenExample"); + Assert.assertEquals(p.example, "new Date()"); + } + + @Test + void dateTimeDefault() { + Schema sc = new Schema(); + sc.setType("string"); + sc.setFormat("date-time"); + Parameter parameter = new Parameter(); + parameter.setSchema(sc); + final CodegenParameter p = fakeJavaCodegen.fromParameter(parameter, "#/components/parameters/dateTimeDefault"); + Assert.assertEquals(p.example, "LocalDate.now()"); + } + + @Test + void dateTimeGivenExample() { + Schema sc = new Schema(); + sc.setType("string"); + sc.setFormat("date-time"); + sc.setExample("2007-12-03T10:15:30+01:00"); + Parameter parameter = new Parameter(); + parameter.setSchema(sc); + final CodegenParameter p = fakeJavaCodegen.fromParameter(parameter, "#/components/parameters/dateTimeGivenExample"); + Assert.assertEquals(p.example, "LocalDate.parse(\"2007-12-03T10:15:30+01:00\")"); + } + + @Test + void uuidDefault() { + Schema sc = new Schema(); + sc.setType("string"); + sc.setFormat("uuid"); + Parameter parameter = new Parameter(); + parameter.setSchema(sc); + final CodegenParameter p = fakeJavaCodegen.fromParameter(parameter, "#/components/parameters/uuidDefault"); + Assert.assertEquals(p.example, "UUID.randomUUID()"); + } + + @Test + void uuidGivenExample() { + Schema sc = new Schema(); + sc.setType("string"); + sc.setFormat("uuid"); + sc.setExample("13b48713-b931-45ea-bd60-b07491245960"); + Parameter parameter = new Parameter(); + parameter.setSchema(sc); + final CodegenParameter p = fakeJavaCodegen.fromParameter(parameter, "#/components/parameters/uuidGivenExample"); + Assert.assertEquals(p.example, "UUID.fromString(\"13b48713-b931-45ea-bd60-b07491245960\")"); + } + + private static class P_AbstractJavaCodegen extends AbstractJavaCodegen { + @Override + public CodegenType getTag() { + return null; + } + + @Override + public String getName() { + return null; + } + + @Override + public String getHelp() { + return null; + } + + /** + * Gets artifact version. + * Only for testing purposes. + * + * @return version + */ + public String getArtifactVersion() { + return this.artifactVersion; + } + } +} diff --git a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/java/assertions/AbstractAnnotationAssert.java b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/java/assertions/AbstractAnnotationAssert.java similarity index 97% rename from modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/java/assertions/AbstractAnnotationAssert.java rename to modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/java/assertions/AbstractAnnotationAssert.java index 05b53d5fa09..385048e9f63 100644 --- a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/java/assertions/AbstractAnnotationAssert.java +++ b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/java/assertions/AbstractAnnotationAssert.java @@ -1,4 +1,4 @@ -package org.openapitools.codegen.java.assertions; +package org.openapijsonschematools.codegen.java.assertions; import java.util.HashMap; import java.util.List; diff --git a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/java/assertions/ConstructorAssert.java b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/java/assertions/ConstructorAssert.java similarity index 98% rename from modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/java/assertions/ConstructorAssert.java rename to modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/java/assertions/ConstructorAssert.java index c0296c5cea6..925eb9cfd0e 100644 --- a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/java/assertions/ConstructorAssert.java +++ b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/java/assertions/ConstructorAssert.java @@ -1,4 +1,4 @@ -package org.openapitools.codegen.java.assertions; +package org.openapijsonschematools.codegen.java.assertions; import com.github.javaparser.ast.body.ConstructorDeclaration; import com.github.javaparser.ast.body.Parameter; diff --git a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/java/assertions/JavaFileAssert.java b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/java/assertions/JavaFileAssert.java similarity index 98% rename from modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/java/assertions/JavaFileAssert.java rename to modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/java/assertions/JavaFileAssert.java index e0621b31662..431ad00f10f 100644 --- a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/java/assertions/JavaFileAssert.java +++ b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/java/assertions/JavaFileAssert.java @@ -1,4 +1,4 @@ -package org.openapitools.codegen.java.assertions; +package org.openapijsonschematools.codegen.java.assertions; import java.io.File; import java.io.IOException; diff --git a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/java/assertions/MethodAnnotationAssert.java b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/java/assertions/MethodAnnotationAssert.java similarity index 95% rename from modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/java/assertions/MethodAnnotationAssert.java rename to modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/java/assertions/MethodAnnotationAssert.java index afcf80f9f97..e17ec2cc1e0 100644 --- a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/java/assertions/MethodAnnotationAssert.java +++ b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/java/assertions/MethodAnnotationAssert.java @@ -1,4 +1,4 @@ -package org.openapitools.codegen.java.assertions; +package org.openapijsonschematools.codegen.java.assertions; import java.util.List; diff --git a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/java/assertions/MethodAssert.java b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/java/assertions/MethodAssert.java similarity index 98% rename from modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/java/assertions/MethodAssert.java rename to modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/java/assertions/MethodAssert.java index 37ab7d6028d..dfb4746825c 100644 --- a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/java/assertions/MethodAssert.java +++ b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/java/assertions/MethodAssert.java @@ -1,4 +1,4 @@ -package org.openapitools.codegen.java.assertions; +package org.openapijsonschematools.codegen.java.assertions; import java.util.Arrays; import java.util.Optional; diff --git a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/java/assertions/ParameterAnnotationAssert.java b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/java/assertions/ParameterAnnotationAssert.java similarity index 90% rename from modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/java/assertions/ParameterAnnotationAssert.java rename to modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/java/assertions/ParameterAnnotationAssert.java index 184943bd4da..f2aaf07306b 100644 --- a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/java/assertions/ParameterAnnotationAssert.java +++ b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/java/assertions/ParameterAnnotationAssert.java @@ -1,4 +1,4 @@ -package org.openapitools.codegen.java.assertions; +package org.openapijsonschematools.codegen.java.assertions; import java.util.List; diff --git a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/java/assertions/ParameterAssert.java b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/java/assertions/ParameterAssert.java similarity index 96% rename from modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/java/assertions/ParameterAssert.java rename to modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/java/assertions/ParameterAssert.java index adf73c7063a..5e0d6495eea 100644 --- a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/java/assertions/ParameterAssert.java +++ b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/java/assertions/ParameterAssert.java @@ -1,4 +1,4 @@ -package org.openapitools.codegen.java.assertions; +package org.openapijsonschematools.codegen.java.assertions; import org.assertj.core.api.Assertions; import org.assertj.core.api.ObjectAssert; diff --git a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/java/assertions/PropertyAnnotationAssert.java b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/java/assertions/PropertyAnnotationAssert.java similarity index 90% rename from modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/java/assertions/PropertyAnnotationAssert.java rename to modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/java/assertions/PropertyAnnotationAssert.java index 92636a90730..d378c799c63 100644 --- a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/java/assertions/PropertyAnnotationAssert.java +++ b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/java/assertions/PropertyAnnotationAssert.java @@ -1,4 +1,4 @@ -package org.openapitools.codegen.java.assertions; +package org.openapijsonschematools.codegen.java.assertions; import java.util.List; diff --git a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/java/assertions/PropertyAssert.java b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/java/assertions/PropertyAssert.java similarity index 94% rename from modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/java/assertions/PropertyAssert.java rename to modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/java/assertions/PropertyAssert.java index 9cf733a05a8..4fa94f9ce59 100644 --- a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/java/assertions/PropertyAssert.java +++ b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/java/assertions/PropertyAssert.java @@ -1,4 +1,4 @@ -package org.openapitools.codegen.java.assertions; +package org.openapijsonschematools.codegen.java.assertions; import org.assertj.core.api.Assertions; import org.assertj.core.api.ObjectAssert; diff --git a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/java/assertions/TypeAnnotationAssert.java b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/java/assertions/TypeAnnotationAssert.java similarity index 90% rename from modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/java/assertions/TypeAnnotationAssert.java rename to modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/java/assertions/TypeAnnotationAssert.java index f8418510049..6d2ac6b674b 100644 --- a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/java/assertions/TypeAnnotationAssert.java +++ b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/java/assertions/TypeAnnotationAssert.java @@ -1,4 +1,4 @@ -package org.openapitools.codegen.java.assertions; +package org.openapijsonschematools.codegen.java.assertions; import java.util.List; diff --git a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/languages/features/DocumentationProviderFeaturesTest.java b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/languages/features/DocumentationProviderFeaturesTest.java similarity index 77% rename from modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/languages/features/DocumentationProviderFeaturesTest.java rename to modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/languages/features/DocumentationProviderFeaturesTest.java index 0954e79fb3a..ec81e695de1 100644 --- a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/languages/features/DocumentationProviderFeaturesTest.java +++ b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/languages/features/DocumentationProviderFeaturesTest.java @@ -1,11 +1,10 @@ -package org.openapitools.codegen.languages.features; +package org.openapijsonschematools.codegen.languages.features; import java.util.Arrays; import java.util.List; import java.util.Locale; import java.util.stream.Collectors; -import org.openapitools.codegen.languages.features.DocumentationProviderFeatures.AnnotationLibrary; -import org.openapitools.codegen.languages.features.DocumentationProviderFeatures.DocumentationProvider; + import org.testng.Assert; import org.testng.annotations.Test; @@ -14,7 +13,7 @@ public class DocumentationProviderFeaturesTest { @Test(priority = 0) void generateDocumentationProviderTable() { - List providers = Arrays.asList(DocumentationProvider.values()); + List providers = Arrays.asList(DocumentationProviderFeatures.DocumentationProvider.values()); StringBuilder sb = new StringBuilder(); sb.append("### DocumentationProvider\n"); sb.append("|Cli Option|Description|Property Name|Preferred Annotation Library|Supported Annotation Libraries|\n"); @@ -25,7 +24,7 @@ void generateDocumentationProviderTable() { dp.getPropertyName(), dp.getPreferredAnnotationLibrary().toCliOptValue(), dp.supportedAnnotationLibraries().stream() - .map(AnnotationLibrary::toCliOptValue) + .map(DocumentationProviderFeatures.AnnotationLibrary::toCliOptValue) .collect(Collectors.joining(", ")) ))); sb.append("\n"); @@ -34,7 +33,7 @@ void generateDocumentationProviderTable() { @Test(priority = 1) void generateAnnotationLibraryTable() { - List libraries = Arrays.asList(AnnotationLibrary.values()); + List libraries = Arrays.asList(DocumentationProviderFeatures.AnnotationLibrary.values()); StringBuilder sb = new StringBuilder(); sb.append("### AnnotationLibrary\n"); sb.append("|Cli Option|Description|Property Name|\n"); diff --git a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/options/OptionsProvider.java b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/options/OptionsProvider.java similarity index 94% rename from modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/options/OptionsProvider.java rename to modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/options/OptionsProvider.java index 1a662831032..d1029a106cf 100644 --- a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/options/OptionsProvider.java +++ b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/options/OptionsProvider.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.openapitools.codegen.options; +package org.openapijsonschematools.codegen.options; import java.util.Map; diff --git a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/options/PythonClientOptionsProvider.java b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/options/PythonClientOptionsProvider.java similarity index 93% rename from modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/options/PythonClientOptionsProvider.java rename to modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/options/PythonClientOptionsProvider.java index 9fef1ed22e4..66b3711926b 100644 --- a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/options/PythonClientOptionsProvider.java +++ b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/options/PythonClientOptionsProvider.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.openapitools.codegen.options; +package org.openapijsonschematools.codegen.options; import com.google.common.collect.ImmutableMap; -import org.openapitools.codegen.CodegenConstants; -import org.openapitools.codegen.languages.PythonClientCodegen; +import org.openapijsonschematools.codegen.CodegenConstants; +import org.openapijsonschematools.codegen.languages.PythonClientCodegen; import java.util.Map; diff --git a/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/python/PythonClientTest.java b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/python/PythonClientTest.java new file mode 100644 index 00000000000..71d8dd4befe --- /dev/null +++ b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/python/PythonClientTest.java @@ -0,0 +1,247 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapijsonschematools.codegen.python; + +import com.google.common.io.Resources; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.Operation; +import io.swagger.v3.oas.models.media.*; +import org.openapijsonschematools.codegen.ClientOptInput; +import org.openapijsonschematools.codegen.model.CodegenSchema; +import org.openapijsonschematools.codegen.DefaultGenerator; +import org.openapijsonschematools.codegen.TestUtils; +import org.openapijsonschematools.codegen.config.CodegenConfigurator; +import org.openapijsonschematools.codegen.languages.PythonClientCodegen; +import org.openapijsonschematools.codegen.model.EnumValue; +import org.openapijsonschematools.codegen.utils.ModelUtils; +import org.testng.Assert; +import org.testng.annotations.Test; + +import java.io.File; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Arrays; +import java.util.Collections; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.TreeMap; + +@SuppressWarnings("static-method") +public class PythonClientTest { + + @Test(description = "tests RecursiveExampleValueWithCycle") + public void testRecursiveExampleValueWithCycle() throws Exception { + + final OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/issue_7532.yaml"); + final PythonClientCodegen codegen = new PythonClientCodegen(); + codegen.setOpenAPI(openAPI); + Schema schemaWithCycleInTreesProperty = openAPI.getComponents().getSchemas().get("Forest"); + String exampleValue = codegen.toExampleValue(schemaWithCycleInTreesProperty, null); + + String expectedValue = Resources.toString( + Resources.getResource("3_0/issue_7532_tree_example_value_expected.txt"), + StandardCharsets.UTF_8); + expectedValue = expectedValue.replaceAll("\\r\\n", "\n"); + Assert.assertEquals(exampleValue.trim(), expectedValue.trim()); + } + + @Test(expectedExceptions = RuntimeException.class) + public void testSpecWithTooLowVersionThrowsException() { + final OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/2_0/petstore.yaml"); + final PythonClientCodegen codegen = new PythonClientCodegen(); + codegen.preprocessOpenAPI(openAPI); + } + + @Test + public void testSpecWithAcceptableVersion() { + final OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/petstore.yaml"); + final PythonClientCodegen codegen = new PythonClientCodegen(); + codegen.preprocessOpenAPI(openAPI); + Assert.assertEquals(openAPI.getOpenapi() , "3.0.0"); + Assert.assertTrue(openAPI.getExtensions() == null); + } + + @Test + public void testSpecWithAcceptableVersionAndExtension() { + final OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/issue_12196.yaml"); + final PythonClientCodegen codegen = new PythonClientCodegen(); + codegen.preprocessOpenAPI(openAPI); + Assert.assertEquals(openAPI.getOpenapi() , "3.0.0"); + Assert.assertFalse(openAPI.getExtensions().isEmpty()); + Assert.assertFalse(openAPI.getExtensions().containsValue("x-original-swagger-version")); + } + + @Test(description = "tests GeoJson Example for GeoJsonGeometry") + public void testRecursiveGeoJsonExampleWhenTypeIsGeoJsonGeometry() throws IOException { + + testEndpointExampleValue("/geojson", + "src/test/resources/3_0/issue_13043_recursive_model.yaml", + "3_0/issue_13043_recursive_model_expected_value.txt"); + + + } + + @Test(description = "tests GeoJson Example for GeometryCollection") + public void testRecursiveGeoJsonExampleWhenTypeIsGeometryCollection() throws IOException { + + testEndpointExampleValue("/geojson_geometry_collection", + "src/test/resources/3_0/issue_13043_recursive_model.yaml", + "3_0/issue_13043_geometry_collection_expected_value.txt"); + + } + + private void testEndpointExampleValue(String endpoint, String specFilePath, String expectedAnswerPath) throws IOException { + final OpenAPI openAPI = TestUtils.parseFlattenSpec(specFilePath); + final PythonClientCodegen codegen = new PythonClientCodegen(); + codegen.setOpenAPI(openAPI); + + final Operation operation = openAPI.getPaths().get(endpoint).getPost(); + Schema schema = ModelUtils.getSchemaFromRequestBody(operation.getRequestBody()); + String exampleValue = codegen.toExampleValue(schema, null); + + // uncomment if you need to regenerate the expected value + // PrintWriter printWriter = new PrintWriter("src/test/resources/" + expectedAnswerPath); + // printWriter.write(exampleValue); + // printWriter.close(); + // org.junit.Assert.assertTrue(false); + + String expectedValue = Resources.toString( + Resources.getResource(expectedAnswerPath), + StandardCharsets.UTF_8); + expectedValue = expectedValue.replaceAll("\\r\\n", "\n"); + Assert.assertEquals(exampleValue.trim(), expectedValue.trim()); + + } + + @Test + public void testApiTestsNotGenerated() throws Exception { + File output = Files.createTempDirectory("test").toFile(); + + Map globalProperties = Collections.singletonMap("apiTests", "false"); + final CodegenConfigurator configurator = new CodegenConfigurator() + .setGlobalProperties(globalProperties) + .setGeneratorName("python") + .setInputSpec("src/test/resources/3_0/petstore.yaml") + .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + + final ClientOptInput clientOptInput = configurator.toClientOptInput(); + DefaultGenerator generator = new DefaultGenerator(); + List files = generator.opts(clientOptInput).generate(); + Assert.assertTrue(files.size() > 0); + + Path pathThatShouldNotExist = output.toPath().resolve("openapi_client/test/test_paths"); + Assert.assertFalse(Files.isDirectory(pathThatShouldNotExist)); + output.deleteOnExit(); + } + + @Test + public void testApisNotGenerated() throws Exception { + File output = Files.createTempDirectory("test").toFile(); + + Map globalProperties = Collections.singletonMap("models", ""); + final CodegenConfigurator configurator = new CodegenConfigurator() + .setGlobalProperties(globalProperties) + .setGeneratorName("python") + .setInputSpec("src/test/resources/3_0/petstore.yaml") + .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + + final ClientOptInput clientOptInput = configurator.toClientOptInput(); + DefaultGenerator generator = new DefaultGenerator(); + List files = generator.opts(clientOptInput).generate(); + Assert.assertTrue(files.size() > 0); + + Path pathThatShouldNotExist = output.toPath().resolve("openapi_client/paths"); + Assert.assertFalse(Files.isDirectory(pathThatShouldNotExist)); + output.deleteOnExit(); + } + + @Test + public void testRegexWithoutTrailingSlashWorks() { + OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/11_regex.yaml"); + PythonClientCodegen codegen = new PythonClientCodegen(); + codegen.setOpenAPI(openAPI); + + String modelName = "UUID"; + Schema schema = openAPI.getComponents().getSchemas().get(modelName); + + CodegenSchema cm = codegen.fromSchema( + schema, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + String expectedRegexPattern = "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}"; + Assert.assertEquals(cm.patternInfo.pattern, expectedRegexPattern); + Assert.assertNull(cm.patternInfo.flags); + } + + @Test + public void testRegexWithMultipleFlagsWorks() { + OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/11_regex.yaml"); + PythonClientCodegen codegen = new PythonClientCodegen(); + codegen.setOpenAPI(openAPI); + + String modelName = "StringWithRegexWithThreeFlags"; + Schema schema = openAPI.getComponents().getSchemas().get(modelName); + + CodegenSchema cm = codegen.fromSchema( + schema, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + String expectedRegexPattern = "a."; + Assert.assertEquals(cm.patternInfo.pattern, expectedRegexPattern); + Assert.assertEquals(cm.patternInfo.flags, new LinkedHashSet<>(Arrays.asList("s", "i", "m"))); + } + + @Test + public void testEnumNames() { + OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/70_schema_enum_names.yaml"); + PythonClientCodegen codegen = new PythonClientCodegen(); + codegen.setOpenAPI(openAPI); + + String modelName = "StringEnum"; + Schema schema = openAPI.getComponents().getSchemas().get(modelName); + + CodegenSchema cm = codegen.fromSchema( + schema, + "#/components/schemas/" + modelName, + "#/components/schemas/" + modelName + ); + + TreeMap schemas = new TreeMap<>(); + schemas.put("StringEnum", cm); + + codegen.postProcessModels(schemas); + + Map enumVars = cm.enumValueToName; + Assert.assertEquals(enumVars.size(), 2); + Assert.assertEquals(enumVars.get(new EnumValue("#367B9C", "string", null)), "NUMBER_SIGN_367B9C"); + Assert.assertEquals(enumVars.get(new EnumValue("#FFA5A4", "string", null)), "NUMBER_SIGN_FFA5A4"); + } + + @Test(description = "format imports of models using a package containing dots") + public void testImportWithQualifiedPackageName() throws Exception { + final PythonClientCodegen codegen = new PythonClientCodegen(); + codegen.setPackageName("openapi.client"); + + String importValue = codegen.toModelImport("model_name.ModelName"); + Assert.assertEquals(importValue, "from openapi.client.components.schema import model_name"); + } +} diff --git a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/serializer/SerializerUtilsTest.java b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/serializer/SerializerUtilsTest.java similarity index 99% rename from modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/serializer/SerializerUtilsTest.java rename to modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/serializer/SerializerUtilsTest.java index adfcaaed03d..d368b7a6092 100644 --- a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/serializer/SerializerUtilsTest.java +++ b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/serializer/SerializerUtilsTest.java @@ -1,4 +1,4 @@ -package org.openapitools.codegen.serializer; +package org.openapijsonschematools.codegen.serializer; import io.swagger.v3.oas.models.*; import io.swagger.v3.oas.models.info.Info; diff --git a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/templating/HandlebarsEngineAdapterTest.java b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/templating/HandlebarsEngineAdapterTest.java similarity index 97% rename from modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/templating/HandlebarsEngineAdapterTest.java rename to modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/templating/HandlebarsEngineAdapterTest.java index a1ee38796b1..4cc572fdbfd 100644 --- a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/templating/HandlebarsEngineAdapterTest.java +++ b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/templating/HandlebarsEngineAdapterTest.java @@ -1,4 +1,4 @@ -package org.openapitools.codegen.templating; +package org.openapijsonschematools.codegen.templating; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; diff --git a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/templating/handlebars/StringHelpersTest.java b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/templating/handlebars/StringHelpersTest.java similarity index 98% rename from modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/templating/handlebars/StringHelpersTest.java rename to modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/templating/handlebars/StringHelpersTest.java index 5bea5678bbb..1b2fcff75a4 100644 --- a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/templating/handlebars/StringHelpersTest.java +++ b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/templating/handlebars/StringHelpersTest.java @@ -1,4 +1,4 @@ -package org.openapitools.codegen.templating.handlebars; +package org.openapijsonschematools.codegen.templating.handlebars; import com.github.jknack.handlebars.Context; import com.github.jknack.handlebars.Handlebars; diff --git a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/templating/mustache/CamelCaseLambdaTest.java b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/templating/mustache/CamelCaseLambdaTest.java similarity index 94% rename from modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/templating/mustache/CamelCaseLambdaTest.java rename to modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/templating/mustache/CamelCaseLambdaTest.java index 101b80adb12..839d4c201ab 100644 --- a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/templating/mustache/CamelCaseLambdaTest.java +++ b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/templating/mustache/CamelCaseLambdaTest.java @@ -1,4 +1,4 @@ -package org.openapitools.codegen.templating.mustache; +package org.openapijsonschematools.codegen.templating.mustache; import static org.mockito.AdditionalAnswers.returnsFirstArg; import static org.mockito.ArgumentMatchers.anyString; @@ -10,7 +10,7 @@ import org.mockito.Mock; import org.mockito.MockitoAnnotations; -import org.openapitools.codegen.CodegenConfig; +import org.openapijsonschematools.codegen.CodegenConfig; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; diff --git a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/templating/mustache/IndentedLambdaTest.java b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/templating/mustache/IndentedLambdaTest.java similarity index 94% rename from modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/templating/mustache/IndentedLambdaTest.java rename to modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/templating/mustache/IndentedLambdaTest.java index 51a4eeda0a3..29d551121b5 100644 --- a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/templating/mustache/IndentedLambdaTest.java +++ b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/templating/mustache/IndentedLambdaTest.java @@ -1,4 +1,4 @@ -package org.openapitools.codegen.templating.mustache; +package org.openapijsonschematools.codegen.templating.mustache; import java.util.Map; diff --git a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/templating/mustache/LambdaTest.java b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/templating/mustache/LambdaTest.java similarity index 95% rename from modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/templating/mustache/LambdaTest.java rename to modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/templating/mustache/LambdaTest.java index fbaed952eff..3d91504a1bb 100644 --- a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/templating/mustache/LambdaTest.java +++ b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/templating/mustache/LambdaTest.java @@ -1,4 +1,4 @@ -package org.openapitools.codegen.templating.mustache; +package org.openapijsonschematools.codegen.templating.mustache; import static org.testng.Assert.assertEquals; diff --git a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/templating/mustache/LowercaseLambdaTest.java b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/templating/mustache/LowercaseLambdaTest.java similarity index 91% rename from modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/templating/mustache/LowercaseLambdaTest.java rename to modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/templating/mustache/LowercaseLambdaTest.java index 87ade0caa70..fe037db3630 100644 --- a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/templating/mustache/LowercaseLambdaTest.java +++ b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/templating/mustache/LowercaseLambdaTest.java @@ -1,4 +1,4 @@ -package org.openapitools.codegen.templating.mustache; +package org.openapijsonschematools.codegen.templating.mustache; import static org.mockito.AdditionalAnswers.returnsFirstArg; import static org.mockito.ArgumentMatchers.anyString; @@ -10,7 +10,7 @@ import org.mockito.Mock; import org.mockito.MockitoAnnotations; -import org.openapitools.codegen.CodegenConfig; +import org.openapijsonschematools.codegen.CodegenConfig; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; diff --git a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/templating/mustache/OnChangeLambdaTest.java b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/templating/mustache/OnChangeLambdaTest.java similarity index 94% rename from modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/templating/mustache/OnChangeLambdaTest.java rename to modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/templating/mustache/OnChangeLambdaTest.java index 175524c0d28..a6d9a73fd18 100644 --- a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/templating/mustache/OnChangeLambdaTest.java +++ b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/templating/mustache/OnChangeLambdaTest.java @@ -1,4 +1,4 @@ -package org.openapitools.codegen.templating.mustache; +package org.openapijsonschematools.codegen.templating.mustache; import java.util.Map; diff --git a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/templating/mustache/PascalCaseLambdaTest.java b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/templating/mustache/PascalCaseLambdaTest.java similarity index 95% rename from modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/templating/mustache/PascalCaseLambdaTest.java rename to modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/templating/mustache/PascalCaseLambdaTest.java index 30a3d0ef4eb..d0c78a10ce1 100644 --- a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/templating/mustache/PascalCaseLambdaTest.java +++ b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/templating/mustache/PascalCaseLambdaTest.java @@ -1,4 +1,4 @@ -package org.openapitools.codegen.templating.mustache; +package org.openapijsonschematools.codegen.templating.mustache; import static org.mockito.AdditionalAnswers.returnsFirstArg; import static org.mockito.ArgumentMatchers.anyString; @@ -10,7 +10,7 @@ import org.mockito.Mock; import org.mockito.MockitoAnnotations; -import org.openapitools.codegen.CodegenConfig; +import org.openapijsonschematools.codegen.CodegenConfig; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; diff --git a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/templating/mustache/SnakecaseLambdaTest.java b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/templating/mustache/SnakecaseLambdaTest.java similarity index 94% rename from modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/templating/mustache/SnakecaseLambdaTest.java rename to modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/templating/mustache/SnakecaseLambdaTest.java index 9dc0d57a506..e457d04e818 100644 --- a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/templating/mustache/SnakecaseLambdaTest.java +++ b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/templating/mustache/SnakecaseLambdaTest.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.openapitools.codegen.templating.mustache; +package org.openapijsonschematools.codegen.templating.mustache; import java.util.Map; diff --git a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/templating/mustache/SplitStringLambdaTest.java b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/templating/mustache/SplitStringLambdaTest.java similarity index 98% rename from modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/templating/mustache/SplitStringLambdaTest.java rename to modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/templating/mustache/SplitStringLambdaTest.java index e0b282c26b6..e14a6a066fb 100644 --- a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/templating/mustache/SplitStringLambdaTest.java +++ b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/templating/mustache/SplitStringLambdaTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.openapitools.codegen.templating.mustache; +package org.openapijsonschematools.codegen.templating.mustache; import static org.mockito.Mockito.when; import static org.testng.Assert.assertEquals; diff --git a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/templating/mustache/TitlecaseLambdaTest.java b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/templating/mustache/TitlecaseLambdaTest.java similarity index 91% rename from modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/templating/mustache/TitlecaseLambdaTest.java rename to modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/templating/mustache/TitlecaseLambdaTest.java index 2b3f632e9dd..a47f1e8bd91 100644 --- a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/templating/mustache/TitlecaseLambdaTest.java +++ b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/templating/mustache/TitlecaseLambdaTest.java @@ -1,4 +1,4 @@ -package org.openapitools.codegen.templating.mustache; +package org.openapijsonschematools.codegen.templating.mustache; import java.util.Map; diff --git a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/templating/mustache/TrimWhitespaceLambdaTest.java b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/templating/mustache/TrimWhitespaceLambdaTest.java similarity index 96% rename from modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/templating/mustache/TrimWhitespaceLambdaTest.java rename to modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/templating/mustache/TrimWhitespaceLambdaTest.java index 5d765506928..a732b1b48b4 100644 --- a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/templating/mustache/TrimWhitespaceLambdaTest.java +++ b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/templating/mustache/TrimWhitespaceLambdaTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.openapitools.codegen.templating.mustache; +package org.openapijsonschematools.codegen.templating.mustache; import static org.mockito.Mockito.when; import static org.testng.Assert.assertEquals; diff --git a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/templating/mustache/UppercaseLambdaTest.java b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/templating/mustache/UppercaseLambdaTest.java similarity index 85% rename from modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/templating/mustache/UppercaseLambdaTest.java rename to modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/templating/mustache/UppercaseLambdaTest.java index ebd12454ce6..4953bd3c750 100644 --- a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/templating/mustache/UppercaseLambdaTest.java +++ b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/templating/mustache/UppercaseLambdaTest.java @@ -1,4 +1,4 @@ -package org.openapitools.codegen.templating.mustache; +package org.openapijsonschematools.codegen.templating.mustache; import java.util.Map; diff --git a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/testutils/AssertFile.java b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/testutils/AssertFile.java similarity index 99% rename from modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/testutils/AssertFile.java rename to modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/testutils/AssertFile.java index d46798cd7f5..4bba255c3e9 100644 --- a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/testutils/AssertFile.java +++ b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/testutils/AssertFile.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.openapitools.codegen.testutils; +package org.openapijsonschematools.codegen.testutils; import difflib.Delta; import difflib.DiffUtils; diff --git a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/testutils/IntegrationTestPathsConfig.java b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/testutils/IntegrationTestPathsConfig.java similarity index 97% rename from modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/testutils/IntegrationTestPathsConfig.java rename to modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/testutils/IntegrationTestPathsConfig.java index fdfd30230cb..a52d5c6e305 100644 --- a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/testutils/IntegrationTestPathsConfig.java +++ b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/testutils/IntegrationTestPathsConfig.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.openapitools.codegen.testutils; +package org.openapijsonschematools.codegen.testutils; import java.nio.file.Path; import java.nio.file.Paths; diff --git a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/utils/JsonCacheTest.java b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/utils/JsonCacheTest.java similarity index 99% rename from modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/utils/JsonCacheTest.java rename to modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/utils/JsonCacheTest.java index 7101d441b2a..90ce4b5772b 100644 --- a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/utils/JsonCacheTest.java +++ b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/utils/JsonCacheTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.openapitools.codegen.utils; +package org.openapijsonschematools.codegen.utils; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.core.JsonPointer; @@ -25,8 +25,6 @@ import com.fasterxml.jackson.datatype.joda.JodaModule; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; -import org.openapitools.codegen.utils.JsonCache.CacheException; -import org.openapitools.codegen.utils.JsonCache.Root.MergePolicy; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; @@ -205,7 +203,7 @@ public String toString() { private JsonCache.Root root; private JsonCache cache; - private void reload() throws CacheException, UnsupportedEncodingException { + private void reload() throws JsonCache.CacheException, UnsupportedEncodingException { root.unload(); root.load(new ByteArrayInputStream(JSON.getBytes(StandardCharsets.UTF_8))); } @@ -993,14 +991,14 @@ public void testMerge() throws Exception { + "}"; ByteArrayInputStream in = new ByteArrayInputStream(incoming.getBytes(StandardCharsets.UTF_8)); - root.mergePolicy(MergePolicy.NO_MERGE).load(in); + root.mergePolicy(JsonCache.Root.MergePolicy.NO_MERGE).load(in); assertFalse(root.isDirty(), "cache should not be dirty after second load() in NO_MERGE mode"); assertEquals(1, root.size(""), "root size incorrect after second load() in NO_MERGE mode;"); assertEquals(8, cache.size(""), "cache size incorrect after second load() in NO_MERGE mode;"); testGet(); in.reset(); - root.mergePolicy(MergePolicy.KEEP_EXISTING).load(in); + root.mergePolicy(JsonCache.Root.MergePolicy.KEEP_EXISTING).load(in); assertTrue(root.isDirty(), "cache should be dirty after second load() in KEEP_EXISTING mode"); assertEquals(2, root.size(""), "root size incorrect after second load() in KEEP_EXISTING mode;"); assertEquals(8, cache.size(""), "cache size incorrect after second load() in KEEP_EXISTING mode;"); @@ -1014,7 +1012,7 @@ public void testMerge() throws Exception { reload(); in.reset(); - root.mergePolicy(MergePolicy.MERGE_RECURSIVE).load(in); + root.mergePolicy(JsonCache.Root.MergePolicy.MERGE_RECURSIVE).load(in); assertTrue(root.isDirty(), "cache should be dirty after second load() in MERGE_RECURSIVE mode"); assertEquals(2, root.size(""), "root size incorrect after second load() in MERGE_RECURSIVE mode;"); assertEquals(10, root.get("/JsonCacheMerge/number"), "added root property not merged in MERGE_RECURSIVE mode"); @@ -1035,7 +1033,7 @@ public void testMerge() throws Exception { reload(); in.reset(); - root.mergePolicy(MergePolicy.OVERWRITE_EXISTING).load(in); + root.mergePolicy(JsonCache.Root.MergePolicy.OVERWRITE_EXISTING).load(in); assertTrue(root.isDirty(), "cache should be dirty after second load() in OVERWRITE_EXISTING mode"); assertEquals(false, cache.get("/boolean"), "existing boolean not overwritten by load() in OVERWRITE_EXISTING mode;"); @@ -1179,7 +1177,7 @@ public void testSetDate() throws Exception { assertTrue(root.isDirty(), "cache should be dirty after date writes;"); } - private void testSetDate0(String dateStr, Object date) throws CacheException { + private void testSetDate0(String dateStr, Object date) throws JsonCache.CacheException { cache.set("/dateStr", dateStr); assertEquals(date, cache.getObject("/dateStr", date.getClass()), "getObject(\"/dateStr\", " + date.getClass().getName() + ".class) returned incorrect result;"); diff --git a/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/utils/ModelUtilsTest.java b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/utils/ModelUtilsTest.java new file mode 100644 index 00000000000..96dd7c8c816 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/utils/ModelUtilsTest.java @@ -0,0 +1,229 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * Copyright 2018 SmartBear Software + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapijsonschematools.codegen.utils; + +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.media.*; +import io.swagger.v3.oas.models.parameters.Parameter; +import io.swagger.v3.oas.models.parameters.RequestBody; +import io.swagger.v3.oas.models.responses.ApiResponse; +import org.openapijsonschematools.codegen.TestUtils; +import org.testng.Assert; +import org.testng.annotations.Test; + +import java.util.*; + +public class ModelUtilsTest { + + @Test + public void testGetAllUsedSchemas() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/unusedSchemas.yaml"); + List allUsedSchemas = ModelUtils.getAllUsedSchemas(openAPI); + List expectedAllUsedSchemas = Arrays.asList( + "SomeObj1", + "SomeObj2", + "SomeObj3", + "SomeObjShared", + "SomeObj6", + "SomeObj7", + "SomeObj8", + "SomeObj9A", + "SomeObj9B", + "SomeObj10A", + "SomeObj10B", + "SomeObj11", + "SomeArrayObj12", + "ArrayItem12", + "SomeArrayObj13", + "ArrayItem13", + "SomeObj14", + "PropertyObj14", + "SomeObj15", + "SomeMapObj16", + "MapItem16", + "SomeObj17", + "SomeObj18", + "Common18", + "Obj19ByAge", + "Obj19ByType", + "SomeObj20", + "OtherObj20", + "PingDataInput21", + "PingDataOutput21", + "SInput22", + "SOutput22", + "SomeHeader23", + "SomeHeader24", + "SomeObj25", + "SomeObj26", + "Param27", + "Param28", + "Parent30", + "AChild30", + "BChild30" + ); + Assert.assertEquals(allUsedSchemas, expectedAllUsedSchemas); + Assert.assertTrue(allUsedSchemas.containsAll(expectedAllUsedSchemas)); + } + + @Test + public void testGetUnusedSchemas() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/unusedSchemas.yaml"); + List unusedSchemas = ModelUtils.getUnusedSchemas(openAPI); + List expectedUnusedSchemas = Arrays.asList( + "UnusedObj1", + "UnusedObj2", + "UnusedObj3", + "UnusedObj4", + "Parent29", + "AChild29", + "BChild29" + ); + Assert.assertEquals(unusedSchemas, expectedUnusedSchemas); + } + + @Test + public void testIsModelAllowsEmptyBaseModel() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/2_0/emptyBaseModel.yaml"); + Schema commandSchema = ModelUtils.getSchema(openAPI, "Command"); + + Assert.assertTrue(ModelUtils.isModel(commandSchema)); + } + + @Test + public void testReferencedSchema() { + Schema otherObj = new ObjectSchema().addProperties("sprop", new StringSchema()).addProperties("iprop", new IntegerSchema()); + + OpenAPI openAPI = TestUtils.createOpenAPI(); + openAPI.getComponents().addSchemas("OtherObj", otherObj); + + Schema notExistingReferencedSchema = new Schema().$ref("NotExisting"); + Schema result1 = ModelUtils.getReferencedSchema(openAPI, notExistingReferencedSchema); + Assert.assertEquals(result1, notExistingReferencedSchema); + + Schema result2 = ModelUtils.getReferencedSchema(openAPI, new Schema().$ref("#/components/schemas/OtherObj")); + Assert.assertEquals(result2, otherObj); + } + + @Test + public void testReferencedRequestBody() { + RequestBody otherRequestBody = new RequestBody().description("Some Description"); + + OpenAPI openAPI = TestUtils.createOpenAPI(); + openAPI.getComponents().addRequestBodies("OtherRequestBody", otherRequestBody); + + RequestBody notExistingRequestBody = new RequestBody().$ref("NotExisting"); + RequestBody result1 = ModelUtils.getReferencedRequestBody(openAPI, notExistingRequestBody); + Assert.assertEquals(result1, notExistingRequestBody); + + RequestBody result2 = ModelUtils.getReferencedRequestBody(openAPI, new RequestBody().$ref("#/components/requestBodies/OtherRequestBody")); + Assert.assertEquals(result2, otherRequestBody); + } + + @Test + public void testReferencedApiResponse() { + ApiResponse otherApiResponse = new ApiResponse().description("Some Description"); + + OpenAPI openAPI = TestUtils.createOpenAPI(); + openAPI.getComponents().addResponses("OtherApiResponse", otherApiResponse); + + ApiResponse notExistingApiResponse = new ApiResponse().$ref("NotExisting"); + ApiResponse result1 = ModelUtils.getReferencedApiResponse(openAPI, notExistingApiResponse); + Assert.assertEquals(result1, notExistingApiResponse); + + ApiResponse result2 = ModelUtils.getReferencedApiResponse(openAPI, new ApiResponse().$ref("#/components/responses/OtherApiResponse")); + Assert.assertEquals(result2, otherApiResponse); + } + + @Test + public void testReferencedParameter() { + Parameter otherParameter = new Parameter().description("Some Description"); + + OpenAPI openAPI = TestUtils.createOpenAPI(); + openAPI.getComponents().addParameters("OtherParameter", otherParameter); + + Parameter notExistingParameter = new Parameter().$ref("NotExisting"); + Parameter result1 = ModelUtils.getReferencedParameter(openAPI, notExistingParameter); + Assert.assertEquals(result1, notExistingParameter); + + Parameter result2 = ModelUtils.getReferencedParameter(openAPI, new Parameter().$ref("#/components/parameters/OtherParameter")); + Assert.assertEquals(result2, otherParameter); + } + + /** + * Issue https://github.com/OpenAPITools/openapi-generator/issues/582. + * Composed schemas should not get unaliased when generating model properties, in order to properly + * generate the property data type name. + */ + @Test + public void testComposedSchemasAreNotUnaliased() { + ComposedSchema composedSchema = new ComposedSchema(); + composedSchema.allOf(Arrays.asList( + new Schema<>().$ref("#/components/schemas/SomeSchema"), + new ObjectSchema() + )); + Schema refToComposedSchema = new Schema().$ref("#/components/schemas/SomeComposedSchema"); + + OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("SomeComposedSchema", composedSchema); + + Assert.assertEquals(refToComposedSchema, ModelUtils.unaliasSchema(openAPI, refToComposedSchema, new HashMap<>())); + } + + @Test + public void testAliasedTypeIsNotUnaliasedIfUsedForImportMapping() { + Schema emailSchema = new Schema().$ref("#/components/schemas/Email").type("string"); + StringSchema stringSchema = new StringSchema(); + HashMap schemaMappings = new HashMap<>(); + schemaMappings.put("Email", "foo.bar.Email"); + + OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("Email", stringSchema); + + Assert.assertEquals(emailSchema, ModelUtils.unaliasSchema(openAPI, emailSchema, schemaMappings)); + Assert.assertEquals(stringSchema, ModelUtils.unaliasSchema(openAPI, emailSchema, new HashMap<>())); + } + + @Test + public void testIsSetForValidSet() { + ArraySchema as = new ArraySchema() + .items(new StringSchema()); + as.setUniqueItems(true); + + Assert.assertTrue(ModelUtils.isSet(as)); + } + + @Test + public void testIsSetFalseForInvalidSet() { + ArraySchema as = new ArraySchema() + .items(new StringSchema()); + as.setUniqueItems(false); + + Assert.assertFalse(ModelUtils.isSet(as)); + } + + @Test + public void testIsSetFailsForNullSchema() { + ArraySchema as = null; + Assert.assertFalse(ModelUtils.isSet(as)); + } + + @Test + public void testSimpleRefDecoding() { + String decoded = ModelUtils.getSimpleRef("#/components/~01%20Hallo~1Welt"); + Assert.assertEquals(decoded, "~1 Hallo/Welt"); + } +} diff --git a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/utils/OnceLoggerTest.java b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/utils/OnceLoggerTest.java similarity index 76% rename from modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/utils/OnceLoggerTest.java rename to modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/utils/OnceLoggerTest.java index 5e2c3729a6d..157d3623b6a 100644 --- a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/utils/OnceLoggerTest.java +++ b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/utils/OnceLoggerTest.java @@ -1,8 +1,8 @@ -package org.openapitools.codegen.utils; +package org.openapijsonschematools.codegen.utils; import com.google.common.testing.FakeTicker; import org.mockito.Mockito; -import org.openapitools.codegen.config.GlobalSettings; +import org.openapijsonschematools.codegen.config.GlobalSettings; import org.slf4j.Logger; import org.slf4j.Marker; import org.testng.annotations.AfterMethod; @@ -14,7 +14,6 @@ import java.util.concurrent.atomic.AtomicInteger; import static org.mockito.Mockito.*; -import static org.openapitools.codegen.utils.OnceLogger.*; import static org.testng.Assert.*; @SuppressWarnings({"SameParameterValue", "UnstableApiUsage"}) @@ -40,7 +39,7 @@ public void beforeEach() { @Test public void onceLogsMessagesOnceWithinTimeLimit() throws InterruptedException { String message = "onceLogsMessagesOnceWithinTimeLimit"; - Logger instance = once(mockLogger); + Logger instance = OnceLogger.once(mockLogger); when(mockLogger.isWarnEnabled()).thenReturn(true); when(mockLogger.isWarnEnabled(any(Marker.class))).thenReturn(true); @@ -48,13 +47,13 @@ public void onceLogsMessagesOnceWithinTimeLimit() throws InterruptedException { instance.warn(message); } - AtomicInteger counter1 = messageCountCache.getIfPresent(message); + AtomicInteger counter1 = OnceLogger.messageCountCache.getIfPresent(message); assertNotNull(counter1); assertEquals(counter1.get(), 50); ticker.advance(1100L, TimeUnit.MILLISECONDS); - AtomicInteger noCounter = messageCountCache.getIfPresent(message); + AtomicInteger noCounter = OnceLogger.messageCountCache.getIfPresent(message); assertNull(noCounter); verify(mockLogger, times(1)).warn(any(Marker.class), same(message)); @@ -64,7 +63,7 @@ public void onceLogsMessagesOnceWithinTimeLimit() throws InterruptedException { ticker.advance(5, TimeUnit.MILLISECONDS); - AtomicInteger counter2 = messageCountCache.getIfPresent(message); + AtomicInteger counter2 = OnceLogger.messageCountCache.getIfPresent(message); assertNotNull(counter2); assertNotEquals(counter2, counter1); @@ -75,7 +74,7 @@ public void onceLogsMessagesOnceWithinTimeLimit() throws InterruptedException { @Test public void onceLogsOneMessageByDefault() { String message = "onceLogsOneMessageByDefault"; - Logger instance = once(mockLogger); + Logger instance = OnceLogger.once(mockLogger); when(mockLogger.isWarnEnabled()).thenReturn(true); when(mockLogger.isWarnEnabled(any(Marker.class))).thenReturn(true); @@ -88,19 +87,19 @@ public void onceLogsOneMessageByDefault() { @Test public void onceReturnsDecoratedLogger() { - Logger instance = once(mockLogger); + Logger instance = OnceLogger.once(mockLogger); assertTrue(instance instanceof OnceLogger); } @Test public void onceReturnsOriginalLoggerWhenDisabled() { - String originalSetting = GlobalSettings.getProperty(ENABLE_ONCE_LOGGER_PROPERTY); + String originalSetting = GlobalSettings.getProperty(OnceLogger.ENABLE_ONCE_LOGGER_PROPERTY); try { - GlobalSettings.setProperty(ENABLE_ONCE_LOGGER_PROPERTY, "false"); - Logger instance = once(mockLogger); + GlobalSettings.setProperty(OnceLogger.ENABLE_ONCE_LOGGER_PROPERTY, "false"); + Logger instance = OnceLogger.once(mockLogger); assertFalse(instance instanceof OnceLogger); } finally { - resetGlobalProperty(ENABLE_ONCE_LOGGER_PROPERTY, originalSetting); + resetGlobalProperty(OnceLogger.ENABLE_ONCE_LOGGER_PROPERTY, originalSetting); } } diff --git a/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/utils/StringUtilsTest.java b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/utils/StringUtilsTest.java new file mode 100644 index 00000000000..115578c9789 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/utils/StringUtilsTest.java @@ -0,0 +1,40 @@ +package org.openapijsonschematools.codegen.utils; + +import org.testng.Assert; +import org.testng.annotations.Test; + +public class StringUtilsTest { + // we'll assume that underscore (Twitter elephant bird) works fine + @Test + public void testUnderscore() { + Assert.assertEquals(StringUtils.underscore("abcd"), "abcd"); + Assert.assertEquals(StringUtils.underscore("abCd"), "ab_cd"); + Assert.assertEquals(StringUtils.underscore("ListABCs"), "list_abcs"); + } + + @Test + public void testCamelize() throws Exception { + Assert.assertEquals(StringUtils.camelize("abcd"), "Abcd"); + Assert.assertEquals(StringUtils.camelize("some-value"), "SomeValue"); + Assert.assertEquals(StringUtils.camelize("some_value"), "SomeValue"); + Assert.assertEquals(StringUtils.camelize("$type"), "$Type"); + + Assert.assertEquals(StringUtils.camelize("abcd", true), "abcd"); + Assert.assertEquals(StringUtils.camelize("some-value", true), "someValue"); + Assert.assertEquals(StringUtils.camelize("some_value", true), "someValue"); + Assert.assertEquals(StringUtils.camelize("Abcd", true), "abcd"); + Assert.assertEquals(StringUtils.camelize("$type", true), "$type"); + + Assert.assertEquals(StringUtils.camelize("123", true), "123"); + Assert.assertEquals(StringUtils.camelize("$123", true), "$123"); + } + + @Test + public void testDashize() { + Assert.assertEquals(StringUtils.dashize("abcd"), "abcd"); + Assert.assertEquals(StringUtils.dashize("some-value"), "some-value"); + Assert.assertEquals(StringUtils.dashize("some_value"), "some-value"); + Assert.assertEquals(StringUtils.dashize("Foo_Response__links"), "foo-response-links"); + Assert.assertEquals(StringUtils.dashize("Foo Response _links"), "foo-response-links"); + } +} diff --git a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/utils/URLPathUtilsTest.java b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/utils/URLPathUtilsTest.java similarity index 99% rename from modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/utils/URLPathUtilsTest.java rename to modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/utils/URLPathUtilsTest.java index f4fa3d68f6d..2e308cb921a 100644 --- a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/utils/URLPathUtilsTest.java +++ b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/utils/URLPathUtilsTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.openapitools.codegen.utils; +package org.openapijsonschematools.codegen.utils; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.servers.Server; diff --git a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/validations/oas/OpenApiOperationValidationsTest.java b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/validations/oas/OpenApiOperationValidationsTest.java similarity index 96% rename from modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/validations/oas/OpenApiOperationValidationsTest.java rename to modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/validations/oas/OpenApiOperationValidationsTest.java index dacd58c9b8d..5132baffa85 100644 --- a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/validations/oas/OpenApiOperationValidationsTest.java +++ b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/validations/oas/OpenApiOperationValidationsTest.java @@ -1,4 +1,4 @@ -package org.openapitools.codegen.validations.oas; +package org.openapijsonschematools.codegen.validations.oas; import io.swagger.v3.oas.models.Operation; import io.swagger.v3.oas.models.PathItem; @@ -6,8 +6,8 @@ import io.swagger.v3.oas.models.media.MediaType; import io.swagger.v3.oas.models.parameters.RequestBody; import org.apache.commons.lang3.StringUtils; -import org.openapitools.codegen.validation.Invalid; -import org.openapitools.codegen.validation.ValidationResult; +import org.openapijsonschematools.codegen.validation.Invalid; +import org.openapijsonschematools.codegen.validation.ValidationResult; import org.testng.Assert; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; diff --git a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/validations/oas/OpenApiParameterValidationsTest.java b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/validations/oas/OpenApiParameterValidationsTest.java similarity index 95% rename from modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/validations/oas/OpenApiParameterValidationsTest.java rename to modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/validations/oas/OpenApiParameterValidationsTest.java index 2ed46fb5bc8..3e4444d6345 100644 --- a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/validations/oas/OpenApiParameterValidationsTest.java +++ b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/validations/oas/OpenApiParameterValidationsTest.java @@ -1,8 +1,8 @@ -package org.openapitools.codegen.validations.oas; +package org.openapijsonschematools.codegen.validations.oas; import io.swagger.v3.oas.models.parameters.Parameter; -import org.openapitools.codegen.validation.Invalid; -import org.openapitools.codegen.validation.ValidationResult; +import org.openapijsonschematools.codegen.validation.Invalid; +import org.openapijsonschematools.codegen.validation.ValidationResult; import org.testng.Assert; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; diff --git a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/validations/oas/OpenApiSchemaTypeTest.java b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/validations/oas/OpenApiSchemaTypeTest.java similarity index 86% rename from modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/validations/oas/OpenApiSchemaTypeTest.java rename to modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/validations/oas/OpenApiSchemaTypeTest.java index 934da7997dd..3abd28a70bf 100644 --- a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/validations/oas/OpenApiSchemaTypeTest.java +++ b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/validations/oas/OpenApiSchemaTypeTest.java @@ -1,9 +1,9 @@ -package org.openapitools.codegen.validations.oas; +package org.openapijsonschematools.codegen.validations.oas; import io.swagger.v3.oas.models.OpenAPI; -import org.openapitools.codegen.TestUtils; -import org.openapitools.codegen.validation.Invalid; -import org.openapitools.codegen.validation.ValidationResult; +import org.openapijsonschematools.codegen.TestUtils; +import org.openapijsonschematools.codegen.validation.Invalid; +import org.openapijsonschematools.codegen.validation.ValidationResult; import org.testng.Assert; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; diff --git a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/validations/oas/OpenApiSchemaValidationsTest.java b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/validations/oas/OpenApiSchemaValidationsTest.java similarity index 96% rename from modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/validations/oas/OpenApiSchemaValidationsTest.java rename to modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/validations/oas/OpenApiSchemaValidationsTest.java index 7ac2fc746b6..3ca85b51b47 100644 --- a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/validations/oas/OpenApiSchemaValidationsTest.java +++ b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/validations/oas/OpenApiSchemaValidationsTest.java @@ -1,8 +1,8 @@ -package org.openapitools.codegen.validations.oas; +package org.openapijsonschematools.codegen.validations.oas; import io.swagger.v3.oas.models.media.*; -import org.openapitools.codegen.validation.Invalid; -import org.openapitools.codegen.validation.ValidationResult; +import org.openapijsonschematools.codegen.validation.Invalid; +import org.openapijsonschematools.codegen.validation.ValidationResult; import org.testng.Assert; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; diff --git a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/validations/oas/OpenApiSecuritySchemeValidationsTest.java b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/validations/oas/OpenApiSecuritySchemeValidationsTest.java similarity index 95% rename from modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/validations/oas/OpenApiSecuritySchemeValidationsTest.java rename to modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/validations/oas/OpenApiSecuritySchemeValidationsTest.java index a0df21ca178..5da0decc216 100644 --- a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/validations/oas/OpenApiSecuritySchemeValidationsTest.java +++ b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/validations/oas/OpenApiSecuritySchemeValidationsTest.java @@ -1,8 +1,8 @@ -package org.openapitools.codegen.validations.oas; +package org.openapijsonschematools.codegen.validations.oas; import io.swagger.v3.oas.models.security.SecurityScheme; -import org.openapitools.codegen.validation.Invalid; -import org.openapitools.codegen.validation.ValidationResult; +import org.openapijsonschematools.codegen.validation.Invalid; +import org.openapijsonschematools.codegen.validation.ValidationResult; import org.testng.Assert; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; diff --git a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java b/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java deleted file mode 100644 index d83ca741b12..00000000000 --- a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java +++ /dev/null @@ -1,4256 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen; - -import com.google.common.collect.Sets; -import com.samskivert.mustache.Mustache.Lambda; - -import io.swagger.parser.OpenAPIParser; -import io.swagger.v3.oas.models.Components; -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.Operation; -import io.swagger.v3.oas.models.PathItem; -import io.swagger.v3.oas.models.headers.Header; -import io.swagger.v3.oas.models.media.*; -import io.swagger.v3.oas.models.parameters.QueryParameter; -import io.swagger.v3.oas.models.parameters.RequestBody; -import io.swagger.v3.oas.models.responses.ApiResponse; -import io.swagger.v3.oas.models.responses.ApiResponses; -import io.swagger.v3.oas.models.security.SecurityScheme; -import io.swagger.v3.parser.core.models.ParseOptions; - -import org.openapitools.codegen.config.CodegenConfigurator; -import org.openapitools.codegen.config.GlobalSettings; -import org.openapitools.codegen.model.ModelMap; -import org.openapitools.codegen.model.ModelsMap; -import org.openapitools.codegen.templating.mustache.CamelCaseLambda; -import org.openapitools.codegen.templating.mustache.IndentedLambda; -import org.openapitools.codegen.templating.mustache.LowercaseLambda; -import org.openapitools.codegen.templating.mustache.TitlecaseLambda; -import org.openapitools.codegen.templating.mustache.UppercaseLambda; -import org.openapitools.codegen.utils.ModelUtils; -import org.openapitools.codegen.utils.SemVer; -import org.testng.Assert; -import org.testng.annotations.Ignore; -import org.testng.annotations.Test; - -import java.io.File; -import java.nio.file.Files; -import java.util.*; -import java.util.stream.Collectors; - -import static org.testng.Assert.*; - - -public class DefaultCodegenTest { - - @Test - public void testDeeplyNestedAdditionalPropertiesImports() { - final DefaultCodegen codegen = new DefaultCodegen(); - final OpenAPI openApi = TestUtils.parseFlattenSpec("src/test/resources/3_0/additional-properties-deeply-nested.yaml"); - codegen.setOpenAPI(openApi); - PathItem path = openApi.getPaths().get("/ping"); - CodegenOperation operation = codegen.fromOperation("/ping", "post", path.getPost(), path.getServers()); - Assert.assertEquals(Sets.intersection(operation.imports, Sets.newHashSet("Person")).size(), 1); - } - - @Test - public void testEnumImports() { - final DefaultCodegen codegen = new DefaultCodegen(); - final OpenAPI openApi = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_12445.yaml"); - codegen.setOpenAPI(openApi); - PathItem path = openApi.getPaths().get("/pets/petType/{type}"); - CodegenOperation operation = codegen.fromOperation("/pets/petType/{type}", "get", path.getGet(), path.getServers()); - Assert.assertEquals(Sets.intersection(operation.imports, Sets.newHashSet("PetByType")).size(), 1); - } - - @Test - public void testHasBodyParameter() { - final Schema refSchema = new Schema<>().$ref("#/components/schemas/Pet"); - Operation pingOperation = new Operation() - .responses( - new ApiResponses().addApiResponse("204", new ApiResponse() - .description("Ok response"))); - Operation createOperation = new Operation() - .requestBody(new RequestBody() - .content(new Content().addMediaType("application/json", - new MediaType().schema(refSchema)))) - .responses( - new ApiResponses().addApiResponse("201", new ApiResponse() - .description("Created response"))); - OpenAPI openAPI = new OpenAPI(); - openAPI.setComponents(new Components()); - openAPI.getComponents().addSchemas("Pet", new ObjectSchema()); - - final DefaultCodegen codegen = new DefaultCodegen(); - - Assert.assertFalse(codegen.hasBodyParameter(openAPI, pingOperation)); - Assert.assertTrue(codegen.hasBodyParameter(openAPI, createOperation)); - } - - @Test(expectedExceptions = RuntimeException.class) - public void testParameterEmptyDescription() { - DefaultCodegen codegen = new DefaultCodegen(); - - codegen.fromRequestBody(null, new HashSet<>(), null); - } - - @Test - public void testGetConsumesInfoAndGetProducesInfo() throws Exception { - final Schema refSchema = new Schema<>().$ref("#/components/schemas/Pet"); - OpenAPI openAPI = new OpenAPI(); - openAPI.setComponents(new Components()); - openAPI.getComponents().addSchemas("Pet", new ObjectSchema()); - openAPI.getComponents().addRequestBodies("MyRequestBody", new RequestBody() - .content(new Content().addMediaType("application/json", - new MediaType().schema(refSchema)))); - openAPI.getComponents().addResponses("MyResponse", new ApiResponse() - .description("Ok response") - .content(new Content().addMediaType("application/xml", - new MediaType().schema(refSchema)))); - - Operation createOperation = new Operation() - .requestBody(new RequestBody() - .content(new Content() - .addMediaType("application/json", new MediaType().schema(refSchema)) - .addMediaType("application/xml", new MediaType().schema(refSchema)) - )) - .responses( - new ApiResponses().addApiResponse("201", new ApiResponse() - .description("Created response"))); - Set createConsumesInfo = DefaultCodegen.getConsumesInfo(openAPI, createOperation); - Assert.assertEquals(createConsumesInfo.size(), 2); - Assert.assertTrue(createConsumesInfo.contains("application/json"), "contains 'application/json'"); - Assert.assertTrue(createConsumesInfo.contains("application/xml"), "contains 'application/xml'"); - Set createProducesInfo = DefaultCodegen.getProducesInfo(openAPI, createOperation); - Assert.assertEquals(createProducesInfo.size(), 0); - final DefaultCodegen codegen = new DefaultCodegen(); - codegen.setOpenAPI(openAPI); - CodegenOperation coCreate = codegen.fromOperation("somepath", "post", createOperation, null); - Assert.assertTrue(coCreate.hasConsumes); - Assert.assertEquals(coCreate.consumes.size(), 2); - Assert.assertFalse(coCreate.hasProduces); - - Operation updateOperationWithRef = new Operation() - .requestBody(new RequestBody().$ref("#/components/requestBodies/MyRequestBody")) - .responses(new ApiResponses().addApiResponse("201", new ApiResponse().$ref("#/components/responses/MyResponse"))); - Set updateConsumesInfo = DefaultCodegen.getConsumesInfo(openAPI, updateOperationWithRef); - Assert.assertEquals(updateConsumesInfo.size(), 1); - Assert.assertTrue(updateConsumesInfo.contains("application/json"), "contains 'application/json'"); - Set updateProducesInfo = DefaultCodegen.getProducesInfo(openAPI, updateOperationWithRef); - Assert.assertEquals(updateProducesInfo.size(), 1); - Assert.assertTrue(updateProducesInfo.contains("application/xml"), "contains 'application/xml'"); - - CodegenOperation coUpdate = codegen.fromOperation("somepath", "post", updateOperationWithRef, null); - Assert.assertTrue(coUpdate.hasConsumes); - Assert.assertEquals(coUpdate.consumes.size(), 1); - Assert.assertEquals(coUpdate.consumes.get(0).get("mediaType"), "application/json"); - Assert.assertTrue(coUpdate.hasProduces); - Assert.assertEquals(coUpdate.produces.size(), 1); - Assert.assertEquals(coUpdate.produces.get(0).get("mediaType"), "application/xml"); - } - - @Test - public void testGetProducesInfo() throws Exception { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/produces.yaml"); - final DefaultCodegen codegen = new DefaultCodegen(); - codegen.setOpenAPI(openAPI); - - Operation textOperation = openAPI.getPaths().get("/ping/text").getGet(); - CodegenOperation coText = codegen.fromOperation("/ping/text", "get", textOperation, null); - Assert.assertTrue(coText.hasProduces); - Assert.assertEquals(coText.produces.size(), 1); - Assert.assertEquals(coText.produces.get(0).get("mediaType"), "text/plain"); - - Operation jsonOperation = openAPI.getPaths().get("/ping/json").getGet(); - CodegenOperation coJson = codegen.fromOperation("/ping/json", "get", jsonOperation, null); - Assert.assertTrue(coJson.hasProduces); - Assert.assertEquals(coJson.produces.size(), 1); - Assert.assertEquals(coJson.produces.get(0).get("mediaType"), "application/json"); - - Operation issue443Operation = openAPI.getPaths().get("/other/issue443").getGet(); - CodegenOperation coIssue443 = codegen.fromOperation("/other/issue443", "get", issue443Operation, null); - Assert.assertTrue(coIssue443.hasProduces); - Assert.assertEquals(coIssue443.produces.size(), 2); - Assert.assertEquals(coIssue443.produces.get(0).get("mediaType"), "application/json"); - Assert.assertEquals(coIssue443.produces.get(1).get("mediaType"), "application/text"); - } - - @Test - public void testInitialConfigValues() throws Exception { - final DefaultCodegen codegen = new DefaultCodegen(); - codegen.processOpts(); - - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.TRUE); - Assert.assertTrue(codegen.isHideGenerationTimestamp()); - } - - @Test - public void testSettersForConfigValues() throws Exception { - final DefaultCodegen codegen = new DefaultCodegen(); - codegen.setHideGenerationTimestamp(false); - codegen.processOpts(); - - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.FALSE); - Assert.assertFalse(codegen.isHideGenerationTimestamp()); - } - - @Test - public void testAdditionalPropertiesPutForConfigValues() throws Exception { - final DefaultCodegen codegen = new DefaultCodegen(); - codegen.additionalProperties().put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, false); - codegen.processOpts(); - - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.FALSE); - Assert.assertFalse(codegen.isHideGenerationTimestamp()); - } - - @Test - public void testArraySchemaIsNotIncludedInAliases() throws Exception { - final DefaultCodegen codegen = new DefaultCodegen(); - Map schemas = new HashMap() { - { - put("ArraySchemaTest", new ArraySchema()); - } - - }; - - Map aliases = codegen.getAllAliases(schemas); - - Assert.assertEquals(aliases.size(), 0); - } - - @Test - public void testFormParameterHasDefaultValue() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml"); - final DefaultCodegen codegen = new DefaultCodegen(); - codegen.setOpenAPI(openAPI); - - Schema requestBodySchema = ModelUtils.getReferencedSchema(openAPI, - ModelUtils.getSchemaFromRequestBody(openAPI.getPaths().get("/fake").getGet().getRequestBody())); - CodegenParameter codegenParameter = codegen.fromFormProperty("enum_form_string", (Schema) requestBodySchema.getProperties().get("enum_form_string"), new HashSet()); - - Assert.assertEquals(codegenParameter.defaultValue, "-efg"); - Assert.assertEquals(codegenParameter.getSchema(), null); - } - - @Test - public void testDateTimeFormParameterHasDefaultValue() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/spring/date-time-parameter-types-for-testing.yml"); - final DefaultCodegen codegen = new DefaultCodegen(); - codegen.setOpenAPI(openAPI); - - Schema requestBodySchema = ModelUtils.getSchemaFromRequestBody(openAPI.getPaths().get("/thingy/{date}").getPost().getRequestBody()); - // dereference - requestBodySchema = ModelUtils.getReferencedSchema(openAPI, requestBodySchema); - CodegenParameter codegenParameter = codegen.fromFormProperty("visitDate", (Schema) requestBodySchema.getProperties().get("visitDate"), - new HashSet<>()); - - Assert.assertEquals(codegenParameter.defaultValue, "1971-12-19T03:39:57-08:00"); - Assert.assertEquals(codegenParameter.getSchema(), null); - } - - @Test - public void testOriginalOpenApiDocumentVersion() { - // Test with OAS 2.0 document. - String location = "src/test/resources/2_0/python-prior/petstore-with-fake-endpoints-models-for-testing.yaml"; - OpenAPI openAPI = TestUtils.parseFlattenSpec(location); - SemVer version = ModelUtils.getOpenApiVersion(openAPI, location, null); - Assert.assertEquals(version, new SemVer("2.0.0")); - - // Test with OAS 3.0 document. - location = "src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml"; - openAPI = TestUtils.parseFlattenSpec(location); - version = ModelUtils.getOpenApiVersion(openAPI, location, null); - Assert.assertEquals(version, new SemVer("3.0.0")); - } - - @Test - public void testAdditionalPropertiesV2SpecDisallowAdditionalPropertiesIfNotPresentTrue() { - // this is the legacy config that most of our tooling uses - OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/2_0/additional-properties-for-testing.yaml"); - DefaultCodegen codegen = new DefaultCodegen(); - codegen.setOpenAPI(openAPI); - codegen.setDisallowAdditionalPropertiesIfNotPresent(true); - - Schema schema = openAPI.getComponents().getSchemas().get("AdditionalPropertiesClass"); - Assert.assertNull(schema.getAdditionalProperties()); - - Schema addProps = ModelUtils.getAdditionalProperties(openAPI, schema); - // The petstore-with-fake-endpoints-models-for-testing.yaml does not set the - // 'additionalProperties' keyword for this model, hence assert the value to be null. - Assert.assertNull(addProps); - CodegenModel cm = codegen.fromModel("AdditionalPropertiesClass", schema); - Assert.assertNull(cm.getAdditionalProperties()); - // When the 'additionalProperties' keyword is not present, the model - // should allow undeclared properties. However, due to bug - // https://github.com/swagger-api/swagger-parser/issues/1369, the swagger - // converter does not retain the value of the additionalProperties. - - Map modelPropSchemas = schema.getProperties(); - Schema map_string_sc = modelPropSchemas.get("map_string"); - CodegenProperty map_string_cp = null; - Schema map_with_additional_properties_sc = modelPropSchemas.get("map_with_additional_properties"); - CodegenProperty map_with_additional_properties_cp = null; - Schema map_without_additional_properties_sc = modelPropSchemas.get("map_without_additional_properties"); - CodegenProperty map_without_additional_properties_cp = null; - - for (CodegenProperty cp : cm.vars) { - if ("map_string".equals(cp.baseName)) { - map_string_cp = cp; - } else if ("map_with_additional_properties".equals(cp.baseName)) { - map_with_additional_properties_cp = cp; - } else if ("map_without_additional_properties".equals(cp.baseName)) { - map_without_additional_properties_cp = cp; - } - } - - // map_string - // This property has the following inline schema. - // additionalProperties: - // type: string - Assert.assertNotNull(map_string_sc); - Assert.assertNotNull(map_string_sc.getAdditionalProperties()); - Assert.assertNotNull(map_string_cp.getAdditionalProperties()); - - // map_with_additional_properties - // This property has the following inline schema. - // additionalProperties: true - Assert.assertNotNull(map_with_additional_properties_sc); - // It is unfortunate that child.getAdditionalProperties() returns null for a V2 schema. - // We cannot differentiate between 'additionalProperties' not present and - // additionalProperties: true. - Assert.assertNull(map_with_additional_properties_sc.getAdditionalProperties()); - addProps = ModelUtils.getAdditionalProperties(openAPI, map_with_additional_properties_sc); - Assert.assertNull(addProps); - Assert.assertNull(map_with_additional_properties_cp.getAdditionalProperties()); - - // map_without_additional_properties - // This property has the following inline schema. - // additionalProperties: false - Assert.assertNotNull(map_without_additional_properties_sc); - // It is unfortunate that child.getAdditionalProperties() returns null for a V2 schema. - // We cannot differentiate between 'additionalProperties' not present and - // additionalProperties: false. - Assert.assertNull(map_without_additional_properties_sc.getAdditionalProperties()); - addProps = ModelUtils.getAdditionalProperties(openAPI, map_without_additional_properties_sc); - Assert.assertNull(addProps); - Assert.assertNull(map_without_additional_properties_cp.getAdditionalProperties()); - - // check of composed schema model - String schemaName = "Parent"; - schema = openAPI.getComponents().getSchemas().get(schemaName); - cm = codegen.fromModel(schemaName, schema); - Assert.assertNull(cm.getAdditionalProperties()); - } - - @Test - public void testAdditionalPropertiesV2SpecDisallowAdditionalPropertiesIfNotPresentFalse() { - OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/2_0/additional-properties-for-testing.yaml"); - DefaultCodegen codegen = new DefaultCodegen(); - codegen.setOpenAPI(openAPI); - codegen.setDisallowAdditionalPropertiesIfNotPresent(false); - codegen.supportsAdditionalPropertiesWithComposedSchema = true; - /* - When this DisallowAdditionalPropertiesIfNotPresent is false: - for CodegenModel/CodegenParameter/CodegenProperty/CodegenResponse.getAdditionalProperties - if the input additionalProperties is False or unset (null) - .getAdditionalProperties is set to AnyTypeSchema - - For the False value this is incorrect, but it is the best that we can do because of this bug: - https://github.com/swagger-api/swagger-parser/issues/1369 where swagger parser - sets both null/False additionalProperties to null - */ - - Schema schema = openAPI.getComponents().getSchemas().get("AdditionalPropertiesClass"); - Assert.assertNull(schema.getAdditionalProperties()); - - Schema addProps = ModelUtils.getAdditionalProperties(openAPI, schema); - // The petstore-with-fake-endpoints-models-for-testing.yaml does not set the - // 'additionalProperties' keyword for this model, hence assert the value to be null. - Assert.assertNull(addProps); - CodegenModel cm = codegen.fromModel("AdditionalPropertiesClass", schema); - Assert.assertNotNull(cm.getAdditionalProperties()); - // When the 'additionalProperties' keyword is not present, the model - // should allow undeclared properties. However, due to bug - // https://github.com/swagger-api/swagger-parser/issues/1369, the swagger - // converter does not retain the value of the additionalProperties. - - Map modelPropSchemas = schema.getProperties(); - Schema map_string_sc = modelPropSchemas.get("map_string"); - CodegenProperty map_string_cp = null; - Schema map_with_additional_properties_sc = modelPropSchemas.get("map_with_additional_properties"); - CodegenProperty map_with_additional_properties_cp = null; - Schema map_without_additional_properties_sc = modelPropSchemas.get("map_without_additional_properties"); - CodegenProperty map_without_additional_properties_cp = null; - - for (CodegenProperty cp : cm.vars) { - if ("map_string".equals(cp.baseName)) { - map_string_cp = cp; - } else if ("map_with_additional_properties".equals(cp.baseName)) { - map_with_additional_properties_cp = cp; - } else if ("map_without_additional_properties".equals(cp.baseName)) { - map_without_additional_properties_cp = cp; - } - } - - // map_string - // This property has the following inline schema. - // additionalProperties: - // type: string - Assert.assertNotNull(map_string_sc); - Assert.assertNotNull(map_string_sc.getAdditionalProperties()); - Assert.assertNotNull(map_string_cp.getAdditionalProperties()); - - // map_with_additional_properties - // This property has the following inline schema. - // additionalProperties: true - Assert.assertNotNull(map_with_additional_properties_sc); - // It is unfortunate that child.getAdditionalProperties() returns null for a V2 schema. - // We cannot differentiate between 'additionalProperties' not present and - // additionalProperties: true. - Assert.assertNull(map_with_additional_properties_sc.getAdditionalProperties()); - addProps = ModelUtils.getAdditionalProperties(openAPI, map_with_additional_properties_sc); - Assert.assertNull(addProps); - Assert.assertNotNull(map_with_additional_properties_cp.getAdditionalProperties()); - - // map_without_additional_properties - // This property has the following inline schema. - // additionalProperties: false - Assert.assertNotNull(map_without_additional_properties_sc); - // It is unfortunate that child.getAdditionalProperties() returns null for a V2 schema. - // We cannot differentiate between 'additionalProperties' not present and - // additionalProperties: false. - Assert.assertNull(map_without_additional_properties_sc.getAdditionalProperties()); - addProps = ModelUtils.getAdditionalProperties(openAPI, map_without_additional_properties_sc); - Assert.assertNull(addProps); - Assert.assertNotNull(map_without_additional_properties_cp.getAdditionalProperties()); - - // check of composed schema model - String schemaName = "Parent"; - schema = openAPI.getComponents().getSchemas().get(schemaName); - cm = codegen.fromModel(schemaName, schema); - Assert.assertNotNull(cm.getAdditionalProperties()); - } - - @Test - public void testAdditionalPropertiesV3SpecDisallowAdditionalPropertiesIfNotPresentFalse() { - OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml"); - DefaultCodegen codegen = new DefaultCodegen(); - codegen.setDisallowAdditionalPropertiesIfNotPresent(false); - codegen.supportsAdditionalPropertiesWithComposedSchema = true; - codegen.setOpenAPI(openAPI); - - Schema componentSchema = openAPI.getComponents().getSchemas().get("AdditionalPropertiesClass"); - Assert.assertNull(componentSchema.getAdditionalProperties()); - - // When the 'additionalProperties' keyword is not present, the schema may be - // extended with any undeclared properties. - Schema addProps = ModelUtils.getAdditionalProperties(openAPI, componentSchema); - Assert.assertNotNull(addProps); - Assert.assertEquals(addProps, new Schema()); - CodegenModel cm = codegen.fromModel("AdditionalPropertiesClass", componentSchema); - Assert.assertNotNull(cm.getAdditionalProperties()); - - Map modelPropSchemas = componentSchema.getProperties(); - Schema map_with_undeclared_properties_string_sc = modelPropSchemas.get("map_with_undeclared_properties_string"); - CodegenProperty map_with_undeclared_properties_string_cp = null; - Schema map_with_undeclared_properties_anytype_1_sc = modelPropSchemas.get("map_with_undeclared_properties_anytype_1"); - CodegenProperty map_with_undeclared_properties_anytype_1_cp = null; - Schema map_with_undeclared_properties_anytype_2_sc = modelPropSchemas.get("map_with_undeclared_properties_anytype_2"); - CodegenProperty map_with_undeclared_properties_anytype_2_cp = null; - Schema map_with_undeclared_properties_anytype_3_sc = modelPropSchemas.get("map_with_undeclared_properties_anytype_3"); - CodegenProperty map_with_undeclared_properties_anytype_3_cp = null; - Schema empty_map_sc = modelPropSchemas.get("empty_map"); - CodegenProperty empty_map_cp = null; - - for (CodegenProperty cp : cm.vars) { - if ("map_with_undeclared_properties_string".equals(cp.baseName)) { - map_with_undeclared_properties_string_cp = cp; - } else if ("map_with_undeclared_properties_anytype_1".equals(cp.baseName)) { - map_with_undeclared_properties_anytype_1_cp = cp; - } else if ("map_with_undeclared_properties_anytype_2".equals(cp.baseName)) { - map_with_undeclared_properties_anytype_2_cp = cp; - } else if ("map_with_undeclared_properties_anytype_3".equals(cp.baseName)) { - map_with_undeclared_properties_anytype_3_cp = cp; - } else if ("empty_map".equals(cp.baseName)) { - empty_map_cp = cp; - } - } - - // map_with_undeclared_properties_string - // This property has the following inline schema. - // additionalProperties: - // type: string - Assert.assertNotNull(map_with_undeclared_properties_string_sc); - Assert.assertNotNull(map_with_undeclared_properties_string_sc.getAdditionalProperties()); - Assert.assertNotNull(map_with_undeclared_properties_string_cp.getAdditionalProperties()); - - // map_with_undeclared_properties_anytype_1 - // This property does not use the additionalProperties keyword, - // which means by default undeclared properties are allowed. - Assert.assertNotNull(map_with_undeclared_properties_anytype_1_sc); - Assert.assertNull(map_with_undeclared_properties_anytype_1_sc.getAdditionalProperties()); - addProps = ModelUtils.getAdditionalProperties(openAPI, map_with_undeclared_properties_anytype_1_sc); - Assert.assertNotNull(addProps); - Assert.assertEquals(addProps, new Schema()); - Assert.assertNotNull(map_with_undeclared_properties_anytype_1_cp.getAdditionalProperties()); - - // map_with_undeclared_properties_anytype_2 - // This property does not use the additionalProperties keyword, - // which means by default undeclared properties are allowed. - Assert.assertNotNull(map_with_undeclared_properties_anytype_2_sc); - Assert.assertNull(map_with_undeclared_properties_anytype_2_sc.getAdditionalProperties()); - addProps = ModelUtils.getAdditionalProperties(openAPI, map_with_undeclared_properties_anytype_2_sc); - Assert.assertNotNull(addProps); - Assert.assertEquals(addProps, new Schema()); - Assert.assertNotNull(map_with_undeclared_properties_anytype_2_cp.getAdditionalProperties()); - - // map_with_undeclared_properties_anytype_3 - // This property has the following inline schema. - // additionalProperties: true - Assert.assertNotNull(map_with_undeclared_properties_anytype_3_sc); - // Unlike the V2 spec, in V3 we CAN differentiate between 'additionalProperties' not present and - // additionalProperties: true. - Assert.assertNotNull(map_with_undeclared_properties_anytype_3_sc.getAdditionalProperties()); - Assert.assertEquals(map_with_undeclared_properties_anytype_3_sc.getAdditionalProperties(), Boolean.TRUE); - addProps = ModelUtils.getAdditionalProperties(openAPI, map_with_undeclared_properties_anytype_3_sc); - Assert.assertNotNull(addProps); - Assert.assertEquals(addProps, new Schema()); - Assert.assertNotNull(map_with_undeclared_properties_anytype_3_cp.getAdditionalProperties()); - - // empty_map - // This property has the following inline schema. - // additionalProperties: false - Assert.assertNotNull(empty_map_sc); - // Unlike the V2 spec, in V3 we CAN differentiate between 'additionalProperties' not present and - // additionalProperties: false. - Assert.assertNotNull(empty_map_sc.getAdditionalProperties()); - Assert.assertEquals(empty_map_sc.getAdditionalProperties(), Boolean.FALSE); - addProps = ModelUtils.getAdditionalProperties(openAPI, empty_map_sc); - Assert.assertNull(addProps); - Assert.assertNull(empty_map_cp.getAdditionalProperties()); - - // check of composed schema model - String schemaName = "SomeObject"; - Schema schema = openAPI.getComponents().getSchemas().get(schemaName); - cm = codegen.fromModel(schemaName, schema); - Assert.assertNotNull(cm.getAdditionalProperties()); - } - - @Test - public void testAdditionalPropertiesV3SpecDisallowAdditionalPropertiesIfNotPresentTrue() { - // As per OAS spec, when the 'additionalProperties' keyword is not present, the schema may be - // extended with any undeclared properties. - // However, in legacy 'additionalProperties' mode, this is interpreted as - // 'no additional properties are allowed'. - OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml"); - DefaultCodegen codegen = new DefaultCodegen(); - codegen.setDisallowAdditionalPropertiesIfNotPresent(true); - codegen.setOpenAPI(openAPI); - - Schema schema = openAPI.getComponents().getSchemas().get("AdditionalPropertiesClass"); - Assert.assertNull(schema.getAdditionalProperties()); - - Schema addProps = ModelUtils.getAdditionalProperties(openAPI, schema); - Assert.assertNull(addProps); - } - - @Test - public void testEnsureNoDuplicateProduces() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/two-responses.yaml"); - final DefaultCodegen codegen = new DefaultCodegen(); - codegen.setOpenAPI(openAPI); - - Operation operation = openAPI.getPaths().get("/test").getGet(); - CodegenOperation co = codegen.fromOperation("/test", "get", operation, null); - - Assert.assertEquals(co.produces.size(), 1); - Assert.assertEquals(co.produces.get(0).get("mediaType"), "application/json"); - } - - @Test - public void testConsistentParameterNameAfterUniquenessRename() throws Exception { - OpenAPI openAPI = TestUtils.createOpenAPI(); - Operation operation = new Operation() - .operationId("opId") - .addParametersItem(new QueryParameter().name("myparam").schema(new StringSchema())) - .addParametersItem(new QueryParameter().name("myparam").schema(new StringSchema())) - .responses(new ApiResponses().addApiResponse("200", new ApiResponse().description("OK"))); - - DefaultCodegen codegen = new DefaultCodegen(); - codegen.setOpenAPI(openAPI); - CodegenOperation co = codegen.fromOperation("/some/path", "get", operation, null); - Assert.assertEquals(co.path, "/some/path"); - Assert.assertEquals(co.allParams.size(), 2); - List allParamsNames = co.allParams.stream().map(p -> p.paramName).collect(Collectors.toList()); - Assert.assertTrue(allParamsNames.contains("myparam")); - Assert.assertTrue(allParamsNames.contains("myparam2")); - List queryParamsNames = co.queryParams.stream().map(p -> p.paramName).collect(Collectors.toList()); - Assert.assertTrue(queryParamsNames.contains("myparam")); - Assert.assertTrue(queryParamsNames.contains("myparam2")); - } - - @Test - public void testUniquenessRenameOfFormParameters() throws Exception { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/form-duplicated-parameter.yaml"); - DefaultCodegen codegen = new DefaultCodegen(); - codegen.setOpenAPI(openAPI); - Operation operation = openAPI.getPaths().get("/form-param-poc/{id}").getPut(); - CodegenOperation co = codegen.fromOperation("/form-param-poc/{id}", "put", operation, null); - Assert.assertEquals(co.path, "/form-param-poc/{id}"); - Assert.assertEquals(co.allParams.size(), 2); - List allParamsNames = co.allParams.stream().map(p -> p.paramName).collect(Collectors.toList()); - Assert.assertTrue(allParamsNames.contains("id")); - Assert.assertTrue(allParamsNames.contains("id2")); - } - - @Test - public void testGetSchemaTypeWithComposedSchemaWithOneOf() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/composed-oneof.yaml"); - final DefaultCodegen codegen = new DefaultCodegen(); - - Operation operation = openAPI.getPaths().get("/state").getPost(); - Schema schema = ModelUtils.getReferencedSchema(openAPI, - ModelUtils.getSchemaFromRequestBody(operation.getRequestBody())); - String type = codegen.getSchemaType(schema); - - Assert.assertNotNull(type); - Assert.assertEquals(type, "oneOf"); - } - - @Test - public void testComposedSchemaOneOfWithProperties() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/oneOf.yaml"); - final DefaultCodegen codegen = new DefaultCodegen(); - - final Schema schema = openAPI.getComponents().getSchemas().get("fruit"); - codegen.setOpenAPI(openAPI); - CodegenModel fruit = codegen.fromModel("Fruit", schema); - - Set oneOf = new TreeSet(); - oneOf.add("Apple"); - oneOf.add("Banana"); - Assert.assertEquals(fruit.oneOf, oneOf); - Assert.assertEquals(fruit.optionalVars.size(), 3); - Assert.assertEquals(fruit.vars.size(), 3); - // make sure that fruit has the property color - boolean colorSeen = false; - for (CodegenProperty cp : fruit.vars) { - if ("color".equals(cp.name)) { - colorSeen = true; - break; - } - } - Assert.assertTrue(colorSeen); - colorSeen = false; - for (CodegenProperty cp : fruit.optionalVars) { - if ("color".equals(cp.name)) { - colorSeen = true; - break; - } - } - Assert.assertTrue(colorSeen); - } - - - @Test - public void testEscapeText() { - final DefaultCodegen codegen = new DefaultCodegen(); - - Assert.assertEquals(codegen.escapeText("\n"), " "); - Assert.assertEquals(codegen.escapeText("\r"), " "); - Assert.assertEquals(codegen.escapeText("\t"), " "); - Assert.assertEquals(codegen.escapeText("\\"), "\\\\"); - Assert.assertEquals(codegen.escapeText("\""), "\\\""); - Assert.assertEquals(codegen.escapeText("\\/"), "/"); - } - - @Test - public void testEscapeTextWhileAllowingNewLines() { - final DefaultCodegen codegen = new DefaultCodegen(); - - // allow new lines - Assert.assertEquals(codegen.escapeTextWhileAllowingNewLines("\n"), "\n"); - Assert.assertEquals(codegen.escapeTextWhileAllowingNewLines("\r"), "\r"); - - // escape other special characters - Assert.assertEquals(codegen.escapeTextWhileAllowingNewLines("\t"), " "); - Assert.assertEquals(codegen.escapeTextWhileAllowingNewLines("\\"), "\\\\"); - Assert.assertEquals(codegen.escapeTextWhileAllowingNewLines("\""), "\\\""); - Assert.assertEquals(codegen.escapeTextWhileAllowingNewLines("\\/"), "/"); - } - - @Test - public void updateCodegenPropertyEnum() { - final DefaultCodegen codegen = new DefaultCodegen(); - CodegenProperty array = codegenPropertyWithArrayOfIntegerValues(); - - codegen.updateCodegenPropertyEnum(array); - - List> enumVars = (List>) array.getItems().getAllowableValues().get("enumVars"); - Assert.assertNotNull(enumVars); - Map testedEnumVar = enumVars.get(0); - Assert.assertNotNull(testedEnumVar); - Assert.assertEquals(testedEnumVar.getOrDefault("name", ""), "_1"); - Assert.assertEquals(testedEnumVar.getOrDefault("value", ""), "\"1\""); - Assert.assertEquals(testedEnumVar.getOrDefault("isString", ""), false); - } - - @Test - public void updateCodegenPropertyEnumWithExtension() { - { - CodegenProperty enumProperty = codegenPropertyWithXEnumVarName(Arrays.asList("dog", "cat"), Arrays.asList("DOGVAR", "CATVAR")); - (new DefaultCodegen()).updateCodegenPropertyEnum(enumProperty); - List> enumVars = (List>) enumProperty.getAllowableValues().get("enumVars"); - Assert.assertNotNull(enumVars); - Assert.assertNotNull(enumVars.get(0)); - Assert.assertEquals(enumVars.get(0).getOrDefault("name", ""), "DOGVAR"); - Assert.assertEquals(enumVars.get(0).getOrDefault("value", ""), "\"dog\""); - Assert.assertNotNull(enumVars.get(1)); - Assert.assertEquals(enumVars.get(1).getOrDefault("name", ""), "CATVAR"); - Assert.assertEquals(enumVars.get(1).getOrDefault("value", ""), "\"cat\""); - } - { - CodegenProperty enumProperty = codegenPropertyWithXEnumVarName(Arrays.asList("1", "2"), Arrays.asList("ONE", "TWO")); - (new DefaultCodegen()).updateCodegenPropertyEnum(enumProperty); - List> enumVars = (List>) enumProperty.getAllowableValues().get("enumVars"); - Assert.assertEquals(enumVars.get(0).getOrDefault("name", ""), "ONE"); - Assert.assertEquals(enumVars.get(0).getOrDefault("value", ""), "\"1\""); - Assert.assertEquals(enumVars.get(1).getOrDefault("name", ""), "TWO"); - Assert.assertEquals(enumVars.get(1).getOrDefault("value", ""), "\"2\""); - } - { - CodegenProperty enumProperty = codegenPropertyWithXEnumVarName(Arrays.asList("a", "b", "c", "d"), Arrays.asList("FOO", "BAR")); - (new DefaultCodegen()).updateCodegenPropertyEnum(enumProperty); - List> enumVars = (List>) enumProperty.getAllowableValues().get("enumVars"); - Assert.assertEquals(enumVars.get(0).getOrDefault("name", ""), "FOO"); - Assert.assertEquals(enumVars.get(1).getOrDefault("name", ""), "BAR"); - Assert.assertEquals(enumVars.get(2).getOrDefault("name", ""), "C"); - Assert.assertEquals(enumVars.get(3).getOrDefault("name", ""), "D"); - } - { - CodegenProperty enumProperty = codegenPropertyWithXEnumVarName(Arrays.asList("a", "b"), Arrays.asList("FOO", "BAR", "BAZ")); - (new DefaultCodegen()).updateCodegenPropertyEnum(enumProperty); - List> enumVars = (List>) enumProperty.getAllowableValues().get("enumVars"); - Assert.assertEquals(enumVars.get(0).getOrDefault("name", ""), "FOO"); - Assert.assertEquals(enumVars.get(1).getOrDefault("name", ""), "BAR"); - Assert.assertEquals(enumVars.size(), 2); - } - } - - @Test - public void updateCodegenPropertyEnumWithPrefixRemoved() { - final DefaultCodegen codegen = new DefaultCodegen(); - CodegenProperty enumProperty = codegenProperty(Arrays.asList("animal_dog", "animal_cat")); - - codegen.updateCodegenPropertyEnum(enumProperty); - - List> enumVars = (List>) enumProperty.getItems().getAllowableValues().get("enumVars"); - Assert.assertNotNull(enumVars); - Assert.assertNotNull(enumVars.get(0)); - Assert.assertEquals(enumVars.get(0).getOrDefault("name", ""), "DOG"); - Assert.assertEquals(enumVars.get(0).getOrDefault("value", ""), "\"animal_dog\""); - Assert.assertNotNull(enumVars.get(1)); - Assert.assertEquals(enumVars.get(1).getOrDefault("name", ""), "CAT"); - Assert.assertEquals(enumVars.get(1).getOrDefault("value", ""), "\"animal_cat\""); - } - - @Test - public void updateCodegenPropertyEnumWithoutPrefixRemoved() { - final DefaultCodegen codegen = new DefaultCodegen(); - codegen.setRemoveEnumValuePrefix(false); - - CodegenProperty enumProperty = codegenProperty(Arrays.asList("animal_dog", "animal_cat")); - - codegen.updateCodegenPropertyEnum(enumProperty); - - List> enumVars = (List>) enumProperty.getItems().getAllowableValues().get("enumVars"); - Assert.assertNotNull(enumVars); - Assert.assertNotNull(enumVars.get(0)); - Assert.assertEquals(enumVars.get(0).getOrDefault("name", ""), "ANIMAL_DOG"); - Assert.assertEquals(enumVars.get(0).getOrDefault("value", ""), "\"animal_dog\""); - Assert.assertNotNull(enumVars.get(1)); - Assert.assertEquals(enumVars.get(1).getOrDefault("name", ""), "ANIMAL_CAT"); - Assert.assertEquals(enumVars.get(1).getOrDefault("value", ""), "\"animal_cat\""); - } - - @Test - public void postProcessModelsEnumWithPrefixRemoved() { - final DefaultCodegen codegen = new DefaultCodegen(); - ModelsMap objs = codegenModel(Arrays.asList("animal_dog", "animal_cat")); - CodegenModel cm = objs.getModels().get(0).getModel(); - - codegen.postProcessModelsEnum(objs); - - List> enumVars = (List>) cm.getAllowableValues().get("enumVars"); - Assert.assertNotNull(enumVars); - Assert.assertNotNull(enumVars.get(0)); - Assert.assertEquals(enumVars.get(0).getOrDefault("name", ""), "DOG"); - Assert.assertEquals(enumVars.get(0).getOrDefault("value", ""), "\"animal_dog\""); - Assert.assertNotNull(enumVars.get(1)); - Assert.assertEquals(enumVars.get(1).getOrDefault("name", ""), "CAT"); - Assert.assertEquals(enumVars.get(1).getOrDefault("value", ""), "\"animal_cat\""); - } - - @Test - public void postProcessModelsEnumWithoutPrefixRemoved() { - final DefaultCodegen codegen = new DefaultCodegen(); - codegen.setRemoveEnumValuePrefix(false); - ModelsMap objs = codegenModel(Arrays.asList("animal_dog", "animal_cat")); - CodegenModel cm = objs.getModels().get(0).getModel(); - - codegen.postProcessModelsEnum(objs); - - List> enumVars = (List>) cm.getAllowableValues().get("enumVars"); - Assert.assertNotNull(enumVars); - Assert.assertNotNull(enumVars.get(0)); - Assert.assertEquals(enumVars.get(0).getOrDefault("name", ""), "ANIMAL_DOG"); - Assert.assertEquals(enumVars.get(0).getOrDefault("value", ""), "\"animal_dog\""); - Assert.assertNotNull(enumVars.get(1)); - Assert.assertEquals(enumVars.get(1).getOrDefault("name", ""), "ANIMAL_CAT"); - Assert.assertEquals(enumVars.get(1).getOrDefault("value", ""), "\"animal_cat\""); - } - - @Test - public void postProcessModelsEnumWithExtension() { - final DefaultCodegen codegen = new DefaultCodegen(); - ModelsMap objs = codegenModelWithXEnumVarName(); - CodegenModel cm = objs.getModels().get(0).getModel(); - - codegen.postProcessModelsEnum(objs); - - List> enumVars = (List>) cm.getAllowableValues().get("enumVars"); - Assert.assertNotNull(enumVars); - Assert.assertNotNull(enumVars.get(0)); - Assert.assertEquals(enumVars.get(0).getOrDefault("name", ""), "DOGVAR"); - Assert.assertEquals(enumVars.get(0).getOrDefault("value", ""), "\"dog\""); - Assert.assertEquals(enumVars.get(0).getOrDefault("enumDescription", ""), "This is a dog"); - Assert.assertNotNull(enumVars.get(1)); - Assert.assertEquals(enumVars.get(1).getOrDefault("name", ""), "CATVAR"); - Assert.assertEquals(enumVars.get(1).getOrDefault("value", ""), "\"cat\""); - Assert.assertEquals(enumVars.get(1).getOrDefault("enumDescription", ""), "This is a cat"); - } - - @Test - public void testExample1() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/examples.yaml"); - final DefaultCodegen codegen = new DefaultCodegen(); - - Operation operation = openAPI.getPaths().get("/example1/singular").getGet(); - CodegenParameter codegenParameter = CodegenModelFactory.newInstance(CodegenModelType.PARAMETER); - codegen.setParameterExampleValue(codegenParameter, operation.getParameters().get(0)); - - Assert.assertEquals(codegenParameter.example, "example1 value"); - - Operation operation2 = openAPI.getPaths().get("/example1/plural").getGet(); - CodegenParameter codegenParameter2 = CodegenModelFactory.newInstance(CodegenModelType.PARAMETER); - codegen.setParameterExampleValue(codegenParameter2, operation2.getParameters().get(0)); - - Assert.assertEquals(codegenParameter2.example, "An example1 value"); - } - - @Test - public void testExample2() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/examples.yaml"); - final DefaultCodegen codegen = new DefaultCodegen(); - - Operation operation = openAPI.getPaths().get("/example2/singular").getGet(); - CodegenParameter codegenParameter = CodegenModelFactory.newInstance(CodegenModelType.PARAMETER); - codegen.setParameterExampleValue(codegenParameter, operation.getParameters().get(0)); - - Assert.assertEquals(codegenParameter.example, "example2 value"); - } - - @Test - public void testExample3() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/examples.yaml"); - final DefaultCodegen codegen = new DefaultCodegen(); - - Operation operation = openAPI.getPaths().get("/example3/singular").getGet(); - CodegenParameter codegenParameter = CodegenModelFactory.newInstance(CodegenModelType.PARAMETER); - codegen.setParameterExampleValue(codegenParameter, operation.getParameters().get(0)); - - Assert.assertEquals(codegenParameter.example, "example3: parameter value"); - - Operation operation2 = openAPI.getPaths().get("/example3/plural").getGet(); - CodegenParameter codegenParameter2 = CodegenModelFactory.newInstance(CodegenModelType.PARAMETER); - codegen.setParameterExampleValue(codegenParameter2, operation2.getParameters().get(0)); - - Assert.assertEquals(codegenParameter2.example, "An example3 value"); - } - - @Test - public void testExample4() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/examples.yaml"); - final DefaultCodegen codegen = new DefaultCodegen(); - - Operation operation = openAPI.getPaths().get("/example4/singular").getPost(); - CodegenParameter codegenParameter = CodegenModelFactory.newInstance(CodegenModelType.PARAMETER); - codegen.setParameterExampleValue(codegenParameter, operation.getRequestBody()); - - Assert.assertEquals(codegenParameter.example, "example4 value"); - - Operation operation2 = openAPI.getPaths().get("/example4/plural").getPost(); - CodegenParameter codegenParameter2 = CodegenModelFactory.newInstance(CodegenModelType.PARAMETER); - codegen.setParameterExampleValue(codegenParameter2, operation2.getRequestBody()); - - Assert.assertEquals(codegenParameter2.example, "An example4 value"); - } - - @Test - public void testDiscriminator() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml"); - DefaultCodegen codegen = new DefaultCodegen(); - - Schema animal = openAPI.getComponents().getSchemas().get("Animal"); - codegen.setOpenAPI(openAPI); - CodegenModel animalModel = codegen.fromModel("Animal", animal); - CodegenDiscriminator discriminator = animalModel.getDiscriminator(); - CodegenDiscriminator test = new CodegenDiscriminator(); - test.setPropertyName("className"); - test.setPropertyBaseName("className"); - test.getMappedModels().add(new CodegenDiscriminator.MappedModel("Dog", "Dog")); - test.getMappedModels().add(new CodegenDiscriminator.MappedModel("Cat", "Cat")); - test.getMappedModels().add(new CodegenDiscriminator.MappedModel("BigCat", "BigCat")); - Assert.assertEquals(discriminator, test); - Assert.assertEquals(animalModel.getHasDiscriminatorWithNonEmptyMapping(), true); - } - - @Test - public void testDiscriminatorWithCustomMapping() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/allOf.yaml"); - DefaultCodegen codegen = new DefaultCodegen(); - codegen.setLegacyDiscriminatorBehavior(false); - codegen.setOpenAPI(openAPI); - - String path = "/person/display/{personId}"; - Operation operation = openAPI.getPaths().get(path).getGet(); - CodegenOperation codegenOperation = codegen.fromOperation(path, "GET", operation, null); - verifyPersonDiscriminator(codegenOperation.discriminator); - - Schema person = openAPI.getComponents().getSchemas().get("Person"); - codegen.setOpenAPI(openAPI); - CodegenModel personModel = codegen.fromModel("Person", person); - verifyPersonDiscriminator(personModel.discriminator); - Assert.assertEquals(personModel.getHasDiscriminatorWithNonEmptyMapping(), true); - } - - @Test - public void testParentName() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/allOf.yaml"); - DefaultCodegen codegen = new DefaultCodegen(); - - Schema child = openAPI.getComponents().getSchemas().get("Child"); - codegen.setOpenAPI(openAPI); - CodegenModel childModel = codegen.fromModel("Child", child); - Assert.assertEquals(childModel.parentSchema, "Person"); - Assert.assertEquals(childModel.getHasDiscriminatorWithNonEmptyMapping(), false); - } - - @Test - public void testAllOfRequired() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/allOf-required.yaml"); - DefaultCodegen codegen = new DefaultCodegen(); - - Schema child = openAPI.getComponents().getSchemas().get("clubForCreation"); - codegen.setOpenAPI(openAPI); - CodegenModel childModel = codegen.fromModel("clubForCreation", child); - Assert.assertEquals(getRequiredVars(childModel), Collections.singletonList("name")); - } - - @Test - public void testAllOfSingleAndDoubleRefWithOwnPropsNoDiscriminator() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/allOf_composition.yaml"); - final DefaultCodegen codegen = new CodegenWithMultipleInheritance(); - - codegen.setOpenAPI(openAPI); - - // to test allOf with double refs - Schema supermanSchema = openAPI.getComponents().getSchemas().get("SuperMan"); - CodegenModel supermanModel = codegen.fromModel("SuperMan", supermanSchema); - Assert.assertNull(supermanModel.parent); - Assert.assertEquals(supermanModel.allParents, null); - - // to test allOf with single ref - Schema superboySchema = openAPI.getComponents().getSchemas().get("SuperBoy"); - CodegenModel superboyModel = codegen.fromModel("SuperBoy", superboySchema); - Assert.assertNull(superboyModel.parent); - Assert.assertEquals(superboyModel.allParents, null); - - // to test allOf with single ref and no "type: object" in the (last) inline schema - Schema superbabySchema = openAPI.getComponents().getSchemas().get("SuperBaby"); - CodegenModel superbabyModel = codegen.fromModel("SuperBaby", superbabySchema); - Assert.assertNull(superbabyModel.parent); - Assert.assertEquals(superbabyModel.allParents, null); - } - - @Test - public void testAllParents() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/allOfMappingDuplicatedProperties.yaml"); - final DefaultCodegen codegen = new CodegenWithMultipleInheritance(); - - codegen.setOpenAPI(openAPI); - - Schema adultSchema = openAPI.getComponents().getSchemas().get("Adult"); - CodegenModel adultModel = codegen.fromModel("Adult", adultSchema); - Assert.assertEquals(adultModel.parent, "Person"); - Assert.assertEquals(adultModel.allParents, Collections.singletonList("Person")); - } - - @Test - public void testComposedSchemaAllOfDiscriminatorMap() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/allOf_composition_discriminator.yaml"); - DefaultCodegen codegen = new DefaultCodegen(); - codegen.setOpenAPI(openAPI); - codegen.setLegacyDiscriminatorBehavior(false); - Schema sc; - String modelName; - - String propertyName = "petType"; - String propertyBaseName = propertyName; - CodegenDiscriminator emptyMapDisc = new CodegenDiscriminator(); - emptyMapDisc.setPropertyName(propertyName); - emptyMapDisc.setPropertyBaseName(propertyBaseName); - - // all leaf Schemas have discriminators with PropertyName/BaseName + empty discriminator maps - List leafModelNames = Arrays.asList("Cat", "Dog", "Lizard", "Snake"); - for (String leafModelName : leafModelNames) { - Schema leafSc = openAPI.getComponents().getSchemas().get(leafModelName); - CodegenModel leafCm = codegen.fromModel(leafModelName, leafSc); - Assert.assertEquals(leafCm.discriminator, emptyMapDisc); - Assert.assertEquals(leafCm.getHasDiscriminatorWithNonEmptyMapping(), false); - } - - // the Pet discriminator map contains all animals + Reptile (children + grandchildren) - CodegenDiscriminator petDisc = new CodegenDiscriminator(); - petDisc.setPropertyName(propertyName); - petDisc.setPropertyBaseName(propertyBaseName); - java.util.LinkedHashSet hs = new LinkedHashSet<>(); - for (String leafModelName : leafModelNames) { - hs.add(new CodegenDiscriminator.MappedModel(leafModelName, codegen.toModelName(leafModelName))); - } - hs.add(new CodegenDiscriminator.MappedModel("Reptile", codegen.toModelName("Reptile"))); - petDisc.setMappedModels(hs); - modelName = "Pet"; - sc = openAPI.getComponents().getSchemas().get(modelName); - CodegenModel pet = codegen.fromModel(modelName, sc); - Assert.assertEquals(pet.getHasDiscriminatorWithNonEmptyMapping(), true); - Assert.assertEquals(pet.discriminator, petDisc); - - // the Reptile discriminator contains both reptiles - List reptileModelNames = Arrays.asList("Lizard", "Snake"); - CodegenDiscriminator reptileDisc = new CodegenDiscriminator(); - reptileDisc.setPropertyName(propertyName); - reptileDisc.setPropertyBaseName(propertyBaseName); - hs.clear(); - for (String reptileModelName : reptileModelNames) { - hs.add(new CodegenDiscriminator.MappedModel(reptileModelName, codegen.toModelName(reptileModelName))); - } - reptileDisc.setMappedModels(hs); - modelName = "Reptile"; - sc = openAPI.getComponents().getSchemas().get(modelName); - CodegenModel reptile = codegen.fromModel(modelName, sc); - Assert.assertEquals(reptile.getHasDiscriminatorWithNonEmptyMapping(), true); - Assert.assertEquals(reptile.discriminator, reptileDisc); - - // the MyPets discriminator contains Cat and Lizard - List myPetNames = Arrays.asList("Cat", "Lizard"); - CodegenDiscriminator myPetDisc = new CodegenDiscriminator(); - myPetDisc.setPropertyName(propertyName); - myPetDisc.setPropertyBaseName(propertyBaseName); - hs.clear(); - for (String myPetName : myPetNames) { - hs.add(new CodegenDiscriminator.MappedModel(myPetName, codegen.toModelName(myPetName))); - } - myPetDisc.setMappedModels(hs); - modelName = "MyPets"; - sc = openAPI.getComponents().getSchemas().get(modelName); - CodegenModel myPets = codegen.fromModel(modelName, sc); - Assert.assertEquals(myPets.getHasDiscriminatorWithNonEmptyMapping(), true); - Assert.assertEquals(myPets.discriminator, myPetDisc); - - // the MyPetsNoDisc discriminator is created because all oneOf classes have the same discriminator - modelName = "MyPetsNoDisc"; - sc = openAPI.getComponents().getSchemas().get(modelName); - CodegenModel myPetsNoDisc = codegen.fromModel(modelName, sc); - Assert.assertEquals(myPetsNoDisc.getHasDiscriminatorWithNonEmptyMapping(), true); - Assert.assertEquals(myPetsNoDisc.discriminator, myPetDisc); - - CodegenModel cm; - - // the mapping in b is in A - modelName = "A"; - sc = openAPI.getComponents().getSchemas().get(modelName); - cm = codegen.fromModel(modelName, sc); - hs.clear(); - hs.add(new CodegenDiscriminator.MappedModel("b", codegen.toModelName("B"))); - hs.add(new CodegenDiscriminator.MappedModel("B", codegen.toModelName("B"))); - hs.add(new CodegenDiscriminator.MappedModel("C", codegen.toModelName("C"))); - Assert.assertEquals(cm.getHasDiscriminatorWithNonEmptyMapping(), true); - Assert.assertEquals(cm.discriminator.getMappedModels(), hs); - - // the mapping in b is in B - modelName = "B"; - sc = openAPI.getComponents().getSchemas().get(modelName); - cm = codegen.fromModel(modelName, sc); - hs.clear(); - hs.add(new CodegenDiscriminator.MappedModel("b", codegen.toModelName("B"))); - hs.add(new CodegenDiscriminator.MappedModel("C", codegen.toModelName("C"))); - Assert.assertEquals(cm.getHasDiscriminatorWithNonEmptyMapping(), true); - Assert.assertEquals(cm.discriminator.getMappedModels(), hs); - - // the mapping in b is in C - modelName = "C"; - sc = openAPI.getComponents().getSchemas().get(modelName); - cm = codegen.fromModel(modelName, sc); - hs.clear(); - hs.add(new CodegenDiscriminator.MappedModel("b", codegen.toModelName("B"))); - Assert.assertEquals(cm.getHasDiscriminatorWithNonEmptyMapping(), true); - Assert.assertEquals(cm.discriminator.getMappedModels(), hs); - } - - @Test - public void testComposedSchemaAllOfDiscriminatorMapLegacy() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/allOf_composition_discriminator.yaml"); - DefaultCodegen codegen = new DefaultCodegen(); - // codegen.legacyDiscriminatorBehavior remains false in the legacy use case - codegen.setOpenAPI(openAPI); - Schema sc; - String modelName; - - String propertyName = "petType"; - String propertyBaseName = propertyName; - CodegenDiscriminator emptyMapDisc = new CodegenDiscriminator(); - emptyMapDisc.setPropertyName(propertyName); - emptyMapDisc.setPropertyBaseName(propertyBaseName); - - // all leaf Schemas have discriminators with PropertyName/BaseName + empty discriminator maps - List leafModelNames = Arrays.asList("Cat", "Dog", "Lizard", "Snake"); - for (String leafModelName : leafModelNames) { - Schema leafSc = openAPI.getComponents().getSchemas().get(leafModelName); - CodegenModel leafCm = codegen.fromModel(leafModelName, leafSc); - Assert.assertNull(leafCm.discriminator); - } - - // the Pet discriminator map contains all animals + Reptile (children + grandchildren) - CodegenDiscriminator petDisc = new CodegenDiscriminator(); - petDisc.setPropertyName(propertyName); - petDisc.setPropertyBaseName(propertyBaseName); - java.util.LinkedHashSet hs = new LinkedHashSet<>(); - for (String leafModelName : leafModelNames) { - hs.add(new CodegenDiscriminator.MappedModel(leafModelName, codegen.toModelName(leafModelName))); - } - hs.add(new CodegenDiscriminator.MappedModel("Reptile", codegen.toModelName("Reptile"))); - petDisc.setMappedModels(hs); - modelName = "Pet"; - sc = openAPI.getComponents().getSchemas().get(modelName); - CodegenModel pet = codegen.fromModel(modelName, sc); - Assert.assertEquals(pet.discriminator, petDisc); - - // the Reptile discriminator contains both reptiles - List reptileModelNames = Arrays.asList("Lizard", "Snake"); - CodegenDiscriminator reptileDisc = new CodegenDiscriminator(); - reptileDisc.setPropertyName(propertyName); - reptileDisc.setPropertyBaseName(propertyBaseName); - hs.clear(); - for (String reptileModelName : reptileModelNames) { - hs.add(new CodegenDiscriminator.MappedModel(reptileModelName, codegen.toModelName(reptileModelName))); - } - reptileDisc.setMappedModels(hs); - modelName = "Reptile"; - sc = openAPI.getComponents().getSchemas().get(modelName); - CodegenModel reptile = codegen.fromModel(modelName, sc); - Assert.assertNull(reptile.discriminator); - - // the MyPets discriminator contains Cat and Lizard - CodegenDiscriminator myPetDisc = new CodegenDiscriminator(); - myPetDisc.setPropertyName(propertyName); - myPetDisc.setPropertyBaseName(propertyBaseName); - hs.clear(); - modelName = "MyPets"; - sc = openAPI.getComponents().getSchemas().get(modelName); - CodegenModel myPets = codegen.fromModel(modelName, sc); - Assert.assertEquals(myPets.discriminator, myPetDisc); - - // the MyPetsNoDisc discriminator is created because all oneOf classes have the same discriminator - modelName = "MyPetsNoDisc"; - sc = openAPI.getComponents().getSchemas().get(modelName); - CodegenModel myPetsNoDisc = codegen.fromModel(modelName, sc); - Assert.assertNull(myPetsNoDisc.discriminator); - - CodegenModel cm; - - // the mapping in b is in A - modelName = "A"; - sc = openAPI.getComponents().getSchemas().get(modelName); - cm = codegen.fromModel(modelName, sc); - hs.clear(); - hs.add(new CodegenDiscriminator.MappedModel("b", codegen.toModelName("B"))); - Assert.assertEquals(cm.discriminator.getMappedModels(), hs); - - // the mapping in b is in B - modelName = "B"; - sc = openAPI.getComponents().getSchemas().get(modelName); - cm = codegen.fromModel(modelName, sc); - Assert.assertNull(cm.discriminator); - - // the mapping in b is in C - modelName = "C"; - sc = openAPI.getComponents().getSchemas().get(modelName); - cm = codegen.fromModel(modelName, sc); - Assert.assertNull(cm.discriminator); - } - - @Test - public void testComposedSchemaOneOfDiscriminatorsInvalid() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/oneOfDiscriminator.yaml"); - DefaultCodegen codegen = new DefaultCodegen(); - codegen.setLegacyDiscriminatorBehavior(false); - codegen.setOpenAPI(openAPI); - - HashMap hm = new HashMap<>(); - hm.put("ComposedDiscMissingNoProperties", "'ComposedDiscMissingNoProperties' defines discriminator 'fruitType', but the referenced schema 'DiscMissingNoProperties' is incorrect. fruitType is missing from the schema, define it as required and type string"); - hm.put("ComposedDiscMissingFromProperties", "'ComposedDiscMissingFromProperties' defines discriminator 'fruitType', but the referenced schema 'DiscMissingFromProperties' is incorrect. fruitType is missing from the schema, define it as required and type string"); - hm.put("ComposedDiscOptionalTypeCorrect", "'ComposedDiscOptionalTypeCorrect' defines discriminator 'fruitType', but the referenced schema 'DiscOptionalTypeCorrect' is incorrect. invalid optional definition of fruitType, include it in required"); - hm.put("ComposedDiscOptionalTypeIncorrect", "'ComposedDiscOptionalTypeIncorrect' defines discriminator 'fruitType', but the referenced schema 'DiscOptionalTypeIncorrect' is incorrect. invalid type for fruitType, set it to string. invalid optional definition of fruitType, include it in required"); - hm.put("ComposedDiscOptionalTypeInconsistent", "'ComposedDiscOptionalTypeInconsistent' defines discriminator 'fruitType', but the referenced schema 'DiscOptionalTypeIncorrect' is incorrect. invalid type for fruitType, set it to string. invalid optional definition of fruitType, include it in required"); - hm.put("ComposedDiscTypeIncorrect", "'ComposedDiscTypeIncorrect' defines discriminator 'fruitType', but the referenced schema 'DiscTypeIncorrect' is incorrect. invalid type for fruitType, set it to string"); - hm.put("ComposedDiscTypeInconsistent", "'ComposedDiscTypeInconsistent' defines discriminator 'fruitType', but the referenced schema 'DiscTypeIncorrect' is incorrect. invalid type for fruitType, set it to string"); - hm.put("ComposedDiscRequiredInconsistent", "'ComposedDiscRequiredInconsistent' defines discriminator 'fruitType', but the referenced schema 'DiscOptionalTypeCorrect' is incorrect. invalid optional definition of fruitType, include it in required"); - - for (Map.Entry entry : hm.entrySet()) { - String modelName = entry.getKey(); - String errorMessageExpected = entry.getValue(); - - Schema sc = openAPI.getComponents().getSchemas().get(modelName); - - /* - // comment out below as we're now showing warnings instead of throwing exceptions - try { - codegen.fromModel(modelName, sc); - Assert.assertTrue(false, "A RuntimeException should have been thrown when processing "+modelName+ " but it was not"); - } catch (RuntimeException re) { - Assert.assertEquals(re.getMessage(), errorMessageExpected); - } - */ - } - } - - @Test - public void testComposedSchemaAnyOfDiscriminatorsInvalid() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/anyOfDiscriminator.yaml"); - DefaultCodegen codegen = new DefaultCodegen(); - codegen.setLegacyDiscriminatorBehavior(false); - codegen.setOpenAPI(openAPI); - - HashMap hm = new HashMap<>(); - hm.put("ComposedDiscMissingNoProperties", "'ComposedDiscMissingNoProperties' defines discriminator 'fruitType', but the referenced schema 'DiscMissingNoProperties' is incorrect. fruitType is missing from the schema, define it as required and type string"); - hm.put("ComposedDiscMissingFromProperties", "'ComposedDiscMissingFromProperties' defines discriminator 'fruitType', but the referenced schema 'DiscMissingFromProperties' is incorrect. fruitType is missing from the schema, define it as required and type string"); - hm.put("ComposedDiscOptionalTypeCorrect", "'ComposedDiscOptionalTypeCorrect' defines discriminator 'fruitType', but the referenced schema 'DiscOptionalTypeCorrect' is incorrect. invalid optional definition of fruitType, include it in required"); - hm.put("ComposedDiscOptionalTypeIncorrect", "'ComposedDiscOptionalTypeIncorrect' defines discriminator 'fruitType', but the referenced schema 'DiscOptionalTypeIncorrect' is incorrect. invalid type for fruitType, set it to string. invalid optional definition of fruitType, include it in required"); - hm.put("ComposedDiscOptionalTypeInconsistent", "'ComposedDiscOptionalTypeInconsistent' defines discriminator 'fruitType', but the referenced schema 'DiscOptionalTypeIncorrect' is incorrect. invalid type for fruitType, set it to string. invalid optional definition of fruitType, include it in required"); - hm.put("ComposedDiscTypeIncorrect", "'ComposedDiscTypeIncorrect' defines discriminator 'fruitType', but the referenced schema 'DiscTypeIncorrect' is incorrect. invalid type for fruitType, set it to string"); - hm.put("ComposedDiscTypeInconsistent", "'ComposedDiscTypeInconsistent' defines discriminator 'fruitType', but the referenced schema 'DiscTypeIncorrect' is incorrect. invalid type for fruitType, set it to string"); - hm.put("ComposedDiscRequiredInconsistent", "'ComposedDiscRequiredInconsistent' defines discriminator 'fruitType', but the referenced schema 'DiscOptionalTypeCorrect' is incorrect. invalid optional definition of fruitType, include it in required"); - - for (Map.Entry entry : hm.entrySet()) { - String modelName = entry.getKey(); - String errorMessageExpected = entry.getValue(); - - Schema sc = openAPI.getComponents().getSchemas().get(modelName); - - /* - // comment out below as we're now showing warnings instead of throwing exceptions - try { - codegen.fromModel(modelName, sc); - Assert.assertTrue(false, "A RuntimeException should have been thrown when processing "+modelName+ " but it was not"); - } catch (RuntimeException re) { - Assert.assertEquals(re.getMessage(), errorMessageExpected); - } - */ - } - } - - @Test - public void testComposedSchemaAnyOfDiscriminatorMap() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/anyOfDiscriminator.yaml"); - DefaultCodegen codegen = new DefaultCodegen(); - codegen.setLegacyDiscriminatorBehavior(false); - codegen.setOpenAPI(openAPI); - - String modelName; - Schema sc; - CodegenModel cm; - java.util.LinkedHashSet hs; - String mn; - - // inline anyOf models work because the inline schemas are turned into $refs - modelName = "FruitInlineDisc"; - sc = openAPI.getComponents().getSchemas().get(modelName); - cm = codegen.fromModel(modelName, sc); - hs = new java.util.LinkedHashSet(); - mn = "FruitInlineDisc_anyOf"; - hs.add(new CodegenDiscriminator.MappedModel(mn, codegen.toModelName(mn))); - mn = "FruitInlineDisc_anyOf_1"; - hs.add(new CodegenDiscriminator.MappedModel(mn, codegen.toModelName(mn))); - Assert.assertEquals(cm.discriminator.getMappedModels(), hs); - - // inline anyOf with inline anyOf model doesn't work because we have null $refs and we throw an exception - final String fmodelName = "FruitInlineInlineDisc"; - final Schema fsc = openAPI.getComponents().getSchemas().get(fmodelName); - // comment out below as we're now showing warnings instead of throwing exceptions - //Assert.assertThrows(() -> codegen.fromModel(fmodelName, fsc)); - - // ref anyOf models with discriminator in properties in those models - modelName = "FruitReqDisc"; - sc = openAPI.getComponents().getSchemas().get(modelName); - cm = codegen.fromModel(modelName, sc); - hs = new java.util.LinkedHashSet(); - mn = "AppleReqDisc"; - hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); - mn = "BananaReqDisc"; - hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); - Assert.assertEquals(cm.discriminator.getMappedModels(), hs); - - // ref oneOf models with discriminator in allOf in those models - modelName = "FruitAllOfDisc"; - sc = openAPI.getComponents().getSchemas().get(modelName); - cm = codegen.fromModel(modelName, sc); - hs = new java.util.LinkedHashSet(); - mn = "AppleAllOfDisc"; - hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); - mn = "BananaAllOfDisc"; - hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); - Assert.assertEquals(cm.discriminator.getMappedModels(), hs); - - // ref oneOf models with discriminator in anyOf in those models - modelName = "FruitAnyOfDisc"; - sc = openAPI.getComponents().getSchemas().get(modelName); - cm = codegen.fromModel(modelName, sc); - hs = new java.util.LinkedHashSet(); - mn = "AppleAnyOfDisc"; - hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); - mn = "BananaAnyOfDisc"; - hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); - Assert.assertEquals(cm.discriminator.getMappedModels(), hs); - - // ref oneOf models with discriminator in anyOf in those models - modelName = "FruitAnyOfDisc"; - sc = openAPI.getComponents().getSchemas().get(modelName); - cm = codegen.fromModel(modelName, sc); - hs = new java.util.LinkedHashSet(); - mn = "AppleAnyOfDisc"; - hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); - mn = "BananaAnyOfDisc"; - hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); - Assert.assertEquals(cm.discriminator.getMappedModels(), hs); - - // ref oneOf models with discriminator in the grandparent schemas of those anyof models - modelName = "FruitGrandparentDisc"; - sc = openAPI.getComponents().getSchemas().get(modelName); - cm = codegen.fromModel(modelName, sc); - hs = new java.util.LinkedHashSet(); - mn = "AppleGrandparentDisc"; - hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); - mn = "BananaGrandparentDisc"; - hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); - Assert.assertEquals(cm.discriminator.getMappedModels(), hs); - } - - @Test - public void testComposedSchemaOneOfDiscriminatorMap() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/oneOfDiscriminator.yaml"); - DefaultCodegen codegen = new DefaultCodegen(); - codegen.setLegacyDiscriminatorBehavior(false); - codegen.setOpenAPI(openAPI); - - String modelName; - Schema sc; - CodegenModel cm; - java.util.LinkedHashSet hs; - String mn; - - // inline oneOf models work because the inline schemas are turned into $refs - modelName = "FruitInlineDisc"; - sc = openAPI.getComponents().getSchemas().get(modelName); - cm = codegen.fromModel(modelName, sc); - hs = new java.util.LinkedHashSet(); - mn = "FruitInlineDisc_oneOf"; - hs.add(new CodegenDiscriminator.MappedModel(mn, codegen.toModelName(mn))); - mn = "FruitInlineDisc_oneOf_1"; - hs.add(new CodegenDiscriminator.MappedModel(mn, codegen.toModelName(mn))); - Assert.assertEquals(cm.discriminator.getMappedModels(), hs); - - // inline oneOf with inline oneOf model doesn't work because we have null $refs and we throw an exception - final String fmodelName = "FruitInlineInlineDisc"; - final Schema fsc = openAPI.getComponents().getSchemas().get(fmodelName); - // comment out below as we're now showing warnings instead of throwing exceptions - //Assert.assertThrows(() -> codegen.fromModel(fmodelName, fsc)); - - // ref oneOf models with discriminator in properties in those models - modelName = "FruitReqDisc"; - sc = openAPI.getComponents().getSchemas().get(modelName); - cm = codegen.fromModel(modelName, sc); - hs = new java.util.LinkedHashSet(); - mn = "AppleReqDisc"; - hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); - mn = "BananaReqDisc"; - hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); - Assert.assertEquals(cm.discriminator.getMappedModels(), hs); - - // ref oneOf models with discriminator in allOf in those models - modelName = "FruitAllOfDisc"; - sc = openAPI.getComponents().getSchemas().get(modelName); - cm = codegen.fromModel(modelName, sc); - hs = new java.util.LinkedHashSet(); - mn = "AppleAllOfDisc"; - hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); - mn = "BananaAllOfDisc"; - hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); - Assert.assertEquals(cm.discriminator.getMappedModels(), hs); - - // ref oneOf models with discriminator in anyOf in those models - modelName = "FruitAnyOfDisc"; - sc = openAPI.getComponents().getSchemas().get(modelName); - cm = codegen.fromModel(modelName, sc); - hs = new java.util.LinkedHashSet(); - mn = "AppleAnyOfDisc"; - hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); - mn = "BananaAnyOfDisc"; - hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); - Assert.assertEquals(cm.discriminator.getMappedModels(), hs); - - // ref oneOf models with discriminator in oneOf in those models - modelName = "FruitOneOfDisc"; - sc = openAPI.getComponents().getSchemas().get(modelName); - cm = codegen.fromModel(modelName, sc); - hs = new java.util.LinkedHashSet(); - mn = "AppleOneOfDisc"; - hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); - mn = "BananaOneOfDisc"; - hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); - Assert.assertEquals(cm.discriminator.getMappedModels(), hs); - - // ref oneOf models with discriminator in the grandparent schemas of those oneof models - modelName = "FruitGrandparentDisc"; - sc = openAPI.getComponents().getSchemas().get(modelName); - cm = codegen.fromModel(modelName, sc); - hs = new java.util.LinkedHashSet(); - mn = "AppleGrandparentDisc"; - hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); - mn = "BananaGrandparentDisc"; - hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); - Assert.assertEquals(cm.discriminator.getMappedModels(), hs); - } - - @Test - public void testComposedSchemaMyPetsOneOfDiscriminatorMap() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/allOf_composition_discriminator.yaml"); - - DefaultCodegen codegen = new DefaultCodegen(); - codegen.setLegacyDiscriminatorBehavior(false); - codegen.setOpenAPI(openAPI); - - String path = "/mypets"; - - Operation operation = openAPI.getPaths().get(path).getGet(); - CodegenOperation codegenOperation = codegen.fromOperation(path, "GET", operation, null); - verifyMyPetsDiscriminator(codegenOperation.discriminator); - - Schema pet = openAPI.getComponents().getSchemas().get("MyPets"); - CodegenModel petModel = codegen.fromModel("MyPets", pet); - verifyMyPetsDiscriminator(petModel.discriminator); - } - - @Test - public void testComposedSchemaAllOfHierarchy() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/allOf_composition_discriminator.yaml"); - - DefaultCodegen codegen = new DefaultCodegen(); - codegen.setLegacyDiscriminatorBehavior(false); - codegen.setOpenAPI(openAPI); - - Schema pet = openAPI.getComponents().getSchemas().get("Lizard"); - CodegenModel petModel = codegen.fromModel("Lizard", pet); - verifyLizardDiscriminator(petModel.discriminator); - - pet = openAPI.getComponents().getSchemas().get("Reptile"); - petModel = codegen.fromModel("Reptile", pet); - verifyReptileDiscriminator(petModel.discriminator); - } - - private void verifyLizardDiscriminator(CodegenDiscriminator discriminator) { - CodegenDiscriminator test = new CodegenDiscriminator(); - String prop = "petType"; - test.setPropertyName(prop); - test.setPropertyBaseName(prop); - test.setMapping(null); - test.setMappedModels(new HashSet<>()); - assertEquals(discriminator, test); - } - - private void verifyReptileDiscriminator(CodegenDiscriminator discriminator) { - CodegenDiscriminator test = new CodegenDiscriminator(); - String prop = "petType"; - test.setPropertyName(prop); - test.setPropertyBaseName(prop); - test.setMapping(null); - test.setMappedModels(new HashSet() {{ - add(new CodegenDiscriminator.MappedModel("Snake", "Snake")); - add(new CodegenDiscriminator.MappedModel("Lizard", "Lizard")); - }}); - assertEquals(discriminator, test); - } - - private void verifyMyPetsDiscriminator(CodegenDiscriminator discriminator) { - CodegenDiscriminator test = new CodegenDiscriminator(); - String prop = "petType"; - test.setPropertyName(prop); - test.setPropertyBaseName(prop); - test.setMapping(null); - test.setMappedModels(new HashSet() {{ - add(new CodegenDiscriminator.MappedModel("Cat", "Cat")); - add(new CodegenDiscriminator.MappedModel("Lizard", "Lizard")); - }}); - assertEquals(discriminator, test); - } - - public CodegenModel getModel(List allModels, String modelName) { - for (ModelMap obj : allModels) { - CodegenModel cm = obj.getModel(); - if (modelName.equals(cm.name)) { - return cm; - } - } - return null; - } - - @Test - public void verifyXDiscriminatorValue() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/2_0/x-discriminator-value.yaml"); - final DefaultCodegen config = new DefaultCodegen(); - config.setOpenAPI(openAPI); - - String modelName; - CodegenDiscriminator discriminator; - Schema sc; - CodegenModel cm; - - Boolean dryRun = Boolean.TRUE; - final DefaultGenerator generator = new DefaultGenerator(dryRun); - generator.openAPI = openAPI; - generator.config = config; - generator.configureGeneratorProperties(); - - // for us to check a model's children we need to run generator.generateModels - // because children are assigned in config.updateAllModels which is invoked in generator.generateModels - List files = new ArrayList<>(); - List filteredSchemas = ModelUtils.getSchemasUsedOnlyInFormParam(openAPI); - List allModels = new ArrayList<>(); - generator.generateModels(files, allModels, filteredSchemas); - - // check that the model's children contain the x-discriminator-values - modelName = "BaseObj"; - cm = getModel(allModels, modelName); - Assert.assertNotNull(cm); - Assert.assertNotNull(cm.children); - List expectedDiscriminatorValues = new ArrayList<>(Arrays.asList("daily", "sub-obj")); - ArrayList xDiscriminatorValues = new ArrayList<>(); - for (CodegenModel child : cm.children) { - xDiscriminatorValues.add((String) child.vendorExtensions.get("x-discriminator-value")); - } - assertEquals(xDiscriminatorValues, expectedDiscriminatorValues); - - // check that the discriminator's MappedModels also contains the x-discriminator-values - discriminator = new CodegenDiscriminator(); - String prop = "object_type"; - discriminator.setPropertyName(config.toVarName(prop)); - discriminator.setPropertyBaseName(prop); - discriminator.setMapping(null); - discriminator.setMappedModels(new HashSet() {{ - add(new CodegenDiscriminator.MappedModel("DailySubObj", "DailySubObj")); - add(new CodegenDiscriminator.MappedModel("SubObj", "SubObj")); - add(new CodegenDiscriminator.MappedModel("daily", "DailySubObj")); - add(new CodegenDiscriminator.MappedModel("sub-obj", "SubObj")); - }}); - assertEquals(cm.discriminator, discriminator); - } - - - @Test - public void testAllOfSingleRefNoOwnProps() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/2_0/composed-allof.yaml"); - final DefaultCodegen codegen = new CodegenWithMultipleInheritance(); - - Schema schema = openAPI.getComponents().getSchemas().get("NewMessageEventCoreNoOwnProps"); - codegen.setOpenAPI(openAPI); - CodegenModel model = codegen.fromModel("NewMessageEventCoreNoOwnProps", schema); - Assert.assertEquals(getNames(model.getVars()), Arrays.asList("id", "message")); - Assert.assertNull(model.parent); - Assert.assertNull(model.allParents); - } - - class CodegenWithMultipleInheritance extends DefaultCodegen { - public CodegenWithMultipleInheritance() { - super(); - supportsInheritance = true; - supportsMultipleInheritance = true; - } - } - - @Test - public void testAllOfParent() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/allOf-required-parent.yaml"); - DefaultCodegen codegen = new DefaultCodegen(); - codegen.setOpenAPI(openAPI); - - Schema person = openAPI.getComponents().getSchemas().get("person"); - CodegenModel personModel = codegen.fromModel("person", person); - Assert.assertEquals(getRequiredVars(personModel), Arrays.asList("firstName", "name", "email", "id")); - - Schema personForCreation = openAPI.getComponents().getSchemas().get("personForCreation"); - CodegenModel personForCreationModel = codegen.fromModel("personForCreation", personForCreation); - Assert.assertEquals(getRequiredVars(personForCreationModel), Arrays.asList("firstName", "name", "email")); - - Schema personForUpdate = openAPI.getComponents().getSchemas().get("personForUpdate"); - CodegenModel personForUpdateModel = codegen.fromModel("personForUpdate", personForUpdate); - Assert.assertEquals(getRequiredVars(personForUpdateModel), Collections.emptyList()); - } - - private List getRequiredVars(CodegenModel model) { - return getNames(model.getRequiredVars()); - } - - private List getNames(List props) { - if (props == null) return null; - return props.stream().map(v -> v.name).collect(Collectors.toList()); - } - - @Test - public void testCallbacks() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/callbacks.yaml"); - final CodegenConfig codegen = new DefaultCodegen(); - codegen.setOpenAPI(openAPI); - - final String path = "/streams"; - Operation subscriptionOperation = openAPI.getPaths().get("/streams").getPost(); - CodegenOperation op = codegen.fromOperation(path, "post", subscriptionOperation, null); - - Assert.assertFalse(op.isCallbackRequest); - Assert.assertNotNull(op.operationId); - Assert.assertEquals(op.callbacks.size(), 2); - - CodegenCallback cbB = op.callbacks.get(1); - Assert.assertEquals(cbB.name, "dummy"); - Assert.assertEquals(cbB.urls.size(), 0); - - CodegenCallback cbA = op.callbacks.get(0); - Assert.assertEquals(cbA.name, "onData"); - - Assert.assertEquals(cbA.urls.size(), 2); - - CodegenCallback.Url urlB = cbA.urls.get(1); - Assert.assertEquals(urlB.expression, "{$request.query.callbackUrl}/test"); - Assert.assertEquals(urlB.requests.size(), 0); - - CodegenCallback.Url urlA = cbA.urls.get(0); - Assert.assertEquals(urlA.expression, "{$request.query.callbackUrl}/data"); - Assert.assertEquals(urlA.requests.size(), 2); - - urlA.requests.forEach(req -> { - Assert.assertTrue(req.isCallbackRequest); - Assert.assertNotNull(req.bodyParam); - Assert.assertEquals(req.responses.size(), 2); - - switch (req.httpMethod.toLowerCase(Locale.getDefault())) { - case "post": - Assert.assertEquals(req.operationId, "onDataDataPost"); - Assert.assertEquals(req.bodyParam.dataType, "NewNotificationData"); - break; - case "delete": - Assert.assertEquals(req.operationId, "onDataDataDelete"); - Assert.assertEquals(req.bodyParam.dataType, "DeleteNotificationData"); - break; - default: - Assert.fail(String.format(Locale.getDefault(), "invalid callback request http method '%s'", req.httpMethod)); - } - }); - } - - @Test - public void testLeadingSlashIsAddedIfMissing() { - OpenAPI openAPI = TestUtils.createOpenAPI(); - Operation operation1 = new Operation().operationId("op1").responses(new ApiResponses().addApiResponse("201", new ApiResponse().description("OK"))); - openAPI.path("/here", new PathItem().get(operation1)); - Operation operation2 = new Operation().operationId("op2").responses(new ApiResponses().addApiResponse("201", new ApiResponse().description("OK"))); - openAPI.path("some/path", new PathItem().get(operation2)); - final DefaultCodegen codegen = new DefaultCodegen(); - codegen.setOpenAPI(openAPI); - - CodegenOperation co1 = codegen.fromOperation("/here", "get", operation2, null); - Assert.assertEquals(co1.path, "/here"); - CodegenOperation co2 = codegen.fromOperation("some/path", "get", operation2, null); - Assert.assertEquals(co2.path, "/some/path"); - } - - @Test - public void testDefaultResponseShouldBeLast() { - OpenAPI openAPI = TestUtils.createOpenAPI(); - Operation myOperation = new Operation().operationId("myOperation").responses( - new ApiResponses() - .addApiResponse( - "default", new ApiResponse().description("Default")) - .addApiResponse( - "422", new ApiResponse().description("Error")) - ); - openAPI.path("/here", new PathItem().get(myOperation)); - final DefaultCodegen codegen = new DefaultCodegen(); - codegen.setOpenAPI(openAPI); - - CodegenOperation co = codegen.fromOperation("/here", "get", myOperation, null); - Assert.assertEquals(co.responses.get(0).message, "Error"); - Assert.assertEquals(co.responses.get(1).message, "Default"); - } - - @Test - public void testResponseWithNoSchemaInHeaders() { - OpenAPI openAPI = TestUtils.createOpenAPI(); - ApiResponse response2XX = new ApiResponse() - .description("OK") - .addHeaderObject("x-custom-header", new Header() - .description("a custom header") - .style(Header.StyleEnum.SIMPLE)); - Operation operation1 = new Operation().operationId("op1").responses(new ApiResponses().addApiResponse("2XX", response2XX)); - openAPI.path("/here", new PathItem().get(operation1)); - final DefaultCodegen codegen = new DefaultCodegen(); - codegen.setOpenAPI(openAPI); - - CodegenResponse cr = codegen.fromResponse("2XX", response2XX); - Assert.assertNotNull(cr); - Assert.assertTrue(cr.hasHeaders); - } - - @Test - public void testNullableProperty() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/examples.yaml"); - new InlineModelResolver().flatten(openAPI); - final DefaultCodegen codegen = new DefaultCodegen(); - codegen.setOpenAPI(openAPI); - - CodegenProperty property = codegen.fromProperty("address", (Schema) openAPI.getComponents().getSchemas().get("User").getProperties().get("address")); - - Assert.assertTrue(property.isNullable); - } - - @Test - public void testDeprecatedModel() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/component-deprecated.yml"); - new InlineModelResolver().flatten(openAPI); - final DefaultCodegen codegen = new DefaultCodegen(); - - CodegenModel codegenPetModel = codegen.fromModel("Pet", openAPI.getComponents().getSchemas().get("Pet")); - Assert.assertTrue(codegenPetModel.isDeprecated); - - CodegenModel codegenFoodModel = codegen.fromModel("Food", openAPI.getComponents().getSchemas().get("Food")); - Assert.assertTrue(codegenFoodModel.isDeprecated); - } - - @Test - public void testDeprecatedProperty() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/property-deprecated.yaml"); - new InlineModelResolver().flatten(openAPI); - final DefaultCodegen codegen = new DefaultCodegen(); - codegen.setOpenAPI(openAPI); - - final Map responseProperties = Collections.unmodifiableMap(openAPI.getComponents().getSchemas().get("Response").getProperties()); - final Map requestProperties = Collections.unmodifiableMap(openAPI.getComponents().getSchemas().get("Response").getProperties()); - - Assert.assertTrue(codegen.fromProperty("firstName", (Schema) responseProperties.get("firstName")).deprecated); - Assert.assertFalse(codegen.fromProperty("customerCode", (Schema) responseProperties.get("customerCode")).deprecated); - Assert.assertTrue(codegen.fromProperty("firstName", (Schema) requestProperties.get("firstName")).deprecated); - Assert.assertFalse(codegen.fromProperty("customerCode", (Schema) requestProperties.get("customerCode")).deprecated); - } - - @Test - public void testDeprecatedRef() { - final OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/model-deprecated.yaml"); - new InlineModelResolver().flatten(openAPI); - final DefaultCodegen codegen = new DefaultCodegen(); - codegen.setOpenAPI(openAPI); - - final Map requestProperties = Collections.unmodifiableMap(openAPI.getComponents().getSchemas().get("complex").getProperties()); - - Assert.assertTrue(codegen.fromProperty("deprecated", (Schema) requestProperties.get("deprecated")).deprecated); - Assert.assertFalse(codegen.fromProperty("current", (Schema) requestProperties.get("current")).deprecated); - } - - @Test - public void integerSchemaPropertyAndModelTest() { - OpenAPI openAPI = TestUtils.createOpenAPI(); - final Schema schema = new IntegerSchema().format("int32"); - final DefaultCodegen codegen = new DefaultCodegen(); - codegen.setOpenAPI(openAPI); - - //Property: - final CodegenProperty cp = codegen.fromProperty("someProperty", schema); - Assert.assertEquals(cp.baseType, "integer"); - Assert.assertEquals(cp.baseName, "someProperty"); - Assert.assertFalse(cp.isString); - Assert.assertTrue(cp.isInteger); - Assert.assertFalse(cp.isLong); - Assert.assertFalse(cp.isNumber); - Assert.assertTrue(cp.isNumeric); - Assert.assertFalse(cp.isFloat); - Assert.assertFalse(cp.isDouble); - - //Model: - final CodegenModel cm = codegen.fromModel("someModel", schema); - Assert.assertEquals(cm.dataType, "integer"); - Assert.assertEquals(cm.name, "someModel"); - Assert.assertFalse(cm.isString); - Assert.assertTrue(cm.isInteger); - Assert.assertFalse(cm.isLong); - Assert.assertFalse(cm.isNumber); - Assert.assertTrue(cm.isNumeric); - Assert.assertFalse(cm.isFloat); - Assert.assertFalse(cm.isDouble); - } - - @Test - public void longSchemaPropertyAndModelTest() { - OpenAPI openAPI = TestUtils.createOpenAPI(); - final Schema schema = new IntegerSchema().format("int64"); - final DefaultCodegen codegen = new DefaultCodegen(); - codegen.setOpenAPI(openAPI); - - //Property: - final CodegenProperty cp = codegen.fromProperty("someProperty", schema); - Assert.assertEquals(cp.baseType, "long"); - Assert.assertEquals(cp.baseName, "someProperty"); - Assert.assertFalse(cp.isString); - Assert.assertFalse(cp.isInteger); - Assert.assertTrue(cp.isLong); - Assert.assertFalse(cp.isNumber); - Assert.assertTrue(cp.isNumeric); - Assert.assertFalse(cp.isFloat); - Assert.assertFalse(cp.isDouble); - - //Model: - final CodegenModel cm = codegen.fromModel("someModel", schema); - Assert.assertEquals(cm.dataType, "long"); - Assert.assertEquals(cm.name, "someModel"); - Assert.assertFalse(cm.isString); - Assert.assertFalse(cm.isInteger); - Assert.assertTrue(cm.isLong); - Assert.assertFalse(cm.isNumber); - Assert.assertTrue(cm.isNumeric); - Assert.assertFalse(cm.isFloat); - Assert.assertFalse(cm.isDouble); - } - - @Test - public void numberSchemaPropertyAndModelTest() { - OpenAPI openAPI = TestUtils.createOpenAPI(); - final Schema schema = new NumberSchema(); - final DefaultCodegen codegen = new DefaultCodegen(); - codegen.setOpenAPI(openAPI); - - //Property: - final CodegenProperty cp = codegen.fromProperty("someProperty", schema); - Assert.assertEquals(cp.baseType, "number"); - Assert.assertEquals(cp.baseName, "someProperty"); - Assert.assertFalse(cp.isString); - Assert.assertFalse(cp.isInteger); - Assert.assertFalse(cp.isLong); - Assert.assertTrue(cp.isNumber); - Assert.assertTrue(cp.isNumeric); - Assert.assertFalse(cp.isFloat); - Assert.assertFalse(cp.isDouble); - - //Model: - final CodegenModel cm = codegen.fromModel("someModel", schema); - Assert.assertEquals(cm.dataType, "number"); - Assert.assertEquals(cm.name, "someModel"); - Assert.assertFalse(cm.isString); - Assert.assertFalse(cm.isInteger); - Assert.assertFalse(cm.isLong); - Assert.assertTrue(cm.isNumber); - Assert.assertTrue(cm.isNumeric); - Assert.assertFalse(cm.isFloat); - Assert.assertFalse(cm.isDouble); - } - - @Test - public void numberFloatSchemaPropertyAndModelTest() { - OpenAPI openAPI = TestUtils.createOpenAPI(); - final Schema schema = new NumberSchema().format("float"); - final DefaultCodegen codegen = new DefaultCodegen(); - codegen.setOpenAPI(openAPI); - - //Property: - final CodegenProperty cp = codegen.fromProperty("someProperty", schema); - Assert.assertEquals(cp.baseType, "float"); - Assert.assertEquals(cp.baseName, "someProperty"); - Assert.assertFalse(cp.isString); - Assert.assertFalse(cp.isInteger); - Assert.assertFalse(cp.isLong); - Assert.assertFalse(cp.isNumber); - Assert.assertTrue(cp.isNumeric); - Assert.assertTrue(cp.isFloat); - Assert.assertFalse(cp.isDouble); - - //Model: - final CodegenModel cm = codegen.fromModel("someModel", schema); - Assert.assertEquals(cm.dataType, "float"); - Assert.assertEquals(cm.name, "someModel"); - Assert.assertFalse(cm.isString); - Assert.assertFalse(cm.isInteger); - Assert.assertFalse(cm.isLong); - Assert.assertFalse(cm.isNumber); - Assert.assertTrue(cm.isNumeric); - Assert.assertTrue(cm.isFloat); - Assert.assertFalse(cm.isDouble); - } - - @Test - public void numberDoubleSchemaPropertyAndModelTest() { - OpenAPI openAPI = TestUtils.createOpenAPI(); - final Schema schema = new NumberSchema().format("double"); - final DefaultCodegen codegen = new DefaultCodegen(); - codegen.setOpenAPI(openAPI); - - //Property: - final CodegenProperty cp = codegen.fromProperty("someProperty", schema); - Assert.assertEquals(cp.baseType, "double"); - Assert.assertEquals(cp.baseName, "someProperty"); - Assert.assertFalse(cp.isString); - Assert.assertFalse(cp.isInteger); - Assert.assertFalse(cp.isLong); - Assert.assertFalse(cp.isNumber); - Assert.assertTrue(cp.isNumeric); - Assert.assertFalse(cp.isFloat); - Assert.assertTrue(cp.isDouble); - - //Model: - final CodegenModel cm = codegen.fromModel("someModel", schema); - Assert.assertEquals(cm.dataType, "double"); - Assert.assertEquals(cm.name, "someModel"); - Assert.assertFalse(cm.isString); - Assert.assertFalse(cm.isInteger); - Assert.assertFalse(cm.isLong); - Assert.assertFalse(cm.isNumber); - Assert.assertTrue(cm.isNumeric); - Assert.assertFalse(cm.isFloat); - Assert.assertTrue(cm.isDouble); - } - - @Test - public void testAlias() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/type_alias.yaml"); - new InlineModelResolver().flatten(openAPI); - - final DefaultCodegen codegen = new DefaultCodegen(); - codegen.setOpenAPI(openAPI); - - CodegenModel typeAliasModel = codegen.fromModel( - "MyParameterTextField", - openAPI.getComponents().getSchemas().get("MyParameterTextField") - ); - Assert.assertTrue(typeAliasModel.isAlias); - Assert.assertEquals(typeAliasModel.dataType, "string"); - - CodegenModel composedModel = codegen.fromModel( - "ComposedModel", - openAPI.getComponents().getSchemas().get("ComposedModel") - ); - Assert.assertFalse(composedModel.isAlias); - } - - private void verifyPersonDiscriminator(CodegenDiscriminator discriminator) { - CodegenDiscriminator test = new CodegenDiscriminator(); - test.setPropertyName("DollarUnderscoretype"); - test.setPropertyBaseName("$_type"); - test.setMapping(new HashMap<>()); - test.getMapping().put("a", "#/components/schemas/Adult"); - test.getMapping().put("c", "Child"); - test.getMappedModels().add(new CodegenDiscriminator.MappedModel("a", "Adult")); - test.getMappedModels().add(new CodegenDiscriminator.MappedModel("c", "Child")); - test.getMappedModels().add(new CodegenDiscriminator.MappedModel("Adult", "Adult")); - test.getMappedModels().add(new CodegenDiscriminator.MappedModel("Child", "Child")); - Assert.assertEquals(discriminator, test); - } - - private CodegenProperty codegenPropertyWithArrayOfIntegerValues() { - CodegenProperty array = new CodegenProperty(); - final CodegenProperty items = new CodegenProperty(); - final HashMap allowableValues = new HashMap<>(); - allowableValues.put("values", Collections.singletonList(1)); - items.setAllowableValues(allowableValues); - items.dataType = "Integer"; - array.items = items; - array.mostInnerItems = items; - array.dataType = "Array"; - return array; - } - - private CodegenProperty codegenProperty(List values) { - CodegenProperty array = new CodegenProperty(); - final CodegenProperty items = new CodegenProperty(); - final HashMap allowableValues = new HashMap<>(); - allowableValues.put("values", values); - items.setAllowableValues(allowableValues); - items.dataType = "String"; - array.items = items; - array.mostInnerItems = items; - array.dataType = "Array"; - return array; - } - - private CodegenProperty codegenPropertyWithXEnumVarName(List values, List aliases) { - final CodegenProperty var = new CodegenProperty(); - final HashMap allowableValues = new HashMap<>(); - allowableValues.put("values", values); - var.setAllowableValues(allowableValues); - var.dataType = "String"; - Map extensions = Collections.singletonMap("x-enum-varnames", aliases); - var.setVendorExtensions(extensions); - return var; - } - - private ModelsMap codegenModel(List values) { - final CodegenModel cm = new CodegenModel(); - cm.isEnum = true; - final HashMap allowableValues = new HashMap<>(); - allowableValues.put("values", values); - cm.setAllowableValues(allowableValues); - cm.dataType = "String"; - return TestUtils.createCodegenModelWrapper(cm); - } - - private ModelsMap codegenModelWithXEnumVarName() { - final CodegenModel cm = new CodegenModel(); - cm.isEnum = true; - final HashMap allowableValues = new HashMap<>(); - allowableValues.put("values", Arrays.asList("dog", "cat")); - cm.setAllowableValues(allowableValues); - cm.dataType = "String"; - final List aliases = Arrays.asList("DOGVAR", "CATVAR"); - final List descriptions = Arrays.asList("This is a dog", "This is a cat"); - Map extensions = new HashMap<>(); - extensions.put("x-enum-varnames", aliases); - extensions.put("x-enum-descriptions", descriptions); - cm.setVendorExtensions(extensions); - cm.setVars(Collections.emptyList()); - return TestUtils.createCodegenModelWrapper(cm); - } - - @Test - public void objectQueryParamIdentifyAsObject() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/objectQueryParam.yaml"); - new InlineModelResolver().flatten(openAPI); - final DefaultCodegen codegen = new DefaultCodegen(); - codegen.setOpenAPI(openAPI); - - Set imports = new HashSet<>(); - CodegenParameter parameter = codegen.fromParameter(openAPI.getPaths().get("/pony").getGet().getParameters().get(0), imports); - - // TODO: This must be updated to work with flattened inline models - Assert.assertEquals(parameter.dataType, "ListPageQueryParameter"); - Assert.assertEquals(imports.size(), 1); - Assert.assertEquals(imports.iterator().next(), "ListPageQueryParameter"); - - Assert.assertNotNull(parameter.getSchema()); - Assert.assertEquals(parameter.getSchema().dataType, "Object"); - Assert.assertEquals(parameter.getSchema().baseType, "object"); - } - - @Test - public void mapParamImportInnerObject() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/2_0/mapArgs.yaml"); - final DefaultCodegen codegen = new DefaultCodegen(); - codegen.setOpenAPI(openAPI); - - RequestBody requestBody = openAPI.getPaths().get("/api/instruments").getPost().getRequestBody(); - - HashSet imports = new HashSet<>(); - codegen.fromRequestBody(requestBody, imports, ""); - - HashSet expected = Sets.newHashSet("InstrumentDefinition", "map"); - - Assert.assertEquals(imports, expected); - } - - @Test - public void modelDoNotContainInheritedVars() { - DefaultCodegen codegen = new DefaultCodegen(); - codegen.supportsInheritance = true; - - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/generic.yaml"); - codegen.setOpenAPI(openAPI); - - CodegenModel codegenModel = codegen.fromModel("Dog", openAPI.getComponents().getSchemas().get("Dog")); - - Assert.assertEquals(codegenModel.vars.size(), 1); - } - - @Test - public void importMapping() { - DefaultCodegen codegen = new DefaultCodegen(); - codegen.importMapping.put("TypeAlias", "foo.bar.TypeAlias"); - - OpenAPI openAPI = new OpenAPIParser() - .readLocation("src/test/resources/3_0/type-alias.yaml", null, new ParseOptions()).getOpenAPI(); - codegen.setOpenAPI(openAPI); - - CodegenModel codegenModel = codegen.fromModel("ParentType", openAPI.getComponents().getSchemas().get("ParentType")); - - Assert.assertEquals(codegenModel.vars.size(), 1); - Assert.assertEquals(codegenModel.vars.get(0).getBaseType(), "string"); - } - - @Test - public void schemaMapping() { - DefaultCodegen codegen = new DefaultCodegen(); - codegen.schemaMapping.put("TypeAlias", "foo.bar.TypeAlias"); - - OpenAPI openAPI = new OpenAPIParser() - .readLocation("src/test/resources/3_0/type-alias.yaml", null, new ParseOptions()).getOpenAPI(); - codegen.setOpenAPI(openAPI); - - CodegenModel codegenModel = codegen.fromModel("ParentType", openAPI.getComponents().getSchemas().get("ParentType")); - - Assert.assertEquals(codegenModel.vars.size(), 1); - Assert.assertEquals(codegenModel.vars.get(0).getBaseType(), "TypeAlias"); - } - - @Test - public void modelWithPrefixDoNotContainInheritedVars() { - DefaultCodegen codegen = new DefaultCodegen(); - codegen.supportsInheritance = true; - codegen.setModelNamePrefix("prefix"); - - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/generic.yaml"); - codegen.setOpenAPI(openAPI); - - CodegenModel codegenModel = codegen.fromModel("Dog", openAPI.getComponents().getSchemas().get("Dog")); - - Assert.assertEquals(codegenModel.vars.size(), 1); - } - - @Test - public void modelWithSuffixDoNotContainInheritedVars() { - DefaultCodegen codegen = new DefaultCodegen(); - codegen.supportsInheritance = true; - codegen.setModelNameSuffix("suffix"); - - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/generic.yaml"); - codegen.setOpenAPI(openAPI); - - CodegenModel codegenModel = codegen.fromModel("Dog", openAPI.getComponents().getSchemas().get("Dog")); - - Assert.assertEquals(codegenModel.vars.size(), 1); - } - - @Test - public void arrayInnerReferencedSchemaMarkedAsModel_20() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/2_0/arrayRefBody.yaml"); - final DefaultCodegen codegen = new DefaultCodegen(); - codegen.setOpenAPI(openAPI); - - Set imports = new HashSet<>(); - - RequestBody body = openAPI.getPaths().get("/examples").getPost().getRequestBody(); - - CodegenParameter codegenParameter = codegen.fromRequestBody(body, imports, ""); - - Assert.assertTrue(codegenParameter.isContainer); - Assert.assertTrue(codegenParameter.items.isModel); - Assert.assertFalse(codegenParameter.items.isContainer); - } - - @Test - public void arrayInnerReferencedSchemaMarkedAsModel_30() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/arrayRefBody.yaml"); - new InlineModelResolver().flatten(openAPI); - final DefaultCodegen codegen = new DefaultCodegen(); - codegen.setOpenAPI(openAPI); - - Set imports = new HashSet<>(); - - RequestBody body = openAPI.getPaths().get("/examples").getPost().getRequestBody(); - - CodegenParameter codegenParameter = codegen.fromRequestBody(body, imports, ""); - - Assert.assertTrue(codegenParameter.isContainer); - Assert.assertTrue(codegenParameter.items.isModel); - Assert.assertFalse(codegenParameter.items.isContainer); - } - - @Test - @SuppressWarnings("unchecked") - public void commonLambdasRegistrationTest() { - - DefaultCodegen codegen = new DefaultCodegen(); - Object lambdasObj = codegen.additionalProperties.get("lambda"); - - assertNotNull(lambdasObj, "Expecting lambda in additionalProperties"); - - Map lambdas = (Map) lambdasObj; - - assertTrue(lambdas.get("lowercase") instanceof LowercaseLambda, "Expecting LowercaseLambda class"); - assertTrue(lambdas.get("uppercase") instanceof UppercaseLambda, "Expecting UppercaseLambda class"); - assertTrue(lambdas.get("titlecase") instanceof TitlecaseLambda, "Expecting TitlecaseLambda class"); - assertTrue(lambdas.get("camelcase") instanceof CamelCaseLambda, "Expecting CamelCaseLambda class"); - assertTrue(lambdas.get("indented") instanceof IndentedLambda, "Expecting IndentedLambda class"); - assertTrue(lambdas.get("indented_8") instanceof IndentedLambda, "Expecting IndentedLambda class"); - assertTrue(lambdas.get("indented_12") instanceof IndentedLambda, "Expecting IndentedLambda class"); - assertTrue(lambdas.get("indented_16") instanceof IndentedLambda, "Expecting IndentedLambda class"); - } - - @Test - public void convertApiNameWithEmptySuffix() { - DefaultCodegen codegen = new DefaultCodegen(); - assertEquals(codegen.toApiName("Fake"), "FakeApi"); - assertEquals(codegen.toApiName(""), "DefaultApi"); - } - - @Test - public void convertApiNameWithSuffix() { - DefaultCodegen codegen = new DefaultCodegen(); - codegen.setApiNameSuffix("Test"); - assertEquals(codegen.toApiName("Fake"), "FakeTest"); - assertEquals(codegen.toApiName(""), "DefaultApi"); - } - - public static class FromParameter { - private CodegenParameter codegenParameter(String path) { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/fromParameter.yaml"); - new InlineModelResolver().flatten(openAPI); - final DefaultCodegen codegen = new DefaultCodegen(); - codegen.setOpenAPI(openAPI); - - return codegen - .fromParameter( - openAPI - .getPaths() - .get(path) - .getGet() - .getParameters() - .get(0), - new HashSet<>() - ); - } - - @Test - public void setStyle() { - CodegenParameter parameter = codegenParameter("/set_style"); - assertEquals(parameter.style, "form"); - } - - @Test - public void setShouldExplode() { - CodegenParameter parameter = codegenParameter("/set_should_explode"); - assertTrue(parameter.isExplode); - } - - @Test - public void testConvertPropertyToBooleanAndWriteBack_Boolean_true() { - final DefaultCodegen codegen = new DefaultCodegen(); - Map additionalProperties = codegen.additionalProperties(); - additionalProperties.put(CodegenConstants.SERIALIZABLE_MODEL, true); - boolean result = codegen.convertPropertyToBooleanAndWriteBack(CodegenConstants.SERIALIZABLE_MODEL); - Assert.assertTrue(result); - } - - @Test - public void testConvertPropertyToBooleanAndWriteBack_Boolean_false() { - final DefaultCodegen codegen = new DefaultCodegen(); - Map additionalProperties = codegen.additionalProperties(); - additionalProperties.put(CodegenConstants.SERIALIZABLE_MODEL, false); - boolean result = codegen.convertPropertyToBooleanAndWriteBack(CodegenConstants.SERIALIZABLE_MODEL); - Assert.assertFalse(result); - } - - @Test - public void testConvertPropertyToBooleanAndWriteBack_String_true() { - final DefaultCodegen codegen = new DefaultCodegen(); - Map additionalProperties = codegen.additionalProperties(); - additionalProperties.put(CodegenConstants.SERIALIZABLE_MODEL, "true"); - boolean result = codegen.convertPropertyToBooleanAndWriteBack(CodegenConstants.SERIALIZABLE_MODEL); - Assert.assertTrue(result); - } - - @Test - public void testConvertPropertyToBooleanAndWriteBack_String_false() { - final DefaultCodegen codegen = new DefaultCodegen(); - Map additionalProperties = codegen.additionalProperties(); - additionalProperties.put(CodegenConstants.SERIALIZABLE_MODEL, "false"); - boolean result = codegen.convertPropertyToBooleanAndWriteBack(CodegenConstants.SERIALIZABLE_MODEL); - Assert.assertFalse(result); - } - - @Test - public void testConvertPropertyToBooleanAndWriteBack_String_blibb() { - final DefaultCodegen codegen = new DefaultCodegen(); - Map additionalProperties = codegen.additionalProperties(); - additionalProperties.put(CodegenConstants.SERIALIZABLE_MODEL, "blibb"); - boolean result = codegen.convertPropertyToBooleanAndWriteBack(CodegenConstants.SERIALIZABLE_MODEL); - Assert.assertFalse(result); - } - } - - @Test - public void testCircularReferencesDetection() { - // given - DefaultCodegen codegen = new DefaultCodegen(); - final CodegenProperty inboundOut = new CodegenProperty(); - inboundOut.baseName = "out"; - inboundOut.dataType = "RoundA"; - final CodegenProperty roundANext = new CodegenProperty(); - roundANext.baseName = "next"; - roundANext.dataType = "RoundB"; - final CodegenProperty roundBNext = new CodegenProperty(); - roundBNext.baseName = "next"; - roundBNext.dataType = "RoundC"; - final CodegenProperty roundCNext = new CodegenProperty(); - roundCNext.baseName = "next"; - roundCNext.dataType = "RoundA"; - final CodegenProperty roundCOut = new CodegenProperty(); - roundCOut.baseName = "out"; - roundCOut.dataType = "Outbound"; - final CodegenModel inboundModel = new CodegenModel(); - inboundModel.setDataType("Inbound"); - inboundModel.setAllVars(Collections.singletonList(inboundOut)); - final CodegenModel roundAModel = new CodegenModel(); - roundAModel.setDataType("RoundA"); - roundAModel.setAllVars(Collections.singletonList(roundANext)); - final CodegenModel roundBModel = new CodegenModel(); - roundBModel.setDataType("RoundB"); - roundBModel.setAllVars(Collections.singletonList(roundBNext)); - final CodegenModel roundCModel = new CodegenModel(); - roundCModel.setDataType("RoundC"); - roundCModel.setAllVars(Arrays.asList(roundCNext, roundCOut)); - final CodegenModel outboundModel = new CodegenModel(); - outboundModel.setDataType("Outbound"); - final Map models = new HashMap<>(); - models.put("Inbound", inboundModel); - models.put("RoundA", roundAModel); - models.put("RoundB", roundBModel); - models.put("RoundC", roundCModel); - models.put("Outbound", outboundModel); - - // when - codegen.setCircularReferences(models); - - // then - Assert.assertFalse(inboundOut.isCircularReference); - Assert.assertTrue(roundANext.isCircularReference); - Assert.assertTrue(roundBNext.isCircularReference); - Assert.assertTrue(roundCNext.isCircularReference); - Assert.assertFalse(roundCOut.isCircularReference); - } - - @Test - public void testUseOneOfInterfaces() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/composed-oneof.yaml"); - final DefaultCodegen cg = new DefaultCodegen(); - cg.setUseOneOfInterfaces(true); - cg.preprocessOpenAPI(openAPI); - - // assert names of the response/request schema oneOf interfaces are as expected - Schema s = ModelUtils.getReferencedSchema(openAPI, openAPI.getPaths() - .get("/state") - .getPost() - .getRequestBody() - .getContent() - .get("application/json") - .getSchema()); - Assert.assertEquals(s.getExtensions().get("x-one-of-name"), "CreateStateRequest"); - - Assert.assertEquals( - openAPI.getPaths() - .get("/state") - .getGet() - .getResponses() - .get("200") - .getContent() - .get("application/json") - .getSchema().get$ref(), - "#/components/schemas/getState_200_response" - ); - Schema getState200 = openAPI.getComponents().getSchemas().get("getState_200_response"); - //Assert.assertEquals(getState200, ""); - Assert.assertEquals(getState200.getExtensions().get("x-one-of-name"), "GetState200Response"); - - // for the array schema, assert that a oneOf interface was added to schema map - Schema items = ((ArraySchema) openAPI.getComponents().getSchemas().get("CustomOneOfArraySchema")).getItems(); - Assert.assertEquals(items.get$ref(), "#/components/schemas/CustomOneOfArraySchema_inner"); - //Assert.assertEquals(items.get$ref(), "#/components/schemas/createState_request"); - Schema innerItem = ModelUtils.getReferencedSchema(openAPI, openAPI.getComponents().getSchemas().get("CustomOneOfArraySchema_inner")); - Assert.assertEquals(innerItem.getExtensions().get("x-one-of-name"), "CustomOneOfArraySchemaInner"); - } - - @Test - public void testFormComposedSchema() { - OpenAPI openAPI = TestUtils.parseContent("openapi: 3.0.1\n" + - "info:\n" + - " version: '1.0.0'\n" + - " title: the title\n" + - "\n" + - "paths:\n" + - " '/users/me':\n" + - " post:\n" + - " description: Change user password.\n" + - " operationId: changeCurrentUserPassword\n" + - " requestBody:\n" + - " required: true\n" + - " content:\n" + - " multipart/form-data:\n" + - " schema:\n" + - " $ref: '#/components/schemas/ChangePasswordRequest'\n" + - " responses:\n" + - " '200':\n" + - " description: Successful operation\n" + - " content: {}\n" + - "\n" + - "components:\n" + - " schemas:\n" + - " CommonPasswordRequest:\n" + - " type: object\n" + - " required: [ password, passwordConfirmation ]\n" + - " properties:\n" + - " password:\n" + - " type: string\n" + - " format: password\n" + - " passwordConfirmation:\n" + - " type: string\n" + - " format: password\n" + - "\n" + - " ChangePasswordRequest:\n" + - " type: object\n" + - " allOf:\n" + - " - $ref: '#/components/schemas/CommonPasswordRequest'\n" + - " - type: object\n" + - " required: [ oldPassword ]\n" + - " properties:\n" + - " oldPassword:\n" + - " type: string\n" + - " format: password\n"); - - final DefaultCodegen cg = new DefaultCodegen(); - cg.setOpenAPI(openAPI); - cg.setUseOneOfInterfaces(true); - cg.preprocessOpenAPI(openAPI); - - final PathItem path = openAPI.getPaths().get("/users/me"); - final CodegenOperation operation = cg.fromOperation( - "/users/me", - "post", - path.getPost(), - path.getServers()); - assertEquals(operation.formParams.size(), 3, - "The list of parameters should include inherited type"); - - final List names = operation.formParams.stream() - .map(param -> param.paramName) - .collect(Collectors.toList()); - assertTrue(names.contains("password")); - assertTrue(names.contains("passwordConfirmation")); - assertTrue(names.contains("oldPassword")); - } - - @Test - public void inlineAllOfSchemaDoesNotThrowException() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue7262.yaml"); - final DefaultCodegen codegen = new DefaultCodegen(); - codegen.setOpenAPI(openAPI); - - String modelName = "UserTimeBase"; - Schema sc = openAPI.getComponents().getSchemas().get(modelName); - CodegenModel cm = codegen.fromModel(modelName, sc); - - final Set expectedMappedModels = Sets.newHashSet(new CodegenDiscriminator.MappedModel("UserSleep", "UserSleep")); - final Set mappedModels = cm.getDiscriminator().getMappedModels(); - assertEquals(mappedModels, expectedMappedModels); - - modelName = "UserSleep"; - sc = openAPI.getComponents().getSchemas().get(modelName); - cm = codegen.fromModel(modelName, sc); - final Set expectedAllOf = new HashSet<>(Arrays.asList("UserTimeBase")); - assertEquals(cm.allOf, expectedAllOf); - assertEquals(openAPI.getComponents().getSchemas().size(), 2); - assertNull(cm.getDiscriminator()); - } - - @Test - public void arrayModelHasValidation() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue7356.yaml"); - final DefaultCodegen codegen = new DefaultCodegen(); - codegen.setOpenAPI(openAPI); - - String modelName = "ArrayWithValidations"; - Schema sc = openAPI.getComponents().getSchemas().get(modelName); - CodegenModel cm = codegen.fromModel(modelName, sc); - assertEquals((int) cm.getMinItems(), 1); - } - - @Test - public void testFreeFormSchemas() throws Exception { - File output = Files.createTempDirectory("test").toFile(); - - final CodegenConfigurator configurator = new CodegenConfigurator() - .setGeneratorName("java") - .setInputSpec("src/test/resources/3_0/issue_7361.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); - - final ClientOptInput clientOptInput = configurator.toClientOptInput(); - DefaultGenerator generator = new DefaultGenerator(); - List files = generator.opts(clientOptInput).generate(); - - TestUtils.ensureDoesNotContainsFile(files, output, "src/main/java/org/openapitools/client/model/FreeFormWithValidation.java"); - TestUtils.ensureDoesNotContainsFile(files, output, "src/main/java/org/openapitools/client/model/FreeFormInterface.java"); - TestUtils.ensureDoesNotContainsFile(files, output, "src/main/java/org/openapitools/client/model/FreeForm.java"); - output.deleteOnExit(); - } - - @Test - public void testOauthMultipleFlows() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_7193.yaml"); - final DefaultCodegen codegen = new DefaultCodegen(); - codegen.setOpenAPI(openAPI); - - final Map securitySchemes = openAPI.getComponents().getSecuritySchemes(); - final List securities = codegen.fromSecurity(securitySchemes); - - assertEquals(securities.size(), 2); - final List flows = securities.stream().map(c -> c.flow).collect(Collectors.toList()); - assertTrue(flows.containsAll(Arrays.asList("password", "application"))); - } - - @Test - public void testItemsPresent() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_7613.yaml"); - final DefaultCodegen codegen = new DefaultCodegen(); - codegen.setOpenAPI(openAPI); - - String modelName; - Schema sc; - CodegenModel cm; - - modelName = "ArrayWithValidationsInItems"; - sc = openAPI.getComponents().getSchemas().get(modelName); - cm = codegen.fromModel(modelName, sc); - assertEquals(cm.getItems().getMaximum(), "7"); - - modelName = "ObjectWithValidationsInArrayPropItems"; - sc = openAPI.getComponents().getSchemas().get(modelName); - cm = codegen.fromModel(modelName, sc); - assertEquals(cm.getVars().get(0).getItems().getMaximum(), "7"); - - String path; - Operation operation; - CodegenOperation co; - - path = "/ref_array_with_validations_in_items/{items}"; - operation = openAPI.getPaths().get(path).getPost(); - co = codegen.fromOperation(path, "POST", operation, null); - assertEquals(co.pathParams.get(0).getItems().getMaximum(), "7"); - assertEquals(co.bodyParams.get(0).getItems().getMaximum(), "7"); - assertEquals(co.responses.get(0).getItems().getMaximum(), "7"); - - path = "/array_with_validations_in_items/{items}"; - operation = openAPI.getPaths().get(path).getPost(); - co = codegen.fromOperation(path, "POST", operation, null); - assertEquals(co.pathParams.get(0).getItems().getMaximum(), "7"); - assertEquals(co.bodyParams.get(0).getItems().getMaximum(), "7"); - assertEquals(co.responses.get(0).getItems().getMaximum(), "7"); - } - - @Test - public void testAdditionalPropertiesPresentInModels() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_7613.yaml"); - final DefaultCodegen codegen = new DefaultCodegen(); - codegen.setOpenAPI(openAPI); - codegen.setDisallowAdditionalPropertiesIfNotPresent(false); - - String modelName; - Schema sc; - CodegenModel cm; - CodegenProperty anyTypeSchema = codegen.fromProperty("additional_properties", new Schema()); - - modelName = "AdditionalPropertiesUnset"; - sc = openAPI.getComponents().getSchemas().get(modelName); - cm = codegen.fromModel(modelName, sc); - assertEquals(cm.getAdditionalProperties(), anyTypeSchema); - assertTrue(cm.getAdditionalPropertiesIsAnyType()); - - modelName = "AdditionalPropertiesTrue"; - sc = openAPI.getComponents().getSchemas().get(modelName); - cm = codegen.fromModel(modelName, sc); - assertEquals(cm.getAdditionalProperties(), anyTypeSchema); - assertTrue(cm.getAdditionalPropertiesIsAnyType()); - - modelName = "AdditionalPropertiesFalse"; - sc = openAPI.getComponents().getSchemas().get(modelName); - cm = codegen.fromModel(modelName, sc); - assertNull(cm.getAdditionalProperties()); - assertFalse(cm.getAdditionalPropertiesIsAnyType()); - - modelName = "AdditionalPropertiesSchema"; - sc = openAPI.getComponents().getSchemas().get(modelName); - cm = codegen.fromModel(modelName, sc); - CodegenProperty stringCp = codegen.fromProperty("additional_properties", new Schema().type("string")); - assertEquals(cm.getAdditionalProperties(), stringCp); - assertFalse(cm.getAdditionalPropertiesIsAnyType()); - } - - @Test - public void testAdditionalPropertiesPresentInModelProperties() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_7613.yaml"); - final DefaultCodegen codegen = new DefaultCodegen(); - codegen.setOpenAPI(openAPI); - codegen.setDisallowAdditionalPropertiesIfNotPresent(false); - - String modelName; - Schema sc; - CodegenModel cm; - CodegenProperty anyTypeSchema = codegen.fromProperty("additional_properties", new Schema()); - CodegenProperty stringCp = codegen.fromProperty("additional_properties", new Schema().type("string")); - CodegenProperty mapWithAddPropsUnset; - CodegenProperty mapWithAddPropsTrue; - CodegenProperty mapWithAddPropsFalse; - CodegenProperty mapWithAddPropsSchema; - - // make sure isGenerateAliasAsModel is false - boolean isGenerateAliasAsModel = ModelUtils.isGenerateAliasAsModel(); - if (isGenerateAliasAsModel) { - GlobalSettings.setProperty("generateAliasAsModel", "false"); - } - - modelName = "ObjectModelWithRefAddPropsInProps"; - sc = openAPI.getComponents().getSchemas().get(modelName); - cm = codegen.fromModel(modelName, sc); - mapWithAddPropsUnset = cm.getVars().get(0); - assertEquals(mapWithAddPropsUnset.getAdditionalProperties(), anyTypeSchema); - assertTrue(mapWithAddPropsUnset.getAdditionalPropertiesIsAnyType()); - mapWithAddPropsTrue = cm.getVars().get(1); - assertEquals(mapWithAddPropsTrue.getAdditionalProperties(), anyTypeSchema); - assertTrue(mapWithAddPropsTrue.getAdditionalPropertiesIsAnyType()); - mapWithAddPropsFalse = cm.getVars().get(2); - assertNull(mapWithAddPropsFalse.getAdditionalProperties()); - assertFalse(mapWithAddPropsFalse.getAdditionalPropertiesIsAnyType()); - mapWithAddPropsSchema = cm.getVars().get(3); - assertEquals(mapWithAddPropsSchema.getAdditionalProperties(), stringCp); - assertFalse(mapWithAddPropsSchema.getAdditionalPropertiesIsAnyType()); - - modelName = "ObjectModelWithAddPropsInProps"; - sc = openAPI.getComponents().getSchemas().get(modelName); - cm = codegen.fromModel(modelName, sc); - mapWithAddPropsUnset = cm.getVars().get(0); - assertEquals(mapWithAddPropsUnset.getAdditionalProperties(), anyTypeSchema); - assertTrue(mapWithAddPropsUnset.getAdditionalPropertiesIsAnyType()); - mapWithAddPropsTrue = cm.getVars().get(1); - assertEquals(mapWithAddPropsTrue.getAdditionalProperties(), anyTypeSchema); - assertTrue(mapWithAddPropsTrue.getAdditionalPropertiesIsAnyType()); - mapWithAddPropsFalse = cm.getVars().get(2); - assertNull(mapWithAddPropsFalse.getAdditionalProperties()); - assertFalse(mapWithAddPropsFalse.getAdditionalPropertiesIsAnyType()); - mapWithAddPropsSchema = cm.getVars().get(3); - assertEquals(mapWithAddPropsSchema.getAdditionalProperties(), stringCp); - assertFalse(mapWithAddPropsSchema.getAdditionalPropertiesIsAnyType()); - - if (isGenerateAliasAsModel) { // restore the setting - GlobalSettings.setProperty("generateAliasAsModel", "true"); - } - } - - @Test - public void testAdditionalPropertiesPresentInParameters() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_7613.yaml"); - final DefaultCodegen codegen = new DefaultCodegen(); - codegen.setOpenAPI(openAPI); - codegen.setDisallowAdditionalPropertiesIfNotPresent(false); - - String path; - Operation operation; - CodegenOperation co; - - CodegenProperty anyTypeSchema = codegen.fromProperty("additional_properties", new Schema()); - CodegenProperty stringCp = codegen.fromProperty("additional_properties", new Schema().type("string")); - CodegenParameter mapWithAddPropsUnset; - CodegenParameter mapWithAddPropsTrue; - CodegenParameter mapWithAddPropsFalse; - CodegenParameter mapWithAddPropsSchema; - - // make sure isGenerateAliasAsModel is false - boolean isGenerateAliasAsModel = ModelUtils.isGenerateAliasAsModel(); - if (isGenerateAliasAsModel) { - GlobalSettings.setProperty("generateAliasAsModel", "false"); - } - - path = "/ref_additional_properties/"; - operation = openAPI.getPaths().get(path).getPost(); - co = codegen.fromOperation(path, "POST", operation, null); - mapWithAddPropsUnset = co.queryParams.get(0); - assertEquals(mapWithAddPropsUnset.getAdditionalProperties(), anyTypeSchema); - assertTrue(mapWithAddPropsUnset.getAdditionalPropertiesIsAnyType()); - mapWithAddPropsTrue = co.queryParams.get(1); - assertEquals(mapWithAddPropsTrue.getAdditionalProperties(), anyTypeSchema); - assertTrue(mapWithAddPropsTrue.getAdditionalPropertiesIsAnyType()); - mapWithAddPropsFalse = co.queryParams.get(2); - assertNull(mapWithAddPropsFalse.getAdditionalProperties()); - assertFalse(mapWithAddPropsFalse.getAdditionalPropertiesIsAnyType()); - mapWithAddPropsSchema = co.queryParams.get(3); - assertEquals(mapWithAddPropsSchema.getAdditionalProperties(), stringCp); - assertFalse(mapWithAddPropsSchema.getAdditionalPropertiesIsAnyType()); - - path = "/additional_properties/"; - operation = openAPI.getPaths().get(path).getPost(); - co = codegen.fromOperation(path, "POST", operation, null); - mapWithAddPropsUnset = co.queryParams.get(0); - assertEquals(mapWithAddPropsUnset.getAdditionalProperties(), anyTypeSchema); - assertTrue(mapWithAddPropsUnset.getAdditionalPropertiesIsAnyType()); - mapWithAddPropsTrue = co.queryParams.get(1); - assertEquals(mapWithAddPropsTrue.getAdditionalProperties(), anyTypeSchema); - assertTrue(mapWithAddPropsTrue.getAdditionalPropertiesIsAnyType()); - mapWithAddPropsFalse = co.queryParams.get(2); - assertNull(mapWithAddPropsFalse.getAdditionalProperties()); - assertFalse(mapWithAddPropsFalse.getAdditionalPropertiesIsAnyType()); - mapWithAddPropsSchema = co.queryParams.get(3); - assertEquals(mapWithAddPropsSchema.getAdditionalProperties(), stringCp); - assertFalse(mapWithAddPropsSchema.getAdditionalPropertiesIsAnyType()); - - if (isGenerateAliasAsModel) { // restore the setting - GlobalSettings.setProperty("generateAliasAsModel", "true"); - } - } - - @Test - public void testAdditionalPropertiesPresentInResponses() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_7613.yaml"); - final DefaultCodegen codegen = new DefaultCodegen(); - codegen.setOpenAPI(openAPI); - codegen.setDisallowAdditionalPropertiesIfNotPresent(false); - - String path; - Operation operation; - CodegenOperation co; - - CodegenProperty anyTypeSchema = codegen.fromProperty("additional_properties", new Schema()); - CodegenProperty stringCp = codegen.fromProperty("additional_properties", new Schema().type("string")); - CodegenResponse mapWithAddPropsUnset; - CodegenResponse mapWithAddPropsTrue; - CodegenResponse mapWithAddPropsFalse; - CodegenResponse mapWithAddPropsSchema; - - // make sure isGenerateAliasAsModel is false - boolean isGenerateAliasAsModel = ModelUtils.isGenerateAliasAsModel(); - if (isGenerateAliasAsModel) { - GlobalSettings.setProperty("generateAliasAsModel", "false"); - } - - path = "/ref_additional_properties/"; - operation = openAPI.getPaths().get(path).getPost(); - co = codegen.fromOperation(path, "POST", operation, null); - mapWithAddPropsUnset = co.responses.get(0); - assertEquals(mapWithAddPropsUnset.getAdditionalProperties(), anyTypeSchema); - assertTrue(mapWithAddPropsUnset.getAdditionalPropertiesIsAnyType()); - mapWithAddPropsTrue = co.responses.get(1); - assertEquals(mapWithAddPropsTrue.getAdditionalProperties(), anyTypeSchema); - assertTrue(mapWithAddPropsTrue.getAdditionalPropertiesIsAnyType()); - mapWithAddPropsFalse = co.responses.get(2); - assertNull(mapWithAddPropsFalse.getAdditionalProperties()); - assertFalse(mapWithAddPropsFalse.getAdditionalPropertiesIsAnyType()); - mapWithAddPropsSchema = co.responses.get(3); - assertEquals(mapWithAddPropsSchema.getAdditionalProperties(), stringCp); - assertFalse(mapWithAddPropsSchema.getAdditionalPropertiesIsAnyType()); - - path = "/additional_properties/"; - operation = openAPI.getPaths().get(path).getPost(); - co = codegen.fromOperation(path, "POST", operation, null); - mapWithAddPropsUnset = co.responses.get(0); - assertEquals(mapWithAddPropsUnset.getAdditionalProperties(), anyTypeSchema); - assertTrue(mapWithAddPropsUnset.getAdditionalPropertiesIsAnyType()); - mapWithAddPropsTrue = co.responses.get(1); - assertEquals(mapWithAddPropsTrue.getAdditionalProperties(), anyTypeSchema); - assertTrue(mapWithAddPropsTrue.getAdditionalPropertiesIsAnyType()); - mapWithAddPropsFalse = co.responses.get(2); - assertNull(mapWithAddPropsFalse.getAdditionalProperties()); - assertFalse(mapWithAddPropsFalse.getAdditionalPropertiesIsAnyType()); - mapWithAddPropsSchema = co.responses.get(3); - assertEquals(mapWithAddPropsSchema.getAdditionalProperties(), stringCp); - assertFalse(mapWithAddPropsSchema.getAdditionalPropertiesIsAnyType()); - - if (isGenerateAliasAsModel) { // restore the setting - GlobalSettings.setProperty("generateAliasAsModel", "true"); - } - } - - @Test - public void testAdditionalPropertiesAnyType() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_9282.yaml"); - final DefaultCodegen codegen = new DefaultCodegen(); - codegen.setOpenAPI(openAPI); - - CodegenProperty anyTypeSchema = codegen.fromProperty("additional_properties", new Schema()); - - Schema sc; - CodegenModel cm; - - sc = openAPI.getComponents().getSchemas().get("AdditionalPropertiesTrue"); - cm = codegen.fromModel("AdditionalPropertiesTrue", sc); - assertEquals(cm.getVars().get(0).additionalProperties, anyTypeSchema); - - sc = openAPI.getComponents().getSchemas().get("AdditionalPropertiesAnyType"); - cm = codegen.fromModel("AdditionalPropertiesAnyType", sc); - assertEquals(cm.getVars().get(0).additionalProperties, anyTypeSchema); - } - - @Test - public void testIsXPresence() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_7651.yaml"); - final DefaultCodegen codegen = new DefaultCodegen(); - codegen.setOpenAPI(openAPI); - - String modelName; - Schema sc; - CodegenModel cm; - - modelName = "DateWithValidation"; - sc = openAPI.getComponents().getSchemas().get(modelName); - cm = codegen.fromModel(modelName, sc); - assertFalse(cm.isString); - assertTrue(cm.isDate); - - modelName = "NullModel"; - sc = openAPI.getComponents().getSchemas().get(modelName); - cm = codegen.fromModel(modelName, sc); - assertTrue(cm.isNull); - - modelName = "ObjectWithTypeNullProperties"; - sc = openAPI.getComponents().getSchemas().get(modelName); - cm = codegen.fromModel(modelName, sc); - assertTrue(cm.getVars().get(0).isNull); - assertTrue(cm.getVars().get(1).getItems().isNull); - assertTrue(cm.getAdditionalProperties().isNull); - - modelName = "ArrayOfNulls"; - sc = openAPI.getComponents().getSchemas().get(modelName); - cm = codegen.fromModel(modelName, sc); - assertTrue(cm.getItems().isNull); - - modelName = "ObjectWithDateWithValidation"; - sc = openAPI.getComponents().getSchemas().get(modelName); - cm = codegen.fromModel(modelName, sc); - assertFalse(cm.getVars().get(0).isString); - assertTrue(cm.getVars().get(0).isDate); - - String path; - Operation operation; - CodegenOperation co; - - path = "/ref_date_with_validation/{date}"; - operation = openAPI.getPaths().get(path).getPost(); - co = codegen.fromOperation(path, "POST", operation, null); - assertFalse(co.pathParams.get(0).isString); - assertTrue(co.pathParams.get(0).isDate); - assertFalse(co.bodyParams.get(0).isString); - assertTrue(co.bodyParams.get(0).isDate); - assertFalse(co.responses.get(0).isString); - assertTrue(co.responses.get(0).isDate); - - path = "/date_with_validation/{date}"; - operation = openAPI.getPaths().get(path).getPost(); - co = codegen.fromOperation(path, "POST", operation, null); - assertFalse(co.pathParams.get(0).isString); - assertTrue(co.pathParams.get(0).isDate); - assertFalse(co.bodyParams.get(0).isString); - assertTrue(co.bodyParams.get(0).isDate); - assertFalse(co.responses.get(0).isString); - assertTrue(co.responses.get(0).isDate); - - modelName = "DateTimeWithValidation"; - sc = openAPI.getComponents().getSchemas().get(modelName); - cm = codegen.fromModel(modelName, sc); - assertFalse(cm.isString); - assertTrue(cm.isDateTime); - - modelName = "ObjectWithDateTimeWithValidation"; - sc = openAPI.getComponents().getSchemas().get(modelName); - cm = codegen.fromModel(modelName, sc); - assertFalse(cm.getVars().get(0).isString); - assertTrue(cm.getVars().get(0).isDateTime); - - path = "/ref_date_time_with_validation/{dateTime}"; - operation = openAPI.getPaths().get(path).getPost(); - co = codegen.fromOperation(path, "POST", operation, null); - assertFalse(co.pathParams.get(0).isString); - assertTrue(co.pathParams.get(0).isDateTime); - assertFalse(co.bodyParams.get(0).isString); - assertTrue(co.bodyParams.get(0).isDateTime); - assertFalse(co.responses.get(0).isString); - assertTrue(co.responses.get(0).isDateTime); - - path = "/date_time_with_validation/{dateTime}"; - operation = openAPI.getPaths().get(path).getPost(); - co = codegen.fromOperation(path, "POST", operation, null); - assertFalse(co.pathParams.get(0).isString); - assertTrue(co.pathParams.get(0).isDateTime); - assertFalse(co.bodyParams.get(0).isString); - assertTrue(co.bodyParams.get(0).isDateTime); - assertFalse(co.responses.get(0).isString); - assertTrue(co.responses.get(0).isDateTime); - - path = "/null/{param}"; - operation = openAPI.getPaths().get(path).getPost(); - co = codegen.fromOperation(path, "POST", operation, null); - assertTrue(co.pathParams.get(0).isNull); - assertTrue(co.bodyParams.get(0).isNull); - assertTrue(co.responses.get(0).isNull); - - path = "/ref_null/{param}"; - operation = openAPI.getPaths().get(path).getPost(); - co = codegen.fromOperation(path, "POST", operation, null); - assertTrue(co.pathParams.get(0).isNull); - assertTrue(co.bodyParams.get(0).isNull); - assertTrue(co.responses.get(0).isNull); - } - - @Test - public void testModelGetHasValidation() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_7651.yaml"); - final DefaultCodegen codegen = new DefaultCodegen(); - codegen.setOpenAPI(openAPI); - - Schema sc; - CodegenModel cm; - - List modelNames = Arrays.asList( - "ArrayWithMaxItems", - "ArrayWithMinItems", - "ArrayWithUniqueItems", - "ObjectWithMinProperties", - "ObjectWithMaxProperties", - "StringWithMinLength", - "DateWithMinLength", - "DateTimeWithMinLength", - "ByteWithMinLength", - "BinaryWithMinLength", - "StringWithMaxLength", - "DateWithMaxLength", - "DateTimeWithMaxLength", - "ByteWithMaxLength", - "BinaryWithMaxLength", - "IntegerWithMultipleOf", - "Integer32WithMultipleOf", - "Integer64WithMultipleOf", - "NumberWithMultipleOf", - "NumberFloatWithMultipleOf", - "NumberDoubleWithMultipleOf", - "StringWithPattern", - "DateWithPattern", - "DateTimeWithPattern", - "ByteWithPattern", - "BinaryWithPattern", - "IntegerWithMinimum", - "Integer32WithMinimum", - "Integer64WithMinimum", - "NumberWithMinimum", - "NumberFloatWithMinimum", - "NumberDoubleWithMinimum", - "IntegerWithMaximum", - "Integer32WithMaximum", - "Integer64WithMaximum", - "NumberWithMaximum", - "NumberFloatWithMaximum", - "NumberDoubleWithMaximum", - "IntegerWithExclusiveMaximum", - "Integer32WithExclusiveMaximum", - "Integer64WithExclusiveMaximum", - "NumberWithExclusiveMaximum", - "NumberFloatWithExclusiveMaximum", - "NumberDoubleWithExclusiveMaximum", - "IntegerWithExclusiveMinimum", - "Integer32WithExclusiveMinimum", - "Integer64WithExclusiveMinimum", - "NumberWithExclusiveMinimum", - "NumberFloatWithExclusiveMinimum", - "NumberDoubleWithExclusiveMinimum" - ); - for (String modelName : modelNames) { - sc = openAPI.getComponents().getSchemas().get(modelName); - cm = codegen.fromModel(modelName, sc); - assertTrue(cm.getHasValidation()); - } - } - - @Test - public void testPropertyGetHasValidation() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_7651.yaml"); - final DefaultCodegen codegen = new DefaultCodegen(); - codegen.setOpenAPI(openAPI); - - String modelName = "ObjectWithPropertiesThatHaveValidations"; - Schema sc = openAPI.getComponents().getSchemas().get(modelName); - CodegenModel cm = codegen.fromModel(modelName, sc); - - List props = cm.getVars(); - assertEquals(props.size(), 50); - for (CodegenProperty prop : props) { - assertTrue(prop.getHasValidation()); - } - } - - @Test - public void testQueryParametersGetHasValidation() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_7651.yaml"); - final DefaultCodegen codegen = new DefaultCodegen(); - codegen.setOpenAPI(openAPI); - - String path = "/queryParametersWithValidation"; - Operation operation = openAPI.getPaths().get(path).getPost(); - CodegenOperation co = codegen.fromOperation(path, "POST", operation, null); - List params = co.queryParams; - assertEquals(params.size(), 50); - for (CodegenParameter param : params) { - assertTrue(param.getHasValidation()); - } - } - - @Test - public void testHeaderParametersGetHasValidation() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_7651.yaml"); - final DefaultCodegen codegen = new DefaultCodegen(); - codegen.setOpenAPI(openAPI); - - String path = "/headerParametersWithValidation"; - Operation operation = openAPI.getPaths().get(path).getPost(); - CodegenOperation co = codegen.fromOperation(path, "POST", operation, null); - List params = co.headerParams; - assertEquals(params.size(), 50); - for (CodegenParameter param : params) { - assertTrue(param.getHasValidation()); - } - } - - @Test - public void testCookieParametersGetHasValidation() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_7651.yaml"); - final DefaultCodegen codegen = new DefaultCodegen(); - codegen.setOpenAPI(openAPI); - - String path = "/cookieParametersWithValidation"; - Operation operation = openAPI.getPaths().get(path).getPost(); - CodegenOperation co = codegen.fromOperation(path, "POST", operation, null); - List params = co.cookieParams; - assertEquals(params.size(), 50); - for (CodegenParameter param : params) { - assertTrue(param.getHasValidation()); - } - } - - @Test - public void testPathParametersGetHasValidation() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_7651.yaml"); - final DefaultCodegen codegen = new DefaultCodegen(); - codegen.setOpenAPI(openAPI); - - String path = "/pathParametersWithValidation"; - Operation operation = openAPI.getPaths().get(path).getPost(); - CodegenOperation co = codegen.fromOperation(path, "POST", operation, null); - List params = co.pathParams; - assertEquals(params.size(), 50); - for (CodegenParameter param : params) { - assertTrue(param.getHasValidation()); - } - } - - @Test - public void testBodyAndResponseGetHasValidation() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_7651.yaml"); - final DefaultCodegen codegen = new DefaultCodegen(); - codegen.setOpenAPI(openAPI); - - List modelNames = Arrays.asList( - "ArrayWithMaxItems", - "ArrayWithMinItems", - "ArrayWithUniqueItems", - "ObjectWithMinProperties", - "ObjectWithMaxProperties", - "StringWithMinLength", - "DateWithMinLength", - "DateTimeWithMinLength", - "ByteWithMinLength", - "BinaryWithMinLength", - "StringWithMaxLength", - "DateWithMaxLength", - "DateTimeWithMaxLength", - "ByteWithMaxLength", - "BinaryWithMaxLength", - "StringWithPattern", - "DateWithPattern", - "DateTimeWithPattern", - "ByteWithPattern", - "BinaryWithPattern", - "IntegerWithMultipleOf", - "Integer32WithMultipleOf", - "Integer64WithMultipleOf", - "NumberWithMultipleOf", - "NumberFloatWithMultipleOf", - "NumberDoubleWithMultipleOf", - "IntegerWithMinimum", - "Integer32WithMinimum", - "Integer64WithMinimum", - "NumberWithMinimum", - "NumberFloatWithMinimum", - "NumberDoubleWithMinimum", - "IntegerWithMaximum", - "Integer32WithMaximum", - "Integer64WithMaximum", - "NumberWithMaximum", - "NumberFloatWithMaximum", - "NumberDoubleWithMaximum", - "IntegerWithExclusiveMaximum", - "Integer32WithExclusiveMaximum", - "Integer64WithExclusiveMaximum", - "NumberWithExclusiveMaximum", - "NumberFloatWithExclusiveMaximum", - "NumberDoubleWithExclusiveMaximum", - "IntegerWithExclusiveMinimum", - "Integer32WithExclusiveMinimum", - "Integer64WithExclusiveMinimum", - "NumberWithExclusiveMinimum", - "NumberFloatWithExclusiveMinimum", - "NumberDoubleWithExclusiveMinimum" - ); - - String path; - Operation operation; - CodegenOperation co; - - for (String modelName : modelNames) { - path = "/" + modelName; - operation = openAPI.getPaths().get(path).getPost(); - co = codegen.fromOperation(path, "POST", operation, null); - assertTrue(co.bodyParam.getHasValidation()); - assertTrue(co.responses.get(0).getHasValidation()); - } - } - - @Test - public void testVarsAndRequiredVarsPresent() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_7613.yaml"); - final DefaultCodegen codegen = new DefaultCodegen(); - codegen.setOpenAPI(openAPI); - codegen.setDisallowAdditionalPropertiesIfNotPresent(false); - - String modelName; - Schema sc; - CodegenModel cm; - CodegenProperty propA = codegen.fromProperty("a", new Schema().type("string").minLength(1)); - propA.setRequired(true); - CodegenProperty propB = codegen.fromProperty("b", new Schema().type("string").minLength(1)); - propB.setRequired(true); - CodegenProperty propC = codegen.fromProperty("c", new Schema().type("string").minLength(1)); - propC.setRequired(false); - - List vars = new ArrayList<>(Arrays.asList(propA, propB, propC)); - List requiredVars = new ArrayList<>(Arrays.asList(propA, propB)); - - modelName = "ObjectWithOptionalAndRequiredProps"; - sc = openAPI.getComponents().getSchemas().get(modelName); - cm = codegen.fromModel(modelName, sc); - assertEquals(cm.vars, vars); - assertEquals(cm.requiredVars, requiredVars); - - String path; - Operation operation; - CodegenOperation co; - - path = "/object_with_optional_and_required_props/{objectData}"; - operation = openAPI.getPaths().get(path).getPost(); - co = codegen.fromOperation(path, "POST", operation, null); - assertEquals(co.pathParams.get(0).vars, vars); - assertEquals(co.pathParams.get(0).requiredVars, requiredVars); - assertEquals(co.bodyParams.get(0).vars, vars); - assertEquals(co.bodyParams.get(0).requiredVars, requiredVars); - - // CodegenOperation puts the inline schema into schemas and refs it - assertTrue(co.responses.get(0).isModel); - assertEquals(co.responses.get(0).baseType, "objectWithOptionalAndRequiredProps_request"); - modelName = "objectWithOptionalAndRequiredProps_request"; - sc = openAPI.getComponents().getSchemas().get(modelName); - cm = codegen.fromModel(modelName, sc); - assertEquals(cm.vars, vars); - assertEquals(cm.requiredVars, requiredVars); - - // CodegenProperty puts the inline schema into schemas and refs it - modelName = "ObjectPropContainsProps"; - sc = openAPI.getComponents().getSchemas().get(modelName); - cm = codegen.fromModel(modelName, sc); - CodegenProperty cp = cm.getVars().get(0); - assertTrue(cp.isModel); - assertEquals(cp.complexType, "objectWithOptionalAndRequiredProps_request"); - } - - @Test - public void testHasVarsInModel() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_7613.yaml"); - final DefaultCodegen codegen = new DefaultCodegen(); - codegen.setOpenAPI(openAPI); - codegen.setDisallowAdditionalPropertiesIfNotPresent(false); - - Schema sc; - CodegenModel cm; - List modelNames; - - modelNames = Arrays.asList( - "ArrayWithValidationsInItems", - "ObjectWithValidationsInAdditionalProperties", - "AdditionalPropertiesUnset", - "AdditionalPropertiesTrue", - "AdditionalPropertiesFalse", - "AdditionalPropertiesSchema" - ); - for (String modelName : modelNames) { - sc = openAPI.getComponents().getSchemas().get(modelName); - cm = codegen.fromModel(modelName, sc); - assertFalse(cm.getHasVars()); - } - - modelNames = Arrays.asList( - "ObjectModelWithRefAddPropsInProps", - "ObjectModelWithAddPropsInProps", - "ObjectWithOptionalAndRequiredProps", - "ObjectPropContainsProps" - ); - for (String modelName : modelNames) { - sc = openAPI.getComponents().getSchemas().get(modelName); - cm = codegen.fromModel(modelName, sc); - assertTrue(cm.getHasVars()); - } - } - - @Test - public void testHasVarsInProperty() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_7613.yaml"); - final DefaultCodegen codegen = new DefaultCodegen(); - codegen.setOpenAPI(openAPI); - codegen.setDisallowAdditionalPropertiesIfNotPresent(false); - - Schema sc; - CodegenModel cm; - List modelNames; - - modelNames = Arrays.asList( - "ObjectWithValidationsInArrayPropItems", - "ObjectModelWithRefAddPropsInProps", - "ObjectModelWithAddPropsInProps", - "ObjectWithOptionalAndRequiredProps" - ); - for (String modelName : modelNames) { - sc = openAPI.getComponents().getSchemas().get(modelName); - cm = codegen.fromModel(modelName, sc); - assertFalse(cm.vars.get(0).getHasVars()); - } - - String modelName; - modelName = "ArrayWithObjectWithPropsInItems"; - ArraySchema as = (ArraySchema) openAPI.getComponents().getSchemas().get(modelName); - assertEquals("#/components/schemas/ArrayWithObjectWithPropsInItems_inner", as.getItems().get$ref()); - sc = openAPI.getComponents().getSchemas().get("ArrayWithObjectWithPropsInItems_inner"); - cm = codegen.fromModel(modelName, sc); - assertTrue(cm.getHasVars()); - - modelName = "ObjectWithObjectWithPropsInAdditionalProperties"; - MapSchema ms = (MapSchema) openAPI.getComponents().getSchemas().get(modelName); - assertEquals("#/components/schemas/ArrayWithObjectWithPropsInItems_inner", as.getItems().get$ref()); - sc = openAPI.getComponents().getSchemas().get("ArrayWithObjectWithPropsInItems_inner"); - cm = codegen.fromModel(modelName, sc); - assertTrue(cm.getHasVars()); - } - - @Test - public void testHasVarsInParameter() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_7613.yaml"); - final DefaultCodegen codegen = new DefaultCodegen(); - codegen.setOpenAPI(openAPI); - codegen.setDisallowAdditionalPropertiesIfNotPresent(false); - - String path; - Operation operation; - CodegenOperation co; - - path = "/array_with_validations_in_items/{items}"; - operation = openAPI.getPaths().get(path).getPost(); - co = codegen.fromOperation(path, "POST", operation, null); - assertFalse(co.pathParams.get(0).getHasVars()); - assertFalse(co.bodyParam.getHasVars()); - - path = "/object_with_optional_and_required_props/{objectData}"; - operation = openAPI.getPaths().get(path).getPost(); - co = codegen.fromOperation(path, "POST", operation, null); - assertTrue(co.pathParams.get(0).getHasVars()); - assertTrue(co.bodyParam.getHasVars()); - } - - @Test - public void testHasVarsInResponse() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_7613.yaml"); - final DefaultCodegen codegen = new DefaultCodegen(); - codegen.setOpenAPI(openAPI); - codegen.setDisallowAdditionalPropertiesIfNotPresent(false); - - String path; - Operation operation; - CodegenOperation co; - - path = "/additional_properties/"; - operation = openAPI.getPaths().get(path).getPost(); - co = codegen.fromOperation(path, "POST", operation, null); - assertFalse(co.responses.get(0).getHasVars()); - - path = "/object_with_optional_and_required_props/{objectData}"; - operation = openAPI.getPaths().get(path).getPost(); - co = codegen.fromOperation(path, "POST", operation, null); - // does not have vars because the inline schema was extracted into a component ref - assertFalse(co.responses.get(0).getHasVars()); - } - - @Test - public void testHasRequiredInModel() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_8906.yaml"); - final DefaultCodegen codegen = new DefaultCodegen(); - codegen.setOpenAPI(openAPI); - codegen.setDisallowAdditionalPropertiesIfNotPresent(false); - - Schema sc; - CodegenModel cm; - - List modelNamesWithoutRequired = Arrays.asList( - "EmptyObject", - "ObjectWithOptionalB", - "AnyTypeNoPropertiesNoRequired", - "AnyTypeHasPropertiesNoRequired", - "AnyTypeNoPropertiesHasRequired", // TODO: hasRequired should be true, fix this - "ObjectNoPropertiesNoRequired", - "ObjectHasPropertiesNoRequired", - "ObjectNoPropertiesHasRequired", // TODO: hasRequired should be true, fix this - "ComposedNoAllofPropsNoPropertiesNoRequired", - "ComposedNoAllofPropsHasPropertiesNoRequired", - "ComposedNoAllofPropsNoPropertiesHasRequired", // TODO: hasRequired should be true, fix this - "ComposedHasAllofOptPropNoPropertiesNoRequired", - "ComposedHasAllofOptPropHasPropertiesNoRequired", - "ComposedHasAllofOptPropNoPropertiesHasRequired" // TODO: hasRequired should be true, fix this - ); - for (String modelName : modelNamesWithoutRequired) { - sc = openAPI.getComponents().getSchemas().get(modelName); - cm = codegen.fromModel(modelName, sc); - assertFalse(cm.getHasRequired()); - } - - List modelNamesWithRequired = Arrays.asList( - "AnyTypeHasPropertiesHasRequired", - "ObjectHasPropertiesHasRequired", - "ComposedNoAllofPropsHasPropertiesHasRequired", - "ComposedHasAllofOptPropHasPropertiesHasRequired", - "ComposedHasAllofReqPropNoPropertiesNoRequired", // TODO: hasRequired should be false, fix this - "ComposedHasAllofReqPropHasPropertiesNoRequired", // TODO: hasRequired should be false, fix this - "ComposedHasAllofReqPropNoPropertiesHasRequired", - "ComposedHasAllofReqPropHasPropertiesHasRequired" - ); - for (String modelName : modelNamesWithRequired) { - sc = openAPI.getComponents().getSchemas().get(modelName); - cm = codegen.fromModel(modelName, sc); - assertTrue(cm.getHasRequired()); - } - } - - @Test - public void testHasRequiredInProperties() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_8906.yaml"); - final DefaultCodegen codegen = new DefaultCodegen(); - codegen.setOpenAPI(openAPI); - codegen.setDisallowAdditionalPropertiesIfNotPresent(false); - - String modelName = "CodegenPropertiesModel"; - Schema sc = openAPI.getComponents().getSchemas().get(modelName); - CodegenModel cm = codegen.fromModel(modelName, sc); - - HashSet modelNamesWithoutRequired = new HashSet(Arrays.asList( - "EmptyObject", - "ObjectWithOptionalB", - "AnyTypeNoPropertiesNoRequired", - "AnyTypeHasPropertiesNoRequired", - "AnyTypeNoPropertiesHasRequired", // TODO: hasRequired should be true, fix this - "AnyTypeHasPropertiesHasRequired", // TODO: hasRequired should be true, fix this - "ObjectNoPropertiesNoRequired", - "ObjectHasPropertiesNoRequired", // Note: this is extracted into another component and is a ref - "ObjectNoPropertiesHasRequired", // TODO: hasRequired should be true, fix this - "ComposedNoAllofPropsNoPropertiesNoRequired", - "ComposedNoAllofPropsHasPropertiesNoRequired", - "ComposedNoAllofPropsNoPropertiesHasRequired", // TODO: hasRequired should be true, fix this - "ComposedHasAllofOptPropNoPropertiesNoRequired", - "ComposedHasAllofOptPropHasPropertiesNoRequired", - "ComposedHasAllofOptPropNoPropertiesHasRequired", // TODO: hasRequired should be true, fix this - "ObjectHasPropertiesHasRequired", // False because this is extracted into another component and is a ref - "ComposedNoAllofPropsHasPropertiesHasRequired", // False because this is extracted into another component and is a ref - "ComposedHasAllofOptPropHasPropertiesHasRequired", // TODO: hasRequired should be true, fix this - "ComposedHasAllofReqPropNoPropertiesNoRequired", - "ComposedHasAllofReqPropHasPropertiesNoRequired", - "ComposedHasAllofReqPropNoPropertiesHasRequired", // TODO: hasRequired should be true, fix this - "ComposedHasAllofReqPropHasPropertiesHasRequired" // TODO: hasRequired should be true, fix this - )); - HashSet modelNamesWithRequired = new HashSet(Arrays.asList( - )); - for (CodegenProperty var : cm.getVars()) { - boolean hasRequired = var.getHasRequired(); - if (modelNamesWithoutRequired.contains(var.name)) { - assertFalse(hasRequired); - } else if (modelNamesWithRequired.contains(var.name)) { - assertTrue(hasRequired); - } else { - // All variables must be in the above sets - fail(); - } - } - } - - @Test - public void testHasRequiredInParameters() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_8906.yaml"); - final DefaultCodegen codegen = new DefaultCodegen(); - codegen.setOpenAPI(openAPI); - codegen.setDisallowAdditionalPropertiesIfNotPresent(false); - - String path = "/schemasInQueryParamsAndResponses"; - Operation operation = openAPI.getPaths().get(path).getPost(); - CodegenOperation co = codegen.fromOperation(path, "POST", operation, null); - - HashSet modelNamesWithoutRequired = new HashSet(Arrays.asList( - "EmptyObject", - "ObjectWithOptionalB", - "AnyTypeNoPropertiesNoRequired", - "AnyTypeHasPropertiesNoRequired", - "AnyTypeNoPropertiesHasRequired", // TODO: hasRequired should be true, fix this - "AnyTypeHasPropertiesHasRequired", // TODO: hasRequired should be true, fix this - "ObjectNoPropertiesNoRequired", - "ObjectHasPropertiesNoRequired", // Note: this is extracted into another component and is a ref - "ObjectNoPropertiesHasRequired", // TODO: hasRequired should be true, fix this - "ComposedNoAllofPropsNoPropertiesNoRequired", - "ComposedNoAllofPropsHasPropertiesNoRequired", - "ComposedNoAllofPropsNoPropertiesHasRequired", // TODO: hasRequired should be true, fix this - "ComposedHasAllofOptPropNoPropertiesNoRequired", - "ComposedHasAllofOptPropHasPropertiesNoRequired", - "ComposedHasAllofOptPropNoPropertiesHasRequired", // TODO: hasRequired should be true, fix this - "ObjectHasPropertiesHasRequired", // False because this is extracted into another component and is a ref - "ComposedNoAllofPropsHasPropertiesHasRequired", // False because this is extracted into another component and is a ref - "ComposedHasAllofOptPropHasPropertiesHasRequired", // TODO: hasRequired should be true, fix this - "ComposedHasAllofReqPropNoPropertiesNoRequired", - "ComposedHasAllofReqPropHasPropertiesNoRequired", - "ComposedHasAllofReqPropNoPropertiesHasRequired", // TODO: hasRequired should be true, fix this - "ComposedHasAllofReqPropHasPropertiesHasRequired" // TODO: hasRequired should be true, fix this - )); - HashSet modelNamesWithRequired = new HashSet(Arrays.asList( - )); - for (CodegenParameter param : co.pathParams) { - boolean hasRequired = param.getHasRequired(); - if (modelNamesWithoutRequired.contains(param.baseName)) { - assertFalse(hasRequired); - } else if (modelNamesWithRequired.contains(param.baseName)) { - assertTrue(hasRequired); - } else { - // All variables must be in the above sets - fail(); - } - } - } - - @Test - public void testHasRequiredInResponses() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_8906.yaml"); - final DefaultCodegen codegen = new DefaultCodegen(); - codegen.setOpenAPI(openAPI); - codegen.setDisallowAdditionalPropertiesIfNotPresent(false); - - String path = "/schemasInQueryParamsAndResponses"; - Operation operation = openAPI.getPaths().get(path).getPost(); - CodegenOperation co = codegen.fromOperation(path, "POST", operation, null); - - HashSet modelNamesWithoutRequired = new HashSet(Arrays.asList( - "EmptyObject", - "ObjectWithOptionalB", - "AnyTypeNoPropertiesNoRequired", - "AnyTypeHasPropertiesNoRequired", - "AnyTypeNoPropertiesHasRequired", // TODO: hasRequired should be true, fix this - "AnyTypeHasPropertiesHasRequired", // TODO: hasRequired should be true, fix this - "ObjectNoPropertiesNoRequired", - "ObjectHasPropertiesNoRequired", // Note: this is extracted into another component and is a ref - "ObjectNoPropertiesHasRequired", // TODO: hasRequired should be true, fix this - "ComposedNoAllofPropsNoPropertiesNoRequired", - "ComposedNoAllofPropsHasPropertiesNoRequired", - "ComposedNoAllofPropsNoPropertiesHasRequired", // TODO: hasRequired should be true, fix this - "ComposedHasAllofOptPropNoPropertiesNoRequired", - "ComposedHasAllofOptPropHasPropertiesNoRequired", - "ComposedHasAllofOptPropNoPropertiesHasRequired", // TODO: hasRequired should be true, fix this - "ObjectHasPropertiesHasRequired", // False because this is extracted into another component and is a ref - "ComposedNoAllofPropsHasPropertiesHasRequired", // False because this is extracted into another component and is a ref - "ComposedHasAllofOptPropHasPropertiesHasRequired", // TODO: hasRequired should be true, fix this - "ComposedHasAllofReqPropNoPropertiesNoRequired", - "ComposedHasAllofReqPropHasPropertiesNoRequired", - "ComposedHasAllofReqPropNoPropertiesHasRequired", // TODO: hasRequired should be true, fix this - "ComposedHasAllofReqPropHasPropertiesHasRequired" // TODO: hasRequired should be true, fix this - )); - HashSet modelNamesWithRequired = new HashSet(Arrays.asList( - )); - for (CodegenResponse cr : co.responses) { - boolean hasRequired = cr.getHasRequired(); - if (modelNamesWithoutRequired.contains(cr.message)) { - assertFalse(hasRequired); - } else if (modelNamesWithRequired.contains(cr.message)) { - assertTrue(hasRequired); - } else { - // All variables must be in the above sets - fail(); - } - } - } - - @Test - public void testBooleansSetForIntSchemas() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_9447.yaml"); - final DefaultCodegen codegen = new DefaultCodegen(); - codegen.setOpenAPI(openAPI); - codegen.setDisallowAdditionalPropertiesIfNotPresent(false); - - String modelName; - Schema sc; - CodegenModel cm; - - modelName = "UnboundedInteger"; - sc = openAPI.getComponents().getSchemas().get(modelName); - cm = codegen.fromModel(modelName, sc); - assertTrue(cm.isUnboundedInteger); - assertTrue(cm.isInteger); - assertFalse(cm.isShort); - assertFalse(cm.isLong); - - modelName = "Int32"; - sc = openAPI.getComponents().getSchemas().get(modelName); - cm = codegen.fromModel(modelName, sc); - assertFalse(cm.isUnboundedInteger); - assertTrue(cm.isInteger); - assertTrue(cm.isShort); - assertFalse(cm.isLong); - - modelName = "Int64"; - sc = openAPI.getComponents().getSchemas().get(modelName); - cm = codegen.fromModel(modelName, sc); - assertFalse(cm.isUnboundedInteger); - assertFalse(cm.isInteger); - assertFalse(cm.isShort); - assertTrue(cm.isLong); - - modelName = "ObjectModelWithIntegerProps"; - sc = openAPI.getComponents().getSchemas().get(modelName); - cm = codegen.fromModel(modelName, sc); - assertFalse(cm.isUnboundedInteger); - assertFalse(cm.isInteger); - assertFalse(cm.isShort); - assertFalse(cm.isLong); - CodegenProperty cp; - cp = cm.vars.get(0); - assertTrue(cp.isUnboundedInteger); - assertTrue(cp.isInteger); - assertFalse(cp.isShort); - assertFalse(cp.isLong); - cp = cm.vars.get(1); - assertFalse(cp.isUnboundedInteger); - assertTrue(cp.isInteger); - assertTrue(cp.isShort); - assertFalse(cp.isLong); - cp = cm.vars.get(2); - assertFalse(cp.isUnboundedInteger); - assertFalse(cp.isInteger); - assertFalse(cp.isShort); - assertTrue(cp.isLong); - - String path; - Operation operation; - CodegenOperation co; - CodegenParameter cpa; - CodegenResponse cr; - - path = "/UnboundedInteger"; - operation = openAPI.getPaths().get(path).getPost(); - co = codegen.fromOperation(path, "POST", operation, null); - cpa = co.pathParams.get(0); - assertTrue(cpa.isUnboundedInteger); - assertTrue(cpa.isInteger); - assertFalse(cpa.isShort); - assertFalse(cpa.isLong); - cpa = co.bodyParam; - assertTrue(cpa.isUnboundedInteger); - assertTrue(cpa.isInteger); - assertFalse(cpa.isShort); - assertFalse(cpa.isLong); - cr = co.responses.get(0); - assertTrue(cr.isUnboundedInteger); - assertTrue(cr.isInteger); - assertFalse(cr.isShort); - assertFalse(cr.isLong); - - path = "/Int32"; - operation = openAPI.getPaths().get(path).getPost(); - co = codegen.fromOperation(path, "POST", operation, null); - cpa = co.pathParams.get(0); - assertFalse(cpa.isUnboundedInteger); - assertTrue(cpa.isInteger); - assertTrue(cpa.isShort); - assertFalse(cpa.isLong); - cpa = co.bodyParam; - assertFalse(cpa.isUnboundedInteger); - assertTrue(cpa.isInteger); - assertTrue(cpa.isShort); - assertFalse(cpa.isLong); - cr = co.responses.get(0); - assertFalse(cr.isUnboundedInteger); - assertTrue(cr.isInteger); - assertTrue(cr.isShort); - assertFalse(cr.isLong); - - path = "/Int64"; - operation = openAPI.getPaths().get(path).getPost(); - co = codegen.fromOperation(path, "POST", operation, null); - cpa = co.pathParams.get(0); - assertFalse(cpa.isUnboundedInteger); - assertFalse(cpa.isInteger); - assertFalse(cpa.isShort); - assertTrue(cpa.isLong); - cpa = co.bodyParam; - assertFalse(cpa.isUnboundedInteger); - assertFalse(cpa.isInteger); - assertFalse(cpa.isShort); - assertTrue(cpa.isLong); - cr = co.responses.get(0); - assertFalse(cr.isUnboundedInteger); - assertFalse(cr.isInteger); - assertFalse(cr.isShort); - assertTrue(cr.isLong); - } - - @Test - public void testRemoveOperationIdPrefix() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/bugs/issue_9719.yaml"); - final DefaultCodegen codegen = new DefaultCodegen(); - codegen.setOpenAPI(openAPI); - codegen.setDisallowAdditionalPropertiesIfNotPresent(false); - - String path; - Operation operation; - CodegenOperation co; - - codegen.additionalProperties().put(CodegenConstants.REMOVE_OPERATION_ID_PREFIX, "True"); - codegen.additionalProperties().put(CodegenConstants.REMOVE_OPERATION_ID_PREFIX_DELIMITER, "."); - codegen.additionalProperties().put(CodegenConstants.REMOVE_OPERATION_ID_PREFIX_COUNT, 2); - codegen.processOpts(); - path = "/dotDelimiter"; - operation = openAPI.getPaths().get(path).getGet(); - co = codegen.fromOperation(path, "GET", operation, null); - assertEquals(co.operationId, "usersGetAll"); - - codegen.additionalProperties().put(CodegenConstants.REMOVE_OPERATION_ID_PREFIX, "True"); - codegen.additionalProperties().put(CodegenConstants.REMOVE_OPERATION_ID_PREFIX_DELIMITER, "."); - codegen.additionalProperties().put(CodegenConstants.REMOVE_OPERATION_ID_PREFIX_COUNT, -1); - codegen.processOpts(); - path = "/dotDelimiter"; - operation = openAPI.getPaths().get(path).getGet(); - co = codegen.fromOperation(path, "GET", operation, null); - assertEquals(co.operationId, "getAll"); - - codegen.additionalProperties().put(CodegenConstants.REMOVE_OPERATION_ID_PREFIX, "True"); - codegen.additionalProperties().put(CodegenConstants.REMOVE_OPERATION_ID_PREFIX_DELIMITER, "."); - codegen.additionalProperties().put(CodegenConstants.REMOVE_OPERATION_ID_PREFIX_COUNT, 10); - codegen.processOpts(); - path = "/dotDelimiter"; - operation = openAPI.getPaths().get(path).getGet(); - co = codegen.fromOperation(path, "GET", operation, null); - assertEquals(co.operationId, "getAll"); - - codegen.additionalProperties().put(CodegenConstants.REMOVE_OPERATION_ID_PREFIX, "True"); - codegen.additionalProperties().put(CodegenConstants.REMOVE_OPERATION_ID_PREFIX_DELIMITER, "_"); - codegen.additionalProperties().put(CodegenConstants.REMOVE_OPERATION_ID_PREFIX_COUNT, 2); - codegen.processOpts(); - path = "/underscoreDelimiter"; - operation = openAPI.getPaths().get(path).getGet(); - co = codegen.fromOperation(path, "GET", operation, null); - assertEquals(co.operationId, "usersGetAll"); - - codegen.additionalProperties().put(CodegenConstants.REMOVE_OPERATION_ID_PREFIX, "True"); - codegen.additionalProperties().put(CodegenConstants.REMOVE_OPERATION_ID_PREFIX_DELIMITER, "_"); - codegen.additionalProperties().put(CodegenConstants.REMOVE_OPERATION_ID_PREFIX_COUNT, -1); - codegen.processOpts(); - path = "/underscoreDelimiter"; - operation = openAPI.getPaths().get(path).getGet(); - co = codegen.fromOperation(path, "GET", operation, null); - assertEquals(co.operationId, "getAll"); - - codegen.additionalProperties().put(CodegenConstants.REMOVE_OPERATION_ID_PREFIX, "True"); - codegen.additionalProperties().put(CodegenConstants.REMOVE_OPERATION_ID_PREFIX_DELIMITER, "_"); - codegen.additionalProperties().put(CodegenConstants.REMOVE_OPERATION_ID_PREFIX_COUNT, 10); - codegen.processOpts(); - path = "/underscoreDelimiter"; - operation = openAPI.getPaths().get(path).getGet(); - co = codegen.fromOperation(path, "GET", operation, null); - assertEquals(co.operationId, "getAll"); - } - - @Test - @Ignore - public void testComposedPropertyTypes() { - DefaultCodegen codegen = new DefaultCodegen(); - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_10330.yaml"); - codegen.setOpenAPI(openAPI); - String modelName; - - modelName = "ObjectWithComposedProperties"; - CodegenModel m = codegen.fromModel(modelName, openAPI.getComponents().getSchemas().get(modelName)); - /* TODO inline allOf schema are created as separate models and the following assumptions that - the properties are non-model are no longer valid and need to be revised - assertTrue(m.vars.get(0).getIsMap()); - assertTrue(m.vars.get(1).getIsNumber()); - assertTrue(m.vars.get(2).getIsUnboundedInteger()); - assertTrue(m.vars.get(3).getIsString()); - assertTrue(m.vars.get(4).getIsBoolean()); - assertTrue(m.vars.get(5).getIsArray()); - assertTrue(m.vars.get(6).getIsNull()); - assertTrue(m.vars.get(7).getIsAnyType()); - */ - } - - @Test - public void testComposedModelTypes() { - DefaultCodegen codegen = new DefaultCodegen(); - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_10330.yaml"); - codegen.setOpenAPI(openAPI); - String modelName; - CodegenModel m; - - modelName = "ComposedObject"; - m = codegen.fromModel(modelName, openAPI.getComponents().getSchemas().get(modelName)); - assertTrue(m.getIsMap()); - - modelName = "ComposedNumber"; - m = codegen.fromModel(modelName, openAPI.getComponents().getSchemas().get(modelName)); - assertTrue(m.getIsNumber()); - - modelName = "ComposedInteger"; - m = codegen.fromModel(modelName, openAPI.getComponents().getSchemas().get(modelName)); - assertTrue(m.getIsUnboundedInteger()); - - modelName = "ComposedString"; - m = codegen.fromModel(modelName, openAPI.getComponents().getSchemas().get(modelName)); - assertTrue(m.getIsString()); - - modelName = "ComposedBool"; - m = codegen.fromModel(modelName, openAPI.getComponents().getSchemas().get(modelName)); - assertTrue(m.getIsBoolean()); - - modelName = "ComposedArray"; - m = codegen.fromModel(modelName, openAPI.getComponents().getSchemas().get(modelName)); - assertTrue(m.getIsArray()); - - modelName = "ComposedNone"; - m = codegen.fromModel(modelName, openAPI.getComponents().getSchemas().get(modelName)); - assertTrue(m.getIsNull()); - - modelName = "ComposedAnyType"; - m = codegen.fromModel(modelName, openAPI.getComponents().getSchemas().get(modelName)); - assertTrue(m.getIsAnyType()); - } - - @Test - public void testComposedResponseTypes() { - DefaultCodegen codegen = new DefaultCodegen(); - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_10330.yaml"); - codegen.setOpenAPI(openAPI); - String path; - CodegenOperation co; - CodegenResponse cr; - - path = "/ComposedObject"; - co = codegen.fromOperation(path, "GET", openAPI.getPaths().get(path).getGet(), null); - cr = co.responses.get(0); - assertTrue(cr.getIsMap()); - - path = "/ComposedNumber"; - co = codegen.fromOperation(path, "GET", openAPI.getPaths().get(path).getGet(), null); - cr = co.responses.get(0); - assertTrue(cr.getIsNumber()); - - path = "/ComposedInteger"; - co = codegen.fromOperation(path, "GET", openAPI.getPaths().get(path).getGet(), null); - cr = co.responses.get(0); - assertTrue(cr.getIsUnboundedInteger()); - - path = "/ComposedString"; - co = codegen.fromOperation(path, "GET", openAPI.getPaths().get(path).getGet(), null); - cr = co.responses.get(0); - assertTrue(cr.getIsString()); - - path = "/ComposedBool"; - co = codegen.fromOperation(path, "GET", openAPI.getPaths().get(path).getGet(), null); - cr = co.responses.get(0); - assertTrue(cr.getIsBoolean()); - - path = "/ComposedArray"; - co = codegen.fromOperation(path, "GET", openAPI.getPaths().get(path).getGet(), null); - cr = co.responses.get(0); - assertTrue(cr.getIsArray()); - - path = "/ComposedNone"; - co = codegen.fromOperation(path, "GET", openAPI.getPaths().get(path).getGet(), null); - cr = co.responses.get(0); - assertTrue(cr.getIsNull()); - - path = "/ComposedAnyType"; - co = codegen.fromOperation(path, "GET", openAPI.getPaths().get(path).getGet(), null); - cr = co.responses.get(0); - assertTrue(cr.getIsAnyType()); - } - - @Test - public void testComposedRequestBodyTypes() { - DefaultCodegen codegen = new DefaultCodegen(); - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_10330.yaml"); - codegen.setOpenAPI(openAPI); - String path; - CodegenOperation co; - CodegenParameter cp; - - path = "/ComposedObject"; - co = codegen.fromOperation(path, "GET", openAPI.getPaths().get(path).getGet(), null); - cp = co.bodyParam; - assertTrue(cp.getIsMap()); - - path = "/ComposedNumber"; - co = codegen.fromOperation(path, "GET", openAPI.getPaths().get(path).getGet(), null); - cp = co.bodyParam; - assertTrue(cp.getIsNumber()); - - path = "/ComposedInteger"; - co = codegen.fromOperation(path, "GET", openAPI.getPaths().get(path).getGet(), null); - cp = co.bodyParam; - assertTrue(cp.getIsUnboundedInteger()); - - path = "/ComposedString"; - co = codegen.fromOperation(path, "GET", openAPI.getPaths().get(path).getGet(), null); - cp = co.bodyParam; - assertTrue(cp.getIsString()); - - path = "/ComposedBool"; - co = codegen.fromOperation(path, "GET", openAPI.getPaths().get(path).getGet(), null); - cp = co.bodyParam; - assertTrue(cp.getIsBoolean()); - - path = "/ComposedArray"; - co = codegen.fromOperation(path, "GET", openAPI.getPaths().get(path).getGet(), null); - cp = co.bodyParam; - assertTrue(cp.getIsArray()); - - path = "/ComposedNone"; - co = codegen.fromOperation(path, "GET", openAPI.getPaths().get(path).getGet(), null); - cp = co.bodyParam; - assertTrue(cp.getIsNull()); - - path = "/ComposedAnyType"; - co = codegen.fromOperation(path, "GET", openAPI.getPaths().get(path).getGet(), null); - cp = co.bodyParam; - assertTrue(cp.getIsAnyType()); - } - - @Test - public void testComposedRequestQueryParamTypes() { - DefaultCodegen codegen = new DefaultCodegen(); - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_10330.yaml"); - codegen.setOpenAPI(openAPI); - String path; - CodegenOperation co; - CodegenParameter cp; - - path = "/ComposedObject"; - co = codegen.fromOperation(path, "GET", openAPI.getPaths().get(path).getGet(), null); - cp = co.queryParams.get(0); - assertTrue(cp.getIsMap()); - - path = "/ComposedNumber"; - co = codegen.fromOperation(path, "GET", openAPI.getPaths().get(path).getGet(), null); - cp = co.queryParams.get(0); - assertTrue(cp.getIsNumber()); - - path = "/ComposedInteger"; - co = codegen.fromOperation(path, "GET", openAPI.getPaths().get(path).getGet(), null); - cp = co.queryParams.get(0); - assertTrue(cp.getIsUnboundedInteger()); - - path = "/ComposedString"; - co = codegen.fromOperation(path, "GET", openAPI.getPaths().get(path).getGet(), null); - cp = co.queryParams.get(0); - assertTrue(cp.getIsString()); - - path = "/ComposedBool"; - co = codegen.fromOperation(path, "GET", openAPI.getPaths().get(path).getGet(), null); - cp = co.queryParams.get(0); - assertTrue(cp.getIsBoolean()); - - path = "/ComposedArray"; - co = codegen.fromOperation(path, "GET", openAPI.getPaths().get(path).getGet(), null); - cp = co.queryParams.get(0); - assertTrue(cp.getIsArray()); - - path = "/ComposedNone"; - co = codegen.fromOperation(path, "GET", openAPI.getPaths().get(path).getGet(), null); - cp = co.queryParams.get(0); - assertTrue(cp.getIsNull()); - - path = "/ComposedAnyType"; - co = codegen.fromOperation(path, "GET", openAPI.getPaths().get(path).getGet(), null); - cp = co.queryParams.get(0); - assertTrue(cp.getIsAnyType()); - } - - @Test - public void testByteArrayTypeInSchemas() { - DefaultCodegen codegen = new DefaultCodegen(); - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_10725.yaml"); - codegen.setOpenAPI(openAPI); - String path; - CodegenOperation co; - CodegenParameter cp; - - path = "/TxRxByteArray"; - co = codegen.fromOperation(path, "POST", openAPI.getPaths().get(path).getPost(), null); - cp = co.bodyParam; - assertTrue(cp.isByteArray); - assertFalse(cp.getIsString()); - CodegenResponse cr = co.responses.get(0); - assertTrue(cr.isByteArray); - assertFalse(cr.getIsString()); - - String modelName = "ObjectContainingByteArray"; - CodegenModel m = codegen.fromModel(modelName, openAPI.getComponents().getSchemas().get(modelName)); - CodegenProperty pr = m.vars.get(0); - assertTrue(pr.isByteArray); - assertFalse(pr.getIsString()); - } - - @Test - public void testResponses() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/response-tests.yaml"); - final DefaultCodegen codegen = new DefaultCodegen(); - codegen.setOpenAPI(openAPI); - codegen.setDisallowAdditionalPropertiesIfNotPresent(false); - - String path; - Operation operation; - CodegenOperation co; - CodegenParameter cpa; - CodegenResponse cr; - - path = "/pet/{petId}"; - operation = openAPI.getPaths().get(path).getGet(); - co = codegen.fromOperation(path, "GET", operation, null); - //assertTrue(co.hasErrorResponseObject); - cr = co.responses.get(0); - assertTrue(cr.is2xx); - assertFalse(cr.simpleType); - assertFalse(cr.primitiveType); - cr = co.responses.get(3); - assertTrue(cr.is5xx); - assertFalse(cr.simpleType); - assertFalse(cr.primitiveType); - - path = "/pet"; - operation = openAPI.getPaths().get(path).getPut(); - co = codegen.fromOperation(path, "PUT", operation, null); - assertTrue(co.hasErrorResponseObject); - - // 200 response - cr = co.responses.get(0); - assertTrue(cr.is2xx); - assertFalse(cr.simpleType); - assertFalse(cr.primitiveType); - - // 400 response - cr = co.responses.get(1); - assertTrue(cr.is4xx); - assertEquals(cr.code, "400"); - assertFalse(cr.simpleType); - assertFalse(cr.primitiveType); - - path = "/pet/findByTags"; - operation = openAPI.getPaths().get(path).getGet(); - co = codegen.fromOperation(path, "GET", operation, null); - assertFalse(co.hasErrorResponseObject); - cr = co.responses.get(0); - assertTrue(cr.is2xx); - assertFalse(cr.simpleType); - assertFalse(cr.primitiveType); - } - - @Test - public void testRequestParameterContent() { - DefaultCodegen codegen = new DefaultCodegen(); - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/content-data.yaml"); - codegen.setOpenAPI(openAPI); - String path; - CodegenOperation co; - - path = "/jsonQueryParams"; - co = codegen.fromOperation(path, "GET", openAPI.getPaths().get(path).getGet(), null); - CodegenParameter coordinatesInlineSchema = co.queryParams.get(0); - LinkedHashMap content = coordinatesInlineSchema.getContent(); - assertNotNull(content); - assertEquals(content.keySet(), new HashSet<>(Arrays.asList("application/json"))); - CodegenMediaType mt = content.get("application/json"); - assertNull(mt.getEncoding()); - CodegenProperty cp = mt.getSchema(); - // TODO need to revise the test below - assertTrue(cp.isMap); - assertTrue(cp.isModel); - assertEquals(cp.complexType, "object"); - assertEquals(cp.baseName, "SchemaForRequestParameterCoordinatesInlineSchemaApplicationJson"); - - CodegenParameter coordinatesReferencedSchema = co.queryParams.get(1); - content = coordinatesReferencedSchema.getContent(); - mt = content.get("application/json"); - assertNull(mt.getEncoding()); - cp = mt.getSchema(); - assertFalse(cp.isMap); // because it is a referenced schema - assertEquals(cp.complexType, "coordinates"); - assertEquals(cp.baseName, "SchemaForRequestParameterCoordinatesReferencedSchemaApplicationJson"); - } - - @Test - public void testRequestBodyContent() { - DefaultCodegen codegen = new DefaultCodegen(); - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/content-data.yaml"); - codegen.setOpenAPI(openAPI); - String path; - CodegenOperation co; - - path = "/inlineRequestBodySchemasDifferingByContentType"; - co = codegen.fromOperation(path, "POST", openAPI.getPaths().get(path).getPost(), null); - CodegenParameter bodyParameter = co.bodyParam; - LinkedHashMap content = bodyParameter.getContent(); - assertNotNull(content); - assertEquals(content.keySet(), new HashSet<>(Arrays.asList("application/json", "text/plain"))); - CodegenMediaType mt = content.get("application/json"); - assertNull(mt.getEncoding()); - CodegenProperty cp = mt.getSchema(); - assertEquals(cp.baseName, "SchemaForRequestBodyApplicationJson"); - assertNotNull(cp); - - mt = content.get("text/plain"); - assertNull(mt.getEncoding()); - cp = mt.getSchema(); - assertEquals(cp.baseName, "SchemaForRequestBodyTextPlain"); - assertNotNull(cp); - // Note: the inline model resolver has a bug for this use case; it extracts an inline request body into a component - // but the schema it references is not string type - - path = "/refRequestBodySchemasDifferingByContentType"; - co = codegen.fromOperation(path, "POST", openAPI.getPaths().get(path).getPost(), null); - bodyParameter = co.bodyParam; - content = bodyParameter.getContent(); - assertNotNull(content); - assertEquals(content.keySet(), new HashSet<>(Arrays.asList("application/json", "text/plain"))); - mt = content.get("application/json"); - assertNull(mt.getEncoding()); - cp = mt.getSchema(); - assertEquals(cp.baseName, "SchemaForRequestBodyApplicationJson"); - assertEquals(cp.complexType, "coordinates"); - - mt = content.get("text/plain"); - assertNull(mt.getEncoding()); - cp = mt.getSchema(); - assertEquals(cp.baseName, "SchemaForRequestBodyTextPlain"); - assertTrue(cp.isString); - - path = "/requestBodyWithEncodingTypes"; - co = codegen.fromOperation(path, "POST", openAPI.getPaths().get(path).getPost(), null); - List formParams = co.formParams; - - assertEquals(formParams.get(0).paramName, "intParam"); - assertFalse(formParams.get(0).isContainer); - assertFalse(formParams.get(0).isExplode); // Should not be true for non-container - - assertEquals(formParams.get(1).paramName, "explodeTrue"); - assertTrue(formParams.get(1).isContainer); - assertEquals(formParams.get(1).style, Encoding.StyleEnum.FORM.toString()); - assertTrue(formParams.get(1).isExplode); - assertNull(formParams.get(1).contentType); - - assertEquals(formParams.get(2).paramName, "explodeFalse"); - assertTrue(formParams.get(2).isContainer); - assertEquals(formParams.get(2).style, Encoding.StyleEnum.FORM.toString()); - assertFalse(formParams.get(2).isExplode); - assertNull(formParams.get(2).contentType); - - assertEquals(formParams.get(3).paramName, "noStyleNoExplode"); - assertTrue(formParams.get(3).isContainer); - assertEquals(formParams.get(3).style, Encoding.StyleEnum.FORM.toString()); - assertTrue(formParams.get(3).isExplode); // Defaults to true for style == FORM - assertEquals(formParams.get(3).contentType, "text/plain"); - - assertEquals(formParams.get(4).paramName, "styleSpecified"); - assertTrue(formParams.get(4).isContainer); - assertEquals(formParams.get(4).style, Encoding.StyleEnum.SPACE_DELIMITED.toString()); - assertFalse(formParams.get(4).isExplode); - assertNull(formParams.get(4).contentType); - - assertEquals(formParams.get(5).paramName, "styleSpecifiedNoExplode"); - assertTrue(formParams.get(5).isContainer); - assertEquals(formParams.get(5).style, Encoding.StyleEnum.SPACE_DELIMITED.toString()); - assertFalse(formParams.get(5).isExplode); // Defaults to false for style other than FORM - assertNull(formParams.get(5).contentType); - } - - @Test - public void testResponseContentAndHeader() { - DefaultCodegen codegen = new DefaultCodegen(); - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/content-data.yaml"); - codegen.setOpenAPI(openAPI); - String path; - CodegenOperation co; - - path = "/jsonQueryParams"; - co = codegen.fromOperation(path, "GET", openAPI.getPaths().get(path).getGet(), null); - CodegenParameter coordinatesInlineSchema = co.queryParams.get(0); - LinkedHashMap content = coordinatesInlineSchema.getContent(); - assertNotNull(content); - assertEquals(content.keySet(), new HashSet<>(Arrays.asList("application/json"))); - - CodegenParameter schemaParam = co.queryParams.get(2); - assertEquals(schemaParam.getSchema().baseName, "stringWithMinLength"); - - - CodegenResponse cr = co.responses.get(0); - List responseHeaders = cr.getResponseHeaders(); - assertEquals(2, responseHeaders.size()); - CodegenParameter header1 = responseHeaders.get(0); - assertEquals("X-Rate-Limit", header1.baseName); - assertTrue(header1.isUnboundedInteger); - assertEquals(header1.getSchema().baseName, "X-Rate-Limit"); - - CodegenParameter header2 = responseHeaders.get(1); - assertEquals("X-Rate-Limit-Ref", header2.baseName); - assertTrue(header2.isUnboundedInteger); - assertEquals(header2.getSchema().baseName, "X-Rate-Limit-Ref"); - - content = cr.getContent(); - assertEquals(content.keySet(), new HashSet<>(Arrays.asList("application/json", "text/plain"))); - CodegenMediaType mt = content.get("application/json"); - assertNull(mt.getEncoding()); - CodegenProperty cp = mt.getSchema(); - assertFalse(cp.isMap); // because it is a referenced schema - assertEquals(cp.complexType, "coordinates"); - assertEquals(cp.baseName, "SchemaFor200ResponseBodyApplicationJson"); - - mt = content.get("text/plain"); - assertNull(mt.getEncoding()); - cp = mt.getSchema(); - assertEquals(cp.baseName, "SchemaFor200ResponseBodyTextPlain"); - assertTrue(cp.isString); - - cr = co.responses.get(1); - content = cr.getContent(); - assertEquals(content.keySet(), new HashSet<>(Arrays.asList("application/json", "text/plain"))); - mt = content.get("application/json"); - assertNull(mt.getEncoding()); - cp = mt.getSchema(); - assertFalse(cp.isMap); // because it is a referenced schema - assertEquals(cp.complexType, "coordinates"); - assertEquals(cp.baseName, "SchemaFor201ResponseBodyApplicationJson"); - - mt = content.get("text/plain"); - assertNull(mt.getEncoding()); - cp = mt.getSchema(); - assertEquals(cp.baseName, "SchemaFor201ResponseBodyTextPlain"); - assertTrue(cp.isString); - } - - @Test - public void testUnalias() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/schema-unalias-test.yml"); - final DefaultCodegen codegen = new DefaultCodegen(); - codegen.setOpenAPI(openAPI); - - Schema requestBodySchema = ModelUtils.getSchemaFromRequestBody( - openAPI.getPaths().get("/thingy/{date}").getPost().getRequestBody()); - Assert.assertEquals(requestBodySchema.get$ref(), "#/components/schemas/updatePetWithForm_request"); - Assert.assertEquals(ModelUtils.getSimpleRef(requestBodySchema.get$ref()), "updatePetWithForm_request"); - Assert.assertNotNull(openAPI.getComponents().getSchemas().get(ModelUtils.getSimpleRef(requestBodySchema.get$ref()))); - - Schema requestBodySchema2 = ModelUtils.unaliasSchema(openAPI, requestBodySchema); - // get$ref is not null as unaliasSchem returns the schema with the last $ref to the actual schema - Assert.assertNotNull(requestBodySchema2.get$ref()); - Assert.assertEquals(requestBodySchema2.get$ref(), "#/components/schemas/updatePetWithForm_request"); - - Schema requestBodySchema3 = ModelUtils.getReferencedSchema(openAPI, requestBodySchema); - CodegenParameter codegenParameter = codegen.fromFormProperty("visitDate", - (Schema) requestBodySchema3.getProperties().get("visitDate"), new HashSet<>()); - - Assert.assertEquals(codegenParameter.defaultValue, "1971-12-19T03:39:57-08:00"); - Assert.assertEquals(codegenParameter.getSchema(), null); - } - - @Test - public void testFromPropertyRequiredAndOptional() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_12857.yaml"); - final DefaultCodegen codegen = new DefaultCodegen(); - codegen.setOpenAPI(openAPI); - codegen.setDisallowAdditionalPropertiesIfNotPresent(false); - - String modelName = "FooRequired"; - Schema sc = openAPI.getComponents().getSchemas().get(modelName); - CodegenModel fooRequired = codegen.fromModel(modelName, sc); - modelName = "FooOptional"; - sc = openAPI.getComponents().getSchemas().get(modelName); - CodegenModel fooOptional = codegen.fromModel(modelName, sc); - Assert.assertTrue(fooRequired.vars.get(0).required); - Assert.assertEquals(fooRequired.vars.get(0).name, "foo"); - - Assert.assertEquals(fooRequired.requiredVars.size(), 1); - Assert.assertEquals(fooRequired.requiredVars.get(0).name, "foo"); - Assert.assertTrue(fooRequired.requiredVars.get(0).required); - - Assert.assertFalse(fooOptional.vars.get(0).required); - Assert.assertEquals(fooOptional.vars.get(0).name, "foo"); - Assert.assertEquals(fooOptional.requiredVars.size(), 0); - } - - @Test - public void testAssigning310SpecWorks() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_1/petstore.yaml"); - final DefaultCodegen codegen = new DefaultCodegen(); - codegen.setOpenAPI(openAPI); - assertEquals(openAPI, codegen.openAPI); - } -} diff --git a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/InlineModelResolverTest.java b/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/InlineModelResolverTest.java deleted file mode 100644 index 6e4fa4f84f3..00000000000 --- a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/InlineModelResolverTest.java +++ /dev/null @@ -1,1070 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen; - -import io.swagger.parser.OpenAPIParser; -import io.swagger.v3.oas.models.Components; -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.Operation; -import io.swagger.v3.oas.models.PathItem; -import io.swagger.v3.oas.models.media.*; -import io.swagger.v3.oas.models.parameters.RequestBody; -import io.swagger.v3.oas.models.responses.ApiResponse; -import io.swagger.v3.oas.models.responses.ApiResponses; -import io.swagger.v3.parser.core.models.ParseOptions; -import org.openapitools.codegen.utils.ModelUtils; -import org.testng.Assert; -import org.testng.annotations.Test; - -import java.util.HashMap; -import java.util.Map; -import java.util.List; - -import static org.testng.AssertJUnit.*; - -@SuppressWarnings("static-method") -public class InlineModelResolverTest { - @Test - public void resolveInlineModelTestWithoutTitle() { - OpenAPI openapi = new OpenAPI(); - openapi.setComponents(new Components()); - openapi.getComponents().addSchemas("User", new ObjectSchema() - .name("user") - .description("a common user") - .addProperties("name", new StringSchema()) - .addProperties("address", new ObjectSchema() - .description("description") - .readOnly(false) - .description("description") - .name("name") - .addProperties("street", new StringSchema()) - .addProperties("city", new StringSchema()))); - - assertNotNull((openapi.getComponents().getSchemas().get("User")).getProperties().get("address")); - - new InlineModelResolver().flatten(openapi); - - Schema user = openapi.getComponents().getSchemas().get("User"); - - assertNotNull(user); - assertNotNull(user.getProperties().get("address")); - assertNotNull(((Schema) user.getProperties().get("address")).get$ref()); - assertEquals(((Schema) user.getProperties().get("address")).get$ref(), "#/components/schemas/User_address"); - - Schema address = openapi.getComponents().getSchemas().get("User_address"); - assertNotNull(address); - assertNotNull(address.getProperties().get("city")); - assertNotNull(address.getProperties().get("street")); - } - - @Test - public void resolveInlineModelTestWithTitle() { - OpenAPI openapi = new OpenAPI(); - openapi.setComponents(new Components()); - openapi.getComponents().addSchemas("User", new ObjectSchema() - .name("user") - .description("a common user") - .addProperties("name", new StringSchema()) - .addProperties("address", new ObjectSchema() - .title("UserAddressTitle") - .readOnly(false) - .description("description") - .name("name") - .addProperties("street", new StringSchema()) - .addProperties("city", new StringSchema()))); - - new InlineModelResolver().flatten(openapi); - - Schema user = openapi.getComponents().getSchemas().get("User"); - - assertNotNull(user); - assertTrue(user.getProperties().get("address") instanceof Schema); - - Schema address = openapi.getComponents().getSchemas().get("UserAddressTitle"); - assertNotNull(address); - assertNotNull(address.getProperties().get("city")); - assertNotNull(address.getProperties().get("street")); - } - - @Test - public void resolveInlineModelTestWithTitleWithSpaces() { - OpenAPI openapi = new OpenAPI(); - openapi.setComponents(new Components()); - openapi.getComponents().addSchemas("User", new ObjectSchema() - .name("user") - .description("a common user") - .addProperties("name", new StringSchema()) - .addProperties("address", new ObjectSchema() - .title("User Address Title") - .readOnly(false) - .description("description") - .name("name") - .addProperties("street", new StringSchema()) - .addProperties("city", new StringSchema()))); - - new InlineModelResolver().flatten(openapi); - - Schema user = openapi.getComponents().getSchemas().get("User"); - - assertNotNull(user); - assertTrue(user.getProperties().get("address") instanceof Schema); - - Schema address = openapi.getComponents().getSchemas().get("User_Address_Title"); - assertNotNull(address); - assertNotNull(address.getProperties().get("city")); - assertNotNull(address.getProperties().get("street")); - } - - @Test - public void resolveInlineModel2EqualInnerModels() { - OpenAPI openapi = new OpenAPI(); - openapi.setComponents(new Components()); - openapi.getComponents().addSchemas("User", new ObjectSchema() - .name("user") - .description("a common user") - .addProperties("name", new StringSchema()) - .addProperties("address", new ObjectSchema() - .title("UserAddressTitle") - .readOnly(false) - .description("description") - .name("name") - .addProperties("street", new StringSchema()) - .addProperties("city", new StringSchema()))); - - openapi.getComponents().addSchemas("AnotherUser", new ObjectSchema() - .name("user") - .description("a common user") - .addProperties("name", new StringSchema()) - .addProperties("lastName", new StringSchema()) - .addProperties("address", new ObjectSchema() - .title("UserAddressTitle") - .readOnly(false) - .description("description") - .name("name") - .addProperties("street", new StringSchema()) - .addProperties("city", new StringSchema()))); - - new InlineModelResolver().flatten(openapi); - - ObjectSchema user = (ObjectSchema) openapi.getComponents().getSchemas().get("User"); - - assertNotNull(user); - assertNotNull(user.getProperties().get("address")); - - Schema address = openapi.getComponents().getSchemas().get("UserAddressTitle"); - assertNotNull(address); - assertNotNull(address.getProperties().get("city")); - assertNotNull(address.getProperties().get("street")); - Schema duplicateAddress = openapi.getComponents().getSchemas().get("UserAddressTitle_0"); - assertNull(duplicateAddress); - } - - @Test - public void resolveInlineModel2DifferentInnerModelsWithSameTitle() { - OpenAPI openapi = new OpenAPI(); - openapi.setComponents(new Components()); - openapi.getComponents().addSchemas("User", new ObjectSchema() - .name("user") - .description("a common user") - .addProperties("name", new StringSchema()) - .addProperties("address", new ObjectSchema() - .title("UserAddressTitle") - .readOnly(false) - .description("description") - .name("name") - .addProperties("street", new StringSchema()) - .addProperties("city", new StringSchema()))); - - openapi.getComponents().addSchemas("AnotherUser", new ObjectSchema() - .name("AnotherUser") - .description("a common user") - .addProperties("name", new StringSchema()) - .addProperties("lastName", new StringSchema()) - .addProperties("address", new ObjectSchema() - .title("UserAddressTitle") - .readOnly(false) - .description("description") - .name("name") - .addProperties("street", new StringSchema()) - .addProperties("city", new StringSchema()) - .addProperties("apartment", new StringSchema()))); - - new InlineModelResolver().flatten(openapi); - - Schema user = openapi.getComponents().getSchemas().get("User"); - - assertNotNull(user); - assertTrue(user.getProperties().get("address") instanceof Schema); - - Schema address = openapi.getComponents().getSchemas().get("UserAddressTitle"); - assertNotNull(address); - assertNotNull(address.getProperties().get("city")); - assertNotNull(address.getProperties().get("street")); - Schema duplicateAddress = openapi.getComponents().getSchemas().get("UserAddressTitle_1"); - assertNotNull(duplicateAddress); - assertNotNull(duplicateAddress.getProperties().get("city")); - assertNotNull(duplicateAddress.getProperties().get("street")); - assertNotNull(duplicateAddress.getProperties().get("apartment")); - } - - @Test - public void testInlineResponseModel() { - OpenAPI openapi = new OpenAPI(); - openapi.setComponents(new Components()); - - Map propExt = new HashMap<>(); - propExt.put("x-ext", "ext-prop"); - - Map responseExt = new HashMap<>(); - responseExt.put("x-foo", "bar"); - - openapi.path("/foo/bar", new PathItem() - .get(new Operation().responses(new ApiResponses().addApiResponse("200", new ApiResponse() - .description("it works!") - .content(new Content().addMediaType("application/json", - new MediaType().schema(new ObjectSchema().title("inline_response_200") - .addProperties("name", new StringSchema()).extensions(propExt)))))))) - .path("/foo/baz", new PathItem() - .get(new Operation().responses(new ApiResponses().addApiResponse("200", new ApiResponse() - .description("it works!") - .extensions(responseExt) - .content(new Content().addMediaType("application/json", - new MediaType().schema(new ObjectSchema() - .addProperties("name", new StringSchema()).extensions(propExt)))))))); - - new InlineModelResolver().flatten(openapi); - - Map responses = openapi.getPaths().get("/foo/bar").getGet().getResponses(); - - ApiResponse response = responses.get("200"); - assertNotNull(response); - Schema schema = response.getContent().get("application/json").getSchema(); - assertNotNull(schema); - assertEquals(1, schema.getExtensions().size()); - assertEquals("ext-prop", schema.getExtensions().get("x-ext")); - - Schema model = openapi.getComponents().getSchemas().get("inline_response_200"); - assertEquals(1, model.getProperties().size()); - assertNotNull(model.getProperties().get("name")); - assertTrue(model.getProperties().get("name") instanceof StringSchema); - } - - @Test - public void testInlineResponseModelType() { - OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/6150_model_json_inline.yaml"); - new InlineModelResolver().flatten(openAPI); - - Schema InlineResponse200 = openAPI.getComponents().getSchemas().get("testOperation_200_response"); - assertEquals("object", InlineResponse200.getType()); - assertEquals("unknown", InlineResponse200.getFormat()); - Schema FooBarObject = openAPI.getComponents().getSchemas().get("FooBarObject"); - assertEquals("object", FooBarObject.getType()); - assertEquals("date-time", FooBarObject.getFormat()); - Schema Animal = openAPI.getComponents().getSchemas().get("Animal"); - assertEquals("object", Animal.getType()); - Schema Dog = openAPI.getComponents().getSchemas().get("Dog"); - assertNull(Dog.getType()); - } - - @Test - public void testInlineResponseModelWithTitle() { - OpenAPI openapi = new OpenAPI(); - openapi.setComponents(new Components()); - - Map propExt = new HashMap<>(); - propExt.put("x-ext", "ext-prop"); - - Map responseExt = new HashMap<>(); - responseExt.put("x-foo", "bar"); - - openapi.path("/foo/bar", new PathItem() - .get(new Operation().responses(new ApiResponses().addApiResponse("200", new ApiResponse() - .description("it works!") - .content(new Content().addMediaType("application/json", - new MediaType().schema(new ObjectSchema().title("GetBarResponse") - .addProperties("name", new StringSchema()).extensions(propExt)))))))) - .path("/foo/baz", new PathItem() - .get(new Operation().responses(new ApiResponses().addApiResponse("200", new ApiResponse() - .description("it works!") - .extensions(responseExt) - .content(new Content().addMediaType("application/json", - new MediaType().schema(new ObjectSchema() - .addProperties("name", new StringSchema()).extensions(propExt)))))))); - - new InlineModelResolver().flatten(openapi); - - Map responses = openapi.getPaths().get("/foo/bar").getGet().getResponses(); - - ApiResponse response = responses.get("200"); - assertNotNull(response); - Schema schema = response.getContent().get("application/json").getSchema(); - assertNotNull(schema); - assertEquals(1, schema.getExtensions().size()); - assertEquals("ext-prop", schema.getExtensions().get("x-ext")); - - Schema model = openapi.getComponents().getSchemas().get("GetBarResponse"); - assertEquals(1, model.getProperties().size()); - assertNotNull(model.getProperties().get("name")); - assertTrue(model.getProperties().get("name") instanceof StringSchema); - } - - @Test - public void resolveInlineRequestBodyWhenNoComponents() { - OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/inline_request_body_no_components.yaml"); - new InlineModelResolver().flatten(openAPI); - - assertNotNull(openAPI.getComponents()); - // no longer create inline requestBodies as references in the refactored inline model resolver (6.x) - assertNull(openAPI.getComponents().getRequestBodies()); - assertNotNull(openAPI.getComponents().getSchemas().get("test1_request")); - } - - @Test - public void resolveInlineArraySchemaWithTitle() { - OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/inline_model_resolver.yaml"); - new InlineModelResolver().flatten(openAPI); - - assertTrue(openAPI.getComponents().getSchemas().get("Users") instanceof ArraySchema); - - ArraySchema users = (ArraySchema) openAPI.getComponents().getSchemas().get("Users"); - assertTrue(users.getItems() instanceof Schema); - assertEquals("#/components/schemas/User", users.getItems().get$ref()); - - ObjectSchema user = (ObjectSchema) openAPI.getComponents().getSchemas().get("User"); - assertEquals("User", user.getTitle()); - assertTrue(user.getProperties().get("street") instanceof StringSchema); - assertTrue(user.getProperties().get("city") instanceof StringSchema); - } - - @Test - public void resolveRequestBodyInvalidRef() { - OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/inline_model_resolver.yaml"); - new InlineModelResolver().flatten(openAPI); - - RequestBody requestBodyReference = openAPI - .getPaths() - .get("/resolve_request_body_invalid_ref") - .getPost() - .getRequestBody(); - assertNull(requestBodyReference.getContent()); - } - - @Test - public void resolveInlineRequestBody() { - OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/inline_model_resolver.yaml"); - new InlineModelResolver().flatten(openAPI); - - RequestBody requestBodyReference = openAPI - .getPaths() - .get("/resolve_inline_request_body") - .getPost() - .getRequestBody(); - assertEquals("#/components/schemas/resolveInlineRequestBody_request", - requestBodyReference.getContent().get("application/json").getSchema().get$ref()); - - RequestBody requestBody = ModelUtils.getReferencedRequestBody(openAPI, requestBodyReference); - MediaType mediaType = requestBody.getContent().get("application/json"); - assertTrue(ModelUtils.getReferencedSchema(openAPI, mediaType.getSchema()) instanceof ObjectSchema); - - ObjectSchema schema = (ObjectSchema) ModelUtils.getReferencedSchema(openAPI, mediaType.getSchema()); - assertTrue(schema.getProperties().get("name") instanceof StringSchema); - assertNotNull(schema.getProperties().get("address").get$ref()); - - Schema address = ModelUtils.getReferencedSchema(openAPI, schema.getProperties().get("address")); - assertTrue(address.getProperties().get("street") instanceof StringSchema); - } - - @Test - public void resolveInlineRequestBodyWithRequired() { - OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/inline_model_resolver.yaml"); - new InlineModelResolver().flatten(openAPI); - - RequestBody requestBodyReference = openAPI.getPaths().get("/resolve_inline_request_body_with_required").getPost().getRequestBody(); - assertTrue(requestBodyReference.getRequired()); - - RequestBody referencedRequestBody = ModelUtils.getReferencedRequestBody(openAPI, requestBodyReference); - assertTrue(referencedRequestBody.getRequired()); - } - - @Test - public void resolveInlineRequestBodyWithTitle() { - OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/inline_model_resolver.yaml"); - new InlineModelResolver().flatten(openAPI); - - RequestBody requestBodyReference = openAPI.getPaths().get("/resolve_inline_request_body_with_title").getPost().getRequestBody(); - assertEquals("#/components/schemas/resolve_inline_request_body_with_title", - requestBodyReference.getContent().get("application/json").getSchema().get$ref()); - } - - @Test - public void nonModelRequestBody() { - OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/inline_model_resolver.yaml"); - new InlineModelResolver().flatten(openAPI); - - MediaType mediaType = openAPI - .getPaths() - .get("/non_model_request_body") - .getPost() - .getRequestBody() - .getContent() - .get("multipart/form-data"); - - assertTrue(mediaType.getSchema() instanceof BinarySchema); - assertEquals("string", mediaType.getSchema().getType()); - assertEquals("binary", mediaType.getSchema().getFormat()); - } - - @Test - public void resolveInlineArrayRequestBody() { - OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/inline_model_resolver.yaml"); - new InlineModelResolver().flatten(openAPI); - - MediaType mediaType = openAPI - .getPaths() - .get("/resolve_inline_array_request_body") - .getPost() - .getRequestBody() - .getContent() - .get("application/json"); - - assertTrue(mediaType.getSchema() instanceof ArraySchema); - - ArraySchema requestBody = (ArraySchema) mediaType.getSchema(); - assertNotNull(requestBody.getItems().get$ref()); - assertEquals("#/components/schemas/resolveInlineArrayRequestBody_request_inner", requestBody.getItems().get$ref()); - - Schema items = ModelUtils.getReferencedSchema(openAPI, ((ArraySchema) mediaType.getSchema()).getItems()); - assertTrue(items.getProperties().get("street") instanceof StringSchema); - assertTrue(items.getProperties().get("city") instanceof StringSchema); - } - - @Test - public void resolveInlineArrayRequestBodyWithTitle() { - OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/inline_model_resolver.yaml"); - new InlineModelResolver().flatten(openAPI); - - ArraySchema requestBodySchema = (ArraySchema) openAPI - .getPaths() - .get("/resolve_inline_array_request_body_with_title") - .getPost() - .getRequestBody() - .getContent() - .get("application/json") - .getSchema(); - - assertNotNull(requestBodySchema.getItems().get$ref()); - assertEquals("#/components/schemas/resolveInlineArrayRequestBodyWithTitleItems", requestBodySchema.getItems().get$ref()); - } - - @Test - public void resolveInlineArrayResponse() { - OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/inline_model_resolver.yaml"); - new InlineModelResolver().flatten(openAPI); - - MediaType mediaType = openAPI - .getPaths() - .get("/resolve_inline_array_response") - .getGet() - .getResponses() - .get("200") - .getContent() - .get("application/json"); - - assertTrue(mediaType.getSchema() instanceof ArraySchema); - - ArraySchema responseSchema = (ArraySchema) mediaType.getSchema(); - assertEquals("#/components/schemas/resolveInlineArrayResponse_200_response_inner", responseSchema.getItems().get$ref()); - - Schema items = ModelUtils.getReferencedSchema(openAPI, responseSchema.getItems()); - assertTrue(items.getProperties().get("array_response_property") instanceof StringSchema); - } - - @Test - public void resolveInlineArrayResponseWithTitle() { - OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/inline_model_resolver.yaml"); - new InlineModelResolver().flatten(openAPI); - - MediaType mediaType = openAPI - .getPaths() - .get("/resolve_inline_array_response_with_title") - .getGet() - .getResponses() - .get("200") - .getContent() - .get("application/json"); - - ArraySchema responseSchema = (ArraySchema) mediaType.getSchema(); - assertEquals("#/components/schemas/resolveInlineArrayResponseWithTitleItems", responseSchema.getItems().get$ref()); - } - - @Test - public void resolveInlineObjectResponseWithAdditionalProperties() { - OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/inline_model_resolver.yaml"); - new InlineModelResolver().flatten(openAPI); - - MediaType mediaType = openAPI - .getPaths() - .get("/resolve_inline_object_response_with_additional_properties") - .getGet() - .getResponses() - .get("200") - .getContent() - .get("application/json"); - - assertEquals("object", mediaType.getSchema().getType()); - Object additionalPropertiesObject = mediaType.getSchema().getAdditionalProperties(); - assertTrue(additionalPropertiesObject instanceof Schema); - - Schema additionalProperties = ModelUtils.getReferencedSchema(openAPI, (Schema) additionalPropertiesObject); - assertNotNull(additionalProperties); - assertTrue(additionalProperties.getProperties().get("resolve_inline_object_response_with_additional_properties") instanceof StringSchema); - } - - @Test - public void resolveInlineMapSchemaInResponse() { - OpenAPI openAPI = new OpenAPIParser().readLocation("src/test/resources/3_0/inline_model_resolver.yaml", null, new ParseOptions()).getOpenAPI(); - ApiResponse apiResponse = openAPI - .getPaths() - .get("/resolve_inline_map_schema_in_response") - .getGet() - .getResponses() - .get("200"); - - // NOTE: Swagger parser doesn't use MapSchema currently, - // so we need to set a MapSchema instance as the schema manually for testing. - // @see https://github.com/swagger-api/swagger-parser/blob/master/modules/swagger-parser-v3/src/main/java/io/swagger/v3/parser/util/SchemaTypeUtil.java - apiResponse.content( - new Content().addMediaType( - "application/json", - new MediaType().schema( - new MapSchema().additionalProperties( - new ObjectSchema().addProperties( - "resolve_inline_map_schema_in_response_property", - new ObjectSchema().addProperties( - "resolve_inline_map_schema_in_response_property_string", - new StringSchema().example("example") - ) - ) - ) - ) - ) - ); - - new InlineModelResolver().flatten(openAPI); - - MediaType mediaType = openAPI - .getPaths() - .get("/resolve_inline_map_schema_in_response") - .getGet() - .getResponses() - .get("200") - .getContent() - .get("application/json"); - assertTrue(mediaType.getSchema() instanceof MapSchema); - - Schema additionalProperties = (Schema) mediaType.getSchema().getAdditionalProperties(); - assertNotNull(additionalProperties.get$ref()); - assertEquals("#/components/schemas/resolveInlineMapSchemaInResponse_200_response_value", additionalProperties.get$ref()); - - Schema referencedSchema = ModelUtils.getReferencedSchema(openAPI, additionalProperties); - Schema referencedSchemaProperty = (Schema) referencedSchema.getProperties().get("resolve_inline_map_schema_in_response_property"); - - assertEquals( - "#/components/schemas/resolveInlineMapSchemaInResponse_200_response_value_resolve_inline_map_schema_in_response_property", - referencedSchemaProperty.get$ref() - ); - assertNotNull(ModelUtils.getReferencedSchema(openAPI, referencedSchemaProperty)); - } - - @Test - public void arbitraryObjectRequestBody() { - OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/inline_model_resolver.yaml"); - new InlineModelResolver().flatten(openAPI); - - MediaType mediaType = openAPI - .getPaths() - .get("/arbitrary_object_request_body") - .getPost() - .getRequestBody() - .getContent() - .get("application/json"); - - assertTrue(mediaType.getSchema() instanceof ObjectSchema); - } - - @Test - public void arbitraryObjectRequestBodyProperty() { - OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/inline_model_resolver.yaml"); - new InlineModelResolver().flatten(openAPI); - - MediaType mediaType = openAPI - .getPaths() - .get("/arbitrary_object_request_body_property") - .getPost() - .getRequestBody() - .getContent() - .get("application/json"); - - assertEquals("#/components/schemas/arbitraryObjectRequestBodyProperty_request", mediaType.getSchema().get$ref()); - Schema requestBodySchema = ModelUtils.getReferencedSchema(openAPI, mediaType.getSchema()); - assertNotNull(requestBodySchema); - assertEquals(1, requestBodySchema.getProperties().size(), 1); - assertTrue(requestBodySchema.getProperties().get("arbitrary_object_request_body_property") instanceof ObjectSchema); - } - - @Test - public void arbitraryRequestBodyArray() { - OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/inline_model_resolver.yaml"); - new InlineModelResolver().flatten(openAPI); - - MediaType mediaType = openAPI - .getPaths() - .get("/arbitrary_request_body_array") - .getPost() - .getRequestBody() - .getContent() - .get("application/json"); - - assertTrue(mediaType.getSchema() instanceof ArraySchema); - - ArraySchema requestBodySchema = (ArraySchema) mediaType.getSchema(); - assertTrue(requestBodySchema.getItems() instanceof ObjectSchema); - assertNull(requestBodySchema.getItems().getProperties()); - } - - @Test - public void arbitraryRequestBodyArrayProperty() { - OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/inline_model_resolver.yaml"); - new InlineModelResolver().flatten(openAPI); - - MediaType mediaType = openAPI - .getPaths() - .get("/arbitrary_request_body_array_property") - .getPost() - .getRequestBody() - .getContent() - .get("application/json"); - - assertTrue(mediaType.getSchema() instanceof ArraySchema); - - ArraySchema requestBodySchema = (ArraySchema) mediaType.getSchema(); - assertNotNull(requestBodySchema.getItems().get$ref()); - - Schema referencedSchema = ModelUtils.getReferencedSchema(openAPI, requestBodySchema.getItems()); - assertTrue(referencedSchema.getProperties().get("arbitrary_request_body_array_property") instanceof ObjectSchema); - } - - @Test - public void arbitraryObjectResponse() { - OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/inline_model_resolver.yaml"); - new InlineModelResolver().flatten(openAPI); - - MediaType mediaType = openAPI - .getPaths() - .get("/arbitrary_object_response") - .getGet() - .getResponses() - .get("200") - .getContent() - .get("application/json"); - - assertTrue(mediaType.getSchema() instanceof ObjectSchema); - assertNull(mediaType.getSchema().getProperties()); - } - - @Test - public void arbitraryObjectResponseArray() { - OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/inline_model_resolver.yaml"); - new InlineModelResolver().flatten(openAPI); - - MediaType mediaType = openAPI - .getPaths() - .get("/arbitrary_object_response_array") - .getGet() - .getResponses() - .get("200") - .getContent() - .get("application/json"); - - assertTrue(mediaType.getSchema() instanceof ArraySchema); - ArraySchema schema = (ArraySchema) mediaType.getSchema(); - assertNull(schema.getItems().getProperties()); - } - - @Test - public void arbitraryObjectResponseArrayInline() { - OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/inline_model_resolver.yaml"); - new InlineModelResolver().flatten(openAPI); - - MediaType mediaType = openAPI - .getPaths() - .get("/arbitrary_object_response_array_inline") - .getGet() - .getResponses() - .get("200") - .getContent() - .get("application/json"); - - assertTrue(mediaType.getSchema() instanceof ArraySchema); - ArraySchema schema = (ArraySchema) mediaType.getSchema(); - assertNotNull(schema.getItems().get$ref()); - - Schema referencedSchema = ModelUtils.getReferencedSchema(openAPI, schema.getItems()); - assertTrue(referencedSchema.getProperties().get("arbitrary_object_response_array_inline") instanceof ObjectSchema); - - ObjectSchema arbitraryObject = (ObjectSchema) referencedSchema.getProperties().get("arbitrary_object_response_array_inline"); - assertNull(arbitraryObject.getProperties()); - } - - @Test - public void arbitraryObjectResponseWithAdditionalProperty() { - OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/inline_model_resolver.yaml"); - new InlineModelResolver().flatten(openAPI); - - MediaType mediaType = openAPI - .getPaths() - .get("/arbitrary_object_response_with_additional_property") - .getGet() - .getResponses() - .get("200") - .getContent() - .get("application/json"); - - assertEquals("object", mediaType.getSchema().getType()); - assertTrue(mediaType.getSchema().getAdditionalProperties() instanceof ObjectSchema); - - ObjectSchema additionalProperty = (ObjectSchema) mediaType.getSchema().getAdditionalProperties(); - assertNull(additionalProperty.getProperties()); - } - - @Test - public void arbitraryObjectModelInline() { - OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/inline_model_resolver.yaml"); - new InlineModelResolver().flatten(openAPI); - - ObjectSchema model = (ObjectSchema) openAPI.getComponents().getSchemas().get("ArbitraryObjectModelInline"); - assertTrue(model.getProperties().get("arbitrary_object_model_inline") instanceof ObjectSchema); - - ObjectSchema schema = (ObjectSchema) model.getProperties().get("arbitrary_object_model_inline"); - assertNull(schema.getProperties()); - } - - @Test - public void arbitraryObjectModelWithArrayInlineWithoutTitle() { - OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/inline_model_resolver.yaml"); - new InlineModelResolver().flatten(openAPI); - - assertTrue(openAPI.getComponents().getSchemas().get("ArbitraryObjectModelWithArrayInlineWithoutTitle") instanceof ArraySchema); - - ArraySchema schema = (ArraySchema) openAPI.getComponents().getSchemas().get("ArbitraryObjectModelWithArrayInlineWithoutTitle"); - assertTrue(schema.getItems() instanceof Schema); - assertEquals(schema.getItems().get$ref(), "#/components/schemas/ArbitraryObjectModelWithArrayInlineWithoutTitle_inner"); - - ObjectSchema items = (ObjectSchema) openAPI.getComponents().getSchemas().get("ArbitraryObjectModelWithArrayInlineWithoutTitle_inner"); - assertTrue(items.getProperties().get("arbitrary_object_model_with_array_inline_without_title") instanceof ObjectSchema); - - ObjectSchema itemsProperty = (ObjectSchema) items.getProperties().get("arbitrary_object_model_with_array_inline_without_title"); - assertNull(itemsProperty.getProperties()); - } - - private void checkComposedChildren(OpenAPI openAPI, List children, String key) { - assertNotNull(children); - Schema inlined = children.get(0); - assertEquals("#/components/schemas/ComposedObjectModelInline_" + key, inlined.get$ref()); - Schema child = ModelUtils.getReferencedSchema(openAPI, inlined); - assertNotNull(child.getProperties()); - assertNotNull(child.getProperties().get("composed_object_model_inline_" + key)); - } - - @Test - public void objectComposedWithInline() { - OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/inline_model_resolver.yaml"); - new InlineModelResolver().flatten(openAPI); - - assertTrue(openAPI.getComponents().getSchemas().get("ComposedObjectModelInline") instanceof ComposedSchema); - - ComposedSchema schema = (ComposedSchema) openAPI.getComponents().getSchemas().get("ComposedObjectModelInline"); - - checkComposedChildren(openAPI, schema.getAllOf(), "allOf"); - checkComposedChildren(openAPI, schema.getAnyOf(), "anyOf"); - checkComposedChildren(openAPI, schema.getOneOf(), "oneOf"); - } - - - @Test - public void inheritanceWithInlineDiscriminator() { - OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/2_0/regression_6905.yaml"); - new InlineModelResolver().flatten(openAPI); - - assertTrue(openAPI.getComponents().getSchemas().get("PartyType") instanceof StringSchema); - assertTrue(openAPI.getComponents().getSchemas().get("CustomerType") instanceof StringSchema); - assertTrue(openAPI.getComponents().getSchemas().get("Entity") instanceof ObjectSchema); - - assertTrue(openAPI.getComponents().getSchemas().get("Party") instanceof ComposedSchema); - assertTrue(openAPI.getComponents().getSchemas().get("Contact") instanceof ComposedSchema); - assertTrue(openAPI.getComponents().getSchemas().get("Customer") instanceof ComposedSchema); - assertTrue(openAPI.getComponents().getSchemas().get("Person") instanceof ComposedSchema); - assertTrue(openAPI.getComponents().getSchemas().get("Organization") instanceof ComposedSchema); - - assertTrue(openAPI.getComponents().getSchemas().get("ApiError") instanceof ObjectSchema); - - assertFalse(openAPI.getComponents().getSchemas().get("Party_allOf") instanceof ComposedSchema); - assertFalse(openAPI.getComponents().getSchemas().get("Contact_allOf") instanceof ComposedSchema); - assertFalse(openAPI.getComponents().getSchemas().get("Customer_allOf") instanceof ComposedSchema); - assertFalse(openAPI.getComponents().getSchemas().get("Person_allOf") instanceof ComposedSchema); - assertFalse(openAPI.getComponents().getSchemas().get("Organization_allOf") instanceof ComposedSchema); - - // Party - ComposedSchema party = (ComposedSchema) openAPI.getComponents().getSchemas().get("Party"); - List partySchemas = party.getAllOf(); - Schema entity = ModelUtils.getReferencedSchema(openAPI, partySchemas.get(0)); - Schema partyAllOf = ModelUtils.getReferencedSchema(openAPI, partySchemas.get(1)); - - assertEquals(partySchemas.get(0).get$ref(), "#/components/schemas/Entity"); - assertEquals(partySchemas.get(1).get$ref(), "#/components/schemas/Party_allOf"); - - assertNull(party.getDiscriminator()); - assertNull(entity.getDiscriminator()); - assertNotNull(partyAllOf.getDiscriminator()); - assertEquals(partyAllOf.getDiscriminator().getPropertyName(), "party_type"); - assertEquals(partyAllOf.getRequired().get(0), "party_type"); - - - // Contact - ComposedSchema contact = (ComposedSchema) openAPI.getComponents().getSchemas().get("Contact"); - Schema contactAllOf = ModelUtils.getReferencedSchema(openAPI, contact.getAllOf().get(1)); - - assertEquals(contact.getExtensions().get("x-discriminator-value"), "contact"); - assertEquals(contact.getAllOf().get(0).get$ref(), "#/components/schemas/Party"); - assertEquals(contact.getAllOf().get(1).get$ref(), "#/components/schemas/Contact_allOf"); - assertNull(contactAllOf.getDiscriminator()); - - - // Customer - ComposedSchema customer = (ComposedSchema) openAPI.getComponents().getSchemas().get("Customer"); - List customerSchemas = customer.getAllOf(); - Schema customerAllOf = ModelUtils.getReferencedSchema(openAPI, customerSchemas.get(1)); - - assertEquals(customerSchemas.get(0).get$ref(), "#/components/schemas/Party"); - assertNull(customer.getDiscriminator()); - assertEquals(customer.getExtensions().get("x-discriminator-value"), "customer"); - - // Discriminators are not defined at this level in the schema doc - assertNull(customerSchemas.get(0).getDiscriminator()); - assertEquals(customerSchemas.get(1).get$ref(), "#/components/schemas/Customer_allOf"); - assertNull(customerSchemas.get(1).getDiscriminator()); - - // Customer -> Party where Customer defines it's own discriminator - assertNotNull(customerAllOf.getDiscriminator()); - assertEquals(customerAllOf.getDiscriminator().getPropertyName(), "customer_type"); - assertEquals(customerAllOf.getRequired().get(0), "customer_type"); - - - // Person - ComposedSchema person = (ComposedSchema) openAPI.getComponents().getSchemas().get("Person"); - List personSchemas = person.getAllOf(); - Schema personAllOf = ModelUtils.getReferencedSchema(openAPI, personSchemas.get(1)); - - // Discriminators are not defined at this level in the schema doc - assertEquals(personSchemas.get(0).get$ref(), "#/components/schemas/Customer"); - assertNull(personSchemas.get(0).getDiscriminator()); - assertEquals(personSchemas.get(1).get$ref(), "#/components/schemas/Person_allOf"); - assertNull(personSchemas.get(1).getDiscriminator()); - - // Person -> Customer -> Party, so discriminator is not at this level - assertNull(person.getDiscriminator()); - assertEquals(person.getExtensions().get("x-discriminator-value"), "person"); - assertNull(personAllOf.getDiscriminator()); - - - // Organization - ComposedSchema organization = (ComposedSchema) openAPI.getComponents().getSchemas().get("Organization"); - List organizationSchemas = organization.getAllOf(); - Schema organizationAllOf = ModelUtils.getReferencedSchema(openAPI, organizationSchemas.get(1)); - - // Discriminators are not defined at this level in the schema doc - assertEquals(organizationSchemas.get(0).get$ref(), "#/components/schemas/Customer"); - assertNull(organizationSchemas.get(0).getDiscriminator()); - assertEquals(organizationSchemas.get(1).get$ref(), "#/components/schemas/Organization_allOf"); - assertNull(organizationSchemas.get(1).getDiscriminator()); - - // Organization -> Customer -> Party, so discriminator is not at this level - assertNull(organizationAllOf.getDiscriminator()); - assertEquals(organization.getExtensions().get("x-discriminator-value"), "organization"); - } - - @Test - public void arbitraryObjectModelWithArrayInlineWithTitle() { - OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/inline_model_resolver.yaml"); - new InlineModelResolver().flatten(openAPI); - - assertTrue(openAPI.getComponents().getSchemas().get("ArbitraryObjectModelWithArrayInlineWithTitle") instanceof ArraySchema); - - ArraySchema schema = (ArraySchema) openAPI.getComponents().getSchemas().get("ArbitraryObjectModelWithArrayInlineWithTitle"); - assertTrue(schema.getItems() instanceof Schema); - assertEquals(schema.getItems().get$ref(), "#/components/schemas/ArbitraryObjectModelWithArrayInlineWithTitleInner"); - - ObjectSchema items = (ObjectSchema) openAPI.getComponents().getSchemas().get("ArbitraryObjectModelWithArrayInlineWithTitleInner"); - assertEquals("ArbitraryObjectModelWithArrayInlineWithTitleInner", items.getTitle()); - assertTrue(items.getProperties().get("arbitrary_object_model_with_array_inline_with_title_property") instanceof ObjectSchema); - - ObjectSchema itemsProperty = (ObjectSchema) items.getProperties().get("arbitrary_object_model_with_array_inline_with_title_property"); - assertNull(itemsProperty.getProperties()); - } - - @Test - public void emptyExampleOnStringTypeModels() { - OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/inline_model_resolver.yaml"); - new InlineModelResolver().flatten(openAPI); - - MediaType mediaType = openAPI - .getPaths() - .get("/empty_example_on_string_models") - .getGet() - .getResponses() - .get("200") - .getContent() - .get("application/json"); - - assertTrue(mediaType.getSchema() instanceof ArraySchema); - - ArraySchema schema = (ArraySchema) mediaType.getSchema(); - assertEquals("#/components/schemas/EmptyExampleOnStringTypeModels", schema.getItems().get$ref()); - - assertTrue(ModelUtils.getReferencedSchema(openAPI, schema.getItems()) instanceof StringSchema); - Assert.assertSame(ModelUtils.getReferencedSchema(openAPI, schema.getItems()).getExample(), ""); - } - - @Test - public void nullable() { - OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/inline_model_resolver.yaml"); - new InlineModelResolver().flatten(openAPI); - - Schema nullablePropertyReference = (Schema) openAPI.getComponents().getSchemas().get("InlinePropertyIsNullable").getProperties().get("nullable_property"); - Schema nullablePropertySchema = ModelUtils.getReferencedSchema(openAPI, nullablePropertyReference); - assertTrue(nullablePropertySchema.getNullable()); - - Schema nullableRequestBodyReference = (Schema) openAPI - .getPaths() - .get("/nullable_properties") - .getPost() - .getRequestBody() - .getContent() - .get("application/json") - .getSchema(); - //.getProperties() - //.get("nullable_request_body_property"); - Schema nullableRequestBodySchema = ModelUtils.getReferencedSchema(openAPI, nullableRequestBodyReference); - //assertEquals(nullableRequestBodySchema, ""); - Schema nullableSchema = ModelUtils.getReferencedSchema(openAPI, - ((Schema) nullableRequestBodySchema.getProperties().get("nullable_request_body_property"))); - assertTrue(nullableSchema.getNullable()); - } - - @Test - public void callbacks() { - OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/inline_model_resolver.yaml"); - new InlineModelResolver().flatten(openAPI); - - RequestBody callbackRequestBodyReference = openAPI - .getPaths() - .get("/callback") - .getPost() - .getCallbacks() - .get("webhook") - .get("{$request.body#/callbackUri}") - .getPost() - .getRequestBody(); - assertNotNull(callbackRequestBodyReference.getContent().get("application/json").getSchema().get$ref()); - assertEquals("#/components/schemas/webhookNotify_request", callbackRequestBodyReference.getContent().get("application/json").getSchema().get$ref()); - - /*RequestBody resolvedCallbackRequestBody = openAPI - .getComponents() - .getSchemas() - .get(ModelUtils.getSimpleRef(callbackRequestBodyReference.getContent().get("application/json").getSchema().get$ref()));*/ - - Schema callbackRequestSchemaReference = callbackRequestBodyReference - .getContent() - .get("application/json") - .getSchema(); - assertNotNull(callbackRequestSchemaReference.get$ref()); - - Schema resolvedCallbackSchema = openAPI - .getComponents() - .getSchemas() - .get(ModelUtils.getSimpleRef(callbackRequestSchemaReference.get$ref())); - - Map properties = resolvedCallbackSchema.getProperties(); - assertTrue(properties.get("notificationId") instanceof StringSchema); - assertTrue(properties.get("action") instanceof StringSchema); - assertTrue(properties.get("data") instanceof StringSchema); - } - - @Test - public void testInlineSchemaNameMapping() { - OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/inline_model_resolver.yaml"); - InlineModelResolver resolver = new InlineModelResolver(); - Map inlineSchemaNames = new HashMap<>(); - inlineSchemaNames.put("resolveInlineArrayRequestBody_request_inner", "SomethingMapped"); - inlineSchemaNames.put("arbitraryRequestBodyArrayProperty_request_inner", "nothing_new"); - resolver.setInlineSchemaNameMapping(inlineSchemaNames); - resolver.flatten(openAPI); - - Schema schema = openAPI.getComponents().getSchemas().get("SomethingMapped"); - assertTrue(schema.getProperties().get("street") instanceof StringSchema); - assertTrue(schema.getProperties().get("city") instanceof StringSchema); - - Schema nothingNew = openAPI.getComponents().getSchemas().get("nothing_new"); - assertTrue(nothingNew.getProperties().get("arbitrary_request_body_array_property") instanceof ObjectSchema); - } - - @Test - public void testInlineSchemaNameDefault() { - OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/inline_model_resolver.yaml"); - InlineModelResolver resolver = new InlineModelResolver(); - Map inlineSchemaNameDefaults = new HashMap<>(); - inlineSchemaNameDefaults.put("arrayItemSuffix", "_something"); - resolver.setInlineSchemaNameDefaults(inlineSchemaNameDefaults); - resolver.flatten(openAPI); - - Schema schema = openAPI.getComponents().getSchemas().get("resolveInlineArrayRequestBody_request_something"); - assertTrue(schema.getProperties().get("street") instanceof StringSchema); - assertTrue(schema.getProperties().get("city") instanceof StringSchema); - - Schema nothingNew = openAPI.getComponents().getSchemas().get("arbitraryRequestBodyArrayProperty_request_something"); - assertTrue(nothingNew.getProperties().get("arbitrary_request_body_array_property") instanceof ObjectSchema); - } - - @Test - public void resolveInlineRequestBodyAllOf() { - OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/inline_model_resolver.yaml"); - new InlineModelResolver().flatten(openAPI); - - RequestBody requestBodyReference = openAPI.getPaths().get("/resolve_inline_request_body_allof").getPost().getRequestBody(); - assertEquals("#/components/schemas/resolveInlineRequestBodyAllOf_request", - requestBodyReference.getContent().get("application/json").getSchema().get$ref()); - //assertEquals("#/components/schemas/resolveInlineRequestBodyAllOf_request", requestBodyReference.get$ref()); - - ComposedSchema allOfModel = (ComposedSchema) openAPI.getComponents().getSchemas().get("resolveInlineRequestBodyAllOf_request"); - assertEquals("#/components/schemas/resolveInlineRequestBody_request", allOfModel.getAllOf().get(0).get$ref()); - //Schema allOfModel = ModelUtils.getReferencedSchema(openAPI, requestBodyReference.get$ref()); - - //RequestBody referencedRequestBody = ModelUtils.getReferencedRequestBody(openAPI, requestBodyReference); - //assertTrue(referencedRequestBody.getRequired()); - } -} diff --git a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/java/AbstractJavaCodegenExampleValuesTest.java b/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/java/AbstractJavaCodegenExampleValuesTest.java deleted file mode 100644 index d9f451a462e..00000000000 --- a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/java/AbstractJavaCodegenExampleValuesTest.java +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen.java; - -import org.openapitools.codegen.CodegenParameter; -import org.openapitools.codegen.CodegenProperty; -import org.openapitools.codegen.CodegenType; -import org.openapitools.codegen.languages.AbstractJavaCodegen; -import org.testng.Assert; -import org.testng.annotations.Test; - -import java.util.Arrays; -import java.util.Collections; - -public class AbstractJavaCodegenExampleValuesTest { - - private final AbstractJavaCodegen fakeJavaCodegen = new P_AbstractJavaCodegen(); - - @Test - void referencedEnumTakeFirstName() { - final CodegenParameter p = new CodegenParameter(); - p.allowableValues = Collections.singletonMap("values", Arrays.asList("first", "second")); - p.dataType = "WrappedEnum"; - - fakeJavaCodegen.setParameterExampleValue(p); - Assert.assertEquals(p.example, "WrappedEnum.fromValue(\"first\")"); - } - - @Test - void inlineEnum() { - final CodegenParameter p = new CodegenParameter(); - p.allowableValues = Collections.singletonMap("values", Arrays.asList("first", "second")); - p.isEnum = true; - p.dataType = "String"; - - fakeJavaCodegen.setParameterExampleValue(p); - Assert.assertEquals(p.example, "\"first\""); - } - - @Test - void inlineEnumArray() { - final CodegenParameter p = new CodegenParameter(); - p.allowableValues = Collections.singletonMap("values", Arrays.asList("first", "second")); - p.isEnum = true; - p.isArray = true; - p.dataType = "List"; - p.items = new CodegenProperty(); - - fakeJavaCodegen.setParameterExampleValue(p); - Assert.assertEquals(p.example, "Arrays.asList()"); - } - - @Test - void dateDefault() { - final CodegenParameter p = new CodegenParameter(); - p.isDate = true; - p.dataType = "LocalDate"; - - fakeJavaCodegen.setParameterExampleValue(p); - Assert.assertEquals(p.example, "LocalDate.now()"); - } - - @Test - void dateGivenExample() { - final CodegenParameter p = new CodegenParameter(); - p.isDate = true; - p.dataType = "LocalDate"; - p.example = "2017-03-30"; - - fakeJavaCodegen.setParameterExampleValue(p); - Assert.assertEquals(p.example, "LocalDate.parse(\"2017-03-30\")"); - } - - @Test - void dateTimeDefault() { - final CodegenParameter p = new CodegenParameter(); - p.isDateTime = true; - p.dataType = "OffsetDateTime"; - - fakeJavaCodegen.setParameterExampleValue(p); - Assert.assertEquals(p.example, "OffsetDateTime.now()"); - } - - @Test - void dateTimeGivenExample() { - final CodegenParameter p = new CodegenParameter(); - p.isDateTime = true; - p.dataType = "OffsetDateTime"; - p.example = "2007-12-03T10:15:30+01:00"; - - fakeJavaCodegen.setParameterExampleValue(p); - Assert.assertEquals(p.example, "OffsetDateTime.parse(\"2007-12-03T10:15:30+01:00\")"); - } - - @Test - void uuidDefault() { - final CodegenParameter p = new CodegenParameter(); - p.isUuid = true; - p.dataType = "UUID"; - - fakeJavaCodegen.setParameterExampleValue(p); - Assert.assertEquals(p.example, "UUID.randomUUID()"); - } - - @Test - void uuidGivenExample() { - final CodegenParameter p = new CodegenParameter(); - p.isUuid = true; - p.dataType = "UUID"; - p.example = "13b48713-b931-45ea-bd60-b07491245960"; - - fakeJavaCodegen.setParameterExampleValue(p); - Assert.assertEquals(p.example, "UUID.fromString(\"13b48713-b931-45ea-bd60-b07491245960\")"); - } - - private static class P_AbstractJavaCodegen extends AbstractJavaCodegen { - @Override - public CodegenType getTag() { - return null; - } - - @Override - public String getName() { - return null; - } - - @Override - public String getHelp() { - return null; - } - - /** - * Gets artifact version. - * Only for testing purposes. - * - * @return version - */ - public String getArtifactVersion() { - return this.artifactVersion; - } - } -} diff --git a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/java/AbstractJavaCodegenTest.java b/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/java/AbstractJavaCodegenTest.java deleted file mode 100644 index 2edaa5024e7..00000000000 --- a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/java/AbstractJavaCodegenTest.java +++ /dev/null @@ -1,890 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen.java; - -import io.swagger.v3.oas.models.Components; -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.media.*; - -import java.time.OffsetDateTime; -import java.time.ZonedDateTime; -import java.util.HashSet; -import java.util.Set; - -import org.openapitools.codegen.CodegenConstants; -import org.openapitools.codegen.CodegenModel; -import org.openapitools.codegen.CodegenParameter; -import org.openapitools.codegen.CodegenType; -import org.openapitools.codegen.TestUtils; -import org.openapitools.codegen.languages.AbstractJavaCodegen; -import org.openapitools.codegen.utils.ModelUtils; -import org.testng.Assert; -import org.testng.annotations.Test; - -import java.io.File; -import java.time.LocalDate; -import java.time.ZoneId; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.Collections; - -public class AbstractJavaCodegenTest { - - private final AbstractJavaCodegen fakeJavaCodegen = new P_AbstractJavaCodegen(); - - @Test - public void toEnumVarNameShouldNotShortenUnderScore() throws Exception { - Assert.assertEquals(fakeJavaCodegen.toEnumVarName("_", "String"), "UNDERSCORE"); - Assert.assertEquals(fakeJavaCodegen.toEnumVarName("__", "String"), "__"); - Assert.assertEquals(fakeJavaCodegen.toEnumVarName("_,.", "String"), "__"); - } - - /** - * As of Java 9, '_' is a keyword, and may not be used as an identifier. - */ - @Test - public void toEnumVarNameShouldNotResultInSingleUnderscore() throws Exception { - Assert.assertEquals(fakeJavaCodegen.toEnumVarName(" ", "String"), "SPACE"); - } - - @Test - public void toVarNameShouldAvoidOverloadingGetClassMethod() throws Exception { - Assert.assertEquals(fakeJavaCodegen.toVarName("class"), "propertyClass"); - Assert.assertEquals(fakeJavaCodegen.toVarName("_class"), "propertyClass"); - Assert.assertEquals(fakeJavaCodegen.toVarName("__class"), "propertyClass"); - } - - @Test - public void toModelNameShouldNotUseProvidedMapping() throws Exception { - fakeJavaCodegen.importMapping().put("json_myclass", "com.test.MyClass"); - Assert.assertEquals(fakeJavaCodegen.toModelName("json_myclass"), "JsonMyclass"); - } - - @Test - public void toModelNameUsesPascalCase() throws Exception { - Assert.assertEquals(fakeJavaCodegen.toModelName("json_anotherclass"), "JsonAnotherclass"); - } - - @Test - public void testPreprocessOpenAPI() throws Exception { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/petstore.yaml"); - final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); - - codegen.preprocessOpenAPI(openAPI); - - Assert.assertEquals(codegen.getArtifactVersion(), openAPI.getInfo().getVersion()); - Assert.assertEquals(openAPI.getPaths().get("/pet").getPost().getExtensions().get("x-accepts"), "application/json"); - } - - @Test - public void testPreprocessOpenAPINumVersion() throws Exception { - final OpenAPI openAPIOtherNumVersion = TestUtils.parseFlattenSpec("src/test/resources/2_0/duplicateOperationIds.yaml"); - final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); - - codegen.preprocessOpenAPI(openAPIOtherNumVersion); - - Assert.assertEquals(codegen.getArtifactVersion(), openAPIOtherNumVersion.getInfo().getVersion()); - } - - @Test - public void convertVarName() throws Exception { - Assert.assertEquals(fakeJavaCodegen.toVarName("name"), "name"); - Assert.assertEquals(fakeJavaCodegen.toVarName("$name"), "$name"); - Assert.assertEquals(fakeJavaCodegen.toVarName("nam$$e"), "nam$$e"); - Assert.assertEquals(fakeJavaCodegen.toVarName("user-name"), "userName"); - Assert.assertEquals(fakeJavaCodegen.toVarName("user_name"), "userName"); - Assert.assertEquals(fakeJavaCodegen.toVarName("user|name"), "userName"); - Assert.assertEquals(fakeJavaCodegen.toVarName("uSername"), "uSername"); - Assert.assertEquals(fakeJavaCodegen.toVarName("USERname"), "usERname"); - Assert.assertEquals(fakeJavaCodegen.toVarName("USERNAME"), "USERNAME"); - Assert.assertEquals(fakeJavaCodegen.toVarName("USER123NAME"), "USER123NAME"); - Assert.assertEquals(fakeJavaCodegen.toVarName("1"), "_1"); - Assert.assertEquals(fakeJavaCodegen.toVarName("1a"), "_1a"); - Assert.assertEquals(fakeJavaCodegen.toVarName("1A"), "_1A"); - Assert.assertEquals(fakeJavaCodegen.toVarName("1AAAA"), "_1AAAA"); - Assert.assertEquals(fakeJavaCodegen.toVarName("1AAaa"), "_1aAaa"); - } - - @Test - public void convertModelName() throws Exception { - Assert.assertEquals(fakeJavaCodegen.toModelName("name"), "Name"); - Assert.assertEquals(fakeJavaCodegen.toModelName("$name"), "Name"); - Assert.assertEquals(fakeJavaCodegen.toModelName("nam#e"), "Name"); - Assert.assertEquals(fakeJavaCodegen.toModelName("$another-fake?"), "AnotherFake"); - Assert.assertEquals(fakeJavaCodegen.toModelName("1a"), "Model1a"); - Assert.assertEquals(fakeJavaCodegen.toModelName("1A"), "Model1A"); - Assert.assertEquals(fakeJavaCodegen.toModelName("AAAb"), "AAAb"); - Assert.assertEquals(fakeJavaCodegen.toModelName("aBB"), "ABB"); - Assert.assertEquals(fakeJavaCodegen.toModelName("AaBBa"), "AaBBa"); - Assert.assertEquals(fakeJavaCodegen.toModelName("A_B"), "AB"); - Assert.assertEquals(fakeJavaCodegen.toModelName("A-B"), "AB"); - Assert.assertEquals(fakeJavaCodegen.toModelName("Aa_Bb"), "AaBb"); - Assert.assertEquals(fakeJavaCodegen.toModelName("Aa-Bb"), "AaBb"); - Assert.assertEquals(fakeJavaCodegen.toModelName("Aa_bb"), "AaBb"); - Assert.assertEquals(fakeJavaCodegen.toModelName("Aa-bb"), "AaBb"); - } - - @Test - public void testInitialConfigValues() throws Exception { - OpenAPI openAPI = TestUtils.createOpenAPI(); - - final AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); - codegen.processOpts(); - codegen.preprocessOpenAPI(openAPI); - - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.FALSE); - Assert.assertFalse(codegen.isHideGenerationTimestamp()); - Assert.assertEquals(codegen.modelPackage(), "invalidPackageName"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.MODEL_PACKAGE), "invalidPackageName"); - Assert.assertEquals(codegen.apiPackage(), "invalidPackageName"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.API_PACKAGE), "invalidPackageName"); - Assert.assertEquals(codegen.getInvokerPackage(), "org.openapitools"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.INVOKER_PACKAGE), "org.openapitools"); - Assert.assertEquals(codegen.additionalProperties().get(AbstractJavaCodegen.BOOLEAN_GETTER_PREFIX), "get"); - Assert.assertEquals(codegen.getArtifactVersion(), openAPI.getInfo().getVersion()); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.ARTIFACT_VERSION), openAPI.getInfo().getVersion()); - } - - @Test - public void testSettersForConfigValues() throws Exception { - OpenAPI openAPI = TestUtils.createOpenAPI(); - - final AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); - - codegen.setHideGenerationTimestamp(true); - codegen.setModelPackage("xyz.yyyyy.zzzzzzz.model"); - codegen.setApiPackage("xyz.yyyyy.zzzzzzz.api"); - codegen.setInvokerPackage("xyz.yyyyy.zzzzzzz.invoker"); - codegen.setBooleanGetterPrefix("is"); - codegen.setArtifactVersion("0.9.0-SNAPSHOT"); - - codegen.processOpts(); - codegen.preprocessOpenAPI(openAPI); - - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.TRUE); - Assert.assertTrue(codegen.isHideGenerationTimestamp()); - Assert.assertEquals(codegen.modelPackage(), "xyz.yyyyy.zzzzzzz.model"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.MODEL_PACKAGE), "xyz.yyyyy.zzzzzzz.model"); - Assert.assertEquals(codegen.apiPackage(), "xyz.yyyyy.zzzzzzz.api"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.API_PACKAGE), "xyz.yyyyy.zzzzzzz.api"); - Assert.assertEquals(codegen.getInvokerPackage(), "xyz.yyyyy.zzzzzzz.invoker"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.INVOKER_PACKAGE), "xyz.yyyyy.zzzzzzz.invoker"); - Assert.assertEquals(codegen.additionalProperties().get(AbstractJavaCodegen.BOOLEAN_GETTER_PREFIX), "is"); - Assert.assertEquals(codegen.getArtifactVersion(), "0.9.0-SNAPSHOT"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.ARTIFACT_VERSION), "0.9.0-SNAPSHOT"); - } - - @Test - public void testAdditionalPropertiesPutForConfigValues() throws Exception { - OpenAPI openAPI = TestUtils.createOpenAPI(); - - final AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); - codegen.additionalProperties().put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, false); - codegen.additionalProperties().put(CodegenConstants.MODEL_PACKAGE, "xyz.yyyyy.model.oooooo"); - codegen.additionalProperties().put(CodegenConstants.API_PACKAGE, "xyz.yyyyy.api.oooooo"); - codegen.additionalProperties().put(CodegenConstants.INVOKER_PACKAGE, "xyz.yyyyy.invoker.oooooo"); - codegen.additionalProperties().put(AbstractJavaCodegen.BOOLEAN_GETTER_PREFIX, "getBoolean"); - codegen.additionalProperties().put(CodegenConstants.ARTIFACT_VERSION, "0.8.0-SNAPSHOT"); - codegen.processOpts(); - codegen.preprocessOpenAPI(openAPI); - - - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.FALSE); - Assert.assertFalse(codegen.isHideGenerationTimestamp()); - Assert.assertEquals(codegen.modelPackage(), "xyz.yyyyy.model.oooooo"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.MODEL_PACKAGE), "xyz.yyyyy.model.oooooo"); - Assert.assertEquals(codegen.apiPackage(), "xyz.yyyyy.api.oooooo"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.API_PACKAGE), "xyz.yyyyy.api.oooooo"); - Assert.assertEquals(codegen.getInvokerPackage(), "xyz.yyyyy.invoker.oooooo"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.INVOKER_PACKAGE), "xyz.yyyyy.invoker.oooooo"); - Assert.assertEquals(codegen.additionalProperties().get(AbstractJavaCodegen.BOOLEAN_GETTER_PREFIX), "getBoolean"); - Assert.assertEquals(codegen.getArtifactVersion(), "0.8.0-SNAPSHOT"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.ARTIFACT_VERSION), "0.8.0-SNAPSHOT"); - } - - @Test - public void testAdditionalModelTypeAnnotationsSemiColon() throws Exception { - OpenAPI openAPI = TestUtils.createOpenAPI(); - - final AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); - codegen.additionalProperties().put(AbstractJavaCodegen.ADDITIONAL_MODEL_TYPE_ANNOTATIONS, "@Foo;@Bar"); - - codegen.processOpts(); - codegen.preprocessOpenAPI(openAPI); - - final List additionalModelTypeAnnotations = new ArrayList(); - additionalModelTypeAnnotations.add("@Foo"); - additionalModelTypeAnnotations.add("@Bar"); - - final List sortedCodegenAdditionalModelTypeAnnotations = new ArrayList<>(codegen.getAdditionalModelTypeAnnotations()); - final List sortedAdditionalModelTypeAnnotations = new ArrayList<>(codegen.getAdditionalModelTypeAnnotations()); - - Collections.sort(sortedCodegenAdditionalModelTypeAnnotations); - Collections.sort(sortedAdditionalModelTypeAnnotations); - Assert.assertEquals(sortedCodegenAdditionalModelTypeAnnotations, sortedAdditionalModelTypeAnnotations); - } - - @Test - public void testAdditionalModelTypeAnnotationsNewLineLinux() throws Exception { - OpenAPI openAPI = TestUtils.createOpenAPI(); - - final AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); - codegen.additionalProperties().put(AbstractJavaCodegen.ADDITIONAL_MODEL_TYPE_ANNOTATIONS, "@Foo\n@Bar"); - - codegen.processOpts(); - codegen.preprocessOpenAPI(openAPI); - - final List additionalModelTypeAnnotations = new ArrayList(); - additionalModelTypeAnnotations.add("@Foo"); - additionalModelTypeAnnotations.add("@Bar"); - - final List sortedCodegenAdditionalModelTypeAnnotations = new ArrayList<>(codegen.getAdditionalModelTypeAnnotations()); - final List sortedAdditionalModelTypeAnnotations = new ArrayList<>(codegen.getAdditionalModelTypeAnnotations()); - - Collections.sort(sortedCodegenAdditionalModelTypeAnnotations); - Collections.sort(sortedAdditionalModelTypeAnnotations); - Assert.assertEquals(sortedCodegenAdditionalModelTypeAnnotations, sortedAdditionalModelTypeAnnotations); - } - - @Test - public void testAdditionalModelTypeAnnotationsNewLineWindows() throws Exception { - OpenAPI openAPI = TestUtils.createOpenAPI(); - - final AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); - codegen.additionalProperties().put(AbstractJavaCodegen.ADDITIONAL_MODEL_TYPE_ANNOTATIONS, "@Foo\r\n@Bar"); - - codegen.processOpts(); - codegen.preprocessOpenAPI(openAPI); - - final List additionalModelTypeAnnotations = new ArrayList(); - additionalModelTypeAnnotations.add("@Foo"); - additionalModelTypeAnnotations.add("@Bar"); - - final List sortedCodegenAdditionalModelTypeAnnotations = new ArrayList<>(codegen.getAdditionalModelTypeAnnotations()); - final List sortedAdditionalModelTypeAnnotations = new ArrayList<>(codegen.getAdditionalModelTypeAnnotations()); - - Collections.sort(sortedCodegenAdditionalModelTypeAnnotations); - Collections.sort(sortedAdditionalModelTypeAnnotations); - Assert.assertEquals(sortedCodegenAdditionalModelTypeAnnotations, sortedAdditionalModelTypeAnnotations); - } - - @Test - public void testAdditionalModelTypeAnnotationsMixed() throws Exception { - OpenAPI openAPI = TestUtils.createOpenAPI(); - - final AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); - codegen.additionalProperties().put(AbstractJavaCodegen.ADDITIONAL_MODEL_TYPE_ANNOTATIONS, " \t @Foo;\r\n@Bar ;\n @Foobar "); - - codegen.processOpts(); - codegen.preprocessOpenAPI(openAPI); - - final List additionalModelTypeAnnotations = new ArrayList(); - additionalModelTypeAnnotations.add("@Foo"); - additionalModelTypeAnnotations.add("@Bar"); - additionalModelTypeAnnotations.add("@Foobar"); - - final List sortedCodegenAdditionalModelTypeAnnotations = new ArrayList<>(codegen.getAdditionalModelTypeAnnotations()); - final List sortedAdditionalModelTypeAnnotations = new ArrayList<>(codegen.getAdditionalModelTypeAnnotations()); - - Collections.sort(sortedCodegenAdditionalModelTypeAnnotations); - Collections.sort(sortedAdditionalModelTypeAnnotations); - Assert.assertEquals(sortedCodegenAdditionalModelTypeAnnotations, sortedAdditionalModelTypeAnnotations); - } - - @Test - public void testAdditionalModelTypeAnnotationsNoDuplicate() throws Exception { - OpenAPI openAPI = TestUtils.createOpenAPI(); - - final AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); - codegen.additionalProperties().put(AbstractJavaCodegen.ADDITIONAL_MODEL_TYPE_ANNOTATIONS, "@Foo;@Bar;@Foo"); - - codegen.processOpts(); - codegen.preprocessOpenAPI(openAPI); - - final List additionalModelTypeAnnotations = new ArrayList(); - additionalModelTypeAnnotations.add("@Foo"); - additionalModelTypeAnnotations.add("@Bar"); - - final List sortedCodegenAdditionalModelTypeAnnotations = new ArrayList<>(codegen.getAdditionalModelTypeAnnotations()); - final List sortedAdditionalModelTypeAnnotations = new ArrayList<>(codegen.getAdditionalModelTypeAnnotations()); - - Collections.sort(sortedCodegenAdditionalModelTypeAnnotations); - Collections.sort(sortedAdditionalModelTypeAnnotations); - Assert.assertEquals(sortedCodegenAdditionalModelTypeAnnotations, sortedAdditionalModelTypeAnnotations); - } - - @Test - public void toEnumValue() { - final AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); - Assert.assertEquals(codegen.toEnumValue("1", "Integer"), "1"); - Assert.assertEquals(codegen.toEnumValue("42", "Double"), "42"); - Assert.assertEquals(codegen.toEnumValue("1337", "Long"), "1337l"); - Assert.assertEquals(codegen.toEnumValue("3.14", "Float"), "3.14f"); - } - - @Test - public void apiFileFolder() { - final AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); - codegen.setOutputDir("/User/open.api.tools"); - codegen.setSourceFolder("source.folder"); - codegen.setApiPackage("org.openapitools.codegen.api"); - Assert.assertEquals(codegen.apiFileFolder(), "/User/open.api.tools/source.folder/org/openapitools/codegen/api".replace('/', File.separatorChar)); - } - - @Test - public void apiTestFileFolder() { - final AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); - codegen.setOutputDir("/User/open.api.tools"); - codegen.setTestFolder("test.folder"); - codegen.setApiPackage("org.openapitools.codegen.api"); - Assert.assertEquals(codegen.apiTestFileFolder(), "/User/open.api.tools/test.folder/org/openapitools/codegen/api".replace('/', File.separatorChar)); - } - - @Test - public void modelTestFileFolder() { - final AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); - codegen.setOutputDir("/User/open.api.tools"); - codegen.setTestFolder("test.folder"); - codegen.setModelPackage("org.openapitools.codegen.model"); - Assert.assertEquals(codegen.modelTestFileFolder(), "/User/open.api.tools/test.folder/org/openapitools/codegen/model".replace('/', File.separatorChar)); - } - - @Test - public void apiTestFileFolderDirect() { - final AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); - codegen.setOutputTestFolder("/User/open.api.tools"); - codegen.setTestFolder("test.folder"); - codegen.setApiPackage("org.openapitools.codegen.api"); - Assert.assertEquals(codegen.apiTestFileFolder(), "/User/open.api.tools/test.folder/org/openapitools/codegen/api".replace('/', File.separatorChar)); - } - - @Test - public void modelTestFileFolderDirect() { - final AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); - codegen.setOutputTestFolder("/User/open.api.tools"); - codegen.setTestFolder("test.folder"); - codegen.setModelPackage("org.openapitools.codegen.model"); - Assert.assertEquals(codegen.modelTestFileFolder(), "/User/open.api.tools/test.folder/org/openapitools/codegen/model".replace('/', File.separatorChar)); - } - - @Test - public void modelFileFolder() { - final AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); - codegen.setOutputDir("/User/open.api.tools"); - codegen.setSourceFolder("source.folder"); - codegen.setModelPackage("org.openapitools.codegen.model"); - Assert.assertEquals(codegen.modelFileFolder(), "/User/open.api.tools/source.folder/org/openapitools/codegen/model".replace('/', File.separatorChar)); - } - - @Test - public void apiDocFileFolder() { - final AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); - codegen.setOutputDir("/User/open.api.tools"); - Assert.assertEquals(codegen.apiDocFileFolder(), "/User/open.api.tools/docs/".replace('/', File.separatorChar)); - } - - @Test(description = "tests if API version specification is used if no version is provided in additional properties") - public void openApiVersionTest() { - final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); - - OpenAPI api = TestUtils.createOpenAPI(); - codegen.processOpts(); - codegen.preprocessOpenAPI(api); - - Assert.assertEquals(codegen.getArtifactVersion(), "1.0.7"); - } - - @Test(description = "tests if API version specification is used if no version is provided in additional properties with snapshot version") - public void openApiSnapShotVersionTest() { - final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); - - codegen.additionalProperties().put("snapshotVersion", "true"); - - OpenAPI api = TestUtils.createOpenAPI(); - codegen.processOpts(); - codegen.preprocessOpenAPI(api); - - Assert.assertEquals(codegen.getArtifactVersion(), "1.0.7-SNAPSHOT"); - } - - @Test(description = "tests if artifactVersion additional property is used") - public void additionalPropertyArtifactVersionTest() { - final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); - - codegen.additionalProperties().put("artifactVersion", "1.1.1"); - - OpenAPI api = TestUtils.createOpenAPI(); - codegen.processOpts(); - codegen.preprocessOpenAPI(api); - - Assert.assertEquals(codegen.getArtifactVersion(), "1.1.1"); - } - - @Test(description = "tests if artifactVersion additional property is used with snapshot parameter") - public void additionalPropertyArtifactSnapShotVersionTest() { - final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); - - codegen.additionalProperties().put("artifactVersion", "1.1.1"); - codegen.additionalProperties().put("snapshotVersion", "true"); - - OpenAPI api = TestUtils.createOpenAPI(); - codegen.processOpts(); - codegen.preprocessOpenAPI(api); - - Assert.assertEquals(codegen.getArtifactVersion(), "1.1.1-SNAPSHOT"); - } - - @Test(description = "tests if default version is used when neither OpenAPI version nor artifactVersion additional property has been provided") - public void defaultVersionTest() { - final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); - codegen.setArtifactVersion(null); - - OpenAPI api = TestUtils.createOpenAPI(); - api.getInfo().setVersion(null); - codegen.processOpts(); - codegen.preprocessOpenAPI(api); - - Assert.assertEquals(codegen.getArtifactVersion(), "1.0.0"); - } - - @Test(description = "tests if default version with snapshot is used when neither OpenAPI version nor artifactVersion additional property has been provided") - public void snapshotVersionTest() { - final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); - - codegen.additionalProperties().put("snapshotVersion", "true"); - - OpenAPI api = TestUtils.createOpenAPI(); - api.getInfo().setVersion(null); - codegen.processOpts(); - codegen.preprocessOpenAPI(api); - - Assert.assertEquals(codegen.getArtifactVersion(), "1.0.0-SNAPSHOT"); - } - - @Test(description = "tests if default version with snapshot is used when OpenAPI version has been provided") - public void snapshotVersionOpenAPITest() { - final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); - - codegen.additionalProperties().put(CodegenConstants.SNAPSHOT_VERSION, "true"); - - OpenAPI api = TestUtils.createOpenAPI(); - api.getInfo().setVersion("2.0"); - codegen.processOpts(); - codegen.preprocessOpenAPI(api); - - Assert.assertEquals(codegen.getArtifactVersion(), "2.0-SNAPSHOT"); - } - - @Test(description = "tests if setting an artifact version programmatically persists to additional properties, when openapi version is null") - public void allowsProgrammaticallySettingArtifactVersionWithNullOpenApiVersion() { - final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); - final String version = "9.8.7-rc1"; - codegen.setArtifactVersion(version); - - OpenAPI api = TestUtils.createOpenAPI(); - api.getInfo().setVersion(null); - codegen.processOpts(); - codegen.preprocessOpenAPI(api); - - Assert.assertEquals(codegen.getArtifactVersion(), version); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.ARTIFACT_VERSION), version); - } - - @Test(description = "tests if setting an artifact version programmatically persists to additional properties, even when openapi version is specified") - public void allowsProgrammaticallySettingArtifactVersionWithSpecifiedOpenApiVersion() { - final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); - final String version = "9.8.7-rc1"; - codegen.setArtifactVersion(version); - - OpenAPI api = TestUtils.createOpenAPI(); - api.getInfo().setVersion("1.2.3-SNAPSHOT"); - codegen.processOpts(); - codegen.preprocessOpenAPI(api); - - Assert.assertEquals(codegen.getArtifactVersion(), version); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.ARTIFACT_VERSION), version); - } - - @Test(description = "tests if a null in addition properties artifactVersion results in default version") - public void usesDefaultVersionWhenAdditionalPropertiesVersionIsNull() { - final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); - final String version = "1.0.0"; - - OpenAPI api = TestUtils.createOpenAPI(); - api.getInfo().setVersion(null); - codegen.setArtifactVersion(null); - codegen.additionalProperties().put(CodegenConstants.ARTIFACT_VERSION, null); - - codegen.processOpts(); - codegen.preprocessOpenAPI(api); - - Assert.assertEquals(codegen.getArtifactVersion(), version); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.ARTIFACT_VERSION), version); - } - - - @Test(description = "tests if default version with snapshot is used when setArtifactVersion is used") - public void snapshotVersionAlreadySnapshotTest() { - final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); - - codegen.additionalProperties().put(CodegenConstants.SNAPSHOT_VERSION, "true"); - - OpenAPI api = TestUtils.createOpenAPI(); - codegen.setArtifactVersion("4.1.2-SNAPSHOT"); - codegen.processOpts(); - codegen.preprocessOpenAPI(api); - - Assert.assertEquals(codegen.getArtifactVersion(), "4.1.2-SNAPSHOT"); - } - - @Test - public void toDefaultValueDateTimeLegacyTest() { - final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); - codegen.setDateLibrary("legacy"); - String defaultValue; - - // Test default value for date format - DateSchema dateSchema = new DateSchema(); - LocalDate defaultLocalDate = LocalDate.of(2019, 2, 15); - Date date = Date.from(defaultLocalDate.atStartOfDay(ZoneId.systemDefault()).toInstant()); - dateSchema.setDefault(date); - defaultValue = codegen.toDefaultValue(dateSchema); - - // dateLibrary <> java8 - Assert.assertNull(defaultValue); - - DateTimeSchema dateTimeSchema = new DateTimeSchema(); - OffsetDateTime defaultDateTime = OffsetDateTime.parse("1984-12-19T03:39:57-08:00"); - ZonedDateTime expectedDateTime = defaultDateTime.atZoneSameInstant(ZoneId.systemDefault()); - dateTimeSchema.setDefault(defaultDateTime); - defaultValue = codegen.toDefaultValue(dateTimeSchema); - - // dateLibrary <> java8 - Assert.assertNull(defaultValue); - } - - @Test - public void toDefaultValueTest() { - final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); - codegen.setDateLibrary("java8"); - - - Schema schema = createObjectSchemaWithMinItems(); - String defaultValue = codegen.toDefaultValue(schema); - Assert.assertNull(defaultValue); - - // Create an alias to an array schema - Schema nestedArraySchema = new ArraySchema().items(new IntegerSchema().format("int32")); - codegen.setOpenAPI(new OpenAPI().components(new Components().addSchemas("NestedArray", nestedArraySchema))); - - // Create an array schema with item type set to the array alias - schema = new ArraySchema().items(new Schema().$ref("#/components/schemas/NestedArray")); - - ModelUtils.setGenerateAliasAsModel(false); - defaultValue = codegen.toDefaultValue(schema); - Assert.assertEquals(defaultValue, "new ArrayList<>()"); - - ModelUtils.setGenerateAliasAsModel(true); - defaultValue = codegen.toDefaultValue(schema); - Assert.assertEquals(defaultValue, "new ArrayList<>()"); - - // Create a map schema with additionalProperties type set to array alias - schema = new MapSchema().additionalProperties(new Schema().$ref("#/components/schemas/NestedArray")); - - ModelUtils.setGenerateAliasAsModel(false); - defaultValue = codegen.toDefaultValue(schema); - Assert.assertEquals(defaultValue, "new HashMap<>()"); - - ModelUtils.setGenerateAliasAsModel(true); - defaultValue = codegen.toDefaultValue(schema); - Assert.assertEquals(defaultValue, "new HashMap<>()"); - - // Test default value for date format - DateSchema dateSchema = new DateSchema(); - LocalDate defaultLocalDate = LocalDate.of(2019, 2, 15); - Date date = Date.from(defaultLocalDate.atStartOfDay(ZoneId.systemDefault()).toInstant()); - dateSchema.setDefault(date); - defaultValue = codegen.toDefaultValue(dateSchema); - Assert.assertEquals(defaultValue, "LocalDate.parse(\"" + defaultLocalDate.toString() + "\")"); - - DateTimeSchema dateTimeSchema = new DateTimeSchema(); - OffsetDateTime defaultDateTime = OffsetDateTime.parse("1984-12-19T03:39:57-08:00"); - ZonedDateTime expectedDateTime = defaultDateTime.atZoneSameInstant(ZoneId.systemDefault()); - dateTimeSchema.setDefault(defaultDateTime); - defaultValue = codegen.toDefaultValue(dateTimeSchema); - Assert.assertTrue(defaultValue.startsWith("OffsetDateTime.parse(\"" + expectedDateTime.toString())); - - // Test default value for number without format - NumberSchema numberSchema = new NumberSchema(); - Double doubleValue = 100.0; - numberSchema.setDefault(doubleValue); - defaultValue = codegen.toDefaultValue(numberSchema); - Assert.assertEquals(defaultValue, "new BigDecimal(\"" + doubleValue + "\")"); - - // Test default value for number with format set to double - numberSchema.setFormat("double"); - defaultValue = codegen.toDefaultValue(numberSchema); - Assert.assertEquals(defaultValue, doubleValue + "d"); - } - - @Test - public void dateDefaultValueIsIsoDate() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/spring/date-time-parameter-types-for-testing.yml"); - final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); - codegen.setOpenAPI(openAPI); - - Set imports = new HashSet<>(); - CodegenParameter parameter = codegen.fromParameter(openAPI.getPaths().get("/thingy/{date}").getGet().getParameters().get(2), imports); - - Assert.assertEquals(parameter.dataType, "Date"); - Assert.assertEquals(parameter.isDate, true); - Assert.assertEquals(parameter.defaultValue, "1974-01-01"); - Assert.assertEquals(imports.size(), 1); - Assert.assertEquals(imports.iterator().next(), "Date"); - - Assert.assertNotNull(parameter.getSchema()); - Assert.assertEquals(parameter.getSchema().baseType, "Date"); - } - - @Test - public void dateDefaultValueIsIsoDateTime() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/spring/date-time-parameter-types-for-testing.yml"); - final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); - codegen.setOpenAPI(openAPI); - - Set imports = new HashSet<>(); - CodegenParameter parameter = codegen.fromParameter(openAPI.getPaths().get("/thingy/{date}").getGet().getParameters().get(1), imports); - - Assert.assertEquals(parameter.dataType, "Date"); - Assert.assertEquals(parameter.isDateTime, true); - Assert.assertEquals(parameter.defaultValue, "1973-12-19T03:39:57-08:00"); - Assert.assertEquals(imports.size(), 1); - Assert.assertEquals(imports.iterator().next(), "Date"); - - Assert.assertNotNull(parameter.getSchema()); - Assert.assertEquals(parameter.getSchema().baseType, "Date"); - } - - @Test - public void getTypeDeclarationGivenSchemaMappingTest() { - final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); - codegen.schemaMapping().put("MyStringType", "com.example.foo"); - codegen.setOpenAPI(new OpenAPI().components(new Components().addSchemas("MyStringType", new StringSchema()))); - Schema schema = new ArraySchema().items(new Schema().$ref("#/components/schemas/MyStringType")); - String defaultValue = codegen.getTypeDeclaration(schema); - Assert.assertEquals(defaultValue, "List"); - } - - @Test - public void getTypeDeclarationTest() { - final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); - - Schema schema = createObjectSchemaWithMinItems(); - String defaultValue = codegen.getTypeDeclaration(schema); - Assert.assertEquals(defaultValue, "Object"); - - // Create an alias to an array schema - Schema nestedArraySchema = new ArraySchema().items(new IntegerSchema().format("int32")); - codegen.setOpenAPI(new OpenAPI().components(new Components().addSchemas("NestedArray", nestedArraySchema))); - - // Create an array schema with item type set to the array alias - schema = new ArraySchema().items(new Schema().$ref("#/components/schemas/NestedArray")); - - ModelUtils.setGenerateAliasAsModel(false); - defaultValue = codegen.getTypeDeclaration(schema); - Assert.assertEquals(defaultValue, "List>"); - - ModelUtils.setGenerateAliasAsModel(true); - defaultValue = codegen.getTypeDeclaration(schema); - Assert.assertEquals(defaultValue, "List"); - - // Create an array schema with item type set to the array alias - schema = new ArraySchema().items(new Schema().$ref("#/components/schemas/NestedArray")); - schema.setUniqueItems(true); - - ModelUtils.setGenerateAliasAsModel(false); - defaultValue = codegen.getTypeDeclaration(schema); - Assert.assertEquals(defaultValue, "Set>"); - - ModelUtils.setGenerateAliasAsModel(true); - defaultValue = codegen.getTypeDeclaration(schema); - Assert.assertEquals(defaultValue, "Set"); - - // Create a map schema with additionalProperties type set to array alias - schema = new MapSchema().additionalProperties(new Schema().$ref("#/components/schemas/NestedArray")); - - ModelUtils.setGenerateAliasAsModel(false); - defaultValue = codegen.getTypeDeclaration(schema); - Assert.assertEquals(defaultValue, "Map>"); - - ModelUtils.setGenerateAliasAsModel(true); - defaultValue = codegen.getTypeDeclaration(schema); - Assert.assertEquals(defaultValue, "Map"); - } - - @Test - public void processOptsBooleanTrueFromString() { - final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/petstore.yaml"); - codegen.additionalProperties().put(CodegenConstants.SNAPSHOT_VERSION, "true"); - codegen.preprocessOpenAPI(openAPI); - Assert.assertTrue((boolean) codegen.additionalProperties().get(CodegenConstants.SNAPSHOT_VERSION)); - } - - @Test - public void processOptsBooleanTrueFromBoolean() { - final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/petstore.yaml"); - codegen.additionalProperties().put(CodegenConstants.SNAPSHOT_VERSION, true); - codegen.preprocessOpenAPI(openAPI); - Assert.assertTrue((boolean) codegen.additionalProperties().get(CodegenConstants.SNAPSHOT_VERSION)); - } - - @Test - public void processOptsBooleanFalseFromString() { - final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/petstore.yaml"); - codegen.additionalProperties().put(CodegenConstants.SNAPSHOT_VERSION, "false"); - codegen.preprocessOpenAPI(openAPI); - Assert.assertFalse((boolean) codegen.additionalProperties().get(CodegenConstants.SNAPSHOT_VERSION)); - } - - @Test - public void processOptsBooleanFalseFromBoolean() { - final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/petstore.yaml"); - codegen.additionalProperties().put(CodegenConstants.SNAPSHOT_VERSION, false); - codegen.preprocessOpenAPI(openAPI); - Assert.assertFalse((boolean) codegen.additionalProperties().get(CodegenConstants.SNAPSHOT_VERSION)); - } - - @Test - public void processOptsBooleanFalseFromGarbage() { - final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/petstore.yaml"); - codegen.additionalProperties().put(CodegenConstants.SNAPSHOT_VERSION, "blibb"); - codegen.preprocessOpenAPI(openAPI); - Assert.assertFalse((boolean) codegen.additionalProperties().get(CodegenConstants.SNAPSHOT_VERSION)); - } - - @Test - public void processOptsBooleanFalseFromNumeric() { - final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/petstore.yaml"); - codegen.additionalProperties().put(CodegenConstants.SNAPSHOT_VERSION, 42L); - codegen.preprocessOpenAPI(openAPI); - Assert.assertFalse((boolean) codegen.additionalProperties().get(CodegenConstants.SNAPSHOT_VERSION)); - } - - @Test - public void nullDefaultValueForModelWithDynamicProperties() { - final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/mapSchemas.yaml"); - codegen.additionalProperties().put(CodegenConstants.GENERATE_ALIAS_AS_MODEL, true); - codegen.setOpenAPI(openAPI); - - Schema schema = openAPI.getComponents().getSchemas().get("ModelWithAdditionalProperties"); - CodegenModel cm = codegen.fromModel("ModelWithAdditionalProperties", schema); - Assert.assertEquals(cm.vars.size(), 1, "Expected single declared var"); - Assert.assertEquals(cm.vars.get(0).name, "id"); - Assert.assertNull(cm.defaultValue, "Expected no defined default value in spec"); - - String defaultValue = codegen.toDefaultValue(schema); - Assert.assertNull(defaultValue); - } - - @Test - public void maplikeDefaultValueForModelWithStringToStringMapping() { - final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/mapSchemas.yaml"); - codegen.additionalProperties().put(CodegenConstants.GENERATE_ALIAS_AS_MODEL, true); - codegen.setOpenAPI(openAPI); - - Schema schema = openAPI.getComponents().getSchemas().get("ModelWithStringToStringMapping"); - CodegenModel cm = codegen.fromModel("ModelWithAdditionalProperties", schema); - Assert.assertEquals(cm.vars.size(), 0, "Expected no declared vars"); - Assert.assertNull(cm.defaultValue, "Expected no defined default value in spec"); - - String defaultValue = codegen.toDefaultValue(schema); - Assert.assertEquals(defaultValue, "new HashMap<>()", "Expected string-string map aliased model to default to new HashMap()"); - } - - @Test - public void maplikeDefaultValueForModelWithStringToModelMapping() { - final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/mapSchemas.yaml"); - codegen.additionalProperties().put(CodegenConstants.GENERATE_ALIAS_AS_MODEL, true); - codegen.setOpenAPI(openAPI); - - Schema schema = openAPI.getComponents().getSchemas().get("ModelWithStringToModelMapping"); - CodegenModel cm = codegen.fromModel("ModelWithStringToModelMapping", schema); - Assert.assertEquals(cm.vars.size(), 0, "Expected no declared vars"); - Assert.assertNull(cm.defaultValue, "Expected no defined default value in spec"); - - String defaultValue = codegen.toDefaultValue(schema); - Assert.assertEquals(defaultValue, "new HashMap<>()", "Expected string-ref map aliased model to default to new HashMap()"); - } - - @Test - public void srcMainFolderShouldNotBeOperatingSystemSpecificPaths() { - // it's not responsibility of the generator to fix OS-specific paths. This is left to template manager. - // This path must be non-OS-specific for expectations in source outputs (e.g. gradle build files) - Assert.assertEquals(fakeJavaCodegen.getSourceFolder(), "src/main/java"); - } - - @Test - public void srcTestFolderShouldNotBeOperatingSystemSpecificPaths() { - // it's not responsibility of the generator to fix OS-specific paths. This is left to template manager. - // This path must be non-OS-specific for expectations in source outputs (e.g. gradle build files) - Assert.assertEquals(fakeJavaCodegen.getTestFolder(), "src/test/java"); - } - - private static Schema createObjectSchemaWithMinItems() { - return new ObjectSchema() - .addProperties("id", new IntegerSchema().format("int32")) - .minItems(1); - } - - private static class P_AbstractJavaCodegen extends AbstractJavaCodegen { - @Override - public CodegenType getTag() { - return null; - } - - @Override - public String getName() { - return null; - } - - @Override - public String getHelp() { - return null; - } - - /** - * Gets artifact version. - * Only for testing purposes. - * - * @return version - */ - public String getArtifactVersion() { - return this.artifactVersion; - } - } -} diff --git a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java b/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java deleted file mode 100644 index e4b4fc94da6..00000000000 --- a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java +++ /dev/null @@ -1,1668 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen.java; - -import static org.openapitools.codegen.TestUtils.validateJavaSourceFiles; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; -import static org.testng.Assert.fail; - -import java.io.File; -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Optional; -import java.util.function.Function; -import java.util.function.Predicate; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import java.util.stream.Collectors; - -import org.openapitools.codegen.ClientOptInput; -import org.openapitools.codegen.CodegenConstants; -import org.openapitools.codegen.CodegenModel; -import org.openapitools.codegen.CodegenOperation; -import org.openapitools.codegen.CodegenParameter; -import org.openapitools.codegen.CodegenProperty; -import org.openapitools.codegen.CodegenResponse; -import org.openapitools.codegen.CodegenSecurity; -import org.openapitools.codegen.DefaultGenerator; -import org.openapitools.codegen.TestUtils; -import org.openapitools.codegen.config.CodegenConfigurator; -import org.openapitools.codegen.java.assertions.JavaFileAssert; -import org.openapitools.codegen.languages.AbstractJavaCodegen; -import org.openapitools.codegen.languages.JavaClientCodegen; -import org.openapitools.codegen.languages.features.BeanValidationFeatures; -import org.openapitools.codegen.languages.features.CXFServerFeatures; -import org.openapitools.codegen.model.OperationMap; -import org.openapitools.codegen.model.OperationsMap; -import org.testng.Assert; -import org.testng.annotations.Ignore; -import org.testng.annotations.Test; - -import com.google.common.collect.ImmutableMap; -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.Operation; -import io.swagger.v3.oas.models.media.ArraySchema; -import io.swagger.v3.oas.models.media.ComposedSchema; -import io.swagger.v3.oas.models.media.Content; -import io.swagger.v3.oas.models.media.IntegerSchema; -import io.swagger.v3.oas.models.media.MediaType; -import io.swagger.v3.oas.models.media.ObjectSchema; -import io.swagger.v3.oas.models.media.Schema; -import io.swagger.v3.oas.models.media.StringSchema; -import io.swagger.v3.oas.models.parameters.RequestBody; -import io.swagger.v3.oas.models.responses.ApiResponse; -import io.swagger.v3.parser.util.SchemaTypeUtil; - -public class JavaClientCodegenTest { - - @Test - public void arraysInRequestBody() { - OpenAPI openAPI = TestUtils.createOpenAPI(); - final JavaClientCodegen codegen = new JavaClientCodegen(); - codegen.setOpenAPI(openAPI); - - RequestBody body1 = new RequestBody(); - body1.setDescription("A list of ids"); - body1.setContent(new Content().addMediaType("application/json", new MediaType().schema(new ArraySchema().items(new StringSchema())))); - CodegenParameter codegenParameter1 = codegen.fromRequestBody(body1, new HashSet(), null); - Assert.assertEquals(codegenParameter1.description, "A list of ids"); - Assert.assertEquals(codegenParameter1.dataType, "List"); - Assert.assertEquals(codegenParameter1.baseType, "String"); - - RequestBody body2 = new RequestBody(); - body2.setDescription("A list of list of values"); - body2.setContent(new Content().addMediaType("application/json", new MediaType().schema(new ArraySchema().items(new ArraySchema().items(new IntegerSchema()))))); - CodegenParameter codegenParameter2 = codegen.fromRequestBody(body2, new HashSet(), null); - Assert.assertEquals(codegenParameter2.description, "A list of list of values"); - Assert.assertEquals(codegenParameter2.dataType, "List>"); - Assert.assertEquals(codegenParameter2.baseType, "List"); - - RequestBody body3 = new RequestBody(); - body3.setDescription("A list of points"); - body3.setContent(new Content().addMediaType("application/json", new MediaType().schema(new ArraySchema().items(new ObjectSchema().$ref("#/components/schemas/Point"))))); - ObjectSchema point = new ObjectSchema(); - point.addProperties("message", new StringSchema()); - point.addProperties("x", new IntegerSchema().format(SchemaTypeUtil.INTEGER32_FORMAT)); - point.addProperties("y", new IntegerSchema().format(SchemaTypeUtil.INTEGER32_FORMAT)); - CodegenParameter codegenParameter3 = codegen.fromRequestBody(body3, new HashSet(), null); - Assert.assertEquals(codegenParameter3.description, "A list of points"); - Assert.assertEquals(codegenParameter3.dataType, "List"); - Assert.assertEquals(codegenParameter3.baseType, "Point"); - } - - @Test - public void nullValuesInComposedSchema() { - final JavaClientCodegen codegen = new JavaClientCodegen(); - ComposedSchema schema = new ComposedSchema(); - CodegenModel result = codegen.fromModel("CompSche", - schema); - Assert.assertEquals(result.name, "CompSche"); - } - - @Test - public void testParametersAreCorrectlyOrderedWhenUsingRetrofit() { - JavaClientCodegen javaClientCodegen = new JavaClientCodegen(); - javaClientCodegen.setLibrary(JavaClientCodegen.RETROFIT_2); - - CodegenOperation codegenOperation = new CodegenOperation(); - CodegenParameter queryParamRequired = createQueryParam("queryParam1", true); - CodegenParameter queryParamOptional = createQueryParam("queryParam2", false); - CodegenParameter pathParam1 = createPathParam("pathParam1"); - CodegenParameter pathParam2 = createPathParam("pathParam2"); - - codegenOperation.allParams.addAll(Arrays.asList(queryParamRequired, pathParam1, pathParam2, queryParamOptional)); - OperationMap operations = new OperationMap(); - operations.setOperation(codegenOperation); - - OperationsMap objs = new OperationsMap(); - objs.setOperation(operations); - objs.setImports(new ArrayList<>()); - - javaClientCodegen.postProcessOperationsWithModels(objs, Collections.emptyList()); - - Assert.assertEquals(Arrays.asList(pathParam1, pathParam2, queryParamRequired, queryParamOptional), codegenOperation.allParams); - } - - @Test - public void testInitialConfigValues() throws Exception { - final JavaClientCodegen codegen = new JavaClientCodegen(); - codegen.processOpts(); - - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.FALSE); - Assert.assertFalse(codegen.isHideGenerationTimestamp()); - - Assert.assertEquals(codegen.modelPackage(), "org.openapitools.client.model"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.MODEL_PACKAGE), "org.openapitools.client.model"); - Assert.assertEquals(codegen.apiPackage(), "org.openapitools.client.api"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.API_PACKAGE), "org.openapitools.client.api"); - Assert.assertEquals(codegen.getInvokerPackage(), "org.openapitools.client"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.INVOKER_PACKAGE), "org.openapitools.client"); - Assert.assertEquals(codegen.getSerializationLibrary(), JavaClientCodegen.SERIALIZATION_LIBRARY_GSON); - } - - @Test - public void testSettersForConfigValues() throws Exception { - final JavaClientCodegen codegen = new JavaClientCodegen(); - codegen.setHideGenerationTimestamp(true); - codegen.setModelPackage("xyz.yyyyy.zzzzzzz.model"); - codegen.setApiPackage("xyz.yyyyy.zzzzzzz.api"); - codegen.setInvokerPackage("xyz.yyyyy.zzzzzzz.invoker"); - codegen.setSerializationLibrary("JACKSON"); - codegen.processOpts(); - - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.TRUE); - Assert.assertTrue(codegen.isHideGenerationTimestamp()); - Assert.assertEquals(codegen.modelPackage(), "xyz.yyyyy.zzzzzzz.model"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.MODEL_PACKAGE), "xyz.yyyyy.zzzzzzz.model"); - Assert.assertEquals(codegen.apiPackage(), "xyz.yyyyy.zzzzzzz.api"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.API_PACKAGE), "xyz.yyyyy.zzzzzzz.api"); - Assert.assertEquals(codegen.getInvokerPackage(), "xyz.yyyyy.zzzzzzz.invoker"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.INVOKER_PACKAGE), "xyz.yyyyy.zzzzzzz.invoker"); - Assert.assertEquals(codegen.getSerializationLibrary(), JavaClientCodegen.SERIALIZATION_LIBRARY_GSON); // the library JavaClientCodegen.OKHTTP_GSON only supports GSON - } - - @Test - public void testAdditionalPropertiesPutForConfigValues() throws Exception { - final JavaClientCodegen codegen = new JavaClientCodegen(); - codegen.additionalProperties().put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, "true"); - codegen.additionalProperties().put(CodegenConstants.MODEL_PACKAGE, "xyz.yyyyy.zzzzzzz.mmmmm.model"); - codegen.additionalProperties().put(CodegenConstants.API_PACKAGE, "xyz.yyyyy.zzzzzzz.aaaaa.api"); - codegen.additionalProperties().put(CodegenConstants.INVOKER_PACKAGE, "xyz.yyyyy.zzzzzzz.iiii.invoker"); - codegen.additionalProperties().put(CodegenConstants.SERIALIZATION_LIBRARY, "JACKSON"); - codegen.additionalProperties().put(CodegenConstants.LIBRARY, JavaClientCodegen.JERSEY2); - codegen.processOpts(); - - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.TRUE); - Assert.assertTrue(codegen.isHideGenerationTimestamp()); - Assert.assertEquals(codegen.modelPackage(), "xyz.yyyyy.zzzzzzz.mmmmm.model"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.MODEL_PACKAGE), "xyz.yyyyy.zzzzzzz.mmmmm.model"); - Assert.assertEquals(codegen.apiPackage(), "xyz.yyyyy.zzzzzzz.aaaaa.api"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.API_PACKAGE), "xyz.yyyyy.zzzzzzz.aaaaa.api"); - Assert.assertEquals(codegen.getInvokerPackage(), "xyz.yyyyy.zzzzzzz.iiii.invoker"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.INVOKER_PACKAGE), "xyz.yyyyy.zzzzzzz.iiii.invoker"); - Assert.assertEquals(codegen.getSerializationLibrary(), JavaClientCodegen.SERIALIZATION_LIBRARY_JACKSON); - } - - @Test - public void testPackageNamesSetInvokerDerivedFromApi() { - final JavaClientCodegen codegen = new JavaClientCodegen(); - codegen.additionalProperties().put(CodegenConstants.MODEL_PACKAGE, "xyz.yyyyy.zzzzzzz.mmmmm.model"); - codegen.additionalProperties().put(CodegenConstants.API_PACKAGE, "xyz.yyyyy.zzzzzzz.aaaaa.api"); - codegen.processOpts(); - - Assert.assertEquals(codegen.modelPackage(), "xyz.yyyyy.zzzzzzz.mmmmm.model"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.MODEL_PACKAGE), "xyz.yyyyy.zzzzzzz.mmmmm.model"); - Assert.assertEquals(codegen.apiPackage(), "xyz.yyyyy.zzzzzzz.aaaaa.api"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.API_PACKAGE), "xyz.yyyyy.zzzzzzz.aaaaa.api"); - Assert.assertEquals(codegen.getInvokerPackage(), "xyz.yyyyy.zzzzzzz.aaaaa"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.INVOKER_PACKAGE), "xyz.yyyyy.zzzzzzz.aaaaa"); - } - - @Test - public void testPackageNamesSetInvokerDerivedFromModel() { - final JavaClientCodegen codegen = new JavaClientCodegen(); - codegen.additionalProperties().put(CodegenConstants.MODEL_PACKAGE, "xyz.yyyyy.zzzzzzz.mmmmm.model"); - codegen.processOpts(); - - Assert.assertEquals(codegen.modelPackage(), "xyz.yyyyy.zzzzzzz.mmmmm.model"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.MODEL_PACKAGE), "xyz.yyyyy.zzzzzzz.mmmmm.model"); - Assert.assertEquals(codegen.apiPackage(), "org.openapitools.client.api"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.API_PACKAGE), "org.openapitools.client.api"); - Assert.assertEquals(codegen.getInvokerPackage(), "xyz.yyyyy.zzzzzzz.mmmmm"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.INVOKER_PACKAGE), "xyz.yyyyy.zzzzzzz.mmmmm"); - } - - @Test - public void testGetSchemaTypeWithComposedSchemaWithAllOf() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/2_0/composed-allof.yaml"); - final JavaClientCodegen codegen = new JavaClientCodegen(); - - Operation operation = openAPI.getPaths().get("/ping").getPost(); - CodegenOperation co = codegen.fromOperation("/ping", "POST", operation, null); - Assert.assertEquals(co.allParams.size(), 1); - Assert.assertEquals(co.allParams.get(0).baseType, "MessageEventCoreWithTimeListEntries"); - } - - @Test - public void updateCodegenPropertyEnum() { - final JavaClientCodegen codegen = new JavaClientCodegen(); - CodegenProperty array = codegenPropertyWithArrayOfIntegerValues(); - - codegen.updateCodegenPropertyEnum(array); - - List> enumVars = (List>) array.getItems().getAllowableValues().get("enumVars"); - Assert.assertNotNull(enumVars); - Map testedEnumVar = enumVars.get(0); - Assert.assertNotNull(testedEnumVar); - Assert.assertEquals(testedEnumVar.getOrDefault("name", ""), "NUMBER_1"); - Assert.assertEquals(testedEnumVar.getOrDefault("value", ""), "1"); - } - - @Test - public void updateCodegenPropertyEnumWithCustomNames() { - final JavaClientCodegen codegen = new JavaClientCodegen(); - CodegenProperty array = codegenPropertyWithArrayOfIntegerValues(); - array.getItems().setVendorExtensions(Collections.singletonMap("x-enum-varnames", Collections.singletonList("ONE"))); - - codegen.updateCodegenPropertyEnum(array); - - List> enumVars = (List>) array.getItems().getAllowableValues().get("enumVars"); - Assert.assertNotNull(enumVars); - Map testedEnumVar = enumVars.get(0); - Assert.assertNotNull(testedEnumVar); - Assert.assertEquals(testedEnumVar.getOrDefault("name", ""), "ONE"); - Assert.assertEquals(testedEnumVar.getOrDefault("value", ""), "1"); - } - - @Test - public void testGeneratePing() throws Exception { - Map properties = new HashMap<>(); - properties.put(CodegenConstants.API_PACKAGE, "xyz.abcdef.api"); - - File output = Files.createTempDirectory("test").toFile(); - - final CodegenConfigurator configurator = new CodegenConfigurator() - .setGeneratorName("java") - .setLibrary(JavaClientCodegen.OKHTTP_GSON) - .setAdditionalProperties(properties) - .setInputSpec("src/test/resources/3_0/ping.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); - - final ClientOptInput clientOptInput = configurator.toClientOptInput(); - DefaultGenerator generator = new DefaultGenerator(); - List files = generator.opts(clientOptInput).generate(); - - Assert.assertEquals(files.size(), 40); - TestUtils.ensureContainsFile(files, output, ".gitignore"); - TestUtils.ensureContainsFile(files, output, ".openapi-generator-ignore"); - TestUtils.ensureContainsFile(files, output, ".openapi-generator/FILES"); - TestUtils.ensureContainsFile(files, output, ".openapi-generator/VERSION"); - TestUtils.ensureContainsFile(files, output, ".travis.yml"); - TestUtils.ensureContainsFile(files, output, "build.gradle"); - TestUtils.ensureContainsFile(files, output, "build.sbt"); - TestUtils.ensureContainsFile(files, output, "docs/DefaultApi.md"); - TestUtils.ensureContainsFile(files, output, "git_push.sh"); - TestUtils.ensureContainsFile(files, output, "gradle.properties"); - TestUtils.ensureContainsFile(files, output, "gradle/wrapper/gradle-wrapper.jar"); - TestUtils.ensureContainsFile(files, output, "gradle/wrapper/gradle-wrapper.properties"); - TestUtils.ensureContainsFile(files, output, "gradlew.bat"); - TestUtils.ensureContainsFile(files, output, "gradlew"); - TestUtils.ensureContainsFile(files, output, "pom.xml"); - TestUtils.ensureContainsFile(files, output, "README.md"); - TestUtils.ensureContainsFile(files, output, "settings.gradle"); - TestUtils.ensureContainsFile(files, output, "api/openapi.yaml"); - TestUtils.ensureContainsFile(files, output, "src/main/AndroidManifest.xml"); - TestUtils.ensureContainsFile(files, output, "src/main/java/xyz/abcdef/api/DefaultApi.java"); - TestUtils.ensureContainsFile(files, output, "src/main/java/xyz/abcdef/ApiCallback.java"); - TestUtils.ensureContainsFile(files, output, "src/main/java/xyz/abcdef/ApiClient.java"); - TestUtils.ensureContainsFile(files, output, "src/main/java/xyz/abcdef/ApiException.java"); - TestUtils.ensureContainsFile(files, output, "src/main/java/xyz/abcdef/ApiResponse.java"); - TestUtils.ensureContainsFile(files, output, "src/main/java/xyz/abcdef/ServerConfiguration.java"); - TestUtils.ensureContainsFile(files, output, "src/main/java/xyz/abcdef/ServerVariable.java"); - TestUtils.ensureContainsFile(files, output, "src/main/java/xyz/abcdef/auth/ApiKeyAuth.java"); - TestUtils.ensureContainsFile(files, output, "src/main/java/xyz/abcdef/auth/Authentication.java"); - TestUtils.ensureContainsFile(files, output, "src/main/java/xyz/abcdef/auth/HttpBasicAuth.java"); - TestUtils.ensureContainsFile(files, output, "src/main/java/xyz/abcdef/auth/HttpBearerAuth.java"); - TestUtils.ensureContainsFile(files, output, "src/main/java/xyz/abcdef/Configuration.java"); - TestUtils.ensureContainsFile(files, output, "src/main/java/xyz/abcdef/GzipRequestInterceptor.java"); - TestUtils.ensureContainsFile(files, output, "src/main/java/xyz/abcdef/JSON.java"); - TestUtils.ensureContainsFile(files, output, "src/main/java/xyz/abcdef/Pair.java"); - TestUtils.ensureContainsFile(files, output, "src/main/java/xyz/abcdef/ProgressRequestBody.java"); - TestUtils.ensureContainsFile(files, output, "src/main/java/xyz/abcdef/ProgressResponseBody.java"); - TestUtils.ensureContainsFile(files, output, "src/main/java/xyz/abcdef/StringUtil.java"); - TestUtils.ensureContainsFile(files, output, "src/test/java/xyz/abcdef/api/DefaultApiTest.java"); - - validateJavaSourceFiles(files); - - TestUtils.assertFileContains(Paths.get(output + "/src/main/java/xyz/abcdef/api/DefaultApi.java"), "public class DefaultApi"); - - output.deleteOnExit(); - } - - @Test - public void testGeneratePingSomeObj() throws Exception { - Map properties = new HashMap<>(); - properties.put(CodegenConstants.MODEL_PACKAGE, "zz.yyyy.model.xxxx"); - properties.put(CodegenConstants.API_PACKAGE, "zz.yyyy.api.xxxx"); - properties.put(CodegenConstants.INVOKER_PACKAGE, "zz.yyyy.invoker.xxxx"); - properties.put(AbstractJavaCodegen.BOOLEAN_GETTER_PREFIX, "is"); - - File output = Files.createTempDirectory("test").toFile(); - - final CodegenConfigurator configurator = new CodegenConfigurator() - .setGeneratorName("java") - .setLibrary(JavaClientCodegen.OKHTTP_GSON) - .setAdditionalProperties(properties) - .setInputSpec("src/test/resources/3_0/pingSomeObj.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); - - final ClientOptInput clientOptInput = configurator.toClientOptInput(); - DefaultGenerator generator = new DefaultGenerator(); - List files = generator.opts(clientOptInput).generate(); - - Assert.assertEquals(files.size(), 43); - TestUtils.ensureContainsFile(files, output, ".gitignore"); - TestUtils.ensureContainsFile(files, output, ".openapi-generator-ignore"); - TestUtils.ensureContainsFile(files, output, ".openapi-generator/FILES"); - TestUtils.ensureContainsFile(files, output, ".openapi-generator/VERSION"); - TestUtils.ensureContainsFile(files, output, ".travis.yml"); - TestUtils.ensureContainsFile(files, output, "build.gradle"); - TestUtils.ensureContainsFile(files, output, "build.sbt"); - TestUtils.ensureContainsFile(files, output, "docs/PingApi.md"); - TestUtils.ensureContainsFile(files, output, "docs/SomeObj.md"); - TestUtils.ensureContainsFile(files, output, "git_push.sh"); - TestUtils.ensureContainsFile(files, output, "gradle.properties"); - TestUtils.ensureContainsFile(files, output, "gradle/wrapper/gradle-wrapper.jar"); - TestUtils.ensureContainsFile(files, output, "gradle/wrapper/gradle-wrapper.properties"); - TestUtils.ensureContainsFile(files, output, "gradlew.bat"); - TestUtils.ensureContainsFile(files, output, "gradlew"); - TestUtils.ensureContainsFile(files, output, "pom.xml"); - TestUtils.ensureContainsFile(files, output, "README.md"); - TestUtils.ensureContainsFile(files, output, "settings.gradle"); - TestUtils.ensureContainsFile(files, output, "api/openapi.yaml"); - TestUtils.ensureContainsFile(files, output, "src/main/AndroidManifest.xml"); - TestUtils.ensureContainsFile(files, output, "src/main/java/zz/yyyy/api/xxxx/PingApi.java"); - TestUtils.ensureContainsFile(files, output, "src/main/java/zz/yyyy/invoker/xxxx/ApiCallback.java"); - TestUtils.ensureContainsFile(files, output, "src/main/java/zz/yyyy/invoker/xxxx/ApiClient.java"); - TestUtils.ensureContainsFile(files, output, "src/main/java/zz/yyyy/invoker/xxxx/ApiException.java"); - TestUtils.ensureContainsFile(files, output, "src/main/java/zz/yyyy/invoker/xxxx/ApiResponse.java"); - TestUtils.ensureContainsFile(files, output, "src/main/java/zz/yyyy/invoker/xxxx/ServerConfiguration.java"); - TestUtils.ensureContainsFile(files, output, "src/main/java/zz/yyyy/invoker/xxxx/ServerVariable.java"); - TestUtils.ensureContainsFile(files, output, "src/main/java/zz/yyyy/invoker/xxxx/auth/ApiKeyAuth.java"); - TestUtils.ensureContainsFile(files, output, "src/main/java/zz/yyyy/invoker/xxxx/auth/Authentication.java"); - TestUtils.ensureContainsFile(files, output, "src/main/java/zz/yyyy/invoker/xxxx/auth/HttpBasicAuth.java"); - TestUtils.ensureContainsFile(files, output, "src/main/java/zz/yyyy/invoker/xxxx/auth/HttpBearerAuth.java"); - TestUtils.ensureContainsFile(files, output, "src/main/java/zz/yyyy/invoker/xxxx/Configuration.java"); - TestUtils.ensureContainsFile(files, output, "src/main/java/zz/yyyy/invoker/xxxx/GzipRequestInterceptor.java"); - TestUtils.ensureContainsFile(files, output, "src/main/java/zz/yyyy/invoker/xxxx/JSON.java"); - TestUtils.ensureContainsFile(files, output, "src/main/java/zz/yyyy/invoker/xxxx/Pair.java"); - TestUtils.ensureContainsFile(files, output, "src/main/java/zz/yyyy/invoker/xxxx/ProgressRequestBody.java"); - TestUtils.ensureContainsFile(files, output, "src/main/java/zz/yyyy/invoker/xxxx/ProgressResponseBody.java"); - TestUtils.ensureContainsFile(files, output, "src/main/java/zz/yyyy/invoker/xxxx/StringUtil.java"); - TestUtils.ensureContainsFile(files, output, "src/main/java/zz/yyyy/model/xxxx/SomeObj.java"); - TestUtils.ensureContainsFile(files, output, "src/test/java/zz/yyyy/api/xxxx/PingApiTest.java"); - TestUtils.ensureContainsFile(files, output, "src/test/java/zz/yyyy/model/xxxx/SomeObjTest.java"); - - validateJavaSourceFiles(files); - - TestUtils.assertFileContains(Paths.get(output + "/src/main/java/zz/yyyy/model/xxxx/SomeObj.java"), - "public class SomeObj", - "Boolean isActive()"); - - output.deleteOnExit(); - } - - @Test - public void testJdkHttpClient() throws Exception { - Map properties = new HashMap<>(); - properties.put(CodegenConstants.API_PACKAGE, "xyz.abcdef.api"); - - File output = Files.createTempDirectory("test").toFile(); - output.deleteOnExit(); - - final CodegenConfigurator configurator = new CodegenConfigurator() - .setGeneratorName("java") - .setLibrary(JavaClientCodegen.NATIVE) - .setAdditionalProperties(properties) - .setInputSpec("src/test/resources/3_0/ping.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); - - final ClientOptInput clientOptInput = configurator.toClientOptInput(); - DefaultGenerator generator = new DefaultGenerator(); - List files = generator.opts(clientOptInput).generate(); - - Assert.assertEquals(files.size(), 32); - validateJavaSourceFiles(files); - - TestUtils.assertFileContains(Paths.get(output + "/src/main/java/xyz/abcdef/api/DefaultApi.java"), - "public class DefaultApi", - "import java.net.http.HttpClient;", - "import java.net.http.HttpRequest;", - "import java.net.http.HttpResponse;"); - - TestUtils.assertFileContains(Paths.get(output + "/src/main/java/xyz/abcdef/ApiClient.java"), - "public class ApiClient", - "import java.net.http.HttpClient;", - "import java.net.http.HttpRequest;"); - } - - @Test - public void testJdkHttpClientWithAndWithoutDiscriminator() throws Exception { - Map properties = new HashMap<>(); - properties.put(CodegenConstants.API_PACKAGE, "xyz.abcdef.api"); - properties.put(CodegenConstants.MODEL_PACKAGE, "xyz.abcdef.model"); - properties.put(CodegenConstants.INVOKER_PACKAGE, "xyz.abcdef.invoker"); - - File output = Files.createTempDirectory("test").toFile(); - output.deleteOnExit(); - - final CodegenConfigurator configurator = new CodegenConfigurator() - .setGeneratorName("java") - .setLibrary(JavaClientCodegen.NATIVE) - .setAdditionalProperties(properties) - .setInputSpec("src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); - - final ClientOptInput clientOptInput = configurator.toClientOptInput(); - DefaultGenerator generator = new DefaultGenerator(); - generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); - generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true"); - List files = generator.opts(clientOptInput).generate(); - - Assert.assertEquals(files.size(), 162); - validateJavaSourceFiles(files); - - TestUtils.assertFileContains(Paths.get(output + "/src/main/java/xyz/abcdef/model/Dog.java"), - "import xyz.abcdef.invoker.JSON;"); - TestUtils.assertFileNotContains(Paths.get(output + "/src/main/java/xyz/abcdef/model/DogAllOf.java"), - "import xyz.abcdef.invoker.JSON;"); - } - - @Test - public void testJdkHttpAsyncClient() throws Exception { - Map properties = new HashMap<>(); - properties.put(CodegenConstants.API_PACKAGE, "xyz.abcdef.api"); - properties.put(JavaClientCodegen.ASYNC_NATIVE, true); - - File output = Files.createTempDirectory("test").toFile(); - output.deleteOnExit(); - - final CodegenConfigurator configurator = new CodegenConfigurator() - .setGeneratorName("java") - .setLibrary(JavaClientCodegen.NATIVE) - .setAdditionalProperties(properties) - .setInputSpec("src/test/resources/3_0/pingSomeObj.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); - - final ClientOptInput clientOptInput = configurator.toClientOptInput(); - DefaultGenerator generator = new DefaultGenerator(); - List files = generator.opts(clientOptInput).generate(); - - Assert.assertEquals(files.size(), 35); - validateJavaSourceFiles(files); - - Path defaultApi = Paths.get(output + "/src/main/java/xyz/abcdef/api/PingApi.java"); - TestUtils.assertFileContains(defaultApi, - "public class PingApi", - "import java.net.http.HttpClient;", - "import java.net.http.HttpRequest;", - "import java.net.http.HttpResponse;", - "import java.util.concurrent.CompletableFuture;"); - - Path apiClient = Paths.get(output + "/src/main/java/xyz/abcdef/ApiClient.java"); - TestUtils.assertFileContains(apiClient, - "public class ApiClient", - "import java.net.http.HttpClient;", - "import java.net.http.HttpRequest;"); - } - - @Test - public void testReferencedHeader() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue855.yaml"); - JavaClientCodegen codegen = new JavaClientCodegen(); - codegen.setOpenAPI(openAPI); - - ApiResponse ok_200 = openAPI.getComponents().getResponses().get("OK_200"); - CodegenResponse response = codegen.fromResponse("200", ok_200); - - Assert.assertEquals(response.headers.size(), 1); - CodegenProperty header = response.headers.get(0); - Assert.assertEquals(header.dataType, "UUID"); - Assert.assertEquals(header.baseName, "Request"); - } - - @Test - public void testAuthorizationScopeValues_Issue392() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue392.yaml"); - - final DefaultGenerator defaultGenerator = new DefaultGenerator(); - - final ClientOptInput clientOptInput = new ClientOptInput(); - clientOptInput.openAPI(openAPI); - clientOptInput.config(new JavaClientCodegen()); - - defaultGenerator.opts(clientOptInput); - final List codegenOperations = defaultGenerator.processPaths(openAPI.getPaths()).get("Pet"); - - // Verify GET only has 'read' scope - final CodegenOperation getCodegenOperation = codegenOperations.stream().filter(it -> it.httpMethod.equals("GET")).collect(Collectors.toList()).get(0); - assertTrue(getCodegenOperation.hasAuthMethods); - assertEquals(getCodegenOperation.authMethods.size(), 1); - final List> getScopes = getCodegenOperation.authMethods.get(0).scopes; - assertEquals(getScopes.size(), 1, "GET scopes don't match. actual::" + getScopes); - - // POST operation should have both 'read' and 'write' scope on it - final CodegenOperation postCodegenOperation = codegenOperations.stream().filter(it -> it.httpMethod.equals("POST")).collect(Collectors.toList()).get(0); - assertTrue(postCodegenOperation.hasAuthMethods); - assertEquals(postCodegenOperation.authMethods.size(), 1); - final List> postScopes = postCodegenOperation.authMethods.get(0).scopes; - assertEquals(postScopes.size(), 2, "POST scopes don't match. actual:" + postScopes); - } - - @Test - public void testAuthorizationScopeValues_Issue6733() throws IOException { - File output = Files.createTempDirectory("test").toFile(); - output.deleteOnExit(); - - final CodegenConfigurator configurator = new CodegenConfigurator() - .setGeneratorName("java") - .setLibrary(JavaClientCodegen.RESTEASY) - .setValidateSpec(false) - .setInputSpec("src/test/resources/3_0/regression-6734.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); - - final ClientOptInput clientOptInput = configurator.toClientOptInput(); - - DefaultGenerator generator = new DefaultGenerator(); - generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); - generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); - generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); - generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true"); - // tests if NPE will crash generation when path in yaml arent provided - generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false"); - generator.setGenerateMetadata(false); - List files = generator.opts(clientOptInput).generate(); - - validateJavaSourceFiles(files); - - Assert.assertEquals(files.size(), 1); - files.forEach(File::deleteOnExit); - } - - @Test - public void testAuthorizationsMethodsSizeWhenFiltered() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue4584.yaml"); - - final DefaultGenerator defaultGenerator = new DefaultGenerator(); - - final ClientOptInput clientOptInput = new ClientOptInput(); - clientOptInput.openAPI(openAPI); - clientOptInput.config(new JavaClientCodegen()); - - defaultGenerator.opts(clientOptInput); - final List codegenOperations = defaultGenerator.processPaths(openAPI.getPaths()).get("Pet"); - - final CodegenOperation getCodegenOperation = codegenOperations.stream().filter(it -> it.httpMethod.equals("GET")).collect(Collectors.toList()).get(0); - assertTrue(getCodegenOperation.hasAuthMethods); - assertEquals(getCodegenOperation.authMethods.size(), 2); - } - - @Test - public void testFreeFormObjects() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue796.yaml"); - JavaClientCodegen codegen = new JavaClientCodegen(); - - Schema test1 = openAPI.getComponents().getSchemas().get("MapTest1"); - codegen.setOpenAPI(openAPI); - CodegenModel cm1 = codegen.fromModel("MapTest1", test1); - Assert.assertEquals(cm1.getDataType(), "Map"); - Assert.assertEquals(cm1.getParent(), "HashMap"); - Assert.assertEquals(cm1.getClassname(), "MapTest1"); - - Schema test2 = openAPI.getComponents().getSchemas().get("MapTest2"); - codegen.setOpenAPI(openAPI); - CodegenModel cm2 = codegen.fromModel("MapTest2", test2); - Assert.assertEquals(cm2.getDataType(), "Map"); - Assert.assertEquals(cm2.getParent(), "HashMap"); - Assert.assertEquals(cm2.getClassname(), "MapTest2"); - - Schema test3 = openAPI.getComponents().getSchemas().get("MapTest3"); - codegen.setOpenAPI(openAPI); - CodegenModel cm3 = codegen.fromModel("MapTest3", test3); - Assert.assertEquals(cm3.getDataType(), "Map"); - Assert.assertEquals(cm3.getParent(), "HashMap"); - Assert.assertEquals(cm3.getClassname(), "MapTest3"); - - Schema other = openAPI.getComponents().getSchemas().get("OtherObj"); - codegen.setOpenAPI(openAPI); - CodegenModel cm = codegen.fromModel("OtherObj", other); - Assert.assertEquals(cm.getDataType(), "Object"); - Assert.assertEquals(cm.getClassname(), "OtherObj"); - } - - /** - * See https://github.com/OpenAPITools/openapi-generator/issues/3589 - */ - @Test - public void testSchemaMapping() throws IOException { - - Map properties = new HashMap<>(); - properties.put(CodegenConstants.API_PACKAGE, "xyz.abcdef.api"); - - Map schemaMappings = new HashMap<>(); - schemaMappings.put("TypeAlias", "foo.bar.TypeAlias"); - - File output = Files.createTempDirectory("test").toFile(); - output.deleteOnExit(); - - final CodegenConfigurator configurator = new CodegenConfigurator() - .setGeneratorName("java") - .setLibrary(JavaClientCodegen.RESTEASY) - .setAdditionalProperties(properties) - .setSchemaMappings(schemaMappings) - .setGenerateAliasAsModel(true) - .setInputSpec("src/test/resources/3_0/type-alias.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); - - final ClientOptInput clientOptInput = configurator.toClientOptInput(); - Assert.assertEquals(clientOptInput.getConfig().schemaMapping().get("TypeAlias"), "foo.bar.TypeAlias"); - - DefaultGenerator generator = new DefaultGenerator(); - generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); - generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); - generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); - generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "false"); - generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false"); - generator.setGenerateMetadata(false); - List files = generator.opts(clientOptInput).generate(); - files.forEach(File::deleteOnExit); - - validateJavaSourceFiles(files); - - Assert.assertEquals(files.size(), 1); - TestUtils.ensureContainsFile(files, output, "src/main/java/org/openapitools/client/model/ParentType.java"); - - String parentTypeContents = ""; - try { - File file = files.stream().filter(f -> f.getName().endsWith("ParentType.java")).findFirst().get(); - parentTypeContents = new String(Files.readAllBytes(file.toPath()), StandardCharsets.UTF_8); - } catch (IOException ignored) { - - } - - final Pattern FIELD_PATTERN = Pattern.compile(".* private (.*?) typeAlias;.*", Pattern.DOTALL); - Matcher fieldMatcher = FIELD_PATTERN.matcher(parentTypeContents); - Assert.assertTrue(fieldMatcher.matches()); - - // this is the type of the field 'typeAlias'. With a working schemaMapping it should - // be 'foo.bar.TypeAlias' or just 'TypeAlias' - Assert.assertEquals(fieldMatcher.group(1), "foo.bar.TypeAlias"); - } - - @Test - public void testBearerAuth() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/pingBearerAuth.yaml"); - JavaClientCodegen codegen = new JavaClientCodegen(); - - List security = codegen.fromSecurity(openAPI.getComponents().getSecuritySchemes()); - Assert.assertEquals(security.size(), 1); - Assert.assertEquals(security.get(0).isBasic, Boolean.TRUE); - Assert.assertEquals(security.get(0).isBasicBasic, Boolean.FALSE); - Assert.assertEquals(security.get(0).isBasicBearer, Boolean.TRUE); - } - - private CodegenProperty codegenPropertyWithArrayOfIntegerValues() { - CodegenProperty array = new CodegenProperty(); - final CodegenProperty items = new CodegenProperty(); - final HashMap allowableValues = new HashMap<>(); - allowableValues.put("values", Collections.singletonList(1)); - items.setAllowableValues(allowableValues); - items.dataType = "Integer"; - array.setItems(items); - array.dataType = "Array"; - array.mostInnerItems = items; - return array; - } - - private CodegenParameter createPathParam(String name) { - CodegenParameter codegenParameter = createStringParam(name); - codegenParameter.isPathParam = true; - return codegenParameter; - } - - private CodegenParameter createQueryParam(String name, boolean required) { - CodegenParameter codegenParameter = createStringParam(name); - codegenParameter.isQueryParam = true; - codegenParameter.required = required; - return codegenParameter; - } - - private CodegenParameter createStringParam(String name) { - CodegenParameter codegenParameter = new CodegenParameter(); - codegenParameter.paramName = name; - codegenParameter.baseName = name; - codegenParameter.dataType = "String"; - return codegenParameter; - } - - @Test - public void escapeName() { - final JavaClientCodegen codegen = new JavaClientCodegen(); - assertEquals(codegen.toApiVarName("Default"), "_default"); - assertEquals(codegen.toApiVarName("int"), "_int"); - assertEquals(codegen.toApiVarName("pony"), "pony"); - } - - @Test - public void testAnyType() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/any_type.yaml"); - JavaClientCodegen codegen = new JavaClientCodegen(); - - Schema test1 = openAPI.getComponents().getSchemas().get("AnyValueModel"); - codegen.setOpenAPI(openAPI); - CodegenModel cm1 = codegen.fromModel("AnyValueModel", test1); - Assert.assertEquals(cm1.getClassname(), "AnyValueModel"); - - final CodegenProperty property1 = cm1.allVars.get(0); - Assert.assertEquals(property1.baseName, "any_value"); - Assert.assertEquals(property1.dataType, "Object"); - Assert.assertTrue(property1.isPrimitiveType); - Assert.assertFalse(property1.isContainer); - Assert.assertFalse(property1.isFreeFormObject); - Assert.assertTrue(property1.isAnyType); - - final CodegenProperty property2 = cm1.allVars.get(1); - Assert.assertEquals(property2.baseName, "any_value_with_desc"); - Assert.assertEquals(property2.dataType, "Object"); - Assert.assertFalse(property2.required); - Assert.assertTrue(property2.isPrimitiveType); - Assert.assertFalse(property2.isContainer); - Assert.assertFalse(property2.isFreeFormObject); - Assert.assertTrue(property2.isAnyType); - - final CodegenProperty property3 = cm1.allVars.get(2); - Assert.assertEquals(property3.baseName, "any_value_nullable"); - Assert.assertEquals(property3.dataType, "Object"); - Assert.assertFalse(property3.required); - Assert.assertTrue(property3.isPrimitiveType); - Assert.assertFalse(property3.isContainer); - Assert.assertFalse(property3.isFreeFormObject); - Assert.assertTrue(property3.isAnyType); - - Schema test2 = openAPI.getComponents().getSchemas().get("AnyValueModelInline"); - codegen.setOpenAPI(openAPI); - CodegenModel cm2 = codegen.fromModel("AnyValueModelInline", test2); - Assert.assertEquals(cm2.getClassname(), "AnyValueModelInline"); - - final CodegenProperty cp1 = cm2.vars.get(0); - Assert.assertEquals(cp1.baseName, "any_value"); - Assert.assertEquals(cp1.dataType, "Object"); - Assert.assertFalse(cp1.required); - Assert.assertTrue(cp1.isPrimitiveType); - Assert.assertFalse(cp1.isContainer); - Assert.assertFalse(cp1.isFreeFormObject); - Assert.assertTrue(cp1.isAnyType); - - final CodegenProperty cp2 = cm2.vars.get(1); - Assert.assertEquals(cp2.baseName, "any_value_with_desc"); - Assert.assertEquals(cp2.dataType, "Object"); - Assert.assertFalse(cp2.required); - Assert.assertTrue(cp2.isPrimitiveType); - Assert.assertFalse(cp2.isContainer); - Assert.assertFalse(cp2.isFreeFormObject); - Assert.assertTrue(cp2.isAnyType); - - final CodegenProperty cp3 = cm2.vars.get(2); - Assert.assertEquals(cp3.baseName, "any_value_nullable"); - Assert.assertEquals(cp3.dataType, "Object"); - Assert.assertFalse(cp3.required); - Assert.assertTrue(cp3.isPrimitiveType); - Assert.assertFalse(cp3.isContainer); - Assert.assertFalse(cp3.isFreeFormObject); - Assert.assertTrue(cp3.isAnyType); - - // map - // Should allow in any type including map, https://github.com/swagger-api/swagger-parser/issues/1603 - final CodegenProperty cp4 = cm2.vars.get(3); - Assert.assertEquals(cp4.baseName, "map_any_value"); - Assert.assertEquals(cp4.dataType, "Map"); - Assert.assertFalse(cp4.required); - Assert.assertTrue(cp4.isPrimitiveType); - Assert.assertTrue(cp4.isContainer); - Assert.assertTrue(cp4.isMap); - Assert.assertTrue(cp4.isFreeFormObject); - Assert.assertFalse(cp4.isAnyType); - - // Should allow in any type including map, https://github.com/swagger-api/swagger-parser/issues/1603 - final CodegenProperty cp5 = cm2.vars.get(4); - Assert.assertEquals(cp5.baseName, "map_any_value_with_desc"); - Assert.assertEquals(cp5.dataType, "Map"); - Assert.assertFalse(cp5.required); - Assert.assertTrue(cp5.isPrimitiveType); - Assert.assertTrue(cp5.isContainer); - Assert.assertTrue(cp5.isMap); - Assert.assertTrue(cp5.isFreeFormObject); - Assert.assertFalse(cp5.isAnyType); - - // Should allow in any type including map, https://github.com/swagger-api/swagger-parser/issues/1603 - final CodegenProperty cp6 = cm2.vars.get(5); - Assert.assertEquals(cp6.baseName, "map_any_value_nullable"); - Assert.assertEquals(cp6.dataType, "Map"); - Assert.assertFalse(cp6.required); - Assert.assertTrue(cp6.isPrimitiveType); - Assert.assertTrue(cp6.isContainer); - Assert.assertTrue(cp6.isMap); - Assert.assertTrue(cp6.isFreeFormObject); - Assert.assertFalse(cp6.isAnyType); - - // array - // Should allow in any type including array, https://github.com/swagger-api/swagger-parser/issues/1603 - final CodegenProperty cp7 = cm2.vars.get(6); - Assert.assertEquals(cp7.baseName, "array_any_value"); - Assert.assertEquals(cp7.dataType, "List"); - Assert.assertFalse(cp7.required); - Assert.assertTrue(cp7.isPrimitiveType); - Assert.assertTrue(cp7.isContainer); - Assert.assertTrue(cp7.isArray); - Assert.assertFalse(cp7.isFreeFormObject); - Assert.assertFalse(cp7.isAnyType); - - // Should allow in any type including array, https://github.com/swagger-api/swagger-parser/issues/1603 - final CodegenProperty cp8 = cm2.vars.get(7); - Assert.assertEquals(cp8.baseName, "array_any_value_with_desc"); - Assert.assertEquals(cp8.dataType, "List"); - Assert.assertFalse(cp8.required); - Assert.assertTrue(cp8.isPrimitiveType); - Assert.assertTrue(cp8.isContainer); - Assert.assertTrue(cp8.isArray); - Assert.assertFalse(cp8.isFreeFormObject); - Assert.assertFalse(cp8.isAnyType); - - // Should allow in any type including array, https://github.com/swagger-api/swagger-parser/issues/1603 - final CodegenProperty cp9 = cm2.vars.get(8); - Assert.assertEquals(cp9.baseName, "array_any_value_nullable"); - Assert.assertEquals(cp9.dataType, "List"); - Assert.assertFalse(cp9.required); - Assert.assertTrue(cp9.isPrimitiveType); - Assert.assertTrue(cp9.isContainer); - Assert.assertTrue(cp9.isArray); - Assert.assertFalse(cp9.isFreeFormObject); - Assert.assertFalse(cp9.isAnyType); - } - - /** - * See https://github.com/OpenAPITools/openapi-generator/issues/4803 - * - * UPDATE: the following test has been ignored due to https://github.com/OpenAPITools/openapi-generator/pull/11081/ - * We will contact the contributor of the following test to see if the fix will break their use cases and - * how we can fix it accordingly. - */ - @Test - @Ignore - public void testRestTemplateFormMultipart() throws IOException { - - Map properties = new HashMap<>(); - properties.put(CodegenConstants.API_PACKAGE, "xyz.abcdef.api"); - - - File output = Files.createTempDirectory("test").toFile(); - output.deleteOnExit(); - - final CodegenConfigurator configurator = new CodegenConfigurator() - .setGeneratorName("java") - .setLibrary(JavaClientCodegen.RESTTEMPLATE) - .setAdditionalProperties(properties) - .setInputSpec("src/test/resources/3_0/form-multipart-binary-array.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); - - - DefaultGenerator generator = new DefaultGenerator(); - List files = generator.opts(configurator.toClientOptInput()).generate(); - files.forEach(File::deleteOnExit); - - validateJavaSourceFiles(files); - - Path defaultApi = Paths.get(output + "/src/main/java/xyz/abcdef/api/MultipartApi.java"); - TestUtils.assertFileContains(defaultApi, - //multiple files - "multipartArrayWithHttpInfo(List files)", - "formParams.addAll(\"files\", files.stream().map(FileSystemResource::new).collect(Collectors.toList()));", - - //mixed - "multipartMixedWithHttpInfo(File file, MultipartMixedMarker marker)", - "formParams.add(\"file\", new FileSystemResource(file));", - - //single file - "multipartSingleWithHttpInfo(File file)", - "formParams.add(\"file\", new FileSystemResource(file));" - ); - } - - /** - * See https://github.com/OpenAPITools/openapi-generator/issues/4803 - * - * UPDATE: the following test has been ignored due to https://github.com/OpenAPITools/openapi-generator/pull/11081/ - * We will contact the contributor of the following test to see if the fix will break their use cases and - * how we can fix it accordingly. - */ - @Test - @Ignore - public void testWebClientFormMultipart() throws IOException { - - Map properties = new HashMap<>(); - properties.put(CodegenConstants.API_PACKAGE, "xyz.abcdef.api"); - - - File output = Files.createTempDirectory("test").toFile(); - output.deleteOnExit(); - - final CodegenConfigurator configurator = new CodegenConfigurator() - .setGeneratorName("java") - .setLibrary(JavaClientCodegen.WEBCLIENT) - .setAdditionalProperties(properties) - .setInputSpec("src/test/resources/3_0/form-multipart-binary-array.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); - - - DefaultGenerator generator = new DefaultGenerator(); - List files = generator.opts(configurator.toClientOptInput()).generate(); - files.forEach(File::deleteOnExit); - - validateJavaSourceFiles(files); - - Path defaultApi = Paths.get(output + "/src/main/java/xyz/abcdef/api/MultipartApi.java"); - TestUtils.assertFileContains(defaultApi, - //multiple files - "multipartArray(List files)", - "formParams.addAll(\"files\", files.stream().map(FileSystemResource::new).collect(Collectors.toList()));", - - //mixed - "multipartMixed(File file, MultipartMixedMarker marker)", - "formParams.add(\"file\", new FileSystemResource(file));", - - //single file - "multipartSingle(File file)", - "formParams.add(\"file\", new FileSystemResource(file));" - ); - } - - @Test - public void testAllowModelWithNoProperties() throws Exception { - File output = Files.createTempDirectory("test").toFile(); - - final CodegenConfigurator configurator = new CodegenConfigurator() - .setGeneratorName("java") - .setLibrary(JavaClientCodegen.OKHTTP_GSON) - .setInputSpec("src/test/resources/2_0/emptyBaseModel.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); - - final ClientOptInput clientOptInput = configurator.toClientOptInput(); - DefaultGenerator generator = new DefaultGenerator(); - List files = generator.opts(clientOptInput).generate(); - - Assert.assertEquals(files.size(), 49); - TestUtils.ensureContainsFile(files, output, "src/main/java/org/openapitools/client/model/RealCommand.java"); - TestUtils.ensureContainsFile(files, output, "src/main/java/org/openapitools/client/model/Command.java"); - - validateJavaSourceFiles(files); - - TestUtils.assertFileContains(Paths.get(output + "/src/main/java/org/openapitools/client/model/RealCommand.java"), - "class RealCommand {"); - - TestUtils.assertFileContains(Paths.get(output + "/src/main/java/org/openapitools/client/model/Command.java"), - "class Command {"); - - output.deleteOnExit(); - } - - /** - * See https://github.com/OpenAPITools/openapi-generator/issues/6715 - * - * UPDATE: the following test has been ignored due to https://github.com/OpenAPITools/openapi-generator/pull/11081/ - * We will contact the contributor of the following test to see if the fix will break their use cases and - * how we can fix it accordingly. - */ - @Test - @Ignore - public void testRestTemplateWithUseAbstractionForFiles() throws IOException { - - Map properties = new HashMap<>(); - properties.put(CodegenConstants.API_PACKAGE, "xyz.abcdef.api"); - properties.put(JavaClientCodegen.USE_ABSTRACTION_FOR_FILES, true); - - - File output = Files.createTempDirectory("test").toFile(); - output.deleteOnExit(); - - final CodegenConfigurator configurator = new CodegenConfigurator() - .setGeneratorName("java") - .setLibrary(JavaClientCodegen.RESTTEMPLATE) - .setAdditionalProperties(properties) - .setInputSpec("src/test/resources/3_0/form-multipart-binary-array.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); - - - DefaultGenerator generator = new DefaultGenerator(); - List files = generator.opts(configurator.toClientOptInput()).generate(); - files.forEach(File::deleteOnExit); - - validateJavaSourceFiles(files); - - Path defaultApi = Paths.get(output + "/src/main/java/xyz/abcdef/api/MultipartApi.java"); - TestUtils.assertFileContains(defaultApi, - //multiple files - "multipartArray(java.util.Collection files)", - "multipartArrayWithHttpInfo(java.util.Collection files)", - "formParams.addAll(\"files\", files.stream().collect(Collectors.toList()));", - - //mixed - "multipartMixed(org.springframework.core.io.Resource file, MultipartMixedMarker marker)", - "multipartMixedWithHttpInfo(org.springframework.core.io.Resource file, MultipartMixedMarker marker)", - "formParams.add(\"file\", file);", - - //single file - "multipartSingle(org.springframework.core.io.Resource file)", - "multipartSingleWithHttpInfo(org.springframework.core.io.Resource file)", - "formParams.add(\"file\", file);" - ); - } - - @Test - void testNotDuplicateOauth2FlowsScopes() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_7614.yaml"); - - final ClientOptInput clientOptInput = new ClientOptInput() - .openAPI(openAPI) - .config(new JavaClientCodegen()); - - final DefaultGenerator defaultGenerator = new DefaultGenerator(); - defaultGenerator.opts(clientOptInput); - - final Map> paths = defaultGenerator.processPaths(openAPI.getPaths()); - final List codegenOperations = paths.values().stream().flatMap(Collection::stream).collect(Collectors.toList()); - - final CodegenOperation getWithBasicAuthAndOauth = getByOperationId(codegenOperations, "getWithBasicAuthAndOauth"); - assertEquals(getWithBasicAuthAndOauth.authMethods.size(), 3); - assertEquals(getWithBasicAuthAndOauth.authMethods.get(0).name, "basic_auth"); - final Map passwordFlowScope = getWithBasicAuthAndOauth.authMethods.get(1).scopes.get(0); - assertEquals(passwordFlowScope.get("scope"), "something:create"); - assertEquals(passwordFlowScope.get("description"), "create from password flow"); - final Map clientCredentialsFlow = getWithBasicAuthAndOauth.authMethods.get(2).scopes.get(0); - assertEquals(clientCredentialsFlow.get("scope"), "something:create"); - assertEquals(clientCredentialsFlow.get("description"), "create from client credentials flow"); - - final CodegenOperation getWithOauthAuth = getByOperationId(codegenOperations, "getWithOauthAuth"); - assertEquals(getWithOauthAuth.authMethods.size(), 2); - final Map passwordFlow = getWithOauthAuth.authMethods.get(0).scopes.get(0); - assertEquals(passwordFlow.get("scope"), "something:create"); - assertEquals(passwordFlow.get("description"), "create from password flow"); - - final Map clientCredentialsCreateFlow = getWithOauthAuth.authMethods.get(1).scopes.get(0); - assertEquals(clientCredentialsCreateFlow.get("scope"), "something:create"); - assertEquals(clientCredentialsCreateFlow.get("description"), "create from client credentials flow"); - - final Map clientCredentialsProcessFlow = getWithOauthAuth.authMethods.get(1).scopes.get(1); - assertEquals(clientCredentialsProcessFlow.get("scope"), "something:process"); - assertEquals(clientCredentialsProcessFlow.get("description"), "process from client credentials flow"); - } - - private CodegenOperation getByOperationId(List codegenOperations, String operationId) { - return getByCriteria(codegenOperations, (co) -> co.operationId.equals(operationId)) - .orElseThrow(() -> new IllegalStateException(String.format(Locale.ROOT, "Operation with id [%s] does not exist", operationId))); - } - - private Optional getByCriteria(List codegenOperations, Predicate filter){ - return codegenOperations.stream() - .filter(filter) - .findFirst(); - } - - @Test - public void testCustomMethodParamsAreCamelizedWhenUsingFeign() throws IOException { - - File output = Files.createTempDirectory("test").toFile(); - - final CodegenConfigurator configurator = new CodegenConfigurator() - .setGeneratorName("java") - .setLibrary(JavaClientCodegen.FEIGN) - .setInputSpec("src/test/resources/3_0/issue_7791.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); - - final ClientOptInput clientOptInput = configurator.toClientOptInput(); - DefaultGenerator generator = new DefaultGenerator(); - List files = generator.opts(clientOptInput).generate(); - - TestUtils.ensureContainsFile(files, output, "src/main/java/org/openapitools/client/api/DefaultApi.java"); - - validateJavaSourceFiles(files); - - TestUtils.assertFileContains(Paths.get(output + "/src/main/java/org/openapitools/client/api/DefaultApi.java"), - "@RequestLine(\"POST /events/{eventId}:undelete\")"); - TestUtils.assertFileNotContains(Paths.get(output + "/src/main/java/org/openapitools/client/api/DefaultApi.java"), - "event_id"); - - // baseName is kept for form parameters - TestUtils.assertFileContains(Paths.get(output + "/src/main/java/org/openapitools/client/api/DefaultApi.java"), - "@Param(\"some_file\") File someFile"); - - output.deleteOnExit(); - } - - /** - * See https://github.com/OpenAPITools/openapi-generator/issues/6715 - * - * UPDATE: the following test has been ignored due to https://github.com/OpenAPITools/openapi-generator/pull/11081/ - * We will contact the contributor of the following test to see if the fix will break their use cases and - * how we can fix it accordingly. - */ - @Test - @Ignore - public void testWebClientWithUseAbstractionForFiles() throws IOException { - - Map properties = new HashMap<>(); - properties.put(CodegenConstants.API_PACKAGE, "xyz.abcdef.api"); - properties.put(JavaClientCodegen.USE_ABSTRACTION_FOR_FILES, true); - - File output = Files.createTempDirectory("test").toFile(); - output.deleteOnExit(); - - final CodegenConfigurator configurator = new CodegenConfigurator() - .setGeneratorName("java") - .setLibrary(JavaClientCodegen.WEBCLIENT) - .setAdditionalProperties(properties) - .setInputSpec("src/test/resources/3_0/form-multipart-binary-array.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); - - - DefaultGenerator generator = new DefaultGenerator(); - List files = generator.opts(configurator.toClientOptInput()).generate(); - files.forEach(File::deleteOnExit); - - validateJavaSourceFiles(files); - - Path defaultApi = Paths.get(output + "/src/main/java/xyz/abcdef/api/MultipartApi.java"); - TestUtils.assertFileContains(defaultApi, - //multiple files - "multipartArray(java.util.Collection files)", - "formParams.addAll(\"files\", files.stream().collect(Collectors.toList()));", - - //mixed - "multipartMixed(org.springframework.core.io.AbstractResource file, MultipartMixedMarker marker)", - "formParams.add(\"file\", file);", - - //single file - "multipartSingle(org.springframework.core.io.AbstractResource file)", - "formParams.add(\"file\", file);" - ); - } - - /** - * See https://github.com/OpenAPITools/openapi-generator/issues/8352 - */ - @Test - public void testRestTemplateWithFreeFormInQueryParameters() throws IOException { - final Map properties = new HashMap<>(); - properties.put(CodegenConstants.API_PACKAGE, "xyz.abcdef.api"); - - final File output = Files.createTempDirectory("test") - .toFile(); - output.deleteOnExit(); - - final CodegenConfigurator configurator = new CodegenConfigurator().setGeneratorName("java") - .setLibrary(JavaClientCodegen.RESTTEMPLATE) - .setAdditionalProperties(properties) - .setInputSpec("src/test/resources/3_0/issue8352.yaml") - .setOutputDir(output.getAbsolutePath() - .replace("\\", "/")); - - final DefaultGenerator generator = new DefaultGenerator(); - final List files = generator.opts(configurator.toClientOptInput()) - .generate(); - files.forEach(File::deleteOnExit); - - final Path defaultApi = Paths.get(output + "/src/main/java/xyz/abcdef/ApiClient.java"); - TestUtils.assertFileContains(defaultApi, "value instanceof Map"); - } - - /** - * See https://github.com/OpenAPITools/openapi-generator/issues/8352 - */ - @Test - public void testWebClientWithFreeFormInQueryParameters() throws IOException { - final Map properties = new HashMap<>(); - properties.put(CodegenConstants.API_PACKAGE, "xyz.abcdef.api"); - - final File output = Files.createTempDirectory("test") - .toFile(); - output.deleteOnExit(); - - final CodegenConfigurator configurator = new CodegenConfigurator().setGeneratorName("java") - .setLibrary(JavaClientCodegen.WEBCLIENT) - .setAdditionalProperties(properties) - .setInputSpec("src/test/resources/3_0/issue8352.yaml") - .setOutputDir(output.getAbsolutePath() - .replace("\\", "/")); - - final DefaultGenerator generator = new DefaultGenerator(); - final List files = generator.opts(configurator.toClientOptInput()) - .generate(); - files.forEach(File::deleteOnExit); - - validateJavaSourceFiles(files); - - final Path defaultApi = Paths.get(output + "/src/main/java/xyz/abcdef/ApiClient.java"); - TestUtils.assertFileContains(defaultApi, "value instanceof Map"); - } - - /** - * See https://github.com/OpenAPITools/openapi-generator/issues/11242 - */ - @Test - public void testNativeClientWhiteSpacePathParamEncoding() throws IOException { - Map properties = new HashMap<>(); - properties.put(CodegenConstants.API_PACKAGE, "xyz.abcdef.api"); - - File output = Files.createTempDirectory("test").toFile(); - output.deleteOnExit(); - - final CodegenConfigurator configurator = new CodegenConfigurator() - .setGeneratorName("java") - .setLibrary(JavaClientCodegen.NATIVE) - .setAdditionalProperties(properties) - .setInputSpec("src/test/resources/3_0/issue11242.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); - - final ClientOptInput clientOptInput = configurator.toClientOptInput(); - DefaultGenerator generator = new DefaultGenerator(); - List files = generator.opts(clientOptInput).generate(); - - Assert.assertEquals(files.size(), 35); - validateJavaSourceFiles(files); - - TestUtils.assertFileContains(Paths.get(output + "/src/main/java/xyz/abcdef/ApiClient.java"), - "public static String urlEncode(String s) { return URLEncoder.encode(s, UTF_8).replaceAll(\"\\\\+\", \"%20\"); }"); - } - - /** - * See https://github.com/OpenAPITools/openapi-generator/issues/4808 - */ - @Test - public void testNativeClientExplodedQueryParamObject() throws IOException { - Map properties = new HashMap<>(); - properties.put(CodegenConstants.API_PACKAGE, "xyz.abcdef.api"); - - File output = Files.createTempDirectory("test").toFile(); - output.deleteOnExit(); - - final CodegenConfigurator configurator = new CodegenConfigurator() - .setGeneratorName("java") - .setLibrary(JavaClientCodegen.NATIVE) - .setAdditionalProperties(properties) - .setInputSpec("src/test/resources/3_0/issue4808.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); - - final ClientOptInput clientOptInput = configurator.toClientOptInput(); - DefaultGenerator generator = new DefaultGenerator(); - List files = generator.opts(clientOptInput).generate(); - - Assert.assertEquals(files.size(), 38); - validateJavaSourceFiles(files); - - TestUtils.assertFileContains(Paths.get(output + "/src/main/java/xyz/abcdef/api/DefaultApi.java"), - "localVarQueryParams.addAll(ApiClient.parameterToPairs(\"since\", queryObject.getSince()));", - "localVarQueryParams.addAll(ApiClient.parameterToPairs(\"sinceBuild\", queryObject.getSinceBuild()));", - "localVarQueryParams.addAll(ApiClient.parameterToPairs(\"maxBuilds\", queryObject.getMaxBuilds()));", - "localVarQueryParams.addAll(ApiClient.parameterToPairs(\"maxWaitSecs\", queryObject.getMaxWaitSecs()));" - ); - } - - @Test - public void testExtraAnnotationsNative() throws IOException { - testExtraAnnotations(JavaClientCodegen.NATIVE); - } - - @Test - public void testExtraAnnotationsJersey1() throws IOException { - testExtraAnnotations(JavaClientCodegen.JERSEY1); - } - - @Test - public void testExtraAnnotationsJersey2() throws IOException { - testExtraAnnotations(JavaClientCodegen.JERSEY2); - } - - @Test - public void testExtraAnnotationsMicroprofile() throws IOException { - testExtraAnnotations(JavaClientCodegen.MICROPROFILE); - } - - @Test - public void testExtraAnnotationsOKHttpGSON() throws IOException { - testExtraAnnotations(JavaClientCodegen.OKHTTP_GSON); - } - - @Test - public void testExtraAnnotationsVertx() throws IOException { - testExtraAnnotations(JavaClientCodegen.VERTX); - } - - @Test - public void testExtraAnnotationsFeign() throws IOException { - testExtraAnnotations(JavaClientCodegen.FEIGN); - } - - @Test - public void testExtraAnnotationsRetrofit2() throws IOException { - testExtraAnnotations(JavaClientCodegen.RETROFIT_2); - } - - @Test - public void testExtraAnnotationsRestTemplate() throws IOException { - testExtraAnnotations(JavaClientCodegen.RESTTEMPLATE); - } - - @Test - public void testExtraAnnotationsWebClient() throws IOException { - testExtraAnnotations(JavaClientCodegen.WEBCLIENT); - } - - @Test - public void testExtraAnnotationsRestEasy() throws IOException { - testExtraAnnotations(JavaClientCodegen.RESTEASY); - } - - @Test - public void testExtraAnnotationsGoogleApiClient() throws IOException { - testExtraAnnotations(JavaClientCodegen.GOOGLE_API_CLIENT); - } - - @Test - public void testExtraAnnotationsRestAssured() throws IOException { - testExtraAnnotations(JavaClientCodegen.REST_ASSURED); - } - - @Test - public void testExtraAnnotationsApache() throws IOException { - testExtraAnnotations(JavaClientCodegen.APACHE); - } - - @Test - public void testDefaultMicroprofileRestClientVersion() throws Exception { - File output = Files.createTempDirectory("test").toFile(); - - final CodegenConfigurator configurator = new CodegenConfigurator() - .setGeneratorName("java") - .setLibrary(JavaClientCodegen.MICROPROFILE) - .setInputSpec("src/test/resources/3_0/petstore.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); - - final ClientOptInput clientOptInput = configurator.toClientOptInput(); - DefaultGenerator generator = new DefaultGenerator(); - List files = generator.opts(clientOptInput).generate(); - - TestUtils.ensureContainsFile(files, output, "pom.xml"); - - validateJavaSourceFiles(files); - - TestUtils.assertFileContains(Paths.get(output + "/pom.xml"), - "2.0"); - TestUtils.assertFileContains(Paths.get(output + "/pom.xml"), - "1.2.1"); - TestUtils.assertFileContains(Paths.get(output + "/pom.xml"), - "1.8"); - TestUtils.assertFileContains(Paths.get(output + "/src/main/java/org/openapitools/client/api/PetApi.java"), - "import javax."); - - output.deleteOnExit(); - } - - @Test - public void testMicroprofileRestClientVersion_1_4_1() throws Exception { - Map properties = new HashMap<>(); - properties.put(JavaClientCodegen.MICROPROFILE_REST_CLIENT_VERSION, "1.4.1"); - - File output = Files.createTempDirectory("test").toFile(); - - final CodegenConfigurator configurator = new CodegenConfigurator() - .setAdditionalProperties(properties) - .setGeneratorName("java") - .setLibrary(JavaClientCodegen.MICROPROFILE) - .setInputSpec("src/test/resources/3_0/petstore.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); - - final ClientOptInput clientOptInput = configurator.toClientOptInput(); - DefaultGenerator generator = new DefaultGenerator(); - List files = generator.opts(clientOptInput).generate(); - - TestUtils.ensureContainsFile(files, output, "pom.xml"); - - validateJavaSourceFiles(files); - - TestUtils.assertFileContains(Paths.get(output + "/pom.xml"), - "1.4.1"); - TestUtils.assertFileContains(Paths.get(output + "/pom.xml"), - "1.2.1"); - TestUtils.assertFileContains(Paths.get(output + "/pom.xml"), - "1.8"); - TestUtils.assertFileContains(Paths.get(output + "/src/main/java/org/openapitools/client/api/PetApi.java"), - "import javax."); - - output.deleteOnExit(); - } - - @Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = "Version incorrectVersion of MicroProfile Rest Client is not supported or incorrect. Supported versions are 1.4.1, 2.0, 3.0") - public void testMicroprofileRestClientIncorrectVersion() throws Exception { - Map properties = new HashMap<>(); - properties.put(JavaClientCodegen.MICROPROFILE_REST_CLIENT_VERSION, "incorrectVersion"); - - File output = Files.createTempDirectory("test").toFile(); - output.deleteOnExit(); - - final CodegenConfigurator configurator = new CodegenConfigurator() - .setAdditionalProperties(properties) - .setGeneratorName("java") - .setLibrary(JavaClientCodegen.MICROPROFILE) - .setInputSpec("src/test/resources/3_0/petstore.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); - - final ClientOptInput clientOptInput = configurator.toClientOptInput(); - DefaultGenerator generator = new DefaultGenerator(); - generator.opts(clientOptInput).generate(); - fail("Expected an exception that did not occur"); - } - - @Test - public void testMicroprofileRestClientVersion_3_0() throws Exception { - Map properties = new HashMap<>(); - properties.put(JavaClientCodegen.MICROPROFILE_REST_CLIENT_VERSION, "3.0"); - - File output = Files.createTempDirectory("test").toFile(); - - final CodegenConfigurator configurator = new CodegenConfigurator() - .setAdditionalProperties(properties) - .setGeneratorName("java") - .setLibrary(JavaClientCodegen.MICROPROFILE) - .setInputSpec("src/test/resources/3_0/petstore.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); - - final ClientOptInput clientOptInput = configurator.toClientOptInput(); - DefaultGenerator generator = new DefaultGenerator(); - List files = generator.opts(clientOptInput).generate(); - - TestUtils.ensureContainsFile(files, output, "pom.xml"); - - validateJavaSourceFiles(files); - - TestUtils.assertFileContains(Paths.get(output + "/pom.xml"), - "3.0"); - TestUtils.assertFileContains(Paths.get(output + "/pom.xml"), - "3.0.4"); - TestUtils.assertFileContains(Paths.get(output + "/pom.xml"), - "11"); - TestUtils.assertFileContains(Paths.get(output + "/src/main/java/org/openapitools/client/api/PetApi.java"), - "import jakarta."); - - output.deleteOnExit(); - } - - @Test - public void testMicroprofileGenerateCorrectJsonbCreator_issue12622() throws Exception { - Map properties = new HashMap<>(); - properties.put(JavaClientCodegen.MICROPROFILE_REST_CLIENT_VERSION, "3.0"); - - File output = Files.createTempDirectory("test").toFile(); - output.deleteOnExit(); - - final CodegenConfigurator configurator = new CodegenConfigurator() - .setAdditionalProperties(properties) - .setGeneratorName("java") - .setLibrary(JavaClientCodegen.MICROPROFILE) - .setInputSpec("src/test/resources/bugs/issue_12622.json") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); - - final ClientOptInput clientOptInput = configurator.toClientOptInput(); - DefaultGenerator generator = new DefaultGenerator(); - Map files = generator.opts(clientOptInput).generate().stream() - .collect(Collectors.toMap(File::getName, Function.identity())); - - JavaFileAssert.assertThat(files.get("Foo.java")) - .assertConstructor("String", "Integer") - .hasParameter("b") - .assertParameterAnnotations() - .containsWithNameAndAttributes("JsonbProperty", ImmutableMap.of("value", "\"b\"", "nillable", "true")) - .toParameter().toConstructor() - .hasParameter("c") - .assertParameterAnnotations() - .containsWithNameAndAttributes("JsonbProperty", ImmutableMap.of("value", "\"c\"")); - } - - @Test - public void testWebClientJsonCreatorWithNullable_issue12790() throws Exception { - Map properties = new HashMap<>(); - properties.put(AbstractJavaCodegen.OPENAPI_NULLABLE, "true"); - - File output = Files.createTempDirectory("test").toFile(); - output.deleteOnExit(); - - final CodegenConfigurator configurator = new CodegenConfigurator() - .setAdditionalProperties(properties) - .setGeneratorName("java") - .setLibrary(JavaClientCodegen.WEBCLIENT) - .setInputSpec("src/test/resources/bugs/issue_12790.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); - - final ClientOptInput clientOptInput = configurator.toClientOptInput(); - DefaultGenerator generator = new DefaultGenerator(); - Map files = generator.opts(clientOptInput).generate().stream() - .collect(Collectors.toMap(File::getName, Function.identity())); - - JavaFileAssert.assertThat(files.get("TestObject.java")) - .printFileContent() - .assertConstructor("String", "String") - .bodyContainsLines( - "this.nullableProperty = nullableProperty == null ? JsonNullable.undefined() : JsonNullable.of(nullableProperty);", - "this.notNullableProperty = notNullableProperty;" - ); - } - - @Test - public void testRestTemplateResponseTypeWithUseAbstractionForFiles() throws IOException { - - Map properties = new HashMap<>(); - properties.put(CodegenConstants.API_PACKAGE, "xyz.abcdef.api"); - properties.put(JavaClientCodegen.USE_ABSTRACTION_FOR_FILES, true); - - File output = Files.createTempDirectory("test").toFile(); - output.deleteOnExit(); - - final CodegenConfigurator configurator = new CodegenConfigurator() - .setGeneratorName("java") - .setLibrary(JavaClientCodegen.RESTTEMPLATE) - .setAdditionalProperties(properties) - .setInputSpec("src/test/resources/3_0/issue13146_file_abstraction_response.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); - - - DefaultGenerator generator = new DefaultGenerator(); - List files = generator.opts(configurator.toClientOptInput()).generate(); - files.forEach(File::deleteOnExit); - - validateJavaSourceFiles(files); - - Path defaultApi = Paths.get(output + "/src/main/java/xyz/abcdef/api/ResourceApi.java"); - TestUtils.assertFileContains(defaultApi, - "org.springframework.core.io.Resource resourceInResponse()", - "ResponseEntity resourceInResponseWithHttpInfo()", - "ParameterizedTypeReference localReturnType = new ParameterizedTypeReference()" - ); - } - - public void testExtraAnnotations(String library) throws IOException { - File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); - output.deleteOnExit(); - String outputPath = output.getAbsolutePath().replace('\\', '/'); - - Map properties = new HashMap<>(); - properties.put(CXFServerFeatures.LOAD_TEST_DATA_FROM_FILE, "true"); - - final CodegenConfigurator configurator = new CodegenConfigurator() - .setGeneratorName("java") - .setLibrary(library) - .setAdditionalProperties(properties) - .setInputSpec("src/test/resources/3_0/issue_11772.yml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); - - final ClientOptInput clientOptInput = configurator.toClientOptInput(); - DefaultGenerator generator = new DefaultGenerator(); - - generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); - generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); - generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); - generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "false"); - generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false"); - generator.opts(clientOptInput).generate(); - - TestUtils.assertExtraAnnotationFiles(outputPath + "/src/main/java/org/openapitools/client/model"); - - } - - /** - * See https://github.com/OpenAPITools/openapi-generator/issues/11340 - */ - @Test - public void testReferencedHeader2() throws Exception { - File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); - output.deleteOnExit(); - Map additionalProperties = new HashMap<>(); - additionalProperties.put(BeanValidationFeatures.USE_BEANVALIDATION, "true"); - final CodegenConfigurator configurator = new CodegenConfigurator().setGeneratorName("java") - .setAdditionalProperties(additionalProperties) - .setInputSpec("src/test/resources/3_0/issue-11340.yaml") - .setOutputDir(output.getAbsolutePath() - .replace("\\", "/")); - - final ClientOptInput clientOptInput = configurator.toClientOptInput(); - DefaultGenerator generator = new DefaultGenerator(); - - Map files = generator.opts(clientOptInput).generate().stream() - .collect(Collectors.toMap(File::getName, Function.identity())); - - JavaFileAssert.assertThat(files.get("DefaultApi.java")) - .assertMethod("operationWithHttpInfo") - .hasParameter("requestBody") - .assertParameterAnnotations() - .containsWithName("NotNull") - .toParameter().toMethod() - .hasParameter("xNonNullHeaderParameter") - .assertParameterAnnotations() - .containsWithName("NotNull"); - } -} diff --git a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/java/JavaClientDeepObjectTest.java b/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/java/JavaClientDeepObjectTest.java deleted file mode 100644 index ec3908435d6..00000000000 --- a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/java/JavaClientDeepObjectTest.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen.java; - -import io.swagger.parser.OpenAPIParser; -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.parser.core.models.ParseOptions; -import org.openapitools.codegen.*; -import org.openapitools.codegen.languages.JavaClientCodegen; -import org.testng.annotations.Test; - -import java.io.File; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Paths; -import static org.openapitools.codegen.TestUtils.assertFileContains; - -public class JavaClientDeepObjectTest { - - @Test - public void deepObject() throws IOException { - File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); - output.deleteOnExit(); - String outputPath = output.getAbsolutePath().replace('\\', '/'); - - OpenAPI openAPI = new OpenAPIParser() - .readLocation("src/test/resources/3_0/deepobject.yaml", null, new ParseOptions()).getOpenAPI(); - - JavaClientCodegen codegen = new JavaClientCodegen(); - codegen.setLibrary("native"); - codegen.setOutputDir(output.getAbsolutePath()); - - ClientOptInput input = new ClientOptInput(); - input.openAPI(openAPI); - input.config(codegen); - - DefaultGenerator generator = new DefaultGenerator(); - - generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); - generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); - generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); - generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true"); - generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false"); - generator.opts(input).generate(); - - assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/client/api/DefaultApi.java"), - "options[a]", "options[b]", "\"csv\", \"options[c]\""); - } -} diff --git a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/java/JavaInheritanceTest.java b/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/java/JavaInheritanceTest.java deleted file mode 100644 index ac94d91542f..00000000000 --- a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/java/JavaInheritanceTest.java +++ /dev/null @@ -1,184 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen.java; - -import com.google.common.collect.Sets; -import io.swagger.v3.oas.models.Components; -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.media.ComposedSchema; -import io.swagger.v3.oas.models.media.Discriminator; -import io.swagger.v3.oas.models.media.ObjectSchema; -import io.swagger.v3.oas.models.media.Schema; -import io.swagger.v3.oas.models.media.StringSchema; -import java.util.Collections; -import org.apache.commons.lang3.StringUtils; -import org.openapitools.codegen.CodegenModel; -import org.openapitools.codegen.CodegenProperty; -import org.openapitools.codegen.DefaultCodegen; -import org.openapitools.codegen.TestUtils; -import org.openapitools.codegen.languages.JavaClientCodegen; -import org.testng.Assert; -import org.testng.annotations.Test; - -public class JavaInheritanceTest { - - - @Test(description = "convert a composed model with parent") - public void javaInheritanceTest() { - final Schema parentModel = new Schema().name("Base"); - - final Schema schema = new ComposedSchema() - .addAllOfItem(new Schema().$ref("Base")) - .name("composed"); - - OpenAPI openAPI = TestUtils.createOpenAPI(); - openAPI.setComponents(new Components() - .addSchemas(parentModel.getName(),parentModel) - .addSchemas(schema.getName(), schema) - ); - - final JavaClientCodegen codegen = new JavaClientCodegen(); - codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("sample", schema); - - Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "Sample"); - Assert.assertNull(cm.parent); - Assert.assertEquals(cm.imports, Collections.emptySet()); - } - - @Test(description = "convert a composed model with discriminator") - public void javaInheritanceWithDiscriminatorTest() { - final Schema base = new Schema().name("Base"); - Discriminator discriminator = new Discriminator().mapping("name", StringUtils.EMPTY); - discriminator.setPropertyName("model_type"); - base.setDiscriminator(discriminator); - - final Schema schema = new ComposedSchema() - .addAllOfItem(new Schema().$ref("Base")); - - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("Base", base); - - final JavaClientCodegen codegen = new JavaClientCodegen(); - codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("sample", schema); - - Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "Sample"); - Assert.assertEquals(cm.parent, "Base"); - Assert.assertEquals(cm.imports, Sets.newHashSet("Base")); - } - - @Test(description = "composed model has the required attributes on the child") - public void javaInheritanceWithRequiredAttributesOnAllOfObject() { - Schema parent = new ObjectSchema() - .addProperties("a", new StringSchema()) - .addProperties("b", new StringSchema()) - .addRequiredItem("a") - .name("Parent"); - Schema child = new ComposedSchema() - .addAllOfItem(new Schema().$ref("Parent")) - .addAllOfItem(new ObjectSchema() - .addProperties("c", new StringSchema()) - .addProperties("d", new StringSchema()) - .addRequiredItem("a") - .addRequiredItem("c")) - .name("Child"); - OpenAPI openAPI = TestUtils.createOpenAPI(); - openAPI.getComponents().addSchemas(parent.getName(), parent); - openAPI.getComponents().addSchemas(child.getName(), child); - - final DefaultCodegen codegen = new JavaClientCodegen(); - codegen.setOpenAPI(openAPI); - - final CodegenModel pm = codegen - .fromModel("Parent", parent); - final CodegenProperty propertyPA = pm.allVars.get(0); - Assert.assertEquals(propertyPA.name, "a"); - Assert.assertTrue(propertyPA.required); - final CodegenProperty propertyPB = pm.allVars.get(1); - Assert.assertEquals(propertyPB.name, "b"); - Assert.assertFalse(propertyPB.required); - Assert.assertEquals(pm.requiredVars.size() + pm.optionalVars.size(), pm.allVars.size()); - - final CodegenModel cm = codegen - .fromModel("Child", child); - final CodegenProperty propertyCA = cm.allVars.get(0); - Assert.assertEquals(propertyCA.name, "a"); - Assert.assertTrue(propertyCA.required); - final CodegenProperty propertyCB = cm.allVars.get(1); - Assert.assertEquals(propertyCB.name, "b"); - Assert.assertFalse(propertyCB.required); - final CodegenProperty propertyCC = cm.allVars.get(2); - Assert.assertEquals(propertyCC.name, "c"); - Assert.assertTrue(propertyCC.required); - final CodegenProperty propertyCD = cm.allVars.get(3); - Assert.assertEquals(propertyCD.name, "d"); - Assert.assertFalse(propertyCD.required); - Assert.assertEquals(cm.requiredVars.size() + cm.optionalVars.size(), cm.allVars.size()); - } - - @Test(description = "composed model has the required attributes for both parent & child") - public void javaInheritanceWithRequiredAttributesOnComposedObject() { - Schema parent = new ObjectSchema() - .addProperties("a", new StringSchema()) - .addProperties("b", new StringSchema()) - .addRequiredItem("a") - .name("Parent"); - Schema child = new ComposedSchema() - .addAllOfItem(new Schema().$ref("Parent")) - .addAllOfItem(new ObjectSchema() - .addProperties("c", new StringSchema()) - .addProperties("d", new StringSchema())) - .name("Child") - .addRequiredItem("a") - .addRequiredItem("c"); - OpenAPI openAPI = TestUtils.createOpenAPI(); - openAPI.getComponents().addSchemas(parent.getName(), parent); - openAPI.getComponents().addSchemas(child.getName(), child); - - final DefaultCodegen codegen = new JavaClientCodegen(); - codegen.setOpenAPI(openAPI); - - final CodegenModel pm = codegen - .fromModel("Parent", parent); - final CodegenProperty propertyPA = pm.allVars.get(0); - Assert.assertEquals(propertyPA.name, "a"); - Assert.assertTrue(propertyPA.required); - final CodegenProperty propertyPB = pm.allVars.get(1); - Assert.assertEquals(propertyPB.name, "b"); - Assert.assertFalse(propertyPB.required); - Assert.assertEquals(pm.requiredVars.size() + pm.optionalVars.size(), pm.allVars.size()); - - final CodegenModel cm = codegen - .fromModel("Child", child); - final CodegenProperty propertyCA = cm.allVars.get(0); - Assert.assertEquals(propertyCA.name, "a"); - Assert.assertTrue(propertyCA.required); - final CodegenProperty propertyCB = cm.allVars.get(1); - Assert.assertEquals(propertyCB.name, "b"); - Assert.assertFalse(propertyCB.required); - final CodegenProperty propertyCC = cm.allVars.get(2); - Assert.assertEquals(propertyCC.name, "c"); - Assert.assertTrue(propertyCC.required); - final CodegenProperty propertyCD = cm.allVars.get(3); - Assert.assertEquals(propertyCD.name, "d"); - Assert.assertFalse(propertyCD.required); - Assert.assertEquals(cm.requiredVars.size() + cm.optionalVars.size(), cm.allVars.size()); - } -} diff --git a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/java/JavaModelEnumTest.java b/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/java/JavaModelEnumTest.java deleted file mode 100644 index 1f3f48e8a61..00000000000 --- a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/java/JavaModelEnumTest.java +++ /dev/null @@ -1,197 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen.java; - -import io.swagger.v3.oas.models.Components; -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.media.*; -import org.apache.commons.lang3.StringUtils; -import org.openapitools.codegen.CodegenModel; -import org.openapitools.codegen.CodegenProperty; -import org.openapitools.codegen.DefaultCodegen; -import org.openapitools.codegen.TestUtils; -import org.openapitools.codegen.languages.JavaClientCodegen; -import org.testng.Assert; -import org.testng.annotations.Test; - -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -public class JavaModelEnumTest { - @Test(description = "convert a java model with an enum") - public void converterTest() { - final StringSchema enumSchema = new StringSchema(); - enumSchema.setEnum(Arrays.asList("VALUE1", "VALUE2", "VALUE3")); - final Schema model = new Schema().type("object").addProperties("name", enumSchema); - - final JavaClientCodegen codegen = new JavaClientCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model); - codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("sample", model); - - Assert.assertEquals(cm.vars.size(), 1); - - final CodegenProperty enumVar = cm.vars.get(0); - Assert.assertEquals(enumVar.baseName, "name"); - Assert.assertEquals(enumVar.dataType, "String"); - Assert.assertEquals(enumVar.datatypeWithEnum, "NameEnum"); - Assert.assertEquals(enumVar.name, "name"); - Assert.assertNull(enumVar.defaultValue); - Assert.assertEquals(enumVar.baseType, "String"); - Assert.assertTrue(enumVar.isEnum); - } - - @Test(description = "convert a java model with an enum inside a list") - public void converterInArrayTest() { - final ArraySchema enumSchema = new ArraySchema().items( - new StringSchema().addEnumItem("Aaaa").addEnumItem("Bbbb")); - final Schema model = new Schema().type("object").addProperties("name", enumSchema); - - final DefaultCodegen codegen = new JavaClientCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model); - codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("sample", model); - - Assert.assertEquals(cm.vars.size(), 1); - - final CodegenProperty enumVar = cm.vars.get(0); - Assert.assertEquals(enumVar.baseName, "name"); - Assert.assertEquals(enumVar.dataType, "List"); - Assert.assertEquals(enumVar.datatypeWithEnum, "List"); - Assert.assertEquals(enumVar.name, "name"); - Assert.assertEquals(enumVar.defaultValue, "new ArrayList<>()"); - Assert.assertEquals(enumVar.baseType, "List"); - Assert.assertTrue(enumVar.isEnum); - - Assert.assertEquals(enumVar.mostInnerItems.baseName, "name"); - Assert.assertEquals(enumVar.mostInnerItems.dataType, "String"); - Assert.assertEquals(enumVar.mostInnerItems.datatypeWithEnum, "NameEnum"); - Assert.assertEquals(enumVar.mostInnerItems.name, "name"); - Assert.assertNull(enumVar.mostInnerItems.defaultValue); - Assert.assertEquals(enumVar.mostInnerItems.baseType, "String"); - - Assert.assertEquals(enumVar.mostInnerItems.baseType, enumVar.items.baseType); - } - - @Test(description = "convert a java model with an enum inside a list") - public void converterInArrayInArrayTest() { - final ArraySchema enumSchema = new ArraySchema().items( - new ArraySchema().items( - new StringSchema().addEnumItem("Aaaa").addEnumItem("Bbbb"))); - final Schema model = new Schema().type("object").addProperties("name", enumSchema); - - final DefaultCodegen codegen = new JavaClientCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model); - codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("sample", model); - - Assert.assertEquals(cm.vars.size(), 1); - - final CodegenProperty enumVar = cm.vars.get(0); - Assert.assertEquals(enumVar.baseName, "name"); - Assert.assertEquals(enumVar.dataType, "List>"); - Assert.assertEquals(enumVar.datatypeWithEnum, "List>"); - Assert.assertEquals(enumVar.name, "name"); - Assert.assertEquals(enumVar.defaultValue, "new ArrayList<>()"); - Assert.assertEquals(enumVar.baseType, "List"); - Assert.assertTrue(enumVar.isEnum); - - Assert.assertEquals(enumVar.mostInnerItems.baseName, "name"); - Assert.assertEquals(enumVar.mostInnerItems.dataType, "String"); - Assert.assertEquals(enumVar.mostInnerItems.datatypeWithEnum, "NameEnum"); - Assert.assertEquals(enumVar.mostInnerItems.name, "name"); - Assert.assertNull(enumVar.mostInnerItems.defaultValue); - Assert.assertEquals(enumVar.mostInnerItems.baseType, "String"); - - Assert.assertEquals(enumVar.mostInnerItems.baseType, enumVar.items.items.baseType); - } - - @Test(description = "not override identical parent enums") - public void overrideEnumTest() { - final StringSchema identicalEnumProperty = new StringSchema(); - identicalEnumProperty.setEnum(Arrays.asList("VALUE1", "VALUE2", "VALUE3")); - - final StringSchema subEnumProperty = new StringSchema(); - subEnumProperty.setEnum(Arrays.asList("SUB1", "SUB2", "SUB3")); - - // Add one enum property to the parent - final Map parentProperties = new HashMap<>(); - parentProperties.put("sharedThing", identicalEnumProperty); - - // Add TWO enums to the subType model; one of which is identical to the one in parent class - final Map subProperties = new HashMap<>(); - subProperties.put("unsharedThing", subEnumProperty); - - final Schema parentModel = new Schema(); - parentModel.setProperties(parentProperties); - parentModel.name("parentModel"); - - Discriminator discriminator = new Discriminator().mapping("name", StringUtils.EMPTY); - discriminator.setPropertyName("model_type"); - parentModel.setDiscriminator(discriminator); - - final ComposedSchema composedSchema = new ComposedSchema(); - composedSchema.addAllOfItem(new Schema().$ref(parentModel.getName())); - composedSchema.setName("sample"); - - final JavaClientCodegen codegen = new JavaClientCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPI(); - openAPI.setComponents(new Components() - .addSchemas(parentModel.getName(), parentModel) - .addSchemas(composedSchema.getName(), composedSchema) - ); - - codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("sample", composedSchema); - - Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "Sample"); - Assert.assertEquals(cm.parent, "ParentModel"); - Assert.assertTrue(cm.imports.contains("ParentModel")); - } - - @Test - public void testEnumTestSchema() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml"); - JavaClientCodegen codegen = new JavaClientCodegen(); - codegen.setOpenAPI(openAPI); - - Schema enumTest = openAPI.getComponents().getSchemas().get("Enum_Test"); - Assert.assertNotNull(enumTest); - CodegenModel cm = codegen.fromModel("Enum_Test", enumTest); - - Assert.assertEquals(cm.getVars().size(), 8); - CodegenProperty cp0 = cm.getVars().get(0); - Assert.assertEquals(cp0.dataType, "String"); - CodegenProperty cp1 = cm.getVars().get(1); - Assert.assertEquals(cp1.dataType, "String"); - CodegenProperty cp2 = cm.getVars().get(2); - Assert.assertEquals(cp2.dataType, "Integer"); - CodegenProperty cp3 = cm.getVars().get(3); - Assert.assertEquals(cp3.dataType, "Double"); - CodegenProperty cp4 = cm.getVars().get(4); - Assert.assertEquals(cp4.dataType, "OuterEnum"); - CodegenProperty cp5 = cm.getVars().get(5); - Assert.assertEquals(cp5.dataType, "OuterEnumInteger"); - CodegenProperty cp6 = cm.getVars().get(6); - Assert.assertEquals(cp6.dataType, "OuterEnumDefaultValue"); - CodegenProperty cp7 = cm.getVars().get(7); - Assert.assertEquals(cp7.dataType, "OuterEnumIntegerDefaultValue"); - } -} diff --git a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/java/JavaModelTest.java b/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/java/JavaModelTest.java deleted file mode 100644 index 45189c9de52..00000000000 --- a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/java/JavaModelTest.java +++ /dev/null @@ -1,1396 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen.java; - -import com.google.common.collect.Sets; -import io.swagger.v3.oas.models.Components; -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.Operation; -import io.swagger.v3.oas.models.media.*; -import io.swagger.v3.oas.models.parameters.Parameter; -import io.swagger.v3.oas.models.parameters.QueryParameter; -import io.swagger.v3.oas.models.parameters.RequestBody; -import io.swagger.v3.oas.models.responses.ApiResponse; -import io.swagger.v3.oas.models.responses.ApiResponses; -import io.swagger.v3.parser.util.SchemaTypeUtil; -import org.openapitools.codegen.*; -import org.openapitools.codegen.config.CodegenConfigurator; -import org.openapitools.codegen.languages.JavaClientCodegen; -import org.testng.Assert; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; - -import java.io.File; -import java.nio.file.Files; -import java.util.List; - -public class JavaModelTest { - - @Test(description = "convert a simple java model") - public void simpleModelTest() { - final Schema model = new Schema() - .description("a sample model") - .addProperties("id", new IntegerSchema().format(SchemaTypeUtil.INTEGER64_FORMAT)) - .addProperties("name", new StringSchema() - .example("Tony")) - .addProperties("createdAt", new DateTimeSchema()) - .addRequiredItem("id") - .addRequiredItem("name"); - final DefaultCodegen codegen = new JavaClientCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model); - codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("sample", model); - - Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "Sample"); - Assert.assertEquals(cm.description, "a sample model"); - Assert.assertEquals(cm.vars.size(), 3); - - final List vars = cm.vars; - - final CodegenProperty property1 = vars.get(0); - Assert.assertEquals(property1.baseName, "id"); - Assert.assertEquals(property1.nameInCamelCase, "Id"); - Assert.assertEquals(property1.nameInSnakeCase, "ID"); - Assert.assertEquals(property1.getter, "getId"); - Assert.assertEquals(property1.setter, "setId"); - Assert.assertEquals(property1.dataType, "Long"); - Assert.assertEquals(property1.name, "id"); - Assert.assertNull(property1.defaultValue); - Assert.assertEquals(property1.baseType, "Long"); - Assert.assertTrue(property1.required); - Assert.assertFalse(property1.isContainer); - - final CodegenProperty property2 = vars.get(1); - Assert.assertEquals(property2.baseName, "name"); - Assert.assertEquals(property2.nameInCamelCase, "Name"); - Assert.assertEquals(property2.nameInSnakeCase, "NAME"); - Assert.assertEquals(property2.getter, "getName"); - Assert.assertEquals(property2.setter, "setName"); - Assert.assertEquals(property2.dataType, "String"); - Assert.assertEquals(property2.name, "name"); - Assert.assertNull(property2.defaultValue); - Assert.assertEquals(property2.baseType, "String"); - Assert.assertEquals(property2.example, "Tony"); - Assert.assertTrue(property2.required); - Assert.assertFalse(property2.isContainer); - - final CodegenProperty property3 = vars.get(2); - Assert.assertEquals(property3.baseName, "createdAt"); - Assert.assertEquals(property3.nameInCamelCase, "CreatedAt"); - Assert.assertEquals(property3.nameInSnakeCase, "CREATED_AT"); - Assert.assertEquals(property3.getter, "getCreatedAt"); - Assert.assertEquals(property3.setter, "setCreatedAt"); - Assert.assertEquals(property3.dataType, "Date"); - Assert.assertEquals(property3.name, "createdAt"); - Assert.assertNull(property3.defaultValue); - Assert.assertEquals(property3.baseType, "Date"); - Assert.assertFalse(property3.required); - Assert.assertFalse(property3.isContainer); - } - - @Test(description = "convert a model with list property") - public void listPropertyTest() { - final Schema schema = new Schema() - .description("a sample model") - .addProperties("id", new IntegerSchema().format(SchemaTypeUtil.INTEGER64_FORMAT)) - .addProperties("urls", new ArraySchema() - .items(new StringSchema())) - .addRequiredItem("id"); - final DefaultCodegen codegen = new JavaClientCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", schema); - codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("sample", schema); - - Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "Sample"); - Assert.assertEquals(cm.description, "a sample model"); - Assert.assertEquals(cm.vars.size(), 2); - - final CodegenProperty property = cm.vars.get(1); - Assert.assertEquals(property.baseName, "urls"); - Assert.assertEquals(property.getter, "getUrls"); - Assert.assertEquals(property.setter, "setUrls"); - Assert.assertEquals(property.dataType, "List"); - Assert.assertEquals(property.name, "urls"); - Assert.assertEquals(property.defaultValue, "new ArrayList<>()"); - Assert.assertEquals(property.baseType, "List"); - Assert.assertEquals(property.containerType, "array"); - Assert.assertFalse(property.required); - Assert.assertTrue(property.isContainer); - } - - @Test(description = "convert a model with set property") - public void setPropertyTest() { - final Schema schema = new Schema() - .description("a sample model") - .addProperties("id", new IntegerSchema().format(SchemaTypeUtil.INTEGER64_FORMAT)) - .addProperties("urls", new ArraySchema() - .items(new StringSchema()) - .uniqueItems(true)) - .addRequiredItem("id"); - final DefaultCodegen codegen = new JavaClientCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", schema); - codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("sample", schema); - - Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "Sample"); - Assert.assertEquals(cm.description, "a sample model"); - Assert.assertEquals(cm.vars.size(), 2); - - final CodegenProperty property = cm.vars.get(1); - Assert.assertEquals(property.baseName, "urls"); - Assert.assertEquals(property.getter, "getUrls"); - Assert.assertEquals(property.setter, "setUrls"); - Assert.assertEquals(property.dataType, "Set"); - Assert.assertEquals(property.name, "urls"); - Assert.assertEquals(property.defaultValue, "new LinkedHashSet<>()"); - Assert.assertEquals(property.baseType, "Set"); - Assert.assertEquals(property.containerType, "set"); - Assert.assertFalse(property.required); - Assert.assertTrue(property.isContainer); - } - - @Test(description = "convert a model with a map property") - public void mapPropertyTest() { - final Schema schema = new Schema() - .description("a sample model") - .addProperties("translations", new MapSchema() - .additionalProperties(new StringSchema())) - .addRequiredItem("id"); - final DefaultCodegen codegen = new JavaClientCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", schema); - codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("sample", schema); - - Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "Sample"); - Assert.assertEquals(cm.description, "a sample model"); - Assert.assertEquals(cm.vars.size(), 1); - - final CodegenProperty property = cm.vars.get(0); - Assert.assertEquals(property.baseName, "translations"); - Assert.assertEquals(property.getter, "getTranslations"); - Assert.assertEquals(property.setter, "setTranslations"); - Assert.assertEquals(property.dataType, "Map"); - Assert.assertEquals(property.name, "translations"); - Assert.assertEquals(property.defaultValue, "new HashMap<>()"); - Assert.assertEquals(property.baseType, "Map"); - Assert.assertEquals(property.containerType, "map"); - Assert.assertFalse(property.required); - Assert.assertTrue(property.isContainer); - } - - @Test(description = "convert a model with a map with complex list property") - public void mapWithListPropertyTest() { - final Schema schema = new Schema() - .description("a sample model") - .addProperties("translations", new MapSchema() - .additionalProperties(new ArraySchema().items(new Schema().$ref("Pet")))) - .addRequiredItem("id"); - final DefaultCodegen codegen = new JavaClientCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", schema); - codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("sample", schema); - - Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "Sample"); - Assert.assertEquals(cm.description, "a sample model"); - Assert.assertEquals(cm.vars.size(), 1); - - final CodegenProperty property = cm.vars.get(0); - Assert.assertEquals(property.baseName, "translations"); - Assert.assertEquals(property.getter, "getTranslations"); - Assert.assertEquals(property.setter, "setTranslations"); - Assert.assertEquals(property.dataType, "Map>"); - Assert.assertEquals(property.name, "translations"); - Assert.assertEquals(property.defaultValue, "new HashMap<>()"); - Assert.assertEquals(property.baseType, "Map"); - Assert.assertEquals(property.containerType, "map"); - Assert.assertFalse(property.required); - Assert.assertTrue(property.isContainer); - } - - @Test(description = "convert a model with a 2D list property") - public void list2DPropertyTest() { - final Schema model = new Schema() - .name("sample") - .addProperties("list2D", new ArraySchema().items( - new ArraySchema().items(new Schema().$ref("Pet")))); - final DefaultCodegen codegen = new JavaClientCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model); - codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("sample", model); - - Assert.assertEquals(cm.vars.size(), 1); - - final CodegenProperty property = cm.vars.get(0); - Assert.assertEquals(property.baseName, "list2D"); - Assert.assertEquals(property.getter, "getList2D"); - Assert.assertEquals(property.setter, "setList2D"); - Assert.assertEquals(property.dataType, "List>"); - Assert.assertEquals(property.name, "list2D"); - Assert.assertEquals(property.defaultValue, "new ArrayList<>()"); - Assert.assertEquals(property.baseType, "List"); - Assert.assertEquals(property.containerType, "array"); - Assert.assertFalse(property.required); - Assert.assertTrue(property.isContainer); - } - - @Test(description = "convert a model with restricted characters") - public void restrictedCharactersPropertiesTest() { - final Schema schema = new Schema() - .description("a sample model") - .addProperties("@Some:restricted%characters#to!handle+", new BooleanSchema()); - final DefaultCodegen codegen = new JavaClientCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", schema); - codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("sample", schema); - - Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "Sample"); - Assert.assertEquals(cm.description, "a sample model"); - Assert.assertEquals(cm.vars.size(), 1); - - final CodegenProperty property = cm.vars.get(0); - Assert.assertEquals(property.baseName, "@Some:restricted%characters#to!handle+"); - Assert.assertEquals(property.getter, "getAtSomeColonRestrictedPercentCharactersHashToExclamationHandlePlus"); - Assert.assertEquals(property.setter, "setAtSomeColonRestrictedPercentCharactersHashToExclamationHandlePlus"); - Assert.assertEquals(property.dataType, "Boolean"); - Assert.assertEquals(property.name, "atSomeColonRestrictedPercentCharactersHashToExclamationHandlePlus"); - Assert.assertNull(property.defaultValue); - Assert.assertEquals(property.baseType, "Boolean"); - Assert.assertFalse(property.required); - Assert.assertFalse(property.isContainer); - } - - @Test(description = "convert a model with complex properties") - public void complexPropertiesTest() { - final Schema schema = new Schema() - .description("a sample model") - .addProperties("children", new Schema().$ref("#/components/schemas/Children")); - final DefaultCodegen codegen = new JavaClientCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", schema); - codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("sample", schema); - - Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "Sample"); - Assert.assertEquals(cm.description, "a sample model"); - Assert.assertEquals(cm.vars.size(), 1); - - final CodegenProperty property = cm.vars.get(0); - Assert.assertEquals(property.baseName, "children"); - Assert.assertEquals(property.getter, "getChildren"); - Assert.assertEquals(property.setter, "setChildren"); - Assert.assertEquals(property.dataType, "Children"); - Assert.assertEquals(property.name, "children"); - // "null" as default value for model - Assert.assertEquals(property.defaultValue, "null"); - Assert.assertEquals(property.baseType, "Children"); - Assert.assertFalse(property.required); - Assert.assertFalse(property.isContainer); - } - - @Test(description = "convert a model with complex list property") - public void complexListPropertyTest() { - final Schema schema = new Schema() - .description("a sample model") - .addProperties("children", new ArraySchema() - .items(new Schema().$ref("#/components/schemas/Children"))); - final DefaultCodegen codegen = new JavaClientCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", schema); - codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("sample", schema); - - Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "Sample"); - Assert.assertEquals(cm.description, "a sample model"); - Assert.assertEquals(cm.vars.size(), 1); - - final CodegenProperty property = cm.vars.get(0); - Assert.assertEquals(property.baseName, "children"); - Assert.assertEquals(property.complexType, "Children"); - Assert.assertEquals(property.getter, "getChildren"); - Assert.assertEquals(property.setter, "setChildren"); - Assert.assertEquals(property.dataType, "List"); - Assert.assertEquals(property.name, "children"); - Assert.assertEquals(property.defaultValue, "new ArrayList<>()"); - Assert.assertEquals(property.baseType, "List"); - Assert.assertEquals(property.containerType, "array"); - Assert.assertFalse(property.required); - Assert.assertTrue(property.isContainer); - } - - @Test(description = "convert a model with complex map property") - public void complexMapPropertyTest() { - final Schema schema = new Schema() - .description("a sample model") - .addProperties("children", new MapSchema() - .additionalProperties(new Schema().$ref("#/components/schemas/Children"))); - final DefaultCodegen codegen = new JavaClientCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", schema); - codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("sample", schema); - - Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "Sample"); - Assert.assertEquals(cm.description, "a sample model"); - Assert.assertEquals(cm.vars.size(), 1); - Assert.assertEquals(Sets.intersection(cm.imports, Sets.newHashSet("Map", "Children")).size(), 2); - - final CodegenProperty property = cm.vars.get(0); - Assert.assertEquals(property.baseName, "children"); - Assert.assertEquals(property.complexType, "Children"); - Assert.assertEquals(property.getter, "getChildren"); - Assert.assertEquals(property.setter, "setChildren"); - Assert.assertEquals(property.dataType, "Map"); - Assert.assertEquals(property.name, "children"); - Assert.assertEquals(property.defaultValue, "new HashMap<>()"); - Assert.assertEquals(property.baseType, "Map"); - Assert.assertEquals(property.containerType, "map"); - Assert.assertFalse(property.required); - Assert.assertTrue(property.isContainer); - Assert.assertTrue(property.isMap); - } - - @Test(description = "convert a model with complex array property") - public void complexArrayPropertyTest() { - final Schema schema = new Schema() - .description("a sample model") - .addProperties("children", new ArraySchema() - .items(new Schema().$ref("#/components/schemas/Children"))); - final DefaultCodegen codegen = new JavaClientCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", schema); - codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("sample", schema); - - Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "Sample"); - Assert.assertEquals(cm.description, "a sample model"); - Assert.assertEquals(cm.vars.size(), 1); - Assert.assertEquals(Sets.intersection(cm.imports, Sets.newHashSet("List", "Children")).size(), 2); - - final CodegenProperty property = cm.vars.get(0); - Assert.assertEquals(property.baseName, "children"); - Assert.assertEquals(property.complexType, "Children"); - Assert.assertEquals(property.getter, "getChildren"); - Assert.assertEquals(property.setter, "setChildren"); - Assert.assertEquals(property.dataType, "List"); - Assert.assertEquals(property.name, "children"); - Assert.assertEquals(property.defaultValue, "new ArrayList<>()"); - Assert.assertEquals(property.baseType, "List"); - Assert.assertEquals(property.containerType, "array"); - Assert.assertFalse(property.required); - Assert.assertTrue(property.isContainer); - Assert.assertTrue(property.isArray); - } - - @Test(description = "convert a model with complex set property") - public void complexSetPropertyTest() { - Schema set = new ArraySchema().items(new Schema().$ref("#/components/schemas/Children")); - set.setUniqueItems(true); // set - final Schema schema = new Schema() - .description("a sample model") - .addProperties("children", set); - final DefaultCodegen codegen = new JavaClientCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", schema); - codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("sample", schema); - - Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "Sample"); - Assert.assertEquals(cm.description, "a sample model"); - Assert.assertEquals(cm.vars.size(), 1); - Assert.assertTrue(cm.imports.contains("Set")); - - final CodegenProperty property = cm.vars.get(0); - Assert.assertEquals(property.baseName, "children"); - Assert.assertEquals(property.complexType, "Children"); - Assert.assertEquals(property.getter, "getChildren"); - Assert.assertEquals(property.setter, "setChildren"); - Assert.assertEquals(property.dataType, "Set"); - Assert.assertEquals(property.name, "children"); - Assert.assertEquals(property.defaultValue, "new LinkedHashSet<>()"); - Assert.assertEquals(property.baseType, "Set"); - Assert.assertEquals(property.containerType, "set"); - Assert.assertFalse(property.required); - Assert.assertTrue(property.isContainer); - Assert.assertTrue(property.getUniqueItemsBoolean()); - } - @Test(description = "convert a model with an array property with item name") - public void arrayModelWithItemNameTest() { - final Schema propertySchema = new ArraySchema() - .items(new Schema().$ref("#/components/schemas/Child")) - .description("an array property"); - propertySchema.addExtension("x-item-name", "child"); - final Schema schema = new Schema() - .type("object") - .description("a sample model") - .addProperties("children", propertySchema); - - - final DefaultCodegen codegen = new JavaClientCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", schema); - codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("sample", schema); - - Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "Sample"); - Assert.assertEquals(cm.description, "a sample model"); - Assert.assertEquals(cm.vars.size(), 1); - Assert.assertEquals(Sets.intersection(cm.imports, Sets.newHashSet("List", "Child")).size(), 2); - - final CodegenProperty property = cm.vars.get(0); - Assert.assertEquals(property.baseName, "children"); - Assert.assertEquals(property.complexType, "Child"); - Assert.assertEquals(property.getter, "getChildren"); - Assert.assertEquals(property.setter, "setChildren"); - Assert.assertEquals(property.dataType, "List"); - Assert.assertEquals(property.name, "children"); - Assert.assertEquals(property.defaultValue, "new ArrayList<>()"); - Assert.assertEquals(property.baseType, "List"); - Assert.assertEquals(property.containerType, "array"); - Assert.assertFalse(property.required); - Assert.assertTrue(property.isContainer); - - final CodegenProperty itemsProperty = property.items; - Assert.assertEquals(itemsProperty.baseName, "child"); - Assert.assertEquals(itemsProperty.name, "child"); - } - - @Test(description = "convert an array model") - public void arrayModelTest() { - final Schema schema = new ArraySchema() - .items(new Schema().name("elobjeto").$ref("#/components/schemas/Children")) - .name("arraySchema") - .description("an array model"); - final DefaultCodegen codegen = new JavaClientCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", schema); - codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("sample", schema); - - Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "Sample"); - Assert.assertEquals(cm.description, "an array model"); - Assert.assertEquals(cm.vars.size(), 0); - Assert.assertEquals(cm.parent, "ArrayList"); - Assert.assertEquals(cm.imports.size(), 4); - Assert.assertEquals(Sets.intersection(cm.imports, Sets.newHashSet("ApiModel", "List", "ArrayList", "Children")).size(), 4); - } - - @Test(description = "convert a set model") - public void setModelTest() { - final Schema schema = new ArraySchema() - .items(new Schema().name("elobjeto").$ref("#/components/schemas/Children")) - .uniqueItems(true) - .name("arraySchema") - .description("an array model"); - final DefaultCodegen codegen = new JavaClientCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", schema); - codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("sample", schema); - - Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "Sample"); - Assert.assertEquals(cm.description, "an array model"); - Assert.assertEquals(cm.vars.size(), 0); - Assert.assertEquals(cm.parent, "LinkedHashSet"); - Assert.assertEquals(cm.imports.size(), 4); - Assert.assertEquals(Sets.intersection(cm.imports, Sets.newHashSet("ApiModel", "Set", "LinkedHashSet", "Children")).size(), 4); - } - - @Test(description = "convert a map model") - public void mapModelTest() { - final Schema schema = new Schema() - .description("a map model") - .additionalProperties(new Schema().$ref("#/components/schemas/Children")); - final DefaultCodegen codegen = new JavaClientCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", schema); - codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("sample", schema); - - Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "Sample"); - Assert.assertEquals(cm.description, "a map model"); - Assert.assertEquals(cm.vars.size(), 0); - Assert.assertEquals(cm.parent, "HashMap"); - Assert.assertEquals(cm.imports.size(), 4); - Assert.assertEquals(Sets.intersection(cm.imports, Sets.newHashSet("ApiModel", "Map", "HashMap", "Children")).size(), 4); - } - - @Test(description = "convert a model with upper-case property names") - public void upperCaseNamesTest() { - final Schema schema = new Schema() - .description("a model with upper-case property names") - .addProperties("NAME", new StringSchema()) - .addRequiredItem("NAME"); - final DefaultCodegen codegen = new JavaClientCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", schema); - codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("sample", schema); - - Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "Sample"); - Assert.assertEquals(cm.vars.size(), 1); - - final CodegenProperty property = cm.vars.get(0); - Assert.assertEquals(property.baseName, "NAME"); - Assert.assertEquals(property.getter, "getNAME"); - Assert.assertEquals(property.setter, "setNAME"); - Assert.assertEquals(property.dataType, "String"); - Assert.assertEquals(property.name, "NAME"); - Assert.assertNull(property.defaultValue); - Assert.assertEquals(property.baseType, "String"); - Assert.assertTrue(property.required); - Assert.assertFalse(property.isContainer); - } - - @Test(description = "convert a model with upper-case property names and Numbers") - public void upperCaseNamesNumbersTest() { - final Schema schema = new Schema() - .description("a model with upper-case property names and numbers") - .addProperties("NAME1", new StringSchema()) - .addRequiredItem("NAME1"); - final DefaultCodegen codegen = new JavaClientCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", schema); - codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("sample", schema); - - Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "Sample"); - Assert.assertEquals(cm.vars.size(), 1); - - final CodegenProperty property = cm.vars.get(0); - Assert.assertEquals(property.baseName, "NAME1"); - Assert.assertEquals(property.getter, "getNAME1"); - Assert.assertEquals(property.setter, "setNAME1"); - Assert.assertEquals(property.dataType, "String"); - Assert.assertEquals(property.name, "NAME1"); - Assert.assertNull(property.defaultValue); - Assert.assertEquals(property.baseType, "String"); - Assert.assertTrue(property.required); - Assert.assertFalse(property.isContainer); - } - - @Test(description = "convert a model with a 2nd char upper-case property names") - public void secondCharUpperCaseNamesTest() { - final Schema schema = new Schema() - .description("a model with a 2nd char upper-case property names") - .addProperties("pId", new StringSchema()) - .addRequiredItem("pId"); - final DefaultCodegen codegen = new JavaClientCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", schema); - codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("sample", schema); - - Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "Sample"); - Assert.assertEquals(cm.vars.size(), 1); - - final CodegenProperty property = cm.vars.get(0); - Assert.assertEquals(property.baseName, "pId"); - Assert.assertEquals(property.getter, "getpId"); - Assert.assertEquals(property.setter, "setpId"); - Assert.assertEquals(property.dataType, "String"); - Assert.assertEquals(property.name, "pId"); - Assert.assertNull(property.defaultValue); - Assert.assertEquals(property.baseType, "String"); - Assert.assertTrue(property.required); - Assert.assertFalse(property.isContainer); - } - - @Test(description = "convert a model starting with two upper-case letter property names") - public void firstTwoUpperCaseLetterNamesTest() { - final Schema schema = new Schema() - .description("a model with a property name starting with two upper-case letters") - .addProperties("ATTName", new StringSchema()) - .addRequiredItem("ATTName"); - final DefaultCodegen codegen = new JavaClientCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", schema); - codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("sample", schema); - - Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "Sample"); - Assert.assertEquals(cm.vars.size(), 1); - - final CodegenProperty property = cm.vars.get(0); - Assert.assertEquals(property.baseName, "ATTName"); - Assert.assertEquals(property.getter, "getAtTName"); - Assert.assertEquals(property.setter, "setAtTName"); - Assert.assertEquals(property.dataType, "String"); - Assert.assertEquals(property.name, "atTName"); - Assert.assertNull(property.defaultValue); - Assert.assertEquals(property.baseType, "String"); - Assert.assertTrue(property.required); - Assert.assertFalse(property.isContainer); - } - - @Test(description = "convert a model with an all upper-case letter and one non letter property names") - public void allUpperCaseOneNonLetterNamesTest() { - final Schema schema = new Schema() - .description("a model with a property name starting with two upper-case letters") - .addProperties("ATT_NAME", new StringSchema()) - .addRequiredItem("ATT_NAME"); - final DefaultCodegen codegen = new JavaClientCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", schema); - codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("sample", schema); - - Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "Sample"); - Assert.assertEquals(cm.vars.size(), 1); - - final CodegenProperty property = cm.vars.get(0); - Assert.assertEquals(property.baseName, "ATT_NAME"); - Assert.assertEquals(property.getter, "getATTNAME"); - Assert.assertEquals(property.setter, "setATTNAME"); - Assert.assertEquals(property.dataType, "String"); - Assert.assertEquals(property.name, "ATT_NAME"); - Assert.assertNull(property.defaultValue); - Assert.assertEquals(property.baseType, "String"); - Assert.assertTrue(property.required); - Assert.assertFalse(property.isContainer); - } - - @Test(description = "convert hyphens per issue 503") - public void hyphensTest() { - final Schema schema = new Schema() - .description("a sample model") - .addProperties("created-at", new DateTimeSchema()); - final DefaultCodegen codegen = new JavaClientCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", schema); - codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("sample", schema); - - final CodegenProperty property = cm.vars.get(0); - Assert.assertEquals(property.baseName, "created-at"); - Assert.assertEquals(property.getter, "getCreatedAt"); - Assert.assertEquals(property.setter, "setCreatedAt"); - Assert.assertEquals(property.name, "createdAt"); - } - - @Test(description = "convert query[password] to queryPassword") - public void squareBracketsTest() { - final Schema schema = new Schema() - .description("a sample model") - .addProperties("query[password]", new StringSchema()); - final DefaultCodegen codegen = new JavaClientCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", schema); - codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("sample", schema); - - final CodegenProperty property = cm.vars.get(0); - Assert.assertEquals(property.baseName, "query[password]"); - Assert.assertEquals(property.getter, "getQueryPassword"); - Assert.assertEquals(property.setter, "setQueryPassword"); - Assert.assertEquals(property.name, "queryPassword"); - } - - @Test(description = "properly escape names per 567") - public void escapeNamesTest() { - final Schema schema = new Schema() - .description("a sample model") - .addProperties("created-at", new DateTimeSchema()); - final DefaultCodegen codegen = new JavaClientCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("with.dots", schema); - codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("with.dots", schema); - - Assert.assertEquals(cm.classname, "WithDots"); - } - - @Test(description = "convert a model with binary data") - public void binaryDataTest() { - final Schema schema = new Schema() - .description("model with binary") - .addProperties("inputBinaryData", new ByteArraySchema()); - final DefaultCodegen codegen = new JavaClientCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", schema); - codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("sample", schema); - - final CodegenProperty property = cm.vars.get(0); - Assert.assertEquals(property.baseName, "inputBinaryData"); - Assert.assertEquals(property.getter, "getInputBinaryData"); - Assert.assertEquals(property.setter, "setInputBinaryData"); - Assert.assertEquals(property.dataType, "byte[]"); - Assert.assertEquals(property.name, "inputBinaryData"); - Assert.assertNull(property.defaultValue); - Assert.assertEquals(property.baseType, "byte[]"); - Assert.assertFalse(property.required); - Assert.assertFalse(property.isContainer); - } - - @Test(description = "translate an invalid param name") - public void invalidParamNameTest() { - final Schema schema = new Schema() - .description("a model with a 2nd char upper-case property names") - .addProperties("_", new StringSchema()); - final DefaultCodegen codegen = new JavaClientCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", schema); - codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("sample", schema); - - Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "Sample"); - Assert.assertEquals(cm.vars.size(), 1); - - final CodegenProperty property = cm.vars.get(0); - Assert.assertEquals(property.baseName, "_"); - Assert.assertEquals(property.getter, "getU"); - Assert.assertEquals(property.setter, "setU"); - Assert.assertEquals(property.dataType, "String"); - Assert.assertEquals(property.name, "u"); - Assert.assertNull(property.defaultValue); - Assert.assertEquals(property.baseType, "String"); - Assert.assertFalse(property.isContainer); - } - - @Test(description = "convert a parameter") - public void convertParameterTest() { - OpenAPI openAPI = TestUtils.createOpenAPI(); - final Parameter parameter = new QueryParameter() - .description("this is a description") - .name("limit") - .required(true); - final DefaultCodegen codegen = new JavaClientCodegen(); - codegen.setOpenAPI(openAPI); - final CodegenParameter cm = codegen.fromParameter(parameter, null); - - Assert.assertNull(cm.allowableValues); - Assert.assertEquals(cm.description, "this is a description"); - } - - @Test(description = "types used by inner properties should be imported") - public void mapWithAnListOfBigDecimalTest() { - Schema decimal = new StringSchema(); - decimal.setFormat("number"); - - Schema schema1 = new Schema() - .description("model with Map>") - .addProperties("map", new MapSchema() - .additionalProperties(new ArraySchema().items(decimal))); - OpenAPI openAPI1 = TestUtils.createOpenAPIWithOneSchema("sample", schema1); - JavaClientCodegen codegen1 = new JavaClientCodegen(); - codegen1.setOpenAPI(openAPI1); - final CodegenModel cm1 = codegen1.fromModel("sample", schema1); - Assert.assertEquals(cm1.vars.get(0).dataType, "Map>"); - Assert.assertTrue(cm1.imports.contains("BigDecimal")); - - Schema schema2 = new Schema() - .description("model with Map>>") - .addProperties("map", new MapSchema() - .additionalProperties(new MapSchema() - .additionalProperties(new ArraySchema().items(decimal)))); - OpenAPI openAPI2 = TestUtils.createOpenAPIWithOneSchema("sample", schema2); - JavaClientCodegen codegen2 = new JavaClientCodegen(); - codegen2.setOpenAPI(openAPI2); - final CodegenModel cm2 = codegen2.fromModel("sample", schema2); - Assert.assertEquals(cm2.vars.get(0).dataType, "Map>>"); - Assert.assertTrue(cm2.imports.contains("BigDecimal")); - } - - @DataProvider(name = "modelNames") - public static Object[][] primeNumbers() { - return new Object[][]{ - {"sample", "Sample"}, - {"sample_name", "SampleName"}, - {"sample__name", "SampleName"}, - {"/sample", "Sample"}, - {"\\sample", "Sample"}, - {"sample.name", "SampleName"}, - {"_sample", "Sample"}, - {"Sample", "Sample"}, - }; - } - - @Test(dataProvider = "modelNames", description = "avoid inner class") - public void modelNameTest(String name, String expectedName) { - final Schema schema = new Schema(); - final DefaultCodegen codegen = new JavaClientCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema(name, schema); - codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel(name, schema); - - Assert.assertEquals(cm.name, name); - Assert.assertEquals(cm.classname, expectedName); - } - - @DataProvider(name = "classProperties") - public static Object[][] classProperties() { - return new Object[][]{ - {"class", "getPropertyClass", "setPropertyClass", "propertyClass"}, - {"_class", "getPropertyClass", "setPropertyClass", "propertyClass"}, - {"__class", "getPropertyClass", "setPropertyClass", "propertyClass"} - }; - } - - @Test(dataProvider = "classProperties", description = "handle 'class' properties") - public void classPropertyTest(String baseName, String getter, String setter, String name) { - final Schema schema = new Schema() - .description("a sample model") - .addProperties(baseName, new StringSchema()); - final DefaultCodegen codegen = new JavaClientCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", schema); - codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("sample", schema); - - final CodegenProperty property = cm.vars.get(0); - Assert.assertEquals(property.baseName, baseName); - Assert.assertEquals(property.getter, getter); - Assert.assertEquals(property.setter, setter); - Assert.assertEquals(property.name, name); - } - - - @Test(description = "test models with xml") - public void modelWithXmlTest() { - final Schema schema = new Schema() - .description("a sample model") - .xml(new XML() - .prefix("my") - .namespace("xmlNamespace") - .name("customXmlName")) - .addProperties("id", new IntegerSchema().format(SchemaTypeUtil.INTEGER64_FORMAT)) - .addProperties("name", new StringSchema() - .example("Tony") - .xml(new XML() - .attribute(true) - .prefix("my") - .name("myName"))) - .addProperties("createdAt", new DateTimeSchema() - .xml(new XML() - .prefix("my") - .namespace("myNamespace") - .name("myCreatedAt"))) - .addRequiredItem("id") - .addRequiredItem("name"); - final DefaultCodegen codegen = new JavaClientCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", schema); - codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("sample", schema); - - Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "Sample"); - Assert.assertEquals(cm.description, "a sample model"); - Assert.assertEquals(cm.xmlPrefix, "my"); - Assert.assertEquals(cm.xmlName, "customXmlName"); - Assert.assertEquals(cm.xmlNamespace, "xmlNamespace"); - Assert.assertEquals(cm.vars.size(), 3); - - final List vars = cm.vars; - - final CodegenProperty property2 = vars.get(1); - Assert.assertEquals(property2.baseName, "name"); - Assert.assertEquals(property2.getter, "getName"); - Assert.assertEquals(property2.setter, "setName"); - Assert.assertEquals(property2.dataType, "String"); - Assert.assertEquals(property2.name, "name"); - Assert.assertNull(property2.defaultValue); - Assert.assertEquals(property2.baseType, "String"); - Assert.assertEquals(property2.example, "Tony"); - Assert.assertTrue(property2.required); - Assert.assertFalse(property2.isContainer); - Assert.assertTrue(property2.isXmlAttribute); - Assert.assertEquals(property2.xmlName, "myName"); - Assert.assertNull(property2.xmlNamespace); - - final CodegenProperty property3 = vars.get(2); - Assert.assertEquals(property3.baseName, "createdAt"); - Assert.assertEquals(property3.getter, "getCreatedAt"); - Assert.assertEquals(property3.setter, "setCreatedAt"); - Assert.assertEquals(property3.dataType, "Date"); - Assert.assertEquals(property3.name, "createdAt"); - Assert.assertNull(property3.defaultValue); - Assert.assertEquals(property3.baseType, "Date"); - Assert.assertFalse(property3.required); - Assert.assertFalse(property3.isContainer); - Assert.assertFalse(property3.isXmlAttribute); - Assert.assertEquals(property3.xmlName, "myCreatedAt"); - Assert.assertEquals(property3.xmlNamespace, "myNamespace"); - Assert.assertEquals(property3.xmlPrefix, "my"); - } - - @Test(description = "test models with wrapped xml") - public void modelWithWrappedXmlTest() { - final Schema schema = new Schema() - .description("a sample model") - .xml(new XML() - .prefix("my") - .namespace("xmlNamespace") - .name("customXmlName")) - .addProperties("id", new IntegerSchema().format(SchemaTypeUtil.INTEGER64_FORMAT)) - .addProperties("array", new ArraySchema() - .items(new StringSchema() - .xml(new XML() - .name("i"))) - .xml(new XML() - .prefix("my") - .wrapped(true) - .namespace("myNamespace") - .name("xmlArray"))) - .addRequiredItem("id"); - final DefaultCodegen codegen = new JavaClientCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", schema); - codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("sample", schema); - - Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "Sample"); - Assert.assertEquals(cm.description, "a sample model"); - Assert.assertEquals(cm.xmlPrefix, "my"); - Assert.assertEquals(cm.xmlName, "customXmlName"); - Assert.assertEquals(cm.xmlNamespace, "xmlNamespace"); - Assert.assertEquals(cm.vars.size(), 2); - - final List vars = cm.vars; - - final CodegenProperty property2 = vars.get(1); - Assert.assertEquals(property2.baseName, "array"); - Assert.assertEquals(property2.getter, "getArray"); - Assert.assertEquals(property2.setter, "setArray"); - Assert.assertEquals(property2.dataType, "List"); - Assert.assertEquals(property2.name, "array"); - Assert.assertEquals(property2.defaultValue, "new ArrayList<>()"); - Assert.assertEquals(property2.baseType, "List"); - Assert.assertTrue(property2.isContainer); - Assert.assertTrue(property2.isXmlWrapped); - Assert.assertEquals(property2.xmlName, "xmlArray"); - Assert.assertNotNull(property2.xmlNamespace); - Assert.assertNotNull(property2.items); - CodegenProperty items = property2.items; - Assert.assertEquals(items.xmlName, "i"); - Assert.assertEquals(items.baseName, "array"); - } - - @Test(description = "convert a boolean parameter") - public void booleanPropertyTest() { - OpenAPI openAPI = TestUtils.createOpenAPI(); - final BooleanSchema property = new BooleanSchema(); - final JavaClientCodegen codegen = new JavaClientCodegen(); - codegen.setOpenAPI(openAPI); - codegen.setBooleanGetterPrefix("is"); - final CodegenProperty cp = codegen.fromProperty("property", property); - - Assert.assertEquals(cp.baseName, "property"); - Assert.assertEquals(cp.dataType, "Boolean"); - Assert.assertEquals(cp.name, "property"); - Assert.assertEquals(cp.baseType, "Boolean"); - Assert.assertFalse(cp.isContainer); - Assert.assertTrue(cp.isBoolean); - Assert.assertEquals(cp.getter, "isProperty"); - } - - @Test(description = "convert an integer property") - public void integerPropertyTest() { - OpenAPI openAPI = TestUtils.createOpenAPI(); - final IntegerSchema property = new IntegerSchema(); - final DefaultCodegen codegen = new JavaClientCodegen(); - codegen.setOpenAPI(openAPI); - final CodegenProperty cp = codegen.fromProperty("property", property); - - Assert.assertEquals(cp.baseName, "property"); - Assert.assertEquals(cp.dataType, "Integer"); - Assert.assertEquals(cp.name, "property"); - Assert.assertEquals(cp.baseType, "Integer"); - Assert.assertFalse(cp.isContainer); - Assert.assertTrue(cp.isInteger); - Assert.assertFalse(cp.isLong); - Assert.assertEquals(cp.getter, "getProperty"); - } - - @Test(description = "convert a long property") - public void longPropertyTest() { - OpenAPI openAPI = TestUtils.createOpenAPI(); - final IntegerSchema property = new IntegerSchema().format("int64"); - final DefaultCodegen codegen = new JavaClientCodegen(); - codegen.setOpenAPI(openAPI); - final CodegenProperty cp = codegen.fromProperty("property", property); - - Assert.assertEquals(cp.baseName, "property"); - Assert.assertEquals(cp.nameInCamelCase, "Property"); - Assert.assertEquals(cp.nameInSnakeCase, "PROPERTY"); - Assert.assertEquals(cp.dataType, "Long"); - Assert.assertEquals(cp.name, "property"); - Assert.assertEquals(cp.baseType, "Long"); - Assert.assertFalse(cp.isContainer); - Assert.assertTrue(cp.isLong); - Assert.assertFalse(cp.isInteger); - Assert.assertEquals(cp.getter, "getProperty"); - } - - @Test(description = "convert an integer property in a referenced schema") - public void integerPropertyInReferencedSchemaTest() { - final IntegerSchema longProperty = new IntegerSchema().format("int32"); - final Schema testSchema = new ObjectSchema() - .addProperties("Integer1", new Schema<>().$ref("#/components/schemas/IntegerProperty")) - .addProperties("Integer2", new IntegerSchema().format("int32")); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("IntegerProperty", longProperty); - final DefaultCodegen codegen = new JavaClientCodegen(); - codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("test", testSchema); - - Assert.assertEquals(cm.vars.size(), 2); - - CodegenProperty cp1 = cm.vars.get(0); - Assert.assertEquals(cp1.baseName, "Integer1"); - Assert.assertEquals(cp1.nameInCamelCase, "Integer1"); - Assert.assertEquals(cp1.nameInSnakeCase, "INTEGER1"); - Assert.assertEquals(cp1.dataType, "Integer"); - Assert.assertEquals(cp1.name, "integer1"); - Assert.assertEquals(cp1.baseType, "Integer"); - Assert.assertEquals(cp1.getter, "getInteger1"); - - CodegenProperty cp2 = cm.vars.get(1); - Assert.assertEquals(cp2.baseName, "Integer2"); - Assert.assertEquals(cp2.nameInCamelCase, "Integer2"); - Assert.assertEquals(cp2.nameInSnakeCase, "INTEGER2"); - Assert.assertEquals(cp2.dataType, "Integer"); - Assert.assertEquals(cp2.name, "integer2"); - Assert.assertEquals(cp2.baseType, "Integer"); - Assert.assertEquals(cp2.getter, "getInteger2"); - } - - @Test(description = "convert a long property in a referenced schema") - public void longPropertyInReferencedSchemaTest() { - final IntegerSchema longProperty = new IntegerSchema().format("int64"); - final Schema TestSchema = new ObjectSchema() - .addProperties("Long1", new Schema<>().$ref("#/components/schemas/LongProperty")) - .addProperties("Long2", new IntegerSchema().format("int64")); - final DefaultCodegen codegen = new JavaClientCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("LongProperty", longProperty); - codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("test", TestSchema); - - Assert.assertEquals(cm.vars.size(), 2); - - CodegenProperty cp1 = cm.vars.get(0); - Assert.assertEquals(cp1.baseName, "Long1"); - Assert.assertEquals(cp1.dataType, "Long"); - Assert.assertEquals(cp1.name, "long1"); - Assert.assertEquals(cp1.baseType, "Long"); - Assert.assertEquals(cp1.getter, "getLong1"); - - CodegenProperty cp2 = cm.vars.get(1); - Assert.assertEquals(cp2.baseName, "Long2"); - Assert.assertEquals(cp2.dataType, "Long"); - Assert.assertEquals(cp2.name, "long2"); - Assert.assertEquals(cp2.baseType, "Long"); - Assert.assertEquals(cp2.getter, "getLong2"); - } - - @Test(description = "convert string property") - public void stringPropertyTest() { - OpenAPI openAPI = TestUtils.createOpenAPI(); - final Schema property = new StringSchema().maxLength(10).minLength(3).pattern("^[A-Z]+$"); - final DefaultCodegen codegen = new JavaClientCodegen(); - codegen.setOpenAPI(openAPI); - final CodegenProperty cp = codegen.fromProperty("somePropertyWithMinMaxAndPattern", property); - - Assert.assertEquals(cp.baseName, "somePropertyWithMinMaxAndPattern"); - Assert.assertEquals(cp.nameInCamelCase, "SomePropertyWithMinMaxAndPattern"); - Assert.assertEquals(cp.nameInSnakeCase, "SOME_PROPERTY_WITH_MIN_MAX_AND_PATTERN"); - Assert.assertEquals(cp.dataType, "String"); - Assert.assertEquals(cp.name, "somePropertyWithMinMaxAndPattern"); - Assert.assertEquals(cp.baseType, "String"); - Assert.assertFalse(cp.isContainer); - Assert.assertFalse(cp.isLong); - Assert.assertFalse(cp.isInteger); - Assert.assertTrue(cp.isString); - Assert.assertEquals(cp.getter, "getSomePropertyWithMinMaxAndPattern"); - Assert.assertEquals(cp.minLength, Integer.valueOf(3)); - Assert.assertEquals(cp.maxLength, Integer.valueOf(10)); - Assert.assertEquals(cp.pattern, "^[A-Z]+$"); - } - - @Test(description = "convert string property in an object") - public void stringPropertyInObjectTest() { - final Schema property = new StringSchema().maxLength(10).minLength(3).pattern("^[A-Z]+$"); - final Schema myObject = new ObjectSchema().addProperties("somePropertyWithMinMaxAndPattern", property); - - final DefaultCodegen codegen = new JavaClientCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("myObject", myObject); - codegen.setOpenAPI(openAPI); - CodegenModel cm = codegen.fromModel("myObject", myObject); - - Assert.assertEquals(cm.getVars().size(), 1); - CodegenProperty cp = cm.getVars().get(0); - Assert.assertEquals(cp.baseName, "somePropertyWithMinMaxAndPattern"); - Assert.assertEquals(cp.nameInCamelCase, "SomePropertyWithMinMaxAndPattern"); - Assert.assertEquals(cp.nameInSnakeCase, "SOME_PROPERTY_WITH_MIN_MAX_AND_PATTERN"); - Assert.assertEquals(cp.dataType, "String"); - Assert.assertEquals(cp.name, "somePropertyWithMinMaxAndPattern"); - Assert.assertEquals(cp.baseType, "String"); - Assert.assertFalse(cp.isContainer); - Assert.assertFalse(cp.isLong); - Assert.assertFalse(cp.isInteger); - Assert.assertTrue(cp.isString); - Assert.assertEquals(cp.getter, "getSomePropertyWithMinMaxAndPattern"); - Assert.assertEquals(cp.minLength, Integer.valueOf(3)); - Assert.assertEquals(cp.maxLength, Integer.valueOf(10)); - Assert.assertEquals(cp.pattern, "^[A-Z]+$"); - } - - @Test(description = "convert referenced string property in an object") - public void stringPropertyReferencedInObjectTest() { - final Schema property = new StringSchema().maxLength(10).minLength(3).pattern("^[A-Z]+$"); - final Schema myObject = new ObjectSchema().addProperties("somePropertyWithMinMaxAndPattern", new ObjectSchema().$ref("refObj")); - - final DefaultCodegen codegen = new JavaClientCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPI(); - openAPI.setComponents(new Components() - .addSchemas("myObject", myObject) - .addSchemas("refObj", property) - ); - codegen.setOpenAPI(openAPI); - CodegenModel cm = codegen.fromModel("myObject", myObject); - - Assert.assertEquals(cm.getVars().size(), 1); - CodegenProperty cp = cm.getVars().get(0); - Assert.assertEquals(cp.baseName, "somePropertyWithMinMaxAndPattern"); - Assert.assertEquals(cp.nameInCamelCase, "SomePropertyWithMinMaxAndPattern"); - Assert.assertEquals(cp.nameInSnakeCase, "SOME_PROPERTY_WITH_MIN_MAX_AND_PATTERN"); - Assert.assertEquals(cp.dataType, "String"); - Assert.assertEquals(cp.name, "somePropertyWithMinMaxAndPattern"); - Assert.assertEquals(cp.baseType, "String"); - Assert.assertFalse(cp.isContainer); - Assert.assertFalse(cp.isLong); - Assert.assertFalse(cp.isInteger); - Assert.assertTrue(cp.isString); - Assert.assertEquals(cp.getter, "getSomePropertyWithMinMaxAndPattern"); - Assert.assertEquals(cp.minLength, Integer.valueOf(3)); - Assert.assertEquals(cp.maxLength, Integer.valueOf(10)); - Assert.assertEquals(cp.pattern, "^[A-Z]+$"); - } - - @Test(description = "convert an array schema") - public void arraySchemaTest() { - final Schema testSchema = new ObjectSchema() - .addProperties("pets", new ArraySchema() - .items(new Schema<>().$ref("#/components/schemas/Pet"))); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("Pet", new ObjectSchema().addProperties("name", new StringSchema())); - final DefaultCodegen codegen = new JavaClientCodegen(); - codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("test", testSchema); - - Assert.assertEquals(cm.vars.size(), 1); - CodegenProperty cp1 = cm.vars.get(0); - Assert.assertEquals(cp1.baseName, "pets"); - Assert.assertEquals(cp1.dataType, "List"); - Assert.assertEquals(cp1.name, "pets"); - Assert.assertEquals(cp1.baseType, "List"); - Assert.assertTrue(cp1.isContainer); - Assert.assertTrue(cp1.isArray); - Assert.assertFalse(cp1.isMap); - Assert.assertEquals(cp1.getter, "getPets"); - Assert.assertEquals(cp1.items.baseType, "Pet"); - - Assert.assertTrue(cm.imports.contains("List")); - Assert.assertTrue(cm.imports.contains("Pet")); - } - - @Test(description = "convert an array schema in a RequestBody") - public void arraySchemaTestInRequestBody() { - final Schema testSchema = new ArraySchema() - .items(new Schema<>().$ref("#/components/schemas/Pet")); - Operation operation = new Operation() - .requestBody(new RequestBody() - .content(new Content().addMediaType("application/json", - new MediaType().schema(testSchema)))) - .responses( - new ApiResponses().addApiResponse("204", new ApiResponse() - .description("Ok response"))); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("Pet", new ObjectSchema().addProperties("name", new StringSchema())); - final DefaultCodegen codegen = new JavaClientCodegen(); - codegen.setOpenAPI(openAPI); - final CodegenOperation co = codegen.fromOperation("testSchema", "GET", operation, null); - - Assert.assertEquals(co.bodyParams.size(), 1); - CodegenParameter cp1 = co.bodyParams.get(0); - Assert.assertEquals(cp1.baseType, "Pet"); - Assert.assertEquals(cp1.dataType, "List"); - Assert.assertTrue(cp1.isContainer); - Assert.assertTrue(cp1.isArray); - Assert.assertFalse(cp1.isMap); - Assert.assertEquals(cp1.items.baseType, "Pet"); - Assert.assertEquals(cp1.items.complexType, "Pet"); - Assert.assertEquals(cp1.items.dataType, "Pet"); - - Assert.assertEquals(co.responses.size(), 1); - - Assert.assertTrue(co.imports.contains("List")); - Assert.assertTrue(co.imports.contains("Pet")); - } - - @Test(description = "convert an array schema in an ApiResponse") - public void arraySchemaTestInOperationResponse() { - final Schema testSchema = new ArraySchema() - .items(new Schema<>().$ref("#/components/schemas/Pet")); - Operation operation = new Operation().responses( - new ApiResponses().addApiResponse("200", new ApiResponse() - .description("Ok response") - .content(new Content().addMediaType("application/json", - new MediaType().schema(testSchema))))); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("Pet", new ObjectSchema().addProperties("name", new StringSchema())); - final DefaultCodegen codegen = new JavaClientCodegen(); - codegen.setOpenAPI(openAPI); - final CodegenOperation co = codegen.fromOperation("testSchema", "GET", operation, null); - - Assert.assertEquals(co.responses.size(), 1); - CodegenResponse cr = co.responses.get(0); - Assert.assertEquals(cr.baseType, "Pet"); - Assert.assertEquals(cr.dataType, "List"); - Assert.assertEquals(cr.containerType, "array"); - - Assert.assertTrue(co.imports.contains("Pet")); - } - - @Test(description = "convert an array of array schema") - public void arrayOfArraySchemaTest() { - final Schema testSchema = new ObjectSchema() - .addProperties("pets", new ArraySchema() - .items(new ArraySchema() - .items(new Schema<>().$ref("#/components/schemas/Pet")))); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("Pet", new ObjectSchema().addProperties("name", new StringSchema())); - final DefaultCodegen codegen = new JavaClientCodegen(); - codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("test", testSchema); - - Assert.assertEquals(cm.vars.size(), 1); - CodegenProperty cp1 = cm.vars.get(0); - Assert.assertEquals(cp1.baseName, "pets"); - Assert.assertEquals(cp1.dataType, "List>"); - Assert.assertEquals(cp1.name, "pets"); - Assert.assertEquals(cp1.baseType, "List"); - Assert.assertEquals(cp1.getter, "getPets"); - - Assert.assertTrue(cm.imports.contains("List")); - Assert.assertTrue(cm.imports.contains("Pet")); - } - - @Test(description = "convert an array of array schema in a RequestBody") - public void arrayOfArraySchemaTestInRequestBody() { - final Schema testSchema = new ArraySchema() - .items(new ArraySchema() - .items(new Schema<>().$ref("#/components/schemas/Pet"))); - Operation operation = new Operation() - .requestBody(new RequestBody() - .content(new Content().addMediaType("application/json", - new MediaType().schema(testSchema)))) - .responses( - new ApiResponses().addApiResponse("204", new ApiResponse() - .description("Ok response"))); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("Pet", new ObjectSchema().addProperties("name", new StringSchema())); - final DefaultCodegen codegen = new JavaClientCodegen(); - codegen.setOpenAPI(openAPI); - final CodegenOperation co = codegen.fromOperation("testSchema", "GET", operation, null); - - Assert.assertEquals(co.bodyParams.size(), 1); - CodegenParameter cp1 = co.bodyParams.get(0); - Assert.assertEquals(cp1.baseType, "List"); - Assert.assertEquals(cp1.dataType, "List>"); - Assert.assertTrue(cp1.isContainer); - Assert.assertTrue(cp1.isArray); - Assert.assertFalse(cp1.isMap); - Assert.assertEquals(cp1.items.baseType, "List"); - Assert.assertEquals(cp1.items.complexType, "Pet"); - Assert.assertEquals(cp1.items.dataType, "List"); - Assert.assertEquals(cp1.items.items.baseType, "Pet"); - Assert.assertEquals(cp1.items.items.complexType, "Pet"); - Assert.assertEquals(cp1.items.items.dataType, "Pet"); - - Assert.assertEquals(co.responses.size(), 1); - - Assert.assertTrue(co.imports.contains("Pet")); - Assert.assertTrue(co.imports.contains("List")); - } - - @Test(description = "convert an array schema in an ApiResponse") - public void arrayOfArraySchemaTestInOperationResponse() { - final Schema testSchema = new ArraySchema() - .items(new ArraySchema() - .items(new Schema<>().$ref("#/components/schemas/Pet"))); - Operation operation = new Operation().responses( - new ApiResponses().addApiResponse("200", new ApiResponse() - .description("Ok response") - .content(new Content().addMediaType("application/json", - new MediaType().schema(testSchema))))); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("Pet", new ObjectSchema().addProperties("name", new StringSchema())); - final DefaultCodegen codegen = new JavaClientCodegen(); - codegen.setOpenAPI(openAPI); - final CodegenOperation co = codegen.fromOperation("testSchema", "GET", operation, null); - - Assert.assertEquals(co.responses.size(), 1); - CodegenResponse cr = co.responses.get(0); - Assert.assertEquals(cr.baseType, "Pet"); - Assert.assertEquals(cr.dataType, "List>"); - Assert.assertEquals(cr.containerType, "array"); - - Assert.assertTrue(co.imports.contains("Pet")); - } - - @Test - public void generateModel() throws Exception { - String inputSpec = "src/test/resources/3_0/petstore.json"; - - final File output = Files.createTempDirectory("test").toFile(); - output.deleteOnExit(); - - Assert.assertTrue(new File(inputSpec).exists()); - - final CodegenConfigurator configurator = new CodegenConfigurator() - .setGeneratorName("java") - .setLibrary("jersey2") - //.addAdditionalProperty("withXml", true) - .addAdditionalProperty(CodegenConstants.SERIALIZABLE_MODEL, true) - .setInputSpec(inputSpec) - .setOutputDir(output.getAbsolutePath()); - - final ClientOptInput clientOptInput = configurator.toClientOptInput(); - new DefaultGenerator().opts(clientOptInput).generate(); - - File orderFile = new File(output, "src/main/java/org/openapitools/client/model/Order.java"); - Assert.assertTrue(orderFile.exists()); - } - - @Test - public void generateEmpty() throws Exception { - String inputSpec = "src/test/resources/3_0/ping.yaml"; - - final File output = Files.createTempDirectory("test").toFile(); - output.deleteOnExit(); - Assert.assertTrue(new File(inputSpec).exists()); - - JavaClientCodegen config = new org.openapitools.codegen.languages.JavaClientCodegen(); - config.setHideGenerationTimestamp(true); - config.setOutputDir(output.getAbsolutePath()); - - final OpenAPI openAPI = TestUtils.parseFlattenSpec(inputSpec); - - final ClientOptInput opts = new ClientOptInput(); - opts.config(config); - opts.openAPI(openAPI); - new DefaultGenerator().opts(opts).generate(); - - File orderFile = new File(output, "src/main/java/org/openapitools/client/api/DefaultApi.java"); - Assert.assertTrue(orderFile.exists()); - } -} diff --git a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/python/PythonClientTest.java b/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/python/PythonClientTest.java deleted file mode 100644 index 7fcdf1e056d..00000000000 --- a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/python/PythonClientTest.java +++ /dev/null @@ -1,262 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen.python; - -import com.google.common.io.Resources; -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.Operation; -import io.swagger.v3.oas.models.media.*; -import org.openapitools.codegen.*; -import org.openapitools.codegen.config.CodegenConfigurator; -import org.openapitools.codegen.languages.PythonClientCodegen; -import org.openapitools.codegen.model.ModelMap; -import org.openapitools.codegen.model.ModelsMap; -import org.openapitools.codegen.utils.ModelUtils; -import org.testng.Assert; -import org.testng.annotations.Test; - -import java.io.File; -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -@SuppressWarnings("static-method") -public class PythonClientTest { - - @Test(description = "tests RecursiveExampleValueWithCycle") - public void testRecursiveExampleValueWithCycle() throws Exception { - - final OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/issue_7532.yaml"); - final PythonClientCodegen codegen = new PythonClientCodegen(); - codegen.setOpenAPI(openAPI); - Schema schemaWithCycleInTreesProperty = openAPI.getComponents().getSchemas().get("Forest"); - String exampleValue = codegen.toExampleValue(schemaWithCycleInTreesProperty, null); - - String expectedValue = Resources.toString( - Resources.getResource("3_0/issue_7532_tree_example_value_expected.txt"), - StandardCharsets.UTF_8); - expectedValue = expectedValue.replaceAll("\\r\\n", "\n"); - Assert.assertEquals(exampleValue.trim(), expectedValue.trim()); - } - - @Test(expectedExceptions = RuntimeException.class) - public void testSpecWithTooLowVersionThrowsException() { - final OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/2_0/petstore.yaml"); - final PythonClientCodegen codegen = new PythonClientCodegen(); - codegen.preprocessOpenAPI(openAPI); - } - - @Test - public void testSpecWithAcceptableVersion() { - final OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/petstore.yaml"); - final PythonClientCodegen codegen = new PythonClientCodegen(); - codegen.preprocessOpenAPI(openAPI); - Assert.assertEquals(openAPI.getOpenapi() , "3.0.0"); - Assert.assertTrue(openAPI.getExtensions() == null); - } - - @Test - public void testSpecWithAcceptableVersionAndExtension() { - final OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/issue_12196.yaml"); - final PythonClientCodegen codegen = new PythonClientCodegen(); - codegen.preprocessOpenAPI(openAPI); - Assert.assertEquals(openAPI.getOpenapi() , "3.0.0"); - Assert.assertFalse(openAPI.getExtensions().isEmpty()); - Assert.assertFalse(openAPI.getExtensions().containsValue("x-original-swagger-version")); - } - - @Test(description = "tests GeoJson Example for GeoJsonGeometry") - public void testRecursiveGeoJsonExampleWhenTypeIsGeoJsonGeometry() throws IOException { - - testEndpointExampleValue("/geojson", - "src/test/resources/3_0/issue_13043_recursive_model.yaml", - "3_0/issue_13043_recursive_model_expected_value.txt"); - - - } - - @Test(description = "tests GeoJson Example for GeometryCollection") - public void testRecursiveGeoJsonExampleWhenTypeIsGeometryCollection() throws IOException { - - testEndpointExampleValue("/geojson_geometry_collection", - "src/test/resources/3_0/issue_13043_recursive_model.yaml", - "3_0/issue_13043_geometry_collection_expected_value.txt"); - - } - - private void testEndpointExampleValue(String endpoint, String specFilePath, String expectedAnswerPath) throws IOException { - final OpenAPI openAPI = TestUtils.parseFlattenSpec(specFilePath); - final PythonClientCodegen codegen = new PythonClientCodegen(); - codegen.setOpenAPI(openAPI); - - final Operation operation = openAPI.getPaths().get(endpoint).getPost(); - Schema schema = ModelUtils.getSchemaFromRequestBody(operation.getRequestBody()); - String exampleValue = codegen.toExampleValue(schema, null); - - // uncomment if you need to regenerate the expected value - // PrintWriter printWriter = new PrintWriter("src/test/resources/" + expectedAnswerPath); - // printWriter.write(exampleValue); - // printWriter.close(); - // org.junit.Assert.assertTrue(false); - - String expectedValue = Resources.toString( - Resources.getResource(expectedAnswerPath), - StandardCharsets.UTF_8); - expectedValue = expectedValue.replaceAll("\\r\\n", "\n"); - Assert.assertEquals(exampleValue.trim(), expectedValue.trim()); - - } - - @Test - public void testApiTestsNotGenerated() throws Exception { - File output = Files.createTempDirectory("test").toFile(); - - Map globalProperties = Collections.singletonMap("apiTests", "false"); - final CodegenConfigurator configurator = new CodegenConfigurator() - .setGlobalProperties(globalProperties) - .setGeneratorName("python") - .setInputSpec("src/test/resources/3_0/petstore.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); - - final ClientOptInput clientOptInput = configurator.toClientOptInput(); - DefaultGenerator generator = new DefaultGenerator(); - List files = generator.opts(clientOptInput).generate(); - Assert.assertTrue(files.size() > 0); - - Path pathThatShouldNotExist = output.toPath().resolve("openapi_client/test/test_paths"); - Assert.assertFalse(Files.isDirectory(pathThatShouldNotExist)); - output.deleteOnExit(); - } - - @Test - public void testApisNotGenerated() throws Exception { - File output = Files.createTempDirectory("test").toFile(); - - Map globalProperties = Collections.singletonMap("models", ""); - final CodegenConfigurator configurator = new CodegenConfigurator() - .setGlobalProperties(globalProperties) - .setGeneratorName("python") - .setInputSpec("src/test/resources/3_0/petstore.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); - - final ClientOptInput clientOptInput = configurator.toClientOptInput(); - DefaultGenerator generator = new DefaultGenerator(); - List files = generator.opts(clientOptInput).generate(); - Assert.assertTrue(files.size() > 0); - - Path pathThatShouldNotExist = output.toPath().resolve("openapi_client/paths"); - Assert.assertFalse(Files.isDirectory(pathThatShouldNotExist)); - output.deleteOnExit(); - } - - @Test - public void testRegexWithoutTrailingSlashWorks() { - OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/11_regex.yaml"); - PythonClientCodegen codegen = new PythonClientCodegen(); - codegen.setOpenAPI(openAPI); - - String modelName = "UUID"; - Schema schema = openAPI.getComponents().getSchemas().get(modelName); - - CodegenModel cm = codegen.fromModel(modelName, schema); - String expectedRegexPattern = "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}"; - Assert.assertEquals(cm.getPattern(), expectedRegexPattern); - Assert.assertEquals(cm.vendorExtensions.get("x-regex"), expectedRegexPattern); - Assert.assertFalse(cm.vendorExtensions.containsKey("x-modifiers")); - } - - @Test - public void testRegexWithMultipleFlagsWorks() { - OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/11_regex.yaml"); - PythonClientCodegen codegen = new PythonClientCodegen(); - codegen.setOpenAPI(openAPI); - - String modelName = "StringWithRegexWithThreeFlags"; - Schema schema = openAPI.getComponents().getSchemas().get(modelName); - - CodegenModel cm = codegen.fromModel(modelName, schema); - String expectedRegexPattern = "a."; - Assert.assertEquals(cm.getPattern(), expectedRegexPattern); - Assert.assertEquals(cm.vendorExtensions.get("x-regex"), expectedRegexPattern); - Assert.assertEquals(cm.vendorExtensions.get("x-modifiers"), Arrays.asList("DOTALL", "IGNORECASE", "MULTILINE")); - } - - @Test - public void testEnumNames() { - OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/70_schema_enum_names.yaml"); - PythonClientCodegen codegen = new PythonClientCodegen(); - codegen.setOpenAPI(openAPI); - - String modelName = "StringEnum"; - Schema schema = openAPI.getComponents().getSchemas().get(modelName); - - CodegenModel cm = codegen.fromModel(modelName, schema); - - ModelMap modelMap = new ModelMap(); - modelMap.setModel(cm); - - ModelsMap modelsMap = new ModelsMap(); - modelsMap.setModels(Collections.singletonList(modelMap)); - codegen.postProcessModels(modelsMap); - - ArrayList> enumVars = (ArrayList>) cm.getAllowableValues().get("enumVars"); - Assert.assertEquals(enumVars.size(), 2); - Assert.assertEquals(enumVars.get(0).get("name"), "DIGIT_THREE_67B9C"); - Assert.assertEquals(enumVars.get(1).get("name"), "FFA5A4"); - } - - @Test(description = "format imports of models using a package containing dots") - public void testImportWithQualifiedPackageName() throws Exception { - final PythonClientCodegen codegen = new PythonClientCodegen(); - codegen.setPackageName("openapi.client"); - - String importValue = codegen.toModelImport("model_name"); - Assert.assertEquals(importValue, "from openapi.client.model.model_name import ModelName"); - } - - @Test - public void testIdenticalSchemasHaveDifferentBasenames() { - final PythonClientCodegen codegen = new PythonClientCodegen(); - - Schema objSchema = new Schema(); - objSchema.setType("object"); - Schema addProp = new Schema(); - addProp.setType("object"); - objSchema.setAdditionalProperties(addProp); - - Schema arraySchema = new ArraySchema(); - Schema items = new Schema(); - items.setType("object"); - arraySchema.setItems(items); - - CodegenProperty objSchemaProp = codegen.fromProperty("objSchemaProp", objSchema, false, false); - CodegenProperty arraySchemaProp = codegen.fromProperty("arraySchemaProp", arraySchema, false, false); - Assert.assertEquals(objSchemaProp.getAdditionalProperties().baseName, "additional_properties"); - Assert.assertEquals(arraySchemaProp.getItems().baseName, "items"); - - CodegenModel objSchemaModel = codegen.fromModel("objSchemaModel", objSchema); - CodegenModel arraySchemaModel = codegen.fromModel("arraySchemaModel", arraySchema); - Assert.assertEquals(objSchemaModel.getAdditionalProperties().baseName, "additional_properties"); - Assert.assertEquals(arraySchemaModel.getItems().baseName, "items"); - } -} diff --git a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/utils/ModelUtilsTest.java b/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/utils/ModelUtilsTest.java deleted file mode 100644 index 23ffd0090e9..00000000000 --- a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/utils/ModelUtilsTest.java +++ /dev/null @@ -1,292 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen.utils; - -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.media.*; -import io.swagger.v3.oas.models.parameters.Parameter; -import io.swagger.v3.oas.models.parameters.RequestBody; -import io.swagger.v3.oas.models.responses.ApiResponse; -import org.openapitools.codegen.TestUtils; -import org.testng.Assert; -import org.testng.annotations.Test; - -import java.util.*; - -public class ModelUtilsTest { - - @Test - public void testGetAllUsedSchemas() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/unusedSchemas.yaml"); - List allUsedSchemas = ModelUtils.getAllUsedSchemas(openAPI); - List expectedAllUsedSchemas = Arrays.asList( - "SomeObj1", - "SomeObj2", - "SomeObj3", - "SomeObjShared", - "SomeObj6", - "SomeObj7", - "SomeObj8", - "SomeObj9A", - "SomeObj9B", - "SomeObj10A", - "SomeObj10B", - "SomeObj11", - "SomeArrayObj12", - "ArrayItem12", - "SomeArrayObj13", - "ArrayItem13", - "SomeObj14", - "PropertyObj14", - "SomeObj15", - "SomeMapObj16", - "MapItem16", - "p17_200_response", - "SomeObj17", - "SomeObj18", - "Common18", - "SomeObj18_allOf", - "_some_p19_patch_request", - "Obj19ByAge", - "Obj19ByType", - "SomeObj20", - "OtherObj20", - "PingDataInput21", - "PingDataOutput21", - "SInput22", - "SOutput22", - "SomeHeader23", - "SomeHeader24", - "SomeObj25", - "SomeObj26", - "Param27", - "Param28", - "Parent30", - "AChild30", - "BChild30" - ); - Assert.assertEquals(allUsedSchemas, expectedAllUsedSchemas); - Assert.assertTrue(allUsedSchemas.containsAll(expectedAllUsedSchemas)); - } - - @Test - public void testGetUnusedSchemas() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/unusedSchemas.yaml"); - List unusedSchemas = ModelUtils.getUnusedSchemas(openAPI); - List expectedUnusedSchemas = Arrays.asList( - "UnusedObj1", - "UnusedObj2", - "UnusedObj3", - "UnusedObj4", - "Parent29", - "AChild29", - "BChild29", - "AChild29_allOf", - "BChild29_allOf" - ); - Assert.assertEquals(unusedSchemas.size(), expectedUnusedSchemas.size()); - Assert.assertTrue(unusedSchemas.containsAll(expectedUnusedSchemas)); - } - - @Test - public void testSchemasUsedOnlyInFormParam() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/unusedSchemas.yaml"); - List unusedSchemas = ModelUtils.getSchemasUsedOnlyInFormParam(openAPI); - Assert.assertEquals(unusedSchemas.size(), 3); - //SomeObj2 is only used in an 'application/x-www-form-urlencoded' request - Assert.assertTrue(unusedSchemas.contains("SomeObj2"), "contains 'SomeObj2'"); - //SomeObj3 is only used in a 'multipart/form-data' request - Assert.assertTrue(unusedSchemas.contains("SomeObj3"), "contains 'SomeObj3'"); - //SomeObj7 is only used in an 'application/x-www-form-urlencoded' request (with referenced request body) - Assert.assertTrue(unusedSchemas.contains("SomeObj7"), "contains 'SomeObj7'"); - } - - @Test - public void testNoComponentsSection() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/ping.yaml"); - List unusedSchemas = ModelUtils.getSchemasUsedOnlyInFormParam(openAPI); - Assert.assertEquals(unusedSchemas.size(), 0); - } - - @Test - public void testGlobalProducesConsumes() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/2_0/globalProducesConsumesTest.yaml"); - List unusedSchemas = ModelUtils.getSchemasUsedOnlyInFormParam(openAPI); - Assert.assertEquals(unusedSchemas.size(), 0); - } - - @Test - public void testIsModelAllowsEmptyBaseModel() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/2_0/emptyBaseModel.yaml"); - Schema commandSchema = ModelUtils.getSchema(openAPI, "Command"); - - Assert.assertTrue(ModelUtils.isModel(commandSchema)); - Assert.assertFalse(ModelUtils.isFreeFormObject(openAPI, commandSchema)); - } - - @Test - public void testReferencedSchema() { - Schema otherObj = new ObjectSchema().addProperties("sprop", new StringSchema()).addProperties("iprop", new IntegerSchema()); - - OpenAPI openAPI = TestUtils.createOpenAPI(); - openAPI.getComponents().addSchemas("OtherObj", otherObj); - - Schema notExistingReferencedSchema = new Schema().$ref("NotExisting"); - Schema result1 = ModelUtils.getReferencedSchema(openAPI, notExistingReferencedSchema); - Assert.assertEquals(result1, notExistingReferencedSchema); - - Schema result2 = ModelUtils.getReferencedSchema(openAPI, new Schema().$ref("#/components/schemas/OtherObj")); - Assert.assertEquals(result2, otherObj); - } - - @Test - public void testReferencedRequestBody() { - RequestBody otherRequestBody = new RequestBody().description("Some Description"); - - OpenAPI openAPI = TestUtils.createOpenAPI(); - openAPI.getComponents().addRequestBodies("OtherRequestBody", otherRequestBody); - - RequestBody notExistingRequestBody = new RequestBody().$ref("NotExisting"); - RequestBody result1 = ModelUtils.getReferencedRequestBody(openAPI, notExistingRequestBody); - Assert.assertEquals(result1, notExistingRequestBody); - - RequestBody result2 = ModelUtils.getReferencedRequestBody(openAPI, new RequestBody().$ref("#/components/requestBodies/OtherRequestBody")); - Assert.assertEquals(result2, otherRequestBody); - } - - @Test - public void testReferencedApiResponse() { - ApiResponse otherApiResponse = new ApiResponse().description("Some Description"); - - OpenAPI openAPI = TestUtils.createOpenAPI(); - openAPI.getComponents().addResponses("OtherApiResponse", otherApiResponse); - - ApiResponse notExistingApiResponse = new ApiResponse().$ref("NotExisting"); - ApiResponse result1 = ModelUtils.getReferencedApiResponse(openAPI, notExistingApiResponse); - Assert.assertEquals(result1, notExistingApiResponse); - - ApiResponse result2 = ModelUtils.getReferencedApiResponse(openAPI, new ApiResponse().$ref("#/components/responses/OtherApiResponse")); - Assert.assertEquals(result2, otherApiResponse); - } - - @Test - public void testReferencedParameter() { - Parameter otherParameter = new Parameter().description("Some Description"); - - OpenAPI openAPI = TestUtils.createOpenAPI(); - openAPI.getComponents().addParameters("OtherParameter", otherParameter); - - Parameter notExistingParameter = new Parameter().$ref("NotExisting"); - Parameter result1 = ModelUtils.getReferencedParameter(openAPI, notExistingParameter); - Assert.assertEquals(result1, notExistingParameter); - - Parameter result2 = ModelUtils.getReferencedParameter(openAPI, new Parameter().$ref("#/components/parameters/OtherParameter")); - Assert.assertEquals(result2, otherParameter); - } - - /** - * Issue https://github.com/OpenAPITools/openapi-generator/issues/582. - * Composed schemas should not get unaliased when generating model properties, in order to properly - * generate the property data type name. - */ - @Test - public void testComposedSchemasAreNotUnaliased() { - ComposedSchema composedSchema = new ComposedSchema(); - composedSchema.allOf(Arrays.asList( - new Schema<>().$ref("#/components/schemas/SomeSchema"), - new ObjectSchema() - )); - Schema refToComposedSchema = new Schema().$ref("#/components/schemas/SomeComposedSchema"); - - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("SomeComposedSchema", composedSchema); - - Assert.assertEquals(refToComposedSchema, ModelUtils.unaliasSchema(openAPI, refToComposedSchema, new HashMap<>())); - } - - @Test - public void testAliasedTypeIsNotUnaliasedIfUsedForImportMapping() { - Schema emailSchema = new Schema().$ref("#/components/schemas/Email").type("string"); - StringSchema stringSchema = new StringSchema(); - HashMap schemaMappings = new HashMap<>(); - schemaMappings.put("Email", "foo.bar.Email"); - - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("Email", stringSchema); - - Assert.assertEquals(emailSchema, ModelUtils.unaliasSchema(openAPI, emailSchema, schemaMappings)); - Assert.assertEquals(stringSchema, ModelUtils.unaliasSchema(openAPI, emailSchema, new HashMap<>())); - } - - /** - * Issue https://github.com/OpenAPITools/openapi-generator/issues/1624. - * ModelUtils.isFreeFormObject() should not throw an NPE when passed an empty - * object schema that has additionalProperties defined as an empty object schema. - */ - @Test - public void testIsFreeFormObject() { - OpenAPI openAPI = new OpenAPI().openapi("3.0.0"); - // Create initial "empty" object schema. - ObjectSchema objSchema = new ObjectSchema(); - Assert.assertTrue(ModelUtils.isFreeFormObject(openAPI, objSchema)); - - // Set additionalProperties to an empty ObjectSchema. - objSchema.setAdditionalProperties(new ObjectSchema()); - Assert.assertTrue(ModelUtils.isFreeFormObject(openAPI, objSchema)); - - // Add a single property to the schema (no longer a free-form object). - Map props = new HashMap<>(); - props.put("prop1", new StringSchema()); - objSchema.setProperties(props); - Assert.assertFalse(ModelUtils.isFreeFormObject(openAPI, objSchema)); - - // Test a non-object schema - Assert.assertFalse(ModelUtils.isFreeFormObject(openAPI, new StringSchema())); - - // Test a null schema - Assert.assertFalse(ModelUtils.isFreeFormObject(openAPI, null)); - } - - @Test - public void testIsSetForValidSet() { - ArraySchema as = new ArraySchema() - .items(new StringSchema()); - as.setUniqueItems(true); - - Assert.assertTrue(ModelUtils.isSet(as)); - } - - @Test - public void testIsSetFalseForInvalidSet() { - ArraySchema as = new ArraySchema() - .items(new StringSchema()); - as.setUniqueItems(false); - - Assert.assertFalse(ModelUtils.isSet(as)); - } - - @Test - public void testIsSetFailsForNullSchema() { - ArraySchema as = null; - Assert.assertFalse(ModelUtils.isSet(as)); - } - - @Test - public void testSimpleRefDecoding() { - String decoded = ModelUtils.getSimpleRef("#/components/~01%20Hallo~1Welt"); - Assert.assertEquals(decoded, "~1 Hallo/Welt"); - } -} diff --git a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/utils/StringUtilsTest.java b/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/utils/StringUtilsTest.java deleted file mode 100644 index 2001a9844c5..00000000000 --- a/modules/openapi-json-schema-generator/src/test/java/org/openapitools/codegen/utils/StringUtilsTest.java +++ /dev/null @@ -1,42 +0,0 @@ -package org.openapitools.codegen.utils; - -import org.testng.Assert; -import org.testng.annotations.Test; - -import static org.openapitools.codegen.utils.StringUtils.*; - -public class StringUtilsTest { - // we'll assume that underscore (Twitter elephant bird) works fine - @Test - public void testUnderscore() { - Assert.assertEquals(underscore("abcd"), "abcd"); - Assert.assertEquals(underscore("abCd"), "ab_cd"); - Assert.assertEquals(underscore("ListABCs"), "list_abcs"); - } - - @Test - public void testCamelize() throws Exception { - Assert.assertEquals(camelize("abcd"), "Abcd"); - Assert.assertEquals(camelize("some-value"), "SomeValue"); - Assert.assertEquals(camelize("some_value"), "SomeValue"); - Assert.assertEquals(camelize("$type"), "$Type"); - - Assert.assertEquals(camelize("abcd", true), "abcd"); - Assert.assertEquals(camelize("some-value", true), "someValue"); - Assert.assertEquals(camelize("some_value", true), "someValue"); - Assert.assertEquals(camelize("Abcd", true), "abcd"); - Assert.assertEquals(camelize("$type", true), "$type"); - - Assert.assertEquals(camelize("123", true), "123"); - Assert.assertEquals(camelize("$123", true), "$123"); - } - - @Test - public void testDashize() { - Assert.assertEquals(dashize("abcd"), "abcd"); - Assert.assertEquals(dashize("some-value"), "some-value"); - Assert.assertEquals(dashize("some_value"), "some-value"); - Assert.assertEquals(dashize("Foo_Response__links"), "foo-response-links"); - Assert.assertEquals(dashize("Foo Response _links"), "foo-response-links"); - } -} diff --git a/modules/openapi-json-schema-generator/src/test/resources/2_0/rust-server/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-json-schema-generator/src/test/resources/2_0/rust-server/petstore-with-fake-endpoints-models-for-testing.yaml index 8f081c09dc1..733c0ed7b4e 100644 --- a/modules/openapi-json-schema-generator/src/test/resources/2_0/rust-server/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/openapi-json-schema-generator/src/test/resources/2_0/rust-server/petstore-with-fake-endpoints-models-for-testing.yaml @@ -608,7 +608,7 @@ paths: consumes: - "application/x-www-form-urlencoded" parameters: - # See https://github.com/OpenAPITools/openapi-generator/issues/545 + # See https://github.com/OpenAPITools/openapi-json-schema-generator/issues/545 # - name: enum_form_string_array # type: array # items: diff --git a/modules/openapi-json-schema-generator/src/test/resources/2_0/rust-server/rust-server-test.yaml b/modules/openapi-json-schema-generator/src/test/resources/2_0/rust-server/rust-server-test.yaml index c7937795ced..c1afd58be57 100644 --- a/modules/openapi-json-schema-generator/src/test/resources/2_0/rust-server/rust-server-test.yaml +++ b/modules/openapi-json-schema-generator/src/test/resources/2_0/rust-server/rust-server-test.yaml @@ -172,7 +172,7 @@ definitions: value: description: Inner string type: string - # Currently broken - see https://github.com/OpenAPITools/openapi-generator/issues/8 + # Currently broken - see https://github.com/OpenAPITools/openapi-json-schema-generator/issues/8 # ArrayOfObjects: # description: An array of objects # type: array diff --git a/modules/openapi-json-schema-generator/src/test/resources/2_0/templates/Java/libraries/jersey2/JSON.mustache b/modules/openapi-json-schema-generator/src/test/resources/2_0/templates/Java/libraries/jersey2/JSON.mustache index 3297c77e49b..3de8ad687f4 100644 --- a/modules/openapi-json-schema-generator/src/test/resources/2_0/templates/Java/libraries/jersey2/JSON.mustache +++ b/modules/openapi-json-schema-generator/src/test/resources/2_0/templates/Java/libraries/jersey2/JSON.mustache @@ -6,7 +6,7 @@ import org.threeten.bp.*; import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.*; {{#openApiNullable}} -import org.openapitools.jackson.nullable.JsonNullableModule; +import org.openapijsonschematools.jackson.nullable.JsonNullableModule; {{/openApiNullable}} {{#java8}} import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; diff --git a/modules/openapi-json-schema-generator/src/test/resources/2_0/templates/Java/libraries/jersey2/build.gradle.mustache b/modules/openapi-json-schema-generator/src/test/resources/2_0/templates/Java/libraries/jersey2/build.gradle.mustache index a506a50fbf5..4ad42ef0341 100644 --- a/modules/openapi-json-schema-generator/src/test/resources/2_0/templates/Java/libraries/jersey2/build.gradle.mustache +++ b/modules/openapi-json-schema-generator/src/test/resources/2_0/templates/Java/libraries/jersey2/build.gradle.mustache @@ -140,7 +140,7 @@ dependencies { implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" {{#openApiNullable}} - implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" + implementation "org.openapijsonschematools:jackson-databind-nullable:$jackson_databind_nullable_version" {{/openApiNullable}} {{#joda}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version" diff --git a/modules/openapi-json-schema-generator/src/test/resources/2_0/templates/Java/libraries/jersey2/pom.mustache b/modules/openapi-json-schema-generator/src/test/resources/2_0/templates/Java/libraries/jersey2/pom.mustache index 0fd1cf9fb54..a0399e543b0 100644 --- a/modules/openapi-json-schema-generator/src/test/resources/2_0/templates/Java/libraries/jersey2/pom.mustache +++ b/modules/openapi-json-schema-generator/src/test/resources/2_0/templates/Java/libraries/jersey2/pom.mustache @@ -285,7 +285,7 @@ {{#openApiNullable}} - org.openapitools + org.openapijsonschematools jackson-databind-nullable ${jackson-databind-nullable-version} diff --git a/modules/openapi-json-schema-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml b/modules/openapi-json-schema-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml index b9e2888f551..18e7a55e707 100644 --- a/modules/openapi-json-schema-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +++ b/modules/openapi-json-schema-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml @@ -1986,7 +1986,7 @@ components: - lengthCm additionalProperties: false # go-experimental is unable to make Triangle and Quadrilateral models - # correctly https://github.com/OpenAPITools/openapi-generator/issues/6149 + # correctly https://github.com/OpenAPITools/openapi-json-schema-generator/issues/6149 Drawing: type: object properties: diff --git a/modules/openapi-json-schema-generator/src/test/resources/3_0/inline_model_resolver.yaml b/modules/openapi-json-schema-generator/src/test/resources/3_0/inline_model_resolver.yaml index 0741d3b5d77..7b9e3c7edb6 100644 --- a/modules/openapi-json-schema-generator/src/test/resources/3_0/inline_model_resolver.yaml +++ b/modules/openapi-json-schema-generator/src/test/resources/3_0/inline_model_resolver.yaml @@ -167,7 +167,6 @@ paths: description: OK # Swagger parser doesn't use MapSchema currently, # so we need to set a MapSchema instance as the schema manually for testing. - # see InlineModelResolverTest#resolveInlineMapSchemaInResponse() /resolve_inline_request_body_allof: post: requestBody: diff --git a/modules/openapi-json-schema-generator/src/test/resources/3_0/issue_13043_geometry_collection_expected_value.txt b/modules/openapi-json-schema-generator/src/test/resources/3_0/issue_13043_geometry_collection_expected_value.txt index 7d4d61650ba..2d004d9d37e 100644 --- a/modules/openapi-json-schema-generator/src/test/resources/3_0/issue_13043_geometry_collection_expected_value.txt +++ b/modules/openapi-json-schema-generator/src/test/resources/3_0/issue_13043_geometry_collection_expected_value.txt @@ -1,4 +1,4 @@ -GeometryCollection( +geometry_collection.GeometryCollection( type="GeometryCollection", geometries=[], ) \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/test/resources/3_0/issue_13043_recursive_model.yaml b/modules/openapi-json-schema-generator/src/test/resources/3_0/issue_13043_recursive_model.yaml index 9b9f5d34c3e..fec5944e7a2 100644 --- a/modules/openapi-json-schema-generator/src/test/resources/3_0/issue_13043_recursive_model.yaml +++ b/modules/openapi-json-schema-generator/src/test/resources/3_0/issue_13043_recursive_model.yaml @@ -57,8 +57,8 @@ components: discriminator: propertyName: type mapping: - Point: '#/components/schemas/Point' GeometryCollection: '#/components/schemas/GeometryCollection' + Point: '#/components/schemas/Point' externalDocs: url: http://geojson.org/geojson-spec.html#geometry-objects Point: diff --git a/modules/openapi-json-schema-generator/src/test/resources/3_0/issue_13043_recursive_model_expected_value.txt b/modules/openapi-json-schema-generator/src/test/resources/3_0/issue_13043_recursive_model_expected_value.txt index 137db22fa97..fb9d3068d74 100644 --- a/modules/openapi-json-schema-generator/src/test/resources/3_0/issue_13043_recursive_model_expected_value.txt +++ b/modules/openapi-json-schema-generator/src/test/resources/3_0/issue_13043_recursive_model_expected_value.txt @@ -1,4 +1,4 @@ -GeoJsonGeometry( +geo_json_geometry.GeoJsonGeometry( type="GeometryCollection", geometries=[], ) \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/test/resources/3_0/issue_7532_tree_example_value_expected.txt b/modules/openapi-json-schema-generator/src/test/resources/3_0/issue_7532_tree_example_value_expected.txt index 6c3772035ed..db85c8b22cb 100644 --- a/modules/openapi-json-schema-generator/src/test/resources/3_0/issue_7532_tree_example_value_expected.txt +++ b/modules/openapi-json-schema-generator/src/test/resources/3_0/issue_7532_tree_example_value_expected.txt @@ -1,15 +1,15 @@ dict( - trees=Tree( + trees=tree.Tree( id=1, name="name_example", description="description_example", children=[ - Tree() + tree.Tree() ], - parent=Tree(), - forest=Forest(), + parent=tree.Tree(), + forest=forest.Forest(), additional=dict( - "key": Tree(), + "key": tree.Tree(), ), ), ) \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/test/resources/3_0/issue_7613.yaml b/modules/openapi-json-schema-generator/src/test/resources/3_0/issue_7613.yaml index 5973adb14d7..21ada9cf5ff 100644 --- a/modules/openapi-json-schema-generator/src/test/resources/3_0/issue_7613.yaml +++ b/modules/openapi-json-schema-generator/src/test/resources/3_0/issue_7613.yaml @@ -163,21 +163,21 @@ paths: "201": description: "201" content: - application/json: + application/xml: schema: type: object additionalProperties: true "202": description: "202" content: - application/json: + application/x-www-form-urlencoded: schema: type: object additionalProperties: false "203": description: "203" content: - application/json: + application/*: schema: type: object additionalProperties: diff --git a/modules/openapi-json-schema-generator/src/test/resources/3_0/issue_8906.yaml b/modules/openapi-json-schema-generator/src/test/resources/3_0/issue_8906.yaml index 10056087574..365cf7745e9 100644 --- a/modules/openapi-json-schema-generator/src/test/resources/3_0/issue_8906.yaml +++ b/modules/openapi-json-schema-generator/src/test/resources/3_0/issue_8906.yaml @@ -478,7 +478,7 @@ components: a: type: string CodegenPropertiesModel: - description: "this model lets us check CodegenProperty.vars/requiredVars/hasVars/hasRequired" + description: "this model lets us check CodegenSchema.vars/requiredVars/hasVars/hasRequired" type: object properties: AnyTypeNoPropertiesNoRequired: diff --git a/modules/openapi-json-schema-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature-okhttp-gson.yaml b/modules/openapi-json-schema-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature-okhttp-gson.yaml index e156e0fb56d..d82f9ef776c 100644 --- a/modules/openapi-json-schema-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature-okhttp-gson.yaml +++ b/modules/openapi-json-schema-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature-okhttp-gson.yaml @@ -1980,7 +1980,7 @@ components: - lengthCm additionalProperties: false # go-experimental is unable to make Triangle and Quadrilateral models - # correctly https://github.com/OpenAPITools/openapi-generator/issues/6149 + # correctly https://github.com/OpenAPITools/openapi-json-schema-generator/issues/6149 Drawing: type: object properties: diff --git a/modules/openapi-json-schema-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml b/modules/openapi-json-schema-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml index 455a11dbe59..260591e940f 100644 --- a/modules/openapi-json-schema-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +++ b/modules/openapi-json-schema-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml @@ -1980,7 +1980,7 @@ components: - lengthCm additionalProperties: false # go-experimental is unable to make Triangle and Quadrilateral models - # correctly https://github.com/OpenAPITools/openapi-generator/issues/6149 + # correctly https://github.com/OpenAPITools/openapi-json-schema-generator/issues/6149 Drawing: type: object properties: diff --git a/modules/openapi-json-schema-generator/src/test/resources/3_0/powershell/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml b/modules/openapi-json-schema-generator/src/test/resources/3_0/powershell/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml index a2e2981e696..51202cc86b3 100644 --- a/modules/openapi-json-schema-generator/src/test/resources/3_0/powershell/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +++ b/modules/openapi-json-schema-generator/src/test/resources/3_0/powershell/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml @@ -1981,7 +1981,7 @@ components: - lengthCm additionalProperties: false # go-experimental is unable to make Triangle and Quadrilateral models - # correctly https://github.com/OpenAPITools/openapi-generator/issues/6149 + # correctly https://github.com/OpenAPITools/openapi-json-schema-generator/issues/6149 Drawing: type: object properties: diff --git a/modules/openapi-json-schema-generator/src/test/resources/3_0/protobuf-schema/pet.proto b/modules/openapi-json-schema-generator/src/test/resources/3_0/protobuf-schema/pet.proto index 6b33968ee19..33ec09270a6 100644 --- a/modules/openapi-json-schema-generator/src/test/resources/3_0/protobuf-schema/pet.proto +++ b/modules/openapi-json-schema-generator/src/test/resources/3_0/protobuf-schema/pet.proto @@ -1,7 +1,7 @@ /* OAI Specification example for Polymorphism - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + No description provided (generated by Openapi Generator https://github.com/openapi-json-schema-tools/openapi-json-schema-generator) The version of the OpenAPI document: 1.0.0 @@ -10,7 +10,7 @@ syntax = "proto3"; -package openapitools; +package openapijsonschematools; message Pet { diff --git a/modules/openapi-json-schema-generator/src/test/resources/3_0/python-prior/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml b/modules/openapi-json-schema-generator/src/test/resources/3_0/python-prior/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml index 8d040105b98..869e91e6a69 100644 --- a/modules/openapi-json-schema-generator/src/test/resources/3_0/python-prior/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +++ b/modules/openapi-json-schema-generator/src/test/resources/3_0/python-prior/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml @@ -2316,7 +2316,7 @@ components: - lengthCm additionalProperties: false # go-experimental is unable to make Triangle and Quadrilateral models - # correctly https://github.com/OpenAPITools/openapi-generator/issues/6149 + # correctly https://github.com/OpenAPITools/openapi-json-schema-generator/issues/6149 Drawing: type: object properties: diff --git a/modules/openapi-json-schema-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml b/modules/openapi-json-schema-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml deleted file mode 100644 index b3b66c84bba..00000000000 --- a/modules/openapi-json-schema-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +++ /dev/null @@ -1,3028 +0,0 @@ -openapi: 3.0.0 -info: - description: >- - This spec is mainly for testing Petstore server and contains fake endpoints, - models. Please do not use this for any other purpose. Special characters: " - \ - version: 1.0.0 - title: OpenAPI Petstore - license: - name: Apache-2.0 - url: 'https://www.apache.org/licenses/LICENSE-2.0.html' -tags: - - name: pet - description: Everything about your Pets - - name: store - description: Access to Petstore orders - - name: user - description: Operations about user -paths: - /foo: - get: - responses: - default: - description: response - content: - application/json: - schema: - type: object - properties: - string: - $ref: '#/components/schemas/Foo' - /pet: - servers: - - url: 'https://petstore.swagger.io/v2' - - url: 'https://path-server-test.petstore.local/v2' - post: - tags: - - pet - summary: Add a new pet to the store - description: Add a new pet to the store - operationId: addPet - responses: - '200': - description: Ok - '405': - description: Invalid input - security: - - http_signature_test: [] - - petstore_auth: - - 'write:pets' - - 'read:pets' - requestBody: - $ref: '#/components/requestBodies/Pet' - put: - tags: - - pet - summary: Update an existing pet - description: '' - operationId: updatePet - responses: - '400': - description: Invalid ID supplied - '404': - description: Pet not found - '405': - description: Validation exception - security: - - http_signature_test: [] - - petstore_auth: - - 'write:pets' - - 'read:pets' - requestBody: - $ref: '#/components/requestBodies/Pet' - /pet/findByStatus: - get: - tags: - - pet - summary: Finds Pets by status - description: Multiple status values can be provided with comma separated strings - operationId: findPetsByStatus - parameters: - - name: status - in: query - description: Status values that need to be considered for filter - required: true - style: form - explode: false - schema: - type: array - items: - type: string - enum: - - available - - pending - - sold - default: available - responses: - '200': - description: successful operation - content: - application/xml: - schema: - type: array - items: - $ref: '#/components/schemas/Pet' - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Pet' - '400': - description: Invalid status value - security: - - http_signature_test: [] - - petstore_auth: - - 'write:pets' - - 'read:pets' - /pet/findByTags: - get: - tags: - - pet - summary: Finds Pets by tags - description: >- - Multiple tags can be provided with comma separated strings. Use tag1, - tag2, tag3 for testing. - operationId: findPetsByTags - parameters: - - name: tags - in: query - description: Tags to filter by - required: true - style: form - explode: false - schema: - type: array - items: - type: string - responses: - '200': - description: successful operation - content: - application/xml: - schema: - type: array - items: - $ref: '#/components/schemas/Pet' - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Pet' - '400': - description: Invalid tag value - security: - - http_signature_test: [] - - petstore_auth: - - 'write:pets' - - 'read:pets' - deprecated: true - '/pet/{petId}': - get: - tags: - - pet - summary: Find pet by ID - description: Returns a single pet - operationId: getPetById - parameters: - - name: petId - in: path - description: ID of pet to return - required: true - schema: - type: integer - format: int64 - responses: - '200': - description: successful operation - content: - application/xml: - schema: - $ref: '#/components/schemas/Pet' - application/json: - schema: - $ref: '#/components/schemas/Pet' - '400': - description: Invalid ID supplied - '404': - description: Pet not found - security: - - api_key: [] - post: - tags: - - pet - summary: Updates a pet in the store with form data - description: '' - operationId: updatePetWithForm - parameters: - - name: petId - in: path - description: ID of pet that needs to be updated - required: true - schema: - type: integer - format: int64 - responses: - '405': - description: Invalid input - security: - - petstore_auth: - - 'write:pets' - - 'read:pets' - requestBody: - content: - application/x-www-form-urlencoded: - schema: - type: object - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string - delete: - tags: - - pet - summary: Deletes a pet - description: '' - operationId: deletePet - parameters: - - name: api_key - in: header - required: false - schema: - type: string - - name: petId - in: path - description: Pet id to delete - required: true - schema: - type: integer - format: int64 - responses: - '400': - description: Invalid pet value - security: - - petstore_auth: - - 'write:pets' - - 'read:pets' - '/pet/{petId}/uploadImage': - post: - tags: - - pet - summary: uploads an image - description: '' - operationId: uploadImage - parameters: - - name: petId - in: path - description: ID of pet to update - required: true - schema: - type: integer - format: int64 - responses: - '200': - description: successful operation - content: - application/json: - schema: - $ref: '#/components/schemas/ApiResponse' - security: - - petstore_auth: - - 'write:pets' - - 'read:pets' - requestBody: - content: - multipart/form-data: - schema: - type: object - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - type: string - format: binary - /store/inventory: - get: - tags: - - store - summary: Returns pet inventories by status - description: Returns a map of status codes to quantities - operationId: getInventory - responses: - '200': - description: successful operation - content: - application/json: - schema: - type: object - additionalProperties: - type: integer - format: int32 - security: - - api_key: [] - /store/order: - post: - tags: - - store - summary: Place an order for a pet - description: '' - operationId: placeOrder - responses: - '200': - description: successful operation - content: - application/xml: - schema: - $ref: '#/components/schemas/Order' - application/json: - schema: - $ref: '#/components/schemas/Order' - '400': - description: Invalid Order - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Order' - description: order placed for purchasing the pet - required: true - '/store/order/{order_id}': - get: - tags: - - store - summary: Find purchase order by ID - description: >- - For valid response try integer IDs with value <= 5 or > 10. Other values - will generated exceptions - operationId: getOrderById - parameters: - - name: order_id - in: path - description: ID of pet that needs to be fetched - required: true - schema: - type: integer - format: int64 - minimum: 1 - maximum: 5 - responses: - '200': - description: successful operation - content: - application/xml: - schema: - $ref: '#/components/schemas/Order' - application/json: - schema: - $ref: '#/components/schemas/Order' - '400': - description: Invalid ID supplied - '404': - description: Order not found - delete: - tags: - - store - summary: Delete purchase order by ID - description: >- - For valid response try integer IDs with value < 1000. Anything above - 1000 or nonintegers will generate API errors - operationId: deleteOrder - parameters: - - name: order_id - in: path - description: ID of the order that needs to be deleted - required: true - schema: - type: string - responses: - '400': - description: Invalid ID supplied - '404': - description: Order not found - /user: - post: - tags: - - user - summary: Create user - description: This can only be done by the logged in user. - operationId: createUser - responses: - default: - description: successful operation - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/User' - description: Created user object - required: true - /user/createWithArray: - post: - tags: - - user - summary: Creates list of users with given input array - description: '' - operationId: createUsersWithArrayInput - responses: - default: - description: successful operation - requestBody: - $ref: '#/components/requestBodies/UserArray' - /user/createWithList: - post: - tags: - - user - summary: Creates list of users with given input array - description: '' - operationId: createUsersWithListInput - responses: - default: - description: successful operation - requestBody: - $ref: '#/components/requestBodies/UserArray' - /user/login: - get: - tags: - - user - summary: Logs user into the system - description: '' - operationId: loginUser - parameters: - - name: username - in: query - description: The user name for login - required: true - schema: - type: string - - name: password - in: query - description: The password for login in clear text - required: true - schema: - type: string - responses: - '200': - description: successful operation - headers: - X-Rate-Limit: - description: calls per hour allowed by the user - schema: - type: integer - format: int32 - X-Expires-After: - description: date in UTC when token expires - schema: - type: string - format: date-time - content: - application/xml: - schema: - type: string - application/json: - schema: - type: string - '400': - description: Invalid username/password supplied - /user/logout: - get: - tags: - - user - summary: Logs out current logged in user session - description: '' - operationId: logoutUser - responses: - default: - description: successful operation - '/user/{username}': - get: - tags: - - user - summary: Get user by user name - description: '' - operationId: getUserByName - parameters: - - name: username - in: path - description: The name that needs to be fetched. Use user1 for testing. - required: true - schema: - type: string - responses: - '200': - description: successful operation - content: - application/xml: - schema: - $ref: '#/components/schemas/User' - application/json: - schema: - $ref: '#/components/schemas/User' - '400': - description: Invalid username supplied - '404': - description: User not found - put: - tags: - - user - summary: Updated user - description: This can only be done by the logged in user. - operationId: updateUser - parameters: - - name: username - in: path - description: name that need to be deleted - required: true - schema: - type: string - responses: - '400': - description: Invalid user supplied - '404': - description: User not found - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/User' - description: Updated user object - required: true - delete: - tags: - - user - summary: Delete user - description: This can only be done by the logged in user. - operationId: deleteUser - parameters: - - name: username - in: path - description: The name that needs to be deleted - required: true - schema: - type: string - responses: - '200': - description: Success - '404': - description: User not found - /fake_classname_test: - patch: - tags: - - 'fake_classname_tags 123#$%^' - summary: To test class name in snake case - description: To test class name in snake case - operationId: Classname - responses: - '200': - description: successful operation - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - security: - - api_key_query: [] - requestBody: - $ref: '#/components/requestBodies/Client' - /fake: - patch: - tags: - - fake - summary: To test "client" model - description: To test "client" model - operationId: ClientModel - responses: - '200': - description: successful operation - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - requestBody: - $ref: '#/components/requestBodies/Client' - get: - tags: - - fake - summary: To test enum parameters - description: To test enum parameters - operationId: EnumParameters - parameters: - - name: enum_header_string_array - in: header - description: Header parameter enum test (string array) - schema: - type: array - items: - type: string - default: $ - enum: - - '>' - - $ - - name: enum_header_string - in: header - description: Header parameter enum test (string) - schema: - type: string - enum: - - _abc - - '-efg' - - (xyz) - default: '-efg' - - name: enum_query_string_array - in: query - description: Query parameter enum test (string array) - schema: - type: array - items: - type: string - default: $ - enum: - - '>' - - $ - - name: enum_query_string - in: query - description: Query parameter enum test (string) - schema: - type: string - enum: - - _abc - - '-efg' - - (xyz) - default: '-efg' - - name: enum_query_integer - in: query - description: Query parameter enum test (double) - schema: - type: integer - format: int32 - enum: - - 1 - - -2 - - name: enum_query_double - in: query - description: Query parameter enum test (double) - schema: - type: number - format: double - enum: - - 1.1 - - -1.2 - responses: - '200': - description: Success - '404': - description: Not found - content: - application/json: - schema: - type: object - requestBody: - content: - application/x-www-form-urlencoded: - schema: - type: object - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - type: array - items: - type: string - default: $ - enum: - - '>' - - $ - enum_form_string: - description: Form parameter enum test (string) - type: string - enum: - - _abc - - '-efg' - - (xyz) - default: '-efg' - post: - tags: - - fake - summary: | - Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 - description: | - Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 - operationId: EndpointParameters - responses: - '200': - description: Success - '404': - description: User not found - security: - - http_basic_test: [] - requestBody: - content: - application/x-www-form-urlencoded: - schema: - type: object - properties: - integer: - description: None - type: integer - minimum: 10 - maximum: 100 - int32: - description: None - type: integer - format: int32 - minimum: 20 - maximum: 200 - int64: - description: None - type: integer - format: int64 - number: - description: None - type: number - minimum: 32.1 - maximum: 543.2 - float: - description: None - type: number - format: float - maximum: 987.6 - double: - description: None - type: number - format: double - minimum: 67.8 - maximum: 123.4 - string: - description: None - type: string - pattern: '/[a-z]/i' - pattern_without_delimiter: - description: None - type: string - pattern: '^[A-Z].*' - byte: - description: None - type: string - format: byte - binary: - description: None - type: string - format: binary - date: - description: None - type: string - format: date - dateTime: - description: None - type: string - format: date-time - default: '2010-02-01T10:20:10.11111+01:00' - example: '2020-02-02T20:20:20.22222Z' - password: - description: None - type: string - format: password - minLength: 10 - maxLength: 64 - callback: - description: None - type: string - required: - - number - - double - - pattern_without_delimiter - - byte - delete: - tags: - - fake - security: - - bearer_test: [] - summary: Fake endpoint to test group parameters (optional) - description: Fake endpoint to test group parameters (optional) - operationId: GroupParameters - x-group-parameters: true - parameters: - - name: required_string_group - in: query - description: Required String in group parameters - required: true - schema: - type: string - - name: required_boolean_group - in: header - description: Required Boolean in group parameters - required: true - schema: - type: string - enum: - - true - - false - - name: required_int64_group - in: query - description: Required Integer in group parameters - required: true - schema: - type: integer - format: int64 - - name: string_group - in: query - description: String in group parameters - schema: - type: string - - name: boolean_group - in: header - description: Boolean in group parameters - schema: - type: string - enum: - - true - - false - - name: int64_group - in: query - description: Integer in group parameters - schema: - type: integer - format: int64 - responses: - '200': - description: succeeded - /fake/refs/number: - post: - tags: - - fake - description: Test serialization of outer number types - operationId: NumberWithValidations - requestBody: - description: Input number as post body - content: - application/json: - schema: - $ref: '#/components/schemas/NumberWithValidations' - required: false - responses: - '200': - description: Output number - content: - application/json: - schema: - $ref: '#/components/schemas/NumberWithValidations' - /fake/refs/mammal: - post: - tags: - - fake - description: Test serialization of mammals - operationId: Mammal - requestBody: - description: Input mammal - content: - application/json: - schema: - $ref: '#/components/schemas/mammal' - required: true - responses: - '200': - description: Output mammal - content: - application/json: - schema: - $ref: '#/components/schemas/mammal' - /fake/refs/string: - post: - tags: - - fake - description: Test serialization of outer string types - operationId: String - requestBody: - description: Input string as post body - content: - application/json: - schema: - $ref: '#/components/schemas/String' - required: false - responses: - '200': - description: Output string - content: - application/json: - schema: - $ref: '#/components/schemas/String' - x-codegen-request-body-name: body - /fake/refs/boolean: - post: - tags: - - fake - description: Test serialization of outer boolean types - operationId: Boolean - requestBody: - description: Input boolean as post body - content: - application/json: - schema: - $ref: '#/components/schemas/Boolean' - required: false - responses: - '200': - description: Output boolean - content: - application/json: - schema: - $ref: '#/components/schemas/Boolean' - x-codegen-request-body-name: body - /fake/refs/arraymodel: - post: - tags: - - fake - description: Test serialization of ArrayModel - operationId: ArrayModel - requestBody: - description: Input model - content: - application/json: - schema: - $ref: '#/components/schemas/AnimalFarm' - required: false - responses: - '200': - description: Output model - content: - application/json: - schema: - $ref: '#/components/schemas/AnimalFarm' - x-codegen-request-body-name: body - /fake/refs/composed_one_of_number_with_validations: - post: - tags: - - fake - description: Test serialization of object with $refed properties - operationId: ComposedOneOfDifferentTypes - requestBody: - description: Input model - content: - application/json: - schema: - $ref: '#/components/schemas/ComposedOneOfDifferentTypes' - required: false - responses: - '200': - description: Output model - content: - application/json: - schema: - $ref: '#/components/schemas/ComposedOneOfDifferentTypes' - /fake/refs/object_model_with_ref_props: - post: - tags: - - fake - description: Test serialization of object with $refed properties - operationId: ObjectModelWithRefProps - requestBody: - description: Input model - content: - application/json: - schema: - $ref: '#/components/schemas/ObjectModelWithRefProps' - required: false - responses: - '200': - description: Output model - content: - application/json: - schema: - $ref: '#/components/schemas/ObjectModelWithRefProps' - x-codegen-request-body-name: body - /fake/refs/enum: - post: - tags: - - fake - description: Test serialization of outer enum - operationId: StringEnum - requestBody: - description: Input enum - content: - application/json: - schema: - $ref: '#/components/schemas/StringEnum' - required: false - responses: - '200': - description: Output enum - content: - application/json: - schema: - $ref: '#/components/schemas/StringEnum' - x-codegen-request-body-name: body - /fake/refs/array-of-enums: - post: - tags: - - fake - summary: Array of Enums - operationId: ArrayOfEnums - requestBody: - description: Input enum - content: - application/json: - schema: - $ref: '#/components/schemas/ArrayOfEnums' - required: false - responses: - 200: - description: Got named array of enums - content: - application/json: - schema: - $ref: '#/components/schemas/ArrayOfEnums' - /fake/additional-properties-with-array-of-enums: - get: - tags: - - fake - summary: Additional Properties with Array of Enums - operationId: AdditionalPropertiesWithArrayOfEnums - requestBody: - description: Input enum - content: - application/json: - schema: - $ref: '#/components/schemas/AdditionalPropertiesWithArrayOfEnums' - required: false - responses: - 200: - description: Got object with additional properties with array of enums - content: - application/json: - schema: - $ref: '#/components/schemas/AdditionalPropertiesWithArrayOfEnums' - /fake/jsonFormData: - get: - tags: - - fake - summary: test json serialization of form data - description: '' - operationId: JsonFormData - responses: - '200': - description: successful operation - requestBody: - content: - application/x-www-form-urlencoded: - schema: - type: object - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 - /fake/inline-additionalProperties: - post: - tags: - - fake - summary: test inline additionalProperties - description: '' - operationId: InlineAdditionalProperties - responses: - '200': - description: successful operation - requestBody: - content: - application/json: - schema: - type: object - additionalProperties: - type: string - description: request body - required: true - /fake/body-with-query-params: - put: - tags: - - fake - operationId: BodyWithQueryParams - parameters: - - name: query - in: query - required: true - schema: - type: string - responses: - '200': - description: Success - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/User' - required: true - /another-fake/dummy: - patch: - tags: - - $another-fake? - summary: To test special tags - description: To test special tags and operation ID starting with number - operationId: '123_test_@#$%_special_tags' - responses: - '200': - description: successful operation - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - requestBody: - $ref: '#/components/requestBodies/Client' - /fake/body-with-file-schema: - put: - tags: - - fake - description: >- - For this test, the body for this request much reference a schema named - `File`. - operationId: BodyWithFileSchema - responses: - '200': - description: Success - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/FileSchemaTestClass' - required: true - /fake/case-sensitive-params: - put: - tags: - - fake - description: Ensures that original naming is used in endpoint params, that way we on't have collisions - operationId: CaseSensitiveParams - parameters: - - name: someVar - in: query - required: true - schema: - type: string - - name: SomeVar - in: query - required: true - schema: - type: string - - name: some_var - in: query - required: true - schema: - type: string - responses: - "200": - description: Success - /fake/test-query-paramters: - put: - tags: - - fake - description: To test the collection format in query parameters - operationId: QueryParameterCollectionFormat - parameters: - - name: pipe - in: query - required: true - schema: - type: array - items: - type: string - - name: ioutil - in: query - required: true - style: form - explode: false - schema: - type: array - items: - type: string - - name: http - in: query - required: true - style: spaceDelimited - schema: - type: array - items: - type: string - - name: url - in: query - required: true - style: form - explode: false - schema: - type: array - items: - type: string - - name: context - in: query - required: true - explode: true - schema: - type: array - items: - type: string - - name: refParam - in: query - required: true - schema: - $ref: '#/components/schemas/StringWithValidation' - responses: - "200": - description: Success - '/fake/{petId}/uploadImageWithRequiredFile': - post: - tags: - - pet - summary: uploads an image (required) - description: '' - operationId: uploadFileWithRequiredFile - parameters: - - name: petId - in: path - description: ID of pet to update - required: true - schema: - type: integer - format: int64 - responses: - '200': - description: successful operation - content: - application/json: - schema: - $ref: '#/components/schemas/ApiResponse' - security: - - petstore_auth: - - 'write:pets' - - 'read:pets' - requestBody: - content: - multipart/form-data: - schema: - type: object - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - type: string - format: binary - required: - - requiredFile - /fake/parameterCollisions/{1}/{aB}/{Ab}/{self}/{A-B}/: - post: - tags: - - fake - summary: parameter collision case - operationId: parameterCollisions - parameters: - - name: 1 - in: query - schema: - type: string - - name: aB - in: query - schema: - type: string - - name: Ab - in: query - schema: - type: string - - name: self - in: query - schema: - type: string - - name: A-B - in: query - schema: - type: string - - name: 1 - in: header - schema: - type: string - - name: aB - in: header - schema: - type: string - - name: self - in: header - schema: - type: string - - name: A-B - in: header - schema: - type: string - - name: 1 - in: path - required: true - schema: - type: string - - name: aB - in: path - required: true - schema: - type: string - - name: Ab - in: path - required: true - schema: - type: string - - name: self - in: path - required: true - schema: - type: string - - name: A-B - in: path - required: true - schema: - type: string - - name: 1 - in: cookie - schema: - type: string - - name: aB - in: cookie - schema: - type: string - - name: Ab - in: cookie - schema: - type: string - - name: self - in: cookie - schema: - type: string - - name: A-B - in: cookie - schema: - type: string - requestBody: - content: - application/json: - schema: {} - responses: - 200: - description: success - content: - application/json: - schema: {} - /fake/uploadFile: - post: - tags: - - fake - summary: uploads a file using multipart/form-data - description: '' - operationId: uploadFile - responses: - '200': - description: successful operation - content: - application/json: - schema: - $ref: '#/components/schemas/ApiResponse' - requestBody: - content: - multipart/form-data: - schema: - type: object - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - type: string - format: binary - required: - - file - /fake/uploadFiles: - post: - tags: - - fake - summary: uploads files using multipart/form-data - description: '' - operationId: uploadFiles - responses: - '200': - description: successful operation - content: - application/json: - schema: - $ref: '#/components/schemas/ApiResponse' - requestBody: - content: - multipart/form-data: - schema: - type: object - properties: - files: - type: array - items: - type: string - format: binary - /fake/uploadDownloadFile: - post: - tags: - - fake - summary: uploads a file and downloads a file using application/octet-stream - description: '' - operationId: uploadDownloadFile - responses: - '200': - description: successful operation - content: - application/octet-stream: - schema: - type: string - format: binary - description: file to download - requestBody: - required: true - content: - application/octet-stream: - schema: - type: string - format: binary - description: file to upload - /fake/health: - get: - tags: - - fake - summary: Health check endpoint - responses: - 200: - description: The instance started successfully - content: - application/json: - schema: - $ref: '#/components/schemas/HealthCheckResult' - /fake/inlineComposition/: - post: - tags: - - fake - summary: testing composed schemas at inline locations - operationId: inlineComposition - parameters: - - name: compositionAtRoot - in: query - schema: - allOf: - - type: string - minLength: 1 - - name: compositionInProperty - in: query - schema: - type: object - properties: - someProp: - allOf: - - type: string - minLength: 1 - requestBody: - content: - application/json: - schema: - allOf: - - type: string - minLength: 1 - multipart/form-data: - schema: - type: object - properties: - someProp: - allOf: - - type: string - minLength: 1 - responses: - 200: - description: success - content: - application/json: - schema: - allOf: - - type: string - minLength: 1 - multipart/form-data: - schema: - type: object - properties: - someProp: - allOf: - - type: string - minLength: 1 - '/fake/objInQuery': - get: - tags: - - fake - summary: user list - operationId: objectInQuery - parameters: - - name: mapBean - in: query - required: false - description: mapBean - style: deepObject - explode: true - schema: - type: object - properties: - keyword: - title: keyword - type: string - responses: - '200': - description: ok - '/fake/refObjInQuery': - get: - tags: - - fake - summary: user list - operationId: refObjectInQuery - parameters: - - name: mapBean - in: query - required: false - description: mapBean - style: deepObject - explode: true - schema: - $ref: '#/components/schemas/Foo' - responses: - '200': - description: ok - '/fake/jsonWithCharset': - post: - tags: - - fake - summary: json with charset tx and rx - operationId: jsonWithCharset - requestBody: - content: - application/json; charset=utf-8: - schema: {} - responses: - 200: - description: success - content: - application/json; charset=utf-8: - schema: {} - "/fake/responseWithoutSchema": - get: - tags: - - fake - summary: receives a response without schema - operationId: responseWithoutSchema - responses: - '200': - description: contents without schema definition - content: - application/json: {} - application/xml: {} - /fake/jsonPatch: - patch: - summary: json patch - description: json patch route with a requestBody - operationId: jsonPatch - tags: - - fake - requestBody: - content: - application/json-patch+json: - schema: - $ref: '#/components/schemas/JSONPatchRequest' - responses: - '200': - description: OK - /fake/deleteCoffee/{id}: - delete: - operationId: deleteCoffee - summary: Delete coffee - description: Delete the coffee identified by the given id, (delete without request body) - tags: - - fake - parameters: - - name: id - in: path - description: The internal object id - required: true - schema: - type: string - responses: - '200': - description: OK - default: - description: Unexpected error - /fake/queryParamWithJsonContentType: - get: - operationId: queryParamWithJsonContentType - summary: query param with json content-type - tags: - - fake - parameters: - - name: someParam - in: query - description: The internal object id - required: true - content: - application/json: - schema: {} - responses: - 200: - description: success - content: - application/json: - schema: {} -servers: - - url: 'http://{server}.swagger.io:{port}/v2' - description: petstore server - variables: - server: - enum: - - 'petstore' - - 'qa-petstore' - - 'dev-petstore' - default: 'petstore' - port: - enum: - - 80 - - 8080 - default: 80 - - url: https://localhost:8080/{version} - description: The local server - variables: - version: - enum: - - 'v1' - - 'v2' - default: 'v2' -components: - requestBodies: - UserArray: - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/User' - description: List of user object - required: true - Client: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true - Pet: - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - description: Pet object that needs to be added to the store - required: true - securitySchemes: - petstore_auth: - type: oauth2 - flows: - implicit: - authorizationUrl: 'http://petstore.swagger.io/api/oauth/dialog' - scopes: - 'write:pets': modify pets in your account - 'read:pets': read your pets - api_key: - type: apiKey - name: api_key - in: header - api_key_query: - type: apiKey - name: api_key_query - in: query - http_basic_test: - type: http - scheme: basic - bearer_test: - type: http - scheme: bearer - bearerFormat: JWT - http_signature_test: - # Test the 'HTTP signature' security scheme. - # Each HTTP request is cryptographically signed as specified - # in https://datatracker.ietf.org/doc/draft-cavage-http-signatures/ - type: http - scheme: signature - schemas: - Foo: - type: object - properties: - bar: - $ref: '#/components/schemas/Bar' - Bar: - type: string - default: bar - Order: - type: object - properties: - id: - type: integer - format: int64 - petId: - type: integer - format: int64 - quantity: - type: integer - format: int32 - shipDate: - type: string - format: date-time - example: '2020-02-02T20:20:20.000222Z' - status: - type: string - description: Order Status - enum: - - placed - - approved - - delivered - complete: - type: boolean - default: false - xml: - name: Order - Category: - type: object - required: - - name - properties: - id: - type: integer - format: int64 - name: - type: string - default: default-name - xml: - name: Category - User: - type: object - properties: - id: - type: integer - format: int64 - x-is-unique: true - username: - type: string - firstName: - type: string - lastName: - type: string - email: - type: string - password: - type: string - phone: - type: string - userStatus: - type: integer - format: int32 - description: User Status - objectWithNoDeclaredProps: - type: object - # Note: the 'additionalProperties' keyword is not specified, which is - # equivalent to allowing undeclared properties of any type. - description: test code generation for objects - Value must be a map of strings to values. It cannot be the 'null' value. - objectWithNoDeclaredPropsNullable: - type: object - # Note: the 'additionalProperties' keyword is not specified, which is - # equivalent to allowing undeclared properties of any type. - description: test code generation for nullable objects. - Value must be a map of strings to values or the 'null' value. - nullable: true - anyTypeProp: - description: test code generation for any type - Here the 'type' attribute is not specified, which means the value can be anything, - including the null value, string, number, boolean, array or object. - See https://github.com/OAI/OpenAPI-Specification/issues/1389 - anyTypeExceptNullProp: - description: any type except 'null' - Here the 'type' attribute is not specified, which means the value can be anything, - including the null value, string, number, boolean, array or object. - not: - type: 'null' - anyTypePropNullable: - description: test code generation for any type - Here the 'type' attribute is not specified, which means the value can be anything, - including the null value, string, number, boolean, array or object. - The 'nullable' attribute does not change the allowed values. - nullable: true - xml: - name: User - Tag: - type: object - properties: - id: - type: integer - format: int64 - name: - type: string - xml: - name: Tag - Pet: - type: object - description: Pet object that needs to be added to the store - required: - - name - - photoUrls - properties: - id: - type: integer - format: int64 - x-is-unique: true - category: - $ref: '#/components/schemas/Category' - name: - type: string - example: doggie - photoUrls: - type: array - xml: - name: photoUrl - wrapped: true - items: - type: string - tags: - type: array - xml: - name: tag - wrapped: true - items: - $ref: '#/components/schemas/Tag' - status: - type: string - description: pet status in the store - enum: - - available - - pending - - sold - xml: - name: Pet - ApiResponse: - type: object - properties: - code: - type: integer - format: int32 - type: - type: string - message: - type: string - Return: - description: Model for testing reserved words - properties: - return: - description: this is a reserved python keyword - type: integer - format: int32 - xml: - name: Return - Name: - description: Model for testing model name same as property name - required: - - name - properties: - name: - type: integer - format: int32 - snake_case: - readOnly: true - type: integer - format: int32 - property: - description: this is a reserved python keyword - type: string - xml: - name: Name - 200_response: - description: model with an invalid class name for python, starts with a number - properties: - name: - type: integer - format: int32 - class: - description: this is a reserved python keyword - type: string - xml: - name: Name - ClassModel: - description: Model for testing model with "_class" property - properties: - _class: - type: string - Dog: - allOf: - - $ref: '#/components/schemas/Animal' - - type: object - properties: - breed: - type: string - Cat: - allOf: - - $ref: '#/components/schemas/Animal' - - type: object - properties: - declawed: - type: boolean - Address: - type: object - additionalProperties: - type: integer - Animal: - type: object - discriminator: - propertyName: className - required: - - className - properties: - className: - type: string - color: - type: string - default: red - AnimalFarm: - type: array - items: - $ref: '#/components/schemas/Animal' - FormatTest: - type: object - required: - - number - - byte - - date - - password - properties: - integer: - type: integer - maximum: 100 - minimum: 10 - multipleOf: 2 - int32: - type: integer - format: int32 - int32withValidations: - type: integer - format: int32 - maximum: 200 - minimum: 20 - int64: - type: integer - format: int64 - number: - maximum: 543.2 - minimum: 32.1 - type: number - multipleOf: 32.5 - float: - description: this is a reserved python keyword - type: number - format: float - maximum: 987.6 - minimum: 54.3 - float32: - type: number - format: float - double: - type: number - format: double - maximum: 123.4 - minimum: 67.8 - float64: - type: number - format: double - arrayWithUniqueItems: - type: array - items: - type: number - uniqueItems: true - string: - type: string - pattern: '/[a-z]/i' - byte: - type: string - format: byte - binary: - type: string - format: binary - date: - type: string - format: date - example: '2020-02-02' - dateTime: - type: string - format: date-time - example: '2007-12-03T10:15:30+01:00' - uuid: - type: string - format: uuid - example: 72f98069-206d-4f12-9f12-3d1e525a8e84 - uuidNoExample: - type: string - format: uuid - password: - type: string - format: password - maxLength: 64 - minLength: 10 - pattern_with_digits: - description: A string that is a 10 digit number. Can have leading zeros. - type: string - pattern: '^\d{10}$' - pattern_with_digits_and_delimiter: - description: A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. - type: string - pattern: '/^image_\d{1,3}$/i' - noneProp: - type: 'null' - EnumClass: - type: string - default: '-efg' - enum: - - _abc - - '-efg' - - (xyz) - - COUNT_1M - - COUNT_50M - ObjectModelWithArgAndArgsProperties: - type: object - properties: - arg: - type: string - args: - type: string - required: - - arg - - args - Enum_Test: - type: object - required: - - enum_string_required - properties: - enum_string: - type: string - enum: - - UPPER - - lower - - '' - enum_string_required: - type: string - enum: - - UPPER - - lower - - '' - enum_integer: - type: integer - format: int32 - enum: - - 1 - - -1 - enum_number: - type: number - format: double - enum: - - 1.1 - - -1.2 - stringEnum: - $ref: '#/components/schemas/StringEnum' - IntegerEnum: - $ref: '#/components/schemas/IntegerEnum' - StringEnumWithDefaultValue: - $ref: '#/components/schemas/StringEnumWithDefaultValue' - IntegerEnumWithDefaultValue: - $ref: '#/components/schemas/IntegerEnumWithDefaultValue' - IntegerEnumOneValue: - $ref: '#/components/schemas/IntegerEnumOneValue' - AdditionalPropertiesClass: - type: object - properties: - map_property: - type: object - additionalProperties: - type: string - map_of_map_property: - type: object - additionalProperties: - type: object - additionalProperties: - type: string - anytype_1: {} - map_with_undeclared_properties_anytype_1: - type: object - map_with_undeclared_properties_anytype_2: - type: object - properties: {} - map_with_undeclared_properties_anytype_3: - type: object - additionalProperties: true - empty_map: - type: object - description: an object with no declared properties and no undeclared - properties, hence it's an empty map. - additionalProperties: false - map_with_undeclared_properties_string: - type: object - additionalProperties: - type: string - MixedPropertiesAndAdditionalPropertiesClass: - type: object - properties: - uuid: - type: string - format: uuid - dateTime: - type: string - format: date-time - map: - type: object - additionalProperties: - $ref: '#/components/schemas/Animal' - Client: - type: object - properties: - client: - type: string - ReadOnlyFirst: - type: object - properties: - bar: - type: string - readOnly: true - baz: - type: string - hasOnlyReadOnly: - type: object - properties: - bar: - type: string - readOnly: true - foo: - type: string - readOnly: true - Capitalization: - type: object - properties: - smallCamel: - type: string - CapitalCamel: - type: string - small_Snake: - type: string - Capital_Snake: - type: string - SCA_ETH_Flow_Points: - type: string - ATT_NAME: - description: | - Name of the pet - type: string - MapTest: - type: object - properties: - map_map_of_string: - type: object - additionalProperties: - type: object - additionalProperties: - type: string - map_of_enum_string: - type: object - additionalProperties: - type: string - enum: - - UPPER - - lower - direct_map: - type: object - additionalProperties: - type: boolean - indirect_map: - $ref: '#/components/schemas/StringBooleanMap' - ArrayTest: - type: object - properties: - array_of_string: - type: array - items: - type: string - array_array_of_integer: - type: array - items: - type: array - items: - type: integer - format: int64 - array_array_of_model: - type: array - items: - type: array - items: - $ref: '#/components/schemas/ReadOnlyFirst' - NumberOnly: - type: object - properties: - JustNumber: - type: number - ArrayOfNumberOnly: - type: object - properties: - ArrayNumber: - type: array - items: - type: number - ArrayOfArrayOfNumberOnly: - type: object - properties: - ArrayArrayNumber: - type: array - items: - type: array - items: - type: number - EnumArrays: - type: object - properties: - just_symbol: - type: string - enum: - - '>=' - - $ - array_enum: - type: array - items: - type: string - enum: - - fish - - crab - StringEnum: - nullable: true - type: string - enum: - - "placed" - - "approved" - - "delivered" - - 'single quoted' - - |- - multiple - lines - - "double quote \n with newline" - - null - IntegerEnum: - type: integer - enum: - - 0 - - 1 - - 2 - IntegerEnumBig: - type: integer - enum: - - 10 - - 11 - - 12 - StringEnumWithDefaultValue: - type: string - enum: - - placed - - approved - - delivered - default: placed - IntegerEnumWithDefaultValue: - type: integer - enum: - - 0 - - 1 - - 2 - default: 0 - IntegerEnumOneValue: - type: integer - enum: - - 0 - NullableString: - nullable: true - type: string - ObjectModelWithRefProps: - description: a model that includes properties which should stay primitive (String + Boolean) and one which is defined as a class, NumberWithValidations - type: object - properties: - myNumber: - $ref: '#/definitions/NumberWithValidations' - myString: - $ref: '#/definitions/String' - myBoolean: - $ref: '#/definitions/Boolean' - NumberWithValidations: - type: number - minimum: 10 - maximum: 20 - ComposedAnyOfDifferentTypesNoValidations: - anyOf: - - type: object - - type: string - format: date - - type: string - format: date-time - - type: string - format: binary - - type: string - format: byte - - type: string - - type: object - - type: boolean - - type: 'null' - - type: array - items: {} - - type: number - - type: number - format: float - - type: number - format: double - - type: integer - - type: integer - format: int32 - - type: integer - format: int64 - ComposedOneOfDifferentTypes: - description: this is a model that allows payloads of type object or number - oneOf: - - $ref: '#/components/schemas/NumberWithValidations' - - $ref: '#/components/schemas/Animal' - - type: 'null' - - type: string - format: date - - type: object - minProperties: 4 - maxProperties: 4 - - type: array - maxItems: 4 - minItems: 4 - items: {} - - type: string - format: date-time - pattern: '^2020.*' - Number: - type: number - String: - type: string - Boolean: - type: boolean - x-codegen-body-parameter-name: boolean_post_body - StringBooleanMap: - additionalProperties: - type: boolean - FileSchemaTestClass: - type: object - properties: - file: - $ref: '#/components/schemas/File' - files: - type: array - items: - $ref: '#/components/schemas/File' - File: - type: object - description: Must be named `File` for test. - properties: - sourceURI: - description: Test capitalization - type: string - ObjectWithDifficultlyNamedProps: - type: object - description: model with properties that have invalid names for python - properties: - '$special[property.name]': - type: integer - format: int64 - 123-list: - type: string - 123Number: - type: integer - readOnly: true - required: - - 123-list - _special_model.name_: - type: object - description: model with an invalid class name for python - properties: - a: - type: string - HealthCheckResult: - type: object - properties: - NullableMessage: - nullable: true - type: string - description: Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. - NullableClass: - type: object - properties: - integer_prop: - type: integer - nullable: true - number_prop: - type: number - nullable: true - boolean_prop: - type: boolean - nullable: true - string_prop: - type: string - nullable: true - date_prop: - type: string - format: date - nullable: true - datetime_prop: - type: string - format: date-time - nullable: true - array_nullable_prop: - type: array - nullable: true - items: - type: object - array_and_items_nullable_prop: - type: array - nullable: true - items: - type: object - nullable: true - array_items_nullable: - type: array - items: - type: object - nullable: true - object_nullable_prop: - type: object - nullable: true - additionalProperties: - type: object - object_and_items_nullable_prop: - type: object - nullable: true - additionalProperties: - type: object - nullable: true - object_items_nullable: - type: object - additionalProperties: - type: object - nullable: true - additionalProperties: - type: object - nullable: true - fruit: - properties: - color: - type: string - oneOf: - - $ref: '#/components/schemas/apple' - - $ref: '#/components/schemas/banana' - apple: - type: object - properties: - cultivar: - type: string - pattern: ^[a-zA-Z\s]*$ - origin: - type: string - pattern: /^[A-Z\s]*$/i - required: - - cultivar - nullable: true - banana: - type: object - properties: - lengthCm: - type: number - required: - - lengthCm - mammal: - oneOf: - - $ref: '#/components/schemas/whale' - - $ref: '#/components/schemas/zebra' - - $ref: '#/components/schemas/Pig' - discriminator: - propertyName: className - whale: - type: object - properties: - hasBaleen: - type: boolean - hasTeeth: - type: boolean - className: - type: string - enum: - - whale - required: - - className - zebra: - type: object - properties: - type: - type: string - enum: - - plains - - mountain - - grevys - className: - type: string - enum: - - zebra - required: - - className - additionalProperties: true - Pig: - oneOf: - - $ref: '#/components/schemas/BasquePig' - - $ref: '#/components/schemas/DanishPig' - discriminator: - propertyName: className - BasquePig: - type: object - properties: - className: - type: string - enum: - - BasquePig - required: - - className - DanishPig: - type: object - properties: - className: - type: string - enum: - - DanishPig - required: - - className - gmFruit: - properties: - color: - type: string - anyOf: - - $ref: '#/components/schemas/apple' - - $ref: '#/components/schemas/banana' - fruitReq: - oneOf: - - type: 'null' - - $ref: '#/components/schemas/appleReq' - - $ref: '#/components/schemas/bananaReq' - appleReq: - type: object - properties: - cultivar: - type: string - mealy: - type: boolean - required: - - cultivar - additionalProperties: false - bananaReq: - type: object - properties: - lengthCm: - type: number - sweet: - type: boolean - required: - - lengthCm - additionalProperties: false - # go-experimental is unable to make Triangle and Quadrilateral models - # correctly https://github.com/OpenAPITools/openapi-generator/issues/6149 - Drawing: - type: object - properties: - mainShape: - # A property whose value is a 'oneOf' type, and the type is referenced instead - # of being defined inline. The value cannot be null. - $ref: '#/components/schemas/Shape' - shapeOrNull: - # A property whose value is a 'oneOf' type, and the type is referenced instead - # of being defined inline. The value may be null because ShapeOrNull has 'null' - # type as a child schema of 'oneOf'. - $ref: '#/components/schemas/ShapeOrNull' - nullableShape: - # A property whose value is a 'oneOf' type, and the type is referenced instead - # of being defined inline. The value may be null because NullableShape has the - # 'nullable: true' attribute. For this specific scenario this is exactly the - # same thing as 'shapeOrNull'. - $ref: '#/components/schemas/NullableShape' - shapes: - type: array - items: - $ref: '#/components/schemas/Shape' - additionalProperties: - # Here the additional properties are specified using a referenced schema. - # This is just to validate the generated code works when using $ref - # under 'additionalProperties'. - $ref: '#/components/schemas/fruit' - Shape: - oneOf: - - $ref: '#/components/schemas/Triangle' - - $ref: '#/components/schemas/Quadrilateral' - discriminator: - propertyName: shapeType - ShapeOrNull: - description: The value may be a shape or the 'null' value. - This is introduced in OAS schema >= 3.1. - oneOf: - - type: 'null' - - $ref: '#/components/schemas/Triangle' - - $ref: '#/components/schemas/Quadrilateral' - discriminator: - propertyName: shapeType - NullableShape: - description: The value may be a shape or the 'null' value. - For a composed schema to validate a null payload, - one of its chosen oneOf schemas must be type null - or nullable (introduced in OAS schema >= 3.0) - oneOf: - - $ref: '#/components/schemas/Triangle' - - $ref: '#/components/schemas/Quadrilateral' - - type: "null" - TriangleInterface: - properties: - shapeType: - type: string - enum: - - 'Triangle' - triangleType: - type: string - required: - - shapeType - - triangleType - Triangle: - oneOf: - - $ref: '#/components/schemas/EquilateralTriangle' - - $ref: '#/components/schemas/IsoscelesTriangle' - - $ref: '#/components/schemas/ScaleneTriangle' - discriminator: - propertyName: triangleType - # Note: the 'additionalProperties' keyword is not specified, which is - # equivalent to allowing undeclared properties of any type. - EquilateralTriangle: - allOf: - - $ref: '#/components/schemas/TriangleInterface' - - type: object - properties: - triangleType: - type: string - enum: - - 'EquilateralTriangle' - IsoscelesTriangle: - allOf: - - $ref: '#/components/schemas/TriangleInterface' - - type: object - properties: - triangleType: - type: string - enum: - - 'IsoscelesTriangle' - ScaleneTriangle: - allOf: - - $ref: '#/components/schemas/TriangleInterface' - - type: object - properties: - triangleType: - type: string - enum: - - 'ScaleneTriangle' - QuadrilateralInterface: - properties: - shapeType: - type: string - enum: - - 'Quadrilateral' - quadrilateralType: - type: string - required: - - shapeType - - quadrilateralType - Quadrilateral: - oneOf: - - $ref: '#/components/schemas/SimpleQuadrilateral' - - $ref: '#/components/schemas/ComplexQuadrilateral' - discriminator: - propertyName: quadrilateralType - SimpleQuadrilateral: - allOf: - - $ref: '#/components/schemas/QuadrilateralInterface' - - type: object - properties: - quadrilateralType: - type: string - enum: - - 'SimpleQuadrilateral' - ComplexQuadrilateral: - allOf: - - $ref: '#/components/schemas/QuadrilateralInterface' - - type: object - properties: - quadrilateralType: - type: string - enum: - - 'ComplexQuadrilateral' - GrandparentAnimal: - type: object - required: - - pet_type - properties: - pet_type: - type: string - discriminator: - propertyName: pet_type - ParentPet: - type: object - allOf: - - $ref: '#/components/schemas/GrandparentAnimal' - ChildCat: - allOf: - - $ref: '#/components/schemas/ParentPet' - - type: object - properties: - name: - type: string - ArrayOfEnums: - type: array - items: - $ref: '#/components/schemas/StringEnum' - AdditionalPropertiesWithArrayOfEnums: - type: object - additionalProperties: - type: array - items: - $ref: '#/components/schemas/EnumClass' - DateTimeTest: - type: string - default: '2010-01-01T10:10:10.000111+01:00' - example: '2010-01-01T10:10:10.000111+01:00' - format: date-time - ObjectInterface: - type: object - ObjectWithValidations: - type: object - minProperties: 2 - SomeObject: - allOf: - - $ref: '#/components/schemas/ObjectInterface' - ArrayWithValidationsInItems: - type: array - maxItems: 2 - items: - type: integer - format: int64 - maximum: 7 - ArrayHoldingAnyType: - type: array - items: - description: any type can be stored here - DateWithValidations: - type: string - format: date - pattern: '^2020.*' - DateTimeWithValidations: - type: string - format: date-time - pattern: '^2020.*' - NoAdditionalProperties: - type: object - properties: - id: - type: integer - format: int64 - petId: - type: integer - format: int64 - required: - - id - additionalProperties: false - IntegerMax10: - type: integer - format: int64 - maximum: 10 - IntegerMin15: - type: integer - format: int64 - minimum: 15 - StringWithValidation: - type: string - minLength: 7 - Player: - type: object - description: a model that includes a self reference this forces properties and additionalProperties - to be lazy loaded in python models because the Player class has not fully loaded when defining - properties - properties: - name: - type: string - enemyPlayer: - $ref: '#/components/schemas/Player' - BooleanEnum: - type: boolean - enum: - - true - ComposedObject: - type: object - allOf: - - {} - ComposedNumber: - type: number - allOf: - - {} - ComposedString: - type: string - allOf: - - {} - ComposedBool: - type: boolean - allOf: - - {} - ComposedArray: - type: array - items: {} - allOf: - - {} - ComposedNone: - type: 'null' - allOf: - - {} - Currency: - type: string - enum: - - eur - - usd - Money: - type: object - properties: - amount: - type: string - format: number - currency: - $ref: '#/components/schemas/Currency' - required: - - amount - - currency - DecimalPayload: - type: string - format: number - ObjectWithDecimalProperties: - type: object - properties: - length: - $ref: '#/components/schemas/DecimalPayload' - width: - type: string - format: number - cost: - $ref: '#/components/schemas/Money' - ObjectWithInlineCompositionProperty: - type: object - properties: - someProp: - allOf: - - type: string - minLength: 1 - UUIDString: - type: string - format: uuid - minLength: 1 - AnyTypeNotString: - not: - type: string - JSONPatchRequest: - type: array - items: - oneOf: - - $ref: '#/components/schemas/JSONPatchRequestAddReplaceTest' - - $ref: '#/components/schemas/JSONPatchRequestRemove' - - $ref: '#/components/schemas/JSONPatchRequestMoveCopy' - JSONPatchRequestAddReplaceTest: - type: object - additionalProperties: false - required: - - value - - op - - path - properties: - path: - description: A JSON Pointer path. - type: string - value: - description: The value to add, replace or test. - op: - description: The operation to perform. - type: string - enum: - - add - - replace - - test - JSONPatchRequestRemove: - type: object - additionalProperties: false - required: - - op - - path - properties: - path: - description: A JSON Pointer path. - type: string - op: - description: The operation to perform. - type: string - enum: - - remove - JSONPatchRequestMoveCopy: - type: object - additionalProperties: false - required: - - from - - op - - path - properties: - from: - description: A JSON Pointer path. - type: string - path: - description: A JSON Pointer path. - type: string - op: - description: The operation to perform. - type: string - enum: - - move - - copy - AdditionalPropertiesValidator: - type: object - allOf: - - type: object - additionalProperties: true - - type: object - additionalProperties: - minLength: 3 - - type: object - additionalProperties: - maxLength: 5 - AnyTypeAndFormat: - type: object - properties: - uuid: - format: uuid - date: - format: date - date-time: - format: date-time - number: - format: number - binary: - format: binary - int32: - format: int32 - int64: - format: int64 - double: - format: double - float: - format: float - FromSchema: - type: object - properties: - data: - type: string - id: - type: integer - ObjectWithInvalidNamedRefedProperties: - type: object - properties: - from: - $ref: "#/components/schemas/FromSchema" - "!reference": - $ref: "#/components/schemas/ArrayWithValidationsInItems" - required: - - from - - "!reference" - ObjectWithOptionalTestProp: - type: object - properties: - test: - type: string - ObjectWithAllOfWithReqTestPropFromUnsetAddProp: - allOf: - - $ref: '#/components/schemas/ObjectWithOptionalTestProp' - - type: object - required: [ test ] - properties: - name: - type: string - AbstractStepMessage: - required: - - description - - discriminator - - sequenceNumber - type: object - properties: - discriminator: - type: string - description: Abstract Step - discriminator: - propertyName: discriminator - anyOf: - - $ref: '#/components/schemas/AbstractStepMessage' \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/test/resources/3_0/python/petstore_customized.yaml b/modules/openapi-json-schema-generator/src/test/resources/3_0/python/petstore_customized.yaml new file mode 100644 index 00000000000..f8236a8645e --- /dev/null +++ b/modules/openapi-json-schema-generator/src/test/resources/3_0/python/petstore_customized.yaml @@ -0,0 +1,3267 @@ +openapi: 3.0.0 +info: + description: >- + This spec is mainly for testing Petstore server and contains fake endpoints, + models. Please do not use this for any other purpose. Special characters: " + \ + version: 1.0.0 + title: OpenAPI Petstore + license: + name: Apache-2.0 + url: 'https://www.apache.org/licenses/LICENSE-2.0.html' +tags: + - name: pet + description: Everything about your Pets + - name: store + description: Access to Petstore orders + - name: user + description: Operations about user +paths: + /foo: + get: + servers: + - url: 'https://path-server-test.petstore.local/v2' + - url: 'https://petstore.swagger.io/{version}' + variables: + version: + enum: + - 'v1' + - 'v2' + default: 'v1' + responses: + default: + description: response + content: + application/json: + schema: + type: object + properties: + string: + $ref: '#/components/schemas/Foo' + /pet: + post: + tags: + - pet + summary: Add a new pet to the store + description: Add a new pet to the store + operationId: addPet + responses: + '200': + $ref: '#/components/responses/SuccessDescriptionOnly' + '405': + description: Invalid input + security: + - api_key: [] + - http_signature_test: [] + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + $ref: '#/components/requestBodies/Pet' + put: + tags: + - pet + summary: Update an existing pet + description: '' + operationId: updatePet + responses: + '400': + description: Invalid ID supplied + '404': + description: Pet not found + '405': + description: Validation exception + security: + - http_signature_test: [] + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + $ref: '#/components/requestBodies/Pet' + /pet/findByStatus: + servers: + - url: 'https://path-server-test.petstore.local/v2' + - url: 'https://petstore.swagger.io/{version}' + variables: + version: + enum: + - 'v1' + - 'v2' + default: 'v1' + get: + tags: + - pet + summary: Finds Pets by status + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - name: status + in: query + description: Status values that need to be considered for filter + required: true + style: form + explode: false + schema: + type: array + items: + type: string + enum: + - available + - pending + - sold + default: available + responses: + '200': + $ref: '#/components/responses/SuccessfulXmlAndJsonArrayOfPet' + '400': + description: Invalid status value + security: + - api_key: [] + - http_signature_test: [] + - petstore_auth: + - 'write:pets' + - 'read:pets' + /pet/findByTags: + get: + tags: + - pet + summary: Finds Pets by tags + description: >- + Multiple tags can be provided with comma separated strings. Use tag1, + tag2, tag3 for testing. + operationId: findPetsByTags + parameters: + - name: tags + in: query + description: Tags to filter by + required: true + style: form + explode: false + schema: + type: array + items: + type: string + responses: + '200': + $ref: '#/components/responses/RefSuccessfulXmlAndJsonArrayOfPet' + '400': + description: Invalid tag value + security: + - http_signature_test: [] + - petstore_auth: + - 'write:pets' + - 'read:pets' + deprecated: true + '/pet/{petId}': + get: + tags: + - pet + summary: Find pet by ID + description: Returns a single pet + operationId: getPetById + parameters: + - name: petId + in: path + description: ID of pet to return + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/RefPet' + '400': + description: Invalid ID supplied + '404': + description: Pet not found + security: + - api_key: [] + post: + tags: + - pet + summary: Updates a pet in the store with form data + description: '' + operationId: updatePetWithForm + parameters: + - name: petId + in: path + description: ID of pet that needs to be updated + required: true + schema: + type: integer + format: int64 + responses: + '405': + description: Invalid input + security: + - api_key: [] + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + delete: + tags: + - pet + summary: Deletes a pet + description: '' + operationId: deletePet + parameters: + - name: api_key + in: header + required: false + schema: + type: string + - name: petId + in: path + description: Pet id to delete + required: true + schema: + type: integer + format: int64 + responses: + '400': + description: Invalid pet value + security: + - api_key: [] + - petstore_auth: + - 'write:pets' + - 'read:pets' + '/pet/{petId}/uploadImage': + post: + tags: + - pet + summary: uploads an image + description: '' + operationId: uploadImage + parameters: + - name: petId + in: path + description: ID of pet to update + required: true + schema: + type: integer + format: int64 + responses: + '200': + $ref: '#/components/responses/SuccessWithJsonApiResponse' + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + type: string + format: binary + /store/inventory: + get: + tags: + - store + summary: Returns pet inventories by status + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + '200': + $ref: '#/components/responses/SuccessInlineContentAndHeader' + security: + - api_key: [] + /store/order: + post: + tags: + - store + summary: Place an order for a pet + description: '' + operationId: placeOrder + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + '400': + description: Invalid Order + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + '/store/order/{order_id}': + get: + tags: + - store + summary: Find purchase order by ID + description: >- + For valid response try integer IDs with value <= 5 or > 10. Other values + will generated exceptions + operationId: getOrderById + parameters: + - name: order_id + in: path + description: ID of pet that needs to be fetched + required: true + schema: + type: integer + format: int64 + minimum: 1 + maximum: 5 + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + '400': + description: Invalid ID supplied + '404': + description: Order not found + delete: + tags: + - store + summary: Delete purchase order by ID + description: >- + For valid response try integer IDs with value < 1000. Anything above + 1000 or nonintegers will generate API errors + operationId: deleteOrder + parameters: + - name: order_id + in: path + description: ID of the order that needs to be deleted + required: true + schema: + type: string + responses: + '400': + description: Invalid ID supplied + '404': + description: Order not found + /user: + post: + tags: + - user + summary: Create user + description: This can only be done by the logged in user. + operationId: createUser + responses: + default: + description: successful operation + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + /user/createWithArray: + post: + tags: + - user + summary: Creates list of users with given input array + description: '' + operationId: createUsersWithArrayInput + responses: + default: + description: successful operation + requestBody: + $ref: '#/components/requestBodies/UserArray' + /user/createWithList: + post: + tags: + - user + summary: Creates list of users with given input array + description: '' + operationId: createUsersWithListInput + responses: + default: + description: successful operation + requestBody: + $ref: '#/components/requestBodies/RefUserArray' + /user/login: + get: + tags: + - user + summary: Logs user into the system + description: '' + operationId: loginUser + parameters: + - name: username + in: query + description: The user name for login + required: true + schema: + type: string + - name: password + in: query + description: The password for login in clear text + required: true + schema: + type: string + responses: + '200': + description: successful operation + headers: + X-Rate-Limit: + description: calls per hour allowed by the user + required: true + content: + application/json: + schema: + type: integer + format: int32 + X-Expires-After: + description: date in UTC when token expires + schema: + type: string + format: date-time + stringHeader: + $ref: '#/components/headers/RefStringHeader' + numberHeader: + $ref: '#/components/headers/NumberHeader' + int32: + $ref: '#/components/headers/Int32JsonContentTypeHeader' + ref-schema-header: + $ref: '#/components/headers/RefSchemaHeader' + ref-content-schema-header: + $ref: '#/components/headers/RefContentSchemaHeader' + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + '400': + description: Invalid username/password supplied + /user/logout: + get: + tags: + - user + summary: Logs out current logged in user session + description: '' + operationId: logoutUser + responses: + default: + $ref: '#/components/responses/RefSuccessDescriptionOnly' + '/user/{username}': + get: + tags: + - user + summary: Get user by user name + description: '' + operationId: getUserByName + parameters: + - $ref: '#/components/parameters/PathUserName' + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + '400': + description: Invalid username supplied + '404': + description: User not found + put: + tags: + - user + summary: Updated user + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - $ref: '#/components/parameters/PathUserName' + responses: + '400': + description: Invalid user supplied + '404': + description: User not found + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + delete: + tags: + - user + summary: Delete user + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - $ref: '#/components/parameters/RefPathUserName' + responses: + '200': + $ref: '#/components/responses/SuccessDescriptionOnly' + '404': + description: User not found + /fake_classname_test: + patch: + tags: + - 'fake_classname_tags 123#$%^' + summary: To test class name in snake case + description: To test class name in snake case + operationId: Classname + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + security: + - api_key_query: [] + requestBody: + $ref: '#/components/requestBodies/Client' + /fake: + patch: + tags: + - fake + summary: To test "client" model + description: To test "client" model + operationId: ClientModel + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + requestBody: + $ref: '#/components/requestBodies/Client' + get: + tags: + - fake + summary: To test enum parameters + description: To test enum parameters + operationId: EnumParameters + parameters: + - name: enum_header_string_array + in: header + description: Header parameter enum test (string array) + schema: + type: array + items: + type: string + default: $ + enum: + - '>' + - $ + - name: enum_header_string + in: header + description: Header parameter enum test (string) + schema: + type: string + enum: + - _abc + - '-efg' + - (xyz) + default: '-efg' + - name: enum_query_string_array + in: query + description: Query parameter enum test (string array) + schema: + type: array + items: + type: string + default: $ + enum: + - '>' + - $ + - name: enum_query_string + in: query + description: Query parameter enum test (string) + schema: + type: string + enum: + - _abc + - '-efg' + - (xyz) + default: '-efg' + - name: enum_query_integer + in: query + description: Query parameter enum test (double) + schema: + type: integer + format: int32 + enum: + - 1 + - -2 + - name: enum_query_double + in: query + description: Query parameter enum test (double) + schema: + type: number + format: double + enum: + - 1.1 + - -1.2 + responses: + '200': + $ref: '#/components/responses/SuccessDescriptionOnly' + '404': + description: Not found + content: + application/json: + schema: + type: object + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + type: array + items: + type: string + default: $ + enum: + - '>' + - $ + enum_form_string: + description: Form parameter enum test (string) + type: string + enum: + - _abc + - '-efg' + - (xyz) + default: '-efg' + post: + tags: + - fake + summary: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + description: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + operationId: EndpointParameters + responses: + '200': + $ref: '#/components/responses/SuccessDescriptionOnly' + '404': + description: User not found + security: + - http_basic_test: [] + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + integer: + description: None + type: integer + minimum: 10 + maximum: 100 + int32: + description: None + type: integer + format: int32 + minimum: 20 + maximum: 200 + int64: + description: None + type: integer + format: int64 + number: + description: None + type: number + minimum: 32.1 + maximum: 543.2 + float: + description: None + type: number + format: float + maximum: 987.6 + double: + description: None + type: number + format: double + minimum: 67.8 + maximum: 123.4 + string: + description: None + type: string + pattern: '/[a-z]/i' + pattern_without_delimiter: + description: None + type: string + pattern: '^[A-Z].*' + byte: + description: None + type: string + format: byte + binary: + description: None + type: string + format: binary + date: + description: None + type: string + format: date + dateTime: + description: None + type: string + format: date-time + default: '2010-02-01T10:20:10.11111+01:00' + example: '2020-02-02T20:20:20.22222Z' + password: + description: None + type: string + format: password + minLength: 10 + maxLength: 64 + callback: + description: None + type: string + required: + - number + - double + - pattern_without_delimiter + - byte + delete: + tags: + - fake + security: + - bearer_test: [] + summary: Fake endpoint to test group parameters (optional) + description: Fake endpoint to test group parameters (optional) + operationId: GroupParameters + x-group-parameters: true + parameters: + - name: required_string_group + in: query + description: Required String in group parameters + required: true + schema: + type: string + - name: required_boolean_group + in: header + description: Required Boolean in group parameters + required: true + schema: + type: string + enum: + - true + - false + - name: required_int64_group + in: query + description: Required Integer in group parameters + required: true + schema: + type: integer + format: int64 + - name: string_group + in: query + description: String in group parameters + schema: + type: string + - name: boolean_group + in: header + description: Boolean in group parameters + schema: + type: string + enum: + - true + - false + - name: int64_group + in: query + description: Integer in group parameters + schema: + type: integer + format: int64 + responses: + '200': + $ref: '#/components/responses/SuccessDescriptionOnly' + /fake/refs/number: + post: + tags: + - fake + description: Test serialization of outer number types + operationId: NumberWithValidations + requestBody: + description: Input number as post body + content: + application/json: + schema: + $ref: '#/components/schemas/NumberWithValidations' + required: false + responses: + '200': + description: Output number + content: + application/json: + schema: + $ref: '#/components/schemas/NumberWithValidations' + /fake/refs/mammal: + post: + tags: + - fake + description: Test serialization of mammals + operationId: Mammal + requestBody: + description: Input mammal + content: + application/json: + schema: + $ref: '#/components/schemas/mammal' + required: true + responses: + '200': + description: Output mammal + content: + application/json: + schema: + $ref: '#/components/schemas/mammal' + /fake/refs/string: + post: + tags: + - fake + description: Test serialization of outer string types + operationId: String + requestBody: + description: Input string as post body + content: + application/json: + schema: + $ref: '#/components/schemas/String' + required: false + responses: + '200': + description: Output string + content: + application/json: + schema: + $ref: '#/components/schemas/String' + x-codegen-request-body-name: body + /fake/refs/boolean: + post: + tags: + - fake + description: Test serialization of outer boolean types + operationId: Boolean + requestBody: + description: Input boolean as post body + content: + application/json: + schema: + $ref: '#/components/schemas/Boolean' + required: false + responses: + '200': + description: Output boolean + content: + application/json: + schema: + $ref: '#/components/schemas/Boolean' + x-codegen-request-body-name: body + /fake/refs/arraymodel: + post: + tags: + - fake + description: Test serialization of ArrayModel + operationId: ArrayModel + requestBody: + description: Input model + content: + application/json: + schema: + $ref: '#/components/schemas/AnimalFarm' + required: false + responses: + '200': + description: Output model + content: + application/json: + schema: + $ref: '#/components/schemas/AnimalFarm' + x-codegen-request-body-name: body + /fake/refs/composed_one_of_number_with_validations: + post: + tags: + - fake + description: Test serialization of object with $refed properties + operationId: ComposedOneOfDifferentTypes + requestBody: + description: Input model + content: + application/json: + schema: + $ref: '#/components/schemas/ComposedOneOfDifferentTypes' + required: false + responses: + '200': + description: Output model + content: + application/json: + schema: + $ref: '#/components/schemas/ComposedOneOfDifferentTypes' + /fake/refs/object_model_with_ref_props: + post: + tags: + - fake + description: Test serialization of object with $refed properties + operationId: ObjectModelWithRefProps + requestBody: + description: Input model + content: + application/json: + schema: + $ref: '#/components/schemas/ObjectModelWithRefProps' + required: false + responses: + '200': + description: Output model + content: + application/json: + schema: + $ref: '#/components/schemas/ObjectModelWithRefProps' + x-codegen-request-body-name: body + /fake/refs/enum: + post: + tags: + - fake + description: Test serialization of outer enum + operationId: StringEnum + requestBody: + description: Input enum + content: + application/json: + schema: + $ref: '#/components/schemas/StringEnum' + required: false + responses: + '200': + description: Output enum + content: + application/json: + schema: + $ref: '#/components/schemas/StringEnum' + x-codegen-request-body-name: body + /fake/refs/array-of-enums: + post: + tags: + - fake + summary: Array of Enums + operationId: ArrayOfEnums + requestBody: + description: Input enum + content: + application/json: + schema: + $ref: '#/components/schemas/ArrayOfEnums' + required: false + responses: + 200: + description: Got named array of enums + content: + application/json: + schema: + $ref: '#/components/schemas/ArrayOfEnums' + /fake/additional-properties-with-array-of-enums: + get: + tags: + - fake + summary: Additional Properties with Array of Enums + operationId: AdditionalPropertiesWithArrayOfEnums + requestBody: + description: Input enum + content: + application/json: + schema: + $ref: '#/components/schemas/AdditionalPropertiesWithArrayOfEnums' + required: false + responses: + 200: + description: Got object with additional properties with array of enums + content: + application/json: + schema: + $ref: '#/components/schemas/AdditionalPropertiesWithArrayOfEnums' + /fake/jsonFormData: + get: + tags: + - fake + summary: test json serialization of form data + description: '' + operationId: JsonFormData + responses: + '200': + $ref: '#/components/responses/SuccessDescriptionOnly' + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + /fake/inline-additionalProperties: + post: + tags: + - fake + summary: test inline additionalProperties + description: '' + operationId: InlineAdditionalProperties + responses: + '200': + $ref: '#/components/responses/SuccessDescriptionOnly' + requestBody: + content: + application/json: + schema: + type: object + additionalProperties: + type: string + description: request body + required: true + /fake/body-with-query-params: + put: + tags: + - fake + operationId: BodyWithQueryParams + parameters: + - name: query + in: query + required: true + schema: + type: string + responses: + '200': + $ref: '#/components/responses/SuccessDescriptionOnly' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + required: true + /another-fake/dummy: + patch: + tags: + - $another-fake? + summary: To test special tags + description: To test special tags and operation ID starting with number + operationId: '123_test_@#$%_special_tags' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + requestBody: + $ref: '#/components/requestBodies/Client' + /fake/body-with-file-schema: + put: + tags: + - fake + description: >- + For this test, the body for this request much reference a schema named + `File`. + operationId: BodyWithFileSchema + responses: + '200': + $ref: '#/components/responses/SuccessDescriptionOnly' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FileSchemaTestClass' + required: true + /fake/case-sensitive-params: + put: + tags: + - fake + description: Ensures that original naming is used in endpoint params, that way we on't have collisions + operationId: CaseSensitiveParams + parameters: + - name: someVar + in: query + required: true + schema: + type: string + - name: SomeVar + in: query + required: true + schema: + type: string + - name: some_var + in: query + required: true + schema: + type: string + responses: + "200": + $ref: '#/components/responses/SuccessDescriptionOnly' + /fake/test-query-paramters: + put: + tags: + - fake + description: To test the collection format in query parameters + operationId: QueryParameterCollectionFormat + parameters: + - name: pipe + in: query + required: true + schema: + type: array + items: + type: string + - name: ioutil + in: query + required: true + style: form + explode: false + schema: + type: array + items: + type: string + - name: http + in: query + required: true + style: spaceDelimited + schema: + type: array + items: + type: string + - name: url + in: query + required: true + style: form + explode: false + schema: + type: array + items: + type: string + - name: context + in: query + required: true + explode: true + schema: + type: array + items: + type: string + - name: refParam + in: query + required: true + schema: + $ref: '#/components/schemas/StringWithValidation' + responses: + "200": + $ref: '#/components/responses/SuccessDescriptionOnly' + '/fake/{petId}/uploadImageWithRequiredFile': + post: + tags: + - pet + summary: uploads an image (required) + description: '' + operationId: uploadFileWithRequiredFile + parameters: + - name: petId + in: path + description: ID of pet to update + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + type: string + format: binary + required: + - requiredFile + /fake/parameterCollisions/{1}/{aB}/{Ab}/{self}/{A-B}/: + post: + tags: + - fake + summary: parameter collision case + operationId: parameterCollisions + parameters: + - name: 1 + in: query + schema: + type: string + - name: aB + in: query + schema: + type: string + - name: Ab + in: query + schema: + type: string + - name: self + in: query + schema: + type: string + - name: A-B + in: query + schema: + type: string + - name: 1 + in: header + schema: + type: string + - name: aB + in: header + schema: + type: string + - name: self + in: header + schema: + type: string + - name: A-B + in: header + schema: + type: string + - name: 1 + in: path + required: true + schema: + type: string + - name: aB + in: path + required: true + schema: + type: string + - name: Ab + in: path + required: true + schema: + type: string + - name: self + in: path + required: true + schema: + type: string + - name: A-B + in: path + required: true + schema: + type: string + - name: 1 + in: cookie + schema: + type: string + - name: aB + in: cookie + schema: + type: string + - name: Ab + in: cookie + schema: + type: string + - name: self + in: cookie + schema: + type: string + - name: A-B + in: cookie + schema: + type: string + requestBody: + content: + application/json: + schema: {} + responses: + 200: + description: success + content: + application/json: + schema: {} + /fake/uploadFile: + post: + tags: + - fake + summary: uploads a file using multipart/form-data + description: '' + operationId: uploadFile + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + type: string + format: binary + required: + - file + /fake/uploadFiles: + post: + tags: + - fake + summary: uploads files using multipart/form-data + description: '' + operationId: uploadFiles + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + files: + type: array + items: + type: string + format: binary + /fake/uploadDownloadFile: + post: + tags: + - fake + summary: uploads a file and downloads a file using application/octet-stream + description: '' + operationId: uploadDownloadFile + responses: + '200': + description: successful operation + content: + application/octet-stream: + schema: + type: string + format: binary + description: file to download + requestBody: + required: true + content: + application/octet-stream: + schema: + type: string + format: binary + description: file to upload + /fake/health: + get: + tags: + - fake + summary: Health check endpoint + responses: + 200: + description: The instance started successfully + content: + application/json: + schema: + $ref: '#/components/schemas/HealthCheckResult' + /fake/inlineComposition/: + post: + tags: + - fake + summary: testing composed schemas at inline locations + description: composed schemas at inline locations + multiple requestBody content types + operationId: inlineComposition + parameters: + - name: compositionAtRoot + in: query + schema: + allOf: + - type: string + minLength: 1 + - name: compositionInProperty + in: query + schema: + type: object + properties: + someProp: + allOf: + - type: string + minLength: 1 + requestBody: + description: multiple content types + content: + application/json: + schema: + allOf: + - type: string + minLength: 1 + multipart/form-data: + schema: + type: object + properties: + someProp: + allOf: + - type: string + minLength: 1 + responses: + 200: + description: success, multiple content types + content: + application/json: + schema: + allOf: + - type: string + minLength: 1 + multipart/form-data: + schema: + type: object + properties: + someProp: + allOf: + - type: string + minLength: 1 + '/fake/objInQuery': + get: + tags: + - fake + summary: user list + operationId: objectInQuery + parameters: + - name: mapBean + in: query + required: false + description: mapBean + style: deepObject + explode: true + schema: + type: object + properties: + keyword: + title: keyword + type: string + responses: + '200': + $ref: '#/components/responses/SuccessDescriptionOnly' + '/fake/refObjInQuery': + get: + tags: + - fake + summary: user list + operationId: refObjectInQuery + parameters: + - name: mapBean + in: query + required: false + description: mapBean + style: deepObject + explode: true + schema: + $ref: '#/components/schemas/Foo' + responses: + '200': + $ref: '#/components/responses/SuccessDescriptionOnly' + '/fake/jsonWithCharset': + post: + tags: + - fake + summary: json with charset tx and rx + operationId: jsonWithCharset + requestBody: + content: + application/json; charset=utf-8: + schema: {} + responses: + 200: + description: success + content: + application/json; charset=utf-8: + schema: {} + "/fake/responseWithoutSchema": + get: + tags: + - fake + summary: receives a response without schema + operationId: responseWithoutSchema + responses: + '200': + description: contents without schema definition, multiple content types + content: + application/json: {} + application/xml: {} + /fake/jsonPatch: + patch: + summary: json patch + description: json patch route with a requestBody + operationId: jsonPatch + tags: + - fake + requestBody: + content: + application/json-patch+json: + schema: + $ref: '#/components/schemas/JSONPatchRequest' + responses: + '200': + $ref: '#/components/responses/SuccessDescriptionOnly' + /fake/deleteCoffee/{id}: + delete: + operationId: deleteCoffee + summary: Delete coffee + description: Delete the coffee identified by the given id, (delete without request body) + tags: + - fake + parameters: + - name: id + in: path + description: The internal object id + required: true + schema: + type: string + responses: + '200': + $ref: '#/components/responses/SuccessDescriptionOnly' + default: + description: Unexpected error + /fake/queryParamWithJsonContentType: + get: + operationId: queryParamWithJsonContentType + summary: query param with json content-type + tags: + - fake + parameters: + - name: someParam + in: query + description: The internal object id + required: true + content: + application/json: + schema: {} + responses: + 200: + description: success + content: + application/json: + schema: {} + /fake/multipleResponseBodies: + get: + operationId: multipleResponseBodies + summary: multiple responses have response bodies + tags: + - fake + responses: + 200: + description: success + content: + application/json: + schema: {} + 202: + description: success + content: + application/json: + schema: {} + /fake/multipleSecurities: + get: + operationId: multipleSecurities + summary: multiple security requirements + tags: + - fake + security: + - {} + - api_key: [] + http_basic_test: [] + - petstore_auth: + - 'write:pets' + - 'read:pets' + responses: + 200: + description: success + content: + application/json: + schema: {} + /fake/wildCardResponses: + get: + operationId: wildCardResponses + summary: operation with wildcard responses + tags: + - fake + responses: + 200: + description: success + content: + application/json: + schema: {} + 1XX: + description: 1XX response + content: + application/json: + schema: {} + 2XX: + description: 2XX response + content: + application/json: + schema: {} + 3XX: + description: 3XX response + content: + application/json: + schema: {} + 4XX: + description: 4XX response + content: + application/json: + schema: {} + 5XX: + description: 5XX response + content: + application/json: + schema: {} + /fake/redirection: + get: + operationId: redirection + summary: operation with redirection responses + tags: + - fake + responses: + 303: + description: see other + 3XX: + description: 3XX response +servers: + - url: 'http://{server}.swagger.io:{port}/v2' + description: petstore server + variables: + server: + description: server host prefix + enum: + - 'petstore' + - 'qa-petstore' + - 'dev-petstore' + default: 'petstore' + port: + description: the port + enum: + - 80 + - 8080 + default: 80 + - url: https://localhost:8080/{version} + description: The local server + variables: + version: + enum: + - 'v1' + - 'v2' + default: 'v2' + - url: https://localhost:8080 + description: staging server with no variables +components: + parameters: + PathUserName: + name: username + in: path + description: the use name to use + required: true + schema: + type: string + RefPathUserName: + $ref: '#/components/parameters/PathUserName' + RefSchemaStringWithValidation: + name: RSstringWithValidation + in: path + description: a path string with validation + required: true + schema: + $ref: '#/components/schemas/StringWithValidation' + ComponentRefSchemaStringWithValidation: + name: CRSstringWithValidation + in: path + description: a path string with validation + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/StringWithValidation' + responses: + SuccessfulXmlAndJsonArrayOfPet: + description: successful operation, multiple content types + content: + application/xml: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/RefPet' + RefSuccessfulXmlAndJsonArrayOfPet: + $ref: '#/components/responses/SuccessfulXmlAndJsonArrayOfPet' + SuccessDescriptionOnly: + description: Success + RefSuccessDescriptionOnly: + $ref: '#/components/responses/SuccessDescriptionOnly' + SuccessWithJsonApiResponse: + description: successful operation + headers: + stringHeader: + $ref: '#/components/headers/RefStringHeader' + numberHeader: + $ref: '#/components/headers/NumberHeader' + int32: + $ref: '#/components/headers/Int32JsonContentTypeHeader' + ref-schema-header: + $ref: '#/components/headers/RefSchemaHeader' + ref-content-schema-header: + $ref: '#/components/headers/RefContentSchemaHeader' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + SuccessInlineContentAndHeader: + description: successful operation + headers: + someHeader: + schema: + type: string + content: + application/json: + schema: + type: object + additionalProperties: + type: integer + format: int32 + requestBodies: + UserArray: + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/User' + description: List of user object + required: true + RefUserArray: + $ref: '#/components/requestBodies/UserArray' + Client: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/RefPet' + description: Pet object that needs to be added to the store, multiple content types + required: true + headers: + StringHeader: + description: string header description + required: true + schema: + type: string + RefStringHeader: + $ref: '#/components/headers/StringHeader' + NumberHeader: + description: number header description + schema: + type: string + format: number + Int32JsonContentTypeHeader: + description: int32 JSON content-type header + required: true + content: + application/json: + schema: + type: integer + format: int32 + RefSchemaHeader: + description: header that has a ref in the schema + required: true + schema: + $ref: '#/components/schemas/StringWithValidation' + RefContentSchemaHeader: + description: int32 JSON content-type header + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/StringWithValidation' + securitySchemes: + petstore_auth: + description: oauth2 implicit flow with two scopes + type: oauth2 + flows: + implicit: + authorizationUrl: 'http://petstore.swagger.io/api/oauth/dialog' + scopes: + 'write:pets': modify pets in your account + 'read:pets': read your pets + api_key: + description: apiKey in header + type: apiKey + name: api_key + in: header + api_key_query: + description: apiKey in query + type: apiKey + name: api_key_query + in: query + http_basic_test: + description: http basic + type: http + scheme: basic + bearer_test: + description: http bearer with JWT bearer format + type: http + scheme: bearer + bearerFormat: JWT + http_signature_test: + description: http + signature + # Test the 'HTTP signature' security scheme. + # Each HTTP request is cryptographically signed as specified + # in https://datatracker.ietf.org/doc/draft-cavage-http-signatures/ + type: http + scheme: signature + openIdConnect_test: + description: openIdConnect + type: openIdConnect + openIdConnectUrl: "https://somesite.com/.well-known/openid-configuration" + schemas: + Items: + description: component's name collides with the inner schema name + type: array + items: + type: object + ObjectWithCollidingProperties: + description: component with properties that have name collisions + type: object + properties: + someProp: + type: object + someprop: + type: object + Foo: + type: object + properties: + bar: + $ref: '#/components/schemas/Bar' + Bar: + type: string + default: bar + Order: + type: object + properties: + id: + type: integer + format: int64 + petId: + type: integer + format: int64 + quantity: + type: integer + format: int32 + shipDate: + type: string + format: date-time + example: '2020-02-02T20:20:20.000222Z' + status: + type: string + description: Order Status + enum: + - placed + - approved + - delivered + complete: + type: boolean + default: false + xml: + name: Order + Category: + type: object + required: + - name + properties: + id: + type: integer + format: int64 + name: + type: string + default: default-name + xml: + name: Category + User: + type: object + properties: + id: + type: integer + format: int64 + x-is-unique: true + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + type: integer + format: int32 + description: User Status + objectWithNoDeclaredProps: + type: object + # Note: the 'additionalProperties' keyword is not specified, which is + # equivalent to allowing undeclared properties of any type. + description: test code generation for objects + Value must be a map of strings to values. It cannot be the 'null' value. + objectWithNoDeclaredPropsNullable: + type: object + # Note: the 'additionalProperties' keyword is not specified, which is + # equivalent to allowing undeclared properties of any type. + description: test code generation for nullable objects. + Value must be a map of strings to values or the 'null' value. + nullable: true + anyTypeProp: + description: test code generation for any type + Here the 'type' attribute is not specified, which means the value can be anything, + including the null value, string, number, boolean, array or object. + See https://github.com/OAI/OpenAPI-Specification/issues/1389 + anyTypeExceptNullProp: + description: any type except 'null' + Here the 'type' attribute is not specified, which means the value can be anything, + including the null value, string, number, boolean, array or object. + not: + type: 'null' + anyTypePropNullable: + description: test code generation for any type + Here the 'type' attribute is not specified, which means the value can be anything, + including the null value, string, number, boolean, array or object. + The 'nullable' attribute does not change the allowed values. + nullable: true + xml: + name: User + Tag: + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + xml: + name: Tag + Pet: + type: object + description: Pet object that needs to be added to the store + required: + - name + - photoUrls + properties: + id: + type: integer + format: int64 + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + type: string + example: doggie + photoUrls: + type: array + xml: + name: photoUrl + wrapped: true + items: + type: string + tags: + type: array + xml: + name: tag + wrapped: true + items: + $ref: '#/components/schemas/Tag' + status: + type: string + description: pet status in the store + enum: + - available + - pending + - sold + xml: + name: Pet + RefPet: + $ref: '#/components/schemas/Pet' + ApiResponse: + type: object + properties: + code: + type: integer + format: int32 + type: + type: string + message: + type: string + Return: + description: Model for testing reserved words + properties: + return: + description: this is a reserved python keyword + type: integer + format: int32 + xml: + name: Return + Name: + description: Model for testing model name same as property name + required: + - name + properties: + name: + type: integer + format: int32 + snake_case: + readOnly: true + type: integer + format: int32 + property: + description: this is a reserved python keyword + type: string + xml: + name: Name + 200_response: + description: model with an invalid class name for python, starts with a number + properties: + name: + type: integer + format: int32 + class: + description: this is a reserved python keyword + type: string + xml: + name: Name + ClassModel: + description: Model for testing model with "_class" property + properties: + _class: + type: string + Dog: + allOf: + - $ref: '#/components/schemas/Animal' + - type: object + properties: + breed: + type: string + Cat: + allOf: + - $ref: '#/components/schemas/Animal' + - type: object + properties: + declawed: + type: boolean + Address: + type: object + additionalProperties: + type: integer + Animal: + type: object + discriminator: + propertyName: className + required: + - className + properties: + className: + type: string + color: + type: string + default: red + AnimalFarm: + type: array + items: + $ref: '#/components/schemas/Animal' + FormatTest: + type: object + required: + - number + - byte + - date + - password + properties: + integer: + type: integer + maximum: 100 + minimum: 10 + multipleOf: 2 + int32: + type: integer + format: int32 + int32withValidations: + type: integer + format: int32 + maximum: 200 + minimum: 20 + int64: + type: integer + format: int64 + number: + maximum: 543.2 + minimum: 32.1 + type: number + multipleOf: 32.5 + float: + description: this is a reserved python keyword + type: number + format: float + maximum: 987.6 + minimum: 54.3 + float32: + type: number + format: float + double: + type: number + format: double + maximum: 123.4 + minimum: 67.8 + float64: + type: number + format: double + arrayWithUniqueItems: + type: array + items: + type: number + uniqueItems: true + string: + type: string + pattern: '/[a-z]/i' + byte: + type: string + format: byte + binary: + type: string + format: binary + date: + type: string + format: date + example: '2020-02-02' + dateTime: + type: string + format: date-time + example: '2007-12-03T10:15:30+01:00' + uuid: + type: string + format: uuid + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + uuidNoExample: + type: string + format: uuid + password: + type: string + format: password + maxLength: 64 + minLength: 10 + pattern_with_digits: + description: A string that is a 10 digit number. Can have leading zeros. + type: string + pattern: '^\d{10}$' + pattern_with_digits_and_delimiter: + description: A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + type: string + pattern: '/^image_\d{1,3}$/i' + noneProp: + type: 'null' + EnumClass: + type: string + default: '-efg' + enum: + - _abc + - '-efg' + - (xyz) + - COUNT_1M + - COUNT_50M + ObjectModelWithArgAndArgsProperties: + type: object + properties: + arg: + type: string + args: + type: string + required: + - arg + - args + Enum_Test: + type: object + required: + - enum_string_required + properties: + enum_string: + type: string + enum: + - UPPER + - lower + - '' + enum_string_required: + type: string + enum: + - UPPER + - lower + - '' + enum_integer: + type: integer + format: int32 + enum: + - 1 + - -1 + enum_number: + type: number + format: double + enum: + - 1.1 + - -1.2 + stringEnum: + $ref: '#/components/schemas/StringEnum' + IntegerEnum: + $ref: '#/components/schemas/IntegerEnum' + StringEnumWithDefaultValue: + $ref: '#/components/schemas/StringEnumWithDefaultValue' + IntegerEnumWithDefaultValue: + $ref: '#/components/schemas/IntegerEnumWithDefaultValue' + IntegerEnumOneValue: + $ref: '#/components/schemas/IntegerEnumOneValue' + AdditionalPropertiesClass: + type: object + properties: + map_property: + type: object + additionalProperties: + type: string + map_of_map_property: + type: object + additionalProperties: + type: object + additionalProperties: + type: string + anytype_1: {} + map_with_undeclared_properties_anytype_1: + type: object + map_with_undeclared_properties_anytype_2: + type: object + properties: {} + map_with_undeclared_properties_anytype_3: + type: object + additionalProperties: true + empty_map: + type: object + description: an object with no declared properties and no undeclared + properties, hence it's an empty map. + additionalProperties: false + map_with_undeclared_properties_string: + type: object + additionalProperties: + type: string + MixedPropertiesAndAdditionalPropertiesClass: + type: object + properties: + uuid: + type: string + format: uuid + dateTime: + type: string + format: date-time + map: + type: object + additionalProperties: + $ref: '#/components/schemas/Animal' + Client: + type: object + properties: + client: + type: string + ReadOnlyFirst: + type: object + properties: + bar: + type: string + readOnly: true + baz: + type: string + hasOnlyReadOnly: + type: object + properties: + bar: + type: string + readOnly: true + foo: + type: string + readOnly: true + Capitalization: + type: object + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + MapTest: + type: object + properties: + map_map_of_string: + type: object + additionalProperties: + type: object + additionalProperties: + type: string + map_of_enum_string: + type: object + additionalProperties: + type: string + enum: + - UPPER + - lower + direct_map: + type: object + additionalProperties: + type: boolean + indirect_map: + $ref: '#/components/schemas/StringBooleanMap' + ArrayTest: + type: object + properties: + array_of_string: + type: array + items: + type: string + array_array_of_integer: + type: array + items: + type: array + items: + type: integer + format: int64 + array_array_of_model: + type: array + items: + type: array + items: + $ref: '#/components/schemas/ReadOnlyFirst' + NumberOnly: + type: object + properties: + JustNumber: + type: number + ArrayOfNumberOnly: + type: object + properties: + ArrayNumber: + type: array + items: + type: number + ArrayOfArrayOfNumberOnly: + type: object + properties: + ArrayArrayNumber: + type: array + items: + type: array + items: + type: number + EnumArrays: + type: object + properties: + just_symbol: + type: string + enum: + - '>=' + - $ + array_enum: + type: array + items: + type: string + enum: + - fish + - crab + StringEnum: + nullable: true + type: string + enum: + - "placed" + - "approved" + - "delivered" + - 'single quoted' + - |- + multiple + lines + - "double quote \n with newline" + - null + IntegerEnum: + type: integer + enum: + - 0 + - 1 + - 2 + IntegerEnumBig: + type: integer + enum: + - 10 + - 11 + - 12 + StringEnumWithDefaultValue: + type: string + enum: + - placed + - approved + - delivered + default: placed + IntegerEnumWithDefaultValue: + type: integer + enum: + - 0 + - 1 + - 2 + default: 0 + IntegerEnumOneValue: + type: integer + enum: + - 0 + NullableString: + nullable: true + type: string + ObjectModelWithRefProps: + description: a model that includes properties which should stay primitive (String + Boolean) and one which is defined as a class, NumberWithValidations + type: object + properties: + myNumber: + $ref: '#/components/schemas/NumberWithValidations' + myString: + $ref: '#/components/schemas/String' + myBoolean: + $ref: '#/components/schemas/Boolean' + NumberWithValidations: + type: number + minimum: 10 + maximum: 20 + ComposedAnyOfDifferentTypesNoValidations: + anyOf: + - type: object + - type: string + format: date + - type: string + format: date-time + - type: string + format: binary + - type: string + format: byte + - type: string + - type: object + - type: boolean + - type: 'null' + - type: array + items: {} + - type: number + - type: number + format: float + - type: number + format: double + - type: integer + - type: integer + format: int32 + - type: integer + format: int64 + ComposedOneOfDifferentTypes: + description: this is a model that allows payloads of type object or number + oneOf: + - $ref: '#/components/schemas/NumberWithValidations' + - $ref: '#/components/schemas/Animal' + - type: 'null' + - type: string + format: date + - type: object + minProperties: 4 + maxProperties: 4 + - type: array + maxItems: 4 + minItems: 4 + items: {} + - type: string + format: date-time + pattern: '^2020.*' + Number: + type: number + String: + type: string + Boolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + StringBooleanMap: + additionalProperties: + type: boolean + FileSchemaTestClass: + type: object + properties: + file: + $ref: '#/components/schemas/File' + files: + type: array + items: + $ref: '#/components/schemas/File' + File: + type: object + description: Must be named `File` for test. + properties: + sourceURI: + description: Test capitalization + type: string + ObjectWithDifficultlyNamedProps: + type: object + description: model with properties that have invalid names for python + properties: + '$special[property.name]': + type: integer + format: int64 + 123-list: + type: string + 123Number: + type: integer + readOnly: true + required: + - 123-list + _special_model.name_: + type: object + description: model with an invalid class name for python + properties: + a: + type: string + HealthCheckResult: + type: object + properties: + NullableMessage: + nullable: true + type: string + description: Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + NullableClass: + type: object + properties: + integer_prop: + type: integer + nullable: true + number_prop: + type: number + nullable: true + boolean_prop: + type: boolean + nullable: true + string_prop: + type: string + nullable: true + date_prop: + type: string + format: date + nullable: true + datetime_prop: + type: string + format: date-time + nullable: true + array_nullable_prop: + type: array + nullable: true + items: + type: object + array_and_items_nullable_prop: + type: array + nullable: true + items: + type: object + nullable: true + array_items_nullable: + type: array + items: + type: object + nullable: true + object_nullable_prop: + type: object + nullable: true + additionalProperties: + type: object + object_and_items_nullable_prop: + type: object + nullable: true + additionalProperties: + type: object + nullable: true + object_items_nullable: + type: object + additionalProperties: + type: object + nullable: true + additionalProperties: + type: object + nullable: true + fruit: + properties: + color: + type: string + oneOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + apple: + type: object + properties: + cultivar: + type: string + pattern: ^[a-zA-Z\s]*$ + origin: + type: string + pattern: /^[A-Z\s]*$/i + required: + - cultivar + nullable: true + banana: + type: object + properties: + lengthCm: + type: number + required: + - lengthCm + mammal: + oneOf: + - $ref: '#/components/schemas/whale' + - $ref: '#/components/schemas/zebra' + - $ref: '#/components/schemas/Pig' + discriminator: + propertyName: className + whale: + type: object + properties: + hasBaleen: + type: boolean + hasTeeth: + type: boolean + className: + type: string + enum: + - whale + required: + - className + zebra: + type: object + properties: + type: + type: string + enum: + - plains + - mountain + - grevys + className: + type: string + enum: + - zebra + required: + - className + additionalProperties: true + Pig: + oneOf: + - $ref: '#/components/schemas/BasquePig' + - $ref: '#/components/schemas/DanishPig' + discriminator: + propertyName: className + BasquePig: + type: object + properties: + className: + type: string + enum: + - BasquePig + required: + - className + DanishPig: + type: object + properties: + className: + type: string + enum: + - DanishPig + required: + - className + gmFruit: + properties: + color: + type: string + anyOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + fruitReq: + oneOf: + - type: 'null' + - $ref: '#/components/schemas/appleReq' + - $ref: '#/components/schemas/bananaReq' + appleReq: + type: object + properties: + cultivar: + type: string + mealy: + type: boolean + required: + - cultivar + additionalProperties: false + bananaReq: + type: object + properties: + lengthCm: + type: number + sweet: + type: boolean + required: + - lengthCm + additionalProperties: false + # go-experimental is unable to make Triangle and Quadrilateral models + # correctly https://github.com/OpenAPITools/openapi-json-schema-generator/issues/6149 + Drawing: + type: object + properties: + mainShape: + # A property whose value is a 'oneOf' type, and the type is referenced instead + # of being defined inline. The value cannot be null. + $ref: '#/components/schemas/Shape' + shapeOrNull: + # A property whose value is a 'oneOf' type, and the type is referenced instead + # of being defined inline. The value may be null because ShapeOrNull has 'null' + # type as a child schema of 'oneOf'. + $ref: '#/components/schemas/ShapeOrNull' + nullableShape: + # A property whose value is a 'oneOf' type, and the type is referenced instead + # of being defined inline. The value may be null because NullableShape has the + # 'nullable: true' attribute. For this specific scenario this is exactly the + # same thing as 'shapeOrNull'. + $ref: '#/components/schemas/NullableShape' + shapes: + type: array + items: + $ref: '#/components/schemas/Shape' + additionalProperties: + # Here the additional properties are specified using a referenced schema. + # This is just to validate the generated code works when using $ref + # under 'additionalProperties'. + $ref: '#/components/schemas/fruit' + Shape: + oneOf: + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + discriminator: + propertyName: shapeType + ShapeOrNull: + description: The value may be a shape or the 'null' value. + This is introduced in OAS schema >= 3.1. + oneOf: + - type: 'null' + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + discriminator: + propertyName: shapeType + NullableShape: + description: The value may be a shape or the 'null' value. + For a composed schema to validate a null payload, + one of its chosen oneOf schemas must be type null + or nullable (introduced in OAS schema >= 3.0) + oneOf: + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + - type: "null" + TriangleInterface: + properties: + shapeType: + type: string + enum: + - 'Triangle' + triangleType: + type: string + required: + - shapeType + - triangleType + Triangle: + oneOf: + - $ref: '#/components/schemas/EquilateralTriangle' + - $ref: '#/components/schemas/IsoscelesTriangle' + - $ref: '#/components/schemas/ScaleneTriangle' + discriminator: + propertyName: triangleType + # Note: the 'additionalProperties' keyword is not specified, which is + # equivalent to allowing undeclared properties of any type. + EquilateralTriangle: + allOf: + - $ref: '#/components/schemas/TriangleInterface' + - type: object + properties: + triangleType: + type: string + enum: + - 'EquilateralTriangle' + IsoscelesTriangle: + allOf: + - $ref: '#/components/schemas/TriangleInterface' + - type: object + properties: + triangleType: + type: string + enum: + - 'IsoscelesTriangle' + ScaleneTriangle: + allOf: + - $ref: '#/components/schemas/TriangleInterface' + - type: object + properties: + triangleType: + type: string + enum: + - 'ScaleneTriangle' + QuadrilateralInterface: + properties: + shapeType: + type: string + enum: + - 'Quadrilateral' + quadrilateralType: + type: string + required: + - shapeType + - quadrilateralType + Quadrilateral: + oneOf: + - $ref: '#/components/schemas/SimpleQuadrilateral' + - $ref: '#/components/schemas/ComplexQuadrilateral' + discriminator: + propertyName: quadrilateralType + SimpleQuadrilateral: + allOf: + - $ref: '#/components/schemas/QuadrilateralInterface' + - type: object + properties: + quadrilateralType: + type: string + enum: + - 'SimpleQuadrilateral' + ComplexQuadrilateral: + allOf: + - $ref: '#/components/schemas/QuadrilateralInterface' + - type: object + properties: + quadrilateralType: + type: string + enum: + - 'ComplexQuadrilateral' + GrandparentAnimal: + type: object + required: + - pet_type + properties: + pet_type: + type: string + discriminator: + propertyName: pet_type + ParentPet: + type: object + allOf: + - $ref: '#/components/schemas/GrandparentAnimal' + ChildCat: + allOf: + - $ref: '#/components/schemas/ParentPet' + - type: object + properties: + name: + type: string + ArrayOfEnums: + type: array + items: + $ref: '#/components/schemas/StringEnum' + AdditionalPropertiesWithArrayOfEnums: + type: object + additionalProperties: + type: array + items: + $ref: '#/components/schemas/EnumClass' + DateTimeTest: + type: string + default: '2010-01-01T10:10:10.000111+01:00' + example: '2010-01-01T10:10:10.000111+01:00' + format: date-time + ObjectInterface: + type: object + ObjectWithValidations: + type: object + minProperties: 2 + SomeObject: + allOf: + - $ref: '#/components/schemas/ObjectInterface' + ArrayWithValidationsInItems: + type: array + maxItems: 2 + items: + type: integer + format: int64 + maximum: 7 + ArrayHoldingAnyType: + type: array + items: + description: any type can be stored here + DateWithValidations: + type: string + format: date + pattern: '^2020.*' + DateTimeWithValidations: + type: string + format: date-time + pattern: '^2020.*' + NoAdditionalProperties: + type: object + properties: + id: + type: integer + format: int64 + petId: + type: integer + format: int64 + required: + - id + additionalProperties: false + IntegerMax10: + type: integer + format: int64 + maximum: 10 + IntegerMin15: + type: integer + format: int64 + minimum: 15 + StringWithValidation: + type: string + minLength: 7 + Player: + type: object + description: a model that includes a self reference this forces properties and additionalProperties + to be lazy loaded in python models because the Player class has not fully loaded when defining + properties + properties: + name: + type: string + enemyPlayer: + $ref: '#/components/schemas/Player' + BooleanEnum: + type: boolean + enum: + - true + ComposedObject: + type: object + allOf: + - {} + ComposedNumber: + type: number + allOf: + - {} + ComposedString: + type: string + allOf: + - {} + ComposedBool: + type: boolean + allOf: + - {} + ComposedArray: + type: array + items: {} + allOf: + - {} + ComposedNone: + type: 'null' + allOf: + - {} + Currency: + type: string + enum: + - eur + - usd + Money: + type: object + properties: + amount: + type: string + format: number + currency: + $ref: '#/components/schemas/Currency' + required: + - amount + - currency + DecimalPayload: + type: string + format: number + ObjectWithDecimalProperties: + type: object + properties: + length: + $ref: '#/components/schemas/DecimalPayload' + width: + type: string + format: number + cost: + $ref: '#/components/schemas/Money' + ObjectWithInlineCompositionProperty: + type: object + properties: + someProp: + allOf: + - type: string + minLength: 1 + UUIDString: + type: string + format: uuid + minLength: 1 + AnyTypeNotString: + not: + type: string + JSONPatchRequest: + type: array + items: + oneOf: + - $ref: '#/components/schemas/JSONPatchRequestAddReplaceTest' + - $ref: '#/components/schemas/JSONPatchRequestRemove' + - $ref: '#/components/schemas/JSONPatchRequestMoveCopy' + JSONPatchRequestAddReplaceTest: + type: object + additionalProperties: false + required: + - value + - op + - path + properties: + path: + description: A JSON Pointer path. + type: string + value: + description: The value to add, replace or test. + op: + description: The operation to perform. + type: string + enum: + - add + - replace + - test + JSONPatchRequestRemove: + type: object + additionalProperties: false + required: + - op + - path + properties: + path: + description: A JSON Pointer path. + type: string + op: + description: The operation to perform. + type: string + enum: + - remove + JSONPatchRequestMoveCopy: + type: object + additionalProperties: false + required: + - from + - op + - path + properties: + from: + description: A JSON Pointer path. + type: string + path: + description: A JSON Pointer path. + type: string + op: + description: The operation to perform. + type: string + enum: + - move + - copy + AdditionalPropertiesValidator: + type: object + allOf: + - type: object + additionalProperties: true + - type: object + additionalProperties: + minLength: 3 + - type: object + additionalProperties: + maxLength: 5 + AnyTypeAndFormat: + type: object + properties: + uuid: + format: uuid + date: + format: date + date-time: + format: date-time + number: + format: number + binary: + format: binary + int32: + format: int32 + int64: + format: int64 + double: + format: double + float: + format: float + FromSchema: + type: object + properties: + data: + type: string + id: + type: integer + ObjectWithInvalidNamedRefedProperties: + type: object + properties: + from: + $ref: "#/components/schemas/FromSchema" + "!reference": + $ref: "#/components/schemas/ArrayWithValidationsInItems" + required: + - from + - "!reference" + ObjectWithOptionalTestProp: + type: object + properties: + test: + type: string + ObjectWithAllOfWithReqTestPropFromUnsetAddProp: + allOf: + - $ref: '#/components/schemas/ObjectWithOptionalTestProp' + - type: object + required: [ test ] + properties: + name: + type: string + AbstractStepMessage: + required: + - description + - discriminator + - sequenceNumber + type: object + properties: + discriminator: + type: string + description: Abstract Step + discriminator: + propertyName: discriminator + anyOf: + - $ref: '#/components/schemas/AbstractStepMessage' + ReqPropsFromUnsetAddProps: + required: + - validName + - invalid-name + type: object + ReqPropsFromTrueAddProps: + required: + - validName + - invalid-name + type: object + additionalProperties: true + ReqPropsFromExplicitAddProps: + required: + - validName + - invalid-name + type: object + additionalProperties: + type: string + SelfReferencingObjectModel: + type: object + properties: + selfRef: + $ref: '#/components/schemas/SelfReferencingObjectModel' + additionalProperties: + $ref: '#/components/schemas/SelfReferencingObjectModel' + SelfReferencingArrayModel: + type: array + items: + $ref: '#/components/schemas/SelfReferencingArrayModel' \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/test/resources/3_0/security.yaml b/modules/openapi-json-schema-generator/src/test/resources/3_0/security.yaml new file mode 100644 index 00000000000..ad16ea95454 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/test/resources/3_0/security.yaml @@ -0,0 +1,63 @@ +openapi: 3.0.0 +info: + title: security-test + version: '1.0' +servers: + - url: 'http://localhost:3000' +security: + - api_key: [] + - http_basic_test: [] + - {} + - api_key: [] + http_basic_test: [] +paths: + /pathWithSecurityFromRoot: + get: + summary: path with security from root + operationId: pathWithSecurityFromRoot + responses: + '200': + description: OK + /pathWithOneExplicitSecurity: + get: + summary: path with one explicit security + operationId: pathWithOneExplicitSecurity + security: + - api_key: [] + responses: + '200': + description: OK + /pathWithTwoExplicitSecurity: + get: + summary: path with two explicit security + operationId: pathWithTwoExplicitSecurity + security: + - api_key: [] + - bearer_test: [] + responses: + '200': + description: OK + /pathWithNoExplicitSecurity: + get: + summary: path with no explicit security + operationId: pathWithNoExplicitSecurity + security: [] + responses: + '200': + description: OK +components: + securitySchemes: + api_key: + description: apiKey in header + type: apiKey + name: api_key + in: header + http_basic_test: + description: http basic + type: http + scheme: basic + bearer_test: + description: http bearer with JWT bearer format + type: http + scheme: bearer + bearerFormat: JWT diff --git a/modules/openapi-json-schema-generator/src/test/resources/3_0/type-alias.yaml b/modules/openapi-json-schema-generator/src/test/resources/3_0/type-alias.yaml index 5ae62c68bc9..cf39f796f93 100644 --- a/modules/openapi-json-schema-generator/src/test/resources/3_0/type-alias.yaml +++ b/modules/openapi-json-schema-generator/src/test/resources/3_0/type-alias.yaml @@ -1,7 +1,7 @@ openapi: 3.0.0 info: title: API using a typeAlias mapped with importMapping - description: See https://github.com/OpenAPITools/openapi-generator/issues/3589 + description: See https://github.com/OpenAPITools/openapi-json-schema-generator/issues/3589 version: 1.0.0 paths: /type-alias: diff --git a/modules/openapi-json-schema-generator/src/test/resources/codegen/scala/JavaTimeObj.scala.txt b/modules/openapi-json-schema-generator/src/test/resources/codegen/scala/JavaTimeObj.scala.txt index 062e5cc5259..145f250506a 100644 --- a/modules/openapi-json-schema-generator/src/test/resources/codegen/scala/JavaTimeObj.scala.txt +++ b/modules/openapi-json-schema-generator/src/test/resources/codegen/scala/JavaTimeObj.scala.txt @@ -1,6 +1,6 @@ /** * ping some object - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * No description provided (generated by Openapi Generator https://github.com/openapi-json-schema-tools/openapi-json-schema-generator) * * The version of the OpenAPI document: 1.0 * diff --git a/modules/openapi-json-schema-generator/src/test/resources/codegen/scala/SomeObj.scala.txt b/modules/openapi-json-schema-generator/src/test/resources/codegen/scala/SomeObj.scala.txt index bb5c7fc08cb..efc6e747230 100644 --- a/modules/openapi-json-schema-generator/src/test/resources/codegen/scala/SomeObj.scala.txt +++ b/modules/openapi-json-schema-generator/src/test/resources/codegen/scala/SomeObj.scala.txt @@ -1,6 +1,6 @@ /** * ping some object - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * No description provided (generated by Openapi Generator https://github.com/openapi-json-schema-tools/openapi-json-schema-generator) * * The version of the OpenAPI document: 1.0 * diff --git a/modules/openapi-json-schema-generator/src/test/resources/integrationtests/typescript/array-and-object-expected/api/project.service.ts b/modules/openapi-json-schema-generator/src/test/resources/integrationtests/typescript/array-and-object-expected/api/project.service.ts index 960db464de2..2b0bc973bff 100644 --- a/modules/openapi-json-schema-generator/src/test/resources/integrationtests/typescript/array-and-object-expected/api/project.service.ts +++ b/modules/openapi-json-schema-generator/src/test/resources/integrationtests/typescript/array-and-object-expected/api/project.service.ts @@ -1,6 +1,6 @@ /** * Cupix API - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * No description provided (generated by Openapi Generator https://github.com/openapi-json-schema-tools/openapi-json-schema-generator) * * The version of the OpenAPI document: 1.7.0 * diff --git a/modules/openapi-json-schema-generator/src/test/resources/integrationtests/typescript/array-and-object-expected/model/projectEntity.ts b/modules/openapi-json-schema-generator/src/test/resources/integrationtests/typescript/array-and-object-expected/model/projectEntity.ts index a0fc28a83a4..4c4e76e2e65 100644 --- a/modules/openapi-json-schema-generator/src/test/resources/integrationtests/typescript/array-and-object-expected/model/projectEntity.ts +++ b/modules/openapi-json-schema-generator/src/test/resources/integrationtests/typescript/array-and-object-expected/model/projectEntity.ts @@ -1,6 +1,6 @@ /** * Cupix API - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * No description provided (generated by Openapi Generator https://github.com/openapi-json-schema-tools/openapi-json-schema-generator) * * The version of the OpenAPI document: 1.7.0 * diff --git a/modules/openapi-json-schema-generator/src/test/resources/integrationtests/typescript/array-and-object-expected/model/projectEntityLocation.ts b/modules/openapi-json-schema-generator/src/test/resources/integrationtests/typescript/array-and-object-expected/model/projectEntityLocation.ts index 30c1aaefd5e..c8510b61009 100644 --- a/modules/openapi-json-schema-generator/src/test/resources/integrationtests/typescript/array-and-object-expected/model/projectEntityLocation.ts +++ b/modules/openapi-json-schema-generator/src/test/resources/integrationtests/typescript/array-and-object-expected/model/projectEntityLocation.ts @@ -1,6 +1,6 @@ /** * Cupix API - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * No description provided (generated by Openapi Generator https://github.com/openapi-json-schema-tools/openapi-json-schema-generator) * * The version of the OpenAPI document: 1.7.0 * diff --git a/modules/openapi-json-schema-generator/src/test/resources/integrationtests/typescript/array-and-object-expected/model/projectList.ts b/modules/openapi-json-schema-generator/src/test/resources/integrationtests/typescript/array-and-object-expected/model/projectList.ts index 7801e2f203c..5ae19ce8674 100644 --- a/modules/openapi-json-schema-generator/src/test/resources/integrationtests/typescript/array-and-object-expected/model/projectList.ts +++ b/modules/openapi-json-schema-generator/src/test/resources/integrationtests/typescript/array-and-object-expected/model/projectList.ts @@ -1,6 +1,6 @@ /** * Cupix API - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * No description provided (generated by Openapi Generator https://github.com/openapi-json-schema-tools/openapi-json-schema-generator) * * The version of the OpenAPI document: 1.7.0 * diff --git a/modules/openapi-json-schema-generator/src/test/resources/integrationtests/typescript/objectsWithEnums-expected/.openapi-generator-ignore b/modules/openapi-json-schema-generator/src/test/resources/integrationtests/typescript/objectsWithEnums-expected/.openapi-generator-ignore index 7484ee590a3..d24a2da8ae5 100644 --- a/modules/openapi-json-schema-generator/src/test/resources/integrationtests/typescript/objectsWithEnums-expected/.openapi-generator-ignore +++ b/modules/openapi-json-schema-generator/src/test/resources/integrationtests/typescript/objectsWithEnums-expected/.openapi-generator-ignore @@ -1,5 +1,5 @@ # OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator +# Generated by openapi-generator https://github.com/openapi-json-schema-tools/openapi-json-schema-generator # Use this file to prevent files from being overwritten by the generator. # The patterns follow closely to .gitignore or .dockerignore. diff --git a/modules/openapi-json-schema-generator/src/test/resources/org/openapitools/codegen/kotlin/KotlinTestUtilsTest/badPack/com/example/SimpleClass.kt b/modules/openapi-json-schema-generator/src/test/resources/org/openapijsonschematools/codegen/kotlin/KotlinTestUtilsTest/badPack/com/example/SimpleClass.kt similarity index 100% rename from modules/openapi-json-schema-generator/src/test/resources/org/openapitools/codegen/kotlin/KotlinTestUtilsTest/badPack/com/example/SimpleClass.kt rename to modules/openapi-json-schema-generator/src/test/resources/org/openapijsonschematools/codegen/kotlin/KotlinTestUtilsTest/badPack/com/example/SimpleClass.kt diff --git a/modules/openapi-json-schema-generator/src/test/resources/org/openapitools/codegen/kotlin/KotlinTestUtilsTest/normalPack/com/example/SimpleClass.kt b/modules/openapi-json-schema-generator/src/test/resources/org/openapijsonschematools/codegen/kotlin/KotlinTestUtilsTest/normalPack/com/example/SimpleClass.kt similarity index 100% rename from modules/openapi-json-schema-generator/src/test/resources/org/openapitools/codegen/kotlin/KotlinTestUtilsTest/normalPack/com/example/SimpleClass.kt rename to modules/openapi-json-schema-generator/src/test/resources/org/openapijsonschematools/codegen/kotlin/KotlinTestUtilsTest/normalPack/com/example/SimpleClass.kt diff --git a/modules/openapi-json-schema-generator/src/test/resources/templating/templates/jmeter/api.hbs b/modules/openapi-json-schema-generator/src/test/resources/templating/templates/jmeter/api.hbs index ac4530655d1..ea462f3887a 100644 --- a/modules/openapi-json-schema-generator/src/test/resources/templating/templates/jmeter/api.hbs +++ b/modules/openapi-json-schema-generator/src/test/resources/templating/templates/jmeter/api.hbs @@ -43,9 +43,9 @@ ${__P(port,8080)} = {{#operations}}{{#operation}} - - testData.{{operationId}}File - ${__P(testData.{{operationId}}File,{{classname}}.csv)} + + testData.{{operationId.snakeCase}}File + ${__P(testData.{{operationId.snakeCase}}File,{{classname}}.csv)} = {{/operation}}{{/operations}} @@ -65,7 +65,7 @@ 4 - {{#operations}}{{#operation}} + {{#operations}}{{#operation}} continue false @@ -89,7 +89,7 @@ - + {{#queryParams}} @@ -108,7 +108,7 @@ {{basePathWithoutHost}}{{vendorExtensions.x-path}} - {{httpMethod}} + {{httpMethod.original}} true false true @@ -116,13 +116,14 @@ false - {{summary}} {{notes}} + {{this}} + summary notes - + , - ${testData.{{operationId}}File} + ${testData.{{operationId.snakeCase}}File} true true shareMode.group diff --git a/modules/openapi-json-schema-generator/src/test/resources/templating/templates/jmeter/testdata-localhost.hbs b/modules/openapi-json-schema-generator/src/test/resources/templating/templates/jmeter/testdata-localhost.hbs index 85182a070ce..4bfbd44f126 100644 --- a/modules/openapi-json-schema-generator/src/test/resources/templating/templates/jmeter/testdata-localhost.hbs +++ b/modules/openapi-json-schema-generator/src/test/resources/templating/templates/jmeter/testdata-localhost.hbs @@ -1,2 +1,2 @@ -testCase,httpStatusCode{{#each operations}}{{#each .}}{{#if hasParams}},{{/if}}{{#each allParams}}{{paramName}}{{#unless @last}},{{/unless}}{{/each}}{{/each}}{{/each}} -Success,200{{#each operations}}{{#each .}}{{#if hasParams}},{{/if}}{{#each allParams}}0{{#unless @last}},{{/unless}}{{/each}}{{/each}}{{/each}} \ No newline at end of file +testCase,httpStatusCode{{#each operations}}{{#each .}}{{#if allParams}},{{/if}}{{#each allParams}}{{paramName}}{{#unless @last}},{{/unless}}{{/each}}{{/each}}{{/each}} +Success,200{{#each operations}}{{#each .}}{{#if allParams}},{{/if}}{{#each allParams}}0{{#unless @last}},{{/unless}}{{/each}}{{/each}}{{/each}} \ No newline at end of file diff --git a/new.sh b/new.sh index 7d33be840e5..c9f94c0f04f 100755 --- a/new.sh +++ b/new.sh @@ -17,24 +17,24 @@ Examples: $0 -n kotlin -s Creates: - modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinServerCodegen.java - modules/openapi-generator/src/main/resources/kotlin-server/README.mustache - modules/openapi-generator/src/main/resources/kotlin-server/model.mustache - modules/openapi-generator/src/main/resources/kotlin-server/api.mustache + modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/KotlinServerCodegen.java + modules/openapi-json-schema-generator/src/main/resources/kotlin-server/README.mustache + modules/openapi-json-schema-generator/src/main/resources/kotlin-server/model.mustache + modules/openapi-json-schema-generator/src/main/resources/kotlin-server/api.mustache bin/configs/kotlin-server-petstore-new.yaml Create a generic C# server generator: $0 -n csharp -s -t Creates: - modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CsharpServerCodegen.java - modules/openapi-generator/src/main/resources/csharp-server/README.mustache - modules/openapi-generator/src/main/resources/csharp-server/model.mustache - modules/openapi-generator/src/main/resources/csharp-server/api.mustache + modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/CsharpServerCodegen.java + modules/openapi-json-schema-generator/src/main/resources/csharp-server/README.mustache + modules/openapi-json-schema-generator/src/main/resources/csharp-server/model.mustache + modules/openapi-json-schema-generator/src/main/resources/csharp-server/api.mustache bin/configs/csharp-server-petstore-new.yaml - modules/openapi-generator/src/test/java/org/openapitools/codegen/csharp/CsharpServerCodegenTest.java - modules/openapi-generator/src/test/java/org/openapitools/codegen/csharp/CsharpServerCodegenModelTest.java - modules/openapi-generator/src/test/java/org/openapitools/codegen/csharp/CsharpServerCodegenOptionsTest.java - modules/openapi-generator/src/test/java/org/openapitools/codegen/options/CsharpServerCodegenOptionsProvider.java + modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/csharp/CsharpServerCodegenTest.java + modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/csharp/CsharpServerCodegenModelTest.java + modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/csharp/CsharpServerCodegenOptionsTest.java + modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/options/CsharpServerCodegenOptionsProvider.java EOF exit 0; } @@ -134,14 +134,14 @@ declare gen_name_camel_pkg=$(kebabCasePkg "${gen_name}") declare codegen_type_enum=$(upperCase "${gen_type}") # Step 1: Add Language Generator -[ -f "${root}/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/${lang_classname}.java" ] && \ +[ -f "${root}/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/${lang_classname}.java" ] && \ echo "${lang_classname} already exists" && exit 1; -echo "Creating modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/${lang_classname}.java" -cat > "${root}/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/${lang_classname}.java" < "${root}/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/${lang_classname}.java" <> "${root}/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig" +echo -e "\norg.openapijsonschematools.codegen.languages.${lang_classname}" >> "${root}/modules/openapi-json-schema-generator/src/main/resources/META-INF/services/org.openapijsonschematools.codegen.CodegenConfig" # Step 3: Create resource files -mkdir -p "${root}/modules/openapi-generator/src/main/resources/${gen_name_camel}" -echo "Creating modules/openapi-generator/src/main/resources/${gen_name_camel}/README.mustache" && \ - touch "${root}/modules/openapi-generator/src/main/resources/${gen_name_camel}/README.mustache" -echo "Creating modules/openapi-generator/src/main/resources/${gen_name_camel}/model.mustache" && \ - touch "${root}/modules/openapi-generator/src/main/resources/${gen_name_camel}/model.mustache" -echo "Creating modules/openapi-generator/src/main/resources/${gen_name_camel}/api.mustache" && \ - touch "${root}/modules/openapi-generator/src/main/resources/${gen_name_camel}/api.mustache" +mkdir -p "${root}/modules/openapi-json-schema-generator/src/main/resources/${gen_name_camel}" +echo "Creating modules/openapi-json-schema-generator/src/main/resources/${gen_name_camel}/README.mustache" && \ + touch "${root}/modules/openapi-json-schema-generator/src/main/resources/${gen_name_camel}/README.mustache" +echo "Creating modules/openapi-json-schema-generator/src/main/resources/${gen_name_camel}/model.mustache" && \ + touch "${root}/modules/openapi-json-schema-generator/src/main/resources/${gen_name_camel}/model.mustache" +echo "Creating modules/openapi-json-schema-generator/src/main/resources/${gen_name_camel}/api.mustache" && \ + touch "${root}/modules/openapi-json-schema-generator/src/main/resources/${gen_name_camel}/api.mustache" # Step 4: Create generation config scripts echo "Creating bin/configs/${gen_name_camel}-petstore-new.yaml" cat > "${root}/bin/configs/${gen_name_camel}-petstore-new.yaml"< "${root}/modules/openapi-generator/src/test/java/org/openapitools/codegen/${gen_name_camel_path}/${lang_classname}Test.java"< "${root}/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/${gen_name_camel_path}/${lang_classname}Test.java"< "${root}/modules/openapi-generator/src/test/java/org/openapitools/codegen/${gen_name_camel_path}/${lang_classname}ModelTest.java"< "${root}/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/${gen_name_camel_path}/${lang_classname}ModelTest.java"< "${root}/modules/openapi-generator/src/test/java/org/openapitools/codegen/${gen_name_camel_path}/${lang_classname}OptionsTest.java"< "${root}/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/${gen_name_camel_path}/${lang_classname}OptionsTest.java"< "${root}/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/${lang_classname}OptionsProvider.java"< "${root}/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/options/${lang_classname}OptionsProvider.java"< 4.0.0 - org.openapitools + org.openapijsonschematools openapi-json-schema-generator-project pom openapi-json-schema-generator-project ${revision} - https://github.com/openapitools/openapi-json-schema-generator + https://github.com/openapi-json-schema-tools/openapi-json-schema-generator - scm:git:git@github.com:openapitools/openapi-json-schema-generator.git - scm:git:git@github.com:openapitools/openapi-jsons-schema-generator.git - https://github.com/openapitools/openapi-jsons-schema-generator + scm:git:git@github.com:openapijsonschematools/openapi-json-schema-generator.git + scm:git:git@github.com:openapijsonschematools/openapi-jsons-schema-generator.git + https://github.com/openapi-json-schema-tools/openapi-jsons-schema-generator @@ -35,7 +35,7 @@ github - https://github.com/openapitools/openapi-json-schema-generator/issues + https://github.com/openapi-json-schema-tools/openapi-json-schema-generator/issues @@ -181,8 +181,8 @@ org.testng:testng @{argLine} -XX:+StartAttachListener - 1000 - 5000 + 1000 + 5000 @@ -228,7 +228,7 @@ development ${project.url} ${project.version} - org.openapitools + org.openapijsonschematools @@ -300,7 +300,7 @@ No Snapshots Allowed! false - org.openapitools:* + org.openapijsonschematools:* @@ -1200,7 +1200,6 @@ modules/openapi-json-schema-generator-core modules/openapi-json-schema-generator modules/openapi-json-schema-generator-cli - modules/openapi-json-schema-generator-online @@ -1267,7 +1266,7 @@ - 1.0.4 + 2.0.0 1.8 1.8 @@ -1282,7 +1281,7 @@ 4.9.10 3.0.9 30.1.1-jre - 4.2.1 + 4.3.0 2.10.0 2.13.4 0.8.7 diff --git a/samples/meta-codegen-kotlin/lib/README.md b/samples/meta-codegen-kotlin/lib/README.md index ed9aa572f29..5bc74ea283d 100644 --- a/samples/meta-codegen-kotlin/lib/README.md +++ b/samples/meta-codegen-kotlin/lib/README.md @@ -49,10 +49,10 @@ To build as a shadowJar, run: To list generators via OpenAPI Generator CLI, you must refer to the CLI jar explicitly. We add a custom copy task which includes the CLI jar in the build output directory: ```bash -java -cp build/libs/openapi-generator-cli-4.1.3.jar:build/libs/my-client-codegen-openapi-generator-1.0-SNAPSHOT-all.jar org.openapitools.codegen.OpenAPIGenerator list +java -cp build/libs/openapi-generator-cli-4.1.3.jar:build/libs/my-client-codegen-openapi-generator-1.0-SNAPSHOT-all.jar OpenAPIGenerator list ``` -Notice that this command _must_ pass classpath via `-cp` and include OpenAPI Generator CLI as well as the artifact built from this project. Also notice that the manifest class must be passed explicitly as `org.openapitools.codegen.OpenAPIGenerator`. +Notice that this command _must_ pass classpath via `-cp` and include OpenAPI Generator CLI as well as the artifact built from this project. Also notice that the manifest class must be passed explicitly as `OpenAPIGenerator`. ## See Also diff --git a/samples/meta-codegen-kotlin/lib/build.gradle.kts b/samples/meta-codegen-kotlin/lib/build.gradle.kts index 180c7beca8f..45bf0737f3d 100644 --- a/samples/meta-codegen-kotlin/lib/build.gradle.kts +++ b/samples/meta-codegen-kotlin/lib/build.gradle.kts @@ -6,7 +6,7 @@ plugins { id("com.github.johnrengelman.shadow") version("5.0.0") } -group = "org.openapitools" +group = "org.openapijsonschematools" version = "1.0-SNAPSHOT" repositories { @@ -18,9 +18,9 @@ dependencies { val openapiGeneratorVersion = "4.1.3" implementation(kotlin("stdlib-jdk8")) - implementation("org.openapitools:openapi-generator:$openapiGeneratorVersion") + implementation("org.openapijsonschematools:openapi-generator:$openapiGeneratorVersion") - runtime("org.openapitools:openapi-generator-cli:$openapiGeneratorVersion") + runtime("org.openapijsonschematools:openapi-generator-cli:$openapiGeneratorVersion") testImplementation("org.junit.jupiter:junit-jupiter:5.5.2") } @@ -48,7 +48,7 @@ tasks.register("standalone") { mergeServiceFiles() - manifest.attributes(mapOf("Main-Class" to "org.openapitools.codegen.OpenAPIGenerator")) + manifest.attributes(mapOf("Main-Class" to "org.openapijsonschematools.codegen.OpenAPIGenerator")) } tasks.withType { diff --git a/samples/meta-codegen-kotlin/lib/src/main/kotlin/com/my/company/codegen/MyclientcodegenGenerator.kt b/samples/meta-codegen-kotlin/lib/src/main/kotlin/com/my/company/codegen/MyclientcodegenGenerator.kt index ab4fdbd49d4..09732c854f1 100644 --- a/samples/meta-codegen-kotlin/lib/src/main/kotlin/com/my/company/codegen/MyclientcodegenGenerator.kt +++ b/samples/meta-codegen-kotlin/lib/src/main/kotlin/com/my/company/codegen/MyclientcodegenGenerator.kt @@ -1,8 +1,8 @@ @file:JvmName("MyclientcodegenGenerator") package com.my.company.codegen -import org.openapitools.codegen.* -import org.openapitools.codegen.model.*; +import org.openapijsonschematools.codegen.* +import org.openapijsonschematools.codegen.model.*; import java.util.* import java.io.File @@ -17,7 +17,7 @@ open class MyclientcodegenGenerator() : DefaultCodegen(), CodegenConfig { * Configures the type of generator. * * @return the CodegenType for this generator - * @see org.openapitools.codegen.CodegenType + * @see org.openapijsonschematools.codegen.CodegenType */ override fun getTag(): CodegenType { return CodegenType.DOCUMENTATION @@ -90,12 +90,12 @@ open class MyclientcodegenGenerator() : DefaultCodegen(), CodegenConfig { /** * Api Package. Optional, if needed, this can be used in templates */ - apiPackage = "org.openapitools.api" + apiPackage = "org.openapijsonschematools.api" /** * Model Package. Optional, if needed, this can be used in templates */ - modelPackage = "org.openapitools.model" + modelPackage = "org.openapijsonschematools.model" /** * Reserved words. Override this with reserved words specific to your language diff --git a/samples/meta-codegen-kotlin/lib/src/test/kotlin/com/my/company/codegen/MyclientcodegenGeneratorTest.kt b/samples/meta-codegen-kotlin/lib/src/test/kotlin/com/my/company/codegen/MyclientcodegenGeneratorTest.kt index 3ebf1576b25..e85460511f5 100644 --- a/samples/meta-codegen-kotlin/lib/src/test/kotlin/com/my/company/codegen/MyclientcodegenGeneratorTest.kt +++ b/samples/meta-codegen-kotlin/lib/src/test/kotlin/com/my/company/codegen/MyclientcodegenGeneratorTest.kt @@ -2,9 +2,9 @@ package com.my.company.codegen import org.junit.jupiter.api.Assertions.* import org.junit.jupiter.api.Test -import org.openapitools.codegen.ClientOptInput -import org.openapitools.codegen.DefaultGenerator -import org.openapitools.codegen.config.CodegenConfigurator +import org.openapijsonschematools.codegen.ClientOptInput +import org.openapijsonschematools.codegen.DefaultGenerator +import org.openapijsonschematools.codegen.config.CodegenConfigurator internal class MyclientcodegenGeneratorTest { @@ -13,10 +13,10 @@ internal class MyclientcodegenGeneratorTest { @Test fun launchCodeGenerator() { // to understand how the 'openapi-generator-cli' module is using 'CodegenConfigurator', have a look at the 'Generate' class: - // https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/Generate.java + // https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator-cli/src/main/java/org/openapijsonschematools/codegen/cmd/Generate.java val configurator: CodegenConfigurator = CodegenConfigurator() .setGeneratorName("myClientCodegen") - .setInputSpec("https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml") // or from the server + .setInputSpec("https://raw.githubusercontent.com/openapi-json-schema-tools/openapi-json-schema-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml") // or from the server .setOutputDir("out/myClientCodegen") val clientOptInput: ClientOptInput = configurator.toClientOptInput() diff --git a/samples/meta-codegen-kotlin/usage/.openapi-generator-ignore b/samples/meta-codegen-kotlin/usage/.openapi-generator-ignore index 7484ee590a3..d24a2da8ae5 100644 --- a/samples/meta-codegen-kotlin/usage/.openapi-generator-ignore +++ b/samples/meta-codegen-kotlin/usage/.openapi-generator-ignore @@ -1,5 +1,5 @@ # OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator +# Generated by openapi-generator https://github.com/openapi-json-schema-tools/openapi-json-schema-generator # Use this file to prevent files from being overwritten by the generator. # The patterns follow closely to .gitignore or .dockerignore. diff --git a/samples/meta-codegen-kotlin/usage/src/org/openapitools/api/PetApi.sample b/samples/meta-codegen-kotlin/usage/src/org/openapitools/api/PetApi.sample index bdc32121ce1..19f3fad42f0 100644 --- a/samples/meta-codegen-kotlin/usage/src/org/openapitools/api/PetApi.sample +++ b/samples/meta-codegen-kotlin/usage/src/org/openapitools/api/PetApi.sample @@ -5,7 +5,7 @@ # like such: # use the package from the `apiPackage` variable -package: org.openapitools.api +package: org.openapijsonschematools.api # operations block classname: PetApi diff --git a/samples/meta-codegen-kotlin/usage/src/org/openapitools/api/StoreApi.sample b/samples/meta-codegen-kotlin/usage/src/org/openapitools/api/StoreApi.sample index fe7dfd5fdd2..1fec4afb265 100644 --- a/samples/meta-codegen-kotlin/usage/src/org/openapitools/api/StoreApi.sample +++ b/samples/meta-codegen-kotlin/usage/src/org/openapitools/api/StoreApi.sample @@ -5,7 +5,7 @@ # like such: # use the package from the `apiPackage` variable -package: org.openapitools.api +package: org.openapijsonschematools.api # operations block classname: StoreApi diff --git a/samples/meta-codegen-kotlin/usage/src/org/openapitools/api/UserApi.sample b/samples/meta-codegen-kotlin/usage/src/org/openapitools/api/UserApi.sample index a8454da37a3..fa97004f08a 100644 --- a/samples/meta-codegen-kotlin/usage/src/org/openapitools/api/UserApi.sample +++ b/samples/meta-codegen-kotlin/usage/src/org/openapitools/api/UserApi.sample @@ -5,7 +5,7 @@ # like such: # use the package from the `apiPackage` variable -package: org.openapitools.api +package: org.openapijsonschematools.api # operations block classname: UserApi diff --git a/samples/meta-codegen/lib/README.md b/samples/meta-codegen/lib/README.md index f411d55c86f..48b37fbe065 100644 --- a/samples/meta-codegen/lib/README.md +++ b/samples/meta-codegen/lib/README.md @@ -27,7 +27,7 @@ At this point, you've likely generated a client setup. It will include somethin |----- myClientCodegen // template files |----- META-INF |------ services -|------- org.openapitools.codegen.CodegenConfig +|------- CodegenConfig ``` You _will_ need to make changes in at least the following: @@ -48,13 +48,13 @@ In your generator project. A single jar file will be produced in `target`. You c For mac/linux: ``` -java -cp /path/to/openapi-generator-cli.jar:/path/to/your.jar org.openapitools.codegen.OpenAPIGenerator generate -g myClientCodegen -i /path/to/openapi.yaml -o ./test +java -cp /path/to/openapi-generator-cli.jar:/path/to/your.jar OpenAPIGenerator generate -g myClientCodegen -i /path/to/openapi.yaml -o ./test ``` (Do not forget to replace the values `/path/to/openapi-generator-cli.jar`, `/path/to/your.jar` and `/path/to/openapi.yaml` in the previous command) For Windows users, you will need to use `;` instead of `:` in the classpath, e.g. ``` -java -cp /path/to/openapi-generator-cli.jar;/path/to/your.jar org.openapitools.codegen.OpenAPIGenerator generate -g myClientCodegen -i /path/to/openapi.yaml -o ./test +java -cp /path/to/openapi-generator-cli.jar;/path/to/your.jar OpenAPIGenerator generate -g myClientCodegen -i /path/to/openapi.yaml -o ./test ``` Now your templates are available to the client generator and you can write output values @@ -78,7 +78,7 @@ the object you have available during client generation: # -DdebugOperations prints operations passed to the template engine # -DdebugSupportingFiles prints additional data passed to the template engine -java -DdebugOperations -cp /path/to/openapi-generator-cli.jar:/path/to/your.jar org.openapitools.codegen.OpenAPIGenerator generate -g myClientCodegen -i /path/to/openapi.yaml -o ./test +java -DdebugOperations -cp /path/to/openapi-generator-cli.jar:/path/to/your.jar OpenAPIGenerator generate -g myClientCodegen -i /path/to/openapi.yaml -o ./test ``` Will, for example, output the debug info for operations. diff --git a/samples/meta-codegen/lib/pom.xml b/samples/meta-codegen/lib/pom.xml index 28ffe4d5831..b9c2b9c85a6 100644 --- a/samples/meta-codegen/lib/pom.xml +++ b/samples/meta-codegen/lib/pom.xml @@ -1,7 +1,7 @@ 4.0.0 - org.openapitools + org.openapijsonschematools myClientCodegen-openapi-generator jar myClientCodegen-openapi-generator @@ -108,7 +108,7 @@ - org.openapitools + org.openapijsonschematools openapi-generator ${openapi-generator-version} provided diff --git a/samples/meta-codegen/lib/src/main/java/com/my/company/codegen/MyclientcodegenGenerator.java b/samples/meta-codegen/lib/src/main/java/com/my/company/codegen/MyclientcodegenGenerator.java index 379443c0dfc..63095788e46 100644 --- a/samples/meta-codegen/lib/src/main/java/com/my/company/codegen/MyclientcodegenGenerator.java +++ b/samples/meta-codegen/lib/src/main/java/com/my/company/codegen/MyclientcodegenGenerator.java @@ -1,7 +1,6 @@ package com.my.company.codegen; -import org.openapitools.codegen.*; -import org.openapitools.codegen.model.*; +import org.openapijsonschematools.codegen.*; import io.swagger.models.properties.*; import java.util.*; @@ -17,7 +16,7 @@ public class MyclientcodegenGenerator extends DefaultCodegen implements CodegenC * Configures the type of generator. * * @return the CodegenType for this generator - * @see org.openapitools.codegen.CodegenType + * @see org.openapijsonschematools.codegen.CodegenType */ public CodegenType getTag() { return CodegenType.DOCUMENTATION; @@ -101,12 +100,12 @@ public MyclientcodegenGenerator() { /** * Api Package. Optional, if needed, this can be used in templates */ - apiPackage = "org.openapitools.api"; + apiPackage = "org.openapijsonschematools.api"; /** * Model Package. Optional, if needed, this can be used in templates */ - modelPackage = "org.openapitools.model"; + modelPackage = "org.openapijsonschematools.model"; /** * Reserved words. Override this with reserved words specific to your language diff --git a/samples/meta-codegen/lib/src/test/java/com/my/company/codegen/MyclientcodegenGeneratorTest.java b/samples/meta-codegen/lib/src/test/java/com/my/company/codegen/MyclientcodegenGeneratorTest.java index e49abd7033f..57094fa3f62 100644 --- a/samples/meta-codegen/lib/src/test/java/com/my/company/codegen/MyclientcodegenGeneratorTest.java +++ b/samples/meta-codegen/lib/src/test/java/com/my/company/codegen/MyclientcodegenGeneratorTest.java @@ -1,9 +1,9 @@ package com.my.company.codegen; import org.junit.Test; -import org.openapitools.codegen.ClientOptInput; -import org.openapitools.codegen.DefaultGenerator; -import org.openapitools.codegen.config.CodegenConfigurator; +import org.openapijsonschematools.codegen.ClientOptInput; +import org.openapijsonschematools.codegen.DefaultGenerator; +import org.openapijsonschematools.codegen.config.CodegenConfigurator; /*** * This test allows you to easily launch your code generation software under a debugger. @@ -22,11 +22,11 @@ public class MyclientcodegenGeneratorTest { @Test public void launchCodeGenerator() { // to understand how the 'openapi-generator-cli' module is using 'CodegenConfigurator', have a look at the 'Generate' class: - // https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/Generate.java + // https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator-cli/src/main/java/org/openapijsonschematools/codegen/cmd/Generate.java final CodegenConfigurator configurator = new CodegenConfigurator() .setGeneratorName("myClientCodegen") // use this codegen library .setInputSpec("../../../modules/openapi-generator/src/test/resources/2_0/petstore.yaml") // sample OpenAPI file - // .setInputSpec("https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml") // or from the server + // .setInputSpec("https://raw.githubusercontent.com/openapi-json-schema-tools/openapi-json-schema-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml") // or from the server .setOutputDir("out/myClientCodegen"); // output directory final ClientOptInput clientOptInput = configurator.toClientOptInput(); diff --git a/samples/meta-codegen/pom.xml b/samples/meta-codegen/pom.xml index 7b095003e4e..956b253926a 100644 --- a/samples/meta-codegen/pom.xml +++ b/samples/meta-codegen/pom.xml @@ -1,7 +1,7 @@ 4.0.0 - org.openapitools + org.openapijsonschematools meta-codegen 1.0.0 pom diff --git a/samples/meta-codegen/usage/.openapi-generator-ignore b/samples/meta-codegen/usage/.openapi-generator-ignore index 7484ee590a3..d24a2da8ae5 100644 --- a/samples/meta-codegen/usage/.openapi-generator-ignore +++ b/samples/meta-codegen/usage/.openapi-generator-ignore @@ -1,5 +1,5 @@ # OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator +# Generated by openapi-generator https://github.com/openapi-json-schema-tools/openapi-json-schema-generator # Use this file to prevent files from being overwritten by the generator. # The patterns follow closely to .gitignore or .dockerignore. diff --git a/samples/meta-codegen/usage/.openapi-generator/FILES b/samples/meta-codegen/usage/.openapi-generator/FILES index 732d36db620..2716fd43e87 100644 --- a/samples/meta-codegen/usage/.openapi-generator/FILES +++ b/samples/meta-codegen/usage/.openapi-generator/FILES @@ -1,9 +1,9 @@ myFile.sample -src/org/openapitools/api/PetApi.sample -src/org/openapitools/api/StoreApi.sample -src/org/openapitools/api/UserApi.sample -src/org/openapitools/model/Category.sample -src/org/openapitools/model/Order.sample -src/org/openapitools/model/Pet.sample -src/org/openapitools/model/Tag.sample -src/org/openapitools/model/User.sample +src/org/openapijsonschematools/api/PetApi.sample +src/org/openapijsonschematools/api/StoreApi.sample +src/org/openapijsonschematools/api/UserApi.sample +src/org/openapijsonschematools/model/Category.sample +src/org/openapijsonschematools/model/Order.sample +src/org/openapijsonschematools/model/Pet.sample +src/org/openapijsonschematools/model/Tag.sample +src/org/openapijsonschematools/model/User.sample diff --git a/samples/meta-codegen/usage/src/org/openapitools/api/PetApi.sample b/samples/meta-codegen/usage/src/org/openapitools/api/PetApi.sample index a5feebb745e..5e38135b643 100644 --- a/samples/meta-codegen/usage/src/org/openapitools/api/PetApi.sample +++ b/samples/meta-codegen/usage/src/org/openapitools/api/PetApi.sample @@ -5,7 +5,7 @@ # like such: # use the package from the `apiPackage` variable -package: org.openapitools.api +package: org.openapijsonschematools.api # operations block classname: PetApi diff --git a/samples/meta-codegen/usage/src/org/openapitools/api/StoreApi.sample b/samples/meta-codegen/usage/src/org/openapitools/api/StoreApi.sample index 4250607257b..6937568cad0 100644 --- a/samples/meta-codegen/usage/src/org/openapitools/api/StoreApi.sample +++ b/samples/meta-codegen/usage/src/org/openapitools/api/StoreApi.sample @@ -5,7 +5,7 @@ # like such: # use the package from the `apiPackage` variable -package: org.openapitools.api +package: org.openapijsonschematools.api # operations block classname: StoreApi diff --git a/samples/meta-codegen/usage/src/org/openapitools/api/UserApi.sample b/samples/meta-codegen/usage/src/org/openapitools/api/UserApi.sample index 3de0f7f4fcc..a209b05c19f 100644 --- a/samples/meta-codegen/usage/src/org/openapitools/api/UserApi.sample +++ b/samples/meta-codegen/usage/src/org/openapitools/api/UserApi.sample @@ -5,7 +5,7 @@ # like such: # use the package from the `apiPackage` variable -package: org.openapitools.api +package: org.openapijsonschematools.api # operations block classname: UserApi diff --git a/samples/openapi3/client/3_0_3_unit_test/python/.openapi-generator-ignore b/samples/openapi3/client/3_0_3_unit_test/python/.openapi-generator-ignore index 7484ee590a3..d24a2da8ae5 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/.openapi-generator-ignore +++ b/samples/openapi3/client/3_0_3_unit_test/python/.openapi-generator-ignore @@ -1,5 +1,5 @@ # OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator +# Generated by openapi-generator https://github.com/openapi-json-schema-tools/openapi-json-schema-generator # Use this file to prevent files from being overwritten by the generator. # The patterns follow closely to .gitignore or .dockerignore. diff --git a/samples/openapi3/client/3_0_3_unit_test/python/.openapi-generator/FILES b/samples/openapi3/client/3_0_3_unit_test/python/.openapi-generator/FILES index 76fb1cb914d..d7dfd52ba62 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/.openapi-generator/FILES +++ b/samples/openapi3/client/3_0_3_unit_test/python/.openapi-generator/FILES @@ -2,420 +2,2613 @@ .gitlab-ci.yml .travis.yml README.md -docs/apis/tags/AdditionalPropertiesApi.md -docs/apis/tags/AllOfApi.md -docs/apis/tags/AnyOfApi.md -docs/apis/tags/ContentTypeJsonApi.md -docs/apis/tags/DefaultApi.md -docs/apis/tags/EnumApi.md -docs/apis/tags/FormatApi.md -docs/apis/tags/ItemsApi.md -docs/apis/tags/MaxItemsApi.md -docs/apis/tags/MaxLengthApi.md -docs/apis/tags/MaxPropertiesApi.md -docs/apis/tags/MaximumApi.md -docs/apis/tags/MinItemsApi.md -docs/apis/tags/MinLengthApi.md -docs/apis/tags/MinPropertiesApi.md -docs/apis/tags/MinimumApi.md -docs/apis/tags/ModelNotApi.md -docs/apis/tags/MultipleOfApi.md -docs/apis/tags/OneOfApi.md -docs/apis/tags/OperationRequestBodyApi.md -docs/apis/tags/PathPostApi.md -docs/apis/tags/PatternApi.md -docs/apis/tags/PropertiesApi.md -docs/apis/tags/RefApi.md -docs/apis/tags/RequiredApi.md -docs/apis/tags/ResponseContentContentTypeSchemaApi.md -docs/apis/tags/TypeApi.md -docs/apis/tags/UniqueItemsApi.md -docs/models/AdditionalpropertiesAllowsASchemaWhichShouldValidate.md -docs/models/AdditionalpropertiesAreAllowedByDefault.md -docs/models/AdditionalpropertiesCanExistByItself.md -docs/models/AdditionalpropertiesShouldNotLookInApplicators.md -docs/models/Allof.md -docs/models/AllofCombinedWithAnyofOneof.md -docs/models/AllofSimpleTypes.md -docs/models/AllofWithBaseSchema.md -docs/models/AllofWithOneEmptySchema.md -docs/models/AllofWithTheFirstEmptySchema.md -docs/models/AllofWithTheLastEmptySchema.md -docs/models/AllofWithTwoEmptySchemas.md -docs/models/Anyof.md -docs/models/AnyofComplexTypes.md -docs/models/AnyofWithBaseSchema.md -docs/models/AnyofWithOneEmptySchema.md -docs/models/ArrayTypeMatchesArrays.md -docs/models/BooleanTypeMatchesBooleans.md -docs/models/ByInt.md -docs/models/ByNumber.md -docs/models/BySmallNumber.md -docs/models/DateTimeFormat.md -docs/models/EmailFormat.md -docs/models/EnumWith0DoesNotMatchFalse.md -docs/models/EnumWith1DoesNotMatchTrue.md -docs/models/EnumWithEscapedCharacters.md -docs/models/EnumWithFalseDoesNotMatch0.md -docs/models/EnumWithTrueDoesNotMatch1.md -docs/models/EnumsInProperties.md -docs/models/ForbiddenProperty.md -docs/models/HostnameFormat.md -docs/models/IntegerTypeMatchesIntegers.md -docs/models/InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf.md -docs/models/InvalidStringValueForDefault.md -docs/models/Ipv4Format.md -docs/models/Ipv6Format.md -docs/models/JsonPointerFormat.md -docs/models/MaximumValidation.md -docs/models/MaximumValidationWithUnsignedInteger.md -docs/models/MaxitemsValidation.md -docs/models/MaxlengthValidation.md -docs/models/Maxproperties0MeansTheObjectIsEmpty.md -docs/models/MaxpropertiesValidation.md -docs/models/MinimumValidation.md -docs/models/MinimumValidationWithSignedInteger.md -docs/models/MinitemsValidation.md -docs/models/MinlengthValidation.md -docs/models/MinpropertiesValidation.md -docs/models/ModelNot.md -docs/models/NestedAllofToCheckValidationSemantics.md -docs/models/NestedAnyofToCheckValidationSemantics.md -docs/models/NestedItems.md -docs/models/NestedOneofToCheckValidationSemantics.md -docs/models/NotMoreComplexSchema.md -docs/models/NulCharactersInStrings.md -docs/models/NullTypeMatchesOnlyTheNullObject.md -docs/models/NumberTypeMatchesNumbers.md -docs/models/ObjectPropertiesValidation.md -docs/models/Oneof.md -docs/models/OneofComplexTypes.md -docs/models/OneofWithBaseSchema.md -docs/models/OneofWithEmptySchema.md -docs/models/OneofWithRequired.md -docs/models/PatternIsNotAnchored.md -docs/models/PatternValidation.md -docs/models/PropertiesWithEscapedCharacters.md -docs/models/PropertyNamedRefThatIsNotAReference.md -docs/models/RefInAdditionalproperties.md -docs/models/RefInAllof.md -docs/models/RefInAnyof.md -docs/models/RefInItems.md -docs/models/RefInNot.md -docs/models/RefInOneof.md -docs/models/RefInProperty.md -docs/models/RequiredDefaultValidation.md -docs/models/RequiredValidation.md -docs/models/RequiredWithEmptyArray.md -docs/models/RequiredWithEscapedCharacters.md -docs/models/SimpleEnumValidation.md -docs/models/StringTypeMatchesStrings.md -docs/models/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.md -docs/models/UniqueitemsFalseValidation.md -docs/models/UniqueitemsValidation.md -docs/models/UriFormat.md -docs/models/UriReferenceFormat.md -docs/models/UriTemplateFormat.md +docs/apis/tags/_not_api.md +docs/apis/tags/additional_properties_api.md +docs/apis/tags/all_of_api.md +docs/apis/tags/any_of_api.md +docs/apis/tags/content_type_json_api.md +docs/apis/tags/default_api.md +docs/apis/tags/enum_api.md +docs/apis/tags/format_api.md +docs/apis/tags/items_api.md +docs/apis/tags/max_items_api.md +docs/apis/tags/max_length_api.md +docs/apis/tags/max_properties_api.md +docs/apis/tags/maximum_api.md +docs/apis/tags/min_items_api.md +docs/apis/tags/min_length_api.md +docs/apis/tags/min_properties_api.md +docs/apis/tags/minimum_api.md +docs/apis/tags/multiple_of_api.md +docs/apis/tags/one_of_api.md +docs/apis/tags/operation_request_body_api.md +docs/apis/tags/path_post_api.md +docs/apis/tags/pattern_api.md +docs/apis/tags/properties_api.md +docs/apis/tags/ref_api.md +docs/apis/tags/required_api.md +docs/apis/tags/response_content_content_type_schema_api.md +docs/apis/tags/type_api.md +docs/apis/tags/unique_items_api.md +docs/components/schema/_not.md +docs/components/schema/additionalproperties_allows_a_schema_which_should_validate.md +docs/components/schema/additionalproperties_are_allowed_by_default.md +docs/components/schema/additionalproperties_can_exist_by_itself.md +docs/components/schema/additionalproperties_should_not_look_in_applicators.md +docs/components/schema/allof.md +docs/components/schema/allof_combined_with_anyof_oneof.md +docs/components/schema/allof_simple_types.md +docs/components/schema/allof_with_base_schema.md +docs/components/schema/allof_with_one_empty_schema.md +docs/components/schema/allof_with_the_first_empty_schema.md +docs/components/schema/allof_with_the_last_empty_schema.md +docs/components/schema/allof_with_two_empty_schemas.md +docs/components/schema/anyof.md +docs/components/schema/anyof_complex_types.md +docs/components/schema/anyof_with_base_schema.md +docs/components/schema/anyof_with_one_empty_schema.md +docs/components/schema/array_type_matches_arrays.md +docs/components/schema/boolean_type_matches_booleans.md +docs/components/schema/by_int.md +docs/components/schema/by_number.md +docs/components/schema/by_small_number.md +docs/components/schema/date_time_format.md +docs/components/schema/email_format.md +docs/components/schema/enum_with0_does_not_match_false.md +docs/components/schema/enum_with1_does_not_match_true.md +docs/components/schema/enum_with_escaped_characters.md +docs/components/schema/enum_with_false_does_not_match0.md +docs/components/schema/enum_with_true_does_not_match1.md +docs/components/schema/enums_in_properties.md +docs/components/schema/forbidden_property.md +docs/components/schema/hostname_format.md +docs/components/schema/integer_type_matches_integers.md +docs/components/schema/invalid_instance_should_not_raise_error_when_float_division_inf.md +docs/components/schema/invalid_string_value_for_default.md +docs/components/schema/ipv4_format.md +docs/components/schema/ipv6_format.md +docs/components/schema/json_pointer_format.md +docs/components/schema/maximum_validation.md +docs/components/schema/maximum_validation_with_unsigned_integer.md +docs/components/schema/maxitems_validation.md +docs/components/schema/maxlength_validation.md +docs/components/schema/maxproperties0_means_the_object_is_empty.md +docs/components/schema/maxproperties_validation.md +docs/components/schema/minimum_validation.md +docs/components/schema/minimum_validation_with_signed_integer.md +docs/components/schema/minitems_validation.md +docs/components/schema/minlength_validation.md +docs/components/schema/minproperties_validation.md +docs/components/schema/nested_allof_to_check_validation_semantics.md +docs/components/schema/nested_anyof_to_check_validation_semantics.md +docs/components/schema/nested_items.md +docs/components/schema/nested_oneof_to_check_validation_semantics.md +docs/components/schema/not_more_complex_schema.md +docs/components/schema/nul_characters_in_strings.md +docs/components/schema/null_type_matches_only_the_null_object.md +docs/components/schema/number_type_matches_numbers.md +docs/components/schema/object_properties_validation.md +docs/components/schema/object_type_matches_objects.md +docs/components/schema/oneof.md +docs/components/schema/oneof_complex_types.md +docs/components/schema/oneof_with_base_schema.md +docs/components/schema/oneof_with_empty_schema.md +docs/components/schema/oneof_with_required.md +docs/components/schema/pattern_is_not_anchored.md +docs/components/schema/pattern_validation.md +docs/components/schema/properties_with_escaped_characters.md +docs/components/schema/property_named_ref_that_is_not_a_reference.md +docs/components/schema/ref_in_additionalproperties.md +docs/components/schema/ref_in_allof.md +docs/components/schema/ref_in_anyof.md +docs/components/schema/ref_in_items.md +docs/components/schema/ref_in_not.md +docs/components/schema/ref_in_oneof.md +docs/components/schema/ref_in_property.md +docs/components/schema/required_default_validation.md +docs/components/schema/required_validation.md +docs/components/schema/required_with_empty_array.md +docs/components/schema/required_with_escaped_characters.md +docs/components/schema/simple_enum_validation.md +docs/components/schema/string_type_matches_strings.md +docs/components/schema/the_default_keyword_does_not_do_anything_if_the_property_is_missing.md +docs/components/schema/uniqueitems_false_validation.md +docs/components/schema/uniqueitems_validation.md +docs/components/schema/uri_format.md +docs/components/schema/uri_reference_format.md +docs/components/schema/uri_template_format.md +docs/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post.md +docs/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post.md +docs/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post.md +docs/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post.md +docs/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post.md +docs/paths/request_body_post_allof_request_body/post.md +docs/paths/request_body_post_allof_simple_types_request_body/post.md +docs/paths/request_body_post_allof_with_base_schema_request_body/post.md +docs/paths/request_body_post_allof_with_one_empty_schema_request_body/post.md +docs/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post.md +docs/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post.md +docs/paths/request_body_post_allof_with_two_empty_schemas_request_body/post.md +docs/paths/request_body_post_anyof_complex_types_request_body/post.md +docs/paths/request_body_post_anyof_request_body/post.md +docs/paths/request_body_post_anyof_with_base_schema_request_body/post.md +docs/paths/request_body_post_anyof_with_one_empty_schema_request_body/post.md +docs/paths/request_body_post_array_type_matches_arrays_request_body/post.md +docs/paths/request_body_post_boolean_type_matches_booleans_request_body/post.md +docs/paths/request_body_post_by_int_request_body/post.md +docs/paths/request_body_post_by_number_request_body/post.md +docs/paths/request_body_post_by_small_number_request_body/post.md +docs/paths/request_body_post_date_time_format_request_body/post.md +docs/paths/request_body_post_email_format_request_body/post.md +docs/paths/request_body_post_enum_with0_does_not_match_false_request_body/post.md +docs/paths/request_body_post_enum_with1_does_not_match_true_request_body/post.md +docs/paths/request_body_post_enum_with_escaped_characters_request_body/post.md +docs/paths/request_body_post_enum_with_false_does_not_match0_request_body/post.md +docs/paths/request_body_post_enum_with_true_does_not_match1_request_body/post.md +docs/paths/request_body_post_enums_in_properties_request_body/post.md +docs/paths/request_body_post_forbidden_property_request_body/post.md +docs/paths/request_body_post_hostname_format_request_body/post.md +docs/paths/request_body_post_integer_type_matches_integers_request_body/post.md +docs/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post.md +docs/paths/request_body_post_invalid_string_value_for_default_request_body/post.md +docs/paths/request_body_post_ipv4_format_request_body/post.md +docs/paths/request_body_post_ipv6_format_request_body/post.md +docs/paths/request_body_post_json_pointer_format_request_body/post.md +docs/paths/request_body_post_maximum_validation_request_body/post.md +docs/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post.md +docs/paths/request_body_post_maxitems_validation_request_body/post.md +docs/paths/request_body_post_maxlength_validation_request_body/post.md +docs/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post.md +docs/paths/request_body_post_maxproperties_validation_request_body/post.md +docs/paths/request_body_post_minimum_validation_request_body/post.md +docs/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post.md +docs/paths/request_body_post_minitems_validation_request_body/post.md +docs/paths/request_body_post_minlength_validation_request_body/post.md +docs/paths/request_body_post_minproperties_validation_request_body/post.md +docs/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post.md +docs/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post.md +docs/paths/request_body_post_nested_items_request_body/post.md +docs/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post.md +docs/paths/request_body_post_not_more_complex_schema_request_body/post.md +docs/paths/request_body_post_not_request_body/post.md +docs/paths/request_body_post_nul_characters_in_strings_request_body/post.md +docs/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post.md +docs/paths/request_body_post_number_type_matches_numbers_request_body/post.md +docs/paths/request_body_post_object_properties_validation_request_body/post.md +docs/paths/request_body_post_object_type_matches_objects_request_body/post.md +docs/paths/request_body_post_oneof_complex_types_request_body/post.md +docs/paths/request_body_post_oneof_request_body/post.md +docs/paths/request_body_post_oneof_with_base_schema_request_body/post.md +docs/paths/request_body_post_oneof_with_empty_schema_request_body/post.md +docs/paths/request_body_post_oneof_with_required_request_body/post.md +docs/paths/request_body_post_pattern_is_not_anchored_request_body/post.md +docs/paths/request_body_post_pattern_validation_request_body/post.md +docs/paths/request_body_post_properties_with_escaped_characters_request_body/post.md +docs/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post.md +docs/paths/request_body_post_ref_in_additionalproperties_request_body/post.md +docs/paths/request_body_post_ref_in_allof_request_body/post.md +docs/paths/request_body_post_ref_in_anyof_request_body/post.md +docs/paths/request_body_post_ref_in_items_request_body/post.md +docs/paths/request_body_post_ref_in_not_request_body/post.md +docs/paths/request_body_post_ref_in_oneof_request_body/post.md +docs/paths/request_body_post_ref_in_property_request_body/post.md +docs/paths/request_body_post_required_default_validation_request_body/post.md +docs/paths/request_body_post_required_validation_request_body/post.md +docs/paths/request_body_post_required_with_empty_array_request_body/post.md +docs/paths/request_body_post_required_with_escaped_characters_request_body/post.md +docs/paths/request_body_post_simple_enum_validation_request_body/post.md +docs/paths/request_body_post_string_type_matches_strings_request_body/post.md +docs/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post.md +docs/paths/request_body_post_uniqueitems_false_validation_request_body/post.md +docs/paths/request_body_post_uniqueitems_validation_request_body/post.md +docs/paths/request_body_post_uri_format_request_body/post.md +docs/paths/request_body_post_uri_reference_format_request_body/post.md +docs/paths/request_body_post_uri_template_format_request_body/post.md +docs/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post.md +docs/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post.md +docs/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post.md +docs/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post.md +docs/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post.md +docs/paths/response_body_post_allof_response_body_for_content_types/post.md +docs/paths/response_body_post_allof_simple_types_response_body_for_content_types/post.md +docs/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post.md +docs/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post.md +docs/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post.md +docs/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post.md +docs/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post.md +docs/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post.md +docs/paths/response_body_post_anyof_response_body_for_content_types/post.md +docs/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post.md +docs/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post.md +docs/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post.md +docs/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post.md +docs/paths/response_body_post_by_int_response_body_for_content_types/post.md +docs/paths/response_body_post_by_number_response_body_for_content_types/post.md +docs/paths/response_body_post_by_small_number_response_body_for_content_types/post.md +docs/paths/response_body_post_date_time_format_response_body_for_content_types/post.md +docs/paths/response_body_post_email_format_response_body_for_content_types/post.md +docs/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post.md +docs/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post.md +docs/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post.md +docs/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post.md +docs/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post.md +docs/paths/response_body_post_enums_in_properties_response_body_for_content_types/post.md +docs/paths/response_body_post_forbidden_property_response_body_for_content_types/post.md +docs/paths/response_body_post_hostname_format_response_body_for_content_types/post.md +docs/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post.md +docs/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post.md +docs/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post.md +docs/paths/response_body_post_ipv4_format_response_body_for_content_types/post.md +docs/paths/response_body_post_ipv6_format_response_body_for_content_types/post.md +docs/paths/response_body_post_json_pointer_format_response_body_for_content_types/post.md +docs/paths/response_body_post_maximum_validation_response_body_for_content_types/post.md +docs/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post.md +docs/paths/response_body_post_maxitems_validation_response_body_for_content_types/post.md +docs/paths/response_body_post_maxlength_validation_response_body_for_content_types/post.md +docs/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post.md +docs/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post.md +docs/paths/response_body_post_minimum_validation_response_body_for_content_types/post.md +docs/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post.md +docs/paths/response_body_post_minitems_validation_response_body_for_content_types/post.md +docs/paths/response_body_post_minlength_validation_response_body_for_content_types/post.md +docs/paths/response_body_post_minproperties_validation_response_body_for_content_types/post.md +docs/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post.md +docs/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post.md +docs/paths/response_body_post_nested_items_response_body_for_content_types/post.md +docs/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post.md +docs/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post.md +docs/paths/response_body_post_not_response_body_for_content_types/post.md +docs/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post.md +docs/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post.md +docs/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post.md +docs/paths/response_body_post_object_properties_validation_response_body_for_content_types/post.md +docs/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post.md +docs/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post.md +docs/paths/response_body_post_oneof_response_body_for_content_types/post.md +docs/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post.md +docs/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post.md +docs/paths/response_body_post_oneof_with_required_response_body_for_content_types/post.md +docs/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post.md +docs/paths/response_body_post_pattern_validation_response_body_for_content_types/post.md +docs/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post.md +docs/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post.md +docs/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post.md +docs/paths/response_body_post_ref_in_allof_response_body_for_content_types/post.md +docs/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post.md +docs/paths/response_body_post_ref_in_items_response_body_for_content_types/post.md +docs/paths/response_body_post_ref_in_not_response_body_for_content_types/post.md +docs/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post.md +docs/paths/response_body_post_ref_in_property_response_body_for_content_types/post.md +docs/paths/response_body_post_required_default_validation_response_body_for_content_types/post.md +docs/paths/response_body_post_required_validation_response_body_for_content_types/post.md +docs/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post.md +docs/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post.md +docs/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post.md +docs/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post.md +docs/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post.md +docs/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post.md +docs/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post.md +docs/paths/response_body_post_uri_format_response_body_for_content_types/post.md +docs/paths/response_body_post_uri_reference_format_response_body_for_content_types/post.md +docs/paths/response_body_post_uri_template_format_response_body_for_content_types/post.md +docs/servers/server_0.md git_push.sh -requirements.txt -setup.cfg -setup.py +migration_2_0_0.md +migration_other_python_generators.md +pyproject.toml +src/unit_test_api/__init__.py +src/unit_test_api/api_client.py +src/unit_test_api/apis/__init__.py +src/unit_test_api/apis/path_to_api.py +src/unit_test_api/apis/paths/__init__.py +src/unit_test_api/apis/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body.py +src/unit_test_api/apis/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body.py +src/unit_test_api/apis/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body.py +src/unit_test_api/apis/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body.py +src/unit_test_api/apis/paths/request_body_post_allof_combined_with_anyof_oneof_request_body.py +src/unit_test_api/apis/paths/request_body_post_allof_request_body.py +src/unit_test_api/apis/paths/request_body_post_allof_simple_types_request_body.py +src/unit_test_api/apis/paths/request_body_post_allof_with_base_schema_request_body.py +src/unit_test_api/apis/paths/request_body_post_allof_with_one_empty_schema_request_body.py +src/unit_test_api/apis/paths/request_body_post_allof_with_the_first_empty_schema_request_body.py +src/unit_test_api/apis/paths/request_body_post_allof_with_the_last_empty_schema_request_body.py +src/unit_test_api/apis/paths/request_body_post_allof_with_two_empty_schemas_request_body.py +src/unit_test_api/apis/paths/request_body_post_anyof_complex_types_request_body.py +src/unit_test_api/apis/paths/request_body_post_anyof_request_body.py +src/unit_test_api/apis/paths/request_body_post_anyof_with_base_schema_request_body.py +src/unit_test_api/apis/paths/request_body_post_anyof_with_one_empty_schema_request_body.py +src/unit_test_api/apis/paths/request_body_post_array_type_matches_arrays_request_body.py +src/unit_test_api/apis/paths/request_body_post_boolean_type_matches_booleans_request_body.py +src/unit_test_api/apis/paths/request_body_post_by_int_request_body.py +src/unit_test_api/apis/paths/request_body_post_by_number_request_body.py +src/unit_test_api/apis/paths/request_body_post_by_small_number_request_body.py +src/unit_test_api/apis/paths/request_body_post_date_time_format_request_body.py +src/unit_test_api/apis/paths/request_body_post_email_format_request_body.py +src/unit_test_api/apis/paths/request_body_post_enum_with0_does_not_match_false_request_body.py +src/unit_test_api/apis/paths/request_body_post_enum_with1_does_not_match_true_request_body.py +src/unit_test_api/apis/paths/request_body_post_enum_with_escaped_characters_request_body.py +src/unit_test_api/apis/paths/request_body_post_enum_with_false_does_not_match0_request_body.py +src/unit_test_api/apis/paths/request_body_post_enum_with_true_does_not_match1_request_body.py +src/unit_test_api/apis/paths/request_body_post_enums_in_properties_request_body.py +src/unit_test_api/apis/paths/request_body_post_forbidden_property_request_body.py +src/unit_test_api/apis/paths/request_body_post_hostname_format_request_body.py +src/unit_test_api/apis/paths/request_body_post_integer_type_matches_integers_request_body.py +src/unit_test_api/apis/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body.py +src/unit_test_api/apis/paths/request_body_post_invalid_string_value_for_default_request_body.py +src/unit_test_api/apis/paths/request_body_post_ipv4_format_request_body.py +src/unit_test_api/apis/paths/request_body_post_ipv6_format_request_body.py +src/unit_test_api/apis/paths/request_body_post_json_pointer_format_request_body.py +src/unit_test_api/apis/paths/request_body_post_maximum_validation_request_body.py +src/unit_test_api/apis/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body.py +src/unit_test_api/apis/paths/request_body_post_maxitems_validation_request_body.py +src/unit_test_api/apis/paths/request_body_post_maxlength_validation_request_body.py +src/unit_test_api/apis/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body.py +src/unit_test_api/apis/paths/request_body_post_maxproperties_validation_request_body.py +src/unit_test_api/apis/paths/request_body_post_minimum_validation_request_body.py +src/unit_test_api/apis/paths/request_body_post_minimum_validation_with_signed_integer_request_body.py +src/unit_test_api/apis/paths/request_body_post_minitems_validation_request_body.py +src/unit_test_api/apis/paths/request_body_post_minlength_validation_request_body.py +src/unit_test_api/apis/paths/request_body_post_minproperties_validation_request_body.py +src/unit_test_api/apis/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body.py +src/unit_test_api/apis/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body.py +src/unit_test_api/apis/paths/request_body_post_nested_items_request_body.py +src/unit_test_api/apis/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body.py +src/unit_test_api/apis/paths/request_body_post_not_more_complex_schema_request_body.py +src/unit_test_api/apis/paths/request_body_post_not_request_body.py +src/unit_test_api/apis/paths/request_body_post_nul_characters_in_strings_request_body.py +src/unit_test_api/apis/paths/request_body_post_null_type_matches_only_the_null_object_request_body.py +src/unit_test_api/apis/paths/request_body_post_number_type_matches_numbers_request_body.py +src/unit_test_api/apis/paths/request_body_post_object_properties_validation_request_body.py +src/unit_test_api/apis/paths/request_body_post_object_type_matches_objects_request_body.py +src/unit_test_api/apis/paths/request_body_post_oneof_complex_types_request_body.py +src/unit_test_api/apis/paths/request_body_post_oneof_request_body.py +src/unit_test_api/apis/paths/request_body_post_oneof_with_base_schema_request_body.py +src/unit_test_api/apis/paths/request_body_post_oneof_with_empty_schema_request_body.py +src/unit_test_api/apis/paths/request_body_post_oneof_with_required_request_body.py +src/unit_test_api/apis/paths/request_body_post_pattern_is_not_anchored_request_body.py +src/unit_test_api/apis/paths/request_body_post_pattern_validation_request_body.py +src/unit_test_api/apis/paths/request_body_post_properties_with_escaped_characters_request_body.py +src/unit_test_api/apis/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body.py +src/unit_test_api/apis/paths/request_body_post_ref_in_additionalproperties_request_body.py +src/unit_test_api/apis/paths/request_body_post_ref_in_allof_request_body.py +src/unit_test_api/apis/paths/request_body_post_ref_in_anyof_request_body.py +src/unit_test_api/apis/paths/request_body_post_ref_in_items_request_body.py +src/unit_test_api/apis/paths/request_body_post_ref_in_not_request_body.py +src/unit_test_api/apis/paths/request_body_post_ref_in_oneof_request_body.py +src/unit_test_api/apis/paths/request_body_post_ref_in_property_request_body.py +src/unit_test_api/apis/paths/request_body_post_required_default_validation_request_body.py +src/unit_test_api/apis/paths/request_body_post_required_validation_request_body.py +src/unit_test_api/apis/paths/request_body_post_required_with_empty_array_request_body.py +src/unit_test_api/apis/paths/request_body_post_required_with_escaped_characters_request_body.py +src/unit_test_api/apis/paths/request_body_post_simple_enum_validation_request_body.py +src/unit_test_api/apis/paths/request_body_post_string_type_matches_strings_request_body.py +src/unit_test_api/apis/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.py +src/unit_test_api/apis/paths/request_body_post_uniqueitems_false_validation_request_body.py +src/unit_test_api/apis/paths/request_body_post_uniqueitems_validation_request_body.py +src/unit_test_api/apis/paths/request_body_post_uri_format_request_body.py +src/unit_test_api/apis/paths/request_body_post_uri_reference_format_request_body.py +src/unit_test_api/apis/paths/request_body_post_uri_template_format_request_body.py +src/unit_test_api/apis/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_allof_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_allof_simple_types_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_allof_with_base_schema_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_anyof_complex_types_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_anyof_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_by_int_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_by_number_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_by_small_number_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_date_time_format_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_email_format_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_enums_in_properties_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_forbidden_property_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_hostname_format_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_ipv4_format_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_ipv6_format_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_json_pointer_format_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_maximum_validation_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_maxitems_validation_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_maxlength_validation_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_maxproperties_validation_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_minimum_validation_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_minitems_validation_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_minlength_validation_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_minproperties_validation_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_nested_items_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_not_more_complex_schema_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_not_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_object_properties_validation_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_object_type_matches_objects_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_oneof_complex_types_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_oneof_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_oneof_with_required_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_pattern_validation_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_ref_in_allof_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_ref_in_anyof_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_ref_in_items_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_ref_in_not_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_ref_in_oneof_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_ref_in_property_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_required_default_validation_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_required_validation_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_required_with_empty_array_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_simple_enum_validation_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_string_type_matches_strings_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_uniqueitems_validation_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_uri_format_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_uri_reference_format_response_body_for_content_types.py +src/unit_test_api/apis/paths/response_body_post_uri_template_format_response_body_for_content_types.py +src/unit_test_api/apis/tag_to_api.py +src/unit_test_api/apis/tags/__init__.py +src/unit_test_api/apis/tags/_not_api.py +src/unit_test_api/apis/tags/additional_properties_api.py +src/unit_test_api/apis/tags/all_of_api.py +src/unit_test_api/apis/tags/any_of_api.py +src/unit_test_api/apis/tags/content_type_json_api.py +src/unit_test_api/apis/tags/default_api.py +src/unit_test_api/apis/tags/enum_api.py +src/unit_test_api/apis/tags/format_api.py +src/unit_test_api/apis/tags/items_api.py +src/unit_test_api/apis/tags/max_items_api.py +src/unit_test_api/apis/tags/max_length_api.py +src/unit_test_api/apis/tags/max_properties_api.py +src/unit_test_api/apis/tags/maximum_api.py +src/unit_test_api/apis/tags/min_items_api.py +src/unit_test_api/apis/tags/min_length_api.py +src/unit_test_api/apis/tags/min_properties_api.py +src/unit_test_api/apis/tags/minimum_api.py +src/unit_test_api/apis/tags/multiple_of_api.py +src/unit_test_api/apis/tags/one_of_api.py +src/unit_test_api/apis/tags/operation_request_body_api.py +src/unit_test_api/apis/tags/path_post_api.py +src/unit_test_api/apis/tags/pattern_api.py +src/unit_test_api/apis/tags/properties_api.py +src/unit_test_api/apis/tags/ref_api.py +src/unit_test_api/apis/tags/required_api.py +src/unit_test_api/apis/tags/response_content_content_type_schema_api.py +src/unit_test_api/apis/tags/type_api.py +src/unit_test_api/apis/tags/unique_items_api.py +src/unit_test_api/components/__init__.py +src/unit_test_api/components/schema/__init__.py +src/unit_test_api/components/schema/_not.py +src/unit_test_api/components/schema/additionalproperties_allows_a_schema_which_should_validate.py +src/unit_test_api/components/schema/additionalproperties_are_allowed_by_default.py +src/unit_test_api/components/schema/additionalproperties_can_exist_by_itself.py +src/unit_test_api/components/schema/additionalproperties_should_not_look_in_applicators.py +src/unit_test_api/components/schema/allof.py +src/unit_test_api/components/schema/allof_combined_with_anyof_oneof.py +src/unit_test_api/components/schema/allof_simple_types.py +src/unit_test_api/components/schema/allof_with_base_schema.py +src/unit_test_api/components/schema/allof_with_one_empty_schema.py +src/unit_test_api/components/schema/allof_with_the_first_empty_schema.py +src/unit_test_api/components/schema/allof_with_the_last_empty_schema.py +src/unit_test_api/components/schema/allof_with_two_empty_schemas.py +src/unit_test_api/components/schema/anyof.py +src/unit_test_api/components/schema/anyof_complex_types.py +src/unit_test_api/components/schema/anyof_with_base_schema.py +src/unit_test_api/components/schema/anyof_with_one_empty_schema.py +src/unit_test_api/components/schema/array_type_matches_arrays.py +src/unit_test_api/components/schema/boolean_type_matches_booleans.py +src/unit_test_api/components/schema/by_int.py +src/unit_test_api/components/schema/by_number.py +src/unit_test_api/components/schema/by_small_number.py +src/unit_test_api/components/schema/date_time_format.py +src/unit_test_api/components/schema/email_format.py +src/unit_test_api/components/schema/enum_with0_does_not_match_false.py +src/unit_test_api/components/schema/enum_with1_does_not_match_true.py +src/unit_test_api/components/schema/enum_with_escaped_characters.py +src/unit_test_api/components/schema/enum_with_false_does_not_match0.py +src/unit_test_api/components/schema/enum_with_true_does_not_match1.py +src/unit_test_api/components/schema/enums_in_properties.py +src/unit_test_api/components/schema/forbidden_property.py +src/unit_test_api/components/schema/hostname_format.py +src/unit_test_api/components/schema/integer_type_matches_integers.py +src/unit_test_api/components/schema/invalid_instance_should_not_raise_error_when_float_division_inf.py +src/unit_test_api/components/schema/invalid_string_value_for_default.py +src/unit_test_api/components/schema/ipv4_format.py +src/unit_test_api/components/schema/ipv6_format.py +src/unit_test_api/components/schema/json_pointer_format.py +src/unit_test_api/components/schema/maximum_validation.py +src/unit_test_api/components/schema/maximum_validation_with_unsigned_integer.py +src/unit_test_api/components/schema/maxitems_validation.py +src/unit_test_api/components/schema/maxlength_validation.py +src/unit_test_api/components/schema/maxproperties0_means_the_object_is_empty.py +src/unit_test_api/components/schema/maxproperties_validation.py +src/unit_test_api/components/schema/minimum_validation.py +src/unit_test_api/components/schema/minimum_validation_with_signed_integer.py +src/unit_test_api/components/schema/minitems_validation.py +src/unit_test_api/components/schema/minlength_validation.py +src/unit_test_api/components/schema/minproperties_validation.py +src/unit_test_api/components/schema/nested_allof_to_check_validation_semantics.py +src/unit_test_api/components/schema/nested_anyof_to_check_validation_semantics.py +src/unit_test_api/components/schema/nested_items.py +src/unit_test_api/components/schema/nested_oneof_to_check_validation_semantics.py +src/unit_test_api/components/schema/not_more_complex_schema.py +src/unit_test_api/components/schema/nul_characters_in_strings.py +src/unit_test_api/components/schema/null_type_matches_only_the_null_object.py +src/unit_test_api/components/schema/number_type_matches_numbers.py +src/unit_test_api/components/schema/object_properties_validation.py +src/unit_test_api/components/schema/object_type_matches_objects.py +src/unit_test_api/components/schema/oneof.py +src/unit_test_api/components/schema/oneof_complex_types.py +src/unit_test_api/components/schema/oneof_with_base_schema.py +src/unit_test_api/components/schema/oneof_with_empty_schema.py +src/unit_test_api/components/schema/oneof_with_required.py +src/unit_test_api/components/schema/pattern_is_not_anchored.py +src/unit_test_api/components/schema/pattern_validation.py +src/unit_test_api/components/schema/properties_with_escaped_characters.py +src/unit_test_api/components/schema/property_named_ref_that_is_not_a_reference.py +src/unit_test_api/components/schema/ref_in_additionalproperties.py +src/unit_test_api/components/schema/ref_in_allof.py +src/unit_test_api/components/schema/ref_in_anyof.py +src/unit_test_api/components/schema/ref_in_items.py +src/unit_test_api/components/schema/ref_in_not.py +src/unit_test_api/components/schema/ref_in_oneof.py +src/unit_test_api/components/schema/ref_in_property.py +src/unit_test_api/components/schema/required_default_validation.py +src/unit_test_api/components/schema/required_validation.py +src/unit_test_api/components/schema/required_with_empty_array.py +src/unit_test_api/components/schema/required_with_escaped_characters.py +src/unit_test_api/components/schema/simple_enum_validation.py +src/unit_test_api/components/schema/string_type_matches_strings.py +src/unit_test_api/components/schema/the_default_keyword_does_not_do_anything_if_the_property_is_missing.py +src/unit_test_api/components/schema/uniqueitems_false_validation.py +src/unit_test_api/components/schema/uniqueitems_validation.py +src/unit_test_api/components/schema/uri_format.py +src/unit_test_api/components/schema/uri_reference_format.py +src/unit_test_api/components/schema/uri_template_format.py +src/unit_test_api/components/schemas/__init__.py +src/unit_test_api/configurations/__init__.py +src/unit_test_api/configurations/api_configuration.py +src/unit_test_api/configurations/schema_configuration.py +src/unit_test_api/exceptions.py +src/unit_test_api/paths/__init__.py +src/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/__init__.py +src/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/__init__.py +src/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/__init__.py +src/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/__init__.py +src/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/__init__.py +src/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_allof_request_body/__init__.py +src/unit_test_api/paths/request_body_post_allof_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_allof_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_allof_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_allof_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_allof_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_allof_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_allof_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_allof_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_allof_simple_types_request_body/__init__.py +src/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/__init__.py +src/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/__init__.py +src/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/__init__.py +src/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/__init__.py +src/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/__init__.py +src/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/__init__.py +src/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_anyof_request_body/__init__.py +src/unit_test_api/paths/request_body_post_anyof_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_anyof_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_anyof_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_anyof_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_anyof_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_anyof_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_anyof_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_anyof_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/__init__.py +src/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/__init__.py +src/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/__init__.py +src/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/__init__.py +src/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_by_int_request_body/__init__.py +src/unit_test_api/paths/request_body_post_by_int_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_by_int_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_by_int_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_by_int_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_by_int_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_by_int_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_by_int_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_by_int_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_by_number_request_body/__init__.py +src/unit_test_api/paths/request_body_post_by_number_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_by_number_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_by_number_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_by_number_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_by_number_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_by_number_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_by_number_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_by_number_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_by_small_number_request_body/__init__.py +src/unit_test_api/paths/request_body_post_by_small_number_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_by_small_number_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_by_small_number_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_by_small_number_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_by_small_number_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_by_small_number_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_by_small_number_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_by_small_number_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_date_time_format_request_body/__init__.py +src/unit_test_api/paths/request_body_post_date_time_format_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_date_time_format_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_date_time_format_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_date_time_format_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_date_time_format_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_date_time_format_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_date_time_format_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_date_time_format_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_email_format_request_body/__init__.py +src/unit_test_api/paths/request_body_post_email_format_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_email_format_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_email_format_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_email_format_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_email_format_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_email_format_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_email_format_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_email_format_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/__init__.py +src/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/__init__.py +src/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/__init__.py +src/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/__init__.py +src/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/__init__.py +src/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_enums_in_properties_request_body/__init__.py +src/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_forbidden_property_request_body/__init__.py +src/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_hostname_format_request_body/__init__.py +src/unit_test_api/paths/request_body_post_hostname_format_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_hostname_format_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_hostname_format_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_hostname_format_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_hostname_format_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_hostname_format_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_hostname_format_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_hostname_format_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/__init__.py +src/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/__init__.py +src/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/__init__.py +src/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_ipv4_format_request_body/__init__.py +src/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_ipv6_format_request_body/__init__.py +src/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_json_pointer_format_request_body/__init__.py +src/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_maximum_validation_request_body/__init__.py +src/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/__init__.py +src/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_maxitems_validation_request_body/__init__.py +src/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_maxlength_validation_request_body/__init__.py +src/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/__init__.py +src/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/__init__.py +src/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_minimum_validation_request_body/__init__.py +src/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/__init__.py +src/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_minitems_validation_request_body/__init__.py +src/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_minlength_validation_request_body/__init__.py +src/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_minproperties_validation_request_body/__init__.py +src/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/__init__.py +src/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/__init__.py +src/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_nested_items_request_body/__init__.py +src/unit_test_api/paths/request_body_post_nested_items_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_nested_items_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_nested_items_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_nested_items_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_nested_items_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_nested_items_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_nested_items_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_nested_items_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/__init__.py +src/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/__init__.py +src/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_not_request_body/__init__.py +src/unit_test_api/paths/request_body_post_not_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_not_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_not_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_not_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_not_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_not_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_not_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_not_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/__init__.py +src/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/__init__.py +src/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/__init__.py +src/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_object_properties_validation_request_body/__init__.py +src/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/__init__.py +src/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/__init__.py +src/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_oneof_request_body/__init__.py +src/unit_test_api/paths/request_body_post_oneof_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_oneof_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_oneof_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_oneof_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_oneof_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_oneof_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_oneof_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_oneof_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/__init__.py +src/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/__init__.py +src/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_oneof_with_required_request_body/__init__.py +src/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/__init__.py +src/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_pattern_validation_request_body/__init__.py +src/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/__init__.py +src/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/__init__.py +src/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/__init__.py +src/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_ref_in_allof_request_body/__init__.py +src/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/__init__.py +src/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_ref_in_items_request_body/__init__.py +src/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_ref_in_not_request_body/__init__.py +src/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/__init__.py +src/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_ref_in_property_request_body/__init__.py +src/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_required_default_validation_request_body/__init__.py +src/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_required_validation_request_body/__init__.py +src/unit_test_api/paths/request_body_post_required_validation_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_required_validation_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_required_validation_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_required_validation_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_required_validation_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_required_validation_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_required_validation_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_required_validation_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/__init__.py +src/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/__init__.py +src/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/__init__.py +src/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/__init__.py +src/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/__init__.py +src/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/__init__.py +src/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/__init__.py +src/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_uri_format_request_body/__init__.py +src/unit_test_api/paths/request_body_post_uri_format_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_uri_format_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_uri_format_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_uri_format_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_uri_format_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_uri_format_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_uri_format_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_uri_format_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_uri_reference_format_request_body/__init__.py +src/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/request_body_post_uri_template_format_request_body/__init__.py +src/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/__init__.py +src/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/operation.py +src/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/request_body/__init__.py +src/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/request_body/content/__init__.py +src/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/request_body/content/application_json/__init__.py +src/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/request_body/content/application_json/schema.py +src/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/responses/__init__.py +src/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_not_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/__init__.py +src/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post/__init__.py +src/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post/operation.py +src/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post/responses/__init__.py +src/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post/responses/response_200/__init__.py +src/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post/responses/response_200/content/__init__.py +src/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py +src/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py +src/unit_test_api/rest.py +src/unit_test_api/schemas.py +src/unit_test_api/security_schemes.py +src/unit_test_api/server.py +src/unit_test_api/servers/__init__.py +src/unit_test_api/servers/server_0.py test-requirements.txt test/__init__.py -test/test_models/__init__.py -test/test_models/test_additionalproperties_allows_a_schema_which_should_validate.py -test/test_models/test_additionalproperties_are_allowed_by_default.py -test/test_models/test_additionalproperties_can_exist_by_itself.py -test/test_models/test_additionalproperties_should_not_look_in_applicators.py -test/test_models/test_allof.py -test/test_models/test_allof_combined_with_anyof_oneof.py -test/test_models/test_allof_simple_types.py -test/test_models/test_allof_with_base_schema.py -test/test_models/test_allof_with_one_empty_schema.py -test/test_models/test_allof_with_the_first_empty_schema.py -test/test_models/test_allof_with_the_last_empty_schema.py -test/test_models/test_allof_with_two_empty_schemas.py -test/test_models/test_anyof.py -test/test_models/test_anyof_complex_types.py -test/test_models/test_anyof_with_base_schema.py -test/test_models/test_anyof_with_one_empty_schema.py -test/test_models/test_array_type_matches_arrays.py -test/test_models/test_boolean_type_matches_booleans.py -test/test_models/test_by_int.py -test/test_models/test_by_number.py -test/test_models/test_by_small_number.py -test/test_models/test_date_time_format.py -test/test_models/test_email_format.py -test/test_models/test_enum_with0_does_not_match_false.py -test/test_models/test_enum_with1_does_not_match_true.py -test/test_models/test_enum_with_escaped_characters.py -test/test_models/test_enum_with_false_does_not_match0.py -test/test_models/test_enum_with_true_does_not_match1.py -test/test_models/test_enums_in_properties.py -test/test_models/test_forbidden_property.py -test/test_models/test_hostname_format.py -test/test_models/test_integer_type_matches_integers.py -test/test_models/test_invalid_instance_should_not_raise_error_when_float_division_inf.py -test/test_models/test_invalid_string_value_for_default.py -test/test_models/test_ipv4_format.py -test/test_models/test_ipv6_format.py -test/test_models/test_json_pointer_format.py -test/test_models/test_maximum_validation.py -test/test_models/test_maximum_validation_with_unsigned_integer.py -test/test_models/test_maxitems_validation.py -test/test_models/test_maxlength_validation.py -test/test_models/test_maxproperties0_means_the_object_is_empty.py -test/test_models/test_maxproperties_validation.py -test/test_models/test_minimum_validation.py -test/test_models/test_minimum_validation_with_signed_integer.py -test/test_models/test_minitems_validation.py -test/test_models/test_minlength_validation.py -test/test_models/test_minproperties_validation.py -test/test_models/test_model_not.py -test/test_models/test_nested_allof_to_check_validation_semantics.py -test/test_models/test_nested_anyof_to_check_validation_semantics.py -test/test_models/test_nested_items.py -test/test_models/test_nested_oneof_to_check_validation_semantics.py -test/test_models/test_not_more_complex_schema.py -test/test_models/test_nul_characters_in_strings.py -test/test_models/test_null_type_matches_only_the_null_object.py -test/test_models/test_number_type_matches_numbers.py -test/test_models/test_object_properties_validation.py -test/test_models/test_oneof.py -test/test_models/test_oneof_complex_types.py -test/test_models/test_oneof_with_base_schema.py -test/test_models/test_oneof_with_empty_schema.py -test/test_models/test_oneof_with_required.py -test/test_models/test_pattern_is_not_anchored.py -test/test_models/test_pattern_validation.py -test/test_models/test_properties_with_escaped_characters.py -test/test_models/test_property_named_ref_that_is_not_a_reference.py -test/test_models/test_ref_in_additionalproperties.py -test/test_models/test_ref_in_allof.py -test/test_models/test_ref_in_anyof.py -test/test_models/test_ref_in_items.py -test/test_models/test_ref_in_not.py -test/test_models/test_ref_in_oneof.py -test/test_models/test_ref_in_property.py -test/test_models/test_required_default_validation.py -test/test_models/test_required_validation.py -test/test_models/test_required_with_empty_array.py -test/test_models/test_required_with_escaped_characters.py -test/test_models/test_simple_enum_validation.py -test/test_models/test_string_type_matches_strings.py -test/test_models/test_the_default_keyword_does_not_do_anything_if_the_property_is_missing.py -test/test_models/test_uniqueitems_false_validation.py -test/test_models/test_uniqueitems_validation.py -test/test_models/test_uri_format.py -test/test_models/test_uri_reference_format.py -test/test_models/test_uri_template_format.py +test/components/__init__.py +test/components/schema/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/test_request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/__init__.py +test/test_paths/test_request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/test_post.py +test/test_paths/test_request_body_post_additionalproperties_are_allowed_by_default_request_body/__init__.py +test/test_paths/test_request_body_post_additionalproperties_are_allowed_by_default_request_body/test_post.py +test/test_paths/test_request_body_post_additionalproperties_can_exist_by_itself_request_body/__init__.py +test/test_paths/test_request_body_post_additionalproperties_can_exist_by_itself_request_body/test_post.py +test/test_paths/test_request_body_post_additionalproperties_should_not_look_in_applicators_request_body/__init__.py +test/test_paths/test_request_body_post_additionalproperties_should_not_look_in_applicators_request_body/test_post.py +test/test_paths/test_request_body_post_allof_combined_with_anyof_oneof_request_body/__init__.py +test/test_paths/test_request_body_post_allof_combined_with_anyof_oneof_request_body/test_post.py +test/test_paths/test_request_body_post_allof_request_body/__init__.py +test/test_paths/test_request_body_post_allof_request_body/test_post.py +test/test_paths/test_request_body_post_allof_simple_types_request_body/__init__.py +test/test_paths/test_request_body_post_allof_simple_types_request_body/test_post.py +test/test_paths/test_request_body_post_allof_with_base_schema_request_body/__init__.py +test/test_paths/test_request_body_post_allof_with_base_schema_request_body/test_post.py +test/test_paths/test_request_body_post_allof_with_one_empty_schema_request_body/__init__.py +test/test_paths/test_request_body_post_allof_with_one_empty_schema_request_body/test_post.py +test/test_paths/test_request_body_post_allof_with_the_first_empty_schema_request_body/__init__.py +test/test_paths/test_request_body_post_allof_with_the_first_empty_schema_request_body/test_post.py +test/test_paths/test_request_body_post_allof_with_the_last_empty_schema_request_body/__init__.py +test/test_paths/test_request_body_post_allof_with_the_last_empty_schema_request_body/test_post.py +test/test_paths/test_request_body_post_allof_with_two_empty_schemas_request_body/__init__.py +test/test_paths/test_request_body_post_allof_with_two_empty_schemas_request_body/test_post.py +test/test_paths/test_request_body_post_anyof_complex_types_request_body/__init__.py +test/test_paths/test_request_body_post_anyof_complex_types_request_body/test_post.py +test/test_paths/test_request_body_post_anyof_request_body/__init__.py +test/test_paths/test_request_body_post_anyof_request_body/test_post.py +test/test_paths/test_request_body_post_anyof_with_base_schema_request_body/__init__.py +test/test_paths/test_request_body_post_anyof_with_base_schema_request_body/test_post.py +test/test_paths/test_request_body_post_anyof_with_one_empty_schema_request_body/__init__.py +test/test_paths/test_request_body_post_anyof_with_one_empty_schema_request_body/test_post.py +test/test_paths/test_request_body_post_array_type_matches_arrays_request_body/__init__.py +test/test_paths/test_request_body_post_array_type_matches_arrays_request_body/test_post.py +test/test_paths/test_request_body_post_boolean_type_matches_booleans_request_body/__init__.py +test/test_paths/test_request_body_post_boolean_type_matches_booleans_request_body/test_post.py +test/test_paths/test_request_body_post_by_int_request_body/__init__.py +test/test_paths/test_request_body_post_by_int_request_body/test_post.py +test/test_paths/test_request_body_post_by_number_request_body/__init__.py +test/test_paths/test_request_body_post_by_number_request_body/test_post.py +test/test_paths/test_request_body_post_by_small_number_request_body/__init__.py +test/test_paths/test_request_body_post_by_small_number_request_body/test_post.py +test/test_paths/test_request_body_post_date_time_format_request_body/__init__.py +test/test_paths/test_request_body_post_date_time_format_request_body/test_post.py +test/test_paths/test_request_body_post_email_format_request_body/__init__.py +test/test_paths/test_request_body_post_email_format_request_body/test_post.py +test/test_paths/test_request_body_post_enum_with0_does_not_match_false_request_body/__init__.py +test/test_paths/test_request_body_post_enum_with0_does_not_match_false_request_body/test_post.py +test/test_paths/test_request_body_post_enum_with1_does_not_match_true_request_body/__init__.py +test/test_paths/test_request_body_post_enum_with1_does_not_match_true_request_body/test_post.py +test/test_paths/test_request_body_post_enum_with_escaped_characters_request_body/__init__.py +test/test_paths/test_request_body_post_enum_with_escaped_characters_request_body/test_post.py +test/test_paths/test_request_body_post_enum_with_false_does_not_match0_request_body/__init__.py +test/test_paths/test_request_body_post_enum_with_false_does_not_match0_request_body/test_post.py +test/test_paths/test_request_body_post_enum_with_true_does_not_match1_request_body/__init__.py +test/test_paths/test_request_body_post_enum_with_true_does_not_match1_request_body/test_post.py +test/test_paths/test_request_body_post_enums_in_properties_request_body/__init__.py +test/test_paths/test_request_body_post_enums_in_properties_request_body/test_post.py +test/test_paths/test_request_body_post_forbidden_property_request_body/__init__.py +test/test_paths/test_request_body_post_forbidden_property_request_body/test_post.py +test/test_paths/test_request_body_post_hostname_format_request_body/__init__.py +test/test_paths/test_request_body_post_hostname_format_request_body/test_post.py +test/test_paths/test_request_body_post_integer_type_matches_integers_request_body/__init__.py +test/test_paths/test_request_body_post_integer_type_matches_integers_request_body/test_post.py +test/test_paths/test_request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/__init__.py +test/test_paths/test_request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/test_post.py +test/test_paths/test_request_body_post_invalid_string_value_for_default_request_body/__init__.py +test/test_paths/test_request_body_post_invalid_string_value_for_default_request_body/test_post.py +test/test_paths/test_request_body_post_ipv4_format_request_body/__init__.py +test/test_paths/test_request_body_post_ipv4_format_request_body/test_post.py +test/test_paths/test_request_body_post_ipv6_format_request_body/__init__.py +test/test_paths/test_request_body_post_ipv6_format_request_body/test_post.py +test/test_paths/test_request_body_post_json_pointer_format_request_body/__init__.py +test/test_paths/test_request_body_post_json_pointer_format_request_body/test_post.py +test/test_paths/test_request_body_post_maximum_validation_request_body/__init__.py +test/test_paths/test_request_body_post_maximum_validation_request_body/test_post.py +test/test_paths/test_request_body_post_maximum_validation_with_unsigned_integer_request_body/__init__.py +test/test_paths/test_request_body_post_maximum_validation_with_unsigned_integer_request_body/test_post.py +test/test_paths/test_request_body_post_maxitems_validation_request_body/__init__.py +test/test_paths/test_request_body_post_maxitems_validation_request_body/test_post.py +test/test_paths/test_request_body_post_maxlength_validation_request_body/__init__.py +test/test_paths/test_request_body_post_maxlength_validation_request_body/test_post.py +test/test_paths/test_request_body_post_maxproperties0_means_the_object_is_empty_request_body/__init__.py +test/test_paths/test_request_body_post_maxproperties0_means_the_object_is_empty_request_body/test_post.py +test/test_paths/test_request_body_post_maxproperties_validation_request_body/__init__.py +test/test_paths/test_request_body_post_maxproperties_validation_request_body/test_post.py +test/test_paths/test_request_body_post_minimum_validation_request_body/__init__.py +test/test_paths/test_request_body_post_minimum_validation_request_body/test_post.py +test/test_paths/test_request_body_post_minimum_validation_with_signed_integer_request_body/__init__.py +test/test_paths/test_request_body_post_minimum_validation_with_signed_integer_request_body/test_post.py +test/test_paths/test_request_body_post_minitems_validation_request_body/__init__.py +test/test_paths/test_request_body_post_minitems_validation_request_body/test_post.py +test/test_paths/test_request_body_post_minlength_validation_request_body/__init__.py +test/test_paths/test_request_body_post_minlength_validation_request_body/test_post.py +test/test_paths/test_request_body_post_minproperties_validation_request_body/__init__.py +test/test_paths/test_request_body_post_minproperties_validation_request_body/test_post.py +test/test_paths/test_request_body_post_nested_allof_to_check_validation_semantics_request_body/__init__.py +test/test_paths/test_request_body_post_nested_allof_to_check_validation_semantics_request_body/test_post.py +test/test_paths/test_request_body_post_nested_anyof_to_check_validation_semantics_request_body/__init__.py +test/test_paths/test_request_body_post_nested_anyof_to_check_validation_semantics_request_body/test_post.py +test/test_paths/test_request_body_post_nested_items_request_body/__init__.py +test/test_paths/test_request_body_post_nested_items_request_body/test_post.py +test/test_paths/test_request_body_post_nested_oneof_to_check_validation_semantics_request_body/__init__.py +test/test_paths/test_request_body_post_nested_oneof_to_check_validation_semantics_request_body/test_post.py +test/test_paths/test_request_body_post_not_more_complex_schema_request_body/__init__.py +test/test_paths/test_request_body_post_not_more_complex_schema_request_body/test_post.py +test/test_paths/test_request_body_post_not_request_body/__init__.py +test/test_paths/test_request_body_post_not_request_body/test_post.py +test/test_paths/test_request_body_post_nul_characters_in_strings_request_body/__init__.py +test/test_paths/test_request_body_post_nul_characters_in_strings_request_body/test_post.py +test/test_paths/test_request_body_post_null_type_matches_only_the_null_object_request_body/__init__.py +test/test_paths/test_request_body_post_null_type_matches_only_the_null_object_request_body/test_post.py +test/test_paths/test_request_body_post_number_type_matches_numbers_request_body/__init__.py +test/test_paths/test_request_body_post_number_type_matches_numbers_request_body/test_post.py +test/test_paths/test_request_body_post_object_properties_validation_request_body/__init__.py +test/test_paths/test_request_body_post_object_properties_validation_request_body/test_post.py +test/test_paths/test_request_body_post_object_type_matches_objects_request_body/__init__.py +test/test_paths/test_request_body_post_object_type_matches_objects_request_body/test_post.py +test/test_paths/test_request_body_post_oneof_complex_types_request_body/__init__.py +test/test_paths/test_request_body_post_oneof_complex_types_request_body/test_post.py +test/test_paths/test_request_body_post_oneof_request_body/__init__.py +test/test_paths/test_request_body_post_oneof_request_body/test_post.py +test/test_paths/test_request_body_post_oneof_with_base_schema_request_body/__init__.py +test/test_paths/test_request_body_post_oneof_with_base_schema_request_body/test_post.py +test/test_paths/test_request_body_post_oneof_with_empty_schema_request_body/__init__.py +test/test_paths/test_request_body_post_oneof_with_empty_schema_request_body/test_post.py +test/test_paths/test_request_body_post_oneof_with_required_request_body/__init__.py +test/test_paths/test_request_body_post_oneof_with_required_request_body/test_post.py +test/test_paths/test_request_body_post_pattern_is_not_anchored_request_body/__init__.py +test/test_paths/test_request_body_post_pattern_is_not_anchored_request_body/test_post.py +test/test_paths/test_request_body_post_pattern_validation_request_body/__init__.py +test/test_paths/test_request_body_post_pattern_validation_request_body/test_post.py +test/test_paths/test_request_body_post_properties_with_escaped_characters_request_body/__init__.py +test/test_paths/test_request_body_post_properties_with_escaped_characters_request_body/test_post.py +test/test_paths/test_request_body_post_property_named_ref_that_is_not_a_reference_request_body/__init__.py +test/test_paths/test_request_body_post_property_named_ref_that_is_not_a_reference_request_body/test_post.py +test/test_paths/test_request_body_post_ref_in_additionalproperties_request_body/__init__.py +test/test_paths/test_request_body_post_ref_in_additionalproperties_request_body/test_post.py +test/test_paths/test_request_body_post_ref_in_allof_request_body/__init__.py +test/test_paths/test_request_body_post_ref_in_allof_request_body/test_post.py +test/test_paths/test_request_body_post_ref_in_anyof_request_body/__init__.py +test/test_paths/test_request_body_post_ref_in_anyof_request_body/test_post.py +test/test_paths/test_request_body_post_ref_in_items_request_body/__init__.py +test/test_paths/test_request_body_post_ref_in_items_request_body/test_post.py +test/test_paths/test_request_body_post_ref_in_not_request_body/__init__.py +test/test_paths/test_request_body_post_ref_in_not_request_body/test_post.py +test/test_paths/test_request_body_post_ref_in_oneof_request_body/__init__.py +test/test_paths/test_request_body_post_ref_in_oneof_request_body/test_post.py +test/test_paths/test_request_body_post_ref_in_property_request_body/__init__.py +test/test_paths/test_request_body_post_ref_in_property_request_body/test_post.py +test/test_paths/test_request_body_post_required_default_validation_request_body/__init__.py +test/test_paths/test_request_body_post_required_default_validation_request_body/test_post.py +test/test_paths/test_request_body_post_required_validation_request_body/__init__.py +test/test_paths/test_request_body_post_required_validation_request_body/test_post.py +test/test_paths/test_request_body_post_required_with_empty_array_request_body/__init__.py +test/test_paths/test_request_body_post_required_with_empty_array_request_body/test_post.py +test/test_paths/test_request_body_post_required_with_escaped_characters_request_body/__init__.py +test/test_paths/test_request_body_post_required_with_escaped_characters_request_body/test_post.py +test/test_paths/test_request_body_post_simple_enum_validation_request_body/__init__.py +test/test_paths/test_request_body_post_simple_enum_validation_request_body/test_post.py +test/test_paths/test_request_body_post_string_type_matches_strings_request_body/__init__.py +test/test_paths/test_request_body_post_string_type_matches_strings_request_body/test_post.py +test/test_paths/test_request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/__init__.py +test/test_paths/test_request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/test_post.py +test/test_paths/test_request_body_post_uniqueitems_false_validation_request_body/__init__.py +test/test_paths/test_request_body_post_uniqueitems_false_validation_request_body/test_post.py +test/test_paths/test_request_body_post_uniqueitems_validation_request_body/__init__.py +test/test_paths/test_request_body_post_uniqueitems_validation_request_body/test_post.py +test/test_paths/test_request_body_post_uri_format_request_body/__init__.py +test/test_paths/test_request_body_post_uri_format_request_body/test_post.py +test/test_paths/test_request_body_post_uri_reference_format_request_body/__init__.py +test/test_paths/test_request_body_post_uri_reference_format_request_body/test_post.py +test/test_paths/test_request_body_post_uri_template_format_request_body/__init__.py +test/test_paths/test_request_body_post_uri_template_format_request_body/test_post.py +test/test_paths/test_response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_allof_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_allof_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_allof_simple_types_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_allof_simple_types_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_allof_with_base_schema_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_allof_with_base_schema_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_allof_with_one_empty_schema_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_allof_with_one_empty_schema_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_anyof_complex_types_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_anyof_complex_types_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_anyof_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_anyof_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_anyof_with_base_schema_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_anyof_with_base_schema_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_array_type_matches_arrays_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_array_type_matches_arrays_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_boolean_type_matches_booleans_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_boolean_type_matches_booleans_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_by_int_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_by_int_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_by_number_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_by_number_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_by_small_number_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_by_small_number_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_date_time_format_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_date_time_format_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_email_format_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_email_format_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_enum_with_escaped_characters_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_enum_with_escaped_characters_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_enums_in_properties_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_enums_in_properties_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_forbidden_property_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_forbidden_property_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_hostname_format_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_hostname_format_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_integer_type_matches_integers_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_integer_type_matches_integers_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_invalid_string_value_for_default_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_invalid_string_value_for_default_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_ipv4_format_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_ipv4_format_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_ipv6_format_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_ipv6_format_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_json_pointer_format_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_json_pointer_format_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_maximum_validation_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_maximum_validation_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_maxitems_validation_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_maxitems_validation_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_maxlength_validation_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_maxlength_validation_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_maxproperties_validation_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_maxproperties_validation_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_minimum_validation_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_minimum_validation_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_minitems_validation_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_minitems_validation_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_minlength_validation_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_minlength_validation_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_minproperties_validation_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_minproperties_validation_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_nested_items_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_nested_items_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_not_more_complex_schema_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_not_more_complex_schema_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_not_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_not_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_nul_characters_in_strings_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_nul_characters_in_strings_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_number_type_matches_numbers_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_number_type_matches_numbers_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_object_properties_validation_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_object_properties_validation_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_object_type_matches_objects_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_object_type_matches_objects_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_oneof_complex_types_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_oneof_complex_types_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_oneof_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_oneof_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_oneof_with_base_schema_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_oneof_with_base_schema_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_oneof_with_empty_schema_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_oneof_with_empty_schema_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_oneof_with_required_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_oneof_with_required_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_pattern_is_not_anchored_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_pattern_is_not_anchored_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_pattern_validation_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_pattern_validation_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_properties_with_escaped_characters_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_properties_with_escaped_characters_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_ref_in_additionalproperties_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_ref_in_additionalproperties_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_ref_in_allof_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_ref_in_allof_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_ref_in_anyof_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_ref_in_anyof_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_ref_in_items_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_ref_in_items_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_ref_in_not_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_ref_in_not_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_ref_in_oneof_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_ref_in_oneof_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_ref_in_property_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_ref_in_property_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_required_default_validation_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_required_default_validation_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_required_validation_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_required_validation_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_required_with_empty_array_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_required_with_empty_array_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_required_with_escaped_characters_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_required_with_escaped_characters_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_simple_enum_validation_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_simple_enum_validation_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_string_type_matches_strings_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_string_type_matches_strings_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_uniqueitems_false_validation_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_uniqueitems_false_validation_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_uniqueitems_validation_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_uniqueitems_validation_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_uri_format_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_uri_format_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_uri_reference_format_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_uri_reference_format_response_body_for_content_types/test_post.py +test/test_paths/test_response_body_post_uri_template_format_response_body_for_content_types/__init__.py +test/test_paths/test_response_body_post_uri_template_format_response_body_for_content_types/test_post.py tox.ini -unit_test_api/__init__.py -unit_test_api/api_client.py -unit_test_api/apis/__init__.py -unit_test_api/apis/tags/additional_properties_api.py -unit_test_api/apis/tags/all_of_api.py -unit_test_api/apis/tags/any_of_api.py -unit_test_api/apis/tags/content_type_json_api.py -unit_test_api/apis/tags/default_api.py -unit_test_api/apis/tags/enum_api.py -unit_test_api/apis/tags/format_api.py -unit_test_api/apis/tags/items_api.py -unit_test_api/apis/tags/max_items_api.py -unit_test_api/apis/tags/max_length_api.py -unit_test_api/apis/tags/max_properties_api.py -unit_test_api/apis/tags/maximum_api.py -unit_test_api/apis/tags/min_items_api.py -unit_test_api/apis/tags/min_length_api.py -unit_test_api/apis/tags/min_properties_api.py -unit_test_api/apis/tags/minimum_api.py -unit_test_api/apis/tags/model_not_api.py -unit_test_api/apis/tags/multiple_of_api.py -unit_test_api/apis/tags/one_of_api.py -unit_test_api/apis/tags/operation_request_body_api.py -unit_test_api/apis/tags/path_post_api.py -unit_test_api/apis/tags/pattern_api.py -unit_test_api/apis/tags/properties_api.py -unit_test_api/apis/tags/ref_api.py -unit_test_api/apis/tags/required_api.py -unit_test_api/apis/tags/response_content_content_type_schema_api.py -unit_test_api/apis/tags/type_api.py -unit_test_api/apis/tags/unique_items_api.py -unit_test_api/configuration.py -unit_test_api/exceptions.py -unit_test_api/model/__init__.py -unit_test_api/model/additionalproperties_allows_a_schema_which_should_validate.py -unit_test_api/model/additionalproperties_allows_a_schema_which_should_validate.pyi -unit_test_api/model/additionalproperties_are_allowed_by_default.py -unit_test_api/model/additionalproperties_are_allowed_by_default.pyi -unit_test_api/model/additionalproperties_can_exist_by_itself.py -unit_test_api/model/additionalproperties_can_exist_by_itself.pyi -unit_test_api/model/additionalproperties_should_not_look_in_applicators.py -unit_test_api/model/additionalproperties_should_not_look_in_applicators.pyi -unit_test_api/model/allof.py -unit_test_api/model/allof.pyi -unit_test_api/model/allof_combined_with_anyof_oneof.py -unit_test_api/model/allof_combined_with_anyof_oneof.pyi -unit_test_api/model/allof_simple_types.py -unit_test_api/model/allof_simple_types.pyi -unit_test_api/model/allof_with_base_schema.py -unit_test_api/model/allof_with_base_schema.pyi -unit_test_api/model/allof_with_one_empty_schema.py -unit_test_api/model/allof_with_one_empty_schema.pyi -unit_test_api/model/allof_with_the_first_empty_schema.py -unit_test_api/model/allof_with_the_first_empty_schema.pyi -unit_test_api/model/allof_with_the_last_empty_schema.py -unit_test_api/model/allof_with_the_last_empty_schema.pyi -unit_test_api/model/allof_with_two_empty_schemas.py -unit_test_api/model/allof_with_two_empty_schemas.pyi -unit_test_api/model/anyof.py -unit_test_api/model/anyof.pyi -unit_test_api/model/anyof_complex_types.py -unit_test_api/model/anyof_complex_types.pyi -unit_test_api/model/anyof_with_base_schema.py -unit_test_api/model/anyof_with_base_schema.pyi -unit_test_api/model/anyof_with_one_empty_schema.py -unit_test_api/model/anyof_with_one_empty_schema.pyi -unit_test_api/model/array_type_matches_arrays.py -unit_test_api/model/array_type_matches_arrays.pyi -unit_test_api/model/boolean_type_matches_booleans.py -unit_test_api/model/boolean_type_matches_booleans.pyi -unit_test_api/model/by_int.py -unit_test_api/model/by_int.pyi -unit_test_api/model/by_number.py -unit_test_api/model/by_number.pyi -unit_test_api/model/by_small_number.py -unit_test_api/model/by_small_number.pyi -unit_test_api/model/date_time_format.py -unit_test_api/model/date_time_format.pyi -unit_test_api/model/email_format.py -unit_test_api/model/email_format.pyi -unit_test_api/model/enum_with0_does_not_match_false.py -unit_test_api/model/enum_with0_does_not_match_false.pyi -unit_test_api/model/enum_with1_does_not_match_true.py -unit_test_api/model/enum_with1_does_not_match_true.pyi -unit_test_api/model/enum_with_escaped_characters.py -unit_test_api/model/enum_with_escaped_characters.pyi -unit_test_api/model/enum_with_false_does_not_match0.py -unit_test_api/model/enum_with_false_does_not_match0.pyi -unit_test_api/model/enum_with_true_does_not_match1.py -unit_test_api/model/enum_with_true_does_not_match1.pyi -unit_test_api/model/enums_in_properties.py -unit_test_api/model/enums_in_properties.pyi -unit_test_api/model/forbidden_property.py -unit_test_api/model/forbidden_property.pyi -unit_test_api/model/hostname_format.py -unit_test_api/model/hostname_format.pyi -unit_test_api/model/integer_type_matches_integers.py -unit_test_api/model/integer_type_matches_integers.pyi -unit_test_api/model/invalid_instance_should_not_raise_error_when_float_division_inf.py -unit_test_api/model/invalid_instance_should_not_raise_error_when_float_division_inf.pyi -unit_test_api/model/invalid_string_value_for_default.py -unit_test_api/model/invalid_string_value_for_default.pyi -unit_test_api/model/ipv4_format.py -unit_test_api/model/ipv4_format.pyi -unit_test_api/model/ipv6_format.py -unit_test_api/model/ipv6_format.pyi -unit_test_api/model/json_pointer_format.py -unit_test_api/model/json_pointer_format.pyi -unit_test_api/model/maximum_validation.py -unit_test_api/model/maximum_validation.pyi -unit_test_api/model/maximum_validation_with_unsigned_integer.py -unit_test_api/model/maximum_validation_with_unsigned_integer.pyi -unit_test_api/model/maxitems_validation.py -unit_test_api/model/maxitems_validation.pyi -unit_test_api/model/maxlength_validation.py -unit_test_api/model/maxlength_validation.pyi -unit_test_api/model/maxproperties0_means_the_object_is_empty.py -unit_test_api/model/maxproperties0_means_the_object_is_empty.pyi -unit_test_api/model/maxproperties_validation.py -unit_test_api/model/maxproperties_validation.pyi -unit_test_api/model/minimum_validation.py -unit_test_api/model/minimum_validation.pyi -unit_test_api/model/minimum_validation_with_signed_integer.py -unit_test_api/model/minimum_validation_with_signed_integer.pyi -unit_test_api/model/minitems_validation.py -unit_test_api/model/minitems_validation.pyi -unit_test_api/model/minlength_validation.py -unit_test_api/model/minlength_validation.pyi -unit_test_api/model/minproperties_validation.py -unit_test_api/model/minproperties_validation.pyi -unit_test_api/model/model_not.py -unit_test_api/model/model_not.pyi -unit_test_api/model/nested_allof_to_check_validation_semantics.py -unit_test_api/model/nested_allof_to_check_validation_semantics.pyi -unit_test_api/model/nested_anyof_to_check_validation_semantics.py -unit_test_api/model/nested_anyof_to_check_validation_semantics.pyi -unit_test_api/model/nested_items.py -unit_test_api/model/nested_items.pyi -unit_test_api/model/nested_oneof_to_check_validation_semantics.py -unit_test_api/model/nested_oneof_to_check_validation_semantics.pyi -unit_test_api/model/not_more_complex_schema.py -unit_test_api/model/not_more_complex_schema.pyi -unit_test_api/model/nul_characters_in_strings.py -unit_test_api/model/nul_characters_in_strings.pyi -unit_test_api/model/null_type_matches_only_the_null_object.py -unit_test_api/model/null_type_matches_only_the_null_object.pyi -unit_test_api/model/number_type_matches_numbers.py -unit_test_api/model/number_type_matches_numbers.pyi -unit_test_api/model/object_properties_validation.py -unit_test_api/model/object_properties_validation.pyi -unit_test_api/model/oneof.py -unit_test_api/model/oneof.pyi -unit_test_api/model/oneof_complex_types.py -unit_test_api/model/oneof_complex_types.pyi -unit_test_api/model/oneof_with_base_schema.py -unit_test_api/model/oneof_with_base_schema.pyi -unit_test_api/model/oneof_with_empty_schema.py -unit_test_api/model/oneof_with_empty_schema.pyi -unit_test_api/model/oneof_with_required.py -unit_test_api/model/oneof_with_required.pyi -unit_test_api/model/pattern_is_not_anchored.py -unit_test_api/model/pattern_is_not_anchored.pyi -unit_test_api/model/pattern_validation.py -unit_test_api/model/pattern_validation.pyi -unit_test_api/model/properties_with_escaped_characters.py -unit_test_api/model/properties_with_escaped_characters.pyi -unit_test_api/model/property_named_ref_that_is_not_a_reference.py -unit_test_api/model/property_named_ref_that_is_not_a_reference.pyi -unit_test_api/model/ref_in_additionalproperties.py -unit_test_api/model/ref_in_additionalproperties.pyi -unit_test_api/model/ref_in_allof.py -unit_test_api/model/ref_in_allof.pyi -unit_test_api/model/ref_in_anyof.py -unit_test_api/model/ref_in_anyof.pyi -unit_test_api/model/ref_in_items.py -unit_test_api/model/ref_in_items.pyi -unit_test_api/model/ref_in_not.py -unit_test_api/model/ref_in_not.pyi -unit_test_api/model/ref_in_oneof.py -unit_test_api/model/ref_in_oneof.pyi -unit_test_api/model/ref_in_property.py -unit_test_api/model/ref_in_property.pyi -unit_test_api/model/required_default_validation.py -unit_test_api/model/required_default_validation.pyi -unit_test_api/model/required_validation.py -unit_test_api/model/required_validation.pyi -unit_test_api/model/required_with_empty_array.py -unit_test_api/model/required_with_empty_array.pyi -unit_test_api/model/required_with_escaped_characters.py -unit_test_api/model/required_with_escaped_characters.pyi -unit_test_api/model/simple_enum_validation.py -unit_test_api/model/simple_enum_validation.pyi -unit_test_api/model/string_type_matches_strings.py -unit_test_api/model/string_type_matches_strings.pyi -unit_test_api/model/the_default_keyword_does_not_do_anything_if_the_property_is_missing.py -unit_test_api/model/the_default_keyword_does_not_do_anything_if_the_property_is_missing.pyi -unit_test_api/model/uniqueitems_false_validation.py -unit_test_api/model/uniqueitems_false_validation.pyi -unit_test_api/model/uniqueitems_validation.py -unit_test_api/model/uniqueitems_validation.pyi -unit_test_api/model/uri_format.py -unit_test_api/model/uri_format.pyi -unit_test_api/model/uri_reference_format.py -unit_test_api/model/uri_reference_format.pyi -unit_test_api/model/uri_template_format.py -unit_test_api/model/uri_template_format.pyi -unit_test_api/models/__init__.py -unit_test_api/rest.py -unit_test_api/schemas.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python/.openapi-generator/VERSION b/samples/openapi3/client/3_0_3_unit_test/python/.openapi-generator/VERSION index a6a3a43c3a0..359a5b952d4 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/.openapi-generator/VERSION +++ b/samples/openapi3/client/3_0_3_unit_test/python/.openapi-generator/VERSION @@ -1 +1 @@ -1.0.4 \ No newline at end of file +2.0.0 \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/Makefile b/samples/openapi3/client/3_0_3_unit_test/python/Makefile index 863c380ebef..b73277d308c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/Makefile +++ b/samples/openapi3/client/3_0_3_unit_test/python/Makefile @@ -1,10 +1,7 @@ -REQUIREMENTS_FILE=dev-requirements.txt -REQUIREMENTS_OUT=dev-requirements.txt.log SETUP_OUT=*.egg-info VENV=venv clean: - rm -rf $(REQUIREMENTS_OUT) rm -rf $(SETUP_OUT) rm -rf $(VENV) rm -rf .tox diff --git a/samples/openapi3/client/3_0_3_unit_test/python/README.md b/samples/openapi3/client/3_0_3_unit_test/python/README.md index 3c71a079b1b..3554698c011 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/README.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/README.md @@ -1,108 +1,22 @@ # unit-test-api sample spec for testing openapi functionality, built from json schema tests for draft6 -This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: +This Python package is automatically generated by the [OpenAPI JSON Schema Generator](https://github.com/openapi-json-schema-tools/openapi-json-schema-generator) project: - API version: 0.0.1 - Package version: 1.0.0 -- Build package: org.openapitools.codegen.languages.PythonClientCodegen +- Build package: PythonClientCodegen -## Requirements. +## Requirements Python >=3.7 -## Migration from other generators like python and python-legacy - -### Changes -1. This generator uses spec case for all (object) property names and parameter names. - - So if the spec has a property name like camelCase, it will use camelCase rather than camel_case - - So you will need to update how you input and read properties to use spec case -2. Endpoint parameters are stored in dictionaries to prevent collisions (explanation below) - - So you will need to update how you pass data in to endpoints -3. Endpoint responses now include the original response, the deserialized response body, and (todo)the deserialized headers - - So you will need to update your code to use response.body to access deserialized data -4. All validated data is instantiated in an instance that subclasses all validated Schema classes and Decimal/str/list/tuple/frozendict/NoneClass/BoolClass/bytes/io.FileIO - - This means that you can use isinstance to check if a payload validated against a schema class - - This means that no data will be of type None/True/False - - ingested None will subclass NoneClass - - ingested True will subclass BoolClass - - ingested False will subclass BoolClass - - So if you need to check is True/False/None, instead use instance.is_true_oapg()/.is_false_oapg()/.is_none_oapg() -5. All validated class instances are immutable except for ones based on io.File - - This is because if properties were changed after validation, that validation would no longer apply - - So no changing values or property values after a class has been instantiated -6. String + Number types with formats - - String type data is stored as a string and if you need to access types based on its format like date, - date-time, uuid, number etc then you will need to use accessor functions on the instance - - type string + format: See .as_date_oapg, .as_datetime_oapg, .as_decimal_oapg, .as_uuid_oapg - - type number + format: See .as_float_oapg, .as_int_oapg - - this was done because openapi/json-schema defines constraints. string data may be type string with no format - keyword in one schema, and include a format constraint in another schema - - So if you need to access a string format based type, use as_date_oapg/as_datetime_oapg/as_decimal_oapg/as_uuid_oapg - - So if you need to access a number format based type, use as_int_oapg/as_float_oapg -7. Property access on AnyType(type unset) or object(dict) schemas - - Only required keys with valid python names are properties like .someProp and have type hints - - All optional keys may not exist, so properties are not defined for them - - One can access optional values with dict_instance['optionalProp'] and KeyError will be raised if it does not exist - - Use get_item_oapg if you need a way to always get a value whether or not the key exists - - If the key does not exist, schemas.unset is returned from calling dict_instance.get_item_oapg('optionalProp') - - All required and optional keys have type hints for this method, and @typing.overload is used - - A type hint is also generated for additionalProperties accessed using this method - - So you will need to update you code to use some_instance['optionalProp'] to access optional property - and additionalProperty values -8. The location of the api classes has changed - - Api classes are located in your_package.apis.tags.some_api - - This change was made to eliminate redundant code generation - - Legacy generators generated the same endpoint twice if it had > 1 tag on it - - This generator defines an endpoint in one class, then inherits that class to generate - apis by tags and by paths - - This change reduces code and allows quicker run time if you use the path apis - - path apis are at your_package.apis.paths.some_path - - Those apis will only load their needed models, which is less to load than all of the resources needed in a tag api - - So you will need to update your import paths to the api classes - -### Why are Oapg and _oapg used in class and method names? -Classes can have arbitrarily named properties set on them -Endpoints can have arbitrary operationId method names set -For those reasons, I use the prefix Oapg and _oapg to greatly reduce the likelihood of collisions -on protected + public classes/methods. -oapg stands for OpenApi Python Generator. - -### Object property spec case -This was done because when payloads are ingested, they can be validated against N number of schemas. -If the input signature used a different property name then that has mutated the payload. -So SchemaA and SchemaB must both see the camelCase spec named variable. -Also it is possible to send in two properties, named camelCase and camel_case in the same payload. -That use case should be support so spec case is used. - -### Parameter spec case -Parameters can be included in different locations including: -- query -- path -- header -- cookie - -Any of those parameters could use the same parameter names, so if every parameter -was included as an endpoint parameter in a function signature, they would collide. -For that reason, each of those inputs have been separated out into separate typed dictionaries: -- query_params -- path_params -- header_params -- cookie_params - -So when updating your code, you will need to pass endpoint parameters in using those -dictionaries. - -### Endpoint responses -Endpoint responses have been enriched to now include more information. -Any response reom an endpoint will now include the following properties: -response: urllib3.HTTPResponse -body: typing.Union[Unset, Schema] -headers: typing.Union[Unset, TODO] -Note: response header deserialization has not yet been added - - -## Installation & Usage +## Migration Guides +- [2.0.0 Migration Guide](migration_2_0_0.md) +- [Migration from Other Python Generators](migration_other_python_generators.md) + + +## Installation ### pip install If the python package is hosted on a repository, you can install directly using: @@ -122,893 +36,465 @@ import unit_test_api Install via [Setuptools](http://pypi.python.org/pypi/setuptools). ```sh -python setup.py install --user +python -m pip install . --user ``` -(or `sudo python setup.py install` to install the package for all users) +(or `python -m pip install .` to install the package for all users) Then import the package: ```python import unit_test_api ``` +## Usage Notes +### Validation, Immutability, and Data Type +This python code validates data to schema classes and return back an immutable instance containing the data +which subclasses all validated schema classes. This ensure that +- valid data cannot be mutated and become invalid to a set of schemas + - the one exception is that files are not immutable, so schema instances storing/sending/receiving files are not immutable +- one can use isinstance to check if a instance or property is valid to a schema class + - this means that expensive validation does not need to be run twice + +
    + Reason + +To do that, some changes had to be made. Python bool and NoneType cannot be subclassed, +so to be able to meet the above design goals, I implemented BoolClass and NoneClass classes +to allow schemas to subclass them. + +In python 0 == False and 1 == True. This is a problem for json schema which is language independent. +The [json schema test suite](https://github.com/json-schema-org/JSON-Schema-Test-Suite) has +[explicit tests that require that 0 != False and 1 != True](https://github.com/json-schema-org/JSON-Schema-Test-Suite/blob/main/tests/draft2020-12/type.json#L260-L267) +Using the above described BoolClass and NoneClasses allows those tests to pass. +- Another example of a package using it's own boolean class is [numpy's bool_](https://numpy.org/doc/stable/reference/arrays.scalars.html#numpy.bool_) +
    + +If you need to check is True/False/None, instead use instance.is_true_()/.is_false_()/.is_none_() + +Here is the mapping from json schema types to python subclassed types: +| Json Schema Type | Python Base Class | +| ---------------- | ----------------- | +| object | frozendict.frozendict | +| array | tuple | +| string | str | +| number | decimal.Decimal | +| integer | decimal.Decimal | +| boolean | BoolClass | +| null | NoneClass | +| AnyType (unset) | typing.Union[frozendict.frozendict, tuple, str, decimal.Decimal, BoolClass, NoneClass] | + +### Storage of Json Schema Definition in Python Classes +In openapi v3.0.3 there are ~ 28 json schema keywords. Almost all of them can apply if +type is unset. This data could be stored as +1. class properties +2. in a container in the class like in a dict or in a nested class + +This data is stored in a nested class named Schema_. +Storing this data as a nested class ensures that the data is encapsulated, does not collide with +class properties, and allows for deeper complex inline definitions. + +
    + Reason + +If the data were stored at the class property level, then the keywords could collide with +type object property names. To avoid that, one could make the properties semi or fully private with +a single or double underscore prefix, but that it a lot of data to put there. +Better to separate out json schema data from type object properties at the class property level. + +If the data were stored in a container that would segregate the different data which is good. +But json schemas can be inlined to any depth. Those complex deeper schemas would need to be included. +One could define them higher in the class file and then refer to them in the dict. That would required +iterating over schemas and adding all of the inner into a collection, and then generate that collection. + +The schema definitions are already nested from the json schema definition. The easiest solution is +to use a nested json schema definition class which holds that data. That way: +- the data is separated from class properties +- deeper complicated schemas can still be stored + +So a nested class was chosen to store json schema data, this class is named Schema_. +- The [django project uses this same pattern to store model class metadata in a Meta class](https://docs.djangoproject.com/en/4.1/topics/db/models/#meta-options) +
    + +### Json Schema Type Object +Most component schemas (models) are probably of type object. Which is a map data structure. +Json schema allows string keys in this map, which means schema properties can have key names that are +invalid python variable names. Names like: +- "hi-there" +- "1variable" +- "@now" +- " " +- "from" + +To allow these use cases to work, frozendict.frozendict is used as the base class of type object schemas. +This means that one can use normal dict methods on instances of these classes. + +
    + Other Details + +- optional properties which were not set will not exist in the instance +- None is only allowed in as a value if type: "null" was included or nullable: true was set +- type hints are written for accessing values by key literals like instance["hi-there"] +- and there is a method instance.get_item_["hi-there"] which returns an schemas.Unset value if the key was not set +- required properties with valid python names are accessible with instance.SomeRequiredProp + which uses the exact key from the openapi document + - preserving the original key names is required to properly validate a payload to multiple json schemas +
    + +### Json Schema Type + Format, Validated Data Storage +N schemas can be validated on the same payload. +To allow multiple schemas to validate, the data must be stored using one base class whether or not +a json schema format constraint exists in the schema. +See te below accessors for string data: +- type string + format: See .as_date_, .as_datetime_, .as_decimal_, .as_uuid_ + +In json schema, type: number with no format validates both integers and floats, so decimal.Decimal is used to store them. +See te below accessors for number data: +- type number + format: See .as_float_, .as_int_ + +
    + String + Date Example + +For example the string payload '2023-12-20' is validates to both of these schemas: +1. string only +``` +- type: string +``` +2. string and date format +``` +- type: string + format: date +``` +Because of use cases like this, a datetime.date is allowed as an input to this schema, but the data +is stored as a string, with a date accessor, instance.as_date_ +
    + ## Getting Started -Please follow the [installation procedure](#installation--usage) and then run the following: +Please follow the [installation procedure](#installation) and then run the following: ```python - -import time import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api from pprint import pprint -from unit_test_api.apis.tags import ref_api -from unit_test_api.model.property_named_ref_that_is_not_a_reference import PropertyNamedRefThatIsNotAReference -from unit_test_api.model.ref_in_additionalproperties import RefInAdditionalproperties -from unit_test_api.model.ref_in_allof import RefInAllof -from unit_test_api.model.ref_in_anyof import RefInAnyof -from unit_test_api.model.ref_in_items import RefInItems -from unit_test_api.model.ref_in_oneof import RefInOneof -from unit_test_api.model.ref_in_property import RefInProperty -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" +used_configuration = api_configuration.ApiConfiguration( ) - - # Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: +with unit_test_api.ApiClient(used_configuration) as api_client: # Create an instance of the API class - api_instance = ref_api.RefApi(api_client) - property_named_ref_that_is_not_a_reference = PropertyNamedRefThatIsNotAReference(None) # PropertyNamedRefThatIsNotAReference | + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + # example passing only required values which don't have defaults set + body = additionalproperties_allows_a_schema_which_should_validate.AdditionalpropertiesAllowsASchemaWhichShouldValidate( + foo=None, + bar=None, + ) try: - api_instance.post_property_named_ref_that_is_not_a_reference_request_body(property_named_ref_that_is_not_a_reference) + api_response = api_instance.post_additionalproperties_allows_a_schema_which_should_validate_request_body( + body=body, + ) + pprint(api_response) except unit_test_api.ApiException as e: - print("Exception when calling RefApi->post_property_named_ref_that_is_not_a_reference_request_body: %s\n" % e) + print("Exception when calling OperationRequestBodyApi->post_additionalproperties_allows_a_schema_which_should_validate_request_body: %s\n" % e) ``` -## Documentation for API Endpoints - -All URIs are relative to *https://someserver.com/v1* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*RefApi* | [**post_property_named_ref_that_is_not_a_reference_request_body**](docs/apis/tags/RefApi.md#post_property_named_ref_that_is_not_a_reference_request_body) | **post** /requestBody/postPropertyNamedRefThatIsNotAReferenceRequestBody | -*RefApi* | [**post_property_named_ref_that_is_not_a_reference_response_body_for_content_types**](docs/apis/tags/RefApi.md#post_property_named_ref_that_is_not_a_reference_response_body_for_content_types) | **post** /responseBody/postPropertyNamedRefThatIsNotAReferenceResponseBodyForContentTypes | -*RefApi* | [**post_ref_in_additionalproperties_request_body**](docs/apis/tags/RefApi.md#post_ref_in_additionalproperties_request_body) | **post** /requestBody/postRefInAdditionalpropertiesRequestBody | -*RefApi* | [**post_ref_in_additionalproperties_response_body_for_content_types**](docs/apis/tags/RefApi.md#post_ref_in_additionalproperties_response_body_for_content_types) | **post** /responseBody/postRefInAdditionalpropertiesResponseBodyForContentTypes | -*RefApi* | [**post_ref_in_allof_request_body**](docs/apis/tags/RefApi.md#post_ref_in_allof_request_body) | **post** /requestBody/postRefInAllofRequestBody | -*RefApi* | [**post_ref_in_allof_response_body_for_content_types**](docs/apis/tags/RefApi.md#post_ref_in_allof_response_body_for_content_types) | **post** /responseBody/postRefInAllofResponseBodyForContentTypes | -*RefApi* | [**post_ref_in_anyof_request_body**](docs/apis/tags/RefApi.md#post_ref_in_anyof_request_body) | **post** /requestBody/postRefInAnyofRequestBody | -*RefApi* | [**post_ref_in_anyof_response_body_for_content_types**](docs/apis/tags/RefApi.md#post_ref_in_anyof_response_body_for_content_types) | **post** /responseBody/postRefInAnyofResponseBodyForContentTypes | -*RefApi* | [**post_ref_in_items_request_body**](docs/apis/tags/RefApi.md#post_ref_in_items_request_body) | **post** /requestBody/postRefInItemsRequestBody | -*RefApi* | [**post_ref_in_items_response_body_for_content_types**](docs/apis/tags/RefApi.md#post_ref_in_items_response_body_for_content_types) | **post** /responseBody/postRefInItemsResponseBodyForContentTypes | -*RefApi* | [**post_ref_in_not_request_body**](docs/apis/tags/RefApi.md#post_ref_in_not_request_body) | **post** /requestBody/postRefInNotRequestBody | -*RefApi* | [**post_ref_in_not_response_body_for_content_types**](docs/apis/tags/RefApi.md#post_ref_in_not_response_body_for_content_types) | **post** /responseBody/postRefInNotResponseBodyForContentTypes | -*RefApi* | [**post_ref_in_oneof_request_body**](docs/apis/tags/RefApi.md#post_ref_in_oneof_request_body) | **post** /requestBody/postRefInOneofRequestBody | -*RefApi* | [**post_ref_in_oneof_response_body_for_content_types**](docs/apis/tags/RefApi.md#post_ref_in_oneof_response_body_for_content_types) | **post** /responseBody/postRefInOneofResponseBodyForContentTypes | -*RefApi* | [**post_ref_in_property_request_body**](docs/apis/tags/RefApi.md#post_ref_in_property_request_body) | **post** /requestBody/postRefInPropertyRequestBody | -*RefApi* | [**post_ref_in_property_response_body_for_content_types**](docs/apis/tags/RefApi.md#post_ref_in_property_response_body_for_content_types) | **post** /responseBody/postRefInPropertyResponseBodyForContentTypes | -*AdditionalPropertiesApi* | [**post_additionalproperties_allows_a_schema_which_should_validate_request_body**](docs/apis/tags/AdditionalPropertiesApi.md#post_additionalproperties_allows_a_schema_which_should_validate_request_body) | **post** /requestBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody | -*AdditionalPropertiesApi* | [**post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types**](docs/apis/tags/AdditionalPropertiesApi.md#post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types) | **post** /responseBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateResponseBodyForContentTypes | -*AdditionalPropertiesApi* | [**post_additionalproperties_are_allowed_by_default_request_body**](docs/apis/tags/AdditionalPropertiesApi.md#post_additionalproperties_are_allowed_by_default_request_body) | **post** /requestBody/postAdditionalpropertiesAreAllowedByDefaultRequestBody | -*AdditionalPropertiesApi* | [**post_additionalproperties_are_allowed_by_default_response_body_for_content_types**](docs/apis/tags/AdditionalPropertiesApi.md#post_additionalproperties_are_allowed_by_default_response_body_for_content_types) | **post** /responseBody/postAdditionalpropertiesAreAllowedByDefaultResponseBodyForContentTypes | -*AdditionalPropertiesApi* | [**post_additionalproperties_can_exist_by_itself_request_body**](docs/apis/tags/AdditionalPropertiesApi.md#post_additionalproperties_can_exist_by_itself_request_body) | **post** /requestBody/postAdditionalpropertiesCanExistByItselfRequestBody | -*AdditionalPropertiesApi* | [**post_additionalproperties_can_exist_by_itself_response_body_for_content_types**](docs/apis/tags/AdditionalPropertiesApi.md#post_additionalproperties_can_exist_by_itself_response_body_for_content_types) | **post** /responseBody/postAdditionalpropertiesCanExistByItselfResponseBodyForContentTypes | -*AdditionalPropertiesApi* | [**post_additionalproperties_should_not_look_in_applicators_request_body**](docs/apis/tags/AdditionalPropertiesApi.md#post_additionalproperties_should_not_look_in_applicators_request_body) | **post** /requestBody/postAdditionalpropertiesShouldNotLookInApplicatorsRequestBody | -*AdditionalPropertiesApi* | [**post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types**](docs/apis/tags/AdditionalPropertiesApi.md#post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types) | **post** /responseBody/postAdditionalpropertiesShouldNotLookInApplicatorsResponseBodyForContentTypes | -*AllOfApi* | [**post_allof_combined_with_anyof_oneof_request_body**](docs/apis/tags/AllOfApi.md#post_allof_combined_with_anyof_oneof_request_body) | **post** /requestBody/postAllofCombinedWithAnyofOneofRequestBody | -*AllOfApi* | [**post_allof_combined_with_anyof_oneof_response_body_for_content_types**](docs/apis/tags/AllOfApi.md#post_allof_combined_with_anyof_oneof_response_body_for_content_types) | **post** /responseBody/postAllofCombinedWithAnyofOneofResponseBodyForContentTypes | -*AllOfApi* | [**post_allof_request_body**](docs/apis/tags/AllOfApi.md#post_allof_request_body) | **post** /requestBody/postAllofRequestBody | -*AllOfApi* | [**post_allof_response_body_for_content_types**](docs/apis/tags/AllOfApi.md#post_allof_response_body_for_content_types) | **post** /responseBody/postAllofResponseBodyForContentTypes | -*AllOfApi* | [**post_allof_simple_types_request_body**](docs/apis/tags/AllOfApi.md#post_allof_simple_types_request_body) | **post** /requestBody/postAllofSimpleTypesRequestBody | -*AllOfApi* | [**post_allof_simple_types_response_body_for_content_types**](docs/apis/tags/AllOfApi.md#post_allof_simple_types_response_body_for_content_types) | **post** /responseBody/postAllofSimpleTypesResponseBodyForContentTypes | -*AllOfApi* | [**post_allof_with_base_schema_request_body**](docs/apis/tags/AllOfApi.md#post_allof_with_base_schema_request_body) | **post** /requestBody/postAllofWithBaseSchemaRequestBody | -*AllOfApi* | [**post_allof_with_base_schema_response_body_for_content_types**](docs/apis/tags/AllOfApi.md#post_allof_with_base_schema_response_body_for_content_types) | **post** /responseBody/postAllofWithBaseSchemaResponseBodyForContentTypes | -*AllOfApi* | [**post_allof_with_one_empty_schema_request_body**](docs/apis/tags/AllOfApi.md#post_allof_with_one_empty_schema_request_body) | **post** /requestBody/postAllofWithOneEmptySchemaRequestBody | -*AllOfApi* | [**post_allof_with_one_empty_schema_response_body_for_content_types**](docs/apis/tags/AllOfApi.md#post_allof_with_one_empty_schema_response_body_for_content_types) | **post** /responseBody/postAllofWithOneEmptySchemaResponseBodyForContentTypes | -*AllOfApi* | [**post_allof_with_the_first_empty_schema_request_body**](docs/apis/tags/AllOfApi.md#post_allof_with_the_first_empty_schema_request_body) | **post** /requestBody/postAllofWithTheFirstEmptySchemaRequestBody | -*AllOfApi* | [**post_allof_with_the_first_empty_schema_response_body_for_content_types**](docs/apis/tags/AllOfApi.md#post_allof_with_the_first_empty_schema_response_body_for_content_types) | **post** /responseBody/postAllofWithTheFirstEmptySchemaResponseBodyForContentTypes | -*AllOfApi* | [**post_allof_with_the_last_empty_schema_request_body**](docs/apis/tags/AllOfApi.md#post_allof_with_the_last_empty_schema_request_body) | **post** /requestBody/postAllofWithTheLastEmptySchemaRequestBody | -*AllOfApi* | [**post_allof_with_the_last_empty_schema_response_body_for_content_types**](docs/apis/tags/AllOfApi.md#post_allof_with_the_last_empty_schema_response_body_for_content_types) | **post** /responseBody/postAllofWithTheLastEmptySchemaResponseBodyForContentTypes | -*AllOfApi* | [**post_allof_with_two_empty_schemas_request_body**](docs/apis/tags/AllOfApi.md#post_allof_with_two_empty_schemas_request_body) | **post** /requestBody/postAllofWithTwoEmptySchemasRequestBody | -*AllOfApi* | [**post_allof_with_two_empty_schemas_response_body_for_content_types**](docs/apis/tags/AllOfApi.md#post_allof_with_two_empty_schemas_response_body_for_content_types) | **post** /responseBody/postAllofWithTwoEmptySchemasResponseBodyForContentTypes | -*AllOfApi* | [**post_nested_allof_to_check_validation_semantics_request_body**](docs/apis/tags/AllOfApi.md#post_nested_allof_to_check_validation_semantics_request_body) | **post** /requestBody/postNestedAllofToCheckValidationSemanticsRequestBody | -*AllOfApi* | [**post_nested_allof_to_check_validation_semantics_response_body_for_content_types**](docs/apis/tags/AllOfApi.md#post_nested_allof_to_check_validation_semantics_response_body_for_content_types) | **post** /responseBody/postNestedAllofToCheckValidationSemanticsResponseBodyForContentTypes | -*AnyOfApi* | [**post_anyof_complex_types_request_body**](docs/apis/tags/AnyOfApi.md#post_anyof_complex_types_request_body) | **post** /requestBody/postAnyofComplexTypesRequestBody | -*AnyOfApi* | [**post_anyof_complex_types_response_body_for_content_types**](docs/apis/tags/AnyOfApi.md#post_anyof_complex_types_response_body_for_content_types) | **post** /responseBody/postAnyofComplexTypesResponseBodyForContentTypes | -*AnyOfApi* | [**post_anyof_request_body**](docs/apis/tags/AnyOfApi.md#post_anyof_request_body) | **post** /requestBody/postAnyofRequestBody | -*AnyOfApi* | [**post_anyof_response_body_for_content_types**](docs/apis/tags/AnyOfApi.md#post_anyof_response_body_for_content_types) | **post** /responseBody/postAnyofResponseBodyForContentTypes | -*AnyOfApi* | [**post_anyof_with_base_schema_request_body**](docs/apis/tags/AnyOfApi.md#post_anyof_with_base_schema_request_body) | **post** /requestBody/postAnyofWithBaseSchemaRequestBody | -*AnyOfApi* | [**post_anyof_with_base_schema_response_body_for_content_types**](docs/apis/tags/AnyOfApi.md#post_anyof_with_base_schema_response_body_for_content_types) | **post** /responseBody/postAnyofWithBaseSchemaResponseBodyForContentTypes | -*AnyOfApi* | [**post_anyof_with_one_empty_schema_request_body**](docs/apis/tags/AnyOfApi.md#post_anyof_with_one_empty_schema_request_body) | **post** /requestBody/postAnyofWithOneEmptySchemaRequestBody | -*AnyOfApi* | [**post_anyof_with_one_empty_schema_response_body_for_content_types**](docs/apis/tags/AnyOfApi.md#post_anyof_with_one_empty_schema_response_body_for_content_types) | **post** /responseBody/postAnyofWithOneEmptySchemaResponseBodyForContentTypes | -*AnyOfApi* | [**post_nested_anyof_to_check_validation_semantics_request_body**](docs/apis/tags/AnyOfApi.md#post_nested_anyof_to_check_validation_semantics_request_body) | **post** /requestBody/postNestedAnyofToCheckValidationSemanticsRequestBody | -*AnyOfApi* | [**post_nested_anyof_to_check_validation_semantics_response_body_for_content_types**](docs/apis/tags/AnyOfApi.md#post_nested_anyof_to_check_validation_semantics_response_body_for_content_types) | **post** /responseBody/postNestedAnyofToCheckValidationSemanticsResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_additionalproperties_allows_a_schema_which_should_validate_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_additionalproperties_allows_a_schema_which_should_validate_request_body) | **post** /requestBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody | -*ContentTypeJsonApi* | [**post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types) | **post** /responseBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_additionalproperties_are_allowed_by_default_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_additionalproperties_are_allowed_by_default_request_body) | **post** /requestBody/postAdditionalpropertiesAreAllowedByDefaultRequestBody | -*ContentTypeJsonApi* | [**post_additionalproperties_are_allowed_by_default_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_additionalproperties_are_allowed_by_default_response_body_for_content_types) | **post** /responseBody/postAdditionalpropertiesAreAllowedByDefaultResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_additionalproperties_can_exist_by_itself_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_additionalproperties_can_exist_by_itself_request_body) | **post** /requestBody/postAdditionalpropertiesCanExistByItselfRequestBody | -*ContentTypeJsonApi* | [**post_additionalproperties_can_exist_by_itself_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_additionalproperties_can_exist_by_itself_response_body_for_content_types) | **post** /responseBody/postAdditionalpropertiesCanExistByItselfResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_additionalproperties_should_not_look_in_applicators_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_additionalproperties_should_not_look_in_applicators_request_body) | **post** /requestBody/postAdditionalpropertiesShouldNotLookInApplicatorsRequestBody | -*ContentTypeJsonApi* | [**post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types) | **post** /responseBody/postAdditionalpropertiesShouldNotLookInApplicatorsResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_allof_combined_with_anyof_oneof_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_allof_combined_with_anyof_oneof_request_body) | **post** /requestBody/postAllofCombinedWithAnyofOneofRequestBody | -*ContentTypeJsonApi* | [**post_allof_combined_with_anyof_oneof_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_allof_combined_with_anyof_oneof_response_body_for_content_types) | **post** /responseBody/postAllofCombinedWithAnyofOneofResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_allof_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_allof_request_body) | **post** /requestBody/postAllofRequestBody | -*ContentTypeJsonApi* | [**post_allof_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_allof_response_body_for_content_types) | **post** /responseBody/postAllofResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_allof_simple_types_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_allof_simple_types_request_body) | **post** /requestBody/postAllofSimpleTypesRequestBody | -*ContentTypeJsonApi* | [**post_allof_simple_types_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_allof_simple_types_response_body_for_content_types) | **post** /responseBody/postAllofSimpleTypesResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_allof_with_base_schema_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_allof_with_base_schema_request_body) | **post** /requestBody/postAllofWithBaseSchemaRequestBody | -*ContentTypeJsonApi* | [**post_allof_with_base_schema_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_allof_with_base_schema_response_body_for_content_types) | **post** /responseBody/postAllofWithBaseSchemaResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_allof_with_one_empty_schema_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_allof_with_one_empty_schema_request_body) | **post** /requestBody/postAllofWithOneEmptySchemaRequestBody | -*ContentTypeJsonApi* | [**post_allof_with_one_empty_schema_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_allof_with_one_empty_schema_response_body_for_content_types) | **post** /responseBody/postAllofWithOneEmptySchemaResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_allof_with_the_first_empty_schema_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_allof_with_the_first_empty_schema_request_body) | **post** /requestBody/postAllofWithTheFirstEmptySchemaRequestBody | -*ContentTypeJsonApi* | [**post_allof_with_the_first_empty_schema_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_allof_with_the_first_empty_schema_response_body_for_content_types) | **post** /responseBody/postAllofWithTheFirstEmptySchemaResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_allof_with_the_last_empty_schema_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_allof_with_the_last_empty_schema_request_body) | **post** /requestBody/postAllofWithTheLastEmptySchemaRequestBody | -*ContentTypeJsonApi* | [**post_allof_with_the_last_empty_schema_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_allof_with_the_last_empty_schema_response_body_for_content_types) | **post** /responseBody/postAllofWithTheLastEmptySchemaResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_allof_with_two_empty_schemas_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_allof_with_two_empty_schemas_request_body) | **post** /requestBody/postAllofWithTwoEmptySchemasRequestBody | -*ContentTypeJsonApi* | [**post_allof_with_two_empty_schemas_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_allof_with_two_empty_schemas_response_body_for_content_types) | **post** /responseBody/postAllofWithTwoEmptySchemasResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_anyof_complex_types_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_anyof_complex_types_request_body) | **post** /requestBody/postAnyofComplexTypesRequestBody | -*ContentTypeJsonApi* | [**post_anyof_complex_types_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_anyof_complex_types_response_body_for_content_types) | **post** /responseBody/postAnyofComplexTypesResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_anyof_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_anyof_request_body) | **post** /requestBody/postAnyofRequestBody | -*ContentTypeJsonApi* | [**post_anyof_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_anyof_response_body_for_content_types) | **post** /responseBody/postAnyofResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_anyof_with_base_schema_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_anyof_with_base_schema_request_body) | **post** /requestBody/postAnyofWithBaseSchemaRequestBody | -*ContentTypeJsonApi* | [**post_anyof_with_base_schema_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_anyof_with_base_schema_response_body_for_content_types) | **post** /responseBody/postAnyofWithBaseSchemaResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_anyof_with_one_empty_schema_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_anyof_with_one_empty_schema_request_body) | **post** /requestBody/postAnyofWithOneEmptySchemaRequestBody | -*ContentTypeJsonApi* | [**post_anyof_with_one_empty_schema_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_anyof_with_one_empty_schema_response_body_for_content_types) | **post** /responseBody/postAnyofWithOneEmptySchemaResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_array_type_matches_arrays_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_array_type_matches_arrays_request_body) | **post** /requestBody/postArrayTypeMatchesArraysRequestBody | -*ContentTypeJsonApi* | [**post_array_type_matches_arrays_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_array_type_matches_arrays_response_body_for_content_types) | **post** /responseBody/postArrayTypeMatchesArraysResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_boolean_type_matches_booleans_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_boolean_type_matches_booleans_request_body) | **post** /requestBody/postBooleanTypeMatchesBooleansRequestBody | -*ContentTypeJsonApi* | [**post_boolean_type_matches_booleans_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_boolean_type_matches_booleans_response_body_for_content_types) | **post** /responseBody/postBooleanTypeMatchesBooleansResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_by_int_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_by_int_request_body) | **post** /requestBody/postByIntRequestBody | -*ContentTypeJsonApi* | [**post_by_int_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_by_int_response_body_for_content_types) | **post** /responseBody/postByIntResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_by_number_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_by_number_request_body) | **post** /requestBody/postByNumberRequestBody | -*ContentTypeJsonApi* | [**post_by_number_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_by_number_response_body_for_content_types) | **post** /responseBody/postByNumberResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_by_small_number_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_by_small_number_request_body) | **post** /requestBody/postBySmallNumberRequestBody | -*ContentTypeJsonApi* | [**post_by_small_number_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_by_small_number_response_body_for_content_types) | **post** /responseBody/postBySmallNumberResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_date_time_format_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_date_time_format_request_body) | **post** /requestBody/postDateTimeFormatRequestBody | -*ContentTypeJsonApi* | [**post_date_time_format_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_date_time_format_response_body_for_content_types) | **post** /responseBody/postDateTimeFormatResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_email_format_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_email_format_request_body) | **post** /requestBody/postEmailFormatRequestBody | -*ContentTypeJsonApi* | [**post_email_format_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_email_format_response_body_for_content_types) | **post** /responseBody/postEmailFormatResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_enum_with0_does_not_match_false_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_enum_with0_does_not_match_false_request_body) | **post** /requestBody/postEnumWith0DoesNotMatchFalseRequestBody | -*ContentTypeJsonApi* | [**post_enum_with0_does_not_match_false_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_enum_with0_does_not_match_false_response_body_for_content_types) | **post** /responseBody/postEnumWith0DoesNotMatchFalseResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_enum_with1_does_not_match_true_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_enum_with1_does_not_match_true_request_body) | **post** /requestBody/postEnumWith1DoesNotMatchTrueRequestBody | -*ContentTypeJsonApi* | [**post_enum_with1_does_not_match_true_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_enum_with1_does_not_match_true_response_body_for_content_types) | **post** /responseBody/postEnumWith1DoesNotMatchTrueResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_enum_with_escaped_characters_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_enum_with_escaped_characters_request_body) | **post** /requestBody/postEnumWithEscapedCharactersRequestBody | -*ContentTypeJsonApi* | [**post_enum_with_escaped_characters_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_enum_with_escaped_characters_response_body_for_content_types) | **post** /responseBody/postEnumWithEscapedCharactersResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_enum_with_false_does_not_match0_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_enum_with_false_does_not_match0_request_body) | **post** /requestBody/postEnumWithFalseDoesNotMatch0RequestBody | -*ContentTypeJsonApi* | [**post_enum_with_false_does_not_match0_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_enum_with_false_does_not_match0_response_body_for_content_types) | **post** /responseBody/postEnumWithFalseDoesNotMatch0ResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_enum_with_true_does_not_match1_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_enum_with_true_does_not_match1_request_body) | **post** /requestBody/postEnumWithTrueDoesNotMatch1RequestBody | -*ContentTypeJsonApi* | [**post_enum_with_true_does_not_match1_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_enum_with_true_does_not_match1_response_body_for_content_types) | **post** /responseBody/postEnumWithTrueDoesNotMatch1ResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_enums_in_properties_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_enums_in_properties_request_body) | **post** /requestBody/postEnumsInPropertiesRequestBody | -*ContentTypeJsonApi* | [**post_enums_in_properties_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_enums_in_properties_response_body_for_content_types) | **post** /responseBody/postEnumsInPropertiesResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_forbidden_property_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_forbidden_property_request_body) | **post** /requestBody/postForbiddenPropertyRequestBody | -*ContentTypeJsonApi* | [**post_forbidden_property_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_forbidden_property_response_body_for_content_types) | **post** /responseBody/postForbiddenPropertyResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_hostname_format_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_hostname_format_request_body) | **post** /requestBody/postHostnameFormatRequestBody | -*ContentTypeJsonApi* | [**post_hostname_format_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_hostname_format_response_body_for_content_types) | **post** /responseBody/postHostnameFormatResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_integer_type_matches_integers_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_integer_type_matches_integers_request_body) | **post** /requestBody/postIntegerTypeMatchesIntegersRequestBody | -*ContentTypeJsonApi* | [**post_integer_type_matches_integers_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_integer_type_matches_integers_response_body_for_content_types) | **post** /responseBody/postIntegerTypeMatchesIntegersResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body) | **post** /requestBody/postInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody | -*ContentTypeJsonApi* | [**post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types) | **post** /responseBody/postInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_invalid_string_value_for_default_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_invalid_string_value_for_default_request_body) | **post** /requestBody/postInvalidStringValueForDefaultRequestBody | -*ContentTypeJsonApi* | [**post_invalid_string_value_for_default_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_invalid_string_value_for_default_response_body_for_content_types) | **post** /responseBody/postInvalidStringValueForDefaultResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_ipv4_format_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_ipv4_format_request_body) | **post** /requestBody/postIpv4FormatRequestBody | -*ContentTypeJsonApi* | [**post_ipv4_format_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_ipv4_format_response_body_for_content_types) | **post** /responseBody/postIpv4FormatResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_ipv6_format_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_ipv6_format_request_body) | **post** /requestBody/postIpv6FormatRequestBody | -*ContentTypeJsonApi* | [**post_ipv6_format_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_ipv6_format_response_body_for_content_types) | **post** /responseBody/postIpv6FormatResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_json_pointer_format_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_json_pointer_format_request_body) | **post** /requestBody/postJsonPointerFormatRequestBody | -*ContentTypeJsonApi* | [**post_json_pointer_format_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_json_pointer_format_response_body_for_content_types) | **post** /responseBody/postJsonPointerFormatResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_maximum_validation_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_maximum_validation_request_body) | **post** /requestBody/postMaximumValidationRequestBody | -*ContentTypeJsonApi* | [**post_maximum_validation_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_maximum_validation_response_body_for_content_types) | **post** /responseBody/postMaximumValidationResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_maximum_validation_with_unsigned_integer_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_maximum_validation_with_unsigned_integer_request_body) | **post** /requestBody/postMaximumValidationWithUnsignedIntegerRequestBody | -*ContentTypeJsonApi* | [**post_maximum_validation_with_unsigned_integer_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_maximum_validation_with_unsigned_integer_response_body_for_content_types) | **post** /responseBody/postMaximumValidationWithUnsignedIntegerResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_maxitems_validation_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_maxitems_validation_request_body) | **post** /requestBody/postMaxitemsValidationRequestBody | -*ContentTypeJsonApi* | [**post_maxitems_validation_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_maxitems_validation_response_body_for_content_types) | **post** /responseBody/postMaxitemsValidationResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_maxlength_validation_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_maxlength_validation_request_body) | **post** /requestBody/postMaxlengthValidationRequestBody | -*ContentTypeJsonApi* | [**post_maxlength_validation_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_maxlength_validation_response_body_for_content_types) | **post** /responseBody/postMaxlengthValidationResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_maxproperties0_means_the_object_is_empty_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_maxproperties0_means_the_object_is_empty_request_body) | **post** /requestBody/postMaxproperties0MeansTheObjectIsEmptyRequestBody | -*ContentTypeJsonApi* | [**post_maxproperties0_means_the_object_is_empty_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_maxproperties0_means_the_object_is_empty_response_body_for_content_types) | **post** /responseBody/postMaxproperties0MeansTheObjectIsEmptyResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_maxproperties_validation_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_maxproperties_validation_request_body) | **post** /requestBody/postMaxpropertiesValidationRequestBody | -*ContentTypeJsonApi* | [**post_maxproperties_validation_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_maxproperties_validation_response_body_for_content_types) | **post** /responseBody/postMaxpropertiesValidationResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_minimum_validation_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_minimum_validation_request_body) | **post** /requestBody/postMinimumValidationRequestBody | -*ContentTypeJsonApi* | [**post_minimum_validation_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_minimum_validation_response_body_for_content_types) | **post** /responseBody/postMinimumValidationResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_minimum_validation_with_signed_integer_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_minimum_validation_with_signed_integer_request_body) | **post** /requestBody/postMinimumValidationWithSignedIntegerRequestBody | -*ContentTypeJsonApi* | [**post_minimum_validation_with_signed_integer_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_minimum_validation_with_signed_integer_response_body_for_content_types) | **post** /responseBody/postMinimumValidationWithSignedIntegerResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_minitems_validation_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_minitems_validation_request_body) | **post** /requestBody/postMinitemsValidationRequestBody | -*ContentTypeJsonApi* | [**post_minitems_validation_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_minitems_validation_response_body_for_content_types) | **post** /responseBody/postMinitemsValidationResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_minlength_validation_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_minlength_validation_request_body) | **post** /requestBody/postMinlengthValidationRequestBody | -*ContentTypeJsonApi* | [**post_minlength_validation_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_minlength_validation_response_body_for_content_types) | **post** /responseBody/postMinlengthValidationResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_minproperties_validation_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_minproperties_validation_request_body) | **post** /requestBody/postMinpropertiesValidationRequestBody | -*ContentTypeJsonApi* | [**post_minproperties_validation_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_minproperties_validation_response_body_for_content_types) | **post** /responseBody/postMinpropertiesValidationResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_nested_allof_to_check_validation_semantics_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_nested_allof_to_check_validation_semantics_request_body) | **post** /requestBody/postNestedAllofToCheckValidationSemanticsRequestBody | -*ContentTypeJsonApi* | [**post_nested_allof_to_check_validation_semantics_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_nested_allof_to_check_validation_semantics_response_body_for_content_types) | **post** /responseBody/postNestedAllofToCheckValidationSemanticsResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_nested_anyof_to_check_validation_semantics_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_nested_anyof_to_check_validation_semantics_request_body) | **post** /requestBody/postNestedAnyofToCheckValidationSemanticsRequestBody | -*ContentTypeJsonApi* | [**post_nested_anyof_to_check_validation_semantics_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_nested_anyof_to_check_validation_semantics_response_body_for_content_types) | **post** /responseBody/postNestedAnyofToCheckValidationSemanticsResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_nested_items_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_nested_items_request_body) | **post** /requestBody/postNestedItemsRequestBody | -*ContentTypeJsonApi* | [**post_nested_items_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_nested_items_response_body_for_content_types) | **post** /responseBody/postNestedItemsResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_nested_oneof_to_check_validation_semantics_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_nested_oneof_to_check_validation_semantics_request_body) | **post** /requestBody/postNestedOneofToCheckValidationSemanticsRequestBody | -*ContentTypeJsonApi* | [**post_nested_oneof_to_check_validation_semantics_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_nested_oneof_to_check_validation_semantics_response_body_for_content_types) | **post** /responseBody/postNestedOneofToCheckValidationSemanticsResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_not_more_complex_schema_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_not_more_complex_schema_request_body) | **post** /requestBody/postNotMoreComplexSchemaRequestBody | -*ContentTypeJsonApi* | [**post_not_more_complex_schema_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_not_more_complex_schema_response_body_for_content_types) | **post** /responseBody/postNotMoreComplexSchemaResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_not_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_not_request_body) | **post** /requestBody/postNotRequestBody | -*ContentTypeJsonApi* | [**post_not_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_not_response_body_for_content_types) | **post** /responseBody/postNotResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_nul_characters_in_strings_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_nul_characters_in_strings_request_body) | **post** /requestBody/postNulCharactersInStringsRequestBody | -*ContentTypeJsonApi* | [**post_nul_characters_in_strings_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_nul_characters_in_strings_response_body_for_content_types) | **post** /responseBody/postNulCharactersInStringsResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_null_type_matches_only_the_null_object_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_null_type_matches_only_the_null_object_request_body) | **post** /requestBody/postNullTypeMatchesOnlyTheNullObjectRequestBody | -*ContentTypeJsonApi* | [**post_null_type_matches_only_the_null_object_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_null_type_matches_only_the_null_object_response_body_for_content_types) | **post** /responseBody/postNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_number_type_matches_numbers_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_number_type_matches_numbers_request_body) | **post** /requestBody/postNumberTypeMatchesNumbersRequestBody | -*ContentTypeJsonApi* | [**post_number_type_matches_numbers_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_number_type_matches_numbers_response_body_for_content_types) | **post** /responseBody/postNumberTypeMatchesNumbersResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_object_properties_validation_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_object_properties_validation_request_body) | **post** /requestBody/postObjectPropertiesValidationRequestBody | -*ContentTypeJsonApi* | [**post_object_properties_validation_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_object_properties_validation_response_body_for_content_types) | **post** /responseBody/postObjectPropertiesValidationResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_object_type_matches_objects_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_object_type_matches_objects_request_body) | **post** /requestBody/postObjectTypeMatchesObjectsRequestBody | -*ContentTypeJsonApi* | [**post_object_type_matches_objects_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_object_type_matches_objects_response_body_for_content_types) | **post** /responseBody/postObjectTypeMatchesObjectsResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_oneof_complex_types_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_oneof_complex_types_request_body) | **post** /requestBody/postOneofComplexTypesRequestBody | -*ContentTypeJsonApi* | [**post_oneof_complex_types_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_oneof_complex_types_response_body_for_content_types) | **post** /responseBody/postOneofComplexTypesResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_oneof_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_oneof_request_body) | **post** /requestBody/postOneofRequestBody | -*ContentTypeJsonApi* | [**post_oneof_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_oneof_response_body_for_content_types) | **post** /responseBody/postOneofResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_oneof_with_base_schema_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_oneof_with_base_schema_request_body) | **post** /requestBody/postOneofWithBaseSchemaRequestBody | -*ContentTypeJsonApi* | [**post_oneof_with_base_schema_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_oneof_with_base_schema_response_body_for_content_types) | **post** /responseBody/postOneofWithBaseSchemaResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_oneof_with_empty_schema_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_oneof_with_empty_schema_request_body) | **post** /requestBody/postOneofWithEmptySchemaRequestBody | -*ContentTypeJsonApi* | [**post_oneof_with_empty_schema_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_oneof_with_empty_schema_response_body_for_content_types) | **post** /responseBody/postOneofWithEmptySchemaResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_oneof_with_required_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_oneof_with_required_request_body) | **post** /requestBody/postOneofWithRequiredRequestBody | -*ContentTypeJsonApi* | [**post_oneof_with_required_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_oneof_with_required_response_body_for_content_types) | **post** /responseBody/postOneofWithRequiredResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_pattern_is_not_anchored_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_pattern_is_not_anchored_request_body) | **post** /requestBody/postPatternIsNotAnchoredRequestBody | -*ContentTypeJsonApi* | [**post_pattern_is_not_anchored_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_pattern_is_not_anchored_response_body_for_content_types) | **post** /responseBody/postPatternIsNotAnchoredResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_pattern_validation_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_pattern_validation_request_body) | **post** /requestBody/postPatternValidationRequestBody | -*ContentTypeJsonApi* | [**post_pattern_validation_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_pattern_validation_response_body_for_content_types) | **post** /responseBody/postPatternValidationResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_properties_with_escaped_characters_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_properties_with_escaped_characters_request_body) | **post** /requestBody/postPropertiesWithEscapedCharactersRequestBody | -*ContentTypeJsonApi* | [**post_properties_with_escaped_characters_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_properties_with_escaped_characters_response_body_for_content_types) | **post** /responseBody/postPropertiesWithEscapedCharactersResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_property_named_ref_that_is_not_a_reference_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_property_named_ref_that_is_not_a_reference_request_body) | **post** /requestBody/postPropertyNamedRefThatIsNotAReferenceRequestBody | -*ContentTypeJsonApi* | [**post_property_named_ref_that_is_not_a_reference_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_property_named_ref_that_is_not_a_reference_response_body_for_content_types) | **post** /responseBody/postPropertyNamedRefThatIsNotAReferenceResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_ref_in_additionalproperties_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_ref_in_additionalproperties_request_body) | **post** /requestBody/postRefInAdditionalpropertiesRequestBody | -*ContentTypeJsonApi* | [**post_ref_in_additionalproperties_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_ref_in_additionalproperties_response_body_for_content_types) | **post** /responseBody/postRefInAdditionalpropertiesResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_ref_in_allof_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_ref_in_allof_request_body) | **post** /requestBody/postRefInAllofRequestBody | -*ContentTypeJsonApi* | [**post_ref_in_allof_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_ref_in_allof_response_body_for_content_types) | **post** /responseBody/postRefInAllofResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_ref_in_anyof_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_ref_in_anyof_request_body) | **post** /requestBody/postRefInAnyofRequestBody | -*ContentTypeJsonApi* | [**post_ref_in_anyof_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_ref_in_anyof_response_body_for_content_types) | **post** /responseBody/postRefInAnyofResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_ref_in_items_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_ref_in_items_request_body) | **post** /requestBody/postRefInItemsRequestBody | -*ContentTypeJsonApi* | [**post_ref_in_items_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_ref_in_items_response_body_for_content_types) | **post** /responseBody/postRefInItemsResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_ref_in_not_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_ref_in_not_request_body) | **post** /requestBody/postRefInNotRequestBody | -*ContentTypeJsonApi* | [**post_ref_in_not_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_ref_in_not_response_body_for_content_types) | **post** /responseBody/postRefInNotResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_ref_in_oneof_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_ref_in_oneof_request_body) | **post** /requestBody/postRefInOneofRequestBody | -*ContentTypeJsonApi* | [**post_ref_in_oneof_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_ref_in_oneof_response_body_for_content_types) | **post** /responseBody/postRefInOneofResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_ref_in_property_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_ref_in_property_request_body) | **post** /requestBody/postRefInPropertyRequestBody | -*ContentTypeJsonApi* | [**post_ref_in_property_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_ref_in_property_response_body_for_content_types) | **post** /responseBody/postRefInPropertyResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_required_default_validation_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_required_default_validation_request_body) | **post** /requestBody/postRequiredDefaultValidationRequestBody | -*ContentTypeJsonApi* | [**post_required_default_validation_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_required_default_validation_response_body_for_content_types) | **post** /responseBody/postRequiredDefaultValidationResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_required_validation_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_required_validation_request_body) | **post** /requestBody/postRequiredValidationRequestBody | -*ContentTypeJsonApi* | [**post_required_validation_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_required_validation_response_body_for_content_types) | **post** /responseBody/postRequiredValidationResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_required_with_empty_array_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_required_with_empty_array_request_body) | **post** /requestBody/postRequiredWithEmptyArrayRequestBody | -*ContentTypeJsonApi* | [**post_required_with_empty_array_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_required_with_empty_array_response_body_for_content_types) | **post** /responseBody/postRequiredWithEmptyArrayResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_required_with_escaped_characters_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_required_with_escaped_characters_request_body) | **post** /requestBody/postRequiredWithEscapedCharactersRequestBody | -*ContentTypeJsonApi* | [**post_required_with_escaped_characters_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_required_with_escaped_characters_response_body_for_content_types) | **post** /responseBody/postRequiredWithEscapedCharactersResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_simple_enum_validation_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_simple_enum_validation_request_body) | **post** /requestBody/postSimpleEnumValidationRequestBody | -*ContentTypeJsonApi* | [**post_simple_enum_validation_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_simple_enum_validation_response_body_for_content_types) | **post** /responseBody/postSimpleEnumValidationResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_string_type_matches_strings_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_string_type_matches_strings_request_body) | **post** /requestBody/postStringTypeMatchesStringsRequestBody | -*ContentTypeJsonApi* | [**post_string_type_matches_strings_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_string_type_matches_strings_response_body_for_content_types) | **post** /responseBody/postStringTypeMatchesStringsResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body) | **post** /requestBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody | -*ContentTypeJsonApi* | [**post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types) | **post** /responseBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_uniqueitems_false_validation_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_uniqueitems_false_validation_request_body) | **post** /requestBody/postUniqueitemsFalseValidationRequestBody | -*ContentTypeJsonApi* | [**post_uniqueitems_false_validation_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_uniqueitems_false_validation_response_body_for_content_types) | **post** /responseBody/postUniqueitemsFalseValidationResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_uniqueitems_validation_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_uniqueitems_validation_request_body) | **post** /requestBody/postUniqueitemsValidationRequestBody | -*ContentTypeJsonApi* | [**post_uniqueitems_validation_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_uniqueitems_validation_response_body_for_content_types) | **post** /responseBody/postUniqueitemsValidationResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_uri_format_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_uri_format_request_body) | **post** /requestBody/postUriFormatRequestBody | -*ContentTypeJsonApi* | [**post_uri_format_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_uri_format_response_body_for_content_types) | **post** /responseBody/postUriFormatResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_uri_reference_format_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_uri_reference_format_request_body) | **post** /requestBody/postUriReferenceFormatRequestBody | -*ContentTypeJsonApi* | [**post_uri_reference_format_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_uri_reference_format_response_body_for_content_types) | **post** /responseBody/postUriReferenceFormatResponseBodyForContentTypes | -*ContentTypeJsonApi* | [**post_uri_template_format_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_uri_template_format_request_body) | **post** /requestBody/postUriTemplateFormatRequestBody | -*ContentTypeJsonApi* | [**post_uri_template_format_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_uri_template_format_response_body_for_content_types) | **post** /responseBody/postUriTemplateFormatResponseBodyForContentTypes | -*DefaultApi* | [**post_invalid_string_value_for_default_request_body**](docs/apis/tags/DefaultApi.md#post_invalid_string_value_for_default_request_body) | **post** /requestBody/postInvalidStringValueForDefaultRequestBody | -*DefaultApi* | [**post_invalid_string_value_for_default_response_body_for_content_types**](docs/apis/tags/DefaultApi.md#post_invalid_string_value_for_default_response_body_for_content_types) | **post** /responseBody/postInvalidStringValueForDefaultResponseBodyForContentTypes | -*DefaultApi* | [**post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body**](docs/apis/tags/DefaultApi.md#post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body) | **post** /requestBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody | -*DefaultApi* | [**post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types**](docs/apis/tags/DefaultApi.md#post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types) | **post** /responseBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyForContentTypes | -*EnumApi* | [**post_enum_with0_does_not_match_false_request_body**](docs/apis/tags/EnumApi.md#post_enum_with0_does_not_match_false_request_body) | **post** /requestBody/postEnumWith0DoesNotMatchFalseRequestBody | -*EnumApi* | [**post_enum_with0_does_not_match_false_response_body_for_content_types**](docs/apis/tags/EnumApi.md#post_enum_with0_does_not_match_false_response_body_for_content_types) | **post** /responseBody/postEnumWith0DoesNotMatchFalseResponseBodyForContentTypes | -*EnumApi* | [**post_enum_with1_does_not_match_true_request_body**](docs/apis/tags/EnumApi.md#post_enum_with1_does_not_match_true_request_body) | **post** /requestBody/postEnumWith1DoesNotMatchTrueRequestBody | -*EnumApi* | [**post_enum_with1_does_not_match_true_response_body_for_content_types**](docs/apis/tags/EnumApi.md#post_enum_with1_does_not_match_true_response_body_for_content_types) | **post** /responseBody/postEnumWith1DoesNotMatchTrueResponseBodyForContentTypes | -*EnumApi* | [**post_enum_with_escaped_characters_request_body**](docs/apis/tags/EnumApi.md#post_enum_with_escaped_characters_request_body) | **post** /requestBody/postEnumWithEscapedCharactersRequestBody | -*EnumApi* | [**post_enum_with_escaped_characters_response_body_for_content_types**](docs/apis/tags/EnumApi.md#post_enum_with_escaped_characters_response_body_for_content_types) | **post** /responseBody/postEnumWithEscapedCharactersResponseBodyForContentTypes | -*EnumApi* | [**post_enum_with_false_does_not_match0_request_body**](docs/apis/tags/EnumApi.md#post_enum_with_false_does_not_match0_request_body) | **post** /requestBody/postEnumWithFalseDoesNotMatch0RequestBody | -*EnumApi* | [**post_enum_with_false_does_not_match0_response_body_for_content_types**](docs/apis/tags/EnumApi.md#post_enum_with_false_does_not_match0_response_body_for_content_types) | **post** /responseBody/postEnumWithFalseDoesNotMatch0ResponseBodyForContentTypes | -*EnumApi* | [**post_enum_with_true_does_not_match1_request_body**](docs/apis/tags/EnumApi.md#post_enum_with_true_does_not_match1_request_body) | **post** /requestBody/postEnumWithTrueDoesNotMatch1RequestBody | -*EnumApi* | [**post_enum_with_true_does_not_match1_response_body_for_content_types**](docs/apis/tags/EnumApi.md#post_enum_with_true_does_not_match1_response_body_for_content_types) | **post** /responseBody/postEnumWithTrueDoesNotMatch1ResponseBodyForContentTypes | -*EnumApi* | [**post_enums_in_properties_request_body**](docs/apis/tags/EnumApi.md#post_enums_in_properties_request_body) | **post** /requestBody/postEnumsInPropertiesRequestBody | -*EnumApi* | [**post_enums_in_properties_response_body_for_content_types**](docs/apis/tags/EnumApi.md#post_enums_in_properties_response_body_for_content_types) | **post** /responseBody/postEnumsInPropertiesResponseBodyForContentTypes | -*EnumApi* | [**post_nul_characters_in_strings_request_body**](docs/apis/tags/EnumApi.md#post_nul_characters_in_strings_request_body) | **post** /requestBody/postNulCharactersInStringsRequestBody | -*EnumApi* | [**post_nul_characters_in_strings_response_body_for_content_types**](docs/apis/tags/EnumApi.md#post_nul_characters_in_strings_response_body_for_content_types) | **post** /responseBody/postNulCharactersInStringsResponseBodyForContentTypes | -*EnumApi* | [**post_simple_enum_validation_request_body**](docs/apis/tags/EnumApi.md#post_simple_enum_validation_request_body) | **post** /requestBody/postSimpleEnumValidationRequestBody | -*EnumApi* | [**post_simple_enum_validation_response_body_for_content_types**](docs/apis/tags/EnumApi.md#post_simple_enum_validation_response_body_for_content_types) | **post** /responseBody/postSimpleEnumValidationResponseBodyForContentTypes | -*FormatApi* | [**post_date_time_format_request_body**](docs/apis/tags/FormatApi.md#post_date_time_format_request_body) | **post** /requestBody/postDateTimeFormatRequestBody | -*FormatApi* | [**post_date_time_format_response_body_for_content_types**](docs/apis/tags/FormatApi.md#post_date_time_format_response_body_for_content_types) | **post** /responseBody/postDateTimeFormatResponseBodyForContentTypes | -*FormatApi* | [**post_email_format_request_body**](docs/apis/tags/FormatApi.md#post_email_format_request_body) | **post** /requestBody/postEmailFormatRequestBody | -*FormatApi* | [**post_email_format_response_body_for_content_types**](docs/apis/tags/FormatApi.md#post_email_format_response_body_for_content_types) | **post** /responseBody/postEmailFormatResponseBodyForContentTypes | -*FormatApi* | [**post_hostname_format_request_body**](docs/apis/tags/FormatApi.md#post_hostname_format_request_body) | **post** /requestBody/postHostnameFormatRequestBody | -*FormatApi* | [**post_hostname_format_response_body_for_content_types**](docs/apis/tags/FormatApi.md#post_hostname_format_response_body_for_content_types) | **post** /responseBody/postHostnameFormatResponseBodyForContentTypes | -*FormatApi* | [**post_ipv4_format_request_body**](docs/apis/tags/FormatApi.md#post_ipv4_format_request_body) | **post** /requestBody/postIpv4FormatRequestBody | -*FormatApi* | [**post_ipv4_format_response_body_for_content_types**](docs/apis/tags/FormatApi.md#post_ipv4_format_response_body_for_content_types) | **post** /responseBody/postIpv4FormatResponseBodyForContentTypes | -*FormatApi* | [**post_ipv6_format_request_body**](docs/apis/tags/FormatApi.md#post_ipv6_format_request_body) | **post** /requestBody/postIpv6FormatRequestBody | -*FormatApi* | [**post_ipv6_format_response_body_for_content_types**](docs/apis/tags/FormatApi.md#post_ipv6_format_response_body_for_content_types) | **post** /responseBody/postIpv6FormatResponseBodyForContentTypes | -*FormatApi* | [**post_json_pointer_format_request_body**](docs/apis/tags/FormatApi.md#post_json_pointer_format_request_body) | **post** /requestBody/postJsonPointerFormatRequestBody | -*FormatApi* | [**post_json_pointer_format_response_body_for_content_types**](docs/apis/tags/FormatApi.md#post_json_pointer_format_response_body_for_content_types) | **post** /responseBody/postJsonPointerFormatResponseBodyForContentTypes | -*FormatApi* | [**post_uri_format_request_body**](docs/apis/tags/FormatApi.md#post_uri_format_request_body) | **post** /requestBody/postUriFormatRequestBody | -*FormatApi* | [**post_uri_format_response_body_for_content_types**](docs/apis/tags/FormatApi.md#post_uri_format_response_body_for_content_types) | **post** /responseBody/postUriFormatResponseBodyForContentTypes | -*FormatApi* | [**post_uri_reference_format_request_body**](docs/apis/tags/FormatApi.md#post_uri_reference_format_request_body) | **post** /requestBody/postUriReferenceFormatRequestBody | -*FormatApi* | [**post_uri_reference_format_response_body_for_content_types**](docs/apis/tags/FormatApi.md#post_uri_reference_format_response_body_for_content_types) | **post** /responseBody/postUriReferenceFormatResponseBodyForContentTypes | -*FormatApi* | [**post_uri_template_format_request_body**](docs/apis/tags/FormatApi.md#post_uri_template_format_request_body) | **post** /requestBody/postUriTemplateFormatRequestBody | -*FormatApi* | [**post_uri_template_format_response_body_for_content_types**](docs/apis/tags/FormatApi.md#post_uri_template_format_response_body_for_content_types) | **post** /responseBody/postUriTemplateFormatResponseBodyForContentTypes | -*ItemsApi* | [**post_nested_items_request_body**](docs/apis/tags/ItemsApi.md#post_nested_items_request_body) | **post** /requestBody/postNestedItemsRequestBody | -*ItemsApi* | [**post_nested_items_response_body_for_content_types**](docs/apis/tags/ItemsApi.md#post_nested_items_response_body_for_content_types) | **post** /responseBody/postNestedItemsResponseBodyForContentTypes | -*MaxItemsApi* | [**post_maxitems_validation_request_body**](docs/apis/tags/MaxItemsApi.md#post_maxitems_validation_request_body) | **post** /requestBody/postMaxitemsValidationRequestBody | -*MaxItemsApi* | [**post_maxitems_validation_response_body_for_content_types**](docs/apis/tags/MaxItemsApi.md#post_maxitems_validation_response_body_for_content_types) | **post** /responseBody/postMaxitemsValidationResponseBodyForContentTypes | -*MaxLengthApi* | [**post_maxlength_validation_request_body**](docs/apis/tags/MaxLengthApi.md#post_maxlength_validation_request_body) | **post** /requestBody/postMaxlengthValidationRequestBody | -*MaxLengthApi* | [**post_maxlength_validation_response_body_for_content_types**](docs/apis/tags/MaxLengthApi.md#post_maxlength_validation_response_body_for_content_types) | **post** /responseBody/postMaxlengthValidationResponseBodyForContentTypes | -*MaxPropertiesApi* | [**post_maxproperties0_means_the_object_is_empty_request_body**](docs/apis/tags/MaxPropertiesApi.md#post_maxproperties0_means_the_object_is_empty_request_body) | **post** /requestBody/postMaxproperties0MeansTheObjectIsEmptyRequestBody | -*MaxPropertiesApi* | [**post_maxproperties0_means_the_object_is_empty_response_body_for_content_types**](docs/apis/tags/MaxPropertiesApi.md#post_maxproperties0_means_the_object_is_empty_response_body_for_content_types) | **post** /responseBody/postMaxproperties0MeansTheObjectIsEmptyResponseBodyForContentTypes | -*MaxPropertiesApi* | [**post_maxproperties_validation_request_body**](docs/apis/tags/MaxPropertiesApi.md#post_maxproperties_validation_request_body) | **post** /requestBody/postMaxpropertiesValidationRequestBody | -*MaxPropertiesApi* | [**post_maxproperties_validation_response_body_for_content_types**](docs/apis/tags/MaxPropertiesApi.md#post_maxproperties_validation_response_body_for_content_types) | **post** /responseBody/postMaxpropertiesValidationResponseBodyForContentTypes | -*MaximumApi* | [**post_maximum_validation_request_body**](docs/apis/tags/MaximumApi.md#post_maximum_validation_request_body) | **post** /requestBody/postMaximumValidationRequestBody | -*MaximumApi* | [**post_maximum_validation_response_body_for_content_types**](docs/apis/tags/MaximumApi.md#post_maximum_validation_response_body_for_content_types) | **post** /responseBody/postMaximumValidationResponseBodyForContentTypes | -*MaximumApi* | [**post_maximum_validation_with_unsigned_integer_request_body**](docs/apis/tags/MaximumApi.md#post_maximum_validation_with_unsigned_integer_request_body) | **post** /requestBody/postMaximumValidationWithUnsignedIntegerRequestBody | -*MaximumApi* | [**post_maximum_validation_with_unsigned_integer_response_body_for_content_types**](docs/apis/tags/MaximumApi.md#post_maximum_validation_with_unsigned_integer_response_body_for_content_types) | **post** /responseBody/postMaximumValidationWithUnsignedIntegerResponseBodyForContentTypes | -*MinItemsApi* | [**post_minitems_validation_request_body**](docs/apis/tags/MinItemsApi.md#post_minitems_validation_request_body) | **post** /requestBody/postMinitemsValidationRequestBody | -*MinItemsApi* | [**post_minitems_validation_response_body_for_content_types**](docs/apis/tags/MinItemsApi.md#post_minitems_validation_response_body_for_content_types) | **post** /responseBody/postMinitemsValidationResponseBodyForContentTypes | -*MinLengthApi* | [**post_minlength_validation_request_body**](docs/apis/tags/MinLengthApi.md#post_minlength_validation_request_body) | **post** /requestBody/postMinlengthValidationRequestBody | -*MinLengthApi* | [**post_minlength_validation_response_body_for_content_types**](docs/apis/tags/MinLengthApi.md#post_minlength_validation_response_body_for_content_types) | **post** /responseBody/postMinlengthValidationResponseBodyForContentTypes | -*MinPropertiesApi* | [**post_minproperties_validation_request_body**](docs/apis/tags/MinPropertiesApi.md#post_minproperties_validation_request_body) | **post** /requestBody/postMinpropertiesValidationRequestBody | -*MinPropertiesApi* | [**post_minproperties_validation_response_body_for_content_types**](docs/apis/tags/MinPropertiesApi.md#post_minproperties_validation_response_body_for_content_types) | **post** /responseBody/postMinpropertiesValidationResponseBodyForContentTypes | -*MinimumApi* | [**post_minimum_validation_request_body**](docs/apis/tags/MinimumApi.md#post_minimum_validation_request_body) | **post** /requestBody/postMinimumValidationRequestBody | -*MinimumApi* | [**post_minimum_validation_response_body_for_content_types**](docs/apis/tags/MinimumApi.md#post_minimum_validation_response_body_for_content_types) | **post** /responseBody/postMinimumValidationResponseBodyForContentTypes | -*MinimumApi* | [**post_minimum_validation_with_signed_integer_request_body**](docs/apis/tags/MinimumApi.md#post_minimum_validation_with_signed_integer_request_body) | **post** /requestBody/postMinimumValidationWithSignedIntegerRequestBody | -*MinimumApi* | [**post_minimum_validation_with_signed_integer_response_body_for_content_types**](docs/apis/tags/MinimumApi.md#post_minimum_validation_with_signed_integer_response_body_for_content_types) | **post** /responseBody/postMinimumValidationWithSignedIntegerResponseBodyForContentTypes | -*MultipleOfApi* | [**post_by_int_request_body**](docs/apis/tags/MultipleOfApi.md#post_by_int_request_body) | **post** /requestBody/postByIntRequestBody | -*MultipleOfApi* | [**post_by_int_response_body_for_content_types**](docs/apis/tags/MultipleOfApi.md#post_by_int_response_body_for_content_types) | **post** /responseBody/postByIntResponseBodyForContentTypes | -*MultipleOfApi* | [**post_by_number_request_body**](docs/apis/tags/MultipleOfApi.md#post_by_number_request_body) | **post** /requestBody/postByNumberRequestBody | -*MultipleOfApi* | [**post_by_number_response_body_for_content_types**](docs/apis/tags/MultipleOfApi.md#post_by_number_response_body_for_content_types) | **post** /responseBody/postByNumberResponseBodyForContentTypes | -*MultipleOfApi* | [**post_by_small_number_request_body**](docs/apis/tags/MultipleOfApi.md#post_by_small_number_request_body) | **post** /requestBody/postBySmallNumberRequestBody | -*MultipleOfApi* | [**post_by_small_number_response_body_for_content_types**](docs/apis/tags/MultipleOfApi.md#post_by_small_number_response_body_for_content_types) | **post** /responseBody/postBySmallNumberResponseBodyForContentTypes | -*MultipleOfApi* | [**post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body**](docs/apis/tags/MultipleOfApi.md#post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body) | **post** /requestBody/postInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody | -*MultipleOfApi* | [**post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types**](docs/apis/tags/MultipleOfApi.md#post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types) | **post** /responseBody/postInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfResponseBodyForContentTypes | -*ModelNotApi* | [**post_forbidden_property_request_body**](docs/apis/tags/ModelNotApi.md#post_forbidden_property_request_body) | **post** /requestBody/postForbiddenPropertyRequestBody | -*ModelNotApi* | [**post_forbidden_property_response_body_for_content_types**](docs/apis/tags/ModelNotApi.md#post_forbidden_property_response_body_for_content_types) | **post** /responseBody/postForbiddenPropertyResponseBodyForContentTypes | -*ModelNotApi* | [**post_not_more_complex_schema_request_body**](docs/apis/tags/ModelNotApi.md#post_not_more_complex_schema_request_body) | **post** /requestBody/postNotMoreComplexSchemaRequestBody | -*ModelNotApi* | [**post_not_more_complex_schema_response_body_for_content_types**](docs/apis/tags/ModelNotApi.md#post_not_more_complex_schema_response_body_for_content_types) | **post** /responseBody/postNotMoreComplexSchemaResponseBodyForContentTypes | -*ModelNotApi* | [**post_not_request_body**](docs/apis/tags/ModelNotApi.md#post_not_request_body) | **post** /requestBody/postNotRequestBody | -*ModelNotApi* | [**post_not_response_body_for_content_types**](docs/apis/tags/ModelNotApi.md#post_not_response_body_for_content_types) | **post** /responseBody/postNotResponseBodyForContentTypes | -*OneOfApi* | [**post_nested_oneof_to_check_validation_semantics_request_body**](docs/apis/tags/OneOfApi.md#post_nested_oneof_to_check_validation_semantics_request_body) | **post** /requestBody/postNestedOneofToCheckValidationSemanticsRequestBody | -*OneOfApi* | [**post_nested_oneof_to_check_validation_semantics_response_body_for_content_types**](docs/apis/tags/OneOfApi.md#post_nested_oneof_to_check_validation_semantics_response_body_for_content_types) | **post** /responseBody/postNestedOneofToCheckValidationSemanticsResponseBodyForContentTypes | -*OneOfApi* | [**post_oneof_complex_types_request_body**](docs/apis/tags/OneOfApi.md#post_oneof_complex_types_request_body) | **post** /requestBody/postOneofComplexTypesRequestBody | -*OneOfApi* | [**post_oneof_complex_types_response_body_for_content_types**](docs/apis/tags/OneOfApi.md#post_oneof_complex_types_response_body_for_content_types) | **post** /responseBody/postOneofComplexTypesResponseBodyForContentTypes | -*OneOfApi* | [**post_oneof_request_body**](docs/apis/tags/OneOfApi.md#post_oneof_request_body) | **post** /requestBody/postOneofRequestBody | -*OneOfApi* | [**post_oneof_response_body_for_content_types**](docs/apis/tags/OneOfApi.md#post_oneof_response_body_for_content_types) | **post** /responseBody/postOneofResponseBodyForContentTypes | -*OneOfApi* | [**post_oneof_with_base_schema_request_body**](docs/apis/tags/OneOfApi.md#post_oneof_with_base_schema_request_body) | **post** /requestBody/postOneofWithBaseSchemaRequestBody | -*OneOfApi* | [**post_oneof_with_base_schema_response_body_for_content_types**](docs/apis/tags/OneOfApi.md#post_oneof_with_base_schema_response_body_for_content_types) | **post** /responseBody/postOneofWithBaseSchemaResponseBodyForContentTypes | -*OneOfApi* | [**post_oneof_with_empty_schema_request_body**](docs/apis/tags/OneOfApi.md#post_oneof_with_empty_schema_request_body) | **post** /requestBody/postOneofWithEmptySchemaRequestBody | -*OneOfApi* | [**post_oneof_with_empty_schema_response_body_for_content_types**](docs/apis/tags/OneOfApi.md#post_oneof_with_empty_schema_response_body_for_content_types) | **post** /responseBody/postOneofWithEmptySchemaResponseBodyForContentTypes | -*OneOfApi* | [**post_oneof_with_required_request_body**](docs/apis/tags/OneOfApi.md#post_oneof_with_required_request_body) | **post** /requestBody/postOneofWithRequiredRequestBody | -*OneOfApi* | [**post_oneof_with_required_response_body_for_content_types**](docs/apis/tags/OneOfApi.md#post_oneof_with_required_response_body_for_content_types) | **post** /responseBody/postOneofWithRequiredResponseBodyForContentTypes | -*OperationRequestBodyApi* | [**post_additionalproperties_allows_a_schema_which_should_validate_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_additionalproperties_allows_a_schema_which_should_validate_request_body) | **post** /requestBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody | -*OperationRequestBodyApi* | [**post_additionalproperties_are_allowed_by_default_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_additionalproperties_are_allowed_by_default_request_body) | **post** /requestBody/postAdditionalpropertiesAreAllowedByDefaultRequestBody | -*OperationRequestBodyApi* | [**post_additionalproperties_can_exist_by_itself_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_additionalproperties_can_exist_by_itself_request_body) | **post** /requestBody/postAdditionalpropertiesCanExistByItselfRequestBody | -*OperationRequestBodyApi* | [**post_additionalproperties_should_not_look_in_applicators_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_additionalproperties_should_not_look_in_applicators_request_body) | **post** /requestBody/postAdditionalpropertiesShouldNotLookInApplicatorsRequestBody | -*OperationRequestBodyApi* | [**post_allof_combined_with_anyof_oneof_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_allof_combined_with_anyof_oneof_request_body) | **post** /requestBody/postAllofCombinedWithAnyofOneofRequestBody | -*OperationRequestBodyApi* | [**post_allof_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_allof_request_body) | **post** /requestBody/postAllofRequestBody | -*OperationRequestBodyApi* | [**post_allof_simple_types_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_allof_simple_types_request_body) | **post** /requestBody/postAllofSimpleTypesRequestBody | -*OperationRequestBodyApi* | [**post_allof_with_base_schema_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_allof_with_base_schema_request_body) | **post** /requestBody/postAllofWithBaseSchemaRequestBody | -*OperationRequestBodyApi* | [**post_allof_with_one_empty_schema_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_allof_with_one_empty_schema_request_body) | **post** /requestBody/postAllofWithOneEmptySchemaRequestBody | -*OperationRequestBodyApi* | [**post_allof_with_the_first_empty_schema_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_allof_with_the_first_empty_schema_request_body) | **post** /requestBody/postAllofWithTheFirstEmptySchemaRequestBody | -*OperationRequestBodyApi* | [**post_allof_with_the_last_empty_schema_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_allof_with_the_last_empty_schema_request_body) | **post** /requestBody/postAllofWithTheLastEmptySchemaRequestBody | -*OperationRequestBodyApi* | [**post_allof_with_two_empty_schemas_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_allof_with_two_empty_schemas_request_body) | **post** /requestBody/postAllofWithTwoEmptySchemasRequestBody | -*OperationRequestBodyApi* | [**post_anyof_complex_types_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_anyof_complex_types_request_body) | **post** /requestBody/postAnyofComplexTypesRequestBody | -*OperationRequestBodyApi* | [**post_anyof_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_anyof_request_body) | **post** /requestBody/postAnyofRequestBody | -*OperationRequestBodyApi* | [**post_anyof_with_base_schema_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_anyof_with_base_schema_request_body) | **post** /requestBody/postAnyofWithBaseSchemaRequestBody | -*OperationRequestBodyApi* | [**post_anyof_with_one_empty_schema_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_anyof_with_one_empty_schema_request_body) | **post** /requestBody/postAnyofWithOneEmptySchemaRequestBody | -*OperationRequestBodyApi* | [**post_array_type_matches_arrays_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_array_type_matches_arrays_request_body) | **post** /requestBody/postArrayTypeMatchesArraysRequestBody | -*OperationRequestBodyApi* | [**post_boolean_type_matches_booleans_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_boolean_type_matches_booleans_request_body) | **post** /requestBody/postBooleanTypeMatchesBooleansRequestBody | -*OperationRequestBodyApi* | [**post_by_int_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_by_int_request_body) | **post** /requestBody/postByIntRequestBody | -*OperationRequestBodyApi* | [**post_by_number_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_by_number_request_body) | **post** /requestBody/postByNumberRequestBody | -*OperationRequestBodyApi* | [**post_by_small_number_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_by_small_number_request_body) | **post** /requestBody/postBySmallNumberRequestBody | -*OperationRequestBodyApi* | [**post_date_time_format_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_date_time_format_request_body) | **post** /requestBody/postDateTimeFormatRequestBody | -*OperationRequestBodyApi* | [**post_email_format_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_email_format_request_body) | **post** /requestBody/postEmailFormatRequestBody | -*OperationRequestBodyApi* | [**post_enum_with0_does_not_match_false_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_enum_with0_does_not_match_false_request_body) | **post** /requestBody/postEnumWith0DoesNotMatchFalseRequestBody | -*OperationRequestBodyApi* | [**post_enum_with1_does_not_match_true_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_enum_with1_does_not_match_true_request_body) | **post** /requestBody/postEnumWith1DoesNotMatchTrueRequestBody | -*OperationRequestBodyApi* | [**post_enum_with_escaped_characters_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_enum_with_escaped_characters_request_body) | **post** /requestBody/postEnumWithEscapedCharactersRequestBody | -*OperationRequestBodyApi* | [**post_enum_with_false_does_not_match0_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_enum_with_false_does_not_match0_request_body) | **post** /requestBody/postEnumWithFalseDoesNotMatch0RequestBody | -*OperationRequestBodyApi* | [**post_enum_with_true_does_not_match1_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_enum_with_true_does_not_match1_request_body) | **post** /requestBody/postEnumWithTrueDoesNotMatch1RequestBody | -*OperationRequestBodyApi* | [**post_enums_in_properties_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_enums_in_properties_request_body) | **post** /requestBody/postEnumsInPropertiesRequestBody | -*OperationRequestBodyApi* | [**post_forbidden_property_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_forbidden_property_request_body) | **post** /requestBody/postForbiddenPropertyRequestBody | -*OperationRequestBodyApi* | [**post_hostname_format_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_hostname_format_request_body) | **post** /requestBody/postHostnameFormatRequestBody | -*OperationRequestBodyApi* | [**post_integer_type_matches_integers_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_integer_type_matches_integers_request_body) | **post** /requestBody/postIntegerTypeMatchesIntegersRequestBody | -*OperationRequestBodyApi* | [**post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body) | **post** /requestBody/postInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody | -*OperationRequestBodyApi* | [**post_invalid_string_value_for_default_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_invalid_string_value_for_default_request_body) | **post** /requestBody/postInvalidStringValueForDefaultRequestBody | -*OperationRequestBodyApi* | [**post_ipv4_format_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_ipv4_format_request_body) | **post** /requestBody/postIpv4FormatRequestBody | -*OperationRequestBodyApi* | [**post_ipv6_format_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_ipv6_format_request_body) | **post** /requestBody/postIpv6FormatRequestBody | -*OperationRequestBodyApi* | [**post_json_pointer_format_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_json_pointer_format_request_body) | **post** /requestBody/postJsonPointerFormatRequestBody | -*OperationRequestBodyApi* | [**post_maximum_validation_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_maximum_validation_request_body) | **post** /requestBody/postMaximumValidationRequestBody | -*OperationRequestBodyApi* | [**post_maximum_validation_with_unsigned_integer_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_maximum_validation_with_unsigned_integer_request_body) | **post** /requestBody/postMaximumValidationWithUnsignedIntegerRequestBody | -*OperationRequestBodyApi* | [**post_maxitems_validation_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_maxitems_validation_request_body) | **post** /requestBody/postMaxitemsValidationRequestBody | -*OperationRequestBodyApi* | [**post_maxlength_validation_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_maxlength_validation_request_body) | **post** /requestBody/postMaxlengthValidationRequestBody | -*OperationRequestBodyApi* | [**post_maxproperties0_means_the_object_is_empty_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_maxproperties0_means_the_object_is_empty_request_body) | **post** /requestBody/postMaxproperties0MeansTheObjectIsEmptyRequestBody | -*OperationRequestBodyApi* | [**post_maxproperties_validation_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_maxproperties_validation_request_body) | **post** /requestBody/postMaxpropertiesValidationRequestBody | -*OperationRequestBodyApi* | [**post_minimum_validation_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_minimum_validation_request_body) | **post** /requestBody/postMinimumValidationRequestBody | -*OperationRequestBodyApi* | [**post_minimum_validation_with_signed_integer_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_minimum_validation_with_signed_integer_request_body) | **post** /requestBody/postMinimumValidationWithSignedIntegerRequestBody | -*OperationRequestBodyApi* | [**post_minitems_validation_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_minitems_validation_request_body) | **post** /requestBody/postMinitemsValidationRequestBody | -*OperationRequestBodyApi* | [**post_minlength_validation_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_minlength_validation_request_body) | **post** /requestBody/postMinlengthValidationRequestBody | -*OperationRequestBodyApi* | [**post_minproperties_validation_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_minproperties_validation_request_body) | **post** /requestBody/postMinpropertiesValidationRequestBody | -*OperationRequestBodyApi* | [**post_nested_allof_to_check_validation_semantics_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_nested_allof_to_check_validation_semantics_request_body) | **post** /requestBody/postNestedAllofToCheckValidationSemanticsRequestBody | -*OperationRequestBodyApi* | [**post_nested_anyof_to_check_validation_semantics_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_nested_anyof_to_check_validation_semantics_request_body) | **post** /requestBody/postNestedAnyofToCheckValidationSemanticsRequestBody | -*OperationRequestBodyApi* | [**post_nested_items_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_nested_items_request_body) | **post** /requestBody/postNestedItemsRequestBody | -*OperationRequestBodyApi* | [**post_nested_oneof_to_check_validation_semantics_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_nested_oneof_to_check_validation_semantics_request_body) | **post** /requestBody/postNestedOneofToCheckValidationSemanticsRequestBody | -*OperationRequestBodyApi* | [**post_not_more_complex_schema_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_not_more_complex_schema_request_body) | **post** /requestBody/postNotMoreComplexSchemaRequestBody | -*OperationRequestBodyApi* | [**post_not_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_not_request_body) | **post** /requestBody/postNotRequestBody | -*OperationRequestBodyApi* | [**post_nul_characters_in_strings_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_nul_characters_in_strings_request_body) | **post** /requestBody/postNulCharactersInStringsRequestBody | -*OperationRequestBodyApi* | [**post_null_type_matches_only_the_null_object_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_null_type_matches_only_the_null_object_request_body) | **post** /requestBody/postNullTypeMatchesOnlyTheNullObjectRequestBody | -*OperationRequestBodyApi* | [**post_number_type_matches_numbers_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_number_type_matches_numbers_request_body) | **post** /requestBody/postNumberTypeMatchesNumbersRequestBody | -*OperationRequestBodyApi* | [**post_object_properties_validation_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_object_properties_validation_request_body) | **post** /requestBody/postObjectPropertiesValidationRequestBody | -*OperationRequestBodyApi* | [**post_object_type_matches_objects_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_object_type_matches_objects_request_body) | **post** /requestBody/postObjectTypeMatchesObjectsRequestBody | -*OperationRequestBodyApi* | [**post_oneof_complex_types_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_oneof_complex_types_request_body) | **post** /requestBody/postOneofComplexTypesRequestBody | -*OperationRequestBodyApi* | [**post_oneof_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_oneof_request_body) | **post** /requestBody/postOneofRequestBody | -*OperationRequestBodyApi* | [**post_oneof_with_base_schema_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_oneof_with_base_schema_request_body) | **post** /requestBody/postOneofWithBaseSchemaRequestBody | -*OperationRequestBodyApi* | [**post_oneof_with_empty_schema_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_oneof_with_empty_schema_request_body) | **post** /requestBody/postOneofWithEmptySchemaRequestBody | -*OperationRequestBodyApi* | [**post_oneof_with_required_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_oneof_with_required_request_body) | **post** /requestBody/postOneofWithRequiredRequestBody | -*OperationRequestBodyApi* | [**post_pattern_is_not_anchored_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_pattern_is_not_anchored_request_body) | **post** /requestBody/postPatternIsNotAnchoredRequestBody | -*OperationRequestBodyApi* | [**post_pattern_validation_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_pattern_validation_request_body) | **post** /requestBody/postPatternValidationRequestBody | -*OperationRequestBodyApi* | [**post_properties_with_escaped_characters_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_properties_with_escaped_characters_request_body) | **post** /requestBody/postPropertiesWithEscapedCharactersRequestBody | -*OperationRequestBodyApi* | [**post_property_named_ref_that_is_not_a_reference_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_property_named_ref_that_is_not_a_reference_request_body) | **post** /requestBody/postPropertyNamedRefThatIsNotAReferenceRequestBody | -*OperationRequestBodyApi* | [**post_ref_in_additionalproperties_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_ref_in_additionalproperties_request_body) | **post** /requestBody/postRefInAdditionalpropertiesRequestBody | -*OperationRequestBodyApi* | [**post_ref_in_allof_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_ref_in_allof_request_body) | **post** /requestBody/postRefInAllofRequestBody | -*OperationRequestBodyApi* | [**post_ref_in_anyof_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_ref_in_anyof_request_body) | **post** /requestBody/postRefInAnyofRequestBody | -*OperationRequestBodyApi* | [**post_ref_in_items_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_ref_in_items_request_body) | **post** /requestBody/postRefInItemsRequestBody | -*OperationRequestBodyApi* | [**post_ref_in_not_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_ref_in_not_request_body) | **post** /requestBody/postRefInNotRequestBody | -*OperationRequestBodyApi* | [**post_ref_in_oneof_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_ref_in_oneof_request_body) | **post** /requestBody/postRefInOneofRequestBody | -*OperationRequestBodyApi* | [**post_ref_in_property_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_ref_in_property_request_body) | **post** /requestBody/postRefInPropertyRequestBody | -*OperationRequestBodyApi* | [**post_required_default_validation_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_required_default_validation_request_body) | **post** /requestBody/postRequiredDefaultValidationRequestBody | -*OperationRequestBodyApi* | [**post_required_validation_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_required_validation_request_body) | **post** /requestBody/postRequiredValidationRequestBody | -*OperationRequestBodyApi* | [**post_required_with_empty_array_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_required_with_empty_array_request_body) | **post** /requestBody/postRequiredWithEmptyArrayRequestBody | -*OperationRequestBodyApi* | [**post_required_with_escaped_characters_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_required_with_escaped_characters_request_body) | **post** /requestBody/postRequiredWithEscapedCharactersRequestBody | -*OperationRequestBodyApi* | [**post_simple_enum_validation_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_simple_enum_validation_request_body) | **post** /requestBody/postSimpleEnumValidationRequestBody | -*OperationRequestBodyApi* | [**post_string_type_matches_strings_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_string_type_matches_strings_request_body) | **post** /requestBody/postStringTypeMatchesStringsRequestBody | -*OperationRequestBodyApi* | [**post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body) | **post** /requestBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody | -*OperationRequestBodyApi* | [**post_uniqueitems_false_validation_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_uniqueitems_false_validation_request_body) | **post** /requestBody/postUniqueitemsFalseValidationRequestBody | -*OperationRequestBodyApi* | [**post_uniqueitems_validation_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_uniqueitems_validation_request_body) | **post** /requestBody/postUniqueitemsValidationRequestBody | -*OperationRequestBodyApi* | [**post_uri_format_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_uri_format_request_body) | **post** /requestBody/postUriFormatRequestBody | -*OperationRequestBodyApi* | [**post_uri_reference_format_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_uri_reference_format_request_body) | **post** /requestBody/postUriReferenceFormatRequestBody | -*OperationRequestBodyApi* | [**post_uri_template_format_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_uri_template_format_request_body) | **post** /requestBody/postUriTemplateFormatRequestBody | -*PathPostApi* | [**post_additionalproperties_allows_a_schema_which_should_validate_request_body**](docs/apis/tags/PathPostApi.md#post_additionalproperties_allows_a_schema_which_should_validate_request_body) | **post** /requestBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody | -*PathPostApi* | [**post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types) | **post** /responseBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateResponseBodyForContentTypes | -*PathPostApi* | [**post_additionalproperties_are_allowed_by_default_request_body**](docs/apis/tags/PathPostApi.md#post_additionalproperties_are_allowed_by_default_request_body) | **post** /requestBody/postAdditionalpropertiesAreAllowedByDefaultRequestBody | -*PathPostApi* | [**post_additionalproperties_are_allowed_by_default_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_additionalproperties_are_allowed_by_default_response_body_for_content_types) | **post** /responseBody/postAdditionalpropertiesAreAllowedByDefaultResponseBodyForContentTypes | -*PathPostApi* | [**post_additionalproperties_can_exist_by_itself_request_body**](docs/apis/tags/PathPostApi.md#post_additionalproperties_can_exist_by_itself_request_body) | **post** /requestBody/postAdditionalpropertiesCanExistByItselfRequestBody | -*PathPostApi* | [**post_additionalproperties_can_exist_by_itself_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_additionalproperties_can_exist_by_itself_response_body_for_content_types) | **post** /responseBody/postAdditionalpropertiesCanExistByItselfResponseBodyForContentTypes | -*PathPostApi* | [**post_additionalproperties_should_not_look_in_applicators_request_body**](docs/apis/tags/PathPostApi.md#post_additionalproperties_should_not_look_in_applicators_request_body) | **post** /requestBody/postAdditionalpropertiesShouldNotLookInApplicatorsRequestBody | -*PathPostApi* | [**post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types) | **post** /responseBody/postAdditionalpropertiesShouldNotLookInApplicatorsResponseBodyForContentTypes | -*PathPostApi* | [**post_allof_combined_with_anyof_oneof_request_body**](docs/apis/tags/PathPostApi.md#post_allof_combined_with_anyof_oneof_request_body) | **post** /requestBody/postAllofCombinedWithAnyofOneofRequestBody | -*PathPostApi* | [**post_allof_combined_with_anyof_oneof_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_allof_combined_with_anyof_oneof_response_body_for_content_types) | **post** /responseBody/postAllofCombinedWithAnyofOneofResponseBodyForContentTypes | -*PathPostApi* | [**post_allof_request_body**](docs/apis/tags/PathPostApi.md#post_allof_request_body) | **post** /requestBody/postAllofRequestBody | -*PathPostApi* | [**post_allof_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_allof_response_body_for_content_types) | **post** /responseBody/postAllofResponseBodyForContentTypes | -*PathPostApi* | [**post_allof_simple_types_request_body**](docs/apis/tags/PathPostApi.md#post_allof_simple_types_request_body) | **post** /requestBody/postAllofSimpleTypesRequestBody | -*PathPostApi* | [**post_allof_simple_types_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_allof_simple_types_response_body_for_content_types) | **post** /responseBody/postAllofSimpleTypesResponseBodyForContentTypes | -*PathPostApi* | [**post_allof_with_base_schema_request_body**](docs/apis/tags/PathPostApi.md#post_allof_with_base_schema_request_body) | **post** /requestBody/postAllofWithBaseSchemaRequestBody | -*PathPostApi* | [**post_allof_with_base_schema_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_allof_with_base_schema_response_body_for_content_types) | **post** /responseBody/postAllofWithBaseSchemaResponseBodyForContentTypes | -*PathPostApi* | [**post_allof_with_one_empty_schema_request_body**](docs/apis/tags/PathPostApi.md#post_allof_with_one_empty_schema_request_body) | **post** /requestBody/postAllofWithOneEmptySchemaRequestBody | -*PathPostApi* | [**post_allof_with_one_empty_schema_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_allof_with_one_empty_schema_response_body_for_content_types) | **post** /responseBody/postAllofWithOneEmptySchemaResponseBodyForContentTypes | -*PathPostApi* | [**post_allof_with_the_first_empty_schema_request_body**](docs/apis/tags/PathPostApi.md#post_allof_with_the_first_empty_schema_request_body) | **post** /requestBody/postAllofWithTheFirstEmptySchemaRequestBody | -*PathPostApi* | [**post_allof_with_the_first_empty_schema_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_allof_with_the_first_empty_schema_response_body_for_content_types) | **post** /responseBody/postAllofWithTheFirstEmptySchemaResponseBodyForContentTypes | -*PathPostApi* | [**post_allof_with_the_last_empty_schema_request_body**](docs/apis/tags/PathPostApi.md#post_allof_with_the_last_empty_schema_request_body) | **post** /requestBody/postAllofWithTheLastEmptySchemaRequestBody | -*PathPostApi* | [**post_allof_with_the_last_empty_schema_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_allof_with_the_last_empty_schema_response_body_for_content_types) | **post** /responseBody/postAllofWithTheLastEmptySchemaResponseBodyForContentTypes | -*PathPostApi* | [**post_allof_with_two_empty_schemas_request_body**](docs/apis/tags/PathPostApi.md#post_allof_with_two_empty_schemas_request_body) | **post** /requestBody/postAllofWithTwoEmptySchemasRequestBody | -*PathPostApi* | [**post_allof_with_two_empty_schemas_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_allof_with_two_empty_schemas_response_body_for_content_types) | **post** /responseBody/postAllofWithTwoEmptySchemasResponseBodyForContentTypes | -*PathPostApi* | [**post_anyof_complex_types_request_body**](docs/apis/tags/PathPostApi.md#post_anyof_complex_types_request_body) | **post** /requestBody/postAnyofComplexTypesRequestBody | -*PathPostApi* | [**post_anyof_complex_types_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_anyof_complex_types_response_body_for_content_types) | **post** /responseBody/postAnyofComplexTypesResponseBodyForContentTypes | -*PathPostApi* | [**post_anyof_request_body**](docs/apis/tags/PathPostApi.md#post_anyof_request_body) | **post** /requestBody/postAnyofRequestBody | -*PathPostApi* | [**post_anyof_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_anyof_response_body_for_content_types) | **post** /responseBody/postAnyofResponseBodyForContentTypes | -*PathPostApi* | [**post_anyof_with_base_schema_request_body**](docs/apis/tags/PathPostApi.md#post_anyof_with_base_schema_request_body) | **post** /requestBody/postAnyofWithBaseSchemaRequestBody | -*PathPostApi* | [**post_anyof_with_base_schema_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_anyof_with_base_schema_response_body_for_content_types) | **post** /responseBody/postAnyofWithBaseSchemaResponseBodyForContentTypes | -*PathPostApi* | [**post_anyof_with_one_empty_schema_request_body**](docs/apis/tags/PathPostApi.md#post_anyof_with_one_empty_schema_request_body) | **post** /requestBody/postAnyofWithOneEmptySchemaRequestBody | -*PathPostApi* | [**post_anyof_with_one_empty_schema_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_anyof_with_one_empty_schema_response_body_for_content_types) | **post** /responseBody/postAnyofWithOneEmptySchemaResponseBodyForContentTypes | -*PathPostApi* | [**post_array_type_matches_arrays_request_body**](docs/apis/tags/PathPostApi.md#post_array_type_matches_arrays_request_body) | **post** /requestBody/postArrayTypeMatchesArraysRequestBody | -*PathPostApi* | [**post_array_type_matches_arrays_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_array_type_matches_arrays_response_body_for_content_types) | **post** /responseBody/postArrayTypeMatchesArraysResponseBodyForContentTypes | -*PathPostApi* | [**post_boolean_type_matches_booleans_request_body**](docs/apis/tags/PathPostApi.md#post_boolean_type_matches_booleans_request_body) | **post** /requestBody/postBooleanTypeMatchesBooleansRequestBody | -*PathPostApi* | [**post_boolean_type_matches_booleans_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_boolean_type_matches_booleans_response_body_for_content_types) | **post** /responseBody/postBooleanTypeMatchesBooleansResponseBodyForContentTypes | -*PathPostApi* | [**post_by_int_request_body**](docs/apis/tags/PathPostApi.md#post_by_int_request_body) | **post** /requestBody/postByIntRequestBody | -*PathPostApi* | [**post_by_int_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_by_int_response_body_for_content_types) | **post** /responseBody/postByIntResponseBodyForContentTypes | -*PathPostApi* | [**post_by_number_request_body**](docs/apis/tags/PathPostApi.md#post_by_number_request_body) | **post** /requestBody/postByNumberRequestBody | -*PathPostApi* | [**post_by_number_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_by_number_response_body_for_content_types) | **post** /responseBody/postByNumberResponseBodyForContentTypes | -*PathPostApi* | [**post_by_small_number_request_body**](docs/apis/tags/PathPostApi.md#post_by_small_number_request_body) | **post** /requestBody/postBySmallNumberRequestBody | -*PathPostApi* | [**post_by_small_number_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_by_small_number_response_body_for_content_types) | **post** /responseBody/postBySmallNumberResponseBodyForContentTypes | -*PathPostApi* | [**post_date_time_format_request_body**](docs/apis/tags/PathPostApi.md#post_date_time_format_request_body) | **post** /requestBody/postDateTimeFormatRequestBody | -*PathPostApi* | [**post_date_time_format_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_date_time_format_response_body_for_content_types) | **post** /responseBody/postDateTimeFormatResponseBodyForContentTypes | -*PathPostApi* | [**post_email_format_request_body**](docs/apis/tags/PathPostApi.md#post_email_format_request_body) | **post** /requestBody/postEmailFormatRequestBody | -*PathPostApi* | [**post_email_format_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_email_format_response_body_for_content_types) | **post** /responseBody/postEmailFormatResponseBodyForContentTypes | -*PathPostApi* | [**post_enum_with0_does_not_match_false_request_body**](docs/apis/tags/PathPostApi.md#post_enum_with0_does_not_match_false_request_body) | **post** /requestBody/postEnumWith0DoesNotMatchFalseRequestBody | -*PathPostApi* | [**post_enum_with0_does_not_match_false_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_enum_with0_does_not_match_false_response_body_for_content_types) | **post** /responseBody/postEnumWith0DoesNotMatchFalseResponseBodyForContentTypes | -*PathPostApi* | [**post_enum_with1_does_not_match_true_request_body**](docs/apis/tags/PathPostApi.md#post_enum_with1_does_not_match_true_request_body) | **post** /requestBody/postEnumWith1DoesNotMatchTrueRequestBody | -*PathPostApi* | [**post_enum_with1_does_not_match_true_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_enum_with1_does_not_match_true_response_body_for_content_types) | **post** /responseBody/postEnumWith1DoesNotMatchTrueResponseBodyForContentTypes | -*PathPostApi* | [**post_enum_with_escaped_characters_request_body**](docs/apis/tags/PathPostApi.md#post_enum_with_escaped_characters_request_body) | **post** /requestBody/postEnumWithEscapedCharactersRequestBody | -*PathPostApi* | [**post_enum_with_escaped_characters_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_enum_with_escaped_characters_response_body_for_content_types) | **post** /responseBody/postEnumWithEscapedCharactersResponseBodyForContentTypes | -*PathPostApi* | [**post_enum_with_false_does_not_match0_request_body**](docs/apis/tags/PathPostApi.md#post_enum_with_false_does_not_match0_request_body) | **post** /requestBody/postEnumWithFalseDoesNotMatch0RequestBody | -*PathPostApi* | [**post_enum_with_false_does_not_match0_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_enum_with_false_does_not_match0_response_body_for_content_types) | **post** /responseBody/postEnumWithFalseDoesNotMatch0ResponseBodyForContentTypes | -*PathPostApi* | [**post_enum_with_true_does_not_match1_request_body**](docs/apis/tags/PathPostApi.md#post_enum_with_true_does_not_match1_request_body) | **post** /requestBody/postEnumWithTrueDoesNotMatch1RequestBody | -*PathPostApi* | [**post_enum_with_true_does_not_match1_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_enum_with_true_does_not_match1_response_body_for_content_types) | **post** /responseBody/postEnumWithTrueDoesNotMatch1ResponseBodyForContentTypes | -*PathPostApi* | [**post_enums_in_properties_request_body**](docs/apis/tags/PathPostApi.md#post_enums_in_properties_request_body) | **post** /requestBody/postEnumsInPropertiesRequestBody | -*PathPostApi* | [**post_enums_in_properties_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_enums_in_properties_response_body_for_content_types) | **post** /responseBody/postEnumsInPropertiesResponseBodyForContentTypes | -*PathPostApi* | [**post_forbidden_property_request_body**](docs/apis/tags/PathPostApi.md#post_forbidden_property_request_body) | **post** /requestBody/postForbiddenPropertyRequestBody | -*PathPostApi* | [**post_forbidden_property_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_forbidden_property_response_body_for_content_types) | **post** /responseBody/postForbiddenPropertyResponseBodyForContentTypes | -*PathPostApi* | [**post_hostname_format_request_body**](docs/apis/tags/PathPostApi.md#post_hostname_format_request_body) | **post** /requestBody/postHostnameFormatRequestBody | -*PathPostApi* | [**post_hostname_format_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_hostname_format_response_body_for_content_types) | **post** /responseBody/postHostnameFormatResponseBodyForContentTypes | -*PathPostApi* | [**post_integer_type_matches_integers_request_body**](docs/apis/tags/PathPostApi.md#post_integer_type_matches_integers_request_body) | **post** /requestBody/postIntegerTypeMatchesIntegersRequestBody | -*PathPostApi* | [**post_integer_type_matches_integers_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_integer_type_matches_integers_response_body_for_content_types) | **post** /responseBody/postIntegerTypeMatchesIntegersResponseBodyForContentTypes | -*PathPostApi* | [**post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body**](docs/apis/tags/PathPostApi.md#post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body) | **post** /requestBody/postInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody | -*PathPostApi* | [**post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types) | **post** /responseBody/postInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfResponseBodyForContentTypes | -*PathPostApi* | [**post_invalid_string_value_for_default_request_body**](docs/apis/tags/PathPostApi.md#post_invalid_string_value_for_default_request_body) | **post** /requestBody/postInvalidStringValueForDefaultRequestBody | -*PathPostApi* | [**post_invalid_string_value_for_default_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_invalid_string_value_for_default_response_body_for_content_types) | **post** /responseBody/postInvalidStringValueForDefaultResponseBodyForContentTypes | -*PathPostApi* | [**post_ipv4_format_request_body**](docs/apis/tags/PathPostApi.md#post_ipv4_format_request_body) | **post** /requestBody/postIpv4FormatRequestBody | -*PathPostApi* | [**post_ipv4_format_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_ipv4_format_response_body_for_content_types) | **post** /responseBody/postIpv4FormatResponseBodyForContentTypes | -*PathPostApi* | [**post_ipv6_format_request_body**](docs/apis/tags/PathPostApi.md#post_ipv6_format_request_body) | **post** /requestBody/postIpv6FormatRequestBody | -*PathPostApi* | [**post_ipv6_format_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_ipv6_format_response_body_for_content_types) | **post** /responseBody/postIpv6FormatResponseBodyForContentTypes | -*PathPostApi* | [**post_json_pointer_format_request_body**](docs/apis/tags/PathPostApi.md#post_json_pointer_format_request_body) | **post** /requestBody/postJsonPointerFormatRequestBody | -*PathPostApi* | [**post_json_pointer_format_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_json_pointer_format_response_body_for_content_types) | **post** /responseBody/postJsonPointerFormatResponseBodyForContentTypes | -*PathPostApi* | [**post_maximum_validation_request_body**](docs/apis/tags/PathPostApi.md#post_maximum_validation_request_body) | **post** /requestBody/postMaximumValidationRequestBody | -*PathPostApi* | [**post_maximum_validation_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_maximum_validation_response_body_for_content_types) | **post** /responseBody/postMaximumValidationResponseBodyForContentTypes | -*PathPostApi* | [**post_maximum_validation_with_unsigned_integer_request_body**](docs/apis/tags/PathPostApi.md#post_maximum_validation_with_unsigned_integer_request_body) | **post** /requestBody/postMaximumValidationWithUnsignedIntegerRequestBody | -*PathPostApi* | [**post_maximum_validation_with_unsigned_integer_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_maximum_validation_with_unsigned_integer_response_body_for_content_types) | **post** /responseBody/postMaximumValidationWithUnsignedIntegerResponseBodyForContentTypes | -*PathPostApi* | [**post_maxitems_validation_request_body**](docs/apis/tags/PathPostApi.md#post_maxitems_validation_request_body) | **post** /requestBody/postMaxitemsValidationRequestBody | -*PathPostApi* | [**post_maxitems_validation_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_maxitems_validation_response_body_for_content_types) | **post** /responseBody/postMaxitemsValidationResponseBodyForContentTypes | -*PathPostApi* | [**post_maxlength_validation_request_body**](docs/apis/tags/PathPostApi.md#post_maxlength_validation_request_body) | **post** /requestBody/postMaxlengthValidationRequestBody | -*PathPostApi* | [**post_maxlength_validation_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_maxlength_validation_response_body_for_content_types) | **post** /responseBody/postMaxlengthValidationResponseBodyForContentTypes | -*PathPostApi* | [**post_maxproperties0_means_the_object_is_empty_request_body**](docs/apis/tags/PathPostApi.md#post_maxproperties0_means_the_object_is_empty_request_body) | **post** /requestBody/postMaxproperties0MeansTheObjectIsEmptyRequestBody | -*PathPostApi* | [**post_maxproperties0_means_the_object_is_empty_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_maxproperties0_means_the_object_is_empty_response_body_for_content_types) | **post** /responseBody/postMaxproperties0MeansTheObjectIsEmptyResponseBodyForContentTypes | -*PathPostApi* | [**post_maxproperties_validation_request_body**](docs/apis/tags/PathPostApi.md#post_maxproperties_validation_request_body) | **post** /requestBody/postMaxpropertiesValidationRequestBody | -*PathPostApi* | [**post_maxproperties_validation_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_maxproperties_validation_response_body_for_content_types) | **post** /responseBody/postMaxpropertiesValidationResponseBodyForContentTypes | -*PathPostApi* | [**post_minimum_validation_request_body**](docs/apis/tags/PathPostApi.md#post_minimum_validation_request_body) | **post** /requestBody/postMinimumValidationRequestBody | -*PathPostApi* | [**post_minimum_validation_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_minimum_validation_response_body_for_content_types) | **post** /responseBody/postMinimumValidationResponseBodyForContentTypes | -*PathPostApi* | [**post_minimum_validation_with_signed_integer_request_body**](docs/apis/tags/PathPostApi.md#post_minimum_validation_with_signed_integer_request_body) | **post** /requestBody/postMinimumValidationWithSignedIntegerRequestBody | -*PathPostApi* | [**post_minimum_validation_with_signed_integer_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_minimum_validation_with_signed_integer_response_body_for_content_types) | **post** /responseBody/postMinimumValidationWithSignedIntegerResponseBodyForContentTypes | -*PathPostApi* | [**post_minitems_validation_request_body**](docs/apis/tags/PathPostApi.md#post_minitems_validation_request_body) | **post** /requestBody/postMinitemsValidationRequestBody | -*PathPostApi* | [**post_minitems_validation_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_minitems_validation_response_body_for_content_types) | **post** /responseBody/postMinitemsValidationResponseBodyForContentTypes | -*PathPostApi* | [**post_minlength_validation_request_body**](docs/apis/tags/PathPostApi.md#post_minlength_validation_request_body) | **post** /requestBody/postMinlengthValidationRequestBody | -*PathPostApi* | [**post_minlength_validation_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_minlength_validation_response_body_for_content_types) | **post** /responseBody/postMinlengthValidationResponseBodyForContentTypes | -*PathPostApi* | [**post_minproperties_validation_request_body**](docs/apis/tags/PathPostApi.md#post_minproperties_validation_request_body) | **post** /requestBody/postMinpropertiesValidationRequestBody | -*PathPostApi* | [**post_minproperties_validation_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_minproperties_validation_response_body_for_content_types) | **post** /responseBody/postMinpropertiesValidationResponseBodyForContentTypes | -*PathPostApi* | [**post_nested_allof_to_check_validation_semantics_request_body**](docs/apis/tags/PathPostApi.md#post_nested_allof_to_check_validation_semantics_request_body) | **post** /requestBody/postNestedAllofToCheckValidationSemanticsRequestBody | -*PathPostApi* | [**post_nested_allof_to_check_validation_semantics_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_nested_allof_to_check_validation_semantics_response_body_for_content_types) | **post** /responseBody/postNestedAllofToCheckValidationSemanticsResponseBodyForContentTypes | -*PathPostApi* | [**post_nested_anyof_to_check_validation_semantics_request_body**](docs/apis/tags/PathPostApi.md#post_nested_anyof_to_check_validation_semantics_request_body) | **post** /requestBody/postNestedAnyofToCheckValidationSemanticsRequestBody | -*PathPostApi* | [**post_nested_anyof_to_check_validation_semantics_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_nested_anyof_to_check_validation_semantics_response_body_for_content_types) | **post** /responseBody/postNestedAnyofToCheckValidationSemanticsResponseBodyForContentTypes | -*PathPostApi* | [**post_nested_items_request_body**](docs/apis/tags/PathPostApi.md#post_nested_items_request_body) | **post** /requestBody/postNestedItemsRequestBody | -*PathPostApi* | [**post_nested_items_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_nested_items_response_body_for_content_types) | **post** /responseBody/postNestedItemsResponseBodyForContentTypes | -*PathPostApi* | [**post_nested_oneof_to_check_validation_semantics_request_body**](docs/apis/tags/PathPostApi.md#post_nested_oneof_to_check_validation_semantics_request_body) | **post** /requestBody/postNestedOneofToCheckValidationSemanticsRequestBody | -*PathPostApi* | [**post_nested_oneof_to_check_validation_semantics_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_nested_oneof_to_check_validation_semantics_response_body_for_content_types) | **post** /responseBody/postNestedOneofToCheckValidationSemanticsResponseBodyForContentTypes | -*PathPostApi* | [**post_not_more_complex_schema_request_body**](docs/apis/tags/PathPostApi.md#post_not_more_complex_schema_request_body) | **post** /requestBody/postNotMoreComplexSchemaRequestBody | -*PathPostApi* | [**post_not_more_complex_schema_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_not_more_complex_schema_response_body_for_content_types) | **post** /responseBody/postNotMoreComplexSchemaResponseBodyForContentTypes | -*PathPostApi* | [**post_not_request_body**](docs/apis/tags/PathPostApi.md#post_not_request_body) | **post** /requestBody/postNotRequestBody | -*PathPostApi* | [**post_not_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_not_response_body_for_content_types) | **post** /responseBody/postNotResponseBodyForContentTypes | -*PathPostApi* | [**post_nul_characters_in_strings_request_body**](docs/apis/tags/PathPostApi.md#post_nul_characters_in_strings_request_body) | **post** /requestBody/postNulCharactersInStringsRequestBody | -*PathPostApi* | [**post_nul_characters_in_strings_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_nul_characters_in_strings_response_body_for_content_types) | **post** /responseBody/postNulCharactersInStringsResponseBodyForContentTypes | -*PathPostApi* | [**post_null_type_matches_only_the_null_object_request_body**](docs/apis/tags/PathPostApi.md#post_null_type_matches_only_the_null_object_request_body) | **post** /requestBody/postNullTypeMatchesOnlyTheNullObjectRequestBody | -*PathPostApi* | [**post_null_type_matches_only_the_null_object_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_null_type_matches_only_the_null_object_response_body_for_content_types) | **post** /responseBody/postNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes | -*PathPostApi* | [**post_number_type_matches_numbers_request_body**](docs/apis/tags/PathPostApi.md#post_number_type_matches_numbers_request_body) | **post** /requestBody/postNumberTypeMatchesNumbersRequestBody | -*PathPostApi* | [**post_number_type_matches_numbers_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_number_type_matches_numbers_response_body_for_content_types) | **post** /responseBody/postNumberTypeMatchesNumbersResponseBodyForContentTypes | -*PathPostApi* | [**post_object_properties_validation_request_body**](docs/apis/tags/PathPostApi.md#post_object_properties_validation_request_body) | **post** /requestBody/postObjectPropertiesValidationRequestBody | -*PathPostApi* | [**post_object_properties_validation_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_object_properties_validation_response_body_for_content_types) | **post** /responseBody/postObjectPropertiesValidationResponseBodyForContentTypes | -*PathPostApi* | [**post_object_type_matches_objects_request_body**](docs/apis/tags/PathPostApi.md#post_object_type_matches_objects_request_body) | **post** /requestBody/postObjectTypeMatchesObjectsRequestBody | -*PathPostApi* | [**post_object_type_matches_objects_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_object_type_matches_objects_response_body_for_content_types) | **post** /responseBody/postObjectTypeMatchesObjectsResponseBodyForContentTypes | -*PathPostApi* | [**post_oneof_complex_types_request_body**](docs/apis/tags/PathPostApi.md#post_oneof_complex_types_request_body) | **post** /requestBody/postOneofComplexTypesRequestBody | -*PathPostApi* | [**post_oneof_complex_types_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_oneof_complex_types_response_body_for_content_types) | **post** /responseBody/postOneofComplexTypesResponseBodyForContentTypes | -*PathPostApi* | [**post_oneof_request_body**](docs/apis/tags/PathPostApi.md#post_oneof_request_body) | **post** /requestBody/postOneofRequestBody | -*PathPostApi* | [**post_oneof_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_oneof_response_body_for_content_types) | **post** /responseBody/postOneofResponseBodyForContentTypes | -*PathPostApi* | [**post_oneof_with_base_schema_request_body**](docs/apis/tags/PathPostApi.md#post_oneof_with_base_schema_request_body) | **post** /requestBody/postOneofWithBaseSchemaRequestBody | -*PathPostApi* | [**post_oneof_with_base_schema_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_oneof_with_base_schema_response_body_for_content_types) | **post** /responseBody/postOneofWithBaseSchemaResponseBodyForContentTypes | -*PathPostApi* | [**post_oneof_with_empty_schema_request_body**](docs/apis/tags/PathPostApi.md#post_oneof_with_empty_schema_request_body) | **post** /requestBody/postOneofWithEmptySchemaRequestBody | -*PathPostApi* | [**post_oneof_with_empty_schema_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_oneof_with_empty_schema_response_body_for_content_types) | **post** /responseBody/postOneofWithEmptySchemaResponseBodyForContentTypes | -*PathPostApi* | [**post_oneof_with_required_request_body**](docs/apis/tags/PathPostApi.md#post_oneof_with_required_request_body) | **post** /requestBody/postOneofWithRequiredRequestBody | -*PathPostApi* | [**post_oneof_with_required_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_oneof_with_required_response_body_for_content_types) | **post** /responseBody/postOneofWithRequiredResponseBodyForContentTypes | -*PathPostApi* | [**post_pattern_is_not_anchored_request_body**](docs/apis/tags/PathPostApi.md#post_pattern_is_not_anchored_request_body) | **post** /requestBody/postPatternIsNotAnchoredRequestBody | -*PathPostApi* | [**post_pattern_is_not_anchored_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_pattern_is_not_anchored_response_body_for_content_types) | **post** /responseBody/postPatternIsNotAnchoredResponseBodyForContentTypes | -*PathPostApi* | [**post_pattern_validation_request_body**](docs/apis/tags/PathPostApi.md#post_pattern_validation_request_body) | **post** /requestBody/postPatternValidationRequestBody | -*PathPostApi* | [**post_pattern_validation_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_pattern_validation_response_body_for_content_types) | **post** /responseBody/postPatternValidationResponseBodyForContentTypes | -*PathPostApi* | [**post_properties_with_escaped_characters_request_body**](docs/apis/tags/PathPostApi.md#post_properties_with_escaped_characters_request_body) | **post** /requestBody/postPropertiesWithEscapedCharactersRequestBody | -*PathPostApi* | [**post_properties_with_escaped_characters_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_properties_with_escaped_characters_response_body_for_content_types) | **post** /responseBody/postPropertiesWithEscapedCharactersResponseBodyForContentTypes | -*PathPostApi* | [**post_property_named_ref_that_is_not_a_reference_request_body**](docs/apis/tags/PathPostApi.md#post_property_named_ref_that_is_not_a_reference_request_body) | **post** /requestBody/postPropertyNamedRefThatIsNotAReferenceRequestBody | -*PathPostApi* | [**post_property_named_ref_that_is_not_a_reference_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_property_named_ref_that_is_not_a_reference_response_body_for_content_types) | **post** /responseBody/postPropertyNamedRefThatIsNotAReferenceResponseBodyForContentTypes | -*PathPostApi* | [**post_ref_in_additionalproperties_request_body**](docs/apis/tags/PathPostApi.md#post_ref_in_additionalproperties_request_body) | **post** /requestBody/postRefInAdditionalpropertiesRequestBody | -*PathPostApi* | [**post_ref_in_additionalproperties_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_ref_in_additionalproperties_response_body_for_content_types) | **post** /responseBody/postRefInAdditionalpropertiesResponseBodyForContentTypes | -*PathPostApi* | [**post_ref_in_allof_request_body**](docs/apis/tags/PathPostApi.md#post_ref_in_allof_request_body) | **post** /requestBody/postRefInAllofRequestBody | -*PathPostApi* | [**post_ref_in_allof_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_ref_in_allof_response_body_for_content_types) | **post** /responseBody/postRefInAllofResponseBodyForContentTypes | -*PathPostApi* | [**post_ref_in_anyof_request_body**](docs/apis/tags/PathPostApi.md#post_ref_in_anyof_request_body) | **post** /requestBody/postRefInAnyofRequestBody | -*PathPostApi* | [**post_ref_in_anyof_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_ref_in_anyof_response_body_for_content_types) | **post** /responseBody/postRefInAnyofResponseBodyForContentTypes | -*PathPostApi* | [**post_ref_in_items_request_body**](docs/apis/tags/PathPostApi.md#post_ref_in_items_request_body) | **post** /requestBody/postRefInItemsRequestBody | -*PathPostApi* | [**post_ref_in_items_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_ref_in_items_response_body_for_content_types) | **post** /responseBody/postRefInItemsResponseBodyForContentTypes | -*PathPostApi* | [**post_ref_in_not_request_body**](docs/apis/tags/PathPostApi.md#post_ref_in_not_request_body) | **post** /requestBody/postRefInNotRequestBody | -*PathPostApi* | [**post_ref_in_not_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_ref_in_not_response_body_for_content_types) | **post** /responseBody/postRefInNotResponseBodyForContentTypes | -*PathPostApi* | [**post_ref_in_oneof_request_body**](docs/apis/tags/PathPostApi.md#post_ref_in_oneof_request_body) | **post** /requestBody/postRefInOneofRequestBody | -*PathPostApi* | [**post_ref_in_oneof_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_ref_in_oneof_response_body_for_content_types) | **post** /responseBody/postRefInOneofResponseBodyForContentTypes | -*PathPostApi* | [**post_ref_in_property_request_body**](docs/apis/tags/PathPostApi.md#post_ref_in_property_request_body) | **post** /requestBody/postRefInPropertyRequestBody | -*PathPostApi* | [**post_ref_in_property_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_ref_in_property_response_body_for_content_types) | **post** /responseBody/postRefInPropertyResponseBodyForContentTypes | -*PathPostApi* | [**post_required_default_validation_request_body**](docs/apis/tags/PathPostApi.md#post_required_default_validation_request_body) | **post** /requestBody/postRequiredDefaultValidationRequestBody | -*PathPostApi* | [**post_required_default_validation_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_required_default_validation_response_body_for_content_types) | **post** /responseBody/postRequiredDefaultValidationResponseBodyForContentTypes | -*PathPostApi* | [**post_required_validation_request_body**](docs/apis/tags/PathPostApi.md#post_required_validation_request_body) | **post** /requestBody/postRequiredValidationRequestBody | -*PathPostApi* | [**post_required_validation_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_required_validation_response_body_for_content_types) | **post** /responseBody/postRequiredValidationResponseBodyForContentTypes | -*PathPostApi* | [**post_required_with_empty_array_request_body**](docs/apis/tags/PathPostApi.md#post_required_with_empty_array_request_body) | **post** /requestBody/postRequiredWithEmptyArrayRequestBody | -*PathPostApi* | [**post_required_with_empty_array_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_required_with_empty_array_response_body_for_content_types) | **post** /responseBody/postRequiredWithEmptyArrayResponseBodyForContentTypes | -*PathPostApi* | [**post_required_with_escaped_characters_request_body**](docs/apis/tags/PathPostApi.md#post_required_with_escaped_characters_request_body) | **post** /requestBody/postRequiredWithEscapedCharactersRequestBody | -*PathPostApi* | [**post_required_with_escaped_characters_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_required_with_escaped_characters_response_body_for_content_types) | **post** /responseBody/postRequiredWithEscapedCharactersResponseBodyForContentTypes | -*PathPostApi* | [**post_simple_enum_validation_request_body**](docs/apis/tags/PathPostApi.md#post_simple_enum_validation_request_body) | **post** /requestBody/postSimpleEnumValidationRequestBody | -*PathPostApi* | [**post_simple_enum_validation_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_simple_enum_validation_response_body_for_content_types) | **post** /responseBody/postSimpleEnumValidationResponseBodyForContentTypes | -*PathPostApi* | [**post_string_type_matches_strings_request_body**](docs/apis/tags/PathPostApi.md#post_string_type_matches_strings_request_body) | **post** /requestBody/postStringTypeMatchesStringsRequestBody | -*PathPostApi* | [**post_string_type_matches_strings_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_string_type_matches_strings_response_body_for_content_types) | **post** /responseBody/postStringTypeMatchesStringsResponseBodyForContentTypes | -*PathPostApi* | [**post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body**](docs/apis/tags/PathPostApi.md#post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body) | **post** /requestBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody | -*PathPostApi* | [**post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types) | **post** /responseBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyForContentTypes | -*PathPostApi* | [**post_uniqueitems_false_validation_request_body**](docs/apis/tags/PathPostApi.md#post_uniqueitems_false_validation_request_body) | **post** /requestBody/postUniqueitemsFalseValidationRequestBody | -*PathPostApi* | [**post_uniqueitems_false_validation_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_uniqueitems_false_validation_response_body_for_content_types) | **post** /responseBody/postUniqueitemsFalseValidationResponseBodyForContentTypes | -*PathPostApi* | [**post_uniqueitems_validation_request_body**](docs/apis/tags/PathPostApi.md#post_uniqueitems_validation_request_body) | **post** /requestBody/postUniqueitemsValidationRequestBody | -*PathPostApi* | [**post_uniqueitems_validation_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_uniqueitems_validation_response_body_for_content_types) | **post** /responseBody/postUniqueitemsValidationResponseBodyForContentTypes | -*PathPostApi* | [**post_uri_format_request_body**](docs/apis/tags/PathPostApi.md#post_uri_format_request_body) | **post** /requestBody/postUriFormatRequestBody | -*PathPostApi* | [**post_uri_format_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_uri_format_response_body_for_content_types) | **post** /responseBody/postUriFormatResponseBodyForContentTypes | -*PathPostApi* | [**post_uri_reference_format_request_body**](docs/apis/tags/PathPostApi.md#post_uri_reference_format_request_body) | **post** /requestBody/postUriReferenceFormatRequestBody | -*PathPostApi* | [**post_uri_reference_format_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_uri_reference_format_response_body_for_content_types) | **post** /responseBody/postUriReferenceFormatResponseBodyForContentTypes | -*PathPostApi* | [**post_uri_template_format_request_body**](docs/apis/tags/PathPostApi.md#post_uri_template_format_request_body) | **post** /requestBody/postUriTemplateFormatRequestBody | -*PathPostApi* | [**post_uri_template_format_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_uri_template_format_response_body_for_content_types) | **post** /responseBody/postUriTemplateFormatResponseBodyForContentTypes | -*PatternApi* | [**post_pattern_is_not_anchored_request_body**](docs/apis/tags/PatternApi.md#post_pattern_is_not_anchored_request_body) | **post** /requestBody/postPatternIsNotAnchoredRequestBody | -*PatternApi* | [**post_pattern_is_not_anchored_response_body_for_content_types**](docs/apis/tags/PatternApi.md#post_pattern_is_not_anchored_response_body_for_content_types) | **post** /responseBody/postPatternIsNotAnchoredResponseBodyForContentTypes | -*PatternApi* | [**post_pattern_validation_request_body**](docs/apis/tags/PatternApi.md#post_pattern_validation_request_body) | **post** /requestBody/postPatternValidationRequestBody | -*PatternApi* | [**post_pattern_validation_response_body_for_content_types**](docs/apis/tags/PatternApi.md#post_pattern_validation_response_body_for_content_types) | **post** /responseBody/postPatternValidationResponseBodyForContentTypes | -*PropertiesApi* | [**post_object_properties_validation_request_body**](docs/apis/tags/PropertiesApi.md#post_object_properties_validation_request_body) | **post** /requestBody/postObjectPropertiesValidationRequestBody | -*PropertiesApi* | [**post_object_properties_validation_response_body_for_content_types**](docs/apis/tags/PropertiesApi.md#post_object_properties_validation_response_body_for_content_types) | **post** /responseBody/postObjectPropertiesValidationResponseBodyForContentTypes | -*PropertiesApi* | [**post_properties_with_escaped_characters_request_body**](docs/apis/tags/PropertiesApi.md#post_properties_with_escaped_characters_request_body) | **post** /requestBody/postPropertiesWithEscapedCharactersRequestBody | -*PropertiesApi* | [**post_properties_with_escaped_characters_response_body_for_content_types**](docs/apis/tags/PropertiesApi.md#post_properties_with_escaped_characters_response_body_for_content_types) | **post** /responseBody/postPropertiesWithEscapedCharactersResponseBodyForContentTypes | -*RequiredApi* | [**post_required_default_validation_request_body**](docs/apis/tags/RequiredApi.md#post_required_default_validation_request_body) | **post** /requestBody/postRequiredDefaultValidationRequestBody | -*RequiredApi* | [**post_required_default_validation_response_body_for_content_types**](docs/apis/tags/RequiredApi.md#post_required_default_validation_response_body_for_content_types) | **post** /responseBody/postRequiredDefaultValidationResponseBodyForContentTypes | -*RequiredApi* | [**post_required_validation_request_body**](docs/apis/tags/RequiredApi.md#post_required_validation_request_body) | **post** /requestBody/postRequiredValidationRequestBody | -*RequiredApi* | [**post_required_validation_response_body_for_content_types**](docs/apis/tags/RequiredApi.md#post_required_validation_response_body_for_content_types) | **post** /responseBody/postRequiredValidationResponseBodyForContentTypes | -*RequiredApi* | [**post_required_with_empty_array_request_body**](docs/apis/tags/RequiredApi.md#post_required_with_empty_array_request_body) | **post** /requestBody/postRequiredWithEmptyArrayRequestBody | -*RequiredApi* | [**post_required_with_empty_array_response_body_for_content_types**](docs/apis/tags/RequiredApi.md#post_required_with_empty_array_response_body_for_content_types) | **post** /responseBody/postRequiredWithEmptyArrayResponseBodyForContentTypes | -*RequiredApi* | [**post_required_with_escaped_characters_request_body**](docs/apis/tags/RequiredApi.md#post_required_with_escaped_characters_request_body) | **post** /requestBody/postRequiredWithEscapedCharactersRequestBody | -*RequiredApi* | [**post_required_with_escaped_characters_response_body_for_content_types**](docs/apis/tags/RequiredApi.md#post_required_with_escaped_characters_response_body_for_content_types) | **post** /responseBody/postRequiredWithEscapedCharactersResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types) | **post** /responseBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_additionalproperties_are_allowed_by_default_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_additionalproperties_are_allowed_by_default_response_body_for_content_types) | **post** /responseBody/postAdditionalpropertiesAreAllowedByDefaultResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_additionalproperties_can_exist_by_itself_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_additionalproperties_can_exist_by_itself_response_body_for_content_types) | **post** /responseBody/postAdditionalpropertiesCanExistByItselfResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types) | **post** /responseBody/postAdditionalpropertiesShouldNotLookInApplicatorsResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_allof_combined_with_anyof_oneof_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_allof_combined_with_anyof_oneof_response_body_for_content_types) | **post** /responseBody/postAllofCombinedWithAnyofOneofResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_allof_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_allof_response_body_for_content_types) | **post** /responseBody/postAllofResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_allof_simple_types_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_allof_simple_types_response_body_for_content_types) | **post** /responseBody/postAllofSimpleTypesResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_allof_with_base_schema_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_allof_with_base_schema_response_body_for_content_types) | **post** /responseBody/postAllofWithBaseSchemaResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_allof_with_one_empty_schema_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_allof_with_one_empty_schema_response_body_for_content_types) | **post** /responseBody/postAllofWithOneEmptySchemaResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_allof_with_the_first_empty_schema_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_allof_with_the_first_empty_schema_response_body_for_content_types) | **post** /responseBody/postAllofWithTheFirstEmptySchemaResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_allof_with_the_last_empty_schema_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_allof_with_the_last_empty_schema_response_body_for_content_types) | **post** /responseBody/postAllofWithTheLastEmptySchemaResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_allof_with_two_empty_schemas_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_allof_with_two_empty_schemas_response_body_for_content_types) | **post** /responseBody/postAllofWithTwoEmptySchemasResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_anyof_complex_types_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_anyof_complex_types_response_body_for_content_types) | **post** /responseBody/postAnyofComplexTypesResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_anyof_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_anyof_response_body_for_content_types) | **post** /responseBody/postAnyofResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_anyof_with_base_schema_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_anyof_with_base_schema_response_body_for_content_types) | **post** /responseBody/postAnyofWithBaseSchemaResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_anyof_with_one_empty_schema_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_anyof_with_one_empty_schema_response_body_for_content_types) | **post** /responseBody/postAnyofWithOneEmptySchemaResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_array_type_matches_arrays_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_array_type_matches_arrays_response_body_for_content_types) | **post** /responseBody/postArrayTypeMatchesArraysResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_boolean_type_matches_booleans_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_boolean_type_matches_booleans_response_body_for_content_types) | **post** /responseBody/postBooleanTypeMatchesBooleansResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_by_int_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_by_int_response_body_for_content_types) | **post** /responseBody/postByIntResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_by_number_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_by_number_response_body_for_content_types) | **post** /responseBody/postByNumberResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_by_small_number_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_by_small_number_response_body_for_content_types) | **post** /responseBody/postBySmallNumberResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_date_time_format_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_date_time_format_response_body_for_content_types) | **post** /responseBody/postDateTimeFormatResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_email_format_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_email_format_response_body_for_content_types) | **post** /responseBody/postEmailFormatResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_enum_with0_does_not_match_false_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_enum_with0_does_not_match_false_response_body_for_content_types) | **post** /responseBody/postEnumWith0DoesNotMatchFalseResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_enum_with1_does_not_match_true_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_enum_with1_does_not_match_true_response_body_for_content_types) | **post** /responseBody/postEnumWith1DoesNotMatchTrueResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_enum_with_escaped_characters_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_enum_with_escaped_characters_response_body_for_content_types) | **post** /responseBody/postEnumWithEscapedCharactersResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_enum_with_false_does_not_match0_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_enum_with_false_does_not_match0_response_body_for_content_types) | **post** /responseBody/postEnumWithFalseDoesNotMatch0ResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_enum_with_true_does_not_match1_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_enum_with_true_does_not_match1_response_body_for_content_types) | **post** /responseBody/postEnumWithTrueDoesNotMatch1ResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_enums_in_properties_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_enums_in_properties_response_body_for_content_types) | **post** /responseBody/postEnumsInPropertiesResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_forbidden_property_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_forbidden_property_response_body_for_content_types) | **post** /responseBody/postForbiddenPropertyResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_hostname_format_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_hostname_format_response_body_for_content_types) | **post** /responseBody/postHostnameFormatResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_integer_type_matches_integers_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_integer_type_matches_integers_response_body_for_content_types) | **post** /responseBody/postIntegerTypeMatchesIntegersResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types) | **post** /responseBody/postInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_invalid_string_value_for_default_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_invalid_string_value_for_default_response_body_for_content_types) | **post** /responseBody/postInvalidStringValueForDefaultResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_ipv4_format_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_ipv4_format_response_body_for_content_types) | **post** /responseBody/postIpv4FormatResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_ipv6_format_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_ipv6_format_response_body_for_content_types) | **post** /responseBody/postIpv6FormatResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_json_pointer_format_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_json_pointer_format_response_body_for_content_types) | **post** /responseBody/postJsonPointerFormatResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_maximum_validation_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_maximum_validation_response_body_for_content_types) | **post** /responseBody/postMaximumValidationResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_maximum_validation_with_unsigned_integer_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_maximum_validation_with_unsigned_integer_response_body_for_content_types) | **post** /responseBody/postMaximumValidationWithUnsignedIntegerResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_maxitems_validation_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_maxitems_validation_response_body_for_content_types) | **post** /responseBody/postMaxitemsValidationResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_maxlength_validation_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_maxlength_validation_response_body_for_content_types) | **post** /responseBody/postMaxlengthValidationResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_maxproperties0_means_the_object_is_empty_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_maxproperties0_means_the_object_is_empty_response_body_for_content_types) | **post** /responseBody/postMaxproperties0MeansTheObjectIsEmptyResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_maxproperties_validation_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_maxproperties_validation_response_body_for_content_types) | **post** /responseBody/postMaxpropertiesValidationResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_minimum_validation_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_minimum_validation_response_body_for_content_types) | **post** /responseBody/postMinimumValidationResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_minimum_validation_with_signed_integer_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_minimum_validation_with_signed_integer_response_body_for_content_types) | **post** /responseBody/postMinimumValidationWithSignedIntegerResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_minitems_validation_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_minitems_validation_response_body_for_content_types) | **post** /responseBody/postMinitemsValidationResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_minlength_validation_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_minlength_validation_response_body_for_content_types) | **post** /responseBody/postMinlengthValidationResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_minproperties_validation_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_minproperties_validation_response_body_for_content_types) | **post** /responseBody/postMinpropertiesValidationResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_nested_allof_to_check_validation_semantics_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_nested_allof_to_check_validation_semantics_response_body_for_content_types) | **post** /responseBody/postNestedAllofToCheckValidationSemanticsResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_nested_anyof_to_check_validation_semantics_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_nested_anyof_to_check_validation_semantics_response_body_for_content_types) | **post** /responseBody/postNestedAnyofToCheckValidationSemanticsResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_nested_items_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_nested_items_response_body_for_content_types) | **post** /responseBody/postNestedItemsResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_nested_oneof_to_check_validation_semantics_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_nested_oneof_to_check_validation_semantics_response_body_for_content_types) | **post** /responseBody/postNestedOneofToCheckValidationSemanticsResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_not_more_complex_schema_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_not_more_complex_schema_response_body_for_content_types) | **post** /responseBody/postNotMoreComplexSchemaResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_not_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_not_response_body_for_content_types) | **post** /responseBody/postNotResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_nul_characters_in_strings_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_nul_characters_in_strings_response_body_for_content_types) | **post** /responseBody/postNulCharactersInStringsResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_null_type_matches_only_the_null_object_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_null_type_matches_only_the_null_object_response_body_for_content_types) | **post** /responseBody/postNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_number_type_matches_numbers_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_number_type_matches_numbers_response_body_for_content_types) | **post** /responseBody/postNumberTypeMatchesNumbersResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_object_properties_validation_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_object_properties_validation_response_body_for_content_types) | **post** /responseBody/postObjectPropertiesValidationResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_object_type_matches_objects_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_object_type_matches_objects_response_body_for_content_types) | **post** /responseBody/postObjectTypeMatchesObjectsResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_oneof_complex_types_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_oneof_complex_types_response_body_for_content_types) | **post** /responseBody/postOneofComplexTypesResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_oneof_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_oneof_response_body_for_content_types) | **post** /responseBody/postOneofResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_oneof_with_base_schema_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_oneof_with_base_schema_response_body_for_content_types) | **post** /responseBody/postOneofWithBaseSchemaResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_oneof_with_empty_schema_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_oneof_with_empty_schema_response_body_for_content_types) | **post** /responseBody/postOneofWithEmptySchemaResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_oneof_with_required_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_oneof_with_required_response_body_for_content_types) | **post** /responseBody/postOneofWithRequiredResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_pattern_is_not_anchored_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_pattern_is_not_anchored_response_body_for_content_types) | **post** /responseBody/postPatternIsNotAnchoredResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_pattern_validation_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_pattern_validation_response_body_for_content_types) | **post** /responseBody/postPatternValidationResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_properties_with_escaped_characters_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_properties_with_escaped_characters_response_body_for_content_types) | **post** /responseBody/postPropertiesWithEscapedCharactersResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_property_named_ref_that_is_not_a_reference_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_property_named_ref_that_is_not_a_reference_response_body_for_content_types) | **post** /responseBody/postPropertyNamedRefThatIsNotAReferenceResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_ref_in_additionalproperties_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_ref_in_additionalproperties_response_body_for_content_types) | **post** /responseBody/postRefInAdditionalpropertiesResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_ref_in_allof_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_ref_in_allof_response_body_for_content_types) | **post** /responseBody/postRefInAllofResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_ref_in_anyof_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_ref_in_anyof_response_body_for_content_types) | **post** /responseBody/postRefInAnyofResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_ref_in_items_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_ref_in_items_response_body_for_content_types) | **post** /responseBody/postRefInItemsResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_ref_in_not_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_ref_in_not_response_body_for_content_types) | **post** /responseBody/postRefInNotResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_ref_in_oneof_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_ref_in_oneof_response_body_for_content_types) | **post** /responseBody/postRefInOneofResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_ref_in_property_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_ref_in_property_response_body_for_content_types) | **post** /responseBody/postRefInPropertyResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_required_default_validation_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_required_default_validation_response_body_for_content_types) | **post** /responseBody/postRequiredDefaultValidationResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_required_validation_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_required_validation_response_body_for_content_types) | **post** /responseBody/postRequiredValidationResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_required_with_empty_array_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_required_with_empty_array_response_body_for_content_types) | **post** /responseBody/postRequiredWithEmptyArrayResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_required_with_escaped_characters_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_required_with_escaped_characters_response_body_for_content_types) | **post** /responseBody/postRequiredWithEscapedCharactersResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_simple_enum_validation_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_simple_enum_validation_response_body_for_content_types) | **post** /responseBody/postSimpleEnumValidationResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_string_type_matches_strings_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_string_type_matches_strings_response_body_for_content_types) | **post** /responseBody/postStringTypeMatchesStringsResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types) | **post** /responseBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_uniqueitems_false_validation_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_uniqueitems_false_validation_response_body_for_content_types) | **post** /responseBody/postUniqueitemsFalseValidationResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_uniqueitems_validation_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_uniqueitems_validation_response_body_for_content_types) | **post** /responseBody/postUniqueitemsValidationResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_uri_format_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_uri_format_response_body_for_content_types) | **post** /responseBody/postUriFormatResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_uri_reference_format_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_uri_reference_format_response_body_for_content_types) | **post** /responseBody/postUriReferenceFormatResponseBodyForContentTypes | -*ResponseContentContentTypeSchemaApi* | [**post_uri_template_format_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_uri_template_format_response_body_for_content_types) | **post** /responseBody/postUriTemplateFormatResponseBodyForContentTypes | -*TypeApi* | [**post_array_type_matches_arrays_request_body**](docs/apis/tags/TypeApi.md#post_array_type_matches_arrays_request_body) | **post** /requestBody/postArrayTypeMatchesArraysRequestBody | -*TypeApi* | [**post_array_type_matches_arrays_response_body_for_content_types**](docs/apis/tags/TypeApi.md#post_array_type_matches_arrays_response_body_for_content_types) | **post** /responseBody/postArrayTypeMatchesArraysResponseBodyForContentTypes | -*TypeApi* | [**post_boolean_type_matches_booleans_request_body**](docs/apis/tags/TypeApi.md#post_boolean_type_matches_booleans_request_body) | **post** /requestBody/postBooleanTypeMatchesBooleansRequestBody | -*TypeApi* | [**post_boolean_type_matches_booleans_response_body_for_content_types**](docs/apis/tags/TypeApi.md#post_boolean_type_matches_booleans_response_body_for_content_types) | **post** /responseBody/postBooleanTypeMatchesBooleansResponseBodyForContentTypes | -*TypeApi* | [**post_integer_type_matches_integers_request_body**](docs/apis/tags/TypeApi.md#post_integer_type_matches_integers_request_body) | **post** /requestBody/postIntegerTypeMatchesIntegersRequestBody | -*TypeApi* | [**post_integer_type_matches_integers_response_body_for_content_types**](docs/apis/tags/TypeApi.md#post_integer_type_matches_integers_response_body_for_content_types) | **post** /responseBody/postIntegerTypeMatchesIntegersResponseBodyForContentTypes | -*TypeApi* | [**post_null_type_matches_only_the_null_object_request_body**](docs/apis/tags/TypeApi.md#post_null_type_matches_only_the_null_object_request_body) | **post** /requestBody/postNullTypeMatchesOnlyTheNullObjectRequestBody | -*TypeApi* | [**post_null_type_matches_only_the_null_object_response_body_for_content_types**](docs/apis/tags/TypeApi.md#post_null_type_matches_only_the_null_object_response_body_for_content_types) | **post** /responseBody/postNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes | -*TypeApi* | [**post_number_type_matches_numbers_request_body**](docs/apis/tags/TypeApi.md#post_number_type_matches_numbers_request_body) | **post** /requestBody/postNumberTypeMatchesNumbersRequestBody | -*TypeApi* | [**post_number_type_matches_numbers_response_body_for_content_types**](docs/apis/tags/TypeApi.md#post_number_type_matches_numbers_response_body_for_content_types) | **post** /responseBody/postNumberTypeMatchesNumbersResponseBodyForContentTypes | -*TypeApi* | [**post_object_type_matches_objects_request_body**](docs/apis/tags/TypeApi.md#post_object_type_matches_objects_request_body) | **post** /requestBody/postObjectTypeMatchesObjectsRequestBody | -*TypeApi* | [**post_object_type_matches_objects_response_body_for_content_types**](docs/apis/tags/TypeApi.md#post_object_type_matches_objects_response_body_for_content_types) | **post** /responseBody/postObjectTypeMatchesObjectsResponseBodyForContentTypes | -*TypeApi* | [**post_string_type_matches_strings_request_body**](docs/apis/tags/TypeApi.md#post_string_type_matches_strings_request_body) | **post** /requestBody/postStringTypeMatchesStringsRequestBody | -*TypeApi* | [**post_string_type_matches_strings_response_body_for_content_types**](docs/apis/tags/TypeApi.md#post_string_type_matches_strings_response_body_for_content_types) | **post** /responseBody/postStringTypeMatchesStringsResponseBodyForContentTypes | -*UniqueItemsApi* | [**post_uniqueitems_false_validation_request_body**](docs/apis/tags/UniqueItemsApi.md#post_uniqueitems_false_validation_request_body) | **post** /requestBody/postUniqueitemsFalseValidationRequestBody | -*UniqueItemsApi* | [**post_uniqueitems_false_validation_response_body_for_content_types**](docs/apis/tags/UniqueItemsApi.md#post_uniqueitems_false_validation_response_body_for_content_types) | **post** /responseBody/postUniqueitemsFalseValidationResponseBodyForContentTypes | -*UniqueItemsApi* | [**post_uniqueitems_validation_request_body**](docs/apis/tags/UniqueItemsApi.md#post_uniqueitems_validation_request_body) | **post** /requestBody/postUniqueitemsValidationRequestBody | -*UniqueItemsApi* | [**post_uniqueitems_validation_response_body_for_content_types**](docs/apis/tags/UniqueItemsApi.md#post_uniqueitems_validation_response_body_for_content_types) | **post** /responseBody/postUniqueitemsValidationResponseBodyForContentTypes | - -## Documentation For Models - - - [AdditionalpropertiesAllowsASchemaWhichShouldValidate](docs/models/AdditionalpropertiesAllowsASchemaWhichShouldValidate.md) - - [AdditionalpropertiesAreAllowedByDefault](docs/models/AdditionalpropertiesAreAllowedByDefault.md) - - [AdditionalpropertiesCanExistByItself](docs/models/AdditionalpropertiesCanExistByItself.md) - - [AdditionalpropertiesShouldNotLookInApplicators](docs/models/AdditionalpropertiesShouldNotLookInApplicators.md) - - [Allof](docs/models/Allof.md) - - [AllofCombinedWithAnyofOneof](docs/models/AllofCombinedWithAnyofOneof.md) - - [AllofSimpleTypes](docs/models/AllofSimpleTypes.md) - - [AllofWithBaseSchema](docs/models/AllofWithBaseSchema.md) - - [AllofWithOneEmptySchema](docs/models/AllofWithOneEmptySchema.md) - - [AllofWithTheFirstEmptySchema](docs/models/AllofWithTheFirstEmptySchema.md) - - [AllofWithTheLastEmptySchema](docs/models/AllofWithTheLastEmptySchema.md) - - [AllofWithTwoEmptySchemas](docs/models/AllofWithTwoEmptySchemas.md) - - [Anyof](docs/models/Anyof.md) - - [AnyofComplexTypes](docs/models/AnyofComplexTypes.md) - - [AnyofWithBaseSchema](docs/models/AnyofWithBaseSchema.md) - - [AnyofWithOneEmptySchema](docs/models/AnyofWithOneEmptySchema.md) - - [ArrayTypeMatchesArrays](docs/models/ArrayTypeMatchesArrays.md) - - [BooleanTypeMatchesBooleans](docs/models/BooleanTypeMatchesBooleans.md) - - [ByInt](docs/models/ByInt.md) - - [ByNumber](docs/models/ByNumber.md) - - [BySmallNumber](docs/models/BySmallNumber.md) - - [DateTimeFormat](docs/models/DateTimeFormat.md) - - [EmailFormat](docs/models/EmailFormat.md) - - [EnumWith0DoesNotMatchFalse](docs/models/EnumWith0DoesNotMatchFalse.md) - - [EnumWith1DoesNotMatchTrue](docs/models/EnumWith1DoesNotMatchTrue.md) - - [EnumWithEscapedCharacters](docs/models/EnumWithEscapedCharacters.md) - - [EnumWithFalseDoesNotMatch0](docs/models/EnumWithFalseDoesNotMatch0.md) - - [EnumWithTrueDoesNotMatch1](docs/models/EnumWithTrueDoesNotMatch1.md) - - [EnumsInProperties](docs/models/EnumsInProperties.md) - - [ForbiddenProperty](docs/models/ForbiddenProperty.md) - - [HostnameFormat](docs/models/HostnameFormat.md) - - [IntegerTypeMatchesIntegers](docs/models/IntegerTypeMatchesIntegers.md) - - [InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf](docs/models/InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf.md) - - [InvalidStringValueForDefault](docs/models/InvalidStringValueForDefault.md) - - [Ipv4Format](docs/models/Ipv4Format.md) - - [Ipv6Format](docs/models/Ipv6Format.md) - - [JsonPointerFormat](docs/models/JsonPointerFormat.md) - - [MaximumValidation](docs/models/MaximumValidation.md) - - [MaximumValidationWithUnsignedInteger](docs/models/MaximumValidationWithUnsignedInteger.md) - - [MaxitemsValidation](docs/models/MaxitemsValidation.md) - - [MaxlengthValidation](docs/models/MaxlengthValidation.md) - - [Maxproperties0MeansTheObjectIsEmpty](docs/models/Maxproperties0MeansTheObjectIsEmpty.md) - - [MaxpropertiesValidation](docs/models/MaxpropertiesValidation.md) - - [MinimumValidation](docs/models/MinimumValidation.md) - - [MinimumValidationWithSignedInteger](docs/models/MinimumValidationWithSignedInteger.md) - - [MinitemsValidation](docs/models/MinitemsValidation.md) - - [MinlengthValidation](docs/models/MinlengthValidation.md) - - [MinpropertiesValidation](docs/models/MinpropertiesValidation.md) - - [ModelNot](docs/models/ModelNot.md) - - [NestedAllofToCheckValidationSemantics](docs/models/NestedAllofToCheckValidationSemantics.md) - - [NestedAnyofToCheckValidationSemantics](docs/models/NestedAnyofToCheckValidationSemantics.md) - - [NestedItems](docs/models/NestedItems.md) - - [NestedOneofToCheckValidationSemantics](docs/models/NestedOneofToCheckValidationSemantics.md) - - [NotMoreComplexSchema](docs/models/NotMoreComplexSchema.md) - - [NulCharactersInStrings](docs/models/NulCharactersInStrings.md) - - [NullTypeMatchesOnlyTheNullObject](docs/models/NullTypeMatchesOnlyTheNullObject.md) - - [NumberTypeMatchesNumbers](docs/models/NumberTypeMatchesNumbers.md) - - [ObjectPropertiesValidation](docs/models/ObjectPropertiesValidation.md) - - [Oneof](docs/models/Oneof.md) - - [OneofComplexTypes](docs/models/OneofComplexTypes.md) - - [OneofWithBaseSchema](docs/models/OneofWithBaseSchema.md) - - [OneofWithEmptySchema](docs/models/OneofWithEmptySchema.md) - - [OneofWithRequired](docs/models/OneofWithRequired.md) - - [PatternIsNotAnchored](docs/models/PatternIsNotAnchored.md) - - [PatternValidation](docs/models/PatternValidation.md) - - [PropertiesWithEscapedCharacters](docs/models/PropertiesWithEscapedCharacters.md) - - [PropertyNamedRefThatIsNotAReference](docs/models/PropertyNamedRefThatIsNotAReference.md) - - [RefInAdditionalproperties](docs/models/RefInAdditionalproperties.md) - - [RefInAllof](docs/models/RefInAllof.md) - - [RefInAnyof](docs/models/RefInAnyof.md) - - [RefInItems](docs/models/RefInItems.md) - - [RefInNot](docs/models/RefInNot.md) - - [RefInOneof](docs/models/RefInOneof.md) - - [RefInProperty](docs/models/RefInProperty.md) - - [RequiredDefaultValidation](docs/models/RequiredDefaultValidation.md) - - [RequiredValidation](docs/models/RequiredValidation.md) - - [RequiredWithEmptyArray](docs/models/RequiredWithEmptyArray.md) - - [RequiredWithEscapedCharacters](docs/models/RequiredWithEscapedCharacters.md) - - [SimpleEnumValidation](docs/models/SimpleEnumValidation.md) - - [StringTypeMatchesStrings](docs/models/StringTypeMatchesStrings.md) - - [TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing](docs/models/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.md) - - [UniqueitemsFalseValidation](docs/models/UniqueitemsFalseValidation.md) - - [UniqueitemsValidation](docs/models/UniqueitemsValidation.md) - - [UriFormat](docs/models/UriFormat.md) - - [UriReferenceFormat](docs/models/UriReferenceFormat.md) - - [UriTemplateFormat](docs/models/UriTemplateFormat.md) - -## Documentation For Authorization - - All endpoints do not require authorization. - -## Author - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +## Servers +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](docs/servers/server_0.md) | + +## Endpoints + +All URIs are relative to the selected server +- The server is selected by passing in server_info and server_index into api_configuration.ApiConfiguration +- Code samples in endpoints documents show how to do this +- server_index can also be passed in to endpoint calls, see endpoint documentation + +HTTP request | Method | Description +------------ | ------ | ------------- +/requestBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_additionalproperties_allows_a_schema_which_should_validate_request_body](docs/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_additionalproperties_allows_a_schema_which_should_validate_request_body](docs/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_additionalproperties_allows_a_schema_which_should_validate_request_body](docs/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post.md) [AdditionalPropertiesApi](docs/apis/tags/additional_properties_api.md).[post_additionalproperties_allows_a_schema_which_should_validate_request_body](docs/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post.md) | +/requestBody/postAdditionalpropertiesAreAllowedByDefaultRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_additionalproperties_are_allowed_by_default_request_body](docs/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_additionalproperties_are_allowed_by_default_request_body](docs/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_additionalproperties_are_allowed_by_default_request_body](docs/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post.md) [AdditionalPropertiesApi](docs/apis/tags/additional_properties_api.md).[post_additionalproperties_are_allowed_by_default_request_body](docs/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post.md) | +/requestBody/postAdditionalpropertiesCanExistByItselfRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_additionalproperties_can_exist_by_itself_request_body](docs/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_additionalproperties_can_exist_by_itself_request_body](docs/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_additionalproperties_can_exist_by_itself_request_body](docs/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post.md) [AdditionalPropertiesApi](docs/apis/tags/additional_properties_api.md).[post_additionalproperties_can_exist_by_itself_request_body](docs/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post.md) | +/requestBody/postAdditionalpropertiesShouldNotLookInApplicatorsRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_additionalproperties_should_not_look_in_applicators_request_body](docs/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_additionalproperties_should_not_look_in_applicators_request_body](docs/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_additionalproperties_should_not_look_in_applicators_request_body](docs/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post.md) [AdditionalPropertiesApi](docs/apis/tags/additional_properties_api.md).[post_additionalproperties_should_not_look_in_applicators_request_body](docs/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post.md) | +/requestBody/postAllofCombinedWithAnyofOneofRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_allof_combined_with_anyof_oneof_request_body](docs/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post.md) [AllOfApi](docs/apis/tags/all_of_api.md).[post_allof_combined_with_anyof_oneof_request_body](docs/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_allof_combined_with_anyof_oneof_request_body](docs/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_allof_combined_with_anyof_oneof_request_body](docs/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post.md) | +/requestBody/postAllofRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_allof_request_body](docs/paths/request_body_post_allof_request_body/post.md) [AllOfApi](docs/apis/tags/all_of_api.md).[post_allof_request_body](docs/paths/request_body_post_allof_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_allof_request_body](docs/paths/request_body_post_allof_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_allof_request_body](docs/paths/request_body_post_allof_request_body/post.md) | +/requestBody/postAllofSimpleTypesRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_allof_simple_types_request_body](docs/paths/request_body_post_allof_simple_types_request_body/post.md) [AllOfApi](docs/apis/tags/all_of_api.md).[post_allof_simple_types_request_body](docs/paths/request_body_post_allof_simple_types_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_allof_simple_types_request_body](docs/paths/request_body_post_allof_simple_types_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_allof_simple_types_request_body](docs/paths/request_body_post_allof_simple_types_request_body/post.md) | +/requestBody/postAllofWithBaseSchemaRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_allof_with_base_schema_request_body](docs/paths/request_body_post_allof_with_base_schema_request_body/post.md) [AllOfApi](docs/apis/tags/all_of_api.md).[post_allof_with_base_schema_request_body](docs/paths/request_body_post_allof_with_base_schema_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_allof_with_base_schema_request_body](docs/paths/request_body_post_allof_with_base_schema_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_allof_with_base_schema_request_body](docs/paths/request_body_post_allof_with_base_schema_request_body/post.md) | +/requestBody/postAllofWithOneEmptySchemaRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_allof_with_one_empty_schema_request_body](docs/paths/request_body_post_allof_with_one_empty_schema_request_body/post.md) [AllOfApi](docs/apis/tags/all_of_api.md).[post_allof_with_one_empty_schema_request_body](docs/paths/request_body_post_allof_with_one_empty_schema_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_allof_with_one_empty_schema_request_body](docs/paths/request_body_post_allof_with_one_empty_schema_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_allof_with_one_empty_schema_request_body](docs/paths/request_body_post_allof_with_one_empty_schema_request_body/post.md) | +/requestBody/postAllofWithTheFirstEmptySchemaRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_allof_with_the_first_empty_schema_request_body](docs/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post.md) [AllOfApi](docs/apis/tags/all_of_api.md).[post_allof_with_the_first_empty_schema_request_body](docs/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_allof_with_the_first_empty_schema_request_body](docs/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_allof_with_the_first_empty_schema_request_body](docs/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post.md) | +/requestBody/postAllofWithTheLastEmptySchemaRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_allof_with_the_last_empty_schema_request_body](docs/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post.md) [AllOfApi](docs/apis/tags/all_of_api.md).[post_allof_with_the_last_empty_schema_request_body](docs/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_allof_with_the_last_empty_schema_request_body](docs/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_allof_with_the_last_empty_schema_request_body](docs/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post.md) | +/requestBody/postAllofWithTwoEmptySchemasRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_allof_with_two_empty_schemas_request_body](docs/paths/request_body_post_allof_with_two_empty_schemas_request_body/post.md) [AllOfApi](docs/apis/tags/all_of_api.md).[post_allof_with_two_empty_schemas_request_body](docs/paths/request_body_post_allof_with_two_empty_schemas_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_allof_with_two_empty_schemas_request_body](docs/paths/request_body_post_allof_with_two_empty_schemas_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_allof_with_two_empty_schemas_request_body](docs/paths/request_body_post_allof_with_two_empty_schemas_request_body/post.md) | +/requestBody/postAnyofComplexTypesRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_anyof_complex_types_request_body](docs/paths/request_body_post_anyof_complex_types_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_anyof_complex_types_request_body](docs/paths/request_body_post_anyof_complex_types_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_anyof_complex_types_request_body](docs/paths/request_body_post_anyof_complex_types_request_body/post.md) [AnyOfApi](docs/apis/tags/any_of_api.md).[post_anyof_complex_types_request_body](docs/paths/request_body_post_anyof_complex_types_request_body/post.md) | +/requestBody/postAnyofRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_anyof_request_body](docs/paths/request_body_post_anyof_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_anyof_request_body](docs/paths/request_body_post_anyof_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_anyof_request_body](docs/paths/request_body_post_anyof_request_body/post.md) [AnyOfApi](docs/apis/tags/any_of_api.md).[post_anyof_request_body](docs/paths/request_body_post_anyof_request_body/post.md) | +/requestBody/postAnyofWithBaseSchemaRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_anyof_with_base_schema_request_body](docs/paths/request_body_post_anyof_with_base_schema_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_anyof_with_base_schema_request_body](docs/paths/request_body_post_anyof_with_base_schema_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_anyof_with_base_schema_request_body](docs/paths/request_body_post_anyof_with_base_schema_request_body/post.md) [AnyOfApi](docs/apis/tags/any_of_api.md).[post_anyof_with_base_schema_request_body](docs/paths/request_body_post_anyof_with_base_schema_request_body/post.md) | +/requestBody/postAnyofWithOneEmptySchemaRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_anyof_with_one_empty_schema_request_body](docs/paths/request_body_post_anyof_with_one_empty_schema_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_anyof_with_one_empty_schema_request_body](docs/paths/request_body_post_anyof_with_one_empty_schema_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_anyof_with_one_empty_schema_request_body](docs/paths/request_body_post_anyof_with_one_empty_schema_request_body/post.md) [AnyOfApi](docs/apis/tags/any_of_api.md).[post_anyof_with_one_empty_schema_request_body](docs/paths/request_body_post_anyof_with_one_empty_schema_request_body/post.md) | +/requestBody/postArrayTypeMatchesArraysRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_array_type_matches_arrays_request_body](docs/paths/request_body_post_array_type_matches_arrays_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_array_type_matches_arrays_request_body](docs/paths/request_body_post_array_type_matches_arrays_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_array_type_matches_arrays_request_body](docs/paths/request_body_post_array_type_matches_arrays_request_body/post.md) [TypeApi](docs/apis/tags/type_api.md).[post_array_type_matches_arrays_request_body](docs/paths/request_body_post_array_type_matches_arrays_request_body/post.md) | +/requestBody/postBooleanTypeMatchesBooleansRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_boolean_type_matches_booleans_request_body](docs/paths/request_body_post_boolean_type_matches_booleans_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_boolean_type_matches_booleans_request_body](docs/paths/request_body_post_boolean_type_matches_booleans_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_boolean_type_matches_booleans_request_body](docs/paths/request_body_post_boolean_type_matches_booleans_request_body/post.md) [TypeApi](docs/apis/tags/type_api.md).[post_boolean_type_matches_booleans_request_body](docs/paths/request_body_post_boolean_type_matches_booleans_request_body/post.md) | +/requestBody/postByIntRequestBody **post** | [MultipleOfApi](docs/apis/tags/multiple_of_api.md).[post_by_int_request_body](docs/paths/request_body_post_by_int_request_body/post.md) [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_by_int_request_body](docs/paths/request_body_post_by_int_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_by_int_request_body](docs/paths/request_body_post_by_int_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_by_int_request_body](docs/paths/request_body_post_by_int_request_body/post.md) | +/requestBody/postByNumberRequestBody **post** | [MultipleOfApi](docs/apis/tags/multiple_of_api.md).[post_by_number_request_body](docs/paths/request_body_post_by_number_request_body/post.md) [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_by_number_request_body](docs/paths/request_body_post_by_number_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_by_number_request_body](docs/paths/request_body_post_by_number_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_by_number_request_body](docs/paths/request_body_post_by_number_request_body/post.md) | +/requestBody/postBySmallNumberRequestBody **post** | [MultipleOfApi](docs/apis/tags/multiple_of_api.md).[post_by_small_number_request_body](docs/paths/request_body_post_by_small_number_request_body/post.md) [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_by_small_number_request_body](docs/paths/request_body_post_by_small_number_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_by_small_number_request_body](docs/paths/request_body_post_by_small_number_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_by_small_number_request_body](docs/paths/request_body_post_by_small_number_request_body/post.md) | +/requestBody/postDateTimeFormatRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_date_time_format_request_body](docs/paths/request_body_post_date_time_format_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_date_time_format_request_body](docs/paths/request_body_post_date_time_format_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_date_time_format_request_body](docs/paths/request_body_post_date_time_format_request_body/post.md) [FormatApi](docs/apis/tags/format_api.md).[post_date_time_format_request_body](docs/paths/request_body_post_date_time_format_request_body/post.md) | +/requestBody/postEmailFormatRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_email_format_request_body](docs/paths/request_body_post_email_format_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_email_format_request_body](docs/paths/request_body_post_email_format_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_email_format_request_body](docs/paths/request_body_post_email_format_request_body/post.md) [FormatApi](docs/apis/tags/format_api.md).[post_email_format_request_body](docs/paths/request_body_post_email_format_request_body/post.md) | +/requestBody/postEnumWith0DoesNotMatchFalseRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_enum_with0_does_not_match_false_request_body](docs/paths/request_body_post_enum_with0_does_not_match_false_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_enum_with0_does_not_match_false_request_body](docs/paths/request_body_post_enum_with0_does_not_match_false_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_enum_with0_does_not_match_false_request_body](docs/paths/request_body_post_enum_with0_does_not_match_false_request_body/post.md) [EnumApi](docs/apis/tags/enum_api.md).[post_enum_with0_does_not_match_false_request_body](docs/paths/request_body_post_enum_with0_does_not_match_false_request_body/post.md) | +/requestBody/postEnumWith1DoesNotMatchTrueRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_enum_with1_does_not_match_true_request_body](docs/paths/request_body_post_enum_with1_does_not_match_true_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_enum_with1_does_not_match_true_request_body](docs/paths/request_body_post_enum_with1_does_not_match_true_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_enum_with1_does_not_match_true_request_body](docs/paths/request_body_post_enum_with1_does_not_match_true_request_body/post.md) [EnumApi](docs/apis/tags/enum_api.md).[post_enum_with1_does_not_match_true_request_body](docs/paths/request_body_post_enum_with1_does_not_match_true_request_body/post.md) | +/requestBody/postEnumWithEscapedCharactersRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_enum_with_escaped_characters_request_body](docs/paths/request_body_post_enum_with_escaped_characters_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_enum_with_escaped_characters_request_body](docs/paths/request_body_post_enum_with_escaped_characters_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_enum_with_escaped_characters_request_body](docs/paths/request_body_post_enum_with_escaped_characters_request_body/post.md) [EnumApi](docs/apis/tags/enum_api.md).[post_enum_with_escaped_characters_request_body](docs/paths/request_body_post_enum_with_escaped_characters_request_body/post.md) | +/requestBody/postEnumWithFalseDoesNotMatch0RequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_enum_with_false_does_not_match0_request_body](docs/paths/request_body_post_enum_with_false_does_not_match0_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_enum_with_false_does_not_match0_request_body](docs/paths/request_body_post_enum_with_false_does_not_match0_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_enum_with_false_does_not_match0_request_body](docs/paths/request_body_post_enum_with_false_does_not_match0_request_body/post.md) [EnumApi](docs/apis/tags/enum_api.md).[post_enum_with_false_does_not_match0_request_body](docs/paths/request_body_post_enum_with_false_does_not_match0_request_body/post.md) | +/requestBody/postEnumWithTrueDoesNotMatch1RequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_enum_with_true_does_not_match1_request_body](docs/paths/request_body_post_enum_with_true_does_not_match1_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_enum_with_true_does_not_match1_request_body](docs/paths/request_body_post_enum_with_true_does_not_match1_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_enum_with_true_does_not_match1_request_body](docs/paths/request_body_post_enum_with_true_does_not_match1_request_body/post.md) [EnumApi](docs/apis/tags/enum_api.md).[post_enum_with_true_does_not_match1_request_body](docs/paths/request_body_post_enum_with_true_does_not_match1_request_body/post.md) | +/requestBody/postEnumsInPropertiesRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_enums_in_properties_request_body](docs/paths/request_body_post_enums_in_properties_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_enums_in_properties_request_body](docs/paths/request_body_post_enums_in_properties_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_enums_in_properties_request_body](docs/paths/request_body_post_enums_in_properties_request_body/post.md) [EnumApi](docs/apis/tags/enum_api.md).[post_enums_in_properties_request_body](docs/paths/request_body_post_enums_in_properties_request_body/post.md) | +/requestBody/postForbiddenPropertyRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_forbidden_property_request_body](docs/paths/request_body_post_forbidden_property_request_body/post.md) [_NotApi](docs/apis/tags/_not_api.md).[post_forbidden_property_request_body](docs/paths/request_body_post_forbidden_property_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_forbidden_property_request_body](docs/paths/request_body_post_forbidden_property_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_forbidden_property_request_body](docs/paths/request_body_post_forbidden_property_request_body/post.md) | +/requestBody/postHostnameFormatRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_hostname_format_request_body](docs/paths/request_body_post_hostname_format_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_hostname_format_request_body](docs/paths/request_body_post_hostname_format_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_hostname_format_request_body](docs/paths/request_body_post_hostname_format_request_body/post.md) [FormatApi](docs/apis/tags/format_api.md).[post_hostname_format_request_body](docs/paths/request_body_post_hostname_format_request_body/post.md) | +/requestBody/postIntegerTypeMatchesIntegersRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_integer_type_matches_integers_request_body](docs/paths/request_body_post_integer_type_matches_integers_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_integer_type_matches_integers_request_body](docs/paths/request_body_post_integer_type_matches_integers_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_integer_type_matches_integers_request_body](docs/paths/request_body_post_integer_type_matches_integers_request_body/post.md) [TypeApi](docs/apis/tags/type_api.md).[post_integer_type_matches_integers_request_body](docs/paths/request_body_post_integer_type_matches_integers_request_body/post.md) | +/requestBody/postInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody **post** | [MultipleOfApi](docs/apis/tags/multiple_of_api.md).[post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body](docs/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post.md) [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body](docs/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body](docs/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body](docs/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post.md) | +/requestBody/postInvalidStringValueForDefaultRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_invalid_string_value_for_default_request_body](docs/paths/request_body_post_invalid_string_value_for_default_request_body/post.md) [DefaultApi](docs/apis/tags/default_api.md).[post_invalid_string_value_for_default_request_body](docs/paths/request_body_post_invalid_string_value_for_default_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_invalid_string_value_for_default_request_body](docs/paths/request_body_post_invalid_string_value_for_default_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_invalid_string_value_for_default_request_body](docs/paths/request_body_post_invalid_string_value_for_default_request_body/post.md) | +/requestBody/postIpv4FormatRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_ipv4_format_request_body](docs/paths/request_body_post_ipv4_format_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_ipv4_format_request_body](docs/paths/request_body_post_ipv4_format_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_ipv4_format_request_body](docs/paths/request_body_post_ipv4_format_request_body/post.md) [FormatApi](docs/apis/tags/format_api.md).[post_ipv4_format_request_body](docs/paths/request_body_post_ipv4_format_request_body/post.md) | +/requestBody/postIpv6FormatRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_ipv6_format_request_body](docs/paths/request_body_post_ipv6_format_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_ipv6_format_request_body](docs/paths/request_body_post_ipv6_format_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_ipv6_format_request_body](docs/paths/request_body_post_ipv6_format_request_body/post.md) [FormatApi](docs/apis/tags/format_api.md).[post_ipv6_format_request_body](docs/paths/request_body_post_ipv6_format_request_body/post.md) | +/requestBody/postJsonPointerFormatRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_json_pointer_format_request_body](docs/paths/request_body_post_json_pointer_format_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_json_pointer_format_request_body](docs/paths/request_body_post_json_pointer_format_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_json_pointer_format_request_body](docs/paths/request_body_post_json_pointer_format_request_body/post.md) [FormatApi](docs/apis/tags/format_api.md).[post_json_pointer_format_request_body](docs/paths/request_body_post_json_pointer_format_request_body/post.md) | +/requestBody/postMaximumValidationRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_maximum_validation_request_body](docs/paths/request_body_post_maximum_validation_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_maximum_validation_request_body](docs/paths/request_body_post_maximum_validation_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_maximum_validation_request_body](docs/paths/request_body_post_maximum_validation_request_body/post.md) [MaximumApi](docs/apis/tags/maximum_api.md).[post_maximum_validation_request_body](docs/paths/request_body_post_maximum_validation_request_body/post.md) | +/requestBody/postMaximumValidationWithUnsignedIntegerRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_maximum_validation_with_unsigned_integer_request_body](docs/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_maximum_validation_with_unsigned_integer_request_body](docs/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_maximum_validation_with_unsigned_integer_request_body](docs/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post.md) [MaximumApi](docs/apis/tags/maximum_api.md).[post_maximum_validation_with_unsigned_integer_request_body](docs/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post.md) | +/requestBody/postMaxitemsValidationRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_maxitems_validation_request_body](docs/paths/request_body_post_maxitems_validation_request_body/post.md) [MaxItemsApi](docs/apis/tags/max_items_api.md).[post_maxitems_validation_request_body](docs/paths/request_body_post_maxitems_validation_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_maxitems_validation_request_body](docs/paths/request_body_post_maxitems_validation_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_maxitems_validation_request_body](docs/paths/request_body_post_maxitems_validation_request_body/post.md) | +/requestBody/postMaxlengthValidationRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_maxlength_validation_request_body](docs/paths/request_body_post_maxlength_validation_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_maxlength_validation_request_body](docs/paths/request_body_post_maxlength_validation_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_maxlength_validation_request_body](docs/paths/request_body_post_maxlength_validation_request_body/post.md) [MaxLengthApi](docs/apis/tags/max_length_api.md).[post_maxlength_validation_request_body](docs/paths/request_body_post_maxlength_validation_request_body/post.md) | +/requestBody/postMaxproperties0MeansTheObjectIsEmptyRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_maxproperties0_means_the_object_is_empty_request_body](docs/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_maxproperties0_means_the_object_is_empty_request_body](docs/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_maxproperties0_means_the_object_is_empty_request_body](docs/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post.md) [MaxPropertiesApi](docs/apis/tags/max_properties_api.md).[post_maxproperties0_means_the_object_is_empty_request_body](docs/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post.md) | +/requestBody/postMaxpropertiesValidationRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_maxproperties_validation_request_body](docs/paths/request_body_post_maxproperties_validation_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_maxproperties_validation_request_body](docs/paths/request_body_post_maxproperties_validation_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_maxproperties_validation_request_body](docs/paths/request_body_post_maxproperties_validation_request_body/post.md) [MaxPropertiesApi](docs/apis/tags/max_properties_api.md).[post_maxproperties_validation_request_body](docs/paths/request_body_post_maxproperties_validation_request_body/post.md) | +/requestBody/postMinimumValidationRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_minimum_validation_request_body](docs/paths/request_body_post_minimum_validation_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_minimum_validation_request_body](docs/paths/request_body_post_minimum_validation_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_minimum_validation_request_body](docs/paths/request_body_post_minimum_validation_request_body/post.md) [MinimumApi](docs/apis/tags/minimum_api.md).[post_minimum_validation_request_body](docs/paths/request_body_post_minimum_validation_request_body/post.md) | +/requestBody/postMinimumValidationWithSignedIntegerRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_minimum_validation_with_signed_integer_request_body](docs/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_minimum_validation_with_signed_integer_request_body](docs/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_minimum_validation_with_signed_integer_request_body](docs/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post.md) [MinimumApi](docs/apis/tags/minimum_api.md).[post_minimum_validation_with_signed_integer_request_body](docs/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post.md) | +/requestBody/postMinitemsValidationRequestBody **post** | [MinItemsApi](docs/apis/tags/min_items_api.md).[post_minitems_validation_request_body](docs/paths/request_body_post_minitems_validation_request_body/post.md) [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_minitems_validation_request_body](docs/paths/request_body_post_minitems_validation_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_minitems_validation_request_body](docs/paths/request_body_post_minitems_validation_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_minitems_validation_request_body](docs/paths/request_body_post_minitems_validation_request_body/post.md) | +/requestBody/postMinlengthValidationRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_minlength_validation_request_body](docs/paths/request_body_post_minlength_validation_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_minlength_validation_request_body](docs/paths/request_body_post_minlength_validation_request_body/post.md) [MinLengthApi](docs/apis/tags/min_length_api.md).[post_minlength_validation_request_body](docs/paths/request_body_post_minlength_validation_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_minlength_validation_request_body](docs/paths/request_body_post_minlength_validation_request_body/post.md) | +/requestBody/postMinpropertiesValidationRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_minproperties_validation_request_body](docs/paths/request_body_post_minproperties_validation_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_minproperties_validation_request_body](docs/paths/request_body_post_minproperties_validation_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_minproperties_validation_request_body](docs/paths/request_body_post_minproperties_validation_request_body/post.md) [MinPropertiesApi](docs/apis/tags/min_properties_api.md).[post_minproperties_validation_request_body](docs/paths/request_body_post_minproperties_validation_request_body/post.md) | +/requestBody/postNestedAllofToCheckValidationSemanticsRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_nested_allof_to_check_validation_semantics_request_body](docs/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post.md) [AllOfApi](docs/apis/tags/all_of_api.md).[post_nested_allof_to_check_validation_semantics_request_body](docs/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_nested_allof_to_check_validation_semantics_request_body](docs/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_nested_allof_to_check_validation_semantics_request_body](docs/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post.md) | +/requestBody/postNestedAnyofToCheckValidationSemanticsRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_nested_anyof_to_check_validation_semantics_request_body](docs/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_nested_anyof_to_check_validation_semantics_request_body](docs/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_nested_anyof_to_check_validation_semantics_request_body](docs/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post.md) [AnyOfApi](docs/apis/tags/any_of_api.md).[post_nested_anyof_to_check_validation_semantics_request_body](docs/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post.md) | +/requestBody/postNestedItemsRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_nested_items_request_body](docs/paths/request_body_post_nested_items_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_nested_items_request_body](docs/paths/request_body_post_nested_items_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_nested_items_request_body](docs/paths/request_body_post_nested_items_request_body/post.md) [ItemsApi](docs/apis/tags/items_api.md).[post_nested_items_request_body](docs/paths/request_body_post_nested_items_request_body/post.md) | +/requestBody/postNestedOneofToCheckValidationSemanticsRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_nested_oneof_to_check_validation_semantics_request_body](docs/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post.md) [OneOfApi](docs/apis/tags/one_of_api.md).[post_nested_oneof_to_check_validation_semantics_request_body](docs/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_nested_oneof_to_check_validation_semantics_request_body](docs/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_nested_oneof_to_check_validation_semantics_request_body](docs/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post.md) | +/requestBody/postNotMoreComplexSchemaRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_not_more_complex_schema_request_body](docs/paths/request_body_post_not_more_complex_schema_request_body/post.md) [_NotApi](docs/apis/tags/_not_api.md).[post_not_more_complex_schema_request_body](docs/paths/request_body_post_not_more_complex_schema_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_not_more_complex_schema_request_body](docs/paths/request_body_post_not_more_complex_schema_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_not_more_complex_schema_request_body](docs/paths/request_body_post_not_more_complex_schema_request_body/post.md) | +/requestBody/postNotRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_not_request_body](docs/paths/request_body_post_not_request_body/post.md) [_NotApi](docs/apis/tags/_not_api.md).[post_not_request_body](docs/paths/request_body_post_not_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_not_request_body](docs/paths/request_body_post_not_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_not_request_body](docs/paths/request_body_post_not_request_body/post.md) | +/requestBody/postNulCharactersInStringsRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_nul_characters_in_strings_request_body](docs/paths/request_body_post_nul_characters_in_strings_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_nul_characters_in_strings_request_body](docs/paths/request_body_post_nul_characters_in_strings_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_nul_characters_in_strings_request_body](docs/paths/request_body_post_nul_characters_in_strings_request_body/post.md) [EnumApi](docs/apis/tags/enum_api.md).[post_nul_characters_in_strings_request_body](docs/paths/request_body_post_nul_characters_in_strings_request_body/post.md) | +/requestBody/postNullTypeMatchesOnlyTheNullObjectRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_null_type_matches_only_the_null_object_request_body](docs/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_null_type_matches_only_the_null_object_request_body](docs/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_null_type_matches_only_the_null_object_request_body](docs/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post.md) [TypeApi](docs/apis/tags/type_api.md).[post_null_type_matches_only_the_null_object_request_body](docs/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post.md) | +/requestBody/postNumberTypeMatchesNumbersRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_number_type_matches_numbers_request_body](docs/paths/request_body_post_number_type_matches_numbers_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_number_type_matches_numbers_request_body](docs/paths/request_body_post_number_type_matches_numbers_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_number_type_matches_numbers_request_body](docs/paths/request_body_post_number_type_matches_numbers_request_body/post.md) [TypeApi](docs/apis/tags/type_api.md).[post_number_type_matches_numbers_request_body](docs/paths/request_body_post_number_type_matches_numbers_request_body/post.md) | +/requestBody/postObjectPropertiesValidationRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_object_properties_validation_request_body](docs/paths/request_body_post_object_properties_validation_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_object_properties_validation_request_body](docs/paths/request_body_post_object_properties_validation_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_object_properties_validation_request_body](docs/paths/request_body_post_object_properties_validation_request_body/post.md) [PropertiesApi](docs/apis/tags/properties_api.md).[post_object_properties_validation_request_body](docs/paths/request_body_post_object_properties_validation_request_body/post.md) | +/requestBody/postObjectTypeMatchesObjectsRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_object_type_matches_objects_request_body](docs/paths/request_body_post_object_type_matches_objects_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_object_type_matches_objects_request_body](docs/paths/request_body_post_object_type_matches_objects_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_object_type_matches_objects_request_body](docs/paths/request_body_post_object_type_matches_objects_request_body/post.md) [TypeApi](docs/apis/tags/type_api.md).[post_object_type_matches_objects_request_body](docs/paths/request_body_post_object_type_matches_objects_request_body/post.md) | +/requestBody/postOneofComplexTypesRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_oneof_complex_types_request_body](docs/paths/request_body_post_oneof_complex_types_request_body/post.md) [OneOfApi](docs/apis/tags/one_of_api.md).[post_oneof_complex_types_request_body](docs/paths/request_body_post_oneof_complex_types_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_oneof_complex_types_request_body](docs/paths/request_body_post_oneof_complex_types_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_oneof_complex_types_request_body](docs/paths/request_body_post_oneof_complex_types_request_body/post.md) | +/requestBody/postOneofRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_oneof_request_body](docs/paths/request_body_post_oneof_request_body/post.md) [OneOfApi](docs/apis/tags/one_of_api.md).[post_oneof_request_body](docs/paths/request_body_post_oneof_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_oneof_request_body](docs/paths/request_body_post_oneof_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_oneof_request_body](docs/paths/request_body_post_oneof_request_body/post.md) | +/requestBody/postOneofWithBaseSchemaRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_oneof_with_base_schema_request_body](docs/paths/request_body_post_oneof_with_base_schema_request_body/post.md) [OneOfApi](docs/apis/tags/one_of_api.md).[post_oneof_with_base_schema_request_body](docs/paths/request_body_post_oneof_with_base_schema_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_oneof_with_base_schema_request_body](docs/paths/request_body_post_oneof_with_base_schema_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_oneof_with_base_schema_request_body](docs/paths/request_body_post_oneof_with_base_schema_request_body/post.md) | +/requestBody/postOneofWithEmptySchemaRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_oneof_with_empty_schema_request_body](docs/paths/request_body_post_oneof_with_empty_schema_request_body/post.md) [OneOfApi](docs/apis/tags/one_of_api.md).[post_oneof_with_empty_schema_request_body](docs/paths/request_body_post_oneof_with_empty_schema_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_oneof_with_empty_schema_request_body](docs/paths/request_body_post_oneof_with_empty_schema_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_oneof_with_empty_schema_request_body](docs/paths/request_body_post_oneof_with_empty_schema_request_body/post.md) | +/requestBody/postOneofWithRequiredRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_oneof_with_required_request_body](docs/paths/request_body_post_oneof_with_required_request_body/post.md) [OneOfApi](docs/apis/tags/one_of_api.md).[post_oneof_with_required_request_body](docs/paths/request_body_post_oneof_with_required_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_oneof_with_required_request_body](docs/paths/request_body_post_oneof_with_required_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_oneof_with_required_request_body](docs/paths/request_body_post_oneof_with_required_request_body/post.md) | +/requestBody/postPatternIsNotAnchoredRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_pattern_is_not_anchored_request_body](docs/paths/request_body_post_pattern_is_not_anchored_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_pattern_is_not_anchored_request_body](docs/paths/request_body_post_pattern_is_not_anchored_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_pattern_is_not_anchored_request_body](docs/paths/request_body_post_pattern_is_not_anchored_request_body/post.md) [PatternApi](docs/apis/tags/pattern_api.md).[post_pattern_is_not_anchored_request_body](docs/paths/request_body_post_pattern_is_not_anchored_request_body/post.md) | +/requestBody/postPatternValidationRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_pattern_validation_request_body](docs/paths/request_body_post_pattern_validation_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_pattern_validation_request_body](docs/paths/request_body_post_pattern_validation_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_pattern_validation_request_body](docs/paths/request_body_post_pattern_validation_request_body/post.md) [PatternApi](docs/apis/tags/pattern_api.md).[post_pattern_validation_request_body](docs/paths/request_body_post_pattern_validation_request_body/post.md) | +/requestBody/postPropertiesWithEscapedCharactersRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_properties_with_escaped_characters_request_body](docs/paths/request_body_post_properties_with_escaped_characters_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_properties_with_escaped_characters_request_body](docs/paths/request_body_post_properties_with_escaped_characters_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_properties_with_escaped_characters_request_body](docs/paths/request_body_post_properties_with_escaped_characters_request_body/post.md) [PropertiesApi](docs/apis/tags/properties_api.md).[post_properties_with_escaped_characters_request_body](docs/paths/request_body_post_properties_with_escaped_characters_request_body/post.md) | +/requestBody/postPropertyNamedRefThatIsNotAReferenceRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_property_named_ref_that_is_not_a_reference_request_body](docs/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_property_named_ref_that_is_not_a_reference_request_body](docs/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_property_named_ref_that_is_not_a_reference_request_body](docs/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post.md) [RefApi](docs/apis/tags/ref_api.md).[post_property_named_ref_that_is_not_a_reference_request_body](docs/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post.md) | +/requestBody/postRefInAdditionalpropertiesRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_ref_in_additionalproperties_request_body](docs/paths/request_body_post_ref_in_additionalproperties_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_ref_in_additionalproperties_request_body](docs/paths/request_body_post_ref_in_additionalproperties_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_ref_in_additionalproperties_request_body](docs/paths/request_body_post_ref_in_additionalproperties_request_body/post.md) [RefApi](docs/apis/tags/ref_api.md).[post_ref_in_additionalproperties_request_body](docs/paths/request_body_post_ref_in_additionalproperties_request_body/post.md) | +/requestBody/postRefInAllofRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_ref_in_allof_request_body](docs/paths/request_body_post_ref_in_allof_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_ref_in_allof_request_body](docs/paths/request_body_post_ref_in_allof_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_ref_in_allof_request_body](docs/paths/request_body_post_ref_in_allof_request_body/post.md) [RefApi](docs/apis/tags/ref_api.md).[post_ref_in_allof_request_body](docs/paths/request_body_post_ref_in_allof_request_body/post.md) | +/requestBody/postRefInAnyofRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_ref_in_anyof_request_body](docs/paths/request_body_post_ref_in_anyof_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_ref_in_anyof_request_body](docs/paths/request_body_post_ref_in_anyof_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_ref_in_anyof_request_body](docs/paths/request_body_post_ref_in_anyof_request_body/post.md) [RefApi](docs/apis/tags/ref_api.md).[post_ref_in_anyof_request_body](docs/paths/request_body_post_ref_in_anyof_request_body/post.md) | +/requestBody/postRefInItemsRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_ref_in_items_request_body](docs/paths/request_body_post_ref_in_items_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_ref_in_items_request_body](docs/paths/request_body_post_ref_in_items_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_ref_in_items_request_body](docs/paths/request_body_post_ref_in_items_request_body/post.md) [RefApi](docs/apis/tags/ref_api.md).[post_ref_in_items_request_body](docs/paths/request_body_post_ref_in_items_request_body/post.md) | +/requestBody/postRefInNotRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_ref_in_not_request_body](docs/paths/request_body_post_ref_in_not_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_ref_in_not_request_body](docs/paths/request_body_post_ref_in_not_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_ref_in_not_request_body](docs/paths/request_body_post_ref_in_not_request_body/post.md) [RefApi](docs/apis/tags/ref_api.md).[post_ref_in_not_request_body](docs/paths/request_body_post_ref_in_not_request_body/post.md) | +/requestBody/postRefInOneofRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_ref_in_oneof_request_body](docs/paths/request_body_post_ref_in_oneof_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_ref_in_oneof_request_body](docs/paths/request_body_post_ref_in_oneof_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_ref_in_oneof_request_body](docs/paths/request_body_post_ref_in_oneof_request_body/post.md) [RefApi](docs/apis/tags/ref_api.md).[post_ref_in_oneof_request_body](docs/paths/request_body_post_ref_in_oneof_request_body/post.md) | +/requestBody/postRefInPropertyRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_ref_in_property_request_body](docs/paths/request_body_post_ref_in_property_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_ref_in_property_request_body](docs/paths/request_body_post_ref_in_property_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_ref_in_property_request_body](docs/paths/request_body_post_ref_in_property_request_body/post.md) [RefApi](docs/apis/tags/ref_api.md).[post_ref_in_property_request_body](docs/paths/request_body_post_ref_in_property_request_body/post.md) | +/requestBody/postRequiredDefaultValidationRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_required_default_validation_request_body](docs/paths/request_body_post_required_default_validation_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_required_default_validation_request_body](docs/paths/request_body_post_required_default_validation_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_required_default_validation_request_body](docs/paths/request_body_post_required_default_validation_request_body/post.md) [RequiredApi](docs/apis/tags/required_api.md).[post_required_default_validation_request_body](docs/paths/request_body_post_required_default_validation_request_body/post.md) | +/requestBody/postRequiredValidationRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_required_validation_request_body](docs/paths/request_body_post_required_validation_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_required_validation_request_body](docs/paths/request_body_post_required_validation_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_required_validation_request_body](docs/paths/request_body_post_required_validation_request_body/post.md) [RequiredApi](docs/apis/tags/required_api.md).[post_required_validation_request_body](docs/paths/request_body_post_required_validation_request_body/post.md) | +/requestBody/postRequiredWithEmptyArrayRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_required_with_empty_array_request_body](docs/paths/request_body_post_required_with_empty_array_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_required_with_empty_array_request_body](docs/paths/request_body_post_required_with_empty_array_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_required_with_empty_array_request_body](docs/paths/request_body_post_required_with_empty_array_request_body/post.md) [RequiredApi](docs/apis/tags/required_api.md).[post_required_with_empty_array_request_body](docs/paths/request_body_post_required_with_empty_array_request_body/post.md) | +/requestBody/postRequiredWithEscapedCharactersRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_required_with_escaped_characters_request_body](docs/paths/request_body_post_required_with_escaped_characters_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_required_with_escaped_characters_request_body](docs/paths/request_body_post_required_with_escaped_characters_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_required_with_escaped_characters_request_body](docs/paths/request_body_post_required_with_escaped_characters_request_body/post.md) [RequiredApi](docs/apis/tags/required_api.md).[post_required_with_escaped_characters_request_body](docs/paths/request_body_post_required_with_escaped_characters_request_body/post.md) | +/requestBody/postSimpleEnumValidationRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_simple_enum_validation_request_body](docs/paths/request_body_post_simple_enum_validation_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_simple_enum_validation_request_body](docs/paths/request_body_post_simple_enum_validation_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_simple_enum_validation_request_body](docs/paths/request_body_post_simple_enum_validation_request_body/post.md) [EnumApi](docs/apis/tags/enum_api.md).[post_simple_enum_validation_request_body](docs/paths/request_body_post_simple_enum_validation_request_body/post.md) | +/requestBody/postStringTypeMatchesStringsRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_string_type_matches_strings_request_body](docs/paths/request_body_post_string_type_matches_strings_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_string_type_matches_strings_request_body](docs/paths/request_body_post_string_type_matches_strings_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_string_type_matches_strings_request_body](docs/paths/request_body_post_string_type_matches_strings_request_body/post.md) [TypeApi](docs/apis/tags/type_api.md).[post_string_type_matches_strings_request_body](docs/paths/request_body_post_string_type_matches_strings_request_body/post.md) | +/requestBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body](docs/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post.md) [DefaultApi](docs/apis/tags/default_api.md).[post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body](docs/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body](docs/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body](docs/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post.md) | +/requestBody/postUniqueitemsFalseValidationRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_uniqueitems_false_validation_request_body](docs/paths/request_body_post_uniqueitems_false_validation_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_uniqueitems_false_validation_request_body](docs/paths/request_body_post_uniqueitems_false_validation_request_body/post.md) [UniqueItemsApi](docs/apis/tags/unique_items_api.md).[post_uniqueitems_false_validation_request_body](docs/paths/request_body_post_uniqueitems_false_validation_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_uniqueitems_false_validation_request_body](docs/paths/request_body_post_uniqueitems_false_validation_request_body/post.md) | +/requestBody/postUniqueitemsValidationRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_uniqueitems_validation_request_body](docs/paths/request_body_post_uniqueitems_validation_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_uniqueitems_validation_request_body](docs/paths/request_body_post_uniqueitems_validation_request_body/post.md) [UniqueItemsApi](docs/apis/tags/unique_items_api.md).[post_uniqueitems_validation_request_body](docs/paths/request_body_post_uniqueitems_validation_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_uniqueitems_validation_request_body](docs/paths/request_body_post_uniqueitems_validation_request_body/post.md) | +/requestBody/postUriFormatRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_uri_format_request_body](docs/paths/request_body_post_uri_format_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_uri_format_request_body](docs/paths/request_body_post_uri_format_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_uri_format_request_body](docs/paths/request_body_post_uri_format_request_body/post.md) [FormatApi](docs/apis/tags/format_api.md).[post_uri_format_request_body](docs/paths/request_body_post_uri_format_request_body/post.md) | +/requestBody/postUriReferenceFormatRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_uri_reference_format_request_body](docs/paths/request_body_post_uri_reference_format_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_uri_reference_format_request_body](docs/paths/request_body_post_uri_reference_format_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_uri_reference_format_request_body](docs/paths/request_body_post_uri_reference_format_request_body/post.md) [FormatApi](docs/apis/tags/format_api.md).[post_uri_reference_format_request_body](docs/paths/request_body_post_uri_reference_format_request_body/post.md) | +/requestBody/postUriTemplateFormatRequestBody **post** | [OperationRequestBodyApi](docs/apis/tags/operation_request_body_api.md).[post_uri_template_format_request_body](docs/paths/request_body_post_uri_template_format_request_body/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_uri_template_format_request_body](docs/paths/request_body_post_uri_template_format_request_body/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_uri_template_format_request_body](docs/paths/request_body_post_uri_template_format_request_body/post.md) [FormatApi](docs/apis/tags/format_api.md).[post_uri_template_format_request_body](docs/paths/request_body_post_uri_template_format_request_body/post.md) | +/responseBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateResponseBodyForContentTypes **post** | [PathPostApi](docs/apis/tags/path_post_api.md).[post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types](docs/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types](docs/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post.md) [AdditionalPropertiesApi](docs/apis/tags/additional_properties_api.md).[post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types](docs/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types](docs/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post.md) | +/responseBody/postAdditionalpropertiesAreAllowedByDefaultResponseBodyForContentTypes **post** | [PathPostApi](docs/apis/tags/path_post_api.md).[post_additionalproperties_are_allowed_by_default_response_body_for_content_types](docs/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_additionalproperties_are_allowed_by_default_response_body_for_content_types](docs/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post.md) [AdditionalPropertiesApi](docs/apis/tags/additional_properties_api.md).[post_additionalproperties_are_allowed_by_default_response_body_for_content_types](docs/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_additionalproperties_are_allowed_by_default_response_body_for_content_types](docs/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post.md) | +/responseBody/postAdditionalpropertiesCanExistByItselfResponseBodyForContentTypes **post** | [PathPostApi](docs/apis/tags/path_post_api.md).[post_additionalproperties_can_exist_by_itself_response_body_for_content_types](docs/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_additionalproperties_can_exist_by_itself_response_body_for_content_types](docs/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post.md) [AdditionalPropertiesApi](docs/apis/tags/additional_properties_api.md).[post_additionalproperties_can_exist_by_itself_response_body_for_content_types](docs/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_additionalproperties_can_exist_by_itself_response_body_for_content_types](docs/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post.md) | +/responseBody/postAdditionalpropertiesShouldNotLookInApplicatorsResponseBodyForContentTypes **post** | [PathPostApi](docs/apis/tags/path_post_api.md).[post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types](docs/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types](docs/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post.md) [AdditionalPropertiesApi](docs/apis/tags/additional_properties_api.md).[post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types](docs/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types](docs/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post.md) | +/responseBody/postAllofCombinedWithAnyofOneofResponseBodyForContentTypes **post** | [AllOfApi](docs/apis/tags/all_of_api.md).[post_allof_combined_with_anyof_oneof_response_body_for_content_types](docs/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_allof_combined_with_anyof_oneof_response_body_for_content_types](docs/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_allof_combined_with_anyof_oneof_response_body_for_content_types](docs/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_allof_combined_with_anyof_oneof_response_body_for_content_types](docs/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post.md) | +/responseBody/postAllofResponseBodyForContentTypes **post** | [AllOfApi](docs/apis/tags/all_of_api.md).[post_allof_response_body_for_content_types](docs/paths/response_body_post_allof_response_body_for_content_types/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_allof_response_body_for_content_types](docs/paths/response_body_post_allof_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_allof_response_body_for_content_types](docs/paths/response_body_post_allof_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_allof_response_body_for_content_types](docs/paths/response_body_post_allof_response_body_for_content_types/post.md) | +/responseBody/postAllofSimpleTypesResponseBodyForContentTypes **post** | [AllOfApi](docs/apis/tags/all_of_api.md).[post_allof_simple_types_response_body_for_content_types](docs/paths/response_body_post_allof_simple_types_response_body_for_content_types/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_allof_simple_types_response_body_for_content_types](docs/paths/response_body_post_allof_simple_types_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_allof_simple_types_response_body_for_content_types](docs/paths/response_body_post_allof_simple_types_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_allof_simple_types_response_body_for_content_types](docs/paths/response_body_post_allof_simple_types_response_body_for_content_types/post.md) | +/responseBody/postAllofWithBaseSchemaResponseBodyForContentTypes **post** | [AllOfApi](docs/apis/tags/all_of_api.md).[post_allof_with_base_schema_response_body_for_content_types](docs/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_allof_with_base_schema_response_body_for_content_types](docs/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_allof_with_base_schema_response_body_for_content_types](docs/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_allof_with_base_schema_response_body_for_content_types](docs/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post.md) | +/responseBody/postAllofWithOneEmptySchemaResponseBodyForContentTypes **post** | [AllOfApi](docs/apis/tags/all_of_api.md).[post_allof_with_one_empty_schema_response_body_for_content_types](docs/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_allof_with_one_empty_schema_response_body_for_content_types](docs/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_allof_with_one_empty_schema_response_body_for_content_types](docs/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_allof_with_one_empty_schema_response_body_for_content_types](docs/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post.md) | +/responseBody/postAllofWithTheFirstEmptySchemaResponseBodyForContentTypes **post** | [AllOfApi](docs/apis/tags/all_of_api.md).[post_allof_with_the_first_empty_schema_response_body_for_content_types](docs/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_allof_with_the_first_empty_schema_response_body_for_content_types](docs/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_allof_with_the_first_empty_schema_response_body_for_content_types](docs/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_allof_with_the_first_empty_schema_response_body_for_content_types](docs/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post.md) | +/responseBody/postAllofWithTheLastEmptySchemaResponseBodyForContentTypes **post** | [AllOfApi](docs/apis/tags/all_of_api.md).[post_allof_with_the_last_empty_schema_response_body_for_content_types](docs/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_allof_with_the_last_empty_schema_response_body_for_content_types](docs/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_allof_with_the_last_empty_schema_response_body_for_content_types](docs/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_allof_with_the_last_empty_schema_response_body_for_content_types](docs/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post.md) | +/responseBody/postAllofWithTwoEmptySchemasResponseBodyForContentTypes **post** | [AllOfApi](docs/apis/tags/all_of_api.md).[post_allof_with_two_empty_schemas_response_body_for_content_types](docs/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_allof_with_two_empty_schemas_response_body_for_content_types](docs/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_allof_with_two_empty_schemas_response_body_for_content_types](docs/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_allof_with_two_empty_schemas_response_body_for_content_types](docs/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post.md) | +/responseBody/postAnyofComplexTypesResponseBodyForContentTypes **post** | [PathPostApi](docs/apis/tags/path_post_api.md).[post_anyof_complex_types_response_body_for_content_types](docs/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_anyof_complex_types_response_body_for_content_types](docs/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post.md) [AnyOfApi](docs/apis/tags/any_of_api.md).[post_anyof_complex_types_response_body_for_content_types](docs/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_anyof_complex_types_response_body_for_content_types](docs/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post.md) | +/responseBody/postAnyofResponseBodyForContentTypes **post** | [PathPostApi](docs/apis/tags/path_post_api.md).[post_anyof_response_body_for_content_types](docs/paths/response_body_post_anyof_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_anyof_response_body_for_content_types](docs/paths/response_body_post_anyof_response_body_for_content_types/post.md) [AnyOfApi](docs/apis/tags/any_of_api.md).[post_anyof_response_body_for_content_types](docs/paths/response_body_post_anyof_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_anyof_response_body_for_content_types](docs/paths/response_body_post_anyof_response_body_for_content_types/post.md) | +/responseBody/postAnyofWithBaseSchemaResponseBodyForContentTypes **post** | [PathPostApi](docs/apis/tags/path_post_api.md).[post_anyof_with_base_schema_response_body_for_content_types](docs/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_anyof_with_base_schema_response_body_for_content_types](docs/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post.md) [AnyOfApi](docs/apis/tags/any_of_api.md).[post_anyof_with_base_schema_response_body_for_content_types](docs/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_anyof_with_base_schema_response_body_for_content_types](docs/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post.md) | +/responseBody/postAnyofWithOneEmptySchemaResponseBodyForContentTypes **post** | [PathPostApi](docs/apis/tags/path_post_api.md).[post_anyof_with_one_empty_schema_response_body_for_content_types](docs/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_anyof_with_one_empty_schema_response_body_for_content_types](docs/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post.md) [AnyOfApi](docs/apis/tags/any_of_api.md).[post_anyof_with_one_empty_schema_response_body_for_content_types](docs/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_anyof_with_one_empty_schema_response_body_for_content_types](docs/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post.md) | +/responseBody/postArrayTypeMatchesArraysResponseBodyForContentTypes **post** | [PathPostApi](docs/apis/tags/path_post_api.md).[post_array_type_matches_arrays_response_body_for_content_types](docs/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_array_type_matches_arrays_response_body_for_content_types](docs/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post.md) [TypeApi](docs/apis/tags/type_api.md).[post_array_type_matches_arrays_response_body_for_content_types](docs/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_array_type_matches_arrays_response_body_for_content_types](docs/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post.md) | +/responseBody/postBooleanTypeMatchesBooleansResponseBodyForContentTypes **post** | [PathPostApi](docs/apis/tags/path_post_api.md).[post_boolean_type_matches_booleans_response_body_for_content_types](docs/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_boolean_type_matches_booleans_response_body_for_content_types](docs/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post.md) [TypeApi](docs/apis/tags/type_api.md).[post_boolean_type_matches_booleans_response_body_for_content_types](docs/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_boolean_type_matches_booleans_response_body_for_content_types](docs/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post.md) | +/responseBody/postByIntResponseBodyForContentTypes **post** | [MultipleOfApi](docs/apis/tags/multiple_of_api.md).[post_by_int_response_body_for_content_types](docs/paths/response_body_post_by_int_response_body_for_content_types/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_by_int_response_body_for_content_types](docs/paths/response_body_post_by_int_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_by_int_response_body_for_content_types](docs/paths/response_body_post_by_int_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_by_int_response_body_for_content_types](docs/paths/response_body_post_by_int_response_body_for_content_types/post.md) | +/responseBody/postByNumberResponseBodyForContentTypes **post** | [MultipleOfApi](docs/apis/tags/multiple_of_api.md).[post_by_number_response_body_for_content_types](docs/paths/response_body_post_by_number_response_body_for_content_types/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_by_number_response_body_for_content_types](docs/paths/response_body_post_by_number_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_by_number_response_body_for_content_types](docs/paths/response_body_post_by_number_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_by_number_response_body_for_content_types](docs/paths/response_body_post_by_number_response_body_for_content_types/post.md) | +/responseBody/postBySmallNumberResponseBodyForContentTypes **post** | [MultipleOfApi](docs/apis/tags/multiple_of_api.md).[post_by_small_number_response_body_for_content_types](docs/paths/response_body_post_by_small_number_response_body_for_content_types/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_by_small_number_response_body_for_content_types](docs/paths/response_body_post_by_small_number_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_by_small_number_response_body_for_content_types](docs/paths/response_body_post_by_small_number_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_by_small_number_response_body_for_content_types](docs/paths/response_body_post_by_small_number_response_body_for_content_types/post.md) | +/responseBody/postDateTimeFormatResponseBodyForContentTypes **post** | [PathPostApi](docs/apis/tags/path_post_api.md).[post_date_time_format_response_body_for_content_types](docs/paths/response_body_post_date_time_format_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_date_time_format_response_body_for_content_types](docs/paths/response_body_post_date_time_format_response_body_for_content_types/post.md) [FormatApi](docs/apis/tags/format_api.md).[post_date_time_format_response_body_for_content_types](docs/paths/response_body_post_date_time_format_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_date_time_format_response_body_for_content_types](docs/paths/response_body_post_date_time_format_response_body_for_content_types/post.md) | +/responseBody/postEmailFormatResponseBodyForContentTypes **post** | [PathPostApi](docs/apis/tags/path_post_api.md).[post_email_format_response_body_for_content_types](docs/paths/response_body_post_email_format_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_email_format_response_body_for_content_types](docs/paths/response_body_post_email_format_response_body_for_content_types/post.md) [FormatApi](docs/apis/tags/format_api.md).[post_email_format_response_body_for_content_types](docs/paths/response_body_post_email_format_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_email_format_response_body_for_content_types](docs/paths/response_body_post_email_format_response_body_for_content_types/post.md) | +/responseBody/postEnumWith0DoesNotMatchFalseResponseBodyForContentTypes **post** | [PathPostApi](docs/apis/tags/path_post_api.md).[post_enum_with0_does_not_match_false_response_body_for_content_types](docs/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_enum_with0_does_not_match_false_response_body_for_content_types](docs/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_enum_with0_does_not_match_false_response_body_for_content_types](docs/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post.md) [EnumApi](docs/apis/tags/enum_api.md).[post_enum_with0_does_not_match_false_response_body_for_content_types](docs/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post.md) | +/responseBody/postEnumWith1DoesNotMatchTrueResponseBodyForContentTypes **post** | [PathPostApi](docs/apis/tags/path_post_api.md).[post_enum_with1_does_not_match_true_response_body_for_content_types](docs/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_enum_with1_does_not_match_true_response_body_for_content_types](docs/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_enum_with1_does_not_match_true_response_body_for_content_types](docs/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post.md) [EnumApi](docs/apis/tags/enum_api.md).[post_enum_with1_does_not_match_true_response_body_for_content_types](docs/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post.md) | +/responseBody/postEnumWithEscapedCharactersResponseBodyForContentTypes **post** | [PathPostApi](docs/apis/tags/path_post_api.md).[post_enum_with_escaped_characters_response_body_for_content_types](docs/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_enum_with_escaped_characters_response_body_for_content_types](docs/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_enum_with_escaped_characters_response_body_for_content_types](docs/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post.md) [EnumApi](docs/apis/tags/enum_api.md).[post_enum_with_escaped_characters_response_body_for_content_types](docs/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post.md) | +/responseBody/postEnumWithFalseDoesNotMatch0ResponseBodyForContentTypes **post** | [PathPostApi](docs/apis/tags/path_post_api.md).[post_enum_with_false_does_not_match0_response_body_for_content_types](docs/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_enum_with_false_does_not_match0_response_body_for_content_types](docs/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_enum_with_false_does_not_match0_response_body_for_content_types](docs/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post.md) [EnumApi](docs/apis/tags/enum_api.md).[post_enum_with_false_does_not_match0_response_body_for_content_types](docs/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post.md) | +/responseBody/postEnumWithTrueDoesNotMatch1ResponseBodyForContentTypes **post** | [PathPostApi](docs/apis/tags/path_post_api.md).[post_enum_with_true_does_not_match1_response_body_for_content_types](docs/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_enum_with_true_does_not_match1_response_body_for_content_types](docs/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_enum_with_true_does_not_match1_response_body_for_content_types](docs/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post.md) [EnumApi](docs/apis/tags/enum_api.md).[post_enum_with_true_does_not_match1_response_body_for_content_types](docs/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post.md) | +/responseBody/postEnumsInPropertiesResponseBodyForContentTypes **post** | [PathPostApi](docs/apis/tags/path_post_api.md).[post_enums_in_properties_response_body_for_content_types](docs/paths/response_body_post_enums_in_properties_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_enums_in_properties_response_body_for_content_types](docs/paths/response_body_post_enums_in_properties_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_enums_in_properties_response_body_for_content_types](docs/paths/response_body_post_enums_in_properties_response_body_for_content_types/post.md) [EnumApi](docs/apis/tags/enum_api.md).[post_enums_in_properties_response_body_for_content_types](docs/paths/response_body_post_enums_in_properties_response_body_for_content_types/post.md) | +/responseBody/postForbiddenPropertyResponseBodyForContentTypes **post** | [_NotApi](docs/apis/tags/_not_api.md).[post_forbidden_property_response_body_for_content_types](docs/paths/response_body_post_forbidden_property_response_body_for_content_types/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_forbidden_property_response_body_for_content_types](docs/paths/response_body_post_forbidden_property_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_forbidden_property_response_body_for_content_types](docs/paths/response_body_post_forbidden_property_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_forbidden_property_response_body_for_content_types](docs/paths/response_body_post_forbidden_property_response_body_for_content_types/post.md) | +/responseBody/postHostnameFormatResponseBodyForContentTypes **post** | [PathPostApi](docs/apis/tags/path_post_api.md).[post_hostname_format_response_body_for_content_types](docs/paths/response_body_post_hostname_format_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_hostname_format_response_body_for_content_types](docs/paths/response_body_post_hostname_format_response_body_for_content_types/post.md) [FormatApi](docs/apis/tags/format_api.md).[post_hostname_format_response_body_for_content_types](docs/paths/response_body_post_hostname_format_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_hostname_format_response_body_for_content_types](docs/paths/response_body_post_hostname_format_response_body_for_content_types/post.md) | +/responseBody/postIntegerTypeMatchesIntegersResponseBodyForContentTypes **post** | [PathPostApi](docs/apis/tags/path_post_api.md).[post_integer_type_matches_integers_response_body_for_content_types](docs/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_integer_type_matches_integers_response_body_for_content_types](docs/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post.md) [TypeApi](docs/apis/tags/type_api.md).[post_integer_type_matches_integers_response_body_for_content_types](docs/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_integer_type_matches_integers_response_body_for_content_types](docs/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post.md) | +/responseBody/postInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfResponseBodyForContentTypes **post** | [MultipleOfApi](docs/apis/tags/multiple_of_api.md).[post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types](docs/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types](docs/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types](docs/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types](docs/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post.md) | +/responseBody/postInvalidStringValueForDefaultResponseBodyForContentTypes **post** | [DefaultApi](docs/apis/tags/default_api.md).[post_invalid_string_value_for_default_response_body_for_content_types](docs/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_invalid_string_value_for_default_response_body_for_content_types](docs/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_invalid_string_value_for_default_response_body_for_content_types](docs/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_invalid_string_value_for_default_response_body_for_content_types](docs/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post.md) | +/responseBody/postIpv4FormatResponseBodyForContentTypes **post** | [PathPostApi](docs/apis/tags/path_post_api.md).[post_ipv4_format_response_body_for_content_types](docs/paths/response_body_post_ipv4_format_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_ipv4_format_response_body_for_content_types](docs/paths/response_body_post_ipv4_format_response_body_for_content_types/post.md) [FormatApi](docs/apis/tags/format_api.md).[post_ipv4_format_response_body_for_content_types](docs/paths/response_body_post_ipv4_format_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_ipv4_format_response_body_for_content_types](docs/paths/response_body_post_ipv4_format_response_body_for_content_types/post.md) | +/responseBody/postIpv6FormatResponseBodyForContentTypes **post** | [PathPostApi](docs/apis/tags/path_post_api.md).[post_ipv6_format_response_body_for_content_types](docs/paths/response_body_post_ipv6_format_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_ipv6_format_response_body_for_content_types](docs/paths/response_body_post_ipv6_format_response_body_for_content_types/post.md) [FormatApi](docs/apis/tags/format_api.md).[post_ipv6_format_response_body_for_content_types](docs/paths/response_body_post_ipv6_format_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_ipv6_format_response_body_for_content_types](docs/paths/response_body_post_ipv6_format_response_body_for_content_types/post.md) | +/responseBody/postJsonPointerFormatResponseBodyForContentTypes **post** | [PathPostApi](docs/apis/tags/path_post_api.md).[post_json_pointer_format_response_body_for_content_types](docs/paths/response_body_post_json_pointer_format_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_json_pointer_format_response_body_for_content_types](docs/paths/response_body_post_json_pointer_format_response_body_for_content_types/post.md) [FormatApi](docs/apis/tags/format_api.md).[post_json_pointer_format_response_body_for_content_types](docs/paths/response_body_post_json_pointer_format_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_json_pointer_format_response_body_for_content_types](docs/paths/response_body_post_json_pointer_format_response_body_for_content_types/post.md) | +/responseBody/postMaximumValidationResponseBodyForContentTypes **post** | [PathPostApi](docs/apis/tags/path_post_api.md).[post_maximum_validation_response_body_for_content_types](docs/paths/response_body_post_maximum_validation_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_maximum_validation_response_body_for_content_types](docs/paths/response_body_post_maximum_validation_response_body_for_content_types/post.md) [MaximumApi](docs/apis/tags/maximum_api.md).[post_maximum_validation_response_body_for_content_types](docs/paths/response_body_post_maximum_validation_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_maximum_validation_response_body_for_content_types](docs/paths/response_body_post_maximum_validation_response_body_for_content_types/post.md) | +/responseBody/postMaximumValidationWithUnsignedIntegerResponseBodyForContentTypes **post** | [PathPostApi](docs/apis/tags/path_post_api.md).[post_maximum_validation_with_unsigned_integer_response_body_for_content_types](docs/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_maximum_validation_with_unsigned_integer_response_body_for_content_types](docs/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post.md) [MaximumApi](docs/apis/tags/maximum_api.md).[post_maximum_validation_with_unsigned_integer_response_body_for_content_types](docs/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_maximum_validation_with_unsigned_integer_response_body_for_content_types](docs/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post.md) | +/responseBody/postMaxitemsValidationResponseBodyForContentTypes **post** | [MaxItemsApi](docs/apis/tags/max_items_api.md).[post_maxitems_validation_response_body_for_content_types](docs/paths/response_body_post_maxitems_validation_response_body_for_content_types/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_maxitems_validation_response_body_for_content_types](docs/paths/response_body_post_maxitems_validation_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_maxitems_validation_response_body_for_content_types](docs/paths/response_body_post_maxitems_validation_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_maxitems_validation_response_body_for_content_types](docs/paths/response_body_post_maxitems_validation_response_body_for_content_types/post.md) | +/responseBody/postMaxlengthValidationResponseBodyForContentTypes **post** | [PathPostApi](docs/apis/tags/path_post_api.md).[post_maxlength_validation_response_body_for_content_types](docs/paths/response_body_post_maxlength_validation_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_maxlength_validation_response_body_for_content_types](docs/paths/response_body_post_maxlength_validation_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_maxlength_validation_response_body_for_content_types](docs/paths/response_body_post_maxlength_validation_response_body_for_content_types/post.md) [MaxLengthApi](docs/apis/tags/max_length_api.md).[post_maxlength_validation_response_body_for_content_types](docs/paths/response_body_post_maxlength_validation_response_body_for_content_types/post.md) | +/responseBody/postMaxproperties0MeansTheObjectIsEmptyResponseBodyForContentTypes **post** | [PathPostApi](docs/apis/tags/path_post_api.md).[post_maxproperties0_means_the_object_is_empty_response_body_for_content_types](docs/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_maxproperties0_means_the_object_is_empty_response_body_for_content_types](docs/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post.md) [MaxPropertiesApi](docs/apis/tags/max_properties_api.md).[post_maxproperties0_means_the_object_is_empty_response_body_for_content_types](docs/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_maxproperties0_means_the_object_is_empty_response_body_for_content_types](docs/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post.md) | +/responseBody/postMaxpropertiesValidationResponseBodyForContentTypes **post** | [PathPostApi](docs/apis/tags/path_post_api.md).[post_maxproperties_validation_response_body_for_content_types](docs/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_maxproperties_validation_response_body_for_content_types](docs/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post.md) [MaxPropertiesApi](docs/apis/tags/max_properties_api.md).[post_maxproperties_validation_response_body_for_content_types](docs/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_maxproperties_validation_response_body_for_content_types](docs/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post.md) | +/responseBody/postMinimumValidationResponseBodyForContentTypes **post** | [PathPostApi](docs/apis/tags/path_post_api.md).[post_minimum_validation_response_body_for_content_types](docs/paths/response_body_post_minimum_validation_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_minimum_validation_response_body_for_content_types](docs/paths/response_body_post_minimum_validation_response_body_for_content_types/post.md) [MinimumApi](docs/apis/tags/minimum_api.md).[post_minimum_validation_response_body_for_content_types](docs/paths/response_body_post_minimum_validation_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_minimum_validation_response_body_for_content_types](docs/paths/response_body_post_minimum_validation_response_body_for_content_types/post.md) | +/responseBody/postMinimumValidationWithSignedIntegerResponseBodyForContentTypes **post** | [PathPostApi](docs/apis/tags/path_post_api.md).[post_minimum_validation_with_signed_integer_response_body_for_content_types](docs/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_minimum_validation_with_signed_integer_response_body_for_content_types](docs/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post.md) [MinimumApi](docs/apis/tags/minimum_api.md).[post_minimum_validation_with_signed_integer_response_body_for_content_types](docs/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_minimum_validation_with_signed_integer_response_body_for_content_types](docs/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post.md) | +/responseBody/postMinitemsValidationResponseBodyForContentTypes **post** | [MinItemsApi](docs/apis/tags/min_items_api.md).[post_minitems_validation_response_body_for_content_types](docs/paths/response_body_post_minitems_validation_response_body_for_content_types/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_minitems_validation_response_body_for_content_types](docs/paths/response_body_post_minitems_validation_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_minitems_validation_response_body_for_content_types](docs/paths/response_body_post_minitems_validation_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_minitems_validation_response_body_for_content_types](docs/paths/response_body_post_minitems_validation_response_body_for_content_types/post.md) | +/responseBody/postMinlengthValidationResponseBodyForContentTypes **post** | [PathPostApi](docs/apis/tags/path_post_api.md).[post_minlength_validation_response_body_for_content_types](docs/paths/response_body_post_minlength_validation_response_body_for_content_types/post.md) [MinLengthApi](docs/apis/tags/min_length_api.md).[post_minlength_validation_response_body_for_content_types](docs/paths/response_body_post_minlength_validation_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_minlength_validation_response_body_for_content_types](docs/paths/response_body_post_minlength_validation_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_minlength_validation_response_body_for_content_types](docs/paths/response_body_post_minlength_validation_response_body_for_content_types/post.md) | +/responseBody/postMinpropertiesValidationResponseBodyForContentTypes **post** | [PathPostApi](docs/apis/tags/path_post_api.md).[post_minproperties_validation_response_body_for_content_types](docs/paths/response_body_post_minproperties_validation_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_minproperties_validation_response_body_for_content_types](docs/paths/response_body_post_minproperties_validation_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_minproperties_validation_response_body_for_content_types](docs/paths/response_body_post_minproperties_validation_response_body_for_content_types/post.md) [MinPropertiesApi](docs/apis/tags/min_properties_api.md).[post_minproperties_validation_response_body_for_content_types](docs/paths/response_body_post_minproperties_validation_response_body_for_content_types/post.md) | +/responseBody/postNestedAllofToCheckValidationSemanticsResponseBodyForContentTypes **post** | [AllOfApi](docs/apis/tags/all_of_api.md).[post_nested_allof_to_check_validation_semantics_response_body_for_content_types](docs/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_nested_allof_to_check_validation_semantics_response_body_for_content_types](docs/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_nested_allof_to_check_validation_semantics_response_body_for_content_types](docs/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_nested_allof_to_check_validation_semantics_response_body_for_content_types](docs/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post.md) | +/responseBody/postNestedAnyofToCheckValidationSemanticsResponseBodyForContentTypes **post** | [PathPostApi](docs/apis/tags/path_post_api.md).[post_nested_anyof_to_check_validation_semantics_response_body_for_content_types](docs/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_nested_anyof_to_check_validation_semantics_response_body_for_content_types](docs/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post.md) [AnyOfApi](docs/apis/tags/any_of_api.md).[post_nested_anyof_to_check_validation_semantics_response_body_for_content_types](docs/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_nested_anyof_to_check_validation_semantics_response_body_for_content_types](docs/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post.md) | +/responseBody/postNestedItemsResponseBodyForContentTypes **post** | [PathPostApi](docs/apis/tags/path_post_api.md).[post_nested_items_response_body_for_content_types](docs/paths/response_body_post_nested_items_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_nested_items_response_body_for_content_types](docs/paths/response_body_post_nested_items_response_body_for_content_types/post.md) [ItemsApi](docs/apis/tags/items_api.md).[post_nested_items_response_body_for_content_types](docs/paths/response_body_post_nested_items_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_nested_items_response_body_for_content_types](docs/paths/response_body_post_nested_items_response_body_for_content_types/post.md) | +/responseBody/postNestedOneofToCheckValidationSemanticsResponseBodyForContentTypes **post** | [OneOfApi](docs/apis/tags/one_of_api.md).[post_nested_oneof_to_check_validation_semantics_response_body_for_content_types](docs/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_nested_oneof_to_check_validation_semantics_response_body_for_content_types](docs/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_nested_oneof_to_check_validation_semantics_response_body_for_content_types](docs/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_nested_oneof_to_check_validation_semantics_response_body_for_content_types](docs/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post.md) | +/responseBody/postNotMoreComplexSchemaResponseBodyForContentTypes **post** | [_NotApi](docs/apis/tags/_not_api.md).[post_not_more_complex_schema_response_body_for_content_types](docs/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_not_more_complex_schema_response_body_for_content_types](docs/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_not_more_complex_schema_response_body_for_content_types](docs/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_not_more_complex_schema_response_body_for_content_types](docs/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post.md) | +/responseBody/postNotResponseBodyForContentTypes **post** | [_NotApi](docs/apis/tags/_not_api.md).[post_not_response_body_for_content_types](docs/paths/response_body_post_not_response_body_for_content_types/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_not_response_body_for_content_types](docs/paths/response_body_post_not_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_not_response_body_for_content_types](docs/paths/response_body_post_not_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_not_response_body_for_content_types](docs/paths/response_body_post_not_response_body_for_content_types/post.md) | +/responseBody/postNulCharactersInStringsResponseBodyForContentTypes **post** | [PathPostApi](docs/apis/tags/path_post_api.md).[post_nul_characters_in_strings_response_body_for_content_types](docs/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_nul_characters_in_strings_response_body_for_content_types](docs/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_nul_characters_in_strings_response_body_for_content_types](docs/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post.md) [EnumApi](docs/apis/tags/enum_api.md).[post_nul_characters_in_strings_response_body_for_content_types](docs/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post.md) | +/responseBody/postNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes **post** | [PathPostApi](docs/apis/tags/path_post_api.md).[post_null_type_matches_only_the_null_object_response_body_for_content_types](docs/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_null_type_matches_only_the_null_object_response_body_for_content_types](docs/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post.md) [TypeApi](docs/apis/tags/type_api.md).[post_null_type_matches_only_the_null_object_response_body_for_content_types](docs/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_null_type_matches_only_the_null_object_response_body_for_content_types](docs/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post.md) | +/responseBody/postNumberTypeMatchesNumbersResponseBodyForContentTypes **post** | [PathPostApi](docs/apis/tags/path_post_api.md).[post_number_type_matches_numbers_response_body_for_content_types](docs/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_number_type_matches_numbers_response_body_for_content_types](docs/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post.md) [TypeApi](docs/apis/tags/type_api.md).[post_number_type_matches_numbers_response_body_for_content_types](docs/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_number_type_matches_numbers_response_body_for_content_types](docs/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post.md) | +/responseBody/postObjectPropertiesValidationResponseBodyForContentTypes **post** | [PathPostApi](docs/apis/tags/path_post_api.md).[post_object_properties_validation_response_body_for_content_types](docs/paths/response_body_post_object_properties_validation_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_object_properties_validation_response_body_for_content_types](docs/paths/response_body_post_object_properties_validation_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_object_properties_validation_response_body_for_content_types](docs/paths/response_body_post_object_properties_validation_response_body_for_content_types/post.md) [PropertiesApi](docs/apis/tags/properties_api.md).[post_object_properties_validation_response_body_for_content_types](docs/paths/response_body_post_object_properties_validation_response_body_for_content_types/post.md) | +/responseBody/postObjectTypeMatchesObjectsResponseBodyForContentTypes **post** | [PathPostApi](docs/apis/tags/path_post_api.md).[post_object_type_matches_objects_response_body_for_content_types](docs/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_object_type_matches_objects_response_body_for_content_types](docs/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post.md) [TypeApi](docs/apis/tags/type_api.md).[post_object_type_matches_objects_response_body_for_content_types](docs/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_object_type_matches_objects_response_body_for_content_types](docs/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post.md) | +/responseBody/postOneofComplexTypesResponseBodyForContentTypes **post** | [OneOfApi](docs/apis/tags/one_of_api.md).[post_oneof_complex_types_response_body_for_content_types](docs/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_oneof_complex_types_response_body_for_content_types](docs/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_oneof_complex_types_response_body_for_content_types](docs/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_oneof_complex_types_response_body_for_content_types](docs/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post.md) | +/responseBody/postOneofResponseBodyForContentTypes **post** | [OneOfApi](docs/apis/tags/one_of_api.md).[post_oneof_response_body_for_content_types](docs/paths/response_body_post_oneof_response_body_for_content_types/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_oneof_response_body_for_content_types](docs/paths/response_body_post_oneof_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_oneof_response_body_for_content_types](docs/paths/response_body_post_oneof_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_oneof_response_body_for_content_types](docs/paths/response_body_post_oneof_response_body_for_content_types/post.md) | +/responseBody/postOneofWithBaseSchemaResponseBodyForContentTypes **post** | [OneOfApi](docs/apis/tags/one_of_api.md).[post_oneof_with_base_schema_response_body_for_content_types](docs/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_oneof_with_base_schema_response_body_for_content_types](docs/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_oneof_with_base_schema_response_body_for_content_types](docs/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_oneof_with_base_schema_response_body_for_content_types](docs/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post.md) | +/responseBody/postOneofWithEmptySchemaResponseBodyForContentTypes **post** | [OneOfApi](docs/apis/tags/one_of_api.md).[post_oneof_with_empty_schema_response_body_for_content_types](docs/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_oneof_with_empty_schema_response_body_for_content_types](docs/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_oneof_with_empty_schema_response_body_for_content_types](docs/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_oneof_with_empty_schema_response_body_for_content_types](docs/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post.md) | +/responseBody/postOneofWithRequiredResponseBodyForContentTypes **post** | [OneOfApi](docs/apis/tags/one_of_api.md).[post_oneof_with_required_response_body_for_content_types](docs/paths/response_body_post_oneof_with_required_response_body_for_content_types/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_oneof_with_required_response_body_for_content_types](docs/paths/response_body_post_oneof_with_required_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_oneof_with_required_response_body_for_content_types](docs/paths/response_body_post_oneof_with_required_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_oneof_with_required_response_body_for_content_types](docs/paths/response_body_post_oneof_with_required_response_body_for_content_types/post.md) | +/responseBody/postPatternIsNotAnchoredResponseBodyForContentTypes **post** | [PathPostApi](docs/apis/tags/path_post_api.md).[post_pattern_is_not_anchored_response_body_for_content_types](docs/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_pattern_is_not_anchored_response_body_for_content_types](docs/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post.md) [PatternApi](docs/apis/tags/pattern_api.md).[post_pattern_is_not_anchored_response_body_for_content_types](docs/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_pattern_is_not_anchored_response_body_for_content_types](docs/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post.md) | +/responseBody/postPatternValidationResponseBodyForContentTypes **post** | [PathPostApi](docs/apis/tags/path_post_api.md).[post_pattern_validation_response_body_for_content_types](docs/paths/response_body_post_pattern_validation_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_pattern_validation_response_body_for_content_types](docs/paths/response_body_post_pattern_validation_response_body_for_content_types/post.md) [PatternApi](docs/apis/tags/pattern_api.md).[post_pattern_validation_response_body_for_content_types](docs/paths/response_body_post_pattern_validation_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_pattern_validation_response_body_for_content_types](docs/paths/response_body_post_pattern_validation_response_body_for_content_types/post.md) | +/responseBody/postPropertiesWithEscapedCharactersResponseBodyForContentTypes **post** | [PathPostApi](docs/apis/tags/path_post_api.md).[post_properties_with_escaped_characters_response_body_for_content_types](docs/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_properties_with_escaped_characters_response_body_for_content_types](docs/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_properties_with_escaped_characters_response_body_for_content_types](docs/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post.md) [PropertiesApi](docs/apis/tags/properties_api.md).[post_properties_with_escaped_characters_response_body_for_content_types](docs/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post.md) | +/responseBody/postPropertyNamedRefThatIsNotAReferenceResponseBodyForContentTypes **post** | [PathPostApi](docs/apis/tags/path_post_api.md).[post_property_named_ref_that_is_not_a_reference_response_body_for_content_types](docs/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_property_named_ref_that_is_not_a_reference_response_body_for_content_types](docs/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post.md) [RefApi](docs/apis/tags/ref_api.md).[post_property_named_ref_that_is_not_a_reference_response_body_for_content_types](docs/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_property_named_ref_that_is_not_a_reference_response_body_for_content_types](docs/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post.md) | +/responseBody/postRefInAdditionalpropertiesResponseBodyForContentTypes **post** | [PathPostApi](docs/apis/tags/path_post_api.md).[post_ref_in_additionalproperties_response_body_for_content_types](docs/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_ref_in_additionalproperties_response_body_for_content_types](docs/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post.md) [RefApi](docs/apis/tags/ref_api.md).[post_ref_in_additionalproperties_response_body_for_content_types](docs/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_ref_in_additionalproperties_response_body_for_content_types](docs/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post.md) | +/responseBody/postRefInAllofResponseBodyForContentTypes **post** | [PathPostApi](docs/apis/tags/path_post_api.md).[post_ref_in_allof_response_body_for_content_types](docs/paths/response_body_post_ref_in_allof_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_ref_in_allof_response_body_for_content_types](docs/paths/response_body_post_ref_in_allof_response_body_for_content_types/post.md) [RefApi](docs/apis/tags/ref_api.md).[post_ref_in_allof_response_body_for_content_types](docs/paths/response_body_post_ref_in_allof_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_ref_in_allof_response_body_for_content_types](docs/paths/response_body_post_ref_in_allof_response_body_for_content_types/post.md) | +/responseBody/postRefInAnyofResponseBodyForContentTypes **post** | [PathPostApi](docs/apis/tags/path_post_api.md).[post_ref_in_anyof_response_body_for_content_types](docs/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_ref_in_anyof_response_body_for_content_types](docs/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post.md) [RefApi](docs/apis/tags/ref_api.md).[post_ref_in_anyof_response_body_for_content_types](docs/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_ref_in_anyof_response_body_for_content_types](docs/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post.md) | +/responseBody/postRefInItemsResponseBodyForContentTypes **post** | [PathPostApi](docs/apis/tags/path_post_api.md).[post_ref_in_items_response_body_for_content_types](docs/paths/response_body_post_ref_in_items_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_ref_in_items_response_body_for_content_types](docs/paths/response_body_post_ref_in_items_response_body_for_content_types/post.md) [RefApi](docs/apis/tags/ref_api.md).[post_ref_in_items_response_body_for_content_types](docs/paths/response_body_post_ref_in_items_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_ref_in_items_response_body_for_content_types](docs/paths/response_body_post_ref_in_items_response_body_for_content_types/post.md) | +/responseBody/postRefInNotResponseBodyForContentTypes **post** | [PathPostApi](docs/apis/tags/path_post_api.md).[post_ref_in_not_response_body_for_content_types](docs/paths/response_body_post_ref_in_not_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_ref_in_not_response_body_for_content_types](docs/paths/response_body_post_ref_in_not_response_body_for_content_types/post.md) [RefApi](docs/apis/tags/ref_api.md).[post_ref_in_not_response_body_for_content_types](docs/paths/response_body_post_ref_in_not_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_ref_in_not_response_body_for_content_types](docs/paths/response_body_post_ref_in_not_response_body_for_content_types/post.md) | +/responseBody/postRefInOneofResponseBodyForContentTypes **post** | [PathPostApi](docs/apis/tags/path_post_api.md).[post_ref_in_oneof_response_body_for_content_types](docs/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_ref_in_oneof_response_body_for_content_types](docs/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post.md) [RefApi](docs/apis/tags/ref_api.md).[post_ref_in_oneof_response_body_for_content_types](docs/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_ref_in_oneof_response_body_for_content_types](docs/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post.md) | +/responseBody/postRefInPropertyResponseBodyForContentTypes **post** | [PathPostApi](docs/apis/tags/path_post_api.md).[post_ref_in_property_response_body_for_content_types](docs/paths/response_body_post_ref_in_property_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_ref_in_property_response_body_for_content_types](docs/paths/response_body_post_ref_in_property_response_body_for_content_types/post.md) [RefApi](docs/apis/tags/ref_api.md).[post_ref_in_property_response_body_for_content_types](docs/paths/response_body_post_ref_in_property_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_ref_in_property_response_body_for_content_types](docs/paths/response_body_post_ref_in_property_response_body_for_content_types/post.md) | +/responseBody/postRequiredDefaultValidationResponseBodyForContentTypes **post** | [PathPostApi](docs/apis/tags/path_post_api.md).[post_required_default_validation_response_body_for_content_types](docs/paths/response_body_post_required_default_validation_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_required_default_validation_response_body_for_content_types](docs/paths/response_body_post_required_default_validation_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_required_default_validation_response_body_for_content_types](docs/paths/response_body_post_required_default_validation_response_body_for_content_types/post.md) [RequiredApi](docs/apis/tags/required_api.md).[post_required_default_validation_response_body_for_content_types](docs/paths/response_body_post_required_default_validation_response_body_for_content_types/post.md) | +/responseBody/postRequiredValidationResponseBodyForContentTypes **post** | [PathPostApi](docs/apis/tags/path_post_api.md).[post_required_validation_response_body_for_content_types](docs/paths/response_body_post_required_validation_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_required_validation_response_body_for_content_types](docs/paths/response_body_post_required_validation_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_required_validation_response_body_for_content_types](docs/paths/response_body_post_required_validation_response_body_for_content_types/post.md) [RequiredApi](docs/apis/tags/required_api.md).[post_required_validation_response_body_for_content_types](docs/paths/response_body_post_required_validation_response_body_for_content_types/post.md) | +/responseBody/postRequiredWithEmptyArrayResponseBodyForContentTypes **post** | [PathPostApi](docs/apis/tags/path_post_api.md).[post_required_with_empty_array_response_body_for_content_types](docs/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_required_with_empty_array_response_body_for_content_types](docs/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_required_with_empty_array_response_body_for_content_types](docs/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post.md) [RequiredApi](docs/apis/tags/required_api.md).[post_required_with_empty_array_response_body_for_content_types](docs/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post.md) | +/responseBody/postRequiredWithEscapedCharactersResponseBodyForContentTypes **post** | [PathPostApi](docs/apis/tags/path_post_api.md).[post_required_with_escaped_characters_response_body_for_content_types](docs/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_required_with_escaped_characters_response_body_for_content_types](docs/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_required_with_escaped_characters_response_body_for_content_types](docs/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post.md) [RequiredApi](docs/apis/tags/required_api.md).[post_required_with_escaped_characters_response_body_for_content_types](docs/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post.md) | +/responseBody/postSimpleEnumValidationResponseBodyForContentTypes **post** | [PathPostApi](docs/apis/tags/path_post_api.md).[post_simple_enum_validation_response_body_for_content_types](docs/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_simple_enum_validation_response_body_for_content_types](docs/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_simple_enum_validation_response_body_for_content_types](docs/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post.md) [EnumApi](docs/apis/tags/enum_api.md).[post_simple_enum_validation_response_body_for_content_types](docs/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post.md) | +/responseBody/postStringTypeMatchesStringsResponseBodyForContentTypes **post** | [PathPostApi](docs/apis/tags/path_post_api.md).[post_string_type_matches_strings_response_body_for_content_types](docs/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_string_type_matches_strings_response_body_for_content_types](docs/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post.md) [TypeApi](docs/apis/tags/type_api.md).[post_string_type_matches_strings_response_body_for_content_types](docs/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_string_type_matches_strings_response_body_for_content_types](docs/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post.md) | +/responseBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyForContentTypes **post** | [DefaultApi](docs/apis/tags/default_api.md).[post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types](docs/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post.md) [PathPostApi](docs/apis/tags/path_post_api.md).[post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types](docs/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types](docs/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types](docs/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post.md) | +/responseBody/postUniqueitemsFalseValidationResponseBodyForContentTypes **post** | [PathPostApi](docs/apis/tags/path_post_api.md).[post_uniqueitems_false_validation_response_body_for_content_types](docs/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post.md) [UniqueItemsApi](docs/apis/tags/unique_items_api.md).[post_uniqueitems_false_validation_response_body_for_content_types](docs/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_uniqueitems_false_validation_response_body_for_content_types](docs/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_uniqueitems_false_validation_response_body_for_content_types](docs/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post.md) | +/responseBody/postUniqueitemsValidationResponseBodyForContentTypes **post** | [PathPostApi](docs/apis/tags/path_post_api.md).[post_uniqueitems_validation_response_body_for_content_types](docs/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post.md) [UniqueItemsApi](docs/apis/tags/unique_items_api.md).[post_uniqueitems_validation_response_body_for_content_types](docs/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_uniqueitems_validation_response_body_for_content_types](docs/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_uniqueitems_validation_response_body_for_content_types](docs/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post.md) | +/responseBody/postUriFormatResponseBodyForContentTypes **post** | [PathPostApi](docs/apis/tags/path_post_api.md).[post_uri_format_response_body_for_content_types](docs/paths/response_body_post_uri_format_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_uri_format_response_body_for_content_types](docs/paths/response_body_post_uri_format_response_body_for_content_types/post.md) [FormatApi](docs/apis/tags/format_api.md).[post_uri_format_response_body_for_content_types](docs/paths/response_body_post_uri_format_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_uri_format_response_body_for_content_types](docs/paths/response_body_post_uri_format_response_body_for_content_types/post.md) | +/responseBody/postUriReferenceFormatResponseBodyForContentTypes **post** | [PathPostApi](docs/apis/tags/path_post_api.md).[post_uri_reference_format_response_body_for_content_types](docs/paths/response_body_post_uri_reference_format_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_uri_reference_format_response_body_for_content_types](docs/paths/response_body_post_uri_reference_format_response_body_for_content_types/post.md) [FormatApi](docs/apis/tags/format_api.md).[post_uri_reference_format_response_body_for_content_types](docs/paths/response_body_post_uri_reference_format_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_uri_reference_format_response_body_for_content_types](docs/paths/response_body_post_uri_reference_format_response_body_for_content_types/post.md) | +/responseBody/postUriTemplateFormatResponseBodyForContentTypes **post** | [PathPostApi](docs/apis/tags/path_post_api.md).[post_uri_template_format_response_body_for_content_types](docs/paths/response_body_post_uri_template_format_response_body_for_content_types/post.md) [ContentTypeJsonApi](docs/apis/tags/content_type_json_api.md).[post_uri_template_format_response_body_for_content_types](docs/paths/response_body_post_uri_template_format_response_body_for_content_types/post.md) [FormatApi](docs/apis/tags/format_api.md).[post_uri_template_format_response_body_for_content_types](docs/paths/response_body_post_uri_template_format_response_body_for_content_types/post.md) [ResponseContentContentTypeSchemaApi](docs/apis/tags/response_content_content_type_schema_api.md).[post_uri_template_format_response_body_for_content_types](docs/paths/response_body_post_uri_template_format_response_body_for_content_types/post.md) | + +## Component Schemas + +Class | Description +----- | ------------ +[AdditionalpropertiesAllowsASchemaWhichShouldValidate](docs/components/schema/additionalproperties_allows_a_schema_which_should_validate.md) | +[AdditionalpropertiesAreAllowedByDefault](docs/components/schema/additionalproperties_are_allowed_by_default.md) | +[AdditionalpropertiesCanExistByItself](docs/components/schema/additionalproperties_can_exist_by_itself.md) | +[AdditionalpropertiesShouldNotLookInApplicators](docs/components/schema/additionalproperties_should_not_look_in_applicators.md) | +[Allof](docs/components/schema/allof.md) | +[AllofCombinedWithAnyofOneof](docs/components/schema/allof_combined_with_anyof_oneof.md) | +[AllofSimpleTypes](docs/components/schema/allof_simple_types.md) | +[AllofWithBaseSchema](docs/components/schema/allof_with_base_schema.md) | +[AllofWithOneEmptySchema](docs/components/schema/allof_with_one_empty_schema.md) | +[AllofWithTheFirstEmptySchema](docs/components/schema/allof_with_the_first_empty_schema.md) | +[AllofWithTheLastEmptySchema](docs/components/schema/allof_with_the_last_empty_schema.md) | +[AllofWithTwoEmptySchemas](docs/components/schema/allof_with_two_empty_schemas.md) | +[Anyof](docs/components/schema/anyof.md) | +[AnyofComplexTypes](docs/components/schema/anyof_complex_types.md) | +[AnyofWithBaseSchema](docs/components/schema/anyof_with_base_schema.md) | +[AnyofWithOneEmptySchema](docs/components/schema/anyof_with_one_empty_schema.md) | +[ArrayTypeMatchesArrays](docs/components/schema/array_type_matches_arrays.md) | +[BooleanTypeMatchesBooleans](docs/components/schema/boolean_type_matches_booleans.md) | +[ByInt](docs/components/schema/by_int.md) | +[ByNumber](docs/components/schema/by_number.md) | +[BySmallNumber](docs/components/schema/by_small_number.md) | +[DateTimeFormat](docs/components/schema/date_time_format.md) | +[EmailFormat](docs/components/schema/email_format.md) | +[EnumWith0DoesNotMatchFalse](docs/components/schema/enum_with0_does_not_match_false.md) | +[EnumWith1DoesNotMatchTrue](docs/components/schema/enum_with1_does_not_match_true.md) | +[EnumWithEscapedCharacters](docs/components/schema/enum_with_escaped_characters.md) | +[EnumWithFalseDoesNotMatch0](docs/components/schema/enum_with_false_does_not_match0.md) | +[EnumWithTrueDoesNotMatch1](docs/components/schema/enum_with_true_does_not_match1.md) | +[EnumsInProperties](docs/components/schema/enums_in_properties.md) | +[ForbiddenProperty](docs/components/schema/forbidden_property.md) | +[HostnameFormat](docs/components/schema/hostname_format.md) | +[IntegerTypeMatchesIntegers](docs/components/schema/integer_type_matches_integers.md) | +[InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf](docs/components/schema/invalid_instance_should_not_raise_error_when_float_division_inf.md) | +[InvalidStringValueForDefault](docs/components/schema/invalid_string_value_for_default.md) | +[Ipv4Format](docs/components/schema/ipv4_format.md) | +[Ipv6Format](docs/components/schema/ipv6_format.md) | +[JsonPointerFormat](docs/components/schema/json_pointer_format.md) | +[MaximumValidation](docs/components/schema/maximum_validation.md) | +[MaximumValidationWithUnsignedInteger](docs/components/schema/maximum_validation_with_unsigned_integer.md) | +[MaxitemsValidation](docs/components/schema/maxitems_validation.md) | +[MaxlengthValidation](docs/components/schema/maxlength_validation.md) | +[Maxproperties0MeansTheObjectIsEmpty](docs/components/schema/maxproperties0_means_the_object_is_empty.md) | +[MaxpropertiesValidation](docs/components/schema/maxproperties_validation.md) | +[MinimumValidation](docs/components/schema/minimum_validation.md) | +[MinimumValidationWithSignedInteger](docs/components/schema/minimum_validation_with_signed_integer.md) | +[MinitemsValidation](docs/components/schema/minitems_validation.md) | +[MinlengthValidation](docs/components/schema/minlength_validation.md) | +[MinpropertiesValidation](docs/components/schema/minproperties_validation.md) | +[NestedAllofToCheckValidationSemantics](docs/components/schema/nested_allof_to_check_validation_semantics.md) | +[NestedAnyofToCheckValidationSemantics](docs/components/schema/nested_anyof_to_check_validation_semantics.md) | +[NestedItems](docs/components/schema/nested_items.md) | +[NestedOneofToCheckValidationSemantics](docs/components/schema/nested_oneof_to_check_validation_semantics.md) | +[_Not](docs/components/schema/_not.md) | +[NotMoreComplexSchema](docs/components/schema/not_more_complex_schema.md) | +[NulCharactersInStrings](docs/components/schema/nul_characters_in_strings.md) | +[NullTypeMatchesOnlyTheNullObject](docs/components/schema/null_type_matches_only_the_null_object.md) | +[NumberTypeMatchesNumbers](docs/components/schema/number_type_matches_numbers.md) | +[ObjectPropertiesValidation](docs/components/schema/object_properties_validation.md) | +[ObjectTypeMatchesObjects](docs/components/schema/object_type_matches_objects.md) | +[Oneof](docs/components/schema/oneof.md) | +[OneofComplexTypes](docs/components/schema/oneof_complex_types.md) | +[OneofWithBaseSchema](docs/components/schema/oneof_with_base_schema.md) | +[OneofWithEmptySchema](docs/components/schema/oneof_with_empty_schema.md) | +[OneofWithRequired](docs/components/schema/oneof_with_required.md) | +[PatternIsNotAnchored](docs/components/schema/pattern_is_not_anchored.md) | +[PatternValidation](docs/components/schema/pattern_validation.md) | +[PropertiesWithEscapedCharacters](docs/components/schema/properties_with_escaped_characters.md) | +[PropertyNamedRefThatIsNotAReference](docs/components/schema/property_named_ref_that_is_not_a_reference.md) | +[RefInAdditionalproperties](docs/components/schema/ref_in_additionalproperties.md) | +[RefInAllof](docs/components/schema/ref_in_allof.md) | +[RefInAnyof](docs/components/schema/ref_in_anyof.md) | +[RefInItems](docs/components/schema/ref_in_items.md) | +[RefInNot](docs/components/schema/ref_in_not.md) | +[RefInOneof](docs/components/schema/ref_in_oneof.md) | +[RefInProperty](docs/components/schema/ref_in_property.md) | +[RequiredDefaultValidation](docs/components/schema/required_default_validation.md) | +[RequiredValidation](docs/components/schema/required_validation.md) | +[RequiredWithEmptyArray](docs/components/schema/required_with_empty_array.md) | +[RequiredWithEscapedCharacters](docs/components/schema/required_with_escaped_characters.md) | +[SimpleEnumValidation](docs/components/schema/simple_enum_validation.md) | +[StringTypeMatchesStrings](docs/components/schema/string_type_matches_strings.md) | +[TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing](docs/components/schema/the_default_keyword_does_not_do_anything_if_the_property_is_missing.md) | +[UniqueitemsFalseValidation](docs/components/schema/uniqueitems_false_validation.md) | +[UniqueitemsValidation](docs/components/schema/uniqueitems_validation.md) | +[UriFormat](docs/components/schema/uri_format.md) | +[UriReferenceFormat](docs/components/schema/uri_reference_format.md) | +[UriTemplateFormat](docs/components/schema/uri_template_format.md) | ## Notes for Large OpenAPI documents -If the OpenAPI document is large, imports in unit_test_api.apis and unit_test_api.models may fail with a +If the OpenAPI document is large, imports in unit_test_api.apis.tags.tag_to_api and unit_test_api.components.schemas may fail with a RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions: Solution 1: Use specific imports for apis and models like: -- `from unit_test_api.apis.default_api import DefaultApi` -- `from unit_test_api.model.pet import Pet` +- tagged api: `from unit_test_api.apis.tags.default_api import DefaultApi` +- api for one path: `from unit_test_api.apis.paths.some_path import SomePath` +- api for one operation (path + verb): `from unit_test_api.paths.some_path.get import ApiForget` +- single model import: `from unit_test_api.components.schema.pet import Pet` -Solution 1: +Solution 2: Before importing the package, adjust the maximum recursion limit as shown below: ``` import sys sys.setrecursionlimit(1500) import unit_test_api -from unit_test_api.apis import * -from unit_test_api.models import * +from unit_test_api.apis.tags.tag_to_api import * +from unit_test_api.components.schemas import * ``` diff --git a/samples/openapi3/client/3_0_3_unit_test/python/dev-requirements.txt b/samples/openapi3/client/3_0_3_unit_test/python/dev-requirements.txt deleted file mode 100644 index ccdfca62949..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/dev-requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -tox -flake8 diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/AdditionalPropertiesApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/AdditionalPropertiesApi.md index 6b758ccf2b8..eda222b38b9 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/AdditionalPropertiesApi.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/AdditionalPropertiesApi.md @@ -1,545 +1,17 @@ - + # unit_test_api.apis.tags.additional_properties_api.AdditionalPropertiesApi All URIs are relative to *https://someserver.com/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**post_additionalproperties_allows_a_schema_which_should_validate_request_body**](#post_additionalproperties_allows_a_schema_which_should_validate_request_body) | **post** /requestBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody | -[**post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types**](#post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types) | **post** /responseBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateResponseBodyForContentTypes | -[**post_additionalproperties_are_allowed_by_default_request_body**](#post_additionalproperties_are_allowed_by_default_request_body) | **post** /requestBody/postAdditionalpropertiesAreAllowedByDefaultRequestBody | -[**post_additionalproperties_are_allowed_by_default_response_body_for_content_types**](#post_additionalproperties_are_allowed_by_default_response_body_for_content_types) | **post** /responseBody/postAdditionalpropertiesAreAllowedByDefaultResponseBodyForContentTypes | -[**post_additionalproperties_can_exist_by_itself_request_body**](#post_additionalproperties_can_exist_by_itself_request_body) | **post** /requestBody/postAdditionalpropertiesCanExistByItselfRequestBody | -[**post_additionalproperties_can_exist_by_itself_response_body_for_content_types**](#post_additionalproperties_can_exist_by_itself_response_body_for_content_types) | **post** /responseBody/postAdditionalpropertiesCanExistByItselfResponseBodyForContentTypes | -[**post_additionalproperties_should_not_look_in_applicators_request_body**](#post_additionalproperties_should_not_look_in_applicators_request_body) | **post** /requestBody/postAdditionalpropertiesShouldNotLookInApplicatorsRequestBody | -[**post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types**](#post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types) | **post** /responseBody/postAdditionalpropertiesShouldNotLookInApplicatorsResponseBodyForContentTypes | - -# **post_additionalproperties_allows_a_schema_which_should_validate_request_body** - -> post_additionalproperties_allows_a_schema_which_should_validate_request_body(additionalproperties_allows_a_schema_which_should_validate) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import additional_properties_api -from unit_test_api.model.additionalproperties_allows_a_schema_which_should_validate import AdditionalpropertiesAllowsASchemaWhichShouldValidate -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = additional_properties_api.AdditionalPropertiesApi(api_client) - - # example passing only required values which don't have defaults set - body = AdditionalpropertiesAllowsASchemaWhichShouldValidate( - foo=None, - bar=None, - ) - try: - api_response = api_instance.post_additionalproperties_allows_a_schema_which_should_validate_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling AdditionalPropertiesApi->post_additionalproperties_allows_a_schema_which_should_validate_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AdditionalpropertiesAllowsASchemaWhichShouldValidate**](../../models/AdditionalpropertiesAllowsASchemaWhichShouldValidate.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_additionalproperties_allows_a_schema_which_should_validate_request_body.ApiResponseFor200) | success - -#### post_additionalproperties_allows_a_schema_which_should_validate_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types** - -> AdditionalpropertiesAllowsASchemaWhichShouldValidate post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import additional_properties_api -from unit_test_api.model.additionalproperties_allows_a_schema_which_should_validate import AdditionalpropertiesAllowsASchemaWhichShouldValidate -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = additional_properties_api.AdditionalPropertiesApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling AdditionalPropertiesApi->post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types.ApiResponseFor200) | success - -#### post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AdditionalpropertiesAllowsASchemaWhichShouldValidate**](../../models/AdditionalpropertiesAllowsASchemaWhichShouldValidate.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_additionalproperties_are_allowed_by_default_request_body** - -> post_additionalproperties_are_allowed_by_default_request_body(additionalproperties_are_allowed_by_default) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import additional_properties_api -from unit_test_api.model.additionalproperties_are_allowed_by_default import AdditionalpropertiesAreAllowedByDefault -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = additional_properties_api.AdditionalPropertiesApi(api_client) - - # example passing only required values which don't have defaults set - body = AdditionalpropertiesAreAllowedByDefault(None) - try: - api_response = api_instance.post_additionalproperties_are_allowed_by_default_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling AdditionalPropertiesApi->post_additionalproperties_are_allowed_by_default_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AdditionalpropertiesAreAllowedByDefault**](../../models/AdditionalpropertiesAreAllowedByDefault.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_additionalproperties_are_allowed_by_default_request_body.ApiResponseFor200) | success - -#### post_additionalproperties_are_allowed_by_default_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_additionalproperties_are_allowed_by_default_response_body_for_content_types** - -> AdditionalpropertiesAreAllowedByDefault post_additionalproperties_are_allowed_by_default_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import additional_properties_api -from unit_test_api.model.additionalproperties_are_allowed_by_default import AdditionalpropertiesAreAllowedByDefault -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = additional_properties_api.AdditionalPropertiesApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_additionalproperties_are_allowed_by_default_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling AdditionalPropertiesApi->post_additionalproperties_are_allowed_by_default_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_additionalproperties_are_allowed_by_default_response_body_for_content_types.ApiResponseFor200) | success - -#### post_additionalproperties_are_allowed_by_default_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AdditionalpropertiesAreAllowedByDefault**](../../models/AdditionalpropertiesAreAllowedByDefault.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_additionalproperties_can_exist_by_itself_request_body** - -> post_additionalproperties_can_exist_by_itself_request_body(additionalproperties_can_exist_by_itself) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import additional_properties_api -from unit_test_api.model.additionalproperties_can_exist_by_itself import AdditionalpropertiesCanExistByItself -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = additional_properties_api.AdditionalPropertiesApi(api_client) - - # example passing only required values which don't have defaults set - body = AdditionalpropertiesCanExistByItself( - key=True, - ) - try: - api_response = api_instance.post_additionalproperties_can_exist_by_itself_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling AdditionalPropertiesApi->post_additionalproperties_can_exist_by_itself_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AdditionalpropertiesCanExistByItself**](../../models/AdditionalpropertiesCanExistByItself.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_additionalproperties_can_exist_by_itself_request_body.ApiResponseFor200) | success - -#### post_additionalproperties_can_exist_by_itself_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_additionalproperties_can_exist_by_itself_response_body_for_content_types** - -> AdditionalpropertiesCanExistByItself post_additionalproperties_can_exist_by_itself_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import additional_properties_api -from unit_test_api.model.additionalproperties_can_exist_by_itself import AdditionalpropertiesCanExistByItself -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = additional_properties_api.AdditionalPropertiesApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_additionalproperties_can_exist_by_itself_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling AdditionalPropertiesApi->post_additionalproperties_can_exist_by_itself_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_additionalproperties_can_exist_by_itself_response_body_for_content_types.ApiResponseFor200) | success - -#### post_additionalproperties_can_exist_by_itself_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AdditionalpropertiesCanExistByItself**](../../models/AdditionalpropertiesCanExistByItself.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_additionalproperties_should_not_look_in_applicators_request_body** - -> post_additionalproperties_should_not_look_in_applicators_request_body(additionalproperties_should_not_look_in_applicators) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import additional_properties_api -from unit_test_api.model.additionalproperties_should_not_look_in_applicators import AdditionalpropertiesShouldNotLookInApplicators -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = additional_properties_api.AdditionalPropertiesApi(api_client) - - # example passing only required values which don't have defaults set - body = AdditionalpropertiesShouldNotLookInApplicators(None) - try: - api_response = api_instance.post_additionalproperties_should_not_look_in_applicators_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling AdditionalPropertiesApi->post_additionalproperties_should_not_look_in_applicators_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AdditionalpropertiesShouldNotLookInApplicators**](../../models/AdditionalpropertiesShouldNotLookInApplicators.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_additionalproperties_should_not_look_in_applicators_request_body.ApiResponseFor200) | success - -#### post_additionalproperties_should_not_look_in_applicators_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types** - -> AdditionalpropertiesShouldNotLookInApplicators post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import additional_properties_api -from unit_test_api.model.additionalproperties_should_not_look_in_applicators import AdditionalpropertiesShouldNotLookInApplicators -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = additional_properties_api.AdditionalPropertiesApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling AdditionalPropertiesApi->post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types.ApiResponseFor200) | success - -#### post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AdditionalpropertiesShouldNotLookInApplicators**](../../models/AdditionalpropertiesShouldNotLookInApplicators.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) +[**post_additionalproperties_allows_a_schema_which_should_validate_request_body**](additional_properties_api/post_additionalproperties_allows_a_schema_which_should_validate_request_body.md) | **post** /requestBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody | +[**post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types**](additional_properties_api/post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types.md) | **post** /responseBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateResponseBodyForContentTypes | +[**post_additionalproperties_are_allowed_by_default_request_body**](additional_properties_api/post_additionalproperties_are_allowed_by_default_request_body.md) | **post** /requestBody/postAdditionalpropertiesAreAllowedByDefaultRequestBody | +[**post_additionalproperties_are_allowed_by_default_response_body_for_content_types**](additional_properties_api/post_additionalproperties_are_allowed_by_default_response_body_for_content_types.md) | **post** /responseBody/postAdditionalpropertiesAreAllowedByDefaultResponseBodyForContentTypes | +[**post_additionalproperties_can_exist_by_itself_request_body**](additional_properties_api/post_additionalproperties_can_exist_by_itself_request_body.md) | **post** /requestBody/postAdditionalpropertiesCanExistByItselfRequestBody | +[**post_additionalproperties_can_exist_by_itself_response_body_for_content_types**](additional_properties_api/post_additionalproperties_can_exist_by_itself_response_body_for_content_types.md) | **post** /responseBody/postAdditionalpropertiesCanExistByItselfResponseBodyForContentTypes | +[**post_additionalproperties_should_not_look_in_applicators_request_body**](additional_properties_api/post_additionalproperties_should_not_look_in_applicators_request_body.md) | **post** /requestBody/postAdditionalpropertiesShouldNotLookInApplicatorsRequestBody | +[**post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types**](additional_properties_api/post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types.md) | **post** /responseBody/postAdditionalpropertiesShouldNotLookInApplicatorsResponseBodyForContentTypes | +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/AllOfApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/AllOfApi.md index 16996cfc810..5fa083c7912 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/AllOfApi.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/AllOfApi.md @@ -1,1205 +1,27 @@ - + # unit_test_api.apis.tags.all_of_api.AllOfApi All URIs are relative to *https://someserver.com/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**post_allof_combined_with_anyof_oneof_request_body**](#post_allof_combined_with_anyof_oneof_request_body) | **post** /requestBody/postAllofCombinedWithAnyofOneofRequestBody | -[**post_allof_combined_with_anyof_oneof_response_body_for_content_types**](#post_allof_combined_with_anyof_oneof_response_body_for_content_types) | **post** /responseBody/postAllofCombinedWithAnyofOneofResponseBodyForContentTypes | -[**post_allof_request_body**](#post_allof_request_body) | **post** /requestBody/postAllofRequestBody | -[**post_allof_response_body_for_content_types**](#post_allof_response_body_for_content_types) | **post** /responseBody/postAllofResponseBodyForContentTypes | -[**post_allof_simple_types_request_body**](#post_allof_simple_types_request_body) | **post** /requestBody/postAllofSimpleTypesRequestBody | -[**post_allof_simple_types_response_body_for_content_types**](#post_allof_simple_types_response_body_for_content_types) | **post** /responseBody/postAllofSimpleTypesResponseBodyForContentTypes | -[**post_allof_with_base_schema_request_body**](#post_allof_with_base_schema_request_body) | **post** /requestBody/postAllofWithBaseSchemaRequestBody | -[**post_allof_with_base_schema_response_body_for_content_types**](#post_allof_with_base_schema_response_body_for_content_types) | **post** /responseBody/postAllofWithBaseSchemaResponseBodyForContentTypes | -[**post_allof_with_one_empty_schema_request_body**](#post_allof_with_one_empty_schema_request_body) | **post** /requestBody/postAllofWithOneEmptySchemaRequestBody | -[**post_allof_with_one_empty_schema_response_body_for_content_types**](#post_allof_with_one_empty_schema_response_body_for_content_types) | **post** /responseBody/postAllofWithOneEmptySchemaResponseBodyForContentTypes | -[**post_allof_with_the_first_empty_schema_request_body**](#post_allof_with_the_first_empty_schema_request_body) | **post** /requestBody/postAllofWithTheFirstEmptySchemaRequestBody | -[**post_allof_with_the_first_empty_schema_response_body_for_content_types**](#post_allof_with_the_first_empty_schema_response_body_for_content_types) | **post** /responseBody/postAllofWithTheFirstEmptySchemaResponseBodyForContentTypes | -[**post_allof_with_the_last_empty_schema_request_body**](#post_allof_with_the_last_empty_schema_request_body) | **post** /requestBody/postAllofWithTheLastEmptySchemaRequestBody | -[**post_allof_with_the_last_empty_schema_response_body_for_content_types**](#post_allof_with_the_last_empty_schema_response_body_for_content_types) | **post** /responseBody/postAllofWithTheLastEmptySchemaResponseBodyForContentTypes | -[**post_allof_with_two_empty_schemas_request_body**](#post_allof_with_two_empty_schemas_request_body) | **post** /requestBody/postAllofWithTwoEmptySchemasRequestBody | -[**post_allof_with_two_empty_schemas_response_body_for_content_types**](#post_allof_with_two_empty_schemas_response_body_for_content_types) | **post** /responseBody/postAllofWithTwoEmptySchemasResponseBodyForContentTypes | -[**post_nested_allof_to_check_validation_semantics_request_body**](#post_nested_allof_to_check_validation_semantics_request_body) | **post** /requestBody/postNestedAllofToCheckValidationSemanticsRequestBody | -[**post_nested_allof_to_check_validation_semantics_response_body_for_content_types**](#post_nested_allof_to_check_validation_semantics_response_body_for_content_types) | **post** /responseBody/postNestedAllofToCheckValidationSemanticsResponseBodyForContentTypes | - -# **post_allof_combined_with_anyof_oneof_request_body** - -> post_allof_combined_with_anyof_oneof_request_body(allof_combined_with_anyof_oneof) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import all_of_api -from unit_test_api.model.allof_combined_with_anyof_oneof import AllofCombinedWithAnyofOneof -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = all_of_api.AllOfApi(api_client) - - # example passing only required values which don't have defaults set - body = AllofCombinedWithAnyofOneof(None) - try: - api_response = api_instance.post_allof_combined_with_anyof_oneof_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling AllOfApi->post_allof_combined_with_anyof_oneof_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AllofCombinedWithAnyofOneof**](../../models/AllofCombinedWithAnyofOneof.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_allof_combined_with_anyof_oneof_request_body.ApiResponseFor200) | success - -#### post_allof_combined_with_anyof_oneof_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_allof_combined_with_anyof_oneof_response_body_for_content_types** - -> AllofCombinedWithAnyofOneof post_allof_combined_with_anyof_oneof_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import all_of_api -from unit_test_api.model.allof_combined_with_anyof_oneof import AllofCombinedWithAnyofOneof -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = all_of_api.AllOfApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_allof_combined_with_anyof_oneof_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling AllOfApi->post_allof_combined_with_anyof_oneof_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_allof_combined_with_anyof_oneof_response_body_for_content_types.ApiResponseFor200) | success - -#### post_allof_combined_with_anyof_oneof_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AllofCombinedWithAnyofOneof**](../../models/AllofCombinedWithAnyofOneof.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_allof_request_body** - -> post_allof_request_body(allof) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import all_of_api -from unit_test_api.model.allof import Allof -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = all_of_api.AllOfApi(api_client) - - # example passing only required values which don't have defaults set - body = Allof(None) - try: - api_response = api_instance.post_allof_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling AllOfApi->post_allof_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**Allof**](../../models/Allof.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_allof_request_body.ApiResponseFor200) | success - -#### post_allof_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_allof_response_body_for_content_types** - -> Allof post_allof_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import all_of_api -from unit_test_api.model.allof import Allof -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = all_of_api.AllOfApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_allof_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling AllOfApi->post_allof_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_allof_response_body_for_content_types.ApiResponseFor200) | success - -#### post_allof_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**Allof**](../../models/Allof.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_allof_simple_types_request_body** - -> post_allof_simple_types_request_body(allof_simple_types) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import all_of_api -from unit_test_api.model.allof_simple_types import AllofSimpleTypes -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = all_of_api.AllOfApi(api_client) - - # example passing only required values which don't have defaults set - body = AllofSimpleTypes(None) - try: - api_response = api_instance.post_allof_simple_types_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling AllOfApi->post_allof_simple_types_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AllofSimpleTypes**](../../models/AllofSimpleTypes.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_allof_simple_types_request_body.ApiResponseFor200) | success - -#### post_allof_simple_types_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_allof_simple_types_response_body_for_content_types** - -> AllofSimpleTypes post_allof_simple_types_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import all_of_api -from unit_test_api.model.allof_simple_types import AllofSimpleTypes -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = all_of_api.AllOfApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_allof_simple_types_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling AllOfApi->post_allof_simple_types_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_allof_simple_types_response_body_for_content_types.ApiResponseFor200) | success - -#### post_allof_simple_types_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AllofSimpleTypes**](../../models/AllofSimpleTypes.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_allof_with_base_schema_request_body** - -> post_allof_with_base_schema_request_body(allof_with_base_schema) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import all_of_api -from unit_test_api.model.allof_with_base_schema import AllofWithBaseSchema -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = all_of_api.AllOfApi(api_client) - - # example passing only required values which don't have defaults set - body = AllofWithBaseSchema({}) - try: - api_response = api_instance.post_allof_with_base_schema_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling AllOfApi->post_allof_with_base_schema_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AllofWithBaseSchema**](../../models/AllofWithBaseSchema.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_allof_with_base_schema_request_body.ApiResponseFor200) | success - -#### post_allof_with_base_schema_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_allof_with_base_schema_response_body_for_content_types** - -> AllofWithBaseSchema post_allof_with_base_schema_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import all_of_api -from unit_test_api.model.allof_with_base_schema import AllofWithBaseSchema -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = all_of_api.AllOfApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_allof_with_base_schema_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling AllOfApi->post_allof_with_base_schema_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_allof_with_base_schema_response_body_for_content_types.ApiResponseFor200) | success - -#### post_allof_with_base_schema_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AllofWithBaseSchema**](../../models/AllofWithBaseSchema.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_allof_with_one_empty_schema_request_body** - -> post_allof_with_one_empty_schema_request_body(allof_with_one_empty_schema) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import all_of_api -from unit_test_api.model.allof_with_one_empty_schema import AllofWithOneEmptySchema -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = all_of_api.AllOfApi(api_client) - - # example passing only required values which don't have defaults set - body = AllofWithOneEmptySchema(None) - try: - api_response = api_instance.post_allof_with_one_empty_schema_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling AllOfApi->post_allof_with_one_empty_schema_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AllofWithOneEmptySchema**](../../models/AllofWithOneEmptySchema.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_allof_with_one_empty_schema_request_body.ApiResponseFor200) | success - -#### post_allof_with_one_empty_schema_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_allof_with_one_empty_schema_response_body_for_content_types** - -> AllofWithOneEmptySchema post_allof_with_one_empty_schema_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import all_of_api -from unit_test_api.model.allof_with_one_empty_schema import AllofWithOneEmptySchema -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = all_of_api.AllOfApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_allof_with_one_empty_schema_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling AllOfApi->post_allof_with_one_empty_schema_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_allof_with_one_empty_schema_response_body_for_content_types.ApiResponseFor200) | success - -#### post_allof_with_one_empty_schema_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AllofWithOneEmptySchema**](../../models/AllofWithOneEmptySchema.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_allof_with_the_first_empty_schema_request_body** - -> post_allof_with_the_first_empty_schema_request_body(allof_with_the_first_empty_schema) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import all_of_api -from unit_test_api.model.allof_with_the_first_empty_schema import AllofWithTheFirstEmptySchema -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = all_of_api.AllOfApi(api_client) - - # example passing only required values which don't have defaults set - body = AllofWithTheFirstEmptySchema(None) - try: - api_response = api_instance.post_allof_with_the_first_empty_schema_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling AllOfApi->post_allof_with_the_first_empty_schema_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AllofWithTheFirstEmptySchema**](../../models/AllofWithTheFirstEmptySchema.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_allof_with_the_first_empty_schema_request_body.ApiResponseFor200) | success - -#### post_allof_with_the_first_empty_schema_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_allof_with_the_first_empty_schema_response_body_for_content_types** - -> AllofWithTheFirstEmptySchema post_allof_with_the_first_empty_schema_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import all_of_api -from unit_test_api.model.allof_with_the_first_empty_schema import AllofWithTheFirstEmptySchema -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = all_of_api.AllOfApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_allof_with_the_first_empty_schema_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling AllOfApi->post_allof_with_the_first_empty_schema_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_allof_with_the_first_empty_schema_response_body_for_content_types.ApiResponseFor200) | success - -#### post_allof_with_the_first_empty_schema_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AllofWithTheFirstEmptySchema**](../../models/AllofWithTheFirstEmptySchema.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_allof_with_the_last_empty_schema_request_body** - -> post_allof_with_the_last_empty_schema_request_body(allof_with_the_last_empty_schema) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import all_of_api -from unit_test_api.model.allof_with_the_last_empty_schema import AllofWithTheLastEmptySchema -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = all_of_api.AllOfApi(api_client) - - # example passing only required values which don't have defaults set - body = AllofWithTheLastEmptySchema(None) - try: - api_response = api_instance.post_allof_with_the_last_empty_schema_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling AllOfApi->post_allof_with_the_last_empty_schema_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AllofWithTheLastEmptySchema**](../../models/AllofWithTheLastEmptySchema.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_allof_with_the_last_empty_schema_request_body.ApiResponseFor200) | success - -#### post_allof_with_the_last_empty_schema_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_allof_with_the_last_empty_schema_response_body_for_content_types** - -> AllofWithTheLastEmptySchema post_allof_with_the_last_empty_schema_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import all_of_api -from unit_test_api.model.allof_with_the_last_empty_schema import AllofWithTheLastEmptySchema -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = all_of_api.AllOfApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_allof_with_the_last_empty_schema_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling AllOfApi->post_allof_with_the_last_empty_schema_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_allof_with_the_last_empty_schema_response_body_for_content_types.ApiResponseFor200) | success - -#### post_allof_with_the_last_empty_schema_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AllofWithTheLastEmptySchema**](../../models/AllofWithTheLastEmptySchema.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_allof_with_two_empty_schemas_request_body** - -> post_allof_with_two_empty_schemas_request_body(allof_with_two_empty_schemas) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import all_of_api -from unit_test_api.model.allof_with_two_empty_schemas import AllofWithTwoEmptySchemas -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = all_of_api.AllOfApi(api_client) - - # example passing only required values which don't have defaults set - body = AllofWithTwoEmptySchemas(None) - try: - api_response = api_instance.post_allof_with_two_empty_schemas_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling AllOfApi->post_allof_with_two_empty_schemas_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AllofWithTwoEmptySchemas**](../../models/AllofWithTwoEmptySchemas.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_allof_with_two_empty_schemas_request_body.ApiResponseFor200) | success - -#### post_allof_with_two_empty_schemas_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_allof_with_two_empty_schemas_response_body_for_content_types** - -> AllofWithTwoEmptySchemas post_allof_with_two_empty_schemas_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import all_of_api -from unit_test_api.model.allof_with_two_empty_schemas import AllofWithTwoEmptySchemas -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = all_of_api.AllOfApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_allof_with_two_empty_schemas_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling AllOfApi->post_allof_with_two_empty_schemas_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_allof_with_two_empty_schemas_response_body_for_content_types.ApiResponseFor200) | success - -#### post_allof_with_two_empty_schemas_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AllofWithTwoEmptySchemas**](../../models/AllofWithTwoEmptySchemas.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_nested_allof_to_check_validation_semantics_request_body** - -> post_nested_allof_to_check_validation_semantics_request_body(nested_allof_to_check_validation_semantics) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import all_of_api -from unit_test_api.model.nested_allof_to_check_validation_semantics import NestedAllofToCheckValidationSemantics -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = all_of_api.AllOfApi(api_client) - - # example passing only required values which don't have defaults set - body = NestedAllofToCheckValidationSemantics(None) - try: - api_response = api_instance.post_nested_allof_to_check_validation_semantics_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling AllOfApi->post_nested_allof_to_check_validation_semantics_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**NestedAllofToCheckValidationSemantics**](../../models/NestedAllofToCheckValidationSemantics.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_nested_allof_to_check_validation_semantics_request_body.ApiResponseFor200) | success - -#### post_nested_allof_to_check_validation_semantics_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_nested_allof_to_check_validation_semantics_response_body_for_content_types** - -> NestedAllofToCheckValidationSemantics post_nested_allof_to_check_validation_semantics_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import all_of_api -from unit_test_api.model.nested_allof_to_check_validation_semantics import NestedAllofToCheckValidationSemantics -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = all_of_api.AllOfApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_nested_allof_to_check_validation_semantics_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling AllOfApi->post_nested_allof_to_check_validation_semantics_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_nested_allof_to_check_validation_semantics_response_body_for_content_types.ApiResponseFor200) | success - -#### post_nested_allof_to_check_validation_semantics_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**NestedAllofToCheckValidationSemantics**](../../models/NestedAllofToCheckValidationSemantics.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - +[**post_allof_combined_with_anyof_oneof_request_body**](all_of_api/post_allof_combined_with_anyof_oneof_request_body.md) | **post** /requestBody/postAllofCombinedWithAnyofOneofRequestBody | +[**post_allof_combined_with_anyof_oneof_response_body_for_content_types**](all_of_api/post_allof_combined_with_anyof_oneof_response_body_for_content_types.md) | **post** /responseBody/postAllofCombinedWithAnyofOneofResponseBodyForContentTypes | +[**post_allof_request_body**](all_of_api/post_allof_request_body.md) | **post** /requestBody/postAllofRequestBody | +[**post_allof_response_body_for_content_types**](all_of_api/post_allof_response_body_for_content_types.md) | **post** /responseBody/postAllofResponseBodyForContentTypes | +[**post_allof_simple_types_request_body**](all_of_api/post_allof_simple_types_request_body.md) | **post** /requestBody/postAllofSimpleTypesRequestBody | +[**post_allof_simple_types_response_body_for_content_types**](all_of_api/post_allof_simple_types_response_body_for_content_types.md) | **post** /responseBody/postAllofSimpleTypesResponseBodyForContentTypes | +[**post_allof_with_base_schema_request_body**](all_of_api/post_allof_with_base_schema_request_body.md) | **post** /requestBody/postAllofWithBaseSchemaRequestBody | +[**post_allof_with_base_schema_response_body_for_content_types**](all_of_api/post_allof_with_base_schema_response_body_for_content_types.md) | **post** /responseBody/postAllofWithBaseSchemaResponseBodyForContentTypes | +[**post_allof_with_one_empty_schema_request_body**](all_of_api/post_allof_with_one_empty_schema_request_body.md) | **post** /requestBody/postAllofWithOneEmptySchemaRequestBody | +[**post_allof_with_one_empty_schema_response_body_for_content_types**](all_of_api/post_allof_with_one_empty_schema_response_body_for_content_types.md) | **post** /responseBody/postAllofWithOneEmptySchemaResponseBodyForContentTypes | +[**post_allof_with_the_first_empty_schema_request_body**](all_of_api/post_allof_with_the_first_empty_schema_request_body.md) | **post** /requestBody/postAllofWithTheFirstEmptySchemaRequestBody | +[**post_allof_with_the_first_empty_schema_response_body_for_content_types**](all_of_api/post_allof_with_the_first_empty_schema_response_body_for_content_types.md) | **post** /responseBody/postAllofWithTheFirstEmptySchemaResponseBodyForContentTypes | +[**post_allof_with_the_last_empty_schema_request_body**](all_of_api/post_allof_with_the_last_empty_schema_request_body.md) | **post** /requestBody/postAllofWithTheLastEmptySchemaRequestBody | +[**post_allof_with_the_last_empty_schema_response_body_for_content_types**](all_of_api/post_allof_with_the_last_empty_schema_response_body_for_content_types.md) | **post** /responseBody/postAllofWithTheLastEmptySchemaResponseBodyForContentTypes | +[**post_allof_with_two_empty_schemas_request_body**](all_of_api/post_allof_with_two_empty_schemas_request_body.md) | **post** /requestBody/postAllofWithTwoEmptySchemasRequestBody | +[**post_allof_with_two_empty_schemas_response_body_for_content_types**](all_of_api/post_allof_with_two_empty_schemas_response_body_for_content_types.md) | **post** /responseBody/postAllofWithTwoEmptySchemasResponseBodyForContentTypes | +[**post_nested_allof_to_check_validation_semantics_request_body**](all_of_api/post_nested_allof_to_check_validation_semantics_request_body.md) | **post** /requestBody/postNestedAllofToCheckValidationSemanticsRequestBody | +[**post_nested_allof_to_check_validation_semantics_response_body_for_content_types**](all_of_api/post_nested_allof_to_check_validation_semantics_response_body_for_content_types.md) | **post** /responseBody/postNestedAllofToCheckValidationSemanticsResponseBodyForContentTypes | + +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/AnyOfApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/AnyOfApi.md index 8f0a035a810..cf8f22089ca 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/AnyOfApi.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/AnyOfApi.md @@ -1,673 +1,19 @@ - + # unit_test_api.apis.tags.any_of_api.AnyOfApi All URIs are relative to *https://someserver.com/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**post_anyof_complex_types_request_body**](#post_anyof_complex_types_request_body) | **post** /requestBody/postAnyofComplexTypesRequestBody | -[**post_anyof_complex_types_response_body_for_content_types**](#post_anyof_complex_types_response_body_for_content_types) | **post** /responseBody/postAnyofComplexTypesResponseBodyForContentTypes | -[**post_anyof_request_body**](#post_anyof_request_body) | **post** /requestBody/postAnyofRequestBody | -[**post_anyof_response_body_for_content_types**](#post_anyof_response_body_for_content_types) | **post** /responseBody/postAnyofResponseBodyForContentTypes | -[**post_anyof_with_base_schema_request_body**](#post_anyof_with_base_schema_request_body) | **post** /requestBody/postAnyofWithBaseSchemaRequestBody | -[**post_anyof_with_base_schema_response_body_for_content_types**](#post_anyof_with_base_schema_response_body_for_content_types) | **post** /responseBody/postAnyofWithBaseSchemaResponseBodyForContentTypes | -[**post_anyof_with_one_empty_schema_request_body**](#post_anyof_with_one_empty_schema_request_body) | **post** /requestBody/postAnyofWithOneEmptySchemaRequestBody | -[**post_anyof_with_one_empty_schema_response_body_for_content_types**](#post_anyof_with_one_empty_schema_response_body_for_content_types) | **post** /responseBody/postAnyofWithOneEmptySchemaResponseBodyForContentTypes | -[**post_nested_anyof_to_check_validation_semantics_request_body**](#post_nested_anyof_to_check_validation_semantics_request_body) | **post** /requestBody/postNestedAnyofToCheckValidationSemanticsRequestBody | -[**post_nested_anyof_to_check_validation_semantics_response_body_for_content_types**](#post_nested_anyof_to_check_validation_semantics_response_body_for_content_types) | **post** /responseBody/postNestedAnyofToCheckValidationSemanticsResponseBodyForContentTypes | - -# **post_anyof_complex_types_request_body** - -> post_anyof_complex_types_request_body(anyof_complex_types) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import any_of_api -from unit_test_api.model.anyof_complex_types import AnyofComplexTypes -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = any_of_api.AnyOfApi(api_client) - - # example passing only required values which don't have defaults set - body = AnyofComplexTypes(None) - try: - api_response = api_instance.post_anyof_complex_types_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling AnyOfApi->post_anyof_complex_types_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AnyofComplexTypes**](../../models/AnyofComplexTypes.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_anyof_complex_types_request_body.ApiResponseFor200) | success - -#### post_anyof_complex_types_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_anyof_complex_types_response_body_for_content_types** - -> AnyofComplexTypes post_anyof_complex_types_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import any_of_api -from unit_test_api.model.anyof_complex_types import AnyofComplexTypes -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = any_of_api.AnyOfApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_anyof_complex_types_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling AnyOfApi->post_anyof_complex_types_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_anyof_complex_types_response_body_for_content_types.ApiResponseFor200) | success - -#### post_anyof_complex_types_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AnyofComplexTypes**](../../models/AnyofComplexTypes.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_anyof_request_body** - -> post_anyof_request_body(anyof) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import any_of_api -from unit_test_api.model.anyof import Anyof -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = any_of_api.AnyOfApi(api_client) - - # example passing only required values which don't have defaults set - body = Anyof(None) - try: - api_response = api_instance.post_anyof_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling AnyOfApi->post_anyof_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**Anyof**](../../models/Anyof.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_anyof_request_body.ApiResponseFor200) | success - -#### post_anyof_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_anyof_response_body_for_content_types** - -> Anyof post_anyof_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import any_of_api -from unit_test_api.model.anyof import Anyof -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = any_of_api.AnyOfApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_anyof_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling AnyOfApi->post_anyof_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_anyof_response_body_for_content_types.ApiResponseFor200) | success - -#### post_anyof_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**Anyof**](../../models/Anyof.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_anyof_with_base_schema_request_body** - -> post_anyof_with_base_schema_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import any_of_api -from unit_test_api.model.anyof_with_base_schema import AnyofWithBaseSchema -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = any_of_api.AnyOfApi(api_client) - - # example passing only required values which don't have defaults set - body = AnyofWithBaseSchema("body_example") - try: - api_response = api_instance.post_anyof_with_base_schema_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling AnyOfApi->post_anyof_with_base_schema_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AnyofWithBaseSchema**](../../models/AnyofWithBaseSchema.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_anyof_with_base_schema_request_body.ApiResponseFor200) | success - -#### post_anyof_with_base_schema_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_anyof_with_base_schema_response_body_for_content_types** - -> AnyofWithBaseSchema post_anyof_with_base_schema_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import any_of_api -from unit_test_api.model.anyof_with_base_schema import AnyofWithBaseSchema -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = any_of_api.AnyOfApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_anyof_with_base_schema_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling AnyOfApi->post_anyof_with_base_schema_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_anyof_with_base_schema_response_body_for_content_types.ApiResponseFor200) | success - -#### post_anyof_with_base_schema_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AnyofWithBaseSchema**](../../models/AnyofWithBaseSchema.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_anyof_with_one_empty_schema_request_body** - -> post_anyof_with_one_empty_schema_request_body(anyof_with_one_empty_schema) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import any_of_api -from unit_test_api.model.anyof_with_one_empty_schema import AnyofWithOneEmptySchema -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = any_of_api.AnyOfApi(api_client) - - # example passing only required values which don't have defaults set - body = AnyofWithOneEmptySchema(None) - try: - api_response = api_instance.post_anyof_with_one_empty_schema_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling AnyOfApi->post_anyof_with_one_empty_schema_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AnyofWithOneEmptySchema**](../../models/AnyofWithOneEmptySchema.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_anyof_with_one_empty_schema_request_body.ApiResponseFor200) | success - -#### post_anyof_with_one_empty_schema_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_anyof_with_one_empty_schema_response_body_for_content_types** - -> AnyofWithOneEmptySchema post_anyof_with_one_empty_schema_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import any_of_api -from unit_test_api.model.anyof_with_one_empty_schema import AnyofWithOneEmptySchema -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = any_of_api.AnyOfApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_anyof_with_one_empty_schema_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling AnyOfApi->post_anyof_with_one_empty_schema_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_anyof_with_one_empty_schema_response_body_for_content_types.ApiResponseFor200) | success - -#### post_anyof_with_one_empty_schema_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AnyofWithOneEmptySchema**](../../models/AnyofWithOneEmptySchema.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_nested_anyof_to_check_validation_semantics_request_body** - -> post_nested_anyof_to_check_validation_semantics_request_body(nested_anyof_to_check_validation_semantics) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import any_of_api -from unit_test_api.model.nested_anyof_to_check_validation_semantics import NestedAnyofToCheckValidationSemantics -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = any_of_api.AnyOfApi(api_client) - - # example passing only required values which don't have defaults set - body = NestedAnyofToCheckValidationSemantics(None) - try: - api_response = api_instance.post_nested_anyof_to_check_validation_semantics_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling AnyOfApi->post_nested_anyof_to_check_validation_semantics_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**NestedAnyofToCheckValidationSemantics**](../../models/NestedAnyofToCheckValidationSemantics.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_nested_anyof_to_check_validation_semantics_request_body.ApiResponseFor200) | success - -#### post_nested_anyof_to_check_validation_semantics_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_nested_anyof_to_check_validation_semantics_response_body_for_content_types** - -> NestedAnyofToCheckValidationSemantics post_nested_anyof_to_check_validation_semantics_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import any_of_api -from unit_test_api.model.nested_anyof_to_check_validation_semantics import NestedAnyofToCheckValidationSemantics -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = any_of_api.AnyOfApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_nested_anyof_to_check_validation_semantics_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling AnyOfApi->post_nested_anyof_to_check_validation_semantics_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_nested_anyof_to_check_validation_semantics_response_body_for_content_types.ApiResponseFor200) | success - -#### post_nested_anyof_to_check_validation_semantics_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**NestedAnyofToCheckValidationSemantics**](../../models/NestedAnyofToCheckValidationSemantics.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - +[**post_anyof_complex_types_request_body**](any_of_api/post_anyof_complex_types_request_body.md) | **post** /requestBody/postAnyofComplexTypesRequestBody | +[**post_anyof_complex_types_response_body_for_content_types**](any_of_api/post_anyof_complex_types_response_body_for_content_types.md) | **post** /responseBody/postAnyofComplexTypesResponseBodyForContentTypes | +[**post_anyof_request_body**](any_of_api/post_anyof_request_body.md) | **post** /requestBody/postAnyofRequestBody | +[**post_anyof_response_body_for_content_types**](any_of_api/post_anyof_response_body_for_content_types.md) | **post** /responseBody/postAnyofResponseBodyForContentTypes | +[**post_anyof_with_base_schema_request_body**](any_of_api/post_anyof_with_base_schema_request_body.md) | **post** /requestBody/postAnyofWithBaseSchemaRequestBody | +[**post_anyof_with_base_schema_response_body_for_content_types**](any_of_api/post_anyof_with_base_schema_response_body_for_content_types.md) | **post** /responseBody/postAnyofWithBaseSchemaResponseBodyForContentTypes | +[**post_anyof_with_one_empty_schema_request_body**](any_of_api/post_anyof_with_one_empty_schema_request_body.md) | **post** /requestBody/postAnyofWithOneEmptySchemaRequestBody | +[**post_anyof_with_one_empty_schema_response_body_for_content_types**](any_of_api/post_anyof_with_one_empty_schema_response_body_for_content_types.md) | **post** /responseBody/postAnyofWithOneEmptySchemaResponseBodyForContentTypes | +[**post_nested_anyof_to_check_validation_semantics_request_body**](any_of_api/post_nested_anyof_to_check_validation_semantics_request_body.md) | **post** /requestBody/postNestedAnyofToCheckValidationSemanticsRequestBody | +[**post_nested_anyof_to_check_validation_semantics_response_body_for_content_types**](any_of_api/post_nested_anyof_to_check_validation_semantics_response_body_for_content_types.md) | **post** /responseBody/postNestedAnyofToCheckValidationSemanticsResponseBodyForContentTypes | + +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/ContentTypeJsonApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/ContentTypeJsonApi.md index 0a1a6bd184c..9bc4f4ca110 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/ContentTypeJsonApi.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/ContentTypeJsonApi.md @@ -1,11681 +1,183 @@ - + # unit_test_api.apis.tags.content_type_json_api.ContentTypeJsonApi All URIs are relative to *https://someserver.com/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**post_additionalproperties_allows_a_schema_which_should_validate_request_body**](#post_additionalproperties_allows_a_schema_which_should_validate_request_body) | **post** /requestBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody | -[**post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types**](#post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types) | **post** /responseBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateResponseBodyForContentTypes | -[**post_additionalproperties_are_allowed_by_default_request_body**](#post_additionalproperties_are_allowed_by_default_request_body) | **post** /requestBody/postAdditionalpropertiesAreAllowedByDefaultRequestBody | -[**post_additionalproperties_are_allowed_by_default_response_body_for_content_types**](#post_additionalproperties_are_allowed_by_default_response_body_for_content_types) | **post** /responseBody/postAdditionalpropertiesAreAllowedByDefaultResponseBodyForContentTypes | -[**post_additionalproperties_can_exist_by_itself_request_body**](#post_additionalproperties_can_exist_by_itself_request_body) | **post** /requestBody/postAdditionalpropertiesCanExistByItselfRequestBody | -[**post_additionalproperties_can_exist_by_itself_response_body_for_content_types**](#post_additionalproperties_can_exist_by_itself_response_body_for_content_types) | **post** /responseBody/postAdditionalpropertiesCanExistByItselfResponseBodyForContentTypes | -[**post_additionalproperties_should_not_look_in_applicators_request_body**](#post_additionalproperties_should_not_look_in_applicators_request_body) | **post** /requestBody/postAdditionalpropertiesShouldNotLookInApplicatorsRequestBody | -[**post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types**](#post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types) | **post** /responseBody/postAdditionalpropertiesShouldNotLookInApplicatorsResponseBodyForContentTypes | -[**post_allof_combined_with_anyof_oneof_request_body**](#post_allof_combined_with_anyof_oneof_request_body) | **post** /requestBody/postAllofCombinedWithAnyofOneofRequestBody | -[**post_allof_combined_with_anyof_oneof_response_body_for_content_types**](#post_allof_combined_with_anyof_oneof_response_body_for_content_types) | **post** /responseBody/postAllofCombinedWithAnyofOneofResponseBodyForContentTypes | -[**post_allof_request_body**](#post_allof_request_body) | **post** /requestBody/postAllofRequestBody | -[**post_allof_response_body_for_content_types**](#post_allof_response_body_for_content_types) | **post** /responseBody/postAllofResponseBodyForContentTypes | -[**post_allof_simple_types_request_body**](#post_allof_simple_types_request_body) | **post** /requestBody/postAllofSimpleTypesRequestBody | -[**post_allof_simple_types_response_body_for_content_types**](#post_allof_simple_types_response_body_for_content_types) | **post** /responseBody/postAllofSimpleTypesResponseBodyForContentTypes | -[**post_allof_with_base_schema_request_body**](#post_allof_with_base_schema_request_body) | **post** /requestBody/postAllofWithBaseSchemaRequestBody | -[**post_allof_with_base_schema_response_body_for_content_types**](#post_allof_with_base_schema_response_body_for_content_types) | **post** /responseBody/postAllofWithBaseSchemaResponseBodyForContentTypes | -[**post_allof_with_one_empty_schema_request_body**](#post_allof_with_one_empty_schema_request_body) | **post** /requestBody/postAllofWithOneEmptySchemaRequestBody | -[**post_allof_with_one_empty_schema_response_body_for_content_types**](#post_allof_with_one_empty_schema_response_body_for_content_types) | **post** /responseBody/postAllofWithOneEmptySchemaResponseBodyForContentTypes | -[**post_allof_with_the_first_empty_schema_request_body**](#post_allof_with_the_first_empty_schema_request_body) | **post** /requestBody/postAllofWithTheFirstEmptySchemaRequestBody | -[**post_allof_with_the_first_empty_schema_response_body_for_content_types**](#post_allof_with_the_first_empty_schema_response_body_for_content_types) | **post** /responseBody/postAllofWithTheFirstEmptySchemaResponseBodyForContentTypes | -[**post_allof_with_the_last_empty_schema_request_body**](#post_allof_with_the_last_empty_schema_request_body) | **post** /requestBody/postAllofWithTheLastEmptySchemaRequestBody | -[**post_allof_with_the_last_empty_schema_response_body_for_content_types**](#post_allof_with_the_last_empty_schema_response_body_for_content_types) | **post** /responseBody/postAllofWithTheLastEmptySchemaResponseBodyForContentTypes | -[**post_allof_with_two_empty_schemas_request_body**](#post_allof_with_two_empty_schemas_request_body) | **post** /requestBody/postAllofWithTwoEmptySchemasRequestBody | -[**post_allof_with_two_empty_schemas_response_body_for_content_types**](#post_allof_with_two_empty_schemas_response_body_for_content_types) | **post** /responseBody/postAllofWithTwoEmptySchemasResponseBodyForContentTypes | -[**post_anyof_complex_types_request_body**](#post_anyof_complex_types_request_body) | **post** /requestBody/postAnyofComplexTypesRequestBody | -[**post_anyof_complex_types_response_body_for_content_types**](#post_anyof_complex_types_response_body_for_content_types) | **post** /responseBody/postAnyofComplexTypesResponseBodyForContentTypes | -[**post_anyof_request_body**](#post_anyof_request_body) | **post** /requestBody/postAnyofRequestBody | -[**post_anyof_response_body_for_content_types**](#post_anyof_response_body_for_content_types) | **post** /responseBody/postAnyofResponseBodyForContentTypes | -[**post_anyof_with_base_schema_request_body**](#post_anyof_with_base_schema_request_body) | **post** /requestBody/postAnyofWithBaseSchemaRequestBody | -[**post_anyof_with_base_schema_response_body_for_content_types**](#post_anyof_with_base_schema_response_body_for_content_types) | **post** /responseBody/postAnyofWithBaseSchemaResponseBodyForContentTypes | -[**post_anyof_with_one_empty_schema_request_body**](#post_anyof_with_one_empty_schema_request_body) | **post** /requestBody/postAnyofWithOneEmptySchemaRequestBody | -[**post_anyof_with_one_empty_schema_response_body_for_content_types**](#post_anyof_with_one_empty_schema_response_body_for_content_types) | **post** /responseBody/postAnyofWithOneEmptySchemaResponseBodyForContentTypes | -[**post_array_type_matches_arrays_request_body**](#post_array_type_matches_arrays_request_body) | **post** /requestBody/postArrayTypeMatchesArraysRequestBody | -[**post_array_type_matches_arrays_response_body_for_content_types**](#post_array_type_matches_arrays_response_body_for_content_types) | **post** /responseBody/postArrayTypeMatchesArraysResponseBodyForContentTypes | -[**post_boolean_type_matches_booleans_request_body**](#post_boolean_type_matches_booleans_request_body) | **post** /requestBody/postBooleanTypeMatchesBooleansRequestBody | -[**post_boolean_type_matches_booleans_response_body_for_content_types**](#post_boolean_type_matches_booleans_response_body_for_content_types) | **post** /responseBody/postBooleanTypeMatchesBooleansResponseBodyForContentTypes | -[**post_by_int_request_body**](#post_by_int_request_body) | **post** /requestBody/postByIntRequestBody | -[**post_by_int_response_body_for_content_types**](#post_by_int_response_body_for_content_types) | **post** /responseBody/postByIntResponseBodyForContentTypes | -[**post_by_number_request_body**](#post_by_number_request_body) | **post** /requestBody/postByNumberRequestBody | -[**post_by_number_response_body_for_content_types**](#post_by_number_response_body_for_content_types) | **post** /responseBody/postByNumberResponseBodyForContentTypes | -[**post_by_small_number_request_body**](#post_by_small_number_request_body) | **post** /requestBody/postBySmallNumberRequestBody | -[**post_by_small_number_response_body_for_content_types**](#post_by_small_number_response_body_for_content_types) | **post** /responseBody/postBySmallNumberResponseBodyForContentTypes | -[**post_date_time_format_request_body**](#post_date_time_format_request_body) | **post** /requestBody/postDateTimeFormatRequestBody | -[**post_date_time_format_response_body_for_content_types**](#post_date_time_format_response_body_for_content_types) | **post** /responseBody/postDateTimeFormatResponseBodyForContentTypes | -[**post_email_format_request_body**](#post_email_format_request_body) | **post** /requestBody/postEmailFormatRequestBody | -[**post_email_format_response_body_for_content_types**](#post_email_format_response_body_for_content_types) | **post** /responseBody/postEmailFormatResponseBodyForContentTypes | -[**post_enum_with0_does_not_match_false_request_body**](#post_enum_with0_does_not_match_false_request_body) | **post** /requestBody/postEnumWith0DoesNotMatchFalseRequestBody | -[**post_enum_with0_does_not_match_false_response_body_for_content_types**](#post_enum_with0_does_not_match_false_response_body_for_content_types) | **post** /responseBody/postEnumWith0DoesNotMatchFalseResponseBodyForContentTypes | -[**post_enum_with1_does_not_match_true_request_body**](#post_enum_with1_does_not_match_true_request_body) | **post** /requestBody/postEnumWith1DoesNotMatchTrueRequestBody | -[**post_enum_with1_does_not_match_true_response_body_for_content_types**](#post_enum_with1_does_not_match_true_response_body_for_content_types) | **post** /responseBody/postEnumWith1DoesNotMatchTrueResponseBodyForContentTypes | -[**post_enum_with_escaped_characters_request_body**](#post_enum_with_escaped_characters_request_body) | **post** /requestBody/postEnumWithEscapedCharactersRequestBody | -[**post_enum_with_escaped_characters_response_body_for_content_types**](#post_enum_with_escaped_characters_response_body_for_content_types) | **post** /responseBody/postEnumWithEscapedCharactersResponseBodyForContentTypes | -[**post_enum_with_false_does_not_match0_request_body**](#post_enum_with_false_does_not_match0_request_body) | **post** /requestBody/postEnumWithFalseDoesNotMatch0RequestBody | -[**post_enum_with_false_does_not_match0_response_body_for_content_types**](#post_enum_with_false_does_not_match0_response_body_for_content_types) | **post** /responseBody/postEnumWithFalseDoesNotMatch0ResponseBodyForContentTypes | -[**post_enum_with_true_does_not_match1_request_body**](#post_enum_with_true_does_not_match1_request_body) | **post** /requestBody/postEnumWithTrueDoesNotMatch1RequestBody | -[**post_enum_with_true_does_not_match1_response_body_for_content_types**](#post_enum_with_true_does_not_match1_response_body_for_content_types) | **post** /responseBody/postEnumWithTrueDoesNotMatch1ResponseBodyForContentTypes | -[**post_enums_in_properties_request_body**](#post_enums_in_properties_request_body) | **post** /requestBody/postEnumsInPropertiesRequestBody | -[**post_enums_in_properties_response_body_for_content_types**](#post_enums_in_properties_response_body_for_content_types) | **post** /responseBody/postEnumsInPropertiesResponseBodyForContentTypes | -[**post_forbidden_property_request_body**](#post_forbidden_property_request_body) | **post** /requestBody/postForbiddenPropertyRequestBody | -[**post_forbidden_property_response_body_for_content_types**](#post_forbidden_property_response_body_for_content_types) | **post** /responseBody/postForbiddenPropertyResponseBodyForContentTypes | -[**post_hostname_format_request_body**](#post_hostname_format_request_body) | **post** /requestBody/postHostnameFormatRequestBody | -[**post_hostname_format_response_body_for_content_types**](#post_hostname_format_response_body_for_content_types) | **post** /responseBody/postHostnameFormatResponseBodyForContentTypes | -[**post_integer_type_matches_integers_request_body**](#post_integer_type_matches_integers_request_body) | **post** /requestBody/postIntegerTypeMatchesIntegersRequestBody | -[**post_integer_type_matches_integers_response_body_for_content_types**](#post_integer_type_matches_integers_response_body_for_content_types) | **post** /responseBody/postIntegerTypeMatchesIntegersResponseBodyForContentTypes | -[**post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body**](#post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body) | **post** /requestBody/postInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody | -[**post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types**](#post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types) | **post** /responseBody/postInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfResponseBodyForContentTypes | -[**post_invalid_string_value_for_default_request_body**](#post_invalid_string_value_for_default_request_body) | **post** /requestBody/postInvalidStringValueForDefaultRequestBody | -[**post_invalid_string_value_for_default_response_body_for_content_types**](#post_invalid_string_value_for_default_response_body_for_content_types) | **post** /responseBody/postInvalidStringValueForDefaultResponseBodyForContentTypes | -[**post_ipv4_format_request_body**](#post_ipv4_format_request_body) | **post** /requestBody/postIpv4FormatRequestBody | -[**post_ipv4_format_response_body_for_content_types**](#post_ipv4_format_response_body_for_content_types) | **post** /responseBody/postIpv4FormatResponseBodyForContentTypes | -[**post_ipv6_format_request_body**](#post_ipv6_format_request_body) | **post** /requestBody/postIpv6FormatRequestBody | -[**post_ipv6_format_response_body_for_content_types**](#post_ipv6_format_response_body_for_content_types) | **post** /responseBody/postIpv6FormatResponseBodyForContentTypes | -[**post_json_pointer_format_request_body**](#post_json_pointer_format_request_body) | **post** /requestBody/postJsonPointerFormatRequestBody | -[**post_json_pointer_format_response_body_for_content_types**](#post_json_pointer_format_response_body_for_content_types) | **post** /responseBody/postJsonPointerFormatResponseBodyForContentTypes | -[**post_maximum_validation_request_body**](#post_maximum_validation_request_body) | **post** /requestBody/postMaximumValidationRequestBody | -[**post_maximum_validation_response_body_for_content_types**](#post_maximum_validation_response_body_for_content_types) | **post** /responseBody/postMaximumValidationResponseBodyForContentTypes | -[**post_maximum_validation_with_unsigned_integer_request_body**](#post_maximum_validation_with_unsigned_integer_request_body) | **post** /requestBody/postMaximumValidationWithUnsignedIntegerRequestBody | -[**post_maximum_validation_with_unsigned_integer_response_body_for_content_types**](#post_maximum_validation_with_unsigned_integer_response_body_for_content_types) | **post** /responseBody/postMaximumValidationWithUnsignedIntegerResponseBodyForContentTypes | -[**post_maxitems_validation_request_body**](#post_maxitems_validation_request_body) | **post** /requestBody/postMaxitemsValidationRequestBody | -[**post_maxitems_validation_response_body_for_content_types**](#post_maxitems_validation_response_body_for_content_types) | **post** /responseBody/postMaxitemsValidationResponseBodyForContentTypes | -[**post_maxlength_validation_request_body**](#post_maxlength_validation_request_body) | **post** /requestBody/postMaxlengthValidationRequestBody | -[**post_maxlength_validation_response_body_for_content_types**](#post_maxlength_validation_response_body_for_content_types) | **post** /responseBody/postMaxlengthValidationResponseBodyForContentTypes | -[**post_maxproperties0_means_the_object_is_empty_request_body**](#post_maxproperties0_means_the_object_is_empty_request_body) | **post** /requestBody/postMaxproperties0MeansTheObjectIsEmptyRequestBody | -[**post_maxproperties0_means_the_object_is_empty_response_body_for_content_types**](#post_maxproperties0_means_the_object_is_empty_response_body_for_content_types) | **post** /responseBody/postMaxproperties0MeansTheObjectIsEmptyResponseBodyForContentTypes | -[**post_maxproperties_validation_request_body**](#post_maxproperties_validation_request_body) | **post** /requestBody/postMaxpropertiesValidationRequestBody | -[**post_maxproperties_validation_response_body_for_content_types**](#post_maxproperties_validation_response_body_for_content_types) | **post** /responseBody/postMaxpropertiesValidationResponseBodyForContentTypes | -[**post_minimum_validation_request_body**](#post_minimum_validation_request_body) | **post** /requestBody/postMinimumValidationRequestBody | -[**post_minimum_validation_response_body_for_content_types**](#post_minimum_validation_response_body_for_content_types) | **post** /responseBody/postMinimumValidationResponseBodyForContentTypes | -[**post_minimum_validation_with_signed_integer_request_body**](#post_minimum_validation_with_signed_integer_request_body) | **post** /requestBody/postMinimumValidationWithSignedIntegerRequestBody | -[**post_minimum_validation_with_signed_integer_response_body_for_content_types**](#post_minimum_validation_with_signed_integer_response_body_for_content_types) | **post** /responseBody/postMinimumValidationWithSignedIntegerResponseBodyForContentTypes | -[**post_minitems_validation_request_body**](#post_minitems_validation_request_body) | **post** /requestBody/postMinitemsValidationRequestBody | -[**post_minitems_validation_response_body_for_content_types**](#post_minitems_validation_response_body_for_content_types) | **post** /responseBody/postMinitemsValidationResponseBodyForContentTypes | -[**post_minlength_validation_request_body**](#post_minlength_validation_request_body) | **post** /requestBody/postMinlengthValidationRequestBody | -[**post_minlength_validation_response_body_for_content_types**](#post_minlength_validation_response_body_for_content_types) | **post** /responseBody/postMinlengthValidationResponseBodyForContentTypes | -[**post_minproperties_validation_request_body**](#post_minproperties_validation_request_body) | **post** /requestBody/postMinpropertiesValidationRequestBody | -[**post_minproperties_validation_response_body_for_content_types**](#post_minproperties_validation_response_body_for_content_types) | **post** /responseBody/postMinpropertiesValidationResponseBodyForContentTypes | -[**post_nested_allof_to_check_validation_semantics_request_body**](#post_nested_allof_to_check_validation_semantics_request_body) | **post** /requestBody/postNestedAllofToCheckValidationSemanticsRequestBody | -[**post_nested_allof_to_check_validation_semantics_response_body_for_content_types**](#post_nested_allof_to_check_validation_semantics_response_body_for_content_types) | **post** /responseBody/postNestedAllofToCheckValidationSemanticsResponseBodyForContentTypes | -[**post_nested_anyof_to_check_validation_semantics_request_body**](#post_nested_anyof_to_check_validation_semantics_request_body) | **post** /requestBody/postNestedAnyofToCheckValidationSemanticsRequestBody | -[**post_nested_anyof_to_check_validation_semantics_response_body_for_content_types**](#post_nested_anyof_to_check_validation_semantics_response_body_for_content_types) | **post** /responseBody/postNestedAnyofToCheckValidationSemanticsResponseBodyForContentTypes | -[**post_nested_items_request_body**](#post_nested_items_request_body) | **post** /requestBody/postNestedItemsRequestBody | -[**post_nested_items_response_body_for_content_types**](#post_nested_items_response_body_for_content_types) | **post** /responseBody/postNestedItemsResponseBodyForContentTypes | -[**post_nested_oneof_to_check_validation_semantics_request_body**](#post_nested_oneof_to_check_validation_semantics_request_body) | **post** /requestBody/postNestedOneofToCheckValidationSemanticsRequestBody | -[**post_nested_oneof_to_check_validation_semantics_response_body_for_content_types**](#post_nested_oneof_to_check_validation_semantics_response_body_for_content_types) | **post** /responseBody/postNestedOneofToCheckValidationSemanticsResponseBodyForContentTypes | -[**post_not_more_complex_schema_request_body**](#post_not_more_complex_schema_request_body) | **post** /requestBody/postNotMoreComplexSchemaRequestBody | -[**post_not_more_complex_schema_response_body_for_content_types**](#post_not_more_complex_schema_response_body_for_content_types) | **post** /responseBody/postNotMoreComplexSchemaResponseBodyForContentTypes | -[**post_not_request_body**](#post_not_request_body) | **post** /requestBody/postNotRequestBody | -[**post_not_response_body_for_content_types**](#post_not_response_body_for_content_types) | **post** /responseBody/postNotResponseBodyForContentTypes | -[**post_nul_characters_in_strings_request_body**](#post_nul_characters_in_strings_request_body) | **post** /requestBody/postNulCharactersInStringsRequestBody | -[**post_nul_characters_in_strings_response_body_for_content_types**](#post_nul_characters_in_strings_response_body_for_content_types) | **post** /responseBody/postNulCharactersInStringsResponseBodyForContentTypes | -[**post_null_type_matches_only_the_null_object_request_body**](#post_null_type_matches_only_the_null_object_request_body) | **post** /requestBody/postNullTypeMatchesOnlyTheNullObjectRequestBody | -[**post_null_type_matches_only_the_null_object_response_body_for_content_types**](#post_null_type_matches_only_the_null_object_response_body_for_content_types) | **post** /responseBody/postNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes | -[**post_number_type_matches_numbers_request_body**](#post_number_type_matches_numbers_request_body) | **post** /requestBody/postNumberTypeMatchesNumbersRequestBody | -[**post_number_type_matches_numbers_response_body_for_content_types**](#post_number_type_matches_numbers_response_body_for_content_types) | **post** /responseBody/postNumberTypeMatchesNumbersResponseBodyForContentTypes | -[**post_object_properties_validation_request_body**](#post_object_properties_validation_request_body) | **post** /requestBody/postObjectPropertiesValidationRequestBody | -[**post_object_properties_validation_response_body_for_content_types**](#post_object_properties_validation_response_body_for_content_types) | **post** /responseBody/postObjectPropertiesValidationResponseBodyForContentTypes | -[**post_object_type_matches_objects_request_body**](#post_object_type_matches_objects_request_body) | **post** /requestBody/postObjectTypeMatchesObjectsRequestBody | -[**post_object_type_matches_objects_response_body_for_content_types**](#post_object_type_matches_objects_response_body_for_content_types) | **post** /responseBody/postObjectTypeMatchesObjectsResponseBodyForContentTypes | -[**post_oneof_complex_types_request_body**](#post_oneof_complex_types_request_body) | **post** /requestBody/postOneofComplexTypesRequestBody | -[**post_oneof_complex_types_response_body_for_content_types**](#post_oneof_complex_types_response_body_for_content_types) | **post** /responseBody/postOneofComplexTypesResponseBodyForContentTypes | -[**post_oneof_request_body**](#post_oneof_request_body) | **post** /requestBody/postOneofRequestBody | -[**post_oneof_response_body_for_content_types**](#post_oneof_response_body_for_content_types) | **post** /responseBody/postOneofResponseBodyForContentTypes | -[**post_oneof_with_base_schema_request_body**](#post_oneof_with_base_schema_request_body) | **post** /requestBody/postOneofWithBaseSchemaRequestBody | -[**post_oneof_with_base_schema_response_body_for_content_types**](#post_oneof_with_base_schema_response_body_for_content_types) | **post** /responseBody/postOneofWithBaseSchemaResponseBodyForContentTypes | -[**post_oneof_with_empty_schema_request_body**](#post_oneof_with_empty_schema_request_body) | **post** /requestBody/postOneofWithEmptySchemaRequestBody | -[**post_oneof_with_empty_schema_response_body_for_content_types**](#post_oneof_with_empty_schema_response_body_for_content_types) | **post** /responseBody/postOneofWithEmptySchemaResponseBodyForContentTypes | -[**post_oneof_with_required_request_body**](#post_oneof_with_required_request_body) | **post** /requestBody/postOneofWithRequiredRequestBody | -[**post_oneof_with_required_response_body_for_content_types**](#post_oneof_with_required_response_body_for_content_types) | **post** /responseBody/postOneofWithRequiredResponseBodyForContentTypes | -[**post_pattern_is_not_anchored_request_body**](#post_pattern_is_not_anchored_request_body) | **post** /requestBody/postPatternIsNotAnchoredRequestBody | -[**post_pattern_is_not_anchored_response_body_for_content_types**](#post_pattern_is_not_anchored_response_body_for_content_types) | **post** /responseBody/postPatternIsNotAnchoredResponseBodyForContentTypes | -[**post_pattern_validation_request_body**](#post_pattern_validation_request_body) | **post** /requestBody/postPatternValidationRequestBody | -[**post_pattern_validation_response_body_for_content_types**](#post_pattern_validation_response_body_for_content_types) | **post** /responseBody/postPatternValidationResponseBodyForContentTypes | -[**post_properties_with_escaped_characters_request_body**](#post_properties_with_escaped_characters_request_body) | **post** /requestBody/postPropertiesWithEscapedCharactersRequestBody | -[**post_properties_with_escaped_characters_response_body_for_content_types**](#post_properties_with_escaped_characters_response_body_for_content_types) | **post** /responseBody/postPropertiesWithEscapedCharactersResponseBodyForContentTypes | -[**post_property_named_ref_that_is_not_a_reference_request_body**](#post_property_named_ref_that_is_not_a_reference_request_body) | **post** /requestBody/postPropertyNamedRefThatIsNotAReferenceRequestBody | -[**post_property_named_ref_that_is_not_a_reference_response_body_for_content_types**](#post_property_named_ref_that_is_not_a_reference_response_body_for_content_types) | **post** /responseBody/postPropertyNamedRefThatIsNotAReferenceResponseBodyForContentTypes | -[**post_ref_in_additionalproperties_request_body**](#post_ref_in_additionalproperties_request_body) | **post** /requestBody/postRefInAdditionalpropertiesRequestBody | -[**post_ref_in_additionalproperties_response_body_for_content_types**](#post_ref_in_additionalproperties_response_body_for_content_types) | **post** /responseBody/postRefInAdditionalpropertiesResponseBodyForContentTypes | -[**post_ref_in_allof_request_body**](#post_ref_in_allof_request_body) | **post** /requestBody/postRefInAllofRequestBody | -[**post_ref_in_allof_response_body_for_content_types**](#post_ref_in_allof_response_body_for_content_types) | **post** /responseBody/postRefInAllofResponseBodyForContentTypes | -[**post_ref_in_anyof_request_body**](#post_ref_in_anyof_request_body) | **post** /requestBody/postRefInAnyofRequestBody | -[**post_ref_in_anyof_response_body_for_content_types**](#post_ref_in_anyof_response_body_for_content_types) | **post** /responseBody/postRefInAnyofResponseBodyForContentTypes | -[**post_ref_in_items_request_body**](#post_ref_in_items_request_body) | **post** /requestBody/postRefInItemsRequestBody | -[**post_ref_in_items_response_body_for_content_types**](#post_ref_in_items_response_body_for_content_types) | **post** /responseBody/postRefInItemsResponseBodyForContentTypes | -[**post_ref_in_not_request_body**](#post_ref_in_not_request_body) | **post** /requestBody/postRefInNotRequestBody | -[**post_ref_in_not_response_body_for_content_types**](#post_ref_in_not_response_body_for_content_types) | **post** /responseBody/postRefInNotResponseBodyForContentTypes | -[**post_ref_in_oneof_request_body**](#post_ref_in_oneof_request_body) | **post** /requestBody/postRefInOneofRequestBody | -[**post_ref_in_oneof_response_body_for_content_types**](#post_ref_in_oneof_response_body_for_content_types) | **post** /responseBody/postRefInOneofResponseBodyForContentTypes | -[**post_ref_in_property_request_body**](#post_ref_in_property_request_body) | **post** /requestBody/postRefInPropertyRequestBody | -[**post_ref_in_property_response_body_for_content_types**](#post_ref_in_property_response_body_for_content_types) | **post** /responseBody/postRefInPropertyResponseBodyForContentTypes | -[**post_required_default_validation_request_body**](#post_required_default_validation_request_body) | **post** /requestBody/postRequiredDefaultValidationRequestBody | -[**post_required_default_validation_response_body_for_content_types**](#post_required_default_validation_response_body_for_content_types) | **post** /responseBody/postRequiredDefaultValidationResponseBodyForContentTypes | -[**post_required_validation_request_body**](#post_required_validation_request_body) | **post** /requestBody/postRequiredValidationRequestBody | -[**post_required_validation_response_body_for_content_types**](#post_required_validation_response_body_for_content_types) | **post** /responseBody/postRequiredValidationResponseBodyForContentTypes | -[**post_required_with_empty_array_request_body**](#post_required_with_empty_array_request_body) | **post** /requestBody/postRequiredWithEmptyArrayRequestBody | -[**post_required_with_empty_array_response_body_for_content_types**](#post_required_with_empty_array_response_body_for_content_types) | **post** /responseBody/postRequiredWithEmptyArrayResponseBodyForContentTypes | -[**post_required_with_escaped_characters_request_body**](#post_required_with_escaped_characters_request_body) | **post** /requestBody/postRequiredWithEscapedCharactersRequestBody | -[**post_required_with_escaped_characters_response_body_for_content_types**](#post_required_with_escaped_characters_response_body_for_content_types) | **post** /responseBody/postRequiredWithEscapedCharactersResponseBodyForContentTypes | -[**post_simple_enum_validation_request_body**](#post_simple_enum_validation_request_body) | **post** /requestBody/postSimpleEnumValidationRequestBody | -[**post_simple_enum_validation_response_body_for_content_types**](#post_simple_enum_validation_response_body_for_content_types) | **post** /responseBody/postSimpleEnumValidationResponseBodyForContentTypes | -[**post_string_type_matches_strings_request_body**](#post_string_type_matches_strings_request_body) | **post** /requestBody/postStringTypeMatchesStringsRequestBody | -[**post_string_type_matches_strings_response_body_for_content_types**](#post_string_type_matches_strings_response_body_for_content_types) | **post** /responseBody/postStringTypeMatchesStringsResponseBodyForContentTypes | -[**post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body**](#post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body) | **post** /requestBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody | -[**post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types**](#post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types) | **post** /responseBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyForContentTypes | -[**post_uniqueitems_false_validation_request_body**](#post_uniqueitems_false_validation_request_body) | **post** /requestBody/postUniqueitemsFalseValidationRequestBody | -[**post_uniqueitems_false_validation_response_body_for_content_types**](#post_uniqueitems_false_validation_response_body_for_content_types) | **post** /responseBody/postUniqueitemsFalseValidationResponseBodyForContentTypes | -[**post_uniqueitems_validation_request_body**](#post_uniqueitems_validation_request_body) | **post** /requestBody/postUniqueitemsValidationRequestBody | -[**post_uniqueitems_validation_response_body_for_content_types**](#post_uniqueitems_validation_response_body_for_content_types) | **post** /responseBody/postUniqueitemsValidationResponseBodyForContentTypes | -[**post_uri_format_request_body**](#post_uri_format_request_body) | **post** /requestBody/postUriFormatRequestBody | -[**post_uri_format_response_body_for_content_types**](#post_uri_format_response_body_for_content_types) | **post** /responseBody/postUriFormatResponseBodyForContentTypes | -[**post_uri_reference_format_request_body**](#post_uri_reference_format_request_body) | **post** /requestBody/postUriReferenceFormatRequestBody | -[**post_uri_reference_format_response_body_for_content_types**](#post_uri_reference_format_response_body_for_content_types) | **post** /responseBody/postUriReferenceFormatResponseBodyForContentTypes | -[**post_uri_template_format_request_body**](#post_uri_template_format_request_body) | **post** /requestBody/postUriTemplateFormatRequestBody | -[**post_uri_template_format_response_body_for_content_types**](#post_uri_template_format_response_body_for_content_types) | **post** /responseBody/postUriTemplateFormatResponseBodyForContentTypes | - -# **post_additionalproperties_allows_a_schema_which_should_validate_request_body** - -> post_additionalproperties_allows_a_schema_which_should_validate_request_body(additionalproperties_allows_a_schema_which_should_validate) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.additionalproperties_allows_a_schema_which_should_validate import AdditionalpropertiesAllowsASchemaWhichShouldValidate -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = AdditionalpropertiesAllowsASchemaWhichShouldValidate( - foo=None, - bar=None, - ) - try: - api_response = api_instance.post_additionalproperties_allows_a_schema_which_should_validate_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_additionalproperties_allows_a_schema_which_should_validate_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AdditionalpropertiesAllowsASchemaWhichShouldValidate**](../../models/AdditionalpropertiesAllowsASchemaWhichShouldValidate.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_additionalproperties_allows_a_schema_which_should_validate_request_body.ApiResponseFor200) | success - -#### post_additionalproperties_allows_a_schema_which_should_validate_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types** - -> AdditionalpropertiesAllowsASchemaWhichShouldValidate post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.additionalproperties_allows_a_schema_which_should_validate import AdditionalpropertiesAllowsASchemaWhichShouldValidate -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types.ApiResponseFor200) | success - -#### post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AdditionalpropertiesAllowsASchemaWhichShouldValidate**](../../models/AdditionalpropertiesAllowsASchemaWhichShouldValidate.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_additionalproperties_are_allowed_by_default_request_body** - -> post_additionalproperties_are_allowed_by_default_request_body(additionalproperties_are_allowed_by_default) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.additionalproperties_are_allowed_by_default import AdditionalpropertiesAreAllowedByDefault -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = AdditionalpropertiesAreAllowedByDefault(None) - try: - api_response = api_instance.post_additionalproperties_are_allowed_by_default_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_additionalproperties_are_allowed_by_default_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AdditionalpropertiesAreAllowedByDefault**](../../models/AdditionalpropertiesAreAllowedByDefault.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_additionalproperties_are_allowed_by_default_request_body.ApiResponseFor200) | success - -#### post_additionalproperties_are_allowed_by_default_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_additionalproperties_are_allowed_by_default_response_body_for_content_types** - -> AdditionalpropertiesAreAllowedByDefault post_additionalproperties_are_allowed_by_default_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.additionalproperties_are_allowed_by_default import AdditionalpropertiesAreAllowedByDefault -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_additionalproperties_are_allowed_by_default_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_additionalproperties_are_allowed_by_default_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_additionalproperties_are_allowed_by_default_response_body_for_content_types.ApiResponseFor200) | success - -#### post_additionalproperties_are_allowed_by_default_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AdditionalpropertiesAreAllowedByDefault**](../../models/AdditionalpropertiesAreAllowedByDefault.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_additionalproperties_can_exist_by_itself_request_body** - -> post_additionalproperties_can_exist_by_itself_request_body(additionalproperties_can_exist_by_itself) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.additionalproperties_can_exist_by_itself import AdditionalpropertiesCanExistByItself -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = AdditionalpropertiesCanExistByItself( - key=True, - ) - try: - api_response = api_instance.post_additionalproperties_can_exist_by_itself_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_additionalproperties_can_exist_by_itself_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AdditionalpropertiesCanExistByItself**](../../models/AdditionalpropertiesCanExistByItself.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_additionalproperties_can_exist_by_itself_request_body.ApiResponseFor200) | success - -#### post_additionalproperties_can_exist_by_itself_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_additionalproperties_can_exist_by_itself_response_body_for_content_types** - -> AdditionalpropertiesCanExistByItself post_additionalproperties_can_exist_by_itself_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.additionalproperties_can_exist_by_itself import AdditionalpropertiesCanExistByItself -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_additionalproperties_can_exist_by_itself_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_additionalproperties_can_exist_by_itself_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_additionalproperties_can_exist_by_itself_response_body_for_content_types.ApiResponseFor200) | success - -#### post_additionalproperties_can_exist_by_itself_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AdditionalpropertiesCanExistByItself**](../../models/AdditionalpropertiesCanExistByItself.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_additionalproperties_should_not_look_in_applicators_request_body** - -> post_additionalproperties_should_not_look_in_applicators_request_body(additionalproperties_should_not_look_in_applicators) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.additionalproperties_should_not_look_in_applicators import AdditionalpropertiesShouldNotLookInApplicators -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = AdditionalpropertiesShouldNotLookInApplicators(None) - try: - api_response = api_instance.post_additionalproperties_should_not_look_in_applicators_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_additionalproperties_should_not_look_in_applicators_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AdditionalpropertiesShouldNotLookInApplicators**](../../models/AdditionalpropertiesShouldNotLookInApplicators.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_additionalproperties_should_not_look_in_applicators_request_body.ApiResponseFor200) | success - -#### post_additionalproperties_should_not_look_in_applicators_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types** - -> AdditionalpropertiesShouldNotLookInApplicators post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.additionalproperties_should_not_look_in_applicators import AdditionalpropertiesShouldNotLookInApplicators -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types.ApiResponseFor200) | success - -#### post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AdditionalpropertiesShouldNotLookInApplicators**](../../models/AdditionalpropertiesShouldNotLookInApplicators.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_allof_combined_with_anyof_oneof_request_body** - -> post_allof_combined_with_anyof_oneof_request_body(allof_combined_with_anyof_oneof) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.allof_combined_with_anyof_oneof import AllofCombinedWithAnyofOneof -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = AllofCombinedWithAnyofOneof(None) - try: - api_response = api_instance.post_allof_combined_with_anyof_oneof_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_allof_combined_with_anyof_oneof_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AllofCombinedWithAnyofOneof**](../../models/AllofCombinedWithAnyofOneof.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_allof_combined_with_anyof_oneof_request_body.ApiResponseFor200) | success - -#### post_allof_combined_with_anyof_oneof_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_allof_combined_with_anyof_oneof_response_body_for_content_types** - -> AllofCombinedWithAnyofOneof post_allof_combined_with_anyof_oneof_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.allof_combined_with_anyof_oneof import AllofCombinedWithAnyofOneof -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_allof_combined_with_anyof_oneof_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_allof_combined_with_anyof_oneof_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_allof_combined_with_anyof_oneof_response_body_for_content_types.ApiResponseFor200) | success - -#### post_allof_combined_with_anyof_oneof_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AllofCombinedWithAnyofOneof**](../../models/AllofCombinedWithAnyofOneof.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_allof_request_body** - -> post_allof_request_body(allof) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.allof import Allof -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = Allof(None) - try: - api_response = api_instance.post_allof_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_allof_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**Allof**](../../models/Allof.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_allof_request_body.ApiResponseFor200) | success - -#### post_allof_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_allof_response_body_for_content_types** - -> Allof post_allof_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.allof import Allof -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_allof_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_allof_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_allof_response_body_for_content_types.ApiResponseFor200) | success - -#### post_allof_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**Allof**](../../models/Allof.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_allof_simple_types_request_body** - -> post_allof_simple_types_request_body(allof_simple_types) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.allof_simple_types import AllofSimpleTypes -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = AllofSimpleTypes(None) - try: - api_response = api_instance.post_allof_simple_types_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_allof_simple_types_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AllofSimpleTypes**](../../models/AllofSimpleTypes.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_allof_simple_types_request_body.ApiResponseFor200) | success - -#### post_allof_simple_types_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_allof_simple_types_response_body_for_content_types** - -> AllofSimpleTypes post_allof_simple_types_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.allof_simple_types import AllofSimpleTypes -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_allof_simple_types_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_allof_simple_types_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_allof_simple_types_response_body_for_content_types.ApiResponseFor200) | success - -#### post_allof_simple_types_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AllofSimpleTypes**](../../models/AllofSimpleTypes.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_allof_with_base_schema_request_body** - -> post_allof_with_base_schema_request_body(allof_with_base_schema) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.allof_with_base_schema import AllofWithBaseSchema -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = AllofWithBaseSchema({}) - try: - api_response = api_instance.post_allof_with_base_schema_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_allof_with_base_schema_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AllofWithBaseSchema**](../../models/AllofWithBaseSchema.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_allof_with_base_schema_request_body.ApiResponseFor200) | success - -#### post_allof_with_base_schema_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_allof_with_base_schema_response_body_for_content_types** - -> AllofWithBaseSchema post_allof_with_base_schema_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.allof_with_base_schema import AllofWithBaseSchema -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_allof_with_base_schema_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_allof_with_base_schema_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_allof_with_base_schema_response_body_for_content_types.ApiResponseFor200) | success - -#### post_allof_with_base_schema_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AllofWithBaseSchema**](../../models/AllofWithBaseSchema.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_allof_with_one_empty_schema_request_body** - -> post_allof_with_one_empty_schema_request_body(allof_with_one_empty_schema) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.allof_with_one_empty_schema import AllofWithOneEmptySchema -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = AllofWithOneEmptySchema(None) - try: - api_response = api_instance.post_allof_with_one_empty_schema_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_allof_with_one_empty_schema_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AllofWithOneEmptySchema**](../../models/AllofWithOneEmptySchema.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_allof_with_one_empty_schema_request_body.ApiResponseFor200) | success - -#### post_allof_with_one_empty_schema_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_allof_with_one_empty_schema_response_body_for_content_types** - -> AllofWithOneEmptySchema post_allof_with_one_empty_schema_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.allof_with_one_empty_schema import AllofWithOneEmptySchema -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_allof_with_one_empty_schema_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_allof_with_one_empty_schema_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_allof_with_one_empty_schema_response_body_for_content_types.ApiResponseFor200) | success - -#### post_allof_with_one_empty_schema_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AllofWithOneEmptySchema**](../../models/AllofWithOneEmptySchema.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_allof_with_the_first_empty_schema_request_body** - -> post_allof_with_the_first_empty_schema_request_body(allof_with_the_first_empty_schema) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.allof_with_the_first_empty_schema import AllofWithTheFirstEmptySchema -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = AllofWithTheFirstEmptySchema(None) - try: - api_response = api_instance.post_allof_with_the_first_empty_schema_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_allof_with_the_first_empty_schema_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AllofWithTheFirstEmptySchema**](../../models/AllofWithTheFirstEmptySchema.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_allof_with_the_first_empty_schema_request_body.ApiResponseFor200) | success - -#### post_allof_with_the_first_empty_schema_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_allof_with_the_first_empty_schema_response_body_for_content_types** - -> AllofWithTheFirstEmptySchema post_allof_with_the_first_empty_schema_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.allof_with_the_first_empty_schema import AllofWithTheFirstEmptySchema -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_allof_with_the_first_empty_schema_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_allof_with_the_first_empty_schema_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_allof_with_the_first_empty_schema_response_body_for_content_types.ApiResponseFor200) | success - -#### post_allof_with_the_first_empty_schema_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AllofWithTheFirstEmptySchema**](../../models/AllofWithTheFirstEmptySchema.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_allof_with_the_last_empty_schema_request_body** - -> post_allof_with_the_last_empty_schema_request_body(allof_with_the_last_empty_schema) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.allof_with_the_last_empty_schema import AllofWithTheLastEmptySchema -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = AllofWithTheLastEmptySchema(None) - try: - api_response = api_instance.post_allof_with_the_last_empty_schema_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_allof_with_the_last_empty_schema_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AllofWithTheLastEmptySchema**](../../models/AllofWithTheLastEmptySchema.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_allof_with_the_last_empty_schema_request_body.ApiResponseFor200) | success - -#### post_allof_with_the_last_empty_schema_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_allof_with_the_last_empty_schema_response_body_for_content_types** - -> AllofWithTheLastEmptySchema post_allof_with_the_last_empty_schema_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.allof_with_the_last_empty_schema import AllofWithTheLastEmptySchema -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_allof_with_the_last_empty_schema_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_allof_with_the_last_empty_schema_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_allof_with_the_last_empty_schema_response_body_for_content_types.ApiResponseFor200) | success - -#### post_allof_with_the_last_empty_schema_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AllofWithTheLastEmptySchema**](../../models/AllofWithTheLastEmptySchema.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_allof_with_two_empty_schemas_request_body** - -> post_allof_with_two_empty_schemas_request_body(allof_with_two_empty_schemas) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.allof_with_two_empty_schemas import AllofWithTwoEmptySchemas -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = AllofWithTwoEmptySchemas(None) - try: - api_response = api_instance.post_allof_with_two_empty_schemas_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_allof_with_two_empty_schemas_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AllofWithTwoEmptySchemas**](../../models/AllofWithTwoEmptySchemas.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_allof_with_two_empty_schemas_request_body.ApiResponseFor200) | success - -#### post_allof_with_two_empty_schemas_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_allof_with_two_empty_schemas_response_body_for_content_types** - -> AllofWithTwoEmptySchemas post_allof_with_two_empty_schemas_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.allof_with_two_empty_schemas import AllofWithTwoEmptySchemas -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_allof_with_two_empty_schemas_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_allof_with_two_empty_schemas_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_allof_with_two_empty_schemas_response_body_for_content_types.ApiResponseFor200) | success - -#### post_allof_with_two_empty_schemas_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AllofWithTwoEmptySchemas**](../../models/AllofWithTwoEmptySchemas.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_anyof_complex_types_request_body** - -> post_anyof_complex_types_request_body(anyof_complex_types) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.anyof_complex_types import AnyofComplexTypes -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = AnyofComplexTypes(None) - try: - api_response = api_instance.post_anyof_complex_types_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_anyof_complex_types_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AnyofComplexTypes**](../../models/AnyofComplexTypes.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_anyof_complex_types_request_body.ApiResponseFor200) | success - -#### post_anyof_complex_types_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_anyof_complex_types_response_body_for_content_types** - -> AnyofComplexTypes post_anyof_complex_types_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.anyof_complex_types import AnyofComplexTypes -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_anyof_complex_types_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_anyof_complex_types_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_anyof_complex_types_response_body_for_content_types.ApiResponseFor200) | success - -#### post_anyof_complex_types_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AnyofComplexTypes**](../../models/AnyofComplexTypes.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_anyof_request_body** - -> post_anyof_request_body(anyof) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.anyof import Anyof -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = Anyof(None) - try: - api_response = api_instance.post_anyof_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_anyof_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**Anyof**](../../models/Anyof.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_anyof_request_body.ApiResponseFor200) | success - -#### post_anyof_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_anyof_response_body_for_content_types** - -> Anyof post_anyof_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.anyof import Anyof -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_anyof_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_anyof_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_anyof_response_body_for_content_types.ApiResponseFor200) | success - -#### post_anyof_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**Anyof**](../../models/Anyof.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_anyof_with_base_schema_request_body** - -> post_anyof_with_base_schema_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.anyof_with_base_schema import AnyofWithBaseSchema -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = AnyofWithBaseSchema("body_example") - try: - api_response = api_instance.post_anyof_with_base_schema_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_anyof_with_base_schema_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AnyofWithBaseSchema**](../../models/AnyofWithBaseSchema.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_anyof_with_base_schema_request_body.ApiResponseFor200) | success - -#### post_anyof_with_base_schema_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_anyof_with_base_schema_response_body_for_content_types** - -> AnyofWithBaseSchema post_anyof_with_base_schema_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.anyof_with_base_schema import AnyofWithBaseSchema -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_anyof_with_base_schema_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_anyof_with_base_schema_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_anyof_with_base_schema_response_body_for_content_types.ApiResponseFor200) | success - -#### post_anyof_with_base_schema_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AnyofWithBaseSchema**](../../models/AnyofWithBaseSchema.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_anyof_with_one_empty_schema_request_body** - -> post_anyof_with_one_empty_schema_request_body(anyof_with_one_empty_schema) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.anyof_with_one_empty_schema import AnyofWithOneEmptySchema -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = AnyofWithOneEmptySchema(None) - try: - api_response = api_instance.post_anyof_with_one_empty_schema_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_anyof_with_one_empty_schema_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AnyofWithOneEmptySchema**](../../models/AnyofWithOneEmptySchema.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_anyof_with_one_empty_schema_request_body.ApiResponseFor200) | success - -#### post_anyof_with_one_empty_schema_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_anyof_with_one_empty_schema_response_body_for_content_types** - -> AnyofWithOneEmptySchema post_anyof_with_one_empty_schema_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.anyof_with_one_empty_schema import AnyofWithOneEmptySchema -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_anyof_with_one_empty_schema_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_anyof_with_one_empty_schema_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_anyof_with_one_empty_schema_response_body_for_content_types.ApiResponseFor200) | success - -#### post_anyof_with_one_empty_schema_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AnyofWithOneEmptySchema**](../../models/AnyofWithOneEmptySchema.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_array_type_matches_arrays_request_body** - -> post_array_type_matches_arrays_request_body(array_type_matches_arrays) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.array_type_matches_arrays import ArrayTypeMatchesArrays -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = ArrayTypeMatchesArrays([ - None - ]) - try: - api_response = api_instance.post_array_type_matches_arrays_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_array_type_matches_arrays_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**ArrayTypeMatchesArrays**](../../models/ArrayTypeMatchesArrays.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_array_type_matches_arrays_request_body.ApiResponseFor200) | success - -#### post_array_type_matches_arrays_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_array_type_matches_arrays_response_body_for_content_types** - -> ArrayTypeMatchesArrays post_array_type_matches_arrays_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.array_type_matches_arrays import ArrayTypeMatchesArrays -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_array_type_matches_arrays_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_array_type_matches_arrays_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_array_type_matches_arrays_response_body_for_content_types.ApiResponseFor200) | success - -#### post_array_type_matches_arrays_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**ArrayTypeMatchesArrays**](../../models/ArrayTypeMatchesArrays.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_boolean_type_matches_booleans_request_body** - -> post_boolean_type_matches_booleans_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = True - try: - api_response = api_instance.post_boolean_type_matches_booleans_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_boolean_type_matches_booleans_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -bool, | BoolClass, | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_boolean_type_matches_booleans_request_body.ApiResponseFor200) | success - -#### post_boolean_type_matches_booleans_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_boolean_type_matches_booleans_response_body_for_content_types** - -> bool post_boolean_type_matches_booleans_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_boolean_type_matches_booleans_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_boolean_type_matches_booleans_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_boolean_type_matches_booleans_response_body_for_content_types.ApiResponseFor200) | success - -#### post_boolean_type_matches_booleans_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -bool, | BoolClass, | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_by_int_request_body** - -> post_by_int_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.by_int import ByInt -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = ByInt(None) - try: - api_response = api_instance.post_by_int_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_by_int_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**ByInt**](../../models/ByInt.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_by_int_request_body.ApiResponseFor200) | success - -#### post_by_int_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_by_int_response_body_for_content_types** - -> ByInt post_by_int_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.by_int import ByInt -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_by_int_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_by_int_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_by_int_response_body_for_content_types.ApiResponseFor200) | success - -#### post_by_int_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**ByInt**](../../models/ByInt.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_by_number_request_body** - -> post_by_number_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.by_number import ByNumber -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = ByNumber(None) - try: - api_response = api_instance.post_by_number_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_by_number_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**ByNumber**](../../models/ByNumber.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_by_number_request_body.ApiResponseFor200) | success - -#### post_by_number_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_by_number_response_body_for_content_types** - -> ByNumber post_by_number_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.by_number import ByNumber -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_by_number_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_by_number_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_by_number_response_body_for_content_types.ApiResponseFor200) | success - -#### post_by_number_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**ByNumber**](../../models/ByNumber.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_by_small_number_request_body** - -> post_by_small_number_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.by_small_number import BySmallNumber -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = BySmallNumber(None) - try: - api_response = api_instance.post_by_small_number_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_by_small_number_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**BySmallNumber**](../../models/BySmallNumber.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_by_small_number_request_body.ApiResponseFor200) | success - -#### post_by_small_number_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_by_small_number_response_body_for_content_types** - -> BySmallNumber post_by_small_number_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.by_small_number import BySmallNumber -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_by_small_number_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_by_small_number_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_by_small_number_response_body_for_content_types.ApiResponseFor200) | success - -#### post_by_small_number_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**BySmallNumber**](../../models/BySmallNumber.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_date_time_format_request_body** - -> post_date_time_format_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = None - try: - api_response = api_instance.post_date_time_format_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_date_time_format_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | value must conform to RFC-3339 date-time - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_date_time_format_request_body.ApiResponseFor200) | success - -#### post_date_time_format_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_date_time_format_response_body_for_content_types** - -> bool, date, datetime, dict, float, int, list, str, none_type post_date_time_format_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_date_time_format_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_date_time_format_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_date_time_format_response_body_for_content_types.ApiResponseFor200) | success - -#### post_date_time_format_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | value must conform to RFC-3339 date-time - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_email_format_request_body** - -> post_email_format_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = None - try: - api_response = api_instance.post_email_format_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_email_format_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_email_format_request_body.ApiResponseFor200) | success - -#### post_email_format_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_email_format_response_body_for_content_types** - -> bool, date, datetime, dict, float, int, list, str, none_type post_email_format_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_email_format_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_email_format_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_email_format_response_body_for_content_types.ApiResponseFor200) | success - -#### post_email_format_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_enum_with0_does_not_match_false_request_body** - -> post_enum_with0_does_not_match_false_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.enum_with0_does_not_match_false import EnumWith0DoesNotMatchFalse -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = EnumWith0DoesNotMatchFalse(0) - try: - api_response = api_instance.post_enum_with0_does_not_match_false_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_enum_with0_does_not_match_false_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**EnumWith0DoesNotMatchFalse**](../../models/EnumWith0DoesNotMatchFalse.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_enum_with0_does_not_match_false_request_body.ApiResponseFor200) | success - -#### post_enum_with0_does_not_match_false_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_enum_with0_does_not_match_false_response_body_for_content_types** - -> EnumWith0DoesNotMatchFalse post_enum_with0_does_not_match_false_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.enum_with0_does_not_match_false import EnumWith0DoesNotMatchFalse -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_enum_with0_does_not_match_false_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_enum_with0_does_not_match_false_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_enum_with0_does_not_match_false_response_body_for_content_types.ApiResponseFor200) | success - -#### post_enum_with0_does_not_match_false_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**EnumWith0DoesNotMatchFalse**](../../models/EnumWith0DoesNotMatchFalse.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_enum_with1_does_not_match_true_request_body** - -> post_enum_with1_does_not_match_true_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.enum_with1_does_not_match_true import EnumWith1DoesNotMatchTrue -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = EnumWith1DoesNotMatchTrue(1) - try: - api_response = api_instance.post_enum_with1_does_not_match_true_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_enum_with1_does_not_match_true_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**EnumWith1DoesNotMatchTrue**](../../models/EnumWith1DoesNotMatchTrue.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_enum_with1_does_not_match_true_request_body.ApiResponseFor200) | success - -#### post_enum_with1_does_not_match_true_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_enum_with1_does_not_match_true_response_body_for_content_types** - -> EnumWith1DoesNotMatchTrue post_enum_with1_does_not_match_true_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.enum_with1_does_not_match_true import EnumWith1DoesNotMatchTrue -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_enum_with1_does_not_match_true_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_enum_with1_does_not_match_true_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_enum_with1_does_not_match_true_response_body_for_content_types.ApiResponseFor200) | success - -#### post_enum_with1_does_not_match_true_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**EnumWith1DoesNotMatchTrue**](../../models/EnumWith1DoesNotMatchTrue.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_enum_with_escaped_characters_request_body** - -> post_enum_with_escaped_characters_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.enum_with_escaped_characters import EnumWithEscapedCharacters -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = EnumWithEscapedCharacters("foo\nbar") - try: - api_response = api_instance.post_enum_with_escaped_characters_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_enum_with_escaped_characters_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**EnumWithEscapedCharacters**](../../models/EnumWithEscapedCharacters.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_enum_with_escaped_characters_request_body.ApiResponseFor200) | success - -#### post_enum_with_escaped_characters_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_enum_with_escaped_characters_response_body_for_content_types** - -> EnumWithEscapedCharacters post_enum_with_escaped_characters_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.enum_with_escaped_characters import EnumWithEscapedCharacters -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_enum_with_escaped_characters_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_enum_with_escaped_characters_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_enum_with_escaped_characters_response_body_for_content_types.ApiResponseFor200) | success - -#### post_enum_with_escaped_characters_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**EnumWithEscapedCharacters**](../../models/EnumWithEscapedCharacters.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_enum_with_false_does_not_match0_request_body** - -> post_enum_with_false_does_not_match0_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.enum_with_false_does_not_match0 import EnumWithFalseDoesNotMatch0 -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = EnumWithFalseDoesNotMatch0(False) - try: - api_response = api_instance.post_enum_with_false_does_not_match0_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_enum_with_false_does_not_match0_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**EnumWithFalseDoesNotMatch0**](../../models/EnumWithFalseDoesNotMatch0.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_enum_with_false_does_not_match0_request_body.ApiResponseFor200) | success - -#### post_enum_with_false_does_not_match0_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_enum_with_false_does_not_match0_response_body_for_content_types** - -> EnumWithFalseDoesNotMatch0 post_enum_with_false_does_not_match0_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.enum_with_false_does_not_match0 import EnumWithFalseDoesNotMatch0 -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_enum_with_false_does_not_match0_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_enum_with_false_does_not_match0_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_enum_with_false_does_not_match0_response_body_for_content_types.ApiResponseFor200) | success - -#### post_enum_with_false_does_not_match0_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**EnumWithFalseDoesNotMatch0**](../../models/EnumWithFalseDoesNotMatch0.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_enum_with_true_does_not_match1_request_body** - -> post_enum_with_true_does_not_match1_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.enum_with_true_does_not_match1 import EnumWithTrueDoesNotMatch1 -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = EnumWithTrueDoesNotMatch1(True) - try: - api_response = api_instance.post_enum_with_true_does_not_match1_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_enum_with_true_does_not_match1_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**EnumWithTrueDoesNotMatch1**](../../models/EnumWithTrueDoesNotMatch1.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_enum_with_true_does_not_match1_request_body.ApiResponseFor200) | success - -#### post_enum_with_true_does_not_match1_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_enum_with_true_does_not_match1_response_body_for_content_types** - -> EnumWithTrueDoesNotMatch1 post_enum_with_true_does_not_match1_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.enum_with_true_does_not_match1 import EnumWithTrueDoesNotMatch1 -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_enum_with_true_does_not_match1_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_enum_with_true_does_not_match1_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_enum_with_true_does_not_match1_response_body_for_content_types.ApiResponseFor200) | success - -#### post_enum_with_true_does_not_match1_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**EnumWithTrueDoesNotMatch1**](../../models/EnumWithTrueDoesNotMatch1.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_enums_in_properties_request_body** - -> post_enums_in_properties_request_body(enums_in_properties) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.enums_in_properties import EnumsInProperties -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = EnumsInProperties( - foo="foo", - bar="bar", - ) - try: - api_response = api_instance.post_enums_in_properties_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_enums_in_properties_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**EnumsInProperties**](../../models/EnumsInProperties.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_enums_in_properties_request_body.ApiResponseFor200) | success - -#### post_enums_in_properties_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_enums_in_properties_response_body_for_content_types** - -> EnumsInProperties post_enums_in_properties_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.enums_in_properties import EnumsInProperties -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_enums_in_properties_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_enums_in_properties_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_enums_in_properties_response_body_for_content_types.ApiResponseFor200) | success - -#### post_enums_in_properties_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**EnumsInProperties**](../../models/EnumsInProperties.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_forbidden_property_request_body** - -> post_forbidden_property_request_body(forbidden_property) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.forbidden_property import ForbiddenProperty -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = ForbiddenProperty(None) - try: - api_response = api_instance.post_forbidden_property_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_forbidden_property_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**ForbiddenProperty**](../../models/ForbiddenProperty.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_forbidden_property_request_body.ApiResponseFor200) | success - -#### post_forbidden_property_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_forbidden_property_response_body_for_content_types** - -> ForbiddenProperty post_forbidden_property_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.forbidden_property import ForbiddenProperty -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_forbidden_property_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_forbidden_property_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_forbidden_property_response_body_for_content_types.ApiResponseFor200) | success - -#### post_forbidden_property_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**ForbiddenProperty**](../../models/ForbiddenProperty.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_hostname_format_request_body** - -> post_hostname_format_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = None - try: - api_response = api_instance.post_hostname_format_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_hostname_format_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_hostname_format_request_body.ApiResponseFor200) | success - -#### post_hostname_format_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_hostname_format_response_body_for_content_types** - -> bool, date, datetime, dict, float, int, list, str, none_type post_hostname_format_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_hostname_format_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_hostname_format_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_hostname_format_response_body_for_content_types.ApiResponseFor200) | success - -#### post_hostname_format_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_integer_type_matches_integers_request_body** - -> post_integer_type_matches_integers_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = 1 - try: - api_response = api_instance.post_integer_type_matches_integers_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_integer_type_matches_integers_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -decimal.Decimal, int, | decimal.Decimal, | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_integer_type_matches_integers_request_body.ApiResponseFor200) | success - -#### post_integer_type_matches_integers_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_integer_type_matches_integers_response_body_for_content_types** - -> int post_integer_type_matches_integers_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_integer_type_matches_integers_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_integer_type_matches_integers_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_integer_type_matches_integers_response_body_for_content_types.ApiResponseFor200) | success - -#### post_integer_type_matches_integers_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -decimal.Decimal, int, | decimal.Decimal, | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body** - -> post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.invalid_instance_should_not_raise_error_when_float_division_inf import InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf(1) - try: - api_response = api_instance.post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf**](../../models/InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body.ApiResponseFor200) | success - -#### post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types** - -> InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.invalid_instance_should_not_raise_error_when_float_division_inf import InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types.ApiResponseFor200) | success - -#### post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf**](../../models/InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_invalid_string_value_for_default_request_body** - -> post_invalid_string_value_for_default_request_body(invalid_string_value_for_default) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.invalid_string_value_for_default import InvalidStringValueForDefault -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = InvalidStringValueForDefault(None) - try: - api_response = api_instance.post_invalid_string_value_for_default_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_invalid_string_value_for_default_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**InvalidStringValueForDefault**](../../models/InvalidStringValueForDefault.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_invalid_string_value_for_default_request_body.ApiResponseFor200) | success - -#### post_invalid_string_value_for_default_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_invalid_string_value_for_default_response_body_for_content_types** - -> InvalidStringValueForDefault post_invalid_string_value_for_default_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.invalid_string_value_for_default import InvalidStringValueForDefault -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_invalid_string_value_for_default_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_invalid_string_value_for_default_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_invalid_string_value_for_default_response_body_for_content_types.ApiResponseFor200) | success - -#### post_invalid_string_value_for_default_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**InvalidStringValueForDefault**](../../models/InvalidStringValueForDefault.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ipv4_format_request_body** - -> post_ipv4_format_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = None - try: - api_response = api_instance.post_ipv4_format_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_ipv4_format_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ipv4_format_request_body.ApiResponseFor200) | success - -#### post_ipv4_format_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ipv4_format_response_body_for_content_types** - -> bool, date, datetime, dict, float, int, list, str, none_type post_ipv4_format_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_ipv4_format_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_ipv4_format_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ipv4_format_response_body_for_content_types.ApiResponseFor200) | success - -#### post_ipv4_format_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ipv6_format_request_body** - -> post_ipv6_format_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = None - try: - api_response = api_instance.post_ipv6_format_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_ipv6_format_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ipv6_format_request_body.ApiResponseFor200) | success - -#### post_ipv6_format_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ipv6_format_response_body_for_content_types** - -> bool, date, datetime, dict, float, int, list, str, none_type post_ipv6_format_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_ipv6_format_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_ipv6_format_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ipv6_format_response_body_for_content_types.ApiResponseFor200) | success - -#### post_ipv6_format_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_json_pointer_format_request_body** - -> post_json_pointer_format_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = None - try: - api_response = api_instance.post_json_pointer_format_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_json_pointer_format_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_json_pointer_format_request_body.ApiResponseFor200) | success - -#### post_json_pointer_format_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_json_pointer_format_response_body_for_content_types** - -> bool, date, datetime, dict, float, int, list, str, none_type post_json_pointer_format_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_json_pointer_format_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_json_pointer_format_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_json_pointer_format_response_body_for_content_types.ApiResponseFor200) | success - -#### post_json_pointer_format_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_maximum_validation_request_body** - -> post_maximum_validation_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.maximum_validation import MaximumValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = MaximumValidation(None) - try: - api_response = api_instance.post_maximum_validation_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_maximum_validation_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MaximumValidation**](../../models/MaximumValidation.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_maximum_validation_request_body.ApiResponseFor200) | success - -#### post_maximum_validation_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_maximum_validation_response_body_for_content_types** - -> MaximumValidation post_maximum_validation_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.maximum_validation import MaximumValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_maximum_validation_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_maximum_validation_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_maximum_validation_response_body_for_content_types.ApiResponseFor200) | success - -#### post_maximum_validation_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MaximumValidation**](../../models/MaximumValidation.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_maximum_validation_with_unsigned_integer_request_body** - -> post_maximum_validation_with_unsigned_integer_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.maximum_validation_with_unsigned_integer import MaximumValidationWithUnsignedInteger -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = MaximumValidationWithUnsignedInteger(None) - try: - api_response = api_instance.post_maximum_validation_with_unsigned_integer_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_maximum_validation_with_unsigned_integer_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MaximumValidationWithUnsignedInteger**](../../models/MaximumValidationWithUnsignedInteger.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_maximum_validation_with_unsigned_integer_request_body.ApiResponseFor200) | success - -#### post_maximum_validation_with_unsigned_integer_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_maximum_validation_with_unsigned_integer_response_body_for_content_types** - -> MaximumValidationWithUnsignedInteger post_maximum_validation_with_unsigned_integer_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.maximum_validation_with_unsigned_integer import MaximumValidationWithUnsignedInteger -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_maximum_validation_with_unsigned_integer_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_maximum_validation_with_unsigned_integer_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_maximum_validation_with_unsigned_integer_response_body_for_content_types.ApiResponseFor200) | success - -#### post_maximum_validation_with_unsigned_integer_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MaximumValidationWithUnsignedInteger**](../../models/MaximumValidationWithUnsignedInteger.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_maxitems_validation_request_body** - -> post_maxitems_validation_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.maxitems_validation import MaxitemsValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = MaxitemsValidation(None) - try: - api_response = api_instance.post_maxitems_validation_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_maxitems_validation_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MaxitemsValidation**](../../models/MaxitemsValidation.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_maxitems_validation_request_body.ApiResponseFor200) | success - -#### post_maxitems_validation_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_maxitems_validation_response_body_for_content_types** - -> MaxitemsValidation post_maxitems_validation_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.maxitems_validation import MaxitemsValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_maxitems_validation_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_maxitems_validation_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_maxitems_validation_response_body_for_content_types.ApiResponseFor200) | success - -#### post_maxitems_validation_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MaxitemsValidation**](../../models/MaxitemsValidation.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_maxlength_validation_request_body** - -> post_maxlength_validation_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.maxlength_validation import MaxlengthValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = MaxlengthValidation(None) - try: - api_response = api_instance.post_maxlength_validation_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_maxlength_validation_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MaxlengthValidation**](../../models/MaxlengthValidation.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_maxlength_validation_request_body.ApiResponseFor200) | success - -#### post_maxlength_validation_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_maxlength_validation_response_body_for_content_types** - -> MaxlengthValidation post_maxlength_validation_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.maxlength_validation import MaxlengthValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_maxlength_validation_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_maxlength_validation_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_maxlength_validation_response_body_for_content_types.ApiResponseFor200) | success - -#### post_maxlength_validation_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MaxlengthValidation**](../../models/MaxlengthValidation.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_maxproperties0_means_the_object_is_empty_request_body** - -> post_maxproperties0_means_the_object_is_empty_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.maxproperties0_means_the_object_is_empty import Maxproperties0MeansTheObjectIsEmpty -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = Maxproperties0MeansTheObjectIsEmpty(None) - try: - api_response = api_instance.post_maxproperties0_means_the_object_is_empty_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_maxproperties0_means_the_object_is_empty_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**Maxproperties0MeansTheObjectIsEmpty**](../../models/Maxproperties0MeansTheObjectIsEmpty.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_maxproperties0_means_the_object_is_empty_request_body.ApiResponseFor200) | success - -#### post_maxproperties0_means_the_object_is_empty_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_maxproperties0_means_the_object_is_empty_response_body_for_content_types** - -> Maxproperties0MeansTheObjectIsEmpty post_maxproperties0_means_the_object_is_empty_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.maxproperties0_means_the_object_is_empty import Maxproperties0MeansTheObjectIsEmpty -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_maxproperties0_means_the_object_is_empty_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_maxproperties0_means_the_object_is_empty_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_maxproperties0_means_the_object_is_empty_response_body_for_content_types.ApiResponseFor200) | success - -#### post_maxproperties0_means_the_object_is_empty_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**Maxproperties0MeansTheObjectIsEmpty**](../../models/Maxproperties0MeansTheObjectIsEmpty.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_maxproperties_validation_request_body** - -> post_maxproperties_validation_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.maxproperties_validation import MaxpropertiesValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = MaxpropertiesValidation(None) - try: - api_response = api_instance.post_maxproperties_validation_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_maxproperties_validation_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MaxpropertiesValidation**](../../models/MaxpropertiesValidation.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_maxproperties_validation_request_body.ApiResponseFor200) | success - -#### post_maxproperties_validation_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_maxproperties_validation_response_body_for_content_types** - -> MaxpropertiesValidation post_maxproperties_validation_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.maxproperties_validation import MaxpropertiesValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_maxproperties_validation_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_maxproperties_validation_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_maxproperties_validation_response_body_for_content_types.ApiResponseFor200) | success - -#### post_maxproperties_validation_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MaxpropertiesValidation**](../../models/MaxpropertiesValidation.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_minimum_validation_request_body** - -> post_minimum_validation_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.minimum_validation import MinimumValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = MinimumValidation(None) - try: - api_response = api_instance.post_minimum_validation_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_minimum_validation_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MinimumValidation**](../../models/MinimumValidation.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_minimum_validation_request_body.ApiResponseFor200) | success - -#### post_minimum_validation_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_minimum_validation_response_body_for_content_types** - -> MinimumValidation post_minimum_validation_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.minimum_validation import MinimumValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_minimum_validation_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_minimum_validation_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_minimum_validation_response_body_for_content_types.ApiResponseFor200) | success - -#### post_minimum_validation_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MinimumValidation**](../../models/MinimumValidation.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_minimum_validation_with_signed_integer_request_body** - -> post_minimum_validation_with_signed_integer_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.minimum_validation_with_signed_integer import MinimumValidationWithSignedInteger -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = MinimumValidationWithSignedInteger(None) - try: - api_response = api_instance.post_minimum_validation_with_signed_integer_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_minimum_validation_with_signed_integer_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MinimumValidationWithSignedInteger**](../../models/MinimumValidationWithSignedInteger.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_minimum_validation_with_signed_integer_request_body.ApiResponseFor200) | success - -#### post_minimum_validation_with_signed_integer_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_minimum_validation_with_signed_integer_response_body_for_content_types** - -> MinimumValidationWithSignedInteger post_minimum_validation_with_signed_integer_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.minimum_validation_with_signed_integer import MinimumValidationWithSignedInteger -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_minimum_validation_with_signed_integer_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_minimum_validation_with_signed_integer_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_minimum_validation_with_signed_integer_response_body_for_content_types.ApiResponseFor200) | success - -#### post_minimum_validation_with_signed_integer_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MinimumValidationWithSignedInteger**](../../models/MinimumValidationWithSignedInteger.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_minitems_validation_request_body** - -> post_minitems_validation_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.minitems_validation import MinitemsValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = MinitemsValidation(None) - try: - api_response = api_instance.post_minitems_validation_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_minitems_validation_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MinitemsValidation**](../../models/MinitemsValidation.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_minitems_validation_request_body.ApiResponseFor200) | success - -#### post_minitems_validation_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_minitems_validation_response_body_for_content_types** - -> MinitemsValidation post_minitems_validation_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.minitems_validation import MinitemsValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_minitems_validation_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_minitems_validation_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_minitems_validation_response_body_for_content_types.ApiResponseFor200) | success - -#### post_minitems_validation_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MinitemsValidation**](../../models/MinitemsValidation.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_minlength_validation_request_body** - -> post_minlength_validation_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.minlength_validation import MinlengthValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = MinlengthValidation(None) - try: - api_response = api_instance.post_minlength_validation_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_minlength_validation_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MinlengthValidation**](../../models/MinlengthValidation.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_minlength_validation_request_body.ApiResponseFor200) | success - -#### post_minlength_validation_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_minlength_validation_response_body_for_content_types** - -> MinlengthValidation post_minlength_validation_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.minlength_validation import MinlengthValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_minlength_validation_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_minlength_validation_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_minlength_validation_response_body_for_content_types.ApiResponseFor200) | success - -#### post_minlength_validation_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MinlengthValidation**](../../models/MinlengthValidation.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_minproperties_validation_request_body** - -> post_minproperties_validation_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.minproperties_validation import MinpropertiesValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = MinpropertiesValidation(None) - try: - api_response = api_instance.post_minproperties_validation_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_minproperties_validation_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MinpropertiesValidation**](../../models/MinpropertiesValidation.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_minproperties_validation_request_body.ApiResponseFor200) | success - -#### post_minproperties_validation_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_minproperties_validation_response_body_for_content_types** - -> MinpropertiesValidation post_minproperties_validation_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.minproperties_validation import MinpropertiesValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_minproperties_validation_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_minproperties_validation_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_minproperties_validation_response_body_for_content_types.ApiResponseFor200) | success - -#### post_minproperties_validation_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MinpropertiesValidation**](../../models/MinpropertiesValidation.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_nested_allof_to_check_validation_semantics_request_body** - -> post_nested_allof_to_check_validation_semantics_request_body(nested_allof_to_check_validation_semantics) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.nested_allof_to_check_validation_semantics import NestedAllofToCheckValidationSemantics -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = NestedAllofToCheckValidationSemantics(None) - try: - api_response = api_instance.post_nested_allof_to_check_validation_semantics_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_nested_allof_to_check_validation_semantics_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**NestedAllofToCheckValidationSemantics**](../../models/NestedAllofToCheckValidationSemantics.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_nested_allof_to_check_validation_semantics_request_body.ApiResponseFor200) | success - -#### post_nested_allof_to_check_validation_semantics_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_nested_allof_to_check_validation_semantics_response_body_for_content_types** - -> NestedAllofToCheckValidationSemantics post_nested_allof_to_check_validation_semantics_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.nested_allof_to_check_validation_semantics import NestedAllofToCheckValidationSemantics -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_nested_allof_to_check_validation_semantics_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_nested_allof_to_check_validation_semantics_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_nested_allof_to_check_validation_semantics_response_body_for_content_types.ApiResponseFor200) | success - -#### post_nested_allof_to_check_validation_semantics_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**NestedAllofToCheckValidationSemantics**](../../models/NestedAllofToCheckValidationSemantics.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_nested_anyof_to_check_validation_semantics_request_body** - -> post_nested_anyof_to_check_validation_semantics_request_body(nested_anyof_to_check_validation_semantics) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.nested_anyof_to_check_validation_semantics import NestedAnyofToCheckValidationSemantics -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = NestedAnyofToCheckValidationSemantics(None) - try: - api_response = api_instance.post_nested_anyof_to_check_validation_semantics_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_nested_anyof_to_check_validation_semantics_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**NestedAnyofToCheckValidationSemantics**](../../models/NestedAnyofToCheckValidationSemantics.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_nested_anyof_to_check_validation_semantics_request_body.ApiResponseFor200) | success - -#### post_nested_anyof_to_check_validation_semantics_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_nested_anyof_to_check_validation_semantics_response_body_for_content_types** - -> NestedAnyofToCheckValidationSemantics post_nested_anyof_to_check_validation_semantics_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.nested_anyof_to_check_validation_semantics import NestedAnyofToCheckValidationSemantics -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_nested_anyof_to_check_validation_semantics_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_nested_anyof_to_check_validation_semantics_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_nested_anyof_to_check_validation_semantics_response_body_for_content_types.ApiResponseFor200) | success - -#### post_nested_anyof_to_check_validation_semantics_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**NestedAnyofToCheckValidationSemantics**](../../models/NestedAnyofToCheckValidationSemantics.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_nested_items_request_body** - -> post_nested_items_request_body(nested_items) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.nested_items import NestedItems -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = NestedItems([ - [ - [ - [ - 3.14 - ] - ] - ] - ]) - try: - api_response = api_instance.post_nested_items_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_nested_items_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**NestedItems**](../../models/NestedItems.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_nested_items_request_body.ApiResponseFor200) | success - -#### post_nested_items_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_nested_items_response_body_for_content_types** - -> NestedItems post_nested_items_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.nested_items import NestedItems -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_nested_items_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_nested_items_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_nested_items_response_body_for_content_types.ApiResponseFor200) | success - -#### post_nested_items_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**NestedItems**](../../models/NestedItems.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_nested_oneof_to_check_validation_semantics_request_body** - -> post_nested_oneof_to_check_validation_semantics_request_body(nested_oneof_to_check_validation_semantics) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.nested_oneof_to_check_validation_semantics import NestedOneofToCheckValidationSemantics -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = NestedOneofToCheckValidationSemantics(None) - try: - api_response = api_instance.post_nested_oneof_to_check_validation_semantics_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_nested_oneof_to_check_validation_semantics_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**NestedOneofToCheckValidationSemantics**](../../models/NestedOneofToCheckValidationSemantics.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_nested_oneof_to_check_validation_semantics_request_body.ApiResponseFor200) | success - -#### post_nested_oneof_to_check_validation_semantics_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_nested_oneof_to_check_validation_semantics_response_body_for_content_types** - -> NestedOneofToCheckValidationSemantics post_nested_oneof_to_check_validation_semantics_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.nested_oneof_to_check_validation_semantics import NestedOneofToCheckValidationSemantics -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_nested_oneof_to_check_validation_semantics_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_nested_oneof_to_check_validation_semantics_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_nested_oneof_to_check_validation_semantics_response_body_for_content_types.ApiResponseFor200) | success - -#### post_nested_oneof_to_check_validation_semantics_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**NestedOneofToCheckValidationSemantics**](../../models/NestedOneofToCheckValidationSemantics.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_not_more_complex_schema_request_body** - -> post_not_more_complex_schema_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = None - try: - api_response = api_instance.post_not_more_complex_schema_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_not_more_complex_schema_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### not -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[not_schema](#not_schema) | dict, frozendict.frozendict, | frozendict.frozendict, | | - -# not_schema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**foo** | str, | str, | | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_not_more_complex_schema_request_body.ApiResponseFor200) | success - -#### post_not_more_complex_schema_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_not_more_complex_schema_response_body_for_content_types** - -> bool, date, datetime, dict, float, int, list, str, none_type post_not_more_complex_schema_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_not_more_complex_schema_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_not_more_complex_schema_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_not_more_complex_schema_response_body_for_content_types.ApiResponseFor200) | success - -#### post_not_more_complex_schema_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### not -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[not_schema](#not_schema) | dict, frozendict.frozendict, | frozendict.frozendict, | | - -# not_schema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**foo** | str, | str, | | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_not_request_body** - -> post_not_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = None - try: - api_response = api_instance.post_not_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_not_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### not -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[not_schema](#not_schema) | decimal.Decimal, int, | decimal.Decimal, | | - -# not_schema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -decimal.Decimal, int, | decimal.Decimal, | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_not_request_body.ApiResponseFor200) | success - -#### post_not_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_not_response_body_for_content_types** - -> bool, date, datetime, dict, float, int, list, str, none_type post_not_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_not_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_not_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_not_response_body_for_content_types.ApiResponseFor200) | success - -#### post_not_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### not -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[not_schema](#not_schema) | decimal.Decimal, int, | decimal.Decimal, | | - -# not_schema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -decimal.Decimal, int, | decimal.Decimal, | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_nul_characters_in_strings_request_body** - -> post_nul_characters_in_strings_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.nul_characters_in_strings import NulCharactersInStrings -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = NulCharactersInStrings("hello\x00there") - try: - api_response = api_instance.post_nul_characters_in_strings_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_nul_characters_in_strings_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**NulCharactersInStrings**](../../models/NulCharactersInStrings.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_nul_characters_in_strings_request_body.ApiResponseFor200) | success - -#### post_nul_characters_in_strings_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_nul_characters_in_strings_response_body_for_content_types** - -> NulCharactersInStrings post_nul_characters_in_strings_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.nul_characters_in_strings import NulCharactersInStrings -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_nul_characters_in_strings_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_nul_characters_in_strings_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_nul_characters_in_strings_response_body_for_content_types.ApiResponseFor200) | success - -#### post_nul_characters_in_strings_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**NulCharactersInStrings**](../../models/NulCharactersInStrings.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_null_type_matches_only_the_null_object_request_body** - -> post_null_type_matches_only_the_null_object_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = None - try: - api_response = api_instance.post_null_type_matches_only_the_null_object_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_null_type_matches_only_the_null_object_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -None, | NoneClass, | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_null_type_matches_only_the_null_object_request_body.ApiResponseFor200) | success - -#### post_null_type_matches_only_the_null_object_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_null_type_matches_only_the_null_object_response_body_for_content_types** - -> none_type post_null_type_matches_only_the_null_object_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_null_type_matches_only_the_null_object_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_null_type_matches_only_the_null_object_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_null_type_matches_only_the_null_object_response_body_for_content_types.ApiResponseFor200) | success - -#### post_null_type_matches_only_the_null_object_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -None, | NoneClass, | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_number_type_matches_numbers_request_body** - -> post_number_type_matches_numbers_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = 3.14 - try: - api_response = api_instance.post_number_type_matches_numbers_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_number_type_matches_numbers_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -decimal.Decimal, int, float, | decimal.Decimal, | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_number_type_matches_numbers_request_body.ApiResponseFor200) | success - -#### post_number_type_matches_numbers_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_number_type_matches_numbers_response_body_for_content_types** - -> int, float post_number_type_matches_numbers_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_number_type_matches_numbers_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_number_type_matches_numbers_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_number_type_matches_numbers_response_body_for_content_types.ApiResponseFor200) | success - -#### post_number_type_matches_numbers_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -decimal.Decimal, int, float, | decimal.Decimal, | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_object_properties_validation_request_body** - -> post_object_properties_validation_request_body(object_properties_validation) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.object_properties_validation import ObjectPropertiesValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = ObjectPropertiesValidation(None) - try: - api_response = api_instance.post_object_properties_validation_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_object_properties_validation_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**ObjectPropertiesValidation**](../../models/ObjectPropertiesValidation.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_object_properties_validation_request_body.ApiResponseFor200) | success - -#### post_object_properties_validation_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_object_properties_validation_response_body_for_content_types** - -> ObjectPropertiesValidation post_object_properties_validation_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.object_properties_validation import ObjectPropertiesValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_object_properties_validation_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_object_properties_validation_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_object_properties_validation_response_body_for_content_types.ApiResponseFor200) | success - -#### post_object_properties_validation_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**ObjectPropertiesValidation**](../../models/ObjectPropertiesValidation.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_object_type_matches_objects_request_body** - -> post_object_type_matches_objects_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = dict() - try: - api_response = api_instance.post_object_type_matches_objects_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_object_type_matches_objects_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_object_type_matches_objects_request_body.ApiResponseFor200) | success - -#### post_object_type_matches_objects_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_object_type_matches_objects_response_body_for_content_types** - -> {str: (bool, date, datetime, dict, float, int, list, str, none_type)} post_object_type_matches_objects_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_object_type_matches_objects_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_object_type_matches_objects_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_object_type_matches_objects_response_body_for_content_types.ApiResponseFor200) | success - -#### post_object_type_matches_objects_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_oneof_complex_types_request_body** - -> post_oneof_complex_types_request_body(oneof_complex_types) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.oneof_complex_types import OneofComplexTypes -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = OneofComplexTypes(None) - try: - api_response = api_instance.post_oneof_complex_types_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_oneof_complex_types_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**OneofComplexTypes**](../../models/OneofComplexTypes.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_oneof_complex_types_request_body.ApiResponseFor200) | success - -#### post_oneof_complex_types_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_oneof_complex_types_response_body_for_content_types** - -> OneofComplexTypes post_oneof_complex_types_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.oneof_complex_types import OneofComplexTypes -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_oneof_complex_types_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_oneof_complex_types_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_oneof_complex_types_response_body_for_content_types.ApiResponseFor200) | success - -#### post_oneof_complex_types_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**OneofComplexTypes**](../../models/OneofComplexTypes.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_oneof_request_body** - -> post_oneof_request_body(oneof) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.oneof import Oneof -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = Oneof(None) - try: - api_response = api_instance.post_oneof_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_oneof_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**Oneof**](../../models/Oneof.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_oneof_request_body.ApiResponseFor200) | success - -#### post_oneof_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_oneof_response_body_for_content_types** - -> Oneof post_oneof_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.oneof import Oneof -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_oneof_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_oneof_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_oneof_response_body_for_content_types.ApiResponseFor200) | success - -#### post_oneof_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**Oneof**](../../models/Oneof.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_oneof_with_base_schema_request_body** - -> post_oneof_with_base_schema_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.oneof_with_base_schema import OneofWithBaseSchema -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = OneofWithBaseSchema("body_example") - try: - api_response = api_instance.post_oneof_with_base_schema_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_oneof_with_base_schema_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**OneofWithBaseSchema**](../../models/OneofWithBaseSchema.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_oneof_with_base_schema_request_body.ApiResponseFor200) | success - -#### post_oneof_with_base_schema_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_oneof_with_base_schema_response_body_for_content_types** - -> OneofWithBaseSchema post_oneof_with_base_schema_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.oneof_with_base_schema import OneofWithBaseSchema -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_oneof_with_base_schema_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_oneof_with_base_schema_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_oneof_with_base_schema_response_body_for_content_types.ApiResponseFor200) | success - -#### post_oneof_with_base_schema_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**OneofWithBaseSchema**](../../models/OneofWithBaseSchema.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_oneof_with_empty_schema_request_body** - -> post_oneof_with_empty_schema_request_body(oneof_with_empty_schema) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.oneof_with_empty_schema import OneofWithEmptySchema -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = OneofWithEmptySchema(None) - try: - api_response = api_instance.post_oneof_with_empty_schema_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_oneof_with_empty_schema_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**OneofWithEmptySchema**](../../models/OneofWithEmptySchema.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_oneof_with_empty_schema_request_body.ApiResponseFor200) | success - -#### post_oneof_with_empty_schema_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_oneof_with_empty_schema_response_body_for_content_types** - -> OneofWithEmptySchema post_oneof_with_empty_schema_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.oneof_with_empty_schema import OneofWithEmptySchema -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_oneof_with_empty_schema_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_oneof_with_empty_schema_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_oneof_with_empty_schema_response_body_for_content_types.ApiResponseFor200) | success - -#### post_oneof_with_empty_schema_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**OneofWithEmptySchema**](../../models/OneofWithEmptySchema.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_oneof_with_required_request_body** - -> post_oneof_with_required_request_body(oneof_with_required) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.oneof_with_required import OneofWithRequired -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = OneofWithRequired() - try: - api_response = api_instance.post_oneof_with_required_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_oneof_with_required_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**OneofWithRequired**](../../models/OneofWithRequired.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_oneof_with_required_request_body.ApiResponseFor200) | success - -#### post_oneof_with_required_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_oneof_with_required_response_body_for_content_types** - -> OneofWithRequired post_oneof_with_required_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.oneof_with_required import OneofWithRequired -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_oneof_with_required_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_oneof_with_required_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_oneof_with_required_response_body_for_content_types.ApiResponseFor200) | success - -#### post_oneof_with_required_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**OneofWithRequired**](../../models/OneofWithRequired.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_pattern_is_not_anchored_request_body** - -> post_pattern_is_not_anchored_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.pattern_is_not_anchored import PatternIsNotAnchored -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = PatternIsNotAnchored(None) - try: - api_response = api_instance.post_pattern_is_not_anchored_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_pattern_is_not_anchored_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**PatternIsNotAnchored**](../../models/PatternIsNotAnchored.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_pattern_is_not_anchored_request_body.ApiResponseFor200) | success - -#### post_pattern_is_not_anchored_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_pattern_is_not_anchored_response_body_for_content_types** - -> PatternIsNotAnchored post_pattern_is_not_anchored_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.pattern_is_not_anchored import PatternIsNotAnchored -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_pattern_is_not_anchored_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_pattern_is_not_anchored_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_pattern_is_not_anchored_response_body_for_content_types.ApiResponseFor200) | success - -#### post_pattern_is_not_anchored_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**PatternIsNotAnchored**](../../models/PatternIsNotAnchored.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_pattern_validation_request_body** - -> post_pattern_validation_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.pattern_validation import PatternValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = PatternValidation(None) - try: - api_response = api_instance.post_pattern_validation_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_pattern_validation_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**PatternValidation**](../../models/PatternValidation.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_pattern_validation_request_body.ApiResponseFor200) | success - -#### post_pattern_validation_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_pattern_validation_response_body_for_content_types** - -> PatternValidation post_pattern_validation_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.pattern_validation import PatternValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_pattern_validation_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_pattern_validation_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_pattern_validation_response_body_for_content_types.ApiResponseFor200) | success - -#### post_pattern_validation_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**PatternValidation**](../../models/PatternValidation.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_properties_with_escaped_characters_request_body** - -> post_properties_with_escaped_characters_request_body(properties_with_escaped_characters) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.properties_with_escaped_characters import PropertiesWithEscapedCharacters -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = PropertiesWithEscapedCharacters(None) - try: - api_response = api_instance.post_properties_with_escaped_characters_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_properties_with_escaped_characters_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**PropertiesWithEscapedCharacters**](../../models/PropertiesWithEscapedCharacters.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_properties_with_escaped_characters_request_body.ApiResponseFor200) | success - -#### post_properties_with_escaped_characters_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_properties_with_escaped_characters_response_body_for_content_types** - -> PropertiesWithEscapedCharacters post_properties_with_escaped_characters_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.properties_with_escaped_characters import PropertiesWithEscapedCharacters -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_properties_with_escaped_characters_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_properties_with_escaped_characters_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_properties_with_escaped_characters_response_body_for_content_types.ApiResponseFor200) | success - -#### post_properties_with_escaped_characters_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**PropertiesWithEscapedCharacters**](../../models/PropertiesWithEscapedCharacters.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_property_named_ref_that_is_not_a_reference_request_body** - -> post_property_named_ref_that_is_not_a_reference_request_body(property_named_ref_that_is_not_a_reference) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.property_named_ref_that_is_not_a_reference import PropertyNamedRefThatIsNotAReference -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = PropertyNamedRefThatIsNotAReference(None) - try: - api_response = api_instance.post_property_named_ref_that_is_not_a_reference_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_property_named_ref_that_is_not_a_reference_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**PropertyNamedRefThatIsNotAReference**](../../models/PropertyNamedRefThatIsNotAReference.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_property_named_ref_that_is_not_a_reference_request_body.ApiResponseFor200) | success - -#### post_property_named_ref_that_is_not_a_reference_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_property_named_ref_that_is_not_a_reference_response_body_for_content_types** - -> PropertyNamedRefThatIsNotAReference post_property_named_ref_that_is_not_a_reference_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.property_named_ref_that_is_not_a_reference import PropertyNamedRefThatIsNotAReference -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_property_named_ref_that_is_not_a_reference_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_property_named_ref_that_is_not_a_reference_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_property_named_ref_that_is_not_a_reference_response_body_for_content_types.ApiResponseFor200) | success - -#### post_property_named_ref_that_is_not_a_reference_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**PropertyNamedRefThatIsNotAReference**](../../models/PropertyNamedRefThatIsNotAReference.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ref_in_additionalproperties_request_body** - -> post_ref_in_additionalproperties_request_body(ref_in_additionalproperties) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.ref_in_additionalproperties import RefInAdditionalproperties -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = RefInAdditionalproperties( - key=PropertyNamedRefThatIsNotAReference(None), - ) - try: - api_response = api_instance.post_ref_in_additionalproperties_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_ref_in_additionalproperties_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RefInAdditionalproperties**](../../models/RefInAdditionalproperties.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ref_in_additionalproperties_request_body.ApiResponseFor200) | success - -#### post_ref_in_additionalproperties_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ref_in_additionalproperties_response_body_for_content_types** - -> RefInAdditionalproperties post_ref_in_additionalproperties_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.ref_in_additionalproperties import RefInAdditionalproperties -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_ref_in_additionalproperties_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_ref_in_additionalproperties_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ref_in_additionalproperties_response_body_for_content_types.ApiResponseFor200) | success - -#### post_ref_in_additionalproperties_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RefInAdditionalproperties**](../../models/RefInAdditionalproperties.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ref_in_allof_request_body** - -> post_ref_in_allof_request_body(ref_in_allof) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.ref_in_allof import RefInAllof -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = RefInAllof(None) - try: - api_response = api_instance.post_ref_in_allof_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_ref_in_allof_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RefInAllof**](../../models/RefInAllof.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ref_in_allof_request_body.ApiResponseFor200) | success - -#### post_ref_in_allof_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ref_in_allof_response_body_for_content_types** - -> RefInAllof post_ref_in_allof_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.ref_in_allof import RefInAllof -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_ref_in_allof_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_ref_in_allof_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ref_in_allof_response_body_for_content_types.ApiResponseFor200) | success - -#### post_ref_in_allof_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RefInAllof**](../../models/RefInAllof.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ref_in_anyof_request_body** - -> post_ref_in_anyof_request_body(ref_in_anyof) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.ref_in_anyof import RefInAnyof -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = RefInAnyof(None) - try: - api_response = api_instance.post_ref_in_anyof_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_ref_in_anyof_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RefInAnyof**](../../models/RefInAnyof.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ref_in_anyof_request_body.ApiResponseFor200) | success - -#### post_ref_in_anyof_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ref_in_anyof_response_body_for_content_types** - -> RefInAnyof post_ref_in_anyof_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.ref_in_anyof import RefInAnyof -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_ref_in_anyof_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_ref_in_anyof_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ref_in_anyof_response_body_for_content_types.ApiResponseFor200) | success - -#### post_ref_in_anyof_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RefInAnyof**](../../models/RefInAnyof.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ref_in_items_request_body** - -> post_ref_in_items_request_body(ref_in_items) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.ref_in_items import RefInItems -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = RefInItems([ - PropertyNamedRefThatIsNotAReference(None) - ]) - try: - api_response = api_instance.post_ref_in_items_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_ref_in_items_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RefInItems**](../../models/RefInItems.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ref_in_items_request_body.ApiResponseFor200) | success - -#### post_ref_in_items_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ref_in_items_response_body_for_content_types** - -> RefInItems post_ref_in_items_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.ref_in_items import RefInItems -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_ref_in_items_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_ref_in_items_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ref_in_items_response_body_for_content_types.ApiResponseFor200) | success - -#### post_ref_in_items_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RefInItems**](../../models/RefInItems.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ref_in_not_request_body** - -> post_ref_in_not_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.property_named_ref_that_is_not_a_reference import PropertyNamedRefThatIsNotAReference -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = None - try: - api_response = api_instance.post_ref_in_not_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_ref_in_not_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### not -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[PropertyNamedRefThatIsNotAReference]({{complexTypePrefix}}PropertyNamedRefThatIsNotAReference.md) | [**PropertyNamedRefThatIsNotAReference**]({{complexTypePrefix}}PropertyNamedRefThatIsNotAReference.md) | [**PropertyNamedRefThatIsNotAReference**]({{complexTypePrefix}}PropertyNamedRefThatIsNotAReference.md) | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ref_in_not_request_body.ApiResponseFor200) | success - -#### post_ref_in_not_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ref_in_not_response_body_for_content_types** - -> bool, date, datetime, dict, float, int, list, str, none_type post_ref_in_not_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.property_named_ref_that_is_not_a_reference import PropertyNamedRefThatIsNotAReference -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_ref_in_not_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_ref_in_not_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ref_in_not_response_body_for_content_types.ApiResponseFor200) | success - -#### post_ref_in_not_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### not -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[PropertyNamedRefThatIsNotAReference]({{complexTypePrefix}}PropertyNamedRefThatIsNotAReference.md) | [**PropertyNamedRefThatIsNotAReference**]({{complexTypePrefix}}PropertyNamedRefThatIsNotAReference.md) | [**PropertyNamedRefThatIsNotAReference**]({{complexTypePrefix}}PropertyNamedRefThatIsNotAReference.md) | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ref_in_oneof_request_body** - -> post_ref_in_oneof_request_body(ref_in_oneof) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.ref_in_oneof import RefInOneof -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = RefInOneof(None) - try: - api_response = api_instance.post_ref_in_oneof_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_ref_in_oneof_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RefInOneof**](../../models/RefInOneof.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ref_in_oneof_request_body.ApiResponseFor200) | success - -#### post_ref_in_oneof_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ref_in_oneof_response_body_for_content_types** - -> RefInOneof post_ref_in_oneof_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.ref_in_oneof import RefInOneof -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_ref_in_oneof_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_ref_in_oneof_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ref_in_oneof_response_body_for_content_types.ApiResponseFor200) | success - -#### post_ref_in_oneof_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RefInOneof**](../../models/RefInOneof.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ref_in_property_request_body** - -> post_ref_in_property_request_body(ref_in_property) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.ref_in_property import RefInProperty -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = RefInProperty(None) - try: - api_response = api_instance.post_ref_in_property_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_ref_in_property_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RefInProperty**](../../models/RefInProperty.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ref_in_property_request_body.ApiResponseFor200) | success - -#### post_ref_in_property_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ref_in_property_response_body_for_content_types** - -> RefInProperty post_ref_in_property_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.ref_in_property import RefInProperty -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_ref_in_property_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_ref_in_property_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ref_in_property_response_body_for_content_types.ApiResponseFor200) | success - -#### post_ref_in_property_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RefInProperty**](../../models/RefInProperty.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_required_default_validation_request_body** - -> post_required_default_validation_request_body(required_default_validation) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.required_default_validation import RequiredDefaultValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = RequiredDefaultValidation(None) - try: - api_response = api_instance.post_required_default_validation_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_required_default_validation_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RequiredDefaultValidation**](../../models/RequiredDefaultValidation.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_required_default_validation_request_body.ApiResponseFor200) | success - -#### post_required_default_validation_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_required_default_validation_response_body_for_content_types** - -> RequiredDefaultValidation post_required_default_validation_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.required_default_validation import RequiredDefaultValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_required_default_validation_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_required_default_validation_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_required_default_validation_response_body_for_content_types.ApiResponseFor200) | success - -#### post_required_default_validation_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RequiredDefaultValidation**](../../models/RequiredDefaultValidation.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_required_validation_request_body** - -> post_required_validation_request_body(required_validation) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.required_validation import RequiredValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = RequiredValidation(None) - try: - api_response = api_instance.post_required_validation_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_required_validation_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RequiredValidation**](../../models/RequiredValidation.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_required_validation_request_body.ApiResponseFor200) | success - -#### post_required_validation_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_required_validation_response_body_for_content_types** - -> RequiredValidation post_required_validation_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.required_validation import RequiredValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_required_validation_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_required_validation_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_required_validation_response_body_for_content_types.ApiResponseFor200) | success - -#### post_required_validation_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RequiredValidation**](../../models/RequiredValidation.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_required_with_empty_array_request_body** - -> post_required_with_empty_array_request_body(required_with_empty_array) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.required_with_empty_array import RequiredWithEmptyArray -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = RequiredWithEmptyArray(None) - try: - api_response = api_instance.post_required_with_empty_array_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_required_with_empty_array_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RequiredWithEmptyArray**](../../models/RequiredWithEmptyArray.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_required_with_empty_array_request_body.ApiResponseFor200) | success - -#### post_required_with_empty_array_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_required_with_empty_array_response_body_for_content_types** - -> RequiredWithEmptyArray post_required_with_empty_array_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.required_with_empty_array import RequiredWithEmptyArray -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_required_with_empty_array_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_required_with_empty_array_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_required_with_empty_array_response_body_for_content_types.ApiResponseFor200) | success - -#### post_required_with_empty_array_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RequiredWithEmptyArray**](../../models/RequiredWithEmptyArray.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_required_with_escaped_characters_request_body** - -> post_required_with_escaped_characters_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = None - try: - api_response = api_instance.post_required_with_escaped_characters_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_required_with_escaped_characters_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_required_with_escaped_characters_request_body.ApiResponseFor200) | success - -#### post_required_with_escaped_characters_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_required_with_escaped_characters_response_body_for_content_types** - -> bool, date, datetime, dict, float, int, list, str, none_type post_required_with_escaped_characters_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_required_with_escaped_characters_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_required_with_escaped_characters_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_required_with_escaped_characters_response_body_for_content_types.ApiResponseFor200) | success - -#### post_required_with_escaped_characters_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_simple_enum_validation_request_body** - -> post_simple_enum_validation_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.simple_enum_validation import SimpleEnumValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = SimpleEnumValidation(1) - try: - api_response = api_instance.post_simple_enum_validation_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_simple_enum_validation_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**SimpleEnumValidation**](../../models/SimpleEnumValidation.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_simple_enum_validation_request_body.ApiResponseFor200) | success - -#### post_simple_enum_validation_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_simple_enum_validation_response_body_for_content_types** - -> SimpleEnumValidation post_simple_enum_validation_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.simple_enum_validation import SimpleEnumValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_simple_enum_validation_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_simple_enum_validation_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_simple_enum_validation_response_body_for_content_types.ApiResponseFor200) | success - -#### post_simple_enum_validation_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**SimpleEnumValidation**](../../models/SimpleEnumValidation.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_string_type_matches_strings_request_body** - -> post_string_type_matches_strings_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = "body_example" - try: - api_response = api_instance.post_string_type_matches_strings_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_string_type_matches_strings_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_string_type_matches_strings_request_body.ApiResponseFor200) | success - -#### post_string_type_matches_strings_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_string_type_matches_strings_response_body_for_content_types** - -> str post_string_type_matches_strings_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_string_type_matches_strings_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_string_type_matches_strings_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_string_type_matches_strings_response_body_for_content_types.ApiResponseFor200) | success - -#### post_string_type_matches_strings_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body** - -> post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body(the_default_keyword_does_not_do_anything_if_the_property_is_missing) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.the_default_keyword_does_not_do_anything_if_the_property_is_missing import TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing( - alpha=5, - ) - try: - api_response = api_instance.post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing**](../../models/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.ApiResponseFor200) | success - -#### post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types** - -> TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.the_default_keyword_does_not_do_anything_if_the_property_is_missing import TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types.ApiResponseFor200) | success - -#### post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing**](../../models/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_uniqueitems_false_validation_request_body** - -> post_uniqueitems_false_validation_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.uniqueitems_false_validation import UniqueitemsFalseValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = UniqueitemsFalseValidation(None) - try: - api_response = api_instance.post_uniqueitems_false_validation_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_uniqueitems_false_validation_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**UniqueitemsFalseValidation**](../../models/UniqueitemsFalseValidation.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_uniqueitems_false_validation_request_body.ApiResponseFor200) | success - -#### post_uniqueitems_false_validation_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_uniqueitems_false_validation_response_body_for_content_types** - -> UniqueitemsFalseValidation post_uniqueitems_false_validation_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.uniqueitems_false_validation import UniqueitemsFalseValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_uniqueitems_false_validation_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_uniqueitems_false_validation_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_uniqueitems_false_validation_response_body_for_content_types.ApiResponseFor200) | success - -#### post_uniqueitems_false_validation_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**UniqueitemsFalseValidation**](../../models/UniqueitemsFalseValidation.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_uniqueitems_validation_request_body** - -> post_uniqueitems_validation_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.uniqueitems_validation import UniqueitemsValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = UniqueitemsValidation(None) - try: - api_response = api_instance.post_uniqueitems_validation_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_uniqueitems_validation_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**UniqueitemsValidation**](../../models/UniqueitemsValidation.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_uniqueitems_validation_request_body.ApiResponseFor200) | success - -#### post_uniqueitems_validation_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_uniqueitems_validation_response_body_for_content_types** - -> UniqueitemsValidation post_uniqueitems_validation_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from unit_test_api.model.uniqueitems_validation import UniqueitemsValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_uniqueitems_validation_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_uniqueitems_validation_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_uniqueitems_validation_response_body_for_content_types.ApiResponseFor200) | success - -#### post_uniqueitems_validation_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**UniqueitemsValidation**](../../models/UniqueitemsValidation.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_uri_format_request_body** - -> post_uri_format_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = None - try: - api_response = api_instance.post_uri_format_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_uri_format_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_uri_format_request_body.ApiResponseFor200) | success - -#### post_uri_format_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_uri_format_response_body_for_content_types** - -> bool, date, datetime, dict, float, int, list, str, none_type post_uri_format_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_uri_format_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_uri_format_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_uri_format_response_body_for_content_types.ApiResponseFor200) | success - -#### post_uri_format_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_uri_reference_format_request_body** - -> post_uri_reference_format_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = None - try: - api_response = api_instance.post_uri_reference_format_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_uri_reference_format_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_uri_reference_format_request_body.ApiResponseFor200) | success - -#### post_uri_reference_format_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_uri_reference_format_response_body_for_content_types** - -> bool, date, datetime, dict, float, int, list, str, none_type post_uri_reference_format_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_uri_reference_format_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_uri_reference_format_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_uri_reference_format_response_body_for_content_types.ApiResponseFor200) | success - -#### post_uri_reference_format_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_uri_template_format_request_body** - -> post_uri_template_format_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example passing only required values which don't have defaults set - body = None - try: - api_response = api_instance.post_uri_template_format_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_uri_template_format_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_uri_template_format_request_body.ApiResponseFor200) | success - -#### post_uri_template_format_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_uri_template_format_response_body_for_content_types** - -> bool, date, datetime, dict, float, int, list, str, none_type post_uri_template_format_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import content_type_json_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = content_type_json_api.ContentTypeJsonApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_uri_template_format_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ContentTypeJsonApi->post_uri_template_format_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_uri_template_format_response_body_for_content_types.ApiResponseFor200) | success - -#### post_uri_template_format_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - +[**post_additionalproperties_allows_a_schema_which_should_validate_request_body**](content_type_json_api/post_additionalproperties_allows_a_schema_which_should_validate_request_body.md) | **post** /requestBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody | +[**post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types**](content_type_json_api/post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types.md) | **post** /responseBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateResponseBodyForContentTypes | +[**post_additionalproperties_are_allowed_by_default_request_body**](content_type_json_api/post_additionalproperties_are_allowed_by_default_request_body.md) | **post** /requestBody/postAdditionalpropertiesAreAllowedByDefaultRequestBody | +[**post_additionalproperties_are_allowed_by_default_response_body_for_content_types**](content_type_json_api/post_additionalproperties_are_allowed_by_default_response_body_for_content_types.md) | **post** /responseBody/postAdditionalpropertiesAreAllowedByDefaultResponseBodyForContentTypes | +[**post_additionalproperties_can_exist_by_itself_request_body**](content_type_json_api/post_additionalproperties_can_exist_by_itself_request_body.md) | **post** /requestBody/postAdditionalpropertiesCanExistByItselfRequestBody | +[**post_additionalproperties_can_exist_by_itself_response_body_for_content_types**](content_type_json_api/post_additionalproperties_can_exist_by_itself_response_body_for_content_types.md) | **post** /responseBody/postAdditionalpropertiesCanExistByItselfResponseBodyForContentTypes | +[**post_additionalproperties_should_not_look_in_applicators_request_body**](content_type_json_api/post_additionalproperties_should_not_look_in_applicators_request_body.md) | **post** /requestBody/postAdditionalpropertiesShouldNotLookInApplicatorsRequestBody | +[**post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types**](content_type_json_api/post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types.md) | **post** /responseBody/postAdditionalpropertiesShouldNotLookInApplicatorsResponseBodyForContentTypes | +[**post_allof_combined_with_anyof_oneof_request_body**](content_type_json_api/post_allof_combined_with_anyof_oneof_request_body.md) | **post** /requestBody/postAllofCombinedWithAnyofOneofRequestBody | +[**post_allof_combined_with_anyof_oneof_response_body_for_content_types**](content_type_json_api/post_allof_combined_with_anyof_oneof_response_body_for_content_types.md) | **post** /responseBody/postAllofCombinedWithAnyofOneofResponseBodyForContentTypes | +[**post_allof_request_body**](content_type_json_api/post_allof_request_body.md) | **post** /requestBody/postAllofRequestBody | +[**post_allof_response_body_for_content_types**](content_type_json_api/post_allof_response_body_for_content_types.md) | **post** /responseBody/postAllofResponseBodyForContentTypes | +[**post_allof_simple_types_request_body**](content_type_json_api/post_allof_simple_types_request_body.md) | **post** /requestBody/postAllofSimpleTypesRequestBody | +[**post_allof_simple_types_response_body_for_content_types**](content_type_json_api/post_allof_simple_types_response_body_for_content_types.md) | **post** /responseBody/postAllofSimpleTypesResponseBodyForContentTypes | +[**post_allof_with_base_schema_request_body**](content_type_json_api/post_allof_with_base_schema_request_body.md) | **post** /requestBody/postAllofWithBaseSchemaRequestBody | +[**post_allof_with_base_schema_response_body_for_content_types**](content_type_json_api/post_allof_with_base_schema_response_body_for_content_types.md) | **post** /responseBody/postAllofWithBaseSchemaResponseBodyForContentTypes | +[**post_allof_with_one_empty_schema_request_body**](content_type_json_api/post_allof_with_one_empty_schema_request_body.md) | **post** /requestBody/postAllofWithOneEmptySchemaRequestBody | +[**post_allof_with_one_empty_schema_response_body_for_content_types**](content_type_json_api/post_allof_with_one_empty_schema_response_body_for_content_types.md) | **post** /responseBody/postAllofWithOneEmptySchemaResponseBodyForContentTypes | +[**post_allof_with_the_first_empty_schema_request_body**](content_type_json_api/post_allof_with_the_first_empty_schema_request_body.md) | **post** /requestBody/postAllofWithTheFirstEmptySchemaRequestBody | +[**post_allof_with_the_first_empty_schema_response_body_for_content_types**](content_type_json_api/post_allof_with_the_first_empty_schema_response_body_for_content_types.md) | **post** /responseBody/postAllofWithTheFirstEmptySchemaResponseBodyForContentTypes | +[**post_allof_with_the_last_empty_schema_request_body**](content_type_json_api/post_allof_with_the_last_empty_schema_request_body.md) | **post** /requestBody/postAllofWithTheLastEmptySchemaRequestBody | +[**post_allof_with_the_last_empty_schema_response_body_for_content_types**](content_type_json_api/post_allof_with_the_last_empty_schema_response_body_for_content_types.md) | **post** /responseBody/postAllofWithTheLastEmptySchemaResponseBodyForContentTypes | +[**post_allof_with_two_empty_schemas_request_body**](content_type_json_api/post_allof_with_two_empty_schemas_request_body.md) | **post** /requestBody/postAllofWithTwoEmptySchemasRequestBody | +[**post_allof_with_two_empty_schemas_response_body_for_content_types**](content_type_json_api/post_allof_with_two_empty_schemas_response_body_for_content_types.md) | **post** /responseBody/postAllofWithTwoEmptySchemasResponseBodyForContentTypes | +[**post_anyof_complex_types_request_body**](content_type_json_api/post_anyof_complex_types_request_body.md) | **post** /requestBody/postAnyofComplexTypesRequestBody | +[**post_anyof_complex_types_response_body_for_content_types**](content_type_json_api/post_anyof_complex_types_response_body_for_content_types.md) | **post** /responseBody/postAnyofComplexTypesResponseBodyForContentTypes | +[**post_anyof_request_body**](content_type_json_api/post_anyof_request_body.md) | **post** /requestBody/postAnyofRequestBody | +[**post_anyof_response_body_for_content_types**](content_type_json_api/post_anyof_response_body_for_content_types.md) | **post** /responseBody/postAnyofResponseBodyForContentTypes | +[**post_anyof_with_base_schema_request_body**](content_type_json_api/post_anyof_with_base_schema_request_body.md) | **post** /requestBody/postAnyofWithBaseSchemaRequestBody | +[**post_anyof_with_base_schema_response_body_for_content_types**](content_type_json_api/post_anyof_with_base_schema_response_body_for_content_types.md) | **post** /responseBody/postAnyofWithBaseSchemaResponseBodyForContentTypes | +[**post_anyof_with_one_empty_schema_request_body**](content_type_json_api/post_anyof_with_one_empty_schema_request_body.md) | **post** /requestBody/postAnyofWithOneEmptySchemaRequestBody | +[**post_anyof_with_one_empty_schema_response_body_for_content_types**](content_type_json_api/post_anyof_with_one_empty_schema_response_body_for_content_types.md) | **post** /responseBody/postAnyofWithOneEmptySchemaResponseBodyForContentTypes | +[**post_array_type_matches_arrays_request_body**](content_type_json_api/post_array_type_matches_arrays_request_body.md) | **post** /requestBody/postArrayTypeMatchesArraysRequestBody | +[**post_array_type_matches_arrays_response_body_for_content_types**](content_type_json_api/post_array_type_matches_arrays_response_body_for_content_types.md) | **post** /responseBody/postArrayTypeMatchesArraysResponseBodyForContentTypes | +[**post_boolean_type_matches_booleans_request_body**](content_type_json_api/post_boolean_type_matches_booleans_request_body.md) | **post** /requestBody/postBooleanTypeMatchesBooleansRequestBody | +[**post_boolean_type_matches_booleans_response_body_for_content_types**](content_type_json_api/post_boolean_type_matches_booleans_response_body_for_content_types.md) | **post** /responseBody/postBooleanTypeMatchesBooleansResponseBodyForContentTypes | +[**post_by_int_request_body**](content_type_json_api/post_by_int_request_body.md) | **post** /requestBody/postByIntRequestBody | +[**post_by_int_response_body_for_content_types**](content_type_json_api/post_by_int_response_body_for_content_types.md) | **post** /responseBody/postByIntResponseBodyForContentTypes | +[**post_by_number_request_body**](content_type_json_api/post_by_number_request_body.md) | **post** /requestBody/postByNumberRequestBody | +[**post_by_number_response_body_for_content_types**](content_type_json_api/post_by_number_response_body_for_content_types.md) | **post** /responseBody/postByNumberResponseBodyForContentTypes | +[**post_by_small_number_request_body**](content_type_json_api/post_by_small_number_request_body.md) | **post** /requestBody/postBySmallNumberRequestBody | +[**post_by_small_number_response_body_for_content_types**](content_type_json_api/post_by_small_number_response_body_for_content_types.md) | **post** /responseBody/postBySmallNumberResponseBodyForContentTypes | +[**post_date_time_format_request_body**](content_type_json_api/post_date_time_format_request_body.md) | **post** /requestBody/postDateTimeFormatRequestBody | +[**post_date_time_format_response_body_for_content_types**](content_type_json_api/post_date_time_format_response_body_for_content_types.md) | **post** /responseBody/postDateTimeFormatResponseBodyForContentTypes | +[**post_email_format_request_body**](content_type_json_api/post_email_format_request_body.md) | **post** /requestBody/postEmailFormatRequestBody | +[**post_email_format_response_body_for_content_types**](content_type_json_api/post_email_format_response_body_for_content_types.md) | **post** /responseBody/postEmailFormatResponseBodyForContentTypes | +[**post_enum_with0_does_not_match_false_request_body**](content_type_json_api/post_enum_with0_does_not_match_false_request_body.md) | **post** /requestBody/postEnumWith0DoesNotMatchFalseRequestBody | +[**post_enum_with0_does_not_match_false_response_body_for_content_types**](content_type_json_api/post_enum_with0_does_not_match_false_response_body_for_content_types.md) | **post** /responseBody/postEnumWith0DoesNotMatchFalseResponseBodyForContentTypes | +[**post_enum_with1_does_not_match_true_request_body**](content_type_json_api/post_enum_with1_does_not_match_true_request_body.md) | **post** /requestBody/postEnumWith1DoesNotMatchTrueRequestBody | +[**post_enum_with1_does_not_match_true_response_body_for_content_types**](content_type_json_api/post_enum_with1_does_not_match_true_response_body_for_content_types.md) | **post** /responseBody/postEnumWith1DoesNotMatchTrueResponseBodyForContentTypes | +[**post_enum_with_escaped_characters_request_body**](content_type_json_api/post_enum_with_escaped_characters_request_body.md) | **post** /requestBody/postEnumWithEscapedCharactersRequestBody | +[**post_enum_with_escaped_characters_response_body_for_content_types**](content_type_json_api/post_enum_with_escaped_characters_response_body_for_content_types.md) | **post** /responseBody/postEnumWithEscapedCharactersResponseBodyForContentTypes | +[**post_enum_with_false_does_not_match0_request_body**](content_type_json_api/post_enum_with_false_does_not_match0_request_body.md) | **post** /requestBody/postEnumWithFalseDoesNotMatch0RequestBody | +[**post_enum_with_false_does_not_match0_response_body_for_content_types**](content_type_json_api/post_enum_with_false_does_not_match0_response_body_for_content_types.md) | **post** /responseBody/postEnumWithFalseDoesNotMatch0ResponseBodyForContentTypes | +[**post_enum_with_true_does_not_match1_request_body**](content_type_json_api/post_enum_with_true_does_not_match1_request_body.md) | **post** /requestBody/postEnumWithTrueDoesNotMatch1RequestBody | +[**post_enum_with_true_does_not_match1_response_body_for_content_types**](content_type_json_api/post_enum_with_true_does_not_match1_response_body_for_content_types.md) | **post** /responseBody/postEnumWithTrueDoesNotMatch1ResponseBodyForContentTypes | +[**post_enums_in_properties_request_body**](content_type_json_api/post_enums_in_properties_request_body.md) | **post** /requestBody/postEnumsInPropertiesRequestBody | +[**post_enums_in_properties_response_body_for_content_types**](content_type_json_api/post_enums_in_properties_response_body_for_content_types.md) | **post** /responseBody/postEnumsInPropertiesResponseBodyForContentTypes | +[**post_forbidden_property_request_body**](content_type_json_api/post_forbidden_property_request_body.md) | **post** /requestBody/postForbiddenPropertyRequestBody | +[**post_forbidden_property_response_body_for_content_types**](content_type_json_api/post_forbidden_property_response_body_for_content_types.md) | **post** /responseBody/postForbiddenPropertyResponseBodyForContentTypes | +[**post_hostname_format_request_body**](content_type_json_api/post_hostname_format_request_body.md) | **post** /requestBody/postHostnameFormatRequestBody | +[**post_hostname_format_response_body_for_content_types**](content_type_json_api/post_hostname_format_response_body_for_content_types.md) | **post** /responseBody/postHostnameFormatResponseBodyForContentTypes | +[**post_integer_type_matches_integers_request_body**](content_type_json_api/post_integer_type_matches_integers_request_body.md) | **post** /requestBody/postIntegerTypeMatchesIntegersRequestBody | +[**post_integer_type_matches_integers_response_body_for_content_types**](content_type_json_api/post_integer_type_matches_integers_response_body_for_content_types.md) | **post** /responseBody/postIntegerTypeMatchesIntegersResponseBodyForContentTypes | +[**post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body**](content_type_json_api/post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body.md) | **post** /requestBody/postInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody | +[**post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types**](content_type_json_api/post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types.md) | **post** /responseBody/postInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfResponseBodyForContentTypes | +[**post_invalid_string_value_for_default_request_body**](content_type_json_api/post_invalid_string_value_for_default_request_body.md) | **post** /requestBody/postInvalidStringValueForDefaultRequestBody | +[**post_invalid_string_value_for_default_response_body_for_content_types**](content_type_json_api/post_invalid_string_value_for_default_response_body_for_content_types.md) | **post** /responseBody/postInvalidStringValueForDefaultResponseBodyForContentTypes | +[**post_ipv4_format_request_body**](content_type_json_api/post_ipv4_format_request_body.md) | **post** /requestBody/postIpv4FormatRequestBody | +[**post_ipv4_format_response_body_for_content_types**](content_type_json_api/post_ipv4_format_response_body_for_content_types.md) | **post** /responseBody/postIpv4FormatResponseBodyForContentTypes | +[**post_ipv6_format_request_body**](content_type_json_api/post_ipv6_format_request_body.md) | **post** /requestBody/postIpv6FormatRequestBody | +[**post_ipv6_format_response_body_for_content_types**](content_type_json_api/post_ipv6_format_response_body_for_content_types.md) | **post** /responseBody/postIpv6FormatResponseBodyForContentTypes | +[**post_json_pointer_format_request_body**](content_type_json_api/post_json_pointer_format_request_body.md) | **post** /requestBody/postJsonPointerFormatRequestBody | +[**post_json_pointer_format_response_body_for_content_types**](content_type_json_api/post_json_pointer_format_response_body_for_content_types.md) | **post** /responseBody/postJsonPointerFormatResponseBodyForContentTypes | +[**post_maximum_validation_request_body**](content_type_json_api/post_maximum_validation_request_body.md) | **post** /requestBody/postMaximumValidationRequestBody | +[**post_maximum_validation_response_body_for_content_types**](content_type_json_api/post_maximum_validation_response_body_for_content_types.md) | **post** /responseBody/postMaximumValidationResponseBodyForContentTypes | +[**post_maximum_validation_with_unsigned_integer_request_body**](content_type_json_api/post_maximum_validation_with_unsigned_integer_request_body.md) | **post** /requestBody/postMaximumValidationWithUnsignedIntegerRequestBody | +[**post_maximum_validation_with_unsigned_integer_response_body_for_content_types**](content_type_json_api/post_maximum_validation_with_unsigned_integer_response_body_for_content_types.md) | **post** /responseBody/postMaximumValidationWithUnsignedIntegerResponseBodyForContentTypes | +[**post_maxitems_validation_request_body**](content_type_json_api/post_maxitems_validation_request_body.md) | **post** /requestBody/postMaxitemsValidationRequestBody | +[**post_maxitems_validation_response_body_for_content_types**](content_type_json_api/post_maxitems_validation_response_body_for_content_types.md) | **post** /responseBody/postMaxitemsValidationResponseBodyForContentTypes | +[**post_maxlength_validation_request_body**](content_type_json_api/post_maxlength_validation_request_body.md) | **post** /requestBody/postMaxlengthValidationRequestBody | +[**post_maxlength_validation_response_body_for_content_types**](content_type_json_api/post_maxlength_validation_response_body_for_content_types.md) | **post** /responseBody/postMaxlengthValidationResponseBodyForContentTypes | +[**post_maxproperties0_means_the_object_is_empty_request_body**](content_type_json_api/post_maxproperties0_means_the_object_is_empty_request_body.md) | **post** /requestBody/postMaxproperties0MeansTheObjectIsEmptyRequestBody | +[**post_maxproperties0_means_the_object_is_empty_response_body_for_content_types**](content_type_json_api/post_maxproperties0_means_the_object_is_empty_response_body_for_content_types.md) | **post** /responseBody/postMaxproperties0MeansTheObjectIsEmptyResponseBodyForContentTypes | +[**post_maxproperties_validation_request_body**](content_type_json_api/post_maxproperties_validation_request_body.md) | **post** /requestBody/postMaxpropertiesValidationRequestBody | +[**post_maxproperties_validation_response_body_for_content_types**](content_type_json_api/post_maxproperties_validation_response_body_for_content_types.md) | **post** /responseBody/postMaxpropertiesValidationResponseBodyForContentTypes | +[**post_minimum_validation_request_body**](content_type_json_api/post_minimum_validation_request_body.md) | **post** /requestBody/postMinimumValidationRequestBody | +[**post_minimum_validation_response_body_for_content_types**](content_type_json_api/post_minimum_validation_response_body_for_content_types.md) | **post** /responseBody/postMinimumValidationResponseBodyForContentTypes | +[**post_minimum_validation_with_signed_integer_request_body**](content_type_json_api/post_minimum_validation_with_signed_integer_request_body.md) | **post** /requestBody/postMinimumValidationWithSignedIntegerRequestBody | +[**post_minimum_validation_with_signed_integer_response_body_for_content_types**](content_type_json_api/post_minimum_validation_with_signed_integer_response_body_for_content_types.md) | **post** /responseBody/postMinimumValidationWithSignedIntegerResponseBodyForContentTypes | +[**post_minitems_validation_request_body**](content_type_json_api/post_minitems_validation_request_body.md) | **post** /requestBody/postMinitemsValidationRequestBody | +[**post_minitems_validation_response_body_for_content_types**](content_type_json_api/post_minitems_validation_response_body_for_content_types.md) | **post** /responseBody/postMinitemsValidationResponseBodyForContentTypes | +[**post_minlength_validation_request_body**](content_type_json_api/post_minlength_validation_request_body.md) | **post** /requestBody/postMinlengthValidationRequestBody | +[**post_minlength_validation_response_body_for_content_types**](content_type_json_api/post_minlength_validation_response_body_for_content_types.md) | **post** /responseBody/postMinlengthValidationResponseBodyForContentTypes | +[**post_minproperties_validation_request_body**](content_type_json_api/post_minproperties_validation_request_body.md) | **post** /requestBody/postMinpropertiesValidationRequestBody | +[**post_minproperties_validation_response_body_for_content_types**](content_type_json_api/post_minproperties_validation_response_body_for_content_types.md) | **post** /responseBody/postMinpropertiesValidationResponseBodyForContentTypes | +[**post_nested_allof_to_check_validation_semantics_request_body**](content_type_json_api/post_nested_allof_to_check_validation_semantics_request_body.md) | **post** /requestBody/postNestedAllofToCheckValidationSemanticsRequestBody | +[**post_nested_allof_to_check_validation_semantics_response_body_for_content_types**](content_type_json_api/post_nested_allof_to_check_validation_semantics_response_body_for_content_types.md) | **post** /responseBody/postNestedAllofToCheckValidationSemanticsResponseBodyForContentTypes | +[**post_nested_anyof_to_check_validation_semantics_request_body**](content_type_json_api/post_nested_anyof_to_check_validation_semantics_request_body.md) | **post** /requestBody/postNestedAnyofToCheckValidationSemanticsRequestBody | +[**post_nested_anyof_to_check_validation_semantics_response_body_for_content_types**](content_type_json_api/post_nested_anyof_to_check_validation_semantics_response_body_for_content_types.md) | **post** /responseBody/postNestedAnyofToCheckValidationSemanticsResponseBodyForContentTypes | +[**post_nested_items_request_body**](content_type_json_api/post_nested_items_request_body.md) | **post** /requestBody/postNestedItemsRequestBody | +[**post_nested_items_response_body_for_content_types**](content_type_json_api/post_nested_items_response_body_for_content_types.md) | **post** /responseBody/postNestedItemsResponseBodyForContentTypes | +[**post_nested_oneof_to_check_validation_semantics_request_body**](content_type_json_api/post_nested_oneof_to_check_validation_semantics_request_body.md) | **post** /requestBody/postNestedOneofToCheckValidationSemanticsRequestBody | +[**post_nested_oneof_to_check_validation_semantics_response_body_for_content_types**](content_type_json_api/post_nested_oneof_to_check_validation_semantics_response_body_for_content_types.md) | **post** /responseBody/postNestedOneofToCheckValidationSemanticsResponseBodyForContentTypes | +[**post_not_more_complex_schema_request_body**](content_type_json_api/post_not_more_complex_schema_request_body.md) | **post** /requestBody/postNotMoreComplexSchemaRequestBody | +[**post_not_more_complex_schema_response_body_for_content_types**](content_type_json_api/post_not_more_complex_schema_response_body_for_content_types.md) | **post** /responseBody/postNotMoreComplexSchemaResponseBodyForContentTypes | +[**post_not_request_body**](content_type_json_api/post_not_request_body.md) | **post** /requestBody/postNotRequestBody | +[**post_not_response_body_for_content_types**](content_type_json_api/post_not_response_body_for_content_types.md) | **post** /responseBody/postNotResponseBodyForContentTypes | +[**post_nul_characters_in_strings_request_body**](content_type_json_api/post_nul_characters_in_strings_request_body.md) | **post** /requestBody/postNulCharactersInStringsRequestBody | +[**post_nul_characters_in_strings_response_body_for_content_types**](content_type_json_api/post_nul_characters_in_strings_response_body_for_content_types.md) | **post** /responseBody/postNulCharactersInStringsResponseBodyForContentTypes | +[**post_null_type_matches_only_the_null_object_request_body**](content_type_json_api/post_null_type_matches_only_the_null_object_request_body.md) | **post** /requestBody/postNullTypeMatchesOnlyTheNullObjectRequestBody | +[**post_null_type_matches_only_the_null_object_response_body_for_content_types**](content_type_json_api/post_null_type_matches_only_the_null_object_response_body_for_content_types.md) | **post** /responseBody/postNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes | +[**post_number_type_matches_numbers_request_body**](content_type_json_api/post_number_type_matches_numbers_request_body.md) | **post** /requestBody/postNumberTypeMatchesNumbersRequestBody | +[**post_number_type_matches_numbers_response_body_for_content_types**](content_type_json_api/post_number_type_matches_numbers_response_body_for_content_types.md) | **post** /responseBody/postNumberTypeMatchesNumbersResponseBodyForContentTypes | +[**post_object_properties_validation_request_body**](content_type_json_api/post_object_properties_validation_request_body.md) | **post** /requestBody/postObjectPropertiesValidationRequestBody | +[**post_object_properties_validation_response_body_for_content_types**](content_type_json_api/post_object_properties_validation_response_body_for_content_types.md) | **post** /responseBody/postObjectPropertiesValidationResponseBodyForContentTypes | +[**post_object_type_matches_objects_request_body**](content_type_json_api/post_object_type_matches_objects_request_body.md) | **post** /requestBody/postObjectTypeMatchesObjectsRequestBody | +[**post_object_type_matches_objects_response_body_for_content_types**](content_type_json_api/post_object_type_matches_objects_response_body_for_content_types.md) | **post** /responseBody/postObjectTypeMatchesObjectsResponseBodyForContentTypes | +[**post_oneof_complex_types_request_body**](content_type_json_api/post_oneof_complex_types_request_body.md) | **post** /requestBody/postOneofComplexTypesRequestBody | +[**post_oneof_complex_types_response_body_for_content_types**](content_type_json_api/post_oneof_complex_types_response_body_for_content_types.md) | **post** /responseBody/postOneofComplexTypesResponseBodyForContentTypes | +[**post_oneof_request_body**](content_type_json_api/post_oneof_request_body.md) | **post** /requestBody/postOneofRequestBody | +[**post_oneof_response_body_for_content_types**](content_type_json_api/post_oneof_response_body_for_content_types.md) | **post** /responseBody/postOneofResponseBodyForContentTypes | +[**post_oneof_with_base_schema_request_body**](content_type_json_api/post_oneof_with_base_schema_request_body.md) | **post** /requestBody/postOneofWithBaseSchemaRequestBody | +[**post_oneof_with_base_schema_response_body_for_content_types**](content_type_json_api/post_oneof_with_base_schema_response_body_for_content_types.md) | **post** /responseBody/postOneofWithBaseSchemaResponseBodyForContentTypes | +[**post_oneof_with_empty_schema_request_body**](content_type_json_api/post_oneof_with_empty_schema_request_body.md) | **post** /requestBody/postOneofWithEmptySchemaRequestBody | +[**post_oneof_with_empty_schema_response_body_for_content_types**](content_type_json_api/post_oneof_with_empty_schema_response_body_for_content_types.md) | **post** /responseBody/postOneofWithEmptySchemaResponseBodyForContentTypes | +[**post_oneof_with_required_request_body**](content_type_json_api/post_oneof_with_required_request_body.md) | **post** /requestBody/postOneofWithRequiredRequestBody | +[**post_oneof_with_required_response_body_for_content_types**](content_type_json_api/post_oneof_with_required_response_body_for_content_types.md) | **post** /responseBody/postOneofWithRequiredResponseBodyForContentTypes | +[**post_pattern_is_not_anchored_request_body**](content_type_json_api/post_pattern_is_not_anchored_request_body.md) | **post** /requestBody/postPatternIsNotAnchoredRequestBody | +[**post_pattern_is_not_anchored_response_body_for_content_types**](content_type_json_api/post_pattern_is_not_anchored_response_body_for_content_types.md) | **post** /responseBody/postPatternIsNotAnchoredResponseBodyForContentTypes | +[**post_pattern_validation_request_body**](content_type_json_api/post_pattern_validation_request_body.md) | **post** /requestBody/postPatternValidationRequestBody | +[**post_pattern_validation_response_body_for_content_types**](content_type_json_api/post_pattern_validation_response_body_for_content_types.md) | **post** /responseBody/postPatternValidationResponseBodyForContentTypes | +[**post_properties_with_escaped_characters_request_body**](content_type_json_api/post_properties_with_escaped_characters_request_body.md) | **post** /requestBody/postPropertiesWithEscapedCharactersRequestBody | +[**post_properties_with_escaped_characters_response_body_for_content_types**](content_type_json_api/post_properties_with_escaped_characters_response_body_for_content_types.md) | **post** /responseBody/postPropertiesWithEscapedCharactersResponseBodyForContentTypes | +[**post_property_named_ref_that_is_not_a_reference_request_body**](content_type_json_api/post_property_named_ref_that_is_not_a_reference_request_body.md) | **post** /requestBody/postPropertyNamedRefThatIsNotAReferenceRequestBody | +[**post_property_named_ref_that_is_not_a_reference_response_body_for_content_types**](content_type_json_api/post_property_named_ref_that_is_not_a_reference_response_body_for_content_types.md) | **post** /responseBody/postPropertyNamedRefThatIsNotAReferenceResponseBodyForContentTypes | +[**post_ref_in_additionalproperties_request_body**](content_type_json_api/post_ref_in_additionalproperties_request_body.md) | **post** /requestBody/postRefInAdditionalpropertiesRequestBody | +[**post_ref_in_additionalproperties_response_body_for_content_types**](content_type_json_api/post_ref_in_additionalproperties_response_body_for_content_types.md) | **post** /responseBody/postRefInAdditionalpropertiesResponseBodyForContentTypes | +[**post_ref_in_allof_request_body**](content_type_json_api/post_ref_in_allof_request_body.md) | **post** /requestBody/postRefInAllofRequestBody | +[**post_ref_in_allof_response_body_for_content_types**](content_type_json_api/post_ref_in_allof_response_body_for_content_types.md) | **post** /responseBody/postRefInAllofResponseBodyForContentTypes | +[**post_ref_in_anyof_request_body**](content_type_json_api/post_ref_in_anyof_request_body.md) | **post** /requestBody/postRefInAnyofRequestBody | +[**post_ref_in_anyof_response_body_for_content_types**](content_type_json_api/post_ref_in_anyof_response_body_for_content_types.md) | **post** /responseBody/postRefInAnyofResponseBodyForContentTypes | +[**post_ref_in_items_request_body**](content_type_json_api/post_ref_in_items_request_body.md) | **post** /requestBody/postRefInItemsRequestBody | +[**post_ref_in_items_response_body_for_content_types**](content_type_json_api/post_ref_in_items_response_body_for_content_types.md) | **post** /responseBody/postRefInItemsResponseBodyForContentTypes | +[**post_ref_in_not_request_body**](content_type_json_api/post_ref_in_not_request_body.md) | **post** /requestBody/postRefInNotRequestBody | +[**post_ref_in_not_response_body_for_content_types**](content_type_json_api/post_ref_in_not_response_body_for_content_types.md) | **post** /responseBody/postRefInNotResponseBodyForContentTypes | +[**post_ref_in_oneof_request_body**](content_type_json_api/post_ref_in_oneof_request_body.md) | **post** /requestBody/postRefInOneofRequestBody | +[**post_ref_in_oneof_response_body_for_content_types**](content_type_json_api/post_ref_in_oneof_response_body_for_content_types.md) | **post** /responseBody/postRefInOneofResponseBodyForContentTypes | +[**post_ref_in_property_request_body**](content_type_json_api/post_ref_in_property_request_body.md) | **post** /requestBody/postRefInPropertyRequestBody | +[**post_ref_in_property_response_body_for_content_types**](content_type_json_api/post_ref_in_property_response_body_for_content_types.md) | **post** /responseBody/postRefInPropertyResponseBodyForContentTypes | +[**post_required_default_validation_request_body**](content_type_json_api/post_required_default_validation_request_body.md) | **post** /requestBody/postRequiredDefaultValidationRequestBody | +[**post_required_default_validation_response_body_for_content_types**](content_type_json_api/post_required_default_validation_response_body_for_content_types.md) | **post** /responseBody/postRequiredDefaultValidationResponseBodyForContentTypes | +[**post_required_validation_request_body**](content_type_json_api/post_required_validation_request_body.md) | **post** /requestBody/postRequiredValidationRequestBody | +[**post_required_validation_response_body_for_content_types**](content_type_json_api/post_required_validation_response_body_for_content_types.md) | **post** /responseBody/postRequiredValidationResponseBodyForContentTypes | +[**post_required_with_empty_array_request_body**](content_type_json_api/post_required_with_empty_array_request_body.md) | **post** /requestBody/postRequiredWithEmptyArrayRequestBody | +[**post_required_with_empty_array_response_body_for_content_types**](content_type_json_api/post_required_with_empty_array_response_body_for_content_types.md) | **post** /responseBody/postRequiredWithEmptyArrayResponseBodyForContentTypes | +[**post_required_with_escaped_characters_request_body**](content_type_json_api/post_required_with_escaped_characters_request_body.md) | **post** /requestBody/postRequiredWithEscapedCharactersRequestBody | +[**post_required_with_escaped_characters_response_body_for_content_types**](content_type_json_api/post_required_with_escaped_characters_response_body_for_content_types.md) | **post** /responseBody/postRequiredWithEscapedCharactersResponseBodyForContentTypes | +[**post_simple_enum_validation_request_body**](content_type_json_api/post_simple_enum_validation_request_body.md) | **post** /requestBody/postSimpleEnumValidationRequestBody | +[**post_simple_enum_validation_response_body_for_content_types**](content_type_json_api/post_simple_enum_validation_response_body_for_content_types.md) | **post** /responseBody/postSimpleEnumValidationResponseBodyForContentTypes | +[**post_string_type_matches_strings_request_body**](content_type_json_api/post_string_type_matches_strings_request_body.md) | **post** /requestBody/postStringTypeMatchesStringsRequestBody | +[**post_string_type_matches_strings_response_body_for_content_types**](content_type_json_api/post_string_type_matches_strings_response_body_for_content_types.md) | **post** /responseBody/postStringTypeMatchesStringsResponseBodyForContentTypes | +[**post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body**](content_type_json_api/post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.md) | **post** /requestBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody | +[**post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types**](content_type_json_api/post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types.md) | **post** /responseBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyForContentTypes | +[**post_uniqueitems_false_validation_request_body**](content_type_json_api/post_uniqueitems_false_validation_request_body.md) | **post** /requestBody/postUniqueitemsFalseValidationRequestBody | +[**post_uniqueitems_false_validation_response_body_for_content_types**](content_type_json_api/post_uniqueitems_false_validation_response_body_for_content_types.md) | **post** /responseBody/postUniqueitemsFalseValidationResponseBodyForContentTypes | +[**post_uniqueitems_validation_request_body**](content_type_json_api/post_uniqueitems_validation_request_body.md) | **post** /requestBody/postUniqueitemsValidationRequestBody | +[**post_uniqueitems_validation_response_body_for_content_types**](content_type_json_api/post_uniqueitems_validation_response_body_for_content_types.md) | **post** /responseBody/postUniqueitemsValidationResponseBodyForContentTypes | +[**post_uri_format_request_body**](content_type_json_api/post_uri_format_request_body.md) | **post** /requestBody/postUriFormatRequestBody | +[**post_uri_format_response_body_for_content_types**](content_type_json_api/post_uri_format_response_body_for_content_types.md) | **post** /responseBody/postUriFormatResponseBodyForContentTypes | +[**post_uri_reference_format_request_body**](content_type_json_api/post_uri_reference_format_request_body.md) | **post** /requestBody/postUriReferenceFormatRequestBody | +[**post_uri_reference_format_response_body_for_content_types**](content_type_json_api/post_uri_reference_format_response_body_for_content_types.md) | **post** /responseBody/postUriReferenceFormatResponseBodyForContentTypes | +[**post_uri_template_format_request_body**](content_type_json_api/post_uri_template_format_request_body.md) | **post** /requestBody/postUriTemplateFormatRequestBody | +[**post_uri_template_format_response_body_for_content_types**](content_type_json_api/post_uri_template_format_response_body_for_content_types.md) | **post** /responseBody/postUriTemplateFormatResponseBodyForContentTypes | + +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/DefaultApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/DefaultApi.md index 4fb214ed39a..7abfd4b3760 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/DefaultApi.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/DefaultApi.md @@ -1,276 +1,13 @@ - + # unit_test_api.apis.tags.default_api.DefaultApi All URIs are relative to *https://someserver.com/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**post_invalid_string_value_for_default_request_body**](#post_invalid_string_value_for_default_request_body) | **post** /requestBody/postInvalidStringValueForDefaultRequestBody | -[**post_invalid_string_value_for_default_response_body_for_content_types**](#post_invalid_string_value_for_default_response_body_for_content_types) | **post** /responseBody/postInvalidStringValueForDefaultResponseBodyForContentTypes | -[**post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body**](#post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body) | **post** /requestBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody | -[**post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types**](#post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types) | **post** /responseBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyForContentTypes | - -# **post_invalid_string_value_for_default_request_body** - -> post_invalid_string_value_for_default_request_body(invalid_string_value_for_default) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import default_api -from unit_test_api.model.invalid_string_value_for_default import InvalidStringValueForDefault -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = default_api.DefaultApi(api_client) - - # example passing only required values which don't have defaults set - body = InvalidStringValueForDefault(None) - try: - api_response = api_instance.post_invalid_string_value_for_default_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling DefaultApi->post_invalid_string_value_for_default_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**InvalidStringValueForDefault**](../../models/InvalidStringValueForDefault.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_invalid_string_value_for_default_request_body.ApiResponseFor200) | success - -#### post_invalid_string_value_for_default_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_invalid_string_value_for_default_response_body_for_content_types** - -> InvalidStringValueForDefault post_invalid_string_value_for_default_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import default_api -from unit_test_api.model.invalid_string_value_for_default import InvalidStringValueForDefault -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = default_api.DefaultApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_invalid_string_value_for_default_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling DefaultApi->post_invalid_string_value_for_default_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_invalid_string_value_for_default_response_body_for_content_types.ApiResponseFor200) | success - -#### post_invalid_string_value_for_default_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**InvalidStringValueForDefault**](../../models/InvalidStringValueForDefault.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body** - -> post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body(the_default_keyword_does_not_do_anything_if_the_property_is_missing) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import default_api -from unit_test_api.model.the_default_keyword_does_not_do_anything_if_the_property_is_missing import TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = default_api.DefaultApi(api_client) - - # example passing only required values which don't have defaults set - body = TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing( - alpha=5, - ) - try: - api_response = api_instance.post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling DefaultApi->post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing**](../../models/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.ApiResponseFor200) | success - -#### post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types** - -> TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import default_api -from unit_test_api.model.the_default_keyword_does_not_do_anything_if_the_property_is_missing import TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = default_api.DefaultApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling DefaultApi->post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types.ApiResponseFor200) | success - -#### post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing**](../../models/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) +[**post_invalid_string_value_for_default_request_body**](default_api/post_invalid_string_value_for_default_request_body.md) | **post** /requestBody/postInvalidStringValueForDefaultRequestBody | +[**post_invalid_string_value_for_default_response_body_for_content_types**](default_api/post_invalid_string_value_for_default_response_body_for_content_types.md) | **post** /responseBody/postInvalidStringValueForDefaultResponseBodyForContentTypes | +[**post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body**](default_api/post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.md) | **post** /requestBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody | +[**post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types**](default_api/post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types.md) | **post** /responseBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyForContentTypes | +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/EnumApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/EnumApi.md index ec345869090..78e23a955c4 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/EnumApi.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/EnumApi.md @@ -1,1075 +1,25 @@ - + # unit_test_api.apis.tags.enum_api.EnumApi All URIs are relative to *https://someserver.com/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**post_enum_with0_does_not_match_false_request_body**](#post_enum_with0_does_not_match_false_request_body) | **post** /requestBody/postEnumWith0DoesNotMatchFalseRequestBody | -[**post_enum_with0_does_not_match_false_response_body_for_content_types**](#post_enum_with0_does_not_match_false_response_body_for_content_types) | **post** /responseBody/postEnumWith0DoesNotMatchFalseResponseBodyForContentTypes | -[**post_enum_with1_does_not_match_true_request_body**](#post_enum_with1_does_not_match_true_request_body) | **post** /requestBody/postEnumWith1DoesNotMatchTrueRequestBody | -[**post_enum_with1_does_not_match_true_response_body_for_content_types**](#post_enum_with1_does_not_match_true_response_body_for_content_types) | **post** /responseBody/postEnumWith1DoesNotMatchTrueResponseBodyForContentTypes | -[**post_enum_with_escaped_characters_request_body**](#post_enum_with_escaped_characters_request_body) | **post** /requestBody/postEnumWithEscapedCharactersRequestBody | -[**post_enum_with_escaped_characters_response_body_for_content_types**](#post_enum_with_escaped_characters_response_body_for_content_types) | **post** /responseBody/postEnumWithEscapedCharactersResponseBodyForContentTypes | -[**post_enum_with_false_does_not_match0_request_body**](#post_enum_with_false_does_not_match0_request_body) | **post** /requestBody/postEnumWithFalseDoesNotMatch0RequestBody | -[**post_enum_with_false_does_not_match0_response_body_for_content_types**](#post_enum_with_false_does_not_match0_response_body_for_content_types) | **post** /responseBody/postEnumWithFalseDoesNotMatch0ResponseBodyForContentTypes | -[**post_enum_with_true_does_not_match1_request_body**](#post_enum_with_true_does_not_match1_request_body) | **post** /requestBody/postEnumWithTrueDoesNotMatch1RequestBody | -[**post_enum_with_true_does_not_match1_response_body_for_content_types**](#post_enum_with_true_does_not_match1_response_body_for_content_types) | **post** /responseBody/postEnumWithTrueDoesNotMatch1ResponseBodyForContentTypes | -[**post_enums_in_properties_request_body**](#post_enums_in_properties_request_body) | **post** /requestBody/postEnumsInPropertiesRequestBody | -[**post_enums_in_properties_response_body_for_content_types**](#post_enums_in_properties_response_body_for_content_types) | **post** /responseBody/postEnumsInPropertiesResponseBodyForContentTypes | -[**post_nul_characters_in_strings_request_body**](#post_nul_characters_in_strings_request_body) | **post** /requestBody/postNulCharactersInStringsRequestBody | -[**post_nul_characters_in_strings_response_body_for_content_types**](#post_nul_characters_in_strings_response_body_for_content_types) | **post** /responseBody/postNulCharactersInStringsResponseBodyForContentTypes | -[**post_simple_enum_validation_request_body**](#post_simple_enum_validation_request_body) | **post** /requestBody/postSimpleEnumValidationRequestBody | -[**post_simple_enum_validation_response_body_for_content_types**](#post_simple_enum_validation_response_body_for_content_types) | **post** /responseBody/postSimpleEnumValidationResponseBodyForContentTypes | - -# **post_enum_with0_does_not_match_false_request_body** - -> post_enum_with0_does_not_match_false_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import enum_api -from unit_test_api.model.enum_with0_does_not_match_false import EnumWith0DoesNotMatchFalse -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = enum_api.EnumApi(api_client) - - # example passing only required values which don't have defaults set - body = EnumWith0DoesNotMatchFalse(0) - try: - api_response = api_instance.post_enum_with0_does_not_match_false_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling EnumApi->post_enum_with0_does_not_match_false_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**EnumWith0DoesNotMatchFalse**](../../models/EnumWith0DoesNotMatchFalse.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_enum_with0_does_not_match_false_request_body.ApiResponseFor200) | success - -#### post_enum_with0_does_not_match_false_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_enum_with0_does_not_match_false_response_body_for_content_types** - -> EnumWith0DoesNotMatchFalse post_enum_with0_does_not_match_false_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import enum_api -from unit_test_api.model.enum_with0_does_not_match_false import EnumWith0DoesNotMatchFalse -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = enum_api.EnumApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_enum_with0_does_not_match_false_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling EnumApi->post_enum_with0_does_not_match_false_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_enum_with0_does_not_match_false_response_body_for_content_types.ApiResponseFor200) | success - -#### post_enum_with0_does_not_match_false_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**EnumWith0DoesNotMatchFalse**](../../models/EnumWith0DoesNotMatchFalse.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_enum_with1_does_not_match_true_request_body** - -> post_enum_with1_does_not_match_true_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import enum_api -from unit_test_api.model.enum_with1_does_not_match_true import EnumWith1DoesNotMatchTrue -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = enum_api.EnumApi(api_client) - - # example passing only required values which don't have defaults set - body = EnumWith1DoesNotMatchTrue(1) - try: - api_response = api_instance.post_enum_with1_does_not_match_true_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling EnumApi->post_enum_with1_does_not_match_true_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**EnumWith1DoesNotMatchTrue**](../../models/EnumWith1DoesNotMatchTrue.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_enum_with1_does_not_match_true_request_body.ApiResponseFor200) | success - -#### post_enum_with1_does_not_match_true_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_enum_with1_does_not_match_true_response_body_for_content_types** - -> EnumWith1DoesNotMatchTrue post_enum_with1_does_not_match_true_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import enum_api -from unit_test_api.model.enum_with1_does_not_match_true import EnumWith1DoesNotMatchTrue -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = enum_api.EnumApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_enum_with1_does_not_match_true_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling EnumApi->post_enum_with1_does_not_match_true_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_enum_with1_does_not_match_true_response_body_for_content_types.ApiResponseFor200) | success - -#### post_enum_with1_does_not_match_true_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**EnumWith1DoesNotMatchTrue**](../../models/EnumWith1DoesNotMatchTrue.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_enum_with_escaped_characters_request_body** - -> post_enum_with_escaped_characters_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import enum_api -from unit_test_api.model.enum_with_escaped_characters import EnumWithEscapedCharacters -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = enum_api.EnumApi(api_client) - - # example passing only required values which don't have defaults set - body = EnumWithEscapedCharacters("foo\nbar") - try: - api_response = api_instance.post_enum_with_escaped_characters_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling EnumApi->post_enum_with_escaped_characters_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**EnumWithEscapedCharacters**](../../models/EnumWithEscapedCharacters.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_enum_with_escaped_characters_request_body.ApiResponseFor200) | success - -#### post_enum_with_escaped_characters_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_enum_with_escaped_characters_response_body_for_content_types** - -> EnumWithEscapedCharacters post_enum_with_escaped_characters_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import enum_api -from unit_test_api.model.enum_with_escaped_characters import EnumWithEscapedCharacters -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = enum_api.EnumApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_enum_with_escaped_characters_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling EnumApi->post_enum_with_escaped_characters_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_enum_with_escaped_characters_response_body_for_content_types.ApiResponseFor200) | success - -#### post_enum_with_escaped_characters_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**EnumWithEscapedCharacters**](../../models/EnumWithEscapedCharacters.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_enum_with_false_does_not_match0_request_body** - -> post_enum_with_false_does_not_match0_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import enum_api -from unit_test_api.model.enum_with_false_does_not_match0 import EnumWithFalseDoesNotMatch0 -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = enum_api.EnumApi(api_client) - - # example passing only required values which don't have defaults set - body = EnumWithFalseDoesNotMatch0(False) - try: - api_response = api_instance.post_enum_with_false_does_not_match0_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling EnumApi->post_enum_with_false_does_not_match0_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**EnumWithFalseDoesNotMatch0**](../../models/EnumWithFalseDoesNotMatch0.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_enum_with_false_does_not_match0_request_body.ApiResponseFor200) | success - -#### post_enum_with_false_does_not_match0_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_enum_with_false_does_not_match0_response_body_for_content_types** - -> EnumWithFalseDoesNotMatch0 post_enum_with_false_does_not_match0_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import enum_api -from unit_test_api.model.enum_with_false_does_not_match0 import EnumWithFalseDoesNotMatch0 -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = enum_api.EnumApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_enum_with_false_does_not_match0_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling EnumApi->post_enum_with_false_does_not_match0_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_enum_with_false_does_not_match0_response_body_for_content_types.ApiResponseFor200) | success - -#### post_enum_with_false_does_not_match0_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**EnumWithFalseDoesNotMatch0**](../../models/EnumWithFalseDoesNotMatch0.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_enum_with_true_does_not_match1_request_body** - -> post_enum_with_true_does_not_match1_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import enum_api -from unit_test_api.model.enum_with_true_does_not_match1 import EnumWithTrueDoesNotMatch1 -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = enum_api.EnumApi(api_client) - - # example passing only required values which don't have defaults set - body = EnumWithTrueDoesNotMatch1(True) - try: - api_response = api_instance.post_enum_with_true_does_not_match1_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling EnumApi->post_enum_with_true_does_not_match1_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**EnumWithTrueDoesNotMatch1**](../../models/EnumWithTrueDoesNotMatch1.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_enum_with_true_does_not_match1_request_body.ApiResponseFor200) | success - -#### post_enum_with_true_does_not_match1_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_enum_with_true_does_not_match1_response_body_for_content_types** - -> EnumWithTrueDoesNotMatch1 post_enum_with_true_does_not_match1_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import enum_api -from unit_test_api.model.enum_with_true_does_not_match1 import EnumWithTrueDoesNotMatch1 -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = enum_api.EnumApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_enum_with_true_does_not_match1_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling EnumApi->post_enum_with_true_does_not_match1_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_enum_with_true_does_not_match1_response_body_for_content_types.ApiResponseFor200) | success - -#### post_enum_with_true_does_not_match1_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**EnumWithTrueDoesNotMatch1**](../../models/EnumWithTrueDoesNotMatch1.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_enums_in_properties_request_body** - -> post_enums_in_properties_request_body(enums_in_properties) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import enum_api -from unit_test_api.model.enums_in_properties import EnumsInProperties -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = enum_api.EnumApi(api_client) - - # example passing only required values which don't have defaults set - body = EnumsInProperties( - foo="foo", - bar="bar", - ) - try: - api_response = api_instance.post_enums_in_properties_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling EnumApi->post_enums_in_properties_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**EnumsInProperties**](../../models/EnumsInProperties.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_enums_in_properties_request_body.ApiResponseFor200) | success - -#### post_enums_in_properties_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_enums_in_properties_response_body_for_content_types** - -> EnumsInProperties post_enums_in_properties_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import enum_api -from unit_test_api.model.enums_in_properties import EnumsInProperties -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = enum_api.EnumApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_enums_in_properties_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling EnumApi->post_enums_in_properties_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_enums_in_properties_response_body_for_content_types.ApiResponseFor200) | success - -#### post_enums_in_properties_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**EnumsInProperties**](../../models/EnumsInProperties.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_nul_characters_in_strings_request_body** - -> post_nul_characters_in_strings_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import enum_api -from unit_test_api.model.nul_characters_in_strings import NulCharactersInStrings -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = enum_api.EnumApi(api_client) - - # example passing only required values which don't have defaults set - body = NulCharactersInStrings("hello\x00there") - try: - api_response = api_instance.post_nul_characters_in_strings_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling EnumApi->post_nul_characters_in_strings_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**NulCharactersInStrings**](../../models/NulCharactersInStrings.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_nul_characters_in_strings_request_body.ApiResponseFor200) | success - -#### post_nul_characters_in_strings_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_nul_characters_in_strings_response_body_for_content_types** - -> NulCharactersInStrings post_nul_characters_in_strings_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import enum_api -from unit_test_api.model.nul_characters_in_strings import NulCharactersInStrings -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = enum_api.EnumApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_nul_characters_in_strings_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling EnumApi->post_nul_characters_in_strings_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_nul_characters_in_strings_response_body_for_content_types.ApiResponseFor200) | success - -#### post_nul_characters_in_strings_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**NulCharactersInStrings**](../../models/NulCharactersInStrings.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_simple_enum_validation_request_body** - -> post_simple_enum_validation_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import enum_api -from unit_test_api.model.simple_enum_validation import SimpleEnumValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = enum_api.EnumApi(api_client) - - # example passing only required values which don't have defaults set - body = SimpleEnumValidation(1) - try: - api_response = api_instance.post_simple_enum_validation_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling EnumApi->post_simple_enum_validation_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**SimpleEnumValidation**](../../models/SimpleEnumValidation.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_simple_enum_validation_request_body.ApiResponseFor200) | success - -#### post_simple_enum_validation_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_simple_enum_validation_response_body_for_content_types** - -> SimpleEnumValidation post_simple_enum_validation_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import enum_api -from unit_test_api.model.simple_enum_validation import SimpleEnumValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = enum_api.EnumApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_simple_enum_validation_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling EnumApi->post_simple_enum_validation_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_simple_enum_validation_response_body_for_content_types.ApiResponseFor200) | success - -#### post_simple_enum_validation_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**SimpleEnumValidation**](../../models/SimpleEnumValidation.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - +[**post_enum_with0_does_not_match_false_request_body**](enum_api/post_enum_with0_does_not_match_false_request_body.md) | **post** /requestBody/postEnumWith0DoesNotMatchFalseRequestBody | +[**post_enum_with0_does_not_match_false_response_body_for_content_types**](enum_api/post_enum_with0_does_not_match_false_response_body_for_content_types.md) | **post** /responseBody/postEnumWith0DoesNotMatchFalseResponseBodyForContentTypes | +[**post_enum_with1_does_not_match_true_request_body**](enum_api/post_enum_with1_does_not_match_true_request_body.md) | **post** /requestBody/postEnumWith1DoesNotMatchTrueRequestBody | +[**post_enum_with1_does_not_match_true_response_body_for_content_types**](enum_api/post_enum_with1_does_not_match_true_response_body_for_content_types.md) | **post** /responseBody/postEnumWith1DoesNotMatchTrueResponseBodyForContentTypes | +[**post_enum_with_escaped_characters_request_body**](enum_api/post_enum_with_escaped_characters_request_body.md) | **post** /requestBody/postEnumWithEscapedCharactersRequestBody | +[**post_enum_with_escaped_characters_response_body_for_content_types**](enum_api/post_enum_with_escaped_characters_response_body_for_content_types.md) | **post** /responseBody/postEnumWithEscapedCharactersResponseBodyForContentTypes | +[**post_enum_with_false_does_not_match0_request_body**](enum_api/post_enum_with_false_does_not_match0_request_body.md) | **post** /requestBody/postEnumWithFalseDoesNotMatch0RequestBody | +[**post_enum_with_false_does_not_match0_response_body_for_content_types**](enum_api/post_enum_with_false_does_not_match0_response_body_for_content_types.md) | **post** /responseBody/postEnumWithFalseDoesNotMatch0ResponseBodyForContentTypes | +[**post_enum_with_true_does_not_match1_request_body**](enum_api/post_enum_with_true_does_not_match1_request_body.md) | **post** /requestBody/postEnumWithTrueDoesNotMatch1RequestBody | +[**post_enum_with_true_does_not_match1_response_body_for_content_types**](enum_api/post_enum_with_true_does_not_match1_response_body_for_content_types.md) | **post** /responseBody/postEnumWithTrueDoesNotMatch1ResponseBodyForContentTypes | +[**post_enums_in_properties_request_body**](enum_api/post_enums_in_properties_request_body.md) | **post** /requestBody/postEnumsInPropertiesRequestBody | +[**post_enums_in_properties_response_body_for_content_types**](enum_api/post_enums_in_properties_response_body_for_content_types.md) | **post** /responseBody/postEnumsInPropertiesResponseBodyForContentTypes | +[**post_nul_characters_in_strings_request_body**](enum_api/post_nul_characters_in_strings_request_body.md) | **post** /requestBody/postNulCharactersInStringsRequestBody | +[**post_nul_characters_in_strings_response_body_for_content_types**](enum_api/post_nul_characters_in_strings_response_body_for_content_types.md) | **post** /responseBody/postNulCharactersInStringsResponseBodyForContentTypes | +[**post_simple_enum_validation_request_body**](enum_api/post_simple_enum_validation_request_body.md) | **post** /requestBody/postSimpleEnumValidationRequestBody | +[**post_simple_enum_validation_response_body_for_content_types**](enum_api/post_simple_enum_validation_response_body_for_content_types.md) | **post** /responseBody/postSimpleEnumValidationResponseBodyForContentTypes | + +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/FormatApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/FormatApi.md index 08431f22e69..7e8fac06f40 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/FormatApi.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/FormatApi.md @@ -1,1205 +1,27 @@ - + # unit_test_api.apis.tags.format_api.FormatApi All URIs are relative to *https://someserver.com/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**post_date_time_format_request_body**](#post_date_time_format_request_body) | **post** /requestBody/postDateTimeFormatRequestBody | -[**post_date_time_format_response_body_for_content_types**](#post_date_time_format_response_body_for_content_types) | **post** /responseBody/postDateTimeFormatResponseBodyForContentTypes | -[**post_email_format_request_body**](#post_email_format_request_body) | **post** /requestBody/postEmailFormatRequestBody | -[**post_email_format_response_body_for_content_types**](#post_email_format_response_body_for_content_types) | **post** /responseBody/postEmailFormatResponseBodyForContentTypes | -[**post_hostname_format_request_body**](#post_hostname_format_request_body) | **post** /requestBody/postHostnameFormatRequestBody | -[**post_hostname_format_response_body_for_content_types**](#post_hostname_format_response_body_for_content_types) | **post** /responseBody/postHostnameFormatResponseBodyForContentTypes | -[**post_ipv4_format_request_body**](#post_ipv4_format_request_body) | **post** /requestBody/postIpv4FormatRequestBody | -[**post_ipv4_format_response_body_for_content_types**](#post_ipv4_format_response_body_for_content_types) | **post** /responseBody/postIpv4FormatResponseBodyForContentTypes | -[**post_ipv6_format_request_body**](#post_ipv6_format_request_body) | **post** /requestBody/postIpv6FormatRequestBody | -[**post_ipv6_format_response_body_for_content_types**](#post_ipv6_format_response_body_for_content_types) | **post** /responseBody/postIpv6FormatResponseBodyForContentTypes | -[**post_json_pointer_format_request_body**](#post_json_pointer_format_request_body) | **post** /requestBody/postJsonPointerFormatRequestBody | -[**post_json_pointer_format_response_body_for_content_types**](#post_json_pointer_format_response_body_for_content_types) | **post** /responseBody/postJsonPointerFormatResponseBodyForContentTypes | -[**post_uri_format_request_body**](#post_uri_format_request_body) | **post** /requestBody/postUriFormatRequestBody | -[**post_uri_format_response_body_for_content_types**](#post_uri_format_response_body_for_content_types) | **post** /responseBody/postUriFormatResponseBodyForContentTypes | -[**post_uri_reference_format_request_body**](#post_uri_reference_format_request_body) | **post** /requestBody/postUriReferenceFormatRequestBody | -[**post_uri_reference_format_response_body_for_content_types**](#post_uri_reference_format_response_body_for_content_types) | **post** /responseBody/postUriReferenceFormatResponseBodyForContentTypes | -[**post_uri_template_format_request_body**](#post_uri_template_format_request_body) | **post** /requestBody/postUriTemplateFormatRequestBody | -[**post_uri_template_format_response_body_for_content_types**](#post_uri_template_format_response_body_for_content_types) | **post** /responseBody/postUriTemplateFormatResponseBodyForContentTypes | - -# **post_date_time_format_request_body** - -> post_date_time_format_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import format_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = format_api.FormatApi(api_client) - - # example passing only required values which don't have defaults set - body = None - try: - api_response = api_instance.post_date_time_format_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling FormatApi->post_date_time_format_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | value must conform to RFC-3339 date-time - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_date_time_format_request_body.ApiResponseFor200) | success - -#### post_date_time_format_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_date_time_format_response_body_for_content_types** - -> bool, date, datetime, dict, float, int, list, str, none_type post_date_time_format_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import format_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = format_api.FormatApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_date_time_format_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling FormatApi->post_date_time_format_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_date_time_format_response_body_for_content_types.ApiResponseFor200) | success - -#### post_date_time_format_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | value must conform to RFC-3339 date-time - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_email_format_request_body** - -> post_email_format_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import format_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = format_api.FormatApi(api_client) - - # example passing only required values which don't have defaults set - body = None - try: - api_response = api_instance.post_email_format_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling FormatApi->post_email_format_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_email_format_request_body.ApiResponseFor200) | success - -#### post_email_format_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_email_format_response_body_for_content_types** - -> bool, date, datetime, dict, float, int, list, str, none_type post_email_format_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import format_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = format_api.FormatApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_email_format_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling FormatApi->post_email_format_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_email_format_response_body_for_content_types.ApiResponseFor200) | success - -#### post_email_format_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_hostname_format_request_body** - -> post_hostname_format_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import format_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = format_api.FormatApi(api_client) - - # example passing only required values which don't have defaults set - body = None - try: - api_response = api_instance.post_hostname_format_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling FormatApi->post_hostname_format_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_hostname_format_request_body.ApiResponseFor200) | success - -#### post_hostname_format_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_hostname_format_response_body_for_content_types** - -> bool, date, datetime, dict, float, int, list, str, none_type post_hostname_format_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import format_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = format_api.FormatApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_hostname_format_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling FormatApi->post_hostname_format_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_hostname_format_response_body_for_content_types.ApiResponseFor200) | success - -#### post_hostname_format_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ipv4_format_request_body** - -> post_ipv4_format_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import format_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = format_api.FormatApi(api_client) - - # example passing only required values which don't have defaults set - body = None - try: - api_response = api_instance.post_ipv4_format_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling FormatApi->post_ipv4_format_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ipv4_format_request_body.ApiResponseFor200) | success - -#### post_ipv4_format_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ipv4_format_response_body_for_content_types** - -> bool, date, datetime, dict, float, int, list, str, none_type post_ipv4_format_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import format_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = format_api.FormatApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_ipv4_format_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling FormatApi->post_ipv4_format_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ipv4_format_response_body_for_content_types.ApiResponseFor200) | success - -#### post_ipv4_format_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ipv6_format_request_body** - -> post_ipv6_format_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import format_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = format_api.FormatApi(api_client) - - # example passing only required values which don't have defaults set - body = None - try: - api_response = api_instance.post_ipv6_format_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling FormatApi->post_ipv6_format_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ipv6_format_request_body.ApiResponseFor200) | success - -#### post_ipv6_format_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ipv6_format_response_body_for_content_types** - -> bool, date, datetime, dict, float, int, list, str, none_type post_ipv6_format_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import format_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = format_api.FormatApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_ipv6_format_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling FormatApi->post_ipv6_format_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ipv6_format_response_body_for_content_types.ApiResponseFor200) | success - -#### post_ipv6_format_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_json_pointer_format_request_body** - -> post_json_pointer_format_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import format_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = format_api.FormatApi(api_client) - - # example passing only required values which don't have defaults set - body = None - try: - api_response = api_instance.post_json_pointer_format_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling FormatApi->post_json_pointer_format_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_json_pointer_format_request_body.ApiResponseFor200) | success - -#### post_json_pointer_format_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_json_pointer_format_response_body_for_content_types** - -> bool, date, datetime, dict, float, int, list, str, none_type post_json_pointer_format_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import format_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = format_api.FormatApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_json_pointer_format_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling FormatApi->post_json_pointer_format_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_json_pointer_format_response_body_for_content_types.ApiResponseFor200) | success - -#### post_json_pointer_format_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_uri_format_request_body** - -> post_uri_format_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import format_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = format_api.FormatApi(api_client) - - # example passing only required values which don't have defaults set - body = None - try: - api_response = api_instance.post_uri_format_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling FormatApi->post_uri_format_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_uri_format_request_body.ApiResponseFor200) | success - -#### post_uri_format_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_uri_format_response_body_for_content_types** - -> bool, date, datetime, dict, float, int, list, str, none_type post_uri_format_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import format_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = format_api.FormatApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_uri_format_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling FormatApi->post_uri_format_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_uri_format_response_body_for_content_types.ApiResponseFor200) | success - -#### post_uri_format_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_uri_reference_format_request_body** - -> post_uri_reference_format_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import format_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = format_api.FormatApi(api_client) - - # example passing only required values which don't have defaults set - body = None - try: - api_response = api_instance.post_uri_reference_format_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling FormatApi->post_uri_reference_format_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_uri_reference_format_request_body.ApiResponseFor200) | success - -#### post_uri_reference_format_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_uri_reference_format_response_body_for_content_types** - -> bool, date, datetime, dict, float, int, list, str, none_type post_uri_reference_format_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import format_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = format_api.FormatApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_uri_reference_format_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling FormatApi->post_uri_reference_format_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_uri_reference_format_response_body_for_content_types.ApiResponseFor200) | success - -#### post_uri_reference_format_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_uri_template_format_request_body** - -> post_uri_template_format_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import format_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = format_api.FormatApi(api_client) - - # example passing only required values which don't have defaults set - body = None - try: - api_response = api_instance.post_uri_template_format_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling FormatApi->post_uri_template_format_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_uri_template_format_request_body.ApiResponseFor200) | success - -#### post_uri_template_format_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_uri_template_format_response_body_for_content_types** - -> bool, date, datetime, dict, float, int, list, str, none_type post_uri_template_format_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import format_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = format_api.FormatApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_uri_template_format_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling FormatApi->post_uri_template_format_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_uri_template_format_response_body_for_content_types.ApiResponseFor200) | success - -#### post_uri_template_format_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - +[**post_date_time_format_request_body**](format_api/post_date_time_format_request_body.md) | **post** /requestBody/postDateTimeFormatRequestBody | +[**post_date_time_format_response_body_for_content_types**](format_api/post_date_time_format_response_body_for_content_types.md) | **post** /responseBody/postDateTimeFormatResponseBodyForContentTypes | +[**post_email_format_request_body**](format_api/post_email_format_request_body.md) | **post** /requestBody/postEmailFormatRequestBody | +[**post_email_format_response_body_for_content_types**](format_api/post_email_format_response_body_for_content_types.md) | **post** /responseBody/postEmailFormatResponseBodyForContentTypes | +[**post_hostname_format_request_body**](format_api/post_hostname_format_request_body.md) | **post** /requestBody/postHostnameFormatRequestBody | +[**post_hostname_format_response_body_for_content_types**](format_api/post_hostname_format_response_body_for_content_types.md) | **post** /responseBody/postHostnameFormatResponseBodyForContentTypes | +[**post_ipv4_format_request_body**](format_api/post_ipv4_format_request_body.md) | **post** /requestBody/postIpv4FormatRequestBody | +[**post_ipv4_format_response_body_for_content_types**](format_api/post_ipv4_format_response_body_for_content_types.md) | **post** /responseBody/postIpv4FormatResponseBodyForContentTypes | +[**post_ipv6_format_request_body**](format_api/post_ipv6_format_request_body.md) | **post** /requestBody/postIpv6FormatRequestBody | +[**post_ipv6_format_response_body_for_content_types**](format_api/post_ipv6_format_response_body_for_content_types.md) | **post** /responseBody/postIpv6FormatResponseBodyForContentTypes | +[**post_json_pointer_format_request_body**](format_api/post_json_pointer_format_request_body.md) | **post** /requestBody/postJsonPointerFormatRequestBody | +[**post_json_pointer_format_response_body_for_content_types**](format_api/post_json_pointer_format_response_body_for_content_types.md) | **post** /responseBody/postJsonPointerFormatResponseBodyForContentTypes | +[**post_uri_format_request_body**](format_api/post_uri_format_request_body.md) | **post** /requestBody/postUriFormatRequestBody | +[**post_uri_format_response_body_for_content_types**](format_api/post_uri_format_response_body_for_content_types.md) | **post** /responseBody/postUriFormatResponseBodyForContentTypes | +[**post_uri_reference_format_request_body**](format_api/post_uri_reference_format_request_body.md) | **post** /requestBody/postUriReferenceFormatRequestBody | +[**post_uri_reference_format_response_body_for_content_types**](format_api/post_uri_reference_format_response_body_for_content_types.md) | **post** /responseBody/postUriReferenceFormatResponseBodyForContentTypes | +[**post_uri_template_format_request_body**](format_api/post_uri_template_format_request_body.md) | **post** /requestBody/postUriTemplateFormatRequestBody | +[**post_uri_template_format_response_body_for_content_types**](format_api/post_uri_template_format_response_body_for_content_types.md) | **post** /responseBody/postUriTemplateFormatResponseBodyForContentTypes | + +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/ItemsApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/ItemsApi.md index a3892956f16..993cb4bdcef 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/ItemsApi.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/ItemsApi.md @@ -1,149 +1,11 @@ - + # unit_test_api.apis.tags.items_api.ItemsApi All URIs are relative to *https://someserver.com/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**post_nested_items_request_body**](#post_nested_items_request_body) | **post** /requestBody/postNestedItemsRequestBody | -[**post_nested_items_response_body_for_content_types**](#post_nested_items_response_body_for_content_types) | **post** /responseBody/postNestedItemsResponseBodyForContentTypes | - -# **post_nested_items_request_body** - -> post_nested_items_request_body(nested_items) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import items_api -from unit_test_api.model.nested_items import NestedItems -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = items_api.ItemsApi(api_client) - - # example passing only required values which don't have defaults set - body = NestedItems([ - [ - [ - [ - 3.14 - ] - ] - ] - ]) - try: - api_response = api_instance.post_nested_items_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ItemsApi->post_nested_items_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**NestedItems**](../../models/NestedItems.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_nested_items_request_body.ApiResponseFor200) | success - -#### post_nested_items_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_nested_items_response_body_for_content_types** - -> NestedItems post_nested_items_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import items_api -from unit_test_api.model.nested_items import NestedItems -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = items_api.ItemsApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_nested_items_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ItemsApi->post_nested_items_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_nested_items_response_body_for_content_types.ApiResponseFor200) | success - -#### post_nested_items_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**NestedItems**](../../models/NestedItems.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) +[**post_nested_items_request_body**](items_api/post_nested_items_request_body.md) | **post** /requestBody/postNestedItemsRequestBody | +[**post_nested_items_response_body_for_content_types**](items_api/post_nested_items_response_body_for_content_types.md) | **post** /responseBody/postNestedItemsResponseBodyForContentTypes | +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MaxItemsApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MaxItemsApi.md index 481d933e61f..c21f4c430eb 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MaxItemsApi.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MaxItemsApi.md @@ -1,141 +1,11 @@ - + # unit_test_api.apis.tags.max_items_api.MaxItemsApi All URIs are relative to *https://someserver.com/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**post_maxitems_validation_request_body**](#post_maxitems_validation_request_body) | **post** /requestBody/postMaxitemsValidationRequestBody | -[**post_maxitems_validation_response_body_for_content_types**](#post_maxitems_validation_response_body_for_content_types) | **post** /responseBody/postMaxitemsValidationResponseBodyForContentTypes | - -# **post_maxitems_validation_request_body** - -> post_maxitems_validation_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import max_items_api -from unit_test_api.model.maxitems_validation import MaxitemsValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = max_items_api.MaxItemsApi(api_client) - - # example passing only required values which don't have defaults set - body = MaxitemsValidation(None) - try: - api_response = api_instance.post_maxitems_validation_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling MaxItemsApi->post_maxitems_validation_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MaxitemsValidation**](../../models/MaxitemsValidation.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_maxitems_validation_request_body.ApiResponseFor200) | success - -#### post_maxitems_validation_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_maxitems_validation_response_body_for_content_types** - -> MaxitemsValidation post_maxitems_validation_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import max_items_api -from unit_test_api.model.maxitems_validation import MaxitemsValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = max_items_api.MaxItemsApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_maxitems_validation_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling MaxItemsApi->post_maxitems_validation_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_maxitems_validation_response_body_for_content_types.ApiResponseFor200) | success - -#### post_maxitems_validation_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MaxitemsValidation**](../../models/MaxitemsValidation.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) +[**post_maxitems_validation_request_body**](max_items_api/post_maxitems_validation_request_body.md) | **post** /requestBody/postMaxitemsValidationRequestBody | +[**post_maxitems_validation_response_body_for_content_types**](max_items_api/post_maxitems_validation_response_body_for_content_types.md) | **post** /responseBody/postMaxitemsValidationResponseBodyForContentTypes | +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MaxLengthApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MaxLengthApi.md index 98d63d49245..ecb57383db3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MaxLengthApi.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MaxLengthApi.md @@ -1,141 +1,11 @@ - + # unit_test_api.apis.tags.max_length_api.MaxLengthApi All URIs are relative to *https://someserver.com/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**post_maxlength_validation_request_body**](#post_maxlength_validation_request_body) | **post** /requestBody/postMaxlengthValidationRequestBody | -[**post_maxlength_validation_response_body_for_content_types**](#post_maxlength_validation_response_body_for_content_types) | **post** /responseBody/postMaxlengthValidationResponseBodyForContentTypes | - -# **post_maxlength_validation_request_body** - -> post_maxlength_validation_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import max_length_api -from unit_test_api.model.maxlength_validation import MaxlengthValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = max_length_api.MaxLengthApi(api_client) - - # example passing only required values which don't have defaults set - body = MaxlengthValidation(None) - try: - api_response = api_instance.post_maxlength_validation_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling MaxLengthApi->post_maxlength_validation_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MaxlengthValidation**](../../models/MaxlengthValidation.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_maxlength_validation_request_body.ApiResponseFor200) | success - -#### post_maxlength_validation_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_maxlength_validation_response_body_for_content_types** - -> MaxlengthValidation post_maxlength_validation_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import max_length_api -from unit_test_api.model.maxlength_validation import MaxlengthValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = max_length_api.MaxLengthApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_maxlength_validation_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling MaxLengthApi->post_maxlength_validation_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_maxlength_validation_response_body_for_content_types.ApiResponseFor200) | success - -#### post_maxlength_validation_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MaxlengthValidation**](../../models/MaxlengthValidation.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) +[**post_maxlength_validation_request_body**](max_length_api/post_maxlength_validation_request_body.md) | **post** /requestBody/postMaxlengthValidationRequestBody | +[**post_maxlength_validation_response_body_for_content_types**](max_length_api/post_maxlength_validation_response_body_for_content_types.md) | **post** /responseBody/postMaxlengthValidationResponseBodyForContentTypes | +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MaxPropertiesApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MaxPropertiesApi.md index 30bb70e217f..98d6cfa9625 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MaxPropertiesApi.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MaxPropertiesApi.md @@ -1,274 +1,13 @@ - + # unit_test_api.apis.tags.max_properties_api.MaxPropertiesApi All URIs are relative to *https://someserver.com/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**post_maxproperties0_means_the_object_is_empty_request_body**](#post_maxproperties0_means_the_object_is_empty_request_body) | **post** /requestBody/postMaxproperties0MeansTheObjectIsEmptyRequestBody | -[**post_maxproperties0_means_the_object_is_empty_response_body_for_content_types**](#post_maxproperties0_means_the_object_is_empty_response_body_for_content_types) | **post** /responseBody/postMaxproperties0MeansTheObjectIsEmptyResponseBodyForContentTypes | -[**post_maxproperties_validation_request_body**](#post_maxproperties_validation_request_body) | **post** /requestBody/postMaxpropertiesValidationRequestBody | -[**post_maxproperties_validation_response_body_for_content_types**](#post_maxproperties_validation_response_body_for_content_types) | **post** /responseBody/postMaxpropertiesValidationResponseBodyForContentTypes | - -# **post_maxproperties0_means_the_object_is_empty_request_body** - -> post_maxproperties0_means_the_object_is_empty_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import max_properties_api -from unit_test_api.model.maxproperties0_means_the_object_is_empty import Maxproperties0MeansTheObjectIsEmpty -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = max_properties_api.MaxPropertiesApi(api_client) - - # example passing only required values which don't have defaults set - body = Maxproperties0MeansTheObjectIsEmpty(None) - try: - api_response = api_instance.post_maxproperties0_means_the_object_is_empty_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling MaxPropertiesApi->post_maxproperties0_means_the_object_is_empty_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**Maxproperties0MeansTheObjectIsEmpty**](../../models/Maxproperties0MeansTheObjectIsEmpty.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_maxproperties0_means_the_object_is_empty_request_body.ApiResponseFor200) | success - -#### post_maxproperties0_means_the_object_is_empty_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_maxproperties0_means_the_object_is_empty_response_body_for_content_types** - -> Maxproperties0MeansTheObjectIsEmpty post_maxproperties0_means_the_object_is_empty_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import max_properties_api -from unit_test_api.model.maxproperties0_means_the_object_is_empty import Maxproperties0MeansTheObjectIsEmpty -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = max_properties_api.MaxPropertiesApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_maxproperties0_means_the_object_is_empty_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling MaxPropertiesApi->post_maxproperties0_means_the_object_is_empty_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_maxproperties0_means_the_object_is_empty_response_body_for_content_types.ApiResponseFor200) | success - -#### post_maxproperties0_means_the_object_is_empty_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**Maxproperties0MeansTheObjectIsEmpty**](../../models/Maxproperties0MeansTheObjectIsEmpty.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_maxproperties_validation_request_body** - -> post_maxproperties_validation_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import max_properties_api -from unit_test_api.model.maxproperties_validation import MaxpropertiesValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = max_properties_api.MaxPropertiesApi(api_client) - - # example passing only required values which don't have defaults set - body = MaxpropertiesValidation(None) - try: - api_response = api_instance.post_maxproperties_validation_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling MaxPropertiesApi->post_maxproperties_validation_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MaxpropertiesValidation**](../../models/MaxpropertiesValidation.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_maxproperties_validation_request_body.ApiResponseFor200) | success - -#### post_maxproperties_validation_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_maxproperties_validation_response_body_for_content_types** - -> MaxpropertiesValidation post_maxproperties_validation_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import max_properties_api -from unit_test_api.model.maxproperties_validation import MaxpropertiesValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = max_properties_api.MaxPropertiesApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_maxproperties_validation_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling MaxPropertiesApi->post_maxproperties_validation_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_maxproperties_validation_response_body_for_content_types.ApiResponseFor200) | success - -#### post_maxproperties_validation_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MaxpropertiesValidation**](../../models/MaxpropertiesValidation.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) +[**post_maxproperties0_means_the_object_is_empty_request_body**](max_properties_api/post_maxproperties0_means_the_object_is_empty_request_body.md) | **post** /requestBody/postMaxproperties0MeansTheObjectIsEmptyRequestBody | +[**post_maxproperties0_means_the_object_is_empty_response_body_for_content_types**](max_properties_api/post_maxproperties0_means_the_object_is_empty_response_body_for_content_types.md) | **post** /responseBody/postMaxproperties0MeansTheObjectIsEmptyResponseBodyForContentTypes | +[**post_maxproperties_validation_request_body**](max_properties_api/post_maxproperties_validation_request_body.md) | **post** /requestBody/postMaxpropertiesValidationRequestBody | +[**post_maxproperties_validation_response_body_for_content_types**](max_properties_api/post_maxproperties_validation_response_body_for_content_types.md) | **post** /responseBody/postMaxpropertiesValidationResponseBodyForContentTypes | +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MaximumApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MaximumApi.md index 388aa8b796a..f6c949aaa45 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MaximumApi.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MaximumApi.md @@ -1,274 +1,13 @@ - + # unit_test_api.apis.tags.maximum_api.MaximumApi All URIs are relative to *https://someserver.com/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**post_maximum_validation_request_body**](#post_maximum_validation_request_body) | **post** /requestBody/postMaximumValidationRequestBody | -[**post_maximum_validation_response_body_for_content_types**](#post_maximum_validation_response_body_for_content_types) | **post** /responseBody/postMaximumValidationResponseBodyForContentTypes | -[**post_maximum_validation_with_unsigned_integer_request_body**](#post_maximum_validation_with_unsigned_integer_request_body) | **post** /requestBody/postMaximumValidationWithUnsignedIntegerRequestBody | -[**post_maximum_validation_with_unsigned_integer_response_body_for_content_types**](#post_maximum_validation_with_unsigned_integer_response_body_for_content_types) | **post** /responseBody/postMaximumValidationWithUnsignedIntegerResponseBodyForContentTypes | - -# **post_maximum_validation_request_body** - -> post_maximum_validation_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import maximum_api -from unit_test_api.model.maximum_validation import MaximumValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = maximum_api.MaximumApi(api_client) - - # example passing only required values which don't have defaults set - body = MaximumValidation(None) - try: - api_response = api_instance.post_maximum_validation_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling MaximumApi->post_maximum_validation_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MaximumValidation**](../../models/MaximumValidation.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_maximum_validation_request_body.ApiResponseFor200) | success - -#### post_maximum_validation_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_maximum_validation_response_body_for_content_types** - -> MaximumValidation post_maximum_validation_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import maximum_api -from unit_test_api.model.maximum_validation import MaximumValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = maximum_api.MaximumApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_maximum_validation_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling MaximumApi->post_maximum_validation_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_maximum_validation_response_body_for_content_types.ApiResponseFor200) | success - -#### post_maximum_validation_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MaximumValidation**](../../models/MaximumValidation.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_maximum_validation_with_unsigned_integer_request_body** - -> post_maximum_validation_with_unsigned_integer_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import maximum_api -from unit_test_api.model.maximum_validation_with_unsigned_integer import MaximumValidationWithUnsignedInteger -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = maximum_api.MaximumApi(api_client) - - # example passing only required values which don't have defaults set - body = MaximumValidationWithUnsignedInteger(None) - try: - api_response = api_instance.post_maximum_validation_with_unsigned_integer_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling MaximumApi->post_maximum_validation_with_unsigned_integer_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MaximumValidationWithUnsignedInteger**](../../models/MaximumValidationWithUnsignedInteger.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_maximum_validation_with_unsigned_integer_request_body.ApiResponseFor200) | success - -#### post_maximum_validation_with_unsigned_integer_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_maximum_validation_with_unsigned_integer_response_body_for_content_types** - -> MaximumValidationWithUnsignedInteger post_maximum_validation_with_unsigned_integer_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import maximum_api -from unit_test_api.model.maximum_validation_with_unsigned_integer import MaximumValidationWithUnsignedInteger -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = maximum_api.MaximumApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_maximum_validation_with_unsigned_integer_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling MaximumApi->post_maximum_validation_with_unsigned_integer_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_maximum_validation_with_unsigned_integer_response_body_for_content_types.ApiResponseFor200) | success - -#### post_maximum_validation_with_unsigned_integer_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MaximumValidationWithUnsignedInteger**](../../models/MaximumValidationWithUnsignedInteger.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) +[**post_maximum_validation_request_body**](maximum_api/post_maximum_validation_request_body.md) | **post** /requestBody/postMaximumValidationRequestBody | +[**post_maximum_validation_response_body_for_content_types**](maximum_api/post_maximum_validation_response_body_for_content_types.md) | **post** /responseBody/postMaximumValidationResponseBodyForContentTypes | +[**post_maximum_validation_with_unsigned_integer_request_body**](maximum_api/post_maximum_validation_with_unsigned_integer_request_body.md) | **post** /requestBody/postMaximumValidationWithUnsignedIntegerRequestBody | +[**post_maximum_validation_with_unsigned_integer_response_body_for_content_types**](maximum_api/post_maximum_validation_with_unsigned_integer_response_body_for_content_types.md) | **post** /responseBody/postMaximumValidationWithUnsignedIntegerResponseBodyForContentTypes | +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MinItemsApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MinItemsApi.md index 47fece84820..ab128990947 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MinItemsApi.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MinItemsApi.md @@ -1,141 +1,11 @@ - + # unit_test_api.apis.tags.min_items_api.MinItemsApi All URIs are relative to *https://someserver.com/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**post_minitems_validation_request_body**](#post_minitems_validation_request_body) | **post** /requestBody/postMinitemsValidationRequestBody | -[**post_minitems_validation_response_body_for_content_types**](#post_minitems_validation_response_body_for_content_types) | **post** /responseBody/postMinitemsValidationResponseBodyForContentTypes | - -# **post_minitems_validation_request_body** - -> post_minitems_validation_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import min_items_api -from unit_test_api.model.minitems_validation import MinitemsValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = min_items_api.MinItemsApi(api_client) - - # example passing only required values which don't have defaults set - body = MinitemsValidation(None) - try: - api_response = api_instance.post_minitems_validation_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling MinItemsApi->post_minitems_validation_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MinitemsValidation**](../../models/MinitemsValidation.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_minitems_validation_request_body.ApiResponseFor200) | success - -#### post_minitems_validation_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_minitems_validation_response_body_for_content_types** - -> MinitemsValidation post_minitems_validation_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import min_items_api -from unit_test_api.model.minitems_validation import MinitemsValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = min_items_api.MinItemsApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_minitems_validation_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling MinItemsApi->post_minitems_validation_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_minitems_validation_response_body_for_content_types.ApiResponseFor200) | success - -#### post_minitems_validation_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MinitemsValidation**](../../models/MinitemsValidation.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) +[**post_minitems_validation_request_body**](min_items_api/post_minitems_validation_request_body.md) | **post** /requestBody/postMinitemsValidationRequestBody | +[**post_minitems_validation_response_body_for_content_types**](min_items_api/post_minitems_validation_response_body_for_content_types.md) | **post** /responseBody/postMinitemsValidationResponseBodyForContentTypes | +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MinLengthApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MinLengthApi.md index 918d02f43ef..3c0de36bee8 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MinLengthApi.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MinLengthApi.md @@ -1,141 +1,11 @@ - + # unit_test_api.apis.tags.min_length_api.MinLengthApi All URIs are relative to *https://someserver.com/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**post_minlength_validation_request_body**](#post_minlength_validation_request_body) | **post** /requestBody/postMinlengthValidationRequestBody | -[**post_minlength_validation_response_body_for_content_types**](#post_minlength_validation_response_body_for_content_types) | **post** /responseBody/postMinlengthValidationResponseBodyForContentTypes | - -# **post_minlength_validation_request_body** - -> post_minlength_validation_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import min_length_api -from unit_test_api.model.minlength_validation import MinlengthValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = min_length_api.MinLengthApi(api_client) - - # example passing only required values which don't have defaults set - body = MinlengthValidation(None) - try: - api_response = api_instance.post_minlength_validation_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling MinLengthApi->post_minlength_validation_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MinlengthValidation**](../../models/MinlengthValidation.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_minlength_validation_request_body.ApiResponseFor200) | success - -#### post_minlength_validation_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_minlength_validation_response_body_for_content_types** - -> MinlengthValidation post_minlength_validation_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import min_length_api -from unit_test_api.model.minlength_validation import MinlengthValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = min_length_api.MinLengthApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_minlength_validation_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling MinLengthApi->post_minlength_validation_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_minlength_validation_response_body_for_content_types.ApiResponseFor200) | success - -#### post_minlength_validation_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MinlengthValidation**](../../models/MinlengthValidation.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) +[**post_minlength_validation_request_body**](min_length_api/post_minlength_validation_request_body.md) | **post** /requestBody/postMinlengthValidationRequestBody | +[**post_minlength_validation_response_body_for_content_types**](min_length_api/post_minlength_validation_response_body_for_content_types.md) | **post** /responseBody/postMinlengthValidationResponseBodyForContentTypes | +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MinPropertiesApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MinPropertiesApi.md index 7d44da6f0b4..71a91d4b1bd 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MinPropertiesApi.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MinPropertiesApi.md @@ -1,141 +1,11 @@ - + # unit_test_api.apis.tags.min_properties_api.MinPropertiesApi All URIs are relative to *https://someserver.com/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**post_minproperties_validation_request_body**](#post_minproperties_validation_request_body) | **post** /requestBody/postMinpropertiesValidationRequestBody | -[**post_minproperties_validation_response_body_for_content_types**](#post_minproperties_validation_response_body_for_content_types) | **post** /responseBody/postMinpropertiesValidationResponseBodyForContentTypes | - -# **post_minproperties_validation_request_body** - -> post_minproperties_validation_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import min_properties_api -from unit_test_api.model.minproperties_validation import MinpropertiesValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = min_properties_api.MinPropertiesApi(api_client) - - # example passing only required values which don't have defaults set - body = MinpropertiesValidation(None) - try: - api_response = api_instance.post_minproperties_validation_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling MinPropertiesApi->post_minproperties_validation_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MinpropertiesValidation**](../../models/MinpropertiesValidation.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_minproperties_validation_request_body.ApiResponseFor200) | success - -#### post_minproperties_validation_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_minproperties_validation_response_body_for_content_types** - -> MinpropertiesValidation post_minproperties_validation_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import min_properties_api -from unit_test_api.model.minproperties_validation import MinpropertiesValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = min_properties_api.MinPropertiesApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_minproperties_validation_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling MinPropertiesApi->post_minproperties_validation_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_minproperties_validation_response_body_for_content_types.ApiResponseFor200) | success - -#### post_minproperties_validation_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MinpropertiesValidation**](../../models/MinpropertiesValidation.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) +[**post_minproperties_validation_request_body**](min_properties_api/post_minproperties_validation_request_body.md) | **post** /requestBody/postMinpropertiesValidationRequestBody | +[**post_minproperties_validation_response_body_for_content_types**](min_properties_api/post_minproperties_validation_response_body_for_content_types.md) | **post** /responseBody/postMinpropertiesValidationResponseBodyForContentTypes | +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MinimumApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MinimumApi.md index b176533c963..6468ba3c7a2 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MinimumApi.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MinimumApi.md @@ -1,274 +1,13 @@ - + # unit_test_api.apis.tags.minimum_api.MinimumApi All URIs are relative to *https://someserver.com/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**post_minimum_validation_request_body**](#post_minimum_validation_request_body) | **post** /requestBody/postMinimumValidationRequestBody | -[**post_minimum_validation_response_body_for_content_types**](#post_minimum_validation_response_body_for_content_types) | **post** /responseBody/postMinimumValidationResponseBodyForContentTypes | -[**post_minimum_validation_with_signed_integer_request_body**](#post_minimum_validation_with_signed_integer_request_body) | **post** /requestBody/postMinimumValidationWithSignedIntegerRequestBody | -[**post_minimum_validation_with_signed_integer_response_body_for_content_types**](#post_minimum_validation_with_signed_integer_response_body_for_content_types) | **post** /responseBody/postMinimumValidationWithSignedIntegerResponseBodyForContentTypes | - -# **post_minimum_validation_request_body** - -> post_minimum_validation_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import minimum_api -from unit_test_api.model.minimum_validation import MinimumValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = minimum_api.MinimumApi(api_client) - - # example passing only required values which don't have defaults set - body = MinimumValidation(None) - try: - api_response = api_instance.post_minimum_validation_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling MinimumApi->post_minimum_validation_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MinimumValidation**](../../models/MinimumValidation.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_minimum_validation_request_body.ApiResponseFor200) | success - -#### post_minimum_validation_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_minimum_validation_response_body_for_content_types** - -> MinimumValidation post_minimum_validation_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import minimum_api -from unit_test_api.model.minimum_validation import MinimumValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = minimum_api.MinimumApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_minimum_validation_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling MinimumApi->post_minimum_validation_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_minimum_validation_response_body_for_content_types.ApiResponseFor200) | success - -#### post_minimum_validation_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MinimumValidation**](../../models/MinimumValidation.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_minimum_validation_with_signed_integer_request_body** - -> post_minimum_validation_with_signed_integer_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import minimum_api -from unit_test_api.model.minimum_validation_with_signed_integer import MinimumValidationWithSignedInteger -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = minimum_api.MinimumApi(api_client) - - # example passing only required values which don't have defaults set - body = MinimumValidationWithSignedInteger(None) - try: - api_response = api_instance.post_minimum_validation_with_signed_integer_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling MinimumApi->post_minimum_validation_with_signed_integer_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MinimumValidationWithSignedInteger**](../../models/MinimumValidationWithSignedInteger.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_minimum_validation_with_signed_integer_request_body.ApiResponseFor200) | success - -#### post_minimum_validation_with_signed_integer_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_minimum_validation_with_signed_integer_response_body_for_content_types** - -> MinimumValidationWithSignedInteger post_minimum_validation_with_signed_integer_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import minimum_api -from unit_test_api.model.minimum_validation_with_signed_integer import MinimumValidationWithSignedInteger -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = minimum_api.MinimumApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_minimum_validation_with_signed_integer_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling MinimumApi->post_minimum_validation_with_signed_integer_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_minimum_validation_with_signed_integer_response_body_for_content_types.ApiResponseFor200) | success - -#### post_minimum_validation_with_signed_integer_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MinimumValidationWithSignedInteger**](../../models/MinimumValidationWithSignedInteger.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) +[**post_minimum_validation_request_body**](minimum_api/post_minimum_validation_request_body.md) | **post** /requestBody/postMinimumValidationRequestBody | +[**post_minimum_validation_response_body_for_content_types**](minimum_api/post_minimum_validation_response_body_for_content_types.md) | **post** /responseBody/postMinimumValidationResponseBodyForContentTypes | +[**post_minimum_validation_with_signed_integer_request_body**](minimum_api/post_minimum_validation_with_signed_integer_request_body.md) | **post** /requestBody/postMinimumValidationWithSignedIntegerRequestBody | +[**post_minimum_validation_with_signed_integer_response_body_for_content_types**](minimum_api/post_minimum_validation_with_signed_integer_response_body_for_content_types.md) | **post** /responseBody/postMinimumValidationWithSignedIntegerResponseBodyForContentTypes | +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/ModelNotApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/ModelNotApi.md deleted file mode 100644 index 0c1ab7ec02d..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/ModelNotApi.md +++ /dev/null @@ -1,471 +0,0 @@ - -# unit_test_api.apis.tags.model_not_api.ModelNotApi - -All URIs are relative to *https://someserver.com/v1* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**post_forbidden_property_request_body**](#post_forbidden_property_request_body) | **post** /requestBody/postForbiddenPropertyRequestBody | -[**post_forbidden_property_response_body_for_content_types**](#post_forbidden_property_response_body_for_content_types) | **post** /responseBody/postForbiddenPropertyResponseBodyForContentTypes | -[**post_not_more_complex_schema_request_body**](#post_not_more_complex_schema_request_body) | **post** /requestBody/postNotMoreComplexSchemaRequestBody | -[**post_not_more_complex_schema_response_body_for_content_types**](#post_not_more_complex_schema_response_body_for_content_types) | **post** /responseBody/postNotMoreComplexSchemaResponseBodyForContentTypes | -[**post_not_request_body**](#post_not_request_body) | **post** /requestBody/postNotRequestBody | -[**post_not_response_body_for_content_types**](#post_not_response_body_for_content_types) | **post** /responseBody/postNotResponseBodyForContentTypes | - -# **post_forbidden_property_request_body** - -> post_forbidden_property_request_body(forbidden_property) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import model_not_api -from unit_test_api.model.forbidden_property import ForbiddenProperty -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = model_not_api.ModelNotApi(api_client) - - # example passing only required values which don't have defaults set - body = ForbiddenProperty(None) - try: - api_response = api_instance.post_forbidden_property_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ModelNotApi->post_forbidden_property_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**ForbiddenProperty**](../../models/ForbiddenProperty.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_forbidden_property_request_body.ApiResponseFor200) | success - -#### post_forbidden_property_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_forbidden_property_response_body_for_content_types** - -> ForbiddenProperty post_forbidden_property_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import model_not_api -from unit_test_api.model.forbidden_property import ForbiddenProperty -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = model_not_api.ModelNotApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_forbidden_property_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ModelNotApi->post_forbidden_property_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_forbidden_property_response_body_for_content_types.ApiResponseFor200) | success - -#### post_forbidden_property_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**ForbiddenProperty**](../../models/ForbiddenProperty.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_not_more_complex_schema_request_body** - -> post_not_more_complex_schema_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import model_not_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = model_not_api.ModelNotApi(api_client) - - # example passing only required values which don't have defaults set - body = None - try: - api_response = api_instance.post_not_more_complex_schema_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ModelNotApi->post_not_more_complex_schema_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### not -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[not_schema](#not_schema) | dict, frozendict.frozendict, | frozendict.frozendict, | | - -# not_schema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**foo** | str, | str, | | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_not_more_complex_schema_request_body.ApiResponseFor200) | success - -#### post_not_more_complex_schema_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_not_more_complex_schema_response_body_for_content_types** - -> bool, date, datetime, dict, float, int, list, str, none_type post_not_more_complex_schema_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import model_not_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = model_not_api.ModelNotApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_not_more_complex_schema_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ModelNotApi->post_not_more_complex_schema_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_not_more_complex_schema_response_body_for_content_types.ApiResponseFor200) | success - -#### post_not_more_complex_schema_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### not -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[not_schema](#not_schema) | dict, frozendict.frozendict, | frozendict.frozendict, | | - -# not_schema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**foo** | str, | str, | | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_not_request_body** - -> post_not_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import model_not_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = model_not_api.ModelNotApi(api_client) - - # example passing only required values which don't have defaults set - body = None - try: - api_response = api_instance.post_not_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling ModelNotApi->post_not_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### not -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[not_schema](#not_schema) | decimal.Decimal, int, | decimal.Decimal, | | - -# not_schema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -decimal.Decimal, int, | decimal.Decimal, | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_not_request_body.ApiResponseFor200) | success - -#### post_not_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_not_response_body_for_content_types** - -> bool, date, datetime, dict, float, int, list, str, none_type post_not_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import model_not_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = model_not_api.ModelNotApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_not_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ModelNotApi->post_not_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_not_response_body_for_content_types.ApiResponseFor200) | success - -#### post_not_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### not -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[not_schema](#not_schema) | decimal.Decimal, int, | decimal.Decimal, | | - -# not_schema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -decimal.Decimal, int, | decimal.Decimal, | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MultipleOfApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MultipleOfApi.md index dae45d4773b..586140e0502 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MultipleOfApi.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MultipleOfApi.md @@ -1,540 +1,17 @@ - + # unit_test_api.apis.tags.multiple_of_api.MultipleOfApi All URIs are relative to *https://someserver.com/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**post_by_int_request_body**](#post_by_int_request_body) | **post** /requestBody/postByIntRequestBody | -[**post_by_int_response_body_for_content_types**](#post_by_int_response_body_for_content_types) | **post** /responseBody/postByIntResponseBodyForContentTypes | -[**post_by_number_request_body**](#post_by_number_request_body) | **post** /requestBody/postByNumberRequestBody | -[**post_by_number_response_body_for_content_types**](#post_by_number_response_body_for_content_types) | **post** /responseBody/postByNumberResponseBodyForContentTypes | -[**post_by_small_number_request_body**](#post_by_small_number_request_body) | **post** /requestBody/postBySmallNumberRequestBody | -[**post_by_small_number_response_body_for_content_types**](#post_by_small_number_response_body_for_content_types) | **post** /responseBody/postBySmallNumberResponseBodyForContentTypes | -[**post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body**](#post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body) | **post** /requestBody/postInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody | -[**post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types**](#post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types) | **post** /responseBody/postInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfResponseBodyForContentTypes | - -# **post_by_int_request_body** - -> post_by_int_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import multiple_of_api -from unit_test_api.model.by_int import ByInt -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = multiple_of_api.MultipleOfApi(api_client) - - # example passing only required values which don't have defaults set - body = ByInt(None) - try: - api_response = api_instance.post_by_int_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling MultipleOfApi->post_by_int_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**ByInt**](../../models/ByInt.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_by_int_request_body.ApiResponseFor200) | success - -#### post_by_int_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_by_int_response_body_for_content_types** - -> ByInt post_by_int_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import multiple_of_api -from unit_test_api.model.by_int import ByInt -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = multiple_of_api.MultipleOfApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_by_int_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling MultipleOfApi->post_by_int_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_by_int_response_body_for_content_types.ApiResponseFor200) | success - -#### post_by_int_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**ByInt**](../../models/ByInt.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_by_number_request_body** - -> post_by_number_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import multiple_of_api -from unit_test_api.model.by_number import ByNumber -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = multiple_of_api.MultipleOfApi(api_client) - - # example passing only required values which don't have defaults set - body = ByNumber(None) - try: - api_response = api_instance.post_by_number_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling MultipleOfApi->post_by_number_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**ByNumber**](../../models/ByNumber.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_by_number_request_body.ApiResponseFor200) | success - -#### post_by_number_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_by_number_response_body_for_content_types** - -> ByNumber post_by_number_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import multiple_of_api -from unit_test_api.model.by_number import ByNumber -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = multiple_of_api.MultipleOfApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_by_number_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling MultipleOfApi->post_by_number_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_by_number_response_body_for_content_types.ApiResponseFor200) | success - -#### post_by_number_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**ByNumber**](../../models/ByNumber.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_by_small_number_request_body** - -> post_by_small_number_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import multiple_of_api -from unit_test_api.model.by_small_number import BySmallNumber -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = multiple_of_api.MultipleOfApi(api_client) - - # example passing only required values which don't have defaults set - body = BySmallNumber(None) - try: - api_response = api_instance.post_by_small_number_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling MultipleOfApi->post_by_small_number_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**BySmallNumber**](../../models/BySmallNumber.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_by_small_number_request_body.ApiResponseFor200) | success - -#### post_by_small_number_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_by_small_number_response_body_for_content_types** - -> BySmallNumber post_by_small_number_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import multiple_of_api -from unit_test_api.model.by_small_number import BySmallNumber -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = multiple_of_api.MultipleOfApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_by_small_number_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling MultipleOfApi->post_by_small_number_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_by_small_number_response_body_for_content_types.ApiResponseFor200) | success - -#### post_by_small_number_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**BySmallNumber**](../../models/BySmallNumber.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body** - -> post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import multiple_of_api -from unit_test_api.model.invalid_instance_should_not_raise_error_when_float_division_inf import InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = multiple_of_api.MultipleOfApi(api_client) - - # example passing only required values which don't have defaults set - body = InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf(1) - try: - api_response = api_instance.post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling MultipleOfApi->post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf**](../../models/InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body.ApiResponseFor200) | success - -#### post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types** - -> InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import multiple_of_api -from unit_test_api.model.invalid_instance_should_not_raise_error_when_float_division_inf import InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = multiple_of_api.MultipleOfApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling MultipleOfApi->post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types.ApiResponseFor200) | success - -#### post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf**](../../models/InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) +[**post_by_int_request_body**](multiple_of_api/post_by_int_request_body.md) | **post** /requestBody/postByIntRequestBody | +[**post_by_int_response_body_for_content_types**](multiple_of_api/post_by_int_response_body_for_content_types.md) | **post** /responseBody/postByIntResponseBodyForContentTypes | +[**post_by_number_request_body**](multiple_of_api/post_by_number_request_body.md) | **post** /requestBody/postByNumberRequestBody | +[**post_by_number_response_body_for_content_types**](multiple_of_api/post_by_number_response_body_for_content_types.md) | **post** /responseBody/postByNumberResponseBodyForContentTypes | +[**post_by_small_number_request_body**](multiple_of_api/post_by_small_number_request_body.md) | **post** /requestBody/postBySmallNumberRequestBody | +[**post_by_small_number_response_body_for_content_types**](multiple_of_api/post_by_small_number_response_body_for_content_types.md) | **post** /responseBody/postBySmallNumberResponseBodyForContentTypes | +[**post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body**](multiple_of_api/post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body.md) | **post** /requestBody/postInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody | +[**post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types**](multiple_of_api/post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types.md) | **post** /responseBody/postInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfResponseBodyForContentTypes | +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/OneOfApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/OneOfApi.md index 9f6c2b244d0..ef8d659e500 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/OneOfApi.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/OneOfApi.md @@ -1,806 +1,21 @@ - + # unit_test_api.apis.tags.one_of_api.OneOfApi All URIs are relative to *https://someserver.com/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**post_nested_oneof_to_check_validation_semantics_request_body**](#post_nested_oneof_to_check_validation_semantics_request_body) | **post** /requestBody/postNestedOneofToCheckValidationSemanticsRequestBody | -[**post_nested_oneof_to_check_validation_semantics_response_body_for_content_types**](#post_nested_oneof_to_check_validation_semantics_response_body_for_content_types) | **post** /responseBody/postNestedOneofToCheckValidationSemanticsResponseBodyForContentTypes | -[**post_oneof_complex_types_request_body**](#post_oneof_complex_types_request_body) | **post** /requestBody/postOneofComplexTypesRequestBody | -[**post_oneof_complex_types_response_body_for_content_types**](#post_oneof_complex_types_response_body_for_content_types) | **post** /responseBody/postOneofComplexTypesResponseBodyForContentTypes | -[**post_oneof_request_body**](#post_oneof_request_body) | **post** /requestBody/postOneofRequestBody | -[**post_oneof_response_body_for_content_types**](#post_oneof_response_body_for_content_types) | **post** /responseBody/postOneofResponseBodyForContentTypes | -[**post_oneof_with_base_schema_request_body**](#post_oneof_with_base_schema_request_body) | **post** /requestBody/postOneofWithBaseSchemaRequestBody | -[**post_oneof_with_base_schema_response_body_for_content_types**](#post_oneof_with_base_schema_response_body_for_content_types) | **post** /responseBody/postOneofWithBaseSchemaResponseBodyForContentTypes | -[**post_oneof_with_empty_schema_request_body**](#post_oneof_with_empty_schema_request_body) | **post** /requestBody/postOneofWithEmptySchemaRequestBody | -[**post_oneof_with_empty_schema_response_body_for_content_types**](#post_oneof_with_empty_schema_response_body_for_content_types) | **post** /responseBody/postOneofWithEmptySchemaResponseBodyForContentTypes | -[**post_oneof_with_required_request_body**](#post_oneof_with_required_request_body) | **post** /requestBody/postOneofWithRequiredRequestBody | -[**post_oneof_with_required_response_body_for_content_types**](#post_oneof_with_required_response_body_for_content_types) | **post** /responseBody/postOneofWithRequiredResponseBodyForContentTypes | - -# **post_nested_oneof_to_check_validation_semantics_request_body** - -> post_nested_oneof_to_check_validation_semantics_request_body(nested_oneof_to_check_validation_semantics) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import one_of_api -from unit_test_api.model.nested_oneof_to_check_validation_semantics import NestedOneofToCheckValidationSemantics -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = one_of_api.OneOfApi(api_client) - - # example passing only required values which don't have defaults set - body = NestedOneofToCheckValidationSemantics(None) - try: - api_response = api_instance.post_nested_oneof_to_check_validation_semantics_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OneOfApi->post_nested_oneof_to_check_validation_semantics_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**NestedOneofToCheckValidationSemantics**](../../models/NestedOneofToCheckValidationSemantics.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_nested_oneof_to_check_validation_semantics_request_body.ApiResponseFor200) | success - -#### post_nested_oneof_to_check_validation_semantics_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_nested_oneof_to_check_validation_semantics_response_body_for_content_types** - -> NestedOneofToCheckValidationSemantics post_nested_oneof_to_check_validation_semantics_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import one_of_api -from unit_test_api.model.nested_oneof_to_check_validation_semantics import NestedOneofToCheckValidationSemantics -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = one_of_api.OneOfApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_nested_oneof_to_check_validation_semantics_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling OneOfApi->post_nested_oneof_to_check_validation_semantics_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_nested_oneof_to_check_validation_semantics_response_body_for_content_types.ApiResponseFor200) | success - -#### post_nested_oneof_to_check_validation_semantics_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**NestedOneofToCheckValidationSemantics**](../../models/NestedOneofToCheckValidationSemantics.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_oneof_complex_types_request_body** - -> post_oneof_complex_types_request_body(oneof_complex_types) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import one_of_api -from unit_test_api.model.oneof_complex_types import OneofComplexTypes -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = one_of_api.OneOfApi(api_client) - - # example passing only required values which don't have defaults set - body = OneofComplexTypes(None) - try: - api_response = api_instance.post_oneof_complex_types_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OneOfApi->post_oneof_complex_types_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**OneofComplexTypes**](../../models/OneofComplexTypes.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_oneof_complex_types_request_body.ApiResponseFor200) | success - -#### post_oneof_complex_types_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_oneof_complex_types_response_body_for_content_types** - -> OneofComplexTypes post_oneof_complex_types_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import one_of_api -from unit_test_api.model.oneof_complex_types import OneofComplexTypes -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = one_of_api.OneOfApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_oneof_complex_types_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling OneOfApi->post_oneof_complex_types_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_oneof_complex_types_response_body_for_content_types.ApiResponseFor200) | success - -#### post_oneof_complex_types_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**OneofComplexTypes**](../../models/OneofComplexTypes.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_oneof_request_body** - -> post_oneof_request_body(oneof) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import one_of_api -from unit_test_api.model.oneof import Oneof -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = one_of_api.OneOfApi(api_client) - - # example passing only required values which don't have defaults set - body = Oneof(None) - try: - api_response = api_instance.post_oneof_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OneOfApi->post_oneof_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**Oneof**](../../models/Oneof.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_oneof_request_body.ApiResponseFor200) | success - -#### post_oneof_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_oneof_response_body_for_content_types** - -> Oneof post_oneof_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import one_of_api -from unit_test_api.model.oneof import Oneof -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = one_of_api.OneOfApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_oneof_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling OneOfApi->post_oneof_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_oneof_response_body_for_content_types.ApiResponseFor200) | success - -#### post_oneof_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**Oneof**](../../models/Oneof.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_oneof_with_base_schema_request_body** - -> post_oneof_with_base_schema_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import one_of_api -from unit_test_api.model.oneof_with_base_schema import OneofWithBaseSchema -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = one_of_api.OneOfApi(api_client) - - # example passing only required values which don't have defaults set - body = OneofWithBaseSchema("body_example") - try: - api_response = api_instance.post_oneof_with_base_schema_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OneOfApi->post_oneof_with_base_schema_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**OneofWithBaseSchema**](../../models/OneofWithBaseSchema.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_oneof_with_base_schema_request_body.ApiResponseFor200) | success - -#### post_oneof_with_base_schema_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_oneof_with_base_schema_response_body_for_content_types** - -> OneofWithBaseSchema post_oneof_with_base_schema_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import one_of_api -from unit_test_api.model.oneof_with_base_schema import OneofWithBaseSchema -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = one_of_api.OneOfApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_oneof_with_base_schema_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling OneOfApi->post_oneof_with_base_schema_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_oneof_with_base_schema_response_body_for_content_types.ApiResponseFor200) | success - -#### post_oneof_with_base_schema_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**OneofWithBaseSchema**](../../models/OneofWithBaseSchema.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_oneof_with_empty_schema_request_body** - -> post_oneof_with_empty_schema_request_body(oneof_with_empty_schema) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import one_of_api -from unit_test_api.model.oneof_with_empty_schema import OneofWithEmptySchema -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = one_of_api.OneOfApi(api_client) - - # example passing only required values which don't have defaults set - body = OneofWithEmptySchema(None) - try: - api_response = api_instance.post_oneof_with_empty_schema_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OneOfApi->post_oneof_with_empty_schema_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**OneofWithEmptySchema**](../../models/OneofWithEmptySchema.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_oneof_with_empty_schema_request_body.ApiResponseFor200) | success - -#### post_oneof_with_empty_schema_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_oneof_with_empty_schema_response_body_for_content_types** - -> OneofWithEmptySchema post_oneof_with_empty_schema_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import one_of_api -from unit_test_api.model.oneof_with_empty_schema import OneofWithEmptySchema -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = one_of_api.OneOfApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_oneof_with_empty_schema_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling OneOfApi->post_oneof_with_empty_schema_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_oneof_with_empty_schema_response_body_for_content_types.ApiResponseFor200) | success - -#### post_oneof_with_empty_schema_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**OneofWithEmptySchema**](../../models/OneofWithEmptySchema.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_oneof_with_required_request_body** - -> post_oneof_with_required_request_body(oneof_with_required) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import one_of_api -from unit_test_api.model.oneof_with_required import OneofWithRequired -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = one_of_api.OneOfApi(api_client) - - # example passing only required values which don't have defaults set - body = OneofWithRequired() - try: - api_response = api_instance.post_oneof_with_required_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OneOfApi->post_oneof_with_required_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**OneofWithRequired**](../../models/OneofWithRequired.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_oneof_with_required_request_body.ApiResponseFor200) | success - -#### post_oneof_with_required_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_oneof_with_required_response_body_for_content_types** - -> OneofWithRequired post_oneof_with_required_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import one_of_api -from unit_test_api.model.oneof_with_required import OneofWithRequired -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = one_of_api.OneOfApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_oneof_with_required_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling OneOfApi->post_oneof_with_required_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_oneof_with_required_response_body_for_content_types.ApiResponseFor200) | success - -#### post_oneof_with_required_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**OneofWithRequired**](../../models/OneofWithRequired.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - +[**post_nested_oneof_to_check_validation_semantics_request_body**](one_of_api/post_nested_oneof_to_check_validation_semantics_request_body.md) | **post** /requestBody/postNestedOneofToCheckValidationSemanticsRequestBody | +[**post_nested_oneof_to_check_validation_semantics_response_body_for_content_types**](one_of_api/post_nested_oneof_to_check_validation_semantics_response_body_for_content_types.md) | **post** /responseBody/postNestedOneofToCheckValidationSemanticsResponseBodyForContentTypes | +[**post_oneof_complex_types_request_body**](one_of_api/post_oneof_complex_types_request_body.md) | **post** /requestBody/postOneofComplexTypesRequestBody | +[**post_oneof_complex_types_response_body_for_content_types**](one_of_api/post_oneof_complex_types_response_body_for_content_types.md) | **post** /responseBody/postOneofComplexTypesResponseBodyForContentTypes | +[**post_oneof_request_body**](one_of_api/post_oneof_request_body.md) | **post** /requestBody/postOneofRequestBody | +[**post_oneof_response_body_for_content_types**](one_of_api/post_oneof_response_body_for_content_types.md) | **post** /responseBody/postOneofResponseBodyForContentTypes | +[**post_oneof_with_base_schema_request_body**](one_of_api/post_oneof_with_base_schema_request_body.md) | **post** /requestBody/postOneofWithBaseSchemaRequestBody | +[**post_oneof_with_base_schema_response_body_for_content_types**](one_of_api/post_oneof_with_base_schema_response_body_for_content_types.md) | **post** /responseBody/postOneofWithBaseSchemaResponseBodyForContentTypes | +[**post_oneof_with_empty_schema_request_body**](one_of_api/post_oneof_with_empty_schema_request_body.md) | **post** /requestBody/postOneofWithEmptySchemaRequestBody | +[**post_oneof_with_empty_schema_response_body_for_content_types**](one_of_api/post_oneof_with_empty_schema_response_body_for_content_types.md) | **post** /responseBody/postOneofWithEmptySchemaResponseBodyForContentTypes | +[**post_oneof_with_required_request_body**](one_of_api/post_oneof_with_required_request_body.md) | **post** /requestBody/postOneofWithRequiredRequestBody | +[**post_oneof_with_required_response_body_for_content_types**](one_of_api/post_oneof_with_required_response_body_for_content_types.md) | **post** /responseBody/postOneofWithRequiredResponseBodyForContentTypes | + +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/OperationRequestBodyApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/OperationRequestBodyApi.md index b483f613cc3..75ecae227fc 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/OperationRequestBodyApi.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/OperationRequestBodyApi.md @@ -1,6335 +1,96 @@ - + # unit_test_api.apis.tags.operation_request_body_api.OperationRequestBodyApi All URIs are relative to *https://someserver.com/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**post_additionalproperties_allows_a_schema_which_should_validate_request_body**](#post_additionalproperties_allows_a_schema_which_should_validate_request_body) | **post** /requestBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody | -[**post_additionalproperties_are_allowed_by_default_request_body**](#post_additionalproperties_are_allowed_by_default_request_body) | **post** /requestBody/postAdditionalpropertiesAreAllowedByDefaultRequestBody | -[**post_additionalproperties_can_exist_by_itself_request_body**](#post_additionalproperties_can_exist_by_itself_request_body) | **post** /requestBody/postAdditionalpropertiesCanExistByItselfRequestBody | -[**post_additionalproperties_should_not_look_in_applicators_request_body**](#post_additionalproperties_should_not_look_in_applicators_request_body) | **post** /requestBody/postAdditionalpropertiesShouldNotLookInApplicatorsRequestBody | -[**post_allof_combined_with_anyof_oneof_request_body**](#post_allof_combined_with_anyof_oneof_request_body) | **post** /requestBody/postAllofCombinedWithAnyofOneofRequestBody | -[**post_allof_request_body**](#post_allof_request_body) | **post** /requestBody/postAllofRequestBody | -[**post_allof_simple_types_request_body**](#post_allof_simple_types_request_body) | **post** /requestBody/postAllofSimpleTypesRequestBody | -[**post_allof_with_base_schema_request_body**](#post_allof_with_base_schema_request_body) | **post** /requestBody/postAllofWithBaseSchemaRequestBody | -[**post_allof_with_one_empty_schema_request_body**](#post_allof_with_one_empty_schema_request_body) | **post** /requestBody/postAllofWithOneEmptySchemaRequestBody | -[**post_allof_with_the_first_empty_schema_request_body**](#post_allof_with_the_first_empty_schema_request_body) | **post** /requestBody/postAllofWithTheFirstEmptySchemaRequestBody | -[**post_allof_with_the_last_empty_schema_request_body**](#post_allof_with_the_last_empty_schema_request_body) | **post** /requestBody/postAllofWithTheLastEmptySchemaRequestBody | -[**post_allof_with_two_empty_schemas_request_body**](#post_allof_with_two_empty_schemas_request_body) | **post** /requestBody/postAllofWithTwoEmptySchemasRequestBody | -[**post_anyof_complex_types_request_body**](#post_anyof_complex_types_request_body) | **post** /requestBody/postAnyofComplexTypesRequestBody | -[**post_anyof_request_body**](#post_anyof_request_body) | **post** /requestBody/postAnyofRequestBody | -[**post_anyof_with_base_schema_request_body**](#post_anyof_with_base_schema_request_body) | **post** /requestBody/postAnyofWithBaseSchemaRequestBody | -[**post_anyof_with_one_empty_schema_request_body**](#post_anyof_with_one_empty_schema_request_body) | **post** /requestBody/postAnyofWithOneEmptySchemaRequestBody | -[**post_array_type_matches_arrays_request_body**](#post_array_type_matches_arrays_request_body) | **post** /requestBody/postArrayTypeMatchesArraysRequestBody | -[**post_boolean_type_matches_booleans_request_body**](#post_boolean_type_matches_booleans_request_body) | **post** /requestBody/postBooleanTypeMatchesBooleansRequestBody | -[**post_by_int_request_body**](#post_by_int_request_body) | **post** /requestBody/postByIntRequestBody | -[**post_by_number_request_body**](#post_by_number_request_body) | **post** /requestBody/postByNumberRequestBody | -[**post_by_small_number_request_body**](#post_by_small_number_request_body) | **post** /requestBody/postBySmallNumberRequestBody | -[**post_date_time_format_request_body**](#post_date_time_format_request_body) | **post** /requestBody/postDateTimeFormatRequestBody | -[**post_email_format_request_body**](#post_email_format_request_body) | **post** /requestBody/postEmailFormatRequestBody | -[**post_enum_with0_does_not_match_false_request_body**](#post_enum_with0_does_not_match_false_request_body) | **post** /requestBody/postEnumWith0DoesNotMatchFalseRequestBody | -[**post_enum_with1_does_not_match_true_request_body**](#post_enum_with1_does_not_match_true_request_body) | **post** /requestBody/postEnumWith1DoesNotMatchTrueRequestBody | -[**post_enum_with_escaped_characters_request_body**](#post_enum_with_escaped_characters_request_body) | **post** /requestBody/postEnumWithEscapedCharactersRequestBody | -[**post_enum_with_false_does_not_match0_request_body**](#post_enum_with_false_does_not_match0_request_body) | **post** /requestBody/postEnumWithFalseDoesNotMatch0RequestBody | -[**post_enum_with_true_does_not_match1_request_body**](#post_enum_with_true_does_not_match1_request_body) | **post** /requestBody/postEnumWithTrueDoesNotMatch1RequestBody | -[**post_enums_in_properties_request_body**](#post_enums_in_properties_request_body) | **post** /requestBody/postEnumsInPropertiesRequestBody | -[**post_forbidden_property_request_body**](#post_forbidden_property_request_body) | **post** /requestBody/postForbiddenPropertyRequestBody | -[**post_hostname_format_request_body**](#post_hostname_format_request_body) | **post** /requestBody/postHostnameFormatRequestBody | -[**post_integer_type_matches_integers_request_body**](#post_integer_type_matches_integers_request_body) | **post** /requestBody/postIntegerTypeMatchesIntegersRequestBody | -[**post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body**](#post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body) | **post** /requestBody/postInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody | -[**post_invalid_string_value_for_default_request_body**](#post_invalid_string_value_for_default_request_body) | **post** /requestBody/postInvalidStringValueForDefaultRequestBody | -[**post_ipv4_format_request_body**](#post_ipv4_format_request_body) | **post** /requestBody/postIpv4FormatRequestBody | -[**post_ipv6_format_request_body**](#post_ipv6_format_request_body) | **post** /requestBody/postIpv6FormatRequestBody | -[**post_json_pointer_format_request_body**](#post_json_pointer_format_request_body) | **post** /requestBody/postJsonPointerFormatRequestBody | -[**post_maximum_validation_request_body**](#post_maximum_validation_request_body) | **post** /requestBody/postMaximumValidationRequestBody | -[**post_maximum_validation_with_unsigned_integer_request_body**](#post_maximum_validation_with_unsigned_integer_request_body) | **post** /requestBody/postMaximumValidationWithUnsignedIntegerRequestBody | -[**post_maxitems_validation_request_body**](#post_maxitems_validation_request_body) | **post** /requestBody/postMaxitemsValidationRequestBody | -[**post_maxlength_validation_request_body**](#post_maxlength_validation_request_body) | **post** /requestBody/postMaxlengthValidationRequestBody | -[**post_maxproperties0_means_the_object_is_empty_request_body**](#post_maxproperties0_means_the_object_is_empty_request_body) | **post** /requestBody/postMaxproperties0MeansTheObjectIsEmptyRequestBody | -[**post_maxproperties_validation_request_body**](#post_maxproperties_validation_request_body) | **post** /requestBody/postMaxpropertiesValidationRequestBody | -[**post_minimum_validation_request_body**](#post_minimum_validation_request_body) | **post** /requestBody/postMinimumValidationRequestBody | -[**post_minimum_validation_with_signed_integer_request_body**](#post_minimum_validation_with_signed_integer_request_body) | **post** /requestBody/postMinimumValidationWithSignedIntegerRequestBody | -[**post_minitems_validation_request_body**](#post_minitems_validation_request_body) | **post** /requestBody/postMinitemsValidationRequestBody | -[**post_minlength_validation_request_body**](#post_minlength_validation_request_body) | **post** /requestBody/postMinlengthValidationRequestBody | -[**post_minproperties_validation_request_body**](#post_minproperties_validation_request_body) | **post** /requestBody/postMinpropertiesValidationRequestBody | -[**post_nested_allof_to_check_validation_semantics_request_body**](#post_nested_allof_to_check_validation_semantics_request_body) | **post** /requestBody/postNestedAllofToCheckValidationSemanticsRequestBody | -[**post_nested_anyof_to_check_validation_semantics_request_body**](#post_nested_anyof_to_check_validation_semantics_request_body) | **post** /requestBody/postNestedAnyofToCheckValidationSemanticsRequestBody | -[**post_nested_items_request_body**](#post_nested_items_request_body) | **post** /requestBody/postNestedItemsRequestBody | -[**post_nested_oneof_to_check_validation_semantics_request_body**](#post_nested_oneof_to_check_validation_semantics_request_body) | **post** /requestBody/postNestedOneofToCheckValidationSemanticsRequestBody | -[**post_not_more_complex_schema_request_body**](#post_not_more_complex_schema_request_body) | **post** /requestBody/postNotMoreComplexSchemaRequestBody | -[**post_not_request_body**](#post_not_request_body) | **post** /requestBody/postNotRequestBody | -[**post_nul_characters_in_strings_request_body**](#post_nul_characters_in_strings_request_body) | **post** /requestBody/postNulCharactersInStringsRequestBody | -[**post_null_type_matches_only_the_null_object_request_body**](#post_null_type_matches_only_the_null_object_request_body) | **post** /requestBody/postNullTypeMatchesOnlyTheNullObjectRequestBody | -[**post_number_type_matches_numbers_request_body**](#post_number_type_matches_numbers_request_body) | **post** /requestBody/postNumberTypeMatchesNumbersRequestBody | -[**post_object_properties_validation_request_body**](#post_object_properties_validation_request_body) | **post** /requestBody/postObjectPropertiesValidationRequestBody | -[**post_object_type_matches_objects_request_body**](#post_object_type_matches_objects_request_body) | **post** /requestBody/postObjectTypeMatchesObjectsRequestBody | -[**post_oneof_complex_types_request_body**](#post_oneof_complex_types_request_body) | **post** /requestBody/postOneofComplexTypesRequestBody | -[**post_oneof_request_body**](#post_oneof_request_body) | **post** /requestBody/postOneofRequestBody | -[**post_oneof_with_base_schema_request_body**](#post_oneof_with_base_schema_request_body) | **post** /requestBody/postOneofWithBaseSchemaRequestBody | -[**post_oneof_with_empty_schema_request_body**](#post_oneof_with_empty_schema_request_body) | **post** /requestBody/postOneofWithEmptySchemaRequestBody | -[**post_oneof_with_required_request_body**](#post_oneof_with_required_request_body) | **post** /requestBody/postOneofWithRequiredRequestBody | -[**post_pattern_is_not_anchored_request_body**](#post_pattern_is_not_anchored_request_body) | **post** /requestBody/postPatternIsNotAnchoredRequestBody | -[**post_pattern_validation_request_body**](#post_pattern_validation_request_body) | **post** /requestBody/postPatternValidationRequestBody | -[**post_properties_with_escaped_characters_request_body**](#post_properties_with_escaped_characters_request_body) | **post** /requestBody/postPropertiesWithEscapedCharactersRequestBody | -[**post_property_named_ref_that_is_not_a_reference_request_body**](#post_property_named_ref_that_is_not_a_reference_request_body) | **post** /requestBody/postPropertyNamedRefThatIsNotAReferenceRequestBody | -[**post_ref_in_additionalproperties_request_body**](#post_ref_in_additionalproperties_request_body) | **post** /requestBody/postRefInAdditionalpropertiesRequestBody | -[**post_ref_in_allof_request_body**](#post_ref_in_allof_request_body) | **post** /requestBody/postRefInAllofRequestBody | -[**post_ref_in_anyof_request_body**](#post_ref_in_anyof_request_body) | **post** /requestBody/postRefInAnyofRequestBody | -[**post_ref_in_items_request_body**](#post_ref_in_items_request_body) | **post** /requestBody/postRefInItemsRequestBody | -[**post_ref_in_not_request_body**](#post_ref_in_not_request_body) | **post** /requestBody/postRefInNotRequestBody | -[**post_ref_in_oneof_request_body**](#post_ref_in_oneof_request_body) | **post** /requestBody/postRefInOneofRequestBody | -[**post_ref_in_property_request_body**](#post_ref_in_property_request_body) | **post** /requestBody/postRefInPropertyRequestBody | -[**post_required_default_validation_request_body**](#post_required_default_validation_request_body) | **post** /requestBody/postRequiredDefaultValidationRequestBody | -[**post_required_validation_request_body**](#post_required_validation_request_body) | **post** /requestBody/postRequiredValidationRequestBody | -[**post_required_with_empty_array_request_body**](#post_required_with_empty_array_request_body) | **post** /requestBody/postRequiredWithEmptyArrayRequestBody | -[**post_required_with_escaped_characters_request_body**](#post_required_with_escaped_characters_request_body) | **post** /requestBody/postRequiredWithEscapedCharactersRequestBody | -[**post_simple_enum_validation_request_body**](#post_simple_enum_validation_request_body) | **post** /requestBody/postSimpleEnumValidationRequestBody | -[**post_string_type_matches_strings_request_body**](#post_string_type_matches_strings_request_body) | **post** /requestBody/postStringTypeMatchesStringsRequestBody | -[**post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body**](#post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body) | **post** /requestBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody | -[**post_uniqueitems_false_validation_request_body**](#post_uniqueitems_false_validation_request_body) | **post** /requestBody/postUniqueitemsFalseValidationRequestBody | -[**post_uniqueitems_validation_request_body**](#post_uniqueitems_validation_request_body) | **post** /requestBody/postUniqueitemsValidationRequestBody | -[**post_uri_format_request_body**](#post_uri_format_request_body) | **post** /requestBody/postUriFormatRequestBody | -[**post_uri_reference_format_request_body**](#post_uri_reference_format_request_body) | **post** /requestBody/postUriReferenceFormatRequestBody | -[**post_uri_template_format_request_body**](#post_uri_template_format_request_body) | **post** /requestBody/postUriTemplateFormatRequestBody | - -# **post_additionalproperties_allows_a_schema_which_should_validate_request_body** - -> post_additionalproperties_allows_a_schema_which_should_validate_request_body(additionalproperties_allows_a_schema_which_should_validate) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.additionalproperties_allows_a_schema_which_should_validate import AdditionalpropertiesAllowsASchemaWhichShouldValidate -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = AdditionalpropertiesAllowsASchemaWhichShouldValidate( - foo=None, - bar=None, - ) - try: - api_response = api_instance.post_additionalproperties_allows_a_schema_which_should_validate_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_additionalproperties_allows_a_schema_which_should_validate_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AdditionalpropertiesAllowsASchemaWhichShouldValidate**](../../models/AdditionalpropertiesAllowsASchemaWhichShouldValidate.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_additionalproperties_allows_a_schema_which_should_validate_request_body.ApiResponseFor200) | success - -#### post_additionalproperties_allows_a_schema_which_should_validate_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_additionalproperties_are_allowed_by_default_request_body** - -> post_additionalproperties_are_allowed_by_default_request_body(additionalproperties_are_allowed_by_default) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.additionalproperties_are_allowed_by_default import AdditionalpropertiesAreAllowedByDefault -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = AdditionalpropertiesAreAllowedByDefault(None) - try: - api_response = api_instance.post_additionalproperties_are_allowed_by_default_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_additionalproperties_are_allowed_by_default_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AdditionalpropertiesAreAllowedByDefault**](../../models/AdditionalpropertiesAreAllowedByDefault.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_additionalproperties_are_allowed_by_default_request_body.ApiResponseFor200) | success - -#### post_additionalproperties_are_allowed_by_default_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_additionalproperties_can_exist_by_itself_request_body** - -> post_additionalproperties_can_exist_by_itself_request_body(additionalproperties_can_exist_by_itself) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.additionalproperties_can_exist_by_itself import AdditionalpropertiesCanExistByItself -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = AdditionalpropertiesCanExistByItself( - key=True, - ) - try: - api_response = api_instance.post_additionalproperties_can_exist_by_itself_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_additionalproperties_can_exist_by_itself_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AdditionalpropertiesCanExistByItself**](../../models/AdditionalpropertiesCanExistByItself.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_additionalproperties_can_exist_by_itself_request_body.ApiResponseFor200) | success - -#### post_additionalproperties_can_exist_by_itself_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_additionalproperties_should_not_look_in_applicators_request_body** - -> post_additionalproperties_should_not_look_in_applicators_request_body(additionalproperties_should_not_look_in_applicators) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.additionalproperties_should_not_look_in_applicators import AdditionalpropertiesShouldNotLookInApplicators -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = AdditionalpropertiesShouldNotLookInApplicators(None) - try: - api_response = api_instance.post_additionalproperties_should_not_look_in_applicators_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_additionalproperties_should_not_look_in_applicators_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AdditionalpropertiesShouldNotLookInApplicators**](../../models/AdditionalpropertiesShouldNotLookInApplicators.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_additionalproperties_should_not_look_in_applicators_request_body.ApiResponseFor200) | success - -#### post_additionalproperties_should_not_look_in_applicators_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_allof_combined_with_anyof_oneof_request_body** - -> post_allof_combined_with_anyof_oneof_request_body(allof_combined_with_anyof_oneof) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.allof_combined_with_anyof_oneof import AllofCombinedWithAnyofOneof -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = AllofCombinedWithAnyofOneof(None) - try: - api_response = api_instance.post_allof_combined_with_anyof_oneof_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_allof_combined_with_anyof_oneof_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AllofCombinedWithAnyofOneof**](../../models/AllofCombinedWithAnyofOneof.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_allof_combined_with_anyof_oneof_request_body.ApiResponseFor200) | success - -#### post_allof_combined_with_anyof_oneof_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_allof_request_body** - -> post_allof_request_body(allof) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.allof import Allof -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = Allof(None) - try: - api_response = api_instance.post_allof_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_allof_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**Allof**](../../models/Allof.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_allof_request_body.ApiResponseFor200) | success - -#### post_allof_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_allof_simple_types_request_body** - -> post_allof_simple_types_request_body(allof_simple_types) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.allof_simple_types import AllofSimpleTypes -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = AllofSimpleTypes(None) - try: - api_response = api_instance.post_allof_simple_types_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_allof_simple_types_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AllofSimpleTypes**](../../models/AllofSimpleTypes.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_allof_simple_types_request_body.ApiResponseFor200) | success - -#### post_allof_simple_types_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_allof_with_base_schema_request_body** - -> post_allof_with_base_schema_request_body(allof_with_base_schema) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.allof_with_base_schema import AllofWithBaseSchema -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = AllofWithBaseSchema({}) - try: - api_response = api_instance.post_allof_with_base_schema_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_allof_with_base_schema_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AllofWithBaseSchema**](../../models/AllofWithBaseSchema.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_allof_with_base_schema_request_body.ApiResponseFor200) | success - -#### post_allof_with_base_schema_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_allof_with_one_empty_schema_request_body** - -> post_allof_with_one_empty_schema_request_body(allof_with_one_empty_schema) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.allof_with_one_empty_schema import AllofWithOneEmptySchema -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = AllofWithOneEmptySchema(None) - try: - api_response = api_instance.post_allof_with_one_empty_schema_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_allof_with_one_empty_schema_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AllofWithOneEmptySchema**](../../models/AllofWithOneEmptySchema.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_allof_with_one_empty_schema_request_body.ApiResponseFor200) | success - -#### post_allof_with_one_empty_schema_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_allof_with_the_first_empty_schema_request_body** - -> post_allof_with_the_first_empty_schema_request_body(allof_with_the_first_empty_schema) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.allof_with_the_first_empty_schema import AllofWithTheFirstEmptySchema -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = AllofWithTheFirstEmptySchema(None) - try: - api_response = api_instance.post_allof_with_the_first_empty_schema_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_allof_with_the_first_empty_schema_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AllofWithTheFirstEmptySchema**](../../models/AllofWithTheFirstEmptySchema.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_allof_with_the_first_empty_schema_request_body.ApiResponseFor200) | success - -#### post_allof_with_the_first_empty_schema_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_allof_with_the_last_empty_schema_request_body** - -> post_allof_with_the_last_empty_schema_request_body(allof_with_the_last_empty_schema) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.allof_with_the_last_empty_schema import AllofWithTheLastEmptySchema -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = AllofWithTheLastEmptySchema(None) - try: - api_response = api_instance.post_allof_with_the_last_empty_schema_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_allof_with_the_last_empty_schema_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AllofWithTheLastEmptySchema**](../../models/AllofWithTheLastEmptySchema.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_allof_with_the_last_empty_schema_request_body.ApiResponseFor200) | success - -#### post_allof_with_the_last_empty_schema_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_allof_with_two_empty_schemas_request_body** - -> post_allof_with_two_empty_schemas_request_body(allof_with_two_empty_schemas) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.allof_with_two_empty_schemas import AllofWithTwoEmptySchemas -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = AllofWithTwoEmptySchemas(None) - try: - api_response = api_instance.post_allof_with_two_empty_schemas_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_allof_with_two_empty_schemas_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AllofWithTwoEmptySchemas**](../../models/AllofWithTwoEmptySchemas.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_allof_with_two_empty_schemas_request_body.ApiResponseFor200) | success - -#### post_allof_with_two_empty_schemas_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_anyof_complex_types_request_body** - -> post_anyof_complex_types_request_body(anyof_complex_types) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.anyof_complex_types import AnyofComplexTypes -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = AnyofComplexTypes(None) - try: - api_response = api_instance.post_anyof_complex_types_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_anyof_complex_types_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AnyofComplexTypes**](../../models/AnyofComplexTypes.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_anyof_complex_types_request_body.ApiResponseFor200) | success - -#### post_anyof_complex_types_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_anyof_request_body** - -> post_anyof_request_body(anyof) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.anyof import Anyof -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = Anyof(None) - try: - api_response = api_instance.post_anyof_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_anyof_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**Anyof**](../../models/Anyof.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_anyof_request_body.ApiResponseFor200) | success - -#### post_anyof_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_anyof_with_base_schema_request_body** - -> post_anyof_with_base_schema_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.anyof_with_base_schema import AnyofWithBaseSchema -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = AnyofWithBaseSchema("body_example") - try: - api_response = api_instance.post_anyof_with_base_schema_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_anyof_with_base_schema_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AnyofWithBaseSchema**](../../models/AnyofWithBaseSchema.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_anyof_with_base_schema_request_body.ApiResponseFor200) | success - -#### post_anyof_with_base_schema_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_anyof_with_one_empty_schema_request_body** - -> post_anyof_with_one_empty_schema_request_body(anyof_with_one_empty_schema) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.anyof_with_one_empty_schema import AnyofWithOneEmptySchema -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = AnyofWithOneEmptySchema(None) - try: - api_response = api_instance.post_anyof_with_one_empty_schema_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_anyof_with_one_empty_schema_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AnyofWithOneEmptySchema**](../../models/AnyofWithOneEmptySchema.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_anyof_with_one_empty_schema_request_body.ApiResponseFor200) | success - -#### post_anyof_with_one_empty_schema_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_array_type_matches_arrays_request_body** - -> post_array_type_matches_arrays_request_body(array_type_matches_arrays) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.array_type_matches_arrays import ArrayTypeMatchesArrays -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = ArrayTypeMatchesArrays([ - None - ]) - try: - api_response = api_instance.post_array_type_matches_arrays_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_array_type_matches_arrays_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**ArrayTypeMatchesArrays**](../../models/ArrayTypeMatchesArrays.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_array_type_matches_arrays_request_body.ApiResponseFor200) | success - -#### post_array_type_matches_arrays_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_boolean_type_matches_booleans_request_body** - -> post_boolean_type_matches_booleans_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = True - try: - api_response = api_instance.post_boolean_type_matches_booleans_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_boolean_type_matches_booleans_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -bool, | BoolClass, | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_boolean_type_matches_booleans_request_body.ApiResponseFor200) | success - -#### post_boolean_type_matches_booleans_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_by_int_request_body** - -> post_by_int_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.by_int import ByInt -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = ByInt(None) - try: - api_response = api_instance.post_by_int_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_by_int_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**ByInt**](../../models/ByInt.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_by_int_request_body.ApiResponseFor200) | success - -#### post_by_int_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_by_number_request_body** - -> post_by_number_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.by_number import ByNumber -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = ByNumber(None) - try: - api_response = api_instance.post_by_number_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_by_number_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**ByNumber**](../../models/ByNumber.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_by_number_request_body.ApiResponseFor200) | success - -#### post_by_number_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_by_small_number_request_body** - -> post_by_small_number_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.by_small_number import BySmallNumber -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = BySmallNumber(None) - try: - api_response = api_instance.post_by_small_number_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_by_small_number_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**BySmallNumber**](../../models/BySmallNumber.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_by_small_number_request_body.ApiResponseFor200) | success - -#### post_by_small_number_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_date_time_format_request_body** - -> post_date_time_format_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = None - try: - api_response = api_instance.post_date_time_format_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_date_time_format_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | value must conform to RFC-3339 date-time - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_date_time_format_request_body.ApiResponseFor200) | success - -#### post_date_time_format_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_email_format_request_body** - -> post_email_format_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = None - try: - api_response = api_instance.post_email_format_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_email_format_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_email_format_request_body.ApiResponseFor200) | success - -#### post_email_format_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_enum_with0_does_not_match_false_request_body** - -> post_enum_with0_does_not_match_false_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.enum_with0_does_not_match_false import EnumWith0DoesNotMatchFalse -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = EnumWith0DoesNotMatchFalse(0) - try: - api_response = api_instance.post_enum_with0_does_not_match_false_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_enum_with0_does_not_match_false_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**EnumWith0DoesNotMatchFalse**](../../models/EnumWith0DoesNotMatchFalse.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_enum_with0_does_not_match_false_request_body.ApiResponseFor200) | success - -#### post_enum_with0_does_not_match_false_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_enum_with1_does_not_match_true_request_body** - -> post_enum_with1_does_not_match_true_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.enum_with1_does_not_match_true import EnumWith1DoesNotMatchTrue -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = EnumWith1DoesNotMatchTrue(1) - try: - api_response = api_instance.post_enum_with1_does_not_match_true_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_enum_with1_does_not_match_true_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**EnumWith1DoesNotMatchTrue**](../../models/EnumWith1DoesNotMatchTrue.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_enum_with1_does_not_match_true_request_body.ApiResponseFor200) | success - -#### post_enum_with1_does_not_match_true_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_enum_with_escaped_characters_request_body** - -> post_enum_with_escaped_characters_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.enum_with_escaped_characters import EnumWithEscapedCharacters -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = EnumWithEscapedCharacters("foo\nbar") - try: - api_response = api_instance.post_enum_with_escaped_characters_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_enum_with_escaped_characters_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**EnumWithEscapedCharacters**](../../models/EnumWithEscapedCharacters.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_enum_with_escaped_characters_request_body.ApiResponseFor200) | success - -#### post_enum_with_escaped_characters_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_enum_with_false_does_not_match0_request_body** - -> post_enum_with_false_does_not_match0_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.enum_with_false_does_not_match0 import EnumWithFalseDoesNotMatch0 -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = EnumWithFalseDoesNotMatch0(False) - try: - api_response = api_instance.post_enum_with_false_does_not_match0_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_enum_with_false_does_not_match0_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**EnumWithFalseDoesNotMatch0**](../../models/EnumWithFalseDoesNotMatch0.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_enum_with_false_does_not_match0_request_body.ApiResponseFor200) | success - -#### post_enum_with_false_does_not_match0_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_enum_with_true_does_not_match1_request_body** - -> post_enum_with_true_does_not_match1_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.enum_with_true_does_not_match1 import EnumWithTrueDoesNotMatch1 -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = EnumWithTrueDoesNotMatch1(True) - try: - api_response = api_instance.post_enum_with_true_does_not_match1_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_enum_with_true_does_not_match1_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**EnumWithTrueDoesNotMatch1**](../../models/EnumWithTrueDoesNotMatch1.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_enum_with_true_does_not_match1_request_body.ApiResponseFor200) | success - -#### post_enum_with_true_does_not_match1_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_enums_in_properties_request_body** - -> post_enums_in_properties_request_body(enums_in_properties) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.enums_in_properties import EnumsInProperties -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = EnumsInProperties( - foo="foo", - bar="bar", - ) - try: - api_response = api_instance.post_enums_in_properties_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_enums_in_properties_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**EnumsInProperties**](../../models/EnumsInProperties.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_enums_in_properties_request_body.ApiResponseFor200) | success - -#### post_enums_in_properties_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_forbidden_property_request_body** - -> post_forbidden_property_request_body(forbidden_property) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.forbidden_property import ForbiddenProperty -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = ForbiddenProperty(None) - try: - api_response = api_instance.post_forbidden_property_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_forbidden_property_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**ForbiddenProperty**](../../models/ForbiddenProperty.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_forbidden_property_request_body.ApiResponseFor200) | success - -#### post_forbidden_property_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_hostname_format_request_body** - -> post_hostname_format_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = None - try: - api_response = api_instance.post_hostname_format_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_hostname_format_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_hostname_format_request_body.ApiResponseFor200) | success - -#### post_hostname_format_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_integer_type_matches_integers_request_body** - -> post_integer_type_matches_integers_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = 1 - try: - api_response = api_instance.post_integer_type_matches_integers_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_integer_type_matches_integers_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -decimal.Decimal, int, | decimal.Decimal, | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_integer_type_matches_integers_request_body.ApiResponseFor200) | success - -#### post_integer_type_matches_integers_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body** - -> post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.invalid_instance_should_not_raise_error_when_float_division_inf import InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf(1) - try: - api_response = api_instance.post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf**](../../models/InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body.ApiResponseFor200) | success - -#### post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_invalid_string_value_for_default_request_body** - -> post_invalid_string_value_for_default_request_body(invalid_string_value_for_default) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.invalid_string_value_for_default import InvalidStringValueForDefault -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = InvalidStringValueForDefault(None) - try: - api_response = api_instance.post_invalid_string_value_for_default_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_invalid_string_value_for_default_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**InvalidStringValueForDefault**](../../models/InvalidStringValueForDefault.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_invalid_string_value_for_default_request_body.ApiResponseFor200) | success - -#### post_invalid_string_value_for_default_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ipv4_format_request_body** - -> post_ipv4_format_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = None - try: - api_response = api_instance.post_ipv4_format_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_ipv4_format_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ipv4_format_request_body.ApiResponseFor200) | success - -#### post_ipv4_format_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ipv6_format_request_body** - -> post_ipv6_format_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = None - try: - api_response = api_instance.post_ipv6_format_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_ipv6_format_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ipv6_format_request_body.ApiResponseFor200) | success - -#### post_ipv6_format_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_json_pointer_format_request_body** - -> post_json_pointer_format_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = None - try: - api_response = api_instance.post_json_pointer_format_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_json_pointer_format_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_json_pointer_format_request_body.ApiResponseFor200) | success - -#### post_json_pointer_format_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_maximum_validation_request_body** - -> post_maximum_validation_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.maximum_validation import MaximumValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = MaximumValidation(None) - try: - api_response = api_instance.post_maximum_validation_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_maximum_validation_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MaximumValidation**](../../models/MaximumValidation.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_maximum_validation_request_body.ApiResponseFor200) | success - -#### post_maximum_validation_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_maximum_validation_with_unsigned_integer_request_body** - -> post_maximum_validation_with_unsigned_integer_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.maximum_validation_with_unsigned_integer import MaximumValidationWithUnsignedInteger -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = MaximumValidationWithUnsignedInteger(None) - try: - api_response = api_instance.post_maximum_validation_with_unsigned_integer_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_maximum_validation_with_unsigned_integer_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MaximumValidationWithUnsignedInteger**](../../models/MaximumValidationWithUnsignedInteger.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_maximum_validation_with_unsigned_integer_request_body.ApiResponseFor200) | success - -#### post_maximum_validation_with_unsigned_integer_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_maxitems_validation_request_body** - -> post_maxitems_validation_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.maxitems_validation import MaxitemsValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = MaxitemsValidation(None) - try: - api_response = api_instance.post_maxitems_validation_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_maxitems_validation_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MaxitemsValidation**](../../models/MaxitemsValidation.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_maxitems_validation_request_body.ApiResponseFor200) | success - -#### post_maxitems_validation_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_maxlength_validation_request_body** - -> post_maxlength_validation_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.maxlength_validation import MaxlengthValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = MaxlengthValidation(None) - try: - api_response = api_instance.post_maxlength_validation_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_maxlength_validation_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MaxlengthValidation**](../../models/MaxlengthValidation.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_maxlength_validation_request_body.ApiResponseFor200) | success - -#### post_maxlength_validation_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_maxproperties0_means_the_object_is_empty_request_body** - -> post_maxproperties0_means_the_object_is_empty_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.maxproperties0_means_the_object_is_empty import Maxproperties0MeansTheObjectIsEmpty -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = Maxproperties0MeansTheObjectIsEmpty(None) - try: - api_response = api_instance.post_maxproperties0_means_the_object_is_empty_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_maxproperties0_means_the_object_is_empty_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**Maxproperties0MeansTheObjectIsEmpty**](../../models/Maxproperties0MeansTheObjectIsEmpty.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_maxproperties0_means_the_object_is_empty_request_body.ApiResponseFor200) | success - -#### post_maxproperties0_means_the_object_is_empty_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_maxproperties_validation_request_body** - -> post_maxproperties_validation_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.maxproperties_validation import MaxpropertiesValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = MaxpropertiesValidation(None) - try: - api_response = api_instance.post_maxproperties_validation_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_maxproperties_validation_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MaxpropertiesValidation**](../../models/MaxpropertiesValidation.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_maxproperties_validation_request_body.ApiResponseFor200) | success - -#### post_maxproperties_validation_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_minimum_validation_request_body** - -> post_minimum_validation_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.minimum_validation import MinimumValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = MinimumValidation(None) - try: - api_response = api_instance.post_minimum_validation_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_minimum_validation_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MinimumValidation**](../../models/MinimumValidation.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_minimum_validation_request_body.ApiResponseFor200) | success - -#### post_minimum_validation_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_minimum_validation_with_signed_integer_request_body** - -> post_minimum_validation_with_signed_integer_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.minimum_validation_with_signed_integer import MinimumValidationWithSignedInteger -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = MinimumValidationWithSignedInteger(None) - try: - api_response = api_instance.post_minimum_validation_with_signed_integer_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_minimum_validation_with_signed_integer_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MinimumValidationWithSignedInteger**](../../models/MinimumValidationWithSignedInteger.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_minimum_validation_with_signed_integer_request_body.ApiResponseFor200) | success - -#### post_minimum_validation_with_signed_integer_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_minitems_validation_request_body** - -> post_minitems_validation_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.minitems_validation import MinitemsValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = MinitemsValidation(None) - try: - api_response = api_instance.post_minitems_validation_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_minitems_validation_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MinitemsValidation**](../../models/MinitemsValidation.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_minitems_validation_request_body.ApiResponseFor200) | success - -#### post_minitems_validation_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_minlength_validation_request_body** - -> post_minlength_validation_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.minlength_validation import MinlengthValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = MinlengthValidation(None) - try: - api_response = api_instance.post_minlength_validation_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_minlength_validation_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MinlengthValidation**](../../models/MinlengthValidation.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_minlength_validation_request_body.ApiResponseFor200) | success - -#### post_minlength_validation_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_minproperties_validation_request_body** - -> post_minproperties_validation_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.minproperties_validation import MinpropertiesValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = MinpropertiesValidation(None) - try: - api_response = api_instance.post_minproperties_validation_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_minproperties_validation_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MinpropertiesValidation**](../../models/MinpropertiesValidation.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_minproperties_validation_request_body.ApiResponseFor200) | success - -#### post_minproperties_validation_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_nested_allof_to_check_validation_semantics_request_body** - -> post_nested_allof_to_check_validation_semantics_request_body(nested_allof_to_check_validation_semantics) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.nested_allof_to_check_validation_semantics import NestedAllofToCheckValidationSemantics -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = NestedAllofToCheckValidationSemantics(None) - try: - api_response = api_instance.post_nested_allof_to_check_validation_semantics_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_nested_allof_to_check_validation_semantics_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**NestedAllofToCheckValidationSemantics**](../../models/NestedAllofToCheckValidationSemantics.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_nested_allof_to_check_validation_semantics_request_body.ApiResponseFor200) | success - -#### post_nested_allof_to_check_validation_semantics_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_nested_anyof_to_check_validation_semantics_request_body** - -> post_nested_anyof_to_check_validation_semantics_request_body(nested_anyof_to_check_validation_semantics) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.nested_anyof_to_check_validation_semantics import NestedAnyofToCheckValidationSemantics -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = NestedAnyofToCheckValidationSemantics(None) - try: - api_response = api_instance.post_nested_anyof_to_check_validation_semantics_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_nested_anyof_to_check_validation_semantics_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**NestedAnyofToCheckValidationSemantics**](../../models/NestedAnyofToCheckValidationSemantics.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_nested_anyof_to_check_validation_semantics_request_body.ApiResponseFor200) | success - -#### post_nested_anyof_to_check_validation_semantics_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_nested_items_request_body** - -> post_nested_items_request_body(nested_items) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.nested_items import NestedItems -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = NestedItems([ - [ - [ - [ - 3.14 - ] - ] - ] - ]) - try: - api_response = api_instance.post_nested_items_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_nested_items_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**NestedItems**](../../models/NestedItems.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_nested_items_request_body.ApiResponseFor200) | success - -#### post_nested_items_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_nested_oneof_to_check_validation_semantics_request_body** - -> post_nested_oneof_to_check_validation_semantics_request_body(nested_oneof_to_check_validation_semantics) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.nested_oneof_to_check_validation_semantics import NestedOneofToCheckValidationSemantics -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = NestedOneofToCheckValidationSemantics(None) - try: - api_response = api_instance.post_nested_oneof_to_check_validation_semantics_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_nested_oneof_to_check_validation_semantics_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**NestedOneofToCheckValidationSemantics**](../../models/NestedOneofToCheckValidationSemantics.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_nested_oneof_to_check_validation_semantics_request_body.ApiResponseFor200) | success - -#### post_nested_oneof_to_check_validation_semantics_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_not_more_complex_schema_request_body** - -> post_not_more_complex_schema_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = None - try: - api_response = api_instance.post_not_more_complex_schema_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_not_more_complex_schema_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### not -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[not_schema](#not_schema) | dict, frozendict.frozendict, | frozendict.frozendict, | | - -# not_schema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**foo** | str, | str, | | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_not_more_complex_schema_request_body.ApiResponseFor200) | success - -#### post_not_more_complex_schema_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_not_request_body** - -> post_not_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = None - try: - api_response = api_instance.post_not_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_not_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### not -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[not_schema](#not_schema) | decimal.Decimal, int, | decimal.Decimal, | | - -# not_schema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -decimal.Decimal, int, | decimal.Decimal, | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_not_request_body.ApiResponseFor200) | success - -#### post_not_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_nul_characters_in_strings_request_body** - -> post_nul_characters_in_strings_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.nul_characters_in_strings import NulCharactersInStrings -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = NulCharactersInStrings("hello\x00there") - try: - api_response = api_instance.post_nul_characters_in_strings_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_nul_characters_in_strings_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**NulCharactersInStrings**](../../models/NulCharactersInStrings.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_nul_characters_in_strings_request_body.ApiResponseFor200) | success - -#### post_nul_characters_in_strings_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_null_type_matches_only_the_null_object_request_body** - -> post_null_type_matches_only_the_null_object_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = None - try: - api_response = api_instance.post_null_type_matches_only_the_null_object_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_null_type_matches_only_the_null_object_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -None, | NoneClass, | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_null_type_matches_only_the_null_object_request_body.ApiResponseFor200) | success - -#### post_null_type_matches_only_the_null_object_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_number_type_matches_numbers_request_body** - -> post_number_type_matches_numbers_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = 3.14 - try: - api_response = api_instance.post_number_type_matches_numbers_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_number_type_matches_numbers_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -decimal.Decimal, int, float, | decimal.Decimal, | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_number_type_matches_numbers_request_body.ApiResponseFor200) | success - -#### post_number_type_matches_numbers_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_object_properties_validation_request_body** - -> post_object_properties_validation_request_body(object_properties_validation) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.object_properties_validation import ObjectPropertiesValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = ObjectPropertiesValidation(None) - try: - api_response = api_instance.post_object_properties_validation_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_object_properties_validation_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**ObjectPropertiesValidation**](../../models/ObjectPropertiesValidation.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_object_properties_validation_request_body.ApiResponseFor200) | success - -#### post_object_properties_validation_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_object_type_matches_objects_request_body** - -> post_object_type_matches_objects_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = dict() - try: - api_response = api_instance.post_object_type_matches_objects_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_object_type_matches_objects_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_object_type_matches_objects_request_body.ApiResponseFor200) | success - -#### post_object_type_matches_objects_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_oneof_complex_types_request_body** - -> post_oneof_complex_types_request_body(oneof_complex_types) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.oneof_complex_types import OneofComplexTypes -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = OneofComplexTypes(None) - try: - api_response = api_instance.post_oneof_complex_types_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_oneof_complex_types_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**OneofComplexTypes**](../../models/OneofComplexTypes.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_oneof_complex_types_request_body.ApiResponseFor200) | success - -#### post_oneof_complex_types_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_oneof_request_body** - -> post_oneof_request_body(oneof) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.oneof import Oneof -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = Oneof(None) - try: - api_response = api_instance.post_oneof_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_oneof_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**Oneof**](../../models/Oneof.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_oneof_request_body.ApiResponseFor200) | success - -#### post_oneof_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_oneof_with_base_schema_request_body** - -> post_oneof_with_base_schema_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.oneof_with_base_schema import OneofWithBaseSchema -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = OneofWithBaseSchema("body_example") - try: - api_response = api_instance.post_oneof_with_base_schema_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_oneof_with_base_schema_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**OneofWithBaseSchema**](../../models/OneofWithBaseSchema.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_oneof_with_base_schema_request_body.ApiResponseFor200) | success - -#### post_oneof_with_base_schema_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_oneof_with_empty_schema_request_body** - -> post_oneof_with_empty_schema_request_body(oneof_with_empty_schema) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.oneof_with_empty_schema import OneofWithEmptySchema -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = OneofWithEmptySchema(None) - try: - api_response = api_instance.post_oneof_with_empty_schema_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_oneof_with_empty_schema_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**OneofWithEmptySchema**](../../models/OneofWithEmptySchema.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_oneof_with_empty_schema_request_body.ApiResponseFor200) | success - -#### post_oneof_with_empty_schema_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_oneof_with_required_request_body** - -> post_oneof_with_required_request_body(oneof_with_required) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.oneof_with_required import OneofWithRequired -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = OneofWithRequired() - try: - api_response = api_instance.post_oneof_with_required_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_oneof_with_required_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**OneofWithRequired**](../../models/OneofWithRequired.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_oneof_with_required_request_body.ApiResponseFor200) | success - -#### post_oneof_with_required_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_pattern_is_not_anchored_request_body** - -> post_pattern_is_not_anchored_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.pattern_is_not_anchored import PatternIsNotAnchored -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = PatternIsNotAnchored(None) - try: - api_response = api_instance.post_pattern_is_not_anchored_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_pattern_is_not_anchored_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**PatternIsNotAnchored**](../../models/PatternIsNotAnchored.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_pattern_is_not_anchored_request_body.ApiResponseFor200) | success - -#### post_pattern_is_not_anchored_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_pattern_validation_request_body** - -> post_pattern_validation_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.pattern_validation import PatternValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = PatternValidation(None) - try: - api_response = api_instance.post_pattern_validation_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_pattern_validation_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**PatternValidation**](../../models/PatternValidation.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_pattern_validation_request_body.ApiResponseFor200) | success - -#### post_pattern_validation_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_properties_with_escaped_characters_request_body** - -> post_properties_with_escaped_characters_request_body(properties_with_escaped_characters) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.properties_with_escaped_characters import PropertiesWithEscapedCharacters -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = PropertiesWithEscapedCharacters(None) - try: - api_response = api_instance.post_properties_with_escaped_characters_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_properties_with_escaped_characters_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**PropertiesWithEscapedCharacters**](../../models/PropertiesWithEscapedCharacters.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_properties_with_escaped_characters_request_body.ApiResponseFor200) | success - -#### post_properties_with_escaped_characters_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_property_named_ref_that_is_not_a_reference_request_body** - -> post_property_named_ref_that_is_not_a_reference_request_body(property_named_ref_that_is_not_a_reference) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.property_named_ref_that_is_not_a_reference import PropertyNamedRefThatIsNotAReference -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = PropertyNamedRefThatIsNotAReference(None) - try: - api_response = api_instance.post_property_named_ref_that_is_not_a_reference_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_property_named_ref_that_is_not_a_reference_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**PropertyNamedRefThatIsNotAReference**](../../models/PropertyNamedRefThatIsNotAReference.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_property_named_ref_that_is_not_a_reference_request_body.ApiResponseFor200) | success - -#### post_property_named_ref_that_is_not_a_reference_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ref_in_additionalproperties_request_body** - -> post_ref_in_additionalproperties_request_body(ref_in_additionalproperties) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.ref_in_additionalproperties import RefInAdditionalproperties -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = RefInAdditionalproperties( - key=PropertyNamedRefThatIsNotAReference(None), - ) - try: - api_response = api_instance.post_ref_in_additionalproperties_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_ref_in_additionalproperties_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RefInAdditionalproperties**](../../models/RefInAdditionalproperties.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ref_in_additionalproperties_request_body.ApiResponseFor200) | success - -#### post_ref_in_additionalproperties_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ref_in_allof_request_body** - -> post_ref_in_allof_request_body(ref_in_allof) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.ref_in_allof import RefInAllof -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = RefInAllof(None) - try: - api_response = api_instance.post_ref_in_allof_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_ref_in_allof_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RefInAllof**](../../models/RefInAllof.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ref_in_allof_request_body.ApiResponseFor200) | success - -#### post_ref_in_allof_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ref_in_anyof_request_body** - -> post_ref_in_anyof_request_body(ref_in_anyof) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.ref_in_anyof import RefInAnyof -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = RefInAnyof(None) - try: - api_response = api_instance.post_ref_in_anyof_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_ref_in_anyof_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RefInAnyof**](../../models/RefInAnyof.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ref_in_anyof_request_body.ApiResponseFor200) | success - -#### post_ref_in_anyof_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ref_in_items_request_body** - -> post_ref_in_items_request_body(ref_in_items) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.ref_in_items import RefInItems -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = RefInItems([ - PropertyNamedRefThatIsNotAReference(None) - ]) - try: - api_response = api_instance.post_ref_in_items_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_ref_in_items_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RefInItems**](../../models/RefInItems.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ref_in_items_request_body.ApiResponseFor200) | success - -#### post_ref_in_items_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ref_in_not_request_body** - -> post_ref_in_not_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.property_named_ref_that_is_not_a_reference import PropertyNamedRefThatIsNotAReference -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = None - try: - api_response = api_instance.post_ref_in_not_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_ref_in_not_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### not -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[PropertyNamedRefThatIsNotAReference]({{complexTypePrefix}}PropertyNamedRefThatIsNotAReference.md) | [**PropertyNamedRefThatIsNotAReference**]({{complexTypePrefix}}PropertyNamedRefThatIsNotAReference.md) | [**PropertyNamedRefThatIsNotAReference**]({{complexTypePrefix}}PropertyNamedRefThatIsNotAReference.md) | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ref_in_not_request_body.ApiResponseFor200) | success - -#### post_ref_in_not_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ref_in_oneof_request_body** - -> post_ref_in_oneof_request_body(ref_in_oneof) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.ref_in_oneof import RefInOneof -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = RefInOneof(None) - try: - api_response = api_instance.post_ref_in_oneof_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_ref_in_oneof_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RefInOneof**](../../models/RefInOneof.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ref_in_oneof_request_body.ApiResponseFor200) | success - -#### post_ref_in_oneof_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ref_in_property_request_body** - -> post_ref_in_property_request_body(ref_in_property) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.ref_in_property import RefInProperty -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = RefInProperty(None) - try: - api_response = api_instance.post_ref_in_property_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_ref_in_property_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RefInProperty**](../../models/RefInProperty.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ref_in_property_request_body.ApiResponseFor200) | success - -#### post_ref_in_property_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_required_default_validation_request_body** - -> post_required_default_validation_request_body(required_default_validation) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.required_default_validation import RequiredDefaultValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = RequiredDefaultValidation(None) - try: - api_response = api_instance.post_required_default_validation_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_required_default_validation_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RequiredDefaultValidation**](../../models/RequiredDefaultValidation.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_required_default_validation_request_body.ApiResponseFor200) | success - -#### post_required_default_validation_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_required_validation_request_body** - -> post_required_validation_request_body(required_validation) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.required_validation import RequiredValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = RequiredValidation(None) - try: - api_response = api_instance.post_required_validation_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_required_validation_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RequiredValidation**](../../models/RequiredValidation.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_required_validation_request_body.ApiResponseFor200) | success - -#### post_required_validation_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_required_with_empty_array_request_body** - -> post_required_with_empty_array_request_body(required_with_empty_array) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.required_with_empty_array import RequiredWithEmptyArray -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = RequiredWithEmptyArray(None) - try: - api_response = api_instance.post_required_with_empty_array_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_required_with_empty_array_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RequiredWithEmptyArray**](../../models/RequiredWithEmptyArray.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_required_with_empty_array_request_body.ApiResponseFor200) | success - -#### post_required_with_empty_array_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_required_with_escaped_characters_request_body** - -> post_required_with_escaped_characters_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = None - try: - api_response = api_instance.post_required_with_escaped_characters_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_required_with_escaped_characters_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_required_with_escaped_characters_request_body.ApiResponseFor200) | success - -#### post_required_with_escaped_characters_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_simple_enum_validation_request_body** - -> post_simple_enum_validation_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.simple_enum_validation import SimpleEnumValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = SimpleEnumValidation(1) - try: - api_response = api_instance.post_simple_enum_validation_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_simple_enum_validation_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**SimpleEnumValidation**](../../models/SimpleEnumValidation.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_simple_enum_validation_request_body.ApiResponseFor200) | success - -#### post_simple_enum_validation_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_string_type_matches_strings_request_body** - -> post_string_type_matches_strings_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = "body_example" - try: - api_response = api_instance.post_string_type_matches_strings_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_string_type_matches_strings_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_string_type_matches_strings_request_body.ApiResponseFor200) | success - -#### post_string_type_matches_strings_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body** - -> post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body(the_default_keyword_does_not_do_anything_if_the_property_is_missing) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.the_default_keyword_does_not_do_anything_if_the_property_is_missing import TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing( - alpha=5, - ) - try: - api_response = api_instance.post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing**](../../models/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.ApiResponseFor200) | success - -#### post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_uniqueitems_false_validation_request_body** - -> post_uniqueitems_false_validation_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.uniqueitems_false_validation import UniqueitemsFalseValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = UniqueitemsFalseValidation(None) - try: - api_response = api_instance.post_uniqueitems_false_validation_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_uniqueitems_false_validation_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**UniqueitemsFalseValidation**](../../models/UniqueitemsFalseValidation.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_uniqueitems_false_validation_request_body.ApiResponseFor200) | success - -#### post_uniqueitems_false_validation_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_uniqueitems_validation_request_body** - -> post_uniqueitems_validation_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from unit_test_api.model.uniqueitems_validation import UniqueitemsValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = UniqueitemsValidation(None) - try: - api_response = api_instance.post_uniqueitems_validation_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_uniqueitems_validation_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**UniqueitemsValidation**](../../models/UniqueitemsValidation.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_uniqueitems_validation_request_body.ApiResponseFor200) | success - -#### post_uniqueitems_validation_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_uri_format_request_body** - -> post_uri_format_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = None - try: - api_response = api_instance.post_uri_format_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_uri_format_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_uri_format_request_body.ApiResponseFor200) | success - -#### post_uri_format_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_uri_reference_format_request_body** - -> post_uri_reference_format_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = None - try: - api_response = api_instance.post_uri_reference_format_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_uri_reference_format_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_uri_reference_format_request_body.ApiResponseFor200) | success - -#### post_uri_reference_format_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_uri_template_format_request_body** - -> post_uri_template_format_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import operation_request_body_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) - - # example passing only required values which don't have defaults set - body = None - try: - api_response = api_instance.post_uri_template_format_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling OperationRequestBodyApi->post_uri_template_format_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_uri_template_format_request_body.ApiResponseFor200) | success - -#### post_uri_template_format_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - +[**post_additionalproperties_allows_a_schema_which_should_validate_request_body**](operation_request_body_api/post_additionalproperties_allows_a_schema_which_should_validate_request_body.md) | **post** /requestBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody | +[**post_additionalproperties_are_allowed_by_default_request_body**](operation_request_body_api/post_additionalproperties_are_allowed_by_default_request_body.md) | **post** /requestBody/postAdditionalpropertiesAreAllowedByDefaultRequestBody | +[**post_additionalproperties_can_exist_by_itself_request_body**](operation_request_body_api/post_additionalproperties_can_exist_by_itself_request_body.md) | **post** /requestBody/postAdditionalpropertiesCanExistByItselfRequestBody | +[**post_additionalproperties_should_not_look_in_applicators_request_body**](operation_request_body_api/post_additionalproperties_should_not_look_in_applicators_request_body.md) | **post** /requestBody/postAdditionalpropertiesShouldNotLookInApplicatorsRequestBody | +[**post_allof_combined_with_anyof_oneof_request_body**](operation_request_body_api/post_allof_combined_with_anyof_oneof_request_body.md) | **post** /requestBody/postAllofCombinedWithAnyofOneofRequestBody | +[**post_allof_request_body**](operation_request_body_api/post_allof_request_body.md) | **post** /requestBody/postAllofRequestBody | +[**post_allof_simple_types_request_body**](operation_request_body_api/post_allof_simple_types_request_body.md) | **post** /requestBody/postAllofSimpleTypesRequestBody | +[**post_allof_with_base_schema_request_body**](operation_request_body_api/post_allof_with_base_schema_request_body.md) | **post** /requestBody/postAllofWithBaseSchemaRequestBody | +[**post_allof_with_one_empty_schema_request_body**](operation_request_body_api/post_allof_with_one_empty_schema_request_body.md) | **post** /requestBody/postAllofWithOneEmptySchemaRequestBody | +[**post_allof_with_the_first_empty_schema_request_body**](operation_request_body_api/post_allof_with_the_first_empty_schema_request_body.md) | **post** /requestBody/postAllofWithTheFirstEmptySchemaRequestBody | +[**post_allof_with_the_last_empty_schema_request_body**](operation_request_body_api/post_allof_with_the_last_empty_schema_request_body.md) | **post** /requestBody/postAllofWithTheLastEmptySchemaRequestBody | +[**post_allof_with_two_empty_schemas_request_body**](operation_request_body_api/post_allof_with_two_empty_schemas_request_body.md) | **post** /requestBody/postAllofWithTwoEmptySchemasRequestBody | +[**post_anyof_complex_types_request_body**](operation_request_body_api/post_anyof_complex_types_request_body.md) | **post** /requestBody/postAnyofComplexTypesRequestBody | +[**post_anyof_request_body**](operation_request_body_api/post_anyof_request_body.md) | **post** /requestBody/postAnyofRequestBody | +[**post_anyof_with_base_schema_request_body**](operation_request_body_api/post_anyof_with_base_schema_request_body.md) | **post** /requestBody/postAnyofWithBaseSchemaRequestBody | +[**post_anyof_with_one_empty_schema_request_body**](operation_request_body_api/post_anyof_with_one_empty_schema_request_body.md) | **post** /requestBody/postAnyofWithOneEmptySchemaRequestBody | +[**post_array_type_matches_arrays_request_body**](operation_request_body_api/post_array_type_matches_arrays_request_body.md) | **post** /requestBody/postArrayTypeMatchesArraysRequestBody | +[**post_boolean_type_matches_booleans_request_body**](operation_request_body_api/post_boolean_type_matches_booleans_request_body.md) | **post** /requestBody/postBooleanTypeMatchesBooleansRequestBody | +[**post_by_int_request_body**](operation_request_body_api/post_by_int_request_body.md) | **post** /requestBody/postByIntRequestBody | +[**post_by_number_request_body**](operation_request_body_api/post_by_number_request_body.md) | **post** /requestBody/postByNumberRequestBody | +[**post_by_small_number_request_body**](operation_request_body_api/post_by_small_number_request_body.md) | **post** /requestBody/postBySmallNumberRequestBody | +[**post_date_time_format_request_body**](operation_request_body_api/post_date_time_format_request_body.md) | **post** /requestBody/postDateTimeFormatRequestBody | +[**post_email_format_request_body**](operation_request_body_api/post_email_format_request_body.md) | **post** /requestBody/postEmailFormatRequestBody | +[**post_enum_with0_does_not_match_false_request_body**](operation_request_body_api/post_enum_with0_does_not_match_false_request_body.md) | **post** /requestBody/postEnumWith0DoesNotMatchFalseRequestBody | +[**post_enum_with1_does_not_match_true_request_body**](operation_request_body_api/post_enum_with1_does_not_match_true_request_body.md) | **post** /requestBody/postEnumWith1DoesNotMatchTrueRequestBody | +[**post_enum_with_escaped_characters_request_body**](operation_request_body_api/post_enum_with_escaped_characters_request_body.md) | **post** /requestBody/postEnumWithEscapedCharactersRequestBody | +[**post_enum_with_false_does_not_match0_request_body**](operation_request_body_api/post_enum_with_false_does_not_match0_request_body.md) | **post** /requestBody/postEnumWithFalseDoesNotMatch0RequestBody | +[**post_enum_with_true_does_not_match1_request_body**](operation_request_body_api/post_enum_with_true_does_not_match1_request_body.md) | **post** /requestBody/postEnumWithTrueDoesNotMatch1RequestBody | +[**post_enums_in_properties_request_body**](operation_request_body_api/post_enums_in_properties_request_body.md) | **post** /requestBody/postEnumsInPropertiesRequestBody | +[**post_forbidden_property_request_body**](operation_request_body_api/post_forbidden_property_request_body.md) | **post** /requestBody/postForbiddenPropertyRequestBody | +[**post_hostname_format_request_body**](operation_request_body_api/post_hostname_format_request_body.md) | **post** /requestBody/postHostnameFormatRequestBody | +[**post_integer_type_matches_integers_request_body**](operation_request_body_api/post_integer_type_matches_integers_request_body.md) | **post** /requestBody/postIntegerTypeMatchesIntegersRequestBody | +[**post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body**](operation_request_body_api/post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body.md) | **post** /requestBody/postInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody | +[**post_invalid_string_value_for_default_request_body**](operation_request_body_api/post_invalid_string_value_for_default_request_body.md) | **post** /requestBody/postInvalidStringValueForDefaultRequestBody | +[**post_ipv4_format_request_body**](operation_request_body_api/post_ipv4_format_request_body.md) | **post** /requestBody/postIpv4FormatRequestBody | +[**post_ipv6_format_request_body**](operation_request_body_api/post_ipv6_format_request_body.md) | **post** /requestBody/postIpv6FormatRequestBody | +[**post_json_pointer_format_request_body**](operation_request_body_api/post_json_pointer_format_request_body.md) | **post** /requestBody/postJsonPointerFormatRequestBody | +[**post_maximum_validation_request_body**](operation_request_body_api/post_maximum_validation_request_body.md) | **post** /requestBody/postMaximumValidationRequestBody | +[**post_maximum_validation_with_unsigned_integer_request_body**](operation_request_body_api/post_maximum_validation_with_unsigned_integer_request_body.md) | **post** /requestBody/postMaximumValidationWithUnsignedIntegerRequestBody | +[**post_maxitems_validation_request_body**](operation_request_body_api/post_maxitems_validation_request_body.md) | **post** /requestBody/postMaxitemsValidationRequestBody | +[**post_maxlength_validation_request_body**](operation_request_body_api/post_maxlength_validation_request_body.md) | **post** /requestBody/postMaxlengthValidationRequestBody | +[**post_maxproperties0_means_the_object_is_empty_request_body**](operation_request_body_api/post_maxproperties0_means_the_object_is_empty_request_body.md) | **post** /requestBody/postMaxproperties0MeansTheObjectIsEmptyRequestBody | +[**post_maxproperties_validation_request_body**](operation_request_body_api/post_maxproperties_validation_request_body.md) | **post** /requestBody/postMaxpropertiesValidationRequestBody | +[**post_minimum_validation_request_body**](operation_request_body_api/post_minimum_validation_request_body.md) | **post** /requestBody/postMinimumValidationRequestBody | +[**post_minimum_validation_with_signed_integer_request_body**](operation_request_body_api/post_minimum_validation_with_signed_integer_request_body.md) | **post** /requestBody/postMinimumValidationWithSignedIntegerRequestBody | +[**post_minitems_validation_request_body**](operation_request_body_api/post_minitems_validation_request_body.md) | **post** /requestBody/postMinitemsValidationRequestBody | +[**post_minlength_validation_request_body**](operation_request_body_api/post_minlength_validation_request_body.md) | **post** /requestBody/postMinlengthValidationRequestBody | +[**post_minproperties_validation_request_body**](operation_request_body_api/post_minproperties_validation_request_body.md) | **post** /requestBody/postMinpropertiesValidationRequestBody | +[**post_nested_allof_to_check_validation_semantics_request_body**](operation_request_body_api/post_nested_allof_to_check_validation_semantics_request_body.md) | **post** /requestBody/postNestedAllofToCheckValidationSemanticsRequestBody | +[**post_nested_anyof_to_check_validation_semantics_request_body**](operation_request_body_api/post_nested_anyof_to_check_validation_semantics_request_body.md) | **post** /requestBody/postNestedAnyofToCheckValidationSemanticsRequestBody | +[**post_nested_items_request_body**](operation_request_body_api/post_nested_items_request_body.md) | **post** /requestBody/postNestedItemsRequestBody | +[**post_nested_oneof_to_check_validation_semantics_request_body**](operation_request_body_api/post_nested_oneof_to_check_validation_semantics_request_body.md) | **post** /requestBody/postNestedOneofToCheckValidationSemanticsRequestBody | +[**post_not_more_complex_schema_request_body**](operation_request_body_api/post_not_more_complex_schema_request_body.md) | **post** /requestBody/postNotMoreComplexSchemaRequestBody | +[**post_not_request_body**](operation_request_body_api/post_not_request_body.md) | **post** /requestBody/postNotRequestBody | +[**post_nul_characters_in_strings_request_body**](operation_request_body_api/post_nul_characters_in_strings_request_body.md) | **post** /requestBody/postNulCharactersInStringsRequestBody | +[**post_null_type_matches_only_the_null_object_request_body**](operation_request_body_api/post_null_type_matches_only_the_null_object_request_body.md) | **post** /requestBody/postNullTypeMatchesOnlyTheNullObjectRequestBody | +[**post_number_type_matches_numbers_request_body**](operation_request_body_api/post_number_type_matches_numbers_request_body.md) | **post** /requestBody/postNumberTypeMatchesNumbersRequestBody | +[**post_object_properties_validation_request_body**](operation_request_body_api/post_object_properties_validation_request_body.md) | **post** /requestBody/postObjectPropertiesValidationRequestBody | +[**post_object_type_matches_objects_request_body**](operation_request_body_api/post_object_type_matches_objects_request_body.md) | **post** /requestBody/postObjectTypeMatchesObjectsRequestBody | +[**post_oneof_complex_types_request_body**](operation_request_body_api/post_oneof_complex_types_request_body.md) | **post** /requestBody/postOneofComplexTypesRequestBody | +[**post_oneof_request_body**](operation_request_body_api/post_oneof_request_body.md) | **post** /requestBody/postOneofRequestBody | +[**post_oneof_with_base_schema_request_body**](operation_request_body_api/post_oneof_with_base_schema_request_body.md) | **post** /requestBody/postOneofWithBaseSchemaRequestBody | +[**post_oneof_with_empty_schema_request_body**](operation_request_body_api/post_oneof_with_empty_schema_request_body.md) | **post** /requestBody/postOneofWithEmptySchemaRequestBody | +[**post_oneof_with_required_request_body**](operation_request_body_api/post_oneof_with_required_request_body.md) | **post** /requestBody/postOneofWithRequiredRequestBody | +[**post_pattern_is_not_anchored_request_body**](operation_request_body_api/post_pattern_is_not_anchored_request_body.md) | **post** /requestBody/postPatternIsNotAnchoredRequestBody | +[**post_pattern_validation_request_body**](operation_request_body_api/post_pattern_validation_request_body.md) | **post** /requestBody/postPatternValidationRequestBody | +[**post_properties_with_escaped_characters_request_body**](operation_request_body_api/post_properties_with_escaped_characters_request_body.md) | **post** /requestBody/postPropertiesWithEscapedCharactersRequestBody | +[**post_property_named_ref_that_is_not_a_reference_request_body**](operation_request_body_api/post_property_named_ref_that_is_not_a_reference_request_body.md) | **post** /requestBody/postPropertyNamedRefThatIsNotAReferenceRequestBody | +[**post_ref_in_additionalproperties_request_body**](operation_request_body_api/post_ref_in_additionalproperties_request_body.md) | **post** /requestBody/postRefInAdditionalpropertiesRequestBody | +[**post_ref_in_allof_request_body**](operation_request_body_api/post_ref_in_allof_request_body.md) | **post** /requestBody/postRefInAllofRequestBody | +[**post_ref_in_anyof_request_body**](operation_request_body_api/post_ref_in_anyof_request_body.md) | **post** /requestBody/postRefInAnyofRequestBody | +[**post_ref_in_items_request_body**](operation_request_body_api/post_ref_in_items_request_body.md) | **post** /requestBody/postRefInItemsRequestBody | +[**post_ref_in_not_request_body**](operation_request_body_api/post_ref_in_not_request_body.md) | **post** /requestBody/postRefInNotRequestBody | +[**post_ref_in_oneof_request_body**](operation_request_body_api/post_ref_in_oneof_request_body.md) | **post** /requestBody/postRefInOneofRequestBody | +[**post_ref_in_property_request_body**](operation_request_body_api/post_ref_in_property_request_body.md) | **post** /requestBody/postRefInPropertyRequestBody | +[**post_required_default_validation_request_body**](operation_request_body_api/post_required_default_validation_request_body.md) | **post** /requestBody/postRequiredDefaultValidationRequestBody | +[**post_required_validation_request_body**](operation_request_body_api/post_required_validation_request_body.md) | **post** /requestBody/postRequiredValidationRequestBody | +[**post_required_with_empty_array_request_body**](operation_request_body_api/post_required_with_empty_array_request_body.md) | **post** /requestBody/postRequiredWithEmptyArrayRequestBody | +[**post_required_with_escaped_characters_request_body**](operation_request_body_api/post_required_with_escaped_characters_request_body.md) | **post** /requestBody/postRequiredWithEscapedCharactersRequestBody | +[**post_simple_enum_validation_request_body**](operation_request_body_api/post_simple_enum_validation_request_body.md) | **post** /requestBody/postSimpleEnumValidationRequestBody | +[**post_string_type_matches_strings_request_body**](operation_request_body_api/post_string_type_matches_strings_request_body.md) | **post** /requestBody/postStringTypeMatchesStringsRequestBody | +[**post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body**](operation_request_body_api/post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.md) | **post** /requestBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody | +[**post_uniqueitems_false_validation_request_body**](operation_request_body_api/post_uniqueitems_false_validation_request_body.md) | **post** /requestBody/postUniqueitemsFalseValidationRequestBody | +[**post_uniqueitems_validation_request_body**](operation_request_body_api/post_uniqueitems_validation_request_body.md) | **post** /requestBody/postUniqueitemsValidationRequestBody | +[**post_uri_format_request_body**](operation_request_body_api/post_uri_format_request_body.md) | **post** /requestBody/postUriFormatRequestBody | +[**post_uri_reference_format_request_body**](operation_request_body_api/post_uri_reference_format_request_body.md) | **post** /requestBody/postUriReferenceFormatRequestBody | +[**post_uri_template_format_request_body**](operation_request_body_api/post_uri_template_format_request_body.md) | **post** /requestBody/postUriTemplateFormatRequestBody | + +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/PathPostApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/PathPostApi.md index f59e95a4c93..9ad5223323d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/PathPostApi.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/PathPostApi.md @@ -1,11681 +1,183 @@ - + # unit_test_api.apis.tags.path_post_api.PathPostApi All URIs are relative to *https://someserver.com/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**post_additionalproperties_allows_a_schema_which_should_validate_request_body**](#post_additionalproperties_allows_a_schema_which_should_validate_request_body) | **post** /requestBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody | -[**post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types**](#post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types) | **post** /responseBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateResponseBodyForContentTypes | -[**post_additionalproperties_are_allowed_by_default_request_body**](#post_additionalproperties_are_allowed_by_default_request_body) | **post** /requestBody/postAdditionalpropertiesAreAllowedByDefaultRequestBody | -[**post_additionalproperties_are_allowed_by_default_response_body_for_content_types**](#post_additionalproperties_are_allowed_by_default_response_body_for_content_types) | **post** /responseBody/postAdditionalpropertiesAreAllowedByDefaultResponseBodyForContentTypes | -[**post_additionalproperties_can_exist_by_itself_request_body**](#post_additionalproperties_can_exist_by_itself_request_body) | **post** /requestBody/postAdditionalpropertiesCanExistByItselfRequestBody | -[**post_additionalproperties_can_exist_by_itself_response_body_for_content_types**](#post_additionalproperties_can_exist_by_itself_response_body_for_content_types) | **post** /responseBody/postAdditionalpropertiesCanExistByItselfResponseBodyForContentTypes | -[**post_additionalproperties_should_not_look_in_applicators_request_body**](#post_additionalproperties_should_not_look_in_applicators_request_body) | **post** /requestBody/postAdditionalpropertiesShouldNotLookInApplicatorsRequestBody | -[**post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types**](#post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types) | **post** /responseBody/postAdditionalpropertiesShouldNotLookInApplicatorsResponseBodyForContentTypes | -[**post_allof_combined_with_anyof_oneof_request_body**](#post_allof_combined_with_anyof_oneof_request_body) | **post** /requestBody/postAllofCombinedWithAnyofOneofRequestBody | -[**post_allof_combined_with_anyof_oneof_response_body_for_content_types**](#post_allof_combined_with_anyof_oneof_response_body_for_content_types) | **post** /responseBody/postAllofCombinedWithAnyofOneofResponseBodyForContentTypes | -[**post_allof_request_body**](#post_allof_request_body) | **post** /requestBody/postAllofRequestBody | -[**post_allof_response_body_for_content_types**](#post_allof_response_body_for_content_types) | **post** /responseBody/postAllofResponseBodyForContentTypes | -[**post_allof_simple_types_request_body**](#post_allof_simple_types_request_body) | **post** /requestBody/postAllofSimpleTypesRequestBody | -[**post_allof_simple_types_response_body_for_content_types**](#post_allof_simple_types_response_body_for_content_types) | **post** /responseBody/postAllofSimpleTypesResponseBodyForContentTypes | -[**post_allof_with_base_schema_request_body**](#post_allof_with_base_schema_request_body) | **post** /requestBody/postAllofWithBaseSchemaRequestBody | -[**post_allof_with_base_schema_response_body_for_content_types**](#post_allof_with_base_schema_response_body_for_content_types) | **post** /responseBody/postAllofWithBaseSchemaResponseBodyForContentTypes | -[**post_allof_with_one_empty_schema_request_body**](#post_allof_with_one_empty_schema_request_body) | **post** /requestBody/postAllofWithOneEmptySchemaRequestBody | -[**post_allof_with_one_empty_schema_response_body_for_content_types**](#post_allof_with_one_empty_schema_response_body_for_content_types) | **post** /responseBody/postAllofWithOneEmptySchemaResponseBodyForContentTypes | -[**post_allof_with_the_first_empty_schema_request_body**](#post_allof_with_the_first_empty_schema_request_body) | **post** /requestBody/postAllofWithTheFirstEmptySchemaRequestBody | -[**post_allof_with_the_first_empty_schema_response_body_for_content_types**](#post_allof_with_the_first_empty_schema_response_body_for_content_types) | **post** /responseBody/postAllofWithTheFirstEmptySchemaResponseBodyForContentTypes | -[**post_allof_with_the_last_empty_schema_request_body**](#post_allof_with_the_last_empty_schema_request_body) | **post** /requestBody/postAllofWithTheLastEmptySchemaRequestBody | -[**post_allof_with_the_last_empty_schema_response_body_for_content_types**](#post_allof_with_the_last_empty_schema_response_body_for_content_types) | **post** /responseBody/postAllofWithTheLastEmptySchemaResponseBodyForContentTypes | -[**post_allof_with_two_empty_schemas_request_body**](#post_allof_with_two_empty_schemas_request_body) | **post** /requestBody/postAllofWithTwoEmptySchemasRequestBody | -[**post_allof_with_two_empty_schemas_response_body_for_content_types**](#post_allof_with_two_empty_schemas_response_body_for_content_types) | **post** /responseBody/postAllofWithTwoEmptySchemasResponseBodyForContentTypes | -[**post_anyof_complex_types_request_body**](#post_anyof_complex_types_request_body) | **post** /requestBody/postAnyofComplexTypesRequestBody | -[**post_anyof_complex_types_response_body_for_content_types**](#post_anyof_complex_types_response_body_for_content_types) | **post** /responseBody/postAnyofComplexTypesResponseBodyForContentTypes | -[**post_anyof_request_body**](#post_anyof_request_body) | **post** /requestBody/postAnyofRequestBody | -[**post_anyof_response_body_for_content_types**](#post_anyof_response_body_for_content_types) | **post** /responseBody/postAnyofResponseBodyForContentTypes | -[**post_anyof_with_base_schema_request_body**](#post_anyof_with_base_schema_request_body) | **post** /requestBody/postAnyofWithBaseSchemaRequestBody | -[**post_anyof_with_base_schema_response_body_for_content_types**](#post_anyof_with_base_schema_response_body_for_content_types) | **post** /responseBody/postAnyofWithBaseSchemaResponseBodyForContentTypes | -[**post_anyof_with_one_empty_schema_request_body**](#post_anyof_with_one_empty_schema_request_body) | **post** /requestBody/postAnyofWithOneEmptySchemaRequestBody | -[**post_anyof_with_one_empty_schema_response_body_for_content_types**](#post_anyof_with_one_empty_schema_response_body_for_content_types) | **post** /responseBody/postAnyofWithOneEmptySchemaResponseBodyForContentTypes | -[**post_array_type_matches_arrays_request_body**](#post_array_type_matches_arrays_request_body) | **post** /requestBody/postArrayTypeMatchesArraysRequestBody | -[**post_array_type_matches_arrays_response_body_for_content_types**](#post_array_type_matches_arrays_response_body_for_content_types) | **post** /responseBody/postArrayTypeMatchesArraysResponseBodyForContentTypes | -[**post_boolean_type_matches_booleans_request_body**](#post_boolean_type_matches_booleans_request_body) | **post** /requestBody/postBooleanTypeMatchesBooleansRequestBody | -[**post_boolean_type_matches_booleans_response_body_for_content_types**](#post_boolean_type_matches_booleans_response_body_for_content_types) | **post** /responseBody/postBooleanTypeMatchesBooleansResponseBodyForContentTypes | -[**post_by_int_request_body**](#post_by_int_request_body) | **post** /requestBody/postByIntRequestBody | -[**post_by_int_response_body_for_content_types**](#post_by_int_response_body_for_content_types) | **post** /responseBody/postByIntResponseBodyForContentTypes | -[**post_by_number_request_body**](#post_by_number_request_body) | **post** /requestBody/postByNumberRequestBody | -[**post_by_number_response_body_for_content_types**](#post_by_number_response_body_for_content_types) | **post** /responseBody/postByNumberResponseBodyForContentTypes | -[**post_by_small_number_request_body**](#post_by_small_number_request_body) | **post** /requestBody/postBySmallNumberRequestBody | -[**post_by_small_number_response_body_for_content_types**](#post_by_small_number_response_body_for_content_types) | **post** /responseBody/postBySmallNumberResponseBodyForContentTypes | -[**post_date_time_format_request_body**](#post_date_time_format_request_body) | **post** /requestBody/postDateTimeFormatRequestBody | -[**post_date_time_format_response_body_for_content_types**](#post_date_time_format_response_body_for_content_types) | **post** /responseBody/postDateTimeFormatResponseBodyForContentTypes | -[**post_email_format_request_body**](#post_email_format_request_body) | **post** /requestBody/postEmailFormatRequestBody | -[**post_email_format_response_body_for_content_types**](#post_email_format_response_body_for_content_types) | **post** /responseBody/postEmailFormatResponseBodyForContentTypes | -[**post_enum_with0_does_not_match_false_request_body**](#post_enum_with0_does_not_match_false_request_body) | **post** /requestBody/postEnumWith0DoesNotMatchFalseRequestBody | -[**post_enum_with0_does_not_match_false_response_body_for_content_types**](#post_enum_with0_does_not_match_false_response_body_for_content_types) | **post** /responseBody/postEnumWith0DoesNotMatchFalseResponseBodyForContentTypes | -[**post_enum_with1_does_not_match_true_request_body**](#post_enum_with1_does_not_match_true_request_body) | **post** /requestBody/postEnumWith1DoesNotMatchTrueRequestBody | -[**post_enum_with1_does_not_match_true_response_body_for_content_types**](#post_enum_with1_does_not_match_true_response_body_for_content_types) | **post** /responseBody/postEnumWith1DoesNotMatchTrueResponseBodyForContentTypes | -[**post_enum_with_escaped_characters_request_body**](#post_enum_with_escaped_characters_request_body) | **post** /requestBody/postEnumWithEscapedCharactersRequestBody | -[**post_enum_with_escaped_characters_response_body_for_content_types**](#post_enum_with_escaped_characters_response_body_for_content_types) | **post** /responseBody/postEnumWithEscapedCharactersResponseBodyForContentTypes | -[**post_enum_with_false_does_not_match0_request_body**](#post_enum_with_false_does_not_match0_request_body) | **post** /requestBody/postEnumWithFalseDoesNotMatch0RequestBody | -[**post_enum_with_false_does_not_match0_response_body_for_content_types**](#post_enum_with_false_does_not_match0_response_body_for_content_types) | **post** /responseBody/postEnumWithFalseDoesNotMatch0ResponseBodyForContentTypes | -[**post_enum_with_true_does_not_match1_request_body**](#post_enum_with_true_does_not_match1_request_body) | **post** /requestBody/postEnumWithTrueDoesNotMatch1RequestBody | -[**post_enum_with_true_does_not_match1_response_body_for_content_types**](#post_enum_with_true_does_not_match1_response_body_for_content_types) | **post** /responseBody/postEnumWithTrueDoesNotMatch1ResponseBodyForContentTypes | -[**post_enums_in_properties_request_body**](#post_enums_in_properties_request_body) | **post** /requestBody/postEnumsInPropertiesRequestBody | -[**post_enums_in_properties_response_body_for_content_types**](#post_enums_in_properties_response_body_for_content_types) | **post** /responseBody/postEnumsInPropertiesResponseBodyForContentTypes | -[**post_forbidden_property_request_body**](#post_forbidden_property_request_body) | **post** /requestBody/postForbiddenPropertyRequestBody | -[**post_forbidden_property_response_body_for_content_types**](#post_forbidden_property_response_body_for_content_types) | **post** /responseBody/postForbiddenPropertyResponseBodyForContentTypes | -[**post_hostname_format_request_body**](#post_hostname_format_request_body) | **post** /requestBody/postHostnameFormatRequestBody | -[**post_hostname_format_response_body_for_content_types**](#post_hostname_format_response_body_for_content_types) | **post** /responseBody/postHostnameFormatResponseBodyForContentTypes | -[**post_integer_type_matches_integers_request_body**](#post_integer_type_matches_integers_request_body) | **post** /requestBody/postIntegerTypeMatchesIntegersRequestBody | -[**post_integer_type_matches_integers_response_body_for_content_types**](#post_integer_type_matches_integers_response_body_for_content_types) | **post** /responseBody/postIntegerTypeMatchesIntegersResponseBodyForContentTypes | -[**post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body**](#post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body) | **post** /requestBody/postInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody | -[**post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types**](#post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types) | **post** /responseBody/postInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfResponseBodyForContentTypes | -[**post_invalid_string_value_for_default_request_body**](#post_invalid_string_value_for_default_request_body) | **post** /requestBody/postInvalidStringValueForDefaultRequestBody | -[**post_invalid_string_value_for_default_response_body_for_content_types**](#post_invalid_string_value_for_default_response_body_for_content_types) | **post** /responseBody/postInvalidStringValueForDefaultResponseBodyForContentTypes | -[**post_ipv4_format_request_body**](#post_ipv4_format_request_body) | **post** /requestBody/postIpv4FormatRequestBody | -[**post_ipv4_format_response_body_for_content_types**](#post_ipv4_format_response_body_for_content_types) | **post** /responseBody/postIpv4FormatResponseBodyForContentTypes | -[**post_ipv6_format_request_body**](#post_ipv6_format_request_body) | **post** /requestBody/postIpv6FormatRequestBody | -[**post_ipv6_format_response_body_for_content_types**](#post_ipv6_format_response_body_for_content_types) | **post** /responseBody/postIpv6FormatResponseBodyForContentTypes | -[**post_json_pointer_format_request_body**](#post_json_pointer_format_request_body) | **post** /requestBody/postJsonPointerFormatRequestBody | -[**post_json_pointer_format_response_body_for_content_types**](#post_json_pointer_format_response_body_for_content_types) | **post** /responseBody/postJsonPointerFormatResponseBodyForContentTypes | -[**post_maximum_validation_request_body**](#post_maximum_validation_request_body) | **post** /requestBody/postMaximumValidationRequestBody | -[**post_maximum_validation_response_body_for_content_types**](#post_maximum_validation_response_body_for_content_types) | **post** /responseBody/postMaximumValidationResponseBodyForContentTypes | -[**post_maximum_validation_with_unsigned_integer_request_body**](#post_maximum_validation_with_unsigned_integer_request_body) | **post** /requestBody/postMaximumValidationWithUnsignedIntegerRequestBody | -[**post_maximum_validation_with_unsigned_integer_response_body_for_content_types**](#post_maximum_validation_with_unsigned_integer_response_body_for_content_types) | **post** /responseBody/postMaximumValidationWithUnsignedIntegerResponseBodyForContentTypes | -[**post_maxitems_validation_request_body**](#post_maxitems_validation_request_body) | **post** /requestBody/postMaxitemsValidationRequestBody | -[**post_maxitems_validation_response_body_for_content_types**](#post_maxitems_validation_response_body_for_content_types) | **post** /responseBody/postMaxitemsValidationResponseBodyForContentTypes | -[**post_maxlength_validation_request_body**](#post_maxlength_validation_request_body) | **post** /requestBody/postMaxlengthValidationRequestBody | -[**post_maxlength_validation_response_body_for_content_types**](#post_maxlength_validation_response_body_for_content_types) | **post** /responseBody/postMaxlengthValidationResponseBodyForContentTypes | -[**post_maxproperties0_means_the_object_is_empty_request_body**](#post_maxproperties0_means_the_object_is_empty_request_body) | **post** /requestBody/postMaxproperties0MeansTheObjectIsEmptyRequestBody | -[**post_maxproperties0_means_the_object_is_empty_response_body_for_content_types**](#post_maxproperties0_means_the_object_is_empty_response_body_for_content_types) | **post** /responseBody/postMaxproperties0MeansTheObjectIsEmptyResponseBodyForContentTypes | -[**post_maxproperties_validation_request_body**](#post_maxproperties_validation_request_body) | **post** /requestBody/postMaxpropertiesValidationRequestBody | -[**post_maxproperties_validation_response_body_for_content_types**](#post_maxproperties_validation_response_body_for_content_types) | **post** /responseBody/postMaxpropertiesValidationResponseBodyForContentTypes | -[**post_minimum_validation_request_body**](#post_minimum_validation_request_body) | **post** /requestBody/postMinimumValidationRequestBody | -[**post_minimum_validation_response_body_for_content_types**](#post_minimum_validation_response_body_for_content_types) | **post** /responseBody/postMinimumValidationResponseBodyForContentTypes | -[**post_minimum_validation_with_signed_integer_request_body**](#post_minimum_validation_with_signed_integer_request_body) | **post** /requestBody/postMinimumValidationWithSignedIntegerRequestBody | -[**post_minimum_validation_with_signed_integer_response_body_for_content_types**](#post_minimum_validation_with_signed_integer_response_body_for_content_types) | **post** /responseBody/postMinimumValidationWithSignedIntegerResponseBodyForContentTypes | -[**post_minitems_validation_request_body**](#post_minitems_validation_request_body) | **post** /requestBody/postMinitemsValidationRequestBody | -[**post_minitems_validation_response_body_for_content_types**](#post_minitems_validation_response_body_for_content_types) | **post** /responseBody/postMinitemsValidationResponseBodyForContentTypes | -[**post_minlength_validation_request_body**](#post_minlength_validation_request_body) | **post** /requestBody/postMinlengthValidationRequestBody | -[**post_minlength_validation_response_body_for_content_types**](#post_minlength_validation_response_body_for_content_types) | **post** /responseBody/postMinlengthValidationResponseBodyForContentTypes | -[**post_minproperties_validation_request_body**](#post_minproperties_validation_request_body) | **post** /requestBody/postMinpropertiesValidationRequestBody | -[**post_minproperties_validation_response_body_for_content_types**](#post_minproperties_validation_response_body_for_content_types) | **post** /responseBody/postMinpropertiesValidationResponseBodyForContentTypes | -[**post_nested_allof_to_check_validation_semantics_request_body**](#post_nested_allof_to_check_validation_semantics_request_body) | **post** /requestBody/postNestedAllofToCheckValidationSemanticsRequestBody | -[**post_nested_allof_to_check_validation_semantics_response_body_for_content_types**](#post_nested_allof_to_check_validation_semantics_response_body_for_content_types) | **post** /responseBody/postNestedAllofToCheckValidationSemanticsResponseBodyForContentTypes | -[**post_nested_anyof_to_check_validation_semantics_request_body**](#post_nested_anyof_to_check_validation_semantics_request_body) | **post** /requestBody/postNestedAnyofToCheckValidationSemanticsRequestBody | -[**post_nested_anyof_to_check_validation_semantics_response_body_for_content_types**](#post_nested_anyof_to_check_validation_semantics_response_body_for_content_types) | **post** /responseBody/postNestedAnyofToCheckValidationSemanticsResponseBodyForContentTypes | -[**post_nested_items_request_body**](#post_nested_items_request_body) | **post** /requestBody/postNestedItemsRequestBody | -[**post_nested_items_response_body_for_content_types**](#post_nested_items_response_body_for_content_types) | **post** /responseBody/postNestedItemsResponseBodyForContentTypes | -[**post_nested_oneof_to_check_validation_semantics_request_body**](#post_nested_oneof_to_check_validation_semantics_request_body) | **post** /requestBody/postNestedOneofToCheckValidationSemanticsRequestBody | -[**post_nested_oneof_to_check_validation_semantics_response_body_for_content_types**](#post_nested_oneof_to_check_validation_semantics_response_body_for_content_types) | **post** /responseBody/postNestedOneofToCheckValidationSemanticsResponseBodyForContentTypes | -[**post_not_more_complex_schema_request_body**](#post_not_more_complex_schema_request_body) | **post** /requestBody/postNotMoreComplexSchemaRequestBody | -[**post_not_more_complex_schema_response_body_for_content_types**](#post_not_more_complex_schema_response_body_for_content_types) | **post** /responseBody/postNotMoreComplexSchemaResponseBodyForContentTypes | -[**post_not_request_body**](#post_not_request_body) | **post** /requestBody/postNotRequestBody | -[**post_not_response_body_for_content_types**](#post_not_response_body_for_content_types) | **post** /responseBody/postNotResponseBodyForContentTypes | -[**post_nul_characters_in_strings_request_body**](#post_nul_characters_in_strings_request_body) | **post** /requestBody/postNulCharactersInStringsRequestBody | -[**post_nul_characters_in_strings_response_body_for_content_types**](#post_nul_characters_in_strings_response_body_for_content_types) | **post** /responseBody/postNulCharactersInStringsResponseBodyForContentTypes | -[**post_null_type_matches_only_the_null_object_request_body**](#post_null_type_matches_only_the_null_object_request_body) | **post** /requestBody/postNullTypeMatchesOnlyTheNullObjectRequestBody | -[**post_null_type_matches_only_the_null_object_response_body_for_content_types**](#post_null_type_matches_only_the_null_object_response_body_for_content_types) | **post** /responseBody/postNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes | -[**post_number_type_matches_numbers_request_body**](#post_number_type_matches_numbers_request_body) | **post** /requestBody/postNumberTypeMatchesNumbersRequestBody | -[**post_number_type_matches_numbers_response_body_for_content_types**](#post_number_type_matches_numbers_response_body_for_content_types) | **post** /responseBody/postNumberTypeMatchesNumbersResponseBodyForContentTypes | -[**post_object_properties_validation_request_body**](#post_object_properties_validation_request_body) | **post** /requestBody/postObjectPropertiesValidationRequestBody | -[**post_object_properties_validation_response_body_for_content_types**](#post_object_properties_validation_response_body_for_content_types) | **post** /responseBody/postObjectPropertiesValidationResponseBodyForContentTypes | -[**post_object_type_matches_objects_request_body**](#post_object_type_matches_objects_request_body) | **post** /requestBody/postObjectTypeMatchesObjectsRequestBody | -[**post_object_type_matches_objects_response_body_for_content_types**](#post_object_type_matches_objects_response_body_for_content_types) | **post** /responseBody/postObjectTypeMatchesObjectsResponseBodyForContentTypes | -[**post_oneof_complex_types_request_body**](#post_oneof_complex_types_request_body) | **post** /requestBody/postOneofComplexTypesRequestBody | -[**post_oneof_complex_types_response_body_for_content_types**](#post_oneof_complex_types_response_body_for_content_types) | **post** /responseBody/postOneofComplexTypesResponseBodyForContentTypes | -[**post_oneof_request_body**](#post_oneof_request_body) | **post** /requestBody/postOneofRequestBody | -[**post_oneof_response_body_for_content_types**](#post_oneof_response_body_for_content_types) | **post** /responseBody/postOneofResponseBodyForContentTypes | -[**post_oneof_with_base_schema_request_body**](#post_oneof_with_base_schema_request_body) | **post** /requestBody/postOneofWithBaseSchemaRequestBody | -[**post_oneof_with_base_schema_response_body_for_content_types**](#post_oneof_with_base_schema_response_body_for_content_types) | **post** /responseBody/postOneofWithBaseSchemaResponseBodyForContentTypes | -[**post_oneof_with_empty_schema_request_body**](#post_oneof_with_empty_schema_request_body) | **post** /requestBody/postOneofWithEmptySchemaRequestBody | -[**post_oneof_with_empty_schema_response_body_for_content_types**](#post_oneof_with_empty_schema_response_body_for_content_types) | **post** /responseBody/postOneofWithEmptySchemaResponseBodyForContentTypes | -[**post_oneof_with_required_request_body**](#post_oneof_with_required_request_body) | **post** /requestBody/postOneofWithRequiredRequestBody | -[**post_oneof_with_required_response_body_for_content_types**](#post_oneof_with_required_response_body_for_content_types) | **post** /responseBody/postOneofWithRequiredResponseBodyForContentTypes | -[**post_pattern_is_not_anchored_request_body**](#post_pattern_is_not_anchored_request_body) | **post** /requestBody/postPatternIsNotAnchoredRequestBody | -[**post_pattern_is_not_anchored_response_body_for_content_types**](#post_pattern_is_not_anchored_response_body_for_content_types) | **post** /responseBody/postPatternIsNotAnchoredResponseBodyForContentTypes | -[**post_pattern_validation_request_body**](#post_pattern_validation_request_body) | **post** /requestBody/postPatternValidationRequestBody | -[**post_pattern_validation_response_body_for_content_types**](#post_pattern_validation_response_body_for_content_types) | **post** /responseBody/postPatternValidationResponseBodyForContentTypes | -[**post_properties_with_escaped_characters_request_body**](#post_properties_with_escaped_characters_request_body) | **post** /requestBody/postPropertiesWithEscapedCharactersRequestBody | -[**post_properties_with_escaped_characters_response_body_for_content_types**](#post_properties_with_escaped_characters_response_body_for_content_types) | **post** /responseBody/postPropertiesWithEscapedCharactersResponseBodyForContentTypes | -[**post_property_named_ref_that_is_not_a_reference_request_body**](#post_property_named_ref_that_is_not_a_reference_request_body) | **post** /requestBody/postPropertyNamedRefThatIsNotAReferenceRequestBody | -[**post_property_named_ref_that_is_not_a_reference_response_body_for_content_types**](#post_property_named_ref_that_is_not_a_reference_response_body_for_content_types) | **post** /responseBody/postPropertyNamedRefThatIsNotAReferenceResponseBodyForContentTypes | -[**post_ref_in_additionalproperties_request_body**](#post_ref_in_additionalproperties_request_body) | **post** /requestBody/postRefInAdditionalpropertiesRequestBody | -[**post_ref_in_additionalproperties_response_body_for_content_types**](#post_ref_in_additionalproperties_response_body_for_content_types) | **post** /responseBody/postRefInAdditionalpropertiesResponseBodyForContentTypes | -[**post_ref_in_allof_request_body**](#post_ref_in_allof_request_body) | **post** /requestBody/postRefInAllofRequestBody | -[**post_ref_in_allof_response_body_for_content_types**](#post_ref_in_allof_response_body_for_content_types) | **post** /responseBody/postRefInAllofResponseBodyForContentTypes | -[**post_ref_in_anyof_request_body**](#post_ref_in_anyof_request_body) | **post** /requestBody/postRefInAnyofRequestBody | -[**post_ref_in_anyof_response_body_for_content_types**](#post_ref_in_anyof_response_body_for_content_types) | **post** /responseBody/postRefInAnyofResponseBodyForContentTypes | -[**post_ref_in_items_request_body**](#post_ref_in_items_request_body) | **post** /requestBody/postRefInItemsRequestBody | -[**post_ref_in_items_response_body_for_content_types**](#post_ref_in_items_response_body_for_content_types) | **post** /responseBody/postRefInItemsResponseBodyForContentTypes | -[**post_ref_in_not_request_body**](#post_ref_in_not_request_body) | **post** /requestBody/postRefInNotRequestBody | -[**post_ref_in_not_response_body_for_content_types**](#post_ref_in_not_response_body_for_content_types) | **post** /responseBody/postRefInNotResponseBodyForContentTypes | -[**post_ref_in_oneof_request_body**](#post_ref_in_oneof_request_body) | **post** /requestBody/postRefInOneofRequestBody | -[**post_ref_in_oneof_response_body_for_content_types**](#post_ref_in_oneof_response_body_for_content_types) | **post** /responseBody/postRefInOneofResponseBodyForContentTypes | -[**post_ref_in_property_request_body**](#post_ref_in_property_request_body) | **post** /requestBody/postRefInPropertyRequestBody | -[**post_ref_in_property_response_body_for_content_types**](#post_ref_in_property_response_body_for_content_types) | **post** /responseBody/postRefInPropertyResponseBodyForContentTypes | -[**post_required_default_validation_request_body**](#post_required_default_validation_request_body) | **post** /requestBody/postRequiredDefaultValidationRequestBody | -[**post_required_default_validation_response_body_for_content_types**](#post_required_default_validation_response_body_for_content_types) | **post** /responseBody/postRequiredDefaultValidationResponseBodyForContentTypes | -[**post_required_validation_request_body**](#post_required_validation_request_body) | **post** /requestBody/postRequiredValidationRequestBody | -[**post_required_validation_response_body_for_content_types**](#post_required_validation_response_body_for_content_types) | **post** /responseBody/postRequiredValidationResponseBodyForContentTypes | -[**post_required_with_empty_array_request_body**](#post_required_with_empty_array_request_body) | **post** /requestBody/postRequiredWithEmptyArrayRequestBody | -[**post_required_with_empty_array_response_body_for_content_types**](#post_required_with_empty_array_response_body_for_content_types) | **post** /responseBody/postRequiredWithEmptyArrayResponseBodyForContentTypes | -[**post_required_with_escaped_characters_request_body**](#post_required_with_escaped_characters_request_body) | **post** /requestBody/postRequiredWithEscapedCharactersRequestBody | -[**post_required_with_escaped_characters_response_body_for_content_types**](#post_required_with_escaped_characters_response_body_for_content_types) | **post** /responseBody/postRequiredWithEscapedCharactersResponseBodyForContentTypes | -[**post_simple_enum_validation_request_body**](#post_simple_enum_validation_request_body) | **post** /requestBody/postSimpleEnumValidationRequestBody | -[**post_simple_enum_validation_response_body_for_content_types**](#post_simple_enum_validation_response_body_for_content_types) | **post** /responseBody/postSimpleEnumValidationResponseBodyForContentTypes | -[**post_string_type_matches_strings_request_body**](#post_string_type_matches_strings_request_body) | **post** /requestBody/postStringTypeMatchesStringsRequestBody | -[**post_string_type_matches_strings_response_body_for_content_types**](#post_string_type_matches_strings_response_body_for_content_types) | **post** /responseBody/postStringTypeMatchesStringsResponseBodyForContentTypes | -[**post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body**](#post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body) | **post** /requestBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody | -[**post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types**](#post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types) | **post** /responseBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyForContentTypes | -[**post_uniqueitems_false_validation_request_body**](#post_uniqueitems_false_validation_request_body) | **post** /requestBody/postUniqueitemsFalseValidationRequestBody | -[**post_uniqueitems_false_validation_response_body_for_content_types**](#post_uniqueitems_false_validation_response_body_for_content_types) | **post** /responseBody/postUniqueitemsFalseValidationResponseBodyForContentTypes | -[**post_uniqueitems_validation_request_body**](#post_uniqueitems_validation_request_body) | **post** /requestBody/postUniqueitemsValidationRequestBody | -[**post_uniqueitems_validation_response_body_for_content_types**](#post_uniqueitems_validation_response_body_for_content_types) | **post** /responseBody/postUniqueitemsValidationResponseBodyForContentTypes | -[**post_uri_format_request_body**](#post_uri_format_request_body) | **post** /requestBody/postUriFormatRequestBody | -[**post_uri_format_response_body_for_content_types**](#post_uri_format_response_body_for_content_types) | **post** /responseBody/postUriFormatResponseBodyForContentTypes | -[**post_uri_reference_format_request_body**](#post_uri_reference_format_request_body) | **post** /requestBody/postUriReferenceFormatRequestBody | -[**post_uri_reference_format_response_body_for_content_types**](#post_uri_reference_format_response_body_for_content_types) | **post** /responseBody/postUriReferenceFormatResponseBodyForContentTypes | -[**post_uri_template_format_request_body**](#post_uri_template_format_request_body) | **post** /requestBody/postUriTemplateFormatRequestBody | -[**post_uri_template_format_response_body_for_content_types**](#post_uri_template_format_response_body_for_content_types) | **post** /responseBody/postUriTemplateFormatResponseBodyForContentTypes | - -# **post_additionalproperties_allows_a_schema_which_should_validate_request_body** - -> post_additionalproperties_allows_a_schema_which_should_validate_request_body(additionalproperties_allows_a_schema_which_should_validate) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.additionalproperties_allows_a_schema_which_should_validate import AdditionalpropertiesAllowsASchemaWhichShouldValidate -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = AdditionalpropertiesAllowsASchemaWhichShouldValidate( - foo=None, - bar=None, - ) - try: - api_response = api_instance.post_additionalproperties_allows_a_schema_which_should_validate_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_additionalproperties_allows_a_schema_which_should_validate_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AdditionalpropertiesAllowsASchemaWhichShouldValidate**](../../models/AdditionalpropertiesAllowsASchemaWhichShouldValidate.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_additionalproperties_allows_a_schema_which_should_validate_request_body.ApiResponseFor200) | success - -#### post_additionalproperties_allows_a_schema_which_should_validate_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types** - -> AdditionalpropertiesAllowsASchemaWhichShouldValidate post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.additionalproperties_allows_a_schema_which_should_validate import AdditionalpropertiesAllowsASchemaWhichShouldValidate -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types.ApiResponseFor200) | success - -#### post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AdditionalpropertiesAllowsASchemaWhichShouldValidate**](../../models/AdditionalpropertiesAllowsASchemaWhichShouldValidate.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_additionalproperties_are_allowed_by_default_request_body** - -> post_additionalproperties_are_allowed_by_default_request_body(additionalproperties_are_allowed_by_default) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.additionalproperties_are_allowed_by_default import AdditionalpropertiesAreAllowedByDefault -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = AdditionalpropertiesAreAllowedByDefault(None) - try: - api_response = api_instance.post_additionalproperties_are_allowed_by_default_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_additionalproperties_are_allowed_by_default_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AdditionalpropertiesAreAllowedByDefault**](../../models/AdditionalpropertiesAreAllowedByDefault.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_additionalproperties_are_allowed_by_default_request_body.ApiResponseFor200) | success - -#### post_additionalproperties_are_allowed_by_default_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_additionalproperties_are_allowed_by_default_response_body_for_content_types** - -> AdditionalpropertiesAreAllowedByDefault post_additionalproperties_are_allowed_by_default_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.additionalproperties_are_allowed_by_default import AdditionalpropertiesAreAllowedByDefault -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_additionalproperties_are_allowed_by_default_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_additionalproperties_are_allowed_by_default_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_additionalproperties_are_allowed_by_default_response_body_for_content_types.ApiResponseFor200) | success - -#### post_additionalproperties_are_allowed_by_default_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AdditionalpropertiesAreAllowedByDefault**](../../models/AdditionalpropertiesAreAllowedByDefault.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_additionalproperties_can_exist_by_itself_request_body** - -> post_additionalproperties_can_exist_by_itself_request_body(additionalproperties_can_exist_by_itself) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.additionalproperties_can_exist_by_itself import AdditionalpropertiesCanExistByItself -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = AdditionalpropertiesCanExistByItself( - key=True, - ) - try: - api_response = api_instance.post_additionalproperties_can_exist_by_itself_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_additionalproperties_can_exist_by_itself_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AdditionalpropertiesCanExistByItself**](../../models/AdditionalpropertiesCanExistByItself.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_additionalproperties_can_exist_by_itself_request_body.ApiResponseFor200) | success - -#### post_additionalproperties_can_exist_by_itself_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_additionalproperties_can_exist_by_itself_response_body_for_content_types** - -> AdditionalpropertiesCanExistByItself post_additionalproperties_can_exist_by_itself_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.additionalproperties_can_exist_by_itself import AdditionalpropertiesCanExistByItself -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_additionalproperties_can_exist_by_itself_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_additionalproperties_can_exist_by_itself_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_additionalproperties_can_exist_by_itself_response_body_for_content_types.ApiResponseFor200) | success - -#### post_additionalproperties_can_exist_by_itself_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AdditionalpropertiesCanExistByItself**](../../models/AdditionalpropertiesCanExistByItself.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_additionalproperties_should_not_look_in_applicators_request_body** - -> post_additionalproperties_should_not_look_in_applicators_request_body(additionalproperties_should_not_look_in_applicators) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.additionalproperties_should_not_look_in_applicators import AdditionalpropertiesShouldNotLookInApplicators -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = AdditionalpropertiesShouldNotLookInApplicators(None) - try: - api_response = api_instance.post_additionalproperties_should_not_look_in_applicators_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_additionalproperties_should_not_look_in_applicators_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AdditionalpropertiesShouldNotLookInApplicators**](../../models/AdditionalpropertiesShouldNotLookInApplicators.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_additionalproperties_should_not_look_in_applicators_request_body.ApiResponseFor200) | success - -#### post_additionalproperties_should_not_look_in_applicators_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types** - -> AdditionalpropertiesShouldNotLookInApplicators post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.additionalproperties_should_not_look_in_applicators import AdditionalpropertiesShouldNotLookInApplicators -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types.ApiResponseFor200) | success - -#### post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AdditionalpropertiesShouldNotLookInApplicators**](../../models/AdditionalpropertiesShouldNotLookInApplicators.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_allof_combined_with_anyof_oneof_request_body** - -> post_allof_combined_with_anyof_oneof_request_body(allof_combined_with_anyof_oneof) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.allof_combined_with_anyof_oneof import AllofCombinedWithAnyofOneof -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = AllofCombinedWithAnyofOneof(None) - try: - api_response = api_instance.post_allof_combined_with_anyof_oneof_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_allof_combined_with_anyof_oneof_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AllofCombinedWithAnyofOneof**](../../models/AllofCombinedWithAnyofOneof.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_allof_combined_with_anyof_oneof_request_body.ApiResponseFor200) | success - -#### post_allof_combined_with_anyof_oneof_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_allof_combined_with_anyof_oneof_response_body_for_content_types** - -> AllofCombinedWithAnyofOneof post_allof_combined_with_anyof_oneof_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.allof_combined_with_anyof_oneof import AllofCombinedWithAnyofOneof -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_allof_combined_with_anyof_oneof_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_allof_combined_with_anyof_oneof_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_allof_combined_with_anyof_oneof_response_body_for_content_types.ApiResponseFor200) | success - -#### post_allof_combined_with_anyof_oneof_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AllofCombinedWithAnyofOneof**](../../models/AllofCombinedWithAnyofOneof.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_allof_request_body** - -> post_allof_request_body(allof) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.allof import Allof -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = Allof(None) - try: - api_response = api_instance.post_allof_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_allof_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**Allof**](../../models/Allof.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_allof_request_body.ApiResponseFor200) | success - -#### post_allof_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_allof_response_body_for_content_types** - -> Allof post_allof_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.allof import Allof -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_allof_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_allof_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_allof_response_body_for_content_types.ApiResponseFor200) | success - -#### post_allof_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**Allof**](../../models/Allof.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_allof_simple_types_request_body** - -> post_allof_simple_types_request_body(allof_simple_types) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.allof_simple_types import AllofSimpleTypes -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = AllofSimpleTypes(None) - try: - api_response = api_instance.post_allof_simple_types_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_allof_simple_types_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AllofSimpleTypes**](../../models/AllofSimpleTypes.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_allof_simple_types_request_body.ApiResponseFor200) | success - -#### post_allof_simple_types_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_allof_simple_types_response_body_for_content_types** - -> AllofSimpleTypes post_allof_simple_types_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.allof_simple_types import AllofSimpleTypes -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_allof_simple_types_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_allof_simple_types_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_allof_simple_types_response_body_for_content_types.ApiResponseFor200) | success - -#### post_allof_simple_types_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AllofSimpleTypes**](../../models/AllofSimpleTypes.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_allof_with_base_schema_request_body** - -> post_allof_with_base_schema_request_body(allof_with_base_schema) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.allof_with_base_schema import AllofWithBaseSchema -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = AllofWithBaseSchema({}) - try: - api_response = api_instance.post_allof_with_base_schema_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_allof_with_base_schema_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AllofWithBaseSchema**](../../models/AllofWithBaseSchema.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_allof_with_base_schema_request_body.ApiResponseFor200) | success - -#### post_allof_with_base_schema_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_allof_with_base_schema_response_body_for_content_types** - -> AllofWithBaseSchema post_allof_with_base_schema_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.allof_with_base_schema import AllofWithBaseSchema -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_allof_with_base_schema_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_allof_with_base_schema_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_allof_with_base_schema_response_body_for_content_types.ApiResponseFor200) | success - -#### post_allof_with_base_schema_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AllofWithBaseSchema**](../../models/AllofWithBaseSchema.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_allof_with_one_empty_schema_request_body** - -> post_allof_with_one_empty_schema_request_body(allof_with_one_empty_schema) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.allof_with_one_empty_schema import AllofWithOneEmptySchema -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = AllofWithOneEmptySchema(None) - try: - api_response = api_instance.post_allof_with_one_empty_schema_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_allof_with_one_empty_schema_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AllofWithOneEmptySchema**](../../models/AllofWithOneEmptySchema.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_allof_with_one_empty_schema_request_body.ApiResponseFor200) | success - -#### post_allof_with_one_empty_schema_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_allof_with_one_empty_schema_response_body_for_content_types** - -> AllofWithOneEmptySchema post_allof_with_one_empty_schema_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.allof_with_one_empty_schema import AllofWithOneEmptySchema -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_allof_with_one_empty_schema_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_allof_with_one_empty_schema_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_allof_with_one_empty_schema_response_body_for_content_types.ApiResponseFor200) | success - -#### post_allof_with_one_empty_schema_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AllofWithOneEmptySchema**](../../models/AllofWithOneEmptySchema.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_allof_with_the_first_empty_schema_request_body** - -> post_allof_with_the_first_empty_schema_request_body(allof_with_the_first_empty_schema) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.allof_with_the_first_empty_schema import AllofWithTheFirstEmptySchema -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = AllofWithTheFirstEmptySchema(None) - try: - api_response = api_instance.post_allof_with_the_first_empty_schema_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_allof_with_the_first_empty_schema_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AllofWithTheFirstEmptySchema**](../../models/AllofWithTheFirstEmptySchema.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_allof_with_the_first_empty_schema_request_body.ApiResponseFor200) | success - -#### post_allof_with_the_first_empty_schema_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_allof_with_the_first_empty_schema_response_body_for_content_types** - -> AllofWithTheFirstEmptySchema post_allof_with_the_first_empty_schema_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.allof_with_the_first_empty_schema import AllofWithTheFirstEmptySchema -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_allof_with_the_first_empty_schema_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_allof_with_the_first_empty_schema_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_allof_with_the_first_empty_schema_response_body_for_content_types.ApiResponseFor200) | success - -#### post_allof_with_the_first_empty_schema_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AllofWithTheFirstEmptySchema**](../../models/AllofWithTheFirstEmptySchema.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_allof_with_the_last_empty_schema_request_body** - -> post_allof_with_the_last_empty_schema_request_body(allof_with_the_last_empty_schema) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.allof_with_the_last_empty_schema import AllofWithTheLastEmptySchema -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = AllofWithTheLastEmptySchema(None) - try: - api_response = api_instance.post_allof_with_the_last_empty_schema_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_allof_with_the_last_empty_schema_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AllofWithTheLastEmptySchema**](../../models/AllofWithTheLastEmptySchema.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_allof_with_the_last_empty_schema_request_body.ApiResponseFor200) | success - -#### post_allof_with_the_last_empty_schema_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_allof_with_the_last_empty_schema_response_body_for_content_types** - -> AllofWithTheLastEmptySchema post_allof_with_the_last_empty_schema_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.allof_with_the_last_empty_schema import AllofWithTheLastEmptySchema -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_allof_with_the_last_empty_schema_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_allof_with_the_last_empty_schema_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_allof_with_the_last_empty_schema_response_body_for_content_types.ApiResponseFor200) | success - -#### post_allof_with_the_last_empty_schema_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AllofWithTheLastEmptySchema**](../../models/AllofWithTheLastEmptySchema.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_allof_with_two_empty_schemas_request_body** - -> post_allof_with_two_empty_schemas_request_body(allof_with_two_empty_schemas) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.allof_with_two_empty_schemas import AllofWithTwoEmptySchemas -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = AllofWithTwoEmptySchemas(None) - try: - api_response = api_instance.post_allof_with_two_empty_schemas_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_allof_with_two_empty_schemas_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AllofWithTwoEmptySchemas**](../../models/AllofWithTwoEmptySchemas.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_allof_with_two_empty_schemas_request_body.ApiResponseFor200) | success - -#### post_allof_with_two_empty_schemas_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_allof_with_two_empty_schemas_response_body_for_content_types** - -> AllofWithTwoEmptySchemas post_allof_with_two_empty_schemas_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.allof_with_two_empty_schemas import AllofWithTwoEmptySchemas -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_allof_with_two_empty_schemas_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_allof_with_two_empty_schemas_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_allof_with_two_empty_schemas_response_body_for_content_types.ApiResponseFor200) | success - -#### post_allof_with_two_empty_schemas_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AllofWithTwoEmptySchemas**](../../models/AllofWithTwoEmptySchemas.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_anyof_complex_types_request_body** - -> post_anyof_complex_types_request_body(anyof_complex_types) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.anyof_complex_types import AnyofComplexTypes -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = AnyofComplexTypes(None) - try: - api_response = api_instance.post_anyof_complex_types_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_anyof_complex_types_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AnyofComplexTypes**](../../models/AnyofComplexTypes.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_anyof_complex_types_request_body.ApiResponseFor200) | success - -#### post_anyof_complex_types_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_anyof_complex_types_response_body_for_content_types** - -> AnyofComplexTypes post_anyof_complex_types_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.anyof_complex_types import AnyofComplexTypes -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_anyof_complex_types_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_anyof_complex_types_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_anyof_complex_types_response_body_for_content_types.ApiResponseFor200) | success - -#### post_anyof_complex_types_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AnyofComplexTypes**](../../models/AnyofComplexTypes.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_anyof_request_body** - -> post_anyof_request_body(anyof) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.anyof import Anyof -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = Anyof(None) - try: - api_response = api_instance.post_anyof_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_anyof_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**Anyof**](../../models/Anyof.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_anyof_request_body.ApiResponseFor200) | success - -#### post_anyof_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_anyof_response_body_for_content_types** - -> Anyof post_anyof_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.anyof import Anyof -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_anyof_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_anyof_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_anyof_response_body_for_content_types.ApiResponseFor200) | success - -#### post_anyof_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**Anyof**](../../models/Anyof.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_anyof_with_base_schema_request_body** - -> post_anyof_with_base_schema_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.anyof_with_base_schema import AnyofWithBaseSchema -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = AnyofWithBaseSchema("body_example") - try: - api_response = api_instance.post_anyof_with_base_schema_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_anyof_with_base_schema_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AnyofWithBaseSchema**](../../models/AnyofWithBaseSchema.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_anyof_with_base_schema_request_body.ApiResponseFor200) | success - -#### post_anyof_with_base_schema_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_anyof_with_base_schema_response_body_for_content_types** - -> AnyofWithBaseSchema post_anyof_with_base_schema_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.anyof_with_base_schema import AnyofWithBaseSchema -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_anyof_with_base_schema_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_anyof_with_base_schema_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_anyof_with_base_schema_response_body_for_content_types.ApiResponseFor200) | success - -#### post_anyof_with_base_schema_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AnyofWithBaseSchema**](../../models/AnyofWithBaseSchema.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_anyof_with_one_empty_schema_request_body** - -> post_anyof_with_one_empty_schema_request_body(anyof_with_one_empty_schema) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.anyof_with_one_empty_schema import AnyofWithOneEmptySchema -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = AnyofWithOneEmptySchema(None) - try: - api_response = api_instance.post_anyof_with_one_empty_schema_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_anyof_with_one_empty_schema_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AnyofWithOneEmptySchema**](../../models/AnyofWithOneEmptySchema.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_anyof_with_one_empty_schema_request_body.ApiResponseFor200) | success - -#### post_anyof_with_one_empty_schema_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_anyof_with_one_empty_schema_response_body_for_content_types** - -> AnyofWithOneEmptySchema post_anyof_with_one_empty_schema_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.anyof_with_one_empty_schema import AnyofWithOneEmptySchema -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_anyof_with_one_empty_schema_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_anyof_with_one_empty_schema_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_anyof_with_one_empty_schema_response_body_for_content_types.ApiResponseFor200) | success - -#### post_anyof_with_one_empty_schema_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AnyofWithOneEmptySchema**](../../models/AnyofWithOneEmptySchema.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_array_type_matches_arrays_request_body** - -> post_array_type_matches_arrays_request_body(array_type_matches_arrays) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.array_type_matches_arrays import ArrayTypeMatchesArrays -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = ArrayTypeMatchesArrays([ - None - ]) - try: - api_response = api_instance.post_array_type_matches_arrays_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_array_type_matches_arrays_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**ArrayTypeMatchesArrays**](../../models/ArrayTypeMatchesArrays.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_array_type_matches_arrays_request_body.ApiResponseFor200) | success - -#### post_array_type_matches_arrays_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_array_type_matches_arrays_response_body_for_content_types** - -> ArrayTypeMatchesArrays post_array_type_matches_arrays_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.array_type_matches_arrays import ArrayTypeMatchesArrays -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_array_type_matches_arrays_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_array_type_matches_arrays_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_array_type_matches_arrays_response_body_for_content_types.ApiResponseFor200) | success - -#### post_array_type_matches_arrays_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**ArrayTypeMatchesArrays**](../../models/ArrayTypeMatchesArrays.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_boolean_type_matches_booleans_request_body** - -> post_boolean_type_matches_booleans_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = True - try: - api_response = api_instance.post_boolean_type_matches_booleans_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_boolean_type_matches_booleans_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -bool, | BoolClass, | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_boolean_type_matches_booleans_request_body.ApiResponseFor200) | success - -#### post_boolean_type_matches_booleans_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_boolean_type_matches_booleans_response_body_for_content_types** - -> bool post_boolean_type_matches_booleans_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_boolean_type_matches_booleans_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_boolean_type_matches_booleans_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_boolean_type_matches_booleans_response_body_for_content_types.ApiResponseFor200) | success - -#### post_boolean_type_matches_booleans_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -bool, | BoolClass, | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_by_int_request_body** - -> post_by_int_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.by_int import ByInt -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = ByInt(None) - try: - api_response = api_instance.post_by_int_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_by_int_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**ByInt**](../../models/ByInt.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_by_int_request_body.ApiResponseFor200) | success - -#### post_by_int_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_by_int_response_body_for_content_types** - -> ByInt post_by_int_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.by_int import ByInt -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_by_int_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_by_int_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_by_int_response_body_for_content_types.ApiResponseFor200) | success - -#### post_by_int_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**ByInt**](../../models/ByInt.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_by_number_request_body** - -> post_by_number_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.by_number import ByNumber -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = ByNumber(None) - try: - api_response = api_instance.post_by_number_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_by_number_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**ByNumber**](../../models/ByNumber.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_by_number_request_body.ApiResponseFor200) | success - -#### post_by_number_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_by_number_response_body_for_content_types** - -> ByNumber post_by_number_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.by_number import ByNumber -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_by_number_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_by_number_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_by_number_response_body_for_content_types.ApiResponseFor200) | success - -#### post_by_number_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**ByNumber**](../../models/ByNumber.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_by_small_number_request_body** - -> post_by_small_number_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.by_small_number import BySmallNumber -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = BySmallNumber(None) - try: - api_response = api_instance.post_by_small_number_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_by_small_number_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**BySmallNumber**](../../models/BySmallNumber.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_by_small_number_request_body.ApiResponseFor200) | success - -#### post_by_small_number_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_by_small_number_response_body_for_content_types** - -> BySmallNumber post_by_small_number_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.by_small_number import BySmallNumber -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_by_small_number_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_by_small_number_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_by_small_number_response_body_for_content_types.ApiResponseFor200) | success - -#### post_by_small_number_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**BySmallNumber**](../../models/BySmallNumber.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_date_time_format_request_body** - -> post_date_time_format_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = None - try: - api_response = api_instance.post_date_time_format_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_date_time_format_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | value must conform to RFC-3339 date-time - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_date_time_format_request_body.ApiResponseFor200) | success - -#### post_date_time_format_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_date_time_format_response_body_for_content_types** - -> bool, date, datetime, dict, float, int, list, str, none_type post_date_time_format_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_date_time_format_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_date_time_format_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_date_time_format_response_body_for_content_types.ApiResponseFor200) | success - -#### post_date_time_format_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | value must conform to RFC-3339 date-time - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_email_format_request_body** - -> post_email_format_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = None - try: - api_response = api_instance.post_email_format_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_email_format_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_email_format_request_body.ApiResponseFor200) | success - -#### post_email_format_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_email_format_response_body_for_content_types** - -> bool, date, datetime, dict, float, int, list, str, none_type post_email_format_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_email_format_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_email_format_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_email_format_response_body_for_content_types.ApiResponseFor200) | success - -#### post_email_format_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_enum_with0_does_not_match_false_request_body** - -> post_enum_with0_does_not_match_false_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.enum_with0_does_not_match_false import EnumWith0DoesNotMatchFalse -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = EnumWith0DoesNotMatchFalse(0) - try: - api_response = api_instance.post_enum_with0_does_not_match_false_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_enum_with0_does_not_match_false_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**EnumWith0DoesNotMatchFalse**](../../models/EnumWith0DoesNotMatchFalse.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_enum_with0_does_not_match_false_request_body.ApiResponseFor200) | success - -#### post_enum_with0_does_not_match_false_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_enum_with0_does_not_match_false_response_body_for_content_types** - -> EnumWith0DoesNotMatchFalse post_enum_with0_does_not_match_false_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.enum_with0_does_not_match_false import EnumWith0DoesNotMatchFalse -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_enum_with0_does_not_match_false_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_enum_with0_does_not_match_false_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_enum_with0_does_not_match_false_response_body_for_content_types.ApiResponseFor200) | success - -#### post_enum_with0_does_not_match_false_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**EnumWith0DoesNotMatchFalse**](../../models/EnumWith0DoesNotMatchFalse.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_enum_with1_does_not_match_true_request_body** - -> post_enum_with1_does_not_match_true_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.enum_with1_does_not_match_true import EnumWith1DoesNotMatchTrue -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = EnumWith1DoesNotMatchTrue(1) - try: - api_response = api_instance.post_enum_with1_does_not_match_true_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_enum_with1_does_not_match_true_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**EnumWith1DoesNotMatchTrue**](../../models/EnumWith1DoesNotMatchTrue.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_enum_with1_does_not_match_true_request_body.ApiResponseFor200) | success - -#### post_enum_with1_does_not_match_true_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_enum_with1_does_not_match_true_response_body_for_content_types** - -> EnumWith1DoesNotMatchTrue post_enum_with1_does_not_match_true_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.enum_with1_does_not_match_true import EnumWith1DoesNotMatchTrue -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_enum_with1_does_not_match_true_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_enum_with1_does_not_match_true_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_enum_with1_does_not_match_true_response_body_for_content_types.ApiResponseFor200) | success - -#### post_enum_with1_does_not_match_true_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**EnumWith1DoesNotMatchTrue**](../../models/EnumWith1DoesNotMatchTrue.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_enum_with_escaped_characters_request_body** - -> post_enum_with_escaped_characters_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.enum_with_escaped_characters import EnumWithEscapedCharacters -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = EnumWithEscapedCharacters("foo\nbar") - try: - api_response = api_instance.post_enum_with_escaped_characters_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_enum_with_escaped_characters_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**EnumWithEscapedCharacters**](../../models/EnumWithEscapedCharacters.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_enum_with_escaped_characters_request_body.ApiResponseFor200) | success - -#### post_enum_with_escaped_characters_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_enum_with_escaped_characters_response_body_for_content_types** - -> EnumWithEscapedCharacters post_enum_with_escaped_characters_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.enum_with_escaped_characters import EnumWithEscapedCharacters -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_enum_with_escaped_characters_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_enum_with_escaped_characters_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_enum_with_escaped_characters_response_body_for_content_types.ApiResponseFor200) | success - -#### post_enum_with_escaped_characters_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**EnumWithEscapedCharacters**](../../models/EnumWithEscapedCharacters.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_enum_with_false_does_not_match0_request_body** - -> post_enum_with_false_does_not_match0_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.enum_with_false_does_not_match0 import EnumWithFalseDoesNotMatch0 -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = EnumWithFalseDoesNotMatch0(False) - try: - api_response = api_instance.post_enum_with_false_does_not_match0_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_enum_with_false_does_not_match0_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**EnumWithFalseDoesNotMatch0**](../../models/EnumWithFalseDoesNotMatch0.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_enum_with_false_does_not_match0_request_body.ApiResponseFor200) | success - -#### post_enum_with_false_does_not_match0_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_enum_with_false_does_not_match0_response_body_for_content_types** - -> EnumWithFalseDoesNotMatch0 post_enum_with_false_does_not_match0_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.enum_with_false_does_not_match0 import EnumWithFalseDoesNotMatch0 -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_enum_with_false_does_not_match0_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_enum_with_false_does_not_match0_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_enum_with_false_does_not_match0_response_body_for_content_types.ApiResponseFor200) | success - -#### post_enum_with_false_does_not_match0_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**EnumWithFalseDoesNotMatch0**](../../models/EnumWithFalseDoesNotMatch0.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_enum_with_true_does_not_match1_request_body** - -> post_enum_with_true_does_not_match1_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.enum_with_true_does_not_match1 import EnumWithTrueDoesNotMatch1 -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = EnumWithTrueDoesNotMatch1(True) - try: - api_response = api_instance.post_enum_with_true_does_not_match1_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_enum_with_true_does_not_match1_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**EnumWithTrueDoesNotMatch1**](../../models/EnumWithTrueDoesNotMatch1.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_enum_with_true_does_not_match1_request_body.ApiResponseFor200) | success - -#### post_enum_with_true_does_not_match1_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_enum_with_true_does_not_match1_response_body_for_content_types** - -> EnumWithTrueDoesNotMatch1 post_enum_with_true_does_not_match1_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.enum_with_true_does_not_match1 import EnumWithTrueDoesNotMatch1 -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_enum_with_true_does_not_match1_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_enum_with_true_does_not_match1_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_enum_with_true_does_not_match1_response_body_for_content_types.ApiResponseFor200) | success - -#### post_enum_with_true_does_not_match1_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**EnumWithTrueDoesNotMatch1**](../../models/EnumWithTrueDoesNotMatch1.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_enums_in_properties_request_body** - -> post_enums_in_properties_request_body(enums_in_properties) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.enums_in_properties import EnumsInProperties -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = EnumsInProperties( - foo="foo", - bar="bar", - ) - try: - api_response = api_instance.post_enums_in_properties_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_enums_in_properties_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**EnumsInProperties**](../../models/EnumsInProperties.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_enums_in_properties_request_body.ApiResponseFor200) | success - -#### post_enums_in_properties_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_enums_in_properties_response_body_for_content_types** - -> EnumsInProperties post_enums_in_properties_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.enums_in_properties import EnumsInProperties -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_enums_in_properties_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_enums_in_properties_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_enums_in_properties_response_body_for_content_types.ApiResponseFor200) | success - -#### post_enums_in_properties_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**EnumsInProperties**](../../models/EnumsInProperties.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_forbidden_property_request_body** - -> post_forbidden_property_request_body(forbidden_property) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.forbidden_property import ForbiddenProperty -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = ForbiddenProperty(None) - try: - api_response = api_instance.post_forbidden_property_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_forbidden_property_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**ForbiddenProperty**](../../models/ForbiddenProperty.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_forbidden_property_request_body.ApiResponseFor200) | success - -#### post_forbidden_property_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_forbidden_property_response_body_for_content_types** - -> ForbiddenProperty post_forbidden_property_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.forbidden_property import ForbiddenProperty -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_forbidden_property_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_forbidden_property_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_forbidden_property_response_body_for_content_types.ApiResponseFor200) | success - -#### post_forbidden_property_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**ForbiddenProperty**](../../models/ForbiddenProperty.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_hostname_format_request_body** - -> post_hostname_format_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = None - try: - api_response = api_instance.post_hostname_format_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_hostname_format_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_hostname_format_request_body.ApiResponseFor200) | success - -#### post_hostname_format_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_hostname_format_response_body_for_content_types** - -> bool, date, datetime, dict, float, int, list, str, none_type post_hostname_format_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_hostname_format_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_hostname_format_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_hostname_format_response_body_for_content_types.ApiResponseFor200) | success - -#### post_hostname_format_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_integer_type_matches_integers_request_body** - -> post_integer_type_matches_integers_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = 1 - try: - api_response = api_instance.post_integer_type_matches_integers_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_integer_type_matches_integers_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -decimal.Decimal, int, | decimal.Decimal, | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_integer_type_matches_integers_request_body.ApiResponseFor200) | success - -#### post_integer_type_matches_integers_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_integer_type_matches_integers_response_body_for_content_types** - -> int post_integer_type_matches_integers_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_integer_type_matches_integers_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_integer_type_matches_integers_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_integer_type_matches_integers_response_body_for_content_types.ApiResponseFor200) | success - -#### post_integer_type_matches_integers_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -decimal.Decimal, int, | decimal.Decimal, | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body** - -> post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.invalid_instance_should_not_raise_error_when_float_division_inf import InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf(1) - try: - api_response = api_instance.post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf**](../../models/InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body.ApiResponseFor200) | success - -#### post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types** - -> InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.invalid_instance_should_not_raise_error_when_float_division_inf import InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types.ApiResponseFor200) | success - -#### post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf**](../../models/InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_invalid_string_value_for_default_request_body** - -> post_invalid_string_value_for_default_request_body(invalid_string_value_for_default) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.invalid_string_value_for_default import InvalidStringValueForDefault -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = InvalidStringValueForDefault(None) - try: - api_response = api_instance.post_invalid_string_value_for_default_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_invalid_string_value_for_default_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**InvalidStringValueForDefault**](../../models/InvalidStringValueForDefault.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_invalid_string_value_for_default_request_body.ApiResponseFor200) | success - -#### post_invalid_string_value_for_default_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_invalid_string_value_for_default_response_body_for_content_types** - -> InvalidStringValueForDefault post_invalid_string_value_for_default_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.invalid_string_value_for_default import InvalidStringValueForDefault -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_invalid_string_value_for_default_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_invalid_string_value_for_default_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_invalid_string_value_for_default_response_body_for_content_types.ApiResponseFor200) | success - -#### post_invalid_string_value_for_default_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**InvalidStringValueForDefault**](../../models/InvalidStringValueForDefault.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ipv4_format_request_body** - -> post_ipv4_format_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = None - try: - api_response = api_instance.post_ipv4_format_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_ipv4_format_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ipv4_format_request_body.ApiResponseFor200) | success - -#### post_ipv4_format_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ipv4_format_response_body_for_content_types** - -> bool, date, datetime, dict, float, int, list, str, none_type post_ipv4_format_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_ipv4_format_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_ipv4_format_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ipv4_format_response_body_for_content_types.ApiResponseFor200) | success - -#### post_ipv4_format_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ipv6_format_request_body** - -> post_ipv6_format_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = None - try: - api_response = api_instance.post_ipv6_format_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_ipv6_format_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ipv6_format_request_body.ApiResponseFor200) | success - -#### post_ipv6_format_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ipv6_format_response_body_for_content_types** - -> bool, date, datetime, dict, float, int, list, str, none_type post_ipv6_format_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_ipv6_format_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_ipv6_format_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ipv6_format_response_body_for_content_types.ApiResponseFor200) | success - -#### post_ipv6_format_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_json_pointer_format_request_body** - -> post_json_pointer_format_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = None - try: - api_response = api_instance.post_json_pointer_format_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_json_pointer_format_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_json_pointer_format_request_body.ApiResponseFor200) | success - -#### post_json_pointer_format_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_json_pointer_format_response_body_for_content_types** - -> bool, date, datetime, dict, float, int, list, str, none_type post_json_pointer_format_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_json_pointer_format_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_json_pointer_format_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_json_pointer_format_response_body_for_content_types.ApiResponseFor200) | success - -#### post_json_pointer_format_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_maximum_validation_request_body** - -> post_maximum_validation_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.maximum_validation import MaximumValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = MaximumValidation(None) - try: - api_response = api_instance.post_maximum_validation_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_maximum_validation_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MaximumValidation**](../../models/MaximumValidation.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_maximum_validation_request_body.ApiResponseFor200) | success - -#### post_maximum_validation_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_maximum_validation_response_body_for_content_types** - -> MaximumValidation post_maximum_validation_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.maximum_validation import MaximumValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_maximum_validation_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_maximum_validation_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_maximum_validation_response_body_for_content_types.ApiResponseFor200) | success - -#### post_maximum_validation_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MaximumValidation**](../../models/MaximumValidation.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_maximum_validation_with_unsigned_integer_request_body** - -> post_maximum_validation_with_unsigned_integer_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.maximum_validation_with_unsigned_integer import MaximumValidationWithUnsignedInteger -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = MaximumValidationWithUnsignedInteger(None) - try: - api_response = api_instance.post_maximum_validation_with_unsigned_integer_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_maximum_validation_with_unsigned_integer_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MaximumValidationWithUnsignedInteger**](../../models/MaximumValidationWithUnsignedInteger.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_maximum_validation_with_unsigned_integer_request_body.ApiResponseFor200) | success - -#### post_maximum_validation_with_unsigned_integer_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_maximum_validation_with_unsigned_integer_response_body_for_content_types** - -> MaximumValidationWithUnsignedInteger post_maximum_validation_with_unsigned_integer_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.maximum_validation_with_unsigned_integer import MaximumValidationWithUnsignedInteger -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_maximum_validation_with_unsigned_integer_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_maximum_validation_with_unsigned_integer_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_maximum_validation_with_unsigned_integer_response_body_for_content_types.ApiResponseFor200) | success - -#### post_maximum_validation_with_unsigned_integer_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MaximumValidationWithUnsignedInteger**](../../models/MaximumValidationWithUnsignedInteger.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_maxitems_validation_request_body** - -> post_maxitems_validation_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.maxitems_validation import MaxitemsValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = MaxitemsValidation(None) - try: - api_response = api_instance.post_maxitems_validation_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_maxitems_validation_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MaxitemsValidation**](../../models/MaxitemsValidation.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_maxitems_validation_request_body.ApiResponseFor200) | success - -#### post_maxitems_validation_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_maxitems_validation_response_body_for_content_types** - -> MaxitemsValidation post_maxitems_validation_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.maxitems_validation import MaxitemsValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_maxitems_validation_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_maxitems_validation_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_maxitems_validation_response_body_for_content_types.ApiResponseFor200) | success - -#### post_maxitems_validation_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MaxitemsValidation**](../../models/MaxitemsValidation.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_maxlength_validation_request_body** - -> post_maxlength_validation_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.maxlength_validation import MaxlengthValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = MaxlengthValidation(None) - try: - api_response = api_instance.post_maxlength_validation_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_maxlength_validation_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MaxlengthValidation**](../../models/MaxlengthValidation.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_maxlength_validation_request_body.ApiResponseFor200) | success - -#### post_maxlength_validation_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_maxlength_validation_response_body_for_content_types** - -> MaxlengthValidation post_maxlength_validation_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.maxlength_validation import MaxlengthValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_maxlength_validation_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_maxlength_validation_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_maxlength_validation_response_body_for_content_types.ApiResponseFor200) | success - -#### post_maxlength_validation_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MaxlengthValidation**](../../models/MaxlengthValidation.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_maxproperties0_means_the_object_is_empty_request_body** - -> post_maxproperties0_means_the_object_is_empty_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.maxproperties0_means_the_object_is_empty import Maxproperties0MeansTheObjectIsEmpty -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = Maxproperties0MeansTheObjectIsEmpty(None) - try: - api_response = api_instance.post_maxproperties0_means_the_object_is_empty_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_maxproperties0_means_the_object_is_empty_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**Maxproperties0MeansTheObjectIsEmpty**](../../models/Maxproperties0MeansTheObjectIsEmpty.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_maxproperties0_means_the_object_is_empty_request_body.ApiResponseFor200) | success - -#### post_maxproperties0_means_the_object_is_empty_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_maxproperties0_means_the_object_is_empty_response_body_for_content_types** - -> Maxproperties0MeansTheObjectIsEmpty post_maxproperties0_means_the_object_is_empty_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.maxproperties0_means_the_object_is_empty import Maxproperties0MeansTheObjectIsEmpty -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_maxproperties0_means_the_object_is_empty_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_maxproperties0_means_the_object_is_empty_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_maxproperties0_means_the_object_is_empty_response_body_for_content_types.ApiResponseFor200) | success - -#### post_maxproperties0_means_the_object_is_empty_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**Maxproperties0MeansTheObjectIsEmpty**](../../models/Maxproperties0MeansTheObjectIsEmpty.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_maxproperties_validation_request_body** - -> post_maxproperties_validation_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.maxproperties_validation import MaxpropertiesValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = MaxpropertiesValidation(None) - try: - api_response = api_instance.post_maxproperties_validation_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_maxproperties_validation_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MaxpropertiesValidation**](../../models/MaxpropertiesValidation.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_maxproperties_validation_request_body.ApiResponseFor200) | success - -#### post_maxproperties_validation_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_maxproperties_validation_response_body_for_content_types** - -> MaxpropertiesValidation post_maxproperties_validation_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.maxproperties_validation import MaxpropertiesValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_maxproperties_validation_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_maxproperties_validation_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_maxproperties_validation_response_body_for_content_types.ApiResponseFor200) | success - -#### post_maxproperties_validation_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MaxpropertiesValidation**](../../models/MaxpropertiesValidation.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_minimum_validation_request_body** - -> post_minimum_validation_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.minimum_validation import MinimumValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = MinimumValidation(None) - try: - api_response = api_instance.post_minimum_validation_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_minimum_validation_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MinimumValidation**](../../models/MinimumValidation.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_minimum_validation_request_body.ApiResponseFor200) | success - -#### post_minimum_validation_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_minimum_validation_response_body_for_content_types** - -> MinimumValidation post_minimum_validation_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.minimum_validation import MinimumValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_minimum_validation_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_minimum_validation_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_minimum_validation_response_body_for_content_types.ApiResponseFor200) | success - -#### post_minimum_validation_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MinimumValidation**](../../models/MinimumValidation.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_minimum_validation_with_signed_integer_request_body** - -> post_minimum_validation_with_signed_integer_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.minimum_validation_with_signed_integer import MinimumValidationWithSignedInteger -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = MinimumValidationWithSignedInteger(None) - try: - api_response = api_instance.post_minimum_validation_with_signed_integer_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_minimum_validation_with_signed_integer_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MinimumValidationWithSignedInteger**](../../models/MinimumValidationWithSignedInteger.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_minimum_validation_with_signed_integer_request_body.ApiResponseFor200) | success - -#### post_minimum_validation_with_signed_integer_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_minimum_validation_with_signed_integer_response_body_for_content_types** - -> MinimumValidationWithSignedInteger post_minimum_validation_with_signed_integer_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.minimum_validation_with_signed_integer import MinimumValidationWithSignedInteger -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_minimum_validation_with_signed_integer_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_minimum_validation_with_signed_integer_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_minimum_validation_with_signed_integer_response_body_for_content_types.ApiResponseFor200) | success - -#### post_minimum_validation_with_signed_integer_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MinimumValidationWithSignedInteger**](../../models/MinimumValidationWithSignedInteger.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_minitems_validation_request_body** - -> post_minitems_validation_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.minitems_validation import MinitemsValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = MinitemsValidation(None) - try: - api_response = api_instance.post_minitems_validation_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_minitems_validation_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MinitemsValidation**](../../models/MinitemsValidation.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_minitems_validation_request_body.ApiResponseFor200) | success - -#### post_minitems_validation_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_minitems_validation_response_body_for_content_types** - -> MinitemsValidation post_minitems_validation_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.minitems_validation import MinitemsValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_minitems_validation_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_minitems_validation_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_minitems_validation_response_body_for_content_types.ApiResponseFor200) | success - -#### post_minitems_validation_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MinitemsValidation**](../../models/MinitemsValidation.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_minlength_validation_request_body** - -> post_minlength_validation_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.minlength_validation import MinlengthValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = MinlengthValidation(None) - try: - api_response = api_instance.post_minlength_validation_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_minlength_validation_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MinlengthValidation**](../../models/MinlengthValidation.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_minlength_validation_request_body.ApiResponseFor200) | success - -#### post_minlength_validation_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_minlength_validation_response_body_for_content_types** - -> MinlengthValidation post_minlength_validation_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.minlength_validation import MinlengthValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_minlength_validation_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_minlength_validation_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_minlength_validation_response_body_for_content_types.ApiResponseFor200) | success - -#### post_minlength_validation_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MinlengthValidation**](../../models/MinlengthValidation.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_minproperties_validation_request_body** - -> post_minproperties_validation_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.minproperties_validation import MinpropertiesValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = MinpropertiesValidation(None) - try: - api_response = api_instance.post_minproperties_validation_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_minproperties_validation_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MinpropertiesValidation**](../../models/MinpropertiesValidation.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_minproperties_validation_request_body.ApiResponseFor200) | success - -#### post_minproperties_validation_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_minproperties_validation_response_body_for_content_types** - -> MinpropertiesValidation post_minproperties_validation_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.minproperties_validation import MinpropertiesValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_minproperties_validation_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_minproperties_validation_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_minproperties_validation_response_body_for_content_types.ApiResponseFor200) | success - -#### post_minproperties_validation_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MinpropertiesValidation**](../../models/MinpropertiesValidation.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_nested_allof_to_check_validation_semantics_request_body** - -> post_nested_allof_to_check_validation_semantics_request_body(nested_allof_to_check_validation_semantics) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.nested_allof_to_check_validation_semantics import NestedAllofToCheckValidationSemantics -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = NestedAllofToCheckValidationSemantics(None) - try: - api_response = api_instance.post_nested_allof_to_check_validation_semantics_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_nested_allof_to_check_validation_semantics_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**NestedAllofToCheckValidationSemantics**](../../models/NestedAllofToCheckValidationSemantics.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_nested_allof_to_check_validation_semantics_request_body.ApiResponseFor200) | success - -#### post_nested_allof_to_check_validation_semantics_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_nested_allof_to_check_validation_semantics_response_body_for_content_types** - -> NestedAllofToCheckValidationSemantics post_nested_allof_to_check_validation_semantics_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.nested_allof_to_check_validation_semantics import NestedAllofToCheckValidationSemantics -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_nested_allof_to_check_validation_semantics_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_nested_allof_to_check_validation_semantics_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_nested_allof_to_check_validation_semantics_response_body_for_content_types.ApiResponseFor200) | success - -#### post_nested_allof_to_check_validation_semantics_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**NestedAllofToCheckValidationSemantics**](../../models/NestedAllofToCheckValidationSemantics.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_nested_anyof_to_check_validation_semantics_request_body** - -> post_nested_anyof_to_check_validation_semantics_request_body(nested_anyof_to_check_validation_semantics) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.nested_anyof_to_check_validation_semantics import NestedAnyofToCheckValidationSemantics -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = NestedAnyofToCheckValidationSemantics(None) - try: - api_response = api_instance.post_nested_anyof_to_check_validation_semantics_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_nested_anyof_to_check_validation_semantics_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**NestedAnyofToCheckValidationSemantics**](../../models/NestedAnyofToCheckValidationSemantics.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_nested_anyof_to_check_validation_semantics_request_body.ApiResponseFor200) | success - -#### post_nested_anyof_to_check_validation_semantics_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_nested_anyof_to_check_validation_semantics_response_body_for_content_types** - -> NestedAnyofToCheckValidationSemantics post_nested_anyof_to_check_validation_semantics_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.nested_anyof_to_check_validation_semantics import NestedAnyofToCheckValidationSemantics -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_nested_anyof_to_check_validation_semantics_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_nested_anyof_to_check_validation_semantics_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_nested_anyof_to_check_validation_semantics_response_body_for_content_types.ApiResponseFor200) | success - -#### post_nested_anyof_to_check_validation_semantics_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**NestedAnyofToCheckValidationSemantics**](../../models/NestedAnyofToCheckValidationSemantics.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_nested_items_request_body** - -> post_nested_items_request_body(nested_items) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.nested_items import NestedItems -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = NestedItems([ - [ - [ - [ - 3.14 - ] - ] - ] - ]) - try: - api_response = api_instance.post_nested_items_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_nested_items_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**NestedItems**](../../models/NestedItems.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_nested_items_request_body.ApiResponseFor200) | success - -#### post_nested_items_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_nested_items_response_body_for_content_types** - -> NestedItems post_nested_items_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.nested_items import NestedItems -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_nested_items_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_nested_items_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_nested_items_response_body_for_content_types.ApiResponseFor200) | success - -#### post_nested_items_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**NestedItems**](../../models/NestedItems.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_nested_oneof_to_check_validation_semantics_request_body** - -> post_nested_oneof_to_check_validation_semantics_request_body(nested_oneof_to_check_validation_semantics) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.nested_oneof_to_check_validation_semantics import NestedOneofToCheckValidationSemantics -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = NestedOneofToCheckValidationSemantics(None) - try: - api_response = api_instance.post_nested_oneof_to_check_validation_semantics_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_nested_oneof_to_check_validation_semantics_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**NestedOneofToCheckValidationSemantics**](../../models/NestedOneofToCheckValidationSemantics.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_nested_oneof_to_check_validation_semantics_request_body.ApiResponseFor200) | success - -#### post_nested_oneof_to_check_validation_semantics_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_nested_oneof_to_check_validation_semantics_response_body_for_content_types** - -> NestedOneofToCheckValidationSemantics post_nested_oneof_to_check_validation_semantics_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.nested_oneof_to_check_validation_semantics import NestedOneofToCheckValidationSemantics -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_nested_oneof_to_check_validation_semantics_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_nested_oneof_to_check_validation_semantics_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_nested_oneof_to_check_validation_semantics_response_body_for_content_types.ApiResponseFor200) | success - -#### post_nested_oneof_to_check_validation_semantics_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**NestedOneofToCheckValidationSemantics**](../../models/NestedOneofToCheckValidationSemantics.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_not_more_complex_schema_request_body** - -> post_not_more_complex_schema_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = None - try: - api_response = api_instance.post_not_more_complex_schema_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_not_more_complex_schema_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### not -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[not_schema](#not_schema) | dict, frozendict.frozendict, | frozendict.frozendict, | | - -# not_schema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**foo** | str, | str, | | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_not_more_complex_schema_request_body.ApiResponseFor200) | success - -#### post_not_more_complex_schema_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_not_more_complex_schema_response_body_for_content_types** - -> bool, date, datetime, dict, float, int, list, str, none_type post_not_more_complex_schema_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_not_more_complex_schema_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_not_more_complex_schema_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_not_more_complex_schema_response_body_for_content_types.ApiResponseFor200) | success - -#### post_not_more_complex_schema_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### not -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[not_schema](#not_schema) | dict, frozendict.frozendict, | frozendict.frozendict, | | - -# not_schema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**foo** | str, | str, | | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_not_request_body** - -> post_not_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = None - try: - api_response = api_instance.post_not_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_not_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### not -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[not_schema](#not_schema) | decimal.Decimal, int, | decimal.Decimal, | | - -# not_schema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -decimal.Decimal, int, | decimal.Decimal, | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_not_request_body.ApiResponseFor200) | success - -#### post_not_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_not_response_body_for_content_types** - -> bool, date, datetime, dict, float, int, list, str, none_type post_not_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_not_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_not_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_not_response_body_for_content_types.ApiResponseFor200) | success - -#### post_not_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### not -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[not_schema](#not_schema) | decimal.Decimal, int, | decimal.Decimal, | | - -# not_schema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -decimal.Decimal, int, | decimal.Decimal, | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_nul_characters_in_strings_request_body** - -> post_nul_characters_in_strings_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.nul_characters_in_strings import NulCharactersInStrings -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = NulCharactersInStrings("hello\x00there") - try: - api_response = api_instance.post_nul_characters_in_strings_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_nul_characters_in_strings_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**NulCharactersInStrings**](../../models/NulCharactersInStrings.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_nul_characters_in_strings_request_body.ApiResponseFor200) | success - -#### post_nul_characters_in_strings_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_nul_characters_in_strings_response_body_for_content_types** - -> NulCharactersInStrings post_nul_characters_in_strings_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.nul_characters_in_strings import NulCharactersInStrings -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_nul_characters_in_strings_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_nul_characters_in_strings_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_nul_characters_in_strings_response_body_for_content_types.ApiResponseFor200) | success - -#### post_nul_characters_in_strings_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**NulCharactersInStrings**](../../models/NulCharactersInStrings.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_null_type_matches_only_the_null_object_request_body** - -> post_null_type_matches_only_the_null_object_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = None - try: - api_response = api_instance.post_null_type_matches_only_the_null_object_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_null_type_matches_only_the_null_object_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -None, | NoneClass, | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_null_type_matches_only_the_null_object_request_body.ApiResponseFor200) | success - -#### post_null_type_matches_only_the_null_object_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_null_type_matches_only_the_null_object_response_body_for_content_types** - -> none_type post_null_type_matches_only_the_null_object_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_null_type_matches_only_the_null_object_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_null_type_matches_only_the_null_object_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_null_type_matches_only_the_null_object_response_body_for_content_types.ApiResponseFor200) | success - -#### post_null_type_matches_only_the_null_object_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -None, | NoneClass, | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_number_type_matches_numbers_request_body** - -> post_number_type_matches_numbers_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = 3.14 - try: - api_response = api_instance.post_number_type_matches_numbers_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_number_type_matches_numbers_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -decimal.Decimal, int, float, | decimal.Decimal, | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_number_type_matches_numbers_request_body.ApiResponseFor200) | success - -#### post_number_type_matches_numbers_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_number_type_matches_numbers_response_body_for_content_types** - -> int, float post_number_type_matches_numbers_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_number_type_matches_numbers_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_number_type_matches_numbers_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_number_type_matches_numbers_response_body_for_content_types.ApiResponseFor200) | success - -#### post_number_type_matches_numbers_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -decimal.Decimal, int, float, | decimal.Decimal, | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_object_properties_validation_request_body** - -> post_object_properties_validation_request_body(object_properties_validation) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.object_properties_validation import ObjectPropertiesValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = ObjectPropertiesValidation(None) - try: - api_response = api_instance.post_object_properties_validation_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_object_properties_validation_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**ObjectPropertiesValidation**](../../models/ObjectPropertiesValidation.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_object_properties_validation_request_body.ApiResponseFor200) | success - -#### post_object_properties_validation_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_object_properties_validation_response_body_for_content_types** - -> ObjectPropertiesValidation post_object_properties_validation_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.object_properties_validation import ObjectPropertiesValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_object_properties_validation_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_object_properties_validation_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_object_properties_validation_response_body_for_content_types.ApiResponseFor200) | success - -#### post_object_properties_validation_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**ObjectPropertiesValidation**](../../models/ObjectPropertiesValidation.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_object_type_matches_objects_request_body** - -> post_object_type_matches_objects_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = dict() - try: - api_response = api_instance.post_object_type_matches_objects_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_object_type_matches_objects_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_object_type_matches_objects_request_body.ApiResponseFor200) | success - -#### post_object_type_matches_objects_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_object_type_matches_objects_response_body_for_content_types** - -> {str: (bool, date, datetime, dict, float, int, list, str, none_type)} post_object_type_matches_objects_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_object_type_matches_objects_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_object_type_matches_objects_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_object_type_matches_objects_response_body_for_content_types.ApiResponseFor200) | success - -#### post_object_type_matches_objects_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_oneof_complex_types_request_body** - -> post_oneof_complex_types_request_body(oneof_complex_types) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.oneof_complex_types import OneofComplexTypes -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = OneofComplexTypes(None) - try: - api_response = api_instance.post_oneof_complex_types_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_oneof_complex_types_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**OneofComplexTypes**](../../models/OneofComplexTypes.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_oneof_complex_types_request_body.ApiResponseFor200) | success - -#### post_oneof_complex_types_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_oneof_complex_types_response_body_for_content_types** - -> OneofComplexTypes post_oneof_complex_types_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.oneof_complex_types import OneofComplexTypes -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_oneof_complex_types_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_oneof_complex_types_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_oneof_complex_types_response_body_for_content_types.ApiResponseFor200) | success - -#### post_oneof_complex_types_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**OneofComplexTypes**](../../models/OneofComplexTypes.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_oneof_request_body** - -> post_oneof_request_body(oneof) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.oneof import Oneof -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = Oneof(None) - try: - api_response = api_instance.post_oneof_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_oneof_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**Oneof**](../../models/Oneof.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_oneof_request_body.ApiResponseFor200) | success - -#### post_oneof_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_oneof_response_body_for_content_types** - -> Oneof post_oneof_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.oneof import Oneof -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_oneof_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_oneof_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_oneof_response_body_for_content_types.ApiResponseFor200) | success - -#### post_oneof_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**Oneof**](../../models/Oneof.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_oneof_with_base_schema_request_body** - -> post_oneof_with_base_schema_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.oneof_with_base_schema import OneofWithBaseSchema -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = OneofWithBaseSchema("body_example") - try: - api_response = api_instance.post_oneof_with_base_schema_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_oneof_with_base_schema_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**OneofWithBaseSchema**](../../models/OneofWithBaseSchema.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_oneof_with_base_schema_request_body.ApiResponseFor200) | success - -#### post_oneof_with_base_schema_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_oneof_with_base_schema_response_body_for_content_types** - -> OneofWithBaseSchema post_oneof_with_base_schema_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.oneof_with_base_schema import OneofWithBaseSchema -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_oneof_with_base_schema_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_oneof_with_base_schema_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_oneof_with_base_schema_response_body_for_content_types.ApiResponseFor200) | success - -#### post_oneof_with_base_schema_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**OneofWithBaseSchema**](../../models/OneofWithBaseSchema.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_oneof_with_empty_schema_request_body** - -> post_oneof_with_empty_schema_request_body(oneof_with_empty_schema) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.oneof_with_empty_schema import OneofWithEmptySchema -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = OneofWithEmptySchema(None) - try: - api_response = api_instance.post_oneof_with_empty_schema_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_oneof_with_empty_schema_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**OneofWithEmptySchema**](../../models/OneofWithEmptySchema.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_oneof_with_empty_schema_request_body.ApiResponseFor200) | success - -#### post_oneof_with_empty_schema_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_oneof_with_empty_schema_response_body_for_content_types** - -> OneofWithEmptySchema post_oneof_with_empty_schema_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.oneof_with_empty_schema import OneofWithEmptySchema -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_oneof_with_empty_schema_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_oneof_with_empty_schema_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_oneof_with_empty_schema_response_body_for_content_types.ApiResponseFor200) | success - -#### post_oneof_with_empty_schema_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**OneofWithEmptySchema**](../../models/OneofWithEmptySchema.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_oneof_with_required_request_body** - -> post_oneof_with_required_request_body(oneof_with_required) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.oneof_with_required import OneofWithRequired -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = OneofWithRequired() - try: - api_response = api_instance.post_oneof_with_required_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_oneof_with_required_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**OneofWithRequired**](../../models/OneofWithRequired.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_oneof_with_required_request_body.ApiResponseFor200) | success - -#### post_oneof_with_required_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_oneof_with_required_response_body_for_content_types** - -> OneofWithRequired post_oneof_with_required_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.oneof_with_required import OneofWithRequired -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_oneof_with_required_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_oneof_with_required_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_oneof_with_required_response_body_for_content_types.ApiResponseFor200) | success - -#### post_oneof_with_required_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**OneofWithRequired**](../../models/OneofWithRequired.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_pattern_is_not_anchored_request_body** - -> post_pattern_is_not_anchored_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.pattern_is_not_anchored import PatternIsNotAnchored -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = PatternIsNotAnchored(None) - try: - api_response = api_instance.post_pattern_is_not_anchored_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_pattern_is_not_anchored_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**PatternIsNotAnchored**](../../models/PatternIsNotAnchored.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_pattern_is_not_anchored_request_body.ApiResponseFor200) | success - -#### post_pattern_is_not_anchored_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_pattern_is_not_anchored_response_body_for_content_types** - -> PatternIsNotAnchored post_pattern_is_not_anchored_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.pattern_is_not_anchored import PatternIsNotAnchored -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_pattern_is_not_anchored_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_pattern_is_not_anchored_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_pattern_is_not_anchored_response_body_for_content_types.ApiResponseFor200) | success - -#### post_pattern_is_not_anchored_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**PatternIsNotAnchored**](../../models/PatternIsNotAnchored.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_pattern_validation_request_body** - -> post_pattern_validation_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.pattern_validation import PatternValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = PatternValidation(None) - try: - api_response = api_instance.post_pattern_validation_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_pattern_validation_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**PatternValidation**](../../models/PatternValidation.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_pattern_validation_request_body.ApiResponseFor200) | success - -#### post_pattern_validation_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_pattern_validation_response_body_for_content_types** - -> PatternValidation post_pattern_validation_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.pattern_validation import PatternValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_pattern_validation_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_pattern_validation_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_pattern_validation_response_body_for_content_types.ApiResponseFor200) | success - -#### post_pattern_validation_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**PatternValidation**](../../models/PatternValidation.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_properties_with_escaped_characters_request_body** - -> post_properties_with_escaped_characters_request_body(properties_with_escaped_characters) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.properties_with_escaped_characters import PropertiesWithEscapedCharacters -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = PropertiesWithEscapedCharacters(None) - try: - api_response = api_instance.post_properties_with_escaped_characters_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_properties_with_escaped_characters_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**PropertiesWithEscapedCharacters**](../../models/PropertiesWithEscapedCharacters.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_properties_with_escaped_characters_request_body.ApiResponseFor200) | success - -#### post_properties_with_escaped_characters_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_properties_with_escaped_characters_response_body_for_content_types** - -> PropertiesWithEscapedCharacters post_properties_with_escaped_characters_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.properties_with_escaped_characters import PropertiesWithEscapedCharacters -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_properties_with_escaped_characters_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_properties_with_escaped_characters_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_properties_with_escaped_characters_response_body_for_content_types.ApiResponseFor200) | success - -#### post_properties_with_escaped_characters_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**PropertiesWithEscapedCharacters**](../../models/PropertiesWithEscapedCharacters.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_property_named_ref_that_is_not_a_reference_request_body** - -> post_property_named_ref_that_is_not_a_reference_request_body(property_named_ref_that_is_not_a_reference) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.property_named_ref_that_is_not_a_reference import PropertyNamedRefThatIsNotAReference -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = PropertyNamedRefThatIsNotAReference(None) - try: - api_response = api_instance.post_property_named_ref_that_is_not_a_reference_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_property_named_ref_that_is_not_a_reference_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**PropertyNamedRefThatIsNotAReference**](../../models/PropertyNamedRefThatIsNotAReference.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_property_named_ref_that_is_not_a_reference_request_body.ApiResponseFor200) | success - -#### post_property_named_ref_that_is_not_a_reference_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_property_named_ref_that_is_not_a_reference_response_body_for_content_types** - -> PropertyNamedRefThatIsNotAReference post_property_named_ref_that_is_not_a_reference_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.property_named_ref_that_is_not_a_reference import PropertyNamedRefThatIsNotAReference -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_property_named_ref_that_is_not_a_reference_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_property_named_ref_that_is_not_a_reference_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_property_named_ref_that_is_not_a_reference_response_body_for_content_types.ApiResponseFor200) | success - -#### post_property_named_ref_that_is_not_a_reference_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**PropertyNamedRefThatIsNotAReference**](../../models/PropertyNamedRefThatIsNotAReference.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ref_in_additionalproperties_request_body** - -> post_ref_in_additionalproperties_request_body(ref_in_additionalproperties) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.ref_in_additionalproperties import RefInAdditionalproperties -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = RefInAdditionalproperties( - key=PropertyNamedRefThatIsNotAReference(None), - ) - try: - api_response = api_instance.post_ref_in_additionalproperties_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_ref_in_additionalproperties_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RefInAdditionalproperties**](../../models/RefInAdditionalproperties.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ref_in_additionalproperties_request_body.ApiResponseFor200) | success - -#### post_ref_in_additionalproperties_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ref_in_additionalproperties_response_body_for_content_types** - -> RefInAdditionalproperties post_ref_in_additionalproperties_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.ref_in_additionalproperties import RefInAdditionalproperties -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_ref_in_additionalproperties_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_ref_in_additionalproperties_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ref_in_additionalproperties_response_body_for_content_types.ApiResponseFor200) | success - -#### post_ref_in_additionalproperties_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RefInAdditionalproperties**](../../models/RefInAdditionalproperties.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ref_in_allof_request_body** - -> post_ref_in_allof_request_body(ref_in_allof) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.ref_in_allof import RefInAllof -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = RefInAllof(None) - try: - api_response = api_instance.post_ref_in_allof_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_ref_in_allof_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RefInAllof**](../../models/RefInAllof.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ref_in_allof_request_body.ApiResponseFor200) | success - -#### post_ref_in_allof_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ref_in_allof_response_body_for_content_types** - -> RefInAllof post_ref_in_allof_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.ref_in_allof import RefInAllof -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_ref_in_allof_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_ref_in_allof_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ref_in_allof_response_body_for_content_types.ApiResponseFor200) | success - -#### post_ref_in_allof_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RefInAllof**](../../models/RefInAllof.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ref_in_anyof_request_body** - -> post_ref_in_anyof_request_body(ref_in_anyof) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.ref_in_anyof import RefInAnyof -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = RefInAnyof(None) - try: - api_response = api_instance.post_ref_in_anyof_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_ref_in_anyof_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RefInAnyof**](../../models/RefInAnyof.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ref_in_anyof_request_body.ApiResponseFor200) | success - -#### post_ref_in_anyof_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ref_in_anyof_response_body_for_content_types** - -> RefInAnyof post_ref_in_anyof_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.ref_in_anyof import RefInAnyof -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_ref_in_anyof_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_ref_in_anyof_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ref_in_anyof_response_body_for_content_types.ApiResponseFor200) | success - -#### post_ref_in_anyof_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RefInAnyof**](../../models/RefInAnyof.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ref_in_items_request_body** - -> post_ref_in_items_request_body(ref_in_items) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.ref_in_items import RefInItems -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = RefInItems([ - PropertyNamedRefThatIsNotAReference(None) - ]) - try: - api_response = api_instance.post_ref_in_items_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_ref_in_items_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RefInItems**](../../models/RefInItems.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ref_in_items_request_body.ApiResponseFor200) | success - -#### post_ref_in_items_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ref_in_items_response_body_for_content_types** - -> RefInItems post_ref_in_items_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.ref_in_items import RefInItems -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_ref_in_items_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_ref_in_items_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ref_in_items_response_body_for_content_types.ApiResponseFor200) | success - -#### post_ref_in_items_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RefInItems**](../../models/RefInItems.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ref_in_not_request_body** - -> post_ref_in_not_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.property_named_ref_that_is_not_a_reference import PropertyNamedRefThatIsNotAReference -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = None - try: - api_response = api_instance.post_ref_in_not_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_ref_in_not_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### not -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[PropertyNamedRefThatIsNotAReference]({{complexTypePrefix}}PropertyNamedRefThatIsNotAReference.md) | [**PropertyNamedRefThatIsNotAReference**]({{complexTypePrefix}}PropertyNamedRefThatIsNotAReference.md) | [**PropertyNamedRefThatIsNotAReference**]({{complexTypePrefix}}PropertyNamedRefThatIsNotAReference.md) | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ref_in_not_request_body.ApiResponseFor200) | success - -#### post_ref_in_not_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ref_in_not_response_body_for_content_types** - -> bool, date, datetime, dict, float, int, list, str, none_type post_ref_in_not_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.property_named_ref_that_is_not_a_reference import PropertyNamedRefThatIsNotAReference -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_ref_in_not_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_ref_in_not_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ref_in_not_response_body_for_content_types.ApiResponseFor200) | success - -#### post_ref_in_not_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### not -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[PropertyNamedRefThatIsNotAReference]({{complexTypePrefix}}PropertyNamedRefThatIsNotAReference.md) | [**PropertyNamedRefThatIsNotAReference**]({{complexTypePrefix}}PropertyNamedRefThatIsNotAReference.md) | [**PropertyNamedRefThatIsNotAReference**]({{complexTypePrefix}}PropertyNamedRefThatIsNotAReference.md) | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ref_in_oneof_request_body** - -> post_ref_in_oneof_request_body(ref_in_oneof) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.ref_in_oneof import RefInOneof -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = RefInOneof(None) - try: - api_response = api_instance.post_ref_in_oneof_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_ref_in_oneof_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RefInOneof**](../../models/RefInOneof.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ref_in_oneof_request_body.ApiResponseFor200) | success - -#### post_ref_in_oneof_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ref_in_oneof_response_body_for_content_types** - -> RefInOneof post_ref_in_oneof_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.ref_in_oneof import RefInOneof -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_ref_in_oneof_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_ref_in_oneof_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ref_in_oneof_response_body_for_content_types.ApiResponseFor200) | success - -#### post_ref_in_oneof_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RefInOneof**](../../models/RefInOneof.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ref_in_property_request_body** - -> post_ref_in_property_request_body(ref_in_property) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.ref_in_property import RefInProperty -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = RefInProperty(None) - try: - api_response = api_instance.post_ref_in_property_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_ref_in_property_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RefInProperty**](../../models/RefInProperty.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ref_in_property_request_body.ApiResponseFor200) | success - -#### post_ref_in_property_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ref_in_property_response_body_for_content_types** - -> RefInProperty post_ref_in_property_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.ref_in_property import RefInProperty -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_ref_in_property_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_ref_in_property_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ref_in_property_response_body_for_content_types.ApiResponseFor200) | success - -#### post_ref_in_property_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RefInProperty**](../../models/RefInProperty.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_required_default_validation_request_body** - -> post_required_default_validation_request_body(required_default_validation) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.required_default_validation import RequiredDefaultValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = RequiredDefaultValidation(None) - try: - api_response = api_instance.post_required_default_validation_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_required_default_validation_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RequiredDefaultValidation**](../../models/RequiredDefaultValidation.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_required_default_validation_request_body.ApiResponseFor200) | success - -#### post_required_default_validation_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_required_default_validation_response_body_for_content_types** - -> RequiredDefaultValidation post_required_default_validation_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.required_default_validation import RequiredDefaultValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_required_default_validation_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_required_default_validation_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_required_default_validation_response_body_for_content_types.ApiResponseFor200) | success - -#### post_required_default_validation_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RequiredDefaultValidation**](../../models/RequiredDefaultValidation.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_required_validation_request_body** - -> post_required_validation_request_body(required_validation) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.required_validation import RequiredValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = RequiredValidation(None) - try: - api_response = api_instance.post_required_validation_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_required_validation_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RequiredValidation**](../../models/RequiredValidation.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_required_validation_request_body.ApiResponseFor200) | success - -#### post_required_validation_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_required_validation_response_body_for_content_types** - -> RequiredValidation post_required_validation_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.required_validation import RequiredValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_required_validation_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_required_validation_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_required_validation_response_body_for_content_types.ApiResponseFor200) | success - -#### post_required_validation_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RequiredValidation**](../../models/RequiredValidation.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_required_with_empty_array_request_body** - -> post_required_with_empty_array_request_body(required_with_empty_array) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.required_with_empty_array import RequiredWithEmptyArray -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = RequiredWithEmptyArray(None) - try: - api_response = api_instance.post_required_with_empty_array_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_required_with_empty_array_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RequiredWithEmptyArray**](../../models/RequiredWithEmptyArray.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_required_with_empty_array_request_body.ApiResponseFor200) | success - -#### post_required_with_empty_array_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_required_with_empty_array_response_body_for_content_types** - -> RequiredWithEmptyArray post_required_with_empty_array_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.required_with_empty_array import RequiredWithEmptyArray -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_required_with_empty_array_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_required_with_empty_array_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_required_with_empty_array_response_body_for_content_types.ApiResponseFor200) | success - -#### post_required_with_empty_array_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RequiredWithEmptyArray**](../../models/RequiredWithEmptyArray.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_required_with_escaped_characters_request_body** - -> post_required_with_escaped_characters_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = None - try: - api_response = api_instance.post_required_with_escaped_characters_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_required_with_escaped_characters_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_required_with_escaped_characters_request_body.ApiResponseFor200) | success - -#### post_required_with_escaped_characters_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_required_with_escaped_characters_response_body_for_content_types** - -> bool, date, datetime, dict, float, int, list, str, none_type post_required_with_escaped_characters_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_required_with_escaped_characters_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_required_with_escaped_characters_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_required_with_escaped_characters_response_body_for_content_types.ApiResponseFor200) | success - -#### post_required_with_escaped_characters_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_simple_enum_validation_request_body** - -> post_simple_enum_validation_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.simple_enum_validation import SimpleEnumValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = SimpleEnumValidation(1) - try: - api_response = api_instance.post_simple_enum_validation_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_simple_enum_validation_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**SimpleEnumValidation**](../../models/SimpleEnumValidation.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_simple_enum_validation_request_body.ApiResponseFor200) | success - -#### post_simple_enum_validation_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_simple_enum_validation_response_body_for_content_types** - -> SimpleEnumValidation post_simple_enum_validation_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.simple_enum_validation import SimpleEnumValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_simple_enum_validation_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_simple_enum_validation_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_simple_enum_validation_response_body_for_content_types.ApiResponseFor200) | success - -#### post_simple_enum_validation_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**SimpleEnumValidation**](../../models/SimpleEnumValidation.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_string_type_matches_strings_request_body** - -> post_string_type_matches_strings_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = "body_example" - try: - api_response = api_instance.post_string_type_matches_strings_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_string_type_matches_strings_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_string_type_matches_strings_request_body.ApiResponseFor200) | success - -#### post_string_type_matches_strings_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_string_type_matches_strings_response_body_for_content_types** - -> str post_string_type_matches_strings_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_string_type_matches_strings_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_string_type_matches_strings_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_string_type_matches_strings_response_body_for_content_types.ApiResponseFor200) | success - -#### post_string_type_matches_strings_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body** - -> post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body(the_default_keyword_does_not_do_anything_if_the_property_is_missing) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.the_default_keyword_does_not_do_anything_if_the_property_is_missing import TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing( - alpha=5, - ) - try: - api_response = api_instance.post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing**](../../models/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.ApiResponseFor200) | success - -#### post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types** - -> TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.the_default_keyword_does_not_do_anything_if_the_property_is_missing import TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types.ApiResponseFor200) | success - -#### post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing**](../../models/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_uniqueitems_false_validation_request_body** - -> post_uniqueitems_false_validation_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.uniqueitems_false_validation import UniqueitemsFalseValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = UniqueitemsFalseValidation(None) - try: - api_response = api_instance.post_uniqueitems_false_validation_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_uniqueitems_false_validation_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**UniqueitemsFalseValidation**](../../models/UniqueitemsFalseValidation.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_uniqueitems_false_validation_request_body.ApiResponseFor200) | success - -#### post_uniqueitems_false_validation_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_uniqueitems_false_validation_response_body_for_content_types** - -> UniqueitemsFalseValidation post_uniqueitems_false_validation_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.uniqueitems_false_validation import UniqueitemsFalseValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_uniqueitems_false_validation_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_uniqueitems_false_validation_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_uniqueitems_false_validation_response_body_for_content_types.ApiResponseFor200) | success - -#### post_uniqueitems_false_validation_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**UniqueitemsFalseValidation**](../../models/UniqueitemsFalseValidation.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_uniqueitems_validation_request_body** - -> post_uniqueitems_validation_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.uniqueitems_validation import UniqueitemsValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = UniqueitemsValidation(None) - try: - api_response = api_instance.post_uniqueitems_validation_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_uniqueitems_validation_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**UniqueitemsValidation**](../../models/UniqueitemsValidation.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_uniqueitems_validation_request_body.ApiResponseFor200) | success - -#### post_uniqueitems_validation_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_uniqueitems_validation_response_body_for_content_types** - -> UniqueitemsValidation post_uniqueitems_validation_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from unit_test_api.model.uniqueitems_validation import UniqueitemsValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_uniqueitems_validation_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_uniqueitems_validation_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_uniqueitems_validation_response_body_for_content_types.ApiResponseFor200) | success - -#### post_uniqueitems_validation_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**UniqueitemsValidation**](../../models/UniqueitemsValidation.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_uri_format_request_body** - -> post_uri_format_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = None - try: - api_response = api_instance.post_uri_format_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_uri_format_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_uri_format_request_body.ApiResponseFor200) | success - -#### post_uri_format_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_uri_format_response_body_for_content_types** - -> bool, date, datetime, dict, float, int, list, str, none_type post_uri_format_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_uri_format_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_uri_format_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_uri_format_response_body_for_content_types.ApiResponseFor200) | success - -#### post_uri_format_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_uri_reference_format_request_body** - -> post_uri_reference_format_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = None - try: - api_response = api_instance.post_uri_reference_format_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_uri_reference_format_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_uri_reference_format_request_body.ApiResponseFor200) | success - -#### post_uri_reference_format_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_uri_reference_format_response_body_for_content_types** - -> bool, date, datetime, dict, float, int, list, str, none_type post_uri_reference_format_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_uri_reference_format_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_uri_reference_format_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_uri_reference_format_response_body_for_content_types.ApiResponseFor200) | success - -#### post_uri_reference_format_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_uri_template_format_request_body** - -> post_uri_template_format_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example passing only required values which don't have defaults set - body = None - try: - api_response = api_instance.post_uri_template_format_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_uri_template_format_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_uri_template_format_request_body.ApiResponseFor200) | success - -#### post_uri_template_format_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_uri_template_format_response_body_for_content_types** - -> bool, date, datetime, dict, float, int, list, str, none_type post_uri_template_format_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import path_post_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = path_post_api.PathPostApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_uri_template_format_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PathPostApi->post_uri_template_format_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_uri_template_format_response_body_for_content_types.ApiResponseFor200) | success - -#### post_uri_template_format_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - +[**post_additionalproperties_allows_a_schema_which_should_validate_request_body**](path_post_api/post_additionalproperties_allows_a_schema_which_should_validate_request_body.md) | **post** /requestBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody | +[**post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types**](path_post_api/post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types.md) | **post** /responseBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateResponseBodyForContentTypes | +[**post_additionalproperties_are_allowed_by_default_request_body**](path_post_api/post_additionalproperties_are_allowed_by_default_request_body.md) | **post** /requestBody/postAdditionalpropertiesAreAllowedByDefaultRequestBody | +[**post_additionalproperties_are_allowed_by_default_response_body_for_content_types**](path_post_api/post_additionalproperties_are_allowed_by_default_response_body_for_content_types.md) | **post** /responseBody/postAdditionalpropertiesAreAllowedByDefaultResponseBodyForContentTypes | +[**post_additionalproperties_can_exist_by_itself_request_body**](path_post_api/post_additionalproperties_can_exist_by_itself_request_body.md) | **post** /requestBody/postAdditionalpropertiesCanExistByItselfRequestBody | +[**post_additionalproperties_can_exist_by_itself_response_body_for_content_types**](path_post_api/post_additionalproperties_can_exist_by_itself_response_body_for_content_types.md) | **post** /responseBody/postAdditionalpropertiesCanExistByItselfResponseBodyForContentTypes | +[**post_additionalproperties_should_not_look_in_applicators_request_body**](path_post_api/post_additionalproperties_should_not_look_in_applicators_request_body.md) | **post** /requestBody/postAdditionalpropertiesShouldNotLookInApplicatorsRequestBody | +[**post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types**](path_post_api/post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types.md) | **post** /responseBody/postAdditionalpropertiesShouldNotLookInApplicatorsResponseBodyForContentTypes | +[**post_allof_combined_with_anyof_oneof_request_body**](path_post_api/post_allof_combined_with_anyof_oneof_request_body.md) | **post** /requestBody/postAllofCombinedWithAnyofOneofRequestBody | +[**post_allof_combined_with_anyof_oneof_response_body_for_content_types**](path_post_api/post_allof_combined_with_anyof_oneof_response_body_for_content_types.md) | **post** /responseBody/postAllofCombinedWithAnyofOneofResponseBodyForContentTypes | +[**post_allof_request_body**](path_post_api/post_allof_request_body.md) | **post** /requestBody/postAllofRequestBody | +[**post_allof_response_body_for_content_types**](path_post_api/post_allof_response_body_for_content_types.md) | **post** /responseBody/postAllofResponseBodyForContentTypes | +[**post_allof_simple_types_request_body**](path_post_api/post_allof_simple_types_request_body.md) | **post** /requestBody/postAllofSimpleTypesRequestBody | +[**post_allof_simple_types_response_body_for_content_types**](path_post_api/post_allof_simple_types_response_body_for_content_types.md) | **post** /responseBody/postAllofSimpleTypesResponseBodyForContentTypes | +[**post_allof_with_base_schema_request_body**](path_post_api/post_allof_with_base_schema_request_body.md) | **post** /requestBody/postAllofWithBaseSchemaRequestBody | +[**post_allof_with_base_schema_response_body_for_content_types**](path_post_api/post_allof_with_base_schema_response_body_for_content_types.md) | **post** /responseBody/postAllofWithBaseSchemaResponseBodyForContentTypes | +[**post_allof_with_one_empty_schema_request_body**](path_post_api/post_allof_with_one_empty_schema_request_body.md) | **post** /requestBody/postAllofWithOneEmptySchemaRequestBody | +[**post_allof_with_one_empty_schema_response_body_for_content_types**](path_post_api/post_allof_with_one_empty_schema_response_body_for_content_types.md) | **post** /responseBody/postAllofWithOneEmptySchemaResponseBodyForContentTypes | +[**post_allof_with_the_first_empty_schema_request_body**](path_post_api/post_allof_with_the_first_empty_schema_request_body.md) | **post** /requestBody/postAllofWithTheFirstEmptySchemaRequestBody | +[**post_allof_with_the_first_empty_schema_response_body_for_content_types**](path_post_api/post_allof_with_the_first_empty_schema_response_body_for_content_types.md) | **post** /responseBody/postAllofWithTheFirstEmptySchemaResponseBodyForContentTypes | +[**post_allof_with_the_last_empty_schema_request_body**](path_post_api/post_allof_with_the_last_empty_schema_request_body.md) | **post** /requestBody/postAllofWithTheLastEmptySchemaRequestBody | +[**post_allof_with_the_last_empty_schema_response_body_for_content_types**](path_post_api/post_allof_with_the_last_empty_schema_response_body_for_content_types.md) | **post** /responseBody/postAllofWithTheLastEmptySchemaResponseBodyForContentTypes | +[**post_allof_with_two_empty_schemas_request_body**](path_post_api/post_allof_with_two_empty_schemas_request_body.md) | **post** /requestBody/postAllofWithTwoEmptySchemasRequestBody | +[**post_allof_with_two_empty_schemas_response_body_for_content_types**](path_post_api/post_allof_with_two_empty_schemas_response_body_for_content_types.md) | **post** /responseBody/postAllofWithTwoEmptySchemasResponseBodyForContentTypes | +[**post_anyof_complex_types_request_body**](path_post_api/post_anyof_complex_types_request_body.md) | **post** /requestBody/postAnyofComplexTypesRequestBody | +[**post_anyof_complex_types_response_body_for_content_types**](path_post_api/post_anyof_complex_types_response_body_for_content_types.md) | **post** /responseBody/postAnyofComplexTypesResponseBodyForContentTypes | +[**post_anyof_request_body**](path_post_api/post_anyof_request_body.md) | **post** /requestBody/postAnyofRequestBody | +[**post_anyof_response_body_for_content_types**](path_post_api/post_anyof_response_body_for_content_types.md) | **post** /responseBody/postAnyofResponseBodyForContentTypes | +[**post_anyof_with_base_schema_request_body**](path_post_api/post_anyof_with_base_schema_request_body.md) | **post** /requestBody/postAnyofWithBaseSchemaRequestBody | +[**post_anyof_with_base_schema_response_body_for_content_types**](path_post_api/post_anyof_with_base_schema_response_body_for_content_types.md) | **post** /responseBody/postAnyofWithBaseSchemaResponseBodyForContentTypes | +[**post_anyof_with_one_empty_schema_request_body**](path_post_api/post_anyof_with_one_empty_schema_request_body.md) | **post** /requestBody/postAnyofWithOneEmptySchemaRequestBody | +[**post_anyof_with_one_empty_schema_response_body_for_content_types**](path_post_api/post_anyof_with_one_empty_schema_response_body_for_content_types.md) | **post** /responseBody/postAnyofWithOneEmptySchemaResponseBodyForContentTypes | +[**post_array_type_matches_arrays_request_body**](path_post_api/post_array_type_matches_arrays_request_body.md) | **post** /requestBody/postArrayTypeMatchesArraysRequestBody | +[**post_array_type_matches_arrays_response_body_for_content_types**](path_post_api/post_array_type_matches_arrays_response_body_for_content_types.md) | **post** /responseBody/postArrayTypeMatchesArraysResponseBodyForContentTypes | +[**post_boolean_type_matches_booleans_request_body**](path_post_api/post_boolean_type_matches_booleans_request_body.md) | **post** /requestBody/postBooleanTypeMatchesBooleansRequestBody | +[**post_boolean_type_matches_booleans_response_body_for_content_types**](path_post_api/post_boolean_type_matches_booleans_response_body_for_content_types.md) | **post** /responseBody/postBooleanTypeMatchesBooleansResponseBodyForContentTypes | +[**post_by_int_request_body**](path_post_api/post_by_int_request_body.md) | **post** /requestBody/postByIntRequestBody | +[**post_by_int_response_body_for_content_types**](path_post_api/post_by_int_response_body_for_content_types.md) | **post** /responseBody/postByIntResponseBodyForContentTypes | +[**post_by_number_request_body**](path_post_api/post_by_number_request_body.md) | **post** /requestBody/postByNumberRequestBody | +[**post_by_number_response_body_for_content_types**](path_post_api/post_by_number_response_body_for_content_types.md) | **post** /responseBody/postByNumberResponseBodyForContentTypes | +[**post_by_small_number_request_body**](path_post_api/post_by_small_number_request_body.md) | **post** /requestBody/postBySmallNumberRequestBody | +[**post_by_small_number_response_body_for_content_types**](path_post_api/post_by_small_number_response_body_for_content_types.md) | **post** /responseBody/postBySmallNumberResponseBodyForContentTypes | +[**post_date_time_format_request_body**](path_post_api/post_date_time_format_request_body.md) | **post** /requestBody/postDateTimeFormatRequestBody | +[**post_date_time_format_response_body_for_content_types**](path_post_api/post_date_time_format_response_body_for_content_types.md) | **post** /responseBody/postDateTimeFormatResponseBodyForContentTypes | +[**post_email_format_request_body**](path_post_api/post_email_format_request_body.md) | **post** /requestBody/postEmailFormatRequestBody | +[**post_email_format_response_body_for_content_types**](path_post_api/post_email_format_response_body_for_content_types.md) | **post** /responseBody/postEmailFormatResponseBodyForContentTypes | +[**post_enum_with0_does_not_match_false_request_body**](path_post_api/post_enum_with0_does_not_match_false_request_body.md) | **post** /requestBody/postEnumWith0DoesNotMatchFalseRequestBody | +[**post_enum_with0_does_not_match_false_response_body_for_content_types**](path_post_api/post_enum_with0_does_not_match_false_response_body_for_content_types.md) | **post** /responseBody/postEnumWith0DoesNotMatchFalseResponseBodyForContentTypes | +[**post_enum_with1_does_not_match_true_request_body**](path_post_api/post_enum_with1_does_not_match_true_request_body.md) | **post** /requestBody/postEnumWith1DoesNotMatchTrueRequestBody | +[**post_enum_with1_does_not_match_true_response_body_for_content_types**](path_post_api/post_enum_with1_does_not_match_true_response_body_for_content_types.md) | **post** /responseBody/postEnumWith1DoesNotMatchTrueResponseBodyForContentTypes | +[**post_enum_with_escaped_characters_request_body**](path_post_api/post_enum_with_escaped_characters_request_body.md) | **post** /requestBody/postEnumWithEscapedCharactersRequestBody | +[**post_enum_with_escaped_characters_response_body_for_content_types**](path_post_api/post_enum_with_escaped_characters_response_body_for_content_types.md) | **post** /responseBody/postEnumWithEscapedCharactersResponseBodyForContentTypes | +[**post_enum_with_false_does_not_match0_request_body**](path_post_api/post_enum_with_false_does_not_match0_request_body.md) | **post** /requestBody/postEnumWithFalseDoesNotMatch0RequestBody | +[**post_enum_with_false_does_not_match0_response_body_for_content_types**](path_post_api/post_enum_with_false_does_not_match0_response_body_for_content_types.md) | **post** /responseBody/postEnumWithFalseDoesNotMatch0ResponseBodyForContentTypes | +[**post_enum_with_true_does_not_match1_request_body**](path_post_api/post_enum_with_true_does_not_match1_request_body.md) | **post** /requestBody/postEnumWithTrueDoesNotMatch1RequestBody | +[**post_enum_with_true_does_not_match1_response_body_for_content_types**](path_post_api/post_enum_with_true_does_not_match1_response_body_for_content_types.md) | **post** /responseBody/postEnumWithTrueDoesNotMatch1ResponseBodyForContentTypes | +[**post_enums_in_properties_request_body**](path_post_api/post_enums_in_properties_request_body.md) | **post** /requestBody/postEnumsInPropertiesRequestBody | +[**post_enums_in_properties_response_body_for_content_types**](path_post_api/post_enums_in_properties_response_body_for_content_types.md) | **post** /responseBody/postEnumsInPropertiesResponseBodyForContentTypes | +[**post_forbidden_property_request_body**](path_post_api/post_forbidden_property_request_body.md) | **post** /requestBody/postForbiddenPropertyRequestBody | +[**post_forbidden_property_response_body_for_content_types**](path_post_api/post_forbidden_property_response_body_for_content_types.md) | **post** /responseBody/postForbiddenPropertyResponseBodyForContentTypes | +[**post_hostname_format_request_body**](path_post_api/post_hostname_format_request_body.md) | **post** /requestBody/postHostnameFormatRequestBody | +[**post_hostname_format_response_body_for_content_types**](path_post_api/post_hostname_format_response_body_for_content_types.md) | **post** /responseBody/postHostnameFormatResponseBodyForContentTypes | +[**post_integer_type_matches_integers_request_body**](path_post_api/post_integer_type_matches_integers_request_body.md) | **post** /requestBody/postIntegerTypeMatchesIntegersRequestBody | +[**post_integer_type_matches_integers_response_body_for_content_types**](path_post_api/post_integer_type_matches_integers_response_body_for_content_types.md) | **post** /responseBody/postIntegerTypeMatchesIntegersResponseBodyForContentTypes | +[**post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body**](path_post_api/post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body.md) | **post** /requestBody/postInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody | +[**post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types**](path_post_api/post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types.md) | **post** /responseBody/postInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfResponseBodyForContentTypes | +[**post_invalid_string_value_for_default_request_body**](path_post_api/post_invalid_string_value_for_default_request_body.md) | **post** /requestBody/postInvalidStringValueForDefaultRequestBody | +[**post_invalid_string_value_for_default_response_body_for_content_types**](path_post_api/post_invalid_string_value_for_default_response_body_for_content_types.md) | **post** /responseBody/postInvalidStringValueForDefaultResponseBodyForContentTypes | +[**post_ipv4_format_request_body**](path_post_api/post_ipv4_format_request_body.md) | **post** /requestBody/postIpv4FormatRequestBody | +[**post_ipv4_format_response_body_for_content_types**](path_post_api/post_ipv4_format_response_body_for_content_types.md) | **post** /responseBody/postIpv4FormatResponseBodyForContentTypes | +[**post_ipv6_format_request_body**](path_post_api/post_ipv6_format_request_body.md) | **post** /requestBody/postIpv6FormatRequestBody | +[**post_ipv6_format_response_body_for_content_types**](path_post_api/post_ipv6_format_response_body_for_content_types.md) | **post** /responseBody/postIpv6FormatResponseBodyForContentTypes | +[**post_json_pointer_format_request_body**](path_post_api/post_json_pointer_format_request_body.md) | **post** /requestBody/postJsonPointerFormatRequestBody | +[**post_json_pointer_format_response_body_for_content_types**](path_post_api/post_json_pointer_format_response_body_for_content_types.md) | **post** /responseBody/postJsonPointerFormatResponseBodyForContentTypes | +[**post_maximum_validation_request_body**](path_post_api/post_maximum_validation_request_body.md) | **post** /requestBody/postMaximumValidationRequestBody | +[**post_maximum_validation_response_body_for_content_types**](path_post_api/post_maximum_validation_response_body_for_content_types.md) | **post** /responseBody/postMaximumValidationResponseBodyForContentTypes | +[**post_maximum_validation_with_unsigned_integer_request_body**](path_post_api/post_maximum_validation_with_unsigned_integer_request_body.md) | **post** /requestBody/postMaximumValidationWithUnsignedIntegerRequestBody | +[**post_maximum_validation_with_unsigned_integer_response_body_for_content_types**](path_post_api/post_maximum_validation_with_unsigned_integer_response_body_for_content_types.md) | **post** /responseBody/postMaximumValidationWithUnsignedIntegerResponseBodyForContentTypes | +[**post_maxitems_validation_request_body**](path_post_api/post_maxitems_validation_request_body.md) | **post** /requestBody/postMaxitemsValidationRequestBody | +[**post_maxitems_validation_response_body_for_content_types**](path_post_api/post_maxitems_validation_response_body_for_content_types.md) | **post** /responseBody/postMaxitemsValidationResponseBodyForContentTypes | +[**post_maxlength_validation_request_body**](path_post_api/post_maxlength_validation_request_body.md) | **post** /requestBody/postMaxlengthValidationRequestBody | +[**post_maxlength_validation_response_body_for_content_types**](path_post_api/post_maxlength_validation_response_body_for_content_types.md) | **post** /responseBody/postMaxlengthValidationResponseBodyForContentTypes | +[**post_maxproperties0_means_the_object_is_empty_request_body**](path_post_api/post_maxproperties0_means_the_object_is_empty_request_body.md) | **post** /requestBody/postMaxproperties0MeansTheObjectIsEmptyRequestBody | +[**post_maxproperties0_means_the_object_is_empty_response_body_for_content_types**](path_post_api/post_maxproperties0_means_the_object_is_empty_response_body_for_content_types.md) | **post** /responseBody/postMaxproperties0MeansTheObjectIsEmptyResponseBodyForContentTypes | +[**post_maxproperties_validation_request_body**](path_post_api/post_maxproperties_validation_request_body.md) | **post** /requestBody/postMaxpropertiesValidationRequestBody | +[**post_maxproperties_validation_response_body_for_content_types**](path_post_api/post_maxproperties_validation_response_body_for_content_types.md) | **post** /responseBody/postMaxpropertiesValidationResponseBodyForContentTypes | +[**post_minimum_validation_request_body**](path_post_api/post_minimum_validation_request_body.md) | **post** /requestBody/postMinimumValidationRequestBody | +[**post_minimum_validation_response_body_for_content_types**](path_post_api/post_minimum_validation_response_body_for_content_types.md) | **post** /responseBody/postMinimumValidationResponseBodyForContentTypes | +[**post_minimum_validation_with_signed_integer_request_body**](path_post_api/post_minimum_validation_with_signed_integer_request_body.md) | **post** /requestBody/postMinimumValidationWithSignedIntegerRequestBody | +[**post_minimum_validation_with_signed_integer_response_body_for_content_types**](path_post_api/post_minimum_validation_with_signed_integer_response_body_for_content_types.md) | **post** /responseBody/postMinimumValidationWithSignedIntegerResponseBodyForContentTypes | +[**post_minitems_validation_request_body**](path_post_api/post_minitems_validation_request_body.md) | **post** /requestBody/postMinitemsValidationRequestBody | +[**post_minitems_validation_response_body_for_content_types**](path_post_api/post_minitems_validation_response_body_for_content_types.md) | **post** /responseBody/postMinitemsValidationResponseBodyForContentTypes | +[**post_minlength_validation_request_body**](path_post_api/post_minlength_validation_request_body.md) | **post** /requestBody/postMinlengthValidationRequestBody | +[**post_minlength_validation_response_body_for_content_types**](path_post_api/post_minlength_validation_response_body_for_content_types.md) | **post** /responseBody/postMinlengthValidationResponseBodyForContentTypes | +[**post_minproperties_validation_request_body**](path_post_api/post_minproperties_validation_request_body.md) | **post** /requestBody/postMinpropertiesValidationRequestBody | +[**post_minproperties_validation_response_body_for_content_types**](path_post_api/post_minproperties_validation_response_body_for_content_types.md) | **post** /responseBody/postMinpropertiesValidationResponseBodyForContentTypes | +[**post_nested_allof_to_check_validation_semantics_request_body**](path_post_api/post_nested_allof_to_check_validation_semantics_request_body.md) | **post** /requestBody/postNestedAllofToCheckValidationSemanticsRequestBody | +[**post_nested_allof_to_check_validation_semantics_response_body_for_content_types**](path_post_api/post_nested_allof_to_check_validation_semantics_response_body_for_content_types.md) | **post** /responseBody/postNestedAllofToCheckValidationSemanticsResponseBodyForContentTypes | +[**post_nested_anyof_to_check_validation_semantics_request_body**](path_post_api/post_nested_anyof_to_check_validation_semantics_request_body.md) | **post** /requestBody/postNestedAnyofToCheckValidationSemanticsRequestBody | +[**post_nested_anyof_to_check_validation_semantics_response_body_for_content_types**](path_post_api/post_nested_anyof_to_check_validation_semantics_response_body_for_content_types.md) | **post** /responseBody/postNestedAnyofToCheckValidationSemanticsResponseBodyForContentTypes | +[**post_nested_items_request_body**](path_post_api/post_nested_items_request_body.md) | **post** /requestBody/postNestedItemsRequestBody | +[**post_nested_items_response_body_for_content_types**](path_post_api/post_nested_items_response_body_for_content_types.md) | **post** /responseBody/postNestedItemsResponseBodyForContentTypes | +[**post_nested_oneof_to_check_validation_semantics_request_body**](path_post_api/post_nested_oneof_to_check_validation_semantics_request_body.md) | **post** /requestBody/postNestedOneofToCheckValidationSemanticsRequestBody | +[**post_nested_oneof_to_check_validation_semantics_response_body_for_content_types**](path_post_api/post_nested_oneof_to_check_validation_semantics_response_body_for_content_types.md) | **post** /responseBody/postNestedOneofToCheckValidationSemanticsResponseBodyForContentTypes | +[**post_not_more_complex_schema_request_body**](path_post_api/post_not_more_complex_schema_request_body.md) | **post** /requestBody/postNotMoreComplexSchemaRequestBody | +[**post_not_more_complex_schema_response_body_for_content_types**](path_post_api/post_not_more_complex_schema_response_body_for_content_types.md) | **post** /responseBody/postNotMoreComplexSchemaResponseBodyForContentTypes | +[**post_not_request_body**](path_post_api/post_not_request_body.md) | **post** /requestBody/postNotRequestBody | +[**post_not_response_body_for_content_types**](path_post_api/post_not_response_body_for_content_types.md) | **post** /responseBody/postNotResponseBodyForContentTypes | +[**post_nul_characters_in_strings_request_body**](path_post_api/post_nul_characters_in_strings_request_body.md) | **post** /requestBody/postNulCharactersInStringsRequestBody | +[**post_nul_characters_in_strings_response_body_for_content_types**](path_post_api/post_nul_characters_in_strings_response_body_for_content_types.md) | **post** /responseBody/postNulCharactersInStringsResponseBodyForContentTypes | +[**post_null_type_matches_only_the_null_object_request_body**](path_post_api/post_null_type_matches_only_the_null_object_request_body.md) | **post** /requestBody/postNullTypeMatchesOnlyTheNullObjectRequestBody | +[**post_null_type_matches_only_the_null_object_response_body_for_content_types**](path_post_api/post_null_type_matches_only_the_null_object_response_body_for_content_types.md) | **post** /responseBody/postNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes | +[**post_number_type_matches_numbers_request_body**](path_post_api/post_number_type_matches_numbers_request_body.md) | **post** /requestBody/postNumberTypeMatchesNumbersRequestBody | +[**post_number_type_matches_numbers_response_body_for_content_types**](path_post_api/post_number_type_matches_numbers_response_body_for_content_types.md) | **post** /responseBody/postNumberTypeMatchesNumbersResponseBodyForContentTypes | +[**post_object_properties_validation_request_body**](path_post_api/post_object_properties_validation_request_body.md) | **post** /requestBody/postObjectPropertiesValidationRequestBody | +[**post_object_properties_validation_response_body_for_content_types**](path_post_api/post_object_properties_validation_response_body_for_content_types.md) | **post** /responseBody/postObjectPropertiesValidationResponseBodyForContentTypes | +[**post_object_type_matches_objects_request_body**](path_post_api/post_object_type_matches_objects_request_body.md) | **post** /requestBody/postObjectTypeMatchesObjectsRequestBody | +[**post_object_type_matches_objects_response_body_for_content_types**](path_post_api/post_object_type_matches_objects_response_body_for_content_types.md) | **post** /responseBody/postObjectTypeMatchesObjectsResponseBodyForContentTypes | +[**post_oneof_complex_types_request_body**](path_post_api/post_oneof_complex_types_request_body.md) | **post** /requestBody/postOneofComplexTypesRequestBody | +[**post_oneof_complex_types_response_body_for_content_types**](path_post_api/post_oneof_complex_types_response_body_for_content_types.md) | **post** /responseBody/postOneofComplexTypesResponseBodyForContentTypes | +[**post_oneof_request_body**](path_post_api/post_oneof_request_body.md) | **post** /requestBody/postOneofRequestBody | +[**post_oneof_response_body_for_content_types**](path_post_api/post_oneof_response_body_for_content_types.md) | **post** /responseBody/postOneofResponseBodyForContentTypes | +[**post_oneof_with_base_schema_request_body**](path_post_api/post_oneof_with_base_schema_request_body.md) | **post** /requestBody/postOneofWithBaseSchemaRequestBody | +[**post_oneof_with_base_schema_response_body_for_content_types**](path_post_api/post_oneof_with_base_schema_response_body_for_content_types.md) | **post** /responseBody/postOneofWithBaseSchemaResponseBodyForContentTypes | +[**post_oneof_with_empty_schema_request_body**](path_post_api/post_oneof_with_empty_schema_request_body.md) | **post** /requestBody/postOneofWithEmptySchemaRequestBody | +[**post_oneof_with_empty_schema_response_body_for_content_types**](path_post_api/post_oneof_with_empty_schema_response_body_for_content_types.md) | **post** /responseBody/postOneofWithEmptySchemaResponseBodyForContentTypes | +[**post_oneof_with_required_request_body**](path_post_api/post_oneof_with_required_request_body.md) | **post** /requestBody/postOneofWithRequiredRequestBody | +[**post_oneof_with_required_response_body_for_content_types**](path_post_api/post_oneof_with_required_response_body_for_content_types.md) | **post** /responseBody/postOneofWithRequiredResponseBodyForContentTypes | +[**post_pattern_is_not_anchored_request_body**](path_post_api/post_pattern_is_not_anchored_request_body.md) | **post** /requestBody/postPatternIsNotAnchoredRequestBody | +[**post_pattern_is_not_anchored_response_body_for_content_types**](path_post_api/post_pattern_is_not_anchored_response_body_for_content_types.md) | **post** /responseBody/postPatternIsNotAnchoredResponseBodyForContentTypes | +[**post_pattern_validation_request_body**](path_post_api/post_pattern_validation_request_body.md) | **post** /requestBody/postPatternValidationRequestBody | +[**post_pattern_validation_response_body_for_content_types**](path_post_api/post_pattern_validation_response_body_for_content_types.md) | **post** /responseBody/postPatternValidationResponseBodyForContentTypes | +[**post_properties_with_escaped_characters_request_body**](path_post_api/post_properties_with_escaped_characters_request_body.md) | **post** /requestBody/postPropertiesWithEscapedCharactersRequestBody | +[**post_properties_with_escaped_characters_response_body_for_content_types**](path_post_api/post_properties_with_escaped_characters_response_body_for_content_types.md) | **post** /responseBody/postPropertiesWithEscapedCharactersResponseBodyForContentTypes | +[**post_property_named_ref_that_is_not_a_reference_request_body**](path_post_api/post_property_named_ref_that_is_not_a_reference_request_body.md) | **post** /requestBody/postPropertyNamedRefThatIsNotAReferenceRequestBody | +[**post_property_named_ref_that_is_not_a_reference_response_body_for_content_types**](path_post_api/post_property_named_ref_that_is_not_a_reference_response_body_for_content_types.md) | **post** /responseBody/postPropertyNamedRefThatIsNotAReferenceResponseBodyForContentTypes | +[**post_ref_in_additionalproperties_request_body**](path_post_api/post_ref_in_additionalproperties_request_body.md) | **post** /requestBody/postRefInAdditionalpropertiesRequestBody | +[**post_ref_in_additionalproperties_response_body_for_content_types**](path_post_api/post_ref_in_additionalproperties_response_body_for_content_types.md) | **post** /responseBody/postRefInAdditionalpropertiesResponseBodyForContentTypes | +[**post_ref_in_allof_request_body**](path_post_api/post_ref_in_allof_request_body.md) | **post** /requestBody/postRefInAllofRequestBody | +[**post_ref_in_allof_response_body_for_content_types**](path_post_api/post_ref_in_allof_response_body_for_content_types.md) | **post** /responseBody/postRefInAllofResponseBodyForContentTypes | +[**post_ref_in_anyof_request_body**](path_post_api/post_ref_in_anyof_request_body.md) | **post** /requestBody/postRefInAnyofRequestBody | +[**post_ref_in_anyof_response_body_for_content_types**](path_post_api/post_ref_in_anyof_response_body_for_content_types.md) | **post** /responseBody/postRefInAnyofResponseBodyForContentTypes | +[**post_ref_in_items_request_body**](path_post_api/post_ref_in_items_request_body.md) | **post** /requestBody/postRefInItemsRequestBody | +[**post_ref_in_items_response_body_for_content_types**](path_post_api/post_ref_in_items_response_body_for_content_types.md) | **post** /responseBody/postRefInItemsResponseBodyForContentTypes | +[**post_ref_in_not_request_body**](path_post_api/post_ref_in_not_request_body.md) | **post** /requestBody/postRefInNotRequestBody | +[**post_ref_in_not_response_body_for_content_types**](path_post_api/post_ref_in_not_response_body_for_content_types.md) | **post** /responseBody/postRefInNotResponseBodyForContentTypes | +[**post_ref_in_oneof_request_body**](path_post_api/post_ref_in_oneof_request_body.md) | **post** /requestBody/postRefInOneofRequestBody | +[**post_ref_in_oneof_response_body_for_content_types**](path_post_api/post_ref_in_oneof_response_body_for_content_types.md) | **post** /responseBody/postRefInOneofResponseBodyForContentTypes | +[**post_ref_in_property_request_body**](path_post_api/post_ref_in_property_request_body.md) | **post** /requestBody/postRefInPropertyRequestBody | +[**post_ref_in_property_response_body_for_content_types**](path_post_api/post_ref_in_property_response_body_for_content_types.md) | **post** /responseBody/postRefInPropertyResponseBodyForContentTypes | +[**post_required_default_validation_request_body**](path_post_api/post_required_default_validation_request_body.md) | **post** /requestBody/postRequiredDefaultValidationRequestBody | +[**post_required_default_validation_response_body_for_content_types**](path_post_api/post_required_default_validation_response_body_for_content_types.md) | **post** /responseBody/postRequiredDefaultValidationResponseBodyForContentTypes | +[**post_required_validation_request_body**](path_post_api/post_required_validation_request_body.md) | **post** /requestBody/postRequiredValidationRequestBody | +[**post_required_validation_response_body_for_content_types**](path_post_api/post_required_validation_response_body_for_content_types.md) | **post** /responseBody/postRequiredValidationResponseBodyForContentTypes | +[**post_required_with_empty_array_request_body**](path_post_api/post_required_with_empty_array_request_body.md) | **post** /requestBody/postRequiredWithEmptyArrayRequestBody | +[**post_required_with_empty_array_response_body_for_content_types**](path_post_api/post_required_with_empty_array_response_body_for_content_types.md) | **post** /responseBody/postRequiredWithEmptyArrayResponseBodyForContentTypes | +[**post_required_with_escaped_characters_request_body**](path_post_api/post_required_with_escaped_characters_request_body.md) | **post** /requestBody/postRequiredWithEscapedCharactersRequestBody | +[**post_required_with_escaped_characters_response_body_for_content_types**](path_post_api/post_required_with_escaped_characters_response_body_for_content_types.md) | **post** /responseBody/postRequiredWithEscapedCharactersResponseBodyForContentTypes | +[**post_simple_enum_validation_request_body**](path_post_api/post_simple_enum_validation_request_body.md) | **post** /requestBody/postSimpleEnumValidationRequestBody | +[**post_simple_enum_validation_response_body_for_content_types**](path_post_api/post_simple_enum_validation_response_body_for_content_types.md) | **post** /responseBody/postSimpleEnumValidationResponseBodyForContentTypes | +[**post_string_type_matches_strings_request_body**](path_post_api/post_string_type_matches_strings_request_body.md) | **post** /requestBody/postStringTypeMatchesStringsRequestBody | +[**post_string_type_matches_strings_response_body_for_content_types**](path_post_api/post_string_type_matches_strings_response_body_for_content_types.md) | **post** /responseBody/postStringTypeMatchesStringsResponseBodyForContentTypes | +[**post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body**](path_post_api/post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.md) | **post** /requestBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody | +[**post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types**](path_post_api/post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types.md) | **post** /responseBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyForContentTypes | +[**post_uniqueitems_false_validation_request_body**](path_post_api/post_uniqueitems_false_validation_request_body.md) | **post** /requestBody/postUniqueitemsFalseValidationRequestBody | +[**post_uniqueitems_false_validation_response_body_for_content_types**](path_post_api/post_uniqueitems_false_validation_response_body_for_content_types.md) | **post** /responseBody/postUniqueitemsFalseValidationResponseBodyForContentTypes | +[**post_uniqueitems_validation_request_body**](path_post_api/post_uniqueitems_validation_request_body.md) | **post** /requestBody/postUniqueitemsValidationRequestBody | +[**post_uniqueitems_validation_response_body_for_content_types**](path_post_api/post_uniqueitems_validation_response_body_for_content_types.md) | **post** /responseBody/postUniqueitemsValidationResponseBodyForContentTypes | +[**post_uri_format_request_body**](path_post_api/post_uri_format_request_body.md) | **post** /requestBody/postUriFormatRequestBody | +[**post_uri_format_response_body_for_content_types**](path_post_api/post_uri_format_response_body_for_content_types.md) | **post** /responseBody/postUriFormatResponseBodyForContentTypes | +[**post_uri_reference_format_request_body**](path_post_api/post_uri_reference_format_request_body.md) | **post** /requestBody/postUriReferenceFormatRequestBody | +[**post_uri_reference_format_response_body_for_content_types**](path_post_api/post_uri_reference_format_response_body_for_content_types.md) | **post** /responseBody/postUriReferenceFormatResponseBodyForContentTypes | +[**post_uri_template_format_request_body**](path_post_api/post_uri_template_format_request_body.md) | **post** /requestBody/postUriTemplateFormatRequestBody | +[**post_uri_template_format_response_body_for_content_types**](path_post_api/post_uri_template_format_response_body_for_content_types.md) | **post** /responseBody/postUriTemplateFormatResponseBodyForContentTypes | + +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/PatternApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/PatternApi.md index a6cae4de541..f4623c2c76b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/PatternApi.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/PatternApi.md @@ -1,274 +1,13 @@ - + # unit_test_api.apis.tags.pattern_api.PatternApi All URIs are relative to *https://someserver.com/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**post_pattern_is_not_anchored_request_body**](#post_pattern_is_not_anchored_request_body) | **post** /requestBody/postPatternIsNotAnchoredRequestBody | -[**post_pattern_is_not_anchored_response_body_for_content_types**](#post_pattern_is_not_anchored_response_body_for_content_types) | **post** /responseBody/postPatternIsNotAnchoredResponseBodyForContentTypes | -[**post_pattern_validation_request_body**](#post_pattern_validation_request_body) | **post** /requestBody/postPatternValidationRequestBody | -[**post_pattern_validation_response_body_for_content_types**](#post_pattern_validation_response_body_for_content_types) | **post** /responseBody/postPatternValidationResponseBodyForContentTypes | - -# **post_pattern_is_not_anchored_request_body** - -> post_pattern_is_not_anchored_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import pattern_api -from unit_test_api.model.pattern_is_not_anchored import PatternIsNotAnchored -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = pattern_api.PatternApi(api_client) - - # example passing only required values which don't have defaults set - body = PatternIsNotAnchored(None) - try: - api_response = api_instance.post_pattern_is_not_anchored_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PatternApi->post_pattern_is_not_anchored_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**PatternIsNotAnchored**](../../models/PatternIsNotAnchored.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_pattern_is_not_anchored_request_body.ApiResponseFor200) | success - -#### post_pattern_is_not_anchored_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_pattern_is_not_anchored_response_body_for_content_types** - -> PatternIsNotAnchored post_pattern_is_not_anchored_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import pattern_api -from unit_test_api.model.pattern_is_not_anchored import PatternIsNotAnchored -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = pattern_api.PatternApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_pattern_is_not_anchored_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PatternApi->post_pattern_is_not_anchored_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_pattern_is_not_anchored_response_body_for_content_types.ApiResponseFor200) | success - -#### post_pattern_is_not_anchored_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**PatternIsNotAnchored**](../../models/PatternIsNotAnchored.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_pattern_validation_request_body** - -> post_pattern_validation_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import pattern_api -from unit_test_api.model.pattern_validation import PatternValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = pattern_api.PatternApi(api_client) - - # example passing only required values which don't have defaults set - body = PatternValidation(None) - try: - api_response = api_instance.post_pattern_validation_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PatternApi->post_pattern_validation_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**PatternValidation**](../../models/PatternValidation.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_pattern_validation_request_body.ApiResponseFor200) | success - -#### post_pattern_validation_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_pattern_validation_response_body_for_content_types** - -> PatternValidation post_pattern_validation_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import pattern_api -from unit_test_api.model.pattern_validation import PatternValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = pattern_api.PatternApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_pattern_validation_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PatternApi->post_pattern_validation_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_pattern_validation_response_body_for_content_types.ApiResponseFor200) | success - -#### post_pattern_validation_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**PatternValidation**](../../models/PatternValidation.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) +[**post_pattern_is_not_anchored_request_body**](pattern_api/post_pattern_is_not_anchored_request_body.md) | **post** /requestBody/postPatternIsNotAnchoredRequestBody | +[**post_pattern_is_not_anchored_response_body_for_content_types**](pattern_api/post_pattern_is_not_anchored_response_body_for_content_types.md) | **post** /responseBody/postPatternIsNotAnchoredResponseBodyForContentTypes | +[**post_pattern_validation_request_body**](pattern_api/post_pattern_validation_request_body.md) | **post** /requestBody/postPatternValidationRequestBody | +[**post_pattern_validation_response_body_for_content_types**](pattern_api/post_pattern_validation_response_body_for_content_types.md) | **post** /responseBody/postPatternValidationResponseBodyForContentTypes | +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/PropertiesApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/PropertiesApi.md index 67c74c2c13f..80dac9aad25 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/PropertiesApi.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/PropertiesApi.md @@ -1,274 +1,13 @@ - + # unit_test_api.apis.tags.properties_api.PropertiesApi All URIs are relative to *https://someserver.com/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**post_object_properties_validation_request_body**](#post_object_properties_validation_request_body) | **post** /requestBody/postObjectPropertiesValidationRequestBody | -[**post_object_properties_validation_response_body_for_content_types**](#post_object_properties_validation_response_body_for_content_types) | **post** /responseBody/postObjectPropertiesValidationResponseBodyForContentTypes | -[**post_properties_with_escaped_characters_request_body**](#post_properties_with_escaped_characters_request_body) | **post** /requestBody/postPropertiesWithEscapedCharactersRequestBody | -[**post_properties_with_escaped_characters_response_body_for_content_types**](#post_properties_with_escaped_characters_response_body_for_content_types) | **post** /responseBody/postPropertiesWithEscapedCharactersResponseBodyForContentTypes | - -# **post_object_properties_validation_request_body** - -> post_object_properties_validation_request_body(object_properties_validation) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import properties_api -from unit_test_api.model.object_properties_validation import ObjectPropertiesValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = properties_api.PropertiesApi(api_client) - - # example passing only required values which don't have defaults set - body = ObjectPropertiesValidation(None) - try: - api_response = api_instance.post_object_properties_validation_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PropertiesApi->post_object_properties_validation_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**ObjectPropertiesValidation**](../../models/ObjectPropertiesValidation.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_object_properties_validation_request_body.ApiResponseFor200) | success - -#### post_object_properties_validation_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_object_properties_validation_response_body_for_content_types** - -> ObjectPropertiesValidation post_object_properties_validation_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import properties_api -from unit_test_api.model.object_properties_validation import ObjectPropertiesValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = properties_api.PropertiesApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_object_properties_validation_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PropertiesApi->post_object_properties_validation_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_object_properties_validation_response_body_for_content_types.ApiResponseFor200) | success - -#### post_object_properties_validation_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**ObjectPropertiesValidation**](../../models/ObjectPropertiesValidation.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_properties_with_escaped_characters_request_body** - -> post_properties_with_escaped_characters_request_body(properties_with_escaped_characters) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import properties_api -from unit_test_api.model.properties_with_escaped_characters import PropertiesWithEscapedCharacters -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = properties_api.PropertiesApi(api_client) - - # example passing only required values which don't have defaults set - body = PropertiesWithEscapedCharacters(None) - try: - api_response = api_instance.post_properties_with_escaped_characters_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling PropertiesApi->post_properties_with_escaped_characters_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**PropertiesWithEscapedCharacters**](../../models/PropertiesWithEscapedCharacters.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_properties_with_escaped_characters_request_body.ApiResponseFor200) | success - -#### post_properties_with_escaped_characters_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_properties_with_escaped_characters_response_body_for_content_types** - -> PropertiesWithEscapedCharacters post_properties_with_escaped_characters_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import properties_api -from unit_test_api.model.properties_with_escaped_characters import PropertiesWithEscapedCharacters -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = properties_api.PropertiesApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_properties_with_escaped_characters_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling PropertiesApi->post_properties_with_escaped_characters_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_properties_with_escaped_characters_response_body_for_content_types.ApiResponseFor200) | success - -#### post_properties_with_escaped_characters_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**PropertiesWithEscapedCharacters**](../../models/PropertiesWithEscapedCharacters.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) +[**post_object_properties_validation_request_body**](properties_api/post_object_properties_validation_request_body.md) | **post** /requestBody/postObjectPropertiesValidationRequestBody | +[**post_object_properties_validation_response_body_for_content_types**](properties_api/post_object_properties_validation_response_body_for_content_types.md) | **post** /responseBody/postObjectPropertiesValidationResponseBodyForContentTypes | +[**post_properties_with_escaped_characters_request_body**](properties_api/post_properties_with_escaped_characters_request_body.md) | **post** /requestBody/postPropertiesWithEscapedCharactersRequestBody | +[**post_properties_with_escaped_characters_response_body_for_content_types**](properties_api/post_properties_with_escaped_characters_response_body_for_content_types.md) | **post** /responseBody/postPropertiesWithEscapedCharactersResponseBodyForContentTypes | +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/RefApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/RefApi.md index 520d9c32307..d4c9b4ce2be 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/RefApi.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/RefApi.md @@ -1,1090 +1,25 @@ - + # unit_test_api.apis.tags.ref_api.RefApi All URIs are relative to *https://someserver.com/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**post_property_named_ref_that_is_not_a_reference_request_body**](#post_property_named_ref_that_is_not_a_reference_request_body) | **post** /requestBody/postPropertyNamedRefThatIsNotAReferenceRequestBody | -[**post_property_named_ref_that_is_not_a_reference_response_body_for_content_types**](#post_property_named_ref_that_is_not_a_reference_response_body_for_content_types) | **post** /responseBody/postPropertyNamedRefThatIsNotAReferenceResponseBodyForContentTypes | -[**post_ref_in_additionalproperties_request_body**](#post_ref_in_additionalproperties_request_body) | **post** /requestBody/postRefInAdditionalpropertiesRequestBody | -[**post_ref_in_additionalproperties_response_body_for_content_types**](#post_ref_in_additionalproperties_response_body_for_content_types) | **post** /responseBody/postRefInAdditionalpropertiesResponseBodyForContentTypes | -[**post_ref_in_allof_request_body**](#post_ref_in_allof_request_body) | **post** /requestBody/postRefInAllofRequestBody | -[**post_ref_in_allof_response_body_for_content_types**](#post_ref_in_allof_response_body_for_content_types) | **post** /responseBody/postRefInAllofResponseBodyForContentTypes | -[**post_ref_in_anyof_request_body**](#post_ref_in_anyof_request_body) | **post** /requestBody/postRefInAnyofRequestBody | -[**post_ref_in_anyof_response_body_for_content_types**](#post_ref_in_anyof_response_body_for_content_types) | **post** /responseBody/postRefInAnyofResponseBodyForContentTypes | -[**post_ref_in_items_request_body**](#post_ref_in_items_request_body) | **post** /requestBody/postRefInItemsRequestBody | -[**post_ref_in_items_response_body_for_content_types**](#post_ref_in_items_response_body_for_content_types) | **post** /responseBody/postRefInItemsResponseBodyForContentTypes | -[**post_ref_in_not_request_body**](#post_ref_in_not_request_body) | **post** /requestBody/postRefInNotRequestBody | -[**post_ref_in_not_response_body_for_content_types**](#post_ref_in_not_response_body_for_content_types) | **post** /responseBody/postRefInNotResponseBodyForContentTypes | -[**post_ref_in_oneof_request_body**](#post_ref_in_oneof_request_body) | **post** /requestBody/postRefInOneofRequestBody | -[**post_ref_in_oneof_response_body_for_content_types**](#post_ref_in_oneof_response_body_for_content_types) | **post** /responseBody/postRefInOneofResponseBodyForContentTypes | -[**post_ref_in_property_request_body**](#post_ref_in_property_request_body) | **post** /requestBody/postRefInPropertyRequestBody | -[**post_ref_in_property_response_body_for_content_types**](#post_ref_in_property_response_body_for_content_types) | **post** /responseBody/postRefInPropertyResponseBodyForContentTypes | - -# **post_property_named_ref_that_is_not_a_reference_request_body** - -> post_property_named_ref_that_is_not_a_reference_request_body(property_named_ref_that_is_not_a_reference) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import ref_api -from unit_test_api.model.property_named_ref_that_is_not_a_reference import PropertyNamedRefThatIsNotAReference -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = ref_api.RefApi(api_client) - - # example passing only required values which don't have defaults set - body = PropertyNamedRefThatIsNotAReference(None) - try: - api_response = api_instance.post_property_named_ref_that_is_not_a_reference_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling RefApi->post_property_named_ref_that_is_not_a_reference_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**PropertyNamedRefThatIsNotAReference**](../../models/PropertyNamedRefThatIsNotAReference.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_property_named_ref_that_is_not_a_reference_request_body.ApiResponseFor200) | success - -#### post_property_named_ref_that_is_not_a_reference_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_property_named_ref_that_is_not_a_reference_response_body_for_content_types** - -> PropertyNamedRefThatIsNotAReference post_property_named_ref_that_is_not_a_reference_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import ref_api -from unit_test_api.model.property_named_ref_that_is_not_a_reference import PropertyNamedRefThatIsNotAReference -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = ref_api.RefApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_property_named_ref_that_is_not_a_reference_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling RefApi->post_property_named_ref_that_is_not_a_reference_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_property_named_ref_that_is_not_a_reference_response_body_for_content_types.ApiResponseFor200) | success - -#### post_property_named_ref_that_is_not_a_reference_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**PropertyNamedRefThatIsNotAReference**](../../models/PropertyNamedRefThatIsNotAReference.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ref_in_additionalproperties_request_body** - -> post_ref_in_additionalproperties_request_body(ref_in_additionalproperties) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import ref_api -from unit_test_api.model.ref_in_additionalproperties import RefInAdditionalproperties -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = ref_api.RefApi(api_client) - - # example passing only required values which don't have defaults set - body = RefInAdditionalproperties( - key=PropertyNamedRefThatIsNotAReference(None), - ) - try: - api_response = api_instance.post_ref_in_additionalproperties_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling RefApi->post_ref_in_additionalproperties_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RefInAdditionalproperties**](../../models/RefInAdditionalproperties.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ref_in_additionalproperties_request_body.ApiResponseFor200) | success - -#### post_ref_in_additionalproperties_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ref_in_additionalproperties_response_body_for_content_types** - -> RefInAdditionalproperties post_ref_in_additionalproperties_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import ref_api -from unit_test_api.model.ref_in_additionalproperties import RefInAdditionalproperties -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = ref_api.RefApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_ref_in_additionalproperties_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling RefApi->post_ref_in_additionalproperties_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ref_in_additionalproperties_response_body_for_content_types.ApiResponseFor200) | success - -#### post_ref_in_additionalproperties_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RefInAdditionalproperties**](../../models/RefInAdditionalproperties.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ref_in_allof_request_body** - -> post_ref_in_allof_request_body(ref_in_allof) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import ref_api -from unit_test_api.model.ref_in_allof import RefInAllof -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = ref_api.RefApi(api_client) - - # example passing only required values which don't have defaults set - body = RefInAllof(None) - try: - api_response = api_instance.post_ref_in_allof_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling RefApi->post_ref_in_allof_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RefInAllof**](../../models/RefInAllof.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ref_in_allof_request_body.ApiResponseFor200) | success - -#### post_ref_in_allof_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ref_in_allof_response_body_for_content_types** - -> RefInAllof post_ref_in_allof_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import ref_api -from unit_test_api.model.ref_in_allof import RefInAllof -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = ref_api.RefApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_ref_in_allof_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling RefApi->post_ref_in_allof_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ref_in_allof_response_body_for_content_types.ApiResponseFor200) | success - -#### post_ref_in_allof_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RefInAllof**](../../models/RefInAllof.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ref_in_anyof_request_body** - -> post_ref_in_anyof_request_body(ref_in_anyof) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import ref_api -from unit_test_api.model.ref_in_anyof import RefInAnyof -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = ref_api.RefApi(api_client) - - # example passing only required values which don't have defaults set - body = RefInAnyof(None) - try: - api_response = api_instance.post_ref_in_anyof_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling RefApi->post_ref_in_anyof_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RefInAnyof**](../../models/RefInAnyof.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ref_in_anyof_request_body.ApiResponseFor200) | success - -#### post_ref_in_anyof_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ref_in_anyof_response_body_for_content_types** - -> RefInAnyof post_ref_in_anyof_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import ref_api -from unit_test_api.model.ref_in_anyof import RefInAnyof -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = ref_api.RefApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_ref_in_anyof_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling RefApi->post_ref_in_anyof_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ref_in_anyof_response_body_for_content_types.ApiResponseFor200) | success - -#### post_ref_in_anyof_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RefInAnyof**](../../models/RefInAnyof.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ref_in_items_request_body** - -> post_ref_in_items_request_body(ref_in_items) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import ref_api -from unit_test_api.model.ref_in_items import RefInItems -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = ref_api.RefApi(api_client) - - # example passing only required values which don't have defaults set - body = RefInItems([ - PropertyNamedRefThatIsNotAReference(None) - ]) - try: - api_response = api_instance.post_ref_in_items_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling RefApi->post_ref_in_items_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RefInItems**](../../models/RefInItems.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ref_in_items_request_body.ApiResponseFor200) | success - -#### post_ref_in_items_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ref_in_items_response_body_for_content_types** - -> RefInItems post_ref_in_items_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import ref_api -from unit_test_api.model.ref_in_items import RefInItems -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = ref_api.RefApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_ref_in_items_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling RefApi->post_ref_in_items_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ref_in_items_response_body_for_content_types.ApiResponseFor200) | success - -#### post_ref_in_items_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RefInItems**](../../models/RefInItems.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ref_in_not_request_body** - -> post_ref_in_not_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import ref_api -from unit_test_api.model.property_named_ref_that_is_not_a_reference import PropertyNamedRefThatIsNotAReference -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = ref_api.RefApi(api_client) - - # example passing only required values which don't have defaults set - body = None - try: - api_response = api_instance.post_ref_in_not_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling RefApi->post_ref_in_not_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### not -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[PropertyNamedRefThatIsNotAReference]({{complexTypePrefix}}PropertyNamedRefThatIsNotAReference.md) | [**PropertyNamedRefThatIsNotAReference**]({{complexTypePrefix}}PropertyNamedRefThatIsNotAReference.md) | [**PropertyNamedRefThatIsNotAReference**]({{complexTypePrefix}}PropertyNamedRefThatIsNotAReference.md) | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ref_in_not_request_body.ApiResponseFor200) | success - -#### post_ref_in_not_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ref_in_not_response_body_for_content_types** - -> bool, date, datetime, dict, float, int, list, str, none_type post_ref_in_not_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import ref_api -from unit_test_api.model.property_named_ref_that_is_not_a_reference import PropertyNamedRefThatIsNotAReference -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = ref_api.RefApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_ref_in_not_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling RefApi->post_ref_in_not_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ref_in_not_response_body_for_content_types.ApiResponseFor200) | success - -#### post_ref_in_not_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### not -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[PropertyNamedRefThatIsNotAReference]({{complexTypePrefix}}PropertyNamedRefThatIsNotAReference.md) | [**PropertyNamedRefThatIsNotAReference**]({{complexTypePrefix}}PropertyNamedRefThatIsNotAReference.md) | [**PropertyNamedRefThatIsNotAReference**]({{complexTypePrefix}}PropertyNamedRefThatIsNotAReference.md) | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ref_in_oneof_request_body** - -> post_ref_in_oneof_request_body(ref_in_oneof) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import ref_api -from unit_test_api.model.ref_in_oneof import RefInOneof -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = ref_api.RefApi(api_client) - - # example passing only required values which don't have defaults set - body = RefInOneof(None) - try: - api_response = api_instance.post_ref_in_oneof_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling RefApi->post_ref_in_oneof_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RefInOneof**](../../models/RefInOneof.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ref_in_oneof_request_body.ApiResponseFor200) | success - -#### post_ref_in_oneof_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ref_in_oneof_response_body_for_content_types** - -> RefInOneof post_ref_in_oneof_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import ref_api -from unit_test_api.model.ref_in_oneof import RefInOneof -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = ref_api.RefApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_ref_in_oneof_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling RefApi->post_ref_in_oneof_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ref_in_oneof_response_body_for_content_types.ApiResponseFor200) | success - -#### post_ref_in_oneof_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RefInOneof**](../../models/RefInOneof.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ref_in_property_request_body** - -> post_ref_in_property_request_body(ref_in_property) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import ref_api -from unit_test_api.model.ref_in_property import RefInProperty -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = ref_api.RefApi(api_client) - - # example passing only required values which don't have defaults set - body = RefInProperty(None) - try: - api_response = api_instance.post_ref_in_property_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling RefApi->post_ref_in_property_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RefInProperty**](../../models/RefInProperty.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ref_in_property_request_body.ApiResponseFor200) | success - -#### post_ref_in_property_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ref_in_property_response_body_for_content_types** - -> RefInProperty post_ref_in_property_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import ref_api -from unit_test_api.model.ref_in_property import RefInProperty -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = ref_api.RefApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_ref_in_property_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling RefApi->post_ref_in_property_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ref_in_property_response_body_for_content_types.ApiResponseFor200) | success - -#### post_ref_in_property_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RefInProperty**](../../models/RefInProperty.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - +[**post_property_named_ref_that_is_not_a_reference_request_body**](ref_api/post_property_named_ref_that_is_not_a_reference_request_body.md) | **post** /requestBody/postPropertyNamedRefThatIsNotAReferenceRequestBody | +[**post_property_named_ref_that_is_not_a_reference_response_body_for_content_types**](ref_api/post_property_named_ref_that_is_not_a_reference_response_body_for_content_types.md) | **post** /responseBody/postPropertyNamedRefThatIsNotAReferenceResponseBodyForContentTypes | +[**post_ref_in_additionalproperties_request_body**](ref_api/post_ref_in_additionalproperties_request_body.md) | **post** /requestBody/postRefInAdditionalpropertiesRequestBody | +[**post_ref_in_additionalproperties_response_body_for_content_types**](ref_api/post_ref_in_additionalproperties_response_body_for_content_types.md) | **post** /responseBody/postRefInAdditionalpropertiesResponseBodyForContentTypes | +[**post_ref_in_allof_request_body**](ref_api/post_ref_in_allof_request_body.md) | **post** /requestBody/postRefInAllofRequestBody | +[**post_ref_in_allof_response_body_for_content_types**](ref_api/post_ref_in_allof_response_body_for_content_types.md) | **post** /responseBody/postRefInAllofResponseBodyForContentTypes | +[**post_ref_in_anyof_request_body**](ref_api/post_ref_in_anyof_request_body.md) | **post** /requestBody/postRefInAnyofRequestBody | +[**post_ref_in_anyof_response_body_for_content_types**](ref_api/post_ref_in_anyof_response_body_for_content_types.md) | **post** /responseBody/postRefInAnyofResponseBodyForContentTypes | +[**post_ref_in_items_request_body**](ref_api/post_ref_in_items_request_body.md) | **post** /requestBody/postRefInItemsRequestBody | +[**post_ref_in_items_response_body_for_content_types**](ref_api/post_ref_in_items_response_body_for_content_types.md) | **post** /responseBody/postRefInItemsResponseBodyForContentTypes | +[**post_ref_in_not_request_body**](ref_api/post_ref_in_not_request_body.md) | **post** /requestBody/postRefInNotRequestBody | +[**post_ref_in_not_response_body_for_content_types**](ref_api/post_ref_in_not_response_body_for_content_types.md) | **post** /responseBody/postRefInNotResponseBodyForContentTypes | +[**post_ref_in_oneof_request_body**](ref_api/post_ref_in_oneof_request_body.md) | **post** /requestBody/postRefInOneofRequestBody | +[**post_ref_in_oneof_response_body_for_content_types**](ref_api/post_ref_in_oneof_response_body_for_content_types.md) | **post** /responseBody/postRefInOneofResponseBodyForContentTypes | +[**post_ref_in_property_request_body**](ref_api/post_ref_in_property_request_body.md) | **post** /requestBody/postRefInPropertyRequestBody | +[**post_ref_in_property_response_body_for_content_types**](ref_api/post_ref_in_property_response_body_for_content_types.md) | **post** /responseBody/postRefInPropertyResponseBodyForContentTypes | + +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/RequiredApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/RequiredApi.md index 7ed6e02f04e..661c45e6f41 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/RequiredApi.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/RequiredApi.md @@ -1,540 +1,17 @@ - + # unit_test_api.apis.tags.required_api.RequiredApi All URIs are relative to *https://someserver.com/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**post_required_default_validation_request_body**](#post_required_default_validation_request_body) | **post** /requestBody/postRequiredDefaultValidationRequestBody | -[**post_required_default_validation_response_body_for_content_types**](#post_required_default_validation_response_body_for_content_types) | **post** /responseBody/postRequiredDefaultValidationResponseBodyForContentTypes | -[**post_required_validation_request_body**](#post_required_validation_request_body) | **post** /requestBody/postRequiredValidationRequestBody | -[**post_required_validation_response_body_for_content_types**](#post_required_validation_response_body_for_content_types) | **post** /responseBody/postRequiredValidationResponseBodyForContentTypes | -[**post_required_with_empty_array_request_body**](#post_required_with_empty_array_request_body) | **post** /requestBody/postRequiredWithEmptyArrayRequestBody | -[**post_required_with_empty_array_response_body_for_content_types**](#post_required_with_empty_array_response_body_for_content_types) | **post** /responseBody/postRequiredWithEmptyArrayResponseBodyForContentTypes | -[**post_required_with_escaped_characters_request_body**](#post_required_with_escaped_characters_request_body) | **post** /requestBody/postRequiredWithEscapedCharactersRequestBody | -[**post_required_with_escaped_characters_response_body_for_content_types**](#post_required_with_escaped_characters_response_body_for_content_types) | **post** /responseBody/postRequiredWithEscapedCharactersResponseBodyForContentTypes | - -# **post_required_default_validation_request_body** - -> post_required_default_validation_request_body(required_default_validation) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import required_api -from unit_test_api.model.required_default_validation import RequiredDefaultValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = required_api.RequiredApi(api_client) - - # example passing only required values which don't have defaults set - body = RequiredDefaultValidation(None) - try: - api_response = api_instance.post_required_default_validation_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling RequiredApi->post_required_default_validation_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RequiredDefaultValidation**](../../models/RequiredDefaultValidation.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_required_default_validation_request_body.ApiResponseFor200) | success - -#### post_required_default_validation_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_required_default_validation_response_body_for_content_types** - -> RequiredDefaultValidation post_required_default_validation_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import required_api -from unit_test_api.model.required_default_validation import RequiredDefaultValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = required_api.RequiredApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_required_default_validation_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling RequiredApi->post_required_default_validation_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_required_default_validation_response_body_for_content_types.ApiResponseFor200) | success - -#### post_required_default_validation_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RequiredDefaultValidation**](../../models/RequiredDefaultValidation.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_required_validation_request_body** - -> post_required_validation_request_body(required_validation) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import required_api -from unit_test_api.model.required_validation import RequiredValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = required_api.RequiredApi(api_client) - - # example passing only required values which don't have defaults set - body = RequiredValidation(None) - try: - api_response = api_instance.post_required_validation_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling RequiredApi->post_required_validation_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RequiredValidation**](../../models/RequiredValidation.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_required_validation_request_body.ApiResponseFor200) | success - -#### post_required_validation_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_required_validation_response_body_for_content_types** - -> RequiredValidation post_required_validation_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import required_api -from unit_test_api.model.required_validation import RequiredValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = required_api.RequiredApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_required_validation_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling RequiredApi->post_required_validation_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_required_validation_response_body_for_content_types.ApiResponseFor200) | success - -#### post_required_validation_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RequiredValidation**](../../models/RequiredValidation.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_required_with_empty_array_request_body** - -> post_required_with_empty_array_request_body(required_with_empty_array) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import required_api -from unit_test_api.model.required_with_empty_array import RequiredWithEmptyArray -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = required_api.RequiredApi(api_client) - - # example passing only required values which don't have defaults set - body = RequiredWithEmptyArray(None) - try: - api_response = api_instance.post_required_with_empty_array_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling RequiredApi->post_required_with_empty_array_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RequiredWithEmptyArray**](../../models/RequiredWithEmptyArray.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_required_with_empty_array_request_body.ApiResponseFor200) | success - -#### post_required_with_empty_array_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_required_with_empty_array_response_body_for_content_types** - -> RequiredWithEmptyArray post_required_with_empty_array_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import required_api -from unit_test_api.model.required_with_empty_array import RequiredWithEmptyArray -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = required_api.RequiredApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_required_with_empty_array_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling RequiredApi->post_required_with_empty_array_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_required_with_empty_array_response_body_for_content_types.ApiResponseFor200) | success - -#### post_required_with_empty_array_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RequiredWithEmptyArray**](../../models/RequiredWithEmptyArray.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_required_with_escaped_characters_request_body** - -> post_required_with_escaped_characters_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import required_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = required_api.RequiredApi(api_client) - - # example passing only required values which don't have defaults set - body = None - try: - api_response = api_instance.post_required_with_escaped_characters_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling RequiredApi->post_required_with_escaped_characters_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_required_with_escaped_characters_request_body.ApiResponseFor200) | success - -#### post_required_with_escaped_characters_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_required_with_escaped_characters_response_body_for_content_types** - -> bool, date, datetime, dict, float, int, list, str, none_type post_required_with_escaped_characters_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import required_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = required_api.RequiredApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_required_with_escaped_characters_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling RequiredApi->post_required_with_escaped_characters_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_required_with_escaped_characters_response_body_for_content_types.ApiResponseFor200) | success - -#### post_required_with_escaped_characters_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) +[**post_required_default_validation_request_body**](required_api/post_required_default_validation_request_body.md) | **post** /requestBody/postRequiredDefaultValidationRequestBody | +[**post_required_default_validation_response_body_for_content_types**](required_api/post_required_default_validation_response_body_for_content_types.md) | **post** /responseBody/postRequiredDefaultValidationResponseBodyForContentTypes | +[**post_required_validation_request_body**](required_api/post_required_validation_request_body.md) | **post** /requestBody/postRequiredValidationRequestBody | +[**post_required_validation_response_body_for_content_types**](required_api/post_required_validation_response_body_for_content_types.md) | **post** /responseBody/postRequiredValidationResponseBodyForContentTypes | +[**post_required_with_empty_array_request_body**](required_api/post_required_with_empty_array_request_body.md) | **post** /requestBody/postRequiredWithEmptyArrayRequestBody | +[**post_required_with_empty_array_response_body_for_content_types**](required_api/post_required_with_empty_array_response_body_for_content_types.md) | **post** /responseBody/postRequiredWithEmptyArrayResponseBodyForContentTypes | +[**post_required_with_escaped_characters_request_body**](required_api/post_required_with_escaped_characters_request_body.md) | **post** /requestBody/postRequiredWithEscapedCharactersRequestBody | +[**post_required_with_escaped_characters_response_body_for_content_types**](required_api/post_required_with_escaped_characters_response_body_for_content_types.md) | **post** /responseBody/postRequiredWithEscapedCharactersResponseBodyForContentTypes | +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/ResponseContentContentTypeSchemaApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/ResponseContentContentTypeSchemaApi.md index 0147f02e5f6..9ee5b3bd536 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/ResponseContentContentTypeSchemaApi.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/ResponseContentContentTypeSchemaApi.md @@ -1,5354 +1,96 @@ - + # unit_test_api.apis.tags.response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi All URIs are relative to *https://someserver.com/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types**](#post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types) | **post** /responseBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateResponseBodyForContentTypes | -[**post_additionalproperties_are_allowed_by_default_response_body_for_content_types**](#post_additionalproperties_are_allowed_by_default_response_body_for_content_types) | **post** /responseBody/postAdditionalpropertiesAreAllowedByDefaultResponseBodyForContentTypes | -[**post_additionalproperties_can_exist_by_itself_response_body_for_content_types**](#post_additionalproperties_can_exist_by_itself_response_body_for_content_types) | **post** /responseBody/postAdditionalpropertiesCanExistByItselfResponseBodyForContentTypes | -[**post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types**](#post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types) | **post** /responseBody/postAdditionalpropertiesShouldNotLookInApplicatorsResponseBodyForContentTypes | -[**post_allof_combined_with_anyof_oneof_response_body_for_content_types**](#post_allof_combined_with_anyof_oneof_response_body_for_content_types) | **post** /responseBody/postAllofCombinedWithAnyofOneofResponseBodyForContentTypes | -[**post_allof_response_body_for_content_types**](#post_allof_response_body_for_content_types) | **post** /responseBody/postAllofResponseBodyForContentTypes | -[**post_allof_simple_types_response_body_for_content_types**](#post_allof_simple_types_response_body_for_content_types) | **post** /responseBody/postAllofSimpleTypesResponseBodyForContentTypes | -[**post_allof_with_base_schema_response_body_for_content_types**](#post_allof_with_base_schema_response_body_for_content_types) | **post** /responseBody/postAllofWithBaseSchemaResponseBodyForContentTypes | -[**post_allof_with_one_empty_schema_response_body_for_content_types**](#post_allof_with_one_empty_schema_response_body_for_content_types) | **post** /responseBody/postAllofWithOneEmptySchemaResponseBodyForContentTypes | -[**post_allof_with_the_first_empty_schema_response_body_for_content_types**](#post_allof_with_the_first_empty_schema_response_body_for_content_types) | **post** /responseBody/postAllofWithTheFirstEmptySchemaResponseBodyForContentTypes | -[**post_allof_with_the_last_empty_schema_response_body_for_content_types**](#post_allof_with_the_last_empty_schema_response_body_for_content_types) | **post** /responseBody/postAllofWithTheLastEmptySchemaResponseBodyForContentTypes | -[**post_allof_with_two_empty_schemas_response_body_for_content_types**](#post_allof_with_two_empty_schemas_response_body_for_content_types) | **post** /responseBody/postAllofWithTwoEmptySchemasResponseBodyForContentTypes | -[**post_anyof_complex_types_response_body_for_content_types**](#post_anyof_complex_types_response_body_for_content_types) | **post** /responseBody/postAnyofComplexTypesResponseBodyForContentTypes | -[**post_anyof_response_body_for_content_types**](#post_anyof_response_body_for_content_types) | **post** /responseBody/postAnyofResponseBodyForContentTypes | -[**post_anyof_with_base_schema_response_body_for_content_types**](#post_anyof_with_base_schema_response_body_for_content_types) | **post** /responseBody/postAnyofWithBaseSchemaResponseBodyForContentTypes | -[**post_anyof_with_one_empty_schema_response_body_for_content_types**](#post_anyof_with_one_empty_schema_response_body_for_content_types) | **post** /responseBody/postAnyofWithOneEmptySchemaResponseBodyForContentTypes | -[**post_array_type_matches_arrays_response_body_for_content_types**](#post_array_type_matches_arrays_response_body_for_content_types) | **post** /responseBody/postArrayTypeMatchesArraysResponseBodyForContentTypes | -[**post_boolean_type_matches_booleans_response_body_for_content_types**](#post_boolean_type_matches_booleans_response_body_for_content_types) | **post** /responseBody/postBooleanTypeMatchesBooleansResponseBodyForContentTypes | -[**post_by_int_response_body_for_content_types**](#post_by_int_response_body_for_content_types) | **post** /responseBody/postByIntResponseBodyForContentTypes | -[**post_by_number_response_body_for_content_types**](#post_by_number_response_body_for_content_types) | **post** /responseBody/postByNumberResponseBodyForContentTypes | -[**post_by_small_number_response_body_for_content_types**](#post_by_small_number_response_body_for_content_types) | **post** /responseBody/postBySmallNumberResponseBodyForContentTypes | -[**post_date_time_format_response_body_for_content_types**](#post_date_time_format_response_body_for_content_types) | **post** /responseBody/postDateTimeFormatResponseBodyForContentTypes | -[**post_email_format_response_body_for_content_types**](#post_email_format_response_body_for_content_types) | **post** /responseBody/postEmailFormatResponseBodyForContentTypes | -[**post_enum_with0_does_not_match_false_response_body_for_content_types**](#post_enum_with0_does_not_match_false_response_body_for_content_types) | **post** /responseBody/postEnumWith0DoesNotMatchFalseResponseBodyForContentTypes | -[**post_enum_with1_does_not_match_true_response_body_for_content_types**](#post_enum_with1_does_not_match_true_response_body_for_content_types) | **post** /responseBody/postEnumWith1DoesNotMatchTrueResponseBodyForContentTypes | -[**post_enum_with_escaped_characters_response_body_for_content_types**](#post_enum_with_escaped_characters_response_body_for_content_types) | **post** /responseBody/postEnumWithEscapedCharactersResponseBodyForContentTypes | -[**post_enum_with_false_does_not_match0_response_body_for_content_types**](#post_enum_with_false_does_not_match0_response_body_for_content_types) | **post** /responseBody/postEnumWithFalseDoesNotMatch0ResponseBodyForContentTypes | -[**post_enum_with_true_does_not_match1_response_body_for_content_types**](#post_enum_with_true_does_not_match1_response_body_for_content_types) | **post** /responseBody/postEnumWithTrueDoesNotMatch1ResponseBodyForContentTypes | -[**post_enums_in_properties_response_body_for_content_types**](#post_enums_in_properties_response_body_for_content_types) | **post** /responseBody/postEnumsInPropertiesResponseBodyForContentTypes | -[**post_forbidden_property_response_body_for_content_types**](#post_forbidden_property_response_body_for_content_types) | **post** /responseBody/postForbiddenPropertyResponseBodyForContentTypes | -[**post_hostname_format_response_body_for_content_types**](#post_hostname_format_response_body_for_content_types) | **post** /responseBody/postHostnameFormatResponseBodyForContentTypes | -[**post_integer_type_matches_integers_response_body_for_content_types**](#post_integer_type_matches_integers_response_body_for_content_types) | **post** /responseBody/postIntegerTypeMatchesIntegersResponseBodyForContentTypes | -[**post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types**](#post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types) | **post** /responseBody/postInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfResponseBodyForContentTypes | -[**post_invalid_string_value_for_default_response_body_for_content_types**](#post_invalid_string_value_for_default_response_body_for_content_types) | **post** /responseBody/postInvalidStringValueForDefaultResponseBodyForContentTypes | -[**post_ipv4_format_response_body_for_content_types**](#post_ipv4_format_response_body_for_content_types) | **post** /responseBody/postIpv4FormatResponseBodyForContentTypes | -[**post_ipv6_format_response_body_for_content_types**](#post_ipv6_format_response_body_for_content_types) | **post** /responseBody/postIpv6FormatResponseBodyForContentTypes | -[**post_json_pointer_format_response_body_for_content_types**](#post_json_pointer_format_response_body_for_content_types) | **post** /responseBody/postJsonPointerFormatResponseBodyForContentTypes | -[**post_maximum_validation_response_body_for_content_types**](#post_maximum_validation_response_body_for_content_types) | **post** /responseBody/postMaximumValidationResponseBodyForContentTypes | -[**post_maximum_validation_with_unsigned_integer_response_body_for_content_types**](#post_maximum_validation_with_unsigned_integer_response_body_for_content_types) | **post** /responseBody/postMaximumValidationWithUnsignedIntegerResponseBodyForContentTypes | -[**post_maxitems_validation_response_body_for_content_types**](#post_maxitems_validation_response_body_for_content_types) | **post** /responseBody/postMaxitemsValidationResponseBodyForContentTypes | -[**post_maxlength_validation_response_body_for_content_types**](#post_maxlength_validation_response_body_for_content_types) | **post** /responseBody/postMaxlengthValidationResponseBodyForContentTypes | -[**post_maxproperties0_means_the_object_is_empty_response_body_for_content_types**](#post_maxproperties0_means_the_object_is_empty_response_body_for_content_types) | **post** /responseBody/postMaxproperties0MeansTheObjectIsEmptyResponseBodyForContentTypes | -[**post_maxproperties_validation_response_body_for_content_types**](#post_maxproperties_validation_response_body_for_content_types) | **post** /responseBody/postMaxpropertiesValidationResponseBodyForContentTypes | -[**post_minimum_validation_response_body_for_content_types**](#post_minimum_validation_response_body_for_content_types) | **post** /responseBody/postMinimumValidationResponseBodyForContentTypes | -[**post_minimum_validation_with_signed_integer_response_body_for_content_types**](#post_minimum_validation_with_signed_integer_response_body_for_content_types) | **post** /responseBody/postMinimumValidationWithSignedIntegerResponseBodyForContentTypes | -[**post_minitems_validation_response_body_for_content_types**](#post_minitems_validation_response_body_for_content_types) | **post** /responseBody/postMinitemsValidationResponseBodyForContentTypes | -[**post_minlength_validation_response_body_for_content_types**](#post_minlength_validation_response_body_for_content_types) | **post** /responseBody/postMinlengthValidationResponseBodyForContentTypes | -[**post_minproperties_validation_response_body_for_content_types**](#post_minproperties_validation_response_body_for_content_types) | **post** /responseBody/postMinpropertiesValidationResponseBodyForContentTypes | -[**post_nested_allof_to_check_validation_semantics_response_body_for_content_types**](#post_nested_allof_to_check_validation_semantics_response_body_for_content_types) | **post** /responseBody/postNestedAllofToCheckValidationSemanticsResponseBodyForContentTypes | -[**post_nested_anyof_to_check_validation_semantics_response_body_for_content_types**](#post_nested_anyof_to_check_validation_semantics_response_body_for_content_types) | **post** /responseBody/postNestedAnyofToCheckValidationSemanticsResponseBodyForContentTypes | -[**post_nested_items_response_body_for_content_types**](#post_nested_items_response_body_for_content_types) | **post** /responseBody/postNestedItemsResponseBodyForContentTypes | -[**post_nested_oneof_to_check_validation_semantics_response_body_for_content_types**](#post_nested_oneof_to_check_validation_semantics_response_body_for_content_types) | **post** /responseBody/postNestedOneofToCheckValidationSemanticsResponseBodyForContentTypes | -[**post_not_more_complex_schema_response_body_for_content_types**](#post_not_more_complex_schema_response_body_for_content_types) | **post** /responseBody/postNotMoreComplexSchemaResponseBodyForContentTypes | -[**post_not_response_body_for_content_types**](#post_not_response_body_for_content_types) | **post** /responseBody/postNotResponseBodyForContentTypes | -[**post_nul_characters_in_strings_response_body_for_content_types**](#post_nul_characters_in_strings_response_body_for_content_types) | **post** /responseBody/postNulCharactersInStringsResponseBodyForContentTypes | -[**post_null_type_matches_only_the_null_object_response_body_for_content_types**](#post_null_type_matches_only_the_null_object_response_body_for_content_types) | **post** /responseBody/postNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes | -[**post_number_type_matches_numbers_response_body_for_content_types**](#post_number_type_matches_numbers_response_body_for_content_types) | **post** /responseBody/postNumberTypeMatchesNumbersResponseBodyForContentTypes | -[**post_object_properties_validation_response_body_for_content_types**](#post_object_properties_validation_response_body_for_content_types) | **post** /responseBody/postObjectPropertiesValidationResponseBodyForContentTypes | -[**post_object_type_matches_objects_response_body_for_content_types**](#post_object_type_matches_objects_response_body_for_content_types) | **post** /responseBody/postObjectTypeMatchesObjectsResponseBodyForContentTypes | -[**post_oneof_complex_types_response_body_for_content_types**](#post_oneof_complex_types_response_body_for_content_types) | **post** /responseBody/postOneofComplexTypesResponseBodyForContentTypes | -[**post_oneof_response_body_for_content_types**](#post_oneof_response_body_for_content_types) | **post** /responseBody/postOneofResponseBodyForContentTypes | -[**post_oneof_with_base_schema_response_body_for_content_types**](#post_oneof_with_base_schema_response_body_for_content_types) | **post** /responseBody/postOneofWithBaseSchemaResponseBodyForContentTypes | -[**post_oneof_with_empty_schema_response_body_for_content_types**](#post_oneof_with_empty_schema_response_body_for_content_types) | **post** /responseBody/postOneofWithEmptySchemaResponseBodyForContentTypes | -[**post_oneof_with_required_response_body_for_content_types**](#post_oneof_with_required_response_body_for_content_types) | **post** /responseBody/postOneofWithRequiredResponseBodyForContentTypes | -[**post_pattern_is_not_anchored_response_body_for_content_types**](#post_pattern_is_not_anchored_response_body_for_content_types) | **post** /responseBody/postPatternIsNotAnchoredResponseBodyForContentTypes | -[**post_pattern_validation_response_body_for_content_types**](#post_pattern_validation_response_body_for_content_types) | **post** /responseBody/postPatternValidationResponseBodyForContentTypes | -[**post_properties_with_escaped_characters_response_body_for_content_types**](#post_properties_with_escaped_characters_response_body_for_content_types) | **post** /responseBody/postPropertiesWithEscapedCharactersResponseBodyForContentTypes | -[**post_property_named_ref_that_is_not_a_reference_response_body_for_content_types**](#post_property_named_ref_that_is_not_a_reference_response_body_for_content_types) | **post** /responseBody/postPropertyNamedRefThatIsNotAReferenceResponseBodyForContentTypes | -[**post_ref_in_additionalproperties_response_body_for_content_types**](#post_ref_in_additionalproperties_response_body_for_content_types) | **post** /responseBody/postRefInAdditionalpropertiesResponseBodyForContentTypes | -[**post_ref_in_allof_response_body_for_content_types**](#post_ref_in_allof_response_body_for_content_types) | **post** /responseBody/postRefInAllofResponseBodyForContentTypes | -[**post_ref_in_anyof_response_body_for_content_types**](#post_ref_in_anyof_response_body_for_content_types) | **post** /responseBody/postRefInAnyofResponseBodyForContentTypes | -[**post_ref_in_items_response_body_for_content_types**](#post_ref_in_items_response_body_for_content_types) | **post** /responseBody/postRefInItemsResponseBodyForContentTypes | -[**post_ref_in_not_response_body_for_content_types**](#post_ref_in_not_response_body_for_content_types) | **post** /responseBody/postRefInNotResponseBodyForContentTypes | -[**post_ref_in_oneof_response_body_for_content_types**](#post_ref_in_oneof_response_body_for_content_types) | **post** /responseBody/postRefInOneofResponseBodyForContentTypes | -[**post_ref_in_property_response_body_for_content_types**](#post_ref_in_property_response_body_for_content_types) | **post** /responseBody/postRefInPropertyResponseBodyForContentTypes | -[**post_required_default_validation_response_body_for_content_types**](#post_required_default_validation_response_body_for_content_types) | **post** /responseBody/postRequiredDefaultValidationResponseBodyForContentTypes | -[**post_required_validation_response_body_for_content_types**](#post_required_validation_response_body_for_content_types) | **post** /responseBody/postRequiredValidationResponseBodyForContentTypes | -[**post_required_with_empty_array_response_body_for_content_types**](#post_required_with_empty_array_response_body_for_content_types) | **post** /responseBody/postRequiredWithEmptyArrayResponseBodyForContentTypes | -[**post_required_with_escaped_characters_response_body_for_content_types**](#post_required_with_escaped_characters_response_body_for_content_types) | **post** /responseBody/postRequiredWithEscapedCharactersResponseBodyForContentTypes | -[**post_simple_enum_validation_response_body_for_content_types**](#post_simple_enum_validation_response_body_for_content_types) | **post** /responseBody/postSimpleEnumValidationResponseBodyForContentTypes | -[**post_string_type_matches_strings_response_body_for_content_types**](#post_string_type_matches_strings_response_body_for_content_types) | **post** /responseBody/postStringTypeMatchesStringsResponseBodyForContentTypes | -[**post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types**](#post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types) | **post** /responseBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyForContentTypes | -[**post_uniqueitems_false_validation_response_body_for_content_types**](#post_uniqueitems_false_validation_response_body_for_content_types) | **post** /responseBody/postUniqueitemsFalseValidationResponseBodyForContentTypes | -[**post_uniqueitems_validation_response_body_for_content_types**](#post_uniqueitems_validation_response_body_for_content_types) | **post** /responseBody/postUniqueitemsValidationResponseBodyForContentTypes | -[**post_uri_format_response_body_for_content_types**](#post_uri_format_response_body_for_content_types) | **post** /responseBody/postUriFormatResponseBodyForContentTypes | -[**post_uri_reference_format_response_body_for_content_types**](#post_uri_reference_format_response_body_for_content_types) | **post** /responseBody/postUriReferenceFormatResponseBodyForContentTypes | -[**post_uri_template_format_response_body_for_content_types**](#post_uri_template_format_response_body_for_content_types) | **post** /responseBody/postUriTemplateFormatResponseBodyForContentTypes | - -# **post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types** - -> AdditionalpropertiesAllowsASchemaWhichShouldValidate post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.additionalproperties_allows_a_schema_which_should_validate import AdditionalpropertiesAllowsASchemaWhichShouldValidate -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types.ApiResponseFor200) | success - -#### post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AdditionalpropertiesAllowsASchemaWhichShouldValidate**](../../models/AdditionalpropertiesAllowsASchemaWhichShouldValidate.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_additionalproperties_are_allowed_by_default_response_body_for_content_types** - -> AdditionalpropertiesAreAllowedByDefault post_additionalproperties_are_allowed_by_default_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.additionalproperties_are_allowed_by_default import AdditionalpropertiesAreAllowedByDefault -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_additionalproperties_are_allowed_by_default_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_additionalproperties_are_allowed_by_default_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_additionalproperties_are_allowed_by_default_response_body_for_content_types.ApiResponseFor200) | success - -#### post_additionalproperties_are_allowed_by_default_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AdditionalpropertiesAreAllowedByDefault**](../../models/AdditionalpropertiesAreAllowedByDefault.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_additionalproperties_can_exist_by_itself_response_body_for_content_types** - -> AdditionalpropertiesCanExistByItself post_additionalproperties_can_exist_by_itself_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.additionalproperties_can_exist_by_itself import AdditionalpropertiesCanExistByItself -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_additionalproperties_can_exist_by_itself_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_additionalproperties_can_exist_by_itself_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_additionalproperties_can_exist_by_itself_response_body_for_content_types.ApiResponseFor200) | success - -#### post_additionalproperties_can_exist_by_itself_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AdditionalpropertiesCanExistByItself**](../../models/AdditionalpropertiesCanExistByItself.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types** - -> AdditionalpropertiesShouldNotLookInApplicators post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.additionalproperties_should_not_look_in_applicators import AdditionalpropertiesShouldNotLookInApplicators -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types.ApiResponseFor200) | success - -#### post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AdditionalpropertiesShouldNotLookInApplicators**](../../models/AdditionalpropertiesShouldNotLookInApplicators.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_allof_combined_with_anyof_oneof_response_body_for_content_types** - -> AllofCombinedWithAnyofOneof post_allof_combined_with_anyof_oneof_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.allof_combined_with_anyof_oneof import AllofCombinedWithAnyofOneof -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_allof_combined_with_anyof_oneof_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_allof_combined_with_anyof_oneof_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_allof_combined_with_anyof_oneof_response_body_for_content_types.ApiResponseFor200) | success - -#### post_allof_combined_with_anyof_oneof_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AllofCombinedWithAnyofOneof**](../../models/AllofCombinedWithAnyofOneof.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_allof_response_body_for_content_types** - -> Allof post_allof_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.allof import Allof -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_allof_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_allof_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_allof_response_body_for_content_types.ApiResponseFor200) | success - -#### post_allof_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**Allof**](../../models/Allof.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_allof_simple_types_response_body_for_content_types** - -> AllofSimpleTypes post_allof_simple_types_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.allof_simple_types import AllofSimpleTypes -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_allof_simple_types_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_allof_simple_types_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_allof_simple_types_response_body_for_content_types.ApiResponseFor200) | success - -#### post_allof_simple_types_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AllofSimpleTypes**](../../models/AllofSimpleTypes.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_allof_with_base_schema_response_body_for_content_types** - -> AllofWithBaseSchema post_allof_with_base_schema_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.allof_with_base_schema import AllofWithBaseSchema -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_allof_with_base_schema_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_allof_with_base_schema_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_allof_with_base_schema_response_body_for_content_types.ApiResponseFor200) | success - -#### post_allof_with_base_schema_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AllofWithBaseSchema**](../../models/AllofWithBaseSchema.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_allof_with_one_empty_schema_response_body_for_content_types** - -> AllofWithOneEmptySchema post_allof_with_one_empty_schema_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.allof_with_one_empty_schema import AllofWithOneEmptySchema -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_allof_with_one_empty_schema_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_allof_with_one_empty_schema_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_allof_with_one_empty_schema_response_body_for_content_types.ApiResponseFor200) | success - -#### post_allof_with_one_empty_schema_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AllofWithOneEmptySchema**](../../models/AllofWithOneEmptySchema.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_allof_with_the_first_empty_schema_response_body_for_content_types** - -> AllofWithTheFirstEmptySchema post_allof_with_the_first_empty_schema_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.allof_with_the_first_empty_schema import AllofWithTheFirstEmptySchema -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_allof_with_the_first_empty_schema_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_allof_with_the_first_empty_schema_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_allof_with_the_first_empty_schema_response_body_for_content_types.ApiResponseFor200) | success - -#### post_allof_with_the_first_empty_schema_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AllofWithTheFirstEmptySchema**](../../models/AllofWithTheFirstEmptySchema.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_allof_with_the_last_empty_schema_response_body_for_content_types** - -> AllofWithTheLastEmptySchema post_allof_with_the_last_empty_schema_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.allof_with_the_last_empty_schema import AllofWithTheLastEmptySchema -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_allof_with_the_last_empty_schema_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_allof_with_the_last_empty_schema_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_allof_with_the_last_empty_schema_response_body_for_content_types.ApiResponseFor200) | success - -#### post_allof_with_the_last_empty_schema_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AllofWithTheLastEmptySchema**](../../models/AllofWithTheLastEmptySchema.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_allof_with_two_empty_schemas_response_body_for_content_types** - -> AllofWithTwoEmptySchemas post_allof_with_two_empty_schemas_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.allof_with_two_empty_schemas import AllofWithTwoEmptySchemas -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_allof_with_two_empty_schemas_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_allof_with_two_empty_schemas_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_allof_with_two_empty_schemas_response_body_for_content_types.ApiResponseFor200) | success - -#### post_allof_with_two_empty_schemas_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AllofWithTwoEmptySchemas**](../../models/AllofWithTwoEmptySchemas.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_anyof_complex_types_response_body_for_content_types** - -> AnyofComplexTypes post_anyof_complex_types_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.anyof_complex_types import AnyofComplexTypes -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_anyof_complex_types_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_anyof_complex_types_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_anyof_complex_types_response_body_for_content_types.ApiResponseFor200) | success - -#### post_anyof_complex_types_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AnyofComplexTypes**](../../models/AnyofComplexTypes.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_anyof_response_body_for_content_types** - -> Anyof post_anyof_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.anyof import Anyof -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_anyof_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_anyof_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_anyof_response_body_for_content_types.ApiResponseFor200) | success - -#### post_anyof_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**Anyof**](../../models/Anyof.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_anyof_with_base_schema_response_body_for_content_types** - -> AnyofWithBaseSchema post_anyof_with_base_schema_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.anyof_with_base_schema import AnyofWithBaseSchema -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_anyof_with_base_schema_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_anyof_with_base_schema_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_anyof_with_base_schema_response_body_for_content_types.ApiResponseFor200) | success - -#### post_anyof_with_base_schema_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AnyofWithBaseSchema**](../../models/AnyofWithBaseSchema.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_anyof_with_one_empty_schema_response_body_for_content_types** - -> AnyofWithOneEmptySchema post_anyof_with_one_empty_schema_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.anyof_with_one_empty_schema import AnyofWithOneEmptySchema -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_anyof_with_one_empty_schema_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_anyof_with_one_empty_schema_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_anyof_with_one_empty_schema_response_body_for_content_types.ApiResponseFor200) | success - -#### post_anyof_with_one_empty_schema_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AnyofWithOneEmptySchema**](../../models/AnyofWithOneEmptySchema.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_array_type_matches_arrays_response_body_for_content_types** - -> ArrayTypeMatchesArrays post_array_type_matches_arrays_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.array_type_matches_arrays import ArrayTypeMatchesArrays -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_array_type_matches_arrays_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_array_type_matches_arrays_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_array_type_matches_arrays_response_body_for_content_types.ApiResponseFor200) | success - -#### post_array_type_matches_arrays_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**ArrayTypeMatchesArrays**](../../models/ArrayTypeMatchesArrays.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_boolean_type_matches_booleans_response_body_for_content_types** - -> bool post_boolean_type_matches_booleans_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_boolean_type_matches_booleans_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_boolean_type_matches_booleans_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_boolean_type_matches_booleans_response_body_for_content_types.ApiResponseFor200) | success - -#### post_boolean_type_matches_booleans_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -bool, | BoolClass, | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_by_int_response_body_for_content_types** - -> ByInt post_by_int_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.by_int import ByInt -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_by_int_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_by_int_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_by_int_response_body_for_content_types.ApiResponseFor200) | success - -#### post_by_int_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**ByInt**](../../models/ByInt.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_by_number_response_body_for_content_types** - -> ByNumber post_by_number_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.by_number import ByNumber -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_by_number_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_by_number_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_by_number_response_body_for_content_types.ApiResponseFor200) | success - -#### post_by_number_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**ByNumber**](../../models/ByNumber.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_by_small_number_response_body_for_content_types** - -> BySmallNumber post_by_small_number_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.by_small_number import BySmallNumber -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_by_small_number_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_by_small_number_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_by_small_number_response_body_for_content_types.ApiResponseFor200) | success - -#### post_by_small_number_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**BySmallNumber**](../../models/BySmallNumber.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_date_time_format_response_body_for_content_types** - -> bool, date, datetime, dict, float, int, list, str, none_type post_date_time_format_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_date_time_format_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_date_time_format_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_date_time_format_response_body_for_content_types.ApiResponseFor200) | success - -#### post_date_time_format_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | value must conform to RFC-3339 date-time - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_email_format_response_body_for_content_types** - -> bool, date, datetime, dict, float, int, list, str, none_type post_email_format_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_email_format_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_email_format_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_email_format_response_body_for_content_types.ApiResponseFor200) | success - -#### post_email_format_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_enum_with0_does_not_match_false_response_body_for_content_types** - -> EnumWith0DoesNotMatchFalse post_enum_with0_does_not_match_false_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.enum_with0_does_not_match_false import EnumWith0DoesNotMatchFalse -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_enum_with0_does_not_match_false_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_enum_with0_does_not_match_false_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_enum_with0_does_not_match_false_response_body_for_content_types.ApiResponseFor200) | success - -#### post_enum_with0_does_not_match_false_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**EnumWith0DoesNotMatchFalse**](../../models/EnumWith0DoesNotMatchFalse.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_enum_with1_does_not_match_true_response_body_for_content_types** - -> EnumWith1DoesNotMatchTrue post_enum_with1_does_not_match_true_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.enum_with1_does_not_match_true import EnumWith1DoesNotMatchTrue -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_enum_with1_does_not_match_true_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_enum_with1_does_not_match_true_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_enum_with1_does_not_match_true_response_body_for_content_types.ApiResponseFor200) | success - -#### post_enum_with1_does_not_match_true_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**EnumWith1DoesNotMatchTrue**](../../models/EnumWith1DoesNotMatchTrue.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_enum_with_escaped_characters_response_body_for_content_types** - -> EnumWithEscapedCharacters post_enum_with_escaped_characters_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.enum_with_escaped_characters import EnumWithEscapedCharacters -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_enum_with_escaped_characters_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_enum_with_escaped_characters_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_enum_with_escaped_characters_response_body_for_content_types.ApiResponseFor200) | success - -#### post_enum_with_escaped_characters_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**EnumWithEscapedCharacters**](../../models/EnumWithEscapedCharacters.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_enum_with_false_does_not_match0_response_body_for_content_types** - -> EnumWithFalseDoesNotMatch0 post_enum_with_false_does_not_match0_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.enum_with_false_does_not_match0 import EnumWithFalseDoesNotMatch0 -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_enum_with_false_does_not_match0_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_enum_with_false_does_not_match0_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_enum_with_false_does_not_match0_response_body_for_content_types.ApiResponseFor200) | success - -#### post_enum_with_false_does_not_match0_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**EnumWithFalseDoesNotMatch0**](../../models/EnumWithFalseDoesNotMatch0.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_enum_with_true_does_not_match1_response_body_for_content_types** - -> EnumWithTrueDoesNotMatch1 post_enum_with_true_does_not_match1_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.enum_with_true_does_not_match1 import EnumWithTrueDoesNotMatch1 -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_enum_with_true_does_not_match1_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_enum_with_true_does_not_match1_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_enum_with_true_does_not_match1_response_body_for_content_types.ApiResponseFor200) | success - -#### post_enum_with_true_does_not_match1_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**EnumWithTrueDoesNotMatch1**](../../models/EnumWithTrueDoesNotMatch1.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_enums_in_properties_response_body_for_content_types** - -> EnumsInProperties post_enums_in_properties_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.enums_in_properties import EnumsInProperties -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_enums_in_properties_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_enums_in_properties_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_enums_in_properties_response_body_for_content_types.ApiResponseFor200) | success - -#### post_enums_in_properties_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**EnumsInProperties**](../../models/EnumsInProperties.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_forbidden_property_response_body_for_content_types** - -> ForbiddenProperty post_forbidden_property_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.forbidden_property import ForbiddenProperty -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_forbidden_property_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_forbidden_property_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_forbidden_property_response_body_for_content_types.ApiResponseFor200) | success - -#### post_forbidden_property_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**ForbiddenProperty**](../../models/ForbiddenProperty.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_hostname_format_response_body_for_content_types** - -> bool, date, datetime, dict, float, int, list, str, none_type post_hostname_format_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_hostname_format_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_hostname_format_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_hostname_format_response_body_for_content_types.ApiResponseFor200) | success - -#### post_hostname_format_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_integer_type_matches_integers_response_body_for_content_types** - -> int post_integer_type_matches_integers_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_integer_type_matches_integers_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_integer_type_matches_integers_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_integer_type_matches_integers_response_body_for_content_types.ApiResponseFor200) | success - -#### post_integer_type_matches_integers_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -decimal.Decimal, int, | decimal.Decimal, | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types** - -> InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.invalid_instance_should_not_raise_error_when_float_division_inf import InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types.ApiResponseFor200) | success - -#### post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf**](../../models/InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_invalid_string_value_for_default_response_body_for_content_types** - -> InvalidStringValueForDefault post_invalid_string_value_for_default_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.invalid_string_value_for_default import InvalidStringValueForDefault -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_invalid_string_value_for_default_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_invalid_string_value_for_default_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_invalid_string_value_for_default_response_body_for_content_types.ApiResponseFor200) | success - -#### post_invalid_string_value_for_default_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**InvalidStringValueForDefault**](../../models/InvalidStringValueForDefault.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ipv4_format_response_body_for_content_types** - -> bool, date, datetime, dict, float, int, list, str, none_type post_ipv4_format_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_ipv4_format_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_ipv4_format_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ipv4_format_response_body_for_content_types.ApiResponseFor200) | success - -#### post_ipv4_format_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ipv6_format_response_body_for_content_types** - -> bool, date, datetime, dict, float, int, list, str, none_type post_ipv6_format_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_ipv6_format_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_ipv6_format_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ipv6_format_response_body_for_content_types.ApiResponseFor200) | success - -#### post_ipv6_format_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_json_pointer_format_response_body_for_content_types** - -> bool, date, datetime, dict, float, int, list, str, none_type post_json_pointer_format_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_json_pointer_format_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_json_pointer_format_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_json_pointer_format_response_body_for_content_types.ApiResponseFor200) | success - -#### post_json_pointer_format_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_maximum_validation_response_body_for_content_types** - -> MaximumValidation post_maximum_validation_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.maximum_validation import MaximumValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_maximum_validation_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_maximum_validation_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_maximum_validation_response_body_for_content_types.ApiResponseFor200) | success - -#### post_maximum_validation_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MaximumValidation**](../../models/MaximumValidation.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_maximum_validation_with_unsigned_integer_response_body_for_content_types** - -> MaximumValidationWithUnsignedInteger post_maximum_validation_with_unsigned_integer_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.maximum_validation_with_unsigned_integer import MaximumValidationWithUnsignedInteger -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_maximum_validation_with_unsigned_integer_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_maximum_validation_with_unsigned_integer_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_maximum_validation_with_unsigned_integer_response_body_for_content_types.ApiResponseFor200) | success - -#### post_maximum_validation_with_unsigned_integer_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MaximumValidationWithUnsignedInteger**](../../models/MaximumValidationWithUnsignedInteger.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_maxitems_validation_response_body_for_content_types** - -> MaxitemsValidation post_maxitems_validation_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.maxitems_validation import MaxitemsValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_maxitems_validation_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_maxitems_validation_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_maxitems_validation_response_body_for_content_types.ApiResponseFor200) | success - -#### post_maxitems_validation_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MaxitemsValidation**](../../models/MaxitemsValidation.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_maxlength_validation_response_body_for_content_types** - -> MaxlengthValidation post_maxlength_validation_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.maxlength_validation import MaxlengthValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_maxlength_validation_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_maxlength_validation_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_maxlength_validation_response_body_for_content_types.ApiResponseFor200) | success - -#### post_maxlength_validation_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MaxlengthValidation**](../../models/MaxlengthValidation.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_maxproperties0_means_the_object_is_empty_response_body_for_content_types** - -> Maxproperties0MeansTheObjectIsEmpty post_maxproperties0_means_the_object_is_empty_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.maxproperties0_means_the_object_is_empty import Maxproperties0MeansTheObjectIsEmpty -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_maxproperties0_means_the_object_is_empty_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_maxproperties0_means_the_object_is_empty_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_maxproperties0_means_the_object_is_empty_response_body_for_content_types.ApiResponseFor200) | success - -#### post_maxproperties0_means_the_object_is_empty_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**Maxproperties0MeansTheObjectIsEmpty**](../../models/Maxproperties0MeansTheObjectIsEmpty.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_maxproperties_validation_response_body_for_content_types** - -> MaxpropertiesValidation post_maxproperties_validation_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.maxproperties_validation import MaxpropertiesValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_maxproperties_validation_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_maxproperties_validation_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_maxproperties_validation_response_body_for_content_types.ApiResponseFor200) | success - -#### post_maxproperties_validation_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MaxpropertiesValidation**](../../models/MaxpropertiesValidation.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_minimum_validation_response_body_for_content_types** - -> MinimumValidation post_minimum_validation_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.minimum_validation import MinimumValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_minimum_validation_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_minimum_validation_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_minimum_validation_response_body_for_content_types.ApiResponseFor200) | success - -#### post_minimum_validation_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MinimumValidation**](../../models/MinimumValidation.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_minimum_validation_with_signed_integer_response_body_for_content_types** - -> MinimumValidationWithSignedInteger post_minimum_validation_with_signed_integer_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.minimum_validation_with_signed_integer import MinimumValidationWithSignedInteger -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_minimum_validation_with_signed_integer_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_minimum_validation_with_signed_integer_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_minimum_validation_with_signed_integer_response_body_for_content_types.ApiResponseFor200) | success - -#### post_minimum_validation_with_signed_integer_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MinimumValidationWithSignedInteger**](../../models/MinimumValidationWithSignedInteger.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_minitems_validation_response_body_for_content_types** - -> MinitemsValidation post_minitems_validation_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.minitems_validation import MinitemsValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_minitems_validation_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_minitems_validation_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_minitems_validation_response_body_for_content_types.ApiResponseFor200) | success - -#### post_minitems_validation_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MinitemsValidation**](../../models/MinitemsValidation.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_minlength_validation_response_body_for_content_types** - -> MinlengthValidation post_minlength_validation_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.minlength_validation import MinlengthValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_minlength_validation_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_minlength_validation_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_minlength_validation_response_body_for_content_types.ApiResponseFor200) | success - -#### post_minlength_validation_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MinlengthValidation**](../../models/MinlengthValidation.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_minproperties_validation_response_body_for_content_types** - -> MinpropertiesValidation post_minproperties_validation_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.minproperties_validation import MinpropertiesValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_minproperties_validation_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_minproperties_validation_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_minproperties_validation_response_body_for_content_types.ApiResponseFor200) | success - -#### post_minproperties_validation_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**MinpropertiesValidation**](../../models/MinpropertiesValidation.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_nested_allof_to_check_validation_semantics_response_body_for_content_types** - -> NestedAllofToCheckValidationSemantics post_nested_allof_to_check_validation_semantics_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.nested_allof_to_check_validation_semantics import NestedAllofToCheckValidationSemantics -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_nested_allof_to_check_validation_semantics_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_nested_allof_to_check_validation_semantics_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_nested_allof_to_check_validation_semantics_response_body_for_content_types.ApiResponseFor200) | success - -#### post_nested_allof_to_check_validation_semantics_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**NestedAllofToCheckValidationSemantics**](../../models/NestedAllofToCheckValidationSemantics.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_nested_anyof_to_check_validation_semantics_response_body_for_content_types** - -> NestedAnyofToCheckValidationSemantics post_nested_anyof_to_check_validation_semantics_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.nested_anyof_to_check_validation_semantics import NestedAnyofToCheckValidationSemantics -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_nested_anyof_to_check_validation_semantics_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_nested_anyof_to_check_validation_semantics_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_nested_anyof_to_check_validation_semantics_response_body_for_content_types.ApiResponseFor200) | success - -#### post_nested_anyof_to_check_validation_semantics_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**NestedAnyofToCheckValidationSemantics**](../../models/NestedAnyofToCheckValidationSemantics.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_nested_items_response_body_for_content_types** - -> NestedItems post_nested_items_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.nested_items import NestedItems -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_nested_items_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_nested_items_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_nested_items_response_body_for_content_types.ApiResponseFor200) | success - -#### post_nested_items_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**NestedItems**](../../models/NestedItems.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_nested_oneof_to_check_validation_semantics_response_body_for_content_types** - -> NestedOneofToCheckValidationSemantics post_nested_oneof_to_check_validation_semantics_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.nested_oneof_to_check_validation_semantics import NestedOneofToCheckValidationSemantics -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_nested_oneof_to_check_validation_semantics_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_nested_oneof_to_check_validation_semantics_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_nested_oneof_to_check_validation_semantics_response_body_for_content_types.ApiResponseFor200) | success - -#### post_nested_oneof_to_check_validation_semantics_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**NestedOneofToCheckValidationSemantics**](../../models/NestedOneofToCheckValidationSemantics.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_not_more_complex_schema_response_body_for_content_types** - -> bool, date, datetime, dict, float, int, list, str, none_type post_not_more_complex_schema_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_not_more_complex_schema_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_not_more_complex_schema_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_not_more_complex_schema_response_body_for_content_types.ApiResponseFor200) | success - -#### post_not_more_complex_schema_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### not -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[not_schema](#not_schema) | dict, frozendict.frozendict, | frozendict.frozendict, | | - -# not_schema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**foo** | str, | str, | | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_not_response_body_for_content_types** - -> bool, date, datetime, dict, float, int, list, str, none_type post_not_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_not_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_not_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_not_response_body_for_content_types.ApiResponseFor200) | success - -#### post_not_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### not -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[not_schema](#not_schema) | decimal.Decimal, int, | decimal.Decimal, | | - -# not_schema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -decimal.Decimal, int, | decimal.Decimal, | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_nul_characters_in_strings_response_body_for_content_types** - -> NulCharactersInStrings post_nul_characters_in_strings_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.nul_characters_in_strings import NulCharactersInStrings -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_nul_characters_in_strings_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_nul_characters_in_strings_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_nul_characters_in_strings_response_body_for_content_types.ApiResponseFor200) | success - -#### post_nul_characters_in_strings_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**NulCharactersInStrings**](../../models/NulCharactersInStrings.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_null_type_matches_only_the_null_object_response_body_for_content_types** - -> none_type post_null_type_matches_only_the_null_object_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_null_type_matches_only_the_null_object_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_null_type_matches_only_the_null_object_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_null_type_matches_only_the_null_object_response_body_for_content_types.ApiResponseFor200) | success - -#### post_null_type_matches_only_the_null_object_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -None, | NoneClass, | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_number_type_matches_numbers_response_body_for_content_types** - -> int, float post_number_type_matches_numbers_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_number_type_matches_numbers_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_number_type_matches_numbers_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_number_type_matches_numbers_response_body_for_content_types.ApiResponseFor200) | success - -#### post_number_type_matches_numbers_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -decimal.Decimal, int, float, | decimal.Decimal, | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_object_properties_validation_response_body_for_content_types** - -> ObjectPropertiesValidation post_object_properties_validation_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.object_properties_validation import ObjectPropertiesValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_object_properties_validation_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_object_properties_validation_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_object_properties_validation_response_body_for_content_types.ApiResponseFor200) | success - -#### post_object_properties_validation_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**ObjectPropertiesValidation**](../../models/ObjectPropertiesValidation.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_object_type_matches_objects_response_body_for_content_types** - -> {str: (bool, date, datetime, dict, float, int, list, str, none_type)} post_object_type_matches_objects_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_object_type_matches_objects_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_object_type_matches_objects_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_object_type_matches_objects_response_body_for_content_types.ApiResponseFor200) | success - -#### post_object_type_matches_objects_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_oneof_complex_types_response_body_for_content_types** - -> OneofComplexTypes post_oneof_complex_types_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.oneof_complex_types import OneofComplexTypes -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_oneof_complex_types_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_oneof_complex_types_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_oneof_complex_types_response_body_for_content_types.ApiResponseFor200) | success - -#### post_oneof_complex_types_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**OneofComplexTypes**](../../models/OneofComplexTypes.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_oneof_response_body_for_content_types** - -> Oneof post_oneof_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.oneof import Oneof -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_oneof_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_oneof_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_oneof_response_body_for_content_types.ApiResponseFor200) | success - -#### post_oneof_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**Oneof**](../../models/Oneof.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_oneof_with_base_schema_response_body_for_content_types** - -> OneofWithBaseSchema post_oneof_with_base_schema_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.oneof_with_base_schema import OneofWithBaseSchema -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_oneof_with_base_schema_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_oneof_with_base_schema_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_oneof_with_base_schema_response_body_for_content_types.ApiResponseFor200) | success - -#### post_oneof_with_base_schema_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**OneofWithBaseSchema**](../../models/OneofWithBaseSchema.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_oneof_with_empty_schema_response_body_for_content_types** - -> OneofWithEmptySchema post_oneof_with_empty_schema_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.oneof_with_empty_schema import OneofWithEmptySchema -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_oneof_with_empty_schema_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_oneof_with_empty_schema_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_oneof_with_empty_schema_response_body_for_content_types.ApiResponseFor200) | success - -#### post_oneof_with_empty_schema_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**OneofWithEmptySchema**](../../models/OneofWithEmptySchema.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_oneof_with_required_response_body_for_content_types** - -> OneofWithRequired post_oneof_with_required_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.oneof_with_required import OneofWithRequired -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_oneof_with_required_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_oneof_with_required_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_oneof_with_required_response_body_for_content_types.ApiResponseFor200) | success - -#### post_oneof_with_required_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**OneofWithRequired**](../../models/OneofWithRequired.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_pattern_is_not_anchored_response_body_for_content_types** - -> PatternIsNotAnchored post_pattern_is_not_anchored_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.pattern_is_not_anchored import PatternIsNotAnchored -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_pattern_is_not_anchored_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_pattern_is_not_anchored_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_pattern_is_not_anchored_response_body_for_content_types.ApiResponseFor200) | success - -#### post_pattern_is_not_anchored_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**PatternIsNotAnchored**](../../models/PatternIsNotAnchored.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_pattern_validation_response_body_for_content_types** - -> PatternValidation post_pattern_validation_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.pattern_validation import PatternValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_pattern_validation_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_pattern_validation_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_pattern_validation_response_body_for_content_types.ApiResponseFor200) | success - -#### post_pattern_validation_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**PatternValidation**](../../models/PatternValidation.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_properties_with_escaped_characters_response_body_for_content_types** - -> PropertiesWithEscapedCharacters post_properties_with_escaped_characters_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.properties_with_escaped_characters import PropertiesWithEscapedCharacters -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_properties_with_escaped_characters_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_properties_with_escaped_characters_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_properties_with_escaped_characters_response_body_for_content_types.ApiResponseFor200) | success - -#### post_properties_with_escaped_characters_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**PropertiesWithEscapedCharacters**](../../models/PropertiesWithEscapedCharacters.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_property_named_ref_that_is_not_a_reference_response_body_for_content_types** - -> PropertyNamedRefThatIsNotAReference post_property_named_ref_that_is_not_a_reference_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.property_named_ref_that_is_not_a_reference import PropertyNamedRefThatIsNotAReference -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_property_named_ref_that_is_not_a_reference_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_property_named_ref_that_is_not_a_reference_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_property_named_ref_that_is_not_a_reference_response_body_for_content_types.ApiResponseFor200) | success - -#### post_property_named_ref_that_is_not_a_reference_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**PropertyNamedRefThatIsNotAReference**](../../models/PropertyNamedRefThatIsNotAReference.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ref_in_additionalproperties_response_body_for_content_types** - -> RefInAdditionalproperties post_ref_in_additionalproperties_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.ref_in_additionalproperties import RefInAdditionalproperties -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_ref_in_additionalproperties_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_ref_in_additionalproperties_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ref_in_additionalproperties_response_body_for_content_types.ApiResponseFor200) | success - -#### post_ref_in_additionalproperties_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RefInAdditionalproperties**](../../models/RefInAdditionalproperties.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ref_in_allof_response_body_for_content_types** - -> RefInAllof post_ref_in_allof_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.ref_in_allof import RefInAllof -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_ref_in_allof_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_ref_in_allof_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ref_in_allof_response_body_for_content_types.ApiResponseFor200) | success - -#### post_ref_in_allof_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RefInAllof**](../../models/RefInAllof.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ref_in_anyof_response_body_for_content_types** - -> RefInAnyof post_ref_in_anyof_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.ref_in_anyof import RefInAnyof -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_ref_in_anyof_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_ref_in_anyof_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ref_in_anyof_response_body_for_content_types.ApiResponseFor200) | success - -#### post_ref_in_anyof_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RefInAnyof**](../../models/RefInAnyof.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ref_in_items_response_body_for_content_types** - -> RefInItems post_ref_in_items_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.ref_in_items import RefInItems -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_ref_in_items_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_ref_in_items_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ref_in_items_response_body_for_content_types.ApiResponseFor200) | success - -#### post_ref_in_items_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RefInItems**](../../models/RefInItems.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ref_in_not_response_body_for_content_types** - -> bool, date, datetime, dict, float, int, list, str, none_type post_ref_in_not_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.property_named_ref_that_is_not_a_reference import PropertyNamedRefThatIsNotAReference -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_ref_in_not_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_ref_in_not_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ref_in_not_response_body_for_content_types.ApiResponseFor200) | success - -#### post_ref_in_not_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### not -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[PropertyNamedRefThatIsNotAReference]({{complexTypePrefix}}PropertyNamedRefThatIsNotAReference.md) | [**PropertyNamedRefThatIsNotAReference**]({{complexTypePrefix}}PropertyNamedRefThatIsNotAReference.md) | [**PropertyNamedRefThatIsNotAReference**]({{complexTypePrefix}}PropertyNamedRefThatIsNotAReference.md) | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ref_in_oneof_response_body_for_content_types** - -> RefInOneof post_ref_in_oneof_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.ref_in_oneof import RefInOneof -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_ref_in_oneof_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_ref_in_oneof_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ref_in_oneof_response_body_for_content_types.ApiResponseFor200) | success - -#### post_ref_in_oneof_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RefInOneof**](../../models/RefInOneof.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_ref_in_property_response_body_for_content_types** - -> RefInProperty post_ref_in_property_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.ref_in_property import RefInProperty -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_ref_in_property_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_ref_in_property_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_ref_in_property_response_body_for_content_types.ApiResponseFor200) | success - -#### post_ref_in_property_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RefInProperty**](../../models/RefInProperty.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_required_default_validation_response_body_for_content_types** - -> RequiredDefaultValidation post_required_default_validation_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.required_default_validation import RequiredDefaultValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_required_default_validation_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_required_default_validation_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_required_default_validation_response_body_for_content_types.ApiResponseFor200) | success - -#### post_required_default_validation_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RequiredDefaultValidation**](../../models/RequiredDefaultValidation.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_required_validation_response_body_for_content_types** - -> RequiredValidation post_required_validation_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.required_validation import RequiredValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_required_validation_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_required_validation_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_required_validation_response_body_for_content_types.ApiResponseFor200) | success - -#### post_required_validation_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RequiredValidation**](../../models/RequiredValidation.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_required_with_empty_array_response_body_for_content_types** - -> RequiredWithEmptyArray post_required_with_empty_array_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.required_with_empty_array import RequiredWithEmptyArray -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_required_with_empty_array_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_required_with_empty_array_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_required_with_empty_array_response_body_for_content_types.ApiResponseFor200) | success - -#### post_required_with_empty_array_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**RequiredWithEmptyArray**](../../models/RequiredWithEmptyArray.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_required_with_escaped_characters_response_body_for_content_types** - -> bool, date, datetime, dict, float, int, list, str, none_type post_required_with_escaped_characters_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_required_with_escaped_characters_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_required_with_escaped_characters_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_required_with_escaped_characters_response_body_for_content_types.ApiResponseFor200) | success - -#### post_required_with_escaped_characters_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_simple_enum_validation_response_body_for_content_types** - -> SimpleEnumValidation post_simple_enum_validation_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.simple_enum_validation import SimpleEnumValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_simple_enum_validation_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_simple_enum_validation_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_simple_enum_validation_response_body_for_content_types.ApiResponseFor200) | success - -#### post_simple_enum_validation_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**SimpleEnumValidation**](../../models/SimpleEnumValidation.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_string_type_matches_strings_response_body_for_content_types** - -> str post_string_type_matches_strings_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_string_type_matches_strings_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_string_type_matches_strings_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_string_type_matches_strings_response_body_for_content_types.ApiResponseFor200) | success - -#### post_string_type_matches_strings_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types** - -> TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.the_default_keyword_does_not_do_anything_if_the_property_is_missing import TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types.ApiResponseFor200) | success - -#### post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing**](../../models/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_uniqueitems_false_validation_response_body_for_content_types** - -> UniqueitemsFalseValidation post_uniqueitems_false_validation_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.uniqueitems_false_validation import UniqueitemsFalseValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_uniqueitems_false_validation_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_uniqueitems_false_validation_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_uniqueitems_false_validation_response_body_for_content_types.ApiResponseFor200) | success - -#### post_uniqueitems_false_validation_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**UniqueitemsFalseValidation**](../../models/UniqueitemsFalseValidation.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_uniqueitems_validation_response_body_for_content_types** - -> UniqueitemsValidation post_uniqueitems_validation_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from unit_test_api.model.uniqueitems_validation import UniqueitemsValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_uniqueitems_validation_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_uniqueitems_validation_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_uniqueitems_validation_response_body_for_content_types.ApiResponseFor200) | success - -#### post_uniqueitems_validation_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**UniqueitemsValidation**](../../models/UniqueitemsValidation.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_uri_format_response_body_for_content_types** - -> bool, date, datetime, dict, float, int, list, str, none_type post_uri_format_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_uri_format_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_uri_format_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_uri_format_response_body_for_content_types.ApiResponseFor200) | success - -#### post_uri_format_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_uri_reference_format_response_body_for_content_types** - -> bool, date, datetime, dict, float, int, list, str, none_type post_uri_reference_format_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_uri_reference_format_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_uri_reference_format_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_uri_reference_format_response_body_for_content_types.ApiResponseFor200) | success - -#### post_uri_reference_format_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_uri_template_format_response_body_for_content_types** - -> bool, date, datetime, dict, float, int, list, str, none_type post_uri_template_format_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import response_content_content_type_schema_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_uri_template_format_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling ResponseContentContentTypeSchemaApi->post_uri_template_format_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_uri_template_format_response_body_for_content_types.ApiResponseFor200) | success - -#### post_uri_template_format_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - +[**post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types**](response_content_content_type_schema_api/post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types.md) | **post** /responseBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateResponseBodyForContentTypes | +[**post_additionalproperties_are_allowed_by_default_response_body_for_content_types**](response_content_content_type_schema_api/post_additionalproperties_are_allowed_by_default_response_body_for_content_types.md) | **post** /responseBody/postAdditionalpropertiesAreAllowedByDefaultResponseBodyForContentTypes | +[**post_additionalproperties_can_exist_by_itself_response_body_for_content_types**](response_content_content_type_schema_api/post_additionalproperties_can_exist_by_itself_response_body_for_content_types.md) | **post** /responseBody/postAdditionalpropertiesCanExistByItselfResponseBodyForContentTypes | +[**post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types**](response_content_content_type_schema_api/post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types.md) | **post** /responseBody/postAdditionalpropertiesShouldNotLookInApplicatorsResponseBodyForContentTypes | +[**post_allof_combined_with_anyof_oneof_response_body_for_content_types**](response_content_content_type_schema_api/post_allof_combined_with_anyof_oneof_response_body_for_content_types.md) | **post** /responseBody/postAllofCombinedWithAnyofOneofResponseBodyForContentTypes | +[**post_allof_response_body_for_content_types**](response_content_content_type_schema_api/post_allof_response_body_for_content_types.md) | **post** /responseBody/postAllofResponseBodyForContentTypes | +[**post_allof_simple_types_response_body_for_content_types**](response_content_content_type_schema_api/post_allof_simple_types_response_body_for_content_types.md) | **post** /responseBody/postAllofSimpleTypesResponseBodyForContentTypes | +[**post_allof_with_base_schema_response_body_for_content_types**](response_content_content_type_schema_api/post_allof_with_base_schema_response_body_for_content_types.md) | **post** /responseBody/postAllofWithBaseSchemaResponseBodyForContentTypes | +[**post_allof_with_one_empty_schema_response_body_for_content_types**](response_content_content_type_schema_api/post_allof_with_one_empty_schema_response_body_for_content_types.md) | **post** /responseBody/postAllofWithOneEmptySchemaResponseBodyForContentTypes | +[**post_allof_with_the_first_empty_schema_response_body_for_content_types**](response_content_content_type_schema_api/post_allof_with_the_first_empty_schema_response_body_for_content_types.md) | **post** /responseBody/postAllofWithTheFirstEmptySchemaResponseBodyForContentTypes | +[**post_allof_with_the_last_empty_schema_response_body_for_content_types**](response_content_content_type_schema_api/post_allof_with_the_last_empty_schema_response_body_for_content_types.md) | **post** /responseBody/postAllofWithTheLastEmptySchemaResponseBodyForContentTypes | +[**post_allof_with_two_empty_schemas_response_body_for_content_types**](response_content_content_type_schema_api/post_allof_with_two_empty_schemas_response_body_for_content_types.md) | **post** /responseBody/postAllofWithTwoEmptySchemasResponseBodyForContentTypes | +[**post_anyof_complex_types_response_body_for_content_types**](response_content_content_type_schema_api/post_anyof_complex_types_response_body_for_content_types.md) | **post** /responseBody/postAnyofComplexTypesResponseBodyForContentTypes | +[**post_anyof_response_body_for_content_types**](response_content_content_type_schema_api/post_anyof_response_body_for_content_types.md) | **post** /responseBody/postAnyofResponseBodyForContentTypes | +[**post_anyof_with_base_schema_response_body_for_content_types**](response_content_content_type_schema_api/post_anyof_with_base_schema_response_body_for_content_types.md) | **post** /responseBody/postAnyofWithBaseSchemaResponseBodyForContentTypes | +[**post_anyof_with_one_empty_schema_response_body_for_content_types**](response_content_content_type_schema_api/post_anyof_with_one_empty_schema_response_body_for_content_types.md) | **post** /responseBody/postAnyofWithOneEmptySchemaResponseBodyForContentTypes | +[**post_array_type_matches_arrays_response_body_for_content_types**](response_content_content_type_schema_api/post_array_type_matches_arrays_response_body_for_content_types.md) | **post** /responseBody/postArrayTypeMatchesArraysResponseBodyForContentTypes | +[**post_boolean_type_matches_booleans_response_body_for_content_types**](response_content_content_type_schema_api/post_boolean_type_matches_booleans_response_body_for_content_types.md) | **post** /responseBody/postBooleanTypeMatchesBooleansResponseBodyForContentTypes | +[**post_by_int_response_body_for_content_types**](response_content_content_type_schema_api/post_by_int_response_body_for_content_types.md) | **post** /responseBody/postByIntResponseBodyForContentTypes | +[**post_by_number_response_body_for_content_types**](response_content_content_type_schema_api/post_by_number_response_body_for_content_types.md) | **post** /responseBody/postByNumberResponseBodyForContentTypes | +[**post_by_small_number_response_body_for_content_types**](response_content_content_type_schema_api/post_by_small_number_response_body_for_content_types.md) | **post** /responseBody/postBySmallNumberResponseBodyForContentTypes | +[**post_date_time_format_response_body_for_content_types**](response_content_content_type_schema_api/post_date_time_format_response_body_for_content_types.md) | **post** /responseBody/postDateTimeFormatResponseBodyForContentTypes | +[**post_email_format_response_body_for_content_types**](response_content_content_type_schema_api/post_email_format_response_body_for_content_types.md) | **post** /responseBody/postEmailFormatResponseBodyForContentTypes | +[**post_enum_with0_does_not_match_false_response_body_for_content_types**](response_content_content_type_schema_api/post_enum_with0_does_not_match_false_response_body_for_content_types.md) | **post** /responseBody/postEnumWith0DoesNotMatchFalseResponseBodyForContentTypes | +[**post_enum_with1_does_not_match_true_response_body_for_content_types**](response_content_content_type_schema_api/post_enum_with1_does_not_match_true_response_body_for_content_types.md) | **post** /responseBody/postEnumWith1DoesNotMatchTrueResponseBodyForContentTypes | +[**post_enum_with_escaped_characters_response_body_for_content_types**](response_content_content_type_schema_api/post_enum_with_escaped_characters_response_body_for_content_types.md) | **post** /responseBody/postEnumWithEscapedCharactersResponseBodyForContentTypes | +[**post_enum_with_false_does_not_match0_response_body_for_content_types**](response_content_content_type_schema_api/post_enum_with_false_does_not_match0_response_body_for_content_types.md) | **post** /responseBody/postEnumWithFalseDoesNotMatch0ResponseBodyForContentTypes | +[**post_enum_with_true_does_not_match1_response_body_for_content_types**](response_content_content_type_schema_api/post_enum_with_true_does_not_match1_response_body_for_content_types.md) | **post** /responseBody/postEnumWithTrueDoesNotMatch1ResponseBodyForContentTypes | +[**post_enums_in_properties_response_body_for_content_types**](response_content_content_type_schema_api/post_enums_in_properties_response_body_for_content_types.md) | **post** /responseBody/postEnumsInPropertiesResponseBodyForContentTypes | +[**post_forbidden_property_response_body_for_content_types**](response_content_content_type_schema_api/post_forbidden_property_response_body_for_content_types.md) | **post** /responseBody/postForbiddenPropertyResponseBodyForContentTypes | +[**post_hostname_format_response_body_for_content_types**](response_content_content_type_schema_api/post_hostname_format_response_body_for_content_types.md) | **post** /responseBody/postHostnameFormatResponseBodyForContentTypes | +[**post_integer_type_matches_integers_response_body_for_content_types**](response_content_content_type_schema_api/post_integer_type_matches_integers_response_body_for_content_types.md) | **post** /responseBody/postIntegerTypeMatchesIntegersResponseBodyForContentTypes | +[**post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types**](response_content_content_type_schema_api/post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types.md) | **post** /responseBody/postInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfResponseBodyForContentTypes | +[**post_invalid_string_value_for_default_response_body_for_content_types**](response_content_content_type_schema_api/post_invalid_string_value_for_default_response_body_for_content_types.md) | **post** /responseBody/postInvalidStringValueForDefaultResponseBodyForContentTypes | +[**post_ipv4_format_response_body_for_content_types**](response_content_content_type_schema_api/post_ipv4_format_response_body_for_content_types.md) | **post** /responseBody/postIpv4FormatResponseBodyForContentTypes | +[**post_ipv6_format_response_body_for_content_types**](response_content_content_type_schema_api/post_ipv6_format_response_body_for_content_types.md) | **post** /responseBody/postIpv6FormatResponseBodyForContentTypes | +[**post_json_pointer_format_response_body_for_content_types**](response_content_content_type_schema_api/post_json_pointer_format_response_body_for_content_types.md) | **post** /responseBody/postJsonPointerFormatResponseBodyForContentTypes | +[**post_maximum_validation_response_body_for_content_types**](response_content_content_type_schema_api/post_maximum_validation_response_body_for_content_types.md) | **post** /responseBody/postMaximumValidationResponseBodyForContentTypes | +[**post_maximum_validation_with_unsigned_integer_response_body_for_content_types**](response_content_content_type_schema_api/post_maximum_validation_with_unsigned_integer_response_body_for_content_types.md) | **post** /responseBody/postMaximumValidationWithUnsignedIntegerResponseBodyForContentTypes | +[**post_maxitems_validation_response_body_for_content_types**](response_content_content_type_schema_api/post_maxitems_validation_response_body_for_content_types.md) | **post** /responseBody/postMaxitemsValidationResponseBodyForContentTypes | +[**post_maxlength_validation_response_body_for_content_types**](response_content_content_type_schema_api/post_maxlength_validation_response_body_for_content_types.md) | **post** /responseBody/postMaxlengthValidationResponseBodyForContentTypes | +[**post_maxproperties0_means_the_object_is_empty_response_body_for_content_types**](response_content_content_type_schema_api/post_maxproperties0_means_the_object_is_empty_response_body_for_content_types.md) | **post** /responseBody/postMaxproperties0MeansTheObjectIsEmptyResponseBodyForContentTypes | +[**post_maxproperties_validation_response_body_for_content_types**](response_content_content_type_schema_api/post_maxproperties_validation_response_body_for_content_types.md) | **post** /responseBody/postMaxpropertiesValidationResponseBodyForContentTypes | +[**post_minimum_validation_response_body_for_content_types**](response_content_content_type_schema_api/post_minimum_validation_response_body_for_content_types.md) | **post** /responseBody/postMinimumValidationResponseBodyForContentTypes | +[**post_minimum_validation_with_signed_integer_response_body_for_content_types**](response_content_content_type_schema_api/post_minimum_validation_with_signed_integer_response_body_for_content_types.md) | **post** /responseBody/postMinimumValidationWithSignedIntegerResponseBodyForContentTypes | +[**post_minitems_validation_response_body_for_content_types**](response_content_content_type_schema_api/post_minitems_validation_response_body_for_content_types.md) | **post** /responseBody/postMinitemsValidationResponseBodyForContentTypes | +[**post_minlength_validation_response_body_for_content_types**](response_content_content_type_schema_api/post_minlength_validation_response_body_for_content_types.md) | **post** /responseBody/postMinlengthValidationResponseBodyForContentTypes | +[**post_minproperties_validation_response_body_for_content_types**](response_content_content_type_schema_api/post_minproperties_validation_response_body_for_content_types.md) | **post** /responseBody/postMinpropertiesValidationResponseBodyForContentTypes | +[**post_nested_allof_to_check_validation_semantics_response_body_for_content_types**](response_content_content_type_schema_api/post_nested_allof_to_check_validation_semantics_response_body_for_content_types.md) | **post** /responseBody/postNestedAllofToCheckValidationSemanticsResponseBodyForContentTypes | +[**post_nested_anyof_to_check_validation_semantics_response_body_for_content_types**](response_content_content_type_schema_api/post_nested_anyof_to_check_validation_semantics_response_body_for_content_types.md) | **post** /responseBody/postNestedAnyofToCheckValidationSemanticsResponseBodyForContentTypes | +[**post_nested_items_response_body_for_content_types**](response_content_content_type_schema_api/post_nested_items_response_body_for_content_types.md) | **post** /responseBody/postNestedItemsResponseBodyForContentTypes | +[**post_nested_oneof_to_check_validation_semantics_response_body_for_content_types**](response_content_content_type_schema_api/post_nested_oneof_to_check_validation_semantics_response_body_for_content_types.md) | **post** /responseBody/postNestedOneofToCheckValidationSemanticsResponseBodyForContentTypes | +[**post_not_more_complex_schema_response_body_for_content_types**](response_content_content_type_schema_api/post_not_more_complex_schema_response_body_for_content_types.md) | **post** /responseBody/postNotMoreComplexSchemaResponseBodyForContentTypes | +[**post_not_response_body_for_content_types**](response_content_content_type_schema_api/post_not_response_body_for_content_types.md) | **post** /responseBody/postNotResponseBodyForContentTypes | +[**post_nul_characters_in_strings_response_body_for_content_types**](response_content_content_type_schema_api/post_nul_characters_in_strings_response_body_for_content_types.md) | **post** /responseBody/postNulCharactersInStringsResponseBodyForContentTypes | +[**post_null_type_matches_only_the_null_object_response_body_for_content_types**](response_content_content_type_schema_api/post_null_type_matches_only_the_null_object_response_body_for_content_types.md) | **post** /responseBody/postNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes | +[**post_number_type_matches_numbers_response_body_for_content_types**](response_content_content_type_schema_api/post_number_type_matches_numbers_response_body_for_content_types.md) | **post** /responseBody/postNumberTypeMatchesNumbersResponseBodyForContentTypes | +[**post_object_properties_validation_response_body_for_content_types**](response_content_content_type_schema_api/post_object_properties_validation_response_body_for_content_types.md) | **post** /responseBody/postObjectPropertiesValidationResponseBodyForContentTypes | +[**post_object_type_matches_objects_response_body_for_content_types**](response_content_content_type_schema_api/post_object_type_matches_objects_response_body_for_content_types.md) | **post** /responseBody/postObjectTypeMatchesObjectsResponseBodyForContentTypes | +[**post_oneof_complex_types_response_body_for_content_types**](response_content_content_type_schema_api/post_oneof_complex_types_response_body_for_content_types.md) | **post** /responseBody/postOneofComplexTypesResponseBodyForContentTypes | +[**post_oneof_response_body_for_content_types**](response_content_content_type_schema_api/post_oneof_response_body_for_content_types.md) | **post** /responseBody/postOneofResponseBodyForContentTypes | +[**post_oneof_with_base_schema_response_body_for_content_types**](response_content_content_type_schema_api/post_oneof_with_base_schema_response_body_for_content_types.md) | **post** /responseBody/postOneofWithBaseSchemaResponseBodyForContentTypes | +[**post_oneof_with_empty_schema_response_body_for_content_types**](response_content_content_type_schema_api/post_oneof_with_empty_schema_response_body_for_content_types.md) | **post** /responseBody/postOneofWithEmptySchemaResponseBodyForContentTypes | +[**post_oneof_with_required_response_body_for_content_types**](response_content_content_type_schema_api/post_oneof_with_required_response_body_for_content_types.md) | **post** /responseBody/postOneofWithRequiredResponseBodyForContentTypes | +[**post_pattern_is_not_anchored_response_body_for_content_types**](response_content_content_type_schema_api/post_pattern_is_not_anchored_response_body_for_content_types.md) | **post** /responseBody/postPatternIsNotAnchoredResponseBodyForContentTypes | +[**post_pattern_validation_response_body_for_content_types**](response_content_content_type_schema_api/post_pattern_validation_response_body_for_content_types.md) | **post** /responseBody/postPatternValidationResponseBodyForContentTypes | +[**post_properties_with_escaped_characters_response_body_for_content_types**](response_content_content_type_schema_api/post_properties_with_escaped_characters_response_body_for_content_types.md) | **post** /responseBody/postPropertiesWithEscapedCharactersResponseBodyForContentTypes | +[**post_property_named_ref_that_is_not_a_reference_response_body_for_content_types**](response_content_content_type_schema_api/post_property_named_ref_that_is_not_a_reference_response_body_for_content_types.md) | **post** /responseBody/postPropertyNamedRefThatIsNotAReferenceResponseBodyForContentTypes | +[**post_ref_in_additionalproperties_response_body_for_content_types**](response_content_content_type_schema_api/post_ref_in_additionalproperties_response_body_for_content_types.md) | **post** /responseBody/postRefInAdditionalpropertiesResponseBodyForContentTypes | +[**post_ref_in_allof_response_body_for_content_types**](response_content_content_type_schema_api/post_ref_in_allof_response_body_for_content_types.md) | **post** /responseBody/postRefInAllofResponseBodyForContentTypes | +[**post_ref_in_anyof_response_body_for_content_types**](response_content_content_type_schema_api/post_ref_in_anyof_response_body_for_content_types.md) | **post** /responseBody/postRefInAnyofResponseBodyForContentTypes | +[**post_ref_in_items_response_body_for_content_types**](response_content_content_type_schema_api/post_ref_in_items_response_body_for_content_types.md) | **post** /responseBody/postRefInItemsResponseBodyForContentTypes | +[**post_ref_in_not_response_body_for_content_types**](response_content_content_type_schema_api/post_ref_in_not_response_body_for_content_types.md) | **post** /responseBody/postRefInNotResponseBodyForContentTypes | +[**post_ref_in_oneof_response_body_for_content_types**](response_content_content_type_schema_api/post_ref_in_oneof_response_body_for_content_types.md) | **post** /responseBody/postRefInOneofResponseBodyForContentTypes | +[**post_ref_in_property_response_body_for_content_types**](response_content_content_type_schema_api/post_ref_in_property_response_body_for_content_types.md) | **post** /responseBody/postRefInPropertyResponseBodyForContentTypes | +[**post_required_default_validation_response_body_for_content_types**](response_content_content_type_schema_api/post_required_default_validation_response_body_for_content_types.md) | **post** /responseBody/postRequiredDefaultValidationResponseBodyForContentTypes | +[**post_required_validation_response_body_for_content_types**](response_content_content_type_schema_api/post_required_validation_response_body_for_content_types.md) | **post** /responseBody/postRequiredValidationResponseBodyForContentTypes | +[**post_required_with_empty_array_response_body_for_content_types**](response_content_content_type_schema_api/post_required_with_empty_array_response_body_for_content_types.md) | **post** /responseBody/postRequiredWithEmptyArrayResponseBodyForContentTypes | +[**post_required_with_escaped_characters_response_body_for_content_types**](response_content_content_type_schema_api/post_required_with_escaped_characters_response_body_for_content_types.md) | **post** /responseBody/postRequiredWithEscapedCharactersResponseBodyForContentTypes | +[**post_simple_enum_validation_response_body_for_content_types**](response_content_content_type_schema_api/post_simple_enum_validation_response_body_for_content_types.md) | **post** /responseBody/postSimpleEnumValidationResponseBodyForContentTypes | +[**post_string_type_matches_strings_response_body_for_content_types**](response_content_content_type_schema_api/post_string_type_matches_strings_response_body_for_content_types.md) | **post** /responseBody/postStringTypeMatchesStringsResponseBodyForContentTypes | +[**post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types**](response_content_content_type_schema_api/post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types.md) | **post** /responseBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyForContentTypes | +[**post_uniqueitems_false_validation_response_body_for_content_types**](response_content_content_type_schema_api/post_uniqueitems_false_validation_response_body_for_content_types.md) | **post** /responseBody/postUniqueitemsFalseValidationResponseBodyForContentTypes | +[**post_uniqueitems_validation_response_body_for_content_types**](response_content_content_type_schema_api/post_uniqueitems_validation_response_body_for_content_types.md) | **post** /responseBody/postUniqueitemsValidationResponseBodyForContentTypes | +[**post_uri_format_response_body_for_content_types**](response_content_content_type_schema_api/post_uri_format_response_body_for_content_types.md) | **post** /responseBody/postUriFormatResponseBodyForContentTypes | +[**post_uri_reference_format_response_body_for_content_types**](response_content_content_type_schema_api/post_uri_reference_format_response_body_for_content_types.md) | **post** /responseBody/postUriReferenceFormatResponseBodyForContentTypes | +[**post_uri_template_format_response_body_for_content_types**](response_content_content_type_schema_api/post_uri_template_format_response_body_for_content_types.md) | **post** /responseBody/postUriTemplateFormatResponseBodyForContentTypes | + +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/TypeApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/TypeApi.md index f3f2d1bebda..15bb0590364 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/TypeApi.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/TypeApi.md @@ -1,941 +1,23 @@ - + # unit_test_api.apis.tags.type_api.TypeApi All URIs are relative to *https://someserver.com/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**post_array_type_matches_arrays_request_body**](#post_array_type_matches_arrays_request_body) | **post** /requestBody/postArrayTypeMatchesArraysRequestBody | -[**post_array_type_matches_arrays_response_body_for_content_types**](#post_array_type_matches_arrays_response_body_for_content_types) | **post** /responseBody/postArrayTypeMatchesArraysResponseBodyForContentTypes | -[**post_boolean_type_matches_booleans_request_body**](#post_boolean_type_matches_booleans_request_body) | **post** /requestBody/postBooleanTypeMatchesBooleansRequestBody | -[**post_boolean_type_matches_booleans_response_body_for_content_types**](#post_boolean_type_matches_booleans_response_body_for_content_types) | **post** /responseBody/postBooleanTypeMatchesBooleansResponseBodyForContentTypes | -[**post_integer_type_matches_integers_request_body**](#post_integer_type_matches_integers_request_body) | **post** /requestBody/postIntegerTypeMatchesIntegersRequestBody | -[**post_integer_type_matches_integers_response_body_for_content_types**](#post_integer_type_matches_integers_response_body_for_content_types) | **post** /responseBody/postIntegerTypeMatchesIntegersResponseBodyForContentTypes | -[**post_null_type_matches_only_the_null_object_request_body**](#post_null_type_matches_only_the_null_object_request_body) | **post** /requestBody/postNullTypeMatchesOnlyTheNullObjectRequestBody | -[**post_null_type_matches_only_the_null_object_response_body_for_content_types**](#post_null_type_matches_only_the_null_object_response_body_for_content_types) | **post** /responseBody/postNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes | -[**post_number_type_matches_numbers_request_body**](#post_number_type_matches_numbers_request_body) | **post** /requestBody/postNumberTypeMatchesNumbersRequestBody | -[**post_number_type_matches_numbers_response_body_for_content_types**](#post_number_type_matches_numbers_response_body_for_content_types) | **post** /responseBody/postNumberTypeMatchesNumbersResponseBodyForContentTypes | -[**post_object_type_matches_objects_request_body**](#post_object_type_matches_objects_request_body) | **post** /requestBody/postObjectTypeMatchesObjectsRequestBody | -[**post_object_type_matches_objects_response_body_for_content_types**](#post_object_type_matches_objects_response_body_for_content_types) | **post** /responseBody/postObjectTypeMatchesObjectsResponseBodyForContentTypes | -[**post_string_type_matches_strings_request_body**](#post_string_type_matches_strings_request_body) | **post** /requestBody/postStringTypeMatchesStringsRequestBody | -[**post_string_type_matches_strings_response_body_for_content_types**](#post_string_type_matches_strings_response_body_for_content_types) | **post** /responseBody/postStringTypeMatchesStringsResponseBodyForContentTypes | - -# **post_array_type_matches_arrays_request_body** - -> post_array_type_matches_arrays_request_body(array_type_matches_arrays) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import type_api -from unit_test_api.model.array_type_matches_arrays import ArrayTypeMatchesArrays -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = type_api.TypeApi(api_client) - - # example passing only required values which don't have defaults set - body = ArrayTypeMatchesArrays([ - None - ]) - try: - api_response = api_instance.post_array_type_matches_arrays_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling TypeApi->post_array_type_matches_arrays_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**ArrayTypeMatchesArrays**](../../models/ArrayTypeMatchesArrays.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_array_type_matches_arrays_request_body.ApiResponseFor200) | success - -#### post_array_type_matches_arrays_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_array_type_matches_arrays_response_body_for_content_types** - -> ArrayTypeMatchesArrays post_array_type_matches_arrays_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import type_api -from unit_test_api.model.array_type_matches_arrays import ArrayTypeMatchesArrays -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = type_api.TypeApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_array_type_matches_arrays_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling TypeApi->post_array_type_matches_arrays_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_array_type_matches_arrays_response_body_for_content_types.ApiResponseFor200) | success - -#### post_array_type_matches_arrays_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**ArrayTypeMatchesArrays**](../../models/ArrayTypeMatchesArrays.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_boolean_type_matches_booleans_request_body** - -> post_boolean_type_matches_booleans_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import type_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = type_api.TypeApi(api_client) - - # example passing only required values which don't have defaults set - body = True - try: - api_response = api_instance.post_boolean_type_matches_booleans_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling TypeApi->post_boolean_type_matches_booleans_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -bool, | BoolClass, | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_boolean_type_matches_booleans_request_body.ApiResponseFor200) | success - -#### post_boolean_type_matches_booleans_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_boolean_type_matches_booleans_response_body_for_content_types** - -> bool post_boolean_type_matches_booleans_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import type_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = type_api.TypeApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_boolean_type_matches_booleans_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling TypeApi->post_boolean_type_matches_booleans_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_boolean_type_matches_booleans_response_body_for_content_types.ApiResponseFor200) | success - -#### post_boolean_type_matches_booleans_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -bool, | BoolClass, | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_integer_type_matches_integers_request_body** - -> post_integer_type_matches_integers_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import type_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = type_api.TypeApi(api_client) - - # example passing only required values which don't have defaults set - body = 1 - try: - api_response = api_instance.post_integer_type_matches_integers_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling TypeApi->post_integer_type_matches_integers_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -decimal.Decimal, int, | decimal.Decimal, | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_integer_type_matches_integers_request_body.ApiResponseFor200) | success - -#### post_integer_type_matches_integers_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_integer_type_matches_integers_response_body_for_content_types** - -> int post_integer_type_matches_integers_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import type_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = type_api.TypeApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_integer_type_matches_integers_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling TypeApi->post_integer_type_matches_integers_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_integer_type_matches_integers_response_body_for_content_types.ApiResponseFor200) | success - -#### post_integer_type_matches_integers_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -decimal.Decimal, int, | decimal.Decimal, | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_null_type_matches_only_the_null_object_request_body** - -> post_null_type_matches_only_the_null_object_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import type_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = type_api.TypeApi(api_client) - - # example passing only required values which don't have defaults set - body = None - try: - api_response = api_instance.post_null_type_matches_only_the_null_object_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling TypeApi->post_null_type_matches_only_the_null_object_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -None, | NoneClass, | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_null_type_matches_only_the_null_object_request_body.ApiResponseFor200) | success - -#### post_null_type_matches_only_the_null_object_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_null_type_matches_only_the_null_object_response_body_for_content_types** - -> none_type post_null_type_matches_only_the_null_object_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import type_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = type_api.TypeApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_null_type_matches_only_the_null_object_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling TypeApi->post_null_type_matches_only_the_null_object_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_null_type_matches_only_the_null_object_response_body_for_content_types.ApiResponseFor200) | success - -#### post_null_type_matches_only_the_null_object_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -None, | NoneClass, | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_number_type_matches_numbers_request_body** - -> post_number_type_matches_numbers_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import type_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = type_api.TypeApi(api_client) - - # example passing only required values which don't have defaults set - body = 3.14 - try: - api_response = api_instance.post_number_type_matches_numbers_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling TypeApi->post_number_type_matches_numbers_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -decimal.Decimal, int, float, | decimal.Decimal, | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_number_type_matches_numbers_request_body.ApiResponseFor200) | success - -#### post_number_type_matches_numbers_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_number_type_matches_numbers_response_body_for_content_types** - -> int, float post_number_type_matches_numbers_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import type_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = type_api.TypeApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_number_type_matches_numbers_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling TypeApi->post_number_type_matches_numbers_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_number_type_matches_numbers_response_body_for_content_types.ApiResponseFor200) | success - -#### post_number_type_matches_numbers_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -decimal.Decimal, int, float, | decimal.Decimal, | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_object_type_matches_objects_request_body** - -> post_object_type_matches_objects_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import type_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = type_api.TypeApi(api_client) - - # example passing only required values which don't have defaults set - body = dict() - try: - api_response = api_instance.post_object_type_matches_objects_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling TypeApi->post_object_type_matches_objects_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_object_type_matches_objects_request_body.ApiResponseFor200) | success - -#### post_object_type_matches_objects_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_object_type_matches_objects_response_body_for_content_types** - -> {str: (bool, date, datetime, dict, float, int, list, str, none_type)} post_object_type_matches_objects_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import type_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = type_api.TypeApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_object_type_matches_objects_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling TypeApi->post_object_type_matches_objects_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_object_type_matches_objects_response_body_for_content_types.ApiResponseFor200) | success - -#### post_object_type_matches_objects_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_string_type_matches_strings_request_body** - -> post_string_type_matches_strings_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import type_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = type_api.TypeApi(api_client) - - # example passing only required values which don't have defaults set - body = "body_example" - try: - api_response = api_instance.post_string_type_matches_strings_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling TypeApi->post_string_type_matches_strings_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_string_type_matches_strings_request_body.ApiResponseFor200) | success - -#### post_string_type_matches_strings_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_string_type_matches_strings_response_body_for_content_types** - -> str post_string_type_matches_strings_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import type_api -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = type_api.TypeApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_string_type_matches_strings_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling TypeApi->post_string_type_matches_strings_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_string_type_matches_strings_response_body_for_content_types.ApiResponseFor200) | success - -#### post_string_type_matches_strings_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - +[**post_array_type_matches_arrays_request_body**](type_api/post_array_type_matches_arrays_request_body.md) | **post** /requestBody/postArrayTypeMatchesArraysRequestBody | +[**post_array_type_matches_arrays_response_body_for_content_types**](type_api/post_array_type_matches_arrays_response_body_for_content_types.md) | **post** /responseBody/postArrayTypeMatchesArraysResponseBodyForContentTypes | +[**post_boolean_type_matches_booleans_request_body**](type_api/post_boolean_type_matches_booleans_request_body.md) | **post** /requestBody/postBooleanTypeMatchesBooleansRequestBody | +[**post_boolean_type_matches_booleans_response_body_for_content_types**](type_api/post_boolean_type_matches_booleans_response_body_for_content_types.md) | **post** /responseBody/postBooleanTypeMatchesBooleansResponseBodyForContentTypes | +[**post_integer_type_matches_integers_request_body**](type_api/post_integer_type_matches_integers_request_body.md) | **post** /requestBody/postIntegerTypeMatchesIntegersRequestBody | +[**post_integer_type_matches_integers_response_body_for_content_types**](type_api/post_integer_type_matches_integers_response_body_for_content_types.md) | **post** /responseBody/postIntegerTypeMatchesIntegersResponseBodyForContentTypes | +[**post_null_type_matches_only_the_null_object_request_body**](type_api/post_null_type_matches_only_the_null_object_request_body.md) | **post** /requestBody/postNullTypeMatchesOnlyTheNullObjectRequestBody | +[**post_null_type_matches_only_the_null_object_response_body_for_content_types**](type_api/post_null_type_matches_only_the_null_object_response_body_for_content_types.md) | **post** /responseBody/postNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes | +[**post_number_type_matches_numbers_request_body**](type_api/post_number_type_matches_numbers_request_body.md) | **post** /requestBody/postNumberTypeMatchesNumbersRequestBody | +[**post_number_type_matches_numbers_response_body_for_content_types**](type_api/post_number_type_matches_numbers_response_body_for_content_types.md) | **post** /responseBody/postNumberTypeMatchesNumbersResponseBodyForContentTypes | +[**post_object_type_matches_objects_request_body**](type_api/post_object_type_matches_objects_request_body.md) | **post** /requestBody/postObjectTypeMatchesObjectsRequestBody | +[**post_object_type_matches_objects_response_body_for_content_types**](type_api/post_object_type_matches_objects_response_body_for_content_types.md) | **post** /responseBody/postObjectTypeMatchesObjectsResponseBodyForContentTypes | +[**post_string_type_matches_strings_request_body**](type_api/post_string_type_matches_strings_request_body.md) | **post** /requestBody/postStringTypeMatchesStringsRequestBody | +[**post_string_type_matches_strings_response_body_for_content_types**](type_api/post_string_type_matches_strings_response_body_for_content_types.md) | **post** /responseBody/postStringTypeMatchesStringsResponseBodyForContentTypes | + +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/UniqueItemsApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/UniqueItemsApi.md index 529b69479c7..6dcc4d59eef 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/UniqueItemsApi.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/UniqueItemsApi.md @@ -1,274 +1,13 @@ - + # unit_test_api.apis.tags.unique_items_api.UniqueItemsApi All URIs are relative to *https://someserver.com/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**post_uniqueitems_false_validation_request_body**](#post_uniqueitems_false_validation_request_body) | **post** /requestBody/postUniqueitemsFalseValidationRequestBody | -[**post_uniqueitems_false_validation_response_body_for_content_types**](#post_uniqueitems_false_validation_response_body_for_content_types) | **post** /responseBody/postUniqueitemsFalseValidationResponseBodyForContentTypes | -[**post_uniqueitems_validation_request_body**](#post_uniqueitems_validation_request_body) | **post** /requestBody/postUniqueitemsValidationRequestBody | -[**post_uniqueitems_validation_response_body_for_content_types**](#post_uniqueitems_validation_response_body_for_content_types) | **post** /responseBody/postUniqueitemsValidationResponseBodyForContentTypes | - -# **post_uniqueitems_false_validation_request_body** - -> post_uniqueitems_false_validation_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import unique_items_api -from unit_test_api.model.uniqueitems_false_validation import UniqueitemsFalseValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = unique_items_api.UniqueItemsApi(api_client) - - # example passing only required values which don't have defaults set - body = UniqueitemsFalseValidation(None) - try: - api_response = api_instance.post_uniqueitems_false_validation_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling UniqueItemsApi->post_uniqueitems_false_validation_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**UniqueitemsFalseValidation**](../../models/UniqueitemsFalseValidation.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_uniqueitems_false_validation_request_body.ApiResponseFor200) | success - -#### post_uniqueitems_false_validation_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_uniqueitems_false_validation_response_body_for_content_types** - -> UniqueitemsFalseValidation post_uniqueitems_false_validation_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import unique_items_api -from unit_test_api.model.uniqueitems_false_validation import UniqueitemsFalseValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = unique_items_api.UniqueItemsApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_uniqueitems_false_validation_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling UniqueItemsApi->post_uniqueitems_false_validation_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_uniqueitems_false_validation_response_body_for_content_types.ApiResponseFor200) | success - -#### post_uniqueitems_false_validation_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**UniqueitemsFalseValidation**](../../models/UniqueitemsFalseValidation.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_uniqueitems_validation_request_body** - -> post_uniqueitems_validation_request_body(body) - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import unique_items_api -from unit_test_api.model.uniqueitems_validation import UniqueitemsValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = unique_items_api.UniqueItemsApi(api_client) - - # example passing only required values which don't have defaults set - body = UniqueitemsValidation(None) - try: - api_response = api_instance.post_uniqueitems_validation_request_body( - body=body, - ) - except unit_test_api.ApiException as e: - print("Exception when calling UniqueItemsApi->post_uniqueitems_validation_request_body: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**UniqueitemsValidation**](../../models/UniqueitemsValidation.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_uniqueitems_validation_request_body.ApiResponseFor200) | success - -#### post_uniqueitems_validation_request_body.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **post_uniqueitems_validation_response_body_for_content_types** - -> UniqueitemsValidation post_uniqueitems_validation_response_body_for_content_types() - - - -### Example - -```python -import unit_test_api -from unit_test_api.apis.tags import unique_items_api -from unit_test_api.model.uniqueitems_validation import UniqueitemsValidation -from pprint import pprint -# Defining the host is optional and defaults to https://someserver.com/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = unit_test_api.Configuration( - host = "https://someserver.com/v1" -) - -# Enter a context with an instance of the API client -with unit_test_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = unique_items_api.UniqueItemsApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.post_uniqueitems_validation_response_body_for_content_types() - pprint(api_response) - except unit_test_api.ApiException as e: - print("Exception when calling UniqueItemsApi->post_uniqueitems_validation_response_body_for_content_types: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_uniqueitems_validation_response_body_for_content_types.ApiResponseFor200) | success - -#### post_uniqueitems_validation_response_body_for_content_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**UniqueitemsValidation**](../../models/UniqueitemsValidation.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) +[**post_uniqueitems_false_validation_request_body**](unique_items_api/post_uniqueitems_false_validation_request_body.md) | **post** /requestBody/postUniqueitemsFalseValidationRequestBody | +[**post_uniqueitems_false_validation_response_body_for_content_types**](unique_items_api/post_uniqueitems_false_validation_response_body_for_content_types.md) | **post** /responseBody/postUniqueitemsFalseValidationResponseBodyForContentTypes | +[**post_uniqueitems_validation_request_body**](unique_items_api/post_uniqueitems_validation_request_body.md) | **post** /requestBody/postUniqueitemsValidationRequestBody | +[**post_uniqueitems_validation_response_body_for_content_types**](unique_items_api/post_uniqueitems_validation_response_body_for_content_types.md) | **post** /responseBody/postUniqueitemsValidationResponseBodyForContentTypes | +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/_NotApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/_NotApi.md new file mode 100644 index 00000000000..70f47a784f9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/_NotApi.md @@ -0,0 +1,15 @@ + +# unit_test_api.apis.tags._not_api._NotApi + +All URIs are relative to *https://someserver.com/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**post_forbidden_property_request_body**](_not_api/post_forbidden_property_request_body.md) | **post** /requestBody/postForbiddenPropertyRequestBody | +[**post_forbidden_property_response_body_for_content_types**](_not_api/post_forbidden_property_response_body_for_content_types.md) | **post** /responseBody/postForbiddenPropertyResponseBodyForContentTypes | +[**post_not_more_complex_schema_request_body**](_not_api/post_not_more_complex_schema_request_body.md) | **post** /requestBody/postNotMoreComplexSchemaRequestBody | +[**post_not_more_complex_schema_response_body_for_content_types**](_not_api/post_not_more_complex_schema_response_body_for_content_types.md) | **post** /responseBody/postNotMoreComplexSchemaResponseBodyForContentTypes | +[**post_not_request_body**](_not_api/post_not_request_body.md) | **post** /requestBody/postNotRequestBody | +[**post_not_response_body_for_content_types**](_not_api/post_not_response_body_for_content_types.md) | **post** /responseBody/postNotResponseBodyForContentTypes | + +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/_not_api.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/_not_api.md new file mode 100644 index 00000000000..0ba33ace170 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/_not_api.md @@ -0,0 +1,19 @@ + +unit_test_api.apis.tags._not_api +# _NotApi + +All URIs are relative to the selected server +- The server is selected by passing in server_info and server_index into api_configuration.ApiConfiguration +- Code samples in endpoints documents show how to do this +- server_index can also be passed in to endpoint calls, see endpoint documentation + +Method | Description +------ | ------------- +[**post_forbidden_property_request_body**](../../paths/request_body_post_forbidden_property_request_body/post.md) | +[**post_forbidden_property_response_body_for_content_types**](../../paths/response_body_post_forbidden_property_response_body_for_content_types/post.md) | +[**post_not_more_complex_schema_request_body**](../../paths/request_body_post_not_more_complex_schema_request_body/post.md) | +[**post_not_more_complex_schema_response_body_for_content_types**](../../paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post.md) | +[**post_not_request_body**](../../paths/request_body_post_not_request_body/post.md) | +[**post_not_response_body_for_content_types**](../../paths/response_body_post_not_response_body_for_content_types/post.md) | + +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/additional_properties_api.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/additional_properties_api.md new file mode 100644 index 00000000000..397fce370e0 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/additional_properties_api.md @@ -0,0 +1,21 @@ + +unit_test_api.apis.tags.additional_properties_api +# AdditionalPropertiesApi + +All URIs are relative to the selected server +- The server is selected by passing in server_info and server_index into api_configuration.ApiConfiguration +- Code samples in endpoints documents show how to do this +- server_index can also be passed in to endpoint calls, see endpoint documentation + +Method | Description +------ | ------------- +[**post_additionalproperties_allows_a_schema_which_should_validate_request_body**](../../paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post.md) | +[**post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types**](../../paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post.md) | +[**post_additionalproperties_are_allowed_by_default_request_body**](../../paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post.md) | +[**post_additionalproperties_are_allowed_by_default_response_body_for_content_types**](../../paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post.md) | +[**post_additionalproperties_can_exist_by_itself_request_body**](../../paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post.md) | +[**post_additionalproperties_can_exist_by_itself_response_body_for_content_types**](../../paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post.md) | +[**post_additionalproperties_should_not_look_in_applicators_request_body**](../../paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post.md) | +[**post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types**](../../paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post.md) | + +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/all_of_api.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/all_of_api.md new file mode 100644 index 00000000000..a8fc70cc41f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/all_of_api.md @@ -0,0 +1,31 @@ + +unit_test_api.apis.tags.all_of_api +# AllOfApi + +All URIs are relative to the selected server +- The server is selected by passing in server_info and server_index into api_configuration.ApiConfiguration +- Code samples in endpoints documents show how to do this +- server_index can also be passed in to endpoint calls, see endpoint documentation + +Method | Description +------ | ------------- +[**post_allof_combined_with_anyof_oneof_request_body**](../../paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post.md) | +[**post_allof_combined_with_anyof_oneof_response_body_for_content_types**](../../paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post.md) | +[**post_allof_request_body**](../../paths/request_body_post_allof_request_body/post.md) | +[**post_allof_response_body_for_content_types**](../../paths/response_body_post_allof_response_body_for_content_types/post.md) | +[**post_allof_simple_types_request_body**](../../paths/request_body_post_allof_simple_types_request_body/post.md) | +[**post_allof_simple_types_response_body_for_content_types**](../../paths/response_body_post_allof_simple_types_response_body_for_content_types/post.md) | +[**post_allof_with_base_schema_request_body**](../../paths/request_body_post_allof_with_base_schema_request_body/post.md) | +[**post_allof_with_base_schema_response_body_for_content_types**](../../paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post.md) | +[**post_allof_with_one_empty_schema_request_body**](../../paths/request_body_post_allof_with_one_empty_schema_request_body/post.md) | +[**post_allof_with_one_empty_schema_response_body_for_content_types**](../../paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post.md) | +[**post_allof_with_the_first_empty_schema_request_body**](../../paths/request_body_post_allof_with_the_first_empty_schema_request_body/post.md) | +[**post_allof_with_the_first_empty_schema_response_body_for_content_types**](../../paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post.md) | +[**post_allof_with_the_last_empty_schema_request_body**](../../paths/request_body_post_allof_with_the_last_empty_schema_request_body/post.md) | +[**post_allof_with_the_last_empty_schema_response_body_for_content_types**](../../paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post.md) | +[**post_allof_with_two_empty_schemas_request_body**](../../paths/request_body_post_allof_with_two_empty_schemas_request_body/post.md) | +[**post_allof_with_two_empty_schemas_response_body_for_content_types**](../../paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post.md) | +[**post_nested_allof_to_check_validation_semantics_request_body**](../../paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post.md) | +[**post_nested_allof_to_check_validation_semantics_response_body_for_content_types**](../../paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post.md) | + +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/any_of_api.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/any_of_api.md new file mode 100644 index 00000000000..db24138c8f9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/any_of_api.md @@ -0,0 +1,23 @@ + +unit_test_api.apis.tags.any_of_api +# AnyOfApi + +All URIs are relative to the selected server +- The server is selected by passing in server_info and server_index into api_configuration.ApiConfiguration +- Code samples in endpoints documents show how to do this +- server_index can also be passed in to endpoint calls, see endpoint documentation + +Method | Description +------ | ------------- +[**post_anyof_complex_types_request_body**](../../paths/request_body_post_anyof_complex_types_request_body/post.md) | +[**post_anyof_complex_types_response_body_for_content_types**](../../paths/response_body_post_anyof_complex_types_response_body_for_content_types/post.md) | +[**post_anyof_request_body**](../../paths/request_body_post_anyof_request_body/post.md) | +[**post_anyof_response_body_for_content_types**](../../paths/response_body_post_anyof_response_body_for_content_types/post.md) | +[**post_anyof_with_base_schema_request_body**](../../paths/request_body_post_anyof_with_base_schema_request_body/post.md) | +[**post_anyof_with_base_schema_response_body_for_content_types**](../../paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post.md) | +[**post_anyof_with_one_empty_schema_request_body**](../../paths/request_body_post_anyof_with_one_empty_schema_request_body/post.md) | +[**post_anyof_with_one_empty_schema_response_body_for_content_types**](../../paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post.md) | +[**post_nested_anyof_to_check_validation_semantics_request_body**](../../paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post.md) | +[**post_nested_anyof_to_check_validation_semantics_response_body_for_content_types**](../../paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post.md) | + +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/content_type_json_api.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/content_type_json_api.md new file mode 100644 index 00000000000..04d4743de09 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/content_type_json_api.md @@ -0,0 +1,187 @@ + +unit_test_api.apis.tags.content_type_json_api +# ContentTypeJsonApi + +All URIs are relative to the selected server +- The server is selected by passing in server_info and server_index into api_configuration.ApiConfiguration +- Code samples in endpoints documents show how to do this +- server_index can also be passed in to endpoint calls, see endpoint documentation + +Method | Description +------ | ------------- +[**post_additionalproperties_allows_a_schema_which_should_validate_request_body**](../../paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post.md) | +[**post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types**](../../paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post.md) | +[**post_additionalproperties_are_allowed_by_default_request_body**](../../paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post.md) | +[**post_additionalproperties_are_allowed_by_default_response_body_for_content_types**](../../paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post.md) | +[**post_additionalproperties_can_exist_by_itself_request_body**](../../paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post.md) | +[**post_additionalproperties_can_exist_by_itself_response_body_for_content_types**](../../paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post.md) | +[**post_additionalproperties_should_not_look_in_applicators_request_body**](../../paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post.md) | +[**post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types**](../../paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post.md) | +[**post_allof_combined_with_anyof_oneof_request_body**](../../paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post.md) | +[**post_allof_combined_with_anyof_oneof_response_body_for_content_types**](../../paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post.md) | +[**post_allof_request_body**](../../paths/request_body_post_allof_request_body/post.md) | +[**post_allof_response_body_for_content_types**](../../paths/response_body_post_allof_response_body_for_content_types/post.md) | +[**post_allof_simple_types_request_body**](../../paths/request_body_post_allof_simple_types_request_body/post.md) | +[**post_allof_simple_types_response_body_for_content_types**](../../paths/response_body_post_allof_simple_types_response_body_for_content_types/post.md) | +[**post_allof_with_base_schema_request_body**](../../paths/request_body_post_allof_with_base_schema_request_body/post.md) | +[**post_allof_with_base_schema_response_body_for_content_types**](../../paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post.md) | +[**post_allof_with_one_empty_schema_request_body**](../../paths/request_body_post_allof_with_one_empty_schema_request_body/post.md) | +[**post_allof_with_one_empty_schema_response_body_for_content_types**](../../paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post.md) | +[**post_allof_with_the_first_empty_schema_request_body**](../../paths/request_body_post_allof_with_the_first_empty_schema_request_body/post.md) | +[**post_allof_with_the_first_empty_schema_response_body_for_content_types**](../../paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post.md) | +[**post_allof_with_the_last_empty_schema_request_body**](../../paths/request_body_post_allof_with_the_last_empty_schema_request_body/post.md) | +[**post_allof_with_the_last_empty_schema_response_body_for_content_types**](../../paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post.md) | +[**post_allof_with_two_empty_schemas_request_body**](../../paths/request_body_post_allof_with_two_empty_schemas_request_body/post.md) | +[**post_allof_with_two_empty_schemas_response_body_for_content_types**](../../paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post.md) | +[**post_anyof_complex_types_request_body**](../../paths/request_body_post_anyof_complex_types_request_body/post.md) | +[**post_anyof_complex_types_response_body_for_content_types**](../../paths/response_body_post_anyof_complex_types_response_body_for_content_types/post.md) | +[**post_anyof_request_body**](../../paths/request_body_post_anyof_request_body/post.md) | +[**post_anyof_response_body_for_content_types**](../../paths/response_body_post_anyof_response_body_for_content_types/post.md) | +[**post_anyof_with_base_schema_request_body**](../../paths/request_body_post_anyof_with_base_schema_request_body/post.md) | +[**post_anyof_with_base_schema_response_body_for_content_types**](../../paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post.md) | +[**post_anyof_with_one_empty_schema_request_body**](../../paths/request_body_post_anyof_with_one_empty_schema_request_body/post.md) | +[**post_anyof_with_one_empty_schema_response_body_for_content_types**](../../paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post.md) | +[**post_array_type_matches_arrays_request_body**](../../paths/request_body_post_array_type_matches_arrays_request_body/post.md) | +[**post_array_type_matches_arrays_response_body_for_content_types**](../../paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post.md) | +[**post_boolean_type_matches_booleans_request_body**](../../paths/request_body_post_boolean_type_matches_booleans_request_body/post.md) | +[**post_boolean_type_matches_booleans_response_body_for_content_types**](../../paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post.md) | +[**post_by_int_request_body**](../../paths/request_body_post_by_int_request_body/post.md) | +[**post_by_int_response_body_for_content_types**](../../paths/response_body_post_by_int_response_body_for_content_types/post.md) | +[**post_by_number_request_body**](../../paths/request_body_post_by_number_request_body/post.md) | +[**post_by_number_response_body_for_content_types**](../../paths/response_body_post_by_number_response_body_for_content_types/post.md) | +[**post_by_small_number_request_body**](../../paths/request_body_post_by_small_number_request_body/post.md) | +[**post_by_small_number_response_body_for_content_types**](../../paths/response_body_post_by_small_number_response_body_for_content_types/post.md) | +[**post_date_time_format_request_body**](../../paths/request_body_post_date_time_format_request_body/post.md) | +[**post_date_time_format_response_body_for_content_types**](../../paths/response_body_post_date_time_format_response_body_for_content_types/post.md) | +[**post_email_format_request_body**](../../paths/request_body_post_email_format_request_body/post.md) | +[**post_email_format_response_body_for_content_types**](../../paths/response_body_post_email_format_response_body_for_content_types/post.md) | +[**post_enum_with0_does_not_match_false_request_body**](../../paths/request_body_post_enum_with0_does_not_match_false_request_body/post.md) | +[**post_enum_with0_does_not_match_false_response_body_for_content_types**](../../paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post.md) | +[**post_enum_with1_does_not_match_true_request_body**](../../paths/request_body_post_enum_with1_does_not_match_true_request_body/post.md) | +[**post_enum_with1_does_not_match_true_response_body_for_content_types**](../../paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post.md) | +[**post_enum_with_escaped_characters_request_body**](../../paths/request_body_post_enum_with_escaped_characters_request_body/post.md) | +[**post_enum_with_escaped_characters_response_body_for_content_types**](../../paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post.md) | +[**post_enum_with_false_does_not_match0_request_body**](../../paths/request_body_post_enum_with_false_does_not_match0_request_body/post.md) | +[**post_enum_with_false_does_not_match0_response_body_for_content_types**](../../paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post.md) | +[**post_enum_with_true_does_not_match1_request_body**](../../paths/request_body_post_enum_with_true_does_not_match1_request_body/post.md) | +[**post_enum_with_true_does_not_match1_response_body_for_content_types**](../../paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post.md) | +[**post_enums_in_properties_request_body**](../../paths/request_body_post_enums_in_properties_request_body/post.md) | +[**post_enums_in_properties_response_body_for_content_types**](../../paths/response_body_post_enums_in_properties_response_body_for_content_types/post.md) | +[**post_forbidden_property_request_body**](../../paths/request_body_post_forbidden_property_request_body/post.md) | +[**post_forbidden_property_response_body_for_content_types**](../../paths/response_body_post_forbidden_property_response_body_for_content_types/post.md) | +[**post_hostname_format_request_body**](../../paths/request_body_post_hostname_format_request_body/post.md) | +[**post_hostname_format_response_body_for_content_types**](../../paths/response_body_post_hostname_format_response_body_for_content_types/post.md) | +[**post_integer_type_matches_integers_request_body**](../../paths/request_body_post_integer_type_matches_integers_request_body/post.md) | +[**post_integer_type_matches_integers_response_body_for_content_types**](../../paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post.md) | +[**post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body**](../../paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post.md) | +[**post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types**](../../paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post.md) | +[**post_invalid_string_value_for_default_request_body**](../../paths/request_body_post_invalid_string_value_for_default_request_body/post.md) | +[**post_invalid_string_value_for_default_response_body_for_content_types**](../../paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post.md) | +[**post_ipv4_format_request_body**](../../paths/request_body_post_ipv4_format_request_body/post.md) | +[**post_ipv4_format_response_body_for_content_types**](../../paths/response_body_post_ipv4_format_response_body_for_content_types/post.md) | +[**post_ipv6_format_request_body**](../../paths/request_body_post_ipv6_format_request_body/post.md) | +[**post_ipv6_format_response_body_for_content_types**](../../paths/response_body_post_ipv6_format_response_body_for_content_types/post.md) | +[**post_json_pointer_format_request_body**](../../paths/request_body_post_json_pointer_format_request_body/post.md) | +[**post_json_pointer_format_response_body_for_content_types**](../../paths/response_body_post_json_pointer_format_response_body_for_content_types/post.md) | +[**post_maximum_validation_request_body**](../../paths/request_body_post_maximum_validation_request_body/post.md) | +[**post_maximum_validation_response_body_for_content_types**](../../paths/response_body_post_maximum_validation_response_body_for_content_types/post.md) | +[**post_maximum_validation_with_unsigned_integer_request_body**](../../paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post.md) | +[**post_maximum_validation_with_unsigned_integer_response_body_for_content_types**](../../paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post.md) | +[**post_maxitems_validation_request_body**](../../paths/request_body_post_maxitems_validation_request_body/post.md) | +[**post_maxitems_validation_response_body_for_content_types**](../../paths/response_body_post_maxitems_validation_response_body_for_content_types/post.md) | +[**post_maxlength_validation_request_body**](../../paths/request_body_post_maxlength_validation_request_body/post.md) | +[**post_maxlength_validation_response_body_for_content_types**](../../paths/response_body_post_maxlength_validation_response_body_for_content_types/post.md) | +[**post_maxproperties0_means_the_object_is_empty_request_body**](../../paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post.md) | +[**post_maxproperties0_means_the_object_is_empty_response_body_for_content_types**](../../paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post.md) | +[**post_maxproperties_validation_request_body**](../../paths/request_body_post_maxproperties_validation_request_body/post.md) | +[**post_maxproperties_validation_response_body_for_content_types**](../../paths/response_body_post_maxproperties_validation_response_body_for_content_types/post.md) | +[**post_minimum_validation_request_body**](../../paths/request_body_post_minimum_validation_request_body/post.md) | +[**post_minimum_validation_response_body_for_content_types**](../../paths/response_body_post_minimum_validation_response_body_for_content_types/post.md) | +[**post_minimum_validation_with_signed_integer_request_body**](../../paths/request_body_post_minimum_validation_with_signed_integer_request_body/post.md) | +[**post_minimum_validation_with_signed_integer_response_body_for_content_types**](../../paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post.md) | +[**post_minitems_validation_request_body**](../../paths/request_body_post_minitems_validation_request_body/post.md) | +[**post_minitems_validation_response_body_for_content_types**](../../paths/response_body_post_minitems_validation_response_body_for_content_types/post.md) | +[**post_minlength_validation_request_body**](../../paths/request_body_post_minlength_validation_request_body/post.md) | +[**post_minlength_validation_response_body_for_content_types**](../../paths/response_body_post_minlength_validation_response_body_for_content_types/post.md) | +[**post_minproperties_validation_request_body**](../../paths/request_body_post_minproperties_validation_request_body/post.md) | +[**post_minproperties_validation_response_body_for_content_types**](../../paths/response_body_post_minproperties_validation_response_body_for_content_types/post.md) | +[**post_nested_allof_to_check_validation_semantics_request_body**](../../paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post.md) | +[**post_nested_allof_to_check_validation_semantics_response_body_for_content_types**](../../paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post.md) | +[**post_nested_anyof_to_check_validation_semantics_request_body**](../../paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post.md) | +[**post_nested_anyof_to_check_validation_semantics_response_body_for_content_types**](../../paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post.md) | +[**post_nested_items_request_body**](../../paths/request_body_post_nested_items_request_body/post.md) | +[**post_nested_items_response_body_for_content_types**](../../paths/response_body_post_nested_items_response_body_for_content_types/post.md) | +[**post_nested_oneof_to_check_validation_semantics_request_body**](../../paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post.md) | +[**post_nested_oneof_to_check_validation_semantics_response_body_for_content_types**](../../paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post.md) | +[**post_not_more_complex_schema_request_body**](../../paths/request_body_post_not_more_complex_schema_request_body/post.md) | +[**post_not_more_complex_schema_response_body_for_content_types**](../../paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post.md) | +[**post_not_request_body**](../../paths/request_body_post_not_request_body/post.md) | +[**post_not_response_body_for_content_types**](../../paths/response_body_post_not_response_body_for_content_types/post.md) | +[**post_nul_characters_in_strings_request_body**](../../paths/request_body_post_nul_characters_in_strings_request_body/post.md) | +[**post_nul_characters_in_strings_response_body_for_content_types**](../../paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post.md) | +[**post_null_type_matches_only_the_null_object_request_body**](../../paths/request_body_post_null_type_matches_only_the_null_object_request_body/post.md) | +[**post_null_type_matches_only_the_null_object_response_body_for_content_types**](../../paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post.md) | +[**post_number_type_matches_numbers_request_body**](../../paths/request_body_post_number_type_matches_numbers_request_body/post.md) | +[**post_number_type_matches_numbers_response_body_for_content_types**](../../paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post.md) | +[**post_object_properties_validation_request_body**](../../paths/request_body_post_object_properties_validation_request_body/post.md) | +[**post_object_properties_validation_response_body_for_content_types**](../../paths/response_body_post_object_properties_validation_response_body_for_content_types/post.md) | +[**post_object_type_matches_objects_request_body**](../../paths/request_body_post_object_type_matches_objects_request_body/post.md) | +[**post_object_type_matches_objects_response_body_for_content_types**](../../paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post.md) | +[**post_oneof_complex_types_request_body**](../../paths/request_body_post_oneof_complex_types_request_body/post.md) | +[**post_oneof_complex_types_response_body_for_content_types**](../../paths/response_body_post_oneof_complex_types_response_body_for_content_types/post.md) | +[**post_oneof_request_body**](../../paths/request_body_post_oneof_request_body/post.md) | +[**post_oneof_response_body_for_content_types**](../../paths/response_body_post_oneof_response_body_for_content_types/post.md) | +[**post_oneof_with_base_schema_request_body**](../../paths/request_body_post_oneof_with_base_schema_request_body/post.md) | +[**post_oneof_with_base_schema_response_body_for_content_types**](../../paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post.md) | +[**post_oneof_with_empty_schema_request_body**](../../paths/request_body_post_oneof_with_empty_schema_request_body/post.md) | +[**post_oneof_with_empty_schema_response_body_for_content_types**](../../paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post.md) | +[**post_oneof_with_required_request_body**](../../paths/request_body_post_oneof_with_required_request_body/post.md) | +[**post_oneof_with_required_response_body_for_content_types**](../../paths/response_body_post_oneof_with_required_response_body_for_content_types/post.md) | +[**post_pattern_is_not_anchored_request_body**](../../paths/request_body_post_pattern_is_not_anchored_request_body/post.md) | +[**post_pattern_is_not_anchored_response_body_for_content_types**](../../paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post.md) | +[**post_pattern_validation_request_body**](../../paths/request_body_post_pattern_validation_request_body/post.md) | +[**post_pattern_validation_response_body_for_content_types**](../../paths/response_body_post_pattern_validation_response_body_for_content_types/post.md) | +[**post_properties_with_escaped_characters_request_body**](../../paths/request_body_post_properties_with_escaped_characters_request_body/post.md) | +[**post_properties_with_escaped_characters_response_body_for_content_types**](../../paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post.md) | +[**post_property_named_ref_that_is_not_a_reference_request_body**](../../paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post.md) | +[**post_property_named_ref_that_is_not_a_reference_response_body_for_content_types**](../../paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post.md) | +[**post_ref_in_additionalproperties_request_body**](../../paths/request_body_post_ref_in_additionalproperties_request_body/post.md) | +[**post_ref_in_additionalproperties_response_body_for_content_types**](../../paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post.md) | +[**post_ref_in_allof_request_body**](../../paths/request_body_post_ref_in_allof_request_body/post.md) | +[**post_ref_in_allof_response_body_for_content_types**](../../paths/response_body_post_ref_in_allof_response_body_for_content_types/post.md) | +[**post_ref_in_anyof_request_body**](../../paths/request_body_post_ref_in_anyof_request_body/post.md) | +[**post_ref_in_anyof_response_body_for_content_types**](../../paths/response_body_post_ref_in_anyof_response_body_for_content_types/post.md) | +[**post_ref_in_items_request_body**](../../paths/request_body_post_ref_in_items_request_body/post.md) | +[**post_ref_in_items_response_body_for_content_types**](../../paths/response_body_post_ref_in_items_response_body_for_content_types/post.md) | +[**post_ref_in_not_request_body**](../../paths/request_body_post_ref_in_not_request_body/post.md) | +[**post_ref_in_not_response_body_for_content_types**](../../paths/response_body_post_ref_in_not_response_body_for_content_types/post.md) | +[**post_ref_in_oneof_request_body**](../../paths/request_body_post_ref_in_oneof_request_body/post.md) | +[**post_ref_in_oneof_response_body_for_content_types**](../../paths/response_body_post_ref_in_oneof_response_body_for_content_types/post.md) | +[**post_ref_in_property_request_body**](../../paths/request_body_post_ref_in_property_request_body/post.md) | +[**post_ref_in_property_response_body_for_content_types**](../../paths/response_body_post_ref_in_property_response_body_for_content_types/post.md) | +[**post_required_default_validation_request_body**](../../paths/request_body_post_required_default_validation_request_body/post.md) | +[**post_required_default_validation_response_body_for_content_types**](../../paths/response_body_post_required_default_validation_response_body_for_content_types/post.md) | +[**post_required_validation_request_body**](../../paths/request_body_post_required_validation_request_body/post.md) | +[**post_required_validation_response_body_for_content_types**](../../paths/response_body_post_required_validation_response_body_for_content_types/post.md) | +[**post_required_with_empty_array_request_body**](../../paths/request_body_post_required_with_empty_array_request_body/post.md) | +[**post_required_with_empty_array_response_body_for_content_types**](../../paths/response_body_post_required_with_empty_array_response_body_for_content_types/post.md) | +[**post_required_with_escaped_characters_request_body**](../../paths/request_body_post_required_with_escaped_characters_request_body/post.md) | +[**post_required_with_escaped_characters_response_body_for_content_types**](../../paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post.md) | +[**post_simple_enum_validation_request_body**](../../paths/request_body_post_simple_enum_validation_request_body/post.md) | +[**post_simple_enum_validation_response_body_for_content_types**](../../paths/response_body_post_simple_enum_validation_response_body_for_content_types/post.md) | +[**post_string_type_matches_strings_request_body**](../../paths/request_body_post_string_type_matches_strings_request_body/post.md) | +[**post_string_type_matches_strings_response_body_for_content_types**](../../paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post.md) | +[**post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body**](../../paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post.md) | +[**post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types**](../../paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post.md) | +[**post_uniqueitems_false_validation_request_body**](../../paths/request_body_post_uniqueitems_false_validation_request_body/post.md) | +[**post_uniqueitems_false_validation_response_body_for_content_types**](../../paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post.md) | +[**post_uniqueitems_validation_request_body**](../../paths/request_body_post_uniqueitems_validation_request_body/post.md) | +[**post_uniqueitems_validation_response_body_for_content_types**](../../paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post.md) | +[**post_uri_format_request_body**](../../paths/request_body_post_uri_format_request_body/post.md) | +[**post_uri_format_response_body_for_content_types**](../../paths/response_body_post_uri_format_response_body_for_content_types/post.md) | +[**post_uri_reference_format_request_body**](../../paths/request_body_post_uri_reference_format_request_body/post.md) | +[**post_uri_reference_format_response_body_for_content_types**](../../paths/response_body_post_uri_reference_format_response_body_for_content_types/post.md) | +[**post_uri_template_format_request_body**](../../paths/request_body_post_uri_template_format_request_body/post.md) | +[**post_uri_template_format_response_body_for_content_types**](../../paths/response_body_post_uri_template_format_response_body_for_content_types/post.md) | + +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/default_api.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/default_api.md new file mode 100644 index 00000000000..b207e3320f0 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/default_api.md @@ -0,0 +1,17 @@ + +unit_test_api.apis.tags.default_api +# DefaultApi + +All URIs are relative to the selected server +- The server is selected by passing in server_info and server_index into api_configuration.ApiConfiguration +- Code samples in endpoints documents show how to do this +- server_index can also be passed in to endpoint calls, see endpoint documentation + +Method | Description +------ | ------------- +[**post_invalid_string_value_for_default_request_body**](../../paths/request_body_post_invalid_string_value_for_default_request_body/post.md) | +[**post_invalid_string_value_for_default_response_body_for_content_types**](../../paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post.md) | +[**post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body**](../../paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post.md) | +[**post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types**](../../paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post.md) | + +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/enum_api.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/enum_api.md new file mode 100644 index 00000000000..529224b8e7b --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/enum_api.md @@ -0,0 +1,29 @@ + +unit_test_api.apis.tags.enum_api +# EnumApi + +All URIs are relative to the selected server +- The server is selected by passing in server_info and server_index into api_configuration.ApiConfiguration +- Code samples in endpoints documents show how to do this +- server_index can also be passed in to endpoint calls, see endpoint documentation + +Method | Description +------ | ------------- +[**post_enum_with0_does_not_match_false_request_body**](../../paths/request_body_post_enum_with0_does_not_match_false_request_body/post.md) | +[**post_enum_with0_does_not_match_false_response_body_for_content_types**](../../paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post.md) | +[**post_enum_with1_does_not_match_true_request_body**](../../paths/request_body_post_enum_with1_does_not_match_true_request_body/post.md) | +[**post_enum_with1_does_not_match_true_response_body_for_content_types**](../../paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post.md) | +[**post_enum_with_escaped_characters_request_body**](../../paths/request_body_post_enum_with_escaped_characters_request_body/post.md) | +[**post_enum_with_escaped_characters_response_body_for_content_types**](../../paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post.md) | +[**post_enum_with_false_does_not_match0_request_body**](../../paths/request_body_post_enum_with_false_does_not_match0_request_body/post.md) | +[**post_enum_with_false_does_not_match0_response_body_for_content_types**](../../paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post.md) | +[**post_enum_with_true_does_not_match1_request_body**](../../paths/request_body_post_enum_with_true_does_not_match1_request_body/post.md) | +[**post_enum_with_true_does_not_match1_response_body_for_content_types**](../../paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post.md) | +[**post_enums_in_properties_request_body**](../../paths/request_body_post_enums_in_properties_request_body/post.md) | +[**post_enums_in_properties_response_body_for_content_types**](../../paths/response_body_post_enums_in_properties_response_body_for_content_types/post.md) | +[**post_nul_characters_in_strings_request_body**](../../paths/request_body_post_nul_characters_in_strings_request_body/post.md) | +[**post_nul_characters_in_strings_response_body_for_content_types**](../../paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post.md) | +[**post_simple_enum_validation_request_body**](../../paths/request_body_post_simple_enum_validation_request_body/post.md) | +[**post_simple_enum_validation_response_body_for_content_types**](../../paths/response_body_post_simple_enum_validation_response_body_for_content_types/post.md) | + +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/format_api.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/format_api.md new file mode 100644 index 00000000000..5f25edf69da --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/format_api.md @@ -0,0 +1,31 @@ + +unit_test_api.apis.tags.format_api +# FormatApi + +All URIs are relative to the selected server +- The server is selected by passing in server_info and server_index into api_configuration.ApiConfiguration +- Code samples in endpoints documents show how to do this +- server_index can also be passed in to endpoint calls, see endpoint documentation + +Method | Description +------ | ------------- +[**post_date_time_format_request_body**](../../paths/request_body_post_date_time_format_request_body/post.md) | +[**post_date_time_format_response_body_for_content_types**](../../paths/response_body_post_date_time_format_response_body_for_content_types/post.md) | +[**post_email_format_request_body**](../../paths/request_body_post_email_format_request_body/post.md) | +[**post_email_format_response_body_for_content_types**](../../paths/response_body_post_email_format_response_body_for_content_types/post.md) | +[**post_hostname_format_request_body**](../../paths/request_body_post_hostname_format_request_body/post.md) | +[**post_hostname_format_response_body_for_content_types**](../../paths/response_body_post_hostname_format_response_body_for_content_types/post.md) | +[**post_ipv4_format_request_body**](../../paths/request_body_post_ipv4_format_request_body/post.md) | +[**post_ipv4_format_response_body_for_content_types**](../../paths/response_body_post_ipv4_format_response_body_for_content_types/post.md) | +[**post_ipv6_format_request_body**](../../paths/request_body_post_ipv6_format_request_body/post.md) | +[**post_ipv6_format_response_body_for_content_types**](../../paths/response_body_post_ipv6_format_response_body_for_content_types/post.md) | +[**post_json_pointer_format_request_body**](../../paths/request_body_post_json_pointer_format_request_body/post.md) | +[**post_json_pointer_format_response_body_for_content_types**](../../paths/response_body_post_json_pointer_format_response_body_for_content_types/post.md) | +[**post_uri_format_request_body**](../../paths/request_body_post_uri_format_request_body/post.md) | +[**post_uri_format_response_body_for_content_types**](../../paths/response_body_post_uri_format_response_body_for_content_types/post.md) | +[**post_uri_reference_format_request_body**](../../paths/request_body_post_uri_reference_format_request_body/post.md) | +[**post_uri_reference_format_response_body_for_content_types**](../../paths/response_body_post_uri_reference_format_response_body_for_content_types/post.md) | +[**post_uri_template_format_request_body**](../../paths/request_body_post_uri_template_format_request_body/post.md) | +[**post_uri_template_format_response_body_for_content_types**](../../paths/response_body_post_uri_template_format_response_body_for_content_types/post.md) | + +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/items_api.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/items_api.md new file mode 100644 index 00000000000..7d4b0563bbb --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/items_api.md @@ -0,0 +1,15 @@ + +unit_test_api.apis.tags.items_api +# ItemsApi + +All URIs are relative to the selected server +- The server is selected by passing in server_info and server_index into api_configuration.ApiConfiguration +- Code samples in endpoints documents show how to do this +- server_index can also be passed in to endpoint calls, see endpoint documentation + +Method | Description +------ | ------------- +[**post_nested_items_request_body**](../../paths/request_body_post_nested_items_request_body/post.md) | +[**post_nested_items_response_body_for_content_types**](../../paths/response_body_post_nested_items_response_body_for_content_types/post.md) | + +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/max_items_api.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/max_items_api.md new file mode 100644 index 00000000000..3c2f39b81d9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/max_items_api.md @@ -0,0 +1,15 @@ + +unit_test_api.apis.tags.max_items_api +# MaxItemsApi + +All URIs are relative to the selected server +- The server is selected by passing in server_info and server_index into api_configuration.ApiConfiguration +- Code samples in endpoints documents show how to do this +- server_index can also be passed in to endpoint calls, see endpoint documentation + +Method | Description +------ | ------------- +[**post_maxitems_validation_request_body**](../../paths/request_body_post_maxitems_validation_request_body/post.md) | +[**post_maxitems_validation_response_body_for_content_types**](../../paths/response_body_post_maxitems_validation_response_body_for_content_types/post.md) | + +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/max_length_api.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/max_length_api.md new file mode 100644 index 00000000000..581d53251b9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/max_length_api.md @@ -0,0 +1,15 @@ + +unit_test_api.apis.tags.max_length_api +# MaxLengthApi + +All URIs are relative to the selected server +- The server is selected by passing in server_info and server_index into api_configuration.ApiConfiguration +- Code samples in endpoints documents show how to do this +- server_index can also be passed in to endpoint calls, see endpoint documentation + +Method | Description +------ | ------------- +[**post_maxlength_validation_request_body**](../../paths/request_body_post_maxlength_validation_request_body/post.md) | +[**post_maxlength_validation_response_body_for_content_types**](../../paths/response_body_post_maxlength_validation_response_body_for_content_types/post.md) | + +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/max_properties_api.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/max_properties_api.md new file mode 100644 index 00000000000..6274432bfaf --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/max_properties_api.md @@ -0,0 +1,17 @@ + +unit_test_api.apis.tags.max_properties_api +# MaxPropertiesApi + +All URIs are relative to the selected server +- The server is selected by passing in server_info and server_index into api_configuration.ApiConfiguration +- Code samples in endpoints documents show how to do this +- server_index can also be passed in to endpoint calls, see endpoint documentation + +Method | Description +------ | ------------- +[**post_maxproperties0_means_the_object_is_empty_request_body**](../../paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post.md) | +[**post_maxproperties0_means_the_object_is_empty_response_body_for_content_types**](../../paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post.md) | +[**post_maxproperties_validation_request_body**](../../paths/request_body_post_maxproperties_validation_request_body/post.md) | +[**post_maxproperties_validation_response_body_for_content_types**](../../paths/response_body_post_maxproperties_validation_response_body_for_content_types/post.md) | + +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/maximum_api.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/maximum_api.md new file mode 100644 index 00000000000..431e5c64ad4 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/maximum_api.md @@ -0,0 +1,17 @@ + +unit_test_api.apis.tags.maximum_api +# MaximumApi + +All URIs are relative to the selected server +- The server is selected by passing in server_info and server_index into api_configuration.ApiConfiguration +- Code samples in endpoints documents show how to do this +- server_index can also be passed in to endpoint calls, see endpoint documentation + +Method | Description +------ | ------------- +[**post_maximum_validation_request_body**](../../paths/request_body_post_maximum_validation_request_body/post.md) | +[**post_maximum_validation_response_body_for_content_types**](../../paths/response_body_post_maximum_validation_response_body_for_content_types/post.md) | +[**post_maximum_validation_with_unsigned_integer_request_body**](../../paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post.md) | +[**post_maximum_validation_with_unsigned_integer_response_body_for_content_types**](../../paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post.md) | + +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/min_items_api.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/min_items_api.md new file mode 100644 index 00000000000..eac5307be28 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/min_items_api.md @@ -0,0 +1,15 @@ + +unit_test_api.apis.tags.min_items_api +# MinItemsApi + +All URIs are relative to the selected server +- The server is selected by passing in server_info and server_index into api_configuration.ApiConfiguration +- Code samples in endpoints documents show how to do this +- server_index can also be passed in to endpoint calls, see endpoint documentation + +Method | Description +------ | ------------- +[**post_minitems_validation_request_body**](../../paths/request_body_post_minitems_validation_request_body/post.md) | +[**post_minitems_validation_response_body_for_content_types**](../../paths/response_body_post_minitems_validation_response_body_for_content_types/post.md) | + +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/min_length_api.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/min_length_api.md new file mode 100644 index 00000000000..76d6f3acdbe --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/min_length_api.md @@ -0,0 +1,15 @@ + +unit_test_api.apis.tags.min_length_api +# MinLengthApi + +All URIs are relative to the selected server +- The server is selected by passing in server_info and server_index into api_configuration.ApiConfiguration +- Code samples in endpoints documents show how to do this +- server_index can also be passed in to endpoint calls, see endpoint documentation + +Method | Description +------ | ------------- +[**post_minlength_validation_request_body**](../../paths/request_body_post_minlength_validation_request_body/post.md) | +[**post_minlength_validation_response_body_for_content_types**](../../paths/response_body_post_minlength_validation_response_body_for_content_types/post.md) | + +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/min_properties_api.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/min_properties_api.md new file mode 100644 index 00000000000..fc7595be9e2 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/min_properties_api.md @@ -0,0 +1,15 @@ + +unit_test_api.apis.tags.min_properties_api +# MinPropertiesApi + +All URIs are relative to the selected server +- The server is selected by passing in server_info and server_index into api_configuration.ApiConfiguration +- Code samples in endpoints documents show how to do this +- server_index can also be passed in to endpoint calls, see endpoint documentation + +Method | Description +------ | ------------- +[**post_minproperties_validation_request_body**](../../paths/request_body_post_minproperties_validation_request_body/post.md) | +[**post_minproperties_validation_response_body_for_content_types**](../../paths/response_body_post_minproperties_validation_response_body_for_content_types/post.md) | + +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/minimum_api.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/minimum_api.md new file mode 100644 index 00000000000..62d9b842e22 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/minimum_api.md @@ -0,0 +1,17 @@ + +unit_test_api.apis.tags.minimum_api +# MinimumApi + +All URIs are relative to the selected server +- The server is selected by passing in server_info and server_index into api_configuration.ApiConfiguration +- Code samples in endpoints documents show how to do this +- server_index can also be passed in to endpoint calls, see endpoint documentation + +Method | Description +------ | ------------- +[**post_minimum_validation_request_body**](../../paths/request_body_post_minimum_validation_request_body/post.md) | +[**post_minimum_validation_response_body_for_content_types**](../../paths/response_body_post_minimum_validation_response_body_for_content_types/post.md) | +[**post_minimum_validation_with_signed_integer_request_body**](../../paths/request_body_post_minimum_validation_with_signed_integer_request_body/post.md) | +[**post_minimum_validation_with_signed_integer_response_body_for_content_types**](../../paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post.md) | + +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/multiple_of_api.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/multiple_of_api.md new file mode 100644 index 00000000000..91592db4255 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/multiple_of_api.md @@ -0,0 +1,21 @@ + +unit_test_api.apis.tags.multiple_of_api +# MultipleOfApi + +All URIs are relative to the selected server +- The server is selected by passing in server_info and server_index into api_configuration.ApiConfiguration +- Code samples in endpoints documents show how to do this +- server_index can also be passed in to endpoint calls, see endpoint documentation + +Method | Description +------ | ------------- +[**post_by_int_request_body**](../../paths/request_body_post_by_int_request_body/post.md) | +[**post_by_int_response_body_for_content_types**](../../paths/response_body_post_by_int_response_body_for_content_types/post.md) | +[**post_by_number_request_body**](../../paths/request_body_post_by_number_request_body/post.md) | +[**post_by_number_response_body_for_content_types**](../../paths/response_body_post_by_number_response_body_for_content_types/post.md) | +[**post_by_small_number_request_body**](../../paths/request_body_post_by_small_number_request_body/post.md) | +[**post_by_small_number_response_body_for_content_types**](../../paths/response_body_post_by_small_number_response_body_for_content_types/post.md) | +[**post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body**](../../paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post.md) | +[**post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types**](../../paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post.md) | + +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/one_of_api.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/one_of_api.md new file mode 100644 index 00000000000..42058af96dd --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/one_of_api.md @@ -0,0 +1,25 @@ + +unit_test_api.apis.tags.one_of_api +# OneOfApi + +All URIs are relative to the selected server +- The server is selected by passing in server_info and server_index into api_configuration.ApiConfiguration +- Code samples in endpoints documents show how to do this +- server_index can also be passed in to endpoint calls, see endpoint documentation + +Method | Description +------ | ------------- +[**post_nested_oneof_to_check_validation_semantics_request_body**](../../paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post.md) | +[**post_nested_oneof_to_check_validation_semantics_response_body_for_content_types**](../../paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post.md) | +[**post_oneof_complex_types_request_body**](../../paths/request_body_post_oneof_complex_types_request_body/post.md) | +[**post_oneof_complex_types_response_body_for_content_types**](../../paths/response_body_post_oneof_complex_types_response_body_for_content_types/post.md) | +[**post_oneof_request_body**](../../paths/request_body_post_oneof_request_body/post.md) | +[**post_oneof_response_body_for_content_types**](../../paths/response_body_post_oneof_response_body_for_content_types/post.md) | +[**post_oneof_with_base_schema_request_body**](../../paths/request_body_post_oneof_with_base_schema_request_body/post.md) | +[**post_oneof_with_base_schema_response_body_for_content_types**](../../paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post.md) | +[**post_oneof_with_empty_schema_request_body**](../../paths/request_body_post_oneof_with_empty_schema_request_body/post.md) | +[**post_oneof_with_empty_schema_response_body_for_content_types**](../../paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post.md) | +[**post_oneof_with_required_request_body**](../../paths/request_body_post_oneof_with_required_request_body/post.md) | +[**post_oneof_with_required_response_body_for_content_types**](../../paths/response_body_post_oneof_with_required_response_body_for_content_types/post.md) | + +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/operation_request_body_api.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/operation_request_body_api.md new file mode 100644 index 00000000000..e49b4cfb7bb --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/operation_request_body_api.md @@ -0,0 +1,100 @@ + +unit_test_api.apis.tags.operation_request_body_api +# OperationRequestBodyApi + +All URIs are relative to the selected server +- The server is selected by passing in server_info and server_index into api_configuration.ApiConfiguration +- Code samples in endpoints documents show how to do this +- server_index can also be passed in to endpoint calls, see endpoint documentation + +Method | Description +------ | ------------- +[**post_additionalproperties_allows_a_schema_which_should_validate_request_body**](../../paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post.md) | +[**post_additionalproperties_are_allowed_by_default_request_body**](../../paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post.md) | +[**post_additionalproperties_can_exist_by_itself_request_body**](../../paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post.md) | +[**post_additionalproperties_should_not_look_in_applicators_request_body**](../../paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post.md) | +[**post_allof_combined_with_anyof_oneof_request_body**](../../paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post.md) | +[**post_allof_request_body**](../../paths/request_body_post_allof_request_body/post.md) | +[**post_allof_simple_types_request_body**](../../paths/request_body_post_allof_simple_types_request_body/post.md) | +[**post_allof_with_base_schema_request_body**](../../paths/request_body_post_allof_with_base_schema_request_body/post.md) | +[**post_allof_with_one_empty_schema_request_body**](../../paths/request_body_post_allof_with_one_empty_schema_request_body/post.md) | +[**post_allof_with_the_first_empty_schema_request_body**](../../paths/request_body_post_allof_with_the_first_empty_schema_request_body/post.md) | +[**post_allof_with_the_last_empty_schema_request_body**](../../paths/request_body_post_allof_with_the_last_empty_schema_request_body/post.md) | +[**post_allof_with_two_empty_schemas_request_body**](../../paths/request_body_post_allof_with_two_empty_schemas_request_body/post.md) | +[**post_anyof_complex_types_request_body**](../../paths/request_body_post_anyof_complex_types_request_body/post.md) | +[**post_anyof_request_body**](../../paths/request_body_post_anyof_request_body/post.md) | +[**post_anyof_with_base_schema_request_body**](../../paths/request_body_post_anyof_with_base_schema_request_body/post.md) | +[**post_anyof_with_one_empty_schema_request_body**](../../paths/request_body_post_anyof_with_one_empty_schema_request_body/post.md) | +[**post_array_type_matches_arrays_request_body**](../../paths/request_body_post_array_type_matches_arrays_request_body/post.md) | +[**post_boolean_type_matches_booleans_request_body**](../../paths/request_body_post_boolean_type_matches_booleans_request_body/post.md) | +[**post_by_int_request_body**](../../paths/request_body_post_by_int_request_body/post.md) | +[**post_by_number_request_body**](../../paths/request_body_post_by_number_request_body/post.md) | +[**post_by_small_number_request_body**](../../paths/request_body_post_by_small_number_request_body/post.md) | +[**post_date_time_format_request_body**](../../paths/request_body_post_date_time_format_request_body/post.md) | +[**post_email_format_request_body**](../../paths/request_body_post_email_format_request_body/post.md) | +[**post_enum_with0_does_not_match_false_request_body**](../../paths/request_body_post_enum_with0_does_not_match_false_request_body/post.md) | +[**post_enum_with1_does_not_match_true_request_body**](../../paths/request_body_post_enum_with1_does_not_match_true_request_body/post.md) | +[**post_enum_with_escaped_characters_request_body**](../../paths/request_body_post_enum_with_escaped_characters_request_body/post.md) | +[**post_enum_with_false_does_not_match0_request_body**](../../paths/request_body_post_enum_with_false_does_not_match0_request_body/post.md) | +[**post_enum_with_true_does_not_match1_request_body**](../../paths/request_body_post_enum_with_true_does_not_match1_request_body/post.md) | +[**post_enums_in_properties_request_body**](../../paths/request_body_post_enums_in_properties_request_body/post.md) | +[**post_forbidden_property_request_body**](../../paths/request_body_post_forbidden_property_request_body/post.md) | +[**post_hostname_format_request_body**](../../paths/request_body_post_hostname_format_request_body/post.md) | +[**post_integer_type_matches_integers_request_body**](../../paths/request_body_post_integer_type_matches_integers_request_body/post.md) | +[**post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body**](../../paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post.md) | +[**post_invalid_string_value_for_default_request_body**](../../paths/request_body_post_invalid_string_value_for_default_request_body/post.md) | +[**post_ipv4_format_request_body**](../../paths/request_body_post_ipv4_format_request_body/post.md) | +[**post_ipv6_format_request_body**](../../paths/request_body_post_ipv6_format_request_body/post.md) | +[**post_json_pointer_format_request_body**](../../paths/request_body_post_json_pointer_format_request_body/post.md) | +[**post_maximum_validation_request_body**](../../paths/request_body_post_maximum_validation_request_body/post.md) | +[**post_maximum_validation_with_unsigned_integer_request_body**](../../paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post.md) | +[**post_maxitems_validation_request_body**](../../paths/request_body_post_maxitems_validation_request_body/post.md) | +[**post_maxlength_validation_request_body**](../../paths/request_body_post_maxlength_validation_request_body/post.md) | +[**post_maxproperties0_means_the_object_is_empty_request_body**](../../paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post.md) | +[**post_maxproperties_validation_request_body**](../../paths/request_body_post_maxproperties_validation_request_body/post.md) | +[**post_minimum_validation_request_body**](../../paths/request_body_post_minimum_validation_request_body/post.md) | +[**post_minimum_validation_with_signed_integer_request_body**](../../paths/request_body_post_minimum_validation_with_signed_integer_request_body/post.md) | +[**post_minitems_validation_request_body**](../../paths/request_body_post_minitems_validation_request_body/post.md) | +[**post_minlength_validation_request_body**](../../paths/request_body_post_minlength_validation_request_body/post.md) | +[**post_minproperties_validation_request_body**](../../paths/request_body_post_minproperties_validation_request_body/post.md) | +[**post_nested_allof_to_check_validation_semantics_request_body**](../../paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post.md) | +[**post_nested_anyof_to_check_validation_semantics_request_body**](../../paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post.md) | +[**post_nested_items_request_body**](../../paths/request_body_post_nested_items_request_body/post.md) | +[**post_nested_oneof_to_check_validation_semantics_request_body**](../../paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post.md) | +[**post_not_more_complex_schema_request_body**](../../paths/request_body_post_not_more_complex_schema_request_body/post.md) | +[**post_not_request_body**](../../paths/request_body_post_not_request_body/post.md) | +[**post_nul_characters_in_strings_request_body**](../../paths/request_body_post_nul_characters_in_strings_request_body/post.md) | +[**post_null_type_matches_only_the_null_object_request_body**](../../paths/request_body_post_null_type_matches_only_the_null_object_request_body/post.md) | +[**post_number_type_matches_numbers_request_body**](../../paths/request_body_post_number_type_matches_numbers_request_body/post.md) | +[**post_object_properties_validation_request_body**](../../paths/request_body_post_object_properties_validation_request_body/post.md) | +[**post_object_type_matches_objects_request_body**](../../paths/request_body_post_object_type_matches_objects_request_body/post.md) | +[**post_oneof_complex_types_request_body**](../../paths/request_body_post_oneof_complex_types_request_body/post.md) | +[**post_oneof_request_body**](../../paths/request_body_post_oneof_request_body/post.md) | +[**post_oneof_with_base_schema_request_body**](../../paths/request_body_post_oneof_with_base_schema_request_body/post.md) | +[**post_oneof_with_empty_schema_request_body**](../../paths/request_body_post_oneof_with_empty_schema_request_body/post.md) | +[**post_oneof_with_required_request_body**](../../paths/request_body_post_oneof_with_required_request_body/post.md) | +[**post_pattern_is_not_anchored_request_body**](../../paths/request_body_post_pattern_is_not_anchored_request_body/post.md) | +[**post_pattern_validation_request_body**](../../paths/request_body_post_pattern_validation_request_body/post.md) | +[**post_properties_with_escaped_characters_request_body**](../../paths/request_body_post_properties_with_escaped_characters_request_body/post.md) | +[**post_property_named_ref_that_is_not_a_reference_request_body**](../../paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post.md) | +[**post_ref_in_additionalproperties_request_body**](../../paths/request_body_post_ref_in_additionalproperties_request_body/post.md) | +[**post_ref_in_allof_request_body**](../../paths/request_body_post_ref_in_allof_request_body/post.md) | +[**post_ref_in_anyof_request_body**](../../paths/request_body_post_ref_in_anyof_request_body/post.md) | +[**post_ref_in_items_request_body**](../../paths/request_body_post_ref_in_items_request_body/post.md) | +[**post_ref_in_not_request_body**](../../paths/request_body_post_ref_in_not_request_body/post.md) | +[**post_ref_in_oneof_request_body**](../../paths/request_body_post_ref_in_oneof_request_body/post.md) | +[**post_ref_in_property_request_body**](../../paths/request_body_post_ref_in_property_request_body/post.md) | +[**post_required_default_validation_request_body**](../../paths/request_body_post_required_default_validation_request_body/post.md) | +[**post_required_validation_request_body**](../../paths/request_body_post_required_validation_request_body/post.md) | +[**post_required_with_empty_array_request_body**](../../paths/request_body_post_required_with_empty_array_request_body/post.md) | +[**post_required_with_escaped_characters_request_body**](../../paths/request_body_post_required_with_escaped_characters_request_body/post.md) | +[**post_simple_enum_validation_request_body**](../../paths/request_body_post_simple_enum_validation_request_body/post.md) | +[**post_string_type_matches_strings_request_body**](../../paths/request_body_post_string_type_matches_strings_request_body/post.md) | +[**post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body**](../../paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post.md) | +[**post_uniqueitems_false_validation_request_body**](../../paths/request_body_post_uniqueitems_false_validation_request_body/post.md) | +[**post_uniqueitems_validation_request_body**](../../paths/request_body_post_uniqueitems_validation_request_body/post.md) | +[**post_uri_format_request_body**](../../paths/request_body_post_uri_format_request_body/post.md) | +[**post_uri_reference_format_request_body**](../../paths/request_body_post_uri_reference_format_request_body/post.md) | +[**post_uri_template_format_request_body**](../../paths/request_body_post_uri_template_format_request_body/post.md) | + +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/path_post_api.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/path_post_api.md new file mode 100644 index 00000000000..72bc6e90636 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/path_post_api.md @@ -0,0 +1,187 @@ + +unit_test_api.apis.tags.path_post_api +# PathPostApi + +All URIs are relative to the selected server +- The server is selected by passing in server_info and server_index into api_configuration.ApiConfiguration +- Code samples in endpoints documents show how to do this +- server_index can also be passed in to endpoint calls, see endpoint documentation + +Method | Description +------ | ------------- +[**post_additionalproperties_allows_a_schema_which_should_validate_request_body**](../../paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post.md) | +[**post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types**](../../paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post.md) | +[**post_additionalproperties_are_allowed_by_default_request_body**](../../paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post.md) | +[**post_additionalproperties_are_allowed_by_default_response_body_for_content_types**](../../paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post.md) | +[**post_additionalproperties_can_exist_by_itself_request_body**](../../paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post.md) | +[**post_additionalproperties_can_exist_by_itself_response_body_for_content_types**](../../paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post.md) | +[**post_additionalproperties_should_not_look_in_applicators_request_body**](../../paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post.md) | +[**post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types**](../../paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post.md) | +[**post_allof_combined_with_anyof_oneof_request_body**](../../paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post.md) | +[**post_allof_combined_with_anyof_oneof_response_body_for_content_types**](../../paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post.md) | +[**post_allof_request_body**](../../paths/request_body_post_allof_request_body/post.md) | +[**post_allof_response_body_for_content_types**](../../paths/response_body_post_allof_response_body_for_content_types/post.md) | +[**post_allof_simple_types_request_body**](../../paths/request_body_post_allof_simple_types_request_body/post.md) | +[**post_allof_simple_types_response_body_for_content_types**](../../paths/response_body_post_allof_simple_types_response_body_for_content_types/post.md) | +[**post_allof_with_base_schema_request_body**](../../paths/request_body_post_allof_with_base_schema_request_body/post.md) | +[**post_allof_with_base_schema_response_body_for_content_types**](../../paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post.md) | +[**post_allof_with_one_empty_schema_request_body**](../../paths/request_body_post_allof_with_one_empty_schema_request_body/post.md) | +[**post_allof_with_one_empty_schema_response_body_for_content_types**](../../paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post.md) | +[**post_allof_with_the_first_empty_schema_request_body**](../../paths/request_body_post_allof_with_the_first_empty_schema_request_body/post.md) | +[**post_allof_with_the_first_empty_schema_response_body_for_content_types**](../../paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post.md) | +[**post_allof_with_the_last_empty_schema_request_body**](../../paths/request_body_post_allof_with_the_last_empty_schema_request_body/post.md) | +[**post_allof_with_the_last_empty_schema_response_body_for_content_types**](../../paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post.md) | +[**post_allof_with_two_empty_schemas_request_body**](../../paths/request_body_post_allof_with_two_empty_schemas_request_body/post.md) | +[**post_allof_with_two_empty_schemas_response_body_for_content_types**](../../paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post.md) | +[**post_anyof_complex_types_request_body**](../../paths/request_body_post_anyof_complex_types_request_body/post.md) | +[**post_anyof_complex_types_response_body_for_content_types**](../../paths/response_body_post_anyof_complex_types_response_body_for_content_types/post.md) | +[**post_anyof_request_body**](../../paths/request_body_post_anyof_request_body/post.md) | +[**post_anyof_response_body_for_content_types**](../../paths/response_body_post_anyof_response_body_for_content_types/post.md) | +[**post_anyof_with_base_schema_request_body**](../../paths/request_body_post_anyof_with_base_schema_request_body/post.md) | +[**post_anyof_with_base_schema_response_body_for_content_types**](../../paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post.md) | +[**post_anyof_with_one_empty_schema_request_body**](../../paths/request_body_post_anyof_with_one_empty_schema_request_body/post.md) | +[**post_anyof_with_one_empty_schema_response_body_for_content_types**](../../paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post.md) | +[**post_array_type_matches_arrays_request_body**](../../paths/request_body_post_array_type_matches_arrays_request_body/post.md) | +[**post_array_type_matches_arrays_response_body_for_content_types**](../../paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post.md) | +[**post_boolean_type_matches_booleans_request_body**](../../paths/request_body_post_boolean_type_matches_booleans_request_body/post.md) | +[**post_boolean_type_matches_booleans_response_body_for_content_types**](../../paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post.md) | +[**post_by_int_request_body**](../../paths/request_body_post_by_int_request_body/post.md) | +[**post_by_int_response_body_for_content_types**](../../paths/response_body_post_by_int_response_body_for_content_types/post.md) | +[**post_by_number_request_body**](../../paths/request_body_post_by_number_request_body/post.md) | +[**post_by_number_response_body_for_content_types**](../../paths/response_body_post_by_number_response_body_for_content_types/post.md) | +[**post_by_small_number_request_body**](../../paths/request_body_post_by_small_number_request_body/post.md) | +[**post_by_small_number_response_body_for_content_types**](../../paths/response_body_post_by_small_number_response_body_for_content_types/post.md) | +[**post_date_time_format_request_body**](../../paths/request_body_post_date_time_format_request_body/post.md) | +[**post_date_time_format_response_body_for_content_types**](../../paths/response_body_post_date_time_format_response_body_for_content_types/post.md) | +[**post_email_format_request_body**](../../paths/request_body_post_email_format_request_body/post.md) | +[**post_email_format_response_body_for_content_types**](../../paths/response_body_post_email_format_response_body_for_content_types/post.md) | +[**post_enum_with0_does_not_match_false_request_body**](../../paths/request_body_post_enum_with0_does_not_match_false_request_body/post.md) | +[**post_enum_with0_does_not_match_false_response_body_for_content_types**](../../paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post.md) | +[**post_enum_with1_does_not_match_true_request_body**](../../paths/request_body_post_enum_with1_does_not_match_true_request_body/post.md) | +[**post_enum_with1_does_not_match_true_response_body_for_content_types**](../../paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post.md) | +[**post_enum_with_escaped_characters_request_body**](../../paths/request_body_post_enum_with_escaped_characters_request_body/post.md) | +[**post_enum_with_escaped_characters_response_body_for_content_types**](../../paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post.md) | +[**post_enum_with_false_does_not_match0_request_body**](../../paths/request_body_post_enum_with_false_does_not_match0_request_body/post.md) | +[**post_enum_with_false_does_not_match0_response_body_for_content_types**](../../paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post.md) | +[**post_enum_with_true_does_not_match1_request_body**](../../paths/request_body_post_enum_with_true_does_not_match1_request_body/post.md) | +[**post_enum_with_true_does_not_match1_response_body_for_content_types**](../../paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post.md) | +[**post_enums_in_properties_request_body**](../../paths/request_body_post_enums_in_properties_request_body/post.md) | +[**post_enums_in_properties_response_body_for_content_types**](../../paths/response_body_post_enums_in_properties_response_body_for_content_types/post.md) | +[**post_forbidden_property_request_body**](../../paths/request_body_post_forbidden_property_request_body/post.md) | +[**post_forbidden_property_response_body_for_content_types**](../../paths/response_body_post_forbidden_property_response_body_for_content_types/post.md) | +[**post_hostname_format_request_body**](../../paths/request_body_post_hostname_format_request_body/post.md) | +[**post_hostname_format_response_body_for_content_types**](../../paths/response_body_post_hostname_format_response_body_for_content_types/post.md) | +[**post_integer_type_matches_integers_request_body**](../../paths/request_body_post_integer_type_matches_integers_request_body/post.md) | +[**post_integer_type_matches_integers_response_body_for_content_types**](../../paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post.md) | +[**post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body**](../../paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post.md) | +[**post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types**](../../paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post.md) | +[**post_invalid_string_value_for_default_request_body**](../../paths/request_body_post_invalid_string_value_for_default_request_body/post.md) | +[**post_invalid_string_value_for_default_response_body_for_content_types**](../../paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post.md) | +[**post_ipv4_format_request_body**](../../paths/request_body_post_ipv4_format_request_body/post.md) | +[**post_ipv4_format_response_body_for_content_types**](../../paths/response_body_post_ipv4_format_response_body_for_content_types/post.md) | +[**post_ipv6_format_request_body**](../../paths/request_body_post_ipv6_format_request_body/post.md) | +[**post_ipv6_format_response_body_for_content_types**](../../paths/response_body_post_ipv6_format_response_body_for_content_types/post.md) | +[**post_json_pointer_format_request_body**](../../paths/request_body_post_json_pointer_format_request_body/post.md) | +[**post_json_pointer_format_response_body_for_content_types**](../../paths/response_body_post_json_pointer_format_response_body_for_content_types/post.md) | +[**post_maximum_validation_request_body**](../../paths/request_body_post_maximum_validation_request_body/post.md) | +[**post_maximum_validation_response_body_for_content_types**](../../paths/response_body_post_maximum_validation_response_body_for_content_types/post.md) | +[**post_maximum_validation_with_unsigned_integer_request_body**](../../paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post.md) | +[**post_maximum_validation_with_unsigned_integer_response_body_for_content_types**](../../paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post.md) | +[**post_maxitems_validation_request_body**](../../paths/request_body_post_maxitems_validation_request_body/post.md) | +[**post_maxitems_validation_response_body_for_content_types**](../../paths/response_body_post_maxitems_validation_response_body_for_content_types/post.md) | +[**post_maxlength_validation_request_body**](../../paths/request_body_post_maxlength_validation_request_body/post.md) | +[**post_maxlength_validation_response_body_for_content_types**](../../paths/response_body_post_maxlength_validation_response_body_for_content_types/post.md) | +[**post_maxproperties0_means_the_object_is_empty_request_body**](../../paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post.md) | +[**post_maxproperties0_means_the_object_is_empty_response_body_for_content_types**](../../paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post.md) | +[**post_maxproperties_validation_request_body**](../../paths/request_body_post_maxproperties_validation_request_body/post.md) | +[**post_maxproperties_validation_response_body_for_content_types**](../../paths/response_body_post_maxproperties_validation_response_body_for_content_types/post.md) | +[**post_minimum_validation_request_body**](../../paths/request_body_post_minimum_validation_request_body/post.md) | +[**post_minimum_validation_response_body_for_content_types**](../../paths/response_body_post_minimum_validation_response_body_for_content_types/post.md) | +[**post_minimum_validation_with_signed_integer_request_body**](../../paths/request_body_post_minimum_validation_with_signed_integer_request_body/post.md) | +[**post_minimum_validation_with_signed_integer_response_body_for_content_types**](../../paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post.md) | +[**post_minitems_validation_request_body**](../../paths/request_body_post_minitems_validation_request_body/post.md) | +[**post_minitems_validation_response_body_for_content_types**](../../paths/response_body_post_minitems_validation_response_body_for_content_types/post.md) | +[**post_minlength_validation_request_body**](../../paths/request_body_post_minlength_validation_request_body/post.md) | +[**post_minlength_validation_response_body_for_content_types**](../../paths/response_body_post_minlength_validation_response_body_for_content_types/post.md) | +[**post_minproperties_validation_request_body**](../../paths/request_body_post_minproperties_validation_request_body/post.md) | +[**post_minproperties_validation_response_body_for_content_types**](../../paths/response_body_post_minproperties_validation_response_body_for_content_types/post.md) | +[**post_nested_allof_to_check_validation_semantics_request_body**](../../paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post.md) | +[**post_nested_allof_to_check_validation_semantics_response_body_for_content_types**](../../paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post.md) | +[**post_nested_anyof_to_check_validation_semantics_request_body**](../../paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post.md) | +[**post_nested_anyof_to_check_validation_semantics_response_body_for_content_types**](../../paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post.md) | +[**post_nested_items_request_body**](../../paths/request_body_post_nested_items_request_body/post.md) | +[**post_nested_items_response_body_for_content_types**](../../paths/response_body_post_nested_items_response_body_for_content_types/post.md) | +[**post_nested_oneof_to_check_validation_semantics_request_body**](../../paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post.md) | +[**post_nested_oneof_to_check_validation_semantics_response_body_for_content_types**](../../paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post.md) | +[**post_not_more_complex_schema_request_body**](../../paths/request_body_post_not_more_complex_schema_request_body/post.md) | +[**post_not_more_complex_schema_response_body_for_content_types**](../../paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post.md) | +[**post_not_request_body**](../../paths/request_body_post_not_request_body/post.md) | +[**post_not_response_body_for_content_types**](../../paths/response_body_post_not_response_body_for_content_types/post.md) | +[**post_nul_characters_in_strings_request_body**](../../paths/request_body_post_nul_characters_in_strings_request_body/post.md) | +[**post_nul_characters_in_strings_response_body_for_content_types**](../../paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post.md) | +[**post_null_type_matches_only_the_null_object_request_body**](../../paths/request_body_post_null_type_matches_only_the_null_object_request_body/post.md) | +[**post_null_type_matches_only_the_null_object_response_body_for_content_types**](../../paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post.md) | +[**post_number_type_matches_numbers_request_body**](../../paths/request_body_post_number_type_matches_numbers_request_body/post.md) | +[**post_number_type_matches_numbers_response_body_for_content_types**](../../paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post.md) | +[**post_object_properties_validation_request_body**](../../paths/request_body_post_object_properties_validation_request_body/post.md) | +[**post_object_properties_validation_response_body_for_content_types**](../../paths/response_body_post_object_properties_validation_response_body_for_content_types/post.md) | +[**post_object_type_matches_objects_request_body**](../../paths/request_body_post_object_type_matches_objects_request_body/post.md) | +[**post_object_type_matches_objects_response_body_for_content_types**](../../paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post.md) | +[**post_oneof_complex_types_request_body**](../../paths/request_body_post_oneof_complex_types_request_body/post.md) | +[**post_oneof_complex_types_response_body_for_content_types**](../../paths/response_body_post_oneof_complex_types_response_body_for_content_types/post.md) | +[**post_oneof_request_body**](../../paths/request_body_post_oneof_request_body/post.md) | +[**post_oneof_response_body_for_content_types**](../../paths/response_body_post_oneof_response_body_for_content_types/post.md) | +[**post_oneof_with_base_schema_request_body**](../../paths/request_body_post_oneof_with_base_schema_request_body/post.md) | +[**post_oneof_with_base_schema_response_body_for_content_types**](../../paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post.md) | +[**post_oneof_with_empty_schema_request_body**](../../paths/request_body_post_oneof_with_empty_schema_request_body/post.md) | +[**post_oneof_with_empty_schema_response_body_for_content_types**](../../paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post.md) | +[**post_oneof_with_required_request_body**](../../paths/request_body_post_oneof_with_required_request_body/post.md) | +[**post_oneof_with_required_response_body_for_content_types**](../../paths/response_body_post_oneof_with_required_response_body_for_content_types/post.md) | +[**post_pattern_is_not_anchored_request_body**](../../paths/request_body_post_pattern_is_not_anchored_request_body/post.md) | +[**post_pattern_is_not_anchored_response_body_for_content_types**](../../paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post.md) | +[**post_pattern_validation_request_body**](../../paths/request_body_post_pattern_validation_request_body/post.md) | +[**post_pattern_validation_response_body_for_content_types**](../../paths/response_body_post_pattern_validation_response_body_for_content_types/post.md) | +[**post_properties_with_escaped_characters_request_body**](../../paths/request_body_post_properties_with_escaped_characters_request_body/post.md) | +[**post_properties_with_escaped_characters_response_body_for_content_types**](../../paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post.md) | +[**post_property_named_ref_that_is_not_a_reference_request_body**](../../paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post.md) | +[**post_property_named_ref_that_is_not_a_reference_response_body_for_content_types**](../../paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post.md) | +[**post_ref_in_additionalproperties_request_body**](../../paths/request_body_post_ref_in_additionalproperties_request_body/post.md) | +[**post_ref_in_additionalproperties_response_body_for_content_types**](../../paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post.md) | +[**post_ref_in_allof_request_body**](../../paths/request_body_post_ref_in_allof_request_body/post.md) | +[**post_ref_in_allof_response_body_for_content_types**](../../paths/response_body_post_ref_in_allof_response_body_for_content_types/post.md) | +[**post_ref_in_anyof_request_body**](../../paths/request_body_post_ref_in_anyof_request_body/post.md) | +[**post_ref_in_anyof_response_body_for_content_types**](../../paths/response_body_post_ref_in_anyof_response_body_for_content_types/post.md) | +[**post_ref_in_items_request_body**](../../paths/request_body_post_ref_in_items_request_body/post.md) | +[**post_ref_in_items_response_body_for_content_types**](../../paths/response_body_post_ref_in_items_response_body_for_content_types/post.md) | +[**post_ref_in_not_request_body**](../../paths/request_body_post_ref_in_not_request_body/post.md) | +[**post_ref_in_not_response_body_for_content_types**](../../paths/response_body_post_ref_in_not_response_body_for_content_types/post.md) | +[**post_ref_in_oneof_request_body**](../../paths/request_body_post_ref_in_oneof_request_body/post.md) | +[**post_ref_in_oneof_response_body_for_content_types**](../../paths/response_body_post_ref_in_oneof_response_body_for_content_types/post.md) | +[**post_ref_in_property_request_body**](../../paths/request_body_post_ref_in_property_request_body/post.md) | +[**post_ref_in_property_response_body_for_content_types**](../../paths/response_body_post_ref_in_property_response_body_for_content_types/post.md) | +[**post_required_default_validation_request_body**](../../paths/request_body_post_required_default_validation_request_body/post.md) | +[**post_required_default_validation_response_body_for_content_types**](../../paths/response_body_post_required_default_validation_response_body_for_content_types/post.md) | +[**post_required_validation_request_body**](../../paths/request_body_post_required_validation_request_body/post.md) | +[**post_required_validation_response_body_for_content_types**](../../paths/response_body_post_required_validation_response_body_for_content_types/post.md) | +[**post_required_with_empty_array_request_body**](../../paths/request_body_post_required_with_empty_array_request_body/post.md) | +[**post_required_with_empty_array_response_body_for_content_types**](../../paths/response_body_post_required_with_empty_array_response_body_for_content_types/post.md) | +[**post_required_with_escaped_characters_request_body**](../../paths/request_body_post_required_with_escaped_characters_request_body/post.md) | +[**post_required_with_escaped_characters_response_body_for_content_types**](../../paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post.md) | +[**post_simple_enum_validation_request_body**](../../paths/request_body_post_simple_enum_validation_request_body/post.md) | +[**post_simple_enum_validation_response_body_for_content_types**](../../paths/response_body_post_simple_enum_validation_response_body_for_content_types/post.md) | +[**post_string_type_matches_strings_request_body**](../../paths/request_body_post_string_type_matches_strings_request_body/post.md) | +[**post_string_type_matches_strings_response_body_for_content_types**](../../paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post.md) | +[**post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body**](../../paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post.md) | +[**post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types**](../../paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post.md) | +[**post_uniqueitems_false_validation_request_body**](../../paths/request_body_post_uniqueitems_false_validation_request_body/post.md) | +[**post_uniqueitems_false_validation_response_body_for_content_types**](../../paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post.md) | +[**post_uniqueitems_validation_request_body**](../../paths/request_body_post_uniqueitems_validation_request_body/post.md) | +[**post_uniqueitems_validation_response_body_for_content_types**](../../paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post.md) | +[**post_uri_format_request_body**](../../paths/request_body_post_uri_format_request_body/post.md) | +[**post_uri_format_response_body_for_content_types**](../../paths/response_body_post_uri_format_response_body_for_content_types/post.md) | +[**post_uri_reference_format_request_body**](../../paths/request_body_post_uri_reference_format_request_body/post.md) | +[**post_uri_reference_format_response_body_for_content_types**](../../paths/response_body_post_uri_reference_format_response_body_for_content_types/post.md) | +[**post_uri_template_format_request_body**](../../paths/request_body_post_uri_template_format_request_body/post.md) | +[**post_uri_template_format_response_body_for_content_types**](../../paths/response_body_post_uri_template_format_response_body_for_content_types/post.md) | + +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/pattern_api.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/pattern_api.md new file mode 100644 index 00000000000..e36a5db710f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/pattern_api.md @@ -0,0 +1,17 @@ + +unit_test_api.apis.tags.pattern_api +# PatternApi + +All URIs are relative to the selected server +- The server is selected by passing in server_info and server_index into api_configuration.ApiConfiguration +- Code samples in endpoints documents show how to do this +- server_index can also be passed in to endpoint calls, see endpoint documentation + +Method | Description +------ | ------------- +[**post_pattern_is_not_anchored_request_body**](../../paths/request_body_post_pattern_is_not_anchored_request_body/post.md) | +[**post_pattern_is_not_anchored_response_body_for_content_types**](../../paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post.md) | +[**post_pattern_validation_request_body**](../../paths/request_body_post_pattern_validation_request_body/post.md) | +[**post_pattern_validation_response_body_for_content_types**](../../paths/response_body_post_pattern_validation_response_body_for_content_types/post.md) | + +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/properties_api.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/properties_api.md new file mode 100644 index 00000000000..49bc5901215 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/properties_api.md @@ -0,0 +1,17 @@ + +unit_test_api.apis.tags.properties_api +# PropertiesApi + +All URIs are relative to the selected server +- The server is selected by passing in server_info and server_index into api_configuration.ApiConfiguration +- Code samples in endpoints documents show how to do this +- server_index can also be passed in to endpoint calls, see endpoint documentation + +Method | Description +------ | ------------- +[**post_object_properties_validation_request_body**](../../paths/request_body_post_object_properties_validation_request_body/post.md) | +[**post_object_properties_validation_response_body_for_content_types**](../../paths/response_body_post_object_properties_validation_response_body_for_content_types/post.md) | +[**post_properties_with_escaped_characters_request_body**](../../paths/request_body_post_properties_with_escaped_characters_request_body/post.md) | +[**post_properties_with_escaped_characters_response_body_for_content_types**](../../paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post.md) | + +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/ref_api.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/ref_api.md new file mode 100644 index 00000000000..eef0c1721f6 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/ref_api.md @@ -0,0 +1,29 @@ + +unit_test_api.apis.tags.ref_api +# RefApi + +All URIs are relative to the selected server +- The server is selected by passing in server_info and server_index into api_configuration.ApiConfiguration +- Code samples in endpoints documents show how to do this +- server_index can also be passed in to endpoint calls, see endpoint documentation + +Method | Description +------ | ------------- +[**post_property_named_ref_that_is_not_a_reference_request_body**](../../paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post.md) | +[**post_property_named_ref_that_is_not_a_reference_response_body_for_content_types**](../../paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post.md) | +[**post_ref_in_additionalproperties_request_body**](../../paths/request_body_post_ref_in_additionalproperties_request_body/post.md) | +[**post_ref_in_additionalproperties_response_body_for_content_types**](../../paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post.md) | +[**post_ref_in_allof_request_body**](../../paths/request_body_post_ref_in_allof_request_body/post.md) | +[**post_ref_in_allof_response_body_for_content_types**](../../paths/response_body_post_ref_in_allof_response_body_for_content_types/post.md) | +[**post_ref_in_anyof_request_body**](../../paths/request_body_post_ref_in_anyof_request_body/post.md) | +[**post_ref_in_anyof_response_body_for_content_types**](../../paths/response_body_post_ref_in_anyof_response_body_for_content_types/post.md) | +[**post_ref_in_items_request_body**](../../paths/request_body_post_ref_in_items_request_body/post.md) | +[**post_ref_in_items_response_body_for_content_types**](../../paths/response_body_post_ref_in_items_response_body_for_content_types/post.md) | +[**post_ref_in_not_request_body**](../../paths/request_body_post_ref_in_not_request_body/post.md) | +[**post_ref_in_not_response_body_for_content_types**](../../paths/response_body_post_ref_in_not_response_body_for_content_types/post.md) | +[**post_ref_in_oneof_request_body**](../../paths/request_body_post_ref_in_oneof_request_body/post.md) | +[**post_ref_in_oneof_response_body_for_content_types**](../../paths/response_body_post_ref_in_oneof_response_body_for_content_types/post.md) | +[**post_ref_in_property_request_body**](../../paths/request_body_post_ref_in_property_request_body/post.md) | +[**post_ref_in_property_response_body_for_content_types**](../../paths/response_body_post_ref_in_property_response_body_for_content_types/post.md) | + +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/required_api.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/required_api.md new file mode 100644 index 00000000000..a37631ea5ea --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/required_api.md @@ -0,0 +1,21 @@ + +unit_test_api.apis.tags.required_api +# RequiredApi + +All URIs are relative to the selected server +- The server is selected by passing in server_info and server_index into api_configuration.ApiConfiguration +- Code samples in endpoints documents show how to do this +- server_index can also be passed in to endpoint calls, see endpoint documentation + +Method | Description +------ | ------------- +[**post_required_default_validation_request_body**](../../paths/request_body_post_required_default_validation_request_body/post.md) | +[**post_required_default_validation_response_body_for_content_types**](../../paths/response_body_post_required_default_validation_response_body_for_content_types/post.md) | +[**post_required_validation_request_body**](../../paths/request_body_post_required_validation_request_body/post.md) | +[**post_required_validation_response_body_for_content_types**](../../paths/response_body_post_required_validation_response_body_for_content_types/post.md) | +[**post_required_with_empty_array_request_body**](../../paths/request_body_post_required_with_empty_array_request_body/post.md) | +[**post_required_with_empty_array_response_body_for_content_types**](../../paths/response_body_post_required_with_empty_array_response_body_for_content_types/post.md) | +[**post_required_with_escaped_characters_request_body**](../../paths/request_body_post_required_with_escaped_characters_request_body/post.md) | +[**post_required_with_escaped_characters_response_body_for_content_types**](../../paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post.md) | + +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/response_content_content_type_schema_api.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/response_content_content_type_schema_api.md new file mode 100644 index 00000000000..31eea7f8cea --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/response_content_content_type_schema_api.md @@ -0,0 +1,100 @@ + +unit_test_api.apis.tags.response_content_content_type_schema_api +# ResponseContentContentTypeSchemaApi + +All URIs are relative to the selected server +- The server is selected by passing in server_info and server_index into api_configuration.ApiConfiguration +- Code samples in endpoints documents show how to do this +- server_index can also be passed in to endpoint calls, see endpoint documentation + +Method | Description +------ | ------------- +[**post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types**](../../paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post.md) | +[**post_additionalproperties_are_allowed_by_default_response_body_for_content_types**](../../paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post.md) | +[**post_additionalproperties_can_exist_by_itself_response_body_for_content_types**](../../paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post.md) | +[**post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types**](../../paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post.md) | +[**post_allof_combined_with_anyof_oneof_response_body_for_content_types**](../../paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post.md) | +[**post_allof_response_body_for_content_types**](../../paths/response_body_post_allof_response_body_for_content_types/post.md) | +[**post_allof_simple_types_response_body_for_content_types**](../../paths/response_body_post_allof_simple_types_response_body_for_content_types/post.md) | +[**post_allof_with_base_schema_response_body_for_content_types**](../../paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post.md) | +[**post_allof_with_one_empty_schema_response_body_for_content_types**](../../paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post.md) | +[**post_allof_with_the_first_empty_schema_response_body_for_content_types**](../../paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post.md) | +[**post_allof_with_the_last_empty_schema_response_body_for_content_types**](../../paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post.md) | +[**post_allof_with_two_empty_schemas_response_body_for_content_types**](../../paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post.md) | +[**post_anyof_complex_types_response_body_for_content_types**](../../paths/response_body_post_anyof_complex_types_response_body_for_content_types/post.md) | +[**post_anyof_response_body_for_content_types**](../../paths/response_body_post_anyof_response_body_for_content_types/post.md) | +[**post_anyof_with_base_schema_response_body_for_content_types**](../../paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post.md) | +[**post_anyof_with_one_empty_schema_response_body_for_content_types**](../../paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post.md) | +[**post_array_type_matches_arrays_response_body_for_content_types**](../../paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post.md) | +[**post_boolean_type_matches_booleans_response_body_for_content_types**](../../paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post.md) | +[**post_by_int_response_body_for_content_types**](../../paths/response_body_post_by_int_response_body_for_content_types/post.md) | +[**post_by_number_response_body_for_content_types**](../../paths/response_body_post_by_number_response_body_for_content_types/post.md) | +[**post_by_small_number_response_body_for_content_types**](../../paths/response_body_post_by_small_number_response_body_for_content_types/post.md) | +[**post_date_time_format_response_body_for_content_types**](../../paths/response_body_post_date_time_format_response_body_for_content_types/post.md) | +[**post_email_format_response_body_for_content_types**](../../paths/response_body_post_email_format_response_body_for_content_types/post.md) | +[**post_enum_with0_does_not_match_false_response_body_for_content_types**](../../paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post.md) | +[**post_enum_with1_does_not_match_true_response_body_for_content_types**](../../paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post.md) | +[**post_enum_with_escaped_characters_response_body_for_content_types**](../../paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post.md) | +[**post_enum_with_false_does_not_match0_response_body_for_content_types**](../../paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post.md) | +[**post_enum_with_true_does_not_match1_response_body_for_content_types**](../../paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post.md) | +[**post_enums_in_properties_response_body_for_content_types**](../../paths/response_body_post_enums_in_properties_response_body_for_content_types/post.md) | +[**post_forbidden_property_response_body_for_content_types**](../../paths/response_body_post_forbidden_property_response_body_for_content_types/post.md) | +[**post_hostname_format_response_body_for_content_types**](../../paths/response_body_post_hostname_format_response_body_for_content_types/post.md) | +[**post_integer_type_matches_integers_response_body_for_content_types**](../../paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post.md) | +[**post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types**](../../paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post.md) | +[**post_invalid_string_value_for_default_response_body_for_content_types**](../../paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post.md) | +[**post_ipv4_format_response_body_for_content_types**](../../paths/response_body_post_ipv4_format_response_body_for_content_types/post.md) | +[**post_ipv6_format_response_body_for_content_types**](../../paths/response_body_post_ipv6_format_response_body_for_content_types/post.md) | +[**post_json_pointer_format_response_body_for_content_types**](../../paths/response_body_post_json_pointer_format_response_body_for_content_types/post.md) | +[**post_maximum_validation_response_body_for_content_types**](../../paths/response_body_post_maximum_validation_response_body_for_content_types/post.md) | +[**post_maximum_validation_with_unsigned_integer_response_body_for_content_types**](../../paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post.md) | +[**post_maxitems_validation_response_body_for_content_types**](../../paths/response_body_post_maxitems_validation_response_body_for_content_types/post.md) | +[**post_maxlength_validation_response_body_for_content_types**](../../paths/response_body_post_maxlength_validation_response_body_for_content_types/post.md) | +[**post_maxproperties0_means_the_object_is_empty_response_body_for_content_types**](../../paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post.md) | +[**post_maxproperties_validation_response_body_for_content_types**](../../paths/response_body_post_maxproperties_validation_response_body_for_content_types/post.md) | +[**post_minimum_validation_response_body_for_content_types**](../../paths/response_body_post_minimum_validation_response_body_for_content_types/post.md) | +[**post_minimum_validation_with_signed_integer_response_body_for_content_types**](../../paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post.md) | +[**post_minitems_validation_response_body_for_content_types**](../../paths/response_body_post_minitems_validation_response_body_for_content_types/post.md) | +[**post_minlength_validation_response_body_for_content_types**](../../paths/response_body_post_minlength_validation_response_body_for_content_types/post.md) | +[**post_minproperties_validation_response_body_for_content_types**](../../paths/response_body_post_minproperties_validation_response_body_for_content_types/post.md) | +[**post_nested_allof_to_check_validation_semantics_response_body_for_content_types**](../../paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post.md) | +[**post_nested_anyof_to_check_validation_semantics_response_body_for_content_types**](../../paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post.md) | +[**post_nested_items_response_body_for_content_types**](../../paths/response_body_post_nested_items_response_body_for_content_types/post.md) | +[**post_nested_oneof_to_check_validation_semantics_response_body_for_content_types**](../../paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post.md) | +[**post_not_more_complex_schema_response_body_for_content_types**](../../paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post.md) | +[**post_not_response_body_for_content_types**](../../paths/response_body_post_not_response_body_for_content_types/post.md) | +[**post_nul_characters_in_strings_response_body_for_content_types**](../../paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post.md) | +[**post_null_type_matches_only_the_null_object_response_body_for_content_types**](../../paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post.md) | +[**post_number_type_matches_numbers_response_body_for_content_types**](../../paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post.md) | +[**post_object_properties_validation_response_body_for_content_types**](../../paths/response_body_post_object_properties_validation_response_body_for_content_types/post.md) | +[**post_object_type_matches_objects_response_body_for_content_types**](../../paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post.md) | +[**post_oneof_complex_types_response_body_for_content_types**](../../paths/response_body_post_oneof_complex_types_response_body_for_content_types/post.md) | +[**post_oneof_response_body_for_content_types**](../../paths/response_body_post_oneof_response_body_for_content_types/post.md) | +[**post_oneof_with_base_schema_response_body_for_content_types**](../../paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post.md) | +[**post_oneof_with_empty_schema_response_body_for_content_types**](../../paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post.md) | +[**post_oneof_with_required_response_body_for_content_types**](../../paths/response_body_post_oneof_with_required_response_body_for_content_types/post.md) | +[**post_pattern_is_not_anchored_response_body_for_content_types**](../../paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post.md) | +[**post_pattern_validation_response_body_for_content_types**](../../paths/response_body_post_pattern_validation_response_body_for_content_types/post.md) | +[**post_properties_with_escaped_characters_response_body_for_content_types**](../../paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post.md) | +[**post_property_named_ref_that_is_not_a_reference_response_body_for_content_types**](../../paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post.md) | +[**post_ref_in_additionalproperties_response_body_for_content_types**](../../paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post.md) | +[**post_ref_in_allof_response_body_for_content_types**](../../paths/response_body_post_ref_in_allof_response_body_for_content_types/post.md) | +[**post_ref_in_anyof_response_body_for_content_types**](../../paths/response_body_post_ref_in_anyof_response_body_for_content_types/post.md) | +[**post_ref_in_items_response_body_for_content_types**](../../paths/response_body_post_ref_in_items_response_body_for_content_types/post.md) | +[**post_ref_in_not_response_body_for_content_types**](../../paths/response_body_post_ref_in_not_response_body_for_content_types/post.md) | +[**post_ref_in_oneof_response_body_for_content_types**](../../paths/response_body_post_ref_in_oneof_response_body_for_content_types/post.md) | +[**post_ref_in_property_response_body_for_content_types**](../../paths/response_body_post_ref_in_property_response_body_for_content_types/post.md) | +[**post_required_default_validation_response_body_for_content_types**](../../paths/response_body_post_required_default_validation_response_body_for_content_types/post.md) | +[**post_required_validation_response_body_for_content_types**](../../paths/response_body_post_required_validation_response_body_for_content_types/post.md) | +[**post_required_with_empty_array_response_body_for_content_types**](../../paths/response_body_post_required_with_empty_array_response_body_for_content_types/post.md) | +[**post_required_with_escaped_characters_response_body_for_content_types**](../../paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post.md) | +[**post_simple_enum_validation_response_body_for_content_types**](../../paths/response_body_post_simple_enum_validation_response_body_for_content_types/post.md) | +[**post_string_type_matches_strings_response_body_for_content_types**](../../paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post.md) | +[**post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types**](../../paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post.md) | +[**post_uniqueitems_false_validation_response_body_for_content_types**](../../paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post.md) | +[**post_uniqueitems_validation_response_body_for_content_types**](../../paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post.md) | +[**post_uri_format_response_body_for_content_types**](../../paths/response_body_post_uri_format_response_body_for_content_types/post.md) | +[**post_uri_reference_format_response_body_for_content_types**](../../paths/response_body_post_uri_reference_format_response_body_for_content_types/post.md) | +[**post_uri_template_format_response_body_for_content_types**](../../paths/response_body_post_uri_template_format_response_body_for_content_types/post.md) | + +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/type_api.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/type_api.md new file mode 100644 index 00000000000..547c75e6739 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/type_api.md @@ -0,0 +1,27 @@ + +unit_test_api.apis.tags.type_api +# TypeApi + +All URIs are relative to the selected server +- The server is selected by passing in server_info and server_index into api_configuration.ApiConfiguration +- Code samples in endpoints documents show how to do this +- server_index can also be passed in to endpoint calls, see endpoint documentation + +Method | Description +------ | ------------- +[**post_array_type_matches_arrays_request_body**](../../paths/request_body_post_array_type_matches_arrays_request_body/post.md) | +[**post_array_type_matches_arrays_response_body_for_content_types**](../../paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post.md) | +[**post_boolean_type_matches_booleans_request_body**](../../paths/request_body_post_boolean_type_matches_booleans_request_body/post.md) | +[**post_boolean_type_matches_booleans_response_body_for_content_types**](../../paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post.md) | +[**post_integer_type_matches_integers_request_body**](../../paths/request_body_post_integer_type_matches_integers_request_body/post.md) | +[**post_integer_type_matches_integers_response_body_for_content_types**](../../paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post.md) | +[**post_null_type_matches_only_the_null_object_request_body**](../../paths/request_body_post_null_type_matches_only_the_null_object_request_body/post.md) | +[**post_null_type_matches_only_the_null_object_response_body_for_content_types**](../../paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post.md) | +[**post_number_type_matches_numbers_request_body**](../../paths/request_body_post_number_type_matches_numbers_request_body/post.md) | +[**post_number_type_matches_numbers_response_body_for_content_types**](../../paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post.md) | +[**post_object_type_matches_objects_request_body**](../../paths/request_body_post_object_type_matches_objects_request_body/post.md) | +[**post_object_type_matches_objects_response_body_for_content_types**](../../paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post.md) | +[**post_string_type_matches_strings_request_body**](../../paths/request_body_post_string_type_matches_strings_request_body/post.md) | +[**post_string_type_matches_strings_response_body_for_content_types**](../../paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post.md) | + +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/unique_items_api.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/unique_items_api.md new file mode 100644 index 00000000000..8c687b43559 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/unique_items_api.md @@ -0,0 +1,17 @@ + +unit_test_api.apis.tags.unique_items_api +# UniqueItemsApi + +All URIs are relative to the selected server +- The server is selected by passing in server_info and server_index into api_configuration.ApiConfiguration +- Code samples in endpoints documents show how to do this +- server_index can also be passed in to endpoint calls, see endpoint documentation + +Method | Description +------ | ------------- +[**post_uniqueitems_false_validation_request_body**](../../paths/request_body_post_uniqueitems_false_validation_request_body/post.md) | +[**post_uniqueitems_false_validation_response_body_for_content_types**](../../paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post.md) | +[**post_uniqueitems_validation_request_body**](../../paths/request_body_post_uniqueitems_validation_request_body/post.md) | +[**post_uniqueitems_validation_response_body_for_content_types**](../../paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post.md) | + +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/_not.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/_not.md new file mode 100644 index 00000000000..ba7f83e0f06 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/_not.md @@ -0,0 +1,22 @@ +unit_test_api.components.schema._not +# Schema _Not + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Composed Schemas (allOf/anyOf/oneOf/not) +## not +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[_not](#_not) | decimal.Decimal, int | decimal.Decimal | | + +# _Not + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +decimal.Decimal, int | decimal.Decimal | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/additionalproperties_allows_a_schema_which_should_validate.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/additionalproperties_allows_a_schema_which_should_validate.md new file mode 100644 index 00000000000..9306b55b379 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/additionalproperties_allows_a_schema_which_should_validate.md @@ -0,0 +1,16 @@ +unit_test_api.components.schema.additionalproperties_allows_a_schema_which_should_validate +# Schema AdditionalpropertiesAllowsASchemaWhichShouldValidate + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**foo** | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | [optional] +**bar** | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | [optional] +**any_string_name** | bool | BoolClass | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/additionalproperties_are_allowed_by_default.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/additionalproperties_are_allowed_by_default.md new file mode 100644 index 00000000000..b24c85e46e6 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/additionalproperties_are_allowed_by_default.md @@ -0,0 +1,16 @@ +unit_test_api.components.schema.additionalproperties_are_allowed_by_default +# Schema AdditionalpropertiesAreAllowedByDefault + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**foo** | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | [optional] +**bar** | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | [optional] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/additionalproperties_can_exist_by_itself.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/additionalproperties_can_exist_by_itself.md new file mode 100644 index 00000000000..7cf722be59f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/additionalproperties_can_exist_by_itself.md @@ -0,0 +1,14 @@ +unit_test_api.components.schema.additionalproperties_can_exist_by_itself +# Schema AdditionalpropertiesCanExistByItself + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**any_string_name** | bool | BoolClass | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/additionalproperties_should_not_look_in_applicators.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/additionalproperties_should_not_look_in_applicators.md new file mode 100644 index 00000000000..8b8e37beafa --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/additionalproperties_should_not_look_in_applicators.md @@ -0,0 +1,33 @@ +unit_test_api.components.schema.additionalproperties_should_not_look_in_applicators +# Schema AdditionalpropertiesShouldNotLookInApplicators + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**any_string_name** | bool | BoolClass | any string name can be used but the value must be the correct type | [optional] + +## Composed Schemas (allOf/anyOf/oneOf/not) +## allOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[_0](#allof-_0) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +# allof _0 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**foo** | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | [optional] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/allof.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/allof.md new file mode 100644 index 00000000000..67dd2c51733 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/allof.md @@ -0,0 +1,42 @@ +unit_test_api.components.schema.allof +# Schema Allof + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Composed Schemas (allOf/anyOf/oneOf/not) +## allOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[_0](#allof-_0) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | +[_1](#allof-_1) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +# allof _0 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**bar** | decimal.Decimal, int | decimal.Decimal | | +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +# allof _1 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**foo** | str | str | | +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/allof_combined_with_anyof_oneof.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/allof_combined_with_anyof_oneof.md new file mode 100644 index 00000000000..f4b70e3d923 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/allof_combined_with_anyof_oneof.md @@ -0,0 +1,44 @@ +unit_test_api.components.schema.allof_combined_with_anyof_oneof +# Schema AllofCombinedWithAnyofOneof + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Composed Schemas (allOf/anyOf/oneOf/not) +## allOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[_0](#allof-_0) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | +## anyOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[_0](#anyof-_0) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | +## oneOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[_0](#oneof-_0) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +# allof _0 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +# anyof _0 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +# oneof _0 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/allof_simple_types.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/allof_simple_types.md new file mode 100644 index 00000000000..dbbbd0a04a2 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/allof_simple_types.md @@ -0,0 +1,30 @@ +unit_test_api.components.schema.allof_simple_types +# Schema AllofSimpleTypes + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Composed Schemas (allOf/anyOf/oneOf/not) +## allOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[_0](#allof-_0) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | +[_1](#allof-_1) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +# allof _0 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +# allof _1 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/allof_with_base_schema.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/allof_with_base_schema.md new file mode 100644 index 00000000000..4c60cf6b655 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/allof_with_base_schema.md @@ -0,0 +1,48 @@ +unit_test_api.components.schema.allof_with_base_schema +# Schema AllofWithBaseSchema + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**bar** | decimal.Decimal, int | decimal.Decimal | | +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +## Composed Schemas (allOf/anyOf/oneOf/not) +## allOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[_0](#allof-_0) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | +[_1](#allof-_1) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +# allof _0 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**foo** | str | str | | +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +# allof _1 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**baz** | None | NoneClass | | +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/allof_with_one_empty_schema.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/allof_with_one_empty_schema.md new file mode 100644 index 00000000000..c9edfc21dfe --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/allof_with_one_empty_schema.md @@ -0,0 +1,22 @@ +unit_test_api.components.schema.allof_with_one_empty_schema +# Schema AllofWithOneEmptySchema + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Composed Schemas (allOf/anyOf/oneOf/not) +## allOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[_0](#allof-_0) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +# allof _0 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/allof_with_the_first_empty_schema.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/allof_with_the_first_empty_schema.md new file mode 100644 index 00000000000..9cd6bd9b5de --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/allof_with_the_first_empty_schema.md @@ -0,0 +1,30 @@ +unit_test_api.components.schema.allof_with_the_first_empty_schema +# Schema AllofWithTheFirstEmptySchema + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Composed Schemas (allOf/anyOf/oneOf/not) +## allOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[_0](#allof-_0) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | +[_1](#allof-_1) | decimal.Decimal, int, float | decimal.Decimal | | + +# allof _0 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +# allof _1 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +decimal.Decimal, int, float | decimal.Decimal | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/allof_with_the_last_empty_schema.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/allof_with_the_last_empty_schema.md new file mode 100644 index 00000000000..b7e5e730859 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/allof_with_the_last_empty_schema.md @@ -0,0 +1,30 @@ +unit_test_api.components.schema.allof_with_the_last_empty_schema +# Schema AllofWithTheLastEmptySchema + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Composed Schemas (allOf/anyOf/oneOf/not) +## allOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[_0](#allof-_0) | decimal.Decimal, int, float | decimal.Decimal | | +[_1](#allof-_1) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +# allof _0 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +decimal.Decimal, int, float | decimal.Decimal | | + +# allof _1 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/allof_with_two_empty_schemas.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/allof_with_two_empty_schemas.md new file mode 100644 index 00000000000..80969d62e56 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/allof_with_two_empty_schemas.md @@ -0,0 +1,30 @@ +unit_test_api.components.schema.allof_with_two_empty_schemas +# Schema AllofWithTwoEmptySchemas + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Composed Schemas (allOf/anyOf/oneOf/not) +## allOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[_0](#allof-_0) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | +[_1](#allof-_1) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +# allof _0 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +# allof _1 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/anyof.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/anyof.md new file mode 100644 index 00000000000..a49c986df1a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/anyof.md @@ -0,0 +1,30 @@ +unit_test_api.components.schema.anyof +# Schema Anyof + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Composed Schemas (allOf/anyOf/oneOf/not) +## anyOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[_0](#anyof-_0) | decimal.Decimal, int | decimal.Decimal | | +[_1](#anyof-_1) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +# anyof _0 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +decimal.Decimal, int | decimal.Decimal | | + +# anyof _1 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/anyof_complex_types.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/anyof_complex_types.md new file mode 100644 index 00000000000..7224c5e75e7 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/anyof_complex_types.md @@ -0,0 +1,42 @@ +unit_test_api.components.schema.anyof_complex_types +# Schema AnyofComplexTypes + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Composed Schemas (allOf/anyOf/oneOf/not) +## anyOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[_0](#anyof-_0) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | +[_1](#anyof-_1) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +# anyof _0 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**bar** | decimal.Decimal, int | decimal.Decimal | | +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +# anyof _1 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**foo** | str | str | | +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/anyof_with_base_schema.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/anyof_with_base_schema.md new file mode 100644 index 00000000000..abb9b870ab5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/anyof_with_base_schema.md @@ -0,0 +1,30 @@ +unit_test_api.components.schema.anyof_with_base_schema +# Schema AnyofWithBaseSchema + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str | str | | + +## Composed Schemas (allOf/anyOf/oneOf/not) +## anyOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[_0](#anyof-_0) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | +[_1](#anyof-_1) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +# anyof _0 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +# anyof _1 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/anyof_with_one_empty_schema.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/anyof_with_one_empty_schema.md new file mode 100644 index 00000000000..5ba8b01be39 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/anyof_with_one_empty_schema.md @@ -0,0 +1,30 @@ +unit_test_api.components.schema.anyof_with_one_empty_schema +# Schema AnyofWithOneEmptySchema + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Composed Schemas (allOf/anyOf/oneOf/not) +## anyOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[_0](#anyof-_0) | decimal.Decimal, int, float | decimal.Decimal | | +[_1](#anyof-_1) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +# anyof _0 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +decimal.Decimal, int, float | decimal.Decimal | | + +# anyof _1 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/array_type_matches_arrays.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/array_type_matches_arrays.md new file mode 100644 index 00000000000..cd903cafdf8 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/array_type_matches_arrays.md @@ -0,0 +1,14 @@ +unit_test_api.components.schema.array_type_matches_arrays +# Schema ArrayTypeMatchesArrays + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +list, tuple | tuple | | + +## List Items +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +items | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/boolean_type_matches_booleans.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/boolean_type_matches_booleans.md new file mode 100644 index 00000000000..7c49847d1ee --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/boolean_type_matches_booleans.md @@ -0,0 +1,9 @@ +unit_test_api.components.schema.boolean_type_matches_booleans +# Schema BooleanTypeMatchesBooleans + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +bool | BoolClass | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/by_int.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/by_int.md new file mode 100644 index 00000000000..12fc6d819d5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/by_int.md @@ -0,0 +1,9 @@ +unit_test_api.components.schema.by_int +# Schema ByInt + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/by_number.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/by_number.md new file mode 100644 index 00000000000..aa7a75107c0 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/by_number.md @@ -0,0 +1,9 @@ +unit_test_api.components.schema.by_number +# Schema ByNumber + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/by_small_number.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/by_small_number.md new file mode 100644 index 00000000000..ae25d634ca2 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/by_small_number.md @@ -0,0 +1,9 @@ +unit_test_api.components.schema.by_small_number +# Schema BySmallNumber + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/date_time_format.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/date_time_format.md new file mode 100644 index 00000000000..4740b03b693 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/date_time_format.md @@ -0,0 +1,9 @@ +unit_test_api.components.schema.date_time_format +# Schema DateTimeFormat + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | value must conform to RFC-3339 date-time + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/email_format.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/email_format.md new file mode 100644 index 00000000000..33d665f286a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/email_format.md @@ -0,0 +1,9 @@ +unit_test_api.components.schema.email_format +# Schema EmailFormat + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/enum_with0_does_not_match_false.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/enum_with0_does_not_match_false.md new file mode 100644 index 00000000000..265e832700c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/enum_with0_does_not_match_false.md @@ -0,0 +1,9 @@ +unit_test_api.components.schema.enum_with0_does_not_match_false +# Schema EnumWith0DoesNotMatchFalse + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +decimal.Decimal, int, float | decimal.Decimal | | must be one of [0] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/enum_with1_does_not_match_true.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/enum_with1_does_not_match_true.md new file mode 100644 index 00000000000..2a96bb74bf0 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/enum_with1_does_not_match_true.md @@ -0,0 +1,9 @@ +unit_test_api.components.schema.enum_with1_does_not_match_true +# Schema EnumWith1DoesNotMatchTrue + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +decimal.Decimal, int, float | decimal.Decimal | | must be one of [1] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/enum_with_escaped_characters.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/enum_with_escaped_characters.md new file mode 100644 index 00000000000..bde7746d5ff --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/enum_with_escaped_characters.md @@ -0,0 +1,9 @@ +unit_test_api.components.schema.enum_with_escaped_characters +# Schema EnumWithEscapedCharacters + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str | str | | must be one of ["foo\nbar", "foo\rbar"] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/enum_with_false_does_not_match0.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/enum_with_false_does_not_match0.md new file mode 100644 index 00000000000..e92a5782eb0 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/enum_with_false_does_not_match0.md @@ -0,0 +1,9 @@ +unit_test_api.components.schema.enum_with_false_does_not_match0 +# Schema EnumWithFalseDoesNotMatch0 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +bool | BoolClass | | must be one of [False] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/enum_with_true_does_not_match1.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/enum_with_true_does_not_match1.md new file mode 100644 index 00000000000..41c2f18a9bf --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/enum_with_true_does_not_match1.md @@ -0,0 +1,9 @@ +unit_test_api.components.schema.enum_with_true_does_not_match1 +# Schema EnumWithTrueDoesNotMatch1 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +bool | BoolClass | | must be one of [True] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/enums_in_properties.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/enums_in_properties.md new file mode 100644 index 00000000000..fb9c8c7685e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/enums_in_properties.md @@ -0,0 +1,16 @@ +unit_test_api.components.schema.enums_in_properties +# Schema EnumsInProperties + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**bar** | str | str | | must be one of ["bar"] +**foo** | str | str | | [optional] must be one of ["foo"] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/forbidden_property.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/forbidden_property.md new file mode 100644 index 00000000000..87a4c912359 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/forbidden_property.md @@ -0,0 +1,35 @@ +unit_test_api.components.schema.forbidden_property +# Schema ForbiddenProperty + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**foo** | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | [properties.Foo](#properties-foo) | | [optional] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +# properties Foo + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Composed Schemas (allOf/anyOf/oneOf/not) +## not +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[_not](#properties-foo-_not) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +# properties Foo _Not + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/hostname_format.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/hostname_format.md new file mode 100644 index 00000000000..5b709dc9a79 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/hostname_format.md @@ -0,0 +1,9 @@ +unit_test_api.components.schema.hostname_format +# Schema HostnameFormat + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/integer_type_matches_integers.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/integer_type_matches_integers.md new file mode 100644 index 00000000000..38f14cbd68c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/integer_type_matches_integers.md @@ -0,0 +1,9 @@ +unit_test_api.components.schema.integer_type_matches_integers +# Schema IntegerTypeMatchesIntegers + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +decimal.Decimal, int | decimal.Decimal | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/invalid_instance_should_not_raise_error_when_float_division_inf.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/invalid_instance_should_not_raise_error_when_float_division_inf.md new file mode 100644 index 00000000000..5f566442369 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/invalid_instance_should_not_raise_error_when_float_division_inf.md @@ -0,0 +1,9 @@ +unit_test_api.components.schema.invalid_instance_should_not_raise_error_when_float_division_inf +# Schema InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +decimal.Decimal, int | decimal.Decimal | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/invalid_string_value_for_default.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/invalid_string_value_for_default.md new file mode 100644 index 00000000000..be79bde96fd --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/invalid_string_value_for_default.md @@ -0,0 +1,15 @@ +unit_test_api.components.schema.invalid_string_value_for_default +# Schema InvalidStringValueForDefault + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**bar** | str | str | | [optional] if omitted the server will use the default value of bad +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/ipv4_format.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/ipv4_format.md new file mode 100644 index 00000000000..d2accca6579 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/ipv4_format.md @@ -0,0 +1,9 @@ +unit_test_api.components.schema.ipv4_format +# Schema Ipv4Format + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/ipv6_format.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/ipv6_format.md new file mode 100644 index 00000000000..e76a722a6f1 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/ipv6_format.md @@ -0,0 +1,9 @@ +unit_test_api.components.schema.ipv6_format +# Schema Ipv6Format + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/json_pointer_format.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/json_pointer_format.md new file mode 100644 index 00000000000..7d6c3715a9f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/json_pointer_format.md @@ -0,0 +1,9 @@ +unit_test_api.components.schema.json_pointer_format +# Schema JsonPointerFormat + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/maximum_validation.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/maximum_validation.md new file mode 100644 index 00000000000..be2e9db2029 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/maximum_validation.md @@ -0,0 +1,9 @@ +unit_test_api.components.schema.maximum_validation +# Schema MaximumValidation + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/maximum_validation_with_unsigned_integer.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/maximum_validation_with_unsigned_integer.md new file mode 100644 index 00000000000..96b2694fcd7 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/maximum_validation_with_unsigned_integer.md @@ -0,0 +1,9 @@ +unit_test_api.components.schema.maximum_validation_with_unsigned_integer +# Schema MaximumValidationWithUnsignedInteger + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/maxitems_validation.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/maxitems_validation.md new file mode 100644 index 00000000000..ae856a23665 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/maxitems_validation.md @@ -0,0 +1,9 @@ +unit_test_api.components.schema.maxitems_validation +# Schema MaxitemsValidation + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/maxlength_validation.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/maxlength_validation.md new file mode 100644 index 00000000000..a7d3cbf4810 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/maxlength_validation.md @@ -0,0 +1,9 @@ +unit_test_api.components.schema.maxlength_validation +# Schema MaxlengthValidation + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/maxproperties0_means_the_object_is_empty.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/maxproperties0_means_the_object_is_empty.md new file mode 100644 index 00000000000..97bc3d5a312 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/maxproperties0_means_the_object_is_empty.md @@ -0,0 +1,9 @@ +unit_test_api.components.schema.maxproperties0_means_the_object_is_empty +# Schema Maxproperties0MeansTheObjectIsEmpty + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/maxproperties_validation.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/maxproperties_validation.md new file mode 100644 index 00000000000..2863d84fbd7 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/maxproperties_validation.md @@ -0,0 +1,9 @@ +unit_test_api.components.schema.maxproperties_validation +# Schema MaxpropertiesValidation + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/minimum_validation.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/minimum_validation.md new file mode 100644 index 00000000000..d6928256ff0 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/minimum_validation.md @@ -0,0 +1,9 @@ +unit_test_api.components.schema.minimum_validation +# Schema MinimumValidation + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/minimum_validation_with_signed_integer.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/minimum_validation_with_signed_integer.md new file mode 100644 index 00000000000..c337924a236 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/minimum_validation_with_signed_integer.md @@ -0,0 +1,9 @@ +unit_test_api.components.schema.minimum_validation_with_signed_integer +# Schema MinimumValidationWithSignedInteger + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/minitems_validation.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/minitems_validation.md new file mode 100644 index 00000000000..1c5e6b7fae5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/minitems_validation.md @@ -0,0 +1,9 @@ +unit_test_api.components.schema.minitems_validation +# Schema MinitemsValidation + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/minlength_validation.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/minlength_validation.md new file mode 100644 index 00000000000..3c34251e2d2 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/minlength_validation.md @@ -0,0 +1,9 @@ +unit_test_api.components.schema.minlength_validation +# Schema MinlengthValidation + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/minproperties_validation.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/minproperties_validation.md new file mode 100644 index 00000000000..b7a9b99c570 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/minproperties_validation.md @@ -0,0 +1,9 @@ +unit_test_api.components.schema.minproperties_validation +# Schema MinpropertiesValidation + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/nested_allof_to_check_validation_semantics.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/nested_allof_to_check_validation_semantics.md new file mode 100644 index 00000000000..4d3961f1e29 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/nested_allof_to_check_validation_semantics.md @@ -0,0 +1,35 @@ +unit_test_api.components.schema.nested_allof_to_check_validation_semantics +# Schema NestedAllofToCheckValidationSemantics + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Composed Schemas (allOf/anyOf/oneOf/not) +## allOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[_0](#allof-_0) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +# allof _0 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Composed Schemas (allOf/anyOf/oneOf/not) +## allOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[_0](#allof-_0-allof-_0) | None | NoneClass | | + +# allof _0 allof _0 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +None | NoneClass | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/nested_anyof_to_check_validation_semantics.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/nested_anyof_to_check_validation_semantics.md new file mode 100644 index 00000000000..d3a97d0066c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/nested_anyof_to_check_validation_semantics.md @@ -0,0 +1,35 @@ +unit_test_api.components.schema.nested_anyof_to_check_validation_semantics +# Schema NestedAnyofToCheckValidationSemantics + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Composed Schemas (allOf/anyOf/oneOf/not) +## anyOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[_0](#anyof-_0) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +# anyof _0 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Composed Schemas (allOf/anyOf/oneOf/not) +## anyOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[_0](#anyof-_0-anyof-_0) | None | NoneClass | | + +# anyof _0 anyof _0 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +None | NoneClass | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/nested_items.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/nested_items.md new file mode 100644 index 00000000000..59b1e59a269 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/nested_items.md @@ -0,0 +1,50 @@ +unit_test_api.components.schema.nested_items +# Schema NestedItems + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +list, tuple | tuple | | + +## List Items +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[items](#items) | list, tuple | tuple | | + +# Items + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +list, tuple | tuple | | + +## List Items +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[items](#items-items) | list, tuple | tuple | | + +# Items Items + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +list, tuple | tuple | | + +## List Items +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[items](#items-items-items) | list, tuple | tuple | | + +# Items Items Items + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +list, tuple | tuple | | + +## List Items +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +items | decimal.Decimal, int, float | decimal.Decimal | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/nested_oneof_to_check_validation_semantics.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/nested_oneof_to_check_validation_semantics.md new file mode 100644 index 00000000000..5e43550dd9a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/nested_oneof_to_check_validation_semantics.md @@ -0,0 +1,35 @@ +unit_test_api.components.schema.nested_oneof_to_check_validation_semantics +# Schema NestedOneofToCheckValidationSemantics + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Composed Schemas (allOf/anyOf/oneOf/not) +## oneOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[_0](#oneof-_0) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +# oneof _0 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Composed Schemas (allOf/anyOf/oneOf/not) +## oneOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[_0](#oneof-_0-oneof-_0) | None | NoneClass | | + +# oneof _0 oneof _0 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +None | NoneClass | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/not_more_complex_schema.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/not_more_complex_schema.md new file mode 100644 index 00000000000..0df6fc56941 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/not_more_complex_schema.md @@ -0,0 +1,28 @@ +unit_test_api.components.schema.not_more_complex_schema +# Schema NotMoreComplexSchema + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Composed Schemas (allOf/anyOf/oneOf/not) +## not +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[_not](#_not) | dict, frozendict.frozendict | frozendict.frozendict | | + +# _Not + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**foo** | str | str | | [optional] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/nul_characters_in_strings.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/nul_characters_in_strings.md new file mode 100644 index 00000000000..e6070446d19 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/nul_characters_in_strings.md @@ -0,0 +1,9 @@ +unit_test_api.components.schema.nul_characters_in_strings +# Schema NulCharactersInStrings + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str | str | | must be one of ["hello\x00there"] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/null_type_matches_only_the_null_object.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/null_type_matches_only_the_null_object.md new file mode 100644 index 00000000000..4fe05ad72bf --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/null_type_matches_only_the_null_object.md @@ -0,0 +1,9 @@ +unit_test_api.components.schema.null_type_matches_only_the_null_object +# Schema NullTypeMatchesOnlyTheNullObject + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +None | NoneClass | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/number_type_matches_numbers.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/number_type_matches_numbers.md new file mode 100644 index 00000000000..9a9dfba239c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/number_type_matches_numbers.md @@ -0,0 +1,9 @@ +unit_test_api.components.schema.number_type_matches_numbers +# Schema NumberTypeMatchesNumbers + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +decimal.Decimal, int, float | decimal.Decimal | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/object_properties_validation.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/object_properties_validation.md new file mode 100644 index 00000000000..011d45bca13 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/object_properties_validation.md @@ -0,0 +1,16 @@ +unit_test_api.components.schema.object_properties_validation +# Schema ObjectPropertiesValidation + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**foo** | decimal.Decimal, int | decimal.Decimal | | [optional] +**bar** | str | str | | [optional] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/object_type_matches_objects.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/object_type_matches_objects.md new file mode 100644 index 00000000000..f5e472739df --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/object_type_matches_objects.md @@ -0,0 +1,9 @@ +unit_test_api.components.schema.object_type_matches_objects +# Schema ObjectTypeMatchesObjects + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/oneof.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/oneof.md new file mode 100644 index 00000000000..dc2b9d4d947 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/oneof.md @@ -0,0 +1,30 @@ +unit_test_api.components.schema.oneof +# Schema Oneof + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Composed Schemas (allOf/anyOf/oneOf/not) +## oneOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[_0](#oneof-_0) | decimal.Decimal, int | decimal.Decimal | | +[_1](#oneof-_1) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +# oneof _0 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +decimal.Decimal, int | decimal.Decimal | | + +# oneof _1 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/oneof_complex_types.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/oneof_complex_types.md new file mode 100644 index 00000000000..d767d6b83cb --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/oneof_complex_types.md @@ -0,0 +1,42 @@ +unit_test_api.components.schema.oneof_complex_types +# Schema OneofComplexTypes + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Composed Schemas (allOf/anyOf/oneOf/not) +## oneOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[_0](#oneof-_0) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | +[_1](#oneof-_1) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +# oneof _0 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**bar** | decimal.Decimal, int | decimal.Decimal | | +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +# oneof _1 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**foo** | str | str | | +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/oneof_with_base_schema.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/oneof_with_base_schema.md new file mode 100644 index 00000000000..224ca5ca36b --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/oneof_with_base_schema.md @@ -0,0 +1,30 @@ +unit_test_api.components.schema.oneof_with_base_schema +# Schema OneofWithBaseSchema + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str | str | | + +## Composed Schemas (allOf/anyOf/oneOf/not) +## oneOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[_0](#oneof-_0) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | +[_1](#oneof-_1) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +# oneof _0 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +# oneof _1 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/oneof_with_empty_schema.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/oneof_with_empty_schema.md new file mode 100644 index 00000000000..d91e44deb52 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/oneof_with_empty_schema.md @@ -0,0 +1,30 @@ +unit_test_api.components.schema.oneof_with_empty_schema +# Schema OneofWithEmptySchema + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Composed Schemas (allOf/anyOf/oneOf/not) +## oneOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[_0](#oneof-_0) | decimal.Decimal, int, float | decimal.Decimal | | +[_1](#oneof-_1) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +# oneof _0 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +decimal.Decimal, int, float | decimal.Decimal | | + +# oneof _1 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/oneof_with_required.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/oneof_with_required.md new file mode 100644 index 00000000000..a35a8dcea62 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/oneof_with_required.md @@ -0,0 +1,44 @@ +unit_test_api.components.schema.oneof_with_required +# Schema OneofWithRequired + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Composed Schemas (allOf/anyOf/oneOf/not) +## oneOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[_0](#oneof-_0) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | +[_1](#oneof-_1) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +# oneof _0 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**bar** | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | +**foo** | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +# oneof _1 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**baz** | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | +**foo** | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/pattern_is_not_anchored.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/pattern_is_not_anchored.md new file mode 100644 index 00000000000..638642b3f2f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/pattern_is_not_anchored.md @@ -0,0 +1,9 @@ +unit_test_api.components.schema.pattern_is_not_anchored +# Schema PatternIsNotAnchored + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/pattern_validation.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/pattern_validation.md new file mode 100644 index 00000000000..faae41b0d87 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/pattern_validation.md @@ -0,0 +1,9 @@ +unit_test_api.components.schema.pattern_validation +# Schema PatternValidation + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/properties_with_escaped_characters.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/properties_with_escaped_characters.md new file mode 100644 index 00000000000..d9f8216acb0 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/properties_with_escaped_characters.md @@ -0,0 +1,20 @@ +unit_test_api.components.schema.properties_with_escaped_characters +# Schema PropertiesWithEscapedCharacters + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**foo\nbar** | decimal.Decimal, int, float | decimal.Decimal | | [optional] +**foo\"bar** | decimal.Decimal, int, float | decimal.Decimal | | [optional] +**foo\\bar** | decimal.Decimal, int, float | decimal.Decimal | | [optional] +**foo\rbar** | decimal.Decimal, int, float | decimal.Decimal | | [optional] +**foo\tbar** | decimal.Decimal, int, float | decimal.Decimal | | [optional] +**foo\fbar** | decimal.Decimal, int, float | decimal.Decimal | | [optional] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/property_named_ref_that_is_not_a_reference.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/property_named_ref_that_is_not_a_reference.md new file mode 100644 index 00000000000..0b81378f2bf --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/property_named_ref_that_is_not_a_reference.md @@ -0,0 +1,15 @@ +unit_test_api.components.schema.property_named_ref_that_is_not_a_reference +# Schema PropertyNamedRefThatIsNotAReference + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**$ref** | str | str | | [optional] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/ref_in_additionalproperties.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/ref_in_additionalproperties.md new file mode 100644 index 00000000000..cd0c5f44c11 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/ref_in_additionalproperties.md @@ -0,0 +1,14 @@ +unit_test_api.components.schema.ref_in_additionalproperties +# Schema RefInAdditionalproperties + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**any_string_name** | [**PropertyNamedRefThatIsNotAReference**](property_named_ref_that_is_not_a_reference.md), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | [**PropertyNamedRefThatIsNotAReference**](property_named_ref_that_is_not_a_reference.md) | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/ref_in_allof.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/ref_in_allof.md new file mode 100644 index 00000000000..aca95db4a6a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/ref_in_allof.md @@ -0,0 +1,15 @@ +unit_test_api.components.schema.ref_in_allof +# Schema RefInAllof + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Composed Schemas (allOf/anyOf/oneOf/not) +## allOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[**PropertyNamedRefThatIsNotAReference**](property_named_ref_that_is_not_a_reference.md) | [**PropertyNamedRefThatIsNotAReference**](property_named_ref_that_is_not_a_reference.md) | [**PropertyNamedRefThatIsNotAReference**](property_named_ref_that_is_not_a_reference.md) | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/ref_in_anyof.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/ref_in_anyof.md new file mode 100644 index 00000000000..70ebc21c954 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/ref_in_anyof.md @@ -0,0 +1,15 @@ +unit_test_api.components.schema.ref_in_anyof +# Schema RefInAnyof + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Composed Schemas (allOf/anyOf/oneOf/not) +## anyOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[**PropertyNamedRefThatIsNotAReference**](property_named_ref_that_is_not_a_reference.md) | [**PropertyNamedRefThatIsNotAReference**](property_named_ref_that_is_not_a_reference.md) | [**PropertyNamedRefThatIsNotAReference**](property_named_ref_that_is_not_a_reference.md) | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/ref_in_items.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/ref_in_items.md new file mode 100644 index 00000000000..a7d66165332 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/ref_in_items.md @@ -0,0 +1,14 @@ +unit_test_api.components.schema.ref_in_items +# Schema RefInItems + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +list, tuple | tuple | | + +## List Items +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[**PropertyNamedRefThatIsNotAReference**](property_named_ref_that_is_not_a_reference.md) | [**PropertyNamedRefThatIsNotAReference**](property_named_ref_that_is_not_a_reference.md) | [**PropertyNamedRefThatIsNotAReference**](property_named_ref_that_is_not_a_reference.md) | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/ref_in_not.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/ref_in_not.md new file mode 100644 index 00000000000..33a1b31f650 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/ref_in_not.md @@ -0,0 +1,15 @@ +unit_test_api.components.schema.ref_in_not +# Schema RefInNot + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Composed Schemas (allOf/anyOf/oneOf/not) +## not +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[**PropertyNamedRefThatIsNotAReference**](property_named_ref_that_is_not_a_reference.md) | [**PropertyNamedRefThatIsNotAReference**](property_named_ref_that_is_not_a_reference.md) | [**PropertyNamedRefThatIsNotAReference**](property_named_ref_that_is_not_a_reference.md) | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/ref_in_oneof.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/ref_in_oneof.md new file mode 100644 index 00000000000..7241f9a3abb --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/ref_in_oneof.md @@ -0,0 +1,15 @@ +unit_test_api.components.schema.ref_in_oneof +# Schema RefInOneof + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Composed Schemas (allOf/anyOf/oneOf/not) +## oneOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[**PropertyNamedRefThatIsNotAReference**](property_named_ref_that_is_not_a_reference.md) | [**PropertyNamedRefThatIsNotAReference**](property_named_ref_that_is_not_a_reference.md) | [**PropertyNamedRefThatIsNotAReference**](property_named_ref_that_is_not_a_reference.md) | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/ref_in_property.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/ref_in_property.md new file mode 100644 index 00000000000..48579de62c3 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/ref_in_property.md @@ -0,0 +1,15 @@ +unit_test_api.components.schema.ref_in_property +# Schema RefInProperty + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**a** | [**PropertyNamedRefThatIsNotAReference**](property_named_ref_that_is_not_a_reference.md), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | [**PropertyNamedRefThatIsNotAReference**](property_named_ref_that_is_not_a_reference.md) | | [optional] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/required_default_validation.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/required_default_validation.md new file mode 100644 index 00000000000..51492fc4559 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/required_default_validation.md @@ -0,0 +1,15 @@ +unit_test_api.components.schema.required_default_validation +# Schema RequiredDefaultValidation + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**foo** | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | [optional] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/required_validation.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/required_validation.md new file mode 100644 index 00000000000..362fa85e514 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/required_validation.md @@ -0,0 +1,16 @@ +unit_test_api.components.schema.required_validation +# Schema RequiredValidation + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**foo** | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | +**bar** | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | [optional] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/required_with_empty_array.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/required_with_empty_array.md new file mode 100644 index 00000000000..190b2a3dbf4 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/required_with_empty_array.md @@ -0,0 +1,15 @@ +unit_test_api.components.schema.required_with_empty_array +# Schema RequiredWithEmptyArray + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**foo** | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | [optional] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/required_with_escaped_characters.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/required_with_escaped_characters.md new file mode 100644 index 00000000000..a304f9f0198 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/required_with_escaped_characters.md @@ -0,0 +1,20 @@ +unit_test_api.components.schema.required_with_escaped_characters +# Schema RequiredWithEscapedCharacters + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**foo\tbar** | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | +**foo\nbar** | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | +**foo\fbar** | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | +**foo\rbar** | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | +**foo\"bar** | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | +**foo\\bar** | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/simple_enum_validation.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/simple_enum_validation.md new file mode 100644 index 00000000000..03cd362a337 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/simple_enum_validation.md @@ -0,0 +1,9 @@ +unit_test_api.components.schema.simple_enum_validation +# Schema SimpleEnumValidation + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +decimal.Decimal, int, float | decimal.Decimal | | must be one of [1, 2, 3] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/string_type_matches_strings.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/string_type_matches_strings.md new file mode 100644 index 00000000000..f9412fa23d3 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/string_type_matches_strings.md @@ -0,0 +1,9 @@ +unit_test_api.components.schema.string_type_matches_strings +# Schema StringTypeMatchesStrings + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str | str | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/the_default_keyword_does_not_do_anything_if_the_property_is_missing.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/the_default_keyword_does_not_do_anything_if_the_property_is_missing.md new file mode 100644 index 00000000000..d656e83ec17 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/the_default_keyword_does_not_do_anything_if_the_property_is_missing.md @@ -0,0 +1,15 @@ +unit_test_api.components.schema.the_default_keyword_does_not_do_anything_if_the_property_is_missing +# Schema TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**alpha** | decimal.Decimal, int, float | decimal.Decimal | | [optional] if omitted the server will use the default value of 5 +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/uniqueitems_false_validation.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/uniqueitems_false_validation.md new file mode 100644 index 00000000000..352ea5fe25d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/uniqueitems_false_validation.md @@ -0,0 +1,9 @@ +unit_test_api.components.schema.uniqueitems_false_validation +# Schema UniqueitemsFalseValidation + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/uniqueitems_validation.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/uniqueitems_validation.md new file mode 100644 index 00000000000..47658642cda --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/uniqueitems_validation.md @@ -0,0 +1,9 @@ +unit_test_api.components.schema.uniqueitems_validation +# Schema UniqueitemsValidation + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/uri_format.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/uri_format.md new file mode 100644 index 00000000000..6d63b58d291 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/uri_format.md @@ -0,0 +1,9 @@ +unit_test_api.components.schema.uri_format +# Schema UriFormat + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/uri_reference_format.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/uri_reference_format.md new file mode 100644 index 00000000000..a77caf9fe2a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/uri_reference_format.md @@ -0,0 +1,9 @@ +unit_test_api.components.schema.uri_reference_format +# Schema UriReferenceFormat + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/uri_template_format.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/uri_template_format.md new file mode 100644 index 00000000000..4f536992dfc --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/uri_template_format.md @@ -0,0 +1,9 @@ +unit_test_api.components.schema.uri_template_format +# Schema UriTemplateFormat + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/AdditionalpropertiesAllowsASchemaWhichShouldValidate.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/AdditionalpropertiesAllowsASchemaWhichShouldValidate.md deleted file mode 100644 index e32452e5c8b..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/AdditionalpropertiesAllowsASchemaWhichShouldValidate.md +++ /dev/null @@ -1,16 +0,0 @@ -# unit_test_api.model.additionalproperties_allows_a_schema_which_should_validate.AdditionalpropertiesAllowsASchemaWhichShouldValidate - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**foo** | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | [optional] -**bar** | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | [optional] -**any_string_name** | bool, | BoolClass, | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/AdditionalpropertiesAreAllowedByDefault.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/AdditionalpropertiesAreAllowedByDefault.md deleted file mode 100644 index 7548452e43d..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/AdditionalpropertiesAreAllowedByDefault.md +++ /dev/null @@ -1,16 +0,0 @@ -# unit_test_api.model.additionalproperties_are_allowed_by_default.AdditionalpropertiesAreAllowedByDefault - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**foo** | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | [optional] -**bar** | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/AdditionalpropertiesCanExistByItself.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/AdditionalpropertiesCanExistByItself.md deleted file mode 100644 index 09f1d02d8d2..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/AdditionalpropertiesCanExistByItself.md +++ /dev/null @@ -1,14 +0,0 @@ -# unit_test_api.model.additionalproperties_can_exist_by_itself.AdditionalpropertiesCanExistByItself - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**any_string_name** | bool, | BoolClass, | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/AdditionalpropertiesShouldNotLookInApplicators.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/AdditionalpropertiesShouldNotLookInApplicators.md deleted file mode 100644 index fa1430a42e9..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/AdditionalpropertiesShouldNotLookInApplicators.md +++ /dev/null @@ -1,33 +0,0 @@ -# unit_test_api.model.additionalproperties_should_not_look_in_applicators.AdditionalpropertiesShouldNotLookInApplicators - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**any_string_name** | bool, | BoolClass, | any string name can be used but the value must be the correct type | [optional] - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### allOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[all_of_0](#all_of_0) | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -# all_of_0 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**foo** | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/Allof.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/Allof.md deleted file mode 100644 index db9cd5c7207..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/Allof.md +++ /dev/null @@ -1,42 +0,0 @@ -# unit_test_api.model.allof.Allof - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### allOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[all_of_0](#all_of_0) | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | -[all_of_1](#all_of_1) | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -# all_of_0 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**bar** | decimal.Decimal, int, | decimal.Decimal, | | -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -# all_of_1 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**foo** | str, | str, | | -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/AllofCombinedWithAnyofOneof.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/AllofCombinedWithAnyofOneof.md deleted file mode 100644 index 5b26a94969d..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/AllofCombinedWithAnyofOneof.md +++ /dev/null @@ -1,44 +0,0 @@ -# unit_test_api.model.allof_combined_with_anyof_oneof.AllofCombinedWithAnyofOneof - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### allOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[all_of_0](#all_of_0) | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -# all_of_0 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | -#### anyOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[any_of_0](#any_of_0) | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -# any_of_0 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | -#### oneOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[one_of_0](#one_of_0) | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -# one_of_0 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/AllofSimpleTypes.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/AllofSimpleTypes.md deleted file mode 100644 index 75e8863db69..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/AllofSimpleTypes.md +++ /dev/null @@ -1,30 +0,0 @@ -# unit_test_api.model.allof_simple_types.AllofSimpleTypes - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### allOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[all_of_0](#all_of_0) | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | -[all_of_1](#all_of_1) | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -# all_of_0 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -# all_of_1 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/AllofWithBaseSchema.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/AllofWithBaseSchema.md deleted file mode 100644 index e9db83fae8a..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/AllofWithBaseSchema.md +++ /dev/null @@ -1,48 +0,0 @@ -# unit_test_api.model.allof_with_base_schema.AllofWithBaseSchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**bar** | decimal.Decimal, int, | decimal.Decimal, | | -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### allOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[all_of_0](#all_of_0) | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | -[all_of_1](#all_of_1) | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -# all_of_0 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**foo** | str, | str, | | -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -# all_of_1 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**baz** | None, | NoneClass, | | -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/AllofWithOneEmptySchema.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/AllofWithOneEmptySchema.md deleted file mode 100644 index 429e2ac820e..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/AllofWithOneEmptySchema.md +++ /dev/null @@ -1,22 +0,0 @@ -# unit_test_api.model.allof_with_one_empty_schema.AllofWithOneEmptySchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### allOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[all_of_0](#all_of_0) | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -# all_of_0 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/AllofWithTheFirstEmptySchema.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/AllofWithTheFirstEmptySchema.md deleted file mode 100644 index bb6fd4199b3..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/AllofWithTheFirstEmptySchema.md +++ /dev/null @@ -1,30 +0,0 @@ -# unit_test_api.model.allof_with_the_first_empty_schema.AllofWithTheFirstEmptySchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### allOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[all_of_0](#all_of_0) | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | -[all_of_1](#all_of_1) | decimal.Decimal, int, float, | decimal.Decimal, | | - -# all_of_0 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -# all_of_1 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -decimal.Decimal, int, float, | decimal.Decimal, | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/AllofWithTheLastEmptySchema.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/AllofWithTheLastEmptySchema.md deleted file mode 100644 index 2e40966de71..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/AllofWithTheLastEmptySchema.md +++ /dev/null @@ -1,30 +0,0 @@ -# unit_test_api.model.allof_with_the_last_empty_schema.AllofWithTheLastEmptySchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### allOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[all_of_0](#all_of_0) | decimal.Decimal, int, float, | decimal.Decimal, | | -[all_of_1](#all_of_1) | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -# all_of_0 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -decimal.Decimal, int, float, | decimal.Decimal, | | - -# all_of_1 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/AllofWithTwoEmptySchemas.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/AllofWithTwoEmptySchemas.md deleted file mode 100644 index 1bc82005d3d..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/AllofWithTwoEmptySchemas.md +++ /dev/null @@ -1,30 +0,0 @@ -# unit_test_api.model.allof_with_two_empty_schemas.AllofWithTwoEmptySchemas - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### allOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[all_of_0](#all_of_0) | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | -[all_of_1](#all_of_1) | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -# all_of_0 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -# all_of_1 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/Anyof.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/Anyof.md deleted file mode 100644 index 53747ab915a..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/Anyof.md +++ /dev/null @@ -1,30 +0,0 @@ -# unit_test_api.model.anyof.Anyof - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### anyOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[any_of_0](#any_of_0) | decimal.Decimal, int, | decimal.Decimal, | | -[any_of_1](#any_of_1) | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -# any_of_0 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -decimal.Decimal, int, | decimal.Decimal, | | - -# any_of_1 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/AnyofComplexTypes.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/AnyofComplexTypes.md deleted file mode 100644 index 12f091e3c9a..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/AnyofComplexTypes.md +++ /dev/null @@ -1,42 +0,0 @@ -# unit_test_api.model.anyof_complex_types.AnyofComplexTypes - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### anyOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[any_of_0](#any_of_0) | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | -[any_of_1](#any_of_1) | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -# any_of_0 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**bar** | decimal.Decimal, int, | decimal.Decimal, | | -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -# any_of_1 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**foo** | str, | str, | | -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/AnyofWithBaseSchema.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/AnyofWithBaseSchema.md deleted file mode 100644 index ad1b6b4d57f..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/AnyofWithBaseSchema.md +++ /dev/null @@ -1,30 +0,0 @@ -# unit_test_api.model.anyof_with_base_schema.AnyofWithBaseSchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### anyOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[any_of_0](#any_of_0) | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | -[any_of_1](#any_of_1) | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -# any_of_0 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -# any_of_1 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/AnyofWithOneEmptySchema.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/AnyofWithOneEmptySchema.md deleted file mode 100644 index 12c5c930674..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/AnyofWithOneEmptySchema.md +++ /dev/null @@ -1,30 +0,0 @@ -# unit_test_api.model.anyof_with_one_empty_schema.AnyofWithOneEmptySchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### anyOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[any_of_0](#any_of_0) | decimal.Decimal, int, float, | decimal.Decimal, | | -[any_of_1](#any_of_1) | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -# any_of_0 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -decimal.Decimal, int, float, | decimal.Decimal, | | - -# any_of_1 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/ArrayTypeMatchesArrays.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/ArrayTypeMatchesArrays.md deleted file mode 100644 index ea887dfa1be..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/ArrayTypeMatchesArrays.md +++ /dev/null @@ -1,14 +0,0 @@ -# unit_test_api.model.array_type_matches_arrays.ArrayTypeMatchesArrays - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -list, tuple, | tuple, | | - -### Tuple Items -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -items | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/BooleanTypeMatchesBooleans.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/BooleanTypeMatchesBooleans.md deleted file mode 100644 index 63d7e87453b..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/BooleanTypeMatchesBooleans.md +++ /dev/null @@ -1,9 +0,0 @@ -# unit_test_api.model.boolean_type_matches_booleans.BooleanTypeMatchesBooleans - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -bool, | BoolClass, | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/ByInt.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/ByInt.md deleted file mode 100644 index 7c7c706c1a8..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/ByInt.md +++ /dev/null @@ -1,9 +0,0 @@ -# unit_test_api.model.by_int.ByInt - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/ByNumber.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/ByNumber.md deleted file mode 100644 index 4f58cada0e6..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/ByNumber.md +++ /dev/null @@ -1,9 +0,0 @@ -# unit_test_api.model.by_number.ByNumber - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/BySmallNumber.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/BySmallNumber.md deleted file mode 100644 index 7b61298957f..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/BySmallNumber.md +++ /dev/null @@ -1,9 +0,0 @@ -# unit_test_api.model.by_small_number.BySmallNumber - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/DateTimeFormat.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/DateTimeFormat.md deleted file mode 100644 index 4dffa18e51c..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/DateTimeFormat.md +++ /dev/null @@ -1,9 +0,0 @@ -# unit_test_api.model.date_time_format.DateTimeFormat - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | value must conform to RFC-3339 date-time - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/EmailFormat.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/EmailFormat.md deleted file mode 100644 index 1a2bb153a20..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/EmailFormat.md +++ /dev/null @@ -1,9 +0,0 @@ -# unit_test_api.model.email_format.EmailFormat - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/EnumWith0DoesNotMatchFalse.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/EnumWith0DoesNotMatchFalse.md deleted file mode 100644 index 8acc40f17f4..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/EnumWith0DoesNotMatchFalse.md +++ /dev/null @@ -1,9 +0,0 @@ -# unit_test_api.model.enum_with0_does_not_match_false.EnumWith0DoesNotMatchFalse - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -decimal.Decimal, int, float, | decimal.Decimal, | | must be one of [0, ] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/EnumWith1DoesNotMatchTrue.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/EnumWith1DoesNotMatchTrue.md deleted file mode 100644 index 40b4a8a2f55..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/EnumWith1DoesNotMatchTrue.md +++ /dev/null @@ -1,9 +0,0 @@ -# unit_test_api.model.enum_with1_does_not_match_true.EnumWith1DoesNotMatchTrue - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -decimal.Decimal, int, float, | decimal.Decimal, | | must be one of [1, ] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/EnumWithEscapedCharacters.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/EnumWithEscapedCharacters.md deleted file mode 100644 index 7910c5126ea..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/EnumWithEscapedCharacters.md +++ /dev/null @@ -1,9 +0,0 @@ -# unit_test_api.model.enum_with_escaped_characters.EnumWithEscapedCharacters - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | must be one of ["foo\nbar", "foo\rbar", ] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/EnumWithFalseDoesNotMatch0.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/EnumWithFalseDoesNotMatch0.md deleted file mode 100644 index 19b1b49815d..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/EnumWithFalseDoesNotMatch0.md +++ /dev/null @@ -1,9 +0,0 @@ -# unit_test_api.model.enum_with_false_does_not_match0.EnumWithFalseDoesNotMatch0 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -bool, | BoolClass, | | must be one of [False, ] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/EnumWithTrueDoesNotMatch1.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/EnumWithTrueDoesNotMatch1.md deleted file mode 100644 index 469529fa841..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/EnumWithTrueDoesNotMatch1.md +++ /dev/null @@ -1,9 +0,0 @@ -# unit_test_api.model.enum_with_true_does_not_match1.EnumWithTrueDoesNotMatch1 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -bool, | BoolClass, | | must be one of [True, ] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/EnumsInProperties.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/EnumsInProperties.md deleted file mode 100644 index 0e08a4a23d2..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/EnumsInProperties.md +++ /dev/null @@ -1,16 +0,0 @@ -# unit_test_api.model.enums_in_properties.EnumsInProperties - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**bar** | str, | str, | | must be one of ["bar", ] -**foo** | str, | str, | | [optional] must be one of ["foo", ] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/ForbiddenProperty.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/ForbiddenProperty.md deleted file mode 100644 index 3fc2175e9b0..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/ForbiddenProperty.md +++ /dev/null @@ -1,35 +0,0 @@ -# unit_test_api.model.forbidden_property.ForbiddenProperty - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**[foo](#foo)** | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -# foo - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### not -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[not_schema](#not_schema) | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -# not_schema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/HostnameFormat.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/HostnameFormat.md deleted file mode 100644 index 5efd27d124f..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/HostnameFormat.md +++ /dev/null @@ -1,9 +0,0 @@ -# unit_test_api.model.hostname_format.HostnameFormat - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/IntegerTypeMatchesIntegers.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/IntegerTypeMatchesIntegers.md deleted file mode 100644 index 2575c1ca534..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/IntegerTypeMatchesIntegers.md +++ /dev/null @@ -1,9 +0,0 @@ -# unit_test_api.model.integer_type_matches_integers.IntegerTypeMatchesIntegers - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -decimal.Decimal, int, | decimal.Decimal, | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf.md deleted file mode 100644 index 753345128a8..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf.md +++ /dev/null @@ -1,9 +0,0 @@ -# unit_test_api.model.invalid_instance_should_not_raise_error_when_float_division_inf.InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -decimal.Decimal, int, | decimal.Decimal, | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/InvalidStringValueForDefault.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/InvalidStringValueForDefault.md deleted file mode 100644 index 296bfd73517..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/InvalidStringValueForDefault.md +++ /dev/null @@ -1,15 +0,0 @@ -# unit_test_api.model.invalid_string_value_for_default.InvalidStringValueForDefault - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**bar** | str, | str, | | [optional] if omitted the server will use the default value of "bad" -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/Ipv4Format.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/Ipv4Format.md deleted file mode 100644 index 67ab85c9349..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/Ipv4Format.md +++ /dev/null @@ -1,9 +0,0 @@ -# unit_test_api.model.ipv4_format.Ipv4Format - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/Ipv6Format.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/Ipv6Format.md deleted file mode 100644 index e2086bee89b..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/Ipv6Format.md +++ /dev/null @@ -1,9 +0,0 @@ -# unit_test_api.model.ipv6_format.Ipv6Format - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/JsonPointerFormat.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/JsonPointerFormat.md deleted file mode 100644 index 40675571904..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/JsonPointerFormat.md +++ /dev/null @@ -1,9 +0,0 @@ -# unit_test_api.model.json_pointer_format.JsonPointerFormat - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/MaximumValidation.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/MaximumValidation.md deleted file mode 100644 index 826c055762d..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/MaximumValidation.md +++ /dev/null @@ -1,9 +0,0 @@ -# unit_test_api.model.maximum_validation.MaximumValidation - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/MaximumValidationWithUnsignedInteger.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/MaximumValidationWithUnsignedInteger.md deleted file mode 100644 index edc23e16bca..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/MaximumValidationWithUnsignedInteger.md +++ /dev/null @@ -1,9 +0,0 @@ -# unit_test_api.model.maximum_validation_with_unsigned_integer.MaximumValidationWithUnsignedInteger - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/MaxitemsValidation.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/MaxitemsValidation.md deleted file mode 100644 index 0aa20c0e8c9..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/MaxitemsValidation.md +++ /dev/null @@ -1,9 +0,0 @@ -# unit_test_api.model.maxitems_validation.MaxitemsValidation - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/MaxlengthValidation.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/MaxlengthValidation.md deleted file mode 100644 index 030db5c34fe..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/MaxlengthValidation.md +++ /dev/null @@ -1,9 +0,0 @@ -# unit_test_api.model.maxlength_validation.MaxlengthValidation - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/Maxproperties0MeansTheObjectIsEmpty.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/Maxproperties0MeansTheObjectIsEmpty.md deleted file mode 100644 index 1bbc951f004..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/Maxproperties0MeansTheObjectIsEmpty.md +++ /dev/null @@ -1,9 +0,0 @@ -# unit_test_api.model.maxproperties0_means_the_object_is_empty.Maxproperties0MeansTheObjectIsEmpty - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/MaxpropertiesValidation.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/MaxpropertiesValidation.md deleted file mode 100644 index e68e3d87adc..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/MaxpropertiesValidation.md +++ /dev/null @@ -1,9 +0,0 @@ -# unit_test_api.model.maxproperties_validation.MaxpropertiesValidation - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/MinimumValidation.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/MinimumValidation.md deleted file mode 100644 index 768068c3a63..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/MinimumValidation.md +++ /dev/null @@ -1,9 +0,0 @@ -# unit_test_api.model.minimum_validation.MinimumValidation - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/MinimumValidationWithSignedInteger.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/MinimumValidationWithSignedInteger.md deleted file mode 100644 index 59d2cb9edfd..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/MinimumValidationWithSignedInteger.md +++ /dev/null @@ -1,9 +0,0 @@ -# unit_test_api.model.minimum_validation_with_signed_integer.MinimumValidationWithSignedInteger - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/MinitemsValidation.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/MinitemsValidation.md deleted file mode 100644 index 48bbb8e3094..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/MinitemsValidation.md +++ /dev/null @@ -1,9 +0,0 @@ -# unit_test_api.model.minitems_validation.MinitemsValidation - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/MinlengthValidation.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/MinlengthValidation.md deleted file mode 100644 index 43ec10fc791..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/MinlengthValidation.md +++ /dev/null @@ -1,9 +0,0 @@ -# unit_test_api.model.minlength_validation.MinlengthValidation - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/MinpropertiesValidation.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/MinpropertiesValidation.md deleted file mode 100644 index b5ab4b4fcb7..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/MinpropertiesValidation.md +++ /dev/null @@ -1,9 +0,0 @@ -# unit_test_api.model.minproperties_validation.MinpropertiesValidation - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/ModelNot.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/ModelNot.md deleted file mode 100644 index e7f25eaa6e1..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/ModelNot.md +++ /dev/null @@ -1,22 +0,0 @@ -# unit_test_api.model.model_not.ModelNot - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### not -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[not_schema](#not_schema) | decimal.Decimal, int, | decimal.Decimal, | | - -# not_schema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -decimal.Decimal, int, | decimal.Decimal, | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/NestedAllofToCheckValidationSemantics.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/NestedAllofToCheckValidationSemantics.md deleted file mode 100644 index c760ab62bf0..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/NestedAllofToCheckValidationSemantics.md +++ /dev/null @@ -1,35 +0,0 @@ -# unit_test_api.model.nested_allof_to_check_validation_semantics.NestedAllofToCheckValidationSemantics - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### allOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[all_of_0](#all_of_0) | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -# all_of_0 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### allOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[all_of_0](#all_of_0) | None, | NoneClass, | | - -# all_of_0 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -None, | NoneClass, | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/NestedAnyofToCheckValidationSemantics.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/NestedAnyofToCheckValidationSemantics.md deleted file mode 100644 index 747506abdca..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/NestedAnyofToCheckValidationSemantics.md +++ /dev/null @@ -1,35 +0,0 @@ -# unit_test_api.model.nested_anyof_to_check_validation_semantics.NestedAnyofToCheckValidationSemantics - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### anyOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[any_of_0](#any_of_0) | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -# any_of_0 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### anyOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[any_of_0](#any_of_0) | None, | NoneClass, | | - -# any_of_0 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -None, | NoneClass, | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/NestedItems.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/NestedItems.md deleted file mode 100644 index 2247f45f60d..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/NestedItems.md +++ /dev/null @@ -1,50 +0,0 @@ -# unit_test_api.model.nested_items.NestedItems - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -list, tuple, | tuple, | | - -### Tuple Items -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[items](#items) | list, tuple, | tuple, | | - -# items - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -list, tuple, | tuple, | | - -### Tuple Items -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[items](#items) | list, tuple, | tuple, | | - -# items - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -list, tuple, | tuple, | | - -### Tuple Items -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[items](#items) | list, tuple, | tuple, | | - -# items - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -list, tuple, | tuple, | | - -### Tuple Items -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -items | decimal.Decimal, int, float, | decimal.Decimal, | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/NestedOneofToCheckValidationSemantics.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/NestedOneofToCheckValidationSemantics.md deleted file mode 100644 index a225e1f6767..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/NestedOneofToCheckValidationSemantics.md +++ /dev/null @@ -1,35 +0,0 @@ -# unit_test_api.model.nested_oneof_to_check_validation_semantics.NestedOneofToCheckValidationSemantics - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### oneOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[one_of_0](#one_of_0) | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -# one_of_0 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### oneOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[one_of_0](#one_of_0) | None, | NoneClass, | | - -# one_of_0 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -None, | NoneClass, | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/NotMoreComplexSchema.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/NotMoreComplexSchema.md deleted file mode 100644 index 45e198b3770..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/NotMoreComplexSchema.md +++ /dev/null @@ -1,28 +0,0 @@ -# unit_test_api.model.not_more_complex_schema.NotMoreComplexSchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### not -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[not_schema](#not_schema) | dict, frozendict.frozendict, | frozendict.frozendict, | | - -# not_schema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**foo** | str, | str, | | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/NulCharactersInStrings.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/NulCharactersInStrings.md deleted file mode 100644 index 8532d97c92e..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/NulCharactersInStrings.md +++ /dev/null @@ -1,9 +0,0 @@ -# unit_test_api.model.nul_characters_in_strings.NulCharactersInStrings - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | must be one of ["hello\x00there", ] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/NullTypeMatchesOnlyTheNullObject.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/NullTypeMatchesOnlyTheNullObject.md deleted file mode 100644 index 9a8e21c21be..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/NullTypeMatchesOnlyTheNullObject.md +++ /dev/null @@ -1,9 +0,0 @@ -# unit_test_api.model.null_type_matches_only_the_null_object.NullTypeMatchesOnlyTheNullObject - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -None, | NoneClass, | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/NumberTypeMatchesNumbers.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/NumberTypeMatchesNumbers.md deleted file mode 100644 index deebc8ff56d..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/NumberTypeMatchesNumbers.md +++ /dev/null @@ -1,9 +0,0 @@ -# unit_test_api.model.number_type_matches_numbers.NumberTypeMatchesNumbers - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -decimal.Decimal, int, float, | decimal.Decimal, | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/ObjectPropertiesValidation.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/ObjectPropertiesValidation.md deleted file mode 100644 index 9d145f83123..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/ObjectPropertiesValidation.md +++ /dev/null @@ -1,16 +0,0 @@ -# unit_test_api.model.object_properties_validation.ObjectPropertiesValidation - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**foo** | decimal.Decimal, int, | decimal.Decimal, | | [optional] -**bar** | str, | str, | | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/Oneof.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/Oneof.md deleted file mode 100644 index 0c056074c41..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/Oneof.md +++ /dev/null @@ -1,30 +0,0 @@ -# unit_test_api.model.oneof.Oneof - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### oneOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[one_of_0](#one_of_0) | decimal.Decimal, int, | decimal.Decimal, | | -[one_of_1](#one_of_1) | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -# one_of_0 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -decimal.Decimal, int, | decimal.Decimal, | | - -# one_of_1 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/OneofComplexTypes.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/OneofComplexTypes.md deleted file mode 100644 index 57278d6a7eb..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/OneofComplexTypes.md +++ /dev/null @@ -1,42 +0,0 @@ -# unit_test_api.model.oneof_complex_types.OneofComplexTypes - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### oneOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[one_of_0](#one_of_0) | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | -[one_of_1](#one_of_1) | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -# one_of_0 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**bar** | decimal.Decimal, int, | decimal.Decimal, | | -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -# one_of_1 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**foo** | str, | str, | | -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/OneofWithBaseSchema.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/OneofWithBaseSchema.md deleted file mode 100644 index 20776594f4e..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/OneofWithBaseSchema.md +++ /dev/null @@ -1,30 +0,0 @@ -# unit_test_api.model.oneof_with_base_schema.OneofWithBaseSchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### oneOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[one_of_0](#one_of_0) | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | -[one_of_1](#one_of_1) | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -# one_of_0 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -# one_of_1 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/OneofWithEmptySchema.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/OneofWithEmptySchema.md deleted file mode 100644 index f420f5c61de..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/OneofWithEmptySchema.md +++ /dev/null @@ -1,30 +0,0 @@ -# unit_test_api.model.oneof_with_empty_schema.OneofWithEmptySchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### oneOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[one_of_0](#one_of_0) | decimal.Decimal, int, float, | decimal.Decimal, | | -[one_of_1](#one_of_1) | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -# one_of_0 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -decimal.Decimal, int, float, | decimal.Decimal, | | - -# one_of_1 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/OneofWithRequired.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/OneofWithRequired.md deleted file mode 100644 index e9ba38802cf..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/OneofWithRequired.md +++ /dev/null @@ -1,30 +0,0 @@ -# unit_test_api.model.oneof_with_required.OneofWithRequired - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### oneOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[one_of_0](#one_of_0) | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | -[one_of_1](#one_of_1) | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -# one_of_0 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -# one_of_1 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/PatternIsNotAnchored.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/PatternIsNotAnchored.md deleted file mode 100644 index e9b758d826c..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/PatternIsNotAnchored.md +++ /dev/null @@ -1,9 +0,0 @@ -# unit_test_api.model.pattern_is_not_anchored.PatternIsNotAnchored - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/PatternValidation.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/PatternValidation.md deleted file mode 100644 index a2c7e75f30b..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/PatternValidation.md +++ /dev/null @@ -1,9 +0,0 @@ -# unit_test_api.model.pattern_validation.PatternValidation - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/PropertiesWithEscapedCharacters.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/PropertiesWithEscapedCharacters.md deleted file mode 100644 index 7505eb4e1ce..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/PropertiesWithEscapedCharacters.md +++ /dev/null @@ -1,20 +0,0 @@ -# unit_test_api.model.properties_with_escaped_characters.PropertiesWithEscapedCharacters - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**foo\nbar** | decimal.Decimal, int, float, | decimal.Decimal, | | [optional] -**foo\"bar** | decimal.Decimal, int, float, | decimal.Decimal, | | [optional] -**foo\\bar** | decimal.Decimal, int, float, | decimal.Decimal, | | [optional] -**foo\rbar** | decimal.Decimal, int, float, | decimal.Decimal, | | [optional] -**foo\tbar** | decimal.Decimal, int, float, | decimal.Decimal, | | [optional] -**foo\fbar** | decimal.Decimal, int, float, | decimal.Decimal, | | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/PropertyNamedRefThatIsNotAReference.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/PropertyNamedRefThatIsNotAReference.md deleted file mode 100644 index 4d0ec592570..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/PropertyNamedRefThatIsNotAReference.md +++ /dev/null @@ -1,15 +0,0 @@ -# unit_test_api.model.property_named_ref_that_is_not_a_reference.PropertyNamedRefThatIsNotAReference - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**$ref** | str, | str, | | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/RefInAdditionalproperties.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/RefInAdditionalproperties.md deleted file mode 100644 index 15d5366ac51..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/RefInAdditionalproperties.md +++ /dev/null @@ -1,14 +0,0 @@ -# unit_test_api.model.ref_in_additionalproperties.RefInAdditionalproperties - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**any_string_name** | [**PropertyNamedRefThatIsNotAReference**](PropertyNamedRefThatIsNotAReference.md) | [**PropertyNamedRefThatIsNotAReference**](PropertyNamedRefThatIsNotAReference.md) | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/RefInAllof.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/RefInAllof.md deleted file mode 100644 index 12158f9e282..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/RefInAllof.md +++ /dev/null @@ -1,15 +0,0 @@ -# unit_test_api.model.ref_in_allof.RefInAllof - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### allOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[PropertyNamedRefThatIsNotAReference](PropertyNamedRefThatIsNotAReference.md) | [**PropertyNamedRefThatIsNotAReference**](PropertyNamedRefThatIsNotAReference.md) | [**PropertyNamedRefThatIsNotAReference**](PropertyNamedRefThatIsNotAReference.md) | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/RefInAnyof.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/RefInAnyof.md deleted file mode 100644 index 5ff141f69b4..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/RefInAnyof.md +++ /dev/null @@ -1,15 +0,0 @@ -# unit_test_api.model.ref_in_anyof.RefInAnyof - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### anyOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[PropertyNamedRefThatIsNotAReference](PropertyNamedRefThatIsNotAReference.md) | [**PropertyNamedRefThatIsNotAReference**](PropertyNamedRefThatIsNotAReference.md) | [**PropertyNamedRefThatIsNotAReference**](PropertyNamedRefThatIsNotAReference.md) | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/RefInItems.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/RefInItems.md deleted file mode 100644 index 687a4da176c..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/RefInItems.md +++ /dev/null @@ -1,14 +0,0 @@ -# unit_test_api.model.ref_in_items.RefInItems - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -list, tuple, | tuple, | | - -### Tuple Items -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[**PropertyNamedRefThatIsNotAReference**](PropertyNamedRefThatIsNotAReference.md) | [**PropertyNamedRefThatIsNotAReference**](PropertyNamedRefThatIsNotAReference.md) | [**PropertyNamedRefThatIsNotAReference**](PropertyNamedRefThatIsNotAReference.md) | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/RefInNot.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/RefInNot.md deleted file mode 100644 index 4414c35841d..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/RefInNot.md +++ /dev/null @@ -1,15 +0,0 @@ -# unit_test_api.model.ref_in_not.RefInNot - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### not -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[PropertyNamedRefThatIsNotAReference](PropertyNamedRefThatIsNotAReference.md) | [**PropertyNamedRefThatIsNotAReference**](PropertyNamedRefThatIsNotAReference.md) | [**PropertyNamedRefThatIsNotAReference**](PropertyNamedRefThatIsNotAReference.md) | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/RefInOneof.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/RefInOneof.md deleted file mode 100644 index 68659fd58a0..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/RefInOneof.md +++ /dev/null @@ -1,15 +0,0 @@ -# unit_test_api.model.ref_in_oneof.RefInOneof - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### oneOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[PropertyNamedRefThatIsNotAReference](PropertyNamedRefThatIsNotAReference.md) | [**PropertyNamedRefThatIsNotAReference**](PropertyNamedRefThatIsNotAReference.md) | [**PropertyNamedRefThatIsNotAReference**](PropertyNamedRefThatIsNotAReference.md) | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/RefInProperty.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/RefInProperty.md deleted file mode 100644 index 67ac9dd119e..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/RefInProperty.md +++ /dev/null @@ -1,15 +0,0 @@ -# unit_test_api.model.ref_in_property.RefInProperty - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**a** | [**PropertyNamedRefThatIsNotAReference**](PropertyNamedRefThatIsNotAReference.md) | [**PropertyNamedRefThatIsNotAReference**](PropertyNamedRefThatIsNotAReference.md) | | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/RequiredDefaultValidation.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/RequiredDefaultValidation.md deleted file mode 100644 index 942d13d2644..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/RequiredDefaultValidation.md +++ /dev/null @@ -1,15 +0,0 @@ -# unit_test_api.model.required_default_validation.RequiredDefaultValidation - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**foo** | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/RequiredValidation.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/RequiredValidation.md deleted file mode 100644 index 0bdb9e64611..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/RequiredValidation.md +++ /dev/null @@ -1,16 +0,0 @@ -# unit_test_api.model.required_validation.RequiredValidation - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**foo** | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | -**bar** | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/RequiredWithEmptyArray.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/RequiredWithEmptyArray.md deleted file mode 100644 index 097a433c649..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/RequiredWithEmptyArray.md +++ /dev/null @@ -1,15 +0,0 @@ -# unit_test_api.model.required_with_empty_array.RequiredWithEmptyArray - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**foo** | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/RequiredWithEscapedCharacters.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/RequiredWithEscapedCharacters.md deleted file mode 100644 index a89c4b8bf84..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/RequiredWithEscapedCharacters.md +++ /dev/null @@ -1,9 +0,0 @@ -# unit_test_api.model.required_with_escaped_characters.RequiredWithEscapedCharacters - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/SimpleEnumValidation.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/SimpleEnumValidation.md deleted file mode 100644 index 12c0eaf4f83..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/SimpleEnumValidation.md +++ /dev/null @@ -1,9 +0,0 @@ -# unit_test_api.model.simple_enum_validation.SimpleEnumValidation - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -decimal.Decimal, int, float, | decimal.Decimal, | | must be one of [1, 2, 3, ] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/StringTypeMatchesStrings.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/StringTypeMatchesStrings.md deleted file mode 100644 index 6cee3b4720c..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/StringTypeMatchesStrings.md +++ /dev/null @@ -1,9 +0,0 @@ -# unit_test_api.model.string_type_matches_strings.StringTypeMatchesStrings - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.md deleted file mode 100644 index 5d3e5000007..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.md +++ /dev/null @@ -1,15 +0,0 @@ -# unit_test_api.model.the_default_keyword_does_not_do_anything_if_the_property_is_missing.TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**alpha** | decimal.Decimal, int, float, | decimal.Decimal, | | [optional] if omitted the server will use the default value of 5 -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/UniqueitemsFalseValidation.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/UniqueitemsFalseValidation.md deleted file mode 100644 index f06a22b0be2..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/UniqueitemsFalseValidation.md +++ /dev/null @@ -1,9 +0,0 @@ -# unit_test_api.model.uniqueitems_false_validation.UniqueitemsFalseValidation - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/UniqueitemsValidation.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/UniqueitemsValidation.md deleted file mode 100644 index 89fe7ce6572..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/UniqueitemsValidation.md +++ /dev/null @@ -1,9 +0,0 @@ -# unit_test_api.model.uniqueitems_validation.UniqueitemsValidation - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/UriFormat.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/UriFormat.md deleted file mode 100644 index 82ee5f3cdb0..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/UriFormat.md +++ /dev/null @@ -1,9 +0,0 @@ -# unit_test_api.model.uri_format.UriFormat - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/UriReferenceFormat.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/UriReferenceFormat.md deleted file mode 100644 index c0bdbf8e260..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/UriReferenceFormat.md +++ /dev/null @@ -1,9 +0,0 @@ -# unit_test_api.model.uri_reference_format.UriReferenceFormat - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/UriTemplateFormat.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/UriTemplateFormat.md deleted file mode 100644 index cfb0c0c98d4..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/models/UriTemplateFormat.md +++ /dev/null @@ -1,9 +0,0 @@ -# unit_test_api.model.uri_template_format.UriTemplateFormat - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post.md new file mode 100644 index 00000000000..727e8c3600d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post.md @@ -0,0 +1,115 @@ +unit_test_api.paths.request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_additionalproperties_allows_a_schema_which_should_validate_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_additionalproperties_allows_a_schema_which_should_validate_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_additionalproperties_allows_a_schema_which_should_validate_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_additionalproperties_allows_a_schema_which_should_validate_request_body | [AdditionalPropertiesApi](../../apis/tags/additional_properties_api.md) | This api is only for tag=additionalProperties | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody | This api is only for path=/requestBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[AdditionalpropertiesAllowsASchemaWhichShouldValidate](../../components/schema/additionalproperties_allows_a_schema_which_should_validate.md) | dict, frozendict.frozendict | frozendict.frozendict | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = additionalproperties_allows_a_schema_which_should_validate.AdditionalpropertiesAllowsASchemaWhichShouldValidate( + foo=None, + bar=None, + ) + try: + api_response = api_instance.post_additionalproperties_allows_a_schema_which_should_validate_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_additionalproperties_allows_a_schema_which_should_validate_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to AdditionalPropertiesApi API]](../../apis/tags/additional_properties_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post.md new file mode 100644 index 00000000000..9ad970ee4c1 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_additionalproperties_are_allowed_by_default_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_additionalproperties_are_allowed_by_default_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_additionalproperties_are_allowed_by_default_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_additionalproperties_are_allowed_by_default_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_additionalproperties_are_allowed_by_default_request_body | [AdditionalPropertiesApi](../../apis/tags/additional_properties_api.md) | This api is only for tag=additionalProperties | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostAdditionalpropertiesAreAllowedByDefaultRequestBody | This api is only for path=/requestBody/postAdditionalpropertiesAreAllowedByDefaultRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postAdditionalpropertiesAreAllowedByDefaultRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[AdditionalpropertiesAreAllowedByDefault](../../components/schema/additionalproperties_are_allowed_by_default.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = additionalproperties_are_allowed_by_default.AdditionalpropertiesAreAllowedByDefault(None) + try: + api_response = api_instance.post_additionalproperties_are_allowed_by_default_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_additionalproperties_are_allowed_by_default_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to AdditionalPropertiesApi API]](../../apis/tags/additional_properties_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post.md new file mode 100644 index 00000000000..aded269ceea --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post.md @@ -0,0 +1,114 @@ +unit_test_api.paths.request_body_post_additionalproperties_can_exist_by_itself_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_additionalproperties_can_exist_by_itself_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_additionalproperties_can_exist_by_itself_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_additionalproperties_can_exist_by_itself_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_additionalproperties_can_exist_by_itself_request_body | [AdditionalPropertiesApi](../../apis/tags/additional_properties_api.md) | This api is only for tag=additionalProperties | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostAdditionalpropertiesCanExistByItselfRequestBody | This api is only for path=/requestBody/postAdditionalpropertiesCanExistByItselfRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postAdditionalpropertiesCanExistByItselfRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[AdditionalpropertiesCanExistByItself](../../components/schema/additionalproperties_can_exist_by_itself.md) | dict, frozendict.frozendict | frozendict.frozendict | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = additionalproperties_can_exist_by_itself.AdditionalpropertiesCanExistByItself( + key=True, + ) + try: + api_response = api_instance.post_additionalproperties_can_exist_by_itself_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_additionalproperties_can_exist_by_itself_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to AdditionalPropertiesApi API]](../../apis/tags/additional_properties_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post.md new file mode 100644 index 00000000000..229c81ab21e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_additionalproperties_should_not_look_in_applicators_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_additionalproperties_should_not_look_in_applicators_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_additionalproperties_should_not_look_in_applicators_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_additionalproperties_should_not_look_in_applicators_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_additionalproperties_should_not_look_in_applicators_request_body | [AdditionalPropertiesApi](../../apis/tags/additional_properties_api.md) | This api is only for tag=additionalProperties | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostAdditionalpropertiesShouldNotLookInApplicatorsRequestBody | This api is only for path=/requestBody/postAdditionalpropertiesShouldNotLookInApplicatorsRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postAdditionalpropertiesShouldNotLookInApplicatorsRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[AdditionalpropertiesShouldNotLookInApplicators](../../components/schema/additionalproperties_should_not_look_in_applicators.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = additionalproperties_should_not_look_in_applicators.AdditionalpropertiesShouldNotLookInApplicators(None) + try: + api_response = api_instance.post_additionalproperties_should_not_look_in_applicators_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_additionalproperties_should_not_look_in_applicators_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to AdditionalPropertiesApi API]](../../apis/tags/additional_properties_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post.md new file mode 100644 index 00000000000..41df672949f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_allof_combined_with_anyof_oneof_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_allof_combined_with_anyof_oneof_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_allof_combined_with_anyof_oneof_request_body | [AllOfApi](../../apis/tags/all_of_api.md) | This api is only for tag=allOf | +| post_allof_combined_with_anyof_oneof_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_allof_combined_with_anyof_oneof_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostAllofCombinedWithAnyofOneofRequestBody | This api is only for path=/requestBody/postAllofCombinedWithAnyofOneofRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postAllofCombinedWithAnyofOneofRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[AllofCombinedWithAnyofOneof](../../components/schema/allof_combined_with_anyof_oneof.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = allof_combined_with_anyof_oneof.AllofCombinedWithAnyofOneof(None) + try: + api_response = api_instance.post_allof_combined_with_anyof_oneof_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_allof_combined_with_anyof_oneof_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to AllOfApi API]](../../apis/tags/all_of_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_allof_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_allof_request_body/post.md new file mode 100644 index 00000000000..c8e85ed8d68 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_allof_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_allof_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_allof_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_allof_request_body | [AllOfApi](../../apis/tags/all_of_api.md) | This api is only for tag=allOf | +| post_allof_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_allof_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostAllofRequestBody | This api is only for path=/requestBody/postAllofRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postAllofRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[Allof](../../components/schema/allof.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = allof.Allof(None) + try: + api_response = api_instance.post_allof_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_allof_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to AllOfApi API]](../../apis/tags/all_of_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_allof_simple_types_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_allof_simple_types_request_body/post.md new file mode 100644 index 00000000000..d6437993018 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_allof_simple_types_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_allof_simple_types_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_allof_simple_types_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_allof_simple_types_request_body | [AllOfApi](../../apis/tags/all_of_api.md) | This api is only for tag=allOf | +| post_allof_simple_types_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_allof_simple_types_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostAllofSimpleTypesRequestBody | This api is only for path=/requestBody/postAllofSimpleTypesRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postAllofSimpleTypesRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[AllofSimpleTypes](../../components/schema/allof_simple_types.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = allof_simple_types.AllofSimpleTypes(None) + try: + api_response = api_instance.post_allof_simple_types_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_allof_simple_types_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to AllOfApi API]](../../apis/tags/all_of_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_allof_with_base_schema_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_allof_with_base_schema_request_body/post.md new file mode 100644 index 00000000000..39fc0a91c95 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_allof_with_base_schema_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_allof_with_base_schema_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_allof_with_base_schema_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_allof_with_base_schema_request_body | [AllOfApi](../../apis/tags/all_of_api.md) | This api is only for tag=allOf | +| post_allof_with_base_schema_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_allof_with_base_schema_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostAllofWithBaseSchemaRequestBody | This api is only for path=/requestBody/postAllofWithBaseSchemaRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postAllofWithBaseSchemaRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[AllofWithBaseSchema](../../components/schema/allof_with_base_schema.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = allof_with_base_schema.AllofWithBaseSchema({}) + try: + api_response = api_instance.post_allof_with_base_schema_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_allof_with_base_schema_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to AllOfApi API]](../../apis/tags/all_of_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_allof_with_one_empty_schema_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_allof_with_one_empty_schema_request_body/post.md new file mode 100644 index 00000000000..b655606ad4c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_allof_with_one_empty_schema_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_allof_with_one_empty_schema_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_allof_with_one_empty_schema_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_allof_with_one_empty_schema_request_body | [AllOfApi](../../apis/tags/all_of_api.md) | This api is only for tag=allOf | +| post_allof_with_one_empty_schema_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_allof_with_one_empty_schema_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostAllofWithOneEmptySchemaRequestBody | This api is only for path=/requestBody/postAllofWithOneEmptySchemaRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postAllofWithOneEmptySchemaRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[AllofWithOneEmptySchema](../../components/schema/allof_with_one_empty_schema.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = allof_with_one_empty_schema.AllofWithOneEmptySchema(None) + try: + api_response = api_instance.post_allof_with_one_empty_schema_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_allof_with_one_empty_schema_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to AllOfApi API]](../../apis/tags/all_of_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post.md new file mode 100644 index 00000000000..5cd94ee7845 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_allof_with_the_first_empty_schema_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_allof_with_the_first_empty_schema_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_allof_with_the_first_empty_schema_request_body | [AllOfApi](../../apis/tags/all_of_api.md) | This api is only for tag=allOf | +| post_allof_with_the_first_empty_schema_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_allof_with_the_first_empty_schema_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostAllofWithTheFirstEmptySchemaRequestBody | This api is only for path=/requestBody/postAllofWithTheFirstEmptySchemaRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postAllofWithTheFirstEmptySchemaRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[AllofWithTheFirstEmptySchema](../../components/schema/allof_with_the_first_empty_schema.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = allof_with_the_first_empty_schema.AllofWithTheFirstEmptySchema(None) + try: + api_response = api_instance.post_allof_with_the_first_empty_schema_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_allof_with_the_first_empty_schema_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to AllOfApi API]](../../apis/tags/all_of_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post.md new file mode 100644 index 00000000000..44f7fa31254 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_allof_with_the_last_empty_schema_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_allof_with_the_last_empty_schema_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_allof_with_the_last_empty_schema_request_body | [AllOfApi](../../apis/tags/all_of_api.md) | This api is only for tag=allOf | +| post_allof_with_the_last_empty_schema_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_allof_with_the_last_empty_schema_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostAllofWithTheLastEmptySchemaRequestBody | This api is only for path=/requestBody/postAllofWithTheLastEmptySchemaRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postAllofWithTheLastEmptySchemaRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[AllofWithTheLastEmptySchema](../../components/schema/allof_with_the_last_empty_schema.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = allof_with_the_last_empty_schema.AllofWithTheLastEmptySchema(None) + try: + api_response = api_instance.post_allof_with_the_last_empty_schema_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_allof_with_the_last_empty_schema_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to AllOfApi API]](../../apis/tags/all_of_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_allof_with_two_empty_schemas_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_allof_with_two_empty_schemas_request_body/post.md new file mode 100644 index 00000000000..e4030335bd5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_allof_with_two_empty_schemas_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_allof_with_two_empty_schemas_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_allof_with_two_empty_schemas_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_allof_with_two_empty_schemas_request_body | [AllOfApi](../../apis/tags/all_of_api.md) | This api is only for tag=allOf | +| post_allof_with_two_empty_schemas_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_allof_with_two_empty_schemas_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostAllofWithTwoEmptySchemasRequestBody | This api is only for path=/requestBody/postAllofWithTwoEmptySchemasRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postAllofWithTwoEmptySchemasRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[AllofWithTwoEmptySchemas](../../components/schema/allof_with_two_empty_schemas.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = allof_with_two_empty_schemas.AllofWithTwoEmptySchemas(None) + try: + api_response = api_instance.post_allof_with_two_empty_schemas_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_allof_with_two_empty_schemas_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to AllOfApi API]](../../apis/tags/all_of_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_anyof_complex_types_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_anyof_complex_types_request_body/post.md new file mode 100644 index 00000000000..8c1bd61dfe9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_anyof_complex_types_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_anyof_complex_types_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_anyof_complex_types_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_anyof_complex_types_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_anyof_complex_types_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_anyof_complex_types_request_body | [AnyOfApi](../../apis/tags/any_of_api.md) | This api is only for tag=anyOf | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostAnyofComplexTypesRequestBody | This api is only for path=/requestBody/postAnyofComplexTypesRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postAnyofComplexTypesRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[AnyofComplexTypes](../../components/schema/anyof_complex_types.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = anyof_complex_types.AnyofComplexTypes(None) + try: + api_response = api_instance.post_anyof_complex_types_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_anyof_complex_types_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to AnyOfApi API]](../../apis/tags/any_of_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_anyof_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_anyof_request_body/post.md new file mode 100644 index 00000000000..eb1a740f726 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_anyof_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_anyof_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_anyof_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_anyof_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_anyof_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_anyof_request_body | [AnyOfApi](../../apis/tags/any_of_api.md) | This api is only for tag=anyOf | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostAnyofRequestBody | This api is only for path=/requestBody/postAnyofRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postAnyofRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[Anyof](../../components/schema/anyof.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = anyof.Anyof(None) + try: + api_response = api_instance.post_anyof_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_anyof_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to AnyOfApi API]](../../apis/tags/any_of_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_anyof_with_base_schema_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_anyof_with_base_schema_request_body/post.md new file mode 100644 index 00000000000..d12757a45c4 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_anyof_with_base_schema_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_anyof_with_base_schema_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_anyof_with_base_schema_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_anyof_with_base_schema_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_anyof_with_base_schema_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_anyof_with_base_schema_request_body | [AnyOfApi](../../apis/tags/any_of_api.md) | This api is only for tag=anyOf | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostAnyofWithBaseSchemaRequestBody | This api is only for path=/requestBody/postAnyofWithBaseSchemaRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postAnyofWithBaseSchemaRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), str] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[AnyofWithBaseSchema](../../components/schema/anyof_with_base_schema.md) | str | str | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = anyof_with_base_schema.AnyofWithBaseSchema("string_example") + try: + api_response = api_instance.post_anyof_with_base_schema_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_anyof_with_base_schema_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to AnyOfApi API]](../../apis/tags/any_of_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_anyof_with_one_empty_schema_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_anyof_with_one_empty_schema_request_body/post.md new file mode 100644 index 00000000000..a4605cf74f5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_anyof_with_one_empty_schema_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_anyof_with_one_empty_schema_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_anyof_with_one_empty_schema_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_anyof_with_one_empty_schema_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_anyof_with_one_empty_schema_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_anyof_with_one_empty_schema_request_body | [AnyOfApi](../../apis/tags/any_of_api.md) | This api is only for tag=anyOf | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostAnyofWithOneEmptySchemaRequestBody | This api is only for path=/requestBody/postAnyofWithOneEmptySchemaRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postAnyofWithOneEmptySchemaRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[AnyofWithOneEmptySchema](../../components/schema/anyof_with_one_empty_schema.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = anyof_with_one_empty_schema.AnyofWithOneEmptySchema(None) + try: + api_response = api_instance.post_anyof_with_one_empty_schema_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_anyof_with_one_empty_schema_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to AnyOfApi API]](../../apis/tags/any_of_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_array_type_matches_arrays_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_array_type_matches_arrays_request_body/post.md new file mode 100644 index 00000000000..08b3d9639c6 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_array_type_matches_arrays_request_body/post.md @@ -0,0 +1,114 @@ +unit_test_api.paths.request_body_post_array_type_matches_arrays_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_array_type_matches_arrays_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_array_type_matches_arrays_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_array_type_matches_arrays_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_array_type_matches_arrays_request_body | [TypeApi](../../apis/tags/type_api.md) | This api is only for tag=type | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostArrayTypeMatchesArraysRequestBody | This api is only for path=/requestBody/postArrayTypeMatchesArraysRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postArrayTypeMatchesArraysRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), list, tuple] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[ArrayTypeMatchesArrays](../../components/schema/array_type_matches_arrays.md) | list, tuple | tuple | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = array_type_matches_arrays.ArrayTypeMatchesArrays([ + None + ]) + try: + api_response = api_instance.post_array_type_matches_arrays_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_array_type_matches_arrays_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to TypeApi API]](../../apis/tags/type_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_boolean_type_matches_booleans_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_boolean_type_matches_booleans_request_body/post.md new file mode 100644 index 00000000000..700d615e0b8 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_boolean_type_matches_booleans_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_boolean_type_matches_booleans_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_boolean_type_matches_booleans_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_boolean_type_matches_booleans_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_boolean_type_matches_booleans_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_boolean_type_matches_booleans_request_body | [TypeApi](../../apis/tags/type_api.md) | This api is only for tag=type | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostBooleanTypeMatchesBooleansRequestBody | This api is only for path=/requestBody/postBooleanTypeMatchesBooleansRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postBooleanTypeMatchesBooleansRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), bool] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[BooleanTypeMatchesBooleans](../../components/schema/boolean_type_matches_booleans.md) | bool | BoolClass | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = boolean_type_matches_booleans.BooleanTypeMatchesBooleans(True) + try: + api_response = api_instance.post_boolean_type_matches_booleans_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_boolean_type_matches_booleans_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to TypeApi API]](../../apis/tags/type_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_by_int_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_by_int_request_body/post.md new file mode 100644 index 00000000000..f5603ce1426 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_by_int_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_by_int_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_by_int_request_body | [MultipleOfApi](../../apis/tags/multiple_of_api.md) | This api is only for tag=multipleOf | +| post_by_int_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_by_int_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_by_int_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostByIntRequestBody | This api is only for path=/requestBody/postByIntRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postByIntRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[ByInt](../../components/schema/by_int.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import multiple_of_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = multiple_of_api.MultipleOfApi(api_client) + + # example passing only required values which don't have defaults set + body = by_int.ByInt(None) + try: + api_response = api_instance.post_by_int_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling MultipleOfApi->post_by_int_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to MultipleOfApi API]](../../apis/tags/multiple_of_api.md) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_by_number_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_by_number_request_body/post.md new file mode 100644 index 00000000000..db9675ea6f4 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_by_number_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_by_number_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_by_number_request_body | [MultipleOfApi](../../apis/tags/multiple_of_api.md) | This api is only for tag=multipleOf | +| post_by_number_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_by_number_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_by_number_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostByNumberRequestBody | This api is only for path=/requestBody/postByNumberRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postByNumberRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[ByNumber](../../components/schema/by_number.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import multiple_of_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = multiple_of_api.MultipleOfApi(api_client) + + # example passing only required values which don't have defaults set + body = by_number.ByNumber(None) + try: + api_response = api_instance.post_by_number_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling MultipleOfApi->post_by_number_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to MultipleOfApi API]](../../apis/tags/multiple_of_api.md) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_by_small_number_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_by_small_number_request_body/post.md new file mode 100644 index 00000000000..d7745378d63 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_by_small_number_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_by_small_number_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_by_small_number_request_body | [MultipleOfApi](../../apis/tags/multiple_of_api.md) | This api is only for tag=multipleOf | +| post_by_small_number_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_by_small_number_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_by_small_number_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostBySmallNumberRequestBody | This api is only for path=/requestBody/postBySmallNumberRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postBySmallNumberRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[BySmallNumber](../../components/schema/by_small_number.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import multiple_of_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = multiple_of_api.MultipleOfApi(api_client) + + # example passing only required values which don't have defaults set + body = by_small_number.BySmallNumber(None) + try: + api_response = api_instance.post_by_small_number_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling MultipleOfApi->post_by_small_number_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to MultipleOfApi API]](../../apis/tags/multiple_of_api.md) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_date_time_format_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_date_time_format_request_body/post.md new file mode 100644 index 00000000000..221be49389e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_date_time_format_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_date_time_format_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_date_time_format_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_date_time_format_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_date_time_format_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_date_time_format_request_body | [FormatApi](../../apis/tags/format_api.md) | This api is only for tag=format | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostDateTimeFormatRequestBody | This api is only for path=/requestBody/postDateTimeFormatRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postDateTimeFormatRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[DateTimeFormat](../../components/schema/date_time_format.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = date_time_format.DateTimeFormat(None) + try: + api_response = api_instance.post_date_time_format_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_date_time_format_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to FormatApi API]](../../apis/tags/format_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_email_format_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_email_format_request_body/post.md new file mode 100644 index 00000000000..735d3a200ac --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_email_format_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_email_format_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_email_format_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_email_format_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_email_format_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_email_format_request_body | [FormatApi](../../apis/tags/format_api.md) | This api is only for tag=format | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostEmailFormatRequestBody | This api is only for path=/requestBody/postEmailFormatRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postEmailFormatRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[EmailFormat](../../components/schema/email_format.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = email_format.EmailFormat(None) + try: + api_response = api_instance.post_email_format_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_email_format_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to FormatApi API]](../../apis/tags/format_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_enum_with0_does_not_match_false_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_enum_with0_does_not_match_false_request_body/post.md new file mode 100644 index 00000000000..3af87d19aaf --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_enum_with0_does_not_match_false_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_enum_with0_does_not_match_false_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_enum_with0_does_not_match_false_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_enum_with0_does_not_match_false_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_enum_with0_does_not_match_false_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_enum_with0_does_not_match_false_request_body | [EnumApi](../../apis/tags/enum_api.md) | This api is only for tag=enum | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostEnumWith0DoesNotMatchFalseRequestBody | This api is only for path=/requestBody/postEnumWith0DoesNotMatchFalseRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postEnumWith0DoesNotMatchFalseRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), decimal.Decimal, int, float] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[EnumWith0DoesNotMatchFalse](../../components/schema/enum_with0_does_not_match_false.md) | decimal.Decimal, int, float | decimal.Decimal | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = enum_with0_does_not_match_false.EnumWith0DoesNotMatchFalse(0) + try: + api_response = api_instance.post_enum_with0_does_not_match_false_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_enum_with0_does_not_match_false_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to EnumApi API]](../../apis/tags/enum_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_enum_with1_does_not_match_true_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_enum_with1_does_not_match_true_request_body/post.md new file mode 100644 index 00000000000..0e00df7fcb5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_enum_with1_does_not_match_true_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_enum_with1_does_not_match_true_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_enum_with1_does_not_match_true_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_enum_with1_does_not_match_true_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_enum_with1_does_not_match_true_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_enum_with1_does_not_match_true_request_body | [EnumApi](../../apis/tags/enum_api.md) | This api is only for tag=enum | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostEnumWith1DoesNotMatchTrueRequestBody | This api is only for path=/requestBody/postEnumWith1DoesNotMatchTrueRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postEnumWith1DoesNotMatchTrueRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), decimal.Decimal, int, float] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[EnumWith1DoesNotMatchTrue](../../components/schema/enum_with1_does_not_match_true.md) | decimal.Decimal, int, float | decimal.Decimal | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = enum_with1_does_not_match_true.EnumWith1DoesNotMatchTrue(1) + try: + api_response = api_instance.post_enum_with1_does_not_match_true_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_enum_with1_does_not_match_true_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to EnumApi API]](../../apis/tags/enum_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_enum_with_escaped_characters_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_enum_with_escaped_characters_request_body/post.md new file mode 100644 index 00000000000..2c3c0b9418d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_enum_with_escaped_characters_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_enum_with_escaped_characters_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_enum_with_escaped_characters_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_enum_with_escaped_characters_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_enum_with_escaped_characters_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_enum_with_escaped_characters_request_body | [EnumApi](../../apis/tags/enum_api.md) | This api is only for tag=enum | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostEnumWithEscapedCharactersRequestBody | This api is only for path=/requestBody/postEnumWithEscapedCharactersRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postEnumWithEscapedCharactersRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), str] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[EnumWithEscapedCharacters](../../components/schema/enum_with_escaped_characters.md) | str | str | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = enum_with_escaped_characters.EnumWithEscapedCharacters("foo\nbar") + try: + api_response = api_instance.post_enum_with_escaped_characters_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_enum_with_escaped_characters_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to EnumApi API]](../../apis/tags/enum_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_enum_with_false_does_not_match0_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_enum_with_false_does_not_match0_request_body/post.md new file mode 100644 index 00000000000..2c2a3d4c2c6 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_enum_with_false_does_not_match0_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_enum_with_false_does_not_match0_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_enum_with_false_does_not_match0_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_enum_with_false_does_not_match0_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_enum_with_false_does_not_match0_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_enum_with_false_does_not_match0_request_body | [EnumApi](../../apis/tags/enum_api.md) | This api is only for tag=enum | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostEnumWithFalseDoesNotMatch0RequestBody | This api is only for path=/requestBody/postEnumWithFalseDoesNotMatch0RequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postEnumWithFalseDoesNotMatch0RequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), bool] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[EnumWithFalseDoesNotMatch0](../../components/schema/enum_with_false_does_not_match0.md) | bool | BoolClass | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = enum_with_false_does_not_match0.EnumWithFalseDoesNotMatch0(False) + try: + api_response = api_instance.post_enum_with_false_does_not_match0_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_enum_with_false_does_not_match0_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to EnumApi API]](../../apis/tags/enum_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_enum_with_true_does_not_match1_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_enum_with_true_does_not_match1_request_body/post.md new file mode 100644 index 00000000000..492f9e1d936 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_enum_with_true_does_not_match1_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_enum_with_true_does_not_match1_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_enum_with_true_does_not_match1_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_enum_with_true_does_not_match1_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_enum_with_true_does_not_match1_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_enum_with_true_does_not_match1_request_body | [EnumApi](../../apis/tags/enum_api.md) | This api is only for tag=enum | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostEnumWithTrueDoesNotMatch1RequestBody | This api is only for path=/requestBody/postEnumWithTrueDoesNotMatch1RequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postEnumWithTrueDoesNotMatch1RequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), bool] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[EnumWithTrueDoesNotMatch1](../../components/schema/enum_with_true_does_not_match1.md) | bool | BoolClass | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = enum_with_true_does_not_match1.EnumWithTrueDoesNotMatch1(True) + try: + api_response = api_instance.post_enum_with_true_does_not_match1_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_enum_with_true_does_not_match1_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to EnumApi API]](../../apis/tags/enum_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_enums_in_properties_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_enums_in_properties_request_body/post.md new file mode 100644 index 00000000000..120f35413aa --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_enums_in_properties_request_body/post.md @@ -0,0 +1,115 @@ +unit_test_api.paths.request_body_post_enums_in_properties_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_enums_in_properties_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_enums_in_properties_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_enums_in_properties_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_enums_in_properties_request_body | [EnumApi](../../apis/tags/enum_api.md) | This api is only for tag=enum | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostEnumsInPropertiesRequestBody | This api is only for path=/requestBody/postEnumsInPropertiesRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postEnumsInPropertiesRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[EnumsInProperties](../../components/schema/enums_in_properties.md) | dict, frozendict.frozendict | frozendict.frozendict | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = enums_in_properties.EnumsInProperties( + foo="foo", + bar="bar", + ) + try: + api_response = api_instance.post_enums_in_properties_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_enums_in_properties_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to EnumApi API]](../../apis/tags/enum_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_forbidden_property_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_forbidden_property_request_body/post.md new file mode 100644 index 00000000000..03154ad3d40 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_forbidden_property_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_forbidden_property_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_forbidden_property_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_forbidden_property_request_body | [_NotApi](../../apis/tags/_not_api.md) | This api is only for tag=not | +| post_forbidden_property_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_forbidden_property_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostForbiddenPropertyRequestBody | This api is only for path=/requestBody/postForbiddenPropertyRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postForbiddenPropertyRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[ForbiddenProperty](../../components/schema/forbidden_property.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = forbidden_property.ForbiddenProperty(None) + try: + api_response = api_instance.post_forbidden_property_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_forbidden_property_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to _NotApi API]](../../apis/tags/_not_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_hostname_format_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_hostname_format_request_body/post.md new file mode 100644 index 00000000000..5e5fddc957d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_hostname_format_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_hostname_format_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_hostname_format_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_hostname_format_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_hostname_format_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_hostname_format_request_body | [FormatApi](../../apis/tags/format_api.md) | This api is only for tag=format | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostHostnameFormatRequestBody | This api is only for path=/requestBody/postHostnameFormatRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postHostnameFormatRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[HostnameFormat](../../components/schema/hostname_format.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = hostname_format.HostnameFormat(None) + try: + api_response = api_instance.post_hostname_format_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_hostname_format_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to FormatApi API]](../../apis/tags/format_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_integer_type_matches_integers_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_integer_type_matches_integers_request_body/post.md new file mode 100644 index 00000000000..f88eb4025bf --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_integer_type_matches_integers_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_integer_type_matches_integers_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_integer_type_matches_integers_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_integer_type_matches_integers_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_integer_type_matches_integers_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_integer_type_matches_integers_request_body | [TypeApi](../../apis/tags/type_api.md) | This api is only for tag=type | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostIntegerTypeMatchesIntegersRequestBody | This api is only for path=/requestBody/postIntegerTypeMatchesIntegersRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postIntegerTypeMatchesIntegersRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), decimal.Decimal, int] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[IntegerTypeMatchesIntegers](../../components/schema/integer_type_matches_integers.md) | decimal.Decimal, int | decimal.Decimal | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = integer_type_matches_integers.IntegerTypeMatchesIntegers(1) + try: + api_response = api_instance.post_integer_type_matches_integers_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_integer_type_matches_integers_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to TypeApi API]](../../apis/tags/type_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post.md new file mode 100644 index 00000000000..517ae1d3dda --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body | [MultipleOfApi](../../apis/tags/multiple_of_api.md) | This api is only for tag=multipleOf | +| post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody | This api is only for path=/requestBody/postInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), decimal.Decimal, int] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf](../../components/schema/invalid_instance_should_not_raise_error_when_float_division_inf.md) | decimal.Decimal, int | decimal.Decimal | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import multiple_of_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = multiple_of_api.MultipleOfApi(api_client) + + # example passing only required values which don't have defaults set + body = invalid_instance_should_not_raise_error_when_float_division_inf.InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf(1) + try: + api_response = api_instance.post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling MultipleOfApi->post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to MultipleOfApi API]](../../apis/tags/multiple_of_api.md) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_invalid_string_value_for_default_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_invalid_string_value_for_default_request_body/post.md new file mode 100644 index 00000000000..55ac8af9f6f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_invalid_string_value_for_default_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_invalid_string_value_for_default_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_invalid_string_value_for_default_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_invalid_string_value_for_default_request_body | [DefaultApi](../../apis/tags/default_api.md) | This api is only for tag=default | +| post_invalid_string_value_for_default_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_invalid_string_value_for_default_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostInvalidStringValueForDefaultRequestBody | This api is only for path=/requestBody/postInvalidStringValueForDefaultRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postInvalidStringValueForDefaultRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[InvalidStringValueForDefault](../../components/schema/invalid_string_value_for_default.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = invalid_string_value_for_default.InvalidStringValueForDefault(None) + try: + api_response = api_instance.post_invalid_string_value_for_default_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_invalid_string_value_for_default_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to DefaultApi API]](../../apis/tags/default_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_ipv4_format_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_ipv4_format_request_body/post.md new file mode 100644 index 00000000000..719c947b429 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_ipv4_format_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_ipv4_format_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_ipv4_format_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_ipv4_format_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_ipv4_format_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_ipv4_format_request_body | [FormatApi](../../apis/tags/format_api.md) | This api is only for tag=format | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostIpv4FormatRequestBody | This api is only for path=/requestBody/postIpv4FormatRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postIpv4FormatRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[Ipv4Format](../../components/schema/ipv4_format.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = ipv4_format.Ipv4Format(None) + try: + api_response = api_instance.post_ipv4_format_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_ipv4_format_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to FormatApi API]](../../apis/tags/format_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_ipv6_format_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_ipv6_format_request_body/post.md new file mode 100644 index 00000000000..b4c3ce386b3 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_ipv6_format_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_ipv6_format_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_ipv6_format_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_ipv6_format_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_ipv6_format_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_ipv6_format_request_body | [FormatApi](../../apis/tags/format_api.md) | This api is only for tag=format | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostIpv6FormatRequestBody | This api is only for path=/requestBody/postIpv6FormatRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postIpv6FormatRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[Ipv6Format](../../components/schema/ipv6_format.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = ipv6_format.Ipv6Format(None) + try: + api_response = api_instance.post_ipv6_format_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_ipv6_format_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to FormatApi API]](../../apis/tags/format_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_json_pointer_format_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_json_pointer_format_request_body/post.md new file mode 100644 index 00000000000..64f9ba5ccca --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_json_pointer_format_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_json_pointer_format_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_json_pointer_format_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_json_pointer_format_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_json_pointer_format_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_json_pointer_format_request_body | [FormatApi](../../apis/tags/format_api.md) | This api is only for tag=format | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostJsonPointerFormatRequestBody | This api is only for path=/requestBody/postJsonPointerFormatRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postJsonPointerFormatRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[JsonPointerFormat](../../components/schema/json_pointer_format.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = json_pointer_format.JsonPointerFormat(None) + try: + api_response = api_instance.post_json_pointer_format_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_json_pointer_format_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to FormatApi API]](../../apis/tags/format_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_maximum_validation_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_maximum_validation_request_body/post.md new file mode 100644 index 00000000000..911b29132e5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_maximum_validation_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_maximum_validation_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_maximum_validation_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_maximum_validation_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_maximum_validation_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_maximum_validation_request_body | [MaximumApi](../../apis/tags/maximum_api.md) | This api is only for tag=maximum | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostMaximumValidationRequestBody | This api is only for path=/requestBody/postMaximumValidationRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postMaximumValidationRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[MaximumValidation](../../components/schema/maximum_validation.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = maximum_validation.MaximumValidation(None) + try: + api_response = api_instance.post_maximum_validation_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_maximum_validation_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to MaximumApi API]](../../apis/tags/maximum_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post.md new file mode 100644 index 00000000000..e1806c507e7 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_maximum_validation_with_unsigned_integer_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_maximum_validation_with_unsigned_integer_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_maximum_validation_with_unsigned_integer_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_maximum_validation_with_unsigned_integer_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_maximum_validation_with_unsigned_integer_request_body | [MaximumApi](../../apis/tags/maximum_api.md) | This api is only for tag=maximum | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostMaximumValidationWithUnsignedIntegerRequestBody | This api is only for path=/requestBody/postMaximumValidationWithUnsignedIntegerRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postMaximumValidationWithUnsignedIntegerRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[MaximumValidationWithUnsignedInteger](../../components/schema/maximum_validation_with_unsigned_integer.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = maximum_validation_with_unsigned_integer.MaximumValidationWithUnsignedInteger(None) + try: + api_response = api_instance.post_maximum_validation_with_unsigned_integer_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_maximum_validation_with_unsigned_integer_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to MaximumApi API]](../../apis/tags/maximum_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_maxitems_validation_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_maxitems_validation_request_body/post.md new file mode 100644 index 00000000000..4924c5ac812 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_maxitems_validation_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_maxitems_validation_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_maxitems_validation_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_maxitems_validation_request_body | [MaxItemsApi](../../apis/tags/max_items_api.md) | This api is only for tag=maxItems | +| post_maxitems_validation_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_maxitems_validation_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostMaxitemsValidationRequestBody | This api is only for path=/requestBody/postMaxitemsValidationRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postMaxitemsValidationRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[MaxitemsValidation](../../components/schema/maxitems_validation.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = maxitems_validation.MaxitemsValidation(None) + try: + api_response = api_instance.post_maxitems_validation_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_maxitems_validation_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to MaxItemsApi API]](../../apis/tags/max_items_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_maxlength_validation_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_maxlength_validation_request_body/post.md new file mode 100644 index 00000000000..fbb1674a0b1 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_maxlength_validation_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_maxlength_validation_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_maxlength_validation_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_maxlength_validation_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_maxlength_validation_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_maxlength_validation_request_body | [MaxLengthApi](../../apis/tags/max_length_api.md) | This api is only for tag=maxLength | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostMaxlengthValidationRequestBody | This api is only for path=/requestBody/postMaxlengthValidationRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postMaxlengthValidationRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[MaxlengthValidation](../../components/schema/maxlength_validation.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = maxlength_validation.MaxlengthValidation(None) + try: + api_response = api_instance.post_maxlength_validation_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_maxlength_validation_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to MaxLengthApi API]](../../apis/tags/max_length_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post.md new file mode 100644 index 00000000000..066037f2884 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_maxproperties0_means_the_object_is_empty_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_maxproperties0_means_the_object_is_empty_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_maxproperties0_means_the_object_is_empty_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_maxproperties0_means_the_object_is_empty_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_maxproperties0_means_the_object_is_empty_request_body | [MaxPropertiesApi](../../apis/tags/max_properties_api.md) | This api is only for tag=maxProperties | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostMaxproperties0MeansTheObjectIsEmptyRequestBody | This api is only for path=/requestBody/postMaxproperties0MeansTheObjectIsEmptyRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postMaxproperties0MeansTheObjectIsEmptyRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[Maxproperties0MeansTheObjectIsEmpty](../../components/schema/maxproperties0_means_the_object_is_empty.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = maxproperties0_means_the_object_is_empty.Maxproperties0MeansTheObjectIsEmpty(None) + try: + api_response = api_instance.post_maxproperties0_means_the_object_is_empty_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_maxproperties0_means_the_object_is_empty_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to MaxPropertiesApi API]](../../apis/tags/max_properties_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_maxproperties_validation_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_maxproperties_validation_request_body/post.md new file mode 100644 index 00000000000..4aa1f11d0be --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_maxproperties_validation_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_maxproperties_validation_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_maxproperties_validation_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_maxproperties_validation_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_maxproperties_validation_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_maxproperties_validation_request_body | [MaxPropertiesApi](../../apis/tags/max_properties_api.md) | This api is only for tag=maxProperties | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostMaxpropertiesValidationRequestBody | This api is only for path=/requestBody/postMaxpropertiesValidationRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postMaxpropertiesValidationRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[MaxpropertiesValidation](../../components/schema/maxproperties_validation.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = maxproperties_validation.MaxpropertiesValidation(None) + try: + api_response = api_instance.post_maxproperties_validation_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_maxproperties_validation_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to MaxPropertiesApi API]](../../apis/tags/max_properties_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_minimum_validation_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_minimum_validation_request_body/post.md new file mode 100644 index 00000000000..7c5025704b9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_minimum_validation_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_minimum_validation_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_minimum_validation_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_minimum_validation_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_minimum_validation_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_minimum_validation_request_body | [MinimumApi](../../apis/tags/minimum_api.md) | This api is only for tag=minimum | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostMinimumValidationRequestBody | This api is only for path=/requestBody/postMinimumValidationRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postMinimumValidationRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[MinimumValidation](../../components/schema/minimum_validation.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = minimum_validation.MinimumValidation(None) + try: + api_response = api_instance.post_minimum_validation_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_minimum_validation_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to MinimumApi API]](../../apis/tags/minimum_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post.md new file mode 100644 index 00000000000..1b70467ca70 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_minimum_validation_with_signed_integer_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_minimum_validation_with_signed_integer_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_minimum_validation_with_signed_integer_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_minimum_validation_with_signed_integer_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_minimum_validation_with_signed_integer_request_body | [MinimumApi](../../apis/tags/minimum_api.md) | This api is only for tag=minimum | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostMinimumValidationWithSignedIntegerRequestBody | This api is only for path=/requestBody/postMinimumValidationWithSignedIntegerRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postMinimumValidationWithSignedIntegerRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[MinimumValidationWithSignedInteger](../../components/schema/minimum_validation_with_signed_integer.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = minimum_validation_with_signed_integer.MinimumValidationWithSignedInteger(None) + try: + api_response = api_instance.post_minimum_validation_with_signed_integer_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_minimum_validation_with_signed_integer_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to MinimumApi API]](../../apis/tags/minimum_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_minitems_validation_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_minitems_validation_request_body/post.md new file mode 100644 index 00000000000..9e78d6768d9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_minitems_validation_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_minitems_validation_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_minitems_validation_request_body | [MinItemsApi](../../apis/tags/min_items_api.md) | This api is only for tag=minItems | +| post_minitems_validation_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_minitems_validation_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_minitems_validation_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostMinitemsValidationRequestBody | This api is only for path=/requestBody/postMinitemsValidationRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postMinitemsValidationRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[MinitemsValidation](../../components/schema/minitems_validation.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import min_items_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = min_items_api.MinItemsApi(api_client) + + # example passing only required values which don't have defaults set + body = minitems_validation.MinitemsValidation(None) + try: + api_response = api_instance.post_minitems_validation_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling MinItemsApi->post_minitems_validation_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to MinItemsApi API]](../../apis/tags/min_items_api.md) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_minlength_validation_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_minlength_validation_request_body/post.md new file mode 100644 index 00000000000..ba39e2bd906 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_minlength_validation_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_minlength_validation_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_minlength_validation_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_minlength_validation_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_minlength_validation_request_body | [MinLengthApi](../../apis/tags/min_length_api.md) | This api is only for tag=minLength | +| post_minlength_validation_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostMinlengthValidationRequestBody | This api is only for path=/requestBody/postMinlengthValidationRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postMinlengthValidationRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[MinlengthValidation](../../components/schema/minlength_validation.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = minlength_validation.MinlengthValidation(None) + try: + api_response = api_instance.post_minlength_validation_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_minlength_validation_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to MinLengthApi API]](../../apis/tags/min_length_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_minproperties_validation_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_minproperties_validation_request_body/post.md new file mode 100644 index 00000000000..ee903caf28c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_minproperties_validation_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_minproperties_validation_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_minproperties_validation_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_minproperties_validation_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_minproperties_validation_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_minproperties_validation_request_body | [MinPropertiesApi](../../apis/tags/min_properties_api.md) | This api is only for tag=minProperties | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostMinpropertiesValidationRequestBody | This api is only for path=/requestBody/postMinpropertiesValidationRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postMinpropertiesValidationRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[MinpropertiesValidation](../../components/schema/minproperties_validation.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = minproperties_validation.MinpropertiesValidation(None) + try: + api_response = api_instance.post_minproperties_validation_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_minproperties_validation_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to MinPropertiesApi API]](../../apis/tags/min_properties_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post.md new file mode 100644 index 00000000000..c421472bdcb --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_nested_allof_to_check_validation_semantics_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_nested_allof_to_check_validation_semantics_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_nested_allof_to_check_validation_semantics_request_body | [AllOfApi](../../apis/tags/all_of_api.md) | This api is only for tag=allOf | +| post_nested_allof_to_check_validation_semantics_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_nested_allof_to_check_validation_semantics_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostNestedAllofToCheckValidationSemanticsRequestBody | This api is only for path=/requestBody/postNestedAllofToCheckValidationSemanticsRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postNestedAllofToCheckValidationSemanticsRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[NestedAllofToCheckValidationSemantics](../../components/schema/nested_allof_to_check_validation_semantics.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = nested_allof_to_check_validation_semantics.NestedAllofToCheckValidationSemantics(None) + try: + api_response = api_instance.post_nested_allof_to_check_validation_semantics_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_nested_allof_to_check_validation_semantics_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to AllOfApi API]](../../apis/tags/all_of_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post.md new file mode 100644 index 00000000000..320a27b2824 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_nested_anyof_to_check_validation_semantics_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_nested_anyof_to_check_validation_semantics_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_nested_anyof_to_check_validation_semantics_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_nested_anyof_to_check_validation_semantics_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_nested_anyof_to_check_validation_semantics_request_body | [AnyOfApi](../../apis/tags/any_of_api.md) | This api is only for tag=anyOf | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostNestedAnyofToCheckValidationSemanticsRequestBody | This api is only for path=/requestBody/postNestedAnyofToCheckValidationSemanticsRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postNestedAnyofToCheckValidationSemanticsRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[NestedAnyofToCheckValidationSemantics](../../components/schema/nested_anyof_to_check_validation_semantics.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = nested_anyof_to_check_validation_semantics.NestedAnyofToCheckValidationSemantics(None) + try: + api_response = api_instance.post_nested_anyof_to_check_validation_semantics_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_nested_anyof_to_check_validation_semantics_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to AnyOfApi API]](../../apis/tags/any_of_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_nested_items_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_nested_items_request_body/post.md new file mode 100644 index 00000000000..5143799edcd --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_nested_items_request_body/post.md @@ -0,0 +1,120 @@ +unit_test_api.paths.request_body_post_nested_items_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_nested_items_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_nested_items_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_nested_items_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_nested_items_request_body | [ItemsApi](../../apis/tags/items_api.md) | This api is only for tag=items | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostNestedItemsRequestBody | This api is only for path=/requestBody/postNestedItemsRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postNestedItemsRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), list, tuple] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[NestedItems](../../components/schema/nested_items.md) | list, tuple | tuple | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = nested_items.NestedItems([ + [ + [ + [ + 3.14 + ] + ] + ] + ]) + try: + api_response = api_instance.post_nested_items_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_nested_items_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to ItemsApi API]](../../apis/tags/items_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post.md new file mode 100644 index 00000000000..9e089074c96 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_nested_oneof_to_check_validation_semantics_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_nested_oneof_to_check_validation_semantics_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_nested_oneof_to_check_validation_semantics_request_body | [OneOfApi](../../apis/tags/one_of_api.md) | This api is only for tag=oneOf | +| post_nested_oneof_to_check_validation_semantics_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_nested_oneof_to_check_validation_semantics_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostNestedOneofToCheckValidationSemanticsRequestBody | This api is only for path=/requestBody/postNestedOneofToCheckValidationSemanticsRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postNestedOneofToCheckValidationSemanticsRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[NestedOneofToCheckValidationSemantics](../../components/schema/nested_oneof_to_check_validation_semantics.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = nested_oneof_to_check_validation_semantics.NestedOneofToCheckValidationSemantics(None) + try: + api_response = api_instance.post_nested_oneof_to_check_validation_semantics_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_nested_oneof_to_check_validation_semantics_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to OneOfApi API]](../../apis/tags/one_of_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_not_more_complex_schema_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_not_more_complex_schema_request_body/post.md new file mode 100644 index 00000000000..f2324d57ecf --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_not_more_complex_schema_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_not_more_complex_schema_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_not_more_complex_schema_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_not_more_complex_schema_request_body | [_NotApi](../../apis/tags/_not_api.md) | This api is only for tag=not | +| post_not_more_complex_schema_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_not_more_complex_schema_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostNotMoreComplexSchemaRequestBody | This api is only for path=/requestBody/postNotMoreComplexSchemaRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postNotMoreComplexSchemaRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[NotMoreComplexSchema](../../components/schema/not_more_complex_schema.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = not_more_complex_schema.NotMoreComplexSchema(None) + try: + api_response = api_instance.post_not_more_complex_schema_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_not_more_complex_schema_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to _NotApi API]](../../apis/tags/_not_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_not_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_not_request_body/post.md new file mode 100644 index 00000000000..451be22290f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_not_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_not_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_not_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_not_request_body | [_NotApi](../../apis/tags/_not_api.md) | This api is only for tag=not | +| post_not_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_not_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostNotRequestBody | This api is only for path=/requestBody/postNotRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postNotRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[_Not](../../components/schema/_not.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = _not._Not(None) + try: + api_response = api_instance.post_not_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_not_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to _NotApi API]](../../apis/tags/_not_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_nul_characters_in_strings_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_nul_characters_in_strings_request_body/post.md new file mode 100644 index 00000000000..af1e1ace3f7 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_nul_characters_in_strings_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_nul_characters_in_strings_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_nul_characters_in_strings_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_nul_characters_in_strings_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_nul_characters_in_strings_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_nul_characters_in_strings_request_body | [EnumApi](../../apis/tags/enum_api.md) | This api is only for tag=enum | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostNulCharactersInStringsRequestBody | This api is only for path=/requestBody/postNulCharactersInStringsRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postNulCharactersInStringsRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), str] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[NulCharactersInStrings](../../components/schema/nul_characters_in_strings.md) | str | str | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = nul_characters_in_strings.NulCharactersInStrings("hello\x00there") + try: + api_response = api_instance.post_nul_characters_in_strings_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_nul_characters_in_strings_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to EnumApi API]](../../apis/tags/enum_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post.md new file mode 100644 index 00000000000..7e7b1fb356c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_null_type_matches_only_the_null_object_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_null_type_matches_only_the_null_object_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_null_type_matches_only_the_null_object_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_null_type_matches_only_the_null_object_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_null_type_matches_only_the_null_object_request_body | [TypeApi](../../apis/tags/type_api.md) | This api is only for tag=type | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostNullTypeMatchesOnlyTheNullObjectRequestBody | This api is only for path=/requestBody/postNullTypeMatchesOnlyTheNullObjectRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postNullTypeMatchesOnlyTheNullObjectRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), None] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[NullTypeMatchesOnlyTheNullObject](../../components/schema/null_type_matches_only_the_null_object.md) | None | NoneClass | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = null_type_matches_only_the_null_object.NullTypeMatchesOnlyTheNullObject(None) + try: + api_response = api_instance.post_null_type_matches_only_the_null_object_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_null_type_matches_only_the_null_object_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to TypeApi API]](../../apis/tags/type_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_number_type_matches_numbers_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_number_type_matches_numbers_request_body/post.md new file mode 100644 index 00000000000..36d2d716b3f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_number_type_matches_numbers_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_number_type_matches_numbers_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_number_type_matches_numbers_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_number_type_matches_numbers_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_number_type_matches_numbers_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_number_type_matches_numbers_request_body | [TypeApi](../../apis/tags/type_api.md) | This api is only for tag=type | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostNumberTypeMatchesNumbersRequestBody | This api is only for path=/requestBody/postNumberTypeMatchesNumbersRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postNumberTypeMatchesNumbersRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), decimal.Decimal, int, float] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[NumberTypeMatchesNumbers](../../components/schema/number_type_matches_numbers.md) | decimal.Decimal, int, float | decimal.Decimal | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = number_type_matches_numbers.NumberTypeMatchesNumbers(3.14) + try: + api_response = api_instance.post_number_type_matches_numbers_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_number_type_matches_numbers_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to TypeApi API]](../../apis/tags/type_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_object_properties_validation_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_object_properties_validation_request_body/post.md new file mode 100644 index 00000000000..6f14d162294 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_object_properties_validation_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_object_properties_validation_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_object_properties_validation_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_object_properties_validation_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_object_properties_validation_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_object_properties_validation_request_body | [PropertiesApi](../../apis/tags/properties_api.md) | This api is only for tag=properties | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostObjectPropertiesValidationRequestBody | This api is only for path=/requestBody/postObjectPropertiesValidationRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postObjectPropertiesValidationRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[ObjectPropertiesValidation](../../components/schema/object_properties_validation.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = object_properties_validation.ObjectPropertiesValidation(None) + try: + api_response = api_instance.post_object_properties_validation_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_object_properties_validation_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to PropertiesApi API]](../../apis/tags/properties_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_object_type_matches_objects_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_object_type_matches_objects_request_body/post.md new file mode 100644 index 00000000000..0972255c574 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_object_type_matches_objects_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_object_type_matches_objects_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_object_type_matches_objects_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_object_type_matches_objects_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_object_type_matches_objects_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_object_type_matches_objects_request_body | [TypeApi](../../apis/tags/type_api.md) | This api is only for tag=type | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostObjectTypeMatchesObjectsRequestBody | This api is only for path=/requestBody/postObjectTypeMatchesObjectsRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postObjectTypeMatchesObjectsRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[ObjectTypeMatchesObjects](../../components/schema/object_type_matches_objects.md) | dict, frozendict.frozendict | frozendict.frozendict | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = object_type_matches_objects.ObjectTypeMatchesObjects() + try: + api_response = api_instance.post_object_type_matches_objects_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_object_type_matches_objects_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to TypeApi API]](../../apis/tags/type_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_oneof_complex_types_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_oneof_complex_types_request_body/post.md new file mode 100644 index 00000000000..9a6aef783c1 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_oneof_complex_types_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_oneof_complex_types_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_oneof_complex_types_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_oneof_complex_types_request_body | [OneOfApi](../../apis/tags/one_of_api.md) | This api is only for tag=oneOf | +| post_oneof_complex_types_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_oneof_complex_types_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostOneofComplexTypesRequestBody | This api is only for path=/requestBody/postOneofComplexTypesRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postOneofComplexTypesRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[OneofComplexTypes](../../components/schema/oneof_complex_types.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = oneof_complex_types.OneofComplexTypes(None) + try: + api_response = api_instance.post_oneof_complex_types_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_oneof_complex_types_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to OneOfApi API]](../../apis/tags/one_of_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_oneof_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_oneof_request_body/post.md new file mode 100644 index 00000000000..6755642c719 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_oneof_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_oneof_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_oneof_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_oneof_request_body | [OneOfApi](../../apis/tags/one_of_api.md) | This api is only for tag=oneOf | +| post_oneof_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_oneof_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostOneofRequestBody | This api is only for path=/requestBody/postOneofRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postOneofRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[Oneof](../../components/schema/oneof.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = oneof.Oneof(None) + try: + api_response = api_instance.post_oneof_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_oneof_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to OneOfApi API]](../../apis/tags/one_of_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_oneof_with_base_schema_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_oneof_with_base_schema_request_body/post.md new file mode 100644 index 00000000000..967adb1d065 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_oneof_with_base_schema_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_oneof_with_base_schema_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_oneof_with_base_schema_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_oneof_with_base_schema_request_body | [OneOfApi](../../apis/tags/one_of_api.md) | This api is only for tag=oneOf | +| post_oneof_with_base_schema_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_oneof_with_base_schema_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostOneofWithBaseSchemaRequestBody | This api is only for path=/requestBody/postOneofWithBaseSchemaRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postOneofWithBaseSchemaRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), str] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[OneofWithBaseSchema](../../components/schema/oneof_with_base_schema.md) | str | str | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = oneof_with_base_schema.OneofWithBaseSchema("string_example") + try: + api_response = api_instance.post_oneof_with_base_schema_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_oneof_with_base_schema_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to OneOfApi API]](../../apis/tags/one_of_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_oneof_with_empty_schema_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_oneof_with_empty_schema_request_body/post.md new file mode 100644 index 00000000000..e80bfa4dc33 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_oneof_with_empty_schema_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_oneof_with_empty_schema_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_oneof_with_empty_schema_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_oneof_with_empty_schema_request_body | [OneOfApi](../../apis/tags/one_of_api.md) | This api is only for tag=oneOf | +| post_oneof_with_empty_schema_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_oneof_with_empty_schema_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostOneofWithEmptySchemaRequestBody | This api is only for path=/requestBody/postOneofWithEmptySchemaRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postOneofWithEmptySchemaRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[OneofWithEmptySchema](../../components/schema/oneof_with_empty_schema.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = oneof_with_empty_schema.OneofWithEmptySchema(None) + try: + api_response = api_instance.post_oneof_with_empty_schema_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_oneof_with_empty_schema_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to OneOfApi API]](../../apis/tags/one_of_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_oneof_with_required_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_oneof_with_required_request_body/post.md new file mode 100644 index 00000000000..9ebdc8bef5d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_oneof_with_required_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_oneof_with_required_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_oneof_with_required_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_oneof_with_required_request_body | [OneOfApi](../../apis/tags/one_of_api.md) | This api is only for tag=oneOf | +| post_oneof_with_required_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_oneof_with_required_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostOneofWithRequiredRequestBody | This api is only for path=/requestBody/postOneofWithRequiredRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postOneofWithRequiredRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[OneofWithRequired](../../components/schema/oneof_with_required.md) | dict, frozendict.frozendict | frozendict.frozendict | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = oneof_with_required.OneofWithRequired() + try: + api_response = api_instance.post_oneof_with_required_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_oneof_with_required_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to OneOfApi API]](../../apis/tags/one_of_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_pattern_is_not_anchored_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_pattern_is_not_anchored_request_body/post.md new file mode 100644 index 00000000000..5166ab70e5d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_pattern_is_not_anchored_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_pattern_is_not_anchored_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_pattern_is_not_anchored_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_pattern_is_not_anchored_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_pattern_is_not_anchored_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_pattern_is_not_anchored_request_body | [PatternApi](../../apis/tags/pattern_api.md) | This api is only for tag=pattern | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostPatternIsNotAnchoredRequestBody | This api is only for path=/requestBody/postPatternIsNotAnchoredRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postPatternIsNotAnchoredRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[PatternIsNotAnchored](../../components/schema/pattern_is_not_anchored.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = pattern_is_not_anchored.PatternIsNotAnchored(None) + try: + api_response = api_instance.post_pattern_is_not_anchored_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_pattern_is_not_anchored_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to PatternApi API]](../../apis/tags/pattern_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_pattern_validation_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_pattern_validation_request_body/post.md new file mode 100644 index 00000000000..200d193dd33 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_pattern_validation_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_pattern_validation_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_pattern_validation_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_pattern_validation_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_pattern_validation_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_pattern_validation_request_body | [PatternApi](../../apis/tags/pattern_api.md) | This api is only for tag=pattern | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostPatternValidationRequestBody | This api is only for path=/requestBody/postPatternValidationRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postPatternValidationRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[PatternValidation](../../components/schema/pattern_validation.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = pattern_validation.PatternValidation(None) + try: + api_response = api_instance.post_pattern_validation_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_pattern_validation_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to PatternApi API]](../../apis/tags/pattern_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_properties_with_escaped_characters_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_properties_with_escaped_characters_request_body/post.md new file mode 100644 index 00000000000..e2b084b6e52 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_properties_with_escaped_characters_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_properties_with_escaped_characters_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_properties_with_escaped_characters_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_properties_with_escaped_characters_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_properties_with_escaped_characters_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_properties_with_escaped_characters_request_body | [PropertiesApi](../../apis/tags/properties_api.md) | This api is only for tag=properties | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostPropertiesWithEscapedCharactersRequestBody | This api is only for path=/requestBody/postPropertiesWithEscapedCharactersRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postPropertiesWithEscapedCharactersRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[PropertiesWithEscapedCharacters](../../components/schema/properties_with_escaped_characters.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = properties_with_escaped_characters.PropertiesWithEscapedCharacters(None) + try: + api_response = api_instance.post_properties_with_escaped_characters_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_properties_with_escaped_characters_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to PropertiesApi API]](../../apis/tags/properties_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post.md new file mode 100644 index 00000000000..efd01108017 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_property_named_ref_that_is_not_a_reference_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_property_named_ref_that_is_not_a_reference_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_property_named_ref_that_is_not_a_reference_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_property_named_ref_that_is_not_a_reference_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_property_named_ref_that_is_not_a_reference_request_body | [RefApi](../../apis/tags/ref_api.md) | This api is only for tag=$ref | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostPropertyNamedRefThatIsNotAReferenceRequestBody | This api is only for path=/requestBody/postPropertyNamedRefThatIsNotAReferenceRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postPropertyNamedRefThatIsNotAReferenceRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[PropertyNamedRefThatIsNotAReference](../../components/schema/property_named_ref_that_is_not_a_reference.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = property_named_ref_that_is_not_a_reference.PropertyNamedRefThatIsNotAReference(None) + try: + api_response = api_instance.post_property_named_ref_that_is_not_a_reference_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_property_named_ref_that_is_not_a_reference_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to RefApi API]](../../apis/tags/ref_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_ref_in_additionalproperties_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_ref_in_additionalproperties_request_body/post.md new file mode 100644 index 00000000000..85c64883098 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_ref_in_additionalproperties_request_body/post.md @@ -0,0 +1,114 @@ +unit_test_api.paths.request_body_post_ref_in_additionalproperties_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_ref_in_additionalproperties_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_ref_in_additionalproperties_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_ref_in_additionalproperties_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_ref_in_additionalproperties_request_body | [RefApi](../../apis/tags/ref_api.md) | This api is only for tag=$ref | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostRefInAdditionalpropertiesRequestBody | This api is only for path=/requestBody/postRefInAdditionalpropertiesRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postRefInAdditionalpropertiesRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[RefInAdditionalproperties](../../components/schema/ref_in_additionalproperties.md) | dict, frozendict.frozendict | frozendict.frozendict | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = ref_in_additionalproperties.RefInAdditionalproperties( + key=property_named_ref_that_is_not_a_reference.PropertyNamedRefThatIsNotAReference(None), + ) + try: + api_response = api_instance.post_ref_in_additionalproperties_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_ref_in_additionalproperties_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to RefApi API]](../../apis/tags/ref_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_ref_in_allof_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_ref_in_allof_request_body/post.md new file mode 100644 index 00000000000..cf55f0c363e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_ref_in_allof_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_ref_in_allof_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_ref_in_allof_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_ref_in_allof_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_ref_in_allof_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_ref_in_allof_request_body | [RefApi](../../apis/tags/ref_api.md) | This api is only for tag=$ref | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostRefInAllofRequestBody | This api is only for path=/requestBody/postRefInAllofRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postRefInAllofRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[RefInAllof](../../components/schema/ref_in_allof.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = ref_in_allof.RefInAllof(None) + try: + api_response = api_instance.post_ref_in_allof_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_ref_in_allof_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to RefApi API]](../../apis/tags/ref_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_ref_in_anyof_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_ref_in_anyof_request_body/post.md new file mode 100644 index 00000000000..2e9ea6e6fb8 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_ref_in_anyof_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_ref_in_anyof_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_ref_in_anyof_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_ref_in_anyof_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_ref_in_anyof_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_ref_in_anyof_request_body | [RefApi](../../apis/tags/ref_api.md) | This api is only for tag=$ref | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostRefInAnyofRequestBody | This api is only for path=/requestBody/postRefInAnyofRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postRefInAnyofRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[RefInAnyof](../../components/schema/ref_in_anyof.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = ref_in_anyof.RefInAnyof(None) + try: + api_response = api_instance.post_ref_in_anyof_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_ref_in_anyof_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to RefApi API]](../../apis/tags/ref_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_ref_in_items_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_ref_in_items_request_body/post.md new file mode 100644 index 00000000000..bc75bc2675c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_ref_in_items_request_body/post.md @@ -0,0 +1,114 @@ +unit_test_api.paths.request_body_post_ref_in_items_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_ref_in_items_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_ref_in_items_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_ref_in_items_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_ref_in_items_request_body | [RefApi](../../apis/tags/ref_api.md) | This api is only for tag=$ref | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostRefInItemsRequestBody | This api is only for path=/requestBody/postRefInItemsRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postRefInItemsRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), list, tuple] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[RefInItems](../../components/schema/ref_in_items.md) | list, tuple | tuple | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = ref_in_items.RefInItems([ + property_named_ref_that_is_not_a_reference.PropertyNamedRefThatIsNotAReference(None) + ]) + try: + api_response = api_instance.post_ref_in_items_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_ref_in_items_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to RefApi API]](../../apis/tags/ref_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_ref_in_not_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_ref_in_not_request_body/post.md new file mode 100644 index 00000000000..f35b696eb28 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_ref_in_not_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_ref_in_not_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_ref_in_not_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_ref_in_not_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_ref_in_not_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_ref_in_not_request_body | [RefApi](../../apis/tags/ref_api.md) | This api is only for tag=$ref | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostRefInNotRequestBody | This api is only for path=/requestBody/postRefInNotRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postRefInNotRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[RefInNot](../../components/schema/ref_in_not.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = ref_in_not.RefInNot(None) + try: + api_response = api_instance.post_ref_in_not_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_ref_in_not_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to RefApi API]](../../apis/tags/ref_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_ref_in_oneof_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_ref_in_oneof_request_body/post.md new file mode 100644 index 00000000000..9b8e8ed9012 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_ref_in_oneof_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_ref_in_oneof_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_ref_in_oneof_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_ref_in_oneof_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_ref_in_oneof_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_ref_in_oneof_request_body | [RefApi](../../apis/tags/ref_api.md) | This api is only for tag=$ref | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostRefInOneofRequestBody | This api is only for path=/requestBody/postRefInOneofRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postRefInOneofRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[RefInOneof](../../components/schema/ref_in_oneof.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = ref_in_oneof.RefInOneof(None) + try: + api_response = api_instance.post_ref_in_oneof_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_ref_in_oneof_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to RefApi API]](../../apis/tags/ref_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_ref_in_property_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_ref_in_property_request_body/post.md new file mode 100644 index 00000000000..d503b1532e7 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_ref_in_property_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_ref_in_property_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_ref_in_property_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_ref_in_property_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_ref_in_property_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_ref_in_property_request_body | [RefApi](../../apis/tags/ref_api.md) | This api is only for tag=$ref | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostRefInPropertyRequestBody | This api is only for path=/requestBody/postRefInPropertyRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postRefInPropertyRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[RefInProperty](../../components/schema/ref_in_property.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = ref_in_property.RefInProperty(None) + try: + api_response = api_instance.post_ref_in_property_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_ref_in_property_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to RefApi API]](../../apis/tags/ref_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_required_default_validation_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_required_default_validation_request_body/post.md new file mode 100644 index 00000000000..956331c783e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_required_default_validation_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_required_default_validation_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_required_default_validation_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_required_default_validation_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_required_default_validation_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_required_default_validation_request_body | [RequiredApi](../../apis/tags/required_api.md) | This api is only for tag=required | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostRequiredDefaultValidationRequestBody | This api is only for path=/requestBody/postRequiredDefaultValidationRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postRequiredDefaultValidationRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[RequiredDefaultValidation](../../components/schema/required_default_validation.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = required_default_validation.RequiredDefaultValidation(None) + try: + api_response = api_instance.post_required_default_validation_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_required_default_validation_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to RequiredApi API]](../../apis/tags/required_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_required_validation_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_required_validation_request_body/post.md new file mode 100644 index 00000000000..00adaef9793 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_required_validation_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_required_validation_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_required_validation_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_required_validation_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_required_validation_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_required_validation_request_body | [RequiredApi](../../apis/tags/required_api.md) | This api is only for tag=required | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostRequiredValidationRequestBody | This api is only for path=/requestBody/postRequiredValidationRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postRequiredValidationRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[RequiredValidation](../../components/schema/required_validation.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = required_validation.RequiredValidation(None) + try: + api_response = api_instance.post_required_validation_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_required_validation_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to RequiredApi API]](../../apis/tags/required_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_required_with_empty_array_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_required_with_empty_array_request_body/post.md new file mode 100644 index 00000000000..eb221c60e23 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_required_with_empty_array_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_required_with_empty_array_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_required_with_empty_array_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_required_with_empty_array_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_required_with_empty_array_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_required_with_empty_array_request_body | [RequiredApi](../../apis/tags/required_api.md) | This api is only for tag=required | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostRequiredWithEmptyArrayRequestBody | This api is only for path=/requestBody/postRequiredWithEmptyArrayRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postRequiredWithEmptyArrayRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[RequiredWithEmptyArray](../../components/schema/required_with_empty_array.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = required_with_empty_array.RequiredWithEmptyArray(None) + try: + api_response = api_instance.post_required_with_empty_array_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_required_with_empty_array_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to RequiredApi API]](../../apis/tags/required_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_required_with_escaped_characters_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_required_with_escaped_characters_request_body/post.md new file mode 100644 index 00000000000..6f18d086f26 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_required_with_escaped_characters_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_required_with_escaped_characters_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_required_with_escaped_characters_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_required_with_escaped_characters_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_required_with_escaped_characters_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_required_with_escaped_characters_request_body | [RequiredApi](../../apis/tags/required_api.md) | This api is only for tag=required | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostRequiredWithEscapedCharactersRequestBody | This api is only for path=/requestBody/postRequiredWithEscapedCharactersRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postRequiredWithEscapedCharactersRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[RequiredWithEscapedCharacters](../../components/schema/required_with_escaped_characters.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = required_with_escaped_characters.RequiredWithEscapedCharacters(None) + try: + api_response = api_instance.post_required_with_escaped_characters_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_required_with_escaped_characters_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to RequiredApi API]](../../apis/tags/required_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_simple_enum_validation_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_simple_enum_validation_request_body/post.md new file mode 100644 index 00000000000..26c2345e8d3 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_simple_enum_validation_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_simple_enum_validation_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_simple_enum_validation_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_simple_enum_validation_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_simple_enum_validation_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_simple_enum_validation_request_body | [EnumApi](../../apis/tags/enum_api.md) | This api is only for tag=enum | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostSimpleEnumValidationRequestBody | This api is only for path=/requestBody/postSimpleEnumValidationRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postSimpleEnumValidationRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), decimal.Decimal, int, float] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[SimpleEnumValidation](../../components/schema/simple_enum_validation.md) | decimal.Decimal, int, float | decimal.Decimal | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = simple_enum_validation.SimpleEnumValidation(1) + try: + api_response = api_instance.post_simple_enum_validation_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_simple_enum_validation_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to EnumApi API]](../../apis/tags/enum_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_string_type_matches_strings_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_string_type_matches_strings_request_body/post.md new file mode 100644 index 00000000000..a99a0560cae --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_string_type_matches_strings_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_string_type_matches_strings_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_string_type_matches_strings_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_string_type_matches_strings_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_string_type_matches_strings_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_string_type_matches_strings_request_body | [TypeApi](../../apis/tags/type_api.md) | This api is only for tag=type | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostStringTypeMatchesStringsRequestBody | This api is only for path=/requestBody/postStringTypeMatchesStringsRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postStringTypeMatchesStringsRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), str] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[StringTypeMatchesStrings](../../components/schema/string_type_matches_strings.md) | str | str | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = string_type_matches_strings.StringTypeMatchesStrings("string_example") + try: + api_response = api_instance.post_string_type_matches_strings_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_string_type_matches_strings_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to TypeApi API]](../../apis/tags/type_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post.md new file mode 100644 index 00000000000..b767cf1146b --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post.md @@ -0,0 +1,114 @@ +unit_test_api.paths.request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body | [DefaultApi](../../apis/tags/default_api.md) | This api is only for tag=default | +| post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody | This api is only for path=/requestBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing](../../components/schema/the_default_keyword_does_not_do_anything_if_the_property_is_missing.md) | dict, frozendict.frozendict | frozendict.frozendict | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = the_default_keyword_does_not_do_anything_if_the_property_is_missing.TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing( + alpha=5, + ) + try: + api_response = api_instance.post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to DefaultApi API]](../../apis/tags/default_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_uniqueitems_false_validation_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_uniqueitems_false_validation_request_body/post.md new file mode 100644 index 00000000000..c09c9ee533b --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_uniqueitems_false_validation_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_uniqueitems_false_validation_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_uniqueitems_false_validation_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_uniqueitems_false_validation_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_uniqueitems_false_validation_request_body | [UniqueItemsApi](../../apis/tags/unique_items_api.md) | This api is only for tag=uniqueItems | +| post_uniqueitems_false_validation_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostUniqueitemsFalseValidationRequestBody | This api is only for path=/requestBody/postUniqueitemsFalseValidationRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postUniqueitemsFalseValidationRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[UniqueitemsFalseValidation](../../components/schema/uniqueitems_false_validation.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = uniqueitems_false_validation.UniqueitemsFalseValidation(None) + try: + api_response = api_instance.post_uniqueitems_false_validation_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_uniqueitems_false_validation_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to UniqueItemsApi API]](../../apis/tags/unique_items_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_uniqueitems_validation_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_uniqueitems_validation_request_body/post.md new file mode 100644 index 00000000000..3a56f8cb938 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_uniqueitems_validation_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_uniqueitems_validation_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_uniqueitems_validation_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_uniqueitems_validation_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_uniqueitems_validation_request_body | [UniqueItemsApi](../../apis/tags/unique_items_api.md) | This api is only for tag=uniqueItems | +| post_uniqueitems_validation_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostUniqueitemsValidationRequestBody | This api is only for path=/requestBody/postUniqueitemsValidationRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postUniqueitemsValidationRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[UniqueitemsValidation](../../components/schema/uniqueitems_validation.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = uniqueitems_validation.UniqueitemsValidation(None) + try: + api_response = api_instance.post_uniqueitems_validation_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_uniqueitems_validation_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to UniqueItemsApi API]](../../apis/tags/unique_items_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_uri_format_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_uri_format_request_body/post.md new file mode 100644 index 00000000000..c855d1f26f6 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_uri_format_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_uri_format_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_uri_format_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_uri_format_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_uri_format_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_uri_format_request_body | [FormatApi](../../apis/tags/format_api.md) | This api is only for tag=format | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostUriFormatRequestBody | This api is only for path=/requestBody/postUriFormatRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postUriFormatRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[UriFormat](../../components/schema/uri_format.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = uri_format.UriFormat(None) + try: + api_response = api_instance.post_uri_format_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_uri_format_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to FormatApi API]](../../apis/tags/format_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_uri_reference_format_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_uri_reference_format_request_body/post.md new file mode 100644 index 00000000000..476323a0822 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_uri_reference_format_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_uri_reference_format_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_uri_reference_format_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_uri_reference_format_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_uri_reference_format_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_uri_reference_format_request_body | [FormatApi](../../apis/tags/format_api.md) | This api is only for tag=format | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostUriReferenceFormatRequestBody | This api is only for path=/requestBody/postUriReferenceFormatRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postUriReferenceFormatRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[UriReferenceFormat](../../components/schema/uri_reference_format.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = uri_reference_format.UriReferenceFormat(None) + try: + api_response = api_instance.post_uri_reference_format_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_uri_reference_format_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to FormatApi API]](../../apis/tags/format_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_uri_template_format_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_uri_template_format_request_body/post.md new file mode 100644 index 00000000000..f3371266c38 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_uri_template_format_request_body/post.md @@ -0,0 +1,112 @@ +unit_test_api.paths.request_body_post_uri_template_format_request_body.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_uri_template_format_request_body | [OperationRequestBodyApi](../../apis/tags/operation_request_body_api.md) | This api is only for tag=operation.requestBody | +| post_uri_template_format_request_body | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_uri_template_format_request_body | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_uri_template_format_request_body | [FormatApi](../../apis/tags/format_api.md) | This api is only for tag=format | +| post | ApiForPost | This api is only for this endpoint | +| post | RequestBodyPostUriTemplateFormatRequestBody | This api is only for path=/requestBody/postUriTemplateFormatRequestBody | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/requestBody/postUriTemplateFormatRequestBody" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[UriTemplateFormat](../../components/schema/uri_template_format.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import operation_request_body_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = uri_template_format.UriTemplateFormat(None) + try: + api_response = api_instance.post_uri_template_format_request_body( + body=body, + ) + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OperationRequestBodyApi->post_uri_template_format_request_body: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OperationRequestBodyApi API]](../../apis/tags/operation_request_body_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to FormatApi API]](../../apis/tags/format_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post.md new file mode 100644 index 00000000000..ead30777d51 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types | [AdditionalPropertiesApi](../../apis/tags/additional_properties_api.md) | This api is only for tag=additionalProperties | +| post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostAdditionalpropertiesAllowsASchemaWhichShouldValidateResponseBodyForContentTypes | This api is only for path=/responseBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[AdditionalpropertiesAllowsASchemaWhichShouldValidate](../../components/schema/additionalproperties_allows_a_schema_which_should_validate.md) | dict, frozendict.frozendict | frozendict.frozendict | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import path_post_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = path_post_api.PathPostApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling PathPostApi->post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to AdditionalPropertiesApi API]](../../apis/tags/additional_properties_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post.md new file mode 100644 index 00000000000..88a0c33d874 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_additionalproperties_are_allowed_by_default_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_additionalproperties_are_allowed_by_default_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_additionalproperties_are_allowed_by_default_response_body_for_content_types | [AdditionalPropertiesApi](../../apis/tags/additional_properties_api.md) | This api is only for tag=additionalProperties | +| post_additionalproperties_are_allowed_by_default_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostAdditionalpropertiesAreAllowedByDefaultResponseBodyForContentTypes | This api is only for path=/responseBody/postAdditionalpropertiesAreAllowedByDefaultResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postAdditionalpropertiesAreAllowedByDefaultResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[AdditionalpropertiesAreAllowedByDefault](../../components/schema/additionalproperties_are_allowed_by_default.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import path_post_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = path_post_api.PathPostApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_additionalproperties_are_allowed_by_default_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling PathPostApi->post_additionalproperties_are_allowed_by_default_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to AdditionalPropertiesApi API]](../../apis/tags/additional_properties_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post.md new file mode 100644 index 00000000000..dd6432d1c27 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_additionalproperties_can_exist_by_itself_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_additionalproperties_can_exist_by_itself_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_additionalproperties_can_exist_by_itself_response_body_for_content_types | [AdditionalPropertiesApi](../../apis/tags/additional_properties_api.md) | This api is only for tag=additionalProperties | +| post_additionalproperties_can_exist_by_itself_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostAdditionalpropertiesCanExistByItselfResponseBodyForContentTypes | This api is only for path=/responseBody/postAdditionalpropertiesCanExistByItselfResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postAdditionalpropertiesCanExistByItselfResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[AdditionalpropertiesCanExistByItself](../../components/schema/additionalproperties_can_exist_by_itself.md) | dict, frozendict.frozendict | frozendict.frozendict | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import path_post_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = path_post_api.PathPostApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_additionalproperties_can_exist_by_itself_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling PathPostApi->post_additionalproperties_can_exist_by_itself_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to AdditionalPropertiesApi API]](../../apis/tags/additional_properties_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post.md new file mode 100644 index 00000000000..a029c51a095 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types | [AdditionalPropertiesApi](../../apis/tags/additional_properties_api.md) | This api is only for tag=additionalProperties | +| post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostAdditionalpropertiesShouldNotLookInApplicatorsResponseBodyForContentTypes | This api is only for path=/responseBody/postAdditionalpropertiesShouldNotLookInApplicatorsResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postAdditionalpropertiesShouldNotLookInApplicatorsResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[AdditionalpropertiesShouldNotLookInApplicators](../../components/schema/additionalproperties_should_not_look_in_applicators.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import path_post_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = path_post_api.PathPostApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling PathPostApi->post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to AdditionalPropertiesApi API]](../../apis/tags/additional_properties_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post.md new file mode 100644 index 00000000000..d6c8de85370 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_allof_combined_with_anyof_oneof_response_body_for_content_types | [AllOfApi](../../apis/tags/all_of_api.md) | This api is only for tag=allOf | +| post_allof_combined_with_anyof_oneof_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_allof_combined_with_anyof_oneof_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_allof_combined_with_anyof_oneof_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostAllofCombinedWithAnyofOneofResponseBodyForContentTypes | This api is only for path=/responseBody/postAllofCombinedWithAnyofOneofResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postAllofCombinedWithAnyofOneofResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[AllofCombinedWithAnyofOneof](../../components/schema/allof_combined_with_anyof_oneof.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import all_of_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = all_of_api.AllOfApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_allof_combined_with_anyof_oneof_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling AllOfApi->post_allof_combined_with_anyof_oneof_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to AllOfApi API]](../../apis/tags/all_of_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_allof_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_allof_response_body_for_content_types/post.md new file mode 100644 index 00000000000..dd148e48816 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_allof_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_allof_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_allof_response_body_for_content_types | [AllOfApi](../../apis/tags/all_of_api.md) | This api is only for tag=allOf | +| post_allof_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_allof_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_allof_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostAllofResponseBodyForContentTypes | This api is only for path=/responseBody/postAllofResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postAllofResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[Allof](../../components/schema/allof.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import all_of_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = all_of_api.AllOfApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_allof_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling AllOfApi->post_allof_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to AllOfApi API]](../../apis/tags/all_of_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_allof_simple_types_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_allof_simple_types_response_body_for_content_types/post.md new file mode 100644 index 00000000000..ab27c118e56 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_allof_simple_types_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_allof_simple_types_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_allof_simple_types_response_body_for_content_types | [AllOfApi](../../apis/tags/all_of_api.md) | This api is only for tag=allOf | +| post_allof_simple_types_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_allof_simple_types_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_allof_simple_types_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostAllofSimpleTypesResponseBodyForContentTypes | This api is only for path=/responseBody/postAllofSimpleTypesResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postAllofSimpleTypesResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[AllofSimpleTypes](../../components/schema/allof_simple_types.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import all_of_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = all_of_api.AllOfApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_allof_simple_types_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling AllOfApi->post_allof_simple_types_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to AllOfApi API]](../../apis/tags/all_of_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post.md new file mode 100644 index 00000000000..53bce21ad43 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_allof_with_base_schema_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_allof_with_base_schema_response_body_for_content_types | [AllOfApi](../../apis/tags/all_of_api.md) | This api is only for tag=allOf | +| post_allof_with_base_schema_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_allof_with_base_schema_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_allof_with_base_schema_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostAllofWithBaseSchemaResponseBodyForContentTypes | This api is only for path=/responseBody/postAllofWithBaseSchemaResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postAllofWithBaseSchemaResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[AllofWithBaseSchema](../../components/schema/allof_with_base_schema.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import all_of_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = all_of_api.AllOfApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_allof_with_base_schema_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling AllOfApi->post_allof_with_base_schema_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to AllOfApi API]](../../apis/tags/all_of_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post.md new file mode 100644 index 00000000000..02170dccdc9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_allof_with_one_empty_schema_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_allof_with_one_empty_schema_response_body_for_content_types | [AllOfApi](../../apis/tags/all_of_api.md) | This api is only for tag=allOf | +| post_allof_with_one_empty_schema_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_allof_with_one_empty_schema_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_allof_with_one_empty_schema_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostAllofWithOneEmptySchemaResponseBodyForContentTypes | This api is only for path=/responseBody/postAllofWithOneEmptySchemaResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postAllofWithOneEmptySchemaResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[AllofWithOneEmptySchema](../../components/schema/allof_with_one_empty_schema.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import all_of_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = all_of_api.AllOfApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_allof_with_one_empty_schema_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling AllOfApi->post_allof_with_one_empty_schema_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to AllOfApi API]](../../apis/tags/all_of_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post.md new file mode 100644 index 00000000000..bf05b52c4fc --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_allof_with_the_first_empty_schema_response_body_for_content_types | [AllOfApi](../../apis/tags/all_of_api.md) | This api is only for tag=allOf | +| post_allof_with_the_first_empty_schema_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_allof_with_the_first_empty_schema_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_allof_with_the_first_empty_schema_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostAllofWithTheFirstEmptySchemaResponseBodyForContentTypes | This api is only for path=/responseBody/postAllofWithTheFirstEmptySchemaResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postAllofWithTheFirstEmptySchemaResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[AllofWithTheFirstEmptySchema](../../components/schema/allof_with_the_first_empty_schema.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import all_of_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = all_of_api.AllOfApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_allof_with_the_first_empty_schema_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling AllOfApi->post_allof_with_the_first_empty_schema_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to AllOfApi API]](../../apis/tags/all_of_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post.md new file mode 100644 index 00000000000..6deda618e6b --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_allof_with_the_last_empty_schema_response_body_for_content_types | [AllOfApi](../../apis/tags/all_of_api.md) | This api is only for tag=allOf | +| post_allof_with_the_last_empty_schema_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_allof_with_the_last_empty_schema_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_allof_with_the_last_empty_schema_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostAllofWithTheLastEmptySchemaResponseBodyForContentTypes | This api is only for path=/responseBody/postAllofWithTheLastEmptySchemaResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postAllofWithTheLastEmptySchemaResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[AllofWithTheLastEmptySchema](../../components/schema/allof_with_the_last_empty_schema.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import all_of_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = all_of_api.AllOfApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_allof_with_the_last_empty_schema_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling AllOfApi->post_allof_with_the_last_empty_schema_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to AllOfApi API]](../../apis/tags/all_of_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post.md new file mode 100644 index 00000000000..3128db1cc81 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_allof_with_two_empty_schemas_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_allof_with_two_empty_schemas_response_body_for_content_types | [AllOfApi](../../apis/tags/all_of_api.md) | This api is only for tag=allOf | +| post_allof_with_two_empty_schemas_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_allof_with_two_empty_schemas_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_allof_with_two_empty_schemas_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostAllofWithTwoEmptySchemasResponseBodyForContentTypes | This api is only for path=/responseBody/postAllofWithTwoEmptySchemasResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postAllofWithTwoEmptySchemasResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[AllofWithTwoEmptySchemas](../../components/schema/allof_with_two_empty_schemas.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import all_of_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = all_of_api.AllOfApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_allof_with_two_empty_schemas_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling AllOfApi->post_allof_with_two_empty_schemas_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to AllOfApi API]](../../apis/tags/all_of_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post.md new file mode 100644 index 00000000000..bdb4c013d92 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_anyof_complex_types_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_anyof_complex_types_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_anyof_complex_types_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_anyof_complex_types_response_body_for_content_types | [AnyOfApi](../../apis/tags/any_of_api.md) | This api is only for tag=anyOf | +| post_anyof_complex_types_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostAnyofComplexTypesResponseBodyForContentTypes | This api is only for path=/responseBody/postAnyofComplexTypesResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postAnyofComplexTypesResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[AnyofComplexTypes](../../components/schema/anyof_complex_types.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import path_post_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = path_post_api.PathPostApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_anyof_complex_types_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling PathPostApi->post_anyof_complex_types_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to AnyOfApi API]](../../apis/tags/any_of_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_anyof_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_anyof_response_body_for_content_types/post.md new file mode 100644 index 00000000000..65347e563d6 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_anyof_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_anyof_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_anyof_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_anyof_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_anyof_response_body_for_content_types | [AnyOfApi](../../apis/tags/any_of_api.md) | This api is only for tag=anyOf | +| post_anyof_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostAnyofResponseBodyForContentTypes | This api is only for path=/responseBody/postAnyofResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postAnyofResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[Anyof](../../components/schema/anyof.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import path_post_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = path_post_api.PathPostApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_anyof_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling PathPostApi->post_anyof_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to AnyOfApi API]](../../apis/tags/any_of_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post.md new file mode 100644 index 00000000000..f83f7b0cd7e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_anyof_with_base_schema_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_anyof_with_base_schema_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_anyof_with_base_schema_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_anyof_with_base_schema_response_body_for_content_types | [AnyOfApi](../../apis/tags/any_of_api.md) | This api is only for tag=anyOf | +| post_anyof_with_base_schema_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostAnyofWithBaseSchemaResponseBodyForContentTypes | This api is only for path=/responseBody/postAnyofWithBaseSchemaResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postAnyofWithBaseSchemaResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[AnyofWithBaseSchema](../../components/schema/anyof_with_base_schema.md) | str | str | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import path_post_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = path_post_api.PathPostApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_anyof_with_base_schema_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling PathPostApi->post_anyof_with_base_schema_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to AnyOfApi API]](../../apis/tags/any_of_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post.md new file mode 100644 index 00000000000..59de3997f1e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_anyof_with_one_empty_schema_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_anyof_with_one_empty_schema_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_anyof_with_one_empty_schema_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_anyof_with_one_empty_schema_response_body_for_content_types | [AnyOfApi](../../apis/tags/any_of_api.md) | This api is only for tag=anyOf | +| post_anyof_with_one_empty_schema_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostAnyofWithOneEmptySchemaResponseBodyForContentTypes | This api is only for path=/responseBody/postAnyofWithOneEmptySchemaResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postAnyofWithOneEmptySchemaResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[AnyofWithOneEmptySchema](../../components/schema/anyof_with_one_empty_schema.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import path_post_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = path_post_api.PathPostApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_anyof_with_one_empty_schema_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling PathPostApi->post_anyof_with_one_empty_schema_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to AnyOfApi API]](../../apis/tags/any_of_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post.md new file mode 100644 index 00000000000..c7c0b1dfa59 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_array_type_matches_arrays_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_array_type_matches_arrays_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_array_type_matches_arrays_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_array_type_matches_arrays_response_body_for_content_types | [TypeApi](../../apis/tags/type_api.md) | This api is only for tag=type | +| post_array_type_matches_arrays_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostArrayTypeMatchesArraysResponseBodyForContentTypes | This api is only for path=/responseBody/postArrayTypeMatchesArraysResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postArrayTypeMatchesArraysResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[ArrayTypeMatchesArrays](../../components/schema/array_type_matches_arrays.md) | list, tuple | tuple | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import path_post_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = path_post_api.PathPostApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_array_type_matches_arrays_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling PathPostApi->post_array_type_matches_arrays_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to TypeApi API]](../../apis/tags/type_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post.md new file mode 100644 index 00000000000..144f9278eea --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_boolean_type_matches_booleans_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_boolean_type_matches_booleans_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_boolean_type_matches_booleans_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_boolean_type_matches_booleans_response_body_for_content_types | [TypeApi](../../apis/tags/type_api.md) | This api is only for tag=type | +| post_boolean_type_matches_booleans_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostBooleanTypeMatchesBooleansResponseBodyForContentTypes | This api is only for path=/responseBody/postBooleanTypeMatchesBooleansResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postBooleanTypeMatchesBooleansResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[BooleanTypeMatchesBooleans](../../components/schema/boolean_type_matches_booleans.md) | bool | BoolClass | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import path_post_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = path_post_api.PathPostApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_boolean_type_matches_booleans_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling PathPostApi->post_boolean_type_matches_booleans_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to TypeApi API]](../../apis/tags/type_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_by_int_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_by_int_response_body_for_content_types/post.md new file mode 100644 index 00000000000..911e70f70a0 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_by_int_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_by_int_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_by_int_response_body_for_content_types | [MultipleOfApi](../../apis/tags/multiple_of_api.md) | This api is only for tag=multipleOf | +| post_by_int_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_by_int_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_by_int_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostByIntResponseBodyForContentTypes | This api is only for path=/responseBody/postByIntResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postByIntResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[ByInt](../../components/schema/by_int.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import multiple_of_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = multiple_of_api.MultipleOfApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_by_int_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling MultipleOfApi->post_by_int_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to MultipleOfApi API]](../../apis/tags/multiple_of_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_by_number_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_by_number_response_body_for_content_types/post.md new file mode 100644 index 00000000000..d9ce9671ace --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_by_number_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_by_number_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_by_number_response_body_for_content_types | [MultipleOfApi](../../apis/tags/multiple_of_api.md) | This api is only for tag=multipleOf | +| post_by_number_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_by_number_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_by_number_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostByNumberResponseBodyForContentTypes | This api is only for path=/responseBody/postByNumberResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postByNumberResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[ByNumber](../../components/schema/by_number.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import multiple_of_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = multiple_of_api.MultipleOfApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_by_number_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling MultipleOfApi->post_by_number_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to MultipleOfApi API]](../../apis/tags/multiple_of_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_by_small_number_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_by_small_number_response_body_for_content_types/post.md new file mode 100644 index 00000000000..1ed6ac259ce --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_by_small_number_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_by_small_number_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_by_small_number_response_body_for_content_types | [MultipleOfApi](../../apis/tags/multiple_of_api.md) | This api is only for tag=multipleOf | +| post_by_small_number_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_by_small_number_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_by_small_number_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostBySmallNumberResponseBodyForContentTypes | This api is only for path=/responseBody/postBySmallNumberResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postBySmallNumberResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[BySmallNumber](../../components/schema/by_small_number.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import multiple_of_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = multiple_of_api.MultipleOfApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_by_small_number_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling MultipleOfApi->post_by_small_number_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to MultipleOfApi API]](../../apis/tags/multiple_of_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_date_time_format_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_date_time_format_response_body_for_content_types/post.md new file mode 100644 index 00000000000..93cc18dcc66 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_date_time_format_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_date_time_format_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_date_time_format_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_date_time_format_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_date_time_format_response_body_for_content_types | [FormatApi](../../apis/tags/format_api.md) | This api is only for tag=format | +| post_date_time_format_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostDateTimeFormatResponseBodyForContentTypes | This api is only for path=/responseBody/postDateTimeFormatResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postDateTimeFormatResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[DateTimeFormat](../../components/schema/date_time_format.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import path_post_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = path_post_api.PathPostApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_date_time_format_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling PathPostApi->post_date_time_format_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to FormatApi API]](../../apis/tags/format_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_email_format_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_email_format_response_body_for_content_types/post.md new file mode 100644 index 00000000000..f4c783e2e98 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_email_format_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_email_format_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_email_format_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_email_format_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_email_format_response_body_for_content_types | [FormatApi](../../apis/tags/format_api.md) | This api is only for tag=format | +| post_email_format_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostEmailFormatResponseBodyForContentTypes | This api is only for path=/responseBody/postEmailFormatResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postEmailFormatResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[EmailFormat](../../components/schema/email_format.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import path_post_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = path_post_api.PathPostApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_email_format_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling PathPostApi->post_email_format_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to FormatApi API]](../../apis/tags/format_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post.md new file mode 100644 index 00000000000..c541f7c6e0a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_enum_with0_does_not_match_false_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_enum_with0_does_not_match_false_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_enum_with0_does_not_match_false_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_enum_with0_does_not_match_false_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post_enum_with0_does_not_match_false_response_body_for_content_types | [EnumApi](../../apis/tags/enum_api.md) | This api is only for tag=enum | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostEnumWith0DoesNotMatchFalseResponseBodyForContentTypes | This api is only for path=/responseBody/postEnumWith0DoesNotMatchFalseResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postEnumWith0DoesNotMatchFalseResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[EnumWith0DoesNotMatchFalse](../../components/schema/enum_with0_does_not_match_false.md) | decimal.Decimal, int, float | decimal.Decimal | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import path_post_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = path_post_api.PathPostApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_enum_with0_does_not_match_false_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling PathPostApi->post_enum_with0_does_not_match_false_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to EnumApi API]](../../apis/tags/enum_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post.md new file mode 100644 index 00000000000..0a9954e1429 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_enum_with1_does_not_match_true_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_enum_with1_does_not_match_true_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_enum_with1_does_not_match_true_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_enum_with1_does_not_match_true_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post_enum_with1_does_not_match_true_response_body_for_content_types | [EnumApi](../../apis/tags/enum_api.md) | This api is only for tag=enum | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostEnumWith1DoesNotMatchTrueResponseBodyForContentTypes | This api is only for path=/responseBody/postEnumWith1DoesNotMatchTrueResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postEnumWith1DoesNotMatchTrueResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[EnumWith1DoesNotMatchTrue](../../components/schema/enum_with1_does_not_match_true.md) | decimal.Decimal, int, float | decimal.Decimal | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import path_post_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = path_post_api.PathPostApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_enum_with1_does_not_match_true_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling PathPostApi->post_enum_with1_does_not_match_true_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to EnumApi API]](../../apis/tags/enum_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post.md new file mode 100644 index 00000000000..97bf7dd5de4 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_enum_with_escaped_characters_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_enum_with_escaped_characters_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_enum_with_escaped_characters_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_enum_with_escaped_characters_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post_enum_with_escaped_characters_response_body_for_content_types | [EnumApi](../../apis/tags/enum_api.md) | This api is only for tag=enum | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostEnumWithEscapedCharactersResponseBodyForContentTypes | This api is only for path=/responseBody/postEnumWithEscapedCharactersResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postEnumWithEscapedCharactersResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[EnumWithEscapedCharacters](../../components/schema/enum_with_escaped_characters.md) | str | str | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import path_post_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = path_post_api.PathPostApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_enum_with_escaped_characters_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling PathPostApi->post_enum_with_escaped_characters_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to EnumApi API]](../../apis/tags/enum_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post.md new file mode 100644 index 00000000000..1ccf7c9fc79 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_enum_with_false_does_not_match0_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_enum_with_false_does_not_match0_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_enum_with_false_does_not_match0_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_enum_with_false_does_not_match0_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post_enum_with_false_does_not_match0_response_body_for_content_types | [EnumApi](../../apis/tags/enum_api.md) | This api is only for tag=enum | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostEnumWithFalseDoesNotMatch0ResponseBodyForContentTypes | This api is only for path=/responseBody/postEnumWithFalseDoesNotMatch0ResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postEnumWithFalseDoesNotMatch0ResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[EnumWithFalseDoesNotMatch0](../../components/schema/enum_with_false_does_not_match0.md) | bool | BoolClass | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import path_post_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = path_post_api.PathPostApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_enum_with_false_does_not_match0_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling PathPostApi->post_enum_with_false_does_not_match0_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to EnumApi API]](../../apis/tags/enum_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post.md new file mode 100644 index 00000000000..ebf91f8d446 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_enum_with_true_does_not_match1_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_enum_with_true_does_not_match1_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_enum_with_true_does_not_match1_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_enum_with_true_does_not_match1_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post_enum_with_true_does_not_match1_response_body_for_content_types | [EnumApi](../../apis/tags/enum_api.md) | This api is only for tag=enum | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostEnumWithTrueDoesNotMatch1ResponseBodyForContentTypes | This api is only for path=/responseBody/postEnumWithTrueDoesNotMatch1ResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postEnumWithTrueDoesNotMatch1ResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[EnumWithTrueDoesNotMatch1](../../components/schema/enum_with_true_does_not_match1.md) | bool | BoolClass | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import path_post_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = path_post_api.PathPostApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_enum_with_true_does_not_match1_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling PathPostApi->post_enum_with_true_does_not_match1_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to EnumApi API]](../../apis/tags/enum_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_enums_in_properties_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_enums_in_properties_response_body_for_content_types/post.md new file mode 100644 index 00000000000..ceb7feb0fd3 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_enums_in_properties_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_enums_in_properties_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_enums_in_properties_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_enums_in_properties_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_enums_in_properties_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post_enums_in_properties_response_body_for_content_types | [EnumApi](../../apis/tags/enum_api.md) | This api is only for tag=enum | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostEnumsInPropertiesResponseBodyForContentTypes | This api is only for path=/responseBody/postEnumsInPropertiesResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postEnumsInPropertiesResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[EnumsInProperties](../../components/schema/enums_in_properties.md) | dict, frozendict.frozendict | frozendict.frozendict | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import path_post_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = path_post_api.PathPostApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_enums_in_properties_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling PathPostApi->post_enums_in_properties_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to EnumApi API]](../../apis/tags/enum_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_forbidden_property_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_forbidden_property_response_body_for_content_types/post.md new file mode 100644 index 00000000000..5478c27dd18 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_forbidden_property_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_forbidden_property_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_forbidden_property_response_body_for_content_types | [_NotApi](../../apis/tags/_not_api.md) | This api is only for tag=not | +| post_forbidden_property_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_forbidden_property_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_forbidden_property_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostForbiddenPropertyResponseBodyForContentTypes | This api is only for path=/responseBody/postForbiddenPropertyResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postForbiddenPropertyResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[ForbiddenProperty](../../components/schema/forbidden_property.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import _not_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = _not_api._NotApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_forbidden_property_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling _NotApi->post_forbidden_property_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to _NotApi API]](../../apis/tags/_not_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_hostname_format_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_hostname_format_response_body_for_content_types/post.md new file mode 100644 index 00000000000..92d57a05030 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_hostname_format_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_hostname_format_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_hostname_format_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_hostname_format_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_hostname_format_response_body_for_content_types | [FormatApi](../../apis/tags/format_api.md) | This api is only for tag=format | +| post_hostname_format_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostHostnameFormatResponseBodyForContentTypes | This api is only for path=/responseBody/postHostnameFormatResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postHostnameFormatResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[HostnameFormat](../../components/schema/hostname_format.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import path_post_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = path_post_api.PathPostApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_hostname_format_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling PathPostApi->post_hostname_format_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to FormatApi API]](../../apis/tags/format_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post.md new file mode 100644 index 00000000000..f83273146f7 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_integer_type_matches_integers_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_integer_type_matches_integers_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_integer_type_matches_integers_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_integer_type_matches_integers_response_body_for_content_types | [TypeApi](../../apis/tags/type_api.md) | This api is only for tag=type | +| post_integer_type_matches_integers_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostIntegerTypeMatchesIntegersResponseBodyForContentTypes | This api is only for path=/responseBody/postIntegerTypeMatchesIntegersResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postIntegerTypeMatchesIntegersResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[IntegerTypeMatchesIntegers](../../components/schema/integer_type_matches_integers.md) | decimal.Decimal, int | decimal.Decimal | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import path_post_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = path_post_api.PathPostApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_integer_type_matches_integers_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling PathPostApi->post_integer_type_matches_integers_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to TypeApi API]](../../apis/tags/type_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post.md new file mode 100644 index 00000000000..89c9192692c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types | [MultipleOfApi](../../apis/tags/multiple_of_api.md) | This api is only for tag=multipleOf | +| post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfResponseBodyForContentTypes | This api is only for path=/responseBody/postInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf](../../components/schema/invalid_instance_should_not_raise_error_when_float_division_inf.md) | decimal.Decimal, int | decimal.Decimal | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import multiple_of_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = multiple_of_api.MultipleOfApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling MultipleOfApi->post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to MultipleOfApi API]](../../apis/tags/multiple_of_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post.md new file mode 100644 index 00000000000..604ba06c005 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_invalid_string_value_for_default_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_invalid_string_value_for_default_response_body_for_content_types | [DefaultApi](../../apis/tags/default_api.md) | This api is only for tag=default | +| post_invalid_string_value_for_default_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_invalid_string_value_for_default_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_invalid_string_value_for_default_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostInvalidStringValueForDefaultResponseBodyForContentTypes | This api is only for path=/responseBody/postInvalidStringValueForDefaultResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postInvalidStringValueForDefaultResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[InvalidStringValueForDefault](../../components/schema/invalid_string_value_for_default.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import default_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = default_api.DefaultApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_invalid_string_value_for_default_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling DefaultApi->post_invalid_string_value_for_default_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to DefaultApi API]](../../apis/tags/default_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_ipv4_format_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_ipv4_format_response_body_for_content_types/post.md new file mode 100644 index 00000000000..d2bdcceb039 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_ipv4_format_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_ipv4_format_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_ipv4_format_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_ipv4_format_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_ipv4_format_response_body_for_content_types | [FormatApi](../../apis/tags/format_api.md) | This api is only for tag=format | +| post_ipv4_format_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostIpv4FormatResponseBodyForContentTypes | This api is only for path=/responseBody/postIpv4FormatResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postIpv4FormatResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[Ipv4Format](../../components/schema/ipv4_format.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import path_post_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = path_post_api.PathPostApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_ipv4_format_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling PathPostApi->post_ipv4_format_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to FormatApi API]](../../apis/tags/format_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_ipv6_format_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_ipv6_format_response_body_for_content_types/post.md new file mode 100644 index 00000000000..6fceb235a0b --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_ipv6_format_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_ipv6_format_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_ipv6_format_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_ipv6_format_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_ipv6_format_response_body_for_content_types | [FormatApi](../../apis/tags/format_api.md) | This api is only for tag=format | +| post_ipv6_format_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostIpv6FormatResponseBodyForContentTypes | This api is only for path=/responseBody/postIpv6FormatResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postIpv6FormatResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[Ipv6Format](../../components/schema/ipv6_format.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import path_post_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = path_post_api.PathPostApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_ipv6_format_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling PathPostApi->post_ipv6_format_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to FormatApi API]](../../apis/tags/format_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_json_pointer_format_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_json_pointer_format_response_body_for_content_types/post.md new file mode 100644 index 00000000000..c3dcb2023f5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_json_pointer_format_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_json_pointer_format_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_json_pointer_format_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_json_pointer_format_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_json_pointer_format_response_body_for_content_types | [FormatApi](../../apis/tags/format_api.md) | This api is only for tag=format | +| post_json_pointer_format_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostJsonPointerFormatResponseBodyForContentTypes | This api is only for path=/responseBody/postJsonPointerFormatResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postJsonPointerFormatResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[JsonPointerFormat](../../components/schema/json_pointer_format.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import path_post_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = path_post_api.PathPostApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_json_pointer_format_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling PathPostApi->post_json_pointer_format_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to FormatApi API]](../../apis/tags/format_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_maximum_validation_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_maximum_validation_response_body_for_content_types/post.md new file mode 100644 index 00000000000..cfd636fe5f5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_maximum_validation_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_maximum_validation_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_maximum_validation_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_maximum_validation_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_maximum_validation_response_body_for_content_types | [MaximumApi](../../apis/tags/maximum_api.md) | This api is only for tag=maximum | +| post_maximum_validation_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostMaximumValidationResponseBodyForContentTypes | This api is only for path=/responseBody/postMaximumValidationResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postMaximumValidationResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[MaximumValidation](../../components/schema/maximum_validation.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import path_post_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = path_post_api.PathPostApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_maximum_validation_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling PathPostApi->post_maximum_validation_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to MaximumApi API]](../../apis/tags/maximum_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post.md new file mode 100644 index 00000000000..a2c2b8c5eff --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_maximum_validation_with_unsigned_integer_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_maximum_validation_with_unsigned_integer_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_maximum_validation_with_unsigned_integer_response_body_for_content_types | [MaximumApi](../../apis/tags/maximum_api.md) | This api is only for tag=maximum | +| post_maximum_validation_with_unsigned_integer_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostMaximumValidationWithUnsignedIntegerResponseBodyForContentTypes | This api is only for path=/responseBody/postMaximumValidationWithUnsignedIntegerResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postMaximumValidationWithUnsignedIntegerResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[MaximumValidationWithUnsignedInteger](../../components/schema/maximum_validation_with_unsigned_integer.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import path_post_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = path_post_api.PathPostApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_maximum_validation_with_unsigned_integer_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling PathPostApi->post_maximum_validation_with_unsigned_integer_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to MaximumApi API]](../../apis/tags/maximum_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_maxitems_validation_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_maxitems_validation_response_body_for_content_types/post.md new file mode 100644 index 00000000000..a5528964949 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_maxitems_validation_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_maxitems_validation_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_maxitems_validation_response_body_for_content_types | [MaxItemsApi](../../apis/tags/max_items_api.md) | This api is only for tag=maxItems | +| post_maxitems_validation_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_maxitems_validation_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_maxitems_validation_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostMaxitemsValidationResponseBodyForContentTypes | This api is only for path=/responseBody/postMaxitemsValidationResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postMaxitemsValidationResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[MaxitemsValidation](../../components/schema/maxitems_validation.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import max_items_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = max_items_api.MaxItemsApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_maxitems_validation_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling MaxItemsApi->post_maxitems_validation_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to MaxItemsApi API]](../../apis/tags/max_items_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_maxlength_validation_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_maxlength_validation_response_body_for_content_types/post.md new file mode 100644 index 00000000000..ccf5d208c05 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_maxlength_validation_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_maxlength_validation_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_maxlength_validation_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_maxlength_validation_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_maxlength_validation_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post_maxlength_validation_response_body_for_content_types | [MaxLengthApi](../../apis/tags/max_length_api.md) | This api is only for tag=maxLength | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostMaxlengthValidationResponseBodyForContentTypes | This api is only for path=/responseBody/postMaxlengthValidationResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postMaxlengthValidationResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[MaxlengthValidation](../../components/schema/maxlength_validation.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import path_post_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = path_post_api.PathPostApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_maxlength_validation_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling PathPostApi->post_maxlength_validation_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to MaxLengthApi API]](../../apis/tags/max_length_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post.md new file mode 100644 index 00000000000..0eef637e2ff --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_maxproperties0_means_the_object_is_empty_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_maxproperties0_means_the_object_is_empty_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_maxproperties0_means_the_object_is_empty_response_body_for_content_types | [MaxPropertiesApi](../../apis/tags/max_properties_api.md) | This api is only for tag=maxProperties | +| post_maxproperties0_means_the_object_is_empty_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostMaxproperties0MeansTheObjectIsEmptyResponseBodyForContentTypes | This api is only for path=/responseBody/postMaxproperties0MeansTheObjectIsEmptyResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postMaxproperties0MeansTheObjectIsEmptyResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[Maxproperties0MeansTheObjectIsEmpty](../../components/schema/maxproperties0_means_the_object_is_empty.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import path_post_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = path_post_api.PathPostApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_maxproperties0_means_the_object_is_empty_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling PathPostApi->post_maxproperties0_means_the_object_is_empty_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to MaxPropertiesApi API]](../../apis/tags/max_properties_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post.md new file mode 100644 index 00000000000..1b5451e9b61 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_maxproperties_validation_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_maxproperties_validation_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_maxproperties_validation_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_maxproperties_validation_response_body_for_content_types | [MaxPropertiesApi](../../apis/tags/max_properties_api.md) | This api is only for tag=maxProperties | +| post_maxproperties_validation_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostMaxpropertiesValidationResponseBodyForContentTypes | This api is only for path=/responseBody/postMaxpropertiesValidationResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postMaxpropertiesValidationResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[MaxpropertiesValidation](../../components/schema/maxproperties_validation.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import path_post_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = path_post_api.PathPostApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_maxproperties_validation_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling PathPostApi->post_maxproperties_validation_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to MaxPropertiesApi API]](../../apis/tags/max_properties_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_minimum_validation_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_minimum_validation_response_body_for_content_types/post.md new file mode 100644 index 00000000000..28044cb81bd --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_minimum_validation_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_minimum_validation_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_minimum_validation_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_minimum_validation_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_minimum_validation_response_body_for_content_types | [MinimumApi](../../apis/tags/minimum_api.md) | This api is only for tag=minimum | +| post_minimum_validation_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostMinimumValidationResponseBodyForContentTypes | This api is only for path=/responseBody/postMinimumValidationResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postMinimumValidationResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[MinimumValidation](../../components/schema/minimum_validation.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import path_post_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = path_post_api.PathPostApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_minimum_validation_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling PathPostApi->post_minimum_validation_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to MinimumApi API]](../../apis/tags/minimum_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post.md new file mode 100644 index 00000000000..e7858c626db --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_minimum_validation_with_signed_integer_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_minimum_validation_with_signed_integer_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_minimum_validation_with_signed_integer_response_body_for_content_types | [MinimumApi](../../apis/tags/minimum_api.md) | This api is only for tag=minimum | +| post_minimum_validation_with_signed_integer_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostMinimumValidationWithSignedIntegerResponseBodyForContentTypes | This api is only for path=/responseBody/postMinimumValidationWithSignedIntegerResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postMinimumValidationWithSignedIntegerResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[MinimumValidationWithSignedInteger](../../components/schema/minimum_validation_with_signed_integer.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import path_post_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = path_post_api.PathPostApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_minimum_validation_with_signed_integer_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling PathPostApi->post_minimum_validation_with_signed_integer_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to MinimumApi API]](../../apis/tags/minimum_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_minitems_validation_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_minitems_validation_response_body_for_content_types/post.md new file mode 100644 index 00000000000..d09e4921a51 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_minitems_validation_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_minitems_validation_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_minitems_validation_response_body_for_content_types | [MinItemsApi](../../apis/tags/min_items_api.md) | This api is only for tag=minItems | +| post_minitems_validation_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_minitems_validation_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_minitems_validation_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostMinitemsValidationResponseBodyForContentTypes | This api is only for path=/responseBody/postMinitemsValidationResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postMinitemsValidationResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[MinitemsValidation](../../components/schema/minitems_validation.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import min_items_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = min_items_api.MinItemsApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_minitems_validation_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling MinItemsApi->post_minitems_validation_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to MinItemsApi API]](../../apis/tags/min_items_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_minlength_validation_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_minlength_validation_response_body_for_content_types/post.md new file mode 100644 index 00000000000..a62982be109 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_minlength_validation_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_minlength_validation_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_minlength_validation_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_minlength_validation_response_body_for_content_types | [MinLengthApi](../../apis/tags/min_length_api.md) | This api is only for tag=minLength | +| post_minlength_validation_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_minlength_validation_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostMinlengthValidationResponseBodyForContentTypes | This api is only for path=/responseBody/postMinlengthValidationResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postMinlengthValidationResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[MinlengthValidation](../../components/schema/minlength_validation.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import path_post_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = path_post_api.PathPostApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_minlength_validation_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling PathPostApi->post_minlength_validation_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to MinLengthApi API]](../../apis/tags/min_length_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_minproperties_validation_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_minproperties_validation_response_body_for_content_types/post.md new file mode 100644 index 00000000000..9cf5fcbd939 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_minproperties_validation_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_minproperties_validation_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_minproperties_validation_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_minproperties_validation_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_minproperties_validation_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post_minproperties_validation_response_body_for_content_types | [MinPropertiesApi](../../apis/tags/min_properties_api.md) | This api is only for tag=minProperties | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostMinpropertiesValidationResponseBodyForContentTypes | This api is only for path=/responseBody/postMinpropertiesValidationResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postMinpropertiesValidationResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[MinpropertiesValidation](../../components/schema/minproperties_validation.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import path_post_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = path_post_api.PathPostApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_minproperties_validation_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling PathPostApi->post_minproperties_validation_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to MinPropertiesApi API]](../../apis/tags/min_properties_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post.md new file mode 100644 index 00000000000..9fc50a6bda4 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_nested_allof_to_check_validation_semantics_response_body_for_content_types | [AllOfApi](../../apis/tags/all_of_api.md) | This api is only for tag=allOf | +| post_nested_allof_to_check_validation_semantics_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_nested_allof_to_check_validation_semantics_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_nested_allof_to_check_validation_semantics_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostNestedAllofToCheckValidationSemanticsResponseBodyForContentTypes | This api is only for path=/responseBody/postNestedAllofToCheckValidationSemanticsResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postNestedAllofToCheckValidationSemanticsResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[NestedAllofToCheckValidationSemantics](../../components/schema/nested_allof_to_check_validation_semantics.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import all_of_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = all_of_api.AllOfApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_nested_allof_to_check_validation_semantics_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling AllOfApi->post_nested_allof_to_check_validation_semantics_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to AllOfApi API]](../../apis/tags/all_of_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post.md new file mode 100644 index 00000000000..8a3a3481308 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_nested_anyof_to_check_validation_semantics_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_nested_anyof_to_check_validation_semantics_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_nested_anyof_to_check_validation_semantics_response_body_for_content_types | [AnyOfApi](../../apis/tags/any_of_api.md) | This api is only for tag=anyOf | +| post_nested_anyof_to_check_validation_semantics_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostNestedAnyofToCheckValidationSemanticsResponseBodyForContentTypes | This api is only for path=/responseBody/postNestedAnyofToCheckValidationSemanticsResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postNestedAnyofToCheckValidationSemanticsResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[NestedAnyofToCheckValidationSemantics](../../components/schema/nested_anyof_to_check_validation_semantics.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import path_post_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = path_post_api.PathPostApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_nested_anyof_to_check_validation_semantics_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling PathPostApi->post_nested_anyof_to_check_validation_semantics_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to AnyOfApi API]](../../apis/tags/any_of_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_nested_items_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_nested_items_response_body_for_content_types/post.md new file mode 100644 index 00000000000..b9aec826871 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_nested_items_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_nested_items_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_nested_items_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_nested_items_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_nested_items_response_body_for_content_types | [ItemsApi](../../apis/tags/items_api.md) | This api is only for tag=items | +| post_nested_items_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostNestedItemsResponseBodyForContentTypes | This api is only for path=/responseBody/postNestedItemsResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postNestedItemsResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[NestedItems](../../components/schema/nested_items.md) | list, tuple | tuple | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import path_post_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = path_post_api.PathPostApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_nested_items_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling PathPostApi->post_nested_items_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to ItemsApi API]](../../apis/tags/items_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post.md new file mode 100644 index 00000000000..db1164c8e30 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_nested_oneof_to_check_validation_semantics_response_body_for_content_types | [OneOfApi](../../apis/tags/one_of_api.md) | This api is only for tag=oneOf | +| post_nested_oneof_to_check_validation_semantics_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_nested_oneof_to_check_validation_semantics_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_nested_oneof_to_check_validation_semantics_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostNestedOneofToCheckValidationSemanticsResponseBodyForContentTypes | This api is only for path=/responseBody/postNestedOneofToCheckValidationSemanticsResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postNestedOneofToCheckValidationSemanticsResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[NestedOneofToCheckValidationSemantics](../../components/schema/nested_oneof_to_check_validation_semantics.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import one_of_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = one_of_api.OneOfApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_nested_oneof_to_check_validation_semantics_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OneOfApi->post_nested_oneof_to_check_validation_semantics_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OneOfApi API]](../../apis/tags/one_of_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post.md new file mode 100644 index 00000000000..f54ed3a09c3 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_not_more_complex_schema_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_not_more_complex_schema_response_body_for_content_types | [_NotApi](../../apis/tags/_not_api.md) | This api is only for tag=not | +| post_not_more_complex_schema_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_not_more_complex_schema_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_not_more_complex_schema_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostNotMoreComplexSchemaResponseBodyForContentTypes | This api is only for path=/responseBody/postNotMoreComplexSchemaResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postNotMoreComplexSchemaResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[NotMoreComplexSchema](../../components/schema/not_more_complex_schema.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import _not_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = _not_api._NotApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_not_more_complex_schema_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling _NotApi->post_not_more_complex_schema_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to _NotApi API]](../../apis/tags/_not_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_not_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_not_response_body_for_content_types/post.md new file mode 100644 index 00000000000..ba1d942ce54 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_not_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_not_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_not_response_body_for_content_types | [_NotApi](../../apis/tags/_not_api.md) | This api is only for tag=not | +| post_not_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_not_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_not_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostNotResponseBodyForContentTypes | This api is only for path=/responseBody/postNotResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postNotResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[_Not](../../components/schema/_not.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import _not_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = _not_api._NotApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_not_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling _NotApi->post_not_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to _NotApi API]](../../apis/tags/_not_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post.md new file mode 100644 index 00000000000..f5f1c426d2c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_nul_characters_in_strings_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_nul_characters_in_strings_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_nul_characters_in_strings_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_nul_characters_in_strings_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post_nul_characters_in_strings_response_body_for_content_types | [EnumApi](../../apis/tags/enum_api.md) | This api is only for tag=enum | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostNulCharactersInStringsResponseBodyForContentTypes | This api is only for path=/responseBody/postNulCharactersInStringsResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postNulCharactersInStringsResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[NulCharactersInStrings](../../components/schema/nul_characters_in_strings.md) | str | str | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import path_post_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = path_post_api.PathPostApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_nul_characters_in_strings_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling PathPostApi->post_nul_characters_in_strings_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to EnumApi API]](../../apis/tags/enum_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post.md new file mode 100644 index 00000000000..63dd1283503 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_null_type_matches_only_the_null_object_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_null_type_matches_only_the_null_object_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_null_type_matches_only_the_null_object_response_body_for_content_types | [TypeApi](../../apis/tags/type_api.md) | This api is only for tag=type | +| post_null_type_matches_only_the_null_object_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes | This api is only for path=/responseBody/postNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[NullTypeMatchesOnlyTheNullObject](../../components/schema/null_type_matches_only_the_null_object.md) | None | NoneClass | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import path_post_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = path_post_api.PathPostApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_null_type_matches_only_the_null_object_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling PathPostApi->post_null_type_matches_only_the_null_object_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to TypeApi API]](../../apis/tags/type_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post.md new file mode 100644 index 00000000000..4a8035c53ca --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_number_type_matches_numbers_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_number_type_matches_numbers_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_number_type_matches_numbers_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_number_type_matches_numbers_response_body_for_content_types | [TypeApi](../../apis/tags/type_api.md) | This api is only for tag=type | +| post_number_type_matches_numbers_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostNumberTypeMatchesNumbersResponseBodyForContentTypes | This api is only for path=/responseBody/postNumberTypeMatchesNumbersResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postNumberTypeMatchesNumbersResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[NumberTypeMatchesNumbers](../../components/schema/number_type_matches_numbers.md) | decimal.Decimal, int, float | decimal.Decimal | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import path_post_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = path_post_api.PathPostApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_number_type_matches_numbers_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling PathPostApi->post_number_type_matches_numbers_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to TypeApi API]](../../apis/tags/type_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_object_properties_validation_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_object_properties_validation_response_body_for_content_types/post.md new file mode 100644 index 00000000000..9968c320df6 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_object_properties_validation_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_object_properties_validation_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_object_properties_validation_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_object_properties_validation_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_object_properties_validation_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post_object_properties_validation_response_body_for_content_types | [PropertiesApi](../../apis/tags/properties_api.md) | This api is only for tag=properties | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostObjectPropertiesValidationResponseBodyForContentTypes | This api is only for path=/responseBody/postObjectPropertiesValidationResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postObjectPropertiesValidationResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[ObjectPropertiesValidation](../../components/schema/object_properties_validation.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import path_post_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = path_post_api.PathPostApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_object_properties_validation_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling PathPostApi->post_object_properties_validation_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to PropertiesApi API]](../../apis/tags/properties_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post.md new file mode 100644 index 00000000000..e71dc7b5e5c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_object_type_matches_objects_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_object_type_matches_objects_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_object_type_matches_objects_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_object_type_matches_objects_response_body_for_content_types | [TypeApi](../../apis/tags/type_api.md) | This api is only for tag=type | +| post_object_type_matches_objects_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostObjectTypeMatchesObjectsResponseBodyForContentTypes | This api is only for path=/responseBody/postObjectTypeMatchesObjectsResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postObjectTypeMatchesObjectsResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[ObjectTypeMatchesObjects](../../components/schema/object_type_matches_objects.md) | dict, frozendict.frozendict | frozendict.frozendict | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import path_post_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = path_post_api.PathPostApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_object_type_matches_objects_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling PathPostApi->post_object_type_matches_objects_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to TypeApi API]](../../apis/tags/type_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post.md new file mode 100644 index 00000000000..cc22c26ac80 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_oneof_complex_types_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_oneof_complex_types_response_body_for_content_types | [OneOfApi](../../apis/tags/one_of_api.md) | This api is only for tag=oneOf | +| post_oneof_complex_types_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_oneof_complex_types_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_oneof_complex_types_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostOneofComplexTypesResponseBodyForContentTypes | This api is only for path=/responseBody/postOneofComplexTypesResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postOneofComplexTypesResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[OneofComplexTypes](../../components/schema/oneof_complex_types.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import one_of_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = one_of_api.OneOfApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_oneof_complex_types_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OneOfApi->post_oneof_complex_types_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OneOfApi API]](../../apis/tags/one_of_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_oneof_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_oneof_response_body_for_content_types/post.md new file mode 100644 index 00000000000..5a0e4c8ed27 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_oneof_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_oneof_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_oneof_response_body_for_content_types | [OneOfApi](../../apis/tags/one_of_api.md) | This api is only for tag=oneOf | +| post_oneof_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_oneof_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_oneof_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostOneofResponseBodyForContentTypes | This api is only for path=/responseBody/postOneofResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postOneofResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[Oneof](../../components/schema/oneof.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import one_of_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = one_of_api.OneOfApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_oneof_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OneOfApi->post_oneof_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OneOfApi API]](../../apis/tags/one_of_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post.md new file mode 100644 index 00000000000..4c9aa21512a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_oneof_with_base_schema_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_oneof_with_base_schema_response_body_for_content_types | [OneOfApi](../../apis/tags/one_of_api.md) | This api is only for tag=oneOf | +| post_oneof_with_base_schema_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_oneof_with_base_schema_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_oneof_with_base_schema_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostOneofWithBaseSchemaResponseBodyForContentTypes | This api is only for path=/responseBody/postOneofWithBaseSchemaResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postOneofWithBaseSchemaResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[OneofWithBaseSchema](../../components/schema/oneof_with_base_schema.md) | str | str | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import one_of_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = one_of_api.OneOfApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_oneof_with_base_schema_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OneOfApi->post_oneof_with_base_schema_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OneOfApi API]](../../apis/tags/one_of_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post.md new file mode 100644 index 00000000000..0366e46e0bb --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_oneof_with_empty_schema_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_oneof_with_empty_schema_response_body_for_content_types | [OneOfApi](../../apis/tags/one_of_api.md) | This api is only for tag=oneOf | +| post_oneof_with_empty_schema_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_oneof_with_empty_schema_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_oneof_with_empty_schema_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostOneofWithEmptySchemaResponseBodyForContentTypes | This api is only for path=/responseBody/postOneofWithEmptySchemaResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postOneofWithEmptySchemaResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[OneofWithEmptySchema](../../components/schema/oneof_with_empty_schema.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import one_of_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = one_of_api.OneOfApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_oneof_with_empty_schema_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OneOfApi->post_oneof_with_empty_schema_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OneOfApi API]](../../apis/tags/one_of_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_oneof_with_required_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_oneof_with_required_response_body_for_content_types/post.md new file mode 100644 index 00000000000..6465e67acd8 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_oneof_with_required_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_oneof_with_required_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_oneof_with_required_response_body_for_content_types | [OneOfApi](../../apis/tags/one_of_api.md) | This api is only for tag=oneOf | +| post_oneof_with_required_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_oneof_with_required_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_oneof_with_required_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostOneofWithRequiredResponseBodyForContentTypes | This api is only for path=/responseBody/postOneofWithRequiredResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postOneofWithRequiredResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[OneofWithRequired](../../components/schema/oneof_with_required.md) | dict, frozendict.frozendict | frozendict.frozendict | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import one_of_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = one_of_api.OneOfApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_oneof_with_required_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling OneOfApi->post_oneof_with_required_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to OneOfApi API]](../../apis/tags/one_of_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post.md new file mode 100644 index 00000000000..124c28eea9b --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_pattern_is_not_anchored_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_pattern_is_not_anchored_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_pattern_is_not_anchored_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_pattern_is_not_anchored_response_body_for_content_types | [PatternApi](../../apis/tags/pattern_api.md) | This api is only for tag=pattern | +| post_pattern_is_not_anchored_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostPatternIsNotAnchoredResponseBodyForContentTypes | This api is only for path=/responseBody/postPatternIsNotAnchoredResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postPatternIsNotAnchoredResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[PatternIsNotAnchored](../../components/schema/pattern_is_not_anchored.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import path_post_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = path_post_api.PathPostApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_pattern_is_not_anchored_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling PathPostApi->post_pattern_is_not_anchored_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to PatternApi API]](../../apis/tags/pattern_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_pattern_validation_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_pattern_validation_response_body_for_content_types/post.md new file mode 100644 index 00000000000..02cf3f92172 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_pattern_validation_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_pattern_validation_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_pattern_validation_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_pattern_validation_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_pattern_validation_response_body_for_content_types | [PatternApi](../../apis/tags/pattern_api.md) | This api is only for tag=pattern | +| post_pattern_validation_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostPatternValidationResponseBodyForContentTypes | This api is only for path=/responseBody/postPatternValidationResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postPatternValidationResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[PatternValidation](../../components/schema/pattern_validation.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import path_post_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = path_post_api.PathPostApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_pattern_validation_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling PathPostApi->post_pattern_validation_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to PatternApi API]](../../apis/tags/pattern_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post.md new file mode 100644 index 00000000000..adcc874f408 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_properties_with_escaped_characters_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_properties_with_escaped_characters_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_properties_with_escaped_characters_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_properties_with_escaped_characters_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post_properties_with_escaped_characters_response_body_for_content_types | [PropertiesApi](../../apis/tags/properties_api.md) | This api is only for tag=properties | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostPropertiesWithEscapedCharactersResponseBodyForContentTypes | This api is only for path=/responseBody/postPropertiesWithEscapedCharactersResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postPropertiesWithEscapedCharactersResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[PropertiesWithEscapedCharacters](../../components/schema/properties_with_escaped_characters.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import path_post_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = path_post_api.PathPostApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_properties_with_escaped_characters_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling PathPostApi->post_properties_with_escaped_characters_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to PropertiesApi API]](../../apis/tags/properties_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post.md new file mode 100644 index 00000000000..5798d76fa85 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_property_named_ref_that_is_not_a_reference_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_property_named_ref_that_is_not_a_reference_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_property_named_ref_that_is_not_a_reference_response_body_for_content_types | [RefApi](../../apis/tags/ref_api.md) | This api is only for tag=$ref | +| post_property_named_ref_that_is_not_a_reference_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostPropertyNamedRefThatIsNotAReferenceResponseBodyForContentTypes | This api is only for path=/responseBody/postPropertyNamedRefThatIsNotAReferenceResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postPropertyNamedRefThatIsNotAReferenceResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[PropertyNamedRefThatIsNotAReference](../../components/schema/property_named_ref_that_is_not_a_reference.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import path_post_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = path_post_api.PathPostApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_property_named_ref_that_is_not_a_reference_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling PathPostApi->post_property_named_ref_that_is_not_a_reference_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to RefApi API]](../../apis/tags/ref_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post.md new file mode 100644 index 00000000000..0c06a3e0402 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_ref_in_additionalproperties_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_ref_in_additionalproperties_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_ref_in_additionalproperties_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_ref_in_additionalproperties_response_body_for_content_types | [RefApi](../../apis/tags/ref_api.md) | This api is only for tag=$ref | +| post_ref_in_additionalproperties_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostRefInAdditionalpropertiesResponseBodyForContentTypes | This api is only for path=/responseBody/postRefInAdditionalpropertiesResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postRefInAdditionalpropertiesResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[RefInAdditionalproperties](../../components/schema/ref_in_additionalproperties.md) | dict, frozendict.frozendict | frozendict.frozendict | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import path_post_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = path_post_api.PathPostApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_ref_in_additionalproperties_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling PathPostApi->post_ref_in_additionalproperties_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to RefApi API]](../../apis/tags/ref_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_ref_in_allof_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_ref_in_allof_response_body_for_content_types/post.md new file mode 100644 index 00000000000..9d37e605e7a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_ref_in_allof_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_ref_in_allof_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_ref_in_allof_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_ref_in_allof_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_ref_in_allof_response_body_for_content_types | [RefApi](../../apis/tags/ref_api.md) | This api is only for tag=$ref | +| post_ref_in_allof_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostRefInAllofResponseBodyForContentTypes | This api is only for path=/responseBody/postRefInAllofResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postRefInAllofResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[RefInAllof](../../components/schema/ref_in_allof.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import path_post_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = path_post_api.PathPostApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_ref_in_allof_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling PathPostApi->post_ref_in_allof_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to RefApi API]](../../apis/tags/ref_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post.md new file mode 100644 index 00000000000..86077dbf9b9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_ref_in_anyof_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_ref_in_anyof_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_ref_in_anyof_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_ref_in_anyof_response_body_for_content_types | [RefApi](../../apis/tags/ref_api.md) | This api is only for tag=$ref | +| post_ref_in_anyof_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostRefInAnyofResponseBodyForContentTypes | This api is only for path=/responseBody/postRefInAnyofResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postRefInAnyofResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[RefInAnyof](../../components/schema/ref_in_anyof.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import path_post_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = path_post_api.PathPostApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_ref_in_anyof_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling PathPostApi->post_ref_in_anyof_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to RefApi API]](../../apis/tags/ref_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_ref_in_items_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_ref_in_items_response_body_for_content_types/post.md new file mode 100644 index 00000000000..4ccd96a92ec --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_ref_in_items_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_ref_in_items_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_ref_in_items_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_ref_in_items_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_ref_in_items_response_body_for_content_types | [RefApi](../../apis/tags/ref_api.md) | This api is only for tag=$ref | +| post_ref_in_items_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostRefInItemsResponseBodyForContentTypes | This api is only for path=/responseBody/postRefInItemsResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postRefInItemsResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[RefInItems](../../components/schema/ref_in_items.md) | list, tuple | tuple | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import path_post_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = path_post_api.PathPostApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_ref_in_items_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling PathPostApi->post_ref_in_items_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to RefApi API]](../../apis/tags/ref_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_ref_in_not_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_ref_in_not_response_body_for_content_types/post.md new file mode 100644 index 00000000000..b96b322fb47 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_ref_in_not_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_ref_in_not_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_ref_in_not_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_ref_in_not_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_ref_in_not_response_body_for_content_types | [RefApi](../../apis/tags/ref_api.md) | This api is only for tag=$ref | +| post_ref_in_not_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostRefInNotResponseBodyForContentTypes | This api is only for path=/responseBody/postRefInNotResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postRefInNotResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[RefInNot](../../components/schema/ref_in_not.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import path_post_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = path_post_api.PathPostApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_ref_in_not_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling PathPostApi->post_ref_in_not_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to RefApi API]](../../apis/tags/ref_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post.md new file mode 100644 index 00000000000..813b7cbeb1a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_ref_in_oneof_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_ref_in_oneof_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_ref_in_oneof_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_ref_in_oneof_response_body_for_content_types | [RefApi](../../apis/tags/ref_api.md) | This api is only for tag=$ref | +| post_ref_in_oneof_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostRefInOneofResponseBodyForContentTypes | This api is only for path=/responseBody/postRefInOneofResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postRefInOneofResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[RefInOneof](../../components/schema/ref_in_oneof.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import path_post_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = path_post_api.PathPostApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_ref_in_oneof_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling PathPostApi->post_ref_in_oneof_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to RefApi API]](../../apis/tags/ref_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_ref_in_property_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_ref_in_property_response_body_for_content_types/post.md new file mode 100644 index 00000000000..58e63f037d2 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_ref_in_property_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_ref_in_property_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_ref_in_property_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_ref_in_property_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_ref_in_property_response_body_for_content_types | [RefApi](../../apis/tags/ref_api.md) | This api is only for tag=$ref | +| post_ref_in_property_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostRefInPropertyResponseBodyForContentTypes | This api is only for path=/responseBody/postRefInPropertyResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postRefInPropertyResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[RefInProperty](../../components/schema/ref_in_property.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import path_post_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = path_post_api.PathPostApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_ref_in_property_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling PathPostApi->post_ref_in_property_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to RefApi API]](../../apis/tags/ref_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_required_default_validation_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_required_default_validation_response_body_for_content_types/post.md new file mode 100644 index 00000000000..414a51585ec --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_required_default_validation_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_required_default_validation_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_required_default_validation_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_required_default_validation_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_required_default_validation_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post_required_default_validation_response_body_for_content_types | [RequiredApi](../../apis/tags/required_api.md) | This api is only for tag=required | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostRequiredDefaultValidationResponseBodyForContentTypes | This api is only for path=/responseBody/postRequiredDefaultValidationResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postRequiredDefaultValidationResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[RequiredDefaultValidation](../../components/schema/required_default_validation.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import path_post_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = path_post_api.PathPostApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_required_default_validation_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling PathPostApi->post_required_default_validation_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to RequiredApi API]](../../apis/tags/required_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_required_validation_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_required_validation_response_body_for_content_types/post.md new file mode 100644 index 00000000000..2e1f2570120 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_required_validation_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_required_validation_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_required_validation_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_required_validation_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_required_validation_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post_required_validation_response_body_for_content_types | [RequiredApi](../../apis/tags/required_api.md) | This api is only for tag=required | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostRequiredValidationResponseBodyForContentTypes | This api is only for path=/responseBody/postRequiredValidationResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postRequiredValidationResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[RequiredValidation](../../components/schema/required_validation.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import path_post_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = path_post_api.PathPostApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_required_validation_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling PathPostApi->post_required_validation_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to RequiredApi API]](../../apis/tags/required_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post.md new file mode 100644 index 00000000000..48838db4632 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_required_with_empty_array_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_required_with_empty_array_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_required_with_empty_array_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_required_with_empty_array_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post_required_with_empty_array_response_body_for_content_types | [RequiredApi](../../apis/tags/required_api.md) | This api is only for tag=required | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostRequiredWithEmptyArrayResponseBodyForContentTypes | This api is only for path=/responseBody/postRequiredWithEmptyArrayResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postRequiredWithEmptyArrayResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[RequiredWithEmptyArray](../../components/schema/required_with_empty_array.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import path_post_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = path_post_api.PathPostApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_required_with_empty_array_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling PathPostApi->post_required_with_empty_array_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to RequiredApi API]](../../apis/tags/required_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post.md new file mode 100644 index 00000000000..8bc90f36229 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_required_with_escaped_characters_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_required_with_escaped_characters_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_required_with_escaped_characters_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_required_with_escaped_characters_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post_required_with_escaped_characters_response_body_for_content_types | [RequiredApi](../../apis/tags/required_api.md) | This api is only for tag=required | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostRequiredWithEscapedCharactersResponseBodyForContentTypes | This api is only for path=/responseBody/postRequiredWithEscapedCharactersResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postRequiredWithEscapedCharactersResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[RequiredWithEscapedCharacters](../../components/schema/required_with_escaped_characters.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import path_post_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = path_post_api.PathPostApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_required_with_escaped_characters_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling PathPostApi->post_required_with_escaped_characters_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to RequiredApi API]](../../apis/tags/required_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post.md new file mode 100644 index 00000000000..9fbd22403a2 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_simple_enum_validation_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_simple_enum_validation_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_simple_enum_validation_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_simple_enum_validation_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post_simple_enum_validation_response_body_for_content_types | [EnumApi](../../apis/tags/enum_api.md) | This api is only for tag=enum | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostSimpleEnumValidationResponseBodyForContentTypes | This api is only for path=/responseBody/postSimpleEnumValidationResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postSimpleEnumValidationResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[SimpleEnumValidation](../../components/schema/simple_enum_validation.md) | decimal.Decimal, int, float | decimal.Decimal | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import path_post_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = path_post_api.PathPostApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_simple_enum_validation_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling PathPostApi->post_simple_enum_validation_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to EnumApi API]](../../apis/tags/enum_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post.md new file mode 100644 index 00000000000..159bfaa2450 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_string_type_matches_strings_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_string_type_matches_strings_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_string_type_matches_strings_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_string_type_matches_strings_response_body_for_content_types | [TypeApi](../../apis/tags/type_api.md) | This api is only for tag=type | +| post_string_type_matches_strings_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostStringTypeMatchesStringsResponseBodyForContentTypes | This api is only for path=/responseBody/postStringTypeMatchesStringsResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postStringTypeMatchesStringsResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[StringTypeMatchesStrings](../../components/schema/string_type_matches_strings.md) | str | str | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import path_post_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = path_post_api.PathPostApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_string_type_matches_strings_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling PathPostApi->post_string_type_matches_strings_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to TypeApi API]](../../apis/tags/type_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post.md new file mode 100644 index 00000000000..e50bd21a2ec --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types | [DefaultApi](../../apis/tags/default_api.md) | This api is only for tag=default | +| post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyForContentTypes | This api is only for path=/responseBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing](../../components/schema/the_default_keyword_does_not_do_anything_if_the_property_is_missing.md) | dict, frozendict.frozendict | frozendict.frozendict | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import default_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = default_api.DefaultApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling DefaultApi->post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to DefaultApi API]](../../apis/tags/default_api.md) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post.md new file mode 100644 index 00000000000..a6546a17505 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_uniqueitems_false_validation_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_uniqueitems_false_validation_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_uniqueitems_false_validation_response_body_for_content_types | [UniqueItemsApi](../../apis/tags/unique_items_api.md) | This api is only for tag=uniqueItems | +| post_uniqueitems_false_validation_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_uniqueitems_false_validation_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostUniqueitemsFalseValidationResponseBodyForContentTypes | This api is only for path=/responseBody/postUniqueitemsFalseValidationResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postUniqueitemsFalseValidationResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[UniqueitemsFalseValidation](../../components/schema/uniqueitems_false_validation.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import path_post_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = path_post_api.PathPostApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_uniqueitems_false_validation_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling PathPostApi->post_uniqueitems_false_validation_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to UniqueItemsApi API]](../../apis/tags/unique_items_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post.md new file mode 100644 index 00000000000..6962b4b981d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_uniqueitems_validation_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_uniqueitems_validation_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_uniqueitems_validation_response_body_for_content_types | [UniqueItemsApi](../../apis/tags/unique_items_api.md) | This api is only for tag=uniqueItems | +| post_uniqueitems_validation_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_uniqueitems_validation_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostUniqueitemsValidationResponseBodyForContentTypes | This api is only for path=/responseBody/postUniqueitemsValidationResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postUniqueitemsValidationResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[UniqueitemsValidation](../../components/schema/uniqueitems_validation.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import path_post_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = path_post_api.PathPostApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_uniqueitems_validation_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling PathPostApi->post_uniqueitems_validation_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to UniqueItemsApi API]](../../apis/tags/unique_items_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_uri_format_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_uri_format_response_body_for_content_types/post.md new file mode 100644 index 00000000000..261e328fbec --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_uri_format_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_uri_format_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_uri_format_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_uri_format_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_uri_format_response_body_for_content_types | [FormatApi](../../apis/tags/format_api.md) | This api is only for tag=format | +| post_uri_format_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostUriFormatResponseBodyForContentTypes | This api is only for path=/responseBody/postUriFormatResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postUriFormatResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[UriFormat](../../components/schema/uri_format.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import path_post_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = path_post_api.PathPostApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_uri_format_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling PathPostApi->post_uri_format_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to FormatApi API]](../../apis/tags/format_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_uri_reference_format_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_uri_reference_format_response_body_for_content_types/post.md new file mode 100644 index 00000000000..15532ecc6ef --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_uri_reference_format_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_uri_reference_format_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_uri_reference_format_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_uri_reference_format_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_uri_reference_format_response_body_for_content_types | [FormatApi](../../apis/tags/format_api.md) | This api is only for tag=format | +| post_uri_reference_format_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostUriReferenceFormatResponseBodyForContentTypes | This api is only for path=/responseBody/postUriReferenceFormatResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postUriReferenceFormatResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[UriReferenceFormat](../../components/schema/uri_reference_format.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import path_post_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = path_post_api.PathPostApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_uri_reference_format_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling PathPostApi->post_uri_reference_format_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to FormatApi API]](../../apis/tags/format_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_uri_template_format_response_body_for_content_types/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_uri_template_format_response_body_for_content_types/post.md new file mode 100644 index 00000000000..95cb944ccf6 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/response_body_post_uri_template_format_response_body_for_content_types/post.md @@ -0,0 +1,107 @@ +unit_test_api.paths.response_body_post_uri_template_format_response_body_for_content_types.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_uri_template_format_response_body_for_content_types | [PathPostApi](../../apis/tags/path_post_api.md) | This api is only for tag=path.post | +| post_uri_template_format_response_body_for_content_types | [ContentTypeJsonApi](../../apis/tags/content_type_json_api.md) | This api is only for tag=contentType_json | +| post_uri_template_format_response_body_for_content_types | [FormatApi](../../apis/tags/format_api.md) | This api is only for tag=format | +| post_uri_template_format_response_body_for_content_types | [ResponseContentContentTypeSchemaApi](../../apis/tags/response_content_content_type_schema_api.md) | This api is only for tag=response.content.contentType.schema | +| post | ApiForPost | This api is only for this endpoint | +| post | ResponseBodyPostUriTemplateFormatResponseBodyForContentTypes | This api is only for path=/responseBody/postUriTemplateFormatResponseBodyForContentTypes | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/responseBody/postUriTemplateFormatResponseBodyForContentTypes" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[UriTemplateFormat](../../components/schema/uri_template_format.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = https://someserver.com/v1 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import unit_test_api +from unit_test_api.configurations import api_configuration +from unit_test_api.apis.tags import path_post_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = path_post_api.PathPostApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.post_uri_template_format_response_body_for_content_types() + pprint(api_response) + except unit_test_api.ApiException as e: + print("Exception when calling PathPostApi->post_uri_template_format_response_body_for_content_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PathPostApi API]](../../apis/tags/path_post_api.md) +[[Back to ContentTypeJsonApi API]](../../apis/tags/content_type_json_api.md) +[[Back to FormatApi API]](../../apis/tags/format_api.md) +[[Back to ResponseContentContentTypeSchemaApi API]](../../apis/tags/response_content_content_type_schema_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/servers/server_0.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/servers/server_0.md new file mode 100644 index 00000000000..b37c67353d5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/servers/server_0.md @@ -0,0 +1,7 @@ +unit_test_api.servers.server_0 +# Server Server0 + +## Url +https://someserver.com/v1 + +[[Back to top]](#top) [[Back to Servers]](../../README.md#Servers) [[Back to README]](../../README.md) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/migration_2_0_0.md b/samples/openapi3/client/3_0_3_unit_test/python/migration_2_0_0.md new file mode 100644 index 00000000000..ed19050a503 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/migration_2_0_0.md @@ -0,0 +1,203 @@ +# Migration v1.X.X to v2.0.0 + +- [Compatibility note for opeanpi-generator](#compatibility-note-for-opeanpi-generator) +- [Component Generation](#component-generation) +- [Packaging Changes](#packaging-changes) +- [Path Generation](#path-generation) +- [Configuration Info Refactored](#configuration-info-refactored) +- [Servers and Security Generation](#servers-and-security-generation) +- [Java Classes for Openapi Data Refactored](#java-classes-for-openapi-data-refactored) +- [Api Access by Tags and Paths Updated](#api-access-by-tags-and-paths-updated) +- [Some Method/Property/Input/Class Names Updated](#some-methodpropertyinputclass-names-updated) +- [Documentation Updated](#documentation-updated) + +## Compatibility note for opeanpi-generator +The v1.0.4 release is nearly identical to the openapi-generator v6.3.0 release + +Below is a summary of big changes when updating you code from v1.X.X to 2.0.0 + +## Component Generation +Update: +Openapi document components in "#/components/x" are now generated in a components/x packages +Ths applies to: +- headers +- parameters +- request_bodies +- responses +- schemas +- security_schemes + +The generator now writes a class for each of those generated components. + +### Reason +A lot of openapi data is $ref references throughout an openapi document. +With this update, those $ref source locations are generated with file system paths that closely mirror the openapi +document json schema path to that info. $ref definition is then imported in generated python code. +This minimizes the amount of code that is generated, imposes well defined encapsulation and allows templates to be +re-used for many types of data regardless of where the data is in the source openapi document. + +### Action +- Update where you are importing models from, models are now component schemas + - File path change: model/pet.py -> components/schema/pet.py + +## Packaging changes +Code has been updated to use .toml packaging. Code is now distributed in a src directory + +### Reason +These updates follow latest python packaging best practices + +### Action +- if you are suppressing generation of any files, you will need to edit those file paths + - File Path Change: package_name -> src/package_name + +## Path Generation +If paths contain inline descriptions of parameters, request bodies, responses, security, or servers, +then those are now generated in separate files. Those files are imported into the endpoint code. +File locations closely mirror the openapi data json schema path. + +### Reason +Generating those files in paths that closely mirror the json schema paths will allow +the generator to use $ref to any location in the openapi document in the future, not just components. +These could include: +- relative $refs +- a request body $ref referring to the request body in another endpoint + +This also allowed the generation code to work the same way regardless of where the header/requestBody etc +is in the source spec. + +Note: +Operations are now at +paths/somePath/get/operation.py +and not at +paths/somePath/get/__init__.py +to minimize the amount of memory needed when importing the python package. +The configurations.api_configuration.py file imports all servers defined at: +- openapi document root +- pathItem +- pathItem operation +And if servers were defined in pathItem operations, then every operation that contains a server would be imported +in api_configuration.py. Which could be many many files. + +So instead +- operation endpoint definition was moved to paths/somePath/get/operation.py +- paths/somePath/get/__init__.py stays empty and does not need lots of memory when api_configuration.py imports servers +- server information was kept in paths/somePath/get/servers/server_x.py + +### Action +- if you are importing any endpoint form its file, update your import + - File path update: paths/somePath/get.py -> paths/somePath/get/operation.py + +## Configuration Info Refactored +Configuration information was separated into two classes +- configurations/api_configuration.py ApiConfiguration for: + - server info + - security (auth) info + - logging info +- configurations/schema_configuration.py SchemaConfiguration for: + - disabled openapi/json-schema keywords + +### Reason +Schema validation only relies on SchemaConfiguration data and does not need to know about any ApiConfiguration info +General api configuration info was poorly structured in the legacy configuration class which had 13 inputs. +The refactored ApiConfiguration now has 4 inputs which define servers and security info. +Having these separate classes prevents circular imports when the schemas.py file imports its SchemaConfiguration class. + +### Action +- When you instantiate ApiClient, update your code to pass in an instance of SchemaConfiguration + ApiConfiguration + + +## Servers and Security Generation +Servers are now generated as separate files with one class per file wherever they were defined in the openapi document +- servers/server_0.py +- paths/somePath/servers/server_0.py +- paths/somePath/get/servers/server_0.py +Security requirements objects are now generated as separate files with one security requirement object per file +wherever they were defined in the openapi document +- security/security_requirement_object_0.py +- paths/somePath/get/security/security_requirement_object_0.py + +### Reason +Server classes now re-use schema validation code to ensure that inputs to server variables are valid. +Generating these separate files minimizes generated code and maximizes code re-use. + +### Action +- If endpoints need to use specific servers or security not at index 0, pass security_index_info + server_index_info + into ApiConfiguration when instantiating it +- If you use non-default server variable values, then update your code to pass in server_info into ApiConfiguration + +## Java Classes for Openapi Data Refactored +Almost every java class used to store openapi document data at generation time has been re-written or refactored. +The new classes are much shorter and contain only what is needed to generate code and documentation. +This will make it much easier to add new openapi v3.1.0 features like new json schema keywords. +Generator interface methods were also refactored to simplify Java model instantiation and code generation. +Almost all properties are now public static final and are: +- immutable +- publicly accessible to the templates + +### Reason +These updates make the code much more maintainable. +The number of properties that have to be maintained is much smaller +- Component Schema: ~100 properties in CodegenModel.java -> ~50 properties in CodegenSchema.java +- PathItem Operation: ~75 properties CodegenOperation: ~25 properties + +This will reduce bugs like: why can't I access this property in this template +Because instances are mostly immutable it is very clear where the wrong value is being created/assigned. + +### Action +- if you are customizing the python generator, you will need to update your java code + +## Api Access By Tags and Paths Updated +Previously, keys togo from tags and paths to apis were enums. +The code was updated to use a TypedDict and uses strings as the keys. + +### Reason +Making this change allows type hinting to work for the TypedDict with string keys + +### Action +- If you use path_to_api.py or tag_to_api.py, update the key that you use to access the api + +## Some Method/Property/Input/Class Names Updated +- is_true_oapg -> is_true_ +- is_false_oapg -> is_false_ +- is_none_oapg -> is_none_ +- as_date_oapg -> as_date_ +- as_datetime_oapg -> as_datetime_ +- as_decimal_oapg -> as_decimal_ +- as_uuid_oapg -> as_uuid_ +- as_float_oapg -> as_float_ +- as_int_oapg -> as_int_ +- get_item_oapg -> get_item_ +- from_openapi_data_oapg -> from_openapi_data_ +- _verify_typed_dict_inputs_oapg -> _verify_typed_dict_inputs +- _configuration -> configuration_ +- _arg -> arg_ +- _args -> args_ +- MetaOapg -> Schema_ +- JsonSchema -> OpenApiSchema + +### Reason +Classes can have arbitrarily named properties set on them +Endpoints can have arbitrary operationId method names set +For those reasons, I use the prefix and suffix _ to greatly reduce the likelihood of collisions +on protected + public classes/methods. + +### Action +- if you use the above methods/inputs/properties/classes update them to the latest names + +## Documentation Updated +- components now have sections in the readme + - models became component schemas +- one file is now generated for each endpoint + - that file now has a table of contents + - heading indentation levels now are indented correctly in descending order + - endpoint now includes server and security info (if security exists) +- servers section added to readme if servers were defined in the openapi document root +- security section added to readme if security was defined in the openapi document root + +### Reason +Endpoint documentation had indentation and linking bugs before, this fixes them. +When all endpoints docs were written in one file it was difficult to link ot the correct section. +How to set server and security info was unclear before, the new docs and classes should clarify that. + +### Action +- if you link to specific parts of the documentation, update your links \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/migration_other_python_generators.md b/samples/openapi3/client/3_0_3_unit_test/python/migration_other_python_generators.md new file mode 100644 index 00000000000..36ab6416ee0 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/migration_other_python_generators.md @@ -0,0 +1,92 @@ +# Migration from Other Python Generators + +When switching from other python client generators you will need to make some changes to your code. + +1. This generator uses spec case for all (object) property names and parameter names. + - So if the spec has a property name like camelCase, it will use camelCase rather than camel_case + - So you will need to update how you input and read properties to use spec case + - endpoint calls will need to have their input arguments updated + - schema instance property usage and instantiation will need to be updated +2. Endpoint parameters are stored in dictionaries to prevent collisions (explanation below) + - So you will need to update how you pass data in to endpoints + - update your endpoint calls to pass in parameter data in path_params, query_params, header_params etc dict inputs +3. Endpoint responses now include the original response, the deserialized response body, and (todo)the deserialized headers + - So you will need to update your code to use response.body to access deserialized data +4. All validated data is instantiated in an instance that subclasses all validated Schema classes and Decimal/str/tuple/frozendict/NoneClass/BoolClass/bytes/io.FileIO + - This means that you can use isinstance to check if a payload validated against a schema class + - This means that no data will be of type None/True/False + - ingested None will subclass NoneClass + - ingested True will subclass BoolClass + - ingested False will subclass BoolClass + - So if you need to check is True/False/None, instead use instance.is_true_()/.is_false_()/.is_none_() +5. All validated class instances are immutable except for ones based on io.File + - This is because if properties were changed after validation, that validation would no longer apply + - So no changing values or property values after a class has been instantiated +6. String + Number types with formats + - String type data is stored as a string and if you need to access types based on its format like date, + date-time, uuid, number etc then you will need to use accessor functions on the instance + - type string + format: See .as_date_, .as_datetime_, .as_decimal_, .as_uuid_ + - type number + format: See .as_float_, .as_int_ + - this was done because openapi/json-schema defines constraints. string data may be type string with no format + keyword in one schema, and include a format constraint in another schema + - So if you need to access a string format based type, use as_date_/as_datetime_/as_decimal_/as_uuid_ + - So if you need to access a number format based type, use as_int_/as_float_ +7. Property access on AnyType(type unset) or object(dict) schemas + - Only required keys with valid python names are properties like .someProp and have type hints + - All optional keys may not exist, so properties are not defined for them + - One can access optional values with dict_instance['optionalProp'] and KeyError will be raised if it does not exist + - Use get_item_ if you need a way to always get a value whether or not the key exists + - If the key does not exist, schemas.unset is returned from calling dict_instance.get_item_('optionalProp') + - All required and optional keys have type hints for this method, and @typing.overload is used + - A type hint is also generated for additionalProperties accessed using this method + - So you will need to update you code to use some_instance['optionalProp'] to access optional property + and additionalProperty values +8. The location of the api classes has changed + - Api classes are located in your_package.apis.tags.some_api + - This change was made to eliminate redundant code generation + - Legacy generators generated the same endpoint twice if it had > 1 tag on it + - This generator defines an endpoint in one class, then inherits that class to generate + apis by tags and by paths + - This change reduces code and allows quicker run time if you use the path apis + - path apis are at your_package.apis.paths.some_path + - Those apis will only load their needed models, which is less to load than all of the resources needed in a tag api + - So you will need to update your import paths to the api classes + +### Why are Leading and Trailing Underscores in class and method names? +Classes can have arbitrarily named properties set on them +Endpoints can have arbitrary operationId method names set +For those reasons, I use the prefix and suffix _ to greatly reduce the likelihood of collisions +on protected + public classes/methods. + +### Object property spec case +This was done because when payloads are ingested, they can be validated against N number of schemas. +If the input signature used a different property name then that has mutated the payload. +So SchemaA and SchemaB must both see the camelCase spec named variable. +Also it is possible to send in two properties, named camelCase and camel_case in the same payload. +That use case should work, so spec case is used. + +### Parameter spec case +Parameters can be included in different locations including: +- query +- path +- header +- cookie + +Any of those parameters could use the same parameter names, so if every parameter +was included as an endpoint parameter in a function signature, they would collide. +For that reason, each of those inputs have been separated out into separate typed dictionaries: +- query_params +- path_params +- header_params +- cookie_params + +So when updating your code, you will need to pass endpoint parameters in using those +dictionaries. + +### Endpoint responses +Endpoint responses have been enriched to now include more information. +Any response reom an endpoint will now include the following properties: +response: urllib3.HTTPResponse +body: typing.Union[Unset, Schema] +headers: typing.Union[Unset, TODO] +Note: response header deserialization has not yet been added \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/pom.xml b/samples/openapi3/client/3_0_3_unit_test/python/pom.xml index 5352ff0ac54..471179ed346 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/pom.xml +++ b/samples/openapi3/client/3_0_3_unit_test/python/pom.xml @@ -1,6 +1,6 @@ 4.0.0 - org.openapitools + org.openapijsonschematools PythonExperimental303UnitTests pom 1.0-SNAPSHOT diff --git a/samples/openapi3/client/3_0_3_unit_test/python/pyproject.toml b/samples/openapi3/client/3_0_3_unit_test/python/pyproject.toml new file mode 100644 index 00000000000..630189bc1b4 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/pyproject.toml @@ -0,0 +1,30 @@ +# Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + +[build-system] +requires = ["setuptools>=61.0"] +build-backend = "setuptools.build_meta" + +[project] +name = "unit-test-api" +version = "1.0.0" +authors = [ + { name="OpenAPI JSON Schema Generator community" }, +] +description = "openapi 3.0.3 sample spec" +readme = "README.md" +requires-python = ">=3.7" +dependencies = [ + "certifi >= 14.5.14", + "frozendict ~= 2.3.4", + "python-dateutil ~= 2.7.0", + "setuptools >= 61.0", + "typing_extensions ~= 4.5.0", + "urllib3 ~= 2.0.a3", +] +classifiers = [ + "Programming Language :: Python :: 3", + + "Operating System :: OS Independent", + "Topic :: Software Development :: Code Generators" +] + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/requirements.txt b/samples/openapi3/client/3_0_3_unit_test/python/requirements.txt deleted file mode 100644 index 3cb6612669d..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/requirements.txt +++ /dev/null @@ -1,6 +0,0 @@ -certifi >= 14.5.14 -frozendict ~= 2.3.4 -python-dateutil ~= 2.7.0 -setuptools >= 21.0.0 -typing_extensions ~= 4.3.0 -urllib3 ~= 1.26.7 diff --git a/samples/openapi3/client/3_0_3_unit_test/python/setup.cfg b/samples/openapi3/client/3_0_3_unit_test/python/setup.cfg deleted file mode 100644 index 11433ee875a..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/setup.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -max-line-length=99 diff --git a/samples/openapi3/client/3_0_3_unit_test/python/setup.py b/samples/openapi3/client/3_0_3_unit_test/python/setup.py deleted file mode 100644 index 1fc837120cf..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/setup.py +++ /dev/null @@ -1,47 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from setuptools import setup, find_packages # noqa: H301 - -NAME = "unit-test-api" -VERSION = "1.0.0" -# To install the library, run the following -# -# python setup.py install -# -# prerequisite: setuptools -# http://pypi.python.org/pypi/setuptools - -REQUIRES = [ - "certifi >= 14.5.14", - "frozendict ~= 2.3.4", - "python-dateutil ~= 2.7.0", - "setuptools >= 21.0.0", - "typing_extensions ~= 4.3.0", - "urllib3 ~= 1.26.7", -] - -setup( - name=NAME, - version=VERSION, - description="openapi 3.0.3 sample spec", - author="OpenAPI Generator community", - author_email="team@openapitools.org", - url="", - keywords=["OpenAPI", "OpenAPI-Generator", "openapi 3.0.3 sample spec"], - python_requires=">=3.7", - install_requires=REQUIRES, - packages=find_packages(exclude=["test", "tests"]), - include_package_data=True, - long_description="""\ - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - """ -) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/__init__.py new file mode 100644 index 00000000000..bb95eac5767 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/__init__.py @@ -0,0 +1,28 @@ +# coding: utf-8 + +# flake8: noqa + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +__version__ = "1.0.0" + +# import ApiClient +from unit_test_api.api_client import ApiClient + +# import Configuration +from unit_test_api.configurations.api_configuration import ApiConfiguration + +# import exceptions +from unit_test_api.exceptions import OpenApiException +from unit_test_api.exceptions import ApiAttributeError +from unit_test_api.exceptions import ApiTypeError +from unit_test_api.exceptions import ApiValueError +from unit_test_api.exceptions import ApiKeyError +from unit_test_api.exceptions import ApiException diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/api_client.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/api_client.py new file mode 100644 index 00000000000..da8dca96b2f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/api_client.py @@ -0,0 +1,1400 @@ +# coding: utf-8 +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime +import dataclasses +import decimal +import enum +import email +import json +import os +import io +import atexit +from multiprocessing import pool +import re +import tempfile +import typing +import typing_extensions +from urllib import parse +import urllib3 +from urllib3 import _collections, fields + +import frozendict + +from unit_test_api import exceptions, rest, schemas, security_schemes +from unit_test_api.configurations import schema_configuration, api_configuration + + +class RequestField(fields.RequestField): + def __eq__(self, other): + if not isinstance(other, RequestField): + return False + return self.__dict__ == other.__dict__ + + +class JSONEncoder(json.JSONEncoder): + compact_separators = (',', ':') + + def default(self, obj): + if isinstance(obj, str): + return str(obj) + elif isinstance(obj, float): + return float(obj) + elif isinstance(obj, int): + return int(obj) + elif isinstance(obj, decimal.Decimal): + if obj.as_tuple().exponent >= 0: + return int(obj) + return float(obj) + elif isinstance(obj, schemas.NoneClass): + return None + elif isinstance(obj, schemas.BoolClass): + return bool(obj) + elif isinstance(obj, (dict, frozendict.frozendict)): + return {key: self.default(val) for key, val in obj.items()} + elif isinstance(obj, (list, tuple)): + return [self.default(item) for item in obj] + raise exceptions.ApiValueError('Unable to prepare type {} for serialization'.format(obj.__class__.__name__)) + + +class ParameterInType(enum.Enum): + QUERY = 'query' + HEADER = 'header' + PATH = 'path' + COOKIE = 'cookie' + + +class ParameterStyle(enum.Enum): + MATRIX = 'matrix' + LABEL = 'label' + FORM = 'form' + SIMPLE = 'simple' + SPACE_DELIMITED = 'spaceDelimited' + PIPE_DELIMITED = 'pipeDelimited' + DEEP_OBJECT = 'deepObject' + + +class PrefixSeparatorIterator: + # A class to store prefixes and separators for rfc6570 expansions + + def __init__(self, prefix: str, separator: str): + self.prefix = prefix + self.separator = separator + self.first = True + if separator in {'.', '|', '%20'}: + item_separator = separator + else: + item_separator = ',' + self.item_separator = item_separator + + def __iter__(self): + return self + + def __next__(self): + if self.first: + self.first = False + return self.prefix + return self.separator + + +class ParameterSerializerBase: + @staticmethod + def __ref6570_item_value(in_data: typing.Any, percent_encode: bool): + """ + Get representation if str/float/int/None/items in list/ values in dict + None is returned if an item is undefined, use cases are value= + - None + - [] + - {} + - [None, None None] + - {'a': None, 'b': None} + """ + if type(in_data) in {str, float, int}: + if percent_encode: + return parse.quote(str(in_data)) + return str(in_data) + elif isinstance(in_data, schemas.none_type_): + # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 + return None + elif isinstance(in_data, list) and not in_data: + # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 + return None + elif isinstance(in_data, dict) and not in_data: + # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 + return None + raise exceptions.ApiValueError('Unable to generate a ref6570 item representation of {}'.format(in_data)) + + @staticmethod + def _to_dict(name: str, value: str): + return {name: value} + + @classmethod + def __ref6570_str_float_int_expansion( + cls, + variable_name: str, + in_data: typing.Any, + explode: bool, + percent_encode: bool, + prefix_separator_iterator: PrefixSeparatorIterator, + var_name_piece: str, + named_parameter_expansion: bool + ) -> str: + item_value = cls.__ref6570_item_value(in_data, percent_encode) + if item_value is None or (item_value == '' and prefix_separator_iterator.separator == ';'): + return next(prefix_separator_iterator) + var_name_piece + value_pair_equals = '=' if named_parameter_expansion else '' + return next(prefix_separator_iterator) + var_name_piece + value_pair_equals + item_value + + @classmethod + def __ref6570_list_expansion( + cls, + variable_name: str, + in_data: typing.Any, + explode: bool, + percent_encode: bool, + prefix_separator_iterator: PrefixSeparatorIterator, + var_name_piece: str, + named_parameter_expansion: bool + ) -> str: + item_values = [cls.__ref6570_item_value(v, percent_encode) for v in in_data] + item_values = [v for v in item_values if v is not None] + if not item_values: + # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 + return "" + value_pair_equals = '=' if named_parameter_expansion else '' + if not explode: + return ( + next(prefix_separator_iterator) + + var_name_piece + + value_pair_equals + + prefix_separator_iterator.item_separator.join(item_values) + ) + # exploded + return next(prefix_separator_iterator) + next(prefix_separator_iterator).join( + [var_name_piece + value_pair_equals + val for val in item_values] + ) + + @classmethod + def __ref6570_dict_expansion( + cls, + variable_name: str, + in_data: typing.Any, + explode: bool, + percent_encode: bool, + prefix_separator_iterator: PrefixSeparatorIterator, + var_name_piece: str, + named_parameter_expansion: bool + ) -> str: + in_data_transformed = {key: cls.__ref6570_item_value(val, percent_encode) for key, val in in_data.items()} + in_data_transformed = {key: val for key, val in in_data_transformed.items() if val is not None} + if not in_data_transformed: + # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 + return "" + value_pair_equals = '=' if named_parameter_expansion else '' + if not explode: + return ( + next(prefix_separator_iterator) + + var_name_piece + value_pair_equals + + prefix_separator_iterator.item_separator.join( + prefix_separator_iterator.item_separator.join( + item_pair + ) for item_pair in in_data_transformed.items() + ) + ) + # exploded + return next(prefix_separator_iterator) + next(prefix_separator_iterator).join( + [key + '=' + val for key, val in in_data_transformed.items()] + ) + + @classmethod + def _ref6570_expansion( + cls, + variable_name: str, + in_data: typing.Any, + explode: bool, + percent_encode: bool, + prefix_separator_iterator: PrefixSeparatorIterator + ) -> str: + """ + Separator is for separate variables like dict with explode true, not for array item separation + """ + named_parameter_expansion = prefix_separator_iterator.separator in {'&', ';'} + var_name_piece = variable_name if named_parameter_expansion else '' + if type(in_data) in {str, float, int}: + return cls.__ref6570_str_float_int_expansion( + variable_name, + in_data, + explode, + percent_encode, + prefix_separator_iterator, + var_name_piece, + named_parameter_expansion + ) + elif isinstance(in_data, schemas.none_type_): + # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 + return "" + elif isinstance(in_data, list): + return cls.__ref6570_list_expansion( + variable_name, + in_data, + explode, + percent_encode, + prefix_separator_iterator, + var_name_piece, + named_parameter_expansion + ) + elif isinstance(in_data, dict): + return cls.__ref6570_dict_expansion( + variable_name, + in_data, + explode, + percent_encode, + prefix_separator_iterator, + var_name_piece, + named_parameter_expansion + ) + # bool, bytes, etc + raise exceptions.ApiValueError('Unable to generate a ref6570 representation of {}'.format(in_data)) + + +class StyleFormSerializer(ParameterSerializerBase): + @classmethod + def _serialize_form( + cls, + in_data: typing.Union[None, int, float, str, bool, dict, list], + name: str, + explode: bool, + percent_encode: bool, + prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] = None + ) -> str: + if prefix_separator_iterator is None: + prefix_separator_iterator = PrefixSeparatorIterator('', '&') + return cls._ref6570_expansion( + variable_name=name, + in_data=in_data, + explode=explode, + percent_encode=percent_encode, + prefix_separator_iterator=prefix_separator_iterator + ) + + +class StyleSimpleSerializer(ParameterSerializerBase): + + @classmethod + def _serialize_simple( + cls, + in_data: typing.Union[None, int, float, str, bool, dict, list], + name: str, + explode: bool, + percent_encode: bool + ) -> str: + prefix_separator_iterator = PrefixSeparatorIterator('', ',') + return cls._ref6570_expansion( + variable_name=name, + in_data=in_data, + explode=explode, + percent_encode=percent_encode, + prefix_separator_iterator=prefix_separator_iterator + ) + + @classmethod + def _deserialize_simple( + cls, + in_data: str, + name: str, + explode: bool, + percent_encode: bool + ) -> typing.Union[str, typing.List[str], typing.Dict[str, str]]: + raise NotImplementedError( + "Deserialization of style=simple has not yet been added. " + "If you need this how about you submit a PR adding it?" + ) + + +class JSONDetector: + """ + Works for: + application/json + application/json; charset=UTF-8 + application/json-patch+json + application/geo+json + """ + __json_content_type_pattern = re.compile("application/[^+]*[+]?(json);?.*") + + @classmethod + def _content_type_is_json(cls, content_type: str) -> bool: + if cls.__json_content_type_pattern.match(content_type): + return True + return False + + +class Encoding: + def __init__( + self, + content_type: str, + headers: typing.Optional[typing.Dict[str, 'HeaderParameter']] = None, + style: typing.Optional[ParameterStyle] = None, + explode: bool = False, + allow_reserved: bool = False, + ): + self.content_type = content_type + self.headers = headers + self.style = style + self.explode = explode + self.allow_reserved = allow_reserved + + +@dataclasses.dataclass +class MediaType: + """ + Used to store request and response body schema information + encoding: + A map between a property name and its encoding information. + The key, being the property name, MUST exist in the schema as a property. + The encoding object SHALL only apply to requestBody objects when the media type is + multipart or application/x-www-form-urlencoded. + """ + schema: typing.Optional[typing.Type[schemas.Schema]] = None + encoding: typing.Optional[typing.Dict[str, Encoding]] = None + + +@dataclasses.dataclass +class ParameterBase(JSONDetector): + in_type: ParameterInType + required: bool + style: typing.Optional[ParameterStyle] + explode: typing.Optional[bool] + allow_reserved: typing.Optional[bool] + schema: typing.Optional[typing.Type[schemas.Schema]] + content: typing.Optional[typing.Dict[str, typing.Type[MediaType]]] + + _json_encoder = JSONEncoder() + + def __init_subclass__(cls, **kwargs): + if cls.explode is None: + if cls.style is ParameterStyle.FORM: + cls.explode = True + else: + cls.explode = False + + @classmethod + def _serialize_json( + cls, + in_data: typing.Union[None, int, float, str, bool, dict, list], + eliminate_whitespace: bool = False + ) -> str: + if eliminate_whitespace: + return json.dumps(in_data, separators=cls._json_encoder.compact_separators) + return json.dumps(in_data) + + +class PathParameter(ParameterBase, StyleSimpleSerializer): + name: str + required: bool = False + in_type: ParameterInType = ParameterInType.PATH + style: ParameterStyle = ParameterStyle.SIMPLE + explode: bool = False + allow_reserved: typing.Optional[bool] = None + schema: typing.Optional[typing.Type[schemas.Schema]] = None + content: typing.Optional[typing.Dict[str, typing.Type[schemas.Schema]]] = None + + @classmethod + def __serialize_label( + cls, + in_data: typing.Union[None, int, float, str, bool, dict, list] + ) -> typing.Dict[str, str]: + prefix_separator_iterator = PrefixSeparatorIterator('.', '.') + value = cls._ref6570_expansion( + variable_name=cls.name, + in_data=in_data, + explode=cls.explode, + percent_encode=True, + prefix_separator_iterator=prefix_separator_iterator + ) + return cls._to_dict(cls.name, value) + + @classmethod + def __serialize_matrix( + cls, + in_data: typing.Union[None, int, float, str, bool, dict, list] + ) -> typing.Dict[str, str]: + prefix_separator_iterator = PrefixSeparatorIterator(';', ';') + value = cls._ref6570_expansion( + variable_name=cls.name, + in_data=in_data, + explode=cls.explode, + percent_encode=True, + prefix_separator_iterator=prefix_separator_iterator + ) + return cls._to_dict(cls.name, value) + + @classmethod + def __serialize_simple( + cls, + in_data: typing.Union[None, int, float, str, bool, dict, list], + ) -> typing.Dict[str, str]: + value = cls._serialize_simple( + in_data=in_data, + name=cls.name, + explode=cls.explode, + percent_encode=True + ) + return cls._to_dict(cls.name, value) + + @classmethod + def serialize( + cls, + in_data: typing.Union[ + schemas.Schema, decimal.Decimal, int, float, str, datetime.date, datetime.datetime, None, bool, list, tuple, dict, frozendict.frozendict] + ) -> typing.Dict[str, str]: + if cls.schema: + cast_in_data = cls.schema(in_data) + cast_in_data = cls._json_encoder.default(cast_in_data) + """ + simple -> path + path: + returns path_params: dict + label -> path + returns path_params + matrix -> path + returns path_params + """ + if cls.style: + if cls.style is ParameterStyle.SIMPLE: + return cls.__serialize_simple(cast_in_data) + elif cls.style is ParameterStyle.LABEL: + return cls.__serialize_label(cast_in_data) + elif cls.style is ParameterStyle.MATRIX: + return cls.__serialize_matrix(cast_in_data) + # cls.content will be length one + for content_type, schema in cls.content.items(): + cast_in_data = schema(in_data) + cast_in_data = cls._json_encoder.default(cast_in_data) + if cls._content_type_is_json(content_type): + value = cls._serialize_json(cast_in_data) + return cls._to_dict(cls.name, value) + raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) + + +class QueryParameter(ParameterBase, StyleFormSerializer): + name: str + required: bool = False + in_type: ParameterInType = ParameterInType.QUERY + style: ParameterStyle = ParameterStyle.FORM + explode: typing.Optional[bool] = None + allow_reserved: typing.Optional[bool] = None + schema: typing.Optional[typing.Type[schemas.Schema]] = None + content: typing.Optional[typing.Dict[str, typing.Type[schemas.Schema]]] = None + + @classmethod + def __serialize_space_delimited( + cls, + in_data: typing.Union[None, int, float, str, bool, dict, list], + prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] + ) -> typing.Dict[str, str]: + if prefix_separator_iterator is None: + prefix_separator_iterator = cls.get_prefix_separator_iterator() + value = cls._ref6570_expansion( + variable_name=cls.name, + in_data=in_data, + explode=cls.explode, + percent_encode=True, + prefix_separator_iterator=prefix_separator_iterator + ) + return cls._to_dict(cls.name, value) + + @classmethod + def __serialize_pipe_delimited( + cls, + in_data: typing.Union[None, int, float, str, bool, dict, list], + prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] + ) -> typing.Dict[str, str]: + if prefix_separator_iterator is None: + prefix_separator_iterator = cls.get_prefix_separator_iterator() + value = cls._ref6570_expansion( + variable_name=cls.name, + in_data=in_data, + explode=cls.explode, + percent_encode=True, + prefix_separator_iterator=prefix_separator_iterator + ) + return cls._to_dict(cls.name, value) + + @classmethod + def __serialize_form( + cls, + in_data: typing.Union[None, int, float, str, bool, dict, list], + prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] + ) -> typing.Dict[str, str]: + if prefix_separator_iterator is None: + prefix_separator_iterator = cls.get_prefix_separator_iterator() + value = cls._serialize_form( + in_data, + name=cls.name, + explode=cls.explode, + percent_encode=True, + prefix_separator_iterator=prefix_separator_iterator + ) + return cls._to_dict(cls.name, value) + + @classmethod + def get_prefix_separator_iterator(cls) -> typing.Optional[PrefixSeparatorIterator]: + if cls.style is ParameterStyle.FORM: + return PrefixSeparatorIterator('?', '&') + elif cls.style is ParameterStyle.SPACE_DELIMITED: + return PrefixSeparatorIterator('', '%20') + elif cls.style is ParameterStyle.PIPE_DELIMITED: + return PrefixSeparatorIterator('', '|') + + @classmethod + def serialize( + cls, + in_data: typing.Union[ + schemas.Schema, decimal.Decimal, int, float, str, datetime.date, datetime.datetime, None, bool, list, tuple, dict, frozendict.frozendict], + prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] = None + ) -> typing.Dict[str, str]: + if cls.schema: + cast_in_data = cls.schema(in_data) + cast_in_data = cls._json_encoder.default(cast_in_data) + """ + form -> query + query: + - GET/HEAD/DELETE: could use fields + - PUT/POST: must use urlencode to send parameters + returns fields: tuple + spaceDelimited -> query + returns fields + pipeDelimited -> query + returns fields + deepObject -> query, https://github.com/OAI/OpenAPI-Specification/issues/1706 + returns fields + """ + if cls.style: + # TODO update query ones to omit setting values when [] {} or None is input + if cls.style is ParameterStyle.FORM: + return cls.__serialize_form(cast_in_data, prefix_separator_iterator) + elif cls.style is ParameterStyle.SPACE_DELIMITED: + return cls.__serialize_space_delimited(cast_in_data, prefix_separator_iterator) + elif cls.style is ParameterStyle.PIPE_DELIMITED: + return cls.__serialize_pipe_delimited(cast_in_data, prefix_separator_iterator) + # cls.content will be length one + if prefix_separator_iterator is None: + prefix_separator_iterator = cls.get_prefix_separator_iterator() + for content_type, media_type in cls.content.items(): + cast_in_data = media_type.schema(in_data) + cast_in_data = cls._json_encoder.default(cast_in_data) + if cls._content_type_is_json(content_type): + value = cls._serialize_json(cast_in_data, eliminate_whitespace=True) + return cls._to_dict( + cls.name, + next(prefix_separator_iterator) + cls.name + '=' + parse.quote(value) + ) + raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) + + +class CookieParameter(ParameterBase, StyleFormSerializer): + name: str + required: bool = False + style: ParameterStyle = ParameterStyle.FORM + in_type: ParameterInType = ParameterInType.COOKIE + explode: typing.Optional[bool] = None + allow_reserved: typing.Optional[bool] = None + schema: typing.Optional[typing.Type[schemas.Schema]] = None + content: typing.Optional[typing.Dict[str, typing.Type[schemas.Schema]]] = None + + @classmethod + def serialize( + cls, + in_data: typing.Union[ + schemas.Schema, decimal.Decimal, int, float, str, datetime.date, datetime.datetime, None, bool, list, tuple, dict, frozendict.frozendict] + ) -> typing.Dict[str, str]: + if cls.schema: + cast_in_data = cls.schema(in_data) + cast_in_data = cls._json_encoder.default(cast_in_data) + """ + form -> cookie + returns fields: tuple + """ + if cls.style: + """ + TODO add escaping of comma, space, equals + or turn encoding on + """ + value = cls._serialize_form( + cast_in_data, + explode=cls.explode, + name=cls.name, + percent_encode=False, + prefix_separator_iterator=PrefixSeparatorIterator('', '&') + ) + return cls._to_dict(cls.name, value) + # cls.content will be length one + for content_type, media_type in cls.content.items(): + cast_in_data = media_type.schema(in_data) + cast_in_data = cls._json_encoder.default(cast_in_data) + if cls._content_type_is_json(content_type): + value = cls._serialize_json(cast_in_data) + return cls._to_dict(cls.name, value) + raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) + + +class HeaderParameterWithoutName(ParameterBase, StyleSimpleSerializer): + required: bool = False + style: ParameterStyle = ParameterStyle.SIMPLE + in_type: ParameterInType = ParameterInType.HEADER + explode: bool = False + allow_reserved: typing.Optional[bool] = None + schema: typing.Optional[typing.Type[schemas.Schema]] = None + content: typing.Optional[typing.Dict[str, typing.Type[schemas.Schema]]] = None + + @staticmethod + def __to_headers(in_data: typing.Tuple[typing.Tuple[str, str], ...]) -> _collections.HTTPHeaderDict: + data = tuple(t for t in in_data if t) + headers = _collections.HTTPHeaderDict() + if not data: + return headers + headers.extend(data) + return headers + + @classmethod + def serialize( + cls, + in_data: typing.Union[ + schemas.Schema, decimal.Decimal, int, float, str, datetime.date, datetime.datetime, None, bool, list, tuple, dict, frozendict.frozendict], + name: str + ) -> _collections.HTTPHeaderDict: + if cls.schema: + cast_in_data = cls.schema(in_data) + cast_in_data = cls._json_encoder.default(cast_in_data) + """ + simple -> header + headers: PoolManager needs a mapping, tuple is close + returns headers: dict + """ + if cls.style: + value = cls._serialize_simple(cast_in_data, name, cls.explode, False) + return cls.__to_headers(((name, value),)) + # cls.content will be length one + for content_type, media_type in cls.content.items(): + cast_in_data = media_type.schema(in_data) + cast_in_data = cls._json_encoder.default(cast_in_data) + if cls._content_type_is_json(content_type): + value = cls._serialize_json(cast_in_data) + return cls.__to_headers(((name, value),)) + raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) + + @classmethod + def deserialize( + cls, + in_data: str, + name: str + ) -> schemas.Schema: + if cls.schema: + """ + simple -> header + headers: PoolManager needs a mapping, tuple is close + returns headers: dict + """ + if cls.style: + extracted_data = cls._deserialize_simple(in_data, name, cls.explode, False) + return cls.schema.from_openapi_data_(extracted_data) + # cls.content will be length one + for content_type, media_type in cls.content.items(): + if cls._content_type_is_json(content_type): + cast_in_data = json.loads(in_data) + return media_type.schema.from_openapi_data_(cast_in_data) + raise NotImplementedError('Deserialization of {} has not yet been implemented'.format(content_type)) + + +class HeaderParameter(HeaderParameterWithoutName): + name: str + + @classmethod + def serialize( + cls, + in_data: typing.Union[ + schemas.Schema, decimal.Decimal, int, float, str, datetime.date, datetime.datetime, None, bool, list, tuple, dict, frozendict.frozendict] + ) -> _collections.HTTPHeaderDict: + return super().serialize( + in_data, + cls.name + ) + + +@dataclasses.dataclass +class ApiResponse: + response: urllib3.HTTPResponse + body: typing.Union[schemas.Unset, schemas.Schema] = schemas.unset + headers: typing.Union[schemas.Unset, typing.Dict[str, schemas.Schema]] = schemas.unset + + def __init__( + self, + response: urllib3.HTTPResponse, + body: typing.Union[schemas.Unset, schemas.Schema] = schemas.unset, + headers: typing.Union[schemas.Unset, typing.Dict[str, schemas.Schema]] = schemas.unset + ): + """ + pycharm needs this to prevent 'Unexpected argument' warnings + """ + self.response = response + self.body = body + self.headers = headers + + +@dataclasses.dataclass +class ApiResponseWithoutDeserialization(ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[schemas.Unset, schemas.Schema] = schemas.unset + headers: typing.Union[schemas.Unset, typing.Dict[str, schemas.Schema]] = schemas.unset + + +class TypedDictInputVerifier: + @staticmethod + def _verify_typed_dict_inputs(cls: typing.Type[typing_extensions.TypedDict], data: typing.Dict[str, typing.Any]): + """ + Ensures that: + - required keys are present + - additional properties are not input + - value stored under required keys do not have the value schemas.unset + Note: detailed value checking is done in schema classes + """ + missing_required_keys = [] + required_keys_with_unset_values = [] + for required_key in cls.__required_keys__: + if required_key not in data: + missing_required_keys.append(required_key) + continue + value = data[required_key] + if value is schemas.unset: + required_keys_with_unset_values.append(required_key) + if missing_required_keys: + raise exceptions.ApiTypeError( + '{} missing {} required arguments: {}'.format( + cls.__name__, len(missing_required_keys), missing_required_keys + ) + ) + if required_keys_with_unset_values: + raise exceptions.ApiValueError( + '{} contains invalid unset values for {} required keys: {}'.format( + cls.__name__, len(required_keys_with_unset_values), required_keys_with_unset_values + ) + ) + + disallowed_additional_keys = [] + for key in data: + if key in cls.__required_keys__ or key in cls.__optional_keys__: + continue + disallowed_additional_keys.append(key) + if disallowed_additional_keys: + raise exceptions.ApiTypeError( + '{} got {} unexpected keyword arguments: {}'.format( + cls.__name__, len(disallowed_additional_keys), disallowed_additional_keys + ) + ) + + +T = typing.TypeVar("T") + + +@dataclasses.dataclass +class OpenApiResponse(JSONDetector, TypedDictInputVerifier, typing.Generic[T]): + __filename_content_disposition_pattern = re.compile('filename="(.+?)"') + response_cls: typing.Type[T] + content: typing.Optional[typing.Dict[str, MediaType]] = None + headers: typing.Optional[typing.Dict[str, HeaderParameterWithoutName]] = None + + @staticmethod + def __deserialize_json(response: urllib3.HTTPResponse) -> typing.Any: + # python must be >= 3.9 so we can pass in bytes into json.loads + return json.loads(response.data) + + @staticmethod + def __file_name_from_response_url(response_url: typing.Optional[str]) -> typing.Optional[str]: + if response_url is None: + return None + url_path = parse.urlparse(response_url).path + if url_path: + path_basename = os.path.basename(url_path) + if path_basename: + _filename, ext = os.path.splitext(path_basename) + if ext: + return path_basename + return None + + @classmethod + def __file_name_from_content_disposition(cls, content_disposition: typing.Optional[str]) -> typing.Optional[str]: + if content_disposition is None: + return None + match = cls.__filename_content_disposition_pattern.search(content_disposition) + if not match: + return None + return match.group(1) + + @classmethod + def __deserialize_application_octet_stream( + cls, response: urllib3.HTTPResponse + ) -> typing.Union[bytes, io.BufferedReader]: + """ + urllib3 use cases: + 1. when preload_content=True (stream=False) then supports_chunked_reads is False and bytes are returned + 2. when preload_content=False (stream=True) then supports_chunked_reads is True and + a file will be written and returned + """ + if response.supports_chunked_reads(): + file_name = ( + cls.__file_name_from_content_disposition(response.headers.get('content-disposition')) + or cls.__file_name_from_response_url(response.geturl()) + ) + + if file_name is None: + _fd, path = tempfile.mkstemp() + else: + path = os.path.join(tempfile.gettempdir(), file_name) + + with open(path, 'wb') as new_file: + chunk_size = 1024 + while True: + data = response.read(chunk_size) + if not data: + break + new_file.write(data) + # release_conn is needed for streaming connections only + response.release_conn() + new_file = open(path, 'rb') + return new_file + else: + return response.data + + @staticmethod + def __deserialize_multipart_form_data( + response: urllib3.HTTPResponse + ) -> typing.Dict[str, typing.Any]: + msg = email.message_from_bytes(response.data) + return { + part.get_param("name", header="Content-Disposition"): part.get_payload( + decode=True + ).decode(part.get_content_charset()) + if part.get_content_charset() + else part.get_payload() + for part in msg.get_payload() + } + + @classmethod + def deserialize(cls, response: urllib3.HTTPResponse, configuration: schema_configuration.SchemaConfiguration) -> T: + content_type = response.headers.get('content-type') + deserialized_body = schemas.unset + streamed = response.supports_chunked_reads() + + deserialized_headers = schemas.unset + if cls.headers is not None: + cls._verify_typed_dict_inputs(cls.response_cls.headers, response.headers) + deserialized_headers = {} + for header_name, header_param in cls.headers.items(): + header_value = response.headers.get(header_name) + if header_value is None: + continue + header_value = header_param.deserialize(header_value, header_name) + deserialized_headers[header_name] = header_value + + if cls.content is not None: + if content_type not in cls.content: + raise exceptions.ApiValueError( + f"Invalid content_type returned. Content_type='{content_type}' was returned " + f"when only {str(set(cls.content))} are defined for status_code={str(response.status)}" + ) + body_schema = cls.content[content_type].schema + if body_schema is None: + # some specs do not define response content media type schemas + return cls.response_cls( + response=response, + headers=deserialized_headers, + body=schemas.unset + ) + + if cls._content_type_is_json(content_type): + body_data = cls.__deserialize_json(response) + elif content_type == 'application/octet-stream': + body_data = cls.__deserialize_application_octet_stream(response) + elif content_type.startswith('multipart/form-data'): + body_data = cls.__deserialize_multipart_form_data(response) + content_type = 'multipart/form-data' + else: + raise NotImplementedError('Deserialization of {} has not yet been implemented'.format(content_type)) + deserialized_body = body_schema.from_openapi_data_( + body_data, configuration_=configuration) + elif streamed: + response.release_conn() + + return cls.response_cls( + response=response, + headers=deserialized_headers, + body=deserialized_body + ) + + +class ApiClient: + """Generic API client for OpenAPI client library builds. + + OpenAPI generic API client. This client handles the client- + server communication, and is invariant across implementations. Specifics of + the methods and models for each application are generated from the OpenAPI + templates. + + NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + Do not edit the class manually. + + :param configuration: api_configuration.ApiConfiguration object for this client + :param schema_configuration: schema_configuration.SchemaConfiguration object for this client + :param header_name: a header to pass when making calls to the API. + :param header_value: a header value to pass when making calls to + the API. + :param cookie: a cookie to include in the header when making calls + to the API + :param pool_threads: The number of threads to use for async requests + to the API. More threads means more concurrent API requests. + """ + + _pool = None + + def __init__( + self, + configuration: typing.Optional[api_configuration.ApiConfiguration] = None, + schema_config: typing.Optional[schema_configuration.SchemaConfiguration] = None, + header_name: typing.Optional[str] = None, + header_value: typing.Optional[str] = None, + cookie: typing.Optional[str] = None, + pool_threads: int = 1 + ): + self.configuration: api_configuration.ApiConfiguration = configuration or api_configuration.ApiConfiguration() + self.schema_configuration: schema_configuration.SchemaConfiguration = schema_config or schema_configuration.SchemaConfiguration() + self.pool_threads = pool_threads + self.rest_client = rest.RESTClientObject(self.configuration) + self.default_headers = _collections.HTTPHeaderDict() + if header_name is not None: + self.default_headers[header_name] = header_value + self.cookie = cookie + # Set default User-Agent. + self.user_agent = 'OpenAPI-JSON-Schema-Generator/1.0.0/python' + + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_value, traceback): + self.close() + + def close(self): + if self._pool: + self._pool.close() + self._pool.join() + self._pool = None + if hasattr(atexit, 'unregister'): + atexit.unregister(self.close) + + @property + def pool(self): + """Create thread pool on first request + avoids instantiating unused threadpool for blocking clients. + """ + if self._pool is None: + atexit.register(self.close) + self._pool = pool.ThreadPool(self.pool_threads) + return self._pool + + @property + def user_agent(self): + """User agent for this API client""" + return self.default_headers['User-Agent'] + + @user_agent.setter + def user_agent(self, value): + self.default_headers['User-Agent'] = value + + def set_default_header(self, header_name, header_value): + self.default_headers[header_name] = header_value + + def __call_api( + self, + resource_path: str, + method: str, + host: str, + headers: typing.Optional[_collections.HTTPHeaderDict] = None, + body: typing.Optional[typing.Union[str, bytes]] = None, + fields: typing.Optional[typing.Tuple[typing.Tuple[str, str], ...]] = None, + security_requirement_object: typing.Optional[security_schemes.SecurityRequirementObject] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> urllib3.HTTPResponse: + + # header parameters + used_headers = _collections.HTTPHeaderDict(self.default_headers) + if self.cookie: + headers['Cookie'] = self.cookie + + # auth setting + self.update_params_for_auth( + used_headers, + security_requirement_object, + resource_path, + method, + body + ) + + # must happen after cookie setting and auth setting in case user is overriding those + if headers: + used_headers.update(headers) + + # request url + url = host + resource_path + + # perform request and return response + response = self.request( + method, + url, + headers=used_headers, + fields=fields, + body=body, + stream=stream, + timeout=timeout, + ) + return response + + def call_api( + self, + resource_path: str, + method: str, + host: str, + headers: typing.Optional[_collections.HTTPHeaderDict] = None, + body: typing.Optional[typing.Union[str, bytes]] = None, + fields: typing.Optional[typing.Tuple[typing.Tuple[str, str], ...]] = None, + security_requirement_object: typing.Optional[security_schemes.SecurityRequirementObject] = None, + async_req: typing.Optional[bool] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> urllib3.HTTPResponse: + """Makes the HTTP request (synchronous) and returns deserialized data. + + To make an async_req request, set the async_req parameter. + + :param resource_path: Path to method endpoint. + :param method: Method to call. + :param headers: Header parameters to be + placed in the request header. + :param body: Request body. + :param fields: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data` + :param security_requirement_object: The security requirement object, used to apply auth when making the call + :param async_req: execute request asynchronously + :type async_req: bool, optional TODO remove, unused + :param stream: if True, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Also when True, if the openapi spec describes a file download, + the data will be written to a local filesystem file and the schemas.BinarySchema + instance will also inherit from FileSchema and schemas.FileIO + Default is False. + :type stream: bool, optional + :param timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param host: api endpoint host + :return: + If async_req parameter is True, + the request will be called asynchronously. + The method will return the request thread. + If parameter async_req is False or missing, + then the method will return the response directly. + """ + + if not async_req: + return self.__call_api( + resource_path, + method, + host, + headers, + body, + fields, + security_requirement_object, + stream, + timeout, + ) + + return self.pool.apply_async( + self.__call_api, + ( + resource_path, + method, + host, + headers, + body, + json, + fields, + security_requirement_object, + stream, + timeout, + ) + ) + + def request( + self, + method: str, + url: str, + headers: typing.Optional[_collections.HTTPHeaderDict] = None, + fields: typing.Optional[typing.Tuple[typing.Tuple[str, str], ...]] = None, + body: typing.Optional[typing.Union[str, bytes]] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> urllib3.HTTPResponse: + """Makes the HTTP request using RESTClient.""" + if method == "get": + return self.rest_client.get(url, + stream=stream, + timeout=timeout, + headers=headers) + elif method == "head": + return self.rest_client.head(url, + stream=stream, + timeout=timeout, + headers=headers) + elif method == "options": + return self.rest_client.options(url, + headers=headers, + fields=fields, + stream=stream, + timeout=timeout, + body=body) + elif method == "post": + return self.rest_client.post(url, + headers=headers, + fields=fields, + stream=stream, + timeout=timeout, + body=body) + elif method == "put": + return self.rest_client.put(url, + headers=headers, + fields=fields, + stream=stream, + timeout=timeout, + body=body) + elif method == "patch": + return self.rest_client.patch(url, + headers=headers, + fields=fields, + stream=stream, + timeout=timeout, + body=body) + elif method == "delete": + return self.rest_client.delete(url, + headers=headers, + stream=stream, + timeout=timeout, + body=body) + else: + raise exceptions.ApiValueError( + "http method must be `GET`, `HEAD`, `OPTIONS`," + " `POST`, `PATCH`, `PUT` or `DELETE`." + ) + + def update_params_for_auth( + self, + headers: _collections.HTTPHeaderDict, + security_requirement_object: typing.Optional[security_schemes.SecurityRequirementObject], + resource_path: str, + method: str, + body: typing.Optional[typing.Union[str, bytes]] = None + ): + """Updates header and query params based on authentication setting. + + :param headers: Header parameters dict to be updated. + :param security_requirement_object: the openapi security requirement object + :param resource_path: A string representation of the HTTP request resource path. + :param method: A string representation of the HTTP request method. + :param body: A object representing the body of the HTTP request. + The object type is the return value of _encoder.default(). + """ + if not security_requirement_object: + # optional auth cause, use no auth + return + for security_scheme_component_name, scope_names in security_requirement_object.items(): + security_scheme_instance = self.configuration.security_scheme_info[security_scheme_component_name] + security_scheme_instance.apply_auth( + headers, + resource_path, + method, + body, + scope_names + ) + + +class Api(TypedDictInputVerifier): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + def __init__(self, api_client: typing.Optional[ApiClient] = None): + self.api_client: ApiClient = api_client or ApiClient() + + +class SerializedRequestBody(typing_extensions.TypedDict, total=False): + body: typing.Union[str, bytes] + fields: typing.Tuple[typing.Union[RequestField, typing.Tuple[str, str]], ...] + + +class RequestBody(StyleFormSerializer, JSONDetector): + """ + A request body parameter + content: content_type to MediaType schemas.Schema info + """ + __json_encoder = JSONEncoder() + content: typing.Dict[str, MediaType] + required: bool = False + + @classmethod + def __serialize_json( + cls, + in_data: typing.Any + ) -> typing.Dict[str, bytes]: + in_data = cls.__json_encoder.default(in_data) + json_str = json.dumps(in_data, separators=(",", ":"), ensure_ascii=False).encode( + "utf-8" + ) + return dict(body=json_str) + + @staticmethod + def __serialize_text_plain(in_data: typing.Any) -> typing.Dict[str, str]: + if isinstance(in_data, frozendict.frozendict): + raise ValueError('Unable to serialize type frozendict.frozendict to text/plain') + elif isinstance(in_data, tuple): + raise ValueError('Unable to serialize type tuple to text/plain') + elif isinstance(in_data, schemas.NoneClass): + raise ValueError('Unable to serialize type NoneClass to text/plain') + elif isinstance(in_data, schemas.BoolClass): + raise ValueError('Unable to serialize type BoolClass to text/plain') + return dict(body=str(in_data)) + + @classmethod + def __multipart_json_item(cls, key: str, value: schemas.Schema) -> RequestField: + json_value = cls.__json_encoder.default(value) + request_field = RequestField(name=key, data=json.dumps(json_value)) + request_field.make_multipart(content_type='application/json') + return request_field + + @classmethod + def __multipart_form_item(cls, key: str, value: schemas.Schema) -> RequestField: + if isinstance(value, str): + request_field = RequestField(name=key, data=str(value)) + request_field.make_multipart(content_type='text/plain') + elif isinstance(value, bytes): + request_field = RequestField(name=key, data=value) + request_field.make_multipart(content_type='application/octet-stream') + elif isinstance(value, schemas.FileIO): + # TODO use content.encoding to limit allowed content types if they are present + request_field = RequestField.from_tuples(key, (os.path.basename(value.name), value.read())) + value.close() + else: + request_field = cls.__multipart_json_item(key=key, value=value) + return request_field + + @classmethod + def __serialize_multipart_form_data( + cls, in_data: schemas.Schema + ) -> typing.Dict[str, typing.Tuple[RequestField, ...]]: + if not isinstance(in_data, frozendict.frozendict): + raise ValueError(f'Unable to serialize {in_data} to multipart/form-data because it is not a dict of data') + """ + In a multipart/form-data request body, each schema property, or each element of a schema array property, + takes a section in the payload with an internal header as defined by RFC7578. The serialization strategy + for each property of a multipart/form-data request body can be specified in an associated Encoding Object. + + When passing in multipart types, boundaries MAY be used to separate sections of the content being + transferred – thus, the following default Content-Types are defined for multipart: + + If the (object) property is a primitive, or an array of primitive values, the default Content-Type is text/plain + If the property is complex, or an array of complex values, the default Content-Type is application/json + Question: how is the array of primitives encoded? + If the property is a type: string with a contentEncoding, the default Content-Type is application/octet-stream + """ + fields = [] + for key, value in in_data.items(): + if isinstance(value, tuple): + if value: + # values use explode = True, so the code makes a RequestField for each item with name=key + for item in value: + request_field = cls.__multipart_form_item(key=key, value=item) + fields.append(request_field) + else: + # send an empty array as json because exploding will not send it + request_field = cls.__multipart_json_item(key=key, value=value) + fields.append(request_field) + else: + request_field = cls.__multipart_form_item(key=key, value=value) + fields.append(request_field) + + return dict(fields=tuple(fields)) + + @staticmethod + def __serialize_application_octet_stream(in_data: schemas.BinarySchema) -> typing.Dict[str, bytes]: + if isinstance(in_data, bytes): + return dict(body=in_data) + # schemas.FileIO type + result = dict(body=in_data.read()) + in_data.close() + return result + + @classmethod + def __serialize_application_x_www_form_data( + cls, in_data: typing.Any + ) -> SerializedRequestBody: + """ + POST submission of form data in body + """ + if not isinstance(in_data, frozendict.frozendict): + raise ValueError( + f'Unable to serialize {in_data} to application/x-www-form-urlencoded because it is not a dict of data') + cast_in_data = cls.__json_encoder.default(in_data) + value = cls._serialize_form(cast_in_data, name='', explode=True, percent_encode=True) + return dict(body=value) + + @classmethod + def serialize( + cls, in_data: typing.Any, content_type: str + ) -> SerializedRequestBody: + """ + If a str is returned then the result will be assigned to data when making the request + If a tuple is returned then the result will be used as fields input in encode_multipart_formdata + Return a tuple of + + The key of the return dict is + - body for application/json + - encode_multipart and fields for multipart/form-data + """ + media_type = cls.content[content_type] + if isinstance(in_data, media_type.schema): + cast_in_data = in_data + elif isinstance(in_data, (dict, frozendict.frozendict)) and in_data: + cast_in_data = media_type.schema(**in_data) + else: + cast_in_data = media_type.schema(in_data) + # TODO check for and use encoding if it exists + # and content_type is multipart or application/x-www-form-urlencoded + if cls._content_type_is_json(content_type): + return cls.__serialize_json(cast_in_data) + elif content_type == 'text/plain': + return cls.__serialize_text_plain(cast_in_data) + elif content_type == 'multipart/form-data': + return cls.__serialize_multipart_form_data(cast_in_data) + elif content_type == 'application/x-www-form-urlencoded': + return cls.__serialize_application_x_www_form_data(cast_in_data) + elif content_type == 'application/octet-stream': + return cls.__serialize_application_octet_stream(cast_in_data) + raise NotImplementedError('Serialization has not yet been implemented for {}'.format(content_type)) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/path_to_api.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/path_to_api.py new file mode 100644 index 00000000000..360e9952b79 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/path_to_api.py @@ -0,0 +1,536 @@ +import typing +import typing_extensions + +from unit_test_api.apis.paths.request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body import RequestBodyPostAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody +from unit_test_api.apis.paths.request_body_post_additionalproperties_are_allowed_by_default_request_body import RequestBodyPostAdditionalpropertiesAreAllowedByDefaultRequestBody +from unit_test_api.apis.paths.request_body_post_additionalproperties_can_exist_by_itself_request_body import RequestBodyPostAdditionalpropertiesCanExistByItselfRequestBody +from unit_test_api.apis.paths.request_body_post_additionalproperties_should_not_look_in_applicators_request_body import RequestBodyPostAdditionalpropertiesShouldNotLookInApplicatorsRequestBody +from unit_test_api.apis.paths.request_body_post_allof_combined_with_anyof_oneof_request_body import RequestBodyPostAllofCombinedWithAnyofOneofRequestBody +from unit_test_api.apis.paths.request_body_post_allof_request_body import RequestBodyPostAllofRequestBody +from unit_test_api.apis.paths.request_body_post_allof_simple_types_request_body import RequestBodyPostAllofSimpleTypesRequestBody +from unit_test_api.apis.paths.request_body_post_allof_with_base_schema_request_body import RequestBodyPostAllofWithBaseSchemaRequestBody +from unit_test_api.apis.paths.request_body_post_allof_with_one_empty_schema_request_body import RequestBodyPostAllofWithOneEmptySchemaRequestBody +from unit_test_api.apis.paths.request_body_post_allof_with_the_first_empty_schema_request_body import RequestBodyPostAllofWithTheFirstEmptySchemaRequestBody +from unit_test_api.apis.paths.request_body_post_allof_with_the_last_empty_schema_request_body import RequestBodyPostAllofWithTheLastEmptySchemaRequestBody +from unit_test_api.apis.paths.request_body_post_allof_with_two_empty_schemas_request_body import RequestBodyPostAllofWithTwoEmptySchemasRequestBody +from unit_test_api.apis.paths.request_body_post_anyof_complex_types_request_body import RequestBodyPostAnyofComplexTypesRequestBody +from unit_test_api.apis.paths.request_body_post_anyof_request_body import RequestBodyPostAnyofRequestBody +from unit_test_api.apis.paths.request_body_post_anyof_with_base_schema_request_body import RequestBodyPostAnyofWithBaseSchemaRequestBody +from unit_test_api.apis.paths.request_body_post_anyof_with_one_empty_schema_request_body import RequestBodyPostAnyofWithOneEmptySchemaRequestBody +from unit_test_api.apis.paths.request_body_post_array_type_matches_arrays_request_body import RequestBodyPostArrayTypeMatchesArraysRequestBody +from unit_test_api.apis.paths.request_body_post_boolean_type_matches_booleans_request_body import RequestBodyPostBooleanTypeMatchesBooleansRequestBody +from unit_test_api.apis.paths.request_body_post_by_int_request_body import RequestBodyPostByIntRequestBody +from unit_test_api.apis.paths.request_body_post_by_number_request_body import RequestBodyPostByNumberRequestBody +from unit_test_api.apis.paths.request_body_post_by_small_number_request_body import RequestBodyPostBySmallNumberRequestBody +from unit_test_api.apis.paths.request_body_post_date_time_format_request_body import RequestBodyPostDateTimeFormatRequestBody +from unit_test_api.apis.paths.request_body_post_email_format_request_body import RequestBodyPostEmailFormatRequestBody +from unit_test_api.apis.paths.request_body_post_enum_with0_does_not_match_false_request_body import RequestBodyPostEnumWith0DoesNotMatchFalseRequestBody +from unit_test_api.apis.paths.request_body_post_enum_with1_does_not_match_true_request_body import RequestBodyPostEnumWith1DoesNotMatchTrueRequestBody +from unit_test_api.apis.paths.request_body_post_enum_with_escaped_characters_request_body import RequestBodyPostEnumWithEscapedCharactersRequestBody +from unit_test_api.apis.paths.request_body_post_enum_with_false_does_not_match0_request_body import RequestBodyPostEnumWithFalseDoesNotMatch0RequestBody +from unit_test_api.apis.paths.request_body_post_enum_with_true_does_not_match1_request_body import RequestBodyPostEnumWithTrueDoesNotMatch1RequestBody +from unit_test_api.apis.paths.request_body_post_enums_in_properties_request_body import RequestBodyPostEnumsInPropertiesRequestBody +from unit_test_api.apis.paths.request_body_post_forbidden_property_request_body import RequestBodyPostForbiddenPropertyRequestBody +from unit_test_api.apis.paths.request_body_post_hostname_format_request_body import RequestBodyPostHostnameFormatRequestBody +from unit_test_api.apis.paths.request_body_post_integer_type_matches_integers_request_body import RequestBodyPostIntegerTypeMatchesIntegersRequestBody +from unit_test_api.apis.paths.request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body import RequestBodyPostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody +from unit_test_api.apis.paths.request_body_post_invalid_string_value_for_default_request_body import RequestBodyPostInvalidStringValueForDefaultRequestBody +from unit_test_api.apis.paths.request_body_post_ipv4_format_request_body import RequestBodyPostIpv4FormatRequestBody +from unit_test_api.apis.paths.request_body_post_ipv6_format_request_body import RequestBodyPostIpv6FormatRequestBody +from unit_test_api.apis.paths.request_body_post_json_pointer_format_request_body import RequestBodyPostJsonPointerFormatRequestBody +from unit_test_api.apis.paths.request_body_post_maximum_validation_request_body import RequestBodyPostMaximumValidationRequestBody +from unit_test_api.apis.paths.request_body_post_maximum_validation_with_unsigned_integer_request_body import RequestBodyPostMaximumValidationWithUnsignedIntegerRequestBody +from unit_test_api.apis.paths.request_body_post_maxitems_validation_request_body import RequestBodyPostMaxitemsValidationRequestBody +from unit_test_api.apis.paths.request_body_post_maxlength_validation_request_body import RequestBodyPostMaxlengthValidationRequestBody +from unit_test_api.apis.paths.request_body_post_maxproperties0_means_the_object_is_empty_request_body import RequestBodyPostMaxproperties0MeansTheObjectIsEmptyRequestBody +from unit_test_api.apis.paths.request_body_post_maxproperties_validation_request_body import RequestBodyPostMaxpropertiesValidationRequestBody +from unit_test_api.apis.paths.request_body_post_minimum_validation_request_body import RequestBodyPostMinimumValidationRequestBody +from unit_test_api.apis.paths.request_body_post_minimum_validation_with_signed_integer_request_body import RequestBodyPostMinimumValidationWithSignedIntegerRequestBody +from unit_test_api.apis.paths.request_body_post_minitems_validation_request_body import RequestBodyPostMinitemsValidationRequestBody +from unit_test_api.apis.paths.request_body_post_minlength_validation_request_body import RequestBodyPostMinlengthValidationRequestBody +from unit_test_api.apis.paths.request_body_post_minproperties_validation_request_body import RequestBodyPostMinpropertiesValidationRequestBody +from unit_test_api.apis.paths.request_body_post_nested_allof_to_check_validation_semantics_request_body import RequestBodyPostNestedAllofToCheckValidationSemanticsRequestBody +from unit_test_api.apis.paths.request_body_post_nested_anyof_to_check_validation_semantics_request_body import RequestBodyPostNestedAnyofToCheckValidationSemanticsRequestBody +from unit_test_api.apis.paths.request_body_post_nested_items_request_body import RequestBodyPostNestedItemsRequestBody +from unit_test_api.apis.paths.request_body_post_nested_oneof_to_check_validation_semantics_request_body import RequestBodyPostNestedOneofToCheckValidationSemanticsRequestBody +from unit_test_api.apis.paths.request_body_post_not_more_complex_schema_request_body import RequestBodyPostNotMoreComplexSchemaRequestBody +from unit_test_api.apis.paths.request_body_post_not_request_body import RequestBodyPostNotRequestBody +from unit_test_api.apis.paths.request_body_post_nul_characters_in_strings_request_body import RequestBodyPostNulCharactersInStringsRequestBody +from unit_test_api.apis.paths.request_body_post_null_type_matches_only_the_null_object_request_body import RequestBodyPostNullTypeMatchesOnlyTheNullObjectRequestBody +from unit_test_api.apis.paths.request_body_post_number_type_matches_numbers_request_body import RequestBodyPostNumberTypeMatchesNumbersRequestBody +from unit_test_api.apis.paths.request_body_post_object_properties_validation_request_body import RequestBodyPostObjectPropertiesValidationRequestBody +from unit_test_api.apis.paths.request_body_post_object_type_matches_objects_request_body import RequestBodyPostObjectTypeMatchesObjectsRequestBody +from unit_test_api.apis.paths.request_body_post_oneof_complex_types_request_body import RequestBodyPostOneofComplexTypesRequestBody +from unit_test_api.apis.paths.request_body_post_oneof_request_body import RequestBodyPostOneofRequestBody +from unit_test_api.apis.paths.request_body_post_oneof_with_base_schema_request_body import RequestBodyPostOneofWithBaseSchemaRequestBody +from unit_test_api.apis.paths.request_body_post_oneof_with_empty_schema_request_body import RequestBodyPostOneofWithEmptySchemaRequestBody +from unit_test_api.apis.paths.request_body_post_oneof_with_required_request_body import RequestBodyPostOneofWithRequiredRequestBody +from unit_test_api.apis.paths.request_body_post_pattern_is_not_anchored_request_body import RequestBodyPostPatternIsNotAnchoredRequestBody +from unit_test_api.apis.paths.request_body_post_pattern_validation_request_body import RequestBodyPostPatternValidationRequestBody +from unit_test_api.apis.paths.request_body_post_properties_with_escaped_characters_request_body import RequestBodyPostPropertiesWithEscapedCharactersRequestBody +from unit_test_api.apis.paths.request_body_post_property_named_ref_that_is_not_a_reference_request_body import RequestBodyPostPropertyNamedRefThatIsNotAReferenceRequestBody +from unit_test_api.apis.paths.request_body_post_ref_in_additionalproperties_request_body import RequestBodyPostRefInAdditionalpropertiesRequestBody +from unit_test_api.apis.paths.request_body_post_ref_in_allof_request_body import RequestBodyPostRefInAllofRequestBody +from unit_test_api.apis.paths.request_body_post_ref_in_anyof_request_body import RequestBodyPostRefInAnyofRequestBody +from unit_test_api.apis.paths.request_body_post_ref_in_items_request_body import RequestBodyPostRefInItemsRequestBody +from unit_test_api.apis.paths.request_body_post_ref_in_not_request_body import RequestBodyPostRefInNotRequestBody +from unit_test_api.apis.paths.request_body_post_ref_in_oneof_request_body import RequestBodyPostRefInOneofRequestBody +from unit_test_api.apis.paths.request_body_post_ref_in_property_request_body import RequestBodyPostRefInPropertyRequestBody +from unit_test_api.apis.paths.request_body_post_required_default_validation_request_body import RequestBodyPostRequiredDefaultValidationRequestBody +from unit_test_api.apis.paths.request_body_post_required_validation_request_body import RequestBodyPostRequiredValidationRequestBody +from unit_test_api.apis.paths.request_body_post_required_with_empty_array_request_body import RequestBodyPostRequiredWithEmptyArrayRequestBody +from unit_test_api.apis.paths.request_body_post_required_with_escaped_characters_request_body import RequestBodyPostRequiredWithEscapedCharactersRequestBody +from unit_test_api.apis.paths.request_body_post_simple_enum_validation_request_body import RequestBodyPostSimpleEnumValidationRequestBody +from unit_test_api.apis.paths.request_body_post_string_type_matches_strings_request_body import RequestBodyPostStringTypeMatchesStringsRequestBody +from unit_test_api.apis.paths.request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body import RequestBodyPostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody +from unit_test_api.apis.paths.request_body_post_uniqueitems_false_validation_request_body import RequestBodyPostUniqueitemsFalseValidationRequestBody +from unit_test_api.apis.paths.request_body_post_uniqueitems_validation_request_body import RequestBodyPostUniqueitemsValidationRequestBody +from unit_test_api.apis.paths.request_body_post_uri_format_request_body import RequestBodyPostUriFormatRequestBody +from unit_test_api.apis.paths.request_body_post_uri_reference_format_request_body import RequestBodyPostUriReferenceFormatRequestBody +from unit_test_api.apis.paths.request_body_post_uri_template_format_request_body import RequestBodyPostUriTemplateFormatRequestBody +from unit_test_api.apis.paths.response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types import ResponseBodyPostAdditionalpropertiesAllowsASchemaWhichShouldValidateResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types import ResponseBodyPostAdditionalpropertiesAreAllowedByDefaultResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types import ResponseBodyPostAdditionalpropertiesCanExistByItselfResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types import ResponseBodyPostAdditionalpropertiesShouldNotLookInApplicatorsResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types import ResponseBodyPostAllofCombinedWithAnyofOneofResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_allof_response_body_for_content_types import ResponseBodyPostAllofResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_allof_simple_types_response_body_for_content_types import ResponseBodyPostAllofSimpleTypesResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_allof_with_base_schema_response_body_for_content_types import ResponseBodyPostAllofWithBaseSchemaResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_allof_with_one_empty_schema_response_body_for_content_types import ResponseBodyPostAllofWithOneEmptySchemaResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types import ResponseBodyPostAllofWithTheFirstEmptySchemaResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types import ResponseBodyPostAllofWithTheLastEmptySchemaResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_allof_with_two_empty_schemas_response_body_for_content_types import ResponseBodyPostAllofWithTwoEmptySchemasResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_anyof_complex_types_response_body_for_content_types import ResponseBodyPostAnyofComplexTypesResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_anyof_response_body_for_content_types import ResponseBodyPostAnyofResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_anyof_with_base_schema_response_body_for_content_types import ResponseBodyPostAnyofWithBaseSchemaResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_anyof_with_one_empty_schema_response_body_for_content_types import ResponseBodyPostAnyofWithOneEmptySchemaResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_array_type_matches_arrays_response_body_for_content_types import ResponseBodyPostArrayTypeMatchesArraysResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_boolean_type_matches_booleans_response_body_for_content_types import ResponseBodyPostBooleanTypeMatchesBooleansResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_by_int_response_body_for_content_types import ResponseBodyPostByIntResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_by_number_response_body_for_content_types import ResponseBodyPostByNumberResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_by_small_number_response_body_for_content_types import ResponseBodyPostBySmallNumberResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_date_time_format_response_body_for_content_types import ResponseBodyPostDateTimeFormatResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_email_format_response_body_for_content_types import ResponseBodyPostEmailFormatResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_enum_with0_does_not_match_false_response_body_for_content_types import ResponseBodyPostEnumWith0DoesNotMatchFalseResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_enum_with1_does_not_match_true_response_body_for_content_types import ResponseBodyPostEnumWith1DoesNotMatchTrueResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_enum_with_escaped_characters_response_body_for_content_types import ResponseBodyPostEnumWithEscapedCharactersResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_enum_with_false_does_not_match0_response_body_for_content_types import ResponseBodyPostEnumWithFalseDoesNotMatch0ResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_enum_with_true_does_not_match1_response_body_for_content_types import ResponseBodyPostEnumWithTrueDoesNotMatch1ResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_enums_in_properties_response_body_for_content_types import ResponseBodyPostEnumsInPropertiesResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_forbidden_property_response_body_for_content_types import ResponseBodyPostForbiddenPropertyResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_hostname_format_response_body_for_content_types import ResponseBodyPostHostnameFormatResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_integer_type_matches_integers_response_body_for_content_types import ResponseBodyPostIntegerTypeMatchesIntegersResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types import ResponseBodyPostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_invalid_string_value_for_default_response_body_for_content_types import ResponseBodyPostInvalidStringValueForDefaultResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_ipv4_format_response_body_for_content_types import ResponseBodyPostIpv4FormatResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_ipv6_format_response_body_for_content_types import ResponseBodyPostIpv6FormatResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_json_pointer_format_response_body_for_content_types import ResponseBodyPostJsonPointerFormatResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_maximum_validation_response_body_for_content_types import ResponseBodyPostMaximumValidationResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types import ResponseBodyPostMaximumValidationWithUnsignedIntegerResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_maxitems_validation_response_body_for_content_types import ResponseBodyPostMaxitemsValidationResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_maxlength_validation_response_body_for_content_types import ResponseBodyPostMaxlengthValidationResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types import ResponseBodyPostMaxproperties0MeansTheObjectIsEmptyResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_maxproperties_validation_response_body_for_content_types import ResponseBodyPostMaxpropertiesValidationResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_minimum_validation_response_body_for_content_types import ResponseBodyPostMinimumValidationResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types import ResponseBodyPostMinimumValidationWithSignedIntegerResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_minitems_validation_response_body_for_content_types import ResponseBodyPostMinitemsValidationResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_minlength_validation_response_body_for_content_types import ResponseBodyPostMinlengthValidationResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_minproperties_validation_response_body_for_content_types import ResponseBodyPostMinpropertiesValidationResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types import ResponseBodyPostNestedAllofToCheckValidationSemanticsResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types import ResponseBodyPostNestedAnyofToCheckValidationSemanticsResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_nested_items_response_body_for_content_types import ResponseBodyPostNestedItemsResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types import ResponseBodyPostNestedOneofToCheckValidationSemanticsResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_not_more_complex_schema_response_body_for_content_types import ResponseBodyPostNotMoreComplexSchemaResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_not_response_body_for_content_types import ResponseBodyPostNotResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_nul_characters_in_strings_response_body_for_content_types import ResponseBodyPostNulCharactersInStringsResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types import ResponseBodyPostNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_number_type_matches_numbers_response_body_for_content_types import ResponseBodyPostNumberTypeMatchesNumbersResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_object_properties_validation_response_body_for_content_types import ResponseBodyPostObjectPropertiesValidationResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_object_type_matches_objects_response_body_for_content_types import ResponseBodyPostObjectTypeMatchesObjectsResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_oneof_complex_types_response_body_for_content_types import ResponseBodyPostOneofComplexTypesResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_oneof_response_body_for_content_types import ResponseBodyPostOneofResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_oneof_with_base_schema_response_body_for_content_types import ResponseBodyPostOneofWithBaseSchemaResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_oneof_with_empty_schema_response_body_for_content_types import ResponseBodyPostOneofWithEmptySchemaResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_oneof_with_required_response_body_for_content_types import ResponseBodyPostOneofWithRequiredResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_pattern_is_not_anchored_response_body_for_content_types import ResponseBodyPostPatternIsNotAnchoredResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_pattern_validation_response_body_for_content_types import ResponseBodyPostPatternValidationResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_properties_with_escaped_characters_response_body_for_content_types import ResponseBodyPostPropertiesWithEscapedCharactersResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types import ResponseBodyPostPropertyNamedRefThatIsNotAReferenceResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_ref_in_additionalproperties_response_body_for_content_types import ResponseBodyPostRefInAdditionalpropertiesResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_ref_in_allof_response_body_for_content_types import ResponseBodyPostRefInAllofResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_ref_in_anyof_response_body_for_content_types import ResponseBodyPostRefInAnyofResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_ref_in_items_response_body_for_content_types import ResponseBodyPostRefInItemsResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_ref_in_not_response_body_for_content_types import ResponseBodyPostRefInNotResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_ref_in_oneof_response_body_for_content_types import ResponseBodyPostRefInOneofResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_ref_in_property_response_body_for_content_types import ResponseBodyPostRefInPropertyResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_required_default_validation_response_body_for_content_types import ResponseBodyPostRequiredDefaultValidationResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_required_validation_response_body_for_content_types import ResponseBodyPostRequiredValidationResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_required_with_empty_array_response_body_for_content_types import ResponseBodyPostRequiredWithEmptyArrayResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_required_with_escaped_characters_response_body_for_content_types import ResponseBodyPostRequiredWithEscapedCharactersResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_simple_enum_validation_response_body_for_content_types import ResponseBodyPostSimpleEnumValidationResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_string_type_matches_strings_response_body_for_content_types import ResponseBodyPostStringTypeMatchesStringsResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types import ResponseBodyPostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_uniqueitems_false_validation_response_body_for_content_types import ResponseBodyPostUniqueitemsFalseValidationResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_uniqueitems_validation_response_body_for_content_types import ResponseBodyPostUniqueitemsValidationResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_uri_format_response_body_for_content_types import ResponseBodyPostUriFormatResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_uri_reference_format_response_body_for_content_types import ResponseBodyPostUriReferenceFormatResponseBodyForContentTypes +from unit_test_api.apis.paths.response_body_post_uri_template_format_response_body_for_content_types import ResponseBodyPostUriTemplateFormatResponseBodyForContentTypes + +PathToApi = typing_extensions.TypedDict( + 'PathToApi', + { + "/requestBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody": typing.Type[RequestBodyPostAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody], + "/requestBody/postAdditionalpropertiesAreAllowedByDefaultRequestBody": typing.Type[RequestBodyPostAdditionalpropertiesAreAllowedByDefaultRequestBody], + "/requestBody/postAdditionalpropertiesCanExistByItselfRequestBody": typing.Type[RequestBodyPostAdditionalpropertiesCanExistByItselfRequestBody], + "/requestBody/postAdditionalpropertiesShouldNotLookInApplicatorsRequestBody": typing.Type[RequestBodyPostAdditionalpropertiesShouldNotLookInApplicatorsRequestBody], + "/requestBody/postAllofCombinedWithAnyofOneofRequestBody": typing.Type[RequestBodyPostAllofCombinedWithAnyofOneofRequestBody], + "/requestBody/postAllofRequestBody": typing.Type[RequestBodyPostAllofRequestBody], + "/requestBody/postAllofSimpleTypesRequestBody": typing.Type[RequestBodyPostAllofSimpleTypesRequestBody], + "/requestBody/postAllofWithBaseSchemaRequestBody": typing.Type[RequestBodyPostAllofWithBaseSchemaRequestBody], + "/requestBody/postAllofWithOneEmptySchemaRequestBody": typing.Type[RequestBodyPostAllofWithOneEmptySchemaRequestBody], + "/requestBody/postAllofWithTheFirstEmptySchemaRequestBody": typing.Type[RequestBodyPostAllofWithTheFirstEmptySchemaRequestBody], + "/requestBody/postAllofWithTheLastEmptySchemaRequestBody": typing.Type[RequestBodyPostAllofWithTheLastEmptySchemaRequestBody], + "/requestBody/postAllofWithTwoEmptySchemasRequestBody": typing.Type[RequestBodyPostAllofWithTwoEmptySchemasRequestBody], + "/requestBody/postAnyofComplexTypesRequestBody": typing.Type[RequestBodyPostAnyofComplexTypesRequestBody], + "/requestBody/postAnyofRequestBody": typing.Type[RequestBodyPostAnyofRequestBody], + "/requestBody/postAnyofWithBaseSchemaRequestBody": typing.Type[RequestBodyPostAnyofWithBaseSchemaRequestBody], + "/requestBody/postAnyofWithOneEmptySchemaRequestBody": typing.Type[RequestBodyPostAnyofWithOneEmptySchemaRequestBody], + "/requestBody/postArrayTypeMatchesArraysRequestBody": typing.Type[RequestBodyPostArrayTypeMatchesArraysRequestBody], + "/requestBody/postBooleanTypeMatchesBooleansRequestBody": typing.Type[RequestBodyPostBooleanTypeMatchesBooleansRequestBody], + "/requestBody/postByIntRequestBody": typing.Type[RequestBodyPostByIntRequestBody], + "/requestBody/postByNumberRequestBody": typing.Type[RequestBodyPostByNumberRequestBody], + "/requestBody/postBySmallNumberRequestBody": typing.Type[RequestBodyPostBySmallNumberRequestBody], + "/requestBody/postDateTimeFormatRequestBody": typing.Type[RequestBodyPostDateTimeFormatRequestBody], + "/requestBody/postEmailFormatRequestBody": typing.Type[RequestBodyPostEmailFormatRequestBody], + "/requestBody/postEnumWith0DoesNotMatchFalseRequestBody": typing.Type[RequestBodyPostEnumWith0DoesNotMatchFalseRequestBody], + "/requestBody/postEnumWith1DoesNotMatchTrueRequestBody": typing.Type[RequestBodyPostEnumWith1DoesNotMatchTrueRequestBody], + "/requestBody/postEnumWithEscapedCharactersRequestBody": typing.Type[RequestBodyPostEnumWithEscapedCharactersRequestBody], + "/requestBody/postEnumWithFalseDoesNotMatch0RequestBody": typing.Type[RequestBodyPostEnumWithFalseDoesNotMatch0RequestBody], + "/requestBody/postEnumWithTrueDoesNotMatch1RequestBody": typing.Type[RequestBodyPostEnumWithTrueDoesNotMatch1RequestBody], + "/requestBody/postEnumsInPropertiesRequestBody": typing.Type[RequestBodyPostEnumsInPropertiesRequestBody], + "/requestBody/postForbiddenPropertyRequestBody": typing.Type[RequestBodyPostForbiddenPropertyRequestBody], + "/requestBody/postHostnameFormatRequestBody": typing.Type[RequestBodyPostHostnameFormatRequestBody], + "/requestBody/postIntegerTypeMatchesIntegersRequestBody": typing.Type[RequestBodyPostIntegerTypeMatchesIntegersRequestBody], + "/requestBody/postInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody": typing.Type[RequestBodyPostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody], + "/requestBody/postInvalidStringValueForDefaultRequestBody": typing.Type[RequestBodyPostInvalidStringValueForDefaultRequestBody], + "/requestBody/postIpv4FormatRequestBody": typing.Type[RequestBodyPostIpv4FormatRequestBody], + "/requestBody/postIpv6FormatRequestBody": typing.Type[RequestBodyPostIpv6FormatRequestBody], + "/requestBody/postJsonPointerFormatRequestBody": typing.Type[RequestBodyPostJsonPointerFormatRequestBody], + "/requestBody/postMaximumValidationRequestBody": typing.Type[RequestBodyPostMaximumValidationRequestBody], + "/requestBody/postMaximumValidationWithUnsignedIntegerRequestBody": typing.Type[RequestBodyPostMaximumValidationWithUnsignedIntegerRequestBody], + "/requestBody/postMaxitemsValidationRequestBody": typing.Type[RequestBodyPostMaxitemsValidationRequestBody], + "/requestBody/postMaxlengthValidationRequestBody": typing.Type[RequestBodyPostMaxlengthValidationRequestBody], + "/requestBody/postMaxproperties0MeansTheObjectIsEmptyRequestBody": typing.Type[RequestBodyPostMaxproperties0MeansTheObjectIsEmptyRequestBody], + "/requestBody/postMaxpropertiesValidationRequestBody": typing.Type[RequestBodyPostMaxpropertiesValidationRequestBody], + "/requestBody/postMinimumValidationRequestBody": typing.Type[RequestBodyPostMinimumValidationRequestBody], + "/requestBody/postMinimumValidationWithSignedIntegerRequestBody": typing.Type[RequestBodyPostMinimumValidationWithSignedIntegerRequestBody], + "/requestBody/postMinitemsValidationRequestBody": typing.Type[RequestBodyPostMinitemsValidationRequestBody], + "/requestBody/postMinlengthValidationRequestBody": typing.Type[RequestBodyPostMinlengthValidationRequestBody], + "/requestBody/postMinpropertiesValidationRequestBody": typing.Type[RequestBodyPostMinpropertiesValidationRequestBody], + "/requestBody/postNestedAllofToCheckValidationSemanticsRequestBody": typing.Type[RequestBodyPostNestedAllofToCheckValidationSemanticsRequestBody], + "/requestBody/postNestedAnyofToCheckValidationSemanticsRequestBody": typing.Type[RequestBodyPostNestedAnyofToCheckValidationSemanticsRequestBody], + "/requestBody/postNestedItemsRequestBody": typing.Type[RequestBodyPostNestedItemsRequestBody], + "/requestBody/postNestedOneofToCheckValidationSemanticsRequestBody": typing.Type[RequestBodyPostNestedOneofToCheckValidationSemanticsRequestBody], + "/requestBody/postNotMoreComplexSchemaRequestBody": typing.Type[RequestBodyPostNotMoreComplexSchemaRequestBody], + "/requestBody/postNotRequestBody": typing.Type[RequestBodyPostNotRequestBody], + "/requestBody/postNulCharactersInStringsRequestBody": typing.Type[RequestBodyPostNulCharactersInStringsRequestBody], + "/requestBody/postNullTypeMatchesOnlyTheNullObjectRequestBody": typing.Type[RequestBodyPostNullTypeMatchesOnlyTheNullObjectRequestBody], + "/requestBody/postNumberTypeMatchesNumbersRequestBody": typing.Type[RequestBodyPostNumberTypeMatchesNumbersRequestBody], + "/requestBody/postObjectPropertiesValidationRequestBody": typing.Type[RequestBodyPostObjectPropertiesValidationRequestBody], + "/requestBody/postObjectTypeMatchesObjectsRequestBody": typing.Type[RequestBodyPostObjectTypeMatchesObjectsRequestBody], + "/requestBody/postOneofComplexTypesRequestBody": typing.Type[RequestBodyPostOneofComplexTypesRequestBody], + "/requestBody/postOneofRequestBody": typing.Type[RequestBodyPostOneofRequestBody], + "/requestBody/postOneofWithBaseSchemaRequestBody": typing.Type[RequestBodyPostOneofWithBaseSchemaRequestBody], + "/requestBody/postOneofWithEmptySchemaRequestBody": typing.Type[RequestBodyPostOneofWithEmptySchemaRequestBody], + "/requestBody/postOneofWithRequiredRequestBody": typing.Type[RequestBodyPostOneofWithRequiredRequestBody], + "/requestBody/postPatternIsNotAnchoredRequestBody": typing.Type[RequestBodyPostPatternIsNotAnchoredRequestBody], + "/requestBody/postPatternValidationRequestBody": typing.Type[RequestBodyPostPatternValidationRequestBody], + "/requestBody/postPropertiesWithEscapedCharactersRequestBody": typing.Type[RequestBodyPostPropertiesWithEscapedCharactersRequestBody], + "/requestBody/postPropertyNamedRefThatIsNotAReferenceRequestBody": typing.Type[RequestBodyPostPropertyNamedRefThatIsNotAReferenceRequestBody], + "/requestBody/postRefInAdditionalpropertiesRequestBody": typing.Type[RequestBodyPostRefInAdditionalpropertiesRequestBody], + "/requestBody/postRefInAllofRequestBody": typing.Type[RequestBodyPostRefInAllofRequestBody], + "/requestBody/postRefInAnyofRequestBody": typing.Type[RequestBodyPostRefInAnyofRequestBody], + "/requestBody/postRefInItemsRequestBody": typing.Type[RequestBodyPostRefInItemsRequestBody], + "/requestBody/postRefInNotRequestBody": typing.Type[RequestBodyPostRefInNotRequestBody], + "/requestBody/postRefInOneofRequestBody": typing.Type[RequestBodyPostRefInOneofRequestBody], + "/requestBody/postRefInPropertyRequestBody": typing.Type[RequestBodyPostRefInPropertyRequestBody], + "/requestBody/postRequiredDefaultValidationRequestBody": typing.Type[RequestBodyPostRequiredDefaultValidationRequestBody], + "/requestBody/postRequiredValidationRequestBody": typing.Type[RequestBodyPostRequiredValidationRequestBody], + "/requestBody/postRequiredWithEmptyArrayRequestBody": typing.Type[RequestBodyPostRequiredWithEmptyArrayRequestBody], + "/requestBody/postRequiredWithEscapedCharactersRequestBody": typing.Type[RequestBodyPostRequiredWithEscapedCharactersRequestBody], + "/requestBody/postSimpleEnumValidationRequestBody": typing.Type[RequestBodyPostSimpleEnumValidationRequestBody], + "/requestBody/postStringTypeMatchesStringsRequestBody": typing.Type[RequestBodyPostStringTypeMatchesStringsRequestBody], + "/requestBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody": typing.Type[RequestBodyPostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody], + "/requestBody/postUniqueitemsFalseValidationRequestBody": typing.Type[RequestBodyPostUniqueitemsFalseValidationRequestBody], + "/requestBody/postUniqueitemsValidationRequestBody": typing.Type[RequestBodyPostUniqueitemsValidationRequestBody], + "/requestBody/postUriFormatRequestBody": typing.Type[RequestBodyPostUriFormatRequestBody], + "/requestBody/postUriReferenceFormatRequestBody": typing.Type[RequestBodyPostUriReferenceFormatRequestBody], + "/requestBody/postUriTemplateFormatRequestBody": typing.Type[RequestBodyPostUriTemplateFormatRequestBody], + "/responseBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateResponseBodyForContentTypes": typing.Type[ResponseBodyPostAdditionalpropertiesAllowsASchemaWhichShouldValidateResponseBodyForContentTypes], + "/responseBody/postAdditionalpropertiesAreAllowedByDefaultResponseBodyForContentTypes": typing.Type[ResponseBodyPostAdditionalpropertiesAreAllowedByDefaultResponseBodyForContentTypes], + "/responseBody/postAdditionalpropertiesCanExistByItselfResponseBodyForContentTypes": typing.Type[ResponseBodyPostAdditionalpropertiesCanExistByItselfResponseBodyForContentTypes], + "/responseBody/postAdditionalpropertiesShouldNotLookInApplicatorsResponseBodyForContentTypes": typing.Type[ResponseBodyPostAdditionalpropertiesShouldNotLookInApplicatorsResponseBodyForContentTypes], + "/responseBody/postAllofCombinedWithAnyofOneofResponseBodyForContentTypes": typing.Type[ResponseBodyPostAllofCombinedWithAnyofOneofResponseBodyForContentTypes], + "/responseBody/postAllofResponseBodyForContentTypes": typing.Type[ResponseBodyPostAllofResponseBodyForContentTypes], + "/responseBody/postAllofSimpleTypesResponseBodyForContentTypes": typing.Type[ResponseBodyPostAllofSimpleTypesResponseBodyForContentTypes], + "/responseBody/postAllofWithBaseSchemaResponseBodyForContentTypes": typing.Type[ResponseBodyPostAllofWithBaseSchemaResponseBodyForContentTypes], + "/responseBody/postAllofWithOneEmptySchemaResponseBodyForContentTypes": typing.Type[ResponseBodyPostAllofWithOneEmptySchemaResponseBodyForContentTypes], + "/responseBody/postAllofWithTheFirstEmptySchemaResponseBodyForContentTypes": typing.Type[ResponseBodyPostAllofWithTheFirstEmptySchemaResponseBodyForContentTypes], + "/responseBody/postAllofWithTheLastEmptySchemaResponseBodyForContentTypes": typing.Type[ResponseBodyPostAllofWithTheLastEmptySchemaResponseBodyForContentTypes], + "/responseBody/postAllofWithTwoEmptySchemasResponseBodyForContentTypes": typing.Type[ResponseBodyPostAllofWithTwoEmptySchemasResponseBodyForContentTypes], + "/responseBody/postAnyofComplexTypesResponseBodyForContentTypes": typing.Type[ResponseBodyPostAnyofComplexTypesResponseBodyForContentTypes], + "/responseBody/postAnyofResponseBodyForContentTypes": typing.Type[ResponseBodyPostAnyofResponseBodyForContentTypes], + "/responseBody/postAnyofWithBaseSchemaResponseBodyForContentTypes": typing.Type[ResponseBodyPostAnyofWithBaseSchemaResponseBodyForContentTypes], + "/responseBody/postAnyofWithOneEmptySchemaResponseBodyForContentTypes": typing.Type[ResponseBodyPostAnyofWithOneEmptySchemaResponseBodyForContentTypes], + "/responseBody/postArrayTypeMatchesArraysResponseBodyForContentTypes": typing.Type[ResponseBodyPostArrayTypeMatchesArraysResponseBodyForContentTypes], + "/responseBody/postBooleanTypeMatchesBooleansResponseBodyForContentTypes": typing.Type[ResponseBodyPostBooleanTypeMatchesBooleansResponseBodyForContentTypes], + "/responseBody/postByIntResponseBodyForContentTypes": typing.Type[ResponseBodyPostByIntResponseBodyForContentTypes], + "/responseBody/postByNumberResponseBodyForContentTypes": typing.Type[ResponseBodyPostByNumberResponseBodyForContentTypes], + "/responseBody/postBySmallNumberResponseBodyForContentTypes": typing.Type[ResponseBodyPostBySmallNumberResponseBodyForContentTypes], + "/responseBody/postDateTimeFormatResponseBodyForContentTypes": typing.Type[ResponseBodyPostDateTimeFormatResponseBodyForContentTypes], + "/responseBody/postEmailFormatResponseBodyForContentTypes": typing.Type[ResponseBodyPostEmailFormatResponseBodyForContentTypes], + "/responseBody/postEnumWith0DoesNotMatchFalseResponseBodyForContentTypes": typing.Type[ResponseBodyPostEnumWith0DoesNotMatchFalseResponseBodyForContentTypes], + "/responseBody/postEnumWith1DoesNotMatchTrueResponseBodyForContentTypes": typing.Type[ResponseBodyPostEnumWith1DoesNotMatchTrueResponseBodyForContentTypes], + "/responseBody/postEnumWithEscapedCharactersResponseBodyForContentTypes": typing.Type[ResponseBodyPostEnumWithEscapedCharactersResponseBodyForContentTypes], + "/responseBody/postEnumWithFalseDoesNotMatch0ResponseBodyForContentTypes": typing.Type[ResponseBodyPostEnumWithFalseDoesNotMatch0ResponseBodyForContentTypes], + "/responseBody/postEnumWithTrueDoesNotMatch1ResponseBodyForContentTypes": typing.Type[ResponseBodyPostEnumWithTrueDoesNotMatch1ResponseBodyForContentTypes], + "/responseBody/postEnumsInPropertiesResponseBodyForContentTypes": typing.Type[ResponseBodyPostEnumsInPropertiesResponseBodyForContentTypes], + "/responseBody/postForbiddenPropertyResponseBodyForContentTypes": typing.Type[ResponseBodyPostForbiddenPropertyResponseBodyForContentTypes], + "/responseBody/postHostnameFormatResponseBodyForContentTypes": typing.Type[ResponseBodyPostHostnameFormatResponseBodyForContentTypes], + "/responseBody/postIntegerTypeMatchesIntegersResponseBodyForContentTypes": typing.Type[ResponseBodyPostIntegerTypeMatchesIntegersResponseBodyForContentTypes], + "/responseBody/postInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfResponseBodyForContentTypes": typing.Type[ResponseBodyPostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfResponseBodyForContentTypes], + "/responseBody/postInvalidStringValueForDefaultResponseBodyForContentTypes": typing.Type[ResponseBodyPostInvalidStringValueForDefaultResponseBodyForContentTypes], + "/responseBody/postIpv4FormatResponseBodyForContentTypes": typing.Type[ResponseBodyPostIpv4FormatResponseBodyForContentTypes], + "/responseBody/postIpv6FormatResponseBodyForContentTypes": typing.Type[ResponseBodyPostIpv6FormatResponseBodyForContentTypes], + "/responseBody/postJsonPointerFormatResponseBodyForContentTypes": typing.Type[ResponseBodyPostJsonPointerFormatResponseBodyForContentTypes], + "/responseBody/postMaximumValidationResponseBodyForContentTypes": typing.Type[ResponseBodyPostMaximumValidationResponseBodyForContentTypes], + "/responseBody/postMaximumValidationWithUnsignedIntegerResponseBodyForContentTypes": typing.Type[ResponseBodyPostMaximumValidationWithUnsignedIntegerResponseBodyForContentTypes], + "/responseBody/postMaxitemsValidationResponseBodyForContentTypes": typing.Type[ResponseBodyPostMaxitemsValidationResponseBodyForContentTypes], + "/responseBody/postMaxlengthValidationResponseBodyForContentTypes": typing.Type[ResponseBodyPostMaxlengthValidationResponseBodyForContentTypes], + "/responseBody/postMaxproperties0MeansTheObjectIsEmptyResponseBodyForContentTypes": typing.Type[ResponseBodyPostMaxproperties0MeansTheObjectIsEmptyResponseBodyForContentTypes], + "/responseBody/postMaxpropertiesValidationResponseBodyForContentTypes": typing.Type[ResponseBodyPostMaxpropertiesValidationResponseBodyForContentTypes], + "/responseBody/postMinimumValidationResponseBodyForContentTypes": typing.Type[ResponseBodyPostMinimumValidationResponseBodyForContentTypes], + "/responseBody/postMinimumValidationWithSignedIntegerResponseBodyForContentTypes": typing.Type[ResponseBodyPostMinimumValidationWithSignedIntegerResponseBodyForContentTypes], + "/responseBody/postMinitemsValidationResponseBodyForContentTypes": typing.Type[ResponseBodyPostMinitemsValidationResponseBodyForContentTypes], + "/responseBody/postMinlengthValidationResponseBodyForContentTypes": typing.Type[ResponseBodyPostMinlengthValidationResponseBodyForContentTypes], + "/responseBody/postMinpropertiesValidationResponseBodyForContentTypes": typing.Type[ResponseBodyPostMinpropertiesValidationResponseBodyForContentTypes], + "/responseBody/postNestedAllofToCheckValidationSemanticsResponseBodyForContentTypes": typing.Type[ResponseBodyPostNestedAllofToCheckValidationSemanticsResponseBodyForContentTypes], + "/responseBody/postNestedAnyofToCheckValidationSemanticsResponseBodyForContentTypes": typing.Type[ResponseBodyPostNestedAnyofToCheckValidationSemanticsResponseBodyForContentTypes], + "/responseBody/postNestedItemsResponseBodyForContentTypes": typing.Type[ResponseBodyPostNestedItemsResponseBodyForContentTypes], + "/responseBody/postNestedOneofToCheckValidationSemanticsResponseBodyForContentTypes": typing.Type[ResponseBodyPostNestedOneofToCheckValidationSemanticsResponseBodyForContentTypes], + "/responseBody/postNotMoreComplexSchemaResponseBodyForContentTypes": typing.Type[ResponseBodyPostNotMoreComplexSchemaResponseBodyForContentTypes], + "/responseBody/postNotResponseBodyForContentTypes": typing.Type[ResponseBodyPostNotResponseBodyForContentTypes], + "/responseBody/postNulCharactersInStringsResponseBodyForContentTypes": typing.Type[ResponseBodyPostNulCharactersInStringsResponseBodyForContentTypes], + "/responseBody/postNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes": typing.Type[ResponseBodyPostNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes], + "/responseBody/postNumberTypeMatchesNumbersResponseBodyForContentTypes": typing.Type[ResponseBodyPostNumberTypeMatchesNumbersResponseBodyForContentTypes], + "/responseBody/postObjectPropertiesValidationResponseBodyForContentTypes": typing.Type[ResponseBodyPostObjectPropertiesValidationResponseBodyForContentTypes], + "/responseBody/postObjectTypeMatchesObjectsResponseBodyForContentTypes": typing.Type[ResponseBodyPostObjectTypeMatchesObjectsResponseBodyForContentTypes], + "/responseBody/postOneofComplexTypesResponseBodyForContentTypes": typing.Type[ResponseBodyPostOneofComplexTypesResponseBodyForContentTypes], + "/responseBody/postOneofResponseBodyForContentTypes": typing.Type[ResponseBodyPostOneofResponseBodyForContentTypes], + "/responseBody/postOneofWithBaseSchemaResponseBodyForContentTypes": typing.Type[ResponseBodyPostOneofWithBaseSchemaResponseBodyForContentTypes], + "/responseBody/postOneofWithEmptySchemaResponseBodyForContentTypes": typing.Type[ResponseBodyPostOneofWithEmptySchemaResponseBodyForContentTypes], + "/responseBody/postOneofWithRequiredResponseBodyForContentTypes": typing.Type[ResponseBodyPostOneofWithRequiredResponseBodyForContentTypes], + "/responseBody/postPatternIsNotAnchoredResponseBodyForContentTypes": typing.Type[ResponseBodyPostPatternIsNotAnchoredResponseBodyForContentTypes], + "/responseBody/postPatternValidationResponseBodyForContentTypes": typing.Type[ResponseBodyPostPatternValidationResponseBodyForContentTypes], + "/responseBody/postPropertiesWithEscapedCharactersResponseBodyForContentTypes": typing.Type[ResponseBodyPostPropertiesWithEscapedCharactersResponseBodyForContentTypes], + "/responseBody/postPropertyNamedRefThatIsNotAReferenceResponseBodyForContentTypes": typing.Type[ResponseBodyPostPropertyNamedRefThatIsNotAReferenceResponseBodyForContentTypes], + "/responseBody/postRefInAdditionalpropertiesResponseBodyForContentTypes": typing.Type[ResponseBodyPostRefInAdditionalpropertiesResponseBodyForContentTypes], + "/responseBody/postRefInAllofResponseBodyForContentTypes": typing.Type[ResponseBodyPostRefInAllofResponseBodyForContentTypes], + "/responseBody/postRefInAnyofResponseBodyForContentTypes": typing.Type[ResponseBodyPostRefInAnyofResponseBodyForContentTypes], + "/responseBody/postRefInItemsResponseBodyForContentTypes": typing.Type[ResponseBodyPostRefInItemsResponseBodyForContentTypes], + "/responseBody/postRefInNotResponseBodyForContentTypes": typing.Type[ResponseBodyPostRefInNotResponseBodyForContentTypes], + "/responseBody/postRefInOneofResponseBodyForContentTypes": typing.Type[ResponseBodyPostRefInOneofResponseBodyForContentTypes], + "/responseBody/postRefInPropertyResponseBodyForContentTypes": typing.Type[ResponseBodyPostRefInPropertyResponseBodyForContentTypes], + "/responseBody/postRequiredDefaultValidationResponseBodyForContentTypes": typing.Type[ResponseBodyPostRequiredDefaultValidationResponseBodyForContentTypes], + "/responseBody/postRequiredValidationResponseBodyForContentTypes": typing.Type[ResponseBodyPostRequiredValidationResponseBodyForContentTypes], + "/responseBody/postRequiredWithEmptyArrayResponseBodyForContentTypes": typing.Type[ResponseBodyPostRequiredWithEmptyArrayResponseBodyForContentTypes], + "/responseBody/postRequiredWithEscapedCharactersResponseBodyForContentTypes": typing.Type[ResponseBodyPostRequiredWithEscapedCharactersResponseBodyForContentTypes], + "/responseBody/postSimpleEnumValidationResponseBodyForContentTypes": typing.Type[ResponseBodyPostSimpleEnumValidationResponseBodyForContentTypes], + "/responseBody/postStringTypeMatchesStringsResponseBodyForContentTypes": typing.Type[ResponseBodyPostStringTypeMatchesStringsResponseBodyForContentTypes], + "/responseBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyForContentTypes": typing.Type[ResponseBodyPostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyForContentTypes], + "/responseBody/postUniqueitemsFalseValidationResponseBodyForContentTypes": typing.Type[ResponseBodyPostUniqueitemsFalseValidationResponseBodyForContentTypes], + "/responseBody/postUniqueitemsValidationResponseBodyForContentTypes": typing.Type[ResponseBodyPostUniqueitemsValidationResponseBodyForContentTypes], + "/responseBody/postUriFormatResponseBodyForContentTypes": typing.Type[ResponseBodyPostUriFormatResponseBodyForContentTypes], + "/responseBody/postUriReferenceFormatResponseBodyForContentTypes": typing.Type[ResponseBodyPostUriReferenceFormatResponseBodyForContentTypes], + "/responseBody/postUriTemplateFormatResponseBodyForContentTypes": typing.Type[ResponseBodyPostUriTemplateFormatResponseBodyForContentTypes], + } +) + +path_to_api = PathToApi( + { + "/requestBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody": RequestBodyPostAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody, + "/requestBody/postAdditionalpropertiesAreAllowedByDefaultRequestBody": RequestBodyPostAdditionalpropertiesAreAllowedByDefaultRequestBody, + "/requestBody/postAdditionalpropertiesCanExistByItselfRequestBody": RequestBodyPostAdditionalpropertiesCanExistByItselfRequestBody, + "/requestBody/postAdditionalpropertiesShouldNotLookInApplicatorsRequestBody": RequestBodyPostAdditionalpropertiesShouldNotLookInApplicatorsRequestBody, + "/requestBody/postAllofCombinedWithAnyofOneofRequestBody": RequestBodyPostAllofCombinedWithAnyofOneofRequestBody, + "/requestBody/postAllofRequestBody": RequestBodyPostAllofRequestBody, + "/requestBody/postAllofSimpleTypesRequestBody": RequestBodyPostAllofSimpleTypesRequestBody, + "/requestBody/postAllofWithBaseSchemaRequestBody": RequestBodyPostAllofWithBaseSchemaRequestBody, + "/requestBody/postAllofWithOneEmptySchemaRequestBody": RequestBodyPostAllofWithOneEmptySchemaRequestBody, + "/requestBody/postAllofWithTheFirstEmptySchemaRequestBody": RequestBodyPostAllofWithTheFirstEmptySchemaRequestBody, + "/requestBody/postAllofWithTheLastEmptySchemaRequestBody": RequestBodyPostAllofWithTheLastEmptySchemaRequestBody, + "/requestBody/postAllofWithTwoEmptySchemasRequestBody": RequestBodyPostAllofWithTwoEmptySchemasRequestBody, + "/requestBody/postAnyofComplexTypesRequestBody": RequestBodyPostAnyofComplexTypesRequestBody, + "/requestBody/postAnyofRequestBody": RequestBodyPostAnyofRequestBody, + "/requestBody/postAnyofWithBaseSchemaRequestBody": RequestBodyPostAnyofWithBaseSchemaRequestBody, + "/requestBody/postAnyofWithOneEmptySchemaRequestBody": RequestBodyPostAnyofWithOneEmptySchemaRequestBody, + "/requestBody/postArrayTypeMatchesArraysRequestBody": RequestBodyPostArrayTypeMatchesArraysRequestBody, + "/requestBody/postBooleanTypeMatchesBooleansRequestBody": RequestBodyPostBooleanTypeMatchesBooleansRequestBody, + "/requestBody/postByIntRequestBody": RequestBodyPostByIntRequestBody, + "/requestBody/postByNumberRequestBody": RequestBodyPostByNumberRequestBody, + "/requestBody/postBySmallNumberRequestBody": RequestBodyPostBySmallNumberRequestBody, + "/requestBody/postDateTimeFormatRequestBody": RequestBodyPostDateTimeFormatRequestBody, + "/requestBody/postEmailFormatRequestBody": RequestBodyPostEmailFormatRequestBody, + "/requestBody/postEnumWith0DoesNotMatchFalseRequestBody": RequestBodyPostEnumWith0DoesNotMatchFalseRequestBody, + "/requestBody/postEnumWith1DoesNotMatchTrueRequestBody": RequestBodyPostEnumWith1DoesNotMatchTrueRequestBody, + "/requestBody/postEnumWithEscapedCharactersRequestBody": RequestBodyPostEnumWithEscapedCharactersRequestBody, + "/requestBody/postEnumWithFalseDoesNotMatch0RequestBody": RequestBodyPostEnumWithFalseDoesNotMatch0RequestBody, + "/requestBody/postEnumWithTrueDoesNotMatch1RequestBody": RequestBodyPostEnumWithTrueDoesNotMatch1RequestBody, + "/requestBody/postEnumsInPropertiesRequestBody": RequestBodyPostEnumsInPropertiesRequestBody, + "/requestBody/postForbiddenPropertyRequestBody": RequestBodyPostForbiddenPropertyRequestBody, + "/requestBody/postHostnameFormatRequestBody": RequestBodyPostHostnameFormatRequestBody, + "/requestBody/postIntegerTypeMatchesIntegersRequestBody": RequestBodyPostIntegerTypeMatchesIntegersRequestBody, + "/requestBody/postInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody": RequestBodyPostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody, + "/requestBody/postInvalidStringValueForDefaultRequestBody": RequestBodyPostInvalidStringValueForDefaultRequestBody, + "/requestBody/postIpv4FormatRequestBody": RequestBodyPostIpv4FormatRequestBody, + "/requestBody/postIpv6FormatRequestBody": RequestBodyPostIpv6FormatRequestBody, + "/requestBody/postJsonPointerFormatRequestBody": RequestBodyPostJsonPointerFormatRequestBody, + "/requestBody/postMaximumValidationRequestBody": RequestBodyPostMaximumValidationRequestBody, + "/requestBody/postMaximumValidationWithUnsignedIntegerRequestBody": RequestBodyPostMaximumValidationWithUnsignedIntegerRequestBody, + "/requestBody/postMaxitemsValidationRequestBody": RequestBodyPostMaxitemsValidationRequestBody, + "/requestBody/postMaxlengthValidationRequestBody": RequestBodyPostMaxlengthValidationRequestBody, + "/requestBody/postMaxproperties0MeansTheObjectIsEmptyRequestBody": RequestBodyPostMaxproperties0MeansTheObjectIsEmptyRequestBody, + "/requestBody/postMaxpropertiesValidationRequestBody": RequestBodyPostMaxpropertiesValidationRequestBody, + "/requestBody/postMinimumValidationRequestBody": RequestBodyPostMinimumValidationRequestBody, + "/requestBody/postMinimumValidationWithSignedIntegerRequestBody": RequestBodyPostMinimumValidationWithSignedIntegerRequestBody, + "/requestBody/postMinitemsValidationRequestBody": RequestBodyPostMinitemsValidationRequestBody, + "/requestBody/postMinlengthValidationRequestBody": RequestBodyPostMinlengthValidationRequestBody, + "/requestBody/postMinpropertiesValidationRequestBody": RequestBodyPostMinpropertiesValidationRequestBody, + "/requestBody/postNestedAllofToCheckValidationSemanticsRequestBody": RequestBodyPostNestedAllofToCheckValidationSemanticsRequestBody, + "/requestBody/postNestedAnyofToCheckValidationSemanticsRequestBody": RequestBodyPostNestedAnyofToCheckValidationSemanticsRequestBody, + "/requestBody/postNestedItemsRequestBody": RequestBodyPostNestedItemsRequestBody, + "/requestBody/postNestedOneofToCheckValidationSemanticsRequestBody": RequestBodyPostNestedOneofToCheckValidationSemanticsRequestBody, + "/requestBody/postNotMoreComplexSchemaRequestBody": RequestBodyPostNotMoreComplexSchemaRequestBody, + "/requestBody/postNotRequestBody": RequestBodyPostNotRequestBody, + "/requestBody/postNulCharactersInStringsRequestBody": RequestBodyPostNulCharactersInStringsRequestBody, + "/requestBody/postNullTypeMatchesOnlyTheNullObjectRequestBody": RequestBodyPostNullTypeMatchesOnlyTheNullObjectRequestBody, + "/requestBody/postNumberTypeMatchesNumbersRequestBody": RequestBodyPostNumberTypeMatchesNumbersRequestBody, + "/requestBody/postObjectPropertiesValidationRequestBody": RequestBodyPostObjectPropertiesValidationRequestBody, + "/requestBody/postObjectTypeMatchesObjectsRequestBody": RequestBodyPostObjectTypeMatchesObjectsRequestBody, + "/requestBody/postOneofComplexTypesRequestBody": RequestBodyPostOneofComplexTypesRequestBody, + "/requestBody/postOneofRequestBody": RequestBodyPostOneofRequestBody, + "/requestBody/postOneofWithBaseSchemaRequestBody": RequestBodyPostOneofWithBaseSchemaRequestBody, + "/requestBody/postOneofWithEmptySchemaRequestBody": RequestBodyPostOneofWithEmptySchemaRequestBody, + "/requestBody/postOneofWithRequiredRequestBody": RequestBodyPostOneofWithRequiredRequestBody, + "/requestBody/postPatternIsNotAnchoredRequestBody": RequestBodyPostPatternIsNotAnchoredRequestBody, + "/requestBody/postPatternValidationRequestBody": RequestBodyPostPatternValidationRequestBody, + "/requestBody/postPropertiesWithEscapedCharactersRequestBody": RequestBodyPostPropertiesWithEscapedCharactersRequestBody, + "/requestBody/postPropertyNamedRefThatIsNotAReferenceRequestBody": RequestBodyPostPropertyNamedRefThatIsNotAReferenceRequestBody, + "/requestBody/postRefInAdditionalpropertiesRequestBody": RequestBodyPostRefInAdditionalpropertiesRequestBody, + "/requestBody/postRefInAllofRequestBody": RequestBodyPostRefInAllofRequestBody, + "/requestBody/postRefInAnyofRequestBody": RequestBodyPostRefInAnyofRequestBody, + "/requestBody/postRefInItemsRequestBody": RequestBodyPostRefInItemsRequestBody, + "/requestBody/postRefInNotRequestBody": RequestBodyPostRefInNotRequestBody, + "/requestBody/postRefInOneofRequestBody": RequestBodyPostRefInOneofRequestBody, + "/requestBody/postRefInPropertyRequestBody": RequestBodyPostRefInPropertyRequestBody, + "/requestBody/postRequiredDefaultValidationRequestBody": RequestBodyPostRequiredDefaultValidationRequestBody, + "/requestBody/postRequiredValidationRequestBody": RequestBodyPostRequiredValidationRequestBody, + "/requestBody/postRequiredWithEmptyArrayRequestBody": RequestBodyPostRequiredWithEmptyArrayRequestBody, + "/requestBody/postRequiredWithEscapedCharactersRequestBody": RequestBodyPostRequiredWithEscapedCharactersRequestBody, + "/requestBody/postSimpleEnumValidationRequestBody": RequestBodyPostSimpleEnumValidationRequestBody, + "/requestBody/postStringTypeMatchesStringsRequestBody": RequestBodyPostStringTypeMatchesStringsRequestBody, + "/requestBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody": RequestBodyPostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody, + "/requestBody/postUniqueitemsFalseValidationRequestBody": RequestBodyPostUniqueitemsFalseValidationRequestBody, + "/requestBody/postUniqueitemsValidationRequestBody": RequestBodyPostUniqueitemsValidationRequestBody, + "/requestBody/postUriFormatRequestBody": RequestBodyPostUriFormatRequestBody, + "/requestBody/postUriReferenceFormatRequestBody": RequestBodyPostUriReferenceFormatRequestBody, + "/requestBody/postUriTemplateFormatRequestBody": RequestBodyPostUriTemplateFormatRequestBody, + "/responseBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateResponseBodyForContentTypes": ResponseBodyPostAdditionalpropertiesAllowsASchemaWhichShouldValidateResponseBodyForContentTypes, + "/responseBody/postAdditionalpropertiesAreAllowedByDefaultResponseBodyForContentTypes": ResponseBodyPostAdditionalpropertiesAreAllowedByDefaultResponseBodyForContentTypes, + "/responseBody/postAdditionalpropertiesCanExistByItselfResponseBodyForContentTypes": ResponseBodyPostAdditionalpropertiesCanExistByItselfResponseBodyForContentTypes, + "/responseBody/postAdditionalpropertiesShouldNotLookInApplicatorsResponseBodyForContentTypes": ResponseBodyPostAdditionalpropertiesShouldNotLookInApplicatorsResponseBodyForContentTypes, + "/responseBody/postAllofCombinedWithAnyofOneofResponseBodyForContentTypes": ResponseBodyPostAllofCombinedWithAnyofOneofResponseBodyForContentTypes, + "/responseBody/postAllofResponseBodyForContentTypes": ResponseBodyPostAllofResponseBodyForContentTypes, + "/responseBody/postAllofSimpleTypesResponseBodyForContentTypes": ResponseBodyPostAllofSimpleTypesResponseBodyForContentTypes, + "/responseBody/postAllofWithBaseSchemaResponseBodyForContentTypes": ResponseBodyPostAllofWithBaseSchemaResponseBodyForContentTypes, + "/responseBody/postAllofWithOneEmptySchemaResponseBodyForContentTypes": ResponseBodyPostAllofWithOneEmptySchemaResponseBodyForContentTypes, + "/responseBody/postAllofWithTheFirstEmptySchemaResponseBodyForContentTypes": ResponseBodyPostAllofWithTheFirstEmptySchemaResponseBodyForContentTypes, + "/responseBody/postAllofWithTheLastEmptySchemaResponseBodyForContentTypes": ResponseBodyPostAllofWithTheLastEmptySchemaResponseBodyForContentTypes, + "/responseBody/postAllofWithTwoEmptySchemasResponseBodyForContentTypes": ResponseBodyPostAllofWithTwoEmptySchemasResponseBodyForContentTypes, + "/responseBody/postAnyofComplexTypesResponseBodyForContentTypes": ResponseBodyPostAnyofComplexTypesResponseBodyForContentTypes, + "/responseBody/postAnyofResponseBodyForContentTypes": ResponseBodyPostAnyofResponseBodyForContentTypes, + "/responseBody/postAnyofWithBaseSchemaResponseBodyForContentTypes": ResponseBodyPostAnyofWithBaseSchemaResponseBodyForContentTypes, + "/responseBody/postAnyofWithOneEmptySchemaResponseBodyForContentTypes": ResponseBodyPostAnyofWithOneEmptySchemaResponseBodyForContentTypes, + "/responseBody/postArrayTypeMatchesArraysResponseBodyForContentTypes": ResponseBodyPostArrayTypeMatchesArraysResponseBodyForContentTypes, + "/responseBody/postBooleanTypeMatchesBooleansResponseBodyForContentTypes": ResponseBodyPostBooleanTypeMatchesBooleansResponseBodyForContentTypes, + "/responseBody/postByIntResponseBodyForContentTypes": ResponseBodyPostByIntResponseBodyForContentTypes, + "/responseBody/postByNumberResponseBodyForContentTypes": ResponseBodyPostByNumberResponseBodyForContentTypes, + "/responseBody/postBySmallNumberResponseBodyForContentTypes": ResponseBodyPostBySmallNumberResponseBodyForContentTypes, + "/responseBody/postDateTimeFormatResponseBodyForContentTypes": ResponseBodyPostDateTimeFormatResponseBodyForContentTypes, + "/responseBody/postEmailFormatResponseBodyForContentTypes": ResponseBodyPostEmailFormatResponseBodyForContentTypes, + "/responseBody/postEnumWith0DoesNotMatchFalseResponseBodyForContentTypes": ResponseBodyPostEnumWith0DoesNotMatchFalseResponseBodyForContentTypes, + "/responseBody/postEnumWith1DoesNotMatchTrueResponseBodyForContentTypes": ResponseBodyPostEnumWith1DoesNotMatchTrueResponseBodyForContentTypes, + "/responseBody/postEnumWithEscapedCharactersResponseBodyForContentTypes": ResponseBodyPostEnumWithEscapedCharactersResponseBodyForContentTypes, + "/responseBody/postEnumWithFalseDoesNotMatch0ResponseBodyForContentTypes": ResponseBodyPostEnumWithFalseDoesNotMatch0ResponseBodyForContentTypes, + "/responseBody/postEnumWithTrueDoesNotMatch1ResponseBodyForContentTypes": ResponseBodyPostEnumWithTrueDoesNotMatch1ResponseBodyForContentTypes, + "/responseBody/postEnumsInPropertiesResponseBodyForContentTypes": ResponseBodyPostEnumsInPropertiesResponseBodyForContentTypes, + "/responseBody/postForbiddenPropertyResponseBodyForContentTypes": ResponseBodyPostForbiddenPropertyResponseBodyForContentTypes, + "/responseBody/postHostnameFormatResponseBodyForContentTypes": ResponseBodyPostHostnameFormatResponseBodyForContentTypes, + "/responseBody/postIntegerTypeMatchesIntegersResponseBodyForContentTypes": ResponseBodyPostIntegerTypeMatchesIntegersResponseBodyForContentTypes, + "/responseBody/postInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfResponseBodyForContentTypes": ResponseBodyPostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfResponseBodyForContentTypes, + "/responseBody/postInvalidStringValueForDefaultResponseBodyForContentTypes": ResponseBodyPostInvalidStringValueForDefaultResponseBodyForContentTypes, + "/responseBody/postIpv4FormatResponseBodyForContentTypes": ResponseBodyPostIpv4FormatResponseBodyForContentTypes, + "/responseBody/postIpv6FormatResponseBodyForContentTypes": ResponseBodyPostIpv6FormatResponseBodyForContentTypes, + "/responseBody/postJsonPointerFormatResponseBodyForContentTypes": ResponseBodyPostJsonPointerFormatResponseBodyForContentTypes, + "/responseBody/postMaximumValidationResponseBodyForContentTypes": ResponseBodyPostMaximumValidationResponseBodyForContentTypes, + "/responseBody/postMaximumValidationWithUnsignedIntegerResponseBodyForContentTypes": ResponseBodyPostMaximumValidationWithUnsignedIntegerResponseBodyForContentTypes, + "/responseBody/postMaxitemsValidationResponseBodyForContentTypes": ResponseBodyPostMaxitemsValidationResponseBodyForContentTypes, + "/responseBody/postMaxlengthValidationResponseBodyForContentTypes": ResponseBodyPostMaxlengthValidationResponseBodyForContentTypes, + "/responseBody/postMaxproperties0MeansTheObjectIsEmptyResponseBodyForContentTypes": ResponseBodyPostMaxproperties0MeansTheObjectIsEmptyResponseBodyForContentTypes, + "/responseBody/postMaxpropertiesValidationResponseBodyForContentTypes": ResponseBodyPostMaxpropertiesValidationResponseBodyForContentTypes, + "/responseBody/postMinimumValidationResponseBodyForContentTypes": ResponseBodyPostMinimumValidationResponseBodyForContentTypes, + "/responseBody/postMinimumValidationWithSignedIntegerResponseBodyForContentTypes": ResponseBodyPostMinimumValidationWithSignedIntegerResponseBodyForContentTypes, + "/responseBody/postMinitemsValidationResponseBodyForContentTypes": ResponseBodyPostMinitemsValidationResponseBodyForContentTypes, + "/responseBody/postMinlengthValidationResponseBodyForContentTypes": ResponseBodyPostMinlengthValidationResponseBodyForContentTypes, + "/responseBody/postMinpropertiesValidationResponseBodyForContentTypes": ResponseBodyPostMinpropertiesValidationResponseBodyForContentTypes, + "/responseBody/postNestedAllofToCheckValidationSemanticsResponseBodyForContentTypes": ResponseBodyPostNestedAllofToCheckValidationSemanticsResponseBodyForContentTypes, + "/responseBody/postNestedAnyofToCheckValidationSemanticsResponseBodyForContentTypes": ResponseBodyPostNestedAnyofToCheckValidationSemanticsResponseBodyForContentTypes, + "/responseBody/postNestedItemsResponseBodyForContentTypes": ResponseBodyPostNestedItemsResponseBodyForContentTypes, + "/responseBody/postNestedOneofToCheckValidationSemanticsResponseBodyForContentTypes": ResponseBodyPostNestedOneofToCheckValidationSemanticsResponseBodyForContentTypes, + "/responseBody/postNotMoreComplexSchemaResponseBodyForContentTypes": ResponseBodyPostNotMoreComplexSchemaResponseBodyForContentTypes, + "/responseBody/postNotResponseBodyForContentTypes": ResponseBodyPostNotResponseBodyForContentTypes, + "/responseBody/postNulCharactersInStringsResponseBodyForContentTypes": ResponseBodyPostNulCharactersInStringsResponseBodyForContentTypes, + "/responseBody/postNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes": ResponseBodyPostNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes, + "/responseBody/postNumberTypeMatchesNumbersResponseBodyForContentTypes": ResponseBodyPostNumberTypeMatchesNumbersResponseBodyForContentTypes, + "/responseBody/postObjectPropertiesValidationResponseBodyForContentTypes": ResponseBodyPostObjectPropertiesValidationResponseBodyForContentTypes, + "/responseBody/postObjectTypeMatchesObjectsResponseBodyForContentTypes": ResponseBodyPostObjectTypeMatchesObjectsResponseBodyForContentTypes, + "/responseBody/postOneofComplexTypesResponseBodyForContentTypes": ResponseBodyPostOneofComplexTypesResponseBodyForContentTypes, + "/responseBody/postOneofResponseBodyForContentTypes": ResponseBodyPostOneofResponseBodyForContentTypes, + "/responseBody/postOneofWithBaseSchemaResponseBodyForContentTypes": ResponseBodyPostOneofWithBaseSchemaResponseBodyForContentTypes, + "/responseBody/postOneofWithEmptySchemaResponseBodyForContentTypes": ResponseBodyPostOneofWithEmptySchemaResponseBodyForContentTypes, + "/responseBody/postOneofWithRequiredResponseBodyForContentTypes": ResponseBodyPostOneofWithRequiredResponseBodyForContentTypes, + "/responseBody/postPatternIsNotAnchoredResponseBodyForContentTypes": ResponseBodyPostPatternIsNotAnchoredResponseBodyForContentTypes, + "/responseBody/postPatternValidationResponseBodyForContentTypes": ResponseBodyPostPatternValidationResponseBodyForContentTypes, + "/responseBody/postPropertiesWithEscapedCharactersResponseBodyForContentTypes": ResponseBodyPostPropertiesWithEscapedCharactersResponseBodyForContentTypes, + "/responseBody/postPropertyNamedRefThatIsNotAReferenceResponseBodyForContentTypes": ResponseBodyPostPropertyNamedRefThatIsNotAReferenceResponseBodyForContentTypes, + "/responseBody/postRefInAdditionalpropertiesResponseBodyForContentTypes": ResponseBodyPostRefInAdditionalpropertiesResponseBodyForContentTypes, + "/responseBody/postRefInAllofResponseBodyForContentTypes": ResponseBodyPostRefInAllofResponseBodyForContentTypes, + "/responseBody/postRefInAnyofResponseBodyForContentTypes": ResponseBodyPostRefInAnyofResponseBodyForContentTypes, + "/responseBody/postRefInItemsResponseBodyForContentTypes": ResponseBodyPostRefInItemsResponseBodyForContentTypes, + "/responseBody/postRefInNotResponseBodyForContentTypes": ResponseBodyPostRefInNotResponseBodyForContentTypes, + "/responseBody/postRefInOneofResponseBodyForContentTypes": ResponseBodyPostRefInOneofResponseBodyForContentTypes, + "/responseBody/postRefInPropertyResponseBodyForContentTypes": ResponseBodyPostRefInPropertyResponseBodyForContentTypes, + "/responseBody/postRequiredDefaultValidationResponseBodyForContentTypes": ResponseBodyPostRequiredDefaultValidationResponseBodyForContentTypes, + "/responseBody/postRequiredValidationResponseBodyForContentTypes": ResponseBodyPostRequiredValidationResponseBodyForContentTypes, + "/responseBody/postRequiredWithEmptyArrayResponseBodyForContentTypes": ResponseBodyPostRequiredWithEmptyArrayResponseBodyForContentTypes, + "/responseBody/postRequiredWithEscapedCharactersResponseBodyForContentTypes": ResponseBodyPostRequiredWithEscapedCharactersResponseBodyForContentTypes, + "/responseBody/postSimpleEnumValidationResponseBodyForContentTypes": ResponseBodyPostSimpleEnumValidationResponseBodyForContentTypes, + "/responseBody/postStringTypeMatchesStringsResponseBodyForContentTypes": ResponseBodyPostStringTypeMatchesStringsResponseBodyForContentTypes, + "/responseBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyForContentTypes": ResponseBodyPostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyForContentTypes, + "/responseBody/postUniqueitemsFalseValidationResponseBodyForContentTypes": ResponseBodyPostUniqueitemsFalseValidationResponseBodyForContentTypes, + "/responseBody/postUniqueitemsValidationResponseBodyForContentTypes": ResponseBodyPostUniqueitemsValidationResponseBodyForContentTypes, + "/responseBody/postUriFormatResponseBodyForContentTypes": ResponseBodyPostUriFormatResponseBodyForContentTypes, + "/responseBody/postUriReferenceFormatResponseBodyForContentTypes": ResponseBodyPostUriReferenceFormatResponseBodyForContentTypes, + "/responseBody/postUriTemplateFormatResponseBodyForContentTypes": ResponseBodyPostUriTemplateFormatResponseBodyForContentTypes, + } +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/__init__.py new file mode 100644 index 00000000000..6428c1345e5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/__init__.py @@ -0,0 +1,3 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.path_to_api import path_to_api \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body.py new file mode 100644 index 00000000000..f30b28a4b8b --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body.post.operation import ApiForPost + + +class RequestBodyPostAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body.py new file mode 100644 index 00000000000..564d9b431ee --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_additionalproperties_are_allowed_by_default_request_body.post.operation import ApiForPost + + +class RequestBodyPostAdditionalpropertiesAreAllowedByDefaultRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body.py new file mode 100644 index 00000000000..cf73f957fb2 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_additionalproperties_can_exist_by_itself_request_body.post.operation import ApiForPost + + +class RequestBodyPostAdditionalpropertiesCanExistByItselfRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body.py new file mode 100644 index 00000000000..2f400770ffe --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_additionalproperties_should_not_look_in_applicators_request_body.post.operation import ApiForPost + + +class RequestBodyPostAdditionalpropertiesShouldNotLookInApplicatorsRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_allof_combined_with_anyof_oneof_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_allof_combined_with_anyof_oneof_request_body.py new file mode 100644 index 00000000000..1ba73efb652 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_allof_combined_with_anyof_oneof_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_allof_combined_with_anyof_oneof_request_body.post.operation import ApiForPost + + +class RequestBodyPostAllofCombinedWithAnyofOneofRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_allof_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_allof_request_body.py new file mode 100644 index 00000000000..0e4a56b6e76 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_allof_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_allof_request_body.post.operation import ApiForPost + + +class RequestBodyPostAllofRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_allof_simple_types_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_allof_simple_types_request_body.py new file mode 100644 index 00000000000..96aa49faa7c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_allof_simple_types_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_allof_simple_types_request_body.post.operation import ApiForPost + + +class RequestBodyPostAllofSimpleTypesRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_allof_with_base_schema_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_allof_with_base_schema_request_body.py new file mode 100644 index 00000000000..39cd709a95a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_allof_with_base_schema_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_allof_with_base_schema_request_body.post.operation import ApiForPost + + +class RequestBodyPostAllofWithBaseSchemaRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_allof_with_one_empty_schema_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_allof_with_one_empty_schema_request_body.py new file mode 100644 index 00000000000..64ee03cf35a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_allof_with_one_empty_schema_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_allof_with_one_empty_schema_request_body.post.operation import ApiForPost + + +class RequestBodyPostAllofWithOneEmptySchemaRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_allof_with_the_first_empty_schema_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_allof_with_the_first_empty_schema_request_body.py new file mode 100644 index 00000000000..71af0d4f840 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_allof_with_the_first_empty_schema_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_allof_with_the_first_empty_schema_request_body.post.operation import ApiForPost + + +class RequestBodyPostAllofWithTheFirstEmptySchemaRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_allof_with_the_last_empty_schema_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_allof_with_the_last_empty_schema_request_body.py new file mode 100644 index 00000000000..7a3fad56f5b --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_allof_with_the_last_empty_schema_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_allof_with_the_last_empty_schema_request_body.post.operation import ApiForPost + + +class RequestBodyPostAllofWithTheLastEmptySchemaRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_allof_with_two_empty_schemas_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_allof_with_two_empty_schemas_request_body.py new file mode 100644 index 00000000000..b42aa6becde --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_allof_with_two_empty_schemas_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_allof_with_two_empty_schemas_request_body.post.operation import ApiForPost + + +class RequestBodyPostAllofWithTwoEmptySchemasRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_anyof_complex_types_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_anyof_complex_types_request_body.py new file mode 100644 index 00000000000..1e7804c5e6b --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_anyof_complex_types_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_anyof_complex_types_request_body.post.operation import ApiForPost + + +class RequestBodyPostAnyofComplexTypesRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_anyof_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_anyof_request_body.py new file mode 100644 index 00000000000..600d74c7638 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_anyof_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_anyof_request_body.post.operation import ApiForPost + + +class RequestBodyPostAnyofRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_anyof_with_base_schema_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_anyof_with_base_schema_request_body.py new file mode 100644 index 00000000000..6772e97da62 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_anyof_with_base_schema_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_anyof_with_base_schema_request_body.post.operation import ApiForPost + + +class RequestBodyPostAnyofWithBaseSchemaRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_anyof_with_one_empty_schema_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_anyof_with_one_empty_schema_request_body.py new file mode 100644 index 00000000000..b36087cc7c5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_anyof_with_one_empty_schema_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_anyof_with_one_empty_schema_request_body.post.operation import ApiForPost + + +class RequestBodyPostAnyofWithOneEmptySchemaRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_array_type_matches_arrays_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_array_type_matches_arrays_request_body.py new file mode 100644 index 00000000000..9f948912997 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_array_type_matches_arrays_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_array_type_matches_arrays_request_body.post.operation import ApiForPost + + +class RequestBodyPostArrayTypeMatchesArraysRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_boolean_type_matches_booleans_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_boolean_type_matches_booleans_request_body.py new file mode 100644 index 00000000000..69e02fb7deb --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_boolean_type_matches_booleans_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_boolean_type_matches_booleans_request_body.post.operation import ApiForPost + + +class RequestBodyPostBooleanTypeMatchesBooleansRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_by_int_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_by_int_request_body.py new file mode 100644 index 00000000000..b6fec25cbc7 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_by_int_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_by_int_request_body.post.operation import ApiForPost + + +class RequestBodyPostByIntRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_by_number_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_by_number_request_body.py new file mode 100644 index 00000000000..c53662bf789 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_by_number_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_by_number_request_body.post.operation import ApiForPost + + +class RequestBodyPostByNumberRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_by_small_number_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_by_small_number_request_body.py new file mode 100644 index 00000000000..b97ba92e634 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_by_small_number_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_by_small_number_request_body.post.operation import ApiForPost + + +class RequestBodyPostBySmallNumberRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_date_time_format_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_date_time_format_request_body.py new file mode 100644 index 00000000000..c5fbc26f543 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_date_time_format_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_date_time_format_request_body.post.operation import ApiForPost + + +class RequestBodyPostDateTimeFormatRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_email_format_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_email_format_request_body.py new file mode 100644 index 00000000000..4664dd519fb --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_email_format_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_email_format_request_body.post.operation import ApiForPost + + +class RequestBodyPostEmailFormatRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_enum_with0_does_not_match_false_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_enum_with0_does_not_match_false_request_body.py new file mode 100644 index 00000000000..d44c6c38334 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_enum_with0_does_not_match_false_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_enum_with0_does_not_match_false_request_body.post.operation import ApiForPost + + +class RequestBodyPostEnumWith0DoesNotMatchFalseRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_enum_with1_does_not_match_true_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_enum_with1_does_not_match_true_request_body.py new file mode 100644 index 00000000000..137e3afcdd2 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_enum_with1_does_not_match_true_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_enum_with1_does_not_match_true_request_body.post.operation import ApiForPost + + +class RequestBodyPostEnumWith1DoesNotMatchTrueRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_enum_with_escaped_characters_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_enum_with_escaped_characters_request_body.py new file mode 100644 index 00000000000..d8da79138f7 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_enum_with_escaped_characters_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_enum_with_escaped_characters_request_body.post.operation import ApiForPost + + +class RequestBodyPostEnumWithEscapedCharactersRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_enum_with_false_does_not_match0_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_enum_with_false_does_not_match0_request_body.py new file mode 100644 index 00000000000..60f3596b203 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_enum_with_false_does_not_match0_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_enum_with_false_does_not_match0_request_body.post.operation import ApiForPost + + +class RequestBodyPostEnumWithFalseDoesNotMatch0RequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_enum_with_true_does_not_match1_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_enum_with_true_does_not_match1_request_body.py new file mode 100644 index 00000000000..b51eab15325 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_enum_with_true_does_not_match1_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_enum_with_true_does_not_match1_request_body.post.operation import ApiForPost + + +class RequestBodyPostEnumWithTrueDoesNotMatch1RequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_enums_in_properties_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_enums_in_properties_request_body.py new file mode 100644 index 00000000000..1f5cce6454d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_enums_in_properties_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_enums_in_properties_request_body.post.operation import ApiForPost + + +class RequestBodyPostEnumsInPropertiesRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_forbidden_property_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_forbidden_property_request_body.py new file mode 100644 index 00000000000..e1c03645b21 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_forbidden_property_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_forbidden_property_request_body.post.operation import ApiForPost + + +class RequestBodyPostForbiddenPropertyRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_hostname_format_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_hostname_format_request_body.py new file mode 100644 index 00000000000..d691b217b20 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_hostname_format_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_hostname_format_request_body.post.operation import ApiForPost + + +class RequestBodyPostHostnameFormatRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_integer_type_matches_integers_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_integer_type_matches_integers_request_body.py new file mode 100644 index 00000000000..3c9684b6b14 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_integer_type_matches_integers_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_integer_type_matches_integers_request_body.post.operation import ApiForPost + + +class RequestBodyPostIntegerTypeMatchesIntegersRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body.py new file mode 100644 index 00000000000..64945589c35 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body.post.operation import ApiForPost + + +class RequestBodyPostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_invalid_string_value_for_default_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_invalid_string_value_for_default_request_body.py new file mode 100644 index 00000000000..5f227148e61 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_invalid_string_value_for_default_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_invalid_string_value_for_default_request_body.post.operation import ApiForPost + + +class RequestBodyPostInvalidStringValueForDefaultRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_ipv4_format_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_ipv4_format_request_body.py new file mode 100644 index 00000000000..dcb78ca5a65 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_ipv4_format_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_ipv4_format_request_body.post.operation import ApiForPost + + +class RequestBodyPostIpv4FormatRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_ipv6_format_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_ipv6_format_request_body.py new file mode 100644 index 00000000000..c5f1b089928 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_ipv6_format_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_ipv6_format_request_body.post.operation import ApiForPost + + +class RequestBodyPostIpv6FormatRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_json_pointer_format_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_json_pointer_format_request_body.py new file mode 100644 index 00000000000..8fb5037f519 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_json_pointer_format_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_json_pointer_format_request_body.post.operation import ApiForPost + + +class RequestBodyPostJsonPointerFormatRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_maximum_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_maximum_validation_request_body.py new file mode 100644 index 00000000000..7b33008c601 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_maximum_validation_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_maximum_validation_request_body.post.operation import ApiForPost + + +class RequestBodyPostMaximumValidationRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body.py new file mode 100644 index 00000000000..c6ea4435917 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_maximum_validation_with_unsigned_integer_request_body.post.operation import ApiForPost + + +class RequestBodyPostMaximumValidationWithUnsignedIntegerRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_maxitems_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_maxitems_validation_request_body.py new file mode 100644 index 00000000000..7811b305004 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_maxitems_validation_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_maxitems_validation_request_body.post.operation import ApiForPost + + +class RequestBodyPostMaxitemsValidationRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_maxlength_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_maxlength_validation_request_body.py new file mode 100644 index 00000000000..98662d4fb4a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_maxlength_validation_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_maxlength_validation_request_body.post.operation import ApiForPost + + +class RequestBodyPostMaxlengthValidationRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body.py new file mode 100644 index 00000000000..9159fb2a0b5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_maxproperties0_means_the_object_is_empty_request_body.post.operation import ApiForPost + + +class RequestBodyPostMaxproperties0MeansTheObjectIsEmptyRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_maxproperties_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_maxproperties_validation_request_body.py new file mode 100644 index 00000000000..37d34307d4c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_maxproperties_validation_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_maxproperties_validation_request_body.post.operation import ApiForPost + + +class RequestBodyPostMaxpropertiesValidationRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_minimum_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_minimum_validation_request_body.py new file mode 100644 index 00000000000..d5be2646221 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_minimum_validation_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_minimum_validation_request_body.post.operation import ApiForPost + + +class RequestBodyPostMinimumValidationRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_minimum_validation_with_signed_integer_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_minimum_validation_with_signed_integer_request_body.py new file mode 100644 index 00000000000..f3e7895f6e0 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_minimum_validation_with_signed_integer_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_minimum_validation_with_signed_integer_request_body.post.operation import ApiForPost + + +class RequestBodyPostMinimumValidationWithSignedIntegerRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_minitems_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_minitems_validation_request_body.py new file mode 100644 index 00000000000..55cab81b894 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_minitems_validation_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_minitems_validation_request_body.post.operation import ApiForPost + + +class RequestBodyPostMinitemsValidationRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_minlength_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_minlength_validation_request_body.py new file mode 100644 index 00000000000..94b0ea46ea9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_minlength_validation_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_minlength_validation_request_body.post.operation import ApiForPost + + +class RequestBodyPostMinlengthValidationRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_minproperties_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_minproperties_validation_request_body.py new file mode 100644 index 00000000000..11d5f3fc11d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_minproperties_validation_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_minproperties_validation_request_body.post.operation import ApiForPost + + +class RequestBodyPostMinpropertiesValidationRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body.py new file mode 100644 index 00000000000..ea8e55b35cc --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_nested_allof_to_check_validation_semantics_request_body.post.operation import ApiForPost + + +class RequestBodyPostNestedAllofToCheckValidationSemanticsRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body.py new file mode 100644 index 00000000000..e1dc7dde373 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_nested_anyof_to_check_validation_semantics_request_body.post.operation import ApiForPost + + +class RequestBodyPostNestedAnyofToCheckValidationSemanticsRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_nested_items_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_nested_items_request_body.py new file mode 100644 index 00000000000..31f1f44dad1 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_nested_items_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_nested_items_request_body.post.operation import ApiForPost + + +class RequestBodyPostNestedItemsRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body.py new file mode 100644 index 00000000000..e6acab27274 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_nested_oneof_to_check_validation_semantics_request_body.post.operation import ApiForPost + + +class RequestBodyPostNestedOneofToCheckValidationSemanticsRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_not_more_complex_schema_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_not_more_complex_schema_request_body.py new file mode 100644 index 00000000000..98574b5533b --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_not_more_complex_schema_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_not_more_complex_schema_request_body.post.operation import ApiForPost + + +class RequestBodyPostNotMoreComplexSchemaRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_not_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_not_request_body.py new file mode 100644 index 00000000000..44d0f710de8 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_not_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_not_request_body.post.operation import ApiForPost + + +class RequestBodyPostNotRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_nul_characters_in_strings_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_nul_characters_in_strings_request_body.py new file mode 100644 index 00000000000..a51dde1112a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_nul_characters_in_strings_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_nul_characters_in_strings_request_body.post.operation import ApiForPost + + +class RequestBodyPostNulCharactersInStringsRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_null_type_matches_only_the_null_object_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_null_type_matches_only_the_null_object_request_body.py new file mode 100644 index 00000000000..0d201ab34b6 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_null_type_matches_only_the_null_object_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_null_type_matches_only_the_null_object_request_body.post.operation import ApiForPost + + +class RequestBodyPostNullTypeMatchesOnlyTheNullObjectRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_number_type_matches_numbers_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_number_type_matches_numbers_request_body.py new file mode 100644 index 00000000000..55a72789513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_number_type_matches_numbers_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_number_type_matches_numbers_request_body.post.operation import ApiForPost + + +class RequestBodyPostNumberTypeMatchesNumbersRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_object_properties_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_object_properties_validation_request_body.py new file mode 100644 index 00000000000..976023c4363 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_object_properties_validation_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_object_properties_validation_request_body.post.operation import ApiForPost + + +class RequestBodyPostObjectPropertiesValidationRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_object_type_matches_objects_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_object_type_matches_objects_request_body.py new file mode 100644 index 00000000000..ad30078bc1a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_object_type_matches_objects_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_object_type_matches_objects_request_body.post.operation import ApiForPost + + +class RequestBodyPostObjectTypeMatchesObjectsRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_oneof_complex_types_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_oneof_complex_types_request_body.py new file mode 100644 index 00000000000..08a3c0efaf6 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_oneof_complex_types_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_oneof_complex_types_request_body.post.operation import ApiForPost + + +class RequestBodyPostOneofComplexTypesRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_oneof_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_oneof_request_body.py new file mode 100644 index 00000000000..12148c40e2f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_oneof_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_oneof_request_body.post.operation import ApiForPost + + +class RequestBodyPostOneofRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_oneof_with_base_schema_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_oneof_with_base_schema_request_body.py new file mode 100644 index 00000000000..7e0b7ae491b --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_oneof_with_base_schema_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_oneof_with_base_schema_request_body.post.operation import ApiForPost + + +class RequestBodyPostOneofWithBaseSchemaRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_oneof_with_empty_schema_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_oneof_with_empty_schema_request_body.py new file mode 100644 index 00000000000..d535d4ab30b --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_oneof_with_empty_schema_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_oneof_with_empty_schema_request_body.post.operation import ApiForPost + + +class RequestBodyPostOneofWithEmptySchemaRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_oneof_with_required_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_oneof_with_required_request_body.py new file mode 100644 index 00000000000..274cbe5b72e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_oneof_with_required_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_oneof_with_required_request_body.post.operation import ApiForPost + + +class RequestBodyPostOneofWithRequiredRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_pattern_is_not_anchored_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_pattern_is_not_anchored_request_body.py new file mode 100644 index 00000000000..c55cb443c1a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_pattern_is_not_anchored_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_pattern_is_not_anchored_request_body.post.operation import ApiForPost + + +class RequestBodyPostPatternIsNotAnchoredRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_pattern_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_pattern_validation_request_body.py new file mode 100644 index 00000000000..d9e97b57286 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_pattern_validation_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_pattern_validation_request_body.post.operation import ApiForPost + + +class RequestBodyPostPatternValidationRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_properties_with_escaped_characters_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_properties_with_escaped_characters_request_body.py new file mode 100644 index 00000000000..9d1cb579365 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_properties_with_escaped_characters_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_properties_with_escaped_characters_request_body.post.operation import ApiForPost + + +class RequestBodyPostPropertiesWithEscapedCharactersRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body.py new file mode 100644 index 00000000000..ee3323753f5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_property_named_ref_that_is_not_a_reference_request_body.post.operation import ApiForPost + + +class RequestBodyPostPropertyNamedRefThatIsNotAReferenceRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_ref_in_additionalproperties_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_ref_in_additionalproperties_request_body.py new file mode 100644 index 00000000000..bfa688903b9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_ref_in_additionalproperties_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_ref_in_additionalproperties_request_body.post.operation import ApiForPost + + +class RequestBodyPostRefInAdditionalpropertiesRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_ref_in_allof_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_ref_in_allof_request_body.py new file mode 100644 index 00000000000..261d1046721 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_ref_in_allof_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_ref_in_allof_request_body.post.operation import ApiForPost + + +class RequestBodyPostRefInAllofRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_ref_in_anyof_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_ref_in_anyof_request_body.py new file mode 100644 index 00000000000..c6a18472f76 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_ref_in_anyof_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_ref_in_anyof_request_body.post.operation import ApiForPost + + +class RequestBodyPostRefInAnyofRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_ref_in_items_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_ref_in_items_request_body.py new file mode 100644 index 00000000000..a27d9907d69 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_ref_in_items_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_ref_in_items_request_body.post.operation import ApiForPost + + +class RequestBodyPostRefInItemsRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_ref_in_not_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_ref_in_not_request_body.py new file mode 100644 index 00000000000..f3dc7c64162 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_ref_in_not_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_ref_in_not_request_body.post.operation import ApiForPost + + +class RequestBodyPostRefInNotRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_ref_in_oneof_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_ref_in_oneof_request_body.py new file mode 100644 index 00000000000..2f770c4576c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_ref_in_oneof_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_ref_in_oneof_request_body.post.operation import ApiForPost + + +class RequestBodyPostRefInOneofRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_ref_in_property_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_ref_in_property_request_body.py new file mode 100644 index 00000000000..be894028c7e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_ref_in_property_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_ref_in_property_request_body.post.operation import ApiForPost + + +class RequestBodyPostRefInPropertyRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_required_default_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_required_default_validation_request_body.py new file mode 100644 index 00000000000..18b4e70f0e4 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_required_default_validation_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_required_default_validation_request_body.post.operation import ApiForPost + + +class RequestBodyPostRequiredDefaultValidationRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_required_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_required_validation_request_body.py new file mode 100644 index 00000000000..70784c370a9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_required_validation_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_required_validation_request_body.post.operation import ApiForPost + + +class RequestBodyPostRequiredValidationRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_required_with_empty_array_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_required_with_empty_array_request_body.py new file mode 100644 index 00000000000..40ec7c08968 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_required_with_empty_array_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_required_with_empty_array_request_body.post.operation import ApiForPost + + +class RequestBodyPostRequiredWithEmptyArrayRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_required_with_escaped_characters_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_required_with_escaped_characters_request_body.py new file mode 100644 index 00000000000..8f7a1c9619e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_required_with_escaped_characters_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_required_with_escaped_characters_request_body.post.operation import ApiForPost + + +class RequestBodyPostRequiredWithEscapedCharactersRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_simple_enum_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_simple_enum_validation_request_body.py new file mode 100644 index 00000000000..2998a06bed4 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_simple_enum_validation_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_simple_enum_validation_request_body.post.operation import ApiForPost + + +class RequestBodyPostSimpleEnumValidationRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_string_type_matches_strings_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_string_type_matches_strings_request_body.py new file mode 100644 index 00000000000..978047fd206 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_string_type_matches_strings_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_string_type_matches_strings_request_body.post.operation import ApiForPost + + +class RequestBodyPostStringTypeMatchesStringsRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.py new file mode 100644 index 00000000000..854897a292c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.post.operation import ApiForPost + + +class RequestBodyPostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_uniqueitems_false_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_uniqueitems_false_validation_request_body.py new file mode 100644 index 00000000000..7f65bb2011d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_uniqueitems_false_validation_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_uniqueitems_false_validation_request_body.post.operation import ApiForPost + + +class RequestBodyPostUniqueitemsFalseValidationRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_uniqueitems_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_uniqueitems_validation_request_body.py new file mode 100644 index 00000000000..7fb001285cb --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_uniqueitems_validation_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_uniqueitems_validation_request_body.post.operation import ApiForPost + + +class RequestBodyPostUniqueitemsValidationRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_uri_format_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_uri_format_request_body.py new file mode 100644 index 00000000000..9bdaee4ad9d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_uri_format_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_uri_format_request_body.post.operation import ApiForPost + + +class RequestBodyPostUriFormatRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_uri_reference_format_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_uri_reference_format_request_body.py new file mode 100644 index 00000000000..f239c625e64 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_uri_reference_format_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_uri_reference_format_request_body.post.operation import ApiForPost + + +class RequestBodyPostUriReferenceFormatRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_uri_template_format_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_uri_template_format_request_body.py new file mode 100644 index 00000000000..aef9887982e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/request_body_post_uri_template_format_request_body.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_uri_template_format_request_body.post.operation import ApiForPost + + +class RequestBodyPostUriTemplateFormatRequestBody( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types.py new file mode 100644 index 00000000000..8b5fddbb1a3 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostAdditionalpropertiesAllowsASchemaWhichShouldValidateResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types.py new file mode 100644 index 00000000000..c8675c9ee15 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostAdditionalpropertiesAreAllowedByDefaultResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types.py new file mode 100644 index 00000000000..0868ced9bd2 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostAdditionalpropertiesCanExistByItselfResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types.py new file mode 100644 index 00000000000..ec43fc866d6 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostAdditionalpropertiesShouldNotLookInApplicatorsResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types.py new file mode 100644 index 00000000000..f11e17aaea2 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostAllofCombinedWithAnyofOneofResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_allof_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_allof_response_body_for_content_types.py new file mode 100644 index 00000000000..7957aa465ef --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_allof_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_allof_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostAllofResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_allof_simple_types_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_allof_simple_types_response_body_for_content_types.py new file mode 100644 index 00000000000..9a02135ca95 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_allof_simple_types_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_allof_simple_types_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostAllofSimpleTypesResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_allof_with_base_schema_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_allof_with_base_schema_response_body_for_content_types.py new file mode 100644 index 00000000000..0fccf498dd2 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_allof_with_base_schema_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_allof_with_base_schema_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostAllofWithBaseSchemaResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types.py new file mode 100644 index 00000000000..4e149b808e9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_allof_with_one_empty_schema_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostAllofWithOneEmptySchemaResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types.py new file mode 100644 index 00000000000..ca9cf6f7caa --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostAllofWithTheFirstEmptySchemaResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types.py new file mode 100644 index 00000000000..c9b9cb31160 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostAllofWithTheLastEmptySchemaResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types.py new file mode 100644 index 00000000000..813f87d3647 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_allof_with_two_empty_schemas_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostAllofWithTwoEmptySchemasResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_anyof_complex_types_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_anyof_complex_types_response_body_for_content_types.py new file mode 100644 index 00000000000..3d945aa4d72 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_anyof_complex_types_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_anyof_complex_types_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostAnyofComplexTypesResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_anyof_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_anyof_response_body_for_content_types.py new file mode 100644 index 00000000000..bed9a0a510f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_anyof_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_anyof_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostAnyofResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types.py new file mode 100644 index 00000000000..18cd43640a3 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_anyof_with_base_schema_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostAnyofWithBaseSchemaResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types.py new file mode 100644 index 00000000000..7c4ad3c4a18 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_anyof_with_one_empty_schema_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostAnyofWithOneEmptySchemaResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types.py new file mode 100644 index 00000000000..e1581069515 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_array_type_matches_arrays_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostArrayTypeMatchesArraysResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types.py new file mode 100644 index 00000000000..31142202703 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_boolean_type_matches_booleans_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostBooleanTypeMatchesBooleansResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_by_int_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_by_int_response_body_for_content_types.py new file mode 100644 index 00000000000..c58980b1576 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_by_int_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_by_int_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostByIntResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_by_number_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_by_number_response_body_for_content_types.py new file mode 100644 index 00000000000..6ded51f8fea --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_by_number_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_by_number_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostByNumberResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_by_small_number_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_by_small_number_response_body_for_content_types.py new file mode 100644 index 00000000000..5536ad1f3e6 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_by_small_number_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_by_small_number_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostBySmallNumberResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_date_time_format_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_date_time_format_response_body_for_content_types.py new file mode 100644 index 00000000000..736df6237ad --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_date_time_format_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_date_time_format_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostDateTimeFormatResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_email_format_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_email_format_response_body_for_content_types.py new file mode 100644 index 00000000000..eb6d403c8e0 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_email_format_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_email_format_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostEmailFormatResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types.py new file mode 100644 index 00000000000..42e5f009e70 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_enum_with0_does_not_match_false_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostEnumWith0DoesNotMatchFalseResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types.py new file mode 100644 index 00000000000..b7b338c766d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_enum_with1_does_not_match_true_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostEnumWith1DoesNotMatchTrueResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types.py new file mode 100644 index 00000000000..f15a9b3d090 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_enum_with_escaped_characters_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostEnumWithEscapedCharactersResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types.py new file mode 100644 index 00000000000..1d70e4bf743 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_enum_with_false_does_not_match0_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostEnumWithFalseDoesNotMatch0ResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types.py new file mode 100644 index 00000000000..51416be418e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_enum_with_true_does_not_match1_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostEnumWithTrueDoesNotMatch1ResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_enums_in_properties_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_enums_in_properties_response_body_for_content_types.py new file mode 100644 index 00000000000..aadfcd93bb1 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_enums_in_properties_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_enums_in_properties_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostEnumsInPropertiesResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_forbidden_property_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_forbidden_property_response_body_for_content_types.py new file mode 100644 index 00000000000..79231948465 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_forbidden_property_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_forbidden_property_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostForbiddenPropertyResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_hostname_format_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_hostname_format_response_body_for_content_types.py new file mode 100644 index 00000000000..a04c8061e41 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_hostname_format_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_hostname_format_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostHostnameFormatResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types.py new file mode 100644 index 00000000000..0310473cd17 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_integer_type_matches_integers_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostIntegerTypeMatchesIntegersResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types.py new file mode 100644 index 00000000000..fdf02bab602 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types.py new file mode 100644 index 00000000000..8c0b4206b91 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_invalid_string_value_for_default_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostInvalidStringValueForDefaultResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_ipv4_format_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_ipv4_format_response_body_for_content_types.py new file mode 100644 index 00000000000..faae6ad4a66 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_ipv4_format_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_ipv4_format_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostIpv4FormatResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_ipv6_format_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_ipv6_format_response_body_for_content_types.py new file mode 100644 index 00000000000..772521c6d0f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_ipv6_format_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_ipv6_format_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostIpv6FormatResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_json_pointer_format_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_json_pointer_format_response_body_for_content_types.py new file mode 100644 index 00000000000..59a9ff0a78a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_json_pointer_format_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_json_pointer_format_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostJsonPointerFormatResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_maximum_validation_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_maximum_validation_response_body_for_content_types.py new file mode 100644 index 00000000000..d03982f863e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_maximum_validation_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_maximum_validation_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostMaximumValidationResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types.py new file mode 100644 index 00000000000..bd0a13abb82 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostMaximumValidationWithUnsignedIntegerResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_maxitems_validation_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_maxitems_validation_response_body_for_content_types.py new file mode 100644 index 00000000000..3b2eae38a6d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_maxitems_validation_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_maxitems_validation_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostMaxitemsValidationResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_maxlength_validation_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_maxlength_validation_response_body_for_content_types.py new file mode 100644 index 00000000000..d1007add548 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_maxlength_validation_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_maxlength_validation_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostMaxlengthValidationResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types.py new file mode 100644 index 00000000000..fd2499478d3 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostMaxproperties0MeansTheObjectIsEmptyResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_maxproperties_validation_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_maxproperties_validation_response_body_for_content_types.py new file mode 100644 index 00000000000..a4846a495b2 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_maxproperties_validation_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_maxproperties_validation_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostMaxpropertiesValidationResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_minimum_validation_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_minimum_validation_response_body_for_content_types.py new file mode 100644 index 00000000000..a90c4c64874 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_minimum_validation_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_minimum_validation_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostMinimumValidationResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types.py new file mode 100644 index 00000000000..f54ca1e1c42 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostMinimumValidationWithSignedIntegerResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_minitems_validation_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_minitems_validation_response_body_for_content_types.py new file mode 100644 index 00000000000..b1059606447 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_minitems_validation_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_minitems_validation_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostMinitemsValidationResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_minlength_validation_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_minlength_validation_response_body_for_content_types.py new file mode 100644 index 00000000000..91ff544db2f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_minlength_validation_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_minlength_validation_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostMinlengthValidationResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_minproperties_validation_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_minproperties_validation_response_body_for_content_types.py new file mode 100644 index 00000000000..e746906c85d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_minproperties_validation_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_minproperties_validation_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostMinpropertiesValidationResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types.py new file mode 100644 index 00000000000..e99a67f1d39 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostNestedAllofToCheckValidationSemanticsResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types.py new file mode 100644 index 00000000000..7ffd33ba4ef --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostNestedAnyofToCheckValidationSemanticsResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_nested_items_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_nested_items_response_body_for_content_types.py new file mode 100644 index 00000000000..d6132e4d7ac --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_nested_items_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_nested_items_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostNestedItemsResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types.py new file mode 100644 index 00000000000..00a49aec03f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostNestedOneofToCheckValidationSemanticsResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_not_more_complex_schema_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_not_more_complex_schema_response_body_for_content_types.py new file mode 100644 index 00000000000..0e449e4d2d3 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_not_more_complex_schema_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_not_more_complex_schema_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostNotMoreComplexSchemaResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_not_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_not_response_body_for_content_types.py new file mode 100644 index 00000000000..a3a69155b54 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_not_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_not_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostNotResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types.py new file mode 100644 index 00000000000..85d4c835a36 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_nul_characters_in_strings_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostNulCharactersInStringsResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types.py new file mode 100644 index 00000000000..2028ec221da --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types.py new file mode 100644 index 00000000000..a303c477022 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_number_type_matches_numbers_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostNumberTypeMatchesNumbersResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_object_properties_validation_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_object_properties_validation_response_body_for_content_types.py new file mode 100644 index 00000000000..6504ccdbb2a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_object_properties_validation_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_object_properties_validation_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostObjectPropertiesValidationResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_object_type_matches_objects_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_object_type_matches_objects_response_body_for_content_types.py new file mode 100644 index 00000000000..6b1763da18a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_object_type_matches_objects_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_object_type_matches_objects_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostObjectTypeMatchesObjectsResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_oneof_complex_types_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_oneof_complex_types_response_body_for_content_types.py new file mode 100644 index 00000000000..afe2e0bb7fa --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_oneof_complex_types_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_oneof_complex_types_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostOneofComplexTypesResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_oneof_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_oneof_response_body_for_content_types.py new file mode 100644 index 00000000000..10cb450c343 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_oneof_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_oneof_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostOneofResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types.py new file mode 100644 index 00000000000..27268acde47 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_oneof_with_base_schema_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostOneofWithBaseSchemaResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types.py new file mode 100644 index 00000000000..d556787d12f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_oneof_with_empty_schema_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostOneofWithEmptySchemaResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_oneof_with_required_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_oneof_with_required_response_body_for_content_types.py new file mode 100644 index 00000000000..97e9ae50465 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_oneof_with_required_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_oneof_with_required_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostOneofWithRequiredResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types.py new file mode 100644 index 00000000000..83a29341bf3 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_pattern_is_not_anchored_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostPatternIsNotAnchoredResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_pattern_validation_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_pattern_validation_response_body_for_content_types.py new file mode 100644 index 00000000000..844e6fb2fed --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_pattern_validation_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_pattern_validation_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostPatternValidationResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types.py new file mode 100644 index 00000000000..512bac35666 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_properties_with_escaped_characters_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostPropertiesWithEscapedCharactersResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types.py new file mode 100644 index 00000000000..6673591beb9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostPropertyNamedRefThatIsNotAReferenceResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types.py new file mode 100644 index 00000000000..cb6292babed --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_ref_in_additionalproperties_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostRefInAdditionalpropertiesResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_ref_in_allof_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_ref_in_allof_response_body_for_content_types.py new file mode 100644 index 00000000000..7c7a15a7fa9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_ref_in_allof_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_ref_in_allof_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostRefInAllofResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_ref_in_anyof_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_ref_in_anyof_response_body_for_content_types.py new file mode 100644 index 00000000000..2e57f53144d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_ref_in_anyof_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_ref_in_anyof_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostRefInAnyofResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_ref_in_items_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_ref_in_items_response_body_for_content_types.py new file mode 100644 index 00000000000..032ff8db683 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_ref_in_items_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_ref_in_items_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostRefInItemsResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_ref_in_not_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_ref_in_not_response_body_for_content_types.py new file mode 100644 index 00000000000..62db8ea7247 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_ref_in_not_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_ref_in_not_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostRefInNotResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_ref_in_oneof_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_ref_in_oneof_response_body_for_content_types.py new file mode 100644 index 00000000000..79e5bdc9e17 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_ref_in_oneof_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_ref_in_oneof_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostRefInOneofResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_ref_in_property_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_ref_in_property_response_body_for_content_types.py new file mode 100644 index 00000000000..71355961c3e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_ref_in_property_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_ref_in_property_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostRefInPropertyResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_required_default_validation_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_required_default_validation_response_body_for_content_types.py new file mode 100644 index 00000000000..c01eeef8461 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_required_default_validation_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_required_default_validation_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostRequiredDefaultValidationResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_required_validation_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_required_validation_response_body_for_content_types.py new file mode 100644 index 00000000000..dc55da887b3 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_required_validation_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_required_validation_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostRequiredValidationResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_required_with_empty_array_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_required_with_empty_array_response_body_for_content_types.py new file mode 100644 index 00000000000..b393d88724d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_required_with_empty_array_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_required_with_empty_array_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostRequiredWithEmptyArrayResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types.py new file mode 100644 index 00000000000..7ea8d2cdfce --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_required_with_escaped_characters_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostRequiredWithEscapedCharactersResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_simple_enum_validation_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_simple_enum_validation_response_body_for_content_types.py new file mode 100644 index 00000000000..fcd814c3a59 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_simple_enum_validation_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_simple_enum_validation_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostSimpleEnumValidationResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_string_type_matches_strings_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_string_type_matches_strings_response_body_for_content_types.py new file mode 100644 index 00000000000..2268388b21d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_string_type_matches_strings_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_string_type_matches_strings_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostStringTypeMatchesStringsResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types.py new file mode 100644 index 00000000000..6ca1b339b1e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types.py new file mode 100644 index 00000000000..cfa2027bd4e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_uniqueitems_false_validation_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostUniqueitemsFalseValidationResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_uniqueitems_validation_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_uniqueitems_validation_response_body_for_content_types.py new file mode 100644 index 00000000000..f353fea50fb --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_uniqueitems_validation_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_uniqueitems_validation_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostUniqueitemsValidationResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_uri_format_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_uri_format_response_body_for_content_types.py new file mode 100644 index 00000000000..6beadff087c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_uri_format_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_uri_format_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostUriFormatResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_uri_reference_format_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_uri_reference_format_response_body_for_content_types.py new file mode 100644 index 00000000000..10f49ba8e6b --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_uri_reference_format_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_uri_reference_format_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostUriReferenceFormatResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_uri_template_format_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_uri_template_format_response_body_for_content_types.py new file mode 100644 index 00000000000..879d044d45b --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/paths/response_body_post_uri_template_format_response_body_for_content_types.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_uri_template_format_response_body_for_content_types.post.operation import ApiForPost + + +class ResponseBodyPostUriTemplateFormatResponseBodyForContentTypes( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tag_to_api.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tag_to_api.py new file mode 100644 index 00000000000..ade636c0491 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tag_to_api.py @@ -0,0 +1,98 @@ +import typing +import typing_extensions + +from unit_test_api.apis.tags.maximum_api import MaximumApi +from unit_test_api.apis.tags.pattern_api import PatternApi +from unit_test_api.apis.tags.additional_properties_api import AdditionalPropertiesApi +from unit_test_api.apis.tags.response_content_content_type_schema_api import ResponseContentContentTypeSchemaApi +from unit_test_api.apis.tags.min_items_api import MinItemsApi +from unit_test_api.apis.tags.min_length_api import MinLengthApi +from unit_test_api.apis.tags.required_api import RequiredApi +from unit_test_api.apis.tags.max_length_api import MaxLengthApi +from unit_test_api.apis.tags._not_api import _NotApi +from unit_test_api.apis.tags.path_post_api import PathPostApi +from unit_test_api.apis.tags.min_properties_api import MinPropertiesApi +from unit_test_api.apis.tags.unique_items_api import UniqueItemsApi +from unit_test_api.apis.tags.operation_request_body_api import OperationRequestBodyApi +from unit_test_api.apis.tags.one_of_api import OneOfApi +from unit_test_api.apis.tags.ref_api import RefApi +from unit_test_api.apis.tags.all_of_api import AllOfApi +from unit_test_api.apis.tags.minimum_api import MinimumApi +from unit_test_api.apis.tags.any_of_api import AnyOfApi +from unit_test_api.apis.tags.multiple_of_api import MultipleOfApi +from unit_test_api.apis.tags.type_api import TypeApi +from unit_test_api.apis.tags.items_api import ItemsApi +from unit_test_api.apis.tags.format_api import FormatApi +from unit_test_api.apis.tags.properties_api import PropertiesApi +from unit_test_api.apis.tags.default_api import DefaultApi +from unit_test_api.apis.tags.content_type_json_api import ContentTypeJsonApi +from unit_test_api.apis.tags.max_properties_api import MaxPropertiesApi +from unit_test_api.apis.tags.enum_api import EnumApi +from unit_test_api.apis.tags.max_items_api import MaxItemsApi + +TagToApi = typing_extensions.TypedDict( + 'TagToApi', + { + "maximum": typing.Type[MaximumApi], + "pattern": typing.Type[PatternApi], + "additionalProperties": typing.Type[AdditionalPropertiesApi], + "response.content.contentType.schema": typing.Type[ResponseContentContentTypeSchemaApi], + "minItems": typing.Type[MinItemsApi], + "minLength": typing.Type[MinLengthApi], + "required": typing.Type[RequiredApi], + "maxLength": typing.Type[MaxLengthApi], + "not": typing.Type[_NotApi], + "path.post": typing.Type[PathPostApi], + "minProperties": typing.Type[MinPropertiesApi], + "uniqueItems": typing.Type[UniqueItemsApi], + "operation.requestBody": typing.Type[OperationRequestBodyApi], + "oneOf": typing.Type[OneOfApi], + "$ref": typing.Type[RefApi], + "allOf": typing.Type[AllOfApi], + "minimum": typing.Type[MinimumApi], + "anyOf": typing.Type[AnyOfApi], + "multipleOf": typing.Type[MultipleOfApi], + "type": typing.Type[TypeApi], + "items": typing.Type[ItemsApi], + "format": typing.Type[FormatApi], + "properties": typing.Type[PropertiesApi], + "default": typing.Type[DefaultApi], + "contentType_json": typing.Type[ContentTypeJsonApi], + "maxProperties": typing.Type[MaxPropertiesApi], + "enum": typing.Type[EnumApi], + "maxItems": typing.Type[MaxItemsApi], + } +) + +tag_to_api = TagToApi( + { + "maximum": MaximumApi, + "pattern": PatternApi, + "additionalProperties": AdditionalPropertiesApi, + "response.content.contentType.schema": ResponseContentContentTypeSchemaApi, + "minItems": MinItemsApi, + "minLength": MinLengthApi, + "required": RequiredApi, + "maxLength": MaxLengthApi, + "not": _NotApi, + "path.post": PathPostApi, + "minProperties": MinPropertiesApi, + "uniqueItems": UniqueItemsApi, + "operation.requestBody": OperationRequestBodyApi, + "oneOf": OneOfApi, + "$ref": RefApi, + "allOf": AllOfApi, + "minimum": MinimumApi, + "anyOf": AnyOfApi, + "multipleOf": MultipleOfApi, + "type": TypeApi, + "items": ItemsApi, + "format": FormatApi, + "properties": PropertiesApi, + "default": DefaultApi, + "contentType_json": ContentTypeJsonApi, + "maxProperties": MaxPropertiesApi, + "enum": EnumApi, + "maxItems": MaxItemsApi, + } +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/__init__.py new file mode 100644 index 00000000000..8be314a222b --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/__init__.py @@ -0,0 +1,3 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.tag_to_api import tag_to_api \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/_not_api.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/_not_api.py new file mode 100644 index 00000000000..330e952f6fa --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/_not_api.py @@ -0,0 +1,30 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_not_request_body.post.operation import PostNotRequestBody +from unit_test_api.paths.response_body_post_not_more_complex_schema_response_body_for_content_types.post.operation import PostNotMoreComplexSchemaResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_not_more_complex_schema_request_body.post.operation import PostNotMoreComplexSchemaRequestBody +from unit_test_api.paths.response_body_post_not_response_body_for_content_types.post.operation import PostNotResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_forbidden_property_response_body_for_content_types.post.operation import PostForbiddenPropertyResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_forbidden_property_request_body.post.operation import PostForbiddenPropertyRequestBody + + +class _NotApi( + PostNotRequestBody, + PostNotMoreComplexSchemaResponseBodyForContentTypes, + PostNotMoreComplexSchemaRequestBody, + PostNotResponseBodyForContentTypes, + PostForbiddenPropertyResponseBodyForContentTypes, + PostForbiddenPropertyRequestBody, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/additional_properties_api.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/additional_properties_api.py new file mode 100644 index 00000000000..ff8e6cbb1f4 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/additional_properties_api.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_additionalproperties_can_exist_by_itself_request_body.post.operation import PostAdditionalpropertiesCanExistByItselfRequestBody +from unit_test_api.paths.response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types.post.operation import PostAdditionalpropertiesAreAllowedByDefaultResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body.post.operation import PostAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody +from unit_test_api.paths.response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types.post.operation import PostAdditionalpropertiesCanExistByItselfResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_additionalproperties_should_not_look_in_applicators_request_body.post.operation import PostAdditionalpropertiesShouldNotLookInApplicatorsRequestBody +from unit_test_api.paths.request_body_post_additionalproperties_are_allowed_by_default_request_body.post.operation import PostAdditionalpropertiesAreAllowedByDefaultRequestBody +from unit_test_api.paths.response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types.post.operation import PostAdditionalpropertiesShouldNotLookInApplicatorsResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types.post.operation import PostAdditionalpropertiesAllowsASchemaWhichShouldValidateResponseBodyForContentTypes + + +class AdditionalPropertiesApi( + PostAdditionalpropertiesCanExistByItselfRequestBody, + PostAdditionalpropertiesAreAllowedByDefaultResponseBodyForContentTypes, + PostAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody, + PostAdditionalpropertiesCanExistByItselfResponseBodyForContentTypes, + PostAdditionalpropertiesShouldNotLookInApplicatorsRequestBody, + PostAdditionalpropertiesAreAllowedByDefaultRequestBody, + PostAdditionalpropertiesShouldNotLookInApplicatorsResponseBodyForContentTypes, + PostAdditionalpropertiesAllowsASchemaWhichShouldValidateResponseBodyForContentTypes, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/all_of_api.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/all_of_api.py new file mode 100644 index 00000000000..21cb30c8062 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/all_of_api.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_allof_with_one_empty_schema_request_body.post.operation import PostAllofWithOneEmptySchemaRequestBody +from unit_test_api.paths.request_body_post_allof_with_two_empty_schemas_request_body.post.operation import PostAllofWithTwoEmptySchemasRequestBody +from unit_test_api.paths.request_body_post_nested_allof_to_check_validation_semantics_request_body.post.operation import PostNestedAllofToCheckValidationSemanticsRequestBody +from unit_test_api.paths.response_body_post_allof_with_two_empty_schemas_response_body_for_content_types.post.operation import PostAllofWithTwoEmptySchemasResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_allof_simple_types_request_body.post.operation import PostAllofSimpleTypesRequestBody +from unit_test_api.paths.response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types.post.operation import PostAllofWithTheFirstEmptySchemaResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_allof_combined_with_anyof_oneof_request_body.post.operation import PostAllofCombinedWithAnyofOneofRequestBody +from unit_test_api.paths.request_body_post_allof_with_the_first_empty_schema_request_body.post.operation import PostAllofWithTheFirstEmptySchemaRequestBody +from unit_test_api.paths.request_body_post_allof_request_body.post.operation import PostAllofRequestBody +from unit_test_api.paths.response_body_post_allof_with_base_schema_response_body_for_content_types.post.operation import PostAllofWithBaseSchemaResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types.post.operation import PostNestedAllofToCheckValidationSemanticsResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_allof_response_body_for_content_types.post.operation import PostAllofResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_allof_with_one_empty_schema_response_body_for_content_types.post.operation import PostAllofWithOneEmptySchemaResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_allof_with_the_last_empty_schema_request_body.post.operation import PostAllofWithTheLastEmptySchemaRequestBody +from unit_test_api.paths.response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types.post.operation import PostAllofCombinedWithAnyofOneofResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_allof_with_base_schema_request_body.post.operation import PostAllofWithBaseSchemaRequestBody +from unit_test_api.paths.response_body_post_allof_simple_types_response_body_for_content_types.post.operation import PostAllofSimpleTypesResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types.post.operation import PostAllofWithTheLastEmptySchemaResponseBodyForContentTypes + + +class AllOfApi( + PostAllofWithOneEmptySchemaRequestBody, + PostAllofWithTwoEmptySchemasRequestBody, + PostNestedAllofToCheckValidationSemanticsRequestBody, + PostAllofWithTwoEmptySchemasResponseBodyForContentTypes, + PostAllofSimpleTypesRequestBody, + PostAllofWithTheFirstEmptySchemaResponseBodyForContentTypes, + PostAllofCombinedWithAnyofOneofRequestBody, + PostAllofWithTheFirstEmptySchemaRequestBody, + PostAllofRequestBody, + PostAllofWithBaseSchemaResponseBodyForContentTypes, + PostNestedAllofToCheckValidationSemanticsResponseBodyForContentTypes, + PostAllofResponseBodyForContentTypes, + PostAllofWithOneEmptySchemaResponseBodyForContentTypes, + PostAllofWithTheLastEmptySchemaRequestBody, + PostAllofCombinedWithAnyofOneofResponseBodyForContentTypes, + PostAllofWithBaseSchemaRequestBody, + PostAllofSimpleTypesResponseBodyForContentTypes, + PostAllofWithTheLastEmptySchemaResponseBodyForContentTypes, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/any_of_api.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/any_of_api.py new file mode 100644 index 00000000000..fb7e3c62384 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/any_of_api.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_anyof_complex_types_response_body_for_content_types.post.operation import PostAnyofComplexTypesResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_anyof_request_body.post.operation import PostAnyofRequestBody +from unit_test_api.paths.response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types.post.operation import PostNestedAnyofToCheckValidationSemanticsResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_anyof_complex_types_request_body.post.operation import PostAnyofComplexTypesRequestBody +from unit_test_api.paths.response_body_post_anyof_response_body_for_content_types.post.operation import PostAnyofResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_anyof_with_one_empty_schema_request_body.post.operation import PostAnyofWithOneEmptySchemaRequestBody +from unit_test_api.paths.request_body_post_nested_anyof_to_check_validation_semantics_request_body.post.operation import PostNestedAnyofToCheckValidationSemanticsRequestBody +from unit_test_api.paths.response_body_post_anyof_with_one_empty_schema_response_body_for_content_types.post.operation import PostAnyofWithOneEmptySchemaResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_anyof_with_base_schema_response_body_for_content_types.post.operation import PostAnyofWithBaseSchemaResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_anyof_with_base_schema_request_body.post.operation import PostAnyofWithBaseSchemaRequestBody + + +class AnyOfApi( + PostAnyofComplexTypesResponseBodyForContentTypes, + PostAnyofRequestBody, + PostNestedAnyofToCheckValidationSemanticsResponseBodyForContentTypes, + PostAnyofComplexTypesRequestBody, + PostAnyofResponseBodyForContentTypes, + PostAnyofWithOneEmptySchemaRequestBody, + PostNestedAnyofToCheckValidationSemanticsRequestBody, + PostAnyofWithOneEmptySchemaResponseBodyForContentTypes, + PostAnyofWithBaseSchemaResponseBodyForContentTypes, + PostAnyofWithBaseSchemaRequestBody, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/content_type_json_api.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/content_type_json_api.py new file mode 100644 index 00000000000..2194156ac54 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/content_type_json_api.py @@ -0,0 +1,366 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_ref_in_additionalproperties_request_body.post.operation import PostRefInAdditionalpropertiesRequestBody +from unit_test_api.paths.response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types.post.operation import PostPropertyNamedRefThatIsNotAReferenceResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_hostname_format_request_body.post.operation import PostHostnameFormatRequestBody +from unit_test_api.paths.response_body_post_object_type_matches_objects_response_body_for_content_types.post.operation import PostObjectTypeMatchesObjectsResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types.post.operation import PostNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_string_type_matches_strings_response_body_for_content_types.post.operation import PostStringTypeMatchesStringsResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_not_request_body.post.operation import PostNotRequestBody +from unit_test_api.paths.response_body_post_ipv4_format_response_body_for_content_types.post.operation import PostIpv4FormatResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types.post.operation import PostMaxproperties0MeansTheObjectIsEmptyResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_minproperties_validation_response_body_for_content_types.post.operation import PostMinpropertiesValidationResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_by_number_response_body_for_content_types.post.operation import PostByNumberResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_allof_with_base_schema_response_body_for_content_types.post.operation import PostAllofWithBaseSchemaResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_boolean_type_matches_booleans_response_body_for_content_types.post.operation import PostBooleanTypeMatchesBooleansResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_anyof_with_one_empty_schema_response_body_for_content_types.post.operation import PostAnyofWithOneEmptySchemaResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types.post.operation import PostMinimumValidationWithSignedIntegerResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_oneof_complex_types_response_body_for_content_types.post.operation import PostOneofComplexTypesResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_uri_template_format_response_body_for_content_types.post.operation import PostUriTemplateFormatResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_allof_with_the_last_empty_schema_request_body.post.operation import PostAllofWithTheLastEmptySchemaRequestBody +from unit_test_api.paths.response_body_post_enum_with_true_does_not_match1_response_body_for_content_types.post.operation import PostEnumWithTrueDoesNotMatch1ResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_ref_in_oneof_response_body_for_content_types.post.operation import PostRefInOneofResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_boolean_type_matches_booleans_request_body.post.operation import PostBooleanTypeMatchesBooleansRequestBody +from unit_test_api.paths.request_body_post_maxlength_validation_request_body.post.operation import PostMaxlengthValidationRequestBody +from unit_test_api.paths.response_body_post_by_small_number_response_body_for_content_types.post.operation import PostBySmallNumberResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_ref_in_property_response_body_for_content_types.post.operation import PostRefInPropertyResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_simple_enum_validation_response_body_for_content_types.post.operation import PostSimpleEnumValidationResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_anyof_with_one_empty_schema_request_body.post.operation import PostAnyofWithOneEmptySchemaRequestBody +from unit_test_api.paths.request_body_post_email_format_request_body.post.operation import PostEmailFormatRequestBody +from unit_test_api.paths.request_body_post_null_type_matches_only_the_null_object_request_body.post.operation import PostNullTypeMatchesOnlyTheNullObjectRequestBody +from unit_test_api.paths.response_body_post_oneof_response_body_for_content_types.post.operation import PostOneofResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_email_format_response_body_for_content_types.post.operation import PostEmailFormatResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_allof_with_two_empty_schemas_response_body_for_content_types.post.operation import PostAllofWithTwoEmptySchemasResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_ipv6_format_response_body_for_content_types.post.operation import PostIpv6FormatResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_invalid_string_value_for_default_response_body_for_content_types.post.operation import PostInvalidStringValueForDefaultResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_enum_with_true_does_not_match1_request_body.post.operation import PostEnumWithTrueDoesNotMatch1RequestBody +from unit_test_api.paths.request_body_post_ref_in_not_request_body.post.operation import PostRefInNotRequestBody +from unit_test_api.paths.request_body_post_nested_oneof_to_check_validation_semantics_request_body.post.operation import PostNestedOneofToCheckValidationSemanticsRequestBody +from unit_test_api.paths.request_body_post_array_type_matches_arrays_request_body.post.operation import PostArrayTypeMatchesArraysRequestBody +from unit_test_api.paths.request_body_post_minitems_validation_request_body.post.operation import PostMinitemsValidationRequestBody +from unit_test_api.paths.response_body_post_uri_reference_format_response_body_for_content_types.post.operation import PostUriReferenceFormatResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_integer_type_matches_integers_request_body.post.operation import PostIntegerTypeMatchesIntegersRequestBody +from unit_test_api.paths.response_body_post_date_time_format_response_body_for_content_types.post.operation import PostDateTimeFormatResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_maximum_validation_with_unsigned_integer_request_body.post.operation import PostMaximumValidationWithUnsignedIntegerRequestBody +from unit_test_api.paths.response_body_post_enums_in_properties_response_body_for_content_types.post.operation import PostEnumsInPropertiesResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_property_named_ref_that_is_not_a_reference_request_body.post.operation import PostPropertyNamedRefThatIsNotAReferenceRequestBody +from unit_test_api.paths.response_body_post_nested_items_response_body_for_content_types.post.operation import PostNestedItemsResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_anyof_with_base_schema_response_body_for_content_types.post.operation import PostAnyofWithBaseSchemaResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types.post.operation import PostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_nul_characters_in_strings_request_body.post.operation import PostNulCharactersInStringsRequestBody +from unit_test_api.paths.request_body_post_by_int_request_body.post.operation import PostByIntRequestBody +from unit_test_api.paths.request_body_post_maxproperties_validation_request_body.post.operation import PostMaxpropertiesValidationRequestBody +from unit_test_api.paths.response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types.post.operation import PostAdditionalpropertiesAreAllowedByDefaultResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_oneof_with_empty_schema_request_body.post.operation import PostOneofWithEmptySchemaRequestBody +from unit_test_api.paths.request_body_post_uri_format_request_body.post.operation import PostUriFormatRequestBody +from unit_test_api.paths.response_body_post_enum_with0_does_not_match_false_response_body_for_content_types.post.operation import PostEnumWith0DoesNotMatchFalseResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_allof_request_body.post.operation import PostAllofRequestBody +from unit_test_api.paths.response_body_post_properties_with_escaped_characters_response_body_for_content_types.post.operation import PostPropertiesWithEscapedCharactersResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_maxproperties_validation_response_body_for_content_types.post.operation import PostMaxpropertiesValidationResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_uniqueitems_validation_response_body_for_content_types.post.operation import PostUniqueitemsValidationResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_nested_items_request_body.post.operation import PostNestedItemsRequestBody +from unit_test_api.paths.request_body_post_number_type_matches_numbers_request_body.post.operation import PostNumberTypeMatchesNumbersRequestBody +from unit_test_api.paths.request_body_post_allof_with_base_schema_request_body.post.operation import PostAllofWithBaseSchemaRequestBody +from unit_test_api.paths.response_body_post_minitems_validation_response_body_for_content_types.post.operation import PostMinitemsValidationResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_ipv4_format_request_body.post.operation import PostIpv4FormatRequestBody +from unit_test_api.paths.response_body_post_allof_simple_types_response_body_for_content_types.post.operation import PostAllofSimpleTypesResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types.post.operation import PostAllofWithTheLastEmptySchemaResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_properties_with_escaped_characters_request_body.post.operation import PostPropertiesWithEscapedCharactersRequestBody +from unit_test_api.paths.request_body_post_oneof_with_required_request_body.post.operation import PostOneofWithRequiredRequestBody +from unit_test_api.paths.response_body_post_maximum_validation_response_body_for_content_types.post.operation import PostMaximumValidationResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types.post.operation import PostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_oneof_complex_types_request_body.post.operation import PostOneofComplexTypesRequestBody +from unit_test_api.paths.request_body_post_allof_with_one_empty_schema_request_body.post.operation import PostAllofWithOneEmptySchemaRequestBody +from unit_test_api.paths.request_body_post_object_properties_validation_request_body.post.operation import PostObjectPropertiesValidationRequestBody +from unit_test_api.paths.request_body_post_uri_reference_format_request_body.post.operation import PostUriReferenceFormatRequestBody +from unit_test_api.paths.response_body_post_oneof_with_base_schema_response_body_for_content_types.post.operation import PostOneofWithBaseSchemaResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_ref_in_not_response_body_for_content_types.post.operation import PostRefInNotResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_required_default_validation_request_body.post.operation import PostRequiredDefaultValidationRequestBody +from unit_test_api.paths.request_body_post_allof_combined_with_anyof_oneof_request_body.post.operation import PostAllofCombinedWithAnyofOneofRequestBody +from unit_test_api.paths.response_body_post_object_properties_validation_response_body_for_content_types.post.operation import PostObjectPropertiesValidationResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_ref_in_anyof_request_body.post.operation import PostRefInAnyofRequestBody +from unit_test_api.paths.response_body_post_ref_in_items_response_body_for_content_types.post.operation import PostRefInItemsResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_allof_response_body_for_content_types.post.operation import PostAllofResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types.post.operation import PostAdditionalpropertiesAllowsASchemaWhichShouldValidateResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_pattern_is_not_anchored_response_body_for_content_types.post.operation import PostPatternIsNotAnchoredResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_ref_in_oneof_request_body.post.operation import PostRefInOneofRequestBody +from unit_test_api.paths.response_body_post_not_response_body_for_content_types.post.operation import PostNotResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_ref_in_anyof_response_body_for_content_types.post.operation import PostRefInAnyofResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_required_with_escaped_characters_request_body.post.operation import PostRequiredWithEscapedCharactersRequestBody +from unit_test_api.paths.response_body_post_minlength_validation_response_body_for_content_types.post.operation import PostMinlengthValidationResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_date_time_format_request_body.post.operation import PostDateTimeFormatRequestBody +from unit_test_api.paths.response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types.post.operation import PostAllofWithTheFirstEmptySchemaResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_by_number_request_body.post.operation import PostByNumberRequestBody +from unit_test_api.paths.response_body_post_ref_in_additionalproperties_response_body_for_content_types.post.operation import PostRefInAdditionalpropertiesResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_anyof_with_base_schema_request_body.post.operation import PostAnyofWithBaseSchemaRequestBody +from unit_test_api.paths.response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types.post.operation import PostAdditionalpropertiesShouldNotLookInApplicatorsResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_object_type_matches_objects_request_body.post.operation import PostObjectTypeMatchesObjectsRequestBody +from unit_test_api.paths.request_body_post_enum_with1_does_not_match_true_request_body.post.operation import PostEnumWith1DoesNotMatchTrueRequestBody +from unit_test_api.paths.request_body_post_enum_with_false_does_not_match0_request_body.post.operation import PostEnumWithFalseDoesNotMatch0RequestBody +from unit_test_api.paths.request_body_post_not_more_complex_schema_request_body.post.operation import PostNotMoreComplexSchemaRequestBody +from unit_test_api.paths.response_body_post_nul_characters_in_strings_response_body_for_content_types.post.operation import PostNulCharactersInStringsResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_required_with_empty_array_request_body.post.operation import PostRequiredWithEmptyArrayRequestBody +from unit_test_api.paths.response_body_post_hostname_format_response_body_for_content_types.post.operation import PostHostnameFormatResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_required_with_empty_array_response_body_for_content_types.post.operation import PostRequiredWithEmptyArrayResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_minimum_validation_request_body.post.operation import PostMinimumValidationRequestBody +from unit_test_api.paths.request_body_post_minlength_validation_request_body.post.operation import PostMinlengthValidationRequestBody +from unit_test_api.paths.request_body_post_enums_in_properties_request_body.post.operation import PostEnumsInPropertiesRequestBody +from unit_test_api.paths.request_body_post_by_small_number_request_body.post.operation import PostBySmallNumberRequestBody +from unit_test_api.paths.request_body_post_additionalproperties_can_exist_by_itself_request_body.post.operation import PostAdditionalpropertiesCanExistByItselfRequestBody +from unit_test_api.paths.request_body_post_allof_with_the_first_empty_schema_request_body.post.operation import PostAllofWithTheFirstEmptySchemaRequestBody +from unit_test_api.paths.response_body_post_oneof_with_empty_schema_response_body_for_content_types.post.operation import PostOneofWithEmptySchemaResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_uniqueitems_validation_request_body.post.operation import PostUniqueitemsValidationRequestBody +from unit_test_api.paths.response_body_post_anyof_response_body_for_content_types.post.operation import PostAnyofResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_maximum_validation_request_body.post.operation import PostMaximumValidationRequestBody +from unit_test_api.paths.request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body.post.operation import PostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody +from unit_test_api.paths.request_body_post_simple_enum_validation_request_body.post.operation import PostSimpleEnumValidationRequestBody +from unit_test_api.paths.response_body_post_oneof_with_required_response_body_for_content_types.post.operation import PostOneofWithRequiredResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_pattern_validation_request_body.post.operation import PostPatternValidationRequestBody +from unit_test_api.paths.response_body_post_allof_with_one_empty_schema_response_body_for_content_types.post.operation import PostAllofWithOneEmptySchemaResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_array_type_matches_arrays_response_body_for_content_types.post.operation import PostArrayTypeMatchesArraysResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_maxlength_validation_response_body_for_content_types.post.operation import PostMaxlengthValidationResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_required_with_escaped_characters_response_body_for_content_types.post.operation import PostRequiredWithEscapedCharactersResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_maxitems_validation_request_body.post.operation import PostMaxitemsValidationRequestBody +from unit_test_api.paths.request_body_post_uniqueitems_false_validation_request_body.post.operation import PostUniqueitemsFalseValidationRequestBody +from unit_test_api.paths.request_body_post_pattern_is_not_anchored_request_body.post.operation import PostPatternIsNotAnchoredRequestBody +from unit_test_api.paths.request_body_post_string_type_matches_strings_request_body.post.operation import PostStringTypeMatchesStringsRequestBody +from unit_test_api.paths.response_body_post_anyof_complex_types_response_body_for_content_types.post.operation import PostAnyofComplexTypesResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types.post.operation import PostNestedOneofToCheckValidationSemanticsResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_by_int_response_body_for_content_types.post.operation import PostByIntResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_forbidden_property_response_body_for_content_types.post.operation import PostForbiddenPropertyResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.post.operation import PostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody +from unit_test_api.paths.request_body_post_enum_with_escaped_characters_request_body.post.operation import PostEnumWithEscapedCharactersRequestBody +from unit_test_api.paths.request_body_post_ipv6_format_request_body.post.operation import PostIpv6FormatRequestBody +from unit_test_api.paths.request_body_post_ref_in_property_request_body.post.operation import PostRefInPropertyRequestBody +from unit_test_api.paths.response_body_post_enum_with_false_does_not_match0_response_body_for_content_types.post.operation import PostEnumWithFalseDoesNotMatch0ResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_ref_in_allof_response_body_for_content_types.post.operation import PostRefInAllofResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_allof_with_two_empty_schemas_request_body.post.operation import PostAllofWithTwoEmptySchemasRequestBody +from unit_test_api.paths.request_body_post_allof_simple_types_request_body.post.operation import PostAllofSimpleTypesRequestBody +from unit_test_api.paths.response_body_post_maxitems_validation_response_body_for_content_types.post.operation import PostMaxitemsValidationResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_required_validation_request_body.post.operation import PostRequiredValidationRequestBody +from unit_test_api.paths.response_body_post_integer_type_matches_integers_response_body_for_content_types.post.operation import PostIntegerTypeMatchesIntegersResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types.post.operation import PostMaximumValidationWithUnsignedIntegerResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types.post.operation import PostNestedAnyofToCheckValidationSemanticsResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_required_default_validation_response_body_for_content_types.post.operation import PostRequiredDefaultValidationResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_invalid_string_value_for_default_request_body.post.operation import PostInvalidStringValueForDefaultRequestBody +from unit_test_api.paths.response_body_post_enum_with1_does_not_match_true_response_body_for_content_types.post.operation import PostEnumWith1DoesNotMatchTrueResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_additionalproperties_are_allowed_by_default_request_body.post.operation import PostAdditionalpropertiesAreAllowedByDefaultRequestBody +from unit_test_api.paths.response_body_post_minimum_validation_response_body_for_content_types.post.operation import PostMinimumValidationResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_required_validation_response_body_for_content_types.post.operation import PostRequiredValidationResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_maxproperties0_means_the_object_is_empty_request_body.post.operation import PostMaxproperties0MeansTheObjectIsEmptyRequestBody +from unit_test_api.paths.request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body.post.operation import PostAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody +from unit_test_api.paths.request_body_post_uri_template_format_request_body.post.operation import PostUriTemplateFormatRequestBody +from unit_test_api.paths.response_body_post_uniqueitems_false_validation_response_body_for_content_types.post.operation import PostUniqueitemsFalseValidationResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_enum_with0_does_not_match_false_request_body.post.operation import PostEnumWith0DoesNotMatchFalseRequestBody +from unit_test_api.paths.request_body_post_minimum_validation_with_signed_integer_request_body.post.operation import PostMinimumValidationWithSignedIntegerRequestBody +from unit_test_api.paths.request_body_post_nested_allof_to_check_validation_semantics_request_body.post.operation import PostNestedAllofToCheckValidationSemanticsRequestBody +from unit_test_api.paths.response_body_post_not_more_complex_schema_response_body_for_content_types.post.operation import PostNotMoreComplexSchemaResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_pattern_validation_response_body_for_content_types.post.operation import PostPatternValidationResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types.post.operation import PostAdditionalpropertiesCanExistByItselfResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_additionalproperties_should_not_look_in_applicators_request_body.post.operation import PostAdditionalpropertiesShouldNotLookInApplicatorsRequestBody +from unit_test_api.paths.request_body_post_nested_anyof_to_check_validation_semantics_request_body.post.operation import PostNestedAnyofToCheckValidationSemanticsRequestBody +from unit_test_api.paths.response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types.post.operation import PostNestedAllofToCheckValidationSemanticsResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_ref_in_allof_request_body.post.operation import PostRefInAllofRequestBody +from unit_test_api.paths.response_body_post_enum_with_escaped_characters_response_body_for_content_types.post.operation import PostEnumWithEscapedCharactersResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_number_type_matches_numbers_response_body_for_content_types.post.operation import PostNumberTypeMatchesNumbersResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types.post.operation import PostAllofCombinedWithAnyofOneofResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_minproperties_validation_request_body.post.operation import PostMinpropertiesValidationRequestBody +from unit_test_api.paths.request_body_post_anyof_request_body.post.operation import PostAnyofRequestBody +from unit_test_api.paths.request_body_post_json_pointer_format_request_body.post.operation import PostJsonPointerFormatRequestBody +from unit_test_api.paths.request_body_post_oneof_request_body.post.operation import PostOneofRequestBody +from unit_test_api.paths.response_body_post_json_pointer_format_response_body_for_content_types.post.operation import PostJsonPointerFormatResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_anyof_complex_types_request_body.post.operation import PostAnyofComplexTypesRequestBody +from unit_test_api.paths.request_body_post_ref_in_items_request_body.post.operation import PostRefInItemsRequestBody +from unit_test_api.paths.request_body_post_oneof_with_base_schema_request_body.post.operation import PostOneofWithBaseSchemaRequestBody +from unit_test_api.paths.request_body_post_forbidden_property_request_body.post.operation import PostForbiddenPropertyRequestBody +from unit_test_api.paths.response_body_post_uri_format_response_body_for_content_types.post.operation import PostUriFormatResponseBodyForContentTypes + + +class ContentTypeJsonApi( + PostRefInAdditionalpropertiesRequestBody, + PostPropertyNamedRefThatIsNotAReferenceResponseBodyForContentTypes, + PostHostnameFormatRequestBody, + PostObjectTypeMatchesObjectsResponseBodyForContentTypes, + PostNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes, + PostStringTypeMatchesStringsResponseBodyForContentTypes, + PostNotRequestBody, + PostIpv4FormatResponseBodyForContentTypes, + PostMaxproperties0MeansTheObjectIsEmptyResponseBodyForContentTypes, + PostMinpropertiesValidationResponseBodyForContentTypes, + PostByNumberResponseBodyForContentTypes, + PostAllofWithBaseSchemaResponseBodyForContentTypes, + PostBooleanTypeMatchesBooleansResponseBodyForContentTypes, + PostAnyofWithOneEmptySchemaResponseBodyForContentTypes, + PostMinimumValidationWithSignedIntegerResponseBodyForContentTypes, + PostOneofComplexTypesResponseBodyForContentTypes, + PostUriTemplateFormatResponseBodyForContentTypes, + PostAllofWithTheLastEmptySchemaRequestBody, + PostEnumWithTrueDoesNotMatch1ResponseBodyForContentTypes, + PostRefInOneofResponseBodyForContentTypes, + PostBooleanTypeMatchesBooleansRequestBody, + PostMaxlengthValidationRequestBody, + PostBySmallNumberResponseBodyForContentTypes, + PostRefInPropertyResponseBodyForContentTypes, + PostSimpleEnumValidationResponseBodyForContentTypes, + PostAnyofWithOneEmptySchemaRequestBody, + PostEmailFormatRequestBody, + PostNullTypeMatchesOnlyTheNullObjectRequestBody, + PostOneofResponseBodyForContentTypes, + PostEmailFormatResponseBodyForContentTypes, + PostAllofWithTwoEmptySchemasResponseBodyForContentTypes, + PostIpv6FormatResponseBodyForContentTypes, + PostInvalidStringValueForDefaultResponseBodyForContentTypes, + PostEnumWithTrueDoesNotMatch1RequestBody, + PostRefInNotRequestBody, + PostNestedOneofToCheckValidationSemanticsRequestBody, + PostArrayTypeMatchesArraysRequestBody, + PostMinitemsValidationRequestBody, + PostUriReferenceFormatResponseBodyForContentTypes, + PostIntegerTypeMatchesIntegersRequestBody, + PostDateTimeFormatResponseBodyForContentTypes, + PostMaximumValidationWithUnsignedIntegerRequestBody, + PostEnumsInPropertiesResponseBodyForContentTypes, + PostPropertyNamedRefThatIsNotAReferenceRequestBody, + PostNestedItemsResponseBodyForContentTypes, + PostAnyofWithBaseSchemaResponseBodyForContentTypes, + PostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfResponseBodyForContentTypes, + PostNulCharactersInStringsRequestBody, + PostByIntRequestBody, + PostMaxpropertiesValidationRequestBody, + PostAdditionalpropertiesAreAllowedByDefaultResponseBodyForContentTypes, + PostOneofWithEmptySchemaRequestBody, + PostUriFormatRequestBody, + PostEnumWith0DoesNotMatchFalseResponseBodyForContentTypes, + PostAllofRequestBody, + PostPropertiesWithEscapedCharactersResponseBodyForContentTypes, + PostMaxpropertiesValidationResponseBodyForContentTypes, + PostUniqueitemsValidationResponseBodyForContentTypes, + PostNestedItemsRequestBody, + PostNumberTypeMatchesNumbersRequestBody, + PostAllofWithBaseSchemaRequestBody, + PostMinitemsValidationResponseBodyForContentTypes, + PostIpv4FormatRequestBody, + PostAllofSimpleTypesResponseBodyForContentTypes, + PostAllofWithTheLastEmptySchemaResponseBodyForContentTypes, + PostPropertiesWithEscapedCharactersRequestBody, + PostOneofWithRequiredRequestBody, + PostMaximumValidationResponseBodyForContentTypes, + PostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyForContentTypes, + PostOneofComplexTypesRequestBody, + PostAllofWithOneEmptySchemaRequestBody, + PostObjectPropertiesValidationRequestBody, + PostUriReferenceFormatRequestBody, + PostOneofWithBaseSchemaResponseBodyForContentTypes, + PostRefInNotResponseBodyForContentTypes, + PostRequiredDefaultValidationRequestBody, + PostAllofCombinedWithAnyofOneofRequestBody, + PostObjectPropertiesValidationResponseBodyForContentTypes, + PostRefInAnyofRequestBody, + PostRefInItemsResponseBodyForContentTypes, + PostAllofResponseBodyForContentTypes, + PostAdditionalpropertiesAllowsASchemaWhichShouldValidateResponseBodyForContentTypes, + PostPatternIsNotAnchoredResponseBodyForContentTypes, + PostRefInOneofRequestBody, + PostNotResponseBodyForContentTypes, + PostRefInAnyofResponseBodyForContentTypes, + PostRequiredWithEscapedCharactersRequestBody, + PostMinlengthValidationResponseBodyForContentTypes, + PostDateTimeFormatRequestBody, + PostAllofWithTheFirstEmptySchemaResponseBodyForContentTypes, + PostByNumberRequestBody, + PostRefInAdditionalpropertiesResponseBodyForContentTypes, + PostAnyofWithBaseSchemaRequestBody, + PostAdditionalpropertiesShouldNotLookInApplicatorsResponseBodyForContentTypes, + PostObjectTypeMatchesObjectsRequestBody, + PostEnumWith1DoesNotMatchTrueRequestBody, + PostEnumWithFalseDoesNotMatch0RequestBody, + PostNotMoreComplexSchemaRequestBody, + PostNulCharactersInStringsResponseBodyForContentTypes, + PostRequiredWithEmptyArrayRequestBody, + PostHostnameFormatResponseBodyForContentTypes, + PostRequiredWithEmptyArrayResponseBodyForContentTypes, + PostMinimumValidationRequestBody, + PostMinlengthValidationRequestBody, + PostEnumsInPropertiesRequestBody, + PostBySmallNumberRequestBody, + PostAdditionalpropertiesCanExistByItselfRequestBody, + PostAllofWithTheFirstEmptySchemaRequestBody, + PostOneofWithEmptySchemaResponseBodyForContentTypes, + PostUniqueitemsValidationRequestBody, + PostAnyofResponseBodyForContentTypes, + PostMaximumValidationRequestBody, + PostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody, + PostSimpleEnumValidationRequestBody, + PostOneofWithRequiredResponseBodyForContentTypes, + PostPatternValidationRequestBody, + PostAllofWithOneEmptySchemaResponseBodyForContentTypes, + PostArrayTypeMatchesArraysResponseBodyForContentTypes, + PostMaxlengthValidationResponseBodyForContentTypes, + PostRequiredWithEscapedCharactersResponseBodyForContentTypes, + PostMaxitemsValidationRequestBody, + PostUniqueitemsFalseValidationRequestBody, + PostPatternIsNotAnchoredRequestBody, + PostStringTypeMatchesStringsRequestBody, + PostAnyofComplexTypesResponseBodyForContentTypes, + PostNestedOneofToCheckValidationSemanticsResponseBodyForContentTypes, + PostByIntResponseBodyForContentTypes, + PostForbiddenPropertyResponseBodyForContentTypes, + PostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody, + PostEnumWithEscapedCharactersRequestBody, + PostIpv6FormatRequestBody, + PostRefInPropertyRequestBody, + PostEnumWithFalseDoesNotMatch0ResponseBodyForContentTypes, + PostRefInAllofResponseBodyForContentTypes, + PostAllofWithTwoEmptySchemasRequestBody, + PostAllofSimpleTypesRequestBody, + PostMaxitemsValidationResponseBodyForContentTypes, + PostRequiredValidationRequestBody, + PostIntegerTypeMatchesIntegersResponseBodyForContentTypes, + PostMaximumValidationWithUnsignedIntegerResponseBodyForContentTypes, + PostNestedAnyofToCheckValidationSemanticsResponseBodyForContentTypes, + PostRequiredDefaultValidationResponseBodyForContentTypes, + PostInvalidStringValueForDefaultRequestBody, + PostEnumWith1DoesNotMatchTrueResponseBodyForContentTypes, + PostAdditionalpropertiesAreAllowedByDefaultRequestBody, + PostMinimumValidationResponseBodyForContentTypes, + PostRequiredValidationResponseBodyForContentTypes, + PostMaxproperties0MeansTheObjectIsEmptyRequestBody, + PostAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody, + PostUriTemplateFormatRequestBody, + PostUniqueitemsFalseValidationResponseBodyForContentTypes, + PostEnumWith0DoesNotMatchFalseRequestBody, + PostMinimumValidationWithSignedIntegerRequestBody, + PostNestedAllofToCheckValidationSemanticsRequestBody, + PostNotMoreComplexSchemaResponseBodyForContentTypes, + PostPatternValidationResponseBodyForContentTypes, + PostAdditionalpropertiesCanExistByItselfResponseBodyForContentTypes, + PostAdditionalpropertiesShouldNotLookInApplicatorsRequestBody, + PostNestedAnyofToCheckValidationSemanticsRequestBody, + PostNestedAllofToCheckValidationSemanticsResponseBodyForContentTypes, + PostRefInAllofRequestBody, + PostEnumWithEscapedCharactersResponseBodyForContentTypes, + PostNumberTypeMatchesNumbersResponseBodyForContentTypes, + PostAllofCombinedWithAnyofOneofResponseBodyForContentTypes, + PostMinpropertiesValidationRequestBody, + PostAnyofRequestBody, + PostJsonPointerFormatRequestBody, + PostOneofRequestBody, + PostJsonPointerFormatResponseBodyForContentTypes, + PostAnyofComplexTypesRequestBody, + PostRefInItemsRequestBody, + PostOneofWithBaseSchemaRequestBody, + PostForbiddenPropertyRequestBody, + PostUriFormatResponseBodyForContentTypes, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/default_api.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/default_api.py new file mode 100644 index 00000000000..d59409cf73e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/default_api.py @@ -0,0 +1,26 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_invalid_string_value_for_default_response_body_for_content_types.post.operation import PostInvalidStringValueForDefaultResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_invalid_string_value_for_default_request_body.post.operation import PostInvalidStringValueForDefaultRequestBody +from unit_test_api.paths.request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.post.operation import PostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody +from unit_test_api.paths.response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types.post.operation import PostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyForContentTypes + + +class DefaultApi( + PostInvalidStringValueForDefaultResponseBodyForContentTypes, + PostInvalidStringValueForDefaultRequestBody, + PostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody, + PostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyForContentTypes, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/enum_api.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/enum_api.py new file mode 100644 index 00000000000..12d4bb0d064 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/enum_api.py @@ -0,0 +1,50 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_enum_with_true_does_not_match1_request_body.post.operation import PostEnumWithTrueDoesNotMatch1RequestBody +from unit_test_api.paths.response_body_post_enum_with0_does_not_match_false_response_body_for_content_types.post.operation import PostEnumWith0DoesNotMatchFalseResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_simple_enum_validation_request_body.post.operation import PostSimpleEnumValidationRequestBody +from unit_test_api.paths.response_body_post_enum_with1_does_not_match_true_response_body_for_content_types.post.operation import PostEnumWith1DoesNotMatchTrueResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_enum_with_escaped_characters_response_body_for_content_types.post.operation import PostEnumWithEscapedCharactersResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_enum_with_true_does_not_match1_response_body_for_content_types.post.operation import PostEnumWithTrueDoesNotMatch1ResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_enum_with1_does_not_match_true_request_body.post.operation import PostEnumWith1DoesNotMatchTrueRequestBody +from unit_test_api.paths.request_body_post_enum_with_false_does_not_match0_request_body.post.operation import PostEnumWithFalseDoesNotMatch0RequestBody +from unit_test_api.paths.response_body_post_enums_in_properties_response_body_for_content_types.post.operation import PostEnumsInPropertiesResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_nul_characters_in_strings_response_body_for_content_types.post.operation import PostNulCharactersInStringsResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_simple_enum_validation_response_body_for_content_types.post.operation import PostSimpleEnumValidationResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_nul_characters_in_strings_request_body.post.operation import PostNulCharactersInStringsRequestBody +from unit_test_api.paths.request_body_post_enums_in_properties_request_body.post.operation import PostEnumsInPropertiesRequestBody +from unit_test_api.paths.request_body_post_enum_with0_does_not_match_false_request_body.post.operation import PostEnumWith0DoesNotMatchFalseRequestBody +from unit_test_api.paths.request_body_post_enum_with_escaped_characters_request_body.post.operation import PostEnumWithEscapedCharactersRequestBody +from unit_test_api.paths.response_body_post_enum_with_false_does_not_match0_response_body_for_content_types.post.operation import PostEnumWithFalseDoesNotMatch0ResponseBodyForContentTypes + + +class EnumApi( + PostEnumWithTrueDoesNotMatch1RequestBody, + PostEnumWith0DoesNotMatchFalseResponseBodyForContentTypes, + PostSimpleEnumValidationRequestBody, + PostEnumWith1DoesNotMatchTrueResponseBodyForContentTypes, + PostEnumWithEscapedCharactersResponseBodyForContentTypes, + PostEnumWithTrueDoesNotMatch1ResponseBodyForContentTypes, + PostEnumWith1DoesNotMatchTrueRequestBody, + PostEnumWithFalseDoesNotMatch0RequestBody, + PostEnumsInPropertiesResponseBodyForContentTypes, + PostNulCharactersInStringsResponseBodyForContentTypes, + PostSimpleEnumValidationResponseBodyForContentTypes, + PostNulCharactersInStringsRequestBody, + PostEnumsInPropertiesRequestBody, + PostEnumWith0DoesNotMatchFalseRequestBody, + PostEnumWithEscapedCharactersRequestBody, + PostEnumWithFalseDoesNotMatch0ResponseBodyForContentTypes, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/format_api.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/format_api.py new file mode 100644 index 00000000000..b59105858d6 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/format_api.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_uri_reference_format_request_body.post.operation import PostUriReferenceFormatRequestBody +from unit_test_api.paths.response_body_post_ipv6_format_response_body_for_content_types.post.operation import PostIpv6FormatResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_date_time_format_request_body.post.operation import PostDateTimeFormatRequestBody +from unit_test_api.paths.request_body_post_hostname_format_request_body.post.operation import PostHostnameFormatRequestBody +from unit_test_api.paths.request_body_post_uri_format_request_body.post.operation import PostUriFormatRequestBody +from unit_test_api.paths.response_body_post_ipv4_format_response_body_for_content_types.post.operation import PostIpv4FormatResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_uri_reference_format_response_body_for_content_types.post.operation import PostUriReferenceFormatResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_uri_template_format_response_body_for_content_types.post.operation import PostUriTemplateFormatResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_date_time_format_response_body_for_content_types.post.operation import PostDateTimeFormatResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_json_pointer_format_request_body.post.operation import PostJsonPointerFormatRequestBody +from unit_test_api.paths.response_body_post_json_pointer_format_response_body_for_content_types.post.operation import PostJsonPointerFormatResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_ipv4_format_request_body.post.operation import PostIpv4FormatRequestBody +from unit_test_api.paths.request_body_post_uri_template_format_request_body.post.operation import PostUriTemplateFormatRequestBody +from unit_test_api.paths.response_body_post_hostname_format_response_body_for_content_types.post.operation import PostHostnameFormatResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_email_format_request_body.post.operation import PostEmailFormatRequestBody +from unit_test_api.paths.request_body_post_ipv6_format_request_body.post.operation import PostIpv6FormatRequestBody +from unit_test_api.paths.response_body_post_uri_format_response_body_for_content_types.post.operation import PostUriFormatResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_email_format_response_body_for_content_types.post.operation import PostEmailFormatResponseBodyForContentTypes + + +class FormatApi( + PostUriReferenceFormatRequestBody, + PostIpv6FormatResponseBodyForContentTypes, + PostDateTimeFormatRequestBody, + PostHostnameFormatRequestBody, + PostUriFormatRequestBody, + PostIpv4FormatResponseBodyForContentTypes, + PostUriReferenceFormatResponseBodyForContentTypes, + PostUriTemplateFormatResponseBodyForContentTypes, + PostDateTimeFormatResponseBodyForContentTypes, + PostJsonPointerFormatRequestBody, + PostJsonPointerFormatResponseBodyForContentTypes, + PostIpv4FormatRequestBody, + PostUriTemplateFormatRequestBody, + PostHostnameFormatResponseBodyForContentTypes, + PostEmailFormatRequestBody, + PostIpv6FormatRequestBody, + PostUriFormatResponseBodyForContentTypes, + PostEmailFormatResponseBodyForContentTypes, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/items_api.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/items_api.py new file mode 100644 index 00000000000..f4123775ade --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/items_api.py @@ -0,0 +1,22 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_nested_items_response_body_for_content_types.post.operation import PostNestedItemsResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_nested_items_request_body.post.operation import PostNestedItemsRequestBody + + +class ItemsApi( + PostNestedItemsResponseBodyForContentTypes, + PostNestedItemsRequestBody, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/max_items_api.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/max_items_api.py new file mode 100644 index 00000000000..23cd9bb24ec --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/max_items_api.py @@ -0,0 +1,22 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_maxitems_validation_response_body_for_content_types.post.operation import PostMaxitemsValidationResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_maxitems_validation_request_body.post.operation import PostMaxitemsValidationRequestBody + + +class MaxItemsApi( + PostMaxitemsValidationResponseBodyForContentTypes, + PostMaxitemsValidationRequestBody, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/max_length_api.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/max_length_api.py new file mode 100644 index 00000000000..70f5e0c8aa8 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/max_length_api.py @@ -0,0 +1,22 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_maxlength_validation_request_body.post.operation import PostMaxlengthValidationRequestBody +from unit_test_api.paths.response_body_post_maxlength_validation_response_body_for_content_types.post.operation import PostMaxlengthValidationResponseBodyForContentTypes + + +class MaxLengthApi( + PostMaxlengthValidationRequestBody, + PostMaxlengthValidationResponseBodyForContentTypes, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/max_properties_api.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/max_properties_api.py new file mode 100644 index 00000000000..3bc7101de6d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/max_properties_api.py @@ -0,0 +1,26 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_maxproperties0_means_the_object_is_empty_request_body.post.operation import PostMaxproperties0MeansTheObjectIsEmptyRequestBody +from unit_test_api.paths.response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types.post.operation import PostMaxproperties0MeansTheObjectIsEmptyResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_maxproperties_validation_response_body_for_content_types.post.operation import PostMaxpropertiesValidationResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_maxproperties_validation_request_body.post.operation import PostMaxpropertiesValidationRequestBody + + +class MaxPropertiesApi( + PostMaxproperties0MeansTheObjectIsEmptyRequestBody, + PostMaxproperties0MeansTheObjectIsEmptyResponseBodyForContentTypes, + PostMaxpropertiesValidationResponseBodyForContentTypes, + PostMaxpropertiesValidationRequestBody, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/maximum_api.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/maximum_api.py new file mode 100644 index 00000000000..50d35b8bf69 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/maximum_api.py @@ -0,0 +1,26 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_maximum_validation_with_unsigned_integer_request_body.post.operation import PostMaximumValidationWithUnsignedIntegerRequestBody +from unit_test_api.paths.response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types.post.operation import PostMaximumValidationWithUnsignedIntegerResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_maximum_validation_request_body.post.operation import PostMaximumValidationRequestBody +from unit_test_api.paths.response_body_post_maximum_validation_response_body_for_content_types.post.operation import PostMaximumValidationResponseBodyForContentTypes + + +class MaximumApi( + PostMaximumValidationWithUnsignedIntegerRequestBody, + PostMaximumValidationWithUnsignedIntegerResponseBodyForContentTypes, + PostMaximumValidationRequestBody, + PostMaximumValidationResponseBodyForContentTypes, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/min_items_api.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/min_items_api.py new file mode 100644 index 00000000000..5982364abc7 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/min_items_api.py @@ -0,0 +1,22 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_minitems_validation_response_body_for_content_types.post.operation import PostMinitemsValidationResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_minitems_validation_request_body.post.operation import PostMinitemsValidationRequestBody + + +class MinItemsApi( + PostMinitemsValidationResponseBodyForContentTypes, + PostMinitemsValidationRequestBody, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/min_length_api.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/min_length_api.py new file mode 100644 index 00000000000..d6361f296cb --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/min_length_api.py @@ -0,0 +1,22 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_minlength_validation_response_body_for_content_types.post.operation import PostMinlengthValidationResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_minlength_validation_request_body.post.operation import PostMinlengthValidationRequestBody + + +class MinLengthApi( + PostMinlengthValidationResponseBodyForContentTypes, + PostMinlengthValidationRequestBody, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/min_properties_api.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/min_properties_api.py new file mode 100644 index 00000000000..198559bf855 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/min_properties_api.py @@ -0,0 +1,22 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_minproperties_validation_request_body.post.operation import PostMinpropertiesValidationRequestBody +from unit_test_api.paths.response_body_post_minproperties_validation_response_body_for_content_types.post.operation import PostMinpropertiesValidationResponseBodyForContentTypes + + +class MinPropertiesApi( + PostMinpropertiesValidationRequestBody, + PostMinpropertiesValidationResponseBodyForContentTypes, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/minimum_api.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/minimum_api.py new file mode 100644 index 00000000000..4e7600d5555 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/minimum_api.py @@ -0,0 +1,26 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types.post.operation import PostMinimumValidationWithSignedIntegerResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_minimum_validation_request_body.post.operation import PostMinimumValidationRequestBody +from unit_test_api.paths.request_body_post_minimum_validation_with_signed_integer_request_body.post.operation import PostMinimumValidationWithSignedIntegerRequestBody +from unit_test_api.paths.response_body_post_minimum_validation_response_body_for_content_types.post.operation import PostMinimumValidationResponseBodyForContentTypes + + +class MinimumApi( + PostMinimumValidationWithSignedIntegerResponseBodyForContentTypes, + PostMinimumValidationRequestBody, + PostMinimumValidationWithSignedIntegerRequestBody, + PostMinimumValidationResponseBodyForContentTypes, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/multiple_of_api.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/multiple_of_api.py new file mode 100644 index 00000000000..2f6c1ce90af --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/multiple_of_api.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_by_number_request_body.post.operation import PostByNumberRequestBody +from unit_test_api.paths.response_body_post_by_small_number_response_body_for_content_types.post.operation import PostBySmallNumberResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_by_int_response_body_for_content_types.post.operation import PostByIntResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_by_number_response_body_for_content_types.post.operation import PostByNumberResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body.post.operation import PostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody +from unit_test_api.paths.response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types.post.operation import PostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_by_small_number_request_body.post.operation import PostBySmallNumberRequestBody +from unit_test_api.paths.request_body_post_by_int_request_body.post.operation import PostByIntRequestBody + + +class MultipleOfApi( + PostByNumberRequestBody, + PostBySmallNumberResponseBodyForContentTypes, + PostByIntResponseBodyForContentTypes, + PostByNumberResponseBodyForContentTypes, + PostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody, + PostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfResponseBodyForContentTypes, + PostBySmallNumberRequestBody, + PostByIntRequestBody, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/one_of_api.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/one_of_api.py new file mode 100644 index 00000000000..c8e0b5be298 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/one_of_api.py @@ -0,0 +1,42 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_oneof_with_base_schema_response_body_for_content_types.post.operation import PostOneofWithBaseSchemaResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_oneof_with_empty_schema_request_body.post.operation import PostOneofWithEmptySchemaRequestBody +from unit_test_api.paths.request_body_post_nested_oneof_to_check_validation_semantics_request_body.post.operation import PostNestedOneofToCheckValidationSemanticsRequestBody +from unit_test_api.paths.request_body_post_oneof_request_body.post.operation import PostOneofRequestBody +from unit_test_api.paths.response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types.post.operation import PostNestedOneofToCheckValidationSemanticsResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_oneof_with_empty_schema_response_body_for_content_types.post.operation import PostOneofWithEmptySchemaResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_oneof_with_base_schema_request_body.post.operation import PostOneofWithBaseSchemaRequestBody +from unit_test_api.paths.response_body_post_oneof_with_required_response_body_for_content_types.post.operation import PostOneofWithRequiredResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_oneof_response_body_for_content_types.post.operation import PostOneofResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_oneof_with_required_request_body.post.operation import PostOneofWithRequiredRequestBody +from unit_test_api.paths.response_body_post_oneof_complex_types_response_body_for_content_types.post.operation import PostOneofComplexTypesResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_oneof_complex_types_request_body.post.operation import PostOneofComplexTypesRequestBody + + +class OneOfApi( + PostOneofWithBaseSchemaResponseBodyForContentTypes, + PostOneofWithEmptySchemaRequestBody, + PostNestedOneofToCheckValidationSemanticsRequestBody, + PostOneofRequestBody, + PostNestedOneofToCheckValidationSemanticsResponseBodyForContentTypes, + PostOneofWithEmptySchemaResponseBodyForContentTypes, + PostOneofWithBaseSchemaRequestBody, + PostOneofWithRequiredResponseBodyForContentTypes, + PostOneofResponseBodyForContentTypes, + PostOneofWithRequiredRequestBody, + PostOneofComplexTypesResponseBodyForContentTypes, + PostOneofComplexTypesRequestBody, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/operation_request_body_api.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/operation_request_body_api.py new file mode 100644 index 00000000000..a1d3e57864d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/operation_request_body_api.py @@ -0,0 +1,192 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_ref_in_additionalproperties_request_body.post.operation import PostRefInAdditionalpropertiesRequestBody +from unit_test_api.paths.request_body_post_date_time_format_request_body.post.operation import PostDateTimeFormatRequestBody +from unit_test_api.paths.request_body_post_by_number_request_body.post.operation import PostByNumberRequestBody +from unit_test_api.paths.request_body_post_hostname_format_request_body.post.operation import PostHostnameFormatRequestBody +from unit_test_api.paths.request_body_post_not_request_body.post.operation import PostNotRequestBody +from unit_test_api.paths.request_body_post_anyof_with_base_schema_request_body.post.operation import PostAnyofWithBaseSchemaRequestBody +from unit_test_api.paths.request_body_post_allof_with_the_last_empty_schema_request_body.post.operation import PostAllofWithTheLastEmptySchemaRequestBody +from unit_test_api.paths.request_body_post_object_type_matches_objects_request_body.post.operation import PostObjectTypeMatchesObjectsRequestBody +from unit_test_api.paths.request_body_post_boolean_type_matches_booleans_request_body.post.operation import PostBooleanTypeMatchesBooleansRequestBody +from unit_test_api.paths.request_body_post_enum_with1_does_not_match_true_request_body.post.operation import PostEnumWith1DoesNotMatchTrueRequestBody +from unit_test_api.paths.request_body_post_maxlength_validation_request_body.post.operation import PostMaxlengthValidationRequestBody +from unit_test_api.paths.request_body_post_enum_with_false_does_not_match0_request_body.post.operation import PostEnumWithFalseDoesNotMatch0RequestBody +from unit_test_api.paths.request_body_post_not_more_complex_schema_request_body.post.operation import PostNotMoreComplexSchemaRequestBody +from unit_test_api.paths.request_body_post_required_with_empty_array_request_body.post.operation import PostRequiredWithEmptyArrayRequestBody +from unit_test_api.paths.request_body_post_anyof_with_one_empty_schema_request_body.post.operation import PostAnyofWithOneEmptySchemaRequestBody +from unit_test_api.paths.request_body_post_email_format_request_body.post.operation import PostEmailFormatRequestBody +from unit_test_api.paths.request_body_post_minimum_validation_request_body.post.operation import PostMinimumValidationRequestBody +from unit_test_api.paths.request_body_post_minlength_validation_request_body.post.operation import PostMinlengthValidationRequestBody +from unit_test_api.paths.request_body_post_null_type_matches_only_the_null_object_request_body.post.operation import PostNullTypeMatchesOnlyTheNullObjectRequestBody +from unit_test_api.paths.request_body_post_enums_in_properties_request_body.post.operation import PostEnumsInPropertiesRequestBody +from unit_test_api.paths.request_body_post_by_small_number_request_body.post.operation import PostBySmallNumberRequestBody +from unit_test_api.paths.request_body_post_additionalproperties_can_exist_by_itself_request_body.post.operation import PostAdditionalpropertiesCanExistByItselfRequestBody +from unit_test_api.paths.request_body_post_enum_with_true_does_not_match1_request_body.post.operation import PostEnumWithTrueDoesNotMatch1RequestBody +from unit_test_api.paths.request_body_post_ref_in_not_request_body.post.operation import PostRefInNotRequestBody +from unit_test_api.paths.request_body_post_nested_oneof_to_check_validation_semantics_request_body.post.operation import PostNestedOneofToCheckValidationSemanticsRequestBody +from unit_test_api.paths.request_body_post_allof_with_the_first_empty_schema_request_body.post.operation import PostAllofWithTheFirstEmptySchemaRequestBody +from unit_test_api.paths.request_body_post_uniqueitems_validation_request_body.post.operation import PostUniqueitemsValidationRequestBody +from unit_test_api.paths.request_body_post_array_type_matches_arrays_request_body.post.operation import PostArrayTypeMatchesArraysRequestBody +from unit_test_api.paths.request_body_post_maximum_validation_request_body.post.operation import PostMaximumValidationRequestBody +from unit_test_api.paths.request_body_post_minitems_validation_request_body.post.operation import PostMinitemsValidationRequestBody +from unit_test_api.paths.request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body.post.operation import PostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody +from unit_test_api.paths.request_body_post_simple_enum_validation_request_body.post.operation import PostSimpleEnumValidationRequestBody +from unit_test_api.paths.request_body_post_integer_type_matches_integers_request_body.post.operation import PostIntegerTypeMatchesIntegersRequestBody +from unit_test_api.paths.request_body_post_pattern_validation_request_body.post.operation import PostPatternValidationRequestBody +from unit_test_api.paths.request_body_post_maxitems_validation_request_body.post.operation import PostMaxitemsValidationRequestBody +from unit_test_api.paths.request_body_post_uniqueitems_false_validation_request_body.post.operation import PostUniqueitemsFalseValidationRequestBody +from unit_test_api.paths.request_body_post_pattern_is_not_anchored_request_body.post.operation import PostPatternIsNotAnchoredRequestBody +from unit_test_api.paths.request_body_post_string_type_matches_strings_request_body.post.operation import PostStringTypeMatchesStringsRequestBody +from unit_test_api.paths.request_body_post_maximum_validation_with_unsigned_integer_request_body.post.operation import PostMaximumValidationWithUnsignedIntegerRequestBody +from unit_test_api.paths.request_body_post_property_named_ref_that_is_not_a_reference_request_body.post.operation import PostPropertyNamedRefThatIsNotAReferenceRequestBody +from unit_test_api.paths.request_body_post_nul_characters_in_strings_request_body.post.operation import PostNulCharactersInStringsRequestBody +from unit_test_api.paths.request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.post.operation import PostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody +from unit_test_api.paths.request_body_post_enum_with_escaped_characters_request_body.post.operation import PostEnumWithEscapedCharactersRequestBody +from unit_test_api.paths.request_body_post_ipv6_format_request_body.post.operation import PostIpv6FormatRequestBody +from unit_test_api.paths.request_body_post_ref_in_property_request_body.post.operation import PostRefInPropertyRequestBody +from unit_test_api.paths.request_body_post_by_int_request_body.post.operation import PostByIntRequestBody +from unit_test_api.paths.request_body_post_maxproperties_validation_request_body.post.operation import PostMaxpropertiesValidationRequestBody +from unit_test_api.paths.request_body_post_allof_with_two_empty_schemas_request_body.post.operation import PostAllofWithTwoEmptySchemasRequestBody +from unit_test_api.paths.request_body_post_allof_simple_types_request_body.post.operation import PostAllofSimpleTypesRequestBody +from unit_test_api.paths.request_body_post_oneof_with_empty_schema_request_body.post.operation import PostOneofWithEmptySchemaRequestBody +from unit_test_api.paths.request_body_post_required_validation_request_body.post.operation import PostRequiredValidationRequestBody +from unit_test_api.paths.request_body_post_uri_format_request_body.post.operation import PostUriFormatRequestBody +from unit_test_api.paths.request_body_post_invalid_string_value_for_default_request_body.post.operation import PostInvalidStringValueForDefaultRequestBody +from unit_test_api.paths.request_body_post_allof_request_body.post.operation import PostAllofRequestBody +from unit_test_api.paths.request_body_post_additionalproperties_are_allowed_by_default_request_body.post.operation import PostAdditionalpropertiesAreAllowedByDefaultRequestBody +from unit_test_api.paths.request_body_post_nested_items_request_body.post.operation import PostNestedItemsRequestBody +from unit_test_api.paths.request_body_post_number_type_matches_numbers_request_body.post.operation import PostNumberTypeMatchesNumbersRequestBody +from unit_test_api.paths.request_body_post_allof_with_base_schema_request_body.post.operation import PostAllofWithBaseSchemaRequestBody +from unit_test_api.paths.request_body_post_maxproperties0_means_the_object_is_empty_request_body.post.operation import PostMaxproperties0MeansTheObjectIsEmptyRequestBody +from unit_test_api.paths.request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body.post.operation import PostAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody +from unit_test_api.paths.request_body_post_ipv4_format_request_body.post.operation import PostIpv4FormatRequestBody +from unit_test_api.paths.request_body_post_uri_template_format_request_body.post.operation import PostUriTemplateFormatRequestBody +from unit_test_api.paths.request_body_post_properties_with_escaped_characters_request_body.post.operation import PostPropertiesWithEscapedCharactersRequestBody +from unit_test_api.paths.request_body_post_oneof_with_required_request_body.post.operation import PostOneofWithRequiredRequestBody +from unit_test_api.paths.request_body_post_enum_with0_does_not_match_false_request_body.post.operation import PostEnumWith0DoesNotMatchFalseRequestBody +from unit_test_api.paths.request_body_post_minimum_validation_with_signed_integer_request_body.post.operation import PostMinimumValidationWithSignedIntegerRequestBody +from unit_test_api.paths.request_body_post_oneof_complex_types_request_body.post.operation import PostOneofComplexTypesRequestBody +from unit_test_api.paths.request_body_post_allof_with_one_empty_schema_request_body.post.operation import PostAllofWithOneEmptySchemaRequestBody +from unit_test_api.paths.request_body_post_nested_allof_to_check_validation_semantics_request_body.post.operation import PostNestedAllofToCheckValidationSemanticsRequestBody +from unit_test_api.paths.request_body_post_object_properties_validation_request_body.post.operation import PostObjectPropertiesValidationRequestBody +from unit_test_api.paths.request_body_post_uri_reference_format_request_body.post.operation import PostUriReferenceFormatRequestBody +from unit_test_api.paths.request_body_post_required_default_validation_request_body.post.operation import PostRequiredDefaultValidationRequestBody +from unit_test_api.paths.request_body_post_allof_combined_with_anyof_oneof_request_body.post.operation import PostAllofCombinedWithAnyofOneofRequestBody +from unit_test_api.paths.request_body_post_ref_in_anyof_request_body.post.operation import PostRefInAnyofRequestBody +from unit_test_api.paths.request_body_post_additionalproperties_should_not_look_in_applicators_request_body.post.operation import PostAdditionalpropertiesShouldNotLookInApplicatorsRequestBody +from unit_test_api.paths.request_body_post_nested_anyof_to_check_validation_semantics_request_body.post.operation import PostNestedAnyofToCheckValidationSemanticsRequestBody +from unit_test_api.paths.request_body_post_ref_in_allof_request_body.post.operation import PostRefInAllofRequestBody +from unit_test_api.paths.request_body_post_minproperties_validation_request_body.post.operation import PostMinpropertiesValidationRequestBody +from unit_test_api.paths.request_body_post_anyof_request_body.post.operation import PostAnyofRequestBody +from unit_test_api.paths.request_body_post_json_pointer_format_request_body.post.operation import PostJsonPointerFormatRequestBody +from unit_test_api.paths.request_body_post_oneof_request_body.post.operation import PostOneofRequestBody +from unit_test_api.paths.request_body_post_anyof_complex_types_request_body.post.operation import PostAnyofComplexTypesRequestBody +from unit_test_api.paths.request_body_post_ref_in_items_request_body.post.operation import PostRefInItemsRequestBody +from unit_test_api.paths.request_body_post_oneof_with_base_schema_request_body.post.operation import PostOneofWithBaseSchemaRequestBody +from unit_test_api.paths.request_body_post_ref_in_oneof_request_body.post.operation import PostRefInOneofRequestBody +from unit_test_api.paths.request_body_post_forbidden_property_request_body.post.operation import PostForbiddenPropertyRequestBody +from unit_test_api.paths.request_body_post_required_with_escaped_characters_request_body.post.operation import PostRequiredWithEscapedCharactersRequestBody + + +class OperationRequestBodyApi( + PostRefInAdditionalpropertiesRequestBody, + PostDateTimeFormatRequestBody, + PostByNumberRequestBody, + PostHostnameFormatRequestBody, + PostNotRequestBody, + PostAnyofWithBaseSchemaRequestBody, + PostAllofWithTheLastEmptySchemaRequestBody, + PostObjectTypeMatchesObjectsRequestBody, + PostBooleanTypeMatchesBooleansRequestBody, + PostEnumWith1DoesNotMatchTrueRequestBody, + PostMaxlengthValidationRequestBody, + PostEnumWithFalseDoesNotMatch0RequestBody, + PostNotMoreComplexSchemaRequestBody, + PostRequiredWithEmptyArrayRequestBody, + PostAnyofWithOneEmptySchemaRequestBody, + PostEmailFormatRequestBody, + PostMinimumValidationRequestBody, + PostMinlengthValidationRequestBody, + PostNullTypeMatchesOnlyTheNullObjectRequestBody, + PostEnumsInPropertiesRequestBody, + PostBySmallNumberRequestBody, + PostAdditionalpropertiesCanExistByItselfRequestBody, + PostEnumWithTrueDoesNotMatch1RequestBody, + PostRefInNotRequestBody, + PostNestedOneofToCheckValidationSemanticsRequestBody, + PostAllofWithTheFirstEmptySchemaRequestBody, + PostUniqueitemsValidationRequestBody, + PostArrayTypeMatchesArraysRequestBody, + PostMaximumValidationRequestBody, + PostMinitemsValidationRequestBody, + PostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody, + PostSimpleEnumValidationRequestBody, + PostIntegerTypeMatchesIntegersRequestBody, + PostPatternValidationRequestBody, + PostMaxitemsValidationRequestBody, + PostUniqueitemsFalseValidationRequestBody, + PostPatternIsNotAnchoredRequestBody, + PostStringTypeMatchesStringsRequestBody, + PostMaximumValidationWithUnsignedIntegerRequestBody, + PostPropertyNamedRefThatIsNotAReferenceRequestBody, + PostNulCharactersInStringsRequestBody, + PostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody, + PostEnumWithEscapedCharactersRequestBody, + PostIpv6FormatRequestBody, + PostRefInPropertyRequestBody, + PostByIntRequestBody, + PostMaxpropertiesValidationRequestBody, + PostAllofWithTwoEmptySchemasRequestBody, + PostAllofSimpleTypesRequestBody, + PostOneofWithEmptySchemaRequestBody, + PostRequiredValidationRequestBody, + PostUriFormatRequestBody, + PostInvalidStringValueForDefaultRequestBody, + PostAllofRequestBody, + PostAdditionalpropertiesAreAllowedByDefaultRequestBody, + PostNestedItemsRequestBody, + PostNumberTypeMatchesNumbersRequestBody, + PostAllofWithBaseSchemaRequestBody, + PostMaxproperties0MeansTheObjectIsEmptyRequestBody, + PostAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody, + PostIpv4FormatRequestBody, + PostUriTemplateFormatRequestBody, + PostPropertiesWithEscapedCharactersRequestBody, + PostOneofWithRequiredRequestBody, + PostEnumWith0DoesNotMatchFalseRequestBody, + PostMinimumValidationWithSignedIntegerRequestBody, + PostOneofComplexTypesRequestBody, + PostAllofWithOneEmptySchemaRequestBody, + PostNestedAllofToCheckValidationSemanticsRequestBody, + PostObjectPropertiesValidationRequestBody, + PostUriReferenceFormatRequestBody, + PostRequiredDefaultValidationRequestBody, + PostAllofCombinedWithAnyofOneofRequestBody, + PostRefInAnyofRequestBody, + PostAdditionalpropertiesShouldNotLookInApplicatorsRequestBody, + PostNestedAnyofToCheckValidationSemanticsRequestBody, + PostRefInAllofRequestBody, + PostMinpropertiesValidationRequestBody, + PostAnyofRequestBody, + PostJsonPointerFormatRequestBody, + PostOneofRequestBody, + PostAnyofComplexTypesRequestBody, + PostRefInItemsRequestBody, + PostOneofWithBaseSchemaRequestBody, + PostRefInOneofRequestBody, + PostForbiddenPropertyRequestBody, + PostRequiredWithEscapedCharactersRequestBody, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/path_post_api.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/path_post_api.py new file mode 100644 index 00000000000..c7cb826efcf --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/path_post_api.py @@ -0,0 +1,366 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_ref_in_additionalproperties_request_body.post.operation import PostRefInAdditionalpropertiesRequestBody +from unit_test_api.paths.response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types.post.operation import PostPropertyNamedRefThatIsNotAReferenceResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_hostname_format_request_body.post.operation import PostHostnameFormatRequestBody +from unit_test_api.paths.response_body_post_object_type_matches_objects_response_body_for_content_types.post.operation import PostObjectTypeMatchesObjectsResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types.post.operation import PostNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_string_type_matches_strings_response_body_for_content_types.post.operation import PostStringTypeMatchesStringsResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_not_request_body.post.operation import PostNotRequestBody +from unit_test_api.paths.response_body_post_ipv4_format_response_body_for_content_types.post.operation import PostIpv4FormatResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types.post.operation import PostMaxproperties0MeansTheObjectIsEmptyResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_minproperties_validation_response_body_for_content_types.post.operation import PostMinpropertiesValidationResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_by_number_response_body_for_content_types.post.operation import PostByNumberResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_allof_with_base_schema_response_body_for_content_types.post.operation import PostAllofWithBaseSchemaResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_boolean_type_matches_booleans_response_body_for_content_types.post.operation import PostBooleanTypeMatchesBooleansResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_anyof_with_one_empty_schema_response_body_for_content_types.post.operation import PostAnyofWithOneEmptySchemaResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types.post.operation import PostMinimumValidationWithSignedIntegerResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_oneof_complex_types_response_body_for_content_types.post.operation import PostOneofComplexTypesResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_uri_template_format_response_body_for_content_types.post.operation import PostUriTemplateFormatResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_allof_with_the_last_empty_schema_request_body.post.operation import PostAllofWithTheLastEmptySchemaRequestBody +from unit_test_api.paths.response_body_post_enum_with_true_does_not_match1_response_body_for_content_types.post.operation import PostEnumWithTrueDoesNotMatch1ResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_ref_in_oneof_response_body_for_content_types.post.operation import PostRefInOneofResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_boolean_type_matches_booleans_request_body.post.operation import PostBooleanTypeMatchesBooleansRequestBody +from unit_test_api.paths.request_body_post_maxlength_validation_request_body.post.operation import PostMaxlengthValidationRequestBody +from unit_test_api.paths.response_body_post_by_small_number_response_body_for_content_types.post.operation import PostBySmallNumberResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_ref_in_property_response_body_for_content_types.post.operation import PostRefInPropertyResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_simple_enum_validation_response_body_for_content_types.post.operation import PostSimpleEnumValidationResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_anyof_with_one_empty_schema_request_body.post.operation import PostAnyofWithOneEmptySchemaRequestBody +from unit_test_api.paths.request_body_post_email_format_request_body.post.operation import PostEmailFormatRequestBody +from unit_test_api.paths.request_body_post_null_type_matches_only_the_null_object_request_body.post.operation import PostNullTypeMatchesOnlyTheNullObjectRequestBody +from unit_test_api.paths.response_body_post_oneof_response_body_for_content_types.post.operation import PostOneofResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_email_format_response_body_for_content_types.post.operation import PostEmailFormatResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_allof_with_two_empty_schemas_response_body_for_content_types.post.operation import PostAllofWithTwoEmptySchemasResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_ipv6_format_response_body_for_content_types.post.operation import PostIpv6FormatResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_invalid_string_value_for_default_response_body_for_content_types.post.operation import PostInvalidStringValueForDefaultResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_enum_with_true_does_not_match1_request_body.post.operation import PostEnumWithTrueDoesNotMatch1RequestBody +from unit_test_api.paths.request_body_post_ref_in_not_request_body.post.operation import PostRefInNotRequestBody +from unit_test_api.paths.request_body_post_nested_oneof_to_check_validation_semantics_request_body.post.operation import PostNestedOneofToCheckValidationSemanticsRequestBody +from unit_test_api.paths.request_body_post_array_type_matches_arrays_request_body.post.operation import PostArrayTypeMatchesArraysRequestBody +from unit_test_api.paths.request_body_post_minitems_validation_request_body.post.operation import PostMinitemsValidationRequestBody +from unit_test_api.paths.response_body_post_uri_reference_format_response_body_for_content_types.post.operation import PostUriReferenceFormatResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_integer_type_matches_integers_request_body.post.operation import PostIntegerTypeMatchesIntegersRequestBody +from unit_test_api.paths.response_body_post_date_time_format_response_body_for_content_types.post.operation import PostDateTimeFormatResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_maximum_validation_with_unsigned_integer_request_body.post.operation import PostMaximumValidationWithUnsignedIntegerRequestBody +from unit_test_api.paths.response_body_post_enums_in_properties_response_body_for_content_types.post.operation import PostEnumsInPropertiesResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_property_named_ref_that_is_not_a_reference_request_body.post.operation import PostPropertyNamedRefThatIsNotAReferenceRequestBody +from unit_test_api.paths.response_body_post_nested_items_response_body_for_content_types.post.operation import PostNestedItemsResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_anyof_with_base_schema_response_body_for_content_types.post.operation import PostAnyofWithBaseSchemaResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types.post.operation import PostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_nul_characters_in_strings_request_body.post.operation import PostNulCharactersInStringsRequestBody +from unit_test_api.paths.request_body_post_by_int_request_body.post.operation import PostByIntRequestBody +from unit_test_api.paths.request_body_post_maxproperties_validation_request_body.post.operation import PostMaxpropertiesValidationRequestBody +from unit_test_api.paths.response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types.post.operation import PostAdditionalpropertiesAreAllowedByDefaultResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_oneof_with_empty_schema_request_body.post.operation import PostOneofWithEmptySchemaRequestBody +from unit_test_api.paths.request_body_post_uri_format_request_body.post.operation import PostUriFormatRequestBody +from unit_test_api.paths.response_body_post_enum_with0_does_not_match_false_response_body_for_content_types.post.operation import PostEnumWith0DoesNotMatchFalseResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_allof_request_body.post.operation import PostAllofRequestBody +from unit_test_api.paths.response_body_post_properties_with_escaped_characters_response_body_for_content_types.post.operation import PostPropertiesWithEscapedCharactersResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_maxproperties_validation_response_body_for_content_types.post.operation import PostMaxpropertiesValidationResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_uniqueitems_validation_response_body_for_content_types.post.operation import PostUniqueitemsValidationResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_nested_items_request_body.post.operation import PostNestedItemsRequestBody +from unit_test_api.paths.request_body_post_number_type_matches_numbers_request_body.post.operation import PostNumberTypeMatchesNumbersRequestBody +from unit_test_api.paths.request_body_post_allof_with_base_schema_request_body.post.operation import PostAllofWithBaseSchemaRequestBody +from unit_test_api.paths.response_body_post_minitems_validation_response_body_for_content_types.post.operation import PostMinitemsValidationResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_ipv4_format_request_body.post.operation import PostIpv4FormatRequestBody +from unit_test_api.paths.response_body_post_allof_simple_types_response_body_for_content_types.post.operation import PostAllofSimpleTypesResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types.post.operation import PostAllofWithTheLastEmptySchemaResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_properties_with_escaped_characters_request_body.post.operation import PostPropertiesWithEscapedCharactersRequestBody +from unit_test_api.paths.request_body_post_oneof_with_required_request_body.post.operation import PostOneofWithRequiredRequestBody +from unit_test_api.paths.response_body_post_maximum_validation_response_body_for_content_types.post.operation import PostMaximumValidationResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types.post.operation import PostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_oneof_complex_types_request_body.post.operation import PostOneofComplexTypesRequestBody +from unit_test_api.paths.request_body_post_allof_with_one_empty_schema_request_body.post.operation import PostAllofWithOneEmptySchemaRequestBody +from unit_test_api.paths.request_body_post_object_properties_validation_request_body.post.operation import PostObjectPropertiesValidationRequestBody +from unit_test_api.paths.request_body_post_uri_reference_format_request_body.post.operation import PostUriReferenceFormatRequestBody +from unit_test_api.paths.response_body_post_oneof_with_base_schema_response_body_for_content_types.post.operation import PostOneofWithBaseSchemaResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_ref_in_not_response_body_for_content_types.post.operation import PostRefInNotResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_required_default_validation_request_body.post.operation import PostRequiredDefaultValidationRequestBody +from unit_test_api.paths.request_body_post_allof_combined_with_anyof_oneof_request_body.post.operation import PostAllofCombinedWithAnyofOneofRequestBody +from unit_test_api.paths.response_body_post_object_properties_validation_response_body_for_content_types.post.operation import PostObjectPropertiesValidationResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_ref_in_anyof_request_body.post.operation import PostRefInAnyofRequestBody +from unit_test_api.paths.response_body_post_ref_in_items_response_body_for_content_types.post.operation import PostRefInItemsResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_allof_response_body_for_content_types.post.operation import PostAllofResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types.post.operation import PostAdditionalpropertiesAllowsASchemaWhichShouldValidateResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_pattern_is_not_anchored_response_body_for_content_types.post.operation import PostPatternIsNotAnchoredResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_ref_in_oneof_request_body.post.operation import PostRefInOneofRequestBody +from unit_test_api.paths.response_body_post_not_response_body_for_content_types.post.operation import PostNotResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_ref_in_anyof_response_body_for_content_types.post.operation import PostRefInAnyofResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_required_with_escaped_characters_request_body.post.operation import PostRequiredWithEscapedCharactersRequestBody +from unit_test_api.paths.response_body_post_minlength_validation_response_body_for_content_types.post.operation import PostMinlengthValidationResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_date_time_format_request_body.post.operation import PostDateTimeFormatRequestBody +from unit_test_api.paths.response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types.post.operation import PostAllofWithTheFirstEmptySchemaResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_by_number_request_body.post.operation import PostByNumberRequestBody +from unit_test_api.paths.response_body_post_ref_in_additionalproperties_response_body_for_content_types.post.operation import PostRefInAdditionalpropertiesResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_anyof_with_base_schema_request_body.post.operation import PostAnyofWithBaseSchemaRequestBody +from unit_test_api.paths.response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types.post.operation import PostAdditionalpropertiesShouldNotLookInApplicatorsResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_object_type_matches_objects_request_body.post.operation import PostObjectTypeMatchesObjectsRequestBody +from unit_test_api.paths.request_body_post_enum_with1_does_not_match_true_request_body.post.operation import PostEnumWith1DoesNotMatchTrueRequestBody +from unit_test_api.paths.request_body_post_enum_with_false_does_not_match0_request_body.post.operation import PostEnumWithFalseDoesNotMatch0RequestBody +from unit_test_api.paths.request_body_post_not_more_complex_schema_request_body.post.operation import PostNotMoreComplexSchemaRequestBody +from unit_test_api.paths.response_body_post_nul_characters_in_strings_response_body_for_content_types.post.operation import PostNulCharactersInStringsResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_required_with_empty_array_request_body.post.operation import PostRequiredWithEmptyArrayRequestBody +from unit_test_api.paths.response_body_post_hostname_format_response_body_for_content_types.post.operation import PostHostnameFormatResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_required_with_empty_array_response_body_for_content_types.post.operation import PostRequiredWithEmptyArrayResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_minimum_validation_request_body.post.operation import PostMinimumValidationRequestBody +from unit_test_api.paths.request_body_post_minlength_validation_request_body.post.operation import PostMinlengthValidationRequestBody +from unit_test_api.paths.request_body_post_enums_in_properties_request_body.post.operation import PostEnumsInPropertiesRequestBody +from unit_test_api.paths.request_body_post_by_small_number_request_body.post.operation import PostBySmallNumberRequestBody +from unit_test_api.paths.request_body_post_additionalproperties_can_exist_by_itself_request_body.post.operation import PostAdditionalpropertiesCanExistByItselfRequestBody +from unit_test_api.paths.request_body_post_allof_with_the_first_empty_schema_request_body.post.operation import PostAllofWithTheFirstEmptySchemaRequestBody +from unit_test_api.paths.response_body_post_oneof_with_empty_schema_response_body_for_content_types.post.operation import PostOneofWithEmptySchemaResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_uniqueitems_validation_request_body.post.operation import PostUniqueitemsValidationRequestBody +from unit_test_api.paths.response_body_post_anyof_response_body_for_content_types.post.operation import PostAnyofResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_maximum_validation_request_body.post.operation import PostMaximumValidationRequestBody +from unit_test_api.paths.request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body.post.operation import PostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody +from unit_test_api.paths.request_body_post_simple_enum_validation_request_body.post.operation import PostSimpleEnumValidationRequestBody +from unit_test_api.paths.response_body_post_oneof_with_required_response_body_for_content_types.post.operation import PostOneofWithRequiredResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_pattern_validation_request_body.post.operation import PostPatternValidationRequestBody +from unit_test_api.paths.response_body_post_allof_with_one_empty_schema_response_body_for_content_types.post.operation import PostAllofWithOneEmptySchemaResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_array_type_matches_arrays_response_body_for_content_types.post.operation import PostArrayTypeMatchesArraysResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_maxlength_validation_response_body_for_content_types.post.operation import PostMaxlengthValidationResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_required_with_escaped_characters_response_body_for_content_types.post.operation import PostRequiredWithEscapedCharactersResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_maxitems_validation_request_body.post.operation import PostMaxitemsValidationRequestBody +from unit_test_api.paths.request_body_post_uniqueitems_false_validation_request_body.post.operation import PostUniqueitemsFalseValidationRequestBody +from unit_test_api.paths.request_body_post_pattern_is_not_anchored_request_body.post.operation import PostPatternIsNotAnchoredRequestBody +from unit_test_api.paths.request_body_post_string_type_matches_strings_request_body.post.operation import PostStringTypeMatchesStringsRequestBody +from unit_test_api.paths.response_body_post_anyof_complex_types_response_body_for_content_types.post.operation import PostAnyofComplexTypesResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types.post.operation import PostNestedOneofToCheckValidationSemanticsResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_by_int_response_body_for_content_types.post.operation import PostByIntResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_forbidden_property_response_body_for_content_types.post.operation import PostForbiddenPropertyResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.post.operation import PostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody +from unit_test_api.paths.request_body_post_enum_with_escaped_characters_request_body.post.operation import PostEnumWithEscapedCharactersRequestBody +from unit_test_api.paths.request_body_post_ipv6_format_request_body.post.operation import PostIpv6FormatRequestBody +from unit_test_api.paths.request_body_post_ref_in_property_request_body.post.operation import PostRefInPropertyRequestBody +from unit_test_api.paths.response_body_post_enum_with_false_does_not_match0_response_body_for_content_types.post.operation import PostEnumWithFalseDoesNotMatch0ResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_ref_in_allof_response_body_for_content_types.post.operation import PostRefInAllofResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_allof_with_two_empty_schemas_request_body.post.operation import PostAllofWithTwoEmptySchemasRequestBody +from unit_test_api.paths.request_body_post_allof_simple_types_request_body.post.operation import PostAllofSimpleTypesRequestBody +from unit_test_api.paths.response_body_post_maxitems_validation_response_body_for_content_types.post.operation import PostMaxitemsValidationResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_required_validation_request_body.post.operation import PostRequiredValidationRequestBody +from unit_test_api.paths.response_body_post_integer_type_matches_integers_response_body_for_content_types.post.operation import PostIntegerTypeMatchesIntegersResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types.post.operation import PostMaximumValidationWithUnsignedIntegerResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types.post.operation import PostNestedAnyofToCheckValidationSemanticsResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_required_default_validation_response_body_for_content_types.post.operation import PostRequiredDefaultValidationResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_invalid_string_value_for_default_request_body.post.operation import PostInvalidStringValueForDefaultRequestBody +from unit_test_api.paths.response_body_post_enum_with1_does_not_match_true_response_body_for_content_types.post.operation import PostEnumWith1DoesNotMatchTrueResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_additionalproperties_are_allowed_by_default_request_body.post.operation import PostAdditionalpropertiesAreAllowedByDefaultRequestBody +from unit_test_api.paths.response_body_post_minimum_validation_response_body_for_content_types.post.operation import PostMinimumValidationResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_required_validation_response_body_for_content_types.post.operation import PostRequiredValidationResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_maxproperties0_means_the_object_is_empty_request_body.post.operation import PostMaxproperties0MeansTheObjectIsEmptyRequestBody +from unit_test_api.paths.request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body.post.operation import PostAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody +from unit_test_api.paths.request_body_post_uri_template_format_request_body.post.operation import PostUriTemplateFormatRequestBody +from unit_test_api.paths.response_body_post_uniqueitems_false_validation_response_body_for_content_types.post.operation import PostUniqueitemsFalseValidationResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_enum_with0_does_not_match_false_request_body.post.operation import PostEnumWith0DoesNotMatchFalseRequestBody +from unit_test_api.paths.request_body_post_minimum_validation_with_signed_integer_request_body.post.operation import PostMinimumValidationWithSignedIntegerRequestBody +from unit_test_api.paths.request_body_post_nested_allof_to_check_validation_semantics_request_body.post.operation import PostNestedAllofToCheckValidationSemanticsRequestBody +from unit_test_api.paths.response_body_post_not_more_complex_schema_response_body_for_content_types.post.operation import PostNotMoreComplexSchemaResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_pattern_validation_response_body_for_content_types.post.operation import PostPatternValidationResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types.post.operation import PostAdditionalpropertiesCanExistByItselfResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_additionalproperties_should_not_look_in_applicators_request_body.post.operation import PostAdditionalpropertiesShouldNotLookInApplicatorsRequestBody +from unit_test_api.paths.request_body_post_nested_anyof_to_check_validation_semantics_request_body.post.operation import PostNestedAnyofToCheckValidationSemanticsRequestBody +from unit_test_api.paths.response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types.post.operation import PostNestedAllofToCheckValidationSemanticsResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_ref_in_allof_request_body.post.operation import PostRefInAllofRequestBody +from unit_test_api.paths.response_body_post_enum_with_escaped_characters_response_body_for_content_types.post.operation import PostEnumWithEscapedCharactersResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_number_type_matches_numbers_response_body_for_content_types.post.operation import PostNumberTypeMatchesNumbersResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types.post.operation import PostAllofCombinedWithAnyofOneofResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_minproperties_validation_request_body.post.operation import PostMinpropertiesValidationRequestBody +from unit_test_api.paths.request_body_post_anyof_request_body.post.operation import PostAnyofRequestBody +from unit_test_api.paths.request_body_post_json_pointer_format_request_body.post.operation import PostJsonPointerFormatRequestBody +from unit_test_api.paths.request_body_post_oneof_request_body.post.operation import PostOneofRequestBody +from unit_test_api.paths.response_body_post_json_pointer_format_response_body_for_content_types.post.operation import PostJsonPointerFormatResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_anyof_complex_types_request_body.post.operation import PostAnyofComplexTypesRequestBody +from unit_test_api.paths.request_body_post_ref_in_items_request_body.post.operation import PostRefInItemsRequestBody +from unit_test_api.paths.request_body_post_oneof_with_base_schema_request_body.post.operation import PostOneofWithBaseSchemaRequestBody +from unit_test_api.paths.request_body_post_forbidden_property_request_body.post.operation import PostForbiddenPropertyRequestBody +from unit_test_api.paths.response_body_post_uri_format_response_body_for_content_types.post.operation import PostUriFormatResponseBodyForContentTypes + + +class PathPostApi( + PostRefInAdditionalpropertiesRequestBody, + PostPropertyNamedRefThatIsNotAReferenceResponseBodyForContentTypes, + PostHostnameFormatRequestBody, + PostObjectTypeMatchesObjectsResponseBodyForContentTypes, + PostNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes, + PostStringTypeMatchesStringsResponseBodyForContentTypes, + PostNotRequestBody, + PostIpv4FormatResponseBodyForContentTypes, + PostMaxproperties0MeansTheObjectIsEmptyResponseBodyForContentTypes, + PostMinpropertiesValidationResponseBodyForContentTypes, + PostByNumberResponseBodyForContentTypes, + PostAllofWithBaseSchemaResponseBodyForContentTypes, + PostBooleanTypeMatchesBooleansResponseBodyForContentTypes, + PostAnyofWithOneEmptySchemaResponseBodyForContentTypes, + PostMinimumValidationWithSignedIntegerResponseBodyForContentTypes, + PostOneofComplexTypesResponseBodyForContentTypes, + PostUriTemplateFormatResponseBodyForContentTypes, + PostAllofWithTheLastEmptySchemaRequestBody, + PostEnumWithTrueDoesNotMatch1ResponseBodyForContentTypes, + PostRefInOneofResponseBodyForContentTypes, + PostBooleanTypeMatchesBooleansRequestBody, + PostMaxlengthValidationRequestBody, + PostBySmallNumberResponseBodyForContentTypes, + PostRefInPropertyResponseBodyForContentTypes, + PostSimpleEnumValidationResponseBodyForContentTypes, + PostAnyofWithOneEmptySchemaRequestBody, + PostEmailFormatRequestBody, + PostNullTypeMatchesOnlyTheNullObjectRequestBody, + PostOneofResponseBodyForContentTypes, + PostEmailFormatResponseBodyForContentTypes, + PostAllofWithTwoEmptySchemasResponseBodyForContentTypes, + PostIpv6FormatResponseBodyForContentTypes, + PostInvalidStringValueForDefaultResponseBodyForContentTypes, + PostEnumWithTrueDoesNotMatch1RequestBody, + PostRefInNotRequestBody, + PostNestedOneofToCheckValidationSemanticsRequestBody, + PostArrayTypeMatchesArraysRequestBody, + PostMinitemsValidationRequestBody, + PostUriReferenceFormatResponseBodyForContentTypes, + PostIntegerTypeMatchesIntegersRequestBody, + PostDateTimeFormatResponseBodyForContentTypes, + PostMaximumValidationWithUnsignedIntegerRequestBody, + PostEnumsInPropertiesResponseBodyForContentTypes, + PostPropertyNamedRefThatIsNotAReferenceRequestBody, + PostNestedItemsResponseBodyForContentTypes, + PostAnyofWithBaseSchemaResponseBodyForContentTypes, + PostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfResponseBodyForContentTypes, + PostNulCharactersInStringsRequestBody, + PostByIntRequestBody, + PostMaxpropertiesValidationRequestBody, + PostAdditionalpropertiesAreAllowedByDefaultResponseBodyForContentTypes, + PostOneofWithEmptySchemaRequestBody, + PostUriFormatRequestBody, + PostEnumWith0DoesNotMatchFalseResponseBodyForContentTypes, + PostAllofRequestBody, + PostPropertiesWithEscapedCharactersResponseBodyForContentTypes, + PostMaxpropertiesValidationResponseBodyForContentTypes, + PostUniqueitemsValidationResponseBodyForContentTypes, + PostNestedItemsRequestBody, + PostNumberTypeMatchesNumbersRequestBody, + PostAllofWithBaseSchemaRequestBody, + PostMinitemsValidationResponseBodyForContentTypes, + PostIpv4FormatRequestBody, + PostAllofSimpleTypesResponseBodyForContentTypes, + PostAllofWithTheLastEmptySchemaResponseBodyForContentTypes, + PostPropertiesWithEscapedCharactersRequestBody, + PostOneofWithRequiredRequestBody, + PostMaximumValidationResponseBodyForContentTypes, + PostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyForContentTypes, + PostOneofComplexTypesRequestBody, + PostAllofWithOneEmptySchemaRequestBody, + PostObjectPropertiesValidationRequestBody, + PostUriReferenceFormatRequestBody, + PostOneofWithBaseSchemaResponseBodyForContentTypes, + PostRefInNotResponseBodyForContentTypes, + PostRequiredDefaultValidationRequestBody, + PostAllofCombinedWithAnyofOneofRequestBody, + PostObjectPropertiesValidationResponseBodyForContentTypes, + PostRefInAnyofRequestBody, + PostRefInItemsResponseBodyForContentTypes, + PostAllofResponseBodyForContentTypes, + PostAdditionalpropertiesAllowsASchemaWhichShouldValidateResponseBodyForContentTypes, + PostPatternIsNotAnchoredResponseBodyForContentTypes, + PostRefInOneofRequestBody, + PostNotResponseBodyForContentTypes, + PostRefInAnyofResponseBodyForContentTypes, + PostRequiredWithEscapedCharactersRequestBody, + PostMinlengthValidationResponseBodyForContentTypes, + PostDateTimeFormatRequestBody, + PostAllofWithTheFirstEmptySchemaResponseBodyForContentTypes, + PostByNumberRequestBody, + PostRefInAdditionalpropertiesResponseBodyForContentTypes, + PostAnyofWithBaseSchemaRequestBody, + PostAdditionalpropertiesShouldNotLookInApplicatorsResponseBodyForContentTypes, + PostObjectTypeMatchesObjectsRequestBody, + PostEnumWith1DoesNotMatchTrueRequestBody, + PostEnumWithFalseDoesNotMatch0RequestBody, + PostNotMoreComplexSchemaRequestBody, + PostNulCharactersInStringsResponseBodyForContentTypes, + PostRequiredWithEmptyArrayRequestBody, + PostHostnameFormatResponseBodyForContentTypes, + PostRequiredWithEmptyArrayResponseBodyForContentTypes, + PostMinimumValidationRequestBody, + PostMinlengthValidationRequestBody, + PostEnumsInPropertiesRequestBody, + PostBySmallNumberRequestBody, + PostAdditionalpropertiesCanExistByItselfRequestBody, + PostAllofWithTheFirstEmptySchemaRequestBody, + PostOneofWithEmptySchemaResponseBodyForContentTypes, + PostUniqueitemsValidationRequestBody, + PostAnyofResponseBodyForContentTypes, + PostMaximumValidationRequestBody, + PostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody, + PostSimpleEnumValidationRequestBody, + PostOneofWithRequiredResponseBodyForContentTypes, + PostPatternValidationRequestBody, + PostAllofWithOneEmptySchemaResponseBodyForContentTypes, + PostArrayTypeMatchesArraysResponseBodyForContentTypes, + PostMaxlengthValidationResponseBodyForContentTypes, + PostRequiredWithEscapedCharactersResponseBodyForContentTypes, + PostMaxitemsValidationRequestBody, + PostUniqueitemsFalseValidationRequestBody, + PostPatternIsNotAnchoredRequestBody, + PostStringTypeMatchesStringsRequestBody, + PostAnyofComplexTypesResponseBodyForContentTypes, + PostNestedOneofToCheckValidationSemanticsResponseBodyForContentTypes, + PostByIntResponseBodyForContentTypes, + PostForbiddenPropertyResponseBodyForContentTypes, + PostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody, + PostEnumWithEscapedCharactersRequestBody, + PostIpv6FormatRequestBody, + PostRefInPropertyRequestBody, + PostEnumWithFalseDoesNotMatch0ResponseBodyForContentTypes, + PostRefInAllofResponseBodyForContentTypes, + PostAllofWithTwoEmptySchemasRequestBody, + PostAllofSimpleTypesRequestBody, + PostMaxitemsValidationResponseBodyForContentTypes, + PostRequiredValidationRequestBody, + PostIntegerTypeMatchesIntegersResponseBodyForContentTypes, + PostMaximumValidationWithUnsignedIntegerResponseBodyForContentTypes, + PostNestedAnyofToCheckValidationSemanticsResponseBodyForContentTypes, + PostRequiredDefaultValidationResponseBodyForContentTypes, + PostInvalidStringValueForDefaultRequestBody, + PostEnumWith1DoesNotMatchTrueResponseBodyForContentTypes, + PostAdditionalpropertiesAreAllowedByDefaultRequestBody, + PostMinimumValidationResponseBodyForContentTypes, + PostRequiredValidationResponseBodyForContentTypes, + PostMaxproperties0MeansTheObjectIsEmptyRequestBody, + PostAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody, + PostUriTemplateFormatRequestBody, + PostUniqueitemsFalseValidationResponseBodyForContentTypes, + PostEnumWith0DoesNotMatchFalseRequestBody, + PostMinimumValidationWithSignedIntegerRequestBody, + PostNestedAllofToCheckValidationSemanticsRequestBody, + PostNotMoreComplexSchemaResponseBodyForContentTypes, + PostPatternValidationResponseBodyForContentTypes, + PostAdditionalpropertiesCanExistByItselfResponseBodyForContentTypes, + PostAdditionalpropertiesShouldNotLookInApplicatorsRequestBody, + PostNestedAnyofToCheckValidationSemanticsRequestBody, + PostNestedAllofToCheckValidationSemanticsResponseBodyForContentTypes, + PostRefInAllofRequestBody, + PostEnumWithEscapedCharactersResponseBodyForContentTypes, + PostNumberTypeMatchesNumbersResponseBodyForContentTypes, + PostAllofCombinedWithAnyofOneofResponseBodyForContentTypes, + PostMinpropertiesValidationRequestBody, + PostAnyofRequestBody, + PostJsonPointerFormatRequestBody, + PostOneofRequestBody, + PostJsonPointerFormatResponseBodyForContentTypes, + PostAnyofComplexTypesRequestBody, + PostRefInItemsRequestBody, + PostOneofWithBaseSchemaRequestBody, + PostForbiddenPropertyRequestBody, + PostUriFormatResponseBodyForContentTypes, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/pattern_api.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/pattern_api.py new file mode 100644 index 00000000000..3cd74ffb785 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/pattern_api.py @@ -0,0 +1,26 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_pattern_is_not_anchored_response_body_for_content_types.post.operation import PostPatternIsNotAnchoredResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_pattern_is_not_anchored_request_body.post.operation import PostPatternIsNotAnchoredRequestBody +from unit_test_api.paths.response_body_post_pattern_validation_response_body_for_content_types.post.operation import PostPatternValidationResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_pattern_validation_request_body.post.operation import PostPatternValidationRequestBody + + +class PatternApi( + PostPatternIsNotAnchoredResponseBodyForContentTypes, + PostPatternIsNotAnchoredRequestBody, + PostPatternValidationResponseBodyForContentTypes, + PostPatternValidationRequestBody, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/properties_api.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/properties_api.py new file mode 100644 index 00000000000..657fe4b6272 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/properties_api.py @@ -0,0 +1,26 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_object_properties_validation_request_body.post.operation import PostObjectPropertiesValidationRequestBody +from unit_test_api.paths.response_body_post_object_properties_validation_response_body_for_content_types.post.operation import PostObjectPropertiesValidationResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_properties_with_escaped_characters_request_body.post.operation import PostPropertiesWithEscapedCharactersRequestBody +from unit_test_api.paths.response_body_post_properties_with_escaped_characters_response_body_for_content_types.post.operation import PostPropertiesWithEscapedCharactersResponseBodyForContentTypes + + +class PropertiesApi( + PostObjectPropertiesValidationRequestBody, + PostObjectPropertiesValidationResponseBodyForContentTypes, + PostPropertiesWithEscapedCharactersRequestBody, + PostPropertiesWithEscapedCharactersResponseBodyForContentTypes, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/ref_api.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/ref_api.py new file mode 100644 index 00000000000..0b2f970d529 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/ref_api.py @@ -0,0 +1,50 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_ref_in_additionalproperties_request_body.post.operation import PostRefInAdditionalpropertiesRequestBody +from unit_test_api.paths.response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types.post.operation import PostPropertyNamedRefThatIsNotAReferenceResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_ref_in_not_response_body_for_content_types.post.operation import PostRefInNotResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_ref_in_not_request_body.post.operation import PostRefInNotRequestBody +from unit_test_api.paths.request_body_post_ref_in_anyof_request_body.post.operation import PostRefInAnyofRequestBody +from unit_test_api.paths.response_body_post_ref_in_additionalproperties_response_body_for_content_types.post.operation import PostRefInAdditionalpropertiesResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_ref_in_items_response_body_for_content_types.post.operation import PostRefInItemsResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_ref_in_allof_request_body.post.operation import PostRefInAllofRequestBody +from unit_test_api.paths.response_body_post_ref_in_oneof_response_body_for_content_types.post.operation import PostRefInOneofResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_ref_in_property_response_body_for_content_types.post.operation import PostRefInPropertyResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_property_named_ref_that_is_not_a_reference_request_body.post.operation import PostPropertyNamedRefThatIsNotAReferenceRequestBody +from unit_test_api.paths.request_body_post_ref_in_items_request_body.post.operation import PostRefInItemsRequestBody +from unit_test_api.paths.request_body_post_ref_in_oneof_request_body.post.operation import PostRefInOneofRequestBody +from unit_test_api.paths.response_body_post_ref_in_anyof_response_body_for_content_types.post.operation import PostRefInAnyofResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_ref_in_property_request_body.post.operation import PostRefInPropertyRequestBody +from unit_test_api.paths.response_body_post_ref_in_allof_response_body_for_content_types.post.operation import PostRefInAllofResponseBodyForContentTypes + + +class RefApi( + PostRefInAdditionalpropertiesRequestBody, + PostPropertyNamedRefThatIsNotAReferenceResponseBodyForContentTypes, + PostRefInNotResponseBodyForContentTypes, + PostRefInNotRequestBody, + PostRefInAnyofRequestBody, + PostRefInAdditionalpropertiesResponseBodyForContentTypes, + PostRefInItemsResponseBodyForContentTypes, + PostRefInAllofRequestBody, + PostRefInOneofResponseBodyForContentTypes, + PostRefInPropertyResponseBodyForContentTypes, + PostPropertyNamedRefThatIsNotAReferenceRequestBody, + PostRefInItemsRequestBody, + PostRefInOneofRequestBody, + PostRefInAnyofResponseBodyForContentTypes, + PostRefInPropertyRequestBody, + PostRefInAllofResponseBodyForContentTypes, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/required_api.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/required_api.py new file mode 100644 index 00000000000..ec5a2281702 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/required_api.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_required_default_validation_request_body.post.operation import PostRequiredDefaultValidationRequestBody +from unit_test_api.paths.response_body_post_required_validation_response_body_for_content_types.post.operation import PostRequiredValidationResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_required_validation_request_body.post.operation import PostRequiredValidationRequestBody +from unit_test_api.paths.request_body_post_required_with_empty_array_request_body.post.operation import PostRequiredWithEmptyArrayRequestBody +from unit_test_api.paths.response_body_post_required_default_validation_response_body_for_content_types.post.operation import PostRequiredDefaultValidationResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_required_with_empty_array_response_body_for_content_types.post.operation import PostRequiredWithEmptyArrayResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_required_with_escaped_characters_request_body.post.operation import PostRequiredWithEscapedCharactersRequestBody +from unit_test_api.paths.response_body_post_required_with_escaped_characters_response_body_for_content_types.post.operation import PostRequiredWithEscapedCharactersResponseBodyForContentTypes + + +class RequiredApi( + PostRequiredDefaultValidationRequestBody, + PostRequiredValidationResponseBodyForContentTypes, + PostRequiredValidationRequestBody, + PostRequiredWithEmptyArrayRequestBody, + PostRequiredDefaultValidationResponseBodyForContentTypes, + PostRequiredWithEmptyArrayResponseBodyForContentTypes, + PostRequiredWithEscapedCharactersRequestBody, + PostRequiredWithEscapedCharactersResponseBodyForContentTypes, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/response_content_content_type_schema_api.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/response_content_content_type_schema_api.py new file mode 100644 index 00000000000..ec854ca7ab5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/response_content_content_type_schema_api.py @@ -0,0 +1,192 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_minlength_validation_response_body_for_content_types.post.operation import PostMinlengthValidationResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types.post.operation import PostPropertyNamedRefThatIsNotAReferenceResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types.post.operation import PostAllofWithTheFirstEmptySchemaResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_object_type_matches_objects_response_body_for_content_types.post.operation import PostObjectTypeMatchesObjectsResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types.post.operation import PostNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_string_type_matches_strings_response_body_for_content_types.post.operation import PostStringTypeMatchesStringsResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_ipv4_format_response_body_for_content_types.post.operation import PostIpv4FormatResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types.post.operation import PostMaxproperties0MeansTheObjectIsEmptyResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_minproperties_validation_response_body_for_content_types.post.operation import PostMinpropertiesValidationResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_by_number_response_body_for_content_types.post.operation import PostByNumberResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_allof_with_base_schema_response_body_for_content_types.post.operation import PostAllofWithBaseSchemaResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_boolean_type_matches_booleans_response_body_for_content_types.post.operation import PostBooleanTypeMatchesBooleansResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_anyof_with_one_empty_schema_response_body_for_content_types.post.operation import PostAnyofWithOneEmptySchemaResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types.post.operation import PostMinimumValidationWithSignedIntegerResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_ref_in_additionalproperties_response_body_for_content_types.post.operation import PostRefInAdditionalpropertiesResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_oneof_complex_types_response_body_for_content_types.post.operation import PostOneofComplexTypesResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_uri_template_format_response_body_for_content_types.post.operation import PostUriTemplateFormatResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_enum_with_true_does_not_match1_response_body_for_content_types.post.operation import PostEnumWithTrueDoesNotMatch1ResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types.post.operation import PostAdditionalpropertiesShouldNotLookInApplicatorsResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_ref_in_oneof_response_body_for_content_types.post.operation import PostRefInOneofResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_nul_characters_in_strings_response_body_for_content_types.post.operation import PostNulCharactersInStringsResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_by_small_number_response_body_for_content_types.post.operation import PostBySmallNumberResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_ref_in_property_response_body_for_content_types.post.operation import PostRefInPropertyResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_simple_enum_validation_response_body_for_content_types.post.operation import PostSimpleEnumValidationResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_hostname_format_response_body_for_content_types.post.operation import PostHostnameFormatResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_required_with_empty_array_response_body_for_content_types.post.operation import PostRequiredWithEmptyArrayResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_oneof_response_body_for_content_types.post.operation import PostOneofResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_email_format_response_body_for_content_types.post.operation import PostEmailFormatResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_allof_with_two_empty_schemas_response_body_for_content_types.post.operation import PostAllofWithTwoEmptySchemasResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_ipv6_format_response_body_for_content_types.post.operation import PostIpv6FormatResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_invalid_string_value_for_default_response_body_for_content_types.post.operation import PostInvalidStringValueForDefaultResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_oneof_with_empty_schema_response_body_for_content_types.post.operation import PostOneofWithEmptySchemaResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_anyof_response_body_for_content_types.post.operation import PostAnyofResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_oneof_with_required_response_body_for_content_types.post.operation import PostOneofWithRequiredResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_uri_reference_format_response_body_for_content_types.post.operation import PostUriReferenceFormatResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_allof_with_one_empty_schema_response_body_for_content_types.post.operation import PostAllofWithOneEmptySchemaResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_array_type_matches_arrays_response_body_for_content_types.post.operation import PostArrayTypeMatchesArraysResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_maxlength_validation_response_body_for_content_types.post.operation import PostMaxlengthValidationResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_required_with_escaped_characters_response_body_for_content_types.post.operation import PostRequiredWithEscapedCharactersResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_date_time_format_response_body_for_content_types.post.operation import PostDateTimeFormatResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_anyof_complex_types_response_body_for_content_types.post.operation import PostAnyofComplexTypesResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_enums_in_properties_response_body_for_content_types.post.operation import PostEnumsInPropertiesResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types.post.operation import PostNestedOneofToCheckValidationSemanticsResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_by_int_response_body_for_content_types.post.operation import PostByIntResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_nested_items_response_body_for_content_types.post.operation import PostNestedItemsResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_anyof_with_base_schema_response_body_for_content_types.post.operation import PostAnyofWithBaseSchemaResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_forbidden_property_response_body_for_content_types.post.operation import PostForbiddenPropertyResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types.post.operation import PostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_enum_with_false_does_not_match0_response_body_for_content_types.post.operation import PostEnumWithFalseDoesNotMatch0ResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_ref_in_allof_response_body_for_content_types.post.operation import PostRefInAllofResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types.post.operation import PostAdditionalpropertiesAreAllowedByDefaultResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_maxitems_validation_response_body_for_content_types.post.operation import PostMaxitemsValidationResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_enum_with0_does_not_match_false_response_body_for_content_types.post.operation import PostEnumWith0DoesNotMatchFalseResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_integer_type_matches_integers_response_body_for_content_types.post.operation import PostIntegerTypeMatchesIntegersResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types.post.operation import PostMaximumValidationWithUnsignedIntegerResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types.post.operation import PostNestedAnyofToCheckValidationSemanticsResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_required_default_validation_response_body_for_content_types.post.operation import PostRequiredDefaultValidationResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_enum_with1_does_not_match_true_response_body_for_content_types.post.operation import PostEnumWith1DoesNotMatchTrueResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_properties_with_escaped_characters_response_body_for_content_types.post.operation import PostPropertiesWithEscapedCharactersResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_maxproperties_validation_response_body_for_content_types.post.operation import PostMaxpropertiesValidationResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_uniqueitems_validation_response_body_for_content_types.post.operation import PostUniqueitemsValidationResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_minimum_validation_response_body_for_content_types.post.operation import PostMinimumValidationResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_required_validation_response_body_for_content_types.post.operation import PostRequiredValidationResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_minitems_validation_response_body_for_content_types.post.operation import PostMinitemsValidationResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_allof_simple_types_response_body_for_content_types.post.operation import PostAllofSimpleTypesResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types.post.operation import PostAllofWithTheLastEmptySchemaResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_uniqueitems_false_validation_response_body_for_content_types.post.operation import PostUniqueitemsFalseValidationResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_maximum_validation_response_body_for_content_types.post.operation import PostMaximumValidationResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types.post.operation import PostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_oneof_with_base_schema_response_body_for_content_types.post.operation import PostOneofWithBaseSchemaResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_ref_in_not_response_body_for_content_types.post.operation import PostRefInNotResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_not_more_complex_schema_response_body_for_content_types.post.operation import PostNotMoreComplexSchemaResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_object_properties_validation_response_body_for_content_types.post.operation import PostObjectPropertiesValidationResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_pattern_validation_response_body_for_content_types.post.operation import PostPatternValidationResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types.post.operation import PostAdditionalpropertiesCanExistByItselfResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types.post.operation import PostNestedAllofToCheckValidationSemanticsResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_ref_in_items_response_body_for_content_types.post.operation import PostRefInItemsResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_allof_response_body_for_content_types.post.operation import PostAllofResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_enum_with_escaped_characters_response_body_for_content_types.post.operation import PostEnumWithEscapedCharactersResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_number_type_matches_numbers_response_body_for_content_types.post.operation import PostNumberTypeMatchesNumbersResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types.post.operation import PostAdditionalpropertiesAllowsASchemaWhichShouldValidateResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types.post.operation import PostAllofCombinedWithAnyofOneofResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_pattern_is_not_anchored_response_body_for_content_types.post.operation import PostPatternIsNotAnchoredResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_json_pointer_format_response_body_for_content_types.post.operation import PostJsonPointerFormatResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_not_response_body_for_content_types.post.operation import PostNotResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_ref_in_anyof_response_body_for_content_types.post.operation import PostRefInAnyofResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_uri_format_response_body_for_content_types.post.operation import PostUriFormatResponseBodyForContentTypes + + +class ResponseContentContentTypeSchemaApi( + PostMinlengthValidationResponseBodyForContentTypes, + PostPropertyNamedRefThatIsNotAReferenceResponseBodyForContentTypes, + PostAllofWithTheFirstEmptySchemaResponseBodyForContentTypes, + PostObjectTypeMatchesObjectsResponseBodyForContentTypes, + PostNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes, + PostStringTypeMatchesStringsResponseBodyForContentTypes, + PostIpv4FormatResponseBodyForContentTypes, + PostMaxproperties0MeansTheObjectIsEmptyResponseBodyForContentTypes, + PostMinpropertiesValidationResponseBodyForContentTypes, + PostByNumberResponseBodyForContentTypes, + PostAllofWithBaseSchemaResponseBodyForContentTypes, + PostBooleanTypeMatchesBooleansResponseBodyForContentTypes, + PostAnyofWithOneEmptySchemaResponseBodyForContentTypes, + PostMinimumValidationWithSignedIntegerResponseBodyForContentTypes, + PostRefInAdditionalpropertiesResponseBodyForContentTypes, + PostOneofComplexTypesResponseBodyForContentTypes, + PostUriTemplateFormatResponseBodyForContentTypes, + PostEnumWithTrueDoesNotMatch1ResponseBodyForContentTypes, + PostAdditionalpropertiesShouldNotLookInApplicatorsResponseBodyForContentTypes, + PostRefInOneofResponseBodyForContentTypes, + PostNulCharactersInStringsResponseBodyForContentTypes, + PostBySmallNumberResponseBodyForContentTypes, + PostRefInPropertyResponseBodyForContentTypes, + PostSimpleEnumValidationResponseBodyForContentTypes, + PostHostnameFormatResponseBodyForContentTypes, + PostRequiredWithEmptyArrayResponseBodyForContentTypes, + PostOneofResponseBodyForContentTypes, + PostEmailFormatResponseBodyForContentTypes, + PostAllofWithTwoEmptySchemasResponseBodyForContentTypes, + PostIpv6FormatResponseBodyForContentTypes, + PostInvalidStringValueForDefaultResponseBodyForContentTypes, + PostOneofWithEmptySchemaResponseBodyForContentTypes, + PostAnyofResponseBodyForContentTypes, + PostOneofWithRequiredResponseBodyForContentTypes, + PostUriReferenceFormatResponseBodyForContentTypes, + PostAllofWithOneEmptySchemaResponseBodyForContentTypes, + PostArrayTypeMatchesArraysResponseBodyForContentTypes, + PostMaxlengthValidationResponseBodyForContentTypes, + PostRequiredWithEscapedCharactersResponseBodyForContentTypes, + PostDateTimeFormatResponseBodyForContentTypes, + PostAnyofComplexTypesResponseBodyForContentTypes, + PostEnumsInPropertiesResponseBodyForContentTypes, + PostNestedOneofToCheckValidationSemanticsResponseBodyForContentTypes, + PostByIntResponseBodyForContentTypes, + PostNestedItemsResponseBodyForContentTypes, + PostAnyofWithBaseSchemaResponseBodyForContentTypes, + PostForbiddenPropertyResponseBodyForContentTypes, + PostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfResponseBodyForContentTypes, + PostEnumWithFalseDoesNotMatch0ResponseBodyForContentTypes, + PostRefInAllofResponseBodyForContentTypes, + PostAdditionalpropertiesAreAllowedByDefaultResponseBodyForContentTypes, + PostMaxitemsValidationResponseBodyForContentTypes, + PostEnumWith0DoesNotMatchFalseResponseBodyForContentTypes, + PostIntegerTypeMatchesIntegersResponseBodyForContentTypes, + PostMaximumValidationWithUnsignedIntegerResponseBodyForContentTypes, + PostNestedAnyofToCheckValidationSemanticsResponseBodyForContentTypes, + PostRequiredDefaultValidationResponseBodyForContentTypes, + PostEnumWith1DoesNotMatchTrueResponseBodyForContentTypes, + PostPropertiesWithEscapedCharactersResponseBodyForContentTypes, + PostMaxpropertiesValidationResponseBodyForContentTypes, + PostUniqueitemsValidationResponseBodyForContentTypes, + PostMinimumValidationResponseBodyForContentTypes, + PostRequiredValidationResponseBodyForContentTypes, + PostMinitemsValidationResponseBodyForContentTypes, + PostAllofSimpleTypesResponseBodyForContentTypes, + PostAllofWithTheLastEmptySchemaResponseBodyForContentTypes, + PostUniqueitemsFalseValidationResponseBodyForContentTypes, + PostMaximumValidationResponseBodyForContentTypes, + PostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyForContentTypes, + PostOneofWithBaseSchemaResponseBodyForContentTypes, + PostRefInNotResponseBodyForContentTypes, + PostNotMoreComplexSchemaResponseBodyForContentTypes, + PostObjectPropertiesValidationResponseBodyForContentTypes, + PostPatternValidationResponseBodyForContentTypes, + PostAdditionalpropertiesCanExistByItselfResponseBodyForContentTypes, + PostNestedAllofToCheckValidationSemanticsResponseBodyForContentTypes, + PostRefInItemsResponseBodyForContentTypes, + PostAllofResponseBodyForContentTypes, + PostEnumWithEscapedCharactersResponseBodyForContentTypes, + PostNumberTypeMatchesNumbersResponseBodyForContentTypes, + PostAdditionalpropertiesAllowsASchemaWhichShouldValidateResponseBodyForContentTypes, + PostAllofCombinedWithAnyofOneofResponseBodyForContentTypes, + PostPatternIsNotAnchoredResponseBodyForContentTypes, + PostJsonPointerFormatResponseBodyForContentTypes, + PostNotResponseBodyForContentTypes, + PostRefInAnyofResponseBodyForContentTypes, + PostUriFormatResponseBodyForContentTypes, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/type_api.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/type_api.py new file mode 100644 index 00000000000..1997bb2087d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/type_api.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.response_body_post_object_type_matches_objects_response_body_for_content_types.post.operation import PostObjectTypeMatchesObjectsResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types.post.operation import PostNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_string_type_matches_strings_response_body_for_content_types.post.operation import PostStringTypeMatchesStringsResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_integer_type_matches_integers_response_body_for_content_types.post.operation import PostIntegerTypeMatchesIntegersResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_array_type_matches_arrays_request_body.post.operation import PostArrayTypeMatchesArraysRequestBody +from unit_test_api.paths.response_body_post_boolean_type_matches_booleans_response_body_for_content_types.post.operation import PostBooleanTypeMatchesBooleansResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_integer_type_matches_integers_request_body.post.operation import PostIntegerTypeMatchesIntegersRequestBody +from unit_test_api.paths.response_body_post_array_type_matches_arrays_response_body_for_content_types.post.operation import PostArrayTypeMatchesArraysResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_number_type_matches_numbers_request_body.post.operation import PostNumberTypeMatchesNumbersRequestBody +from unit_test_api.paths.response_body_post_number_type_matches_numbers_response_body_for_content_types.post.operation import PostNumberTypeMatchesNumbersResponseBodyForContentTypes +from unit_test_api.paths.request_body_post_object_type_matches_objects_request_body.post.operation import PostObjectTypeMatchesObjectsRequestBody +from unit_test_api.paths.request_body_post_boolean_type_matches_booleans_request_body.post.operation import PostBooleanTypeMatchesBooleansRequestBody +from unit_test_api.paths.request_body_post_string_type_matches_strings_request_body.post.operation import PostStringTypeMatchesStringsRequestBody +from unit_test_api.paths.request_body_post_null_type_matches_only_the_null_object_request_body.post.operation import PostNullTypeMatchesOnlyTheNullObjectRequestBody + + +class TypeApi( + PostObjectTypeMatchesObjectsResponseBodyForContentTypes, + PostNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes, + PostStringTypeMatchesStringsResponseBodyForContentTypes, + PostIntegerTypeMatchesIntegersResponseBodyForContentTypes, + PostArrayTypeMatchesArraysRequestBody, + PostBooleanTypeMatchesBooleansResponseBodyForContentTypes, + PostIntegerTypeMatchesIntegersRequestBody, + PostArrayTypeMatchesArraysResponseBodyForContentTypes, + PostNumberTypeMatchesNumbersRequestBody, + PostNumberTypeMatchesNumbersResponseBodyForContentTypes, + PostObjectTypeMatchesObjectsRequestBody, + PostBooleanTypeMatchesBooleansRequestBody, + PostStringTypeMatchesStringsRequestBody, + PostNullTypeMatchesOnlyTheNullObjectRequestBody, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/unique_items_api.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/unique_items_api.py new file mode 100644 index 00000000000..047d5e0fa2d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/apis/tags/unique_items_api.py @@ -0,0 +1,26 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from unit_test_api.paths.request_body_post_uniqueitems_false_validation_request_body.post.operation import PostUniqueitemsFalseValidationRequestBody +from unit_test_api.paths.request_body_post_uniqueitems_validation_request_body.post.operation import PostUniqueitemsValidationRequestBody +from unit_test_api.paths.response_body_post_uniqueitems_false_validation_response_body_for_content_types.post.operation import PostUniqueitemsFalseValidationResponseBodyForContentTypes +from unit_test_api.paths.response_body_post_uniqueitems_validation_response_body_for_content_types.post.operation import PostUniqueitemsValidationResponseBodyForContentTypes + + +class UniqueItemsApi( + PostUniqueitemsFalseValidationRequestBody, + PostUniqueitemsValidationRequestBody, + PostUniqueitemsFalseValidationResponseBodyForContentTypes, + PostUniqueitemsValidationResponseBodyForContentTypes, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python/test/test_models/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/__init__.py new file mode 100644 index 00000000000..233d2aefb12 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/__init__.py @@ -0,0 +1,5 @@ +# we can not import model classes here because that would create a circular +# reference which would not work in python2 +# do not import all models into this module because that uses a lot of memory and stack frames +# if you need the ability to import all models from one package, import them with +# from unit_test_api.components.schemas import ModelA, ModelB diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/_not.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/_not.py new file mode 100644 index 00000000000..a2ff1696759 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/_not.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class _Not( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + _Not = schemas.IntSchema + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> '_Not': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/additionalproperties_allows_a_schema_which_should_validate.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/additionalproperties_allows_a_schema_which_should_validate.py new file mode 100644 index 00000000000..dbcbef81c8d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/additionalproperties_allows_a_schema_which_should_validate.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class AdditionalpropertiesAllowsASchemaWhichShouldValidate( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {frozendict.frozendict} + + class Properties: + Foo = schemas.AnyTypeSchema + Bar = schemas.AnyTypeSchema + __annotations__ = { + "foo": Foo, + "bar": Bar, + } + AdditionalProperties = schemas.BoolSchema + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["foo"]) -> Schema_.Properties.Foo: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["bar"]) -> Schema_.Properties.Bar: ... + + @typing.overload + def __getitem__(self, name: str) -> Schema_.AdditionalProperties: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["foo"], + typing_extensions.Literal["bar"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["foo"]) -> typing.Union[Schema_.Properties.Foo, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["bar"]) -> typing.Union[Schema_.Properties.Bar, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[Schema_.AdditionalProperties, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["foo"], + typing_extensions.Literal["bar"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + foo: typing.Union[Schema_.Properties.Foo, dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + bar: typing.Union[Schema_.Properties.Bar, dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[Schema_.AdditionalProperties, bool], + ) -> 'AdditionalpropertiesAllowsASchemaWhichShouldValidate': + return super().__new__( + cls, + *args_, + foo=foo, + bar=bar, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/additionalproperties_are_allowed_by_default.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/additionalproperties_are_allowed_by_default.py new file mode 100644 index 00000000000..4255c658ed7 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/additionalproperties_are_allowed_by_default.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class AdditionalpropertiesAreAllowedByDefault( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + + class Properties: + Foo = schemas.AnyTypeSchema + Bar = schemas.AnyTypeSchema + __annotations__ = { + "foo": Foo, + "bar": Bar, + } + + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["foo"]) -> Schema_.Properties.Foo: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["bar"]) -> Schema_.Properties.Bar: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["foo"], + typing_extensions.Literal["bar"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["foo"]) -> typing.Union[Schema_.Properties.Foo, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["bar"]) -> typing.Union[Schema_.Properties.Bar, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["foo"], + typing_extensions.Literal["bar"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + foo: typing.Union[Schema_.Properties.Foo, dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + bar: typing.Union[Schema_.Properties.Bar, dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'AdditionalpropertiesAreAllowedByDefault': + return super().__new__( + cls, + *args_, + foo=foo, + bar=bar, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/additionalproperties_can_exist_by_itself.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/additionalproperties_can_exist_by_itself.py new file mode 100644 index 00000000000..b0d25ceb008 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/additionalproperties_can_exist_by_itself.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class AdditionalpropertiesCanExistByItself( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {frozendict.frozendict} + AdditionalProperties = schemas.BoolSchema + + def __getitem__(self, name: str) -> Schema_.AdditionalProperties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def get_item_(self, name: str) -> Schema_.AdditionalProperties: + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[Schema_.AdditionalProperties, bool], + ) -> 'AdditionalpropertiesCanExistByItself': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/additionalproperties_should_not_look_in_applicators.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/additionalproperties_should_not_look_in_applicators.py new file mode 100644 index 00000000000..8105e1c976d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/additionalproperties_should_not_look_in_applicators.py @@ -0,0 +1,126 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class AdditionalpropertiesShouldNotLookInApplicators( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + AdditionalProperties = schemas.BoolSchema + + class AllOf: + + + class _0( + schemas.AnyTypeSchema, + ): + + + class Schema_: + # any type + + class Properties: + Foo = schemas.AnyTypeSchema + __annotations__ = { + "foo": Foo, + } + + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["foo"]) -> Schema_.Properties.Foo: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["foo"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["foo"]) -> typing.Union[Schema_.Properties.Foo, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["foo"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + foo: typing.Union[Schema_.Properties.Foo, dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'AdditionalpropertiesShouldNotLookInApplicators.Schema_.AllOf._0': + return super().__new__( + cls, + *args_, + foo=foo, + configuration_=configuration_, + **kwargs, + ) + classes = [ + _0, + ] + + + def __getitem__(self, name: str) -> Schema_.AdditionalProperties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def get_item_(self, name: str) -> Schema_.AdditionalProperties: + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[Schema_.AdditionalProperties, bool], + ) -> 'AdditionalpropertiesShouldNotLookInApplicators': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/allof.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/allof.py new file mode 100644 index 00000000000..d59cba1f34a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/allof.py @@ -0,0 +1,187 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class Allof( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + + class AllOf: + + + class _0( + schemas.AnyTypeSchema, + ): + + + class Schema_: + # any type + required = { + "bar", + } + + class Properties: + Bar = schemas.IntSchema + __annotations__ = { + "bar": Bar, + } + + + bar: Schema_.Properties.Bar + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["bar"]) -> Schema_.Properties.Bar: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["bar"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["bar"]) -> Schema_.Properties.Bar: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["bar"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'Allof.Schema_.AllOf._0': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + + + class _1( + schemas.AnyTypeSchema, + ): + + + class Schema_: + # any type + required = { + "foo", + } + + class Properties: + Foo = schemas.StrSchema + __annotations__ = { + "foo": Foo, + } + + + foo: Schema_.Properties.Foo + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["foo"]) -> Schema_.Properties.Foo: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["foo"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["foo"]) -> Schema_.Properties.Foo: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["foo"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'Allof.Schema_.AllOf._1': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + classes = [ + _0, + _1, + ] + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'Allof': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/allof_combined_with_anyof_oneof.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/allof_combined_with_anyof_oneof.py new file mode 100644 index 00000000000..2ecae75c12c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/allof_combined_with_anyof_oneof.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class AllofCombinedWithAnyofOneof( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + + class AllOf: + + + class _0( + schemas.AnyTypeSchema, + ): + + + class Schema_: + # any type + multiple_of = 2 + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'AllofCombinedWithAnyofOneof.Schema_.AllOf._0': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + classes = [ + _0, + ] + + class OneOf: + + + class _0( + schemas.AnyTypeSchema, + ): + + + class Schema_: + # any type + multiple_of = 5 + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'AllofCombinedWithAnyofOneof.Schema_.OneOf._0': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + classes = [ + _0, + ] + + class AnyOf: + + + class _0( + schemas.AnyTypeSchema, + ): + + + class Schema_: + # any type + multiple_of = 3 + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'AllofCombinedWithAnyofOneof.Schema_.AnyOf._0': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + classes = [ + _0, + ] + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'AllofCombinedWithAnyofOneof': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/allof_simple_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/allof_simple_types.py new file mode 100644 index 00000000000..56384e5bc0f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/allof_simple_types.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class AllofSimpleTypes( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + + class AllOf: + + + class _0( + schemas.AnyTypeSchema, + ): + + + class Schema_: + # any type + inclusive_maximum = 30 + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'AllofSimpleTypes.Schema_.AllOf._0': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + + + class _1( + schemas.AnyTypeSchema, + ): + + + class Schema_: + # any type + inclusive_minimum = 20 + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'AllofSimpleTypes.Schema_.AllOf._1': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + classes = [ + _0, + _1, + ] + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'AllofSimpleTypes': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/allof_with_base_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/allof_with_base_schema.py new file mode 100644 index 00000000000..e2bdc0f5532 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/allof_with_base_schema.py @@ -0,0 +1,229 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class AllofWithBaseSchema( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + required = { + "bar", + } + + class Properties: + Bar = schemas.IntSchema + __annotations__ = { + "bar": Bar, + } + + class AllOf: + + + class _0( + schemas.AnyTypeSchema, + ): + + + class Schema_: + # any type + required = { + "foo", + } + + class Properties: + Foo = schemas.StrSchema + __annotations__ = { + "foo": Foo, + } + + + foo: Schema_.Properties.Foo + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["foo"]) -> Schema_.Properties.Foo: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["foo"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["foo"]) -> Schema_.Properties.Foo: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["foo"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'AllofWithBaseSchema.Schema_.AllOf._0': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + + + class _1( + schemas.AnyTypeSchema, + ): + + + class Schema_: + # any type + required = { + "baz", + } + + class Properties: + Baz = schemas.NoneSchema + __annotations__ = { + "baz": Baz, + } + + + baz: Schema_.Properties.Baz + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["baz"]) -> Schema_.Properties.Baz: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["baz"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["baz"]) -> Schema_.Properties.Baz: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["baz"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'AllofWithBaseSchema.Schema_.AllOf._1': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + classes = [ + _0, + _1, + ] + + + bar: Schema_.Properties.Bar + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["bar"]) -> Schema_.Properties.Bar: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["bar"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["bar"]) -> Schema_.Properties.Bar: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["bar"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'AllofWithBaseSchema': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/allof_with_one_empty_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/allof_with_one_empty_schema.py new file mode 100644 index 00000000000..31a5842dfa1 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/allof_with_one_empty_schema.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class AllofWithOneEmptySchema( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + + class AllOf: + _0 = schemas.AnyTypeSchema + classes = [ + _0, + ] + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'AllofWithOneEmptySchema': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/allof_with_the_first_empty_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/allof_with_the_first_empty_schema.py new file mode 100644 index 00000000000..aa8c069d9e7 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/allof_with_the_first_empty_schema.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class AllofWithTheFirstEmptySchema( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + + class AllOf: + _0 = schemas.AnyTypeSchema + _1 = schemas.NumberSchema + classes = [ + _0, + _1, + ] + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'AllofWithTheFirstEmptySchema': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/allof_with_the_last_empty_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/allof_with_the_last_empty_schema.py new file mode 100644 index 00000000000..46ced0275a6 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/allof_with_the_last_empty_schema.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class AllofWithTheLastEmptySchema( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + + class AllOf: + _0 = schemas.NumberSchema + _1 = schemas.AnyTypeSchema + classes = [ + _0, + _1, + ] + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'AllofWithTheLastEmptySchema': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/allof_with_two_empty_schemas.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/allof_with_two_empty_schemas.py new file mode 100644 index 00000000000..19cba0180c7 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/allof_with_two_empty_schemas.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class AllofWithTwoEmptySchemas( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + + class AllOf: + _0 = schemas.AnyTypeSchema + _1 = schemas.AnyTypeSchema + classes = [ + _0, + _1, + ] + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'AllofWithTwoEmptySchemas': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/anyof.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/anyof.py new file mode 100644 index 00000000000..e89b7525a88 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/anyof.py @@ -0,0 +1,82 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class Anyof( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + + class AnyOf: + _0 = schemas.IntSchema + + + class _1( + schemas.AnyTypeSchema, + ): + + + class Schema_: + # any type + inclusive_minimum = 2 + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'Anyof.Schema_.AnyOf._1': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + classes = [ + _0, + _1, + ] + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'Anyof': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/anyof_complex_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/anyof_complex_types.py new file mode 100644 index 00000000000..369d05dac81 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/anyof_complex_types.py @@ -0,0 +1,187 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class AnyofComplexTypes( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + + class AnyOf: + + + class _0( + schemas.AnyTypeSchema, + ): + + + class Schema_: + # any type + required = { + "bar", + } + + class Properties: + Bar = schemas.IntSchema + __annotations__ = { + "bar": Bar, + } + + + bar: Schema_.Properties.Bar + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["bar"]) -> Schema_.Properties.Bar: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["bar"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["bar"]) -> Schema_.Properties.Bar: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["bar"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'AnyofComplexTypes.Schema_.AnyOf._0': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + + + class _1( + schemas.AnyTypeSchema, + ): + + + class Schema_: + # any type + required = { + "foo", + } + + class Properties: + Foo = schemas.StrSchema + __annotations__ = { + "foo": Foo, + } + + + foo: Schema_.Properties.Foo + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["foo"]) -> Schema_.Properties.Foo: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["foo"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["foo"]) -> Schema_.Properties.Foo: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["foo"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'AnyofComplexTypes.Schema_.AnyOf._1': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + classes = [ + _0, + _1, + ] + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'AnyofComplexTypes': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/anyof_with_base_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/anyof_with_base_schema.py new file mode 100644 index 00000000000..9d0c87e4928 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/anyof_with_base_schema.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class AnyofWithBaseSchema( + schemas.StrSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = { + str, + } + + class AnyOf: + + + class _0( + schemas.AnyTypeSchema, + ): + + + class Schema_: + # any type + max_length = 2 + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'AnyofWithBaseSchema.Schema_.AnyOf._0': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + + + class _1( + schemas.AnyTypeSchema, + ): + + + class Schema_: + # any type + min_length = 4 + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'AnyofWithBaseSchema.Schema_.AnyOf._1': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + classes = [ + _0, + _1, + ] + + + def __new__( + cls, + arg_: str, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'AnyofWithBaseSchema': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/anyof_with_one_empty_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/anyof_with_one_empty_schema.py new file mode 100644 index 00000000000..d7acc797edc --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/anyof_with_one_empty_schema.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class AnyofWithOneEmptySchema( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + + class AnyOf: + _0 = schemas.NumberSchema + _1 = schemas.AnyTypeSchema + classes = [ + _0, + _1, + ] + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'AnyofWithOneEmptySchema': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/array_type_matches_arrays.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/array_type_matches_arrays.py new file mode 100644 index 00000000000..518bfcc9b20 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/array_type_matches_arrays.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class ArrayTypeMatchesArrays( + schemas.ListSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {tuple} + Items = schemas.AnyTypeSchema + + def __new__( + cls, + arg_: typing.Union[ + typing.Tuple[ + typing.Union[Schema_.Items, dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], ... + ], + typing.List[ + typing.Union[Schema_.Items, dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] + ], + ], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'ArrayTypeMatchesArrays': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) + + def __getitem__(self, i: int) -> Schema_.Items: + return super().__getitem__(i) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/boolean_type_matches_booleans.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/boolean_type_matches_booleans.py similarity index 81% rename from samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/boolean_type_matches_booleans.py rename to samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/boolean_type_matches_booleans.py index 8e9d55f91a4..2e7f47b455f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/boolean_type_matches_booleans.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/boolean_type_matches_booleans.py @@ -6,10 +6,10 @@ sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ -from datetime import date, datetime # noqa: F401 +import datetime # noqa: F401 import decimal # noqa: F401 import functools # noqa: F401 import io # noqa: F401 diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/by_int.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/by_int.py new file mode 100644 index 00000000000..0eadb22f79c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/by_int.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class ByInt( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + multiple_of = 2 + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'ByInt': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/by_number.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/by_number.py new file mode 100644 index 00000000000..13e07d9cdbf --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/by_number.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class ByNumber( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + multiple_of = 1.5 + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'ByNumber': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/by_small_number.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/by_small_number.py new file mode 100644 index 00000000000..d02973bef5c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/by_small_number.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class BySmallNumber( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + multiple_of = 0.00010 + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'BySmallNumber': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/date_time_format.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/date_time_format.py new file mode 100644 index 00000000000..535365bcfed --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/date_time_format.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class DateTimeFormat( + schemas.DateTimeBase, + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + format = 'date-time' + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'DateTimeFormat': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/email_format.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/email_format.py new file mode 100644 index 00000000000..70b9da8d697 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/email_format.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class EmailFormat( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + format = 'email' + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'EmailFormat': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/enum_with0_does_not_match_false.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/enum_with0_does_not_match_false.py new file mode 100644 index 00000000000..1187c5c2340 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/enum_with0_does_not_match_false.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class EnumWith0DoesNotMatchFalse( + schemas.NumberSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = { + decimal.Decimal, + } + enum_value_to_name = { + 0: "POSITIVE_0", + } + + @schemas.classproperty + def POSITIVE_0(cls): + return cls(0) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/enum_with1_does_not_match_true.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/enum_with1_does_not_match_true.py new file mode 100644 index 00000000000..ea100385b10 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/enum_with1_does_not_match_true.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class EnumWith1DoesNotMatchTrue( + schemas.NumberSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = { + decimal.Decimal, + } + enum_value_to_name = { + 1: "POSITIVE_1", + } + + @schemas.classproperty + def POSITIVE_1(cls): + return cls(1) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/enum_with_escaped_characters.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/enum_with_escaped_characters.py new file mode 100644 index 00000000000..5a59c336102 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/enum_with_escaped_characters.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class EnumWithEscapedCharacters( + schemas.StrSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = { + str, + } + enum_value_to_name = { + "foo\nbar": "FOO_LINE_FEED_LF_BAR", + "foo\rbar": "FOO_CARRIAGE_RETURN_CR_BAR", + } + + @schemas.classproperty + def FOO_LINE_FEED_LF_BAR(cls): + return cls("foo\nbar") + + @schemas.classproperty + def FOO_CARRIAGE_RETURN_CR_BAR(cls): + return cls("foo\rbar") diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/enum_with_false_does_not_match0.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/enum_with_false_does_not_match0.py new file mode 100644 index 00000000000..a143a42cdef --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/enum_with_false_does_not_match0.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class EnumWithFalseDoesNotMatch0( + schemas.BoolSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = { + schemas.BoolClass, + } + enum_value_to_name = { + schemas.BoolClass.FALSE: "FALSE", + } + + @schemas.classproperty + def FALSE(cls): + return cls(False) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/enum_with_true_does_not_match1.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/enum_with_true_does_not_match1.py new file mode 100644 index 00000000000..27d039c8d3e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/enum_with_true_does_not_match1.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class EnumWithTrueDoesNotMatch1( + schemas.BoolSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = { + schemas.BoolClass, + } + enum_value_to_name = { + schemas.BoolClass.TRUE: "TRUE", + } + + @schemas.classproperty + def TRUE(cls): + return cls(True) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/enums_in_properties.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/enums_in_properties.py new file mode 100644 index 00000000000..f95a658bc80 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/enums_in_properties.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class EnumsInProperties( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {frozendict.frozendict} + required = { + "bar", + } + + class Properties: + + + class Foo( + schemas.StrSchema + ): + + + class Schema_: + types = { + str, + } + enum_value_to_name = { + "foo": "FOO", + } + + @schemas.classproperty + def FOO(cls): + return cls("foo") + + + class Bar( + schemas.StrSchema + ): + + + class Schema_: + types = { + str, + } + enum_value_to_name = { + "bar": "BAR", + } + + @schemas.classproperty + def BAR(cls): + return cls("bar") + __annotations__ = { + "foo": Foo, + "bar": Bar, + } + + bar: Schema_.Properties.Bar + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["bar"]) -> Schema_.Properties.Bar: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["foo"]) -> Schema_.Properties.Foo: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["bar"], + typing_extensions.Literal["foo"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["bar"]) -> Schema_.Properties.Bar: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["foo"]) -> typing.Union[Schema_.Properties.Foo, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["bar"], + typing_extensions.Literal["foo"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + bar: typing.Union[Schema_.Properties.Bar, str], + foo: typing.Union[Schema_.Properties.Foo, str, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'EnumsInProperties': + return super().__new__( + cls, + *args_, + bar=bar, + foo=foo, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/forbidden_property.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/forbidden_property.py new file mode 100644 index 00000000000..dc14bded746 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/forbidden_property.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class ForbiddenProperty( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + + class Properties: + Foo = schemas.NotAnyTypeSchema + __annotations__ = { + "foo": Foo, + } + + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["foo"]) -> Schema_.Properties.Foo: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["foo"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["foo"]) -> typing.Union[Schema_.Properties.Foo, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["foo"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + foo: typing.Union[Schema_.Properties.Foo, dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'ForbiddenProperty': + return super().__new__( + cls, + *args_, + foo=foo, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/hostname_format.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/hostname_format.py new file mode 100644 index 00000000000..eb162ac4f87 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/hostname_format.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class HostnameFormat( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + format = 'hostname' + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'HostnameFormat': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/integer_type_matches_integers.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/integer_type_matches_integers.py similarity index 81% rename from samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/integer_type_matches_integers.py rename to samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/integer_type_matches_integers.py index ccb986ac466..c7ad3339c4d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/integer_type_matches_integers.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/integer_type_matches_integers.py @@ -6,10 +6,10 @@ sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ -from datetime import date, datetime # noqa: F401 +import datetime # noqa: F401 import decimal # noqa: F401 import functools # noqa: F401 import io # noqa: F401 diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/invalid_instance_should_not_raise_error_when_float_division_inf.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/invalid_instance_should_not_raise_error_when_float_division_inf.py new file mode 100644 index 00000000000..86435454e39 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/invalid_instance_should_not_raise_error_when_float_division_inf.py @@ -0,0 +1,41 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf( + schemas.IntSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = { + decimal.Decimal, + } + format = 'int' + multiple_of = 0.123456789 diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/invalid_string_value_for_default.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/invalid_string_value_for_default.py new file mode 100644 index 00000000000..4f61dda6020 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/invalid_string_value_for_default.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class InvalidStringValueForDefault( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + + class Properties: + + + class Bar( + schemas.StrSchema + ): + + + class Schema_: + types = { + str, + } + min_length = 4 + default = "bad" + __annotations__ = { + "bar": Bar, + } + + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["bar"]) -> Schema_.Properties.Bar: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["bar"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["bar"]) -> typing.Union[Schema_.Properties.Bar, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["bar"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + bar: typing.Union[Schema_.Properties.Bar, str, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'InvalidStringValueForDefault': + return super().__new__( + cls, + *args_, + bar=bar, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/ipv4_format.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/ipv4_format.py new file mode 100644 index 00000000000..ac05443f7b0 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/ipv4_format.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class Ipv4Format( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + format = 'ipv4' + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'Ipv4Format': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/ipv6_format.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/ipv6_format.py new file mode 100644 index 00000000000..1756857457a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/ipv6_format.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class Ipv6Format( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + format = 'ipv6' + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'Ipv6Format': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/json_pointer_format.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/json_pointer_format.py new file mode 100644 index 00000000000..1875025048c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/json_pointer_format.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class JsonPointerFormat( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + format = 'json-pointer' + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'JsonPointerFormat': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/maximum_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/maximum_validation.py new file mode 100644 index 00000000000..8bf14184866 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/maximum_validation.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class MaximumValidation( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + inclusive_maximum = 3.0 + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'MaximumValidation': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/maximum_validation_with_unsigned_integer.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/maximum_validation_with_unsigned_integer.py new file mode 100644 index 00000000000..c0f5128fa43 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/maximum_validation_with_unsigned_integer.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class MaximumValidationWithUnsignedInteger( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + inclusive_maximum = 300 + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'MaximumValidationWithUnsignedInteger': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/maxitems_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/maxitems_validation.py new file mode 100644 index 00000000000..ba4e705e5e3 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/maxitems_validation.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class MaxitemsValidation( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + max_items = 2 + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'MaxitemsValidation': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/maxlength_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/maxlength_validation.py new file mode 100644 index 00000000000..ceefcc85c75 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/maxlength_validation.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class MaxlengthValidation( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + max_length = 2 + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'MaxlengthValidation': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/maxproperties0_means_the_object_is_empty.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/maxproperties0_means_the_object_is_empty.py new file mode 100644 index 00000000000..6168e5efa6c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/maxproperties0_means_the_object_is_empty.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class Maxproperties0MeansTheObjectIsEmpty( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + max_properties = 0 + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'Maxproperties0MeansTheObjectIsEmpty': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/maxproperties_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/maxproperties_validation.py new file mode 100644 index 00000000000..18fbf634fd3 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/maxproperties_validation.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class MaxpropertiesValidation( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + max_properties = 2 + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'MaxpropertiesValidation': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/minimum_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/minimum_validation.py new file mode 100644 index 00000000000..6cf38b9077b --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/minimum_validation.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class MinimumValidation( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + inclusive_minimum = 1.1 + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'MinimumValidation': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/minimum_validation_with_signed_integer.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/minimum_validation_with_signed_integer.py new file mode 100644 index 00000000000..c6983336d29 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/minimum_validation_with_signed_integer.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class MinimumValidationWithSignedInteger( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + inclusive_minimum = -2 + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'MinimumValidationWithSignedInteger': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/minitems_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/minitems_validation.py new file mode 100644 index 00000000000..07884cfbda7 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/minitems_validation.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class MinitemsValidation( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + min_items = 1 + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'MinitemsValidation': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/minlength_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/minlength_validation.py new file mode 100644 index 00000000000..5e0ef67823e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/minlength_validation.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class MinlengthValidation( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + min_length = 2 + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'MinlengthValidation': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/minproperties_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/minproperties_validation.py new file mode 100644 index 00000000000..0127b6a27dc --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/minproperties_validation.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class MinpropertiesValidation( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + min_properties = 1 + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'MinpropertiesValidation': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/nested_allof_to_check_validation_semantics.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/nested_allof_to_check_validation_semantics.py new file mode 100644 index 00000000000..b01132b5be6 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/nested_allof_to_check_validation_semantics.py @@ -0,0 +1,85 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class NestedAllofToCheckValidationSemantics( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + + class AllOf: + + + class _0( + schemas.AnyTypeSchema, + ): + + + class Schema_: + # any type + + class AllOf: + _0 = schemas.NoneSchema + classes = [ + _0, + ] + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'NestedAllofToCheckValidationSemantics.Schema_.AllOf._0': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + classes = [ + _0, + ] + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'NestedAllofToCheckValidationSemantics': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/nested_anyof_to_check_validation_semantics.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/nested_anyof_to_check_validation_semantics.py new file mode 100644 index 00000000000..367868ab45b --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/nested_anyof_to_check_validation_semantics.py @@ -0,0 +1,85 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class NestedAnyofToCheckValidationSemantics( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + + class AnyOf: + + + class _0( + schemas.AnyTypeSchema, + ): + + + class Schema_: + # any type + + class AnyOf: + _0 = schemas.NoneSchema + classes = [ + _0, + ] + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'NestedAnyofToCheckValidationSemantics.Schema_.AnyOf._0': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + classes = [ + _0, + ] + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'NestedAnyofToCheckValidationSemantics': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/nested_items.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/nested_items.py new file mode 100644 index 00000000000..98f80976b27 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/nested_items.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class NestedItems( + schemas.ListSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {tuple} + + + class Items( + schemas.ListSchema + ): + + + class Schema_: + types = {tuple} + + + class Items( + schemas.ListSchema + ): + + + class Schema_: + types = {tuple} + + + class Items( + schemas.ListSchema + ): + + + class Schema_: + types = {tuple} + Items = schemas.NumberSchema + + def __new__( + cls, + arg_: typing.Union[ + typing.Tuple[ + typing.Union[Schema_.Items, decimal.Decimal, int, float], ... + ], + typing.List[ + typing.Union[Schema_.Items, decimal.Decimal, int, float] + ], + ], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'NestedItems.Schema_.Items.Schema_.Items.Schema_.Items': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) + + def __getitem__(self, i: int) -> Schema_.Items: + return super().__getitem__(i) + + def __new__( + cls, + arg_: typing.Union[ + typing.Tuple[ + typing.Union[Schema_.Items, list, tuple], ... + ], + typing.List[ + typing.Union[Schema_.Items, list, tuple] + ], + ], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'NestedItems.Schema_.Items.Schema_.Items': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) + + def __getitem__(self, i: int) -> Schema_.Items: + return super().__getitem__(i) + + def __new__( + cls, + arg_: typing.Union[ + typing.Tuple[ + typing.Union[Schema_.Items, list, tuple], ... + ], + typing.List[ + typing.Union[Schema_.Items, list, tuple] + ], + ], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'NestedItems.Schema_.Items': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) + + def __getitem__(self, i: int) -> Schema_.Items: + return super().__getitem__(i) + + def __new__( + cls, + arg_: typing.Union[ + typing.Tuple[ + typing.Union[Schema_.Items, list, tuple], ... + ], + typing.List[ + typing.Union[Schema_.Items, list, tuple] + ], + ], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'NestedItems': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) + + def __getitem__(self, i: int) -> Schema_.Items: + return super().__getitem__(i) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/nested_oneof_to_check_validation_semantics.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/nested_oneof_to_check_validation_semantics.py new file mode 100644 index 00000000000..84828e62284 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/nested_oneof_to_check_validation_semantics.py @@ -0,0 +1,85 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class NestedOneofToCheckValidationSemantics( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + + class OneOf: + + + class _0( + schemas.AnyTypeSchema, + ): + + + class Schema_: + # any type + + class OneOf: + _0 = schemas.NoneSchema + classes = [ + _0, + ] + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'NestedOneofToCheckValidationSemantics.Schema_.OneOf._0': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + classes = [ + _0, + ] + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'NestedOneofToCheckValidationSemantics': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/not_more_complex_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/not_more_complex_schema.py new file mode 100644 index 00000000000..415b7c509e9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/not_more_complex_schema.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class NotMoreComplexSchema( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + + + class _Not( + schemas.DictSchema + ): + + + class Schema_: + types = {frozendict.frozendict} + + class Properties: + Foo = schemas.StrSchema + __annotations__ = { + "foo": Foo, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["foo"]) -> Schema_.Properties.Foo: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["foo"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["foo"]) -> typing.Union[Schema_.Properties.Foo, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["foo"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + foo: typing.Union[Schema_.Properties.Foo, str, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'NotMoreComplexSchema.Schema_._Not': + return super().__new__( + cls, + *args_, + foo=foo, + configuration_=configuration_, + **kwargs, + ) + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'NotMoreComplexSchema': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/nul_characters_in_strings.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/nul_characters_in_strings.py new file mode 100644 index 00000000000..b93bd8d1805 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/nul_characters_in_strings.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class NulCharactersInStrings( + schemas.StrSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = { + str, + } + enum_value_to_name = { + "hello\x00there": "HELLO_NULL_THERE", + } + + @schemas.classproperty + def HELLO_NULL_THERE(cls): + return cls("hello\x00there") diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/null_type_matches_only_the_null_object.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/null_type_matches_only_the_null_object.py similarity index 81% rename from samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/null_type_matches_only_the_null_object.py rename to samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/null_type_matches_only_the_null_object.py index 4b1bff62a13..d4375810d0e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/null_type_matches_only_the_null_object.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/null_type_matches_only_the_null_object.py @@ -6,10 +6,10 @@ sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ -from datetime import date, datetime # noqa: F401 +import datetime # noqa: F401 import decimal # noqa: F401 import functools # noqa: F401 import io # noqa: F401 diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/number_type_matches_numbers.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/number_type_matches_numbers.py similarity index 81% rename from samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/number_type_matches_numbers.py rename to samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/number_type_matches_numbers.py index e4d1d79b975..068a6cfda96 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/number_type_matches_numbers.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/number_type_matches_numbers.py @@ -6,10 +6,10 @@ sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ -from datetime import date, datetime # noqa: F401 +import datetime # noqa: F401 import decimal # noqa: F401 import functools # noqa: F401 import io # noqa: F401 diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/object_properties_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/object_properties_validation.py new file mode 100644 index 00000000000..9a60dd1b62d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/object_properties_validation.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class ObjectPropertiesValidation( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + + class Properties: + Foo = schemas.IntSchema + Bar = schemas.StrSchema + __annotations__ = { + "foo": Foo, + "bar": Bar, + } + + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["foo"]) -> Schema_.Properties.Foo: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["bar"]) -> Schema_.Properties.Bar: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["foo"], + typing_extensions.Literal["bar"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["foo"]) -> typing.Union[Schema_.Properties.Foo, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["bar"]) -> typing.Union[Schema_.Properties.Bar, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["foo"], + typing_extensions.Literal["bar"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + foo: typing.Union[Schema_.Properties.Foo, decimal.Decimal, int, schemas.Unset] = schemas.unset, + bar: typing.Union[Schema_.Properties.Bar, str, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'ObjectPropertiesValidation': + return super().__new__( + cls, + *args_, + foo=foo, + bar=bar, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/object_type_matches_objects.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/object_type_matches_objects.py new file mode 100644 index 00000000000..0cb63b3eb5c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/object_type_matches_objects.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 +ObjectTypeMatchesObjects = schemas.DictSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/oneof.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/oneof.py new file mode 100644 index 00000000000..4bc332136c5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/oneof.py @@ -0,0 +1,82 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class Oneof( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + + class OneOf: + _0 = schemas.IntSchema + + + class _1( + schemas.AnyTypeSchema, + ): + + + class Schema_: + # any type + inclusive_minimum = 2 + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'Oneof.Schema_.OneOf._1': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + classes = [ + _0, + _1, + ] + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'Oneof': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/oneof_complex_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/oneof_complex_types.py new file mode 100644 index 00000000000..78d7807fc35 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/oneof_complex_types.py @@ -0,0 +1,187 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class OneofComplexTypes( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + + class OneOf: + + + class _0( + schemas.AnyTypeSchema, + ): + + + class Schema_: + # any type + required = { + "bar", + } + + class Properties: + Bar = schemas.IntSchema + __annotations__ = { + "bar": Bar, + } + + + bar: Schema_.Properties.Bar + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["bar"]) -> Schema_.Properties.Bar: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["bar"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["bar"]) -> Schema_.Properties.Bar: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["bar"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'OneofComplexTypes.Schema_.OneOf._0': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + + + class _1( + schemas.AnyTypeSchema, + ): + + + class Schema_: + # any type + required = { + "foo", + } + + class Properties: + Foo = schemas.StrSchema + __annotations__ = { + "foo": Foo, + } + + + foo: Schema_.Properties.Foo + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["foo"]) -> Schema_.Properties.Foo: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["foo"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["foo"]) -> Schema_.Properties.Foo: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["foo"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'OneofComplexTypes.Schema_.OneOf._1': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + classes = [ + _0, + _1, + ] + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'OneofComplexTypes': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/oneof_with_base_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/oneof_with_base_schema.py new file mode 100644 index 00000000000..cb5c61fb2d9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/oneof_with_base_schema.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class OneofWithBaseSchema( + schemas.StrSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = { + str, + } + + class OneOf: + + + class _0( + schemas.AnyTypeSchema, + ): + + + class Schema_: + # any type + min_length = 2 + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'OneofWithBaseSchema.Schema_.OneOf._0': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + + + class _1( + schemas.AnyTypeSchema, + ): + + + class Schema_: + # any type + max_length = 4 + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'OneofWithBaseSchema.Schema_.OneOf._1': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + classes = [ + _0, + _1, + ] + + + def __new__( + cls, + arg_: str, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'OneofWithBaseSchema': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/oneof_with_empty_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/oneof_with_empty_schema.py new file mode 100644 index 00000000000..c4478118aae --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/oneof_with_empty_schema.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class OneofWithEmptySchema( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + + class OneOf: + _0 = schemas.NumberSchema + _1 = schemas.AnyTypeSchema + classes = [ + _0, + _1, + ] + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'OneofWithEmptySchema': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/oneof_with_required.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/oneof_with_required.py new file mode 100644 index 00000000000..497b4b7601c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/oneof_with_required.py @@ -0,0 +1,197 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class OneofWithRequired( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = { + frozendict.frozendict, + } + + class OneOf: + + + class _0( + schemas.AnyTypeSchema, + ): + + + class Schema_: + # any type + required = { + "bar", + "foo", + } + + + bar: schemas.AnyTypeSchema + foo: schemas.AnyTypeSchema + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["bar"]) -> schemas.AnyTypeSchema: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["foo"]) -> schemas.AnyTypeSchema: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["bar"], + typing_extensions.Literal["foo"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["bar"]) -> schemas.AnyTypeSchema: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["foo"]) -> schemas.AnyTypeSchema: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["bar"], + typing_extensions.Literal["foo"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'OneofWithRequired.Schema_.OneOf._0': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + + + class _1( + schemas.AnyTypeSchema, + ): + + + class Schema_: + # any type + required = { + "baz", + "foo", + } + + + baz: schemas.AnyTypeSchema + foo: schemas.AnyTypeSchema + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["baz"]) -> schemas.AnyTypeSchema: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["foo"]) -> schemas.AnyTypeSchema: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["baz"], + typing_extensions.Literal["foo"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["baz"]) -> schemas.AnyTypeSchema: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["foo"]) -> schemas.AnyTypeSchema: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["baz"], + typing_extensions.Literal["foo"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'OneofWithRequired.Schema_.OneOf._1': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + classes = [ + _0, + _1, + ] + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'OneofWithRequired': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/pattern_is_not_anchored.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/pattern_is_not_anchored.py new file mode 100644 index 00000000000..ad8f238b67b --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/pattern_is_not_anchored.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class PatternIsNotAnchored( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + regex={ + 'pattern': r'a+', # noqa: E501 + } + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'PatternIsNotAnchored': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/pattern_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/pattern_validation.py new file mode 100644 index 00000000000..47268ce2d0f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/pattern_validation.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class PatternValidation( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + regex={ + 'pattern': r'^a*$', # noqa: E501 + } + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'PatternValidation': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/properties_with_escaped_characters.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/properties_with_escaped_characters.py new file mode 100644 index 00000000000..abbcf88f92f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/properties_with_escaped_characters.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class PropertiesWithEscapedCharacters( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + + class Properties: + FooNbar = schemas.NumberSchema + FooBar = schemas.NumberSchema + FooBar = schemas.NumberSchema + FooRbar = schemas.NumberSchema + FooTbar = schemas.NumberSchema + FooFbar = schemas.NumberSchema + __annotations__ = { + "foo\nbar": FooNbar, + "foo\"bar": FooBar, + "foo\\bar": FooBar, + "foo\rbar": FooRbar, + "foo\tbar": FooTbar, + "foo\fbar": FooFbar, + } + + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["foo\nbar"]) -> Schema_.Properties.FooNbar: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["foo\"bar"]) -> Schema_.Properties.FooBar: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["foo\\bar"]) -> Schema_.Properties.FooBar: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["foo\rbar"]) -> Schema_.Properties.FooRbar: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["foo\tbar"]) -> Schema_.Properties.FooTbar: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["foo\fbar"]) -> Schema_.Properties.FooFbar: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["foo\nbar"], + typing_extensions.Literal["foo\"bar"], + typing_extensions.Literal["foo\\bar"], + typing_extensions.Literal["foo\rbar"], + typing_extensions.Literal["foo\tbar"], + typing_extensions.Literal["foo\fbar"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["foo\nbar"]) -> typing.Union[Schema_.Properties.FooNbar, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["foo\"bar"]) -> typing.Union[Schema_.Properties.FooBar, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["foo\\bar"]) -> typing.Union[Schema_.Properties.FooBar, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["foo\rbar"]) -> typing.Union[Schema_.Properties.FooRbar, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["foo\tbar"]) -> typing.Union[Schema_.Properties.FooTbar, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["foo\fbar"]) -> typing.Union[Schema_.Properties.FooFbar, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["foo\nbar"], + typing_extensions.Literal["foo\"bar"], + typing_extensions.Literal["foo\\bar"], + typing_extensions.Literal["foo\rbar"], + typing_extensions.Literal["foo\tbar"], + typing_extensions.Literal["foo\fbar"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'PropertiesWithEscapedCharacters': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/property_named_ref_that_is_not_a_reference.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/property_named_ref_that_is_not_a_reference.py new file mode 100644 index 00000000000..0114a6bb827 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/property_named_ref_that_is_not_a_reference.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class PropertyNamedRefThatIsNotAReference( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + + class Properties: + Ref = schemas.StrSchema + __annotations__ = { + "$ref": Ref, + } + + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["$ref"]) -> Schema_.Properties.Ref: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["$ref"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["$ref"]) -> typing.Union[Schema_.Properties.Ref, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["$ref"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'PropertyNamedRefThatIsNotAReference': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/ref_in_additionalproperties.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/ref_in_additionalproperties.py new file mode 100644 index 00000000000..f5ea74fe159 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/ref_in_additionalproperties.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class RefInAdditionalproperties( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {frozendict.frozendict} + + @staticmethod + def additional_properties() -> typing.Type['property_named_ref_that_is_not_a_reference.PropertyNamedRefThatIsNotAReference']: + return property_named_ref_that_is_not_a_reference.PropertyNamedRefThatIsNotAReference + + def __getitem__(self, name: str) -> 'property_named_ref_that_is_not_a_reference.PropertyNamedRefThatIsNotAReference': + # dict_instance[name] accessor + return super().__getitem__(name) + + def get_item_(self, name: str) -> 'property_named_ref_that_is_not_a_reference.PropertyNamedRefThatIsNotAReference': + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union['property_named_ref_that_is_not_a_reference.PropertyNamedRefThatIsNotAReference', dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + ) -> 'RefInAdditionalproperties': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + +from unit_test_api.components.schema import property_named_ref_that_is_not_a_reference diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/ref_in_allof.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/ref_in_allof.py new file mode 100644 index 00000000000..14f5d6d22e7 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/ref_in_allof.py @@ -0,0 +1,62 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class RefInAllof( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + + class AllOf: + + @staticmethod + def _0() -> typing.Type['property_named_ref_that_is_not_a_reference.PropertyNamedRefThatIsNotAReference']: + return property_named_ref_that_is_not_a_reference.PropertyNamedRefThatIsNotAReference + classes = [ + _0, + ] + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'RefInAllof': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + +from unit_test_api.components.schema import property_named_ref_that_is_not_a_reference diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/ref_in_anyof.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/ref_in_anyof.py new file mode 100644 index 00000000000..c9ea3d4e8cc --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/ref_in_anyof.py @@ -0,0 +1,62 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class RefInAnyof( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + + class AnyOf: + + @staticmethod + def _0() -> typing.Type['property_named_ref_that_is_not_a_reference.PropertyNamedRefThatIsNotAReference']: + return property_named_ref_that_is_not_a_reference.PropertyNamedRefThatIsNotAReference + classes = [ + _0, + ] + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'RefInAnyof': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + +from unit_test_api.components.schema import property_named_ref_that_is_not_a_reference diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/ref_in_items.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/ref_in_items.py new file mode 100644 index 00000000000..79c05b284d0 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/ref_in_items.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class RefInItems( + schemas.ListSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {tuple} + + @staticmethod + def items() -> typing.Type['property_named_ref_that_is_not_a_reference.PropertyNamedRefThatIsNotAReference']: + return property_named_ref_that_is_not_a_reference.PropertyNamedRefThatIsNotAReference + + def __new__( + cls, + arg_: typing.Union[ + typing.Tuple[ + typing.Union['property_named_ref_that_is_not_a_reference.PropertyNamedRefThatIsNotAReference', dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], ... + ], + typing.List[ + typing.Union['property_named_ref_that_is_not_a_reference.PropertyNamedRefThatIsNotAReference', dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] + ], + ], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'RefInItems': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) + + def __getitem__(self, i: int) -> 'property_named_ref_that_is_not_a_reference.PropertyNamedRefThatIsNotAReference': + return super().__getitem__(i) + +from unit_test_api.components.schema import property_named_ref_that_is_not_a_reference diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/ref_in_not.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/ref_in_not.py new file mode 100644 index 00000000000..dd846cc8be3 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/ref_in_not.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class RefInNot( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + + @staticmethod + def _not() -> typing.Type['property_named_ref_that_is_not_a_reference.PropertyNamedRefThatIsNotAReference']: + return property_named_ref_that_is_not_a_reference.PropertyNamedRefThatIsNotAReference + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'RefInNot': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + +from unit_test_api.components.schema import property_named_ref_that_is_not_a_reference diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/ref_in_oneof.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/ref_in_oneof.py new file mode 100644 index 00000000000..b58353ad3a1 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/ref_in_oneof.py @@ -0,0 +1,62 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class RefInOneof( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + + class OneOf: + + @staticmethod + def _0() -> typing.Type['property_named_ref_that_is_not_a_reference.PropertyNamedRefThatIsNotAReference']: + return property_named_ref_that_is_not_a_reference.PropertyNamedRefThatIsNotAReference + classes = [ + _0, + ] + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'RefInOneof': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + +from unit_test_api.components.schema import property_named_ref_that_is_not_a_reference diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/ref_in_property.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/ref_in_property.py new file mode 100644 index 00000000000..a37371d28f4 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/ref_in_property.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class RefInProperty( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + + class Properties: + + @staticmethod + def a() -> typing.Type['property_named_ref_that_is_not_a_reference.PropertyNamedRefThatIsNotAReference']: + return property_named_ref_that_is_not_a_reference.PropertyNamedRefThatIsNotAReference + __annotations__ = { + "a": a, + } + + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["a"]) -> 'property_named_ref_that_is_not_a_reference.PropertyNamedRefThatIsNotAReference': ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["a"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["a"]) -> typing.Union['property_named_ref_that_is_not_a_reference.PropertyNamedRefThatIsNotAReference', schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["a"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + a: typing.Union['property_named_ref_that_is_not_a_reference.PropertyNamedRefThatIsNotAReference', dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'RefInProperty': + return super().__new__( + cls, + *args_, + a=a, + configuration_=configuration_, + **kwargs, + ) + +from unit_test_api.components.schema import property_named_ref_that_is_not_a_reference diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/required_default_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/required_default_validation.py new file mode 100644 index 00000000000..d3e33f29e9f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/required_default_validation.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class RequiredDefaultValidation( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + + class Properties: + Foo = schemas.AnyTypeSchema + __annotations__ = { + "foo": Foo, + } + + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["foo"]) -> Schema_.Properties.Foo: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["foo"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["foo"]) -> typing.Union[Schema_.Properties.Foo, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["foo"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + foo: typing.Union[Schema_.Properties.Foo, dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'RequiredDefaultValidation': + return super().__new__( + cls, + *args_, + foo=foo, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/required_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/required_validation.py new file mode 100644 index 00000000000..f064a323d5d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/required_validation.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class RequiredValidation( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + required = { + "foo", + } + + class Properties: + Foo = schemas.AnyTypeSchema + Bar = schemas.AnyTypeSchema + __annotations__ = { + "foo": Foo, + "bar": Bar, + } + + + foo: Schema_.Properties.Foo + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["foo"]) -> Schema_.Properties.Foo: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["bar"]) -> Schema_.Properties.Bar: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["foo"], + typing_extensions.Literal["bar"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["foo"]) -> Schema_.Properties.Foo: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["bar"]) -> typing.Union[Schema_.Properties.Bar, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["foo"], + typing_extensions.Literal["bar"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + bar: typing.Union[Schema_.Properties.Bar, dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'RequiredValidation': + return super().__new__( + cls, + *args_, + bar=bar, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/required_with_empty_array.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/required_with_empty_array.py new file mode 100644 index 00000000000..2ed491da9c6 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/required_with_empty_array.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class RequiredWithEmptyArray( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + + class Properties: + Foo = schemas.AnyTypeSchema + __annotations__ = { + "foo": Foo, + } + + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["foo"]) -> Schema_.Properties.Foo: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["foo"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["foo"]) -> typing.Union[Schema_.Properties.Foo, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["foo"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + foo: typing.Union[Schema_.Properties.Foo, dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'RequiredWithEmptyArray': + return super().__new__( + cls, + *args_, + foo=foo, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/required_with_escaped_characters.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/required_with_escaped_characters.py new file mode 100644 index 00000000000..45ec5182624 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/required_with_escaped_characters.py @@ -0,0 +1,131 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class RequiredWithEscapedCharacters( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + required = { + "foo\tbar", + "foo\nbar", + "foo\fbar", + "foo\rbar", + "foo\"bar", + "foo\\bar", + } + + + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["foo\tbar"]) -> schemas.AnyTypeSchema: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["foo\nbar"]) -> schemas.AnyTypeSchema: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["foo\fbar"]) -> schemas.AnyTypeSchema: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["foo\rbar"]) -> schemas.AnyTypeSchema: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["foo\"bar"]) -> schemas.AnyTypeSchema: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["foo\\bar"]) -> schemas.AnyTypeSchema: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["foo\tbar"], + typing_extensions.Literal["foo\nbar"], + typing_extensions.Literal["foo\fbar"], + typing_extensions.Literal["foo\rbar"], + typing_extensions.Literal["foo\"bar"], + typing_extensions.Literal["foo\\bar"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["foo\tbar"]) -> schemas.AnyTypeSchema: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["foo\nbar"]) -> schemas.AnyTypeSchema: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["foo\fbar"]) -> schemas.AnyTypeSchema: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["foo\rbar"]) -> schemas.AnyTypeSchema: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["foo\"bar"]) -> schemas.AnyTypeSchema: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["foo\\bar"]) -> schemas.AnyTypeSchema: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["foo\tbar"], + typing_extensions.Literal["foo\nbar"], + typing_extensions.Literal["foo\fbar"], + typing_extensions.Literal["foo\rbar"], + typing_extensions.Literal["foo\"bar"], + typing_extensions.Literal["foo\\bar"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'RequiredWithEscapedCharacters': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/simple_enum_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/simple_enum_validation.py new file mode 100644 index 00000000000..9fa3340dad4 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/simple_enum_validation.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class SimpleEnumValidation( + schemas.NumberSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = { + decimal.Decimal, + } + enum_value_to_name = { + 1: "POSITIVE_1", + 2: "POSITIVE_2", + 3: "POSITIVE_3", + } + + @schemas.classproperty + def POSITIVE_1(cls): + return cls(1) + + @schemas.classproperty + def POSITIVE_2(cls): + return cls(2) + + @schemas.classproperty + def POSITIVE_3(cls): + return cls(3) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/string_type_matches_strings.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/string_type_matches_strings.py similarity index 81% rename from samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/string_type_matches_strings.py rename to samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/string_type_matches_strings.py index 573e83bc999..8131a158dbf 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/string_type_matches_strings.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/string_type_matches_strings.py @@ -6,10 +6,10 @@ sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ -from datetime import date, datetime # noqa: F401 +import datetime # noqa: F401 import decimal # noqa: F401 import functools # noqa: F401 import io # noqa: F401 diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/the_default_keyword_does_not_do_anything_if_the_property_is_missing.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/the_default_keyword_does_not_do_anything_if_the_property_is_missing.py new file mode 100644 index 00000000000..e9b934d4b4b --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/the_default_keyword_does_not_do_anything_if_the_property_is_missing.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {frozendict.frozendict} + + class Properties: + + + class Alpha( + schemas.NumberSchema + ): + + + class Schema_: + types = { + decimal.Decimal, + } + inclusive_maximum = 3 + default = 5 + __annotations__ = { + "alpha": Alpha, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["alpha"]) -> Schema_.Properties.Alpha: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["alpha"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["alpha"]) -> typing.Union[Schema_.Properties.Alpha, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["alpha"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + alpha: typing.Union[Schema_.Properties.Alpha, decimal.Decimal, int, float, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing': + return super().__new__( + cls, + *args_, + alpha=alpha, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/uniqueitems_false_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/uniqueitems_false_validation.py new file mode 100644 index 00000000000..e6cae1e46c2 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/uniqueitems_false_validation.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class UniqueitemsFalseValidation( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + unique_items = False + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'UniqueitemsFalseValidation': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/uniqueitems_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/uniqueitems_validation.py new file mode 100644 index 00000000000..11be6c30890 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/uniqueitems_validation.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class UniqueitemsValidation( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + unique_items = True + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'UniqueitemsValidation': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/uri_format.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/uri_format.py new file mode 100644 index 00000000000..12296f6a8c6 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/uri_format.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class UriFormat( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + format = 'uri' + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'UriFormat': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/uri_reference_format.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/uri_reference_format.py new file mode 100644 index 00000000000..98ffe3c77e5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/uri_reference_format.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class UriReferenceFormat( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + format = 'uri-reference' + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'UriReferenceFormat': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/uri_template_format.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/uri_template_format.py new file mode 100644 index 00000000000..374022657b1 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/uri_template_format.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class UriTemplateFormat( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + format = 'uri-template' + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'UriTemplateFormat': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schemas/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schemas/__init__.py new file mode 100644 index 00000000000..7244d2f60b7 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schemas/__init__.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +# flake8: noqa + +# import all models into this package +# if you have many models here with many references from one model to another this may +# raise a RecursionError +# to avoid this, import only the models that you directly need like: +# from from unit_test_api.components.schema.pet import Pet +# or import this package, but before doing it, use: +# import sys +# sys.setrecursionlimit(n) + +from unit_test_api.components.schema.additionalproperties_allows_a_schema_which_should_validate import AdditionalpropertiesAllowsASchemaWhichShouldValidate +from unit_test_api.components.schema.additionalproperties_are_allowed_by_default import AdditionalpropertiesAreAllowedByDefault +from unit_test_api.components.schema.additionalproperties_can_exist_by_itself import AdditionalpropertiesCanExistByItself +from unit_test_api.components.schema.additionalproperties_should_not_look_in_applicators import AdditionalpropertiesShouldNotLookInApplicators +from unit_test_api.components.schema.allof import Allof +from unit_test_api.components.schema.allof_combined_with_anyof_oneof import AllofCombinedWithAnyofOneof +from unit_test_api.components.schema.allof_simple_types import AllofSimpleTypes +from unit_test_api.components.schema.allof_with_base_schema import AllofWithBaseSchema +from unit_test_api.components.schema.allof_with_one_empty_schema import AllofWithOneEmptySchema +from unit_test_api.components.schema.allof_with_the_first_empty_schema import AllofWithTheFirstEmptySchema +from unit_test_api.components.schema.allof_with_the_last_empty_schema import AllofWithTheLastEmptySchema +from unit_test_api.components.schema.allof_with_two_empty_schemas import AllofWithTwoEmptySchemas +from unit_test_api.components.schema.anyof import Anyof +from unit_test_api.components.schema.anyof_complex_types import AnyofComplexTypes +from unit_test_api.components.schema.anyof_with_base_schema import AnyofWithBaseSchema +from unit_test_api.components.schema.anyof_with_one_empty_schema import AnyofWithOneEmptySchema +from unit_test_api.components.schema.array_type_matches_arrays import ArrayTypeMatchesArrays +from unit_test_api.components.schema.boolean_type_matches_booleans import BooleanTypeMatchesBooleans +from unit_test_api.components.schema.by_int import ByInt +from unit_test_api.components.schema.by_number import ByNumber +from unit_test_api.components.schema.by_small_number import BySmallNumber +from unit_test_api.components.schema.date_time_format import DateTimeFormat +from unit_test_api.components.schema.email_format import EmailFormat +from unit_test_api.components.schema.enum_with0_does_not_match_false import EnumWith0DoesNotMatchFalse +from unit_test_api.components.schema.enum_with1_does_not_match_true import EnumWith1DoesNotMatchTrue +from unit_test_api.components.schema.enum_with_escaped_characters import EnumWithEscapedCharacters +from unit_test_api.components.schema.enum_with_false_does_not_match0 import EnumWithFalseDoesNotMatch0 +from unit_test_api.components.schema.enum_with_true_does_not_match1 import EnumWithTrueDoesNotMatch1 +from unit_test_api.components.schema.enums_in_properties import EnumsInProperties +from unit_test_api.components.schema.forbidden_property import ForbiddenProperty +from unit_test_api.components.schema.hostname_format import HostnameFormat +from unit_test_api.components.schema.integer_type_matches_integers import IntegerTypeMatchesIntegers +from unit_test_api.components.schema.invalid_instance_should_not_raise_error_when_float_division_inf import InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf +from unit_test_api.components.schema.invalid_string_value_for_default import InvalidStringValueForDefault +from unit_test_api.components.schema.ipv4_format import Ipv4Format +from unit_test_api.components.schema.ipv6_format import Ipv6Format +from unit_test_api.components.schema.json_pointer_format import JsonPointerFormat +from unit_test_api.components.schema.maximum_validation import MaximumValidation +from unit_test_api.components.schema.maximum_validation_with_unsigned_integer import MaximumValidationWithUnsignedInteger +from unit_test_api.components.schema.maxitems_validation import MaxitemsValidation +from unit_test_api.components.schema.maxlength_validation import MaxlengthValidation +from unit_test_api.components.schema.maxproperties0_means_the_object_is_empty import Maxproperties0MeansTheObjectIsEmpty +from unit_test_api.components.schema.maxproperties_validation import MaxpropertiesValidation +from unit_test_api.components.schema.minimum_validation import MinimumValidation +from unit_test_api.components.schema.minimum_validation_with_signed_integer import MinimumValidationWithSignedInteger +from unit_test_api.components.schema.minitems_validation import MinitemsValidation +from unit_test_api.components.schema.minlength_validation import MinlengthValidation +from unit_test_api.components.schema.minproperties_validation import MinpropertiesValidation +from unit_test_api.components.schema.nested_allof_to_check_validation_semantics import NestedAllofToCheckValidationSemantics +from unit_test_api.components.schema.nested_anyof_to_check_validation_semantics import NestedAnyofToCheckValidationSemantics +from unit_test_api.components.schema.nested_items import NestedItems +from unit_test_api.components.schema.nested_oneof_to_check_validation_semantics import NestedOneofToCheckValidationSemantics +from unit_test_api.components.schema._not import _Not +from unit_test_api.components.schema.not_more_complex_schema import NotMoreComplexSchema +from unit_test_api.components.schema.nul_characters_in_strings import NulCharactersInStrings +from unit_test_api.components.schema.null_type_matches_only_the_null_object import NullTypeMatchesOnlyTheNullObject +from unit_test_api.components.schema.number_type_matches_numbers import NumberTypeMatchesNumbers +from unit_test_api.components.schema.object_properties_validation import ObjectPropertiesValidation +from unit_test_api.components.schema.object_type_matches_objects import ObjectTypeMatchesObjects +from unit_test_api.components.schema.oneof import Oneof +from unit_test_api.components.schema.oneof_complex_types import OneofComplexTypes +from unit_test_api.components.schema.oneof_with_base_schema import OneofWithBaseSchema +from unit_test_api.components.schema.oneof_with_empty_schema import OneofWithEmptySchema +from unit_test_api.components.schema.oneof_with_required import OneofWithRequired +from unit_test_api.components.schema.pattern_is_not_anchored import PatternIsNotAnchored +from unit_test_api.components.schema.pattern_validation import PatternValidation +from unit_test_api.components.schema.properties_with_escaped_characters import PropertiesWithEscapedCharacters +from unit_test_api.components.schema.property_named_ref_that_is_not_a_reference import PropertyNamedRefThatIsNotAReference +from unit_test_api.components.schema.ref_in_additionalproperties import RefInAdditionalproperties +from unit_test_api.components.schema.ref_in_allof import RefInAllof +from unit_test_api.components.schema.ref_in_anyof import RefInAnyof +from unit_test_api.components.schema.ref_in_items import RefInItems +from unit_test_api.components.schema.ref_in_not import RefInNot +from unit_test_api.components.schema.ref_in_oneof import RefInOneof +from unit_test_api.components.schema.ref_in_property import RefInProperty +from unit_test_api.components.schema.required_default_validation import RequiredDefaultValidation +from unit_test_api.components.schema.required_validation import RequiredValidation +from unit_test_api.components.schema.required_with_empty_array import RequiredWithEmptyArray +from unit_test_api.components.schema.required_with_escaped_characters import RequiredWithEscapedCharacters +from unit_test_api.components.schema.simple_enum_validation import SimpleEnumValidation +from unit_test_api.components.schema.string_type_matches_strings import StringTypeMatchesStrings +from unit_test_api.components.schema.the_default_keyword_does_not_do_anything_if_the_property_is_missing import TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing +from unit_test_api.components.schema.uniqueitems_false_validation import UniqueitemsFalseValidation +from unit_test_api.components.schema.uniqueitems_validation import UniqueitemsValidation +from unit_test_api.components.schema.uri_format import UriFormat +from unit_test_api.components.schema.uri_reference_format import UriReferenceFormat +from unit_test_api.components.schema.uri_template_format import UriTemplateFormat diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/configuration.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/configuration.py new file mode 100644 index 00000000000..17b28cf44aa --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/configuration.py @@ -0,0 +1,404 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import copy +from http import client as http_client +import logging +import multiprocessing +import sys +import typing + +import urllib3 + +from unit_test_api import exceptions + + +PYTHON_KEYWORD_TO_JSON_SCHEMA_KEYWORD = { + 'types': 'type', + 'enum_value_to_name': 'enum', + 'unique_items': 'uniqueItems', + 'min_items': 'minItems', + 'max_items': 'maxItems', + 'min_properties': 'minProperties', + 'max_properties': 'maxProperties', + 'min_length': 'minLength', + 'max_length': 'maxLength', + 'inclusive_minimum': 'minimum', + 'exclusive_minimum': 'exclusiveMinimum', + 'inclusive_maximum': 'maximum', + 'exclusive_maximum': 'exclusiveMaximum', + 'multiple_of': 'multipleOf', + 'regex': 'pattern', + 'format': 'format', + 'required': 'required', + 'items': 'items', + 'Items': 'items', + 'Properties': 'properties', + 'additional_properties': 'additionalProperties', + 'additionalProperties': 'additionalProperties', + 'OneOf': 'oneOf', + 'AnyOf': 'anyOf', + 'AllOf': 'allOf', + '_not': 'not', + '_Not': 'not', + 'discriminator': 'discriminator' +} + +class Configuration(object): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator + + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + Do not edit the class manually. + + :param host: Base url + :param disabled_json_schema_keywords (set): Set of + JSON schema validation keywords to disable JSON schema structural validation + rules. The following keywords may be specified: multipleOf, maximum, + exclusiveMaximum, minimum, exclusiveMinimum, maxLength, minLength, pattern, + maxItems, minItems. + By default, the validation is performed for data generated locally by the client + and data received from the server, independent of any validation performed by + the server side. If the input data does not satisfy the JSON schema validation + rules specified in the OpenAPI document, an exception is raised. + If disabled_json_schema_keywords is set, structural validation is + disabled. This can be useful to troubleshoot data validation problem, such as + when the OpenAPI document validation rules do not match the actual API data + received by the server. + :param server_index: Index to servers configuration. + :param server_variables: Mapping with string values to replace variables in + templated server configuration. The validation of enums is performed for + variables with defined enum values before. + :param server_operation_index: Mapping from operation ID to an index to server + configuration. + :param server_operation_variables: Mapping from operation ID to a mapping with + string values to replace variables in templated server configuration. + The validation of enums is performed for variables with defined enum values before. + """ + + _default = None + + def __init__( + self, + host: typing.Optional[str] = None, + disabled_json_schema_keywords = frozenset(), + server_index: typing.Optional[int] = None, + server_variables = None, + server_operation_index = None, + server_operation_variables = None, + ): + """Constructor + """ + self._base_path = host or "https://someserver.com/v1" + """Default Base url + """ + self.server_index = 0 if server_index is None and host is None else server_index + self.server_operation_index = server_operation_index or {} + """Default server index + """ + self.server_variables = server_variables or {} + self.server_operation_variables = server_operation_variables or {} + """Default server variables + """ + self.temp_folder_path = None + """Temp file folder for downloading files + """ + # Authentication Settings + self.auth_info = {} + self.disabled_json_schema_keywords = disabled_json_schema_keywords + self.logger = {} + """Logging Settings + """ + self.logger["package_logger"] = logging.getLogger("unit_test_api") + self.logger["urllib3_logger"] = logging.getLogger("urllib3") + self.logger_format = '%(asctime)s %(levelname)s %(message)s' + """Log format + """ + self.logger_stream_handler = None + """Log stream handler + """ + self.logger_file_handler = None + """Log file handler + """ + self.logger_file = None + """Debug file location + """ + self.debug = False + """Debug switch + """ + + self.verify_ssl = True + """SSL/TLS verification + Set this to false to skip verifying SSL certificate when calling API + from https server. + """ + self.ssl_ca_cert = None + """Set this to customize the certificate file to verify the peer. + """ + self.cert_file = None + """client certificate file + """ + self.key_file = None + """client key file + """ + self.assert_hostname = None + """Set this to True/False to enable/disable SSL hostname verification. + """ + + self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 + """urllib3 connection pool's maximum number of connections saved + per pool. urllib3 uses 1 connection as default value, but this is + not the best value when you are making a lot of possibly parallel + requests to the same host, which is often the case here. + cpu_count * 5 is used as default value to increase performance. + """ + + self.proxy = None + """Proxy URL + """ + self.proxy_headers = None + """Proxy headers + """ + self.safe_chars_for_path_param = '' + """Safe chars for path_param + """ + self.retries = None + """Adding retries to override urllib3 default value 3 + """ + # Enable client side validation + self.client_side_validation = True + + # Options to pass down to the underlying urllib3 socket + self.socket_options = None + + def __deepcopy__(self, memo): + cls = self.__class__ + result = cls.__new__(cls) + memo[id(self)] = result + for k, v in self.__dict__.items(): + if k not in ('logger', 'logger_file_handler'): + setattr(result, k, copy.deepcopy(v, memo)) + # shallow copy of loggers + result.logger = copy.copy(self.logger) + # use setters to configure loggers + result.logger_file = self.logger_file + result.debug = self.debug + return result + + @property + def disabled_json_schema_keywords(self) -> typing.Set[str]: + return self.__disabled_json_schema_keywords + + @property + def disabled_json_schema_python_keywords(self) -> typing.Set[str]: + return self.__disabled_json_schema_python_keywords + + @disabled_json_schema_keywords.setter + def disabled_json_schema_keywords(self, json_keywords: typing.Set[str]): + disabled_json_schema_keywords = set() + disabled_json_schema_python_keywords = set() + for k in json_keywords: + python_keywords = {key for key, val in PYTHON_KEYWORD_TO_JSON_SCHEMA_KEYWORD.items() if val == k} + if not python_keywords: + raise exceptions.ApiValueError( + "Invalid keyword: '{0}''".format(k)) + disabled_json_schema_keywords.add(k) + disabled_json_schema_python_keywords.update(python_keywords) + self.__disabled_json_schema_keywords = disabled_json_schema_keywords + self.__disabled_json_schema_python_keywords = disabled_json_schema_python_keywords + + @classmethod + def set_default(cls, default): + """Set default instance of configuration. + + It stores default configuration, which can be + returned by get_default_copy method. + + :param default: object of Configuration + """ + cls._default = copy.deepcopy(default) + + @classmethod + def get_default_copy(cls): + """Return new instance of configuration. + + This method returns newly created, based on default constructor, + object of Configuration class or returns a copy of default + configuration passed by the set_default method. + + :return: The configuration object. + """ + if cls._default is not None: + return copy.deepcopy(cls._default) + return Configuration() + + @property + def logger_file(self): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + return self.__logger_file + + @logger_file.setter + def logger_file(self, value): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + self.__logger_file = value + if self.__logger_file: + # If set logging file, + # then add file handler and remove stream handler. + self.logger_file_handler = logging.FileHandler(self.__logger_file) + self.logger_file_handler.setFormatter(self.logger_formatter) + for _, logger in self.logger.items(): + logger.addHandler(self.logger_file_handler) + + @property + def debug(self): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + return self.__debug + + @debug.setter + def debug(self, value): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + self.__debug = value + if self.__debug: + # if debug status is True, turn on debug logging + for _, logger in self.logger.items(): + logger.setLevel(logging.DEBUG) + # turn on http_client debug + http_client.HTTPConnection.debuglevel = 1 + else: + # if debug status is False, turn off debug logging, + # setting log level to default `logging.WARNING` + for _, logger in self.logger.items(): + logger.setLevel(logging.WARNING) + # turn off http_client debug + http_client.HTTPConnection.debuglevel = 0 + + @property + def logger_format(self): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + return self.__logger_format + + @logger_format.setter + def logger_format(self, value): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + self.__logger_format = value + self.logger_formatter = logging.Formatter(self.__logger_format) + + def to_debug_report(self): + """Gets the essential information for debugging. + + :return: The report for debugging. + """ + return "Python SDK Debug Report:\n"\ + "OS: {env}\n"\ + "Python Version: {pyversion}\n"\ + "Version of the API: 0.0.1\n"\ + "SDK Package Version: 1.0.0".\ + format(env=sys.platform, pyversion=sys.version) + + def get_host_settings(self): + """Gets an array of host settings + + :return: An array of host settings + """ + return [ + { + 'url': "https://someserver.com/v1", + 'description': "No description provided", + } + ] + + def get_host_from_settings( + self, + index: typing.Optional[int], + variables: typing.Optional[typing.Dict[str, dict]] = None, + servers: typing.Optional[typing.List[dict]] = None + ) -> str: + """Gets host URL based on the index and variables + :param index: array index of the host settings + :param variables: hash of variable and the corresponding value + :param servers: an array of host settings or None + :return: URL based on host settings + """ + if index is None: + return self._base_path + + variables = variables or {} + servers = servers or self.get_host_settings() + + try: + server = servers[index] + except IndexError: + raise ValueError( + "Invalid index {0} when selecting the host settings. " + "Must be less than {1}".format(index, len(servers))) + + url = server['url'] + + # go through variables and replace placeholders + for variable_name, variable in server.get('variables', {}).items(): + used_value = variables.get( + variable_name, variable['default_value']) + + if 'enum_values' in variable \ + and used_value not in variable['enum_values']: + raise ValueError( + "The variable `{0}` in the host URL has invalid value " + "{1}. Must be {2}.".format( + variable_name, variables[variable_name], + variable['enum_values'])) + + url = url.replace("{" + variable_name + "}", used_value) + + return url + + @property + def host(self) -> str: + """Return generated host.""" + return self.get_host_from_settings(self.server_index, variables=self.server_variables) + + @host.setter + def host(self, value): + """Fix base path.""" + self._base_path = value + self.server_index = None diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/test/test_models/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/configurations/__init__.py similarity index 100% rename from samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/test/test_models/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/configurations/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/configurations/api_configuration.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/configurations/api_configuration.py new file mode 100644 index 00000000000..b58bd30e7b0 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/configurations/api_configuration.py @@ -0,0 +1,266 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import copy +from http import client as http_client +import logging +import multiprocessing +import sys +import typing +import typing_extensions + +import urllib3 + +from unit_test_api import exceptions +from unit_test_api.servers import server_0 + +# the server to use at each openapi document json path +ServerInfo = typing_extensions.TypedDict( + 'ServerInfo', + { + 'servers/0': server_0.Server0, + }, + total=False +) + +""" +the default server_index to use at each openapi document json path +the fallback value is stored in the 'servers' key +""" +ServerIndexInfo = typing_extensions.TypedDict( + 'ServerIndexInfo', + { + 'servers': typing_extensions.Literal[0], + }, + total=False +) + + +class ApiConfiguration(object): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator + + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + Do not edit the class manually. + + :param server_info: the servers that can be used to make endpoint calls + :param server_index_info: index to servers configuration + """ + + def __init__( + self, + server_info: typing.Optional[ServerInfo] = None, + server_index_info: typing.Optional[ServerIndexInfo] = None, + ): + """Constructor + """ + # Authentication Settings + self.security_scheme_info: {} + self.security_index_info = {'security': 0} + # Server Info + self.server_info: ServerInfo = server_info or { + 'servers/0': server_0.Server0(), + } + self.server_index_info: ServerIndexInfo = server_index_info or {'servers': 0} + self.logger = {} + """Logging Settings + """ + self.logger["package_logger"] = logging.getLogger("unit_test_api") + self.logger["urllib3_logger"] = logging.getLogger("urllib3") + self.logger_format = '%(asctime)s %(levelname)s %(message)s' + """Log format + """ + self.logger_stream_handler = None + """Log stream handler + """ + self.logger_file_handler = None + """Log file handler + """ + self.logger_file = None + """Debug file location + """ + self.debug = False + """Debug switch + """ + + self.verify_ssl = True + """SSL/TLS verification + Set this to false to skip verifying SSL certificate when calling API + from https server. + """ + self.ssl_ca_cert = None + """Set this to customize the certificate file to verify the peer. + """ + self.cert_file = None + """client certificate file + """ + self.key_file = None + """client key file + """ + self.assert_hostname = None + """Set this to True/False to enable/disable SSL hostname verification. + """ + + self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 + """urllib3 connection pool's maximum number of connections saved + per pool. urllib3 uses 1 connection as default value, but this is + not the best value when you are making a lot of possibly parallel + requests to the same host, which is often the case here. + cpu_count * 5 is used as default value to increase performance. + """ + + self.proxy = None + """Proxy URL + """ + self.proxy_headers = None + """Proxy headers + """ + self.safe_chars_for_path_param = '' + """Safe chars for path_param + """ + self.retries = None + """Adding retries to override urllib3 default value 3 + """ + # Enable client side validation + self.client_side_validation = True + + # Options to pass down to the underlying urllib3 socket + self.socket_options = None + + def __deepcopy__(self, memo): + cls = self.__class__ + result = cls.__new__(cls) + memo[id(self)] = result + for k, v in self.__dict__.items(): + if k not in ('logger', 'logger_file_handler'): + setattr(result, k, copy.deepcopy(v, memo)) + # shallow copy of loggers + result.logger = copy.copy(self.logger) + # use setters to configure loggers + result.logger_file = self.logger_file + result.debug = self.debug + return result + + @property + def logger_file(self): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + return self.__logger_file + + @logger_file.setter + def logger_file(self, value): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + self.__logger_file = value + if self.__logger_file: + # If set logging file, + # then add file handler and remove stream handler. + self.logger_file_handler = logging.FileHandler(self.__logger_file) + self.logger_file_handler.setFormatter(self.logger_formatter) + for _, logger in self.logger.items(): + logger.addHandler(self.logger_file_handler) + + @property + def debug(self): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + return self.__debug + + @debug.setter + def debug(self, value): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + self.__debug = value + if self.__debug: + # if debug status is True, turn on debug logging + for _, logger in self.logger.items(): + logger.setLevel(logging.DEBUG) + # turn on http_client debug + http_client.HTTPConnection.debuglevel = 1 + else: + # if debug status is False, turn off debug logging, + # setting log level to default `logging.WARNING` + for _, logger in self.logger.items(): + logger.setLevel(logging.WARNING) + # turn off http_client debug + http_client.HTTPConnection.debuglevel = 0 + + @property + def logger_format(self): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + return self.__logger_format + + @logger_format.setter + def logger_format(self, value): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + self.__logger_format = value + self.logger_formatter = logging.Formatter(self.__logger_format) + + def to_debug_report(self): + """Gets the essential information for debugging. + + :return: The report for debugging. + """ + return "Python SDK Debug Report:\n"\ + "OS: {env}\n"\ + "Python Version: {pyversion}\n"\ + "Version of the API: 0.0.1\n"\ + "SDK Package Version: 1.0.0".\ + format(env=sys.platform, pyversion=sys.version) + + def get_server_url( + self, + key_prefix: str, + index: typing.Optional[int], + ) -> str: + """Gets host URL based on the index + :param index: array index of the host settings + :return: URL based on host settings + """ + if index: + used_index = index + else: + try: + used_index = self.server_index_info[key_prefix] + except KeyError: + # fallback and use the default index + used_index = self.server_index_info["servers"] + server = self.server_info[f"{key_prefix}/{used_index}"] + return server.url diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/configurations/schema_configuration.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/configurations/schema_configuration.py new file mode 100644 index 00000000000..a72ff77fd04 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/configurations/schema_configuration.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing + +from unit_test_api import exceptions + + +PYTHON_KEYWORD_TO_JSON_SCHEMA_KEYWORD = { + 'types': 'type', + 'enum_value_to_name': 'enum', + 'unique_items': 'uniqueItems', + 'min_items': 'minItems', + 'max_items': 'maxItems', + 'min_properties': 'minProperties', + 'max_properties': 'maxProperties', + 'min_length': 'minLength', + 'max_length': 'maxLength', + 'inclusive_minimum': 'minimum', + 'exclusive_minimum': 'exclusiveMinimum', + 'inclusive_maximum': 'maximum', + 'exclusive_maximum': 'exclusiveMaximum', + 'multiple_of': 'multipleOf', + 'regex': 'pattern', + 'format': 'format', + 'required': 'required', + 'items': 'items', + 'Items': 'items', + 'Properties': 'properties', + 'additional_properties': 'additionalProperties', + 'additionalProperties': 'additionalProperties', + 'OneOf': 'oneOf', + 'AnyOf': 'anyOf', + 'AllOf': 'allOf', + '_not': 'not', + '_Not': 'not', + 'discriminator': 'discriminator' +} + +class SchemaConfiguration: + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator + + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + Do not edit the class manually. + + :param disabled_json_schema_keywords (set): Set of + JSON schema validation keywords to disable JSON schema structural validation + rules. The following keywords may be specified: multipleOf, maximum, + exclusiveMaximum, minimum, exclusiveMinimum, maxLength, minLength, pattern, + maxItems, minItems. + By default, the validation is performed for data generated locally by the client + and data received from the server, independent of any validation performed by + the server side. If the input data does not satisfy the JSON schema validation + rules specified in the OpenAPI document, an exception is raised. + If disabled_json_schema_keywords is set, structural validation is + disabled. This can be useful to troubleshoot data validation problem, such as + when the OpenAPI document validation rules do not match the actual API data + received by the server. + :param server_index: Index to servers configuration. + """ + + def __init__( + self, + disabled_json_schema_keywords = frozenset(), + ): + """Constructor + """ + self.disabled_json_schema_keywords = disabled_json_schema_keywords + + @property + def disabled_json_schema_keywords(self) -> typing.Set[str]: + return self.__disabled_json_schema_keywords + + @property + def disabled_json_schema_python_keywords(self) -> typing.Set[str]: + return self.__disabled_json_schema_python_keywords + + @disabled_json_schema_keywords.setter + def disabled_json_schema_keywords(self, json_keywords: typing.Set[str]): + disabled_json_schema_keywords = set() + disabled_json_schema_python_keywords = set() + for k in json_keywords: + python_keywords = {key for key, val in PYTHON_KEYWORD_TO_JSON_SCHEMA_KEYWORD.items() if val == k} + if not python_keywords: + raise exceptions.ApiValueError( + "Invalid keyword: '{0}''".format(k)) + disabled_json_schema_keywords.add(k) + disabled_json_schema_python_keywords.update(python_keywords) + self.__disabled_json_schema_keywords = disabled_json_schema_keywords + self.__disabled_json_schema_python_keywords = disabled_json_schema_python_keywords \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/exceptions.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/exceptions.py new file mode 100644 index 00000000000..26c180f3646 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/exceptions.py @@ -0,0 +1,135 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" +import dataclasses +import typing + +from urllib3._collections import HTTPHeaderDict + + +class OpenApiException(Exception): + """The base exception class for all OpenAPIExceptions""" + + +class ApiTypeError(OpenApiException, TypeError): + def __init__(self, msg, path_to_item=None, valid_classes=None, + key_type=None): + """ Raises an exception for TypeErrors + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list): a list of keys an indices to get to the + current_item + None if unset + valid_classes (tuple): the primitive classes that current item + should be an instance of + None if unset + key_type (bool): False if our value is a value in a dict + True if it is a key in a dict + False if our item is an item in a list + None if unset + """ + self.path_to_item = path_to_item + self.valid_classes = valid_classes + self.key_type = key_type + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiTypeError, self).__init__(full_msg) + + +class ApiValueError(OpenApiException, ValueError): + def __init__(self, msg, path_to_item=None): + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list) the path to the exception in the + received_data dict. None if unset + """ + + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiValueError, self).__init__(full_msg) + + +class ApiAttributeError(OpenApiException, AttributeError): + def __init__(self, msg, path_to_item=None): + """ + Raised when an attribute reference or assignment fails. + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiAttributeError, self).__init__(full_msg) + + +class ApiKeyError(OpenApiException, KeyError): + def __init__(self, msg, path_to_item=None): + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiKeyError, self).__init__(full_msg) + + +T = typing.TypeVar("T") + + +@dataclasses.dataclass +class ApiException(OpenApiException, typing.Generic[T]): + status: int + reason: str + api_response: typing.Optional[T] = None + + def __str__(self): + """Custom error messages for exception""" + error_message = "({0})\n"\ + "Reason: {1}\n".format(self.status, self.reason) + if self.api_response: + if self.api_response.response.headers: + error_message += "HTTP response headers: {0}\n".format( + self.api_response.response.headers) + if self.api_response.response.data: + error_message += "HTTP response body: {0}\n".format(self.api_response.response.data) + + return error_message + + +def render_path(path_to_item): + """Returns a string representation of a path""" + result = "" + for pth in path_to_item: + if isinstance(pth, int): + result += "[{0}]".format(pth) + else: + result += "['{0}']".format(pth) + return result diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/__init__.py new file mode 100644 index 00000000000..dbd9606d284 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/__init__.py @@ -0,0 +1,3 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis import path_to_api diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/__init__.py new file mode 100644 index 00000000000..5fced185656 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body import RequestBodyPostAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody + +path = "/requestBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/test/test_models/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_models/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/operation.py new file mode 100644 index 00000000000..a1ad37f3c23 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/operation.py @@ -0,0 +1,361 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_additionalproperties_allows_a_schema_which_should_validate_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_additionalproperties_allows_a_schema_which_should_validate_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_additionalproperties_allows_a_schema_which_should_validate_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_additionalproperties_allows_a_schema_which_should_validate_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_additionalproperties_allows_a_schema_which_should_validate_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_additionalproperties_allows_a_schema_which_should_validate_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_additionalproperties_allows_a_schema_which_should_validate_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_additionalproperties_allows_a_schema_which_should_validate_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_additionalproperties_allows_a_schema_which_should_validate_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_additionalproperties_allows_a_schema_which_should_validate_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_additionalproperties_allows_a_schema_which_should_validate_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_additionalproperties_allows_a_schema_which_should_validate_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_inline_composition_/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/request_body/content/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_paths/test_fake_inline_composition_/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/request_body/content/__init__.py diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_parameter_collisions_1_a_b_ab_self_a_b_/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/request_body/content/application_json/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_paths/test_fake_parameter_collisions_1_a_b_ab_self_a_b_/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/request_body/content/application_json/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..1a5dfde9c1d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import additionalproperties_allows_a_schema_which_should_validate +Schema = additionalproperties_allows_a_schema_which_should_validate.AdditionalpropertiesAllowsASchemaWhichShouldValidate diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/__init__.py new file mode 100644 index 00000000000..0a5c5814265 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_additionalproperties_are_allowed_by_default_request_body import RequestBodyPostAdditionalpropertiesAreAllowedByDefaultRequestBody + +path = "/requestBody/postAdditionalpropertiesAreAllowedByDefaultRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/operation.py new file mode 100644 index 00000000000..7b3498ef49f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/operation.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_additionalproperties_are_allowed_by_default_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_additionalproperties_are_allowed_by_default_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_additionalproperties_are_allowed_by_default_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_additionalproperties_are_allowed_by_default_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_additionalproperties_are_allowed_by_default_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostAdditionalpropertiesAreAllowedByDefaultRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_additionalproperties_are_allowed_by_default_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_additionalproperties_are_allowed_by_default_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_additionalproperties_are_allowed_by_default_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_additionalproperties_are_allowed_by_default_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_additionalproperties_are_allowed_by_default_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_additionalproperties_are_allowed_by_default_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_additionalproperties_are_allowed_by_default_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..960ff78d8cd --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import additionalproperties_are_allowed_by_default +Schema = additionalproperties_are_allowed_by_default.AdditionalpropertiesAreAllowedByDefault diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/__init__.py new file mode 100644 index 00000000000..664657ac531 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_additionalproperties_can_exist_by_itself_request_body import RequestBodyPostAdditionalpropertiesCanExistByItselfRequestBody + +path = "/requestBody/postAdditionalpropertiesCanExistByItselfRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/operation.py new file mode 100644 index 00000000000..41af62ef656 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/operation.py @@ -0,0 +1,361 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_additionalproperties_can_exist_by_itself_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_additionalproperties_can_exist_by_itself_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_additionalproperties_can_exist_by_itself_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_additionalproperties_can_exist_by_itself_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_additionalproperties_can_exist_by_itself_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostAdditionalpropertiesCanExistByItselfRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_additionalproperties_can_exist_by_itself_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_additionalproperties_can_exist_by_itself_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_additionalproperties_can_exist_by_itself_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_additionalproperties_can_exist_by_itself_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_additionalproperties_can_exist_by_itself_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_additionalproperties_can_exist_by_itself_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_additionalproperties_can_exist_by_itself_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..4ff96c91373 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import additionalproperties_can_exist_by_itself +Schema = additionalproperties_can_exist_by_itself.AdditionalpropertiesCanExistByItself diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/__init__.py new file mode 100644 index 00000000000..4d51bcfad3c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_additionalproperties_should_not_look_in_applicators_request_body import RequestBodyPostAdditionalpropertiesShouldNotLookInApplicatorsRequestBody + +path = "/requestBody/postAdditionalpropertiesShouldNotLookInApplicatorsRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/operation.py new file mode 100644 index 00000000000..6e1714ecea4 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/operation.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_additionalproperties_should_not_look_in_applicators_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_additionalproperties_should_not_look_in_applicators_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_additionalproperties_should_not_look_in_applicators_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_additionalproperties_should_not_look_in_applicators_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_additionalproperties_should_not_look_in_applicators_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostAdditionalpropertiesShouldNotLookInApplicatorsRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_additionalproperties_should_not_look_in_applicators_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_additionalproperties_should_not_look_in_applicators_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_additionalproperties_should_not_look_in_applicators_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_additionalproperties_should_not_look_in_applicators_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_additionalproperties_should_not_look_in_applicators_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_additionalproperties_should_not_look_in_applicators_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_additionalproperties_should_not_look_in_applicators_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..52cc79839f3 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import additionalproperties_should_not_look_in_applicators +Schema = additionalproperties_should_not_look_in_applicators.AdditionalpropertiesShouldNotLookInApplicators diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/__init__.py new file mode 100644 index 00000000000..f8bdc80ef28 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_allof_combined_with_anyof_oneof_request_body import RequestBodyPostAllofCombinedWithAnyofOneofRequestBody + +path = "/requestBody/postAllofCombinedWithAnyofOneofRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/operation.py new file mode 100644 index 00000000000..2515537da60 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/operation.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_allof_combined_with_anyof_oneof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_allof_combined_with_anyof_oneof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_allof_combined_with_anyof_oneof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_allof_combined_with_anyof_oneof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_allof_combined_with_anyof_oneof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostAllofCombinedWithAnyofOneofRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_allof_combined_with_anyof_oneof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_allof_combined_with_anyof_oneof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_allof_combined_with_anyof_oneof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_allof_combined_with_anyof_oneof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_allof_combined_with_anyof_oneof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_allof_combined_with_anyof_oneof_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_allof_combined_with_anyof_oneof_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..42ed68365fd --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import allof_combined_with_anyof_oneof +Schema = allof_combined_with_anyof_oneof.AllofCombinedWithAnyofOneof diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_request_body/__init__.py new file mode 100644 index 00000000000..edb1154f1bd --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_allof_request_body import RequestBodyPostAllofRequestBody + +path = "/requestBody/postAllofRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_request_body/post/operation.py new file mode 100644 index 00000000000..070cfaaa86e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_request_body/post/operation.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_allof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_allof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_allof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_allof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_allof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostAllofRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_allof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_allof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_allof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_allof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_allof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_allof_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_allof_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..6b359fe3a62 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import allof +Schema = allof.Allof diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_simple_types_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_simple_types_request_body/__init__.py new file mode 100644 index 00000000000..7476a0204b4 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_simple_types_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_allof_simple_types_request_body import RequestBodyPostAllofSimpleTypesRequestBody + +path = "/requestBody/postAllofSimpleTypesRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/operation.py new file mode 100644 index 00000000000..cf8edd3128b --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/operation.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_allof_simple_types_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_allof_simple_types_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_allof_simple_types_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_allof_simple_types_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_allof_simple_types_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostAllofSimpleTypesRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_allof_simple_types_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_allof_simple_types_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_allof_simple_types_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_allof_simple_types_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_allof_simple_types_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_allof_simple_types_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_allof_simple_types_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..ed6b07a54b3 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import allof_simple_types +Schema = allof_simple_types.AllofSimpleTypes diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/__init__.py new file mode 100644 index 00000000000..2c8c4f73b60 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_allof_with_base_schema_request_body import RequestBodyPostAllofWithBaseSchemaRequestBody + +path = "/requestBody/postAllofWithBaseSchemaRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/operation.py new file mode 100644 index 00000000000..3592c38124b --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/operation.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_allof_with_base_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_allof_with_base_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_allof_with_base_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_allof_with_base_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_allof_with_base_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostAllofWithBaseSchemaRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_allof_with_base_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_allof_with_base_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_allof_with_base_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_allof_with_base_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_allof_with_base_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_allof_with_base_schema_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_allof_with_base_schema_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..d46134cd001 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import allof_with_base_schema +Schema = allof_with_base_schema.AllofWithBaseSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/__init__.py new file mode 100644 index 00000000000..c5637a25225 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_allof_with_one_empty_schema_request_body import RequestBodyPostAllofWithOneEmptySchemaRequestBody + +path = "/requestBody/postAllofWithOneEmptySchemaRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/operation.py new file mode 100644 index 00000000000..73a733af888 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/operation.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_allof_with_one_empty_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_allof_with_one_empty_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_allof_with_one_empty_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_allof_with_one_empty_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_allof_with_one_empty_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostAllofWithOneEmptySchemaRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_allof_with_one_empty_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_allof_with_one_empty_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_allof_with_one_empty_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_allof_with_one_empty_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_allof_with_one_empty_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_allof_with_one_empty_schema_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_allof_with_one_empty_schema_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..a1850c58e56 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import allof_with_one_empty_schema +Schema = allof_with_one_empty_schema.AllofWithOneEmptySchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/__init__.py new file mode 100644 index 00000000000..dd2829de942 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_allof_with_the_first_empty_schema_request_body import RequestBodyPostAllofWithTheFirstEmptySchemaRequestBody + +path = "/requestBody/postAllofWithTheFirstEmptySchemaRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/operation.py new file mode 100644 index 00000000000..2df35175a9f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/operation.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_allof_with_the_first_empty_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_allof_with_the_first_empty_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_allof_with_the_first_empty_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_allof_with_the_first_empty_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_allof_with_the_first_empty_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostAllofWithTheFirstEmptySchemaRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_allof_with_the_first_empty_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_allof_with_the_first_empty_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_allof_with_the_first_empty_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_allof_with_the_first_empty_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_allof_with_the_first_empty_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_allof_with_the_first_empty_schema_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_allof_with_the_first_empty_schema_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..7935b99eb74 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import allof_with_the_first_empty_schema +Schema = allof_with_the_first_empty_schema.AllofWithTheFirstEmptySchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/__init__.py new file mode 100644 index 00000000000..f46ff81851b --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_allof_with_the_last_empty_schema_request_body import RequestBodyPostAllofWithTheLastEmptySchemaRequestBody + +path = "/requestBody/postAllofWithTheLastEmptySchemaRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/operation.py new file mode 100644 index 00000000000..0ec813fec8a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/operation.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_allof_with_the_last_empty_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_allof_with_the_last_empty_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_allof_with_the_last_empty_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_allof_with_the_last_empty_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_allof_with_the_last_empty_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostAllofWithTheLastEmptySchemaRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_allof_with_the_last_empty_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_allof_with_the_last_empty_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_allof_with_the_last_empty_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_allof_with_the_last_empty_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_allof_with_the_last_empty_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_allof_with_the_last_empty_schema_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_allof_with_the_last_empty_schema_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..219c3c540dd --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import allof_with_the_last_empty_schema +Schema = allof_with_the_last_empty_schema.AllofWithTheLastEmptySchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/__init__.py new file mode 100644 index 00000000000..df72c42fad5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_allof_with_two_empty_schemas_request_body import RequestBodyPostAllofWithTwoEmptySchemasRequestBody + +path = "/requestBody/postAllofWithTwoEmptySchemasRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/operation.py new file mode 100644 index 00000000000..502077a70dd --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/operation.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_allof_with_two_empty_schemas_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_allof_with_two_empty_schemas_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_allof_with_two_empty_schemas_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_allof_with_two_empty_schemas_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_allof_with_two_empty_schemas_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostAllofWithTwoEmptySchemasRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_allof_with_two_empty_schemas_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_allof_with_two_empty_schemas_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_allof_with_two_empty_schemas_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_allof_with_two_empty_schemas_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_allof_with_two_empty_schemas_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_allof_with_two_empty_schemas_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_allof_with_two_empty_schemas_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..004ab7a1e5d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import allof_with_two_empty_schemas +Schema = allof_with_two_empty_schemas.AllofWithTwoEmptySchemas diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/__init__.py new file mode 100644 index 00000000000..431a5af682e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_anyof_complex_types_request_body import RequestBodyPostAnyofComplexTypesRequestBody + +path = "/requestBody/postAnyofComplexTypesRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/operation.py new file mode 100644 index 00000000000..78aa5b1c78e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/operation.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_anyof_complex_types_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_anyof_complex_types_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_anyof_complex_types_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_anyof_complex_types_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_anyof_complex_types_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostAnyofComplexTypesRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_anyof_complex_types_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_anyof_complex_types_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_anyof_complex_types_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_anyof_complex_types_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_anyof_complex_types_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_anyof_complex_types_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_anyof_complex_types_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..bdff269c760 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import anyof_complex_types +Schema = anyof_complex_types.AnyofComplexTypes diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_request_body/__init__.py new file mode 100644 index 00000000000..4be5a0acb5a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_anyof_request_body import RequestBodyPostAnyofRequestBody + +path = "/requestBody/postAnyofRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_request_body/post/operation.py new file mode 100644 index 00000000000..a6f51d4b3fc --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_request_body/post/operation.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_anyof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_anyof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_anyof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_anyof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_anyof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostAnyofRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_anyof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_anyof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_anyof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_anyof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_anyof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_anyof_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_anyof_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..04efc2e486a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import anyof +Schema = anyof.Anyof diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/__init__.py new file mode 100644 index 00000000000..527c93d70d4 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_anyof_with_base_schema_request_body import RequestBodyPostAnyofWithBaseSchemaRequestBody + +path = "/requestBody/postAnyofWithBaseSchemaRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/operation.py new file mode 100644 index 00000000000..23096e50d27 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/operation.py @@ -0,0 +1,346 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_anyof_with_base_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_anyof_with_base_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_anyof_with_base_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_anyof_with_base_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_anyof_with_base_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostAnyofWithBaseSchemaRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_anyof_with_base_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_anyof_with_base_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_anyof_with_base_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_anyof_with_base_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_anyof_with_base_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_anyof_with_base_schema_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_anyof_with_base_schema_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..7c4631249bb --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import anyof_with_base_schema +Schema = anyof_with_base_schema.AnyofWithBaseSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/__init__.py new file mode 100644 index 00000000000..7f39f937555 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_anyof_with_one_empty_schema_request_body import RequestBodyPostAnyofWithOneEmptySchemaRequestBody + +path = "/requestBody/postAnyofWithOneEmptySchemaRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/operation.py new file mode 100644 index 00000000000..39773b0621b --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/operation.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_anyof_with_one_empty_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_anyof_with_one_empty_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_anyof_with_one_empty_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_anyof_with_one_empty_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_anyof_with_one_empty_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostAnyofWithOneEmptySchemaRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_anyof_with_one_empty_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_anyof_with_one_empty_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_anyof_with_one_empty_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_anyof_with_one_empty_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_anyof_with_one_empty_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_anyof_with_one_empty_schema_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_anyof_with_one_empty_schema_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..96f36f92f2d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import anyof_with_one_empty_schema +Schema = anyof_with_one_empty_schema.AnyofWithOneEmptySchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/__init__.py new file mode 100644 index 00000000000..90d80a0d113 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_array_type_matches_arrays_request_body import RequestBodyPostArrayTypeMatchesArraysRequestBody + +path = "/requestBody/postArrayTypeMatchesArraysRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/operation.py new file mode 100644 index 00000000000..6ca0ecb02c2 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/operation.py @@ -0,0 +1,361 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_array_type_matches_arrays_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_array_type_matches_arrays_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_array_type_matches_arrays_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_array_type_matches_arrays_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_array_type_matches_arrays_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostArrayTypeMatchesArraysRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_array_type_matches_arrays_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_array_type_matches_arrays_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_array_type_matches_arrays_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_array_type_matches_arrays_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_array_type_matches_arrays_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_array_type_matches_arrays_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_array_type_matches_arrays_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..495271f9fad --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import array_type_matches_arrays +Schema = array_type_matches_arrays.ArrayTypeMatchesArrays diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/__init__.py new file mode 100644 index 00000000000..cf45b92e32d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_boolean_type_matches_booleans_request_body import RequestBodyPostBooleanTypeMatchesBooleansRequestBody + +path = "/requestBody/postBooleanTypeMatchesBooleansRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/operation.py new file mode 100644 index 00000000000..df04b1ec02a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/operation.py @@ -0,0 +1,346 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_boolean_type_matches_booleans_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + bool + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_boolean_type_matches_booleans_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + bool + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_boolean_type_matches_booleans_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + bool + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_boolean_type_matches_booleans_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + bool + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_boolean_type_matches_booleans_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + bool + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostBooleanTypeMatchesBooleansRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_boolean_type_matches_booleans_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + bool + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_boolean_type_matches_booleans_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + bool + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_boolean_type_matches_booleans_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + bool + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_boolean_type_matches_booleans_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + bool + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_boolean_type_matches_booleans_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + bool + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_boolean_type_matches_booleans_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + bool + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + bool + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + bool + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + bool + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + bool + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_boolean_type_matches_booleans_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..a40135390d5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import boolean_type_matches_booleans +Schema = boolean_type_matches_booleans.BooleanTypeMatchesBooleans diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_int_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_int_request_body/__init__.py new file mode 100644 index 00000000000..17e2fc7c876 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_int_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_by_int_request_body import RequestBodyPostByIntRequestBody + +path = "/requestBody/postByIntRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_int_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_int_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_int_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_int_request_body/post/operation.py new file mode 100644 index 00000000000..9070683225c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_int_request_body/post/operation.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_by_int_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_by_int_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_by_int_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_by_int_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_by_int_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostByIntRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_by_int_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_by_int_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_by_int_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_by_int_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_by_int_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_by_int_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_by_int_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_int_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_int_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_int_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_int_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_int_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_int_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_int_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_int_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_int_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..864afee2e01 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_int_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import by_int +Schema = by_int.ByInt diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_int_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_int_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_int_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_int_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_int_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_number_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_number_request_body/__init__.py new file mode 100644 index 00000000000..b38b2cfb185 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_number_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_by_number_request_body import RequestBodyPostByNumberRequestBody + +path = "/requestBody/postByNumberRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_number_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_number_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_number_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_number_request_body/post/operation.py new file mode 100644 index 00000000000..8eaa14d23d2 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_number_request_body/post/operation.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_by_number_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_by_number_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_by_number_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_by_number_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_by_number_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostByNumberRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_by_number_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_by_number_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_by_number_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_by_number_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_by_number_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_by_number_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_by_number_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_number_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_number_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_number_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_number_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_number_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_number_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_number_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_number_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_number_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..920713c206f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_number_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import by_number +Schema = by_number.ByNumber diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_number_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_number_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_number_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_number_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_number_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_small_number_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_small_number_request_body/__init__.py new file mode 100644 index 00000000000..65ee7f90bd1 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_small_number_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_by_small_number_request_body import RequestBodyPostBySmallNumberRequestBody + +path = "/requestBody/postBySmallNumberRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_small_number_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_small_number_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_small_number_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_small_number_request_body/post/operation.py new file mode 100644 index 00000000000..ce829fc3c26 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_small_number_request_body/post/operation.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_by_small_number_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_by_small_number_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_by_small_number_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_by_small_number_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_by_small_number_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostBySmallNumberRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_by_small_number_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_by_small_number_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_by_small_number_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_by_small_number_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_by_small_number_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_by_small_number_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_by_small_number_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_small_number_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_small_number_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_small_number_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_small_number_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_small_number_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_small_number_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_small_number_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_small_number_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_small_number_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..c6596e536c5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_small_number_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import by_small_number +Schema = by_small_number.BySmallNumber diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_small_number_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_small_number_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_small_number_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_small_number_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_small_number_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_date_time_format_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_date_time_format_request_body/__init__.py new file mode 100644 index 00000000000..8fe4c6d44aa --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_date_time_format_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_date_time_format_request_body import RequestBodyPostDateTimeFormatRequestBody + +path = "/requestBody/postDateTimeFormatRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_date_time_format_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_date_time_format_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_date_time_format_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_date_time_format_request_body/post/operation.py new file mode 100644 index 00000000000..a379a42ffd4 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_date_time_format_request_body/post/operation.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_date_time_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_date_time_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_date_time_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_date_time_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_date_time_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostDateTimeFormatRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_date_time_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_date_time_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_date_time_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_date_time_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_date_time_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_date_time_format_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_date_time_format_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_date_time_format_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_date_time_format_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_date_time_format_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_date_time_format_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_date_time_format_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_date_time_format_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_date_time_format_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_date_time_format_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_date_time_format_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..3a33095d428 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_date_time_format_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import date_time_format +Schema = date_time_format.DateTimeFormat diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_date_time_format_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_date_time_format_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_date_time_format_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_date_time_format_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_date_time_format_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_email_format_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_email_format_request_body/__init__.py new file mode 100644 index 00000000000..1be88be49c2 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_email_format_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_email_format_request_body import RequestBodyPostEmailFormatRequestBody + +path = "/requestBody/postEmailFormatRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_email_format_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_email_format_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_email_format_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_email_format_request_body/post/operation.py new file mode 100644 index 00000000000..66ce9899b4e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_email_format_request_body/post/operation.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_email_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_email_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_email_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_email_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_email_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostEmailFormatRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_email_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_email_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_email_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_email_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_email_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_email_format_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_email_format_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_email_format_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_email_format_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_email_format_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_email_format_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_email_format_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_email_format_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_email_format_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_email_format_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_email_format_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..a285dc8db54 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_email_format_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import email_format +Schema = email_format.EmailFormat diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_email_format_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_email_format_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_email_format_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_email_format_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_email_format_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/__init__.py new file mode 100644 index 00000000000..d0d43d69c0a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_enum_with0_does_not_match_false_request_body import RequestBodyPostEnumWith0DoesNotMatchFalseRequestBody + +path = "/requestBody/postEnumWith0DoesNotMatchFalseRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/operation.py new file mode 100644 index 00000000000..1546a5d8eb4 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/operation.py @@ -0,0 +1,376 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_enum_with0_does_not_match_false_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int, + float + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_enum_with0_does_not_match_false_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int, + float + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_enum_with0_does_not_match_false_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int, + float + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_enum_with0_does_not_match_false_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int, + float + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_enum_with0_does_not_match_false_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int, + float + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostEnumWith0DoesNotMatchFalseRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_enum_with0_does_not_match_false_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int, + float + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_enum_with0_does_not_match_false_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int, + float + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_enum_with0_does_not_match_false_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int, + float + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_enum_with0_does_not_match_false_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int, + float + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_enum_with0_does_not_match_false_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int, + float + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_enum_with0_does_not_match_false_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int, + float + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int, + float + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int, + float + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int, + float + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int, + float + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_enum_with0_does_not_match_false_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..7e74b2edaa4 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import enum_with0_does_not_match_false +Schema = enum_with0_does_not_match_false.EnumWith0DoesNotMatchFalse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/__init__.py new file mode 100644 index 00000000000..aa039a2bf3d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_enum_with1_does_not_match_true_request_body import RequestBodyPostEnumWith1DoesNotMatchTrueRequestBody + +path = "/requestBody/postEnumWith1DoesNotMatchTrueRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/operation.py new file mode 100644 index 00000000000..c7c02bfa237 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/operation.py @@ -0,0 +1,376 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_enum_with1_does_not_match_true_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int, + float + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_enum_with1_does_not_match_true_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int, + float + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_enum_with1_does_not_match_true_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int, + float + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_enum_with1_does_not_match_true_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int, + float + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_enum_with1_does_not_match_true_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int, + float + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostEnumWith1DoesNotMatchTrueRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_enum_with1_does_not_match_true_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int, + float + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_enum_with1_does_not_match_true_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int, + float + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_enum_with1_does_not_match_true_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int, + float + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_enum_with1_does_not_match_true_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int, + float + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_enum_with1_does_not_match_true_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int, + float + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_enum_with1_does_not_match_true_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int, + float + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int, + float + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int, + float + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int, + float + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int, + float + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_enum_with1_does_not_match_true_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..ae8c5ce69cf --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import enum_with1_does_not_match_true +Schema = enum_with1_does_not_match_true.EnumWith1DoesNotMatchTrue diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/__init__.py new file mode 100644 index 00000000000..5a411102446 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_enum_with_escaped_characters_request_body import RequestBodyPostEnumWithEscapedCharactersRequestBody + +path = "/requestBody/postEnumWithEscapedCharactersRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/operation.py new file mode 100644 index 00000000000..68835778d49 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/operation.py @@ -0,0 +1,346 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_enum_with_escaped_characters_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_enum_with_escaped_characters_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_enum_with_escaped_characters_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_enum_with_escaped_characters_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_enum_with_escaped_characters_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostEnumWithEscapedCharactersRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_enum_with_escaped_characters_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_enum_with_escaped_characters_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_enum_with_escaped_characters_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_enum_with_escaped_characters_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_enum_with_escaped_characters_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_enum_with_escaped_characters_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_enum_with_escaped_characters_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..fd2b9f67cb5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import enum_with_escaped_characters +Schema = enum_with_escaped_characters.EnumWithEscapedCharacters diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/__init__.py new file mode 100644 index 00000000000..5d29f33de61 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_enum_with_false_does_not_match0_request_body import RequestBodyPostEnumWithFalseDoesNotMatch0RequestBody + +path = "/requestBody/postEnumWithFalseDoesNotMatch0RequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/operation.py new file mode 100644 index 00000000000..8280e2c522e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/operation.py @@ -0,0 +1,346 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_enum_with_false_does_not_match0_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + bool + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_enum_with_false_does_not_match0_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + bool + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_enum_with_false_does_not_match0_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + bool + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_enum_with_false_does_not_match0_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + bool + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_enum_with_false_does_not_match0_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + bool + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostEnumWithFalseDoesNotMatch0RequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_enum_with_false_does_not_match0_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + bool + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_enum_with_false_does_not_match0_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + bool + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_enum_with_false_does_not_match0_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + bool + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_enum_with_false_does_not_match0_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + bool + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_enum_with_false_does_not_match0_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + bool + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_enum_with_false_does_not_match0_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + bool + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + bool + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + bool + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + bool + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + bool + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_enum_with_false_does_not_match0_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..7ca0330788b --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import enum_with_false_does_not_match0 +Schema = enum_with_false_does_not_match0.EnumWithFalseDoesNotMatch0 diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/__init__.py new file mode 100644 index 00000000000..511fddaf7f6 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_enum_with_true_does_not_match1_request_body import RequestBodyPostEnumWithTrueDoesNotMatch1RequestBody + +path = "/requestBody/postEnumWithTrueDoesNotMatch1RequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/operation.py new file mode 100644 index 00000000000..c348a106787 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/operation.py @@ -0,0 +1,346 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_enum_with_true_does_not_match1_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + bool + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_enum_with_true_does_not_match1_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + bool + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_enum_with_true_does_not_match1_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + bool + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_enum_with_true_does_not_match1_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + bool + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_enum_with_true_does_not_match1_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + bool + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostEnumWithTrueDoesNotMatch1RequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_enum_with_true_does_not_match1_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + bool + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_enum_with_true_does_not_match1_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + bool + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_enum_with_true_does_not_match1_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + bool + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_enum_with_true_does_not_match1_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + bool + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_enum_with_true_does_not_match1_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + bool + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_enum_with_true_does_not_match1_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + bool + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + bool + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + bool + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + bool + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + bool + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_enum_with_true_does_not_match1_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..c7dd82c61a9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import enum_with_true_does_not_match1 +Schema = enum_with_true_does_not_match1.EnumWithTrueDoesNotMatch1 diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enums_in_properties_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enums_in_properties_request_body/__init__.py new file mode 100644 index 00000000000..cd84f0de300 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enums_in_properties_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_enums_in_properties_request_body import RequestBodyPostEnumsInPropertiesRequestBody + +path = "/requestBody/postEnumsInPropertiesRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/operation.py new file mode 100644 index 00000000000..85f83c67187 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/operation.py @@ -0,0 +1,361 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_enums_in_properties_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_enums_in_properties_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_enums_in_properties_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_enums_in_properties_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_enums_in_properties_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostEnumsInPropertiesRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_enums_in_properties_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_enums_in_properties_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_enums_in_properties_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_enums_in_properties_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_enums_in_properties_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_enums_in_properties_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_enums_in_properties_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..4bd20ae9d6e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import enums_in_properties +Schema = enums_in_properties.EnumsInProperties diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_forbidden_property_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_forbidden_property_request_body/__init__.py new file mode 100644 index 00000000000..46b1e524780 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_forbidden_property_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_forbidden_property_request_body import RequestBodyPostForbiddenPropertyRequestBody + +path = "/requestBody/postForbiddenPropertyRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/operation.py new file mode 100644 index 00000000000..6eb4b165c6c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/operation.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_forbidden_property_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_forbidden_property_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_forbidden_property_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_forbidden_property_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_forbidden_property_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostForbiddenPropertyRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_forbidden_property_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_forbidden_property_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_forbidden_property_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_forbidden_property_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_forbidden_property_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_forbidden_property_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_forbidden_property_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..ef431e13d33 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import forbidden_property +Schema = forbidden_property.ForbiddenProperty diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_hostname_format_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_hostname_format_request_body/__init__.py new file mode 100644 index 00000000000..92c788bb56b --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_hostname_format_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_hostname_format_request_body import RequestBodyPostHostnameFormatRequestBody + +path = "/requestBody/postHostnameFormatRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_hostname_format_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_hostname_format_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_hostname_format_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_hostname_format_request_body/post/operation.py new file mode 100644 index 00000000000..e5c141607f9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_hostname_format_request_body/post/operation.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_hostname_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_hostname_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_hostname_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_hostname_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_hostname_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostHostnameFormatRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_hostname_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_hostname_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_hostname_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_hostname_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_hostname_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_hostname_format_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_hostname_format_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_hostname_format_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_hostname_format_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_hostname_format_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_hostname_format_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_hostname_format_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_hostname_format_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_hostname_format_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_hostname_format_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_hostname_format_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..b39f679cc7a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_hostname_format_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import hostname_format +Schema = hostname_format.HostnameFormat diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_hostname_format_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_hostname_format_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_hostname_format_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_hostname_format_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_hostname_format_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/__init__.py new file mode 100644 index 00000000000..e3a2db44861 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_integer_type_matches_integers_request_body import RequestBodyPostIntegerTypeMatchesIntegersRequestBody + +path = "/requestBody/postIntegerTypeMatchesIntegersRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/operation.py new file mode 100644 index 00000000000..4f9f0d0ba76 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/operation.py @@ -0,0 +1,361 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_integer_type_matches_integers_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_integer_type_matches_integers_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_integer_type_matches_integers_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_integer_type_matches_integers_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_integer_type_matches_integers_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostIntegerTypeMatchesIntegersRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_integer_type_matches_integers_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_integer_type_matches_integers_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_integer_type_matches_integers_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_integer_type_matches_integers_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_integer_type_matches_integers_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_integer_type_matches_integers_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_integer_type_matches_integers_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..791e5052ce7 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import integer_type_matches_integers +Schema = integer_type_matches_integers.IntegerTypeMatchesIntegers diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/__init__.py new file mode 100644 index 00000000000..06d428cd374 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body import RequestBodyPostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody + +path = "/requestBody/postInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/operation.py new file mode 100644 index 00000000000..ecde6f2488d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/operation.py @@ -0,0 +1,361 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..f4c7b611e42 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import invalid_instance_should_not_raise_error_when_float_division_inf +Schema = invalid_instance_should_not_raise_error_when_float_division_inf.InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/__init__.py new file mode 100644 index 00000000000..79b03e46465 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_invalid_string_value_for_default_request_body import RequestBodyPostInvalidStringValueForDefaultRequestBody + +path = "/requestBody/postInvalidStringValueForDefaultRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/operation.py new file mode 100644 index 00000000000..d979d8403ed --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/operation.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_invalid_string_value_for_default_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_invalid_string_value_for_default_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_invalid_string_value_for_default_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_invalid_string_value_for_default_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_invalid_string_value_for_default_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostInvalidStringValueForDefaultRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_invalid_string_value_for_default_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_invalid_string_value_for_default_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_invalid_string_value_for_default_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_invalid_string_value_for_default_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_invalid_string_value_for_default_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_invalid_string_value_for_default_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_invalid_string_value_for_default_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..6aac31aa314 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import invalid_string_value_for_default +Schema = invalid_string_value_for_default.InvalidStringValueForDefault diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ipv4_format_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ipv4_format_request_body/__init__.py new file mode 100644 index 00000000000..f54f2fd1cca --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ipv4_format_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_ipv4_format_request_body import RequestBodyPostIpv4FormatRequestBody + +path = "/requestBody/postIpv4FormatRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/operation.py new file mode 100644 index 00000000000..84432e0dab6 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/operation.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_ipv4_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_ipv4_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_ipv4_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_ipv4_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_ipv4_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostIpv4FormatRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_ipv4_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_ipv4_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_ipv4_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_ipv4_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_ipv4_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_ipv4_format_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_ipv4_format_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..ec5e069e43b --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import ipv4_format +Schema = ipv4_format.Ipv4Format diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ipv6_format_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ipv6_format_request_body/__init__.py new file mode 100644 index 00000000000..53d994ddc9b --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ipv6_format_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_ipv6_format_request_body import RequestBodyPostIpv6FormatRequestBody + +path = "/requestBody/postIpv6FormatRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/operation.py new file mode 100644 index 00000000000..fb8147220c0 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/operation.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_ipv6_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_ipv6_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_ipv6_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_ipv6_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_ipv6_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostIpv6FormatRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_ipv6_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_ipv6_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_ipv6_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_ipv6_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_ipv6_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_ipv6_format_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_ipv6_format_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..312cc834880 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import ipv6_format +Schema = ipv6_format.Ipv6Format diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_json_pointer_format_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_json_pointer_format_request_body/__init__.py new file mode 100644 index 00000000000..73b6b517482 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_json_pointer_format_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_json_pointer_format_request_body import RequestBodyPostJsonPointerFormatRequestBody + +path = "/requestBody/postJsonPointerFormatRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/operation.py new file mode 100644 index 00000000000..ebf9b4696eb --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/operation.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_json_pointer_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_json_pointer_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_json_pointer_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_json_pointer_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_json_pointer_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostJsonPointerFormatRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_json_pointer_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_json_pointer_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_json_pointer_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_json_pointer_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_json_pointer_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_json_pointer_format_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_json_pointer_format_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..c19be1f98b8 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import json_pointer_format +Schema = json_pointer_format.JsonPointerFormat diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maximum_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maximum_validation_request_body/__init__.py new file mode 100644 index 00000000000..f97c9d9d599 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maximum_validation_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_maximum_validation_request_body import RequestBodyPostMaximumValidationRequestBody + +path = "/requestBody/postMaximumValidationRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/operation.py new file mode 100644 index 00000000000..685ac2064db --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/operation.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_maximum_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_maximum_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_maximum_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_maximum_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_maximum_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostMaximumValidationRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_maximum_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_maximum_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_maximum_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_maximum_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_maximum_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_maximum_validation_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_maximum_validation_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..d368444b07b --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import maximum_validation +Schema = maximum_validation.MaximumValidation diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/__init__.py new file mode 100644 index 00000000000..03a0008ddf4 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_maximum_validation_with_unsigned_integer_request_body import RequestBodyPostMaximumValidationWithUnsignedIntegerRequestBody + +path = "/requestBody/postMaximumValidationWithUnsignedIntegerRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/operation.py new file mode 100644 index 00000000000..24b08cccf0e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/operation.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_maximum_validation_with_unsigned_integer_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_maximum_validation_with_unsigned_integer_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_maximum_validation_with_unsigned_integer_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_maximum_validation_with_unsigned_integer_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_maximum_validation_with_unsigned_integer_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostMaximumValidationWithUnsignedIntegerRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_maximum_validation_with_unsigned_integer_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_maximum_validation_with_unsigned_integer_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_maximum_validation_with_unsigned_integer_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_maximum_validation_with_unsigned_integer_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_maximum_validation_with_unsigned_integer_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_maximum_validation_with_unsigned_integer_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_maximum_validation_with_unsigned_integer_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..6278da92a32 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import maximum_validation_with_unsigned_integer +Schema = maximum_validation_with_unsigned_integer.MaximumValidationWithUnsignedInteger diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxitems_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxitems_validation_request_body/__init__.py new file mode 100644 index 00000000000..86be2694565 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxitems_validation_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_maxitems_validation_request_body import RequestBodyPostMaxitemsValidationRequestBody + +path = "/requestBody/postMaxitemsValidationRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/operation.py new file mode 100644 index 00000000000..60a88c892f0 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/operation.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_maxitems_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_maxitems_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_maxitems_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_maxitems_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_maxitems_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostMaxitemsValidationRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_maxitems_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_maxitems_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_maxitems_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_maxitems_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_maxitems_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_maxitems_validation_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_maxitems_validation_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..b01ae68bcb2 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import maxitems_validation +Schema = maxitems_validation.MaxitemsValidation diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxlength_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxlength_validation_request_body/__init__.py new file mode 100644 index 00000000000..1dfdf430059 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxlength_validation_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_maxlength_validation_request_body import RequestBodyPostMaxlengthValidationRequestBody + +path = "/requestBody/postMaxlengthValidationRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/operation.py new file mode 100644 index 00000000000..fe62199d5b1 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/operation.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_maxlength_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_maxlength_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_maxlength_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_maxlength_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_maxlength_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostMaxlengthValidationRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_maxlength_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_maxlength_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_maxlength_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_maxlength_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_maxlength_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_maxlength_validation_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_maxlength_validation_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..38757fabfa0 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import maxlength_validation +Schema = maxlength_validation.MaxlengthValidation diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/__init__.py new file mode 100644 index 00000000000..735d0dcc0b5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_maxproperties0_means_the_object_is_empty_request_body import RequestBodyPostMaxproperties0MeansTheObjectIsEmptyRequestBody + +path = "/requestBody/postMaxproperties0MeansTheObjectIsEmptyRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/operation.py new file mode 100644 index 00000000000..f5950b41a10 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/operation.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_maxproperties0_means_the_object_is_empty_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_maxproperties0_means_the_object_is_empty_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_maxproperties0_means_the_object_is_empty_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_maxproperties0_means_the_object_is_empty_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_maxproperties0_means_the_object_is_empty_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostMaxproperties0MeansTheObjectIsEmptyRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_maxproperties0_means_the_object_is_empty_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_maxproperties0_means_the_object_is_empty_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_maxproperties0_means_the_object_is_empty_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_maxproperties0_means_the_object_is_empty_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_maxproperties0_means_the_object_is_empty_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_maxproperties0_means_the_object_is_empty_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_maxproperties0_means_the_object_is_empty_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..76e69d128e2 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import maxproperties0_means_the_object_is_empty +Schema = maxproperties0_means_the_object_is_empty.Maxproperties0MeansTheObjectIsEmpty diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/__init__.py new file mode 100644 index 00000000000..7842c1f8fe7 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_maxproperties_validation_request_body import RequestBodyPostMaxpropertiesValidationRequestBody + +path = "/requestBody/postMaxpropertiesValidationRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/operation.py new file mode 100644 index 00000000000..a0a3b1092a9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/operation.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_maxproperties_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_maxproperties_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_maxproperties_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_maxproperties_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_maxproperties_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostMaxpropertiesValidationRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_maxproperties_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_maxproperties_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_maxproperties_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_maxproperties_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_maxproperties_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_maxproperties_validation_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_maxproperties_validation_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..6dde9788979 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import maxproperties_validation +Schema = maxproperties_validation.MaxpropertiesValidation diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minimum_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minimum_validation_request_body/__init__.py new file mode 100644 index 00000000000..20090bfd744 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minimum_validation_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_minimum_validation_request_body import RequestBodyPostMinimumValidationRequestBody + +path = "/requestBody/postMinimumValidationRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/operation.py new file mode 100644 index 00000000000..f0e6c42fa26 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/operation.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_minimum_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_minimum_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_minimum_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_minimum_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_minimum_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostMinimumValidationRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_minimum_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_minimum_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_minimum_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_minimum_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_minimum_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_minimum_validation_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_minimum_validation_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..231497d6aa2 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import minimum_validation +Schema = minimum_validation.MinimumValidation diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/__init__.py new file mode 100644 index 00000000000..6edc922cdb9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_minimum_validation_with_signed_integer_request_body import RequestBodyPostMinimumValidationWithSignedIntegerRequestBody + +path = "/requestBody/postMinimumValidationWithSignedIntegerRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/operation.py new file mode 100644 index 00000000000..4832fb1ea57 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/operation.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_minimum_validation_with_signed_integer_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_minimum_validation_with_signed_integer_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_minimum_validation_with_signed_integer_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_minimum_validation_with_signed_integer_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_minimum_validation_with_signed_integer_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostMinimumValidationWithSignedIntegerRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_minimum_validation_with_signed_integer_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_minimum_validation_with_signed_integer_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_minimum_validation_with_signed_integer_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_minimum_validation_with_signed_integer_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_minimum_validation_with_signed_integer_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_minimum_validation_with_signed_integer_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_minimum_validation_with_signed_integer_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..aeb455b4573 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import minimum_validation_with_signed_integer +Schema = minimum_validation_with_signed_integer.MinimumValidationWithSignedInteger diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minitems_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minitems_validation_request_body/__init__.py new file mode 100644 index 00000000000..1f370a8699d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minitems_validation_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_minitems_validation_request_body import RequestBodyPostMinitemsValidationRequestBody + +path = "/requestBody/postMinitemsValidationRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/operation.py new file mode 100644 index 00000000000..852213c8123 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/operation.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_minitems_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_minitems_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_minitems_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_minitems_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_minitems_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostMinitemsValidationRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_minitems_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_minitems_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_minitems_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_minitems_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_minitems_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_minitems_validation_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_minitems_validation_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..71bd8f7fe44 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import minitems_validation +Schema = minitems_validation.MinitemsValidation diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minlength_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minlength_validation_request_body/__init__.py new file mode 100644 index 00000000000..8d7bfa08658 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minlength_validation_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_minlength_validation_request_body import RequestBodyPostMinlengthValidationRequestBody + +path = "/requestBody/postMinlengthValidationRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/operation.py new file mode 100644 index 00000000000..c9c4c17c518 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/operation.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_minlength_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_minlength_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_minlength_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_minlength_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_minlength_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostMinlengthValidationRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_minlength_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_minlength_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_minlength_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_minlength_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_minlength_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_minlength_validation_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_minlength_validation_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..23b5ebfc444 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import minlength_validation +Schema = minlength_validation.MinlengthValidation diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minproperties_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minproperties_validation_request_body/__init__.py new file mode 100644 index 00000000000..64b2043825e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minproperties_validation_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_minproperties_validation_request_body import RequestBodyPostMinpropertiesValidationRequestBody + +path = "/requestBody/postMinpropertiesValidationRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/operation.py new file mode 100644 index 00000000000..6c65a5c9d5d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/operation.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_minproperties_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_minproperties_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_minproperties_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_minproperties_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_minproperties_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostMinpropertiesValidationRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_minproperties_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_minproperties_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_minproperties_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_minproperties_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_minproperties_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_minproperties_validation_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_minproperties_validation_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..84dcb6167b8 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import minproperties_validation +Schema = minproperties_validation.MinpropertiesValidation diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/__init__.py new file mode 100644 index 00000000000..0d0b20f3068 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_nested_allof_to_check_validation_semantics_request_body import RequestBodyPostNestedAllofToCheckValidationSemanticsRequestBody + +path = "/requestBody/postNestedAllofToCheckValidationSemanticsRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/operation.py new file mode 100644 index 00000000000..369ea5e2765 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/operation.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_nested_allof_to_check_validation_semantics_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_nested_allof_to_check_validation_semantics_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_nested_allof_to_check_validation_semantics_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_nested_allof_to_check_validation_semantics_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_nested_allof_to_check_validation_semantics_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostNestedAllofToCheckValidationSemanticsRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_nested_allof_to_check_validation_semantics_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_nested_allof_to_check_validation_semantics_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_nested_allof_to_check_validation_semantics_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_nested_allof_to_check_validation_semantics_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_nested_allof_to_check_validation_semantics_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_nested_allof_to_check_validation_semantics_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_nested_allof_to_check_validation_semantics_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..9280d57a779 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import nested_allof_to_check_validation_semantics +Schema = nested_allof_to_check_validation_semantics.NestedAllofToCheckValidationSemantics diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/__init__.py new file mode 100644 index 00000000000..8ee5906003c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_nested_anyof_to_check_validation_semantics_request_body import RequestBodyPostNestedAnyofToCheckValidationSemanticsRequestBody + +path = "/requestBody/postNestedAnyofToCheckValidationSemanticsRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/operation.py new file mode 100644 index 00000000000..839cb68d58b --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/operation.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_nested_anyof_to_check_validation_semantics_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_nested_anyof_to_check_validation_semantics_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_nested_anyof_to_check_validation_semantics_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_nested_anyof_to_check_validation_semantics_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_nested_anyof_to_check_validation_semantics_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostNestedAnyofToCheckValidationSemanticsRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_nested_anyof_to_check_validation_semantics_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_nested_anyof_to_check_validation_semantics_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_nested_anyof_to_check_validation_semantics_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_nested_anyof_to_check_validation_semantics_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_nested_anyof_to_check_validation_semantics_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_nested_anyof_to_check_validation_semantics_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_nested_anyof_to_check_validation_semantics_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..dea6b114075 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import nested_anyof_to_check_validation_semantics +Schema = nested_anyof_to_check_validation_semantics.NestedAnyofToCheckValidationSemantics diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_items_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_items_request_body/__init__.py new file mode 100644 index 00000000000..eac3d4da9d1 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_items_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_nested_items_request_body import RequestBodyPostNestedItemsRequestBody + +path = "/requestBody/postNestedItemsRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_items_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_items_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_items_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_items_request_body/post/operation.py new file mode 100644 index 00000000000..27edd264501 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_items_request_body/post/operation.py @@ -0,0 +1,361 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_nested_items_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_nested_items_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_nested_items_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_nested_items_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_nested_items_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostNestedItemsRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_nested_items_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_nested_items_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_nested_items_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_nested_items_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_nested_items_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_nested_items_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_nested_items_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_items_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_items_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_items_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_items_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_items_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_items_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_items_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_items_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_items_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..b9e3777ee06 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_items_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import nested_items +Schema = nested_items.NestedItems diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_items_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_items_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_items_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_items_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_items_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/__init__.py new file mode 100644 index 00000000000..4d6c1a34d12 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_nested_oneof_to_check_validation_semantics_request_body import RequestBodyPostNestedOneofToCheckValidationSemanticsRequestBody + +path = "/requestBody/postNestedOneofToCheckValidationSemanticsRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/operation.py new file mode 100644 index 00000000000..67f2a4f25c1 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/operation.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_nested_oneof_to_check_validation_semantics_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_nested_oneof_to_check_validation_semantics_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_nested_oneof_to_check_validation_semantics_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_nested_oneof_to_check_validation_semantics_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_nested_oneof_to_check_validation_semantics_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostNestedOneofToCheckValidationSemanticsRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_nested_oneof_to_check_validation_semantics_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_nested_oneof_to_check_validation_semantics_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_nested_oneof_to_check_validation_semantics_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_nested_oneof_to_check_validation_semantics_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_nested_oneof_to_check_validation_semantics_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_nested_oneof_to_check_validation_semantics_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_nested_oneof_to_check_validation_semantics_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..bfefad33c03 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import nested_oneof_to_check_validation_semantics +Schema = nested_oneof_to_check_validation_semantics.NestedOneofToCheckValidationSemantics diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/__init__.py new file mode 100644 index 00000000000..08d861769bc --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_not_more_complex_schema_request_body import RequestBodyPostNotMoreComplexSchemaRequestBody + +path = "/requestBody/postNotMoreComplexSchemaRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/operation.py new file mode 100644 index 00000000000..0616a2560f4 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/operation.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_not_more_complex_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_not_more_complex_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_not_more_complex_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_not_more_complex_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_not_more_complex_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostNotMoreComplexSchemaRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_not_more_complex_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_not_more_complex_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_not_more_complex_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_not_more_complex_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_not_more_complex_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_not_more_complex_schema_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_not_more_complex_schema_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..7701df43d8e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import not_more_complex_schema +Schema = not_more_complex_schema.NotMoreComplexSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_not_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_not_request_body/__init__.py new file mode 100644 index 00000000000..595e76c5c14 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_not_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_not_request_body import RequestBodyPostNotRequestBody + +path = "/requestBody/postNotRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_not_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_not_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_not_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_not_request_body/post/operation.py new file mode 100644 index 00000000000..f51718d4427 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_not_request_body/post/operation.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_not_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_not_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_not_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_not_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_not_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostNotRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_not_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_not_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_not_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_not_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_not_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_not_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_not_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_not_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_not_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_not_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_not_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_not_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_not_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_not_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_not_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_not_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..bebcacf9ebf --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_not_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import _not +Schema = _not._Not diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_not_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_not_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_not_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_not_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_not_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/__init__.py new file mode 100644 index 00000000000..8964e494afb --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_nul_characters_in_strings_request_body import RequestBodyPostNulCharactersInStringsRequestBody + +path = "/requestBody/postNulCharactersInStringsRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/operation.py new file mode 100644 index 00000000000..ffb8b992158 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/operation.py @@ -0,0 +1,346 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_nul_characters_in_strings_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_nul_characters_in_strings_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_nul_characters_in_strings_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_nul_characters_in_strings_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_nul_characters_in_strings_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostNulCharactersInStringsRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_nul_characters_in_strings_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_nul_characters_in_strings_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_nul_characters_in_strings_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_nul_characters_in_strings_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_nul_characters_in_strings_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_nul_characters_in_strings_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_nul_characters_in_strings_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..dfcaba68017 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import nul_characters_in_strings +Schema = nul_characters_in_strings.NulCharactersInStrings diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/__init__.py new file mode 100644 index 00000000000..26849f5a4af --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_null_type_matches_only_the_null_object_request_body import RequestBodyPostNullTypeMatchesOnlyTheNullObjectRequestBody + +path = "/requestBody/postNullTypeMatchesOnlyTheNullObjectRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/operation.py new file mode 100644 index 00000000000..c487cf6a687 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/operation.py @@ -0,0 +1,346 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_null_type_matches_only_the_null_object_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + None + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_null_type_matches_only_the_null_object_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + None + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_null_type_matches_only_the_null_object_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + None + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_null_type_matches_only_the_null_object_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + None + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_null_type_matches_only_the_null_object_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + None + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostNullTypeMatchesOnlyTheNullObjectRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_null_type_matches_only_the_null_object_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + None + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_null_type_matches_only_the_null_object_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + None + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_null_type_matches_only_the_null_object_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + None + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_null_type_matches_only_the_null_object_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + None + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_null_type_matches_only_the_null_object_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + None + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_null_type_matches_only_the_null_object_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + None + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + None + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + None + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + None + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + None + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_null_type_matches_only_the_null_object_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..7b17fd7362b --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import null_type_matches_only_the_null_object +Schema = null_type_matches_only_the_null_object.NullTypeMatchesOnlyTheNullObject diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/__init__.py new file mode 100644 index 00000000000..29582654ae6 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_number_type_matches_numbers_request_body import RequestBodyPostNumberTypeMatchesNumbersRequestBody + +path = "/requestBody/postNumberTypeMatchesNumbersRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/operation.py new file mode 100644 index 00000000000..79c68e71f2e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/operation.py @@ -0,0 +1,376 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_number_type_matches_numbers_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int, + float + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_number_type_matches_numbers_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int, + float + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_number_type_matches_numbers_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int, + float + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_number_type_matches_numbers_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int, + float + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_number_type_matches_numbers_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int, + float + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostNumberTypeMatchesNumbersRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_number_type_matches_numbers_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int, + float + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_number_type_matches_numbers_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int, + float + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_number_type_matches_numbers_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int, + float + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_number_type_matches_numbers_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int, + float + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_number_type_matches_numbers_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int, + float + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_number_type_matches_numbers_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int, + float + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int, + float + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int, + float + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int, + float + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int, + float + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_number_type_matches_numbers_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..35f8a34e485 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import number_type_matches_numbers +Schema = number_type_matches_numbers.NumberTypeMatchesNumbers diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_object_properties_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_object_properties_validation_request_body/__init__.py new file mode 100644 index 00000000000..7dc9fa4d95a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_object_properties_validation_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_object_properties_validation_request_body import RequestBodyPostObjectPropertiesValidationRequestBody + +path = "/requestBody/postObjectPropertiesValidationRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/operation.py new file mode 100644 index 00000000000..649e9b8130a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/operation.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_object_properties_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_object_properties_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_object_properties_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_object_properties_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_object_properties_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostObjectPropertiesValidationRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_object_properties_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_object_properties_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_object_properties_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_object_properties_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_object_properties_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_object_properties_validation_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_object_properties_validation_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..9be3984fe2c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import object_properties_validation +Schema = object_properties_validation.ObjectPropertiesValidation diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/__init__.py new file mode 100644 index 00000000000..b73e0ed3972 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_object_type_matches_objects_request_body import RequestBodyPostObjectTypeMatchesObjectsRequestBody + +path = "/requestBody/postObjectTypeMatchesObjectsRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/operation.py new file mode 100644 index 00000000000..d8e2681e4cc --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/operation.py @@ -0,0 +1,361 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_object_type_matches_objects_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_object_type_matches_objects_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_object_type_matches_objects_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_object_type_matches_objects_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_object_type_matches_objects_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostObjectTypeMatchesObjectsRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_object_type_matches_objects_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_object_type_matches_objects_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_object_type_matches_objects_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_object_type_matches_objects_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_object_type_matches_objects_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_object_type_matches_objects_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_object_type_matches_objects_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..9c6e1cbbbdc --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import object_type_matches_objects +Schema = object_type_matches_objects.ObjectTypeMatchesObjects diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/__init__.py new file mode 100644 index 00000000000..e828cc383db --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_oneof_complex_types_request_body import RequestBodyPostOneofComplexTypesRequestBody + +path = "/requestBody/postOneofComplexTypesRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/operation.py new file mode 100644 index 00000000000..0591c316a2a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/operation.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_oneof_complex_types_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_oneof_complex_types_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_oneof_complex_types_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_oneof_complex_types_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_oneof_complex_types_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostOneofComplexTypesRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_oneof_complex_types_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_oneof_complex_types_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_oneof_complex_types_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_oneof_complex_types_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_oneof_complex_types_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_oneof_complex_types_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_oneof_complex_types_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..f1b6fca7ce1 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import oneof_complex_types +Schema = oneof_complex_types.OneofComplexTypes diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_request_body/__init__.py new file mode 100644 index 00000000000..e963a5cc91e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_oneof_request_body import RequestBodyPostOneofRequestBody + +path = "/requestBody/postOneofRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_request_body/post/operation.py new file mode 100644 index 00000000000..db605a756a0 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_request_body/post/operation.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_oneof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_oneof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_oneof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_oneof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_oneof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostOneofRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_oneof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_oneof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_oneof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_oneof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_oneof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_oneof_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_oneof_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..ab0470c6457 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import oneof +Schema = oneof.Oneof diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/__init__.py new file mode 100644 index 00000000000..ba56355bead --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_oneof_with_base_schema_request_body import RequestBodyPostOneofWithBaseSchemaRequestBody + +path = "/requestBody/postOneofWithBaseSchemaRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/operation.py new file mode 100644 index 00000000000..3b4aa22a4b4 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/operation.py @@ -0,0 +1,346 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_oneof_with_base_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_oneof_with_base_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_oneof_with_base_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_oneof_with_base_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_oneof_with_base_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostOneofWithBaseSchemaRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_oneof_with_base_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_oneof_with_base_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_oneof_with_base_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_oneof_with_base_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_oneof_with_base_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_oneof_with_base_schema_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_oneof_with_base_schema_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..442f6aaac3f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import oneof_with_base_schema +Schema = oneof_with_base_schema.OneofWithBaseSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/__init__.py new file mode 100644 index 00000000000..b02dc7fc0f5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_oneof_with_empty_schema_request_body import RequestBodyPostOneofWithEmptySchemaRequestBody + +path = "/requestBody/postOneofWithEmptySchemaRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/operation.py new file mode 100644 index 00000000000..2d5e4d5d2c9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/operation.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_oneof_with_empty_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_oneof_with_empty_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_oneof_with_empty_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_oneof_with_empty_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_oneof_with_empty_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostOneofWithEmptySchemaRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_oneof_with_empty_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_oneof_with_empty_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_oneof_with_empty_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_oneof_with_empty_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_oneof_with_empty_schema_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_oneof_with_empty_schema_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_oneof_with_empty_schema_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..e1ef7c9bfff --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import oneof_with_empty_schema +Schema = oneof_with_empty_schema.OneofWithEmptySchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_required_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_required_request_body/__init__.py new file mode 100644 index 00000000000..362d5c27708 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_required_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_oneof_with_required_request_body import RequestBodyPostOneofWithRequiredRequestBody + +path = "/requestBody/postOneofWithRequiredRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/operation.py new file mode 100644 index 00000000000..a0ebe422d42 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/operation.py @@ -0,0 +1,361 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_oneof_with_required_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_oneof_with_required_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_oneof_with_required_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_oneof_with_required_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_oneof_with_required_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostOneofWithRequiredRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_oneof_with_required_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_oneof_with_required_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_oneof_with_required_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_oneof_with_required_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_oneof_with_required_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_oneof_with_required_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_oneof_with_required_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..ab7730f16fe --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import oneof_with_required +Schema = oneof_with_required.OneofWithRequired diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/__init__.py new file mode 100644 index 00000000000..626fb8ae36e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_pattern_is_not_anchored_request_body import RequestBodyPostPatternIsNotAnchoredRequestBody + +path = "/requestBody/postPatternIsNotAnchoredRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/operation.py new file mode 100644 index 00000000000..35c37a9461c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/operation.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_pattern_is_not_anchored_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_pattern_is_not_anchored_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_pattern_is_not_anchored_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_pattern_is_not_anchored_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_pattern_is_not_anchored_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostPatternIsNotAnchoredRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_pattern_is_not_anchored_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_pattern_is_not_anchored_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_pattern_is_not_anchored_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_pattern_is_not_anchored_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_pattern_is_not_anchored_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_pattern_is_not_anchored_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_pattern_is_not_anchored_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..f339224c57c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import pattern_is_not_anchored +Schema = pattern_is_not_anchored.PatternIsNotAnchored diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_pattern_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_pattern_validation_request_body/__init__.py new file mode 100644 index 00000000000..2bcefe8065f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_pattern_validation_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_pattern_validation_request_body import RequestBodyPostPatternValidationRequestBody + +path = "/requestBody/postPatternValidationRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/operation.py new file mode 100644 index 00000000000..fe62c4ccf24 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/operation.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_pattern_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_pattern_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_pattern_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_pattern_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_pattern_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostPatternValidationRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_pattern_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_pattern_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_pattern_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_pattern_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_pattern_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_pattern_validation_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_pattern_validation_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..4d4a119fbc5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import pattern_validation +Schema = pattern_validation.PatternValidation diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/__init__.py new file mode 100644 index 00000000000..92b7633192e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_properties_with_escaped_characters_request_body import RequestBodyPostPropertiesWithEscapedCharactersRequestBody + +path = "/requestBody/postPropertiesWithEscapedCharactersRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/operation.py new file mode 100644 index 00000000000..048990f820d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/operation.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_properties_with_escaped_characters_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_properties_with_escaped_characters_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_properties_with_escaped_characters_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_properties_with_escaped_characters_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_properties_with_escaped_characters_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostPropertiesWithEscapedCharactersRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_properties_with_escaped_characters_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_properties_with_escaped_characters_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_properties_with_escaped_characters_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_properties_with_escaped_characters_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_properties_with_escaped_characters_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_properties_with_escaped_characters_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_properties_with_escaped_characters_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..811637a134c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import properties_with_escaped_characters +Schema = properties_with_escaped_characters.PropertiesWithEscapedCharacters diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/__init__.py new file mode 100644 index 00000000000..51e82dbd06b --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_property_named_ref_that_is_not_a_reference_request_body import RequestBodyPostPropertyNamedRefThatIsNotAReferenceRequestBody + +path = "/requestBody/postPropertyNamedRefThatIsNotAReferenceRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/operation.py new file mode 100644 index 00000000000..5cbde4f2461 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/operation.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_property_named_ref_that_is_not_a_reference_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_property_named_ref_that_is_not_a_reference_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_property_named_ref_that_is_not_a_reference_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_property_named_ref_that_is_not_a_reference_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_property_named_ref_that_is_not_a_reference_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostPropertyNamedRefThatIsNotAReferenceRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_property_named_ref_that_is_not_a_reference_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_property_named_ref_that_is_not_a_reference_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_property_named_ref_that_is_not_a_reference_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_property_named_ref_that_is_not_a_reference_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_property_named_ref_that_is_not_a_reference_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_property_named_ref_that_is_not_a_reference_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_property_named_ref_that_is_not_a_reference_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..6f232156597 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import property_named_ref_that_is_not_a_reference +Schema = property_named_ref_that_is_not_a_reference.PropertyNamedRefThatIsNotAReference diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/__init__.py new file mode 100644 index 00000000000..edfdeaaa8ea --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_ref_in_additionalproperties_request_body import RequestBodyPostRefInAdditionalpropertiesRequestBody + +path = "/requestBody/postRefInAdditionalpropertiesRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/operation.py new file mode 100644 index 00000000000..7f0e01eaea4 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/operation.py @@ -0,0 +1,361 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_ref_in_additionalproperties_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_ref_in_additionalproperties_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_ref_in_additionalproperties_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_ref_in_additionalproperties_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_ref_in_additionalproperties_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostRefInAdditionalpropertiesRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_ref_in_additionalproperties_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_ref_in_additionalproperties_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_ref_in_additionalproperties_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_ref_in_additionalproperties_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_ref_in_additionalproperties_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_ref_in_additionalproperties_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_ref_in_additionalproperties_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..1661432048d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import ref_in_additionalproperties +Schema = ref_in_additionalproperties.RefInAdditionalproperties diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_allof_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_allof_request_body/__init__.py new file mode 100644 index 00000000000..4c719b765f4 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_allof_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_ref_in_allof_request_body import RequestBodyPostRefInAllofRequestBody + +path = "/requestBody/postRefInAllofRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/operation.py new file mode 100644 index 00000000000..5f378bd5e1f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/operation.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_ref_in_allof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_ref_in_allof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_ref_in_allof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_ref_in_allof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_ref_in_allof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostRefInAllofRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_ref_in_allof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_ref_in_allof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_ref_in_allof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_ref_in_allof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_ref_in_allof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_ref_in_allof_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_ref_in_allof_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..4f28a227604 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import ref_in_allof +Schema = ref_in_allof.RefInAllof diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/__init__.py new file mode 100644 index 00000000000..21b90ff8c1e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_ref_in_anyof_request_body import RequestBodyPostRefInAnyofRequestBody + +path = "/requestBody/postRefInAnyofRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/operation.py new file mode 100644 index 00000000000..538f0146dfe --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/operation.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_ref_in_anyof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_ref_in_anyof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_ref_in_anyof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_ref_in_anyof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_ref_in_anyof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostRefInAnyofRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_ref_in_anyof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_ref_in_anyof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_ref_in_anyof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_ref_in_anyof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_ref_in_anyof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_ref_in_anyof_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_ref_in_anyof_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..c9df8f0119b --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import ref_in_anyof +Schema = ref_in_anyof.RefInAnyof diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_items_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_items_request_body/__init__.py new file mode 100644 index 00000000000..4a997109ef3 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_items_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_ref_in_items_request_body import RequestBodyPostRefInItemsRequestBody + +path = "/requestBody/postRefInItemsRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/operation.py new file mode 100644 index 00000000000..e57b211dcac --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/operation.py @@ -0,0 +1,361 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_ref_in_items_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_ref_in_items_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_ref_in_items_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_ref_in_items_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_ref_in_items_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostRefInItemsRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_ref_in_items_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_ref_in_items_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_ref_in_items_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_ref_in_items_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_ref_in_items_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_ref_in_items_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_ref_in_items_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..17ee4242d4c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import ref_in_items +Schema = ref_in_items.RefInItems diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_not_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_not_request_body/__init__.py new file mode 100644 index 00000000000..7f8a54f0c61 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_not_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_ref_in_not_request_body import RequestBodyPostRefInNotRequestBody + +path = "/requestBody/postRefInNotRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/operation.py new file mode 100644 index 00000000000..bf20f484f3f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/operation.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_ref_in_not_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_ref_in_not_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_ref_in_not_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_ref_in_not_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_ref_in_not_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostRefInNotRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_ref_in_not_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_ref_in_not_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_ref_in_not_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_ref_in_not_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_ref_in_not_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_ref_in_not_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_ref_in_not_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..81d0e8444ab --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import ref_in_not +Schema = ref_in_not.RefInNot diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/__init__.py new file mode 100644 index 00000000000..251bde2a784 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_ref_in_oneof_request_body import RequestBodyPostRefInOneofRequestBody + +path = "/requestBody/postRefInOneofRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/operation.py new file mode 100644 index 00000000000..2a7e92978a2 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/operation.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_ref_in_oneof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_ref_in_oneof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_ref_in_oneof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_ref_in_oneof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_ref_in_oneof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostRefInOneofRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_ref_in_oneof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_ref_in_oneof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_ref_in_oneof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_ref_in_oneof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_ref_in_oneof_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_ref_in_oneof_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_ref_in_oneof_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..80aef0712d6 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import ref_in_oneof +Schema = ref_in_oneof.RefInOneof diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_property_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_property_request_body/__init__.py new file mode 100644 index 00000000000..8a668f42f0c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_property_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_ref_in_property_request_body import RequestBodyPostRefInPropertyRequestBody + +path = "/requestBody/postRefInPropertyRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/operation.py new file mode 100644 index 00000000000..dd7f4d7feb4 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/operation.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_ref_in_property_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_ref_in_property_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_ref_in_property_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_ref_in_property_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_ref_in_property_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostRefInPropertyRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_ref_in_property_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_ref_in_property_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_ref_in_property_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_ref_in_property_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_ref_in_property_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_ref_in_property_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_ref_in_property_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..9e469ad0f15 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import ref_in_property +Schema = ref_in_property.RefInProperty diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_default_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_default_validation_request_body/__init__.py new file mode 100644 index 00000000000..95dcd408fb4 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_default_validation_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_required_default_validation_request_body import RequestBodyPostRequiredDefaultValidationRequestBody + +path = "/requestBody/postRequiredDefaultValidationRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/operation.py new file mode 100644 index 00000000000..1719dd10689 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/operation.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_required_default_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_required_default_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_required_default_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_required_default_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_required_default_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostRequiredDefaultValidationRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_required_default_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_required_default_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_required_default_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_required_default_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_required_default_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_required_default_validation_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_required_default_validation_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..276d8542a53 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import required_default_validation +Schema = required_default_validation.RequiredDefaultValidation diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_validation_request_body/__init__.py new file mode 100644 index 00000000000..c3e1b98e641 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_validation_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_required_validation_request_body import RequestBodyPostRequiredValidationRequestBody + +path = "/requestBody/postRequiredValidationRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_validation_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_validation_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_validation_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_validation_request_body/post/operation.py new file mode 100644 index 00000000000..a4c32fe7401 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_validation_request_body/post/operation.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_required_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_required_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_required_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_required_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_required_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostRequiredValidationRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_required_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_required_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_required_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_required_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_required_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_required_validation_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_required_validation_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_validation_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_validation_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_validation_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_validation_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_validation_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_validation_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_validation_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_validation_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_validation_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..7ffdf49df0f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_validation_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import required_validation +Schema = required_validation.RequiredValidation diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_validation_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_validation_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_validation_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_validation_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_validation_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/__init__.py new file mode 100644 index 00000000000..9c6ccfd5d42 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_required_with_empty_array_request_body import RequestBodyPostRequiredWithEmptyArrayRequestBody + +path = "/requestBody/postRequiredWithEmptyArrayRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/operation.py new file mode 100644 index 00000000000..f6ee9ea1f81 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/operation.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_required_with_empty_array_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_required_with_empty_array_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_required_with_empty_array_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_required_with_empty_array_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_required_with_empty_array_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostRequiredWithEmptyArrayRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_required_with_empty_array_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_required_with_empty_array_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_required_with_empty_array_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_required_with_empty_array_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_required_with_empty_array_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_required_with_empty_array_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_required_with_empty_array_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..f2dce709a1c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import required_with_empty_array +Schema = required_with_empty_array.RequiredWithEmptyArray diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/__init__.py new file mode 100644 index 00000000000..5a2bce47d89 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_required_with_escaped_characters_request_body import RequestBodyPostRequiredWithEscapedCharactersRequestBody + +path = "/requestBody/postRequiredWithEscapedCharactersRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/operation.py new file mode 100644 index 00000000000..4bae3f20c8f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/operation.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_required_with_escaped_characters_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_required_with_escaped_characters_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_required_with_escaped_characters_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_required_with_escaped_characters_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_required_with_escaped_characters_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostRequiredWithEscapedCharactersRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_required_with_escaped_characters_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_required_with_escaped_characters_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_required_with_escaped_characters_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_required_with_escaped_characters_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_required_with_escaped_characters_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_required_with_escaped_characters_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_required_with_escaped_characters_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..0443b64e37f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import required_with_escaped_characters +Schema = required_with_escaped_characters.RequiredWithEscapedCharacters diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/__init__.py new file mode 100644 index 00000000000..f88389e988a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_simple_enum_validation_request_body import RequestBodyPostSimpleEnumValidationRequestBody + +path = "/requestBody/postSimpleEnumValidationRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/operation.py new file mode 100644 index 00000000000..5ef8e5aeb5a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/operation.py @@ -0,0 +1,376 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_simple_enum_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int, + float + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_simple_enum_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int, + float + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_simple_enum_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int, + float + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_simple_enum_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int, + float + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_simple_enum_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int, + float + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostSimpleEnumValidationRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_simple_enum_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int, + float + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_simple_enum_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int, + float + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_simple_enum_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int, + float + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_simple_enum_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int, + float + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_simple_enum_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int, + float + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_simple_enum_validation_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int, + float + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int, + float + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int, + float + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int, + float + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + decimal.Decimal, + int, + float + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_simple_enum_validation_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..9a40af3aa13 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import simple_enum_validation +Schema = simple_enum_validation.SimpleEnumValidation diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/__init__.py new file mode 100644 index 00000000000..bf9e15d99d3 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_string_type_matches_strings_request_body import RequestBodyPostStringTypeMatchesStringsRequestBody + +path = "/requestBody/postStringTypeMatchesStringsRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/operation.py new file mode 100644 index 00000000000..1c3632acffa --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/operation.py @@ -0,0 +1,346 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_string_type_matches_strings_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_string_type_matches_strings_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_string_type_matches_strings_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_string_type_matches_strings_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_string_type_matches_strings_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostStringTypeMatchesStringsRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_string_type_matches_strings_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_string_type_matches_strings_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_string_type_matches_strings_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_string_type_matches_strings_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_string_type_matches_strings_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_string_type_matches_strings_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + str + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_string_type_matches_strings_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..087e9d4b3ed --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import string_type_matches_strings +Schema = string_type_matches_strings.StringTypeMatchesStrings diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/__init__.py new file mode 100644 index 00000000000..5361e0f31a1 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body import RequestBodyPostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody + +path = "/requestBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/operation.py new file mode 100644 index 00000000000..c6c26c405eb --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/operation.py @@ -0,0 +1,361 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..08db8d2d201 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import the_default_keyword_does_not_do_anything_if_the_property_is_missing +Schema = the_default_keyword_does_not_do_anything_if_the_property_is_missing.TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/__init__.py new file mode 100644 index 00000000000..dd5cb805c49 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_uniqueitems_false_validation_request_body import RequestBodyPostUniqueitemsFalseValidationRequestBody + +path = "/requestBody/postUniqueitemsFalseValidationRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/operation.py new file mode 100644 index 00000000000..bd8befa1ca3 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/operation.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_uniqueitems_false_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_uniqueitems_false_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_uniqueitems_false_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_uniqueitems_false_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_uniqueitems_false_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostUniqueitemsFalseValidationRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_uniqueitems_false_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_uniqueitems_false_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_uniqueitems_false_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_uniqueitems_false_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_uniqueitems_false_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_uniqueitems_false_validation_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_uniqueitems_false_validation_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..fa9c914eae9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import uniqueitems_false_validation +Schema = uniqueitems_false_validation.UniqueitemsFalseValidation diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/__init__.py new file mode 100644 index 00000000000..aa31ed2d72e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_uniqueitems_validation_request_body import RequestBodyPostUniqueitemsValidationRequestBody + +path = "/requestBody/postUniqueitemsValidationRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/operation.py new file mode 100644 index 00000000000..aff589bc301 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/operation.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_uniqueitems_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_uniqueitems_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_uniqueitems_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_uniqueitems_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_uniqueitems_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostUniqueitemsValidationRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_uniqueitems_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_uniqueitems_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_uniqueitems_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_uniqueitems_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_uniqueitems_validation_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_uniqueitems_validation_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_uniqueitems_validation_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..8085d23fc68 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import uniqueitems_validation +Schema = uniqueitems_validation.UniqueitemsValidation diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_format_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_format_request_body/__init__.py new file mode 100644 index 00000000000..e69df11e271 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_format_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_uri_format_request_body import RequestBodyPostUriFormatRequestBody + +path = "/requestBody/postUriFormatRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_format_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_format_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_format_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_format_request_body/post/operation.py new file mode 100644 index 00000000000..55d96f302b9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_format_request_body/post/operation.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_uri_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_uri_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_uri_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_uri_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_uri_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostUriFormatRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_uri_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_uri_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_uri_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_uri_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_uri_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_uri_format_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_uri_format_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_format_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_format_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_format_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_format_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_format_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_format_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_format_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_format_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_format_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..d8492f8d8dc --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_format_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import uri_format +Schema = uri_format.UriFormat diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_format_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_format_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_format_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_format_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_format_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_reference_format_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_reference_format_request_body/__init__.py new file mode 100644 index 00000000000..113b28e9f47 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_reference_format_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_uri_reference_format_request_body import RequestBodyPostUriReferenceFormatRequestBody + +path = "/requestBody/postUriReferenceFormatRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/operation.py new file mode 100644 index 00000000000..dd1c2f6e6cf --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/operation.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_uri_reference_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_uri_reference_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_uri_reference_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_uri_reference_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_uri_reference_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostUriReferenceFormatRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_uri_reference_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_uri_reference_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_uri_reference_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_uri_reference_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_uri_reference_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_uri_reference_format_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_uri_reference_format_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..6a702282821 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import uri_reference_format +Schema = uri_reference_format.UriReferenceFormat diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_template_format_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_template_format_request_body/__init__.py new file mode 100644 index 00000000000..140605f1039 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_template_format_request_body/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.request_body_post_uri_template_format_request_body import RequestBodyPostUriTemplateFormatRequestBody + +path = "/requestBody/postUriTemplateFormatRequestBody" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/operation.py new file mode 100644 index 00000000000..3f4a1c4aa3b --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/operation.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_uri_template_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_uri_template_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_uri_template_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_uri_template_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_uri_template_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostUriTemplateFormatRequestBody(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_uri_template_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_uri_template_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_uri_template_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_uri_template_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_uri_template_format_request_body( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_uri_template_format_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_uri_template_format_request_body( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/request_body/__init__.py new file mode 100644 index 00000000000..bb35aa91be5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from unit_test_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/request_body/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/request_body/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..0a72dbb3108 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import uri_template_format +Schema = uri_template_format.UriTemplateFormat diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..994396ced4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..97973ab2490 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types import ResponseBodyPostAdditionalpropertiesAllowsASchemaWhichShouldValidateResponseBodyForContentTypes + +path = "/responseBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..f3a2c150bb2 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostAdditionalpropertiesAllowsASchemaWhichShouldValidateResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..1a5dfde9c1d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import additionalproperties_allows_a_schema_which_should_validate +Schema = additionalproperties_allows_a_schema_which_should_validate.AdditionalpropertiesAllowsASchemaWhichShouldValidate diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..1ff536b22e8 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types import ResponseBodyPostAdditionalpropertiesAreAllowedByDefaultResponseBodyForContentTypes + +path = "/responseBody/postAdditionalpropertiesAreAllowedByDefaultResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..717e57c78d0 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_additionalproperties_are_allowed_by_default_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_additionalproperties_are_allowed_by_default_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_additionalproperties_are_allowed_by_default_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_additionalproperties_are_allowed_by_default_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostAdditionalpropertiesAreAllowedByDefaultResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_additionalproperties_are_allowed_by_default_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_additionalproperties_are_allowed_by_default_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_additionalproperties_are_allowed_by_default_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_additionalproperties_are_allowed_by_default_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_additionalproperties_are_allowed_by_default_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_additionalproperties_are_allowed_by_default_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..960ff78d8cd --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import additionalproperties_are_allowed_by_default +Schema = additionalproperties_are_allowed_by_default.AdditionalpropertiesAreAllowedByDefault diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..9cf15dfd3aa --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types import ResponseBodyPostAdditionalpropertiesCanExistByItselfResponseBodyForContentTypes + +path = "/responseBody/postAdditionalpropertiesCanExistByItselfResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..6932b47603b --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_additionalproperties_can_exist_by_itself_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_additionalproperties_can_exist_by_itself_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_additionalproperties_can_exist_by_itself_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_additionalproperties_can_exist_by_itself_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostAdditionalpropertiesCanExistByItselfResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_additionalproperties_can_exist_by_itself_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_additionalproperties_can_exist_by_itself_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_additionalproperties_can_exist_by_itself_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_additionalproperties_can_exist_by_itself_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_additionalproperties_can_exist_by_itself_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_additionalproperties_can_exist_by_itself_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..4ff96c91373 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import additionalproperties_can_exist_by_itself +Schema = additionalproperties_can_exist_by_itself.AdditionalpropertiesCanExistByItself diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..486494cbb62 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types import ResponseBodyPostAdditionalpropertiesShouldNotLookInApplicatorsResponseBodyForContentTypes + +path = "/responseBody/postAdditionalpropertiesShouldNotLookInApplicatorsResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..8d4bc9b4cc3 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostAdditionalpropertiesShouldNotLookInApplicatorsResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..52cc79839f3 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import additionalproperties_should_not_look_in_applicators +Schema = additionalproperties_should_not_look_in_applicators.AdditionalpropertiesShouldNotLookInApplicators diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..8d46c1aa13e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types import ResponseBodyPostAllofCombinedWithAnyofOneofResponseBodyForContentTypes + +path = "/responseBody/postAllofCombinedWithAnyofOneofResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..2a0cb5cca01 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_allof_combined_with_anyof_oneof_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_allof_combined_with_anyof_oneof_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_allof_combined_with_anyof_oneof_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_allof_combined_with_anyof_oneof_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostAllofCombinedWithAnyofOneofResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_allof_combined_with_anyof_oneof_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_allof_combined_with_anyof_oneof_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_allof_combined_with_anyof_oneof_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_allof_combined_with_anyof_oneof_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_allof_combined_with_anyof_oneof_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_allof_combined_with_anyof_oneof_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..42ed68365fd --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import allof_combined_with_anyof_oneof +Schema = allof_combined_with_anyof_oneof.AllofCombinedWithAnyofOneof diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..a821539f542 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_allof_response_body_for_content_types import ResponseBodyPostAllofResponseBodyForContentTypes + +path = "/responseBody/postAllofResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..a4ca8fdcbb7 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_allof_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_allof_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_allof_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_allof_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostAllofResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_allof_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_allof_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_allof_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_allof_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_allof_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_allof_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..6b359fe3a62 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import allof +Schema = allof.Allof diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..2f22fc64bd9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_allof_simple_types_response_body_for_content_types import ResponseBodyPostAllofSimpleTypesResponseBodyForContentTypes + +path = "/responseBody/postAllofSimpleTypesResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..1a16ffefb6a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_allof_simple_types_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_allof_simple_types_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_allof_simple_types_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_allof_simple_types_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostAllofSimpleTypesResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_allof_simple_types_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_allof_simple_types_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_allof_simple_types_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_allof_simple_types_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_allof_simple_types_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_allof_simple_types_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..ed6b07a54b3 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import allof_simple_types +Schema = allof_simple_types.AllofSimpleTypes diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..f1d58e55573 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_allof_with_base_schema_response_body_for_content_types import ResponseBodyPostAllofWithBaseSchemaResponseBodyForContentTypes + +path = "/responseBody/postAllofWithBaseSchemaResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..64544f1db26 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_allof_with_base_schema_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_allof_with_base_schema_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_allof_with_base_schema_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_allof_with_base_schema_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostAllofWithBaseSchemaResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_allof_with_base_schema_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_allof_with_base_schema_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_allof_with_base_schema_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_allof_with_base_schema_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_allof_with_base_schema_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_allof_with_base_schema_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..d46134cd001 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import allof_with_base_schema +Schema = allof_with_base_schema.AllofWithBaseSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..328cb2bdbbc --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_allof_with_one_empty_schema_response_body_for_content_types import ResponseBodyPostAllofWithOneEmptySchemaResponseBodyForContentTypes + +path = "/responseBody/postAllofWithOneEmptySchemaResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..ed114272ad8 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_allof_with_one_empty_schema_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_allof_with_one_empty_schema_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_allof_with_one_empty_schema_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_allof_with_one_empty_schema_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostAllofWithOneEmptySchemaResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_allof_with_one_empty_schema_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_allof_with_one_empty_schema_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_allof_with_one_empty_schema_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_allof_with_one_empty_schema_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_allof_with_one_empty_schema_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_allof_with_one_empty_schema_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..a1850c58e56 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import allof_with_one_empty_schema +Schema = allof_with_one_empty_schema.AllofWithOneEmptySchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..6e880a6ace4 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types import ResponseBodyPostAllofWithTheFirstEmptySchemaResponseBodyForContentTypes + +path = "/responseBody/postAllofWithTheFirstEmptySchemaResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..2302e51c666 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_allof_with_the_first_empty_schema_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_allof_with_the_first_empty_schema_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_allof_with_the_first_empty_schema_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_allof_with_the_first_empty_schema_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostAllofWithTheFirstEmptySchemaResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_allof_with_the_first_empty_schema_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_allof_with_the_first_empty_schema_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_allof_with_the_first_empty_schema_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_allof_with_the_first_empty_schema_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_allof_with_the_first_empty_schema_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_allof_with_the_first_empty_schema_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..7935b99eb74 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import allof_with_the_first_empty_schema +Schema = allof_with_the_first_empty_schema.AllofWithTheFirstEmptySchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..fbc44278664 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types import ResponseBodyPostAllofWithTheLastEmptySchemaResponseBodyForContentTypes + +path = "/responseBody/postAllofWithTheLastEmptySchemaResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..b363ef3ce04 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_allof_with_the_last_empty_schema_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_allof_with_the_last_empty_schema_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_allof_with_the_last_empty_schema_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_allof_with_the_last_empty_schema_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostAllofWithTheLastEmptySchemaResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_allof_with_the_last_empty_schema_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_allof_with_the_last_empty_schema_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_allof_with_the_last_empty_schema_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_allof_with_the_last_empty_schema_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_allof_with_the_last_empty_schema_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_allof_with_the_last_empty_schema_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..219c3c540dd --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import allof_with_the_last_empty_schema +Schema = allof_with_the_last_empty_schema.AllofWithTheLastEmptySchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..5b300d3a7a5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_allof_with_two_empty_schemas_response_body_for_content_types import ResponseBodyPostAllofWithTwoEmptySchemasResponseBodyForContentTypes + +path = "/responseBody/postAllofWithTwoEmptySchemasResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..0985add4e23 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_allof_with_two_empty_schemas_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_allof_with_two_empty_schemas_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_allof_with_two_empty_schemas_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_allof_with_two_empty_schemas_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostAllofWithTwoEmptySchemasResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_allof_with_two_empty_schemas_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_allof_with_two_empty_schemas_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_allof_with_two_empty_schemas_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_allof_with_two_empty_schemas_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_allof_with_two_empty_schemas_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_allof_with_two_empty_schemas_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..004ab7a1e5d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import allof_with_two_empty_schemas +Schema = allof_with_two_empty_schemas.AllofWithTwoEmptySchemas diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..3f446dbe483 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_anyof_complex_types_response_body_for_content_types import ResponseBodyPostAnyofComplexTypesResponseBodyForContentTypes + +path = "/responseBody/postAnyofComplexTypesResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..c0cbddebe7d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_anyof_complex_types_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_anyof_complex_types_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_anyof_complex_types_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_anyof_complex_types_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostAnyofComplexTypesResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_anyof_complex_types_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_anyof_complex_types_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_anyof_complex_types_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_anyof_complex_types_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_anyof_complex_types_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_anyof_complex_types_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..bdff269c760 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import anyof_complex_types +Schema = anyof_complex_types.AnyofComplexTypes diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..1b05f950c01 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_anyof_response_body_for_content_types import ResponseBodyPostAnyofResponseBodyForContentTypes + +path = "/responseBody/postAnyofResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..260392fa2af --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_anyof_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_anyof_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_anyof_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_anyof_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostAnyofResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_anyof_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_anyof_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_anyof_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_anyof_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_anyof_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_anyof_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..04efc2e486a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import anyof +Schema = anyof.Anyof diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..5edb95e217d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_anyof_with_base_schema_response_body_for_content_types import ResponseBodyPostAnyofWithBaseSchemaResponseBodyForContentTypes + +path = "/responseBody/postAnyofWithBaseSchemaResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..1ef85388d63 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_anyof_with_base_schema_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_anyof_with_base_schema_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_anyof_with_base_schema_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_anyof_with_base_schema_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostAnyofWithBaseSchemaResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_anyof_with_base_schema_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_anyof_with_base_schema_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_anyof_with_base_schema_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_anyof_with_base_schema_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_anyof_with_base_schema_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_anyof_with_base_schema_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..7c4631249bb --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import anyof_with_base_schema +Schema = anyof_with_base_schema.AnyofWithBaseSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..ca8107ca351 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_anyof_with_one_empty_schema_response_body_for_content_types import ResponseBodyPostAnyofWithOneEmptySchemaResponseBodyForContentTypes + +path = "/responseBody/postAnyofWithOneEmptySchemaResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..c1488321860 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_anyof_with_one_empty_schema_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_anyof_with_one_empty_schema_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_anyof_with_one_empty_schema_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_anyof_with_one_empty_schema_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostAnyofWithOneEmptySchemaResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_anyof_with_one_empty_schema_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_anyof_with_one_empty_schema_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_anyof_with_one_empty_schema_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_anyof_with_one_empty_schema_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_anyof_with_one_empty_schema_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_anyof_with_one_empty_schema_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..96f36f92f2d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import anyof_with_one_empty_schema +Schema = anyof_with_one_empty_schema.AnyofWithOneEmptySchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..3630900b7ad --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_array_type_matches_arrays_response_body_for_content_types import ResponseBodyPostArrayTypeMatchesArraysResponseBodyForContentTypes + +path = "/responseBody/postArrayTypeMatchesArraysResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..09e577b0240 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_array_type_matches_arrays_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_array_type_matches_arrays_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_array_type_matches_arrays_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_array_type_matches_arrays_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostArrayTypeMatchesArraysResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_array_type_matches_arrays_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_array_type_matches_arrays_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_array_type_matches_arrays_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_array_type_matches_arrays_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_array_type_matches_arrays_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_array_type_matches_arrays_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..495271f9fad --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import array_type_matches_arrays +Schema = array_type_matches_arrays.ArrayTypeMatchesArrays diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..2e8e077b376 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_boolean_type_matches_booleans_response_body_for_content_types import ResponseBodyPostBooleanTypeMatchesBooleansResponseBodyForContentTypes + +path = "/responseBody/postBooleanTypeMatchesBooleansResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..47ee4c060cf --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_boolean_type_matches_booleans_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_boolean_type_matches_booleans_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_boolean_type_matches_booleans_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_boolean_type_matches_booleans_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostBooleanTypeMatchesBooleansResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_boolean_type_matches_booleans_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_boolean_type_matches_booleans_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_boolean_type_matches_booleans_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_boolean_type_matches_booleans_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_boolean_type_matches_booleans_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_boolean_type_matches_booleans_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..a40135390d5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import boolean_type_matches_booleans +Schema = boolean_type_matches_booleans.BooleanTypeMatchesBooleans diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..2095dfea7c2 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_by_int_response_body_for_content_types import ResponseBodyPostByIntResponseBodyForContentTypes + +path = "/responseBody/postByIntResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..a0659fb5a3a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_by_int_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_by_int_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_by_int_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_by_int_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostByIntResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_by_int_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_by_int_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_by_int_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_by_int_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_by_int_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_by_int_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..864afee2e01 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import by_int +Schema = by_int.ByInt diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..c5d143559d6 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_by_number_response_body_for_content_types import ResponseBodyPostByNumberResponseBodyForContentTypes + +path = "/responseBody/postByNumberResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..53062ab1a55 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_by_number_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_by_number_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_by_number_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_by_number_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostByNumberResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_by_number_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_by_number_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_by_number_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_by_number_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_by_number_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_by_number_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..920713c206f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import by_number +Schema = by_number.ByNumber diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..1cc155d3efb --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_by_small_number_response_body_for_content_types import ResponseBodyPostBySmallNumberResponseBodyForContentTypes + +path = "/responseBody/postBySmallNumberResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..eee3c518adb --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_by_small_number_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_by_small_number_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_by_small_number_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_by_small_number_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostBySmallNumberResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_by_small_number_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_by_small_number_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_by_small_number_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_by_small_number_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_by_small_number_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_by_small_number_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..c6596e536c5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import by_small_number +Schema = by_small_number.BySmallNumber diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..8273ce8ba12 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_date_time_format_response_body_for_content_types import ResponseBodyPostDateTimeFormatResponseBodyForContentTypes + +path = "/responseBody/postDateTimeFormatResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..9fdb97d0a83 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_date_time_format_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_date_time_format_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_date_time_format_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_date_time_format_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostDateTimeFormatResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_date_time_format_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_date_time_format_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_date_time_format_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_date_time_format_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_date_time_format_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_date_time_format_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..3a33095d428 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import date_time_format +Schema = date_time_format.DateTimeFormat diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..5fd4c511a38 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_email_format_response_body_for_content_types import ResponseBodyPostEmailFormatResponseBodyForContentTypes + +path = "/responseBody/postEmailFormatResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..d316203da10 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_email_format_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_email_format_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_email_format_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_email_format_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostEmailFormatResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_email_format_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_email_format_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_email_format_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_email_format_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_email_format_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_email_format_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..a285dc8db54 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import email_format +Schema = email_format.EmailFormat diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..49bca3ab703 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_enum_with0_does_not_match_false_response_body_for_content_types import ResponseBodyPostEnumWith0DoesNotMatchFalseResponseBodyForContentTypes + +path = "/responseBody/postEnumWith0DoesNotMatchFalseResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..247f84d84a8 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_enum_with0_does_not_match_false_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_enum_with0_does_not_match_false_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_enum_with0_does_not_match_false_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_enum_with0_does_not_match_false_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostEnumWith0DoesNotMatchFalseResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_enum_with0_does_not_match_false_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_enum_with0_does_not_match_false_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_enum_with0_does_not_match_false_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_enum_with0_does_not_match_false_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_enum_with0_does_not_match_false_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_enum_with0_does_not_match_false_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..7e74b2edaa4 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import enum_with0_does_not_match_false +Schema = enum_with0_does_not_match_false.EnumWith0DoesNotMatchFalse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..85cec02e587 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_enum_with1_does_not_match_true_response_body_for_content_types import ResponseBodyPostEnumWith1DoesNotMatchTrueResponseBodyForContentTypes + +path = "/responseBody/postEnumWith1DoesNotMatchTrueResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..ff2ca06a877 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_enum_with1_does_not_match_true_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_enum_with1_does_not_match_true_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_enum_with1_does_not_match_true_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_enum_with1_does_not_match_true_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostEnumWith1DoesNotMatchTrueResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_enum_with1_does_not_match_true_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_enum_with1_does_not_match_true_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_enum_with1_does_not_match_true_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_enum_with1_does_not_match_true_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_enum_with1_does_not_match_true_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_enum_with1_does_not_match_true_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..ae8c5ce69cf --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import enum_with1_does_not_match_true +Schema = enum_with1_does_not_match_true.EnumWith1DoesNotMatchTrue diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..031a5458111 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_enum_with_escaped_characters_response_body_for_content_types import ResponseBodyPostEnumWithEscapedCharactersResponseBodyForContentTypes + +path = "/responseBody/postEnumWithEscapedCharactersResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..0cd3cdf522c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_enum_with_escaped_characters_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_enum_with_escaped_characters_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_enum_with_escaped_characters_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_enum_with_escaped_characters_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostEnumWithEscapedCharactersResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_enum_with_escaped_characters_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_enum_with_escaped_characters_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_enum_with_escaped_characters_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_enum_with_escaped_characters_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_enum_with_escaped_characters_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_enum_with_escaped_characters_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..fd2b9f67cb5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import enum_with_escaped_characters +Schema = enum_with_escaped_characters.EnumWithEscapedCharacters diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..85ba108b5d3 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_enum_with_false_does_not_match0_response_body_for_content_types import ResponseBodyPostEnumWithFalseDoesNotMatch0ResponseBodyForContentTypes + +path = "/responseBody/postEnumWithFalseDoesNotMatch0ResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..9fa23a1de61 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_enum_with_false_does_not_match0_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_enum_with_false_does_not_match0_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_enum_with_false_does_not_match0_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_enum_with_false_does_not_match0_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostEnumWithFalseDoesNotMatch0ResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_enum_with_false_does_not_match0_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_enum_with_false_does_not_match0_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_enum_with_false_does_not_match0_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_enum_with_false_does_not_match0_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_enum_with_false_does_not_match0_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_enum_with_false_does_not_match0_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..7ca0330788b --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import enum_with_false_does_not_match0 +Schema = enum_with_false_does_not_match0.EnumWithFalseDoesNotMatch0 diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..8cd94f1e64b --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_enum_with_true_does_not_match1_response_body_for_content_types import ResponseBodyPostEnumWithTrueDoesNotMatch1ResponseBodyForContentTypes + +path = "/responseBody/postEnumWithTrueDoesNotMatch1ResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..df58a89b796 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_enum_with_true_does_not_match1_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_enum_with_true_does_not_match1_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_enum_with_true_does_not_match1_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_enum_with_true_does_not_match1_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostEnumWithTrueDoesNotMatch1ResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_enum_with_true_does_not_match1_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_enum_with_true_does_not_match1_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_enum_with_true_does_not_match1_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_enum_with_true_does_not_match1_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_enum_with_true_does_not_match1_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_enum_with_true_does_not_match1_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..c7dd82c61a9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import enum_with_true_does_not_match1 +Schema = enum_with_true_does_not_match1.EnumWithTrueDoesNotMatch1 diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..836e2dc5ea9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_enums_in_properties_response_body_for_content_types import ResponseBodyPostEnumsInPropertiesResponseBodyForContentTypes + +path = "/responseBody/postEnumsInPropertiesResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..943f162367b --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_enums_in_properties_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_enums_in_properties_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_enums_in_properties_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_enums_in_properties_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostEnumsInPropertiesResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_enums_in_properties_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_enums_in_properties_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_enums_in_properties_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_enums_in_properties_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_enums_in_properties_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_enums_in_properties_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..4bd20ae9d6e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import enums_in_properties +Schema = enums_in_properties.EnumsInProperties diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..0b530b3e542 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_forbidden_property_response_body_for_content_types import ResponseBodyPostForbiddenPropertyResponseBodyForContentTypes + +path = "/responseBody/postForbiddenPropertyResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..525ab5714e5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_forbidden_property_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_forbidden_property_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_forbidden_property_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_forbidden_property_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostForbiddenPropertyResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_forbidden_property_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_forbidden_property_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_forbidden_property_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_forbidden_property_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_forbidden_property_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_forbidden_property_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..ef431e13d33 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import forbidden_property +Schema = forbidden_property.ForbiddenProperty diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..78a028e54dc --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_hostname_format_response_body_for_content_types import ResponseBodyPostHostnameFormatResponseBodyForContentTypes + +path = "/responseBody/postHostnameFormatResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..2aaf7805343 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_hostname_format_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_hostname_format_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_hostname_format_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_hostname_format_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostHostnameFormatResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_hostname_format_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_hostname_format_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_hostname_format_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_hostname_format_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_hostname_format_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_hostname_format_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..b39f679cc7a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import hostname_format +Schema = hostname_format.HostnameFormat diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..9f4c7ff8e6a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_integer_type_matches_integers_response_body_for_content_types import ResponseBodyPostIntegerTypeMatchesIntegersResponseBodyForContentTypes + +path = "/responseBody/postIntegerTypeMatchesIntegersResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..9c799052e05 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_integer_type_matches_integers_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_integer_type_matches_integers_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_integer_type_matches_integers_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_integer_type_matches_integers_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostIntegerTypeMatchesIntegersResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_integer_type_matches_integers_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_integer_type_matches_integers_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_integer_type_matches_integers_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_integer_type_matches_integers_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_integer_type_matches_integers_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_integer_type_matches_integers_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..791e5052ce7 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import integer_type_matches_integers +Schema = integer_type_matches_integers.IntegerTypeMatchesIntegers diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..727c69ca588 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types import ResponseBodyPostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfResponseBodyForContentTypes + +path = "/responseBody/postInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..a9f53e7efa6 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..f4c7b611e42 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import invalid_instance_should_not_raise_error_when_float_division_inf +Schema = invalid_instance_should_not_raise_error_when_float_division_inf.InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..4aab40da127 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_invalid_string_value_for_default_response_body_for_content_types import ResponseBodyPostInvalidStringValueForDefaultResponseBodyForContentTypes + +path = "/responseBody/postInvalidStringValueForDefaultResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..eca92e18007 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_invalid_string_value_for_default_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_invalid_string_value_for_default_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_invalid_string_value_for_default_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_invalid_string_value_for_default_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostInvalidStringValueForDefaultResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_invalid_string_value_for_default_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_invalid_string_value_for_default_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_invalid_string_value_for_default_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_invalid_string_value_for_default_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_invalid_string_value_for_default_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_invalid_string_value_for_default_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..6aac31aa314 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import invalid_string_value_for_default +Schema = invalid_string_value_for_default.InvalidStringValueForDefault diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..f7d245be6d0 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_ipv4_format_response_body_for_content_types import ResponseBodyPostIpv4FormatResponseBodyForContentTypes + +path = "/responseBody/postIpv4FormatResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..58403b88e3c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_ipv4_format_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_ipv4_format_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_ipv4_format_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_ipv4_format_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostIpv4FormatResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_ipv4_format_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_ipv4_format_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_ipv4_format_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_ipv4_format_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_ipv4_format_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_ipv4_format_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..ec5e069e43b --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import ipv4_format +Schema = ipv4_format.Ipv4Format diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..669a26dd396 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_ipv6_format_response_body_for_content_types import ResponseBodyPostIpv6FormatResponseBodyForContentTypes + +path = "/responseBody/postIpv6FormatResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..e974b556fea --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_ipv6_format_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_ipv6_format_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_ipv6_format_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_ipv6_format_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostIpv6FormatResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_ipv6_format_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_ipv6_format_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_ipv6_format_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_ipv6_format_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_ipv6_format_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_ipv6_format_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..312cc834880 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import ipv6_format +Schema = ipv6_format.Ipv6Format diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..9b1923db1c4 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_json_pointer_format_response_body_for_content_types import ResponseBodyPostJsonPointerFormatResponseBodyForContentTypes + +path = "/responseBody/postJsonPointerFormatResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..8fc709e270f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_json_pointer_format_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_json_pointer_format_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_json_pointer_format_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_json_pointer_format_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostJsonPointerFormatResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_json_pointer_format_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_json_pointer_format_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_json_pointer_format_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_json_pointer_format_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_json_pointer_format_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_json_pointer_format_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..c19be1f98b8 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import json_pointer_format +Schema = json_pointer_format.JsonPointerFormat diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..fa319fd15f6 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_maximum_validation_response_body_for_content_types import ResponseBodyPostMaximumValidationResponseBodyForContentTypes + +path = "/responseBody/postMaximumValidationResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..a9f5ade807e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_maximum_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_maximum_validation_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_maximum_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_maximum_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostMaximumValidationResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_maximum_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_maximum_validation_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_maximum_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_maximum_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_maximum_validation_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_maximum_validation_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..d368444b07b --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import maximum_validation +Schema = maximum_validation.MaximumValidation diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..5af74f4cf56 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types import ResponseBodyPostMaximumValidationWithUnsignedIntegerResponseBodyForContentTypes + +path = "/responseBody/postMaximumValidationWithUnsignedIntegerResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..708019ace64 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_maximum_validation_with_unsigned_integer_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_maximum_validation_with_unsigned_integer_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_maximum_validation_with_unsigned_integer_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_maximum_validation_with_unsigned_integer_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostMaximumValidationWithUnsignedIntegerResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_maximum_validation_with_unsigned_integer_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_maximum_validation_with_unsigned_integer_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_maximum_validation_with_unsigned_integer_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_maximum_validation_with_unsigned_integer_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_maximum_validation_with_unsigned_integer_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_maximum_validation_with_unsigned_integer_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..6278da92a32 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import maximum_validation_with_unsigned_integer +Schema = maximum_validation_with_unsigned_integer.MaximumValidationWithUnsignedInteger diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..b0125bf0916 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_maxitems_validation_response_body_for_content_types import ResponseBodyPostMaxitemsValidationResponseBodyForContentTypes + +path = "/responseBody/postMaxitemsValidationResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..49062d86dad --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_maxitems_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_maxitems_validation_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_maxitems_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_maxitems_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostMaxitemsValidationResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_maxitems_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_maxitems_validation_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_maxitems_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_maxitems_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_maxitems_validation_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_maxitems_validation_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..b01ae68bcb2 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import maxitems_validation +Schema = maxitems_validation.MaxitemsValidation diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..b7f15060162 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_maxlength_validation_response_body_for_content_types import ResponseBodyPostMaxlengthValidationResponseBodyForContentTypes + +path = "/responseBody/postMaxlengthValidationResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..41d67db29e8 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_maxlength_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_maxlength_validation_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_maxlength_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_maxlength_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostMaxlengthValidationResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_maxlength_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_maxlength_validation_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_maxlength_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_maxlength_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_maxlength_validation_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_maxlength_validation_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..38757fabfa0 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import maxlength_validation +Schema = maxlength_validation.MaxlengthValidation diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..8798b2b5206 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types import ResponseBodyPostMaxproperties0MeansTheObjectIsEmptyResponseBodyForContentTypes + +path = "/responseBody/postMaxproperties0MeansTheObjectIsEmptyResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..fa169e8a5d5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_maxproperties0_means_the_object_is_empty_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_maxproperties0_means_the_object_is_empty_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_maxproperties0_means_the_object_is_empty_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_maxproperties0_means_the_object_is_empty_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostMaxproperties0MeansTheObjectIsEmptyResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_maxproperties0_means_the_object_is_empty_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_maxproperties0_means_the_object_is_empty_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_maxproperties0_means_the_object_is_empty_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_maxproperties0_means_the_object_is_empty_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_maxproperties0_means_the_object_is_empty_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_maxproperties0_means_the_object_is_empty_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..76e69d128e2 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import maxproperties0_means_the_object_is_empty +Schema = maxproperties0_means_the_object_is_empty.Maxproperties0MeansTheObjectIsEmpty diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..d2576d68aac --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_maxproperties_validation_response_body_for_content_types import ResponseBodyPostMaxpropertiesValidationResponseBodyForContentTypes + +path = "/responseBody/postMaxpropertiesValidationResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..043d9c080c5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_maxproperties_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_maxproperties_validation_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_maxproperties_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_maxproperties_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostMaxpropertiesValidationResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_maxproperties_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_maxproperties_validation_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_maxproperties_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_maxproperties_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_maxproperties_validation_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_maxproperties_validation_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..6dde9788979 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import maxproperties_validation +Schema = maxproperties_validation.MaxpropertiesValidation diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..ba4c36b6304 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_minimum_validation_response_body_for_content_types import ResponseBodyPostMinimumValidationResponseBodyForContentTypes + +path = "/responseBody/postMinimumValidationResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..943f1a7532a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_minimum_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_minimum_validation_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_minimum_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_minimum_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostMinimumValidationResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_minimum_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_minimum_validation_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_minimum_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_minimum_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_minimum_validation_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_minimum_validation_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..231497d6aa2 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import minimum_validation +Schema = minimum_validation.MinimumValidation diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..a6fb8f7e452 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types import ResponseBodyPostMinimumValidationWithSignedIntegerResponseBodyForContentTypes + +path = "/responseBody/postMinimumValidationWithSignedIntegerResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..2e3fa5ff8c9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_minimum_validation_with_signed_integer_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_minimum_validation_with_signed_integer_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_minimum_validation_with_signed_integer_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_minimum_validation_with_signed_integer_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostMinimumValidationWithSignedIntegerResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_minimum_validation_with_signed_integer_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_minimum_validation_with_signed_integer_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_minimum_validation_with_signed_integer_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_minimum_validation_with_signed_integer_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_minimum_validation_with_signed_integer_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_minimum_validation_with_signed_integer_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..aeb455b4573 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import minimum_validation_with_signed_integer +Schema = minimum_validation_with_signed_integer.MinimumValidationWithSignedInteger diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..549b10b1d77 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_minitems_validation_response_body_for_content_types import ResponseBodyPostMinitemsValidationResponseBodyForContentTypes + +path = "/responseBody/postMinitemsValidationResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..54974371736 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_minitems_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_minitems_validation_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_minitems_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_minitems_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostMinitemsValidationResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_minitems_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_minitems_validation_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_minitems_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_minitems_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_minitems_validation_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_minitems_validation_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..71bd8f7fe44 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import minitems_validation +Schema = minitems_validation.MinitemsValidation diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..c51701d3c7d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_minlength_validation_response_body_for_content_types import ResponseBodyPostMinlengthValidationResponseBodyForContentTypes + +path = "/responseBody/postMinlengthValidationResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..f84fc2f3eb6 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_minlength_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_minlength_validation_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_minlength_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_minlength_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostMinlengthValidationResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_minlength_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_minlength_validation_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_minlength_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_minlength_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_minlength_validation_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_minlength_validation_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..23b5ebfc444 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import minlength_validation +Schema = minlength_validation.MinlengthValidation diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..580a155882d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_minproperties_validation_response_body_for_content_types import ResponseBodyPostMinpropertiesValidationResponseBodyForContentTypes + +path = "/responseBody/postMinpropertiesValidationResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..2520aea5574 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_minproperties_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_minproperties_validation_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_minproperties_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_minproperties_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostMinpropertiesValidationResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_minproperties_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_minproperties_validation_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_minproperties_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_minproperties_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_minproperties_validation_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_minproperties_validation_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..84dcb6167b8 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import minproperties_validation +Schema = minproperties_validation.MinpropertiesValidation diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..eb4480d03b5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types import ResponseBodyPostNestedAllofToCheckValidationSemanticsResponseBodyForContentTypes + +path = "/responseBody/postNestedAllofToCheckValidationSemanticsResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..db2b246c6af --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_nested_allof_to_check_validation_semantics_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_nested_allof_to_check_validation_semantics_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_nested_allof_to_check_validation_semantics_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_nested_allof_to_check_validation_semantics_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostNestedAllofToCheckValidationSemanticsResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_nested_allof_to_check_validation_semantics_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_nested_allof_to_check_validation_semantics_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_nested_allof_to_check_validation_semantics_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_nested_allof_to_check_validation_semantics_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_nested_allof_to_check_validation_semantics_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_nested_allof_to_check_validation_semantics_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..9280d57a779 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import nested_allof_to_check_validation_semantics +Schema = nested_allof_to_check_validation_semantics.NestedAllofToCheckValidationSemantics diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..4b6b9117d7d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types import ResponseBodyPostNestedAnyofToCheckValidationSemanticsResponseBodyForContentTypes + +path = "/responseBody/postNestedAnyofToCheckValidationSemanticsResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..c367cac6b4f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_nested_anyof_to_check_validation_semantics_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_nested_anyof_to_check_validation_semantics_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_nested_anyof_to_check_validation_semantics_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_nested_anyof_to_check_validation_semantics_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostNestedAnyofToCheckValidationSemanticsResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_nested_anyof_to_check_validation_semantics_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_nested_anyof_to_check_validation_semantics_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_nested_anyof_to_check_validation_semantics_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_nested_anyof_to_check_validation_semantics_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_nested_anyof_to_check_validation_semantics_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_nested_anyof_to_check_validation_semantics_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..dea6b114075 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import nested_anyof_to_check_validation_semantics +Schema = nested_anyof_to_check_validation_semantics.NestedAnyofToCheckValidationSemantics diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..017d7f838ab --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_nested_items_response_body_for_content_types import ResponseBodyPostNestedItemsResponseBodyForContentTypes + +path = "/responseBody/postNestedItemsResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..454dd1f51d1 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_nested_items_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_nested_items_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_nested_items_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_nested_items_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostNestedItemsResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_nested_items_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_nested_items_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_nested_items_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_nested_items_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_nested_items_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_nested_items_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..b9e3777ee06 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import nested_items +Schema = nested_items.NestedItems diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..ce0b0924c92 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types import ResponseBodyPostNestedOneofToCheckValidationSemanticsResponseBodyForContentTypes + +path = "/responseBody/postNestedOneofToCheckValidationSemanticsResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..5c94ad6929f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_nested_oneof_to_check_validation_semantics_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_nested_oneof_to_check_validation_semantics_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_nested_oneof_to_check_validation_semantics_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_nested_oneof_to_check_validation_semantics_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostNestedOneofToCheckValidationSemanticsResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_nested_oneof_to_check_validation_semantics_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_nested_oneof_to_check_validation_semantics_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_nested_oneof_to_check_validation_semantics_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_nested_oneof_to_check_validation_semantics_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_nested_oneof_to_check_validation_semantics_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_nested_oneof_to_check_validation_semantics_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..bfefad33c03 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import nested_oneof_to_check_validation_semantics +Schema = nested_oneof_to_check_validation_semantics.NestedOneofToCheckValidationSemantics diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..0add14246c4 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_not_more_complex_schema_response_body_for_content_types import ResponseBodyPostNotMoreComplexSchemaResponseBodyForContentTypes + +path = "/responseBody/postNotMoreComplexSchemaResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..0110d75f869 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_not_more_complex_schema_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_not_more_complex_schema_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_not_more_complex_schema_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_not_more_complex_schema_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostNotMoreComplexSchemaResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_not_more_complex_schema_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_not_more_complex_schema_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_not_more_complex_schema_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_not_more_complex_schema_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_not_more_complex_schema_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_not_more_complex_schema_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..7701df43d8e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import not_more_complex_schema +Schema = not_more_complex_schema.NotMoreComplexSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_not_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_not_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..47e40e76ed8 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_not_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_not_response_body_for_content_types import ResponseBodyPostNotResponseBodyForContentTypes + +path = "/responseBody/postNotResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..0ef462d52be --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_not_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_not_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_not_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_not_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostNotResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_not_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_not_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_not_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_not_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_not_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_not_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..bebcacf9ebf --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import _not +Schema = _not._Not diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..76523110ce1 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_nul_characters_in_strings_response_body_for_content_types import ResponseBodyPostNulCharactersInStringsResponseBodyForContentTypes + +path = "/responseBody/postNulCharactersInStringsResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..940022ece04 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_nul_characters_in_strings_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_nul_characters_in_strings_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_nul_characters_in_strings_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_nul_characters_in_strings_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostNulCharactersInStringsResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_nul_characters_in_strings_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_nul_characters_in_strings_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_nul_characters_in_strings_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_nul_characters_in_strings_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_nul_characters_in_strings_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_nul_characters_in_strings_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..dfcaba68017 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import nul_characters_in_strings +Schema = nul_characters_in_strings.NulCharactersInStrings diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..040c7a45d65 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types import ResponseBodyPostNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes + +path = "/responseBody/postNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..1c219a89403 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_null_type_matches_only_the_null_object_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_null_type_matches_only_the_null_object_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_null_type_matches_only_the_null_object_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_null_type_matches_only_the_null_object_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_null_type_matches_only_the_null_object_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_null_type_matches_only_the_null_object_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_null_type_matches_only_the_null_object_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_null_type_matches_only_the_null_object_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_null_type_matches_only_the_null_object_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_null_type_matches_only_the_null_object_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..7b17fd7362b --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import null_type_matches_only_the_null_object +Schema = null_type_matches_only_the_null_object.NullTypeMatchesOnlyTheNullObject diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..b7e5164362b --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_number_type_matches_numbers_response_body_for_content_types import ResponseBodyPostNumberTypeMatchesNumbersResponseBodyForContentTypes + +path = "/responseBody/postNumberTypeMatchesNumbersResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..e33469e133f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_number_type_matches_numbers_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_number_type_matches_numbers_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_number_type_matches_numbers_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_number_type_matches_numbers_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostNumberTypeMatchesNumbersResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_number_type_matches_numbers_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_number_type_matches_numbers_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_number_type_matches_numbers_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_number_type_matches_numbers_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_number_type_matches_numbers_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_number_type_matches_numbers_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..35f8a34e485 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import number_type_matches_numbers +Schema = number_type_matches_numbers.NumberTypeMatchesNumbers diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..4e450b7c12a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_object_properties_validation_response_body_for_content_types import ResponseBodyPostObjectPropertiesValidationResponseBodyForContentTypes + +path = "/responseBody/postObjectPropertiesValidationResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..451aee595a0 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_object_properties_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_object_properties_validation_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_object_properties_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_object_properties_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostObjectPropertiesValidationResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_object_properties_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_object_properties_validation_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_object_properties_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_object_properties_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_object_properties_validation_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_object_properties_validation_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..9be3984fe2c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import object_properties_validation +Schema = object_properties_validation.ObjectPropertiesValidation diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..97695da5328 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_object_type_matches_objects_response_body_for_content_types import ResponseBodyPostObjectTypeMatchesObjectsResponseBodyForContentTypes + +path = "/responseBody/postObjectTypeMatchesObjectsResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..8d14c826661 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_object_type_matches_objects_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_object_type_matches_objects_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_object_type_matches_objects_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_object_type_matches_objects_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostObjectTypeMatchesObjectsResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_object_type_matches_objects_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_object_type_matches_objects_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_object_type_matches_objects_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_object_type_matches_objects_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_object_type_matches_objects_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_object_type_matches_objects_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..9c6e1cbbbdc --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import object_type_matches_objects +Schema = object_type_matches_objects.ObjectTypeMatchesObjects diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..18f61bfda88 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_oneof_complex_types_response_body_for_content_types import ResponseBodyPostOneofComplexTypesResponseBodyForContentTypes + +path = "/responseBody/postOneofComplexTypesResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..06dff44d7a8 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_oneof_complex_types_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_oneof_complex_types_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_oneof_complex_types_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_oneof_complex_types_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostOneofComplexTypesResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_oneof_complex_types_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_oneof_complex_types_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_oneof_complex_types_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_oneof_complex_types_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_oneof_complex_types_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_oneof_complex_types_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..f1b6fca7ce1 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import oneof_complex_types +Schema = oneof_complex_types.OneofComplexTypes diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..22b0cf095a7 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_oneof_response_body_for_content_types import ResponseBodyPostOneofResponseBodyForContentTypes + +path = "/responseBody/postOneofResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..cb1d2f23a48 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_oneof_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_oneof_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_oneof_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_oneof_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostOneofResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_oneof_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_oneof_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_oneof_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_oneof_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_oneof_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_oneof_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..ab0470c6457 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import oneof +Schema = oneof.Oneof diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..760b51f5b21 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_oneof_with_base_schema_response_body_for_content_types import ResponseBodyPostOneofWithBaseSchemaResponseBodyForContentTypes + +path = "/responseBody/postOneofWithBaseSchemaResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..7c461ff0297 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_oneof_with_base_schema_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_oneof_with_base_schema_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_oneof_with_base_schema_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_oneof_with_base_schema_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostOneofWithBaseSchemaResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_oneof_with_base_schema_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_oneof_with_base_schema_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_oneof_with_base_schema_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_oneof_with_base_schema_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_oneof_with_base_schema_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_oneof_with_base_schema_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..442f6aaac3f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import oneof_with_base_schema +Schema = oneof_with_base_schema.OneofWithBaseSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..ccb7ca7aaf6 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_oneof_with_empty_schema_response_body_for_content_types import ResponseBodyPostOneofWithEmptySchemaResponseBodyForContentTypes + +path = "/responseBody/postOneofWithEmptySchemaResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..86f899dff04 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_oneof_with_empty_schema_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_oneof_with_empty_schema_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_oneof_with_empty_schema_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_oneof_with_empty_schema_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostOneofWithEmptySchemaResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_oneof_with_empty_schema_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_oneof_with_empty_schema_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_oneof_with_empty_schema_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_oneof_with_empty_schema_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_oneof_with_empty_schema_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_oneof_with_empty_schema_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..e1ef7c9bfff --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import oneof_with_empty_schema +Schema = oneof_with_empty_schema.OneofWithEmptySchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..bd0dc7d3217 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_oneof_with_required_response_body_for_content_types import ResponseBodyPostOneofWithRequiredResponseBodyForContentTypes + +path = "/responseBody/postOneofWithRequiredResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..290535d0868 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_oneof_with_required_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_oneof_with_required_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_oneof_with_required_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_oneof_with_required_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostOneofWithRequiredResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_oneof_with_required_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_oneof_with_required_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_oneof_with_required_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_oneof_with_required_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_oneof_with_required_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_oneof_with_required_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..ab7730f16fe --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import oneof_with_required +Schema = oneof_with_required.OneofWithRequired diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..710b061e3b9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_pattern_is_not_anchored_response_body_for_content_types import ResponseBodyPostPatternIsNotAnchoredResponseBodyForContentTypes + +path = "/responseBody/postPatternIsNotAnchoredResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..b39a903d98f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_pattern_is_not_anchored_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_pattern_is_not_anchored_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_pattern_is_not_anchored_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_pattern_is_not_anchored_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostPatternIsNotAnchoredResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_pattern_is_not_anchored_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_pattern_is_not_anchored_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_pattern_is_not_anchored_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_pattern_is_not_anchored_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_pattern_is_not_anchored_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_pattern_is_not_anchored_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..f339224c57c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import pattern_is_not_anchored +Schema = pattern_is_not_anchored.PatternIsNotAnchored diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..f4dfcf14ba6 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_pattern_validation_response_body_for_content_types import ResponseBodyPostPatternValidationResponseBodyForContentTypes + +path = "/responseBody/postPatternValidationResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..3578eafdab7 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_pattern_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_pattern_validation_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_pattern_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_pattern_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostPatternValidationResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_pattern_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_pattern_validation_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_pattern_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_pattern_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_pattern_validation_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_pattern_validation_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..4d4a119fbc5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import pattern_validation +Schema = pattern_validation.PatternValidation diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..c3903a5ce2e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_properties_with_escaped_characters_response_body_for_content_types import ResponseBodyPostPropertiesWithEscapedCharactersResponseBodyForContentTypes + +path = "/responseBody/postPropertiesWithEscapedCharactersResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..798c02636ca --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_properties_with_escaped_characters_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_properties_with_escaped_characters_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_properties_with_escaped_characters_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_properties_with_escaped_characters_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostPropertiesWithEscapedCharactersResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_properties_with_escaped_characters_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_properties_with_escaped_characters_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_properties_with_escaped_characters_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_properties_with_escaped_characters_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_properties_with_escaped_characters_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_properties_with_escaped_characters_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..811637a134c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import properties_with_escaped_characters +Schema = properties_with_escaped_characters.PropertiesWithEscapedCharacters diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..2eea7a1fb3c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types import ResponseBodyPostPropertyNamedRefThatIsNotAReferenceResponseBodyForContentTypes + +path = "/responseBody/postPropertyNamedRefThatIsNotAReferenceResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..488ec8ccef0 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_property_named_ref_that_is_not_a_reference_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_property_named_ref_that_is_not_a_reference_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_property_named_ref_that_is_not_a_reference_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_property_named_ref_that_is_not_a_reference_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostPropertyNamedRefThatIsNotAReferenceResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_property_named_ref_that_is_not_a_reference_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_property_named_ref_that_is_not_a_reference_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_property_named_ref_that_is_not_a_reference_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_property_named_ref_that_is_not_a_reference_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_property_named_ref_that_is_not_a_reference_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_property_named_ref_that_is_not_a_reference_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..6f232156597 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import property_named_ref_that_is_not_a_reference +Schema = property_named_ref_that_is_not_a_reference.PropertyNamedRefThatIsNotAReference diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..ba034ba029b --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_ref_in_additionalproperties_response_body_for_content_types import ResponseBodyPostRefInAdditionalpropertiesResponseBodyForContentTypes + +path = "/responseBody/postRefInAdditionalpropertiesResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..0885607491a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_ref_in_additionalproperties_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_ref_in_additionalproperties_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_ref_in_additionalproperties_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_ref_in_additionalproperties_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostRefInAdditionalpropertiesResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_ref_in_additionalproperties_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_ref_in_additionalproperties_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_ref_in_additionalproperties_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_ref_in_additionalproperties_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_ref_in_additionalproperties_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_ref_in_additionalproperties_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..1661432048d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import ref_in_additionalproperties +Schema = ref_in_additionalproperties.RefInAdditionalproperties diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..10df8dc1ea9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_ref_in_allof_response_body_for_content_types import ResponseBodyPostRefInAllofResponseBodyForContentTypes + +path = "/responseBody/postRefInAllofResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..2da32d07e5a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_ref_in_allof_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_ref_in_allof_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_ref_in_allof_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_ref_in_allof_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostRefInAllofResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_ref_in_allof_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_ref_in_allof_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_ref_in_allof_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_ref_in_allof_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_ref_in_allof_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_ref_in_allof_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..4f28a227604 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import ref_in_allof +Schema = ref_in_allof.RefInAllof diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..fd6f79815dd --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_ref_in_anyof_response_body_for_content_types import ResponseBodyPostRefInAnyofResponseBodyForContentTypes + +path = "/responseBody/postRefInAnyofResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..179ac574b1e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_ref_in_anyof_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_ref_in_anyof_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_ref_in_anyof_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_ref_in_anyof_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostRefInAnyofResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_ref_in_anyof_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_ref_in_anyof_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_ref_in_anyof_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_ref_in_anyof_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_ref_in_anyof_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_ref_in_anyof_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..c9df8f0119b --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import ref_in_anyof +Schema = ref_in_anyof.RefInAnyof diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..aa00da3f581 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_ref_in_items_response_body_for_content_types import ResponseBodyPostRefInItemsResponseBodyForContentTypes + +path = "/responseBody/postRefInItemsResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..8bc09649ba8 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_ref_in_items_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_ref_in_items_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_ref_in_items_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_ref_in_items_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostRefInItemsResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_ref_in_items_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_ref_in_items_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_ref_in_items_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_ref_in_items_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_ref_in_items_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_ref_in_items_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..17ee4242d4c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import ref_in_items +Schema = ref_in_items.RefInItems diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..a1b927ae8fb --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_ref_in_not_response_body_for_content_types import ResponseBodyPostRefInNotResponseBodyForContentTypes + +path = "/responseBody/postRefInNotResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..1a2647f71e1 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_ref_in_not_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_ref_in_not_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_ref_in_not_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_ref_in_not_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostRefInNotResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_ref_in_not_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_ref_in_not_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_ref_in_not_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_ref_in_not_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_ref_in_not_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_ref_in_not_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..81d0e8444ab --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import ref_in_not +Schema = ref_in_not.RefInNot diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..d94e25cc199 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_ref_in_oneof_response_body_for_content_types import ResponseBodyPostRefInOneofResponseBodyForContentTypes + +path = "/responseBody/postRefInOneofResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..da5ec9e305d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_ref_in_oneof_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_ref_in_oneof_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_ref_in_oneof_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_ref_in_oneof_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostRefInOneofResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_ref_in_oneof_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_ref_in_oneof_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_ref_in_oneof_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_ref_in_oneof_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_ref_in_oneof_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_ref_in_oneof_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..80aef0712d6 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import ref_in_oneof +Schema = ref_in_oneof.RefInOneof diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..e7b68b0656a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_ref_in_property_response_body_for_content_types import ResponseBodyPostRefInPropertyResponseBodyForContentTypes + +path = "/responseBody/postRefInPropertyResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..8d7c673c64d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_ref_in_property_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_ref_in_property_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_ref_in_property_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_ref_in_property_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostRefInPropertyResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_ref_in_property_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_ref_in_property_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_ref_in_property_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_ref_in_property_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_ref_in_property_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_ref_in_property_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..9e469ad0f15 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import ref_in_property +Schema = ref_in_property.RefInProperty diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..5f0fcf1c320 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_required_default_validation_response_body_for_content_types import ResponseBodyPostRequiredDefaultValidationResponseBodyForContentTypes + +path = "/responseBody/postRequiredDefaultValidationResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..e30ad788182 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_required_default_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_required_default_validation_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_required_default_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_required_default_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostRequiredDefaultValidationResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_required_default_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_required_default_validation_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_required_default_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_required_default_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_required_default_validation_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_required_default_validation_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..276d8542a53 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import required_default_validation +Schema = required_default_validation.RequiredDefaultValidation diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..84b266b86e0 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_required_validation_response_body_for_content_types import ResponseBodyPostRequiredValidationResponseBodyForContentTypes + +path = "/responseBody/postRequiredValidationResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..3ae0a42b8aa --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_required_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_required_validation_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_required_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_required_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostRequiredValidationResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_required_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_required_validation_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_required_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_required_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_required_validation_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_required_validation_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..7ffdf49df0f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import required_validation +Schema = required_validation.RequiredValidation diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..ff6db07f898 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_required_with_empty_array_response_body_for_content_types import ResponseBodyPostRequiredWithEmptyArrayResponseBodyForContentTypes + +path = "/responseBody/postRequiredWithEmptyArrayResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..5af9c1b174f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_required_with_empty_array_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_required_with_empty_array_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_required_with_empty_array_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_required_with_empty_array_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostRequiredWithEmptyArrayResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_required_with_empty_array_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_required_with_empty_array_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_required_with_empty_array_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_required_with_empty_array_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_required_with_empty_array_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_required_with_empty_array_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..f2dce709a1c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import required_with_empty_array +Schema = required_with_empty_array.RequiredWithEmptyArray diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..8b24b24d22d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_required_with_escaped_characters_response_body_for_content_types import ResponseBodyPostRequiredWithEscapedCharactersResponseBodyForContentTypes + +path = "/responseBody/postRequiredWithEscapedCharactersResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..edeb1702cde --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_required_with_escaped_characters_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_required_with_escaped_characters_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_required_with_escaped_characters_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_required_with_escaped_characters_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostRequiredWithEscapedCharactersResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_required_with_escaped_characters_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_required_with_escaped_characters_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_required_with_escaped_characters_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_required_with_escaped_characters_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_required_with_escaped_characters_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_required_with_escaped_characters_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..0443b64e37f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import required_with_escaped_characters +Schema = required_with_escaped_characters.RequiredWithEscapedCharacters diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..fa0ed0a80a0 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_simple_enum_validation_response_body_for_content_types import ResponseBodyPostSimpleEnumValidationResponseBodyForContentTypes + +path = "/responseBody/postSimpleEnumValidationResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..f28b2b8abf7 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_simple_enum_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_simple_enum_validation_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_simple_enum_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_simple_enum_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostSimpleEnumValidationResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_simple_enum_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_simple_enum_validation_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_simple_enum_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_simple_enum_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_simple_enum_validation_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_simple_enum_validation_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..9a40af3aa13 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import simple_enum_validation +Schema = simple_enum_validation.SimpleEnumValidation diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..c21538e890f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_string_type_matches_strings_response_body_for_content_types import ResponseBodyPostStringTypeMatchesStringsResponseBodyForContentTypes + +path = "/responseBody/postStringTypeMatchesStringsResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..ca32edbec2c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_string_type_matches_strings_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_string_type_matches_strings_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_string_type_matches_strings_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_string_type_matches_strings_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostStringTypeMatchesStringsResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_string_type_matches_strings_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_string_type_matches_strings_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_string_type_matches_strings_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_string_type_matches_strings_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_string_type_matches_strings_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_string_type_matches_strings_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..087e9d4b3ed --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import string_type_matches_strings +Schema = string_type_matches_strings.StringTypeMatchesStrings diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..08e58aa043d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types import ResponseBodyPostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyForContentTypes + +path = "/responseBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..d420cdefc50 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..08db8d2d201 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import the_default_keyword_does_not_do_anything_if_the_property_is_missing +Schema = the_default_keyword_does_not_do_anything_if_the_property_is_missing.TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..a59c068b52f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_uniqueitems_false_validation_response_body_for_content_types import ResponseBodyPostUniqueitemsFalseValidationResponseBodyForContentTypes + +path = "/responseBody/postUniqueitemsFalseValidationResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..caeabf593f6 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_uniqueitems_false_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_uniqueitems_false_validation_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_uniqueitems_false_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_uniqueitems_false_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostUniqueitemsFalseValidationResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_uniqueitems_false_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_uniqueitems_false_validation_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_uniqueitems_false_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_uniqueitems_false_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_uniqueitems_false_validation_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_uniqueitems_false_validation_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..fa9c914eae9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import uniqueitems_false_validation +Schema = uniqueitems_false_validation.UniqueitemsFalseValidation diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..c4cc62f6486 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_uniqueitems_validation_response_body_for_content_types import ResponseBodyPostUniqueitemsValidationResponseBodyForContentTypes + +path = "/responseBody/postUniqueitemsValidationResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..e0122e7a7e9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_uniqueitems_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_uniqueitems_validation_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_uniqueitems_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_uniqueitems_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostUniqueitemsValidationResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_uniqueitems_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_uniqueitems_validation_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_uniqueitems_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_uniqueitems_validation_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_uniqueitems_validation_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_uniqueitems_validation_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..8085d23fc68 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import uniqueitems_validation +Schema = uniqueitems_validation.UniqueitemsValidation diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..007ebfeebdd --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_uri_format_response_body_for_content_types import ResponseBodyPostUriFormatResponseBodyForContentTypes + +path = "/responseBody/postUriFormatResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..2691d533d96 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_uri_format_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_uri_format_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_uri_format_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_uri_format_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostUriFormatResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_uri_format_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_uri_format_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_uri_format_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_uri_format_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_uri_format_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_uri_format_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..d8492f8d8dc --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import uri_format +Schema = uri_format.UriFormat diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..f858bcea97e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_uri_reference_format_response_body_for_content_types import ResponseBodyPostUriReferenceFormatResponseBodyForContentTypes + +path = "/responseBody/postUriReferenceFormatResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..63ca7660c13 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_uri_reference_format_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_uri_reference_format_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_uri_reference_format_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_uri_reference_format_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostUriReferenceFormatResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_uri_reference_format_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_uri_reference_format_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_uri_reference_format_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_uri_reference_format_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_uri_reference_format_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_uri_reference_format_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..6a702282821 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import uri_reference_format +Schema = uri_reference_format.UriReferenceFormat diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/__init__.py new file mode 100644 index 00000000000..4c74a254f9a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.apis.paths.response_body_post_uri_template_format_response_body_for_content_types import ResponseBodyPostUriTemplateFormatResponseBodyForContentTypes + +path = "/responseBody/postUriTemplateFormatResponseBodyForContentTypes" \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post/operation.py new file mode 100644 index 00000000000..504276af7f2 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post/operation.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _post_uri_template_format_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_uri_template_format_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_uri_template_format_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_uri_template_format_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostUriTemplateFormatResponseBodyForContentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_uri_template_format_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_uri_template_format_response_body_for_content_types( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_uri_template_format_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_uri_template_format_response_body_for_content_types( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_uri_template_format_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_uri_template_format_response_body_for_content_types( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post/responses/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..790e742c513 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from unit_test_api import api_client +from unit_test_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post/responses/response_200/content/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..0a72dbb3108 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from unit_test_api.components.schema import uri_template_format +Schema = uri_template_format.UriTemplateFormat diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/rest.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/rest.py new file mode 100644 index 00000000000..0d28ae05d7c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/rest.py @@ -0,0 +1,252 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import logging +import ssl +from urllib.parse import urlencode +import typing + +import certifi +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api.exceptions import ApiException, ApiValueError + + +logger = logging.getLogger(__name__) + + +class RESTClientObject(object): + + def __init__(self, configuration, pools_size=4, maxsize=None): + # urllib3.PoolManager will pass all kw parameters to connectionpool + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 + # maxsize is the number of requests to host that are allowed in parallel # noqa: E501 + # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 + + # cert_reqs + if configuration.verify_ssl: + cert_reqs = ssl.CERT_REQUIRED + else: + cert_reqs = ssl.CERT_NONE + + # ca_certs + if configuration.ssl_ca_cert: + ca_certs = configuration.ssl_ca_cert + else: + # if not set certificate file, use Mozilla's root certificates. + ca_certs = certifi.where() + + addition_pool_args = {} + if configuration.assert_hostname is not None: + addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 + + if configuration.retries is not None: + addition_pool_args['retries'] = configuration.retries + + if configuration.socket_options is not None: + addition_pool_args['socket_options'] = configuration.socket_options + + if maxsize is None: + if configuration.connection_pool_maxsize is not None: + maxsize = configuration.connection_pool_maxsize + else: + maxsize = 4 + + # https pool manager + if configuration.proxy: + self.pool_manager = urllib3.ProxyManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=ca_certs, + cert_file=configuration.cert_file, + key_file=configuration.key_file, + proxy_url=configuration.proxy, + proxy_headers=configuration.proxy_headers, + **addition_pool_args + ) + else: + self.pool_manager = urllib3.PoolManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=ca_certs, + cert_file=configuration.cert_file, + key_file=configuration.key_file, + **addition_pool_args + ) + + def request( + self, + method: str, + url: str, + headers: typing.Optional[HTTPHeaderDict] = None, + fields: typing.Optional[typing.Tuple[typing.Tuple[str, typing.Any], ...]] = None, + body: typing.Optional[typing.Union[str, bytes]] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> urllib3.HTTPResponse: + """Perform requests. + + :param method: http request method + :param url: http request url + :param headers: http request headers + :param body: request body, for other types + :param fields: request parameters for + `application/x-www-form-urlencoded` + or `multipart/form-data` + :param stream: if True, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is False. + :param timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + """ + assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', + 'PATCH', 'OPTIONS'] + + if fields and body: + raise ApiValueError( + "body parameter cannot be used with fields parameter." + ) + + fields = fields or {} + headers = headers or {} + + if timeout: + if isinstance(timeout, (int, float)): # noqa: E501,F821 + timeout = urllib3.Timeout(total=timeout) + elif (isinstance(timeout, tuple) and + len(timeout) == 2): + timeout = urllib3.Timeout(connect=timeout[0], read=timeout[1]) + + try: + # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` + if method in {'POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE'}: + if 'Content-Type' not in headers and body is None: + r = self.pool_manager.request( + method, + url, + preload_content=not stream, + timeout=timeout, + headers=headers + ) + elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 + r = self.pool_manager.request( + method, url, + body=body, + encode_multipart=False, + preload_content=not stream, + timeout=timeout, + headers=headers) + elif headers['Content-Type'] == 'multipart/form-data': + # must del headers['Content-Type'], or the correct + # Content-Type which generated by urllib3 will be + # overwritten. + del headers['Content-Type'] + r = self.pool_manager.request( + method, url, + fields=fields, + encode_multipart=True, + preload_content=not stream, + timeout=timeout, + headers=headers) + # Pass a `string` parameter directly in the body to support + # other content types than Json when `body` argument is + # provided in serialized form + elif isinstance(body, str) or isinstance(body, bytes): + request_body = body + r = self.pool_manager.request( + method, url, + body=request_body, + preload_content=not stream, + timeout=timeout, + headers=headers) + else: + # Cannot generate the request from given parameters + msg = """Cannot prepare a request message for provided + arguments. Please check that your arguments match + declared content type.""" + raise ApiException(status=0, reason=msg) + # For `GET`, `HEAD` + else: + r = self.pool_manager.request(method, url, + preload_content=not stream, + timeout=timeout, + headers=headers) + except urllib3.exceptions.SSLError as e: + msg = "{0}\n{1}".format(type(e).__name__, str(e)) + raise ApiException(status=0, reason=msg) + + if not stream: + # log response body + logger.debug("response body: %s", r.data) + + return r + + def get(self, url, headers=None, stream=False, + timeout=None, fields=None) -> urllib3.HTTPResponse: + return self.request("GET", url, + headers=headers, + stream=stream, + timeout=timeout, + fields=fields) + + def head(self, url, headers=None, stream=False, + timeout=None, fields=None) -> urllib3.HTTPResponse: + return self.request("HEAD", url, + headers=headers, + stream=stream, + timeout=timeout, + fields=fields) + + def options(self, url, headers=None, + body=None, stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: + return self.request("OPTIONS", url, + headers=headers, + stream=stream, + timeout=timeout, + body=body, fields=fields) + + def delete(self, url, headers=None, body=None, + stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: + return self.request("DELETE", url, + headers=headers, + stream=stream, + timeout=timeout, + body=body, fields=fields) + + def post(self, url, headers=None, + body=None, stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: + return self.request("POST", url, + headers=headers, + stream=stream, + timeout=timeout, + body=body, fields=fields) + + def put(self, url, headers=None, + body=None, stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: + return self.request("PUT", url, + headers=headers, + stream=stream, + timeout=timeout, + body=body, fields=fields) + + def patch(self, url, headers=None, + body=None, stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: + return self.request("PATCH", url, + headers=headers, + stream=stream, + timeout=timeout, + body=body, fields=fields) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/schemas.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/schemas.py new file mode 100644 index 00000000000..54ebc6c8307 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/schemas.py @@ -0,0 +1,2401 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import collections +import datetime +import functools +import decimal +import io +import re +import types +import typing +import uuid + +from dateutil import parser +from dateutil.parser.isoparser import _takes_ascii +import frozendict + +from unit_test_api import exceptions +from unit_test_api.configurations import schema_configuration + + +class Unset(object): + """ + An instance of this class is set as the default value for object type(dict) properties that are optional + When a property has an unset value, that property will not be assigned in the dict + """ + pass + +unset = Unset() + +none_type_ = type(None) + + +class FileIO(io.FileIO): + """ + A class for storing files + Note: this class is not immutable + """ + + def __new__(cls, arg_: typing.Union[io.FileIO, io.BufferedReader]): + if isinstance(arg_, (io.FileIO, io.BufferedReader)): + if arg_.closed: + raise exceptions.ApiValueError('Invalid file state; file is closed and must be open') + arg_.close() + inst = super(FileIO, cls).__new__(cls, arg_.name) + super(FileIO, inst).__init__(arg_.name) + return inst + raise exceptions.ApiValueError('FileIO must be passed arg_ which contains the open file') + + def __init__(self, arg_: typing.Union[io.FileIO, io.BufferedReader]): + pass + + +def update(d: dict, u: dict): + """ + Adds u to d + Where each dict is collections.defaultdict(set) + """ + if not u: + return d + for k, v in u.items(): + if k not in d: + d[k] = v + else: + d[k] = d[k] | v + + +class ValidationMetadata(frozendict.frozendict): + """ + A class storing metadata that is needed to validate OpenApi Schema payloads + """ + def __new__( + cls, + path_to_item: typing.Tuple[typing.Union[str, int], ...], + configuration: schema_configuration.SchemaConfiguration, + seen_classes: typing.FrozenSet[typing.Type] = frozenset(), + validated_path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Type]] = frozendict.frozendict() + ): + """ + Args: + path_to_item: the path to the current data being instantiated. + For {'a': [1]} if the code is handling, 1, then the path is ('args[0]', 'a', 0) + This changes from location to location + configuration: the schema_configuration.SchemaConfiguration instance to use + This is needed because in schema_configuration.SchemaConfiguration: + - one can disable validation checking + This does not change from location to location + seen_classes: when deserializing data that matches multiple schemas, this is used to store + the schemas that have been traversed. This is used to stop processing when a cycle is seen. + This changes from location to location + validated_path_to_schemas: stores the already validated schema classes for a given path location + This does not change from location to location + """ + return super().__new__( + cls, + path_to_item=path_to_item, + configuration=configuration, + seen_classes=seen_classes, + validated_path_to_schemas=validated_path_to_schemas + ) + + def validation_ran_earlier(self, cls: type) -> bool: + validated_schemas = self.validated_path_to_schemas.get(self.path_to_item, set()) + validation_ran_earlier = validated_schemas and cls in validated_schemas + if validation_ran_earlier: + return True + if cls in self.seen_classes: + return True + return False + + @property + def path_to_item(self) -> typing.Tuple[typing.Union[str, int], ...]: + return self['path_to_item'] + + @property + def configuration(self) -> schema_configuration.SchemaConfiguration: + return self['configuration'] + + @property + def seen_classes(self) -> typing.FrozenSet[typing.Type]: + return self['seen_classes'] + + @property + def validated_path_to_schemas(self) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Type]]: + return self['validated_path_to_schemas'] + + +def add_deeper_validated_schemas(validation_metadata: ValidationMetadata, path_to_schemas: dict): + # this is called if validation_ran_earlier and current and deeper locations need to be added + current_path_to_item = validation_metadata.path_to_item + other_path_to_schemas = {} + for path_to_item, schemas in validation_metadata.validated_path_to_schemas.items(): + if len(path_to_item) < len(current_path_to_item): + continue + path_begins_with_current_path = path_to_item[:len(current_path_to_item)] == current_path_to_item + if path_begins_with_current_path: + other_path_to_schemas[path_to_item] = schemas + update(path_to_schemas, other_path_to_schemas) + + +class Singleton: + """ + Enums and singletons are the same + The same instance is returned for a given key of (cls, arg_) + """ + _instances = {} + + def __new__(cls, arg_: typing.Any, **kwargs): + """ + cls base classes: BoolClass, NoneClass, str, decimal.Decimal + The 3rd key is used in the tuple below for a corner case where an enum contains integer 1 + However 1.0 can also be ingested into that enum schema because 1.0 == 1 and + Decimal('1.0') == Decimal('1') + But if we omitted the 3rd value in the key, then Decimal('1.0') would be stored as Decimal('1') + and json serializing that instance would be '1' rather than the expected '1.0' + Adding the 3rd value, the str of arg_ ensures that 1.0 -> Decimal('1.0') which is serialized as 1.0 + """ + key = (cls, arg_, str(arg_)) + if key not in cls._instances: + if isinstance(arg_, (none_type_, bool, BoolClass, NoneClass)): + inst = super().__new__(cls) + cls._instances[key] = inst + else: + cls._instances[key] = super().__new__(cls, arg_) + return cls._instances[key] + + def __repr__(self): + if isinstance(self, NoneClass): + return f'<{self.__class__.__name__}: None>' + elif isinstance(self, BoolClass): + if bool(self): + return f'<{self.__class__.__name__}: True>' + return f'<{self.__class__.__name__}: False>' + return f'<{self.__class__.__name__}: {super().__repr__()}>' + + +class classproperty: + + def __init__(self, fget): + self.fget = fget + + def __get__(self, owner_self, owner_cls): + return self.fget(owner_cls) + + +class NoneClass(Singleton): + @classproperty + def NONE(cls): + return cls(None) + + def __bool__(self) -> bool: + return False + + +class BoolClass(Singleton): + @classproperty + def TRUE(cls): + return cls(True) + + @classproperty + def FALSE(cls): + return cls(False) + + @functools.lru_cache() + def __bool__(self) -> bool: + for key, instance in self._instances.items(): + if self is instance: + return bool(key[1]) + raise ValueError('Unable to find the boolean value of this instance') + + +class SchemaTyped: + types: typing.Optional[typing.Set[typing.Type]] + exclusive_maximum: typing.Union[int, float] + inclusive_maximum: typing.Union[int, float] + exclusive_minimum: typing.Union[int, float] + inclusive_minimum: typing.Union[int, float] + max_items: int + min_items: int + discriminator: typing.Dict[str, typing.Dict[str, typing.Type['Schema']]] + + + class Properties: + # to hold object properties + pass + + additionalProperties: typing.Optional[typing.Type['Schema']] + max_properties: int + min_properties: int + AllOf: typing.List[typing.Type['Schema']] + OneOf: typing.List[typing.Type['Schema']] + AnyOf: typing.List[typing.Type['Schema']] + _not: typing.Type['Schema'] + max_length: int + min_length: int + items: typing.Type['Schema'] + +PathToSchemasType = typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]] + + +def __get_valid_classes_phrase(input_classes): + """Returns a string phrase describing what types are allowed""" + all_classes = list(input_classes) + all_classes = sorted(all_classes, key=lambda cls: cls.__name__) + all_class_names = [cls.__name__ for cls in all_classes] + if len(all_class_names) == 1: + return "is {0}".format(all_class_names[0]) + return "is one of [{0}]".format(", ".join(all_class_names)) + + +def __type_error_message( + var_value=None, var_name=None, valid_classes=None, key_type=None +): + """ + Keyword Args: + var_value (any): the variable which has the type_error + var_name (str): the name of the variable which has the typ error + valid_classes (tuple): the accepted classes for current_item's + value + key_type (bool): False if our value is a value in a dict + True if it is a key in a dict + False if our item is an item in a tuple + """ + key_or_value = "value" + if key_type: + key_or_value = "key" + valid_classes_phrase = __get_valid_classes_phrase(valid_classes) + msg = "Invalid type. Required {1} type {2} and " "passed type was {3}".format( + var_name, + key_or_value, + valid_classes_phrase, + type(var_value).__name__, + ) + return msg + + +def __get_type_error(var_value, path_to_item, valid_classes, key_type=False): + error_msg = __type_error_message( + var_name=path_to_item[-1], + var_value=var_value, + valid_classes=valid_classes, + key_type=key_type, + ) + return exceptions.ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=valid_classes, + key_type=key_type, + ) + + +def validate_types( + arg: typing.Any, + allowed_types: typing.Set[typing.Type], + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> None: + if type(arg) not in allowed_types: + raise __get_type_error( + arg, + validation_metadata.path_to_item, + allowed_types, + key_type=False, + ) + return None + +def validate_enum( + arg: typing.Any, + enum_value_to_name: typing.Dict[typing.Any, str], + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> None: + if arg not in enum_value_to_name: + raise exceptions.ApiValueError("Invalid value {} passed in to {}, allowed_values={}".format(arg, cls, enum_value_to_name.keys())) + return None + + +def _raise_validation_error_message(value, constraint_msg, constraint_value, path_to_item, additional_txt=""): + raise exceptions.ApiValueError( + "Invalid value `{value}`, {constraint_msg} `{constraint_value}`{additional_txt} at {path_to_item}".format( + value=value, + constraint_msg=constraint_msg, + constraint_value=constraint_value, + additional_txt=additional_txt, + path_to_item=path_to_item, + ) + ) + + +def validate_unique_items( + arg: typing.Any, + unique_items_value: bool, + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> None: + if not unique_items_value or not isinstance(arg, tuple): + return None + if len(arg) > len(set(arg)): + _raise_validation_error_message( + value=arg, + constraint_msg="duplicate items were found, and the tuple must not contain duplicates because", + constraint_value='unique_items==True', + path_to_item=validation_metadata.path_to_item + ) + return None + + +def validate_min_items( + arg: typing.Any, + min_items: int, + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> None: + if not isinstance(arg, tuple): + return None + if len(arg) < min_items: + _raise_validation_error_message( + value=arg, + constraint_msg="number of items must be greater than or equal to", + constraint_value=min_items, + path_to_item=validation_metadata.path_to_item + ) + return None + + +def validate_max_items( + arg: typing.Any, + max_items: int, + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> None: + if not isinstance(arg, tuple): + return None + if len(arg) > max_items: + _raise_validation_error_message( + value=arg, + constraint_msg="number of items must be less than or equal to", + constraint_value=max_items, + path_to_item=validation_metadata.path_to_item + ) + return None + + +def validate_min_properties( + arg: typing.Any, + min_properties: int, + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> None: + if not isinstance(arg, frozendict.frozendict): + return None + if len(arg) < min_properties: + _raise_validation_error_message( + value=arg, + constraint_msg="number of properties must be greater than or equal to", + constraint_value=min_properties, + path_to_item=validation_metadata.path_to_item + ) + return None + + +def validate_max_properties( + arg: typing.Any, + max_properties: int, + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> None: + if not isinstance(arg, frozendict.frozendict): + return None + if len(arg) > max_properties: + _raise_validation_error_message( + value=arg, + constraint_msg="number of properties must be less than or equal to", + constraint_value=max_properties, + path_to_item=validation_metadata.path_to_item + ) + return None + + +def validate_min_length( + arg: typing.Any, + min_length: int, + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> None: + if not isinstance(arg, str): + return None + if len(arg) < min_length: + _raise_validation_error_message( + value=arg, + constraint_msg="length must be greater than or equal to", + constraint_value=min_length, + path_to_item=validation_metadata.path_to_item + ) + return None + + +def validate_max_length( + arg: typing.Any, + max_length: int, + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> None: + if not isinstance(arg, str): + return None + if len(arg) > max_length: + _raise_validation_error_message( + value=arg, + constraint_msg="length must be less than or equal to", + constraint_value=max_length, + path_to_item=validation_metadata.path_to_item + ) + return None + + +def validate_inclusive_minimum( + arg: typing.Any, + inclusive_minimum: typing.Union[int, float], + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> None: + if not isinstance(arg, decimal.Decimal): + return None + if arg < inclusive_minimum: + _raise_validation_error_message( + value=arg, + constraint_msg="must be a value greater than or equal to", + constraint_value=inclusive_minimum, + path_to_item=validation_metadata.path_to_item + ) + return None + + +def validate_exclusive_minimum( + arg: typing.Any, + exclusive_minimum: typing.Union[int, float], + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> None: + if not isinstance(arg, decimal.Decimal): + return None + if arg <= exclusive_minimum: + _raise_validation_error_message( + value=arg, + constraint_msg="must be a value greater than", + constraint_value=exclusive_minimum, + path_to_item=validation_metadata.path_to_item + ) + return None + + +def validate_inclusive_maximum( + arg: typing.Any, + inclusive_maximum: typing.Union[int, float], + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> None: + if not isinstance(arg, decimal.Decimal): + return None + if arg > inclusive_maximum: + _raise_validation_error_message( + value=arg, + constraint_msg="must be a value less than or equal to", + constraint_value=inclusive_maximum, + path_to_item=validation_metadata.path_to_item + ) + return None + + +def validate_exclusive_maximum( + arg: typing.Any, + exclusive_maximum: typing.Union[int, float], + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> None: + if not isinstance(arg, decimal.Decimal): + return None + if arg >= exclusive_maximum: + _raise_validation_error_message( + value=arg, + constraint_msg="must be a value less than", + constraint_value=exclusive_maximum, + path_to_item=validation_metadata.path_to_item + ) + return None + +def validate_multiple_of( + arg: typing.Any, + multiple_of: typing.Union[int, float], + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> None: + if not isinstance(arg, decimal.Decimal): + return None + if (not (float(arg) / multiple_of).is_integer()): + # Note 'multipleOf' will be as good as the floating point arithmetic. + _raise_validation_error_message( + value=arg, + constraint_msg="value must be a multiple of", + constraint_value=multiple_of, + path_to_item=validation_metadata.path_to_item + ) + return None + + +def validate_regex( + arg: typing.Any, + regex_dict: typing.Dict, + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> None: + if not isinstance(arg, str): + return None + flags = regex_dict.get('flags', 0) + if not re.search(regex_dict['pattern'], arg, flags=flags): + if flags != 0: + # Don't print the regex flags if the flags are not + # specified in the OAS document. + _raise_validation_error_message( + value=arg, + constraint_msg="must match regular expression", + constraint_value=regex_dict['pattern'], + path_to_item=validation_metadata.path_to_item, + additional_txt=" with flags=`{}`".format(flags) + ) + _raise_validation_error_message( + value=arg, + constraint_msg="must match regular expression", + constraint_value=regex_dict['pattern'], + path_to_item=validation_metadata.path_to_item + ) + return None + + +__int32_inclusive_minimum = decimal.Decimal(-2147483648) +__int32_inclusive_maximum = decimal.Decimal(2147483647) +__int64_inclusive_minimum = decimal.Decimal(-9223372036854775808) +__int64_inclusive_maximum = decimal.Decimal(9223372036854775807) +__float_inclusive_minimum = decimal.Decimal(-3.4028234663852886e+38) +__float_inclusive_maximum = decimal.Decimal(3.4028234663852886e+38) +__double_inclusive_minimum = decimal.Decimal(-1.7976931348623157E+308) +__double_inclusive_maximum = decimal.Decimal(1.7976931348623157E+308) + +def __validate_numeric_format( + arg: decimal.Decimal, + format: str, + validation_metadata: ValidationMetadata +) -> None: + if format[:3] == 'int': + # there is a json schema test where 1.0 validates as an integer + if arg != int(arg): + raise exceptions.ApiValueError( + "Invalid non-integer value '{}' for type {} at {}".format( + arg, format, validation_metadata.path_to_item + ) + ) + if format == 'int32': + if not __int32_inclusive_minimum <= arg <= __int32_inclusive_maximum: + raise exceptions.ApiValueError( + "Invalid value '{}' for type int32 at {}".format(arg, validation_metadata.path_to_item) + ) + return None + elif format == 'int64': + if not __int64_inclusive_minimum <= arg <= __int64_inclusive_maximum: + raise exceptions.ApiValueError( + "Invalid value '{}' for type int64 at {}".format(arg, validation_metadata.path_to_item) + ) + return None + return None + elif format in {'float', 'double'}: + if format == 'float': + if not __float_inclusive_minimum <= arg <= __float_inclusive_maximum: + raise exceptions.ApiValueError( + "Invalid value '{}' for type float at {}".format(arg, validation_metadata.path_to_item) + ) + return None + # double + if not __double_inclusive_minimum <= arg <= __double_inclusive_maximum: + raise exceptions.ApiValueError( + "Invalid value '{}' for type double at {}".format(arg, validation_metadata.path_to_item) + ) + return None + return None + + +class CustomIsoparser(parser.isoparser): + @_takes_ascii + def parse_isodatetime(self, dt_str): + components, pos = self._parse_isodate(dt_str) + if len(dt_str) > pos: + if self._sep is None or dt_str[pos:pos + 1] == self._sep: + components += self._parse_isotime(dt_str[pos + 1:]) + else: + raise ValueError('String contains unknown ISO components') + + if len(components) > 3 and components[3] == 24: + components[3] = 0 + return datetime.datetime(*components) + datetime.timedelta(days=1) + + if len(components) <= 3: + raise ValueError('Value is not a datetime') + + return datetime.datetime(*components) + + @_takes_ascii + def parse_isodate(self, datestr): + components, pos = self._parse_isodate(datestr) + + if len(datestr) > pos: + raise ValueError('String contains invalid time components') + + if len(components) > 3: + raise ValueError('String contains invalid time components') + + return datetime.date(*components) + + +DEFAULT_ISOPARSER = CustomIsoparser() + + +def __validate_string_format( + arg: str, + format: str, + validation_metadata: ValidationMetadata +) -> None: + if format == 'uuid': + try: + uuid.UUID(arg) + return None + except ValueError: + raise exceptions.ApiValueError( + "Invalid value '{}' for type UUID at {}".format(arg, validation_metadata.path_to_item) + ) + elif format == 'number': + try: + decimal.Decimal(arg) + return None + except decimal.InvalidOperation: + raise exceptions.ApiValueError( + "Value cannot be converted to a decimal. " + "Invalid value '{}' for type decimal at {}".format(arg, validation_metadata.path_to_item) + ) + elif format == 'date': + try: + DEFAULT_ISOPARSER.parse_isodate(arg) + return None + except ValueError: + raise exceptions.ApiValueError( + "Value does not conform to the required ISO-8601 date format. " + "Invalid value '{}' for type date at {}".format(arg, validation_metadata.path_to_item) + ) + elif format == 'date-time': + try: + DEFAULT_ISOPARSER.parse_isodatetime(arg) + return None + except ValueError: + raise exceptions.ApiValueError( + "Value does not conform to the required ISO-8601 datetime format. " + "Invalid value '{}' for type datetime at {}".format(arg, validation_metadata.path_to_item) + ) + return None + + +def validate_format( + arg: typing.Any, + format: str, + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> None: + # formats work for strings + numbers + if isinstance(arg, decimal.Decimal): + return __validate_numeric_format( + arg, + format, + validation_metadata + ) + elif isinstance(arg, str): + return __validate_string_format( + arg, + format, + validation_metadata + ) + return None + + +def validate_required( + arg: typing.Any, + required: typing.Set[str], + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> None: + if not isinstance(arg, frozendict.frozendict): + return None + missing_required_arguments = required - arg.keys() + if missing_required_arguments: + missing_required_arguments = list(missing_required_arguments) + missing_required_arguments.sort() + raise exceptions.ApiTypeError( + "{} is missing {} required argument{}: {}".format( + cls.__name__, + len(missing_required_arguments), + "s" if len(missing_required_arguments) > 1 else "", + missing_required_arguments + ) + ) + return None + + +def _get_class(item_cls: typing.Union[types.FunctionType, staticmethod, typing.Type['Schema']]) -> typing.Type['Schema']: + if isinstance(item_cls, types.FunctionType): + # referenced schema + return item_cls() + elif isinstance(item_cls, staticmethod): + # referenced schema + return item_cls.__func__() + return item_cls + + +def validate_items( + arg: typing.Any, + item_cls: typing.Type, + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> PathToSchemasType: + if not isinstance(arg, tuple): + return None + item_cls = _get_class(item_cls) + path_to_schemas = {} + for i, value in enumerate(arg): + item_validation_metadata = ValidationMetadata( + path_to_item=validation_metadata.path_to_item+(i,), + configuration=validation_metadata.configuration, + validated_path_to_schemas=validation_metadata.validated_path_to_schemas + ) + if item_validation_metadata.validation_ran_earlier(item_cls): + add_deeper_validated_schemas(item_validation_metadata, path_to_schemas) + continue + other_path_to_schemas = item_cls._validate( + value, validation_metadata=item_validation_metadata) + update(path_to_schemas, other_path_to_schemas) + return path_to_schemas + + +def validate_properties( + arg: typing.Any, + properties: typing.Type, + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> typing.Optional[PathToSchemasType]: + if not isinstance(arg, frozendict.frozendict): + return None + path_to_schemas = {} + present_properties = {k: v for k, v, in arg.items() if k in properties.__annotations__} + for property_name, value in present_properties.items(): + path_to_item = validation_metadata.path_to_item + (property_name,) + schema = properties.__annotations__[property_name] + schema = _get_class(schema) + arg_validation_metadata = ValidationMetadata( + path_to_item=path_to_item, + configuration=validation_metadata.configuration, + validated_path_to_schemas=validation_metadata.validated_path_to_schemas + ) + if arg_validation_metadata.validation_ran_earlier(schema): + add_deeper_validated_schemas(arg_validation_metadata, path_to_schemas) + continue + other_path_to_schemas = schema._validate(value, validation_metadata=arg_validation_metadata) + update(path_to_schemas, other_path_to_schemas) + return path_to_schemas + + +def validate_additional_properties( + arg: typing.Any, + additional_properties_schema: typing.Type, + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> typing.Optional[PathToSchemasType]: + if not isinstance(arg, frozendict.frozendict): + return None + schema = _get_class(additional_properties_schema) + path_to_schemas = {} + properties_annotations = cls.Schema_.Properties.__annotations__ if hasattr(cls.Schema_, 'Properties') else {} + present_additional_properties = {k: v for k, v, in arg.items() if k not in properties_annotations} + for property_name, value in present_additional_properties.items(): + path_to_item = validation_metadata.path_to_item + (property_name,) + arg_validation_metadata = ValidationMetadata( + path_to_item=path_to_item, + configuration=validation_metadata.configuration, + validated_path_to_schemas=validation_metadata.validated_path_to_schemas + ) + if arg_validation_metadata.validation_ran_earlier(schema): + add_deeper_validated_schemas(arg_validation_metadata, path_to_schemas) + continue + other_path_to_schemas = schema._validate(value, validation_metadata=arg_validation_metadata) + update(path_to_schemas, other_path_to_schemas) + return path_to_schemas + + +def validate_one_of( + arg: typing.Any, + one_of_container_cls: typing.Type, + cls: 'Schema', + validation_metadata: ValidationMetadata, +) -> PathToSchemasType: + oneof_classes = [] + path_to_schemas = collections.defaultdict(set) + for one_of_cls in one_of_container_cls.classes: + schema = _get_class(one_of_cls) + if schema in path_to_schemas[validation_metadata.path_to_item]: + oneof_classes.append(schema) + continue + if schema is cls: + """ + optimistically assume that cls schema will pass validation + do not invoke _validate on it because that is recursive + """ + oneof_classes.append(schema) + continue + if validation_metadata.validation_ran_earlier(schema): + oneof_classes.append(schema) + add_deeper_validated_schemas(validation_metadata, path_to_schemas) + continue + try: + path_to_schemas = schema._validate(arg, validation_metadata=validation_metadata) + except (exceptions.ApiValueError, exceptions.ApiTypeError) as ex: + # silence exceptions because the code needs to accumulate oneof_classes + continue + oneof_classes.append(schema) + if not oneof_classes: + raise exceptions.ApiValueError( + "Invalid inputs given to generate an instance of {}. None " + "of the oneOf schemas matched the input data.".format(cls) + ) + elif len(oneof_classes) > 1: + raise exceptions.ApiValueError( + "Invalid inputs given to generate an instance of {}. Multiple " + "oneOf schemas {} matched the inputs, but a max of one is allowed.".format(cls, oneof_classes) + ) + # exactly one class matches + return path_to_schemas + + +def validate_any_of( + arg: typing.Any, + any_of_container_cls: typing.Type, + cls: 'Schema', + validation_metadata: ValidationMetadata, +) -> PathToSchemasType: + anyof_classes = [] + path_to_schemas = collections.defaultdict(set) + for any_of_cls in any_of_container_cls.classes: + schema = _get_class(any_of_cls) + if schema is cls: + """ + optimistically assume that cls schema will pass validation + do not invoke _validate on it because that is recursive + """ + anyof_classes.append(schema) + continue + if validation_metadata.validation_ran_earlier(schema): + anyof_classes.append(schema) + add_deeper_validated_schemas(validation_metadata, path_to_schemas) + continue + + try: + other_path_to_schemas = schema._validate(arg, validation_metadata=validation_metadata) + except (exceptions.ApiValueError, exceptions.ApiTypeError) as ex: + # silence exceptions because the code needs to accumulate anyof_classes + continue + anyof_classes.append(schema) + update(path_to_schemas, other_path_to_schemas) + if not anyof_classes: + raise exceptions.ApiValueError( + "Invalid inputs given to generate an instance of {}. None " + "of the anyOf schemas matched the input data.".format(cls) + ) + return path_to_schemas + + +def validate_all_of( + arg: typing.Any, + all_of_cls: typing.Type, + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> PathToSchemasType: + path_to_schemas = collections.defaultdict(set) + for allof_cls in all_of_cls.classes: + schema = _get_class(allof_cls) + if schema is cls: + """ + optimistically assume that cls schema will pass validation + do not invoke _validate on it because that is recursive + """ + continue + if validation_metadata.validation_ran_earlier(schema): + add_deeper_validated_schemas(validation_metadata, path_to_schemas) + continue + other_path_to_schemas = schema._validate(arg, validation_metadata=validation_metadata) + update(path_to_schemas, other_path_to_schemas) + return path_to_schemas + + +def validate_not( + arg: typing.Any, + not_cls: typing.Type, + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> None: + not_schema = _get_class(not_cls) + other_path_to_schemas = None + not_exception = exceptions.ApiValueError( + "Invalid value '{}' was passed in to {}. Value is invalid because it is disallowed by {}".format( + arg, + cls.__name__, + not_schema.__name__, + ) + ) + if validation_metadata.validation_ran_earlier(not_schema): + raise not_exception + + try: + other_path_to_schemas = not_schema._validate(arg, validation_metadata=validation_metadata) + except (exceptions.ApiValueError, exceptions.ApiTypeError): + pass + if other_path_to_schemas: + raise not_exception + return None + + +def __ensure_discriminator_value_present( + disc_property_name: str, + validation_metadata: ValidationMetadata, + arg +): + if disc_property_name not in arg: + # The input data does not contain the discriminator property + raise exceptions.ApiValueError( + "Cannot deserialize input data due to missing discriminator. " + "The discriminator property '{}' is missing at path: {}".format(disc_property_name, validation_metadata.path_to_item) + ) + + +def __get_discriminated_class(cls, disc_property_name: str, disc_payload_value: str): + """ + Used in schemas with discriminators + """ + if not hasattr(cls.Schema_, 'discriminator'): + return None + disc = cls.Schema_.discriminator() + if disc_property_name not in disc: + return None + discriminated_cls = disc[disc_property_name].get(disc_payload_value) + if discriminated_cls is not None: + return discriminated_cls + if not ( + hasattr(cls.Schema_, 'AllOf') or + hasattr(cls.Schema_, 'OneOf') or + hasattr(cls.Schema_, 'AnyOf') + ): + return None + # TODO stop traveling if a cycle is hit + if hasattr(cls.Schema_, 'AllOf'): + for allof_cls in cls.Schema_.AllOf.classes: + allof_cls = _get_class(allof_cls) + discriminated_cls = __get_discriminated_class( + allof_cls, disc_property_name=disc_property_name, disc_payload_value=disc_payload_value) + if discriminated_cls is not None: + return discriminated_cls + if hasattr(cls.Schema_, 'OneOf'): + for oneof_cls in cls.Schema_.OneOf.classes: + oneof_cls = _get_class(oneof_cls) + discriminated_cls = __get_discriminated_class( + oneof_cls, disc_property_name=disc_property_name, disc_payload_value=disc_payload_value) + if discriminated_cls is not None: + return discriminated_cls + if hasattr(cls.Schema_, 'AnyOf'): + for anyof_cls in cls.Schema_.AnyOf.classes: + anyof_cls = _get_class(anyof_cls) + discriminated_cls = __get_discriminated_class( + anyof_cls, disc_property_name=disc_property_name, disc_payload_value=disc_payload_value) + if discriminated_cls is not None: + return discriminated_cls + return None + + +def validate_discriminator( + arg: typing.Any, + discriminator_fn: typing.Type, + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> typing.Optional[PathToSchemasType]: + if not isinstance(arg, frozendict.frozendict): + return None + discriminator = discriminator_fn.__func__() + disc_prop_name = list(discriminator.keys())[0] + __ensure_discriminator_value_present(disc_prop_name, validation_metadata, arg) + discriminated_cls = __get_discriminated_class( + cls, disc_property_name=disc_prop_name, disc_payload_value=arg[disc_prop_name] + ) + if discriminated_cls is None: + raise exceptions.ApiValueError( + "Invalid discriminator value was passed in to {}.{} Only the values {} are allowed at {}".format( + cls.__name__, + disc_prop_name, + list(discriminator[disc_prop_name].keys()), + validation_metadata.path_to_item + (disc_prop_name,) + ) + ) + if discriminated_cls is cls: + """ + Optimistically assume that cls will pass validation + If the code invoked _validate on cls it would infinitely recurse + """ + return None + if validation_metadata.validation_ran_earlier(discriminated_cls): + path_to_schemas = {} + add_deeper_validated_schemas(validation_metadata, path_to_schemas) + return path_to_schemas + updated_vm = ValidationMetadata( + path_to_item=validation_metadata.path_to_item, + configuration=validation_metadata.configuration, + seen_classes=validation_metadata.seen_classes | frozenset({cls}), + validated_path_to_schemas=validation_metadata.validated_path_to_schemas + ) + return discriminated_cls._validate(arg, validation_metadata=updated_vm) + + +json_schema_keyword_to_validator = { + 'types': validate_types, + 'enum_value_to_name': validate_enum, + 'unique_items': validate_unique_items, + 'min_items': validate_min_items, + 'max_items': validate_max_items, + 'min_properties': validate_min_properties, + 'max_properties': validate_max_properties, + 'min_length': validate_min_length, + 'max_length': validate_max_length, + 'inclusive_minimum': validate_inclusive_minimum, + 'exclusive_minimum': validate_exclusive_minimum, + 'inclusive_maximum': validate_inclusive_maximum, + 'exclusive_maximum': validate_exclusive_maximum, + 'multiple_of': validate_multiple_of, + 'regex': validate_regex, + 'format': validate_format, + 'required': validate_required, + 'items': validate_items, + 'Items': validate_items, + 'Properties': validate_properties, + 'AdditionalProperties': validate_additional_properties, + 'additional_properties': validate_additional_properties, + 'OneOf': validate_one_of, + 'AnyOf': validate_any_of, + 'AllOf': validate_all_of, + '_not': validate_not, + '_Not': validate_not, + 'ModelNot': validate_not, + 'discriminator': validate_discriminator +} + + +class Schema: + """ + the base class of all swagger/openapi schemas/models + """ + __inheritable_primitive_types_set = {decimal.Decimal, str, tuple, frozendict.frozendict, FileIO, bytes, BoolClass, NoneClass} + Schema_: SchemaTyped + __excluded_cls_properties = { + '__module__', + '__dict__', + '__weakref__', + '__doc__', + 'default', # excluded because it has no impact on validation + } + + @classmethod + def _validate( + cls, + arg, + validation_metadata: ValidationMetadata, + ) -> PathToSchemasType: + """ + Schema validate + All keyword validation except for type checking was done in calling stack frames + If those validations passed, the validated classes are collected in path_to_schemas + """ + json_schema_data = { + k: v + for k, v in vars(cls.Schema_).items() + if k not in cls.__excluded_cls_properties + and k + not in validation_metadata.configuration.disabled_json_schema_python_keywords + } + path_to_schemas = {} + for keyword, val in json_schema_data.items(): + validator = json_schema_keyword_to_validator[keyword] + + other_path_to_schemas = validator( + arg, + val, + cls, + validation_metadata, + ) + if other_path_to_schemas: + update(path_to_schemas, other_path_to_schemas) + + base_class = type(arg) + if validation_metadata.path_to_item not in path_to_schemas: + path_to_schemas[validation_metadata.path_to_item] = set() + path_to_schemas[validation_metadata.path_to_item].add(cls) + path_to_schemas[validation_metadata.path_to_item].add(base_class) + return path_to_schemas + + @staticmethod + def _process_schema_classes( + schema_classes: typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]] + ): + """ + Processes and mutates schema_classes + If a SomeSchema is a subclass of DictSchema then remove DictSchema because it is already included + """ + if len(schema_classes) < 2: + return + if len(schema_classes) > 2 and UnsetAnyTypeSchema in schema_classes: + schema_classes.remove(UnsetAnyTypeSchema) + x_schema = schema_type_classes & schema_classes + if not x_schema: + return + # the only way len == 2 is to have one be AnyTypeSchema + x_schema = x_schema.pop() if len(x_schema) == 1 else AnyTypeSchema + if any(c is not x_schema and issubclass(c, x_schema) for c in schema_classes): + # needed to not have a mro error in get_new_class + schema_classes.remove(x_schema) + + @staticmethod + def __bases_by_type(): + return { + str: (UnsetAnyTypeSchema, str), + decimal.Decimal: (UnsetAnyTypeSchema, decimal.Decimal), + BoolClass: (UnsetAnyTypeSchema, BoolClass), + NoneClass: (UnsetAnyTypeSchema, NoneClass), + tuple: (UnsetAnyTypeSchema, tuple), + frozendict.frozendict: (UnsetAnyTypeSchema, frozendict.frozendict), + bytes: (UnsetAnyTypeSchema, bytes), + FileIO: (UnsetAnyTypeSchema, FileIO), + } + + @classmethod + def __get_new_cls( + cls, + arg, + validation_metadata: ValidationMetadata, + path_to_type: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Type] + ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Type['Schema']]: + """ + Make a new dynamic class and return an instance of that class + We are making an instance of cls, but instead of making cls + make a new class, new_cls + which includes dynamic bases including cls + return an instance of that new class + + Dict property + List Item Assignment Use cases: + 1. value is NOT an instance of the required schema class + the value is validated by _validate + _validate returns a key value pair + where the key is the path to the item, and the value will be the required manufactured class + made out of the matching schemas + 2. value is an instance of the correct schema type + the value is NOT validated by _validate, _validate only checks that the instance is of the correct schema type + for this value, _validate does NOT return an entry for it in _path_to_schemas + and in list/dict _get_items,_get_properties the value will be directly assigned + because value is of the correct type, and validation was run earlier when the instance was created + """ + _path_to_schemas = {} + if validation_metadata.validation_ran_earlier(cls): + add_deeper_validated_schemas(validation_metadata, _path_to_schemas) + else: + other_path_to_schemas = cls._validate(arg, validation_metadata=validation_metadata) + update(_path_to_schemas, other_path_to_schemas) + # loop through it make a new class for each entry + # do not modify the returned result because it is cached and we would be modifying the cached value + path_to_schemas = {} + for path, schema_classes in _path_to_schemas.items(): + """ + Use cases + 1. N number of schema classes + enum + type != bool/None, classes in path_to_schemas: tuple/frozendict.frozendict/str/Decimal/bytes/FileIo + needs Singleton added + 2. N number of schema classes + enum + type == bool/None, classes in path_to_schemas: BoolClass/NoneClass + Singleton already added + 3. N number of schema classes, classes in path_to_schemas: BoolClass/NoneClass/tuple/frozendict.frozendict/str/Decimal/bytes/FileIo + """ + cls._process_schema_classes(schema_classes) + enum_schema = any( + issubclass(this_cls, Schema) and hasattr(this_cls.Schema_, "enum_value_to_name") + for this_cls in schema_classes + ) + inheritable_primitive_type = schema_classes.intersection(cls.__inheritable_primitive_types_set) + chosen_schema_classes = schema_classes - inheritable_primitive_type + suffix = tuple(inheritable_primitive_type) + if enum_schema and suffix[0] not in {NoneClass, BoolClass}: + suffix = (Singleton,) + suffix + + used_classes = tuple(sorted(chosen_schema_classes, key=lambda a_cls: a_cls.__name__)) + suffix + mfg_cls = get_new_class(class_name='DynamicSchema', bases=used_classes) + path_to_schemas[path] = mfg_cls + + """ + For locations that validation did not check + the code still needs to mfg a class to hold those values + All of these classes will be based on UnsetAnyTypeSchema + """ + missing_paths = path_to_type.keys() - path_to_schemas.keys() + for missing_path in missing_paths: + value_type = path_to_type[missing_path] + bases = cls.__bases_by_type()[value_type] + mfg_cls = get_new_class(class_name='DynamicSchema', bases=bases) + path_to_schemas[missing_path] = mfg_cls + + return path_to_schemas + + @classmethod + def _get_new_instance_without_conversion( + cls, + arg: typing.Any, + path_to_item: typing.Tuple[typing.Union[str, int], ...], + path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Type['Schema']] + ): + # We have a Dynamic class and we are making an instance of it + if issubclass(cls, frozendict.frozendict) and issubclass(cls, DictBase): + properties = cls._get_properties(arg, path_to_item, path_to_schemas) + return super(Schema, cls).__new__(cls, properties) + elif issubclass(cls, tuple) and issubclass(cls, ListBase): + items = cls._get_items(arg, path_to_item, path_to_schemas) + return super(Schema, cls).__new__(cls, items) + """ + str = openapi str, datetime.date, and datetime.datetime + decimal.Decimal = openapi int and float + FileIO = openapi binary type and the user inputs a file + bytes = openapi binary type and the user inputs bytes + """ + return super(Schema, cls).__new__(cls, arg) + + @classmethod + def from_openapi_data_( + cls, + arg: typing.Union[ + str, + int, + float, + bool, + None, + dict, + list, + io.FileIO, + io.BufferedReader, + bytes + ], + configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None + ): + """ + Schema from_openapi_data_ + """ + from_server = True + validated_path_to_schemas = {} + path_to_type = {} + arg = cast_to_allowed_types(arg, from_server, validated_path_to_schemas, ('args[0]',), path_to_type) + validation_metadata = ValidationMetadata( + path_to_item=('args[0]',), + configuration=configuration_ or schema_configuration.SchemaConfiguration(), + validated_path_to_schemas=frozendict.frozendict(validated_path_to_schemas) + ) + path_to_schemas = cls.__get_new_cls(arg, validation_metadata, path_to_type) + new_cls = path_to_schemas[validation_metadata.path_to_item] + new_inst = new_cls._get_new_instance_without_conversion( + arg, + validation_metadata.path_to_item, + path_to_schemas + ) + return new_inst + + @staticmethod + def __get_input_dict(*args, **kwargs) -> frozendict.frozendict: + input_dict = {} + if args and isinstance(args[0], (dict, frozendict.frozendict)): + input_dict.update(args[0]) + if kwargs: + input_dict.update(kwargs) + return frozendict.frozendict(input_dict) + + @staticmethod + def __remove_unsets(kwargs): + return {key: val for key, val in kwargs.items() if val is not unset} + + def __new__( + cls, + *args_: typing.Union[ + dict, + frozendict.frozendict, + list, + tuple, + decimal.Decimal, + float, + int, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + bool, + None, + bytes, + io.FileIO, + io.BufferedReader, + 'Schema', ], + configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[ + dict, + frozendict.frozendict, + list, + tuple, + decimal.Decimal, + float, + int, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + bool, + None, + bytes, + io.FileIO, + io.BufferedReader, + 'Schema', Unset + ] + ): + """ + Schema __new__ + + Args: + args_ (int/float/decimal.Decimal/str/list/tuple/dict/frozendict.frozendict/bool/None): the value + kwargs (str, int/float/decimal.Decimal/str/list/tuple/dict/frozendict.frozendict/bool/None): dict values + configuration_: contains the schema_configuration.SchemaConfiguration that enables json schema validation keywords + like minItems, minLength etc + + Note: double underscores are used here because pycharm thinks that these variables + are instance properties if they are named normally :( + """ + __kwargs = cls.__remove_unsets(kwargs) + if not args_ and not __kwargs: + raise TypeError( + 'No input given. args or kwargs must be given.' + ) + if not __kwargs and args_ and not isinstance(args_[0], dict): + __arg = args_[0] + else: + __arg = cls.__get_input_dict(*args_, **__kwargs) + __from_server = False + __validated_path_to_schemas = {} + __path_to_type = {} + __arg = cast_to_allowed_types( + __arg, __from_server, __validated_path_to_schemas, ('args[0]',), __path_to_type) + __validation_metadata = ValidationMetadata( + path_to_item=('args[0]',), + configuration=configuration_ or schema_configuration.SchemaConfiguration(), + validated_path_to_schemas=frozendict.frozendict(__validated_path_to_schemas) + ) + __path_to_schemas = cls.__get_new_cls(__arg, __validation_metadata, __path_to_type) + __new_cls = __path_to_schemas[__validation_metadata.path_to_item] + return __new_cls._get_new_instance_without_conversion( + __arg, + __validation_metadata.path_to_item, + __path_to_schemas + ) + + +""" +import itertools +data_types = ('None', 'FrozenDict', 'Tuple', 'Str', 'Decimal', 'Bool') +type_to_cls = { + 'None': 'NoneClass', + 'FrozenDict': 'frozendict.frozendict', + 'Tuple': 'tuple', + 'Str': 'str', + 'Decimal': 'decimal.Decimal', + 'Bool': 'BoolClass' +} +cls_tuples = [v for v in itertools.combinations(data_types, 5)] +typed_classes = [f"class {''.join(cls_tuple)}Mixin({', '.join(type_to_cls[typ] for typ in cls_tuple)}):\n pass" for cls_tuple in cls_tuples] +for cls in typed_classes: + print(cls) +object_classes = [f"{''.join(cls_tuple)}Mixin = object" for cls_tuple in cls_tuples] +for cls in object_classes: + print(cls) +""" +if typing.TYPE_CHECKING: + # qty 1 + NoneMixin = NoneClass + FrozenDictMixin = frozendict.frozendict + TupleMixin = tuple + StrMixin = str + DecimalMixin = decimal.Decimal + BoolMixin = BoolClass + BytesMixin = bytes + FileMixin = FileIO + # qty 2 + class BinaryMixin(bytes, FileIO): + pass + class NoneFrozenDictMixin(NoneClass, frozendict.frozendict): + pass + class NoneTupleMixin(NoneClass, tuple): + pass + class NoneStrMixin(NoneClass, str): + pass + class NoneDecimalMixin(NoneClass, decimal.Decimal): + pass + class NoneBoolMixin(NoneClass, BoolClass): + pass + class FrozenDictTupleMixin(frozendict.frozendict, tuple): + pass + class FrozenDictStrMixin(frozendict.frozendict, str): + pass + class FrozenDictDecimalMixin(frozendict.frozendict, decimal.Decimal): + pass + class FrozenDictBoolMixin(frozendict.frozendict, BoolClass): + pass + class TupleStrMixin(tuple, str): + pass + class TupleDecimalMixin(tuple, decimal.Decimal): + pass + class TupleBoolMixin(tuple, BoolClass): + pass + class StrDecimalMixin(str, decimal.Decimal): + pass + class StrBoolMixin(str, BoolClass): + pass + class DecimalBoolMixin(decimal.Decimal, BoolClass): + pass + # qty 3 + class NoneFrozenDictTupleMixin(NoneClass, frozendict.frozendict, tuple): + pass + class NoneFrozenDictStrMixin(NoneClass, frozendict.frozendict, str): + pass + class NoneFrozenDictDecimalMixin(NoneClass, frozendict.frozendict, decimal.Decimal): + pass + class NoneFrozenDictBoolMixin(NoneClass, frozendict.frozendict, BoolClass): + pass + class NoneTupleStrMixin(NoneClass, tuple, str): + pass + class NoneTupleDecimalMixin(NoneClass, tuple, decimal.Decimal): + pass + class NoneTupleBoolMixin(NoneClass, tuple, BoolClass): + pass + class NoneStrDecimalMixin(NoneClass, str, decimal.Decimal): + pass + class NoneStrBoolMixin(NoneClass, str, BoolClass): + pass + class NoneDecimalBoolMixin(NoneClass, decimal.Decimal, BoolClass): + pass + class FrozenDictTupleStrMixin(frozendict.frozendict, tuple, str): + pass + class FrozenDictTupleDecimalMixin(frozendict.frozendict, tuple, decimal.Decimal): + pass + class FrozenDictTupleBoolMixin(frozendict.frozendict, tuple, BoolClass): + pass + class FrozenDictStrDecimalMixin(frozendict.frozendict, str, decimal.Decimal): + pass + class FrozenDictStrBoolMixin(frozendict.frozendict, str, BoolClass): + pass + class FrozenDictDecimalBoolMixin(frozendict.frozendict, decimal.Decimal, BoolClass): + pass + class TupleStrDecimalMixin(tuple, str, decimal.Decimal): + pass + class TupleStrBoolMixin(tuple, str, BoolClass): + pass + class TupleDecimalBoolMixin(tuple, decimal.Decimal, BoolClass): + pass + class StrDecimalBoolMixin(str, decimal.Decimal, BoolClass): + pass + # qty 4 + class NoneFrozenDictTupleStrMixin(NoneClass, frozendict.frozendict, tuple, str): + pass + class NoneFrozenDictTupleDecimalMixin(NoneClass, frozendict.frozendict, tuple, decimal.Decimal): + pass + class NoneFrozenDictTupleBoolMixin(NoneClass, frozendict.frozendict, tuple, BoolClass): + pass + class NoneFrozenDictStrDecimalMixin(NoneClass, frozendict.frozendict, str, decimal.Decimal): + pass + class NoneFrozenDictStrBoolMixin(NoneClass, frozendict.frozendict, str, BoolClass): + pass + class NoneFrozenDictDecimalBoolMixin(NoneClass, frozendict.frozendict, decimal.Decimal, BoolClass): + pass + class NoneTupleStrDecimalMixin(NoneClass, tuple, str, decimal.Decimal): + pass + class NoneTupleStrBoolMixin(NoneClass, tuple, str, BoolClass): + pass + class NoneTupleDecimalBoolMixin(NoneClass, tuple, decimal.Decimal, BoolClass): + pass + class NoneStrDecimalBoolMixin(NoneClass, str, decimal.Decimal, BoolClass): + pass + class FrozenDictTupleStrDecimalMixin(frozendict.frozendict, tuple, str, decimal.Decimal): + pass + class FrozenDictTupleStrBoolMixin(frozendict.frozendict, tuple, str, BoolClass): + pass + class FrozenDictTupleDecimalBoolMixin(frozendict.frozendict, tuple, decimal.Decimal, BoolClass): + pass + class FrozenDictStrDecimalBoolMixin(frozendict.frozendict, str, decimal.Decimal, BoolClass): + pass + class TupleStrDecimalBoolMixin(tuple, str, decimal.Decimal, BoolClass): + pass + # qty 5 + class NoneFrozenDictTupleStrDecimalMixin(NoneClass, frozendict.frozendict, tuple, str, decimal.Decimal): + pass + class NoneFrozenDictTupleStrBoolMixin(NoneClass, frozendict.frozendict, tuple, str, BoolClass): + pass + class NoneFrozenDictTupleDecimalBoolMixin(NoneClass, frozendict.frozendict, tuple, decimal.Decimal, BoolClass): + pass + class NoneFrozenDictStrDecimalBoolMixin(NoneClass, frozendict.frozendict, str, decimal.Decimal, BoolClass): + pass + class NoneTupleStrDecimalBoolMixin(NoneClass, tuple, str, decimal.Decimal, BoolClass): + pass + class FrozenDictTupleStrDecimalBoolMixin(frozendict.frozendict, tuple, str, decimal.Decimal, BoolClass): + pass + # qty 6 + class NoneFrozenDictTupleStrDecimalBoolMixin(NoneClass, frozendict.frozendict, tuple, str, decimal.Decimal, BoolClass): + pass + # qty 8 + class NoneFrozenDictTupleStrDecimalBoolFileBytesMixin(NoneClass, frozendict.frozendict, tuple, str, decimal.Decimal, BoolClass, FileIO, bytes): + pass +else: + # qty 1 + class NoneMixin: + pass + class FrozenDictMixin: + pass + class TupleMixin: + pass + class StrMixin: + pass + class DecimalMixin: + pass + class BoolMixin: + pass + class BytesMixin: + pass + class FileMixin: + pass + # qty 2 + class BinaryMixin: + pass + class NoneFrozenDictMixin: + pass + class NoneTupleMixin: + pass + class NoneStrMixin: + pass + class NoneDecimalMixin: + pass + class NoneBoolMixin: + pass + class FrozenDictTupleMixin: + pass + class FrozenDictStrMixin: + pass + class FrozenDictDecimalMixin: + pass + class FrozenDictBoolMixin: + pass + class TupleStrMixin: + pass + class TupleDecimalMixin: + pass + class TupleBoolMixin: + pass + class StrDecimalMixin: + pass + class StrBoolMixin: + pass + class DecimalBoolMixin: + pass + # qty 3 + class NoneFrozenDictTupleMixin: + pass + class NoneFrozenDictStrMixin: + pass + class NoneFrozenDictDecimalMixin: + pass + class NoneFrozenDictBoolMixin: + pass + class NoneTupleStrMixin: + pass + class NoneTupleDecimalMixin: + pass + class NoneTupleBoolMixin: + pass + class NoneStrDecimalMixin: + pass + class NoneStrBoolMixin: + pass + class NoneDecimalBoolMixin: + pass + class FrozenDictTupleStrMixin: + pass + class FrozenDictTupleDecimalMixin: + pass + class FrozenDictTupleBoolMixin: + pass + class FrozenDictStrDecimalMixin: + pass + class FrozenDictStrBoolMixin: + pass + class FrozenDictDecimalBoolMixin: + pass + class TupleStrDecimalMixin: + pass + class TupleStrBoolMixin: + pass + class TupleDecimalBoolMixin: + pass + class StrDecimalBoolMixin: + pass + # qty 4 + class NoneFrozenDictTupleStrMixin: + pass + class NoneFrozenDictTupleDecimalMixin: + pass + class NoneFrozenDictTupleBoolMixin: + pass + class NoneFrozenDictStrDecimalMixin: + pass + class NoneFrozenDictStrBoolMixin: + pass + class NoneFrozenDictDecimalBoolMixin: + pass + class NoneTupleStrDecimalMixin: + pass + class NoneTupleStrBoolMixin: + pass + class NoneTupleDecimalBoolMixin: + pass + class NoneStrDecimalBoolMixin: + pass + class FrozenDictTupleStrDecimalMixin: + pass + class FrozenDictTupleStrBoolMixin: + pass + class FrozenDictTupleDecimalBoolMixin: + pass + class FrozenDictStrDecimalBoolMixin: + pass + class TupleStrDecimalBoolMixin: + pass + # qty 5 + class NoneFrozenDictTupleStrDecimalMixin: + pass + class NoneFrozenDictTupleStrBoolMixin: + pass + class NoneFrozenDictTupleDecimalBoolMixin: + pass + class NoneFrozenDictStrDecimalBoolMixin: + pass + class NoneTupleStrDecimalBoolMixin: + pass + class FrozenDictTupleStrDecimalBoolMixin: + pass + # qty 6 + class NoneFrozenDictTupleStrDecimalBoolMixin: + pass + # qty 8 + class NoneFrozenDictTupleStrDecimalBoolFileBytesMixin: + pass + + +class BoolBase: + def is_true_(self) -> bool: + """ + A replacement for x is True + True if the instance is a BoolClass True Singleton + """ + if not issubclass(self.__class__, BoolClass): + return False + return bool(self) + + def is_false_(self) -> bool: + """ + A replacement for x is False + True if the instance is a BoolClass False Singleton + """ + if not issubclass(self.__class__, BoolClass): + return False + return bool(self) is False + + +class NoneBase: + def is_none_(self) -> bool: + """ + A replacement for x is None + True if the instance is a NoneClass None Singleton + """ + if issubclass(self.__class__, NoneClass): + return True + return False + + +class StrBase: + Schema_: SchemaTyped + + @property + def as_str_(self) -> str: + return self + + @property + def as_date_(self) -> datetime.date: + raise Exception('not implemented') + + @property + def as_datetime_(self) -> datetime.datetime: + raise Exception('not implemented') + + @property + def as_decimal_(self) -> decimal.Decimal: + raise Exception('not implemented') + + @property + def as_uuid_(self) -> uuid.UUID: + raise Exception('not implemented') + + +class UUIDBase: + @property + @functools.lru_cache() + def as_uuid_(self) -> uuid.UUID: + return uuid.UUID(self) + + +class DateBase: + @property + @functools.lru_cache() + def as_date_(self) -> datetime.date: + return DEFAULT_ISOPARSER.parse_isodate(self) + + +class DateTimeBase: + @property + @functools.lru_cache() + def as_datetime_(self) -> datetime.datetime: + return DEFAULT_ISOPARSER.parse_isodatetime(self) + + +class DecimalBase: + """ + A class for storing decimals that are sent over the wire as strings + These schemas must remain based on StrBase rather than NumberBase + because picking base classes must be deterministic + """ + + @property + @functools.lru_cache() + def as_decimal_(self) -> decimal.Decimal: + return decimal.Decimal(self) + + +class NumberBase: + Schema_: SchemaTyped + + @property + def as_int_(self) -> int: + try: + return self._as_int + except AttributeError: + """ + Note: for some numbers like 9.0 they could be represented as an + integer but our code chooses to store them as + >>> Decimal('9.0').as_tuple() + DecimalTuple(sign=0, digits=(9, 0), exponent=-1) + so we can tell that the value came from a float and convert it back to a float + during later serialization + """ + if self.as_tuple().exponent < 0: + # this could be represented as an integer but should be represented as a float + # because that's what it was serialized from + raise exceptions.ApiValueError(f'{self} is not an integer') + self._as_int = int(self) + return self._as_int + + @property + def as_float_(self) -> float: + try: + return self._as_float + except AttributeError: + if self.as_tuple().exponent >= 0: + raise exceptions.ApiValueError(f'{self} is not a float') + self._as_float = float(self) + return self._as_float + + +class ListBase: + Schema_: SchemaTyped + + @classmethod + def _get_items( + cls: 'Schema', + arg: typing.List[typing.Any], + path_to_item: typing.Tuple[typing.Union[str, int], ...], + path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Type['Schema']] + ): + ''' + ListBase _get_items + ''' + cast_items = [] + + for i, value in enumerate(arg): + item_path_to_item = path_to_item + (i,) + item_cls = path_to_schemas[item_path_to_item] + new_value = item_cls._get_new_instance_without_conversion( + value, + item_path_to_item, + path_to_schemas + ) + cast_items.append(new_value) + + return cast_items + + +class DictBase: + @classmethod + def _get_properties( + cls, + arg: typing.Dict[str, typing.Any], + path_to_item: typing.Tuple[typing.Union[str, int], ...], + path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Type['Schema']] + ): + """ + DictBase _get_properties, this is how properties are set + These values already passed validation + """ + dict_items = {} + + for property_name_js, value in arg.items(): + property_path_to_item = path_to_item + (property_name_js,) + property_cls = path_to_schemas[property_path_to_item] + new_value = property_cls._get_new_instance_without_conversion( + value, + property_path_to_item, + path_to_schemas + ) + dict_items[property_name_js] = new_value + + return dict_items + + def __setattr__(self, name: str, value: typing.Any): + if not isinstance(self, FileIO): + raise AttributeError('property setting not supported on immutable instances') + + def __getattr__(self, name: str): + """ + for instance.name access + Properties are only type hinted for required properties + so that hasattr(instance, 'optionalProp') is False when that key is not present + """ + if not isinstance(self, frozendict.frozendict): + return super().__getattr__(name) + if name not in self.__class__.__annotations__: + raise AttributeError(f"{self} has no attribute '{name}'") + try: + value = self[name] + return value + except KeyError as ex: + raise AttributeError(str(ex)) + + def get_item_(self, name: str) -> typing.Union['AnyTypeSchema', Unset]: + # dict_instance[name] accessor + if not isinstance(self, frozendict.frozendict): + raise NotImplementedError() + try: + return super().__getitem__(name) + except KeyError: + return unset + + +def cast_to_allowed_types( + arg: typing.Union[ + dict, + frozendict.frozendict, + list, + tuple, + decimal.Decimal, + float, + int, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + bool, + None, + bytes, + io.FileIO, + io.BufferedReader, + 'Schema', ], + from_server: bool, + validated_path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]], + path_to_item: typing.Tuple[typing.Union[str, int], ...], + path_to_type: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Type] +) -> typing.Union[ + frozendict.frozendict, + tuple, + decimal.Decimal, + str, + bytes, + BoolClass, + NoneClass, + FileIO]: + """ + Casts the input payload arg into the allowed types + The input validated_path_to_schemas is mutated by running this function + + When from_server is False then + - date/datetime is cast to str + - int/float is cast to Decimal + + If a Schema instance is passed in it is converted back to a primitive instance because + One may need to validate that data to the original Schema class AND additional different classes + those additional classes will need to be added to the new manufactured class for that payload + If the code didn't do this and kept the payload as a Schema instance it would fail to validate to other + Schema classes and the code wouldn't be able to mfg a new class that includes all valid schemas + TODO: store the validated schema classes in validation_metadata + + Args: + arg: the payload + from_server: whether this payload came from the server or not + validated_path_to_schemas: a dict that stores the validated classes at any path location in the payload + """ + if isinstance(arg, Schema) and not isinstance(arg, UnsetAnyTypeSchema): + """ + store the already run validations + but omit UnsetAnyTypeSchema instances because they were not validated + """ + schema_classes = set() + for cls in arg.__class__.__bases__: + if cls is Singleton: + # Skip Singleton + continue + schema_classes.add(cls) + validated_path_to_schemas[path_to_item] = schema_classes + + type_error = exceptions.ApiTypeError(f"Invalid type. Required value type is str and passed type was {type(arg)} at {path_to_item}") + if isinstance(arg, str): + path_to_type[path_to_item] = str + return str(arg) + elif isinstance(arg, (dict, frozendict.frozendict)): + path_to_type[path_to_item] = frozendict.frozendict + return frozendict.frozendict( + { + key: cast_to_allowed_types( + val, + from_server, + validated_path_to_schemas, + path_to_item + (key,), + path_to_type, + ) + for key, val in arg.items() + } + ) + elif isinstance(arg, (bool, BoolClass)): + path_to_type[path_to_item] = BoolClass + """ + this check must come before isinstance(arg, (int, float)) + because isinstance(True, int) is True + """ + if arg: + return BoolClass.TRUE + return BoolClass.FALSE + elif isinstance(arg, int): + path_to_type[path_to_item] = decimal.Decimal + return decimal.Decimal(arg) + elif isinstance(arg, float): + path_to_type[path_to_item] = decimal.Decimal + decimal_from_float = decimal.Decimal(arg) + if decimal_from_float.as_integer_ratio()[1] == 1: + # 9.0 -> Decimal('9.0') + # 3.4028234663852886e+38 -> Decimal('340282346638528859811704183484516925440.0') + return decimal.Decimal(str(decimal_from_float)+'.0') + return decimal_from_float + elif isinstance(arg, (tuple, list)): + path_to_type[path_to_item] = tuple + return tuple( + [ + cast_to_allowed_types( + item, + from_server, + validated_path_to_schemas, + path_to_item + (i,), + path_to_type, + ) + for i, item in enumerate(arg) + ] + ) + elif isinstance(arg, (none_type_, NoneClass)): + path_to_type[path_to_item] = NoneClass + return NoneClass.NONE + elif isinstance(arg, (datetime.date, datetime.datetime)): + path_to_type[path_to_item] = str + if not from_server: + return arg.isoformat() + raise type_error + elif isinstance(arg, uuid.UUID): + path_to_type[path_to_item] = str + if not from_server: + return str(arg) + raise type_error + elif isinstance(arg, decimal.Decimal): + path_to_type[path_to_item] = decimal.Decimal + return decimal.Decimal(arg) + elif isinstance(arg, bytes): + path_to_type[path_to_item] = bytes + return bytes(arg) + elif isinstance(arg, (io.FileIO, io.BufferedReader)): + path_to_type[path_to_item] = FileIO + return FileIO(arg) + raise ValueError('Invalid type passed in got input={} type={}'.format(arg, type(arg))) + + +class ListSchema( + ListBase, + Schema, + TupleMixin +): + class Schema_: + types = {tuple} + + @classmethod + def from_openapi_data_(cls, arg: typing.List[typing.Any], configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): + return super().from_openapi_data_(arg, configuration_=configuration_) + + def __new__(cls, arg_: typing.Union[typing.List[typing.Any], typing.Tuple[typing.Any]], **kwargs: schema_configuration.SchemaConfiguration): + return super().__new__(cls, arg_, **kwargs) + + +class NoneSchema( + NoneBase, + Schema, + NoneMixin +): + class Schema_: + types = {NoneClass} + + @classmethod + def from_openapi_data_(cls, arg: None, configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): + return super().from_openapi_data_(arg, configuration_=configuration_) + + def __new__(cls, arg_: None, **kwargs: schema_configuration.SchemaConfiguration): + return super().__new__(cls, arg_, **kwargs) + + +class NumberSchema( + NumberBase, + Schema, + DecimalMixin +): + """ + This is used for type: number with no format + Both integers AND floats are accepted + """ + class Schema_: + types = {decimal.Decimal} + + @classmethod + def from_openapi_data_(cls, arg: typing.Union[int, float], configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): + return super().from_openapi_data_(arg, configuration_=configuration_) + + def __new__(cls, arg_: typing.Union[decimal.Decimal, int, float], **kwargs: schema_configuration.SchemaConfiguration): + return super().__new__(cls, arg_, **kwargs) + + +class IntBase: + @property + def as_int_(self) -> int: + try: + return self._as_int + except AttributeError: + self._as_int = int(self) + return self._as_int + + +class IntSchema(IntBase, NumberSchema): + class Schema_: + types = {decimal.Decimal} + format = 'int' + + @classmethod + def from_openapi_data_(cls, arg: int, configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): + return super().from_openapi_data_(arg, configuration_=configuration_) + + def __new__(cls, arg_: typing.Union[decimal.Decimal, int], **kwargs: schema_configuration.SchemaConfiguration): + return super().__new__(cls, arg_, **kwargs) + + +class Int32Schema( + IntSchema +): + class Schema_: + types = {decimal.Decimal} + format = 'int32' + + +class Int64Schema( + IntSchema +): + class Schema_: + types = {decimal.Decimal} + format = 'int64' + + +class Float32Schema( + NumberSchema +): + class Schema_: + types = {decimal.Decimal} + format = 'float' + + @classmethod + def from_openapi_data_(cls, arg: float, configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): + return super().from_openapi_data_(arg, configuration_=configuration_) + + +class Float64Schema( + NumberSchema +): + class Schema_: + types = {decimal.Decimal} + format = 'double' + + @classmethod + def from_openapi_data_(cls, arg: float, configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): + return super().from_openapi_data_(arg, configuration_=configuration_) + + +class StrSchema( + StrBase, + Schema, + StrMixin +): + """ + date + datetime string types must inherit from this class + That is because one can validate a str payload as both: + - type: string (format unset) + - type: string, format: date + """ + class Schema_: + types = {str} + + @classmethod + def from_openapi_data_(cls, arg: str, configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None) -> 'StrSchema': + return super().from_openapi_data_(arg, configuration_=configuration_) + + def __new__(cls, arg_: typing.Union[str, datetime.date, datetime.datetime, uuid.UUID], **kwargs: schema_configuration.SchemaConfiguration): + return super().__new__(cls, arg_, **kwargs) + + +class UUIDSchema(UUIDBase, StrSchema): + class Schema_: + types = {str} + format = 'uuid' + + def __new__(cls, arg_: typing.Union[str, uuid.UUID], **kwargs: schema_configuration.SchemaConfiguration): + return super().__new__(cls, arg_, **kwargs) + + +class DateSchema(DateBase, StrSchema): + class Schema_: + types = {str} + format = 'date' + + def __new__(cls, arg_: typing.Union[str, datetime.date], **kwargs: schema_configuration.SchemaConfiguration): + return super().__new__(cls, arg_, **kwargs) + + +class DateTimeSchema(DateTimeBase, StrSchema): + class Schema_: + types = {str} + format = 'date-time' + + def __new__(cls, arg_: typing.Union[str, datetime.datetime], **kwargs: schema_configuration.SchemaConfiguration): + return super().__new__(cls, arg_, **kwargs) + + +class DecimalSchema(DecimalBase, StrSchema): + class Schema_: + types = {str} + format = 'number' + + def __new__(cls, arg_: str, **kwargs: schema_configuration.SchemaConfiguration): + """ + Note: Decimals may not be passed in because cast_to_allowed_types is only invoked once for payloads + which can be simple (str) or complex (dicts or lists with nested values) + Because casting is only done once and recursively casts all values prior to validation then for a potential + client side Decimal input if Decimal was accepted as an input in DecimalSchema then one would not know + if one was using it for a StrSchema (where it should be cast to str) or one is using it for NumberSchema + where it should stay as Decimal. + """ + return super().__new__(cls, arg_, **kwargs) + + +class BytesSchema( + Schema, + BytesMixin +): + """ + this class will subclass bytes and is immutable + """ + class Schema_: + types = {bytes} + + def __new__(cls, arg_: bytes, **kwargs: schema_configuration.SchemaConfiguration): + return super(Schema, cls).__new__(cls, arg_) + + +class FileSchema( + Schema, + FileMixin +): + """ + This class is NOT immutable + Dynamic classes are built using it for example when AnyType allows in binary data + Al other schema classes ARE immutable + If one wanted to make this immutable one could make this a DictSchema with required properties: + - data = BytesSchema (which would be an immutable bytes based schema) + - file_name = StrSchema + and cast_to_allowed_types would convert bytes and file instances into dicts containing data + file_name + The downside would be that data would be stored in memory which one may not want to do for very large files + + The developer is responsible for closing this file and deleting it + + This class was kept as mutable: + - to allow file reading and writing to disk + - to be able to preserve file name info + """ + class Schema_: + types = {FileIO} + + def __new__(cls, arg_: typing.Union[io.FileIO, io.BufferedReader], **kwargs: schema_configuration.SchemaConfiguration): + return super(Schema, cls).__new__(cls, arg_) + + +class BinarySchema( + Schema, + BinaryMixin +): + class Schema_: + types = {FileIO, bytes} + format = 'binary' + + class OneOf: + classes = [ + BytesSchema, + FileSchema, + ] + + def __new__(cls, arg_: typing.Union[io.FileIO, io.BufferedReader, bytes], **kwargs: schema_configuration.SchemaConfiguration): + return super().__new__(cls, arg_) + + +class BoolSchema( + BoolBase, + Schema, + BoolMixin +): + class Schema_: + types = {BoolClass} + + @classmethod + def from_openapi_data_(cls, arg: bool, configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): + return super().from_openapi_data_(arg, configuration_=configuration_) + + def __new__(cls, arg_: bool, **kwargs: ValidationMetadata): + return super().__new__(cls, arg_, **kwargs) + + +class AnyTypeSchema( + NoneBase, + DictBase, + ListBase, + StrBase, + NumberBase, + BoolBase, + Schema, + NoneFrozenDictTupleStrDecimalBoolFileBytesMixin +): + # Python representation of a schema defined as true or {} + class Schema_: + pass + + +class UnsetAnyTypeSchema(AnyTypeSchema): + # Used when additionalProperties/items was not explicitly defined and a defining schema is needed + pass + + +class NotAnyTypeSchema(AnyTypeSchema): + """ + Python representation of a schema defined as false or {'not': {}} + Does not allow inputs in of AnyType + Note: validations on this class are never run because the code knows that no inputs will ever validate + """ + + class Schema_: + _not = AnyTypeSchema + + def __new__( + cls, + *args_, + configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None, + ) -> 'NotAnyTypeSchema': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + ) + + +class DictSchema( + DictBase, + Schema, + FrozenDictMixin +): + class Schema_: + types = {frozendict.frozendict} + + @classmethod + def from_openapi_data_(cls, arg: typing.Dict[str, typing.Any], configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): + return super().from_openapi_data_(arg, configuration_=configuration_) + + def __new__(cls, *args_: typing.Union[dict, frozendict.frozendict], **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, bool, None, bytes, Schema, Unset, ValidationMetadata]): + return super().__new__(cls, *args_, **kwargs) + + +schema_type_classes = {NoneSchema, DictSchema, ListSchema, NumberSchema, StrSchema, BoolSchema, AnyTypeSchema} + + +@functools.lru_cache() +def get_new_class( + class_name: str, + bases: typing.Tuple[typing.Type[typing.Union[Schema, typing.Any]], ...] +) -> typing.Type[Schema]: + """ + Returns a new class that is made with the subclass bases + """ + new_cls: typing.Type[Schema] = type(class_name, bases, {}) + return new_cls + + +LOG_CACHE_USAGE = False + + +def log_cache_usage(cache_fn): + if LOG_CACHE_USAGE: + print(cache_fn.__name__, cache_fn.cache_info()) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/security_schemes.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/security_schemes.py new file mode 100644 index 00000000000..0c37d7c17a5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/security_schemes.py @@ -0,0 +1,221 @@ +# coding: utf-8 +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import abc +import base64 +import dataclasses +import enum +import typing +import typing_extensions + +from urllib3 import _collections + + +class SecuritySchemeType(enum.Enum): + API_KEY = 'apiKey' + HTTP = 'http' + MUTUAL_TLS = 'mutualTLS' + OAUTH_2 = 'oauth2' + OPENID_CONNECT = 'openIdConnect' + + +class ApiKeyInLocation(enum.Enum): + QUERY = 'query' + HEADER = 'header' + COOKIE = 'cookie' + + +class __SecuritySchemeBase(metaclass=abc.ABCMeta): + @abc.abstractmethod + def apply_auth( + self, + headers: _collections.HTTPHeaderDict, + resource_path: str, + method: str, + body: typing.Optional[typing.Union[str, bytes]], + scope_names: typing.Tuple[str] = (), + ) -> None: + pass + + +@dataclasses.dataclass +class ApiKeySecurityScheme(__SecuritySchemeBase, abc.ABC): + api_key: str # this must be set by the developer + name: str = '' + in_location: ApiKeyInLocation = ApiKeyInLocation.QUERY + type: SecuritySchemeType = SecuritySchemeType.API_KEY + + def apply_auth( + self, + headers: _collections.HTTPHeaderDict, + resource_path: str, + method: str, + body: typing.Optional[typing.Union[str, bytes]], + scope_names: typing.Tuple[str] = (), + ) -> None: + if self.in_location is ApiKeyInLocation.COOKIE: + headers.add('Cookie', self.api_key) + elif self.in_location is ApiKeyInLocation.HEADER: + headers.add(self.name, self.api_key) + elif self.in_location is ApiKeyInLocation.QUERY: + # todo add query handling + raise NotImplementedError("ApiKeySecurityScheme in query not yet implemented") + return + + +class HTTPSchemeType(enum.Enum): + BASIC = 'basic' + BEARER = 'bearer' + DIGEST = 'digest' + SIGNATURE = 'signature' # https://datatracker.ietf.org/doc/draft-cavage-http-signatures/ + + +@dataclasses.dataclass +class HTTPBasicSecurityScheme(__SecuritySchemeBase): + user_id: str # user name + password: str + scheme: HTTPSchemeType = HTTPSchemeType.BASIC + encoding: str = 'utf-8' + type: SecuritySchemeType = SecuritySchemeType.HTTP + """ + https://www.rfc-editor.org/rfc/rfc7617.html + """ + + def apply_auth( + self, + headers: _collections.HTTPHeaderDict, + resource_path: str, + method: str, + body: typing.Optional[typing.Union[str, bytes]], + scope_names: typing.Tuple[str] = (), + ) -> None: + user_pass = f"{self.user_id}:{self.password}" + b64_user_pass = base64.b64encode(user_pass.encode(encoding=self.encoding)) + headers.add('Authorization', f"Basic {b64_user_pass.decode()}") + + +@dataclasses.dataclass +class HTTPBearerSecurityScheme(__SecuritySchemeBase): + access_token: str + bearer_format: typing.Optional[str] = None + scheme: HTTPSchemeType = HTTPSchemeType.BEARER + type: SecuritySchemeType = SecuritySchemeType.HTTP + + def apply_auth( + self, + headers: _collections.HTTPHeaderDict, + resource_path: str, + method: str, + body: typing.Optional[typing.Union[str, bytes]], + scope_names: typing.Tuple[str] = (), + ) -> None: + headers.add('Authorization', f"Bearer {self.access_token}") + + +@dataclasses.dataclass +class HTTPDigestSecurityScheme(__SecuritySchemeBase): + scheme: HTTPSchemeType = HTTPSchemeType.DIGEST + type: SecuritySchemeType = SecuritySchemeType.HTTP + + def apply_auth( + self, + headers: _collections.HTTPHeaderDict, + resource_path: str, + method: str, + body: typing.Optional[typing.Union[str, bytes]], + scope_names: typing.Tuple[str] = (), + ) -> None: + raise NotImplementedError("HTTPDigestSecurityScheme not yet implemented") + + +@dataclasses.dataclass +class MutualTLSSecurityScheme(__SecuritySchemeBase): + type: SecuritySchemeType = SecuritySchemeType.MUTUAL_TLS + + def apply_auth( + self, + headers: _collections.HTTPHeaderDict, + resource_path: str, + method: str, + body: typing.Optional[typing.Union[str, bytes]], + scope_names: typing.Tuple[str] = (), + ) -> None: + raise NotImplementedError("MutualTLSSecurityScheme not yet implemented") + + +@dataclasses.dataclass +class ImplicitOAuthFlow: + authorization_url: str + scopes: typing.Dict[str, str] + refresh_url: typing.Optional[str] = None + + +@dataclasses.dataclass +class TokenUrlOauthFlow: + token_url: str + scopes: typing.Dict[str, str] + refresh_url: typing.Optional[str] = None + + +@dataclasses.dataclass +class AuthorizationCodeOauthFlow: + authorization_url: str + token_url: str + scopes: typing.Dict[str, str] + refresh_url: typing.Optional[str] = None + + +@dataclasses.dataclass +class OAuthFlows: + implicit: typing.Optional[ImplicitOAuthFlow] = None + password: typing.Optional[TokenUrlOauthFlow] = None + client_credentials: typing.Optional[TokenUrlOauthFlow] = None + authorization_code: typing.Optional[AuthorizationCodeOauthFlow] = None + + +class OAuth2SecurityScheme(__SecuritySchemeBase, abc.ABC): + flows: OAuthFlows + type: SecuritySchemeType = SecuritySchemeType.OAUTH_2 + + def apply_auth( + self, + headers: _collections.HTTPHeaderDict, + resource_path: str, + method: str, + body: typing.Optional[typing.Union[str, bytes]], + scope_names: typing.Tuple[str] = (), + ) -> None: + raise NotImplementedError("OAuth2SecurityScheme not yet implemented") + + +class OpenIdConnectSecurityScheme(__SecuritySchemeBase, abc.ABC): + openid_connect_url: str + type: SecuritySchemeType = SecuritySchemeType.OPENID_CONNECT + + def apply_auth( + self, + headers: _collections.HTTPHeaderDict, + resource_path: str, + method: str, + body: typing.Optional[typing.Union[str, bytes]], + scope_names: typing.Tuple[str] = (), + ) -> None: + raise NotImplementedError("OpenIdConnectSecurityScheme not yet implemented") + +""" +Key is the Security scheme class +Value is the list of scopes +""" +SecurityRequirementObject = typing_extensions.TypedDict( + 'SecurityRequirementObject', + { + }, + total=False +) \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/server.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/server.py new file mode 100644 index 00000000000..451baa7495b --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/server.py @@ -0,0 +1,37 @@ +# coding: utf-8 +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import abc +import dataclasses +import typing + + +@dataclasses.dataclass +class Server(abc.ABC): + _url: str + variables: typing.Optional[typing.Dict[str, str]] = None + variable_schemas: typing.Optional[typing.Dict[str, typing.Type['schemas.Schema']]] = None + url: str = dataclasses.field(init=False) + + def __post_init__(self): + if not self.variable_schemas: + self.url = self._url + return + url = self._url + for (key, schema) in self.variable_schemas.items(): + if self.variables and key in self.variables: + value = self.variables[key] + cast_value = schema(value) + else: + cast_value = schema.Schema_.default + url = url.replace("{" + key + "}", cast_value) + self.url = url + +from unit_test_api import schemas diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/servers/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/servers/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/servers/server_0.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/servers/server_0.py new file mode 100644 index 00000000000..50f336c9461 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/servers/server_0.py @@ -0,0 +1,16 @@ +# coding: utf-8 +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import typing + +from unit_test_api import server + + +@dataclasses.dataclass +class Server0(server.Server): + _url: str = "https://someserver.com/v1" diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test-requirements.txt b/samples/openapi3/client/3_0_3_unit_test/python/test-requirements.txt index 2d88b034192..3043888202a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test-requirements.txt +++ b/samples/openapi3/client/3_0_3_unit_test/python/test-requirements.txt @@ -1,3 +1,2 @@ -pytest~=4.6.7 # needed for python 3.4 -pytest-cov>=2.8.1 -pytest-randomly==1.2.3 # needed for python 3.4 +pytest ~= 7.2.0 +pytest-cov ~= 4.0.0 diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test__not.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test__not.py new file mode 100644 index 00000000000..bbb7d32ed78 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test__not.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema._not import _Not +from unit_test_api import configuration + + +class Test_Not(unittest.TestCase): + """_Not unit test stubs""" + configuration_ = configuration.Configuration() + + def test_allowed_passes(self): + # allowed + _Not.from_openapi_data_( + "foo", + configuration_=self.configuration_ + ) + + def test_disallowed_fails(self): + # disallowed + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + _Not.from_openapi_data_( + 1, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_additionalproperties_allows_a_schema_which_should_validate.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_additionalproperties_allows_a_schema_which_should_validate.py similarity index 76% rename from samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_additionalproperties_allows_a_schema_which_should_validate.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_additionalproperties_allows_a_schema_which_should_validate.py index b946a7840f2..d0ce12be1db 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_additionalproperties_allows_a_schema_which_should_validate.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_additionalproperties_allows_a_schema_which_should_validate.py @@ -6,34 +6,34 @@ sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest import unit_test_api -from unit_test_api.model.additionalproperties_allows_a_schema_which_should_validate import AdditionalpropertiesAllowsASchemaWhichShouldValidate +from unit_test_api.components.schema.additionalproperties_allows_a_schema_which_should_validate import AdditionalpropertiesAllowsASchemaWhichShouldValidate from unit_test_api import configuration class TestAdditionalpropertiesAllowsASchemaWhichShouldValidate(unittest.TestCase): """AdditionalpropertiesAllowsASchemaWhichShouldValidate unit test stubs""" - _configuration = configuration.Configuration() + configuration_ = configuration.Configuration() def test_no_additional_properties_is_valid_passes(self): # no additional properties is valid - AdditionalpropertiesAllowsASchemaWhichShouldValidate.from_openapi_data_oapg( + AdditionalpropertiesAllowsASchemaWhichShouldValidate.from_openapi_data_( { "foo": 1, }, - _configuration=self._configuration + configuration_=self.configuration_ ) def test_an_additional_invalid_property_is_invalid_fails(self): # an additional invalid property is invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - AdditionalpropertiesAllowsASchemaWhichShouldValidate.from_openapi_data_oapg( + AdditionalpropertiesAllowsASchemaWhichShouldValidate.from_openapi_data_( { "foo": 1, @@ -42,12 +42,12 @@ def test_an_additional_invalid_property_is_invalid_fails(self): "quux": 12, }, - _configuration=self._configuration + configuration_=self.configuration_ ) def test_an_additional_valid_property_is_valid_passes(self): # an additional valid property is valid - AdditionalpropertiesAllowsASchemaWhichShouldValidate.from_openapi_data_oapg( + AdditionalpropertiesAllowsASchemaWhichShouldValidate.from_openapi_data_( { "foo": 1, @@ -56,7 +56,7 @@ def test_an_additional_valid_property_is_valid_passes(self): "quux": True, }, - _configuration=self._configuration + configuration_=self.configuration_ ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_additionalproperties_are_allowed_by_default.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_additionalproperties_are_allowed_by_default.py new file mode 100644 index 00000000000..8709b7d9db1 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_additionalproperties_are_allowed_by_default.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.additionalproperties_are_allowed_by_default import AdditionalpropertiesAreAllowedByDefault +from unit_test_api import configuration + + +class TestAdditionalpropertiesAreAllowedByDefault(unittest.TestCase): + """AdditionalpropertiesAreAllowedByDefault unit test stubs""" + configuration_ = configuration.Configuration() + + def test_additional_properties_are_allowed_passes(self): + # additional properties are allowed + AdditionalpropertiesAreAllowedByDefault.from_openapi_data_( + { + "foo": + 1, + "bar": + 2, + "quux": + True, + }, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_additionalproperties_can_exist_by_itself.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_additionalproperties_can_exist_by_itself.py new file mode 100644 index 00000000000..eed4d864085 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_additionalproperties_can_exist_by_itself.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.additionalproperties_can_exist_by_itself import AdditionalpropertiesCanExistByItself +from unit_test_api import configuration + + +class TestAdditionalpropertiesCanExistByItself(unittest.TestCase): + """AdditionalpropertiesCanExistByItself unit test stubs""" + configuration_ = configuration.Configuration() + + def test_an_additional_invalid_property_is_invalid_fails(self): + # an additional invalid property is invalid + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + AdditionalpropertiesCanExistByItself.from_openapi_data_( + { + "foo": + 1, + }, + configuration_=self.configuration_ + ) + + def test_an_additional_valid_property_is_valid_passes(self): + # an additional valid property is valid + AdditionalpropertiesCanExistByItself.from_openapi_data_( + { + "foo": + True, + }, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_additionalproperties_should_not_look_in_applicators.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_additionalproperties_should_not_look_in_applicators.py new file mode 100644 index 00000000000..27eaf50edd4 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_additionalproperties_should_not_look_in_applicators.py @@ -0,0 +1,50 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.additionalproperties_should_not_look_in_applicators import AdditionalpropertiesShouldNotLookInApplicators +from unit_test_api import configuration + + +class TestAdditionalpropertiesShouldNotLookInApplicators(unittest.TestCase): + """AdditionalpropertiesShouldNotLookInApplicators unit test stubs""" + configuration_ = configuration.Configuration() + + def test_properties_defined_in_allof_are_not_examined_fails(self): + # properties defined in allOf are not examined + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + AdditionalpropertiesShouldNotLookInApplicators.from_openapi_data_( + { + "foo": + 1, + "bar": + True, + }, + configuration_=self.configuration_ + ) + + def test_valid_test_case_passes(self): + # valid test case + AdditionalpropertiesShouldNotLookInApplicators.from_openapi_data_( + { + "foo": + False, + "bar": + True, + }, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_allof.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_allof.py new file mode 100644 index 00000000000..eb16ed0282a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_allof.py @@ -0,0 +1,72 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.allof import Allof +from unit_test_api import configuration + + +class TestAllof(unittest.TestCase): + """Allof unit test stubs""" + configuration_ = configuration.Configuration() + + def test_allof_passes(self): + # allOf + Allof.from_openapi_data_( + { + "foo": + "baz", + "bar": + 2, + }, + configuration_=self.configuration_ + ) + + def test_mismatch_first_fails(self): + # mismatch first + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + Allof.from_openapi_data_( + { + "bar": + 2, + }, + configuration_=self.configuration_ + ) + + def test_mismatch_second_fails(self): + # mismatch second + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + Allof.from_openapi_data_( + { + "foo": + "baz", + }, + configuration_=self.configuration_ + ) + + def test_wrong_type_fails(self): + # wrong type + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + Allof.from_openapi_data_( + { + "foo": + "baz", + "bar": + "quux", + }, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_allof_combined_with_anyof_oneof.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_allof_combined_with_anyof_oneof.py new file mode 100644 index 00000000000..bf527f8361a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_allof_combined_with_anyof_oneof.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.allof_combined_with_anyof_oneof import AllofCombinedWithAnyofOneof +from unit_test_api import configuration + + +class TestAllofCombinedWithAnyofOneof(unittest.TestCase): + """AllofCombinedWithAnyofOneof unit test stubs""" + configuration_ = configuration.Configuration() + + def test_allof_true_anyof_false_oneof_false_fails(self): + # allOf: true, anyOf: false, oneOf: false + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + AllofCombinedWithAnyofOneof.from_openapi_data_( + 2, + configuration_=self.configuration_ + ) + + def test_allof_false_anyof_false_oneof_true_fails(self): + # allOf: false, anyOf: false, oneOf: true + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + AllofCombinedWithAnyofOneof.from_openapi_data_( + 5, + configuration_=self.configuration_ + ) + + def test_allof_false_anyof_true_oneof_true_fails(self): + # allOf: false, anyOf: true, oneOf: true + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + AllofCombinedWithAnyofOneof.from_openapi_data_( + 15, + configuration_=self.configuration_ + ) + + def test_allof_true_anyof_true_oneof_false_fails(self): + # allOf: true, anyOf: true, oneOf: false + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + AllofCombinedWithAnyofOneof.from_openapi_data_( + 6, + configuration_=self.configuration_ + ) + + def test_allof_true_anyof_true_oneof_true_passes(self): + # allOf: true, anyOf: true, oneOf: true + AllofCombinedWithAnyofOneof.from_openapi_data_( + 30, + configuration_=self.configuration_ + ) + + def test_allof_true_anyof_false_oneof_true_fails(self): + # allOf: true, anyOf: false, oneOf: true + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + AllofCombinedWithAnyofOneof.from_openapi_data_( + 10, + configuration_=self.configuration_ + ) + + def test_allof_false_anyof_true_oneof_false_fails(self): + # allOf: false, anyOf: true, oneOf: false + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + AllofCombinedWithAnyofOneof.from_openapi_data_( + 3, + configuration_=self.configuration_ + ) + + def test_allof_false_anyof_false_oneof_false_fails(self): + # allOf: false, anyOf: false, oneOf: false + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + AllofCombinedWithAnyofOneof.from_openapi_data_( + 1, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_allof_simple_types.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_allof_simple_types.py new file mode 100644 index 00000000000..016d4576f0e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_allof_simple_types.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.allof_simple_types import AllofSimpleTypes +from unit_test_api import configuration + + +class TestAllofSimpleTypes(unittest.TestCase): + """AllofSimpleTypes unit test stubs""" + configuration_ = configuration.Configuration() + + def test_valid_passes(self): + # valid + AllofSimpleTypes.from_openapi_data_( + 25, + configuration_=self.configuration_ + ) + + def test_mismatch_one_fails(self): + # mismatch one + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + AllofSimpleTypes.from_openapi_data_( + 35, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_allof_with_base_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_allof_with_base_schema.py new file mode 100644 index 00000000000..48715e20dcd --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_allof_with_base_schema.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.allof_with_base_schema import AllofWithBaseSchema +from unit_test_api import configuration + + +class TestAllofWithBaseSchema(unittest.TestCase): + """AllofWithBaseSchema unit test stubs""" + configuration_ = configuration.Configuration() + + def test_valid_passes(self): + # valid + AllofWithBaseSchema.from_openapi_data_( + { + "foo": + "quux", + "bar": + 2, + "baz": + None, + }, + configuration_=self.configuration_ + ) + + def test_mismatch_first_allof_fails(self): + # mismatch first allOf + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + AllofWithBaseSchema.from_openapi_data_( + { + "bar": + 2, + "baz": + None, + }, + configuration_=self.configuration_ + ) + + def test_mismatch_base_schema_fails(self): + # mismatch base schema + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + AllofWithBaseSchema.from_openapi_data_( + { + "foo": + "quux", + "baz": + None, + }, + configuration_=self.configuration_ + ) + + def test_mismatch_both_fails(self): + # mismatch both + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + AllofWithBaseSchema.from_openapi_data_( + { + "bar": + 2, + }, + configuration_=self.configuration_ + ) + + def test_mismatch_second_allof_fails(self): + # mismatch second allOf + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + AllofWithBaseSchema.from_openapi_data_( + { + "foo": + "quux", + "bar": + 2, + }, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_allof_with_one_empty_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_allof_with_one_empty_schema.py new file mode 100644 index 00000000000..5244f65e2ce --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_allof_with_one_empty_schema.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.allof_with_one_empty_schema import AllofWithOneEmptySchema +from unit_test_api import configuration + + +class TestAllofWithOneEmptySchema(unittest.TestCase): + """AllofWithOneEmptySchema unit test stubs""" + configuration_ = configuration.Configuration() + + def test_any_data_is_valid_passes(self): + # any data is valid + AllofWithOneEmptySchema.from_openapi_data_( + 1, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_allof_with_the_first_empty_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_allof_with_the_first_empty_schema.py new file mode 100644 index 00000000000..0fbeda18acf --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_allof_with_the_first_empty_schema.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.allof_with_the_first_empty_schema import AllofWithTheFirstEmptySchema +from unit_test_api import configuration + + +class TestAllofWithTheFirstEmptySchema(unittest.TestCase): + """AllofWithTheFirstEmptySchema unit test stubs""" + configuration_ = configuration.Configuration() + + def test_string_is_invalid_fails(self): + # string is invalid + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + AllofWithTheFirstEmptySchema.from_openapi_data_( + "foo", + configuration_=self.configuration_ + ) + + def test_number_is_valid_passes(self): + # number is valid + AllofWithTheFirstEmptySchema.from_openapi_data_( + 1, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_allof_with_the_last_empty_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_allof_with_the_last_empty_schema.py new file mode 100644 index 00000000000..6269c24cd45 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_allof_with_the_last_empty_schema.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.allof_with_the_last_empty_schema import AllofWithTheLastEmptySchema +from unit_test_api import configuration + + +class TestAllofWithTheLastEmptySchema(unittest.TestCase): + """AllofWithTheLastEmptySchema unit test stubs""" + configuration_ = configuration.Configuration() + + def test_string_is_invalid_fails(self): + # string is invalid + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + AllofWithTheLastEmptySchema.from_openapi_data_( + "foo", + configuration_=self.configuration_ + ) + + def test_number_is_valid_passes(self): + # number is valid + AllofWithTheLastEmptySchema.from_openapi_data_( + 1, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_allof_with_two_empty_schemas.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_allof_with_two_empty_schemas.py new file mode 100644 index 00000000000..804c23dec52 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_allof_with_two_empty_schemas.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.allof_with_two_empty_schemas import AllofWithTwoEmptySchemas +from unit_test_api import configuration + + +class TestAllofWithTwoEmptySchemas(unittest.TestCase): + """AllofWithTwoEmptySchemas unit test stubs""" + configuration_ = configuration.Configuration() + + def test_any_data_is_valid_passes(self): + # any data is valid + AllofWithTwoEmptySchemas.from_openapi_data_( + 1, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_anyof.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_anyof.py new file mode 100644 index 00000000000..da1014d45e9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_anyof.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.anyof import Anyof +from unit_test_api import configuration + + +class TestAnyof(unittest.TestCase): + """Anyof unit test stubs""" + configuration_ = configuration.Configuration() + + def test_second_anyof_valid_passes(self): + # second anyOf valid + Anyof.from_openapi_data_( + 2.5, + configuration_=self.configuration_ + ) + + def test_neither_anyof_valid_fails(self): + # neither anyOf valid + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + Anyof.from_openapi_data_( + 1.5, + configuration_=self.configuration_ + ) + + def test_both_anyof_valid_passes(self): + # both anyOf valid + Anyof.from_openapi_data_( + 3, + configuration_=self.configuration_ + ) + + def test_first_anyof_valid_passes(self): + # first anyOf valid + Anyof.from_openapi_data_( + 1, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_anyof_complex_types.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_anyof_complex_types.py new file mode 100644 index 00000000000..0c4891de94c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_anyof_complex_types.py @@ -0,0 +1,70 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.anyof_complex_types import AnyofComplexTypes +from unit_test_api import configuration + + +class TestAnyofComplexTypes(unittest.TestCase): + """AnyofComplexTypes unit test stubs""" + configuration_ = configuration.Configuration() + + def test_second_anyof_valid_complex_passes(self): + # second anyOf valid (complex) + AnyofComplexTypes.from_openapi_data_( + { + "foo": + "baz", + }, + configuration_=self.configuration_ + ) + + def test_neither_anyof_valid_complex_fails(self): + # neither anyOf valid (complex) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + AnyofComplexTypes.from_openapi_data_( + { + "foo": + 2, + "bar": + "quux", + }, + configuration_=self.configuration_ + ) + + def test_both_anyof_valid_complex_passes(self): + # both anyOf valid (complex) + AnyofComplexTypes.from_openapi_data_( + { + "foo": + "baz", + "bar": + 2, + }, + configuration_=self.configuration_ + ) + + def test_first_anyof_valid_complex_passes(self): + # first anyOf valid (complex) + AnyofComplexTypes.from_openapi_data_( + { + "bar": + 2, + }, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_anyof_with_base_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_anyof_with_base_schema.py new file mode 100644 index 00000000000..0440a3ce9a0 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_anyof_with_base_schema.py @@ -0,0 +1,48 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.anyof_with_base_schema import AnyofWithBaseSchema +from unit_test_api import configuration + + +class TestAnyofWithBaseSchema(unittest.TestCase): + """AnyofWithBaseSchema unit test stubs""" + configuration_ = configuration.Configuration() + + def test_one_anyof_valid_passes(self): + # one anyOf valid + AnyofWithBaseSchema.from_openapi_data_( + "foobar", + configuration_=self.configuration_ + ) + + def test_both_anyof_invalid_fails(self): + # both anyOf invalid + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + AnyofWithBaseSchema.from_openapi_data_( + "foo", + configuration_=self.configuration_ + ) + + def test_mismatch_base_schema_fails(self): + # mismatch base schema + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + AnyofWithBaseSchema.from_openapi_data_( + 3, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_anyof_with_one_empty_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_anyof_with_one_empty_schema.py new file mode 100644 index 00000000000..c46f62e9c38 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_anyof_with_one_empty_schema.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.anyof_with_one_empty_schema import AnyofWithOneEmptySchema +from unit_test_api import configuration + + +class TestAnyofWithOneEmptySchema(unittest.TestCase): + """AnyofWithOneEmptySchema unit test stubs""" + configuration_ = configuration.Configuration() + + def test_string_is_valid_passes(self): + # string is valid + AnyofWithOneEmptySchema.from_openapi_data_( + "foo", + configuration_=self.configuration_ + ) + + def test_number_is_valid_passes(self): + # number is valid + AnyofWithOneEmptySchema.from_openapi_data_( + 123, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_array_type_matches_arrays.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_array_type_matches_arrays.py new file mode 100644 index 00000000000..a087a7fa3af --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_array_type_matches_arrays.py @@ -0,0 +1,82 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.array_type_matches_arrays import ArrayTypeMatchesArrays +from unit_test_api import configuration + + +class TestArrayTypeMatchesArrays(unittest.TestCase): + """ArrayTypeMatchesArrays unit test stubs""" + configuration_ = configuration.Configuration() + + def test_a_float_is_not_an_array_fails(self): + # a float is not an array + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + ArrayTypeMatchesArrays.from_openapi_data_( + 1.1, + configuration_=self.configuration_ + ) + + def test_a_boolean_is_not_an_array_fails(self): + # a boolean is not an array + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + ArrayTypeMatchesArrays.from_openapi_data_( + True, + configuration_=self.configuration_ + ) + + def test_null_is_not_an_array_fails(self): + # null is not an array + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + ArrayTypeMatchesArrays.from_openapi_data_( + None, + configuration_=self.configuration_ + ) + + def test_an_object_is_not_an_array_fails(self): + # an object is not an array + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + ArrayTypeMatchesArrays.from_openapi_data_( + { + }, + configuration_=self.configuration_ + ) + + def test_a_string_is_not_an_array_fails(self): + # a string is not an array + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + ArrayTypeMatchesArrays.from_openapi_data_( + "foo", + configuration_=self.configuration_ + ) + + def test_an_array_is_an_array_passes(self): + # an array is an array + ArrayTypeMatchesArrays.from_openapi_data_( + [ + ], + configuration_=self.configuration_ + ) + + def test_an_integer_is_not_an_array_fails(self): + # an integer is not an array + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + ArrayTypeMatchesArrays.from_openapi_data_( + 1, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_boolean_type_matches_booleans.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_boolean_type_matches_booleans.py new file mode 100644 index 00000000000..b12796d3b31 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_boolean_type_matches_booleans.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.boolean_type_matches_booleans import BooleanTypeMatchesBooleans +from unit_test_api import configuration + + +class TestBooleanTypeMatchesBooleans(unittest.TestCase): + """BooleanTypeMatchesBooleans unit test stubs""" + configuration_ = configuration.Configuration() + + def test_an_empty_string_is_not_a_boolean_fails(self): + # an empty string is not a boolean + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + BooleanTypeMatchesBooleans.from_openapi_data_( + "", + configuration_=self.configuration_ + ) + + def test_a_float_is_not_a_boolean_fails(self): + # a float is not a boolean + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + BooleanTypeMatchesBooleans.from_openapi_data_( + 1.1, + configuration_=self.configuration_ + ) + + def test_null_is_not_a_boolean_fails(self): + # null is not a boolean + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + BooleanTypeMatchesBooleans.from_openapi_data_( + None, + configuration_=self.configuration_ + ) + + def test_zero_is_not_a_boolean_fails(self): + # zero is not a boolean + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + BooleanTypeMatchesBooleans.from_openapi_data_( + 0, + configuration_=self.configuration_ + ) + + def test_an_array_is_not_a_boolean_fails(self): + # an array is not a boolean + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + BooleanTypeMatchesBooleans.from_openapi_data_( + [ + ], + configuration_=self.configuration_ + ) + + def test_a_string_is_not_a_boolean_fails(self): + # a string is not a boolean + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + BooleanTypeMatchesBooleans.from_openapi_data_( + "foo", + configuration_=self.configuration_ + ) + + def test_false_is_a_boolean_passes(self): + # false is a boolean + BooleanTypeMatchesBooleans.from_openapi_data_( + False, + configuration_=self.configuration_ + ) + + def test_an_integer_is_not_a_boolean_fails(self): + # an integer is not a boolean + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + BooleanTypeMatchesBooleans.from_openapi_data_( + 1, + configuration_=self.configuration_ + ) + + def test_true_is_a_boolean_passes(self): + # true is a boolean + BooleanTypeMatchesBooleans.from_openapi_data_( + True, + configuration_=self.configuration_ + ) + + def test_an_object_is_not_a_boolean_fails(self): + # an object is not a boolean + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + BooleanTypeMatchesBooleans.from_openapi_data_( + { + }, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_by_int.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_by_int.py new file mode 100644 index 00000000000..7a8030a869f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_by_int.py @@ -0,0 +1,47 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.by_int import ByInt +from unit_test_api import configuration + + +class TestByInt(unittest.TestCase): + """ByInt unit test stubs""" + configuration_ = configuration.Configuration() + + def test_int_by_int_fail_fails(self): + # int by int fail + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + ByInt.from_openapi_data_( + 7, + configuration_=self.configuration_ + ) + + def test_int_by_int_passes(self): + # int by int + ByInt.from_openapi_data_( + 10, + configuration_=self.configuration_ + ) + + def test_ignores_non_numbers_passes(self): + # ignores non-numbers + ByInt.from_openapi_data_( + "foo", + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_by_number.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_by_number.py new file mode 100644 index 00000000000..db65c18d414 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_by_number.py @@ -0,0 +1,47 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.by_number import ByNumber +from unit_test_api import configuration + + +class TestByNumber(unittest.TestCase): + """ByNumber unit test stubs""" + configuration_ = configuration.Configuration() + + def test_45_is_multiple_of15_passes(self): + # 4.5 is multiple of 1.5 + ByNumber.from_openapi_data_( + 4.5, + configuration_=self.configuration_ + ) + + def test_35_is_not_multiple_of15_fails(self): + # 35 is not multiple of 1.5 + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + ByNumber.from_openapi_data_( + 35, + configuration_=self.configuration_ + ) + + def test_zero_is_multiple_of_anything_passes(self): + # zero is multiple of anything + ByNumber.from_openapi_data_( + 0, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_by_small_number.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_by_small_number.py new file mode 100644 index 00000000000..aa6eb5afa11 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_by_small_number.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.by_small_number import BySmallNumber +from unit_test_api import configuration + + +class TestBySmallNumber(unittest.TestCase): + """BySmallNumber unit test stubs""" + configuration_ = configuration.Configuration() + + def test_000751_is_not_multiple_of00001_fails(self): + # 0.00751 is not multiple of 0.0001 + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + BySmallNumber.from_openapi_data_( + 0.00751, + configuration_=self.configuration_ + ) + + def test_00075_is_multiple_of00001_passes(self): + # 0.0075 is multiple of 0.0001 + BySmallNumber.from_openapi_data_( + 0.0075, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_date_time_format.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_date_time_format.py new file mode 100644 index 00000000000..a9c14bed53e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_date_time_format.py @@ -0,0 +1,69 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.date_time_format import DateTimeFormat +from unit_test_api import configuration + + +class TestDateTimeFormat(unittest.TestCase): + """DateTimeFormat unit test stubs""" + configuration_ = configuration.Configuration() + + def test_all_string_formats_ignore_objects_passes(self): + # all string formats ignore objects + DateTimeFormat.from_openapi_data_( + { + }, + configuration_=self.configuration_ + ) + + def test_all_string_formats_ignore_booleans_passes(self): + # all string formats ignore booleans + DateTimeFormat.from_openapi_data_( + False, + configuration_=self.configuration_ + ) + + def test_all_string_formats_ignore_integers_passes(self): + # all string formats ignore integers + DateTimeFormat.from_openapi_data_( + 12, + configuration_=self.configuration_ + ) + + def test_all_string_formats_ignore_floats_passes(self): + # all string formats ignore floats + DateTimeFormat.from_openapi_data_( + 13.7, + configuration_=self.configuration_ + ) + + def test_all_string_formats_ignore_arrays_passes(self): + # all string formats ignore arrays + DateTimeFormat.from_openapi_data_( + [ + ], + configuration_=self.configuration_ + ) + + def test_all_string_formats_ignore_nulls_passes(self): + # all string formats ignore nulls + DateTimeFormat.from_openapi_data_( + None, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_email_format.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_email_format.py new file mode 100644 index 00000000000..1c30f9a17b3 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_email_format.py @@ -0,0 +1,69 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.email_format import EmailFormat +from unit_test_api import configuration + + +class TestEmailFormat(unittest.TestCase): + """EmailFormat unit test stubs""" + configuration_ = configuration.Configuration() + + def test_all_string_formats_ignore_objects_passes(self): + # all string formats ignore objects + EmailFormat.from_openapi_data_( + { + }, + configuration_=self.configuration_ + ) + + def test_all_string_formats_ignore_booleans_passes(self): + # all string formats ignore booleans + EmailFormat.from_openapi_data_( + False, + configuration_=self.configuration_ + ) + + def test_all_string_formats_ignore_integers_passes(self): + # all string formats ignore integers + EmailFormat.from_openapi_data_( + 12, + configuration_=self.configuration_ + ) + + def test_all_string_formats_ignore_floats_passes(self): + # all string formats ignore floats + EmailFormat.from_openapi_data_( + 13.7, + configuration_=self.configuration_ + ) + + def test_all_string_formats_ignore_arrays_passes(self): + # all string formats ignore arrays + EmailFormat.from_openapi_data_( + [ + ], + configuration_=self.configuration_ + ) + + def test_all_string_formats_ignore_nulls_passes(self): + # all string formats ignore nulls + EmailFormat.from_openapi_data_( + None, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_enum_with0_does_not_match_false.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_enum_with0_does_not_match_false.py new file mode 100644 index 00000000000..3f63ae781b1 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_enum_with0_does_not_match_false.py @@ -0,0 +1,47 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.enum_with0_does_not_match_false import EnumWith0DoesNotMatchFalse +from unit_test_api import configuration + + +class TestEnumWith0DoesNotMatchFalse(unittest.TestCase): + """EnumWith0DoesNotMatchFalse unit test stubs""" + configuration_ = configuration.Configuration() + + def test_integer_zero_is_valid_passes(self): + # integer zero is valid + EnumWith0DoesNotMatchFalse.from_openapi_data_( + 0, + configuration_=self.configuration_ + ) + + def test_float_zero_is_valid_passes(self): + # float zero is valid + EnumWith0DoesNotMatchFalse.from_openapi_data_( + 0.0, + configuration_=self.configuration_ + ) + + def test_false_is_invalid_fails(self): + # false is invalid + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + EnumWith0DoesNotMatchFalse.from_openapi_data_( + False, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_enum_with1_does_not_match_true.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_enum_with1_does_not_match_true.py new file mode 100644 index 00000000000..ca8b10ad53e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_enum_with1_does_not_match_true.py @@ -0,0 +1,47 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.enum_with1_does_not_match_true import EnumWith1DoesNotMatchTrue +from unit_test_api import configuration + + +class TestEnumWith1DoesNotMatchTrue(unittest.TestCase): + """EnumWith1DoesNotMatchTrue unit test stubs""" + configuration_ = configuration.Configuration() + + def test_true_is_invalid_fails(self): + # true is invalid + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + EnumWith1DoesNotMatchTrue.from_openapi_data_( + True, + configuration_=self.configuration_ + ) + + def test_integer_one_is_valid_passes(self): + # integer one is valid + EnumWith1DoesNotMatchTrue.from_openapi_data_( + 1, + configuration_=self.configuration_ + ) + + def test_float_one_is_valid_passes(self): + # float one is valid + EnumWith1DoesNotMatchTrue.from_openapi_data_( + 1.0, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_enum_with_escaped_characters.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_enum_with_escaped_characters.py new file mode 100644 index 00000000000..aef87626eaf --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_enum_with_escaped_characters.py @@ -0,0 +1,47 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.enum_with_escaped_characters import EnumWithEscapedCharacters +from unit_test_api import configuration + + +class TestEnumWithEscapedCharacters(unittest.TestCase): + """EnumWithEscapedCharacters unit test stubs""" + configuration_ = configuration.Configuration() + + def test_member2_is_valid_passes(self): + # member 2 is valid + EnumWithEscapedCharacters.from_openapi_data_( + "foo\rbar", + configuration_=self.configuration_ + ) + + def test_member1_is_valid_passes(self): + # member 1 is valid + EnumWithEscapedCharacters.from_openapi_data_( + "foo\nbar", + configuration_=self.configuration_ + ) + + def test_another_string_is_invalid_fails(self): + # another string is invalid + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + EnumWithEscapedCharacters.from_openapi_data_( + "abc", + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_enum_with_false_does_not_match0.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_enum_with_false_does_not_match0.py new file mode 100644 index 00000000000..f220f2dbe40 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_enum_with_false_does_not_match0.py @@ -0,0 +1,48 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.enum_with_false_does_not_match0 import EnumWithFalseDoesNotMatch0 +from unit_test_api import configuration + + +class TestEnumWithFalseDoesNotMatch0(unittest.TestCase): + """EnumWithFalseDoesNotMatch0 unit test stubs""" + configuration_ = configuration.Configuration() + + def test_false_is_valid_passes(self): + # false is valid + EnumWithFalseDoesNotMatch0.from_openapi_data_( + False, + configuration_=self.configuration_ + ) + + def test_float_zero_is_invalid_fails(self): + # float zero is invalid + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + EnumWithFalseDoesNotMatch0.from_openapi_data_( + 0.0, + configuration_=self.configuration_ + ) + + def test_integer_zero_is_invalid_fails(self): + # integer zero is invalid + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + EnumWithFalseDoesNotMatch0.from_openapi_data_( + 0, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_enum_with_true_does_not_match1.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_enum_with_true_does_not_match1.py new file mode 100644 index 00000000000..1a0d4ebad27 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_enum_with_true_does_not_match1.py @@ -0,0 +1,48 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.enum_with_true_does_not_match1 import EnumWithTrueDoesNotMatch1 +from unit_test_api import configuration + + +class TestEnumWithTrueDoesNotMatch1(unittest.TestCase): + """EnumWithTrueDoesNotMatch1 unit test stubs""" + configuration_ = configuration.Configuration() + + def test_float_one_is_invalid_fails(self): + # float one is invalid + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + EnumWithTrueDoesNotMatch1.from_openapi_data_( + 1.0, + configuration_=self.configuration_ + ) + + def test_true_is_valid_passes(self): + # true is valid + EnumWithTrueDoesNotMatch1.from_openapi_data_( + True, + configuration_=self.configuration_ + ) + + def test_integer_one_is_invalid_fails(self): + # integer one is invalid + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + EnumWithTrueDoesNotMatch1.from_openapi_data_( + 1, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_enums_in_properties.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_enums_in_properties.py new file mode 100644 index 00000000000..8d5b30a54c1 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_enums_in_properties.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.enums_in_properties import EnumsInProperties +from unit_test_api import configuration + + +class TestEnumsInProperties(unittest.TestCase): + """EnumsInProperties unit test stubs""" + configuration_ = configuration.Configuration() + + def test_missing_optional_property_is_valid_passes(self): + # missing optional property is valid + EnumsInProperties.from_openapi_data_( + { + "bar": + "bar", + }, + configuration_=self.configuration_ + ) + + def test_wrong_foo_value_fails(self): + # wrong foo value + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + EnumsInProperties.from_openapi_data_( + { + "foo": + "foot", + "bar": + "bar", + }, + configuration_=self.configuration_ + ) + + def test_both_properties_are_valid_passes(self): + # both properties are valid + EnumsInProperties.from_openapi_data_( + { + "foo": + "foo", + "bar": + "bar", + }, + configuration_=self.configuration_ + ) + + def test_wrong_bar_value_fails(self): + # wrong bar value + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + EnumsInProperties.from_openapi_data_( + { + "foo": + "foo", + "bar": + "bart", + }, + configuration_=self.configuration_ + ) + + def test_missing_all_properties_is_invalid_fails(self): + # missing all properties is invalid + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + EnumsInProperties.from_openapi_data_( + { + }, + configuration_=self.configuration_ + ) + + def test_missing_required_property_is_invalid_fails(self): + # missing required property is invalid + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + EnumsInProperties.from_openapi_data_( + { + "foo": + "foo", + }, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_forbidden_property.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_forbidden_property.py new file mode 100644 index 00000000000..cff830e09dc --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_forbidden_property.py @@ -0,0 +1,50 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.forbidden_property import ForbiddenProperty +from unit_test_api import configuration + + +class TestForbiddenProperty(unittest.TestCase): + """ForbiddenProperty unit test stubs""" + configuration_ = configuration.Configuration() + + def test_property_present_fails(self): + # property present + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + ForbiddenProperty.from_openapi_data_( + { + "foo": + 1, + "bar": + 2, + }, + configuration_=self.configuration_ + ) + + def test_property_absent_passes(self): + # property absent + ForbiddenProperty.from_openapi_data_( + { + "bar": + 1, + "baz": + 2, + }, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_hostname_format.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_hostname_format.py new file mode 100644 index 00000000000..362faa86f05 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_hostname_format.py @@ -0,0 +1,69 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.hostname_format import HostnameFormat +from unit_test_api import configuration + + +class TestHostnameFormat(unittest.TestCase): + """HostnameFormat unit test stubs""" + configuration_ = configuration.Configuration() + + def test_all_string_formats_ignore_objects_passes(self): + # all string formats ignore objects + HostnameFormat.from_openapi_data_( + { + }, + configuration_=self.configuration_ + ) + + def test_all_string_formats_ignore_booleans_passes(self): + # all string formats ignore booleans + HostnameFormat.from_openapi_data_( + False, + configuration_=self.configuration_ + ) + + def test_all_string_formats_ignore_integers_passes(self): + # all string formats ignore integers + HostnameFormat.from_openapi_data_( + 12, + configuration_=self.configuration_ + ) + + def test_all_string_formats_ignore_floats_passes(self): + # all string formats ignore floats + HostnameFormat.from_openapi_data_( + 13.7, + configuration_=self.configuration_ + ) + + def test_all_string_formats_ignore_arrays_passes(self): + # all string formats ignore arrays + HostnameFormat.from_openapi_data_( + [ + ], + configuration_=self.configuration_ + ) + + def test_all_string_formats_ignore_nulls_passes(self): + # all string formats ignore nulls + HostnameFormat.from_openapi_data_( + None, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_integer_type_matches_integers.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_integer_type_matches_integers.py new file mode 100644 index 00000000000..ef95b0c43be --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_integer_type_matches_integers.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.integer_type_matches_integers import IntegerTypeMatchesIntegers +from unit_test_api import configuration + + +class TestIntegerTypeMatchesIntegers(unittest.TestCase): + """IntegerTypeMatchesIntegers unit test stubs""" + configuration_ = configuration.Configuration() + + def test_an_object_is_not_an_integer_fails(self): + # an object is not an integer + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + IntegerTypeMatchesIntegers.from_openapi_data_( + { + }, + configuration_=self.configuration_ + ) + + def test_a_string_is_not_an_integer_fails(self): + # a string is not an integer + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + IntegerTypeMatchesIntegers.from_openapi_data_( + "foo", + configuration_=self.configuration_ + ) + + def test_null_is_not_an_integer_fails(self): + # null is not an integer + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + IntegerTypeMatchesIntegers.from_openapi_data_( + None, + configuration_=self.configuration_ + ) + + def test_a_float_with_zero_fractional_part_is_an_integer_passes(self): + # a float with zero fractional part is an integer + IntegerTypeMatchesIntegers.from_openapi_data_( + 1.0, + configuration_=self.configuration_ + ) + + def test_a_float_is_not_an_integer_fails(self): + # a float is not an integer + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + IntegerTypeMatchesIntegers.from_openapi_data_( + 1.1, + configuration_=self.configuration_ + ) + + def test_a_boolean_is_not_an_integer_fails(self): + # a boolean is not an integer + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + IntegerTypeMatchesIntegers.from_openapi_data_( + True, + configuration_=self.configuration_ + ) + + def test_an_integer_is_an_integer_passes(self): + # an integer is an integer + IntegerTypeMatchesIntegers.from_openapi_data_( + 1, + configuration_=self.configuration_ + ) + + def test_a_string_is_still_not_an_integer_even_if_it_looks_like_one_fails(self): + # a string is still not an integer, even if it looks like one + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + IntegerTypeMatchesIntegers.from_openapi_data_( + "1", + configuration_=self.configuration_ + ) + + def test_an_array_is_not_an_integer_fails(self): + # an array is not an integer + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + IntegerTypeMatchesIntegers.from_openapi_data_( + [ + ], + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_invalid_instance_should_not_raise_error_when_float_division_inf.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_invalid_instance_should_not_raise_error_when_float_division_inf.py new file mode 100644 index 00000000000..b64ade95373 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_invalid_instance_should_not_raise_error_when_float_division_inf.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.invalid_instance_should_not_raise_error_when_float_division_inf import InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf +from unit_test_api import configuration + + +class TestInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf(unittest.TestCase): + """InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf unit test stubs""" + configuration_ = configuration.Configuration() + + def test_always_invalid_but_naive_implementations_may_raise_an_overflow_error_fails(self): + # always invalid, but naive implementations may raise an overflow error + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf.from_openapi_data_( + 1.0E308, + configuration_=self.configuration_ + ) + + def test_valid_integer_with_multipleof_float_passes(self): + # valid integer with multipleOf float + InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf.from_openapi_data_( + 123456789, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_invalid_string_value_for_default.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_invalid_string_value_for_default.py new file mode 100644 index 00000000000..4fd17ddd242 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_invalid_string_value_for_default.py @@ -0,0 +1,43 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.invalid_string_value_for_default import InvalidStringValueForDefault +from unit_test_api import configuration + + +class TestInvalidStringValueForDefault(unittest.TestCase): + """InvalidStringValueForDefault unit test stubs""" + configuration_ = configuration.Configuration() + + def test_valid_when_property_is_specified_passes(self): + # valid when property is specified + InvalidStringValueForDefault.from_openapi_data_( + { + "bar": + "good", + }, + configuration_=self.configuration_ + ) + + def test_still_valid_when_the_invalid_default_is_used_passes(self): + # still valid when the invalid default is used + InvalidStringValueForDefault.from_openapi_data_( + { + }, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_ipv4_format.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_ipv4_format.py new file mode 100644 index 00000000000..e9587042749 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_ipv4_format.py @@ -0,0 +1,69 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.ipv4_format import Ipv4Format +from unit_test_api import configuration + + +class TestIpv4Format(unittest.TestCase): + """Ipv4Format unit test stubs""" + configuration_ = configuration.Configuration() + + def test_all_string_formats_ignore_objects_passes(self): + # all string formats ignore objects + Ipv4Format.from_openapi_data_( + { + }, + configuration_=self.configuration_ + ) + + def test_all_string_formats_ignore_booleans_passes(self): + # all string formats ignore booleans + Ipv4Format.from_openapi_data_( + False, + configuration_=self.configuration_ + ) + + def test_all_string_formats_ignore_integers_passes(self): + # all string formats ignore integers + Ipv4Format.from_openapi_data_( + 12, + configuration_=self.configuration_ + ) + + def test_all_string_formats_ignore_floats_passes(self): + # all string formats ignore floats + Ipv4Format.from_openapi_data_( + 13.7, + configuration_=self.configuration_ + ) + + def test_all_string_formats_ignore_arrays_passes(self): + # all string formats ignore arrays + Ipv4Format.from_openapi_data_( + [ + ], + configuration_=self.configuration_ + ) + + def test_all_string_formats_ignore_nulls_passes(self): + # all string formats ignore nulls + Ipv4Format.from_openapi_data_( + None, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_ipv6_format.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_ipv6_format.py new file mode 100644 index 00000000000..007df1984f6 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_ipv6_format.py @@ -0,0 +1,69 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.ipv6_format import Ipv6Format +from unit_test_api import configuration + + +class TestIpv6Format(unittest.TestCase): + """Ipv6Format unit test stubs""" + configuration_ = configuration.Configuration() + + def test_all_string_formats_ignore_objects_passes(self): + # all string formats ignore objects + Ipv6Format.from_openapi_data_( + { + }, + configuration_=self.configuration_ + ) + + def test_all_string_formats_ignore_booleans_passes(self): + # all string formats ignore booleans + Ipv6Format.from_openapi_data_( + False, + configuration_=self.configuration_ + ) + + def test_all_string_formats_ignore_integers_passes(self): + # all string formats ignore integers + Ipv6Format.from_openapi_data_( + 12, + configuration_=self.configuration_ + ) + + def test_all_string_formats_ignore_floats_passes(self): + # all string formats ignore floats + Ipv6Format.from_openapi_data_( + 13.7, + configuration_=self.configuration_ + ) + + def test_all_string_formats_ignore_arrays_passes(self): + # all string formats ignore arrays + Ipv6Format.from_openapi_data_( + [ + ], + configuration_=self.configuration_ + ) + + def test_all_string_formats_ignore_nulls_passes(self): + # all string formats ignore nulls + Ipv6Format.from_openapi_data_( + None, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_json_pointer_format.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_json_pointer_format.py new file mode 100644 index 00000000000..bfa9ba29028 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_json_pointer_format.py @@ -0,0 +1,69 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.json_pointer_format import JsonPointerFormat +from unit_test_api import configuration + + +class TestJsonPointerFormat(unittest.TestCase): + """JsonPointerFormat unit test stubs""" + configuration_ = configuration.Configuration() + + def test_all_string_formats_ignore_objects_passes(self): + # all string formats ignore objects + JsonPointerFormat.from_openapi_data_( + { + }, + configuration_=self.configuration_ + ) + + def test_all_string_formats_ignore_booleans_passes(self): + # all string formats ignore booleans + JsonPointerFormat.from_openapi_data_( + False, + configuration_=self.configuration_ + ) + + def test_all_string_formats_ignore_integers_passes(self): + # all string formats ignore integers + JsonPointerFormat.from_openapi_data_( + 12, + configuration_=self.configuration_ + ) + + def test_all_string_formats_ignore_floats_passes(self): + # all string formats ignore floats + JsonPointerFormat.from_openapi_data_( + 13.7, + configuration_=self.configuration_ + ) + + def test_all_string_formats_ignore_arrays_passes(self): + # all string formats ignore arrays + JsonPointerFormat.from_openapi_data_( + [ + ], + configuration_=self.configuration_ + ) + + def test_all_string_formats_ignore_nulls_passes(self): + # all string formats ignore nulls + JsonPointerFormat.from_openapi_data_( + None, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_maximum_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_maximum_validation.py new file mode 100644 index 00000000000..b845b1cef97 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_maximum_validation.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.maximum_validation import MaximumValidation +from unit_test_api import configuration + + +class TestMaximumValidation(unittest.TestCase): + """MaximumValidation unit test stubs""" + configuration_ = configuration.Configuration() + + def test_below_the_maximum_is_valid_passes(self): + # below the maximum is valid + MaximumValidation.from_openapi_data_( + 2.6, + configuration_=self.configuration_ + ) + + def test_boundary_point_is_valid_passes(self): + # boundary point is valid + MaximumValidation.from_openapi_data_( + 3.0, + configuration_=self.configuration_ + ) + + def test_above_the_maximum_is_invalid_fails(self): + # above the maximum is invalid + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + MaximumValidation.from_openapi_data_( + 3.5, + configuration_=self.configuration_ + ) + + def test_ignores_non_numbers_passes(self): + # ignores non-numbers + MaximumValidation.from_openapi_data_( + "x", + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_maximum_validation_with_unsigned_integer.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_maximum_validation_with_unsigned_integer.py new file mode 100644 index 00000000000..f4bcfb9bbbc --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_maximum_validation_with_unsigned_integer.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.maximum_validation_with_unsigned_integer import MaximumValidationWithUnsignedInteger +from unit_test_api import configuration + + +class TestMaximumValidationWithUnsignedInteger(unittest.TestCase): + """MaximumValidationWithUnsignedInteger unit test stubs""" + configuration_ = configuration.Configuration() + + def test_below_the_maximum_is_invalid_passes(self): + # below the maximum is invalid + MaximumValidationWithUnsignedInteger.from_openapi_data_( + 299.97, + configuration_=self.configuration_ + ) + + def test_above_the_maximum_is_invalid_fails(self): + # above the maximum is invalid + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + MaximumValidationWithUnsignedInteger.from_openapi_data_( + 300.5, + configuration_=self.configuration_ + ) + + def test_boundary_point_integer_is_valid_passes(self): + # boundary point integer is valid + MaximumValidationWithUnsignedInteger.from_openapi_data_( + 300, + configuration_=self.configuration_ + ) + + def test_boundary_point_float_is_valid_passes(self): + # boundary point float is valid + MaximumValidationWithUnsignedInteger.from_openapi_data_( + 300.0, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_maxitems_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_maxitems_validation.py new file mode 100644 index 00000000000..2ca30ca1ae9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_maxitems_validation.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.maxitems_validation import MaxitemsValidation +from unit_test_api import configuration + + +class TestMaxitemsValidation(unittest.TestCase): + """MaxitemsValidation unit test stubs""" + configuration_ = configuration.Configuration() + + def test_too_long_is_invalid_fails(self): + # too long is invalid + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + MaxitemsValidation.from_openapi_data_( + [ + 1, + 2, + 3, + ], + configuration_=self.configuration_ + ) + + def test_ignores_non_arrays_passes(self): + # ignores non-arrays + MaxitemsValidation.from_openapi_data_( + "foobar", + configuration_=self.configuration_ + ) + + def test_shorter_is_valid_passes(self): + # shorter is valid + MaxitemsValidation.from_openapi_data_( + [ + 1, + ], + configuration_=self.configuration_ + ) + + def test_exact_length_is_valid_passes(self): + # exact length is valid + MaxitemsValidation.from_openapi_data_( + [ + 1, + 2, + ], + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_maxlength_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_maxlength_validation.py new file mode 100644 index 00000000000..37c6c376580 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_maxlength_validation.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.maxlength_validation import MaxlengthValidation +from unit_test_api import configuration + + +class TestMaxlengthValidation(unittest.TestCase): + """MaxlengthValidation unit test stubs""" + configuration_ = configuration.Configuration() + + def test_too_long_is_invalid_fails(self): + # too long is invalid + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + MaxlengthValidation.from_openapi_data_( + "foo", + configuration_=self.configuration_ + ) + + def test_ignores_non_strings_passes(self): + # ignores non-strings + MaxlengthValidation.from_openapi_data_( + 100, + configuration_=self.configuration_ + ) + + def test_shorter_is_valid_passes(self): + # shorter is valid + MaxlengthValidation.from_openapi_data_( + "f", + configuration_=self.configuration_ + ) + + def test_two_supplementary_unicode_code_points_is_long_enough_passes(self): + # two supplementary Unicode code points is long enough + MaxlengthValidation.from_openapi_data_( + "💩💩", + configuration_=self.configuration_ + ) + + def test_exact_length_is_valid_passes(self): + # exact length is valid + MaxlengthValidation.from_openapi_data_( + "fo", + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_maxproperties0_means_the_object_is_empty.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_maxproperties0_means_the_object_is_empty.py new file mode 100644 index 00000000000..7d15b4a8c56 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_maxproperties0_means_the_object_is_empty.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.maxproperties0_means_the_object_is_empty import Maxproperties0MeansTheObjectIsEmpty +from unit_test_api import configuration + + +class TestMaxproperties0MeansTheObjectIsEmpty(unittest.TestCase): + """Maxproperties0MeansTheObjectIsEmpty unit test stubs""" + configuration_ = configuration.Configuration() + + def test_no_properties_is_valid_passes(self): + # no properties is valid + Maxproperties0MeansTheObjectIsEmpty.from_openapi_data_( + { + }, + configuration_=self.configuration_ + ) + + def test_one_property_is_invalid_fails(self): + # one property is invalid + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + Maxproperties0MeansTheObjectIsEmpty.from_openapi_data_( + { + "foo": + 1, + }, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_maxproperties_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_maxproperties_validation.py new file mode 100644 index 00000000000..58feb9cda40 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_maxproperties_validation.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.maxproperties_validation import MaxpropertiesValidation +from unit_test_api import configuration + + +class TestMaxpropertiesValidation(unittest.TestCase): + """MaxpropertiesValidation unit test stubs""" + configuration_ = configuration.Configuration() + + def test_too_long_is_invalid_fails(self): + # too long is invalid + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + MaxpropertiesValidation.from_openapi_data_( + { + "foo": + 1, + "bar": + 2, + "baz": + 3, + }, + configuration_=self.configuration_ + ) + + def test_ignores_arrays_passes(self): + # ignores arrays + MaxpropertiesValidation.from_openapi_data_( + [ + 1, + 2, + 3, + ], + configuration_=self.configuration_ + ) + + def test_ignores_other_non_objects_passes(self): + # ignores other non-objects + MaxpropertiesValidation.from_openapi_data_( + 12, + configuration_=self.configuration_ + ) + + def test_ignores_strings_passes(self): + # ignores strings + MaxpropertiesValidation.from_openapi_data_( + "foobar", + configuration_=self.configuration_ + ) + + def test_shorter_is_valid_passes(self): + # shorter is valid + MaxpropertiesValidation.from_openapi_data_( + { + "foo": + 1, + }, + configuration_=self.configuration_ + ) + + def test_exact_length_is_valid_passes(self): + # exact length is valid + MaxpropertiesValidation.from_openapi_data_( + { + "foo": + 1, + "bar": + 2, + }, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_minimum_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_minimum_validation.py new file mode 100644 index 00000000000..67276896b3c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_minimum_validation.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.minimum_validation import MinimumValidation +from unit_test_api import configuration + + +class TestMinimumValidation(unittest.TestCase): + """MinimumValidation unit test stubs""" + configuration_ = configuration.Configuration() + + def test_boundary_point_is_valid_passes(self): + # boundary point is valid + MinimumValidation.from_openapi_data_( + 1.1, + configuration_=self.configuration_ + ) + + def test_below_the_minimum_is_invalid_fails(self): + # below the minimum is invalid + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + MinimumValidation.from_openapi_data_( + 0.6, + configuration_=self.configuration_ + ) + + def test_above_the_minimum_is_valid_passes(self): + # above the minimum is valid + MinimumValidation.from_openapi_data_( + 2.6, + configuration_=self.configuration_ + ) + + def test_ignores_non_numbers_passes(self): + # ignores non-numbers + MinimumValidation.from_openapi_data_( + "x", + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_minimum_validation_with_signed_integer.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_minimum_validation_with_signed_integer.py new file mode 100644 index 00000000000..a8876922664 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_minimum_validation_with_signed_integer.py @@ -0,0 +1,76 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.minimum_validation_with_signed_integer import MinimumValidationWithSignedInteger +from unit_test_api import configuration + + +class TestMinimumValidationWithSignedInteger(unittest.TestCase): + """MinimumValidationWithSignedInteger unit test stubs""" + configuration_ = configuration.Configuration() + + def test_boundary_point_is_valid_passes(self): + # boundary point is valid + MinimumValidationWithSignedInteger.from_openapi_data_( + -2, + configuration_=self.configuration_ + ) + + def test_positive_above_the_minimum_is_valid_passes(self): + # positive above the minimum is valid + MinimumValidationWithSignedInteger.from_openapi_data_( + 0, + configuration_=self.configuration_ + ) + + def test_int_below_the_minimum_is_invalid_fails(self): + # int below the minimum is invalid + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + MinimumValidationWithSignedInteger.from_openapi_data_( + -3, + configuration_=self.configuration_ + ) + + def test_float_below_the_minimum_is_invalid_fails(self): + # float below the minimum is invalid + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + MinimumValidationWithSignedInteger.from_openapi_data_( + -2.0001, + configuration_=self.configuration_ + ) + + def test_boundary_point_with_float_is_valid_passes(self): + # boundary point with float is valid + MinimumValidationWithSignedInteger.from_openapi_data_( + -2.0, + configuration_=self.configuration_ + ) + + def test_negative_above_the_minimum_is_valid_passes(self): + # negative above the minimum is valid + MinimumValidationWithSignedInteger.from_openapi_data_( + -1, + configuration_=self.configuration_ + ) + + def test_ignores_non_numbers_passes(self): + # ignores non-numbers + MinimumValidationWithSignedInteger.from_openapi_data_( + "x", + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_minitems_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_minitems_validation.py new file mode 100644 index 00000000000..3c91561e849 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_minitems_validation.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.minitems_validation import MinitemsValidation +from unit_test_api import configuration + + +class TestMinitemsValidation(unittest.TestCase): + """MinitemsValidation unit test stubs""" + configuration_ = configuration.Configuration() + + def test_too_short_is_invalid_fails(self): + # too short is invalid + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + MinitemsValidation.from_openapi_data_( + [ + ], + configuration_=self.configuration_ + ) + + def test_ignores_non_arrays_passes(self): + # ignores non-arrays + MinitemsValidation.from_openapi_data_( + "", + configuration_=self.configuration_ + ) + + def test_longer_is_valid_passes(self): + # longer is valid + MinitemsValidation.from_openapi_data_( + [ + 1, + 2, + ], + configuration_=self.configuration_ + ) + + def test_exact_length_is_valid_passes(self): + # exact length is valid + MinitemsValidation.from_openapi_data_( + [ + 1, + ], + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_minlength_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_minlength_validation.py new file mode 100644 index 00000000000..80e3b7be614 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_minlength_validation.py @@ -0,0 +1,62 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.minlength_validation import MinlengthValidation +from unit_test_api import configuration + + +class TestMinlengthValidation(unittest.TestCase): + """MinlengthValidation unit test stubs""" + configuration_ = configuration.Configuration() + + def test_too_short_is_invalid_fails(self): + # too short is invalid + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + MinlengthValidation.from_openapi_data_( + "f", + configuration_=self.configuration_ + ) + + def test_one_supplementary_unicode_code_point_is_not_long_enough_fails(self): + # one supplementary Unicode code point is not long enough + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + MinlengthValidation.from_openapi_data_( + "💩", + configuration_=self.configuration_ + ) + + def test_longer_is_valid_passes(self): + # longer is valid + MinlengthValidation.from_openapi_data_( + "foo", + configuration_=self.configuration_ + ) + + def test_ignores_non_strings_passes(self): + # ignores non-strings + MinlengthValidation.from_openapi_data_( + 1, + configuration_=self.configuration_ + ) + + def test_exact_length_is_valid_passes(self): + # exact length is valid + MinlengthValidation.from_openapi_data_( + "fo", + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_minproperties_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_minproperties_validation.py new file mode 100644 index 00000000000..b2b1bcb79e9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_minproperties_validation.py @@ -0,0 +1,78 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.minproperties_validation import MinpropertiesValidation +from unit_test_api import configuration + + +class TestMinpropertiesValidation(unittest.TestCase): + """MinpropertiesValidation unit test stubs""" + configuration_ = configuration.Configuration() + + def test_ignores_arrays_passes(self): + # ignores arrays + MinpropertiesValidation.from_openapi_data_( + [ + ], + configuration_=self.configuration_ + ) + + def test_ignores_other_non_objects_passes(self): + # ignores other non-objects + MinpropertiesValidation.from_openapi_data_( + 12, + configuration_=self.configuration_ + ) + + def test_too_short_is_invalid_fails(self): + # too short is invalid + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + MinpropertiesValidation.from_openapi_data_( + { + }, + configuration_=self.configuration_ + ) + + def test_ignores_strings_passes(self): + # ignores strings + MinpropertiesValidation.from_openapi_data_( + "", + configuration_=self.configuration_ + ) + + def test_longer_is_valid_passes(self): + # longer is valid + MinpropertiesValidation.from_openapi_data_( + { + "foo": + 1, + "bar": + 2, + }, + configuration_=self.configuration_ + ) + + def test_exact_length_is_valid_passes(self): + # exact length is valid + MinpropertiesValidation.from_openapi_data_( + { + "foo": + 1, + }, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_nested_allof_to_check_validation_semantics.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_nested_allof_to_check_validation_semantics.py new file mode 100644 index 00000000000..76bb018b0ea --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_nested_allof_to_check_validation_semantics.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.nested_allof_to_check_validation_semantics import NestedAllofToCheckValidationSemantics +from unit_test_api import configuration + + +class TestNestedAllofToCheckValidationSemantics(unittest.TestCase): + """NestedAllofToCheckValidationSemantics unit test stubs""" + configuration_ = configuration.Configuration() + + def test_anything_non_null_is_invalid_fails(self): + # anything non-null is invalid + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + NestedAllofToCheckValidationSemantics.from_openapi_data_( + 123, + configuration_=self.configuration_ + ) + + def test_null_is_valid_passes(self): + # null is valid + NestedAllofToCheckValidationSemantics.from_openapi_data_( + None, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_nested_anyof_to_check_validation_semantics.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_nested_anyof_to_check_validation_semantics.py new file mode 100644 index 00000000000..256ff75148d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_nested_anyof_to_check_validation_semantics.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.nested_anyof_to_check_validation_semantics import NestedAnyofToCheckValidationSemantics +from unit_test_api import configuration + + +class TestNestedAnyofToCheckValidationSemantics(unittest.TestCase): + """NestedAnyofToCheckValidationSemantics unit test stubs""" + configuration_ = configuration.Configuration() + + def test_anything_non_null_is_invalid_fails(self): + # anything non-null is invalid + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + NestedAnyofToCheckValidationSemantics.from_openapi_data_( + 123, + configuration_=self.configuration_ + ) + + def test_null_is_valid_passes(self): + # null is valid + NestedAnyofToCheckValidationSemantics.from_openapi_data_( + None, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_nested_items.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_nested_items.py similarity index 86% rename from samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_nested_items.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_nested_items.py index 273f27f8b7e..e9a41474070 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_nested_items.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_nested_items.py @@ -6,23 +6,23 @@ sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest import unit_test_api -from unit_test_api.model.nested_items import NestedItems +from unit_test_api.components.schema.nested_items import NestedItems from unit_test_api import configuration class TestNestedItems(unittest.TestCase): """NestedItems unit test stubs""" - _configuration = configuration.Configuration() + configuration_ = configuration.Configuration() def test_valid_nested_array_passes(self): # valid nested array - NestedItems.from_openapi_data_oapg( + NestedItems.from_openapi_data_( [ [ [ @@ -53,13 +53,13 @@ def test_valid_nested_array_passes(self): ], ], ], - _configuration=self._configuration + configuration_=self.configuration_ ) def test_nested_array_with_invalid_type_fails(self): # nested array with invalid type with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - NestedItems.from_openapi_data_oapg( + NestedItems.from_openapi_data_( [ [ [ @@ -90,13 +90,13 @@ def test_nested_array_with_invalid_type_fails(self): ], ], ], - _configuration=self._configuration + configuration_=self.configuration_ ) def test_not_deep_enough_fails(self): # not deep enough with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - NestedItems.from_openapi_data_oapg( + NestedItems.from_openapi_data_( [ [ [ @@ -121,7 +121,7 @@ def test_not_deep_enough_fails(self): ], ], ], - _configuration=self._configuration + configuration_=self.configuration_ ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_nested_oneof_to_check_validation_semantics.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_nested_oneof_to_check_validation_semantics.py new file mode 100644 index 00000000000..3aa3e36853c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_nested_oneof_to_check_validation_semantics.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.nested_oneof_to_check_validation_semantics import NestedOneofToCheckValidationSemantics +from unit_test_api import configuration + + +class TestNestedOneofToCheckValidationSemantics(unittest.TestCase): + """NestedOneofToCheckValidationSemantics unit test stubs""" + configuration_ = configuration.Configuration() + + def test_anything_non_null_is_invalid_fails(self): + # anything non-null is invalid + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + NestedOneofToCheckValidationSemantics.from_openapi_data_( + 123, + configuration_=self.configuration_ + ) + + def test_null_is_valid_passes(self): + # null is valid + NestedOneofToCheckValidationSemantics.from_openapi_data_( + None, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_not_more_complex_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_not_more_complex_schema.py new file mode 100644 index 00000000000..b97514dfaf1 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_not_more_complex_schema.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.not_more_complex_schema import NotMoreComplexSchema +from unit_test_api import configuration + + +class TestNotMoreComplexSchema(unittest.TestCase): + """NotMoreComplexSchema unit test stubs""" + configuration_ = configuration.Configuration() + + def test_other_match_passes(self): + # other match + NotMoreComplexSchema.from_openapi_data_( + { + "foo": + 1, + }, + configuration_=self.configuration_ + ) + + def test_mismatch_fails(self): + # mismatch + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + NotMoreComplexSchema.from_openapi_data_( + { + "foo": + "bar", + }, + configuration_=self.configuration_ + ) + + def test_match_passes(self): + # match + NotMoreComplexSchema.from_openapi_data_( + 1, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_nul_characters_in_strings.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_nul_characters_in_strings.py new file mode 100644 index 00000000000..befdb3a1112 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_nul_characters_in_strings.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.nul_characters_in_strings import NulCharactersInStrings +from unit_test_api import configuration + + +class TestNulCharactersInStrings(unittest.TestCase): + """NulCharactersInStrings unit test stubs""" + configuration_ = configuration.Configuration() + + def test_match_string_with_nul_passes(self): + # match string with nul + NulCharactersInStrings.from_openapi_data_( + "hello\x00there", + configuration_=self.configuration_ + ) + + def test_do_not_match_string_lacking_nul_fails(self): + # do not match string lacking nul + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + NulCharactersInStrings.from_openapi_data_( + "hellothere", + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_null_type_matches_only_the_null_object.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_null_type_matches_only_the_null_object.py new file mode 100644 index 00000000000..e030f14e354 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_null_type_matches_only_the_null_object.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.null_type_matches_only_the_null_object import NullTypeMatchesOnlyTheNullObject +from unit_test_api import configuration + + +class TestNullTypeMatchesOnlyTheNullObject(unittest.TestCase): + """NullTypeMatchesOnlyTheNullObject unit test stubs""" + configuration_ = configuration.Configuration() + + def test_a_float_is_not_null_fails(self): + # a float is not null + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + NullTypeMatchesOnlyTheNullObject.from_openapi_data_( + 1.1, + configuration_=self.configuration_ + ) + + def test_an_object_is_not_null_fails(self): + # an object is not null + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + NullTypeMatchesOnlyTheNullObject.from_openapi_data_( + { + }, + configuration_=self.configuration_ + ) + + def test_false_is_not_null_fails(self): + # false is not null + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + NullTypeMatchesOnlyTheNullObject.from_openapi_data_( + False, + configuration_=self.configuration_ + ) + + def test_an_integer_is_not_null_fails(self): + # an integer is not null + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + NullTypeMatchesOnlyTheNullObject.from_openapi_data_( + 1, + configuration_=self.configuration_ + ) + + def test_true_is_not_null_fails(self): + # true is not null + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + NullTypeMatchesOnlyTheNullObject.from_openapi_data_( + True, + configuration_=self.configuration_ + ) + + def test_zero_is_not_null_fails(self): + # zero is not null + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + NullTypeMatchesOnlyTheNullObject.from_openapi_data_( + 0, + configuration_=self.configuration_ + ) + + def test_an_empty_string_is_not_null_fails(self): + # an empty string is not null + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + NullTypeMatchesOnlyTheNullObject.from_openapi_data_( + "", + configuration_=self.configuration_ + ) + + def test_null_is_null_passes(self): + # null is null + NullTypeMatchesOnlyTheNullObject.from_openapi_data_( + None, + configuration_=self.configuration_ + ) + + def test_an_array_is_not_null_fails(self): + # an array is not null + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + NullTypeMatchesOnlyTheNullObject.from_openapi_data_( + [ + ], + configuration_=self.configuration_ + ) + + def test_a_string_is_not_null_fails(self): + # a string is not null + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + NullTypeMatchesOnlyTheNullObject.from_openapi_data_( + "foo", + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_number_type_matches_numbers.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_number_type_matches_numbers.py new file mode 100644 index 00000000000..5d988552074 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_number_type_matches_numbers.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.number_type_matches_numbers import NumberTypeMatchesNumbers +from unit_test_api import configuration + + +class TestNumberTypeMatchesNumbers(unittest.TestCase): + """NumberTypeMatchesNumbers unit test stubs""" + configuration_ = configuration.Configuration() + + def test_an_array_is_not_a_number_fails(self): + # an array is not a number + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + NumberTypeMatchesNumbers.from_openapi_data_( + [ + ], + configuration_=self.configuration_ + ) + + def test_null_is_not_a_number_fails(self): + # null is not a number + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + NumberTypeMatchesNumbers.from_openapi_data_( + None, + configuration_=self.configuration_ + ) + + def test_an_object_is_not_a_number_fails(self): + # an object is not a number + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + NumberTypeMatchesNumbers.from_openapi_data_( + { + }, + configuration_=self.configuration_ + ) + + def test_a_boolean_is_not_a_number_fails(self): + # a boolean is not a number + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + NumberTypeMatchesNumbers.from_openapi_data_( + True, + configuration_=self.configuration_ + ) + + def test_a_float_is_a_number_passes(self): + # a float is a number + NumberTypeMatchesNumbers.from_openapi_data_( + 1.1, + configuration_=self.configuration_ + ) + + def test_a_string_is_still_not_a_number_even_if_it_looks_like_one_fails(self): + # a string is still not a number, even if it looks like one + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + NumberTypeMatchesNumbers.from_openapi_data_( + "1", + configuration_=self.configuration_ + ) + + def test_a_string_is_not_a_number_fails(self): + # a string is not a number + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + NumberTypeMatchesNumbers.from_openapi_data_( + "foo", + configuration_=self.configuration_ + ) + + def test_an_integer_is_a_number_passes(self): + # an integer is a number + NumberTypeMatchesNumbers.from_openapi_data_( + 1, + configuration_=self.configuration_ + ) + + def test_a_float_with_zero_fractional_part_is_a_number_and_an_integer_passes(self): + # a float with zero fractional part is a number (and an integer) + NumberTypeMatchesNumbers.from_openapi_data_( + 1.0, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_object_properties_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_object_properties_validation.py new file mode 100644 index 00000000000..9ae135d0b43 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_object_properties_validation.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.object_properties_validation import ObjectPropertiesValidation +from unit_test_api import configuration + + +class TestObjectPropertiesValidation(unittest.TestCase): + """ObjectPropertiesValidation unit test stubs""" + configuration_ = configuration.Configuration() + + def test_ignores_arrays_passes(self): + # ignores arrays + ObjectPropertiesValidation.from_openapi_data_( + [ + ], + configuration_=self.configuration_ + ) + + def test_ignores_other_non_objects_passes(self): + # ignores other non-objects + ObjectPropertiesValidation.from_openapi_data_( + 12, + configuration_=self.configuration_ + ) + + def test_one_property_invalid_is_invalid_fails(self): + # one property invalid is invalid + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + ObjectPropertiesValidation.from_openapi_data_( + { + "foo": + 1, + "bar": + { + }, + }, + configuration_=self.configuration_ + ) + + def test_both_properties_present_and_valid_is_valid_passes(self): + # both properties present and valid is valid + ObjectPropertiesValidation.from_openapi_data_( + { + "foo": + 1, + "bar": + "baz", + }, + configuration_=self.configuration_ + ) + + def test_doesn_t_invalidate_other_properties_passes(self): + # doesn't invalidate other properties + ObjectPropertiesValidation.from_openapi_data_( + { + "quux": + [ + ], + }, + configuration_=self.configuration_ + ) + + def test_both_properties_invalid_is_invalid_fails(self): + # both properties invalid is invalid + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + ObjectPropertiesValidation.from_openapi_data_( + { + "foo": + [ + ], + "bar": + { + }, + }, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_object_type_matches_objects.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_object_type_matches_objects.py new file mode 100644 index 00000000000..fd1b8d59be9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_object_type_matches_objects.py @@ -0,0 +1,82 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.object_type_matches_objects import ObjectTypeMatchesObjects +from unit_test_api import configuration + + +class TestObjectTypeMatchesObjects(unittest.TestCase): + """ObjectTypeMatchesObjects unit test stubs""" + configuration_ = configuration.Configuration() + + def test_a_float_is_not_an_object_fails(self): + # a float is not an object + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + ObjectTypeMatchesObjects.from_openapi_data_( + 1.1, + configuration_=self.configuration_ + ) + + def test_null_is_not_an_object_fails(self): + # null is not an object + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + ObjectTypeMatchesObjects.from_openapi_data_( + None, + configuration_=self.configuration_ + ) + + def test_an_array_is_not_an_object_fails(self): + # an array is not an object + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + ObjectTypeMatchesObjects.from_openapi_data_( + [ + ], + configuration_=self.configuration_ + ) + + def test_an_object_is_an_object_passes(self): + # an object is an object + ObjectTypeMatchesObjects.from_openapi_data_( + { + }, + configuration_=self.configuration_ + ) + + def test_a_string_is_not_an_object_fails(self): + # a string is not an object + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + ObjectTypeMatchesObjects.from_openapi_data_( + "foo", + configuration_=self.configuration_ + ) + + def test_an_integer_is_not_an_object_fails(self): + # an integer is not an object + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + ObjectTypeMatchesObjects.from_openapi_data_( + 1, + configuration_=self.configuration_ + ) + + def test_a_boolean_is_not_an_object_fails(self): + # a boolean is not an object + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + ObjectTypeMatchesObjects.from_openapi_data_( + True, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_oneof.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_oneof.py new file mode 100644 index 00000000000..ed0cd687433 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_oneof.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.oneof import Oneof +from unit_test_api import configuration + + +class TestOneof(unittest.TestCase): + """Oneof unit test stubs""" + configuration_ = configuration.Configuration() + + def test_second_oneof_valid_passes(self): + # second oneOf valid + Oneof.from_openapi_data_( + 2.5, + configuration_=self.configuration_ + ) + + def test_both_oneof_valid_fails(self): + # both oneOf valid + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + Oneof.from_openapi_data_( + 3, + configuration_=self.configuration_ + ) + + def test_first_oneof_valid_passes(self): + # first oneOf valid + Oneof.from_openapi_data_( + 1, + configuration_=self.configuration_ + ) + + def test_neither_oneof_valid_fails(self): + # neither oneOf valid + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + Oneof.from_openapi_data_( + 1.5, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_oneof_complex_types.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_oneof_complex_types.py new file mode 100644 index 00000000000..991d4249643 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_oneof_complex_types.py @@ -0,0 +1,71 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.oneof_complex_types import OneofComplexTypes +from unit_test_api import configuration + + +class TestOneofComplexTypes(unittest.TestCase): + """OneofComplexTypes unit test stubs""" + configuration_ = configuration.Configuration() + + def test_first_oneof_valid_complex_passes(self): + # first oneOf valid (complex) + OneofComplexTypes.from_openapi_data_( + { + "bar": + 2, + }, + configuration_=self.configuration_ + ) + + def test_neither_oneof_valid_complex_fails(self): + # neither oneOf valid (complex) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + OneofComplexTypes.from_openapi_data_( + { + "foo": + 2, + "bar": + "quux", + }, + configuration_=self.configuration_ + ) + + def test_both_oneof_valid_complex_fails(self): + # both oneOf valid (complex) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + OneofComplexTypes.from_openapi_data_( + { + "foo": + "baz", + "bar": + 2, + }, + configuration_=self.configuration_ + ) + + def test_second_oneof_valid_complex_passes(self): + # second oneOf valid (complex) + OneofComplexTypes.from_openapi_data_( + { + "foo": + "baz", + }, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_oneof_with_base_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_oneof_with_base_schema.py new file mode 100644 index 00000000000..b96c587cc36 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_oneof_with_base_schema.py @@ -0,0 +1,48 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.oneof_with_base_schema import OneofWithBaseSchema +from unit_test_api import configuration + + +class TestOneofWithBaseSchema(unittest.TestCase): + """OneofWithBaseSchema unit test stubs""" + configuration_ = configuration.Configuration() + + def test_both_oneof_valid_fails(self): + # both oneOf valid + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + OneofWithBaseSchema.from_openapi_data_( + "foo", + configuration_=self.configuration_ + ) + + def test_mismatch_base_schema_fails(self): + # mismatch base schema + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + OneofWithBaseSchema.from_openapi_data_( + 3, + configuration_=self.configuration_ + ) + + def test_one_oneof_valid_passes(self): + # one oneOf valid + OneofWithBaseSchema.from_openapi_data_( + "foobar", + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_oneof_with_empty_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_oneof_with_empty_schema.py new file mode 100644 index 00000000000..67d55ec667a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_oneof_with_empty_schema.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.oneof_with_empty_schema import OneofWithEmptySchema +from unit_test_api import configuration + + +class TestOneofWithEmptySchema(unittest.TestCase): + """OneofWithEmptySchema unit test stubs""" + configuration_ = configuration.Configuration() + + def test_both_valid_invalid_fails(self): + # both valid - invalid + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + OneofWithEmptySchema.from_openapi_data_( + 123, + configuration_=self.configuration_ + ) + + def test_one_valid_valid_passes(self): + # one valid - valid + OneofWithEmptySchema.from_openapi_data_( + "foo", + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_oneof_with_required.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_oneof_with_required.py new file mode 100644 index 00000000000..966783764c3 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_oneof_with_required.py @@ -0,0 +1,75 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.oneof_with_required import OneofWithRequired +from unit_test_api import configuration + + +class TestOneofWithRequired(unittest.TestCase): + """OneofWithRequired unit test stubs""" + configuration_ = configuration.Configuration() + + def test_both_valid_invalid_fails(self): + # both valid - invalid + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + OneofWithRequired.from_openapi_data_( + { + "foo": + 1, + "bar": + 2, + "baz": + 3, + }, + configuration_=self.configuration_ + ) + + def test_both_invalid_invalid_fails(self): + # both invalid - invalid + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + OneofWithRequired.from_openapi_data_( + { + "bar": + 2, + }, + configuration_=self.configuration_ + ) + + def test_first_valid_valid_passes(self): + # first valid - valid + OneofWithRequired.from_openapi_data_( + { + "foo": + 1, + "bar": + 2, + }, + configuration_=self.configuration_ + ) + + def test_second_valid_valid_passes(self): + # second valid - valid + OneofWithRequired.from_openapi_data_( + { + "foo": + 1, + "baz": + 3, + }, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_pattern_is_not_anchored.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_pattern_is_not_anchored.py new file mode 100644 index 00000000000..fca5e035ce2 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_pattern_is_not_anchored.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.pattern_is_not_anchored import PatternIsNotAnchored +from unit_test_api import configuration + + +class TestPatternIsNotAnchored(unittest.TestCase): + """PatternIsNotAnchored unit test stubs""" + configuration_ = configuration.Configuration() + + def test_matches_a_substring_passes(self): + # matches a substring + PatternIsNotAnchored.from_openapi_data_( + "xxaayy", + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_pattern_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_pattern_validation.py new file mode 100644 index 00000000000..e7e8a2f6d6b --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_pattern_validation.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.pattern_validation import PatternValidation +from unit_test_api import configuration + + +class TestPatternValidation(unittest.TestCase): + """PatternValidation unit test stubs""" + configuration_ = configuration.Configuration() + + def test_ignores_arrays_passes(self): + # ignores arrays + PatternValidation.from_openapi_data_( + [ + ], + configuration_=self.configuration_ + ) + + def test_ignores_objects_passes(self): + # ignores objects + PatternValidation.from_openapi_data_( + { + }, + configuration_=self.configuration_ + ) + + def test_ignores_null_passes(self): + # ignores null + PatternValidation.from_openapi_data_( + None, + configuration_=self.configuration_ + ) + + def test_ignores_floats_passes(self): + # ignores floats + PatternValidation.from_openapi_data_( + 1.0, + configuration_=self.configuration_ + ) + + def test_a_non_matching_pattern_is_invalid_fails(self): + # a non-matching pattern is invalid + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + PatternValidation.from_openapi_data_( + "abc", + configuration_=self.configuration_ + ) + + def test_ignores_booleans_passes(self): + # ignores booleans + PatternValidation.from_openapi_data_( + True, + configuration_=self.configuration_ + ) + + def test_a_matching_pattern_is_valid_passes(self): + # a matching pattern is valid + PatternValidation.from_openapi_data_( + "aaa", + configuration_=self.configuration_ + ) + + def test_ignores_integers_passes(self): + # ignores integers + PatternValidation.from_openapi_data_( + 123, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_properties_with_escaped_characters.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_properties_with_escaped_characters.py similarity index 76% rename from samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_properties_with_escaped_characters.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_properties_with_escaped_characters.py index 9cef87212dc..64a64536692 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_properties_with_escaped_characters.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_properties_with_escaped_characters.py @@ -6,23 +6,23 @@ sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest import unit_test_api -from unit_test_api.model.properties_with_escaped_characters import PropertiesWithEscapedCharacters +from unit_test_api.components.schema.properties_with_escaped_characters import PropertiesWithEscapedCharacters from unit_test_api import configuration class TestPropertiesWithEscapedCharacters(unittest.TestCase): """PropertiesWithEscapedCharacters unit test stubs""" - _configuration = configuration.Configuration() + configuration_ = configuration.Configuration() def test_object_with_all_numbers_is_valid_passes(self): # object with all numbers is valid - PropertiesWithEscapedCharacters.from_openapi_data_oapg( + PropertiesWithEscapedCharacters.from_openapi_data_( { "foo\nbar": 1, @@ -37,13 +37,13 @@ def test_object_with_all_numbers_is_valid_passes(self): "foo\fbar": 1, }, - _configuration=self._configuration + configuration_=self.configuration_ ) def test_object_with_strings_is_invalid_fails(self): # object with strings is invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - PropertiesWithEscapedCharacters.from_openapi_data_oapg( + PropertiesWithEscapedCharacters.from_openapi_data_( { "foo\nbar": "1", @@ -58,7 +58,7 @@ def test_object_with_strings_is_invalid_fails(self): "foo\fbar": "1", }, - _configuration=self._configuration + configuration_=self.configuration_ ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_property_named_ref_that_is_not_a_reference.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_property_named_ref_that_is_not_a_reference.py new file mode 100644 index 00000000000..458301f7fc2 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_property_named_ref_that_is_not_a_reference.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.property_named_ref_that_is_not_a_reference import PropertyNamedRefThatIsNotAReference +from unit_test_api import configuration + + +class TestPropertyNamedRefThatIsNotAReference(unittest.TestCase): + """PropertyNamedRefThatIsNotAReference unit test stubs""" + configuration_ = configuration.Configuration() + + def test_property_named_ref_valid_passes(self): + # property named $ref valid + PropertyNamedRefThatIsNotAReference.from_openapi_data_( + { + "$ref": + "a", + }, + configuration_=self.configuration_ + ) + + def test_property_named_ref_invalid_fails(self): + # property named $ref invalid + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + PropertyNamedRefThatIsNotAReference.from_openapi_data_( + { + "$ref": + 2, + }, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_ref_in_additionalproperties.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_ref_in_additionalproperties.py new file mode 100644 index 00000000000..16aaea2e96e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_ref_in_additionalproperties.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.ref_in_additionalproperties import RefInAdditionalproperties +from unit_test_api import configuration + + +class TestRefInAdditionalproperties(unittest.TestCase): + """RefInAdditionalproperties unit test stubs""" + configuration_ = configuration.Configuration() + + def test_property_named_ref_valid_passes(self): + # property named $ref valid + RefInAdditionalproperties.from_openapi_data_( + { + "someProp": + { + "$ref": + "a", + }, + }, + configuration_=self.configuration_ + ) + + def test_property_named_ref_invalid_fails(self): + # property named $ref invalid + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + RefInAdditionalproperties.from_openapi_data_( + { + "someProp": + { + "$ref": + 2, + }, + }, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_ref_in_allof.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_ref_in_allof.py new file mode 100644 index 00000000000..212046dc0a7 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_ref_in_allof.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.ref_in_allof import RefInAllof +from unit_test_api import configuration + + +class TestRefInAllof(unittest.TestCase): + """RefInAllof unit test stubs""" + configuration_ = configuration.Configuration() + + def test_property_named_ref_valid_passes(self): + # property named $ref valid + RefInAllof.from_openapi_data_( + { + "$ref": + "a", + }, + configuration_=self.configuration_ + ) + + def test_property_named_ref_invalid_fails(self): + # property named $ref invalid + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + RefInAllof.from_openapi_data_( + { + "$ref": + 2, + }, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_ref_in_anyof.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_ref_in_anyof.py new file mode 100644 index 00000000000..526ecee032c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_ref_in_anyof.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.ref_in_anyof import RefInAnyof +from unit_test_api import configuration + + +class TestRefInAnyof(unittest.TestCase): + """RefInAnyof unit test stubs""" + configuration_ = configuration.Configuration() + + def test_property_named_ref_valid_passes(self): + # property named $ref valid + RefInAnyof.from_openapi_data_( + { + "$ref": + "a", + }, + configuration_=self.configuration_ + ) + + def test_property_named_ref_invalid_fails(self): + # property named $ref invalid + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + RefInAnyof.from_openapi_data_( + { + "$ref": + 2, + }, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_ref_in_items.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_ref_in_items.py new file mode 100644 index 00000000000..ff6e8101687 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_ref_in_items.py @@ -0,0 +1,50 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.ref_in_items import RefInItems +from unit_test_api import configuration + + +class TestRefInItems(unittest.TestCase): + """RefInItems unit test stubs""" + configuration_ = configuration.Configuration() + + def test_property_named_ref_valid_passes(self): + # property named $ref valid + RefInItems.from_openapi_data_( + [ + { + "$ref": + "a", + }, + ], + configuration_=self.configuration_ + ) + + def test_property_named_ref_invalid_fails(self): + # property named $ref invalid + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + RefInItems.from_openapi_data_( + [ + { + "$ref": + 2, + }, + ], + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_ref_in_not.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_ref_in_not.py new file mode 100644 index 00000000000..5490bc5f3a7 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_ref_in_not.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.ref_in_not import RefInNot +from unit_test_api import configuration + + +class TestRefInNot(unittest.TestCase): + """RefInNot unit test stubs""" + configuration_ = configuration.Configuration() + + def test_property_named_ref_valid_passes(self): + # property named $ref valid + RefInNot.from_openapi_data_( + { + "$ref": + 2, + }, + configuration_=self.configuration_ + ) + + def test_property_named_ref_invalid_fails(self): + # property named $ref invalid + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + RefInNot.from_openapi_data_( + { + "$ref": + "a", + }, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_ref_in_oneof.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_ref_in_oneof.py new file mode 100644 index 00000000000..387ea81e5d4 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_ref_in_oneof.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.ref_in_oneof import RefInOneof +from unit_test_api import configuration + + +class TestRefInOneof(unittest.TestCase): + """RefInOneof unit test stubs""" + configuration_ = configuration.Configuration() + + def test_property_named_ref_valid_passes(self): + # property named $ref valid + RefInOneof.from_openapi_data_( + { + "$ref": + "a", + }, + configuration_=self.configuration_ + ) + + def test_property_named_ref_invalid_fails(self): + # property named $ref invalid + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + RefInOneof.from_openapi_data_( + { + "$ref": + 2, + }, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_ref_in_property.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_ref_in_property.py new file mode 100644 index 00000000000..4500e851df9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_ref_in_property.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.ref_in_property import RefInProperty +from unit_test_api import configuration + + +class TestRefInProperty(unittest.TestCase): + """RefInProperty unit test stubs""" + configuration_ = configuration.Configuration() + + def test_property_named_ref_valid_passes(self): + # property named $ref valid + RefInProperty.from_openapi_data_( + { + "a": + { + "$ref": + "a", + }, + }, + configuration_=self.configuration_ + ) + + def test_property_named_ref_invalid_fails(self): + # property named $ref invalid + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + RefInProperty.from_openapi_data_( + { + "a": + { + "$ref": + 2, + }, + }, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_required_default_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_required_default_validation.py new file mode 100644 index 00000000000..91f63373bf1 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_required_default_validation.py @@ -0,0 +1,33 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.required_default_validation import RequiredDefaultValidation +from unit_test_api import configuration + + +class TestRequiredDefaultValidation(unittest.TestCase): + """RequiredDefaultValidation unit test stubs""" + configuration_ = configuration.Configuration() + + def test_not_required_by_default_passes(self): + # not required by default + RequiredDefaultValidation.from_openapi_data_( + { + }, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_required_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_required_validation.py new file mode 100644 index 00000000000..f85e696e18e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_required_validation.py @@ -0,0 +1,68 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.required_validation import RequiredValidation +from unit_test_api import configuration + + +class TestRequiredValidation(unittest.TestCase): + """RequiredValidation unit test stubs""" + configuration_ = configuration.Configuration() + + def test_ignores_arrays_passes(self): + # ignores arrays + RequiredValidation.from_openapi_data_( + [ + ], + configuration_=self.configuration_ + ) + + def test_present_required_property_is_valid_passes(self): + # present required property is valid + RequiredValidation.from_openapi_data_( + { + "foo": + 1, + }, + configuration_=self.configuration_ + ) + + def test_ignores_other_non_objects_passes(self): + # ignores other non-objects + RequiredValidation.from_openapi_data_( + 12, + configuration_=self.configuration_ + ) + + def test_ignores_strings_passes(self): + # ignores strings + RequiredValidation.from_openapi_data_( + "", + configuration_=self.configuration_ + ) + + def test_non_present_required_property_is_invalid_fails(self): + # non-present required property is invalid + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + RequiredValidation.from_openapi_data_( + { + "bar": + 1, + }, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_required_with_empty_array.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_required_with_empty_array.py new file mode 100644 index 00000000000..16b7b777b75 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_required_with_empty_array.py @@ -0,0 +1,33 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.required_with_empty_array import RequiredWithEmptyArray +from unit_test_api import configuration + + +class TestRequiredWithEmptyArray(unittest.TestCase): + """RequiredWithEmptyArray unit test stubs""" + configuration_ = configuration.Configuration() + + def test_property_not_required_passes(self): + # property not required + RequiredWithEmptyArray.from_openapi_data_( + { + }, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_required_with_escaped_characters.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_required_with_escaped_characters.py new file mode 100644 index 00000000000..d77fbec00aa --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_required_with_escaped_characters.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.required_with_escaped_characters import RequiredWithEscapedCharacters +from unit_test_api import configuration + + +class TestRequiredWithEscapedCharacters(unittest.TestCase): + """RequiredWithEscapedCharacters unit test stubs""" + configuration_ = configuration.Configuration() + + def test_object_with_some_properties_missing_is_invalid_fails(self): + # object with some properties missing is invalid + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + RequiredWithEscapedCharacters.from_openapi_data_( + { + "foo\nbar": + "1", + "foo\"bar": + "1", + }, + configuration_=self.configuration_ + ) + + def test_object_with_all_properties_present_is_valid_passes(self): + # object with all properties present is valid + RequiredWithEscapedCharacters.from_openapi_data_( + { + "foo\nbar": + 1, + "foo\"bar": + 1, + "foo\\bar": + 1, + "foo\rbar": + 1, + "foo\tbar": + 1, + "foo\fbar": + 1, + }, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_simple_enum_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_simple_enum_validation.py new file mode 100644 index 00000000000..fa87914530d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_simple_enum_validation.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.simple_enum_validation import SimpleEnumValidation +from unit_test_api import configuration + + +class TestSimpleEnumValidation(unittest.TestCase): + """SimpleEnumValidation unit test stubs""" + configuration_ = configuration.Configuration() + + def test_something_else_is_invalid_fails(self): + # something else is invalid + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + SimpleEnumValidation.from_openapi_data_( + 4, + configuration_=self.configuration_ + ) + + def test_one_of_the_enum_is_valid_passes(self): + # one of the enum is valid + SimpleEnumValidation.from_openapi_data_( + 1, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_string_type_matches_strings.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_string_type_matches_strings.py new file mode 100644 index 00000000000..e61669a6c17 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_string_type_matches_strings.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.string_type_matches_strings import StringTypeMatchesStrings +from unit_test_api import configuration + + +class TestStringTypeMatchesStrings(unittest.TestCase): + """StringTypeMatchesStrings unit test stubs""" + configuration_ = configuration.Configuration() + + def test_1_is_not_a_string_fails(self): + # 1 is not a string + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + StringTypeMatchesStrings.from_openapi_data_( + 1, + configuration_=self.configuration_ + ) + + def test_a_string_is_still_a_string_even_if_it_looks_like_a_number_passes(self): + # a string is still a string, even if it looks like a number + StringTypeMatchesStrings.from_openapi_data_( + "1", + configuration_=self.configuration_ + ) + + def test_an_empty_string_is_still_a_string_passes(self): + # an empty string is still a string + StringTypeMatchesStrings.from_openapi_data_( + "", + configuration_=self.configuration_ + ) + + def test_a_float_is_not_a_string_fails(self): + # a float is not a string + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + StringTypeMatchesStrings.from_openapi_data_( + 1.1, + configuration_=self.configuration_ + ) + + def test_an_object_is_not_a_string_fails(self): + # an object is not a string + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + StringTypeMatchesStrings.from_openapi_data_( + { + }, + configuration_=self.configuration_ + ) + + def test_an_array_is_not_a_string_fails(self): + # an array is not a string + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + StringTypeMatchesStrings.from_openapi_data_( + [ + ], + configuration_=self.configuration_ + ) + + def test_a_boolean_is_not_a_string_fails(self): + # a boolean is not a string + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + StringTypeMatchesStrings.from_openapi_data_( + True, + configuration_=self.configuration_ + ) + + def test_null_is_not_a_string_fails(self): + # null is not a string + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + StringTypeMatchesStrings.from_openapi_data_( + None, + configuration_=self.configuration_ + ) + + def test_a_string_is_a_string_passes(self): + # a string is a string + StringTypeMatchesStrings.from_openapi_data_( + "foo", + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_the_default_keyword_does_not_do_anything_if_the_property_is_missing.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_the_default_keyword_does_not_do_anything_if_the_property_is_missing.py new file mode 100644 index 00000000000..43e21da415c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_the_default_keyword_does_not_do_anything_if_the_property_is_missing.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.the_default_keyword_does_not_do_anything_if_the_property_is_missing import TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing +from unit_test_api import configuration + + +class TestTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing(unittest.TestCase): + """TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing unit test stubs""" + configuration_ = configuration.Configuration() + + def test_missing_properties_are_not_filled_in_with_the_default_passes(self): + # missing properties are not filled in with the default + TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.from_openapi_data_( + { + }, + configuration_=self.configuration_ + ) + + def test_an_explicit_property_value_is_checked_against_maximum_passing_passes(self): + # an explicit property value is checked against maximum (passing) + TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.from_openapi_data_( + { + "alpha": + 1, + }, + configuration_=self.configuration_ + ) + + def test_an_explicit_property_value_is_checked_against_maximum_failing_fails(self): + # an explicit property value is checked against maximum (failing) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.from_openapi_data_( + { + "alpha": + 5, + }, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_uniqueitems_false_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_uniqueitems_false_validation.py new file mode 100644 index 00000000000..20ec05f4b3b --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_uniqueitems_false_validation.py @@ -0,0 +1,246 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.uniqueitems_false_validation import UniqueitemsFalseValidation +from unit_test_api import configuration + + +class TestUniqueitemsFalseValidation(unittest.TestCase): + """UniqueitemsFalseValidation unit test stubs""" + configuration_ = configuration.Configuration() + + def test_non_unique_array_of_integers_is_valid_passes(self): + # non-unique array of integers is valid + UniqueitemsFalseValidation.from_openapi_data_( + [ + 1, + 1, + ], + configuration_=self.configuration_ + ) + + def test_unique_array_of_objects_is_valid_passes(self): + # unique array of objects is valid + UniqueitemsFalseValidation.from_openapi_data_( + [ + { + "foo": + "bar", + }, + { + "foo": + "baz", + }, + ], + configuration_=self.configuration_ + ) + + def test_non_unique_array_of_nested_objects_is_valid_passes(self): + # non-unique array of nested objects is valid + UniqueitemsFalseValidation.from_openapi_data_( + [ + { + "foo": + { + "bar": + { + "baz": + True, + }, + }, + }, + { + "foo": + { + "bar": + { + "baz": + True, + }, + }, + }, + ], + configuration_=self.configuration_ + ) + + def test_non_unique_array_of_objects_is_valid_passes(self): + # non-unique array of objects is valid + UniqueitemsFalseValidation.from_openapi_data_( + [ + { + "foo": + "bar", + }, + { + "foo": + "bar", + }, + ], + configuration_=self.configuration_ + ) + + def test_1_and_true_are_unique_passes(self): + # 1 and true are unique + UniqueitemsFalseValidation.from_openapi_data_( + [ + 1, + True, + ], + configuration_=self.configuration_ + ) + + def test_unique_array_of_integers_is_valid_passes(self): + # unique array of integers is valid + UniqueitemsFalseValidation.from_openapi_data_( + [ + 1, + 2, + ], + configuration_=self.configuration_ + ) + + def test_non_unique_array_of_arrays_is_valid_passes(self): + # non-unique array of arrays is valid + UniqueitemsFalseValidation.from_openapi_data_( + [ + [ + "foo", + ], + [ + "foo", + ], + ], + configuration_=self.configuration_ + ) + + def test_numbers_are_unique_if_mathematically_unequal_passes(self): + # numbers are unique if mathematically unequal + UniqueitemsFalseValidation.from_openapi_data_( + [ + 1.0, + 1.0, + 1, + ], + configuration_=self.configuration_ + ) + + def test_false_is_not_equal_to_zero_passes(self): + # false is not equal to zero + UniqueitemsFalseValidation.from_openapi_data_( + [ + 0, + False, + ], + configuration_=self.configuration_ + ) + + def test_unique_array_of_nested_objects_is_valid_passes(self): + # unique array of nested objects is valid + UniqueitemsFalseValidation.from_openapi_data_( + [ + { + "foo": + { + "bar": + { + "baz": + True, + }, + }, + }, + { + "foo": + { + "bar": + { + "baz": + False, + }, + }, + }, + ], + configuration_=self.configuration_ + ) + + def test_0_and_false_are_unique_passes(self): + # 0 and false are unique + UniqueitemsFalseValidation.from_openapi_data_( + [ + 0, + False, + ], + configuration_=self.configuration_ + ) + + def test_unique_array_of_arrays_is_valid_passes(self): + # unique array of arrays is valid + UniqueitemsFalseValidation.from_openapi_data_( + [ + [ + "foo", + ], + [ + "bar", + ], + ], + configuration_=self.configuration_ + ) + + def test_true_is_not_equal_to_one_passes(self): + # true is not equal to one + UniqueitemsFalseValidation.from_openapi_data_( + [ + 1, + True, + ], + configuration_=self.configuration_ + ) + + def test_non_unique_heterogeneous_types_are_valid_passes(self): + # non-unique heterogeneous types are valid + UniqueitemsFalseValidation.from_openapi_data_( + [ + { + }, + [ + 1, + ], + True, + None, + { + }, + 1, + ], + configuration_=self.configuration_ + ) + + def test_unique_heterogeneous_types_are_valid_passes(self): + # unique heterogeneous types are valid + UniqueitemsFalseValidation.from_openapi_data_( + [ + { + }, + [ + 1, + ], + True, + None, + 1, + ], + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_uniqueitems_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_uniqueitems_validation.py similarity index 78% rename from samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_uniqueitems_validation.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_uniqueitems_validation.py index 819beed3070..97d165d9005 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_uniqueitems_validation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_uniqueitems_validation.py @@ -6,23 +6,23 @@ sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest import unit_test_api -from unit_test_api.model.uniqueitems_validation import UniqueitemsValidation +from unit_test_api.components.schema.uniqueitems_validation import UniqueitemsValidation from unit_test_api import configuration class TestUniqueitemsValidation(unittest.TestCase): """UniqueitemsValidation unit test stubs""" - _configuration = configuration.Configuration() + configuration_ = configuration.Configuration() def test_unique_array_of_objects_is_valid_passes(self): # unique array of objects is valid - UniqueitemsValidation.from_openapi_data_oapg( + UniqueitemsValidation.from_openapi_data_( [ { "foo": @@ -33,12 +33,12 @@ def test_unique_array_of_objects_is_valid_passes(self): "baz", }, ], - _configuration=self._configuration + configuration_=self.configuration_ ) def test_a_true_and_a1_are_unique_passes(self): # {"a": true} and {"a": 1} are unique - UniqueitemsValidation.from_openapi_data_oapg( + UniqueitemsValidation.from_openapi_data_( [ { "a": @@ -49,13 +49,13 @@ def test_a_true_and_a1_are_unique_passes(self): 1, }, ], - _configuration=self._configuration + configuration_=self.configuration_ ) def test_non_unique_heterogeneous_types_are_invalid_fails(self): # non-unique heterogeneous types are invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - UniqueitemsValidation.from_openapi_data_oapg( + UniqueitemsValidation.from_openapi_data_( [ { }, @@ -68,12 +68,12 @@ def test_non_unique_heterogeneous_types_are_invalid_fails(self): }, 1, ], - _configuration=self._configuration + configuration_=self.configuration_ ) def test_nested0_and_false_are_unique_passes(self): # nested [0] and [false] are unique - UniqueitemsValidation.from_openapi_data_oapg( + UniqueitemsValidation.from_openapi_data_( [ [ [ @@ -88,12 +88,12 @@ def test_nested0_and_false_are_unique_passes(self): "foo", ], ], - _configuration=self._configuration + configuration_=self.configuration_ ) def test_a_false_and_a0_are_unique_passes(self): # {"a": false} and {"a": 0} are unique - UniqueitemsValidation.from_openapi_data_oapg( + UniqueitemsValidation.from_openapi_data_( [ { "a": @@ -104,34 +104,34 @@ def test_a_false_and_a0_are_unique_passes(self): 0, }, ], - _configuration=self._configuration + configuration_=self.configuration_ ) def test_numbers_are_unique_if_mathematically_unequal_fails(self): # numbers are unique if mathematically unequal with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - UniqueitemsValidation.from_openapi_data_oapg( + UniqueitemsValidation.from_openapi_data_( [ 1.0, 1.0, 1, ], - _configuration=self._configuration + configuration_=self.configuration_ ) def test_false_is_not_equal_to_zero_passes(self): # false is not equal to zero - UniqueitemsValidation.from_openapi_data_oapg( + UniqueitemsValidation.from_openapi_data_( [ 0, False, ], - _configuration=self._configuration + configuration_=self.configuration_ ) def test_0_and_false_are_unique_passes(self): # [0] and [false] are unique - UniqueitemsValidation.from_openapi_data_oapg( + UniqueitemsValidation.from_openapi_data_( [ [ 0, @@ -140,12 +140,12 @@ def test_0_and_false_are_unique_passes(self): False, ], ], - _configuration=self._configuration + configuration_=self.configuration_ ) def test_unique_array_of_arrays_is_valid_passes(self): # unique array of arrays is valid - UniqueitemsValidation.from_openapi_data_oapg( + UniqueitemsValidation.from_openapi_data_( [ [ "foo", @@ -154,13 +154,13 @@ def test_unique_array_of_arrays_is_valid_passes(self): "bar", ], ], - _configuration=self._configuration + configuration_=self.configuration_ ) def test_non_unique_array_of_nested_objects_is_invalid_fails(self): # non-unique array of nested objects is invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - UniqueitemsValidation.from_openapi_data_oapg( + UniqueitemsValidation.from_openapi_data_( [ { "foo": @@ -183,35 +183,35 @@ def test_non_unique_array_of_nested_objects_is_invalid_fails(self): }, }, ], - _configuration=self._configuration + configuration_=self.configuration_ ) def test_non_unique_array_of_more_than_two_integers_is_invalid_fails(self): # non-unique array of more than two integers is invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - UniqueitemsValidation.from_openapi_data_oapg( + UniqueitemsValidation.from_openapi_data_( [ 1, 2, 1, ], - _configuration=self._configuration + configuration_=self.configuration_ ) def test_true_is_not_equal_to_one_passes(self): # true is not equal to one - UniqueitemsValidation.from_openapi_data_oapg( + UniqueitemsValidation.from_openapi_data_( [ 1, True, ], - _configuration=self._configuration + configuration_=self.configuration_ ) def test_objects_are_non_unique_despite_key_order_fails(self): # objects are non-unique despite key order with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - UniqueitemsValidation.from_openapi_data_oapg( + UniqueitemsValidation.from_openapi_data_( [ { "a": @@ -226,23 +226,23 @@ def test_objects_are_non_unique_despite_key_order_fails(self): 1, }, ], - _configuration=self._configuration + configuration_=self.configuration_ ) def test_unique_array_of_strings_is_valid_passes(self): # unique array of strings is valid - UniqueitemsValidation.from_openapi_data_oapg( + UniqueitemsValidation.from_openapi_data_( [ "foo", "bar", "baz", ], - _configuration=self._configuration + configuration_=self.configuration_ ) def test_1_and_true_are_unique_passes(self): # [1] and [true] are unique - UniqueitemsValidation.from_openapi_data_oapg( + UniqueitemsValidation.from_openapi_data_( [ [ 1, @@ -251,12 +251,12 @@ def test_1_and_true_are_unique_passes(self): True, ], ], - _configuration=self._configuration + configuration_=self.configuration_ ) def test_different_objects_are_unique_passes(self): # different objects are unique - UniqueitemsValidation.from_openapi_data_oapg( + UniqueitemsValidation.from_openapi_data_( [ { "a": @@ -271,23 +271,23 @@ def test_different_objects_are_unique_passes(self): 1, }, ], - _configuration=self._configuration + configuration_=self.configuration_ ) def test_unique_array_of_integers_is_valid_passes(self): # unique array of integers is valid - UniqueitemsValidation.from_openapi_data_oapg( + UniqueitemsValidation.from_openapi_data_( [ 1, 2, ], - _configuration=self._configuration + configuration_=self.configuration_ ) def test_non_unique_array_of_more_than_two_arrays_is_invalid_fails(self): # non-unique array of more than two arrays is invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - UniqueitemsValidation.from_openapi_data_oapg( + UniqueitemsValidation.from_openapi_data_( [ [ "foo", @@ -299,13 +299,13 @@ def test_non_unique_array_of_more_than_two_arrays_is_invalid_fails(self): "foo", ], ], - _configuration=self._configuration + configuration_=self.configuration_ ) def test_non_unique_array_of_objects_is_invalid_fails(self): # non-unique array of objects is invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - UniqueitemsValidation.from_openapi_data_oapg( + UniqueitemsValidation.from_openapi_data_( [ { "foo": @@ -316,12 +316,12 @@ def test_non_unique_array_of_objects_is_invalid_fails(self): "bar", }, ], - _configuration=self._configuration + configuration_=self.configuration_ ) def test_unique_array_of_nested_objects_is_valid_passes(self): # unique array of nested objects is valid - UniqueitemsValidation.from_openapi_data_oapg( + UniqueitemsValidation.from_openapi_data_( [ { "foo": @@ -344,13 +344,13 @@ def test_unique_array_of_nested_objects_is_valid_passes(self): }, }, ], - _configuration=self._configuration + configuration_=self.configuration_ ) def test_non_unique_array_of_arrays_is_invalid_fails(self): # non-unique array of arrays is invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - UniqueitemsValidation.from_openapi_data_oapg( + UniqueitemsValidation.from_openapi_data_( [ [ "foo", @@ -359,24 +359,24 @@ def test_non_unique_array_of_arrays_is_invalid_fails(self): "foo", ], ], - _configuration=self._configuration + configuration_=self.configuration_ ) def test_non_unique_array_of_strings_is_invalid_fails(self): # non-unique array of strings is invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - UniqueitemsValidation.from_openapi_data_oapg( + UniqueitemsValidation.from_openapi_data_( [ "foo", "bar", "foo", ], - _configuration=self._configuration + configuration_=self.configuration_ ) def test_nested1_and_true_are_unique_passes(self): # nested [1] and [true] are unique - UniqueitemsValidation.from_openapi_data_oapg( + UniqueitemsValidation.from_openapi_data_( [ [ [ @@ -391,12 +391,12 @@ def test_nested1_and_true_are_unique_passes(self): "foo", ], ], - _configuration=self._configuration + configuration_=self.configuration_ ) def test_unique_heterogeneous_types_are_valid_passes(self): # unique heterogeneous types are valid - UniqueitemsValidation.from_openapi_data_oapg( + UniqueitemsValidation.from_openapi_data_( [ { }, @@ -408,18 +408,18 @@ def test_unique_heterogeneous_types_are_valid_passes(self): 1, "{}", ], - _configuration=self._configuration + configuration_=self.configuration_ ) def test_non_unique_array_of_integers_is_invalid_fails(self): # non-unique array of integers is invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - UniqueitemsValidation.from_openapi_data_oapg( + UniqueitemsValidation.from_openapi_data_( [ 1, 1, ], - _configuration=self._configuration + configuration_=self.configuration_ ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_uri_format.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_uri_format.py new file mode 100644 index 00000000000..87279b23274 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_uri_format.py @@ -0,0 +1,69 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.uri_format import UriFormat +from unit_test_api import configuration + + +class TestUriFormat(unittest.TestCase): + """UriFormat unit test stubs""" + configuration_ = configuration.Configuration() + + def test_all_string_formats_ignore_objects_passes(self): + # all string formats ignore objects + UriFormat.from_openapi_data_( + { + }, + configuration_=self.configuration_ + ) + + def test_all_string_formats_ignore_booleans_passes(self): + # all string formats ignore booleans + UriFormat.from_openapi_data_( + False, + configuration_=self.configuration_ + ) + + def test_all_string_formats_ignore_integers_passes(self): + # all string formats ignore integers + UriFormat.from_openapi_data_( + 12, + configuration_=self.configuration_ + ) + + def test_all_string_formats_ignore_floats_passes(self): + # all string formats ignore floats + UriFormat.from_openapi_data_( + 13.7, + configuration_=self.configuration_ + ) + + def test_all_string_formats_ignore_arrays_passes(self): + # all string formats ignore arrays + UriFormat.from_openapi_data_( + [ + ], + configuration_=self.configuration_ + ) + + def test_all_string_formats_ignore_nulls_passes(self): + # all string formats ignore nulls + UriFormat.from_openapi_data_( + None, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_uri_reference_format.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_uri_reference_format.py new file mode 100644 index 00000000000..092ccd38951 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_uri_reference_format.py @@ -0,0 +1,69 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.uri_reference_format import UriReferenceFormat +from unit_test_api import configuration + + +class TestUriReferenceFormat(unittest.TestCase): + """UriReferenceFormat unit test stubs""" + configuration_ = configuration.Configuration() + + def test_all_string_formats_ignore_objects_passes(self): + # all string formats ignore objects + UriReferenceFormat.from_openapi_data_( + { + }, + configuration_=self.configuration_ + ) + + def test_all_string_formats_ignore_booleans_passes(self): + # all string formats ignore booleans + UriReferenceFormat.from_openapi_data_( + False, + configuration_=self.configuration_ + ) + + def test_all_string_formats_ignore_integers_passes(self): + # all string formats ignore integers + UriReferenceFormat.from_openapi_data_( + 12, + configuration_=self.configuration_ + ) + + def test_all_string_formats_ignore_floats_passes(self): + # all string formats ignore floats + UriReferenceFormat.from_openapi_data_( + 13.7, + configuration_=self.configuration_ + ) + + def test_all_string_formats_ignore_arrays_passes(self): + # all string formats ignore arrays + UriReferenceFormat.from_openapi_data_( + [ + ], + configuration_=self.configuration_ + ) + + def test_all_string_formats_ignore_nulls_passes(self): + # all string formats ignore nulls + UriReferenceFormat.from_openapi_data_( + None, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_uri_template_format.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_uri_template_format.py new file mode 100644 index 00000000000..09942297f6d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_uri_template_format.py @@ -0,0 +1,69 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import unit_test_api +from unit_test_api.components.schema.uri_template_format import UriTemplateFormat +from unit_test_api import configuration + + +class TestUriTemplateFormat(unittest.TestCase): + """UriTemplateFormat unit test stubs""" + configuration_ = configuration.Configuration() + + def test_all_string_formats_ignore_objects_passes(self): + # all string formats ignore objects + UriTemplateFormat.from_openapi_data_( + { + }, + configuration_=self.configuration_ + ) + + def test_all_string_formats_ignore_booleans_passes(self): + # all string formats ignore booleans + UriTemplateFormat.from_openapi_data_( + False, + configuration_=self.configuration_ + ) + + def test_all_string_formats_ignore_integers_passes(self): + # all string formats ignore integers + UriTemplateFormat.from_openapi_data_( + 12, + configuration_=self.configuration_ + ) + + def test_all_string_formats_ignore_floats_passes(self): + # all string formats ignore floats + UriTemplateFormat.from_openapi_data_( + 13.7, + configuration_=self.configuration_ + ) + + def test_all_string_formats_ignore_arrays_passes(self): + # all string formats ignore arrays + UriTemplateFormat.from_openapi_data_( + [ + ], + configuration_=self.configuration_ + ) + + def test_all_string_formats_ignore_nulls_passes(self): + # all string formats ignore nulls + UriTemplateFormat.from_openapi_data_( + None, + configuration_=self.configuration_ + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_additionalproperties_are_allowed_by_default.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_additionalproperties_are_allowed_by_default.py deleted file mode 100644 index ede7b006506..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_additionalproperties_are_allowed_by_default.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.additionalproperties_are_allowed_by_default import AdditionalpropertiesAreAllowedByDefault -from unit_test_api import configuration - - -class TestAdditionalpropertiesAreAllowedByDefault(unittest.TestCase): - """AdditionalpropertiesAreAllowedByDefault unit test stubs""" - _configuration = configuration.Configuration() - - def test_additional_properties_are_allowed_passes(self): - # additional properties are allowed - AdditionalpropertiesAreAllowedByDefault.from_openapi_data_oapg( - { - "foo": - 1, - "bar": - 2, - "quux": - True, - }, - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_additionalproperties_can_exist_by_itself.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_additionalproperties_can_exist_by_itself.py deleted file mode 100644 index fd4c4b4e9f9..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_additionalproperties_can_exist_by_itself.py +++ /dev/null @@ -1,46 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.additionalproperties_can_exist_by_itself import AdditionalpropertiesCanExistByItself -from unit_test_api import configuration - - -class TestAdditionalpropertiesCanExistByItself(unittest.TestCase): - """AdditionalpropertiesCanExistByItself unit test stubs""" - _configuration = configuration.Configuration() - - def test_an_additional_invalid_property_is_invalid_fails(self): - # an additional invalid property is invalid - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - AdditionalpropertiesCanExistByItself.from_openapi_data_oapg( - { - "foo": - 1, - }, - _configuration=self._configuration - ) - - def test_an_additional_valid_property_is_valid_passes(self): - # an additional valid property is valid - AdditionalpropertiesCanExistByItself.from_openapi_data_oapg( - { - "foo": - True, - }, - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_additionalproperties_should_not_look_in_applicators.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_additionalproperties_should_not_look_in_applicators.py deleted file mode 100644 index cc08697897f..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_additionalproperties_should_not_look_in_applicators.py +++ /dev/null @@ -1,50 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.additionalproperties_should_not_look_in_applicators import AdditionalpropertiesShouldNotLookInApplicators -from unit_test_api import configuration - - -class TestAdditionalpropertiesShouldNotLookInApplicators(unittest.TestCase): - """AdditionalpropertiesShouldNotLookInApplicators unit test stubs""" - _configuration = configuration.Configuration() - - def test_properties_defined_in_allof_are_not_examined_fails(self): - # properties defined in allOf are not examined - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - AdditionalpropertiesShouldNotLookInApplicators.from_openapi_data_oapg( - { - "foo": - 1, - "bar": - True, - }, - _configuration=self._configuration - ) - - def test_valid_test_case_passes(self): - # valid test case - AdditionalpropertiesShouldNotLookInApplicators.from_openapi_data_oapg( - { - "foo": - False, - "bar": - True, - }, - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_allof.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_allof.py deleted file mode 100644 index d03edae4b79..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_allof.py +++ /dev/null @@ -1,72 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.allof import Allof -from unit_test_api import configuration - - -class TestAllof(unittest.TestCase): - """Allof unit test stubs""" - _configuration = configuration.Configuration() - - def test_allof_passes(self): - # allOf - Allof.from_openapi_data_oapg( - { - "foo": - "baz", - "bar": - 2, - }, - _configuration=self._configuration - ) - - def test_mismatch_first_fails(self): - # mismatch first - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - Allof.from_openapi_data_oapg( - { - "bar": - 2, - }, - _configuration=self._configuration - ) - - def test_mismatch_second_fails(self): - # mismatch second - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - Allof.from_openapi_data_oapg( - { - "foo": - "baz", - }, - _configuration=self._configuration - ) - - def test_wrong_type_fails(self): - # wrong type - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - Allof.from_openapi_data_oapg( - { - "foo": - "baz", - "bar": - "quux", - }, - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_allof_combined_with_anyof_oneof.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_allof_combined_with_anyof_oneof.py deleted file mode 100644 index f1875ccfff7..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_allof_combined_with_anyof_oneof.py +++ /dev/null @@ -1,88 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.allof_combined_with_anyof_oneof import AllofCombinedWithAnyofOneof -from unit_test_api import configuration - - -class TestAllofCombinedWithAnyofOneof(unittest.TestCase): - """AllofCombinedWithAnyofOneof unit test stubs""" - _configuration = configuration.Configuration() - - def test_allof_true_anyof_false_oneof_false_fails(self): - # allOf: true, anyOf: false, oneOf: false - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - AllofCombinedWithAnyofOneof.from_openapi_data_oapg( - 2, - _configuration=self._configuration - ) - - def test_allof_false_anyof_false_oneof_true_fails(self): - # allOf: false, anyOf: false, oneOf: true - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - AllofCombinedWithAnyofOneof.from_openapi_data_oapg( - 5, - _configuration=self._configuration - ) - - def test_allof_false_anyof_true_oneof_true_fails(self): - # allOf: false, anyOf: true, oneOf: true - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - AllofCombinedWithAnyofOneof.from_openapi_data_oapg( - 15, - _configuration=self._configuration - ) - - def test_allof_true_anyof_true_oneof_false_fails(self): - # allOf: true, anyOf: true, oneOf: false - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - AllofCombinedWithAnyofOneof.from_openapi_data_oapg( - 6, - _configuration=self._configuration - ) - - def test_allof_true_anyof_true_oneof_true_passes(self): - # allOf: true, anyOf: true, oneOf: true - AllofCombinedWithAnyofOneof.from_openapi_data_oapg( - 30, - _configuration=self._configuration - ) - - def test_allof_true_anyof_false_oneof_true_fails(self): - # allOf: true, anyOf: false, oneOf: true - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - AllofCombinedWithAnyofOneof.from_openapi_data_oapg( - 10, - _configuration=self._configuration - ) - - def test_allof_false_anyof_true_oneof_false_fails(self): - # allOf: false, anyOf: true, oneOf: false - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - AllofCombinedWithAnyofOneof.from_openapi_data_oapg( - 3, - _configuration=self._configuration - ) - - def test_allof_false_anyof_false_oneof_false_fails(self): - # allOf: false, anyOf: false, oneOf: false - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - AllofCombinedWithAnyofOneof.from_openapi_data_oapg( - 1, - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_allof_simple_types.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_allof_simple_types.py deleted file mode 100644 index 7f351098909..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_allof_simple_types.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.allof_simple_types import AllofSimpleTypes -from unit_test_api import configuration - - -class TestAllofSimpleTypes(unittest.TestCase): - """AllofSimpleTypes unit test stubs""" - _configuration = configuration.Configuration() - - def test_valid_passes(self): - # valid - AllofSimpleTypes.from_openapi_data_oapg( - 25, - _configuration=self._configuration - ) - - def test_mismatch_one_fails(self): - # mismatch one - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - AllofSimpleTypes.from_openapi_data_oapg( - 35, - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_allof_with_base_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_allof_with_base_schema.py deleted file mode 100644 index f089c4a39fe..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_allof_with_base_schema.py +++ /dev/null @@ -1,89 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.allof_with_base_schema import AllofWithBaseSchema -from unit_test_api import configuration - - -class TestAllofWithBaseSchema(unittest.TestCase): - """AllofWithBaseSchema unit test stubs""" - _configuration = configuration.Configuration() - - def test_valid_passes(self): - # valid - AllofWithBaseSchema.from_openapi_data_oapg( - { - "foo": - "quux", - "bar": - 2, - "baz": - None, - }, - _configuration=self._configuration - ) - - def test_mismatch_first_allof_fails(self): - # mismatch first allOf - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - AllofWithBaseSchema.from_openapi_data_oapg( - { - "bar": - 2, - "baz": - None, - }, - _configuration=self._configuration - ) - - def test_mismatch_base_schema_fails(self): - # mismatch base schema - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - AllofWithBaseSchema.from_openapi_data_oapg( - { - "foo": - "quux", - "baz": - None, - }, - _configuration=self._configuration - ) - - def test_mismatch_both_fails(self): - # mismatch both - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - AllofWithBaseSchema.from_openapi_data_oapg( - { - "bar": - 2, - }, - _configuration=self._configuration - ) - - def test_mismatch_second_allof_fails(self): - # mismatch second allOf - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - AllofWithBaseSchema.from_openapi_data_oapg( - { - "foo": - "quux", - "bar": - 2, - }, - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_allof_with_one_empty_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_allof_with_one_empty_schema.py deleted file mode 100644 index f3eee78309c..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_allof_with_one_empty_schema.py +++ /dev/null @@ -1,32 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.allof_with_one_empty_schema import AllofWithOneEmptySchema -from unit_test_api import configuration - - -class TestAllofWithOneEmptySchema(unittest.TestCase): - """AllofWithOneEmptySchema unit test stubs""" - _configuration = configuration.Configuration() - - def test_any_data_is_valid_passes(self): - # any data is valid - AllofWithOneEmptySchema.from_openapi_data_oapg( - 1, - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_allof_with_the_first_empty_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_allof_with_the_first_empty_schema.py deleted file mode 100644 index f30ef23cb29..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_allof_with_the_first_empty_schema.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.allof_with_the_first_empty_schema import AllofWithTheFirstEmptySchema -from unit_test_api import configuration - - -class TestAllofWithTheFirstEmptySchema(unittest.TestCase): - """AllofWithTheFirstEmptySchema unit test stubs""" - _configuration = configuration.Configuration() - - def test_string_is_invalid_fails(self): - # string is invalid - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - AllofWithTheFirstEmptySchema.from_openapi_data_oapg( - "foo", - _configuration=self._configuration - ) - - def test_number_is_valid_passes(self): - # number is valid - AllofWithTheFirstEmptySchema.from_openapi_data_oapg( - 1, - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_allof_with_the_last_empty_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_allof_with_the_last_empty_schema.py deleted file mode 100644 index 94e0a662c19..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_allof_with_the_last_empty_schema.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.allof_with_the_last_empty_schema import AllofWithTheLastEmptySchema -from unit_test_api import configuration - - -class TestAllofWithTheLastEmptySchema(unittest.TestCase): - """AllofWithTheLastEmptySchema unit test stubs""" - _configuration = configuration.Configuration() - - def test_string_is_invalid_fails(self): - # string is invalid - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - AllofWithTheLastEmptySchema.from_openapi_data_oapg( - "foo", - _configuration=self._configuration - ) - - def test_number_is_valid_passes(self): - # number is valid - AllofWithTheLastEmptySchema.from_openapi_data_oapg( - 1, - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_allof_with_two_empty_schemas.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_allof_with_two_empty_schemas.py deleted file mode 100644 index db5b6fa9caf..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_allof_with_two_empty_schemas.py +++ /dev/null @@ -1,32 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.allof_with_two_empty_schemas import AllofWithTwoEmptySchemas -from unit_test_api import configuration - - -class TestAllofWithTwoEmptySchemas(unittest.TestCase): - """AllofWithTwoEmptySchemas unit test stubs""" - _configuration = configuration.Configuration() - - def test_any_data_is_valid_passes(self): - # any data is valid - AllofWithTwoEmptySchemas.from_openapi_data_oapg( - 1, - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_anyof.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_anyof.py deleted file mode 100644 index d300d967d03..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_anyof.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.anyof import Anyof -from unit_test_api import configuration - - -class TestAnyof(unittest.TestCase): - """Anyof unit test stubs""" - _configuration = configuration.Configuration() - - def test_second_anyof_valid_passes(self): - # second anyOf valid - Anyof.from_openapi_data_oapg( - 2.5, - _configuration=self._configuration - ) - - def test_neither_anyof_valid_fails(self): - # neither anyOf valid - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - Anyof.from_openapi_data_oapg( - 1.5, - _configuration=self._configuration - ) - - def test_both_anyof_valid_passes(self): - # both anyOf valid - Anyof.from_openapi_data_oapg( - 3, - _configuration=self._configuration - ) - - def test_first_anyof_valid_passes(self): - # first anyOf valid - Anyof.from_openapi_data_oapg( - 1, - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_anyof_complex_types.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_anyof_complex_types.py deleted file mode 100644 index fc6d14191dc..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_anyof_complex_types.py +++ /dev/null @@ -1,70 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.anyof_complex_types import AnyofComplexTypes -from unit_test_api import configuration - - -class TestAnyofComplexTypes(unittest.TestCase): - """AnyofComplexTypes unit test stubs""" - _configuration = configuration.Configuration() - - def test_second_anyof_valid_complex_passes(self): - # second anyOf valid (complex) - AnyofComplexTypes.from_openapi_data_oapg( - { - "foo": - "baz", - }, - _configuration=self._configuration - ) - - def test_neither_anyof_valid_complex_fails(self): - # neither anyOf valid (complex) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - AnyofComplexTypes.from_openapi_data_oapg( - { - "foo": - 2, - "bar": - "quux", - }, - _configuration=self._configuration - ) - - def test_both_anyof_valid_complex_passes(self): - # both anyOf valid (complex) - AnyofComplexTypes.from_openapi_data_oapg( - { - "foo": - "baz", - "bar": - 2, - }, - _configuration=self._configuration - ) - - def test_first_anyof_valid_complex_passes(self): - # first anyOf valid (complex) - AnyofComplexTypes.from_openapi_data_oapg( - { - "bar": - 2, - }, - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_anyof_with_base_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_anyof_with_base_schema.py deleted file mode 100644 index 7edf767ad5b..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_anyof_with_base_schema.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.anyof_with_base_schema import AnyofWithBaseSchema -from unit_test_api import configuration - - -class TestAnyofWithBaseSchema(unittest.TestCase): - """AnyofWithBaseSchema unit test stubs""" - _configuration = configuration.Configuration() - - def test_one_anyof_valid_passes(self): - # one anyOf valid - AnyofWithBaseSchema.from_openapi_data_oapg( - "foobar", - _configuration=self._configuration - ) - - def test_both_anyof_invalid_fails(self): - # both anyOf invalid - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - AnyofWithBaseSchema.from_openapi_data_oapg( - "foo", - _configuration=self._configuration - ) - - def test_mismatch_base_schema_fails(self): - # mismatch base schema - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - AnyofWithBaseSchema.from_openapi_data_oapg( - 3, - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_anyof_with_one_empty_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_anyof_with_one_empty_schema.py deleted file mode 100644 index 31cc78ca3c2..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_anyof_with_one_empty_schema.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.anyof_with_one_empty_schema import AnyofWithOneEmptySchema -from unit_test_api import configuration - - -class TestAnyofWithOneEmptySchema(unittest.TestCase): - """AnyofWithOneEmptySchema unit test stubs""" - _configuration = configuration.Configuration() - - def test_string_is_valid_passes(self): - # string is valid - AnyofWithOneEmptySchema.from_openapi_data_oapg( - "foo", - _configuration=self._configuration - ) - - def test_number_is_valid_passes(self): - # number is valid - AnyofWithOneEmptySchema.from_openapi_data_oapg( - 123, - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_array_type_matches_arrays.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_array_type_matches_arrays.py deleted file mode 100644 index 98fbd44a16c..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_array_type_matches_arrays.py +++ /dev/null @@ -1,82 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.array_type_matches_arrays import ArrayTypeMatchesArrays -from unit_test_api import configuration - - -class TestArrayTypeMatchesArrays(unittest.TestCase): - """ArrayTypeMatchesArrays unit test stubs""" - _configuration = configuration.Configuration() - - def test_a_float_is_not_an_array_fails(self): - # a float is not an array - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - ArrayTypeMatchesArrays.from_openapi_data_oapg( - 1.1, - _configuration=self._configuration - ) - - def test_a_boolean_is_not_an_array_fails(self): - # a boolean is not an array - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - ArrayTypeMatchesArrays.from_openapi_data_oapg( - True, - _configuration=self._configuration - ) - - def test_null_is_not_an_array_fails(self): - # null is not an array - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - ArrayTypeMatchesArrays.from_openapi_data_oapg( - None, - _configuration=self._configuration - ) - - def test_an_object_is_not_an_array_fails(self): - # an object is not an array - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - ArrayTypeMatchesArrays.from_openapi_data_oapg( - { - }, - _configuration=self._configuration - ) - - def test_a_string_is_not_an_array_fails(self): - # a string is not an array - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - ArrayTypeMatchesArrays.from_openapi_data_oapg( - "foo", - _configuration=self._configuration - ) - - def test_an_array_is_an_array_passes(self): - # an array is an array - ArrayTypeMatchesArrays.from_openapi_data_oapg( - [ - ], - _configuration=self._configuration - ) - - def test_an_integer_is_not_an_array_fails(self): - # an integer is not an array - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - ArrayTypeMatchesArrays.from_openapi_data_oapg( - 1, - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_boolean_type_matches_booleans.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_boolean_type_matches_booleans.py deleted file mode 100644 index fc20c8059dc..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_boolean_type_matches_booleans.py +++ /dev/null @@ -1,105 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.boolean_type_matches_booleans import BooleanTypeMatchesBooleans -from unit_test_api import configuration - - -class TestBooleanTypeMatchesBooleans(unittest.TestCase): - """BooleanTypeMatchesBooleans unit test stubs""" - _configuration = configuration.Configuration() - - def test_an_empty_string_is_not_a_boolean_fails(self): - # an empty string is not a boolean - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - BooleanTypeMatchesBooleans.from_openapi_data_oapg( - "", - _configuration=self._configuration - ) - - def test_a_float_is_not_a_boolean_fails(self): - # a float is not a boolean - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - BooleanTypeMatchesBooleans.from_openapi_data_oapg( - 1.1, - _configuration=self._configuration - ) - - def test_null_is_not_a_boolean_fails(self): - # null is not a boolean - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - BooleanTypeMatchesBooleans.from_openapi_data_oapg( - None, - _configuration=self._configuration - ) - - def test_zero_is_not_a_boolean_fails(self): - # zero is not a boolean - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - BooleanTypeMatchesBooleans.from_openapi_data_oapg( - 0, - _configuration=self._configuration - ) - - def test_an_array_is_not_a_boolean_fails(self): - # an array is not a boolean - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - BooleanTypeMatchesBooleans.from_openapi_data_oapg( - [ - ], - _configuration=self._configuration - ) - - def test_a_string_is_not_a_boolean_fails(self): - # a string is not a boolean - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - BooleanTypeMatchesBooleans.from_openapi_data_oapg( - "foo", - _configuration=self._configuration - ) - - def test_false_is_a_boolean_passes(self): - # false is a boolean - BooleanTypeMatchesBooleans.from_openapi_data_oapg( - False, - _configuration=self._configuration - ) - - def test_an_integer_is_not_a_boolean_fails(self): - # an integer is not a boolean - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - BooleanTypeMatchesBooleans.from_openapi_data_oapg( - 1, - _configuration=self._configuration - ) - - def test_true_is_a_boolean_passes(self): - # true is a boolean - BooleanTypeMatchesBooleans.from_openapi_data_oapg( - True, - _configuration=self._configuration - ) - - def test_an_object_is_not_a_boolean_fails(self): - # an object is not a boolean - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - BooleanTypeMatchesBooleans.from_openapi_data_oapg( - { - }, - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_by_int.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_by_int.py deleted file mode 100644 index 4abbab69a57..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_by_int.py +++ /dev/null @@ -1,47 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.by_int import ByInt -from unit_test_api import configuration - - -class TestByInt(unittest.TestCase): - """ByInt unit test stubs""" - _configuration = configuration.Configuration() - - def test_int_by_int_fail_fails(self): - # int by int fail - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - ByInt.from_openapi_data_oapg( - 7, - _configuration=self._configuration - ) - - def test_int_by_int_passes(self): - # int by int - ByInt.from_openapi_data_oapg( - 10, - _configuration=self._configuration - ) - - def test_ignores_non_numbers_passes(self): - # ignores non-numbers - ByInt.from_openapi_data_oapg( - "foo", - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_by_number.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_by_number.py deleted file mode 100644 index 9614cc470d1..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_by_number.py +++ /dev/null @@ -1,47 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.by_number import ByNumber -from unit_test_api import configuration - - -class TestByNumber(unittest.TestCase): - """ByNumber unit test stubs""" - _configuration = configuration.Configuration() - - def test_45_is_multiple_of15_passes(self): - # 4.5 is multiple of 1.5 - ByNumber.from_openapi_data_oapg( - 4.5, - _configuration=self._configuration - ) - - def test_35_is_not_multiple_of15_fails(self): - # 35 is not multiple of 1.5 - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - ByNumber.from_openapi_data_oapg( - 35, - _configuration=self._configuration - ) - - def test_zero_is_multiple_of_anything_passes(self): - # zero is multiple of anything - ByNumber.from_openapi_data_oapg( - 0, - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_by_small_number.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_by_small_number.py deleted file mode 100644 index 3a4e1449caf..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_by_small_number.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.by_small_number import BySmallNumber -from unit_test_api import configuration - - -class TestBySmallNumber(unittest.TestCase): - """BySmallNumber unit test stubs""" - _configuration = configuration.Configuration() - - def test_000751_is_not_multiple_of00001_fails(self): - # 0.00751 is not multiple of 0.0001 - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - BySmallNumber.from_openapi_data_oapg( - 0.00751, - _configuration=self._configuration - ) - - def test_00075_is_multiple_of00001_passes(self): - # 0.0075 is multiple of 0.0001 - BySmallNumber.from_openapi_data_oapg( - 0.0075, - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_date_time_format.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_date_time_format.py deleted file mode 100644 index 1fdd3e3614e..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_date_time_format.py +++ /dev/null @@ -1,69 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.date_time_format import DateTimeFormat -from unit_test_api import configuration - - -class TestDateTimeFormat(unittest.TestCase): - """DateTimeFormat unit test stubs""" - _configuration = configuration.Configuration() - - def test_all_string_formats_ignore_objects_passes(self): - # all string formats ignore objects - DateTimeFormat.from_openapi_data_oapg( - { - }, - _configuration=self._configuration - ) - - def test_all_string_formats_ignore_booleans_passes(self): - # all string formats ignore booleans - DateTimeFormat.from_openapi_data_oapg( - False, - _configuration=self._configuration - ) - - def test_all_string_formats_ignore_integers_passes(self): - # all string formats ignore integers - DateTimeFormat.from_openapi_data_oapg( - 12, - _configuration=self._configuration - ) - - def test_all_string_formats_ignore_floats_passes(self): - # all string formats ignore floats - DateTimeFormat.from_openapi_data_oapg( - 13.7, - _configuration=self._configuration - ) - - def test_all_string_formats_ignore_arrays_passes(self): - # all string formats ignore arrays - DateTimeFormat.from_openapi_data_oapg( - [ - ], - _configuration=self._configuration - ) - - def test_all_string_formats_ignore_nulls_passes(self): - # all string formats ignore nulls - DateTimeFormat.from_openapi_data_oapg( - None, - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_email_format.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_email_format.py deleted file mode 100644 index 830b136aae6..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_email_format.py +++ /dev/null @@ -1,69 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.email_format import EmailFormat -from unit_test_api import configuration - - -class TestEmailFormat(unittest.TestCase): - """EmailFormat unit test stubs""" - _configuration = configuration.Configuration() - - def test_all_string_formats_ignore_objects_passes(self): - # all string formats ignore objects - EmailFormat.from_openapi_data_oapg( - { - }, - _configuration=self._configuration - ) - - def test_all_string_formats_ignore_booleans_passes(self): - # all string formats ignore booleans - EmailFormat.from_openapi_data_oapg( - False, - _configuration=self._configuration - ) - - def test_all_string_formats_ignore_integers_passes(self): - # all string formats ignore integers - EmailFormat.from_openapi_data_oapg( - 12, - _configuration=self._configuration - ) - - def test_all_string_formats_ignore_floats_passes(self): - # all string formats ignore floats - EmailFormat.from_openapi_data_oapg( - 13.7, - _configuration=self._configuration - ) - - def test_all_string_formats_ignore_arrays_passes(self): - # all string formats ignore arrays - EmailFormat.from_openapi_data_oapg( - [ - ], - _configuration=self._configuration - ) - - def test_all_string_formats_ignore_nulls_passes(self): - # all string formats ignore nulls - EmailFormat.from_openapi_data_oapg( - None, - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_enum_with0_does_not_match_false.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_enum_with0_does_not_match_false.py deleted file mode 100644 index 5456b86202f..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_enum_with0_does_not_match_false.py +++ /dev/null @@ -1,47 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.enum_with0_does_not_match_false import EnumWith0DoesNotMatchFalse -from unit_test_api import configuration - - -class TestEnumWith0DoesNotMatchFalse(unittest.TestCase): - """EnumWith0DoesNotMatchFalse unit test stubs""" - _configuration = configuration.Configuration() - - def test_integer_zero_is_valid_passes(self): - # integer zero is valid - EnumWith0DoesNotMatchFalse.from_openapi_data_oapg( - 0, - _configuration=self._configuration - ) - - def test_float_zero_is_valid_passes(self): - # float zero is valid - EnumWith0DoesNotMatchFalse.from_openapi_data_oapg( - 0.0, - _configuration=self._configuration - ) - - def test_false_is_invalid_fails(self): - # false is invalid - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - EnumWith0DoesNotMatchFalse.from_openapi_data_oapg( - False, - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_enum_with1_does_not_match_true.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_enum_with1_does_not_match_true.py deleted file mode 100644 index e9a97663fe6..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_enum_with1_does_not_match_true.py +++ /dev/null @@ -1,47 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.enum_with1_does_not_match_true import EnumWith1DoesNotMatchTrue -from unit_test_api import configuration - - -class TestEnumWith1DoesNotMatchTrue(unittest.TestCase): - """EnumWith1DoesNotMatchTrue unit test stubs""" - _configuration = configuration.Configuration() - - def test_true_is_invalid_fails(self): - # true is invalid - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - EnumWith1DoesNotMatchTrue.from_openapi_data_oapg( - True, - _configuration=self._configuration - ) - - def test_integer_one_is_valid_passes(self): - # integer one is valid - EnumWith1DoesNotMatchTrue.from_openapi_data_oapg( - 1, - _configuration=self._configuration - ) - - def test_float_one_is_valid_passes(self): - # float one is valid - EnumWith1DoesNotMatchTrue.from_openapi_data_oapg( - 1.0, - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_enum_with_escaped_characters.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_enum_with_escaped_characters.py deleted file mode 100644 index 4144f3b77d8..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_enum_with_escaped_characters.py +++ /dev/null @@ -1,47 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.enum_with_escaped_characters import EnumWithEscapedCharacters -from unit_test_api import configuration - - -class TestEnumWithEscapedCharacters(unittest.TestCase): - """EnumWithEscapedCharacters unit test stubs""" - _configuration = configuration.Configuration() - - def test_member2_is_valid_passes(self): - # member 2 is valid - EnumWithEscapedCharacters.from_openapi_data_oapg( - "foo\rbar", - _configuration=self._configuration - ) - - def test_member1_is_valid_passes(self): - # member 1 is valid - EnumWithEscapedCharacters.from_openapi_data_oapg( - "foo\nbar", - _configuration=self._configuration - ) - - def test_another_string_is_invalid_fails(self): - # another string is invalid - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - EnumWithEscapedCharacters.from_openapi_data_oapg( - "abc", - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_enum_with_false_does_not_match0.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_enum_with_false_does_not_match0.py deleted file mode 100644 index ebd6bc55d45..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_enum_with_false_does_not_match0.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.enum_with_false_does_not_match0 import EnumWithFalseDoesNotMatch0 -from unit_test_api import configuration - - -class TestEnumWithFalseDoesNotMatch0(unittest.TestCase): - """EnumWithFalseDoesNotMatch0 unit test stubs""" - _configuration = configuration.Configuration() - - def test_false_is_valid_passes(self): - # false is valid - EnumWithFalseDoesNotMatch0.from_openapi_data_oapg( - False, - _configuration=self._configuration - ) - - def test_float_zero_is_invalid_fails(self): - # float zero is invalid - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - EnumWithFalseDoesNotMatch0.from_openapi_data_oapg( - 0.0, - _configuration=self._configuration - ) - - def test_integer_zero_is_invalid_fails(self): - # integer zero is invalid - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - EnumWithFalseDoesNotMatch0.from_openapi_data_oapg( - 0, - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_enum_with_true_does_not_match1.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_enum_with_true_does_not_match1.py deleted file mode 100644 index 7827ca725b9..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_enum_with_true_does_not_match1.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.enum_with_true_does_not_match1 import EnumWithTrueDoesNotMatch1 -from unit_test_api import configuration - - -class TestEnumWithTrueDoesNotMatch1(unittest.TestCase): - """EnumWithTrueDoesNotMatch1 unit test stubs""" - _configuration = configuration.Configuration() - - def test_float_one_is_invalid_fails(self): - # float one is invalid - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - EnumWithTrueDoesNotMatch1.from_openapi_data_oapg( - 1.0, - _configuration=self._configuration - ) - - def test_true_is_valid_passes(self): - # true is valid - EnumWithTrueDoesNotMatch1.from_openapi_data_oapg( - True, - _configuration=self._configuration - ) - - def test_integer_one_is_invalid_fails(self): - # integer one is invalid - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - EnumWithTrueDoesNotMatch1.from_openapi_data_oapg( - 1, - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_enums_in_properties.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_enums_in_properties.py deleted file mode 100644 index 3850f849db1..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_enums_in_properties.py +++ /dev/null @@ -1,93 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.enums_in_properties import EnumsInProperties -from unit_test_api import configuration - - -class TestEnumsInProperties(unittest.TestCase): - """EnumsInProperties unit test stubs""" - _configuration = configuration.Configuration() - - def test_missing_optional_property_is_valid_passes(self): - # missing optional property is valid - EnumsInProperties.from_openapi_data_oapg( - { - "bar": - "bar", - }, - _configuration=self._configuration - ) - - def test_wrong_foo_value_fails(self): - # wrong foo value - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - EnumsInProperties.from_openapi_data_oapg( - { - "foo": - "foot", - "bar": - "bar", - }, - _configuration=self._configuration - ) - - def test_both_properties_are_valid_passes(self): - # both properties are valid - EnumsInProperties.from_openapi_data_oapg( - { - "foo": - "foo", - "bar": - "bar", - }, - _configuration=self._configuration - ) - - def test_wrong_bar_value_fails(self): - # wrong bar value - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - EnumsInProperties.from_openapi_data_oapg( - { - "foo": - "foo", - "bar": - "bart", - }, - _configuration=self._configuration - ) - - def test_missing_all_properties_is_invalid_fails(self): - # missing all properties is invalid - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - EnumsInProperties.from_openapi_data_oapg( - { - }, - _configuration=self._configuration - ) - - def test_missing_required_property_is_invalid_fails(self): - # missing required property is invalid - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - EnumsInProperties.from_openapi_data_oapg( - { - "foo": - "foo", - }, - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_forbidden_property.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_forbidden_property.py deleted file mode 100644 index f1db3521b1e..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_forbidden_property.py +++ /dev/null @@ -1,50 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.forbidden_property import ForbiddenProperty -from unit_test_api import configuration - - -class TestForbiddenProperty(unittest.TestCase): - """ForbiddenProperty unit test stubs""" - _configuration = configuration.Configuration() - - def test_property_present_fails(self): - # property present - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - ForbiddenProperty.from_openapi_data_oapg( - { - "foo": - 1, - "bar": - 2, - }, - _configuration=self._configuration - ) - - def test_property_absent_passes(self): - # property absent - ForbiddenProperty.from_openapi_data_oapg( - { - "bar": - 1, - "baz": - 2, - }, - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_hostname_format.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_hostname_format.py deleted file mode 100644 index 20c3febcb3e..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_hostname_format.py +++ /dev/null @@ -1,69 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.hostname_format import HostnameFormat -from unit_test_api import configuration - - -class TestHostnameFormat(unittest.TestCase): - """HostnameFormat unit test stubs""" - _configuration = configuration.Configuration() - - def test_all_string_formats_ignore_objects_passes(self): - # all string formats ignore objects - HostnameFormat.from_openapi_data_oapg( - { - }, - _configuration=self._configuration - ) - - def test_all_string_formats_ignore_booleans_passes(self): - # all string formats ignore booleans - HostnameFormat.from_openapi_data_oapg( - False, - _configuration=self._configuration - ) - - def test_all_string_formats_ignore_integers_passes(self): - # all string formats ignore integers - HostnameFormat.from_openapi_data_oapg( - 12, - _configuration=self._configuration - ) - - def test_all_string_formats_ignore_floats_passes(self): - # all string formats ignore floats - HostnameFormat.from_openapi_data_oapg( - 13.7, - _configuration=self._configuration - ) - - def test_all_string_formats_ignore_arrays_passes(self): - # all string formats ignore arrays - HostnameFormat.from_openapi_data_oapg( - [ - ], - _configuration=self._configuration - ) - - def test_all_string_formats_ignore_nulls_passes(self): - # all string formats ignore nulls - HostnameFormat.from_openapi_data_oapg( - None, - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_integer_type_matches_integers.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_integer_type_matches_integers.py deleted file mode 100644 index 4ffba76e328..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_integer_type_matches_integers.py +++ /dev/null @@ -1,97 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.integer_type_matches_integers import IntegerTypeMatchesIntegers -from unit_test_api import configuration - - -class TestIntegerTypeMatchesIntegers(unittest.TestCase): - """IntegerTypeMatchesIntegers unit test stubs""" - _configuration = configuration.Configuration() - - def test_an_object_is_not_an_integer_fails(self): - # an object is not an integer - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - IntegerTypeMatchesIntegers.from_openapi_data_oapg( - { - }, - _configuration=self._configuration - ) - - def test_a_string_is_not_an_integer_fails(self): - # a string is not an integer - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - IntegerTypeMatchesIntegers.from_openapi_data_oapg( - "foo", - _configuration=self._configuration - ) - - def test_null_is_not_an_integer_fails(self): - # null is not an integer - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - IntegerTypeMatchesIntegers.from_openapi_data_oapg( - None, - _configuration=self._configuration - ) - - def test_a_float_with_zero_fractional_part_is_an_integer_passes(self): - # a float with zero fractional part is an integer - IntegerTypeMatchesIntegers.from_openapi_data_oapg( - 1.0, - _configuration=self._configuration - ) - - def test_a_float_is_not_an_integer_fails(self): - # a float is not an integer - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - IntegerTypeMatchesIntegers.from_openapi_data_oapg( - 1.1, - _configuration=self._configuration - ) - - def test_a_boolean_is_not_an_integer_fails(self): - # a boolean is not an integer - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - IntegerTypeMatchesIntegers.from_openapi_data_oapg( - True, - _configuration=self._configuration - ) - - def test_an_integer_is_an_integer_passes(self): - # an integer is an integer - IntegerTypeMatchesIntegers.from_openapi_data_oapg( - 1, - _configuration=self._configuration - ) - - def test_a_string_is_still_not_an_integer_even_if_it_looks_like_one_fails(self): - # a string is still not an integer, even if it looks like one - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - IntegerTypeMatchesIntegers.from_openapi_data_oapg( - "1", - _configuration=self._configuration - ) - - def test_an_array_is_not_an_integer_fails(self): - # an array is not an integer - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - IntegerTypeMatchesIntegers.from_openapi_data_oapg( - [ - ], - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_invalid_instance_should_not_raise_error_when_float_division_inf.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_invalid_instance_should_not_raise_error_when_float_division_inf.py deleted file mode 100644 index fb2c597c565..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_invalid_instance_should_not_raise_error_when_float_division_inf.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.invalid_instance_should_not_raise_error_when_float_division_inf import InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf -from unit_test_api import configuration - - -class TestInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf(unittest.TestCase): - """InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf unit test stubs""" - _configuration = configuration.Configuration() - - def test_always_invalid_but_naive_implementations_may_raise_an_overflow_error_fails(self): - # always invalid, but naive implementations may raise an overflow error - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf.from_openapi_data_oapg( - 1.0E308, - _configuration=self._configuration - ) - - def test_valid_integer_with_multipleof_float_passes(self): - # valid integer with multipleOf float - InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf.from_openapi_data_oapg( - 123456789, - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_invalid_string_value_for_default.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_invalid_string_value_for_default.py deleted file mode 100644 index c62e6e45b56..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_invalid_string_value_for_default.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.invalid_string_value_for_default import InvalidStringValueForDefault -from unit_test_api import configuration - - -class TestInvalidStringValueForDefault(unittest.TestCase): - """InvalidStringValueForDefault unit test stubs""" - _configuration = configuration.Configuration() - - def test_valid_when_property_is_specified_passes(self): - # valid when property is specified - InvalidStringValueForDefault.from_openapi_data_oapg( - { - "bar": - "good", - }, - _configuration=self._configuration - ) - - def test_still_valid_when_the_invalid_default_is_used_passes(self): - # still valid when the invalid default is used - InvalidStringValueForDefault.from_openapi_data_oapg( - { - }, - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_ipv4_format.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_ipv4_format.py deleted file mode 100644 index 19e925b9a7e..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_ipv4_format.py +++ /dev/null @@ -1,69 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.ipv4_format import Ipv4Format -from unit_test_api import configuration - - -class TestIpv4Format(unittest.TestCase): - """Ipv4Format unit test stubs""" - _configuration = configuration.Configuration() - - def test_all_string_formats_ignore_objects_passes(self): - # all string formats ignore objects - Ipv4Format.from_openapi_data_oapg( - { - }, - _configuration=self._configuration - ) - - def test_all_string_formats_ignore_booleans_passes(self): - # all string formats ignore booleans - Ipv4Format.from_openapi_data_oapg( - False, - _configuration=self._configuration - ) - - def test_all_string_formats_ignore_integers_passes(self): - # all string formats ignore integers - Ipv4Format.from_openapi_data_oapg( - 12, - _configuration=self._configuration - ) - - def test_all_string_formats_ignore_floats_passes(self): - # all string formats ignore floats - Ipv4Format.from_openapi_data_oapg( - 13.7, - _configuration=self._configuration - ) - - def test_all_string_formats_ignore_arrays_passes(self): - # all string formats ignore arrays - Ipv4Format.from_openapi_data_oapg( - [ - ], - _configuration=self._configuration - ) - - def test_all_string_formats_ignore_nulls_passes(self): - # all string formats ignore nulls - Ipv4Format.from_openapi_data_oapg( - None, - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_ipv6_format.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_ipv6_format.py deleted file mode 100644 index 09e7895b469..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_ipv6_format.py +++ /dev/null @@ -1,69 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.ipv6_format import Ipv6Format -from unit_test_api import configuration - - -class TestIpv6Format(unittest.TestCase): - """Ipv6Format unit test stubs""" - _configuration = configuration.Configuration() - - def test_all_string_formats_ignore_objects_passes(self): - # all string formats ignore objects - Ipv6Format.from_openapi_data_oapg( - { - }, - _configuration=self._configuration - ) - - def test_all_string_formats_ignore_booleans_passes(self): - # all string formats ignore booleans - Ipv6Format.from_openapi_data_oapg( - False, - _configuration=self._configuration - ) - - def test_all_string_formats_ignore_integers_passes(self): - # all string formats ignore integers - Ipv6Format.from_openapi_data_oapg( - 12, - _configuration=self._configuration - ) - - def test_all_string_formats_ignore_floats_passes(self): - # all string formats ignore floats - Ipv6Format.from_openapi_data_oapg( - 13.7, - _configuration=self._configuration - ) - - def test_all_string_formats_ignore_arrays_passes(self): - # all string formats ignore arrays - Ipv6Format.from_openapi_data_oapg( - [ - ], - _configuration=self._configuration - ) - - def test_all_string_formats_ignore_nulls_passes(self): - # all string formats ignore nulls - Ipv6Format.from_openapi_data_oapg( - None, - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_json_pointer_format.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_json_pointer_format.py deleted file mode 100644 index 9b5fae8d6e7..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_json_pointer_format.py +++ /dev/null @@ -1,69 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.json_pointer_format import JsonPointerFormat -from unit_test_api import configuration - - -class TestJsonPointerFormat(unittest.TestCase): - """JsonPointerFormat unit test stubs""" - _configuration = configuration.Configuration() - - def test_all_string_formats_ignore_objects_passes(self): - # all string formats ignore objects - JsonPointerFormat.from_openapi_data_oapg( - { - }, - _configuration=self._configuration - ) - - def test_all_string_formats_ignore_booleans_passes(self): - # all string formats ignore booleans - JsonPointerFormat.from_openapi_data_oapg( - False, - _configuration=self._configuration - ) - - def test_all_string_formats_ignore_integers_passes(self): - # all string formats ignore integers - JsonPointerFormat.from_openapi_data_oapg( - 12, - _configuration=self._configuration - ) - - def test_all_string_formats_ignore_floats_passes(self): - # all string formats ignore floats - JsonPointerFormat.from_openapi_data_oapg( - 13.7, - _configuration=self._configuration - ) - - def test_all_string_formats_ignore_arrays_passes(self): - # all string formats ignore arrays - JsonPointerFormat.from_openapi_data_oapg( - [ - ], - _configuration=self._configuration - ) - - def test_all_string_formats_ignore_nulls_passes(self): - # all string formats ignore nulls - JsonPointerFormat.from_openapi_data_oapg( - None, - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_maximum_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_maximum_validation.py deleted file mode 100644 index b9cdf9e3617..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_maximum_validation.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.maximum_validation import MaximumValidation -from unit_test_api import configuration - - -class TestMaximumValidation(unittest.TestCase): - """MaximumValidation unit test stubs""" - _configuration = configuration.Configuration() - - def test_below_the_maximum_is_valid_passes(self): - # below the maximum is valid - MaximumValidation.from_openapi_data_oapg( - 2.6, - _configuration=self._configuration - ) - - def test_boundary_point_is_valid_passes(self): - # boundary point is valid - MaximumValidation.from_openapi_data_oapg( - 3.0, - _configuration=self._configuration - ) - - def test_above_the_maximum_is_invalid_fails(self): - # above the maximum is invalid - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - MaximumValidation.from_openapi_data_oapg( - 3.5, - _configuration=self._configuration - ) - - def test_ignores_non_numbers_passes(self): - # ignores non-numbers - MaximumValidation.from_openapi_data_oapg( - "x", - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_maximum_validation_with_unsigned_integer.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_maximum_validation_with_unsigned_integer.py deleted file mode 100644 index c18028ee2af..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_maximum_validation_with_unsigned_integer.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.maximum_validation_with_unsigned_integer import MaximumValidationWithUnsignedInteger -from unit_test_api import configuration - - -class TestMaximumValidationWithUnsignedInteger(unittest.TestCase): - """MaximumValidationWithUnsignedInteger unit test stubs""" - _configuration = configuration.Configuration() - - def test_below_the_maximum_is_invalid_passes(self): - # below the maximum is invalid - MaximumValidationWithUnsignedInteger.from_openapi_data_oapg( - 299.97, - _configuration=self._configuration - ) - - def test_above_the_maximum_is_invalid_fails(self): - # above the maximum is invalid - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - MaximumValidationWithUnsignedInteger.from_openapi_data_oapg( - 300.5, - _configuration=self._configuration - ) - - def test_boundary_point_integer_is_valid_passes(self): - # boundary point integer is valid - MaximumValidationWithUnsignedInteger.from_openapi_data_oapg( - 300, - _configuration=self._configuration - ) - - def test_boundary_point_float_is_valid_passes(self): - # boundary point float is valid - MaximumValidationWithUnsignedInteger.from_openapi_data_oapg( - 300.0, - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_maxitems_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_maxitems_validation.py deleted file mode 100644 index 1a8afe4e9bb..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_maxitems_validation.py +++ /dev/null @@ -1,63 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.maxitems_validation import MaxitemsValidation -from unit_test_api import configuration - - -class TestMaxitemsValidation(unittest.TestCase): - """MaxitemsValidation unit test stubs""" - _configuration = configuration.Configuration() - - def test_too_long_is_invalid_fails(self): - # too long is invalid - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - MaxitemsValidation.from_openapi_data_oapg( - [ - 1, - 2, - 3, - ], - _configuration=self._configuration - ) - - def test_ignores_non_arrays_passes(self): - # ignores non-arrays - MaxitemsValidation.from_openapi_data_oapg( - "foobar", - _configuration=self._configuration - ) - - def test_shorter_is_valid_passes(self): - # shorter is valid - MaxitemsValidation.from_openapi_data_oapg( - [ - 1, - ], - _configuration=self._configuration - ) - - def test_exact_length_is_valid_passes(self): - # exact length is valid - MaxitemsValidation.from_openapi_data_oapg( - [ - 1, - 2, - ], - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_maxlength_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_maxlength_validation.py deleted file mode 100644 index 7454b37934c..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_maxlength_validation.py +++ /dev/null @@ -1,61 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.maxlength_validation import MaxlengthValidation -from unit_test_api import configuration - - -class TestMaxlengthValidation(unittest.TestCase): - """MaxlengthValidation unit test stubs""" - _configuration = configuration.Configuration() - - def test_too_long_is_invalid_fails(self): - # too long is invalid - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - MaxlengthValidation.from_openapi_data_oapg( - "foo", - _configuration=self._configuration - ) - - def test_ignores_non_strings_passes(self): - # ignores non-strings - MaxlengthValidation.from_openapi_data_oapg( - 100, - _configuration=self._configuration - ) - - def test_shorter_is_valid_passes(self): - # shorter is valid - MaxlengthValidation.from_openapi_data_oapg( - "f", - _configuration=self._configuration - ) - - def test_two_supplementary_unicode_code_points_is_long_enough_passes(self): - # two supplementary Unicode code points is long enough - MaxlengthValidation.from_openapi_data_oapg( - "💩💩", - _configuration=self._configuration - ) - - def test_exact_length_is_valid_passes(self): - # exact length is valid - MaxlengthValidation.from_openapi_data_oapg( - "fo", - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_maxproperties0_means_the_object_is_empty.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_maxproperties0_means_the_object_is_empty.py deleted file mode 100644 index 92a8cf2139a..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_maxproperties0_means_the_object_is_empty.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.maxproperties0_means_the_object_is_empty import Maxproperties0MeansTheObjectIsEmpty -from unit_test_api import configuration - - -class TestMaxproperties0MeansTheObjectIsEmpty(unittest.TestCase): - """Maxproperties0MeansTheObjectIsEmpty unit test stubs""" - _configuration = configuration.Configuration() - - def test_no_properties_is_valid_passes(self): - # no properties is valid - Maxproperties0MeansTheObjectIsEmpty.from_openapi_data_oapg( - { - }, - _configuration=self._configuration - ) - - def test_one_property_is_invalid_fails(self): - # one property is invalid - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - Maxproperties0MeansTheObjectIsEmpty.from_openapi_data_oapg( - { - "foo": - 1, - }, - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_maxproperties_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_maxproperties_validation.py deleted file mode 100644 index cc3684783b6..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_maxproperties_validation.py +++ /dev/null @@ -1,87 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.maxproperties_validation import MaxpropertiesValidation -from unit_test_api import configuration - - -class TestMaxpropertiesValidation(unittest.TestCase): - """MaxpropertiesValidation unit test stubs""" - _configuration = configuration.Configuration() - - def test_too_long_is_invalid_fails(self): - # too long is invalid - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - MaxpropertiesValidation.from_openapi_data_oapg( - { - "foo": - 1, - "bar": - 2, - "baz": - 3, - }, - _configuration=self._configuration - ) - - def test_ignores_arrays_passes(self): - # ignores arrays - MaxpropertiesValidation.from_openapi_data_oapg( - [ - 1, - 2, - 3, - ], - _configuration=self._configuration - ) - - def test_ignores_other_non_objects_passes(self): - # ignores other non-objects - MaxpropertiesValidation.from_openapi_data_oapg( - 12, - _configuration=self._configuration - ) - - def test_ignores_strings_passes(self): - # ignores strings - MaxpropertiesValidation.from_openapi_data_oapg( - "foobar", - _configuration=self._configuration - ) - - def test_shorter_is_valid_passes(self): - # shorter is valid - MaxpropertiesValidation.from_openapi_data_oapg( - { - "foo": - 1, - }, - _configuration=self._configuration - ) - - def test_exact_length_is_valid_passes(self): - # exact length is valid - MaxpropertiesValidation.from_openapi_data_oapg( - { - "foo": - 1, - "bar": - 2, - }, - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_minimum_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_minimum_validation.py deleted file mode 100644 index 9c3798fadb9..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_minimum_validation.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.minimum_validation import MinimumValidation -from unit_test_api import configuration - - -class TestMinimumValidation(unittest.TestCase): - """MinimumValidation unit test stubs""" - _configuration = configuration.Configuration() - - def test_boundary_point_is_valid_passes(self): - # boundary point is valid - MinimumValidation.from_openapi_data_oapg( - 1.1, - _configuration=self._configuration - ) - - def test_below_the_minimum_is_invalid_fails(self): - # below the minimum is invalid - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - MinimumValidation.from_openapi_data_oapg( - 0.6, - _configuration=self._configuration - ) - - def test_above_the_minimum_is_valid_passes(self): - # above the minimum is valid - MinimumValidation.from_openapi_data_oapg( - 2.6, - _configuration=self._configuration - ) - - def test_ignores_non_numbers_passes(self): - # ignores non-numbers - MinimumValidation.from_openapi_data_oapg( - "x", - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_minimum_validation_with_signed_integer.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_minimum_validation_with_signed_integer.py deleted file mode 100644 index 02795c09294..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_minimum_validation_with_signed_integer.py +++ /dev/null @@ -1,76 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.minimum_validation_with_signed_integer import MinimumValidationWithSignedInteger -from unit_test_api import configuration - - -class TestMinimumValidationWithSignedInteger(unittest.TestCase): - """MinimumValidationWithSignedInteger unit test stubs""" - _configuration = configuration.Configuration() - - def test_boundary_point_is_valid_passes(self): - # boundary point is valid - MinimumValidationWithSignedInteger.from_openapi_data_oapg( - -2, - _configuration=self._configuration - ) - - def test_positive_above_the_minimum_is_valid_passes(self): - # positive above the minimum is valid - MinimumValidationWithSignedInteger.from_openapi_data_oapg( - 0, - _configuration=self._configuration - ) - - def test_int_below_the_minimum_is_invalid_fails(self): - # int below the minimum is invalid - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - MinimumValidationWithSignedInteger.from_openapi_data_oapg( - -3, - _configuration=self._configuration - ) - - def test_float_below_the_minimum_is_invalid_fails(self): - # float below the minimum is invalid - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - MinimumValidationWithSignedInteger.from_openapi_data_oapg( - -2.0001, - _configuration=self._configuration - ) - - def test_boundary_point_with_float_is_valid_passes(self): - # boundary point with float is valid - MinimumValidationWithSignedInteger.from_openapi_data_oapg( - -2.0, - _configuration=self._configuration - ) - - def test_negative_above_the_minimum_is_valid_passes(self): - # negative above the minimum is valid - MinimumValidationWithSignedInteger.from_openapi_data_oapg( - -1, - _configuration=self._configuration - ) - - def test_ignores_non_numbers_passes(self): - # ignores non-numbers - MinimumValidationWithSignedInteger.from_openapi_data_oapg( - "x", - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_minitems_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_minitems_validation.py deleted file mode 100644 index db5bb4eea03..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_minitems_validation.py +++ /dev/null @@ -1,60 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.minitems_validation import MinitemsValidation -from unit_test_api import configuration - - -class TestMinitemsValidation(unittest.TestCase): - """MinitemsValidation unit test stubs""" - _configuration = configuration.Configuration() - - def test_too_short_is_invalid_fails(self): - # too short is invalid - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - MinitemsValidation.from_openapi_data_oapg( - [ - ], - _configuration=self._configuration - ) - - def test_ignores_non_arrays_passes(self): - # ignores non-arrays - MinitemsValidation.from_openapi_data_oapg( - "", - _configuration=self._configuration - ) - - def test_longer_is_valid_passes(self): - # longer is valid - MinitemsValidation.from_openapi_data_oapg( - [ - 1, - 2, - ], - _configuration=self._configuration - ) - - def test_exact_length_is_valid_passes(self): - # exact length is valid - MinitemsValidation.from_openapi_data_oapg( - [ - 1, - ], - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_minlength_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_minlength_validation.py deleted file mode 100644 index e7327d1a4d6..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_minlength_validation.py +++ /dev/null @@ -1,62 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.minlength_validation import MinlengthValidation -from unit_test_api import configuration - - -class TestMinlengthValidation(unittest.TestCase): - """MinlengthValidation unit test stubs""" - _configuration = configuration.Configuration() - - def test_too_short_is_invalid_fails(self): - # too short is invalid - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - MinlengthValidation.from_openapi_data_oapg( - "f", - _configuration=self._configuration - ) - - def test_one_supplementary_unicode_code_point_is_not_long_enough_fails(self): - # one supplementary Unicode code point is not long enough - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - MinlengthValidation.from_openapi_data_oapg( - "💩", - _configuration=self._configuration - ) - - def test_longer_is_valid_passes(self): - # longer is valid - MinlengthValidation.from_openapi_data_oapg( - "foo", - _configuration=self._configuration - ) - - def test_ignores_non_strings_passes(self): - # ignores non-strings - MinlengthValidation.from_openapi_data_oapg( - 1, - _configuration=self._configuration - ) - - def test_exact_length_is_valid_passes(self): - # exact length is valid - MinlengthValidation.from_openapi_data_oapg( - "fo", - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_minproperties_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_minproperties_validation.py deleted file mode 100644 index 6d79810b1d9..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_minproperties_validation.py +++ /dev/null @@ -1,78 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.minproperties_validation import MinpropertiesValidation -from unit_test_api import configuration - - -class TestMinpropertiesValidation(unittest.TestCase): - """MinpropertiesValidation unit test stubs""" - _configuration = configuration.Configuration() - - def test_ignores_arrays_passes(self): - # ignores arrays - MinpropertiesValidation.from_openapi_data_oapg( - [ - ], - _configuration=self._configuration - ) - - def test_ignores_other_non_objects_passes(self): - # ignores other non-objects - MinpropertiesValidation.from_openapi_data_oapg( - 12, - _configuration=self._configuration - ) - - def test_too_short_is_invalid_fails(self): - # too short is invalid - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - MinpropertiesValidation.from_openapi_data_oapg( - { - }, - _configuration=self._configuration - ) - - def test_ignores_strings_passes(self): - # ignores strings - MinpropertiesValidation.from_openapi_data_oapg( - "", - _configuration=self._configuration - ) - - def test_longer_is_valid_passes(self): - # longer is valid - MinpropertiesValidation.from_openapi_data_oapg( - { - "foo": - 1, - "bar": - 2, - }, - _configuration=self._configuration - ) - - def test_exact_length_is_valid_passes(self): - # exact length is valid - MinpropertiesValidation.from_openapi_data_oapg( - { - "foo": - 1, - }, - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_model_not.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_model_not.py deleted file mode 100644 index 996812828d1..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_model_not.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.model_not import ModelNot -from unit_test_api import configuration - - -class TestModelNot(unittest.TestCase): - """ModelNot unit test stubs""" - _configuration = configuration.Configuration() - - def test_allowed_passes(self): - # allowed - ModelNot.from_openapi_data_oapg( - "foo", - _configuration=self._configuration - ) - - def test_disallowed_fails(self): - # disallowed - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - ModelNot.from_openapi_data_oapg( - 1, - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_nested_allof_to_check_validation_semantics.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_nested_allof_to_check_validation_semantics.py deleted file mode 100644 index 7919e40463c..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_nested_allof_to_check_validation_semantics.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.nested_allof_to_check_validation_semantics import NestedAllofToCheckValidationSemantics -from unit_test_api import configuration - - -class TestNestedAllofToCheckValidationSemantics(unittest.TestCase): - """NestedAllofToCheckValidationSemantics unit test stubs""" - _configuration = configuration.Configuration() - - def test_anything_non_null_is_invalid_fails(self): - # anything non-null is invalid - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - NestedAllofToCheckValidationSemantics.from_openapi_data_oapg( - 123, - _configuration=self._configuration - ) - - def test_null_is_valid_passes(self): - # null is valid - NestedAllofToCheckValidationSemantics.from_openapi_data_oapg( - None, - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_nested_anyof_to_check_validation_semantics.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_nested_anyof_to_check_validation_semantics.py deleted file mode 100644 index 2be0dd8edae..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_nested_anyof_to_check_validation_semantics.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.nested_anyof_to_check_validation_semantics import NestedAnyofToCheckValidationSemantics -from unit_test_api import configuration - - -class TestNestedAnyofToCheckValidationSemantics(unittest.TestCase): - """NestedAnyofToCheckValidationSemantics unit test stubs""" - _configuration = configuration.Configuration() - - def test_anything_non_null_is_invalid_fails(self): - # anything non-null is invalid - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - NestedAnyofToCheckValidationSemantics.from_openapi_data_oapg( - 123, - _configuration=self._configuration - ) - - def test_null_is_valid_passes(self): - # null is valid - NestedAnyofToCheckValidationSemantics.from_openapi_data_oapg( - None, - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_nested_oneof_to_check_validation_semantics.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_nested_oneof_to_check_validation_semantics.py deleted file mode 100644 index 80f80e3ec49..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_nested_oneof_to_check_validation_semantics.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.nested_oneof_to_check_validation_semantics import NestedOneofToCheckValidationSemantics -from unit_test_api import configuration - - -class TestNestedOneofToCheckValidationSemantics(unittest.TestCase): - """NestedOneofToCheckValidationSemantics unit test stubs""" - _configuration = configuration.Configuration() - - def test_anything_non_null_is_invalid_fails(self): - # anything non-null is invalid - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - NestedOneofToCheckValidationSemantics.from_openapi_data_oapg( - 123, - _configuration=self._configuration - ) - - def test_null_is_valid_passes(self): - # null is valid - NestedOneofToCheckValidationSemantics.from_openapi_data_oapg( - None, - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_not_more_complex_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_not_more_complex_schema.py deleted file mode 100644 index 38acbc0e04b..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_not_more_complex_schema.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.not_more_complex_schema import NotMoreComplexSchema -from unit_test_api import configuration - - -class TestNotMoreComplexSchema(unittest.TestCase): - """NotMoreComplexSchema unit test stubs""" - _configuration = configuration.Configuration() - - def test_other_match_passes(self): - # other match - NotMoreComplexSchema.from_openapi_data_oapg( - { - "foo": - 1, - }, - _configuration=self._configuration - ) - - def test_mismatch_fails(self): - # mismatch - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - NotMoreComplexSchema.from_openapi_data_oapg( - { - "foo": - "bar", - }, - _configuration=self._configuration - ) - - def test_match_passes(self): - # match - NotMoreComplexSchema.from_openapi_data_oapg( - 1, - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_nul_characters_in_strings.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_nul_characters_in_strings.py deleted file mode 100644 index c5bbe098599..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_nul_characters_in_strings.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.nul_characters_in_strings import NulCharactersInStrings -from unit_test_api import configuration - - -class TestNulCharactersInStrings(unittest.TestCase): - """NulCharactersInStrings unit test stubs""" - _configuration = configuration.Configuration() - - def test_match_string_with_nul_passes(self): - # match string with nul - NulCharactersInStrings.from_openapi_data_oapg( - "hello\x00there", - _configuration=self._configuration - ) - - def test_do_not_match_string_lacking_nul_fails(self): - # do not match string lacking nul - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - NulCharactersInStrings.from_openapi_data_oapg( - "hellothere", - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_null_type_matches_only_the_null_object.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_null_type_matches_only_the_null_object.py deleted file mode 100644 index be22b3587ca..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_null_type_matches_only_the_null_object.py +++ /dev/null @@ -1,106 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.null_type_matches_only_the_null_object import NullTypeMatchesOnlyTheNullObject -from unit_test_api import configuration - - -class TestNullTypeMatchesOnlyTheNullObject(unittest.TestCase): - """NullTypeMatchesOnlyTheNullObject unit test stubs""" - _configuration = configuration.Configuration() - - def test_a_float_is_not_null_fails(self): - # a float is not null - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - NullTypeMatchesOnlyTheNullObject.from_openapi_data_oapg( - 1.1, - _configuration=self._configuration - ) - - def test_an_object_is_not_null_fails(self): - # an object is not null - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - NullTypeMatchesOnlyTheNullObject.from_openapi_data_oapg( - { - }, - _configuration=self._configuration - ) - - def test_false_is_not_null_fails(self): - # false is not null - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - NullTypeMatchesOnlyTheNullObject.from_openapi_data_oapg( - False, - _configuration=self._configuration - ) - - def test_an_integer_is_not_null_fails(self): - # an integer is not null - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - NullTypeMatchesOnlyTheNullObject.from_openapi_data_oapg( - 1, - _configuration=self._configuration - ) - - def test_true_is_not_null_fails(self): - # true is not null - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - NullTypeMatchesOnlyTheNullObject.from_openapi_data_oapg( - True, - _configuration=self._configuration - ) - - def test_zero_is_not_null_fails(self): - # zero is not null - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - NullTypeMatchesOnlyTheNullObject.from_openapi_data_oapg( - 0, - _configuration=self._configuration - ) - - def test_an_empty_string_is_not_null_fails(self): - # an empty string is not null - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - NullTypeMatchesOnlyTheNullObject.from_openapi_data_oapg( - "", - _configuration=self._configuration - ) - - def test_null_is_null_passes(self): - # null is null - NullTypeMatchesOnlyTheNullObject.from_openapi_data_oapg( - None, - _configuration=self._configuration - ) - - def test_an_array_is_not_null_fails(self): - # an array is not null - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - NullTypeMatchesOnlyTheNullObject.from_openapi_data_oapg( - [ - ], - _configuration=self._configuration - ) - - def test_a_string_is_not_null_fails(self): - # a string is not null - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - NullTypeMatchesOnlyTheNullObject.from_openapi_data_oapg( - "foo", - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_number_type_matches_numbers.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_number_type_matches_numbers.py deleted file mode 100644 index 2070edb70c8..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_number_type_matches_numbers.py +++ /dev/null @@ -1,96 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.number_type_matches_numbers import NumberTypeMatchesNumbers -from unit_test_api import configuration - - -class TestNumberTypeMatchesNumbers(unittest.TestCase): - """NumberTypeMatchesNumbers unit test stubs""" - _configuration = configuration.Configuration() - - def test_an_array_is_not_a_number_fails(self): - # an array is not a number - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - NumberTypeMatchesNumbers.from_openapi_data_oapg( - [ - ], - _configuration=self._configuration - ) - - def test_null_is_not_a_number_fails(self): - # null is not a number - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - NumberTypeMatchesNumbers.from_openapi_data_oapg( - None, - _configuration=self._configuration - ) - - def test_an_object_is_not_a_number_fails(self): - # an object is not a number - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - NumberTypeMatchesNumbers.from_openapi_data_oapg( - { - }, - _configuration=self._configuration - ) - - def test_a_boolean_is_not_a_number_fails(self): - # a boolean is not a number - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - NumberTypeMatchesNumbers.from_openapi_data_oapg( - True, - _configuration=self._configuration - ) - - def test_a_float_is_a_number_passes(self): - # a float is a number - NumberTypeMatchesNumbers.from_openapi_data_oapg( - 1.1, - _configuration=self._configuration - ) - - def test_a_string_is_still_not_a_number_even_if_it_looks_like_one_fails(self): - # a string is still not a number, even if it looks like one - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - NumberTypeMatchesNumbers.from_openapi_data_oapg( - "1", - _configuration=self._configuration - ) - - def test_a_string_is_not_a_number_fails(self): - # a string is not a number - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - NumberTypeMatchesNumbers.from_openapi_data_oapg( - "foo", - _configuration=self._configuration - ) - - def test_an_integer_is_a_number_passes(self): - # an integer is a number - NumberTypeMatchesNumbers.from_openapi_data_oapg( - 1, - _configuration=self._configuration - ) - - def test_a_float_with_zero_fractional_part_is_a_number_and_an_integer_passes(self): - # a float with zero fractional part is a number (and an integer) - NumberTypeMatchesNumbers.from_openapi_data_oapg( - 1.0, - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_object_properties_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_object_properties_validation.py deleted file mode 100644 index 9b74a32cc99..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_object_properties_validation.py +++ /dev/null @@ -1,92 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.object_properties_validation import ObjectPropertiesValidation -from unit_test_api import configuration - - -class TestObjectPropertiesValidation(unittest.TestCase): - """ObjectPropertiesValidation unit test stubs""" - _configuration = configuration.Configuration() - - def test_ignores_arrays_passes(self): - # ignores arrays - ObjectPropertiesValidation.from_openapi_data_oapg( - [ - ], - _configuration=self._configuration - ) - - def test_ignores_other_non_objects_passes(self): - # ignores other non-objects - ObjectPropertiesValidation.from_openapi_data_oapg( - 12, - _configuration=self._configuration - ) - - def test_one_property_invalid_is_invalid_fails(self): - # one property invalid is invalid - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - ObjectPropertiesValidation.from_openapi_data_oapg( - { - "foo": - 1, - "bar": - { - }, - }, - _configuration=self._configuration - ) - - def test_both_properties_present_and_valid_is_valid_passes(self): - # both properties present and valid is valid - ObjectPropertiesValidation.from_openapi_data_oapg( - { - "foo": - 1, - "bar": - "baz", - }, - _configuration=self._configuration - ) - - def test_doesn_t_invalidate_other_properties_passes(self): - # doesn't invalidate other properties - ObjectPropertiesValidation.from_openapi_data_oapg( - { - "quux": - [ - ], - }, - _configuration=self._configuration - ) - - def test_both_properties_invalid_is_invalid_fails(self): - # both properties invalid is invalid - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - ObjectPropertiesValidation.from_openapi_data_oapg( - { - "foo": - [ - ], - "bar": - { - }, - }, - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_oneof.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_oneof.py deleted file mode 100644 index c23316082f8..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_oneof.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.oneof import Oneof -from unit_test_api import configuration - - -class TestOneof(unittest.TestCase): - """Oneof unit test stubs""" - _configuration = configuration.Configuration() - - def test_second_oneof_valid_passes(self): - # second oneOf valid - Oneof.from_openapi_data_oapg( - 2.5, - _configuration=self._configuration - ) - - def test_both_oneof_valid_fails(self): - # both oneOf valid - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - Oneof.from_openapi_data_oapg( - 3, - _configuration=self._configuration - ) - - def test_first_oneof_valid_passes(self): - # first oneOf valid - Oneof.from_openapi_data_oapg( - 1, - _configuration=self._configuration - ) - - def test_neither_oneof_valid_fails(self): - # neither oneOf valid - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - Oneof.from_openapi_data_oapg( - 1.5, - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_oneof_complex_types.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_oneof_complex_types.py deleted file mode 100644 index f577d4cfa75..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_oneof_complex_types.py +++ /dev/null @@ -1,71 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.oneof_complex_types import OneofComplexTypes -from unit_test_api import configuration - - -class TestOneofComplexTypes(unittest.TestCase): - """OneofComplexTypes unit test stubs""" - _configuration = configuration.Configuration() - - def test_first_oneof_valid_complex_passes(self): - # first oneOf valid (complex) - OneofComplexTypes.from_openapi_data_oapg( - { - "bar": - 2, - }, - _configuration=self._configuration - ) - - def test_neither_oneof_valid_complex_fails(self): - # neither oneOf valid (complex) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - OneofComplexTypes.from_openapi_data_oapg( - { - "foo": - 2, - "bar": - "quux", - }, - _configuration=self._configuration - ) - - def test_both_oneof_valid_complex_fails(self): - # both oneOf valid (complex) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - OneofComplexTypes.from_openapi_data_oapg( - { - "foo": - "baz", - "bar": - 2, - }, - _configuration=self._configuration - ) - - def test_second_oneof_valid_complex_passes(self): - # second oneOf valid (complex) - OneofComplexTypes.from_openapi_data_oapg( - { - "foo": - "baz", - }, - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_oneof_with_base_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_oneof_with_base_schema.py deleted file mode 100644 index a1662542c13..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_oneof_with_base_schema.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.oneof_with_base_schema import OneofWithBaseSchema -from unit_test_api import configuration - - -class TestOneofWithBaseSchema(unittest.TestCase): - """OneofWithBaseSchema unit test stubs""" - _configuration = configuration.Configuration() - - def test_both_oneof_valid_fails(self): - # both oneOf valid - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - OneofWithBaseSchema.from_openapi_data_oapg( - "foo", - _configuration=self._configuration - ) - - def test_mismatch_base_schema_fails(self): - # mismatch base schema - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - OneofWithBaseSchema.from_openapi_data_oapg( - 3, - _configuration=self._configuration - ) - - def test_one_oneof_valid_passes(self): - # one oneOf valid - OneofWithBaseSchema.from_openapi_data_oapg( - "foobar", - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_oneof_with_empty_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_oneof_with_empty_schema.py deleted file mode 100644 index ad3cd286186..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_oneof_with_empty_schema.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.oneof_with_empty_schema import OneofWithEmptySchema -from unit_test_api import configuration - - -class TestOneofWithEmptySchema(unittest.TestCase): - """OneofWithEmptySchema unit test stubs""" - _configuration = configuration.Configuration() - - def test_both_valid_invalid_fails(self): - # both valid - invalid - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - OneofWithEmptySchema.from_openapi_data_oapg( - 123, - _configuration=self._configuration - ) - - def test_one_valid_valid_passes(self): - # one valid - valid - OneofWithEmptySchema.from_openapi_data_oapg( - "foo", - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_oneof_with_required.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_oneof_with_required.py deleted file mode 100644 index 5c8132375d6..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_oneof_with_required.py +++ /dev/null @@ -1,75 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.oneof_with_required import OneofWithRequired -from unit_test_api import configuration - - -class TestOneofWithRequired(unittest.TestCase): - """OneofWithRequired unit test stubs""" - _configuration = configuration.Configuration() - - def test_both_valid_invalid_fails(self): - # both valid - invalid - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - OneofWithRequired.from_openapi_data_oapg( - { - "foo": - 1, - "bar": - 2, - "baz": - 3, - }, - _configuration=self._configuration - ) - - def test_both_invalid_invalid_fails(self): - # both invalid - invalid - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - OneofWithRequired.from_openapi_data_oapg( - { - "bar": - 2, - }, - _configuration=self._configuration - ) - - def test_first_valid_valid_passes(self): - # first valid - valid - OneofWithRequired.from_openapi_data_oapg( - { - "foo": - 1, - "bar": - 2, - }, - _configuration=self._configuration - ) - - def test_second_valid_valid_passes(self): - # second valid - valid - OneofWithRequired.from_openapi_data_oapg( - { - "foo": - 1, - "baz": - 3, - }, - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_pattern_is_not_anchored.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_pattern_is_not_anchored.py deleted file mode 100644 index 42f533b9013..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_pattern_is_not_anchored.py +++ /dev/null @@ -1,32 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.pattern_is_not_anchored import PatternIsNotAnchored -from unit_test_api import configuration - - -class TestPatternIsNotAnchored(unittest.TestCase): - """PatternIsNotAnchored unit test stubs""" - _configuration = configuration.Configuration() - - def test_matches_a_substring_passes(self): - # matches a substring - PatternIsNotAnchored.from_openapi_data_oapg( - "xxaayy", - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_pattern_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_pattern_validation.py deleted file mode 100644 index 60cb2e1a1c7..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_pattern_validation.py +++ /dev/null @@ -1,84 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.pattern_validation import PatternValidation -from unit_test_api import configuration - - -class TestPatternValidation(unittest.TestCase): - """PatternValidation unit test stubs""" - _configuration = configuration.Configuration() - - def test_ignores_arrays_passes(self): - # ignores arrays - PatternValidation.from_openapi_data_oapg( - [ - ], - _configuration=self._configuration - ) - - def test_ignores_objects_passes(self): - # ignores objects - PatternValidation.from_openapi_data_oapg( - { - }, - _configuration=self._configuration - ) - - def test_ignores_null_passes(self): - # ignores null - PatternValidation.from_openapi_data_oapg( - None, - _configuration=self._configuration - ) - - def test_ignores_floats_passes(self): - # ignores floats - PatternValidation.from_openapi_data_oapg( - 1.0, - _configuration=self._configuration - ) - - def test_a_non_matching_pattern_is_invalid_fails(self): - # a non-matching pattern is invalid - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - PatternValidation.from_openapi_data_oapg( - "abc", - _configuration=self._configuration - ) - - def test_ignores_booleans_passes(self): - # ignores booleans - PatternValidation.from_openapi_data_oapg( - True, - _configuration=self._configuration - ) - - def test_a_matching_pattern_is_valid_passes(self): - # a matching pattern is valid - PatternValidation.from_openapi_data_oapg( - "aaa", - _configuration=self._configuration - ) - - def test_ignores_integers_passes(self): - # ignores integers - PatternValidation.from_openapi_data_oapg( - 123, - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_property_named_ref_that_is_not_a_reference.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_property_named_ref_that_is_not_a_reference.py deleted file mode 100644 index 52809d26e4d..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_property_named_ref_that_is_not_a_reference.py +++ /dev/null @@ -1,46 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.property_named_ref_that_is_not_a_reference import PropertyNamedRefThatIsNotAReference -from unit_test_api import configuration - - -class TestPropertyNamedRefThatIsNotAReference(unittest.TestCase): - """PropertyNamedRefThatIsNotAReference unit test stubs""" - _configuration = configuration.Configuration() - - def test_property_named_ref_valid_passes(self): - # property named $ref valid - PropertyNamedRefThatIsNotAReference.from_openapi_data_oapg( - { - "$ref": - "a", - }, - _configuration=self._configuration - ) - - def test_property_named_ref_invalid_fails(self): - # property named $ref invalid - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - PropertyNamedRefThatIsNotAReference.from_openapi_data_oapg( - { - "$ref": - 2, - }, - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_ref_in_additionalproperties.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_ref_in_additionalproperties.py deleted file mode 100644 index db4bc26bbba..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_ref_in_additionalproperties.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.ref_in_additionalproperties import RefInAdditionalproperties -from unit_test_api import configuration - - -class TestRefInAdditionalproperties(unittest.TestCase): - """RefInAdditionalproperties unit test stubs""" - _configuration = configuration.Configuration() - - def test_property_named_ref_valid_passes(self): - # property named $ref valid - RefInAdditionalproperties.from_openapi_data_oapg( - { - "someProp": - { - "$ref": - "a", - }, - }, - _configuration=self._configuration - ) - - def test_property_named_ref_invalid_fails(self): - # property named $ref invalid - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - RefInAdditionalproperties.from_openapi_data_oapg( - { - "someProp": - { - "$ref": - 2, - }, - }, - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_ref_in_allof.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_ref_in_allof.py deleted file mode 100644 index 66ff7e5cdcf..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_ref_in_allof.py +++ /dev/null @@ -1,46 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.ref_in_allof import RefInAllof -from unit_test_api import configuration - - -class TestRefInAllof(unittest.TestCase): - """RefInAllof unit test stubs""" - _configuration = configuration.Configuration() - - def test_property_named_ref_valid_passes(self): - # property named $ref valid - RefInAllof.from_openapi_data_oapg( - { - "$ref": - "a", - }, - _configuration=self._configuration - ) - - def test_property_named_ref_invalid_fails(self): - # property named $ref invalid - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - RefInAllof.from_openapi_data_oapg( - { - "$ref": - 2, - }, - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_ref_in_anyof.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_ref_in_anyof.py deleted file mode 100644 index ddf20866766..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_ref_in_anyof.py +++ /dev/null @@ -1,46 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.ref_in_anyof import RefInAnyof -from unit_test_api import configuration - - -class TestRefInAnyof(unittest.TestCase): - """RefInAnyof unit test stubs""" - _configuration = configuration.Configuration() - - def test_property_named_ref_valid_passes(self): - # property named $ref valid - RefInAnyof.from_openapi_data_oapg( - { - "$ref": - "a", - }, - _configuration=self._configuration - ) - - def test_property_named_ref_invalid_fails(self): - # property named $ref invalid - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - RefInAnyof.from_openapi_data_oapg( - { - "$ref": - 2, - }, - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_ref_in_items.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_ref_in_items.py deleted file mode 100644 index 4f39d31763b..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_ref_in_items.py +++ /dev/null @@ -1,50 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.ref_in_items import RefInItems -from unit_test_api import configuration - - -class TestRefInItems(unittest.TestCase): - """RefInItems unit test stubs""" - _configuration = configuration.Configuration() - - def test_property_named_ref_valid_passes(self): - # property named $ref valid - RefInItems.from_openapi_data_oapg( - [ - { - "$ref": - "a", - }, - ], - _configuration=self._configuration - ) - - def test_property_named_ref_invalid_fails(self): - # property named $ref invalid - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - RefInItems.from_openapi_data_oapg( - [ - { - "$ref": - 2, - }, - ], - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_ref_in_not.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_ref_in_not.py deleted file mode 100644 index c33378cd279..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_ref_in_not.py +++ /dev/null @@ -1,46 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.ref_in_not import RefInNot -from unit_test_api import configuration - - -class TestRefInNot(unittest.TestCase): - """RefInNot unit test stubs""" - _configuration = configuration.Configuration() - - def test_property_named_ref_valid_passes(self): - # property named $ref valid - RefInNot.from_openapi_data_oapg( - { - "$ref": - 2, - }, - _configuration=self._configuration - ) - - def test_property_named_ref_invalid_fails(self): - # property named $ref invalid - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - RefInNot.from_openapi_data_oapg( - { - "$ref": - "a", - }, - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_ref_in_oneof.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_ref_in_oneof.py deleted file mode 100644 index f21623c8d8d..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_ref_in_oneof.py +++ /dev/null @@ -1,46 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.ref_in_oneof import RefInOneof -from unit_test_api import configuration - - -class TestRefInOneof(unittest.TestCase): - """RefInOneof unit test stubs""" - _configuration = configuration.Configuration() - - def test_property_named_ref_valid_passes(self): - # property named $ref valid - RefInOneof.from_openapi_data_oapg( - { - "$ref": - "a", - }, - _configuration=self._configuration - ) - - def test_property_named_ref_invalid_fails(self): - # property named $ref invalid - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - RefInOneof.from_openapi_data_oapg( - { - "$ref": - 2, - }, - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_ref_in_property.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_ref_in_property.py deleted file mode 100644 index 38113b134fe..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_ref_in_property.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.ref_in_property import RefInProperty -from unit_test_api import configuration - - -class TestRefInProperty(unittest.TestCase): - """RefInProperty unit test stubs""" - _configuration = configuration.Configuration() - - def test_property_named_ref_valid_passes(self): - # property named $ref valid - RefInProperty.from_openapi_data_oapg( - { - "a": - { - "$ref": - "a", - }, - }, - _configuration=self._configuration - ) - - def test_property_named_ref_invalid_fails(self): - # property named $ref invalid - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - RefInProperty.from_openapi_data_oapg( - { - "a": - { - "$ref": - 2, - }, - }, - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_required_default_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_required_default_validation.py deleted file mode 100644 index 839aa6742db..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_required_default_validation.py +++ /dev/null @@ -1,33 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.required_default_validation import RequiredDefaultValidation -from unit_test_api import configuration - - -class TestRequiredDefaultValidation(unittest.TestCase): - """RequiredDefaultValidation unit test stubs""" - _configuration = configuration.Configuration() - - def test_not_required_by_default_passes(self): - # not required by default - RequiredDefaultValidation.from_openapi_data_oapg( - { - }, - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_required_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_required_validation.py deleted file mode 100644 index 9f1f18cc6ac..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_required_validation.py +++ /dev/null @@ -1,68 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.required_validation import RequiredValidation -from unit_test_api import configuration - - -class TestRequiredValidation(unittest.TestCase): - """RequiredValidation unit test stubs""" - _configuration = configuration.Configuration() - - def test_ignores_arrays_passes(self): - # ignores arrays - RequiredValidation.from_openapi_data_oapg( - [ - ], - _configuration=self._configuration - ) - - def test_present_required_property_is_valid_passes(self): - # present required property is valid - RequiredValidation.from_openapi_data_oapg( - { - "foo": - 1, - }, - _configuration=self._configuration - ) - - def test_ignores_other_non_objects_passes(self): - # ignores other non-objects - RequiredValidation.from_openapi_data_oapg( - 12, - _configuration=self._configuration - ) - - def test_ignores_strings_passes(self): - # ignores strings - RequiredValidation.from_openapi_data_oapg( - "", - _configuration=self._configuration - ) - - def test_non_present_required_property_is_invalid_fails(self): - # non-present required property is invalid - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - RequiredValidation.from_openapi_data_oapg( - { - "bar": - 1, - }, - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_required_with_empty_array.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_required_with_empty_array.py deleted file mode 100644 index 8a42ce63bac..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_required_with_empty_array.py +++ /dev/null @@ -1,33 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.required_with_empty_array import RequiredWithEmptyArray -from unit_test_api import configuration - - -class TestRequiredWithEmptyArray(unittest.TestCase): - """RequiredWithEmptyArray unit test stubs""" - _configuration = configuration.Configuration() - - def test_property_not_required_passes(self): - # property not required - RequiredWithEmptyArray.from_openapi_data_oapg( - { - }, - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_required_with_escaped_characters.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_required_with_escaped_characters.py deleted file mode 100644 index bd327f0981f..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_required_with_escaped_characters.py +++ /dev/null @@ -1,58 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.required_with_escaped_characters import RequiredWithEscapedCharacters -from unit_test_api import configuration - - -class TestRequiredWithEscapedCharacters(unittest.TestCase): - """RequiredWithEscapedCharacters unit test stubs""" - _configuration = configuration.Configuration() - - def test_object_with_some_properties_missing_is_invalid_fails(self): - # object with some properties missing is invalid - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - RequiredWithEscapedCharacters.from_openapi_data_oapg( - { - "foo\nbar": - "1", - "foo\"bar": - "1", - }, - _configuration=self._configuration - ) - - def test_object_with_all_properties_present_is_valid_passes(self): - # object with all properties present is valid - RequiredWithEscapedCharacters.from_openapi_data_oapg( - { - "foo\nbar": - 1, - "foo\"bar": - 1, - "foo\\bar": - 1, - "foo\rbar": - 1, - "foo\tbar": - 1, - "foo\fbar": - 1, - }, - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_simple_enum_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_simple_enum_validation.py deleted file mode 100644 index 76658126189..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_simple_enum_validation.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.simple_enum_validation import SimpleEnumValidation -from unit_test_api import configuration - - -class TestSimpleEnumValidation(unittest.TestCase): - """SimpleEnumValidation unit test stubs""" - _configuration = configuration.Configuration() - - def test_something_else_is_invalid_fails(self): - # something else is invalid - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - SimpleEnumValidation.from_openapi_data_oapg( - 4, - _configuration=self._configuration - ) - - def test_one_of_the_enum_is_valid_passes(self): - # one of the enum is valid - SimpleEnumValidation.from_openapi_data_oapg( - 1, - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_string_type_matches_strings.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_string_type_matches_strings.py deleted file mode 100644 index a1990db3021..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_string_type_matches_strings.py +++ /dev/null @@ -1,96 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.string_type_matches_strings import StringTypeMatchesStrings -from unit_test_api import configuration - - -class TestStringTypeMatchesStrings(unittest.TestCase): - """StringTypeMatchesStrings unit test stubs""" - _configuration = configuration.Configuration() - - def test_1_is_not_a_string_fails(self): - # 1 is not a string - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - StringTypeMatchesStrings.from_openapi_data_oapg( - 1, - _configuration=self._configuration - ) - - def test_a_string_is_still_a_string_even_if_it_looks_like_a_number_passes(self): - # a string is still a string, even if it looks like a number - StringTypeMatchesStrings.from_openapi_data_oapg( - "1", - _configuration=self._configuration - ) - - def test_an_empty_string_is_still_a_string_passes(self): - # an empty string is still a string - StringTypeMatchesStrings.from_openapi_data_oapg( - "", - _configuration=self._configuration - ) - - def test_a_float_is_not_a_string_fails(self): - # a float is not a string - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - StringTypeMatchesStrings.from_openapi_data_oapg( - 1.1, - _configuration=self._configuration - ) - - def test_an_object_is_not_a_string_fails(self): - # an object is not a string - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - StringTypeMatchesStrings.from_openapi_data_oapg( - { - }, - _configuration=self._configuration - ) - - def test_an_array_is_not_a_string_fails(self): - # an array is not a string - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - StringTypeMatchesStrings.from_openapi_data_oapg( - [ - ], - _configuration=self._configuration - ) - - def test_a_boolean_is_not_a_string_fails(self): - # a boolean is not a string - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - StringTypeMatchesStrings.from_openapi_data_oapg( - True, - _configuration=self._configuration - ) - - def test_null_is_not_a_string_fails(self): - # null is not a string - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - StringTypeMatchesStrings.from_openapi_data_oapg( - None, - _configuration=self._configuration - ) - - def test_a_string_is_a_string_passes(self): - # a string is a string - StringTypeMatchesStrings.from_openapi_data_oapg( - "foo", - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_the_default_keyword_does_not_do_anything_if_the_property_is_missing.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_the_default_keyword_does_not_do_anything_if_the_property_is_missing.py deleted file mode 100644 index d3ab488aa50..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_the_default_keyword_does_not_do_anything_if_the_property_is_missing.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.the_default_keyword_does_not_do_anything_if_the_property_is_missing import TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing -from unit_test_api import configuration - - -class TestTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing(unittest.TestCase): - """TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing unit test stubs""" - _configuration = configuration.Configuration() - - def test_missing_properties_are_not_filled_in_with_the_default_passes(self): - # missing properties are not filled in with the default - TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.from_openapi_data_oapg( - { - }, - _configuration=self._configuration - ) - - def test_an_explicit_property_value_is_checked_against_maximum_passing_passes(self): - # an explicit property value is checked against maximum (passing) - TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.from_openapi_data_oapg( - { - "alpha": - 1, - }, - _configuration=self._configuration - ) - - def test_an_explicit_property_value_is_checked_against_maximum_failing_fails(self): - # an explicit property value is checked against maximum (failing) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.from_openapi_data_oapg( - { - "alpha": - 5, - }, - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_uniqueitems_false_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_uniqueitems_false_validation.py deleted file mode 100644 index cda8f767328..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_uniqueitems_false_validation.py +++ /dev/null @@ -1,246 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.uniqueitems_false_validation import UniqueitemsFalseValidation -from unit_test_api import configuration - - -class TestUniqueitemsFalseValidation(unittest.TestCase): - """UniqueitemsFalseValidation unit test stubs""" - _configuration = configuration.Configuration() - - def test_non_unique_array_of_integers_is_valid_passes(self): - # non-unique array of integers is valid - UniqueitemsFalseValidation.from_openapi_data_oapg( - [ - 1, - 1, - ], - _configuration=self._configuration - ) - - def test_unique_array_of_objects_is_valid_passes(self): - # unique array of objects is valid - UniqueitemsFalseValidation.from_openapi_data_oapg( - [ - { - "foo": - "bar", - }, - { - "foo": - "baz", - }, - ], - _configuration=self._configuration - ) - - def test_non_unique_array_of_nested_objects_is_valid_passes(self): - # non-unique array of nested objects is valid - UniqueitemsFalseValidation.from_openapi_data_oapg( - [ - { - "foo": - { - "bar": - { - "baz": - True, - }, - }, - }, - { - "foo": - { - "bar": - { - "baz": - True, - }, - }, - }, - ], - _configuration=self._configuration - ) - - def test_non_unique_array_of_objects_is_valid_passes(self): - # non-unique array of objects is valid - UniqueitemsFalseValidation.from_openapi_data_oapg( - [ - { - "foo": - "bar", - }, - { - "foo": - "bar", - }, - ], - _configuration=self._configuration - ) - - def test_1_and_true_are_unique_passes(self): - # 1 and true are unique - UniqueitemsFalseValidation.from_openapi_data_oapg( - [ - 1, - True, - ], - _configuration=self._configuration - ) - - def test_unique_array_of_integers_is_valid_passes(self): - # unique array of integers is valid - UniqueitemsFalseValidation.from_openapi_data_oapg( - [ - 1, - 2, - ], - _configuration=self._configuration - ) - - def test_non_unique_array_of_arrays_is_valid_passes(self): - # non-unique array of arrays is valid - UniqueitemsFalseValidation.from_openapi_data_oapg( - [ - [ - "foo", - ], - [ - "foo", - ], - ], - _configuration=self._configuration - ) - - def test_numbers_are_unique_if_mathematically_unequal_passes(self): - # numbers are unique if mathematically unequal - UniqueitemsFalseValidation.from_openapi_data_oapg( - [ - 1.0, - 1.0, - 1, - ], - _configuration=self._configuration - ) - - def test_false_is_not_equal_to_zero_passes(self): - # false is not equal to zero - UniqueitemsFalseValidation.from_openapi_data_oapg( - [ - 0, - False, - ], - _configuration=self._configuration - ) - - def test_unique_array_of_nested_objects_is_valid_passes(self): - # unique array of nested objects is valid - UniqueitemsFalseValidation.from_openapi_data_oapg( - [ - { - "foo": - { - "bar": - { - "baz": - True, - }, - }, - }, - { - "foo": - { - "bar": - { - "baz": - False, - }, - }, - }, - ], - _configuration=self._configuration - ) - - def test_0_and_false_are_unique_passes(self): - # 0 and false are unique - UniqueitemsFalseValidation.from_openapi_data_oapg( - [ - 0, - False, - ], - _configuration=self._configuration - ) - - def test_unique_array_of_arrays_is_valid_passes(self): - # unique array of arrays is valid - UniqueitemsFalseValidation.from_openapi_data_oapg( - [ - [ - "foo", - ], - [ - "bar", - ], - ], - _configuration=self._configuration - ) - - def test_true_is_not_equal_to_one_passes(self): - # true is not equal to one - UniqueitemsFalseValidation.from_openapi_data_oapg( - [ - 1, - True, - ], - _configuration=self._configuration - ) - - def test_non_unique_heterogeneous_types_are_valid_passes(self): - # non-unique heterogeneous types are valid - UniqueitemsFalseValidation.from_openapi_data_oapg( - [ - { - }, - [ - 1, - ], - True, - None, - { - }, - 1, - ], - _configuration=self._configuration - ) - - def test_unique_heterogeneous_types_are_valid_passes(self): - # unique heterogeneous types are valid - UniqueitemsFalseValidation.from_openapi_data_oapg( - [ - { - }, - [ - 1, - ], - True, - None, - 1, - ], - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_uri_format.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_uri_format.py deleted file mode 100644 index b44051e385c..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_uri_format.py +++ /dev/null @@ -1,69 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.uri_format import UriFormat -from unit_test_api import configuration - - -class TestUriFormat(unittest.TestCase): - """UriFormat unit test stubs""" - _configuration = configuration.Configuration() - - def test_all_string_formats_ignore_objects_passes(self): - # all string formats ignore objects - UriFormat.from_openapi_data_oapg( - { - }, - _configuration=self._configuration - ) - - def test_all_string_formats_ignore_booleans_passes(self): - # all string formats ignore booleans - UriFormat.from_openapi_data_oapg( - False, - _configuration=self._configuration - ) - - def test_all_string_formats_ignore_integers_passes(self): - # all string formats ignore integers - UriFormat.from_openapi_data_oapg( - 12, - _configuration=self._configuration - ) - - def test_all_string_formats_ignore_floats_passes(self): - # all string formats ignore floats - UriFormat.from_openapi_data_oapg( - 13.7, - _configuration=self._configuration - ) - - def test_all_string_formats_ignore_arrays_passes(self): - # all string formats ignore arrays - UriFormat.from_openapi_data_oapg( - [ - ], - _configuration=self._configuration - ) - - def test_all_string_formats_ignore_nulls_passes(self): - # all string formats ignore nulls - UriFormat.from_openapi_data_oapg( - None, - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_uri_reference_format.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_uri_reference_format.py deleted file mode 100644 index 4feeaca2787..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_uri_reference_format.py +++ /dev/null @@ -1,69 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.uri_reference_format import UriReferenceFormat -from unit_test_api import configuration - - -class TestUriReferenceFormat(unittest.TestCase): - """UriReferenceFormat unit test stubs""" - _configuration = configuration.Configuration() - - def test_all_string_formats_ignore_objects_passes(self): - # all string formats ignore objects - UriReferenceFormat.from_openapi_data_oapg( - { - }, - _configuration=self._configuration - ) - - def test_all_string_formats_ignore_booleans_passes(self): - # all string formats ignore booleans - UriReferenceFormat.from_openapi_data_oapg( - False, - _configuration=self._configuration - ) - - def test_all_string_formats_ignore_integers_passes(self): - # all string formats ignore integers - UriReferenceFormat.from_openapi_data_oapg( - 12, - _configuration=self._configuration - ) - - def test_all_string_formats_ignore_floats_passes(self): - # all string formats ignore floats - UriReferenceFormat.from_openapi_data_oapg( - 13.7, - _configuration=self._configuration - ) - - def test_all_string_formats_ignore_arrays_passes(self): - # all string formats ignore arrays - UriReferenceFormat.from_openapi_data_oapg( - [ - ], - _configuration=self._configuration - ) - - def test_all_string_formats_ignore_nulls_passes(self): - # all string formats ignore nulls - UriReferenceFormat.from_openapi_data_oapg( - None, - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_uri_template_format.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_uri_template_format.py deleted file mode 100644 index a3e1e2f9876..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_uri_template_format.py +++ /dev/null @@ -1,69 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import unit_test_api -from unit_test_api.model.uri_template_format import UriTemplateFormat -from unit_test_api import configuration - - -class TestUriTemplateFormat(unittest.TestCase): - """UriTemplateFormat unit test stubs""" - _configuration = configuration.Configuration() - - def test_all_string_formats_ignore_objects_passes(self): - # all string formats ignore objects - UriTemplateFormat.from_openapi_data_oapg( - { - }, - _configuration=self._configuration - ) - - def test_all_string_formats_ignore_booleans_passes(self): - # all string formats ignore booleans - UriTemplateFormat.from_openapi_data_oapg( - False, - _configuration=self._configuration - ) - - def test_all_string_formats_ignore_integers_passes(self): - # all string formats ignore integers - UriTemplateFormat.from_openapi_data_oapg( - 12, - _configuration=self._configuration - ) - - def test_all_string_formats_ignore_floats_passes(self): - # all string formats ignore floats - UriTemplateFormat.from_openapi_data_oapg( - 13.7, - _configuration=self._configuration - ) - - def test_all_string_formats_ignore_arrays_passes(self): - # all string formats ignore arrays - UriTemplateFormat.from_openapi_data_oapg( - [ - ], - _configuration=self._configuration - ) - - def test_all_string_formats_ignore_nulls_passes(self): - # all string formats ignore nulls - UriTemplateFormat.from_openapi_data_oapg( - None, - _configuration=self._configuration - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/__init__.py index 1309632d3d5..bcc864a1738 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/__init__.py @@ -7,7 +7,7 @@ class ApiTestMixin: json_content_type = 'application/json' - user_agent = 'OpenAPI-Generator/1.0.0/python' + user_agent = 'OpenAPI-JSON-Schema-Generator/1.0.0/python' @classmethod def assert_pool_manager_request_called_with( diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/test_post.py index 1ec438f9e0b..f941695b694 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -44,9 +41,9 @@ def test_no_additional_properties_is_valid_passes(self): 1, } ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -58,7 +55,7 @@ def test_no_additional_properties_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -82,9 +79,9 @@ def test_an_additional_invalid_property_is_invalid_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -102,9 +99,9 @@ def test_an_additional_valid_property_is_valid_passes(self): True, } ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -116,7 +113,7 @@ def test_an_additional_valid_property_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -125,8 +122,5 @@ def test_an_additional_valid_property_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, schemas.Unset) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_are_allowed_by_default_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_are_allowed_by_default_request_body/test_post.py index 51206546a3e..39f38e79309 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_are_allowed_by_default_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_are_allowed_by_default_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_additionalproperties_are_allowed_by_default_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_additionalproperties_are_allowed_by_default_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostAdditionalpropertiesAreAllowedByDefaultRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostAdditionalpropertiesAreAllowedByDefaultRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -48,9 +45,9 @@ def test_additional_properties_are_allowed_passes(self): True, } ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -62,7 +59,7 @@ def test_additional_properties_are_allowed_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postAdditionalpropertiesAreAllowedByDefaultRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postAdditionalpropertiesAreAllowedByDefaultRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -71,8 +68,5 @@ def test_additional_properties_are_allowed_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, schemas.Unset) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_can_exist_by_itself_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_can_exist_by_itself_request_body/test_post.py index 6ef684d7aaa..e76c0ad264e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_can_exist_by_itself_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_can_exist_by_itself_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_additionalproperties_can_exist_by_itself_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_additionalproperties_can_exist_by_itself_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostAdditionalpropertiesCanExistByItselfRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostAdditionalpropertiesCanExistByItselfRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -45,9 +42,9 @@ def test_an_additional_invalid_property_is_invalid_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -61,9 +58,9 @@ def test_an_additional_valid_property_is_valid_passes(self): True, } ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -75,7 +72,7 @@ def test_an_additional_valid_property_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postAdditionalpropertiesCanExistByItselfRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postAdditionalpropertiesCanExistByItselfRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -84,8 +81,5 @@ def test_an_additional_valid_property_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, schemas.Unset) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_should_not_look_in_applicators_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_should_not_look_in_applicators_request_body/test_post.py index b8eadc2525f..74d8e47628e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_should_not_look_in_applicators_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_should_not_look_in_applicators_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_additionalproperties_should_not_look_in_applicators_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_additionalproperties_should_not_look_in_applicators_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostAdditionalpropertiesShouldNotLookInApplicatorsRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostAdditionalpropertiesShouldNotLookInApplicatorsRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -47,9 +44,9 @@ def test_properties_defined_in_allof_are_not_examined_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -65,9 +62,9 @@ def test_valid_test_case_passes(self): True, } ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -79,7 +76,7 @@ def test_valid_test_case_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postAdditionalpropertiesShouldNotLookInApplicatorsRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postAdditionalpropertiesShouldNotLookInApplicatorsRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -88,8 +85,5 @@ def test_valid_test_case_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, schemas.Unset) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_combined_with_anyof_oneof_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_combined_with_anyof_oneof_request_body/test_post.py index d1c7dc21251..fa4a4d12146 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_combined_with_anyof_oneof_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_combined_with_anyof_oneof_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_allof_combined_with_anyof_oneof_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_allof_combined_with_anyof_oneof_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostAllofCombinedWithAnyofOneofRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostAllofCombinedWithAnyofOneofRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -42,9 +39,9 @@ def test_allof_true_anyof_false_oneof_false_fails(self): 2 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -56,9 +53,9 @@ def test_allof_false_anyof_false_oneof_true_fails(self): 5 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -70,9 +67,9 @@ def test_allof_false_anyof_true_oneof_true_fails(self): 15 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -84,9 +81,9 @@ def test_allof_true_anyof_true_oneof_false_fails(self): 6 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -97,9 +94,9 @@ def test_allof_true_anyof_true_oneof_true_passes(self): payload = ( 30 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -111,7 +108,7 @@ def test_allof_true_anyof_true_oneof_true_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postAllofCombinedWithAnyofOneofRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postAllofCombinedWithAnyofOneofRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -128,9 +125,9 @@ def test_allof_true_anyof_false_oneof_true_fails(self): 10 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -142,9 +139,9 @@ def test_allof_false_anyof_true_oneof_false_fails(self): 3 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -156,14 +153,11 @@ def test_allof_false_anyof_false_oneof_false_fails(self): 1 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_request_body/test_post.py index b5b226da396..6c6ccad9d7c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_allof_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_allof_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostAllofRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostAllofRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -46,9 +43,9 @@ def test_allof_passes(self): 2, } ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -60,7 +57,7 @@ def test_allof_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postAllofRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postAllofRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -80,9 +77,9 @@ def test_mismatch_first_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -97,9 +94,9 @@ def test_mismatch_second_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -116,14 +113,11 @@ def test_wrong_type_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_simple_types_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_simple_types_request_body/test_post.py index 9bc320bd602..cea6af05bc6 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_simple_types_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_simple_types_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_allof_simple_types_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_allof_simple_types_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostAllofSimpleTypesRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostAllofSimpleTypesRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -41,9 +38,9 @@ def test_valid_passes(self): payload = ( 25 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -55,7 +52,7 @@ def test_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postAllofSimpleTypesRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postAllofSimpleTypesRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -72,14 +69,11 @@ def test_mismatch_one_fails(self): 35 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_base_schema_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_base_schema_request_body/test_post.py index b9cbf295229..1d441f8b6b6 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_base_schema_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_base_schema_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_allof_with_base_schema_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_allof_with_base_schema_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostAllofWithBaseSchemaRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostAllofWithBaseSchemaRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -48,9 +45,9 @@ def test_valid_passes(self): None, } ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -62,7 +59,7 @@ def test_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postAllofWithBaseSchemaRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postAllofWithBaseSchemaRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -84,9 +81,9 @@ def test_mismatch_first_allof_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -103,9 +100,9 @@ def test_mismatch_base_schema_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -120,9 +117,9 @@ def test_mismatch_both_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -139,14 +136,11 @@ def test_mismatch_second_allof_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_one_empty_schema_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_one_empty_schema_request_body/test_post.py index 908bd1ca7ba..30d1cb7134b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_one_empty_schema_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_one_empty_schema_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_allof_with_one_empty_schema_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_allof_with_one_empty_schema_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostAllofWithOneEmptySchemaRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostAllofWithOneEmptySchemaRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -41,9 +38,9 @@ def test_any_data_is_valid_passes(self): payload = ( 1 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -55,7 +52,7 @@ def test_any_data_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postAllofWithOneEmptySchemaRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postAllofWithOneEmptySchemaRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -64,8 +61,5 @@ def test_any_data_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, schemas.Unset) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_the_first_empty_schema_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_the_first_empty_schema_request_body/test_post.py index 72bd0bed2be..f9a1d8e1cd6 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_the_first_empty_schema_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_the_first_empty_schema_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_allof_with_the_first_empty_schema_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_allof_with_the_first_empty_schema_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostAllofWithTheFirstEmptySchemaRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostAllofWithTheFirstEmptySchemaRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -42,9 +39,9 @@ def test_string_is_invalid_fails(self): "foo" ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -55,9 +52,9 @@ def test_number_is_valid_passes(self): payload = ( 1 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -69,7 +66,7 @@ def test_number_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postAllofWithTheFirstEmptySchemaRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postAllofWithTheFirstEmptySchemaRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -78,8 +75,5 @@ def test_number_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, schemas.Unset) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_the_last_empty_schema_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_the_last_empty_schema_request_body/test_post.py index 46ab77081dc..f276863b094 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_the_last_empty_schema_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_the_last_empty_schema_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_allof_with_the_last_empty_schema_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_allof_with_the_last_empty_schema_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostAllofWithTheLastEmptySchemaRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostAllofWithTheLastEmptySchemaRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -42,9 +39,9 @@ def test_string_is_invalid_fails(self): "foo" ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -55,9 +52,9 @@ def test_number_is_valid_passes(self): payload = ( 1 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -69,7 +66,7 @@ def test_number_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postAllofWithTheLastEmptySchemaRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postAllofWithTheLastEmptySchemaRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -78,8 +75,5 @@ def test_number_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, schemas.Unset) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_two_empty_schemas_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_two_empty_schemas_request_body/test_post.py index 7457f418182..22e2b810e82 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_two_empty_schemas_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_two_empty_schemas_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_allof_with_two_empty_schemas_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_allof_with_two_empty_schemas_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostAllofWithTwoEmptySchemasRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostAllofWithTwoEmptySchemasRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -41,9 +38,9 @@ def test_any_data_is_valid_passes(self): payload = ( 1 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -55,7 +52,7 @@ def test_any_data_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postAllofWithTwoEmptySchemasRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postAllofWithTwoEmptySchemasRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -64,8 +61,5 @@ def test_any_data_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, schemas.Unset) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_complex_types_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_complex_types_request_body/test_post.py index 2cd85be49f7..995d6af6d4d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_complex_types_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_complex_types_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_anyof_complex_types_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_anyof_complex_types_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostAnyofComplexTypesRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostAnyofComplexTypesRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -44,9 +41,9 @@ def test_second_anyof_valid_complex_passes(self): "baz", } ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -58,7 +55,7 @@ def test_second_anyof_valid_complex_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postAnyofComplexTypesRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postAnyofComplexTypesRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -80,9 +77,9 @@ def test_neither_anyof_valid_complex_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -98,9 +95,9 @@ def test_both_anyof_valid_complex_passes(self): 2, } ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -112,7 +109,7 @@ def test_both_anyof_valid_complex_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postAnyofComplexTypesRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postAnyofComplexTypesRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -131,9 +128,9 @@ def test_first_anyof_valid_complex_passes(self): 2, } ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -145,7 +142,7 @@ def test_first_anyof_valid_complex_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postAnyofComplexTypesRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postAnyofComplexTypesRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -154,8 +151,5 @@ def test_first_anyof_valid_complex_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, schemas.Unset) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_request_body/test_post.py index 8405d6e3181..edcb7690568 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_anyof_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_anyof_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostAnyofRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostAnyofRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -41,9 +38,9 @@ def test_second_anyof_valid_passes(self): payload = ( 2.5 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -55,7 +52,7 @@ def test_second_anyof_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postAnyofRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postAnyofRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -72,9 +69,9 @@ def test_neither_anyof_valid_fails(self): 1.5 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -85,9 +82,9 @@ def test_both_anyof_valid_passes(self): payload = ( 3 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -99,7 +96,7 @@ def test_both_anyof_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postAnyofRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postAnyofRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -115,9 +112,9 @@ def test_first_anyof_valid_passes(self): payload = ( 1 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -129,7 +126,7 @@ def test_first_anyof_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postAnyofRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postAnyofRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -138,8 +135,5 @@ def test_first_anyof_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, schemas.Unset) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_with_base_schema_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_with_base_schema_request_body/test_post.py index 7db203a0e1c..84d6010a339 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_with_base_schema_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_with_base_schema_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_anyof_with_base_schema_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_anyof_with_base_schema_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostAnyofWithBaseSchemaRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostAnyofWithBaseSchemaRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -41,9 +38,9 @@ def test_one_anyof_valid_passes(self): payload = ( "foobar" ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -55,7 +52,7 @@ def test_one_anyof_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postAnyofWithBaseSchemaRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postAnyofWithBaseSchemaRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -72,9 +69,9 @@ def test_both_anyof_invalid_fails(self): "foo" ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -86,14 +83,11 @@ def test_mismatch_base_schema_fails(self): 3 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_with_one_empty_schema_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_with_one_empty_schema_request_body/test_post.py index 15e0575d87b..b68b154c690 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_with_one_empty_schema_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_with_one_empty_schema_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_anyof_with_one_empty_schema_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_anyof_with_one_empty_schema_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostAnyofWithOneEmptySchemaRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostAnyofWithOneEmptySchemaRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -41,9 +38,9 @@ def test_string_is_valid_passes(self): payload = ( "foo" ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -55,7 +52,7 @@ def test_string_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postAnyofWithOneEmptySchemaRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postAnyofWithOneEmptySchemaRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -71,9 +68,9 @@ def test_number_is_valid_passes(self): payload = ( 123 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -85,7 +82,7 @@ def test_number_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postAnyofWithOneEmptySchemaRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postAnyofWithOneEmptySchemaRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -94,8 +91,5 @@ def test_number_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, schemas.Unset) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_array_type_matches_arrays_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_array_type_matches_arrays_request_body/test_post.py index 6132d9c26bd..7b359ef38f7 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_array_type_matches_arrays_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_array_type_matches_arrays_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_array_type_matches_arrays_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_array_type_matches_arrays_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostArrayTypeMatchesArraysRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostArrayTypeMatchesArraysRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -42,9 +39,9 @@ def test_a_float_is_not_an_array_fails(self): 1.1 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -56,9 +53,9 @@ def test_a_boolean_is_not_an_array_fails(self): True ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -70,9 +67,9 @@ def test_null_is_not_an_array_fails(self): None ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -85,9 +82,9 @@ def test_an_object_is_not_an_array_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -99,9 +96,9 @@ def test_a_string_is_not_an_array_fails(self): "foo" ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -113,9 +110,9 @@ def test_an_array_is_an_array_passes(self): [ ] ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -127,7 +124,7 @@ def test_an_array_is_an_array_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postArrayTypeMatchesArraysRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postArrayTypeMatchesArraysRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -144,14 +141,11 @@ def test_an_integer_is_not_an_array_fails(self): 1 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_boolean_type_matches_booleans_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_boolean_type_matches_booleans_request_body/test_post.py index 3755adac412..48d186152c3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_boolean_type_matches_booleans_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_boolean_type_matches_booleans_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_boolean_type_matches_booleans_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_boolean_type_matches_booleans_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostBooleanTypeMatchesBooleansRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostBooleanTypeMatchesBooleansRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -42,9 +39,9 @@ def test_an_empty_string_is_not_a_boolean_fails(self): "" ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -56,9 +53,9 @@ def test_a_float_is_not_a_boolean_fails(self): 1.1 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -70,9 +67,9 @@ def test_null_is_not_a_boolean_fails(self): None ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -84,9 +81,9 @@ def test_zero_is_not_a_boolean_fails(self): 0 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -99,9 +96,9 @@ def test_an_array_is_not_a_boolean_fails(self): ] ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -113,9 +110,9 @@ def test_a_string_is_not_a_boolean_fails(self): "foo" ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -126,9 +123,9 @@ def test_false_is_a_boolean_passes(self): payload = ( False ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -140,7 +137,7 @@ def test_false_is_a_boolean_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postBooleanTypeMatchesBooleansRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postBooleanTypeMatchesBooleansRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -157,9 +154,9 @@ def test_an_integer_is_not_a_boolean_fails(self): 1 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -170,9 +167,9 @@ def test_true_is_a_boolean_passes(self): payload = ( True ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -184,7 +181,7 @@ def test_true_is_a_boolean_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postBooleanTypeMatchesBooleansRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postBooleanTypeMatchesBooleansRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -202,14 +199,11 @@ def test_an_object_is_not_a_boolean_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_by_int_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_by_int_request_body/test_post.py index 6792b353533..4c8126395f7 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_by_int_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_by_int_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_by_int_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_by_int_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostByIntRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostByIntRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -42,9 +39,9 @@ def test_int_by_int_fail_fails(self): 7 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -55,9 +52,9 @@ def test_int_by_int_passes(self): payload = ( 10 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -69,7 +66,7 @@ def test_int_by_int_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postByIntRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postByIntRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -85,9 +82,9 @@ def test_ignores_non_numbers_passes(self): payload = ( "foo" ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -99,7 +96,7 @@ def test_ignores_non_numbers_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postByIntRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postByIntRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -108,8 +105,5 @@ def test_ignores_non_numbers_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, schemas.Unset) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_by_number_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_by_number_request_body/test_post.py index 71cf3827359..3403efd98d7 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_by_number_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_by_number_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_by_number_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_by_number_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostByNumberRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostByNumberRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -41,9 +38,9 @@ def test_45_is_multiple_of15_passes(self): payload = ( 4.5 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -55,7 +52,7 @@ def test_45_is_multiple_of15_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postByNumberRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postByNumberRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -72,9 +69,9 @@ def test_35_is_not_multiple_of15_fails(self): 35 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -85,9 +82,9 @@ def test_zero_is_multiple_of_anything_passes(self): payload = ( 0 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -99,7 +96,7 @@ def test_zero_is_multiple_of_anything_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postByNumberRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postByNumberRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -108,8 +105,5 @@ def test_zero_is_multiple_of_anything_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, schemas.Unset) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_by_small_number_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_by_small_number_request_body/test_post.py index f16340e5b9b..7c6bec3b71e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_by_small_number_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_by_small_number_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_by_small_number_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_by_small_number_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostBySmallNumberRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostBySmallNumberRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -42,9 +39,9 @@ def test_000751_is_not_multiple_of00001_fails(self): 0.00751 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -55,9 +52,9 @@ def test_00075_is_multiple_of00001_passes(self): payload = ( 0.0075 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -69,7 +66,7 @@ def test_00075_is_multiple_of00001_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postBySmallNumberRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postBySmallNumberRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -78,8 +75,5 @@ def test_00075_is_multiple_of00001_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, schemas.Unset) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_date_time_format_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_date_time_format_request_body/test_post.py index 51f2f2fd429..05868c772a0 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_date_time_format_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_date_time_format_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_date_time_format_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_date_time_format_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostDateTimeFormatRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostDateTimeFormatRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -42,9 +39,9 @@ def test_all_string_formats_ignore_objects_passes(self): { } ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -56,7 +53,7 @@ def test_all_string_formats_ignore_objects_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postDateTimeFormatRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postDateTimeFormatRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -72,9 +69,9 @@ def test_all_string_formats_ignore_booleans_passes(self): payload = ( False ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -86,7 +83,7 @@ def test_all_string_formats_ignore_booleans_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postDateTimeFormatRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postDateTimeFormatRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -102,9 +99,9 @@ def test_all_string_formats_ignore_integers_passes(self): payload = ( 12 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -116,7 +113,7 @@ def test_all_string_formats_ignore_integers_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postDateTimeFormatRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postDateTimeFormatRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -132,9 +129,9 @@ def test_all_string_formats_ignore_floats_passes(self): payload = ( 13.7 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -146,7 +143,7 @@ def test_all_string_formats_ignore_floats_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postDateTimeFormatRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postDateTimeFormatRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -163,9 +160,9 @@ def test_all_string_formats_ignore_arrays_passes(self): [ ] ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -177,7 +174,7 @@ def test_all_string_formats_ignore_arrays_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postDateTimeFormatRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postDateTimeFormatRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -193,9 +190,9 @@ def test_all_string_formats_ignore_nulls_passes(self): payload = ( None ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -207,7 +204,7 @@ def test_all_string_formats_ignore_nulls_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postDateTimeFormatRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postDateTimeFormatRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -216,8 +213,5 @@ def test_all_string_formats_ignore_nulls_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, schemas.Unset) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_email_format_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_email_format_request_body/test_post.py index 4d1a472e3b4..03b32547c96 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_email_format_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_email_format_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_email_format_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_email_format_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostEmailFormatRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostEmailFormatRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -42,9 +39,9 @@ def test_all_string_formats_ignore_objects_passes(self): { } ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -56,7 +53,7 @@ def test_all_string_formats_ignore_objects_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postEmailFormatRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postEmailFormatRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -72,9 +69,9 @@ def test_all_string_formats_ignore_booleans_passes(self): payload = ( False ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -86,7 +83,7 @@ def test_all_string_formats_ignore_booleans_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postEmailFormatRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postEmailFormatRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -102,9 +99,9 @@ def test_all_string_formats_ignore_integers_passes(self): payload = ( 12 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -116,7 +113,7 @@ def test_all_string_formats_ignore_integers_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postEmailFormatRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postEmailFormatRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -132,9 +129,9 @@ def test_all_string_formats_ignore_floats_passes(self): payload = ( 13.7 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -146,7 +143,7 @@ def test_all_string_formats_ignore_floats_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postEmailFormatRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postEmailFormatRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -163,9 +160,9 @@ def test_all_string_formats_ignore_arrays_passes(self): [ ] ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -177,7 +174,7 @@ def test_all_string_formats_ignore_arrays_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postEmailFormatRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postEmailFormatRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -193,9 +190,9 @@ def test_all_string_formats_ignore_nulls_passes(self): payload = ( None ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -207,7 +204,7 @@ def test_all_string_formats_ignore_nulls_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postEmailFormatRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postEmailFormatRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -216,8 +213,5 @@ def test_all_string_formats_ignore_nulls_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, schemas.Unset) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with0_does_not_match_false_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with0_does_not_match_false_request_body/test_post.py index c58a7e635a9..a55a58c64df 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with0_does_not_match_false_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with0_does_not_match_false_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_enum_with0_does_not_match_false_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_enum_with0_does_not_match_false_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostEnumWith0DoesNotMatchFalseRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostEnumWith0DoesNotMatchFalseRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -41,9 +38,9 @@ def test_integer_zero_is_valid_passes(self): payload = ( 0 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -55,7 +52,7 @@ def test_integer_zero_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postEnumWith0DoesNotMatchFalseRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postEnumWith0DoesNotMatchFalseRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -71,9 +68,9 @@ def test_float_zero_is_valid_passes(self): payload = ( 0.0 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -85,7 +82,7 @@ def test_float_zero_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postEnumWith0DoesNotMatchFalseRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postEnumWith0DoesNotMatchFalseRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -102,14 +99,11 @@ def test_false_is_invalid_fails(self): False ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with1_does_not_match_true_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with1_does_not_match_true_request_body/test_post.py index 837485e2b97..902e9722609 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with1_does_not_match_true_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with1_does_not_match_true_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_enum_with1_does_not_match_true_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_enum_with1_does_not_match_true_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostEnumWith1DoesNotMatchTrueRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostEnumWith1DoesNotMatchTrueRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -42,9 +39,9 @@ def test_true_is_invalid_fails(self): True ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -55,9 +52,9 @@ def test_integer_one_is_valid_passes(self): payload = ( 1 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -69,7 +66,7 @@ def test_integer_one_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postEnumWith1DoesNotMatchTrueRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postEnumWith1DoesNotMatchTrueRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -85,9 +82,9 @@ def test_float_one_is_valid_passes(self): payload = ( 1.0 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -99,7 +96,7 @@ def test_float_one_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postEnumWith1DoesNotMatchTrueRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postEnumWith1DoesNotMatchTrueRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -108,8 +105,5 @@ def test_float_one_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, schemas.Unset) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with_escaped_characters_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with_escaped_characters_request_body/test_post.py index 2aaa5a405ec..d653736932c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with_escaped_characters_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with_escaped_characters_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_enum_with_escaped_characters_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_enum_with_escaped_characters_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostEnumWithEscapedCharactersRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostEnumWithEscapedCharactersRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -41,9 +38,9 @@ def test_member2_is_valid_passes(self): payload = ( "foo\rbar" ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -55,7 +52,7 @@ def test_member2_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postEnumWithEscapedCharactersRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postEnumWithEscapedCharactersRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -71,9 +68,9 @@ def test_member1_is_valid_passes(self): payload = ( "foo\nbar" ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -85,7 +82,7 @@ def test_member1_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postEnumWithEscapedCharactersRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postEnumWithEscapedCharactersRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -102,14 +99,11 @@ def test_another_string_is_invalid_fails(self): "abc" ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with_false_does_not_match0_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with_false_does_not_match0_request_body/test_post.py index f68456be55e..35f67bf7381 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with_false_does_not_match0_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with_false_does_not_match0_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_enum_with_false_does_not_match0_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_enum_with_false_does_not_match0_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostEnumWithFalseDoesNotMatch0RequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostEnumWithFalseDoesNotMatch0RequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -41,9 +38,9 @@ def test_false_is_valid_passes(self): payload = ( False ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -55,7 +52,7 @@ def test_false_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postEnumWithFalseDoesNotMatch0RequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postEnumWithFalseDoesNotMatch0RequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -72,9 +69,9 @@ def test_float_zero_is_invalid_fails(self): 0.0 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -86,14 +83,11 @@ def test_integer_zero_is_invalid_fails(self): 0 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with_true_does_not_match1_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with_true_does_not_match1_request_body/test_post.py index 36fc116919a..e80e1c48b35 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with_true_does_not_match1_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with_true_does_not_match1_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_enum_with_true_does_not_match1_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_enum_with_true_does_not_match1_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostEnumWithTrueDoesNotMatch1RequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostEnumWithTrueDoesNotMatch1RequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -42,9 +39,9 @@ def test_float_one_is_invalid_fails(self): 1.0 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -55,9 +52,9 @@ def test_true_is_valid_passes(self): payload = ( True ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -69,7 +66,7 @@ def test_true_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postEnumWithTrueDoesNotMatch1RequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postEnumWithTrueDoesNotMatch1RequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -86,14 +83,11 @@ def test_integer_one_is_invalid_fails(self): 1 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enums_in_properties_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enums_in_properties_request_body/test_post.py index 9244bfd1824..aed6495ca09 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enums_in_properties_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enums_in_properties_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_enums_in_properties_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_enums_in_properties_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostEnumsInPropertiesRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostEnumsInPropertiesRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -44,9 +41,9 @@ def test_missing_optional_property_is_valid_passes(self): "bar", } ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -58,7 +55,7 @@ def test_missing_optional_property_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postEnumsInPropertiesRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postEnumsInPropertiesRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -80,9 +77,9 @@ def test_wrong_foo_value_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -98,9 +95,9 @@ def test_both_properties_are_valid_passes(self): "bar", } ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -112,7 +109,7 @@ def test_both_properties_are_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postEnumsInPropertiesRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postEnumsInPropertiesRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -134,9 +131,9 @@ def test_wrong_bar_value_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -149,9 +146,9 @@ def test_missing_all_properties_is_invalid_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -166,14 +163,11 @@ def test_missing_required_property_is_invalid_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_forbidden_property_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_forbidden_property_request_body/test_post.py index 38f04c4f878..e95c8daffc9 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_forbidden_property_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_forbidden_property_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_forbidden_property_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_forbidden_property_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostForbiddenPropertyRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostForbiddenPropertyRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -47,9 +44,9 @@ def test_property_present_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -65,9 +62,9 @@ def test_property_absent_passes(self): 2, } ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -79,7 +76,7 @@ def test_property_absent_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postForbiddenPropertyRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postForbiddenPropertyRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -88,8 +85,5 @@ def test_property_absent_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, schemas.Unset) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_hostname_format_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_hostname_format_request_body/test_post.py index b626fef6e2b..875c54070e1 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_hostname_format_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_hostname_format_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_hostname_format_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_hostname_format_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostHostnameFormatRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostHostnameFormatRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -42,9 +39,9 @@ def test_all_string_formats_ignore_objects_passes(self): { } ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -56,7 +53,7 @@ def test_all_string_formats_ignore_objects_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postHostnameFormatRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postHostnameFormatRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -72,9 +69,9 @@ def test_all_string_formats_ignore_booleans_passes(self): payload = ( False ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -86,7 +83,7 @@ def test_all_string_formats_ignore_booleans_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postHostnameFormatRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postHostnameFormatRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -102,9 +99,9 @@ def test_all_string_formats_ignore_integers_passes(self): payload = ( 12 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -116,7 +113,7 @@ def test_all_string_formats_ignore_integers_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postHostnameFormatRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postHostnameFormatRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -132,9 +129,9 @@ def test_all_string_formats_ignore_floats_passes(self): payload = ( 13.7 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -146,7 +143,7 @@ def test_all_string_formats_ignore_floats_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postHostnameFormatRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postHostnameFormatRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -163,9 +160,9 @@ def test_all_string_formats_ignore_arrays_passes(self): [ ] ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -177,7 +174,7 @@ def test_all_string_formats_ignore_arrays_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postHostnameFormatRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postHostnameFormatRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -193,9 +190,9 @@ def test_all_string_formats_ignore_nulls_passes(self): payload = ( None ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -207,7 +204,7 @@ def test_all_string_formats_ignore_nulls_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postHostnameFormatRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postHostnameFormatRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -216,8 +213,5 @@ def test_all_string_formats_ignore_nulls_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, schemas.Unset) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_integer_type_matches_integers_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_integer_type_matches_integers_request_body/test_post.py index d30a2776da4..976a86a2448 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_integer_type_matches_integers_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_integer_type_matches_integers_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_integer_type_matches_integers_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_integer_type_matches_integers_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostIntegerTypeMatchesIntegersRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostIntegerTypeMatchesIntegersRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -43,9 +40,9 @@ def test_an_object_is_not_an_integer_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -57,9 +54,9 @@ def test_a_string_is_not_an_integer_fails(self): "foo" ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -71,9 +68,9 @@ def test_null_is_not_an_integer_fails(self): None ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -84,9 +81,9 @@ def test_a_float_with_zero_fractional_part_is_an_integer_passes(self): payload = ( 1.0 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -98,7 +95,7 @@ def test_a_float_with_zero_fractional_part_is_an_integer_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postIntegerTypeMatchesIntegersRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postIntegerTypeMatchesIntegersRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -115,9 +112,9 @@ def test_a_float_is_not_an_integer_fails(self): 1.1 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -129,9 +126,9 @@ def test_a_boolean_is_not_an_integer_fails(self): True ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -142,9 +139,9 @@ def test_an_integer_is_an_integer_passes(self): payload = ( 1 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -156,7 +153,7 @@ def test_an_integer_is_an_integer_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postIntegerTypeMatchesIntegersRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postIntegerTypeMatchesIntegersRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -173,9 +170,9 @@ def test_a_string_is_still_not_an_integer_even_if_it_looks_like_one_fails(self): "1" ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -188,14 +185,11 @@ def test_an_array_is_not_an_integer_fails(self): ] ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/test_post.py index c2ff2adebed..f1451275a0d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -42,9 +39,9 @@ def test_always_invalid_but_naive_implementations_may_raise_an_overflow_error_fa 1.0E308 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -55,9 +52,9 @@ def test_valid_integer_with_multipleof_float_passes(self): payload = ( 123456789 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -69,7 +66,7 @@ def test_valid_integer_with_multipleof_float_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -78,8 +75,5 @@ def test_valid_integer_with_multipleof_float_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, schemas.Unset) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_invalid_string_value_for_default_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_invalid_string_value_for_default_request_body/test_post.py index e3d1edeeee4..c4a8e35c85c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_invalid_string_value_for_default_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_invalid_string_value_for_default_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_invalid_string_value_for_default_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_invalid_string_value_for_default_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostInvalidStringValueForDefaultRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostInvalidStringValueForDefaultRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -44,9 +41,9 @@ def test_valid_when_property_is_specified_passes(self): "good", } ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -58,7 +55,7 @@ def test_valid_when_property_is_specified_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postInvalidStringValueForDefaultRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postInvalidStringValueForDefaultRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -75,9 +72,9 @@ def test_still_valid_when_the_invalid_default_is_used_passes(self): { } ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -89,7 +86,7 @@ def test_still_valid_when_the_invalid_default_is_used_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postInvalidStringValueForDefaultRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postInvalidStringValueForDefaultRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -98,8 +95,5 @@ def test_still_valid_when_the_invalid_default_is_used_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, schemas.Unset) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ipv4_format_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ipv4_format_request_body/test_post.py index 0c7408ba02f..0c860b6b629 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ipv4_format_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ipv4_format_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_ipv4_format_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_ipv4_format_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostIpv4FormatRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostIpv4FormatRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -42,9 +39,9 @@ def test_all_string_formats_ignore_objects_passes(self): { } ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -56,7 +53,7 @@ def test_all_string_formats_ignore_objects_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postIpv4FormatRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postIpv4FormatRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -72,9 +69,9 @@ def test_all_string_formats_ignore_booleans_passes(self): payload = ( False ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -86,7 +83,7 @@ def test_all_string_formats_ignore_booleans_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postIpv4FormatRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postIpv4FormatRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -102,9 +99,9 @@ def test_all_string_formats_ignore_integers_passes(self): payload = ( 12 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -116,7 +113,7 @@ def test_all_string_formats_ignore_integers_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postIpv4FormatRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postIpv4FormatRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -132,9 +129,9 @@ def test_all_string_formats_ignore_floats_passes(self): payload = ( 13.7 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -146,7 +143,7 @@ def test_all_string_formats_ignore_floats_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postIpv4FormatRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postIpv4FormatRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -163,9 +160,9 @@ def test_all_string_formats_ignore_arrays_passes(self): [ ] ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -177,7 +174,7 @@ def test_all_string_formats_ignore_arrays_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postIpv4FormatRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postIpv4FormatRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -193,9 +190,9 @@ def test_all_string_formats_ignore_nulls_passes(self): payload = ( None ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -207,7 +204,7 @@ def test_all_string_formats_ignore_nulls_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postIpv4FormatRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postIpv4FormatRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -216,8 +213,5 @@ def test_all_string_formats_ignore_nulls_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, schemas.Unset) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ipv6_format_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ipv6_format_request_body/test_post.py index 19214ebb3ae..2d501e37cfc 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ipv6_format_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ipv6_format_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_ipv6_format_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_ipv6_format_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostIpv6FormatRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostIpv6FormatRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -42,9 +39,9 @@ def test_all_string_formats_ignore_objects_passes(self): { } ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -56,7 +53,7 @@ def test_all_string_formats_ignore_objects_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postIpv6FormatRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postIpv6FormatRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -72,9 +69,9 @@ def test_all_string_formats_ignore_booleans_passes(self): payload = ( False ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -86,7 +83,7 @@ def test_all_string_formats_ignore_booleans_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postIpv6FormatRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postIpv6FormatRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -102,9 +99,9 @@ def test_all_string_formats_ignore_integers_passes(self): payload = ( 12 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -116,7 +113,7 @@ def test_all_string_formats_ignore_integers_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postIpv6FormatRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postIpv6FormatRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -132,9 +129,9 @@ def test_all_string_formats_ignore_floats_passes(self): payload = ( 13.7 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -146,7 +143,7 @@ def test_all_string_formats_ignore_floats_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postIpv6FormatRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postIpv6FormatRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -163,9 +160,9 @@ def test_all_string_formats_ignore_arrays_passes(self): [ ] ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -177,7 +174,7 @@ def test_all_string_formats_ignore_arrays_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postIpv6FormatRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postIpv6FormatRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -193,9 +190,9 @@ def test_all_string_formats_ignore_nulls_passes(self): payload = ( None ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -207,7 +204,7 @@ def test_all_string_formats_ignore_nulls_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postIpv6FormatRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postIpv6FormatRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -216,8 +213,5 @@ def test_all_string_formats_ignore_nulls_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, schemas.Unset) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_json_pointer_format_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_json_pointer_format_request_body/test_post.py index ae8f171dd60..cf19b512f61 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_json_pointer_format_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_json_pointer_format_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_json_pointer_format_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_json_pointer_format_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostJsonPointerFormatRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostJsonPointerFormatRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -42,9 +39,9 @@ def test_all_string_formats_ignore_objects_passes(self): { } ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -56,7 +53,7 @@ def test_all_string_formats_ignore_objects_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postJsonPointerFormatRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postJsonPointerFormatRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -72,9 +69,9 @@ def test_all_string_formats_ignore_booleans_passes(self): payload = ( False ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -86,7 +83,7 @@ def test_all_string_formats_ignore_booleans_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postJsonPointerFormatRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postJsonPointerFormatRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -102,9 +99,9 @@ def test_all_string_formats_ignore_integers_passes(self): payload = ( 12 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -116,7 +113,7 @@ def test_all_string_formats_ignore_integers_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postJsonPointerFormatRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postJsonPointerFormatRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -132,9 +129,9 @@ def test_all_string_formats_ignore_floats_passes(self): payload = ( 13.7 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -146,7 +143,7 @@ def test_all_string_formats_ignore_floats_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postJsonPointerFormatRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postJsonPointerFormatRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -163,9 +160,9 @@ def test_all_string_formats_ignore_arrays_passes(self): [ ] ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -177,7 +174,7 @@ def test_all_string_formats_ignore_arrays_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postJsonPointerFormatRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postJsonPointerFormatRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -193,9 +190,9 @@ def test_all_string_formats_ignore_nulls_passes(self): payload = ( None ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -207,7 +204,7 @@ def test_all_string_formats_ignore_nulls_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postJsonPointerFormatRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postJsonPointerFormatRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -216,8 +213,5 @@ def test_all_string_formats_ignore_nulls_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, schemas.Unset) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maximum_validation_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maximum_validation_request_body/test_post.py index d16fe2926be..0881e61ce17 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maximum_validation_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maximum_validation_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_maximum_validation_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_maximum_validation_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostMaximumValidationRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostMaximumValidationRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -41,9 +38,9 @@ def test_below_the_maximum_is_valid_passes(self): payload = ( 2.6 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -55,7 +52,7 @@ def test_below_the_maximum_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postMaximumValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postMaximumValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -71,9 +68,9 @@ def test_boundary_point_is_valid_passes(self): payload = ( 3.0 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -85,7 +82,7 @@ def test_boundary_point_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postMaximumValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postMaximumValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -102,9 +99,9 @@ def test_above_the_maximum_is_invalid_fails(self): 3.5 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -115,9 +112,9 @@ def test_ignores_non_numbers_passes(self): payload = ( "x" ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -129,7 +126,7 @@ def test_ignores_non_numbers_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postMaximumValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postMaximumValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -138,8 +135,5 @@ def test_ignores_non_numbers_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, schemas.Unset) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maximum_validation_with_unsigned_integer_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maximum_validation_with_unsigned_integer_request_body/test_post.py index e26b9b2dae7..328c3ad8cc2 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maximum_validation_with_unsigned_integer_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maximum_validation_with_unsigned_integer_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_maximum_validation_with_unsigned_integer_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_maximum_validation_with_unsigned_integer_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostMaximumValidationWithUnsignedIntegerRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostMaximumValidationWithUnsignedIntegerRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -41,9 +38,9 @@ def test_below_the_maximum_is_invalid_passes(self): payload = ( 299.97 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -55,7 +52,7 @@ def test_below_the_maximum_is_invalid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postMaximumValidationWithUnsignedIntegerRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postMaximumValidationWithUnsignedIntegerRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -72,9 +69,9 @@ def test_above_the_maximum_is_invalid_fails(self): 300.5 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -85,9 +82,9 @@ def test_boundary_point_integer_is_valid_passes(self): payload = ( 300 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -99,7 +96,7 @@ def test_boundary_point_integer_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postMaximumValidationWithUnsignedIntegerRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postMaximumValidationWithUnsignedIntegerRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -115,9 +112,9 @@ def test_boundary_point_float_is_valid_passes(self): payload = ( 300.0 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -129,7 +126,7 @@ def test_boundary_point_float_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postMaximumValidationWithUnsignedIntegerRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postMaximumValidationWithUnsignedIntegerRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -138,8 +135,5 @@ def test_boundary_point_float_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, schemas.Unset) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxitems_validation_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxitems_validation_request_body/test_post.py index de8c99ca795..c58023aa31c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxitems_validation_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxitems_validation_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_maxitems_validation_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_maxitems_validation_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostMaxitemsValidationRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostMaxitemsValidationRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -46,9 +43,9 @@ def test_too_long_is_invalid_fails(self): ] ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -59,9 +56,9 @@ def test_ignores_non_arrays_passes(self): payload = ( "foobar" ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -73,7 +70,7 @@ def test_ignores_non_arrays_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postMaxitemsValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postMaxitemsValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -91,9 +88,9 @@ def test_shorter_is_valid_passes(self): 1, ] ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -105,7 +102,7 @@ def test_shorter_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postMaxitemsValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postMaxitemsValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -124,9 +121,9 @@ def test_exact_length_is_valid_passes(self): 2, ] ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -138,7 +135,7 @@ def test_exact_length_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postMaxitemsValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postMaxitemsValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -147,8 +144,5 @@ def test_exact_length_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, schemas.Unset) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxlength_validation_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxlength_validation_request_body/test_post.py index 8443176e95f..bd65c249d48 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxlength_validation_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxlength_validation_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_maxlength_validation_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_maxlength_validation_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostMaxlengthValidationRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostMaxlengthValidationRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -42,9 +39,9 @@ def test_too_long_is_invalid_fails(self): "foo" ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -55,9 +52,9 @@ def test_ignores_non_strings_passes(self): payload = ( 100 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -69,7 +66,7 @@ def test_ignores_non_strings_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postMaxlengthValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postMaxlengthValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -85,9 +82,9 @@ def test_shorter_is_valid_passes(self): payload = ( "f" ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -99,7 +96,7 @@ def test_shorter_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postMaxlengthValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postMaxlengthValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -115,9 +112,9 @@ def test_two_supplementary_unicode_code_points_is_long_enough_passes(self): payload = ( "💩💩" ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -129,7 +126,7 @@ def test_two_supplementary_unicode_code_points_is_long_enough_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postMaxlengthValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postMaxlengthValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -145,9 +142,9 @@ def test_exact_length_is_valid_passes(self): payload = ( "fo" ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -159,7 +156,7 @@ def test_exact_length_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postMaxlengthValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postMaxlengthValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -168,8 +165,5 @@ def test_exact_length_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, schemas.Unset) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxproperties0_means_the_object_is_empty_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxproperties0_means_the_object_is_empty_request_body/test_post.py index 53c93f5ba26..e229dbe27d9 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxproperties0_means_the_object_is_empty_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxproperties0_means_the_object_is_empty_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_maxproperties0_means_the_object_is_empty_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_maxproperties0_means_the_object_is_empty_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostMaxproperties0MeansTheObjectIsEmptyRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostMaxproperties0MeansTheObjectIsEmptyRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -42,9 +39,9 @@ def test_no_properties_is_valid_passes(self): { } ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -56,7 +53,7 @@ def test_no_properties_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postMaxproperties0MeansTheObjectIsEmptyRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postMaxproperties0MeansTheObjectIsEmptyRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -76,14 +73,11 @@ def test_one_property_is_invalid_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxproperties_validation_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxproperties_validation_request_body/test_post.py index 75849461f66..4403e3735d3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxproperties_validation_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxproperties_validation_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_maxproperties_validation_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_maxproperties_validation_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostMaxpropertiesValidationRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostMaxpropertiesValidationRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -49,9 +46,9 @@ def test_too_long_is_invalid_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -66,9 +63,9 @@ def test_ignores_arrays_passes(self): 3, ] ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -80,7 +77,7 @@ def test_ignores_arrays_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postMaxpropertiesValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postMaxpropertiesValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -96,9 +93,9 @@ def test_ignores_other_non_objects_passes(self): payload = ( 12 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -110,7 +107,7 @@ def test_ignores_other_non_objects_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postMaxpropertiesValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postMaxpropertiesValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -126,9 +123,9 @@ def test_ignores_strings_passes(self): payload = ( "foobar" ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -140,7 +137,7 @@ def test_ignores_strings_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postMaxpropertiesValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postMaxpropertiesValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -159,9 +156,9 @@ def test_shorter_is_valid_passes(self): 1, } ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -173,7 +170,7 @@ def test_shorter_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postMaxpropertiesValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postMaxpropertiesValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -194,9 +191,9 @@ def test_exact_length_is_valid_passes(self): 2, } ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -208,7 +205,7 @@ def test_exact_length_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postMaxpropertiesValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postMaxpropertiesValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -217,8 +214,5 @@ def test_exact_length_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, schemas.Unset) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minimum_validation_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minimum_validation_request_body/test_post.py index b637e0e80af..252f2955c6e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minimum_validation_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minimum_validation_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_minimum_validation_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_minimum_validation_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostMinimumValidationRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostMinimumValidationRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -41,9 +38,9 @@ def test_boundary_point_is_valid_passes(self): payload = ( 1.1 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -55,7 +52,7 @@ def test_boundary_point_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postMinimumValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postMinimumValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -72,9 +69,9 @@ def test_below_the_minimum_is_invalid_fails(self): 0.6 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -85,9 +82,9 @@ def test_above_the_minimum_is_valid_passes(self): payload = ( 2.6 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -99,7 +96,7 @@ def test_above_the_minimum_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postMinimumValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postMinimumValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -115,9 +112,9 @@ def test_ignores_non_numbers_passes(self): payload = ( "x" ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -129,7 +126,7 @@ def test_ignores_non_numbers_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postMinimumValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postMinimumValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -138,8 +135,5 @@ def test_ignores_non_numbers_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, schemas.Unset) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minimum_validation_with_signed_integer_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minimum_validation_with_signed_integer_request_body/test_post.py index 37dab1a048d..08a2bc5470e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minimum_validation_with_signed_integer_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minimum_validation_with_signed_integer_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_minimum_validation_with_signed_integer_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_minimum_validation_with_signed_integer_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostMinimumValidationWithSignedIntegerRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostMinimumValidationWithSignedIntegerRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -41,9 +38,9 @@ def test_boundary_point_is_valid_passes(self): payload = ( -2 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -55,7 +52,7 @@ def test_boundary_point_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postMinimumValidationWithSignedIntegerRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postMinimumValidationWithSignedIntegerRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -71,9 +68,9 @@ def test_positive_above_the_minimum_is_valid_passes(self): payload = ( 0 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -85,7 +82,7 @@ def test_positive_above_the_minimum_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postMinimumValidationWithSignedIntegerRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postMinimumValidationWithSignedIntegerRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -102,9 +99,9 @@ def test_int_below_the_minimum_is_invalid_fails(self): -3 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -116,9 +113,9 @@ def test_float_below_the_minimum_is_invalid_fails(self): -2.0001 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -129,9 +126,9 @@ def test_boundary_point_with_float_is_valid_passes(self): payload = ( -2.0 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -143,7 +140,7 @@ def test_boundary_point_with_float_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postMinimumValidationWithSignedIntegerRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postMinimumValidationWithSignedIntegerRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -159,9 +156,9 @@ def test_negative_above_the_minimum_is_valid_passes(self): payload = ( -1 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -173,7 +170,7 @@ def test_negative_above_the_minimum_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postMinimumValidationWithSignedIntegerRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postMinimumValidationWithSignedIntegerRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -189,9 +186,9 @@ def test_ignores_non_numbers_passes(self): payload = ( "x" ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -203,7 +200,7 @@ def test_ignores_non_numbers_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postMinimumValidationWithSignedIntegerRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postMinimumValidationWithSignedIntegerRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -212,8 +209,5 @@ def test_ignores_non_numbers_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, schemas.Unset) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minitems_validation_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minitems_validation_request_body/test_post.py index af54b84112b..e251d8722cc 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minitems_validation_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minitems_validation_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_minitems_validation_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_minitems_validation_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostMinitemsValidationRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostMinitemsValidationRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -43,9 +40,9 @@ def test_too_short_is_invalid_fails(self): ] ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -56,9 +53,9 @@ def test_ignores_non_arrays_passes(self): payload = ( "" ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -70,7 +67,7 @@ def test_ignores_non_arrays_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postMinitemsValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postMinitemsValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -89,9 +86,9 @@ def test_longer_is_valid_passes(self): 2, ] ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -103,7 +100,7 @@ def test_longer_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postMinitemsValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postMinitemsValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -121,9 +118,9 @@ def test_exact_length_is_valid_passes(self): 1, ] ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -135,7 +132,7 @@ def test_exact_length_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postMinitemsValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postMinitemsValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -144,8 +141,5 @@ def test_exact_length_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, schemas.Unset) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minlength_validation_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minlength_validation_request_body/test_post.py index 1a1db934bba..c95cd608f3f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minlength_validation_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minlength_validation_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_minlength_validation_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_minlength_validation_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostMinlengthValidationRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostMinlengthValidationRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -42,9 +39,9 @@ def test_too_short_is_invalid_fails(self): "f" ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -56,9 +53,9 @@ def test_one_supplementary_unicode_code_point_is_not_long_enough_fails(self): "💩" ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -69,9 +66,9 @@ def test_longer_is_valid_passes(self): payload = ( "foo" ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -83,7 +80,7 @@ def test_longer_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postMinlengthValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postMinlengthValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -99,9 +96,9 @@ def test_ignores_non_strings_passes(self): payload = ( 1 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -113,7 +110,7 @@ def test_ignores_non_strings_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postMinlengthValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postMinlengthValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -129,9 +126,9 @@ def test_exact_length_is_valid_passes(self): payload = ( "fo" ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -143,7 +140,7 @@ def test_exact_length_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postMinlengthValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postMinlengthValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -152,8 +149,5 @@ def test_exact_length_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, schemas.Unset) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minproperties_validation_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minproperties_validation_request_body/test_post.py index 91341e06d74..a6eacb68584 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minproperties_validation_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minproperties_validation_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_minproperties_validation_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_minproperties_validation_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostMinpropertiesValidationRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostMinpropertiesValidationRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -42,9 +39,9 @@ def test_ignores_arrays_passes(self): [ ] ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -56,7 +53,7 @@ def test_ignores_arrays_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postMinpropertiesValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postMinpropertiesValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -72,9 +69,9 @@ def test_ignores_other_non_objects_passes(self): payload = ( 12 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -86,7 +83,7 @@ def test_ignores_other_non_objects_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postMinpropertiesValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postMinpropertiesValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -104,9 +101,9 @@ def test_too_short_is_invalid_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -117,9 +114,9 @@ def test_ignores_strings_passes(self): payload = ( "" ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -131,7 +128,7 @@ def test_ignores_strings_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postMinpropertiesValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postMinpropertiesValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -152,9 +149,9 @@ def test_longer_is_valid_passes(self): 2, } ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -166,7 +163,7 @@ def test_longer_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postMinpropertiesValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postMinpropertiesValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -185,9 +182,9 @@ def test_exact_length_is_valid_passes(self): 1, } ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -199,7 +196,7 @@ def test_exact_length_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postMinpropertiesValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postMinpropertiesValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -208,8 +205,5 @@ def test_exact_length_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, schemas.Unset) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_allof_to_check_validation_semantics_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_allof_to_check_validation_semantics_request_body/test_post.py index 73e992a05f2..551793716af 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_allof_to_check_validation_semantics_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_allof_to_check_validation_semantics_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_nested_allof_to_check_validation_semantics_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_nested_allof_to_check_validation_semantics_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostNestedAllofToCheckValidationSemanticsRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostNestedAllofToCheckValidationSemanticsRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -42,9 +39,9 @@ def test_anything_non_null_is_invalid_fails(self): 123 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -55,9 +52,9 @@ def test_null_is_valid_passes(self): payload = ( None ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -69,7 +66,7 @@ def test_null_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postNestedAllofToCheckValidationSemanticsRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postNestedAllofToCheckValidationSemanticsRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -78,8 +75,5 @@ def test_null_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, schemas.Unset) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_anyof_to_check_validation_semantics_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_anyof_to_check_validation_semantics_request_body/test_post.py index 7951e3c8e8c..b894c81c879 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_anyof_to_check_validation_semantics_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_anyof_to_check_validation_semantics_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_nested_anyof_to_check_validation_semantics_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_nested_anyof_to_check_validation_semantics_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostNestedAnyofToCheckValidationSemanticsRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostNestedAnyofToCheckValidationSemanticsRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -42,9 +39,9 @@ def test_anything_non_null_is_invalid_fails(self): 123 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -55,9 +52,9 @@ def test_null_is_valid_passes(self): payload = ( None ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -69,7 +66,7 @@ def test_null_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postNestedAnyofToCheckValidationSemanticsRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postNestedAnyofToCheckValidationSemanticsRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -78,8 +75,5 @@ def test_null_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, schemas.Unset) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_items_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_items_request_body/test_post.py index 60874a6b8ae..321b97ba3ef 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_items_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_items_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_nested_items_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_nested_items_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostNestedItemsRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostNestedItemsRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -70,9 +67,9 @@ def test_valid_nested_array_passes(self): ], ] ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -84,7 +81,7 @@ def test_valid_nested_array_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postNestedItemsRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postNestedItemsRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -130,9 +127,9 @@ def test_nested_array_with_invalid_type_fails(self): ] ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -167,14 +164,11 @@ def test_not_deep_enough_fails(self): ] ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_oneof_to_check_validation_semantics_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_oneof_to_check_validation_semantics_request_body/test_post.py index 42a97ddac7b..8cfc905d8f0 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_oneof_to_check_validation_semantics_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_oneof_to_check_validation_semantics_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_nested_oneof_to_check_validation_semantics_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_nested_oneof_to_check_validation_semantics_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostNestedOneofToCheckValidationSemanticsRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostNestedOneofToCheckValidationSemanticsRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -42,9 +39,9 @@ def test_anything_non_null_is_invalid_fails(self): 123 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -55,9 +52,9 @@ def test_null_is_valid_passes(self): payload = ( None ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -69,7 +66,7 @@ def test_null_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postNestedOneofToCheckValidationSemanticsRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postNestedOneofToCheckValidationSemanticsRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -78,8 +75,5 @@ def test_null_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, schemas.Unset) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_not_more_complex_schema_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_not_more_complex_schema_request_body/test_post.py index eaacac00ebb..82fbcb4e31f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_not_more_complex_schema_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_not_more_complex_schema_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_not_more_complex_schema_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_not_more_complex_schema_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostNotMoreComplexSchemaRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostNotMoreComplexSchemaRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -44,9 +41,9 @@ def test_other_match_passes(self): 1, } ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -58,7 +55,7 @@ def test_other_match_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postNotMoreComplexSchemaRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postNotMoreComplexSchemaRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -78,9 +75,9 @@ def test_mismatch_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -91,9 +88,9 @@ def test_match_passes(self): payload = ( 1 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -105,7 +102,7 @@ def test_match_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postNotMoreComplexSchemaRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postNotMoreComplexSchemaRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -114,8 +111,5 @@ def test_match_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, schemas.Unset) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_not_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_not_request_body/test_post.py index c9bd6f3f304..aa0b135c843 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_not_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_not_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_not_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_not_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostNotRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostNotRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -41,9 +38,9 @@ def test_allowed_passes(self): payload = ( "foo" ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -55,7 +52,7 @@ def test_allowed_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postNotRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postNotRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -72,14 +69,11 @@ def test_disallowed_fails(self): 1 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nul_characters_in_strings_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nul_characters_in_strings_request_body/test_post.py index 0586243d617..d1ae9835f99 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nul_characters_in_strings_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nul_characters_in_strings_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_nul_characters_in_strings_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_nul_characters_in_strings_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostNulCharactersInStringsRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostNulCharactersInStringsRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -41,9 +38,9 @@ def test_match_string_with_nul_passes(self): payload = ( "hello\x00there" ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -55,7 +52,7 @@ def test_match_string_with_nul_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postNulCharactersInStringsRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postNulCharactersInStringsRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -72,14 +69,11 @@ def test_do_not_match_string_lacking_nul_fails(self): "hellothere" ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_null_type_matches_only_the_null_object_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_null_type_matches_only_the_null_object_request_body/test_post.py index f75a20619fa..a51e9146f53 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_null_type_matches_only_the_null_object_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_null_type_matches_only_the_null_object_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_null_type_matches_only_the_null_object_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_null_type_matches_only_the_null_object_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostNullTypeMatchesOnlyTheNullObjectRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostNullTypeMatchesOnlyTheNullObjectRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -42,9 +39,9 @@ def test_a_float_is_not_null_fails(self): 1.1 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -57,9 +54,9 @@ def test_an_object_is_not_null_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -71,9 +68,9 @@ def test_false_is_not_null_fails(self): False ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -85,9 +82,9 @@ def test_an_integer_is_not_null_fails(self): 1 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -99,9 +96,9 @@ def test_true_is_not_null_fails(self): True ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -113,9 +110,9 @@ def test_zero_is_not_null_fails(self): 0 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -127,9 +124,9 @@ def test_an_empty_string_is_not_null_fails(self): "" ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -140,9 +137,9 @@ def test_null_is_null_passes(self): payload = ( None ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -154,7 +151,7 @@ def test_null_is_null_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postNullTypeMatchesOnlyTheNullObjectRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postNullTypeMatchesOnlyTheNullObjectRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -172,9 +169,9 @@ def test_an_array_is_not_null_fails(self): ] ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -186,14 +183,11 @@ def test_a_string_is_not_null_fails(self): "foo" ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_number_type_matches_numbers_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_number_type_matches_numbers_request_body/test_post.py index 70284734ef6..ab8d4e80563 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_number_type_matches_numbers_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_number_type_matches_numbers_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_number_type_matches_numbers_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_number_type_matches_numbers_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostNumberTypeMatchesNumbersRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostNumberTypeMatchesNumbersRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -43,9 +40,9 @@ def test_an_array_is_not_a_number_fails(self): ] ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -57,9 +54,9 @@ def test_null_is_not_a_number_fails(self): None ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -72,9 +69,9 @@ def test_an_object_is_not_a_number_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -86,9 +83,9 @@ def test_a_boolean_is_not_a_number_fails(self): True ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -99,9 +96,9 @@ def test_a_float_is_a_number_passes(self): payload = ( 1.1 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -113,7 +110,7 @@ def test_a_float_is_a_number_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postNumberTypeMatchesNumbersRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postNumberTypeMatchesNumbersRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -130,9 +127,9 @@ def test_a_string_is_still_not_a_number_even_if_it_looks_like_one_fails(self): "1" ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -144,9 +141,9 @@ def test_a_string_is_not_a_number_fails(self): "foo" ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -157,9 +154,9 @@ def test_an_integer_is_a_number_passes(self): payload = ( 1 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -171,7 +168,7 @@ def test_an_integer_is_a_number_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postNumberTypeMatchesNumbersRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postNumberTypeMatchesNumbersRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -187,9 +184,9 @@ def test_a_float_with_zero_fractional_part_is_a_number_and_an_integer_passes(sel payload = ( 1.0 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -201,7 +198,7 @@ def test_a_float_with_zero_fractional_part_is_a_number_and_an_integer_passes(sel ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postNumberTypeMatchesNumbersRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postNumberTypeMatchesNumbersRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -210,8 +207,5 @@ def test_a_float_with_zero_fractional_part_is_a_number_and_an_integer_passes(sel assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, schemas.Unset) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_object_properties_validation_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_object_properties_validation_request_body/test_post.py index 67fe785a8e4..85c601775d3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_object_properties_validation_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_object_properties_validation_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_object_properties_validation_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_object_properties_validation_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostObjectPropertiesValidationRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostObjectPropertiesValidationRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -42,9 +39,9 @@ def test_ignores_arrays_passes(self): [ ] ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -56,7 +53,7 @@ def test_ignores_arrays_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postObjectPropertiesValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postObjectPropertiesValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -72,9 +69,9 @@ def test_ignores_other_non_objects_passes(self): payload = ( 12 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -86,7 +83,7 @@ def test_ignores_other_non_objects_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postObjectPropertiesValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postObjectPropertiesValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -109,9 +106,9 @@ def test_one_property_invalid_is_invalid_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -127,9 +124,9 @@ def test_both_properties_present_and_valid_is_valid_passes(self): "baz", } ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -141,7 +138,7 @@ def test_both_properties_present_and_valid_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postObjectPropertiesValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postObjectPropertiesValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -161,9 +158,9 @@ def test_doesn_t_invalidate_other_properties_passes(self): ], } ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -175,7 +172,7 @@ def test_doesn_t_invalidate_other_properties_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postObjectPropertiesValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postObjectPropertiesValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -199,14 +196,11 @@ def test_both_properties_invalid_is_invalid_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_object_type_matches_objects_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_object_type_matches_objects_request_body/test_post.py index da5fdf5754b..bffd99f7771 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_object_type_matches_objects_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_object_type_matches_objects_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_object_type_matches_objects_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_object_type_matches_objects_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostObjectTypeMatchesObjectsRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostObjectTypeMatchesObjectsRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -42,9 +39,9 @@ def test_a_float_is_not_an_object_fails(self): 1.1 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -56,9 +53,9 @@ def test_null_is_not_an_object_fails(self): None ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -71,9 +68,9 @@ def test_an_array_is_not_an_object_fails(self): ] ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -85,9 +82,9 @@ def test_an_object_is_an_object_passes(self): { } ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -99,7 +96,7 @@ def test_an_object_is_an_object_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postObjectTypeMatchesObjectsRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postObjectTypeMatchesObjectsRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -116,9 +113,9 @@ def test_a_string_is_not_an_object_fails(self): "foo" ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -130,9 +127,9 @@ def test_an_integer_is_not_an_object_fails(self): 1 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -144,14 +141,11 @@ def test_a_boolean_is_not_an_object_fails(self): True ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_complex_types_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_complex_types_request_body/test_post.py index a786ebf4eb7..c923ccd46d6 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_complex_types_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_complex_types_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_oneof_complex_types_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_oneof_complex_types_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostOneofComplexTypesRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostOneofComplexTypesRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -44,9 +41,9 @@ def test_first_oneof_valid_complex_passes(self): 2, } ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -58,7 +55,7 @@ def test_first_oneof_valid_complex_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postOneofComplexTypesRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postOneofComplexTypesRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -80,9 +77,9 @@ def test_neither_oneof_valid_complex_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -99,9 +96,9 @@ def test_both_oneof_valid_complex_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -115,9 +112,9 @@ def test_second_oneof_valid_complex_passes(self): "baz", } ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -129,7 +126,7 @@ def test_second_oneof_valid_complex_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postOneofComplexTypesRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postOneofComplexTypesRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -138,8 +135,5 @@ def test_second_oneof_valid_complex_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, schemas.Unset) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_request_body/test_post.py index 1b837331c1f..adc2596a6b9 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_oneof_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_oneof_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostOneofRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostOneofRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -41,9 +38,9 @@ def test_second_oneof_valid_passes(self): payload = ( 2.5 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -55,7 +52,7 @@ def test_second_oneof_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postOneofRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postOneofRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -72,9 +69,9 @@ def test_both_oneof_valid_fails(self): 3 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -85,9 +82,9 @@ def test_first_oneof_valid_passes(self): payload = ( 1 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -99,7 +96,7 @@ def test_first_oneof_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postOneofRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postOneofRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -116,14 +113,11 @@ def test_neither_oneof_valid_fails(self): 1.5 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_with_base_schema_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_with_base_schema_request_body/test_post.py index 57bc715f62d..4a739ec9ae3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_with_base_schema_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_with_base_schema_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_oneof_with_base_schema_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_oneof_with_base_schema_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostOneofWithBaseSchemaRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostOneofWithBaseSchemaRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -42,9 +39,9 @@ def test_both_oneof_valid_fails(self): "foo" ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -56,9 +53,9 @@ def test_mismatch_base_schema_fails(self): 3 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -69,9 +66,9 @@ def test_one_oneof_valid_passes(self): payload = ( "foobar" ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -83,7 +80,7 @@ def test_one_oneof_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postOneofWithBaseSchemaRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postOneofWithBaseSchemaRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -92,8 +89,5 @@ def test_one_oneof_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, schemas.Unset) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_with_empty_schema_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_with_empty_schema_request_body/test_post.py index 191c9dc3dc2..04dcf7ceb66 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_with_empty_schema_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_with_empty_schema_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_oneof_with_empty_schema_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_oneof_with_empty_schema_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostOneofWithEmptySchemaRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostOneofWithEmptySchemaRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -42,9 +39,9 @@ def test_both_valid_invalid_fails(self): 123 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -55,9 +52,9 @@ def test_one_valid_valid_passes(self): payload = ( "foo" ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -69,7 +66,7 @@ def test_one_valid_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postOneofWithEmptySchemaRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postOneofWithEmptySchemaRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -78,8 +75,5 @@ def test_one_valid_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, schemas.Unset) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_with_required_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_with_required_request_body/test_post.py index 6f01d9c6e51..402910fcf67 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_with_required_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_with_required_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_oneof_with_required_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_oneof_with_required_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostOneofWithRequiredRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostOneofWithRequiredRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -49,9 +46,9 @@ def test_both_valid_invalid_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -66,9 +63,9 @@ def test_both_invalid_invalid_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -84,9 +81,9 @@ def test_first_valid_valid_passes(self): 2, } ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -98,7 +95,7 @@ def test_first_valid_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postOneofWithRequiredRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postOneofWithRequiredRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -119,9 +116,9 @@ def test_second_valid_valid_passes(self): 3, } ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -133,7 +130,7 @@ def test_second_valid_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postOneofWithRequiredRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postOneofWithRequiredRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -142,8 +139,5 @@ def test_second_valid_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, schemas.Unset) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_pattern_is_not_anchored_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_pattern_is_not_anchored_request_body/test_post.py index 6ec8ce1d92a..709f2678ee3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_pattern_is_not_anchored_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_pattern_is_not_anchored_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_pattern_is_not_anchored_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_pattern_is_not_anchored_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostPatternIsNotAnchoredRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostPatternIsNotAnchoredRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -41,9 +38,9 @@ def test_matches_a_substring_passes(self): payload = ( "xxaayy" ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -55,7 +52,7 @@ def test_matches_a_substring_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postPatternIsNotAnchoredRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postPatternIsNotAnchoredRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -64,8 +61,5 @@ def test_matches_a_substring_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, schemas.Unset) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_pattern_validation_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_pattern_validation_request_body/test_post.py index e788bd9e21c..ba0ea2d8977 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_pattern_validation_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_pattern_validation_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_pattern_validation_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_pattern_validation_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostPatternValidationRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostPatternValidationRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -42,9 +39,9 @@ def test_ignores_arrays_passes(self): [ ] ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -56,7 +53,7 @@ def test_ignores_arrays_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postPatternValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postPatternValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -73,9 +70,9 @@ def test_ignores_objects_passes(self): { } ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -87,7 +84,7 @@ def test_ignores_objects_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postPatternValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postPatternValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -103,9 +100,9 @@ def test_ignores_null_passes(self): payload = ( None ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -117,7 +114,7 @@ def test_ignores_null_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postPatternValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postPatternValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -133,9 +130,9 @@ def test_ignores_floats_passes(self): payload = ( 1.0 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -147,7 +144,7 @@ def test_ignores_floats_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postPatternValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postPatternValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -164,9 +161,9 @@ def test_a_non_matching_pattern_is_invalid_fails(self): "abc" ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -177,9 +174,9 @@ def test_ignores_booleans_passes(self): payload = ( True ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -191,7 +188,7 @@ def test_ignores_booleans_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postPatternValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postPatternValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -207,9 +204,9 @@ def test_a_matching_pattern_is_valid_passes(self): payload = ( "aaa" ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -221,7 +218,7 @@ def test_a_matching_pattern_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postPatternValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postPatternValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -237,9 +234,9 @@ def test_ignores_integers_passes(self): payload = ( 123 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -251,7 +248,7 @@ def test_ignores_integers_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postPatternValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postPatternValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -260,8 +257,5 @@ def test_ignores_integers_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, schemas.Unset) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_properties_with_escaped_characters_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_properties_with_escaped_characters_request_body/test_post.py index f0ce9cfad28..6d982c9abef 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_properties_with_escaped_characters_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_properties_with_escaped_characters_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_properties_with_escaped_characters_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_properties_with_escaped_characters_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostPropertiesWithEscapedCharactersRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostPropertiesWithEscapedCharactersRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -54,9 +51,9 @@ def test_object_with_all_numbers_is_valid_passes(self): 1, } ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -68,7 +65,7 @@ def test_object_with_all_numbers_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postPropertiesWithEscapedCharactersRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postPropertiesWithEscapedCharactersRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -98,14 +95,11 @@ def test_object_with_strings_is_invalid_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_property_named_ref_that_is_not_a_reference_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_property_named_ref_that_is_not_a_reference_request_body/test_post.py index 486fa4c5ae7..e0d6076987e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_property_named_ref_that_is_not_a_reference_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_property_named_ref_that_is_not_a_reference_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_property_named_ref_that_is_not_a_reference_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_property_named_ref_that_is_not_a_reference_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostPropertyNamedRefThatIsNotAReferenceRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostPropertyNamedRefThatIsNotAReferenceRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -44,9 +41,9 @@ def test_property_named_ref_valid_passes(self): "a", } ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -58,7 +55,7 @@ def test_property_named_ref_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postPropertyNamedRefThatIsNotAReferenceRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postPropertyNamedRefThatIsNotAReferenceRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -78,14 +75,11 @@ def test_property_named_ref_invalid_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_additionalproperties_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_additionalproperties_request_body/test_post.py index eabe92bd69b..730ccba3b70 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_additionalproperties_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_additionalproperties_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_ref_in_additionalproperties_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_ref_in_additionalproperties_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostRefInAdditionalpropertiesRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostRefInAdditionalpropertiesRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -47,9 +44,9 @@ def test_property_named_ref_valid_passes(self): }, } ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -61,7 +58,7 @@ def test_property_named_ref_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postRefInAdditionalpropertiesRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postRefInAdditionalpropertiesRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -84,14 +81,11 @@ def test_property_named_ref_invalid_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_allof_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_allof_request_body/test_post.py index b7aa28e7bd7..a2323f0a8bd 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_allof_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_allof_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_ref_in_allof_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_ref_in_allof_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostRefInAllofRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostRefInAllofRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -44,9 +41,9 @@ def test_property_named_ref_valid_passes(self): "a", } ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -58,7 +55,7 @@ def test_property_named_ref_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postRefInAllofRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postRefInAllofRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -78,14 +75,11 @@ def test_property_named_ref_invalid_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_anyof_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_anyof_request_body/test_post.py index 517d2427df6..7249e96639f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_anyof_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_anyof_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_ref_in_anyof_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_ref_in_anyof_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostRefInAnyofRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostRefInAnyofRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -44,9 +41,9 @@ def test_property_named_ref_valid_passes(self): "a", } ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -58,7 +55,7 @@ def test_property_named_ref_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postRefInAnyofRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postRefInAnyofRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -78,14 +75,11 @@ def test_property_named_ref_invalid_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_items_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_items_request_body/test_post.py index e32c859fc69..a5ca64e5ebd 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_items_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_items_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_ref_in_items_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_ref_in_items_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostRefInItemsRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostRefInItemsRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -46,9 +43,9 @@ def test_property_named_ref_valid_passes(self): }, ] ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -60,7 +57,7 @@ def test_property_named_ref_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postRefInItemsRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postRefInItemsRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -82,14 +79,11 @@ def test_property_named_ref_invalid_fails(self): ] ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_not_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_not_request_body/test_post.py index 2285d7c3b43..5b150784434 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_not_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_not_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_ref_in_not_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_ref_in_not_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostRefInNotRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostRefInNotRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -44,9 +41,9 @@ def test_property_named_ref_valid_passes(self): 2, } ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -58,7 +55,7 @@ def test_property_named_ref_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postRefInNotRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postRefInNotRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -78,14 +75,11 @@ def test_property_named_ref_invalid_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_oneof_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_oneof_request_body/test_post.py index 7606a57de91..6595a3a1dad 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_oneof_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_oneof_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_ref_in_oneof_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_ref_in_oneof_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostRefInOneofRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostRefInOneofRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -44,9 +41,9 @@ def test_property_named_ref_valid_passes(self): "a", } ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -58,7 +55,7 @@ def test_property_named_ref_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postRefInOneofRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postRefInOneofRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -78,14 +75,11 @@ def test_property_named_ref_invalid_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_property_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_property_request_body/test_post.py index 7f469264453..b93276c4717 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_property_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_property_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_ref_in_property_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_ref_in_property_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostRefInPropertyRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostRefInPropertyRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -47,9 +44,9 @@ def test_property_named_ref_valid_passes(self): }, } ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -61,7 +58,7 @@ def test_property_named_ref_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postRefInPropertyRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postRefInPropertyRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -84,14 +81,11 @@ def test_property_named_ref_invalid_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_default_validation_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_default_validation_request_body/test_post.py index 17a9e08c7a3..15b2c1debfd 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_default_validation_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_default_validation_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_required_default_validation_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_required_default_validation_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostRequiredDefaultValidationRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostRequiredDefaultValidationRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -42,9 +39,9 @@ def test_not_required_by_default_passes(self): { } ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -56,7 +53,7 @@ def test_not_required_by_default_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postRequiredDefaultValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postRequiredDefaultValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -65,8 +62,5 @@ def test_not_required_by_default_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, schemas.Unset) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_validation_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_validation_request_body/test_post.py index ab17be30229..fe9c130b39e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_validation_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_validation_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_required_validation_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_required_validation_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostRequiredValidationRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostRequiredValidationRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -42,9 +39,9 @@ def test_ignores_arrays_passes(self): [ ] ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -56,7 +53,7 @@ def test_ignores_arrays_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postRequiredValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postRequiredValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -75,9 +72,9 @@ def test_present_required_property_is_valid_passes(self): 1, } ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -89,7 +86,7 @@ def test_present_required_property_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postRequiredValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postRequiredValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -105,9 +102,9 @@ def test_ignores_other_non_objects_passes(self): payload = ( 12 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -119,7 +116,7 @@ def test_ignores_other_non_objects_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postRequiredValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postRequiredValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -135,9 +132,9 @@ def test_ignores_strings_passes(self): payload = ( "" ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -149,7 +146,7 @@ def test_ignores_strings_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postRequiredValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postRequiredValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -169,14 +166,11 @@ def test_non_present_required_property_is_invalid_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_with_empty_array_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_with_empty_array_request_body/test_post.py index 3e3491d1821..d47aba085ce 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_with_empty_array_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_with_empty_array_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_required_with_empty_array_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_required_with_empty_array_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostRequiredWithEmptyArrayRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostRequiredWithEmptyArrayRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -42,9 +39,9 @@ def test_property_not_required_passes(self): { } ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -56,7 +53,7 @@ def test_property_not_required_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postRequiredWithEmptyArrayRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postRequiredWithEmptyArrayRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -65,8 +62,5 @@ def test_property_not_required_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, schemas.Unset) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_with_escaped_characters_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_with_escaped_characters_request_body/test_post.py index 607f5368732..ecf2aea5064 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_with_escaped_characters_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_with_escaped_characters_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_required_with_escaped_characters_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_required_with_escaped_characters_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostRequiredWithEscapedCharactersRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostRequiredWithEscapedCharactersRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -47,9 +44,9 @@ def test_object_with_some_properties_missing_is_invalid_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -73,9 +70,9 @@ def test_object_with_all_properties_present_is_valid_passes(self): 1, } ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -87,7 +84,7 @@ def test_object_with_all_properties_present_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postRequiredWithEscapedCharactersRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postRequiredWithEscapedCharactersRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -96,8 +93,5 @@ def test_object_with_all_properties_present_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, schemas.Unset) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_simple_enum_validation_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_simple_enum_validation_request_body/test_post.py index a6ee338a7e7..fd49bc77202 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_simple_enum_validation_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_simple_enum_validation_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_simple_enum_validation_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_simple_enum_validation_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostSimpleEnumValidationRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostSimpleEnumValidationRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -42,9 +39,9 @@ def test_something_else_is_invalid_fails(self): 4 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -55,9 +52,9 @@ def test_one_of_the_enum_is_valid_passes(self): payload = ( 1 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -69,7 +66,7 @@ def test_one_of_the_enum_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postSimpleEnumValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postSimpleEnumValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -78,8 +75,5 @@ def test_one_of_the_enum_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, schemas.Unset) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_string_type_matches_strings_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_string_type_matches_strings_request_body/test_post.py index 12f1e9bfefc..ecda83b4d4a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_string_type_matches_strings_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_string_type_matches_strings_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_string_type_matches_strings_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_string_type_matches_strings_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostStringTypeMatchesStringsRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostStringTypeMatchesStringsRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -42,9 +39,9 @@ def test_1_is_not_a_string_fails(self): 1 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -55,9 +52,9 @@ def test_a_string_is_still_a_string_even_if_it_looks_like_a_number_passes(self): payload = ( "1" ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -69,7 +66,7 @@ def test_a_string_is_still_a_string_even_if_it_looks_like_a_number_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postStringTypeMatchesStringsRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postStringTypeMatchesStringsRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -85,9 +82,9 @@ def test_an_empty_string_is_still_a_string_passes(self): payload = ( "" ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -99,7 +96,7 @@ def test_an_empty_string_is_still_a_string_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postStringTypeMatchesStringsRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postStringTypeMatchesStringsRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -116,9 +113,9 @@ def test_a_float_is_not_a_string_fails(self): 1.1 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -131,9 +128,9 @@ def test_an_object_is_not_a_string_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -146,9 +143,9 @@ def test_an_array_is_not_a_string_fails(self): ] ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -160,9 +157,9 @@ def test_a_boolean_is_not_a_string_fails(self): True ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -174,9 +171,9 @@ def test_null_is_not_a_string_fails(self): None ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -187,9 +184,9 @@ def test_a_string_is_a_string_passes(self): payload = ( "foo" ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -201,7 +198,7 @@ def test_a_string_is_a_string_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postStringTypeMatchesStringsRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postStringTypeMatchesStringsRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -210,8 +207,5 @@ def test_a_string_is_a_string_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, schemas.Unset) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/test_post.py index 56ea79de77d..e059c3ae906 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -42,9 +39,9 @@ def test_missing_properties_are_not_filled_in_with_the_default_passes(self): { } ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -56,7 +53,7 @@ def test_missing_properties_are_not_filled_in_with_the_default_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -75,9 +72,9 @@ def test_an_explicit_property_value_is_checked_against_maximum_passing_passes(se 1, } ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -89,7 +86,7 @@ def test_an_explicit_property_value_is_checked_against_maximum_passing_passes(se ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -109,14 +106,11 @@ def test_an_explicit_property_value_is_checked_against_maximum_failing_fails(sel } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uniqueitems_false_validation_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uniqueitems_false_validation_request_body/test_post.py index affd09c5194..94ee39560e6 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uniqueitems_false_validation_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uniqueitems_false_validation_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_uniqueitems_false_validation_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_uniqueitems_false_validation_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostUniqueitemsFalseValidationRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostUniqueitemsFalseValidationRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -44,9 +41,9 @@ def test_non_unique_array_of_integers_is_valid_passes(self): 1, ] ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -58,7 +55,7 @@ def test_non_unique_array_of_integers_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postUniqueitemsFalseValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postUniqueitemsFalseValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -83,9 +80,9 @@ def test_unique_array_of_objects_is_valid_passes(self): }, ] ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -97,7 +94,7 @@ def test_unique_array_of_objects_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postUniqueitemsFalseValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postUniqueitemsFalseValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -134,9 +131,9 @@ def test_non_unique_array_of_nested_objects_is_valid_passes(self): }, ] ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -148,7 +145,7 @@ def test_non_unique_array_of_nested_objects_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postUniqueitemsFalseValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postUniqueitemsFalseValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -173,9 +170,9 @@ def test_non_unique_array_of_objects_is_valid_passes(self): }, ] ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -187,7 +184,7 @@ def test_non_unique_array_of_objects_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postUniqueitemsFalseValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postUniqueitemsFalseValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -206,9 +203,9 @@ def test_1_and_true_are_unique_passes(self): True, ] ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -220,7 +217,7 @@ def test_1_and_true_are_unique_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postUniqueitemsFalseValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postUniqueitemsFalseValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -239,9 +236,9 @@ def test_unique_array_of_integers_is_valid_passes(self): 2, ] ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -253,7 +250,7 @@ def test_unique_array_of_integers_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postUniqueitemsFalseValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postUniqueitemsFalseValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -276,9 +273,9 @@ def test_non_unique_array_of_arrays_is_valid_passes(self): ], ] ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -290,7 +287,7 @@ def test_non_unique_array_of_arrays_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postUniqueitemsFalseValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postUniqueitemsFalseValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -310,9 +307,9 @@ def test_numbers_are_unique_if_mathematically_unequal_passes(self): 1, ] ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -324,7 +321,7 @@ def test_numbers_are_unique_if_mathematically_unequal_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postUniqueitemsFalseValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postUniqueitemsFalseValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -343,9 +340,9 @@ def test_false_is_not_equal_to_zero_passes(self): False, ] ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -357,7 +354,7 @@ def test_false_is_not_equal_to_zero_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postUniqueitemsFalseValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postUniqueitemsFalseValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -394,9 +391,9 @@ def test_unique_array_of_nested_objects_is_valid_passes(self): }, ] ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -408,7 +405,7 @@ def test_unique_array_of_nested_objects_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postUniqueitemsFalseValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postUniqueitemsFalseValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -427,9 +424,9 @@ def test_0_and_false_are_unique_passes(self): False, ] ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -441,7 +438,7 @@ def test_0_and_false_are_unique_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postUniqueitemsFalseValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postUniqueitemsFalseValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -464,9 +461,9 @@ def test_unique_array_of_arrays_is_valid_passes(self): ], ] ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -478,7 +475,7 @@ def test_unique_array_of_arrays_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postUniqueitemsFalseValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postUniqueitemsFalseValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -497,9 +494,9 @@ def test_true_is_not_equal_to_one_passes(self): True, ] ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -511,7 +508,7 @@ def test_true_is_not_equal_to_one_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postUniqueitemsFalseValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postUniqueitemsFalseValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -538,9 +535,9 @@ def test_non_unique_heterogeneous_types_are_valid_passes(self): 1, ] ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -552,7 +549,7 @@ def test_non_unique_heterogeneous_types_are_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postUniqueitemsFalseValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postUniqueitemsFalseValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -577,9 +574,9 @@ def test_unique_heterogeneous_types_are_valid_passes(self): 1, ] ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -591,7 +588,7 @@ def test_unique_heterogeneous_types_are_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postUniqueitemsFalseValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postUniqueitemsFalseValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -600,8 +597,5 @@ def test_unique_heterogeneous_types_are_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, schemas.Unset) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uniqueitems_validation_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uniqueitems_validation_request_body/test_post.py index 12d95ae7aef..a468e5ea03d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uniqueitems_validation_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uniqueitems_validation_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_uniqueitems_validation_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_uniqueitems_validation_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostUniqueitemsValidationRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostUniqueitemsValidationRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -50,9 +47,9 @@ def test_unique_array_of_objects_is_valid_passes(self): }, ] ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -64,7 +61,7 @@ def test_unique_array_of_objects_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postUniqueitemsValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postUniqueitemsValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -89,9 +86,9 @@ def test_a_true_and_a1_are_unique_passes(self): }, ] ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -103,7 +100,7 @@ def test_a_true_and_a1_are_unique_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postUniqueitemsValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postUniqueitemsValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -131,9 +128,9 @@ def test_non_unique_heterogeneous_types_are_invalid_fails(self): ] ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -157,9 +154,9 @@ def test_nested0_and_false_are_unique_passes(self): ], ] ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -171,7 +168,7 @@ def test_nested0_and_false_are_unique_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postUniqueitemsValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postUniqueitemsValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -196,9 +193,9 @@ def test_a_false_and_a0_are_unique_passes(self): }, ] ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -210,7 +207,7 @@ def test_a_false_and_a0_are_unique_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postUniqueitemsValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postUniqueitemsValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -231,9 +228,9 @@ def test_numbers_are_unique_if_mathematically_unequal_fails(self): ] ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -247,9 +244,9 @@ def test_false_is_not_equal_to_zero_passes(self): False, ] ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -261,7 +258,7 @@ def test_false_is_not_equal_to_zero_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postUniqueitemsValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postUniqueitemsValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -284,9 +281,9 @@ def test_0_and_false_are_unique_passes(self): ], ] ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -298,7 +295,7 @@ def test_0_and_false_are_unique_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postUniqueitemsValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postUniqueitemsValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -321,9 +318,9 @@ def test_unique_array_of_arrays_is_valid_passes(self): ], ] ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -335,7 +332,7 @@ def test_unique_array_of_arrays_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postUniqueitemsValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postUniqueitemsValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -373,9 +370,9 @@ def test_non_unique_array_of_nested_objects_is_invalid_fails(self): ] ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -391,9 +388,9 @@ def test_non_unique_array_of_more_than_two_integers_is_invalid_fails(self): ] ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -407,9 +404,9 @@ def test_true_is_not_equal_to_one_passes(self): True, ] ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -421,7 +418,7 @@ def test_true_is_not_equal_to_one_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postUniqueitemsValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postUniqueitemsValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -451,9 +448,9 @@ def test_objects_are_non_unique_despite_key_order_fails(self): ] ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -468,9 +465,9 @@ def test_unique_array_of_strings_is_valid_passes(self): "baz", ] ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -482,7 +479,7 @@ def test_unique_array_of_strings_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postUniqueitemsValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postUniqueitemsValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -505,9 +502,9 @@ def test_1_and_true_are_unique_passes(self): ], ] ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -519,7 +516,7 @@ def test_1_and_true_are_unique_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postUniqueitemsValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postUniqueitemsValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -548,9 +545,9 @@ def test_different_objects_are_unique_passes(self): }, ] ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -562,7 +559,7 @@ def test_different_objects_are_unique_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postUniqueitemsValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postUniqueitemsValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -581,9 +578,9 @@ def test_unique_array_of_integers_is_valid_passes(self): 2, ] ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -595,7 +592,7 @@ def test_unique_array_of_integers_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postUniqueitemsValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postUniqueitemsValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -622,9 +619,9 @@ def test_non_unique_array_of_more_than_two_arrays_is_invalid_fails(self): ] ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -645,9 +642,9 @@ def test_non_unique_array_of_objects_is_invalid_fails(self): ] ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -679,9 +676,9 @@ def test_unique_array_of_nested_objects_is_valid_passes(self): }, ] ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -693,7 +690,7 @@ def test_unique_array_of_nested_objects_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postUniqueitemsValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postUniqueitemsValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -717,9 +714,9 @@ def test_non_unique_array_of_arrays_is_invalid_fails(self): ] ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -735,9 +732,9 @@ def test_non_unique_array_of_strings_is_invalid_fails(self): ] ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) @@ -761,9 +758,9 @@ def test_nested1_and_true_are_unique_passes(self): ], ] ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -775,7 +772,7 @@ def test_nested1_and_true_are_unique_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postUniqueitemsValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postUniqueitemsValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -801,9 +798,9 @@ def test_unique_heterogeneous_types_are_valid_passes(self): "{}", ] ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -815,7 +812,7 @@ def test_unique_heterogeneous_types_are_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postUniqueitemsValidationRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postUniqueitemsValidationRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -835,14 +832,11 @@ def test_non_unique_array_of_integers_is_invalid_fails(self): ] ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) self.api.post(body=body) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uri_format_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uri_format_request_body/test_post.py index 94a07cc1f57..58d93f81ec1 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uri_format_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uri_format_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_uri_format_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_uri_format_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostUriFormatRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostUriFormatRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -42,9 +39,9 @@ def test_all_string_formats_ignore_objects_passes(self): { } ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -56,7 +53,7 @@ def test_all_string_formats_ignore_objects_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postUriFormatRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postUriFormatRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -72,9 +69,9 @@ def test_all_string_formats_ignore_booleans_passes(self): payload = ( False ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -86,7 +83,7 @@ def test_all_string_formats_ignore_booleans_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postUriFormatRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postUriFormatRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -102,9 +99,9 @@ def test_all_string_formats_ignore_integers_passes(self): payload = ( 12 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -116,7 +113,7 @@ def test_all_string_formats_ignore_integers_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postUriFormatRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postUriFormatRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -132,9 +129,9 @@ def test_all_string_formats_ignore_floats_passes(self): payload = ( 13.7 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -146,7 +143,7 @@ def test_all_string_formats_ignore_floats_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postUriFormatRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postUriFormatRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -163,9 +160,9 @@ def test_all_string_formats_ignore_arrays_passes(self): [ ] ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -177,7 +174,7 @@ def test_all_string_formats_ignore_arrays_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postUriFormatRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postUriFormatRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -193,9 +190,9 @@ def test_all_string_formats_ignore_nulls_passes(self): payload = ( None ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -207,7 +204,7 @@ def test_all_string_formats_ignore_nulls_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postUriFormatRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postUriFormatRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -216,8 +213,5 @@ def test_all_string_formats_ignore_nulls_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, schemas.Unset) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uri_reference_format_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uri_reference_format_request_body/test_post.py index 9dfca7bbc66..b2b2eb2ef6d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uri_reference_format_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uri_reference_format_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_uri_reference_format_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_uri_reference_format_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostUriReferenceFormatRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostUriReferenceFormatRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -42,9 +39,9 @@ def test_all_string_formats_ignore_objects_passes(self): { } ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -56,7 +53,7 @@ def test_all_string_formats_ignore_objects_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postUriReferenceFormatRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postUriReferenceFormatRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -72,9 +69,9 @@ def test_all_string_formats_ignore_booleans_passes(self): payload = ( False ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -86,7 +83,7 @@ def test_all_string_formats_ignore_booleans_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postUriReferenceFormatRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postUriReferenceFormatRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -102,9 +99,9 @@ def test_all_string_formats_ignore_integers_passes(self): payload = ( 12 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -116,7 +113,7 @@ def test_all_string_formats_ignore_integers_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postUriReferenceFormatRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postUriReferenceFormatRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -132,9 +129,9 @@ def test_all_string_formats_ignore_floats_passes(self): payload = ( 13.7 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -146,7 +143,7 @@ def test_all_string_formats_ignore_floats_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postUriReferenceFormatRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postUriReferenceFormatRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -163,9 +160,9 @@ def test_all_string_formats_ignore_arrays_passes(self): [ ] ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -177,7 +174,7 @@ def test_all_string_formats_ignore_arrays_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postUriReferenceFormatRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postUriReferenceFormatRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -193,9 +190,9 @@ def test_all_string_formats_ignore_nulls_passes(self): payload = ( None ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -207,7 +204,7 @@ def test_all_string_formats_ignore_nulls_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postUriReferenceFormatRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postUriReferenceFormatRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -216,8 +213,5 @@ def test_all_string_formats_ignore_nulls_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, schemas.Unset) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uri_template_format_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uri_template_format_request_body/test_post.py index 93544bef168..77ca486e1c3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uri_template_format_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uri_template_format_request_body/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,24 +12,21 @@ import urllib3 import unit_test_api -from unit_test_api.paths.request_body_post_uri_template_format_request_body import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.request_body_post_uri_template_format_request_body.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestRequestBodyPostUriTemplateFormatRequestBody(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - RequestBodyPostUriTemplateFormatRequestBody unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' @@ -42,9 +39,9 @@ def test_all_string_formats_ignore_objects_passes(self): { } ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -56,7 +53,7 @@ def test_all_string_formats_ignore_objects_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postUriTemplateFormatRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postUriTemplateFormatRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -72,9 +69,9 @@ def test_all_string_formats_ignore_booleans_passes(self): payload = ( False ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -86,7 +83,7 @@ def test_all_string_formats_ignore_booleans_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postUriTemplateFormatRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postUriTemplateFormatRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -102,9 +99,9 @@ def test_all_string_formats_ignore_integers_passes(self): payload = ( 12 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -116,7 +113,7 @@ def test_all_string_formats_ignore_integers_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postUriTemplateFormatRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postUriTemplateFormatRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -132,9 +129,9 @@ def test_all_string_formats_ignore_floats_passes(self): payload = ( 13.7 ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -146,7 +143,7 @@ def test_all_string_formats_ignore_floats_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postUriTemplateFormatRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postUriTemplateFormatRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -163,9 +160,9 @@ def test_all_string_formats_ignore_arrays_passes(self): [ ] ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -177,7 +174,7 @@ def test_all_string_formats_ignore_arrays_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postUriTemplateFormatRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postUriTemplateFormatRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -193,9 +190,9 @@ def test_all_string_formats_ignore_nulls_passes(self): payload = ( None ) - body = post.SchemaForRequestBodyApplicationJson.from_openapi_data_oapg( + body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -207,7 +204,7 @@ def test_all_string_formats_ignore_nulls_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/requestBody/postUriTemplateFormatRequestBody', + self.api_config.get_server_url('servers', None) + "/requestBody/postUriTemplateFormatRequestBody", method='post'.upper(), body=self.json_bytes(payload), content_type=content_type, @@ -216,8 +213,5 @@ def test_all_string_formats_ignore_nulls_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, schemas.Unset) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/test_post.py index 4c408162b7c..f3bb2f367cb 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostAdditionalpropertiesAllowsASchemaWhichShouldValidateResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostAdditionalpropertiesAllowsASchemaWhichShouldValidateResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_no_additional_properties_is_valid_passes(self): # no additional properties is valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -53,23 +51,23 @@ def test_no_additional_properties_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_an_additional_invalid_property_is_invalid_fails(self): # an additional invalid property is invalid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -91,16 +89,16 @@ def test_an_additional_invalid_property_is_invalid_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_an_additional_valid_property_is_valid_passes(self): # an additional valid property is valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -121,21 +119,18 @@ def test_an_additional_valid_property_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/test_post.py index 2a8383382a9..b1fe00a398a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostAdditionalpropertiesAreAllowedByDefaultResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostAdditionalpropertiesAreAllowedByDefaultResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_additional_properties_are_allowed_passes(self): # additional properties are allowed accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -57,21 +55,18 @@ def test_additional_properties_are_allowed_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postAdditionalpropertiesAreAllowedByDefaultResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postAdditionalpropertiesAreAllowedByDefaultResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/test_post.py index fa6be7937ed..7de73d46e71 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostAdditionalpropertiesCanExistByItselfResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostAdditionalpropertiesCanExistByItselfResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_an_additional_invalid_property_is_invalid_fails(self): # an additional invalid property is invalid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -54,16 +52,16 @@ def test_an_additional_invalid_property_is_invalid_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postAdditionalpropertiesCanExistByItselfResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postAdditionalpropertiesCanExistByItselfResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_an_additional_valid_property_is_valid_passes(self): # an additional valid property is valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -80,21 +78,18 @@ def test_an_additional_valid_property_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postAdditionalpropertiesCanExistByItselfResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postAdditionalpropertiesCanExistByItselfResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/test_post.py index 66faadd6a08..02444352fc8 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostAdditionalpropertiesShouldNotLookInApplicatorsResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostAdditionalpropertiesShouldNotLookInApplicatorsResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_properties_defined_in_allof_are_not_examined_fails(self): # properties defined in allOf are not examined accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -56,16 +54,16 @@ def test_properties_defined_in_allof_are_not_examined_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postAdditionalpropertiesShouldNotLookInApplicatorsResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postAdditionalpropertiesShouldNotLookInApplicatorsResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_valid_test_case_passes(self): # valid test case accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -84,21 +82,18 @@ def test_valid_test_case_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postAdditionalpropertiesShouldNotLookInApplicatorsResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postAdditionalpropertiesShouldNotLookInApplicatorsResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/test_post.py index 50707b5fb2b..78ba38affd9 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostAllofCombinedWithAnyofOneofResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostAllofCombinedWithAnyofOneofResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_allof_true_anyof_false_oneof_false_fails(self): # allOf: true, anyOf: false, oneOf: false accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 2 @@ -51,16 +49,16 @@ def test_allof_true_anyof_false_oneof_false_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postAllofCombinedWithAnyofOneofResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postAllofCombinedWithAnyofOneofResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_allof_false_anyof_false_oneof_true_fails(self): # allOf: false, anyOf: false, oneOf: true accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 5 @@ -75,16 +73,16 @@ def test_allof_false_anyof_false_oneof_true_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postAllofCombinedWithAnyofOneofResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postAllofCombinedWithAnyofOneofResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_allof_false_anyof_true_oneof_true_fails(self): # allOf: false, anyOf: true, oneOf: true accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 15 @@ -99,16 +97,16 @@ def test_allof_false_anyof_true_oneof_true_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postAllofCombinedWithAnyofOneofResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postAllofCombinedWithAnyofOneofResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_allof_true_anyof_true_oneof_false_fails(self): # allOf: true, anyOf: true, oneOf: false accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 6 @@ -123,16 +121,16 @@ def test_allof_true_anyof_true_oneof_false_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postAllofCombinedWithAnyofOneofResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postAllofCombinedWithAnyofOneofResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_allof_true_anyof_true_oneof_true_passes(self): # allOf: true, anyOf: true, oneOf: true accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 30 @@ -146,23 +144,23 @@ def test_allof_true_anyof_true_oneof_true_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postAllofCombinedWithAnyofOneofResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postAllofCombinedWithAnyofOneofResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_allof_true_anyof_false_oneof_true_fails(self): # allOf: true, anyOf: false, oneOf: true accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 10 @@ -177,16 +175,16 @@ def test_allof_true_anyof_false_oneof_true_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postAllofCombinedWithAnyofOneofResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postAllofCombinedWithAnyofOneofResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_allof_false_anyof_true_oneof_false_fails(self): # allOf: false, anyOf: true, oneOf: false accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 3 @@ -201,16 +199,16 @@ def test_allof_false_anyof_true_oneof_false_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postAllofCombinedWithAnyofOneofResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postAllofCombinedWithAnyofOneofResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_allof_false_anyof_false_oneof_false_fails(self): # allOf: false, anyOf: false, oneOf: false accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 1 @@ -225,14 +223,11 @@ def test_allof_false_anyof_false_oneof_false_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postAllofCombinedWithAnyofOneofResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postAllofCombinedWithAnyofOneofResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_response_body_for_content_types/test_post.py index dae63942115..cc6170da862 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_allof_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_allof_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostAllofResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostAllofResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_allof_passes(self): # allOf accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -55,23 +53,23 @@ def test_allof_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postAllofResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postAllofResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_mismatch_first_fails(self): # mismatch first accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -89,16 +87,16 @@ def test_mismatch_first_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postAllofResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postAllofResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_mismatch_second_fails(self): # mismatch second accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -116,16 +114,16 @@ def test_mismatch_second_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postAllofResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postAllofResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_wrong_type_fails(self): # wrong type accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -145,14 +143,11 @@ def test_wrong_type_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postAllofResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postAllofResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_simple_types_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_simple_types_response_body_for_content_types/test_post.py index 7713cf8e733..4254f960df1 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_simple_types_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_simple_types_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_allof_simple_types_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_allof_simple_types_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostAllofSimpleTypesResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostAllofSimpleTypesResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_valid_passes(self): # valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 25 @@ -50,23 +48,23 @@ def test_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postAllofSimpleTypesResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postAllofSimpleTypesResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_mismatch_one_fails(self): # mismatch one accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 35 @@ -81,14 +79,11 @@ def test_mismatch_one_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postAllofSimpleTypesResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postAllofSimpleTypesResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_base_schema_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_base_schema_response_body_for_content_types/test_post.py index 42142f307ea..f10247f1d5a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_base_schema_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_base_schema_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_allof_with_base_schema_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_allof_with_base_schema_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostAllofWithBaseSchemaResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostAllofWithBaseSchemaResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_valid_passes(self): # valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -57,23 +55,23 @@ def test_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postAllofWithBaseSchemaResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postAllofWithBaseSchemaResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_mismatch_first_allof_fails(self): # mismatch first allOf accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -93,16 +91,16 @@ def test_mismatch_first_allof_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postAllofWithBaseSchemaResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postAllofWithBaseSchemaResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_mismatch_base_schema_fails(self): # mismatch base schema accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -122,16 +120,16 @@ def test_mismatch_base_schema_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postAllofWithBaseSchemaResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postAllofWithBaseSchemaResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_mismatch_both_fails(self): # mismatch both accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -149,16 +147,16 @@ def test_mismatch_both_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postAllofWithBaseSchemaResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postAllofWithBaseSchemaResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_mismatch_second_allof_fails(self): # mismatch second allOf accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -178,14 +176,11 @@ def test_mismatch_second_allof_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postAllofWithBaseSchemaResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postAllofWithBaseSchemaResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_one_empty_schema_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_one_empty_schema_response_body_for_content_types/test_post.py index 68d704af400..941101100ed 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_one_empty_schema_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_one_empty_schema_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_allof_with_one_empty_schema_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_allof_with_one_empty_schema_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostAllofWithOneEmptySchemaResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostAllofWithOneEmptySchemaResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_any_data_is_valid_passes(self): # any data is valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 1 @@ -50,21 +48,18 @@ def test_any_data_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postAllofWithOneEmptySchemaResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postAllofWithOneEmptySchemaResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/test_post.py index 0d11bae4dbb..d6daaee9455 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostAllofWithTheFirstEmptySchemaResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostAllofWithTheFirstEmptySchemaResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_string_is_invalid_fails(self): # string is invalid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( "foo" @@ -51,16 +49,16 @@ def test_string_is_invalid_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postAllofWithTheFirstEmptySchemaResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postAllofWithTheFirstEmptySchemaResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_number_is_valid_passes(self): # number is valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 1 @@ -74,21 +72,18 @@ def test_number_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postAllofWithTheFirstEmptySchemaResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postAllofWithTheFirstEmptySchemaResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/test_post.py index 557fe4b7496..0c6d35e7ceb 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostAllofWithTheLastEmptySchemaResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostAllofWithTheLastEmptySchemaResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_string_is_invalid_fails(self): # string is invalid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( "foo" @@ -51,16 +49,16 @@ def test_string_is_invalid_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postAllofWithTheLastEmptySchemaResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postAllofWithTheLastEmptySchemaResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_number_is_valid_passes(self): # number is valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 1 @@ -74,21 +72,18 @@ def test_number_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postAllofWithTheLastEmptySchemaResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postAllofWithTheLastEmptySchemaResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/test_post.py index 3e280d443b0..8ffc6cf4931 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_allof_with_two_empty_schemas_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_allof_with_two_empty_schemas_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostAllofWithTwoEmptySchemasResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostAllofWithTwoEmptySchemasResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_any_data_is_valid_passes(self): # any data is valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 1 @@ -50,21 +48,18 @@ def test_any_data_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postAllofWithTwoEmptySchemasResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postAllofWithTwoEmptySchemasResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_anyof_complex_types_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_anyof_complex_types_response_body_for_content_types/test_post.py index 2a40c9b558f..5fdd984b4ac 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_anyof_complex_types_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_anyof_complex_types_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_anyof_complex_types_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_anyof_complex_types_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostAnyofComplexTypesResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostAnyofComplexTypesResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_second_anyof_valid_complex_passes(self): # second anyOf valid (complex) accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -53,23 +51,23 @@ def test_second_anyof_valid_complex_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postAnyofComplexTypesResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postAnyofComplexTypesResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_neither_anyof_valid_complex_fails(self): # neither anyOf valid (complex) accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -89,16 +87,16 @@ def test_neither_anyof_valid_complex_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postAnyofComplexTypesResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postAnyofComplexTypesResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_both_anyof_valid_complex_passes(self): # both anyOf valid (complex) accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -117,23 +115,23 @@ def test_both_anyof_valid_complex_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postAnyofComplexTypesResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postAnyofComplexTypesResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_first_anyof_valid_complex_passes(self): # first anyOf valid (complex) accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -150,21 +148,18 @@ def test_first_anyof_valid_complex_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postAnyofComplexTypesResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postAnyofComplexTypesResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_anyof_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_anyof_response_body_for_content_types/test_post.py index 7707cd74acf..ccea3c606b1 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_anyof_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_anyof_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_anyof_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_anyof_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostAnyofResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostAnyofResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_second_anyof_valid_passes(self): # second anyOf valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 2.5 @@ -50,23 +48,23 @@ def test_second_anyof_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postAnyofResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postAnyofResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_neither_anyof_valid_fails(self): # neither anyOf valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 1.5 @@ -81,16 +79,16 @@ def test_neither_anyof_valid_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postAnyofResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postAnyofResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_both_anyof_valid_passes(self): # both anyOf valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 3 @@ -104,23 +102,23 @@ def test_both_anyof_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postAnyofResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postAnyofResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_first_anyof_valid_passes(self): # first anyOf valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 1 @@ -134,21 +132,18 @@ def test_first_anyof_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postAnyofResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postAnyofResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_anyof_with_base_schema_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_anyof_with_base_schema_response_body_for_content_types/test_post.py index d8981bb737f..998430f148b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_anyof_with_base_schema_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_anyof_with_base_schema_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_anyof_with_base_schema_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_anyof_with_base_schema_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostAnyofWithBaseSchemaResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostAnyofWithBaseSchemaResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_one_anyof_valid_passes(self): # one anyOf valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( "foobar" @@ -50,23 +48,23 @@ def test_one_anyof_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postAnyofWithBaseSchemaResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postAnyofWithBaseSchemaResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_both_anyof_invalid_fails(self): # both anyOf invalid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( "foo" @@ -81,16 +79,16 @@ def test_both_anyof_invalid_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postAnyofWithBaseSchemaResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postAnyofWithBaseSchemaResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_mismatch_base_schema_fails(self): # mismatch base schema accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 3 @@ -105,14 +103,11 @@ def test_mismatch_base_schema_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postAnyofWithBaseSchemaResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postAnyofWithBaseSchemaResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/test_post.py index d8a37341e9b..11de507eeff 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_anyof_with_one_empty_schema_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_anyof_with_one_empty_schema_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostAnyofWithOneEmptySchemaResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostAnyofWithOneEmptySchemaResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_string_is_valid_passes(self): # string is valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( "foo" @@ -50,23 +48,23 @@ def test_string_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postAnyofWithOneEmptySchemaResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postAnyofWithOneEmptySchemaResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_number_is_valid_passes(self): # number is valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 123 @@ -80,21 +78,18 @@ def test_number_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postAnyofWithOneEmptySchemaResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postAnyofWithOneEmptySchemaResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_array_type_matches_arrays_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_array_type_matches_arrays_response_body_for_content_types/test_post.py index 717a6d1e2d9..c2e9a8e6ef4 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_array_type_matches_arrays_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_array_type_matches_arrays_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_array_type_matches_arrays_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_array_type_matches_arrays_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostArrayTypeMatchesArraysResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostArrayTypeMatchesArraysResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_a_float_is_not_an_array_fails(self): # a float is not an array accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 1.1 @@ -51,16 +49,16 @@ def test_a_float_is_not_an_array_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postArrayTypeMatchesArraysResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postArrayTypeMatchesArraysResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_a_boolean_is_not_an_array_fails(self): # a boolean is not an array accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( True @@ -75,16 +73,16 @@ def test_a_boolean_is_not_an_array_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postArrayTypeMatchesArraysResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postArrayTypeMatchesArraysResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_null_is_not_an_array_fails(self): # null is not an array accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( None @@ -99,16 +97,16 @@ def test_null_is_not_an_array_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postArrayTypeMatchesArraysResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postArrayTypeMatchesArraysResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_an_object_is_not_an_array_fails(self): # an object is not an array accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -124,16 +122,16 @@ def test_an_object_is_not_an_array_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postArrayTypeMatchesArraysResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postArrayTypeMatchesArraysResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_a_string_is_not_an_array_fails(self): # a string is not an array accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( "foo" @@ -148,16 +146,16 @@ def test_a_string_is_not_an_array_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postArrayTypeMatchesArraysResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postArrayTypeMatchesArraysResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_an_array_is_an_array_passes(self): # an array is an array accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -172,23 +170,23 @@ def test_an_array_is_an_array_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postArrayTypeMatchesArraysResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postArrayTypeMatchesArraysResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_an_integer_is_not_an_array_fails(self): # an integer is not an array accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 1 @@ -203,14 +201,11 @@ def test_an_integer_is_not_an_array_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postArrayTypeMatchesArraysResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postArrayTypeMatchesArraysResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_boolean_type_matches_booleans_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_boolean_type_matches_booleans_response_body_for_content_types/test_post.py index f4daf112ba0..ed32e44e7ec 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_boolean_type_matches_booleans_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_boolean_type_matches_booleans_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_boolean_type_matches_booleans_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_boolean_type_matches_booleans_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostBooleanTypeMatchesBooleansResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostBooleanTypeMatchesBooleansResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_an_empty_string_is_not_a_boolean_fails(self): # an empty string is not a boolean accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( "" @@ -51,16 +49,16 @@ def test_an_empty_string_is_not_a_boolean_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postBooleanTypeMatchesBooleansResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postBooleanTypeMatchesBooleansResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_a_float_is_not_a_boolean_fails(self): # a float is not a boolean accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 1.1 @@ -75,16 +73,16 @@ def test_a_float_is_not_a_boolean_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postBooleanTypeMatchesBooleansResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postBooleanTypeMatchesBooleansResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_null_is_not_a_boolean_fails(self): # null is not a boolean accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( None @@ -99,16 +97,16 @@ def test_null_is_not_a_boolean_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postBooleanTypeMatchesBooleansResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postBooleanTypeMatchesBooleansResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_zero_is_not_a_boolean_fails(self): # zero is not a boolean accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 0 @@ -123,16 +121,16 @@ def test_zero_is_not_a_boolean_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postBooleanTypeMatchesBooleansResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postBooleanTypeMatchesBooleansResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_an_array_is_not_a_boolean_fails(self): # an array is not a boolean accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -148,16 +146,16 @@ def test_an_array_is_not_a_boolean_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postBooleanTypeMatchesBooleansResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postBooleanTypeMatchesBooleansResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_a_string_is_not_a_boolean_fails(self): # a string is not a boolean accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( "foo" @@ -172,16 +170,16 @@ def test_a_string_is_not_a_boolean_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postBooleanTypeMatchesBooleansResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postBooleanTypeMatchesBooleansResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_false_is_a_boolean_passes(self): # false is a boolean accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( False @@ -195,23 +193,23 @@ def test_false_is_a_boolean_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postBooleanTypeMatchesBooleansResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postBooleanTypeMatchesBooleansResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_an_integer_is_not_a_boolean_fails(self): # an integer is not a boolean accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 1 @@ -226,16 +224,16 @@ def test_an_integer_is_not_a_boolean_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postBooleanTypeMatchesBooleansResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postBooleanTypeMatchesBooleansResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_true_is_a_boolean_passes(self): # true is a boolean accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( True @@ -249,23 +247,23 @@ def test_true_is_a_boolean_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postBooleanTypeMatchesBooleansResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postBooleanTypeMatchesBooleansResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_an_object_is_not_a_boolean_fails(self): # an object is not a boolean accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -281,14 +279,11 @@ def test_an_object_is_not_a_boolean_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postBooleanTypeMatchesBooleansResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postBooleanTypeMatchesBooleansResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_by_int_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_by_int_response_body_for_content_types/test_post.py index ccb4450d001..f327131eac8 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_by_int_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_by_int_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_by_int_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_by_int_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostByIntResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostByIntResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_int_by_int_fail_fails(self): # int by int fail accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 7 @@ -51,16 +49,16 @@ def test_int_by_int_fail_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postByIntResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postByIntResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_int_by_int_passes(self): # int by int accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 10 @@ -74,23 +72,23 @@ def test_int_by_int_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postByIntResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postByIntResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_ignores_non_numbers_passes(self): # ignores non-numbers accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( "foo" @@ -104,21 +102,18 @@ def test_ignores_non_numbers_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postByIntResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postByIntResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_by_number_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_by_number_response_body_for_content_types/test_post.py index 553452dd34d..643583a9b57 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_by_number_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_by_number_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_by_number_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_by_number_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostByNumberResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostByNumberResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_45_is_multiple_of15_passes(self): # 4.5 is multiple of 1.5 accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 4.5 @@ -50,23 +48,23 @@ def test_45_is_multiple_of15_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postByNumberResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postByNumberResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_35_is_not_multiple_of15_fails(self): # 35 is not multiple of 1.5 accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 35 @@ -81,16 +79,16 @@ def test_35_is_not_multiple_of15_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postByNumberResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postByNumberResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_zero_is_multiple_of_anything_passes(self): # zero is multiple of anything accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 0 @@ -104,21 +102,18 @@ def test_zero_is_multiple_of_anything_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postByNumberResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postByNumberResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_by_small_number_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_by_small_number_response_body_for_content_types/test_post.py index c8e0af97ede..ea2438319c9 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_by_small_number_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_by_small_number_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_by_small_number_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_by_small_number_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostBySmallNumberResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostBySmallNumberResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_000751_is_not_multiple_of00001_fails(self): # 0.00751 is not multiple of 0.0001 accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 0.00751 @@ -51,16 +49,16 @@ def test_000751_is_not_multiple_of00001_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postBySmallNumberResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postBySmallNumberResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_00075_is_multiple_of00001_passes(self): # 0.0075 is multiple of 0.0001 accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 0.0075 @@ -74,21 +72,18 @@ def test_00075_is_multiple_of00001_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postBySmallNumberResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postBySmallNumberResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_date_time_format_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_date_time_format_response_body_for_content_types/test_post.py index 813449ce9a1..adffb1eb530 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_date_time_format_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_date_time_format_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_date_time_format_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_date_time_format_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostDateTimeFormatResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostDateTimeFormatResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_all_string_formats_ignore_objects_passes(self): # all string formats ignore objects accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -51,23 +49,23 @@ def test_all_string_formats_ignore_objects_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postDateTimeFormatResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postDateTimeFormatResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_all_string_formats_ignore_booleans_passes(self): # all string formats ignore booleans accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( False @@ -81,23 +79,23 @@ def test_all_string_formats_ignore_booleans_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postDateTimeFormatResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postDateTimeFormatResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_all_string_formats_ignore_integers_passes(self): # all string formats ignore integers accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 12 @@ -111,23 +109,23 @@ def test_all_string_formats_ignore_integers_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postDateTimeFormatResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postDateTimeFormatResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_all_string_formats_ignore_floats_passes(self): # all string formats ignore floats accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 13.7 @@ -141,23 +139,23 @@ def test_all_string_formats_ignore_floats_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postDateTimeFormatResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postDateTimeFormatResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_all_string_formats_ignore_arrays_passes(self): # all string formats ignore arrays accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -172,23 +170,23 @@ def test_all_string_formats_ignore_arrays_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postDateTimeFormatResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postDateTimeFormatResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_all_string_formats_ignore_nulls_passes(self): # all string formats ignore nulls accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( None @@ -202,21 +200,18 @@ def test_all_string_formats_ignore_nulls_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postDateTimeFormatResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postDateTimeFormatResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_email_format_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_email_format_response_body_for_content_types/test_post.py index 0d82125e127..ed132edd91b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_email_format_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_email_format_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_email_format_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_email_format_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostEmailFormatResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostEmailFormatResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_all_string_formats_ignore_objects_passes(self): # all string formats ignore objects accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -51,23 +49,23 @@ def test_all_string_formats_ignore_objects_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postEmailFormatResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postEmailFormatResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_all_string_formats_ignore_booleans_passes(self): # all string formats ignore booleans accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( False @@ -81,23 +79,23 @@ def test_all_string_formats_ignore_booleans_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postEmailFormatResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postEmailFormatResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_all_string_formats_ignore_integers_passes(self): # all string formats ignore integers accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 12 @@ -111,23 +109,23 @@ def test_all_string_formats_ignore_integers_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postEmailFormatResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postEmailFormatResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_all_string_formats_ignore_floats_passes(self): # all string formats ignore floats accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 13.7 @@ -141,23 +139,23 @@ def test_all_string_formats_ignore_floats_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postEmailFormatResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postEmailFormatResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_all_string_formats_ignore_arrays_passes(self): # all string formats ignore arrays accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -172,23 +170,23 @@ def test_all_string_formats_ignore_arrays_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postEmailFormatResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postEmailFormatResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_all_string_formats_ignore_nulls_passes(self): # all string formats ignore nulls accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( None @@ -202,21 +200,18 @@ def test_all_string_formats_ignore_nulls_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postEmailFormatResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postEmailFormatResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/test_post.py index 35e22564157..54e1c102ad7 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_enum_with0_does_not_match_false_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_enum_with0_does_not_match_false_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostEnumWith0DoesNotMatchFalseResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostEnumWith0DoesNotMatchFalseResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_integer_zero_is_valid_passes(self): # integer zero is valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 0 @@ -50,23 +48,23 @@ def test_integer_zero_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postEnumWith0DoesNotMatchFalseResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postEnumWith0DoesNotMatchFalseResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_float_zero_is_valid_passes(self): # float zero is valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 0.0 @@ -80,23 +78,23 @@ def test_float_zero_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postEnumWith0DoesNotMatchFalseResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postEnumWith0DoesNotMatchFalseResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_false_is_invalid_fails(self): # false is invalid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( False @@ -111,14 +109,11 @@ def test_false_is_invalid_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postEnumWith0DoesNotMatchFalseResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postEnumWith0DoesNotMatchFalseResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/test_post.py index 3ddc9a784b8..642899522cb 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_enum_with1_does_not_match_true_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_enum_with1_does_not_match_true_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostEnumWith1DoesNotMatchTrueResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostEnumWith1DoesNotMatchTrueResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_true_is_invalid_fails(self): # true is invalid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( True @@ -51,16 +49,16 @@ def test_true_is_invalid_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postEnumWith1DoesNotMatchTrueResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postEnumWith1DoesNotMatchTrueResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_integer_one_is_valid_passes(self): # integer one is valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 1 @@ -74,23 +72,23 @@ def test_integer_one_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postEnumWith1DoesNotMatchTrueResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postEnumWith1DoesNotMatchTrueResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_float_one_is_valid_passes(self): # float one is valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 1.0 @@ -104,21 +102,18 @@ def test_float_one_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postEnumWith1DoesNotMatchTrueResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postEnumWith1DoesNotMatchTrueResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with_escaped_characters_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with_escaped_characters_response_body_for_content_types/test_post.py index a775da33fc4..4adf5660698 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with_escaped_characters_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with_escaped_characters_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_enum_with_escaped_characters_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_enum_with_escaped_characters_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostEnumWithEscapedCharactersResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostEnumWithEscapedCharactersResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_member2_is_valid_passes(self): # member 2 is valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( "foo\rbar" @@ -50,23 +48,23 @@ def test_member2_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postEnumWithEscapedCharactersResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postEnumWithEscapedCharactersResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_member1_is_valid_passes(self): # member 1 is valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( "foo\nbar" @@ -80,23 +78,23 @@ def test_member1_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postEnumWithEscapedCharactersResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postEnumWithEscapedCharactersResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_another_string_is_invalid_fails(self): # another string is invalid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( "abc" @@ -111,14 +109,11 @@ def test_another_string_is_invalid_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postEnumWithEscapedCharactersResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postEnumWithEscapedCharactersResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/test_post.py index 229b64beab5..2e6a3878b34 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_enum_with_false_does_not_match0_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_enum_with_false_does_not_match0_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostEnumWithFalseDoesNotMatch0ResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostEnumWithFalseDoesNotMatch0ResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_false_is_valid_passes(self): # false is valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( False @@ -50,23 +48,23 @@ def test_false_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postEnumWithFalseDoesNotMatch0ResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postEnumWithFalseDoesNotMatch0ResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_float_zero_is_invalid_fails(self): # float zero is invalid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 0.0 @@ -81,16 +79,16 @@ def test_float_zero_is_invalid_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postEnumWithFalseDoesNotMatch0ResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postEnumWithFalseDoesNotMatch0ResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_integer_zero_is_invalid_fails(self): # integer zero is invalid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 0 @@ -105,14 +103,11 @@ def test_integer_zero_is_invalid_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postEnumWithFalseDoesNotMatch0ResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postEnumWithFalseDoesNotMatch0ResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/test_post.py index abb8635973d..ed0b547790a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_enum_with_true_does_not_match1_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_enum_with_true_does_not_match1_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostEnumWithTrueDoesNotMatch1ResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostEnumWithTrueDoesNotMatch1ResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_float_one_is_invalid_fails(self): # float one is invalid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 1.0 @@ -51,16 +49,16 @@ def test_float_one_is_invalid_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postEnumWithTrueDoesNotMatch1ResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postEnumWithTrueDoesNotMatch1ResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_true_is_valid_passes(self): # true is valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( True @@ -74,23 +72,23 @@ def test_true_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postEnumWithTrueDoesNotMatch1ResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postEnumWithTrueDoesNotMatch1ResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_integer_one_is_invalid_fails(self): # integer one is invalid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 1 @@ -105,14 +103,11 @@ def test_integer_one_is_invalid_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postEnumWithTrueDoesNotMatch1ResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postEnumWithTrueDoesNotMatch1ResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enums_in_properties_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enums_in_properties_response_body_for_content_types/test_post.py index 59f2f9b9acb..2816bed34cc 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enums_in_properties_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enums_in_properties_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_enums_in_properties_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_enums_in_properties_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostEnumsInPropertiesResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostEnumsInPropertiesResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_missing_optional_property_is_valid_passes(self): # missing optional property is valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -53,23 +51,23 @@ def test_missing_optional_property_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postEnumsInPropertiesResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postEnumsInPropertiesResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_wrong_foo_value_fails(self): # wrong foo value accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -89,16 +87,16 @@ def test_wrong_foo_value_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postEnumsInPropertiesResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postEnumsInPropertiesResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_both_properties_are_valid_passes(self): # both properties are valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -117,23 +115,23 @@ def test_both_properties_are_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postEnumsInPropertiesResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postEnumsInPropertiesResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_wrong_bar_value_fails(self): # wrong bar value accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -153,16 +151,16 @@ def test_wrong_bar_value_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postEnumsInPropertiesResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postEnumsInPropertiesResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_missing_all_properties_is_invalid_fails(self): # missing all properties is invalid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -178,16 +176,16 @@ def test_missing_all_properties_is_invalid_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postEnumsInPropertiesResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postEnumsInPropertiesResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_missing_required_property_is_invalid_fails(self): # missing required property is invalid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -205,14 +203,11 @@ def test_missing_required_property_is_invalid_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postEnumsInPropertiesResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postEnumsInPropertiesResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_forbidden_property_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_forbidden_property_response_body_for_content_types/test_post.py index 5610f1bd7aa..7fa9d72465d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_forbidden_property_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_forbidden_property_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_forbidden_property_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_forbidden_property_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostForbiddenPropertyResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostForbiddenPropertyResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_property_present_fails(self): # property present accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -56,16 +54,16 @@ def test_property_present_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postForbiddenPropertyResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postForbiddenPropertyResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_property_absent_passes(self): # property absent accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -84,21 +82,18 @@ def test_property_absent_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postForbiddenPropertyResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postForbiddenPropertyResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_hostname_format_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_hostname_format_response_body_for_content_types/test_post.py index ac74108dd33..6c11a617489 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_hostname_format_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_hostname_format_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_hostname_format_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_hostname_format_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostHostnameFormatResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostHostnameFormatResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_all_string_formats_ignore_objects_passes(self): # all string formats ignore objects accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -51,23 +49,23 @@ def test_all_string_formats_ignore_objects_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postHostnameFormatResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postHostnameFormatResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_all_string_formats_ignore_booleans_passes(self): # all string formats ignore booleans accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( False @@ -81,23 +79,23 @@ def test_all_string_formats_ignore_booleans_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postHostnameFormatResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postHostnameFormatResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_all_string_formats_ignore_integers_passes(self): # all string formats ignore integers accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 12 @@ -111,23 +109,23 @@ def test_all_string_formats_ignore_integers_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postHostnameFormatResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postHostnameFormatResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_all_string_formats_ignore_floats_passes(self): # all string formats ignore floats accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 13.7 @@ -141,23 +139,23 @@ def test_all_string_formats_ignore_floats_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postHostnameFormatResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postHostnameFormatResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_all_string_formats_ignore_arrays_passes(self): # all string formats ignore arrays accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -172,23 +170,23 @@ def test_all_string_formats_ignore_arrays_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postHostnameFormatResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postHostnameFormatResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_all_string_formats_ignore_nulls_passes(self): # all string formats ignore nulls accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( None @@ -202,21 +200,18 @@ def test_all_string_formats_ignore_nulls_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postHostnameFormatResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postHostnameFormatResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_integer_type_matches_integers_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_integer_type_matches_integers_response_body_for_content_types/test_post.py index c772cd05dc4..8b46fa7bc8a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_integer_type_matches_integers_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_integer_type_matches_integers_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_integer_type_matches_integers_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_integer_type_matches_integers_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostIntegerTypeMatchesIntegersResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostIntegerTypeMatchesIntegersResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_an_object_is_not_an_integer_fails(self): # an object is not an integer accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -52,16 +50,16 @@ def test_an_object_is_not_an_integer_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postIntegerTypeMatchesIntegersResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postIntegerTypeMatchesIntegersResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_a_string_is_not_an_integer_fails(self): # a string is not an integer accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( "foo" @@ -76,16 +74,16 @@ def test_a_string_is_not_an_integer_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postIntegerTypeMatchesIntegersResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postIntegerTypeMatchesIntegersResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_null_is_not_an_integer_fails(self): # null is not an integer accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( None @@ -100,16 +98,16 @@ def test_null_is_not_an_integer_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postIntegerTypeMatchesIntegersResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postIntegerTypeMatchesIntegersResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_a_float_with_zero_fractional_part_is_an_integer_passes(self): # a float with zero fractional part is an integer accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 1.0 @@ -123,23 +121,23 @@ def test_a_float_with_zero_fractional_part_is_an_integer_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postIntegerTypeMatchesIntegersResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postIntegerTypeMatchesIntegersResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_a_float_is_not_an_integer_fails(self): # a float is not an integer accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 1.1 @@ -154,16 +152,16 @@ def test_a_float_is_not_an_integer_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postIntegerTypeMatchesIntegersResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postIntegerTypeMatchesIntegersResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_a_boolean_is_not_an_integer_fails(self): # a boolean is not an integer accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( True @@ -178,16 +176,16 @@ def test_a_boolean_is_not_an_integer_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postIntegerTypeMatchesIntegersResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postIntegerTypeMatchesIntegersResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_an_integer_is_an_integer_passes(self): # an integer is an integer accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 1 @@ -201,23 +199,23 @@ def test_an_integer_is_an_integer_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postIntegerTypeMatchesIntegersResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postIntegerTypeMatchesIntegersResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_a_string_is_still_not_an_integer_even_if_it_looks_like_one_fails(self): # a string is still not an integer, even if it looks like one accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( "1" @@ -232,16 +230,16 @@ def test_a_string_is_still_not_an_integer_even_if_it_looks_like_one_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postIntegerTypeMatchesIntegersResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postIntegerTypeMatchesIntegersResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_an_array_is_not_an_integer_fails(self): # an array is not an integer accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -257,14 +255,11 @@ def test_an_array_is_not_an_integer_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postIntegerTypeMatchesIntegersResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postIntegerTypeMatchesIntegersResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/test_post.py index a198deb37b7..9557fed5897 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_always_invalid_but_naive_implementations_may_raise_an_overflow_error_fails(self): # always invalid, but naive implementations may raise an overflow error accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 1.0E308 @@ -51,16 +49,16 @@ def test_always_invalid_but_naive_implementations_may_raise_an_overflow_error_fa ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_valid_integer_with_multipleof_float_passes(self): # valid integer with multipleOf float accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 123456789 @@ -74,21 +72,18 @@ def test_valid_integer_with_multipleof_float_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_invalid_string_value_for_default_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_invalid_string_value_for_default_response_body_for_content_types/test_post.py index 3cd375f9db4..8b3b7d7f5ab 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_invalid_string_value_for_default_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_invalid_string_value_for_default_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_invalid_string_value_for_default_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_invalid_string_value_for_default_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostInvalidStringValueForDefaultResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostInvalidStringValueForDefaultResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_valid_when_property_is_specified_passes(self): # valid when property is specified accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -53,23 +51,23 @@ def test_valid_when_property_is_specified_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postInvalidStringValueForDefaultResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postInvalidStringValueForDefaultResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_still_valid_when_the_invalid_default_is_used_passes(self): # still valid when the invalid default is used accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -84,21 +82,18 @@ def test_still_valid_when_the_invalid_default_is_used_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postInvalidStringValueForDefaultResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postInvalidStringValueForDefaultResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ipv4_format_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ipv4_format_response_body_for_content_types/test_post.py index 4804e8e5a12..3edfea896ac 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ipv4_format_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ipv4_format_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_ipv4_format_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_ipv4_format_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostIpv4FormatResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostIpv4FormatResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_all_string_formats_ignore_objects_passes(self): # all string formats ignore objects accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -51,23 +49,23 @@ def test_all_string_formats_ignore_objects_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postIpv4FormatResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postIpv4FormatResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_all_string_formats_ignore_booleans_passes(self): # all string formats ignore booleans accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( False @@ -81,23 +79,23 @@ def test_all_string_formats_ignore_booleans_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postIpv4FormatResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postIpv4FormatResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_all_string_formats_ignore_integers_passes(self): # all string formats ignore integers accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 12 @@ -111,23 +109,23 @@ def test_all_string_formats_ignore_integers_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postIpv4FormatResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postIpv4FormatResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_all_string_formats_ignore_floats_passes(self): # all string formats ignore floats accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 13.7 @@ -141,23 +139,23 @@ def test_all_string_formats_ignore_floats_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postIpv4FormatResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postIpv4FormatResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_all_string_formats_ignore_arrays_passes(self): # all string formats ignore arrays accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -172,23 +170,23 @@ def test_all_string_formats_ignore_arrays_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postIpv4FormatResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postIpv4FormatResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_all_string_formats_ignore_nulls_passes(self): # all string formats ignore nulls accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( None @@ -202,21 +200,18 @@ def test_all_string_formats_ignore_nulls_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postIpv4FormatResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postIpv4FormatResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ipv6_format_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ipv6_format_response_body_for_content_types/test_post.py index b63faab6c47..50fdbaf381e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ipv6_format_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ipv6_format_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_ipv6_format_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_ipv6_format_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostIpv6FormatResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostIpv6FormatResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_all_string_formats_ignore_objects_passes(self): # all string formats ignore objects accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -51,23 +49,23 @@ def test_all_string_formats_ignore_objects_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postIpv6FormatResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postIpv6FormatResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_all_string_formats_ignore_booleans_passes(self): # all string formats ignore booleans accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( False @@ -81,23 +79,23 @@ def test_all_string_formats_ignore_booleans_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postIpv6FormatResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postIpv6FormatResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_all_string_formats_ignore_integers_passes(self): # all string formats ignore integers accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 12 @@ -111,23 +109,23 @@ def test_all_string_formats_ignore_integers_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postIpv6FormatResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postIpv6FormatResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_all_string_formats_ignore_floats_passes(self): # all string formats ignore floats accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 13.7 @@ -141,23 +139,23 @@ def test_all_string_formats_ignore_floats_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postIpv6FormatResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postIpv6FormatResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_all_string_formats_ignore_arrays_passes(self): # all string formats ignore arrays accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -172,23 +170,23 @@ def test_all_string_formats_ignore_arrays_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postIpv6FormatResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postIpv6FormatResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_all_string_formats_ignore_nulls_passes(self): # all string formats ignore nulls accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( None @@ -202,21 +200,18 @@ def test_all_string_formats_ignore_nulls_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postIpv6FormatResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postIpv6FormatResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_json_pointer_format_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_json_pointer_format_response_body_for_content_types/test_post.py index 49e2e9df945..c576c1aacd8 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_json_pointer_format_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_json_pointer_format_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_json_pointer_format_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_json_pointer_format_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostJsonPointerFormatResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostJsonPointerFormatResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_all_string_formats_ignore_objects_passes(self): # all string formats ignore objects accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -51,23 +49,23 @@ def test_all_string_formats_ignore_objects_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postJsonPointerFormatResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postJsonPointerFormatResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_all_string_formats_ignore_booleans_passes(self): # all string formats ignore booleans accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( False @@ -81,23 +79,23 @@ def test_all_string_formats_ignore_booleans_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postJsonPointerFormatResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postJsonPointerFormatResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_all_string_formats_ignore_integers_passes(self): # all string formats ignore integers accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 12 @@ -111,23 +109,23 @@ def test_all_string_formats_ignore_integers_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postJsonPointerFormatResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postJsonPointerFormatResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_all_string_formats_ignore_floats_passes(self): # all string formats ignore floats accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 13.7 @@ -141,23 +139,23 @@ def test_all_string_formats_ignore_floats_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postJsonPointerFormatResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postJsonPointerFormatResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_all_string_formats_ignore_arrays_passes(self): # all string formats ignore arrays accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -172,23 +170,23 @@ def test_all_string_formats_ignore_arrays_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postJsonPointerFormatResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postJsonPointerFormatResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_all_string_formats_ignore_nulls_passes(self): # all string formats ignore nulls accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( None @@ -202,21 +200,18 @@ def test_all_string_formats_ignore_nulls_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postJsonPointerFormatResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postJsonPointerFormatResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maximum_validation_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maximum_validation_response_body_for_content_types/test_post.py index 42ccfe7cb15..82bc89cbdcd 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maximum_validation_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maximum_validation_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_maximum_validation_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_maximum_validation_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostMaximumValidationResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostMaximumValidationResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_below_the_maximum_is_valid_passes(self): # below the maximum is valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 2.6 @@ -50,23 +48,23 @@ def test_below_the_maximum_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postMaximumValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postMaximumValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_boundary_point_is_valid_passes(self): # boundary point is valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 3.0 @@ -80,23 +78,23 @@ def test_boundary_point_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postMaximumValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postMaximumValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_above_the_maximum_is_invalid_fails(self): # above the maximum is invalid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 3.5 @@ -111,16 +109,16 @@ def test_above_the_maximum_is_invalid_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postMaximumValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postMaximumValidationResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_ignores_non_numbers_passes(self): # ignores non-numbers accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( "x" @@ -134,21 +132,18 @@ def test_ignores_non_numbers_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postMaximumValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postMaximumValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/test_post.py index 725ca59dd94..8cf94c7364f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostMaximumValidationWithUnsignedIntegerResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostMaximumValidationWithUnsignedIntegerResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_below_the_maximum_is_invalid_passes(self): # below the maximum is invalid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 299.97 @@ -50,23 +48,23 @@ def test_below_the_maximum_is_invalid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postMaximumValidationWithUnsignedIntegerResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postMaximumValidationWithUnsignedIntegerResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_above_the_maximum_is_invalid_fails(self): # above the maximum is invalid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 300.5 @@ -81,16 +79,16 @@ def test_above_the_maximum_is_invalid_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postMaximumValidationWithUnsignedIntegerResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postMaximumValidationWithUnsignedIntegerResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_boundary_point_integer_is_valid_passes(self): # boundary point integer is valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 300 @@ -104,23 +102,23 @@ def test_boundary_point_integer_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postMaximumValidationWithUnsignedIntegerResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postMaximumValidationWithUnsignedIntegerResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_boundary_point_float_is_valid_passes(self): # boundary point float is valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 300.0 @@ -134,21 +132,18 @@ def test_boundary_point_float_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postMaximumValidationWithUnsignedIntegerResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postMaximumValidationWithUnsignedIntegerResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maxitems_validation_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maxitems_validation_response_body_for_content_types/test_post.py index d297f38843b..1b453dfe07c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maxitems_validation_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maxitems_validation_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_maxitems_validation_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_maxitems_validation_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostMaxitemsValidationResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostMaxitemsValidationResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_too_long_is_invalid_fails(self): # too long is invalid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -55,16 +53,16 @@ def test_too_long_is_invalid_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postMaxitemsValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postMaxitemsValidationResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_ignores_non_arrays_passes(self): # ignores non-arrays accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( "foobar" @@ -78,23 +76,23 @@ def test_ignores_non_arrays_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postMaxitemsValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postMaxitemsValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_shorter_is_valid_passes(self): # shorter is valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -110,23 +108,23 @@ def test_shorter_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postMaxitemsValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postMaxitemsValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_exact_length_is_valid_passes(self): # exact length is valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -143,21 +141,18 @@ def test_exact_length_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postMaxitemsValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postMaxitemsValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maxlength_validation_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maxlength_validation_response_body_for_content_types/test_post.py index 7f5622b34b5..09056d486bd 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maxlength_validation_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maxlength_validation_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_maxlength_validation_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_maxlength_validation_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostMaxlengthValidationResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostMaxlengthValidationResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_too_long_is_invalid_fails(self): # too long is invalid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( "foo" @@ -51,16 +49,16 @@ def test_too_long_is_invalid_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postMaxlengthValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postMaxlengthValidationResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_ignores_non_strings_passes(self): # ignores non-strings accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 100 @@ -74,23 +72,23 @@ def test_ignores_non_strings_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postMaxlengthValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postMaxlengthValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_shorter_is_valid_passes(self): # shorter is valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( "f" @@ -104,23 +102,23 @@ def test_shorter_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postMaxlengthValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postMaxlengthValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_two_supplementary_unicode_code_points_is_long_enough_passes(self): # two supplementary Unicode code points is long enough accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( "💩💩" @@ -134,23 +132,23 @@ def test_two_supplementary_unicode_code_points_is_long_enough_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postMaxlengthValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postMaxlengthValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_exact_length_is_valid_passes(self): # exact length is valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( "fo" @@ -164,21 +162,18 @@ def test_exact_length_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postMaxlengthValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postMaxlengthValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/test_post.py index 58145de0411..a7d00e17dac 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostMaxproperties0MeansTheObjectIsEmptyResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostMaxproperties0MeansTheObjectIsEmptyResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_no_properties_is_valid_passes(self): # no properties is valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -51,23 +49,23 @@ def test_no_properties_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postMaxproperties0MeansTheObjectIsEmptyResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postMaxproperties0MeansTheObjectIsEmptyResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_one_property_is_invalid_fails(self): # one property is invalid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -85,14 +83,11 @@ def test_one_property_is_invalid_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postMaxproperties0MeansTheObjectIsEmptyResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postMaxproperties0MeansTheObjectIsEmptyResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maxproperties_validation_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maxproperties_validation_response_body_for_content_types/test_post.py index 28a24d6e03f..03cdfb61f1c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maxproperties_validation_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maxproperties_validation_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_maxproperties_validation_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_maxproperties_validation_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostMaxpropertiesValidationResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostMaxpropertiesValidationResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_too_long_is_invalid_fails(self): # too long is invalid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -58,16 +56,16 @@ def test_too_long_is_invalid_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postMaxpropertiesValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postMaxpropertiesValidationResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_ignores_arrays_passes(self): # ignores arrays accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -85,23 +83,23 @@ def test_ignores_arrays_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postMaxpropertiesValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postMaxpropertiesValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_ignores_other_non_objects_passes(self): # ignores other non-objects accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 12 @@ -115,23 +113,23 @@ def test_ignores_other_non_objects_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postMaxpropertiesValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postMaxpropertiesValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_ignores_strings_passes(self): # ignores strings accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( "foobar" @@ -145,23 +143,23 @@ def test_ignores_strings_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postMaxpropertiesValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postMaxpropertiesValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_shorter_is_valid_passes(self): # shorter is valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -178,23 +176,23 @@ def test_shorter_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postMaxpropertiesValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postMaxpropertiesValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_exact_length_is_valid_passes(self): # exact length is valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -213,21 +211,18 @@ def test_exact_length_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postMaxpropertiesValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postMaxpropertiesValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minimum_validation_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minimum_validation_response_body_for_content_types/test_post.py index ca262ddbde2..b223888044a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minimum_validation_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minimum_validation_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_minimum_validation_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_minimum_validation_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostMinimumValidationResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostMinimumValidationResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_boundary_point_is_valid_passes(self): # boundary point is valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 1.1 @@ -50,23 +48,23 @@ def test_boundary_point_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postMinimumValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postMinimumValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_below_the_minimum_is_invalid_fails(self): # below the minimum is invalid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 0.6 @@ -81,16 +79,16 @@ def test_below_the_minimum_is_invalid_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postMinimumValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postMinimumValidationResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_above_the_minimum_is_valid_passes(self): # above the minimum is valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 2.6 @@ -104,23 +102,23 @@ def test_above_the_minimum_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postMinimumValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postMinimumValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_ignores_non_numbers_passes(self): # ignores non-numbers accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( "x" @@ -134,21 +132,18 @@ def test_ignores_non_numbers_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postMinimumValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postMinimumValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/test_post.py index d5842cf8a47..018d13884d0 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostMinimumValidationWithSignedIntegerResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostMinimumValidationWithSignedIntegerResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_boundary_point_is_valid_passes(self): # boundary point is valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( -2 @@ -50,23 +48,23 @@ def test_boundary_point_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postMinimumValidationWithSignedIntegerResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postMinimumValidationWithSignedIntegerResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_positive_above_the_minimum_is_valid_passes(self): # positive above the minimum is valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 0 @@ -80,23 +78,23 @@ def test_positive_above_the_minimum_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postMinimumValidationWithSignedIntegerResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postMinimumValidationWithSignedIntegerResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_int_below_the_minimum_is_invalid_fails(self): # int below the minimum is invalid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( -3 @@ -111,16 +109,16 @@ def test_int_below_the_minimum_is_invalid_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postMinimumValidationWithSignedIntegerResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postMinimumValidationWithSignedIntegerResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_float_below_the_minimum_is_invalid_fails(self): # float below the minimum is invalid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( -2.0001 @@ -135,16 +133,16 @@ def test_float_below_the_minimum_is_invalid_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postMinimumValidationWithSignedIntegerResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postMinimumValidationWithSignedIntegerResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_boundary_point_with_float_is_valid_passes(self): # boundary point with float is valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( -2.0 @@ -158,23 +156,23 @@ def test_boundary_point_with_float_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postMinimumValidationWithSignedIntegerResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postMinimumValidationWithSignedIntegerResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_negative_above_the_minimum_is_valid_passes(self): # negative above the minimum is valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( -1 @@ -188,23 +186,23 @@ def test_negative_above_the_minimum_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postMinimumValidationWithSignedIntegerResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postMinimumValidationWithSignedIntegerResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_ignores_non_numbers_passes(self): # ignores non-numbers accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( "x" @@ -218,21 +216,18 @@ def test_ignores_non_numbers_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postMinimumValidationWithSignedIntegerResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postMinimumValidationWithSignedIntegerResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minitems_validation_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minitems_validation_response_body_for_content_types/test_post.py index 4450462f998..4b1eda14a83 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minitems_validation_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minitems_validation_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_minitems_validation_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_minitems_validation_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostMinitemsValidationResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostMinitemsValidationResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_too_short_is_invalid_fails(self): # too short is invalid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -52,16 +50,16 @@ def test_too_short_is_invalid_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postMinitemsValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postMinitemsValidationResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_ignores_non_arrays_passes(self): # ignores non-arrays accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( "" @@ -75,23 +73,23 @@ def test_ignores_non_arrays_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postMinitemsValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postMinitemsValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_longer_is_valid_passes(self): # longer is valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -108,23 +106,23 @@ def test_longer_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postMinitemsValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postMinitemsValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_exact_length_is_valid_passes(self): # exact length is valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -140,21 +138,18 @@ def test_exact_length_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postMinitemsValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postMinitemsValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minlength_validation_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minlength_validation_response_body_for_content_types/test_post.py index 247a17756b0..09d4967f9dc 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minlength_validation_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minlength_validation_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_minlength_validation_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_minlength_validation_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostMinlengthValidationResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostMinlengthValidationResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_too_short_is_invalid_fails(self): # too short is invalid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( "f" @@ -51,16 +49,16 @@ def test_too_short_is_invalid_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postMinlengthValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postMinlengthValidationResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_one_supplementary_unicode_code_point_is_not_long_enough_fails(self): # one supplementary Unicode code point is not long enough accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( "💩" @@ -75,16 +73,16 @@ def test_one_supplementary_unicode_code_point_is_not_long_enough_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postMinlengthValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postMinlengthValidationResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_longer_is_valid_passes(self): # longer is valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( "foo" @@ -98,23 +96,23 @@ def test_longer_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postMinlengthValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postMinlengthValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_ignores_non_strings_passes(self): # ignores non-strings accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 1 @@ -128,23 +126,23 @@ def test_ignores_non_strings_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postMinlengthValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postMinlengthValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_exact_length_is_valid_passes(self): # exact length is valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( "fo" @@ -158,21 +156,18 @@ def test_exact_length_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postMinlengthValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postMinlengthValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minproperties_validation_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minproperties_validation_response_body_for_content_types/test_post.py index 2f3aadb3583..e8d85ae17e3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minproperties_validation_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minproperties_validation_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_minproperties_validation_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_minproperties_validation_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostMinpropertiesValidationResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostMinpropertiesValidationResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_ignores_arrays_passes(self): # ignores arrays accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -51,23 +49,23 @@ def test_ignores_arrays_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postMinpropertiesValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postMinpropertiesValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_ignores_other_non_objects_passes(self): # ignores other non-objects accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 12 @@ -81,23 +79,23 @@ def test_ignores_other_non_objects_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postMinpropertiesValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postMinpropertiesValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_too_short_is_invalid_fails(self): # too short is invalid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -113,16 +111,16 @@ def test_too_short_is_invalid_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postMinpropertiesValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postMinpropertiesValidationResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_ignores_strings_passes(self): # ignores strings accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( "" @@ -136,23 +134,23 @@ def test_ignores_strings_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postMinpropertiesValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postMinpropertiesValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_longer_is_valid_passes(self): # longer is valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -171,23 +169,23 @@ def test_longer_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postMinpropertiesValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postMinpropertiesValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_exact_length_is_valid_passes(self): # exact length is valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -204,21 +202,18 @@ def test_exact_length_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postMinpropertiesValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postMinpropertiesValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/test_post.py index 9d8f8fbf930..254e04bcebb 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostNestedAllofToCheckValidationSemanticsResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostNestedAllofToCheckValidationSemanticsResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_anything_non_null_is_invalid_fails(self): # anything non-null is invalid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 123 @@ -51,16 +49,16 @@ def test_anything_non_null_is_invalid_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postNestedAllofToCheckValidationSemanticsResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postNestedAllofToCheckValidationSemanticsResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_null_is_valid_passes(self): # null is valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( None @@ -74,21 +72,18 @@ def test_null_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postNestedAllofToCheckValidationSemanticsResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postNestedAllofToCheckValidationSemanticsResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/test_post.py index 8fc358252fb..137ad32413a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostNestedAnyofToCheckValidationSemanticsResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostNestedAnyofToCheckValidationSemanticsResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_anything_non_null_is_invalid_fails(self): # anything non-null is invalid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 123 @@ -51,16 +49,16 @@ def test_anything_non_null_is_invalid_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postNestedAnyofToCheckValidationSemanticsResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postNestedAnyofToCheckValidationSemanticsResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_null_is_valid_passes(self): # null is valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( None @@ -74,21 +72,18 @@ def test_null_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postNestedAnyofToCheckValidationSemanticsResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postNestedAnyofToCheckValidationSemanticsResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nested_items_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nested_items_response_body_for_content_types/test_post.py index ffb0092cb84..b8f7782ee69 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nested_items_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nested_items_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_nested_items_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_nested_items_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostNestedItemsResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostNestedItemsResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_valid_nested_array_passes(self): # valid nested array accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -79,23 +77,23 @@ def test_valid_nested_array_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postNestedItemsResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postNestedItemsResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_nested_array_with_invalid_type_fails(self): # nested array with invalid type accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -139,16 +137,16 @@ def test_nested_array_with_invalid_type_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postNestedItemsResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postNestedItemsResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_not_deep_enough_fails(self): # not deep enough accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -186,14 +184,11 @@ def test_not_deep_enough_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postNestedItemsResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postNestedItemsResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/test_post.py index 188ce661ff1..cd2bb19a0af 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostNestedOneofToCheckValidationSemanticsResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostNestedOneofToCheckValidationSemanticsResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_anything_non_null_is_invalid_fails(self): # anything non-null is invalid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 123 @@ -51,16 +49,16 @@ def test_anything_non_null_is_invalid_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postNestedOneofToCheckValidationSemanticsResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postNestedOneofToCheckValidationSemanticsResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_null_is_valid_passes(self): # null is valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( None @@ -74,21 +72,18 @@ def test_null_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postNestedOneofToCheckValidationSemanticsResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postNestedOneofToCheckValidationSemanticsResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_not_more_complex_schema_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_not_more_complex_schema_response_body_for_content_types/test_post.py index 4b615daed14..6c69448f3d6 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_not_more_complex_schema_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_not_more_complex_schema_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_not_more_complex_schema_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_not_more_complex_schema_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostNotMoreComplexSchemaResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostNotMoreComplexSchemaResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_other_match_passes(self): # other match accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -53,23 +51,23 @@ def test_other_match_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postNotMoreComplexSchemaResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postNotMoreComplexSchemaResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_mismatch_fails(self): # mismatch accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -87,16 +85,16 @@ def test_mismatch_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postNotMoreComplexSchemaResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postNotMoreComplexSchemaResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_match_passes(self): # match accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 1 @@ -110,21 +108,18 @@ def test_match_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postNotMoreComplexSchemaResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postNotMoreComplexSchemaResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_not_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_not_response_body_for_content_types/test_post.py index 4b505c1b4dd..d0a80c40d36 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_not_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_not_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_not_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_not_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostNotResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostNotResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_allowed_passes(self): # allowed accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( "foo" @@ -50,23 +48,23 @@ def test_allowed_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postNotResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postNotResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_disallowed_fails(self): # disallowed accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 1 @@ -81,14 +79,11 @@ def test_disallowed_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postNotResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postNotResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nul_characters_in_strings_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nul_characters_in_strings_response_body_for_content_types/test_post.py index b0ce13a519c..d87bf06c4ac 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nul_characters_in_strings_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nul_characters_in_strings_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_nul_characters_in_strings_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_nul_characters_in_strings_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostNulCharactersInStringsResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostNulCharactersInStringsResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_match_string_with_nul_passes(self): # match string with nul accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( "hello\x00there" @@ -50,23 +48,23 @@ def test_match_string_with_nul_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postNulCharactersInStringsResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postNulCharactersInStringsResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_do_not_match_string_lacking_nul_fails(self): # do not match string lacking nul accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( "hellothere" @@ -81,14 +79,11 @@ def test_do_not_match_string_lacking_nul_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postNulCharactersInStringsResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postNulCharactersInStringsResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/test_post.py index 39685609338..0d16cc4b795 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_a_float_is_not_null_fails(self): # a float is not null accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 1.1 @@ -51,16 +49,16 @@ def test_a_float_is_not_null_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_an_object_is_not_null_fails(self): # an object is not null accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -76,16 +74,16 @@ def test_an_object_is_not_null_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_false_is_not_null_fails(self): # false is not null accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( False @@ -100,16 +98,16 @@ def test_false_is_not_null_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_an_integer_is_not_null_fails(self): # an integer is not null accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 1 @@ -124,16 +122,16 @@ def test_an_integer_is_not_null_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_true_is_not_null_fails(self): # true is not null accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( True @@ -148,16 +146,16 @@ def test_true_is_not_null_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_zero_is_not_null_fails(self): # zero is not null accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 0 @@ -172,16 +170,16 @@ def test_zero_is_not_null_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_an_empty_string_is_not_null_fails(self): # an empty string is not null accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( "" @@ -196,16 +194,16 @@ def test_an_empty_string_is_not_null_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_null_is_null_passes(self): # null is null accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( None @@ -219,23 +217,23 @@ def test_null_is_null_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_an_array_is_not_null_fails(self): # an array is not null accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -251,16 +249,16 @@ def test_an_array_is_not_null_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_a_string_is_not_null_fails(self): # a string is not null accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( "foo" @@ -275,14 +273,11 @@ def test_a_string_is_not_null_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_number_type_matches_numbers_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_number_type_matches_numbers_response_body_for_content_types/test_post.py index aa54a7620bc..2d595ec07c0 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_number_type_matches_numbers_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_number_type_matches_numbers_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_number_type_matches_numbers_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_number_type_matches_numbers_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostNumberTypeMatchesNumbersResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostNumberTypeMatchesNumbersResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_an_array_is_not_a_number_fails(self): # an array is not a number accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -52,16 +50,16 @@ def test_an_array_is_not_a_number_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postNumberTypeMatchesNumbersResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postNumberTypeMatchesNumbersResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_null_is_not_a_number_fails(self): # null is not a number accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( None @@ -76,16 +74,16 @@ def test_null_is_not_a_number_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postNumberTypeMatchesNumbersResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postNumberTypeMatchesNumbersResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_an_object_is_not_a_number_fails(self): # an object is not a number accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -101,16 +99,16 @@ def test_an_object_is_not_a_number_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postNumberTypeMatchesNumbersResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postNumberTypeMatchesNumbersResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_a_boolean_is_not_a_number_fails(self): # a boolean is not a number accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( True @@ -125,16 +123,16 @@ def test_a_boolean_is_not_a_number_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postNumberTypeMatchesNumbersResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postNumberTypeMatchesNumbersResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_a_float_is_a_number_passes(self): # a float is a number accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 1.1 @@ -148,23 +146,23 @@ def test_a_float_is_a_number_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postNumberTypeMatchesNumbersResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postNumberTypeMatchesNumbersResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_a_string_is_still_not_a_number_even_if_it_looks_like_one_fails(self): # a string is still not a number, even if it looks like one accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( "1" @@ -179,16 +177,16 @@ def test_a_string_is_still_not_a_number_even_if_it_looks_like_one_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postNumberTypeMatchesNumbersResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postNumberTypeMatchesNumbersResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_a_string_is_not_a_number_fails(self): # a string is not a number accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( "foo" @@ -203,16 +201,16 @@ def test_a_string_is_not_a_number_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postNumberTypeMatchesNumbersResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postNumberTypeMatchesNumbersResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_an_integer_is_a_number_passes(self): # an integer is a number accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 1 @@ -226,23 +224,23 @@ def test_an_integer_is_a_number_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postNumberTypeMatchesNumbersResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postNumberTypeMatchesNumbersResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_a_float_with_zero_fractional_part_is_a_number_and_an_integer_passes(self): # a float with zero fractional part is a number (and an integer) accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 1.0 @@ -256,21 +254,18 @@ def test_a_float_with_zero_fractional_part_is_a_number_and_an_integer_passes(sel ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postNumberTypeMatchesNumbersResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postNumberTypeMatchesNumbersResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_object_properties_validation_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_object_properties_validation_response_body_for_content_types/test_post.py index 28b78c68162..afdaf360647 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_object_properties_validation_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_object_properties_validation_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_object_properties_validation_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_object_properties_validation_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostObjectPropertiesValidationResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostObjectPropertiesValidationResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_ignores_arrays_passes(self): # ignores arrays accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -51,23 +49,23 @@ def test_ignores_arrays_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postObjectPropertiesValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postObjectPropertiesValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_ignores_other_non_objects_passes(self): # ignores other non-objects accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 12 @@ -81,23 +79,23 @@ def test_ignores_other_non_objects_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postObjectPropertiesValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postObjectPropertiesValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_one_property_invalid_is_invalid_fails(self): # one property invalid is invalid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -118,16 +116,16 @@ def test_one_property_invalid_is_invalid_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postObjectPropertiesValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postObjectPropertiesValidationResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_both_properties_present_and_valid_is_valid_passes(self): # both properties present and valid is valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -146,23 +144,23 @@ def test_both_properties_present_and_valid_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postObjectPropertiesValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postObjectPropertiesValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_doesn_t_invalidate_other_properties_passes(self): # doesn't invalidate other properties accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -180,23 +178,23 @@ def test_doesn_t_invalidate_other_properties_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postObjectPropertiesValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postObjectPropertiesValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_both_properties_invalid_is_invalid_fails(self): # both properties invalid is invalid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -218,14 +216,11 @@ def test_both_properties_invalid_is_invalid_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postObjectPropertiesValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postObjectPropertiesValidationResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_object_type_matches_objects_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_object_type_matches_objects_response_body_for_content_types/test_post.py index 55da20de7ef..c5b277485fd 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_object_type_matches_objects_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_object_type_matches_objects_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_object_type_matches_objects_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_object_type_matches_objects_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostObjectTypeMatchesObjectsResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostObjectTypeMatchesObjectsResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_a_float_is_not_an_object_fails(self): # a float is not an object accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 1.1 @@ -51,16 +49,16 @@ def test_a_float_is_not_an_object_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postObjectTypeMatchesObjectsResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postObjectTypeMatchesObjectsResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_null_is_not_an_object_fails(self): # null is not an object accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( None @@ -75,16 +73,16 @@ def test_null_is_not_an_object_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postObjectTypeMatchesObjectsResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postObjectTypeMatchesObjectsResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_an_array_is_not_an_object_fails(self): # an array is not an object accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -100,16 +98,16 @@ def test_an_array_is_not_an_object_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postObjectTypeMatchesObjectsResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postObjectTypeMatchesObjectsResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_an_object_is_an_object_passes(self): # an object is an object accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -124,23 +122,23 @@ def test_an_object_is_an_object_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postObjectTypeMatchesObjectsResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postObjectTypeMatchesObjectsResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_a_string_is_not_an_object_fails(self): # a string is not an object accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( "foo" @@ -155,16 +153,16 @@ def test_a_string_is_not_an_object_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postObjectTypeMatchesObjectsResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postObjectTypeMatchesObjectsResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_an_integer_is_not_an_object_fails(self): # an integer is not an object accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 1 @@ -179,16 +177,16 @@ def test_an_integer_is_not_an_object_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postObjectTypeMatchesObjectsResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postObjectTypeMatchesObjectsResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_a_boolean_is_not_an_object_fails(self): # a boolean is not an object accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( True @@ -203,14 +201,11 @@ def test_a_boolean_is_not_an_object_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postObjectTypeMatchesObjectsResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postObjectTypeMatchesObjectsResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_complex_types_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_complex_types_response_body_for_content_types/test_post.py index 678c4ad8098..c769f61be08 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_complex_types_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_complex_types_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_oneof_complex_types_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_oneof_complex_types_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostOneofComplexTypesResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostOneofComplexTypesResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_first_oneof_valid_complex_passes(self): # first oneOf valid (complex) accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -53,23 +51,23 @@ def test_first_oneof_valid_complex_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postOneofComplexTypesResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postOneofComplexTypesResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_neither_oneof_valid_complex_fails(self): # neither oneOf valid (complex) accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -89,16 +87,16 @@ def test_neither_oneof_valid_complex_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postOneofComplexTypesResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postOneofComplexTypesResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_both_oneof_valid_complex_fails(self): # both oneOf valid (complex) accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -118,16 +116,16 @@ def test_both_oneof_valid_complex_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postOneofComplexTypesResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postOneofComplexTypesResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_second_oneof_valid_complex_passes(self): # second oneOf valid (complex) accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -144,21 +142,18 @@ def test_second_oneof_valid_complex_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postOneofComplexTypesResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postOneofComplexTypesResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_response_body_for_content_types/test_post.py index ea487855ed5..83c822950b2 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_oneof_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_oneof_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostOneofResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostOneofResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_second_oneof_valid_passes(self): # second oneOf valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 2.5 @@ -50,23 +48,23 @@ def test_second_oneof_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postOneofResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postOneofResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_both_oneof_valid_fails(self): # both oneOf valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 3 @@ -81,16 +79,16 @@ def test_both_oneof_valid_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postOneofResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postOneofResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_first_oneof_valid_passes(self): # first oneOf valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 1 @@ -104,23 +102,23 @@ def test_first_oneof_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postOneofResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postOneofResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_neither_oneof_valid_fails(self): # neither oneOf valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 1.5 @@ -135,14 +133,11 @@ def test_neither_oneof_valid_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postOneofResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postOneofResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_with_base_schema_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_with_base_schema_response_body_for_content_types/test_post.py index cfe0200c089..60fc05b80df 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_with_base_schema_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_with_base_schema_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_oneof_with_base_schema_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_oneof_with_base_schema_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostOneofWithBaseSchemaResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostOneofWithBaseSchemaResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_both_oneof_valid_fails(self): # both oneOf valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( "foo" @@ -51,16 +49,16 @@ def test_both_oneof_valid_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postOneofWithBaseSchemaResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postOneofWithBaseSchemaResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_mismatch_base_schema_fails(self): # mismatch base schema accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 3 @@ -75,16 +73,16 @@ def test_mismatch_base_schema_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postOneofWithBaseSchemaResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postOneofWithBaseSchemaResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_one_oneof_valid_passes(self): # one oneOf valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( "foobar" @@ -98,21 +96,18 @@ def test_one_oneof_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postOneofWithBaseSchemaResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postOneofWithBaseSchemaResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_with_empty_schema_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_with_empty_schema_response_body_for_content_types/test_post.py index 471fdae40c1..e59ba02e6d0 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_with_empty_schema_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_with_empty_schema_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_oneof_with_empty_schema_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_oneof_with_empty_schema_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostOneofWithEmptySchemaResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostOneofWithEmptySchemaResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_both_valid_invalid_fails(self): # both valid - invalid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 123 @@ -51,16 +49,16 @@ def test_both_valid_invalid_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postOneofWithEmptySchemaResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postOneofWithEmptySchemaResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_one_valid_valid_passes(self): # one valid - valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( "foo" @@ -74,21 +72,18 @@ def test_one_valid_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postOneofWithEmptySchemaResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postOneofWithEmptySchemaResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_with_required_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_with_required_response_body_for_content_types/test_post.py index dca5c2b9194..354d2c492d1 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_with_required_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_with_required_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_oneof_with_required_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_oneof_with_required_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostOneofWithRequiredResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostOneofWithRequiredResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_both_valid_invalid_fails(self): # both valid - invalid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -58,16 +56,16 @@ def test_both_valid_invalid_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postOneofWithRequiredResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postOneofWithRequiredResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_both_invalid_invalid_fails(self): # both invalid - invalid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -85,16 +83,16 @@ def test_both_invalid_invalid_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postOneofWithRequiredResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postOneofWithRequiredResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_first_valid_valid_passes(self): # first valid - valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -113,23 +111,23 @@ def test_first_valid_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postOneofWithRequiredResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postOneofWithRequiredResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_second_valid_valid_passes(self): # second valid - valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -148,21 +146,18 @@ def test_second_valid_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postOneofWithRequiredResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postOneofWithRequiredResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_pattern_is_not_anchored_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_pattern_is_not_anchored_response_body_for_content_types/test_post.py index 245619a9482..8ce9ea84df2 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_pattern_is_not_anchored_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_pattern_is_not_anchored_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_pattern_is_not_anchored_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_pattern_is_not_anchored_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostPatternIsNotAnchoredResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostPatternIsNotAnchoredResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_matches_a_substring_passes(self): # matches a substring accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( "xxaayy" @@ -50,21 +48,18 @@ def test_matches_a_substring_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postPatternIsNotAnchoredResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postPatternIsNotAnchoredResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_pattern_validation_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_pattern_validation_response_body_for_content_types/test_post.py index 15e3b6dc969..43fe7905410 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_pattern_validation_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_pattern_validation_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_pattern_validation_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_pattern_validation_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostPatternValidationResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostPatternValidationResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_ignores_arrays_passes(self): # ignores arrays accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -51,23 +49,23 @@ def test_ignores_arrays_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postPatternValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postPatternValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_ignores_objects_passes(self): # ignores objects accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -82,23 +80,23 @@ def test_ignores_objects_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postPatternValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postPatternValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_ignores_null_passes(self): # ignores null accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( None @@ -112,23 +110,23 @@ def test_ignores_null_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postPatternValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postPatternValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_ignores_floats_passes(self): # ignores floats accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 1.0 @@ -142,23 +140,23 @@ def test_ignores_floats_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postPatternValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postPatternValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_a_non_matching_pattern_is_invalid_fails(self): # a non-matching pattern is invalid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( "abc" @@ -173,16 +171,16 @@ def test_a_non_matching_pattern_is_invalid_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postPatternValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postPatternValidationResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_ignores_booleans_passes(self): # ignores booleans accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( True @@ -196,23 +194,23 @@ def test_ignores_booleans_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postPatternValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postPatternValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_a_matching_pattern_is_valid_passes(self): # a matching pattern is valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( "aaa" @@ -226,23 +224,23 @@ def test_a_matching_pattern_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postPatternValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postPatternValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_ignores_integers_passes(self): # ignores integers accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 123 @@ -256,21 +254,18 @@ def test_ignores_integers_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postPatternValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postPatternValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_properties_with_escaped_characters_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_properties_with_escaped_characters_response_body_for_content_types/test_post.py index d3104eca246..aa020d43ded 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_properties_with_escaped_characters_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_properties_with_escaped_characters_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_properties_with_escaped_characters_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_properties_with_escaped_characters_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostPropertiesWithEscapedCharactersResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostPropertiesWithEscapedCharactersResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_object_with_all_numbers_is_valid_passes(self): # object with all numbers is valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -63,23 +61,23 @@ def test_object_with_all_numbers_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postPropertiesWithEscapedCharactersResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postPropertiesWithEscapedCharactersResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_object_with_strings_is_invalid_fails(self): # object with strings is invalid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -107,14 +105,11 @@ def test_object_with_strings_is_invalid_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postPropertiesWithEscapedCharactersResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postPropertiesWithEscapedCharactersResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/test_post.py index 15809e33dbe..11ce980d67a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostPropertyNamedRefThatIsNotAReferenceResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostPropertyNamedRefThatIsNotAReferenceResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_property_named_ref_valid_passes(self): # property named $ref valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -53,23 +51,23 @@ def test_property_named_ref_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postPropertyNamedRefThatIsNotAReferenceResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postPropertyNamedRefThatIsNotAReferenceResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_property_named_ref_invalid_fails(self): # property named $ref invalid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -87,14 +85,11 @@ def test_property_named_ref_invalid_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postPropertyNamedRefThatIsNotAReferenceResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postPropertyNamedRefThatIsNotAReferenceResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_additionalproperties_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_additionalproperties_response_body_for_content_types/test_post.py index 00e6305e31d..878ea1e65a0 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_additionalproperties_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_additionalproperties_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_ref_in_additionalproperties_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_ref_in_additionalproperties_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostRefInAdditionalpropertiesResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostRefInAdditionalpropertiesResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_property_named_ref_valid_passes(self): # property named $ref valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -56,23 +54,23 @@ def test_property_named_ref_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postRefInAdditionalpropertiesResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postRefInAdditionalpropertiesResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_property_named_ref_invalid_fails(self): # property named $ref invalid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -93,14 +91,11 @@ def test_property_named_ref_invalid_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postRefInAdditionalpropertiesResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postRefInAdditionalpropertiesResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_allof_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_allof_response_body_for_content_types/test_post.py index 02b7a73a40d..1adc6140e0e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_allof_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_allof_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_ref_in_allof_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_ref_in_allof_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostRefInAllofResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostRefInAllofResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_property_named_ref_valid_passes(self): # property named $ref valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -53,23 +51,23 @@ def test_property_named_ref_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postRefInAllofResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postRefInAllofResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_property_named_ref_invalid_fails(self): # property named $ref invalid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -87,14 +85,11 @@ def test_property_named_ref_invalid_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postRefInAllofResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postRefInAllofResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_anyof_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_anyof_response_body_for_content_types/test_post.py index 5094e0cc1c3..7a75c9946e5 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_anyof_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_anyof_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_ref_in_anyof_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_ref_in_anyof_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostRefInAnyofResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostRefInAnyofResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_property_named_ref_valid_passes(self): # property named $ref valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -53,23 +51,23 @@ def test_property_named_ref_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postRefInAnyofResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postRefInAnyofResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_property_named_ref_invalid_fails(self): # property named $ref invalid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -87,14 +85,11 @@ def test_property_named_ref_invalid_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postRefInAnyofResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postRefInAnyofResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_items_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_items_response_body_for_content_types/test_post.py index 73d211de567..4ce887b09ce 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_items_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_items_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_ref_in_items_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_ref_in_items_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostRefInItemsResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostRefInItemsResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_property_named_ref_valid_passes(self): # property named $ref valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -55,23 +53,23 @@ def test_property_named_ref_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postRefInItemsResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postRefInItemsResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_property_named_ref_invalid_fails(self): # property named $ref invalid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -91,14 +89,11 @@ def test_property_named_ref_invalid_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postRefInItemsResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postRefInItemsResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_not_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_not_response_body_for_content_types/test_post.py index fa87d826404..72874549959 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_not_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_not_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_ref_in_not_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_ref_in_not_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostRefInNotResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostRefInNotResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_property_named_ref_valid_passes(self): # property named $ref valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -53,23 +51,23 @@ def test_property_named_ref_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postRefInNotResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postRefInNotResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_property_named_ref_invalid_fails(self): # property named $ref invalid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -87,14 +85,11 @@ def test_property_named_ref_invalid_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postRefInNotResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postRefInNotResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_oneof_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_oneof_response_body_for_content_types/test_post.py index 50be3af9dc6..93b4b1f8be7 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_oneof_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_oneof_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_ref_in_oneof_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_ref_in_oneof_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostRefInOneofResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostRefInOneofResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_property_named_ref_valid_passes(self): # property named $ref valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -53,23 +51,23 @@ def test_property_named_ref_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postRefInOneofResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postRefInOneofResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_property_named_ref_invalid_fails(self): # property named $ref invalid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -87,14 +85,11 @@ def test_property_named_ref_invalid_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postRefInOneofResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postRefInOneofResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_property_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_property_response_body_for_content_types/test_post.py index 3d93977c2bc..f5d7dc98d29 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_property_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_property_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_ref_in_property_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_ref_in_property_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostRefInPropertyResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostRefInPropertyResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_property_named_ref_valid_passes(self): # property named $ref valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -56,23 +54,23 @@ def test_property_named_ref_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postRefInPropertyResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postRefInPropertyResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_property_named_ref_invalid_fails(self): # property named $ref invalid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -93,14 +91,11 @@ def test_property_named_ref_invalid_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postRefInPropertyResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postRefInPropertyResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_required_default_validation_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_required_default_validation_response_body_for_content_types/test_post.py index c7978bfe4bc..fcb9a44331a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_required_default_validation_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_required_default_validation_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_required_default_validation_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_required_default_validation_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostRequiredDefaultValidationResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostRequiredDefaultValidationResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_not_required_by_default_passes(self): # not required by default accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -51,21 +49,18 @@ def test_not_required_by_default_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postRequiredDefaultValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postRequiredDefaultValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_required_validation_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_required_validation_response_body_for_content_types/test_post.py index e3c20b581ce..26cbb06e838 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_required_validation_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_required_validation_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_required_validation_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_required_validation_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostRequiredValidationResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostRequiredValidationResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_ignores_arrays_passes(self): # ignores arrays accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -51,23 +49,23 @@ def test_ignores_arrays_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postRequiredValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postRequiredValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_present_required_property_is_valid_passes(self): # present required property is valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -84,23 +82,23 @@ def test_present_required_property_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postRequiredValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postRequiredValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_ignores_other_non_objects_passes(self): # ignores other non-objects accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 12 @@ -114,23 +112,23 @@ def test_ignores_other_non_objects_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postRequiredValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postRequiredValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_ignores_strings_passes(self): # ignores strings accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( "" @@ -144,23 +142,23 @@ def test_ignores_strings_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postRequiredValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postRequiredValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_non_present_required_property_is_invalid_fails(self): # non-present required property is invalid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -178,14 +176,11 @@ def test_non_present_required_property_is_invalid_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postRequiredValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postRequiredValidationResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_required_with_empty_array_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_required_with_empty_array_response_body_for_content_types/test_post.py index 2e220a6fccf..68da0ff98f4 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_required_with_empty_array_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_required_with_empty_array_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_required_with_empty_array_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_required_with_empty_array_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostRequiredWithEmptyArrayResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostRequiredWithEmptyArrayResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_property_not_required_passes(self): # property not required accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -51,21 +49,18 @@ def test_property_not_required_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postRequiredWithEmptyArrayResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postRequiredWithEmptyArrayResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_required_with_escaped_characters_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_required_with_escaped_characters_response_body_for_content_types/test_post.py index 921a4c2923c..8173a4b80b8 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_required_with_escaped_characters_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_required_with_escaped_characters_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_required_with_escaped_characters_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_required_with_escaped_characters_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostRequiredWithEscapedCharactersResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostRequiredWithEscapedCharactersResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_object_with_some_properties_missing_is_invalid_fails(self): # object with some properties missing is invalid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -56,16 +54,16 @@ def test_object_with_some_properties_missing_is_invalid_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postRequiredWithEscapedCharactersResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postRequiredWithEscapedCharactersResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_object_with_all_properties_present_is_valid_passes(self): # object with all properties present is valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -92,21 +90,18 @@ def test_object_with_all_properties_present_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postRequiredWithEscapedCharactersResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postRequiredWithEscapedCharactersResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_simple_enum_validation_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_simple_enum_validation_response_body_for_content_types/test_post.py index abadbf18cb1..12c5809ea08 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_simple_enum_validation_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_simple_enum_validation_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_simple_enum_validation_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_simple_enum_validation_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostSimpleEnumValidationResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostSimpleEnumValidationResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_something_else_is_invalid_fails(self): # something else is invalid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 4 @@ -51,16 +49,16 @@ def test_something_else_is_invalid_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postSimpleEnumValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postSimpleEnumValidationResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_one_of_the_enum_is_valid_passes(self): # one of the enum is valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 1 @@ -74,21 +72,18 @@ def test_one_of_the_enum_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postSimpleEnumValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postSimpleEnumValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_string_type_matches_strings_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_string_type_matches_strings_response_body_for_content_types/test_post.py index e1a0a1dd840..83903a68065 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_string_type_matches_strings_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_string_type_matches_strings_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_string_type_matches_strings_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_string_type_matches_strings_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostStringTypeMatchesStringsResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostStringTypeMatchesStringsResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_1_is_not_a_string_fails(self): # 1 is not a string accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 1 @@ -51,16 +49,16 @@ def test_1_is_not_a_string_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postStringTypeMatchesStringsResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postStringTypeMatchesStringsResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_a_string_is_still_a_string_even_if_it_looks_like_a_number_passes(self): # a string is still a string, even if it looks like a number accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( "1" @@ -74,23 +72,23 @@ def test_a_string_is_still_a_string_even_if_it_looks_like_a_number_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postStringTypeMatchesStringsResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postStringTypeMatchesStringsResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_an_empty_string_is_still_a_string_passes(self): # an empty string is still a string accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( "" @@ -104,23 +102,23 @@ def test_an_empty_string_is_still_a_string_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postStringTypeMatchesStringsResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postStringTypeMatchesStringsResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_a_float_is_not_a_string_fails(self): # a float is not a string accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 1.1 @@ -135,16 +133,16 @@ def test_a_float_is_not_a_string_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postStringTypeMatchesStringsResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postStringTypeMatchesStringsResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_an_object_is_not_a_string_fails(self): # an object is not a string accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -160,16 +158,16 @@ def test_an_object_is_not_a_string_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postStringTypeMatchesStringsResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postStringTypeMatchesStringsResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_an_array_is_not_a_string_fails(self): # an array is not a string accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -185,16 +183,16 @@ def test_an_array_is_not_a_string_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postStringTypeMatchesStringsResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postStringTypeMatchesStringsResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_a_boolean_is_not_a_string_fails(self): # a boolean is not a string accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( True @@ -209,16 +207,16 @@ def test_a_boolean_is_not_a_string_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postStringTypeMatchesStringsResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postStringTypeMatchesStringsResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_null_is_not_a_string_fails(self): # null is not a string accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( None @@ -233,16 +231,16 @@ def test_null_is_not_a_string_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postStringTypeMatchesStringsResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postStringTypeMatchesStringsResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_a_string_is_a_string_passes(self): # a string is a string accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( "foo" @@ -256,21 +254,18 @@ def test_a_string_is_a_string_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postStringTypeMatchesStringsResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postStringTypeMatchesStringsResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/test_post.py index c729358716d..8ac19cd022e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_missing_properties_are_not_filled_in_with_the_default_passes(self): # missing properties are not filled in with the default accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -51,23 +49,23 @@ def test_missing_properties_are_not_filled_in_with_the_default_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_an_explicit_property_value_is_checked_against_maximum_passing_passes(self): # an explicit property value is checked against maximum (passing) accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -84,23 +82,23 @@ def test_an_explicit_property_value_is_checked_against_maximum_passing_passes(se ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_an_explicit_property_value_is_checked_against_maximum_failing_fails(self): # an explicit property value is checked against maximum (failing) accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -118,14 +116,11 @@ def test_an_explicit_property_value_is_checked_against_maximum_failing_fails(sel ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uniqueitems_false_validation_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uniqueitems_false_validation_response_body_for_content_types/test_post.py index f78f2961df8..678720b1e23 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uniqueitems_false_validation_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uniqueitems_false_validation_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_uniqueitems_false_validation_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_uniqueitems_false_validation_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostUniqueitemsFalseValidationResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostUniqueitemsFalseValidationResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_non_unique_array_of_integers_is_valid_passes(self): # non-unique array of integers is valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -53,23 +51,23 @@ def test_non_unique_array_of_integers_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postUniqueitemsFalseValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsFalseValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_unique_array_of_objects_is_valid_passes(self): # unique array of objects is valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -92,23 +90,23 @@ def test_unique_array_of_objects_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postUniqueitemsFalseValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsFalseValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_non_unique_array_of_nested_objects_is_valid_passes(self): # non-unique array of nested objects is valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -143,23 +141,23 @@ def test_non_unique_array_of_nested_objects_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postUniqueitemsFalseValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsFalseValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_non_unique_array_of_objects_is_valid_passes(self): # non-unique array of objects is valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -182,23 +180,23 @@ def test_non_unique_array_of_objects_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postUniqueitemsFalseValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsFalseValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_1_and_true_are_unique_passes(self): # 1 and true are unique accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -215,23 +213,23 @@ def test_1_and_true_are_unique_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postUniqueitemsFalseValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsFalseValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_unique_array_of_integers_is_valid_passes(self): # unique array of integers is valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -248,23 +246,23 @@ def test_unique_array_of_integers_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postUniqueitemsFalseValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsFalseValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_non_unique_array_of_arrays_is_valid_passes(self): # non-unique array of arrays is valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -285,23 +283,23 @@ def test_non_unique_array_of_arrays_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postUniqueitemsFalseValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsFalseValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_numbers_are_unique_if_mathematically_unequal_passes(self): # numbers are unique if mathematically unequal accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -319,23 +317,23 @@ def test_numbers_are_unique_if_mathematically_unequal_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postUniqueitemsFalseValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsFalseValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_false_is_not_equal_to_zero_passes(self): # false is not equal to zero accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -352,23 +350,23 @@ def test_false_is_not_equal_to_zero_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postUniqueitemsFalseValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsFalseValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_unique_array_of_nested_objects_is_valid_passes(self): # unique array of nested objects is valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -403,23 +401,23 @@ def test_unique_array_of_nested_objects_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postUniqueitemsFalseValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsFalseValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_0_and_false_are_unique_passes(self): # 0 and false are unique accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -436,23 +434,23 @@ def test_0_and_false_are_unique_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postUniqueitemsFalseValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsFalseValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_unique_array_of_arrays_is_valid_passes(self): # unique array of arrays is valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -473,23 +471,23 @@ def test_unique_array_of_arrays_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postUniqueitemsFalseValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsFalseValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_true_is_not_equal_to_one_passes(self): # true is not equal to one accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -506,23 +504,23 @@ def test_true_is_not_equal_to_one_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postUniqueitemsFalseValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsFalseValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_non_unique_heterogeneous_types_are_valid_passes(self): # non-unique heterogeneous types are valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -547,23 +545,23 @@ def test_non_unique_heterogeneous_types_are_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postUniqueitemsFalseValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsFalseValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_unique_heterogeneous_types_are_valid_passes(self): # unique heterogeneous types are valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -586,21 +584,18 @@ def test_unique_heterogeneous_types_are_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postUniqueitemsFalseValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsFalseValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uniqueitems_validation_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uniqueitems_validation_response_body_for_content_types/test_post.py index f7a88f24b26..805c21056c8 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uniqueitems_validation_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uniqueitems_validation_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_uniqueitems_validation_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_uniqueitems_validation_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostUniqueitemsValidationResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostUniqueitemsValidationResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_unique_array_of_objects_is_valid_passes(self): # unique array of objects is valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -59,23 +57,23 @@ def test_unique_array_of_objects_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postUniqueitemsValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_a_true_and_a1_are_unique_passes(self): # {"a": true} and {"a": 1} are unique accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -98,23 +96,23 @@ def test_a_true_and_a1_are_unique_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postUniqueitemsValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_non_unique_heterogeneous_types_are_invalid_fails(self): # non-unique heterogeneous types are invalid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -140,16 +138,16 @@ def test_non_unique_heterogeneous_types_are_invalid_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postUniqueitemsValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsValidationResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_nested0_and_false_are_unique_passes(self): # nested [0] and [false] are unique accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -176,23 +174,23 @@ def test_nested0_and_false_are_unique_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postUniqueitemsValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_a_false_and_a0_are_unique_passes(self): # {"a": false} and {"a": 0} are unique accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -215,23 +213,23 @@ def test_a_false_and_a0_are_unique_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postUniqueitemsValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_numbers_are_unique_if_mathematically_unequal_fails(self): # numbers are unique if mathematically unequal accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -250,16 +248,16 @@ def test_numbers_are_unique_if_mathematically_unequal_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postUniqueitemsValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsValidationResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_false_is_not_equal_to_zero_passes(self): # false is not equal to zero accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -276,23 +274,23 @@ def test_false_is_not_equal_to_zero_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postUniqueitemsValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_0_and_false_are_unique_passes(self): # [0] and [false] are unique accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -313,23 +311,23 @@ def test_0_and_false_are_unique_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postUniqueitemsValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_unique_array_of_arrays_is_valid_passes(self): # unique array of arrays is valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -350,23 +348,23 @@ def test_unique_array_of_arrays_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postUniqueitemsValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_non_unique_array_of_nested_objects_is_invalid_fails(self): # non-unique array of nested objects is invalid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -402,16 +400,16 @@ def test_non_unique_array_of_nested_objects_is_invalid_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postUniqueitemsValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsValidationResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_non_unique_array_of_more_than_two_integers_is_invalid_fails(self): # non-unique array of more than two integers is invalid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -430,16 +428,16 @@ def test_non_unique_array_of_more_than_two_integers_is_invalid_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postUniqueitemsValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsValidationResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_true_is_not_equal_to_one_passes(self): # true is not equal to one accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -456,23 +454,23 @@ def test_true_is_not_equal_to_one_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postUniqueitemsValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_objects_are_non_unique_despite_key_order_fails(self): # objects are non-unique despite key order accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -500,16 +498,16 @@ def test_objects_are_non_unique_despite_key_order_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postUniqueitemsValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsValidationResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_unique_array_of_strings_is_valid_passes(self): # unique array of strings is valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -527,23 +525,23 @@ def test_unique_array_of_strings_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postUniqueitemsValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_1_and_true_are_unique_passes(self): # [1] and [true] are unique accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -564,23 +562,23 @@ def test_1_and_true_are_unique_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postUniqueitemsValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_different_objects_are_unique_passes(self): # different objects are unique accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -607,23 +605,23 @@ def test_different_objects_are_unique_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postUniqueitemsValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_unique_array_of_integers_is_valid_passes(self): # unique array of integers is valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -640,23 +638,23 @@ def test_unique_array_of_integers_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postUniqueitemsValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_non_unique_array_of_more_than_two_arrays_is_invalid_fails(self): # non-unique array of more than two arrays is invalid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -681,16 +679,16 @@ def test_non_unique_array_of_more_than_two_arrays_is_invalid_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postUniqueitemsValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsValidationResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_non_unique_array_of_objects_is_invalid_fails(self): # non-unique array of objects is invalid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -714,16 +712,16 @@ def test_non_unique_array_of_objects_is_invalid_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postUniqueitemsValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsValidationResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_unique_array_of_nested_objects_is_valid_passes(self): # unique array of nested objects is valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -758,23 +756,23 @@ def test_unique_array_of_nested_objects_is_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postUniqueitemsValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_non_unique_array_of_arrays_is_invalid_fails(self): # non-unique array of arrays is invalid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -796,16 +794,16 @@ def test_non_unique_array_of_arrays_is_invalid_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postUniqueitemsValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsValidationResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_non_unique_array_of_strings_is_invalid_fails(self): # non-unique array of strings is invalid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -824,16 +822,16 @@ def test_non_unique_array_of_strings_is_invalid_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postUniqueitemsValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsValidationResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - + def test_nested1_and_true_are_unique_passes(self): # nested [1] and [true] are unique accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -860,23 +858,23 @@ def test_nested1_and_true_are_unique_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postUniqueitemsValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_unique_heterogeneous_types_are_valid_passes(self): # unique heterogeneous types are valid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -900,23 +898,23 @@ def test_unique_heterogeneous_types_are_valid_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postUniqueitemsValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsValidationResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_non_unique_array_of_integers_is_invalid_fails(self): # non-unique array of integers is invalid accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -934,14 +932,11 @@ def test_non_unique_array_of_integers_is_invalid_fails(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postUniqueitemsValidationResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsValidationResponseBodyForContentTypes", method='post'.upper(), content_type=None, accept_content_type=accept_content_type, ) - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uri_format_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uri_format_response_body_for_content_types/test_post.py index 2c93b63f9e8..0604e737101 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uri_format_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uri_format_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_uri_format_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_uri_format_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostUriFormatResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostUriFormatResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_all_string_formats_ignore_objects_passes(self): # all string formats ignore objects accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -51,23 +49,23 @@ def test_all_string_formats_ignore_objects_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postUriFormatResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postUriFormatResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_all_string_formats_ignore_booleans_passes(self): # all string formats ignore booleans accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( False @@ -81,23 +79,23 @@ def test_all_string_formats_ignore_booleans_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postUriFormatResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postUriFormatResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_all_string_formats_ignore_integers_passes(self): # all string formats ignore integers accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 12 @@ -111,23 +109,23 @@ def test_all_string_formats_ignore_integers_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postUriFormatResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postUriFormatResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_all_string_formats_ignore_floats_passes(self): # all string formats ignore floats accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 13.7 @@ -141,23 +139,23 @@ def test_all_string_formats_ignore_floats_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postUriFormatResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postUriFormatResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_all_string_formats_ignore_arrays_passes(self): # all string formats ignore arrays accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -172,23 +170,23 @@ def test_all_string_formats_ignore_arrays_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postUriFormatResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postUriFormatResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_all_string_formats_ignore_nulls_passes(self): # all string formats ignore nulls accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( None @@ -202,21 +200,18 @@ def test_all_string_formats_ignore_nulls_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postUriFormatResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postUriFormatResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uri_reference_format_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uri_reference_format_response_body_for_content_types/test_post.py index 6fa62462b50..2c5f5bef2c2 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uri_reference_format_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uri_reference_format_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_uri_reference_format_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_uri_reference_format_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostUriReferenceFormatResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostUriReferenceFormatResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_all_string_formats_ignore_objects_passes(self): # all string formats ignore objects accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -51,23 +49,23 @@ def test_all_string_formats_ignore_objects_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postUriReferenceFormatResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postUriReferenceFormatResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_all_string_formats_ignore_booleans_passes(self): # all string formats ignore booleans accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( False @@ -81,23 +79,23 @@ def test_all_string_formats_ignore_booleans_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postUriReferenceFormatResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postUriReferenceFormatResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_all_string_formats_ignore_integers_passes(self): # all string formats ignore integers accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 12 @@ -111,23 +109,23 @@ def test_all_string_formats_ignore_integers_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postUriReferenceFormatResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postUriReferenceFormatResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_all_string_formats_ignore_floats_passes(self): # all string formats ignore floats accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 13.7 @@ -141,23 +139,23 @@ def test_all_string_formats_ignore_floats_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postUriReferenceFormatResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postUriReferenceFormatResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_all_string_formats_ignore_arrays_passes(self): # all string formats ignore arrays accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -172,23 +170,23 @@ def test_all_string_formats_ignore_arrays_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postUriReferenceFormatResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postUriReferenceFormatResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_all_string_formats_ignore_nulls_passes(self): # all string formats ignore nulls accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( None @@ -202,21 +200,18 @@ def test_all_string_formats_ignore_nulls_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postUriReferenceFormatResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postUriReferenceFormatResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uri_template_format_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uri_template_format_response_body_for_content_types/test_post.py index 3a57d51e1ae..75229d137c3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uri_template_format_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uri_template_format_response_body_for_content_types/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,29 @@ import urllib3 import unit_test_api -from unit_test_api.paths.response_body_post_uri_template_format_response_body_for_content_types import post # noqa: E501 -from unit_test_api import configuration, schemas, api_client +from unit_test_api.paths.response_body_post_uri_template_format_response_body_for_content_types.post import operation as post # noqa: E501 +from unit_test_api import schemas, api_client +from unit_test_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestResponseBodyPostUriTemplateFormatResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - ResponseBodyPostUriTemplateFormatResponseBodyForContentTypes unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + def test_all_string_formats_ignore_objects_passes(self): # all string formats ignore objects accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( { @@ -51,23 +49,23 @@ def test_all_string_formats_ignore_objects_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postUriTemplateFormatResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postUriTemplateFormatResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_all_string_formats_ignore_booleans_passes(self): # all string formats ignore booleans accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( False @@ -81,23 +79,23 @@ def test_all_string_formats_ignore_booleans_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postUriTemplateFormatResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postUriTemplateFormatResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_all_string_formats_ignore_integers_passes(self): # all string formats ignore integers accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 12 @@ -111,23 +109,23 @@ def test_all_string_formats_ignore_integers_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postUriTemplateFormatResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postUriTemplateFormatResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_all_string_formats_ignore_floats_passes(self): # all string formats ignore floats accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( 13.7 @@ -141,23 +139,23 @@ def test_all_string_formats_ignore_floats_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postUriTemplateFormatResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postUriTemplateFormatResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_all_string_formats_ignore_arrays_passes(self): # all string formats ignore arrays accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( [ @@ -172,23 +170,23 @@ def test_all_string_formats_ignore_arrays_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postUriTemplateFormatResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postUriTemplateFormatResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - + def test_all_string_formats_ignore_nulls_passes(self): # all string formats ignore nulls accept_content_type = 'application/json' - + with patch.object(urllib3.PoolManager, 'request') as mock_request: payload = ( None @@ -202,21 +200,18 @@ def test_all_string_formats_ignore_nulls_passes(self): ) self.assert_pool_manager_request_called_with( mock_request, - self._configuration.host + '/responseBody/postUriTemplateFormatResponseBodyForContentTypes', + self.api_config.get_server_url('servers', None) + "/responseBody/postUriTemplateFormatResponseBodyForContentTypes", method='post'.upper(), accept_content_type=accept_content_type, ) - + assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson) - deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson.from_openapi_data_oapg( + assert isinstance(api_response.body, self.response_body_schema) + deserialized_response_body = self.response_body_schema.from_openapi_data_( payload, - _configuration=self._configuration + configuration_=self.schema_config ) assert api_response.body == deserialized_response_body - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test_python.sh b/samples/openapi3/client/3_0_3_unit_test/python/test_python.sh index 9728a9b5316..f170f03a6e2 100755 --- a/samples/openapi3/client/3_0_3_unit_test/python/test_python.sh +++ b/samples/openapi3/client/3_0_3_unit_test/python/test_python.sh @@ -1,7 +1,5 @@ #!/bin/bash -REQUIREMENTS_FILE=dev-requirements.txt -REQUIREMENTS_OUT=dev-requirements.txt.log SETUP_OUT=*.egg-info VENV=venv DEACTIVE=false @@ -17,9 +15,9 @@ if [ -z "$VENVV" ]; then fi ### install dependencies -pip install -r $REQUIREMENTS_FILE | tee -a $REQUIREMENTS_OUT +pip install tox ### locally install the package, needed for pycharm problem checking -pip install -e . +python -m pip install . ### run tests tox || exit 1 diff --git a/samples/openapi3/client/3_0_3_unit_test/python/tox.ini b/samples/openapi3/client/3_0_3_unit_test/python/tox.ini index 6db4b8ba647..64b9f316b8b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/tox.ini +++ b/samples/openapi3/client/3_0_3_unit_test/python/tox.ini @@ -1,10 +1,10 @@ [tox] envlist = py37 +isolated_build = True [testenv] passenv = PYTHON_VERSION -deps=-r{toxinidir}/requirements.txt - -r{toxinidir}/test-requirements.txt +deps=-r{toxinidir}/test-requirements.txt commands= pytest --cov=unit_test_api diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/__init__.py deleted file mode 100644 index 5ca6e989be0..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/__init__.py +++ /dev/null @@ -1,28 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -__version__ = "1.0.0" - -# import ApiClient -from unit_test_api.api_client import ApiClient - -# import Configuration -from unit_test_api.configuration import Configuration - -# import exceptions -from unit_test_api.exceptions import OpenApiException -from unit_test_api.exceptions import ApiAttributeError -from unit_test_api.exceptions import ApiTypeError -from unit_test_api.exceptions import ApiValueError -from unit_test_api.exceptions import ApiKeyError -from unit_test_api.exceptions import ApiException diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/api_client.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/api_client.py deleted file mode 100644 index fdd29b55404..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/api_client.py +++ /dev/null @@ -1,1499 +0,0 @@ -# coding: utf-8 -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -from decimal import Decimal -import enum -import email -import json -import os -import io -import atexit -from multiprocessing.pool import ThreadPool -import re -import tempfile -import typing -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict -from urllib.parse import urlparse, quote -from urllib3.fields import RequestField as RequestFieldBase - -import frozendict - -from unit_test_api import rest -from unit_test_api.configuration import Configuration -from unit_test_api.exceptions import ApiTypeError, ApiValueError -from unit_test_api.schemas import ( - NoneClass, - BoolClass, - Schema, - FileIO, - BinarySchema, - date, - datetime, - none_type, - Unset, - unset, -) - - -class RequestField(RequestFieldBase): - def __eq__(self, other): - if not isinstance(other, RequestField): - return False - return self.__dict__ == other.__dict__ - - -class JSONEncoder(json.JSONEncoder): - compact_separators = (',', ':') - - def default(self, obj): - if isinstance(obj, str): - return str(obj) - elif isinstance(obj, float): - return float(obj) - elif isinstance(obj, int): - return int(obj) - elif isinstance(obj, Decimal): - if obj.as_tuple().exponent >= 0: - return int(obj) - return float(obj) - elif isinstance(obj, NoneClass): - return None - elif isinstance(obj, BoolClass): - return bool(obj) - elif isinstance(obj, (dict, frozendict.frozendict)): - return {key: self.default(val) for key, val in obj.items()} - elif isinstance(obj, (list, tuple)): - return [self.default(item) for item in obj] - raise ApiValueError('Unable to prepare type {} for serialization'.format(obj.__class__.__name__)) - - -class ParameterInType(enum.Enum): - QUERY = 'query' - HEADER = 'header' - PATH = 'path' - COOKIE = 'cookie' - - -class ParameterStyle(enum.Enum): - MATRIX = 'matrix' - LABEL = 'label' - FORM = 'form' - SIMPLE = 'simple' - SPACE_DELIMITED = 'spaceDelimited' - PIPE_DELIMITED = 'pipeDelimited' - DEEP_OBJECT = 'deepObject' - - -class PrefixSeparatorIterator: - # A class to store prefixes and separators for rfc6570 expansions - - def __init__(self, prefix: str, separator: str): - self.prefix = prefix - self.separator = separator - self.first = True - if separator in {'.', '|', '%20'}: - item_separator = separator - else: - item_separator = ',' - self.item_separator = item_separator - - def __iter__(self): - return self - - def __next__(self): - if self.first: - self.first = False - return self.prefix - return self.separator - - -class ParameterSerializerBase: - @classmethod - def _get_default_explode(cls, style: ParameterStyle) -> bool: - return False - - @staticmethod - def __ref6570_item_value(in_data: typing.Any, percent_encode: bool): - """ - Get representation if str/float/int/None/items in list/ values in dict - None is returned if an item is undefined, use cases are value= - - None - - [] - - {} - - [None, None None] - - {'a': None, 'b': None} - """ - if type(in_data) in {str, float, int}: - if percent_encode: - return quote(str(in_data)) - return str(in_data) - elif isinstance(in_data, none_type): - # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 - return None - elif isinstance(in_data, list) and not in_data: - # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 - return None - elif isinstance(in_data, dict) and not in_data: - # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 - return None - raise ApiValueError('Unable to generate a ref6570 item representation of {}'.format(in_data)) - - @staticmethod - def _to_dict(name: str, value: str): - return {name: value} - - @classmethod - def __ref6570_str_float_int_expansion( - cls, - variable_name: str, - in_data: typing.Any, - explode: bool, - percent_encode: bool, - prefix_separator_iterator: PrefixSeparatorIterator, - var_name_piece: str, - named_parameter_expansion: bool - ) -> str: - item_value = cls.__ref6570_item_value(in_data, percent_encode) - if item_value is None or (item_value == '' and prefix_separator_iterator.separator == ';'): - return next(prefix_separator_iterator) + var_name_piece - value_pair_equals = '=' if named_parameter_expansion else '' - return next(prefix_separator_iterator) + var_name_piece + value_pair_equals + item_value - - @classmethod - def __ref6570_list_expansion( - cls, - variable_name: str, - in_data: typing.Any, - explode: bool, - percent_encode: bool, - prefix_separator_iterator: PrefixSeparatorIterator, - var_name_piece: str, - named_parameter_expansion: bool - ) -> str: - item_values = [cls.__ref6570_item_value(v, percent_encode) for v in in_data] - item_values = [v for v in item_values if v is not None] - if not item_values: - # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 - return "" - value_pair_equals = '=' if named_parameter_expansion else '' - if not explode: - return ( - next(prefix_separator_iterator) + - var_name_piece + - value_pair_equals + - prefix_separator_iterator.item_separator.join(item_values) - ) - # exploded - return next(prefix_separator_iterator) + next(prefix_separator_iterator).join( - [var_name_piece + value_pair_equals + val for val in item_values] - ) - - @classmethod - def __ref6570_dict_expansion( - cls, - variable_name: str, - in_data: typing.Any, - explode: bool, - percent_encode: bool, - prefix_separator_iterator: PrefixSeparatorIterator, - var_name_piece: str, - named_parameter_expansion: bool - ) -> str: - in_data_transformed = {key: cls.__ref6570_item_value(val, percent_encode) for key, val in in_data.items()} - in_data_transformed = {key: val for key, val in in_data_transformed.items() if val is not None} - if not in_data_transformed: - # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 - return "" - value_pair_equals = '=' if named_parameter_expansion else '' - if not explode: - return ( - next(prefix_separator_iterator) + - var_name_piece + value_pair_equals + - prefix_separator_iterator.item_separator.join( - prefix_separator_iterator.item_separator.join( - item_pair - ) for item_pair in in_data_transformed.items() - ) - ) - # exploded - return next(prefix_separator_iterator) + next(prefix_separator_iterator).join( - [key + '=' + val for key, val in in_data_transformed.items()] - ) - - @classmethod - def _ref6570_expansion( - cls, - variable_name: str, - in_data: typing.Any, - explode: bool, - percent_encode: bool, - prefix_separator_iterator: PrefixSeparatorIterator - ) -> str: - """ - Separator is for separate variables like dict with explode true, not for array item separation - """ - named_parameter_expansion = prefix_separator_iterator.separator in {'&', ';'} - var_name_piece = variable_name if named_parameter_expansion else '' - if type(in_data) in {str, float, int}: - return cls.__ref6570_str_float_int_expansion( - variable_name, - in_data, - explode, - percent_encode, - prefix_separator_iterator, - var_name_piece, - named_parameter_expansion - ) - elif isinstance(in_data, none_type): - # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 - return "" - elif isinstance(in_data, list): - return cls.__ref6570_list_expansion( - variable_name, - in_data, - explode, - percent_encode, - prefix_separator_iterator, - var_name_piece, - named_parameter_expansion - ) - elif isinstance(in_data, dict): - return cls.__ref6570_dict_expansion( - variable_name, - in_data, - explode, - percent_encode, - prefix_separator_iterator, - var_name_piece, - named_parameter_expansion - ) - # bool, bytes, etc - raise ApiValueError('Unable to generate a ref6570 representation of {}'.format(in_data)) - - -class StyleFormSerializer(ParameterSerializerBase): - @classmethod - def _get_default_explode(cls, style: ParameterStyle) -> bool: - if style is ParameterStyle.FORM: - return True - return super()._get_default_explode(style) - - def _serialize_form( - self, - in_data: typing.Union[None, int, float, str, bool, dict, list], - name: str, - explode: bool, - percent_encode: bool, - prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] = None - ) -> str: - if prefix_separator_iterator is None: - prefix_separator_iterator = PrefixSeparatorIterator('', '&') - return self._ref6570_expansion( - variable_name=name, - in_data=in_data, - explode=explode, - percent_encode=percent_encode, - prefix_separator_iterator=prefix_separator_iterator - ) - - -class StyleSimpleSerializer(ParameterSerializerBase): - - def _serialize_simple( - self, - in_data: typing.Union[None, int, float, str, bool, dict, list], - name: str, - explode: bool, - percent_encode: bool - ) -> str: - prefix_separator_iterator = PrefixSeparatorIterator('', ',') - return self._ref6570_expansion( - variable_name=name, - in_data=in_data, - explode=explode, - percent_encode=percent_encode, - prefix_separator_iterator=prefix_separator_iterator - ) - - -class JSONDetector: - """ - Works for: - application/json - application/json; charset=UTF-8 - application/json-patch+json - application/geo+json - """ - __json_content_type_pattern = re.compile("application/[^+]*[+]?(json);?.*") - - @classmethod - def _content_type_is_json(cls, content_type: str) -> bool: - if cls.__json_content_type_pattern.match(content_type): - return True - return False - - -@dataclass -class ParameterBase(JSONDetector): - name: str - in_type: ParameterInType - required: bool - style: typing.Optional[ParameterStyle] - explode: typing.Optional[bool] - allow_reserved: typing.Optional[bool] - schema: typing.Optional[typing.Type[Schema]] - content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] - - __style_to_in_type = { - ParameterStyle.MATRIX: {ParameterInType.PATH}, - ParameterStyle.LABEL: {ParameterInType.PATH}, - ParameterStyle.FORM: {ParameterInType.QUERY, ParameterInType.COOKIE}, - ParameterStyle.SIMPLE: {ParameterInType.PATH, ParameterInType.HEADER}, - ParameterStyle.SPACE_DELIMITED: {ParameterInType.QUERY}, - ParameterStyle.PIPE_DELIMITED: {ParameterInType.QUERY}, - ParameterStyle.DEEP_OBJECT: {ParameterInType.QUERY}, - } - __in_type_to_default_style = { - ParameterInType.QUERY: ParameterStyle.FORM, - ParameterInType.PATH: ParameterStyle.SIMPLE, - ParameterInType.HEADER: ParameterStyle.SIMPLE, - ParameterInType.COOKIE: ParameterStyle.FORM, - } - __disallowed_header_names = {'Accept', 'Content-Type', 'Authorization'} - _json_encoder = JSONEncoder() - - @classmethod - def __verify_style_to_in_type(cls, style: typing.Optional[ParameterStyle], in_type: ParameterInType): - if style is None: - return - in_type_set = cls.__style_to_in_type[style] - if in_type not in in_type_set: - raise ValueError( - 'Invalid style and in_type combination. For style={} only in_type={} are allowed'.format( - style, in_type_set - ) - ) - - def __init__( - self, - name: str, - in_type: ParameterInType, - required: bool = False, - style: typing.Optional[ParameterStyle] = None, - explode: bool = False, - allow_reserved: typing.Optional[bool] = None, - schema: typing.Optional[typing.Type[Schema]] = None, - content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None - ): - if schema is None and content is None: - raise ValueError('Value missing; Pass in either schema or content') - if schema and content: - raise ValueError('Too many values provided. Both schema and content were provided. Only one may be input') - if name in self.__disallowed_header_names and in_type is ParameterInType.HEADER: - raise ValueError('Invalid name, name may not be one of {}'.format(self.__disallowed_header_names)) - self.__verify_style_to_in_type(style, in_type) - if content is None and style is None: - style = self.__in_type_to_default_style[in_type] - if content is not None and in_type in self.__in_type_to_default_style and len(content) != 1: - raise ValueError('Invalid content length, content length must equal 1') - self.in_type = in_type - self.name = name - self.required = required - self.style = style - self.explode = explode - self.allow_reserved = allow_reserved - self.schema = schema - self.content = content - - def _serialize_json( - self, - in_data: typing.Union[None, int, float, str, bool, dict, list], - eliminate_whitespace: bool = False - ) -> str: - if eliminate_whitespace: - return json.dumps(in_data, separators=self._json_encoder.compact_separators) - return json.dumps(in_data) - - -class PathParameter(ParameterBase, StyleSimpleSerializer): - - def __init__( - self, - name: str, - required: bool = False, - style: typing.Optional[ParameterStyle] = None, - explode: bool = False, - allow_reserved: typing.Optional[bool] = None, - schema: typing.Optional[typing.Type[Schema]] = None, - content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None - ): - super().__init__( - name, - in_type=ParameterInType.PATH, - required=required, - style=style, - explode=explode, - allow_reserved=allow_reserved, - schema=schema, - content=content - ) - - def __serialize_label( - self, - in_data: typing.Union[None, int, float, str, bool, dict, list] - ) -> typing.Dict[str, str]: - prefix_separator_iterator = PrefixSeparatorIterator('.', '.') - value = self._ref6570_expansion( - variable_name=self.name, - in_data=in_data, - explode=self.explode, - percent_encode=True, - prefix_separator_iterator=prefix_separator_iterator - ) - return self._to_dict(self.name, value) - - def __serialize_matrix( - self, - in_data: typing.Union[None, int, float, str, bool, dict, list] - ) -> typing.Dict[str, str]: - prefix_separator_iterator = PrefixSeparatorIterator(';', ';') - value = self._ref6570_expansion( - variable_name=self.name, - in_data=in_data, - explode=self.explode, - percent_encode=True, - prefix_separator_iterator=prefix_separator_iterator - ) - return self._to_dict(self.name, value) - - def __serialize_simple( - self, - in_data: typing.Union[None, int, float, str, bool, dict, list], - ) -> typing.Dict[str, str]: - value = self._serialize_simple( - in_data=in_data, - name=self.name, - explode=self.explode, - percent_encode=True - ) - return self._to_dict(self.name, value) - - def serialize( - self, - in_data: typing.Union[ - Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict] - ) -> typing.Dict[str, str]: - if self.schema: - cast_in_data = self.schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) - """ - simple -> path - path: - returns path_params: dict - label -> path - returns path_params - matrix -> path - returns path_params - """ - if self.style: - if self.style is ParameterStyle.SIMPLE: - return self.__serialize_simple(cast_in_data) - elif self.style is ParameterStyle.LABEL: - return self.__serialize_label(cast_in_data) - elif self.style is ParameterStyle.MATRIX: - return self.__serialize_matrix(cast_in_data) - # self.content will be length one - for content_type, schema in self.content.items(): - cast_in_data = schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) - if self._content_type_is_json(content_type): - value = self._serialize_json(cast_in_data) - return self._to_dict(self.name, value) - raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) - - -class QueryParameter(ParameterBase, StyleFormSerializer): - - def __init__( - self, - name: str, - required: bool = False, - style: typing.Optional[ParameterStyle] = None, - explode: typing.Optional[bool] = None, - allow_reserved: typing.Optional[bool] = None, - schema: typing.Optional[typing.Type[Schema]] = None, - content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None - ): - used_style = ParameterStyle.FORM if style is None else style - used_explode = self._get_default_explode(used_style) if explode is None else explode - - super().__init__( - name, - in_type=ParameterInType.QUERY, - required=required, - style=used_style, - explode=used_explode, - allow_reserved=allow_reserved, - schema=schema, - content=content - ) - - def __serialize_space_delimited( - self, - in_data: typing.Union[None, int, float, str, bool, dict, list], - prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] - ) -> typing.Dict[str, str]: - if prefix_separator_iterator is None: - prefix_separator_iterator = self.get_prefix_separator_iterator() - value = self._ref6570_expansion( - variable_name=self.name, - in_data=in_data, - explode=self.explode, - percent_encode=True, - prefix_separator_iterator=prefix_separator_iterator - ) - return self._to_dict(self.name, value) - - def __serialize_pipe_delimited( - self, - in_data: typing.Union[None, int, float, str, bool, dict, list], - prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] - ) -> typing.Dict[str, str]: - if prefix_separator_iterator is None: - prefix_separator_iterator = self.get_prefix_separator_iterator() - value = self._ref6570_expansion( - variable_name=self.name, - in_data=in_data, - explode=self.explode, - percent_encode=True, - prefix_separator_iterator=prefix_separator_iterator - ) - return self._to_dict(self.name, value) - - def __serialize_form( - self, - in_data: typing.Union[None, int, float, str, bool, dict, list], - prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] - ) -> typing.Dict[str, str]: - if prefix_separator_iterator is None: - prefix_separator_iterator = self.get_prefix_separator_iterator() - value = self._serialize_form( - in_data, - name=self.name, - explode=self.explode, - percent_encode=True, - prefix_separator_iterator=prefix_separator_iterator - ) - return self._to_dict(self.name, value) - - def get_prefix_separator_iterator(self) -> typing.Optional[PrefixSeparatorIterator]: - if self.style is ParameterStyle.FORM: - return PrefixSeparatorIterator('?', '&') - elif self.style is ParameterStyle.SPACE_DELIMITED: - return PrefixSeparatorIterator('', '%20') - elif self.style is ParameterStyle.PIPE_DELIMITED: - return PrefixSeparatorIterator('', '|') - - def serialize( - self, - in_data: typing.Union[ - Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict], - prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] = None - ) -> typing.Dict[str, str]: - if self.schema: - cast_in_data = self.schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) - """ - form -> query - query: - - GET/HEAD/DELETE: could use fields - - PUT/POST: must use urlencode to send parameters - returns fields: tuple - spaceDelimited -> query - returns fields - pipeDelimited -> query - returns fields - deepObject -> query, https://github.com/OAI/OpenAPI-Specification/issues/1706 - returns fields - """ - if self.style: - # TODO update query ones to omit setting values when [] {} or None is input - if self.style is ParameterStyle.FORM: - return self.__serialize_form(cast_in_data, prefix_separator_iterator) - elif self.style is ParameterStyle.SPACE_DELIMITED: - return self.__serialize_space_delimited(cast_in_data, prefix_separator_iterator) - elif self.style is ParameterStyle.PIPE_DELIMITED: - return self.__serialize_pipe_delimited(cast_in_data, prefix_separator_iterator) - # self.content will be length one - if prefix_separator_iterator is None: - prefix_separator_iterator = self.get_prefix_separator_iterator() - for content_type, schema in self.content.items(): - cast_in_data = schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) - if self._content_type_is_json(content_type): - value = self._serialize_json(cast_in_data, eliminate_whitespace=True) - return self._to_dict( - self.name, - next(prefix_separator_iterator) + self.name + '=' + quote(value) - ) - raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) - - -class CookieParameter(ParameterBase, StyleFormSerializer): - - def __init__( - self, - name: str, - required: bool = False, - style: typing.Optional[ParameterStyle] = None, - explode: typing.Optional[bool] = None, - allow_reserved: typing.Optional[bool] = None, - schema: typing.Optional[typing.Type[Schema]] = None, - content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None - ): - used_style = ParameterStyle.FORM if style is None and content is None and schema else style - used_explode = self._get_default_explode(used_style) if explode is None else explode - - super().__init__( - name, - in_type=ParameterInType.COOKIE, - required=required, - style=used_style, - explode=used_explode, - allow_reserved=allow_reserved, - schema=schema, - content=content - ) - - def serialize( - self, - in_data: typing.Union[ - Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict] - ) -> typing.Dict[str, str]: - if self.schema: - cast_in_data = self.schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) - """ - form -> cookie - returns fields: tuple - """ - if self.style: - """ - TODO add escaping of comma, space, equals - or turn encoding on - """ - value = self._serialize_form( - cast_in_data, - explode=self.explode, - name=self.name, - percent_encode=False, - prefix_separator_iterator=PrefixSeparatorIterator('', '&') - ) - return self._to_dict(self.name, value) - # self.content will be length one - for content_type, schema in self.content.items(): - cast_in_data = schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) - if self._content_type_is_json(content_type): - value = self._serialize_json(cast_in_data) - return self._to_dict(self.name, value) - raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) - - -class HeaderParameter(ParameterBase, StyleSimpleSerializer): - def __init__( - self, - name: str, - required: bool = False, - style: typing.Optional[ParameterStyle] = None, - explode: bool = False, - allow_reserved: typing.Optional[bool] = None, - schema: typing.Optional[typing.Type[Schema]] = None, - content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None - ): - super().__init__( - name, - in_type=ParameterInType.HEADER, - required=required, - style=style, - explode=explode, - allow_reserved=allow_reserved, - schema=schema, - content=content - ) - - @staticmethod - def __to_headers(in_data: typing.Tuple[typing.Tuple[str, str], ...]) -> HTTPHeaderDict: - data = tuple(t for t in in_data if t) - headers = HTTPHeaderDict() - if not data: - return headers - headers.extend(data) - return headers - - def serialize( - self, - in_data: typing.Union[ - Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict] - ) -> HTTPHeaderDict: - if self.schema: - cast_in_data = self.schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) - """ - simple -> header - headers: PoolManager needs a mapping, tuple is close - returns headers: dict - """ - if self.style: - value = self._serialize_simple(cast_in_data, self.name, self.explode, False) - return self.__to_headers(((self.name, value),)) - # self.content will be length one - for content_type, schema in self.content.items(): - cast_in_data = schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) - if self._content_type_is_json(content_type): - value = self._serialize_json(cast_in_data) - return self.__to_headers(((self.name, value),)) - raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) - - -class Encoding: - def __init__( - self, - content_type: str, - headers: typing.Optional[typing.Dict[str, HeaderParameter]] = None, - style: typing.Optional[ParameterStyle] = None, - explode: bool = False, - allow_reserved: bool = False, - ): - self.content_type = content_type - self.headers = headers - self.style = style - self.explode = explode - self.allow_reserved = allow_reserved - - -@dataclass -class MediaType: - """ - Used to store request and response body schema information - encoding: - A map between a property name and its encoding information. - The key, being the property name, MUST exist in the schema as a property. - The encoding object SHALL only apply to requestBody objects when the media type is - multipart or application/x-www-form-urlencoded. - """ - schema: typing.Optional[typing.Type[Schema]] = None - encoding: typing.Optional[typing.Dict[str, Encoding]] = None - - -@dataclass -class ApiResponse: - response: urllib3.HTTPResponse - body: typing.Union[Unset, Schema] = unset - headers: typing.Union[Unset, typing.Dict[str, Schema]] = unset - - def __init__( - self, - response: urllib3.HTTPResponse, - body: typing.Union[Unset, Schema] = unset, - headers: typing.Union[Unset, typing.Dict[str, Schema]] = unset - ): - """ - pycharm needs this to prevent 'Unexpected argument' warnings - """ - self.response = response - self.body = body - self.headers = headers - - -@dataclass -class ApiResponseWithoutDeserialization(ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[Unset, typing.Type[Schema]] = unset - headers: typing.Union[Unset, typing.List[HeaderParameter]] = unset - - -class OpenApiResponse(JSONDetector): - __filename_content_disposition_pattern = re.compile('filename="(.+?)"') - - def __init__( - self, - response_cls: typing.Type[ApiResponse] = ApiResponse, - content: typing.Optional[typing.Dict[str, MediaType]] = None, - headers: typing.Optional[typing.List[HeaderParameter]] = None, - ): - self.headers = headers - if content is not None and len(content) == 0: - raise ValueError('Invalid value for content, the content dict must have >= 1 entry') - self.content = content - self.response_cls = response_cls - - @staticmethod - def __deserialize_json(response: urllib3.HTTPResponse) -> typing.Any: - # python must be >= 3.9 so we can pass in bytes into json.loads - return json.loads(response.data) - - @staticmethod - def __file_name_from_response_url(response_url: typing.Optional[str]) -> typing.Optional[str]: - if response_url is None: - return None - url_path = urlparse(response_url).path - if url_path: - path_basename = os.path.basename(url_path) - if path_basename: - _filename, ext = os.path.splitext(path_basename) - if ext: - return path_basename - return None - - @classmethod - def __file_name_from_content_disposition(cls, content_disposition: typing.Optional[str]) -> typing.Optional[str]: - if content_disposition is None: - return None - match = cls.__filename_content_disposition_pattern.search(content_disposition) - if not match: - return None - return match.group(1) - - def __deserialize_application_octet_stream( - self, response: urllib3.HTTPResponse - ) -> typing.Union[bytes, io.BufferedReader]: - """ - urllib3 use cases: - 1. when preload_content=True (stream=False) then supports_chunked_reads is False and bytes are returned - 2. when preload_content=False (stream=True) then supports_chunked_reads is True and - a file will be written and returned - """ - if response.supports_chunked_reads(): - file_name = ( - self.__file_name_from_content_disposition(response.headers.get('content-disposition')) - or self.__file_name_from_response_url(response.geturl()) - ) - - if file_name is None: - _fd, path = tempfile.mkstemp() - else: - path = os.path.join(tempfile.gettempdir(), file_name) - - with open(path, 'wb') as new_file: - chunk_size = 1024 - while True: - data = response.read(chunk_size) - if not data: - break - new_file.write(data) - # release_conn is needed for streaming connections only - response.release_conn() - new_file = open(path, 'rb') - return new_file - else: - return response.data - - @staticmethod - def __deserialize_multipart_form_data( - response: urllib3.HTTPResponse - ) -> typing.Dict[str, typing.Any]: - msg = email.message_from_bytes(response.data) - return { - part.get_param("name", header="Content-Disposition"): part.get_payload( - decode=True - ).decode(part.get_content_charset()) - if part.get_content_charset() - else part.get_payload() - for part in msg.get_payload() - } - - def deserialize(self, response: urllib3.HTTPResponse, configuration: Configuration) -> ApiResponse: - content_type = response.getheader('content-type') - deserialized_body = unset - streamed = response.supports_chunked_reads() - - deserialized_headers = unset - if self.headers is not None: - # TODO add header deserialiation here - pass - - if self.content is not None: - if content_type not in self.content: - raise ApiValueError( - f"Invalid content_type returned. Content_type='{content_type}' was returned " - f"when only {str(set(self.content))} are defined for status_code={str(response.status)}" - ) - body_schema = self.content[content_type].schema - if body_schema is None: - # some specs do not define response content media type schemas - return self.response_cls( - response=response, - headers=deserialized_headers, - body=unset - ) - - if self._content_type_is_json(content_type): - body_data = self.__deserialize_json(response) - elif content_type == 'application/octet-stream': - body_data = self.__deserialize_application_octet_stream(response) - elif content_type.startswith('multipart/form-data'): - body_data = self.__deserialize_multipart_form_data(response) - content_type = 'multipart/form-data' - else: - raise NotImplementedError('Deserialization of {} has not yet been implemented'.format(content_type)) - deserialized_body = body_schema.from_openapi_data_oapg( - body_data, _configuration=configuration) - elif streamed: - response.release_conn() - - return self.response_cls( - response=response, - headers=deserialized_headers, - body=deserialized_body - ) - - -class ApiClient: - """Generic API client for OpenAPI client library builds. - - OpenAPI generic API client. This client handles the client- - server communication, and is invariant across implementations. Specifics of - the methods and models for each application are generated from the OpenAPI - templates. - - NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - Do not edit the class manually. - - :param configuration: .Configuration object for this client - :param header_name: a header to pass when making calls to the API. - :param header_value: a header value to pass when making calls to - the API. - :param cookie: a cookie to include in the header when making calls - to the API - :param pool_threads: The number of threads to use for async requests - to the API. More threads means more concurrent API requests. - """ - - _pool = None - - def __init__( - self, - configuration: typing.Optional[Configuration] = None, - header_name: typing.Optional[str] = None, - header_value: typing.Optional[str] = None, - cookie: typing.Optional[str] = None, - pool_threads: int = 1 - ): - if configuration is None: - configuration = Configuration() - self.configuration = configuration - self.pool_threads = pool_threads - - self.rest_client = rest.RESTClientObject(configuration) - self.default_headers = HTTPHeaderDict() - if header_name is not None: - self.default_headers[header_name] = header_value - self.cookie = cookie - # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/1.0.0/python' - - def __enter__(self): - return self - - def __exit__(self, exc_type, exc_value, traceback): - self.close() - - def close(self): - if self._pool: - self._pool.close() - self._pool.join() - self._pool = None - if hasattr(atexit, 'unregister'): - atexit.unregister(self.close) - - @property - def pool(self): - """Create thread pool on first request - avoids instantiating unused threadpool for blocking clients. - """ - if self._pool is None: - atexit.register(self.close) - self._pool = ThreadPool(self.pool_threads) - return self._pool - - @property - def user_agent(self): - """User agent for this API client""" - return self.default_headers['User-Agent'] - - @user_agent.setter - def user_agent(self, value): - self.default_headers['User-Agent'] = value - - def set_default_header(self, header_name, header_value): - self.default_headers[header_name] = header_value - - def __call_api( - self, - resource_path: str, - method: str, - headers: typing.Optional[HTTPHeaderDict] = None, - body: typing.Optional[typing.Union[str, bytes]] = None, - fields: typing.Optional[typing.Tuple[typing.Tuple[str, str], ...]] = None, - auth_settings: typing.Optional[typing.List[str]] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - host: typing.Optional[str] = None, - ) -> urllib3.HTTPResponse: - - # header parameters - used_headers = HTTPHeaderDict(self.default_headers) - if self.cookie: - headers['Cookie'] = self.cookie - - # auth setting - self.update_params_for_auth(used_headers, - auth_settings, resource_path, method, body) - - # must happen after cookie setting and auth setting in case user is overriding those - if headers: - used_headers.update(headers) - - # request url - if host is None: - url = self.configuration.host + resource_path - else: - # use server/host defined in path or operation instead - url = host + resource_path - - # perform request and return response - response = self.request( - method, - url, - headers=used_headers, - fields=fields, - body=body, - stream=stream, - timeout=timeout, - ) - return response - - def call_api( - self, - resource_path: str, - method: str, - headers: typing.Optional[HTTPHeaderDict] = None, - body: typing.Optional[typing.Union[str, bytes]] = None, - fields: typing.Optional[typing.Tuple[typing.Tuple[str, str], ...]] = None, - auth_settings: typing.Optional[typing.List[str]] = None, - async_req: typing.Optional[bool] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - host: typing.Optional[str] = None, - ) -> urllib3.HTTPResponse: - """Makes the HTTP request (synchronous) and returns deserialized data. - - To make an async_req request, set the async_req parameter. - - :param resource_path: Path to method endpoint. - :param method: Method to call. - :param headers: Header parameters to be - placed in the request header. - :param body: Request body. - :param fields: Request post form parameters, - for `application/x-www-form-urlencoded`, `multipart/form-data`. - :param auth_settings: Auth Settings names for the request. - :param async_req: execute request asynchronously - :type async_req: bool, optional TODO remove, unused - :param stream: if True, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Also when True, if the openapi spec describes a file download, - the data will be written to a local filesystme file and the BinarySchema - instance will also inherit from FileSchema and FileIO - Default is False. - :type stream: bool, optional - :param timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param host: api endpoint host - :return: - If async_req parameter is True, - the request will be called asynchronously. - The method will return the request thread. - If parameter async_req is False or missing, - then the method will return the response directly. - """ - - if not async_req: - return self.__call_api( - resource_path, - method, - headers, - body, - fields, - auth_settings, - stream, - timeout, - host, - ) - - return self.pool.apply_async( - self.__call_api, - ( - resource_path, - method, - headers, - body, - json, - fields, - auth_settings, - stream, - timeout, - host, - ) - ) - - def request( - self, - method: str, - url: str, - headers: typing.Optional[HTTPHeaderDict] = None, - fields: typing.Optional[typing.Tuple[typing.Tuple[str, str], ...]] = None, - body: typing.Optional[typing.Union[str, bytes]] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> urllib3.HTTPResponse: - """Makes the HTTP request using RESTClient.""" - if method == "GET": - return self.rest_client.GET(url, - stream=stream, - timeout=timeout, - headers=headers) - elif method == "HEAD": - return self.rest_client.HEAD(url, - stream=stream, - timeout=timeout, - headers=headers) - elif method == "OPTIONS": - return self.rest_client.OPTIONS(url, - headers=headers, - fields=fields, - stream=stream, - timeout=timeout, - body=body) - elif method == "POST": - return self.rest_client.POST(url, - headers=headers, - fields=fields, - stream=stream, - timeout=timeout, - body=body) - elif method == "PUT": - return self.rest_client.PUT(url, - headers=headers, - fields=fields, - stream=stream, - timeout=timeout, - body=body) - elif method == "PATCH": - return self.rest_client.PATCH(url, - headers=headers, - fields=fields, - stream=stream, - timeout=timeout, - body=body) - elif method == "DELETE": - return self.rest_client.DELETE(url, - headers=headers, - stream=stream, - timeout=timeout, - body=body) - else: - raise ApiValueError( - "http method must be `GET`, `HEAD`, `OPTIONS`," - " `POST`, `PATCH`, `PUT` or `DELETE`." - ) - - def update_params_for_auth(self, headers, auth_settings, - resource_path, method, body): - """Updates header and query params based on authentication setting. - - :param headers: Header parameters dict to be updated. - :param auth_settings: Authentication setting identifiers list. - :param resource_path: A string representation of the HTTP request resource path. - :param method: A string representation of the HTTP request method. - :param body: A object representing the body of the HTTP request. - The object type is the return value of _encoder.default(). - """ - if not auth_settings: - return - - for auth in auth_settings: - auth_setting = self.configuration.auth_settings().get(auth) - if not auth_setting: - continue - if auth_setting['in'] == 'cookie': - headers.add('Cookie', auth_setting['value']) - elif auth_setting['in'] == 'header': - if auth_setting['type'] != 'http-signature': - headers.add(auth_setting['key'], auth_setting['value']) - elif auth_setting['in'] == 'query': - """ TODO implement auth in query - need to pass in prefix_separator_iterator - and need to output resource_path with query params added - """ - raise ApiValueError("Auth in query not yet implemented") - else: - raise ApiValueError( - 'Authentication token must be in `query` or `header`' - ) - - -class Api: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client: typing.Optional[ApiClient] = None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - @staticmethod - def _verify_typed_dict_inputs_oapg(cls: typing.Type[typing_extensions.TypedDict], data: typing.Dict[str, typing.Any]): - """ - Ensures that: - - required keys are present - - additional properties are not input - - value stored under required keys do not have the value unset - Note: detailed value checking is done in schema classes - """ - missing_required_keys = [] - required_keys_with_unset_values = [] - for required_key in cls.__required_keys__: - if required_key not in data: - missing_required_keys.append(required_key) - continue - value = data[required_key] - if value is unset: - required_keys_with_unset_values.append(required_key) - if missing_required_keys: - raise ApiTypeError( - '{} missing {} required arguments: {}'.format( - cls.__name__, len(missing_required_keys), missing_required_keys - ) - ) - if required_keys_with_unset_values: - raise ApiValueError( - '{} contains invalid unset values for {} required keys: {}'.format( - cls.__name__, len(required_keys_with_unset_values), required_keys_with_unset_values - ) - ) - - disallowed_additional_keys = [] - for key in data: - if key in cls.__required_keys__ or key in cls.__optional_keys__: - continue - disallowed_additional_keys.append(key) - if disallowed_additional_keys: - raise ApiTypeError( - '{} got {} unexpected keyword arguments: {}'.format( - cls.__name__, len(disallowed_additional_keys), disallowed_additional_keys - ) - ) - - def _get_host_oapg( - self, - operation_id: str, - servers: typing.Tuple[typing.Dict[str, str], ...] = tuple(), - host_index: typing.Optional[int] = None - ) -> typing.Optional[str]: - configuration = self.api_client.configuration - try: - if host_index is None: - index = configuration.server_operation_index.get( - operation_id, configuration.server_index - ) - else: - index = host_index - server_variables = configuration.server_operation_variables.get( - operation_id, configuration.server_variables - ) - host = configuration.get_host_from_settings( - index, variables=server_variables, servers=servers - ) - except IndexError: - if servers: - raise ApiValueError( - "Invalid host index. Must be 0 <= index < %s" % - len(servers) - ) - host = None - return host - - -class SerializedRequestBody(typing_extensions.TypedDict, total=False): - body: typing.Union[str, bytes] - fields: typing.Tuple[typing.Union[RequestField, typing.Tuple[str, str]], ...] - - -class RequestBody(StyleFormSerializer, JSONDetector): - """ - A request body parameter - content: content_type to MediaType Schema info - """ - __json_encoder = JSONEncoder() - - def __init__( - self, - content: typing.Dict[str, MediaType], - required: bool = False, - ): - self.required = required - if len(content) == 0: - raise ValueError('Invalid value for content, the content dict must have >= 1 entry') - self.content = content - - def __serialize_json( - self, - in_data: typing.Any - ) -> typing.Dict[str, bytes]: - in_data = self.__json_encoder.default(in_data) - json_str = json.dumps(in_data, separators=(",", ":"), ensure_ascii=False).encode( - "utf-8" - ) - return dict(body=json_str) - - @staticmethod - def __serialize_text_plain(in_data: typing.Any) -> typing.Dict[str, str]: - if isinstance(in_data, frozendict.frozendict): - raise ValueError('Unable to serialize type frozendict.frozendict to text/plain') - elif isinstance(in_data, tuple): - raise ValueError('Unable to serialize type tuple to text/plain') - elif isinstance(in_data, NoneClass): - raise ValueError('Unable to serialize type NoneClass to text/plain') - elif isinstance(in_data, BoolClass): - raise ValueError('Unable to serialize type BoolClass to text/plain') - return dict(body=str(in_data)) - - def __multipart_json_item(self, key: str, value: Schema) -> RequestField: - json_value = self.__json_encoder.default(value) - request_field = RequestField(name=key, data=json.dumps(json_value)) - request_field.make_multipart(content_type='application/json') - return request_field - - def __multipart_form_item(self, key: str, value: Schema) -> RequestField: - if isinstance(value, str): - request_field = RequestField(name=key, data=str(value)) - request_field.make_multipart(content_type='text/plain') - elif isinstance(value, bytes): - request_field = RequestField(name=key, data=value) - request_field.make_multipart(content_type='application/octet-stream') - elif isinstance(value, FileIO): - # TODO use content.encoding to limit allowed content types if they are present - request_field = RequestField.from_tuples(key, (os.path.basename(value.name), value.read())) - value.close() - else: - request_field = self.__multipart_json_item(key=key, value=value) - return request_field - - def __serialize_multipart_form_data( - self, in_data: Schema - ) -> typing.Dict[str, typing.Tuple[RequestField, ...]]: - if not isinstance(in_data, frozendict.frozendict): - raise ValueError(f'Unable to serialize {in_data} to multipart/form-data because it is not a dict of data') - """ - In a multipart/form-data request body, each schema property, or each element of a schema array property, - takes a section in the payload with an internal header as defined by RFC7578. The serialization strategy - for each property of a multipart/form-data request body can be specified in an associated Encoding Object. - - When passing in multipart types, boundaries MAY be used to separate sections of the content being - transferred – thus, the following default Content-Types are defined for multipart: - - If the (object) property is a primitive, or an array of primitive values, the default Content-Type is text/plain - If the property is complex, or an array of complex values, the default Content-Type is application/json - Question: how is the array of primitives encoded? - If the property is a type: string with a contentEncoding, the default Content-Type is application/octet-stream - """ - fields = [] - for key, value in in_data.items(): - if isinstance(value, tuple): - if value: - # values use explode = True, so the code makes a RequestField for each item with name=key - for item in value: - request_field = self.__multipart_form_item(key=key, value=item) - fields.append(request_field) - else: - # send an empty array as json because exploding will not send it - request_field = self.__multipart_json_item(key=key, value=value) - fields.append(request_field) - else: - request_field = self.__multipart_form_item(key=key, value=value) - fields.append(request_field) - - return dict(fields=tuple(fields)) - - def __serialize_application_octet_stream(self, in_data: BinarySchema) -> typing.Dict[str, bytes]: - if isinstance(in_data, bytes): - return dict(body=in_data) - # FileIO type - result = dict(body=in_data.read()) - in_data.close() - return result - - def __serialize_application_x_www_form_data( - self, in_data: typing.Any - ) -> SerializedRequestBody: - """ - POST submission of form data in body - """ - if not isinstance(in_data, frozendict.frozendict): - raise ValueError( - f'Unable to serialize {in_data} to application/x-www-form-urlencoded because it is not a dict of data') - cast_in_data = self.__json_encoder.default(in_data) - value = self._serialize_form(cast_in_data, name='', explode=True, percent_encode=True) - return dict(body=value) - - def serialize( - self, in_data: typing.Any, content_type: str - ) -> SerializedRequestBody: - """ - If a str is returned then the result will be assigned to data when making the request - If a tuple is returned then the result will be used as fields input in encode_multipart_formdata - Return a tuple of - - The key of the return dict is - - body for application/json - - encode_multipart and fields for multipart/form-data - """ - media_type = self.content[content_type] - if isinstance(in_data, media_type.schema): - cast_in_data = in_data - elif isinstance(in_data, (dict, frozendict.frozendict)) and in_data: - cast_in_data = media_type.schema(**in_data) - else: - cast_in_data = media_type.schema(in_data) - # TODO check for and use encoding if it exists - # and content_type is multipart or application/x-www-form-urlencoded - if self._content_type_is_json(content_type): - return self.__serialize_json(cast_in_data) - elif content_type == 'text/plain': - return self.__serialize_text_plain(cast_in_data) - elif content_type == 'multipart/form-data': - return self.__serialize_multipart_form_data(cast_in_data) - elif content_type == 'application/x-www-form-urlencoded': - return self.__serialize_application_x_www_form_data(cast_in_data) - elif content_type == 'application/octet-stream': - return self.__serialize_application_octet_stream(cast_in_data) - raise NotImplementedError('Serialization has not yet been implemented for {}'.format(content_type)) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/path_to_api.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/path_to_api.py deleted file mode 100644 index 8a75c50c3ee..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/path_to_api.py +++ /dev/null @@ -1,536 +0,0 @@ -import typing_extensions - -from unit_test_api.paths import PathValues -from unit_test_api.apis.paths.request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body import RequestBodyPostAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody -from unit_test_api.apis.paths.response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types import ResponseBodyPostAdditionalpropertiesAllowsASchemaWhichShouldValidateResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_additionalproperties_can_exist_by_itself_request_body import RequestBodyPostAdditionalpropertiesCanExistByItselfRequestBody -from unit_test_api.apis.paths.response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types import ResponseBodyPostAdditionalpropertiesCanExistByItselfResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_additionalproperties_are_allowed_by_default_request_body import RequestBodyPostAdditionalpropertiesAreAllowedByDefaultRequestBody -from unit_test_api.apis.paths.response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types import ResponseBodyPostAdditionalpropertiesAreAllowedByDefaultResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_additionalproperties_should_not_look_in_applicators_request_body import RequestBodyPostAdditionalpropertiesShouldNotLookInApplicatorsRequestBody -from unit_test_api.apis.paths.response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types import ResponseBodyPostAdditionalpropertiesShouldNotLookInApplicatorsResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_allof_request_body import RequestBodyPostAllofRequestBody -from unit_test_api.apis.paths.response_body_post_allof_response_body_for_content_types import ResponseBodyPostAllofResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_allof_with_base_schema_request_body import RequestBodyPostAllofWithBaseSchemaRequestBody -from unit_test_api.apis.paths.response_body_post_allof_with_base_schema_response_body_for_content_types import ResponseBodyPostAllofWithBaseSchemaResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_allof_simple_types_request_body import RequestBodyPostAllofSimpleTypesRequestBody -from unit_test_api.apis.paths.response_body_post_allof_simple_types_response_body_for_content_types import ResponseBodyPostAllofSimpleTypesResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_allof_with_one_empty_schema_request_body import RequestBodyPostAllofWithOneEmptySchemaRequestBody -from unit_test_api.apis.paths.response_body_post_allof_with_one_empty_schema_response_body_for_content_types import ResponseBodyPostAllofWithOneEmptySchemaResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_allof_with_two_empty_schemas_request_body import RequestBodyPostAllofWithTwoEmptySchemasRequestBody -from unit_test_api.apis.paths.response_body_post_allof_with_two_empty_schemas_response_body_for_content_types import ResponseBodyPostAllofWithTwoEmptySchemasResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_allof_with_the_first_empty_schema_request_body import RequestBodyPostAllofWithTheFirstEmptySchemaRequestBody -from unit_test_api.apis.paths.response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types import ResponseBodyPostAllofWithTheFirstEmptySchemaResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_allof_with_the_last_empty_schema_request_body import RequestBodyPostAllofWithTheLastEmptySchemaRequestBody -from unit_test_api.apis.paths.response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types import ResponseBodyPostAllofWithTheLastEmptySchemaResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_nested_allof_to_check_validation_semantics_request_body import RequestBodyPostNestedAllofToCheckValidationSemanticsRequestBody -from unit_test_api.apis.paths.response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types import ResponseBodyPostNestedAllofToCheckValidationSemanticsResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_allof_combined_with_anyof_oneof_request_body import RequestBodyPostAllofCombinedWithAnyofOneofRequestBody -from unit_test_api.apis.paths.response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types import ResponseBodyPostAllofCombinedWithAnyofOneofResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_anyof_request_body import RequestBodyPostAnyofRequestBody -from unit_test_api.apis.paths.response_body_post_anyof_response_body_for_content_types import ResponseBodyPostAnyofResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_anyof_with_base_schema_request_body import RequestBodyPostAnyofWithBaseSchemaRequestBody -from unit_test_api.apis.paths.response_body_post_anyof_with_base_schema_response_body_for_content_types import ResponseBodyPostAnyofWithBaseSchemaResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_anyof_complex_types_request_body import RequestBodyPostAnyofComplexTypesRequestBody -from unit_test_api.apis.paths.response_body_post_anyof_complex_types_response_body_for_content_types import ResponseBodyPostAnyofComplexTypesResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_anyof_with_one_empty_schema_request_body import RequestBodyPostAnyofWithOneEmptySchemaRequestBody -from unit_test_api.apis.paths.response_body_post_anyof_with_one_empty_schema_response_body_for_content_types import ResponseBodyPostAnyofWithOneEmptySchemaResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_nested_anyof_to_check_validation_semantics_request_body import RequestBodyPostNestedAnyofToCheckValidationSemanticsRequestBody -from unit_test_api.apis.paths.response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types import ResponseBodyPostNestedAnyofToCheckValidationSemanticsResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_invalid_string_value_for_default_request_body import RequestBodyPostInvalidStringValueForDefaultRequestBody -from unit_test_api.apis.paths.response_body_post_invalid_string_value_for_default_response_body_for_content_types import ResponseBodyPostInvalidStringValueForDefaultResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body import RequestBodyPostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody -from unit_test_api.apis.paths.response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types import ResponseBodyPostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_simple_enum_validation_request_body import RequestBodyPostSimpleEnumValidationRequestBody -from unit_test_api.apis.paths.response_body_post_simple_enum_validation_response_body_for_content_types import ResponseBodyPostSimpleEnumValidationResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_enums_in_properties_request_body import RequestBodyPostEnumsInPropertiesRequestBody -from unit_test_api.apis.paths.response_body_post_enums_in_properties_response_body_for_content_types import ResponseBodyPostEnumsInPropertiesResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_enum_with_escaped_characters_request_body import RequestBodyPostEnumWithEscapedCharactersRequestBody -from unit_test_api.apis.paths.response_body_post_enum_with_escaped_characters_response_body_for_content_types import ResponseBodyPostEnumWithEscapedCharactersResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_enum_with_false_does_not_match0_request_body import RequestBodyPostEnumWithFalseDoesNotMatch0RequestBody -from unit_test_api.apis.paths.response_body_post_enum_with_false_does_not_match0_response_body_for_content_types import ResponseBodyPostEnumWithFalseDoesNotMatch0ResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_enum_with_true_does_not_match1_request_body import RequestBodyPostEnumWithTrueDoesNotMatch1RequestBody -from unit_test_api.apis.paths.response_body_post_enum_with_true_does_not_match1_response_body_for_content_types import ResponseBodyPostEnumWithTrueDoesNotMatch1ResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_enum_with0_does_not_match_false_request_body import RequestBodyPostEnumWith0DoesNotMatchFalseRequestBody -from unit_test_api.apis.paths.response_body_post_enum_with0_does_not_match_false_response_body_for_content_types import ResponseBodyPostEnumWith0DoesNotMatchFalseResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_enum_with1_does_not_match_true_request_body import RequestBodyPostEnumWith1DoesNotMatchTrueRequestBody -from unit_test_api.apis.paths.response_body_post_enum_with1_does_not_match_true_response_body_for_content_types import ResponseBodyPostEnumWith1DoesNotMatchTrueResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_nul_characters_in_strings_request_body import RequestBodyPostNulCharactersInStringsRequestBody -from unit_test_api.apis.paths.response_body_post_nul_characters_in_strings_response_body_for_content_types import ResponseBodyPostNulCharactersInStringsResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_email_format_request_body import RequestBodyPostEmailFormatRequestBody -from unit_test_api.apis.paths.response_body_post_email_format_response_body_for_content_types import ResponseBodyPostEmailFormatResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_ipv4_format_request_body import RequestBodyPostIpv4FormatRequestBody -from unit_test_api.apis.paths.response_body_post_ipv4_format_response_body_for_content_types import ResponseBodyPostIpv4FormatResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_ipv6_format_request_body import RequestBodyPostIpv6FormatRequestBody -from unit_test_api.apis.paths.response_body_post_ipv6_format_response_body_for_content_types import ResponseBodyPostIpv6FormatResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_hostname_format_request_body import RequestBodyPostHostnameFormatRequestBody -from unit_test_api.apis.paths.response_body_post_hostname_format_response_body_for_content_types import ResponseBodyPostHostnameFormatResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_date_time_format_request_body import RequestBodyPostDateTimeFormatRequestBody -from unit_test_api.apis.paths.response_body_post_date_time_format_response_body_for_content_types import ResponseBodyPostDateTimeFormatResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_json_pointer_format_request_body import RequestBodyPostJsonPointerFormatRequestBody -from unit_test_api.apis.paths.response_body_post_json_pointer_format_response_body_for_content_types import ResponseBodyPostJsonPointerFormatResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_uri_format_request_body import RequestBodyPostUriFormatRequestBody -from unit_test_api.apis.paths.response_body_post_uri_format_response_body_for_content_types import ResponseBodyPostUriFormatResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_uri_reference_format_request_body import RequestBodyPostUriReferenceFormatRequestBody -from unit_test_api.apis.paths.response_body_post_uri_reference_format_response_body_for_content_types import ResponseBodyPostUriReferenceFormatResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_uri_template_format_request_body import RequestBodyPostUriTemplateFormatRequestBody -from unit_test_api.apis.paths.response_body_post_uri_template_format_response_body_for_content_types import ResponseBodyPostUriTemplateFormatResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_nested_items_request_body import RequestBodyPostNestedItemsRequestBody -from unit_test_api.apis.paths.response_body_post_nested_items_response_body_for_content_types import ResponseBodyPostNestedItemsResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_maximum_validation_request_body import RequestBodyPostMaximumValidationRequestBody -from unit_test_api.apis.paths.response_body_post_maximum_validation_response_body_for_content_types import ResponseBodyPostMaximumValidationResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_maximum_validation_with_unsigned_integer_request_body import RequestBodyPostMaximumValidationWithUnsignedIntegerRequestBody -from unit_test_api.apis.paths.response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types import ResponseBodyPostMaximumValidationWithUnsignedIntegerResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_maxitems_validation_request_body import RequestBodyPostMaxitemsValidationRequestBody -from unit_test_api.apis.paths.response_body_post_maxitems_validation_response_body_for_content_types import ResponseBodyPostMaxitemsValidationResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_maxlength_validation_request_body import RequestBodyPostMaxlengthValidationRequestBody -from unit_test_api.apis.paths.response_body_post_maxlength_validation_response_body_for_content_types import ResponseBodyPostMaxlengthValidationResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_maxproperties_validation_request_body import RequestBodyPostMaxpropertiesValidationRequestBody -from unit_test_api.apis.paths.response_body_post_maxproperties_validation_response_body_for_content_types import ResponseBodyPostMaxpropertiesValidationResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_maxproperties0_means_the_object_is_empty_request_body import RequestBodyPostMaxproperties0MeansTheObjectIsEmptyRequestBody -from unit_test_api.apis.paths.response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types import ResponseBodyPostMaxproperties0MeansTheObjectIsEmptyResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_minimum_validation_request_body import RequestBodyPostMinimumValidationRequestBody -from unit_test_api.apis.paths.response_body_post_minimum_validation_response_body_for_content_types import ResponseBodyPostMinimumValidationResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_minimum_validation_with_signed_integer_request_body import RequestBodyPostMinimumValidationWithSignedIntegerRequestBody -from unit_test_api.apis.paths.response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types import ResponseBodyPostMinimumValidationWithSignedIntegerResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_minitems_validation_request_body import RequestBodyPostMinitemsValidationRequestBody -from unit_test_api.apis.paths.response_body_post_minitems_validation_response_body_for_content_types import ResponseBodyPostMinitemsValidationResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_minlength_validation_request_body import RequestBodyPostMinlengthValidationRequestBody -from unit_test_api.apis.paths.response_body_post_minlength_validation_response_body_for_content_types import ResponseBodyPostMinlengthValidationResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_minproperties_validation_request_body import RequestBodyPostMinpropertiesValidationRequestBody -from unit_test_api.apis.paths.response_body_post_minproperties_validation_response_body_for_content_types import ResponseBodyPostMinpropertiesValidationResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_by_int_request_body import RequestBodyPostByIntRequestBody -from unit_test_api.apis.paths.response_body_post_by_int_response_body_for_content_types import ResponseBodyPostByIntResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_by_number_request_body import RequestBodyPostByNumberRequestBody -from unit_test_api.apis.paths.response_body_post_by_number_response_body_for_content_types import ResponseBodyPostByNumberResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_by_small_number_request_body import RequestBodyPostBySmallNumberRequestBody -from unit_test_api.apis.paths.response_body_post_by_small_number_response_body_for_content_types import ResponseBodyPostBySmallNumberResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body import RequestBodyPostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody -from unit_test_api.apis.paths.response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types import ResponseBodyPostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_not_request_body import RequestBodyPostNotRequestBody -from unit_test_api.apis.paths.response_body_post_not_response_body_for_content_types import ResponseBodyPostNotResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_not_more_complex_schema_request_body import RequestBodyPostNotMoreComplexSchemaRequestBody -from unit_test_api.apis.paths.response_body_post_not_more_complex_schema_response_body_for_content_types import ResponseBodyPostNotMoreComplexSchemaResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_forbidden_property_request_body import RequestBodyPostForbiddenPropertyRequestBody -from unit_test_api.apis.paths.response_body_post_forbidden_property_response_body_for_content_types import ResponseBodyPostForbiddenPropertyResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_oneof_request_body import RequestBodyPostOneofRequestBody -from unit_test_api.apis.paths.response_body_post_oneof_response_body_for_content_types import ResponseBodyPostOneofResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_oneof_with_base_schema_request_body import RequestBodyPostOneofWithBaseSchemaRequestBody -from unit_test_api.apis.paths.response_body_post_oneof_with_base_schema_response_body_for_content_types import ResponseBodyPostOneofWithBaseSchemaResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_oneof_complex_types_request_body import RequestBodyPostOneofComplexTypesRequestBody -from unit_test_api.apis.paths.response_body_post_oneof_complex_types_response_body_for_content_types import ResponseBodyPostOneofComplexTypesResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_oneof_with_empty_schema_request_body import RequestBodyPostOneofWithEmptySchemaRequestBody -from unit_test_api.apis.paths.response_body_post_oneof_with_empty_schema_response_body_for_content_types import ResponseBodyPostOneofWithEmptySchemaResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_oneof_with_required_request_body import RequestBodyPostOneofWithRequiredRequestBody -from unit_test_api.apis.paths.response_body_post_oneof_with_required_response_body_for_content_types import ResponseBodyPostOneofWithRequiredResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_nested_oneof_to_check_validation_semantics_request_body import RequestBodyPostNestedOneofToCheckValidationSemanticsRequestBody -from unit_test_api.apis.paths.response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types import ResponseBodyPostNestedOneofToCheckValidationSemanticsResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_pattern_validation_request_body import RequestBodyPostPatternValidationRequestBody -from unit_test_api.apis.paths.response_body_post_pattern_validation_response_body_for_content_types import ResponseBodyPostPatternValidationResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_pattern_is_not_anchored_request_body import RequestBodyPostPatternIsNotAnchoredRequestBody -from unit_test_api.apis.paths.response_body_post_pattern_is_not_anchored_response_body_for_content_types import ResponseBodyPostPatternIsNotAnchoredResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_object_properties_validation_request_body import RequestBodyPostObjectPropertiesValidationRequestBody -from unit_test_api.apis.paths.response_body_post_object_properties_validation_response_body_for_content_types import ResponseBodyPostObjectPropertiesValidationResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_properties_with_escaped_characters_request_body import RequestBodyPostPropertiesWithEscapedCharactersRequestBody -from unit_test_api.apis.paths.response_body_post_properties_with_escaped_characters_response_body_for_content_types import ResponseBodyPostPropertiesWithEscapedCharactersResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_property_named_ref_that_is_not_a_reference_request_body import RequestBodyPostPropertyNamedRefThatIsNotAReferenceRequestBody -from unit_test_api.apis.paths.response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types import ResponseBodyPostPropertyNamedRefThatIsNotAReferenceResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_ref_in_additionalproperties_request_body import RequestBodyPostRefInAdditionalpropertiesRequestBody -from unit_test_api.apis.paths.response_body_post_ref_in_additionalproperties_response_body_for_content_types import ResponseBodyPostRefInAdditionalpropertiesResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_ref_in_items_request_body import RequestBodyPostRefInItemsRequestBody -from unit_test_api.apis.paths.response_body_post_ref_in_items_response_body_for_content_types import ResponseBodyPostRefInItemsResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_ref_in_property_request_body import RequestBodyPostRefInPropertyRequestBody -from unit_test_api.apis.paths.response_body_post_ref_in_property_response_body_for_content_types import ResponseBodyPostRefInPropertyResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_ref_in_allof_request_body import RequestBodyPostRefInAllofRequestBody -from unit_test_api.apis.paths.response_body_post_ref_in_allof_response_body_for_content_types import ResponseBodyPostRefInAllofResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_ref_in_oneof_request_body import RequestBodyPostRefInOneofRequestBody -from unit_test_api.apis.paths.response_body_post_ref_in_oneof_response_body_for_content_types import ResponseBodyPostRefInOneofResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_ref_in_anyof_request_body import RequestBodyPostRefInAnyofRequestBody -from unit_test_api.apis.paths.response_body_post_ref_in_anyof_response_body_for_content_types import ResponseBodyPostRefInAnyofResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_ref_in_not_request_body import RequestBodyPostRefInNotRequestBody -from unit_test_api.apis.paths.response_body_post_ref_in_not_response_body_for_content_types import ResponseBodyPostRefInNotResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_required_validation_request_body import RequestBodyPostRequiredValidationRequestBody -from unit_test_api.apis.paths.response_body_post_required_validation_response_body_for_content_types import ResponseBodyPostRequiredValidationResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_required_default_validation_request_body import RequestBodyPostRequiredDefaultValidationRequestBody -from unit_test_api.apis.paths.response_body_post_required_default_validation_response_body_for_content_types import ResponseBodyPostRequiredDefaultValidationResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_required_with_empty_array_request_body import RequestBodyPostRequiredWithEmptyArrayRequestBody -from unit_test_api.apis.paths.response_body_post_required_with_empty_array_response_body_for_content_types import ResponseBodyPostRequiredWithEmptyArrayResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_required_with_escaped_characters_request_body import RequestBodyPostRequiredWithEscapedCharactersRequestBody -from unit_test_api.apis.paths.response_body_post_required_with_escaped_characters_response_body_for_content_types import ResponseBodyPostRequiredWithEscapedCharactersResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_integer_type_matches_integers_request_body import RequestBodyPostIntegerTypeMatchesIntegersRequestBody -from unit_test_api.apis.paths.response_body_post_integer_type_matches_integers_response_body_for_content_types import ResponseBodyPostIntegerTypeMatchesIntegersResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_number_type_matches_numbers_request_body import RequestBodyPostNumberTypeMatchesNumbersRequestBody -from unit_test_api.apis.paths.response_body_post_number_type_matches_numbers_response_body_for_content_types import ResponseBodyPostNumberTypeMatchesNumbersResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_string_type_matches_strings_request_body import RequestBodyPostStringTypeMatchesStringsRequestBody -from unit_test_api.apis.paths.response_body_post_string_type_matches_strings_response_body_for_content_types import ResponseBodyPostStringTypeMatchesStringsResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_object_type_matches_objects_request_body import RequestBodyPostObjectTypeMatchesObjectsRequestBody -from unit_test_api.apis.paths.response_body_post_object_type_matches_objects_response_body_for_content_types import ResponseBodyPostObjectTypeMatchesObjectsResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_boolean_type_matches_booleans_request_body import RequestBodyPostBooleanTypeMatchesBooleansRequestBody -from unit_test_api.apis.paths.response_body_post_boolean_type_matches_booleans_response_body_for_content_types import ResponseBodyPostBooleanTypeMatchesBooleansResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_null_type_matches_only_the_null_object_request_body import RequestBodyPostNullTypeMatchesOnlyTheNullObjectRequestBody -from unit_test_api.apis.paths.response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types import ResponseBodyPostNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_array_type_matches_arrays_request_body import RequestBodyPostArrayTypeMatchesArraysRequestBody -from unit_test_api.apis.paths.response_body_post_array_type_matches_arrays_response_body_for_content_types import ResponseBodyPostArrayTypeMatchesArraysResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_uniqueitems_validation_request_body import RequestBodyPostUniqueitemsValidationRequestBody -from unit_test_api.apis.paths.response_body_post_uniqueitems_validation_response_body_for_content_types import ResponseBodyPostUniqueitemsValidationResponseBodyForContentTypes -from unit_test_api.apis.paths.request_body_post_uniqueitems_false_validation_request_body import RequestBodyPostUniqueitemsFalseValidationRequestBody -from unit_test_api.apis.paths.response_body_post_uniqueitems_false_validation_response_body_for_content_types import ResponseBodyPostUniqueitemsFalseValidationResponseBodyForContentTypes - -PathToApi = typing_extensions.TypedDict( - 'PathToApi', - { - PathValues.REQUEST_BODY_POST_ADDITIONALPROPERTIES_ALLOWS_ASCHEMA_WHICH_SHOULD_VALIDATE_REQUEST_BODY: RequestBodyPostAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody, - PathValues.RESPONSE_BODY_POST_ADDITIONALPROPERTIES_ALLOWS_ASCHEMA_WHICH_SHOULD_VALIDATE_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostAdditionalpropertiesAllowsASchemaWhichShouldValidateResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_ADDITIONALPROPERTIES_CAN_EXIST_BY_ITSELF_REQUEST_BODY: RequestBodyPostAdditionalpropertiesCanExistByItselfRequestBody, - PathValues.RESPONSE_BODY_POST_ADDITIONALPROPERTIES_CAN_EXIST_BY_ITSELF_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostAdditionalpropertiesCanExistByItselfResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_ADDITIONALPROPERTIES_ARE_ALLOWED_BY_DEFAULT_REQUEST_BODY: RequestBodyPostAdditionalpropertiesAreAllowedByDefaultRequestBody, - PathValues.RESPONSE_BODY_POST_ADDITIONALPROPERTIES_ARE_ALLOWED_BY_DEFAULT_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostAdditionalpropertiesAreAllowedByDefaultResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_ADDITIONALPROPERTIES_SHOULD_NOT_LOOK_IN_APPLICATORS_REQUEST_BODY: RequestBodyPostAdditionalpropertiesShouldNotLookInApplicatorsRequestBody, - PathValues.RESPONSE_BODY_POST_ADDITIONALPROPERTIES_SHOULD_NOT_LOOK_IN_APPLICATORS_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostAdditionalpropertiesShouldNotLookInApplicatorsResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_ALLOF_REQUEST_BODY: RequestBodyPostAllofRequestBody, - PathValues.RESPONSE_BODY_POST_ALLOF_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostAllofResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_ALLOF_WITH_BASE_SCHEMA_REQUEST_BODY: RequestBodyPostAllofWithBaseSchemaRequestBody, - PathValues.RESPONSE_BODY_POST_ALLOF_WITH_BASE_SCHEMA_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostAllofWithBaseSchemaResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_ALLOF_SIMPLE_TYPES_REQUEST_BODY: RequestBodyPostAllofSimpleTypesRequestBody, - PathValues.RESPONSE_BODY_POST_ALLOF_SIMPLE_TYPES_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostAllofSimpleTypesResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_ALLOF_WITH_ONE_EMPTY_SCHEMA_REQUEST_BODY: RequestBodyPostAllofWithOneEmptySchemaRequestBody, - PathValues.RESPONSE_BODY_POST_ALLOF_WITH_ONE_EMPTY_SCHEMA_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostAllofWithOneEmptySchemaResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_ALLOF_WITH_TWO_EMPTY_SCHEMAS_REQUEST_BODY: RequestBodyPostAllofWithTwoEmptySchemasRequestBody, - PathValues.RESPONSE_BODY_POST_ALLOF_WITH_TWO_EMPTY_SCHEMAS_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostAllofWithTwoEmptySchemasResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_ALLOF_WITH_THE_FIRST_EMPTY_SCHEMA_REQUEST_BODY: RequestBodyPostAllofWithTheFirstEmptySchemaRequestBody, - PathValues.RESPONSE_BODY_POST_ALLOF_WITH_THE_FIRST_EMPTY_SCHEMA_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostAllofWithTheFirstEmptySchemaResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_ALLOF_WITH_THE_LAST_EMPTY_SCHEMA_REQUEST_BODY: RequestBodyPostAllofWithTheLastEmptySchemaRequestBody, - PathValues.RESPONSE_BODY_POST_ALLOF_WITH_THE_LAST_EMPTY_SCHEMA_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostAllofWithTheLastEmptySchemaResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_NESTED_ALLOF_TO_CHECK_VALIDATION_SEMANTICS_REQUEST_BODY: RequestBodyPostNestedAllofToCheckValidationSemanticsRequestBody, - PathValues.RESPONSE_BODY_POST_NESTED_ALLOF_TO_CHECK_VALIDATION_SEMANTICS_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostNestedAllofToCheckValidationSemanticsResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_ALLOF_COMBINED_WITH_ANYOF_ONEOF_REQUEST_BODY: RequestBodyPostAllofCombinedWithAnyofOneofRequestBody, - PathValues.RESPONSE_BODY_POST_ALLOF_COMBINED_WITH_ANYOF_ONEOF_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostAllofCombinedWithAnyofOneofResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_ANYOF_REQUEST_BODY: RequestBodyPostAnyofRequestBody, - PathValues.RESPONSE_BODY_POST_ANYOF_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostAnyofResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_ANYOF_WITH_BASE_SCHEMA_REQUEST_BODY: RequestBodyPostAnyofWithBaseSchemaRequestBody, - PathValues.RESPONSE_BODY_POST_ANYOF_WITH_BASE_SCHEMA_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostAnyofWithBaseSchemaResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_ANYOF_COMPLEX_TYPES_REQUEST_BODY: RequestBodyPostAnyofComplexTypesRequestBody, - PathValues.RESPONSE_BODY_POST_ANYOF_COMPLEX_TYPES_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostAnyofComplexTypesResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_ANYOF_WITH_ONE_EMPTY_SCHEMA_REQUEST_BODY: RequestBodyPostAnyofWithOneEmptySchemaRequestBody, - PathValues.RESPONSE_BODY_POST_ANYOF_WITH_ONE_EMPTY_SCHEMA_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostAnyofWithOneEmptySchemaResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_NESTED_ANYOF_TO_CHECK_VALIDATION_SEMANTICS_REQUEST_BODY: RequestBodyPostNestedAnyofToCheckValidationSemanticsRequestBody, - PathValues.RESPONSE_BODY_POST_NESTED_ANYOF_TO_CHECK_VALIDATION_SEMANTICS_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostNestedAnyofToCheckValidationSemanticsResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_INVALID_STRING_VALUE_FOR_DEFAULT_REQUEST_BODY: RequestBodyPostInvalidStringValueForDefaultRequestBody, - PathValues.RESPONSE_BODY_POST_INVALID_STRING_VALUE_FOR_DEFAULT_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostInvalidStringValueForDefaultResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_THE_DEFAULT_KEYWORD_DOES_NOT_DO_ANYTHING_IF_THE_PROPERTY_IS_MISSING_REQUEST_BODY: RequestBodyPostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody, - PathValues.RESPONSE_BODY_POST_THE_DEFAULT_KEYWORD_DOES_NOT_DO_ANYTHING_IF_THE_PROPERTY_IS_MISSING_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_SIMPLE_ENUM_VALIDATION_REQUEST_BODY: RequestBodyPostSimpleEnumValidationRequestBody, - PathValues.RESPONSE_BODY_POST_SIMPLE_ENUM_VALIDATION_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostSimpleEnumValidationResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_ENUMS_IN_PROPERTIES_REQUEST_BODY: RequestBodyPostEnumsInPropertiesRequestBody, - PathValues.RESPONSE_BODY_POST_ENUMS_IN_PROPERTIES_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostEnumsInPropertiesResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_ENUM_WITH_ESCAPED_CHARACTERS_REQUEST_BODY: RequestBodyPostEnumWithEscapedCharactersRequestBody, - PathValues.RESPONSE_BODY_POST_ENUM_WITH_ESCAPED_CHARACTERS_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostEnumWithEscapedCharactersResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_ENUM_WITH_FALSE_DOES_NOT_MATCH0REQUEST_BODY: RequestBodyPostEnumWithFalseDoesNotMatch0RequestBody, - PathValues.RESPONSE_BODY_POST_ENUM_WITH_FALSE_DOES_NOT_MATCH0RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostEnumWithFalseDoesNotMatch0ResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_ENUM_WITH_TRUE_DOES_NOT_MATCH1REQUEST_BODY: RequestBodyPostEnumWithTrueDoesNotMatch1RequestBody, - PathValues.RESPONSE_BODY_POST_ENUM_WITH_TRUE_DOES_NOT_MATCH1RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostEnumWithTrueDoesNotMatch1ResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_ENUM_WITH0DOES_NOT_MATCH_FALSE_REQUEST_BODY: RequestBodyPostEnumWith0DoesNotMatchFalseRequestBody, - PathValues.RESPONSE_BODY_POST_ENUM_WITH0DOES_NOT_MATCH_FALSE_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostEnumWith0DoesNotMatchFalseResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_ENUM_WITH1DOES_NOT_MATCH_TRUE_REQUEST_BODY: RequestBodyPostEnumWith1DoesNotMatchTrueRequestBody, - PathValues.RESPONSE_BODY_POST_ENUM_WITH1DOES_NOT_MATCH_TRUE_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostEnumWith1DoesNotMatchTrueResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_NUL_CHARACTERS_IN_STRINGS_REQUEST_BODY: RequestBodyPostNulCharactersInStringsRequestBody, - PathValues.RESPONSE_BODY_POST_NUL_CHARACTERS_IN_STRINGS_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostNulCharactersInStringsResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_EMAIL_FORMAT_REQUEST_BODY: RequestBodyPostEmailFormatRequestBody, - PathValues.RESPONSE_BODY_POST_EMAIL_FORMAT_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostEmailFormatResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_IPV4FORMAT_REQUEST_BODY: RequestBodyPostIpv4FormatRequestBody, - PathValues.RESPONSE_BODY_POST_IPV4FORMAT_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostIpv4FormatResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_IPV6FORMAT_REQUEST_BODY: RequestBodyPostIpv6FormatRequestBody, - PathValues.RESPONSE_BODY_POST_IPV6FORMAT_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostIpv6FormatResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_HOSTNAME_FORMAT_REQUEST_BODY: RequestBodyPostHostnameFormatRequestBody, - PathValues.RESPONSE_BODY_POST_HOSTNAME_FORMAT_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostHostnameFormatResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_DATE_TIME_FORMAT_REQUEST_BODY: RequestBodyPostDateTimeFormatRequestBody, - PathValues.RESPONSE_BODY_POST_DATE_TIME_FORMAT_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostDateTimeFormatResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_JSON_POINTER_FORMAT_REQUEST_BODY: RequestBodyPostJsonPointerFormatRequestBody, - PathValues.RESPONSE_BODY_POST_JSON_POINTER_FORMAT_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostJsonPointerFormatResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_URI_FORMAT_REQUEST_BODY: RequestBodyPostUriFormatRequestBody, - PathValues.RESPONSE_BODY_POST_URI_FORMAT_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostUriFormatResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_URI_REFERENCE_FORMAT_REQUEST_BODY: RequestBodyPostUriReferenceFormatRequestBody, - PathValues.RESPONSE_BODY_POST_URI_REFERENCE_FORMAT_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostUriReferenceFormatResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_URI_TEMPLATE_FORMAT_REQUEST_BODY: RequestBodyPostUriTemplateFormatRequestBody, - PathValues.RESPONSE_BODY_POST_URI_TEMPLATE_FORMAT_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostUriTemplateFormatResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_NESTED_ITEMS_REQUEST_BODY: RequestBodyPostNestedItemsRequestBody, - PathValues.RESPONSE_BODY_POST_NESTED_ITEMS_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostNestedItemsResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_MAXIMUM_VALIDATION_REQUEST_BODY: RequestBodyPostMaximumValidationRequestBody, - PathValues.RESPONSE_BODY_POST_MAXIMUM_VALIDATION_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostMaximumValidationResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_MAXIMUM_VALIDATION_WITH_UNSIGNED_INTEGER_REQUEST_BODY: RequestBodyPostMaximumValidationWithUnsignedIntegerRequestBody, - PathValues.RESPONSE_BODY_POST_MAXIMUM_VALIDATION_WITH_UNSIGNED_INTEGER_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostMaximumValidationWithUnsignedIntegerResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_MAXITEMS_VALIDATION_REQUEST_BODY: RequestBodyPostMaxitemsValidationRequestBody, - PathValues.RESPONSE_BODY_POST_MAXITEMS_VALIDATION_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostMaxitemsValidationResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_MAXLENGTH_VALIDATION_REQUEST_BODY: RequestBodyPostMaxlengthValidationRequestBody, - PathValues.RESPONSE_BODY_POST_MAXLENGTH_VALIDATION_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostMaxlengthValidationResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_MAXPROPERTIES_VALIDATION_REQUEST_BODY: RequestBodyPostMaxpropertiesValidationRequestBody, - PathValues.RESPONSE_BODY_POST_MAXPROPERTIES_VALIDATION_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostMaxpropertiesValidationResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_MAXPROPERTIES0MEANS_THE_OBJECT_IS_EMPTY_REQUEST_BODY: RequestBodyPostMaxproperties0MeansTheObjectIsEmptyRequestBody, - PathValues.RESPONSE_BODY_POST_MAXPROPERTIES0MEANS_THE_OBJECT_IS_EMPTY_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostMaxproperties0MeansTheObjectIsEmptyResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_MINIMUM_VALIDATION_REQUEST_BODY: RequestBodyPostMinimumValidationRequestBody, - PathValues.RESPONSE_BODY_POST_MINIMUM_VALIDATION_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostMinimumValidationResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_MINIMUM_VALIDATION_WITH_SIGNED_INTEGER_REQUEST_BODY: RequestBodyPostMinimumValidationWithSignedIntegerRequestBody, - PathValues.RESPONSE_BODY_POST_MINIMUM_VALIDATION_WITH_SIGNED_INTEGER_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostMinimumValidationWithSignedIntegerResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_MINITEMS_VALIDATION_REQUEST_BODY: RequestBodyPostMinitemsValidationRequestBody, - PathValues.RESPONSE_BODY_POST_MINITEMS_VALIDATION_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostMinitemsValidationResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_MINLENGTH_VALIDATION_REQUEST_BODY: RequestBodyPostMinlengthValidationRequestBody, - PathValues.RESPONSE_BODY_POST_MINLENGTH_VALIDATION_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostMinlengthValidationResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_MINPROPERTIES_VALIDATION_REQUEST_BODY: RequestBodyPostMinpropertiesValidationRequestBody, - PathValues.RESPONSE_BODY_POST_MINPROPERTIES_VALIDATION_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostMinpropertiesValidationResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_BY_INT_REQUEST_BODY: RequestBodyPostByIntRequestBody, - PathValues.RESPONSE_BODY_POST_BY_INT_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostByIntResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_BY_NUMBER_REQUEST_BODY: RequestBodyPostByNumberRequestBody, - PathValues.RESPONSE_BODY_POST_BY_NUMBER_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostByNumberResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_BY_SMALL_NUMBER_REQUEST_BODY: RequestBodyPostBySmallNumberRequestBody, - PathValues.RESPONSE_BODY_POST_BY_SMALL_NUMBER_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostBySmallNumberResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_INVALID_INSTANCE_SHOULD_NOT_RAISE_ERROR_WHEN_FLOAT_DIVISION_INF_REQUEST_BODY: RequestBodyPostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody, - PathValues.RESPONSE_BODY_POST_INVALID_INSTANCE_SHOULD_NOT_RAISE_ERROR_WHEN_FLOAT_DIVISION_INF_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_NOT_REQUEST_BODY: RequestBodyPostNotRequestBody, - PathValues.RESPONSE_BODY_POST_NOT_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostNotResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_NOT_MORE_COMPLEX_SCHEMA_REQUEST_BODY: RequestBodyPostNotMoreComplexSchemaRequestBody, - PathValues.RESPONSE_BODY_POST_NOT_MORE_COMPLEX_SCHEMA_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostNotMoreComplexSchemaResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_FORBIDDEN_PROPERTY_REQUEST_BODY: RequestBodyPostForbiddenPropertyRequestBody, - PathValues.RESPONSE_BODY_POST_FORBIDDEN_PROPERTY_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostForbiddenPropertyResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_ONEOF_REQUEST_BODY: RequestBodyPostOneofRequestBody, - PathValues.RESPONSE_BODY_POST_ONEOF_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostOneofResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_ONEOF_WITH_BASE_SCHEMA_REQUEST_BODY: RequestBodyPostOneofWithBaseSchemaRequestBody, - PathValues.RESPONSE_BODY_POST_ONEOF_WITH_BASE_SCHEMA_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostOneofWithBaseSchemaResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_ONEOF_COMPLEX_TYPES_REQUEST_BODY: RequestBodyPostOneofComplexTypesRequestBody, - PathValues.RESPONSE_BODY_POST_ONEOF_COMPLEX_TYPES_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostOneofComplexTypesResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_ONEOF_WITH_EMPTY_SCHEMA_REQUEST_BODY: RequestBodyPostOneofWithEmptySchemaRequestBody, - PathValues.RESPONSE_BODY_POST_ONEOF_WITH_EMPTY_SCHEMA_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostOneofWithEmptySchemaResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_ONEOF_WITH_REQUIRED_REQUEST_BODY: RequestBodyPostOneofWithRequiredRequestBody, - PathValues.RESPONSE_BODY_POST_ONEOF_WITH_REQUIRED_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostOneofWithRequiredResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_NESTED_ONEOF_TO_CHECK_VALIDATION_SEMANTICS_REQUEST_BODY: RequestBodyPostNestedOneofToCheckValidationSemanticsRequestBody, - PathValues.RESPONSE_BODY_POST_NESTED_ONEOF_TO_CHECK_VALIDATION_SEMANTICS_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostNestedOneofToCheckValidationSemanticsResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_PATTERN_VALIDATION_REQUEST_BODY: RequestBodyPostPatternValidationRequestBody, - PathValues.RESPONSE_BODY_POST_PATTERN_VALIDATION_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostPatternValidationResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_PATTERN_IS_NOT_ANCHORED_REQUEST_BODY: RequestBodyPostPatternIsNotAnchoredRequestBody, - PathValues.RESPONSE_BODY_POST_PATTERN_IS_NOT_ANCHORED_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostPatternIsNotAnchoredResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_OBJECT_PROPERTIES_VALIDATION_REQUEST_BODY: RequestBodyPostObjectPropertiesValidationRequestBody, - PathValues.RESPONSE_BODY_POST_OBJECT_PROPERTIES_VALIDATION_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostObjectPropertiesValidationResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_PROPERTIES_WITH_ESCAPED_CHARACTERS_REQUEST_BODY: RequestBodyPostPropertiesWithEscapedCharactersRequestBody, - PathValues.RESPONSE_BODY_POST_PROPERTIES_WITH_ESCAPED_CHARACTERS_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostPropertiesWithEscapedCharactersResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_PROPERTY_NAMED_REF_THAT_IS_NOT_AREFERENCE_REQUEST_BODY: RequestBodyPostPropertyNamedRefThatIsNotAReferenceRequestBody, - PathValues.RESPONSE_BODY_POST_PROPERTY_NAMED_REF_THAT_IS_NOT_AREFERENCE_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostPropertyNamedRefThatIsNotAReferenceResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_REF_IN_ADDITIONALPROPERTIES_REQUEST_BODY: RequestBodyPostRefInAdditionalpropertiesRequestBody, - PathValues.RESPONSE_BODY_POST_REF_IN_ADDITIONALPROPERTIES_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostRefInAdditionalpropertiesResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_REF_IN_ITEMS_REQUEST_BODY: RequestBodyPostRefInItemsRequestBody, - PathValues.RESPONSE_BODY_POST_REF_IN_ITEMS_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostRefInItemsResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_REF_IN_PROPERTY_REQUEST_BODY: RequestBodyPostRefInPropertyRequestBody, - PathValues.RESPONSE_BODY_POST_REF_IN_PROPERTY_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostRefInPropertyResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_REF_IN_ALLOF_REQUEST_BODY: RequestBodyPostRefInAllofRequestBody, - PathValues.RESPONSE_BODY_POST_REF_IN_ALLOF_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostRefInAllofResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_REF_IN_ONEOF_REQUEST_BODY: RequestBodyPostRefInOneofRequestBody, - PathValues.RESPONSE_BODY_POST_REF_IN_ONEOF_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostRefInOneofResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_REF_IN_ANYOF_REQUEST_BODY: RequestBodyPostRefInAnyofRequestBody, - PathValues.RESPONSE_BODY_POST_REF_IN_ANYOF_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostRefInAnyofResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_REF_IN_NOT_REQUEST_BODY: RequestBodyPostRefInNotRequestBody, - PathValues.RESPONSE_BODY_POST_REF_IN_NOT_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostRefInNotResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_REQUIRED_VALIDATION_REQUEST_BODY: RequestBodyPostRequiredValidationRequestBody, - PathValues.RESPONSE_BODY_POST_REQUIRED_VALIDATION_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostRequiredValidationResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_REQUIRED_DEFAULT_VALIDATION_REQUEST_BODY: RequestBodyPostRequiredDefaultValidationRequestBody, - PathValues.RESPONSE_BODY_POST_REQUIRED_DEFAULT_VALIDATION_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostRequiredDefaultValidationResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_REQUIRED_WITH_EMPTY_ARRAY_REQUEST_BODY: RequestBodyPostRequiredWithEmptyArrayRequestBody, - PathValues.RESPONSE_BODY_POST_REQUIRED_WITH_EMPTY_ARRAY_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostRequiredWithEmptyArrayResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_REQUIRED_WITH_ESCAPED_CHARACTERS_REQUEST_BODY: RequestBodyPostRequiredWithEscapedCharactersRequestBody, - PathValues.RESPONSE_BODY_POST_REQUIRED_WITH_ESCAPED_CHARACTERS_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostRequiredWithEscapedCharactersResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_INTEGER_TYPE_MATCHES_INTEGERS_REQUEST_BODY: RequestBodyPostIntegerTypeMatchesIntegersRequestBody, - PathValues.RESPONSE_BODY_POST_INTEGER_TYPE_MATCHES_INTEGERS_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostIntegerTypeMatchesIntegersResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_NUMBER_TYPE_MATCHES_NUMBERS_REQUEST_BODY: RequestBodyPostNumberTypeMatchesNumbersRequestBody, - PathValues.RESPONSE_BODY_POST_NUMBER_TYPE_MATCHES_NUMBERS_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostNumberTypeMatchesNumbersResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_STRING_TYPE_MATCHES_STRINGS_REQUEST_BODY: RequestBodyPostStringTypeMatchesStringsRequestBody, - PathValues.RESPONSE_BODY_POST_STRING_TYPE_MATCHES_STRINGS_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostStringTypeMatchesStringsResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_OBJECT_TYPE_MATCHES_OBJECTS_REQUEST_BODY: RequestBodyPostObjectTypeMatchesObjectsRequestBody, - PathValues.RESPONSE_BODY_POST_OBJECT_TYPE_MATCHES_OBJECTS_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostObjectTypeMatchesObjectsResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_BOOLEAN_TYPE_MATCHES_BOOLEANS_REQUEST_BODY: RequestBodyPostBooleanTypeMatchesBooleansRequestBody, - PathValues.RESPONSE_BODY_POST_BOOLEAN_TYPE_MATCHES_BOOLEANS_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostBooleanTypeMatchesBooleansResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_NULL_TYPE_MATCHES_ONLY_THE_NULL_OBJECT_REQUEST_BODY: RequestBodyPostNullTypeMatchesOnlyTheNullObjectRequestBody, - PathValues.RESPONSE_BODY_POST_NULL_TYPE_MATCHES_ONLY_THE_NULL_OBJECT_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_ARRAY_TYPE_MATCHES_ARRAYS_REQUEST_BODY: RequestBodyPostArrayTypeMatchesArraysRequestBody, - PathValues.RESPONSE_BODY_POST_ARRAY_TYPE_MATCHES_ARRAYS_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostArrayTypeMatchesArraysResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_UNIQUEITEMS_VALIDATION_REQUEST_BODY: RequestBodyPostUniqueitemsValidationRequestBody, - PathValues.RESPONSE_BODY_POST_UNIQUEITEMS_VALIDATION_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostUniqueitemsValidationResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_UNIQUEITEMS_FALSE_VALIDATION_REQUEST_BODY: RequestBodyPostUniqueitemsFalseValidationRequestBody, - PathValues.RESPONSE_BODY_POST_UNIQUEITEMS_FALSE_VALIDATION_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostUniqueitemsFalseValidationResponseBodyForContentTypes, - } -) - -path_to_api = PathToApi( - { - PathValues.REQUEST_BODY_POST_ADDITIONALPROPERTIES_ALLOWS_ASCHEMA_WHICH_SHOULD_VALIDATE_REQUEST_BODY: RequestBodyPostAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody, - PathValues.RESPONSE_BODY_POST_ADDITIONALPROPERTIES_ALLOWS_ASCHEMA_WHICH_SHOULD_VALIDATE_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostAdditionalpropertiesAllowsASchemaWhichShouldValidateResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_ADDITIONALPROPERTIES_CAN_EXIST_BY_ITSELF_REQUEST_BODY: RequestBodyPostAdditionalpropertiesCanExistByItselfRequestBody, - PathValues.RESPONSE_BODY_POST_ADDITIONALPROPERTIES_CAN_EXIST_BY_ITSELF_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostAdditionalpropertiesCanExistByItselfResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_ADDITIONALPROPERTIES_ARE_ALLOWED_BY_DEFAULT_REQUEST_BODY: RequestBodyPostAdditionalpropertiesAreAllowedByDefaultRequestBody, - PathValues.RESPONSE_BODY_POST_ADDITIONALPROPERTIES_ARE_ALLOWED_BY_DEFAULT_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostAdditionalpropertiesAreAllowedByDefaultResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_ADDITIONALPROPERTIES_SHOULD_NOT_LOOK_IN_APPLICATORS_REQUEST_BODY: RequestBodyPostAdditionalpropertiesShouldNotLookInApplicatorsRequestBody, - PathValues.RESPONSE_BODY_POST_ADDITIONALPROPERTIES_SHOULD_NOT_LOOK_IN_APPLICATORS_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostAdditionalpropertiesShouldNotLookInApplicatorsResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_ALLOF_REQUEST_BODY: RequestBodyPostAllofRequestBody, - PathValues.RESPONSE_BODY_POST_ALLOF_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostAllofResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_ALLOF_WITH_BASE_SCHEMA_REQUEST_BODY: RequestBodyPostAllofWithBaseSchemaRequestBody, - PathValues.RESPONSE_BODY_POST_ALLOF_WITH_BASE_SCHEMA_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostAllofWithBaseSchemaResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_ALLOF_SIMPLE_TYPES_REQUEST_BODY: RequestBodyPostAllofSimpleTypesRequestBody, - PathValues.RESPONSE_BODY_POST_ALLOF_SIMPLE_TYPES_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostAllofSimpleTypesResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_ALLOF_WITH_ONE_EMPTY_SCHEMA_REQUEST_BODY: RequestBodyPostAllofWithOneEmptySchemaRequestBody, - PathValues.RESPONSE_BODY_POST_ALLOF_WITH_ONE_EMPTY_SCHEMA_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostAllofWithOneEmptySchemaResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_ALLOF_WITH_TWO_EMPTY_SCHEMAS_REQUEST_BODY: RequestBodyPostAllofWithTwoEmptySchemasRequestBody, - PathValues.RESPONSE_BODY_POST_ALLOF_WITH_TWO_EMPTY_SCHEMAS_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostAllofWithTwoEmptySchemasResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_ALLOF_WITH_THE_FIRST_EMPTY_SCHEMA_REQUEST_BODY: RequestBodyPostAllofWithTheFirstEmptySchemaRequestBody, - PathValues.RESPONSE_BODY_POST_ALLOF_WITH_THE_FIRST_EMPTY_SCHEMA_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostAllofWithTheFirstEmptySchemaResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_ALLOF_WITH_THE_LAST_EMPTY_SCHEMA_REQUEST_BODY: RequestBodyPostAllofWithTheLastEmptySchemaRequestBody, - PathValues.RESPONSE_BODY_POST_ALLOF_WITH_THE_LAST_EMPTY_SCHEMA_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostAllofWithTheLastEmptySchemaResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_NESTED_ALLOF_TO_CHECK_VALIDATION_SEMANTICS_REQUEST_BODY: RequestBodyPostNestedAllofToCheckValidationSemanticsRequestBody, - PathValues.RESPONSE_BODY_POST_NESTED_ALLOF_TO_CHECK_VALIDATION_SEMANTICS_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostNestedAllofToCheckValidationSemanticsResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_ALLOF_COMBINED_WITH_ANYOF_ONEOF_REQUEST_BODY: RequestBodyPostAllofCombinedWithAnyofOneofRequestBody, - PathValues.RESPONSE_BODY_POST_ALLOF_COMBINED_WITH_ANYOF_ONEOF_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostAllofCombinedWithAnyofOneofResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_ANYOF_REQUEST_BODY: RequestBodyPostAnyofRequestBody, - PathValues.RESPONSE_BODY_POST_ANYOF_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostAnyofResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_ANYOF_WITH_BASE_SCHEMA_REQUEST_BODY: RequestBodyPostAnyofWithBaseSchemaRequestBody, - PathValues.RESPONSE_BODY_POST_ANYOF_WITH_BASE_SCHEMA_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostAnyofWithBaseSchemaResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_ANYOF_COMPLEX_TYPES_REQUEST_BODY: RequestBodyPostAnyofComplexTypesRequestBody, - PathValues.RESPONSE_BODY_POST_ANYOF_COMPLEX_TYPES_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostAnyofComplexTypesResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_ANYOF_WITH_ONE_EMPTY_SCHEMA_REQUEST_BODY: RequestBodyPostAnyofWithOneEmptySchemaRequestBody, - PathValues.RESPONSE_BODY_POST_ANYOF_WITH_ONE_EMPTY_SCHEMA_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostAnyofWithOneEmptySchemaResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_NESTED_ANYOF_TO_CHECK_VALIDATION_SEMANTICS_REQUEST_BODY: RequestBodyPostNestedAnyofToCheckValidationSemanticsRequestBody, - PathValues.RESPONSE_BODY_POST_NESTED_ANYOF_TO_CHECK_VALIDATION_SEMANTICS_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostNestedAnyofToCheckValidationSemanticsResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_INVALID_STRING_VALUE_FOR_DEFAULT_REQUEST_BODY: RequestBodyPostInvalidStringValueForDefaultRequestBody, - PathValues.RESPONSE_BODY_POST_INVALID_STRING_VALUE_FOR_DEFAULT_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostInvalidStringValueForDefaultResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_THE_DEFAULT_KEYWORD_DOES_NOT_DO_ANYTHING_IF_THE_PROPERTY_IS_MISSING_REQUEST_BODY: RequestBodyPostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody, - PathValues.RESPONSE_BODY_POST_THE_DEFAULT_KEYWORD_DOES_NOT_DO_ANYTHING_IF_THE_PROPERTY_IS_MISSING_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_SIMPLE_ENUM_VALIDATION_REQUEST_BODY: RequestBodyPostSimpleEnumValidationRequestBody, - PathValues.RESPONSE_BODY_POST_SIMPLE_ENUM_VALIDATION_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostSimpleEnumValidationResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_ENUMS_IN_PROPERTIES_REQUEST_BODY: RequestBodyPostEnumsInPropertiesRequestBody, - PathValues.RESPONSE_BODY_POST_ENUMS_IN_PROPERTIES_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostEnumsInPropertiesResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_ENUM_WITH_ESCAPED_CHARACTERS_REQUEST_BODY: RequestBodyPostEnumWithEscapedCharactersRequestBody, - PathValues.RESPONSE_BODY_POST_ENUM_WITH_ESCAPED_CHARACTERS_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostEnumWithEscapedCharactersResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_ENUM_WITH_FALSE_DOES_NOT_MATCH0REQUEST_BODY: RequestBodyPostEnumWithFalseDoesNotMatch0RequestBody, - PathValues.RESPONSE_BODY_POST_ENUM_WITH_FALSE_DOES_NOT_MATCH0RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostEnumWithFalseDoesNotMatch0ResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_ENUM_WITH_TRUE_DOES_NOT_MATCH1REQUEST_BODY: RequestBodyPostEnumWithTrueDoesNotMatch1RequestBody, - PathValues.RESPONSE_BODY_POST_ENUM_WITH_TRUE_DOES_NOT_MATCH1RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostEnumWithTrueDoesNotMatch1ResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_ENUM_WITH0DOES_NOT_MATCH_FALSE_REQUEST_BODY: RequestBodyPostEnumWith0DoesNotMatchFalseRequestBody, - PathValues.RESPONSE_BODY_POST_ENUM_WITH0DOES_NOT_MATCH_FALSE_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostEnumWith0DoesNotMatchFalseResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_ENUM_WITH1DOES_NOT_MATCH_TRUE_REQUEST_BODY: RequestBodyPostEnumWith1DoesNotMatchTrueRequestBody, - PathValues.RESPONSE_BODY_POST_ENUM_WITH1DOES_NOT_MATCH_TRUE_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostEnumWith1DoesNotMatchTrueResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_NUL_CHARACTERS_IN_STRINGS_REQUEST_BODY: RequestBodyPostNulCharactersInStringsRequestBody, - PathValues.RESPONSE_BODY_POST_NUL_CHARACTERS_IN_STRINGS_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostNulCharactersInStringsResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_EMAIL_FORMAT_REQUEST_BODY: RequestBodyPostEmailFormatRequestBody, - PathValues.RESPONSE_BODY_POST_EMAIL_FORMAT_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostEmailFormatResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_IPV4FORMAT_REQUEST_BODY: RequestBodyPostIpv4FormatRequestBody, - PathValues.RESPONSE_BODY_POST_IPV4FORMAT_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostIpv4FormatResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_IPV6FORMAT_REQUEST_BODY: RequestBodyPostIpv6FormatRequestBody, - PathValues.RESPONSE_BODY_POST_IPV6FORMAT_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostIpv6FormatResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_HOSTNAME_FORMAT_REQUEST_BODY: RequestBodyPostHostnameFormatRequestBody, - PathValues.RESPONSE_BODY_POST_HOSTNAME_FORMAT_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostHostnameFormatResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_DATE_TIME_FORMAT_REQUEST_BODY: RequestBodyPostDateTimeFormatRequestBody, - PathValues.RESPONSE_BODY_POST_DATE_TIME_FORMAT_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostDateTimeFormatResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_JSON_POINTER_FORMAT_REQUEST_BODY: RequestBodyPostJsonPointerFormatRequestBody, - PathValues.RESPONSE_BODY_POST_JSON_POINTER_FORMAT_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostJsonPointerFormatResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_URI_FORMAT_REQUEST_BODY: RequestBodyPostUriFormatRequestBody, - PathValues.RESPONSE_BODY_POST_URI_FORMAT_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostUriFormatResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_URI_REFERENCE_FORMAT_REQUEST_BODY: RequestBodyPostUriReferenceFormatRequestBody, - PathValues.RESPONSE_BODY_POST_URI_REFERENCE_FORMAT_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostUriReferenceFormatResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_URI_TEMPLATE_FORMAT_REQUEST_BODY: RequestBodyPostUriTemplateFormatRequestBody, - PathValues.RESPONSE_BODY_POST_URI_TEMPLATE_FORMAT_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostUriTemplateFormatResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_NESTED_ITEMS_REQUEST_BODY: RequestBodyPostNestedItemsRequestBody, - PathValues.RESPONSE_BODY_POST_NESTED_ITEMS_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostNestedItemsResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_MAXIMUM_VALIDATION_REQUEST_BODY: RequestBodyPostMaximumValidationRequestBody, - PathValues.RESPONSE_BODY_POST_MAXIMUM_VALIDATION_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostMaximumValidationResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_MAXIMUM_VALIDATION_WITH_UNSIGNED_INTEGER_REQUEST_BODY: RequestBodyPostMaximumValidationWithUnsignedIntegerRequestBody, - PathValues.RESPONSE_BODY_POST_MAXIMUM_VALIDATION_WITH_UNSIGNED_INTEGER_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostMaximumValidationWithUnsignedIntegerResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_MAXITEMS_VALIDATION_REQUEST_BODY: RequestBodyPostMaxitemsValidationRequestBody, - PathValues.RESPONSE_BODY_POST_MAXITEMS_VALIDATION_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostMaxitemsValidationResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_MAXLENGTH_VALIDATION_REQUEST_BODY: RequestBodyPostMaxlengthValidationRequestBody, - PathValues.RESPONSE_BODY_POST_MAXLENGTH_VALIDATION_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostMaxlengthValidationResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_MAXPROPERTIES_VALIDATION_REQUEST_BODY: RequestBodyPostMaxpropertiesValidationRequestBody, - PathValues.RESPONSE_BODY_POST_MAXPROPERTIES_VALIDATION_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostMaxpropertiesValidationResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_MAXPROPERTIES0MEANS_THE_OBJECT_IS_EMPTY_REQUEST_BODY: RequestBodyPostMaxproperties0MeansTheObjectIsEmptyRequestBody, - PathValues.RESPONSE_BODY_POST_MAXPROPERTIES0MEANS_THE_OBJECT_IS_EMPTY_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostMaxproperties0MeansTheObjectIsEmptyResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_MINIMUM_VALIDATION_REQUEST_BODY: RequestBodyPostMinimumValidationRequestBody, - PathValues.RESPONSE_BODY_POST_MINIMUM_VALIDATION_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostMinimumValidationResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_MINIMUM_VALIDATION_WITH_SIGNED_INTEGER_REQUEST_BODY: RequestBodyPostMinimumValidationWithSignedIntegerRequestBody, - PathValues.RESPONSE_BODY_POST_MINIMUM_VALIDATION_WITH_SIGNED_INTEGER_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostMinimumValidationWithSignedIntegerResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_MINITEMS_VALIDATION_REQUEST_BODY: RequestBodyPostMinitemsValidationRequestBody, - PathValues.RESPONSE_BODY_POST_MINITEMS_VALIDATION_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostMinitemsValidationResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_MINLENGTH_VALIDATION_REQUEST_BODY: RequestBodyPostMinlengthValidationRequestBody, - PathValues.RESPONSE_BODY_POST_MINLENGTH_VALIDATION_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostMinlengthValidationResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_MINPROPERTIES_VALIDATION_REQUEST_BODY: RequestBodyPostMinpropertiesValidationRequestBody, - PathValues.RESPONSE_BODY_POST_MINPROPERTIES_VALIDATION_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostMinpropertiesValidationResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_BY_INT_REQUEST_BODY: RequestBodyPostByIntRequestBody, - PathValues.RESPONSE_BODY_POST_BY_INT_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostByIntResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_BY_NUMBER_REQUEST_BODY: RequestBodyPostByNumberRequestBody, - PathValues.RESPONSE_BODY_POST_BY_NUMBER_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostByNumberResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_BY_SMALL_NUMBER_REQUEST_BODY: RequestBodyPostBySmallNumberRequestBody, - PathValues.RESPONSE_BODY_POST_BY_SMALL_NUMBER_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostBySmallNumberResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_INVALID_INSTANCE_SHOULD_NOT_RAISE_ERROR_WHEN_FLOAT_DIVISION_INF_REQUEST_BODY: RequestBodyPostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody, - PathValues.RESPONSE_BODY_POST_INVALID_INSTANCE_SHOULD_NOT_RAISE_ERROR_WHEN_FLOAT_DIVISION_INF_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_NOT_REQUEST_BODY: RequestBodyPostNotRequestBody, - PathValues.RESPONSE_BODY_POST_NOT_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostNotResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_NOT_MORE_COMPLEX_SCHEMA_REQUEST_BODY: RequestBodyPostNotMoreComplexSchemaRequestBody, - PathValues.RESPONSE_BODY_POST_NOT_MORE_COMPLEX_SCHEMA_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostNotMoreComplexSchemaResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_FORBIDDEN_PROPERTY_REQUEST_BODY: RequestBodyPostForbiddenPropertyRequestBody, - PathValues.RESPONSE_BODY_POST_FORBIDDEN_PROPERTY_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostForbiddenPropertyResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_ONEOF_REQUEST_BODY: RequestBodyPostOneofRequestBody, - PathValues.RESPONSE_BODY_POST_ONEOF_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostOneofResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_ONEOF_WITH_BASE_SCHEMA_REQUEST_BODY: RequestBodyPostOneofWithBaseSchemaRequestBody, - PathValues.RESPONSE_BODY_POST_ONEOF_WITH_BASE_SCHEMA_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostOneofWithBaseSchemaResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_ONEOF_COMPLEX_TYPES_REQUEST_BODY: RequestBodyPostOneofComplexTypesRequestBody, - PathValues.RESPONSE_BODY_POST_ONEOF_COMPLEX_TYPES_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostOneofComplexTypesResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_ONEOF_WITH_EMPTY_SCHEMA_REQUEST_BODY: RequestBodyPostOneofWithEmptySchemaRequestBody, - PathValues.RESPONSE_BODY_POST_ONEOF_WITH_EMPTY_SCHEMA_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostOneofWithEmptySchemaResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_ONEOF_WITH_REQUIRED_REQUEST_BODY: RequestBodyPostOneofWithRequiredRequestBody, - PathValues.RESPONSE_BODY_POST_ONEOF_WITH_REQUIRED_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostOneofWithRequiredResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_NESTED_ONEOF_TO_CHECK_VALIDATION_SEMANTICS_REQUEST_BODY: RequestBodyPostNestedOneofToCheckValidationSemanticsRequestBody, - PathValues.RESPONSE_BODY_POST_NESTED_ONEOF_TO_CHECK_VALIDATION_SEMANTICS_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostNestedOneofToCheckValidationSemanticsResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_PATTERN_VALIDATION_REQUEST_BODY: RequestBodyPostPatternValidationRequestBody, - PathValues.RESPONSE_BODY_POST_PATTERN_VALIDATION_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostPatternValidationResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_PATTERN_IS_NOT_ANCHORED_REQUEST_BODY: RequestBodyPostPatternIsNotAnchoredRequestBody, - PathValues.RESPONSE_BODY_POST_PATTERN_IS_NOT_ANCHORED_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostPatternIsNotAnchoredResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_OBJECT_PROPERTIES_VALIDATION_REQUEST_BODY: RequestBodyPostObjectPropertiesValidationRequestBody, - PathValues.RESPONSE_BODY_POST_OBJECT_PROPERTIES_VALIDATION_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostObjectPropertiesValidationResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_PROPERTIES_WITH_ESCAPED_CHARACTERS_REQUEST_BODY: RequestBodyPostPropertiesWithEscapedCharactersRequestBody, - PathValues.RESPONSE_BODY_POST_PROPERTIES_WITH_ESCAPED_CHARACTERS_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostPropertiesWithEscapedCharactersResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_PROPERTY_NAMED_REF_THAT_IS_NOT_AREFERENCE_REQUEST_BODY: RequestBodyPostPropertyNamedRefThatIsNotAReferenceRequestBody, - PathValues.RESPONSE_BODY_POST_PROPERTY_NAMED_REF_THAT_IS_NOT_AREFERENCE_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostPropertyNamedRefThatIsNotAReferenceResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_REF_IN_ADDITIONALPROPERTIES_REQUEST_BODY: RequestBodyPostRefInAdditionalpropertiesRequestBody, - PathValues.RESPONSE_BODY_POST_REF_IN_ADDITIONALPROPERTIES_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostRefInAdditionalpropertiesResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_REF_IN_ITEMS_REQUEST_BODY: RequestBodyPostRefInItemsRequestBody, - PathValues.RESPONSE_BODY_POST_REF_IN_ITEMS_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostRefInItemsResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_REF_IN_PROPERTY_REQUEST_BODY: RequestBodyPostRefInPropertyRequestBody, - PathValues.RESPONSE_BODY_POST_REF_IN_PROPERTY_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostRefInPropertyResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_REF_IN_ALLOF_REQUEST_BODY: RequestBodyPostRefInAllofRequestBody, - PathValues.RESPONSE_BODY_POST_REF_IN_ALLOF_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostRefInAllofResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_REF_IN_ONEOF_REQUEST_BODY: RequestBodyPostRefInOneofRequestBody, - PathValues.RESPONSE_BODY_POST_REF_IN_ONEOF_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostRefInOneofResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_REF_IN_ANYOF_REQUEST_BODY: RequestBodyPostRefInAnyofRequestBody, - PathValues.RESPONSE_BODY_POST_REF_IN_ANYOF_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostRefInAnyofResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_REF_IN_NOT_REQUEST_BODY: RequestBodyPostRefInNotRequestBody, - PathValues.RESPONSE_BODY_POST_REF_IN_NOT_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostRefInNotResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_REQUIRED_VALIDATION_REQUEST_BODY: RequestBodyPostRequiredValidationRequestBody, - PathValues.RESPONSE_BODY_POST_REQUIRED_VALIDATION_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostRequiredValidationResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_REQUIRED_DEFAULT_VALIDATION_REQUEST_BODY: RequestBodyPostRequiredDefaultValidationRequestBody, - PathValues.RESPONSE_BODY_POST_REQUIRED_DEFAULT_VALIDATION_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostRequiredDefaultValidationResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_REQUIRED_WITH_EMPTY_ARRAY_REQUEST_BODY: RequestBodyPostRequiredWithEmptyArrayRequestBody, - PathValues.RESPONSE_BODY_POST_REQUIRED_WITH_EMPTY_ARRAY_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostRequiredWithEmptyArrayResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_REQUIRED_WITH_ESCAPED_CHARACTERS_REQUEST_BODY: RequestBodyPostRequiredWithEscapedCharactersRequestBody, - PathValues.RESPONSE_BODY_POST_REQUIRED_WITH_ESCAPED_CHARACTERS_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostRequiredWithEscapedCharactersResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_INTEGER_TYPE_MATCHES_INTEGERS_REQUEST_BODY: RequestBodyPostIntegerTypeMatchesIntegersRequestBody, - PathValues.RESPONSE_BODY_POST_INTEGER_TYPE_MATCHES_INTEGERS_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostIntegerTypeMatchesIntegersResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_NUMBER_TYPE_MATCHES_NUMBERS_REQUEST_BODY: RequestBodyPostNumberTypeMatchesNumbersRequestBody, - PathValues.RESPONSE_BODY_POST_NUMBER_TYPE_MATCHES_NUMBERS_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostNumberTypeMatchesNumbersResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_STRING_TYPE_MATCHES_STRINGS_REQUEST_BODY: RequestBodyPostStringTypeMatchesStringsRequestBody, - PathValues.RESPONSE_BODY_POST_STRING_TYPE_MATCHES_STRINGS_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostStringTypeMatchesStringsResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_OBJECT_TYPE_MATCHES_OBJECTS_REQUEST_BODY: RequestBodyPostObjectTypeMatchesObjectsRequestBody, - PathValues.RESPONSE_BODY_POST_OBJECT_TYPE_MATCHES_OBJECTS_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostObjectTypeMatchesObjectsResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_BOOLEAN_TYPE_MATCHES_BOOLEANS_REQUEST_BODY: RequestBodyPostBooleanTypeMatchesBooleansRequestBody, - PathValues.RESPONSE_BODY_POST_BOOLEAN_TYPE_MATCHES_BOOLEANS_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostBooleanTypeMatchesBooleansResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_NULL_TYPE_MATCHES_ONLY_THE_NULL_OBJECT_REQUEST_BODY: RequestBodyPostNullTypeMatchesOnlyTheNullObjectRequestBody, - PathValues.RESPONSE_BODY_POST_NULL_TYPE_MATCHES_ONLY_THE_NULL_OBJECT_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_ARRAY_TYPE_MATCHES_ARRAYS_REQUEST_BODY: RequestBodyPostArrayTypeMatchesArraysRequestBody, - PathValues.RESPONSE_BODY_POST_ARRAY_TYPE_MATCHES_ARRAYS_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostArrayTypeMatchesArraysResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_UNIQUEITEMS_VALIDATION_REQUEST_BODY: RequestBodyPostUniqueitemsValidationRequestBody, - PathValues.RESPONSE_BODY_POST_UNIQUEITEMS_VALIDATION_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostUniqueitemsValidationResponseBodyForContentTypes, - PathValues.REQUEST_BODY_POST_UNIQUEITEMS_FALSE_VALIDATION_REQUEST_BODY: RequestBodyPostUniqueitemsFalseValidationRequestBody, - PathValues.RESPONSE_BODY_POST_UNIQUEITEMS_FALSE_VALIDATION_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostUniqueitemsFalseValidationResponseBodyForContentTypes, - } -) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/__init__.py deleted file mode 100644 index 53ee69932fa..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.apis.path_to_api import path_to_api diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body.py deleted file mode 100644 index b192522f2aa..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body.post import ApiForpost - - -class RequestBodyPostAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body.py deleted file mode 100644 index 451e8f90027..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_additionalproperties_are_allowed_by_default_request_body.post import ApiForpost - - -class RequestBodyPostAdditionalpropertiesAreAllowedByDefaultRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body.py deleted file mode 100644 index c52850fbd68..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_additionalproperties_can_exist_by_itself_request_body.post import ApiForpost - - -class RequestBodyPostAdditionalpropertiesCanExistByItselfRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body.py deleted file mode 100644 index ce1a4fdad65..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_additionalproperties_should_not_look_in_applicators_request_body.post import ApiForpost - - -class RequestBodyPostAdditionalpropertiesShouldNotLookInApplicatorsRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_allof_combined_with_anyof_oneof_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_allof_combined_with_anyof_oneof_request_body.py deleted file mode 100644 index 6793b00407b..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_allof_combined_with_anyof_oneof_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_allof_combined_with_anyof_oneof_request_body.post import ApiForpost - - -class RequestBodyPostAllofCombinedWithAnyofOneofRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_allof_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_allof_request_body.py deleted file mode 100644 index 37c84da359b..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_allof_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_allof_request_body.post import ApiForpost - - -class RequestBodyPostAllofRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_allof_simple_types_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_allof_simple_types_request_body.py deleted file mode 100644 index 9fc93cccdbc..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_allof_simple_types_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_allof_simple_types_request_body.post import ApiForpost - - -class RequestBodyPostAllofSimpleTypesRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_allof_with_base_schema_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_allof_with_base_schema_request_body.py deleted file mode 100644 index 86134ff5215..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_allof_with_base_schema_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_allof_with_base_schema_request_body.post import ApiForpost - - -class RequestBodyPostAllofWithBaseSchemaRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_allof_with_one_empty_schema_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_allof_with_one_empty_schema_request_body.py deleted file mode 100644 index 2a53c4f4e6d..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_allof_with_one_empty_schema_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_allof_with_one_empty_schema_request_body.post import ApiForpost - - -class RequestBodyPostAllofWithOneEmptySchemaRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_allof_with_the_first_empty_schema_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_allof_with_the_first_empty_schema_request_body.py deleted file mode 100644 index d7e39a3366f..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_allof_with_the_first_empty_schema_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_allof_with_the_first_empty_schema_request_body.post import ApiForpost - - -class RequestBodyPostAllofWithTheFirstEmptySchemaRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_allof_with_the_last_empty_schema_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_allof_with_the_last_empty_schema_request_body.py deleted file mode 100644 index e89f23b2e65..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_allof_with_the_last_empty_schema_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_allof_with_the_last_empty_schema_request_body.post import ApiForpost - - -class RequestBodyPostAllofWithTheLastEmptySchemaRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_allof_with_two_empty_schemas_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_allof_with_two_empty_schemas_request_body.py deleted file mode 100644 index 52d37e53682..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_allof_with_two_empty_schemas_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_allof_with_two_empty_schemas_request_body.post import ApiForpost - - -class RequestBodyPostAllofWithTwoEmptySchemasRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_anyof_complex_types_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_anyof_complex_types_request_body.py deleted file mode 100644 index e0451e54403..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_anyof_complex_types_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_anyof_complex_types_request_body.post import ApiForpost - - -class RequestBodyPostAnyofComplexTypesRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_anyof_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_anyof_request_body.py deleted file mode 100644 index 664362a7a17..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_anyof_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_anyof_request_body.post import ApiForpost - - -class RequestBodyPostAnyofRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_anyof_with_base_schema_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_anyof_with_base_schema_request_body.py deleted file mode 100644 index 7cb12e0242f..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_anyof_with_base_schema_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_anyof_with_base_schema_request_body.post import ApiForpost - - -class RequestBodyPostAnyofWithBaseSchemaRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_anyof_with_one_empty_schema_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_anyof_with_one_empty_schema_request_body.py deleted file mode 100644 index debf0a4001d..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_anyof_with_one_empty_schema_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_anyof_with_one_empty_schema_request_body.post import ApiForpost - - -class RequestBodyPostAnyofWithOneEmptySchemaRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_array_type_matches_arrays_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_array_type_matches_arrays_request_body.py deleted file mode 100644 index 07f36e7221d..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_array_type_matches_arrays_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_array_type_matches_arrays_request_body.post import ApiForpost - - -class RequestBodyPostArrayTypeMatchesArraysRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_boolean_type_matches_booleans_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_boolean_type_matches_booleans_request_body.py deleted file mode 100644 index 8d84adf9461..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_boolean_type_matches_booleans_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_boolean_type_matches_booleans_request_body.post import ApiForpost - - -class RequestBodyPostBooleanTypeMatchesBooleansRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_by_int_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_by_int_request_body.py deleted file mode 100644 index dd56fe4d763..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_by_int_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_by_int_request_body.post import ApiForpost - - -class RequestBodyPostByIntRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_by_number_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_by_number_request_body.py deleted file mode 100644 index 1c4479a5830..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_by_number_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_by_number_request_body.post import ApiForpost - - -class RequestBodyPostByNumberRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_by_small_number_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_by_small_number_request_body.py deleted file mode 100644 index a02655bdcf4..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_by_small_number_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_by_small_number_request_body.post import ApiForpost - - -class RequestBodyPostBySmallNumberRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_date_time_format_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_date_time_format_request_body.py deleted file mode 100644 index 7a8bcf9dd3c..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_date_time_format_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_date_time_format_request_body.post import ApiForpost - - -class RequestBodyPostDateTimeFormatRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_email_format_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_email_format_request_body.py deleted file mode 100644 index d981e181d71..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_email_format_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_email_format_request_body.post import ApiForpost - - -class RequestBodyPostEmailFormatRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_enum_with0_does_not_match_false_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_enum_with0_does_not_match_false_request_body.py deleted file mode 100644 index 2ad5fc633c5..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_enum_with0_does_not_match_false_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_enum_with0_does_not_match_false_request_body.post import ApiForpost - - -class RequestBodyPostEnumWith0DoesNotMatchFalseRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_enum_with1_does_not_match_true_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_enum_with1_does_not_match_true_request_body.py deleted file mode 100644 index e839c2072b6..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_enum_with1_does_not_match_true_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_enum_with1_does_not_match_true_request_body.post import ApiForpost - - -class RequestBodyPostEnumWith1DoesNotMatchTrueRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_enum_with_escaped_characters_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_enum_with_escaped_characters_request_body.py deleted file mode 100644 index 7f2d1af225d..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_enum_with_escaped_characters_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_enum_with_escaped_characters_request_body.post import ApiForpost - - -class RequestBodyPostEnumWithEscapedCharactersRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_enum_with_false_does_not_match0_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_enum_with_false_does_not_match0_request_body.py deleted file mode 100644 index 3a411072adf..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_enum_with_false_does_not_match0_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_enum_with_false_does_not_match0_request_body.post import ApiForpost - - -class RequestBodyPostEnumWithFalseDoesNotMatch0RequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_enum_with_true_does_not_match1_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_enum_with_true_does_not_match1_request_body.py deleted file mode 100644 index b4de11a45aa..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_enum_with_true_does_not_match1_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_enum_with_true_does_not_match1_request_body.post import ApiForpost - - -class RequestBodyPostEnumWithTrueDoesNotMatch1RequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_enums_in_properties_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_enums_in_properties_request_body.py deleted file mode 100644 index 2691381350b..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_enums_in_properties_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_enums_in_properties_request_body.post import ApiForpost - - -class RequestBodyPostEnumsInPropertiesRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_forbidden_property_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_forbidden_property_request_body.py deleted file mode 100644 index 2d47b6c3b2e..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_forbidden_property_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_forbidden_property_request_body.post import ApiForpost - - -class RequestBodyPostForbiddenPropertyRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_hostname_format_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_hostname_format_request_body.py deleted file mode 100644 index 7c7f8a231e5..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_hostname_format_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_hostname_format_request_body.post import ApiForpost - - -class RequestBodyPostHostnameFormatRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_integer_type_matches_integers_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_integer_type_matches_integers_request_body.py deleted file mode 100644 index 77edb2b06bb..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_integer_type_matches_integers_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_integer_type_matches_integers_request_body.post import ApiForpost - - -class RequestBodyPostIntegerTypeMatchesIntegersRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body.py deleted file mode 100644 index 5941f7771dc..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body.post import ApiForpost - - -class RequestBodyPostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_invalid_string_value_for_default_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_invalid_string_value_for_default_request_body.py deleted file mode 100644 index 4ba3eccbfcb..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_invalid_string_value_for_default_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_invalid_string_value_for_default_request_body.post import ApiForpost - - -class RequestBodyPostInvalidStringValueForDefaultRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_ipv4_format_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_ipv4_format_request_body.py deleted file mode 100644 index 3a08ac42fb7..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_ipv4_format_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_ipv4_format_request_body.post import ApiForpost - - -class RequestBodyPostIpv4FormatRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_ipv6_format_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_ipv6_format_request_body.py deleted file mode 100644 index a4c77959125..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_ipv6_format_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_ipv6_format_request_body.post import ApiForpost - - -class RequestBodyPostIpv6FormatRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_json_pointer_format_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_json_pointer_format_request_body.py deleted file mode 100644 index 72c1b75f118..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_json_pointer_format_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_json_pointer_format_request_body.post import ApiForpost - - -class RequestBodyPostJsonPointerFormatRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_maximum_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_maximum_validation_request_body.py deleted file mode 100644 index be4ee24b7bf..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_maximum_validation_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_maximum_validation_request_body.post import ApiForpost - - -class RequestBodyPostMaximumValidationRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body.py deleted file mode 100644 index 8320d0e690a..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_maximum_validation_with_unsigned_integer_request_body.post import ApiForpost - - -class RequestBodyPostMaximumValidationWithUnsignedIntegerRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_maxitems_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_maxitems_validation_request_body.py deleted file mode 100644 index 0cd52b5704a..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_maxitems_validation_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_maxitems_validation_request_body.post import ApiForpost - - -class RequestBodyPostMaxitemsValidationRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_maxlength_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_maxlength_validation_request_body.py deleted file mode 100644 index 3bbe70bf34a..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_maxlength_validation_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_maxlength_validation_request_body.post import ApiForpost - - -class RequestBodyPostMaxlengthValidationRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body.py deleted file mode 100644 index 98a7f6edf79..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_maxproperties0_means_the_object_is_empty_request_body.post import ApiForpost - - -class RequestBodyPostMaxproperties0MeansTheObjectIsEmptyRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_maxproperties_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_maxproperties_validation_request_body.py deleted file mode 100644 index d4e696fd84a..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_maxproperties_validation_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_maxproperties_validation_request_body.post import ApiForpost - - -class RequestBodyPostMaxpropertiesValidationRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_minimum_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_minimum_validation_request_body.py deleted file mode 100644 index 027c18ffdef..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_minimum_validation_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_minimum_validation_request_body.post import ApiForpost - - -class RequestBodyPostMinimumValidationRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_minimum_validation_with_signed_integer_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_minimum_validation_with_signed_integer_request_body.py deleted file mode 100644 index dafbf06e919..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_minimum_validation_with_signed_integer_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_minimum_validation_with_signed_integer_request_body.post import ApiForpost - - -class RequestBodyPostMinimumValidationWithSignedIntegerRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_minitems_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_minitems_validation_request_body.py deleted file mode 100644 index 799cb6d8c9b..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_minitems_validation_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_minitems_validation_request_body.post import ApiForpost - - -class RequestBodyPostMinitemsValidationRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_minlength_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_minlength_validation_request_body.py deleted file mode 100644 index 5998484905d..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_minlength_validation_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_minlength_validation_request_body.post import ApiForpost - - -class RequestBodyPostMinlengthValidationRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_minproperties_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_minproperties_validation_request_body.py deleted file mode 100644 index 2198665c3b1..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_minproperties_validation_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_minproperties_validation_request_body.post import ApiForpost - - -class RequestBodyPostMinpropertiesValidationRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body.py deleted file mode 100644 index 65e76d896e8..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_nested_allof_to_check_validation_semantics_request_body.post import ApiForpost - - -class RequestBodyPostNestedAllofToCheckValidationSemanticsRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body.py deleted file mode 100644 index 806340cb355..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_nested_anyof_to_check_validation_semantics_request_body.post import ApiForpost - - -class RequestBodyPostNestedAnyofToCheckValidationSemanticsRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_nested_items_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_nested_items_request_body.py deleted file mode 100644 index a32286fd144..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_nested_items_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_nested_items_request_body.post import ApiForpost - - -class RequestBodyPostNestedItemsRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body.py deleted file mode 100644 index e88c0c4cfd7..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_nested_oneof_to_check_validation_semantics_request_body.post import ApiForpost - - -class RequestBodyPostNestedOneofToCheckValidationSemanticsRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_not_more_complex_schema_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_not_more_complex_schema_request_body.py deleted file mode 100644 index 5b3f9fe9695..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_not_more_complex_schema_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_not_more_complex_schema_request_body.post import ApiForpost - - -class RequestBodyPostNotMoreComplexSchemaRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_not_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_not_request_body.py deleted file mode 100644 index 631de4606c8..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_not_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_not_request_body.post import ApiForpost - - -class RequestBodyPostNotRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_nul_characters_in_strings_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_nul_characters_in_strings_request_body.py deleted file mode 100644 index 3b58e5d911c..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_nul_characters_in_strings_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_nul_characters_in_strings_request_body.post import ApiForpost - - -class RequestBodyPostNulCharactersInStringsRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_null_type_matches_only_the_null_object_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_null_type_matches_only_the_null_object_request_body.py deleted file mode 100644 index a1b6fef89e0..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_null_type_matches_only_the_null_object_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_null_type_matches_only_the_null_object_request_body.post import ApiForpost - - -class RequestBodyPostNullTypeMatchesOnlyTheNullObjectRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_number_type_matches_numbers_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_number_type_matches_numbers_request_body.py deleted file mode 100644 index 406a6293d32..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_number_type_matches_numbers_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_number_type_matches_numbers_request_body.post import ApiForpost - - -class RequestBodyPostNumberTypeMatchesNumbersRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_object_properties_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_object_properties_validation_request_body.py deleted file mode 100644 index 5d2954070a1..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_object_properties_validation_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_object_properties_validation_request_body.post import ApiForpost - - -class RequestBodyPostObjectPropertiesValidationRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_object_type_matches_objects_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_object_type_matches_objects_request_body.py deleted file mode 100644 index 44a8c119ba0..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_object_type_matches_objects_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_object_type_matches_objects_request_body.post import ApiForpost - - -class RequestBodyPostObjectTypeMatchesObjectsRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_oneof_complex_types_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_oneof_complex_types_request_body.py deleted file mode 100644 index a717308f2ca..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_oneof_complex_types_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_oneof_complex_types_request_body.post import ApiForpost - - -class RequestBodyPostOneofComplexTypesRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_oneof_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_oneof_request_body.py deleted file mode 100644 index 45d31d7fdf6..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_oneof_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_oneof_request_body.post import ApiForpost - - -class RequestBodyPostOneofRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_oneof_with_base_schema_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_oneof_with_base_schema_request_body.py deleted file mode 100644 index 4f599245d02..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_oneof_with_base_schema_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_oneof_with_base_schema_request_body.post import ApiForpost - - -class RequestBodyPostOneofWithBaseSchemaRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_oneof_with_empty_schema_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_oneof_with_empty_schema_request_body.py deleted file mode 100644 index 2ec2d18c535..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_oneof_with_empty_schema_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_oneof_with_empty_schema_request_body.post import ApiForpost - - -class RequestBodyPostOneofWithEmptySchemaRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_oneof_with_required_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_oneof_with_required_request_body.py deleted file mode 100644 index 774cf6dc1ac..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_oneof_with_required_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_oneof_with_required_request_body.post import ApiForpost - - -class RequestBodyPostOneofWithRequiredRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_pattern_is_not_anchored_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_pattern_is_not_anchored_request_body.py deleted file mode 100644 index 06aca1f2b3e..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_pattern_is_not_anchored_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_pattern_is_not_anchored_request_body.post import ApiForpost - - -class RequestBodyPostPatternIsNotAnchoredRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_pattern_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_pattern_validation_request_body.py deleted file mode 100644 index 5ddc1ec9b7c..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_pattern_validation_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_pattern_validation_request_body.post import ApiForpost - - -class RequestBodyPostPatternValidationRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_properties_with_escaped_characters_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_properties_with_escaped_characters_request_body.py deleted file mode 100644 index dd948001468..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_properties_with_escaped_characters_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_properties_with_escaped_characters_request_body.post import ApiForpost - - -class RequestBodyPostPropertiesWithEscapedCharactersRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body.py deleted file mode 100644 index c211121f9db..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_property_named_ref_that_is_not_a_reference_request_body.post import ApiForpost - - -class RequestBodyPostPropertyNamedRefThatIsNotAReferenceRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_ref_in_additionalproperties_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_ref_in_additionalproperties_request_body.py deleted file mode 100644 index b74804c5e79..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_ref_in_additionalproperties_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_ref_in_additionalproperties_request_body.post import ApiForpost - - -class RequestBodyPostRefInAdditionalpropertiesRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_ref_in_allof_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_ref_in_allof_request_body.py deleted file mode 100644 index 4720ef7849b..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_ref_in_allof_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_ref_in_allof_request_body.post import ApiForpost - - -class RequestBodyPostRefInAllofRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_ref_in_anyof_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_ref_in_anyof_request_body.py deleted file mode 100644 index c86e5289609..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_ref_in_anyof_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_ref_in_anyof_request_body.post import ApiForpost - - -class RequestBodyPostRefInAnyofRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_ref_in_items_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_ref_in_items_request_body.py deleted file mode 100644 index 1552ea32ee6..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_ref_in_items_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_ref_in_items_request_body.post import ApiForpost - - -class RequestBodyPostRefInItemsRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_ref_in_not_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_ref_in_not_request_body.py deleted file mode 100644 index 12dbc3510d7..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_ref_in_not_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_ref_in_not_request_body.post import ApiForpost - - -class RequestBodyPostRefInNotRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_ref_in_oneof_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_ref_in_oneof_request_body.py deleted file mode 100644 index 3e66c6cef48..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_ref_in_oneof_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_ref_in_oneof_request_body.post import ApiForpost - - -class RequestBodyPostRefInOneofRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_ref_in_property_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_ref_in_property_request_body.py deleted file mode 100644 index 9950d6d0854..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_ref_in_property_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_ref_in_property_request_body.post import ApiForpost - - -class RequestBodyPostRefInPropertyRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_required_default_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_required_default_validation_request_body.py deleted file mode 100644 index f000c3cdc89..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_required_default_validation_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_required_default_validation_request_body.post import ApiForpost - - -class RequestBodyPostRequiredDefaultValidationRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_required_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_required_validation_request_body.py deleted file mode 100644 index f31a3846f3f..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_required_validation_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_required_validation_request_body.post import ApiForpost - - -class RequestBodyPostRequiredValidationRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_required_with_empty_array_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_required_with_empty_array_request_body.py deleted file mode 100644 index eb7c393317f..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_required_with_empty_array_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_required_with_empty_array_request_body.post import ApiForpost - - -class RequestBodyPostRequiredWithEmptyArrayRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_required_with_escaped_characters_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_required_with_escaped_characters_request_body.py deleted file mode 100644 index 2098fa9255d..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_required_with_escaped_characters_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_required_with_escaped_characters_request_body.post import ApiForpost - - -class RequestBodyPostRequiredWithEscapedCharactersRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_simple_enum_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_simple_enum_validation_request_body.py deleted file mode 100644 index 867da55645d..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_simple_enum_validation_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_simple_enum_validation_request_body.post import ApiForpost - - -class RequestBodyPostSimpleEnumValidationRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_string_type_matches_strings_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_string_type_matches_strings_request_body.py deleted file mode 100644 index 8fecfc63a8c..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_string_type_matches_strings_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_string_type_matches_strings_request_body.post import ApiForpost - - -class RequestBodyPostStringTypeMatchesStringsRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.py deleted file mode 100644 index f661679de9f..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.post import ApiForpost - - -class RequestBodyPostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_uniqueitems_false_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_uniqueitems_false_validation_request_body.py deleted file mode 100644 index 59cd97a909c..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_uniqueitems_false_validation_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_uniqueitems_false_validation_request_body.post import ApiForpost - - -class RequestBodyPostUniqueitemsFalseValidationRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_uniqueitems_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_uniqueitems_validation_request_body.py deleted file mode 100644 index 3491c6ceb9b..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_uniqueitems_validation_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_uniqueitems_validation_request_body.post import ApiForpost - - -class RequestBodyPostUniqueitemsValidationRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_uri_format_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_uri_format_request_body.py deleted file mode 100644 index efed57abe10..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_uri_format_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_uri_format_request_body.post import ApiForpost - - -class RequestBodyPostUriFormatRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_uri_reference_format_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_uri_reference_format_request_body.py deleted file mode 100644 index 42007af52dc..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_uri_reference_format_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_uri_reference_format_request_body.post import ApiForpost - - -class RequestBodyPostUriReferenceFormatRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_uri_template_format_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_uri_template_format_request_body.py deleted file mode 100644 index 91da7cc9196..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_uri_template_format_request_body.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.request_body_post_uri_template_format_request_body.post import ApiForpost - - -class RequestBodyPostUriTemplateFormatRequestBody( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types.py deleted file mode 100644 index 40fb8b563e7..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostAdditionalpropertiesAllowsASchemaWhichShouldValidateResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types.py deleted file mode 100644 index 76fa69d7867..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostAdditionalpropertiesAreAllowedByDefaultResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types.py deleted file mode 100644 index 745ec3b920c..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostAdditionalpropertiesCanExistByItselfResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types.py deleted file mode 100644 index 84f7d2c57f2..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostAdditionalpropertiesShouldNotLookInApplicatorsResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types.py deleted file mode 100644 index 48e10e30ddc..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostAllofCombinedWithAnyofOneofResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_allof_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_allof_response_body_for_content_types.py deleted file mode 100644 index b33146d83bd..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_allof_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_allof_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostAllofResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_allof_simple_types_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_allof_simple_types_response_body_for_content_types.py deleted file mode 100644 index eed89884778..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_allof_simple_types_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_allof_simple_types_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostAllofSimpleTypesResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_allof_with_base_schema_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_allof_with_base_schema_response_body_for_content_types.py deleted file mode 100644 index 9773d68717f..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_allof_with_base_schema_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_allof_with_base_schema_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostAllofWithBaseSchemaResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types.py deleted file mode 100644 index cfbab796719..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_allof_with_one_empty_schema_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostAllofWithOneEmptySchemaResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types.py deleted file mode 100644 index 4ef24243e38..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostAllofWithTheFirstEmptySchemaResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types.py deleted file mode 100644 index 6a072308b9e..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostAllofWithTheLastEmptySchemaResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types.py deleted file mode 100644 index cb2d392a271..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_allof_with_two_empty_schemas_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostAllofWithTwoEmptySchemasResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_anyof_complex_types_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_anyof_complex_types_response_body_for_content_types.py deleted file mode 100644 index 57c04635509..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_anyof_complex_types_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_anyof_complex_types_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostAnyofComplexTypesResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_anyof_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_anyof_response_body_for_content_types.py deleted file mode 100644 index 9548bd80a81..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_anyof_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_anyof_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostAnyofResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types.py deleted file mode 100644 index 9a9acdee10f..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_anyof_with_base_schema_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostAnyofWithBaseSchemaResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types.py deleted file mode 100644 index 1e7d7dd5038..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_anyof_with_one_empty_schema_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostAnyofWithOneEmptySchemaResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types.py deleted file mode 100644 index 234e28085ab..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_array_type_matches_arrays_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostArrayTypeMatchesArraysResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types.py deleted file mode 100644 index d9c89215c63..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_boolean_type_matches_booleans_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostBooleanTypeMatchesBooleansResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_by_int_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_by_int_response_body_for_content_types.py deleted file mode 100644 index c24958f9e98..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_by_int_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_by_int_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostByIntResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_by_number_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_by_number_response_body_for_content_types.py deleted file mode 100644 index b25ffaf327b..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_by_number_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_by_number_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostByNumberResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_by_small_number_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_by_small_number_response_body_for_content_types.py deleted file mode 100644 index ebd44f5eacb..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_by_small_number_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_by_small_number_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostBySmallNumberResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_date_time_format_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_date_time_format_response_body_for_content_types.py deleted file mode 100644 index e94b0c25526..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_date_time_format_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_date_time_format_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostDateTimeFormatResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_email_format_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_email_format_response_body_for_content_types.py deleted file mode 100644 index fd0f359da10..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_email_format_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_email_format_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostEmailFormatResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types.py deleted file mode 100644 index 57ad82fd774..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_enum_with0_does_not_match_false_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostEnumWith0DoesNotMatchFalseResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types.py deleted file mode 100644 index 72d19978383..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_enum_with1_does_not_match_true_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostEnumWith1DoesNotMatchTrueResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types.py deleted file mode 100644 index c8305686f73..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_enum_with_escaped_characters_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostEnumWithEscapedCharactersResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types.py deleted file mode 100644 index 05231260c73..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_enum_with_false_does_not_match0_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostEnumWithFalseDoesNotMatch0ResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types.py deleted file mode 100644 index bea4b3e3f62..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_enum_with_true_does_not_match1_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostEnumWithTrueDoesNotMatch1ResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_enums_in_properties_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_enums_in_properties_response_body_for_content_types.py deleted file mode 100644 index 0edfd61b881..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_enums_in_properties_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_enums_in_properties_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostEnumsInPropertiesResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_forbidden_property_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_forbidden_property_response_body_for_content_types.py deleted file mode 100644 index 5393f81369b..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_forbidden_property_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_forbidden_property_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostForbiddenPropertyResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_hostname_format_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_hostname_format_response_body_for_content_types.py deleted file mode 100644 index 780d18a115b..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_hostname_format_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_hostname_format_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostHostnameFormatResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types.py deleted file mode 100644 index 28ace3c210f..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_integer_type_matches_integers_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostIntegerTypeMatchesIntegersResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types.py deleted file mode 100644 index b4f0e5ace74..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types.py deleted file mode 100644 index a9a3fcce75c..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_invalid_string_value_for_default_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostInvalidStringValueForDefaultResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_ipv4_format_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_ipv4_format_response_body_for_content_types.py deleted file mode 100644 index 5c2a095c50e..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_ipv4_format_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_ipv4_format_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostIpv4FormatResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_ipv6_format_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_ipv6_format_response_body_for_content_types.py deleted file mode 100644 index 231daa31e19..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_ipv6_format_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_ipv6_format_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostIpv6FormatResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_json_pointer_format_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_json_pointer_format_response_body_for_content_types.py deleted file mode 100644 index 14fe52abf3a..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_json_pointer_format_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_json_pointer_format_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostJsonPointerFormatResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_maximum_validation_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_maximum_validation_response_body_for_content_types.py deleted file mode 100644 index 135c48eb886..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_maximum_validation_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_maximum_validation_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostMaximumValidationResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types.py deleted file mode 100644 index 0b9f4c65850..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostMaximumValidationWithUnsignedIntegerResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_maxitems_validation_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_maxitems_validation_response_body_for_content_types.py deleted file mode 100644 index f650e8dbda7..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_maxitems_validation_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_maxitems_validation_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostMaxitemsValidationResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_maxlength_validation_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_maxlength_validation_response_body_for_content_types.py deleted file mode 100644 index e300e8a9cb1..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_maxlength_validation_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_maxlength_validation_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostMaxlengthValidationResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types.py deleted file mode 100644 index ed154e366dd..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostMaxproperties0MeansTheObjectIsEmptyResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_maxproperties_validation_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_maxproperties_validation_response_body_for_content_types.py deleted file mode 100644 index 7bbc0d7dd21..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_maxproperties_validation_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_maxproperties_validation_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostMaxpropertiesValidationResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_minimum_validation_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_minimum_validation_response_body_for_content_types.py deleted file mode 100644 index 5db44592d23..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_minimum_validation_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_minimum_validation_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostMinimumValidationResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types.py deleted file mode 100644 index d33537118b2..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostMinimumValidationWithSignedIntegerResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_minitems_validation_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_minitems_validation_response_body_for_content_types.py deleted file mode 100644 index 62e83546f04..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_minitems_validation_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_minitems_validation_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostMinitemsValidationResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_minlength_validation_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_minlength_validation_response_body_for_content_types.py deleted file mode 100644 index c33c6ff17c1..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_minlength_validation_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_minlength_validation_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostMinlengthValidationResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_minproperties_validation_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_minproperties_validation_response_body_for_content_types.py deleted file mode 100644 index 7cdf0b9ac7d..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_minproperties_validation_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_minproperties_validation_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostMinpropertiesValidationResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types.py deleted file mode 100644 index 0268fe25aa8..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostNestedAllofToCheckValidationSemanticsResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types.py deleted file mode 100644 index 68ad0f0a4de..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostNestedAnyofToCheckValidationSemanticsResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_nested_items_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_nested_items_response_body_for_content_types.py deleted file mode 100644 index 78492c45a53..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_nested_items_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_nested_items_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostNestedItemsResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types.py deleted file mode 100644 index 18390d6cddf..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostNestedOneofToCheckValidationSemanticsResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_not_more_complex_schema_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_not_more_complex_schema_response_body_for_content_types.py deleted file mode 100644 index 2321185dcc9..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_not_more_complex_schema_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_not_more_complex_schema_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostNotMoreComplexSchemaResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_not_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_not_response_body_for_content_types.py deleted file mode 100644 index 4479983190b..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_not_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_not_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostNotResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types.py deleted file mode 100644 index c1c7cb23cd3..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_nul_characters_in_strings_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostNulCharactersInStringsResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types.py deleted file mode 100644 index 0d4058d552c..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types.py deleted file mode 100644 index 62135db0c75..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_number_type_matches_numbers_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostNumberTypeMatchesNumbersResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_object_properties_validation_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_object_properties_validation_response_body_for_content_types.py deleted file mode 100644 index 141786c230e..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_object_properties_validation_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_object_properties_validation_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostObjectPropertiesValidationResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_object_type_matches_objects_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_object_type_matches_objects_response_body_for_content_types.py deleted file mode 100644 index 211c386ed61..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_object_type_matches_objects_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_object_type_matches_objects_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostObjectTypeMatchesObjectsResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_oneof_complex_types_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_oneof_complex_types_response_body_for_content_types.py deleted file mode 100644 index f56b2bef461..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_oneof_complex_types_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_oneof_complex_types_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostOneofComplexTypesResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_oneof_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_oneof_response_body_for_content_types.py deleted file mode 100644 index b88819ef179..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_oneof_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_oneof_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostOneofResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types.py deleted file mode 100644 index fcdbccfce40..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_oneof_with_base_schema_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostOneofWithBaseSchemaResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types.py deleted file mode 100644 index 02e6abc4b11..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_oneof_with_empty_schema_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostOneofWithEmptySchemaResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_oneof_with_required_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_oneof_with_required_response_body_for_content_types.py deleted file mode 100644 index f5a9664a518..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_oneof_with_required_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_oneof_with_required_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostOneofWithRequiredResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types.py deleted file mode 100644 index 1a862e844b5..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_pattern_is_not_anchored_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostPatternIsNotAnchoredResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_pattern_validation_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_pattern_validation_response_body_for_content_types.py deleted file mode 100644 index 88c3da5de6a..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_pattern_validation_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_pattern_validation_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostPatternValidationResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types.py deleted file mode 100644 index 081476765eb..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_properties_with_escaped_characters_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostPropertiesWithEscapedCharactersResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types.py deleted file mode 100644 index 0b75f8b1480..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostPropertyNamedRefThatIsNotAReferenceResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types.py deleted file mode 100644 index 94fc9c9da2b..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_ref_in_additionalproperties_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostRefInAdditionalpropertiesResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_ref_in_allof_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_ref_in_allof_response_body_for_content_types.py deleted file mode 100644 index a40dcf8e5ad..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_ref_in_allof_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_ref_in_allof_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostRefInAllofResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_ref_in_anyof_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_ref_in_anyof_response_body_for_content_types.py deleted file mode 100644 index e0f407a0fd0..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_ref_in_anyof_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_ref_in_anyof_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostRefInAnyofResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_ref_in_items_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_ref_in_items_response_body_for_content_types.py deleted file mode 100644 index dae8c311469..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_ref_in_items_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_ref_in_items_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostRefInItemsResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_ref_in_not_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_ref_in_not_response_body_for_content_types.py deleted file mode 100644 index 383fa2cf0e1..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_ref_in_not_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_ref_in_not_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostRefInNotResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_ref_in_oneof_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_ref_in_oneof_response_body_for_content_types.py deleted file mode 100644 index 82d7f902729..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_ref_in_oneof_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_ref_in_oneof_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostRefInOneofResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_ref_in_property_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_ref_in_property_response_body_for_content_types.py deleted file mode 100644 index b2d7ad44682..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_ref_in_property_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_ref_in_property_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostRefInPropertyResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_required_default_validation_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_required_default_validation_response_body_for_content_types.py deleted file mode 100644 index 51feba56845..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_required_default_validation_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_required_default_validation_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostRequiredDefaultValidationResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_required_validation_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_required_validation_response_body_for_content_types.py deleted file mode 100644 index b41f1105d73..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_required_validation_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_required_validation_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostRequiredValidationResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_required_with_empty_array_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_required_with_empty_array_response_body_for_content_types.py deleted file mode 100644 index 928bbc72a71..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_required_with_empty_array_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_required_with_empty_array_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostRequiredWithEmptyArrayResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types.py deleted file mode 100644 index 50f83818f4b..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_required_with_escaped_characters_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostRequiredWithEscapedCharactersResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_simple_enum_validation_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_simple_enum_validation_response_body_for_content_types.py deleted file mode 100644 index d9e1b211f1c..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_simple_enum_validation_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_simple_enum_validation_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostSimpleEnumValidationResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_string_type_matches_strings_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_string_type_matches_strings_response_body_for_content_types.py deleted file mode 100644 index e7b69a99857..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_string_type_matches_strings_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_string_type_matches_strings_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostStringTypeMatchesStringsResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types.py deleted file mode 100644 index e591237938e..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types.py deleted file mode 100644 index 4ed02742f97..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_uniqueitems_false_validation_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostUniqueitemsFalseValidationResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_uniqueitems_validation_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_uniqueitems_validation_response_body_for_content_types.py deleted file mode 100644 index 11ef62e6f60..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_uniqueitems_validation_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_uniqueitems_validation_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostUniqueitemsValidationResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_uri_format_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_uri_format_response_body_for_content_types.py deleted file mode 100644 index a99810c7219..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_uri_format_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_uri_format_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostUriFormatResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_uri_reference_format_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_uri_reference_format_response_body_for_content_types.py deleted file mode 100644 index 61ffe53b6cf..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_uri_reference_format_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_uri_reference_format_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostUriReferenceFormatResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_uri_template_format_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_uri_template_format_response_body_for_content_types.py deleted file mode 100644 index 5a32fe18149..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_uri_template_format_response_body_for_content_types.py +++ /dev/null @@ -1,7 +0,0 @@ -from unit_test_api.paths.response_body_post_uri_template_format_response_body_for_content_types.post import ApiForpost - - -class ResponseBodyPostUriTemplateFormatResponseBodyForContentTypes( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tag_to_api.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tag_to_api.py deleted file mode 100644 index a40db5c5f90..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tag_to_api.py +++ /dev/null @@ -1,98 +0,0 @@ -import typing_extensions - -from unit_test_api.apis.tags import TagValues -from unit_test_api.apis.tags.operation_request_body_api import OperationRequestBodyApi -from unit_test_api.apis.tags.path_post_api import PathPostApi -from unit_test_api.apis.tags.content_type_json_api import ContentTypeJsonApi -from unit_test_api.apis.tags.response_content_content_type_schema_api import ResponseContentContentTypeSchemaApi -from unit_test_api.apis.tags.additional_properties_api import AdditionalPropertiesApi -from unit_test_api.apis.tags.all_of_api import AllOfApi -from unit_test_api.apis.tags.any_of_api import AnyOfApi -from unit_test_api.apis.tags.default_api import DefaultApi -from unit_test_api.apis.tags.enum_api import EnumApi -from unit_test_api.apis.tags.format_api import FormatApi -from unit_test_api.apis.tags.items_api import ItemsApi -from unit_test_api.apis.tags.maximum_api import MaximumApi -from unit_test_api.apis.tags.max_items_api import MaxItemsApi -from unit_test_api.apis.tags.max_length_api import MaxLengthApi -from unit_test_api.apis.tags.max_properties_api import MaxPropertiesApi -from unit_test_api.apis.tags.minimum_api import MinimumApi -from unit_test_api.apis.tags.min_items_api import MinItemsApi -from unit_test_api.apis.tags.min_length_api import MinLengthApi -from unit_test_api.apis.tags.min_properties_api import MinPropertiesApi -from unit_test_api.apis.tags.multiple_of_api import MultipleOfApi -from unit_test_api.apis.tags.model_not_api import ModelNotApi -from unit_test_api.apis.tags.one_of_api import OneOfApi -from unit_test_api.apis.tags.pattern_api import PatternApi -from unit_test_api.apis.tags.properties_api import PropertiesApi -from unit_test_api.apis.tags.ref_api import RefApi -from unit_test_api.apis.tags.required_api import RequiredApi -from unit_test_api.apis.tags.type_api import TypeApi -from unit_test_api.apis.tags.unique_items_api import UniqueItemsApi - -TagToApi = typing_extensions.TypedDict( - 'TagToApi', - { - TagValues.OPERATION_REQUEST_BODY: OperationRequestBodyApi, - TagValues.PATH_POST: PathPostApi, - TagValues.CONTENT_TYPE_JSON: ContentTypeJsonApi, - TagValues.RESPONSE_CONTENT_CONTENT_TYPE_SCHEMA: ResponseContentContentTypeSchemaApi, - TagValues.ADDITIONAL_PROPERTIES: AdditionalPropertiesApi, - TagValues.ALL_OF: AllOfApi, - TagValues.ANY_OF: AnyOfApi, - TagValues.DEFAULT: DefaultApi, - TagValues.ENUM: EnumApi, - TagValues.FORMAT: FormatApi, - TagValues.ITEMS: ItemsApi, - TagValues.MAXIMUM: MaximumApi, - TagValues.MAX_ITEMS: MaxItemsApi, - TagValues.MAX_LENGTH: MaxLengthApi, - TagValues.MAX_PROPERTIES: MaxPropertiesApi, - TagValues.MINIMUM: MinimumApi, - TagValues.MIN_ITEMS: MinItemsApi, - TagValues.MIN_LENGTH: MinLengthApi, - TagValues.MIN_PROPERTIES: MinPropertiesApi, - TagValues.MULTIPLE_OF: MultipleOfApi, - TagValues.NOT: ModelNotApi, - TagValues.ONE_OF: OneOfApi, - TagValues.PATTERN: PatternApi, - TagValues.PROPERTIES: PropertiesApi, - TagValues.REF: RefApi, - TagValues.REQUIRED: RequiredApi, - TagValues.TYPE: TypeApi, - TagValues.UNIQUE_ITEMS: UniqueItemsApi, - } -) - -tag_to_api = TagToApi( - { - TagValues.OPERATION_REQUEST_BODY: OperationRequestBodyApi, - TagValues.PATH_POST: PathPostApi, - TagValues.CONTENT_TYPE_JSON: ContentTypeJsonApi, - TagValues.RESPONSE_CONTENT_CONTENT_TYPE_SCHEMA: ResponseContentContentTypeSchemaApi, - TagValues.ADDITIONAL_PROPERTIES: AdditionalPropertiesApi, - TagValues.ALL_OF: AllOfApi, - TagValues.ANY_OF: AnyOfApi, - TagValues.DEFAULT: DefaultApi, - TagValues.ENUM: EnumApi, - TagValues.FORMAT: FormatApi, - TagValues.ITEMS: ItemsApi, - TagValues.MAXIMUM: MaximumApi, - TagValues.MAX_ITEMS: MaxItemsApi, - TagValues.MAX_LENGTH: MaxLengthApi, - TagValues.MAX_PROPERTIES: MaxPropertiesApi, - TagValues.MINIMUM: MinimumApi, - TagValues.MIN_ITEMS: MinItemsApi, - TagValues.MIN_LENGTH: MinLengthApi, - TagValues.MIN_PROPERTIES: MinPropertiesApi, - TagValues.MULTIPLE_OF: MultipleOfApi, - TagValues.NOT: ModelNotApi, - TagValues.ONE_OF: OneOfApi, - TagValues.PATTERN: PatternApi, - TagValues.PROPERTIES: PropertiesApi, - TagValues.REF: RefApi, - TagValues.REQUIRED: RequiredApi, - TagValues.TYPE: TypeApi, - TagValues.UNIQUE_ITEMS: UniqueItemsApi, - } -) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/__init__.py deleted file mode 100644 index 7a2dacb2e46..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/__init__.py +++ /dev/null @@ -1,36 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.apis.tag_to_api import tag_to_api - -import enum - - -class TagValues(str, enum.Enum): - OPERATION_REQUEST_BODY = "operation.requestBody" - PATH_POST = "path.post" - CONTENT_TYPE_JSON = "contentType_json" - RESPONSE_CONTENT_CONTENT_TYPE_SCHEMA = "response.content.contentType.schema" - ADDITIONAL_PROPERTIES = "additionalProperties" - ALL_OF = "allOf" - ANY_OF = "anyOf" - DEFAULT = "default" - ENUM = "enum" - FORMAT = "format" - ITEMS = "items" - MAXIMUM = "maximum" - MAX_ITEMS = "maxItems" - MAX_LENGTH = "maxLength" - MAX_PROPERTIES = "maxProperties" - MINIMUM = "minimum" - MIN_ITEMS = "minItems" - MIN_LENGTH = "minLength" - MIN_PROPERTIES = "minProperties" - MULTIPLE_OF = "multipleOf" - NOT = "not" - ONE_OF = "oneOf" - PATTERN = "pattern" - PROPERTIES = "properties" - REF = "$ref" - REQUIRED = "required" - TYPE = "type" - UNIQUE_ITEMS = "uniqueItems" diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/additional_properties_api.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/additional_properties_api.py deleted file mode 100644 index 764e56412cf..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/additional_properties_api.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from unit_test_api.paths.request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body.post import PostAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody -from unit_test_api.paths.response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types.post import PostAdditionalpropertiesAllowsASchemaWhichShouldValidateResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_additionalproperties_are_allowed_by_default_request_body.post import PostAdditionalpropertiesAreAllowedByDefaultRequestBody -from unit_test_api.paths.response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types.post import PostAdditionalpropertiesAreAllowedByDefaultResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_additionalproperties_can_exist_by_itself_request_body.post import PostAdditionalpropertiesCanExistByItselfRequestBody -from unit_test_api.paths.response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types.post import PostAdditionalpropertiesCanExistByItselfResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_additionalproperties_should_not_look_in_applicators_request_body.post import PostAdditionalpropertiesShouldNotLookInApplicatorsRequestBody -from unit_test_api.paths.response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types.post import PostAdditionalpropertiesShouldNotLookInApplicatorsResponseBodyForContentTypes - - -class AdditionalPropertiesApi( - PostAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody, - PostAdditionalpropertiesAllowsASchemaWhichShouldValidateResponseBodyForContentTypes, - PostAdditionalpropertiesAreAllowedByDefaultRequestBody, - PostAdditionalpropertiesAreAllowedByDefaultResponseBodyForContentTypes, - PostAdditionalpropertiesCanExistByItselfRequestBody, - PostAdditionalpropertiesCanExistByItselfResponseBodyForContentTypes, - PostAdditionalpropertiesShouldNotLookInApplicatorsRequestBody, - PostAdditionalpropertiesShouldNotLookInApplicatorsResponseBodyForContentTypes, -): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/all_of_api.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/all_of_api.py deleted file mode 100644 index cce0174269e..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/all_of_api.py +++ /dev/null @@ -1,57 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from unit_test_api.paths.request_body_post_allof_combined_with_anyof_oneof_request_body.post import PostAllofCombinedWithAnyofOneofRequestBody -from unit_test_api.paths.response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types.post import PostAllofCombinedWithAnyofOneofResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_allof_request_body.post import PostAllofRequestBody -from unit_test_api.paths.response_body_post_allof_response_body_for_content_types.post import PostAllofResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_allof_simple_types_request_body.post import PostAllofSimpleTypesRequestBody -from unit_test_api.paths.response_body_post_allof_simple_types_response_body_for_content_types.post import PostAllofSimpleTypesResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_allof_with_base_schema_request_body.post import PostAllofWithBaseSchemaRequestBody -from unit_test_api.paths.response_body_post_allof_with_base_schema_response_body_for_content_types.post import PostAllofWithBaseSchemaResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_allof_with_one_empty_schema_request_body.post import PostAllofWithOneEmptySchemaRequestBody -from unit_test_api.paths.response_body_post_allof_with_one_empty_schema_response_body_for_content_types.post import PostAllofWithOneEmptySchemaResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_allof_with_the_first_empty_schema_request_body.post import PostAllofWithTheFirstEmptySchemaRequestBody -from unit_test_api.paths.response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types.post import PostAllofWithTheFirstEmptySchemaResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_allof_with_the_last_empty_schema_request_body.post import PostAllofWithTheLastEmptySchemaRequestBody -from unit_test_api.paths.response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types.post import PostAllofWithTheLastEmptySchemaResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_allof_with_two_empty_schemas_request_body.post import PostAllofWithTwoEmptySchemasRequestBody -from unit_test_api.paths.response_body_post_allof_with_two_empty_schemas_response_body_for_content_types.post import PostAllofWithTwoEmptySchemasResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_nested_allof_to_check_validation_semantics_request_body.post import PostNestedAllofToCheckValidationSemanticsRequestBody -from unit_test_api.paths.response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types.post import PostNestedAllofToCheckValidationSemanticsResponseBodyForContentTypes - - -class AllOfApi( - PostAllofCombinedWithAnyofOneofRequestBody, - PostAllofCombinedWithAnyofOneofResponseBodyForContentTypes, - PostAllofRequestBody, - PostAllofResponseBodyForContentTypes, - PostAllofSimpleTypesRequestBody, - PostAllofSimpleTypesResponseBodyForContentTypes, - PostAllofWithBaseSchemaRequestBody, - PostAllofWithBaseSchemaResponseBodyForContentTypes, - PostAllofWithOneEmptySchemaRequestBody, - PostAllofWithOneEmptySchemaResponseBodyForContentTypes, - PostAllofWithTheFirstEmptySchemaRequestBody, - PostAllofWithTheFirstEmptySchemaResponseBodyForContentTypes, - PostAllofWithTheLastEmptySchemaRequestBody, - PostAllofWithTheLastEmptySchemaResponseBodyForContentTypes, - PostAllofWithTwoEmptySchemasRequestBody, - PostAllofWithTwoEmptySchemasResponseBodyForContentTypes, - PostNestedAllofToCheckValidationSemanticsRequestBody, - PostNestedAllofToCheckValidationSemanticsResponseBodyForContentTypes, -): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/any_of_api.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/any_of_api.py deleted file mode 100644 index de0242b5aed..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/any_of_api.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from unit_test_api.paths.request_body_post_anyof_complex_types_request_body.post import PostAnyofComplexTypesRequestBody -from unit_test_api.paths.response_body_post_anyof_complex_types_response_body_for_content_types.post import PostAnyofComplexTypesResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_anyof_request_body.post import PostAnyofRequestBody -from unit_test_api.paths.response_body_post_anyof_response_body_for_content_types.post import PostAnyofResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_anyof_with_base_schema_request_body.post import PostAnyofWithBaseSchemaRequestBody -from unit_test_api.paths.response_body_post_anyof_with_base_schema_response_body_for_content_types.post import PostAnyofWithBaseSchemaResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_anyof_with_one_empty_schema_request_body.post import PostAnyofWithOneEmptySchemaRequestBody -from unit_test_api.paths.response_body_post_anyof_with_one_empty_schema_response_body_for_content_types.post import PostAnyofWithOneEmptySchemaResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_nested_anyof_to_check_validation_semantics_request_body.post import PostNestedAnyofToCheckValidationSemanticsRequestBody -from unit_test_api.paths.response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types.post import PostNestedAnyofToCheckValidationSemanticsResponseBodyForContentTypes - - -class AnyOfApi( - PostAnyofComplexTypesRequestBody, - PostAnyofComplexTypesResponseBodyForContentTypes, - PostAnyofRequestBody, - PostAnyofResponseBodyForContentTypes, - PostAnyofWithBaseSchemaRequestBody, - PostAnyofWithBaseSchemaResponseBodyForContentTypes, - PostAnyofWithOneEmptySchemaRequestBody, - PostAnyofWithOneEmptySchemaResponseBodyForContentTypes, - PostNestedAnyofToCheckValidationSemanticsRequestBody, - PostNestedAnyofToCheckValidationSemanticsResponseBodyForContentTypes, -): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/content_type_json_api.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/content_type_json_api.py deleted file mode 100644 index 0e5d3b26c39..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/content_type_json_api.py +++ /dev/null @@ -1,369 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from unit_test_api.paths.request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body.post import PostAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody -from unit_test_api.paths.response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types.post import PostAdditionalpropertiesAllowsASchemaWhichShouldValidateResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_additionalproperties_are_allowed_by_default_request_body.post import PostAdditionalpropertiesAreAllowedByDefaultRequestBody -from unit_test_api.paths.response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types.post import PostAdditionalpropertiesAreAllowedByDefaultResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_additionalproperties_can_exist_by_itself_request_body.post import PostAdditionalpropertiesCanExistByItselfRequestBody -from unit_test_api.paths.response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types.post import PostAdditionalpropertiesCanExistByItselfResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_additionalproperties_should_not_look_in_applicators_request_body.post import PostAdditionalpropertiesShouldNotLookInApplicatorsRequestBody -from unit_test_api.paths.response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types.post import PostAdditionalpropertiesShouldNotLookInApplicatorsResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_allof_combined_with_anyof_oneof_request_body.post import PostAllofCombinedWithAnyofOneofRequestBody -from unit_test_api.paths.response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types.post import PostAllofCombinedWithAnyofOneofResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_allof_request_body.post import PostAllofRequestBody -from unit_test_api.paths.response_body_post_allof_response_body_for_content_types.post import PostAllofResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_allof_simple_types_request_body.post import PostAllofSimpleTypesRequestBody -from unit_test_api.paths.response_body_post_allof_simple_types_response_body_for_content_types.post import PostAllofSimpleTypesResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_allof_with_base_schema_request_body.post import PostAllofWithBaseSchemaRequestBody -from unit_test_api.paths.response_body_post_allof_with_base_schema_response_body_for_content_types.post import PostAllofWithBaseSchemaResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_allof_with_one_empty_schema_request_body.post import PostAllofWithOneEmptySchemaRequestBody -from unit_test_api.paths.response_body_post_allof_with_one_empty_schema_response_body_for_content_types.post import PostAllofWithOneEmptySchemaResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_allof_with_the_first_empty_schema_request_body.post import PostAllofWithTheFirstEmptySchemaRequestBody -from unit_test_api.paths.response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types.post import PostAllofWithTheFirstEmptySchemaResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_allof_with_the_last_empty_schema_request_body.post import PostAllofWithTheLastEmptySchemaRequestBody -from unit_test_api.paths.response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types.post import PostAllofWithTheLastEmptySchemaResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_allof_with_two_empty_schemas_request_body.post import PostAllofWithTwoEmptySchemasRequestBody -from unit_test_api.paths.response_body_post_allof_with_two_empty_schemas_response_body_for_content_types.post import PostAllofWithTwoEmptySchemasResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_anyof_complex_types_request_body.post import PostAnyofComplexTypesRequestBody -from unit_test_api.paths.response_body_post_anyof_complex_types_response_body_for_content_types.post import PostAnyofComplexTypesResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_anyof_request_body.post import PostAnyofRequestBody -from unit_test_api.paths.response_body_post_anyof_response_body_for_content_types.post import PostAnyofResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_anyof_with_base_schema_request_body.post import PostAnyofWithBaseSchemaRequestBody -from unit_test_api.paths.response_body_post_anyof_with_base_schema_response_body_for_content_types.post import PostAnyofWithBaseSchemaResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_anyof_with_one_empty_schema_request_body.post import PostAnyofWithOneEmptySchemaRequestBody -from unit_test_api.paths.response_body_post_anyof_with_one_empty_schema_response_body_for_content_types.post import PostAnyofWithOneEmptySchemaResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_array_type_matches_arrays_request_body.post import PostArrayTypeMatchesArraysRequestBody -from unit_test_api.paths.response_body_post_array_type_matches_arrays_response_body_for_content_types.post import PostArrayTypeMatchesArraysResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_boolean_type_matches_booleans_request_body.post import PostBooleanTypeMatchesBooleansRequestBody -from unit_test_api.paths.response_body_post_boolean_type_matches_booleans_response_body_for_content_types.post import PostBooleanTypeMatchesBooleansResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_by_int_request_body.post import PostByIntRequestBody -from unit_test_api.paths.response_body_post_by_int_response_body_for_content_types.post import PostByIntResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_by_number_request_body.post import PostByNumberRequestBody -from unit_test_api.paths.response_body_post_by_number_response_body_for_content_types.post import PostByNumberResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_by_small_number_request_body.post import PostBySmallNumberRequestBody -from unit_test_api.paths.response_body_post_by_small_number_response_body_for_content_types.post import PostBySmallNumberResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_date_time_format_request_body.post import PostDateTimeFormatRequestBody -from unit_test_api.paths.response_body_post_date_time_format_response_body_for_content_types.post import PostDateTimeFormatResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_email_format_request_body.post import PostEmailFormatRequestBody -from unit_test_api.paths.response_body_post_email_format_response_body_for_content_types.post import PostEmailFormatResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_enum_with0_does_not_match_false_request_body.post import PostEnumWith0DoesNotMatchFalseRequestBody -from unit_test_api.paths.response_body_post_enum_with0_does_not_match_false_response_body_for_content_types.post import PostEnumWith0DoesNotMatchFalseResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_enum_with1_does_not_match_true_request_body.post import PostEnumWith1DoesNotMatchTrueRequestBody -from unit_test_api.paths.response_body_post_enum_with1_does_not_match_true_response_body_for_content_types.post import PostEnumWith1DoesNotMatchTrueResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_enum_with_escaped_characters_request_body.post import PostEnumWithEscapedCharactersRequestBody -from unit_test_api.paths.response_body_post_enum_with_escaped_characters_response_body_for_content_types.post import PostEnumWithEscapedCharactersResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_enum_with_false_does_not_match0_request_body.post import PostEnumWithFalseDoesNotMatch0RequestBody -from unit_test_api.paths.response_body_post_enum_with_false_does_not_match0_response_body_for_content_types.post import PostEnumWithFalseDoesNotMatch0ResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_enum_with_true_does_not_match1_request_body.post import PostEnumWithTrueDoesNotMatch1RequestBody -from unit_test_api.paths.response_body_post_enum_with_true_does_not_match1_response_body_for_content_types.post import PostEnumWithTrueDoesNotMatch1ResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_enums_in_properties_request_body.post import PostEnumsInPropertiesRequestBody -from unit_test_api.paths.response_body_post_enums_in_properties_response_body_for_content_types.post import PostEnumsInPropertiesResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_forbidden_property_request_body.post import PostForbiddenPropertyRequestBody -from unit_test_api.paths.response_body_post_forbidden_property_response_body_for_content_types.post import PostForbiddenPropertyResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_hostname_format_request_body.post import PostHostnameFormatRequestBody -from unit_test_api.paths.response_body_post_hostname_format_response_body_for_content_types.post import PostHostnameFormatResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_integer_type_matches_integers_request_body.post import PostIntegerTypeMatchesIntegersRequestBody -from unit_test_api.paths.response_body_post_integer_type_matches_integers_response_body_for_content_types.post import PostIntegerTypeMatchesIntegersResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body.post import PostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody -from unit_test_api.paths.response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types.post import PostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_invalid_string_value_for_default_request_body.post import PostInvalidStringValueForDefaultRequestBody -from unit_test_api.paths.response_body_post_invalid_string_value_for_default_response_body_for_content_types.post import PostInvalidStringValueForDefaultResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_ipv4_format_request_body.post import PostIpv4FormatRequestBody -from unit_test_api.paths.response_body_post_ipv4_format_response_body_for_content_types.post import PostIpv4FormatResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_ipv6_format_request_body.post import PostIpv6FormatRequestBody -from unit_test_api.paths.response_body_post_ipv6_format_response_body_for_content_types.post import PostIpv6FormatResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_json_pointer_format_request_body.post import PostJsonPointerFormatRequestBody -from unit_test_api.paths.response_body_post_json_pointer_format_response_body_for_content_types.post import PostJsonPointerFormatResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_maximum_validation_request_body.post import PostMaximumValidationRequestBody -from unit_test_api.paths.response_body_post_maximum_validation_response_body_for_content_types.post import PostMaximumValidationResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_maximum_validation_with_unsigned_integer_request_body.post import PostMaximumValidationWithUnsignedIntegerRequestBody -from unit_test_api.paths.response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types.post import PostMaximumValidationWithUnsignedIntegerResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_maxitems_validation_request_body.post import PostMaxitemsValidationRequestBody -from unit_test_api.paths.response_body_post_maxitems_validation_response_body_for_content_types.post import PostMaxitemsValidationResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_maxlength_validation_request_body.post import PostMaxlengthValidationRequestBody -from unit_test_api.paths.response_body_post_maxlength_validation_response_body_for_content_types.post import PostMaxlengthValidationResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_maxproperties0_means_the_object_is_empty_request_body.post import PostMaxproperties0MeansTheObjectIsEmptyRequestBody -from unit_test_api.paths.response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types.post import PostMaxproperties0MeansTheObjectIsEmptyResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_maxproperties_validation_request_body.post import PostMaxpropertiesValidationRequestBody -from unit_test_api.paths.response_body_post_maxproperties_validation_response_body_for_content_types.post import PostMaxpropertiesValidationResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_minimum_validation_request_body.post import PostMinimumValidationRequestBody -from unit_test_api.paths.response_body_post_minimum_validation_response_body_for_content_types.post import PostMinimumValidationResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_minimum_validation_with_signed_integer_request_body.post import PostMinimumValidationWithSignedIntegerRequestBody -from unit_test_api.paths.response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types.post import PostMinimumValidationWithSignedIntegerResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_minitems_validation_request_body.post import PostMinitemsValidationRequestBody -from unit_test_api.paths.response_body_post_minitems_validation_response_body_for_content_types.post import PostMinitemsValidationResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_minlength_validation_request_body.post import PostMinlengthValidationRequestBody -from unit_test_api.paths.response_body_post_minlength_validation_response_body_for_content_types.post import PostMinlengthValidationResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_minproperties_validation_request_body.post import PostMinpropertiesValidationRequestBody -from unit_test_api.paths.response_body_post_minproperties_validation_response_body_for_content_types.post import PostMinpropertiesValidationResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_nested_allof_to_check_validation_semantics_request_body.post import PostNestedAllofToCheckValidationSemanticsRequestBody -from unit_test_api.paths.response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types.post import PostNestedAllofToCheckValidationSemanticsResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_nested_anyof_to_check_validation_semantics_request_body.post import PostNestedAnyofToCheckValidationSemanticsRequestBody -from unit_test_api.paths.response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types.post import PostNestedAnyofToCheckValidationSemanticsResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_nested_items_request_body.post import PostNestedItemsRequestBody -from unit_test_api.paths.response_body_post_nested_items_response_body_for_content_types.post import PostNestedItemsResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_nested_oneof_to_check_validation_semantics_request_body.post import PostNestedOneofToCheckValidationSemanticsRequestBody -from unit_test_api.paths.response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types.post import PostNestedOneofToCheckValidationSemanticsResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_not_more_complex_schema_request_body.post import PostNotMoreComplexSchemaRequestBody -from unit_test_api.paths.response_body_post_not_more_complex_schema_response_body_for_content_types.post import PostNotMoreComplexSchemaResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_not_request_body.post import PostNotRequestBody -from unit_test_api.paths.response_body_post_not_response_body_for_content_types.post import PostNotResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_nul_characters_in_strings_request_body.post import PostNulCharactersInStringsRequestBody -from unit_test_api.paths.response_body_post_nul_characters_in_strings_response_body_for_content_types.post import PostNulCharactersInStringsResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_null_type_matches_only_the_null_object_request_body.post import PostNullTypeMatchesOnlyTheNullObjectRequestBody -from unit_test_api.paths.response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types.post import PostNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_number_type_matches_numbers_request_body.post import PostNumberTypeMatchesNumbersRequestBody -from unit_test_api.paths.response_body_post_number_type_matches_numbers_response_body_for_content_types.post import PostNumberTypeMatchesNumbersResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_object_properties_validation_request_body.post import PostObjectPropertiesValidationRequestBody -from unit_test_api.paths.response_body_post_object_properties_validation_response_body_for_content_types.post import PostObjectPropertiesValidationResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_object_type_matches_objects_request_body.post import PostObjectTypeMatchesObjectsRequestBody -from unit_test_api.paths.response_body_post_object_type_matches_objects_response_body_for_content_types.post import PostObjectTypeMatchesObjectsResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_oneof_complex_types_request_body.post import PostOneofComplexTypesRequestBody -from unit_test_api.paths.response_body_post_oneof_complex_types_response_body_for_content_types.post import PostOneofComplexTypesResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_oneof_request_body.post import PostOneofRequestBody -from unit_test_api.paths.response_body_post_oneof_response_body_for_content_types.post import PostOneofResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_oneof_with_base_schema_request_body.post import PostOneofWithBaseSchemaRequestBody -from unit_test_api.paths.response_body_post_oneof_with_base_schema_response_body_for_content_types.post import PostOneofWithBaseSchemaResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_oneof_with_empty_schema_request_body.post import PostOneofWithEmptySchemaRequestBody -from unit_test_api.paths.response_body_post_oneof_with_empty_schema_response_body_for_content_types.post import PostOneofWithEmptySchemaResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_oneof_with_required_request_body.post import PostOneofWithRequiredRequestBody -from unit_test_api.paths.response_body_post_oneof_with_required_response_body_for_content_types.post import PostOneofWithRequiredResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_pattern_is_not_anchored_request_body.post import PostPatternIsNotAnchoredRequestBody -from unit_test_api.paths.response_body_post_pattern_is_not_anchored_response_body_for_content_types.post import PostPatternIsNotAnchoredResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_pattern_validation_request_body.post import PostPatternValidationRequestBody -from unit_test_api.paths.response_body_post_pattern_validation_response_body_for_content_types.post import PostPatternValidationResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_properties_with_escaped_characters_request_body.post import PostPropertiesWithEscapedCharactersRequestBody -from unit_test_api.paths.response_body_post_properties_with_escaped_characters_response_body_for_content_types.post import PostPropertiesWithEscapedCharactersResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_property_named_ref_that_is_not_a_reference_request_body.post import PostPropertyNamedRefThatIsNotAReferenceRequestBody -from unit_test_api.paths.response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types.post import PostPropertyNamedRefThatIsNotAReferenceResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_ref_in_additionalproperties_request_body.post import PostRefInAdditionalpropertiesRequestBody -from unit_test_api.paths.response_body_post_ref_in_additionalproperties_response_body_for_content_types.post import PostRefInAdditionalpropertiesResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_ref_in_allof_request_body.post import PostRefInAllofRequestBody -from unit_test_api.paths.response_body_post_ref_in_allof_response_body_for_content_types.post import PostRefInAllofResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_ref_in_anyof_request_body.post import PostRefInAnyofRequestBody -from unit_test_api.paths.response_body_post_ref_in_anyof_response_body_for_content_types.post import PostRefInAnyofResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_ref_in_items_request_body.post import PostRefInItemsRequestBody -from unit_test_api.paths.response_body_post_ref_in_items_response_body_for_content_types.post import PostRefInItemsResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_ref_in_not_request_body.post import PostRefInNotRequestBody -from unit_test_api.paths.response_body_post_ref_in_not_response_body_for_content_types.post import PostRefInNotResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_ref_in_oneof_request_body.post import PostRefInOneofRequestBody -from unit_test_api.paths.response_body_post_ref_in_oneof_response_body_for_content_types.post import PostRefInOneofResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_ref_in_property_request_body.post import PostRefInPropertyRequestBody -from unit_test_api.paths.response_body_post_ref_in_property_response_body_for_content_types.post import PostRefInPropertyResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_required_default_validation_request_body.post import PostRequiredDefaultValidationRequestBody -from unit_test_api.paths.response_body_post_required_default_validation_response_body_for_content_types.post import PostRequiredDefaultValidationResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_required_validation_request_body.post import PostRequiredValidationRequestBody -from unit_test_api.paths.response_body_post_required_validation_response_body_for_content_types.post import PostRequiredValidationResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_required_with_empty_array_request_body.post import PostRequiredWithEmptyArrayRequestBody -from unit_test_api.paths.response_body_post_required_with_empty_array_response_body_for_content_types.post import PostRequiredWithEmptyArrayResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_required_with_escaped_characters_request_body.post import PostRequiredWithEscapedCharactersRequestBody -from unit_test_api.paths.response_body_post_required_with_escaped_characters_response_body_for_content_types.post import PostRequiredWithEscapedCharactersResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_simple_enum_validation_request_body.post import PostSimpleEnumValidationRequestBody -from unit_test_api.paths.response_body_post_simple_enum_validation_response_body_for_content_types.post import PostSimpleEnumValidationResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_string_type_matches_strings_request_body.post import PostStringTypeMatchesStringsRequestBody -from unit_test_api.paths.response_body_post_string_type_matches_strings_response_body_for_content_types.post import PostStringTypeMatchesStringsResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.post import PostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody -from unit_test_api.paths.response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types.post import PostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_uniqueitems_false_validation_request_body.post import PostUniqueitemsFalseValidationRequestBody -from unit_test_api.paths.response_body_post_uniqueitems_false_validation_response_body_for_content_types.post import PostUniqueitemsFalseValidationResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_uniqueitems_validation_request_body.post import PostUniqueitemsValidationRequestBody -from unit_test_api.paths.response_body_post_uniqueitems_validation_response_body_for_content_types.post import PostUniqueitemsValidationResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_uri_format_request_body.post import PostUriFormatRequestBody -from unit_test_api.paths.response_body_post_uri_format_response_body_for_content_types.post import PostUriFormatResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_uri_reference_format_request_body.post import PostUriReferenceFormatRequestBody -from unit_test_api.paths.response_body_post_uri_reference_format_response_body_for_content_types.post import PostUriReferenceFormatResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_uri_template_format_request_body.post import PostUriTemplateFormatRequestBody -from unit_test_api.paths.response_body_post_uri_template_format_response_body_for_content_types.post import PostUriTemplateFormatResponseBodyForContentTypes - - -class ContentTypeJsonApi( - PostAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody, - PostAdditionalpropertiesAllowsASchemaWhichShouldValidateResponseBodyForContentTypes, - PostAdditionalpropertiesAreAllowedByDefaultRequestBody, - PostAdditionalpropertiesAreAllowedByDefaultResponseBodyForContentTypes, - PostAdditionalpropertiesCanExistByItselfRequestBody, - PostAdditionalpropertiesCanExistByItselfResponseBodyForContentTypes, - PostAdditionalpropertiesShouldNotLookInApplicatorsRequestBody, - PostAdditionalpropertiesShouldNotLookInApplicatorsResponseBodyForContentTypes, - PostAllofCombinedWithAnyofOneofRequestBody, - PostAllofCombinedWithAnyofOneofResponseBodyForContentTypes, - PostAllofRequestBody, - PostAllofResponseBodyForContentTypes, - PostAllofSimpleTypesRequestBody, - PostAllofSimpleTypesResponseBodyForContentTypes, - PostAllofWithBaseSchemaRequestBody, - PostAllofWithBaseSchemaResponseBodyForContentTypes, - PostAllofWithOneEmptySchemaRequestBody, - PostAllofWithOneEmptySchemaResponseBodyForContentTypes, - PostAllofWithTheFirstEmptySchemaRequestBody, - PostAllofWithTheFirstEmptySchemaResponseBodyForContentTypes, - PostAllofWithTheLastEmptySchemaRequestBody, - PostAllofWithTheLastEmptySchemaResponseBodyForContentTypes, - PostAllofWithTwoEmptySchemasRequestBody, - PostAllofWithTwoEmptySchemasResponseBodyForContentTypes, - PostAnyofComplexTypesRequestBody, - PostAnyofComplexTypesResponseBodyForContentTypes, - PostAnyofRequestBody, - PostAnyofResponseBodyForContentTypes, - PostAnyofWithBaseSchemaRequestBody, - PostAnyofWithBaseSchemaResponseBodyForContentTypes, - PostAnyofWithOneEmptySchemaRequestBody, - PostAnyofWithOneEmptySchemaResponseBodyForContentTypes, - PostArrayTypeMatchesArraysRequestBody, - PostArrayTypeMatchesArraysResponseBodyForContentTypes, - PostBooleanTypeMatchesBooleansRequestBody, - PostBooleanTypeMatchesBooleansResponseBodyForContentTypes, - PostByIntRequestBody, - PostByIntResponseBodyForContentTypes, - PostByNumberRequestBody, - PostByNumberResponseBodyForContentTypes, - PostBySmallNumberRequestBody, - PostBySmallNumberResponseBodyForContentTypes, - PostDateTimeFormatRequestBody, - PostDateTimeFormatResponseBodyForContentTypes, - PostEmailFormatRequestBody, - PostEmailFormatResponseBodyForContentTypes, - PostEnumWith0DoesNotMatchFalseRequestBody, - PostEnumWith0DoesNotMatchFalseResponseBodyForContentTypes, - PostEnumWith1DoesNotMatchTrueRequestBody, - PostEnumWith1DoesNotMatchTrueResponseBodyForContentTypes, - PostEnumWithEscapedCharactersRequestBody, - PostEnumWithEscapedCharactersResponseBodyForContentTypes, - PostEnumWithFalseDoesNotMatch0RequestBody, - PostEnumWithFalseDoesNotMatch0ResponseBodyForContentTypes, - PostEnumWithTrueDoesNotMatch1RequestBody, - PostEnumWithTrueDoesNotMatch1ResponseBodyForContentTypes, - PostEnumsInPropertiesRequestBody, - PostEnumsInPropertiesResponseBodyForContentTypes, - PostForbiddenPropertyRequestBody, - PostForbiddenPropertyResponseBodyForContentTypes, - PostHostnameFormatRequestBody, - PostHostnameFormatResponseBodyForContentTypes, - PostIntegerTypeMatchesIntegersRequestBody, - PostIntegerTypeMatchesIntegersResponseBodyForContentTypes, - PostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody, - PostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfResponseBodyForContentTypes, - PostInvalidStringValueForDefaultRequestBody, - PostInvalidStringValueForDefaultResponseBodyForContentTypes, - PostIpv4FormatRequestBody, - PostIpv4FormatResponseBodyForContentTypes, - PostIpv6FormatRequestBody, - PostIpv6FormatResponseBodyForContentTypes, - PostJsonPointerFormatRequestBody, - PostJsonPointerFormatResponseBodyForContentTypes, - PostMaximumValidationRequestBody, - PostMaximumValidationResponseBodyForContentTypes, - PostMaximumValidationWithUnsignedIntegerRequestBody, - PostMaximumValidationWithUnsignedIntegerResponseBodyForContentTypes, - PostMaxitemsValidationRequestBody, - PostMaxitemsValidationResponseBodyForContentTypes, - PostMaxlengthValidationRequestBody, - PostMaxlengthValidationResponseBodyForContentTypes, - PostMaxproperties0MeansTheObjectIsEmptyRequestBody, - PostMaxproperties0MeansTheObjectIsEmptyResponseBodyForContentTypes, - PostMaxpropertiesValidationRequestBody, - PostMaxpropertiesValidationResponseBodyForContentTypes, - PostMinimumValidationRequestBody, - PostMinimumValidationResponseBodyForContentTypes, - PostMinimumValidationWithSignedIntegerRequestBody, - PostMinimumValidationWithSignedIntegerResponseBodyForContentTypes, - PostMinitemsValidationRequestBody, - PostMinitemsValidationResponseBodyForContentTypes, - PostMinlengthValidationRequestBody, - PostMinlengthValidationResponseBodyForContentTypes, - PostMinpropertiesValidationRequestBody, - PostMinpropertiesValidationResponseBodyForContentTypes, - PostNestedAllofToCheckValidationSemanticsRequestBody, - PostNestedAllofToCheckValidationSemanticsResponseBodyForContentTypes, - PostNestedAnyofToCheckValidationSemanticsRequestBody, - PostNestedAnyofToCheckValidationSemanticsResponseBodyForContentTypes, - PostNestedItemsRequestBody, - PostNestedItemsResponseBodyForContentTypes, - PostNestedOneofToCheckValidationSemanticsRequestBody, - PostNestedOneofToCheckValidationSemanticsResponseBodyForContentTypes, - PostNotMoreComplexSchemaRequestBody, - PostNotMoreComplexSchemaResponseBodyForContentTypes, - PostNotRequestBody, - PostNotResponseBodyForContentTypes, - PostNulCharactersInStringsRequestBody, - PostNulCharactersInStringsResponseBodyForContentTypes, - PostNullTypeMatchesOnlyTheNullObjectRequestBody, - PostNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes, - PostNumberTypeMatchesNumbersRequestBody, - PostNumberTypeMatchesNumbersResponseBodyForContentTypes, - PostObjectPropertiesValidationRequestBody, - PostObjectPropertiesValidationResponseBodyForContentTypes, - PostObjectTypeMatchesObjectsRequestBody, - PostObjectTypeMatchesObjectsResponseBodyForContentTypes, - PostOneofComplexTypesRequestBody, - PostOneofComplexTypesResponseBodyForContentTypes, - PostOneofRequestBody, - PostOneofResponseBodyForContentTypes, - PostOneofWithBaseSchemaRequestBody, - PostOneofWithBaseSchemaResponseBodyForContentTypes, - PostOneofWithEmptySchemaRequestBody, - PostOneofWithEmptySchemaResponseBodyForContentTypes, - PostOneofWithRequiredRequestBody, - PostOneofWithRequiredResponseBodyForContentTypes, - PostPatternIsNotAnchoredRequestBody, - PostPatternIsNotAnchoredResponseBodyForContentTypes, - PostPatternValidationRequestBody, - PostPatternValidationResponseBodyForContentTypes, - PostPropertiesWithEscapedCharactersRequestBody, - PostPropertiesWithEscapedCharactersResponseBodyForContentTypes, - PostPropertyNamedRefThatIsNotAReferenceRequestBody, - PostPropertyNamedRefThatIsNotAReferenceResponseBodyForContentTypes, - PostRefInAdditionalpropertiesRequestBody, - PostRefInAdditionalpropertiesResponseBodyForContentTypes, - PostRefInAllofRequestBody, - PostRefInAllofResponseBodyForContentTypes, - PostRefInAnyofRequestBody, - PostRefInAnyofResponseBodyForContentTypes, - PostRefInItemsRequestBody, - PostRefInItemsResponseBodyForContentTypes, - PostRefInNotRequestBody, - PostRefInNotResponseBodyForContentTypes, - PostRefInOneofRequestBody, - PostRefInOneofResponseBodyForContentTypes, - PostRefInPropertyRequestBody, - PostRefInPropertyResponseBodyForContentTypes, - PostRequiredDefaultValidationRequestBody, - PostRequiredDefaultValidationResponseBodyForContentTypes, - PostRequiredValidationRequestBody, - PostRequiredValidationResponseBodyForContentTypes, - PostRequiredWithEmptyArrayRequestBody, - PostRequiredWithEmptyArrayResponseBodyForContentTypes, - PostRequiredWithEscapedCharactersRequestBody, - PostRequiredWithEscapedCharactersResponseBodyForContentTypes, - PostSimpleEnumValidationRequestBody, - PostSimpleEnumValidationResponseBodyForContentTypes, - PostStringTypeMatchesStringsRequestBody, - PostStringTypeMatchesStringsResponseBodyForContentTypes, - PostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody, - PostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyForContentTypes, - PostUniqueitemsFalseValidationRequestBody, - PostUniqueitemsFalseValidationResponseBodyForContentTypes, - PostUniqueitemsValidationRequestBody, - PostUniqueitemsValidationResponseBodyForContentTypes, - PostUriFormatRequestBody, - PostUriFormatResponseBodyForContentTypes, - PostUriReferenceFormatRequestBody, - PostUriReferenceFormatResponseBodyForContentTypes, - PostUriTemplateFormatRequestBody, - PostUriTemplateFormatResponseBodyForContentTypes, -): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/default_api.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/default_api.py deleted file mode 100644 index 63ec1b87fe7..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/default_api.py +++ /dev/null @@ -1,29 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from unit_test_api.paths.request_body_post_invalid_string_value_for_default_request_body.post import PostInvalidStringValueForDefaultRequestBody -from unit_test_api.paths.response_body_post_invalid_string_value_for_default_response_body_for_content_types.post import PostInvalidStringValueForDefaultResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.post import PostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody -from unit_test_api.paths.response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types.post import PostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyForContentTypes - - -class DefaultApi( - PostInvalidStringValueForDefaultRequestBody, - PostInvalidStringValueForDefaultResponseBodyForContentTypes, - PostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody, - PostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyForContentTypes, -): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/enum_api.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/enum_api.py deleted file mode 100644 index a5fe3006617..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/enum_api.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from unit_test_api.paths.request_body_post_enum_with0_does_not_match_false_request_body.post import PostEnumWith0DoesNotMatchFalseRequestBody -from unit_test_api.paths.response_body_post_enum_with0_does_not_match_false_response_body_for_content_types.post import PostEnumWith0DoesNotMatchFalseResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_enum_with1_does_not_match_true_request_body.post import PostEnumWith1DoesNotMatchTrueRequestBody -from unit_test_api.paths.response_body_post_enum_with1_does_not_match_true_response_body_for_content_types.post import PostEnumWith1DoesNotMatchTrueResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_enum_with_escaped_characters_request_body.post import PostEnumWithEscapedCharactersRequestBody -from unit_test_api.paths.response_body_post_enum_with_escaped_characters_response_body_for_content_types.post import PostEnumWithEscapedCharactersResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_enum_with_false_does_not_match0_request_body.post import PostEnumWithFalseDoesNotMatch0RequestBody -from unit_test_api.paths.response_body_post_enum_with_false_does_not_match0_response_body_for_content_types.post import PostEnumWithFalseDoesNotMatch0ResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_enum_with_true_does_not_match1_request_body.post import PostEnumWithTrueDoesNotMatch1RequestBody -from unit_test_api.paths.response_body_post_enum_with_true_does_not_match1_response_body_for_content_types.post import PostEnumWithTrueDoesNotMatch1ResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_enums_in_properties_request_body.post import PostEnumsInPropertiesRequestBody -from unit_test_api.paths.response_body_post_enums_in_properties_response_body_for_content_types.post import PostEnumsInPropertiesResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_nul_characters_in_strings_request_body.post import PostNulCharactersInStringsRequestBody -from unit_test_api.paths.response_body_post_nul_characters_in_strings_response_body_for_content_types.post import PostNulCharactersInStringsResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_simple_enum_validation_request_body.post import PostSimpleEnumValidationRequestBody -from unit_test_api.paths.response_body_post_simple_enum_validation_response_body_for_content_types.post import PostSimpleEnumValidationResponseBodyForContentTypes - - -class EnumApi( - PostEnumWith0DoesNotMatchFalseRequestBody, - PostEnumWith0DoesNotMatchFalseResponseBodyForContentTypes, - PostEnumWith1DoesNotMatchTrueRequestBody, - PostEnumWith1DoesNotMatchTrueResponseBodyForContentTypes, - PostEnumWithEscapedCharactersRequestBody, - PostEnumWithEscapedCharactersResponseBodyForContentTypes, - PostEnumWithFalseDoesNotMatch0RequestBody, - PostEnumWithFalseDoesNotMatch0ResponseBodyForContentTypes, - PostEnumWithTrueDoesNotMatch1RequestBody, - PostEnumWithTrueDoesNotMatch1ResponseBodyForContentTypes, - PostEnumsInPropertiesRequestBody, - PostEnumsInPropertiesResponseBodyForContentTypes, - PostNulCharactersInStringsRequestBody, - PostNulCharactersInStringsResponseBodyForContentTypes, - PostSimpleEnumValidationRequestBody, - PostSimpleEnumValidationResponseBodyForContentTypes, -): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/format_api.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/format_api.py deleted file mode 100644 index 2741a9bac77..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/format_api.py +++ /dev/null @@ -1,57 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from unit_test_api.paths.request_body_post_date_time_format_request_body.post import PostDateTimeFormatRequestBody -from unit_test_api.paths.response_body_post_date_time_format_response_body_for_content_types.post import PostDateTimeFormatResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_email_format_request_body.post import PostEmailFormatRequestBody -from unit_test_api.paths.response_body_post_email_format_response_body_for_content_types.post import PostEmailFormatResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_hostname_format_request_body.post import PostHostnameFormatRequestBody -from unit_test_api.paths.response_body_post_hostname_format_response_body_for_content_types.post import PostHostnameFormatResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_ipv4_format_request_body.post import PostIpv4FormatRequestBody -from unit_test_api.paths.response_body_post_ipv4_format_response_body_for_content_types.post import PostIpv4FormatResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_ipv6_format_request_body.post import PostIpv6FormatRequestBody -from unit_test_api.paths.response_body_post_ipv6_format_response_body_for_content_types.post import PostIpv6FormatResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_json_pointer_format_request_body.post import PostJsonPointerFormatRequestBody -from unit_test_api.paths.response_body_post_json_pointer_format_response_body_for_content_types.post import PostJsonPointerFormatResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_uri_format_request_body.post import PostUriFormatRequestBody -from unit_test_api.paths.response_body_post_uri_format_response_body_for_content_types.post import PostUriFormatResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_uri_reference_format_request_body.post import PostUriReferenceFormatRequestBody -from unit_test_api.paths.response_body_post_uri_reference_format_response_body_for_content_types.post import PostUriReferenceFormatResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_uri_template_format_request_body.post import PostUriTemplateFormatRequestBody -from unit_test_api.paths.response_body_post_uri_template_format_response_body_for_content_types.post import PostUriTemplateFormatResponseBodyForContentTypes - - -class FormatApi( - PostDateTimeFormatRequestBody, - PostDateTimeFormatResponseBodyForContentTypes, - PostEmailFormatRequestBody, - PostEmailFormatResponseBodyForContentTypes, - PostHostnameFormatRequestBody, - PostHostnameFormatResponseBodyForContentTypes, - PostIpv4FormatRequestBody, - PostIpv4FormatResponseBodyForContentTypes, - PostIpv6FormatRequestBody, - PostIpv6FormatResponseBodyForContentTypes, - PostJsonPointerFormatRequestBody, - PostJsonPointerFormatResponseBodyForContentTypes, - PostUriFormatRequestBody, - PostUriFormatResponseBodyForContentTypes, - PostUriReferenceFormatRequestBody, - PostUriReferenceFormatResponseBodyForContentTypes, - PostUriTemplateFormatRequestBody, - PostUriTemplateFormatResponseBodyForContentTypes, -): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/items_api.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/items_api.py deleted file mode 100644 index edfe56e91f9..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/items_api.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from unit_test_api.paths.request_body_post_nested_items_request_body.post import PostNestedItemsRequestBody -from unit_test_api.paths.response_body_post_nested_items_response_body_for_content_types.post import PostNestedItemsResponseBodyForContentTypes - - -class ItemsApi( - PostNestedItemsRequestBody, - PostNestedItemsResponseBodyForContentTypes, -): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/max_items_api.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/max_items_api.py deleted file mode 100644 index 4d06489252c..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/max_items_api.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from unit_test_api.paths.request_body_post_maxitems_validation_request_body.post import PostMaxitemsValidationRequestBody -from unit_test_api.paths.response_body_post_maxitems_validation_response_body_for_content_types.post import PostMaxitemsValidationResponseBodyForContentTypes - - -class MaxItemsApi( - PostMaxitemsValidationRequestBody, - PostMaxitemsValidationResponseBodyForContentTypes, -): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/max_length_api.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/max_length_api.py deleted file mode 100644 index 693a1ef965b..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/max_length_api.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from unit_test_api.paths.request_body_post_maxlength_validation_request_body.post import PostMaxlengthValidationRequestBody -from unit_test_api.paths.response_body_post_maxlength_validation_response_body_for_content_types.post import PostMaxlengthValidationResponseBodyForContentTypes - - -class MaxLengthApi( - PostMaxlengthValidationRequestBody, - PostMaxlengthValidationResponseBodyForContentTypes, -): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/max_properties_api.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/max_properties_api.py deleted file mode 100644 index 56c90ed28c0..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/max_properties_api.py +++ /dev/null @@ -1,29 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from unit_test_api.paths.request_body_post_maxproperties0_means_the_object_is_empty_request_body.post import PostMaxproperties0MeansTheObjectIsEmptyRequestBody -from unit_test_api.paths.response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types.post import PostMaxproperties0MeansTheObjectIsEmptyResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_maxproperties_validation_request_body.post import PostMaxpropertiesValidationRequestBody -from unit_test_api.paths.response_body_post_maxproperties_validation_response_body_for_content_types.post import PostMaxpropertiesValidationResponseBodyForContentTypes - - -class MaxPropertiesApi( - PostMaxproperties0MeansTheObjectIsEmptyRequestBody, - PostMaxproperties0MeansTheObjectIsEmptyResponseBodyForContentTypes, - PostMaxpropertiesValidationRequestBody, - PostMaxpropertiesValidationResponseBodyForContentTypes, -): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/maximum_api.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/maximum_api.py deleted file mode 100644 index 017bc30650a..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/maximum_api.py +++ /dev/null @@ -1,29 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from unit_test_api.paths.request_body_post_maximum_validation_request_body.post import PostMaximumValidationRequestBody -from unit_test_api.paths.response_body_post_maximum_validation_response_body_for_content_types.post import PostMaximumValidationResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_maximum_validation_with_unsigned_integer_request_body.post import PostMaximumValidationWithUnsignedIntegerRequestBody -from unit_test_api.paths.response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types.post import PostMaximumValidationWithUnsignedIntegerResponseBodyForContentTypes - - -class MaximumApi( - PostMaximumValidationRequestBody, - PostMaximumValidationResponseBodyForContentTypes, - PostMaximumValidationWithUnsignedIntegerRequestBody, - PostMaximumValidationWithUnsignedIntegerResponseBodyForContentTypes, -): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/min_items_api.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/min_items_api.py deleted file mode 100644 index 93f1ae37b0c..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/min_items_api.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from unit_test_api.paths.request_body_post_minitems_validation_request_body.post import PostMinitemsValidationRequestBody -from unit_test_api.paths.response_body_post_minitems_validation_response_body_for_content_types.post import PostMinitemsValidationResponseBodyForContentTypes - - -class MinItemsApi( - PostMinitemsValidationRequestBody, - PostMinitemsValidationResponseBodyForContentTypes, -): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/min_length_api.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/min_length_api.py deleted file mode 100644 index 60429b6e3c6..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/min_length_api.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from unit_test_api.paths.request_body_post_minlength_validation_request_body.post import PostMinlengthValidationRequestBody -from unit_test_api.paths.response_body_post_minlength_validation_response_body_for_content_types.post import PostMinlengthValidationResponseBodyForContentTypes - - -class MinLengthApi( - PostMinlengthValidationRequestBody, - PostMinlengthValidationResponseBodyForContentTypes, -): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/min_properties_api.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/min_properties_api.py deleted file mode 100644 index d51d44f4b81..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/min_properties_api.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from unit_test_api.paths.request_body_post_minproperties_validation_request_body.post import PostMinpropertiesValidationRequestBody -from unit_test_api.paths.response_body_post_minproperties_validation_response_body_for_content_types.post import PostMinpropertiesValidationResponseBodyForContentTypes - - -class MinPropertiesApi( - PostMinpropertiesValidationRequestBody, - PostMinpropertiesValidationResponseBodyForContentTypes, -): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/minimum_api.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/minimum_api.py deleted file mode 100644 index f7e4c9ac0ee..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/minimum_api.py +++ /dev/null @@ -1,29 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from unit_test_api.paths.request_body_post_minimum_validation_request_body.post import PostMinimumValidationRequestBody -from unit_test_api.paths.response_body_post_minimum_validation_response_body_for_content_types.post import PostMinimumValidationResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_minimum_validation_with_signed_integer_request_body.post import PostMinimumValidationWithSignedIntegerRequestBody -from unit_test_api.paths.response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types.post import PostMinimumValidationWithSignedIntegerResponseBodyForContentTypes - - -class MinimumApi( - PostMinimumValidationRequestBody, - PostMinimumValidationResponseBodyForContentTypes, - PostMinimumValidationWithSignedIntegerRequestBody, - PostMinimumValidationWithSignedIntegerResponseBodyForContentTypes, -): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/model_not_api.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/model_not_api.py deleted file mode 100644 index ae8de1451fc..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/model_not_api.py +++ /dev/null @@ -1,33 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from unit_test_api.paths.request_body_post_forbidden_property_request_body.post import PostForbiddenPropertyRequestBody -from unit_test_api.paths.response_body_post_forbidden_property_response_body_for_content_types.post import PostForbiddenPropertyResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_not_more_complex_schema_request_body.post import PostNotMoreComplexSchemaRequestBody -from unit_test_api.paths.response_body_post_not_more_complex_schema_response_body_for_content_types.post import PostNotMoreComplexSchemaResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_not_request_body.post import PostNotRequestBody -from unit_test_api.paths.response_body_post_not_response_body_for_content_types.post import PostNotResponseBodyForContentTypes - - -class ModelNotApi( - PostForbiddenPropertyRequestBody, - PostForbiddenPropertyResponseBodyForContentTypes, - PostNotMoreComplexSchemaRequestBody, - PostNotMoreComplexSchemaResponseBodyForContentTypes, - PostNotRequestBody, - PostNotResponseBodyForContentTypes, -): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/multiple_of_api.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/multiple_of_api.py deleted file mode 100644 index f694870392c..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/multiple_of_api.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from unit_test_api.paths.request_body_post_by_int_request_body.post import PostByIntRequestBody -from unit_test_api.paths.response_body_post_by_int_response_body_for_content_types.post import PostByIntResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_by_number_request_body.post import PostByNumberRequestBody -from unit_test_api.paths.response_body_post_by_number_response_body_for_content_types.post import PostByNumberResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_by_small_number_request_body.post import PostBySmallNumberRequestBody -from unit_test_api.paths.response_body_post_by_small_number_response_body_for_content_types.post import PostBySmallNumberResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body.post import PostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody -from unit_test_api.paths.response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types.post import PostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfResponseBodyForContentTypes - - -class MultipleOfApi( - PostByIntRequestBody, - PostByIntResponseBodyForContentTypes, - PostByNumberRequestBody, - PostByNumberResponseBodyForContentTypes, - PostBySmallNumberRequestBody, - PostBySmallNumberResponseBodyForContentTypes, - PostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody, - PostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfResponseBodyForContentTypes, -): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/one_of_api.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/one_of_api.py deleted file mode 100644 index 4582b5e30f4..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/one_of_api.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from unit_test_api.paths.request_body_post_nested_oneof_to_check_validation_semantics_request_body.post import PostNestedOneofToCheckValidationSemanticsRequestBody -from unit_test_api.paths.response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types.post import PostNestedOneofToCheckValidationSemanticsResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_oneof_complex_types_request_body.post import PostOneofComplexTypesRequestBody -from unit_test_api.paths.response_body_post_oneof_complex_types_response_body_for_content_types.post import PostOneofComplexTypesResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_oneof_request_body.post import PostOneofRequestBody -from unit_test_api.paths.response_body_post_oneof_response_body_for_content_types.post import PostOneofResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_oneof_with_base_schema_request_body.post import PostOneofWithBaseSchemaRequestBody -from unit_test_api.paths.response_body_post_oneof_with_base_schema_response_body_for_content_types.post import PostOneofWithBaseSchemaResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_oneof_with_empty_schema_request_body.post import PostOneofWithEmptySchemaRequestBody -from unit_test_api.paths.response_body_post_oneof_with_empty_schema_response_body_for_content_types.post import PostOneofWithEmptySchemaResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_oneof_with_required_request_body.post import PostOneofWithRequiredRequestBody -from unit_test_api.paths.response_body_post_oneof_with_required_response_body_for_content_types.post import PostOneofWithRequiredResponseBodyForContentTypes - - -class OneOfApi( - PostNestedOneofToCheckValidationSemanticsRequestBody, - PostNestedOneofToCheckValidationSemanticsResponseBodyForContentTypes, - PostOneofComplexTypesRequestBody, - PostOneofComplexTypesResponseBodyForContentTypes, - PostOneofRequestBody, - PostOneofResponseBodyForContentTypes, - PostOneofWithBaseSchemaRequestBody, - PostOneofWithBaseSchemaResponseBodyForContentTypes, - PostOneofWithEmptySchemaRequestBody, - PostOneofWithEmptySchemaResponseBodyForContentTypes, - PostOneofWithRequiredRequestBody, - PostOneofWithRequiredResponseBodyForContentTypes, -): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/operation_request_body_api.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/operation_request_body_api.py deleted file mode 100644 index 2f64723d300..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/operation_request_body_api.py +++ /dev/null @@ -1,195 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from unit_test_api.paths.request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body.post import PostAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody -from unit_test_api.paths.request_body_post_additionalproperties_are_allowed_by_default_request_body.post import PostAdditionalpropertiesAreAllowedByDefaultRequestBody -from unit_test_api.paths.request_body_post_additionalproperties_can_exist_by_itself_request_body.post import PostAdditionalpropertiesCanExistByItselfRequestBody -from unit_test_api.paths.request_body_post_additionalproperties_should_not_look_in_applicators_request_body.post import PostAdditionalpropertiesShouldNotLookInApplicatorsRequestBody -from unit_test_api.paths.request_body_post_allof_combined_with_anyof_oneof_request_body.post import PostAllofCombinedWithAnyofOneofRequestBody -from unit_test_api.paths.request_body_post_allof_request_body.post import PostAllofRequestBody -from unit_test_api.paths.request_body_post_allof_simple_types_request_body.post import PostAllofSimpleTypesRequestBody -from unit_test_api.paths.request_body_post_allof_with_base_schema_request_body.post import PostAllofWithBaseSchemaRequestBody -from unit_test_api.paths.request_body_post_allof_with_one_empty_schema_request_body.post import PostAllofWithOneEmptySchemaRequestBody -from unit_test_api.paths.request_body_post_allof_with_the_first_empty_schema_request_body.post import PostAllofWithTheFirstEmptySchemaRequestBody -from unit_test_api.paths.request_body_post_allof_with_the_last_empty_schema_request_body.post import PostAllofWithTheLastEmptySchemaRequestBody -from unit_test_api.paths.request_body_post_allof_with_two_empty_schemas_request_body.post import PostAllofWithTwoEmptySchemasRequestBody -from unit_test_api.paths.request_body_post_anyof_complex_types_request_body.post import PostAnyofComplexTypesRequestBody -from unit_test_api.paths.request_body_post_anyof_request_body.post import PostAnyofRequestBody -from unit_test_api.paths.request_body_post_anyof_with_base_schema_request_body.post import PostAnyofWithBaseSchemaRequestBody -from unit_test_api.paths.request_body_post_anyof_with_one_empty_schema_request_body.post import PostAnyofWithOneEmptySchemaRequestBody -from unit_test_api.paths.request_body_post_array_type_matches_arrays_request_body.post import PostArrayTypeMatchesArraysRequestBody -from unit_test_api.paths.request_body_post_boolean_type_matches_booleans_request_body.post import PostBooleanTypeMatchesBooleansRequestBody -from unit_test_api.paths.request_body_post_by_int_request_body.post import PostByIntRequestBody -from unit_test_api.paths.request_body_post_by_number_request_body.post import PostByNumberRequestBody -from unit_test_api.paths.request_body_post_by_small_number_request_body.post import PostBySmallNumberRequestBody -from unit_test_api.paths.request_body_post_date_time_format_request_body.post import PostDateTimeFormatRequestBody -from unit_test_api.paths.request_body_post_email_format_request_body.post import PostEmailFormatRequestBody -from unit_test_api.paths.request_body_post_enum_with0_does_not_match_false_request_body.post import PostEnumWith0DoesNotMatchFalseRequestBody -from unit_test_api.paths.request_body_post_enum_with1_does_not_match_true_request_body.post import PostEnumWith1DoesNotMatchTrueRequestBody -from unit_test_api.paths.request_body_post_enum_with_escaped_characters_request_body.post import PostEnumWithEscapedCharactersRequestBody -from unit_test_api.paths.request_body_post_enum_with_false_does_not_match0_request_body.post import PostEnumWithFalseDoesNotMatch0RequestBody -from unit_test_api.paths.request_body_post_enum_with_true_does_not_match1_request_body.post import PostEnumWithTrueDoesNotMatch1RequestBody -from unit_test_api.paths.request_body_post_enums_in_properties_request_body.post import PostEnumsInPropertiesRequestBody -from unit_test_api.paths.request_body_post_forbidden_property_request_body.post import PostForbiddenPropertyRequestBody -from unit_test_api.paths.request_body_post_hostname_format_request_body.post import PostHostnameFormatRequestBody -from unit_test_api.paths.request_body_post_integer_type_matches_integers_request_body.post import PostIntegerTypeMatchesIntegersRequestBody -from unit_test_api.paths.request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body.post import PostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody -from unit_test_api.paths.request_body_post_invalid_string_value_for_default_request_body.post import PostInvalidStringValueForDefaultRequestBody -from unit_test_api.paths.request_body_post_ipv4_format_request_body.post import PostIpv4FormatRequestBody -from unit_test_api.paths.request_body_post_ipv6_format_request_body.post import PostIpv6FormatRequestBody -from unit_test_api.paths.request_body_post_json_pointer_format_request_body.post import PostJsonPointerFormatRequestBody -from unit_test_api.paths.request_body_post_maximum_validation_request_body.post import PostMaximumValidationRequestBody -from unit_test_api.paths.request_body_post_maximum_validation_with_unsigned_integer_request_body.post import PostMaximumValidationWithUnsignedIntegerRequestBody -from unit_test_api.paths.request_body_post_maxitems_validation_request_body.post import PostMaxitemsValidationRequestBody -from unit_test_api.paths.request_body_post_maxlength_validation_request_body.post import PostMaxlengthValidationRequestBody -from unit_test_api.paths.request_body_post_maxproperties0_means_the_object_is_empty_request_body.post import PostMaxproperties0MeansTheObjectIsEmptyRequestBody -from unit_test_api.paths.request_body_post_maxproperties_validation_request_body.post import PostMaxpropertiesValidationRequestBody -from unit_test_api.paths.request_body_post_minimum_validation_request_body.post import PostMinimumValidationRequestBody -from unit_test_api.paths.request_body_post_minimum_validation_with_signed_integer_request_body.post import PostMinimumValidationWithSignedIntegerRequestBody -from unit_test_api.paths.request_body_post_minitems_validation_request_body.post import PostMinitemsValidationRequestBody -from unit_test_api.paths.request_body_post_minlength_validation_request_body.post import PostMinlengthValidationRequestBody -from unit_test_api.paths.request_body_post_minproperties_validation_request_body.post import PostMinpropertiesValidationRequestBody -from unit_test_api.paths.request_body_post_nested_allof_to_check_validation_semantics_request_body.post import PostNestedAllofToCheckValidationSemanticsRequestBody -from unit_test_api.paths.request_body_post_nested_anyof_to_check_validation_semantics_request_body.post import PostNestedAnyofToCheckValidationSemanticsRequestBody -from unit_test_api.paths.request_body_post_nested_items_request_body.post import PostNestedItemsRequestBody -from unit_test_api.paths.request_body_post_nested_oneof_to_check_validation_semantics_request_body.post import PostNestedOneofToCheckValidationSemanticsRequestBody -from unit_test_api.paths.request_body_post_not_more_complex_schema_request_body.post import PostNotMoreComplexSchemaRequestBody -from unit_test_api.paths.request_body_post_not_request_body.post import PostNotRequestBody -from unit_test_api.paths.request_body_post_nul_characters_in_strings_request_body.post import PostNulCharactersInStringsRequestBody -from unit_test_api.paths.request_body_post_null_type_matches_only_the_null_object_request_body.post import PostNullTypeMatchesOnlyTheNullObjectRequestBody -from unit_test_api.paths.request_body_post_number_type_matches_numbers_request_body.post import PostNumberTypeMatchesNumbersRequestBody -from unit_test_api.paths.request_body_post_object_properties_validation_request_body.post import PostObjectPropertiesValidationRequestBody -from unit_test_api.paths.request_body_post_object_type_matches_objects_request_body.post import PostObjectTypeMatchesObjectsRequestBody -from unit_test_api.paths.request_body_post_oneof_complex_types_request_body.post import PostOneofComplexTypesRequestBody -from unit_test_api.paths.request_body_post_oneof_request_body.post import PostOneofRequestBody -from unit_test_api.paths.request_body_post_oneof_with_base_schema_request_body.post import PostOneofWithBaseSchemaRequestBody -from unit_test_api.paths.request_body_post_oneof_with_empty_schema_request_body.post import PostOneofWithEmptySchemaRequestBody -from unit_test_api.paths.request_body_post_oneof_with_required_request_body.post import PostOneofWithRequiredRequestBody -from unit_test_api.paths.request_body_post_pattern_is_not_anchored_request_body.post import PostPatternIsNotAnchoredRequestBody -from unit_test_api.paths.request_body_post_pattern_validation_request_body.post import PostPatternValidationRequestBody -from unit_test_api.paths.request_body_post_properties_with_escaped_characters_request_body.post import PostPropertiesWithEscapedCharactersRequestBody -from unit_test_api.paths.request_body_post_property_named_ref_that_is_not_a_reference_request_body.post import PostPropertyNamedRefThatIsNotAReferenceRequestBody -from unit_test_api.paths.request_body_post_ref_in_additionalproperties_request_body.post import PostRefInAdditionalpropertiesRequestBody -from unit_test_api.paths.request_body_post_ref_in_allof_request_body.post import PostRefInAllofRequestBody -from unit_test_api.paths.request_body_post_ref_in_anyof_request_body.post import PostRefInAnyofRequestBody -from unit_test_api.paths.request_body_post_ref_in_items_request_body.post import PostRefInItemsRequestBody -from unit_test_api.paths.request_body_post_ref_in_not_request_body.post import PostRefInNotRequestBody -from unit_test_api.paths.request_body_post_ref_in_oneof_request_body.post import PostRefInOneofRequestBody -from unit_test_api.paths.request_body_post_ref_in_property_request_body.post import PostRefInPropertyRequestBody -from unit_test_api.paths.request_body_post_required_default_validation_request_body.post import PostRequiredDefaultValidationRequestBody -from unit_test_api.paths.request_body_post_required_validation_request_body.post import PostRequiredValidationRequestBody -from unit_test_api.paths.request_body_post_required_with_empty_array_request_body.post import PostRequiredWithEmptyArrayRequestBody -from unit_test_api.paths.request_body_post_required_with_escaped_characters_request_body.post import PostRequiredWithEscapedCharactersRequestBody -from unit_test_api.paths.request_body_post_simple_enum_validation_request_body.post import PostSimpleEnumValidationRequestBody -from unit_test_api.paths.request_body_post_string_type_matches_strings_request_body.post import PostStringTypeMatchesStringsRequestBody -from unit_test_api.paths.request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.post import PostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody -from unit_test_api.paths.request_body_post_uniqueitems_false_validation_request_body.post import PostUniqueitemsFalseValidationRequestBody -from unit_test_api.paths.request_body_post_uniqueitems_validation_request_body.post import PostUniqueitemsValidationRequestBody -from unit_test_api.paths.request_body_post_uri_format_request_body.post import PostUriFormatRequestBody -from unit_test_api.paths.request_body_post_uri_reference_format_request_body.post import PostUriReferenceFormatRequestBody -from unit_test_api.paths.request_body_post_uri_template_format_request_body.post import PostUriTemplateFormatRequestBody - - -class OperationRequestBodyApi( - PostAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody, - PostAdditionalpropertiesAreAllowedByDefaultRequestBody, - PostAdditionalpropertiesCanExistByItselfRequestBody, - PostAdditionalpropertiesShouldNotLookInApplicatorsRequestBody, - PostAllofCombinedWithAnyofOneofRequestBody, - PostAllofRequestBody, - PostAllofSimpleTypesRequestBody, - PostAllofWithBaseSchemaRequestBody, - PostAllofWithOneEmptySchemaRequestBody, - PostAllofWithTheFirstEmptySchemaRequestBody, - PostAllofWithTheLastEmptySchemaRequestBody, - PostAllofWithTwoEmptySchemasRequestBody, - PostAnyofComplexTypesRequestBody, - PostAnyofRequestBody, - PostAnyofWithBaseSchemaRequestBody, - PostAnyofWithOneEmptySchemaRequestBody, - PostArrayTypeMatchesArraysRequestBody, - PostBooleanTypeMatchesBooleansRequestBody, - PostByIntRequestBody, - PostByNumberRequestBody, - PostBySmallNumberRequestBody, - PostDateTimeFormatRequestBody, - PostEmailFormatRequestBody, - PostEnumWith0DoesNotMatchFalseRequestBody, - PostEnumWith1DoesNotMatchTrueRequestBody, - PostEnumWithEscapedCharactersRequestBody, - PostEnumWithFalseDoesNotMatch0RequestBody, - PostEnumWithTrueDoesNotMatch1RequestBody, - PostEnumsInPropertiesRequestBody, - PostForbiddenPropertyRequestBody, - PostHostnameFormatRequestBody, - PostIntegerTypeMatchesIntegersRequestBody, - PostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody, - PostInvalidStringValueForDefaultRequestBody, - PostIpv4FormatRequestBody, - PostIpv6FormatRequestBody, - PostJsonPointerFormatRequestBody, - PostMaximumValidationRequestBody, - PostMaximumValidationWithUnsignedIntegerRequestBody, - PostMaxitemsValidationRequestBody, - PostMaxlengthValidationRequestBody, - PostMaxproperties0MeansTheObjectIsEmptyRequestBody, - PostMaxpropertiesValidationRequestBody, - PostMinimumValidationRequestBody, - PostMinimumValidationWithSignedIntegerRequestBody, - PostMinitemsValidationRequestBody, - PostMinlengthValidationRequestBody, - PostMinpropertiesValidationRequestBody, - PostNestedAllofToCheckValidationSemanticsRequestBody, - PostNestedAnyofToCheckValidationSemanticsRequestBody, - PostNestedItemsRequestBody, - PostNestedOneofToCheckValidationSemanticsRequestBody, - PostNotMoreComplexSchemaRequestBody, - PostNotRequestBody, - PostNulCharactersInStringsRequestBody, - PostNullTypeMatchesOnlyTheNullObjectRequestBody, - PostNumberTypeMatchesNumbersRequestBody, - PostObjectPropertiesValidationRequestBody, - PostObjectTypeMatchesObjectsRequestBody, - PostOneofComplexTypesRequestBody, - PostOneofRequestBody, - PostOneofWithBaseSchemaRequestBody, - PostOneofWithEmptySchemaRequestBody, - PostOneofWithRequiredRequestBody, - PostPatternIsNotAnchoredRequestBody, - PostPatternValidationRequestBody, - PostPropertiesWithEscapedCharactersRequestBody, - PostPropertyNamedRefThatIsNotAReferenceRequestBody, - PostRefInAdditionalpropertiesRequestBody, - PostRefInAllofRequestBody, - PostRefInAnyofRequestBody, - PostRefInItemsRequestBody, - PostRefInNotRequestBody, - PostRefInOneofRequestBody, - PostRefInPropertyRequestBody, - PostRequiredDefaultValidationRequestBody, - PostRequiredValidationRequestBody, - PostRequiredWithEmptyArrayRequestBody, - PostRequiredWithEscapedCharactersRequestBody, - PostSimpleEnumValidationRequestBody, - PostStringTypeMatchesStringsRequestBody, - PostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody, - PostUniqueitemsFalseValidationRequestBody, - PostUniqueitemsValidationRequestBody, - PostUriFormatRequestBody, - PostUriReferenceFormatRequestBody, - PostUriTemplateFormatRequestBody, -): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/path_post_api.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/path_post_api.py deleted file mode 100644 index 3003735504e..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/path_post_api.py +++ /dev/null @@ -1,369 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from unit_test_api.paths.request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body.post import PostAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody -from unit_test_api.paths.response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types.post import PostAdditionalpropertiesAllowsASchemaWhichShouldValidateResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_additionalproperties_are_allowed_by_default_request_body.post import PostAdditionalpropertiesAreAllowedByDefaultRequestBody -from unit_test_api.paths.response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types.post import PostAdditionalpropertiesAreAllowedByDefaultResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_additionalproperties_can_exist_by_itself_request_body.post import PostAdditionalpropertiesCanExistByItselfRequestBody -from unit_test_api.paths.response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types.post import PostAdditionalpropertiesCanExistByItselfResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_additionalproperties_should_not_look_in_applicators_request_body.post import PostAdditionalpropertiesShouldNotLookInApplicatorsRequestBody -from unit_test_api.paths.response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types.post import PostAdditionalpropertiesShouldNotLookInApplicatorsResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_allof_combined_with_anyof_oneof_request_body.post import PostAllofCombinedWithAnyofOneofRequestBody -from unit_test_api.paths.response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types.post import PostAllofCombinedWithAnyofOneofResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_allof_request_body.post import PostAllofRequestBody -from unit_test_api.paths.response_body_post_allof_response_body_for_content_types.post import PostAllofResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_allof_simple_types_request_body.post import PostAllofSimpleTypesRequestBody -from unit_test_api.paths.response_body_post_allof_simple_types_response_body_for_content_types.post import PostAllofSimpleTypesResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_allof_with_base_schema_request_body.post import PostAllofWithBaseSchemaRequestBody -from unit_test_api.paths.response_body_post_allof_with_base_schema_response_body_for_content_types.post import PostAllofWithBaseSchemaResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_allof_with_one_empty_schema_request_body.post import PostAllofWithOneEmptySchemaRequestBody -from unit_test_api.paths.response_body_post_allof_with_one_empty_schema_response_body_for_content_types.post import PostAllofWithOneEmptySchemaResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_allof_with_the_first_empty_schema_request_body.post import PostAllofWithTheFirstEmptySchemaRequestBody -from unit_test_api.paths.response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types.post import PostAllofWithTheFirstEmptySchemaResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_allof_with_the_last_empty_schema_request_body.post import PostAllofWithTheLastEmptySchemaRequestBody -from unit_test_api.paths.response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types.post import PostAllofWithTheLastEmptySchemaResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_allof_with_two_empty_schemas_request_body.post import PostAllofWithTwoEmptySchemasRequestBody -from unit_test_api.paths.response_body_post_allof_with_two_empty_schemas_response_body_for_content_types.post import PostAllofWithTwoEmptySchemasResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_anyof_complex_types_request_body.post import PostAnyofComplexTypesRequestBody -from unit_test_api.paths.response_body_post_anyof_complex_types_response_body_for_content_types.post import PostAnyofComplexTypesResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_anyof_request_body.post import PostAnyofRequestBody -from unit_test_api.paths.response_body_post_anyof_response_body_for_content_types.post import PostAnyofResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_anyof_with_base_schema_request_body.post import PostAnyofWithBaseSchemaRequestBody -from unit_test_api.paths.response_body_post_anyof_with_base_schema_response_body_for_content_types.post import PostAnyofWithBaseSchemaResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_anyof_with_one_empty_schema_request_body.post import PostAnyofWithOneEmptySchemaRequestBody -from unit_test_api.paths.response_body_post_anyof_with_one_empty_schema_response_body_for_content_types.post import PostAnyofWithOneEmptySchemaResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_array_type_matches_arrays_request_body.post import PostArrayTypeMatchesArraysRequestBody -from unit_test_api.paths.response_body_post_array_type_matches_arrays_response_body_for_content_types.post import PostArrayTypeMatchesArraysResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_boolean_type_matches_booleans_request_body.post import PostBooleanTypeMatchesBooleansRequestBody -from unit_test_api.paths.response_body_post_boolean_type_matches_booleans_response_body_for_content_types.post import PostBooleanTypeMatchesBooleansResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_by_int_request_body.post import PostByIntRequestBody -from unit_test_api.paths.response_body_post_by_int_response_body_for_content_types.post import PostByIntResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_by_number_request_body.post import PostByNumberRequestBody -from unit_test_api.paths.response_body_post_by_number_response_body_for_content_types.post import PostByNumberResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_by_small_number_request_body.post import PostBySmallNumberRequestBody -from unit_test_api.paths.response_body_post_by_small_number_response_body_for_content_types.post import PostBySmallNumberResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_date_time_format_request_body.post import PostDateTimeFormatRequestBody -from unit_test_api.paths.response_body_post_date_time_format_response_body_for_content_types.post import PostDateTimeFormatResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_email_format_request_body.post import PostEmailFormatRequestBody -from unit_test_api.paths.response_body_post_email_format_response_body_for_content_types.post import PostEmailFormatResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_enum_with0_does_not_match_false_request_body.post import PostEnumWith0DoesNotMatchFalseRequestBody -from unit_test_api.paths.response_body_post_enum_with0_does_not_match_false_response_body_for_content_types.post import PostEnumWith0DoesNotMatchFalseResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_enum_with1_does_not_match_true_request_body.post import PostEnumWith1DoesNotMatchTrueRequestBody -from unit_test_api.paths.response_body_post_enum_with1_does_not_match_true_response_body_for_content_types.post import PostEnumWith1DoesNotMatchTrueResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_enum_with_escaped_characters_request_body.post import PostEnumWithEscapedCharactersRequestBody -from unit_test_api.paths.response_body_post_enum_with_escaped_characters_response_body_for_content_types.post import PostEnumWithEscapedCharactersResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_enum_with_false_does_not_match0_request_body.post import PostEnumWithFalseDoesNotMatch0RequestBody -from unit_test_api.paths.response_body_post_enum_with_false_does_not_match0_response_body_for_content_types.post import PostEnumWithFalseDoesNotMatch0ResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_enum_with_true_does_not_match1_request_body.post import PostEnumWithTrueDoesNotMatch1RequestBody -from unit_test_api.paths.response_body_post_enum_with_true_does_not_match1_response_body_for_content_types.post import PostEnumWithTrueDoesNotMatch1ResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_enums_in_properties_request_body.post import PostEnumsInPropertiesRequestBody -from unit_test_api.paths.response_body_post_enums_in_properties_response_body_for_content_types.post import PostEnumsInPropertiesResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_forbidden_property_request_body.post import PostForbiddenPropertyRequestBody -from unit_test_api.paths.response_body_post_forbidden_property_response_body_for_content_types.post import PostForbiddenPropertyResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_hostname_format_request_body.post import PostHostnameFormatRequestBody -from unit_test_api.paths.response_body_post_hostname_format_response_body_for_content_types.post import PostHostnameFormatResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_integer_type_matches_integers_request_body.post import PostIntegerTypeMatchesIntegersRequestBody -from unit_test_api.paths.response_body_post_integer_type_matches_integers_response_body_for_content_types.post import PostIntegerTypeMatchesIntegersResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body.post import PostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody -from unit_test_api.paths.response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types.post import PostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_invalid_string_value_for_default_request_body.post import PostInvalidStringValueForDefaultRequestBody -from unit_test_api.paths.response_body_post_invalid_string_value_for_default_response_body_for_content_types.post import PostInvalidStringValueForDefaultResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_ipv4_format_request_body.post import PostIpv4FormatRequestBody -from unit_test_api.paths.response_body_post_ipv4_format_response_body_for_content_types.post import PostIpv4FormatResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_ipv6_format_request_body.post import PostIpv6FormatRequestBody -from unit_test_api.paths.response_body_post_ipv6_format_response_body_for_content_types.post import PostIpv6FormatResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_json_pointer_format_request_body.post import PostJsonPointerFormatRequestBody -from unit_test_api.paths.response_body_post_json_pointer_format_response_body_for_content_types.post import PostJsonPointerFormatResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_maximum_validation_request_body.post import PostMaximumValidationRequestBody -from unit_test_api.paths.response_body_post_maximum_validation_response_body_for_content_types.post import PostMaximumValidationResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_maximum_validation_with_unsigned_integer_request_body.post import PostMaximumValidationWithUnsignedIntegerRequestBody -from unit_test_api.paths.response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types.post import PostMaximumValidationWithUnsignedIntegerResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_maxitems_validation_request_body.post import PostMaxitemsValidationRequestBody -from unit_test_api.paths.response_body_post_maxitems_validation_response_body_for_content_types.post import PostMaxitemsValidationResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_maxlength_validation_request_body.post import PostMaxlengthValidationRequestBody -from unit_test_api.paths.response_body_post_maxlength_validation_response_body_for_content_types.post import PostMaxlengthValidationResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_maxproperties0_means_the_object_is_empty_request_body.post import PostMaxproperties0MeansTheObjectIsEmptyRequestBody -from unit_test_api.paths.response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types.post import PostMaxproperties0MeansTheObjectIsEmptyResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_maxproperties_validation_request_body.post import PostMaxpropertiesValidationRequestBody -from unit_test_api.paths.response_body_post_maxproperties_validation_response_body_for_content_types.post import PostMaxpropertiesValidationResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_minimum_validation_request_body.post import PostMinimumValidationRequestBody -from unit_test_api.paths.response_body_post_minimum_validation_response_body_for_content_types.post import PostMinimumValidationResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_minimum_validation_with_signed_integer_request_body.post import PostMinimumValidationWithSignedIntegerRequestBody -from unit_test_api.paths.response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types.post import PostMinimumValidationWithSignedIntegerResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_minitems_validation_request_body.post import PostMinitemsValidationRequestBody -from unit_test_api.paths.response_body_post_minitems_validation_response_body_for_content_types.post import PostMinitemsValidationResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_minlength_validation_request_body.post import PostMinlengthValidationRequestBody -from unit_test_api.paths.response_body_post_minlength_validation_response_body_for_content_types.post import PostMinlengthValidationResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_minproperties_validation_request_body.post import PostMinpropertiesValidationRequestBody -from unit_test_api.paths.response_body_post_minproperties_validation_response_body_for_content_types.post import PostMinpropertiesValidationResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_nested_allof_to_check_validation_semantics_request_body.post import PostNestedAllofToCheckValidationSemanticsRequestBody -from unit_test_api.paths.response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types.post import PostNestedAllofToCheckValidationSemanticsResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_nested_anyof_to_check_validation_semantics_request_body.post import PostNestedAnyofToCheckValidationSemanticsRequestBody -from unit_test_api.paths.response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types.post import PostNestedAnyofToCheckValidationSemanticsResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_nested_items_request_body.post import PostNestedItemsRequestBody -from unit_test_api.paths.response_body_post_nested_items_response_body_for_content_types.post import PostNestedItemsResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_nested_oneof_to_check_validation_semantics_request_body.post import PostNestedOneofToCheckValidationSemanticsRequestBody -from unit_test_api.paths.response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types.post import PostNestedOneofToCheckValidationSemanticsResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_not_more_complex_schema_request_body.post import PostNotMoreComplexSchemaRequestBody -from unit_test_api.paths.response_body_post_not_more_complex_schema_response_body_for_content_types.post import PostNotMoreComplexSchemaResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_not_request_body.post import PostNotRequestBody -from unit_test_api.paths.response_body_post_not_response_body_for_content_types.post import PostNotResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_nul_characters_in_strings_request_body.post import PostNulCharactersInStringsRequestBody -from unit_test_api.paths.response_body_post_nul_characters_in_strings_response_body_for_content_types.post import PostNulCharactersInStringsResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_null_type_matches_only_the_null_object_request_body.post import PostNullTypeMatchesOnlyTheNullObjectRequestBody -from unit_test_api.paths.response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types.post import PostNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_number_type_matches_numbers_request_body.post import PostNumberTypeMatchesNumbersRequestBody -from unit_test_api.paths.response_body_post_number_type_matches_numbers_response_body_for_content_types.post import PostNumberTypeMatchesNumbersResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_object_properties_validation_request_body.post import PostObjectPropertiesValidationRequestBody -from unit_test_api.paths.response_body_post_object_properties_validation_response_body_for_content_types.post import PostObjectPropertiesValidationResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_object_type_matches_objects_request_body.post import PostObjectTypeMatchesObjectsRequestBody -from unit_test_api.paths.response_body_post_object_type_matches_objects_response_body_for_content_types.post import PostObjectTypeMatchesObjectsResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_oneof_complex_types_request_body.post import PostOneofComplexTypesRequestBody -from unit_test_api.paths.response_body_post_oneof_complex_types_response_body_for_content_types.post import PostOneofComplexTypesResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_oneof_request_body.post import PostOneofRequestBody -from unit_test_api.paths.response_body_post_oneof_response_body_for_content_types.post import PostOneofResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_oneof_with_base_schema_request_body.post import PostOneofWithBaseSchemaRequestBody -from unit_test_api.paths.response_body_post_oneof_with_base_schema_response_body_for_content_types.post import PostOneofWithBaseSchemaResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_oneof_with_empty_schema_request_body.post import PostOneofWithEmptySchemaRequestBody -from unit_test_api.paths.response_body_post_oneof_with_empty_schema_response_body_for_content_types.post import PostOneofWithEmptySchemaResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_oneof_with_required_request_body.post import PostOneofWithRequiredRequestBody -from unit_test_api.paths.response_body_post_oneof_with_required_response_body_for_content_types.post import PostOneofWithRequiredResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_pattern_is_not_anchored_request_body.post import PostPatternIsNotAnchoredRequestBody -from unit_test_api.paths.response_body_post_pattern_is_not_anchored_response_body_for_content_types.post import PostPatternIsNotAnchoredResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_pattern_validation_request_body.post import PostPatternValidationRequestBody -from unit_test_api.paths.response_body_post_pattern_validation_response_body_for_content_types.post import PostPatternValidationResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_properties_with_escaped_characters_request_body.post import PostPropertiesWithEscapedCharactersRequestBody -from unit_test_api.paths.response_body_post_properties_with_escaped_characters_response_body_for_content_types.post import PostPropertiesWithEscapedCharactersResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_property_named_ref_that_is_not_a_reference_request_body.post import PostPropertyNamedRefThatIsNotAReferenceRequestBody -from unit_test_api.paths.response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types.post import PostPropertyNamedRefThatIsNotAReferenceResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_ref_in_additionalproperties_request_body.post import PostRefInAdditionalpropertiesRequestBody -from unit_test_api.paths.response_body_post_ref_in_additionalproperties_response_body_for_content_types.post import PostRefInAdditionalpropertiesResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_ref_in_allof_request_body.post import PostRefInAllofRequestBody -from unit_test_api.paths.response_body_post_ref_in_allof_response_body_for_content_types.post import PostRefInAllofResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_ref_in_anyof_request_body.post import PostRefInAnyofRequestBody -from unit_test_api.paths.response_body_post_ref_in_anyof_response_body_for_content_types.post import PostRefInAnyofResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_ref_in_items_request_body.post import PostRefInItemsRequestBody -from unit_test_api.paths.response_body_post_ref_in_items_response_body_for_content_types.post import PostRefInItemsResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_ref_in_not_request_body.post import PostRefInNotRequestBody -from unit_test_api.paths.response_body_post_ref_in_not_response_body_for_content_types.post import PostRefInNotResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_ref_in_oneof_request_body.post import PostRefInOneofRequestBody -from unit_test_api.paths.response_body_post_ref_in_oneof_response_body_for_content_types.post import PostRefInOneofResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_ref_in_property_request_body.post import PostRefInPropertyRequestBody -from unit_test_api.paths.response_body_post_ref_in_property_response_body_for_content_types.post import PostRefInPropertyResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_required_default_validation_request_body.post import PostRequiredDefaultValidationRequestBody -from unit_test_api.paths.response_body_post_required_default_validation_response_body_for_content_types.post import PostRequiredDefaultValidationResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_required_validation_request_body.post import PostRequiredValidationRequestBody -from unit_test_api.paths.response_body_post_required_validation_response_body_for_content_types.post import PostRequiredValidationResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_required_with_empty_array_request_body.post import PostRequiredWithEmptyArrayRequestBody -from unit_test_api.paths.response_body_post_required_with_empty_array_response_body_for_content_types.post import PostRequiredWithEmptyArrayResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_required_with_escaped_characters_request_body.post import PostRequiredWithEscapedCharactersRequestBody -from unit_test_api.paths.response_body_post_required_with_escaped_characters_response_body_for_content_types.post import PostRequiredWithEscapedCharactersResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_simple_enum_validation_request_body.post import PostSimpleEnumValidationRequestBody -from unit_test_api.paths.response_body_post_simple_enum_validation_response_body_for_content_types.post import PostSimpleEnumValidationResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_string_type_matches_strings_request_body.post import PostStringTypeMatchesStringsRequestBody -from unit_test_api.paths.response_body_post_string_type_matches_strings_response_body_for_content_types.post import PostStringTypeMatchesStringsResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.post import PostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody -from unit_test_api.paths.response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types.post import PostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_uniqueitems_false_validation_request_body.post import PostUniqueitemsFalseValidationRequestBody -from unit_test_api.paths.response_body_post_uniqueitems_false_validation_response_body_for_content_types.post import PostUniqueitemsFalseValidationResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_uniqueitems_validation_request_body.post import PostUniqueitemsValidationRequestBody -from unit_test_api.paths.response_body_post_uniqueitems_validation_response_body_for_content_types.post import PostUniqueitemsValidationResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_uri_format_request_body.post import PostUriFormatRequestBody -from unit_test_api.paths.response_body_post_uri_format_response_body_for_content_types.post import PostUriFormatResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_uri_reference_format_request_body.post import PostUriReferenceFormatRequestBody -from unit_test_api.paths.response_body_post_uri_reference_format_response_body_for_content_types.post import PostUriReferenceFormatResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_uri_template_format_request_body.post import PostUriTemplateFormatRequestBody -from unit_test_api.paths.response_body_post_uri_template_format_response_body_for_content_types.post import PostUriTemplateFormatResponseBodyForContentTypes - - -class PathPostApi( - PostAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody, - PostAdditionalpropertiesAllowsASchemaWhichShouldValidateResponseBodyForContentTypes, - PostAdditionalpropertiesAreAllowedByDefaultRequestBody, - PostAdditionalpropertiesAreAllowedByDefaultResponseBodyForContentTypes, - PostAdditionalpropertiesCanExistByItselfRequestBody, - PostAdditionalpropertiesCanExistByItselfResponseBodyForContentTypes, - PostAdditionalpropertiesShouldNotLookInApplicatorsRequestBody, - PostAdditionalpropertiesShouldNotLookInApplicatorsResponseBodyForContentTypes, - PostAllofCombinedWithAnyofOneofRequestBody, - PostAllofCombinedWithAnyofOneofResponseBodyForContentTypes, - PostAllofRequestBody, - PostAllofResponseBodyForContentTypes, - PostAllofSimpleTypesRequestBody, - PostAllofSimpleTypesResponseBodyForContentTypes, - PostAllofWithBaseSchemaRequestBody, - PostAllofWithBaseSchemaResponseBodyForContentTypes, - PostAllofWithOneEmptySchemaRequestBody, - PostAllofWithOneEmptySchemaResponseBodyForContentTypes, - PostAllofWithTheFirstEmptySchemaRequestBody, - PostAllofWithTheFirstEmptySchemaResponseBodyForContentTypes, - PostAllofWithTheLastEmptySchemaRequestBody, - PostAllofWithTheLastEmptySchemaResponseBodyForContentTypes, - PostAllofWithTwoEmptySchemasRequestBody, - PostAllofWithTwoEmptySchemasResponseBodyForContentTypes, - PostAnyofComplexTypesRequestBody, - PostAnyofComplexTypesResponseBodyForContentTypes, - PostAnyofRequestBody, - PostAnyofResponseBodyForContentTypes, - PostAnyofWithBaseSchemaRequestBody, - PostAnyofWithBaseSchemaResponseBodyForContentTypes, - PostAnyofWithOneEmptySchemaRequestBody, - PostAnyofWithOneEmptySchemaResponseBodyForContentTypes, - PostArrayTypeMatchesArraysRequestBody, - PostArrayTypeMatchesArraysResponseBodyForContentTypes, - PostBooleanTypeMatchesBooleansRequestBody, - PostBooleanTypeMatchesBooleansResponseBodyForContentTypes, - PostByIntRequestBody, - PostByIntResponseBodyForContentTypes, - PostByNumberRequestBody, - PostByNumberResponseBodyForContentTypes, - PostBySmallNumberRequestBody, - PostBySmallNumberResponseBodyForContentTypes, - PostDateTimeFormatRequestBody, - PostDateTimeFormatResponseBodyForContentTypes, - PostEmailFormatRequestBody, - PostEmailFormatResponseBodyForContentTypes, - PostEnumWith0DoesNotMatchFalseRequestBody, - PostEnumWith0DoesNotMatchFalseResponseBodyForContentTypes, - PostEnumWith1DoesNotMatchTrueRequestBody, - PostEnumWith1DoesNotMatchTrueResponseBodyForContentTypes, - PostEnumWithEscapedCharactersRequestBody, - PostEnumWithEscapedCharactersResponseBodyForContentTypes, - PostEnumWithFalseDoesNotMatch0RequestBody, - PostEnumWithFalseDoesNotMatch0ResponseBodyForContentTypes, - PostEnumWithTrueDoesNotMatch1RequestBody, - PostEnumWithTrueDoesNotMatch1ResponseBodyForContentTypes, - PostEnumsInPropertiesRequestBody, - PostEnumsInPropertiesResponseBodyForContentTypes, - PostForbiddenPropertyRequestBody, - PostForbiddenPropertyResponseBodyForContentTypes, - PostHostnameFormatRequestBody, - PostHostnameFormatResponseBodyForContentTypes, - PostIntegerTypeMatchesIntegersRequestBody, - PostIntegerTypeMatchesIntegersResponseBodyForContentTypes, - PostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody, - PostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfResponseBodyForContentTypes, - PostInvalidStringValueForDefaultRequestBody, - PostInvalidStringValueForDefaultResponseBodyForContentTypes, - PostIpv4FormatRequestBody, - PostIpv4FormatResponseBodyForContentTypes, - PostIpv6FormatRequestBody, - PostIpv6FormatResponseBodyForContentTypes, - PostJsonPointerFormatRequestBody, - PostJsonPointerFormatResponseBodyForContentTypes, - PostMaximumValidationRequestBody, - PostMaximumValidationResponseBodyForContentTypes, - PostMaximumValidationWithUnsignedIntegerRequestBody, - PostMaximumValidationWithUnsignedIntegerResponseBodyForContentTypes, - PostMaxitemsValidationRequestBody, - PostMaxitemsValidationResponseBodyForContentTypes, - PostMaxlengthValidationRequestBody, - PostMaxlengthValidationResponseBodyForContentTypes, - PostMaxproperties0MeansTheObjectIsEmptyRequestBody, - PostMaxproperties0MeansTheObjectIsEmptyResponseBodyForContentTypes, - PostMaxpropertiesValidationRequestBody, - PostMaxpropertiesValidationResponseBodyForContentTypes, - PostMinimumValidationRequestBody, - PostMinimumValidationResponseBodyForContentTypes, - PostMinimumValidationWithSignedIntegerRequestBody, - PostMinimumValidationWithSignedIntegerResponseBodyForContentTypes, - PostMinitemsValidationRequestBody, - PostMinitemsValidationResponseBodyForContentTypes, - PostMinlengthValidationRequestBody, - PostMinlengthValidationResponseBodyForContentTypes, - PostMinpropertiesValidationRequestBody, - PostMinpropertiesValidationResponseBodyForContentTypes, - PostNestedAllofToCheckValidationSemanticsRequestBody, - PostNestedAllofToCheckValidationSemanticsResponseBodyForContentTypes, - PostNestedAnyofToCheckValidationSemanticsRequestBody, - PostNestedAnyofToCheckValidationSemanticsResponseBodyForContentTypes, - PostNestedItemsRequestBody, - PostNestedItemsResponseBodyForContentTypes, - PostNestedOneofToCheckValidationSemanticsRequestBody, - PostNestedOneofToCheckValidationSemanticsResponseBodyForContentTypes, - PostNotMoreComplexSchemaRequestBody, - PostNotMoreComplexSchemaResponseBodyForContentTypes, - PostNotRequestBody, - PostNotResponseBodyForContentTypes, - PostNulCharactersInStringsRequestBody, - PostNulCharactersInStringsResponseBodyForContentTypes, - PostNullTypeMatchesOnlyTheNullObjectRequestBody, - PostNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes, - PostNumberTypeMatchesNumbersRequestBody, - PostNumberTypeMatchesNumbersResponseBodyForContentTypes, - PostObjectPropertiesValidationRequestBody, - PostObjectPropertiesValidationResponseBodyForContentTypes, - PostObjectTypeMatchesObjectsRequestBody, - PostObjectTypeMatchesObjectsResponseBodyForContentTypes, - PostOneofComplexTypesRequestBody, - PostOneofComplexTypesResponseBodyForContentTypes, - PostOneofRequestBody, - PostOneofResponseBodyForContentTypes, - PostOneofWithBaseSchemaRequestBody, - PostOneofWithBaseSchemaResponseBodyForContentTypes, - PostOneofWithEmptySchemaRequestBody, - PostOneofWithEmptySchemaResponseBodyForContentTypes, - PostOneofWithRequiredRequestBody, - PostOneofWithRequiredResponseBodyForContentTypes, - PostPatternIsNotAnchoredRequestBody, - PostPatternIsNotAnchoredResponseBodyForContentTypes, - PostPatternValidationRequestBody, - PostPatternValidationResponseBodyForContentTypes, - PostPropertiesWithEscapedCharactersRequestBody, - PostPropertiesWithEscapedCharactersResponseBodyForContentTypes, - PostPropertyNamedRefThatIsNotAReferenceRequestBody, - PostPropertyNamedRefThatIsNotAReferenceResponseBodyForContentTypes, - PostRefInAdditionalpropertiesRequestBody, - PostRefInAdditionalpropertiesResponseBodyForContentTypes, - PostRefInAllofRequestBody, - PostRefInAllofResponseBodyForContentTypes, - PostRefInAnyofRequestBody, - PostRefInAnyofResponseBodyForContentTypes, - PostRefInItemsRequestBody, - PostRefInItemsResponseBodyForContentTypes, - PostRefInNotRequestBody, - PostRefInNotResponseBodyForContentTypes, - PostRefInOneofRequestBody, - PostRefInOneofResponseBodyForContentTypes, - PostRefInPropertyRequestBody, - PostRefInPropertyResponseBodyForContentTypes, - PostRequiredDefaultValidationRequestBody, - PostRequiredDefaultValidationResponseBodyForContentTypes, - PostRequiredValidationRequestBody, - PostRequiredValidationResponseBodyForContentTypes, - PostRequiredWithEmptyArrayRequestBody, - PostRequiredWithEmptyArrayResponseBodyForContentTypes, - PostRequiredWithEscapedCharactersRequestBody, - PostRequiredWithEscapedCharactersResponseBodyForContentTypes, - PostSimpleEnumValidationRequestBody, - PostSimpleEnumValidationResponseBodyForContentTypes, - PostStringTypeMatchesStringsRequestBody, - PostStringTypeMatchesStringsResponseBodyForContentTypes, - PostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody, - PostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyForContentTypes, - PostUniqueitemsFalseValidationRequestBody, - PostUniqueitemsFalseValidationResponseBodyForContentTypes, - PostUniqueitemsValidationRequestBody, - PostUniqueitemsValidationResponseBodyForContentTypes, - PostUriFormatRequestBody, - PostUriFormatResponseBodyForContentTypes, - PostUriReferenceFormatRequestBody, - PostUriReferenceFormatResponseBodyForContentTypes, - PostUriTemplateFormatRequestBody, - PostUriTemplateFormatResponseBodyForContentTypes, -): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/pattern_api.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/pattern_api.py deleted file mode 100644 index 0e1e1dad2cf..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/pattern_api.py +++ /dev/null @@ -1,29 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from unit_test_api.paths.request_body_post_pattern_is_not_anchored_request_body.post import PostPatternIsNotAnchoredRequestBody -from unit_test_api.paths.response_body_post_pattern_is_not_anchored_response_body_for_content_types.post import PostPatternIsNotAnchoredResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_pattern_validation_request_body.post import PostPatternValidationRequestBody -from unit_test_api.paths.response_body_post_pattern_validation_response_body_for_content_types.post import PostPatternValidationResponseBodyForContentTypes - - -class PatternApi( - PostPatternIsNotAnchoredRequestBody, - PostPatternIsNotAnchoredResponseBodyForContentTypes, - PostPatternValidationRequestBody, - PostPatternValidationResponseBodyForContentTypes, -): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/properties_api.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/properties_api.py deleted file mode 100644 index 3514d135759..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/properties_api.py +++ /dev/null @@ -1,29 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from unit_test_api.paths.request_body_post_object_properties_validation_request_body.post import PostObjectPropertiesValidationRequestBody -from unit_test_api.paths.response_body_post_object_properties_validation_response_body_for_content_types.post import PostObjectPropertiesValidationResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_properties_with_escaped_characters_request_body.post import PostPropertiesWithEscapedCharactersRequestBody -from unit_test_api.paths.response_body_post_properties_with_escaped_characters_response_body_for_content_types.post import PostPropertiesWithEscapedCharactersResponseBodyForContentTypes - - -class PropertiesApi( - PostObjectPropertiesValidationRequestBody, - PostObjectPropertiesValidationResponseBodyForContentTypes, - PostPropertiesWithEscapedCharactersRequestBody, - PostPropertiesWithEscapedCharactersResponseBodyForContentTypes, -): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/ref_api.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/ref_api.py deleted file mode 100644 index 7775cd1104f..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/ref_api.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from unit_test_api.paths.request_body_post_property_named_ref_that_is_not_a_reference_request_body.post import PostPropertyNamedRefThatIsNotAReferenceRequestBody -from unit_test_api.paths.response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types.post import PostPropertyNamedRefThatIsNotAReferenceResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_ref_in_additionalproperties_request_body.post import PostRefInAdditionalpropertiesRequestBody -from unit_test_api.paths.response_body_post_ref_in_additionalproperties_response_body_for_content_types.post import PostRefInAdditionalpropertiesResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_ref_in_allof_request_body.post import PostRefInAllofRequestBody -from unit_test_api.paths.response_body_post_ref_in_allof_response_body_for_content_types.post import PostRefInAllofResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_ref_in_anyof_request_body.post import PostRefInAnyofRequestBody -from unit_test_api.paths.response_body_post_ref_in_anyof_response_body_for_content_types.post import PostRefInAnyofResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_ref_in_items_request_body.post import PostRefInItemsRequestBody -from unit_test_api.paths.response_body_post_ref_in_items_response_body_for_content_types.post import PostRefInItemsResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_ref_in_not_request_body.post import PostRefInNotRequestBody -from unit_test_api.paths.response_body_post_ref_in_not_response_body_for_content_types.post import PostRefInNotResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_ref_in_oneof_request_body.post import PostRefInOneofRequestBody -from unit_test_api.paths.response_body_post_ref_in_oneof_response_body_for_content_types.post import PostRefInOneofResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_ref_in_property_request_body.post import PostRefInPropertyRequestBody -from unit_test_api.paths.response_body_post_ref_in_property_response_body_for_content_types.post import PostRefInPropertyResponseBodyForContentTypes - - -class RefApi( - PostPropertyNamedRefThatIsNotAReferenceRequestBody, - PostPropertyNamedRefThatIsNotAReferenceResponseBodyForContentTypes, - PostRefInAdditionalpropertiesRequestBody, - PostRefInAdditionalpropertiesResponseBodyForContentTypes, - PostRefInAllofRequestBody, - PostRefInAllofResponseBodyForContentTypes, - PostRefInAnyofRequestBody, - PostRefInAnyofResponseBodyForContentTypes, - PostRefInItemsRequestBody, - PostRefInItemsResponseBodyForContentTypes, - PostRefInNotRequestBody, - PostRefInNotResponseBodyForContentTypes, - PostRefInOneofRequestBody, - PostRefInOneofResponseBodyForContentTypes, - PostRefInPropertyRequestBody, - PostRefInPropertyResponseBodyForContentTypes, -): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/required_api.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/required_api.py deleted file mode 100644 index 4ba23de087a..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/required_api.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from unit_test_api.paths.request_body_post_required_default_validation_request_body.post import PostRequiredDefaultValidationRequestBody -from unit_test_api.paths.response_body_post_required_default_validation_response_body_for_content_types.post import PostRequiredDefaultValidationResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_required_validation_request_body.post import PostRequiredValidationRequestBody -from unit_test_api.paths.response_body_post_required_validation_response_body_for_content_types.post import PostRequiredValidationResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_required_with_empty_array_request_body.post import PostRequiredWithEmptyArrayRequestBody -from unit_test_api.paths.response_body_post_required_with_empty_array_response_body_for_content_types.post import PostRequiredWithEmptyArrayResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_required_with_escaped_characters_request_body.post import PostRequiredWithEscapedCharactersRequestBody -from unit_test_api.paths.response_body_post_required_with_escaped_characters_response_body_for_content_types.post import PostRequiredWithEscapedCharactersResponseBodyForContentTypes - - -class RequiredApi( - PostRequiredDefaultValidationRequestBody, - PostRequiredDefaultValidationResponseBodyForContentTypes, - PostRequiredValidationRequestBody, - PostRequiredValidationResponseBodyForContentTypes, - PostRequiredWithEmptyArrayRequestBody, - PostRequiredWithEmptyArrayResponseBodyForContentTypes, - PostRequiredWithEscapedCharactersRequestBody, - PostRequiredWithEscapedCharactersResponseBodyForContentTypes, -): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/response_content_content_type_schema_api.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/response_content_content_type_schema_api.py deleted file mode 100644 index 0e0e47d3f8a..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/response_content_content_type_schema_api.py +++ /dev/null @@ -1,195 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from unit_test_api.paths.response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types.post import PostAdditionalpropertiesAllowsASchemaWhichShouldValidateResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types.post import PostAdditionalpropertiesAreAllowedByDefaultResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types.post import PostAdditionalpropertiesCanExistByItselfResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types.post import PostAdditionalpropertiesShouldNotLookInApplicatorsResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types.post import PostAllofCombinedWithAnyofOneofResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_allof_response_body_for_content_types.post import PostAllofResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_allof_simple_types_response_body_for_content_types.post import PostAllofSimpleTypesResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_allof_with_base_schema_response_body_for_content_types.post import PostAllofWithBaseSchemaResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_allof_with_one_empty_schema_response_body_for_content_types.post import PostAllofWithOneEmptySchemaResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types.post import PostAllofWithTheFirstEmptySchemaResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types.post import PostAllofWithTheLastEmptySchemaResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_allof_with_two_empty_schemas_response_body_for_content_types.post import PostAllofWithTwoEmptySchemasResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_anyof_complex_types_response_body_for_content_types.post import PostAnyofComplexTypesResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_anyof_response_body_for_content_types.post import PostAnyofResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_anyof_with_base_schema_response_body_for_content_types.post import PostAnyofWithBaseSchemaResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_anyof_with_one_empty_schema_response_body_for_content_types.post import PostAnyofWithOneEmptySchemaResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_array_type_matches_arrays_response_body_for_content_types.post import PostArrayTypeMatchesArraysResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_boolean_type_matches_booleans_response_body_for_content_types.post import PostBooleanTypeMatchesBooleansResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_by_int_response_body_for_content_types.post import PostByIntResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_by_number_response_body_for_content_types.post import PostByNumberResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_by_small_number_response_body_for_content_types.post import PostBySmallNumberResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_date_time_format_response_body_for_content_types.post import PostDateTimeFormatResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_email_format_response_body_for_content_types.post import PostEmailFormatResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_enum_with0_does_not_match_false_response_body_for_content_types.post import PostEnumWith0DoesNotMatchFalseResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_enum_with1_does_not_match_true_response_body_for_content_types.post import PostEnumWith1DoesNotMatchTrueResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_enum_with_escaped_characters_response_body_for_content_types.post import PostEnumWithEscapedCharactersResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_enum_with_false_does_not_match0_response_body_for_content_types.post import PostEnumWithFalseDoesNotMatch0ResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_enum_with_true_does_not_match1_response_body_for_content_types.post import PostEnumWithTrueDoesNotMatch1ResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_enums_in_properties_response_body_for_content_types.post import PostEnumsInPropertiesResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_forbidden_property_response_body_for_content_types.post import PostForbiddenPropertyResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_hostname_format_response_body_for_content_types.post import PostHostnameFormatResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_integer_type_matches_integers_response_body_for_content_types.post import PostIntegerTypeMatchesIntegersResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types.post import PostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_invalid_string_value_for_default_response_body_for_content_types.post import PostInvalidStringValueForDefaultResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_ipv4_format_response_body_for_content_types.post import PostIpv4FormatResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_ipv6_format_response_body_for_content_types.post import PostIpv6FormatResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_json_pointer_format_response_body_for_content_types.post import PostJsonPointerFormatResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_maximum_validation_response_body_for_content_types.post import PostMaximumValidationResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types.post import PostMaximumValidationWithUnsignedIntegerResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_maxitems_validation_response_body_for_content_types.post import PostMaxitemsValidationResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_maxlength_validation_response_body_for_content_types.post import PostMaxlengthValidationResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types.post import PostMaxproperties0MeansTheObjectIsEmptyResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_maxproperties_validation_response_body_for_content_types.post import PostMaxpropertiesValidationResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_minimum_validation_response_body_for_content_types.post import PostMinimumValidationResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types.post import PostMinimumValidationWithSignedIntegerResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_minitems_validation_response_body_for_content_types.post import PostMinitemsValidationResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_minlength_validation_response_body_for_content_types.post import PostMinlengthValidationResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_minproperties_validation_response_body_for_content_types.post import PostMinpropertiesValidationResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types.post import PostNestedAllofToCheckValidationSemanticsResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types.post import PostNestedAnyofToCheckValidationSemanticsResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_nested_items_response_body_for_content_types.post import PostNestedItemsResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types.post import PostNestedOneofToCheckValidationSemanticsResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_not_more_complex_schema_response_body_for_content_types.post import PostNotMoreComplexSchemaResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_not_response_body_for_content_types.post import PostNotResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_nul_characters_in_strings_response_body_for_content_types.post import PostNulCharactersInStringsResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types.post import PostNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_number_type_matches_numbers_response_body_for_content_types.post import PostNumberTypeMatchesNumbersResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_object_properties_validation_response_body_for_content_types.post import PostObjectPropertiesValidationResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_object_type_matches_objects_response_body_for_content_types.post import PostObjectTypeMatchesObjectsResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_oneof_complex_types_response_body_for_content_types.post import PostOneofComplexTypesResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_oneof_response_body_for_content_types.post import PostOneofResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_oneof_with_base_schema_response_body_for_content_types.post import PostOneofWithBaseSchemaResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_oneof_with_empty_schema_response_body_for_content_types.post import PostOneofWithEmptySchemaResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_oneof_with_required_response_body_for_content_types.post import PostOneofWithRequiredResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_pattern_is_not_anchored_response_body_for_content_types.post import PostPatternIsNotAnchoredResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_pattern_validation_response_body_for_content_types.post import PostPatternValidationResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_properties_with_escaped_characters_response_body_for_content_types.post import PostPropertiesWithEscapedCharactersResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types.post import PostPropertyNamedRefThatIsNotAReferenceResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_ref_in_additionalproperties_response_body_for_content_types.post import PostRefInAdditionalpropertiesResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_ref_in_allof_response_body_for_content_types.post import PostRefInAllofResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_ref_in_anyof_response_body_for_content_types.post import PostRefInAnyofResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_ref_in_items_response_body_for_content_types.post import PostRefInItemsResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_ref_in_not_response_body_for_content_types.post import PostRefInNotResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_ref_in_oneof_response_body_for_content_types.post import PostRefInOneofResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_ref_in_property_response_body_for_content_types.post import PostRefInPropertyResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_required_default_validation_response_body_for_content_types.post import PostRequiredDefaultValidationResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_required_validation_response_body_for_content_types.post import PostRequiredValidationResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_required_with_empty_array_response_body_for_content_types.post import PostRequiredWithEmptyArrayResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_required_with_escaped_characters_response_body_for_content_types.post import PostRequiredWithEscapedCharactersResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_simple_enum_validation_response_body_for_content_types.post import PostSimpleEnumValidationResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_string_type_matches_strings_response_body_for_content_types.post import PostStringTypeMatchesStringsResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types.post import PostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_uniqueitems_false_validation_response_body_for_content_types.post import PostUniqueitemsFalseValidationResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_uniqueitems_validation_response_body_for_content_types.post import PostUniqueitemsValidationResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_uri_format_response_body_for_content_types.post import PostUriFormatResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_uri_reference_format_response_body_for_content_types.post import PostUriReferenceFormatResponseBodyForContentTypes -from unit_test_api.paths.response_body_post_uri_template_format_response_body_for_content_types.post import PostUriTemplateFormatResponseBodyForContentTypes - - -class ResponseContentContentTypeSchemaApi( - PostAdditionalpropertiesAllowsASchemaWhichShouldValidateResponseBodyForContentTypes, - PostAdditionalpropertiesAreAllowedByDefaultResponseBodyForContentTypes, - PostAdditionalpropertiesCanExistByItselfResponseBodyForContentTypes, - PostAdditionalpropertiesShouldNotLookInApplicatorsResponseBodyForContentTypes, - PostAllofCombinedWithAnyofOneofResponseBodyForContentTypes, - PostAllofResponseBodyForContentTypes, - PostAllofSimpleTypesResponseBodyForContentTypes, - PostAllofWithBaseSchemaResponseBodyForContentTypes, - PostAllofWithOneEmptySchemaResponseBodyForContentTypes, - PostAllofWithTheFirstEmptySchemaResponseBodyForContentTypes, - PostAllofWithTheLastEmptySchemaResponseBodyForContentTypes, - PostAllofWithTwoEmptySchemasResponseBodyForContentTypes, - PostAnyofComplexTypesResponseBodyForContentTypes, - PostAnyofResponseBodyForContentTypes, - PostAnyofWithBaseSchemaResponseBodyForContentTypes, - PostAnyofWithOneEmptySchemaResponseBodyForContentTypes, - PostArrayTypeMatchesArraysResponseBodyForContentTypes, - PostBooleanTypeMatchesBooleansResponseBodyForContentTypes, - PostByIntResponseBodyForContentTypes, - PostByNumberResponseBodyForContentTypes, - PostBySmallNumberResponseBodyForContentTypes, - PostDateTimeFormatResponseBodyForContentTypes, - PostEmailFormatResponseBodyForContentTypes, - PostEnumWith0DoesNotMatchFalseResponseBodyForContentTypes, - PostEnumWith1DoesNotMatchTrueResponseBodyForContentTypes, - PostEnumWithEscapedCharactersResponseBodyForContentTypes, - PostEnumWithFalseDoesNotMatch0ResponseBodyForContentTypes, - PostEnumWithTrueDoesNotMatch1ResponseBodyForContentTypes, - PostEnumsInPropertiesResponseBodyForContentTypes, - PostForbiddenPropertyResponseBodyForContentTypes, - PostHostnameFormatResponseBodyForContentTypes, - PostIntegerTypeMatchesIntegersResponseBodyForContentTypes, - PostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfResponseBodyForContentTypes, - PostInvalidStringValueForDefaultResponseBodyForContentTypes, - PostIpv4FormatResponseBodyForContentTypes, - PostIpv6FormatResponseBodyForContentTypes, - PostJsonPointerFormatResponseBodyForContentTypes, - PostMaximumValidationResponseBodyForContentTypes, - PostMaximumValidationWithUnsignedIntegerResponseBodyForContentTypes, - PostMaxitemsValidationResponseBodyForContentTypes, - PostMaxlengthValidationResponseBodyForContentTypes, - PostMaxproperties0MeansTheObjectIsEmptyResponseBodyForContentTypes, - PostMaxpropertiesValidationResponseBodyForContentTypes, - PostMinimumValidationResponseBodyForContentTypes, - PostMinimumValidationWithSignedIntegerResponseBodyForContentTypes, - PostMinitemsValidationResponseBodyForContentTypes, - PostMinlengthValidationResponseBodyForContentTypes, - PostMinpropertiesValidationResponseBodyForContentTypes, - PostNestedAllofToCheckValidationSemanticsResponseBodyForContentTypes, - PostNestedAnyofToCheckValidationSemanticsResponseBodyForContentTypes, - PostNestedItemsResponseBodyForContentTypes, - PostNestedOneofToCheckValidationSemanticsResponseBodyForContentTypes, - PostNotMoreComplexSchemaResponseBodyForContentTypes, - PostNotResponseBodyForContentTypes, - PostNulCharactersInStringsResponseBodyForContentTypes, - PostNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes, - PostNumberTypeMatchesNumbersResponseBodyForContentTypes, - PostObjectPropertiesValidationResponseBodyForContentTypes, - PostObjectTypeMatchesObjectsResponseBodyForContentTypes, - PostOneofComplexTypesResponseBodyForContentTypes, - PostOneofResponseBodyForContentTypes, - PostOneofWithBaseSchemaResponseBodyForContentTypes, - PostOneofWithEmptySchemaResponseBodyForContentTypes, - PostOneofWithRequiredResponseBodyForContentTypes, - PostPatternIsNotAnchoredResponseBodyForContentTypes, - PostPatternValidationResponseBodyForContentTypes, - PostPropertiesWithEscapedCharactersResponseBodyForContentTypes, - PostPropertyNamedRefThatIsNotAReferenceResponseBodyForContentTypes, - PostRefInAdditionalpropertiesResponseBodyForContentTypes, - PostRefInAllofResponseBodyForContentTypes, - PostRefInAnyofResponseBodyForContentTypes, - PostRefInItemsResponseBodyForContentTypes, - PostRefInNotResponseBodyForContentTypes, - PostRefInOneofResponseBodyForContentTypes, - PostRefInPropertyResponseBodyForContentTypes, - PostRequiredDefaultValidationResponseBodyForContentTypes, - PostRequiredValidationResponseBodyForContentTypes, - PostRequiredWithEmptyArrayResponseBodyForContentTypes, - PostRequiredWithEscapedCharactersResponseBodyForContentTypes, - PostSimpleEnumValidationResponseBodyForContentTypes, - PostStringTypeMatchesStringsResponseBodyForContentTypes, - PostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyForContentTypes, - PostUniqueitemsFalseValidationResponseBodyForContentTypes, - PostUniqueitemsValidationResponseBodyForContentTypes, - PostUriFormatResponseBodyForContentTypes, - PostUriReferenceFormatResponseBodyForContentTypes, - PostUriTemplateFormatResponseBodyForContentTypes, -): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/type_api.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/type_api.py deleted file mode 100644 index dbb518c1c00..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/type_api.py +++ /dev/null @@ -1,49 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from unit_test_api.paths.request_body_post_array_type_matches_arrays_request_body.post import PostArrayTypeMatchesArraysRequestBody -from unit_test_api.paths.response_body_post_array_type_matches_arrays_response_body_for_content_types.post import PostArrayTypeMatchesArraysResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_boolean_type_matches_booleans_request_body.post import PostBooleanTypeMatchesBooleansRequestBody -from unit_test_api.paths.response_body_post_boolean_type_matches_booleans_response_body_for_content_types.post import PostBooleanTypeMatchesBooleansResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_integer_type_matches_integers_request_body.post import PostIntegerTypeMatchesIntegersRequestBody -from unit_test_api.paths.response_body_post_integer_type_matches_integers_response_body_for_content_types.post import PostIntegerTypeMatchesIntegersResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_null_type_matches_only_the_null_object_request_body.post import PostNullTypeMatchesOnlyTheNullObjectRequestBody -from unit_test_api.paths.response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types.post import PostNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_number_type_matches_numbers_request_body.post import PostNumberTypeMatchesNumbersRequestBody -from unit_test_api.paths.response_body_post_number_type_matches_numbers_response_body_for_content_types.post import PostNumberTypeMatchesNumbersResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_object_type_matches_objects_request_body.post import PostObjectTypeMatchesObjectsRequestBody -from unit_test_api.paths.response_body_post_object_type_matches_objects_response_body_for_content_types.post import PostObjectTypeMatchesObjectsResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_string_type_matches_strings_request_body.post import PostStringTypeMatchesStringsRequestBody -from unit_test_api.paths.response_body_post_string_type_matches_strings_response_body_for_content_types.post import PostStringTypeMatchesStringsResponseBodyForContentTypes - - -class TypeApi( - PostArrayTypeMatchesArraysRequestBody, - PostArrayTypeMatchesArraysResponseBodyForContentTypes, - PostBooleanTypeMatchesBooleansRequestBody, - PostBooleanTypeMatchesBooleansResponseBodyForContentTypes, - PostIntegerTypeMatchesIntegersRequestBody, - PostIntegerTypeMatchesIntegersResponseBodyForContentTypes, - PostNullTypeMatchesOnlyTheNullObjectRequestBody, - PostNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes, - PostNumberTypeMatchesNumbersRequestBody, - PostNumberTypeMatchesNumbersResponseBodyForContentTypes, - PostObjectTypeMatchesObjectsRequestBody, - PostObjectTypeMatchesObjectsResponseBodyForContentTypes, - PostStringTypeMatchesStringsRequestBody, - PostStringTypeMatchesStringsResponseBodyForContentTypes, -): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/unique_items_api.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/unique_items_api.py deleted file mode 100644 index 820896d2894..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/unique_items_api.py +++ /dev/null @@ -1,29 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from unit_test_api.paths.request_body_post_uniqueitems_false_validation_request_body.post import PostUniqueitemsFalseValidationRequestBody -from unit_test_api.paths.response_body_post_uniqueitems_false_validation_response_body_for_content_types.post import PostUniqueitemsFalseValidationResponseBodyForContentTypes -from unit_test_api.paths.request_body_post_uniqueitems_validation_request_body.post import PostUniqueitemsValidationRequestBody -from unit_test_api.paths.response_body_post_uniqueitems_validation_response_body_for_content_types.post import PostUniqueitemsValidationResponseBodyForContentTypes - - -class UniqueItemsApi( - PostUniqueitemsFalseValidationRequestBody, - PostUniqueitemsFalseValidationResponseBodyForContentTypes, - PostUniqueitemsValidationRequestBody, - PostUniqueitemsValidationResponseBodyForContentTypes, -): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/configuration.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/configuration.py deleted file mode 100644 index df35a2dfdc7..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/configuration.py +++ /dev/null @@ -1,410 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import copy -import logging -import multiprocessing -import sys -import urllib3 - -from http import client as http_client -from unit_test_api.exceptions import ApiValueError - - -JSON_SCHEMA_VALIDATION_KEYWORDS = { - 'multipleOf', 'maximum', 'exclusiveMaximum', - 'minimum', 'exclusiveMinimum', 'maxLength', - 'minLength', 'pattern', 'maxItems', 'minItems', - 'uniqueItems', 'maxProperties', 'minProperties', -} - -class Configuration(object): - """NOTE: This class is auto generated by OpenAPI Generator - - Ref: https://openapi-generator.tech - Do not edit the class manually. - - :param host: Base url - :param api_key: Dict to store API key(s). - Each entry in the dict specifies an API key. - The dict key is the name of the security scheme in the OAS specification. - The dict value is the API key secret. - :param api_key_prefix: Dict to store API prefix (e.g. Bearer) - The dict key is the name of the security scheme in the OAS specification. - The dict value is an API key prefix when generating the auth data. - :param username: Username for HTTP basic authentication - :param password: Password for HTTP basic authentication - :param disabled_client_side_validations (string): Comma-separated list of - JSON schema validation keywords to disable JSON schema structural validation - rules. The following keywords may be specified: multipleOf, maximum, - exclusiveMaximum, minimum, exclusiveMinimum, maxLength, minLength, pattern, - maxItems, minItems. - By default, the validation is performed for data generated locally by the client - and data received from the server, independent of any validation performed by - the server side. If the input data does not satisfy the JSON schema validation - rules specified in the OpenAPI document, an exception is raised. - If disabled_client_side_validations is set, structural validation is - disabled. This can be useful to troubleshoot data validation problem, such as - when the OpenAPI document validation rules do not match the actual API data - received by the server. - :param server_index: Index to servers configuration. - :param server_variables: Mapping with string values to replace variables in - templated server configuration. The validation of enums is performed for - variables with defined enum values before. - :param server_operation_index: Mapping from operation ID to an index to server - configuration. - :param server_operation_variables: Mapping from operation ID to a mapping with - string values to replace variables in templated server configuration. - The validation of enums is performed for variables with defined enum values before. - - """ - - _default = None - - def __init__( - self, - host=None, - disabled_client_side_validations="", - server_index=None, - server_variables=None, - server_operation_index=None, - server_operation_variables=None, - ): - """Constructor - """ - self._base_path = "https://someserver.com/v1" if host is None else host - """Default Base url - """ - self.server_index = 0 if server_index is None and host is None else server_index - self.server_operation_index = server_operation_index or {} - """Default server index - """ - self.server_variables = server_variables or {} - self.server_operation_variables = server_operation_variables or {} - """Default server variables - """ - self.temp_folder_path = None - """Temp file folder for downloading files - """ - # Authentication Settings - self.disabled_client_side_validations = disabled_client_side_validations - self.logger = {} - """Logging Settings - """ - self.logger["package_logger"] = logging.getLogger("unit_test_api") - self.logger["urllib3_logger"] = logging.getLogger("urllib3") - self.logger_format = '%(asctime)s %(levelname)s %(message)s' - """Log format - """ - self.logger_stream_handler = None - """Log stream handler - """ - self.logger_file_handler = None - """Log file handler - """ - self.logger_file = None - """Debug file location - """ - self.debug = False - """Debug switch - """ - - self.verify_ssl = True - """SSL/TLS verification - Set this to false to skip verifying SSL certificate when calling API - from https server. - """ - self.ssl_ca_cert = None - """Set this to customize the certificate file to verify the peer. - """ - self.cert_file = None - """client certificate file - """ - self.key_file = None - """client key file - """ - self.assert_hostname = None - """Set this to True/False to enable/disable SSL hostname verification. - """ - - self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 - """urllib3 connection pool's maximum number of connections saved - per pool. urllib3 uses 1 connection as default value, but this is - not the best value when you are making a lot of possibly parallel - requests to the same host, which is often the case here. - cpu_count * 5 is used as default value to increase performance. - """ - - self.proxy = None - """Proxy URL - """ - self.proxy_headers = None - """Proxy headers - """ - self.safe_chars_for_path_param = '' - """Safe chars for path_param - """ - self.retries = None - """Adding retries to override urllib3 default value 3 - """ - # Enable client side validation - self.client_side_validation = True - - # Options to pass down to the underlying urllib3 socket - self.socket_options = None - - def __deepcopy__(self, memo): - cls = self.__class__ - result = cls.__new__(cls) - memo[id(self)] = result - for k, v in self.__dict__.items(): - if k not in ('logger', 'logger_file_handler'): - setattr(result, k, copy.deepcopy(v, memo)) - # shallow copy of loggers - result.logger = copy.copy(self.logger) - # use setters to configure loggers - result.logger_file = self.logger_file - result.debug = self.debug - return result - - def __setattr__(self, name, value): - object.__setattr__(self, name, value) - if name == 'disabled_client_side_validations': - s = set(filter(None, value.split(','))) - for v in s: - if v not in JSON_SCHEMA_VALIDATION_KEYWORDS: - raise ApiValueError( - "Invalid keyword: '{0}''".format(v)) - self._disabled_client_side_validations = s - - @classmethod - def set_default(cls, default): - """Set default instance of configuration. - - It stores default configuration, which can be - returned by get_default_copy method. - - :param default: object of Configuration - """ - cls._default = copy.deepcopy(default) - - @classmethod - def get_default_copy(cls): - """Return new instance of configuration. - - This method returns newly created, based on default constructor, - object of Configuration class or returns a copy of default - configuration passed by the set_default method. - - :return: The configuration object. - """ - if cls._default is not None: - return copy.deepcopy(cls._default) - return Configuration() - - @property - def logger_file(self): - """The logger file. - - If the logger_file is None, then add stream handler and remove file - handler. Otherwise, add file handler and remove stream handler. - - :param value: The logger_file path. - :type: str - """ - return self.__logger_file - - @logger_file.setter - def logger_file(self, value): - """The logger file. - - If the logger_file is None, then add stream handler and remove file - handler. Otherwise, add file handler and remove stream handler. - - :param value: The logger_file path. - :type: str - """ - self.__logger_file = value - if self.__logger_file: - # If set logging file, - # then add file handler and remove stream handler. - self.logger_file_handler = logging.FileHandler(self.__logger_file) - self.logger_file_handler.setFormatter(self.logger_formatter) - for _, logger in self.logger.items(): - logger.addHandler(self.logger_file_handler) - - @property - def debug(self): - """Debug status - - :param value: The debug status, True or False. - :type: bool - """ - return self.__debug - - @debug.setter - def debug(self, value): - """Debug status - - :param value: The debug status, True or False. - :type: bool - """ - self.__debug = value - if self.__debug: - # if debug status is True, turn on debug logging - for _, logger in self.logger.items(): - logger.setLevel(logging.DEBUG) - # turn on http_client debug - http_client.HTTPConnection.debuglevel = 1 - else: - # if debug status is False, turn off debug logging, - # setting log level to default `logging.WARNING` - for _, logger in self.logger.items(): - logger.setLevel(logging.WARNING) - # turn off http_client debug - http_client.HTTPConnection.debuglevel = 0 - - @property - def logger_format(self): - """The logger format. - - The logger_formatter will be updated when sets logger_format. - - :param value: The format string. - :type: str - """ - return self.__logger_format - - @logger_format.setter - def logger_format(self, value): - """The logger format. - - The logger_formatter will be updated when sets logger_format. - - :param value: The format string. - :type: str - """ - self.__logger_format = value - self.logger_formatter = logging.Formatter(self.__logger_format) - - def get_api_key_with_prefix(self, identifier, alias=None): - """Gets API key (with prefix if set). - - :param identifier: The identifier of apiKey. - :param alias: The alternative identifier of apiKey. - :return: The token for api key authentication. - """ - if self.refresh_api_key_hook is not None: - self.refresh_api_key_hook(self) - key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None) - if key: - prefix = self.api_key_prefix.get(identifier) - if prefix: - return "%s %s" % (prefix, key) - else: - return key - - def get_basic_auth_token(self): - """Gets HTTP basic authentication header (string). - - :return: The token for basic HTTP authentication. - """ - username = "" - if self.username is not None: - username = self.username - password = "" - if self.password is not None: - password = self.password - return urllib3.util.make_headers( - basic_auth=username + ':' + password - ).get('authorization') - - def auth_settings(self): - """Gets Auth Settings dict for api client. - - :return: The Auth Settings information dict. - """ - auth = {} - return auth - - def to_debug_report(self): - """Gets the essential information for debugging. - - :return: The report for debugging. - """ - return "Python SDK Debug Report:\n"\ - "OS: {env}\n"\ - "Python Version: {pyversion}\n"\ - "Version of the API: 0.0.1\n"\ - "SDK Package Version: 1.0.0".\ - format(env=sys.platform, pyversion=sys.version) - - def get_host_settings(self): - """Gets an array of host settings - - :return: An array of host settings - """ - return [ - { - 'url': "https://someserver.com/v1", - 'description': "No description provided", - } - ] - - def get_host_from_settings(self, index, variables=None, servers=None): - """Gets host URL based on the index and variables - :param index: array index of the host settings - :param variables: hash of variable and the corresponding value - :param servers: an array of host settings or None - :return: URL based on host settings - """ - if index is None: - return self._base_path - - variables = {} if variables is None else variables - servers = self.get_host_settings() if servers is None else servers - - try: - server = servers[index] - except IndexError: - raise ValueError( - "Invalid index {0} when selecting the host settings. " - "Must be less than {1}".format(index, len(servers))) - - url = server['url'] - - # go through variables and replace placeholders - for variable_name, variable in server.get('variables', {}).items(): - used_value = variables.get( - variable_name, variable['default_value']) - - if 'enum_values' in variable \ - and used_value not in variable['enum_values']: - raise ValueError( - "The variable `{0}` in the host URL has invalid value " - "{1}. Must be {2}.".format( - variable_name, variables[variable_name], - variable['enum_values'])) - - url = url.replace("{" + variable_name + "}", used_value) - - return url - - @property - def host(self): - """Return generated host.""" - return self.get_host_from_settings(self.server_index, variables=self.server_variables) - - @host.setter - def host(self, value): - """Fix base path.""" - self._base_path = value - self.server_index = None diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/exceptions.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/exceptions.py deleted file mode 100644 index 983bba8a4c4..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/exceptions.py +++ /dev/null @@ -1,147 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" -import dataclasses -import typing - -from urllib3._collections import HTTPHeaderDict - - -class OpenApiException(Exception): - """The base exception class for all OpenAPIExceptions""" - - -class ApiTypeError(OpenApiException, TypeError): - def __init__(self, msg, path_to_item=None, valid_classes=None, - key_type=None): - """ Raises an exception for TypeErrors - - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (list): a list of keys an indices to get to the - current_item - None if unset - valid_classes (tuple): the primitive classes that current item - should be an instance of - None if unset - key_type (bool): False if our value is a value in a dict - True if it is a key in a dict - False if our item is an item in a list - None if unset - """ - self.path_to_item = path_to_item - self.valid_classes = valid_classes - self.key_type = key_type - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiTypeError, self).__init__(full_msg) - - -class ApiValueError(OpenApiException, ValueError): - def __init__(self, msg, path_to_item=None): - """ - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (list) the path to the exception in the - received_data dict. None if unset - """ - - self.path_to_item = path_to_item - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiValueError, self).__init__(full_msg) - - -class ApiAttributeError(OpenApiException, AttributeError): - def __init__(self, msg, path_to_item=None): - """ - Raised when an attribute reference or assignment fails. - - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (None/list) the path to the exception in the - received_data dict - """ - self.path_to_item = path_to_item - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiAttributeError, self).__init__(full_msg) - - -class ApiKeyError(OpenApiException, KeyError): - def __init__(self, msg, path_to_item=None): - """ - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (None/list) the path to the exception in the - received_data dict - """ - self.path_to_item = path_to_item - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiKeyError, self).__init__(full_msg) - - -T = typing.TypeVar("T") - - -@dataclasses.dataclass -class ApiException(OpenApiException, typing.Generic[T]): - status: int - reason: str - api_response: typing.Optional[T] = None - - @property - def body(self) -> typing.Union[str, bytes, None]: - if not self.api_response: - return None - return self.api_response.response.data - - @property - def headers(self) -> typing.Optional[HTTPHeaderDict]: - if not self.api_response: - return None - return self.api_response.response.getheaders() - - def __str__(self): - """Custom error messages for exception""" - error_message = "({0})\n"\ - "Reason: {1}\n".format(self.status, self.reason) - if self.headers: - error_message += "HTTP response headers: {0}\n".format( - self.headers) - - if self.body: - error_message += "HTTP response body: {0}\n".format(self.body) - - return error_message - - -def render_path(path_to_item): - """Returns a string representation of a path""" - result = "" - for pth in path_to_item: - if isinstance(pth, int): - result += "[{0}]".format(pth) - else: - result += "['{0}']".format(pth) - return result diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/__init__.py deleted file mode 100644 index 0056d7a31eb..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -# we can not import model classes here because that would create a circular -# reference which would not work in python2 -# do not import all models into this module because that uses a lot of memory and stack frames -# if you need the ability to import all models from one package, import them with -# from unit_test_api.models import ModelA, ModelB diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/additionalproperties_allows_a_schema_which_should_validate.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/additionalproperties_allows_a_schema_which_should_validate.py deleted file mode 100644 index 9e581b19d8f..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/additionalproperties_allows_a_schema_which_should_validate.py +++ /dev/null @@ -1,87 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class AdditionalpropertiesAllowsASchemaWhichShouldValidate( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - foo = schemas.AnyTypeSchema - bar = schemas.AnyTypeSchema - __annotations__ = { - "foo": foo, - "bar": bar, - } - additional_properties = schemas.BoolSchema - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["bar"]) -> MetaOapg.properties.bar: ... - - @typing.overload - def __getitem__(self, name: str) -> MetaOapg.additional_properties: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["foo"], typing_extensions.Literal["bar"], str, ]): - # dict_instance[name] accessor - return super().__getitem__(name) - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["foo"]) -> typing.Union[MetaOapg.properties.foo, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["bar"]) -> typing.Union[MetaOapg.properties.bar, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[MetaOapg.additional_properties, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["foo"], typing_extensions.Literal["bar"], str, ]): - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - foo: typing.Union[MetaOapg.properties.foo, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - bar: typing.Union[MetaOapg.properties.bar, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, bool, ], - ) -> 'AdditionalpropertiesAllowsASchemaWhichShouldValidate': - return super().__new__( - cls, - *_args, - foo=foo, - bar=bar, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/additionalproperties_allows_a_schema_which_should_validate.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/additionalproperties_allows_a_schema_which_should_validate.pyi deleted file mode 100644 index 9e581b19d8f..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/additionalproperties_allows_a_schema_which_should_validate.pyi +++ /dev/null @@ -1,87 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class AdditionalpropertiesAllowsASchemaWhichShouldValidate( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - foo = schemas.AnyTypeSchema - bar = schemas.AnyTypeSchema - __annotations__ = { - "foo": foo, - "bar": bar, - } - additional_properties = schemas.BoolSchema - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["bar"]) -> MetaOapg.properties.bar: ... - - @typing.overload - def __getitem__(self, name: str) -> MetaOapg.additional_properties: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["foo"], typing_extensions.Literal["bar"], str, ]): - # dict_instance[name] accessor - return super().__getitem__(name) - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["foo"]) -> typing.Union[MetaOapg.properties.foo, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["bar"]) -> typing.Union[MetaOapg.properties.bar, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[MetaOapg.additional_properties, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["foo"], typing_extensions.Literal["bar"], str, ]): - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - foo: typing.Union[MetaOapg.properties.foo, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - bar: typing.Union[MetaOapg.properties.bar, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, bool, ], - ) -> 'AdditionalpropertiesAllowsASchemaWhichShouldValidate': - return super().__new__( - cls, - *_args, - foo=foo, - bar=bar, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/additionalproperties_are_allowed_by_default.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/additionalproperties_are_allowed_by_default.py deleted file mode 100644 index 67bcff89af4..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/additionalproperties_are_allowed_by_default.py +++ /dev/null @@ -1,89 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class AdditionalpropertiesAreAllowedByDefault( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - foo = schemas.AnyTypeSchema - bar = schemas.AnyTypeSchema - __annotations__ = { - "foo": foo, - "bar": bar, - } - - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["bar"]) -> MetaOapg.properties.bar: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["foo", "bar", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["foo"]) -> typing.Union[MetaOapg.properties.foo, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["bar"]) -> typing.Union[MetaOapg.properties.bar, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["foo", "bar", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - foo: typing.Union[MetaOapg.properties.foo, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - bar: typing.Union[MetaOapg.properties.bar, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'AdditionalpropertiesAreAllowedByDefault': - return super().__new__( - cls, - *_args, - foo=foo, - bar=bar, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/additionalproperties_are_allowed_by_default.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/additionalproperties_are_allowed_by_default.pyi deleted file mode 100644 index 67bcff89af4..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/additionalproperties_are_allowed_by_default.pyi +++ /dev/null @@ -1,89 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class AdditionalpropertiesAreAllowedByDefault( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - foo = schemas.AnyTypeSchema - bar = schemas.AnyTypeSchema - __annotations__ = { - "foo": foo, - "bar": bar, - } - - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["bar"]) -> MetaOapg.properties.bar: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["foo", "bar", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["foo"]) -> typing.Union[MetaOapg.properties.foo, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["bar"]) -> typing.Union[MetaOapg.properties.bar, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["foo", "bar", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - foo: typing.Union[MetaOapg.properties.foo, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - bar: typing.Union[MetaOapg.properties.bar, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'AdditionalpropertiesAreAllowedByDefault': - return super().__new__( - cls, - *_args, - foo=foo, - bar=bar, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/additionalproperties_can_exist_by_itself.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/additionalproperties_can_exist_by_itself.py deleted file mode 100644 index 9d86ab6eeaa..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/additionalproperties_can_exist_by_itself.py +++ /dev/null @@ -1,57 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class AdditionalpropertiesCanExistByItself( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - additional_properties = schemas.BoolSchema - - def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, bool, ], - ) -> 'AdditionalpropertiesCanExistByItself': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/additionalproperties_can_exist_by_itself.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/additionalproperties_can_exist_by_itself.pyi deleted file mode 100644 index 9d86ab6eeaa..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/additionalproperties_can_exist_by_itself.pyi +++ /dev/null @@ -1,57 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class AdditionalpropertiesCanExistByItself( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - additional_properties = schemas.BoolSchema - - def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, bool, ], - ) -> 'AdditionalpropertiesCanExistByItself': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/additionalproperties_should_not_look_in_applicators.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/additionalproperties_should_not_look_in_applicators.py deleted file mode 100644 index 629a345a675..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/additionalproperties_should_not_look_in_applicators.py +++ /dev/null @@ -1,123 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class AdditionalpropertiesShouldNotLookInApplicators( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - additional_properties = schemas.BoolSchema - - - class all_of_0( - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - - class properties: - foo = schemas.AnyTypeSchema - __annotations__ = { - "foo": foo, - } - - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["foo", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["foo"]) -> typing.Union[MetaOapg.properties.foo, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["foo", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - foo: typing.Union[MetaOapg.properties.foo, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'all_of_0': - return super().__new__( - cls, - *_args, - foo=foo, - _configuration=_configuration, - **kwargs, - ) - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.all_of_0, - ] - - - def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, bool, ], - ) -> 'AdditionalpropertiesShouldNotLookInApplicators': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/additionalproperties_should_not_look_in_applicators.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/additionalproperties_should_not_look_in_applicators.pyi deleted file mode 100644 index 629a345a675..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/additionalproperties_should_not_look_in_applicators.pyi +++ /dev/null @@ -1,123 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class AdditionalpropertiesShouldNotLookInApplicators( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - additional_properties = schemas.BoolSchema - - - class all_of_0( - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - - class properties: - foo = schemas.AnyTypeSchema - __annotations__ = { - "foo": foo, - } - - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["foo", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["foo"]) -> typing.Union[MetaOapg.properties.foo, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["foo", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - foo: typing.Union[MetaOapg.properties.foo, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'all_of_0': - return super().__new__( - cls, - *_args, - foo=foo, - _configuration=_configuration, - **kwargs, - ) - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.all_of_0, - ] - - - def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, bool, ], - ) -> 'AdditionalpropertiesShouldNotLookInApplicators': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof.py deleted file mode 100644 index 2c672855e2d..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof.py +++ /dev/null @@ -1,177 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class Allof( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - class all_of_0( - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - required = { - "bar", - } - - class properties: - bar = schemas.IntSchema - __annotations__ = { - "bar": bar, - } - - - bar: MetaOapg.properties.bar - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["bar"]) -> MetaOapg.properties.bar: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["bar", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["bar"]) -> MetaOapg.properties.bar: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["bar", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - bar: typing.Union[MetaOapg.properties.bar, decimal.Decimal, int, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'all_of_0': - return super().__new__( - cls, - *_args, - bar=bar, - _configuration=_configuration, - **kwargs, - ) - - - class all_of_1( - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - required = { - "foo", - } - - class properties: - foo = schemas.StrSchema - __annotations__ = { - "foo": foo, - } - - - foo: MetaOapg.properties.foo - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["foo", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["foo", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - foo: typing.Union[MetaOapg.properties.foo, str, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'all_of_1': - return super().__new__( - cls, - *_args, - foo=foo, - _configuration=_configuration, - **kwargs, - ) - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.all_of_0, - cls.all_of_1, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Allof': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof.pyi deleted file mode 100644 index 2c672855e2d..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof.pyi +++ /dev/null @@ -1,177 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class Allof( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - class all_of_0( - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - required = { - "bar", - } - - class properties: - bar = schemas.IntSchema - __annotations__ = { - "bar": bar, - } - - - bar: MetaOapg.properties.bar - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["bar"]) -> MetaOapg.properties.bar: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["bar", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["bar"]) -> MetaOapg.properties.bar: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["bar", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - bar: typing.Union[MetaOapg.properties.bar, decimal.Decimal, int, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'all_of_0': - return super().__new__( - cls, - *_args, - bar=bar, - _configuration=_configuration, - **kwargs, - ) - - - class all_of_1( - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - required = { - "foo", - } - - class properties: - foo = schemas.StrSchema - __annotations__ = { - "foo": foo, - } - - - foo: MetaOapg.properties.foo - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["foo", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["foo", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - foo: typing.Union[MetaOapg.properties.foo, str, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'all_of_1': - return super().__new__( - cls, - *_args, - foo=foo, - _configuration=_configuration, - **kwargs, - ) - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.all_of_0, - cls.all_of_1, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Allof': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_combined_with_anyof_oneof.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_combined_with_anyof_oneof.py deleted file mode 100644 index 2ff1d34cf09..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_combined_with_anyof_oneof.py +++ /dev/null @@ -1,161 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class AllofCombinedWithAnyofOneof( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - class all_of_0( - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - multiple_of = 2 - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'all_of_0': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - - class one_of_0( - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - multiple_of = 5 - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'one_of_0': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - - class any_of_0( - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - multiple_of = 3 - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'any_of_0': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.all_of_0, - ] - - @classmethod - @functools.lru_cache() - def one_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.one_of_0, - ] - - @classmethod - @functools.lru_cache() - def any_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.any_of_0, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'AllofCombinedWithAnyofOneof': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_combined_with_anyof_oneof.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_combined_with_anyof_oneof.pyi deleted file mode 100644 index b9afb0232d9..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_combined_with_anyof_oneof.pyi +++ /dev/null @@ -1,158 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class AllofCombinedWithAnyofOneof( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - class all_of_0( - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'all_of_0': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - - class one_of_0( - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'one_of_0': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - - class any_of_0( - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'any_of_0': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.all_of_0, - ] - - @classmethod - @functools.lru_cache() - def one_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.one_of_0, - ] - - @classmethod - @functools.lru_cache() - def any_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.any_of_0, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'AllofCombinedWithAnyofOneof': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_simple_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_simple_types.py deleted file mode 100644 index 5ede861b17c..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_simple_types.py +++ /dev/null @@ -1,111 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class AllofSimpleTypes( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - class all_of_0( - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - inclusive_maximum = 30 - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'all_of_0': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - - class all_of_1( - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - inclusive_minimum = 20 - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'all_of_1': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.all_of_0, - cls.all_of_1, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'AllofSimpleTypes': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_simple_types.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_simple_types.pyi deleted file mode 100644 index 709f7579168..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_simple_types.pyi +++ /dev/null @@ -1,109 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class AllofSimpleTypes( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - class all_of_0( - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'all_of_0': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - - class all_of_1( - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'all_of_1': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.all_of_0, - cls.all_of_1, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'AllofSimpleTypes': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_with_base_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_with_base_schema.py deleted file mode 100644 index a2d8ed50db0..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_with_base_schema.py +++ /dev/null @@ -1,211 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class AllofWithBaseSchema( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "bar", - } - - class properties: - bar = schemas.IntSchema - __annotations__ = { - "bar": bar, - } - - - class all_of_0( - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - required = { - "foo", - } - - class properties: - foo = schemas.StrSchema - __annotations__ = { - "foo": foo, - } - - - foo: MetaOapg.properties.foo - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["foo", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["foo", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - foo: typing.Union[MetaOapg.properties.foo, str, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'all_of_0': - return super().__new__( - cls, - *_args, - foo=foo, - _configuration=_configuration, - **kwargs, - ) - - - class all_of_1( - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - required = { - "baz", - } - - class properties: - baz = schemas.NoneSchema - __annotations__ = { - "baz": baz, - } - - - baz: MetaOapg.properties.baz - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["baz"]) -> MetaOapg.properties.baz: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["baz", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["baz"]) -> MetaOapg.properties.baz: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["baz", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - baz: typing.Union[MetaOapg.properties.baz, None, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'all_of_1': - return super().__new__( - cls, - *_args, - baz=baz, - _configuration=_configuration, - **kwargs, - ) - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.all_of_0, - cls.all_of_1, - ] - - - bar: MetaOapg.properties.bar - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["bar"]) -> MetaOapg.properties.bar: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["bar", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["bar"]) -> MetaOapg.properties.bar: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["bar", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - bar: typing.Union[MetaOapg.properties.bar, decimal.Decimal, int, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'AllofWithBaseSchema': - return super().__new__( - cls, - *_args, - bar=bar, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_with_base_schema.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_with_base_schema.pyi deleted file mode 100644 index a2d8ed50db0..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_with_base_schema.pyi +++ /dev/null @@ -1,211 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class AllofWithBaseSchema( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "bar", - } - - class properties: - bar = schemas.IntSchema - __annotations__ = { - "bar": bar, - } - - - class all_of_0( - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - required = { - "foo", - } - - class properties: - foo = schemas.StrSchema - __annotations__ = { - "foo": foo, - } - - - foo: MetaOapg.properties.foo - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["foo", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["foo", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - foo: typing.Union[MetaOapg.properties.foo, str, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'all_of_0': - return super().__new__( - cls, - *_args, - foo=foo, - _configuration=_configuration, - **kwargs, - ) - - - class all_of_1( - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - required = { - "baz", - } - - class properties: - baz = schemas.NoneSchema - __annotations__ = { - "baz": baz, - } - - - baz: MetaOapg.properties.baz - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["baz"]) -> MetaOapg.properties.baz: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["baz", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["baz"]) -> MetaOapg.properties.baz: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["baz", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - baz: typing.Union[MetaOapg.properties.baz, None, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'all_of_1': - return super().__new__( - cls, - *_args, - baz=baz, - _configuration=_configuration, - **kwargs, - ) - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.all_of_0, - cls.all_of_1, - ] - - - bar: MetaOapg.properties.bar - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["bar"]) -> MetaOapg.properties.bar: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["bar", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["bar"]) -> MetaOapg.properties.bar: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["bar", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - bar: typing.Union[MetaOapg.properties.bar, decimal.Decimal, int, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'AllofWithBaseSchema': - return super().__new__( - cls, - *_args, - bar=bar, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_with_one_empty_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_with_one_empty_schema.py deleted file mode 100644 index 66d64a6d84f..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_with_one_empty_schema.py +++ /dev/null @@ -1,65 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class AllofWithOneEmptySchema( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - all_of_0 = schemas.AnyTypeSchema - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.all_of_0, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'AllofWithOneEmptySchema': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_with_one_empty_schema.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_with_one_empty_schema.pyi deleted file mode 100644 index 66d64a6d84f..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_with_one_empty_schema.pyi +++ /dev/null @@ -1,65 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class AllofWithOneEmptySchema( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - all_of_0 = schemas.AnyTypeSchema - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.all_of_0, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'AllofWithOneEmptySchema': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_with_the_first_empty_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_with_the_first_empty_schema.py deleted file mode 100644 index d4e8af5a1e9..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_with_the_first_empty_schema.py +++ /dev/null @@ -1,67 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class AllofWithTheFirstEmptySchema( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - all_of_0 = schemas.AnyTypeSchema - all_of_1 = schemas.NumberSchema - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.all_of_0, - cls.all_of_1, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'AllofWithTheFirstEmptySchema': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_with_the_first_empty_schema.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_with_the_first_empty_schema.pyi deleted file mode 100644 index d4e8af5a1e9..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_with_the_first_empty_schema.pyi +++ /dev/null @@ -1,67 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class AllofWithTheFirstEmptySchema( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - all_of_0 = schemas.AnyTypeSchema - all_of_1 = schemas.NumberSchema - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.all_of_0, - cls.all_of_1, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'AllofWithTheFirstEmptySchema': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_with_the_last_empty_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_with_the_last_empty_schema.py deleted file mode 100644 index 18a96eca19c..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_with_the_last_empty_schema.py +++ /dev/null @@ -1,67 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class AllofWithTheLastEmptySchema( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - all_of_0 = schemas.NumberSchema - all_of_1 = schemas.AnyTypeSchema - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.all_of_0, - cls.all_of_1, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'AllofWithTheLastEmptySchema': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_with_the_last_empty_schema.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_with_the_last_empty_schema.pyi deleted file mode 100644 index 18a96eca19c..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_with_the_last_empty_schema.pyi +++ /dev/null @@ -1,67 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class AllofWithTheLastEmptySchema( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - all_of_0 = schemas.NumberSchema - all_of_1 = schemas.AnyTypeSchema - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.all_of_0, - cls.all_of_1, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'AllofWithTheLastEmptySchema': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_with_two_empty_schemas.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_with_two_empty_schemas.py deleted file mode 100644 index ba5f5783b2b..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_with_two_empty_schemas.py +++ /dev/null @@ -1,67 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class AllofWithTwoEmptySchemas( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - all_of_0 = schemas.AnyTypeSchema - all_of_1 = schemas.AnyTypeSchema - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.all_of_0, - cls.all_of_1, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'AllofWithTwoEmptySchemas': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_with_two_empty_schemas.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_with_two_empty_schemas.pyi deleted file mode 100644 index ba5f5783b2b..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_with_two_empty_schemas.pyi +++ /dev/null @@ -1,67 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class AllofWithTwoEmptySchemas( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - all_of_0 = schemas.AnyTypeSchema - all_of_1 = schemas.AnyTypeSchema - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.all_of_0, - cls.all_of_1, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'AllofWithTwoEmptySchemas': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/anyof.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/anyof.py deleted file mode 100644 index 3792ff6b586..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/anyof.py +++ /dev/null @@ -1,89 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class Anyof( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - any_of_0 = schemas.IntSchema - - - class any_of_1( - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - inclusive_minimum = 2 - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'any_of_1': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - @classmethod - @functools.lru_cache() - def any_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.any_of_0, - cls.any_of_1, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Anyof': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/anyof.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/anyof.pyi deleted file mode 100644 index 9cc5c73fd2d..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/anyof.pyi +++ /dev/null @@ -1,88 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class Anyof( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - any_of_0 = schemas.IntSchema - - - class any_of_1( - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'any_of_1': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - @classmethod - @functools.lru_cache() - def any_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.any_of_0, - cls.any_of_1, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Anyof': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/anyof_complex_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/anyof_complex_types.py deleted file mode 100644 index 6bf61e0e753..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/anyof_complex_types.py +++ /dev/null @@ -1,177 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class AnyofComplexTypes( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - class any_of_0( - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - required = { - "bar", - } - - class properties: - bar = schemas.IntSchema - __annotations__ = { - "bar": bar, - } - - - bar: MetaOapg.properties.bar - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["bar"]) -> MetaOapg.properties.bar: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["bar", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["bar"]) -> MetaOapg.properties.bar: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["bar", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - bar: typing.Union[MetaOapg.properties.bar, decimal.Decimal, int, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'any_of_0': - return super().__new__( - cls, - *_args, - bar=bar, - _configuration=_configuration, - **kwargs, - ) - - - class any_of_1( - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - required = { - "foo", - } - - class properties: - foo = schemas.StrSchema - __annotations__ = { - "foo": foo, - } - - - foo: MetaOapg.properties.foo - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["foo", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["foo", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - foo: typing.Union[MetaOapg.properties.foo, str, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'any_of_1': - return super().__new__( - cls, - *_args, - foo=foo, - _configuration=_configuration, - **kwargs, - ) - - @classmethod - @functools.lru_cache() - def any_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.any_of_0, - cls.any_of_1, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'AnyofComplexTypes': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/anyof_complex_types.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/anyof_complex_types.pyi deleted file mode 100644 index 6bf61e0e753..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/anyof_complex_types.pyi +++ /dev/null @@ -1,177 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class AnyofComplexTypes( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - class any_of_0( - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - required = { - "bar", - } - - class properties: - bar = schemas.IntSchema - __annotations__ = { - "bar": bar, - } - - - bar: MetaOapg.properties.bar - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["bar"]) -> MetaOapg.properties.bar: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["bar", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["bar"]) -> MetaOapg.properties.bar: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["bar", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - bar: typing.Union[MetaOapg.properties.bar, decimal.Decimal, int, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'any_of_0': - return super().__new__( - cls, - *_args, - bar=bar, - _configuration=_configuration, - **kwargs, - ) - - - class any_of_1( - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - required = { - "foo", - } - - class properties: - foo = schemas.StrSchema - __annotations__ = { - "foo": foo, - } - - - foo: MetaOapg.properties.foo - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["foo", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["foo", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - foo: typing.Union[MetaOapg.properties.foo, str, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'any_of_1': - return super().__new__( - cls, - *_args, - foo=foo, - _configuration=_configuration, - **kwargs, - ) - - @classmethod - @functools.lru_cache() - def any_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.any_of_0, - cls.any_of_1, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'AnyofComplexTypes': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/anyof_with_base_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/anyof_with_base_schema.py deleted file mode 100644 index 281e1fe4df9..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/anyof_with_base_schema.py +++ /dev/null @@ -1,110 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class AnyofWithBaseSchema( - schemas.ComposedBase, - schemas.StrSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - class any_of_0( - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - max_length = 2 - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'any_of_0': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - - class any_of_1( - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - min_length = 4 - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'any_of_1': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - @classmethod - @functools.lru_cache() - def any_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.any_of_0, - cls.any_of_1, - ] - - - def __new__( - cls, - *_args: typing.Union[str, ], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'AnyofWithBaseSchema': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/anyof_with_base_schema.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/anyof_with_base_schema.pyi deleted file mode 100644 index 3f1b667bca7..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/anyof_with_base_schema.pyi +++ /dev/null @@ -1,108 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class AnyofWithBaseSchema( - schemas.ComposedBase, - schemas.StrSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - class any_of_0( - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'any_of_0': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - - class any_of_1( - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'any_of_1': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - @classmethod - @functools.lru_cache() - def any_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.any_of_0, - cls.any_of_1, - ] - - - def __new__( - cls, - *_args: typing.Union[str, ], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'AnyofWithBaseSchema': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/anyof_with_one_empty_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/anyof_with_one_empty_schema.py deleted file mode 100644 index a7c4a89c9d0..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/anyof_with_one_empty_schema.py +++ /dev/null @@ -1,67 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class AnyofWithOneEmptySchema( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - any_of_0 = schemas.NumberSchema - any_of_1 = schemas.AnyTypeSchema - - @classmethod - @functools.lru_cache() - def any_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.any_of_0, - cls.any_of_1, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'AnyofWithOneEmptySchema': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/anyof_with_one_empty_schema.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/anyof_with_one_empty_schema.pyi deleted file mode 100644 index a7c4a89c9d0..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/anyof_with_one_empty_schema.pyi +++ /dev/null @@ -1,67 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class AnyofWithOneEmptySchema( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - any_of_0 = schemas.NumberSchema - any_of_1 = schemas.AnyTypeSchema - - @classmethod - @functools.lru_cache() - def any_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.any_of_0, - cls.any_of_1, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'AnyofWithOneEmptySchema': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/array_type_matches_arrays.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/array_type_matches_arrays.py deleted file mode 100644 index 1d3739deba7..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/array_type_matches_arrays.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class ArrayTypeMatchesArrays( - schemas.ListSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - items = schemas.AnyTypeSchema - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ]], typing.List[typing.Union[MetaOapg.items, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'ArrayTypeMatchesArrays': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/array_type_matches_arrays.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/array_type_matches_arrays.pyi deleted file mode 100644 index 1d3739deba7..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/array_type_matches_arrays.pyi +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class ArrayTypeMatchesArrays( - schemas.ListSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - items = schemas.AnyTypeSchema - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ]], typing.List[typing.Union[MetaOapg.items, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'ArrayTypeMatchesArrays': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/boolean_type_matches_booleans.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/boolean_type_matches_booleans.pyi deleted file mode 100644 index 8e9d55f91a4..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/boolean_type_matches_booleans.pyi +++ /dev/null @@ -1,24 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 -BooleanTypeMatchesBooleans = schemas.BoolSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/by_int.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/by_int.py deleted file mode 100644 index 916ccf4c8fd..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/by_int.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class ByInt( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - multiple_of = 2 - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ByInt': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/by_int.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/by_int.pyi deleted file mode 100644 index 1ade1d20fc6..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/by_int.pyi +++ /dev/null @@ -1,50 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class ByInt( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ByInt': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/by_number.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/by_number.py deleted file mode 100644 index c6c7b904e20..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/by_number.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class ByNumber( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - multiple_of = 1.5 - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ByNumber': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/by_number.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/by_number.pyi deleted file mode 100644 index 5e0068ad3fe..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/by_number.pyi +++ /dev/null @@ -1,50 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class ByNumber( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ByNumber': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/by_small_number.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/by_small_number.py deleted file mode 100644 index 7708e25f2a7..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/by_small_number.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class BySmallNumber( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - multiple_of = 0.00010 - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'BySmallNumber': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/by_small_number.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/by_small_number.pyi deleted file mode 100644 index c7658f0e2e9..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/by_small_number.pyi +++ /dev/null @@ -1,50 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class BySmallNumber( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'BySmallNumber': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/date_time_format.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/date_time_format.py deleted file mode 100644 index 3004856abd5..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/date_time_format.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class DateTimeFormat( - schemas.DateTimeBase, - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - format = 'date-time' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'DateTimeFormat': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/date_time_format.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/date_time_format.pyi deleted file mode 100644 index 3004856abd5..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/date_time_format.pyi +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class DateTimeFormat( - schemas.DateTimeBase, - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - format = 'date-time' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'DateTimeFormat': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/email_format.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/email_format.py deleted file mode 100644 index cd12884a058..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/email_format.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class EmailFormat( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - format = 'email' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'EmailFormat': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/email_format.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/email_format.pyi deleted file mode 100644 index cd12884a058..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/email_format.pyi +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class EmailFormat( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - format = 'email' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'EmailFormat': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/enum_with0_does_not_match_false.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/enum_with0_does_not_match_false.py deleted file mode 100644 index 2f77c5996f4..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/enum_with0_does_not_match_false.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class EnumWith0DoesNotMatchFalse( - schemas.EnumBase, - schemas.NumberSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - enum_value_to_name = { - 0: "POSITIVE_0", - } - - @schemas.classproperty - def POSITIVE_0(cls): - return cls(0) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/enum_with0_does_not_match_false.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/enum_with0_does_not_match_false.pyi deleted file mode 100644 index 337edc4956d..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/enum_with0_does_not_match_false.pyi +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class EnumWith0DoesNotMatchFalse( - schemas.EnumBase, - schemas.NumberSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - @schemas.classproperty - def POSITIVE_0(cls): - return cls(0) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/enum_with1_does_not_match_true.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/enum_with1_does_not_match_true.py deleted file mode 100644 index 2acbb376d63..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/enum_with1_does_not_match_true.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class EnumWith1DoesNotMatchTrue( - schemas.EnumBase, - schemas.NumberSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - enum_value_to_name = { - 1: "POSITIVE_1", - } - - @schemas.classproperty - def POSITIVE_1(cls): - return cls(1) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/enum_with1_does_not_match_true.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/enum_with1_does_not_match_true.pyi deleted file mode 100644 index 8664a7f747f..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/enum_with1_does_not_match_true.pyi +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class EnumWith1DoesNotMatchTrue( - schemas.EnumBase, - schemas.NumberSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - @schemas.classproperty - def POSITIVE_1(cls): - return cls(1) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/enum_with_escaped_characters.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/enum_with_escaped_characters.py deleted file mode 100644 index c8f68c1000d..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/enum_with_escaped_characters.py +++ /dev/null @@ -1,49 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class EnumWithEscapedCharacters( - schemas.EnumBase, - schemas.StrSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - enum_value_to_name = { - "foo\nbar": "FOO_BAR", - "foo\rbar": "FOO_BAR", - } - - @schemas.classproperty - def FOO_BAR(cls): - return cls("foo\nbar") - - @schemas.classproperty - def FOO_BAR(cls): - return cls("foo\rbar") diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/enum_with_escaped_characters.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/enum_with_escaped_characters.pyi deleted file mode 100644 index 6fb1827e441..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/enum_with_escaped_characters.pyi +++ /dev/null @@ -1,42 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class EnumWithEscapedCharacters( - schemas.EnumBase, - schemas.StrSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - @schemas.classproperty - def FOO_BAR(cls): - return cls("foo\nbar") - - @schemas.classproperty - def FOO_BAR(cls): - return cls("foo\rbar") diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/enum_with_false_does_not_match0.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/enum_with_false_does_not_match0.py deleted file mode 100644 index c4992b57a35..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/enum_with_false_does_not_match0.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class EnumWithFalseDoesNotMatch0( - schemas.EnumBase, - schemas.BoolSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - enum_value_to_name = { - schemas.BoolClass.FALSE: "FALSE", - } - - @schemas.classproperty - def FALSE(cls): - return cls(False) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/enum_with_false_does_not_match0.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/enum_with_false_does_not_match0.pyi deleted file mode 100644 index 35ef43076ce..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/enum_with_false_does_not_match0.pyi +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class EnumWithFalseDoesNotMatch0( - schemas.EnumBase, - schemas.BoolSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - @schemas.classproperty - def FALSE(cls): - return cls(False) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/enum_with_true_does_not_match1.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/enum_with_true_does_not_match1.py deleted file mode 100644 index a8e80747103..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/enum_with_true_does_not_match1.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class EnumWithTrueDoesNotMatch1( - schemas.EnumBase, - schemas.BoolSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - enum_value_to_name = { - schemas.BoolClass.TRUE: "TRUE", - } - - @schemas.classproperty - def TRUE(cls): - return cls(True) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/enum_with_true_does_not_match1.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/enum_with_true_does_not_match1.pyi deleted file mode 100644 index f86fc0d2810..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/enum_with_true_does_not_match1.pyi +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class EnumWithTrueDoesNotMatch1( - schemas.EnumBase, - schemas.BoolSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - @schemas.classproperty - def TRUE(cls): - return cls(True) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/enums_in_properties.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/enums_in_properties.py deleted file mode 100644 index 049126041d5..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/enums_in_properties.py +++ /dev/null @@ -1,123 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class EnumsInProperties( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "bar", - } - - class properties: - - - class bar( - schemas.EnumBase, - schemas.StrSchema - ): - - - class MetaOapg: - enum_value_to_name = { - "bar": "BAR", - } - - @schemas.classproperty - def BAR(cls): - return cls("bar") - - - class foo( - schemas.EnumBase, - schemas.StrSchema - ): - - - class MetaOapg: - enum_value_to_name = { - "foo": "FOO", - } - - @schemas.classproperty - def FOO(cls): - return cls("foo") - __annotations__ = { - "bar": bar, - "foo": foo, - } - - bar: MetaOapg.properties.bar - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["bar"]) -> MetaOapg.properties.bar: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["bar", "foo", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["bar"]) -> MetaOapg.properties.bar: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["foo"]) -> typing.Union[MetaOapg.properties.foo, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["bar", "foo", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - bar: typing.Union[MetaOapg.properties.bar, str, ], - foo: typing.Union[MetaOapg.properties.foo, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'EnumsInProperties': - return super().__new__( - cls, - *_args, - bar=bar, - foo=foo, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/enums_in_properties.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/enums_in_properties.pyi deleted file mode 100644 index b6a19141242..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/enums_in_properties.pyi +++ /dev/null @@ -1,111 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class EnumsInProperties( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "bar", - } - - class properties: - - - class bar( - schemas.EnumBase, - schemas.StrSchema - ): - - @schemas.classproperty - def BAR(cls): - return cls("bar") - - - class foo( - schemas.EnumBase, - schemas.StrSchema - ): - - @schemas.classproperty - def FOO(cls): - return cls("foo") - __annotations__ = { - "bar": bar, - "foo": foo, - } - - bar: MetaOapg.properties.bar - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["bar"]) -> MetaOapg.properties.bar: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["bar", "foo", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["bar"]) -> MetaOapg.properties.bar: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["foo"]) -> typing.Union[MetaOapg.properties.foo, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["bar", "foo", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - bar: typing.Union[MetaOapg.properties.bar, str, ], - foo: typing.Union[MetaOapg.properties.foo, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'EnumsInProperties': - return super().__new__( - cls, - *_args, - bar=bar, - foo=foo, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/forbidden_property.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/forbidden_property.py deleted file mode 100644 index 7e30cfceb35..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/forbidden_property.py +++ /dev/null @@ -1,79 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class ForbiddenProperty( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - foo = schemas.NotAnyTypeSchema - __annotations__ = { - "foo": foo, - } - - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["foo", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["foo"]) -> typing.Union[MetaOapg.properties.foo, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["foo", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - foo: typing.Union[MetaOapg.properties.foo, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ForbiddenProperty': - return super().__new__( - cls, - *_args, - foo=foo, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/forbidden_property.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/forbidden_property.pyi deleted file mode 100644 index 7e30cfceb35..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/forbidden_property.pyi +++ /dev/null @@ -1,79 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class ForbiddenProperty( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - foo = schemas.NotAnyTypeSchema - __annotations__ = { - "foo": foo, - } - - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["foo", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["foo"]) -> typing.Union[MetaOapg.properties.foo, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["foo", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - foo: typing.Union[MetaOapg.properties.foo, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ForbiddenProperty': - return super().__new__( - cls, - *_args, - foo=foo, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/hostname_format.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/hostname_format.py deleted file mode 100644 index d63fc48311a..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/hostname_format.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class HostnameFormat( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - format = 'hostname' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'HostnameFormat': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/hostname_format.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/hostname_format.pyi deleted file mode 100644 index d63fc48311a..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/hostname_format.pyi +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class HostnameFormat( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - format = 'hostname' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'HostnameFormat': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/integer_type_matches_integers.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/integer_type_matches_integers.pyi deleted file mode 100644 index ccb986ac466..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/integer_type_matches_integers.pyi +++ /dev/null @@ -1,24 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 -IntegerTypeMatchesIntegers = schemas.IntSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/invalid_instance_should_not_raise_error_when_float_division_inf.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/invalid_instance_should_not_raise_error_when_float_division_inf.py deleted file mode 100644 index 3f5ff42395c..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/invalid_instance_should_not_raise_error_when_float_division_inf.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf( - schemas.IntSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - multiple_of = 0.123456789 diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/invalid_instance_should_not_raise_error_when_float_division_inf.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/invalid_instance_should_not_raise_error_when_float_division_inf.pyi deleted file mode 100644 index 33c88d10402..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/invalid_instance_should_not_raise_error_when_float_division_inf.pyi +++ /dev/null @@ -1,34 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf( - schemas.IntSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/invalid_string_value_for_default.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/invalid_string_value_for_default.py deleted file mode 100644 index badf060b3a1..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/invalid_string_value_for_default.py +++ /dev/null @@ -1,87 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class InvalidStringValueForDefault( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - - - class bar( - schemas.StrSchema - ): - - - class MetaOapg: - min_length = 4 - __annotations__ = { - "bar": bar, - } - - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["bar"]) -> MetaOapg.properties.bar: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["bar", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["bar"]) -> typing.Union[MetaOapg.properties.bar, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["bar", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - bar: typing.Union[MetaOapg.properties.bar, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'InvalidStringValueForDefault': - return super().__new__( - cls, - *_args, - bar=bar, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/invalid_string_value_for_default.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/invalid_string_value_for_default.pyi deleted file mode 100644 index 4ade4dce933..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/invalid_string_value_for_default.pyi +++ /dev/null @@ -1,84 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class InvalidStringValueForDefault( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - - - class bar( - schemas.StrSchema - ): - pass - __annotations__ = { - "bar": bar, - } - - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["bar"]) -> MetaOapg.properties.bar: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["bar", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["bar"]) -> typing.Union[MetaOapg.properties.bar, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["bar", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - bar: typing.Union[MetaOapg.properties.bar, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'InvalidStringValueForDefault': - return super().__new__( - cls, - *_args, - bar=bar, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ipv4_format.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ipv4_format.py deleted file mode 100644 index 89b1ccc1ca3..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ipv4_format.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class Ipv4Format( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - format = 'ipv4' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Ipv4Format': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ipv4_format.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ipv4_format.pyi deleted file mode 100644 index 89b1ccc1ca3..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ipv4_format.pyi +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class Ipv4Format( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - format = 'ipv4' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Ipv4Format': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ipv6_format.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ipv6_format.py deleted file mode 100644 index a33fc23d781..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ipv6_format.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class Ipv6Format( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - format = 'ipv6' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Ipv6Format': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ipv6_format.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ipv6_format.pyi deleted file mode 100644 index a33fc23d781..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ipv6_format.pyi +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class Ipv6Format( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - format = 'ipv6' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Ipv6Format': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/json_pointer_format.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/json_pointer_format.py deleted file mode 100644 index b7f7798cfed..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/json_pointer_format.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class JsonPointerFormat( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - format = 'json-pointer' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'JsonPointerFormat': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/json_pointer_format.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/json_pointer_format.pyi deleted file mode 100644 index b7f7798cfed..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/json_pointer_format.pyi +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class JsonPointerFormat( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - format = 'json-pointer' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'JsonPointerFormat': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/maximum_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/maximum_validation.py deleted file mode 100644 index 2c02065c5ef..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/maximum_validation.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class MaximumValidation( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - inclusive_maximum = 3.0 - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'MaximumValidation': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/maximum_validation.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/maximum_validation.pyi deleted file mode 100644 index fb94c3a96d9..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/maximum_validation.pyi +++ /dev/null @@ -1,50 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class MaximumValidation( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'MaximumValidation': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/maximum_validation_with_unsigned_integer.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/maximum_validation_with_unsigned_integer.py deleted file mode 100644 index e2bd6d9c82f..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/maximum_validation_with_unsigned_integer.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class MaximumValidationWithUnsignedInteger( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - inclusive_maximum = 300 - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'MaximumValidationWithUnsignedInteger': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/maximum_validation_with_unsigned_integer.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/maximum_validation_with_unsigned_integer.pyi deleted file mode 100644 index af52478419e..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/maximum_validation_with_unsigned_integer.pyi +++ /dev/null @@ -1,50 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class MaximumValidationWithUnsignedInteger( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'MaximumValidationWithUnsignedInteger': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/maxitems_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/maxitems_validation.py deleted file mode 100644 index 2c2d2964519..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/maxitems_validation.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class MaxitemsValidation( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - max_items = 2 - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'MaxitemsValidation': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/maxitems_validation.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/maxitems_validation.pyi deleted file mode 100644 index ee591cf4ac5..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/maxitems_validation.pyi +++ /dev/null @@ -1,50 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class MaxitemsValidation( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'MaxitemsValidation': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/maxlength_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/maxlength_validation.py deleted file mode 100644 index 9e8bbff5672..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/maxlength_validation.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class MaxlengthValidation( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - max_length = 2 - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'MaxlengthValidation': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/maxlength_validation.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/maxlength_validation.pyi deleted file mode 100644 index f1d4241ab9d..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/maxlength_validation.pyi +++ /dev/null @@ -1,50 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class MaxlengthValidation( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'MaxlengthValidation': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/maxproperties0_means_the_object_is_empty.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/maxproperties0_means_the_object_is_empty.py deleted file mode 100644 index 78c925c92d1..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/maxproperties0_means_the_object_is_empty.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class Maxproperties0MeansTheObjectIsEmpty( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - max_properties = 0 - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Maxproperties0MeansTheObjectIsEmpty': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/maxproperties0_means_the_object_is_empty.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/maxproperties0_means_the_object_is_empty.pyi deleted file mode 100644 index 2d26e8f679e..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/maxproperties0_means_the_object_is_empty.pyi +++ /dev/null @@ -1,50 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class Maxproperties0MeansTheObjectIsEmpty( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Maxproperties0MeansTheObjectIsEmpty': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/maxproperties_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/maxproperties_validation.py deleted file mode 100644 index 0c29fe0428e..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/maxproperties_validation.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class MaxpropertiesValidation( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - max_properties = 2 - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'MaxpropertiesValidation': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/maxproperties_validation.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/maxproperties_validation.pyi deleted file mode 100644 index 9f60d59043c..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/maxproperties_validation.pyi +++ /dev/null @@ -1,50 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class MaxpropertiesValidation( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'MaxpropertiesValidation': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/minimum_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/minimum_validation.py deleted file mode 100644 index 82c4ace13f5..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/minimum_validation.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class MinimumValidation( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - inclusive_minimum = 1.1 - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'MinimumValidation': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/minimum_validation.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/minimum_validation.pyi deleted file mode 100644 index 9643ac0424c..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/minimum_validation.pyi +++ /dev/null @@ -1,50 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class MinimumValidation( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'MinimumValidation': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/minimum_validation_with_signed_integer.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/minimum_validation_with_signed_integer.py deleted file mode 100644 index 1e4729e9900..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/minimum_validation_with_signed_integer.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class MinimumValidationWithSignedInteger( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - inclusive_minimum = -2 - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'MinimumValidationWithSignedInteger': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/minimum_validation_with_signed_integer.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/minimum_validation_with_signed_integer.pyi deleted file mode 100644 index 298bf570dfd..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/minimum_validation_with_signed_integer.pyi +++ /dev/null @@ -1,50 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class MinimumValidationWithSignedInteger( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'MinimumValidationWithSignedInteger': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/minitems_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/minitems_validation.py deleted file mode 100644 index af50bd074f8..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/minitems_validation.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class MinitemsValidation( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - min_items = 1 - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'MinitemsValidation': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/minitems_validation.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/minitems_validation.pyi deleted file mode 100644 index 23864e2ce96..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/minitems_validation.pyi +++ /dev/null @@ -1,50 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class MinitemsValidation( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'MinitemsValidation': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/minlength_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/minlength_validation.py deleted file mode 100644 index d83ad8cb675..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/minlength_validation.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class MinlengthValidation( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - min_length = 2 - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'MinlengthValidation': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/minlength_validation.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/minlength_validation.pyi deleted file mode 100644 index d69c6fcea9b..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/minlength_validation.pyi +++ /dev/null @@ -1,50 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class MinlengthValidation( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'MinlengthValidation': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/minproperties_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/minproperties_validation.py deleted file mode 100644 index 5e032e7f09a..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/minproperties_validation.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class MinpropertiesValidation( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - min_properties = 1 - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'MinpropertiesValidation': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/minproperties_validation.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/minproperties_validation.pyi deleted file mode 100644 index ff14e068f97..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/minproperties_validation.pyi +++ /dev/null @@ -1,50 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class MinpropertiesValidation( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'MinpropertiesValidation': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/model_not.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/model_not.py deleted file mode 100644 index fb8e10a0293..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/model_not.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class ModelNot( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - not_schema = schemas.IntSchema - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ModelNot': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/model_not.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/model_not.pyi deleted file mode 100644 index fb8e10a0293..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/model_not.pyi +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class ModelNot( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - not_schema = schemas.IntSchema - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ModelNot': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/nested_allof_to_check_validation_semantics.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/nested_allof_to_check_validation_semantics.py deleted file mode 100644 index a948721b22e..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/nested_allof_to_check_validation_semantics.py +++ /dev/null @@ -1,101 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class NestedAllofToCheckValidationSemantics( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - class all_of_0( - schemas.ComposedSchema, - ): - - - class MetaOapg: - all_of_0 = schemas.NoneSchema - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.all_of_0, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'all_of_0': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.all_of_0, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'NestedAllofToCheckValidationSemantics': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/nested_allof_to_check_validation_semantics.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/nested_allof_to_check_validation_semantics.pyi deleted file mode 100644 index a948721b22e..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/nested_allof_to_check_validation_semantics.pyi +++ /dev/null @@ -1,101 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class NestedAllofToCheckValidationSemantics( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - class all_of_0( - schemas.ComposedSchema, - ): - - - class MetaOapg: - all_of_0 = schemas.NoneSchema - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.all_of_0, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'all_of_0': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.all_of_0, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'NestedAllofToCheckValidationSemantics': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/nested_anyof_to_check_validation_semantics.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/nested_anyof_to_check_validation_semantics.py deleted file mode 100644 index 28e998bbd21..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/nested_anyof_to_check_validation_semantics.py +++ /dev/null @@ -1,101 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class NestedAnyofToCheckValidationSemantics( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - class any_of_0( - schemas.ComposedSchema, - ): - - - class MetaOapg: - any_of_0 = schemas.NoneSchema - - @classmethod - @functools.lru_cache() - def any_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.any_of_0, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'any_of_0': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - @classmethod - @functools.lru_cache() - def any_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.any_of_0, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'NestedAnyofToCheckValidationSemantics': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/nested_anyof_to_check_validation_semantics.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/nested_anyof_to_check_validation_semantics.pyi deleted file mode 100644 index 28e998bbd21..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/nested_anyof_to_check_validation_semantics.pyi +++ /dev/null @@ -1,101 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class NestedAnyofToCheckValidationSemantics( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - class any_of_0( - schemas.ComposedSchema, - ): - - - class MetaOapg: - any_of_0 = schemas.NoneSchema - - @classmethod - @functools.lru_cache() - def any_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.any_of_0, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'any_of_0': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - @classmethod - @functools.lru_cache() - def any_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.any_of_0, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'NestedAnyofToCheckValidationSemantics': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/nested_items.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/nested_items.py deleted file mode 100644 index 53008830119..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/nested_items.py +++ /dev/null @@ -1,117 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class NestedItems( - schemas.ListSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - class items( - schemas.ListSchema - ): - - - class MetaOapg: - - - class items( - schemas.ListSchema - ): - - - class MetaOapg: - - - class items( - schemas.ListSchema - ): - - - class MetaOapg: - items = schemas.NumberSchema - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, decimal.Decimal, int, float, ]], typing.List[typing.Union[MetaOapg.items, decimal.Decimal, int, float, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'items': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, list, tuple, ]], typing.List[typing.Union[MetaOapg.items, list, tuple, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'items': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, list, tuple, ]], typing.List[typing.Union[MetaOapg.items, list, tuple, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'items': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, list, tuple, ]], typing.List[typing.Union[MetaOapg.items, list, tuple, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'NestedItems': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/nested_items.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/nested_items.pyi deleted file mode 100644 index 53008830119..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/nested_items.pyi +++ /dev/null @@ -1,117 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class NestedItems( - schemas.ListSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - class items( - schemas.ListSchema - ): - - - class MetaOapg: - - - class items( - schemas.ListSchema - ): - - - class MetaOapg: - - - class items( - schemas.ListSchema - ): - - - class MetaOapg: - items = schemas.NumberSchema - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, decimal.Decimal, int, float, ]], typing.List[typing.Union[MetaOapg.items, decimal.Decimal, int, float, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'items': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, list, tuple, ]], typing.List[typing.Union[MetaOapg.items, list, tuple, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'items': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, list, tuple, ]], typing.List[typing.Union[MetaOapg.items, list, tuple, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'items': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, list, tuple, ]], typing.List[typing.Union[MetaOapg.items, list, tuple, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'NestedItems': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/nested_oneof_to_check_validation_semantics.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/nested_oneof_to_check_validation_semantics.py deleted file mode 100644 index 4e855cfc082..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/nested_oneof_to_check_validation_semantics.py +++ /dev/null @@ -1,101 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class NestedOneofToCheckValidationSemantics( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - class one_of_0( - schemas.ComposedSchema, - ): - - - class MetaOapg: - one_of_0 = schemas.NoneSchema - - @classmethod - @functools.lru_cache() - def one_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.one_of_0, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'one_of_0': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - @classmethod - @functools.lru_cache() - def one_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.one_of_0, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'NestedOneofToCheckValidationSemantics': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/nested_oneof_to_check_validation_semantics.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/nested_oneof_to_check_validation_semantics.pyi deleted file mode 100644 index 4e855cfc082..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/nested_oneof_to_check_validation_semantics.pyi +++ /dev/null @@ -1,101 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class NestedOneofToCheckValidationSemantics( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - class one_of_0( - schemas.ComposedSchema, - ): - - - class MetaOapg: - one_of_0 = schemas.NoneSchema - - @classmethod - @functools.lru_cache() - def one_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.one_of_0, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'one_of_0': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - @classmethod - @functools.lru_cache() - def one_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.one_of_0, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'NestedOneofToCheckValidationSemantics': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/not_more_complex_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/not_more_complex_schema.py deleted file mode 100644 index 111590e7b3d..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/not_more_complex_schema.py +++ /dev/null @@ -1,100 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class NotMoreComplexSchema( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - class not_schema( - schemas.DictSchema - ): - - - class MetaOapg: - - class properties: - foo = schemas.StrSchema - __annotations__ = { - "foo": foo, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["foo", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["foo"]) -> typing.Union[MetaOapg.properties.foo, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["foo", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - foo: typing.Union[MetaOapg.properties.foo, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'not_schema': - return super().__new__( - cls, - *_args, - foo=foo, - _configuration=_configuration, - **kwargs, - ) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'NotMoreComplexSchema': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/not_more_complex_schema.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/not_more_complex_schema.pyi deleted file mode 100644 index 111590e7b3d..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/not_more_complex_schema.pyi +++ /dev/null @@ -1,100 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class NotMoreComplexSchema( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - class not_schema( - schemas.DictSchema - ): - - - class MetaOapg: - - class properties: - foo = schemas.StrSchema - __annotations__ = { - "foo": foo, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["foo", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["foo"]) -> typing.Union[MetaOapg.properties.foo, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["foo", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - foo: typing.Union[MetaOapg.properties.foo, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'not_schema': - return super().__new__( - cls, - *_args, - foo=foo, - _configuration=_configuration, - **kwargs, - ) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'NotMoreComplexSchema': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/nul_characters_in_strings.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/nul_characters_in_strings.py deleted file mode 100644 index 3aa6a9fe9ba..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/nul_characters_in_strings.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class NulCharactersInStrings( - schemas.EnumBase, - schemas.StrSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - enum_value_to_name = { - "hello\x00there": "HELLOTHERE", - } - - @schemas.classproperty - def HELLOTHERE(cls): - return cls("hello\x00there") diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/nul_characters_in_strings.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/nul_characters_in_strings.pyi deleted file mode 100644 index eb9d42800cf..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/nul_characters_in_strings.pyi +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class NulCharactersInStrings( - schemas.EnumBase, - schemas.StrSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - @schemas.classproperty - def HELLOTHERE(cls): - return cls("hello\x00there") diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/null_type_matches_only_the_null_object.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/null_type_matches_only_the_null_object.pyi deleted file mode 100644 index 4b1bff62a13..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/null_type_matches_only_the_null_object.pyi +++ /dev/null @@ -1,24 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 -NullTypeMatchesOnlyTheNullObject = schemas.NoneSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/number_type_matches_numbers.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/number_type_matches_numbers.pyi deleted file mode 100644 index e4d1d79b975..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/number_type_matches_numbers.pyi +++ /dev/null @@ -1,24 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 -NumberTypeMatchesNumbers = schemas.NumberSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/object_properties_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/object_properties_validation.py deleted file mode 100644 index d5e7c6cf931..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/object_properties_validation.py +++ /dev/null @@ -1,89 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class ObjectPropertiesValidation( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - foo = schemas.IntSchema - bar = schemas.StrSchema - __annotations__ = { - "foo": foo, - "bar": bar, - } - - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["bar"]) -> MetaOapg.properties.bar: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["foo", "bar", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["foo"]) -> typing.Union[MetaOapg.properties.foo, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["bar"]) -> typing.Union[MetaOapg.properties.bar, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["foo", "bar", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - foo: typing.Union[MetaOapg.properties.foo, decimal.Decimal, int, schemas.Unset] = schemas.unset, - bar: typing.Union[MetaOapg.properties.bar, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ObjectPropertiesValidation': - return super().__new__( - cls, - *_args, - foo=foo, - bar=bar, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/object_properties_validation.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/object_properties_validation.pyi deleted file mode 100644 index d5e7c6cf931..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/object_properties_validation.pyi +++ /dev/null @@ -1,89 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class ObjectPropertiesValidation( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - foo = schemas.IntSchema - bar = schemas.StrSchema - __annotations__ = { - "foo": foo, - "bar": bar, - } - - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["bar"]) -> MetaOapg.properties.bar: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["foo", "bar", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["foo"]) -> typing.Union[MetaOapg.properties.foo, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["bar"]) -> typing.Union[MetaOapg.properties.bar, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["foo", "bar", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - foo: typing.Union[MetaOapg.properties.foo, decimal.Decimal, int, schemas.Unset] = schemas.unset, - bar: typing.Union[MetaOapg.properties.bar, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ObjectPropertiesValidation': - return super().__new__( - cls, - *_args, - foo=foo, - bar=bar, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/oneof.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/oneof.py deleted file mode 100644 index 3b54b5a2ecc..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/oneof.py +++ /dev/null @@ -1,89 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class Oneof( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - one_of_0 = schemas.IntSchema - - - class one_of_1( - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - inclusive_minimum = 2 - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'one_of_1': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - @classmethod - @functools.lru_cache() - def one_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.one_of_0, - cls.one_of_1, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Oneof': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/oneof.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/oneof.pyi deleted file mode 100644 index f896a11c67e..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/oneof.pyi +++ /dev/null @@ -1,88 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class Oneof( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - one_of_0 = schemas.IntSchema - - - class one_of_1( - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'one_of_1': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - @classmethod - @functools.lru_cache() - def one_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.one_of_0, - cls.one_of_1, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Oneof': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/oneof_complex_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/oneof_complex_types.py deleted file mode 100644 index 3867b8e3d03..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/oneof_complex_types.py +++ /dev/null @@ -1,177 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class OneofComplexTypes( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - class one_of_0( - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - required = { - "bar", - } - - class properties: - bar = schemas.IntSchema - __annotations__ = { - "bar": bar, - } - - - bar: MetaOapg.properties.bar - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["bar"]) -> MetaOapg.properties.bar: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["bar", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["bar"]) -> MetaOapg.properties.bar: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["bar", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - bar: typing.Union[MetaOapg.properties.bar, decimal.Decimal, int, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'one_of_0': - return super().__new__( - cls, - *_args, - bar=bar, - _configuration=_configuration, - **kwargs, - ) - - - class one_of_1( - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - required = { - "foo", - } - - class properties: - foo = schemas.StrSchema - __annotations__ = { - "foo": foo, - } - - - foo: MetaOapg.properties.foo - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["foo", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["foo", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - foo: typing.Union[MetaOapg.properties.foo, str, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'one_of_1': - return super().__new__( - cls, - *_args, - foo=foo, - _configuration=_configuration, - **kwargs, - ) - - @classmethod - @functools.lru_cache() - def one_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.one_of_0, - cls.one_of_1, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'OneofComplexTypes': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/oneof_complex_types.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/oneof_complex_types.pyi deleted file mode 100644 index 3867b8e3d03..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/oneof_complex_types.pyi +++ /dev/null @@ -1,177 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class OneofComplexTypes( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - class one_of_0( - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - required = { - "bar", - } - - class properties: - bar = schemas.IntSchema - __annotations__ = { - "bar": bar, - } - - - bar: MetaOapg.properties.bar - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["bar"]) -> MetaOapg.properties.bar: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["bar", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["bar"]) -> MetaOapg.properties.bar: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["bar", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - bar: typing.Union[MetaOapg.properties.bar, decimal.Decimal, int, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'one_of_0': - return super().__new__( - cls, - *_args, - bar=bar, - _configuration=_configuration, - **kwargs, - ) - - - class one_of_1( - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - required = { - "foo", - } - - class properties: - foo = schemas.StrSchema - __annotations__ = { - "foo": foo, - } - - - foo: MetaOapg.properties.foo - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["foo", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["foo", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - foo: typing.Union[MetaOapg.properties.foo, str, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'one_of_1': - return super().__new__( - cls, - *_args, - foo=foo, - _configuration=_configuration, - **kwargs, - ) - - @classmethod - @functools.lru_cache() - def one_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.one_of_0, - cls.one_of_1, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'OneofComplexTypes': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/oneof_with_base_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/oneof_with_base_schema.py deleted file mode 100644 index bc743b52219..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/oneof_with_base_schema.py +++ /dev/null @@ -1,110 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class OneofWithBaseSchema( - schemas.ComposedBase, - schemas.StrSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - class one_of_0( - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - min_length = 2 - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'one_of_0': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - - class one_of_1( - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - max_length = 4 - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'one_of_1': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - @classmethod - @functools.lru_cache() - def one_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.one_of_0, - cls.one_of_1, - ] - - - def __new__( - cls, - *_args: typing.Union[str, ], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'OneofWithBaseSchema': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/oneof_with_base_schema.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/oneof_with_base_schema.pyi deleted file mode 100644 index 4d521f17ab4..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/oneof_with_base_schema.pyi +++ /dev/null @@ -1,108 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class OneofWithBaseSchema( - schemas.ComposedBase, - schemas.StrSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - class one_of_0( - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'one_of_0': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - - class one_of_1( - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'one_of_1': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - @classmethod - @functools.lru_cache() - def one_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.one_of_0, - cls.one_of_1, - ] - - - def __new__( - cls, - *_args: typing.Union[str, ], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'OneofWithBaseSchema': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/oneof_with_empty_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/oneof_with_empty_schema.py deleted file mode 100644 index 6c106531e09..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/oneof_with_empty_schema.py +++ /dev/null @@ -1,67 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class OneofWithEmptySchema( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - one_of_0 = schemas.NumberSchema - one_of_1 = schemas.AnyTypeSchema - - @classmethod - @functools.lru_cache() - def one_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.one_of_0, - cls.one_of_1, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'OneofWithEmptySchema': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/oneof_with_empty_schema.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/oneof_with_empty_schema.pyi deleted file mode 100644 index 6c106531e09..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/oneof_with_empty_schema.pyi +++ /dev/null @@ -1,67 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class OneofWithEmptySchema( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - one_of_0 = schemas.NumberSchema - one_of_1 = schemas.AnyTypeSchema - - @classmethod - @functools.lru_cache() - def one_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.one_of_0, - cls.one_of_1, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'OneofWithEmptySchema': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/oneof_with_required.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/oneof_with_required.py deleted file mode 100644 index 65e3c48bd59..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/oneof_with_required.py +++ /dev/null @@ -1,124 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class OneofWithRequired( - schemas.ComposedBase, - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - class one_of_0( - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - required = { - "bar", - "foo", - } - - - bar: schemas.AnyTypeSchema - foo: schemas.AnyTypeSchema - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'one_of_0': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - - class one_of_1( - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - required = { - "foo", - "baz", - } - - - foo: schemas.AnyTypeSchema - baz: schemas.AnyTypeSchema - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'one_of_1': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - @classmethod - @functools.lru_cache() - def one_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.one_of_0, - cls.one_of_1, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'OneofWithRequired': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/oneof_with_required.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/oneof_with_required.pyi deleted file mode 100644 index 65e3c48bd59..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/oneof_with_required.pyi +++ /dev/null @@ -1,124 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class OneofWithRequired( - schemas.ComposedBase, - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - class one_of_0( - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - required = { - "bar", - "foo", - } - - - bar: schemas.AnyTypeSchema - foo: schemas.AnyTypeSchema - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'one_of_0': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - - class one_of_1( - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - required = { - "foo", - "baz", - } - - - foo: schemas.AnyTypeSchema - baz: schemas.AnyTypeSchema - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'one_of_1': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - @classmethod - @functools.lru_cache() - def one_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.one_of_0, - cls.one_of_1, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'OneofWithRequired': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/pattern_is_not_anchored.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/pattern_is_not_anchored.py deleted file mode 100644 index c28ee2c4e94..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/pattern_is_not_anchored.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class PatternIsNotAnchored( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - regex=[{ - 'pattern': r'a+', # noqa: E501 - }] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'PatternIsNotAnchored': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/pattern_is_not_anchored.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/pattern_is_not_anchored.pyi deleted file mode 100644 index 23cf254031e..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/pattern_is_not_anchored.pyi +++ /dev/null @@ -1,50 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class PatternIsNotAnchored( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'PatternIsNotAnchored': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/pattern_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/pattern_validation.py deleted file mode 100644 index 6c35cf6a752..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/pattern_validation.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class PatternValidation( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - regex=[{ - 'pattern': r'^a*$', # noqa: E501 - }] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'PatternValidation': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/pattern_validation.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/pattern_validation.pyi deleted file mode 100644 index c0b53bd013d..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/pattern_validation.pyi +++ /dev/null @@ -1,50 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class PatternValidation( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'PatternValidation': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/properties_with_escaped_characters.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/properties_with_escaped_characters.py deleted file mode 100644 index cac2e048c9c..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/properties_with_escaped_characters.py +++ /dev/null @@ -1,117 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class PropertiesWithEscapedCharacters( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - foo_nbar = schemas.NumberSchema - foo_bar = schemas.NumberSchema - foo__bar = schemas.NumberSchema - foo_rbar = schemas.NumberSchema - foo_tbar = schemas.NumberSchema - foo_fbar = schemas.NumberSchema - __annotations__ = { - "foo\nbar": foo_nbar, - "foo\"bar": foo_bar, - "foo\\bar": foo__bar, - "foo\rbar": foo_rbar, - "foo\tbar": foo_tbar, - "foo\fbar": foo_fbar, - } - - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["foo\nbar"]) -> MetaOapg.properties.foo_nbar: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["foo\"bar"]) -> MetaOapg.properties.foo_bar: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["foo\\bar"]) -> MetaOapg.properties.foo__bar: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["foo\rbar"]) -> MetaOapg.properties.foo_rbar: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["foo\tbar"]) -> MetaOapg.properties.foo_tbar: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["foo\fbar"]) -> MetaOapg.properties.foo_fbar: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["foo\nbar", "foo\"bar", "foo\\bar", "foo\rbar", "foo\tbar", "foo\fbar", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["foo\nbar"]) -> typing.Union[MetaOapg.properties.foo_nbar, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["foo\"bar"]) -> typing.Union[MetaOapg.properties.foo_bar, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["foo\\bar"]) -> typing.Union[MetaOapg.properties.foo__bar, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["foo\rbar"]) -> typing.Union[MetaOapg.properties.foo_rbar, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["foo\tbar"]) -> typing.Union[MetaOapg.properties.foo_tbar, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["foo\fbar"]) -> typing.Union[MetaOapg.properties.foo_fbar, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["foo\nbar", "foo\"bar", "foo\\bar", "foo\rbar", "foo\tbar", "foo\fbar", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'PropertiesWithEscapedCharacters': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/properties_with_escaped_characters.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/properties_with_escaped_characters.pyi deleted file mode 100644 index cac2e048c9c..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/properties_with_escaped_characters.pyi +++ /dev/null @@ -1,117 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class PropertiesWithEscapedCharacters( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - foo_nbar = schemas.NumberSchema - foo_bar = schemas.NumberSchema - foo__bar = schemas.NumberSchema - foo_rbar = schemas.NumberSchema - foo_tbar = schemas.NumberSchema - foo_fbar = schemas.NumberSchema - __annotations__ = { - "foo\nbar": foo_nbar, - "foo\"bar": foo_bar, - "foo\\bar": foo__bar, - "foo\rbar": foo_rbar, - "foo\tbar": foo_tbar, - "foo\fbar": foo_fbar, - } - - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["foo\nbar"]) -> MetaOapg.properties.foo_nbar: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["foo\"bar"]) -> MetaOapg.properties.foo_bar: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["foo\\bar"]) -> MetaOapg.properties.foo__bar: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["foo\rbar"]) -> MetaOapg.properties.foo_rbar: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["foo\tbar"]) -> MetaOapg.properties.foo_tbar: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["foo\fbar"]) -> MetaOapg.properties.foo_fbar: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["foo\nbar", "foo\"bar", "foo\\bar", "foo\rbar", "foo\tbar", "foo\fbar", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["foo\nbar"]) -> typing.Union[MetaOapg.properties.foo_nbar, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["foo\"bar"]) -> typing.Union[MetaOapg.properties.foo_bar, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["foo\\bar"]) -> typing.Union[MetaOapg.properties.foo__bar, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["foo\rbar"]) -> typing.Union[MetaOapg.properties.foo_rbar, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["foo\tbar"]) -> typing.Union[MetaOapg.properties.foo_tbar, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["foo\fbar"]) -> typing.Union[MetaOapg.properties.foo_fbar, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["foo\nbar", "foo\"bar", "foo\\bar", "foo\rbar", "foo\tbar", "foo\fbar", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'PropertiesWithEscapedCharacters': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/property_named_ref_that_is_not_a_reference.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/property_named_ref_that_is_not_a_reference.py deleted file mode 100644 index 45e0df45067..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/property_named_ref_that_is_not_a_reference.py +++ /dev/null @@ -1,77 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class PropertyNamedRefThatIsNotAReference( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - ref = schemas.StrSchema - __annotations__ = { - "$ref": ref, - } - - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["$ref"]) -> MetaOapg.properties.ref: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["$ref", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["$ref"]) -> typing.Union[MetaOapg.properties.ref, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["$ref", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'PropertyNamedRefThatIsNotAReference': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/property_named_ref_that_is_not_a_reference.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/property_named_ref_that_is_not_a_reference.pyi deleted file mode 100644 index 45e0df45067..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/property_named_ref_that_is_not_a_reference.pyi +++ /dev/null @@ -1,77 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class PropertyNamedRefThatIsNotAReference( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - ref = schemas.StrSchema - __annotations__ = { - "$ref": ref, - } - - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["$ref"]) -> MetaOapg.properties.ref: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["$ref", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["$ref"]) -> typing.Union[MetaOapg.properties.ref, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["$ref", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'PropertyNamedRefThatIsNotAReference': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_additionalproperties.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_additionalproperties.py deleted file mode 100644 index 5ae9aeffff8..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_additionalproperties.py +++ /dev/null @@ -1,62 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class RefInAdditionalproperties( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - @staticmethod - def additional_properties() -> typing.Type['PropertyNamedRefThatIsNotAReference']: - return PropertyNamedRefThatIsNotAReference - - def __getitem__(self, name: typing.Union[str, ]) -> 'PropertyNamedRefThatIsNotAReference': - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> 'PropertyNamedRefThatIsNotAReference': - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: 'PropertyNamedRefThatIsNotAReference', - ) -> 'RefInAdditionalproperties': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - -from unit_test_api.model.property_named_ref_that_is_not_a_reference import PropertyNamedRefThatIsNotAReference diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_additionalproperties.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_additionalproperties.pyi deleted file mode 100644 index 5ae9aeffff8..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_additionalproperties.pyi +++ /dev/null @@ -1,62 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class RefInAdditionalproperties( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - @staticmethod - def additional_properties() -> typing.Type['PropertyNamedRefThatIsNotAReference']: - return PropertyNamedRefThatIsNotAReference - - def __getitem__(self, name: typing.Union[str, ]) -> 'PropertyNamedRefThatIsNotAReference': - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> 'PropertyNamedRefThatIsNotAReference': - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: 'PropertyNamedRefThatIsNotAReference', - ) -> 'RefInAdditionalproperties': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - -from unit_test_api.model.property_named_ref_that_is_not_a_reference import PropertyNamedRefThatIsNotAReference diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_allof.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_allof.py deleted file mode 100644 index 0fad528f4dd..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_allof.py +++ /dev/null @@ -1,66 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class RefInAllof( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - PropertyNamedRefThatIsNotAReference, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'RefInAllof': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - -from unit_test_api.model.property_named_ref_that_is_not_a_reference import PropertyNamedRefThatIsNotAReference diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_allof.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_allof.pyi deleted file mode 100644 index 0fad528f4dd..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_allof.pyi +++ /dev/null @@ -1,66 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class RefInAllof( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - PropertyNamedRefThatIsNotAReference, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'RefInAllof': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - -from unit_test_api.model.property_named_ref_that_is_not_a_reference import PropertyNamedRefThatIsNotAReference diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_anyof.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_anyof.py deleted file mode 100644 index f7ce71a11af..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_anyof.py +++ /dev/null @@ -1,66 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class RefInAnyof( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - @classmethod - @functools.lru_cache() - def any_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - PropertyNamedRefThatIsNotAReference, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'RefInAnyof': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - -from unit_test_api.model.property_named_ref_that_is_not_a_reference import PropertyNamedRefThatIsNotAReference diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_anyof.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_anyof.pyi deleted file mode 100644 index f7ce71a11af..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_anyof.pyi +++ /dev/null @@ -1,66 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class RefInAnyof( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - @classmethod - @functools.lru_cache() - def any_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - PropertyNamedRefThatIsNotAReference, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'RefInAnyof': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - -from unit_test_api.model.property_named_ref_that_is_not_a_reference import PropertyNamedRefThatIsNotAReference diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_items.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_items.py deleted file mode 100644 index 664bc90905b..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_items.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class RefInItems( - schemas.ListSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - @staticmethod - def items() -> typing.Type['PropertyNamedRefThatIsNotAReference']: - return PropertyNamedRefThatIsNotAReference - - def __new__( - cls, - _arg: typing.Union[typing.Tuple['PropertyNamedRefThatIsNotAReference'], typing.List['PropertyNamedRefThatIsNotAReference']], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'RefInItems': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> 'PropertyNamedRefThatIsNotAReference': - return super().__getitem__(i) - -from unit_test_api.model.property_named_ref_that_is_not_a_reference import PropertyNamedRefThatIsNotAReference diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_items.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_items.pyi deleted file mode 100644 index 664bc90905b..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_items.pyi +++ /dev/null @@ -1,56 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class RefInItems( - schemas.ListSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - @staticmethod - def items() -> typing.Type['PropertyNamedRefThatIsNotAReference']: - return PropertyNamedRefThatIsNotAReference - - def __new__( - cls, - _arg: typing.Union[typing.Tuple['PropertyNamedRefThatIsNotAReference'], typing.List['PropertyNamedRefThatIsNotAReference']], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'RefInItems': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> 'PropertyNamedRefThatIsNotAReference': - return super().__getitem__(i) - -from unit_test_api.model.property_named_ref_that_is_not_a_reference import PropertyNamedRefThatIsNotAReference diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_not.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_not.py deleted file mode 100644 index b8c574e16b8..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_not.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class RefInNot( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - @staticmethod - def not_schema() -> typing.Type['PropertyNamedRefThatIsNotAReference']: - return PropertyNamedRefThatIsNotAReference - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'RefInNot': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - -from unit_test_api.model.property_named_ref_that_is_not_a_reference import PropertyNamedRefThatIsNotAReference diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_not.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_not.pyi deleted file mode 100644 index b8c574e16b8..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_not.pyi +++ /dev/null @@ -1,56 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class RefInNot( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - @staticmethod - def not_schema() -> typing.Type['PropertyNamedRefThatIsNotAReference']: - return PropertyNamedRefThatIsNotAReference - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'RefInNot': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - -from unit_test_api.model.property_named_ref_that_is_not_a_reference import PropertyNamedRefThatIsNotAReference diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_oneof.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_oneof.py deleted file mode 100644 index 9c76a655bb0..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_oneof.py +++ /dev/null @@ -1,66 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class RefInOneof( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - @classmethod - @functools.lru_cache() - def one_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - PropertyNamedRefThatIsNotAReference, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'RefInOneof': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - -from unit_test_api.model.property_named_ref_that_is_not_a_reference import PropertyNamedRefThatIsNotAReference diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_oneof.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_oneof.pyi deleted file mode 100644 index 9c76a655bb0..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_oneof.pyi +++ /dev/null @@ -1,66 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class RefInOneof( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - @classmethod - @functools.lru_cache() - def one_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - PropertyNamedRefThatIsNotAReference, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'RefInOneof': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - -from unit_test_api.model.property_named_ref_that_is_not_a_reference import PropertyNamedRefThatIsNotAReference diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_property.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_property.py deleted file mode 100644 index 13f303fa140..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_property.py +++ /dev/null @@ -1,84 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class RefInProperty( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - - @staticmethod - def a() -> typing.Type['PropertyNamedRefThatIsNotAReference']: - return PropertyNamedRefThatIsNotAReference - __annotations__ = { - "a": a, - } - - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["a"]) -> 'PropertyNamedRefThatIsNotAReference': ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["a", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["a"]) -> typing.Union['PropertyNamedRefThatIsNotAReference', schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["a", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - a: typing.Union['PropertyNamedRefThatIsNotAReference', schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'RefInProperty': - return super().__new__( - cls, - *_args, - a=a, - _configuration=_configuration, - **kwargs, - ) - -from unit_test_api.model.property_named_ref_that_is_not_a_reference import PropertyNamedRefThatIsNotAReference diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_property.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_property.pyi deleted file mode 100644 index 13f303fa140..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_property.pyi +++ /dev/null @@ -1,84 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class RefInProperty( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - - @staticmethod - def a() -> typing.Type['PropertyNamedRefThatIsNotAReference']: - return PropertyNamedRefThatIsNotAReference - __annotations__ = { - "a": a, - } - - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["a"]) -> 'PropertyNamedRefThatIsNotAReference': ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["a", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["a"]) -> typing.Union['PropertyNamedRefThatIsNotAReference', schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["a", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - a: typing.Union['PropertyNamedRefThatIsNotAReference', schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'RefInProperty': - return super().__new__( - cls, - *_args, - a=a, - _configuration=_configuration, - **kwargs, - ) - -from unit_test_api.model.property_named_ref_that_is_not_a_reference import PropertyNamedRefThatIsNotAReference diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/required_default_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/required_default_validation.py deleted file mode 100644 index e1e2bfdd424..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/required_default_validation.py +++ /dev/null @@ -1,79 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class RequiredDefaultValidation( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - foo = schemas.AnyTypeSchema - __annotations__ = { - "foo": foo, - } - - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["foo", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["foo"]) -> typing.Union[MetaOapg.properties.foo, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["foo", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - foo: typing.Union[MetaOapg.properties.foo, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'RequiredDefaultValidation': - return super().__new__( - cls, - *_args, - foo=foo, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/required_default_validation.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/required_default_validation.pyi deleted file mode 100644 index e1e2bfdd424..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/required_default_validation.pyi +++ /dev/null @@ -1,79 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class RequiredDefaultValidation( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - foo = schemas.AnyTypeSchema - __annotations__ = { - "foo": foo, - } - - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["foo", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["foo"]) -> typing.Union[MetaOapg.properties.foo, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["foo", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - foo: typing.Union[MetaOapg.properties.foo, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'RequiredDefaultValidation': - return super().__new__( - cls, - *_args, - foo=foo, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/required_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/required_validation.py deleted file mode 100644 index b1905083110..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/required_validation.py +++ /dev/null @@ -1,94 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class RequiredValidation( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "foo", - } - - class properties: - foo = schemas.AnyTypeSchema - bar = schemas.AnyTypeSchema - __annotations__ = { - "foo": foo, - "bar": bar, - } - - - foo: MetaOapg.properties.foo - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["bar"]) -> MetaOapg.properties.bar: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["foo", "bar", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["bar"]) -> typing.Union[MetaOapg.properties.bar, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["foo", "bar", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - foo: typing.Union[MetaOapg.properties.foo, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - bar: typing.Union[MetaOapg.properties.bar, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'RequiredValidation': - return super().__new__( - cls, - *_args, - foo=foo, - bar=bar, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/required_validation.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/required_validation.pyi deleted file mode 100644 index b1905083110..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/required_validation.pyi +++ /dev/null @@ -1,94 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class RequiredValidation( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "foo", - } - - class properties: - foo = schemas.AnyTypeSchema - bar = schemas.AnyTypeSchema - __annotations__ = { - "foo": foo, - "bar": bar, - } - - - foo: MetaOapg.properties.foo - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["bar"]) -> MetaOapg.properties.bar: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["foo", "bar", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["bar"]) -> typing.Union[MetaOapg.properties.bar, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["foo", "bar", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - foo: typing.Union[MetaOapg.properties.foo, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - bar: typing.Union[MetaOapg.properties.bar, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'RequiredValidation': - return super().__new__( - cls, - *_args, - foo=foo, - bar=bar, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/required_with_empty_array.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/required_with_empty_array.py deleted file mode 100644 index d91c0e7cf2f..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/required_with_empty_array.py +++ /dev/null @@ -1,79 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class RequiredWithEmptyArray( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - foo = schemas.AnyTypeSchema - __annotations__ = { - "foo": foo, - } - - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["foo", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["foo"]) -> typing.Union[MetaOapg.properties.foo, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["foo", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - foo: typing.Union[MetaOapg.properties.foo, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'RequiredWithEmptyArray': - return super().__new__( - cls, - *_args, - foo=foo, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/required_with_empty_array.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/required_with_empty_array.pyi deleted file mode 100644 index d91c0e7cf2f..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/required_with_empty_array.pyi +++ /dev/null @@ -1,79 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class RequiredWithEmptyArray( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - foo = schemas.AnyTypeSchema - __annotations__ = { - "foo": foo, - } - - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["foo", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["foo"]) -> typing.Union[MetaOapg.properties.foo, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["foo", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - foo: typing.Union[MetaOapg.properties.foo, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'RequiredWithEmptyArray': - return super().__new__( - cls, - *_args, - foo=foo, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/required_with_escaped_characters.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/required_with_escaped_characters.py deleted file mode 100644 index a482d65db3c..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/required_with_escaped_characters.py +++ /dev/null @@ -1,59 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class RequiredWithEscapedCharacters( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "foo\"bar", - "foo\nbar", - "foo\fbar", - "foo\tbar", - "foo\rbar", - "foo\\bar", - } - - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'RequiredWithEscapedCharacters': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/required_with_escaped_characters.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/required_with_escaped_characters.pyi deleted file mode 100644 index a482d65db3c..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/required_with_escaped_characters.pyi +++ /dev/null @@ -1,59 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class RequiredWithEscapedCharacters( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "foo\"bar", - "foo\nbar", - "foo\fbar", - "foo\tbar", - "foo\rbar", - "foo\\bar", - } - - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'RequiredWithEscapedCharacters': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/simple_enum_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/simple_enum_validation.py deleted file mode 100644 index 26641b8c99f..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/simple_enum_validation.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class SimpleEnumValidation( - schemas.EnumBase, - schemas.NumberSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - enum_value_to_name = { - 1: "POSITIVE_1", - 2: "POSITIVE_2", - 3: "POSITIVE_3", - } - - @schemas.classproperty - def POSITIVE_1(cls): - return cls(1) - - @schemas.classproperty - def POSITIVE_2(cls): - return cls(2) - - @schemas.classproperty - def POSITIVE_3(cls): - return cls(3) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/simple_enum_validation.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/simple_enum_validation.pyi deleted file mode 100644 index 61ed175912c..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/simple_enum_validation.pyi +++ /dev/null @@ -1,46 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class SimpleEnumValidation( - schemas.EnumBase, - schemas.NumberSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - @schemas.classproperty - def POSITIVE_1(cls): - return cls(1) - - @schemas.classproperty - def POSITIVE_2(cls): - return cls(2) - - @schemas.classproperty - def POSITIVE_3(cls): - return cls(3) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/string_type_matches_strings.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/string_type_matches_strings.pyi deleted file mode 100644 index 573e83bc999..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/string_type_matches_strings.pyi +++ /dev/null @@ -1,24 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 -StringTypeMatchesStrings = schemas.StrSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/the_default_keyword_does_not_do_anything_if_the_property_is_missing.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/the_default_keyword_does_not_do_anything_if_the_property_is_missing.py deleted file mode 100644 index 4033b5a2e5d..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/the_default_keyword_does_not_do_anything_if_the_property_is_missing.py +++ /dev/null @@ -1,86 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - - - class alpha( - schemas.NumberSchema - ): - - - class MetaOapg: - inclusive_maximum = 3 - __annotations__ = { - "alpha": alpha, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["alpha"]) -> MetaOapg.properties.alpha: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["alpha", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["alpha"]) -> typing.Union[MetaOapg.properties.alpha, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["alpha", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - alpha: typing.Union[MetaOapg.properties.alpha, decimal.Decimal, int, float, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing': - return super().__new__( - cls, - *_args, - alpha=alpha, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/the_default_keyword_does_not_do_anything_if_the_property_is_missing.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/the_default_keyword_does_not_do_anything_if_the_property_is_missing.pyi deleted file mode 100644 index 4deb08abe2a..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/the_default_keyword_does_not_do_anything_if_the_property_is_missing.pyi +++ /dev/null @@ -1,83 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - - - class alpha( - schemas.NumberSchema - ): - pass - __annotations__ = { - "alpha": alpha, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["alpha"]) -> MetaOapg.properties.alpha: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["alpha", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["alpha"]) -> typing.Union[MetaOapg.properties.alpha, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["alpha", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - alpha: typing.Union[MetaOapg.properties.alpha, decimal.Decimal, int, float, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing': - return super().__new__( - cls, - *_args, - alpha=alpha, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/uniqueitems_false_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/uniqueitems_false_validation.py deleted file mode 100644 index 9a1260048ba..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/uniqueitems_false_validation.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class UniqueitemsFalseValidation( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - unique_items = False - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'UniqueitemsFalseValidation': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/uniqueitems_false_validation.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/uniqueitems_false_validation.pyi deleted file mode 100644 index e1854bc77e7..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/uniqueitems_false_validation.pyi +++ /dev/null @@ -1,50 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class UniqueitemsFalseValidation( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'UniqueitemsFalseValidation': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/uniqueitems_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/uniqueitems_validation.py deleted file mode 100644 index 33f292d4ea3..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/uniqueitems_validation.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class UniqueitemsValidation( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - unique_items = True - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'UniqueitemsValidation': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/uniqueitems_validation.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/uniqueitems_validation.pyi deleted file mode 100644 index c23e7c8a006..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/uniqueitems_validation.pyi +++ /dev/null @@ -1,50 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class UniqueitemsValidation( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'UniqueitemsValidation': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/uri_format.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/uri_format.py deleted file mode 100644 index 7ade387ae23..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/uri_format.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class UriFormat( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - format = 'uri' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'UriFormat': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/uri_format.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/uri_format.pyi deleted file mode 100644 index 7ade387ae23..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/uri_format.pyi +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class UriFormat( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - format = 'uri' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'UriFormat': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/uri_reference_format.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/uri_reference_format.py deleted file mode 100644 index 5fc3716e2db..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/uri_reference_format.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class UriReferenceFormat( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - format = 'uri-reference' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'UriReferenceFormat': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/uri_reference_format.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/uri_reference_format.pyi deleted file mode 100644 index 5fc3716e2db..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/uri_reference_format.pyi +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class UriReferenceFormat( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - format = 'uri-reference' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'UriReferenceFormat': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/uri_template_format.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/uri_template_format.py deleted file mode 100644 index fa7bdb515fd..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/uri_template_format.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class UriTemplateFormat( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - format = 'uri-template' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'UriTemplateFormat': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/uri_template_format.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/uri_template_format.pyi deleted file mode 100644 index fa7bdb515fd..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/uri_template_format.pyi +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - -class UriTemplateFormat( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - format = 'uri-template' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'UriTemplateFormat': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/models/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/models/__init__.py deleted file mode 100644 index 3dd512a4cd2..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/models/__init__.py +++ /dev/null @@ -1,99 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -# import all models into this package -# if you have many models here with many references from one model to another this may -# raise a RecursionError -# to avoid this, import only the models that you directly need like: -# from from unit_test_api.model.pet import Pet -# or import this package, but before doing it, use: -# import sys -# sys.setrecursionlimit(n) - -from unit_test_api.model.additionalproperties_allows_a_schema_which_should_validate import AdditionalpropertiesAllowsASchemaWhichShouldValidate -from unit_test_api.model.additionalproperties_are_allowed_by_default import AdditionalpropertiesAreAllowedByDefault -from unit_test_api.model.additionalproperties_can_exist_by_itself import AdditionalpropertiesCanExistByItself -from unit_test_api.model.additionalproperties_should_not_look_in_applicators import AdditionalpropertiesShouldNotLookInApplicators -from unit_test_api.model.allof import Allof -from unit_test_api.model.allof_combined_with_anyof_oneof import AllofCombinedWithAnyofOneof -from unit_test_api.model.allof_simple_types import AllofSimpleTypes -from unit_test_api.model.allof_with_base_schema import AllofWithBaseSchema -from unit_test_api.model.allof_with_one_empty_schema import AllofWithOneEmptySchema -from unit_test_api.model.allof_with_the_first_empty_schema import AllofWithTheFirstEmptySchema -from unit_test_api.model.allof_with_the_last_empty_schema import AllofWithTheLastEmptySchema -from unit_test_api.model.allof_with_two_empty_schemas import AllofWithTwoEmptySchemas -from unit_test_api.model.anyof import Anyof -from unit_test_api.model.anyof_complex_types import AnyofComplexTypes -from unit_test_api.model.anyof_with_base_schema import AnyofWithBaseSchema -from unit_test_api.model.anyof_with_one_empty_schema import AnyofWithOneEmptySchema -from unit_test_api.model.array_type_matches_arrays import ArrayTypeMatchesArrays -from unit_test_api.model.boolean_type_matches_booleans import BooleanTypeMatchesBooleans -from unit_test_api.model.by_int import ByInt -from unit_test_api.model.by_number import ByNumber -from unit_test_api.model.by_small_number import BySmallNumber -from unit_test_api.model.date_time_format import DateTimeFormat -from unit_test_api.model.email_format import EmailFormat -from unit_test_api.model.enum_with0_does_not_match_false import EnumWith0DoesNotMatchFalse -from unit_test_api.model.enum_with1_does_not_match_true import EnumWith1DoesNotMatchTrue -from unit_test_api.model.enum_with_escaped_characters import EnumWithEscapedCharacters -from unit_test_api.model.enum_with_false_does_not_match0 import EnumWithFalseDoesNotMatch0 -from unit_test_api.model.enum_with_true_does_not_match1 import EnumWithTrueDoesNotMatch1 -from unit_test_api.model.enums_in_properties import EnumsInProperties -from unit_test_api.model.forbidden_property import ForbiddenProperty -from unit_test_api.model.hostname_format import HostnameFormat -from unit_test_api.model.integer_type_matches_integers import IntegerTypeMatchesIntegers -from unit_test_api.model.invalid_instance_should_not_raise_error_when_float_division_inf import InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf -from unit_test_api.model.invalid_string_value_for_default import InvalidStringValueForDefault -from unit_test_api.model.ipv4_format import Ipv4Format -from unit_test_api.model.ipv6_format import Ipv6Format -from unit_test_api.model.json_pointer_format import JsonPointerFormat -from unit_test_api.model.maximum_validation import MaximumValidation -from unit_test_api.model.maximum_validation_with_unsigned_integer import MaximumValidationWithUnsignedInteger -from unit_test_api.model.maxitems_validation import MaxitemsValidation -from unit_test_api.model.maxlength_validation import MaxlengthValidation -from unit_test_api.model.maxproperties0_means_the_object_is_empty import Maxproperties0MeansTheObjectIsEmpty -from unit_test_api.model.maxproperties_validation import MaxpropertiesValidation -from unit_test_api.model.minimum_validation import MinimumValidation -from unit_test_api.model.minimum_validation_with_signed_integer import MinimumValidationWithSignedInteger -from unit_test_api.model.minitems_validation import MinitemsValidation -from unit_test_api.model.minlength_validation import MinlengthValidation -from unit_test_api.model.minproperties_validation import MinpropertiesValidation -from unit_test_api.model.model_not import ModelNot -from unit_test_api.model.nested_allof_to_check_validation_semantics import NestedAllofToCheckValidationSemantics -from unit_test_api.model.nested_anyof_to_check_validation_semantics import NestedAnyofToCheckValidationSemantics -from unit_test_api.model.nested_items import NestedItems -from unit_test_api.model.nested_oneof_to_check_validation_semantics import NestedOneofToCheckValidationSemantics -from unit_test_api.model.not_more_complex_schema import NotMoreComplexSchema -from unit_test_api.model.nul_characters_in_strings import NulCharactersInStrings -from unit_test_api.model.null_type_matches_only_the_null_object import NullTypeMatchesOnlyTheNullObject -from unit_test_api.model.number_type_matches_numbers import NumberTypeMatchesNumbers -from unit_test_api.model.object_properties_validation import ObjectPropertiesValidation -from unit_test_api.model.oneof import Oneof -from unit_test_api.model.oneof_complex_types import OneofComplexTypes -from unit_test_api.model.oneof_with_base_schema import OneofWithBaseSchema -from unit_test_api.model.oneof_with_empty_schema import OneofWithEmptySchema -from unit_test_api.model.oneof_with_required import OneofWithRequired -from unit_test_api.model.pattern_is_not_anchored import PatternIsNotAnchored -from unit_test_api.model.pattern_validation import PatternValidation -from unit_test_api.model.properties_with_escaped_characters import PropertiesWithEscapedCharacters -from unit_test_api.model.property_named_ref_that_is_not_a_reference import PropertyNamedRefThatIsNotAReference -from unit_test_api.model.ref_in_additionalproperties import RefInAdditionalproperties -from unit_test_api.model.ref_in_allof import RefInAllof -from unit_test_api.model.ref_in_anyof import RefInAnyof -from unit_test_api.model.ref_in_items import RefInItems -from unit_test_api.model.ref_in_not import RefInNot -from unit_test_api.model.ref_in_oneof import RefInOneof -from unit_test_api.model.ref_in_property import RefInProperty -from unit_test_api.model.required_default_validation import RequiredDefaultValidation -from unit_test_api.model.required_validation import RequiredValidation -from unit_test_api.model.required_with_empty_array import RequiredWithEmptyArray -from unit_test_api.model.required_with_escaped_characters import RequiredWithEscapedCharacters -from unit_test_api.model.simple_enum_validation import SimpleEnumValidation -from unit_test_api.model.string_type_matches_strings import StringTypeMatchesStrings -from unit_test_api.model.the_default_keyword_does_not_do_anything_if_the_property_is_missing import TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing -from unit_test_api.model.uniqueitems_false_validation import UniqueitemsFalseValidation -from unit_test_api.model.uniqueitems_validation import UniqueitemsValidation -from unit_test_api.model.uri_format import UriFormat -from unit_test_api.model.uri_reference_format import UriReferenceFormat -from unit_test_api.model.uri_template_format import UriTemplateFormat diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/__init__.py deleted file mode 100644 index 2522dcf8f19..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/__init__.py +++ /dev/null @@ -1,182 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.apis.path_to_api import path_to_api - -import enum - - -class PathValues(str, enum.Enum): - REQUEST_BODY_POST_ADDITIONALPROPERTIES_ALLOWS_ASCHEMA_WHICH_SHOULD_VALIDATE_REQUEST_BODY = "/requestBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody" - RESPONSE_BODY_POST_ADDITIONALPROPERTIES_ALLOWS_ASCHEMA_WHICH_SHOULD_VALIDATE_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateResponseBodyForContentTypes" - REQUEST_BODY_POST_ADDITIONALPROPERTIES_CAN_EXIST_BY_ITSELF_REQUEST_BODY = "/requestBody/postAdditionalpropertiesCanExistByItselfRequestBody" - RESPONSE_BODY_POST_ADDITIONALPROPERTIES_CAN_EXIST_BY_ITSELF_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postAdditionalpropertiesCanExistByItselfResponseBodyForContentTypes" - REQUEST_BODY_POST_ADDITIONALPROPERTIES_ARE_ALLOWED_BY_DEFAULT_REQUEST_BODY = "/requestBody/postAdditionalpropertiesAreAllowedByDefaultRequestBody" - RESPONSE_BODY_POST_ADDITIONALPROPERTIES_ARE_ALLOWED_BY_DEFAULT_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postAdditionalpropertiesAreAllowedByDefaultResponseBodyForContentTypes" - REQUEST_BODY_POST_ADDITIONALPROPERTIES_SHOULD_NOT_LOOK_IN_APPLICATORS_REQUEST_BODY = "/requestBody/postAdditionalpropertiesShouldNotLookInApplicatorsRequestBody" - RESPONSE_BODY_POST_ADDITIONALPROPERTIES_SHOULD_NOT_LOOK_IN_APPLICATORS_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postAdditionalpropertiesShouldNotLookInApplicatorsResponseBodyForContentTypes" - REQUEST_BODY_POST_ALLOF_REQUEST_BODY = "/requestBody/postAllofRequestBody" - RESPONSE_BODY_POST_ALLOF_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postAllofResponseBodyForContentTypes" - REQUEST_BODY_POST_ALLOF_WITH_BASE_SCHEMA_REQUEST_BODY = "/requestBody/postAllofWithBaseSchemaRequestBody" - RESPONSE_BODY_POST_ALLOF_WITH_BASE_SCHEMA_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postAllofWithBaseSchemaResponseBodyForContentTypes" - REQUEST_BODY_POST_ALLOF_SIMPLE_TYPES_REQUEST_BODY = "/requestBody/postAllofSimpleTypesRequestBody" - RESPONSE_BODY_POST_ALLOF_SIMPLE_TYPES_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postAllofSimpleTypesResponseBodyForContentTypes" - REQUEST_BODY_POST_ALLOF_WITH_ONE_EMPTY_SCHEMA_REQUEST_BODY = "/requestBody/postAllofWithOneEmptySchemaRequestBody" - RESPONSE_BODY_POST_ALLOF_WITH_ONE_EMPTY_SCHEMA_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postAllofWithOneEmptySchemaResponseBodyForContentTypes" - REQUEST_BODY_POST_ALLOF_WITH_TWO_EMPTY_SCHEMAS_REQUEST_BODY = "/requestBody/postAllofWithTwoEmptySchemasRequestBody" - RESPONSE_BODY_POST_ALLOF_WITH_TWO_EMPTY_SCHEMAS_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postAllofWithTwoEmptySchemasResponseBodyForContentTypes" - REQUEST_BODY_POST_ALLOF_WITH_THE_FIRST_EMPTY_SCHEMA_REQUEST_BODY = "/requestBody/postAllofWithTheFirstEmptySchemaRequestBody" - RESPONSE_BODY_POST_ALLOF_WITH_THE_FIRST_EMPTY_SCHEMA_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postAllofWithTheFirstEmptySchemaResponseBodyForContentTypes" - REQUEST_BODY_POST_ALLOF_WITH_THE_LAST_EMPTY_SCHEMA_REQUEST_BODY = "/requestBody/postAllofWithTheLastEmptySchemaRequestBody" - RESPONSE_BODY_POST_ALLOF_WITH_THE_LAST_EMPTY_SCHEMA_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postAllofWithTheLastEmptySchemaResponseBodyForContentTypes" - REQUEST_BODY_POST_NESTED_ALLOF_TO_CHECK_VALIDATION_SEMANTICS_REQUEST_BODY = "/requestBody/postNestedAllofToCheckValidationSemanticsRequestBody" - RESPONSE_BODY_POST_NESTED_ALLOF_TO_CHECK_VALIDATION_SEMANTICS_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postNestedAllofToCheckValidationSemanticsResponseBodyForContentTypes" - REQUEST_BODY_POST_ALLOF_COMBINED_WITH_ANYOF_ONEOF_REQUEST_BODY = "/requestBody/postAllofCombinedWithAnyofOneofRequestBody" - RESPONSE_BODY_POST_ALLOF_COMBINED_WITH_ANYOF_ONEOF_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postAllofCombinedWithAnyofOneofResponseBodyForContentTypes" - REQUEST_BODY_POST_ANYOF_REQUEST_BODY = "/requestBody/postAnyofRequestBody" - RESPONSE_BODY_POST_ANYOF_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postAnyofResponseBodyForContentTypes" - REQUEST_BODY_POST_ANYOF_WITH_BASE_SCHEMA_REQUEST_BODY = "/requestBody/postAnyofWithBaseSchemaRequestBody" - RESPONSE_BODY_POST_ANYOF_WITH_BASE_SCHEMA_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postAnyofWithBaseSchemaResponseBodyForContentTypes" - REQUEST_BODY_POST_ANYOF_COMPLEX_TYPES_REQUEST_BODY = "/requestBody/postAnyofComplexTypesRequestBody" - RESPONSE_BODY_POST_ANYOF_COMPLEX_TYPES_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postAnyofComplexTypesResponseBodyForContentTypes" - REQUEST_BODY_POST_ANYOF_WITH_ONE_EMPTY_SCHEMA_REQUEST_BODY = "/requestBody/postAnyofWithOneEmptySchemaRequestBody" - RESPONSE_BODY_POST_ANYOF_WITH_ONE_EMPTY_SCHEMA_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postAnyofWithOneEmptySchemaResponseBodyForContentTypes" - REQUEST_BODY_POST_NESTED_ANYOF_TO_CHECK_VALIDATION_SEMANTICS_REQUEST_BODY = "/requestBody/postNestedAnyofToCheckValidationSemanticsRequestBody" - RESPONSE_BODY_POST_NESTED_ANYOF_TO_CHECK_VALIDATION_SEMANTICS_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postNestedAnyofToCheckValidationSemanticsResponseBodyForContentTypes" - REQUEST_BODY_POST_INVALID_STRING_VALUE_FOR_DEFAULT_REQUEST_BODY = "/requestBody/postInvalidStringValueForDefaultRequestBody" - RESPONSE_BODY_POST_INVALID_STRING_VALUE_FOR_DEFAULT_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postInvalidStringValueForDefaultResponseBodyForContentTypes" - REQUEST_BODY_POST_THE_DEFAULT_KEYWORD_DOES_NOT_DO_ANYTHING_IF_THE_PROPERTY_IS_MISSING_REQUEST_BODY = "/requestBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody" - RESPONSE_BODY_POST_THE_DEFAULT_KEYWORD_DOES_NOT_DO_ANYTHING_IF_THE_PROPERTY_IS_MISSING_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyForContentTypes" - REQUEST_BODY_POST_SIMPLE_ENUM_VALIDATION_REQUEST_BODY = "/requestBody/postSimpleEnumValidationRequestBody" - RESPONSE_BODY_POST_SIMPLE_ENUM_VALIDATION_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postSimpleEnumValidationResponseBodyForContentTypes" - REQUEST_BODY_POST_ENUMS_IN_PROPERTIES_REQUEST_BODY = "/requestBody/postEnumsInPropertiesRequestBody" - RESPONSE_BODY_POST_ENUMS_IN_PROPERTIES_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postEnumsInPropertiesResponseBodyForContentTypes" - REQUEST_BODY_POST_ENUM_WITH_ESCAPED_CHARACTERS_REQUEST_BODY = "/requestBody/postEnumWithEscapedCharactersRequestBody" - RESPONSE_BODY_POST_ENUM_WITH_ESCAPED_CHARACTERS_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postEnumWithEscapedCharactersResponseBodyForContentTypes" - REQUEST_BODY_POST_ENUM_WITH_FALSE_DOES_NOT_MATCH0REQUEST_BODY = "/requestBody/postEnumWithFalseDoesNotMatch0RequestBody" - RESPONSE_BODY_POST_ENUM_WITH_FALSE_DOES_NOT_MATCH0RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postEnumWithFalseDoesNotMatch0ResponseBodyForContentTypes" - REQUEST_BODY_POST_ENUM_WITH_TRUE_DOES_NOT_MATCH1REQUEST_BODY = "/requestBody/postEnumWithTrueDoesNotMatch1RequestBody" - RESPONSE_BODY_POST_ENUM_WITH_TRUE_DOES_NOT_MATCH1RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postEnumWithTrueDoesNotMatch1ResponseBodyForContentTypes" - REQUEST_BODY_POST_ENUM_WITH0DOES_NOT_MATCH_FALSE_REQUEST_BODY = "/requestBody/postEnumWith0DoesNotMatchFalseRequestBody" - RESPONSE_BODY_POST_ENUM_WITH0DOES_NOT_MATCH_FALSE_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postEnumWith0DoesNotMatchFalseResponseBodyForContentTypes" - REQUEST_BODY_POST_ENUM_WITH1DOES_NOT_MATCH_TRUE_REQUEST_BODY = "/requestBody/postEnumWith1DoesNotMatchTrueRequestBody" - RESPONSE_BODY_POST_ENUM_WITH1DOES_NOT_MATCH_TRUE_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postEnumWith1DoesNotMatchTrueResponseBodyForContentTypes" - REQUEST_BODY_POST_NUL_CHARACTERS_IN_STRINGS_REQUEST_BODY = "/requestBody/postNulCharactersInStringsRequestBody" - RESPONSE_BODY_POST_NUL_CHARACTERS_IN_STRINGS_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postNulCharactersInStringsResponseBodyForContentTypes" - REQUEST_BODY_POST_EMAIL_FORMAT_REQUEST_BODY = "/requestBody/postEmailFormatRequestBody" - RESPONSE_BODY_POST_EMAIL_FORMAT_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postEmailFormatResponseBodyForContentTypes" - REQUEST_BODY_POST_IPV4FORMAT_REQUEST_BODY = "/requestBody/postIpv4FormatRequestBody" - RESPONSE_BODY_POST_IPV4FORMAT_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postIpv4FormatResponseBodyForContentTypes" - REQUEST_BODY_POST_IPV6FORMAT_REQUEST_BODY = "/requestBody/postIpv6FormatRequestBody" - RESPONSE_BODY_POST_IPV6FORMAT_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postIpv6FormatResponseBodyForContentTypes" - REQUEST_BODY_POST_HOSTNAME_FORMAT_REQUEST_BODY = "/requestBody/postHostnameFormatRequestBody" - RESPONSE_BODY_POST_HOSTNAME_FORMAT_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postHostnameFormatResponseBodyForContentTypes" - REQUEST_BODY_POST_DATE_TIME_FORMAT_REQUEST_BODY = "/requestBody/postDateTimeFormatRequestBody" - RESPONSE_BODY_POST_DATE_TIME_FORMAT_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postDateTimeFormatResponseBodyForContentTypes" - REQUEST_BODY_POST_JSON_POINTER_FORMAT_REQUEST_BODY = "/requestBody/postJsonPointerFormatRequestBody" - RESPONSE_BODY_POST_JSON_POINTER_FORMAT_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postJsonPointerFormatResponseBodyForContentTypes" - REQUEST_BODY_POST_URI_FORMAT_REQUEST_BODY = "/requestBody/postUriFormatRequestBody" - RESPONSE_BODY_POST_URI_FORMAT_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postUriFormatResponseBodyForContentTypes" - REQUEST_BODY_POST_URI_REFERENCE_FORMAT_REQUEST_BODY = "/requestBody/postUriReferenceFormatRequestBody" - RESPONSE_BODY_POST_URI_REFERENCE_FORMAT_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postUriReferenceFormatResponseBodyForContentTypes" - REQUEST_BODY_POST_URI_TEMPLATE_FORMAT_REQUEST_BODY = "/requestBody/postUriTemplateFormatRequestBody" - RESPONSE_BODY_POST_URI_TEMPLATE_FORMAT_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postUriTemplateFormatResponseBodyForContentTypes" - REQUEST_BODY_POST_NESTED_ITEMS_REQUEST_BODY = "/requestBody/postNestedItemsRequestBody" - RESPONSE_BODY_POST_NESTED_ITEMS_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postNestedItemsResponseBodyForContentTypes" - REQUEST_BODY_POST_MAXIMUM_VALIDATION_REQUEST_BODY = "/requestBody/postMaximumValidationRequestBody" - RESPONSE_BODY_POST_MAXIMUM_VALIDATION_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postMaximumValidationResponseBodyForContentTypes" - REQUEST_BODY_POST_MAXIMUM_VALIDATION_WITH_UNSIGNED_INTEGER_REQUEST_BODY = "/requestBody/postMaximumValidationWithUnsignedIntegerRequestBody" - RESPONSE_BODY_POST_MAXIMUM_VALIDATION_WITH_UNSIGNED_INTEGER_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postMaximumValidationWithUnsignedIntegerResponseBodyForContentTypes" - REQUEST_BODY_POST_MAXITEMS_VALIDATION_REQUEST_BODY = "/requestBody/postMaxitemsValidationRequestBody" - RESPONSE_BODY_POST_MAXITEMS_VALIDATION_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postMaxitemsValidationResponseBodyForContentTypes" - REQUEST_BODY_POST_MAXLENGTH_VALIDATION_REQUEST_BODY = "/requestBody/postMaxlengthValidationRequestBody" - RESPONSE_BODY_POST_MAXLENGTH_VALIDATION_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postMaxlengthValidationResponseBodyForContentTypes" - REQUEST_BODY_POST_MAXPROPERTIES_VALIDATION_REQUEST_BODY = "/requestBody/postMaxpropertiesValidationRequestBody" - RESPONSE_BODY_POST_MAXPROPERTIES_VALIDATION_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postMaxpropertiesValidationResponseBodyForContentTypes" - REQUEST_BODY_POST_MAXPROPERTIES0MEANS_THE_OBJECT_IS_EMPTY_REQUEST_BODY = "/requestBody/postMaxproperties0MeansTheObjectIsEmptyRequestBody" - RESPONSE_BODY_POST_MAXPROPERTIES0MEANS_THE_OBJECT_IS_EMPTY_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postMaxproperties0MeansTheObjectIsEmptyResponseBodyForContentTypes" - REQUEST_BODY_POST_MINIMUM_VALIDATION_REQUEST_BODY = "/requestBody/postMinimumValidationRequestBody" - RESPONSE_BODY_POST_MINIMUM_VALIDATION_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postMinimumValidationResponseBodyForContentTypes" - REQUEST_BODY_POST_MINIMUM_VALIDATION_WITH_SIGNED_INTEGER_REQUEST_BODY = "/requestBody/postMinimumValidationWithSignedIntegerRequestBody" - RESPONSE_BODY_POST_MINIMUM_VALIDATION_WITH_SIGNED_INTEGER_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postMinimumValidationWithSignedIntegerResponseBodyForContentTypes" - REQUEST_BODY_POST_MINITEMS_VALIDATION_REQUEST_BODY = "/requestBody/postMinitemsValidationRequestBody" - RESPONSE_BODY_POST_MINITEMS_VALIDATION_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postMinitemsValidationResponseBodyForContentTypes" - REQUEST_BODY_POST_MINLENGTH_VALIDATION_REQUEST_BODY = "/requestBody/postMinlengthValidationRequestBody" - RESPONSE_BODY_POST_MINLENGTH_VALIDATION_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postMinlengthValidationResponseBodyForContentTypes" - REQUEST_BODY_POST_MINPROPERTIES_VALIDATION_REQUEST_BODY = "/requestBody/postMinpropertiesValidationRequestBody" - RESPONSE_BODY_POST_MINPROPERTIES_VALIDATION_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postMinpropertiesValidationResponseBodyForContentTypes" - REQUEST_BODY_POST_BY_INT_REQUEST_BODY = "/requestBody/postByIntRequestBody" - RESPONSE_BODY_POST_BY_INT_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postByIntResponseBodyForContentTypes" - REQUEST_BODY_POST_BY_NUMBER_REQUEST_BODY = "/requestBody/postByNumberRequestBody" - RESPONSE_BODY_POST_BY_NUMBER_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postByNumberResponseBodyForContentTypes" - REQUEST_BODY_POST_BY_SMALL_NUMBER_REQUEST_BODY = "/requestBody/postBySmallNumberRequestBody" - RESPONSE_BODY_POST_BY_SMALL_NUMBER_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postBySmallNumberResponseBodyForContentTypes" - REQUEST_BODY_POST_INVALID_INSTANCE_SHOULD_NOT_RAISE_ERROR_WHEN_FLOAT_DIVISION_INF_REQUEST_BODY = "/requestBody/postInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody" - RESPONSE_BODY_POST_INVALID_INSTANCE_SHOULD_NOT_RAISE_ERROR_WHEN_FLOAT_DIVISION_INF_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfResponseBodyForContentTypes" - REQUEST_BODY_POST_NOT_REQUEST_BODY = "/requestBody/postNotRequestBody" - RESPONSE_BODY_POST_NOT_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postNotResponseBodyForContentTypes" - REQUEST_BODY_POST_NOT_MORE_COMPLEX_SCHEMA_REQUEST_BODY = "/requestBody/postNotMoreComplexSchemaRequestBody" - RESPONSE_BODY_POST_NOT_MORE_COMPLEX_SCHEMA_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postNotMoreComplexSchemaResponseBodyForContentTypes" - REQUEST_BODY_POST_FORBIDDEN_PROPERTY_REQUEST_BODY = "/requestBody/postForbiddenPropertyRequestBody" - RESPONSE_BODY_POST_FORBIDDEN_PROPERTY_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postForbiddenPropertyResponseBodyForContentTypes" - REQUEST_BODY_POST_ONEOF_REQUEST_BODY = "/requestBody/postOneofRequestBody" - RESPONSE_BODY_POST_ONEOF_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postOneofResponseBodyForContentTypes" - REQUEST_BODY_POST_ONEOF_WITH_BASE_SCHEMA_REQUEST_BODY = "/requestBody/postOneofWithBaseSchemaRequestBody" - RESPONSE_BODY_POST_ONEOF_WITH_BASE_SCHEMA_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postOneofWithBaseSchemaResponseBodyForContentTypes" - REQUEST_BODY_POST_ONEOF_COMPLEX_TYPES_REQUEST_BODY = "/requestBody/postOneofComplexTypesRequestBody" - RESPONSE_BODY_POST_ONEOF_COMPLEX_TYPES_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postOneofComplexTypesResponseBodyForContentTypes" - REQUEST_BODY_POST_ONEOF_WITH_EMPTY_SCHEMA_REQUEST_BODY = "/requestBody/postOneofWithEmptySchemaRequestBody" - RESPONSE_BODY_POST_ONEOF_WITH_EMPTY_SCHEMA_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postOneofWithEmptySchemaResponseBodyForContentTypes" - REQUEST_BODY_POST_ONEOF_WITH_REQUIRED_REQUEST_BODY = "/requestBody/postOneofWithRequiredRequestBody" - RESPONSE_BODY_POST_ONEOF_WITH_REQUIRED_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postOneofWithRequiredResponseBodyForContentTypes" - REQUEST_BODY_POST_NESTED_ONEOF_TO_CHECK_VALIDATION_SEMANTICS_REQUEST_BODY = "/requestBody/postNestedOneofToCheckValidationSemanticsRequestBody" - RESPONSE_BODY_POST_NESTED_ONEOF_TO_CHECK_VALIDATION_SEMANTICS_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postNestedOneofToCheckValidationSemanticsResponseBodyForContentTypes" - REQUEST_BODY_POST_PATTERN_VALIDATION_REQUEST_BODY = "/requestBody/postPatternValidationRequestBody" - RESPONSE_BODY_POST_PATTERN_VALIDATION_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postPatternValidationResponseBodyForContentTypes" - REQUEST_BODY_POST_PATTERN_IS_NOT_ANCHORED_REQUEST_BODY = "/requestBody/postPatternIsNotAnchoredRequestBody" - RESPONSE_BODY_POST_PATTERN_IS_NOT_ANCHORED_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postPatternIsNotAnchoredResponseBodyForContentTypes" - REQUEST_BODY_POST_OBJECT_PROPERTIES_VALIDATION_REQUEST_BODY = "/requestBody/postObjectPropertiesValidationRequestBody" - RESPONSE_BODY_POST_OBJECT_PROPERTIES_VALIDATION_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postObjectPropertiesValidationResponseBodyForContentTypes" - REQUEST_BODY_POST_PROPERTIES_WITH_ESCAPED_CHARACTERS_REQUEST_BODY = "/requestBody/postPropertiesWithEscapedCharactersRequestBody" - RESPONSE_BODY_POST_PROPERTIES_WITH_ESCAPED_CHARACTERS_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postPropertiesWithEscapedCharactersResponseBodyForContentTypes" - REQUEST_BODY_POST_PROPERTY_NAMED_REF_THAT_IS_NOT_AREFERENCE_REQUEST_BODY = "/requestBody/postPropertyNamedRefThatIsNotAReferenceRequestBody" - RESPONSE_BODY_POST_PROPERTY_NAMED_REF_THAT_IS_NOT_AREFERENCE_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postPropertyNamedRefThatIsNotAReferenceResponseBodyForContentTypes" - REQUEST_BODY_POST_REF_IN_ADDITIONALPROPERTIES_REQUEST_BODY = "/requestBody/postRefInAdditionalpropertiesRequestBody" - RESPONSE_BODY_POST_REF_IN_ADDITIONALPROPERTIES_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postRefInAdditionalpropertiesResponseBodyForContentTypes" - REQUEST_BODY_POST_REF_IN_ITEMS_REQUEST_BODY = "/requestBody/postRefInItemsRequestBody" - RESPONSE_BODY_POST_REF_IN_ITEMS_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postRefInItemsResponseBodyForContentTypes" - REQUEST_BODY_POST_REF_IN_PROPERTY_REQUEST_BODY = "/requestBody/postRefInPropertyRequestBody" - RESPONSE_BODY_POST_REF_IN_PROPERTY_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postRefInPropertyResponseBodyForContentTypes" - REQUEST_BODY_POST_REF_IN_ALLOF_REQUEST_BODY = "/requestBody/postRefInAllofRequestBody" - RESPONSE_BODY_POST_REF_IN_ALLOF_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postRefInAllofResponseBodyForContentTypes" - REQUEST_BODY_POST_REF_IN_ONEOF_REQUEST_BODY = "/requestBody/postRefInOneofRequestBody" - RESPONSE_BODY_POST_REF_IN_ONEOF_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postRefInOneofResponseBodyForContentTypes" - REQUEST_BODY_POST_REF_IN_ANYOF_REQUEST_BODY = "/requestBody/postRefInAnyofRequestBody" - RESPONSE_BODY_POST_REF_IN_ANYOF_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postRefInAnyofResponseBodyForContentTypes" - REQUEST_BODY_POST_REF_IN_NOT_REQUEST_BODY = "/requestBody/postRefInNotRequestBody" - RESPONSE_BODY_POST_REF_IN_NOT_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postRefInNotResponseBodyForContentTypes" - REQUEST_BODY_POST_REQUIRED_VALIDATION_REQUEST_BODY = "/requestBody/postRequiredValidationRequestBody" - RESPONSE_BODY_POST_REQUIRED_VALIDATION_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postRequiredValidationResponseBodyForContentTypes" - REQUEST_BODY_POST_REQUIRED_DEFAULT_VALIDATION_REQUEST_BODY = "/requestBody/postRequiredDefaultValidationRequestBody" - RESPONSE_BODY_POST_REQUIRED_DEFAULT_VALIDATION_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postRequiredDefaultValidationResponseBodyForContentTypes" - REQUEST_BODY_POST_REQUIRED_WITH_EMPTY_ARRAY_REQUEST_BODY = "/requestBody/postRequiredWithEmptyArrayRequestBody" - RESPONSE_BODY_POST_REQUIRED_WITH_EMPTY_ARRAY_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postRequiredWithEmptyArrayResponseBodyForContentTypes" - REQUEST_BODY_POST_REQUIRED_WITH_ESCAPED_CHARACTERS_REQUEST_BODY = "/requestBody/postRequiredWithEscapedCharactersRequestBody" - RESPONSE_BODY_POST_REQUIRED_WITH_ESCAPED_CHARACTERS_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postRequiredWithEscapedCharactersResponseBodyForContentTypes" - REQUEST_BODY_POST_INTEGER_TYPE_MATCHES_INTEGERS_REQUEST_BODY = "/requestBody/postIntegerTypeMatchesIntegersRequestBody" - RESPONSE_BODY_POST_INTEGER_TYPE_MATCHES_INTEGERS_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postIntegerTypeMatchesIntegersResponseBodyForContentTypes" - REQUEST_BODY_POST_NUMBER_TYPE_MATCHES_NUMBERS_REQUEST_BODY = "/requestBody/postNumberTypeMatchesNumbersRequestBody" - RESPONSE_BODY_POST_NUMBER_TYPE_MATCHES_NUMBERS_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postNumberTypeMatchesNumbersResponseBodyForContentTypes" - REQUEST_BODY_POST_STRING_TYPE_MATCHES_STRINGS_REQUEST_BODY = "/requestBody/postStringTypeMatchesStringsRequestBody" - RESPONSE_BODY_POST_STRING_TYPE_MATCHES_STRINGS_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postStringTypeMatchesStringsResponseBodyForContentTypes" - REQUEST_BODY_POST_OBJECT_TYPE_MATCHES_OBJECTS_REQUEST_BODY = "/requestBody/postObjectTypeMatchesObjectsRequestBody" - RESPONSE_BODY_POST_OBJECT_TYPE_MATCHES_OBJECTS_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postObjectTypeMatchesObjectsResponseBodyForContentTypes" - REQUEST_BODY_POST_BOOLEAN_TYPE_MATCHES_BOOLEANS_REQUEST_BODY = "/requestBody/postBooleanTypeMatchesBooleansRequestBody" - RESPONSE_BODY_POST_BOOLEAN_TYPE_MATCHES_BOOLEANS_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postBooleanTypeMatchesBooleansResponseBodyForContentTypes" - REQUEST_BODY_POST_NULL_TYPE_MATCHES_ONLY_THE_NULL_OBJECT_REQUEST_BODY = "/requestBody/postNullTypeMatchesOnlyTheNullObjectRequestBody" - RESPONSE_BODY_POST_NULL_TYPE_MATCHES_ONLY_THE_NULL_OBJECT_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes" - REQUEST_BODY_POST_ARRAY_TYPE_MATCHES_ARRAYS_REQUEST_BODY = "/requestBody/postArrayTypeMatchesArraysRequestBody" - RESPONSE_BODY_POST_ARRAY_TYPE_MATCHES_ARRAYS_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postArrayTypeMatchesArraysResponseBodyForContentTypes" - REQUEST_BODY_POST_UNIQUEITEMS_VALIDATION_REQUEST_BODY = "/requestBody/postUniqueitemsValidationRequestBody" - RESPONSE_BODY_POST_UNIQUEITEMS_VALIDATION_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postUniqueitemsValidationResponseBodyForContentTypes" - REQUEST_BODY_POST_UNIQUEITEMS_FALSE_VALIDATION_REQUEST_BODY = "/requestBody/postUniqueitemsFalseValidationRequestBody" - RESPONSE_BODY_POST_UNIQUEITEMS_FALSE_VALIDATION_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postUniqueitemsFalseValidationResponseBodyForContentTypes" diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/__init__.py deleted file mode 100644 index 70345f0107d..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_ADDITIONALPROPERTIES_ALLOWS_ASCHEMA_WHICH_SHOULD_VALIDATE_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post.py deleted file mode 100644 index 5f10a127c2d..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.additionalproperties_allows_a_schema_which_should_validate import AdditionalpropertiesAllowsASchemaWhichShouldValidate - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = AdditionalpropertiesAllowsASchemaWhichShouldValidate - - -request_body_additionalproperties_allows_a_schema_which_should_validate = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_additionalproperties_allows_a_schema_which_should_validate_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_additionalproperties_allows_a_schema_which_should_validate_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_additionalproperties_allows_a_schema_which_should_validate_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_additionalproperties_allows_a_schema_which_should_validate_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_additionalproperties_allows_a_schema_which_should_validate_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_additionalproperties_allows_a_schema_which_should_validate.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_additionalproperties_allows_a_schema_which_should_validate_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_additionalproperties_allows_a_schema_which_should_validate_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_additionalproperties_allows_a_schema_which_should_validate_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_additionalproperties_allows_a_schema_which_should_validate_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_additionalproperties_allows_a_schema_which_should_validate_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_additionalproperties_allows_a_schema_which_should_validate_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_additionalproperties_allows_a_schema_which_should_validate_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post.pyi deleted file mode 100644 index 3ec2f37fae0..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.additionalproperties_allows_a_schema_which_should_validate import AdditionalpropertiesAllowsASchemaWhichShouldValidate - -# body param -SchemaForRequestBodyApplicationJson = AdditionalpropertiesAllowsASchemaWhichShouldValidate - - -request_body_additionalproperties_allows_a_schema_which_should_validate = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_additionalproperties_allows_a_schema_which_should_validate_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_additionalproperties_allows_a_schema_which_should_validate_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_additionalproperties_allows_a_schema_which_should_validate_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_additionalproperties_allows_a_schema_which_should_validate_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_additionalproperties_allows_a_schema_which_should_validate_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_additionalproperties_allows_a_schema_which_should_validate.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_additionalproperties_allows_a_schema_which_should_validate_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_additionalproperties_allows_a_schema_which_should_validate_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_additionalproperties_allows_a_schema_which_should_validate_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_additionalproperties_allows_a_schema_which_should_validate_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_additionalproperties_allows_a_schema_which_should_validate_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_additionalproperties_allows_a_schema_which_should_validate_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_additionalproperties_allows_a_schema_which_should_validate_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/__init__.py deleted file mode 100644 index 6430d2326ae..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_additionalproperties_are_allowed_by_default_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_ADDITIONALPROPERTIES_ARE_ALLOWED_BY_DEFAULT_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post.py deleted file mode 100644 index 00eeab16165..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.additionalproperties_are_allowed_by_default import AdditionalpropertiesAreAllowedByDefault - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = AdditionalpropertiesAreAllowedByDefault - - -request_body_additionalproperties_are_allowed_by_default = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_additionalproperties_are_allowed_by_default_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_additionalproperties_are_allowed_by_default_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_additionalproperties_are_allowed_by_default_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_additionalproperties_are_allowed_by_default_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_additionalproperties_are_allowed_by_default_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_additionalproperties_are_allowed_by_default.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostAdditionalpropertiesAreAllowedByDefaultRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_additionalproperties_are_allowed_by_default_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_additionalproperties_are_allowed_by_default_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_additionalproperties_are_allowed_by_default_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_additionalproperties_are_allowed_by_default_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_additionalproperties_are_allowed_by_default_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_additionalproperties_are_allowed_by_default_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_additionalproperties_are_allowed_by_default_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post.pyi deleted file mode 100644 index 27163ff769d..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.additionalproperties_are_allowed_by_default import AdditionalpropertiesAreAllowedByDefault - -# body param -SchemaForRequestBodyApplicationJson = AdditionalpropertiesAreAllowedByDefault - - -request_body_additionalproperties_are_allowed_by_default = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_additionalproperties_are_allowed_by_default_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_additionalproperties_are_allowed_by_default_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_additionalproperties_are_allowed_by_default_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_additionalproperties_are_allowed_by_default_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_additionalproperties_are_allowed_by_default_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_additionalproperties_are_allowed_by_default.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostAdditionalpropertiesAreAllowedByDefaultRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_additionalproperties_are_allowed_by_default_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_additionalproperties_are_allowed_by_default_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_additionalproperties_are_allowed_by_default_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_additionalproperties_are_allowed_by_default_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_additionalproperties_are_allowed_by_default_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_additionalproperties_are_allowed_by_default_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_additionalproperties_are_allowed_by_default_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/__init__.py deleted file mode 100644 index 96c4aff53e5..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_additionalproperties_can_exist_by_itself_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_ADDITIONALPROPERTIES_CAN_EXIST_BY_ITSELF_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post.py deleted file mode 100644 index 7a793a714d2..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.additionalproperties_can_exist_by_itself import AdditionalpropertiesCanExistByItself - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = AdditionalpropertiesCanExistByItself - - -request_body_additionalproperties_can_exist_by_itself = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_additionalproperties_can_exist_by_itself_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_additionalproperties_can_exist_by_itself_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_additionalproperties_can_exist_by_itself_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_additionalproperties_can_exist_by_itself_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_additionalproperties_can_exist_by_itself_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_additionalproperties_can_exist_by_itself.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostAdditionalpropertiesCanExistByItselfRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_additionalproperties_can_exist_by_itself_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_additionalproperties_can_exist_by_itself_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_additionalproperties_can_exist_by_itself_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_additionalproperties_can_exist_by_itself_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_additionalproperties_can_exist_by_itself_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_additionalproperties_can_exist_by_itself_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_additionalproperties_can_exist_by_itself_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post.pyi deleted file mode 100644 index 73568bd9c01..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.additionalproperties_can_exist_by_itself import AdditionalpropertiesCanExistByItself - -# body param -SchemaForRequestBodyApplicationJson = AdditionalpropertiesCanExistByItself - - -request_body_additionalproperties_can_exist_by_itself = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_additionalproperties_can_exist_by_itself_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_additionalproperties_can_exist_by_itself_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_additionalproperties_can_exist_by_itself_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_additionalproperties_can_exist_by_itself_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_additionalproperties_can_exist_by_itself_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_additionalproperties_can_exist_by_itself.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostAdditionalpropertiesCanExistByItselfRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_additionalproperties_can_exist_by_itself_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_additionalproperties_can_exist_by_itself_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_additionalproperties_can_exist_by_itself_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_additionalproperties_can_exist_by_itself_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_additionalproperties_can_exist_by_itself_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_additionalproperties_can_exist_by_itself_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_additionalproperties_can_exist_by_itself_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/__init__.py deleted file mode 100644 index 7777dd53d63..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_additionalproperties_should_not_look_in_applicators_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_ADDITIONALPROPERTIES_SHOULD_NOT_LOOK_IN_APPLICATORS_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post.py deleted file mode 100644 index adc08b4f7f4..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.additionalproperties_should_not_look_in_applicators import AdditionalpropertiesShouldNotLookInApplicators - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = AdditionalpropertiesShouldNotLookInApplicators - - -request_body_additionalproperties_should_not_look_in_applicators = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_additionalproperties_should_not_look_in_applicators_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_additionalproperties_should_not_look_in_applicators_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_additionalproperties_should_not_look_in_applicators_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_additionalproperties_should_not_look_in_applicators_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_additionalproperties_should_not_look_in_applicators_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_additionalproperties_should_not_look_in_applicators.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostAdditionalpropertiesShouldNotLookInApplicatorsRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_additionalproperties_should_not_look_in_applicators_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_additionalproperties_should_not_look_in_applicators_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_additionalproperties_should_not_look_in_applicators_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_additionalproperties_should_not_look_in_applicators_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_additionalproperties_should_not_look_in_applicators_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_additionalproperties_should_not_look_in_applicators_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_additionalproperties_should_not_look_in_applicators_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post.pyi deleted file mode 100644 index 8fdd9d8902e..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.additionalproperties_should_not_look_in_applicators import AdditionalpropertiesShouldNotLookInApplicators - -# body param -SchemaForRequestBodyApplicationJson = AdditionalpropertiesShouldNotLookInApplicators - - -request_body_additionalproperties_should_not_look_in_applicators = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_additionalproperties_should_not_look_in_applicators_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_additionalproperties_should_not_look_in_applicators_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_additionalproperties_should_not_look_in_applicators_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_additionalproperties_should_not_look_in_applicators_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_additionalproperties_should_not_look_in_applicators_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_additionalproperties_should_not_look_in_applicators.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostAdditionalpropertiesShouldNotLookInApplicatorsRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_additionalproperties_should_not_look_in_applicators_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_additionalproperties_should_not_look_in_applicators_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_additionalproperties_should_not_look_in_applicators_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_additionalproperties_should_not_look_in_applicators_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_additionalproperties_should_not_look_in_applicators_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_additionalproperties_should_not_look_in_applicators_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_additionalproperties_should_not_look_in_applicators_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/__init__.py deleted file mode 100644 index 60e8ae1384e..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_allof_combined_with_anyof_oneof_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_ALLOF_COMBINED_WITH_ANYOF_ONEOF_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post.py deleted file mode 100644 index 1f658c45534..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.allof_combined_with_anyof_oneof import AllofCombinedWithAnyofOneof - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = AllofCombinedWithAnyofOneof - - -request_body_allof_combined_with_anyof_oneof = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_allof_combined_with_anyof_oneof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_allof_combined_with_anyof_oneof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_allof_combined_with_anyof_oneof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_allof_combined_with_anyof_oneof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_allof_combined_with_anyof_oneof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_allof_combined_with_anyof_oneof.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostAllofCombinedWithAnyofOneofRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_allof_combined_with_anyof_oneof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_allof_combined_with_anyof_oneof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_allof_combined_with_anyof_oneof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_allof_combined_with_anyof_oneof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_allof_combined_with_anyof_oneof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_allof_combined_with_anyof_oneof_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_allof_combined_with_anyof_oneof_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post.pyi deleted file mode 100644 index f2a7c77527f..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.allof_combined_with_anyof_oneof import AllofCombinedWithAnyofOneof - -# body param -SchemaForRequestBodyApplicationJson = AllofCombinedWithAnyofOneof - - -request_body_allof_combined_with_anyof_oneof = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_allof_combined_with_anyof_oneof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_allof_combined_with_anyof_oneof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_allof_combined_with_anyof_oneof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_allof_combined_with_anyof_oneof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_allof_combined_with_anyof_oneof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_allof_combined_with_anyof_oneof.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostAllofCombinedWithAnyofOneofRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_allof_combined_with_anyof_oneof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_allof_combined_with_anyof_oneof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_allof_combined_with_anyof_oneof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_allof_combined_with_anyof_oneof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_allof_combined_with_anyof_oneof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_allof_combined_with_anyof_oneof_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_allof_combined_with_anyof_oneof_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_request_body/__init__.py deleted file mode 100644 index 00e22cf1437..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_allof_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_ALLOF_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_request_body/post.py deleted file mode 100644 index 172bf601890..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.allof import Allof - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = Allof - - -request_body_allof = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_allof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_allof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_allof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_allof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_allof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_allof.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostAllofRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_allof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_allof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_allof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_allof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_allof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_allof_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_allof_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_request_body/post.pyi deleted file mode 100644 index c81e5055cae..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.allof import Allof - -# body param -SchemaForRequestBodyApplicationJson = Allof - - -request_body_allof = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_allof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_allof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_allof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_allof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_allof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_allof.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostAllofRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_allof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_allof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_allof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_allof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_allof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_allof_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_allof_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_simple_types_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_simple_types_request_body/__init__.py deleted file mode 100644 index 0a136645b84..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_simple_types_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_allof_simple_types_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_ALLOF_SIMPLE_TYPES_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post.py deleted file mode 100644 index 61eb3a05e54..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.allof_simple_types import AllofSimpleTypes - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = AllofSimpleTypes - - -request_body_allof_simple_types = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_allof_simple_types_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_allof_simple_types_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_allof_simple_types_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_allof_simple_types_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_allof_simple_types_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_allof_simple_types.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostAllofSimpleTypesRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_allof_simple_types_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_allof_simple_types_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_allof_simple_types_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_allof_simple_types_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_allof_simple_types_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_allof_simple_types_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_allof_simple_types_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post.pyi deleted file mode 100644 index 4f7e092ea7f..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.allof_simple_types import AllofSimpleTypes - -# body param -SchemaForRequestBodyApplicationJson = AllofSimpleTypes - - -request_body_allof_simple_types = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_allof_simple_types_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_allof_simple_types_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_allof_simple_types_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_allof_simple_types_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_allof_simple_types_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_allof_simple_types.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostAllofSimpleTypesRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_allof_simple_types_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_allof_simple_types_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_allof_simple_types_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_allof_simple_types_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_allof_simple_types_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_allof_simple_types_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_allof_simple_types_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/__init__.py deleted file mode 100644 index 65a8c436dd9..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_allof_with_base_schema_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_ALLOF_WITH_BASE_SCHEMA_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post.py deleted file mode 100644 index 9cba8c53f9d..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.allof_with_base_schema import AllofWithBaseSchema - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = AllofWithBaseSchema - - -request_body_allof_with_base_schema = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_allof_with_base_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_allof_with_base_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_allof_with_base_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_allof_with_base_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_allof_with_base_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_allof_with_base_schema.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostAllofWithBaseSchemaRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_allof_with_base_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_allof_with_base_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_allof_with_base_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_allof_with_base_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_allof_with_base_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_allof_with_base_schema_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_allof_with_base_schema_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post.pyi deleted file mode 100644 index bccddbd496a..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.allof_with_base_schema import AllofWithBaseSchema - -# body param -SchemaForRequestBodyApplicationJson = AllofWithBaseSchema - - -request_body_allof_with_base_schema = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_allof_with_base_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_allof_with_base_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_allof_with_base_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_allof_with_base_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_allof_with_base_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_allof_with_base_schema.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostAllofWithBaseSchemaRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_allof_with_base_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_allof_with_base_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_allof_with_base_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_allof_with_base_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_allof_with_base_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_allof_with_base_schema_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_allof_with_base_schema_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/__init__.py deleted file mode 100644 index 1dcfbcb8c42..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_allof_with_one_empty_schema_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_ALLOF_WITH_ONE_EMPTY_SCHEMA_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post.py deleted file mode 100644 index 0cb60b25a72..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.allof_with_one_empty_schema import AllofWithOneEmptySchema - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = AllofWithOneEmptySchema - - -request_body_allof_with_one_empty_schema = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_allof_with_one_empty_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_allof_with_one_empty_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_allof_with_one_empty_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_allof_with_one_empty_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_allof_with_one_empty_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_allof_with_one_empty_schema.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostAllofWithOneEmptySchemaRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_allof_with_one_empty_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_allof_with_one_empty_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_allof_with_one_empty_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_allof_with_one_empty_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_allof_with_one_empty_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_allof_with_one_empty_schema_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_allof_with_one_empty_schema_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post.pyi deleted file mode 100644 index 029ae069ae1..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.allof_with_one_empty_schema import AllofWithOneEmptySchema - -# body param -SchemaForRequestBodyApplicationJson = AllofWithOneEmptySchema - - -request_body_allof_with_one_empty_schema = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_allof_with_one_empty_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_allof_with_one_empty_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_allof_with_one_empty_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_allof_with_one_empty_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_allof_with_one_empty_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_allof_with_one_empty_schema.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostAllofWithOneEmptySchemaRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_allof_with_one_empty_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_allof_with_one_empty_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_allof_with_one_empty_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_allof_with_one_empty_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_allof_with_one_empty_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_allof_with_one_empty_schema_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_allof_with_one_empty_schema_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/__init__.py deleted file mode 100644 index 404be3a1692..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_allof_with_the_first_empty_schema_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_ALLOF_WITH_THE_FIRST_EMPTY_SCHEMA_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post.py deleted file mode 100644 index 60858c1b0b7..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.allof_with_the_first_empty_schema import AllofWithTheFirstEmptySchema - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = AllofWithTheFirstEmptySchema - - -request_body_allof_with_the_first_empty_schema = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_allof_with_the_first_empty_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_allof_with_the_first_empty_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_allof_with_the_first_empty_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_allof_with_the_first_empty_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_allof_with_the_first_empty_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_allof_with_the_first_empty_schema.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostAllofWithTheFirstEmptySchemaRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_allof_with_the_first_empty_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_allof_with_the_first_empty_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_allof_with_the_first_empty_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_allof_with_the_first_empty_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_allof_with_the_first_empty_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_allof_with_the_first_empty_schema_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_allof_with_the_first_empty_schema_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post.pyi deleted file mode 100644 index 2c1db939373..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.allof_with_the_first_empty_schema import AllofWithTheFirstEmptySchema - -# body param -SchemaForRequestBodyApplicationJson = AllofWithTheFirstEmptySchema - - -request_body_allof_with_the_first_empty_schema = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_allof_with_the_first_empty_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_allof_with_the_first_empty_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_allof_with_the_first_empty_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_allof_with_the_first_empty_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_allof_with_the_first_empty_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_allof_with_the_first_empty_schema.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostAllofWithTheFirstEmptySchemaRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_allof_with_the_first_empty_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_allof_with_the_first_empty_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_allof_with_the_first_empty_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_allof_with_the_first_empty_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_allof_with_the_first_empty_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_allof_with_the_first_empty_schema_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_allof_with_the_first_empty_schema_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/__init__.py deleted file mode 100644 index 19dd1d7abff..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_allof_with_the_last_empty_schema_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_ALLOF_WITH_THE_LAST_EMPTY_SCHEMA_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post.py deleted file mode 100644 index 1acd473d64d..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.allof_with_the_last_empty_schema import AllofWithTheLastEmptySchema - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = AllofWithTheLastEmptySchema - - -request_body_allof_with_the_last_empty_schema = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_allof_with_the_last_empty_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_allof_with_the_last_empty_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_allof_with_the_last_empty_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_allof_with_the_last_empty_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_allof_with_the_last_empty_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_allof_with_the_last_empty_schema.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostAllofWithTheLastEmptySchemaRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_allof_with_the_last_empty_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_allof_with_the_last_empty_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_allof_with_the_last_empty_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_allof_with_the_last_empty_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_allof_with_the_last_empty_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_allof_with_the_last_empty_schema_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_allof_with_the_last_empty_schema_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post.pyi deleted file mode 100644 index 207e2b4c3c0..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.allof_with_the_last_empty_schema import AllofWithTheLastEmptySchema - -# body param -SchemaForRequestBodyApplicationJson = AllofWithTheLastEmptySchema - - -request_body_allof_with_the_last_empty_schema = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_allof_with_the_last_empty_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_allof_with_the_last_empty_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_allof_with_the_last_empty_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_allof_with_the_last_empty_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_allof_with_the_last_empty_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_allof_with_the_last_empty_schema.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostAllofWithTheLastEmptySchemaRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_allof_with_the_last_empty_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_allof_with_the_last_empty_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_allof_with_the_last_empty_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_allof_with_the_last_empty_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_allof_with_the_last_empty_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_allof_with_the_last_empty_schema_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_allof_with_the_last_empty_schema_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/__init__.py deleted file mode 100644 index 9a8175cea1e..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_allof_with_two_empty_schemas_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_ALLOF_WITH_TWO_EMPTY_SCHEMAS_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post.py deleted file mode 100644 index 5f4822f1fbf..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.allof_with_two_empty_schemas import AllofWithTwoEmptySchemas - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = AllofWithTwoEmptySchemas - - -request_body_allof_with_two_empty_schemas = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_allof_with_two_empty_schemas_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_allof_with_two_empty_schemas_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_allof_with_two_empty_schemas_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_allof_with_two_empty_schemas_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_allof_with_two_empty_schemas_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_allof_with_two_empty_schemas.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostAllofWithTwoEmptySchemasRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_allof_with_two_empty_schemas_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_allof_with_two_empty_schemas_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_allof_with_two_empty_schemas_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_allof_with_two_empty_schemas_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_allof_with_two_empty_schemas_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_allof_with_two_empty_schemas_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_allof_with_two_empty_schemas_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post.pyi deleted file mode 100644 index 4d5a90744e1..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.allof_with_two_empty_schemas import AllofWithTwoEmptySchemas - -# body param -SchemaForRequestBodyApplicationJson = AllofWithTwoEmptySchemas - - -request_body_allof_with_two_empty_schemas = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_allof_with_two_empty_schemas_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_allof_with_two_empty_schemas_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_allof_with_two_empty_schemas_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_allof_with_two_empty_schemas_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_allof_with_two_empty_schemas_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_allof_with_two_empty_schemas.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostAllofWithTwoEmptySchemasRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_allof_with_two_empty_schemas_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_allof_with_two_empty_schemas_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_allof_with_two_empty_schemas_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_allof_with_two_empty_schemas_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_allof_with_two_empty_schemas_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_allof_with_two_empty_schemas_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_allof_with_two_empty_schemas_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/__init__.py deleted file mode 100644 index cbd8b46e5a4..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_anyof_complex_types_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_ANYOF_COMPLEX_TYPES_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post.py deleted file mode 100644 index 992598d12db..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.anyof_complex_types import AnyofComplexTypes - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = AnyofComplexTypes - - -request_body_anyof_complex_types = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_anyof_complex_types_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_anyof_complex_types_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_anyof_complex_types_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_anyof_complex_types_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_anyof_complex_types_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_anyof_complex_types.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostAnyofComplexTypesRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_anyof_complex_types_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_anyof_complex_types_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_anyof_complex_types_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_anyof_complex_types_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_anyof_complex_types_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_anyof_complex_types_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_anyof_complex_types_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post.pyi deleted file mode 100644 index b5537f04bc9..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.anyof_complex_types import AnyofComplexTypes - -# body param -SchemaForRequestBodyApplicationJson = AnyofComplexTypes - - -request_body_anyof_complex_types = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_anyof_complex_types_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_anyof_complex_types_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_anyof_complex_types_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_anyof_complex_types_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_anyof_complex_types_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_anyof_complex_types.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostAnyofComplexTypesRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_anyof_complex_types_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_anyof_complex_types_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_anyof_complex_types_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_anyof_complex_types_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_anyof_complex_types_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_anyof_complex_types_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_anyof_complex_types_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_request_body/__init__.py deleted file mode 100644 index b4b0fa5ebe3..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_anyof_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_ANYOF_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_request_body/post.py deleted file mode 100644 index 22da84f83bd..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.anyof import Anyof - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = Anyof - - -request_body_anyof = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_anyof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_anyof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_anyof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_anyof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_anyof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_anyof.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostAnyofRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_anyof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_anyof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_anyof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_anyof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_anyof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_anyof_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_anyof_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_request_body/post.pyi deleted file mode 100644 index 98e7a30aa9c..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.anyof import Anyof - -# body param -SchemaForRequestBodyApplicationJson = Anyof - - -request_body_anyof = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_anyof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_anyof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_anyof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_anyof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_anyof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_anyof.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostAnyofRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_anyof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_anyof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_anyof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_anyof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_anyof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_anyof_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_anyof_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/__init__.py deleted file mode 100644 index 1f25c057036..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_anyof_with_base_schema_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_ANYOF_WITH_BASE_SCHEMA_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post.py deleted file mode 100644 index 99ee2f6a392..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.anyof_with_base_schema import AnyofWithBaseSchema - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = AnyofWithBaseSchema - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_anyof_with_base_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_anyof_with_base_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_anyof_with_base_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_anyof_with_base_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_anyof_with_base_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostAnyofWithBaseSchemaRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_anyof_with_base_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_anyof_with_base_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_anyof_with_base_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_anyof_with_base_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_anyof_with_base_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_anyof_with_base_schema_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_anyof_with_base_schema_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post.pyi deleted file mode 100644 index f13723f0bdc..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.anyof_with_base_schema import AnyofWithBaseSchema - -# body param -SchemaForRequestBodyApplicationJson = AnyofWithBaseSchema - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_anyof_with_base_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_anyof_with_base_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_anyof_with_base_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_anyof_with_base_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_anyof_with_base_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostAnyofWithBaseSchemaRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_anyof_with_base_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_anyof_with_base_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_anyof_with_base_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_anyof_with_base_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_anyof_with_base_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_anyof_with_base_schema_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_anyof_with_base_schema_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/__init__.py deleted file mode 100644 index 7f519de28b5..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_anyof_with_one_empty_schema_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_ANYOF_WITH_ONE_EMPTY_SCHEMA_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post.py deleted file mode 100644 index a4f42f22500..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.anyof_with_one_empty_schema import AnyofWithOneEmptySchema - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = AnyofWithOneEmptySchema - - -request_body_anyof_with_one_empty_schema = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_anyof_with_one_empty_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_anyof_with_one_empty_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_anyof_with_one_empty_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_anyof_with_one_empty_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_anyof_with_one_empty_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_anyof_with_one_empty_schema.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostAnyofWithOneEmptySchemaRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_anyof_with_one_empty_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_anyof_with_one_empty_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_anyof_with_one_empty_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_anyof_with_one_empty_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_anyof_with_one_empty_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_anyof_with_one_empty_schema_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_anyof_with_one_empty_schema_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post.pyi deleted file mode 100644 index e2f21e63eea..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.anyof_with_one_empty_schema import AnyofWithOneEmptySchema - -# body param -SchemaForRequestBodyApplicationJson = AnyofWithOneEmptySchema - - -request_body_anyof_with_one_empty_schema = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_anyof_with_one_empty_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_anyof_with_one_empty_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_anyof_with_one_empty_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_anyof_with_one_empty_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_anyof_with_one_empty_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_anyof_with_one_empty_schema.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostAnyofWithOneEmptySchemaRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_anyof_with_one_empty_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_anyof_with_one_empty_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_anyof_with_one_empty_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_anyof_with_one_empty_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_anyof_with_one_empty_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_anyof_with_one_empty_schema_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_anyof_with_one_empty_schema_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/__init__.py deleted file mode 100644 index 434d64c1f59..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_array_type_matches_arrays_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_ARRAY_TYPE_MATCHES_ARRAYS_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post.py deleted file mode 100644 index e2842e964da..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.array_type_matches_arrays import ArrayTypeMatchesArrays - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = ArrayTypeMatchesArrays - - -request_body_array_type_matches_arrays = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_array_type_matches_arrays_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_array_type_matches_arrays_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_array_type_matches_arrays_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_array_type_matches_arrays_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_array_type_matches_arrays_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_array_type_matches_arrays.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostArrayTypeMatchesArraysRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_array_type_matches_arrays_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_array_type_matches_arrays_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_array_type_matches_arrays_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_array_type_matches_arrays_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_array_type_matches_arrays_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_array_type_matches_arrays_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_array_type_matches_arrays_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post.pyi deleted file mode 100644 index bf141c0602a..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.array_type_matches_arrays import ArrayTypeMatchesArrays - -# body param -SchemaForRequestBodyApplicationJson = ArrayTypeMatchesArrays - - -request_body_array_type_matches_arrays = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_array_type_matches_arrays_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_array_type_matches_arrays_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_array_type_matches_arrays_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_array_type_matches_arrays_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_array_type_matches_arrays_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_array_type_matches_arrays.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostArrayTypeMatchesArraysRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_array_type_matches_arrays_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_array_type_matches_arrays_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_array_type_matches_arrays_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_array_type_matches_arrays_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_array_type_matches_arrays_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_array_type_matches_arrays_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_array_type_matches_arrays_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/__init__.py deleted file mode 100644 index dd529eb0069..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_boolean_type_matches_booleans_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_BOOLEAN_TYPE_MATCHES_BOOLEANS_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post.py deleted file mode 100644 index 876c36a9cb3..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post.py +++ /dev/null @@ -1,300 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = schemas.BoolSchema - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_boolean_type_matches_booleans_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,bool, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_boolean_type_matches_booleans_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,bool, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_boolean_type_matches_booleans_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,bool, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_boolean_type_matches_booleans_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,bool, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_boolean_type_matches_booleans_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,bool, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostBooleanTypeMatchesBooleansRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_boolean_type_matches_booleans_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,bool, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_boolean_type_matches_booleans_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,bool, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_boolean_type_matches_booleans_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,bool, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_boolean_type_matches_booleans_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,bool, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_boolean_type_matches_booleans_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,bool, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_boolean_type_matches_booleans_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,bool, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,bool, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,bool, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,bool, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,bool, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_boolean_type_matches_booleans_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post.pyi deleted file mode 100644 index ef34a83351d..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post.pyi +++ /dev/null @@ -1,295 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -# body param -SchemaForRequestBodyApplicationJson = schemas.BoolSchema - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_boolean_type_matches_booleans_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,bool, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_boolean_type_matches_booleans_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,bool, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_boolean_type_matches_booleans_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,bool, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_boolean_type_matches_booleans_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,bool, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_boolean_type_matches_booleans_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,bool, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostBooleanTypeMatchesBooleansRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_boolean_type_matches_booleans_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,bool, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_boolean_type_matches_booleans_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,bool, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_boolean_type_matches_booleans_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,bool, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_boolean_type_matches_booleans_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,bool, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_boolean_type_matches_booleans_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,bool, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_boolean_type_matches_booleans_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,bool, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,bool, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,bool, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,bool, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,bool, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_boolean_type_matches_booleans_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_int_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_int_request_body/__init__.py deleted file mode 100644 index 1e7404f60cd..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_int_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_by_int_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_BY_INT_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_int_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_int_request_body/post.py deleted file mode 100644 index 583d35bfffb..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_int_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.by_int import ByInt - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = ByInt - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_by_int_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_by_int_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_by_int_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_by_int_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_by_int_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostByIntRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_by_int_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_by_int_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_by_int_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_by_int_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_by_int_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_by_int_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_by_int_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_int_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_int_request_body/post.pyi deleted file mode 100644 index 56679019571..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_int_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.by_int import ByInt - -# body param -SchemaForRequestBodyApplicationJson = ByInt - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_by_int_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_by_int_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_by_int_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_by_int_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_by_int_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostByIntRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_by_int_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_by_int_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_by_int_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_by_int_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_by_int_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_by_int_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_by_int_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_number_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_number_request_body/__init__.py deleted file mode 100644 index f146d05f52d..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_number_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_by_number_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_BY_NUMBER_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_number_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_number_request_body/post.py deleted file mode 100644 index c48e51d55a6..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_number_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.by_number import ByNumber - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = ByNumber - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_by_number_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_by_number_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_by_number_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_by_number_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_by_number_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostByNumberRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_by_number_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_by_number_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_by_number_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_by_number_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_by_number_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_by_number_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_by_number_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_number_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_number_request_body/post.pyi deleted file mode 100644 index 27e71d6dd4d..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_number_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.by_number import ByNumber - -# body param -SchemaForRequestBodyApplicationJson = ByNumber - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_by_number_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_by_number_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_by_number_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_by_number_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_by_number_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostByNumberRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_by_number_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_by_number_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_by_number_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_by_number_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_by_number_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_by_number_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_by_number_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_small_number_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_small_number_request_body/__init__.py deleted file mode 100644 index e3016e6929c..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_small_number_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_by_small_number_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_BY_SMALL_NUMBER_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_small_number_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_small_number_request_body/post.py deleted file mode 100644 index dd8a655b0cd..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_small_number_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.by_small_number import BySmallNumber - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = BySmallNumber - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_by_small_number_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_by_small_number_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_by_small_number_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_by_small_number_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_by_small_number_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostBySmallNumberRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_by_small_number_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_by_small_number_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_by_small_number_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_by_small_number_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_by_small_number_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_by_small_number_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_by_small_number_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_small_number_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_small_number_request_body/post.pyi deleted file mode 100644 index 95e7065dc6e..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_small_number_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.by_small_number import BySmallNumber - -# body param -SchemaForRequestBodyApplicationJson = BySmallNumber - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_by_small_number_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_by_small_number_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_by_small_number_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_by_small_number_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_by_small_number_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostBySmallNumberRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_by_small_number_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_by_small_number_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_by_small_number_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_by_small_number_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_by_small_number_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_by_small_number_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_by_small_number_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_date_time_format_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_date_time_format_request_body/__init__.py deleted file mode 100644 index 54e91fac2c0..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_date_time_format_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_date_time_format_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_DATE_TIME_FORMAT_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_date_time_format_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_date_time_format_request_body/post.py deleted file mode 100644 index 6298f25e742..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_date_time_format_request_body/post.py +++ /dev/null @@ -1,323 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from . import path - -# body param - - -class SchemaForRequestBodyApplicationJson( - schemas.DateTimeBase, - schemas.AnyTypeSchema, -): - - - class MetaOapg: - format = 'date-time' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaForRequestBodyApplicationJson': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_date_time_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_date_time_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_date_time_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_date_time_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_date_time_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostDateTimeFormatRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_date_time_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_date_time_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_date_time_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_date_time_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_date_time_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_date_time_format_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_date_time_format_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_date_time_format_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_date_time_format_request_body/post.pyi deleted file mode 100644 index be17f98e07d..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_date_time_format_request_body/post.pyi +++ /dev/null @@ -1,318 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -# body param - - -class SchemaForRequestBodyApplicationJson( - schemas.DateTimeBase, - schemas.AnyTypeSchema, -): - - - class MetaOapg: - format = 'date-time' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaForRequestBodyApplicationJson': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_date_time_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_date_time_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_date_time_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_date_time_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_date_time_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostDateTimeFormatRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_date_time_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_date_time_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_date_time_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_date_time_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_date_time_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_date_time_format_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_date_time_format_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_email_format_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_email_format_request_body/__init__.py deleted file mode 100644 index ac461d949ee..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_email_format_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_email_format_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_EMAIL_FORMAT_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_email_format_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_email_format_request_body/post.py deleted file mode 100644 index 32b03225435..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_email_format_request_body/post.py +++ /dev/null @@ -1,322 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from . import path - -# body param - - -class SchemaForRequestBodyApplicationJson( - schemas.AnyTypeSchema, -): - - - class MetaOapg: - format = 'email' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaForRequestBodyApplicationJson': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_email_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_email_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_email_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_email_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_email_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostEmailFormatRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_email_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_email_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_email_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_email_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_email_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_email_format_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_email_format_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_email_format_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_email_format_request_body/post.pyi deleted file mode 100644 index a82ce392e60..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_email_format_request_body/post.pyi +++ /dev/null @@ -1,317 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -# body param - - -class SchemaForRequestBodyApplicationJson( - schemas.AnyTypeSchema, -): - - - class MetaOapg: - format = 'email' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaForRequestBodyApplicationJson': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_email_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_email_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_email_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_email_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_email_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostEmailFormatRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_email_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_email_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_email_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_email_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_email_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_email_format_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_email_format_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/__init__.py deleted file mode 100644 index 0d0a92e77a8..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_enum_with0_does_not_match_false_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_ENUM_WITH0DOES_NOT_MATCH_FALSE_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post.py deleted file mode 100644 index c87c81e2a44..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.enum_with0_does_not_match_false import EnumWith0DoesNotMatchFalse - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = EnumWith0DoesNotMatchFalse - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_enum_with0_does_not_match_false_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_enum_with0_does_not_match_false_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_enum_with0_does_not_match_false_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_enum_with0_does_not_match_false_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_enum_with0_does_not_match_false_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostEnumWith0DoesNotMatchFalseRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_enum_with0_does_not_match_false_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_enum_with0_does_not_match_false_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_enum_with0_does_not_match_false_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_enum_with0_does_not_match_false_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_enum_with0_does_not_match_false_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_enum_with0_does_not_match_false_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_enum_with0_does_not_match_false_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post.pyi deleted file mode 100644 index af8dd7481e2..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.enum_with0_does_not_match_false import EnumWith0DoesNotMatchFalse - -# body param -SchemaForRequestBodyApplicationJson = EnumWith0DoesNotMatchFalse - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_enum_with0_does_not_match_false_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_enum_with0_does_not_match_false_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_enum_with0_does_not_match_false_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_enum_with0_does_not_match_false_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_enum_with0_does_not_match_false_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostEnumWith0DoesNotMatchFalseRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_enum_with0_does_not_match_false_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_enum_with0_does_not_match_false_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_enum_with0_does_not_match_false_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_enum_with0_does_not_match_false_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_enum_with0_does_not_match_false_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_enum_with0_does_not_match_false_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_enum_with0_does_not_match_false_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/__init__.py deleted file mode 100644 index ddc8ab96401..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_enum_with1_does_not_match_true_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_ENUM_WITH1DOES_NOT_MATCH_TRUE_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post.py deleted file mode 100644 index ac32cbc5542..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.enum_with1_does_not_match_true import EnumWith1DoesNotMatchTrue - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = EnumWith1DoesNotMatchTrue - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_enum_with1_does_not_match_true_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_enum_with1_does_not_match_true_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_enum_with1_does_not_match_true_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_enum_with1_does_not_match_true_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_enum_with1_does_not_match_true_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostEnumWith1DoesNotMatchTrueRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_enum_with1_does_not_match_true_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_enum_with1_does_not_match_true_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_enum_with1_does_not_match_true_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_enum_with1_does_not_match_true_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_enum_with1_does_not_match_true_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_enum_with1_does_not_match_true_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_enum_with1_does_not_match_true_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post.pyi deleted file mode 100644 index 072bbbbf164..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.enum_with1_does_not_match_true import EnumWith1DoesNotMatchTrue - -# body param -SchemaForRequestBodyApplicationJson = EnumWith1DoesNotMatchTrue - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_enum_with1_does_not_match_true_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_enum_with1_does_not_match_true_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_enum_with1_does_not_match_true_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_enum_with1_does_not_match_true_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_enum_with1_does_not_match_true_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostEnumWith1DoesNotMatchTrueRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_enum_with1_does_not_match_true_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_enum_with1_does_not_match_true_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_enum_with1_does_not_match_true_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_enum_with1_does_not_match_true_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_enum_with1_does_not_match_true_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_enum_with1_does_not_match_true_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_enum_with1_does_not_match_true_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/__init__.py deleted file mode 100644 index 69670a038cc..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_enum_with_escaped_characters_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_ENUM_WITH_ESCAPED_CHARACTERS_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post.py deleted file mode 100644 index 2c83747d7a6..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.enum_with_escaped_characters import EnumWithEscapedCharacters - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = EnumWithEscapedCharacters - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_enum_with_escaped_characters_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_enum_with_escaped_characters_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_enum_with_escaped_characters_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_enum_with_escaped_characters_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_enum_with_escaped_characters_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostEnumWithEscapedCharactersRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_enum_with_escaped_characters_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_enum_with_escaped_characters_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_enum_with_escaped_characters_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_enum_with_escaped_characters_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_enum_with_escaped_characters_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_enum_with_escaped_characters_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_enum_with_escaped_characters_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post.pyi deleted file mode 100644 index ac4b2d2140f..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.enum_with_escaped_characters import EnumWithEscapedCharacters - -# body param -SchemaForRequestBodyApplicationJson = EnumWithEscapedCharacters - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_enum_with_escaped_characters_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_enum_with_escaped_characters_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_enum_with_escaped_characters_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_enum_with_escaped_characters_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_enum_with_escaped_characters_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostEnumWithEscapedCharactersRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_enum_with_escaped_characters_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_enum_with_escaped_characters_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_enum_with_escaped_characters_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_enum_with_escaped_characters_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_enum_with_escaped_characters_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_enum_with_escaped_characters_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_enum_with_escaped_characters_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/__init__.py deleted file mode 100644 index 3d8993bf56e..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_enum_with_false_does_not_match0_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_ENUM_WITH_FALSE_DOES_NOT_MATCH0REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post.py deleted file mode 100644 index fd7cb2b5a77..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.enum_with_false_does_not_match0 import EnumWithFalseDoesNotMatch0 - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = EnumWithFalseDoesNotMatch0 - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_enum_with_false_does_not_match0_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_enum_with_false_does_not_match0_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_enum_with_false_does_not_match0_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_enum_with_false_does_not_match0_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_enum_with_false_does_not_match0_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostEnumWithFalseDoesNotMatch0RequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_enum_with_false_does_not_match0_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_enum_with_false_does_not_match0_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_enum_with_false_does_not_match0_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_enum_with_false_does_not_match0_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_enum_with_false_does_not_match0_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_enum_with_false_does_not_match0_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_enum_with_false_does_not_match0_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post.pyi deleted file mode 100644 index 1762519a557..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.enum_with_false_does_not_match0 import EnumWithFalseDoesNotMatch0 - -# body param -SchemaForRequestBodyApplicationJson = EnumWithFalseDoesNotMatch0 - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_enum_with_false_does_not_match0_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_enum_with_false_does_not_match0_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_enum_with_false_does_not_match0_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_enum_with_false_does_not_match0_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_enum_with_false_does_not_match0_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostEnumWithFalseDoesNotMatch0RequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_enum_with_false_does_not_match0_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_enum_with_false_does_not_match0_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_enum_with_false_does_not_match0_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_enum_with_false_does_not_match0_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_enum_with_false_does_not_match0_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_enum_with_false_does_not_match0_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_enum_with_false_does_not_match0_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/__init__.py deleted file mode 100644 index 7cec94a70c1..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_enum_with_true_does_not_match1_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_ENUM_WITH_TRUE_DOES_NOT_MATCH1REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post.py deleted file mode 100644 index 47c7ab13562..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.enum_with_true_does_not_match1 import EnumWithTrueDoesNotMatch1 - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = EnumWithTrueDoesNotMatch1 - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_enum_with_true_does_not_match1_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_enum_with_true_does_not_match1_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_enum_with_true_does_not_match1_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_enum_with_true_does_not_match1_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_enum_with_true_does_not_match1_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostEnumWithTrueDoesNotMatch1RequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_enum_with_true_does_not_match1_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_enum_with_true_does_not_match1_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_enum_with_true_does_not_match1_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_enum_with_true_does_not_match1_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_enum_with_true_does_not_match1_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_enum_with_true_does_not_match1_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_enum_with_true_does_not_match1_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post.pyi deleted file mode 100644 index c6dd660b93f..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.enum_with_true_does_not_match1 import EnumWithTrueDoesNotMatch1 - -# body param -SchemaForRequestBodyApplicationJson = EnumWithTrueDoesNotMatch1 - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_enum_with_true_does_not_match1_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_enum_with_true_does_not_match1_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_enum_with_true_does_not_match1_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_enum_with_true_does_not_match1_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_enum_with_true_does_not_match1_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostEnumWithTrueDoesNotMatch1RequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_enum_with_true_does_not_match1_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_enum_with_true_does_not_match1_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_enum_with_true_does_not_match1_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_enum_with_true_does_not_match1_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_enum_with_true_does_not_match1_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_enum_with_true_does_not_match1_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_enum_with_true_does_not_match1_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enums_in_properties_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enums_in_properties_request_body/__init__.py deleted file mode 100644 index 9c1d9754609..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enums_in_properties_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_enums_in_properties_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_ENUMS_IN_PROPERTIES_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post.py deleted file mode 100644 index 48ade2c1322..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.enums_in_properties import EnumsInProperties - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = EnumsInProperties - - -request_body_enums_in_properties = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_enums_in_properties_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_enums_in_properties_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_enums_in_properties_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_enums_in_properties_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_enums_in_properties_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_enums_in_properties.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostEnumsInPropertiesRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_enums_in_properties_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_enums_in_properties_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_enums_in_properties_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_enums_in_properties_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_enums_in_properties_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_enums_in_properties_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_enums_in_properties_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post.pyi deleted file mode 100644 index 79d1caa283f..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.enums_in_properties import EnumsInProperties - -# body param -SchemaForRequestBodyApplicationJson = EnumsInProperties - - -request_body_enums_in_properties = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_enums_in_properties_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_enums_in_properties_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_enums_in_properties_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_enums_in_properties_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_enums_in_properties_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_enums_in_properties.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostEnumsInPropertiesRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_enums_in_properties_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_enums_in_properties_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_enums_in_properties_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_enums_in_properties_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_enums_in_properties_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_enums_in_properties_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_enums_in_properties_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_forbidden_property_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_forbidden_property_request_body/__init__.py deleted file mode 100644 index 3d25a7311c0..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_forbidden_property_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_forbidden_property_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_FORBIDDEN_PROPERTY_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_forbidden_property_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_forbidden_property_request_body/post.py deleted file mode 100644 index 91cd9f98522..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_forbidden_property_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.forbidden_property import ForbiddenProperty - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = ForbiddenProperty - - -request_body_forbidden_property = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_forbidden_property_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_forbidden_property_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_forbidden_property_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_forbidden_property_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_forbidden_property_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_forbidden_property.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostForbiddenPropertyRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_forbidden_property_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_forbidden_property_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_forbidden_property_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_forbidden_property_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_forbidden_property_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_forbidden_property_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_forbidden_property_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_forbidden_property_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_forbidden_property_request_body/post.pyi deleted file mode 100644 index 43721a059ab..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_forbidden_property_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.forbidden_property import ForbiddenProperty - -# body param -SchemaForRequestBodyApplicationJson = ForbiddenProperty - - -request_body_forbidden_property = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_forbidden_property_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_forbidden_property_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_forbidden_property_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_forbidden_property_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_forbidden_property_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_forbidden_property.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostForbiddenPropertyRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_forbidden_property_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_forbidden_property_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_forbidden_property_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_forbidden_property_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_forbidden_property_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_forbidden_property_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_forbidden_property_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_hostname_format_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_hostname_format_request_body/__init__.py deleted file mode 100644 index c02c074d762..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_hostname_format_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_hostname_format_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_HOSTNAME_FORMAT_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_hostname_format_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_hostname_format_request_body/post.py deleted file mode 100644 index a02bb9f8b2f..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_hostname_format_request_body/post.py +++ /dev/null @@ -1,322 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from . import path - -# body param - - -class SchemaForRequestBodyApplicationJson( - schemas.AnyTypeSchema, -): - - - class MetaOapg: - format = 'hostname' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaForRequestBodyApplicationJson': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_hostname_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_hostname_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_hostname_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_hostname_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_hostname_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostHostnameFormatRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_hostname_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_hostname_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_hostname_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_hostname_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_hostname_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_hostname_format_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_hostname_format_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_hostname_format_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_hostname_format_request_body/post.pyi deleted file mode 100644 index 036aa7a6ad9..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_hostname_format_request_body/post.pyi +++ /dev/null @@ -1,317 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -# body param - - -class SchemaForRequestBodyApplicationJson( - schemas.AnyTypeSchema, -): - - - class MetaOapg: - format = 'hostname' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaForRequestBodyApplicationJson': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_hostname_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_hostname_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_hostname_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_hostname_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_hostname_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostHostnameFormatRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_hostname_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_hostname_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_hostname_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_hostname_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_hostname_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_hostname_format_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_hostname_format_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/__init__.py deleted file mode 100644 index 4be9e60848d..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_integer_type_matches_integers_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_INTEGER_TYPE_MATCHES_INTEGERS_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post.py deleted file mode 100644 index 74e7fe12ebc..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post.py +++ /dev/null @@ -1,300 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = schemas.IntSchema - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_integer_type_matches_integers_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,decimal.Decimal, int, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_integer_type_matches_integers_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,decimal.Decimal, int, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_integer_type_matches_integers_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,decimal.Decimal, int, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_integer_type_matches_integers_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,decimal.Decimal, int, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_integer_type_matches_integers_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,decimal.Decimal, int, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostIntegerTypeMatchesIntegersRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_integer_type_matches_integers_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,decimal.Decimal, int, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_integer_type_matches_integers_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,decimal.Decimal, int, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_integer_type_matches_integers_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,decimal.Decimal, int, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_integer_type_matches_integers_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,decimal.Decimal, int, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_integer_type_matches_integers_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,decimal.Decimal, int, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_integer_type_matches_integers_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,decimal.Decimal, int, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,decimal.Decimal, int, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,decimal.Decimal, int, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,decimal.Decimal, int, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,decimal.Decimal, int, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_integer_type_matches_integers_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post.pyi deleted file mode 100644 index 4b50872d23a..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post.pyi +++ /dev/null @@ -1,295 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -# body param -SchemaForRequestBodyApplicationJson = schemas.IntSchema - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_integer_type_matches_integers_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,decimal.Decimal, int, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_integer_type_matches_integers_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,decimal.Decimal, int, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_integer_type_matches_integers_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,decimal.Decimal, int, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_integer_type_matches_integers_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,decimal.Decimal, int, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_integer_type_matches_integers_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,decimal.Decimal, int, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostIntegerTypeMatchesIntegersRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_integer_type_matches_integers_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,decimal.Decimal, int, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_integer_type_matches_integers_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,decimal.Decimal, int, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_integer_type_matches_integers_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,decimal.Decimal, int, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_integer_type_matches_integers_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,decimal.Decimal, int, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_integer_type_matches_integers_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,decimal.Decimal, int, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_integer_type_matches_integers_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,decimal.Decimal, int, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,decimal.Decimal, int, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,decimal.Decimal, int, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,decimal.Decimal, int, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,decimal.Decimal, int, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_integer_type_matches_integers_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/__init__.py deleted file mode 100644 index f60497ab737..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_INVALID_INSTANCE_SHOULD_NOT_RAISE_ERROR_WHEN_FLOAT_DIVISION_INF_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post.py deleted file mode 100644 index 50b11235a14..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.invalid_instance_should_not_raise_error_when_float_division_inf import InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post.pyi deleted file mode 100644 index 7384965014d..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.invalid_instance_should_not_raise_error_when_float_division_inf import InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf - -# body param -SchemaForRequestBodyApplicationJson = InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/__init__.py deleted file mode 100644 index b00384bdb15..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_invalid_string_value_for_default_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_INVALID_STRING_VALUE_FOR_DEFAULT_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post.py deleted file mode 100644 index e448ed1f307..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.invalid_string_value_for_default import InvalidStringValueForDefault - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = InvalidStringValueForDefault - - -request_body_invalid_string_value_for_default = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_invalid_string_value_for_default_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_invalid_string_value_for_default_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_invalid_string_value_for_default_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_invalid_string_value_for_default_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_invalid_string_value_for_default_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_invalid_string_value_for_default.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostInvalidStringValueForDefaultRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_invalid_string_value_for_default_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_invalid_string_value_for_default_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_invalid_string_value_for_default_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_invalid_string_value_for_default_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_invalid_string_value_for_default_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_invalid_string_value_for_default_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_invalid_string_value_for_default_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post.pyi deleted file mode 100644 index fc088687730..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.invalid_string_value_for_default import InvalidStringValueForDefault - -# body param -SchemaForRequestBodyApplicationJson = InvalidStringValueForDefault - - -request_body_invalid_string_value_for_default = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_invalid_string_value_for_default_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_invalid_string_value_for_default_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_invalid_string_value_for_default_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_invalid_string_value_for_default_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_invalid_string_value_for_default_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_invalid_string_value_for_default.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostInvalidStringValueForDefaultRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_invalid_string_value_for_default_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_invalid_string_value_for_default_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_invalid_string_value_for_default_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_invalid_string_value_for_default_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_invalid_string_value_for_default_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_invalid_string_value_for_default_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_invalid_string_value_for_default_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv4_format_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv4_format_request_body/__init__.py deleted file mode 100644 index e71b237c897..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv4_format_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_ipv4_format_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_IPV4FORMAT_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv4_format_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv4_format_request_body/post.py deleted file mode 100644 index 76be0693c27..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv4_format_request_body/post.py +++ /dev/null @@ -1,322 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from . import path - -# body param - - -class SchemaForRequestBodyApplicationJson( - schemas.AnyTypeSchema, -): - - - class MetaOapg: - format = 'ipv4' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaForRequestBodyApplicationJson': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_ipv4_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_ipv4_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_ipv4_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_ipv4_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_ipv4_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostIpv4FormatRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_ipv4_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_ipv4_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_ipv4_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_ipv4_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_ipv4_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ipv4_format_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ipv4_format_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv4_format_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv4_format_request_body/post.pyi deleted file mode 100644 index 29353388c41..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv4_format_request_body/post.pyi +++ /dev/null @@ -1,317 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -# body param - - -class SchemaForRequestBodyApplicationJson( - schemas.AnyTypeSchema, -): - - - class MetaOapg: - format = 'ipv4' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaForRequestBodyApplicationJson': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_ipv4_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_ipv4_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_ipv4_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_ipv4_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_ipv4_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostIpv4FormatRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_ipv4_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_ipv4_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_ipv4_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_ipv4_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_ipv4_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ipv4_format_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ipv4_format_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv6_format_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv6_format_request_body/__init__.py deleted file mode 100644 index f9b9074867e..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv6_format_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_ipv6_format_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_IPV6FORMAT_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv6_format_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv6_format_request_body/post.py deleted file mode 100644 index d914c92afb5..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv6_format_request_body/post.py +++ /dev/null @@ -1,322 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from . import path - -# body param - - -class SchemaForRequestBodyApplicationJson( - schemas.AnyTypeSchema, -): - - - class MetaOapg: - format = 'ipv6' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaForRequestBodyApplicationJson': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_ipv6_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_ipv6_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_ipv6_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_ipv6_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_ipv6_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostIpv6FormatRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_ipv6_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_ipv6_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_ipv6_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_ipv6_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_ipv6_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ipv6_format_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ipv6_format_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv6_format_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv6_format_request_body/post.pyi deleted file mode 100644 index 73a32e266d3..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv6_format_request_body/post.pyi +++ /dev/null @@ -1,317 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -# body param - - -class SchemaForRequestBodyApplicationJson( - schemas.AnyTypeSchema, -): - - - class MetaOapg: - format = 'ipv6' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaForRequestBodyApplicationJson': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_ipv6_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_ipv6_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_ipv6_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_ipv6_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_ipv6_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostIpv6FormatRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_ipv6_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_ipv6_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_ipv6_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_ipv6_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_ipv6_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ipv6_format_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ipv6_format_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_json_pointer_format_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_json_pointer_format_request_body/__init__.py deleted file mode 100644 index aed1ba09bc3..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_json_pointer_format_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_json_pointer_format_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_JSON_POINTER_FORMAT_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post.py deleted file mode 100644 index 20b2e21facf..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post.py +++ /dev/null @@ -1,322 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from . import path - -# body param - - -class SchemaForRequestBodyApplicationJson( - schemas.AnyTypeSchema, -): - - - class MetaOapg: - format = 'json-pointer' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaForRequestBodyApplicationJson': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_json_pointer_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_json_pointer_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_json_pointer_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_json_pointer_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_json_pointer_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostJsonPointerFormatRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_json_pointer_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_json_pointer_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_json_pointer_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_json_pointer_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_json_pointer_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_json_pointer_format_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_json_pointer_format_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post.pyi deleted file mode 100644 index 7469997aebe..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post.pyi +++ /dev/null @@ -1,317 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -# body param - - -class SchemaForRequestBodyApplicationJson( - schemas.AnyTypeSchema, -): - - - class MetaOapg: - format = 'json-pointer' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaForRequestBodyApplicationJson': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_json_pointer_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_json_pointer_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_json_pointer_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_json_pointer_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_json_pointer_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostJsonPointerFormatRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_json_pointer_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_json_pointer_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_json_pointer_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_json_pointer_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_json_pointer_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_json_pointer_format_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_json_pointer_format_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_request_body/__init__.py deleted file mode 100644 index 0c3a5424591..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_maximum_validation_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_MAXIMUM_VALIDATION_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_request_body/post.py deleted file mode 100644 index e5314b9f5b5..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.maximum_validation import MaximumValidation - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = MaximumValidation - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_maximum_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_maximum_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_maximum_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_maximum_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_maximum_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostMaximumValidationRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_maximum_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_maximum_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_maximum_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_maximum_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_maximum_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_maximum_validation_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_maximum_validation_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_request_body/post.pyi deleted file mode 100644 index 221f546283b..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.maximum_validation import MaximumValidation - -# body param -SchemaForRequestBodyApplicationJson = MaximumValidation - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_maximum_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_maximum_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_maximum_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_maximum_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_maximum_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostMaximumValidationRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_maximum_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_maximum_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_maximum_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_maximum_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_maximum_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_maximum_validation_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_maximum_validation_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/__init__.py deleted file mode 100644 index 01a0a917a1e..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_maximum_validation_with_unsigned_integer_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_MAXIMUM_VALIDATION_WITH_UNSIGNED_INTEGER_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post.py deleted file mode 100644 index e82db4f3a89..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.maximum_validation_with_unsigned_integer import MaximumValidationWithUnsignedInteger - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = MaximumValidationWithUnsignedInteger - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_maximum_validation_with_unsigned_integer_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_maximum_validation_with_unsigned_integer_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_maximum_validation_with_unsigned_integer_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_maximum_validation_with_unsigned_integer_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_maximum_validation_with_unsigned_integer_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostMaximumValidationWithUnsignedIntegerRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_maximum_validation_with_unsigned_integer_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_maximum_validation_with_unsigned_integer_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_maximum_validation_with_unsigned_integer_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_maximum_validation_with_unsigned_integer_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_maximum_validation_with_unsigned_integer_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_maximum_validation_with_unsigned_integer_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_maximum_validation_with_unsigned_integer_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post.pyi deleted file mode 100644 index c7a3d545fe8..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.maximum_validation_with_unsigned_integer import MaximumValidationWithUnsignedInteger - -# body param -SchemaForRequestBodyApplicationJson = MaximumValidationWithUnsignedInteger - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_maximum_validation_with_unsigned_integer_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_maximum_validation_with_unsigned_integer_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_maximum_validation_with_unsigned_integer_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_maximum_validation_with_unsigned_integer_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_maximum_validation_with_unsigned_integer_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostMaximumValidationWithUnsignedIntegerRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_maximum_validation_with_unsigned_integer_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_maximum_validation_with_unsigned_integer_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_maximum_validation_with_unsigned_integer_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_maximum_validation_with_unsigned_integer_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_maximum_validation_with_unsigned_integer_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_maximum_validation_with_unsigned_integer_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_maximum_validation_with_unsigned_integer_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxitems_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxitems_validation_request_body/__init__.py deleted file mode 100644 index 86e4dc9f146..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxitems_validation_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_maxitems_validation_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_MAXITEMS_VALIDATION_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post.py deleted file mode 100644 index 30149f7f35c..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.maxitems_validation import MaxitemsValidation - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = MaxitemsValidation - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_maxitems_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_maxitems_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_maxitems_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_maxitems_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_maxitems_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostMaxitemsValidationRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_maxitems_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_maxitems_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_maxitems_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_maxitems_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_maxitems_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_maxitems_validation_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_maxitems_validation_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post.pyi deleted file mode 100644 index 4545e992e7f..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.maxitems_validation import MaxitemsValidation - -# body param -SchemaForRequestBodyApplicationJson = MaxitemsValidation - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_maxitems_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_maxitems_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_maxitems_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_maxitems_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_maxitems_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostMaxitemsValidationRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_maxitems_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_maxitems_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_maxitems_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_maxitems_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_maxitems_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_maxitems_validation_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_maxitems_validation_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxlength_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxlength_validation_request_body/__init__.py deleted file mode 100644 index 40b927a792b..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxlength_validation_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_maxlength_validation_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_MAXLENGTH_VALIDATION_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post.py deleted file mode 100644 index 5312eaeead1..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.maxlength_validation import MaxlengthValidation - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = MaxlengthValidation - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_maxlength_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_maxlength_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_maxlength_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_maxlength_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_maxlength_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostMaxlengthValidationRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_maxlength_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_maxlength_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_maxlength_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_maxlength_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_maxlength_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_maxlength_validation_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_maxlength_validation_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post.pyi deleted file mode 100644 index 11014b75597..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.maxlength_validation import MaxlengthValidation - -# body param -SchemaForRequestBodyApplicationJson = MaxlengthValidation - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_maxlength_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_maxlength_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_maxlength_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_maxlength_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_maxlength_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostMaxlengthValidationRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_maxlength_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_maxlength_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_maxlength_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_maxlength_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_maxlength_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_maxlength_validation_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_maxlength_validation_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/__init__.py deleted file mode 100644 index d0abb2424fe..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_maxproperties0_means_the_object_is_empty_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_MAXPROPERTIES0MEANS_THE_OBJECT_IS_EMPTY_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post.py deleted file mode 100644 index db06be2cee3..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.maxproperties0_means_the_object_is_empty import Maxproperties0MeansTheObjectIsEmpty - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = Maxproperties0MeansTheObjectIsEmpty - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_maxproperties0_means_the_object_is_empty_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_maxproperties0_means_the_object_is_empty_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_maxproperties0_means_the_object_is_empty_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_maxproperties0_means_the_object_is_empty_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_maxproperties0_means_the_object_is_empty_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostMaxproperties0MeansTheObjectIsEmptyRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_maxproperties0_means_the_object_is_empty_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_maxproperties0_means_the_object_is_empty_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_maxproperties0_means_the_object_is_empty_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_maxproperties0_means_the_object_is_empty_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_maxproperties0_means_the_object_is_empty_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_maxproperties0_means_the_object_is_empty_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_maxproperties0_means_the_object_is_empty_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post.pyi deleted file mode 100644 index 63dcf2d5e0a..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.maxproperties0_means_the_object_is_empty import Maxproperties0MeansTheObjectIsEmpty - -# body param -SchemaForRequestBodyApplicationJson = Maxproperties0MeansTheObjectIsEmpty - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_maxproperties0_means_the_object_is_empty_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_maxproperties0_means_the_object_is_empty_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_maxproperties0_means_the_object_is_empty_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_maxproperties0_means_the_object_is_empty_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_maxproperties0_means_the_object_is_empty_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostMaxproperties0MeansTheObjectIsEmptyRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_maxproperties0_means_the_object_is_empty_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_maxproperties0_means_the_object_is_empty_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_maxproperties0_means_the_object_is_empty_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_maxproperties0_means_the_object_is_empty_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_maxproperties0_means_the_object_is_empty_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_maxproperties0_means_the_object_is_empty_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_maxproperties0_means_the_object_is_empty_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/__init__.py deleted file mode 100644 index 40f9c621620..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_maxproperties_validation_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_MAXPROPERTIES_VALIDATION_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post.py deleted file mode 100644 index c82334418b8..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.maxproperties_validation import MaxpropertiesValidation - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = MaxpropertiesValidation - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_maxproperties_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_maxproperties_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_maxproperties_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_maxproperties_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_maxproperties_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostMaxpropertiesValidationRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_maxproperties_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_maxproperties_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_maxproperties_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_maxproperties_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_maxproperties_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_maxproperties_validation_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_maxproperties_validation_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post.pyi deleted file mode 100644 index 96f125f032e..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.maxproperties_validation import MaxpropertiesValidation - -# body param -SchemaForRequestBodyApplicationJson = MaxpropertiesValidation - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_maxproperties_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_maxproperties_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_maxproperties_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_maxproperties_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_maxproperties_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostMaxpropertiesValidationRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_maxproperties_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_maxproperties_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_maxproperties_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_maxproperties_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_maxproperties_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_maxproperties_validation_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_maxproperties_validation_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_request_body/__init__.py deleted file mode 100644 index a2ebaf49e20..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_minimum_validation_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_MINIMUM_VALIDATION_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_request_body/post.py deleted file mode 100644 index 5d83fb0c687..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.minimum_validation import MinimumValidation - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = MinimumValidation - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_minimum_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_minimum_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_minimum_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_minimum_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_minimum_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostMinimumValidationRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_minimum_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_minimum_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_minimum_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_minimum_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_minimum_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_minimum_validation_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_minimum_validation_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_request_body/post.pyi deleted file mode 100644 index 4ea64ba9efd..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.minimum_validation import MinimumValidation - -# body param -SchemaForRequestBodyApplicationJson = MinimumValidation - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_minimum_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_minimum_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_minimum_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_minimum_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_minimum_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostMinimumValidationRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_minimum_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_minimum_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_minimum_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_minimum_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_minimum_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_minimum_validation_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_minimum_validation_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/__init__.py deleted file mode 100644 index 55f61d940e1..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_minimum_validation_with_signed_integer_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_MINIMUM_VALIDATION_WITH_SIGNED_INTEGER_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post.py deleted file mode 100644 index 99ce543ccd9..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.minimum_validation_with_signed_integer import MinimumValidationWithSignedInteger - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = MinimumValidationWithSignedInteger - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_minimum_validation_with_signed_integer_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_minimum_validation_with_signed_integer_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_minimum_validation_with_signed_integer_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_minimum_validation_with_signed_integer_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_minimum_validation_with_signed_integer_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostMinimumValidationWithSignedIntegerRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_minimum_validation_with_signed_integer_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_minimum_validation_with_signed_integer_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_minimum_validation_with_signed_integer_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_minimum_validation_with_signed_integer_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_minimum_validation_with_signed_integer_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_minimum_validation_with_signed_integer_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_minimum_validation_with_signed_integer_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post.pyi deleted file mode 100644 index b256a9dbcd9..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.minimum_validation_with_signed_integer import MinimumValidationWithSignedInteger - -# body param -SchemaForRequestBodyApplicationJson = MinimumValidationWithSignedInteger - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_minimum_validation_with_signed_integer_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_minimum_validation_with_signed_integer_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_minimum_validation_with_signed_integer_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_minimum_validation_with_signed_integer_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_minimum_validation_with_signed_integer_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostMinimumValidationWithSignedIntegerRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_minimum_validation_with_signed_integer_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_minimum_validation_with_signed_integer_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_minimum_validation_with_signed_integer_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_minimum_validation_with_signed_integer_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_minimum_validation_with_signed_integer_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_minimum_validation_with_signed_integer_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_minimum_validation_with_signed_integer_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minitems_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minitems_validation_request_body/__init__.py deleted file mode 100644 index d4df22e9047..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minitems_validation_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_minitems_validation_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_MINITEMS_VALIDATION_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minitems_validation_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minitems_validation_request_body/post.py deleted file mode 100644 index e27d10abbc4..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minitems_validation_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.minitems_validation import MinitemsValidation - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = MinitemsValidation - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_minitems_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_minitems_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_minitems_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_minitems_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_minitems_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostMinitemsValidationRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_minitems_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_minitems_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_minitems_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_minitems_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_minitems_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_minitems_validation_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_minitems_validation_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minitems_validation_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minitems_validation_request_body/post.pyi deleted file mode 100644 index 9d7d5454f17..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minitems_validation_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.minitems_validation import MinitemsValidation - -# body param -SchemaForRequestBodyApplicationJson = MinitemsValidation - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_minitems_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_minitems_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_minitems_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_minitems_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_minitems_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostMinitemsValidationRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_minitems_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_minitems_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_minitems_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_minitems_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_minitems_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_minitems_validation_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_minitems_validation_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minlength_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minlength_validation_request_body/__init__.py deleted file mode 100644 index b68e6e60ee2..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minlength_validation_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_minlength_validation_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_MINLENGTH_VALIDATION_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minlength_validation_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minlength_validation_request_body/post.py deleted file mode 100644 index e7fb74b29b7..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minlength_validation_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.minlength_validation import MinlengthValidation - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = MinlengthValidation - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_minlength_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_minlength_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_minlength_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_minlength_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_minlength_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostMinlengthValidationRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_minlength_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_minlength_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_minlength_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_minlength_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_minlength_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_minlength_validation_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_minlength_validation_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minlength_validation_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minlength_validation_request_body/post.pyi deleted file mode 100644 index cc3eec06714..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minlength_validation_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.minlength_validation import MinlengthValidation - -# body param -SchemaForRequestBodyApplicationJson = MinlengthValidation - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_minlength_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_minlength_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_minlength_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_minlength_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_minlength_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostMinlengthValidationRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_minlength_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_minlength_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_minlength_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_minlength_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_minlength_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_minlength_validation_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_minlength_validation_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minproperties_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minproperties_validation_request_body/__init__.py deleted file mode 100644 index b76e1db9aae..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minproperties_validation_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_minproperties_validation_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_MINPROPERTIES_VALIDATION_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post.py deleted file mode 100644 index bfa4fac8eaf..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.minproperties_validation import MinpropertiesValidation - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = MinpropertiesValidation - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_minproperties_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_minproperties_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_minproperties_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_minproperties_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_minproperties_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostMinpropertiesValidationRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_minproperties_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_minproperties_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_minproperties_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_minproperties_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_minproperties_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_minproperties_validation_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_minproperties_validation_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post.pyi deleted file mode 100644 index e28e5f4e532..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.minproperties_validation import MinpropertiesValidation - -# body param -SchemaForRequestBodyApplicationJson = MinpropertiesValidation - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_minproperties_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_minproperties_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_minproperties_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_minproperties_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_minproperties_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostMinpropertiesValidationRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_minproperties_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_minproperties_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_minproperties_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_minproperties_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_minproperties_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_minproperties_validation_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_minproperties_validation_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/__init__.py deleted file mode 100644 index 6c1f7d73a44..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_nested_allof_to_check_validation_semantics_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_NESTED_ALLOF_TO_CHECK_VALIDATION_SEMANTICS_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post.py deleted file mode 100644 index 9cbc5724df2..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.nested_allof_to_check_validation_semantics import NestedAllofToCheckValidationSemantics - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = NestedAllofToCheckValidationSemantics - - -request_body_nested_allof_to_check_validation_semantics = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_nested_allof_to_check_validation_semantics_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_nested_allof_to_check_validation_semantics_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_nested_allof_to_check_validation_semantics_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_nested_allof_to_check_validation_semantics_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_nested_allof_to_check_validation_semantics_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_nested_allof_to_check_validation_semantics.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostNestedAllofToCheckValidationSemanticsRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_nested_allof_to_check_validation_semantics_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_nested_allof_to_check_validation_semantics_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_nested_allof_to_check_validation_semantics_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_nested_allof_to_check_validation_semantics_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_nested_allof_to_check_validation_semantics_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_nested_allof_to_check_validation_semantics_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_nested_allof_to_check_validation_semantics_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post.pyi deleted file mode 100644 index ee247b34f97..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.nested_allof_to_check_validation_semantics import NestedAllofToCheckValidationSemantics - -# body param -SchemaForRequestBodyApplicationJson = NestedAllofToCheckValidationSemantics - - -request_body_nested_allof_to_check_validation_semantics = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_nested_allof_to_check_validation_semantics_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_nested_allof_to_check_validation_semantics_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_nested_allof_to_check_validation_semantics_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_nested_allof_to_check_validation_semantics_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_nested_allof_to_check_validation_semantics_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_nested_allof_to_check_validation_semantics.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostNestedAllofToCheckValidationSemanticsRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_nested_allof_to_check_validation_semantics_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_nested_allof_to_check_validation_semantics_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_nested_allof_to_check_validation_semantics_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_nested_allof_to_check_validation_semantics_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_nested_allof_to_check_validation_semantics_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_nested_allof_to_check_validation_semantics_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_nested_allof_to_check_validation_semantics_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/__init__.py deleted file mode 100644 index e7b3408e53d..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_nested_anyof_to_check_validation_semantics_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_NESTED_ANYOF_TO_CHECK_VALIDATION_SEMANTICS_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post.py deleted file mode 100644 index 11756e52963..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.nested_anyof_to_check_validation_semantics import NestedAnyofToCheckValidationSemantics - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = NestedAnyofToCheckValidationSemantics - - -request_body_nested_anyof_to_check_validation_semantics = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_nested_anyof_to_check_validation_semantics_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_nested_anyof_to_check_validation_semantics_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_nested_anyof_to_check_validation_semantics_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_nested_anyof_to_check_validation_semantics_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_nested_anyof_to_check_validation_semantics_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_nested_anyof_to_check_validation_semantics.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostNestedAnyofToCheckValidationSemanticsRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_nested_anyof_to_check_validation_semantics_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_nested_anyof_to_check_validation_semantics_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_nested_anyof_to_check_validation_semantics_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_nested_anyof_to_check_validation_semantics_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_nested_anyof_to_check_validation_semantics_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_nested_anyof_to_check_validation_semantics_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_nested_anyof_to_check_validation_semantics_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post.pyi deleted file mode 100644 index 92880350b13..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.nested_anyof_to_check_validation_semantics import NestedAnyofToCheckValidationSemantics - -# body param -SchemaForRequestBodyApplicationJson = NestedAnyofToCheckValidationSemantics - - -request_body_nested_anyof_to_check_validation_semantics = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_nested_anyof_to_check_validation_semantics_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_nested_anyof_to_check_validation_semantics_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_nested_anyof_to_check_validation_semantics_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_nested_anyof_to_check_validation_semantics_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_nested_anyof_to_check_validation_semantics_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_nested_anyof_to_check_validation_semantics.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostNestedAnyofToCheckValidationSemanticsRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_nested_anyof_to_check_validation_semantics_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_nested_anyof_to_check_validation_semantics_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_nested_anyof_to_check_validation_semantics_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_nested_anyof_to_check_validation_semantics_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_nested_anyof_to_check_validation_semantics_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_nested_anyof_to_check_validation_semantics_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_nested_anyof_to_check_validation_semantics_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_items_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_items_request_body/__init__.py deleted file mode 100644 index b38abd53421..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_items_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_nested_items_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_NESTED_ITEMS_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_items_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_items_request_body/post.py deleted file mode 100644 index e92ec5f89e0..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_items_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.nested_items import NestedItems - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = NestedItems - - -request_body_nested_items = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_nested_items_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_nested_items_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_nested_items_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_nested_items_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_nested_items_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_nested_items.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostNestedItemsRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_nested_items_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_nested_items_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_nested_items_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_nested_items_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_nested_items_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_nested_items_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_nested_items_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_items_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_items_request_body/post.pyi deleted file mode 100644 index ab1ec318a3c..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_items_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.nested_items import NestedItems - -# body param -SchemaForRequestBodyApplicationJson = NestedItems - - -request_body_nested_items = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_nested_items_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_nested_items_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_nested_items_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_nested_items_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_nested_items_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_nested_items.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostNestedItemsRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_nested_items_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_nested_items_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_nested_items_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_nested_items_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_nested_items_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_nested_items_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_nested_items_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/__init__.py deleted file mode 100644 index 8a24e9c066c..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_nested_oneof_to_check_validation_semantics_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_NESTED_ONEOF_TO_CHECK_VALIDATION_SEMANTICS_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post.py deleted file mode 100644 index 3bda1415937..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.nested_oneof_to_check_validation_semantics import NestedOneofToCheckValidationSemantics - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = NestedOneofToCheckValidationSemantics - - -request_body_nested_oneof_to_check_validation_semantics = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_nested_oneof_to_check_validation_semantics_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_nested_oneof_to_check_validation_semantics_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_nested_oneof_to_check_validation_semantics_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_nested_oneof_to_check_validation_semantics_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_nested_oneof_to_check_validation_semantics_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_nested_oneof_to_check_validation_semantics.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostNestedOneofToCheckValidationSemanticsRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_nested_oneof_to_check_validation_semantics_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_nested_oneof_to_check_validation_semantics_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_nested_oneof_to_check_validation_semantics_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_nested_oneof_to_check_validation_semantics_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_nested_oneof_to_check_validation_semantics_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_nested_oneof_to_check_validation_semantics_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_nested_oneof_to_check_validation_semantics_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post.pyi deleted file mode 100644 index 4fa8b0a4282..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.nested_oneof_to_check_validation_semantics import NestedOneofToCheckValidationSemantics - -# body param -SchemaForRequestBodyApplicationJson = NestedOneofToCheckValidationSemantics - - -request_body_nested_oneof_to_check_validation_semantics = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_nested_oneof_to_check_validation_semantics_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_nested_oneof_to_check_validation_semantics_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_nested_oneof_to_check_validation_semantics_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_nested_oneof_to_check_validation_semantics_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_nested_oneof_to_check_validation_semantics_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_nested_oneof_to_check_validation_semantics.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostNestedOneofToCheckValidationSemanticsRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_nested_oneof_to_check_validation_semantics_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_nested_oneof_to_check_validation_semantics_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_nested_oneof_to_check_validation_semantics_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_nested_oneof_to_check_validation_semantics_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_nested_oneof_to_check_validation_semantics_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_nested_oneof_to_check_validation_semantics_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_nested_oneof_to_check_validation_semantics_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/__init__.py deleted file mode 100644 index c4fccb535c0..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_not_more_complex_schema_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_NOT_MORE_COMPLEX_SCHEMA_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post.py deleted file mode 100644 index 719decbae1e..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post.py +++ /dev/null @@ -1,371 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from . import path - -# body param - - -class SchemaForRequestBodyApplicationJson( - schemas.ComposedSchema, -): - - - class MetaOapg: - - - class not_schema( - schemas.DictSchema - ): - - - class MetaOapg: - - class properties: - foo = schemas.StrSchema - __annotations__ = { - "foo": foo, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["foo", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["foo"]) -> typing.Union[MetaOapg.properties.foo, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["foo", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - foo: typing.Union[MetaOapg.properties.foo, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'not_schema': - return super().__new__( - cls, - *_args, - foo=foo, - _configuration=_configuration, - **kwargs, - ) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaForRequestBodyApplicationJson': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_not_more_complex_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_not_more_complex_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_not_more_complex_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_not_more_complex_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_not_more_complex_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostNotMoreComplexSchemaRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_not_more_complex_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_not_more_complex_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_not_more_complex_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_not_more_complex_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_not_more_complex_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_not_more_complex_schema_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_not_more_complex_schema_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post.pyi deleted file mode 100644 index dd9a4054ab2..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post.pyi +++ /dev/null @@ -1,366 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -# body param - - -class SchemaForRequestBodyApplicationJson( - schemas.ComposedSchema, -): - - - class MetaOapg: - - - class not_schema( - schemas.DictSchema - ): - - - class MetaOapg: - - class properties: - foo = schemas.StrSchema - __annotations__ = { - "foo": foo, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["foo", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["foo"]) -> typing.Union[MetaOapg.properties.foo, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["foo", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - foo: typing.Union[MetaOapg.properties.foo, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'not_schema': - return super().__new__( - cls, - *_args, - foo=foo, - _configuration=_configuration, - **kwargs, - ) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaForRequestBodyApplicationJson': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_not_more_complex_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_not_more_complex_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_not_more_complex_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_not_more_complex_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_not_more_complex_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostNotMoreComplexSchemaRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_not_more_complex_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_not_more_complex_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_not_more_complex_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_not_more_complex_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_not_more_complex_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_not_more_complex_schema_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_not_more_complex_schema_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_request_body/__init__.py deleted file mode 100644 index f37c1cc913e..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_not_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_NOT_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_request_body/post.py deleted file mode 100644 index e7e0e620302..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_request_body/post.py +++ /dev/null @@ -1,322 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from . import path - -# body param - - -class SchemaForRequestBodyApplicationJson( - schemas.ComposedSchema, -): - - - class MetaOapg: - not_schema = schemas.IntSchema - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaForRequestBodyApplicationJson': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_not_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_not_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_not_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_not_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_not_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostNotRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_not_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_not_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_not_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_not_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_not_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_not_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_not_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_request_body/post.pyi deleted file mode 100644 index c1aba246f6d..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_request_body/post.pyi +++ /dev/null @@ -1,317 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -# body param - - -class SchemaForRequestBodyApplicationJson( - schemas.ComposedSchema, -): - - - class MetaOapg: - not_schema = schemas.IntSchema - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaForRequestBodyApplicationJson': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_not_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_not_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_not_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_not_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_not_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostNotRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_not_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_not_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_not_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_not_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_not_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_not_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_not_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/__init__.py deleted file mode 100644 index a6d59aa973d..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_nul_characters_in_strings_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_NUL_CHARACTERS_IN_STRINGS_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post.py deleted file mode 100644 index 0c7f440c708..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.nul_characters_in_strings import NulCharactersInStrings - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = NulCharactersInStrings - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_nul_characters_in_strings_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_nul_characters_in_strings_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_nul_characters_in_strings_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_nul_characters_in_strings_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_nul_characters_in_strings_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostNulCharactersInStringsRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_nul_characters_in_strings_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_nul_characters_in_strings_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_nul_characters_in_strings_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_nul_characters_in_strings_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_nul_characters_in_strings_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_nul_characters_in_strings_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_nul_characters_in_strings_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post.pyi deleted file mode 100644 index cbf4486797f..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.nul_characters_in_strings import NulCharactersInStrings - -# body param -SchemaForRequestBodyApplicationJson = NulCharactersInStrings - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_nul_characters_in_strings_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_nul_characters_in_strings_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_nul_characters_in_strings_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_nul_characters_in_strings_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_nul_characters_in_strings_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostNulCharactersInStringsRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_nul_characters_in_strings_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_nul_characters_in_strings_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_nul_characters_in_strings_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_nul_characters_in_strings_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_nul_characters_in_strings_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_nul_characters_in_strings_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_nul_characters_in_strings_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/__init__.py deleted file mode 100644 index c4be57a9447..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_null_type_matches_only_the_null_object_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_NULL_TYPE_MATCHES_ONLY_THE_NULL_OBJECT_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post.py deleted file mode 100644 index 56b091985c6..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post.py +++ /dev/null @@ -1,300 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = schemas.NoneSchema - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_null_type_matches_only_the_null_object_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,None, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_null_type_matches_only_the_null_object_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,None, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_null_type_matches_only_the_null_object_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,None, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_null_type_matches_only_the_null_object_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,None, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_null_type_matches_only_the_null_object_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,None, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostNullTypeMatchesOnlyTheNullObjectRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_null_type_matches_only_the_null_object_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,None, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_null_type_matches_only_the_null_object_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,None, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_null_type_matches_only_the_null_object_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,None, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_null_type_matches_only_the_null_object_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,None, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_null_type_matches_only_the_null_object_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,None, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_null_type_matches_only_the_null_object_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,None, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,None, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,None, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,None, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,None, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_null_type_matches_only_the_null_object_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post.pyi deleted file mode 100644 index 4da5c4f7002..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post.pyi +++ /dev/null @@ -1,295 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -# body param -SchemaForRequestBodyApplicationJson = schemas.NoneSchema - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_null_type_matches_only_the_null_object_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,None, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_null_type_matches_only_the_null_object_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,None, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_null_type_matches_only_the_null_object_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,None, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_null_type_matches_only_the_null_object_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,None, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_null_type_matches_only_the_null_object_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,None, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostNullTypeMatchesOnlyTheNullObjectRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_null_type_matches_only_the_null_object_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,None, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_null_type_matches_only_the_null_object_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,None, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_null_type_matches_only_the_null_object_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,None, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_null_type_matches_only_the_null_object_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,None, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_null_type_matches_only_the_null_object_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,None, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_null_type_matches_only_the_null_object_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,None, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,None, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,None, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,None, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,None, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_null_type_matches_only_the_null_object_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/__init__.py deleted file mode 100644 index b95a838eacb..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_number_type_matches_numbers_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_NUMBER_TYPE_MATCHES_NUMBERS_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post.py deleted file mode 100644 index 1423f642119..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post.py +++ /dev/null @@ -1,300 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = schemas.NumberSchema - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_number_type_matches_numbers_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,decimal.Decimal, int, float, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_number_type_matches_numbers_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,decimal.Decimal, int, float, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_number_type_matches_numbers_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,decimal.Decimal, int, float, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_number_type_matches_numbers_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,decimal.Decimal, int, float, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_number_type_matches_numbers_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,decimal.Decimal, int, float, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostNumberTypeMatchesNumbersRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_number_type_matches_numbers_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,decimal.Decimal, int, float, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_number_type_matches_numbers_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,decimal.Decimal, int, float, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_number_type_matches_numbers_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,decimal.Decimal, int, float, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_number_type_matches_numbers_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,decimal.Decimal, int, float, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_number_type_matches_numbers_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,decimal.Decimal, int, float, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_number_type_matches_numbers_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,decimal.Decimal, int, float, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,decimal.Decimal, int, float, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,decimal.Decimal, int, float, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,decimal.Decimal, int, float, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,decimal.Decimal, int, float, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_number_type_matches_numbers_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post.pyi deleted file mode 100644 index ff7cb65e909..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post.pyi +++ /dev/null @@ -1,295 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -# body param -SchemaForRequestBodyApplicationJson = schemas.NumberSchema - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_number_type_matches_numbers_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,decimal.Decimal, int, float, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_number_type_matches_numbers_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,decimal.Decimal, int, float, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_number_type_matches_numbers_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,decimal.Decimal, int, float, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_number_type_matches_numbers_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,decimal.Decimal, int, float, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_number_type_matches_numbers_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,decimal.Decimal, int, float, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostNumberTypeMatchesNumbersRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_number_type_matches_numbers_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,decimal.Decimal, int, float, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_number_type_matches_numbers_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,decimal.Decimal, int, float, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_number_type_matches_numbers_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,decimal.Decimal, int, float, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_number_type_matches_numbers_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,decimal.Decimal, int, float, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_number_type_matches_numbers_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,decimal.Decimal, int, float, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_number_type_matches_numbers_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,decimal.Decimal, int, float, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,decimal.Decimal, int, float, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,decimal.Decimal, int, float, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,decimal.Decimal, int, float, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,decimal.Decimal, int, float, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_number_type_matches_numbers_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_properties_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_properties_validation_request_body/__init__.py deleted file mode 100644 index d7d33f2aef2..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_properties_validation_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_object_properties_validation_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_OBJECT_PROPERTIES_VALIDATION_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post.py deleted file mode 100644 index 41241c760da..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.object_properties_validation import ObjectPropertiesValidation - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = ObjectPropertiesValidation - - -request_body_object_properties_validation = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_object_properties_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_object_properties_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_object_properties_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_object_properties_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_object_properties_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_object_properties_validation.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostObjectPropertiesValidationRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_object_properties_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_object_properties_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_object_properties_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_object_properties_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_object_properties_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_object_properties_validation_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_object_properties_validation_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post.pyi deleted file mode 100644 index 95a3ee82309..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.object_properties_validation import ObjectPropertiesValidation - -# body param -SchemaForRequestBodyApplicationJson = ObjectPropertiesValidation - - -request_body_object_properties_validation = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_object_properties_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_object_properties_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_object_properties_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_object_properties_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_object_properties_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_object_properties_validation.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostObjectPropertiesValidationRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_object_properties_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_object_properties_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_object_properties_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_object_properties_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_object_properties_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_object_properties_validation_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_object_properties_validation_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/__init__.py deleted file mode 100644 index d125b30a97e..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_object_type_matches_objects_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_OBJECT_TYPE_MATCHES_OBJECTS_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post.py deleted file mode 100644 index 911273486be..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post.py +++ /dev/null @@ -1,300 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = schemas.DictSchema - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_object_type_matches_objects_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_object_type_matches_objects_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_object_type_matches_objects_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_object_type_matches_objects_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_object_type_matches_objects_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostObjectTypeMatchesObjectsRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_object_type_matches_objects_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_object_type_matches_objects_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_object_type_matches_objects_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_object_type_matches_objects_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_object_type_matches_objects_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_object_type_matches_objects_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_object_type_matches_objects_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post.pyi deleted file mode 100644 index a044e862a33..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post.pyi +++ /dev/null @@ -1,295 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -# body param -SchemaForRequestBodyApplicationJson = schemas.DictSchema - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_object_type_matches_objects_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_object_type_matches_objects_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_object_type_matches_objects_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_object_type_matches_objects_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_object_type_matches_objects_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostObjectTypeMatchesObjectsRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_object_type_matches_objects_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_object_type_matches_objects_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_object_type_matches_objects_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_object_type_matches_objects_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_object_type_matches_objects_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_object_type_matches_objects_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_object_type_matches_objects_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/__init__.py deleted file mode 100644 index 1b089b411fd..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_oneof_complex_types_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_ONEOF_COMPLEX_TYPES_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post.py deleted file mode 100644 index fe4d050911d..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.oneof_complex_types import OneofComplexTypes - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = OneofComplexTypes - - -request_body_oneof_complex_types = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_oneof_complex_types_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_oneof_complex_types_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_oneof_complex_types_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_oneof_complex_types_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_oneof_complex_types_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_oneof_complex_types.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostOneofComplexTypesRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_oneof_complex_types_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_oneof_complex_types_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_oneof_complex_types_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_oneof_complex_types_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_oneof_complex_types_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_oneof_complex_types_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_oneof_complex_types_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post.pyi deleted file mode 100644 index 75c8162380c..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.oneof_complex_types import OneofComplexTypes - -# body param -SchemaForRequestBodyApplicationJson = OneofComplexTypes - - -request_body_oneof_complex_types = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_oneof_complex_types_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_oneof_complex_types_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_oneof_complex_types_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_oneof_complex_types_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_oneof_complex_types_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_oneof_complex_types.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostOneofComplexTypesRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_oneof_complex_types_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_oneof_complex_types_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_oneof_complex_types_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_oneof_complex_types_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_oneof_complex_types_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_oneof_complex_types_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_oneof_complex_types_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_request_body/__init__.py deleted file mode 100644 index c19aa40ea94..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_oneof_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_ONEOF_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_request_body/post.py deleted file mode 100644 index 43ccc249302..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.oneof import Oneof - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = Oneof - - -request_body_oneof = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_oneof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_oneof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_oneof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_oneof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_oneof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_oneof.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostOneofRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_oneof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_oneof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_oneof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_oneof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_oneof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_oneof_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_oneof_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_request_body/post.pyi deleted file mode 100644 index a97c6e2446f..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.oneof import Oneof - -# body param -SchemaForRequestBodyApplicationJson = Oneof - - -request_body_oneof = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_oneof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_oneof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_oneof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_oneof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_oneof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_oneof.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostOneofRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_oneof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_oneof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_oneof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_oneof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_oneof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_oneof_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_oneof_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/__init__.py deleted file mode 100644 index 605ed77fbeb..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_oneof_with_base_schema_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_ONEOF_WITH_BASE_SCHEMA_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post.py deleted file mode 100644 index e544c6ff49e..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.oneof_with_base_schema import OneofWithBaseSchema - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = OneofWithBaseSchema - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_oneof_with_base_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_oneof_with_base_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_oneof_with_base_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_oneof_with_base_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_oneof_with_base_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostOneofWithBaseSchemaRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_oneof_with_base_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_oneof_with_base_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_oneof_with_base_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_oneof_with_base_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_oneof_with_base_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_oneof_with_base_schema_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_oneof_with_base_schema_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post.pyi deleted file mode 100644 index a746f7a0d76..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.oneof_with_base_schema import OneofWithBaseSchema - -# body param -SchemaForRequestBodyApplicationJson = OneofWithBaseSchema - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_oneof_with_base_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_oneof_with_base_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_oneof_with_base_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_oneof_with_base_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_oneof_with_base_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostOneofWithBaseSchemaRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_oneof_with_base_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_oneof_with_base_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_oneof_with_base_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_oneof_with_base_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_oneof_with_base_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_oneof_with_base_schema_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_oneof_with_base_schema_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/__init__.py deleted file mode 100644 index ba897616f78..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_oneof_with_empty_schema_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_ONEOF_WITH_EMPTY_SCHEMA_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post.py deleted file mode 100644 index fdbf4b27853..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.oneof_with_empty_schema import OneofWithEmptySchema - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = OneofWithEmptySchema - - -request_body_oneof_with_empty_schema = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_oneof_with_empty_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_oneof_with_empty_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_oneof_with_empty_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_oneof_with_empty_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_oneof_with_empty_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_oneof_with_empty_schema.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostOneofWithEmptySchemaRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_oneof_with_empty_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_oneof_with_empty_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_oneof_with_empty_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_oneof_with_empty_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_oneof_with_empty_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_oneof_with_empty_schema_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_oneof_with_empty_schema_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post.pyi deleted file mode 100644 index d8fc0e2bd0c..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.oneof_with_empty_schema import OneofWithEmptySchema - -# body param -SchemaForRequestBodyApplicationJson = OneofWithEmptySchema - - -request_body_oneof_with_empty_schema = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_oneof_with_empty_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_oneof_with_empty_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_oneof_with_empty_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_oneof_with_empty_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_oneof_with_empty_schema_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_oneof_with_empty_schema.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostOneofWithEmptySchemaRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_oneof_with_empty_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_oneof_with_empty_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_oneof_with_empty_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_oneof_with_empty_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_oneof_with_empty_schema_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_oneof_with_empty_schema_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_oneof_with_empty_schema_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_required_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_required_request_body/__init__.py deleted file mode 100644 index 748f67c50b3..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_required_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_oneof_with_required_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_ONEOF_WITH_REQUIRED_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post.py deleted file mode 100644 index 96b14ac5e38..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.oneof_with_required import OneofWithRequired - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = OneofWithRequired - - -request_body_oneof_with_required = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_oneof_with_required_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_oneof_with_required_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_oneof_with_required_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_oneof_with_required_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_oneof_with_required_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_oneof_with_required.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostOneofWithRequiredRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_oneof_with_required_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_oneof_with_required_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_oneof_with_required_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_oneof_with_required_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_oneof_with_required_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_oneof_with_required_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_oneof_with_required_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post.pyi deleted file mode 100644 index f8aa54fb070..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.oneof_with_required import OneofWithRequired - -# body param -SchemaForRequestBodyApplicationJson = OneofWithRequired - - -request_body_oneof_with_required = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_oneof_with_required_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_oneof_with_required_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_oneof_with_required_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_oneof_with_required_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_oneof_with_required_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_oneof_with_required.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostOneofWithRequiredRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_oneof_with_required_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_oneof_with_required_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_oneof_with_required_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_oneof_with_required_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_oneof_with_required_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_oneof_with_required_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_oneof_with_required_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/__init__.py deleted file mode 100644 index 30f8d5d82d9..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_pattern_is_not_anchored_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_PATTERN_IS_NOT_ANCHORED_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post.py deleted file mode 100644 index 61694587558..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.pattern_is_not_anchored import PatternIsNotAnchored - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = PatternIsNotAnchored - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_pattern_is_not_anchored_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_pattern_is_not_anchored_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_pattern_is_not_anchored_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_pattern_is_not_anchored_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_pattern_is_not_anchored_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostPatternIsNotAnchoredRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_pattern_is_not_anchored_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_pattern_is_not_anchored_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_pattern_is_not_anchored_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_pattern_is_not_anchored_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_pattern_is_not_anchored_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_pattern_is_not_anchored_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_pattern_is_not_anchored_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post.pyi deleted file mode 100644 index d189f268f14..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.pattern_is_not_anchored import PatternIsNotAnchored - -# body param -SchemaForRequestBodyApplicationJson = PatternIsNotAnchored - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_pattern_is_not_anchored_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_pattern_is_not_anchored_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_pattern_is_not_anchored_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_pattern_is_not_anchored_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_pattern_is_not_anchored_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostPatternIsNotAnchoredRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_pattern_is_not_anchored_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_pattern_is_not_anchored_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_pattern_is_not_anchored_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_pattern_is_not_anchored_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_pattern_is_not_anchored_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_pattern_is_not_anchored_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_pattern_is_not_anchored_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_validation_request_body/__init__.py deleted file mode 100644 index 9f48e004c50..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_validation_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_pattern_validation_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_PATTERN_VALIDATION_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_validation_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_validation_request_body/post.py deleted file mode 100644 index 458054ebee2..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_validation_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.pattern_validation import PatternValidation - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = PatternValidation - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_pattern_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_pattern_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_pattern_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_pattern_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_pattern_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostPatternValidationRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_pattern_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_pattern_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_pattern_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_pattern_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_pattern_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_pattern_validation_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_pattern_validation_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_validation_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_validation_request_body/post.pyi deleted file mode 100644 index c39cf9f1a7f..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_validation_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.pattern_validation import PatternValidation - -# body param -SchemaForRequestBodyApplicationJson = PatternValidation - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_pattern_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_pattern_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_pattern_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_pattern_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_pattern_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostPatternValidationRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_pattern_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_pattern_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_pattern_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_pattern_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_pattern_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_pattern_validation_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_pattern_validation_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/__init__.py deleted file mode 100644 index 0191726a9df..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_properties_with_escaped_characters_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_PROPERTIES_WITH_ESCAPED_CHARACTERS_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post.py deleted file mode 100644 index 425ee3cfe0a..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.properties_with_escaped_characters import PropertiesWithEscapedCharacters - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = PropertiesWithEscapedCharacters - - -request_body_properties_with_escaped_characters = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_properties_with_escaped_characters_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_properties_with_escaped_characters_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_properties_with_escaped_characters_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_properties_with_escaped_characters_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_properties_with_escaped_characters_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_properties_with_escaped_characters.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostPropertiesWithEscapedCharactersRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_properties_with_escaped_characters_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_properties_with_escaped_characters_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_properties_with_escaped_characters_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_properties_with_escaped_characters_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_properties_with_escaped_characters_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_properties_with_escaped_characters_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_properties_with_escaped_characters_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post.pyi deleted file mode 100644 index 7b0d38f7f92..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.properties_with_escaped_characters import PropertiesWithEscapedCharacters - -# body param -SchemaForRequestBodyApplicationJson = PropertiesWithEscapedCharacters - - -request_body_properties_with_escaped_characters = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_properties_with_escaped_characters_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_properties_with_escaped_characters_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_properties_with_escaped_characters_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_properties_with_escaped_characters_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_properties_with_escaped_characters_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_properties_with_escaped_characters.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostPropertiesWithEscapedCharactersRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_properties_with_escaped_characters_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_properties_with_escaped_characters_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_properties_with_escaped_characters_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_properties_with_escaped_characters_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_properties_with_escaped_characters_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_properties_with_escaped_characters_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_properties_with_escaped_characters_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/__init__.py deleted file mode 100644 index d75d1defcf2..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_property_named_ref_that_is_not_a_reference_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_PROPERTY_NAMED_REF_THAT_IS_NOT_AREFERENCE_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post.py deleted file mode 100644 index e1358eb351b..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.property_named_ref_that_is_not_a_reference import PropertyNamedRefThatIsNotAReference - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = PropertyNamedRefThatIsNotAReference - - -request_body_property_named_ref_that_is_not_a_reference = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_property_named_ref_that_is_not_a_reference_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_property_named_ref_that_is_not_a_reference_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_property_named_ref_that_is_not_a_reference_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_property_named_ref_that_is_not_a_reference_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_property_named_ref_that_is_not_a_reference_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_property_named_ref_that_is_not_a_reference.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostPropertyNamedRefThatIsNotAReferenceRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_property_named_ref_that_is_not_a_reference_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_property_named_ref_that_is_not_a_reference_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_property_named_ref_that_is_not_a_reference_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_property_named_ref_that_is_not_a_reference_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_property_named_ref_that_is_not_a_reference_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_property_named_ref_that_is_not_a_reference_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_property_named_ref_that_is_not_a_reference_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post.pyi deleted file mode 100644 index af7fa383529..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.property_named_ref_that_is_not_a_reference import PropertyNamedRefThatIsNotAReference - -# body param -SchemaForRequestBodyApplicationJson = PropertyNamedRefThatIsNotAReference - - -request_body_property_named_ref_that_is_not_a_reference = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_property_named_ref_that_is_not_a_reference_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_property_named_ref_that_is_not_a_reference_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_property_named_ref_that_is_not_a_reference_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_property_named_ref_that_is_not_a_reference_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_property_named_ref_that_is_not_a_reference_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_property_named_ref_that_is_not_a_reference.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostPropertyNamedRefThatIsNotAReferenceRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_property_named_ref_that_is_not_a_reference_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_property_named_ref_that_is_not_a_reference_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_property_named_ref_that_is_not_a_reference_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_property_named_ref_that_is_not_a_reference_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_property_named_ref_that_is_not_a_reference_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_property_named_ref_that_is_not_a_reference_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_property_named_ref_that_is_not_a_reference_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/__init__.py deleted file mode 100644 index 39685b68077..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_ref_in_additionalproperties_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_REF_IN_ADDITIONALPROPERTIES_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post.py deleted file mode 100644 index 2b5b2534eaf..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.ref_in_additionalproperties import RefInAdditionalproperties - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = RefInAdditionalproperties - - -request_body_ref_in_additionalproperties = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_ref_in_additionalproperties_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_ref_in_additionalproperties_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_ref_in_additionalproperties_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_ref_in_additionalproperties_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_ref_in_additionalproperties_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_ref_in_additionalproperties.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostRefInAdditionalpropertiesRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_ref_in_additionalproperties_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_ref_in_additionalproperties_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_ref_in_additionalproperties_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_ref_in_additionalproperties_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_ref_in_additionalproperties_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ref_in_additionalproperties_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ref_in_additionalproperties_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post.pyi deleted file mode 100644 index e4ec8205ea7..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.ref_in_additionalproperties import RefInAdditionalproperties - -# body param -SchemaForRequestBodyApplicationJson = RefInAdditionalproperties - - -request_body_ref_in_additionalproperties = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_ref_in_additionalproperties_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_ref_in_additionalproperties_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_ref_in_additionalproperties_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_ref_in_additionalproperties_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_ref_in_additionalproperties_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_ref_in_additionalproperties.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostRefInAdditionalpropertiesRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_ref_in_additionalproperties_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_ref_in_additionalproperties_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_ref_in_additionalproperties_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_ref_in_additionalproperties_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_ref_in_additionalproperties_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ref_in_additionalproperties_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ref_in_additionalproperties_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_allof_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_allof_request_body/__init__.py deleted file mode 100644 index 6865649fc91..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_allof_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_ref_in_allof_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_REF_IN_ALLOF_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post.py deleted file mode 100644 index 490d3d5ca29..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.ref_in_allof import RefInAllof - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = RefInAllof - - -request_body_ref_in_allof = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_ref_in_allof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_ref_in_allof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_ref_in_allof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_ref_in_allof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_ref_in_allof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_ref_in_allof.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostRefInAllofRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_ref_in_allof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_ref_in_allof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_ref_in_allof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_ref_in_allof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_ref_in_allof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ref_in_allof_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ref_in_allof_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post.pyi deleted file mode 100644 index 7a254236249..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.ref_in_allof import RefInAllof - -# body param -SchemaForRequestBodyApplicationJson = RefInAllof - - -request_body_ref_in_allof = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_ref_in_allof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_ref_in_allof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_ref_in_allof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_ref_in_allof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_ref_in_allof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_ref_in_allof.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostRefInAllofRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_ref_in_allof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_ref_in_allof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_ref_in_allof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_ref_in_allof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_ref_in_allof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ref_in_allof_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ref_in_allof_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/__init__.py deleted file mode 100644 index 9eff1a1046b..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_ref_in_anyof_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_REF_IN_ANYOF_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post.py deleted file mode 100644 index ded6d110687..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.ref_in_anyof import RefInAnyof - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = RefInAnyof - - -request_body_ref_in_anyof = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_ref_in_anyof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_ref_in_anyof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_ref_in_anyof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_ref_in_anyof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_ref_in_anyof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_ref_in_anyof.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostRefInAnyofRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_ref_in_anyof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_ref_in_anyof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_ref_in_anyof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_ref_in_anyof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_ref_in_anyof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ref_in_anyof_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ref_in_anyof_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post.pyi deleted file mode 100644 index 862064722c4..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.ref_in_anyof import RefInAnyof - -# body param -SchemaForRequestBodyApplicationJson = RefInAnyof - - -request_body_ref_in_anyof = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_ref_in_anyof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_ref_in_anyof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_ref_in_anyof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_ref_in_anyof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_ref_in_anyof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_ref_in_anyof.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostRefInAnyofRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_ref_in_anyof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_ref_in_anyof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_ref_in_anyof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_ref_in_anyof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_ref_in_anyof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ref_in_anyof_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ref_in_anyof_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_items_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_items_request_body/__init__.py deleted file mode 100644 index cfe5fc1bdef..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_items_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_ref_in_items_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_REF_IN_ITEMS_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_items_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_items_request_body/post.py deleted file mode 100644 index 309a4968e07..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_items_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.ref_in_items import RefInItems - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = RefInItems - - -request_body_ref_in_items = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_ref_in_items_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_ref_in_items_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_ref_in_items_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_ref_in_items_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_ref_in_items_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_ref_in_items.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostRefInItemsRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_ref_in_items_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_ref_in_items_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_ref_in_items_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_ref_in_items_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_ref_in_items_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ref_in_items_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ref_in_items_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_items_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_items_request_body/post.pyi deleted file mode 100644 index 0acd78196a3..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_items_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.ref_in_items import RefInItems - -# body param -SchemaForRequestBodyApplicationJson = RefInItems - - -request_body_ref_in_items = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_ref_in_items_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_ref_in_items_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_ref_in_items_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_ref_in_items_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_ref_in_items_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_ref_in_items.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostRefInItemsRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_ref_in_items_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_ref_in_items_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_ref_in_items_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_ref_in_items_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_ref_in_items_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ref_in_items_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ref_in_items_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_not_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_not_request_body/__init__.py deleted file mode 100644 index 3d3ad62339f..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_not_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_ref_in_not_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_REF_IN_NOT_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_not_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_not_request_body/post.py deleted file mode 100644 index 7b03f7e62f3..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_not_request_body/post.py +++ /dev/null @@ -1,327 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.property_named_ref_that_is_not_a_reference import PropertyNamedRefThatIsNotAReference - -from . import path - -# body param - - -class SchemaForRequestBodyApplicationJson( - schemas.ComposedSchema, -): - - - class MetaOapg: - - @staticmethod - def not_schema() -> typing.Type['PropertyNamedRefThatIsNotAReference']: - return PropertyNamedRefThatIsNotAReference - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaForRequestBodyApplicationJson': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_ref_in_not_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_ref_in_not_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_ref_in_not_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_ref_in_not_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_ref_in_not_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostRefInNotRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_ref_in_not_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_ref_in_not_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_ref_in_not_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_ref_in_not_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_ref_in_not_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ref_in_not_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ref_in_not_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_not_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_not_request_body/post.pyi deleted file mode 100644 index 58ea2df2482..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_not_request_body/post.pyi +++ /dev/null @@ -1,322 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.property_named_ref_that_is_not_a_reference import PropertyNamedRefThatIsNotAReference - -# body param - - -class SchemaForRequestBodyApplicationJson( - schemas.ComposedSchema, -): - - - class MetaOapg: - - @staticmethod - def not_schema() -> typing.Type['PropertyNamedRefThatIsNotAReference']: - return PropertyNamedRefThatIsNotAReference - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaForRequestBodyApplicationJson': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_ref_in_not_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_ref_in_not_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_ref_in_not_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_ref_in_not_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_ref_in_not_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostRefInNotRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_ref_in_not_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_ref_in_not_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_ref_in_not_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_ref_in_not_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_ref_in_not_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ref_in_not_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ref_in_not_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/__init__.py deleted file mode 100644 index 3cf7e2dfb0e..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_ref_in_oneof_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_REF_IN_ONEOF_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post.py deleted file mode 100644 index ded54b035d3..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.ref_in_oneof import RefInOneof - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = RefInOneof - - -request_body_ref_in_oneof = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_ref_in_oneof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_ref_in_oneof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_ref_in_oneof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_ref_in_oneof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_ref_in_oneof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_ref_in_oneof.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostRefInOneofRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_ref_in_oneof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_ref_in_oneof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_ref_in_oneof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_ref_in_oneof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_ref_in_oneof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ref_in_oneof_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ref_in_oneof_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post.pyi deleted file mode 100644 index 7d6b25b5ce8..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.ref_in_oneof import RefInOneof - -# body param -SchemaForRequestBodyApplicationJson = RefInOneof - - -request_body_ref_in_oneof = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_ref_in_oneof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_ref_in_oneof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_ref_in_oneof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_ref_in_oneof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_ref_in_oneof_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_ref_in_oneof.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostRefInOneofRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_ref_in_oneof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_ref_in_oneof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_ref_in_oneof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_ref_in_oneof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_ref_in_oneof_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ref_in_oneof_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ref_in_oneof_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_property_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_property_request_body/__init__.py deleted file mode 100644 index e5315940008..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_property_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_ref_in_property_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_REF_IN_PROPERTY_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_property_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_property_request_body/post.py deleted file mode 100644 index 609b6754493..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_property_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.ref_in_property import RefInProperty - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = RefInProperty - - -request_body_ref_in_property = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_ref_in_property_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_ref_in_property_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_ref_in_property_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_ref_in_property_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_ref_in_property_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_ref_in_property.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostRefInPropertyRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_ref_in_property_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_ref_in_property_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_ref_in_property_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_ref_in_property_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_ref_in_property_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ref_in_property_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ref_in_property_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_property_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_property_request_body/post.pyi deleted file mode 100644 index ef76cd16401..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_property_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.ref_in_property import RefInProperty - -# body param -SchemaForRequestBodyApplicationJson = RefInProperty - - -request_body_ref_in_property = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_ref_in_property_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_ref_in_property_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_ref_in_property_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_ref_in_property_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_ref_in_property_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_ref_in_property.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostRefInPropertyRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_ref_in_property_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_ref_in_property_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_ref_in_property_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_ref_in_property_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_ref_in_property_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ref_in_property_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ref_in_property_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_default_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_default_validation_request_body/__init__.py deleted file mode 100644 index c281e13df0f..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_default_validation_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_required_default_validation_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_REQUIRED_DEFAULT_VALIDATION_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_default_validation_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_default_validation_request_body/post.py deleted file mode 100644 index 81fcb2360bb..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_default_validation_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.required_default_validation import RequiredDefaultValidation - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = RequiredDefaultValidation - - -request_body_required_default_validation = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_required_default_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_required_default_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_required_default_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_required_default_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_required_default_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_required_default_validation.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostRequiredDefaultValidationRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_required_default_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_required_default_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_required_default_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_required_default_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_required_default_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_required_default_validation_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_required_default_validation_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_default_validation_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_default_validation_request_body/post.pyi deleted file mode 100644 index 1547a9ddbc0..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_default_validation_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.required_default_validation import RequiredDefaultValidation - -# body param -SchemaForRequestBodyApplicationJson = RequiredDefaultValidation - - -request_body_required_default_validation = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_required_default_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_required_default_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_required_default_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_required_default_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_required_default_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_required_default_validation.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostRequiredDefaultValidationRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_required_default_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_required_default_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_required_default_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_required_default_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_required_default_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_required_default_validation_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_required_default_validation_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_validation_request_body/__init__.py deleted file mode 100644 index 64140f0c884..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_validation_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_required_validation_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_REQUIRED_VALIDATION_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_validation_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_validation_request_body/post.py deleted file mode 100644 index d63ce6b708c..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_validation_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.required_validation import RequiredValidation - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = RequiredValidation - - -request_body_required_validation = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_required_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_required_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_required_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_required_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_required_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_required_validation.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostRequiredValidationRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_required_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_required_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_required_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_required_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_required_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_required_validation_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_required_validation_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_validation_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_validation_request_body/post.pyi deleted file mode 100644 index 56c39dd8953..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_validation_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.required_validation import RequiredValidation - -# body param -SchemaForRequestBodyApplicationJson = RequiredValidation - - -request_body_required_validation = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_required_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_required_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_required_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_required_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_required_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_required_validation.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostRequiredValidationRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_required_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_required_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_required_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_required_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_required_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_required_validation_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_required_validation_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/__init__.py deleted file mode 100644 index 2b789e16f48..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_required_with_empty_array_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_REQUIRED_WITH_EMPTY_ARRAY_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post.py deleted file mode 100644 index 805ab2b80b7..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.required_with_empty_array import RequiredWithEmptyArray - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = RequiredWithEmptyArray - - -request_body_required_with_empty_array = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_required_with_empty_array_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_required_with_empty_array_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_required_with_empty_array_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_required_with_empty_array_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_required_with_empty_array_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_required_with_empty_array.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostRequiredWithEmptyArrayRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_required_with_empty_array_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_required_with_empty_array_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_required_with_empty_array_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_required_with_empty_array_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_required_with_empty_array_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_required_with_empty_array_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_required_with_empty_array_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post.pyi deleted file mode 100644 index 1f2a9c1946c..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.required_with_empty_array import RequiredWithEmptyArray - -# body param -SchemaForRequestBodyApplicationJson = RequiredWithEmptyArray - - -request_body_required_with_empty_array = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_required_with_empty_array_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_required_with_empty_array_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_required_with_empty_array_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_required_with_empty_array_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_required_with_empty_array_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_required_with_empty_array.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostRequiredWithEmptyArrayRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_required_with_empty_array_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_required_with_empty_array_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_required_with_empty_array_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_required_with_empty_array_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_required_with_empty_array_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_required_with_empty_array_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_required_with_empty_array_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/__init__.py deleted file mode 100644 index 84963ff8819..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_required_with_escaped_characters_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_REQUIRED_WITH_ESCAPED_CHARACTERS_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post.py deleted file mode 100644 index 834a8baa087..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post.py +++ /dev/null @@ -1,330 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from . import path - -# body param - - -class SchemaForRequestBodyApplicationJson( - schemas.AnyTypeSchema, -): - - - class MetaOapg: - required = { - "foo\"bar", - "foo\nbar", - "foo\fbar", - "foo\tbar", - "foo\rbar", - "foo\\bar", - } - - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaForRequestBodyApplicationJson': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_required_with_escaped_characters_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_required_with_escaped_characters_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_required_with_escaped_characters_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_required_with_escaped_characters_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_required_with_escaped_characters_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostRequiredWithEscapedCharactersRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_required_with_escaped_characters_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_required_with_escaped_characters_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_required_with_escaped_characters_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_required_with_escaped_characters_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_required_with_escaped_characters_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_required_with_escaped_characters_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_required_with_escaped_characters_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post.pyi deleted file mode 100644 index 57aef4b171c..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post.pyi +++ /dev/null @@ -1,325 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -# body param - - -class SchemaForRequestBodyApplicationJson( - schemas.AnyTypeSchema, -): - - - class MetaOapg: - required = { - "foo\"bar", - "foo\nbar", - "foo\fbar", - "foo\tbar", - "foo\rbar", - "foo\\bar", - } - - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaForRequestBodyApplicationJson': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_required_with_escaped_characters_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_required_with_escaped_characters_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_required_with_escaped_characters_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_required_with_escaped_characters_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_required_with_escaped_characters_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostRequiredWithEscapedCharactersRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_required_with_escaped_characters_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_required_with_escaped_characters_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_required_with_escaped_characters_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_required_with_escaped_characters_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_required_with_escaped_characters_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_required_with_escaped_characters_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_required_with_escaped_characters_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/__init__.py deleted file mode 100644 index 9fbc857f5ff..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_simple_enum_validation_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_SIMPLE_ENUM_VALIDATION_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post.py deleted file mode 100644 index 5354e4de1b5..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.simple_enum_validation import SimpleEnumValidation - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = SimpleEnumValidation - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_simple_enum_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_simple_enum_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_simple_enum_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_simple_enum_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_simple_enum_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostSimpleEnumValidationRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_simple_enum_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_simple_enum_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_simple_enum_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_simple_enum_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_simple_enum_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_simple_enum_validation_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_simple_enum_validation_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post.pyi deleted file mode 100644 index effcdc02f2d..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.simple_enum_validation import SimpleEnumValidation - -# body param -SchemaForRequestBodyApplicationJson = SimpleEnumValidation - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_simple_enum_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_simple_enum_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_simple_enum_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_simple_enum_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_simple_enum_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostSimpleEnumValidationRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_simple_enum_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_simple_enum_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_simple_enum_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_simple_enum_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_simple_enum_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_simple_enum_validation_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_simple_enum_validation_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/__init__.py deleted file mode 100644 index a5975daf716..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_string_type_matches_strings_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_STRING_TYPE_MATCHES_STRINGS_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post.py deleted file mode 100644 index 3b4e6447496..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post.py +++ /dev/null @@ -1,300 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = schemas.StrSchema - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_string_type_matches_strings_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,str, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_string_type_matches_strings_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,str, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_string_type_matches_strings_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,str, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_string_type_matches_strings_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,str, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_string_type_matches_strings_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,str, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostStringTypeMatchesStringsRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_string_type_matches_strings_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,str, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_string_type_matches_strings_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,str, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_string_type_matches_strings_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,str, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_string_type_matches_strings_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,str, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_string_type_matches_strings_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,str, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_string_type_matches_strings_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,str, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,str, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,str, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,str, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,str, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_string_type_matches_strings_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post.pyi deleted file mode 100644 index 111d13eaddb..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post.pyi +++ /dev/null @@ -1,295 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -# body param -SchemaForRequestBodyApplicationJson = schemas.StrSchema - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_string_type_matches_strings_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,str, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_string_type_matches_strings_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,str, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_string_type_matches_strings_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,str, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_string_type_matches_strings_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,str, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_string_type_matches_strings_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,str, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostStringTypeMatchesStringsRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_string_type_matches_strings_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,str, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_string_type_matches_strings_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,str, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_string_type_matches_strings_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,str, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_string_type_matches_strings_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,str, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_string_type_matches_strings_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,str, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_string_type_matches_strings_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,str, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,str, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,str, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,str, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,str, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_string_type_matches_strings_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/__init__.py deleted file mode 100644 index 19bb1f267e9..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_THE_DEFAULT_KEYWORD_DOES_NOT_DO_ANYTHING_IF_THE_PROPERTY_IS_MISSING_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post.py deleted file mode 100644 index 2f172ee7ea9..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.the_default_keyword_does_not_do_anything_if_the_property_is_missing import TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing - - -request_body_the_default_keyword_does_not_do_anything_if_the_property_is_missing = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_the_default_keyword_does_not_do_anything_if_the_property_is_missing.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post.pyi deleted file mode 100644 index 3c829415e75..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.the_default_keyword_does_not_do_anything_if_the_property_is_missing import TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing - -# body param -SchemaForRequestBodyApplicationJson = TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing - - -request_body_the_default_keyword_does_not_do_anything_if_the_property_is_missing = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_the_default_keyword_does_not_do_anything_if_the_property_is_missing.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/__init__.py deleted file mode 100644 index cfdcae95f6c..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_uniqueitems_false_validation_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_UNIQUEITEMS_FALSE_VALIDATION_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post.py deleted file mode 100644 index 84e9b315a2b..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.uniqueitems_false_validation import UniqueitemsFalseValidation - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = UniqueitemsFalseValidation - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_uniqueitems_false_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_uniqueitems_false_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_uniqueitems_false_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_uniqueitems_false_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_uniqueitems_false_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostUniqueitemsFalseValidationRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_uniqueitems_false_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_uniqueitems_false_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_uniqueitems_false_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_uniqueitems_false_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_uniqueitems_false_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_uniqueitems_false_validation_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_uniqueitems_false_validation_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post.pyi deleted file mode 100644 index 8207e18ee6f..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.uniqueitems_false_validation import UniqueitemsFalseValidation - -# body param -SchemaForRequestBodyApplicationJson = UniqueitemsFalseValidation - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_uniqueitems_false_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_uniqueitems_false_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_uniqueitems_false_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_uniqueitems_false_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_uniqueitems_false_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostUniqueitemsFalseValidationRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_uniqueitems_false_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_uniqueitems_false_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_uniqueitems_false_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_uniqueitems_false_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_uniqueitems_false_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_uniqueitems_false_validation_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_uniqueitems_false_validation_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/__init__.py deleted file mode 100644 index e3afc7776c9..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_uniqueitems_validation_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_UNIQUEITEMS_VALIDATION_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post.py deleted file mode 100644 index b8c23088f93..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.uniqueitems_validation import UniqueitemsValidation - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = UniqueitemsValidation - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_uniqueitems_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_uniqueitems_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_uniqueitems_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_uniqueitems_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_uniqueitems_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostUniqueitemsValidationRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_uniqueitems_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_uniqueitems_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_uniqueitems_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_uniqueitems_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_uniqueitems_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_uniqueitems_validation_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_uniqueitems_validation_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post.pyi deleted file mode 100644 index e07c97b8adc..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.uniqueitems_validation import UniqueitemsValidation - -# body param -SchemaForRequestBodyApplicationJson = UniqueitemsValidation - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_uniqueitems_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_uniqueitems_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_uniqueitems_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_uniqueitems_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_uniqueitems_validation_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostUniqueitemsValidationRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_uniqueitems_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_uniqueitems_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_uniqueitems_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_uniqueitems_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_uniqueitems_validation_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_uniqueitems_validation_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_uniqueitems_validation_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_format_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_format_request_body/__init__.py deleted file mode 100644 index 8b7bbf53e8f..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_format_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_uri_format_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_URI_FORMAT_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_format_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_format_request_body/post.py deleted file mode 100644 index cb462b9db7c..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_format_request_body/post.py +++ /dev/null @@ -1,322 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from . import path - -# body param - - -class SchemaForRequestBodyApplicationJson( - schemas.AnyTypeSchema, -): - - - class MetaOapg: - format = 'uri' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaForRequestBodyApplicationJson': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_uri_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_uri_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_uri_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_uri_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_uri_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostUriFormatRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_uri_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_uri_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_uri_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_uri_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_uri_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_uri_format_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_uri_format_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_format_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_format_request_body/post.pyi deleted file mode 100644 index 73a3c7ebb32..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_format_request_body/post.pyi +++ /dev/null @@ -1,317 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -# body param - - -class SchemaForRequestBodyApplicationJson( - schemas.AnyTypeSchema, -): - - - class MetaOapg: - format = 'uri' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaForRequestBodyApplicationJson': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_uri_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_uri_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_uri_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_uri_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_uri_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostUriFormatRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_uri_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_uri_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_uri_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_uri_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_uri_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_uri_format_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_uri_format_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_reference_format_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_reference_format_request_body/__init__.py deleted file mode 100644 index 75781edad7c..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_reference_format_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_uri_reference_format_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_URI_REFERENCE_FORMAT_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post.py deleted file mode 100644 index c0dc0dbb2a8..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post.py +++ /dev/null @@ -1,322 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from . import path - -# body param - - -class SchemaForRequestBodyApplicationJson( - schemas.AnyTypeSchema, -): - - - class MetaOapg: - format = 'uri-reference' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaForRequestBodyApplicationJson': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_uri_reference_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_uri_reference_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_uri_reference_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_uri_reference_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_uri_reference_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostUriReferenceFormatRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_uri_reference_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_uri_reference_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_uri_reference_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_uri_reference_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_uri_reference_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_uri_reference_format_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_uri_reference_format_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post.pyi deleted file mode 100644 index 64a2a746e02..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post.pyi +++ /dev/null @@ -1,317 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -# body param - - -class SchemaForRequestBodyApplicationJson( - schemas.AnyTypeSchema, -): - - - class MetaOapg: - format = 'uri-reference' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaForRequestBodyApplicationJson': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_uri_reference_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_uri_reference_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_uri_reference_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_uri_reference_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_uri_reference_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostUriReferenceFormatRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_uri_reference_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_uri_reference_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_uri_reference_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_uri_reference_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_uri_reference_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_uri_reference_format_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_uri_reference_format_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_template_format_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_template_format_request_body/__init__.py deleted file mode 100644 index 5c3430004e2..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_template_format_request_body/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.request_body_post_uri_template_format_request_body import Api - -from unit_test_api.paths import PathValues - -path = PathValues.REQUEST_BODY_POST_URI_TEMPLATE_FORMAT_REQUEST_BODY \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_template_format_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_template_format_request_body/post.py deleted file mode 100644 index faa0919acc7..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_template_format_request_body/post.py +++ /dev/null @@ -1,322 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from . import path - -# body param - - -class SchemaForRequestBodyApplicationJson( - schemas.AnyTypeSchema, -): - - - class MetaOapg: - format = 'uri-template' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaForRequestBodyApplicationJson': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_uri_template_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_uri_template_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_uri_template_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_uri_template_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_uri_template_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostUriTemplateFormatRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_uri_template_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_uri_template_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_uri_template_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_uri_template_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_uri_template_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_uri_template_format_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_uri_template_format_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_template_format_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_template_format_request_body/post.pyi deleted file mode 100644 index c45b03a050c..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_template_format_request_body/post.pyi +++ /dev/null @@ -1,317 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -# body param - - -class SchemaForRequestBodyApplicationJson( - schemas.AnyTypeSchema, -): - - - class MetaOapg: - format = 'uri-template' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaForRequestBodyApplicationJson': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_uri_template_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_uri_template_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_uri_template_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_uri_template_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_uri_template_format_request_body_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostUriTemplateFormatRequestBody(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_uri_template_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_uri_template_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_uri_template_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_uri_template_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_uri_template_format_request_body( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_uri_template_format_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_uri_template_format_request_body_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/__init__.py deleted file mode 100644 index 952a3a37816..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_ADDITIONALPROPERTIES_ALLOWS_ASCHEMA_WHICH_SHOULD_VALIDATE_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post.py deleted file mode 100644 index 70aa9f68534..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.additionalproperties_allows_a_schema_which_should_validate import AdditionalpropertiesAllowsASchemaWhichShouldValidate - -from . import path - -SchemaFor200ResponseBodyApplicationJson = AdditionalpropertiesAllowsASchemaWhichShouldValidate - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostAdditionalpropertiesAllowsASchemaWhichShouldValidateResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post.pyi deleted file mode 100644 index 0105fff8438..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.additionalproperties_allows_a_schema_which_should_validate import AdditionalpropertiesAllowsASchemaWhichShouldValidate - -SchemaFor200ResponseBodyApplicationJson = AdditionalpropertiesAllowsASchemaWhichShouldValidate - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostAdditionalpropertiesAllowsASchemaWhichShouldValidateResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/__init__.py deleted file mode 100644 index 8ba816b84c7..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_ADDITIONALPROPERTIES_ARE_ALLOWED_BY_DEFAULT_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post.py deleted file mode 100644 index 5b26f694e8f..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.additionalproperties_are_allowed_by_default import AdditionalpropertiesAreAllowedByDefault - -from . import path - -SchemaFor200ResponseBodyApplicationJson = AdditionalpropertiesAreAllowedByDefault - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_additionalproperties_are_allowed_by_default_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_additionalproperties_are_allowed_by_default_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_additionalproperties_are_allowed_by_default_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_additionalproperties_are_allowed_by_default_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostAdditionalpropertiesAreAllowedByDefaultResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_additionalproperties_are_allowed_by_default_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_additionalproperties_are_allowed_by_default_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_additionalproperties_are_allowed_by_default_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_additionalproperties_are_allowed_by_default_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_additionalproperties_are_allowed_by_default_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_additionalproperties_are_allowed_by_default_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post.pyi deleted file mode 100644 index 4401eaf87f2..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.additionalproperties_are_allowed_by_default import AdditionalpropertiesAreAllowedByDefault - -SchemaFor200ResponseBodyApplicationJson = AdditionalpropertiesAreAllowedByDefault - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_additionalproperties_are_allowed_by_default_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_additionalproperties_are_allowed_by_default_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_additionalproperties_are_allowed_by_default_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_additionalproperties_are_allowed_by_default_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostAdditionalpropertiesAreAllowedByDefaultResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_additionalproperties_are_allowed_by_default_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_additionalproperties_are_allowed_by_default_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_additionalproperties_are_allowed_by_default_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_additionalproperties_are_allowed_by_default_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_additionalproperties_are_allowed_by_default_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_additionalproperties_are_allowed_by_default_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/__init__.py deleted file mode 100644 index 2c17dfc57e3..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_ADDITIONALPROPERTIES_CAN_EXIST_BY_ITSELF_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post.py deleted file mode 100644 index 3bf75bed914..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.additionalproperties_can_exist_by_itself import AdditionalpropertiesCanExistByItself - -from . import path - -SchemaFor200ResponseBodyApplicationJson = AdditionalpropertiesCanExistByItself - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_additionalproperties_can_exist_by_itself_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_additionalproperties_can_exist_by_itself_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_additionalproperties_can_exist_by_itself_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_additionalproperties_can_exist_by_itself_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostAdditionalpropertiesCanExistByItselfResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_additionalproperties_can_exist_by_itself_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_additionalproperties_can_exist_by_itself_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_additionalproperties_can_exist_by_itself_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_additionalproperties_can_exist_by_itself_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_additionalproperties_can_exist_by_itself_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_additionalproperties_can_exist_by_itself_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post.pyi deleted file mode 100644 index 4089f55a73e..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.additionalproperties_can_exist_by_itself import AdditionalpropertiesCanExistByItself - -SchemaFor200ResponseBodyApplicationJson = AdditionalpropertiesCanExistByItself - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_additionalproperties_can_exist_by_itself_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_additionalproperties_can_exist_by_itself_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_additionalproperties_can_exist_by_itself_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_additionalproperties_can_exist_by_itself_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostAdditionalpropertiesCanExistByItselfResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_additionalproperties_can_exist_by_itself_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_additionalproperties_can_exist_by_itself_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_additionalproperties_can_exist_by_itself_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_additionalproperties_can_exist_by_itself_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_additionalproperties_can_exist_by_itself_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_additionalproperties_can_exist_by_itself_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/__init__.py deleted file mode 100644 index 91245978b9f..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_ADDITIONALPROPERTIES_SHOULD_NOT_LOOK_IN_APPLICATORS_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post.py deleted file mode 100644 index 5be612e8e01..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.additionalproperties_should_not_look_in_applicators import AdditionalpropertiesShouldNotLookInApplicators - -from . import path - -SchemaFor200ResponseBodyApplicationJson = AdditionalpropertiesShouldNotLookInApplicators - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostAdditionalpropertiesShouldNotLookInApplicatorsResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post.pyi deleted file mode 100644 index bc87bead413..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.additionalproperties_should_not_look_in_applicators import AdditionalpropertiesShouldNotLookInApplicators - -SchemaFor200ResponseBodyApplicationJson = AdditionalpropertiesShouldNotLookInApplicators - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostAdditionalpropertiesShouldNotLookInApplicatorsResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/__init__.py deleted file mode 100644 index c2954dad02b..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_ALLOF_COMBINED_WITH_ANYOF_ONEOF_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post.py deleted file mode 100644 index 635afda0dbd..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.allof_combined_with_anyof_oneof import AllofCombinedWithAnyofOneof - -from . import path - -SchemaFor200ResponseBodyApplicationJson = AllofCombinedWithAnyofOneof - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_allof_combined_with_anyof_oneof_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_allof_combined_with_anyof_oneof_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_allof_combined_with_anyof_oneof_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_allof_combined_with_anyof_oneof_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostAllofCombinedWithAnyofOneofResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_allof_combined_with_anyof_oneof_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_allof_combined_with_anyof_oneof_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_allof_combined_with_anyof_oneof_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_allof_combined_with_anyof_oneof_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_allof_combined_with_anyof_oneof_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_allof_combined_with_anyof_oneof_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post.pyi deleted file mode 100644 index 3795a3b74b2..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.allof_combined_with_anyof_oneof import AllofCombinedWithAnyofOneof - -SchemaFor200ResponseBodyApplicationJson = AllofCombinedWithAnyofOneof - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_allof_combined_with_anyof_oneof_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_allof_combined_with_anyof_oneof_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_allof_combined_with_anyof_oneof_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_allof_combined_with_anyof_oneof_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostAllofCombinedWithAnyofOneofResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_allof_combined_with_anyof_oneof_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_allof_combined_with_anyof_oneof_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_allof_combined_with_anyof_oneof_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_allof_combined_with_anyof_oneof_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_allof_combined_with_anyof_oneof_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_allof_combined_with_anyof_oneof_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/__init__.py deleted file mode 100644 index 966421655a4..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_allof_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_ALLOF_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post.py deleted file mode 100644 index 94a447e4956..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.allof import Allof - -from . import path - -SchemaFor200ResponseBodyApplicationJson = Allof - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_allof_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_allof_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_allof_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_allof_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostAllofResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_allof_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_allof_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_allof_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_allof_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_allof_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_allof_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post.pyi deleted file mode 100644 index 1dc3c32a9cc..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.allof import Allof - -SchemaFor200ResponseBodyApplicationJson = Allof - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_allof_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_allof_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_allof_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_allof_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostAllofResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_allof_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_allof_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_allof_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_allof_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_allof_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_allof_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/__init__.py deleted file mode 100644 index d3d3b345f62..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_allof_simple_types_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_ALLOF_SIMPLE_TYPES_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post.py deleted file mode 100644 index 5c4604d196e..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.allof_simple_types import AllofSimpleTypes - -from . import path - -SchemaFor200ResponseBodyApplicationJson = AllofSimpleTypes - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_allof_simple_types_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_allof_simple_types_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_allof_simple_types_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_allof_simple_types_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostAllofSimpleTypesResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_allof_simple_types_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_allof_simple_types_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_allof_simple_types_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_allof_simple_types_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_allof_simple_types_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_allof_simple_types_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post.pyi deleted file mode 100644 index a1396767914..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.allof_simple_types import AllofSimpleTypes - -SchemaFor200ResponseBodyApplicationJson = AllofSimpleTypes - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_allof_simple_types_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_allof_simple_types_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_allof_simple_types_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_allof_simple_types_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostAllofSimpleTypesResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_allof_simple_types_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_allof_simple_types_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_allof_simple_types_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_allof_simple_types_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_allof_simple_types_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_allof_simple_types_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/__init__.py deleted file mode 100644 index ead19c41027..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_allof_with_base_schema_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_ALLOF_WITH_BASE_SCHEMA_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post.py deleted file mode 100644 index 1f0985f895b..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.allof_with_base_schema import AllofWithBaseSchema - -from . import path - -SchemaFor200ResponseBodyApplicationJson = AllofWithBaseSchema - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_allof_with_base_schema_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_allof_with_base_schema_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_allof_with_base_schema_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_allof_with_base_schema_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostAllofWithBaseSchemaResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_allof_with_base_schema_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_allof_with_base_schema_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_allof_with_base_schema_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_allof_with_base_schema_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_allof_with_base_schema_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_allof_with_base_schema_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post.pyi deleted file mode 100644 index 77da52c350d..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.allof_with_base_schema import AllofWithBaseSchema - -SchemaFor200ResponseBodyApplicationJson = AllofWithBaseSchema - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_allof_with_base_schema_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_allof_with_base_schema_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_allof_with_base_schema_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_allof_with_base_schema_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostAllofWithBaseSchemaResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_allof_with_base_schema_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_allof_with_base_schema_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_allof_with_base_schema_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_allof_with_base_schema_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_allof_with_base_schema_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_allof_with_base_schema_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/__init__.py deleted file mode 100644 index 5b925dbe84f..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_allof_with_one_empty_schema_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_ALLOF_WITH_ONE_EMPTY_SCHEMA_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post.py deleted file mode 100644 index da75e06fbb1..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.allof_with_one_empty_schema import AllofWithOneEmptySchema - -from . import path - -SchemaFor200ResponseBodyApplicationJson = AllofWithOneEmptySchema - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_allof_with_one_empty_schema_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_allof_with_one_empty_schema_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_allof_with_one_empty_schema_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_allof_with_one_empty_schema_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostAllofWithOneEmptySchemaResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_allof_with_one_empty_schema_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_allof_with_one_empty_schema_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_allof_with_one_empty_schema_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_allof_with_one_empty_schema_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_allof_with_one_empty_schema_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_allof_with_one_empty_schema_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post.pyi deleted file mode 100644 index 746593975d9..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.allof_with_one_empty_schema import AllofWithOneEmptySchema - -SchemaFor200ResponseBodyApplicationJson = AllofWithOneEmptySchema - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_allof_with_one_empty_schema_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_allof_with_one_empty_schema_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_allof_with_one_empty_schema_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_allof_with_one_empty_schema_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostAllofWithOneEmptySchemaResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_allof_with_one_empty_schema_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_allof_with_one_empty_schema_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_allof_with_one_empty_schema_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_allof_with_one_empty_schema_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_allof_with_one_empty_schema_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_allof_with_one_empty_schema_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/__init__.py deleted file mode 100644 index d2158fd5910..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_ALLOF_WITH_THE_FIRST_EMPTY_SCHEMA_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post.py deleted file mode 100644 index 48101abd1e0..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.allof_with_the_first_empty_schema import AllofWithTheFirstEmptySchema - -from . import path - -SchemaFor200ResponseBodyApplicationJson = AllofWithTheFirstEmptySchema - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_allof_with_the_first_empty_schema_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_allof_with_the_first_empty_schema_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_allof_with_the_first_empty_schema_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_allof_with_the_first_empty_schema_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostAllofWithTheFirstEmptySchemaResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_allof_with_the_first_empty_schema_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_allof_with_the_first_empty_schema_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_allof_with_the_first_empty_schema_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_allof_with_the_first_empty_schema_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_allof_with_the_first_empty_schema_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_allof_with_the_first_empty_schema_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post.pyi deleted file mode 100644 index 908b9e379d5..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.allof_with_the_first_empty_schema import AllofWithTheFirstEmptySchema - -SchemaFor200ResponseBodyApplicationJson = AllofWithTheFirstEmptySchema - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_allof_with_the_first_empty_schema_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_allof_with_the_first_empty_schema_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_allof_with_the_first_empty_schema_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_allof_with_the_first_empty_schema_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostAllofWithTheFirstEmptySchemaResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_allof_with_the_first_empty_schema_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_allof_with_the_first_empty_schema_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_allof_with_the_first_empty_schema_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_allof_with_the_first_empty_schema_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_allof_with_the_first_empty_schema_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_allof_with_the_first_empty_schema_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/__init__.py deleted file mode 100644 index 96db6f89d5d..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_ALLOF_WITH_THE_LAST_EMPTY_SCHEMA_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post.py deleted file mode 100644 index bf48f1ab291..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.allof_with_the_last_empty_schema import AllofWithTheLastEmptySchema - -from . import path - -SchemaFor200ResponseBodyApplicationJson = AllofWithTheLastEmptySchema - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_allof_with_the_last_empty_schema_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_allof_with_the_last_empty_schema_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_allof_with_the_last_empty_schema_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_allof_with_the_last_empty_schema_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostAllofWithTheLastEmptySchemaResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_allof_with_the_last_empty_schema_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_allof_with_the_last_empty_schema_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_allof_with_the_last_empty_schema_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_allof_with_the_last_empty_schema_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_allof_with_the_last_empty_schema_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_allof_with_the_last_empty_schema_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post.pyi deleted file mode 100644 index 8c19a4c802d..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.allof_with_the_last_empty_schema import AllofWithTheLastEmptySchema - -SchemaFor200ResponseBodyApplicationJson = AllofWithTheLastEmptySchema - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_allof_with_the_last_empty_schema_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_allof_with_the_last_empty_schema_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_allof_with_the_last_empty_schema_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_allof_with_the_last_empty_schema_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostAllofWithTheLastEmptySchemaResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_allof_with_the_last_empty_schema_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_allof_with_the_last_empty_schema_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_allof_with_the_last_empty_schema_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_allof_with_the_last_empty_schema_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_allof_with_the_last_empty_schema_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_allof_with_the_last_empty_schema_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/__init__.py deleted file mode 100644 index fcb8c8f7ec4..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_allof_with_two_empty_schemas_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_ALLOF_WITH_TWO_EMPTY_SCHEMAS_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post.py deleted file mode 100644 index ab51977650d..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.allof_with_two_empty_schemas import AllofWithTwoEmptySchemas - -from . import path - -SchemaFor200ResponseBodyApplicationJson = AllofWithTwoEmptySchemas - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_allof_with_two_empty_schemas_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_allof_with_two_empty_schemas_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_allof_with_two_empty_schemas_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_allof_with_two_empty_schemas_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostAllofWithTwoEmptySchemasResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_allof_with_two_empty_schemas_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_allof_with_two_empty_schemas_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_allof_with_two_empty_schemas_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_allof_with_two_empty_schemas_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_allof_with_two_empty_schemas_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_allof_with_two_empty_schemas_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post.pyi deleted file mode 100644 index 19aa76ce144..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.allof_with_two_empty_schemas import AllofWithTwoEmptySchemas - -SchemaFor200ResponseBodyApplicationJson = AllofWithTwoEmptySchemas - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_allof_with_two_empty_schemas_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_allof_with_two_empty_schemas_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_allof_with_two_empty_schemas_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_allof_with_two_empty_schemas_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostAllofWithTwoEmptySchemasResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_allof_with_two_empty_schemas_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_allof_with_two_empty_schemas_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_allof_with_two_empty_schemas_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_allof_with_two_empty_schemas_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_allof_with_two_empty_schemas_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_allof_with_two_empty_schemas_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/__init__.py deleted file mode 100644 index b028f3bec7c..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_anyof_complex_types_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_ANYOF_COMPLEX_TYPES_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post.py deleted file mode 100644 index ce0cb06e73b..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.anyof_complex_types import AnyofComplexTypes - -from . import path - -SchemaFor200ResponseBodyApplicationJson = AnyofComplexTypes - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_anyof_complex_types_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_anyof_complex_types_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_anyof_complex_types_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_anyof_complex_types_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostAnyofComplexTypesResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_anyof_complex_types_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_anyof_complex_types_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_anyof_complex_types_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_anyof_complex_types_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_anyof_complex_types_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_anyof_complex_types_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post.pyi deleted file mode 100644 index 3587d554fa0..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.anyof_complex_types import AnyofComplexTypes - -SchemaFor200ResponseBodyApplicationJson = AnyofComplexTypes - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_anyof_complex_types_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_anyof_complex_types_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_anyof_complex_types_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_anyof_complex_types_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostAnyofComplexTypesResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_anyof_complex_types_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_anyof_complex_types_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_anyof_complex_types_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_anyof_complex_types_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_anyof_complex_types_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_anyof_complex_types_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/__init__.py deleted file mode 100644 index de1893c9ea8..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_anyof_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_ANYOF_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post.py deleted file mode 100644 index a9550fa4ef7..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.anyof import Anyof - -from . import path - -SchemaFor200ResponseBodyApplicationJson = Anyof - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_anyof_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_anyof_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_anyof_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_anyof_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostAnyofResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_anyof_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_anyof_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_anyof_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_anyof_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_anyof_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_anyof_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post.pyi deleted file mode 100644 index 01a0cc7ab6a..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.anyof import Anyof - -SchemaFor200ResponseBodyApplicationJson = Anyof - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_anyof_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_anyof_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_anyof_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_anyof_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostAnyofResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_anyof_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_anyof_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_anyof_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_anyof_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_anyof_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_anyof_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/__init__.py deleted file mode 100644 index bbb82f9ffcb..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_anyof_with_base_schema_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_ANYOF_WITH_BASE_SCHEMA_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post.py deleted file mode 100644 index 1dee133da93..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.anyof_with_base_schema import AnyofWithBaseSchema - -from . import path - -SchemaFor200ResponseBodyApplicationJson = AnyofWithBaseSchema - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_anyof_with_base_schema_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_anyof_with_base_schema_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_anyof_with_base_schema_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_anyof_with_base_schema_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostAnyofWithBaseSchemaResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_anyof_with_base_schema_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_anyof_with_base_schema_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_anyof_with_base_schema_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_anyof_with_base_schema_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_anyof_with_base_schema_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_anyof_with_base_schema_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post.pyi deleted file mode 100644 index e5da7323ab6..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.anyof_with_base_schema import AnyofWithBaseSchema - -SchemaFor200ResponseBodyApplicationJson = AnyofWithBaseSchema - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_anyof_with_base_schema_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_anyof_with_base_schema_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_anyof_with_base_schema_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_anyof_with_base_schema_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostAnyofWithBaseSchemaResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_anyof_with_base_schema_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_anyof_with_base_schema_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_anyof_with_base_schema_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_anyof_with_base_schema_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_anyof_with_base_schema_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_anyof_with_base_schema_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/__init__.py deleted file mode 100644 index ceb7349121d..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_anyof_with_one_empty_schema_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_ANYOF_WITH_ONE_EMPTY_SCHEMA_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post.py deleted file mode 100644 index 8bc44fe0935..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.anyof_with_one_empty_schema import AnyofWithOneEmptySchema - -from . import path - -SchemaFor200ResponseBodyApplicationJson = AnyofWithOneEmptySchema - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_anyof_with_one_empty_schema_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_anyof_with_one_empty_schema_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_anyof_with_one_empty_schema_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_anyof_with_one_empty_schema_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostAnyofWithOneEmptySchemaResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_anyof_with_one_empty_schema_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_anyof_with_one_empty_schema_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_anyof_with_one_empty_schema_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_anyof_with_one_empty_schema_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_anyof_with_one_empty_schema_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_anyof_with_one_empty_schema_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post.pyi deleted file mode 100644 index d21ca9bc8db..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.anyof_with_one_empty_schema import AnyofWithOneEmptySchema - -SchemaFor200ResponseBodyApplicationJson = AnyofWithOneEmptySchema - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_anyof_with_one_empty_schema_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_anyof_with_one_empty_schema_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_anyof_with_one_empty_schema_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_anyof_with_one_empty_schema_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostAnyofWithOneEmptySchemaResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_anyof_with_one_empty_schema_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_anyof_with_one_empty_schema_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_anyof_with_one_empty_schema_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_anyof_with_one_empty_schema_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_anyof_with_one_empty_schema_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_anyof_with_one_empty_schema_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/__init__.py deleted file mode 100644 index 2fdd3453b97..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_array_type_matches_arrays_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_ARRAY_TYPE_MATCHES_ARRAYS_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post.py deleted file mode 100644 index 139e56b4a53..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.array_type_matches_arrays import ArrayTypeMatchesArrays - -from . import path - -SchemaFor200ResponseBodyApplicationJson = ArrayTypeMatchesArrays - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_array_type_matches_arrays_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_array_type_matches_arrays_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_array_type_matches_arrays_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_array_type_matches_arrays_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostArrayTypeMatchesArraysResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_array_type_matches_arrays_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_array_type_matches_arrays_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_array_type_matches_arrays_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_array_type_matches_arrays_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_array_type_matches_arrays_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_array_type_matches_arrays_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post.pyi deleted file mode 100644 index 8747581c8ab..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.array_type_matches_arrays import ArrayTypeMatchesArrays - -SchemaFor200ResponseBodyApplicationJson = ArrayTypeMatchesArrays - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_array_type_matches_arrays_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_array_type_matches_arrays_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_array_type_matches_arrays_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_array_type_matches_arrays_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostArrayTypeMatchesArraysResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_array_type_matches_arrays_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_array_type_matches_arrays_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_array_type_matches_arrays_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_array_type_matches_arrays_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_array_type_matches_arrays_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_array_type_matches_arrays_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/__init__.py deleted file mode 100644 index bb12060f2d4..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_boolean_type_matches_booleans_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_BOOLEAN_TYPE_MATCHES_BOOLEANS_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post.py deleted file mode 100644 index 8925a2f124c..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post.py +++ /dev/null @@ -1,236 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from . import path - -SchemaFor200ResponseBodyApplicationJson = schemas.BoolSchema - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_boolean_type_matches_booleans_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_boolean_type_matches_booleans_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_boolean_type_matches_booleans_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_boolean_type_matches_booleans_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostBooleanTypeMatchesBooleansResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_boolean_type_matches_booleans_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_boolean_type_matches_booleans_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_boolean_type_matches_booleans_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_boolean_type_matches_booleans_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_boolean_type_matches_booleans_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_boolean_type_matches_booleans_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post.pyi deleted file mode 100644 index a18f80d294e..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,231 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -SchemaFor200ResponseBodyApplicationJson = schemas.BoolSchema - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_boolean_type_matches_booleans_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_boolean_type_matches_booleans_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_boolean_type_matches_booleans_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_boolean_type_matches_booleans_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostBooleanTypeMatchesBooleansResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_boolean_type_matches_booleans_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_boolean_type_matches_booleans_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_boolean_type_matches_booleans_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_boolean_type_matches_booleans_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_boolean_type_matches_booleans_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_boolean_type_matches_booleans_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/__init__.py deleted file mode 100644 index 65dc15fb389..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_by_int_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_BY_INT_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post.py deleted file mode 100644 index 6db4c98f076..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.by_int import ByInt - -from . import path - -SchemaFor200ResponseBodyApplicationJson = ByInt - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_by_int_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_by_int_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_by_int_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_by_int_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostByIntResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_by_int_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_by_int_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_by_int_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_by_int_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_by_int_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_by_int_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post.pyi deleted file mode 100644 index 86ce25c36b7..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.by_int import ByInt - -SchemaFor200ResponseBodyApplicationJson = ByInt - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_by_int_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_by_int_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_by_int_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_by_int_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostByIntResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_by_int_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_by_int_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_by_int_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_by_int_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_by_int_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_by_int_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/__init__.py deleted file mode 100644 index c4a2ebe9634..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_by_number_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_BY_NUMBER_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post.py deleted file mode 100644 index 74a44f78f2e..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.by_number import ByNumber - -from . import path - -SchemaFor200ResponseBodyApplicationJson = ByNumber - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_by_number_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_by_number_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_by_number_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_by_number_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostByNumberResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_by_number_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_by_number_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_by_number_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_by_number_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_by_number_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_by_number_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post.pyi deleted file mode 100644 index 262254f8eae..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.by_number import ByNumber - -SchemaFor200ResponseBodyApplicationJson = ByNumber - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_by_number_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_by_number_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_by_number_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_by_number_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostByNumberResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_by_number_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_by_number_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_by_number_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_by_number_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_by_number_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_by_number_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/__init__.py deleted file mode 100644 index 8006bf48849..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_by_small_number_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_BY_SMALL_NUMBER_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post.py deleted file mode 100644 index 07beaaff033..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.by_small_number import BySmallNumber - -from . import path - -SchemaFor200ResponseBodyApplicationJson = BySmallNumber - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_by_small_number_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_by_small_number_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_by_small_number_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_by_small_number_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostBySmallNumberResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_by_small_number_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_by_small_number_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_by_small_number_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_by_small_number_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_by_small_number_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_by_small_number_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post.pyi deleted file mode 100644 index 885313a3343..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.by_small_number import BySmallNumber - -SchemaFor200ResponseBodyApplicationJson = BySmallNumber - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_by_small_number_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_by_small_number_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_by_small_number_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_by_small_number_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostBySmallNumberResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_by_small_number_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_by_small_number_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_by_small_number_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_by_small_number_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_by_small_number_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_by_small_number_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/__init__.py deleted file mode 100644 index da7708ad056..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_date_time_format_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_DATE_TIME_FORMAT_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post.py deleted file mode 100644 index 548965b1387..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post.py +++ /dev/null @@ -1,259 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from . import path - - - -class SchemaFor200ResponseBodyApplicationJson( - schemas.DateTimeBase, - schemas.AnyTypeSchema, -): - - - class MetaOapg: - format = 'date-time' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaFor200ResponseBodyApplicationJson': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_date_time_format_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_date_time_format_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_date_time_format_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_date_time_format_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostDateTimeFormatResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_date_time_format_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_date_time_format_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_date_time_format_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_date_time_format_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_date_time_format_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_date_time_format_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post.pyi deleted file mode 100644 index 865b451de20..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,254 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - - -class SchemaFor200ResponseBodyApplicationJson( - schemas.DateTimeBase, - schemas.AnyTypeSchema, -): - - - class MetaOapg: - format = 'date-time' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaFor200ResponseBodyApplicationJson': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_date_time_format_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_date_time_format_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_date_time_format_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_date_time_format_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostDateTimeFormatResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_date_time_format_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_date_time_format_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_date_time_format_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_date_time_format_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_date_time_format_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_date_time_format_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/__init__.py deleted file mode 100644 index 0946a580d73..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_email_format_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_EMAIL_FORMAT_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post.py deleted file mode 100644 index ee286e283b7..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post.py +++ /dev/null @@ -1,258 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from . import path - - - -class SchemaFor200ResponseBodyApplicationJson( - schemas.AnyTypeSchema, -): - - - class MetaOapg: - format = 'email' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaFor200ResponseBodyApplicationJson': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_email_format_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_email_format_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_email_format_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_email_format_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostEmailFormatResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_email_format_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_email_format_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_email_format_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_email_format_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_email_format_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_email_format_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post.pyi deleted file mode 100644 index 5c95b257433..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,253 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - - -class SchemaFor200ResponseBodyApplicationJson( - schemas.AnyTypeSchema, -): - - - class MetaOapg: - format = 'email' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaFor200ResponseBodyApplicationJson': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_email_format_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_email_format_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_email_format_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_email_format_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostEmailFormatResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_email_format_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_email_format_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_email_format_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_email_format_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_email_format_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_email_format_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/__init__.py deleted file mode 100644 index 974d688885b..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_enum_with0_does_not_match_false_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_ENUM_WITH0DOES_NOT_MATCH_FALSE_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post.py deleted file mode 100644 index 1f6ca70ec90..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.enum_with0_does_not_match_false import EnumWith0DoesNotMatchFalse - -from . import path - -SchemaFor200ResponseBodyApplicationJson = EnumWith0DoesNotMatchFalse - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_enum_with0_does_not_match_false_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_enum_with0_does_not_match_false_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_enum_with0_does_not_match_false_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_enum_with0_does_not_match_false_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostEnumWith0DoesNotMatchFalseResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_enum_with0_does_not_match_false_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_enum_with0_does_not_match_false_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_enum_with0_does_not_match_false_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_enum_with0_does_not_match_false_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_enum_with0_does_not_match_false_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_enum_with0_does_not_match_false_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post.pyi deleted file mode 100644 index 606fa10bf1e..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.enum_with0_does_not_match_false import EnumWith0DoesNotMatchFalse - -SchemaFor200ResponseBodyApplicationJson = EnumWith0DoesNotMatchFalse - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_enum_with0_does_not_match_false_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_enum_with0_does_not_match_false_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_enum_with0_does_not_match_false_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_enum_with0_does_not_match_false_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostEnumWith0DoesNotMatchFalseResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_enum_with0_does_not_match_false_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_enum_with0_does_not_match_false_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_enum_with0_does_not_match_false_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_enum_with0_does_not_match_false_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_enum_with0_does_not_match_false_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_enum_with0_does_not_match_false_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/__init__.py deleted file mode 100644 index 2234fa84bfb..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_enum_with1_does_not_match_true_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_ENUM_WITH1DOES_NOT_MATCH_TRUE_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post.py deleted file mode 100644 index c19285a5e6d..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.enum_with1_does_not_match_true import EnumWith1DoesNotMatchTrue - -from . import path - -SchemaFor200ResponseBodyApplicationJson = EnumWith1DoesNotMatchTrue - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_enum_with1_does_not_match_true_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_enum_with1_does_not_match_true_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_enum_with1_does_not_match_true_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_enum_with1_does_not_match_true_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostEnumWith1DoesNotMatchTrueResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_enum_with1_does_not_match_true_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_enum_with1_does_not_match_true_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_enum_with1_does_not_match_true_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_enum_with1_does_not_match_true_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_enum_with1_does_not_match_true_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_enum_with1_does_not_match_true_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post.pyi deleted file mode 100644 index 84b4d6043b4..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.enum_with1_does_not_match_true import EnumWith1DoesNotMatchTrue - -SchemaFor200ResponseBodyApplicationJson = EnumWith1DoesNotMatchTrue - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_enum_with1_does_not_match_true_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_enum_with1_does_not_match_true_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_enum_with1_does_not_match_true_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_enum_with1_does_not_match_true_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostEnumWith1DoesNotMatchTrueResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_enum_with1_does_not_match_true_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_enum_with1_does_not_match_true_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_enum_with1_does_not_match_true_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_enum_with1_does_not_match_true_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_enum_with1_does_not_match_true_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_enum_with1_does_not_match_true_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/__init__.py deleted file mode 100644 index 29277c539a0..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_enum_with_escaped_characters_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_ENUM_WITH_ESCAPED_CHARACTERS_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post.py deleted file mode 100644 index 017e5021399..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.enum_with_escaped_characters import EnumWithEscapedCharacters - -from . import path - -SchemaFor200ResponseBodyApplicationJson = EnumWithEscapedCharacters - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_enum_with_escaped_characters_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_enum_with_escaped_characters_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_enum_with_escaped_characters_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_enum_with_escaped_characters_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostEnumWithEscapedCharactersResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_enum_with_escaped_characters_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_enum_with_escaped_characters_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_enum_with_escaped_characters_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_enum_with_escaped_characters_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_enum_with_escaped_characters_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_enum_with_escaped_characters_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post.pyi deleted file mode 100644 index 7c3a996d642..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.enum_with_escaped_characters import EnumWithEscapedCharacters - -SchemaFor200ResponseBodyApplicationJson = EnumWithEscapedCharacters - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_enum_with_escaped_characters_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_enum_with_escaped_characters_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_enum_with_escaped_characters_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_enum_with_escaped_characters_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostEnumWithEscapedCharactersResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_enum_with_escaped_characters_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_enum_with_escaped_characters_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_enum_with_escaped_characters_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_enum_with_escaped_characters_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_enum_with_escaped_characters_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_enum_with_escaped_characters_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/__init__.py deleted file mode 100644 index 754d48ea264..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_enum_with_false_does_not_match0_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_ENUM_WITH_FALSE_DOES_NOT_MATCH0RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post.py deleted file mode 100644 index b3b63b493d2..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.enum_with_false_does_not_match0 import EnumWithFalseDoesNotMatch0 - -from . import path - -SchemaFor200ResponseBodyApplicationJson = EnumWithFalseDoesNotMatch0 - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_enum_with_false_does_not_match0_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_enum_with_false_does_not_match0_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_enum_with_false_does_not_match0_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_enum_with_false_does_not_match0_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostEnumWithFalseDoesNotMatch0ResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_enum_with_false_does_not_match0_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_enum_with_false_does_not_match0_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_enum_with_false_does_not_match0_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_enum_with_false_does_not_match0_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_enum_with_false_does_not_match0_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_enum_with_false_does_not_match0_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post.pyi deleted file mode 100644 index 01289282a0e..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.enum_with_false_does_not_match0 import EnumWithFalseDoesNotMatch0 - -SchemaFor200ResponseBodyApplicationJson = EnumWithFalseDoesNotMatch0 - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_enum_with_false_does_not_match0_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_enum_with_false_does_not_match0_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_enum_with_false_does_not_match0_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_enum_with_false_does_not_match0_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostEnumWithFalseDoesNotMatch0ResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_enum_with_false_does_not_match0_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_enum_with_false_does_not_match0_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_enum_with_false_does_not_match0_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_enum_with_false_does_not_match0_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_enum_with_false_does_not_match0_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_enum_with_false_does_not_match0_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/__init__.py deleted file mode 100644 index 49e7a0e7899..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_enum_with_true_does_not_match1_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_ENUM_WITH_TRUE_DOES_NOT_MATCH1RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post.py deleted file mode 100644 index b70e8aa05e8..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.enum_with_true_does_not_match1 import EnumWithTrueDoesNotMatch1 - -from . import path - -SchemaFor200ResponseBodyApplicationJson = EnumWithTrueDoesNotMatch1 - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_enum_with_true_does_not_match1_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_enum_with_true_does_not_match1_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_enum_with_true_does_not_match1_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_enum_with_true_does_not_match1_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostEnumWithTrueDoesNotMatch1ResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_enum_with_true_does_not_match1_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_enum_with_true_does_not_match1_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_enum_with_true_does_not_match1_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_enum_with_true_does_not_match1_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_enum_with_true_does_not_match1_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_enum_with_true_does_not_match1_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post.pyi deleted file mode 100644 index ad1aa82192f..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.enum_with_true_does_not_match1 import EnumWithTrueDoesNotMatch1 - -SchemaFor200ResponseBodyApplicationJson = EnumWithTrueDoesNotMatch1 - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_enum_with_true_does_not_match1_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_enum_with_true_does_not_match1_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_enum_with_true_does_not_match1_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_enum_with_true_does_not_match1_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostEnumWithTrueDoesNotMatch1ResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_enum_with_true_does_not_match1_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_enum_with_true_does_not_match1_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_enum_with_true_does_not_match1_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_enum_with_true_does_not_match1_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_enum_with_true_does_not_match1_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_enum_with_true_does_not_match1_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/__init__.py deleted file mode 100644 index 9b16fee8d8a..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_enums_in_properties_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_ENUMS_IN_PROPERTIES_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post.py deleted file mode 100644 index c8e117992eb..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.enums_in_properties import EnumsInProperties - -from . import path - -SchemaFor200ResponseBodyApplicationJson = EnumsInProperties - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_enums_in_properties_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_enums_in_properties_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_enums_in_properties_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_enums_in_properties_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostEnumsInPropertiesResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_enums_in_properties_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_enums_in_properties_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_enums_in_properties_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_enums_in_properties_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_enums_in_properties_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_enums_in_properties_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post.pyi deleted file mode 100644 index 7eec1429ac4..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.enums_in_properties import EnumsInProperties - -SchemaFor200ResponseBodyApplicationJson = EnumsInProperties - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_enums_in_properties_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_enums_in_properties_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_enums_in_properties_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_enums_in_properties_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostEnumsInPropertiesResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_enums_in_properties_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_enums_in_properties_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_enums_in_properties_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_enums_in_properties_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_enums_in_properties_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_enums_in_properties_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/__init__.py deleted file mode 100644 index 2aa3240b7b8..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_forbidden_property_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_FORBIDDEN_PROPERTY_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post.py deleted file mode 100644 index 5a8d448e356..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.forbidden_property import ForbiddenProperty - -from . import path - -SchemaFor200ResponseBodyApplicationJson = ForbiddenProperty - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_forbidden_property_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_forbidden_property_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_forbidden_property_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_forbidden_property_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostForbiddenPropertyResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_forbidden_property_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_forbidden_property_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_forbidden_property_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_forbidden_property_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_forbidden_property_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_forbidden_property_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post.pyi deleted file mode 100644 index b6001e78d20..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.forbidden_property import ForbiddenProperty - -SchemaFor200ResponseBodyApplicationJson = ForbiddenProperty - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_forbidden_property_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_forbidden_property_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_forbidden_property_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_forbidden_property_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostForbiddenPropertyResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_forbidden_property_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_forbidden_property_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_forbidden_property_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_forbidden_property_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_forbidden_property_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_forbidden_property_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/__init__.py deleted file mode 100644 index fda9b15ffc9..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_hostname_format_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_HOSTNAME_FORMAT_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post.py deleted file mode 100644 index 43a5c9f81aa..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post.py +++ /dev/null @@ -1,258 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from . import path - - - -class SchemaFor200ResponseBodyApplicationJson( - schemas.AnyTypeSchema, -): - - - class MetaOapg: - format = 'hostname' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaFor200ResponseBodyApplicationJson': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_hostname_format_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_hostname_format_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_hostname_format_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_hostname_format_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostHostnameFormatResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_hostname_format_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_hostname_format_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_hostname_format_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_hostname_format_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_hostname_format_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_hostname_format_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post.pyi deleted file mode 100644 index 1fe8282ca02..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,253 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - - -class SchemaFor200ResponseBodyApplicationJson( - schemas.AnyTypeSchema, -): - - - class MetaOapg: - format = 'hostname' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaFor200ResponseBodyApplicationJson': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_hostname_format_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_hostname_format_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_hostname_format_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_hostname_format_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostHostnameFormatResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_hostname_format_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_hostname_format_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_hostname_format_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_hostname_format_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_hostname_format_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_hostname_format_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/__init__.py deleted file mode 100644 index cc00a644c93..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_integer_type_matches_integers_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_INTEGER_TYPE_MATCHES_INTEGERS_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post.py deleted file mode 100644 index 3b2afaaedf0..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post.py +++ /dev/null @@ -1,236 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from . import path - -SchemaFor200ResponseBodyApplicationJson = schemas.IntSchema - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_integer_type_matches_integers_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_integer_type_matches_integers_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_integer_type_matches_integers_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_integer_type_matches_integers_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostIntegerTypeMatchesIntegersResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_integer_type_matches_integers_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_integer_type_matches_integers_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_integer_type_matches_integers_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_integer_type_matches_integers_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_integer_type_matches_integers_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_integer_type_matches_integers_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post.pyi deleted file mode 100644 index 87225adca5e..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,231 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -SchemaFor200ResponseBodyApplicationJson = schemas.IntSchema - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_integer_type_matches_integers_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_integer_type_matches_integers_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_integer_type_matches_integers_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_integer_type_matches_integers_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostIntegerTypeMatchesIntegersResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_integer_type_matches_integers_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_integer_type_matches_integers_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_integer_type_matches_integers_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_integer_type_matches_integers_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_integer_type_matches_integers_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_integer_type_matches_integers_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/__init__.py deleted file mode 100644 index 511449f6622..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_INVALID_INSTANCE_SHOULD_NOT_RAISE_ERROR_WHEN_FLOAT_DIVISION_INF_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post.py deleted file mode 100644 index 1d4c9093414..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.invalid_instance_should_not_raise_error_when_float_division_inf import InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf - -from . import path - -SchemaFor200ResponseBodyApplicationJson = InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post.pyi deleted file mode 100644 index a35b8e66278..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.invalid_instance_should_not_raise_error_when_float_division_inf import InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf - -SchemaFor200ResponseBodyApplicationJson = InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/__init__.py deleted file mode 100644 index fb4cadd1165..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_invalid_string_value_for_default_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_INVALID_STRING_VALUE_FOR_DEFAULT_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post.py deleted file mode 100644 index 578b5d1f05a..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.invalid_string_value_for_default import InvalidStringValueForDefault - -from . import path - -SchemaFor200ResponseBodyApplicationJson = InvalidStringValueForDefault - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_invalid_string_value_for_default_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_invalid_string_value_for_default_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_invalid_string_value_for_default_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_invalid_string_value_for_default_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostInvalidStringValueForDefaultResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_invalid_string_value_for_default_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_invalid_string_value_for_default_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_invalid_string_value_for_default_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_invalid_string_value_for_default_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_invalid_string_value_for_default_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_invalid_string_value_for_default_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post.pyi deleted file mode 100644 index b177c7f62b1..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.invalid_string_value_for_default import InvalidStringValueForDefault - -SchemaFor200ResponseBodyApplicationJson = InvalidStringValueForDefault - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_invalid_string_value_for_default_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_invalid_string_value_for_default_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_invalid_string_value_for_default_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_invalid_string_value_for_default_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostInvalidStringValueForDefaultResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_invalid_string_value_for_default_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_invalid_string_value_for_default_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_invalid_string_value_for_default_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_invalid_string_value_for_default_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_invalid_string_value_for_default_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_invalid_string_value_for_default_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/__init__.py deleted file mode 100644 index 1b7b9c3555a..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_ipv4_format_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_IPV4FORMAT_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post.py deleted file mode 100644 index 30d1288b479..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post.py +++ /dev/null @@ -1,258 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from . import path - - - -class SchemaFor200ResponseBodyApplicationJson( - schemas.AnyTypeSchema, -): - - - class MetaOapg: - format = 'ipv4' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaFor200ResponseBodyApplicationJson': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_ipv4_format_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_ipv4_format_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_ipv4_format_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_ipv4_format_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostIpv4FormatResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_ipv4_format_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_ipv4_format_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_ipv4_format_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_ipv4_format_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ipv4_format_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ipv4_format_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post.pyi deleted file mode 100644 index 0876cdbf06d..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,253 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - - -class SchemaFor200ResponseBodyApplicationJson( - schemas.AnyTypeSchema, -): - - - class MetaOapg: - format = 'ipv4' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaFor200ResponseBodyApplicationJson': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_ipv4_format_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_ipv4_format_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_ipv4_format_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_ipv4_format_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostIpv4FormatResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_ipv4_format_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_ipv4_format_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_ipv4_format_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_ipv4_format_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ipv4_format_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ipv4_format_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/__init__.py deleted file mode 100644 index a1919a789e2..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_ipv6_format_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_IPV6FORMAT_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post.py deleted file mode 100644 index 48b02e2d7fa..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post.py +++ /dev/null @@ -1,258 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from . import path - - - -class SchemaFor200ResponseBodyApplicationJson( - schemas.AnyTypeSchema, -): - - - class MetaOapg: - format = 'ipv6' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaFor200ResponseBodyApplicationJson': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_ipv6_format_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_ipv6_format_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_ipv6_format_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_ipv6_format_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostIpv6FormatResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_ipv6_format_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_ipv6_format_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_ipv6_format_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_ipv6_format_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ipv6_format_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ipv6_format_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post.pyi deleted file mode 100644 index c1f2332964e..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,253 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - - -class SchemaFor200ResponseBodyApplicationJson( - schemas.AnyTypeSchema, -): - - - class MetaOapg: - format = 'ipv6' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaFor200ResponseBodyApplicationJson': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_ipv6_format_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_ipv6_format_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_ipv6_format_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_ipv6_format_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostIpv6FormatResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_ipv6_format_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_ipv6_format_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_ipv6_format_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_ipv6_format_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ipv6_format_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ipv6_format_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/__init__.py deleted file mode 100644 index bd56842c09a..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_json_pointer_format_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_JSON_POINTER_FORMAT_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post.py deleted file mode 100644 index cbe7a00b23c..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post.py +++ /dev/null @@ -1,258 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from . import path - - - -class SchemaFor200ResponseBodyApplicationJson( - schemas.AnyTypeSchema, -): - - - class MetaOapg: - format = 'json-pointer' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaFor200ResponseBodyApplicationJson': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_json_pointer_format_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_json_pointer_format_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_json_pointer_format_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_json_pointer_format_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostJsonPointerFormatResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_json_pointer_format_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_json_pointer_format_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_json_pointer_format_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_json_pointer_format_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_json_pointer_format_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_json_pointer_format_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post.pyi deleted file mode 100644 index 6a636be3f3e..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,253 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - - -class SchemaFor200ResponseBodyApplicationJson( - schemas.AnyTypeSchema, -): - - - class MetaOapg: - format = 'json-pointer' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaFor200ResponseBodyApplicationJson': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_json_pointer_format_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_json_pointer_format_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_json_pointer_format_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_json_pointer_format_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostJsonPointerFormatResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_json_pointer_format_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_json_pointer_format_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_json_pointer_format_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_json_pointer_format_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_json_pointer_format_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_json_pointer_format_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/__init__.py deleted file mode 100644 index 0a37153cc0b..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_maximum_validation_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_MAXIMUM_VALIDATION_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post.py deleted file mode 100644 index b7afe034720..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.maximum_validation import MaximumValidation - -from . import path - -SchemaFor200ResponseBodyApplicationJson = MaximumValidation - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_maximum_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_maximum_validation_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_maximum_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_maximum_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostMaximumValidationResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_maximum_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_maximum_validation_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_maximum_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_maximum_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_maximum_validation_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_maximum_validation_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post.pyi deleted file mode 100644 index c4661e8ea07..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.maximum_validation import MaximumValidation - -SchemaFor200ResponseBodyApplicationJson = MaximumValidation - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_maximum_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_maximum_validation_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_maximum_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_maximum_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostMaximumValidationResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_maximum_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_maximum_validation_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_maximum_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_maximum_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_maximum_validation_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_maximum_validation_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/__init__.py deleted file mode 100644 index eb036d358c4..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_MAXIMUM_VALIDATION_WITH_UNSIGNED_INTEGER_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post.py deleted file mode 100644 index 621037fbb6f..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.maximum_validation_with_unsigned_integer import MaximumValidationWithUnsignedInteger - -from . import path - -SchemaFor200ResponseBodyApplicationJson = MaximumValidationWithUnsignedInteger - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_maximum_validation_with_unsigned_integer_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_maximum_validation_with_unsigned_integer_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_maximum_validation_with_unsigned_integer_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_maximum_validation_with_unsigned_integer_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostMaximumValidationWithUnsignedIntegerResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_maximum_validation_with_unsigned_integer_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_maximum_validation_with_unsigned_integer_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_maximum_validation_with_unsigned_integer_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_maximum_validation_with_unsigned_integer_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_maximum_validation_with_unsigned_integer_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_maximum_validation_with_unsigned_integer_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post.pyi deleted file mode 100644 index 925fb61c8ea..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.maximum_validation_with_unsigned_integer import MaximumValidationWithUnsignedInteger - -SchemaFor200ResponseBodyApplicationJson = MaximumValidationWithUnsignedInteger - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_maximum_validation_with_unsigned_integer_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_maximum_validation_with_unsigned_integer_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_maximum_validation_with_unsigned_integer_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_maximum_validation_with_unsigned_integer_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostMaximumValidationWithUnsignedIntegerResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_maximum_validation_with_unsigned_integer_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_maximum_validation_with_unsigned_integer_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_maximum_validation_with_unsigned_integer_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_maximum_validation_with_unsigned_integer_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_maximum_validation_with_unsigned_integer_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_maximum_validation_with_unsigned_integer_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/__init__.py deleted file mode 100644 index 7c0b46d8d73..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_maxitems_validation_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_MAXITEMS_VALIDATION_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post.py deleted file mode 100644 index e8e3ac4607c..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.maxitems_validation import MaxitemsValidation - -from . import path - -SchemaFor200ResponseBodyApplicationJson = MaxitemsValidation - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_maxitems_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_maxitems_validation_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_maxitems_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_maxitems_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostMaxitemsValidationResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_maxitems_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_maxitems_validation_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_maxitems_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_maxitems_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_maxitems_validation_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_maxitems_validation_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post.pyi deleted file mode 100644 index b4f0f78c742..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.maxitems_validation import MaxitemsValidation - -SchemaFor200ResponseBodyApplicationJson = MaxitemsValidation - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_maxitems_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_maxitems_validation_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_maxitems_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_maxitems_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostMaxitemsValidationResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_maxitems_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_maxitems_validation_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_maxitems_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_maxitems_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_maxitems_validation_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_maxitems_validation_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/__init__.py deleted file mode 100644 index 0fe9a95208b..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_maxlength_validation_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_MAXLENGTH_VALIDATION_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post.py deleted file mode 100644 index eba71da226d..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.maxlength_validation import MaxlengthValidation - -from . import path - -SchemaFor200ResponseBodyApplicationJson = MaxlengthValidation - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_maxlength_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_maxlength_validation_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_maxlength_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_maxlength_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostMaxlengthValidationResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_maxlength_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_maxlength_validation_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_maxlength_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_maxlength_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_maxlength_validation_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_maxlength_validation_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post.pyi deleted file mode 100644 index ca09d8bde8b..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.maxlength_validation import MaxlengthValidation - -SchemaFor200ResponseBodyApplicationJson = MaxlengthValidation - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_maxlength_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_maxlength_validation_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_maxlength_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_maxlength_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostMaxlengthValidationResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_maxlength_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_maxlength_validation_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_maxlength_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_maxlength_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_maxlength_validation_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_maxlength_validation_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/__init__.py deleted file mode 100644 index 109f64b15b3..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_MAXPROPERTIES0MEANS_THE_OBJECT_IS_EMPTY_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post.py deleted file mode 100644 index 2cc7df09dd4..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.maxproperties0_means_the_object_is_empty import Maxproperties0MeansTheObjectIsEmpty - -from . import path - -SchemaFor200ResponseBodyApplicationJson = Maxproperties0MeansTheObjectIsEmpty - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_maxproperties0_means_the_object_is_empty_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_maxproperties0_means_the_object_is_empty_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_maxproperties0_means_the_object_is_empty_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_maxproperties0_means_the_object_is_empty_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostMaxproperties0MeansTheObjectIsEmptyResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_maxproperties0_means_the_object_is_empty_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_maxproperties0_means_the_object_is_empty_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_maxproperties0_means_the_object_is_empty_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_maxproperties0_means_the_object_is_empty_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_maxproperties0_means_the_object_is_empty_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_maxproperties0_means_the_object_is_empty_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post.pyi deleted file mode 100644 index 7813699de15..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.maxproperties0_means_the_object_is_empty import Maxproperties0MeansTheObjectIsEmpty - -SchemaFor200ResponseBodyApplicationJson = Maxproperties0MeansTheObjectIsEmpty - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_maxproperties0_means_the_object_is_empty_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_maxproperties0_means_the_object_is_empty_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_maxproperties0_means_the_object_is_empty_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_maxproperties0_means_the_object_is_empty_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostMaxproperties0MeansTheObjectIsEmptyResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_maxproperties0_means_the_object_is_empty_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_maxproperties0_means_the_object_is_empty_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_maxproperties0_means_the_object_is_empty_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_maxproperties0_means_the_object_is_empty_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_maxproperties0_means_the_object_is_empty_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_maxproperties0_means_the_object_is_empty_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/__init__.py deleted file mode 100644 index 4331ff3b54a..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_maxproperties_validation_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_MAXPROPERTIES_VALIDATION_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post.py deleted file mode 100644 index 72f32e20741..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.maxproperties_validation import MaxpropertiesValidation - -from . import path - -SchemaFor200ResponseBodyApplicationJson = MaxpropertiesValidation - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_maxproperties_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_maxproperties_validation_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_maxproperties_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_maxproperties_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostMaxpropertiesValidationResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_maxproperties_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_maxproperties_validation_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_maxproperties_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_maxproperties_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_maxproperties_validation_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_maxproperties_validation_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post.pyi deleted file mode 100644 index f24ddb8e32b..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.maxproperties_validation import MaxpropertiesValidation - -SchemaFor200ResponseBodyApplicationJson = MaxpropertiesValidation - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_maxproperties_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_maxproperties_validation_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_maxproperties_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_maxproperties_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostMaxpropertiesValidationResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_maxproperties_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_maxproperties_validation_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_maxproperties_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_maxproperties_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_maxproperties_validation_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_maxproperties_validation_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/__init__.py deleted file mode 100644 index ddb4f8db270..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_minimum_validation_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_MINIMUM_VALIDATION_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post.py deleted file mode 100644 index f290947d7e9..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.minimum_validation import MinimumValidation - -from . import path - -SchemaFor200ResponseBodyApplicationJson = MinimumValidation - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_minimum_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_minimum_validation_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_minimum_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_minimum_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostMinimumValidationResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_minimum_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_minimum_validation_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_minimum_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_minimum_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_minimum_validation_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_minimum_validation_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post.pyi deleted file mode 100644 index 82b2ad07cff..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.minimum_validation import MinimumValidation - -SchemaFor200ResponseBodyApplicationJson = MinimumValidation - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_minimum_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_minimum_validation_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_minimum_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_minimum_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostMinimumValidationResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_minimum_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_minimum_validation_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_minimum_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_minimum_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_minimum_validation_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_minimum_validation_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/__init__.py deleted file mode 100644 index 3b5de8d2111..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_MINIMUM_VALIDATION_WITH_SIGNED_INTEGER_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post.py deleted file mode 100644 index ca57d31936d..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.minimum_validation_with_signed_integer import MinimumValidationWithSignedInteger - -from . import path - -SchemaFor200ResponseBodyApplicationJson = MinimumValidationWithSignedInteger - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_minimum_validation_with_signed_integer_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_minimum_validation_with_signed_integer_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_minimum_validation_with_signed_integer_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_minimum_validation_with_signed_integer_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostMinimumValidationWithSignedIntegerResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_minimum_validation_with_signed_integer_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_minimum_validation_with_signed_integer_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_minimum_validation_with_signed_integer_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_minimum_validation_with_signed_integer_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_minimum_validation_with_signed_integer_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_minimum_validation_with_signed_integer_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post.pyi deleted file mode 100644 index 9c9006b70eb..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.minimum_validation_with_signed_integer import MinimumValidationWithSignedInteger - -SchemaFor200ResponseBodyApplicationJson = MinimumValidationWithSignedInteger - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_minimum_validation_with_signed_integer_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_minimum_validation_with_signed_integer_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_minimum_validation_with_signed_integer_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_minimum_validation_with_signed_integer_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostMinimumValidationWithSignedIntegerResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_minimum_validation_with_signed_integer_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_minimum_validation_with_signed_integer_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_minimum_validation_with_signed_integer_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_minimum_validation_with_signed_integer_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_minimum_validation_with_signed_integer_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_minimum_validation_with_signed_integer_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/__init__.py deleted file mode 100644 index 243d71070cd..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_minitems_validation_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_MINITEMS_VALIDATION_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post.py deleted file mode 100644 index 3d50fd67c37..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.minitems_validation import MinitemsValidation - -from . import path - -SchemaFor200ResponseBodyApplicationJson = MinitemsValidation - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_minitems_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_minitems_validation_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_minitems_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_minitems_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostMinitemsValidationResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_minitems_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_minitems_validation_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_minitems_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_minitems_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_minitems_validation_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_minitems_validation_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post.pyi deleted file mode 100644 index 78ae9660ddd..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.minitems_validation import MinitemsValidation - -SchemaFor200ResponseBodyApplicationJson = MinitemsValidation - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_minitems_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_minitems_validation_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_minitems_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_minitems_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostMinitemsValidationResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_minitems_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_minitems_validation_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_minitems_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_minitems_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_minitems_validation_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_minitems_validation_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/__init__.py deleted file mode 100644 index ee102e9b975..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_minlength_validation_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_MINLENGTH_VALIDATION_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post.py deleted file mode 100644 index 7f54aa35a87..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.minlength_validation import MinlengthValidation - -from . import path - -SchemaFor200ResponseBodyApplicationJson = MinlengthValidation - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_minlength_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_minlength_validation_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_minlength_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_minlength_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostMinlengthValidationResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_minlength_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_minlength_validation_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_minlength_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_minlength_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_minlength_validation_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_minlength_validation_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post.pyi deleted file mode 100644 index 5686f4bc8fc..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.minlength_validation import MinlengthValidation - -SchemaFor200ResponseBodyApplicationJson = MinlengthValidation - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_minlength_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_minlength_validation_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_minlength_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_minlength_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostMinlengthValidationResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_minlength_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_minlength_validation_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_minlength_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_minlength_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_minlength_validation_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_minlength_validation_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/__init__.py deleted file mode 100644 index 43828ac6ee4..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_minproperties_validation_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_MINPROPERTIES_VALIDATION_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post.py deleted file mode 100644 index 7cae7fac748..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.minproperties_validation import MinpropertiesValidation - -from . import path - -SchemaFor200ResponseBodyApplicationJson = MinpropertiesValidation - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_minproperties_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_minproperties_validation_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_minproperties_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_minproperties_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostMinpropertiesValidationResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_minproperties_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_minproperties_validation_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_minproperties_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_minproperties_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_minproperties_validation_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_minproperties_validation_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post.pyi deleted file mode 100644 index a8a5fed8e26..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.minproperties_validation import MinpropertiesValidation - -SchemaFor200ResponseBodyApplicationJson = MinpropertiesValidation - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_minproperties_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_minproperties_validation_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_minproperties_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_minproperties_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostMinpropertiesValidationResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_minproperties_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_minproperties_validation_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_minproperties_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_minproperties_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_minproperties_validation_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_minproperties_validation_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/__init__.py deleted file mode 100644 index d5438b625bc..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_NESTED_ALLOF_TO_CHECK_VALIDATION_SEMANTICS_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post.py deleted file mode 100644 index 36122b5c781..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.nested_allof_to_check_validation_semantics import NestedAllofToCheckValidationSemantics - -from . import path - -SchemaFor200ResponseBodyApplicationJson = NestedAllofToCheckValidationSemantics - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_nested_allof_to_check_validation_semantics_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_nested_allof_to_check_validation_semantics_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_nested_allof_to_check_validation_semantics_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_nested_allof_to_check_validation_semantics_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostNestedAllofToCheckValidationSemanticsResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_nested_allof_to_check_validation_semantics_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_nested_allof_to_check_validation_semantics_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_nested_allof_to_check_validation_semantics_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_nested_allof_to_check_validation_semantics_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_nested_allof_to_check_validation_semantics_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_nested_allof_to_check_validation_semantics_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post.pyi deleted file mode 100644 index a7e9a3b1b68..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.nested_allof_to_check_validation_semantics import NestedAllofToCheckValidationSemantics - -SchemaFor200ResponseBodyApplicationJson = NestedAllofToCheckValidationSemantics - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_nested_allof_to_check_validation_semantics_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_nested_allof_to_check_validation_semantics_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_nested_allof_to_check_validation_semantics_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_nested_allof_to_check_validation_semantics_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostNestedAllofToCheckValidationSemanticsResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_nested_allof_to_check_validation_semantics_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_nested_allof_to_check_validation_semantics_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_nested_allof_to_check_validation_semantics_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_nested_allof_to_check_validation_semantics_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_nested_allof_to_check_validation_semantics_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_nested_allof_to_check_validation_semantics_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/__init__.py deleted file mode 100644 index e8b0c6f26ee..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_NESTED_ANYOF_TO_CHECK_VALIDATION_SEMANTICS_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post.py deleted file mode 100644 index 8cb87ce5d8c..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.nested_anyof_to_check_validation_semantics import NestedAnyofToCheckValidationSemantics - -from . import path - -SchemaFor200ResponseBodyApplicationJson = NestedAnyofToCheckValidationSemantics - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_nested_anyof_to_check_validation_semantics_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_nested_anyof_to_check_validation_semantics_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_nested_anyof_to_check_validation_semantics_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_nested_anyof_to_check_validation_semantics_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostNestedAnyofToCheckValidationSemanticsResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_nested_anyof_to_check_validation_semantics_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_nested_anyof_to_check_validation_semantics_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_nested_anyof_to_check_validation_semantics_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_nested_anyof_to_check_validation_semantics_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_nested_anyof_to_check_validation_semantics_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_nested_anyof_to_check_validation_semantics_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post.pyi deleted file mode 100644 index a1774aa0880..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.nested_anyof_to_check_validation_semantics import NestedAnyofToCheckValidationSemantics - -SchemaFor200ResponseBodyApplicationJson = NestedAnyofToCheckValidationSemantics - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_nested_anyof_to_check_validation_semantics_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_nested_anyof_to_check_validation_semantics_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_nested_anyof_to_check_validation_semantics_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_nested_anyof_to_check_validation_semantics_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostNestedAnyofToCheckValidationSemanticsResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_nested_anyof_to_check_validation_semantics_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_nested_anyof_to_check_validation_semantics_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_nested_anyof_to_check_validation_semantics_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_nested_anyof_to_check_validation_semantics_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_nested_anyof_to_check_validation_semantics_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_nested_anyof_to_check_validation_semantics_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/__init__.py deleted file mode 100644 index 9c307628311..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_nested_items_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_NESTED_ITEMS_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post.py deleted file mode 100644 index e1b615ef075..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.nested_items import NestedItems - -from . import path - -SchemaFor200ResponseBodyApplicationJson = NestedItems - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_nested_items_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_nested_items_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_nested_items_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_nested_items_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostNestedItemsResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_nested_items_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_nested_items_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_nested_items_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_nested_items_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_nested_items_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_nested_items_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post.pyi deleted file mode 100644 index 22c26ae93dd..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.nested_items import NestedItems - -SchemaFor200ResponseBodyApplicationJson = NestedItems - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_nested_items_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_nested_items_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_nested_items_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_nested_items_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostNestedItemsResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_nested_items_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_nested_items_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_nested_items_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_nested_items_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_nested_items_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_nested_items_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/__init__.py deleted file mode 100644 index 3db488be784..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_NESTED_ONEOF_TO_CHECK_VALIDATION_SEMANTICS_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post.py deleted file mode 100644 index a489b9f4ff7..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.nested_oneof_to_check_validation_semantics import NestedOneofToCheckValidationSemantics - -from . import path - -SchemaFor200ResponseBodyApplicationJson = NestedOneofToCheckValidationSemantics - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_nested_oneof_to_check_validation_semantics_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_nested_oneof_to_check_validation_semantics_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_nested_oneof_to_check_validation_semantics_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_nested_oneof_to_check_validation_semantics_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostNestedOneofToCheckValidationSemanticsResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_nested_oneof_to_check_validation_semantics_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_nested_oneof_to_check_validation_semantics_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_nested_oneof_to_check_validation_semantics_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_nested_oneof_to_check_validation_semantics_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_nested_oneof_to_check_validation_semantics_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_nested_oneof_to_check_validation_semantics_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post.pyi deleted file mode 100644 index da59ed9b9dd..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.nested_oneof_to_check_validation_semantics import NestedOneofToCheckValidationSemantics - -SchemaFor200ResponseBodyApplicationJson = NestedOneofToCheckValidationSemantics - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_nested_oneof_to_check_validation_semantics_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_nested_oneof_to_check_validation_semantics_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_nested_oneof_to_check_validation_semantics_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_nested_oneof_to_check_validation_semantics_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostNestedOneofToCheckValidationSemanticsResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_nested_oneof_to_check_validation_semantics_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_nested_oneof_to_check_validation_semantics_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_nested_oneof_to_check_validation_semantics_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_nested_oneof_to_check_validation_semantics_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_nested_oneof_to_check_validation_semantics_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_nested_oneof_to_check_validation_semantics_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/__init__.py deleted file mode 100644 index 8af95c890e7..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_not_more_complex_schema_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_NOT_MORE_COMPLEX_SCHEMA_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post.py deleted file mode 100644 index 3f43f74ce9a..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post.py +++ /dev/null @@ -1,307 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from . import path - - - -class SchemaFor200ResponseBodyApplicationJson( - schemas.ComposedSchema, -): - - - class MetaOapg: - - - class not_schema( - schemas.DictSchema - ): - - - class MetaOapg: - - class properties: - foo = schemas.StrSchema - __annotations__ = { - "foo": foo, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["foo", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["foo"]) -> typing.Union[MetaOapg.properties.foo, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["foo", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - foo: typing.Union[MetaOapg.properties.foo, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'not_schema': - return super().__new__( - cls, - *_args, - foo=foo, - _configuration=_configuration, - **kwargs, - ) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaFor200ResponseBodyApplicationJson': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_not_more_complex_schema_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_not_more_complex_schema_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_not_more_complex_schema_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_not_more_complex_schema_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostNotMoreComplexSchemaResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_not_more_complex_schema_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_not_more_complex_schema_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_not_more_complex_schema_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_not_more_complex_schema_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_not_more_complex_schema_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_not_more_complex_schema_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post.pyi deleted file mode 100644 index 0e570fd9572..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - - -class SchemaFor200ResponseBodyApplicationJson( - schemas.ComposedSchema, -): - - - class MetaOapg: - - - class not_schema( - schemas.DictSchema - ): - - - class MetaOapg: - - class properties: - foo = schemas.StrSchema - __annotations__ = { - "foo": foo, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["foo", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["foo"]) -> typing.Union[MetaOapg.properties.foo, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["foo", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - foo: typing.Union[MetaOapg.properties.foo, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'not_schema': - return super().__new__( - cls, - *_args, - foo=foo, - _configuration=_configuration, - **kwargs, - ) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaFor200ResponseBodyApplicationJson': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_not_more_complex_schema_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_not_more_complex_schema_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_not_more_complex_schema_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_not_more_complex_schema_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostNotMoreComplexSchemaResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_not_more_complex_schema_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_not_more_complex_schema_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_not_more_complex_schema_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_not_more_complex_schema_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_not_more_complex_schema_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_not_more_complex_schema_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_response_body_for_content_types/__init__.py deleted file mode 100644 index e832b365dd1..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_not_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_NOT_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post.py deleted file mode 100644 index 6a3c5ee94cd..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post.py +++ /dev/null @@ -1,258 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from . import path - - - -class SchemaFor200ResponseBodyApplicationJson( - schemas.ComposedSchema, -): - - - class MetaOapg: - not_schema = schemas.IntSchema - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaFor200ResponseBodyApplicationJson': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_not_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_not_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_not_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_not_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostNotResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_not_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_not_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_not_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_not_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_not_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_not_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post.pyi deleted file mode 100644 index dbe29a8e4b9..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,253 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - - -class SchemaFor200ResponseBodyApplicationJson( - schemas.ComposedSchema, -): - - - class MetaOapg: - not_schema = schemas.IntSchema - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaFor200ResponseBodyApplicationJson': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_not_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_not_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_not_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_not_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostNotResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_not_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_not_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_not_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_not_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_not_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_not_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/__init__.py deleted file mode 100644 index f91e082d1fe..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_nul_characters_in_strings_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_NUL_CHARACTERS_IN_STRINGS_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post.py deleted file mode 100644 index cabfa961dcf..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.nul_characters_in_strings import NulCharactersInStrings - -from . import path - -SchemaFor200ResponseBodyApplicationJson = NulCharactersInStrings - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_nul_characters_in_strings_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_nul_characters_in_strings_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_nul_characters_in_strings_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_nul_characters_in_strings_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostNulCharactersInStringsResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_nul_characters_in_strings_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_nul_characters_in_strings_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_nul_characters_in_strings_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_nul_characters_in_strings_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_nul_characters_in_strings_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_nul_characters_in_strings_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post.pyi deleted file mode 100644 index 97eb1a58520..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.nul_characters_in_strings import NulCharactersInStrings - -SchemaFor200ResponseBodyApplicationJson = NulCharactersInStrings - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_nul_characters_in_strings_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_nul_characters_in_strings_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_nul_characters_in_strings_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_nul_characters_in_strings_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostNulCharactersInStringsResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_nul_characters_in_strings_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_nul_characters_in_strings_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_nul_characters_in_strings_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_nul_characters_in_strings_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_nul_characters_in_strings_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_nul_characters_in_strings_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/__init__.py deleted file mode 100644 index bc488406d9d..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_NULL_TYPE_MATCHES_ONLY_THE_NULL_OBJECT_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post.py deleted file mode 100644 index db6c8211097..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post.py +++ /dev/null @@ -1,236 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from . import path - -SchemaFor200ResponseBodyApplicationJson = schemas.NoneSchema - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_null_type_matches_only_the_null_object_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_null_type_matches_only_the_null_object_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_null_type_matches_only_the_null_object_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_null_type_matches_only_the_null_object_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_null_type_matches_only_the_null_object_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_null_type_matches_only_the_null_object_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_null_type_matches_only_the_null_object_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_null_type_matches_only_the_null_object_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_null_type_matches_only_the_null_object_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_null_type_matches_only_the_null_object_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post.pyi deleted file mode 100644 index c2210cb8d2a..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,231 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -SchemaFor200ResponseBodyApplicationJson = schemas.NoneSchema - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_null_type_matches_only_the_null_object_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_null_type_matches_only_the_null_object_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_null_type_matches_only_the_null_object_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_null_type_matches_only_the_null_object_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_null_type_matches_only_the_null_object_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_null_type_matches_only_the_null_object_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_null_type_matches_only_the_null_object_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_null_type_matches_only_the_null_object_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_null_type_matches_only_the_null_object_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_null_type_matches_only_the_null_object_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/__init__.py deleted file mode 100644 index 77109139f3e..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_number_type_matches_numbers_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_NUMBER_TYPE_MATCHES_NUMBERS_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post.py deleted file mode 100644 index d0da0ee8b64..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post.py +++ /dev/null @@ -1,236 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from . import path - -SchemaFor200ResponseBodyApplicationJson = schemas.NumberSchema - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_number_type_matches_numbers_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_number_type_matches_numbers_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_number_type_matches_numbers_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_number_type_matches_numbers_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostNumberTypeMatchesNumbersResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_number_type_matches_numbers_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_number_type_matches_numbers_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_number_type_matches_numbers_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_number_type_matches_numbers_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_number_type_matches_numbers_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_number_type_matches_numbers_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post.pyi deleted file mode 100644 index 565ddc34dac..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,231 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -SchemaFor200ResponseBodyApplicationJson = schemas.NumberSchema - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_number_type_matches_numbers_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_number_type_matches_numbers_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_number_type_matches_numbers_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_number_type_matches_numbers_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostNumberTypeMatchesNumbersResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_number_type_matches_numbers_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_number_type_matches_numbers_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_number_type_matches_numbers_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_number_type_matches_numbers_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_number_type_matches_numbers_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_number_type_matches_numbers_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/__init__.py deleted file mode 100644 index b2c02e85caa..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_object_properties_validation_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_OBJECT_PROPERTIES_VALIDATION_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post.py deleted file mode 100644 index da2f6840076..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.object_properties_validation import ObjectPropertiesValidation - -from . import path - -SchemaFor200ResponseBodyApplicationJson = ObjectPropertiesValidation - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_object_properties_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_object_properties_validation_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_object_properties_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_object_properties_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostObjectPropertiesValidationResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_object_properties_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_object_properties_validation_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_object_properties_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_object_properties_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_object_properties_validation_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_object_properties_validation_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post.pyi deleted file mode 100644 index 3da213a42b6..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.object_properties_validation import ObjectPropertiesValidation - -SchemaFor200ResponseBodyApplicationJson = ObjectPropertiesValidation - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_object_properties_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_object_properties_validation_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_object_properties_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_object_properties_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostObjectPropertiesValidationResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_object_properties_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_object_properties_validation_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_object_properties_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_object_properties_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_object_properties_validation_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_object_properties_validation_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/__init__.py deleted file mode 100644 index c069354cd1c..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_object_type_matches_objects_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_OBJECT_TYPE_MATCHES_OBJECTS_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post.py deleted file mode 100644 index 7a6f898ee41..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post.py +++ /dev/null @@ -1,236 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from . import path - -SchemaFor200ResponseBodyApplicationJson = schemas.DictSchema - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_object_type_matches_objects_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_object_type_matches_objects_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_object_type_matches_objects_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_object_type_matches_objects_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostObjectTypeMatchesObjectsResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_object_type_matches_objects_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_object_type_matches_objects_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_object_type_matches_objects_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_object_type_matches_objects_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_object_type_matches_objects_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_object_type_matches_objects_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post.pyi deleted file mode 100644 index 8d95e32fcc3..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,231 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -SchemaFor200ResponseBodyApplicationJson = schemas.DictSchema - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_object_type_matches_objects_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_object_type_matches_objects_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_object_type_matches_objects_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_object_type_matches_objects_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostObjectTypeMatchesObjectsResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_object_type_matches_objects_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_object_type_matches_objects_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_object_type_matches_objects_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_object_type_matches_objects_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_object_type_matches_objects_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_object_type_matches_objects_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/__init__.py deleted file mode 100644 index 2003410c48f..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_oneof_complex_types_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_ONEOF_COMPLEX_TYPES_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post.py deleted file mode 100644 index ba686b0553d..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.oneof_complex_types import OneofComplexTypes - -from . import path - -SchemaFor200ResponseBodyApplicationJson = OneofComplexTypes - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_oneof_complex_types_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_oneof_complex_types_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_oneof_complex_types_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_oneof_complex_types_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostOneofComplexTypesResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_oneof_complex_types_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_oneof_complex_types_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_oneof_complex_types_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_oneof_complex_types_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_oneof_complex_types_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_oneof_complex_types_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post.pyi deleted file mode 100644 index fb610e25012..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.oneof_complex_types import OneofComplexTypes - -SchemaFor200ResponseBodyApplicationJson = OneofComplexTypes - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_oneof_complex_types_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_oneof_complex_types_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_oneof_complex_types_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_oneof_complex_types_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostOneofComplexTypesResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_oneof_complex_types_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_oneof_complex_types_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_oneof_complex_types_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_oneof_complex_types_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_oneof_complex_types_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_oneof_complex_types_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/__init__.py deleted file mode 100644 index 5b88a1224f2..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_oneof_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_ONEOF_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post.py deleted file mode 100644 index 1e8d017506b..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.oneof import Oneof - -from . import path - -SchemaFor200ResponseBodyApplicationJson = Oneof - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_oneof_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_oneof_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_oneof_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_oneof_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostOneofResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_oneof_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_oneof_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_oneof_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_oneof_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_oneof_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_oneof_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post.pyi deleted file mode 100644 index b0b3436cf59..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.oneof import Oneof - -SchemaFor200ResponseBodyApplicationJson = Oneof - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_oneof_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_oneof_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_oneof_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_oneof_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostOneofResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_oneof_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_oneof_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_oneof_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_oneof_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_oneof_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_oneof_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/__init__.py deleted file mode 100644 index 075773cc7ea..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_oneof_with_base_schema_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_ONEOF_WITH_BASE_SCHEMA_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post.py deleted file mode 100644 index 01364c47bae..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.oneof_with_base_schema import OneofWithBaseSchema - -from . import path - -SchemaFor200ResponseBodyApplicationJson = OneofWithBaseSchema - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_oneof_with_base_schema_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_oneof_with_base_schema_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_oneof_with_base_schema_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_oneof_with_base_schema_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostOneofWithBaseSchemaResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_oneof_with_base_schema_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_oneof_with_base_schema_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_oneof_with_base_schema_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_oneof_with_base_schema_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_oneof_with_base_schema_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_oneof_with_base_schema_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post.pyi deleted file mode 100644 index 88cefca69e1..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.oneof_with_base_schema import OneofWithBaseSchema - -SchemaFor200ResponseBodyApplicationJson = OneofWithBaseSchema - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_oneof_with_base_schema_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_oneof_with_base_schema_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_oneof_with_base_schema_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_oneof_with_base_schema_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostOneofWithBaseSchemaResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_oneof_with_base_schema_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_oneof_with_base_schema_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_oneof_with_base_schema_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_oneof_with_base_schema_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_oneof_with_base_schema_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_oneof_with_base_schema_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/__init__.py deleted file mode 100644 index 7640477c2f0..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_oneof_with_empty_schema_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_ONEOF_WITH_EMPTY_SCHEMA_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post.py deleted file mode 100644 index cd618b49b30..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.oneof_with_empty_schema import OneofWithEmptySchema - -from . import path - -SchemaFor200ResponseBodyApplicationJson = OneofWithEmptySchema - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_oneof_with_empty_schema_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_oneof_with_empty_schema_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_oneof_with_empty_schema_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_oneof_with_empty_schema_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostOneofWithEmptySchemaResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_oneof_with_empty_schema_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_oneof_with_empty_schema_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_oneof_with_empty_schema_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_oneof_with_empty_schema_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_oneof_with_empty_schema_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_oneof_with_empty_schema_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post.pyi deleted file mode 100644 index 083ceeaa186..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.oneof_with_empty_schema import OneofWithEmptySchema - -SchemaFor200ResponseBodyApplicationJson = OneofWithEmptySchema - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_oneof_with_empty_schema_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_oneof_with_empty_schema_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_oneof_with_empty_schema_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_oneof_with_empty_schema_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostOneofWithEmptySchemaResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_oneof_with_empty_schema_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_oneof_with_empty_schema_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_oneof_with_empty_schema_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_oneof_with_empty_schema_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_oneof_with_empty_schema_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_oneof_with_empty_schema_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/__init__.py deleted file mode 100644 index 1439a56296e..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_oneof_with_required_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_ONEOF_WITH_REQUIRED_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post.py deleted file mode 100644 index c6d42872827..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.oneof_with_required import OneofWithRequired - -from . import path - -SchemaFor200ResponseBodyApplicationJson = OneofWithRequired - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_oneof_with_required_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_oneof_with_required_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_oneof_with_required_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_oneof_with_required_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostOneofWithRequiredResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_oneof_with_required_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_oneof_with_required_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_oneof_with_required_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_oneof_with_required_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_oneof_with_required_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_oneof_with_required_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post.pyi deleted file mode 100644 index 07c8ce0bca0..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.oneof_with_required import OneofWithRequired - -SchemaFor200ResponseBodyApplicationJson = OneofWithRequired - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_oneof_with_required_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_oneof_with_required_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_oneof_with_required_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_oneof_with_required_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostOneofWithRequiredResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_oneof_with_required_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_oneof_with_required_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_oneof_with_required_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_oneof_with_required_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_oneof_with_required_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_oneof_with_required_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/__init__.py deleted file mode 100644 index f1ac8646a88..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_pattern_is_not_anchored_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_PATTERN_IS_NOT_ANCHORED_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post.py deleted file mode 100644 index 9d866d09c68..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.pattern_is_not_anchored import PatternIsNotAnchored - -from . import path - -SchemaFor200ResponseBodyApplicationJson = PatternIsNotAnchored - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_pattern_is_not_anchored_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_pattern_is_not_anchored_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_pattern_is_not_anchored_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_pattern_is_not_anchored_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostPatternIsNotAnchoredResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_pattern_is_not_anchored_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_pattern_is_not_anchored_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_pattern_is_not_anchored_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_pattern_is_not_anchored_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_pattern_is_not_anchored_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_pattern_is_not_anchored_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post.pyi deleted file mode 100644 index ddf370ce1ca..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.pattern_is_not_anchored import PatternIsNotAnchored - -SchemaFor200ResponseBodyApplicationJson = PatternIsNotAnchored - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_pattern_is_not_anchored_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_pattern_is_not_anchored_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_pattern_is_not_anchored_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_pattern_is_not_anchored_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostPatternIsNotAnchoredResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_pattern_is_not_anchored_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_pattern_is_not_anchored_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_pattern_is_not_anchored_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_pattern_is_not_anchored_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_pattern_is_not_anchored_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_pattern_is_not_anchored_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/__init__.py deleted file mode 100644 index 3789f6ceca7..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_pattern_validation_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_PATTERN_VALIDATION_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post.py deleted file mode 100644 index b57bb80d050..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.pattern_validation import PatternValidation - -from . import path - -SchemaFor200ResponseBodyApplicationJson = PatternValidation - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_pattern_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_pattern_validation_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_pattern_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_pattern_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostPatternValidationResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_pattern_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_pattern_validation_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_pattern_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_pattern_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_pattern_validation_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_pattern_validation_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post.pyi deleted file mode 100644 index 1cf08e265c2..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.pattern_validation import PatternValidation - -SchemaFor200ResponseBodyApplicationJson = PatternValidation - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_pattern_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_pattern_validation_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_pattern_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_pattern_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostPatternValidationResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_pattern_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_pattern_validation_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_pattern_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_pattern_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_pattern_validation_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_pattern_validation_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/__init__.py deleted file mode 100644 index 9aaa4005c48..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_properties_with_escaped_characters_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_PROPERTIES_WITH_ESCAPED_CHARACTERS_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post.py deleted file mode 100644 index ec8ead79772..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.properties_with_escaped_characters import PropertiesWithEscapedCharacters - -from . import path - -SchemaFor200ResponseBodyApplicationJson = PropertiesWithEscapedCharacters - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_properties_with_escaped_characters_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_properties_with_escaped_characters_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_properties_with_escaped_characters_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_properties_with_escaped_characters_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostPropertiesWithEscapedCharactersResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_properties_with_escaped_characters_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_properties_with_escaped_characters_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_properties_with_escaped_characters_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_properties_with_escaped_characters_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_properties_with_escaped_characters_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_properties_with_escaped_characters_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post.pyi deleted file mode 100644 index 8ba842de248..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.properties_with_escaped_characters import PropertiesWithEscapedCharacters - -SchemaFor200ResponseBodyApplicationJson = PropertiesWithEscapedCharacters - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_properties_with_escaped_characters_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_properties_with_escaped_characters_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_properties_with_escaped_characters_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_properties_with_escaped_characters_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostPropertiesWithEscapedCharactersResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_properties_with_escaped_characters_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_properties_with_escaped_characters_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_properties_with_escaped_characters_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_properties_with_escaped_characters_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_properties_with_escaped_characters_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_properties_with_escaped_characters_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/__init__.py deleted file mode 100644 index 424bb192e45..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_PROPERTY_NAMED_REF_THAT_IS_NOT_AREFERENCE_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post.py deleted file mode 100644 index 0bc30e9f40d..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.property_named_ref_that_is_not_a_reference import PropertyNamedRefThatIsNotAReference - -from . import path - -SchemaFor200ResponseBodyApplicationJson = PropertyNamedRefThatIsNotAReference - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_property_named_ref_that_is_not_a_reference_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_property_named_ref_that_is_not_a_reference_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_property_named_ref_that_is_not_a_reference_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_property_named_ref_that_is_not_a_reference_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostPropertyNamedRefThatIsNotAReferenceResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_property_named_ref_that_is_not_a_reference_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_property_named_ref_that_is_not_a_reference_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_property_named_ref_that_is_not_a_reference_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_property_named_ref_that_is_not_a_reference_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_property_named_ref_that_is_not_a_reference_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_property_named_ref_that_is_not_a_reference_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post.pyi deleted file mode 100644 index ae3b5d35ea0..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.property_named_ref_that_is_not_a_reference import PropertyNamedRefThatIsNotAReference - -SchemaFor200ResponseBodyApplicationJson = PropertyNamedRefThatIsNotAReference - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_property_named_ref_that_is_not_a_reference_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_property_named_ref_that_is_not_a_reference_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_property_named_ref_that_is_not_a_reference_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_property_named_ref_that_is_not_a_reference_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostPropertyNamedRefThatIsNotAReferenceResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_property_named_ref_that_is_not_a_reference_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_property_named_ref_that_is_not_a_reference_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_property_named_ref_that_is_not_a_reference_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_property_named_ref_that_is_not_a_reference_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_property_named_ref_that_is_not_a_reference_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_property_named_ref_that_is_not_a_reference_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/__init__.py deleted file mode 100644 index af2e8f8096e..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_ref_in_additionalproperties_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_REF_IN_ADDITIONALPROPERTIES_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post.py deleted file mode 100644 index 3977e5c7a67..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.ref_in_additionalproperties import RefInAdditionalproperties - -from . import path - -SchemaFor200ResponseBodyApplicationJson = RefInAdditionalproperties - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_ref_in_additionalproperties_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_ref_in_additionalproperties_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_ref_in_additionalproperties_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_ref_in_additionalproperties_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostRefInAdditionalpropertiesResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_ref_in_additionalproperties_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_ref_in_additionalproperties_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_ref_in_additionalproperties_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_ref_in_additionalproperties_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ref_in_additionalproperties_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ref_in_additionalproperties_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post.pyi deleted file mode 100644 index 47b877c7265..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.ref_in_additionalproperties import RefInAdditionalproperties - -SchemaFor200ResponseBodyApplicationJson = RefInAdditionalproperties - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_ref_in_additionalproperties_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_ref_in_additionalproperties_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_ref_in_additionalproperties_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_ref_in_additionalproperties_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostRefInAdditionalpropertiesResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_ref_in_additionalproperties_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_ref_in_additionalproperties_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_ref_in_additionalproperties_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_ref_in_additionalproperties_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ref_in_additionalproperties_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ref_in_additionalproperties_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/__init__.py deleted file mode 100644 index 2aff994d8f8..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_ref_in_allof_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_REF_IN_ALLOF_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post.py deleted file mode 100644 index 44daed19b53..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.ref_in_allof import RefInAllof - -from . import path - -SchemaFor200ResponseBodyApplicationJson = RefInAllof - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_ref_in_allof_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_ref_in_allof_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_ref_in_allof_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_ref_in_allof_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostRefInAllofResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_ref_in_allof_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_ref_in_allof_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_ref_in_allof_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_ref_in_allof_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ref_in_allof_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ref_in_allof_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post.pyi deleted file mode 100644 index d1c63f5d24b..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.ref_in_allof import RefInAllof - -SchemaFor200ResponseBodyApplicationJson = RefInAllof - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_ref_in_allof_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_ref_in_allof_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_ref_in_allof_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_ref_in_allof_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostRefInAllofResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_ref_in_allof_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_ref_in_allof_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_ref_in_allof_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_ref_in_allof_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ref_in_allof_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ref_in_allof_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/__init__.py deleted file mode 100644 index 662467ec6dd..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_ref_in_anyof_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_REF_IN_ANYOF_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post.py deleted file mode 100644 index 251abc4156c..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.ref_in_anyof import RefInAnyof - -from . import path - -SchemaFor200ResponseBodyApplicationJson = RefInAnyof - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_ref_in_anyof_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_ref_in_anyof_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_ref_in_anyof_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_ref_in_anyof_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostRefInAnyofResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_ref_in_anyof_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_ref_in_anyof_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_ref_in_anyof_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_ref_in_anyof_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ref_in_anyof_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ref_in_anyof_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post.pyi deleted file mode 100644 index 8cd1b4fc063..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.ref_in_anyof import RefInAnyof - -SchemaFor200ResponseBodyApplicationJson = RefInAnyof - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_ref_in_anyof_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_ref_in_anyof_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_ref_in_anyof_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_ref_in_anyof_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostRefInAnyofResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_ref_in_anyof_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_ref_in_anyof_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_ref_in_anyof_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_ref_in_anyof_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ref_in_anyof_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ref_in_anyof_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/__init__.py deleted file mode 100644 index 5f4fef45816..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_ref_in_items_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_REF_IN_ITEMS_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post.py deleted file mode 100644 index 86efdb62556..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.ref_in_items import RefInItems - -from . import path - -SchemaFor200ResponseBodyApplicationJson = RefInItems - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_ref_in_items_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_ref_in_items_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_ref_in_items_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_ref_in_items_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostRefInItemsResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_ref_in_items_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_ref_in_items_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_ref_in_items_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_ref_in_items_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ref_in_items_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ref_in_items_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post.pyi deleted file mode 100644 index 2dab7883e37..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.ref_in_items import RefInItems - -SchemaFor200ResponseBodyApplicationJson = RefInItems - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_ref_in_items_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_ref_in_items_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_ref_in_items_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_ref_in_items_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostRefInItemsResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_ref_in_items_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_ref_in_items_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_ref_in_items_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_ref_in_items_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ref_in_items_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ref_in_items_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/__init__.py deleted file mode 100644 index 81c335c672f..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_ref_in_not_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_REF_IN_NOT_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post.py deleted file mode 100644 index 02d7ded6679..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post.py +++ /dev/null @@ -1,263 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.property_named_ref_that_is_not_a_reference import PropertyNamedRefThatIsNotAReference - -from . import path - - - -class SchemaFor200ResponseBodyApplicationJson( - schemas.ComposedSchema, -): - - - class MetaOapg: - - @staticmethod - def not_schema() -> typing.Type['PropertyNamedRefThatIsNotAReference']: - return PropertyNamedRefThatIsNotAReference - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaFor200ResponseBodyApplicationJson': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_ref_in_not_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_ref_in_not_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_ref_in_not_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_ref_in_not_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostRefInNotResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_ref_in_not_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_ref_in_not_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_ref_in_not_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_ref_in_not_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ref_in_not_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ref_in_not_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post.pyi deleted file mode 100644 index 4583198739a..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,258 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.property_named_ref_that_is_not_a_reference import PropertyNamedRefThatIsNotAReference - - - -class SchemaFor200ResponseBodyApplicationJson( - schemas.ComposedSchema, -): - - - class MetaOapg: - - @staticmethod - def not_schema() -> typing.Type['PropertyNamedRefThatIsNotAReference']: - return PropertyNamedRefThatIsNotAReference - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaFor200ResponseBodyApplicationJson': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_ref_in_not_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_ref_in_not_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_ref_in_not_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_ref_in_not_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostRefInNotResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_ref_in_not_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_ref_in_not_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_ref_in_not_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_ref_in_not_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ref_in_not_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ref_in_not_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/__init__.py deleted file mode 100644 index 40113e93f25..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_ref_in_oneof_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_REF_IN_ONEOF_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post.py deleted file mode 100644 index 8e41ae0ac32..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.ref_in_oneof import RefInOneof - -from . import path - -SchemaFor200ResponseBodyApplicationJson = RefInOneof - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_ref_in_oneof_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_ref_in_oneof_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_ref_in_oneof_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_ref_in_oneof_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostRefInOneofResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_ref_in_oneof_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_ref_in_oneof_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_ref_in_oneof_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_ref_in_oneof_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ref_in_oneof_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ref_in_oneof_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post.pyi deleted file mode 100644 index 17d53c1870f..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.ref_in_oneof import RefInOneof - -SchemaFor200ResponseBodyApplicationJson = RefInOneof - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_ref_in_oneof_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_ref_in_oneof_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_ref_in_oneof_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_ref_in_oneof_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostRefInOneofResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_ref_in_oneof_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_ref_in_oneof_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_ref_in_oneof_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_ref_in_oneof_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ref_in_oneof_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ref_in_oneof_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/__init__.py deleted file mode 100644 index 46badf3657d..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_ref_in_property_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_REF_IN_PROPERTY_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post.py deleted file mode 100644 index 0bd6aa8eee7..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.ref_in_property import RefInProperty - -from . import path - -SchemaFor200ResponseBodyApplicationJson = RefInProperty - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_ref_in_property_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_ref_in_property_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_ref_in_property_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_ref_in_property_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostRefInPropertyResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_ref_in_property_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_ref_in_property_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_ref_in_property_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_ref_in_property_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ref_in_property_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ref_in_property_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post.pyi deleted file mode 100644 index 8c5ad980063..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.ref_in_property import RefInProperty - -SchemaFor200ResponseBodyApplicationJson = RefInProperty - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_ref_in_property_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_ref_in_property_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_ref_in_property_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_ref_in_property_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostRefInPropertyResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_ref_in_property_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_ref_in_property_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_ref_in_property_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_ref_in_property_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ref_in_property_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_ref_in_property_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/__init__.py deleted file mode 100644 index 5d1b90f2672..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_required_default_validation_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_REQUIRED_DEFAULT_VALIDATION_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post.py deleted file mode 100644 index 2f004f5dd0e..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.required_default_validation import RequiredDefaultValidation - -from . import path - -SchemaFor200ResponseBodyApplicationJson = RequiredDefaultValidation - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_required_default_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_required_default_validation_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_required_default_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_required_default_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostRequiredDefaultValidationResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_required_default_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_required_default_validation_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_required_default_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_required_default_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_required_default_validation_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_required_default_validation_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post.pyi deleted file mode 100644 index c1bef2edb94..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.required_default_validation import RequiredDefaultValidation - -SchemaFor200ResponseBodyApplicationJson = RequiredDefaultValidation - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_required_default_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_required_default_validation_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_required_default_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_required_default_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostRequiredDefaultValidationResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_required_default_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_required_default_validation_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_required_default_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_required_default_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_required_default_validation_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_required_default_validation_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/__init__.py deleted file mode 100644 index b17c030e827..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_required_validation_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_REQUIRED_VALIDATION_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post.py deleted file mode 100644 index f93165b3247..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.required_validation import RequiredValidation - -from . import path - -SchemaFor200ResponseBodyApplicationJson = RequiredValidation - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_required_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_required_validation_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_required_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_required_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostRequiredValidationResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_required_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_required_validation_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_required_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_required_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_required_validation_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_required_validation_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post.pyi deleted file mode 100644 index 3ca538228c9..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.required_validation import RequiredValidation - -SchemaFor200ResponseBodyApplicationJson = RequiredValidation - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_required_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_required_validation_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_required_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_required_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostRequiredValidationResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_required_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_required_validation_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_required_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_required_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_required_validation_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_required_validation_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/__init__.py deleted file mode 100644 index a890c56e6ec..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_required_with_empty_array_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_REQUIRED_WITH_EMPTY_ARRAY_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post.py deleted file mode 100644 index 5d0c96f7a3f..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.required_with_empty_array import RequiredWithEmptyArray - -from . import path - -SchemaFor200ResponseBodyApplicationJson = RequiredWithEmptyArray - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_required_with_empty_array_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_required_with_empty_array_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_required_with_empty_array_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_required_with_empty_array_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostRequiredWithEmptyArrayResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_required_with_empty_array_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_required_with_empty_array_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_required_with_empty_array_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_required_with_empty_array_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_required_with_empty_array_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_required_with_empty_array_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post.pyi deleted file mode 100644 index 007808a372e..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.required_with_empty_array import RequiredWithEmptyArray - -SchemaFor200ResponseBodyApplicationJson = RequiredWithEmptyArray - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_required_with_empty_array_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_required_with_empty_array_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_required_with_empty_array_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_required_with_empty_array_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostRequiredWithEmptyArrayResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_required_with_empty_array_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_required_with_empty_array_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_required_with_empty_array_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_required_with_empty_array_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_required_with_empty_array_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_required_with_empty_array_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/__init__.py deleted file mode 100644 index b9fb929544f..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_required_with_escaped_characters_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_REQUIRED_WITH_ESCAPED_CHARACTERS_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post.py deleted file mode 100644 index f85c67a6312..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post.py +++ /dev/null @@ -1,266 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from . import path - - - -class SchemaFor200ResponseBodyApplicationJson( - schemas.AnyTypeSchema, -): - - - class MetaOapg: - required = { - "foo\"bar", - "foo\nbar", - "foo\fbar", - "foo\tbar", - "foo\rbar", - "foo\\bar", - } - - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaFor200ResponseBodyApplicationJson': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_required_with_escaped_characters_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_required_with_escaped_characters_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_required_with_escaped_characters_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_required_with_escaped_characters_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostRequiredWithEscapedCharactersResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_required_with_escaped_characters_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_required_with_escaped_characters_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_required_with_escaped_characters_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_required_with_escaped_characters_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_required_with_escaped_characters_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_required_with_escaped_characters_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post.pyi deleted file mode 100644 index 1325cdbe859..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,261 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - - -class SchemaFor200ResponseBodyApplicationJson( - schemas.AnyTypeSchema, -): - - - class MetaOapg: - required = { - "foo\"bar", - "foo\nbar", - "foo\fbar", - "foo\tbar", - "foo\rbar", - "foo\\bar", - } - - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaFor200ResponseBodyApplicationJson': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_required_with_escaped_characters_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_required_with_escaped_characters_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_required_with_escaped_characters_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_required_with_escaped_characters_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostRequiredWithEscapedCharactersResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_required_with_escaped_characters_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_required_with_escaped_characters_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_required_with_escaped_characters_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_required_with_escaped_characters_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_required_with_escaped_characters_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_required_with_escaped_characters_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/__init__.py deleted file mode 100644 index 5434927f1ff..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_simple_enum_validation_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_SIMPLE_ENUM_VALIDATION_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post.py deleted file mode 100644 index 65e29f541ca..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.simple_enum_validation import SimpleEnumValidation - -from . import path - -SchemaFor200ResponseBodyApplicationJson = SimpleEnumValidation - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_simple_enum_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_simple_enum_validation_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_simple_enum_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_simple_enum_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostSimpleEnumValidationResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_simple_enum_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_simple_enum_validation_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_simple_enum_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_simple_enum_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_simple_enum_validation_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_simple_enum_validation_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post.pyi deleted file mode 100644 index 4b580ac35fc..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.simple_enum_validation import SimpleEnumValidation - -SchemaFor200ResponseBodyApplicationJson = SimpleEnumValidation - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_simple_enum_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_simple_enum_validation_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_simple_enum_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_simple_enum_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostSimpleEnumValidationResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_simple_enum_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_simple_enum_validation_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_simple_enum_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_simple_enum_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_simple_enum_validation_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_simple_enum_validation_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/__init__.py deleted file mode 100644 index 0e9991d012d..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_string_type_matches_strings_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_STRING_TYPE_MATCHES_STRINGS_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post.py deleted file mode 100644 index a5453c23391..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post.py +++ /dev/null @@ -1,236 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from . import path - -SchemaFor200ResponseBodyApplicationJson = schemas.StrSchema - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_string_type_matches_strings_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_string_type_matches_strings_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_string_type_matches_strings_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_string_type_matches_strings_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostStringTypeMatchesStringsResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_string_type_matches_strings_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_string_type_matches_strings_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_string_type_matches_strings_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_string_type_matches_strings_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_string_type_matches_strings_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_string_type_matches_strings_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post.pyi deleted file mode 100644 index 739044826e4..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,231 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -SchemaFor200ResponseBodyApplicationJson = schemas.StrSchema - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_string_type_matches_strings_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_string_type_matches_strings_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_string_type_matches_strings_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_string_type_matches_strings_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostStringTypeMatchesStringsResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_string_type_matches_strings_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_string_type_matches_strings_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_string_type_matches_strings_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_string_type_matches_strings_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_string_type_matches_strings_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_string_type_matches_strings_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/__init__.py deleted file mode 100644 index ec8ccdc38e5..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_THE_DEFAULT_KEYWORD_DOES_NOT_DO_ANYTHING_IF_THE_PROPERTY_IS_MISSING_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post.py deleted file mode 100644 index b526e4e77a6..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.the_default_keyword_does_not_do_anything_if_the_property_is_missing import TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing - -from . import path - -SchemaFor200ResponseBodyApplicationJson = TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post.pyi deleted file mode 100644 index 15ccfbb0425..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.the_default_keyword_does_not_do_anything_if_the_property_is_missing import TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing - -SchemaFor200ResponseBodyApplicationJson = TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/__init__.py deleted file mode 100644 index f40589c90cc..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_uniqueitems_false_validation_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_UNIQUEITEMS_FALSE_VALIDATION_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post.py deleted file mode 100644 index 172961d6b1f..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.uniqueitems_false_validation import UniqueitemsFalseValidation - -from . import path - -SchemaFor200ResponseBodyApplicationJson = UniqueitemsFalseValidation - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_uniqueitems_false_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_uniqueitems_false_validation_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_uniqueitems_false_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_uniqueitems_false_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostUniqueitemsFalseValidationResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_uniqueitems_false_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_uniqueitems_false_validation_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_uniqueitems_false_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_uniqueitems_false_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_uniqueitems_false_validation_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_uniqueitems_false_validation_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post.pyi deleted file mode 100644 index c96643d3387..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.uniqueitems_false_validation import UniqueitemsFalseValidation - -SchemaFor200ResponseBodyApplicationJson = UniqueitemsFalseValidation - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_uniqueitems_false_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_uniqueitems_false_validation_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_uniqueitems_false_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_uniqueitems_false_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostUniqueitemsFalseValidationResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_uniqueitems_false_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_uniqueitems_false_validation_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_uniqueitems_false_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_uniqueitems_false_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_uniqueitems_false_validation_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_uniqueitems_false_validation_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/__init__.py deleted file mode 100644 index 693706fd005..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_uniqueitems_validation_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_UNIQUEITEMS_VALIDATION_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post.py deleted file mode 100644 index 2fd7618958b..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.uniqueitems_validation import UniqueitemsValidation - -from . import path - -SchemaFor200ResponseBodyApplicationJson = UniqueitemsValidation - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_uniqueitems_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_uniqueitems_validation_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_uniqueitems_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_uniqueitems_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostUniqueitemsValidationResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_uniqueitems_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_uniqueitems_validation_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_uniqueitems_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_uniqueitems_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_uniqueitems_validation_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_uniqueitems_validation_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post.pyi deleted file mode 100644 index 85f01ffb123..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from unit_test_api.model.uniqueitems_validation import UniqueitemsValidation - -SchemaFor200ResponseBodyApplicationJson = UniqueitemsValidation - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_uniqueitems_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_uniqueitems_validation_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_uniqueitems_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_uniqueitems_validation_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostUniqueitemsValidationResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_uniqueitems_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_uniqueitems_validation_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_uniqueitems_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_uniqueitems_validation_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_uniqueitems_validation_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_uniqueitems_validation_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/__init__.py deleted file mode 100644 index d7621b58329..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_uri_format_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_URI_FORMAT_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post.py deleted file mode 100644 index cd654cf4f65..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post.py +++ /dev/null @@ -1,258 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from . import path - - - -class SchemaFor200ResponseBodyApplicationJson( - schemas.AnyTypeSchema, -): - - - class MetaOapg: - format = 'uri' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaFor200ResponseBodyApplicationJson': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_uri_format_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_uri_format_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_uri_format_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_uri_format_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostUriFormatResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_uri_format_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_uri_format_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_uri_format_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_uri_format_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_uri_format_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_uri_format_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post.pyi deleted file mode 100644 index 23e328ef8ad..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,253 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - - -class SchemaFor200ResponseBodyApplicationJson( - schemas.AnyTypeSchema, -): - - - class MetaOapg: - format = 'uri' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaFor200ResponseBodyApplicationJson': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_uri_format_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_uri_format_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_uri_format_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_uri_format_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostUriFormatResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_uri_format_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_uri_format_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_uri_format_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_uri_format_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_uri_format_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_uri_format_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/__init__.py deleted file mode 100644 index dd5c4ffc435..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_uri_reference_format_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_URI_REFERENCE_FORMAT_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post.py deleted file mode 100644 index e42b15bd714..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post.py +++ /dev/null @@ -1,258 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from . import path - - - -class SchemaFor200ResponseBodyApplicationJson( - schemas.AnyTypeSchema, -): - - - class MetaOapg: - format = 'uri-reference' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaFor200ResponseBodyApplicationJson': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_uri_reference_format_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_uri_reference_format_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_uri_reference_format_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_uri_reference_format_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostUriReferenceFormatResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_uri_reference_format_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_uri_reference_format_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_uri_reference_format_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_uri_reference_format_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_uri_reference_format_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_uri_reference_format_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post.pyi deleted file mode 100644 index 636bf07c55d..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,253 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - - -class SchemaFor200ResponseBodyApplicationJson( - schemas.AnyTypeSchema, -): - - - class MetaOapg: - format = 'uri-reference' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaFor200ResponseBodyApplicationJson': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_uri_reference_format_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_uri_reference_format_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_uri_reference_format_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_uri_reference_format_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostUriReferenceFormatResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_uri_reference_format_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_uri_reference_format_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_uri_reference_format_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_uri_reference_format_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_uri_reference_format_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_uri_reference_format_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/__init__.py deleted file mode 100644 index 468a1c4cfd3..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from unit_test_api.paths.response_body_post_uri_template_format_response_body_for_content_types import Api - -from unit_test_api.paths import PathValues - -path = PathValues.RESPONSE_BODY_POST_URI_TEMPLATE_FORMAT_RESPONSE_BODY_FOR_CONTENT_TYPES \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post.py deleted file mode 100644 index 7fe2ce2c2f1..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post.py +++ /dev/null @@ -1,258 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - -from . import path - - - -class SchemaFor200ResponseBodyApplicationJson( - schemas.AnyTypeSchema, -): - - - class MetaOapg: - format = 'uri-template' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaFor200ResponseBodyApplicationJson': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_uri_template_format_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_uri_template_format_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_uri_template_format_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_uri_template_format_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostUriTemplateFormatResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_uri_template_format_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_uri_template_format_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_uri_template_format_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_uri_template_format_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_uri_template_format_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_uri_template_format_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post.pyi deleted file mode 100644 index 1e4b98b1558..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post.pyi +++ /dev/null @@ -1,253 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from unit_test_api import schemas # noqa: F401 - - - -class SchemaFor200ResponseBodyApplicationJson( - schemas.AnyTypeSchema, -): - - - class MetaOapg: - format = 'uri-template' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaFor200ResponseBodyApplicationJson': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_uri_template_format_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_uri_template_format_response_body_for_content_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_uri_template_format_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_uri_template_format_response_body_for_content_types_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostUriTemplateFormatResponseBodyForContentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_uri_template_format_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_uri_template_format_response_body_for_content_types( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_uri_template_format_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_uri_template_format_response_body_for_content_types( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_uri_template_format_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_uri_template_format_response_body_for_content_types_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/rest.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/rest.py deleted file mode 100644 index 6fa80d8b304..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/rest.py +++ /dev/null @@ -1,253 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -import logging -import ssl -from urllib.parse import urlencode -import typing - -import certifi -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from unit_test_api.exceptions import ApiException, ApiValueError - - -logger = logging.getLogger(__name__) - - -class RESTClientObject(object): - - def __init__(self, configuration, pools_size=4, maxsize=None): - # urllib3.PoolManager will pass all kw parameters to connectionpool - # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 - # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 - # maxsize is the number of requests to host that are allowed in parallel # noqa: E501 - # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 - - # cert_reqs - if configuration.verify_ssl: - cert_reqs = ssl.CERT_REQUIRED - else: - cert_reqs = ssl.CERT_NONE - - # ca_certs - if configuration.ssl_ca_cert: - ca_certs = configuration.ssl_ca_cert - else: - # if not set certificate file, use Mozilla's root certificates. - ca_certs = certifi.where() - - addition_pool_args = {} - if configuration.assert_hostname is not None: - addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 - - if configuration.retries is not None: - addition_pool_args['retries'] = configuration.retries - - if configuration.socket_options is not None: - addition_pool_args['socket_options'] = configuration.socket_options - - if maxsize is None: - if configuration.connection_pool_maxsize is not None: - maxsize = configuration.connection_pool_maxsize - else: - maxsize = 4 - - # https pool manager - if configuration.proxy: - self.pool_manager = urllib3.ProxyManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=ca_certs, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - proxy_url=configuration.proxy, - proxy_headers=configuration.proxy_headers, - **addition_pool_args - ) - else: - self.pool_manager = urllib3.PoolManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=ca_certs, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - **addition_pool_args - ) - - def request( - self, - method: str, - url: str, - headers: typing.Optional[HTTPHeaderDict] = None, - fields: typing.Optional[typing.Tuple[typing.Tuple[str, typing.Any], ...]] = None, - body: typing.Optional[typing.Union[str, bytes]] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> urllib3.HTTPResponse: - """Perform requests. - - :param method: http request method - :param url: http request url - :param headers: http request headers - :param body: request body, for other types - :param fields: request parameters for - `application/x-www-form-urlencoded` - or `multipart/form-data` - :param stream: if True, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is False. - :param timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - """ - method = method.upper() - assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', - 'PATCH', 'OPTIONS'] - - if fields and body: - raise ApiValueError( - "body parameter cannot be used with fields parameter." - ) - - fields = fields or {} - headers = headers or {} - - if timeout: - if isinstance(timeout, (int, float)): # noqa: E501,F821 - timeout = urllib3.Timeout(total=timeout) - elif (isinstance(timeout, tuple) and - len(timeout) == 2): - timeout = urllib3.Timeout(connect=timeout[0], read=timeout[1]) - - try: - # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` - if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: - if 'Content-Type' not in headers and body is None: - r = self.pool_manager.request( - method, - url, - preload_content=not stream, - timeout=timeout, - headers=headers - ) - elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 - r = self.pool_manager.request( - method, url, - body=body, - encode_multipart=False, - preload_content=not stream, - timeout=timeout, - headers=headers) - elif headers['Content-Type'] == 'multipart/form-data': - # must del headers['Content-Type'], or the correct - # Content-Type which generated by urllib3 will be - # overwritten. - del headers['Content-Type'] - r = self.pool_manager.request( - method, url, - fields=fields, - encode_multipart=True, - preload_content=not stream, - timeout=timeout, - headers=headers) - # Pass a `string` parameter directly in the body to support - # other content types than Json when `body` argument is - # provided in serialized form - elif isinstance(body, str) or isinstance(body, bytes): - request_body = body - r = self.pool_manager.request( - method, url, - body=request_body, - preload_content=not stream, - timeout=timeout, - headers=headers) - else: - # Cannot generate the request from given parameters - msg = """Cannot prepare a request message for provided - arguments. Please check that your arguments match - declared content type.""" - raise ApiException(status=0, reason=msg) - # For `GET`, `HEAD` - else: - r = self.pool_manager.request(method, url, - preload_content=not stream, - timeout=timeout, - headers=headers) - except urllib3.exceptions.SSLError as e: - msg = "{0}\n{1}".format(type(e).__name__, str(e)) - raise ApiException(status=0, reason=msg) - - if not stream: - # log response body - logger.debug("response body: %s", r.data) - - return r - - def GET(self, url, headers=None, stream=False, - timeout=None, fields=None) -> urllib3.HTTPResponse: - return self.request("GET", url, - headers=headers, - stream=stream, - timeout=timeout, - fields=fields) - - def HEAD(self, url, headers=None, stream=False, - timeout=None, fields=None) -> urllib3.HTTPResponse: - return self.request("HEAD", url, - headers=headers, - stream=stream, - timeout=timeout, - fields=fields) - - def OPTIONS(self, url, headers=None, - body=None, stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: - return self.request("OPTIONS", url, - headers=headers, - stream=stream, - timeout=timeout, - body=body, fields=fields) - - def DELETE(self, url, headers=None, body=None, - stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: - return self.request("DELETE", url, - headers=headers, - stream=stream, - timeout=timeout, - body=body, fields=fields) - - def POST(self, url, headers=None, - body=None, stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: - return self.request("POST", url, - headers=headers, - stream=stream, - timeout=timeout, - body=body, fields=fields) - - def PUT(self, url, headers=None, - body=None, stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: - return self.request("PUT", url, - headers=headers, - stream=stream, - timeout=timeout, - body=body, fields=fields) - - def PATCH(self, url, headers=None, - body=None, stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: - return self.request("PATCH", url, - headers=headers, - stream=stream, - timeout=timeout, - body=body, fields=fields) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/schemas.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/schemas.py deleted file mode 100644 index 7e443c6d5e6..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/schemas.py +++ /dev/null @@ -1,2475 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://openapi-generator.tech -""" - -from collections import defaultdict -from datetime import date, datetime, timedelta # noqa: F401 -import functools -import decimal -import io -import re -import types -import typing -import uuid - -from dateutil.parser.isoparser import isoparser, _takes_ascii -import frozendict - -from unit_test_api.exceptions import ( - ApiTypeError, - ApiValueError, -) -from unit_test_api.configuration import ( - Configuration, -) - - -class Unset(object): - """ - An instance of this class is set as the default value for object type(dict) properties that are optional - When a property has an unset value, that property will not be assigned in the dict - """ - pass - -unset = Unset() - -none_type = type(None) -file_type = io.IOBase - - -class FileIO(io.FileIO): - """ - A class for storing files - Note: this class is not immutable - """ - - def __new__(cls, _arg: typing.Union[io.FileIO, io.BufferedReader]): - if isinstance(_arg, (io.FileIO, io.BufferedReader)): - if _arg.closed: - raise ApiValueError('Invalid file state; file is closed and must be open') - _arg.close() - inst = super(FileIO, cls).__new__(cls, _arg.name) - super(FileIO, inst).__init__(_arg.name) - return inst - raise ApiValueError('FileIO must be passed _arg which contains the open file') - - def __init__(self, _arg: typing.Union[io.FileIO, io.BufferedReader]): - pass - - -def update(d: dict, u: dict): - """ - Adds u to d - Where each dict is defaultdict(set) - """ - if not u: - return d - for k, v in u.items(): - if k not in d: - d[k] = v - else: - d[k] = d[k] | v - - -class ValidationMetadata(frozendict.frozendict): - """ - A class storing metadata that is needed to validate OpenApi Schema payloads - """ - def __new__( - cls, - path_to_item: typing.Tuple[typing.Union[str, int], ...] = tuple(['args[0]']), - from_server: bool = False, - configuration: typing.Optional[Configuration] = None, - seen_classes: typing.FrozenSet[typing.Type] = frozenset(), - validated_path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Type]] = frozendict.frozendict() - ): - """ - Args: - path_to_item: the path to the current data being instantiated. - For {'a': [1]} if the code is handling, 1, then the path is ('args[0]', 'a', 0) - This changes from location to location - from_server: whether or not this data came form the server - True when receiving server data - False when instantiating model with client side data not form the server - This does not change from location to location - configuration: the Configuration instance to use - This is needed because in Configuration: - - one can disable validation checking - This does not change from location to location - seen_classes: when deserializing data that matches multiple schemas, this is used to store - the schemas that have been traversed. This is used to stop processing when a cycle is seen. - This changes from location to location - validated_path_to_schemas: stores the already validated schema classes for a given path location - This does not change from location to location - """ - return super().__new__( - cls, - path_to_item=path_to_item, - from_server=from_server, - configuration=configuration, - seen_classes=seen_classes, - validated_path_to_schemas=validated_path_to_schemas - ) - - def validation_ran_earlier(self, cls: type) -> bool: - validated_schemas = self.validated_path_to_schemas.get(self.path_to_item, set()) - validation_ran_earlier = validated_schemas and cls in validated_schemas - if validation_ran_earlier: - return True - if cls in self.seen_classes: - return True - return False - - @property - def path_to_item(self) -> typing.Tuple[typing.Union[str, int], ...]: - return self.get('path_to_item') - - @property - def from_server(self) -> bool: - return self.get('from_server') - - @property - def configuration(self) -> typing.Optional[Configuration]: - return self.get('configuration') - - @property - def seen_classes(self) -> typing.FrozenSet[typing.Type]: - return self.get('seen_classes') - - @property - def validated_path_to_schemas(self) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Type]]: - return self.get('validated_path_to_schemas') - - -def add_deeper_validated_schemas(validation_metadata: ValidationMetadata, path_to_schemas: dict): - # this is called if validation_ran_earlier and current and deeper locations need to be added - current_path_to_item = validation_metadata.path_to_item - other_path_to_schemas = {} - for path_to_item, schemas in validation_metadata.validated_path_to_schemas.items(): - if len(path_to_item) < len(current_path_to_item): - continue - path_begins_with_current_path = path_to_item[:len(current_path_to_item)] == current_path_to_item - if path_begins_with_current_path: - other_path_to_schemas[path_to_item] = schemas - update(path_to_schemas, other_path_to_schemas) - - -class Singleton: - """ - Enums and singletons are the same - The same instance is returned for a given key of (cls, _arg) - """ - _instances = {} - - def __new__(cls, _arg: typing.Any, **kwargs): - """ - cls base classes: BoolClass, NoneClass, str, decimal.Decimal - The 3rd key is used in the tuple below for a corner case where an enum contains integer 1 - However 1.0 can also be ingested into that enum schema because 1.0 == 1 and - Decimal('1.0') == Decimal('1') - But if we omitted the 3rd value in the key, then Decimal('1.0') would be stored as Decimal('1') - and json serializing that instance would be '1' rather than the expected '1.0' - Adding the 3rd value, the str of _arg ensures that 1.0 -> Decimal('1.0') which is serialized as 1.0 - """ - key = (cls, _arg, str(_arg)) - if key not in cls._instances: - if isinstance(_arg, (none_type, bool, BoolClass, NoneClass)): - inst = super().__new__(cls) - cls._instances[key] = inst - else: - cls._instances[key] = super().__new__(cls, _arg) - return cls._instances[key] - - def __repr__(self): - if isinstance(self, NoneClass): - return f'<{self.__class__.__name__}: None>' - elif isinstance(self, BoolClass): - if bool(self): - return f'<{self.__class__.__name__}: True>' - return f'<{self.__class__.__name__}: False>' - return f'<{self.__class__.__name__}: {super().__repr__()}>' - - -class classproperty: - - def __init__(self, fget): - self.fget = fget - - def __get__(self, owner_self, owner_cls): - return self.fget(owner_cls) - - -class NoneClass(Singleton): - @classproperty - def NONE(cls): - return cls(None) - - def __bool__(self) -> bool: - return False - - -class BoolClass(Singleton): - @classproperty - def TRUE(cls): - return cls(True) - - @classproperty - def FALSE(cls): - return cls(False) - - @functools.lru_cache() - def __bool__(self) -> bool: - for key, instance in self._instances.items(): - if self is instance: - return bool(key[1]) - raise ValueError('Unable to find the boolean value of this instance') - - -class MetaOapgTyped: - exclusive_maximum: typing.Union[int, float] - inclusive_maximum: typing.Union[int, float] - exclusive_minimum: typing.Union[int, float] - inclusive_minimum: typing.Union[int, float] - max_items: int - min_items: int - discriminator: typing.Dict[str, typing.Dict[str, typing.Type['Schema']]] - - - class properties: - # to hold object properties - pass - - additional_properties: typing.Optional[typing.Type['Schema']] - max_properties: int - min_properties: int - all_of: typing.List[typing.Type['Schema']] - one_of: typing.List[typing.Type['Schema']] - any_of: typing.List[typing.Type['Schema']] - not_schema: typing.Type['Schema'] - max_length: int - min_length: int - items: typing.Type['Schema'] - - -class Schema: - """ - the base class of all swagger/openapi schemas/models - """ - __inheritable_primitive_types_set = {decimal.Decimal, str, tuple, frozendict.frozendict, FileIO, bytes, BoolClass, NoneClass} - _types: typing.Set[typing.Type] - MetaOapg = MetaOapgTyped - - @staticmethod - def __get_valid_classes_phrase(input_classes): - """Returns a string phrase describing what types are allowed""" - all_classes = list(input_classes) - all_classes = sorted(all_classes, key=lambda cls: cls.__name__) - all_class_names = [cls.__name__ for cls in all_classes] - if len(all_class_names) == 1: - return "is {0}".format(all_class_names[0]) - return "is one of [{0}]".format(", ".join(all_class_names)) - - @staticmethod - def _get_class_oapg(item_cls: typing.Union[types.FunctionType, staticmethod, typing.Type['Schema']]) -> typing.Type['Schema']: - if isinstance(item_cls, types.FunctionType): - # referenced schema - return item_cls() - elif isinstance(item_cls, staticmethod): - # referenced schema - return item_cls.__func__() - return item_cls - - @classmethod - def __type_error_message( - cls, var_value=None, var_name=None, valid_classes=None, key_type=None - ): - """ - Keyword Args: - var_value (any): the variable which has the type_error - var_name (str): the name of the variable which has the typ error - valid_classes (tuple): the accepted classes for current_item's - value - key_type (bool): False if our value is a value in a dict - True if it is a key in a dict - False if our item is an item in a tuple - """ - key_or_value = "value" - if key_type: - key_or_value = "key" - valid_classes_phrase = cls.__get_valid_classes_phrase(valid_classes) - msg = "Invalid type. Required {1} type {2} and " "passed type was {3}".format( - var_name, - key_or_value, - valid_classes_phrase, - type(var_value).__name__, - ) - return msg - - @classmethod - def __get_type_error(cls, var_value, path_to_item, valid_classes, key_type=False): - error_msg = cls.__type_error_message( - var_name=path_to_item[-1], - var_value=var_value, - valid_classes=valid_classes, - key_type=key_type, - ) - return ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=valid_classes, - key_type=key_type, - ) - - @classmethod - def _validate_oapg( - cls, - arg, - validation_metadata: ValidationMetadata, - ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]]: - """ - Schema _validate_oapg - All keyword validation except for type checking was done in calling stack frames - If those validations passed, the validated classes are collected in path_to_schemas - - Returns: - path_to_schemas: a map of path to schemas - - Raises: - ApiValueError: when a string can't be converted into a date or datetime and it must be one of those classes - ApiTypeError: when the input type is not in the list of allowed spec types - """ - base_class = type(arg) - if base_class not in cls._types: - raise cls.__get_type_error( - arg, - validation_metadata.path_to_item, - cls._types, - key_type=False, - ) - - path_to_schemas = {validation_metadata.path_to_item: set()} - path_to_schemas[validation_metadata.path_to_item].add(cls) - path_to_schemas[validation_metadata.path_to_item].add(base_class) - return path_to_schemas - - @staticmethod - def _process_schema_classes_oapg( - schema_classes: typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]] - ): - """ - Processes and mutates schema_classes - If a SomeSchema is a subclass of DictSchema then remove DictSchema because it is already included - """ - if len(schema_classes) < 2: - return - if len(schema_classes) > 2 and UnsetAnyTypeSchema in schema_classes: - schema_classes.remove(UnsetAnyTypeSchema) - x_schema = schema_type_classes & schema_classes - if not x_schema: - return - x_schema = x_schema.pop() - if any(c is not x_schema and issubclass(c, x_schema) for c in schema_classes): - # needed to not have a mro error in get_new_class - schema_classes.remove(x_schema) - - @classmethod - def __get_new_cls( - cls, - arg, - validation_metadata: ValidationMetadata - ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Type['Schema']]: - """ - Make a new dynamic class and return an instance of that class - We are making an instance of cls, but instead of making cls - make a new class, new_cls - which includes dynamic bases including cls - return an instance of that new class - - Dict property + List Item Assignment Use cases: - 1. value is NOT an instance of the required schema class - the value is validated by _validate_oapg - _validate_oapg returns a key value pair - where the key is the path to the item, and the value will be the required manufactured class - made out of the matching schemas - 2. value is an instance of the correct schema type - the value is NOT validated by _validate_oapg, _validate_oapg only checks that the instance is of the correct schema type - for this value, _validate_oapg does NOT return an entry for it in _path_to_schemas - and in list/dict _get_items_oapg,_get_properties_oapg the value will be directly assigned - because value is of the correct type, and validation was run earlier when the instance was created - """ - _path_to_schemas = {} - if validation_metadata.validation_ran_earlier(cls): - add_deeper_validated_schemas(validation_metadata, _path_to_schemas) - else: - other_path_to_schemas = cls._validate_oapg(arg, validation_metadata=validation_metadata) - update(_path_to_schemas, other_path_to_schemas) - # loop through it make a new class for each entry - # do not modify the returned result because it is cached and we would be modifying the cached value - path_to_schemas = {} - for path, schema_classes in _path_to_schemas.items(): - """ - Use cases - 1. N number of schema classes + enum + type != bool/None, classes in path_to_schemas: tuple/frozendict.frozendict/str/Decimal/bytes/FileIo - needs Singleton added - 2. N number of schema classes + enum + type == bool/None, classes in path_to_schemas: BoolClass/NoneClass - Singleton already added - 3. N number of schema classes, classes in path_to_schemas: BoolClass/NoneClass/tuple/frozendict.frozendict/str/Decimal/bytes/FileIo - """ - cls._process_schema_classes_oapg(schema_classes) - enum_schema = any( - issubclass(this_cls, EnumBase) for this_cls in schema_classes) - inheritable_primitive_type = schema_classes.intersection(cls.__inheritable_primitive_types_set) - chosen_schema_classes = schema_classes - inheritable_primitive_type - suffix = tuple(inheritable_primitive_type) - if enum_schema and suffix[0] not in {NoneClass, BoolClass}: - suffix = (Singleton,) + suffix - - used_classes = tuple(sorted(chosen_schema_classes, key=lambda a_cls: a_cls.__name__)) + suffix - mfg_cls = get_new_class(class_name='DynamicSchema', bases=used_classes) - path_to_schemas[path] = mfg_cls - - return path_to_schemas - - @classmethod - def _get_new_instance_without_conversion_oapg( - cls, - arg: typing.Any, - path_to_item: typing.Tuple[typing.Union[str, int], ...], - path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Type['Schema']] - ): - # We have a Dynamic class and we are making an instance of it - if issubclass(cls, frozendict.frozendict) and issubclass(cls, DictBase): - properties = cls._get_properties_oapg(arg, path_to_item, path_to_schemas) - return super(Schema, cls).__new__(cls, properties) - elif issubclass(cls, tuple) and issubclass(cls, ListBase): - items = cls._get_items_oapg(arg, path_to_item, path_to_schemas) - return super(Schema, cls).__new__(cls, items) - """ - str = openapi str, date, and datetime - decimal.Decimal = openapi int and float - FileIO = openapi binary type and the user inputs a file - bytes = openapi binary type and the user inputs bytes - """ - return super(Schema, cls).__new__(cls, arg) - - @classmethod - def from_openapi_data_oapg( - cls, - arg: typing.Union[ - str, - date, - datetime, - int, - float, - decimal.Decimal, - bool, - None, - 'Schema', - dict, - frozendict.frozendict, - tuple, - list, - io.FileIO, - io.BufferedReader, - bytes - ], - _configuration: typing.Optional[Configuration] - ): - """ - Schema from_openapi_data_oapg - """ - from_server = True - validated_path_to_schemas = {} - arg = cast_to_allowed_types(arg, from_server, validated_path_to_schemas) - validation_metadata = ValidationMetadata( - from_server=from_server, configuration=_configuration, validated_path_to_schemas=validated_path_to_schemas) - path_to_schemas = cls.__get_new_cls(arg, validation_metadata) - new_cls = path_to_schemas[validation_metadata.path_to_item] - new_inst = new_cls._get_new_instance_without_conversion_oapg( - arg, - validation_metadata.path_to_item, - path_to_schemas - ) - return new_inst - - @staticmethod - def __get_input_dict(*args, **kwargs) -> frozendict.frozendict: - input_dict = {} - if args and isinstance(args[0], (dict, frozendict.frozendict)): - input_dict.update(args[0]) - if kwargs: - input_dict.update(kwargs) - return frozendict.frozendict(input_dict) - - @staticmethod - def __remove_unsets(kwargs): - return {key: val for key, val in kwargs.items() if val is not unset} - - def __new__(cls, *_args: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema'], _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema', Unset]): - """ - Schema __new__ - - Args: - _args (int/float/decimal.Decimal/str/list/tuple/dict/frozendict.frozendict/bool/None): the value - kwargs (str, int/float/decimal.Decimal/str/list/tuple/dict/frozendict.frozendict/bool/None): dict values - _configuration: contains the Configuration that enables json schema validation keywords - like minItems, minLength etc - - Note: double underscores are used here because pycharm thinks that these variables - are instance properties if they are named normally :( - """ - __kwargs = cls.__remove_unsets(kwargs) - if not _args and not __kwargs: - raise TypeError( - 'No input given. args or kwargs must be given.' - ) - if not __kwargs and _args and not isinstance(_args[0], dict): - __arg = _args[0] - else: - __arg = cls.__get_input_dict(*_args, **__kwargs) - __from_server = False - __validated_path_to_schemas = {} - __arg = cast_to_allowed_types( - __arg, __from_server, __validated_path_to_schemas) - __validation_metadata = ValidationMetadata( - configuration=_configuration, from_server=__from_server, validated_path_to_schemas=__validated_path_to_schemas) - __path_to_schemas = cls.__get_new_cls(__arg, __validation_metadata) - __new_cls = __path_to_schemas[__validation_metadata.path_to_item] - return __new_cls._get_new_instance_without_conversion_oapg( - __arg, - __validation_metadata.path_to_item, - __path_to_schemas - ) - - def __init__( - self, - *_args: typing.Union[ - dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema'], - _configuration: typing.Optional[Configuration] = None, - **kwargs: typing.Union[ - dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema', Unset - ] - ): - """ - this is needed to fix 'Unexpected argument' warning in pycharm - this code does nothing because all Schema instances are immutable - this means that all input data is passed into and used in new, and after the new instance is made - no new attributes are assigned and init is not used - """ - pass - -""" -import itertools -data_types = ('None', 'FrozenDict', 'Tuple', 'Str', 'Decimal', 'Bool') -type_to_cls = { - 'None': 'NoneClass', - 'FrozenDict': 'frozendict.frozendict', - 'Tuple': 'tuple', - 'Str': 'str', - 'Decimal': 'decimal.Decimal', - 'Bool': 'BoolClass' -} -cls_tuples = [v for v in itertools.combinations(data_types, 5)] -typed_classes = [f"class {''.join(cls_tuple)}Mixin({', '.join(type_to_cls[typ] for typ in cls_tuple)}):\n pass" for cls_tuple in cls_tuples] -for cls in typed_classes: - print(cls) -object_classes = [f"{''.join(cls_tuple)}Mixin = object" for cls_tuple in cls_tuples] -for cls in object_classes: - print(cls) -""" -if typing.TYPE_CHECKING: - # qty 1 - NoneMixin = NoneClass - FrozenDictMixin = frozendict.frozendict - TupleMixin = tuple - StrMixin = str - DecimalMixin = decimal.Decimal - BoolMixin = BoolClass - BytesMixin = bytes - FileMixin = FileIO - # qty 2 - class BinaryMixin(bytes, FileIO): - pass - class NoneFrozenDictMixin(NoneClass, frozendict.frozendict): - pass - class NoneTupleMixin(NoneClass, tuple): - pass - class NoneStrMixin(NoneClass, str): - pass - class NoneDecimalMixin(NoneClass, decimal.Decimal): - pass - class NoneBoolMixin(NoneClass, BoolClass): - pass - class FrozenDictTupleMixin(frozendict.frozendict, tuple): - pass - class FrozenDictStrMixin(frozendict.frozendict, str): - pass - class FrozenDictDecimalMixin(frozendict.frozendict, decimal.Decimal): - pass - class FrozenDictBoolMixin(frozendict.frozendict, BoolClass): - pass - class TupleStrMixin(tuple, str): - pass - class TupleDecimalMixin(tuple, decimal.Decimal): - pass - class TupleBoolMixin(tuple, BoolClass): - pass - class StrDecimalMixin(str, decimal.Decimal): - pass - class StrBoolMixin(str, BoolClass): - pass - class DecimalBoolMixin(decimal.Decimal, BoolClass): - pass - # qty 3 - class NoneFrozenDictTupleMixin(NoneClass, frozendict.frozendict, tuple): - pass - class NoneFrozenDictStrMixin(NoneClass, frozendict.frozendict, str): - pass - class NoneFrozenDictDecimalMixin(NoneClass, frozendict.frozendict, decimal.Decimal): - pass - class NoneFrozenDictBoolMixin(NoneClass, frozendict.frozendict, BoolClass): - pass - class NoneTupleStrMixin(NoneClass, tuple, str): - pass - class NoneTupleDecimalMixin(NoneClass, tuple, decimal.Decimal): - pass - class NoneTupleBoolMixin(NoneClass, tuple, BoolClass): - pass - class NoneStrDecimalMixin(NoneClass, str, decimal.Decimal): - pass - class NoneStrBoolMixin(NoneClass, str, BoolClass): - pass - class NoneDecimalBoolMixin(NoneClass, decimal.Decimal, BoolClass): - pass - class FrozenDictTupleStrMixin(frozendict.frozendict, tuple, str): - pass - class FrozenDictTupleDecimalMixin(frozendict.frozendict, tuple, decimal.Decimal): - pass - class FrozenDictTupleBoolMixin(frozendict.frozendict, tuple, BoolClass): - pass - class FrozenDictStrDecimalMixin(frozendict.frozendict, str, decimal.Decimal): - pass - class FrozenDictStrBoolMixin(frozendict.frozendict, str, BoolClass): - pass - class FrozenDictDecimalBoolMixin(frozendict.frozendict, decimal.Decimal, BoolClass): - pass - class TupleStrDecimalMixin(tuple, str, decimal.Decimal): - pass - class TupleStrBoolMixin(tuple, str, BoolClass): - pass - class TupleDecimalBoolMixin(tuple, decimal.Decimal, BoolClass): - pass - class StrDecimalBoolMixin(str, decimal.Decimal, BoolClass): - pass - # qty 4 - class NoneFrozenDictTupleStrMixin(NoneClass, frozendict.frozendict, tuple, str): - pass - class NoneFrozenDictTupleDecimalMixin(NoneClass, frozendict.frozendict, tuple, decimal.Decimal): - pass - class NoneFrozenDictTupleBoolMixin(NoneClass, frozendict.frozendict, tuple, BoolClass): - pass - class NoneFrozenDictStrDecimalMixin(NoneClass, frozendict.frozendict, str, decimal.Decimal): - pass - class NoneFrozenDictStrBoolMixin(NoneClass, frozendict.frozendict, str, BoolClass): - pass - class NoneFrozenDictDecimalBoolMixin(NoneClass, frozendict.frozendict, decimal.Decimal, BoolClass): - pass - class NoneTupleStrDecimalMixin(NoneClass, tuple, str, decimal.Decimal): - pass - class NoneTupleStrBoolMixin(NoneClass, tuple, str, BoolClass): - pass - class NoneTupleDecimalBoolMixin(NoneClass, tuple, decimal.Decimal, BoolClass): - pass - class NoneStrDecimalBoolMixin(NoneClass, str, decimal.Decimal, BoolClass): - pass - class FrozenDictTupleStrDecimalMixin(frozendict.frozendict, tuple, str, decimal.Decimal): - pass - class FrozenDictTupleStrBoolMixin(frozendict.frozendict, tuple, str, BoolClass): - pass - class FrozenDictTupleDecimalBoolMixin(frozendict.frozendict, tuple, decimal.Decimal, BoolClass): - pass - class FrozenDictStrDecimalBoolMixin(frozendict.frozendict, str, decimal.Decimal, BoolClass): - pass - class TupleStrDecimalBoolMixin(tuple, str, decimal.Decimal, BoolClass): - pass - # qty 5 - class NoneFrozenDictTupleStrDecimalMixin(NoneClass, frozendict.frozendict, tuple, str, decimal.Decimal): - pass - class NoneFrozenDictTupleStrBoolMixin(NoneClass, frozendict.frozendict, tuple, str, BoolClass): - pass - class NoneFrozenDictTupleDecimalBoolMixin(NoneClass, frozendict.frozendict, tuple, decimal.Decimal, BoolClass): - pass - class NoneFrozenDictStrDecimalBoolMixin(NoneClass, frozendict.frozendict, str, decimal.Decimal, BoolClass): - pass - class NoneTupleStrDecimalBoolMixin(NoneClass, tuple, str, decimal.Decimal, BoolClass): - pass - class FrozenDictTupleStrDecimalBoolMixin(frozendict.frozendict, tuple, str, decimal.Decimal, BoolClass): - pass - # qty 6 - class NoneFrozenDictTupleStrDecimalBoolMixin(NoneClass, frozendict.frozendict, tuple, str, decimal.Decimal, BoolClass): - pass - # qty 8 - class NoneFrozenDictTupleStrDecimalBoolFileBytesMixin(NoneClass, frozendict.frozendict, tuple, str, decimal.Decimal, BoolClass, FileIO, bytes): - pass -else: - # qty 1 - class NoneMixin: - _types = {NoneClass} - class FrozenDictMixin: - _types = {frozendict.frozendict} - class TupleMixin: - _types = {tuple} - class StrMixin: - _types = {str} - class DecimalMixin: - _types = {decimal.Decimal} - class BoolMixin: - _types = {BoolClass} - class BytesMixin: - _types = {bytes} - class FileMixin: - _types = {FileIO} - # qty 2 - class BinaryMixin: - _types = {bytes, FileIO} - class NoneFrozenDictMixin: - _types = {NoneClass, frozendict.frozendict} - class NoneTupleMixin: - _types = {NoneClass, tuple} - class NoneStrMixin: - _types = {NoneClass, str} - class NoneDecimalMixin: - _types = {NoneClass, decimal.Decimal} - class NoneBoolMixin: - _types = {NoneClass, BoolClass} - class FrozenDictTupleMixin: - _types = {frozendict.frozendict, tuple} - class FrozenDictStrMixin: - _types = {frozendict.frozendict, str} - class FrozenDictDecimalMixin: - _types = {frozendict.frozendict, decimal.Decimal} - class FrozenDictBoolMixin: - _types = {frozendict.frozendict, BoolClass} - class TupleStrMixin: - _types = {tuple, str} - class TupleDecimalMixin: - _types = {tuple, decimal.Decimal} - class TupleBoolMixin: - _types = {tuple, BoolClass} - class StrDecimalMixin: - _types = {str, decimal.Decimal} - class StrBoolMixin: - _types = {str, BoolClass} - class DecimalBoolMixin: - _types = {decimal.Decimal, BoolClass} - # qty 3 - class NoneFrozenDictTupleMixin: - _types = {NoneClass, frozendict.frozendict, tuple} - class NoneFrozenDictStrMixin: - _types = {NoneClass, frozendict.frozendict, str} - class NoneFrozenDictDecimalMixin: - _types = {NoneClass, frozendict.frozendict, decimal.Decimal} - class NoneFrozenDictBoolMixin: - _types = {NoneClass, frozendict.frozendict, BoolClass} - class NoneTupleStrMixin: - _types = {NoneClass, tuple, str} - class NoneTupleDecimalMixin: - _types = {NoneClass, tuple, decimal.Decimal} - class NoneTupleBoolMixin: - _types = {NoneClass, tuple, BoolClass} - class NoneStrDecimalMixin: - _types = {NoneClass, str, decimal.Decimal} - class NoneStrBoolMixin: - _types = {NoneClass, str, BoolClass} - class NoneDecimalBoolMixin: - _types = {NoneClass, decimal.Decimal, BoolClass} - class FrozenDictTupleStrMixin: - _types = {frozendict.frozendict, tuple, str} - class FrozenDictTupleDecimalMixin: - _types = {frozendict.frozendict, tuple, decimal.Decimal} - class FrozenDictTupleBoolMixin: - _types = {frozendict.frozendict, tuple, BoolClass} - class FrozenDictStrDecimalMixin: - _types = {frozendict.frozendict, str, decimal.Decimal} - class FrozenDictStrBoolMixin: - _types = {frozendict.frozendict, str, BoolClass} - class FrozenDictDecimalBoolMixin: - _types = {frozendict.frozendict, decimal.Decimal, BoolClass} - class TupleStrDecimalMixin: - _types = {tuple, str, decimal.Decimal} - class TupleStrBoolMixin: - _types = {tuple, str, BoolClass} - class TupleDecimalBoolMixin: - _types = {tuple, decimal.Decimal, BoolClass} - class StrDecimalBoolMixin: - _types = {str, decimal.Decimal, BoolClass} - # qty 4 - class NoneFrozenDictTupleStrMixin: - _types = {NoneClass, frozendict.frozendict, tuple, str} - class NoneFrozenDictTupleDecimalMixin: - _types = {NoneClass, frozendict.frozendict, tuple, decimal.Decimal} - class NoneFrozenDictTupleBoolMixin: - _types = {NoneClass, frozendict.frozendict, tuple, BoolClass} - class NoneFrozenDictStrDecimalMixin: - _types = {NoneClass, frozendict.frozendict, str, decimal.Decimal} - class NoneFrozenDictStrBoolMixin: - _types = {NoneClass, frozendict.frozendict, str, BoolClass} - class NoneFrozenDictDecimalBoolMixin: - _types = {NoneClass, frozendict.frozendict, decimal.Decimal, BoolClass} - class NoneTupleStrDecimalMixin: - _types = {NoneClass, tuple, str, decimal.Decimal} - class NoneTupleStrBoolMixin: - _types = {NoneClass, tuple, str, BoolClass} - class NoneTupleDecimalBoolMixin: - _types = {NoneClass, tuple, decimal.Decimal, BoolClass} - class NoneStrDecimalBoolMixin: - _types = {NoneClass, str, decimal.Decimal, BoolClass} - class FrozenDictTupleStrDecimalMixin: - _types = {frozendict.frozendict, tuple, str, decimal.Decimal} - class FrozenDictTupleStrBoolMixin: - _types = {frozendict.frozendict, tuple, str, BoolClass} - class FrozenDictTupleDecimalBoolMixin: - _types = {frozendict.frozendict, tuple, decimal.Decimal, BoolClass} - class FrozenDictStrDecimalBoolMixin: - _types = {frozendict.frozendict, str, decimal.Decimal, BoolClass} - class TupleStrDecimalBoolMixin: - _types = {tuple, str, decimal.Decimal, BoolClass} - # qty 5 - class NoneFrozenDictTupleStrDecimalMixin: - _types = {NoneClass, frozendict.frozendict, tuple, str, decimal.Decimal} - class NoneFrozenDictTupleStrBoolMixin: - _types = {NoneClass, frozendict.frozendict, tuple, str, BoolClass} - class NoneFrozenDictTupleDecimalBoolMixin: - _types = {NoneClass, frozendict.frozendict, tuple, decimal.Decimal, BoolClass} - class NoneFrozenDictStrDecimalBoolMixin: - _types = {NoneClass, frozendict.frozendict, str, decimal.Decimal, BoolClass} - class NoneTupleStrDecimalBoolMixin: - _types = {NoneClass, tuple, str, decimal.Decimal, BoolClass} - class FrozenDictTupleStrDecimalBoolMixin: - _types = {frozendict.frozendict, tuple, str, decimal.Decimal, BoolClass} - # qty 6 - class NoneFrozenDictTupleStrDecimalBoolMixin: - _types = {NoneClass, frozendict.frozendict, tuple, str, decimal.Decimal, BoolClass} - # qty 8 - class NoneFrozenDictTupleStrDecimalBoolFileBytesMixin: - _types = {NoneClass, frozendict.frozendict, tuple, str, decimal.Decimal, BoolClass, FileIO, bytes} - - -class ValidatorBase: - @staticmethod - def _is_json_validation_enabled_oapg(schema_keyword, configuration=None): - """Returns true if JSON schema validation is enabled for the specified - validation keyword. This can be used to skip JSON schema structural validation - as requested in the configuration. - Note: the suffix _oapg stands for openapi python (experimental) generator and - it has been added to prevent collisions with other methods and properties - - Args: - schema_keyword (string): the name of a JSON schema validation keyword. - configuration (Configuration): the configuration class. - """ - - return (configuration is None or - not hasattr(configuration, '_disabled_client_side_validations') or - schema_keyword not in configuration._disabled_client_side_validations) - - @staticmethod - def _raise_validation_error_message_oapg(value, constraint_msg, constraint_value, path_to_item, additional_txt=""): - raise ApiValueError( - "Invalid value `{value}`, {constraint_msg} `{constraint_value}`{additional_txt} at {path_to_item}".format( - value=value, - constraint_msg=constraint_msg, - constraint_value=constraint_value, - additional_txt=additional_txt, - path_to_item=path_to_item, - ) - ) - - -class EnumBase: - @classmethod - def _validate_oapg( - cls, - arg, - validation_metadata: ValidationMetadata, - ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]]: - """ - EnumBase _validate_oapg - Validates that arg is in the enum's allowed values - """ - try: - cls.MetaOapg.enum_value_to_name[arg] - except KeyError: - raise ApiValueError("Invalid value {} passed in to {}, allowed_values={}".format(arg, cls, cls.MetaOapg.enum_value_to_name.keys())) - return super()._validate_oapg(arg, validation_metadata=validation_metadata) - - -class BoolBase: - def is_true_oapg(self) -> bool: - """ - A replacement for x is True - True if the instance is a BoolClass True Singleton - """ - if not issubclass(self.__class__, BoolClass): - return False - return bool(self) - - def is_false_oapg(self) -> bool: - """ - A replacement for x is False - True if the instance is a BoolClass False Singleton - """ - if not issubclass(self.__class__, BoolClass): - return False - return bool(self) is False - - -class NoneBase: - def is_none_oapg(self) -> bool: - """ - A replacement for x is None - True if the instance is a NoneClass None Singleton - """ - if issubclass(self.__class__, NoneClass): - return True - return False - - -class StrBase(ValidatorBase): - MetaOapg: MetaOapgTyped - - @property - def as_str_oapg(self) -> str: - return self - - @property - def as_date_oapg(self) -> date: - raise Exception('not implemented') - - @property - def as_datetime_oapg(self) -> datetime: - raise Exception('not implemented') - - @property - def as_decimal_oapg(self) -> decimal.Decimal: - raise Exception('not implemented') - - @property - def as_uuid_oapg(self) -> uuid.UUID: - raise Exception('not implemented') - - @classmethod - def __check_str_validations( - cls, - arg: str, - validation_metadata: ValidationMetadata - ): - if not hasattr(cls, 'MetaOapg'): - return - if (cls._is_json_validation_enabled_oapg('maxLength', validation_metadata.configuration) and - hasattr(cls.MetaOapg, 'max_length') and - len(arg) > cls.MetaOapg.max_length): - cls._raise_validation_error_message_oapg( - value=arg, - constraint_msg="length must be less than or equal to", - constraint_value=cls.MetaOapg.max_length, - path_to_item=validation_metadata.path_to_item - ) - - if (cls._is_json_validation_enabled_oapg('minLength', validation_metadata.configuration) and - hasattr(cls.MetaOapg, 'min_length') and - len(arg) < cls.MetaOapg.min_length): - cls._raise_validation_error_message_oapg( - value=arg, - constraint_msg="length must be greater than or equal to", - constraint_value=cls.MetaOapg.min_length, - path_to_item=validation_metadata.path_to_item - ) - - if (cls._is_json_validation_enabled_oapg('pattern', validation_metadata.configuration) and - hasattr(cls.MetaOapg, 'regex')): - for regex_dict in cls.MetaOapg.regex: - flags = regex_dict.get('flags', 0) - if not re.search(regex_dict['pattern'], arg, flags=flags): - if flags != 0: - # Don't print the regex flags if the flags are not - # specified in the OAS document. - cls._raise_validation_error_message_oapg( - value=arg, - constraint_msg="must match regular expression", - constraint_value=regex_dict['pattern'], - path_to_item=validation_metadata.path_to_item, - additional_txt=" with flags=`{}`".format(flags) - ) - cls._raise_validation_error_message_oapg( - value=arg, - constraint_msg="must match regular expression", - constraint_value=regex_dict['pattern'], - path_to_item=validation_metadata.path_to_item - ) - - @classmethod - def _validate_oapg( - cls, - arg, - validation_metadata: ValidationMetadata, - ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]]: - """ - StrBase _validate_oapg - Validates that validations pass - """ - if isinstance(arg, str): - cls.__check_str_validations(arg, validation_metadata) - return super()._validate_oapg(arg, validation_metadata=validation_metadata) - - -class UUIDBase: - @property - @functools.lru_cache() - def as_uuid_oapg(self) -> uuid.UUID: - return uuid.UUID(self) - - @classmethod - def __validate_format(cls, arg: typing.Optional[str], validation_metadata: ValidationMetadata): - if isinstance(arg, str): - try: - uuid.UUID(arg) - return True - except ValueError: - raise ApiValueError( - "Invalid value '{}' for type UUID at {}".format(arg, validation_metadata.path_to_item) - ) - - @classmethod - def _validate_oapg( - cls, - arg, - validation_metadata: typing.Optional[ValidationMetadata] = None, - ): - """ - UUIDBase _validate_oapg - """ - cls.__validate_format(arg, validation_metadata=validation_metadata) - return super()._validate_oapg(arg, validation_metadata=validation_metadata) - - -class CustomIsoparser(isoparser): - - @_takes_ascii - def parse_isodatetime(self, dt_str): - components, pos = self._parse_isodate(dt_str) - if len(dt_str) > pos: - if self._sep is None or dt_str[pos:pos + 1] == self._sep: - components += self._parse_isotime(dt_str[pos + 1:]) - else: - raise ValueError('String contains unknown ISO components') - - if len(components) > 3 and components[3] == 24: - components[3] = 0 - return datetime(*components) + timedelta(days=1) - - if len(components) <= 3: - raise ValueError('Value is not a datetime') - - return datetime(*components) - - @_takes_ascii - def parse_isodate(self, datestr): - components, pos = self._parse_isodate(datestr) - - if len(datestr) > pos: - raise ValueError('String contains invalid time components') - - if len(components) > 3: - raise ValueError('String contains invalid time components') - - return date(*components) - - -DEFAULT_ISOPARSER = CustomIsoparser() - - -class DateBase: - @property - @functools.lru_cache() - def as_date_oapg(self) -> date: - return DEFAULT_ISOPARSER.parse_isodate(self) - - @classmethod - def __validate_format(cls, arg: typing.Optional[str], validation_metadata: ValidationMetadata): - if isinstance(arg, str): - try: - DEFAULT_ISOPARSER.parse_isodate(arg) - return True - except ValueError: - raise ApiValueError( - "Value does not conform to the required ISO-8601 date format. " - "Invalid value '{}' for type date at {}".format(arg, validation_metadata.path_to_item) - ) - - @classmethod - def _validate_oapg( - cls, - arg, - validation_metadata: typing.Optional[ValidationMetadata] = None, - ): - """ - DateBase _validate_oapg - """ - cls.__validate_format(arg, validation_metadata=validation_metadata) - return super()._validate_oapg(arg, validation_metadata=validation_metadata) - - -class DateTimeBase: - @property - @functools.lru_cache() - def as_datetime_oapg(self) -> datetime: - return DEFAULT_ISOPARSER.parse_isodatetime(self) - - @classmethod - def __validate_format(cls, arg: typing.Optional[str], validation_metadata: ValidationMetadata): - if isinstance(arg, str): - try: - DEFAULT_ISOPARSER.parse_isodatetime(arg) - return True - except ValueError: - raise ApiValueError( - "Value does not conform to the required ISO-8601 datetime format. " - "Invalid value '{}' for type datetime at {}".format(arg, validation_metadata.path_to_item) - ) - - @classmethod - def _validate_oapg( - cls, - arg, - validation_metadata: ValidationMetadata, - ): - """ - DateTimeBase _validate_oapg - """ - cls.__validate_format(arg, validation_metadata=validation_metadata) - return super()._validate_oapg(arg, validation_metadata=validation_metadata) - - -class DecimalBase: - """ - A class for storing decimals that are sent over the wire as strings - These schemas must remain based on StrBase rather than NumberBase - because picking base classes must be deterministic - """ - - @property - @functools.lru_cache() - def as_decimal_oapg(self) -> decimal.Decimal: - return decimal.Decimal(self) - - @classmethod - def __validate_format(cls, arg: typing.Optional[str], validation_metadata: ValidationMetadata): - if isinstance(arg, str): - try: - decimal.Decimal(arg) - return True - except decimal.InvalidOperation: - raise ApiValueError( - "Value cannot be converted to a decimal. " - "Invalid value '{}' for type decimal at {}".format(arg, validation_metadata.path_to_item) - ) - - @classmethod - def _validate_oapg( - cls, - arg, - validation_metadata: ValidationMetadata, - ): - """ - DecimalBase _validate_oapg - """ - cls.__validate_format(arg, validation_metadata=validation_metadata) - return super()._validate_oapg(arg, validation_metadata=validation_metadata) - - -class NumberBase(ValidatorBase): - MetaOapg: MetaOapgTyped - - @property - def as_int_oapg(self) -> int: - try: - return self._as_int - except AttributeError: - """ - Note: for some numbers like 9.0 they could be represented as an - integer but our code chooses to store them as - >>> Decimal('9.0').as_tuple() - DecimalTuple(sign=0, digits=(9, 0), exponent=-1) - so we can tell that the value came from a float and convert it back to a float - during later serialization - """ - if self.as_tuple().exponent < 0: - # this could be represented as an integer but should be represented as a float - # because that's what it was serialized from - raise ApiValueError(f'{self} is not an integer') - self._as_int = int(self) - return self._as_int - - @property - def as_float_oapg(self) -> float: - try: - return self._as_float - except AttributeError: - if self.as_tuple().exponent >= 0: - raise ApiValueError(f'{self} is not a float') - self._as_float = float(self) - return self._as_float - - @classmethod - def __check_numeric_validations( - cls, - arg, - validation_metadata: ValidationMetadata - ): - if not hasattr(cls, 'MetaOapg'): - return - if cls._is_json_validation_enabled_oapg('multipleOf', - validation_metadata.configuration) and hasattr(cls.MetaOapg, 'multiple_of'): - multiple_of_value = cls.MetaOapg.multiple_of - if (not (float(arg) / multiple_of_value).is_integer()): - # Note 'multipleOf' will be as good as the floating point arithmetic. - cls._raise_validation_error_message_oapg( - value=arg, - constraint_msg="value must be a multiple of", - constraint_value=multiple_of_value, - path_to_item=validation_metadata.path_to_item - ) - - checking_max_or_min_values = any( - hasattr(cls.MetaOapg, validation_key) for validation_key in { - 'exclusive_maximum', - 'inclusive_maximum', - 'exclusive_minimum', - 'inclusive_minimum', - } - ) - if not checking_max_or_min_values: - return - - if (cls._is_json_validation_enabled_oapg('exclusiveMaximum', validation_metadata.configuration) and - hasattr(cls.MetaOapg, 'exclusive_maximum') and - arg >= cls.MetaOapg.exclusive_maximum): - cls._raise_validation_error_message_oapg( - value=arg, - constraint_msg="must be a value less than", - constraint_value=cls.MetaOapg.exclusive_maximum, - path_to_item=validation_metadata.path_to_item - ) - - if (cls._is_json_validation_enabled_oapg('maximum', validation_metadata.configuration) and - hasattr(cls.MetaOapg, 'inclusive_maximum') and - arg > cls.MetaOapg.inclusive_maximum): - cls._raise_validation_error_message_oapg( - value=arg, - constraint_msg="must be a value less than or equal to", - constraint_value=cls.MetaOapg.inclusive_maximum, - path_to_item=validation_metadata.path_to_item - ) - - if (cls._is_json_validation_enabled_oapg('exclusiveMinimum', validation_metadata.configuration) and - hasattr(cls.MetaOapg, 'exclusive_minimum') and - arg <= cls.MetaOapg.exclusive_minimum): - cls._raise_validation_error_message_oapg( - value=arg, - constraint_msg="must be a value greater than", - constraint_value=cls.MetaOapg.exclusive_maximum, - path_to_item=validation_metadata.path_to_item - ) - - if (cls._is_json_validation_enabled_oapg('minimum', validation_metadata.configuration) and - hasattr(cls.MetaOapg, 'inclusive_minimum') and - arg < cls.MetaOapg.inclusive_minimum): - cls._raise_validation_error_message_oapg( - value=arg, - constraint_msg="must be a value greater than or equal to", - constraint_value=cls.MetaOapg.inclusive_minimum, - path_to_item=validation_metadata.path_to_item - ) - - @classmethod - def _validate_oapg( - cls, - arg, - validation_metadata: ValidationMetadata, - ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]]: - """ - NumberBase _validate_oapg - Validates that validations pass - """ - if isinstance(arg, decimal.Decimal): - cls.__check_numeric_validations(arg, validation_metadata) - return super()._validate_oapg(arg, validation_metadata=validation_metadata) - - -class ListBase(ValidatorBase): - MetaOapg: MetaOapgTyped - - @classmethod - def __validate_items(cls, list_items, validation_metadata: ValidationMetadata): - """ - Ensures that: - - values passed in for items are valid - Exceptions will be raised if: - - invalid arguments were passed in - - Args: - list_items: the input list of items - - Raises: - ApiTypeError - for missing required arguments, or for invalid properties - """ - - # if we have definitions for an items schema, use it - # otherwise accept anything - item_cls = getattr(cls.MetaOapg, 'items', UnsetAnyTypeSchema) - item_cls = cls._get_class_oapg(item_cls) - path_to_schemas = {} - for i, value in enumerate(list_items): - item_validation_metadata = ValidationMetadata( - from_server=validation_metadata.from_server, - configuration=validation_metadata.configuration, - path_to_item=validation_metadata.path_to_item+(i,), - validated_path_to_schemas=validation_metadata.validated_path_to_schemas - ) - if item_validation_metadata.validation_ran_earlier(item_cls): - add_deeper_validated_schemas(item_validation_metadata, path_to_schemas) - continue - other_path_to_schemas = item_cls._validate_oapg( - value, validation_metadata=item_validation_metadata) - update(path_to_schemas, other_path_to_schemas) - return path_to_schemas - - @classmethod - def __check_tuple_validations( - cls, arg, - validation_metadata: ValidationMetadata): - if not hasattr(cls, 'MetaOapg'): - return - if (cls._is_json_validation_enabled_oapg('maxItems', validation_metadata.configuration) and - hasattr(cls.MetaOapg, 'max_items') and - len(arg) > cls.MetaOapg.max_items): - cls._raise_validation_error_message_oapg( - value=arg, - constraint_msg="number of items must be less than or equal to", - constraint_value=cls.MetaOapg.max_items, - path_to_item=validation_metadata.path_to_item - ) - - if (cls._is_json_validation_enabled_oapg('minItems', validation_metadata.configuration) and - hasattr(cls.MetaOapg, 'min_items') and - len(arg) < cls.MetaOapg.min_items): - cls._raise_validation_error_message_oapg( - value=arg, - constraint_msg="number of items must be greater than or equal to", - constraint_value=cls.MetaOapg.min_items, - path_to_item=validation_metadata.path_to_item - ) - - if (cls._is_json_validation_enabled_oapg('uniqueItems', validation_metadata.configuration) and - hasattr(cls.MetaOapg, 'unique_items') and cls.MetaOapg.unique_items and arg): - unique_items = set(arg) - if len(arg) > len(unique_items): - cls._raise_validation_error_message_oapg( - value=arg, - constraint_msg="duplicate items were found, and the tuple must not contain duplicates because", - constraint_value='unique_items==True', - path_to_item=validation_metadata.path_to_item - ) - - @classmethod - def _validate_oapg( - cls, - arg, - validation_metadata: ValidationMetadata, - ): - """ - ListBase _validate_oapg - We return dynamic classes of different bases depending upon the inputs - This makes it so: - - the returned instance is always a subclass of our defining schema - - this allows us to check type based on whether an instance is a subclass of a schema - - the returned instance is a serializable type (except for None, True, and False) which are enums - - Returns: - new_cls (type): the new class - - Raises: - ApiValueError: when a string can't be converted into a date or datetime and it must be one of those classes - ApiTypeError: when the input type is not in the list of allowed spec types - """ - if isinstance(arg, tuple): - cls.__check_tuple_validations(arg, validation_metadata) - _path_to_schemas = super()._validate_oapg(arg, validation_metadata=validation_metadata) - if not isinstance(arg, tuple): - return _path_to_schemas - updated_vm = ValidationMetadata( - configuration=validation_metadata.configuration, - from_server=validation_metadata.from_server, - path_to_item=validation_metadata.path_to_item, - seen_classes=validation_metadata.seen_classes | frozenset({cls}), - validated_path_to_schemas=validation_metadata.validated_path_to_schemas - ) - other_path_to_schemas = cls.__validate_items(arg, validation_metadata=updated_vm) - update(_path_to_schemas, other_path_to_schemas) - return _path_to_schemas - - @classmethod - def _get_items_oapg( - cls: 'Schema', - arg: typing.List[typing.Any], - path_to_item: typing.Tuple[typing.Union[str, int], ...], - path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Type['Schema']] - ): - ''' - ListBase _get_items_oapg - ''' - cast_items = [] - - for i, value in enumerate(arg): - item_path_to_item = path_to_item + (i,) - item_cls = path_to_schemas[item_path_to_item] - new_value = item_cls._get_new_instance_without_conversion_oapg( - value, - item_path_to_item, - path_to_schemas - ) - cast_items.append(new_value) - - return cast_items - - -class Discriminable: - MetaOapg: MetaOapgTyped - - @classmethod - def _ensure_discriminator_value_present_oapg(cls, disc_property_name: str, validation_metadata: ValidationMetadata, *args): - if not args or args and disc_property_name not in args[0]: - # The input data does not contain the discriminator property - raise ApiValueError( - "Cannot deserialize input data due to missing discriminator. " - "The discriminator property '{}' is missing at path: {}".format(disc_property_name, validation_metadata.path_to_item) - ) - - @classmethod - def get_discriminated_class_oapg(cls, disc_property_name: str, disc_payload_value: str): - """ - Used in schemas with discriminators - """ - if not hasattr(cls.MetaOapg, 'discriminator'): - return None - disc = cls.MetaOapg.discriminator() - if disc_property_name not in disc: - return None - discriminated_cls = disc[disc_property_name].get(disc_payload_value) - if discriminated_cls is not None: - return discriminated_cls - if not hasattr(cls, 'MetaOapg'): - return None - elif not ( - hasattr(cls.MetaOapg, 'all_of') or - hasattr(cls.MetaOapg, 'one_of') or - hasattr(cls.MetaOapg, 'any_of') - ): - return None - # TODO stop traveling if a cycle is hit - if hasattr(cls.MetaOapg, 'all_of'): - for allof_cls in cls.MetaOapg.all_of(): - discriminated_cls = allof_cls.get_discriminated_class_oapg( - disc_property_name=disc_property_name, disc_payload_value=disc_payload_value) - if discriminated_cls is not None: - return discriminated_cls - if hasattr(cls.MetaOapg, 'one_of'): - for oneof_cls in cls.MetaOapg.one_of(): - discriminated_cls = oneof_cls.get_discriminated_class_oapg( - disc_property_name=disc_property_name, disc_payload_value=disc_payload_value) - if discriminated_cls is not None: - return discriminated_cls - if hasattr(cls.MetaOapg, 'any_of'): - for anyof_cls in cls.MetaOapg.any_of(): - discriminated_cls = anyof_cls.get_discriminated_class_oapg( - disc_property_name=disc_property_name, disc_payload_value=disc_payload_value) - if discriminated_cls is not None: - return discriminated_cls - return None - - -class DictBase(Discriminable, ValidatorBase): - - @classmethod - def __validate_arg_presence(cls, arg): - """ - Ensures that: - - all required arguments are passed in - - the input variable names are valid - - present in properties or - - accepted because additionalProperties exists - Exceptions will be raised if: - - invalid arguments were passed in - - a var_name is invalid if additional_properties == NotAnyTypeSchema - and var_name not in properties.__annotations__ - - required properties were not passed in - - Args: - arg: the input dict - - Raises: - ApiTypeError - for missing required arguments, or for invalid properties - """ - seen_required_properties = set() - invalid_arguments = [] - required_property_names = getattr(cls.MetaOapg, 'required', set()) - additional_properties = getattr(cls.MetaOapg, 'additional_properties', UnsetAnyTypeSchema) - properties = getattr(cls.MetaOapg, 'properties', {}) - property_annotations = getattr(properties, '__annotations__', {}) - for property_name in arg: - if property_name in required_property_names: - seen_required_properties.add(property_name) - elif property_name in property_annotations: - continue - elif additional_properties is not NotAnyTypeSchema: - continue - else: - invalid_arguments.append(property_name) - missing_required_arguments = list(required_property_names - seen_required_properties) - if missing_required_arguments: - missing_required_arguments.sort() - raise ApiTypeError( - "{} is missing {} required argument{}: {}".format( - cls.__name__, - len(missing_required_arguments), - "s" if len(missing_required_arguments) > 1 else "", - missing_required_arguments - ) - ) - if invalid_arguments: - invalid_arguments.sort() - raise ApiTypeError( - "{} was passed {} invalid argument{}: {}".format( - cls.__name__, - len(invalid_arguments), - "s" if len(invalid_arguments) > 1 else "", - invalid_arguments - ) - ) - - @classmethod - def __validate_args(cls, arg, validation_metadata: ValidationMetadata): - """ - Ensures that: - - values passed in for properties are valid - Exceptions will be raised if: - - invalid arguments were passed in - - Args: - arg: the input dict - - Raises: - ApiTypeError - for missing required arguments, or for invalid properties - """ - path_to_schemas = {} - additional_properties = getattr(cls.MetaOapg, 'additional_properties', UnsetAnyTypeSchema) - properties = getattr(cls.MetaOapg, 'properties', {}) - property_annotations = getattr(properties, '__annotations__', {}) - for property_name, value in arg.items(): - path_to_item = validation_metadata.path_to_item+(property_name,) - if property_name in property_annotations: - schema = property_annotations[property_name] - elif additional_properties is not NotAnyTypeSchema: - if additional_properties is UnsetAnyTypeSchema: - """ - If additionalProperties is unset and this path_to_item does not yet have - any validations on it, validate it. - If it already has validations on it, skip this validation. - """ - if path_to_item in path_to_schemas: - continue - schema = additional_properties - else: - raise ApiTypeError('Unable to find schema for value={} in class={} at path_to_item={}'.format( - value, cls, validation_metadata.path_to_item+(property_name,) - )) - schema = cls._get_class_oapg(schema) - arg_validation_metadata = ValidationMetadata( - from_server=validation_metadata.from_server, - configuration=validation_metadata.configuration, - path_to_item=path_to_item, - validated_path_to_schemas=validation_metadata.validated_path_to_schemas - ) - if arg_validation_metadata.validation_ran_earlier(schema): - add_deeper_validated_schemas(arg_validation_metadata, path_to_schemas) - continue - other_path_to_schemas = schema._validate_oapg(value, validation_metadata=arg_validation_metadata) - update(path_to_schemas, other_path_to_schemas) - return path_to_schemas - - @classmethod - def __check_dict_validations( - cls, - arg, - validation_metadata: ValidationMetadata - ): - if not hasattr(cls, 'MetaOapg'): - return - if (cls._is_json_validation_enabled_oapg('maxProperties', validation_metadata.configuration) and - hasattr(cls.MetaOapg, 'max_properties') and - len(arg) > cls.MetaOapg.max_properties): - cls._raise_validation_error_message_oapg( - value=arg, - constraint_msg="number of properties must be less than or equal to", - constraint_value=cls.MetaOapg.max_properties, - path_to_item=validation_metadata.path_to_item - ) - - if (cls._is_json_validation_enabled_oapg('minProperties', validation_metadata.configuration) and - hasattr(cls.MetaOapg, 'min_properties') and - len(arg) < cls.MetaOapg.min_properties): - cls._raise_validation_error_message_oapg( - value=arg, - constraint_msg="number of properties must be greater than or equal to", - constraint_value=cls.MetaOapg.min_properties, - path_to_item=validation_metadata.path_to_item - ) - - @classmethod - def _validate_oapg( - cls, - arg, - validation_metadata: ValidationMetadata, - ): - """ - DictBase _validate_oapg - We return dynamic classes of different bases depending upon the inputs - This makes it so: - - the returned instance is always a subclass of our defining schema - - this allows us to check type based on whether an instance is a subclass of a schema - - the returned instance is a serializable type (except for None, True, and False) which are enums - - Returns: - new_cls (type): the new class - - Raises: - ApiValueError: when a string can't be converted into a date or datetime and it must be one of those classes - ApiTypeError: when the input type is not in the list of allowed spec types - """ - if isinstance(arg, frozendict.frozendict): - cls.__check_dict_validations(arg, validation_metadata) - _path_to_schemas = super()._validate_oapg(arg, validation_metadata=validation_metadata) - if not isinstance(arg, frozendict.frozendict): - return _path_to_schemas - cls.__validate_arg_presence(arg) - other_path_to_schemas = cls.__validate_args(arg, validation_metadata=validation_metadata) - update(_path_to_schemas, other_path_to_schemas) - try: - discriminator = cls.MetaOapg.discriminator() - except AttributeError: - return _path_to_schemas - # discriminator exists - disc_prop_name = list(discriminator.keys())[0] - cls._ensure_discriminator_value_present_oapg(disc_prop_name, validation_metadata, arg) - discriminated_cls = cls.get_discriminated_class_oapg( - disc_property_name=disc_prop_name, disc_payload_value=arg[disc_prop_name]) - if discriminated_cls is None: - raise ApiValueError( - "Invalid discriminator value was passed in to {}.{} Only the values {} are allowed at {}".format( - cls.__name__, - disc_prop_name, - list(discriminator[disc_prop_name].keys()), - validation_metadata.path_to_item + (disc_prop_name,) - ) - ) - updated_vm = ValidationMetadata( - configuration=validation_metadata.configuration, - from_server=validation_metadata.from_server, - path_to_item=validation_metadata.path_to_item, - seen_classes=validation_metadata.seen_classes | frozenset({cls}), - validated_path_to_schemas=validation_metadata.validated_path_to_schemas - ) - if updated_vm.validation_ran_earlier(discriminated_cls): - add_deeper_validated_schemas(updated_vm, _path_to_schemas) - return _path_to_schemas - other_path_to_schemas = discriminated_cls._validate_oapg(arg, validation_metadata=updated_vm) - update(_path_to_schemas, other_path_to_schemas) - return _path_to_schemas - - @classmethod - def _get_properties_oapg( - cls, - arg: typing.Dict[str, typing.Any], - path_to_item: typing.Tuple[typing.Union[str, int], ...], - path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Type['Schema']] - ): - """ - DictBase _get_properties_oapg, this is how properties are set - These values already passed validation - """ - dict_items = {} - - for property_name_js, value in arg.items(): - property_path_to_item = path_to_item + (property_name_js,) - property_cls = path_to_schemas[property_path_to_item] - new_value = property_cls._get_new_instance_without_conversion_oapg( - value, - property_path_to_item, - path_to_schemas - ) - dict_items[property_name_js] = new_value - - return dict_items - - def __setattr__(self, name: str, value: typing.Any): - if not isinstance(self, FileIO): - raise AttributeError('property setting not supported on immutable instances') - - def __getattr__(self, name: str): - """ - for instance.name access - Properties are only type hinted for required properties - so that hasattr(instance, 'optionalProp') is False when that key is not present - """ - if not isinstance(self, frozendict.frozendict): - return super().__getattr__(name) - if name not in self.__class__.__annotations__: - raise AttributeError(f"{self} has no attribute '{name}'") - try: - value = self[name] - return value - except KeyError as ex: - raise AttributeError(str(ex)) - - def __getitem__(self, name: str): - """ - dict_instance[name] accessor - key errors thrown - """ - if not isinstance(self, frozendict.frozendict): - return super().__getattr__(name) - return super().__getitem__(name) - - def get_item_oapg(self, name: str) -> typing.Union['AnyTypeSchema', Unset]: - # dict_instance[name] accessor - if not isinstance(self, frozendict.frozendict): - raise NotImplementedError() - try: - return super().__getitem__(name) - except KeyError: - return unset - - -def cast_to_allowed_types( - arg: typing.Union[str, date, datetime, uuid.UUID, decimal.Decimal, int, float, None, dict, frozendict.frozendict, list, tuple, bytes, Schema, io.FileIO, io.BufferedReader], - from_server: bool, - validated_path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]], - path_to_item: typing.Tuple[typing.Union[str, int], ...] = tuple(['args[0]']), -) -> typing.Union[frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO]: - """ - Casts the input payload arg into the allowed types - The input validated_path_to_schemas is mutated by running this function - - When from_server is False then - - date/datetime is cast to str - - int/float is cast to Decimal - - If a Schema instance is passed in it is converted back to a primitive instance because - One may need to validate that data to the original Schema class AND additional different classes - those additional classes will need to be added to the new manufactured class for that payload - If the code didn't do this and kept the payload as a Schema instance it would fail to validate to other - Schema classes and the code wouldn't be able to mfg a new class that includes all valid schemas - TODO: store the validated schema classes in validation_metadata - - Args: - arg: the payload - from_server: whether this payload came from the server or not - validated_path_to_schemas: a dict that stores the validated classes at any path location in the payload - """ - if isinstance(arg, Schema): - # store the already run validations - schema_classes = set() - for cls in arg.__class__.__bases__: - if cls is Singleton: - # Skip Singleton - continue - schema_classes.add(cls) - validated_path_to_schemas[path_to_item] = schema_classes - - type_error = ApiTypeError(f"Invalid type. Required value type is str and passed type was {type(arg)} at {path_to_item}") - if isinstance(arg, str): - return str(arg) - elif isinstance(arg, (dict, frozendict.frozendict)): - return frozendict.frozendict({key: cast_to_allowed_types(val, from_server, validated_path_to_schemas, path_to_item + (key,)) for key, val in arg.items()}) - elif isinstance(arg, (bool, BoolClass)): - """ - this check must come before isinstance(arg, (int, float)) - because isinstance(True, int) is True - """ - if arg: - return BoolClass.TRUE - return BoolClass.FALSE - elif isinstance(arg, int): - return decimal.Decimal(arg) - elif isinstance(arg, float): - decimal_from_float = decimal.Decimal(arg) - if decimal_from_float.as_integer_ratio()[1] == 1: - # 9.0 -> Decimal('9.0') - # 3.4028234663852886e+38 -> Decimal('340282346638528859811704183484516925440.0') - return decimal.Decimal(str(decimal_from_float)+'.0') - return decimal_from_float - elif isinstance(arg, (tuple, list)): - return tuple([cast_to_allowed_types(item, from_server, validated_path_to_schemas, path_to_item + (i,)) for i, item in enumerate(arg)]) - elif isinstance(arg, (none_type, NoneClass)): - return NoneClass.NONE - elif isinstance(arg, (date, datetime)): - if not from_server: - return arg.isoformat() - raise type_error - elif isinstance(arg, uuid.UUID): - if not from_server: - return str(arg) - raise type_error - elif isinstance(arg, decimal.Decimal): - return decimal.Decimal(arg) - elif isinstance(arg, bytes): - return bytes(arg) - elif isinstance(arg, (io.FileIO, io.BufferedReader)): - return FileIO(arg) - raise ValueError('Invalid type passed in got input={} type={}'.format(arg, type(arg))) - - -class ComposedBase(Discriminable): - - @classmethod - def __get_allof_classes(cls, arg, validation_metadata: ValidationMetadata): - path_to_schemas = defaultdict(set) - for allof_cls in cls.MetaOapg.all_of(): - if validation_metadata.validation_ran_earlier(allof_cls): - add_deeper_validated_schemas(validation_metadata, path_to_schemas) - continue - other_path_to_schemas = allof_cls._validate_oapg(arg, validation_metadata=validation_metadata) - update(path_to_schemas, other_path_to_schemas) - return path_to_schemas - - @classmethod - def __get_oneof_class( - cls, - arg, - discriminated_cls, - validation_metadata: ValidationMetadata, - ): - oneof_classes = [] - path_to_schemas = defaultdict(set) - for oneof_cls in cls.MetaOapg.one_of(): - if oneof_cls in path_to_schemas[validation_metadata.path_to_item]: - oneof_classes.append(oneof_cls) - continue - if validation_metadata.validation_ran_earlier(oneof_cls): - oneof_classes.append(oneof_cls) - add_deeper_validated_schemas(validation_metadata, path_to_schemas) - continue - try: - path_to_schemas = oneof_cls._validate_oapg(arg, validation_metadata=validation_metadata) - except (ApiValueError, ApiTypeError) as ex: - if discriminated_cls is not None and oneof_cls is discriminated_cls: - raise ex - continue - oneof_classes.append(oneof_cls) - if not oneof_classes: - raise ApiValueError( - "Invalid inputs given to generate an instance of {}. None " - "of the oneOf schemas matched the input data.".format(cls) - ) - elif len(oneof_classes) > 1: - raise ApiValueError( - "Invalid inputs given to generate an instance of {}. Multiple " - "oneOf schemas {} matched the inputs, but a max of one is allowed.".format(cls, oneof_classes) - ) - # exactly one class matches - return path_to_schemas - - @classmethod - def __get_anyof_classes( - cls, - arg, - discriminated_cls, - validation_metadata: ValidationMetadata - ): - anyof_classes = [] - path_to_schemas = defaultdict(set) - for anyof_cls in cls.MetaOapg.any_of(): - if validation_metadata.validation_ran_earlier(anyof_cls): - anyof_classes.append(anyof_cls) - add_deeper_validated_schemas(validation_metadata, path_to_schemas) - continue - - try: - other_path_to_schemas = anyof_cls._validate_oapg(arg, validation_metadata=validation_metadata) - except (ApiValueError, ApiTypeError) as ex: - if discriminated_cls is not None and anyof_cls is discriminated_cls: - raise ex - continue - anyof_classes.append(anyof_cls) - update(path_to_schemas, other_path_to_schemas) - if not anyof_classes: - raise ApiValueError( - "Invalid inputs given to generate an instance of {}. None " - "of the anyOf schemas matched the input data.".format(cls) - ) - return path_to_schemas - - @classmethod - def _validate_oapg( - cls, - arg, - validation_metadata: ValidationMetadata, - ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]]: - """ - ComposedBase _validate_oapg - We return dynamic classes of different bases depending upon the inputs - This makes it so: - - the returned instance is always a subclass of our defining schema - - this allows us to check type based on whether an instance is a subclass of a schema - - the returned instance is a serializable type (except for None, True, and False) which are enums - - Returns: - new_cls (type): the new class - - Raises: - ApiValueError: when a string can't be converted into a date or datetime and it must be one of those classes - ApiTypeError: when the input type is not in the list of allowed spec types - """ - # validation checking on types, validations, and enums - path_to_schemas = super()._validate_oapg(arg, validation_metadata=validation_metadata) - - updated_vm = ValidationMetadata( - configuration=validation_metadata.configuration, - from_server=validation_metadata.from_server, - path_to_item=validation_metadata.path_to_item, - seen_classes=validation_metadata.seen_classes | frozenset({cls}), - validated_path_to_schemas=validation_metadata.validated_path_to_schemas - ) - - # process composed schema - discriminator = None - if hasattr(cls, 'MetaOapg') and hasattr(cls.MetaOapg, 'discriminator'): - discriminator = cls.MetaOapg.discriminator() - discriminated_cls = None - if discriminator and arg and isinstance(arg, frozendict.frozendict): - disc_property_name = list(discriminator.keys())[0] - cls._ensure_discriminator_value_present_oapg(disc_property_name, updated_vm, arg) - # get discriminated_cls by looking at the dict in the current class - discriminated_cls = cls.get_discriminated_class_oapg( - disc_property_name=disc_property_name, disc_payload_value=arg[disc_property_name]) - if discriminated_cls is None: - raise ApiValueError( - "Invalid discriminator value '{}' was passed in to {}.{} Only the values {} are allowed at {}".format( - arg[disc_property_name], - cls.__name__, - disc_property_name, - list(discriminator[disc_property_name].keys()), - updated_vm.path_to_item + (disc_property_name,) - ) - ) - - if hasattr(cls, 'MetaOapg') and hasattr(cls.MetaOapg, 'all_of'): - other_path_to_schemas = cls.__get_allof_classes(arg, validation_metadata=updated_vm) - update(path_to_schemas, other_path_to_schemas) - if hasattr(cls, 'MetaOapg') and hasattr(cls.MetaOapg, 'one_of'): - other_path_to_schemas = cls.__get_oneof_class( - arg, - discriminated_cls=discriminated_cls, - validation_metadata=updated_vm - ) - update(path_to_schemas, other_path_to_schemas) - if hasattr(cls, 'MetaOapg') and hasattr(cls.MetaOapg, 'any_of'): - other_path_to_schemas = cls.__get_anyof_classes( - arg, - discriminated_cls=discriminated_cls, - validation_metadata=updated_vm - ) - update(path_to_schemas, other_path_to_schemas) - not_cls = None - if hasattr(cls, 'MetaOapg') and hasattr(cls.MetaOapg, 'not_schema'): - not_cls = cls.MetaOapg.not_schema - not_cls = cls._get_class_oapg(not_cls) - if not_cls: - other_path_to_schemas = None - not_exception = ApiValueError( - "Invalid value '{}' was passed in to {}. Value is invalid because it is disallowed by {}".format( - arg, - cls.__name__, - not_cls.__name__, - ) - ) - if updated_vm.validation_ran_earlier(not_cls): - raise not_exception - - try: - other_path_to_schemas = not_cls._validate_oapg(arg, validation_metadata=updated_vm) - except (ApiValueError, ApiTypeError): - pass - if other_path_to_schemas: - raise not_exception - - if discriminated_cls is not None and not updated_vm.validation_ran_earlier(discriminated_cls): - # TODO use an exception from this package here - add_deeper_validated_schemas(updated_vm, path_to_schemas) - assert discriminated_cls in path_to_schemas[updated_vm.path_to_item] - return path_to_schemas - - -# DictBase, ListBase, NumberBase, StrBase, BoolBase, NoneBase -class ComposedSchema( - ComposedBase, - DictBase, - ListBase, - NumberBase, - StrBase, - BoolBase, - NoneBase, - Schema, - NoneFrozenDictTupleStrDecimalBoolMixin -): - @classmethod - def from_openapi_data_oapg(cls, *args: typing.Any, _configuration: typing.Optional[Configuration] = None, **kwargs): - if not args: - if not kwargs: - raise ApiTypeError('{} is missing required input data in args or kwargs'.format(cls.__name__)) - args = (kwargs, ) - return super().from_openapi_data_oapg(args[0], _configuration=_configuration) - - -class ListSchema( - ListBase, - Schema, - TupleMixin -): - - @classmethod - def from_openapi_data_oapg(cls, arg: typing.List[typing.Any], _configuration: typing.Optional[Configuration] = None): - return super().from_openapi_data_oapg(arg, _configuration=_configuration) - - def __new__(cls, _arg: typing.Union[typing.List[typing.Any], typing.Tuple[typing.Any]], **kwargs: Configuration): - return super().__new__(cls, _arg, **kwargs) - - -class NoneSchema( - NoneBase, - Schema, - NoneMixin -): - - @classmethod - def from_openapi_data_oapg(cls, arg: None, _configuration: typing.Optional[Configuration] = None): - return super().from_openapi_data_oapg(arg, _configuration=_configuration) - - def __new__(cls, _arg: None, **kwargs: Configuration): - return super().__new__(cls, _arg, **kwargs) - - -class NumberSchema( - NumberBase, - Schema, - DecimalMixin -): - """ - This is used for type: number with no format - Both integers AND floats are accepted - """ - - @classmethod - def from_openapi_data_oapg(cls, arg: typing.Union[int, float], _configuration: typing.Optional[Configuration] = None): - return super().from_openapi_data_oapg(arg, _configuration=_configuration) - - def __new__(cls, _arg: typing.Union[decimal.Decimal, int, float], **kwargs: Configuration): - return super().__new__(cls, _arg, **kwargs) - - -class IntBase: - @property - def as_int_oapg(self) -> int: - try: - return self._as_int - except AttributeError: - self._as_int = int(self) - return self._as_int - - @classmethod - def __validate_format(cls, arg: typing.Optional[decimal.Decimal], validation_metadata: ValidationMetadata): - if isinstance(arg, decimal.Decimal): - - denominator = arg.as_integer_ratio()[-1] - if denominator != 1: - raise ApiValueError( - "Invalid value '{}' for type integer at {}".format(arg, validation_metadata.path_to_item) - ) - - @classmethod - def _validate_oapg( - cls, - arg, - validation_metadata: ValidationMetadata, - ): - """ - IntBase _validate_oapg - TODO what about types = (int, number) -> IntBase, NumberBase? We could drop int and keep number only - """ - cls.__validate_format(arg, validation_metadata=validation_metadata) - return super()._validate_oapg(arg, validation_metadata=validation_metadata) - - -class IntSchema(IntBase, NumberSchema): - - @classmethod - def from_openapi_data_oapg(cls, arg: int, _configuration: typing.Optional[Configuration] = None): - return super().from_openapi_data_oapg(arg, _configuration=_configuration) - - def __new__(cls, _arg: typing.Union[decimal.Decimal, int], **kwargs: Configuration): - return super().__new__(cls, _arg, **kwargs) - - -class Int32Base: - __inclusive_minimum = decimal.Decimal(-2147483648) - __inclusive_maximum = decimal.Decimal(2147483647) - - @classmethod - def __validate_format(cls, arg: typing.Optional[decimal.Decimal], validation_metadata: ValidationMetadata): - if isinstance(arg, decimal.Decimal) and arg.as_tuple().exponent == 0: - if not cls.__inclusive_minimum <= arg <= cls.__inclusive_maximum: - raise ApiValueError( - "Invalid value '{}' for type int32 at {}".format(arg, validation_metadata.path_to_item) - ) - - @classmethod - def _validate_oapg( - cls, - arg, - validation_metadata: ValidationMetadata, - ): - """ - Int32Base _validate_oapg - """ - cls.__validate_format(arg, validation_metadata=validation_metadata) - return super()._validate_oapg(arg, validation_metadata=validation_metadata) - - -class Int32Schema( - Int32Base, - IntSchema -): - pass - - -class Int64Base: - __inclusive_minimum = decimal.Decimal(-9223372036854775808) - __inclusive_maximum = decimal.Decimal(9223372036854775807) - - @classmethod - def __validate_format(cls, arg: typing.Optional[decimal.Decimal], validation_metadata: ValidationMetadata): - if isinstance(arg, decimal.Decimal) and arg.as_tuple().exponent == 0: - if not cls.__inclusive_minimum <= arg <= cls.__inclusive_maximum: - raise ApiValueError( - "Invalid value '{}' for type int64 at {}".format(arg, validation_metadata.path_to_item) - ) - - @classmethod - def _validate_oapg( - cls, - arg, - validation_metadata: ValidationMetadata, - ): - """ - Int64Base _validate_oapg - """ - cls.__validate_format(arg, validation_metadata=validation_metadata) - return super()._validate_oapg(arg, validation_metadata=validation_metadata) - - -class Int64Schema( - Int64Base, - IntSchema -): - pass - - -class Float32Base: - __inclusive_minimum = decimal.Decimal(-3.4028234663852886e+38) - __inclusive_maximum = decimal.Decimal(3.4028234663852886e+38) - - @classmethod - def __validate_format(cls, arg: typing.Optional[decimal.Decimal], validation_metadata: ValidationMetadata): - if isinstance(arg, decimal.Decimal): - if not cls.__inclusive_minimum <= arg <= cls.__inclusive_maximum: - raise ApiValueError( - "Invalid value '{}' for type float at {}".format(arg, validation_metadata.path_to_item) - ) - - @classmethod - def _validate_oapg( - cls, - arg, - validation_metadata: ValidationMetadata, - ): - """ - Float32Base _validate_oapg - """ - cls.__validate_format(arg, validation_metadata=validation_metadata) - return super()._validate_oapg(arg, validation_metadata=validation_metadata) - - -class Float32Schema( - Float32Base, - NumberSchema -): - - @classmethod - def from_openapi_data_oapg(cls, arg: float, _configuration: typing.Optional[Configuration] = None): - return super().from_openapi_data_oapg(arg, _configuration=_configuration) - - -class Float64Base: - __inclusive_minimum = decimal.Decimal(-1.7976931348623157E+308) - __inclusive_maximum = decimal.Decimal(1.7976931348623157E+308) - - @classmethod - def __validate_format(cls, arg: typing.Optional[decimal.Decimal], validation_metadata: ValidationMetadata): - if isinstance(arg, decimal.Decimal): - if not cls.__inclusive_minimum <= arg <= cls.__inclusive_maximum: - raise ApiValueError( - "Invalid value '{}' for type double at {}".format(arg, validation_metadata.path_to_item) - ) - - @classmethod - def _validate_oapg( - cls, - arg, - validation_metadata: ValidationMetadata, - ): - """ - Float64Base _validate_oapg - """ - cls.__validate_format(arg, validation_metadata=validation_metadata) - return super()._validate_oapg(arg, validation_metadata=validation_metadata) - -class Float64Schema( - Float64Base, - NumberSchema -): - - @classmethod - def from_openapi_data_oapg(cls, arg: float, _configuration: typing.Optional[Configuration] = None): - # todo check format - return super().from_openapi_data_oapg(arg, _configuration=_configuration) - - -class StrSchema( - StrBase, - Schema, - StrMixin -): - """ - date + datetime string types must inherit from this class - That is because one can validate a str payload as both: - - type: string (format unset) - - type: string, format: date - """ - - @classmethod - def from_openapi_data_oapg(cls, arg: str, _configuration: typing.Optional[Configuration] = None) -> 'StrSchema': - return super().from_openapi_data_oapg(arg, _configuration=_configuration) - - def __new__(cls, _arg: typing.Union[str, date, datetime, uuid.UUID], **kwargs: Configuration): - return super().__new__(cls, _arg, **kwargs) - - -class UUIDSchema(UUIDBase, StrSchema): - - def __new__(cls, _arg: typing.Union[str, uuid.UUID], **kwargs: Configuration): - return super().__new__(cls, _arg, **kwargs) - - -class DateSchema(DateBase, StrSchema): - - def __new__(cls, _arg: typing.Union[str, date], **kwargs: Configuration): - return super().__new__(cls, _arg, **kwargs) - - -class DateTimeSchema(DateTimeBase, StrSchema): - - def __new__(cls, _arg: typing.Union[str, datetime], **kwargs: Configuration): - return super().__new__(cls, _arg, **kwargs) - - -class DecimalSchema(DecimalBase, StrSchema): - - def __new__(cls, _arg: str, **kwargs: Configuration): - """ - Note: Decimals may not be passed in because cast_to_allowed_types is only invoked once for payloads - which can be simple (str) or complex (dicts or lists with nested values) - Because casting is only done once and recursively casts all values prior to validation then for a potential - client side Decimal input if Decimal was accepted as an input in DecimalSchema then one would not know - if one was using it for a StrSchema (where it should be cast to str) or one is using it for NumberSchema - where it should stay as Decimal. - """ - return super().__new__(cls, _arg, **kwargs) - - -class BytesSchema( - Schema, - BytesMixin -): - """ - this class will subclass bytes and is immutable - """ - def __new__(cls, _arg: bytes, **kwargs: Configuration): - return super(Schema, cls).__new__(cls, _arg) - - -class FileSchema( - Schema, - FileMixin -): - """ - This class is NOT immutable - Dynamic classes are built using it for example when AnyType allows in binary data - Al other schema classes ARE immutable - If one wanted to make this immutable one could make this a DictSchema with required properties: - - data = BytesSchema (which would be an immutable bytes based schema) - - file_name = StrSchema - and cast_to_allowed_types would convert bytes and file instances into dicts containing data + file_name - The downside would be that data would be stored in memory which one may not want to do for very large files - - The developer is responsible for closing this file and deleting it - - This class was kept as mutable: - - to allow file reading and writing to disk - - to be able to preserve file name info - """ - - def __new__(cls, _arg: typing.Union[io.FileIO, io.BufferedReader], **kwargs: Configuration): - return super(Schema, cls).__new__(cls, _arg) - - -class BinaryBase: - pass - - -class BinarySchema( - ComposedBase, - BinaryBase, - Schema, - BinaryMixin -): - class MetaOapg: - @staticmethod - def one_of(): - return [ - BytesSchema, - FileSchema, - ] - - def __new__(cls, _arg: typing.Union[io.FileIO, io.BufferedReader, bytes], **kwargs: Configuration): - return super().__new__(cls, _arg) - - -class BoolSchema( - BoolBase, - Schema, - BoolMixin -): - - @classmethod - def from_openapi_data_oapg(cls, arg: bool, _configuration: typing.Optional[Configuration] = None): - return super().from_openapi_data_oapg(arg, _configuration=_configuration) - - def __new__(cls, _arg: bool, **kwargs: ValidationMetadata): - return super().__new__(cls, _arg, **kwargs) - - -class AnyTypeSchema( - DictBase, - ListBase, - NumberBase, - StrBase, - BoolBase, - NoneBase, - Schema, - NoneFrozenDictTupleStrDecimalBoolFileBytesMixin -): - # Python representation of a schema defined as true or {} - pass - - -class UnsetAnyTypeSchema(AnyTypeSchema): - # Used when additionalProperties/items was not explicitly defined and a defining schema is needed - pass - - -class NotAnyTypeSchema( - ComposedSchema, -): - """ - Python representation of a schema defined as false or {'not': {}} - Does not allow inputs in of AnyType - Note: validations on this class are never run because the code knows that no inputs will ever validate - """ - - class MetaOapg: - not_schema = AnyTypeSchema - - def __new__( - cls, - *_args, - _configuration: typing.Optional[Configuration] = None, - ) -> 'NotAnyTypeSchema': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - ) - - -class DictSchema( - DictBase, - Schema, - FrozenDictMixin -): - @classmethod - def from_openapi_data_oapg(cls, arg: typing.Dict[str, typing.Any], _configuration: typing.Optional[Configuration] = None): - return super().from_openapi_data_oapg(arg, _configuration=_configuration) - - def __new__(cls, *_args: typing.Union[dict, frozendict.frozendict], **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, bytes, Schema, Unset, ValidationMetadata]): - return super().__new__(cls, *_args, **kwargs) - - -schema_type_classes = {NoneSchema, DictSchema, ListSchema, NumberSchema, StrSchema, BoolSchema, AnyTypeSchema} - - -@functools.lru_cache() -def get_new_class( - class_name: str, - bases: typing.Tuple[typing.Type[typing.Union[Schema, typing.Any]], ...] -) -> typing.Type[Schema]: - """ - Returns a new class that is made with the subclass bases - """ - new_cls: typing.Type[Schema] = type(class_name, bases, {}) - return new_cls - - -LOG_CACHE_USAGE = False - - -def log_cache_usage(cache_fn): - if LOG_CACHE_USAGE: - print(cache_fn.__name__, cache_fn.cache_info()) diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/.openapi-generator-ignore b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/.openapi-generator-ignore index 7484ee590a3..d24a2da8ae5 100644 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/.openapi-generator-ignore +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/.openapi-generator-ignore @@ -1,5 +1,5 @@ # OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator +# Generated by openapi-generator https://github.com/openapi-json-schema-tools/openapi-json-schema-generator # Use this file to prevent files from being overwritten by the generator. # The patterns follow closely to .gitignore or .dockerignore. diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/.openapi-generator/FILES b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/.openapi-generator/FILES index 3584b2ac026..2fb4acc533d 100644 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/.openapi-generator/FILES +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/.openapi-generator/FILES @@ -2,31 +2,56 @@ .gitlab-ci.yml .travis.yml README.md -docs/apis/tags/DefaultApi.md -docs/models/AdditionOperator.md -docs/models/Operator.md -docs/models/SubtractionOperator.md +docs/apis/tags/default_api.md +docs/components/schema/addition_operator.md +docs/components/schema/operator.md +docs/components/schema/subtraction_operator.md +docs/paths/operators/post.md +docs/servers/server_0.md git_push.sh -requirements.txt -setup.cfg -setup.py +migration_2_0_0.md +migration_other_python_generators.md +pyproject.toml +src/this_package/__init__.py +src/this_package/api_client.py +src/this_package/apis/__init__.py +src/this_package/apis/path_to_api.py +src/this_package/apis/paths/__init__.py +src/this_package/apis/paths/operators.py +src/this_package/apis/tag_to_api.py +src/this_package/apis/tags/__init__.py +src/this_package/apis/tags/default_api.py +src/this_package/components/__init__.py +src/this_package/components/schema/__init__.py +src/this_package/components/schema/addition_operator.py +src/this_package/components/schema/operator.py +src/this_package/components/schema/subtraction_operator.py +src/this_package/components/schemas/__init__.py +src/this_package/configurations/__init__.py +src/this_package/configurations/api_configuration.py +src/this_package/configurations/schema_configuration.py +src/this_package/exceptions.py +src/this_package/paths/__init__.py +src/this_package/paths/operators/__init__.py +src/this_package/paths/operators/post/__init__.py +src/this_package/paths/operators/post/operation.py +src/this_package/paths/operators/post/request_body/__init__.py +src/this_package/paths/operators/post/request_body/content/__init__.py +src/this_package/paths/operators/post/request_body/content/application_json/__init__.py +src/this_package/paths/operators/post/request_body/content/application_json/schema.py +src/this_package/paths/operators/post/responses/__init__.py +src/this_package/paths/operators/post/responses/response_200/__init__.py +src/this_package/rest.py +src/this_package/schemas.py +src/this_package/security_schemes.py +src/this_package/server.py +src/this_package/servers/__init__.py +src/this_package/servers/server_0.py test-requirements.txt test/__init__.py -test/test_models/__init__.py -this_package/__init__.py -this_package/api_client.py -this_package/apis/__init__.py -this_package/apis/tags/default_api.py -this_package/configuration.py -this_package/exceptions.py -this_package/model/__init__.py -this_package/model/addition_operator.py -this_package/model/addition_operator.pyi -this_package/model/operator.py -this_package/model/operator.pyi -this_package/model/subtraction_operator.py -this_package/model/subtraction_operator.pyi -this_package/models/__init__.py -this_package/rest.py -this_package/schemas.py +test/components/__init__.py +test/components/schema/__init__.py +test/test_paths/__init__.py +test/test_paths/test_operators/__init__.py +test/test_paths/test_operators/test_post.py tox.ini diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/.openapi-generator/VERSION b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/.openapi-generator/VERSION index a6a3a43c3a0..359a5b952d4 100644 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/.openapi-generator/VERSION +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/.openapi-generator/VERSION @@ -1 +1 @@ -1.0.4 \ No newline at end of file +2.0.0 \ No newline at end of file diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/Makefile b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/Makefile index 863c380ebef..b73277d308c 100644 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/Makefile +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/Makefile @@ -1,10 +1,7 @@ -REQUIREMENTS_FILE=dev-requirements.txt -REQUIREMENTS_OUT=dev-requirements.txt.log SETUP_OUT=*.egg-info VENV=venv clean: - rm -rf $(REQUIREMENTS_OUT) rm -rf $(SETUP_OUT) rm -rf $(VENV) rm -rf .tox diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/README.md b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/README.md index 012012384bc..b960211aa00 100644 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/README.md +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/README.md @@ -1,108 +1,22 @@ # this-package -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) +No description provided (generated by Openapi JSON Schema Generator https://github.com/openapi-json-schema-tools/openapi-json-schema-generator) -This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: +This Python package is automatically generated by the [OpenAPI JSON Schema Generator](https://github.com/openapi-json-schema-tools/openapi-json-schema-generator) project: - API version: 1.0 - Package version: 1.0.0 -- Build package: org.openapitools.codegen.languages.PythonClientCodegen +- Build package: PythonClientCodegen -## Requirements. +## Requirements Python >=3.7 -## Migration from other generators like python and python-legacy - -### Changes -1. This generator uses spec case for all (object) property names and parameter names. - - So if the spec has a property name like camelCase, it will use camelCase rather than camel_case - - So you will need to update how you input and read properties to use spec case -2. Endpoint parameters are stored in dictionaries to prevent collisions (explanation below) - - So you will need to update how you pass data in to endpoints -3. Endpoint responses now include the original response, the deserialized response body, and (todo)the deserialized headers - - So you will need to update your code to use response.body to access deserialized data -4. All validated data is instantiated in an instance that subclasses all validated Schema classes and Decimal/str/list/tuple/frozendict/NoneClass/BoolClass/bytes/io.FileIO - - This means that you can use isinstance to check if a payload validated against a schema class - - This means that no data will be of type None/True/False - - ingested None will subclass NoneClass - - ingested True will subclass BoolClass - - ingested False will subclass BoolClass - - So if you need to check is True/False/None, instead use instance.is_true_oapg()/.is_false_oapg()/.is_none_oapg() -5. All validated class instances are immutable except for ones based on io.File - - This is because if properties were changed after validation, that validation would no longer apply - - So no changing values or property values after a class has been instantiated -6. String + Number types with formats - - String type data is stored as a string and if you need to access types based on its format like date, - date-time, uuid, number etc then you will need to use accessor functions on the instance - - type string + format: See .as_date_oapg, .as_datetime_oapg, .as_decimal_oapg, .as_uuid_oapg - - type number + format: See .as_float_oapg, .as_int_oapg - - this was done because openapi/json-schema defines constraints. string data may be type string with no format - keyword in one schema, and include a format constraint in another schema - - So if you need to access a string format based type, use as_date_oapg/as_datetime_oapg/as_decimal_oapg/as_uuid_oapg - - So if you need to access a number format based type, use as_int_oapg/as_float_oapg -7. Property access on AnyType(type unset) or object(dict) schemas - - Only required keys with valid python names are properties like .someProp and have type hints - - All optional keys may not exist, so properties are not defined for them - - One can access optional values with dict_instance['optionalProp'] and KeyError will be raised if it does not exist - - Use get_item_oapg if you need a way to always get a value whether or not the key exists - - If the key does not exist, schemas.unset is returned from calling dict_instance.get_item_oapg('optionalProp') - - All required and optional keys have type hints for this method, and @typing.overload is used - - A type hint is also generated for additionalProperties accessed using this method - - So you will need to update you code to use some_instance['optionalProp'] to access optional property - and additionalProperty values -8. The location of the api classes has changed - - Api classes are located in your_package.apis.tags.some_api - - This change was made to eliminate redundant code generation - - Legacy generators generated the same endpoint twice if it had > 1 tag on it - - This generator defines an endpoint in one class, then inherits that class to generate - apis by tags and by paths - - This change reduces code and allows quicker run time if you use the path apis - - path apis are at your_package.apis.paths.some_path - - Those apis will only load their needed models, which is less to load than all of the resources needed in a tag api - - So you will need to update your import paths to the api classes - -### Why are Oapg and _oapg used in class and method names? -Classes can have arbitrarily named properties set on them -Endpoints can have arbitrary operationId method names set -For those reasons, I use the prefix Oapg and _oapg to greatly reduce the likelihood of collisions -on protected + public classes/methods. -oapg stands for OpenApi Python Generator. - -### Object property spec case -This was done because when payloads are ingested, they can be validated against N number of schemas. -If the input signature used a different property name then that has mutated the payload. -So SchemaA and SchemaB must both see the camelCase spec named variable. -Also it is possible to send in two properties, named camelCase and camel_case in the same payload. -That use case should be support so spec case is used. - -### Parameter spec case -Parameters can be included in different locations including: -- query -- path -- header -- cookie - -Any of those parameters could use the same parameter names, so if every parameter -was included as an endpoint parameter in a function signature, they would collide. -For that reason, each of those inputs have been separated out into separate typed dictionaries: -- query_params -- path_params -- header_params -- cookie_params - -So when updating your code, you will need to pass endpoint parameters in using those -dictionaries. - -### Endpoint responses -Endpoint responses have been enriched to now include more information. -Any response reom an endpoint will now include the following properties: -response: urllib3.HTTPResponse -body: typing.Union[Unset, Schema] -headers: typing.Union[Unset, TODO] -Note: response header deserialization has not yet been added - - -## Installation & Usage +## Migration Guides +- [2.0.0 Migration Guide](migration_2_0_0.md) +- [Migration from Other Python Generators](migration_other_python_generators.md) + + +## Installation ### pip install If the python package is hosted on a repository, you can install directly using: @@ -122,86 +36,209 @@ import this_package Install via [Setuptools](http://pypi.python.org/pypi/setuptools). ```sh -python setup.py install --user +python -m pip install . --user ``` -(or `sudo python setup.py install` to install the package for all users) +(or `python -m pip install .` to install the package for all users) Then import the package: ```python import this_package ``` +## Usage Notes +### Validation, Immutability, and Data Type +This python code validates data to schema classes and return back an immutable instance containing the data +which subclasses all validated schema classes. This ensure that +- valid data cannot be mutated and become invalid to a set of schemas + - the one exception is that files are not immutable, so schema instances storing/sending/receiving files are not immutable +- one can use isinstance to check if a instance or property is valid to a schema class + - this means that expensive validation does not need to be run twice + +
    + Reason + +To do that, some changes had to be made. Python bool and NoneType cannot be subclassed, +so to be able to meet the above design goals, I implemented BoolClass and NoneClass classes +to allow schemas to subclass them. + +In python 0 == False and 1 == True. This is a problem for json schema which is language independent. +The [json schema test suite](https://github.com/json-schema-org/JSON-Schema-Test-Suite) has +[explicit tests that require that 0 != False and 1 != True](https://github.com/json-schema-org/JSON-Schema-Test-Suite/blob/main/tests/draft2020-12/type.json#L260-L267) +Using the above described BoolClass and NoneClasses allows those tests to pass. +- Another example of a package using it's own boolean class is [numpy's bool_](https://numpy.org/doc/stable/reference/arrays.scalars.html#numpy.bool_) +
    + +If you need to check is True/False/None, instead use instance.is_true_()/.is_false_()/.is_none_() + +Here is the mapping from json schema types to python subclassed types: +| Json Schema Type | Python Base Class | +| ---------------- | ----------------- | +| object | frozendict.frozendict | +| array | tuple | +| string | str | +| number | decimal.Decimal | +| integer | decimal.Decimal | +| boolean | BoolClass | +| null | NoneClass | +| AnyType (unset) | typing.Union[frozendict.frozendict, tuple, str, decimal.Decimal, BoolClass, NoneClass] | + +### Storage of Json Schema Definition in Python Classes +In openapi v3.0.3 there are ~ 28 json schema keywords. Almost all of them can apply if +type is unset. This data could be stored as +1. class properties +2. in a container in the class like in a dict or in a nested class + +This data is stored in a nested class named Schema_. +Storing this data as a nested class ensures that the data is encapsulated, does not collide with +class properties, and allows for deeper complex inline definitions. + +
    + Reason + +If the data were stored at the class property level, then the keywords could collide with +type object property names. To avoid that, one could make the properties semi or fully private with +a single or double underscore prefix, but that it a lot of data to put there. +Better to separate out json schema data from type object properties at the class property level. + +If the data were stored in a container that would segregate the different data which is good. +But json schemas can be inlined to any depth. Those complex deeper schemas would need to be included. +One could define them higher in the class file and then refer to them in the dict. That would required +iterating over schemas and adding all of the inner into a collection, and then generate that collection. + +The schema definitions are already nested from the json schema definition. The easiest solution is +to use a nested json schema definition class which holds that data. That way: +- the data is separated from class properties +- deeper complicated schemas can still be stored + +So a nested class was chosen to store json schema data, this class is named Schema_. +- The [django project uses this same pattern to store model class metadata in a Meta class](https://docs.djangoproject.com/en/4.1/topics/db/models/#meta-options) +
    + +### Json Schema Type Object +Most component schemas (models) are probably of type object. Which is a map data structure. +Json schema allows string keys in this map, which means schema properties can have key names that are +invalid python variable names. Names like: +- "hi-there" +- "1variable" +- "@now" +- " " +- "from" + +To allow these use cases to work, frozendict.frozendict is used as the base class of type object schemas. +This means that one can use normal dict methods on instances of these classes. + +
    + Other Details + +- optional properties which were not set will not exist in the instance +- None is only allowed in as a value if type: "null" was included or nullable: true was set +- type hints are written for accessing values by key literals like instance["hi-there"] +- and there is a method instance.get_item_["hi-there"] which returns an schemas.Unset value if the key was not set +- required properties with valid python names are accessible with instance.SomeRequiredProp + which uses the exact key from the openapi document + - preserving the original key names is required to properly validate a payload to multiple json schemas +
    + +### Json Schema Type + Format, Validated Data Storage +N schemas can be validated on the same payload. +To allow multiple schemas to validate, the data must be stored using one base class whether or not +a json schema format constraint exists in the schema. +See te below accessors for string data: +- type string + format: See .as_date_, .as_datetime_, .as_decimal_, .as_uuid_ + +In json schema, type: number with no format validates both integers and floats, so decimal.Decimal is used to store them. +See te below accessors for number data: +- type number + format: See .as_float_, .as_int_ + +
    + String + Date Example + +For example the string payload '2023-12-20' is validates to both of these schemas: +1. string only +``` +- type: string +``` +2. string and date format +``` +- type: string + format: date +``` +Because of use cases like this, a datetime.date is allowed as an input to this schema, but the data +is stored as a string, with a date accessor, instance.as_date_ +
    + ## Getting Started -Please follow the [installation procedure](#installation--usage) and then run the following: +Please follow the [installation procedure](#installation) and then run the following: ```python - -import time import this_package -from pprint import pprint +from this_package.configurations import api_configuration from this_package.apis.tags import default_api -from this_package.model.operator import Operator -# Defining the host is optional and defaults to http://localhost:3000 -# See configuration.py for a list of all supported configuration parameters. -configuration = this_package.Configuration( - host = "http://localhost:3000" +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( ) - - # Enter a context with an instance of the API client -with this_package.ApiClient(configuration) as api_client: +with this_package.ApiClient(used_configuration) as api_client: # Create an instance of the API class api_instance = default_api.DefaultApi(api_client) - operator = Operator( + + # example passing only optional values + body = operator.Operator( a=3.14, b=3.14, operator_id="ADD", - ) # Operator | (optional) - + ) try: - api_instance.post_operators(operator=operator) + api_response = api_instance.post_operators( + body=body, + ) + pprint(api_response) except this_package.ApiException as e: print("Exception when calling DefaultApi->post_operators: %s\n" % e) ``` -## Documentation for API Endpoints - -All URIs are relative to *http://localhost:3000* +## Servers +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](docs/servers/server_0.md) | -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*DefaultApi* | [**post_operators**](docs/apis/tags/DefaultApi.md#post_operators) | **post** /operators | +## Endpoints -## Documentation For Models +All URIs are relative to the selected server +- The server is selected by passing in server_info and server_index into api_configuration.ApiConfiguration +- Code samples in endpoints documents show how to do this +- server_index can also be passed in to endpoint calls, see endpoint documentation - - [AdditionOperator](docs/models/AdditionOperator.md) - - [Operator](docs/models/Operator.md) - - [SubtractionOperator](docs/models/SubtractionOperator.md) - -## Documentation For Authorization - - All endpoints do not require authorization. - -## Author +HTTP request | Method | Description +------------ | ------ | ------------- +/operators **post** | [DefaultApi](docs/apis/tags/default_api.md).[post_operators](docs/paths/operators/post.md) | +## Component Schemas +Class | Description +----- | ------------ +[AdditionOperator](docs/components/schema/addition_operator.md) | +[Operator](docs/components/schema/operator.md) | +[SubtractionOperator](docs/components/schema/subtraction_operator.md) | ## Notes for Large OpenAPI documents -If the OpenAPI document is large, imports in this_package.apis and this_package.models may fail with a +If the OpenAPI document is large, imports in this_package.apis.tags.tag_to_api and this_package.components.schemas may fail with a RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions: Solution 1: Use specific imports for apis and models like: -- `from this_package.apis.default_api import DefaultApi` -- `from this_package.model.pet import Pet` +- tagged api: `from this_package.apis.tags.default_api import DefaultApi` +- api for one path: `from this_package.apis.paths.some_path import SomePath` +- api for one operation (path + verb): `from this_package.paths.some_path.get import ApiForget` +- single model import: `from this_package.components.schema.pet import Pet` -Solution 1: +Solution 2: Before importing the package, adjust the maximum recursion limit as shown below: ``` import sys sys.setrecursionlimit(1500) import this_package -from this_package.apis import * -from this_package.models import * +from this_package.apis.tags.tag_to_api import * +from this_package.components.schemas import * ``` diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/dev-requirements.txt b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/dev-requirements.txt deleted file mode 100644 index ccdfca62949..00000000000 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/dev-requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -tox -flake8 diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/docs/apis/tags/DefaultApi.md b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/docs/apis/tags/DefaultApi.md deleted file mode 100644 index b361ea6af0e..00000000000 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/docs/apis/tags/DefaultApi.md +++ /dev/null @@ -1,84 +0,0 @@ - -# this_package.apis.tags.default_api.DefaultApi - -All URIs are relative to *http://localhost:3000* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**post_operators**](#post_operators) | **post** /operators | - -# **post_operators** - -> post_operators() - - - -### Example - -```python -import this_package -from this_package.apis.tags import default_api -from this_package.model.operator import Operator -from pprint import pprint -# Defining the host is optional and defaults to http://localhost:3000 -# See configuration.py for a list of all supported configuration parameters. -configuration = this_package.Configuration( - host = "http://localhost:3000" -) - -# Enter a context with an instance of the API client -with this_package.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = default_api.DefaultApi(api_client) - - # example passing only optional values - body = Operator( - a=3.14, - b=3.14, - operator_id="ADD", - ) - try: - api_response = api_instance.post_operators( - body=body, - ) - except this_package.ApiException as e: - print("Exception when calling DefaultApi->post_operators: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson, Unset] | optional, default is unset | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**Operator**](../../models/Operator.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#post_operators.ApiResponseFor200) | OK - -#### post_operators.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/docs/apis/tags/default_api.md b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/docs/apis/tags/default_api.md new file mode 100644 index 00000000000..a904558e9db --- /dev/null +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/docs/apis/tags/default_api.md @@ -0,0 +1,17 @@ + +this_package.apis.tags.default_api +# DefaultApi + +## Description +operations that lack tags are assigned this default tag + +All URIs are relative to the selected server +- The server is selected by passing in server_info and server_index into api_configuration.ApiConfiguration +- Code samples in endpoints documents show how to do this +- server_index can also be passed in to endpoint calls, see endpoint documentation + +Method | Description +------ | ------------- +[**post_operators**](../../paths/operators/post.md) | + +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/docs/components/schema/addition_operator.md b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/docs/components/schema/addition_operator.md new file mode 100644 index 00000000000..515a059b03a --- /dev/null +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/docs/components/schema/addition_operator.md @@ -0,0 +1,16 @@ +this_package.components.schema.addition_operator +# Schema AdditionOperator + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**a** | decimal.Decimal, int, float | decimal.Decimal | | value must be a 64 bit float +**b** | decimal.Decimal, int, float | decimal.Decimal | | value must be a 64 bit float +**operator_id** | str | str | | if omitted the server will use the default value of ADD + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/docs/components/schema/operator.md b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/docs/components/schema/operator.md new file mode 100644 index 00000000000..662a3aaaf0a --- /dev/null +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/docs/components/schema/operator.md @@ -0,0 +1,16 @@ +this_package.components.schema.operator +# Schema Operator + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Composed Schemas (allOf/anyOf/oneOf/not) +## oneOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[**AdditionOperator**](addition_operator.md) | [**AdditionOperator**](addition_operator.md) | [**AdditionOperator**](addition_operator.md) | | +[**SubtractionOperator**](subtraction_operator.md) | [**SubtractionOperator**](subtraction_operator.md) | [**SubtractionOperator**](subtraction_operator.md) | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/docs/components/schema/subtraction_operator.md b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/docs/components/schema/subtraction_operator.md new file mode 100644 index 00000000000..5c6c40d6310 --- /dev/null +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/docs/components/schema/subtraction_operator.md @@ -0,0 +1,16 @@ +this_package.components.schema.subtraction_operator +# Schema SubtractionOperator + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**a** | decimal.Decimal, int, float | decimal.Decimal | | value must be a 64 bit float +**b** | decimal.Decimal, int, float | decimal.Decimal | | value must be a 64 bit float +**operator_id** | str | str | | if omitted the server will use the default value of SUB + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/docs/models/AdditionOperator.md b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/docs/models/AdditionOperator.md deleted file mode 100644 index 5303f6da17c..00000000000 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/docs/models/AdditionOperator.md +++ /dev/null @@ -1,16 +0,0 @@ -# this_package.model.addition_operator.AdditionOperator - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**a** | decimal.Decimal, int, float, | decimal.Decimal, | | value must be a 64 bit float -**b** | decimal.Decimal, int, float, | decimal.Decimal, | | value must be a 64 bit float -**operator_id** | str, | str, | | if omitted the server will use the default value of "ADD" - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/docs/models/Operator.md b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/docs/models/Operator.md deleted file mode 100644 index 01a33e47239..00000000000 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/docs/models/Operator.md +++ /dev/null @@ -1,16 +0,0 @@ -# this_package.model.operator.Operator - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### oneOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[AdditionOperator](AdditionOperator.md) | [**AdditionOperator**](AdditionOperator.md) | [**AdditionOperator**](AdditionOperator.md) | | -[SubtractionOperator](SubtractionOperator.md) | [**SubtractionOperator**](SubtractionOperator.md) | [**SubtractionOperator**](SubtractionOperator.md) | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/docs/models/SubtractionOperator.md b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/docs/models/SubtractionOperator.md deleted file mode 100644 index c7f17eb2f6a..00000000000 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/docs/models/SubtractionOperator.md +++ /dev/null @@ -1,16 +0,0 @@ -# this_package.model.subtraction_operator.SubtractionOperator - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**a** | decimal.Decimal, int, float, | decimal.Decimal, | | value must be a 64 bit float -**b** | decimal.Decimal, int, float, | decimal.Decimal, | | value must be a 64 bit float -**operator_id** | str, | str, | | if omitted the server will use the default value of "SUB" - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/docs/paths/operators/post.md b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/docs/paths/operators/post.md new file mode 100644 index 00000000000..8f3cc6788e7 --- /dev/null +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/docs/paths/operators/post.md @@ -0,0 +1,110 @@ +this_package.paths.operators.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| post_operators | [DefaultApi](../../apis/tags/default_api.md) | This api is only for tag=default | +| post | ApiForPost | This api is only for this endpoint | +| post | Operators | This api is only for path=/operators | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/operators" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), Unset, dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | optional, default is unset | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[Operator](../../components/schema/operator.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | OK + +## ResponseFor200 + +### Description +OK + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://localhost:3000 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import this_package +from this_package.configurations import api_configuration +from this_package.apis.tags import default_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with this_package.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = default_api.DefaultApi(api_client) + + # example passing only optional values + body = operator.Operator( + a=3.14, + b=3.14, + operator_id="ADD", + ) + try: + api_response = api_instance.post_operators( + body=body, + ) + pprint(api_response) + except this_package.ApiException as e: + print("Exception when calling DefaultApi->post_operators: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to DefaultApi API]](../../apis/tags/default_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/docs/servers/server_0.md b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/docs/servers/server_0.md new file mode 100644 index 00000000000..a749b8eb2fd --- /dev/null +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/docs/servers/server_0.md @@ -0,0 +1,7 @@ +this_package.servers.server_0 +# Server Server0 + +## Url +http://localhost:3000 + +[[Back to top]](#top) [[Back to Servers]](../../README.md#Servers) [[Back to README]](../../README.md) diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/migration_2_0_0.md b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/migration_2_0_0.md new file mode 100644 index 00000000000..ed19050a503 --- /dev/null +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/migration_2_0_0.md @@ -0,0 +1,203 @@ +# Migration v1.X.X to v2.0.0 + +- [Compatibility note for opeanpi-generator](#compatibility-note-for-opeanpi-generator) +- [Component Generation](#component-generation) +- [Packaging Changes](#packaging-changes) +- [Path Generation](#path-generation) +- [Configuration Info Refactored](#configuration-info-refactored) +- [Servers and Security Generation](#servers-and-security-generation) +- [Java Classes for Openapi Data Refactored](#java-classes-for-openapi-data-refactored) +- [Api Access by Tags and Paths Updated](#api-access-by-tags-and-paths-updated) +- [Some Method/Property/Input/Class Names Updated](#some-methodpropertyinputclass-names-updated) +- [Documentation Updated](#documentation-updated) + +## Compatibility note for opeanpi-generator +The v1.0.4 release is nearly identical to the openapi-generator v6.3.0 release + +Below is a summary of big changes when updating you code from v1.X.X to 2.0.0 + +## Component Generation +Update: +Openapi document components in "#/components/x" are now generated in a components/x packages +Ths applies to: +- headers +- parameters +- request_bodies +- responses +- schemas +- security_schemes + +The generator now writes a class for each of those generated components. + +### Reason +A lot of openapi data is $ref references throughout an openapi document. +With this update, those $ref source locations are generated with file system paths that closely mirror the openapi +document json schema path to that info. $ref definition is then imported in generated python code. +This minimizes the amount of code that is generated, imposes well defined encapsulation and allows templates to be +re-used for many types of data regardless of where the data is in the source openapi document. + +### Action +- Update where you are importing models from, models are now component schemas + - File path change: model/pet.py -> components/schema/pet.py + +## Packaging changes +Code has been updated to use .toml packaging. Code is now distributed in a src directory + +### Reason +These updates follow latest python packaging best practices + +### Action +- if you are suppressing generation of any files, you will need to edit those file paths + - File Path Change: package_name -> src/package_name + +## Path Generation +If paths contain inline descriptions of parameters, request bodies, responses, security, or servers, +then those are now generated in separate files. Those files are imported into the endpoint code. +File locations closely mirror the openapi data json schema path. + +### Reason +Generating those files in paths that closely mirror the json schema paths will allow +the generator to use $ref to any location in the openapi document in the future, not just components. +These could include: +- relative $refs +- a request body $ref referring to the request body in another endpoint + +This also allowed the generation code to work the same way regardless of where the header/requestBody etc +is in the source spec. + +Note: +Operations are now at +paths/somePath/get/operation.py +and not at +paths/somePath/get/__init__.py +to minimize the amount of memory needed when importing the python package. +The configurations.api_configuration.py file imports all servers defined at: +- openapi document root +- pathItem +- pathItem operation +And if servers were defined in pathItem operations, then every operation that contains a server would be imported +in api_configuration.py. Which could be many many files. + +So instead +- operation endpoint definition was moved to paths/somePath/get/operation.py +- paths/somePath/get/__init__.py stays empty and does not need lots of memory when api_configuration.py imports servers +- server information was kept in paths/somePath/get/servers/server_x.py + +### Action +- if you are importing any endpoint form its file, update your import + - File path update: paths/somePath/get.py -> paths/somePath/get/operation.py + +## Configuration Info Refactored +Configuration information was separated into two classes +- configurations/api_configuration.py ApiConfiguration for: + - server info + - security (auth) info + - logging info +- configurations/schema_configuration.py SchemaConfiguration for: + - disabled openapi/json-schema keywords + +### Reason +Schema validation only relies on SchemaConfiguration data and does not need to know about any ApiConfiguration info +General api configuration info was poorly structured in the legacy configuration class which had 13 inputs. +The refactored ApiConfiguration now has 4 inputs which define servers and security info. +Having these separate classes prevents circular imports when the schemas.py file imports its SchemaConfiguration class. + +### Action +- When you instantiate ApiClient, update your code to pass in an instance of SchemaConfiguration + ApiConfiguration + + +## Servers and Security Generation +Servers are now generated as separate files with one class per file wherever they were defined in the openapi document +- servers/server_0.py +- paths/somePath/servers/server_0.py +- paths/somePath/get/servers/server_0.py +Security requirements objects are now generated as separate files with one security requirement object per file +wherever they were defined in the openapi document +- security/security_requirement_object_0.py +- paths/somePath/get/security/security_requirement_object_0.py + +### Reason +Server classes now re-use schema validation code to ensure that inputs to server variables are valid. +Generating these separate files minimizes generated code and maximizes code re-use. + +### Action +- If endpoints need to use specific servers or security not at index 0, pass security_index_info + server_index_info + into ApiConfiguration when instantiating it +- If you use non-default server variable values, then update your code to pass in server_info into ApiConfiguration + +## Java Classes for Openapi Data Refactored +Almost every java class used to store openapi document data at generation time has been re-written or refactored. +The new classes are much shorter and contain only what is needed to generate code and documentation. +This will make it much easier to add new openapi v3.1.0 features like new json schema keywords. +Generator interface methods were also refactored to simplify Java model instantiation and code generation. +Almost all properties are now public static final and are: +- immutable +- publicly accessible to the templates + +### Reason +These updates make the code much more maintainable. +The number of properties that have to be maintained is much smaller +- Component Schema: ~100 properties in CodegenModel.java -> ~50 properties in CodegenSchema.java +- PathItem Operation: ~75 properties CodegenOperation: ~25 properties + +This will reduce bugs like: why can't I access this property in this template +Because instances are mostly immutable it is very clear where the wrong value is being created/assigned. + +### Action +- if you are customizing the python generator, you will need to update your java code + +## Api Access By Tags and Paths Updated +Previously, keys togo from tags and paths to apis were enums. +The code was updated to use a TypedDict and uses strings as the keys. + +### Reason +Making this change allows type hinting to work for the TypedDict with string keys + +### Action +- If you use path_to_api.py or tag_to_api.py, update the key that you use to access the api + +## Some Method/Property/Input/Class Names Updated +- is_true_oapg -> is_true_ +- is_false_oapg -> is_false_ +- is_none_oapg -> is_none_ +- as_date_oapg -> as_date_ +- as_datetime_oapg -> as_datetime_ +- as_decimal_oapg -> as_decimal_ +- as_uuid_oapg -> as_uuid_ +- as_float_oapg -> as_float_ +- as_int_oapg -> as_int_ +- get_item_oapg -> get_item_ +- from_openapi_data_oapg -> from_openapi_data_ +- _verify_typed_dict_inputs_oapg -> _verify_typed_dict_inputs +- _configuration -> configuration_ +- _arg -> arg_ +- _args -> args_ +- MetaOapg -> Schema_ +- JsonSchema -> OpenApiSchema + +### Reason +Classes can have arbitrarily named properties set on them +Endpoints can have arbitrary operationId method names set +For those reasons, I use the prefix and suffix _ to greatly reduce the likelihood of collisions +on protected + public classes/methods. + +### Action +- if you use the above methods/inputs/properties/classes update them to the latest names + +## Documentation Updated +- components now have sections in the readme + - models became component schemas +- one file is now generated for each endpoint + - that file now has a table of contents + - heading indentation levels now are indented correctly in descending order + - endpoint now includes server and security info (if security exists) +- servers section added to readme if servers were defined in the openapi document root +- security section added to readme if security was defined in the openapi document root + +### Reason +Endpoint documentation had indentation and linking bugs before, this fixes them. +When all endpoints docs were written in one file it was difficult to link ot the correct section. +How to set server and security info was unclear before, the new docs and classes should clarify that. + +### Action +- if you link to specific parts of the documentation, update your links \ No newline at end of file diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/migration_other_python_generators.md b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/migration_other_python_generators.md new file mode 100644 index 00000000000..36ab6416ee0 --- /dev/null +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/migration_other_python_generators.md @@ -0,0 +1,92 @@ +# Migration from Other Python Generators + +When switching from other python client generators you will need to make some changes to your code. + +1. This generator uses spec case for all (object) property names and parameter names. + - So if the spec has a property name like camelCase, it will use camelCase rather than camel_case + - So you will need to update how you input and read properties to use spec case + - endpoint calls will need to have their input arguments updated + - schema instance property usage and instantiation will need to be updated +2. Endpoint parameters are stored in dictionaries to prevent collisions (explanation below) + - So you will need to update how you pass data in to endpoints + - update your endpoint calls to pass in parameter data in path_params, query_params, header_params etc dict inputs +3. Endpoint responses now include the original response, the deserialized response body, and (todo)the deserialized headers + - So you will need to update your code to use response.body to access deserialized data +4. All validated data is instantiated in an instance that subclasses all validated Schema classes and Decimal/str/tuple/frozendict/NoneClass/BoolClass/bytes/io.FileIO + - This means that you can use isinstance to check if a payload validated against a schema class + - This means that no data will be of type None/True/False + - ingested None will subclass NoneClass + - ingested True will subclass BoolClass + - ingested False will subclass BoolClass + - So if you need to check is True/False/None, instead use instance.is_true_()/.is_false_()/.is_none_() +5. All validated class instances are immutable except for ones based on io.File + - This is because if properties were changed after validation, that validation would no longer apply + - So no changing values or property values after a class has been instantiated +6. String + Number types with formats + - String type data is stored as a string and if you need to access types based on its format like date, + date-time, uuid, number etc then you will need to use accessor functions on the instance + - type string + format: See .as_date_, .as_datetime_, .as_decimal_, .as_uuid_ + - type number + format: See .as_float_, .as_int_ + - this was done because openapi/json-schema defines constraints. string data may be type string with no format + keyword in one schema, and include a format constraint in another schema + - So if you need to access a string format based type, use as_date_/as_datetime_/as_decimal_/as_uuid_ + - So if you need to access a number format based type, use as_int_/as_float_ +7. Property access on AnyType(type unset) or object(dict) schemas + - Only required keys with valid python names are properties like .someProp and have type hints + - All optional keys may not exist, so properties are not defined for them + - One can access optional values with dict_instance['optionalProp'] and KeyError will be raised if it does not exist + - Use get_item_ if you need a way to always get a value whether or not the key exists + - If the key does not exist, schemas.unset is returned from calling dict_instance.get_item_('optionalProp') + - All required and optional keys have type hints for this method, and @typing.overload is used + - A type hint is also generated for additionalProperties accessed using this method + - So you will need to update you code to use some_instance['optionalProp'] to access optional property + and additionalProperty values +8. The location of the api classes has changed + - Api classes are located in your_package.apis.tags.some_api + - This change was made to eliminate redundant code generation + - Legacy generators generated the same endpoint twice if it had > 1 tag on it + - This generator defines an endpoint in one class, then inherits that class to generate + apis by tags and by paths + - This change reduces code and allows quicker run time if you use the path apis + - path apis are at your_package.apis.paths.some_path + - Those apis will only load their needed models, which is less to load than all of the resources needed in a tag api + - So you will need to update your import paths to the api classes + +### Why are Leading and Trailing Underscores in class and method names? +Classes can have arbitrarily named properties set on them +Endpoints can have arbitrary operationId method names set +For those reasons, I use the prefix and suffix _ to greatly reduce the likelihood of collisions +on protected + public classes/methods. + +### Object property spec case +This was done because when payloads are ingested, they can be validated against N number of schemas. +If the input signature used a different property name then that has mutated the payload. +So SchemaA and SchemaB must both see the camelCase spec named variable. +Also it is possible to send in two properties, named camelCase and camel_case in the same payload. +That use case should work, so spec case is used. + +### Parameter spec case +Parameters can be included in different locations including: +- query +- path +- header +- cookie + +Any of those parameters could use the same parameter names, so if every parameter +was included as an endpoint parameter in a function signature, they would collide. +For that reason, each of those inputs have been separated out into separate typed dictionaries: +- query_params +- path_params +- header_params +- cookie_params + +So when updating your code, you will need to pass endpoint parameters in using those +dictionaries. + +### Endpoint responses +Endpoint responses have been enriched to now include more information. +Any response reom an endpoint will now include the following properties: +response: urllib3.HTTPResponse +body: typing.Union[Unset, Schema] +headers: typing.Union[Unset, TODO] +Note: response header deserialization has not yet been added \ No newline at end of file diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/pyproject.toml b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/pyproject.toml new file mode 100644 index 00000000000..fcc52cfd141 --- /dev/null +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/pyproject.toml @@ -0,0 +1,30 @@ +# Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + +[build-system] +requires = ["setuptools>=61.0"] +build-backend = "setuptools.build_meta" + +[project] +name = "this-package" +version = "1.0.0" +authors = [ + { name="OpenAPI JSON Schema Generator community" }, +] +description = "discriminator-test" +readme = "README.md" +requires-python = ">=3.7" +dependencies = [ + "certifi >= 14.5.14", + "frozendict ~= 2.3.4", + "python-dateutil ~= 2.7.0", + "setuptools >= 61.0", + "typing_extensions ~= 4.5.0", + "urllib3 ~= 2.0.a3", +] +classifiers = [ + "Programming Language :: Python :: 3", + + "Operating System :: OS Independent", + "Topic :: Software Development :: Code Generators" +] + diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/requirements.txt b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/requirements.txt deleted file mode 100644 index 3cb6612669d..00000000000 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/requirements.txt +++ /dev/null @@ -1,6 +0,0 @@ -certifi >= 14.5.14 -frozendict ~= 2.3.4 -python-dateutil ~= 2.7.0 -setuptools >= 21.0.0 -typing_extensions ~= 4.3.0 -urllib3 ~= 1.26.7 diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/setup.cfg b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/setup.cfg deleted file mode 100644 index 11433ee875a..00000000000 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/setup.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -max-line-length=99 diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/setup.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/setup.py deleted file mode 100644 index 4356510d67a..00000000000 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/setup.py +++ /dev/null @@ -1,47 +0,0 @@ -# coding: utf-8 - -""" - discriminator-test - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 - - The version of the OpenAPI document: 1.0 - Generated by: https://openapi-generator.tech -""" - -from setuptools import setup, find_packages # noqa: H301 - -NAME = "this-package" -VERSION = "1.0.0" -# To install the library, run the following -# -# python setup.py install -# -# prerequisite: setuptools -# http://pypi.python.org/pypi/setuptools - -REQUIRES = [ - "certifi >= 14.5.14", - "frozendict ~= 2.3.4", - "python-dateutil ~= 2.7.0", - "setuptools >= 21.0.0", - "typing_extensions ~= 4.3.0", - "urllib3 ~= 1.26.7", -] - -setup( - name=NAME, - version=VERSION, - description="discriminator-test", - author="OpenAPI Generator community", - author_email="team@openapitools.org", - url="", - keywords=["OpenAPI", "OpenAPI-Generator", "discriminator-test"], - python_requires=">=3.7", - install_requires=REQUIRES, - packages=find_packages(exclude=["test", "tests"]), - include_package_data=True, - long_description="""\ - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 - """ -) diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/__init__.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/__init__.py new file mode 100644 index 00000000000..8bbf347d049 --- /dev/null +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/__init__.py @@ -0,0 +1,28 @@ +# coding: utf-8 + +# flake8: noqa + +""" + discriminator-test + + No description provided (generated by Openapi JSON Schema Generator https://github.com/openapi-json-schema-tools/openapi-json-schema-generator) # noqa: E501 + + The version of the OpenAPI document: 1.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +__version__ = "1.0.0" + +# import ApiClient +from this_package.api_client import ApiClient + +# import Configuration +from this_package.configurations.api_configuration import ApiConfiguration + +# import exceptions +from this_package.exceptions import OpenApiException +from this_package.exceptions import ApiAttributeError +from this_package.exceptions import ApiTypeError +from this_package.exceptions import ApiValueError +from this_package.exceptions import ApiKeyError +from this_package.exceptions import ApiException diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/api_client.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/api_client.py new file mode 100644 index 00000000000..554ca4b776e --- /dev/null +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/api_client.py @@ -0,0 +1,1400 @@ +# coding: utf-8 +""" + discriminator-test + + No description provided (generated by Openapi JSON Schema Generator https://github.com/openapi-json-schema-tools/openapi-json-schema-generator) # noqa: E501 + + The version of the OpenAPI document: 1.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime +import dataclasses +import decimal +import enum +import email +import json +import os +import io +import atexit +from multiprocessing import pool +import re +import tempfile +import typing +import typing_extensions +from urllib import parse +import urllib3 +from urllib3 import _collections, fields + +import frozendict + +from this_package import exceptions, rest, schemas, security_schemes +from this_package.configurations import schema_configuration, api_configuration + + +class RequestField(fields.RequestField): + def __eq__(self, other): + if not isinstance(other, RequestField): + return False + return self.__dict__ == other.__dict__ + + +class JSONEncoder(json.JSONEncoder): + compact_separators = (',', ':') + + def default(self, obj): + if isinstance(obj, str): + return str(obj) + elif isinstance(obj, float): + return float(obj) + elif isinstance(obj, int): + return int(obj) + elif isinstance(obj, decimal.Decimal): + if obj.as_tuple().exponent >= 0: + return int(obj) + return float(obj) + elif isinstance(obj, schemas.NoneClass): + return None + elif isinstance(obj, schemas.BoolClass): + return bool(obj) + elif isinstance(obj, (dict, frozendict.frozendict)): + return {key: self.default(val) for key, val in obj.items()} + elif isinstance(obj, (list, tuple)): + return [self.default(item) for item in obj] + raise exceptions.ApiValueError('Unable to prepare type {} for serialization'.format(obj.__class__.__name__)) + + +class ParameterInType(enum.Enum): + QUERY = 'query' + HEADER = 'header' + PATH = 'path' + COOKIE = 'cookie' + + +class ParameterStyle(enum.Enum): + MATRIX = 'matrix' + LABEL = 'label' + FORM = 'form' + SIMPLE = 'simple' + SPACE_DELIMITED = 'spaceDelimited' + PIPE_DELIMITED = 'pipeDelimited' + DEEP_OBJECT = 'deepObject' + + +class PrefixSeparatorIterator: + # A class to store prefixes and separators for rfc6570 expansions + + def __init__(self, prefix: str, separator: str): + self.prefix = prefix + self.separator = separator + self.first = True + if separator in {'.', '|', '%20'}: + item_separator = separator + else: + item_separator = ',' + self.item_separator = item_separator + + def __iter__(self): + return self + + def __next__(self): + if self.first: + self.first = False + return self.prefix + return self.separator + + +class ParameterSerializerBase: + @staticmethod + def __ref6570_item_value(in_data: typing.Any, percent_encode: bool): + """ + Get representation if str/float/int/None/items in list/ values in dict + None is returned if an item is undefined, use cases are value= + - None + - [] + - {} + - [None, None None] + - {'a': None, 'b': None} + """ + if type(in_data) in {str, float, int}: + if percent_encode: + return parse.quote(str(in_data)) + return str(in_data) + elif isinstance(in_data, schemas.none_type_): + # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 + return None + elif isinstance(in_data, list) and not in_data: + # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 + return None + elif isinstance(in_data, dict) and not in_data: + # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 + return None + raise exceptions.ApiValueError('Unable to generate a ref6570 item representation of {}'.format(in_data)) + + @staticmethod + def _to_dict(name: str, value: str): + return {name: value} + + @classmethod + def __ref6570_str_float_int_expansion( + cls, + variable_name: str, + in_data: typing.Any, + explode: bool, + percent_encode: bool, + prefix_separator_iterator: PrefixSeparatorIterator, + var_name_piece: str, + named_parameter_expansion: bool + ) -> str: + item_value = cls.__ref6570_item_value(in_data, percent_encode) + if item_value is None or (item_value == '' and prefix_separator_iterator.separator == ';'): + return next(prefix_separator_iterator) + var_name_piece + value_pair_equals = '=' if named_parameter_expansion else '' + return next(prefix_separator_iterator) + var_name_piece + value_pair_equals + item_value + + @classmethod + def __ref6570_list_expansion( + cls, + variable_name: str, + in_data: typing.Any, + explode: bool, + percent_encode: bool, + prefix_separator_iterator: PrefixSeparatorIterator, + var_name_piece: str, + named_parameter_expansion: bool + ) -> str: + item_values = [cls.__ref6570_item_value(v, percent_encode) for v in in_data] + item_values = [v for v in item_values if v is not None] + if not item_values: + # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 + return "" + value_pair_equals = '=' if named_parameter_expansion else '' + if not explode: + return ( + next(prefix_separator_iterator) + + var_name_piece + + value_pair_equals + + prefix_separator_iterator.item_separator.join(item_values) + ) + # exploded + return next(prefix_separator_iterator) + next(prefix_separator_iterator).join( + [var_name_piece + value_pair_equals + val for val in item_values] + ) + + @classmethod + def __ref6570_dict_expansion( + cls, + variable_name: str, + in_data: typing.Any, + explode: bool, + percent_encode: bool, + prefix_separator_iterator: PrefixSeparatorIterator, + var_name_piece: str, + named_parameter_expansion: bool + ) -> str: + in_data_transformed = {key: cls.__ref6570_item_value(val, percent_encode) for key, val in in_data.items()} + in_data_transformed = {key: val for key, val in in_data_transformed.items() if val is not None} + if not in_data_transformed: + # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 + return "" + value_pair_equals = '=' if named_parameter_expansion else '' + if not explode: + return ( + next(prefix_separator_iterator) + + var_name_piece + value_pair_equals + + prefix_separator_iterator.item_separator.join( + prefix_separator_iterator.item_separator.join( + item_pair + ) for item_pair in in_data_transformed.items() + ) + ) + # exploded + return next(prefix_separator_iterator) + next(prefix_separator_iterator).join( + [key + '=' + val for key, val in in_data_transformed.items()] + ) + + @classmethod + def _ref6570_expansion( + cls, + variable_name: str, + in_data: typing.Any, + explode: bool, + percent_encode: bool, + prefix_separator_iterator: PrefixSeparatorIterator + ) -> str: + """ + Separator is for separate variables like dict with explode true, not for array item separation + """ + named_parameter_expansion = prefix_separator_iterator.separator in {'&', ';'} + var_name_piece = variable_name if named_parameter_expansion else '' + if type(in_data) in {str, float, int}: + return cls.__ref6570_str_float_int_expansion( + variable_name, + in_data, + explode, + percent_encode, + prefix_separator_iterator, + var_name_piece, + named_parameter_expansion + ) + elif isinstance(in_data, schemas.none_type_): + # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 + return "" + elif isinstance(in_data, list): + return cls.__ref6570_list_expansion( + variable_name, + in_data, + explode, + percent_encode, + prefix_separator_iterator, + var_name_piece, + named_parameter_expansion + ) + elif isinstance(in_data, dict): + return cls.__ref6570_dict_expansion( + variable_name, + in_data, + explode, + percent_encode, + prefix_separator_iterator, + var_name_piece, + named_parameter_expansion + ) + # bool, bytes, etc + raise exceptions.ApiValueError('Unable to generate a ref6570 representation of {}'.format(in_data)) + + +class StyleFormSerializer(ParameterSerializerBase): + @classmethod + def _serialize_form( + cls, + in_data: typing.Union[None, int, float, str, bool, dict, list], + name: str, + explode: bool, + percent_encode: bool, + prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] = None + ) -> str: + if prefix_separator_iterator is None: + prefix_separator_iterator = PrefixSeparatorIterator('', '&') + return cls._ref6570_expansion( + variable_name=name, + in_data=in_data, + explode=explode, + percent_encode=percent_encode, + prefix_separator_iterator=prefix_separator_iterator + ) + + +class StyleSimpleSerializer(ParameterSerializerBase): + + @classmethod + def _serialize_simple( + cls, + in_data: typing.Union[None, int, float, str, bool, dict, list], + name: str, + explode: bool, + percent_encode: bool + ) -> str: + prefix_separator_iterator = PrefixSeparatorIterator('', ',') + return cls._ref6570_expansion( + variable_name=name, + in_data=in_data, + explode=explode, + percent_encode=percent_encode, + prefix_separator_iterator=prefix_separator_iterator + ) + + @classmethod + def _deserialize_simple( + cls, + in_data: str, + name: str, + explode: bool, + percent_encode: bool + ) -> typing.Union[str, typing.List[str], typing.Dict[str, str]]: + raise NotImplementedError( + "Deserialization of style=simple has not yet been added. " + "If you need this how about you submit a PR adding it?" + ) + + +class JSONDetector: + """ + Works for: + application/json + application/json; charset=UTF-8 + application/json-patch+json + application/geo+json + """ + __json_content_type_pattern = re.compile("application/[^+]*[+]?(json);?.*") + + @classmethod + def _content_type_is_json(cls, content_type: str) -> bool: + if cls.__json_content_type_pattern.match(content_type): + return True + return False + + +class Encoding: + def __init__( + self, + content_type: str, + headers: typing.Optional[typing.Dict[str, 'HeaderParameter']] = None, + style: typing.Optional[ParameterStyle] = None, + explode: bool = False, + allow_reserved: bool = False, + ): + self.content_type = content_type + self.headers = headers + self.style = style + self.explode = explode + self.allow_reserved = allow_reserved + + +@dataclasses.dataclass +class MediaType: + """ + Used to store request and response body schema information + encoding: + A map between a property name and its encoding information. + The key, being the property name, MUST exist in the schema as a property. + The encoding object SHALL only apply to requestBody objects when the media type is + multipart or application/x-www-form-urlencoded. + """ + schema: typing.Optional[typing.Type[schemas.Schema]] = None + encoding: typing.Optional[typing.Dict[str, Encoding]] = None + + +@dataclasses.dataclass +class ParameterBase(JSONDetector): + in_type: ParameterInType + required: bool + style: typing.Optional[ParameterStyle] + explode: typing.Optional[bool] + allow_reserved: typing.Optional[bool] + schema: typing.Optional[typing.Type[schemas.Schema]] + content: typing.Optional[typing.Dict[str, typing.Type[MediaType]]] + + _json_encoder = JSONEncoder() + + def __init_subclass__(cls, **kwargs): + if cls.explode is None: + if cls.style is ParameterStyle.FORM: + cls.explode = True + else: + cls.explode = False + + @classmethod + def _serialize_json( + cls, + in_data: typing.Union[None, int, float, str, bool, dict, list], + eliminate_whitespace: bool = False + ) -> str: + if eliminate_whitespace: + return json.dumps(in_data, separators=cls._json_encoder.compact_separators) + return json.dumps(in_data) + + +class PathParameter(ParameterBase, StyleSimpleSerializer): + name: str + required: bool = False + in_type: ParameterInType = ParameterInType.PATH + style: ParameterStyle = ParameterStyle.SIMPLE + explode: bool = False + allow_reserved: typing.Optional[bool] = None + schema: typing.Optional[typing.Type[schemas.Schema]] = None + content: typing.Optional[typing.Dict[str, typing.Type[schemas.Schema]]] = None + + @classmethod + def __serialize_label( + cls, + in_data: typing.Union[None, int, float, str, bool, dict, list] + ) -> typing.Dict[str, str]: + prefix_separator_iterator = PrefixSeparatorIterator('.', '.') + value = cls._ref6570_expansion( + variable_name=cls.name, + in_data=in_data, + explode=cls.explode, + percent_encode=True, + prefix_separator_iterator=prefix_separator_iterator + ) + return cls._to_dict(cls.name, value) + + @classmethod + def __serialize_matrix( + cls, + in_data: typing.Union[None, int, float, str, bool, dict, list] + ) -> typing.Dict[str, str]: + prefix_separator_iterator = PrefixSeparatorIterator(';', ';') + value = cls._ref6570_expansion( + variable_name=cls.name, + in_data=in_data, + explode=cls.explode, + percent_encode=True, + prefix_separator_iterator=prefix_separator_iterator + ) + return cls._to_dict(cls.name, value) + + @classmethod + def __serialize_simple( + cls, + in_data: typing.Union[None, int, float, str, bool, dict, list], + ) -> typing.Dict[str, str]: + value = cls._serialize_simple( + in_data=in_data, + name=cls.name, + explode=cls.explode, + percent_encode=True + ) + return cls._to_dict(cls.name, value) + + @classmethod + def serialize( + cls, + in_data: typing.Union[ + schemas.Schema, decimal.Decimal, int, float, str, datetime.date, datetime.datetime, None, bool, list, tuple, dict, frozendict.frozendict] + ) -> typing.Dict[str, str]: + if cls.schema: + cast_in_data = cls.schema(in_data) + cast_in_data = cls._json_encoder.default(cast_in_data) + """ + simple -> path + path: + returns path_params: dict + label -> path + returns path_params + matrix -> path + returns path_params + """ + if cls.style: + if cls.style is ParameterStyle.SIMPLE: + return cls.__serialize_simple(cast_in_data) + elif cls.style is ParameterStyle.LABEL: + return cls.__serialize_label(cast_in_data) + elif cls.style is ParameterStyle.MATRIX: + return cls.__serialize_matrix(cast_in_data) + # cls.content will be length one + for content_type, schema in cls.content.items(): + cast_in_data = schema(in_data) + cast_in_data = cls._json_encoder.default(cast_in_data) + if cls._content_type_is_json(content_type): + value = cls._serialize_json(cast_in_data) + return cls._to_dict(cls.name, value) + raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) + + +class QueryParameter(ParameterBase, StyleFormSerializer): + name: str + required: bool = False + in_type: ParameterInType = ParameterInType.QUERY + style: ParameterStyle = ParameterStyle.FORM + explode: typing.Optional[bool] = None + allow_reserved: typing.Optional[bool] = None + schema: typing.Optional[typing.Type[schemas.Schema]] = None + content: typing.Optional[typing.Dict[str, typing.Type[schemas.Schema]]] = None + + @classmethod + def __serialize_space_delimited( + cls, + in_data: typing.Union[None, int, float, str, bool, dict, list], + prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] + ) -> typing.Dict[str, str]: + if prefix_separator_iterator is None: + prefix_separator_iterator = cls.get_prefix_separator_iterator() + value = cls._ref6570_expansion( + variable_name=cls.name, + in_data=in_data, + explode=cls.explode, + percent_encode=True, + prefix_separator_iterator=prefix_separator_iterator + ) + return cls._to_dict(cls.name, value) + + @classmethod + def __serialize_pipe_delimited( + cls, + in_data: typing.Union[None, int, float, str, bool, dict, list], + prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] + ) -> typing.Dict[str, str]: + if prefix_separator_iterator is None: + prefix_separator_iterator = cls.get_prefix_separator_iterator() + value = cls._ref6570_expansion( + variable_name=cls.name, + in_data=in_data, + explode=cls.explode, + percent_encode=True, + prefix_separator_iterator=prefix_separator_iterator + ) + return cls._to_dict(cls.name, value) + + @classmethod + def __serialize_form( + cls, + in_data: typing.Union[None, int, float, str, bool, dict, list], + prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] + ) -> typing.Dict[str, str]: + if prefix_separator_iterator is None: + prefix_separator_iterator = cls.get_prefix_separator_iterator() + value = cls._serialize_form( + in_data, + name=cls.name, + explode=cls.explode, + percent_encode=True, + prefix_separator_iterator=prefix_separator_iterator + ) + return cls._to_dict(cls.name, value) + + @classmethod + def get_prefix_separator_iterator(cls) -> typing.Optional[PrefixSeparatorIterator]: + if cls.style is ParameterStyle.FORM: + return PrefixSeparatorIterator('?', '&') + elif cls.style is ParameterStyle.SPACE_DELIMITED: + return PrefixSeparatorIterator('', '%20') + elif cls.style is ParameterStyle.PIPE_DELIMITED: + return PrefixSeparatorIterator('', '|') + + @classmethod + def serialize( + cls, + in_data: typing.Union[ + schemas.Schema, decimal.Decimal, int, float, str, datetime.date, datetime.datetime, None, bool, list, tuple, dict, frozendict.frozendict], + prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] = None + ) -> typing.Dict[str, str]: + if cls.schema: + cast_in_data = cls.schema(in_data) + cast_in_data = cls._json_encoder.default(cast_in_data) + """ + form -> query + query: + - GET/HEAD/DELETE: could use fields + - PUT/POST: must use urlencode to send parameters + returns fields: tuple + spaceDelimited -> query + returns fields + pipeDelimited -> query + returns fields + deepObject -> query, https://github.com/OAI/OpenAPI-Specification/issues/1706 + returns fields + """ + if cls.style: + # TODO update query ones to omit setting values when [] {} or None is input + if cls.style is ParameterStyle.FORM: + return cls.__serialize_form(cast_in_data, prefix_separator_iterator) + elif cls.style is ParameterStyle.SPACE_DELIMITED: + return cls.__serialize_space_delimited(cast_in_data, prefix_separator_iterator) + elif cls.style is ParameterStyle.PIPE_DELIMITED: + return cls.__serialize_pipe_delimited(cast_in_data, prefix_separator_iterator) + # cls.content will be length one + if prefix_separator_iterator is None: + prefix_separator_iterator = cls.get_prefix_separator_iterator() + for content_type, media_type in cls.content.items(): + cast_in_data = media_type.schema(in_data) + cast_in_data = cls._json_encoder.default(cast_in_data) + if cls._content_type_is_json(content_type): + value = cls._serialize_json(cast_in_data, eliminate_whitespace=True) + return cls._to_dict( + cls.name, + next(prefix_separator_iterator) + cls.name + '=' + parse.quote(value) + ) + raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) + + +class CookieParameter(ParameterBase, StyleFormSerializer): + name: str + required: bool = False + style: ParameterStyle = ParameterStyle.FORM + in_type: ParameterInType = ParameterInType.COOKIE + explode: typing.Optional[bool] = None + allow_reserved: typing.Optional[bool] = None + schema: typing.Optional[typing.Type[schemas.Schema]] = None + content: typing.Optional[typing.Dict[str, typing.Type[schemas.Schema]]] = None + + @classmethod + def serialize( + cls, + in_data: typing.Union[ + schemas.Schema, decimal.Decimal, int, float, str, datetime.date, datetime.datetime, None, bool, list, tuple, dict, frozendict.frozendict] + ) -> typing.Dict[str, str]: + if cls.schema: + cast_in_data = cls.schema(in_data) + cast_in_data = cls._json_encoder.default(cast_in_data) + """ + form -> cookie + returns fields: tuple + """ + if cls.style: + """ + TODO add escaping of comma, space, equals + or turn encoding on + """ + value = cls._serialize_form( + cast_in_data, + explode=cls.explode, + name=cls.name, + percent_encode=False, + prefix_separator_iterator=PrefixSeparatorIterator('', '&') + ) + return cls._to_dict(cls.name, value) + # cls.content will be length one + for content_type, media_type in cls.content.items(): + cast_in_data = media_type.schema(in_data) + cast_in_data = cls._json_encoder.default(cast_in_data) + if cls._content_type_is_json(content_type): + value = cls._serialize_json(cast_in_data) + return cls._to_dict(cls.name, value) + raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) + + +class HeaderParameterWithoutName(ParameterBase, StyleSimpleSerializer): + required: bool = False + style: ParameterStyle = ParameterStyle.SIMPLE + in_type: ParameterInType = ParameterInType.HEADER + explode: bool = False + allow_reserved: typing.Optional[bool] = None + schema: typing.Optional[typing.Type[schemas.Schema]] = None + content: typing.Optional[typing.Dict[str, typing.Type[schemas.Schema]]] = None + + @staticmethod + def __to_headers(in_data: typing.Tuple[typing.Tuple[str, str], ...]) -> _collections.HTTPHeaderDict: + data = tuple(t for t in in_data if t) + headers = _collections.HTTPHeaderDict() + if not data: + return headers + headers.extend(data) + return headers + + @classmethod + def serialize( + cls, + in_data: typing.Union[ + schemas.Schema, decimal.Decimal, int, float, str, datetime.date, datetime.datetime, None, bool, list, tuple, dict, frozendict.frozendict], + name: str + ) -> _collections.HTTPHeaderDict: + if cls.schema: + cast_in_data = cls.schema(in_data) + cast_in_data = cls._json_encoder.default(cast_in_data) + """ + simple -> header + headers: PoolManager needs a mapping, tuple is close + returns headers: dict + """ + if cls.style: + value = cls._serialize_simple(cast_in_data, name, cls.explode, False) + return cls.__to_headers(((name, value),)) + # cls.content will be length one + for content_type, media_type in cls.content.items(): + cast_in_data = media_type.schema(in_data) + cast_in_data = cls._json_encoder.default(cast_in_data) + if cls._content_type_is_json(content_type): + value = cls._serialize_json(cast_in_data) + return cls.__to_headers(((name, value),)) + raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) + + @classmethod + def deserialize( + cls, + in_data: str, + name: str + ) -> schemas.Schema: + if cls.schema: + """ + simple -> header + headers: PoolManager needs a mapping, tuple is close + returns headers: dict + """ + if cls.style: + extracted_data = cls._deserialize_simple(in_data, name, cls.explode, False) + return cls.schema.from_openapi_data_(extracted_data) + # cls.content will be length one + for content_type, media_type in cls.content.items(): + if cls._content_type_is_json(content_type): + cast_in_data = json.loads(in_data) + return media_type.schema.from_openapi_data_(cast_in_data) + raise NotImplementedError('Deserialization of {} has not yet been implemented'.format(content_type)) + + +class HeaderParameter(HeaderParameterWithoutName): + name: str + + @classmethod + def serialize( + cls, + in_data: typing.Union[ + schemas.Schema, decimal.Decimal, int, float, str, datetime.date, datetime.datetime, None, bool, list, tuple, dict, frozendict.frozendict] + ) -> _collections.HTTPHeaderDict: + return super().serialize( + in_data, + cls.name + ) + + +@dataclasses.dataclass +class ApiResponse: + response: urllib3.HTTPResponse + body: typing.Union[schemas.Unset, schemas.Schema] = schemas.unset + headers: typing.Union[schemas.Unset, typing.Dict[str, schemas.Schema]] = schemas.unset + + def __init__( + self, + response: urllib3.HTTPResponse, + body: typing.Union[schemas.Unset, schemas.Schema] = schemas.unset, + headers: typing.Union[schemas.Unset, typing.Dict[str, schemas.Schema]] = schemas.unset + ): + """ + pycharm needs this to prevent 'Unexpected argument' warnings + """ + self.response = response + self.body = body + self.headers = headers + + +@dataclasses.dataclass +class ApiResponseWithoutDeserialization(ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[schemas.Unset, schemas.Schema] = schemas.unset + headers: typing.Union[schemas.Unset, typing.Dict[str, schemas.Schema]] = schemas.unset + + +class TypedDictInputVerifier: + @staticmethod + def _verify_typed_dict_inputs(cls: typing.Type[typing_extensions.TypedDict], data: typing.Dict[str, typing.Any]): + """ + Ensures that: + - required keys are present + - additional properties are not input + - value stored under required keys do not have the value schemas.unset + Note: detailed value checking is done in schema classes + """ + missing_required_keys = [] + required_keys_with_unset_values = [] + for required_key in cls.__required_keys__: + if required_key not in data: + missing_required_keys.append(required_key) + continue + value = data[required_key] + if value is schemas.unset: + required_keys_with_unset_values.append(required_key) + if missing_required_keys: + raise exceptions.ApiTypeError( + '{} missing {} required arguments: {}'.format( + cls.__name__, len(missing_required_keys), missing_required_keys + ) + ) + if required_keys_with_unset_values: + raise exceptions.ApiValueError( + '{} contains invalid unset values for {} required keys: {}'.format( + cls.__name__, len(required_keys_with_unset_values), required_keys_with_unset_values + ) + ) + + disallowed_additional_keys = [] + for key in data: + if key in cls.__required_keys__ or key in cls.__optional_keys__: + continue + disallowed_additional_keys.append(key) + if disallowed_additional_keys: + raise exceptions.ApiTypeError( + '{} got {} unexpected keyword arguments: {}'.format( + cls.__name__, len(disallowed_additional_keys), disallowed_additional_keys + ) + ) + + +T = typing.TypeVar("T") + + +@dataclasses.dataclass +class OpenApiResponse(JSONDetector, TypedDictInputVerifier, typing.Generic[T]): + __filename_content_disposition_pattern = re.compile('filename="(.+?)"') + response_cls: typing.Type[T] + content: typing.Optional[typing.Dict[str, MediaType]] = None + headers: typing.Optional[typing.Dict[str, HeaderParameterWithoutName]] = None + + @staticmethod + def __deserialize_json(response: urllib3.HTTPResponse) -> typing.Any: + # python must be >= 3.9 so we can pass in bytes into json.loads + return json.loads(response.data) + + @staticmethod + def __file_name_from_response_url(response_url: typing.Optional[str]) -> typing.Optional[str]: + if response_url is None: + return None + url_path = parse.urlparse(response_url).path + if url_path: + path_basename = os.path.basename(url_path) + if path_basename: + _filename, ext = os.path.splitext(path_basename) + if ext: + return path_basename + return None + + @classmethod + def __file_name_from_content_disposition(cls, content_disposition: typing.Optional[str]) -> typing.Optional[str]: + if content_disposition is None: + return None + match = cls.__filename_content_disposition_pattern.search(content_disposition) + if not match: + return None + return match.group(1) + + @classmethod + def __deserialize_application_octet_stream( + cls, response: urllib3.HTTPResponse + ) -> typing.Union[bytes, io.BufferedReader]: + """ + urllib3 use cases: + 1. when preload_content=True (stream=False) then supports_chunked_reads is False and bytes are returned + 2. when preload_content=False (stream=True) then supports_chunked_reads is True and + a file will be written and returned + """ + if response.supports_chunked_reads(): + file_name = ( + cls.__file_name_from_content_disposition(response.headers.get('content-disposition')) + or cls.__file_name_from_response_url(response.geturl()) + ) + + if file_name is None: + _fd, path = tempfile.mkstemp() + else: + path = os.path.join(tempfile.gettempdir(), file_name) + + with open(path, 'wb') as new_file: + chunk_size = 1024 + while True: + data = response.read(chunk_size) + if not data: + break + new_file.write(data) + # release_conn is needed for streaming connections only + response.release_conn() + new_file = open(path, 'rb') + return new_file + else: + return response.data + + @staticmethod + def __deserialize_multipart_form_data( + response: urllib3.HTTPResponse + ) -> typing.Dict[str, typing.Any]: + msg = email.message_from_bytes(response.data) + return { + part.get_param("name", header="Content-Disposition"): part.get_payload( + decode=True + ).decode(part.get_content_charset()) + if part.get_content_charset() + else part.get_payload() + for part in msg.get_payload() + } + + @classmethod + def deserialize(cls, response: urllib3.HTTPResponse, configuration: schema_configuration.SchemaConfiguration) -> T: + content_type = response.headers.get('content-type') + deserialized_body = schemas.unset + streamed = response.supports_chunked_reads() + + deserialized_headers = schemas.unset + if cls.headers is not None: + cls._verify_typed_dict_inputs(cls.response_cls.headers, response.headers) + deserialized_headers = {} + for header_name, header_param in cls.headers.items(): + header_value = response.headers.get(header_name) + if header_value is None: + continue + header_value = header_param.deserialize(header_value, header_name) + deserialized_headers[header_name] = header_value + + if cls.content is not None: + if content_type not in cls.content: + raise exceptions.ApiValueError( + f"Invalid content_type returned. Content_type='{content_type}' was returned " + f"when only {str(set(cls.content))} are defined for status_code={str(response.status)}" + ) + body_schema = cls.content[content_type].schema + if body_schema is None: + # some specs do not define response content media type schemas + return cls.response_cls( + response=response, + headers=deserialized_headers, + body=schemas.unset + ) + + if cls._content_type_is_json(content_type): + body_data = cls.__deserialize_json(response) + elif content_type == 'application/octet-stream': + body_data = cls.__deserialize_application_octet_stream(response) + elif content_type.startswith('multipart/form-data'): + body_data = cls.__deserialize_multipart_form_data(response) + content_type = 'multipart/form-data' + else: + raise NotImplementedError('Deserialization of {} has not yet been implemented'.format(content_type)) + deserialized_body = body_schema.from_openapi_data_( + body_data, configuration_=configuration) + elif streamed: + response.release_conn() + + return cls.response_cls( + response=response, + headers=deserialized_headers, + body=deserialized_body + ) + + +class ApiClient: + """Generic API client for OpenAPI client library builds. + + OpenAPI generic API client. This client handles the client- + server communication, and is invariant across implementations. Specifics of + the methods and models for each application are generated from the OpenAPI + templates. + + NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + Do not edit the class manually. + + :param configuration: api_configuration.ApiConfiguration object for this client + :param schema_configuration: schema_configuration.SchemaConfiguration object for this client + :param header_name: a header to pass when making calls to the API. + :param header_value: a header value to pass when making calls to + the API. + :param cookie: a cookie to include in the header when making calls + to the API + :param pool_threads: The number of threads to use for async requests + to the API. More threads means more concurrent API requests. + """ + + _pool = None + + def __init__( + self, + configuration: typing.Optional[api_configuration.ApiConfiguration] = None, + schema_config: typing.Optional[schema_configuration.SchemaConfiguration] = None, + header_name: typing.Optional[str] = None, + header_value: typing.Optional[str] = None, + cookie: typing.Optional[str] = None, + pool_threads: int = 1 + ): + self.configuration: api_configuration.ApiConfiguration = configuration or api_configuration.ApiConfiguration() + self.schema_configuration: schema_configuration.SchemaConfiguration = schema_config or schema_configuration.SchemaConfiguration() + self.pool_threads = pool_threads + self.rest_client = rest.RESTClientObject(self.configuration) + self.default_headers = _collections.HTTPHeaderDict() + if header_name is not None: + self.default_headers[header_name] = header_value + self.cookie = cookie + # Set default User-Agent. + self.user_agent = 'OpenAPI-JSON-Schema-Generator/1.0.0/python' + + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_value, traceback): + self.close() + + def close(self): + if self._pool: + self._pool.close() + self._pool.join() + self._pool = None + if hasattr(atexit, 'unregister'): + atexit.unregister(self.close) + + @property + def pool(self): + """Create thread pool on first request + avoids instantiating unused threadpool for blocking clients. + """ + if self._pool is None: + atexit.register(self.close) + self._pool = pool.ThreadPool(self.pool_threads) + return self._pool + + @property + def user_agent(self): + """User agent for this API client""" + return self.default_headers['User-Agent'] + + @user_agent.setter + def user_agent(self, value): + self.default_headers['User-Agent'] = value + + def set_default_header(self, header_name, header_value): + self.default_headers[header_name] = header_value + + def __call_api( + self, + resource_path: str, + method: str, + host: str, + headers: typing.Optional[_collections.HTTPHeaderDict] = None, + body: typing.Optional[typing.Union[str, bytes]] = None, + fields: typing.Optional[typing.Tuple[typing.Tuple[str, str], ...]] = None, + security_requirement_object: typing.Optional[security_schemes.SecurityRequirementObject] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> urllib3.HTTPResponse: + + # header parameters + used_headers = _collections.HTTPHeaderDict(self.default_headers) + if self.cookie: + headers['Cookie'] = self.cookie + + # auth setting + self.update_params_for_auth( + used_headers, + security_requirement_object, + resource_path, + method, + body + ) + + # must happen after cookie setting and auth setting in case user is overriding those + if headers: + used_headers.update(headers) + + # request url + url = host + resource_path + + # perform request and return response + response = self.request( + method, + url, + headers=used_headers, + fields=fields, + body=body, + stream=stream, + timeout=timeout, + ) + return response + + def call_api( + self, + resource_path: str, + method: str, + host: str, + headers: typing.Optional[_collections.HTTPHeaderDict] = None, + body: typing.Optional[typing.Union[str, bytes]] = None, + fields: typing.Optional[typing.Tuple[typing.Tuple[str, str], ...]] = None, + security_requirement_object: typing.Optional[security_schemes.SecurityRequirementObject] = None, + async_req: typing.Optional[bool] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> urllib3.HTTPResponse: + """Makes the HTTP request (synchronous) and returns deserialized data. + + To make an async_req request, set the async_req parameter. + + :param resource_path: Path to method endpoint. + :param method: Method to call. + :param headers: Header parameters to be + placed in the request header. + :param body: Request body. + :param fields: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data` + :param security_requirement_object: The security requirement object, used to apply auth when making the call + :param async_req: execute request asynchronously + :type async_req: bool, optional TODO remove, unused + :param stream: if True, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Also when True, if the openapi spec describes a file download, + the data will be written to a local filesystem file and the schemas.BinarySchema + instance will also inherit from FileSchema and schemas.FileIO + Default is False. + :type stream: bool, optional + :param timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param host: api endpoint host + :return: + If async_req parameter is True, + the request will be called asynchronously. + The method will return the request thread. + If parameter async_req is False or missing, + then the method will return the response directly. + """ + + if not async_req: + return self.__call_api( + resource_path, + method, + host, + headers, + body, + fields, + security_requirement_object, + stream, + timeout, + ) + + return self.pool.apply_async( + self.__call_api, + ( + resource_path, + method, + host, + headers, + body, + json, + fields, + security_requirement_object, + stream, + timeout, + ) + ) + + def request( + self, + method: str, + url: str, + headers: typing.Optional[_collections.HTTPHeaderDict] = None, + fields: typing.Optional[typing.Tuple[typing.Tuple[str, str], ...]] = None, + body: typing.Optional[typing.Union[str, bytes]] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> urllib3.HTTPResponse: + """Makes the HTTP request using RESTClient.""" + if method == "get": + return self.rest_client.get(url, + stream=stream, + timeout=timeout, + headers=headers) + elif method == "head": + return self.rest_client.head(url, + stream=stream, + timeout=timeout, + headers=headers) + elif method == "options": + return self.rest_client.options(url, + headers=headers, + fields=fields, + stream=stream, + timeout=timeout, + body=body) + elif method == "post": + return self.rest_client.post(url, + headers=headers, + fields=fields, + stream=stream, + timeout=timeout, + body=body) + elif method == "put": + return self.rest_client.put(url, + headers=headers, + fields=fields, + stream=stream, + timeout=timeout, + body=body) + elif method == "patch": + return self.rest_client.patch(url, + headers=headers, + fields=fields, + stream=stream, + timeout=timeout, + body=body) + elif method == "delete": + return self.rest_client.delete(url, + headers=headers, + stream=stream, + timeout=timeout, + body=body) + else: + raise exceptions.ApiValueError( + "http method must be `GET`, `HEAD`, `OPTIONS`," + " `POST`, `PATCH`, `PUT` or `DELETE`." + ) + + def update_params_for_auth( + self, + headers: _collections.HTTPHeaderDict, + security_requirement_object: typing.Optional[security_schemes.SecurityRequirementObject], + resource_path: str, + method: str, + body: typing.Optional[typing.Union[str, bytes]] = None + ): + """Updates header and query params based on authentication setting. + + :param headers: Header parameters dict to be updated. + :param security_requirement_object: the openapi security requirement object + :param resource_path: A string representation of the HTTP request resource path. + :param method: A string representation of the HTTP request method. + :param body: A object representing the body of the HTTP request. + The object type is the return value of _encoder.default(). + """ + if not security_requirement_object: + # optional auth cause, use no auth + return + for security_scheme_component_name, scope_names in security_requirement_object.items(): + security_scheme_instance = self.configuration.security_scheme_info[security_scheme_component_name] + security_scheme_instance.apply_auth( + headers, + resource_path, + method, + body, + scope_names + ) + + +class Api(TypedDictInputVerifier): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + def __init__(self, api_client: typing.Optional[ApiClient] = None): + self.api_client: ApiClient = api_client or ApiClient() + + +class SerializedRequestBody(typing_extensions.TypedDict, total=False): + body: typing.Union[str, bytes] + fields: typing.Tuple[typing.Union[RequestField, typing.Tuple[str, str]], ...] + + +class RequestBody(StyleFormSerializer, JSONDetector): + """ + A request body parameter + content: content_type to MediaType schemas.Schema info + """ + __json_encoder = JSONEncoder() + content: typing.Dict[str, MediaType] + required: bool = False + + @classmethod + def __serialize_json( + cls, + in_data: typing.Any + ) -> typing.Dict[str, bytes]: + in_data = cls.__json_encoder.default(in_data) + json_str = json.dumps(in_data, separators=(",", ":"), ensure_ascii=False).encode( + "utf-8" + ) + return dict(body=json_str) + + @staticmethod + def __serialize_text_plain(in_data: typing.Any) -> typing.Dict[str, str]: + if isinstance(in_data, frozendict.frozendict): + raise ValueError('Unable to serialize type frozendict.frozendict to text/plain') + elif isinstance(in_data, tuple): + raise ValueError('Unable to serialize type tuple to text/plain') + elif isinstance(in_data, schemas.NoneClass): + raise ValueError('Unable to serialize type NoneClass to text/plain') + elif isinstance(in_data, schemas.BoolClass): + raise ValueError('Unable to serialize type BoolClass to text/plain') + return dict(body=str(in_data)) + + @classmethod + def __multipart_json_item(cls, key: str, value: schemas.Schema) -> RequestField: + json_value = cls.__json_encoder.default(value) + request_field = RequestField(name=key, data=json.dumps(json_value)) + request_field.make_multipart(content_type='application/json') + return request_field + + @classmethod + def __multipart_form_item(cls, key: str, value: schemas.Schema) -> RequestField: + if isinstance(value, str): + request_field = RequestField(name=key, data=str(value)) + request_field.make_multipart(content_type='text/plain') + elif isinstance(value, bytes): + request_field = RequestField(name=key, data=value) + request_field.make_multipart(content_type='application/octet-stream') + elif isinstance(value, schemas.FileIO): + # TODO use content.encoding to limit allowed content types if they are present + request_field = RequestField.from_tuples(key, (os.path.basename(value.name), value.read())) + value.close() + else: + request_field = cls.__multipart_json_item(key=key, value=value) + return request_field + + @classmethod + def __serialize_multipart_form_data( + cls, in_data: schemas.Schema + ) -> typing.Dict[str, typing.Tuple[RequestField, ...]]: + if not isinstance(in_data, frozendict.frozendict): + raise ValueError(f'Unable to serialize {in_data} to multipart/form-data because it is not a dict of data') + """ + In a multipart/form-data request body, each schema property, or each element of a schema array property, + takes a section in the payload with an internal header as defined by RFC7578. The serialization strategy + for each property of a multipart/form-data request body can be specified in an associated Encoding Object. + + When passing in multipart types, boundaries MAY be used to separate sections of the content being + transferred – thus, the following default Content-Types are defined for multipart: + + If the (object) property is a primitive, or an array of primitive values, the default Content-Type is text/plain + If the property is complex, or an array of complex values, the default Content-Type is application/json + Question: how is the array of primitives encoded? + If the property is a type: string with a contentEncoding, the default Content-Type is application/octet-stream + """ + fields = [] + for key, value in in_data.items(): + if isinstance(value, tuple): + if value: + # values use explode = True, so the code makes a RequestField for each item with name=key + for item in value: + request_field = cls.__multipart_form_item(key=key, value=item) + fields.append(request_field) + else: + # send an empty array as json because exploding will not send it + request_field = cls.__multipart_json_item(key=key, value=value) + fields.append(request_field) + else: + request_field = cls.__multipart_form_item(key=key, value=value) + fields.append(request_field) + + return dict(fields=tuple(fields)) + + @staticmethod + def __serialize_application_octet_stream(in_data: schemas.BinarySchema) -> typing.Dict[str, bytes]: + if isinstance(in_data, bytes): + return dict(body=in_data) + # schemas.FileIO type + result = dict(body=in_data.read()) + in_data.close() + return result + + @classmethod + def __serialize_application_x_www_form_data( + cls, in_data: typing.Any + ) -> SerializedRequestBody: + """ + POST submission of form data in body + """ + if not isinstance(in_data, frozendict.frozendict): + raise ValueError( + f'Unable to serialize {in_data} to application/x-www-form-urlencoded because it is not a dict of data') + cast_in_data = cls.__json_encoder.default(in_data) + value = cls._serialize_form(cast_in_data, name='', explode=True, percent_encode=True) + return dict(body=value) + + @classmethod + def serialize( + cls, in_data: typing.Any, content_type: str + ) -> SerializedRequestBody: + """ + If a str is returned then the result will be assigned to data when making the request + If a tuple is returned then the result will be used as fields input in encode_multipart_formdata + Return a tuple of + + The key of the return dict is + - body for application/json + - encode_multipart and fields for multipart/form-data + """ + media_type = cls.content[content_type] + if isinstance(in_data, media_type.schema): + cast_in_data = in_data + elif isinstance(in_data, (dict, frozendict.frozendict)) and in_data: + cast_in_data = media_type.schema(**in_data) + else: + cast_in_data = media_type.schema(in_data) + # TODO check for and use encoding if it exists + # and content_type is multipart or application/x-www-form-urlencoded + if cls._content_type_is_json(content_type): + return cls.__serialize_json(cast_in_data) + elif content_type == 'text/plain': + return cls.__serialize_text_plain(cast_in_data) + elif content_type == 'multipart/form-data': + return cls.__serialize_multipart_form_data(cast_in_data) + elif content_type == 'application/x-www-form-urlencoded': + return cls.__serialize_application_x_www_form_data(cast_in_data) + elif content_type == 'application/octet-stream': + return cls.__serialize_application_octet_stream(cast_in_data) + raise NotImplementedError('Serialization has not yet been implemented for {}'.format(content_type)) diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/apis/__init__.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/apis/__init__.py similarity index 100% rename from samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/apis/__init__.py rename to samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/apis/__init__.py diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/apis/path_to_api.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/apis/path_to_api.py new file mode 100644 index 00000000000..9b93470cc63 --- /dev/null +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/apis/path_to_api.py @@ -0,0 +1,17 @@ +import typing +import typing_extensions + +from this_package.apis.paths.operators import Operators + +PathToApi = typing_extensions.TypedDict( + 'PathToApi', + { + "/operators": typing.Type[Operators], + } +) + +path_to_api = PathToApi( + { + "/operators": Operators, + } +) diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/apis/paths/__init__.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/apis/paths/__init__.py new file mode 100644 index 00000000000..55179ce77cd --- /dev/null +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/apis/paths/__init__.py @@ -0,0 +1,3 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from this_package.apis.path_to_api import path_to_api \ No newline at end of file diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/apis/paths/operators.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/apis/paths/operators.py new file mode 100644 index 00000000000..7b97382ea9f --- /dev/null +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/apis/paths/operators.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from this_package.paths.operators.post.operation import ApiForPost + + +class Operators( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/apis/tag_to_api.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/apis/tag_to_api.py new file mode 100644 index 00000000000..c58c06a5153 --- /dev/null +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/apis/tag_to_api.py @@ -0,0 +1,17 @@ +import typing +import typing_extensions + +from this_package.apis.tags.default_api import DefaultApi + +TagToApi = typing_extensions.TypedDict( + 'TagToApi', + { + "default": typing.Type[DefaultApi], + } +) + +tag_to_api = TagToApi( + { + "default": DefaultApi, + } +) diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/apis/tags/__init__.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/apis/tags/__init__.py new file mode 100644 index 00000000000..55ef8cf0321 --- /dev/null +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/apis/tags/__init__.py @@ -0,0 +1,3 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from this_package.apis.tag_to_api import tag_to_api \ No newline at end of file diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/apis/tags/default_api.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/apis/tags/default_api.py new file mode 100644 index 00000000000..cec81c704b0 --- /dev/null +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/apis/tags/default_api.py @@ -0,0 +1,20 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from this_package.paths.operators.post.operation import PostOperators + + +class DefaultApi( + PostOperators, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + pass diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/components/__init__.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/components/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/components/schema/__init__.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/components/schema/__init__.py new file mode 100644 index 00000000000..5f04205d88c --- /dev/null +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/components/schema/__init__.py @@ -0,0 +1,5 @@ +# we can not import model classes here because that would create a circular +# reference which would not work in python2 +# do not import all models into this module because that uses a lot of memory and stack frames +# if you need the ability to import all models from one package, import them with +# from this_package.components.schemas import ModelA, ModelB diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/components/schema/addition_operator.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/components/schema/addition_operator.py new file mode 100644 index 00000000000..5ba982a130d --- /dev/null +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/components/schema/addition_operator.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + discriminator-test + + No description provided (generated by Openapi JSON Schema Generator https://github.com/openapi-json-schema-tools/openapi-json-schema-generator) # noqa: E501 + + The version of the OpenAPI document: 1.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from this_package import schemas # noqa: F401 + + +class AdditionOperator( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {frozendict.frozendict} + required = { + "a", + "b", + "operator_id", + } + + class Properties: + A = schemas.Float64Schema + B = schemas.Float64Schema + + + class OperatorId( + schemas.StrSchema + ): + + + class Schema_: + types = { + str, + } + default = "ADD" + __annotations__ = { + "a": A, + "b": B, + "operator_id": OperatorId, + } + AdditionalProperties = schemas.NotAnyTypeSchema + + a: Schema_.Properties.A + b: Schema_.Properties.B + operator_id: Schema_.Properties.OperatorId + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["a"]) -> Schema_.Properties.A: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["b"]) -> Schema_.Properties.B: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["operator_id"]) -> Schema_.Properties.OperatorId: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["a"], + typing_extensions.Literal["b"], + typing_extensions.Literal["operator_id"], + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["a"]) -> Schema_.Properties.A: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["b"]) -> Schema_.Properties.B: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["operator_id"]) -> Schema_.Properties.OperatorId: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["a"], + typing_extensions.Literal["b"], + typing_extensions.Literal["operator_id"], + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + a: typing.Union[Schema_.Properties.A, decimal.Decimal, int, float], + b: typing.Union[Schema_.Properties.B, decimal.Decimal, int, float], + operator_id: typing.Union[Schema_.Properties.OperatorId, str], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'AdditionOperator': + return super().__new__( + cls, + *args_, + a=a, + b=b, + operator_id=operator_id, + configuration_=configuration_, + ) diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/components/schema/operator.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/components/schema/operator.py new file mode 100644 index 00000000000..04f3800f5a5 --- /dev/null +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/components/schema/operator.py @@ -0,0 +1,79 @@ +# coding: utf-8 + +""" + discriminator-test + + No description provided (generated by Openapi JSON Schema Generator https://github.com/openapi-json-schema-tools/openapi-json-schema-generator) # noqa: E501 + + The version of the OpenAPI document: 1.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from this_package import schemas # noqa: F401 + + +class Operator( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + + @staticmethod + def discriminator(): + return { + 'operator_id': { + 'ADD': addition_operator.AdditionOperator, + 'AdditionOperator': addition_operator.AdditionOperator, + 'SUB': subtraction_operator.SubtractionOperator, + 'SubtractionOperator': subtraction_operator.SubtractionOperator, + } + } + + class OneOf: + + @staticmethod + def _0() -> typing.Type['addition_operator.AdditionOperator']: + return addition_operator.AdditionOperator + + @staticmethod + def _1() -> typing.Type['subtraction_operator.SubtractionOperator']: + return subtraction_operator.SubtractionOperator + classes = [ + _0, + _1, + ] + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'Operator': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + +from this_package.components.schema import addition_operator +from this_package.components.schema import subtraction_operator diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/components/schema/subtraction_operator.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/components/schema/subtraction_operator.py new file mode 100644 index 00000000000..01e7aca318e --- /dev/null +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/components/schema/subtraction_operator.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + discriminator-test + + No description provided (generated by Openapi JSON Schema Generator https://github.com/openapi-json-schema-tools/openapi-json-schema-generator) # noqa: E501 + + The version of the OpenAPI document: 1.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from this_package import schemas # noqa: F401 + + +class SubtractionOperator( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {frozendict.frozendict} + required = { + "a", + "b", + "operator_id", + } + + class Properties: + A = schemas.Float64Schema + B = schemas.Float64Schema + + + class OperatorId( + schemas.StrSchema + ): + + + class Schema_: + types = { + str, + } + default = "SUB" + __annotations__ = { + "a": A, + "b": B, + "operator_id": OperatorId, + } + AdditionalProperties = schemas.NotAnyTypeSchema + + a: Schema_.Properties.A + b: Schema_.Properties.B + operator_id: Schema_.Properties.OperatorId + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["a"]) -> Schema_.Properties.A: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["b"]) -> Schema_.Properties.B: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["operator_id"]) -> Schema_.Properties.OperatorId: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["a"], + typing_extensions.Literal["b"], + typing_extensions.Literal["operator_id"], + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["a"]) -> Schema_.Properties.A: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["b"]) -> Schema_.Properties.B: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["operator_id"]) -> Schema_.Properties.OperatorId: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["a"], + typing_extensions.Literal["b"], + typing_extensions.Literal["operator_id"], + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + a: typing.Union[Schema_.Properties.A, decimal.Decimal, int, float], + b: typing.Union[Schema_.Properties.B, decimal.Decimal, int, float], + operator_id: typing.Union[Schema_.Properties.OperatorId, str], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'SubtractionOperator': + return super().__new__( + cls, + *args_, + a=a, + b=b, + operator_id=operator_id, + configuration_=configuration_, + ) diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/components/schemas/__init__.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/components/schemas/__init__.py new file mode 100644 index 00000000000..755e18164fb --- /dev/null +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/components/schemas/__init__.py @@ -0,0 +1,16 @@ +# coding: utf-8 + +# flake8: noqa + +# import all models into this package +# if you have many models here with many references from one model to another this may +# raise a RecursionError +# to avoid this, import only the models that you directly need like: +# from from this_package.components.schema.pet import Pet +# or import this package, but before doing it, use: +# import sys +# sys.setrecursionlimit(n) + +from this_package.components.schema.addition_operator import AdditionOperator +from this_package.components.schema.operator import Operator +from this_package.components.schema.subtraction_operator import SubtractionOperator diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/configuration.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/configuration.py new file mode 100644 index 00000000000..995cfce83d4 --- /dev/null +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/configuration.py @@ -0,0 +1,404 @@ +# coding: utf-8 + +""" + discriminator-test + + No description provided (generated by Openapi JSON Schema Generator https://github.com/openapi-json-schema-tools/openapi-json-schema-generator) # noqa: E501 + + The version of the OpenAPI document: 1.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import copy +from http import client as http_client +import logging +import multiprocessing +import sys +import typing + +import urllib3 + +from this_package import exceptions + + +PYTHON_KEYWORD_TO_JSON_SCHEMA_KEYWORD = { + 'types': 'type', + 'enum_value_to_name': 'enum', + 'unique_items': 'uniqueItems', + 'min_items': 'minItems', + 'max_items': 'maxItems', + 'min_properties': 'minProperties', + 'max_properties': 'maxProperties', + 'min_length': 'minLength', + 'max_length': 'maxLength', + 'inclusive_minimum': 'minimum', + 'exclusive_minimum': 'exclusiveMinimum', + 'inclusive_maximum': 'maximum', + 'exclusive_maximum': 'exclusiveMaximum', + 'multiple_of': 'multipleOf', + 'regex': 'pattern', + 'format': 'format', + 'required': 'required', + 'items': 'items', + 'Items': 'items', + 'Properties': 'properties', + 'additional_properties': 'additionalProperties', + 'additionalProperties': 'additionalProperties', + 'OneOf': 'oneOf', + 'AnyOf': 'anyOf', + 'AllOf': 'allOf', + '_not': 'not', + '_Not': 'not', + 'discriminator': 'discriminator' +} + +class Configuration(object): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator + + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + Do not edit the class manually. + + :param host: Base url + :param disabled_json_schema_keywords (set): Set of + JSON schema validation keywords to disable JSON schema structural validation + rules. The following keywords may be specified: multipleOf, maximum, + exclusiveMaximum, minimum, exclusiveMinimum, maxLength, minLength, pattern, + maxItems, minItems. + By default, the validation is performed for data generated locally by the client + and data received from the server, independent of any validation performed by + the server side. If the input data does not satisfy the JSON schema validation + rules specified in the OpenAPI document, an exception is raised. + If disabled_json_schema_keywords is set, structural validation is + disabled. This can be useful to troubleshoot data validation problem, such as + when the OpenAPI document validation rules do not match the actual API data + received by the server. + :param server_index: Index to servers configuration. + :param server_variables: Mapping with string values to replace variables in + templated server configuration. The validation of enums is performed for + variables with defined enum values before. + :param server_operation_index: Mapping from operation ID to an index to server + configuration. + :param server_operation_variables: Mapping from operation ID to a mapping with + string values to replace variables in templated server configuration. + The validation of enums is performed for variables with defined enum values before. + """ + + _default = None + + def __init__( + self, + host: typing.Optional[str] = None, + disabled_json_schema_keywords = frozenset(), + server_index: typing.Optional[int] = None, + server_variables = None, + server_operation_index = None, + server_operation_variables = None, + ): + """Constructor + """ + self._base_path = host or "http://localhost:3000" + """Default Base url + """ + self.server_index = 0 if server_index is None and host is None else server_index + self.server_operation_index = server_operation_index or {} + """Default server index + """ + self.server_variables = server_variables or {} + self.server_operation_variables = server_operation_variables or {} + """Default server variables + """ + self.temp_folder_path = None + """Temp file folder for downloading files + """ + # Authentication Settings + self.auth_info = {} + self.disabled_json_schema_keywords = disabled_json_schema_keywords + self.logger = {} + """Logging Settings + """ + self.logger["package_logger"] = logging.getLogger("this_package") + self.logger["urllib3_logger"] = logging.getLogger("urllib3") + self.logger_format = '%(asctime)s %(levelname)s %(message)s' + """Log format + """ + self.logger_stream_handler = None + """Log stream handler + """ + self.logger_file_handler = None + """Log file handler + """ + self.logger_file = None + """Debug file location + """ + self.debug = False + """Debug switch + """ + + self.verify_ssl = True + """SSL/TLS verification + Set this to false to skip verifying SSL certificate when calling API + from https server. + """ + self.ssl_ca_cert = None + """Set this to customize the certificate file to verify the peer. + """ + self.cert_file = None + """client certificate file + """ + self.key_file = None + """client key file + """ + self.assert_hostname = None + """Set this to True/False to enable/disable SSL hostname verification. + """ + + self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 + """urllib3 connection pool's maximum number of connections saved + per pool. urllib3 uses 1 connection as default value, but this is + not the best value when you are making a lot of possibly parallel + requests to the same host, which is often the case here. + cpu_count * 5 is used as default value to increase performance. + """ + + self.proxy = None + """Proxy URL + """ + self.proxy_headers = None + """Proxy headers + """ + self.safe_chars_for_path_param = '' + """Safe chars for path_param + """ + self.retries = None + """Adding retries to override urllib3 default value 3 + """ + # Enable client side validation + self.client_side_validation = True + + # Options to pass down to the underlying urllib3 socket + self.socket_options = None + + def __deepcopy__(self, memo): + cls = self.__class__ + result = cls.__new__(cls) + memo[id(self)] = result + for k, v in self.__dict__.items(): + if k not in ('logger', 'logger_file_handler'): + setattr(result, k, copy.deepcopy(v, memo)) + # shallow copy of loggers + result.logger = copy.copy(self.logger) + # use setters to configure loggers + result.logger_file = self.logger_file + result.debug = self.debug + return result + + @property + def disabled_json_schema_keywords(self) -> typing.Set[str]: + return self.__disabled_json_schema_keywords + + @property + def disabled_json_schema_python_keywords(self) -> typing.Set[str]: + return self.__disabled_json_schema_python_keywords + + @disabled_json_schema_keywords.setter + def disabled_json_schema_keywords(self, json_keywords: typing.Set[str]): + disabled_json_schema_keywords = set() + disabled_json_schema_python_keywords = set() + for k in json_keywords: + python_keywords = {key for key, val in PYTHON_KEYWORD_TO_JSON_SCHEMA_KEYWORD.items() if val == k} + if not python_keywords: + raise exceptions.ApiValueError( + "Invalid keyword: '{0}''".format(k)) + disabled_json_schema_keywords.add(k) + disabled_json_schema_python_keywords.update(python_keywords) + self.__disabled_json_schema_keywords = disabled_json_schema_keywords + self.__disabled_json_schema_python_keywords = disabled_json_schema_python_keywords + + @classmethod + def set_default(cls, default): + """Set default instance of configuration. + + It stores default configuration, which can be + returned by get_default_copy method. + + :param default: object of Configuration + """ + cls._default = copy.deepcopy(default) + + @classmethod + def get_default_copy(cls): + """Return new instance of configuration. + + This method returns newly created, based on default constructor, + object of Configuration class or returns a copy of default + configuration passed by the set_default method. + + :return: The configuration object. + """ + if cls._default is not None: + return copy.deepcopy(cls._default) + return Configuration() + + @property + def logger_file(self): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + return self.__logger_file + + @logger_file.setter + def logger_file(self, value): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + self.__logger_file = value + if self.__logger_file: + # If set logging file, + # then add file handler and remove stream handler. + self.logger_file_handler = logging.FileHandler(self.__logger_file) + self.logger_file_handler.setFormatter(self.logger_formatter) + for _, logger in self.logger.items(): + logger.addHandler(self.logger_file_handler) + + @property + def debug(self): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + return self.__debug + + @debug.setter + def debug(self, value): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + self.__debug = value + if self.__debug: + # if debug status is True, turn on debug logging + for _, logger in self.logger.items(): + logger.setLevel(logging.DEBUG) + # turn on http_client debug + http_client.HTTPConnection.debuglevel = 1 + else: + # if debug status is False, turn off debug logging, + # setting log level to default `logging.WARNING` + for _, logger in self.logger.items(): + logger.setLevel(logging.WARNING) + # turn off http_client debug + http_client.HTTPConnection.debuglevel = 0 + + @property + def logger_format(self): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + return self.__logger_format + + @logger_format.setter + def logger_format(self, value): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + self.__logger_format = value + self.logger_formatter = logging.Formatter(self.__logger_format) + + def to_debug_report(self): + """Gets the essential information for debugging. + + :return: The report for debugging. + """ + return "Python SDK Debug Report:\n"\ + "OS: {env}\n"\ + "Python Version: {pyversion}\n"\ + "Version of the API: 1.0\n"\ + "SDK Package Version: 1.0.0".\ + format(env=sys.platform, pyversion=sys.version) + + def get_host_settings(self): + """Gets an array of host settings + + :return: An array of host settings + """ + return [ + { + 'url': "http://localhost:3000", + 'description': "No description provided", + } + ] + + def get_host_from_settings( + self, + index: typing.Optional[int], + variables: typing.Optional[typing.Dict[str, dict]] = None, + servers: typing.Optional[typing.List[dict]] = None + ) -> str: + """Gets host URL based on the index and variables + :param index: array index of the host settings + :param variables: hash of variable and the corresponding value + :param servers: an array of host settings or None + :return: URL based on host settings + """ + if index is None: + return self._base_path + + variables = variables or {} + servers = servers or self.get_host_settings() + + try: + server = servers[index] + except IndexError: + raise ValueError( + "Invalid index {0} when selecting the host settings. " + "Must be less than {1}".format(index, len(servers))) + + url = server['url'] + + # go through variables and replace placeholders + for variable_name, variable in server.get('variables', {}).items(): + used_value = variables.get( + variable_name, variable['default_value']) + + if 'enum_values' in variable \ + and used_value not in variable['enum_values']: + raise ValueError( + "The variable `{0}` in the host URL has invalid value " + "{1}. Must be {2}.".format( + variable_name, variables[variable_name], + variable['enum_values'])) + + url = url.replace("{" + variable_name + "}", used_value) + + return url + + @property + def host(self) -> str: + """Return generated host.""" + return self.get_host_from_settings(self.server_index, variables=self.server_variables) + + @host.setter + def host(self, value): + """Fix base path.""" + self._base_path = value + self.server_index = None diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/configurations/__init__.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/configurations/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/configurations/api_configuration.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/configurations/api_configuration.py new file mode 100644 index 00000000000..ea1e58fcf3f --- /dev/null +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/configurations/api_configuration.py @@ -0,0 +1,266 @@ +# coding: utf-8 + +""" + discriminator-test + + No description provided (generated by Openapi JSON Schema Generator https://github.com/openapi-json-schema-tools/openapi-json-schema-generator) # noqa: E501 + + The version of the OpenAPI document: 1.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import copy +from http import client as http_client +import logging +import multiprocessing +import sys +import typing +import typing_extensions + +import urllib3 + +from this_package import exceptions +from this_package.servers import server_0 + +# the server to use at each openapi document json path +ServerInfo = typing_extensions.TypedDict( + 'ServerInfo', + { + 'servers/0': server_0.Server0, + }, + total=False +) + +""" +the default server_index to use at each openapi document json path +the fallback value is stored in the 'servers' key +""" +ServerIndexInfo = typing_extensions.TypedDict( + 'ServerIndexInfo', + { + 'servers': typing_extensions.Literal[0], + }, + total=False +) + + +class ApiConfiguration(object): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator + + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + Do not edit the class manually. + + :param server_info: the servers that can be used to make endpoint calls + :param server_index_info: index to servers configuration + """ + + def __init__( + self, + server_info: typing.Optional[ServerInfo] = None, + server_index_info: typing.Optional[ServerIndexInfo] = None, + ): + """Constructor + """ + # Authentication Settings + self.security_scheme_info: {} + self.security_index_info = {'security': 0} + # Server Info + self.server_info: ServerInfo = server_info or { + 'servers/0': server_0.Server0(), + } + self.server_index_info: ServerIndexInfo = server_index_info or {'servers': 0} + self.logger = {} + """Logging Settings + """ + self.logger["package_logger"] = logging.getLogger("this_package") + self.logger["urllib3_logger"] = logging.getLogger("urllib3") + self.logger_format = '%(asctime)s %(levelname)s %(message)s' + """Log format + """ + self.logger_stream_handler = None + """Log stream handler + """ + self.logger_file_handler = None + """Log file handler + """ + self.logger_file = None + """Debug file location + """ + self.debug = False + """Debug switch + """ + + self.verify_ssl = True + """SSL/TLS verification + Set this to false to skip verifying SSL certificate when calling API + from https server. + """ + self.ssl_ca_cert = None + """Set this to customize the certificate file to verify the peer. + """ + self.cert_file = None + """client certificate file + """ + self.key_file = None + """client key file + """ + self.assert_hostname = None + """Set this to True/False to enable/disable SSL hostname verification. + """ + + self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 + """urllib3 connection pool's maximum number of connections saved + per pool. urllib3 uses 1 connection as default value, but this is + not the best value when you are making a lot of possibly parallel + requests to the same host, which is often the case here. + cpu_count * 5 is used as default value to increase performance. + """ + + self.proxy = None + """Proxy URL + """ + self.proxy_headers = None + """Proxy headers + """ + self.safe_chars_for_path_param = '' + """Safe chars for path_param + """ + self.retries = None + """Adding retries to override urllib3 default value 3 + """ + # Enable client side validation + self.client_side_validation = True + + # Options to pass down to the underlying urllib3 socket + self.socket_options = None + + def __deepcopy__(self, memo): + cls = self.__class__ + result = cls.__new__(cls) + memo[id(self)] = result + for k, v in self.__dict__.items(): + if k not in ('logger', 'logger_file_handler'): + setattr(result, k, copy.deepcopy(v, memo)) + # shallow copy of loggers + result.logger = copy.copy(self.logger) + # use setters to configure loggers + result.logger_file = self.logger_file + result.debug = self.debug + return result + + @property + def logger_file(self): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + return self.__logger_file + + @logger_file.setter + def logger_file(self, value): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + self.__logger_file = value + if self.__logger_file: + # If set logging file, + # then add file handler and remove stream handler. + self.logger_file_handler = logging.FileHandler(self.__logger_file) + self.logger_file_handler.setFormatter(self.logger_formatter) + for _, logger in self.logger.items(): + logger.addHandler(self.logger_file_handler) + + @property + def debug(self): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + return self.__debug + + @debug.setter + def debug(self, value): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + self.__debug = value + if self.__debug: + # if debug status is True, turn on debug logging + for _, logger in self.logger.items(): + logger.setLevel(logging.DEBUG) + # turn on http_client debug + http_client.HTTPConnection.debuglevel = 1 + else: + # if debug status is False, turn off debug logging, + # setting log level to default `logging.WARNING` + for _, logger in self.logger.items(): + logger.setLevel(logging.WARNING) + # turn off http_client debug + http_client.HTTPConnection.debuglevel = 0 + + @property + def logger_format(self): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + return self.__logger_format + + @logger_format.setter + def logger_format(self, value): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + self.__logger_format = value + self.logger_formatter = logging.Formatter(self.__logger_format) + + def to_debug_report(self): + """Gets the essential information for debugging. + + :return: The report for debugging. + """ + return "Python SDK Debug Report:\n"\ + "OS: {env}\n"\ + "Python Version: {pyversion}\n"\ + "Version of the API: 1.0\n"\ + "SDK Package Version: 1.0.0".\ + format(env=sys.platform, pyversion=sys.version) + + def get_server_url( + self, + key_prefix: str, + index: typing.Optional[int], + ) -> str: + """Gets host URL based on the index + :param index: array index of the host settings + :return: URL based on host settings + """ + if index: + used_index = index + else: + try: + used_index = self.server_index_info[key_prefix] + except KeyError: + # fallback and use the default index + used_index = self.server_index_info["servers"] + server = self.server_info[f"{key_prefix}/{used_index}"] + return server.url diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/configurations/schema_configuration.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/configurations/schema_configuration.py new file mode 100644 index 00000000000..b1e734713c5 --- /dev/null +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/configurations/schema_configuration.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + discriminator-test + + No description provided (generated by Openapi JSON Schema Generator https://github.com/openapi-json-schema-tools/openapi-json-schema-generator) # noqa: E501 + + The version of the OpenAPI document: 1.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing + +from this_package import exceptions + + +PYTHON_KEYWORD_TO_JSON_SCHEMA_KEYWORD = { + 'types': 'type', + 'enum_value_to_name': 'enum', + 'unique_items': 'uniqueItems', + 'min_items': 'minItems', + 'max_items': 'maxItems', + 'min_properties': 'minProperties', + 'max_properties': 'maxProperties', + 'min_length': 'minLength', + 'max_length': 'maxLength', + 'inclusive_minimum': 'minimum', + 'exclusive_minimum': 'exclusiveMinimum', + 'inclusive_maximum': 'maximum', + 'exclusive_maximum': 'exclusiveMaximum', + 'multiple_of': 'multipleOf', + 'regex': 'pattern', + 'format': 'format', + 'required': 'required', + 'items': 'items', + 'Items': 'items', + 'Properties': 'properties', + 'additional_properties': 'additionalProperties', + 'additionalProperties': 'additionalProperties', + 'OneOf': 'oneOf', + 'AnyOf': 'anyOf', + 'AllOf': 'allOf', + '_not': 'not', + '_Not': 'not', + 'discriminator': 'discriminator' +} + +class SchemaConfiguration: + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator + + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + Do not edit the class manually. + + :param disabled_json_schema_keywords (set): Set of + JSON schema validation keywords to disable JSON schema structural validation + rules. The following keywords may be specified: multipleOf, maximum, + exclusiveMaximum, minimum, exclusiveMinimum, maxLength, minLength, pattern, + maxItems, minItems. + By default, the validation is performed for data generated locally by the client + and data received from the server, independent of any validation performed by + the server side. If the input data does not satisfy the JSON schema validation + rules specified in the OpenAPI document, an exception is raised. + If disabled_json_schema_keywords is set, structural validation is + disabled. This can be useful to troubleshoot data validation problem, such as + when the OpenAPI document validation rules do not match the actual API data + received by the server. + :param server_index: Index to servers configuration. + """ + + def __init__( + self, + disabled_json_schema_keywords = frozenset(), + ): + """Constructor + """ + self.disabled_json_schema_keywords = disabled_json_schema_keywords + + @property + def disabled_json_schema_keywords(self) -> typing.Set[str]: + return self.__disabled_json_schema_keywords + + @property + def disabled_json_schema_python_keywords(self) -> typing.Set[str]: + return self.__disabled_json_schema_python_keywords + + @disabled_json_schema_keywords.setter + def disabled_json_schema_keywords(self, json_keywords: typing.Set[str]): + disabled_json_schema_keywords = set() + disabled_json_schema_python_keywords = set() + for k in json_keywords: + python_keywords = {key for key, val in PYTHON_KEYWORD_TO_JSON_SCHEMA_KEYWORD.items() if val == k} + if not python_keywords: + raise exceptions.ApiValueError( + "Invalid keyword: '{0}''".format(k)) + disabled_json_schema_keywords.add(k) + disabled_json_schema_python_keywords.update(python_keywords) + self.__disabled_json_schema_keywords = disabled_json_schema_keywords + self.__disabled_json_schema_python_keywords = disabled_json_schema_python_keywords \ No newline at end of file diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/exceptions.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/exceptions.py new file mode 100644 index 00000000000..7da807f68b4 --- /dev/null +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/exceptions.py @@ -0,0 +1,135 @@ +# coding: utf-8 + +""" + discriminator-test + + No description provided (generated by Openapi JSON Schema Generator https://github.com/openapi-json-schema-tools/openapi-json-schema-generator) # noqa: E501 + + The version of the OpenAPI document: 1.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" +import dataclasses +import typing + +from urllib3._collections import HTTPHeaderDict + + +class OpenApiException(Exception): + """The base exception class for all OpenAPIExceptions""" + + +class ApiTypeError(OpenApiException, TypeError): + def __init__(self, msg, path_to_item=None, valid_classes=None, + key_type=None): + """ Raises an exception for TypeErrors + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list): a list of keys an indices to get to the + current_item + None if unset + valid_classes (tuple): the primitive classes that current item + should be an instance of + None if unset + key_type (bool): False if our value is a value in a dict + True if it is a key in a dict + False if our item is an item in a list + None if unset + """ + self.path_to_item = path_to_item + self.valid_classes = valid_classes + self.key_type = key_type + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiTypeError, self).__init__(full_msg) + + +class ApiValueError(OpenApiException, ValueError): + def __init__(self, msg, path_to_item=None): + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list) the path to the exception in the + received_data dict. None if unset + """ + + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiValueError, self).__init__(full_msg) + + +class ApiAttributeError(OpenApiException, AttributeError): + def __init__(self, msg, path_to_item=None): + """ + Raised when an attribute reference or assignment fails. + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiAttributeError, self).__init__(full_msg) + + +class ApiKeyError(OpenApiException, KeyError): + def __init__(self, msg, path_to_item=None): + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiKeyError, self).__init__(full_msg) + + +T = typing.TypeVar("T") + + +@dataclasses.dataclass +class ApiException(OpenApiException, typing.Generic[T]): + status: int + reason: str + api_response: typing.Optional[T] = None + + def __str__(self): + """Custom error messages for exception""" + error_message = "({0})\n"\ + "Reason: {1}\n".format(self.status, self.reason) + if self.api_response: + if self.api_response.response.headers: + error_message += "HTTP response headers: {0}\n".format( + self.api_response.response.headers) + if self.api_response.response.data: + error_message += "HTTP response body: {0}\n".format(self.api_response.response.data) + + return error_message + + +def render_path(path_to_item): + """Returns a string representation of a path""" + result = "" + for pth in path_to_item: + if isinstance(pth, int): + result += "[{0}]".format(pth) + else: + result += "['{0}']".format(pth) + return result diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/paths/__init__.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/paths/__init__.py new file mode 100644 index 00000000000..cd4e1d7d97f --- /dev/null +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/paths/__init__.py @@ -0,0 +1,3 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from this_package.apis import path_to_api diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/paths/operators/__init__.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/paths/operators/__init__.py new file mode 100644 index 00000000000..09e54a65a1f --- /dev/null +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/paths/operators/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from this_package.apis.paths.operators import Operators + +path = "/operators" \ No newline at end of file diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/paths/operators/post/__init__.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/paths/operators/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/paths/operators/post/operation.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/paths/operators/post/operation.py new file mode 100644 index 00000000000..94196579d0d --- /dev/null +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/paths/operators/post/operation.py @@ -0,0 +1,584 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from this_package import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from this_package import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _post_operators( + self, + content_type: typing_extensions.Literal["application/json"] = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _post_operators( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _post_operators( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _post_operators( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _post_operators( + self, + content_type: str = 'application/json', + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + _fields = None + _body = None + if body is not schemas.unset: + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PostOperators(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def post_operators( + self, + content_type: typing_extensions.Literal["application/json"] = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post_operators( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post_operators( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post_operators( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post_operators( + self, + content_type: str = 'application/json', + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_operators( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + content_type: typing_extensions.Literal["application/json"] = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + content_type: str = 'application/json', + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._post_operators( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/paths/operators/post/request_body/__init__.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/paths/operators/post/request_body/__init__.py new file mode 100644 index 00000000000..102b5416994 --- /dev/null +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/paths/operators/post/request_body/__init__.py @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from this_package import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/paths/operators/post/request_body/content/__init__.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/paths/operators/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/paths/operators/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/paths/operators/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/paths/operators/post/request_body/content/application_json/schema.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/paths/operators/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..e454e7e5dc9 --- /dev/null +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/paths/operators/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + discriminator-test + + No description provided (generated by Openapi JSON Schema Generator https://github.com/openapi-json-schema-tools/openapi-json-schema-generator) # noqa: E501 + + The version of the OpenAPI document: 1.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from this_package.components.schema import operator +Schema = operator.Operator diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/paths/operators/post/responses/__init__.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/paths/operators/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/paths/operators/post/responses/response_200/__init__.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/paths/operators/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..3c8134e99d5 --- /dev/null +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/paths/operators/post/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from this_package import api_client +from this_package import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/rest.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/rest.py new file mode 100644 index 00000000000..c2922b118f9 --- /dev/null +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/rest.py @@ -0,0 +1,252 @@ +# coding: utf-8 + +""" + discriminator-test + + No description provided (generated by Openapi JSON Schema Generator https://github.com/openapi-json-schema-tools/openapi-json-schema-generator) # noqa: E501 + + The version of the OpenAPI document: 1.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import logging +import ssl +from urllib.parse import urlencode +import typing + +import certifi +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from this_package.exceptions import ApiException, ApiValueError + + +logger = logging.getLogger(__name__) + + +class RESTClientObject(object): + + def __init__(self, configuration, pools_size=4, maxsize=None): + # urllib3.PoolManager will pass all kw parameters to connectionpool + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 + # maxsize is the number of requests to host that are allowed in parallel # noqa: E501 + # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 + + # cert_reqs + if configuration.verify_ssl: + cert_reqs = ssl.CERT_REQUIRED + else: + cert_reqs = ssl.CERT_NONE + + # ca_certs + if configuration.ssl_ca_cert: + ca_certs = configuration.ssl_ca_cert + else: + # if not set certificate file, use Mozilla's root certificates. + ca_certs = certifi.where() + + addition_pool_args = {} + if configuration.assert_hostname is not None: + addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 + + if configuration.retries is not None: + addition_pool_args['retries'] = configuration.retries + + if configuration.socket_options is not None: + addition_pool_args['socket_options'] = configuration.socket_options + + if maxsize is None: + if configuration.connection_pool_maxsize is not None: + maxsize = configuration.connection_pool_maxsize + else: + maxsize = 4 + + # https pool manager + if configuration.proxy: + self.pool_manager = urllib3.ProxyManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=ca_certs, + cert_file=configuration.cert_file, + key_file=configuration.key_file, + proxy_url=configuration.proxy, + proxy_headers=configuration.proxy_headers, + **addition_pool_args + ) + else: + self.pool_manager = urllib3.PoolManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=ca_certs, + cert_file=configuration.cert_file, + key_file=configuration.key_file, + **addition_pool_args + ) + + def request( + self, + method: str, + url: str, + headers: typing.Optional[HTTPHeaderDict] = None, + fields: typing.Optional[typing.Tuple[typing.Tuple[str, typing.Any], ...]] = None, + body: typing.Optional[typing.Union[str, bytes]] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> urllib3.HTTPResponse: + """Perform requests. + + :param method: http request method + :param url: http request url + :param headers: http request headers + :param body: request body, for other types + :param fields: request parameters for + `application/x-www-form-urlencoded` + or `multipart/form-data` + :param stream: if True, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is False. + :param timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + """ + assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', + 'PATCH', 'OPTIONS'] + + if fields and body: + raise ApiValueError( + "body parameter cannot be used with fields parameter." + ) + + fields = fields or {} + headers = headers or {} + + if timeout: + if isinstance(timeout, (int, float)): # noqa: E501,F821 + timeout = urllib3.Timeout(total=timeout) + elif (isinstance(timeout, tuple) and + len(timeout) == 2): + timeout = urllib3.Timeout(connect=timeout[0], read=timeout[1]) + + try: + # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` + if method in {'POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE'}: + if 'Content-Type' not in headers and body is None: + r = self.pool_manager.request( + method, + url, + preload_content=not stream, + timeout=timeout, + headers=headers + ) + elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 + r = self.pool_manager.request( + method, url, + body=body, + encode_multipart=False, + preload_content=not stream, + timeout=timeout, + headers=headers) + elif headers['Content-Type'] == 'multipart/form-data': + # must del headers['Content-Type'], or the correct + # Content-Type which generated by urllib3 will be + # overwritten. + del headers['Content-Type'] + r = self.pool_manager.request( + method, url, + fields=fields, + encode_multipart=True, + preload_content=not stream, + timeout=timeout, + headers=headers) + # Pass a `string` parameter directly in the body to support + # other content types than Json when `body` argument is + # provided in serialized form + elif isinstance(body, str) or isinstance(body, bytes): + request_body = body + r = self.pool_manager.request( + method, url, + body=request_body, + preload_content=not stream, + timeout=timeout, + headers=headers) + else: + # Cannot generate the request from given parameters + msg = """Cannot prepare a request message for provided + arguments. Please check that your arguments match + declared content type.""" + raise ApiException(status=0, reason=msg) + # For `GET`, `HEAD` + else: + r = self.pool_manager.request(method, url, + preload_content=not stream, + timeout=timeout, + headers=headers) + except urllib3.exceptions.SSLError as e: + msg = "{0}\n{1}".format(type(e).__name__, str(e)) + raise ApiException(status=0, reason=msg) + + if not stream: + # log response body + logger.debug("response body: %s", r.data) + + return r + + def get(self, url, headers=None, stream=False, + timeout=None, fields=None) -> urllib3.HTTPResponse: + return self.request("GET", url, + headers=headers, + stream=stream, + timeout=timeout, + fields=fields) + + def head(self, url, headers=None, stream=False, + timeout=None, fields=None) -> urllib3.HTTPResponse: + return self.request("HEAD", url, + headers=headers, + stream=stream, + timeout=timeout, + fields=fields) + + def options(self, url, headers=None, + body=None, stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: + return self.request("OPTIONS", url, + headers=headers, + stream=stream, + timeout=timeout, + body=body, fields=fields) + + def delete(self, url, headers=None, body=None, + stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: + return self.request("DELETE", url, + headers=headers, + stream=stream, + timeout=timeout, + body=body, fields=fields) + + def post(self, url, headers=None, + body=None, stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: + return self.request("POST", url, + headers=headers, + stream=stream, + timeout=timeout, + body=body, fields=fields) + + def put(self, url, headers=None, + body=None, stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: + return self.request("PUT", url, + headers=headers, + stream=stream, + timeout=timeout, + body=body, fields=fields) + + def patch(self, url, headers=None, + body=None, stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: + return self.request("PATCH", url, + headers=headers, + stream=stream, + timeout=timeout, + body=body, fields=fields) diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/schemas.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/schemas.py new file mode 100644 index 00000000000..0e76ad8bb9e --- /dev/null +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/schemas.py @@ -0,0 +1,2477 @@ +# coding: utf-8 + +""" + discriminator-test + + No description provided (generated by Openapi JSON Schema Generator https://github.com/openapi-json-schema-tools/openapi-json-schema-generator) # noqa: E501 + + The version of the OpenAPI document: 1.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import collections +import datetime +import functools +import decimal +import io +import re +import types +import typing +import uuid + +from dateutil import parser +from dateutil.parser.isoparser import _takes_ascii +import frozendict + +from this_package import exceptions +from this_package.configurations import schema_configuration + + +class Unset(object): + """ + An instance of this class is set as the default value for object type(dict) properties that are optional + When a property has an unset value, that property will not be assigned in the dict + """ + pass + +unset = Unset() + +none_type_ = type(None) + + +class FileIO(io.FileIO): + """ + A class for storing files + Note: this class is not immutable + """ + + def __new__(cls, arg_: typing.Union[io.FileIO, io.BufferedReader]): + if isinstance(arg_, (io.FileIO, io.BufferedReader)): + if arg_.closed: + raise exceptions.ApiValueError('Invalid file state; file is closed and must be open') + arg_.close() + inst = super(FileIO, cls).__new__(cls, arg_.name) + super(FileIO, inst).__init__(arg_.name) + return inst + raise exceptions.ApiValueError('FileIO must be passed arg_ which contains the open file') + + def __init__(self, arg_: typing.Union[io.FileIO, io.BufferedReader]): + pass + + +def update(d: dict, u: dict): + """ + Adds u to d + Where each dict is collections.defaultdict(set) + """ + if not u: + return d + for k, v in u.items(): + if k not in d: + d[k] = v + else: + d[k] = d[k] | v + + +class ValidationMetadata(frozendict.frozendict): + """ + A class storing metadata that is needed to validate OpenApi Schema payloads + """ + def __new__( + cls, + path_to_item: typing.Tuple[typing.Union[str, int], ...], + configuration: schema_configuration.SchemaConfiguration, + seen_classes: typing.FrozenSet[typing.Type] = frozenset(), + validated_path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Type]] = frozendict.frozendict() + ): + """ + Args: + path_to_item: the path to the current data being instantiated. + For {'a': [1]} if the code is handling, 1, then the path is ('args[0]', 'a', 0) + This changes from location to location + configuration: the schema_configuration.SchemaConfiguration instance to use + This is needed because in schema_configuration.SchemaConfiguration: + - one can disable validation checking + This does not change from location to location + seen_classes: when deserializing data that matches multiple schemas, this is used to store + the schemas that have been traversed. This is used to stop processing when a cycle is seen. + This changes from location to location + validated_path_to_schemas: stores the already validated schema classes for a given path location + This does not change from location to location + """ + return super().__new__( + cls, + path_to_item=path_to_item, + configuration=configuration, + seen_classes=seen_classes, + validated_path_to_schemas=validated_path_to_schemas + ) + + def validation_ran_earlier(self, cls: type) -> bool: + validated_schemas = self.validated_path_to_schemas.get(self.path_to_item, set()) + validation_ran_earlier = validated_schemas and cls in validated_schemas + if validation_ran_earlier: + return True + if cls in self.seen_classes: + return True + return False + + @property + def path_to_item(self) -> typing.Tuple[typing.Union[str, int], ...]: + return self['path_to_item'] + + @property + def configuration(self) -> schema_configuration.SchemaConfiguration: + return self['configuration'] + + @property + def seen_classes(self) -> typing.FrozenSet[typing.Type]: + return self['seen_classes'] + + @property + def validated_path_to_schemas(self) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Type]]: + return self['validated_path_to_schemas'] + + +def add_deeper_validated_schemas(validation_metadata: ValidationMetadata, path_to_schemas: dict): + # this is called if validation_ran_earlier and current and deeper locations need to be added + current_path_to_item = validation_metadata.path_to_item + other_path_to_schemas = {} + for path_to_item, schemas in validation_metadata.validated_path_to_schemas.items(): + if len(path_to_item) < len(current_path_to_item): + continue + path_begins_with_current_path = path_to_item[:len(current_path_to_item)] == current_path_to_item + if path_begins_with_current_path: + other_path_to_schemas[path_to_item] = schemas + update(path_to_schemas, other_path_to_schemas) + + +class Singleton: + """ + Enums and singletons are the same + The same instance is returned for a given key of (cls, arg_) + """ + _instances = {} + + def __new__(cls, arg_: typing.Any, **kwargs): + """ + cls base classes: BoolClass, NoneClass, str, decimal.Decimal + The 3rd key is used in the tuple below for a corner case where an enum contains integer 1 + However 1.0 can also be ingested into that enum schema because 1.0 == 1 and + Decimal('1.0') == Decimal('1') + But if we omitted the 3rd value in the key, then Decimal('1.0') would be stored as Decimal('1') + and json serializing that instance would be '1' rather than the expected '1.0' + Adding the 3rd value, the str of arg_ ensures that 1.0 -> Decimal('1.0') which is serialized as 1.0 + """ + key = (cls, arg_, str(arg_)) + if key not in cls._instances: + if isinstance(arg_, (none_type_, bool, BoolClass, NoneClass)): + inst = super().__new__(cls) + cls._instances[key] = inst + else: + cls._instances[key] = super().__new__(cls, arg_) + return cls._instances[key] + + def __repr__(self): + if isinstance(self, NoneClass): + return f'<{self.__class__.__name__}: None>' + elif isinstance(self, BoolClass): + if bool(self): + return f'<{self.__class__.__name__}: True>' + return f'<{self.__class__.__name__}: False>' + return f'<{self.__class__.__name__}: {super().__repr__()}>' + + +class classproperty: + + def __init__(self, fget): + self.fget = fget + + def __get__(self, owner_self, owner_cls): + return self.fget(owner_cls) + + +class NoneClass(Singleton): + @classproperty + def NONE(cls): + return cls(None) + + def __bool__(self) -> bool: + return False + + +class BoolClass(Singleton): + @classproperty + def TRUE(cls): + return cls(True) + + @classproperty + def FALSE(cls): + return cls(False) + + @functools.lru_cache() + def __bool__(self) -> bool: + for key, instance in self._instances.items(): + if self is instance: + return bool(key[1]) + raise ValueError('Unable to find the boolean value of this instance') + + +class SchemaTyped: + types: typing.Optional[typing.Set[typing.Type]] + exclusive_maximum: typing.Union[int, float] + inclusive_maximum: typing.Union[int, float] + exclusive_minimum: typing.Union[int, float] + inclusive_minimum: typing.Union[int, float] + max_items: int + min_items: int + discriminator: typing.Dict[str, typing.Dict[str, typing.Type['Schema']]] + + + class Properties: + # to hold object properties + pass + + additionalProperties: typing.Optional[typing.Type['Schema']] + max_properties: int + min_properties: int + AllOf: typing.List[typing.Type['Schema']] + OneOf: typing.List[typing.Type['Schema']] + AnyOf: typing.List[typing.Type['Schema']] + _not: typing.Type['Schema'] + max_length: int + min_length: int + items: typing.Type['Schema'] + +PathToSchemasType = typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]] + + +def __get_valid_classes_phrase(input_classes): + """Returns a string phrase describing what types are allowed""" + all_classes = list(input_classes) + all_classes = sorted(all_classes, key=lambda cls: cls.__name__) + all_class_names = [cls.__name__ for cls in all_classes] + if len(all_class_names) == 1: + return "is {0}".format(all_class_names[0]) + return "is one of [{0}]".format(", ".join(all_class_names)) + + +def __type_error_message( + var_value=None, var_name=None, valid_classes=None, key_type=None +): + """ + Keyword Args: + var_value (any): the variable which has the type_error + var_name (str): the name of the variable which has the typ error + valid_classes (tuple): the accepted classes for current_item's + value + key_type (bool): False if our value is a value in a dict + True if it is a key in a dict + False if our item is an item in a tuple + """ + key_or_value = "value" + if key_type: + key_or_value = "key" + valid_classes_phrase = __get_valid_classes_phrase(valid_classes) + msg = "Invalid type. Required {1} type {2} and " "passed type was {3}".format( + var_name, + key_or_value, + valid_classes_phrase, + type(var_value).__name__, + ) + return msg + + +def __get_type_error(var_value, path_to_item, valid_classes, key_type=False): + error_msg = __type_error_message( + var_name=path_to_item[-1], + var_value=var_value, + valid_classes=valid_classes, + key_type=key_type, + ) + return exceptions.ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=valid_classes, + key_type=key_type, + ) + + +def validate_types( + arg: typing.Any, + allowed_types: typing.Set[typing.Type], + cls: typing.Type, + validation_metadata: ValidationMetadata, + **kwargs +) -> None: + if type(arg) not in allowed_types: + raise __get_type_error( + arg, + validation_metadata.path_to_item, + allowed_types, + key_type=False, + ) + return None + +def validate_enum( + arg: typing.Any, + enum_value_to_name: typing.Dict[typing.Any, str], + cls: typing.Type, + validation_metadata: ValidationMetadata, + **kwargs +) -> None: + if arg not in enum_value_to_name: + raise exceptions.ApiValueError("Invalid value {} passed in to {}, allowed_values={}".format(arg, cls, enum_value_to_name.keys())) + return None + + +def _raise_validation_error_message(value, constraint_msg, constraint_value, path_to_item, additional_txt=""): + raise exceptions.ApiValueError( + "Invalid value `{value}`, {constraint_msg} `{constraint_value}`{additional_txt} at {path_to_item}".format( + value=value, + constraint_msg=constraint_msg, + constraint_value=constraint_value, + additional_txt=additional_txt, + path_to_item=path_to_item, + ) + ) + + +def validate_unique_items( + arg: typing.Any, + unique_items_value: bool, + cls: typing.Type, + validation_metadata: ValidationMetadata, + **kwargs +) -> None: + if not unique_items_value or not isinstance(arg, tuple): + return None + if len(arg) > len(set(arg)): + _raise_validation_error_message( + value=arg, + constraint_msg="duplicate items were found, and the tuple must not contain duplicates because", + constraint_value='unique_items==True', + path_to_item=validation_metadata.path_to_item + ) + return None + + +def validate_min_items( + arg: typing.Any, + min_items: int, + cls: typing.Type, + validation_metadata: ValidationMetadata, + **kwargs +) -> None: + if not isinstance(arg, tuple): + return None + if len(arg) < min_items: + _raise_validation_error_message( + value=arg, + constraint_msg="number of items must be greater than or equal to", + constraint_value=min_items, + path_to_item=validation_metadata.path_to_item + ) + return None + + +def validate_max_items( + arg: typing.Any, + max_items: int, + cls: typing.Type, + validation_metadata: ValidationMetadata, + **kwargs +) -> None: + if not isinstance(arg, tuple): + return None + if len(arg) > max_items: + _raise_validation_error_message( + value=arg, + constraint_msg="number of items must be less than or equal to", + constraint_value=max_items, + path_to_item=validation_metadata.path_to_item + ) + return None + + +def validate_min_properties( + arg: typing.Any, + min_properties: int, + cls: typing.Type, + validation_metadata: ValidationMetadata, + **kwargs +) -> None: + if not isinstance(arg, frozendict.frozendict): + return None + if len(arg) < min_properties: + _raise_validation_error_message( + value=arg, + constraint_msg="number of properties must be greater than or equal to", + constraint_value=min_properties, + path_to_item=validation_metadata.path_to_item + ) + return None + + +def validate_max_properties( + arg: typing.Any, + max_properties: int, + cls: typing.Type, + validation_metadata: ValidationMetadata, + **kwargs +) -> None: + if not isinstance(arg, frozendict.frozendict): + return None + if len(arg) > max_properties: + _raise_validation_error_message( + value=arg, + constraint_msg="number of properties must be less than or equal to", + constraint_value=max_properties, + path_to_item=validation_metadata.path_to_item + ) + return None + + +def validate_min_length( + arg: typing.Any, + min_length: int, + cls: typing.Type, + validation_metadata: ValidationMetadata, + **kwargs +) -> None: + if not isinstance(arg, str): + return None + if len(arg) < min_length: + _raise_validation_error_message( + value=arg, + constraint_msg="length must be greater than or equal to", + constraint_value=min_length, + path_to_item=validation_metadata.path_to_item + ) + return None + + +def validate_max_length( + arg: typing.Any, + max_length: int, + cls: typing.Type, + validation_metadata: ValidationMetadata, + **kwargs +) -> None: + if not isinstance(arg, str): + return None + if len(arg) > max_length: + _raise_validation_error_message( + value=arg, + constraint_msg="length must be less than or equal to", + constraint_value=max_length, + path_to_item=validation_metadata.path_to_item + ) + return None + + +def validate_inclusive_minimum( + arg: typing.Any, + inclusive_minimum: typing.Union[int, float], + cls: typing.Type, + validation_metadata: ValidationMetadata, + **kwargs +) -> None: + if not isinstance(arg, decimal.Decimal): + return None + if arg < inclusive_minimum: + _raise_validation_error_message( + value=arg, + constraint_msg="must be a value greater than or equal to", + constraint_value=inclusive_minimum, + path_to_item=validation_metadata.path_to_item + ) + return None + + +def validate_exclusive_minimum( + arg: typing.Any, + exclusive_minimum: typing.Union[int, float], + cls: typing.Type, + validation_metadata: ValidationMetadata, + **kwargs +) -> None: + if not isinstance(arg, decimal.Decimal): + return None + if arg <= exclusive_minimum: + _raise_validation_error_message( + value=arg, + constraint_msg="must be a value greater than", + constraint_value=exclusive_minimum, + path_to_item=validation_metadata.path_to_item + ) + return None + + +def validate_inclusive_maximum( + arg: typing.Any, + inclusive_maximum: typing.Union[int, float], + cls: typing.Type, + validation_metadata: ValidationMetadata, + **kwargs +) -> None: + if not isinstance(arg, decimal.Decimal): + return None + if arg > inclusive_maximum: + _raise_validation_error_message( + value=arg, + constraint_msg="must be a value less than or equal to", + constraint_value=inclusive_maximum, + path_to_item=validation_metadata.path_to_item + ) + return None + + +def validate_exclusive_maximum( + arg: typing.Any, + exclusive_maximum: typing.Union[int, float], + cls: typing.Type, + validation_metadata: ValidationMetadata, + **kwargs +) -> None: + if not isinstance(arg, decimal.Decimal): + return None + if arg >= exclusive_maximum: + _raise_validation_error_message( + value=arg, + constraint_msg="must be a value less than", + constraint_value=exclusive_maximum, + path_to_item=validation_metadata.path_to_item + ) + return None + +def validate_multiple_of( + arg: typing.Any, + multiple_of: typing.Union[int, float], + cls: typing.Type, + validation_metadata: ValidationMetadata, + **kwargs +) -> None: + if not isinstance(arg, decimal.Decimal): + return None + if (not (float(arg) / multiple_of).is_integer()): + # Note 'multipleOf' will be as good as the floating point arithmetic. + _raise_validation_error_message( + value=arg, + constraint_msg="value must be a multiple of", + constraint_value=multiple_of, + path_to_item=validation_metadata.path_to_item + ) + return None + + +def validate_regex( + arg: typing.Any, + regex_dict: typing.Dict, + cls: typing.Type, + validation_metadata: ValidationMetadata, + **kwargs +) -> None: + if not isinstance(arg, str): + return None + flags = regex_dict.get('flags', 0) + if not re.search(regex_dict['pattern'], arg, flags=flags): + if flags != 0: + # Don't print the regex flags if the flags are not + # specified in the OAS document. + _raise_validation_error_message( + value=arg, + constraint_msg="must match regular expression", + constraint_value=regex_dict['pattern'], + path_to_item=validation_metadata.path_to_item, + additional_txt=" with flags=`{}`".format(flags) + ) + _raise_validation_error_message( + value=arg, + constraint_msg="must match regular expression", + constraint_value=regex_dict['pattern'], + path_to_item=validation_metadata.path_to_item + ) + return None + + +__int32_inclusive_minimum = decimal.Decimal(-2147483648) +__int32_inclusive_maximum = decimal.Decimal(2147483647) +__int64_inclusive_minimum = decimal.Decimal(-9223372036854775808) +__int64_inclusive_maximum = decimal.Decimal(9223372036854775807) +__float_inclusive_minimum = decimal.Decimal(-3.4028234663852886e+38) +__float_inclusive_maximum = decimal.Decimal(3.4028234663852886e+38) +__double_inclusive_minimum = decimal.Decimal(-1.7976931348623157E+308) +__double_inclusive_maximum = decimal.Decimal(1.7976931348623157E+308) + +def __validate_numeric_format( + arg: decimal.Decimal, + format: str, + validation_metadata: ValidationMetadata +) -> None: + if format[:3] == 'int': + # there is a json schema test where 1.0 validates as an integer + if arg != int(arg): + raise exceptions.ApiValueError( + "Invalid non-integer value '{}' for type {} at {}".format( + arg, format, validation_metadata.path_to_item + ) + ) + if format == 'int32': + if not __int32_inclusive_minimum <= arg <= __int32_inclusive_maximum: + raise exceptions.ApiValueError( + "Invalid value '{}' for type int32 at {}".format(arg, validation_metadata.path_to_item) + ) + return None + elif format == 'int64': + if not __int64_inclusive_minimum <= arg <= __int64_inclusive_maximum: + raise exceptions.ApiValueError( + "Invalid value '{}' for type int64 at {}".format(arg, validation_metadata.path_to_item) + ) + return None + return None + elif format in {'float', 'double'}: + if format == 'float': + if not __float_inclusive_minimum <= arg <= __float_inclusive_maximum: + raise exceptions.ApiValueError( + "Invalid value '{}' for type float at {}".format(arg, validation_metadata.path_to_item) + ) + return None + # double + if not __double_inclusive_minimum <= arg <= __double_inclusive_maximum: + raise exceptions.ApiValueError( + "Invalid value '{}' for type double at {}".format(arg, validation_metadata.path_to_item) + ) + return None + return None + + +class CustomIsoparser(parser.isoparser): + @_takes_ascii + def parse_isodatetime(self, dt_str): + components, pos = self._parse_isodate(dt_str) + if len(dt_str) > pos: + if self._sep is None or dt_str[pos:pos + 1] == self._sep: + components += self._parse_isotime(dt_str[pos + 1:]) + else: + raise ValueError('String contains unknown ISO components') + + if len(components) > 3 and components[3] == 24: + components[3] = 0 + return datetime.datetime(*components) + datetime.timedelta(days=1) + + if len(components) <= 3: + raise ValueError('Value is not a datetime') + + return datetime.datetime(*components) + + @_takes_ascii + def parse_isodate(self, datestr): + components, pos = self._parse_isodate(datestr) + + if len(datestr) > pos: + raise ValueError('String contains invalid time components') + + if len(components) > 3: + raise ValueError('String contains invalid time components') + + return datetime.date(*components) + + +DEFAULT_ISOPARSER = CustomIsoparser() + + +def __validate_string_format( + arg: str, + format: str, + validation_metadata: ValidationMetadata +) -> None: + if format == 'uuid': + try: + uuid.UUID(arg) + return None + except ValueError: + raise exceptions.ApiValueError( + "Invalid value '{}' for type UUID at {}".format(arg, validation_metadata.path_to_item) + ) + elif format == 'number': + try: + decimal.Decimal(arg) + return None + except decimal.InvalidOperation: + raise exceptions.ApiValueError( + "Value cannot be converted to a decimal. " + "Invalid value '{}' for type decimal at {}".format(arg, validation_metadata.path_to_item) + ) + elif format == 'date': + try: + DEFAULT_ISOPARSER.parse_isodate(arg) + return None + except ValueError: + raise exceptions.ApiValueError( + "Value does not conform to the required ISO-8601 date format. " + "Invalid value '{}' for type date at {}".format(arg, validation_metadata.path_to_item) + ) + elif format == 'date-time': + try: + DEFAULT_ISOPARSER.parse_isodatetime(arg) + return None + except ValueError: + raise exceptions.ApiValueError( + "Value does not conform to the required ISO-8601 datetime format. " + "Invalid value '{}' for type datetime at {}".format(arg, validation_metadata.path_to_item) + ) + return None + + +def validate_format( + arg: typing.Any, + format: str, + cls: typing.Type, + validation_metadata: ValidationMetadata, + **kwargs +) -> None: + # formats work for strings + numbers + if isinstance(arg, decimal.Decimal): + return __validate_numeric_format( + arg, + format, + validation_metadata + ) + elif isinstance(arg, str): + return __validate_string_format( + arg, + format, + validation_metadata + ) + return None + + +def validate_required( + arg: typing.Any, + required: typing.Set[str], + cls: typing.Type, + validation_metadata: ValidationMetadata, + **kwargs +) -> None: + if not isinstance(arg, frozendict.frozendict): + return None + missing_required_arguments = required - arg.keys() + if missing_required_arguments: + missing_required_arguments = list(missing_required_arguments) + missing_required_arguments.sort() + raise exceptions.ApiTypeError( + "{} is missing {} required argument{}: {}".format( + cls.__name__, + len(missing_required_arguments), + "s" if len(missing_required_arguments) > 1 else "", + missing_required_arguments + ) + ) + return None + + +def _get_class(item_cls: typing.Union[types.FunctionType, staticmethod, typing.Type['Schema']]) -> typing.Type['Schema']: + if isinstance(item_cls, types.FunctionType): + # referenced schema + return item_cls() + elif isinstance(item_cls, staticmethod): + # referenced schema + return item_cls.__func__() + return item_cls + + +def validate_items( + arg: typing.Any, + item_cls: typing.Type, + cls: typing.Type, + validation_metadata: ValidationMetadata, + **kwargs +) -> PathToSchemasType: + if not isinstance(arg, tuple): + return None + item_cls = _get_class(item_cls) + path_to_schemas = {} + for i, value in enumerate(arg): + item_validation_metadata = ValidationMetadata( + path_to_item=validation_metadata.path_to_item+(i,), + configuration=validation_metadata.configuration, + validated_path_to_schemas=validation_metadata.validated_path_to_schemas + ) + if item_validation_metadata.validation_ran_earlier(item_cls): + add_deeper_validated_schemas(item_validation_metadata, path_to_schemas) + continue + other_path_to_schemas = item_cls._validate( + value, validation_metadata=item_validation_metadata) + update(path_to_schemas, other_path_to_schemas) + return path_to_schemas + + +def validate_properties( + arg: typing.Any, + properties: typing.Type, + cls: typing.Type, + validation_metadata: ValidationMetadata, + **kwargs +) -> typing.Optional[PathToSchemasType]: + if not isinstance(arg, frozendict.frozendict): + return None + path_to_schemas = {} + present_properties = {k: v for k, v, in arg.items() if k in properties.__annotations__} + for property_name, value in present_properties.items(): + path_to_item = validation_metadata.path_to_item + (property_name,) + schema = properties.__annotations__[property_name] + schema = _get_class(schema) + arg_validation_metadata = ValidationMetadata( + path_to_item=path_to_item, + configuration=validation_metadata.configuration, + validated_path_to_schemas=validation_metadata.validated_path_to_schemas + ) + if arg_validation_metadata.validation_ran_earlier(schema): + add_deeper_validated_schemas(arg_validation_metadata, path_to_schemas) + continue + other_path_to_schemas = schema._validate(value, validation_metadata=arg_validation_metadata) + update(path_to_schemas, other_path_to_schemas) + return path_to_schemas + + +def validate_additional_properties( + arg: typing.Any, + additional_properties_schema: typing.Type, + cls: typing.Type, + validation_metadata: ValidationMetadata, + **kwargs +) -> typing.Optional[PathToSchemasType]: + if not isinstance(arg, frozendict.frozendict): + return None + schema = _get_class(additional_properties_schema) + path_to_schemas = {} + properties_annotations = cls.Schema_.Properties.__annotations__ if hasattr(cls.Schema_, 'Properties') else {} + present_additional_properties = {k: v for k, v, in arg.items() if k not in properties_annotations} + for property_name, value in present_additional_properties.items(): + path_to_item = validation_metadata.path_to_item + (property_name,) + arg_validation_metadata = ValidationMetadata( + path_to_item=path_to_item, + configuration=validation_metadata.configuration, + validated_path_to_schemas=validation_metadata.validated_path_to_schemas + ) + if arg_validation_metadata.validation_ran_earlier(schema): + add_deeper_validated_schemas(arg_validation_metadata, path_to_schemas) + continue + other_path_to_schemas = schema._validate(value, validation_metadata=arg_validation_metadata) + update(path_to_schemas, other_path_to_schemas) + return path_to_schemas + + +def validate_one_of( + arg: typing.Any, + one_of_container_cls: typing.Type, + cls: 'Schema', + validation_metadata: ValidationMetadata, + discriminated_cls: typing.Optional['Schema'], + **kwargs +) -> PathToSchemasType: + oneof_classes = [] + path_to_schemas = collections.defaultdict(set) + for one_of_cls in one_of_container_cls.classes: + schema = _get_class(one_of_cls) + if schema in path_to_schemas[validation_metadata.path_to_item]: + oneof_classes.append(schema) + continue + if schema is cls: + """ + optimistically assume that cls schema will pass validation + do not invoke _validate on it because that is recursive + """ + oneof_classes.append(schema) + continue + if validation_metadata.validation_ran_earlier(schema): + oneof_classes.append(schema) + add_deeper_validated_schemas(validation_metadata, path_to_schemas) + continue + try: + path_to_schemas = schema._validate(arg, validation_metadata=validation_metadata) + except (exceptions.ApiValueError, exceptions.ApiTypeError) as ex: + # silence exceptions because the code needs to accumulate oneof_classes + continue + oneof_classes.append(schema) + if not oneof_classes: + if discriminated_cls: + """ + return without exception because code was generated with + nonCompliantUseDiscriminatorIfCompositionFails=true + """ + return {} + raise exceptions.ApiValueError( + "Invalid inputs given to generate an instance of {}. None " + "of the oneOf schemas matched the input data.".format(cls) + ) + elif len(oneof_classes) > 1: + if discriminated_cls: + """ + return without exception because code was generated with + nonCompliantUseDiscriminatorIfCompositionFails=true + """ + return {} + raise exceptions.ApiValueError( + "Invalid inputs given to generate an instance of {}. Multiple " + "oneOf schemas {} matched the inputs, but a max of one is allowed.".format(cls, oneof_classes) + ) + # exactly one class matches + return path_to_schemas + + +def validate_any_of( + arg: typing.Any, + any_of_container_cls: typing.Type, + cls: 'Schema', + validation_metadata: ValidationMetadata, + discriminated_cls: typing.Optional['Schema'], + **kwargs +) -> PathToSchemasType: + anyof_classes = [] + path_to_schemas = collections.defaultdict(set) + for any_of_cls in any_of_container_cls.classes: + schema = _get_class(any_of_cls) + if schema is cls: + """ + optimistically assume that cls schema will pass validation + do not invoke _validate on it because that is recursive + """ + anyof_classes.append(schema) + continue + if validation_metadata.validation_ran_earlier(schema): + anyof_classes.append(schema) + add_deeper_validated_schemas(validation_metadata, path_to_schemas) + continue + + try: + other_path_to_schemas = schema._validate(arg, validation_metadata=validation_metadata) + except (exceptions.ApiValueError, exceptions.ApiTypeError) as ex: + # silence exceptions because the code needs to accumulate anyof_classes + continue + anyof_classes.append(schema) + update(path_to_schemas, other_path_to_schemas) + if not anyof_classes: + if discriminated_cls: + """ + return without exception because code was generated with + nonCompliantUseDiscriminatorIfCompositionFails=true + """ + return {} + raise exceptions.ApiValueError( + "Invalid inputs given to generate an instance of {}. None " + "of the anyOf schemas matched the input data.".format(cls) + ) + return path_to_schemas + + +def validate_all_of( + arg: typing.Any, + all_of_cls: typing.Type, + cls: typing.Type, + validation_metadata: ValidationMetadata, + **kwargs +) -> PathToSchemasType: + path_to_schemas = collections.defaultdict(set) + for allof_cls in all_of_cls.classes: + schema = _get_class(allof_cls) + if schema is cls: + """ + optimistically assume that cls schema will pass validation + do not invoke _validate on it because that is recursive + """ + continue + if validation_metadata.validation_ran_earlier(schema): + add_deeper_validated_schemas(validation_metadata, path_to_schemas) + continue + other_path_to_schemas = schema._validate(arg, validation_metadata=validation_metadata) + update(path_to_schemas, other_path_to_schemas) + return path_to_schemas + + +def validate_not( + arg: typing.Any, + not_cls: typing.Type, + cls: typing.Type, + validation_metadata: ValidationMetadata, + **kwargs +) -> None: + not_schema = _get_class(not_cls) + other_path_to_schemas = None + not_exception = exceptions.ApiValueError( + "Invalid value '{}' was passed in to {}. Value is invalid because it is disallowed by {}".format( + arg, + cls.__name__, + not_schema.__name__, + ) + ) + if validation_metadata.validation_ran_earlier(not_schema): + raise not_exception + + try: + other_path_to_schemas = not_schema._validate(arg, validation_metadata=validation_metadata) + except (exceptions.ApiValueError, exceptions.ApiTypeError): + pass + if other_path_to_schemas: + raise not_exception + return None + + +def __ensure_discriminator_value_present( + disc_property_name: str, + validation_metadata: ValidationMetadata, + arg +): + if disc_property_name not in arg: + # The input data does not contain the discriminator property + raise exceptions.ApiValueError( + "Cannot deserialize input data due to missing discriminator. " + "The discriminator property '{}' is missing at path: {}".format(disc_property_name, validation_metadata.path_to_item) + ) + + +def __get_discriminated_class(cls, disc_property_name: str, disc_payload_value: str): + """ + Used in schemas with discriminators + """ + if not hasattr(cls.Schema_, 'discriminator'): + return None + disc = cls.Schema_.discriminator() + if disc_property_name not in disc: + return None + discriminated_cls = disc[disc_property_name].get(disc_payload_value) + if discriminated_cls is not None: + return discriminated_cls + if not ( + hasattr(cls.Schema_, 'AllOf') or + hasattr(cls.Schema_, 'OneOf') or + hasattr(cls.Schema_, 'AnyOf') + ): + return None + # TODO stop traveling if a cycle is hit + if hasattr(cls.Schema_, 'AllOf'): + for allof_cls in cls.Schema_.AllOf.classes: + allof_cls = _get_class(allof_cls) + discriminated_cls = __get_discriminated_class( + allof_cls, disc_property_name=disc_property_name, disc_payload_value=disc_payload_value) + if discriminated_cls is not None: + return discriminated_cls + if hasattr(cls.Schema_, 'OneOf'): + for oneof_cls in cls.Schema_.OneOf.classes: + oneof_cls = _get_class(oneof_cls) + discriminated_cls = __get_discriminated_class( + oneof_cls, disc_property_name=disc_property_name, disc_payload_value=disc_payload_value) + if discriminated_cls is not None: + return discriminated_cls + if hasattr(cls.Schema_, 'AnyOf'): + for anyof_cls in cls.Schema_.AnyOf.classes: + anyof_cls = _get_class(anyof_cls) + discriminated_cls = __get_discriminated_class( + anyof_cls, disc_property_name=disc_property_name, disc_payload_value=disc_payload_value) + if discriminated_cls is not None: + return discriminated_cls + return None + +def _get_discriminated_class_and_exception( + arg: typing.Any, + cls: 'Schema', + validation_metadata: ValidationMetadata +) -> typing.Tuple[typing.Optional['Schema'], typing.Optional[Exception]]: + if not isinstance(arg, frozendict.frozendict): + return None, None + discriminator = cls.Schema_.discriminator() + disc_prop_name = list(discriminator.keys())[0] + try: + __ensure_discriminator_value_present(disc_prop_name, validation_metadata, arg) + except exceptions.ApiValueError as ex: + return None, ex + return ( + __get_discriminated_class( + cls, disc_property_name=disc_prop_name, disc_payload_value=arg[disc_prop_name] + ), + None + ) + + +def validate_discriminator( + arg: typing.Any, + discriminator_fn: typing.Type, + cls: typing.Type, + validation_metadata: ValidationMetadata, + discriminated_cls: typing.Optional['Schema'], + ensure_discriminator_value_present_exc: typing.Optional[Exception], +) -> typing.Optional[PathToSchemasType]: + if not isinstance(arg, frozendict.frozendict): + return None + discriminator = discriminator_fn.__func__() + disc_prop_name = list(discriminator.keys())[0] + if ensure_discriminator_value_present_exc: + raise ensure_discriminator_value_present_exc + if discriminated_cls is None: + raise exceptions.ApiValueError( + "Invalid discriminator value was passed in to {}.{} Only the values {} are allowed at {}".format( + cls.__name__, + disc_prop_name, + list(discriminator[disc_prop_name].keys()), + validation_metadata.path_to_item + (disc_prop_name,) + ) + ) + if discriminated_cls is cls: + """ + Optimistically assume that cls will pass validation + If the code invoked _validate on cls it would infinitely recurse + """ + return None + if validation_metadata.validation_ran_earlier(discriminated_cls): + path_to_schemas = {} + add_deeper_validated_schemas(validation_metadata, path_to_schemas) + return path_to_schemas + updated_vm = ValidationMetadata( + path_to_item=validation_metadata.path_to_item, + configuration=validation_metadata.configuration, + seen_classes=validation_metadata.seen_classes | frozenset({cls}), + validated_path_to_schemas=validation_metadata.validated_path_to_schemas + ) + return discriminated_cls._validate(arg, validation_metadata=updated_vm) + + +json_schema_keyword_to_validator = { + 'types': validate_types, + 'enum_value_to_name': validate_enum, + 'unique_items': validate_unique_items, + 'min_items': validate_min_items, + 'max_items': validate_max_items, + 'min_properties': validate_min_properties, + 'max_properties': validate_max_properties, + 'min_length': validate_min_length, + 'max_length': validate_max_length, + 'inclusive_minimum': validate_inclusive_minimum, + 'exclusive_minimum': validate_exclusive_minimum, + 'inclusive_maximum': validate_inclusive_maximum, + 'exclusive_maximum': validate_exclusive_maximum, + 'multiple_of': validate_multiple_of, + 'regex': validate_regex, + 'format': validate_format, + 'required': validate_required, + 'items': validate_items, + 'Items': validate_items, + 'Properties': validate_properties, + 'AdditionalProperties': validate_additional_properties, + 'additional_properties': validate_additional_properties, + 'OneOf': validate_one_of, + 'AnyOf': validate_any_of, + 'AllOf': validate_all_of, + '_not': validate_not, + '_Not': validate_not, + 'ModelNot': validate_not, + 'discriminator': validate_discriminator +} + + +class Schema: + """ + the base class of all swagger/openapi schemas/models + """ + __inheritable_primitive_types_set = {decimal.Decimal, str, tuple, frozendict.frozendict, FileIO, bytes, BoolClass, NoneClass} + Schema_: SchemaTyped + __excluded_cls_properties = { + '__module__', + '__dict__', + '__weakref__', + '__doc__', + 'default', # excluded because it has no impact on validation + } + + @classmethod + def _validate( + cls, + arg, + validation_metadata: ValidationMetadata, + ) -> PathToSchemasType: + """ + Schema validate + All keyword validation except for type checking was done in calling stack frames + If those validations passed, the validated classes are collected in path_to_schemas + """ + json_schema_data = { + k: v + for k, v in vars(cls.Schema_).items() + if k not in cls.__excluded_cls_properties + and k + not in validation_metadata.configuration.disabled_json_schema_python_keywords + } + kwargs = {} + if 'discriminator' in json_schema_data: + discriminated_cls, ensure_discriminator_value_present_exc = _get_discriminated_class_and_exception( + arg, + cls, + validation_metadata + ) + kwargs = { + 'discriminated_cls': discriminated_cls, + 'ensure_discriminator_value_present_exc': ensure_discriminator_value_present_exc + } + path_to_schemas = {} + for keyword, val in json_schema_data.items(): + validator = json_schema_keyword_to_validator[keyword] + + other_path_to_schemas = validator( + arg, + val, + cls, + validation_metadata, + **kwargs + ) + if other_path_to_schemas: + update(path_to_schemas, other_path_to_schemas) + + base_class = type(arg) + if validation_metadata.path_to_item not in path_to_schemas: + path_to_schemas[validation_metadata.path_to_item] = set() + path_to_schemas[validation_metadata.path_to_item].add(cls) + path_to_schemas[validation_metadata.path_to_item].add(base_class) + return path_to_schemas + + @staticmethod + def _process_schema_classes( + schema_classes: typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]] + ): + """ + Processes and mutates schema_classes + If a SomeSchema is a subclass of DictSchema then remove DictSchema because it is already included + """ + if len(schema_classes) < 2: + return + if len(schema_classes) > 2 and UnsetAnyTypeSchema in schema_classes: + schema_classes.remove(UnsetAnyTypeSchema) + x_schema = schema_type_classes & schema_classes + if not x_schema: + return + # the only way len == 2 is to have one be AnyTypeSchema + x_schema = x_schema.pop() if len(x_schema) == 1 else AnyTypeSchema + if any(c is not x_schema and issubclass(c, x_schema) for c in schema_classes): + # needed to not have a mro error in get_new_class + schema_classes.remove(x_schema) + + @staticmethod + def __bases_by_type(): + return { + str: (UnsetAnyTypeSchema, str), + decimal.Decimal: (UnsetAnyTypeSchema, decimal.Decimal), + BoolClass: (UnsetAnyTypeSchema, BoolClass), + NoneClass: (UnsetAnyTypeSchema, NoneClass), + tuple: (UnsetAnyTypeSchema, tuple), + frozendict.frozendict: (UnsetAnyTypeSchema, frozendict.frozendict), + bytes: (UnsetAnyTypeSchema, bytes), + FileIO: (UnsetAnyTypeSchema, FileIO), + } + + @classmethod + def __get_new_cls( + cls, + arg, + validation_metadata: ValidationMetadata, + path_to_type: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Type] + ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Type['Schema']]: + """ + Make a new dynamic class and return an instance of that class + We are making an instance of cls, but instead of making cls + make a new class, new_cls + which includes dynamic bases including cls + return an instance of that new class + + Dict property + List Item Assignment Use cases: + 1. value is NOT an instance of the required schema class + the value is validated by _validate + _validate returns a key value pair + where the key is the path to the item, and the value will be the required manufactured class + made out of the matching schemas + 2. value is an instance of the correct schema type + the value is NOT validated by _validate, _validate only checks that the instance is of the correct schema type + for this value, _validate does NOT return an entry for it in _path_to_schemas + and in list/dict _get_items,_get_properties the value will be directly assigned + because value is of the correct type, and validation was run earlier when the instance was created + """ + _path_to_schemas = {} + if validation_metadata.validation_ran_earlier(cls): + add_deeper_validated_schemas(validation_metadata, _path_to_schemas) + else: + other_path_to_schemas = cls._validate(arg, validation_metadata=validation_metadata) + update(_path_to_schemas, other_path_to_schemas) + # loop through it make a new class for each entry + # do not modify the returned result because it is cached and we would be modifying the cached value + path_to_schemas = {} + for path, schema_classes in _path_to_schemas.items(): + """ + Use cases + 1. N number of schema classes + enum + type != bool/None, classes in path_to_schemas: tuple/frozendict.frozendict/str/Decimal/bytes/FileIo + needs Singleton added + 2. N number of schema classes + enum + type == bool/None, classes in path_to_schemas: BoolClass/NoneClass + Singleton already added + 3. N number of schema classes, classes in path_to_schemas: BoolClass/NoneClass/tuple/frozendict.frozendict/str/Decimal/bytes/FileIo + """ + cls._process_schema_classes(schema_classes) + enum_schema = any( + issubclass(this_cls, Schema) and hasattr(this_cls.Schema_, "enum_value_to_name") + for this_cls in schema_classes + ) + inheritable_primitive_type = schema_classes.intersection(cls.__inheritable_primitive_types_set) + chosen_schema_classes = schema_classes - inheritable_primitive_type + suffix = tuple(inheritable_primitive_type) + if enum_schema and suffix[0] not in {NoneClass, BoolClass}: + suffix = (Singleton,) + suffix + + used_classes = tuple(sorted(chosen_schema_classes, key=lambda a_cls: a_cls.__name__)) + suffix + mfg_cls = get_new_class(class_name='DynamicSchema', bases=used_classes) + path_to_schemas[path] = mfg_cls + + """ + For locations that validation did not check + the code still needs to mfg a class to hold those values + All of these classes will be based on UnsetAnyTypeSchema + """ + missing_paths = path_to_type.keys() - path_to_schemas.keys() + for missing_path in missing_paths: + value_type = path_to_type[missing_path] + bases = cls.__bases_by_type()[value_type] + mfg_cls = get_new_class(class_name='DynamicSchema', bases=bases) + path_to_schemas[missing_path] = mfg_cls + + return path_to_schemas + + @classmethod + def _get_new_instance_without_conversion( + cls, + arg: typing.Any, + path_to_item: typing.Tuple[typing.Union[str, int], ...], + path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Type['Schema']] + ): + # We have a Dynamic class and we are making an instance of it + if issubclass(cls, frozendict.frozendict) and issubclass(cls, DictBase): + properties = cls._get_properties(arg, path_to_item, path_to_schemas) + return super(Schema, cls).__new__(cls, properties) + elif issubclass(cls, tuple) and issubclass(cls, ListBase): + items = cls._get_items(arg, path_to_item, path_to_schemas) + return super(Schema, cls).__new__(cls, items) + """ + str = openapi str, datetime.date, and datetime.datetime + decimal.Decimal = openapi int and float + FileIO = openapi binary type and the user inputs a file + bytes = openapi binary type and the user inputs bytes + """ + return super(Schema, cls).__new__(cls, arg) + + @classmethod + def from_openapi_data_( + cls, + arg: typing.Union[ + str, + int, + float, + bool, + None, + dict, + list, + io.FileIO, + io.BufferedReader, + bytes + ], + configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None + ): + """ + Schema from_openapi_data_ + """ + from_server = True + validated_path_to_schemas = {} + path_to_type = {} + arg = cast_to_allowed_types(arg, from_server, validated_path_to_schemas, ('args[0]',), path_to_type) + validation_metadata = ValidationMetadata( + path_to_item=('args[0]',), + configuration=configuration_ or schema_configuration.SchemaConfiguration(), + validated_path_to_schemas=frozendict.frozendict(validated_path_to_schemas) + ) + path_to_schemas = cls.__get_new_cls(arg, validation_metadata, path_to_type) + new_cls = path_to_schemas[validation_metadata.path_to_item] + new_inst = new_cls._get_new_instance_without_conversion( + arg, + validation_metadata.path_to_item, + path_to_schemas + ) + return new_inst + + @staticmethod + def __get_input_dict(*args, **kwargs) -> frozendict.frozendict: + input_dict = {} + if args and isinstance(args[0], (dict, frozendict.frozendict)): + input_dict.update(args[0]) + if kwargs: + input_dict.update(kwargs) + return frozendict.frozendict(input_dict) + + @staticmethod + def __remove_unsets(kwargs): + return {key: val for key, val in kwargs.items() if val is not unset} + + def __new__( + cls, + *args_: typing.Union[ + dict, + frozendict.frozendict, + list, + tuple, + decimal.Decimal, + float, + int, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + bool, + None, + bytes, + io.FileIO, + io.BufferedReader, + 'Schema', ], + configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[ + dict, + frozendict.frozendict, + list, + tuple, + decimal.Decimal, + float, + int, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + bool, + None, + bytes, + io.FileIO, + io.BufferedReader, + 'Schema', Unset + ] + ): + """ + Schema __new__ + + Args: + args_ (int/float/decimal.Decimal/str/list/tuple/dict/frozendict.frozendict/bool/None): the value + kwargs (str, int/float/decimal.Decimal/str/list/tuple/dict/frozendict.frozendict/bool/None): dict values + configuration_: contains the schema_configuration.SchemaConfiguration that enables json schema validation keywords + like minItems, minLength etc + + Note: double underscores are used here because pycharm thinks that these variables + are instance properties if they are named normally :( + """ + __kwargs = cls.__remove_unsets(kwargs) + if not args_ and not __kwargs: + raise TypeError( + 'No input given. args or kwargs must be given.' + ) + if not __kwargs and args_ and not isinstance(args_[0], dict): + __arg = args_[0] + else: + __arg = cls.__get_input_dict(*args_, **__kwargs) + __from_server = False + __validated_path_to_schemas = {} + __path_to_type = {} + __arg = cast_to_allowed_types( + __arg, __from_server, __validated_path_to_schemas, ('args[0]',), __path_to_type) + __validation_metadata = ValidationMetadata( + path_to_item=('args[0]',), + configuration=configuration_ or schema_configuration.SchemaConfiguration(), + validated_path_to_schemas=frozendict.frozendict(__validated_path_to_schemas) + ) + __path_to_schemas = cls.__get_new_cls(__arg, __validation_metadata, __path_to_type) + __new_cls = __path_to_schemas[__validation_metadata.path_to_item] + return __new_cls._get_new_instance_without_conversion( + __arg, + __validation_metadata.path_to_item, + __path_to_schemas + ) + + +""" +import itertools +data_types = ('None', 'FrozenDict', 'Tuple', 'Str', 'Decimal', 'Bool') +type_to_cls = { + 'None': 'NoneClass', + 'FrozenDict': 'frozendict.frozendict', + 'Tuple': 'tuple', + 'Str': 'str', + 'Decimal': 'decimal.Decimal', + 'Bool': 'BoolClass' +} +cls_tuples = [v for v in itertools.combinations(data_types, 5)] +typed_classes = [f"class {''.join(cls_tuple)}Mixin({', '.join(type_to_cls[typ] for typ in cls_tuple)}):\n pass" for cls_tuple in cls_tuples] +for cls in typed_classes: + print(cls) +object_classes = [f"{''.join(cls_tuple)}Mixin = object" for cls_tuple in cls_tuples] +for cls in object_classes: + print(cls) +""" +if typing.TYPE_CHECKING: + # qty 1 + NoneMixin = NoneClass + FrozenDictMixin = frozendict.frozendict + TupleMixin = tuple + StrMixin = str + DecimalMixin = decimal.Decimal + BoolMixin = BoolClass + BytesMixin = bytes + FileMixin = FileIO + # qty 2 + class BinaryMixin(bytes, FileIO): + pass + class NoneFrozenDictMixin(NoneClass, frozendict.frozendict): + pass + class NoneTupleMixin(NoneClass, tuple): + pass + class NoneStrMixin(NoneClass, str): + pass + class NoneDecimalMixin(NoneClass, decimal.Decimal): + pass + class NoneBoolMixin(NoneClass, BoolClass): + pass + class FrozenDictTupleMixin(frozendict.frozendict, tuple): + pass + class FrozenDictStrMixin(frozendict.frozendict, str): + pass + class FrozenDictDecimalMixin(frozendict.frozendict, decimal.Decimal): + pass + class FrozenDictBoolMixin(frozendict.frozendict, BoolClass): + pass + class TupleStrMixin(tuple, str): + pass + class TupleDecimalMixin(tuple, decimal.Decimal): + pass + class TupleBoolMixin(tuple, BoolClass): + pass + class StrDecimalMixin(str, decimal.Decimal): + pass + class StrBoolMixin(str, BoolClass): + pass + class DecimalBoolMixin(decimal.Decimal, BoolClass): + pass + # qty 3 + class NoneFrozenDictTupleMixin(NoneClass, frozendict.frozendict, tuple): + pass + class NoneFrozenDictStrMixin(NoneClass, frozendict.frozendict, str): + pass + class NoneFrozenDictDecimalMixin(NoneClass, frozendict.frozendict, decimal.Decimal): + pass + class NoneFrozenDictBoolMixin(NoneClass, frozendict.frozendict, BoolClass): + pass + class NoneTupleStrMixin(NoneClass, tuple, str): + pass + class NoneTupleDecimalMixin(NoneClass, tuple, decimal.Decimal): + pass + class NoneTupleBoolMixin(NoneClass, tuple, BoolClass): + pass + class NoneStrDecimalMixin(NoneClass, str, decimal.Decimal): + pass + class NoneStrBoolMixin(NoneClass, str, BoolClass): + pass + class NoneDecimalBoolMixin(NoneClass, decimal.Decimal, BoolClass): + pass + class FrozenDictTupleStrMixin(frozendict.frozendict, tuple, str): + pass + class FrozenDictTupleDecimalMixin(frozendict.frozendict, tuple, decimal.Decimal): + pass + class FrozenDictTupleBoolMixin(frozendict.frozendict, tuple, BoolClass): + pass + class FrozenDictStrDecimalMixin(frozendict.frozendict, str, decimal.Decimal): + pass + class FrozenDictStrBoolMixin(frozendict.frozendict, str, BoolClass): + pass + class FrozenDictDecimalBoolMixin(frozendict.frozendict, decimal.Decimal, BoolClass): + pass + class TupleStrDecimalMixin(tuple, str, decimal.Decimal): + pass + class TupleStrBoolMixin(tuple, str, BoolClass): + pass + class TupleDecimalBoolMixin(tuple, decimal.Decimal, BoolClass): + pass + class StrDecimalBoolMixin(str, decimal.Decimal, BoolClass): + pass + # qty 4 + class NoneFrozenDictTupleStrMixin(NoneClass, frozendict.frozendict, tuple, str): + pass + class NoneFrozenDictTupleDecimalMixin(NoneClass, frozendict.frozendict, tuple, decimal.Decimal): + pass + class NoneFrozenDictTupleBoolMixin(NoneClass, frozendict.frozendict, tuple, BoolClass): + pass + class NoneFrozenDictStrDecimalMixin(NoneClass, frozendict.frozendict, str, decimal.Decimal): + pass + class NoneFrozenDictStrBoolMixin(NoneClass, frozendict.frozendict, str, BoolClass): + pass + class NoneFrozenDictDecimalBoolMixin(NoneClass, frozendict.frozendict, decimal.Decimal, BoolClass): + pass + class NoneTupleStrDecimalMixin(NoneClass, tuple, str, decimal.Decimal): + pass + class NoneTupleStrBoolMixin(NoneClass, tuple, str, BoolClass): + pass + class NoneTupleDecimalBoolMixin(NoneClass, tuple, decimal.Decimal, BoolClass): + pass + class NoneStrDecimalBoolMixin(NoneClass, str, decimal.Decimal, BoolClass): + pass + class FrozenDictTupleStrDecimalMixin(frozendict.frozendict, tuple, str, decimal.Decimal): + pass + class FrozenDictTupleStrBoolMixin(frozendict.frozendict, tuple, str, BoolClass): + pass + class FrozenDictTupleDecimalBoolMixin(frozendict.frozendict, tuple, decimal.Decimal, BoolClass): + pass + class FrozenDictStrDecimalBoolMixin(frozendict.frozendict, str, decimal.Decimal, BoolClass): + pass + class TupleStrDecimalBoolMixin(tuple, str, decimal.Decimal, BoolClass): + pass + # qty 5 + class NoneFrozenDictTupleStrDecimalMixin(NoneClass, frozendict.frozendict, tuple, str, decimal.Decimal): + pass + class NoneFrozenDictTupleStrBoolMixin(NoneClass, frozendict.frozendict, tuple, str, BoolClass): + pass + class NoneFrozenDictTupleDecimalBoolMixin(NoneClass, frozendict.frozendict, tuple, decimal.Decimal, BoolClass): + pass + class NoneFrozenDictStrDecimalBoolMixin(NoneClass, frozendict.frozendict, str, decimal.Decimal, BoolClass): + pass + class NoneTupleStrDecimalBoolMixin(NoneClass, tuple, str, decimal.Decimal, BoolClass): + pass + class FrozenDictTupleStrDecimalBoolMixin(frozendict.frozendict, tuple, str, decimal.Decimal, BoolClass): + pass + # qty 6 + class NoneFrozenDictTupleStrDecimalBoolMixin(NoneClass, frozendict.frozendict, tuple, str, decimal.Decimal, BoolClass): + pass + # qty 8 + class NoneFrozenDictTupleStrDecimalBoolFileBytesMixin(NoneClass, frozendict.frozendict, tuple, str, decimal.Decimal, BoolClass, FileIO, bytes): + pass +else: + # qty 1 + class NoneMixin: + pass + class FrozenDictMixin: + pass + class TupleMixin: + pass + class StrMixin: + pass + class DecimalMixin: + pass + class BoolMixin: + pass + class BytesMixin: + pass + class FileMixin: + pass + # qty 2 + class BinaryMixin: + pass + class NoneFrozenDictMixin: + pass + class NoneTupleMixin: + pass + class NoneStrMixin: + pass + class NoneDecimalMixin: + pass + class NoneBoolMixin: + pass + class FrozenDictTupleMixin: + pass + class FrozenDictStrMixin: + pass + class FrozenDictDecimalMixin: + pass + class FrozenDictBoolMixin: + pass + class TupleStrMixin: + pass + class TupleDecimalMixin: + pass + class TupleBoolMixin: + pass + class StrDecimalMixin: + pass + class StrBoolMixin: + pass + class DecimalBoolMixin: + pass + # qty 3 + class NoneFrozenDictTupleMixin: + pass + class NoneFrozenDictStrMixin: + pass + class NoneFrozenDictDecimalMixin: + pass + class NoneFrozenDictBoolMixin: + pass + class NoneTupleStrMixin: + pass + class NoneTupleDecimalMixin: + pass + class NoneTupleBoolMixin: + pass + class NoneStrDecimalMixin: + pass + class NoneStrBoolMixin: + pass + class NoneDecimalBoolMixin: + pass + class FrozenDictTupleStrMixin: + pass + class FrozenDictTupleDecimalMixin: + pass + class FrozenDictTupleBoolMixin: + pass + class FrozenDictStrDecimalMixin: + pass + class FrozenDictStrBoolMixin: + pass + class FrozenDictDecimalBoolMixin: + pass + class TupleStrDecimalMixin: + pass + class TupleStrBoolMixin: + pass + class TupleDecimalBoolMixin: + pass + class StrDecimalBoolMixin: + pass + # qty 4 + class NoneFrozenDictTupleStrMixin: + pass + class NoneFrozenDictTupleDecimalMixin: + pass + class NoneFrozenDictTupleBoolMixin: + pass + class NoneFrozenDictStrDecimalMixin: + pass + class NoneFrozenDictStrBoolMixin: + pass + class NoneFrozenDictDecimalBoolMixin: + pass + class NoneTupleStrDecimalMixin: + pass + class NoneTupleStrBoolMixin: + pass + class NoneTupleDecimalBoolMixin: + pass + class NoneStrDecimalBoolMixin: + pass + class FrozenDictTupleStrDecimalMixin: + pass + class FrozenDictTupleStrBoolMixin: + pass + class FrozenDictTupleDecimalBoolMixin: + pass + class FrozenDictStrDecimalBoolMixin: + pass + class TupleStrDecimalBoolMixin: + pass + # qty 5 + class NoneFrozenDictTupleStrDecimalMixin: + pass + class NoneFrozenDictTupleStrBoolMixin: + pass + class NoneFrozenDictTupleDecimalBoolMixin: + pass + class NoneFrozenDictStrDecimalBoolMixin: + pass + class NoneTupleStrDecimalBoolMixin: + pass + class FrozenDictTupleStrDecimalBoolMixin: + pass + # qty 6 + class NoneFrozenDictTupleStrDecimalBoolMixin: + pass + # qty 8 + class NoneFrozenDictTupleStrDecimalBoolFileBytesMixin: + pass + + +class BoolBase: + def is_true_(self) -> bool: + """ + A replacement for x is True + True if the instance is a BoolClass True Singleton + """ + if not issubclass(self.__class__, BoolClass): + return False + return bool(self) + + def is_false_(self) -> bool: + """ + A replacement for x is False + True if the instance is a BoolClass False Singleton + """ + if not issubclass(self.__class__, BoolClass): + return False + return bool(self) is False + + +class NoneBase: + def is_none_(self) -> bool: + """ + A replacement for x is None + True if the instance is a NoneClass None Singleton + """ + if issubclass(self.__class__, NoneClass): + return True + return False + + +class StrBase: + Schema_: SchemaTyped + + @property + def as_str_(self) -> str: + return self + + @property + def as_date_(self) -> datetime.date: + raise Exception('not implemented') + + @property + def as_datetime_(self) -> datetime.datetime: + raise Exception('not implemented') + + @property + def as_decimal_(self) -> decimal.Decimal: + raise Exception('not implemented') + + @property + def as_uuid_(self) -> uuid.UUID: + raise Exception('not implemented') + + +class UUIDBase: + @property + @functools.lru_cache() + def as_uuid_(self) -> uuid.UUID: + return uuid.UUID(self) + + +class DateBase: + @property + @functools.lru_cache() + def as_date_(self) -> datetime.date: + return DEFAULT_ISOPARSER.parse_isodate(self) + + +class DateTimeBase: + @property + @functools.lru_cache() + def as_datetime_(self) -> datetime.datetime: + return DEFAULT_ISOPARSER.parse_isodatetime(self) + + +class DecimalBase: + """ + A class for storing decimals that are sent over the wire as strings + These schemas must remain based on StrBase rather than NumberBase + because picking base classes must be deterministic + """ + + @property + @functools.lru_cache() + def as_decimal_(self) -> decimal.Decimal: + return decimal.Decimal(self) + + +class NumberBase: + Schema_: SchemaTyped + + @property + def as_int_(self) -> int: + try: + return self._as_int + except AttributeError: + """ + Note: for some numbers like 9.0 they could be represented as an + integer but our code chooses to store them as + >>> Decimal('9.0').as_tuple() + DecimalTuple(sign=0, digits=(9, 0), exponent=-1) + so we can tell that the value came from a float and convert it back to a float + during later serialization + """ + if self.as_tuple().exponent < 0: + # this could be represented as an integer but should be represented as a float + # because that's what it was serialized from + raise exceptions.ApiValueError(f'{self} is not an integer') + self._as_int = int(self) + return self._as_int + + @property + def as_float_(self) -> float: + try: + return self._as_float + except AttributeError: + if self.as_tuple().exponent >= 0: + raise exceptions.ApiValueError(f'{self} is not a float') + self._as_float = float(self) + return self._as_float + + +class ListBase: + Schema_: SchemaTyped + + @classmethod + def _get_items( + cls: 'Schema', + arg: typing.List[typing.Any], + path_to_item: typing.Tuple[typing.Union[str, int], ...], + path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Type['Schema']] + ): + ''' + ListBase _get_items + ''' + cast_items = [] + + for i, value in enumerate(arg): + item_path_to_item = path_to_item + (i,) + item_cls = path_to_schemas[item_path_to_item] + new_value = item_cls._get_new_instance_without_conversion( + value, + item_path_to_item, + path_to_schemas + ) + cast_items.append(new_value) + + return cast_items + + +class DictBase: + @classmethod + def _get_properties( + cls, + arg: typing.Dict[str, typing.Any], + path_to_item: typing.Tuple[typing.Union[str, int], ...], + path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Type['Schema']] + ): + """ + DictBase _get_properties, this is how properties are set + These values already passed validation + """ + dict_items = {} + + for property_name_js, value in arg.items(): + property_path_to_item = path_to_item + (property_name_js,) + property_cls = path_to_schemas[property_path_to_item] + new_value = property_cls._get_new_instance_without_conversion( + value, + property_path_to_item, + path_to_schemas + ) + dict_items[property_name_js] = new_value + + return dict_items + + def __setattr__(self, name: str, value: typing.Any): + if not isinstance(self, FileIO): + raise AttributeError('property setting not supported on immutable instances') + + def __getattr__(self, name: str): + """ + for instance.name access + Properties are only type hinted for required properties + so that hasattr(instance, 'optionalProp') is False when that key is not present + """ + if not isinstance(self, frozendict.frozendict): + return super().__getattr__(name) + if name not in self.__class__.__annotations__: + raise AttributeError(f"{self} has no attribute '{name}'") + try: + value = self[name] + return value + except KeyError as ex: + raise AttributeError(str(ex)) + + def get_item_(self, name: str) -> typing.Union['AnyTypeSchema', Unset]: + # dict_instance[name] accessor + if not isinstance(self, frozendict.frozendict): + raise NotImplementedError() + try: + return super().__getitem__(name) + except KeyError: + return unset + + +def cast_to_allowed_types( + arg: typing.Union[ + dict, + frozendict.frozendict, + list, + tuple, + decimal.Decimal, + float, + int, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + bool, + None, + bytes, + io.FileIO, + io.BufferedReader, + 'Schema', ], + from_server: bool, + validated_path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]], + path_to_item: typing.Tuple[typing.Union[str, int], ...], + path_to_type: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Type] +) -> typing.Union[ + frozendict.frozendict, + tuple, + decimal.Decimal, + str, + bytes, + BoolClass, + NoneClass, + FileIO]: + """ + Casts the input payload arg into the allowed types + The input validated_path_to_schemas is mutated by running this function + + When from_server is False then + - date/datetime is cast to str + - int/float is cast to Decimal + + If a Schema instance is passed in it is converted back to a primitive instance because + One may need to validate that data to the original Schema class AND additional different classes + those additional classes will need to be added to the new manufactured class for that payload + If the code didn't do this and kept the payload as a Schema instance it would fail to validate to other + Schema classes and the code wouldn't be able to mfg a new class that includes all valid schemas + TODO: store the validated schema classes in validation_metadata + + Args: + arg: the payload + from_server: whether this payload came from the server or not + validated_path_to_schemas: a dict that stores the validated classes at any path location in the payload + """ + if isinstance(arg, Schema) and not isinstance(arg, UnsetAnyTypeSchema): + """ + store the already run validations + but omit UnsetAnyTypeSchema instances because they were not validated + """ + schema_classes = set() + for cls in arg.__class__.__bases__: + if cls is Singleton: + # Skip Singleton + continue + schema_classes.add(cls) + validated_path_to_schemas[path_to_item] = schema_classes + + type_error = exceptions.ApiTypeError(f"Invalid type. Required value type is str and passed type was {type(arg)} at {path_to_item}") + if isinstance(arg, str): + path_to_type[path_to_item] = str + return str(arg) + elif isinstance(arg, (dict, frozendict.frozendict)): + path_to_type[path_to_item] = frozendict.frozendict + return frozendict.frozendict( + { + key: cast_to_allowed_types( + val, + from_server, + validated_path_to_schemas, + path_to_item + (key,), + path_to_type, + ) + for key, val in arg.items() + } + ) + elif isinstance(arg, (bool, BoolClass)): + path_to_type[path_to_item] = BoolClass + """ + this check must come before isinstance(arg, (int, float)) + because isinstance(True, int) is True + """ + if arg: + return BoolClass.TRUE + return BoolClass.FALSE + elif isinstance(arg, int): + path_to_type[path_to_item] = decimal.Decimal + return decimal.Decimal(arg) + elif isinstance(arg, float): + path_to_type[path_to_item] = decimal.Decimal + decimal_from_float = decimal.Decimal(arg) + if decimal_from_float.as_integer_ratio()[1] == 1: + # 9.0 -> Decimal('9.0') + # 3.4028234663852886e+38 -> Decimal('340282346638528859811704183484516925440.0') + return decimal.Decimal(str(decimal_from_float)+'.0') + return decimal_from_float + elif isinstance(arg, (tuple, list)): + path_to_type[path_to_item] = tuple + return tuple( + [ + cast_to_allowed_types( + item, + from_server, + validated_path_to_schemas, + path_to_item + (i,), + path_to_type, + ) + for i, item in enumerate(arg) + ] + ) + elif isinstance(arg, (none_type_, NoneClass)): + path_to_type[path_to_item] = NoneClass + return NoneClass.NONE + elif isinstance(arg, (datetime.date, datetime.datetime)): + path_to_type[path_to_item] = str + if not from_server: + return arg.isoformat() + raise type_error + elif isinstance(arg, uuid.UUID): + path_to_type[path_to_item] = str + if not from_server: + return str(arg) + raise type_error + elif isinstance(arg, decimal.Decimal): + path_to_type[path_to_item] = decimal.Decimal + return decimal.Decimal(arg) + elif isinstance(arg, bytes): + path_to_type[path_to_item] = bytes + return bytes(arg) + elif isinstance(arg, (io.FileIO, io.BufferedReader)): + path_to_type[path_to_item] = FileIO + return FileIO(arg) + raise ValueError('Invalid type passed in got input={} type={}'.format(arg, type(arg))) + + +class ListSchema( + ListBase, + Schema, + TupleMixin +): + class Schema_: + types = {tuple} + + @classmethod + def from_openapi_data_(cls, arg: typing.List[typing.Any], configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): + return super().from_openapi_data_(arg, configuration_=configuration_) + + def __new__(cls, arg_: typing.Union[typing.List[typing.Any], typing.Tuple[typing.Any]], **kwargs: schema_configuration.SchemaConfiguration): + return super().__new__(cls, arg_, **kwargs) + + +class NoneSchema( + NoneBase, + Schema, + NoneMixin +): + class Schema_: + types = {NoneClass} + + @classmethod + def from_openapi_data_(cls, arg: None, configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): + return super().from_openapi_data_(arg, configuration_=configuration_) + + def __new__(cls, arg_: None, **kwargs: schema_configuration.SchemaConfiguration): + return super().__new__(cls, arg_, **kwargs) + + +class NumberSchema( + NumberBase, + Schema, + DecimalMixin +): + """ + This is used for type: number with no format + Both integers AND floats are accepted + """ + class Schema_: + types = {decimal.Decimal} + + @classmethod + def from_openapi_data_(cls, arg: typing.Union[int, float], configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): + return super().from_openapi_data_(arg, configuration_=configuration_) + + def __new__(cls, arg_: typing.Union[decimal.Decimal, int, float], **kwargs: schema_configuration.SchemaConfiguration): + return super().__new__(cls, arg_, **kwargs) + + +class IntBase: + @property + def as_int_(self) -> int: + try: + return self._as_int + except AttributeError: + self._as_int = int(self) + return self._as_int + + +class IntSchema(IntBase, NumberSchema): + class Schema_: + types = {decimal.Decimal} + format = 'int' + + @classmethod + def from_openapi_data_(cls, arg: int, configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): + return super().from_openapi_data_(arg, configuration_=configuration_) + + def __new__(cls, arg_: typing.Union[decimal.Decimal, int], **kwargs: schema_configuration.SchemaConfiguration): + return super().__new__(cls, arg_, **kwargs) + + +class Int32Schema( + IntSchema +): + class Schema_: + types = {decimal.Decimal} + format = 'int32' + + +class Int64Schema( + IntSchema +): + class Schema_: + types = {decimal.Decimal} + format = 'int64' + + +class Float32Schema( + NumberSchema +): + class Schema_: + types = {decimal.Decimal} + format = 'float' + + @classmethod + def from_openapi_data_(cls, arg: float, configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): + return super().from_openapi_data_(arg, configuration_=configuration_) + + +class Float64Schema( + NumberSchema +): + class Schema_: + types = {decimal.Decimal} + format = 'double' + + @classmethod + def from_openapi_data_(cls, arg: float, configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): + return super().from_openapi_data_(arg, configuration_=configuration_) + + +class StrSchema( + StrBase, + Schema, + StrMixin +): + """ + date + datetime string types must inherit from this class + That is because one can validate a str payload as both: + - type: string (format unset) + - type: string, format: date + """ + class Schema_: + types = {str} + + @classmethod + def from_openapi_data_(cls, arg: str, configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None) -> 'StrSchema': + return super().from_openapi_data_(arg, configuration_=configuration_) + + def __new__(cls, arg_: typing.Union[str, datetime.date, datetime.datetime, uuid.UUID], **kwargs: schema_configuration.SchemaConfiguration): + return super().__new__(cls, arg_, **kwargs) + + +class UUIDSchema(UUIDBase, StrSchema): + class Schema_: + types = {str} + format = 'uuid' + + def __new__(cls, arg_: typing.Union[str, uuid.UUID], **kwargs: schema_configuration.SchemaConfiguration): + return super().__new__(cls, arg_, **kwargs) + + +class DateSchema(DateBase, StrSchema): + class Schema_: + types = {str} + format = 'date' + + def __new__(cls, arg_: typing.Union[str, datetime.date], **kwargs: schema_configuration.SchemaConfiguration): + return super().__new__(cls, arg_, **kwargs) + + +class DateTimeSchema(DateTimeBase, StrSchema): + class Schema_: + types = {str} + format = 'date-time' + + def __new__(cls, arg_: typing.Union[str, datetime.datetime], **kwargs: schema_configuration.SchemaConfiguration): + return super().__new__(cls, arg_, **kwargs) + + +class DecimalSchema(DecimalBase, StrSchema): + class Schema_: + types = {str} + format = 'number' + + def __new__(cls, arg_: str, **kwargs: schema_configuration.SchemaConfiguration): + """ + Note: Decimals may not be passed in because cast_to_allowed_types is only invoked once for payloads + which can be simple (str) or complex (dicts or lists with nested values) + Because casting is only done once and recursively casts all values prior to validation then for a potential + client side Decimal input if Decimal was accepted as an input in DecimalSchema then one would not know + if one was using it for a StrSchema (where it should be cast to str) or one is using it for NumberSchema + where it should stay as Decimal. + """ + return super().__new__(cls, arg_, **kwargs) + + +class BytesSchema( + Schema, + BytesMixin +): + """ + this class will subclass bytes and is immutable + """ + class Schema_: + types = {bytes} + + def __new__(cls, arg_: bytes, **kwargs: schema_configuration.SchemaConfiguration): + return super(Schema, cls).__new__(cls, arg_) + + +class FileSchema( + Schema, + FileMixin +): + """ + This class is NOT immutable + Dynamic classes are built using it for example when AnyType allows in binary data + Al other schema classes ARE immutable + If one wanted to make this immutable one could make this a DictSchema with required properties: + - data = BytesSchema (which would be an immutable bytes based schema) + - file_name = StrSchema + and cast_to_allowed_types would convert bytes and file instances into dicts containing data + file_name + The downside would be that data would be stored in memory which one may not want to do for very large files + + The developer is responsible for closing this file and deleting it + + This class was kept as mutable: + - to allow file reading and writing to disk + - to be able to preserve file name info + """ + class Schema_: + types = {FileIO} + + def __new__(cls, arg_: typing.Union[io.FileIO, io.BufferedReader], **kwargs: schema_configuration.SchemaConfiguration): + return super(Schema, cls).__new__(cls, arg_) + + +class BinarySchema( + Schema, + BinaryMixin +): + class Schema_: + types = {FileIO, bytes} + format = 'binary' + + class OneOf: + classes = [ + BytesSchema, + FileSchema, + ] + + def __new__(cls, arg_: typing.Union[io.FileIO, io.BufferedReader, bytes], **kwargs: schema_configuration.SchemaConfiguration): + return super().__new__(cls, arg_) + + +class BoolSchema( + BoolBase, + Schema, + BoolMixin +): + class Schema_: + types = {BoolClass} + + @classmethod + def from_openapi_data_(cls, arg: bool, configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): + return super().from_openapi_data_(arg, configuration_=configuration_) + + def __new__(cls, arg_: bool, **kwargs: ValidationMetadata): + return super().__new__(cls, arg_, **kwargs) + + +class AnyTypeSchema( + NoneBase, + DictBase, + ListBase, + StrBase, + NumberBase, + BoolBase, + Schema, + NoneFrozenDictTupleStrDecimalBoolFileBytesMixin +): + # Python representation of a schema defined as true or {} + class Schema_: + pass + + +class UnsetAnyTypeSchema(AnyTypeSchema): + # Used when additionalProperties/items was not explicitly defined and a defining schema is needed + pass + + +class NotAnyTypeSchema(AnyTypeSchema): + """ + Python representation of a schema defined as false or {'not': {}} + Does not allow inputs in of AnyType + Note: validations on this class are never run because the code knows that no inputs will ever validate + """ + + class Schema_: + _not = AnyTypeSchema + + def __new__( + cls, + *args_, + configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None, + ) -> 'NotAnyTypeSchema': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + ) + + +class DictSchema( + DictBase, + Schema, + FrozenDictMixin +): + class Schema_: + types = {frozendict.frozendict} + + @classmethod + def from_openapi_data_(cls, arg: typing.Dict[str, typing.Any], configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): + return super().from_openapi_data_(arg, configuration_=configuration_) + + def __new__(cls, *args_: typing.Union[dict, frozendict.frozendict], **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, bool, None, bytes, Schema, Unset, ValidationMetadata]): + return super().__new__(cls, *args_, **kwargs) + + +schema_type_classes = {NoneSchema, DictSchema, ListSchema, NumberSchema, StrSchema, BoolSchema, AnyTypeSchema} + + +@functools.lru_cache() +def get_new_class( + class_name: str, + bases: typing.Tuple[typing.Type[typing.Union[Schema, typing.Any]], ...] +) -> typing.Type[Schema]: + """ + Returns a new class that is made with the subclass bases + """ + new_cls: typing.Type[Schema] = type(class_name, bases, {}) + return new_cls + + +LOG_CACHE_USAGE = False + + +def log_cache_usage(cache_fn): + if LOG_CACHE_USAGE: + print(cache_fn.__name__, cache_fn.cache_info()) diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/security_schemes.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/security_schemes.py new file mode 100644 index 00000000000..a0b966a1260 --- /dev/null +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/security_schemes.py @@ -0,0 +1,221 @@ +# coding: utf-8 +""" + discriminator-test + + No description provided (generated by Openapi JSON Schema Generator https://github.com/openapi-json-schema-tools/openapi-json-schema-generator) # noqa: E501 + + The version of the OpenAPI document: 1.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import abc +import base64 +import dataclasses +import enum +import typing +import typing_extensions + +from urllib3 import _collections + + +class SecuritySchemeType(enum.Enum): + API_KEY = 'apiKey' + HTTP = 'http' + MUTUAL_TLS = 'mutualTLS' + OAUTH_2 = 'oauth2' + OPENID_CONNECT = 'openIdConnect' + + +class ApiKeyInLocation(enum.Enum): + QUERY = 'query' + HEADER = 'header' + COOKIE = 'cookie' + + +class __SecuritySchemeBase(metaclass=abc.ABCMeta): + @abc.abstractmethod + def apply_auth( + self, + headers: _collections.HTTPHeaderDict, + resource_path: str, + method: str, + body: typing.Optional[typing.Union[str, bytes]], + scope_names: typing.Tuple[str] = (), + ) -> None: + pass + + +@dataclasses.dataclass +class ApiKeySecurityScheme(__SecuritySchemeBase, abc.ABC): + api_key: str # this must be set by the developer + name: str = '' + in_location: ApiKeyInLocation = ApiKeyInLocation.QUERY + type: SecuritySchemeType = SecuritySchemeType.API_KEY + + def apply_auth( + self, + headers: _collections.HTTPHeaderDict, + resource_path: str, + method: str, + body: typing.Optional[typing.Union[str, bytes]], + scope_names: typing.Tuple[str] = (), + ) -> None: + if self.in_location is ApiKeyInLocation.COOKIE: + headers.add('Cookie', self.api_key) + elif self.in_location is ApiKeyInLocation.HEADER: + headers.add(self.name, self.api_key) + elif self.in_location is ApiKeyInLocation.QUERY: + # todo add query handling + raise NotImplementedError("ApiKeySecurityScheme in query not yet implemented") + return + + +class HTTPSchemeType(enum.Enum): + BASIC = 'basic' + BEARER = 'bearer' + DIGEST = 'digest' + SIGNATURE = 'signature' # https://datatracker.ietf.org/doc/draft-cavage-http-signatures/ + + +@dataclasses.dataclass +class HTTPBasicSecurityScheme(__SecuritySchemeBase): + user_id: str # user name + password: str + scheme: HTTPSchemeType = HTTPSchemeType.BASIC + encoding: str = 'utf-8' + type: SecuritySchemeType = SecuritySchemeType.HTTP + """ + https://www.rfc-editor.org/rfc/rfc7617.html + """ + + def apply_auth( + self, + headers: _collections.HTTPHeaderDict, + resource_path: str, + method: str, + body: typing.Optional[typing.Union[str, bytes]], + scope_names: typing.Tuple[str] = (), + ) -> None: + user_pass = f"{self.user_id}:{self.password}" + b64_user_pass = base64.b64encode(user_pass.encode(encoding=self.encoding)) + headers.add('Authorization', f"Basic {b64_user_pass.decode()}") + + +@dataclasses.dataclass +class HTTPBearerSecurityScheme(__SecuritySchemeBase): + access_token: str + bearer_format: typing.Optional[str] = None + scheme: HTTPSchemeType = HTTPSchemeType.BEARER + type: SecuritySchemeType = SecuritySchemeType.HTTP + + def apply_auth( + self, + headers: _collections.HTTPHeaderDict, + resource_path: str, + method: str, + body: typing.Optional[typing.Union[str, bytes]], + scope_names: typing.Tuple[str] = (), + ) -> None: + headers.add('Authorization', f"Bearer {self.access_token}") + + +@dataclasses.dataclass +class HTTPDigestSecurityScheme(__SecuritySchemeBase): + scheme: HTTPSchemeType = HTTPSchemeType.DIGEST + type: SecuritySchemeType = SecuritySchemeType.HTTP + + def apply_auth( + self, + headers: _collections.HTTPHeaderDict, + resource_path: str, + method: str, + body: typing.Optional[typing.Union[str, bytes]], + scope_names: typing.Tuple[str] = (), + ) -> None: + raise NotImplementedError("HTTPDigestSecurityScheme not yet implemented") + + +@dataclasses.dataclass +class MutualTLSSecurityScheme(__SecuritySchemeBase): + type: SecuritySchemeType = SecuritySchemeType.MUTUAL_TLS + + def apply_auth( + self, + headers: _collections.HTTPHeaderDict, + resource_path: str, + method: str, + body: typing.Optional[typing.Union[str, bytes]], + scope_names: typing.Tuple[str] = (), + ) -> None: + raise NotImplementedError("MutualTLSSecurityScheme not yet implemented") + + +@dataclasses.dataclass +class ImplicitOAuthFlow: + authorization_url: str + scopes: typing.Dict[str, str] + refresh_url: typing.Optional[str] = None + + +@dataclasses.dataclass +class TokenUrlOauthFlow: + token_url: str + scopes: typing.Dict[str, str] + refresh_url: typing.Optional[str] = None + + +@dataclasses.dataclass +class AuthorizationCodeOauthFlow: + authorization_url: str + token_url: str + scopes: typing.Dict[str, str] + refresh_url: typing.Optional[str] = None + + +@dataclasses.dataclass +class OAuthFlows: + implicit: typing.Optional[ImplicitOAuthFlow] = None + password: typing.Optional[TokenUrlOauthFlow] = None + client_credentials: typing.Optional[TokenUrlOauthFlow] = None + authorization_code: typing.Optional[AuthorizationCodeOauthFlow] = None + + +class OAuth2SecurityScheme(__SecuritySchemeBase, abc.ABC): + flows: OAuthFlows + type: SecuritySchemeType = SecuritySchemeType.OAUTH_2 + + def apply_auth( + self, + headers: _collections.HTTPHeaderDict, + resource_path: str, + method: str, + body: typing.Optional[typing.Union[str, bytes]], + scope_names: typing.Tuple[str] = (), + ) -> None: + raise NotImplementedError("OAuth2SecurityScheme not yet implemented") + + +class OpenIdConnectSecurityScheme(__SecuritySchemeBase, abc.ABC): + openid_connect_url: str + type: SecuritySchemeType = SecuritySchemeType.OPENID_CONNECT + + def apply_auth( + self, + headers: _collections.HTTPHeaderDict, + resource_path: str, + method: str, + body: typing.Optional[typing.Union[str, bytes]], + scope_names: typing.Tuple[str] = (), + ) -> None: + raise NotImplementedError("OpenIdConnectSecurityScheme not yet implemented") + +""" +Key is the Security scheme class +Value is the list of scopes +""" +SecurityRequirementObject = typing_extensions.TypedDict( + 'SecurityRequirementObject', + { + }, + total=False +) \ No newline at end of file diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/server.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/server.py new file mode 100644 index 00000000000..274f468d38f --- /dev/null +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/server.py @@ -0,0 +1,37 @@ +# coding: utf-8 +""" + discriminator-test + + No description provided (generated by Openapi JSON Schema Generator https://github.com/openapi-json-schema-tools/openapi-json-schema-generator) # noqa: E501 + + The version of the OpenAPI document: 1.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import abc +import dataclasses +import typing + + +@dataclasses.dataclass +class Server(abc.ABC): + _url: str + variables: typing.Optional[typing.Dict[str, str]] = None + variable_schemas: typing.Optional[typing.Dict[str, typing.Type['schemas.Schema']]] = None + url: str = dataclasses.field(init=False) + + def __post_init__(self): + if not self.variable_schemas: + self.url = self._url + return + url = self._url + for (key, schema) in self.variable_schemas.items(): + if self.variables and key in self.variables: + value = self.variables[key] + cast_value = schema(value) + else: + cast_value = schema.Schema_.default + url = url.replace("{" + key + "}", cast_value) + self.url = url + +from this_package import schemas diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/servers/__init__.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/servers/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/servers/server_0.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/servers/server_0.py new file mode 100644 index 00000000000..0c8638e3989 --- /dev/null +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/servers/server_0.py @@ -0,0 +1,16 @@ +# coding: utf-8 +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import typing + +from this_package import server + + +@dataclasses.dataclass +class Server0(server.Server): + _url: str = "http://localhost:3000" diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/test-requirements.txt b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/test-requirements.txt index 2d88b034192..3043888202a 100644 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/test-requirements.txt +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/test-requirements.txt @@ -1,3 +1,2 @@ -pytest~=4.6.7 # needed for python 3.4 -pytest-cov>=2.8.1 -pytest-randomly==1.2.3 # needed for python 3.4 +pytest ~= 7.2.0 +pytest-cov ~= 4.0.0 diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/test/components/__init__.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/test/components/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/test/components/schema/__init__.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/test/components/schema/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/test/components/schema/test_addition_operator.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/test/components/schema/test_addition_operator.py new file mode 100644 index 00000000000..925257584bc --- /dev/null +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/test/components/schema/test_addition_operator.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + discriminator-test + + No description provided (generated by Openapi Generator https://github.com/openapi-json-schema-tools/openapi-json-schema-generator) # noqa: E501 + + The version of the OpenAPI document: 1.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import this_package +from this_package.components.schema.addition_operator import AdditionOperator +from this_package import configuration + + +class TestAdditionOperator(unittest.TestCase): + """AdditionOperator unit test stubs""" + configuration_ = configuration.Configuration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/test/components/schema/test_operator.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/test/components/schema/test_operator.py new file mode 100644 index 00000000000..9524e4dd660 --- /dev/null +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/test/components/schema/test_operator.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + discriminator-test + + No description provided (generated by Openapi Generator https://github.com/openapi-json-schema-tools/openapi-json-schema-generator) # noqa: E501 + + The version of the OpenAPI document: 1.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import this_package +from this_package.components.schema.operator import Operator +from this_package import configuration + + +class TestOperator(unittest.TestCase): + """Operator unit test stubs""" + configuration_ = configuration.Configuration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/test/components/schema/test_subtraction_operator.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/test/components/schema/test_subtraction_operator.py new file mode 100644 index 00000000000..bd550349e0e --- /dev/null +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/test/components/schema/test_subtraction_operator.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + discriminator-test + + No description provided (generated by Openapi Generator https://github.com/openapi-json-schema-tools/openapi-json-schema-generator) # noqa: E501 + + The version of the OpenAPI document: 1.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import this_package +from this_package.components.schema.subtraction_operator import SubtractionOperator +from this_package import configuration + + +class TestSubtractionOperator(unittest.TestCase): + """SubtractionOperator unit test stubs""" + configuration_ = configuration.Configuration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/test/test_models/test_addition_operator.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/test/test_models/test_addition_operator.py deleted file mode 100644 index 2c185a95d97..00000000000 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/test/test_models/test_addition_operator.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - discriminator-test - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 - - The version of the OpenAPI document: 1.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import this_package -from this_package.model.addition_operator import AdditionOperator -from this_package import configuration - - -class TestAdditionOperator(unittest.TestCase): - """AdditionOperator unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/test/test_models/test_operator.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/test/test_models/test_operator.py deleted file mode 100644 index d61fa39d124..00000000000 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/test/test_models/test_operator.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - discriminator-test - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 - - The version of the OpenAPI document: 1.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import this_package -from this_package.model.operator import Operator -from this_package import configuration - - -class TestOperator(unittest.TestCase): - """Operator unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/test/test_models/test_subtraction_operator.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/test/test_models/test_subtraction_operator.py deleted file mode 100644 index 1e1979b9d8b..00000000000 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/test/test_models/test_subtraction_operator.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - discriminator-test - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 - - The version of the OpenAPI document: 1.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import this_package -from this_package.model.subtraction_operator import SubtractionOperator -from this_package import configuration - - -class TestSubtractionOperator(unittest.TestCase): - """SubtractionOperator unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/test/test_paths/__init__.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/test/test_paths/__init__.py index 1309632d3d5..bcc864a1738 100644 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/test/test_paths/__init__.py +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/test/test_paths/__init__.py @@ -7,7 +7,7 @@ class ApiTestMixin: json_content_type = 'application/json' - user_agent = 'OpenAPI-Generator/1.0.0/python' + user_agent = 'OpenAPI-JSON-Schema-Generator/1.0.0/python' @classmethod def assert_pool_manager_request_called_with( diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/test/test_paths/test_operators/test_post.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/test/test_paths/test_operators/test_post.py index 52f2f839ad4..0ffc30ce3a8 100644 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/test/test_paths/test_operators/test_post.py +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/test/test_paths/test_operators/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,28 +12,24 @@ import urllib3 import this_package -from this_package.paths.operators import post # noqa: E501 -from this_package import configuration, schemas, api_client +from this_package.paths.operators.post import operation as post # noqa: E501 +from this_package import schemas, api_client +from this_package.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestOperators(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - Operators unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/test_manual/test_operator.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/test_manual/test_operator.py index 4e72fa00b3b..b6084f2d402 100644 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/test_manual/test_operator.py +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/test_manual/test_operator.py @@ -3,23 +3,21 @@ """ discriminator-test - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + No description provided (generated by Openapi Generator https://github.com/openapi-json-schema-tools/openapi-json-schema-generator) # noqa: E501 The version of the OpenAPI document: 1.0 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest -from this_package.model.operator import Operator -from this_package.model.addition_operator import AdditionOperator -from this_package.model.subtraction_operator import SubtractionOperator -from this_package import configuration +from this_package.components.schema.operator import Operator +from this_package.components.schema.addition_operator import AdditionOperator +from this_package.components.schema.subtraction_operator import SubtractionOperator class TestOperator(unittest.TestCase): """Operator unit test stubs""" - _configuration = configuration.Configuration() def test_discriminator_works(self): op = Operator( diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/test_python.sh b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/test_python.sh index 9728a9b5316..f170f03a6e2 100755 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/test_python.sh +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/test_python.sh @@ -1,7 +1,5 @@ #!/bin/bash -REQUIREMENTS_FILE=dev-requirements.txt -REQUIREMENTS_OUT=dev-requirements.txt.log SETUP_OUT=*.egg-info VENV=venv DEACTIVE=false @@ -17,9 +15,9 @@ if [ -z "$VENVV" ]; then fi ### install dependencies -pip install -r $REQUIREMENTS_FILE | tee -a $REQUIREMENTS_OUT +pip install tox ### locally install the package, needed for pycharm problem checking -pip install -e . +python -m pip install . ### run tests tox || exit 1 diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/__init__.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/__init__.py deleted file mode 100644 index fac77d1d052..00000000000 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/__init__.py +++ /dev/null @@ -1,28 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -""" - discriminator-test - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 - - The version of the OpenAPI document: 1.0 - Generated by: https://openapi-generator.tech -""" - -__version__ = "1.0.0" - -# import ApiClient -from this_package.api_client import ApiClient - -# import Configuration -from this_package.configuration import Configuration - -# import exceptions -from this_package.exceptions import OpenApiException -from this_package.exceptions import ApiAttributeError -from this_package.exceptions import ApiTypeError -from this_package.exceptions import ApiValueError -from this_package.exceptions import ApiKeyError -from this_package.exceptions import ApiException diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/api_client.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/api_client.py deleted file mode 100644 index 78c0bf93dfb..00000000000 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/api_client.py +++ /dev/null @@ -1,1499 +0,0 @@ -# coding: utf-8 -""" - discriminator-test - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 - - The version of the OpenAPI document: 1.0 - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -from decimal import Decimal -import enum -import email -import json -import os -import io -import atexit -from multiprocessing.pool import ThreadPool -import re -import tempfile -import typing -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict -from urllib.parse import urlparse, quote -from urllib3.fields import RequestField as RequestFieldBase - -import frozendict - -from this_package import rest -from this_package.configuration import Configuration -from this_package.exceptions import ApiTypeError, ApiValueError -from this_package.schemas import ( - NoneClass, - BoolClass, - Schema, - FileIO, - BinarySchema, - date, - datetime, - none_type, - Unset, - unset, -) - - -class RequestField(RequestFieldBase): - def __eq__(self, other): - if not isinstance(other, RequestField): - return False - return self.__dict__ == other.__dict__ - - -class JSONEncoder(json.JSONEncoder): - compact_separators = (',', ':') - - def default(self, obj): - if isinstance(obj, str): - return str(obj) - elif isinstance(obj, float): - return float(obj) - elif isinstance(obj, int): - return int(obj) - elif isinstance(obj, Decimal): - if obj.as_tuple().exponent >= 0: - return int(obj) - return float(obj) - elif isinstance(obj, NoneClass): - return None - elif isinstance(obj, BoolClass): - return bool(obj) - elif isinstance(obj, (dict, frozendict.frozendict)): - return {key: self.default(val) for key, val in obj.items()} - elif isinstance(obj, (list, tuple)): - return [self.default(item) for item in obj] - raise ApiValueError('Unable to prepare type {} for serialization'.format(obj.__class__.__name__)) - - -class ParameterInType(enum.Enum): - QUERY = 'query' - HEADER = 'header' - PATH = 'path' - COOKIE = 'cookie' - - -class ParameterStyle(enum.Enum): - MATRIX = 'matrix' - LABEL = 'label' - FORM = 'form' - SIMPLE = 'simple' - SPACE_DELIMITED = 'spaceDelimited' - PIPE_DELIMITED = 'pipeDelimited' - DEEP_OBJECT = 'deepObject' - - -class PrefixSeparatorIterator: - # A class to store prefixes and separators for rfc6570 expansions - - def __init__(self, prefix: str, separator: str): - self.prefix = prefix - self.separator = separator - self.first = True - if separator in {'.', '|', '%20'}: - item_separator = separator - else: - item_separator = ',' - self.item_separator = item_separator - - def __iter__(self): - return self - - def __next__(self): - if self.first: - self.first = False - return self.prefix - return self.separator - - -class ParameterSerializerBase: - @classmethod - def _get_default_explode(cls, style: ParameterStyle) -> bool: - return False - - @staticmethod - def __ref6570_item_value(in_data: typing.Any, percent_encode: bool): - """ - Get representation if str/float/int/None/items in list/ values in dict - None is returned if an item is undefined, use cases are value= - - None - - [] - - {} - - [None, None None] - - {'a': None, 'b': None} - """ - if type(in_data) in {str, float, int}: - if percent_encode: - return quote(str(in_data)) - return str(in_data) - elif isinstance(in_data, none_type): - # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 - return None - elif isinstance(in_data, list) and not in_data: - # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 - return None - elif isinstance(in_data, dict) and not in_data: - # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 - return None - raise ApiValueError('Unable to generate a ref6570 item representation of {}'.format(in_data)) - - @staticmethod - def _to_dict(name: str, value: str): - return {name: value} - - @classmethod - def __ref6570_str_float_int_expansion( - cls, - variable_name: str, - in_data: typing.Any, - explode: bool, - percent_encode: bool, - prefix_separator_iterator: PrefixSeparatorIterator, - var_name_piece: str, - named_parameter_expansion: bool - ) -> str: - item_value = cls.__ref6570_item_value(in_data, percent_encode) - if item_value is None or (item_value == '' and prefix_separator_iterator.separator == ';'): - return next(prefix_separator_iterator) + var_name_piece - value_pair_equals = '=' if named_parameter_expansion else '' - return next(prefix_separator_iterator) + var_name_piece + value_pair_equals + item_value - - @classmethod - def __ref6570_list_expansion( - cls, - variable_name: str, - in_data: typing.Any, - explode: bool, - percent_encode: bool, - prefix_separator_iterator: PrefixSeparatorIterator, - var_name_piece: str, - named_parameter_expansion: bool - ) -> str: - item_values = [cls.__ref6570_item_value(v, percent_encode) for v in in_data] - item_values = [v for v in item_values if v is not None] - if not item_values: - # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 - return "" - value_pair_equals = '=' if named_parameter_expansion else '' - if not explode: - return ( - next(prefix_separator_iterator) + - var_name_piece + - value_pair_equals + - prefix_separator_iterator.item_separator.join(item_values) - ) - # exploded - return next(prefix_separator_iterator) + next(prefix_separator_iterator).join( - [var_name_piece + value_pair_equals + val for val in item_values] - ) - - @classmethod - def __ref6570_dict_expansion( - cls, - variable_name: str, - in_data: typing.Any, - explode: bool, - percent_encode: bool, - prefix_separator_iterator: PrefixSeparatorIterator, - var_name_piece: str, - named_parameter_expansion: bool - ) -> str: - in_data_transformed = {key: cls.__ref6570_item_value(val, percent_encode) for key, val in in_data.items()} - in_data_transformed = {key: val for key, val in in_data_transformed.items() if val is not None} - if not in_data_transformed: - # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 - return "" - value_pair_equals = '=' if named_parameter_expansion else '' - if not explode: - return ( - next(prefix_separator_iterator) + - var_name_piece + value_pair_equals + - prefix_separator_iterator.item_separator.join( - prefix_separator_iterator.item_separator.join( - item_pair - ) for item_pair in in_data_transformed.items() - ) - ) - # exploded - return next(prefix_separator_iterator) + next(prefix_separator_iterator).join( - [key + '=' + val for key, val in in_data_transformed.items()] - ) - - @classmethod - def _ref6570_expansion( - cls, - variable_name: str, - in_data: typing.Any, - explode: bool, - percent_encode: bool, - prefix_separator_iterator: PrefixSeparatorIterator - ) -> str: - """ - Separator is for separate variables like dict with explode true, not for array item separation - """ - named_parameter_expansion = prefix_separator_iterator.separator in {'&', ';'} - var_name_piece = variable_name if named_parameter_expansion else '' - if type(in_data) in {str, float, int}: - return cls.__ref6570_str_float_int_expansion( - variable_name, - in_data, - explode, - percent_encode, - prefix_separator_iterator, - var_name_piece, - named_parameter_expansion - ) - elif isinstance(in_data, none_type): - # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 - return "" - elif isinstance(in_data, list): - return cls.__ref6570_list_expansion( - variable_name, - in_data, - explode, - percent_encode, - prefix_separator_iterator, - var_name_piece, - named_parameter_expansion - ) - elif isinstance(in_data, dict): - return cls.__ref6570_dict_expansion( - variable_name, - in_data, - explode, - percent_encode, - prefix_separator_iterator, - var_name_piece, - named_parameter_expansion - ) - # bool, bytes, etc - raise ApiValueError('Unable to generate a ref6570 representation of {}'.format(in_data)) - - -class StyleFormSerializer(ParameterSerializerBase): - @classmethod - def _get_default_explode(cls, style: ParameterStyle) -> bool: - if style is ParameterStyle.FORM: - return True - return super()._get_default_explode(style) - - def _serialize_form( - self, - in_data: typing.Union[None, int, float, str, bool, dict, list], - name: str, - explode: bool, - percent_encode: bool, - prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] = None - ) -> str: - if prefix_separator_iterator is None: - prefix_separator_iterator = PrefixSeparatorIterator('', '&') - return self._ref6570_expansion( - variable_name=name, - in_data=in_data, - explode=explode, - percent_encode=percent_encode, - prefix_separator_iterator=prefix_separator_iterator - ) - - -class StyleSimpleSerializer(ParameterSerializerBase): - - def _serialize_simple( - self, - in_data: typing.Union[None, int, float, str, bool, dict, list], - name: str, - explode: bool, - percent_encode: bool - ) -> str: - prefix_separator_iterator = PrefixSeparatorIterator('', ',') - return self._ref6570_expansion( - variable_name=name, - in_data=in_data, - explode=explode, - percent_encode=percent_encode, - prefix_separator_iterator=prefix_separator_iterator - ) - - -class JSONDetector: - """ - Works for: - application/json - application/json; charset=UTF-8 - application/json-patch+json - application/geo+json - """ - __json_content_type_pattern = re.compile("application/[^+]*[+]?(json);?.*") - - @classmethod - def _content_type_is_json(cls, content_type: str) -> bool: - if cls.__json_content_type_pattern.match(content_type): - return True - return False - - -@dataclass -class ParameterBase(JSONDetector): - name: str - in_type: ParameterInType - required: bool - style: typing.Optional[ParameterStyle] - explode: typing.Optional[bool] - allow_reserved: typing.Optional[bool] - schema: typing.Optional[typing.Type[Schema]] - content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] - - __style_to_in_type = { - ParameterStyle.MATRIX: {ParameterInType.PATH}, - ParameterStyle.LABEL: {ParameterInType.PATH}, - ParameterStyle.FORM: {ParameterInType.QUERY, ParameterInType.COOKIE}, - ParameterStyle.SIMPLE: {ParameterInType.PATH, ParameterInType.HEADER}, - ParameterStyle.SPACE_DELIMITED: {ParameterInType.QUERY}, - ParameterStyle.PIPE_DELIMITED: {ParameterInType.QUERY}, - ParameterStyle.DEEP_OBJECT: {ParameterInType.QUERY}, - } - __in_type_to_default_style = { - ParameterInType.QUERY: ParameterStyle.FORM, - ParameterInType.PATH: ParameterStyle.SIMPLE, - ParameterInType.HEADER: ParameterStyle.SIMPLE, - ParameterInType.COOKIE: ParameterStyle.FORM, - } - __disallowed_header_names = {'Accept', 'Content-Type', 'Authorization'} - _json_encoder = JSONEncoder() - - @classmethod - def __verify_style_to_in_type(cls, style: typing.Optional[ParameterStyle], in_type: ParameterInType): - if style is None: - return - in_type_set = cls.__style_to_in_type[style] - if in_type not in in_type_set: - raise ValueError( - 'Invalid style and in_type combination. For style={} only in_type={} are allowed'.format( - style, in_type_set - ) - ) - - def __init__( - self, - name: str, - in_type: ParameterInType, - required: bool = False, - style: typing.Optional[ParameterStyle] = None, - explode: bool = False, - allow_reserved: typing.Optional[bool] = None, - schema: typing.Optional[typing.Type[Schema]] = None, - content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None - ): - if schema is None and content is None: - raise ValueError('Value missing; Pass in either schema or content') - if schema and content: - raise ValueError('Too many values provided. Both schema and content were provided. Only one may be input') - if name in self.__disallowed_header_names and in_type is ParameterInType.HEADER: - raise ValueError('Invalid name, name may not be one of {}'.format(self.__disallowed_header_names)) - self.__verify_style_to_in_type(style, in_type) - if content is None and style is None: - style = self.__in_type_to_default_style[in_type] - if content is not None and in_type in self.__in_type_to_default_style and len(content) != 1: - raise ValueError('Invalid content length, content length must equal 1') - self.in_type = in_type - self.name = name - self.required = required - self.style = style - self.explode = explode - self.allow_reserved = allow_reserved - self.schema = schema - self.content = content - - def _serialize_json( - self, - in_data: typing.Union[None, int, float, str, bool, dict, list], - eliminate_whitespace: bool = False - ) -> str: - if eliminate_whitespace: - return json.dumps(in_data, separators=self._json_encoder.compact_separators) - return json.dumps(in_data) - - -class PathParameter(ParameterBase, StyleSimpleSerializer): - - def __init__( - self, - name: str, - required: bool = False, - style: typing.Optional[ParameterStyle] = None, - explode: bool = False, - allow_reserved: typing.Optional[bool] = None, - schema: typing.Optional[typing.Type[Schema]] = None, - content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None - ): - super().__init__( - name, - in_type=ParameterInType.PATH, - required=required, - style=style, - explode=explode, - allow_reserved=allow_reserved, - schema=schema, - content=content - ) - - def __serialize_label( - self, - in_data: typing.Union[None, int, float, str, bool, dict, list] - ) -> typing.Dict[str, str]: - prefix_separator_iterator = PrefixSeparatorIterator('.', '.') - value = self._ref6570_expansion( - variable_name=self.name, - in_data=in_data, - explode=self.explode, - percent_encode=True, - prefix_separator_iterator=prefix_separator_iterator - ) - return self._to_dict(self.name, value) - - def __serialize_matrix( - self, - in_data: typing.Union[None, int, float, str, bool, dict, list] - ) -> typing.Dict[str, str]: - prefix_separator_iterator = PrefixSeparatorIterator(';', ';') - value = self._ref6570_expansion( - variable_name=self.name, - in_data=in_data, - explode=self.explode, - percent_encode=True, - prefix_separator_iterator=prefix_separator_iterator - ) - return self._to_dict(self.name, value) - - def __serialize_simple( - self, - in_data: typing.Union[None, int, float, str, bool, dict, list], - ) -> typing.Dict[str, str]: - value = self._serialize_simple( - in_data=in_data, - name=self.name, - explode=self.explode, - percent_encode=True - ) - return self._to_dict(self.name, value) - - def serialize( - self, - in_data: typing.Union[ - Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict] - ) -> typing.Dict[str, str]: - if self.schema: - cast_in_data = self.schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) - """ - simple -> path - path: - returns path_params: dict - label -> path - returns path_params - matrix -> path - returns path_params - """ - if self.style: - if self.style is ParameterStyle.SIMPLE: - return self.__serialize_simple(cast_in_data) - elif self.style is ParameterStyle.LABEL: - return self.__serialize_label(cast_in_data) - elif self.style is ParameterStyle.MATRIX: - return self.__serialize_matrix(cast_in_data) - # self.content will be length one - for content_type, schema in self.content.items(): - cast_in_data = schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) - if self._content_type_is_json(content_type): - value = self._serialize_json(cast_in_data) - return self._to_dict(self.name, value) - raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) - - -class QueryParameter(ParameterBase, StyleFormSerializer): - - def __init__( - self, - name: str, - required: bool = False, - style: typing.Optional[ParameterStyle] = None, - explode: typing.Optional[bool] = None, - allow_reserved: typing.Optional[bool] = None, - schema: typing.Optional[typing.Type[Schema]] = None, - content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None - ): - used_style = ParameterStyle.FORM if style is None else style - used_explode = self._get_default_explode(used_style) if explode is None else explode - - super().__init__( - name, - in_type=ParameterInType.QUERY, - required=required, - style=used_style, - explode=used_explode, - allow_reserved=allow_reserved, - schema=schema, - content=content - ) - - def __serialize_space_delimited( - self, - in_data: typing.Union[None, int, float, str, bool, dict, list], - prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] - ) -> typing.Dict[str, str]: - if prefix_separator_iterator is None: - prefix_separator_iterator = self.get_prefix_separator_iterator() - value = self._ref6570_expansion( - variable_name=self.name, - in_data=in_data, - explode=self.explode, - percent_encode=True, - prefix_separator_iterator=prefix_separator_iterator - ) - return self._to_dict(self.name, value) - - def __serialize_pipe_delimited( - self, - in_data: typing.Union[None, int, float, str, bool, dict, list], - prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] - ) -> typing.Dict[str, str]: - if prefix_separator_iterator is None: - prefix_separator_iterator = self.get_prefix_separator_iterator() - value = self._ref6570_expansion( - variable_name=self.name, - in_data=in_data, - explode=self.explode, - percent_encode=True, - prefix_separator_iterator=prefix_separator_iterator - ) - return self._to_dict(self.name, value) - - def __serialize_form( - self, - in_data: typing.Union[None, int, float, str, bool, dict, list], - prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] - ) -> typing.Dict[str, str]: - if prefix_separator_iterator is None: - prefix_separator_iterator = self.get_prefix_separator_iterator() - value = self._serialize_form( - in_data, - name=self.name, - explode=self.explode, - percent_encode=True, - prefix_separator_iterator=prefix_separator_iterator - ) - return self._to_dict(self.name, value) - - def get_prefix_separator_iterator(self) -> typing.Optional[PrefixSeparatorIterator]: - if self.style is ParameterStyle.FORM: - return PrefixSeparatorIterator('?', '&') - elif self.style is ParameterStyle.SPACE_DELIMITED: - return PrefixSeparatorIterator('', '%20') - elif self.style is ParameterStyle.PIPE_DELIMITED: - return PrefixSeparatorIterator('', '|') - - def serialize( - self, - in_data: typing.Union[ - Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict], - prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] = None - ) -> typing.Dict[str, str]: - if self.schema: - cast_in_data = self.schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) - """ - form -> query - query: - - GET/HEAD/DELETE: could use fields - - PUT/POST: must use urlencode to send parameters - returns fields: tuple - spaceDelimited -> query - returns fields - pipeDelimited -> query - returns fields - deepObject -> query, https://github.com/OAI/OpenAPI-Specification/issues/1706 - returns fields - """ - if self.style: - # TODO update query ones to omit setting values when [] {} or None is input - if self.style is ParameterStyle.FORM: - return self.__serialize_form(cast_in_data, prefix_separator_iterator) - elif self.style is ParameterStyle.SPACE_DELIMITED: - return self.__serialize_space_delimited(cast_in_data, prefix_separator_iterator) - elif self.style is ParameterStyle.PIPE_DELIMITED: - return self.__serialize_pipe_delimited(cast_in_data, prefix_separator_iterator) - # self.content will be length one - if prefix_separator_iterator is None: - prefix_separator_iterator = self.get_prefix_separator_iterator() - for content_type, schema in self.content.items(): - cast_in_data = schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) - if self._content_type_is_json(content_type): - value = self._serialize_json(cast_in_data, eliminate_whitespace=True) - return self._to_dict( - self.name, - next(prefix_separator_iterator) + self.name + '=' + quote(value) - ) - raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) - - -class CookieParameter(ParameterBase, StyleFormSerializer): - - def __init__( - self, - name: str, - required: bool = False, - style: typing.Optional[ParameterStyle] = None, - explode: typing.Optional[bool] = None, - allow_reserved: typing.Optional[bool] = None, - schema: typing.Optional[typing.Type[Schema]] = None, - content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None - ): - used_style = ParameterStyle.FORM if style is None and content is None and schema else style - used_explode = self._get_default_explode(used_style) if explode is None else explode - - super().__init__( - name, - in_type=ParameterInType.COOKIE, - required=required, - style=used_style, - explode=used_explode, - allow_reserved=allow_reserved, - schema=schema, - content=content - ) - - def serialize( - self, - in_data: typing.Union[ - Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict] - ) -> typing.Dict[str, str]: - if self.schema: - cast_in_data = self.schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) - """ - form -> cookie - returns fields: tuple - """ - if self.style: - """ - TODO add escaping of comma, space, equals - or turn encoding on - """ - value = self._serialize_form( - cast_in_data, - explode=self.explode, - name=self.name, - percent_encode=False, - prefix_separator_iterator=PrefixSeparatorIterator('', '&') - ) - return self._to_dict(self.name, value) - # self.content will be length one - for content_type, schema in self.content.items(): - cast_in_data = schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) - if self._content_type_is_json(content_type): - value = self._serialize_json(cast_in_data) - return self._to_dict(self.name, value) - raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) - - -class HeaderParameter(ParameterBase, StyleSimpleSerializer): - def __init__( - self, - name: str, - required: bool = False, - style: typing.Optional[ParameterStyle] = None, - explode: bool = False, - allow_reserved: typing.Optional[bool] = None, - schema: typing.Optional[typing.Type[Schema]] = None, - content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None - ): - super().__init__( - name, - in_type=ParameterInType.HEADER, - required=required, - style=style, - explode=explode, - allow_reserved=allow_reserved, - schema=schema, - content=content - ) - - @staticmethod - def __to_headers(in_data: typing.Tuple[typing.Tuple[str, str], ...]) -> HTTPHeaderDict: - data = tuple(t for t in in_data if t) - headers = HTTPHeaderDict() - if not data: - return headers - headers.extend(data) - return headers - - def serialize( - self, - in_data: typing.Union[ - Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict] - ) -> HTTPHeaderDict: - if self.schema: - cast_in_data = self.schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) - """ - simple -> header - headers: PoolManager needs a mapping, tuple is close - returns headers: dict - """ - if self.style: - value = self._serialize_simple(cast_in_data, self.name, self.explode, False) - return self.__to_headers(((self.name, value),)) - # self.content will be length one - for content_type, schema in self.content.items(): - cast_in_data = schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) - if self._content_type_is_json(content_type): - value = self._serialize_json(cast_in_data) - return self.__to_headers(((self.name, value),)) - raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) - - -class Encoding: - def __init__( - self, - content_type: str, - headers: typing.Optional[typing.Dict[str, HeaderParameter]] = None, - style: typing.Optional[ParameterStyle] = None, - explode: bool = False, - allow_reserved: bool = False, - ): - self.content_type = content_type - self.headers = headers - self.style = style - self.explode = explode - self.allow_reserved = allow_reserved - - -@dataclass -class MediaType: - """ - Used to store request and response body schema information - encoding: - A map between a property name and its encoding information. - The key, being the property name, MUST exist in the schema as a property. - The encoding object SHALL only apply to requestBody objects when the media type is - multipart or application/x-www-form-urlencoded. - """ - schema: typing.Optional[typing.Type[Schema]] = None - encoding: typing.Optional[typing.Dict[str, Encoding]] = None - - -@dataclass -class ApiResponse: - response: urllib3.HTTPResponse - body: typing.Union[Unset, Schema] = unset - headers: typing.Union[Unset, typing.Dict[str, Schema]] = unset - - def __init__( - self, - response: urllib3.HTTPResponse, - body: typing.Union[Unset, Schema] = unset, - headers: typing.Union[Unset, typing.Dict[str, Schema]] = unset - ): - """ - pycharm needs this to prevent 'Unexpected argument' warnings - """ - self.response = response - self.body = body - self.headers = headers - - -@dataclass -class ApiResponseWithoutDeserialization(ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[Unset, typing.Type[Schema]] = unset - headers: typing.Union[Unset, typing.List[HeaderParameter]] = unset - - -class OpenApiResponse(JSONDetector): - __filename_content_disposition_pattern = re.compile('filename="(.+?)"') - - def __init__( - self, - response_cls: typing.Type[ApiResponse] = ApiResponse, - content: typing.Optional[typing.Dict[str, MediaType]] = None, - headers: typing.Optional[typing.List[HeaderParameter]] = None, - ): - self.headers = headers - if content is not None and len(content) == 0: - raise ValueError('Invalid value for content, the content dict must have >= 1 entry') - self.content = content - self.response_cls = response_cls - - @staticmethod - def __deserialize_json(response: urllib3.HTTPResponse) -> typing.Any: - # python must be >= 3.9 so we can pass in bytes into json.loads - return json.loads(response.data) - - @staticmethod - def __file_name_from_response_url(response_url: typing.Optional[str]) -> typing.Optional[str]: - if response_url is None: - return None - url_path = urlparse(response_url).path - if url_path: - path_basename = os.path.basename(url_path) - if path_basename: - _filename, ext = os.path.splitext(path_basename) - if ext: - return path_basename - return None - - @classmethod - def __file_name_from_content_disposition(cls, content_disposition: typing.Optional[str]) -> typing.Optional[str]: - if content_disposition is None: - return None - match = cls.__filename_content_disposition_pattern.search(content_disposition) - if not match: - return None - return match.group(1) - - def __deserialize_application_octet_stream( - self, response: urllib3.HTTPResponse - ) -> typing.Union[bytes, io.BufferedReader]: - """ - urllib3 use cases: - 1. when preload_content=True (stream=False) then supports_chunked_reads is False and bytes are returned - 2. when preload_content=False (stream=True) then supports_chunked_reads is True and - a file will be written and returned - """ - if response.supports_chunked_reads(): - file_name = ( - self.__file_name_from_content_disposition(response.headers.get('content-disposition')) - or self.__file_name_from_response_url(response.geturl()) - ) - - if file_name is None: - _fd, path = tempfile.mkstemp() - else: - path = os.path.join(tempfile.gettempdir(), file_name) - - with open(path, 'wb') as new_file: - chunk_size = 1024 - while True: - data = response.read(chunk_size) - if not data: - break - new_file.write(data) - # release_conn is needed for streaming connections only - response.release_conn() - new_file = open(path, 'rb') - return new_file - else: - return response.data - - @staticmethod - def __deserialize_multipart_form_data( - response: urllib3.HTTPResponse - ) -> typing.Dict[str, typing.Any]: - msg = email.message_from_bytes(response.data) - return { - part.get_param("name", header="Content-Disposition"): part.get_payload( - decode=True - ).decode(part.get_content_charset()) - if part.get_content_charset() - else part.get_payload() - for part in msg.get_payload() - } - - def deserialize(self, response: urllib3.HTTPResponse, configuration: Configuration) -> ApiResponse: - content_type = response.getheader('content-type') - deserialized_body = unset - streamed = response.supports_chunked_reads() - - deserialized_headers = unset - if self.headers is not None: - # TODO add header deserialiation here - pass - - if self.content is not None: - if content_type not in self.content: - raise ApiValueError( - f"Invalid content_type returned. Content_type='{content_type}' was returned " - f"when only {str(set(self.content))} are defined for status_code={str(response.status)}" - ) - body_schema = self.content[content_type].schema - if body_schema is None: - # some specs do not define response content media type schemas - return self.response_cls( - response=response, - headers=deserialized_headers, - body=unset - ) - - if self._content_type_is_json(content_type): - body_data = self.__deserialize_json(response) - elif content_type == 'application/octet-stream': - body_data = self.__deserialize_application_octet_stream(response) - elif content_type.startswith('multipart/form-data'): - body_data = self.__deserialize_multipart_form_data(response) - content_type = 'multipart/form-data' - else: - raise NotImplementedError('Deserialization of {} has not yet been implemented'.format(content_type)) - deserialized_body = body_schema.from_openapi_data_oapg( - body_data, _configuration=configuration) - elif streamed: - response.release_conn() - - return self.response_cls( - response=response, - headers=deserialized_headers, - body=deserialized_body - ) - - -class ApiClient: - """Generic API client for OpenAPI client library builds. - - OpenAPI generic API client. This client handles the client- - server communication, and is invariant across implementations. Specifics of - the methods and models for each application are generated from the OpenAPI - templates. - - NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - Do not edit the class manually. - - :param configuration: .Configuration object for this client - :param header_name: a header to pass when making calls to the API. - :param header_value: a header value to pass when making calls to - the API. - :param cookie: a cookie to include in the header when making calls - to the API - :param pool_threads: The number of threads to use for async requests - to the API. More threads means more concurrent API requests. - """ - - _pool = None - - def __init__( - self, - configuration: typing.Optional[Configuration] = None, - header_name: typing.Optional[str] = None, - header_value: typing.Optional[str] = None, - cookie: typing.Optional[str] = None, - pool_threads: int = 1 - ): - if configuration is None: - configuration = Configuration() - self.configuration = configuration - self.pool_threads = pool_threads - - self.rest_client = rest.RESTClientObject(configuration) - self.default_headers = HTTPHeaderDict() - if header_name is not None: - self.default_headers[header_name] = header_value - self.cookie = cookie - # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/1.0.0/python' - - def __enter__(self): - return self - - def __exit__(self, exc_type, exc_value, traceback): - self.close() - - def close(self): - if self._pool: - self._pool.close() - self._pool.join() - self._pool = None - if hasattr(atexit, 'unregister'): - atexit.unregister(self.close) - - @property - def pool(self): - """Create thread pool on first request - avoids instantiating unused threadpool for blocking clients. - """ - if self._pool is None: - atexit.register(self.close) - self._pool = ThreadPool(self.pool_threads) - return self._pool - - @property - def user_agent(self): - """User agent for this API client""" - return self.default_headers['User-Agent'] - - @user_agent.setter - def user_agent(self, value): - self.default_headers['User-Agent'] = value - - def set_default_header(self, header_name, header_value): - self.default_headers[header_name] = header_value - - def __call_api( - self, - resource_path: str, - method: str, - headers: typing.Optional[HTTPHeaderDict] = None, - body: typing.Optional[typing.Union[str, bytes]] = None, - fields: typing.Optional[typing.Tuple[typing.Tuple[str, str], ...]] = None, - auth_settings: typing.Optional[typing.List[str]] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - host: typing.Optional[str] = None, - ) -> urllib3.HTTPResponse: - - # header parameters - used_headers = HTTPHeaderDict(self.default_headers) - if self.cookie: - headers['Cookie'] = self.cookie - - # auth setting - self.update_params_for_auth(used_headers, - auth_settings, resource_path, method, body) - - # must happen after cookie setting and auth setting in case user is overriding those - if headers: - used_headers.update(headers) - - # request url - if host is None: - url = self.configuration.host + resource_path - else: - # use server/host defined in path or operation instead - url = host + resource_path - - # perform request and return response - response = self.request( - method, - url, - headers=used_headers, - fields=fields, - body=body, - stream=stream, - timeout=timeout, - ) - return response - - def call_api( - self, - resource_path: str, - method: str, - headers: typing.Optional[HTTPHeaderDict] = None, - body: typing.Optional[typing.Union[str, bytes]] = None, - fields: typing.Optional[typing.Tuple[typing.Tuple[str, str], ...]] = None, - auth_settings: typing.Optional[typing.List[str]] = None, - async_req: typing.Optional[bool] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - host: typing.Optional[str] = None, - ) -> urllib3.HTTPResponse: - """Makes the HTTP request (synchronous) and returns deserialized data. - - To make an async_req request, set the async_req parameter. - - :param resource_path: Path to method endpoint. - :param method: Method to call. - :param headers: Header parameters to be - placed in the request header. - :param body: Request body. - :param fields: Request post form parameters, - for `application/x-www-form-urlencoded`, `multipart/form-data`. - :param auth_settings: Auth Settings names for the request. - :param async_req: execute request asynchronously - :type async_req: bool, optional TODO remove, unused - :param stream: if True, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Also when True, if the openapi spec describes a file download, - the data will be written to a local filesystme file and the BinarySchema - instance will also inherit from FileSchema and FileIO - Default is False. - :type stream: bool, optional - :param timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param host: api endpoint host - :return: - If async_req parameter is True, - the request will be called asynchronously. - The method will return the request thread. - If parameter async_req is False or missing, - then the method will return the response directly. - """ - - if not async_req: - return self.__call_api( - resource_path, - method, - headers, - body, - fields, - auth_settings, - stream, - timeout, - host, - ) - - return self.pool.apply_async( - self.__call_api, - ( - resource_path, - method, - headers, - body, - json, - fields, - auth_settings, - stream, - timeout, - host, - ) - ) - - def request( - self, - method: str, - url: str, - headers: typing.Optional[HTTPHeaderDict] = None, - fields: typing.Optional[typing.Tuple[typing.Tuple[str, str], ...]] = None, - body: typing.Optional[typing.Union[str, bytes]] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> urllib3.HTTPResponse: - """Makes the HTTP request using RESTClient.""" - if method == "GET": - return self.rest_client.GET(url, - stream=stream, - timeout=timeout, - headers=headers) - elif method == "HEAD": - return self.rest_client.HEAD(url, - stream=stream, - timeout=timeout, - headers=headers) - elif method == "OPTIONS": - return self.rest_client.OPTIONS(url, - headers=headers, - fields=fields, - stream=stream, - timeout=timeout, - body=body) - elif method == "POST": - return self.rest_client.POST(url, - headers=headers, - fields=fields, - stream=stream, - timeout=timeout, - body=body) - elif method == "PUT": - return self.rest_client.PUT(url, - headers=headers, - fields=fields, - stream=stream, - timeout=timeout, - body=body) - elif method == "PATCH": - return self.rest_client.PATCH(url, - headers=headers, - fields=fields, - stream=stream, - timeout=timeout, - body=body) - elif method == "DELETE": - return self.rest_client.DELETE(url, - headers=headers, - stream=stream, - timeout=timeout, - body=body) - else: - raise ApiValueError( - "http method must be `GET`, `HEAD`, `OPTIONS`," - " `POST`, `PATCH`, `PUT` or `DELETE`." - ) - - def update_params_for_auth(self, headers, auth_settings, - resource_path, method, body): - """Updates header and query params based on authentication setting. - - :param headers: Header parameters dict to be updated. - :param auth_settings: Authentication setting identifiers list. - :param resource_path: A string representation of the HTTP request resource path. - :param method: A string representation of the HTTP request method. - :param body: A object representing the body of the HTTP request. - The object type is the return value of _encoder.default(). - """ - if not auth_settings: - return - - for auth in auth_settings: - auth_setting = self.configuration.auth_settings().get(auth) - if not auth_setting: - continue - if auth_setting['in'] == 'cookie': - headers.add('Cookie', auth_setting['value']) - elif auth_setting['in'] == 'header': - if auth_setting['type'] != 'http-signature': - headers.add(auth_setting['key'], auth_setting['value']) - elif auth_setting['in'] == 'query': - """ TODO implement auth in query - need to pass in prefix_separator_iterator - and need to output resource_path with query params added - """ - raise ApiValueError("Auth in query not yet implemented") - else: - raise ApiValueError( - 'Authentication token must be in `query` or `header`' - ) - - -class Api: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client: typing.Optional[ApiClient] = None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - @staticmethod - def _verify_typed_dict_inputs_oapg(cls: typing.Type[typing_extensions.TypedDict], data: typing.Dict[str, typing.Any]): - """ - Ensures that: - - required keys are present - - additional properties are not input - - value stored under required keys do not have the value unset - Note: detailed value checking is done in schema classes - """ - missing_required_keys = [] - required_keys_with_unset_values = [] - for required_key in cls.__required_keys__: - if required_key not in data: - missing_required_keys.append(required_key) - continue - value = data[required_key] - if value is unset: - required_keys_with_unset_values.append(required_key) - if missing_required_keys: - raise ApiTypeError( - '{} missing {} required arguments: {}'.format( - cls.__name__, len(missing_required_keys), missing_required_keys - ) - ) - if required_keys_with_unset_values: - raise ApiValueError( - '{} contains invalid unset values for {} required keys: {}'.format( - cls.__name__, len(required_keys_with_unset_values), required_keys_with_unset_values - ) - ) - - disallowed_additional_keys = [] - for key in data: - if key in cls.__required_keys__ or key in cls.__optional_keys__: - continue - disallowed_additional_keys.append(key) - if disallowed_additional_keys: - raise ApiTypeError( - '{} got {} unexpected keyword arguments: {}'.format( - cls.__name__, len(disallowed_additional_keys), disallowed_additional_keys - ) - ) - - def _get_host_oapg( - self, - operation_id: str, - servers: typing.Tuple[typing.Dict[str, str], ...] = tuple(), - host_index: typing.Optional[int] = None - ) -> typing.Optional[str]: - configuration = self.api_client.configuration - try: - if host_index is None: - index = configuration.server_operation_index.get( - operation_id, configuration.server_index - ) - else: - index = host_index - server_variables = configuration.server_operation_variables.get( - operation_id, configuration.server_variables - ) - host = configuration.get_host_from_settings( - index, variables=server_variables, servers=servers - ) - except IndexError: - if servers: - raise ApiValueError( - "Invalid host index. Must be 0 <= index < %s" % - len(servers) - ) - host = None - return host - - -class SerializedRequestBody(typing_extensions.TypedDict, total=False): - body: typing.Union[str, bytes] - fields: typing.Tuple[typing.Union[RequestField, typing.Tuple[str, str]], ...] - - -class RequestBody(StyleFormSerializer, JSONDetector): - """ - A request body parameter - content: content_type to MediaType Schema info - """ - __json_encoder = JSONEncoder() - - def __init__( - self, - content: typing.Dict[str, MediaType], - required: bool = False, - ): - self.required = required - if len(content) == 0: - raise ValueError('Invalid value for content, the content dict must have >= 1 entry') - self.content = content - - def __serialize_json( - self, - in_data: typing.Any - ) -> typing.Dict[str, bytes]: - in_data = self.__json_encoder.default(in_data) - json_str = json.dumps(in_data, separators=(",", ":"), ensure_ascii=False).encode( - "utf-8" - ) - return dict(body=json_str) - - @staticmethod - def __serialize_text_plain(in_data: typing.Any) -> typing.Dict[str, str]: - if isinstance(in_data, frozendict.frozendict): - raise ValueError('Unable to serialize type frozendict.frozendict to text/plain') - elif isinstance(in_data, tuple): - raise ValueError('Unable to serialize type tuple to text/plain') - elif isinstance(in_data, NoneClass): - raise ValueError('Unable to serialize type NoneClass to text/plain') - elif isinstance(in_data, BoolClass): - raise ValueError('Unable to serialize type BoolClass to text/plain') - return dict(body=str(in_data)) - - def __multipart_json_item(self, key: str, value: Schema) -> RequestField: - json_value = self.__json_encoder.default(value) - request_field = RequestField(name=key, data=json.dumps(json_value)) - request_field.make_multipart(content_type='application/json') - return request_field - - def __multipart_form_item(self, key: str, value: Schema) -> RequestField: - if isinstance(value, str): - request_field = RequestField(name=key, data=str(value)) - request_field.make_multipart(content_type='text/plain') - elif isinstance(value, bytes): - request_field = RequestField(name=key, data=value) - request_field.make_multipart(content_type='application/octet-stream') - elif isinstance(value, FileIO): - # TODO use content.encoding to limit allowed content types if they are present - request_field = RequestField.from_tuples(key, (os.path.basename(value.name), value.read())) - value.close() - else: - request_field = self.__multipart_json_item(key=key, value=value) - return request_field - - def __serialize_multipart_form_data( - self, in_data: Schema - ) -> typing.Dict[str, typing.Tuple[RequestField, ...]]: - if not isinstance(in_data, frozendict.frozendict): - raise ValueError(f'Unable to serialize {in_data} to multipart/form-data because it is not a dict of data') - """ - In a multipart/form-data request body, each schema property, or each element of a schema array property, - takes a section in the payload with an internal header as defined by RFC7578. The serialization strategy - for each property of a multipart/form-data request body can be specified in an associated Encoding Object. - - When passing in multipart types, boundaries MAY be used to separate sections of the content being - transferred – thus, the following default Content-Types are defined for multipart: - - If the (object) property is a primitive, or an array of primitive values, the default Content-Type is text/plain - If the property is complex, or an array of complex values, the default Content-Type is application/json - Question: how is the array of primitives encoded? - If the property is a type: string with a contentEncoding, the default Content-Type is application/octet-stream - """ - fields = [] - for key, value in in_data.items(): - if isinstance(value, tuple): - if value: - # values use explode = True, so the code makes a RequestField for each item with name=key - for item in value: - request_field = self.__multipart_form_item(key=key, value=item) - fields.append(request_field) - else: - # send an empty array as json because exploding will not send it - request_field = self.__multipart_json_item(key=key, value=value) - fields.append(request_field) - else: - request_field = self.__multipart_form_item(key=key, value=value) - fields.append(request_field) - - return dict(fields=tuple(fields)) - - def __serialize_application_octet_stream(self, in_data: BinarySchema) -> typing.Dict[str, bytes]: - if isinstance(in_data, bytes): - return dict(body=in_data) - # FileIO type - result = dict(body=in_data.read()) - in_data.close() - return result - - def __serialize_application_x_www_form_data( - self, in_data: typing.Any - ) -> SerializedRequestBody: - """ - POST submission of form data in body - """ - if not isinstance(in_data, frozendict.frozendict): - raise ValueError( - f'Unable to serialize {in_data} to application/x-www-form-urlencoded because it is not a dict of data') - cast_in_data = self.__json_encoder.default(in_data) - value = self._serialize_form(cast_in_data, name='', explode=True, percent_encode=True) - return dict(body=value) - - def serialize( - self, in_data: typing.Any, content_type: str - ) -> SerializedRequestBody: - """ - If a str is returned then the result will be assigned to data when making the request - If a tuple is returned then the result will be used as fields input in encode_multipart_formdata - Return a tuple of - - The key of the return dict is - - body for application/json - - encode_multipart and fields for multipart/form-data - """ - media_type = self.content[content_type] - if isinstance(in_data, media_type.schema): - cast_in_data = in_data - elif isinstance(in_data, (dict, frozendict.frozendict)) and in_data: - cast_in_data = media_type.schema(**in_data) - else: - cast_in_data = media_type.schema(in_data) - # TODO check for and use encoding if it exists - # and content_type is multipart or application/x-www-form-urlencoded - if self._content_type_is_json(content_type): - return self.__serialize_json(cast_in_data) - elif content_type == 'text/plain': - return self.__serialize_text_plain(cast_in_data) - elif content_type == 'multipart/form-data': - return self.__serialize_multipart_form_data(cast_in_data) - elif content_type == 'application/x-www-form-urlencoded': - return self.__serialize_application_x_www_form_data(cast_in_data) - elif content_type == 'application/octet-stream': - return self.__serialize_application_octet_stream(cast_in_data) - raise NotImplementedError('Serialization has not yet been implemented for {}'.format(content_type)) diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/apis/path_to_api.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/apis/path_to_api.py deleted file mode 100644 index 1eb9aba4359..00000000000 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/apis/path_to_api.py +++ /dev/null @@ -1,17 +0,0 @@ -import typing_extensions - -from this_package.paths import PathValues -from this_package.apis.paths.operators import Operators - -PathToApi = typing_extensions.TypedDict( - 'PathToApi', - { - PathValues.OPERATORS: Operators, - } -) - -path_to_api = PathToApi( - { - PathValues.OPERATORS: Operators, - } -) diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/apis/paths/__init__.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/apis/paths/__init__.py deleted file mode 100644 index c4509c3729d..00000000000 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/apis/paths/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from this_package.apis.path_to_api import path_to_api diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/apis/paths/operators.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/apis/paths/operators.py deleted file mode 100644 index d5250e1774b..00000000000 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/apis/paths/operators.py +++ /dev/null @@ -1,7 +0,0 @@ -from this_package.paths.operators.post import ApiForpost - - -class Operators( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/apis/tag_to_api.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/apis/tag_to_api.py deleted file mode 100644 index 9c0a0a5cfc4..00000000000 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/apis/tag_to_api.py +++ /dev/null @@ -1,17 +0,0 @@ -import typing_extensions - -from this_package.apis.tags import TagValues -from this_package.apis.tags.default_api import DefaultApi - -TagToApi = typing_extensions.TypedDict( - 'TagToApi', - { - TagValues.DEFAULT: DefaultApi, - } -) - -tag_to_api = TagToApi( - { - TagValues.DEFAULT: DefaultApi, - } -) diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/apis/tags/__init__.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/apis/tags/__init__.py deleted file mode 100644 index a731754fccc..00000000000 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/apis/tags/__init__.py +++ /dev/null @@ -1,9 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from this_package.apis.tag_to_api import tag_to_api - -import enum - - -class TagValues(str, enum.Enum): - DEFAULT = "default" diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/apis/tags/default_api.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/apis/tags/default_api.py deleted file mode 100644 index aab11571b98..00000000000 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/apis/tags/default_api.py +++ /dev/null @@ -1,23 +0,0 @@ -# coding: utf-8 - -""" - discriminator-test - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 - - The version of the OpenAPI document: 1.0 - Generated by: https://openapi-generator.tech -""" - -from this_package.paths.operators.post import PostOperators - - -class DefaultApi( - PostOperators, -): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - pass diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/configuration.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/configuration.py deleted file mode 100644 index 32cd774ed63..00000000000 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/configuration.py +++ /dev/null @@ -1,410 +0,0 @@ -# coding: utf-8 - -""" - discriminator-test - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 - - The version of the OpenAPI document: 1.0 - Generated by: https://openapi-generator.tech -""" - -import copy -import logging -import multiprocessing -import sys -import urllib3 - -from http import client as http_client -from this_package.exceptions import ApiValueError - - -JSON_SCHEMA_VALIDATION_KEYWORDS = { - 'multipleOf', 'maximum', 'exclusiveMaximum', - 'minimum', 'exclusiveMinimum', 'maxLength', - 'minLength', 'pattern', 'maxItems', 'minItems', - 'uniqueItems', 'maxProperties', 'minProperties', -} - -class Configuration(object): - """NOTE: This class is auto generated by OpenAPI Generator - - Ref: https://openapi-generator.tech - Do not edit the class manually. - - :param host: Base url - :param api_key: Dict to store API key(s). - Each entry in the dict specifies an API key. - The dict key is the name of the security scheme in the OAS specification. - The dict value is the API key secret. - :param api_key_prefix: Dict to store API prefix (e.g. Bearer) - The dict key is the name of the security scheme in the OAS specification. - The dict value is an API key prefix when generating the auth data. - :param username: Username for HTTP basic authentication - :param password: Password for HTTP basic authentication - :param disabled_client_side_validations (string): Comma-separated list of - JSON schema validation keywords to disable JSON schema structural validation - rules. The following keywords may be specified: multipleOf, maximum, - exclusiveMaximum, minimum, exclusiveMinimum, maxLength, minLength, pattern, - maxItems, minItems. - By default, the validation is performed for data generated locally by the client - and data received from the server, independent of any validation performed by - the server side. If the input data does not satisfy the JSON schema validation - rules specified in the OpenAPI document, an exception is raised. - If disabled_client_side_validations is set, structural validation is - disabled. This can be useful to troubleshoot data validation problem, such as - when the OpenAPI document validation rules do not match the actual API data - received by the server. - :param server_index: Index to servers configuration. - :param server_variables: Mapping with string values to replace variables in - templated server configuration. The validation of enums is performed for - variables with defined enum values before. - :param server_operation_index: Mapping from operation ID to an index to server - configuration. - :param server_operation_variables: Mapping from operation ID to a mapping with - string values to replace variables in templated server configuration. - The validation of enums is performed for variables with defined enum values before. - - """ - - _default = None - - def __init__( - self, - host=None, - disabled_client_side_validations="", - server_index=None, - server_variables=None, - server_operation_index=None, - server_operation_variables=None, - ): - """Constructor - """ - self._base_path = "http://localhost:3000" if host is None else host - """Default Base url - """ - self.server_index = 0 if server_index is None and host is None else server_index - self.server_operation_index = server_operation_index or {} - """Default server index - """ - self.server_variables = server_variables or {} - self.server_operation_variables = server_operation_variables or {} - """Default server variables - """ - self.temp_folder_path = None - """Temp file folder for downloading files - """ - # Authentication Settings - self.disabled_client_side_validations = disabled_client_side_validations - self.logger = {} - """Logging Settings - """ - self.logger["package_logger"] = logging.getLogger("this_package") - self.logger["urllib3_logger"] = logging.getLogger("urllib3") - self.logger_format = '%(asctime)s %(levelname)s %(message)s' - """Log format - """ - self.logger_stream_handler = None - """Log stream handler - """ - self.logger_file_handler = None - """Log file handler - """ - self.logger_file = None - """Debug file location - """ - self.debug = False - """Debug switch - """ - - self.verify_ssl = True - """SSL/TLS verification - Set this to false to skip verifying SSL certificate when calling API - from https server. - """ - self.ssl_ca_cert = None - """Set this to customize the certificate file to verify the peer. - """ - self.cert_file = None - """client certificate file - """ - self.key_file = None - """client key file - """ - self.assert_hostname = None - """Set this to True/False to enable/disable SSL hostname verification. - """ - - self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 - """urllib3 connection pool's maximum number of connections saved - per pool. urllib3 uses 1 connection as default value, but this is - not the best value when you are making a lot of possibly parallel - requests to the same host, which is often the case here. - cpu_count * 5 is used as default value to increase performance. - """ - - self.proxy = None - """Proxy URL - """ - self.proxy_headers = None - """Proxy headers - """ - self.safe_chars_for_path_param = '' - """Safe chars for path_param - """ - self.retries = None - """Adding retries to override urllib3 default value 3 - """ - # Enable client side validation - self.client_side_validation = True - - # Options to pass down to the underlying urllib3 socket - self.socket_options = None - - def __deepcopy__(self, memo): - cls = self.__class__ - result = cls.__new__(cls) - memo[id(self)] = result - for k, v in self.__dict__.items(): - if k not in ('logger', 'logger_file_handler'): - setattr(result, k, copy.deepcopy(v, memo)) - # shallow copy of loggers - result.logger = copy.copy(self.logger) - # use setters to configure loggers - result.logger_file = self.logger_file - result.debug = self.debug - return result - - def __setattr__(self, name, value): - object.__setattr__(self, name, value) - if name == 'disabled_client_side_validations': - s = set(filter(None, value.split(','))) - for v in s: - if v not in JSON_SCHEMA_VALIDATION_KEYWORDS: - raise ApiValueError( - "Invalid keyword: '{0}''".format(v)) - self._disabled_client_side_validations = s - - @classmethod - def set_default(cls, default): - """Set default instance of configuration. - - It stores default configuration, which can be - returned by get_default_copy method. - - :param default: object of Configuration - """ - cls._default = copy.deepcopy(default) - - @classmethod - def get_default_copy(cls): - """Return new instance of configuration. - - This method returns newly created, based on default constructor, - object of Configuration class or returns a copy of default - configuration passed by the set_default method. - - :return: The configuration object. - """ - if cls._default is not None: - return copy.deepcopy(cls._default) - return Configuration() - - @property - def logger_file(self): - """The logger file. - - If the logger_file is None, then add stream handler and remove file - handler. Otherwise, add file handler and remove stream handler. - - :param value: The logger_file path. - :type: str - """ - return self.__logger_file - - @logger_file.setter - def logger_file(self, value): - """The logger file. - - If the logger_file is None, then add stream handler and remove file - handler. Otherwise, add file handler and remove stream handler. - - :param value: The logger_file path. - :type: str - """ - self.__logger_file = value - if self.__logger_file: - # If set logging file, - # then add file handler and remove stream handler. - self.logger_file_handler = logging.FileHandler(self.__logger_file) - self.logger_file_handler.setFormatter(self.logger_formatter) - for _, logger in self.logger.items(): - logger.addHandler(self.logger_file_handler) - - @property - def debug(self): - """Debug status - - :param value: The debug status, True or False. - :type: bool - """ - return self.__debug - - @debug.setter - def debug(self, value): - """Debug status - - :param value: The debug status, True or False. - :type: bool - """ - self.__debug = value - if self.__debug: - # if debug status is True, turn on debug logging - for _, logger in self.logger.items(): - logger.setLevel(logging.DEBUG) - # turn on http_client debug - http_client.HTTPConnection.debuglevel = 1 - else: - # if debug status is False, turn off debug logging, - # setting log level to default `logging.WARNING` - for _, logger in self.logger.items(): - logger.setLevel(logging.WARNING) - # turn off http_client debug - http_client.HTTPConnection.debuglevel = 0 - - @property - def logger_format(self): - """The logger format. - - The logger_formatter will be updated when sets logger_format. - - :param value: The format string. - :type: str - """ - return self.__logger_format - - @logger_format.setter - def logger_format(self, value): - """The logger format. - - The logger_formatter will be updated when sets logger_format. - - :param value: The format string. - :type: str - """ - self.__logger_format = value - self.logger_formatter = logging.Formatter(self.__logger_format) - - def get_api_key_with_prefix(self, identifier, alias=None): - """Gets API key (with prefix if set). - - :param identifier: The identifier of apiKey. - :param alias: The alternative identifier of apiKey. - :return: The token for api key authentication. - """ - if self.refresh_api_key_hook is not None: - self.refresh_api_key_hook(self) - key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None) - if key: - prefix = self.api_key_prefix.get(identifier) - if prefix: - return "%s %s" % (prefix, key) - else: - return key - - def get_basic_auth_token(self): - """Gets HTTP basic authentication header (string). - - :return: The token for basic HTTP authentication. - """ - username = "" - if self.username is not None: - username = self.username - password = "" - if self.password is not None: - password = self.password - return urllib3.util.make_headers( - basic_auth=username + ':' + password - ).get('authorization') - - def auth_settings(self): - """Gets Auth Settings dict for api client. - - :return: The Auth Settings information dict. - """ - auth = {} - return auth - - def to_debug_report(self): - """Gets the essential information for debugging. - - :return: The report for debugging. - """ - return "Python SDK Debug Report:\n"\ - "OS: {env}\n"\ - "Python Version: {pyversion}\n"\ - "Version of the API: 1.0\n"\ - "SDK Package Version: 1.0.0".\ - format(env=sys.platform, pyversion=sys.version) - - def get_host_settings(self): - """Gets an array of host settings - - :return: An array of host settings - """ - return [ - { - 'url': "http://localhost:3000", - 'description': "No description provided", - } - ] - - def get_host_from_settings(self, index, variables=None, servers=None): - """Gets host URL based on the index and variables - :param index: array index of the host settings - :param variables: hash of variable and the corresponding value - :param servers: an array of host settings or None - :return: URL based on host settings - """ - if index is None: - return self._base_path - - variables = {} if variables is None else variables - servers = self.get_host_settings() if servers is None else servers - - try: - server = servers[index] - except IndexError: - raise ValueError( - "Invalid index {0} when selecting the host settings. " - "Must be less than {1}".format(index, len(servers))) - - url = server['url'] - - # go through variables and replace placeholders - for variable_name, variable in server.get('variables', {}).items(): - used_value = variables.get( - variable_name, variable['default_value']) - - if 'enum_values' in variable \ - and used_value not in variable['enum_values']: - raise ValueError( - "The variable `{0}` in the host URL has invalid value " - "{1}. Must be {2}.".format( - variable_name, variables[variable_name], - variable['enum_values'])) - - url = url.replace("{" + variable_name + "}", used_value) - - return url - - @property - def host(self): - """Return generated host.""" - return self.get_host_from_settings(self.server_index, variables=self.server_variables) - - @host.setter - def host(self, value): - """Fix base path.""" - self._base_path = value - self.server_index = None diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/exceptions.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/exceptions.py deleted file mode 100644 index de61e44225e..00000000000 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/exceptions.py +++ /dev/null @@ -1,147 +0,0 @@ -# coding: utf-8 - -""" - discriminator-test - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 - - The version of the OpenAPI document: 1.0 - Generated by: https://openapi-generator.tech -""" -import dataclasses -import typing - -from urllib3._collections import HTTPHeaderDict - - -class OpenApiException(Exception): - """The base exception class for all OpenAPIExceptions""" - - -class ApiTypeError(OpenApiException, TypeError): - def __init__(self, msg, path_to_item=None, valid_classes=None, - key_type=None): - """ Raises an exception for TypeErrors - - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (list): a list of keys an indices to get to the - current_item - None if unset - valid_classes (tuple): the primitive classes that current item - should be an instance of - None if unset - key_type (bool): False if our value is a value in a dict - True if it is a key in a dict - False if our item is an item in a list - None if unset - """ - self.path_to_item = path_to_item - self.valid_classes = valid_classes - self.key_type = key_type - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiTypeError, self).__init__(full_msg) - - -class ApiValueError(OpenApiException, ValueError): - def __init__(self, msg, path_to_item=None): - """ - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (list) the path to the exception in the - received_data dict. None if unset - """ - - self.path_to_item = path_to_item - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiValueError, self).__init__(full_msg) - - -class ApiAttributeError(OpenApiException, AttributeError): - def __init__(self, msg, path_to_item=None): - """ - Raised when an attribute reference or assignment fails. - - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (None/list) the path to the exception in the - received_data dict - """ - self.path_to_item = path_to_item - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiAttributeError, self).__init__(full_msg) - - -class ApiKeyError(OpenApiException, KeyError): - def __init__(self, msg, path_to_item=None): - """ - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (None/list) the path to the exception in the - received_data dict - """ - self.path_to_item = path_to_item - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiKeyError, self).__init__(full_msg) - - -T = typing.TypeVar("T") - - -@dataclasses.dataclass -class ApiException(OpenApiException, typing.Generic[T]): - status: int - reason: str - api_response: typing.Optional[T] = None - - @property - def body(self) -> typing.Union[str, bytes, None]: - if not self.api_response: - return None - return self.api_response.response.data - - @property - def headers(self) -> typing.Optional[HTTPHeaderDict]: - if not self.api_response: - return None - return self.api_response.response.getheaders() - - def __str__(self): - """Custom error messages for exception""" - error_message = "({0})\n"\ - "Reason: {1}\n".format(self.status, self.reason) - if self.headers: - error_message += "HTTP response headers: {0}\n".format( - self.headers) - - if self.body: - error_message += "HTTP response body: {0}\n".format(self.body) - - return error_message - - -def render_path(path_to_item): - """Returns a string representation of a path""" - result = "" - for pth in path_to_item: - if isinstance(pth, int): - result += "[{0}]".format(pth) - else: - result += "['{0}']".format(pth) - return result diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/model/__init__.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/model/__init__.py deleted file mode 100644 index b339018352e..00000000000 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/model/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -# we can not import model classes here because that would create a circular -# reference which would not work in python2 -# do not import all models into this module because that uses a lot of memory and stack frames -# if you need the ability to import all models from one package, import them with -# from this_package.models import ModelA, ModelB diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/model/addition_operator.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/model/addition_operator.py deleted file mode 100644 index a354eed5364..00000000000 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/model/addition_operator.py +++ /dev/null @@ -1,98 +0,0 @@ -# coding: utf-8 - -""" - discriminator-test - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 - - The version of the OpenAPI document: 1.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from this_package import schemas # noqa: F401 - - -class AdditionOperator( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "a", - "b", - "operator_id", - } - - class properties: - a = schemas.Float64Schema - b = schemas.Float64Schema - operator_id = schemas.StrSchema - __annotations__ = { - "a": a, - "b": b, - "operator_id": operator_id, - } - additional_properties = schemas.NotAnyTypeSchema - - a: MetaOapg.properties.a - b: MetaOapg.properties.b - operator_id: MetaOapg.properties.operator_id - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["a"]) -> MetaOapg.properties.a: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["b"]) -> MetaOapg.properties.b: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["operator_id"]) -> MetaOapg.properties.operator_id: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["a"], typing_extensions.Literal["b"], typing_extensions.Literal["operator_id"], ]): - # dict_instance[name] accessor - return super().__getitem__(name) - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["a"]) -> MetaOapg.properties.a: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["b"]) -> MetaOapg.properties.b: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["operator_id"]) -> MetaOapg.properties.operator_id: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["a"], typing_extensions.Literal["b"], typing_extensions.Literal["operator_id"], ]): - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - a: typing.Union[MetaOapg.properties.a, decimal.Decimal, int, float, ], - b: typing.Union[MetaOapg.properties.b, decimal.Decimal, int, float, ], - operator_id: typing.Union[MetaOapg.properties.operator_id, str, ], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'AdditionOperator': - return super().__new__( - cls, - *_args, - a=a, - b=b, - operator_id=operator_id, - _configuration=_configuration, - ) diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/model/addition_operator.pyi b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/model/addition_operator.pyi deleted file mode 100644 index a354eed5364..00000000000 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/model/addition_operator.pyi +++ /dev/null @@ -1,98 +0,0 @@ -# coding: utf-8 - -""" - discriminator-test - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 - - The version of the OpenAPI document: 1.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from this_package import schemas # noqa: F401 - - -class AdditionOperator( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "a", - "b", - "operator_id", - } - - class properties: - a = schemas.Float64Schema - b = schemas.Float64Schema - operator_id = schemas.StrSchema - __annotations__ = { - "a": a, - "b": b, - "operator_id": operator_id, - } - additional_properties = schemas.NotAnyTypeSchema - - a: MetaOapg.properties.a - b: MetaOapg.properties.b - operator_id: MetaOapg.properties.operator_id - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["a"]) -> MetaOapg.properties.a: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["b"]) -> MetaOapg.properties.b: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["operator_id"]) -> MetaOapg.properties.operator_id: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["a"], typing_extensions.Literal["b"], typing_extensions.Literal["operator_id"], ]): - # dict_instance[name] accessor - return super().__getitem__(name) - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["a"]) -> MetaOapg.properties.a: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["b"]) -> MetaOapg.properties.b: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["operator_id"]) -> MetaOapg.properties.operator_id: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["a"], typing_extensions.Literal["b"], typing_extensions.Literal["operator_id"], ]): - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - a: typing.Union[MetaOapg.properties.a, decimal.Decimal, int, float, ], - b: typing.Union[MetaOapg.properties.b, decimal.Decimal, int, float, ], - operator_id: typing.Union[MetaOapg.properties.operator_id, str, ], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'AdditionOperator': - return super().__new__( - cls, - *_args, - a=a, - b=b, - operator_id=operator_id, - _configuration=_configuration, - ) diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/model/operator.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/model/operator.py deleted file mode 100644 index e6f37357f91..00000000000 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/model/operator.py +++ /dev/null @@ -1,79 +0,0 @@ -# coding: utf-8 - -""" - discriminator-test - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 - - The version of the OpenAPI document: 1.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from this_package import schemas # noqa: F401 - - -class Operator( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - @staticmethod - def discriminator(): - return { - 'operator_id': { - 'ADD': AdditionOperator, - 'AdditionOperator': AdditionOperator, - 'SUB': SubtractionOperator, - 'SubtractionOperator': SubtractionOperator, - } - } - - @classmethod - @functools.lru_cache() - def one_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - AdditionOperator, - SubtractionOperator, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Operator': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - -from this_package.model.addition_operator import AdditionOperator -from this_package.model.subtraction_operator import SubtractionOperator diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/model/operator.pyi b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/model/operator.pyi deleted file mode 100644 index e6f37357f91..00000000000 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/model/operator.pyi +++ /dev/null @@ -1,79 +0,0 @@ -# coding: utf-8 - -""" - discriminator-test - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 - - The version of the OpenAPI document: 1.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from this_package import schemas # noqa: F401 - - -class Operator( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - @staticmethod - def discriminator(): - return { - 'operator_id': { - 'ADD': AdditionOperator, - 'AdditionOperator': AdditionOperator, - 'SUB': SubtractionOperator, - 'SubtractionOperator': SubtractionOperator, - } - } - - @classmethod - @functools.lru_cache() - def one_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - AdditionOperator, - SubtractionOperator, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Operator': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - -from this_package.model.addition_operator import AdditionOperator -from this_package.model.subtraction_operator import SubtractionOperator diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/model/subtraction_operator.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/model/subtraction_operator.py deleted file mode 100644 index 9ca1d535114..00000000000 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/model/subtraction_operator.py +++ /dev/null @@ -1,98 +0,0 @@ -# coding: utf-8 - -""" - discriminator-test - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 - - The version of the OpenAPI document: 1.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from this_package import schemas # noqa: F401 - - -class SubtractionOperator( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "a", - "b", - "operator_id", - } - - class properties: - a = schemas.Float64Schema - b = schemas.Float64Schema - operator_id = schemas.StrSchema - __annotations__ = { - "a": a, - "b": b, - "operator_id": operator_id, - } - additional_properties = schemas.NotAnyTypeSchema - - a: MetaOapg.properties.a - b: MetaOapg.properties.b - operator_id: MetaOapg.properties.operator_id - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["a"]) -> MetaOapg.properties.a: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["b"]) -> MetaOapg.properties.b: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["operator_id"]) -> MetaOapg.properties.operator_id: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["a"], typing_extensions.Literal["b"], typing_extensions.Literal["operator_id"], ]): - # dict_instance[name] accessor - return super().__getitem__(name) - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["a"]) -> MetaOapg.properties.a: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["b"]) -> MetaOapg.properties.b: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["operator_id"]) -> MetaOapg.properties.operator_id: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["a"], typing_extensions.Literal["b"], typing_extensions.Literal["operator_id"], ]): - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - a: typing.Union[MetaOapg.properties.a, decimal.Decimal, int, float, ], - b: typing.Union[MetaOapg.properties.b, decimal.Decimal, int, float, ], - operator_id: typing.Union[MetaOapg.properties.operator_id, str, ], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'SubtractionOperator': - return super().__new__( - cls, - *_args, - a=a, - b=b, - operator_id=operator_id, - _configuration=_configuration, - ) diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/model/subtraction_operator.pyi b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/model/subtraction_operator.pyi deleted file mode 100644 index 9ca1d535114..00000000000 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/model/subtraction_operator.pyi +++ /dev/null @@ -1,98 +0,0 @@ -# coding: utf-8 - -""" - discriminator-test - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 - - The version of the OpenAPI document: 1.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from this_package import schemas # noqa: F401 - - -class SubtractionOperator( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "a", - "b", - "operator_id", - } - - class properties: - a = schemas.Float64Schema - b = schemas.Float64Schema - operator_id = schemas.StrSchema - __annotations__ = { - "a": a, - "b": b, - "operator_id": operator_id, - } - additional_properties = schemas.NotAnyTypeSchema - - a: MetaOapg.properties.a - b: MetaOapg.properties.b - operator_id: MetaOapg.properties.operator_id - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["a"]) -> MetaOapg.properties.a: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["b"]) -> MetaOapg.properties.b: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["operator_id"]) -> MetaOapg.properties.operator_id: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["a"], typing_extensions.Literal["b"], typing_extensions.Literal["operator_id"], ]): - # dict_instance[name] accessor - return super().__getitem__(name) - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["a"]) -> MetaOapg.properties.a: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["b"]) -> MetaOapg.properties.b: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["operator_id"]) -> MetaOapg.properties.operator_id: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["a"], typing_extensions.Literal["b"], typing_extensions.Literal["operator_id"], ]): - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - a: typing.Union[MetaOapg.properties.a, decimal.Decimal, int, float, ], - b: typing.Union[MetaOapg.properties.b, decimal.Decimal, int, float, ], - operator_id: typing.Union[MetaOapg.properties.operator_id, str, ], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'SubtractionOperator': - return super().__new__( - cls, - *_args, - a=a, - b=b, - operator_id=operator_id, - _configuration=_configuration, - ) diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/models/__init__.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/models/__init__.py deleted file mode 100644 index 5eba4cb111e..00000000000 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/models/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -# import all models into this package -# if you have many models here with many references from one model to another this may -# raise a RecursionError -# to avoid this, import only the models that you directly need like: -# from from this_package.model.pet import Pet -# or import this package, but before doing it, use: -# import sys -# sys.setrecursionlimit(n) - -from this_package.model.addition_operator import AdditionOperator -from this_package.model.operator import Operator -from this_package.model.subtraction_operator import SubtractionOperator diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/paths/__init__.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/paths/__init__.py deleted file mode 100644 index 8c39139e50a..00000000000 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/paths/__init__.py +++ /dev/null @@ -1,9 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from this_package.apis.path_to_api import path_to_api - -import enum - - -class PathValues(str, enum.Enum): - OPERATORS = "/operators" diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/paths/operators/__init__.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/paths/operators/__init__.py deleted file mode 100644 index 84782ebb78c..00000000000 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/paths/operators/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from this_package.paths.operators import Api - -from this_package.paths import PathValues - -path = PathValues.OPERATORS \ No newline at end of file diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/paths/operators/post.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/paths/operators/post.py deleted file mode 100644 index 7d81432d33d..00000000000 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/paths/operators/post.py +++ /dev/null @@ -1,299 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from this_package import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from this_package import schemas # noqa: F401 - -from this_package.model.operator import Operator - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = Operator - - -request_body_operator = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _post_operators_oapg( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_operators_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_operators_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_operators_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_operators_oapg( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - _fields = None - _body = None - if body is not schemas.unset: - serialized_data = request_body_operator.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostOperators(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_operators( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_operators( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_operators( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_operators( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_operators( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_operators_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_operators_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/paths/operators/post.pyi b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/paths/operators/post.pyi deleted file mode 100644 index fc73d02ad14..00000000000 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/paths/operators/post.pyi +++ /dev/null @@ -1,294 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from this_package import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from this_package import schemas # noqa: F401 - -from this_package.model.operator import Operator - -# body param -SchemaForRequestBodyApplicationJson = Operator - - -request_body_operator = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _post_operators_oapg( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _post_operators_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _post_operators_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _post_operators_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _post_operators_oapg( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - _fields = None - _body = None - if body is not schemas.unset: - serialized_data = request_body_operator.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PostOperators(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def post_operators( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post_operators( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post_operators( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post_operators( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post_operators( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_operators_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._post_operators_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/rest.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/rest.py deleted file mode 100644 index 4064705e2ff..00000000000 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/rest.py +++ /dev/null @@ -1,253 +0,0 @@ -# coding: utf-8 - -""" - discriminator-test - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 - - The version of the OpenAPI document: 1.0 - Generated by: https://openapi-generator.tech -""" - -import logging -import ssl -from urllib.parse import urlencode -import typing - -import certifi -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from this_package.exceptions import ApiException, ApiValueError - - -logger = logging.getLogger(__name__) - - -class RESTClientObject(object): - - def __init__(self, configuration, pools_size=4, maxsize=None): - # urllib3.PoolManager will pass all kw parameters to connectionpool - # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 - # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 - # maxsize is the number of requests to host that are allowed in parallel # noqa: E501 - # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 - - # cert_reqs - if configuration.verify_ssl: - cert_reqs = ssl.CERT_REQUIRED - else: - cert_reqs = ssl.CERT_NONE - - # ca_certs - if configuration.ssl_ca_cert: - ca_certs = configuration.ssl_ca_cert - else: - # if not set certificate file, use Mozilla's root certificates. - ca_certs = certifi.where() - - addition_pool_args = {} - if configuration.assert_hostname is not None: - addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 - - if configuration.retries is not None: - addition_pool_args['retries'] = configuration.retries - - if configuration.socket_options is not None: - addition_pool_args['socket_options'] = configuration.socket_options - - if maxsize is None: - if configuration.connection_pool_maxsize is not None: - maxsize = configuration.connection_pool_maxsize - else: - maxsize = 4 - - # https pool manager - if configuration.proxy: - self.pool_manager = urllib3.ProxyManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=ca_certs, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - proxy_url=configuration.proxy, - proxy_headers=configuration.proxy_headers, - **addition_pool_args - ) - else: - self.pool_manager = urllib3.PoolManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=ca_certs, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - **addition_pool_args - ) - - def request( - self, - method: str, - url: str, - headers: typing.Optional[HTTPHeaderDict] = None, - fields: typing.Optional[typing.Tuple[typing.Tuple[str, typing.Any], ...]] = None, - body: typing.Optional[typing.Union[str, bytes]] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> urllib3.HTTPResponse: - """Perform requests. - - :param method: http request method - :param url: http request url - :param headers: http request headers - :param body: request body, for other types - :param fields: request parameters for - `application/x-www-form-urlencoded` - or `multipart/form-data` - :param stream: if True, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is False. - :param timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - """ - method = method.upper() - assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', - 'PATCH', 'OPTIONS'] - - if fields and body: - raise ApiValueError( - "body parameter cannot be used with fields parameter." - ) - - fields = fields or {} - headers = headers or {} - - if timeout: - if isinstance(timeout, (int, float)): # noqa: E501,F821 - timeout = urllib3.Timeout(total=timeout) - elif (isinstance(timeout, tuple) and - len(timeout) == 2): - timeout = urllib3.Timeout(connect=timeout[0], read=timeout[1]) - - try: - # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` - if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: - if 'Content-Type' not in headers and body is None: - r = self.pool_manager.request( - method, - url, - preload_content=not stream, - timeout=timeout, - headers=headers - ) - elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 - r = self.pool_manager.request( - method, url, - body=body, - encode_multipart=False, - preload_content=not stream, - timeout=timeout, - headers=headers) - elif headers['Content-Type'] == 'multipart/form-data': - # must del headers['Content-Type'], or the correct - # Content-Type which generated by urllib3 will be - # overwritten. - del headers['Content-Type'] - r = self.pool_manager.request( - method, url, - fields=fields, - encode_multipart=True, - preload_content=not stream, - timeout=timeout, - headers=headers) - # Pass a `string` parameter directly in the body to support - # other content types than Json when `body` argument is - # provided in serialized form - elif isinstance(body, str) or isinstance(body, bytes): - request_body = body - r = self.pool_manager.request( - method, url, - body=request_body, - preload_content=not stream, - timeout=timeout, - headers=headers) - else: - # Cannot generate the request from given parameters - msg = """Cannot prepare a request message for provided - arguments. Please check that your arguments match - declared content type.""" - raise ApiException(status=0, reason=msg) - # For `GET`, `HEAD` - else: - r = self.pool_manager.request(method, url, - preload_content=not stream, - timeout=timeout, - headers=headers) - except urllib3.exceptions.SSLError as e: - msg = "{0}\n{1}".format(type(e).__name__, str(e)) - raise ApiException(status=0, reason=msg) - - if not stream: - # log response body - logger.debug("response body: %s", r.data) - - return r - - def GET(self, url, headers=None, stream=False, - timeout=None, fields=None) -> urllib3.HTTPResponse: - return self.request("GET", url, - headers=headers, - stream=stream, - timeout=timeout, - fields=fields) - - def HEAD(self, url, headers=None, stream=False, - timeout=None, fields=None) -> urllib3.HTTPResponse: - return self.request("HEAD", url, - headers=headers, - stream=stream, - timeout=timeout, - fields=fields) - - def OPTIONS(self, url, headers=None, - body=None, stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: - return self.request("OPTIONS", url, - headers=headers, - stream=stream, - timeout=timeout, - body=body, fields=fields) - - def DELETE(self, url, headers=None, body=None, - stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: - return self.request("DELETE", url, - headers=headers, - stream=stream, - timeout=timeout, - body=body, fields=fields) - - def POST(self, url, headers=None, - body=None, stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: - return self.request("POST", url, - headers=headers, - stream=stream, - timeout=timeout, - body=body, fields=fields) - - def PUT(self, url, headers=None, - body=None, stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: - return self.request("PUT", url, - headers=headers, - stream=stream, - timeout=timeout, - body=body, fields=fields) - - def PATCH(self, url, headers=None, - body=None, stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: - return self.request("PATCH", url, - headers=headers, - stream=stream, - timeout=timeout, - body=body, fields=fields) diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/schemas.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/schemas.py deleted file mode 100644 index 5e117f6df3a..00000000000 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/schemas.py +++ /dev/null @@ -1,2501 +0,0 @@ -# coding: utf-8 - -""" - discriminator-test - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 - - The version of the OpenAPI document: 1.0 - Generated by: https://openapi-generator.tech -""" - -from collections import defaultdict -from datetime import date, datetime, timedelta # noqa: F401 -import functools -import decimal -import io -import re -import types -import typing -import uuid - -from dateutil.parser.isoparser import isoparser, _takes_ascii -import frozendict - -from this_package.exceptions import ( - ApiTypeError, - ApiValueError, -) -from this_package.configuration import ( - Configuration, -) - - -class Unset(object): - """ - An instance of this class is set as the default value for object type(dict) properties that are optional - When a property has an unset value, that property will not be assigned in the dict - """ - pass - -unset = Unset() - -none_type = type(None) -file_type = io.IOBase - - -class FileIO(io.FileIO): - """ - A class for storing files - Note: this class is not immutable - """ - - def __new__(cls, _arg: typing.Union[io.FileIO, io.BufferedReader]): - if isinstance(_arg, (io.FileIO, io.BufferedReader)): - if _arg.closed: - raise ApiValueError('Invalid file state; file is closed and must be open') - _arg.close() - inst = super(FileIO, cls).__new__(cls, _arg.name) - super(FileIO, inst).__init__(_arg.name) - return inst - raise ApiValueError('FileIO must be passed _arg which contains the open file') - - def __init__(self, _arg: typing.Union[io.FileIO, io.BufferedReader]): - pass - - -def update(d: dict, u: dict): - """ - Adds u to d - Where each dict is defaultdict(set) - """ - if not u: - return d - for k, v in u.items(): - if k not in d: - d[k] = v - else: - d[k] = d[k] | v - - -class ValidationMetadata(frozendict.frozendict): - """ - A class storing metadata that is needed to validate OpenApi Schema payloads - """ - def __new__( - cls, - path_to_item: typing.Tuple[typing.Union[str, int], ...] = tuple(['args[0]']), - from_server: bool = False, - configuration: typing.Optional[Configuration] = None, - seen_classes: typing.FrozenSet[typing.Type] = frozenset(), - validated_path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Type]] = frozendict.frozendict() - ): - """ - Args: - path_to_item: the path to the current data being instantiated. - For {'a': [1]} if the code is handling, 1, then the path is ('args[0]', 'a', 0) - This changes from location to location - from_server: whether or not this data came form the server - True when receiving server data - False when instantiating model with client side data not form the server - This does not change from location to location - configuration: the Configuration instance to use - This is needed because in Configuration: - - one can disable validation checking - This does not change from location to location - seen_classes: when deserializing data that matches multiple schemas, this is used to store - the schemas that have been traversed. This is used to stop processing when a cycle is seen. - This changes from location to location - validated_path_to_schemas: stores the already validated schema classes for a given path location - This does not change from location to location - """ - return super().__new__( - cls, - path_to_item=path_to_item, - from_server=from_server, - configuration=configuration, - seen_classes=seen_classes, - validated_path_to_schemas=validated_path_to_schemas - ) - - def validation_ran_earlier(self, cls: type) -> bool: - validated_schemas = self.validated_path_to_schemas.get(self.path_to_item, set()) - validation_ran_earlier = validated_schemas and cls in validated_schemas - if validation_ran_earlier: - return True - if cls in self.seen_classes: - return True - return False - - @property - def path_to_item(self) -> typing.Tuple[typing.Union[str, int], ...]: - return self.get('path_to_item') - - @property - def from_server(self) -> bool: - return self.get('from_server') - - @property - def configuration(self) -> typing.Optional[Configuration]: - return self.get('configuration') - - @property - def seen_classes(self) -> typing.FrozenSet[typing.Type]: - return self.get('seen_classes') - - @property - def validated_path_to_schemas(self) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Type]]: - return self.get('validated_path_to_schemas') - - -def add_deeper_validated_schemas(validation_metadata: ValidationMetadata, path_to_schemas: dict): - # this is called if validation_ran_earlier and current and deeper locations need to be added - current_path_to_item = validation_metadata.path_to_item - other_path_to_schemas = {} - for path_to_item, schemas in validation_metadata.validated_path_to_schemas.items(): - if len(path_to_item) < len(current_path_to_item): - continue - path_begins_with_current_path = path_to_item[:len(current_path_to_item)] == current_path_to_item - if path_begins_with_current_path: - other_path_to_schemas[path_to_item] = schemas - update(path_to_schemas, other_path_to_schemas) - - -class Singleton: - """ - Enums and singletons are the same - The same instance is returned for a given key of (cls, _arg) - """ - _instances = {} - - def __new__(cls, _arg: typing.Any, **kwargs): - """ - cls base classes: BoolClass, NoneClass, str, decimal.Decimal - The 3rd key is used in the tuple below for a corner case where an enum contains integer 1 - However 1.0 can also be ingested into that enum schema because 1.0 == 1 and - Decimal('1.0') == Decimal('1') - But if we omitted the 3rd value in the key, then Decimal('1.0') would be stored as Decimal('1') - and json serializing that instance would be '1' rather than the expected '1.0' - Adding the 3rd value, the str of _arg ensures that 1.0 -> Decimal('1.0') which is serialized as 1.0 - """ - key = (cls, _arg, str(_arg)) - if key not in cls._instances: - if isinstance(_arg, (none_type, bool, BoolClass, NoneClass)): - inst = super().__new__(cls) - cls._instances[key] = inst - else: - cls._instances[key] = super().__new__(cls, _arg) - return cls._instances[key] - - def __repr__(self): - if isinstance(self, NoneClass): - return f'<{self.__class__.__name__}: None>' - elif isinstance(self, BoolClass): - if bool(self): - return f'<{self.__class__.__name__}: True>' - return f'<{self.__class__.__name__}: False>' - return f'<{self.__class__.__name__}: {super().__repr__()}>' - - -class classproperty: - - def __init__(self, fget): - self.fget = fget - - def __get__(self, owner_self, owner_cls): - return self.fget(owner_cls) - - -class NoneClass(Singleton): - @classproperty - def NONE(cls): - return cls(None) - - def __bool__(self) -> bool: - return False - - -class BoolClass(Singleton): - @classproperty - def TRUE(cls): - return cls(True) - - @classproperty - def FALSE(cls): - return cls(False) - - @functools.lru_cache() - def __bool__(self) -> bool: - for key, instance in self._instances.items(): - if self is instance: - return bool(key[1]) - raise ValueError('Unable to find the boolean value of this instance') - - -class MetaOapgTyped: - exclusive_maximum: typing.Union[int, float] - inclusive_maximum: typing.Union[int, float] - exclusive_minimum: typing.Union[int, float] - inclusive_minimum: typing.Union[int, float] - max_items: int - min_items: int - discriminator: typing.Dict[str, typing.Dict[str, typing.Type['Schema']]] - - - class properties: - # to hold object properties - pass - - additional_properties: typing.Optional[typing.Type['Schema']] - max_properties: int - min_properties: int - all_of: typing.List[typing.Type['Schema']] - one_of: typing.List[typing.Type['Schema']] - any_of: typing.List[typing.Type['Schema']] - not_schema: typing.Type['Schema'] - max_length: int - min_length: int - items: typing.Type['Schema'] - - -class Schema: - """ - the base class of all swagger/openapi schemas/models - """ - __inheritable_primitive_types_set = {decimal.Decimal, str, tuple, frozendict.frozendict, FileIO, bytes, BoolClass, NoneClass} - _types: typing.Set[typing.Type] - MetaOapg = MetaOapgTyped - - @staticmethod - def __get_valid_classes_phrase(input_classes): - """Returns a string phrase describing what types are allowed""" - all_classes = list(input_classes) - all_classes = sorted(all_classes, key=lambda cls: cls.__name__) - all_class_names = [cls.__name__ for cls in all_classes] - if len(all_class_names) == 1: - return "is {0}".format(all_class_names[0]) - return "is one of [{0}]".format(", ".join(all_class_names)) - - @staticmethod - def _get_class_oapg(item_cls: typing.Union[types.FunctionType, staticmethod, typing.Type['Schema']]) -> typing.Type['Schema']: - if isinstance(item_cls, types.FunctionType): - # referenced schema - return item_cls() - elif isinstance(item_cls, staticmethod): - # referenced schema - return item_cls.__func__() - return item_cls - - @classmethod - def __type_error_message( - cls, var_value=None, var_name=None, valid_classes=None, key_type=None - ): - """ - Keyword Args: - var_value (any): the variable which has the type_error - var_name (str): the name of the variable which has the typ error - valid_classes (tuple): the accepted classes for current_item's - value - key_type (bool): False if our value is a value in a dict - True if it is a key in a dict - False if our item is an item in a tuple - """ - key_or_value = "value" - if key_type: - key_or_value = "key" - valid_classes_phrase = cls.__get_valid_classes_phrase(valid_classes) - msg = "Invalid type. Required {1} type {2} and " "passed type was {3}".format( - var_name, - key_or_value, - valid_classes_phrase, - type(var_value).__name__, - ) - return msg - - @classmethod - def __get_type_error(cls, var_value, path_to_item, valid_classes, key_type=False): - error_msg = cls.__type_error_message( - var_name=path_to_item[-1], - var_value=var_value, - valid_classes=valid_classes, - key_type=key_type, - ) - return ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=valid_classes, - key_type=key_type, - ) - - @classmethod - def _validate_oapg( - cls, - arg, - validation_metadata: ValidationMetadata, - ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]]: - """ - Schema _validate_oapg - All keyword validation except for type checking was done in calling stack frames - If those validations passed, the validated classes are collected in path_to_schemas - - Returns: - path_to_schemas: a map of path to schemas - - Raises: - ApiValueError: when a string can't be converted into a date or datetime and it must be one of those classes - ApiTypeError: when the input type is not in the list of allowed spec types - """ - base_class = type(arg) - if base_class not in cls._types: - raise cls.__get_type_error( - arg, - validation_metadata.path_to_item, - cls._types, - key_type=False, - ) - - path_to_schemas = {validation_metadata.path_to_item: set()} - path_to_schemas[validation_metadata.path_to_item].add(cls) - path_to_schemas[validation_metadata.path_to_item].add(base_class) - return path_to_schemas - - @staticmethod - def _process_schema_classes_oapg( - schema_classes: typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]] - ): - """ - Processes and mutates schema_classes - If a SomeSchema is a subclass of DictSchema then remove DictSchema because it is already included - """ - if len(schema_classes) < 2: - return - if len(schema_classes) > 2 and UnsetAnyTypeSchema in schema_classes: - schema_classes.remove(UnsetAnyTypeSchema) - x_schema = schema_type_classes & schema_classes - if not x_schema: - return - x_schema = x_schema.pop() - if any(c is not x_schema and issubclass(c, x_schema) for c in schema_classes): - # needed to not have a mro error in get_new_class - schema_classes.remove(x_schema) - - @classmethod - def __get_new_cls( - cls, - arg, - validation_metadata: ValidationMetadata - ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Type['Schema']]: - """ - Make a new dynamic class and return an instance of that class - We are making an instance of cls, but instead of making cls - make a new class, new_cls - which includes dynamic bases including cls - return an instance of that new class - - Dict property + List Item Assignment Use cases: - 1. value is NOT an instance of the required schema class - the value is validated by _validate_oapg - _validate_oapg returns a key value pair - where the key is the path to the item, and the value will be the required manufactured class - made out of the matching schemas - 2. value is an instance of the correct schema type - the value is NOT validated by _validate_oapg, _validate_oapg only checks that the instance is of the correct schema type - for this value, _validate_oapg does NOT return an entry for it in _path_to_schemas - and in list/dict _get_items_oapg,_get_properties_oapg the value will be directly assigned - because value is of the correct type, and validation was run earlier when the instance was created - """ - _path_to_schemas = {} - if validation_metadata.validation_ran_earlier(cls): - add_deeper_validated_schemas(validation_metadata, _path_to_schemas) - else: - other_path_to_schemas = cls._validate_oapg(arg, validation_metadata=validation_metadata) - update(_path_to_schemas, other_path_to_schemas) - # loop through it make a new class for each entry - # do not modify the returned result because it is cached and we would be modifying the cached value - path_to_schemas = {} - for path, schema_classes in _path_to_schemas.items(): - """ - Use cases - 1. N number of schema classes + enum + type != bool/None, classes in path_to_schemas: tuple/frozendict.frozendict/str/Decimal/bytes/FileIo - needs Singleton added - 2. N number of schema classes + enum + type == bool/None, classes in path_to_schemas: BoolClass/NoneClass - Singleton already added - 3. N number of schema classes, classes in path_to_schemas: BoolClass/NoneClass/tuple/frozendict.frozendict/str/Decimal/bytes/FileIo - """ - cls._process_schema_classes_oapg(schema_classes) - enum_schema = any( - issubclass(this_cls, EnumBase) for this_cls in schema_classes) - inheritable_primitive_type = schema_classes.intersection(cls.__inheritable_primitive_types_set) - chosen_schema_classes = schema_classes - inheritable_primitive_type - suffix = tuple(inheritable_primitive_type) - if enum_schema and suffix[0] not in {NoneClass, BoolClass}: - suffix = (Singleton,) + suffix - - used_classes = tuple(sorted(chosen_schema_classes, key=lambda a_cls: a_cls.__name__)) + suffix - mfg_cls = get_new_class(class_name='DynamicSchema', bases=used_classes) - path_to_schemas[path] = mfg_cls - - return path_to_schemas - - @classmethod - def _get_new_instance_without_conversion_oapg( - cls, - arg: typing.Any, - path_to_item: typing.Tuple[typing.Union[str, int], ...], - path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Type['Schema']] - ): - # We have a Dynamic class and we are making an instance of it - if issubclass(cls, frozendict.frozendict) and issubclass(cls, DictBase): - properties = cls._get_properties_oapg(arg, path_to_item, path_to_schemas) - return super(Schema, cls).__new__(cls, properties) - elif issubclass(cls, tuple) and issubclass(cls, ListBase): - items = cls._get_items_oapg(arg, path_to_item, path_to_schemas) - return super(Schema, cls).__new__(cls, items) - """ - str = openapi str, date, and datetime - decimal.Decimal = openapi int and float - FileIO = openapi binary type and the user inputs a file - bytes = openapi binary type and the user inputs bytes - """ - return super(Schema, cls).__new__(cls, arg) - - @classmethod - def from_openapi_data_oapg( - cls, - arg: typing.Union[ - str, - date, - datetime, - int, - float, - decimal.Decimal, - bool, - None, - 'Schema', - dict, - frozendict.frozendict, - tuple, - list, - io.FileIO, - io.BufferedReader, - bytes - ], - _configuration: typing.Optional[Configuration] - ): - """ - Schema from_openapi_data_oapg - """ - from_server = True - validated_path_to_schemas = {} - arg = cast_to_allowed_types(arg, from_server, validated_path_to_schemas) - validation_metadata = ValidationMetadata( - from_server=from_server, configuration=_configuration, validated_path_to_schemas=validated_path_to_schemas) - path_to_schemas = cls.__get_new_cls(arg, validation_metadata) - new_cls = path_to_schemas[validation_metadata.path_to_item] - new_inst = new_cls._get_new_instance_without_conversion_oapg( - arg, - validation_metadata.path_to_item, - path_to_schemas - ) - return new_inst - - @staticmethod - def __get_input_dict(*args, **kwargs) -> frozendict.frozendict: - input_dict = {} - if args and isinstance(args[0], (dict, frozendict.frozendict)): - input_dict.update(args[0]) - if kwargs: - input_dict.update(kwargs) - return frozendict.frozendict(input_dict) - - @staticmethod - def __remove_unsets(kwargs): - return {key: val for key, val in kwargs.items() if val is not unset} - - def __new__(cls, *_args: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema'], _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema', Unset]): - """ - Schema __new__ - - Args: - _args (int/float/decimal.Decimal/str/list/tuple/dict/frozendict.frozendict/bool/None): the value - kwargs (str, int/float/decimal.Decimal/str/list/tuple/dict/frozendict.frozendict/bool/None): dict values - _configuration: contains the Configuration that enables json schema validation keywords - like minItems, minLength etc - - Note: double underscores are used here because pycharm thinks that these variables - are instance properties if they are named normally :( - """ - __kwargs = cls.__remove_unsets(kwargs) - if not _args and not __kwargs: - raise TypeError( - 'No input given. args or kwargs must be given.' - ) - if not __kwargs and _args and not isinstance(_args[0], dict): - __arg = _args[0] - else: - __arg = cls.__get_input_dict(*_args, **__kwargs) - __from_server = False - __validated_path_to_schemas = {} - __arg = cast_to_allowed_types( - __arg, __from_server, __validated_path_to_schemas) - __validation_metadata = ValidationMetadata( - configuration=_configuration, from_server=__from_server, validated_path_to_schemas=__validated_path_to_schemas) - __path_to_schemas = cls.__get_new_cls(__arg, __validation_metadata) - __new_cls = __path_to_schemas[__validation_metadata.path_to_item] - return __new_cls._get_new_instance_without_conversion_oapg( - __arg, - __validation_metadata.path_to_item, - __path_to_schemas - ) - - def __init__( - self, - *_args: typing.Union[ - dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema'], - _configuration: typing.Optional[Configuration] = None, - **kwargs: typing.Union[ - dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema', Unset - ] - ): - """ - this is needed to fix 'Unexpected argument' warning in pycharm - this code does nothing because all Schema instances are immutable - this means that all input data is passed into and used in new, and after the new instance is made - no new attributes are assigned and init is not used - """ - pass - -""" -import itertools -data_types = ('None', 'FrozenDict', 'Tuple', 'Str', 'Decimal', 'Bool') -type_to_cls = { - 'None': 'NoneClass', - 'FrozenDict': 'frozendict.frozendict', - 'Tuple': 'tuple', - 'Str': 'str', - 'Decimal': 'decimal.Decimal', - 'Bool': 'BoolClass' -} -cls_tuples = [v for v in itertools.combinations(data_types, 5)] -typed_classes = [f"class {''.join(cls_tuple)}Mixin({', '.join(type_to_cls[typ] for typ in cls_tuple)}):\n pass" for cls_tuple in cls_tuples] -for cls in typed_classes: - print(cls) -object_classes = [f"{''.join(cls_tuple)}Mixin = object" for cls_tuple in cls_tuples] -for cls in object_classes: - print(cls) -""" -if typing.TYPE_CHECKING: - # qty 1 - NoneMixin = NoneClass - FrozenDictMixin = frozendict.frozendict - TupleMixin = tuple - StrMixin = str - DecimalMixin = decimal.Decimal - BoolMixin = BoolClass - BytesMixin = bytes - FileMixin = FileIO - # qty 2 - class BinaryMixin(bytes, FileIO): - pass - class NoneFrozenDictMixin(NoneClass, frozendict.frozendict): - pass - class NoneTupleMixin(NoneClass, tuple): - pass - class NoneStrMixin(NoneClass, str): - pass - class NoneDecimalMixin(NoneClass, decimal.Decimal): - pass - class NoneBoolMixin(NoneClass, BoolClass): - pass - class FrozenDictTupleMixin(frozendict.frozendict, tuple): - pass - class FrozenDictStrMixin(frozendict.frozendict, str): - pass - class FrozenDictDecimalMixin(frozendict.frozendict, decimal.Decimal): - pass - class FrozenDictBoolMixin(frozendict.frozendict, BoolClass): - pass - class TupleStrMixin(tuple, str): - pass - class TupleDecimalMixin(tuple, decimal.Decimal): - pass - class TupleBoolMixin(tuple, BoolClass): - pass - class StrDecimalMixin(str, decimal.Decimal): - pass - class StrBoolMixin(str, BoolClass): - pass - class DecimalBoolMixin(decimal.Decimal, BoolClass): - pass - # qty 3 - class NoneFrozenDictTupleMixin(NoneClass, frozendict.frozendict, tuple): - pass - class NoneFrozenDictStrMixin(NoneClass, frozendict.frozendict, str): - pass - class NoneFrozenDictDecimalMixin(NoneClass, frozendict.frozendict, decimal.Decimal): - pass - class NoneFrozenDictBoolMixin(NoneClass, frozendict.frozendict, BoolClass): - pass - class NoneTupleStrMixin(NoneClass, tuple, str): - pass - class NoneTupleDecimalMixin(NoneClass, tuple, decimal.Decimal): - pass - class NoneTupleBoolMixin(NoneClass, tuple, BoolClass): - pass - class NoneStrDecimalMixin(NoneClass, str, decimal.Decimal): - pass - class NoneStrBoolMixin(NoneClass, str, BoolClass): - pass - class NoneDecimalBoolMixin(NoneClass, decimal.Decimal, BoolClass): - pass - class FrozenDictTupleStrMixin(frozendict.frozendict, tuple, str): - pass - class FrozenDictTupleDecimalMixin(frozendict.frozendict, tuple, decimal.Decimal): - pass - class FrozenDictTupleBoolMixin(frozendict.frozendict, tuple, BoolClass): - pass - class FrozenDictStrDecimalMixin(frozendict.frozendict, str, decimal.Decimal): - pass - class FrozenDictStrBoolMixin(frozendict.frozendict, str, BoolClass): - pass - class FrozenDictDecimalBoolMixin(frozendict.frozendict, decimal.Decimal, BoolClass): - pass - class TupleStrDecimalMixin(tuple, str, decimal.Decimal): - pass - class TupleStrBoolMixin(tuple, str, BoolClass): - pass - class TupleDecimalBoolMixin(tuple, decimal.Decimal, BoolClass): - pass - class StrDecimalBoolMixin(str, decimal.Decimal, BoolClass): - pass - # qty 4 - class NoneFrozenDictTupleStrMixin(NoneClass, frozendict.frozendict, tuple, str): - pass - class NoneFrozenDictTupleDecimalMixin(NoneClass, frozendict.frozendict, tuple, decimal.Decimal): - pass - class NoneFrozenDictTupleBoolMixin(NoneClass, frozendict.frozendict, tuple, BoolClass): - pass - class NoneFrozenDictStrDecimalMixin(NoneClass, frozendict.frozendict, str, decimal.Decimal): - pass - class NoneFrozenDictStrBoolMixin(NoneClass, frozendict.frozendict, str, BoolClass): - pass - class NoneFrozenDictDecimalBoolMixin(NoneClass, frozendict.frozendict, decimal.Decimal, BoolClass): - pass - class NoneTupleStrDecimalMixin(NoneClass, tuple, str, decimal.Decimal): - pass - class NoneTupleStrBoolMixin(NoneClass, tuple, str, BoolClass): - pass - class NoneTupleDecimalBoolMixin(NoneClass, tuple, decimal.Decimal, BoolClass): - pass - class NoneStrDecimalBoolMixin(NoneClass, str, decimal.Decimal, BoolClass): - pass - class FrozenDictTupleStrDecimalMixin(frozendict.frozendict, tuple, str, decimal.Decimal): - pass - class FrozenDictTupleStrBoolMixin(frozendict.frozendict, tuple, str, BoolClass): - pass - class FrozenDictTupleDecimalBoolMixin(frozendict.frozendict, tuple, decimal.Decimal, BoolClass): - pass - class FrozenDictStrDecimalBoolMixin(frozendict.frozendict, str, decimal.Decimal, BoolClass): - pass - class TupleStrDecimalBoolMixin(tuple, str, decimal.Decimal, BoolClass): - pass - # qty 5 - class NoneFrozenDictTupleStrDecimalMixin(NoneClass, frozendict.frozendict, tuple, str, decimal.Decimal): - pass - class NoneFrozenDictTupleStrBoolMixin(NoneClass, frozendict.frozendict, tuple, str, BoolClass): - pass - class NoneFrozenDictTupleDecimalBoolMixin(NoneClass, frozendict.frozendict, tuple, decimal.Decimal, BoolClass): - pass - class NoneFrozenDictStrDecimalBoolMixin(NoneClass, frozendict.frozendict, str, decimal.Decimal, BoolClass): - pass - class NoneTupleStrDecimalBoolMixin(NoneClass, tuple, str, decimal.Decimal, BoolClass): - pass - class FrozenDictTupleStrDecimalBoolMixin(frozendict.frozendict, tuple, str, decimal.Decimal, BoolClass): - pass - # qty 6 - class NoneFrozenDictTupleStrDecimalBoolMixin(NoneClass, frozendict.frozendict, tuple, str, decimal.Decimal, BoolClass): - pass - # qty 8 - class NoneFrozenDictTupleStrDecimalBoolFileBytesMixin(NoneClass, frozendict.frozendict, tuple, str, decimal.Decimal, BoolClass, FileIO, bytes): - pass -else: - # qty 1 - class NoneMixin: - _types = {NoneClass} - class FrozenDictMixin: - _types = {frozendict.frozendict} - class TupleMixin: - _types = {tuple} - class StrMixin: - _types = {str} - class DecimalMixin: - _types = {decimal.Decimal} - class BoolMixin: - _types = {BoolClass} - class BytesMixin: - _types = {bytes} - class FileMixin: - _types = {FileIO} - # qty 2 - class BinaryMixin: - _types = {bytes, FileIO} - class NoneFrozenDictMixin: - _types = {NoneClass, frozendict.frozendict} - class NoneTupleMixin: - _types = {NoneClass, tuple} - class NoneStrMixin: - _types = {NoneClass, str} - class NoneDecimalMixin: - _types = {NoneClass, decimal.Decimal} - class NoneBoolMixin: - _types = {NoneClass, BoolClass} - class FrozenDictTupleMixin: - _types = {frozendict.frozendict, tuple} - class FrozenDictStrMixin: - _types = {frozendict.frozendict, str} - class FrozenDictDecimalMixin: - _types = {frozendict.frozendict, decimal.Decimal} - class FrozenDictBoolMixin: - _types = {frozendict.frozendict, BoolClass} - class TupleStrMixin: - _types = {tuple, str} - class TupleDecimalMixin: - _types = {tuple, decimal.Decimal} - class TupleBoolMixin: - _types = {tuple, BoolClass} - class StrDecimalMixin: - _types = {str, decimal.Decimal} - class StrBoolMixin: - _types = {str, BoolClass} - class DecimalBoolMixin: - _types = {decimal.Decimal, BoolClass} - # qty 3 - class NoneFrozenDictTupleMixin: - _types = {NoneClass, frozendict.frozendict, tuple} - class NoneFrozenDictStrMixin: - _types = {NoneClass, frozendict.frozendict, str} - class NoneFrozenDictDecimalMixin: - _types = {NoneClass, frozendict.frozendict, decimal.Decimal} - class NoneFrozenDictBoolMixin: - _types = {NoneClass, frozendict.frozendict, BoolClass} - class NoneTupleStrMixin: - _types = {NoneClass, tuple, str} - class NoneTupleDecimalMixin: - _types = {NoneClass, tuple, decimal.Decimal} - class NoneTupleBoolMixin: - _types = {NoneClass, tuple, BoolClass} - class NoneStrDecimalMixin: - _types = {NoneClass, str, decimal.Decimal} - class NoneStrBoolMixin: - _types = {NoneClass, str, BoolClass} - class NoneDecimalBoolMixin: - _types = {NoneClass, decimal.Decimal, BoolClass} - class FrozenDictTupleStrMixin: - _types = {frozendict.frozendict, tuple, str} - class FrozenDictTupleDecimalMixin: - _types = {frozendict.frozendict, tuple, decimal.Decimal} - class FrozenDictTupleBoolMixin: - _types = {frozendict.frozendict, tuple, BoolClass} - class FrozenDictStrDecimalMixin: - _types = {frozendict.frozendict, str, decimal.Decimal} - class FrozenDictStrBoolMixin: - _types = {frozendict.frozendict, str, BoolClass} - class FrozenDictDecimalBoolMixin: - _types = {frozendict.frozendict, decimal.Decimal, BoolClass} - class TupleStrDecimalMixin: - _types = {tuple, str, decimal.Decimal} - class TupleStrBoolMixin: - _types = {tuple, str, BoolClass} - class TupleDecimalBoolMixin: - _types = {tuple, decimal.Decimal, BoolClass} - class StrDecimalBoolMixin: - _types = {str, decimal.Decimal, BoolClass} - # qty 4 - class NoneFrozenDictTupleStrMixin: - _types = {NoneClass, frozendict.frozendict, tuple, str} - class NoneFrozenDictTupleDecimalMixin: - _types = {NoneClass, frozendict.frozendict, tuple, decimal.Decimal} - class NoneFrozenDictTupleBoolMixin: - _types = {NoneClass, frozendict.frozendict, tuple, BoolClass} - class NoneFrozenDictStrDecimalMixin: - _types = {NoneClass, frozendict.frozendict, str, decimal.Decimal} - class NoneFrozenDictStrBoolMixin: - _types = {NoneClass, frozendict.frozendict, str, BoolClass} - class NoneFrozenDictDecimalBoolMixin: - _types = {NoneClass, frozendict.frozendict, decimal.Decimal, BoolClass} - class NoneTupleStrDecimalMixin: - _types = {NoneClass, tuple, str, decimal.Decimal} - class NoneTupleStrBoolMixin: - _types = {NoneClass, tuple, str, BoolClass} - class NoneTupleDecimalBoolMixin: - _types = {NoneClass, tuple, decimal.Decimal, BoolClass} - class NoneStrDecimalBoolMixin: - _types = {NoneClass, str, decimal.Decimal, BoolClass} - class FrozenDictTupleStrDecimalMixin: - _types = {frozendict.frozendict, tuple, str, decimal.Decimal} - class FrozenDictTupleStrBoolMixin: - _types = {frozendict.frozendict, tuple, str, BoolClass} - class FrozenDictTupleDecimalBoolMixin: - _types = {frozendict.frozendict, tuple, decimal.Decimal, BoolClass} - class FrozenDictStrDecimalBoolMixin: - _types = {frozendict.frozendict, str, decimal.Decimal, BoolClass} - class TupleStrDecimalBoolMixin: - _types = {tuple, str, decimal.Decimal, BoolClass} - # qty 5 - class NoneFrozenDictTupleStrDecimalMixin: - _types = {NoneClass, frozendict.frozendict, tuple, str, decimal.Decimal} - class NoneFrozenDictTupleStrBoolMixin: - _types = {NoneClass, frozendict.frozendict, tuple, str, BoolClass} - class NoneFrozenDictTupleDecimalBoolMixin: - _types = {NoneClass, frozendict.frozendict, tuple, decimal.Decimal, BoolClass} - class NoneFrozenDictStrDecimalBoolMixin: - _types = {NoneClass, frozendict.frozendict, str, decimal.Decimal, BoolClass} - class NoneTupleStrDecimalBoolMixin: - _types = {NoneClass, tuple, str, decimal.Decimal, BoolClass} - class FrozenDictTupleStrDecimalBoolMixin: - _types = {frozendict.frozendict, tuple, str, decimal.Decimal, BoolClass} - # qty 6 - class NoneFrozenDictTupleStrDecimalBoolMixin: - _types = {NoneClass, frozendict.frozendict, tuple, str, decimal.Decimal, BoolClass} - # qty 8 - class NoneFrozenDictTupleStrDecimalBoolFileBytesMixin: - _types = {NoneClass, frozendict.frozendict, tuple, str, decimal.Decimal, BoolClass, FileIO, bytes} - - -class ValidatorBase: - @staticmethod - def _is_json_validation_enabled_oapg(schema_keyword, configuration=None): - """Returns true if JSON schema validation is enabled for the specified - validation keyword. This can be used to skip JSON schema structural validation - as requested in the configuration. - Note: the suffix _oapg stands for openapi python (experimental) generator and - it has been added to prevent collisions with other methods and properties - - Args: - schema_keyword (string): the name of a JSON schema validation keyword. - configuration (Configuration): the configuration class. - """ - - return (configuration is None or - not hasattr(configuration, '_disabled_client_side_validations') or - schema_keyword not in configuration._disabled_client_side_validations) - - @staticmethod - def _raise_validation_error_message_oapg(value, constraint_msg, constraint_value, path_to_item, additional_txt=""): - raise ApiValueError( - "Invalid value `{value}`, {constraint_msg} `{constraint_value}`{additional_txt} at {path_to_item}".format( - value=value, - constraint_msg=constraint_msg, - constraint_value=constraint_value, - additional_txt=additional_txt, - path_to_item=path_to_item, - ) - ) - - -class EnumBase: - @classmethod - def _validate_oapg( - cls, - arg, - validation_metadata: ValidationMetadata, - ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]]: - """ - EnumBase _validate_oapg - Validates that arg is in the enum's allowed values - """ - try: - cls.MetaOapg.enum_value_to_name[arg] - except KeyError: - raise ApiValueError("Invalid value {} passed in to {}, allowed_values={}".format(arg, cls, cls.MetaOapg.enum_value_to_name.keys())) - return super()._validate_oapg(arg, validation_metadata=validation_metadata) - - -class BoolBase: - def is_true_oapg(self) -> bool: - """ - A replacement for x is True - True if the instance is a BoolClass True Singleton - """ - if not issubclass(self.__class__, BoolClass): - return False - return bool(self) - - def is_false_oapg(self) -> bool: - """ - A replacement for x is False - True if the instance is a BoolClass False Singleton - """ - if not issubclass(self.__class__, BoolClass): - return False - return bool(self) is False - - -class NoneBase: - def is_none_oapg(self) -> bool: - """ - A replacement for x is None - True if the instance is a NoneClass None Singleton - """ - if issubclass(self.__class__, NoneClass): - return True - return False - - -class StrBase(ValidatorBase): - MetaOapg: MetaOapgTyped - - @property - def as_str_oapg(self) -> str: - return self - - @property - def as_date_oapg(self) -> date: - raise Exception('not implemented') - - @property - def as_datetime_oapg(self) -> datetime: - raise Exception('not implemented') - - @property - def as_decimal_oapg(self) -> decimal.Decimal: - raise Exception('not implemented') - - @property - def as_uuid_oapg(self) -> uuid.UUID: - raise Exception('not implemented') - - @classmethod - def __check_str_validations( - cls, - arg: str, - validation_metadata: ValidationMetadata - ): - if not hasattr(cls, 'MetaOapg'): - return - if (cls._is_json_validation_enabled_oapg('maxLength', validation_metadata.configuration) and - hasattr(cls.MetaOapg, 'max_length') and - len(arg) > cls.MetaOapg.max_length): - cls._raise_validation_error_message_oapg( - value=arg, - constraint_msg="length must be less than or equal to", - constraint_value=cls.MetaOapg.max_length, - path_to_item=validation_metadata.path_to_item - ) - - if (cls._is_json_validation_enabled_oapg('minLength', validation_metadata.configuration) and - hasattr(cls.MetaOapg, 'min_length') and - len(arg) < cls.MetaOapg.min_length): - cls._raise_validation_error_message_oapg( - value=arg, - constraint_msg="length must be greater than or equal to", - constraint_value=cls.MetaOapg.min_length, - path_to_item=validation_metadata.path_to_item - ) - - if (cls._is_json_validation_enabled_oapg('pattern', validation_metadata.configuration) and - hasattr(cls.MetaOapg, 'regex')): - for regex_dict in cls.MetaOapg.regex: - flags = regex_dict.get('flags', 0) - if not re.search(regex_dict['pattern'], arg, flags=flags): - if flags != 0: - # Don't print the regex flags if the flags are not - # specified in the OAS document. - cls._raise_validation_error_message_oapg( - value=arg, - constraint_msg="must match regular expression", - constraint_value=regex_dict['pattern'], - path_to_item=validation_metadata.path_to_item, - additional_txt=" with flags=`{}`".format(flags) - ) - cls._raise_validation_error_message_oapg( - value=arg, - constraint_msg="must match regular expression", - constraint_value=regex_dict['pattern'], - path_to_item=validation_metadata.path_to_item - ) - - @classmethod - def _validate_oapg( - cls, - arg, - validation_metadata: ValidationMetadata, - ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]]: - """ - StrBase _validate_oapg - Validates that validations pass - """ - if isinstance(arg, str): - cls.__check_str_validations(arg, validation_metadata) - return super()._validate_oapg(arg, validation_metadata=validation_metadata) - - -class UUIDBase: - @property - @functools.lru_cache() - def as_uuid_oapg(self) -> uuid.UUID: - return uuid.UUID(self) - - @classmethod - def __validate_format(cls, arg: typing.Optional[str], validation_metadata: ValidationMetadata): - if isinstance(arg, str): - try: - uuid.UUID(arg) - return True - except ValueError: - raise ApiValueError( - "Invalid value '{}' for type UUID at {}".format(arg, validation_metadata.path_to_item) - ) - - @classmethod - def _validate_oapg( - cls, - arg, - validation_metadata: typing.Optional[ValidationMetadata] = None, - ): - """ - UUIDBase _validate_oapg - """ - cls.__validate_format(arg, validation_metadata=validation_metadata) - return super()._validate_oapg(arg, validation_metadata=validation_metadata) - - -class CustomIsoparser(isoparser): - - @_takes_ascii - def parse_isodatetime(self, dt_str): - components, pos = self._parse_isodate(dt_str) - if len(dt_str) > pos: - if self._sep is None or dt_str[pos:pos + 1] == self._sep: - components += self._parse_isotime(dt_str[pos + 1:]) - else: - raise ValueError('String contains unknown ISO components') - - if len(components) > 3 and components[3] == 24: - components[3] = 0 - return datetime(*components) + timedelta(days=1) - - if len(components) <= 3: - raise ValueError('Value is not a datetime') - - return datetime(*components) - - @_takes_ascii - def parse_isodate(self, datestr): - components, pos = self._parse_isodate(datestr) - - if len(datestr) > pos: - raise ValueError('String contains invalid time components') - - if len(components) > 3: - raise ValueError('String contains invalid time components') - - return date(*components) - - -DEFAULT_ISOPARSER = CustomIsoparser() - - -class DateBase: - @property - @functools.lru_cache() - def as_date_oapg(self) -> date: - return DEFAULT_ISOPARSER.parse_isodate(self) - - @classmethod - def __validate_format(cls, arg: typing.Optional[str], validation_metadata: ValidationMetadata): - if isinstance(arg, str): - try: - DEFAULT_ISOPARSER.parse_isodate(arg) - return True - except ValueError: - raise ApiValueError( - "Value does not conform to the required ISO-8601 date format. " - "Invalid value '{}' for type date at {}".format(arg, validation_metadata.path_to_item) - ) - - @classmethod - def _validate_oapg( - cls, - arg, - validation_metadata: typing.Optional[ValidationMetadata] = None, - ): - """ - DateBase _validate_oapg - """ - cls.__validate_format(arg, validation_metadata=validation_metadata) - return super()._validate_oapg(arg, validation_metadata=validation_metadata) - - -class DateTimeBase: - @property - @functools.lru_cache() - def as_datetime_oapg(self) -> datetime: - return DEFAULT_ISOPARSER.parse_isodatetime(self) - - @classmethod - def __validate_format(cls, arg: typing.Optional[str], validation_metadata: ValidationMetadata): - if isinstance(arg, str): - try: - DEFAULT_ISOPARSER.parse_isodatetime(arg) - return True - except ValueError: - raise ApiValueError( - "Value does not conform to the required ISO-8601 datetime format. " - "Invalid value '{}' for type datetime at {}".format(arg, validation_metadata.path_to_item) - ) - - @classmethod - def _validate_oapg( - cls, - arg, - validation_metadata: ValidationMetadata, - ): - """ - DateTimeBase _validate_oapg - """ - cls.__validate_format(arg, validation_metadata=validation_metadata) - return super()._validate_oapg(arg, validation_metadata=validation_metadata) - - -class DecimalBase: - """ - A class for storing decimals that are sent over the wire as strings - These schemas must remain based on StrBase rather than NumberBase - because picking base classes must be deterministic - """ - - @property - @functools.lru_cache() - def as_decimal_oapg(self) -> decimal.Decimal: - return decimal.Decimal(self) - - @classmethod - def __validate_format(cls, arg: typing.Optional[str], validation_metadata: ValidationMetadata): - if isinstance(arg, str): - try: - decimal.Decimal(arg) - return True - except decimal.InvalidOperation: - raise ApiValueError( - "Value cannot be converted to a decimal. " - "Invalid value '{}' for type decimal at {}".format(arg, validation_metadata.path_to_item) - ) - - @classmethod - def _validate_oapg( - cls, - arg, - validation_metadata: ValidationMetadata, - ): - """ - DecimalBase _validate_oapg - """ - cls.__validate_format(arg, validation_metadata=validation_metadata) - return super()._validate_oapg(arg, validation_metadata=validation_metadata) - - -class NumberBase(ValidatorBase): - MetaOapg: MetaOapgTyped - - @property - def as_int_oapg(self) -> int: - try: - return self._as_int - except AttributeError: - """ - Note: for some numbers like 9.0 they could be represented as an - integer but our code chooses to store them as - >>> Decimal('9.0').as_tuple() - DecimalTuple(sign=0, digits=(9, 0), exponent=-1) - so we can tell that the value came from a float and convert it back to a float - during later serialization - """ - if self.as_tuple().exponent < 0: - # this could be represented as an integer but should be represented as a float - # because that's what it was serialized from - raise ApiValueError(f'{self} is not an integer') - self._as_int = int(self) - return self._as_int - - @property - def as_float_oapg(self) -> float: - try: - return self._as_float - except AttributeError: - if self.as_tuple().exponent >= 0: - raise ApiValueError(f'{self} is not a float') - self._as_float = float(self) - return self._as_float - - @classmethod - def __check_numeric_validations( - cls, - arg, - validation_metadata: ValidationMetadata - ): - if not hasattr(cls, 'MetaOapg'): - return - if cls._is_json_validation_enabled_oapg('multipleOf', - validation_metadata.configuration) and hasattr(cls.MetaOapg, 'multiple_of'): - multiple_of_value = cls.MetaOapg.multiple_of - if (not (float(arg) / multiple_of_value).is_integer()): - # Note 'multipleOf' will be as good as the floating point arithmetic. - cls._raise_validation_error_message_oapg( - value=arg, - constraint_msg="value must be a multiple of", - constraint_value=multiple_of_value, - path_to_item=validation_metadata.path_to_item - ) - - checking_max_or_min_values = any( - hasattr(cls.MetaOapg, validation_key) for validation_key in { - 'exclusive_maximum', - 'inclusive_maximum', - 'exclusive_minimum', - 'inclusive_minimum', - } - ) - if not checking_max_or_min_values: - return - - if (cls._is_json_validation_enabled_oapg('exclusiveMaximum', validation_metadata.configuration) and - hasattr(cls.MetaOapg, 'exclusive_maximum') and - arg >= cls.MetaOapg.exclusive_maximum): - cls._raise_validation_error_message_oapg( - value=arg, - constraint_msg="must be a value less than", - constraint_value=cls.MetaOapg.exclusive_maximum, - path_to_item=validation_metadata.path_to_item - ) - - if (cls._is_json_validation_enabled_oapg('maximum', validation_metadata.configuration) and - hasattr(cls.MetaOapg, 'inclusive_maximum') and - arg > cls.MetaOapg.inclusive_maximum): - cls._raise_validation_error_message_oapg( - value=arg, - constraint_msg="must be a value less than or equal to", - constraint_value=cls.MetaOapg.inclusive_maximum, - path_to_item=validation_metadata.path_to_item - ) - - if (cls._is_json_validation_enabled_oapg('exclusiveMinimum', validation_metadata.configuration) and - hasattr(cls.MetaOapg, 'exclusive_minimum') and - arg <= cls.MetaOapg.exclusive_minimum): - cls._raise_validation_error_message_oapg( - value=arg, - constraint_msg="must be a value greater than", - constraint_value=cls.MetaOapg.exclusive_maximum, - path_to_item=validation_metadata.path_to_item - ) - - if (cls._is_json_validation_enabled_oapg('minimum', validation_metadata.configuration) and - hasattr(cls.MetaOapg, 'inclusive_minimum') and - arg < cls.MetaOapg.inclusive_minimum): - cls._raise_validation_error_message_oapg( - value=arg, - constraint_msg="must be a value greater than or equal to", - constraint_value=cls.MetaOapg.inclusive_minimum, - path_to_item=validation_metadata.path_to_item - ) - - @classmethod - def _validate_oapg( - cls, - arg, - validation_metadata: ValidationMetadata, - ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]]: - """ - NumberBase _validate_oapg - Validates that validations pass - """ - if isinstance(arg, decimal.Decimal): - cls.__check_numeric_validations(arg, validation_metadata) - return super()._validate_oapg(arg, validation_metadata=validation_metadata) - - -class ListBase(ValidatorBase): - MetaOapg: MetaOapgTyped - - @classmethod - def __validate_items(cls, list_items, validation_metadata: ValidationMetadata): - """ - Ensures that: - - values passed in for items are valid - Exceptions will be raised if: - - invalid arguments were passed in - - Args: - list_items: the input list of items - - Raises: - ApiTypeError - for missing required arguments, or for invalid properties - """ - - # if we have definitions for an items schema, use it - # otherwise accept anything - item_cls = getattr(cls.MetaOapg, 'items', UnsetAnyTypeSchema) - item_cls = cls._get_class_oapg(item_cls) - path_to_schemas = {} - for i, value in enumerate(list_items): - item_validation_metadata = ValidationMetadata( - from_server=validation_metadata.from_server, - configuration=validation_metadata.configuration, - path_to_item=validation_metadata.path_to_item+(i,), - validated_path_to_schemas=validation_metadata.validated_path_to_schemas - ) - if item_validation_metadata.validation_ran_earlier(item_cls): - add_deeper_validated_schemas(item_validation_metadata, path_to_schemas) - continue - other_path_to_schemas = item_cls._validate_oapg( - value, validation_metadata=item_validation_metadata) - update(path_to_schemas, other_path_to_schemas) - return path_to_schemas - - @classmethod - def __check_tuple_validations( - cls, arg, - validation_metadata: ValidationMetadata): - if not hasattr(cls, 'MetaOapg'): - return - if (cls._is_json_validation_enabled_oapg('maxItems', validation_metadata.configuration) and - hasattr(cls.MetaOapg, 'max_items') and - len(arg) > cls.MetaOapg.max_items): - cls._raise_validation_error_message_oapg( - value=arg, - constraint_msg="number of items must be less than or equal to", - constraint_value=cls.MetaOapg.max_items, - path_to_item=validation_metadata.path_to_item - ) - - if (cls._is_json_validation_enabled_oapg('minItems', validation_metadata.configuration) and - hasattr(cls.MetaOapg, 'min_items') and - len(arg) < cls.MetaOapg.min_items): - cls._raise_validation_error_message_oapg( - value=arg, - constraint_msg="number of items must be greater than or equal to", - constraint_value=cls.MetaOapg.min_items, - path_to_item=validation_metadata.path_to_item - ) - - if (cls._is_json_validation_enabled_oapg('uniqueItems', validation_metadata.configuration) and - hasattr(cls.MetaOapg, 'unique_items') and cls.MetaOapg.unique_items and arg): - unique_items = set(arg) - if len(arg) > len(unique_items): - cls._raise_validation_error_message_oapg( - value=arg, - constraint_msg="duplicate items were found, and the tuple must not contain duplicates because", - constraint_value='unique_items==True', - path_to_item=validation_metadata.path_to_item - ) - - @classmethod - def _validate_oapg( - cls, - arg, - validation_metadata: ValidationMetadata, - ): - """ - ListBase _validate_oapg - We return dynamic classes of different bases depending upon the inputs - This makes it so: - - the returned instance is always a subclass of our defining schema - - this allows us to check type based on whether an instance is a subclass of a schema - - the returned instance is a serializable type (except for None, True, and False) which are enums - - Returns: - new_cls (type): the new class - - Raises: - ApiValueError: when a string can't be converted into a date or datetime and it must be one of those classes - ApiTypeError: when the input type is not in the list of allowed spec types - """ - if isinstance(arg, tuple): - cls.__check_tuple_validations(arg, validation_metadata) - _path_to_schemas = super()._validate_oapg(arg, validation_metadata=validation_metadata) - if not isinstance(arg, tuple): - return _path_to_schemas - updated_vm = ValidationMetadata( - configuration=validation_metadata.configuration, - from_server=validation_metadata.from_server, - path_to_item=validation_metadata.path_to_item, - seen_classes=validation_metadata.seen_classes | frozenset({cls}), - validated_path_to_schemas=validation_metadata.validated_path_to_schemas - ) - other_path_to_schemas = cls.__validate_items(arg, validation_metadata=updated_vm) - update(_path_to_schemas, other_path_to_schemas) - return _path_to_schemas - - @classmethod - def _get_items_oapg( - cls: 'Schema', - arg: typing.List[typing.Any], - path_to_item: typing.Tuple[typing.Union[str, int], ...], - path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Type['Schema']] - ): - ''' - ListBase _get_items_oapg - ''' - cast_items = [] - - for i, value in enumerate(arg): - item_path_to_item = path_to_item + (i,) - item_cls = path_to_schemas[item_path_to_item] - new_value = item_cls._get_new_instance_without_conversion_oapg( - value, - item_path_to_item, - path_to_schemas - ) - cast_items.append(new_value) - - return cast_items - - -class Discriminable: - MetaOapg: MetaOapgTyped - - @classmethod - def _ensure_discriminator_value_present_oapg(cls, disc_property_name: str, validation_metadata: ValidationMetadata, *args): - if not args or args and disc_property_name not in args[0]: - # The input data does not contain the discriminator property - raise ApiValueError( - "Cannot deserialize input data due to missing discriminator. " - "The discriminator property '{}' is missing at path: {}".format(disc_property_name, validation_metadata.path_to_item) - ) - - @classmethod - def get_discriminated_class_oapg(cls, disc_property_name: str, disc_payload_value: str): - """ - Used in schemas with discriminators - """ - if not hasattr(cls.MetaOapg, 'discriminator'): - return None - disc = cls.MetaOapg.discriminator() - if disc_property_name not in disc: - return None - discriminated_cls = disc[disc_property_name].get(disc_payload_value) - if discriminated_cls is not None: - return discriminated_cls - if not hasattr(cls, 'MetaOapg'): - return None - elif not ( - hasattr(cls.MetaOapg, 'all_of') or - hasattr(cls.MetaOapg, 'one_of') or - hasattr(cls.MetaOapg, 'any_of') - ): - return None - # TODO stop traveling if a cycle is hit - if hasattr(cls.MetaOapg, 'all_of'): - for allof_cls in cls.MetaOapg.all_of(): - discriminated_cls = allof_cls.get_discriminated_class_oapg( - disc_property_name=disc_property_name, disc_payload_value=disc_payload_value) - if discriminated_cls is not None: - return discriminated_cls - if hasattr(cls.MetaOapg, 'one_of'): - for oneof_cls in cls.MetaOapg.one_of(): - discriminated_cls = oneof_cls.get_discriminated_class_oapg( - disc_property_name=disc_property_name, disc_payload_value=disc_payload_value) - if discriminated_cls is not None: - return discriminated_cls - if hasattr(cls.MetaOapg, 'any_of'): - for anyof_cls in cls.MetaOapg.any_of(): - discriminated_cls = anyof_cls.get_discriminated_class_oapg( - disc_property_name=disc_property_name, disc_payload_value=disc_payload_value) - if discriminated_cls is not None: - return discriminated_cls - return None - - -class DictBase(Discriminable, ValidatorBase): - - @classmethod - def __validate_arg_presence(cls, arg): - """ - Ensures that: - - all required arguments are passed in - - the input variable names are valid - - present in properties or - - accepted because additionalProperties exists - Exceptions will be raised if: - - invalid arguments were passed in - - a var_name is invalid if additional_properties == NotAnyTypeSchema - and var_name not in properties.__annotations__ - - required properties were not passed in - - Args: - arg: the input dict - - Raises: - ApiTypeError - for missing required arguments, or for invalid properties - """ - seen_required_properties = set() - invalid_arguments = [] - required_property_names = getattr(cls.MetaOapg, 'required', set()) - additional_properties = getattr(cls.MetaOapg, 'additional_properties', UnsetAnyTypeSchema) - properties = getattr(cls.MetaOapg, 'properties', {}) - property_annotations = getattr(properties, '__annotations__', {}) - for property_name in arg: - if property_name in required_property_names: - seen_required_properties.add(property_name) - elif property_name in property_annotations: - continue - elif additional_properties is not NotAnyTypeSchema: - continue - else: - invalid_arguments.append(property_name) - missing_required_arguments = list(required_property_names - seen_required_properties) - if missing_required_arguments: - missing_required_arguments.sort() - raise ApiTypeError( - "{} is missing {} required argument{}: {}".format( - cls.__name__, - len(missing_required_arguments), - "s" if len(missing_required_arguments) > 1 else "", - missing_required_arguments - ) - ) - if invalid_arguments: - invalid_arguments.sort() - raise ApiTypeError( - "{} was passed {} invalid argument{}: {}".format( - cls.__name__, - len(invalid_arguments), - "s" if len(invalid_arguments) > 1 else "", - invalid_arguments - ) - ) - - @classmethod - def __validate_args(cls, arg, validation_metadata: ValidationMetadata): - """ - Ensures that: - - values passed in for properties are valid - Exceptions will be raised if: - - invalid arguments were passed in - - Args: - arg: the input dict - - Raises: - ApiTypeError - for missing required arguments, or for invalid properties - """ - path_to_schemas = {} - additional_properties = getattr(cls.MetaOapg, 'additional_properties', UnsetAnyTypeSchema) - properties = getattr(cls.MetaOapg, 'properties', {}) - property_annotations = getattr(properties, '__annotations__', {}) - for property_name, value in arg.items(): - path_to_item = validation_metadata.path_to_item+(property_name,) - if property_name in property_annotations: - schema = property_annotations[property_name] - elif additional_properties is not NotAnyTypeSchema: - if additional_properties is UnsetAnyTypeSchema: - """ - If additionalProperties is unset and this path_to_item does not yet have - any validations on it, validate it. - If it already has validations on it, skip this validation. - """ - if path_to_item in path_to_schemas: - continue - schema = additional_properties - else: - raise ApiTypeError('Unable to find schema for value={} in class={} at path_to_item={}'.format( - value, cls, validation_metadata.path_to_item+(property_name,) - )) - schema = cls._get_class_oapg(schema) - arg_validation_metadata = ValidationMetadata( - from_server=validation_metadata.from_server, - configuration=validation_metadata.configuration, - path_to_item=path_to_item, - validated_path_to_schemas=validation_metadata.validated_path_to_schemas - ) - if arg_validation_metadata.validation_ran_earlier(schema): - add_deeper_validated_schemas(arg_validation_metadata, path_to_schemas) - continue - other_path_to_schemas = schema._validate_oapg(value, validation_metadata=arg_validation_metadata) - update(path_to_schemas, other_path_to_schemas) - return path_to_schemas - - @classmethod - def __check_dict_validations( - cls, - arg, - validation_metadata: ValidationMetadata - ): - if not hasattr(cls, 'MetaOapg'): - return - if (cls._is_json_validation_enabled_oapg('maxProperties', validation_metadata.configuration) and - hasattr(cls.MetaOapg, 'max_properties') and - len(arg) > cls.MetaOapg.max_properties): - cls._raise_validation_error_message_oapg( - value=arg, - constraint_msg="number of properties must be less than or equal to", - constraint_value=cls.MetaOapg.max_properties, - path_to_item=validation_metadata.path_to_item - ) - - if (cls._is_json_validation_enabled_oapg('minProperties', validation_metadata.configuration) and - hasattr(cls.MetaOapg, 'min_properties') and - len(arg) < cls.MetaOapg.min_properties): - cls._raise_validation_error_message_oapg( - value=arg, - constraint_msg="number of properties must be greater than or equal to", - constraint_value=cls.MetaOapg.min_properties, - path_to_item=validation_metadata.path_to_item - ) - - @classmethod - def _validate_oapg( - cls, - arg, - validation_metadata: ValidationMetadata, - ): - """ - DictBase _validate_oapg - We return dynamic classes of different bases depending upon the inputs - This makes it so: - - the returned instance is always a subclass of our defining schema - - this allows us to check type based on whether an instance is a subclass of a schema - - the returned instance is a serializable type (except for None, True, and False) which are enums - - Returns: - new_cls (type): the new class - - Raises: - ApiValueError: when a string can't be converted into a date or datetime and it must be one of those classes - ApiTypeError: when the input type is not in the list of allowed spec types - """ - if isinstance(arg, frozendict.frozendict): - cls.__check_dict_validations(arg, validation_metadata) - _path_to_schemas = super()._validate_oapg(arg, validation_metadata=validation_metadata) - if not isinstance(arg, frozendict.frozendict): - return _path_to_schemas - cls.__validate_arg_presence(arg) - other_path_to_schemas = cls.__validate_args(arg, validation_metadata=validation_metadata) - update(_path_to_schemas, other_path_to_schemas) - try: - discriminator = cls.MetaOapg.discriminator() - except AttributeError: - return _path_to_schemas - # discriminator exists - disc_prop_name = list(discriminator.keys())[0] - cls._ensure_discriminator_value_present_oapg(disc_prop_name, validation_metadata, arg) - discriminated_cls = cls.get_discriminated_class_oapg( - disc_property_name=disc_prop_name, disc_payload_value=arg[disc_prop_name]) - if discriminated_cls is None: - raise ApiValueError( - "Invalid discriminator value was passed in to {}.{} Only the values {} are allowed at {}".format( - cls.__name__, - disc_prop_name, - list(discriminator[disc_prop_name].keys()), - validation_metadata.path_to_item + (disc_prop_name,) - ) - ) - updated_vm = ValidationMetadata( - configuration=validation_metadata.configuration, - from_server=validation_metadata.from_server, - path_to_item=validation_metadata.path_to_item, - seen_classes=validation_metadata.seen_classes | frozenset({cls}), - validated_path_to_schemas=validation_metadata.validated_path_to_schemas - ) - if updated_vm.validation_ran_earlier(discriminated_cls): - add_deeper_validated_schemas(updated_vm, _path_to_schemas) - return _path_to_schemas - other_path_to_schemas = discriminated_cls._validate_oapg(arg, validation_metadata=updated_vm) - update(_path_to_schemas, other_path_to_schemas) - return _path_to_schemas - - @classmethod - def _get_properties_oapg( - cls, - arg: typing.Dict[str, typing.Any], - path_to_item: typing.Tuple[typing.Union[str, int], ...], - path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Type['Schema']] - ): - """ - DictBase _get_properties_oapg, this is how properties are set - These values already passed validation - """ - dict_items = {} - - for property_name_js, value in arg.items(): - property_path_to_item = path_to_item + (property_name_js,) - property_cls = path_to_schemas[property_path_to_item] - new_value = property_cls._get_new_instance_without_conversion_oapg( - value, - property_path_to_item, - path_to_schemas - ) - dict_items[property_name_js] = new_value - - return dict_items - - def __setattr__(self, name: str, value: typing.Any): - if not isinstance(self, FileIO): - raise AttributeError('property setting not supported on immutable instances') - - def __getattr__(self, name: str): - """ - for instance.name access - Properties are only type hinted for required properties - so that hasattr(instance, 'optionalProp') is False when that key is not present - """ - if not isinstance(self, frozendict.frozendict): - return super().__getattr__(name) - if name not in self.__class__.__annotations__: - raise AttributeError(f"{self} has no attribute '{name}'") - try: - value = self[name] - return value - except KeyError as ex: - raise AttributeError(str(ex)) - - def __getitem__(self, name: str): - """ - dict_instance[name] accessor - key errors thrown - """ - if not isinstance(self, frozendict.frozendict): - return super().__getattr__(name) - return super().__getitem__(name) - - def get_item_oapg(self, name: str) -> typing.Union['AnyTypeSchema', Unset]: - # dict_instance[name] accessor - if not isinstance(self, frozendict.frozendict): - raise NotImplementedError() - try: - return super().__getitem__(name) - except KeyError: - return unset - - -def cast_to_allowed_types( - arg: typing.Union[str, date, datetime, uuid.UUID, decimal.Decimal, int, float, None, dict, frozendict.frozendict, list, tuple, bytes, Schema, io.FileIO, io.BufferedReader], - from_server: bool, - validated_path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]], - path_to_item: typing.Tuple[typing.Union[str, int], ...] = tuple(['args[0]']), -) -> typing.Union[frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO]: - """ - Casts the input payload arg into the allowed types - The input validated_path_to_schemas is mutated by running this function - - When from_server is False then - - date/datetime is cast to str - - int/float is cast to Decimal - - If a Schema instance is passed in it is converted back to a primitive instance because - One may need to validate that data to the original Schema class AND additional different classes - those additional classes will need to be added to the new manufactured class for that payload - If the code didn't do this and kept the payload as a Schema instance it would fail to validate to other - Schema classes and the code wouldn't be able to mfg a new class that includes all valid schemas - TODO: store the validated schema classes in validation_metadata - - Args: - arg: the payload - from_server: whether this payload came from the server or not - validated_path_to_schemas: a dict that stores the validated classes at any path location in the payload - """ - if isinstance(arg, Schema): - # store the already run validations - schema_classes = set() - for cls in arg.__class__.__bases__: - if cls is Singleton: - # Skip Singleton - continue - schema_classes.add(cls) - validated_path_to_schemas[path_to_item] = schema_classes - - type_error = ApiTypeError(f"Invalid type. Required value type is str and passed type was {type(arg)} at {path_to_item}") - if isinstance(arg, str): - return str(arg) - elif isinstance(arg, (dict, frozendict.frozendict)): - return frozendict.frozendict({key: cast_to_allowed_types(val, from_server, validated_path_to_schemas, path_to_item + (key,)) for key, val in arg.items()}) - elif isinstance(arg, (bool, BoolClass)): - """ - this check must come before isinstance(arg, (int, float)) - because isinstance(True, int) is True - """ - if arg: - return BoolClass.TRUE - return BoolClass.FALSE - elif isinstance(arg, int): - return decimal.Decimal(arg) - elif isinstance(arg, float): - decimal_from_float = decimal.Decimal(arg) - if decimal_from_float.as_integer_ratio()[1] == 1: - # 9.0 -> Decimal('9.0') - # 3.4028234663852886e+38 -> Decimal('340282346638528859811704183484516925440.0') - return decimal.Decimal(str(decimal_from_float)+'.0') - return decimal_from_float - elif isinstance(arg, (tuple, list)): - return tuple([cast_to_allowed_types(item, from_server, validated_path_to_schemas, path_to_item + (i,)) for i, item in enumerate(arg)]) - elif isinstance(arg, (none_type, NoneClass)): - return NoneClass.NONE - elif isinstance(arg, (date, datetime)): - if not from_server: - return arg.isoformat() - raise type_error - elif isinstance(arg, uuid.UUID): - if not from_server: - return str(arg) - raise type_error - elif isinstance(arg, decimal.Decimal): - return decimal.Decimal(arg) - elif isinstance(arg, bytes): - return bytes(arg) - elif isinstance(arg, (io.FileIO, io.BufferedReader)): - return FileIO(arg) - raise ValueError('Invalid type passed in got input={} type={}'.format(arg, type(arg))) - - -class ComposedBase(Discriminable): - - @classmethod - def __get_allof_classes(cls, arg, validation_metadata: ValidationMetadata): - path_to_schemas = defaultdict(set) - for allof_cls in cls.MetaOapg.all_of(): - if validation_metadata.validation_ran_earlier(allof_cls): - add_deeper_validated_schemas(validation_metadata, path_to_schemas) - continue - other_path_to_schemas = allof_cls._validate_oapg(arg, validation_metadata=validation_metadata) - update(path_to_schemas, other_path_to_schemas) - return path_to_schemas - - @classmethod - def __get_oneof_class( - cls, - arg, - discriminated_cls, - validation_metadata: ValidationMetadata, - ): - oneof_classes = [] - path_to_schemas = defaultdict(set) - for oneof_cls in cls.MetaOapg.one_of(): - if oneof_cls in path_to_schemas[validation_metadata.path_to_item]: - oneof_classes.append(oneof_cls) - continue - if validation_metadata.validation_ran_earlier(oneof_cls): - oneof_classes.append(oneof_cls) - add_deeper_validated_schemas(validation_metadata, path_to_schemas) - continue - try: - path_to_schemas = oneof_cls._validate_oapg(arg, validation_metadata=validation_metadata) - except (ApiValueError, ApiTypeError) as ex: - if discriminated_cls is not None and oneof_cls is discriminated_cls: - """ - suppress exception because code was generated with - nonCompliantUseDiscriminatorIfCompositionFails=true - """ - pass - continue - oneof_classes.append(oneof_cls) - if not oneof_classes: - if discriminated_cls: - """ - return without exception because code was generated with - nonCompliantUseDiscriminatorIfCompositionFails=true - """ - return {} - raise ApiValueError( - "Invalid inputs given to generate an instance of {}. None " - "of the oneOf schemas matched the input data.".format(cls) - ) - elif len(oneof_classes) > 1: - if discriminated_cls: - """ - return without exception because code was generated with - nonCompliantUseDiscriminatorIfCompositionFails=true - """ - return {} - raise ApiValueError( - "Invalid inputs given to generate an instance of {}. Multiple " - "oneOf schemas {} matched the inputs, but a max of one is allowed.".format(cls, oneof_classes) - ) - # exactly one class matches - return path_to_schemas - - @classmethod - def __get_anyof_classes( - cls, - arg, - discriminated_cls, - validation_metadata: ValidationMetadata - ): - anyof_classes = [] - path_to_schemas = defaultdict(set) - for anyof_cls in cls.MetaOapg.any_of(): - if validation_metadata.validation_ran_earlier(anyof_cls): - anyof_classes.append(anyof_cls) - add_deeper_validated_schemas(validation_metadata, path_to_schemas) - continue - - try: - other_path_to_schemas = anyof_cls._validate_oapg(arg, validation_metadata=validation_metadata) - except (ApiValueError, ApiTypeError) as ex: - if discriminated_cls is not None and anyof_cls is discriminated_cls: - """ - suppress exception because code was generated with - nonCompliantUseDiscriminatorIfCompositionFails=true - """ - pass - continue - anyof_classes.append(anyof_cls) - update(path_to_schemas, other_path_to_schemas) - if not anyof_classes: - if discriminated_cls: - """ - return without exception because code was generated with - nonCompliantUseDiscriminatorIfCompositionFails=true - """ - return {} - raise ApiValueError( - "Invalid inputs given to generate an instance of {}. None " - "of the anyOf schemas matched the input data.".format(cls) - ) - return path_to_schemas - - @classmethod - def _validate_oapg( - cls, - arg, - validation_metadata: ValidationMetadata, - ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]]: - """ - ComposedBase _validate_oapg - We return dynamic classes of different bases depending upon the inputs - This makes it so: - - the returned instance is always a subclass of our defining schema - - this allows us to check type based on whether an instance is a subclass of a schema - - the returned instance is a serializable type (except for None, True, and False) which are enums - - Returns: - new_cls (type): the new class - - Raises: - ApiValueError: when a string can't be converted into a date or datetime and it must be one of those classes - ApiTypeError: when the input type is not in the list of allowed spec types - """ - # validation checking on types, validations, and enums - path_to_schemas = super()._validate_oapg(arg, validation_metadata=validation_metadata) - - updated_vm = ValidationMetadata( - configuration=validation_metadata.configuration, - from_server=validation_metadata.from_server, - path_to_item=validation_metadata.path_to_item, - seen_classes=validation_metadata.seen_classes | frozenset({cls}), - validated_path_to_schemas=validation_metadata.validated_path_to_schemas - ) - - # process composed schema - discriminator = None - if hasattr(cls, 'MetaOapg') and hasattr(cls.MetaOapg, 'discriminator'): - discriminator = cls.MetaOapg.discriminator() - discriminated_cls = None - if discriminator and arg and isinstance(arg, frozendict.frozendict): - disc_property_name = list(discriminator.keys())[0] - cls._ensure_discriminator_value_present_oapg(disc_property_name, updated_vm, arg) - # get discriminated_cls by looking at the dict in the current class - discriminated_cls = cls.get_discriminated_class_oapg( - disc_property_name=disc_property_name, disc_payload_value=arg[disc_property_name]) - if discriminated_cls is None: - raise ApiValueError( - "Invalid discriminator value '{}' was passed in to {}.{} Only the values {} are allowed at {}".format( - arg[disc_property_name], - cls.__name__, - disc_property_name, - list(discriminator[disc_property_name].keys()), - updated_vm.path_to_item + (disc_property_name,) - ) - ) - - if hasattr(cls, 'MetaOapg') and hasattr(cls.MetaOapg, 'all_of'): - other_path_to_schemas = cls.__get_allof_classes(arg, validation_metadata=updated_vm) - update(path_to_schemas, other_path_to_schemas) - if hasattr(cls, 'MetaOapg') and hasattr(cls.MetaOapg, 'one_of'): - other_path_to_schemas = cls.__get_oneof_class( - arg, - discriminated_cls=discriminated_cls, - validation_metadata=updated_vm - ) - update(path_to_schemas, other_path_to_schemas) - if hasattr(cls, 'MetaOapg') and hasattr(cls.MetaOapg, 'any_of'): - other_path_to_schemas = cls.__get_anyof_classes( - arg, - discriminated_cls=discriminated_cls, - validation_metadata=updated_vm - ) - update(path_to_schemas, other_path_to_schemas) - not_cls = None - if hasattr(cls, 'MetaOapg') and hasattr(cls.MetaOapg, 'not_schema'): - not_cls = cls.MetaOapg.not_schema - not_cls = cls._get_class_oapg(not_cls) - if not_cls: - other_path_to_schemas = None - not_exception = ApiValueError( - "Invalid value '{}' was passed in to {}. Value is invalid because it is disallowed by {}".format( - arg, - cls.__name__, - not_cls.__name__, - ) - ) - if updated_vm.validation_ran_earlier(not_cls): - raise not_exception - - try: - other_path_to_schemas = not_cls._validate_oapg(arg, validation_metadata=updated_vm) - except (ApiValueError, ApiTypeError): - pass - if other_path_to_schemas: - raise not_exception - - if discriminated_cls is not None and not updated_vm.validation_ran_earlier(discriminated_cls): - # TODO use an exception from this package here - add_deeper_validated_schemas(updated_vm, path_to_schemas) - assert discriminated_cls in path_to_schemas[updated_vm.path_to_item] - return path_to_schemas - - -# DictBase, ListBase, NumberBase, StrBase, BoolBase, NoneBase -class ComposedSchema( - ComposedBase, - DictBase, - ListBase, - NumberBase, - StrBase, - BoolBase, - NoneBase, - Schema, - NoneFrozenDictTupleStrDecimalBoolMixin -): - @classmethod - def from_openapi_data_oapg(cls, *args: typing.Any, _configuration: typing.Optional[Configuration] = None, **kwargs): - if not args: - if not kwargs: - raise ApiTypeError('{} is missing required input data in args or kwargs'.format(cls.__name__)) - args = (kwargs, ) - return super().from_openapi_data_oapg(args[0], _configuration=_configuration) - - -class ListSchema( - ListBase, - Schema, - TupleMixin -): - - @classmethod - def from_openapi_data_oapg(cls, arg: typing.List[typing.Any], _configuration: typing.Optional[Configuration] = None): - return super().from_openapi_data_oapg(arg, _configuration=_configuration) - - def __new__(cls, _arg: typing.Union[typing.List[typing.Any], typing.Tuple[typing.Any]], **kwargs: Configuration): - return super().__new__(cls, _arg, **kwargs) - - -class NoneSchema( - NoneBase, - Schema, - NoneMixin -): - - @classmethod - def from_openapi_data_oapg(cls, arg: None, _configuration: typing.Optional[Configuration] = None): - return super().from_openapi_data_oapg(arg, _configuration=_configuration) - - def __new__(cls, _arg: None, **kwargs: Configuration): - return super().__new__(cls, _arg, **kwargs) - - -class NumberSchema( - NumberBase, - Schema, - DecimalMixin -): - """ - This is used for type: number with no format - Both integers AND floats are accepted - """ - - @classmethod - def from_openapi_data_oapg(cls, arg: typing.Union[int, float], _configuration: typing.Optional[Configuration] = None): - return super().from_openapi_data_oapg(arg, _configuration=_configuration) - - def __new__(cls, _arg: typing.Union[decimal.Decimal, int, float], **kwargs: Configuration): - return super().__new__(cls, _arg, **kwargs) - - -class IntBase: - @property - def as_int_oapg(self) -> int: - try: - return self._as_int - except AttributeError: - self._as_int = int(self) - return self._as_int - - @classmethod - def __validate_format(cls, arg: typing.Optional[decimal.Decimal], validation_metadata: ValidationMetadata): - if isinstance(arg, decimal.Decimal): - - denominator = arg.as_integer_ratio()[-1] - if denominator != 1: - raise ApiValueError( - "Invalid value '{}' for type integer at {}".format(arg, validation_metadata.path_to_item) - ) - - @classmethod - def _validate_oapg( - cls, - arg, - validation_metadata: ValidationMetadata, - ): - """ - IntBase _validate_oapg - TODO what about types = (int, number) -> IntBase, NumberBase? We could drop int and keep number only - """ - cls.__validate_format(arg, validation_metadata=validation_metadata) - return super()._validate_oapg(arg, validation_metadata=validation_metadata) - - -class IntSchema(IntBase, NumberSchema): - - @classmethod - def from_openapi_data_oapg(cls, arg: int, _configuration: typing.Optional[Configuration] = None): - return super().from_openapi_data_oapg(arg, _configuration=_configuration) - - def __new__(cls, _arg: typing.Union[decimal.Decimal, int], **kwargs: Configuration): - return super().__new__(cls, _arg, **kwargs) - - -class Int32Base: - __inclusive_minimum = decimal.Decimal(-2147483648) - __inclusive_maximum = decimal.Decimal(2147483647) - - @classmethod - def __validate_format(cls, arg: typing.Optional[decimal.Decimal], validation_metadata: ValidationMetadata): - if isinstance(arg, decimal.Decimal) and arg.as_tuple().exponent == 0: - if not cls.__inclusive_minimum <= arg <= cls.__inclusive_maximum: - raise ApiValueError( - "Invalid value '{}' for type int32 at {}".format(arg, validation_metadata.path_to_item) - ) - - @classmethod - def _validate_oapg( - cls, - arg, - validation_metadata: ValidationMetadata, - ): - """ - Int32Base _validate_oapg - """ - cls.__validate_format(arg, validation_metadata=validation_metadata) - return super()._validate_oapg(arg, validation_metadata=validation_metadata) - - -class Int32Schema( - Int32Base, - IntSchema -): - pass - - -class Int64Base: - __inclusive_minimum = decimal.Decimal(-9223372036854775808) - __inclusive_maximum = decimal.Decimal(9223372036854775807) - - @classmethod - def __validate_format(cls, arg: typing.Optional[decimal.Decimal], validation_metadata: ValidationMetadata): - if isinstance(arg, decimal.Decimal) and arg.as_tuple().exponent == 0: - if not cls.__inclusive_minimum <= arg <= cls.__inclusive_maximum: - raise ApiValueError( - "Invalid value '{}' for type int64 at {}".format(arg, validation_metadata.path_to_item) - ) - - @classmethod - def _validate_oapg( - cls, - arg, - validation_metadata: ValidationMetadata, - ): - """ - Int64Base _validate_oapg - """ - cls.__validate_format(arg, validation_metadata=validation_metadata) - return super()._validate_oapg(arg, validation_metadata=validation_metadata) - - -class Int64Schema( - Int64Base, - IntSchema -): - pass - - -class Float32Base: - __inclusive_minimum = decimal.Decimal(-3.4028234663852886e+38) - __inclusive_maximum = decimal.Decimal(3.4028234663852886e+38) - - @classmethod - def __validate_format(cls, arg: typing.Optional[decimal.Decimal], validation_metadata: ValidationMetadata): - if isinstance(arg, decimal.Decimal): - if not cls.__inclusive_minimum <= arg <= cls.__inclusive_maximum: - raise ApiValueError( - "Invalid value '{}' for type float at {}".format(arg, validation_metadata.path_to_item) - ) - - @classmethod - def _validate_oapg( - cls, - arg, - validation_metadata: ValidationMetadata, - ): - """ - Float32Base _validate_oapg - """ - cls.__validate_format(arg, validation_metadata=validation_metadata) - return super()._validate_oapg(arg, validation_metadata=validation_metadata) - - -class Float32Schema( - Float32Base, - NumberSchema -): - - @classmethod - def from_openapi_data_oapg(cls, arg: float, _configuration: typing.Optional[Configuration] = None): - return super().from_openapi_data_oapg(arg, _configuration=_configuration) - - -class Float64Base: - __inclusive_minimum = decimal.Decimal(-1.7976931348623157E+308) - __inclusive_maximum = decimal.Decimal(1.7976931348623157E+308) - - @classmethod - def __validate_format(cls, arg: typing.Optional[decimal.Decimal], validation_metadata: ValidationMetadata): - if isinstance(arg, decimal.Decimal): - if not cls.__inclusive_minimum <= arg <= cls.__inclusive_maximum: - raise ApiValueError( - "Invalid value '{}' for type double at {}".format(arg, validation_metadata.path_to_item) - ) - - @classmethod - def _validate_oapg( - cls, - arg, - validation_metadata: ValidationMetadata, - ): - """ - Float64Base _validate_oapg - """ - cls.__validate_format(arg, validation_metadata=validation_metadata) - return super()._validate_oapg(arg, validation_metadata=validation_metadata) - -class Float64Schema( - Float64Base, - NumberSchema -): - - @classmethod - def from_openapi_data_oapg(cls, arg: float, _configuration: typing.Optional[Configuration] = None): - # todo check format - return super().from_openapi_data_oapg(arg, _configuration=_configuration) - - -class StrSchema( - StrBase, - Schema, - StrMixin -): - """ - date + datetime string types must inherit from this class - That is because one can validate a str payload as both: - - type: string (format unset) - - type: string, format: date - """ - - @classmethod - def from_openapi_data_oapg(cls, arg: str, _configuration: typing.Optional[Configuration] = None) -> 'StrSchema': - return super().from_openapi_data_oapg(arg, _configuration=_configuration) - - def __new__(cls, _arg: typing.Union[str, date, datetime, uuid.UUID], **kwargs: Configuration): - return super().__new__(cls, _arg, **kwargs) - - -class UUIDSchema(UUIDBase, StrSchema): - - def __new__(cls, _arg: typing.Union[str, uuid.UUID], **kwargs: Configuration): - return super().__new__(cls, _arg, **kwargs) - - -class DateSchema(DateBase, StrSchema): - - def __new__(cls, _arg: typing.Union[str, date], **kwargs: Configuration): - return super().__new__(cls, _arg, **kwargs) - - -class DateTimeSchema(DateTimeBase, StrSchema): - - def __new__(cls, _arg: typing.Union[str, datetime], **kwargs: Configuration): - return super().__new__(cls, _arg, **kwargs) - - -class DecimalSchema(DecimalBase, StrSchema): - - def __new__(cls, _arg: str, **kwargs: Configuration): - """ - Note: Decimals may not be passed in because cast_to_allowed_types is only invoked once for payloads - which can be simple (str) or complex (dicts or lists with nested values) - Because casting is only done once and recursively casts all values prior to validation then for a potential - client side Decimal input if Decimal was accepted as an input in DecimalSchema then one would not know - if one was using it for a StrSchema (where it should be cast to str) or one is using it for NumberSchema - where it should stay as Decimal. - """ - return super().__new__(cls, _arg, **kwargs) - - -class BytesSchema( - Schema, - BytesMixin -): - """ - this class will subclass bytes and is immutable - """ - def __new__(cls, _arg: bytes, **kwargs: Configuration): - return super(Schema, cls).__new__(cls, _arg) - - -class FileSchema( - Schema, - FileMixin -): - """ - This class is NOT immutable - Dynamic classes are built using it for example when AnyType allows in binary data - Al other schema classes ARE immutable - If one wanted to make this immutable one could make this a DictSchema with required properties: - - data = BytesSchema (which would be an immutable bytes based schema) - - file_name = StrSchema - and cast_to_allowed_types would convert bytes and file instances into dicts containing data + file_name - The downside would be that data would be stored in memory which one may not want to do for very large files - - The developer is responsible for closing this file and deleting it - - This class was kept as mutable: - - to allow file reading and writing to disk - - to be able to preserve file name info - """ - - def __new__(cls, _arg: typing.Union[io.FileIO, io.BufferedReader], **kwargs: Configuration): - return super(Schema, cls).__new__(cls, _arg) - - -class BinaryBase: - pass - - -class BinarySchema( - ComposedBase, - BinaryBase, - Schema, - BinaryMixin -): - class MetaOapg: - @staticmethod - def one_of(): - return [ - BytesSchema, - FileSchema, - ] - - def __new__(cls, _arg: typing.Union[io.FileIO, io.BufferedReader, bytes], **kwargs: Configuration): - return super().__new__(cls, _arg) - - -class BoolSchema( - BoolBase, - Schema, - BoolMixin -): - - @classmethod - def from_openapi_data_oapg(cls, arg: bool, _configuration: typing.Optional[Configuration] = None): - return super().from_openapi_data_oapg(arg, _configuration=_configuration) - - def __new__(cls, _arg: bool, **kwargs: ValidationMetadata): - return super().__new__(cls, _arg, **kwargs) - - -class AnyTypeSchema( - DictBase, - ListBase, - NumberBase, - StrBase, - BoolBase, - NoneBase, - Schema, - NoneFrozenDictTupleStrDecimalBoolFileBytesMixin -): - # Python representation of a schema defined as true or {} - pass - - -class UnsetAnyTypeSchema(AnyTypeSchema): - # Used when additionalProperties/items was not explicitly defined and a defining schema is needed - pass - - -class NotAnyTypeSchema( - ComposedSchema, -): - """ - Python representation of a schema defined as false or {'not': {}} - Does not allow inputs in of AnyType - Note: validations on this class are never run because the code knows that no inputs will ever validate - """ - - class MetaOapg: - not_schema = AnyTypeSchema - - def __new__( - cls, - *_args, - _configuration: typing.Optional[Configuration] = None, - ) -> 'NotAnyTypeSchema': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - ) - - -class DictSchema( - DictBase, - Schema, - FrozenDictMixin -): - @classmethod - def from_openapi_data_oapg(cls, arg: typing.Dict[str, typing.Any], _configuration: typing.Optional[Configuration] = None): - return super().from_openapi_data_oapg(arg, _configuration=_configuration) - - def __new__(cls, *_args: typing.Union[dict, frozendict.frozendict], **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, bytes, Schema, Unset, ValidationMetadata]): - return super().__new__(cls, *_args, **kwargs) - - -schema_type_classes = {NoneSchema, DictSchema, ListSchema, NumberSchema, StrSchema, BoolSchema, AnyTypeSchema} - - -@functools.lru_cache() -def get_new_class( - class_name: str, - bases: typing.Tuple[typing.Type[typing.Union[Schema, typing.Any]], ...] -) -> typing.Type[Schema]: - """ - Returns a new class that is made with the subclass bases - """ - new_cls: typing.Type[Schema] = type(class_name, bases, {}) - return new_cls - - -LOG_CACHE_USAGE = False - - -def log_cache_usage(cache_fn): - if LOG_CACHE_USAGE: - print(cache_fn.__name__, cache_fn.cache_info()) diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/tox.ini b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/tox.ini index 747ebd626c9..d450a327dd5 100644 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/tox.ini +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/tox.ini @@ -1,10 +1,10 @@ [tox] envlist = py37 +isolated_build = True [testenv] passenv = PYTHON_VERSION -deps=-r{toxinidir}/requirements.txt - -r{toxinidir}/test-requirements.txt +deps=-r{toxinidir}/test-requirements.txt commands= pytest --cov=this_package diff --git a/samples/openapi3/client/features/security/python/.gitignore b/samples/openapi3/client/features/security/python/.gitignore new file mode 100644 index 00000000000..a62e8aba43f --- /dev/null +++ b/samples/openapi3/client/features/security/python/.gitignore @@ -0,0 +1,67 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt +dev-requirements.txt.log + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*,cover +.hypothesis/ +venv/ +.venv/ +.python-version +.pytest_cache + +# Translations +*.mo +*.pot + +# Django stuff: +*.log + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +#Ipython Notebook +.ipynb_checkpoints diff --git a/samples/openapi3/client/features/security/python/.gitlab-ci.yml b/samples/openapi3/client/features/security/python/.gitlab-ci.yml new file mode 100644 index 00000000000..0928729c5b0 --- /dev/null +++ b/samples/openapi3/client/features/security/python/.gitlab-ci.yml @@ -0,0 +1,24 @@ +# ref: https://docs.gitlab.com/ee/ci/README.html + +stages: + - test + +.tests: + stage: test + script: + - pip install -r requirements.txt + - pip install -r test-requirements.txt + - pytest --cov=this_package + +test-3.5: + extends: .tests + image: python:3.5-alpine +test-3.6: + extends: .tests + image: python:3.6-alpine +test-3.7: + extends: .tests + image: python:3.7-alpine +test-3.8: + extends: .tests + image: python:3.8-alpine diff --git a/modules/openapi-json-schema-generator-online/.openapi-generator-ignore b/samples/openapi3/client/features/security/python/.openapi-generator-ignore similarity index 89% rename from modules/openapi-json-schema-generator-online/.openapi-generator-ignore rename to samples/openapi3/client/features/security/python/.openapi-generator-ignore index 7484ee590a3..d24a2da8ae5 100644 --- a/modules/openapi-json-schema-generator-online/.openapi-generator-ignore +++ b/samples/openapi3/client/features/security/python/.openapi-generator-ignore @@ -1,5 +1,5 @@ # OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator +# Generated by openapi-generator https://github.com/openapi-json-schema-tools/openapi-json-schema-generator # Use this file to prevent files from being overwritten by the generator. # The patterns follow closely to .gitignore or .dockerignore. diff --git a/samples/openapi3/client/features/security/python/.openapi-generator/FILES b/samples/openapi3/client/features/security/python/.openapi-generator/FILES new file mode 100644 index 00000000000..f1a98b0261d --- /dev/null +++ b/samples/openapi3/client/features/security/python/.openapi-generator/FILES @@ -0,0 +1,92 @@ +.gitignore +.gitlab-ci.yml +.travis.yml +README.md +docs/apis/tags/default_api.md +docs/components/security_schemes/security_scheme_api_key.md +docs/components/security_schemes/security_scheme_bearer_test.md +docs/components/security_schemes/security_scheme_http_basic_test.md +docs/paths/path_with_no_explicit_security/get.md +docs/paths/path_with_one_explicit_security/get.md +docs/paths/path_with_security_from_root/get.md +docs/paths/path_with_two_explicit_security/get.md +docs/servers/server_0.md +git_push.sh +migration_2_0_0.md +migration_other_python_generators.md +pyproject.toml +src/this_package/__init__.py +src/this_package/api_client.py +src/this_package/apis/__init__.py +src/this_package/apis/path_to_api.py +src/this_package/apis/paths/__init__.py +src/this_package/apis/paths/path_with_no_explicit_security.py +src/this_package/apis/paths/path_with_one_explicit_security.py +src/this_package/apis/paths/path_with_security_from_root.py +src/this_package/apis/paths/path_with_two_explicit_security.py +src/this_package/apis/tag_to_api.py +src/this_package/apis/tags/__init__.py +src/this_package/apis/tags/default_api.py +src/this_package/components/schemas/__init__.py +src/this_package/components/security_schemes/__init__.py +src/this_package/components/security_schemes/security_scheme_api_key.py +src/this_package/components/security_schemes/security_scheme_bearer_test.py +src/this_package/components/security_schemes/security_scheme_http_basic_test.py +src/this_package/configurations/__init__.py +src/this_package/configurations/api_configuration.py +src/this_package/configurations/schema_configuration.py +src/this_package/exceptions.py +src/this_package/paths/__init__.py +src/this_package/paths/path_with_no_explicit_security/__init__.py +src/this_package/paths/path_with_no_explicit_security/get/__init__.py +src/this_package/paths/path_with_no_explicit_security/get/operation.py +src/this_package/paths/path_with_no_explicit_security/get/responses/__init__.py +src/this_package/paths/path_with_no_explicit_security/get/responses/response_200/__init__.py +src/this_package/paths/path_with_one_explicit_security/__init__.py +src/this_package/paths/path_with_one_explicit_security/get/__init__.py +src/this_package/paths/path_with_one_explicit_security/get/operation.py +src/this_package/paths/path_with_one_explicit_security/get/responses/__init__.py +src/this_package/paths/path_with_one_explicit_security/get/responses/response_200/__init__.py +src/this_package/paths/path_with_one_explicit_security/get/security/__init__.py +src/this_package/paths/path_with_one_explicit_security/get/security/security_requirement_object_0.py +src/this_package/paths/path_with_security_from_root/__init__.py +src/this_package/paths/path_with_security_from_root/get/__init__.py +src/this_package/paths/path_with_security_from_root/get/operation.py +src/this_package/paths/path_with_security_from_root/get/responses/__init__.py +src/this_package/paths/path_with_security_from_root/get/responses/response_200/__init__.py +src/this_package/paths/path_with_two_explicit_security/__init__.py +src/this_package/paths/path_with_two_explicit_security/get/__init__.py +src/this_package/paths/path_with_two_explicit_security/get/operation.py +src/this_package/paths/path_with_two_explicit_security/get/responses/__init__.py +src/this_package/paths/path_with_two_explicit_security/get/responses/response_200/__init__.py +src/this_package/paths/path_with_two_explicit_security/get/security/__init__.py +src/this_package/paths/path_with_two_explicit_security/get/security/security_requirement_object_0.py +src/this_package/paths/path_with_two_explicit_security/get/security/security_requirement_object_1.py +src/this_package/rest.py +src/this_package/schemas.py +src/this_package/security/__init__.py +src/this_package/security/security_requirement_object_0.py +src/this_package/security/security_requirement_object_1.py +src/this_package/security/security_requirement_object_2.py +src/this_package/security/security_requirement_object_3.py +src/this_package/security_schemes.py +src/this_package/server.py +src/this_package/servers/__init__.py +src/this_package/servers/server_0.py +test-requirements.txt +test/__init__.py +test/components/__init__.py +test/components/schema/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/test_path_with_no_explicit_security/__init__.py +test/test_paths/test_path_with_no_explicit_security/test_get.py +test/test_paths/test_path_with_one_explicit_security/__init__.py +test/test_paths/test_path_with_one_explicit_security/test_get.py +test/test_paths/test_path_with_security_from_root/__init__.py +test/test_paths/test_path_with_security_from_root/test_get.py +test/test_paths/test_path_with_two_explicit_security/__init__.py +test/test_paths/test_path_with_two_explicit_security/test_get.py +tox.ini diff --git a/samples/openapi3/client/features/security/python/.openapi-generator/VERSION b/samples/openapi3/client/features/security/python/.openapi-generator/VERSION new file mode 100644 index 00000000000..359a5b952d4 --- /dev/null +++ b/samples/openapi3/client/features/security/python/.openapi-generator/VERSION @@ -0,0 +1 @@ +2.0.0 \ No newline at end of file diff --git a/samples/openapi3/client/features/security/python/.travis.yml b/samples/openapi3/client/features/security/python/.travis.yml new file mode 100644 index 00000000000..38d8ccea99e --- /dev/null +++ b/samples/openapi3/client/features/security/python/.travis.yml @@ -0,0 +1,13 @@ +# ref: https://docs.travis-ci.com/user/languages/python +language: python +python: + - "3.5" + - "3.6" + - "3.7" + - "3.8" +# command to install dependencies +install: + - "pip install -r requirements.txt" + - "pip install -r test-requirements.txt" +# command to run tests +script: pytest --cov=this_package diff --git a/samples/openapi3/client/features/security/python/Makefile b/samples/openapi3/client/features/security/python/Makefile new file mode 100644 index 00000000000..b73277d308c --- /dev/null +++ b/samples/openapi3/client/features/security/python/Makefile @@ -0,0 +1,13 @@ +SETUP_OUT=*.egg-info +VENV=venv + +clean: + rm -rf $(SETUP_OUT) + rm -rf $(VENV) + rm -rf .tox + rm -rf .coverage + find . -name "*.py[oc]" -delete + find . -name "__pycache__" -delete + +test: clean + bash ./test_python.sh \ No newline at end of file diff --git a/samples/openapi3/client/features/security/python/README.md b/samples/openapi3/client/features/security/python/README.md new file mode 100644 index 00000000000..0fbc6110a82 --- /dev/null +++ b/samples/openapi3/client/features/security/python/README.md @@ -0,0 +1,255 @@ +# this-package +No description provided (generated by Openapi JSON Schema Generator https://github.com/openapi-json-schema-tools/openapi-json-schema-generator) + +This Python package is automatically generated by the [OpenAPI JSON Schema Generator](https://github.com/openapi-json-schema-tools/openapi-json-schema-generator) project: + +- API version: 1.0 +- Package version: 1.0.0 +- Build package: PythonClientCodegen + +## Requirements + +Python >=3.7 + +## Migration Guides +- [2.0.0 Migration Guide](migration_2_0_0.md) +- [Migration from Other Python Generators](migration_other_python_generators.md) + + +## Installation +### pip install + +If the python package is hosted on a repository, you can install directly using: + +```sh +pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git +``` +(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`) + +Then import the package: +```python +import this_package +``` + +### Setuptools + +Install via [Setuptools](http://pypi.python.org/pypi/setuptools). + +```sh +python -m pip install . --user +``` +(or `python -m pip install .` to install the package for all users) + +Then import the package: +```python +import this_package +``` + +## Usage Notes +### Validation, Immutability, and Data Type +This python code validates data to schema classes and return back an immutable instance containing the data +which subclasses all validated schema classes. This ensure that +- valid data cannot be mutated and become invalid to a set of schemas + - the one exception is that files are not immutable, so schema instances storing/sending/receiving files are not immutable +- one can use isinstance to check if a instance or property is valid to a schema class + - this means that expensive validation does not need to be run twice + +
    + Reason + +To do that, some changes had to be made. Python bool and NoneType cannot be subclassed, +so to be able to meet the above design goals, I implemented BoolClass and NoneClass classes +to allow schemas to subclass them. + +In python 0 == False and 1 == True. This is a problem for json schema which is language independent. +The [json schema test suite](https://github.com/json-schema-org/JSON-Schema-Test-Suite) has +[explicit tests that require that 0 != False and 1 != True](https://github.com/json-schema-org/JSON-Schema-Test-Suite/blob/main/tests/draft2020-12/type.json#L260-L267) +Using the above described BoolClass and NoneClasses allows those tests to pass. +- Another example of a package using it's own boolean class is [numpy's bool_](https://numpy.org/doc/stable/reference/arrays.scalars.html#numpy.bool_) +
    + +If you need to check is True/False/None, instead use instance.is_true_()/.is_false_()/.is_none_() + +Here is the mapping from json schema types to python subclassed types: +| Json Schema Type | Python Base Class | +| ---------------- | ----------------- | +| object | frozendict.frozendict | +| array | tuple | +| string | str | +| number | decimal.Decimal | +| integer | decimal.Decimal | +| boolean | BoolClass | +| null | NoneClass | +| AnyType (unset) | typing.Union[frozendict.frozendict, tuple, str, decimal.Decimal, BoolClass, NoneClass] | + +### Storage of Json Schema Definition in Python Classes +In openapi v3.0.3 there are ~ 28 json schema keywords. Almost all of them can apply if +type is unset. This data could be stored as +1. class properties +2. in a container in the class like in a dict or in a nested class + +This data is stored in a nested class named Schema_. +Storing this data as a nested class ensures that the data is encapsulated, does not collide with +class properties, and allows for deeper complex inline definitions. + +
    + Reason + +If the data were stored at the class property level, then the keywords could collide with +type object property names. To avoid that, one could make the properties semi or fully private with +a single or double underscore prefix, but that it a lot of data to put there. +Better to separate out json schema data from type object properties at the class property level. + +If the data were stored in a container that would segregate the different data which is good. +But json schemas can be inlined to any depth. Those complex deeper schemas would need to be included. +One could define them higher in the class file and then refer to them in the dict. That would required +iterating over schemas and adding all of the inner into a collection, and then generate that collection. + +The schema definitions are already nested from the json schema definition. The easiest solution is +to use a nested json schema definition class which holds that data. That way: +- the data is separated from class properties +- deeper complicated schemas can still be stored + +So a nested class was chosen to store json schema data, this class is named Schema_. +- The [django project uses this same pattern to store model class metadata in a Meta class](https://docs.djangoproject.com/en/4.1/topics/db/models/#meta-options) +
    + +### Json Schema Type Object +Most component schemas (models) are probably of type object. Which is a map data structure. +Json schema allows string keys in this map, which means schema properties can have key names that are +invalid python variable names. Names like: +- "hi-there" +- "1variable" +- "@now" +- " " +- "from" + +To allow these use cases to work, frozendict.frozendict is used as the base class of type object schemas. +This means that one can use normal dict methods on instances of these classes. + +
    + Other Details + +- optional properties which were not set will not exist in the instance +- None is only allowed in as a value if type: "null" was included or nullable: true was set +- type hints are written for accessing values by key literals like instance["hi-there"] +- and there is a method instance.get_item_["hi-there"] which returns an schemas.Unset value if the key was not set +- required properties with valid python names are accessible with instance.SomeRequiredProp + which uses the exact key from the openapi document + - preserving the original key names is required to properly validate a payload to multiple json schemas +
    + +### Json Schema Type + Format, Validated Data Storage +N schemas can be validated on the same payload. +To allow multiple schemas to validate, the data must be stored using one base class whether or not +a json schema format constraint exists in the schema. +See te below accessors for string data: +- type string + format: See .as_date_, .as_datetime_, .as_decimal_, .as_uuid_ + +In json schema, type: number with no format validates both integers and floats, so decimal.Decimal is used to store them. +See te below accessors for number data: +- type number + format: See .as_float_, .as_int_ + +
    + String + Date Example + +For example the string payload '2023-12-20' is validates to both of these schemas: +1. string only +``` +- type: string +``` +2. string and date format +``` +- type: string + format: date +``` +Because of use cases like this, a datetime.date is allowed as an input to this schema, but the data +is stored as a string, with a date accessor, instance.as_date_ +
    + +## Getting Started + +Please follow the [installation procedure](#installation) and then run the following: + +```python +import this_package +from this_package.configurations import api_configuration +from this_package.apis.tags import default_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with this_package.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = default_api.DefaultApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + # path with no explicit security + api_response = api_instance.path_with_no_explicit_security() + pprint(api_response) + except this_package.ApiException as e: + print("Exception when calling DefaultApi->path_with_no_explicit_security: %s\n" % e) +``` + +## Servers +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](docs/servers/server_0.md) | + +## Security + +Set auth info by setting ApiConfiguration.security_scheme_info to a dict where the +key is the below security scheme quoted name, and the value is an instance of the linked +component security scheme class. See how to do this in the endpoint code sample. + +| Security Index | Security Scheme to Scope Names | +| -------------- | ------------------------------ | +| 0 | ["api_key"](docs/components/security_schemes/security_scheme_api_key.md) []
    | +| 1 | ["http_basic_test"](docs/components/security_schemes/security_scheme_http_basic_test.md) []
    | +| 2 | no security | +| 3 | ["http_basic_test"](docs/components/security_schemes/security_scheme_http_basic_test.md) []
    ["api_key"](docs/components/security_schemes/security_scheme_api_key.md) []
    | + +## Endpoints + +All URIs are relative to the selected server +- The server is selected by passing in server_info and server_index into api_configuration.ApiConfiguration +- Code samples in endpoints documents show how to do this +- server_index can also be passed in to endpoint calls, see endpoint documentation + +HTTP request | Method | Description +------------ | ------ | ------------- +/pathWithNoExplicitSecurity **get** | [DefaultApi](docs/apis/tags/default_api.md).[path_with_no_explicit_security](docs/paths/path_with_no_explicit_security/get.md) | path with no explicit security +/pathWithOneExplicitSecurity **get** | [DefaultApi](docs/apis/tags/default_api.md).[path_with_one_explicit_security](docs/paths/path_with_one_explicit_security/get.md) | path with one explicit security +/pathWithSecurityFromRoot **get** | [DefaultApi](docs/apis/tags/default_api.md).[path_with_security_from_root](docs/paths/path_with_security_from_root/get.md) | path with security from root +/pathWithTwoExplicitSecurity **get** | [DefaultApi](docs/apis/tags/default_api.md).[path_with_two_explicit_security](docs/paths/path_with_two_explicit_security/get.md) | path with two explicit security + +## Component SecuritySchemes + +Class | Description +----- | ------------ +[ApiKey](docs/components/security_schemes/security_scheme_api_key.md) | apiKey in header +[BearerTest](docs/components/security_schemes/security_scheme_bearer_test.md) | http bearer with JWT bearer format +[HttpBasicTest](docs/components/security_schemes/security_scheme_http_basic_test.md) | http basic + + +## Notes for Large OpenAPI documents +If the OpenAPI document is large, imports in this_package.apis.tags.tag_to_api and this_package.components.schemas may fail with a +RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions: + +Solution 1: +Use specific imports for apis and models like: +- tagged api: `from this_package.apis.tags.default_api import DefaultApi` +- api for one path: `from this_package.apis.paths.some_path import SomePath` +- api for one operation (path + verb): `from this_package.paths.some_path.get import ApiForget` +- single model import: `from this_package.components.schema.pet import Pet` + +Solution 2: +Before importing the package, adjust the maximum recursion limit as shown below: +``` +import sys +sys.setrecursionlimit(1500) +import this_package +from this_package.apis.tags.tag_to_api import * +from this_package.components.schemas import * +``` diff --git a/samples/openapi3/client/features/security/python/docs/apis/tags/default_api.md b/samples/openapi3/client/features/security/python/docs/apis/tags/default_api.md new file mode 100644 index 00000000000..69b36c71e96 --- /dev/null +++ b/samples/openapi3/client/features/security/python/docs/apis/tags/default_api.md @@ -0,0 +1,20 @@ + +this_package.apis.tags.default_api +# DefaultApi + +## Description +operations that lack tags are assigned this default tag + +All URIs are relative to the selected server +- The server is selected by passing in server_info and server_index into api_configuration.ApiConfiguration +- Code samples in endpoints documents show how to do this +- server_index can also be passed in to endpoint calls, see endpoint documentation + +Method | Description +------ | ------------- +[**path_with_no_explicit_security**](../../paths/path_with_no_explicit_security/get.md) | path with no explicit security +[**path_with_one_explicit_security**](../../paths/path_with_one_explicit_security/get.md) | path with one explicit security +[**path_with_security_from_root**](../../paths/path_with_security_from_root/get.md) | path with security from root +[**path_with_two_explicit_security**](../../paths/path_with_two_explicit_security/get.md) | path with two explicit security + +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/features/security/python/docs/components/security_schemes/security_scheme_api_key.md b/samples/openapi3/client/features/security/python/docs/components/security_schemes/security_scheme_api_key.md new file mode 100644 index 00000000000..b8f6bac1672 --- /dev/null +++ b/samples/openapi3/client/features/security/python/docs/components/security_schemes/security_scheme_api_key.md @@ -0,0 +1,21 @@ +this_package.components.security_schemes.security_scheme_api_key +# SecurityScheme ApiKey + +## Description +apiKey in header + +## Type +security_schemes.SecuritySchemeType.API_KEY + +## Name +"api_key" + +## api_key +Type | Notes +---- | ------ +str | Set by the developer + +## In Location +security_schemes.ApiKeyInLocation.HEADER + +[[Back to top]](#top) [[Back to Component Security Schemes]](../../../README.md#Component-SecuritySchemes) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/features/security/python/docs/components/security_schemes/security_scheme_bearer_test.md b/samples/openapi3/client/features/security/python/docs/components/security_schemes/security_scheme_bearer_test.md new file mode 100644 index 00000000000..2897c986598 --- /dev/null +++ b/samples/openapi3/client/features/security/python/docs/components/security_schemes/security_scheme_bearer_test.md @@ -0,0 +1,21 @@ +this_package.components.security_schemes.security_scheme_bearer_test +# SecurityScheme BearerTest + +## Description +http bearer with JWT bearer format + +## Type +security_schemes.SecuritySchemeType.HTTP + +## Scheme +security_schemes.HTTPSchemeType.BEARER + +## Bearer Format +"JWT" + +## access_token +Type | Notes +---- | ------ +str | Set by the developer + +[[Back to top]](#top) [[Back to Component Security Schemes]](../../../README.md#Component-SecuritySchemes) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/features/security/python/docs/components/security_schemes/security_scheme_http_basic_test.md b/samples/openapi3/client/features/security/python/docs/components/security_schemes/security_scheme_http_basic_test.md new file mode 100644 index 00000000000..ceb34bb0f00 --- /dev/null +++ b/samples/openapi3/client/features/security/python/docs/components/security_schemes/security_scheme_http_basic_test.md @@ -0,0 +1,23 @@ +this_package.components.security_schemes.security_scheme_http_basic_test +# SecurityScheme HttpBasicTest + +## Description +http basic + +## Type +security_schemes.SecuritySchemeType.HTTP + +## Scheme +security_schemes.HTTPSchemeType.BASIC + +## user_id +Type | Notes +---- | ------ +str | Set by the developer + +## password +Type | Notes +---- | ------ +str | Set by the developer + +[[Back to top]](#top) [[Back to Component Security Schemes]](../../../README.md#Component-SecuritySchemes) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/features/security/python/docs/paths/path_with_no_explicit_security/get.md b/samples/openapi3/client/features/security/python/docs/paths/path_with_no_explicit_security/get.md new file mode 100644 index 00000000000..7aa36d6f02b --- /dev/null +++ b/samples/openapi3/client/features/security/python/docs/paths/path_with_no_explicit_security/get.md @@ -0,0 +1,89 @@ +this_package.paths.path_with_no_explicit_security.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| path_with_no_explicit_security | [DefaultApi](../../apis/tags/default_api.md) | This api is only for tag=default | +| get | ApiForGet | This api is only for this endpoint | +| get | PathWithNoExplicitSecurity | This api is only for path=/pathWithNoExplicitSecurity | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Summary | path with no explicit security | +| Path | "/pathWithNoExplicitSecurity" | +| HTTP Method | get | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | OK + +## ResponseFor200 + +### Description +OK + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://localhost:3000 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import this_package +from this_package.configurations import api_configuration +from this_package.apis.tags import default_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with this_package.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = default_api.DefaultApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + # path with no explicit security + api_response = api_instance.path_with_no_explicit_security() + pprint(api_response) + except this_package.ApiException as e: + print("Exception when calling DefaultApi->path_with_no_explicit_security: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to DefaultApi API]](../../apis/tags/default_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/features/security/python/docs/paths/path_with_one_explicit_security/get.md b/samples/openapi3/client/features/security/python/docs/paths/path_with_one_explicit_security/get.md new file mode 100644 index 00000000000..fecb2c82d0b --- /dev/null +++ b/samples/openapi3/client/features/security/python/docs/paths/path_with_one_explicit_security/get.md @@ -0,0 +1,115 @@ +this_package.paths.path_with_one_explicit_security.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| path_with_one_explicit_security | [DefaultApi](../../apis/tags/default_api.md) | This api is only for tag=default | +| get | ApiForGet | This api is only for this endpoint | +| get | PathWithOneExplicitSecurity | This api is only for path=/pathWithOneExplicitSecurity | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Security](#security) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Summary | path with one explicit security | +| Path | "/pathWithOneExplicitSecurity" | +| HTTP Method | get | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | OK + +## ResponseFor200 + +### Description +OK + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Security + +Set auth info by setting ApiConfiguration.security_scheme_info to a dict where the +key is the below security scheme quoted name, and the value is an instance of the linked +component security scheme class. +Select the security index by setting ApiConfiguration.security_index_info or by +passing in security_index into the endpoint method. +See how to do this in the code sample. +- these securities are specific to this to this endpoint + +| Security Index | Security Scheme to Scope Names | +| -------------- | ------------------------------ | +| 0 | ["api_key"](../../components/security_schemes/security_scheme_api_key.md) []
    | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://localhost:3000 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import this_package +from this_package.configurations import api_configuration +from this_package.apis.tags import default_api +from pprint import pprint +# security_index 0 +from this_package.components.security_schemes import security_scheme_api_key + +# security_scheme_info for security_index 0 +security_scheme_info: api_configuration.SecuritySchemeInfo = { + "api_key": security_scheme_api_key.ApiKey( + api_key='sampleApiKeyValue' + ), +} + +used_configuration = api_configuration.ApiConfiguration( + security_scheme_info=security_scheme_info +) +# Enter a context with an instance of the API client +with this_package.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = default_api.DefaultApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + # path with one explicit security + api_response = api_instance.path_with_one_explicit_security() + pprint(api_response) + except this_package.ApiException as e: + print("Exception when calling DefaultApi->path_with_one_explicit_security: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to DefaultApi API]](../../apis/tags/default_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/features/security/python/docs/paths/path_with_security_from_root/get.md b/samples/openapi3/client/features/security/python/docs/paths/path_with_security_from_root/get.md new file mode 100644 index 00000000000..c3c32a8a045 --- /dev/null +++ b/samples/openapi3/client/features/security/python/docs/paths/path_with_security_from_root/get.md @@ -0,0 +1,149 @@ +this_package.paths.path_with_security_from_root.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| path_with_security_from_root | [DefaultApi](../../apis/tags/default_api.md) | This api is only for tag=default | +| get | ApiForGet | This api is only for this endpoint | +| get | PathWithSecurityFromRoot | This api is only for path=/pathWithSecurityFromRoot | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Security](#security) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Summary | path with security from root | +| Path | "/pathWithSecurityFromRoot" | +| HTTP Method | get | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | OK + +## ResponseFor200 + +### Description +OK + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Security + +Set auth info by setting ApiConfiguration.security_scheme_info to a dict where the +key is the below security scheme quoted name, and the value is an instance of the linked +component security scheme class. +Select the security index by setting ApiConfiguration.security_index_info or by +passing in security_index into the endpoint method. +See how to do this in the code sample. +- these securities are the general api securities + +| Security Index | Security Scheme to Scope Names | +| -------------- | ------------------------------ | +| 0 | ["api_key"](../../components/security_schemes/security_scheme_api_key.md) []
    | +| 1 | ["http_basic_test"](../../components/security_schemes/security_scheme_http_basic_test.md) []
    | +| 2 | no security | +| 3 | ["http_basic_test"](../../components/security_schemes/security_scheme_http_basic_test.md) []
    ["api_key"](../../components/security_schemes/security_scheme_api_key.md) []
    | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://localhost:3000 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import this_package +from this_package.configurations import api_configuration +from this_package.apis.tags import default_api +from pprint import pprint +# security_index 0 +from this_package.components.security_schemes import security_scheme_api_key +# security_index 1 +from this_package.components.security_schemes import security_scheme_http_basic_test +# security_index 3 +from this_package.components.security_schemes import security_scheme_http_basic_test +from this_package.components.security_schemes import security_scheme_api_key + +# security_scheme_info for security_index 0 +security_scheme_info: api_configuration.SecuritySchemeInfo = { + "api_key": security_scheme_api_key.ApiKey( + api_key='sampleApiKeyValue' + ), +} + + +# security_scheme_info for security_index 1 +security_scheme_info: api_configuration.SecuritySchemeInfo = { + "http_basic_test": security_scheme_http_basic_test.HttpBasicTest( + user_id='someUserIdOrName', + password='somePassword', + ), +} + + +# security_scheme_info for security_index 2 +# no auth required for this security_index +security_scheme_info: api_configuration.SecuritySchemeInfo = {} + + +# security_scheme_info for security_index 3 +security_scheme_info: api_configuration.SecuritySchemeInfo = { + "http_basic_test": security_scheme_http_basic_test.HttpBasicTest( + user_id='someUserIdOrName', + password='somePassword', + ), + "api_key": security_scheme_api_key.ApiKey( + api_key='sampleApiKeyValue' + ), +} + +used_configuration = api_configuration.ApiConfiguration( + security_scheme_info=security_scheme_info +) +# Enter a context with an instance of the API client +with this_package.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = default_api.DefaultApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + # path with security from root + api_response = api_instance.path_with_security_from_root() + pprint(api_response) + except this_package.ApiException as e: + print("Exception when calling DefaultApi->path_with_security_from_root: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to DefaultApi API]](../../apis/tags/default_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/features/security/python/docs/paths/path_with_two_explicit_security/get.md b/samples/openapi3/client/features/security/python/docs/paths/path_with_two_explicit_security/get.md new file mode 100644 index 00000000000..c0a712f2d1b --- /dev/null +++ b/samples/openapi3/client/features/security/python/docs/paths/path_with_two_explicit_security/get.md @@ -0,0 +1,126 @@ +this_package.paths.path_with_two_explicit_security.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| path_with_two_explicit_security | [DefaultApi](../../apis/tags/default_api.md) | This api is only for tag=default | +| get | ApiForGet | This api is only for this endpoint | +| get | PathWithTwoExplicitSecurity | This api is only for path=/pathWithTwoExplicitSecurity | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Security](#security) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Summary | path with two explicit security | +| Path | "/pathWithTwoExplicitSecurity" | +| HTTP Method | get | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | OK + +## ResponseFor200 + +### Description +OK + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Security + +Set auth info by setting ApiConfiguration.security_scheme_info to a dict where the +key is the below security scheme quoted name, and the value is an instance of the linked +component security scheme class. +Select the security index by setting ApiConfiguration.security_index_info or by +passing in security_index into the endpoint method. +See how to do this in the code sample. +- these securities are specific to this to this endpoint + +| Security Index | Security Scheme to Scope Names | +| -------------- | ------------------------------ | +| 0 | ["api_key"](../../components/security_schemes/security_scheme_api_key.md) []
    | +| 1 | ["bearer_test"](../../components/security_schemes/security_scheme_bearer_test.md) []
    | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://localhost:3000 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | + +## Code Sample + +```python +import this_package +from this_package.configurations import api_configuration +from this_package.apis.tags import default_api +from pprint import pprint +# security_index 0 +from this_package.components.security_schemes import security_scheme_api_key +# security_index 1 +from this_package.components.security_schemes import security_scheme_bearer_test + +# security_scheme_info for security_index 0 +security_scheme_info: api_configuration.SecuritySchemeInfo = { + "api_key": security_scheme_api_key.ApiKey( + api_key='sampleApiKeyValue' + ), +} + + +# security_scheme_info for security_index 1 +security_scheme_info: api_configuration.SecuritySchemeInfo = { + "bearer_test": security_scheme_bearer_test.BearerTest( + access_token='someAccessToken' + ), +} + +used_configuration = api_configuration.ApiConfiguration( + security_scheme_info=security_scheme_info +) +# Enter a context with an instance of the API client +with this_package.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = default_api.DefaultApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + # path with two explicit security + api_response = api_instance.path_with_two_explicit_security() + pprint(api_response) + except this_package.ApiException as e: + print("Exception when calling DefaultApi->path_with_two_explicit_security: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to DefaultApi API]](../../apis/tags/default_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/features/security/python/docs/servers/server_0.md b/samples/openapi3/client/features/security/python/docs/servers/server_0.md new file mode 100644 index 00000000000..a749b8eb2fd --- /dev/null +++ b/samples/openapi3/client/features/security/python/docs/servers/server_0.md @@ -0,0 +1,7 @@ +this_package.servers.server_0 +# Server Server0 + +## Url +http://localhost:3000 + +[[Back to top]](#top) [[Back to Servers]](../../README.md#Servers) [[Back to README]](../../README.md) diff --git a/samples/openapi3/client/features/security/python/git_push.sh b/samples/openapi3/client/features/security/python/git_push.sh new file mode 100644 index 00000000000..ced3be2b0c7 --- /dev/null +++ b/samples/openapi3/client/features/security/python/git_push.sh @@ -0,0 +1,58 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=`git remote` +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' + diff --git a/samples/openapi3/client/features/security/python/migration_2_0_0.md b/samples/openapi3/client/features/security/python/migration_2_0_0.md new file mode 100644 index 00000000000..ed19050a503 --- /dev/null +++ b/samples/openapi3/client/features/security/python/migration_2_0_0.md @@ -0,0 +1,203 @@ +# Migration v1.X.X to v2.0.0 + +- [Compatibility note for opeanpi-generator](#compatibility-note-for-opeanpi-generator) +- [Component Generation](#component-generation) +- [Packaging Changes](#packaging-changes) +- [Path Generation](#path-generation) +- [Configuration Info Refactored](#configuration-info-refactored) +- [Servers and Security Generation](#servers-and-security-generation) +- [Java Classes for Openapi Data Refactored](#java-classes-for-openapi-data-refactored) +- [Api Access by Tags and Paths Updated](#api-access-by-tags-and-paths-updated) +- [Some Method/Property/Input/Class Names Updated](#some-methodpropertyinputclass-names-updated) +- [Documentation Updated](#documentation-updated) + +## Compatibility note for opeanpi-generator +The v1.0.4 release is nearly identical to the openapi-generator v6.3.0 release + +Below is a summary of big changes when updating you code from v1.X.X to 2.0.0 + +## Component Generation +Update: +Openapi document components in "#/components/x" are now generated in a components/x packages +Ths applies to: +- headers +- parameters +- request_bodies +- responses +- schemas +- security_schemes + +The generator now writes a class for each of those generated components. + +### Reason +A lot of openapi data is $ref references throughout an openapi document. +With this update, those $ref source locations are generated with file system paths that closely mirror the openapi +document json schema path to that info. $ref definition is then imported in generated python code. +This minimizes the amount of code that is generated, imposes well defined encapsulation and allows templates to be +re-used for many types of data regardless of where the data is in the source openapi document. + +### Action +- Update where you are importing models from, models are now component schemas + - File path change: model/pet.py -> components/schema/pet.py + +## Packaging changes +Code has been updated to use .toml packaging. Code is now distributed in a src directory + +### Reason +These updates follow latest python packaging best practices + +### Action +- if you are suppressing generation of any files, you will need to edit those file paths + - File Path Change: package_name -> src/package_name + +## Path Generation +If paths contain inline descriptions of parameters, request bodies, responses, security, or servers, +then those are now generated in separate files. Those files are imported into the endpoint code. +File locations closely mirror the openapi data json schema path. + +### Reason +Generating those files in paths that closely mirror the json schema paths will allow +the generator to use $ref to any location in the openapi document in the future, not just components. +These could include: +- relative $refs +- a request body $ref referring to the request body in another endpoint + +This also allowed the generation code to work the same way regardless of where the header/requestBody etc +is in the source spec. + +Note: +Operations are now at +paths/somePath/get/operation.py +and not at +paths/somePath/get/__init__.py +to minimize the amount of memory needed when importing the python package. +The configurations.api_configuration.py file imports all servers defined at: +- openapi document root +- pathItem +- pathItem operation +And if servers were defined in pathItem operations, then every operation that contains a server would be imported +in api_configuration.py. Which could be many many files. + +So instead +- operation endpoint definition was moved to paths/somePath/get/operation.py +- paths/somePath/get/__init__.py stays empty and does not need lots of memory when api_configuration.py imports servers +- server information was kept in paths/somePath/get/servers/server_x.py + +### Action +- if you are importing any endpoint form its file, update your import + - File path update: paths/somePath/get.py -> paths/somePath/get/operation.py + +## Configuration Info Refactored +Configuration information was separated into two classes +- configurations/api_configuration.py ApiConfiguration for: + - server info + - security (auth) info + - logging info +- configurations/schema_configuration.py SchemaConfiguration for: + - disabled openapi/json-schema keywords + +### Reason +Schema validation only relies on SchemaConfiguration data and does not need to know about any ApiConfiguration info +General api configuration info was poorly structured in the legacy configuration class which had 13 inputs. +The refactored ApiConfiguration now has 4 inputs which define servers and security info. +Having these separate classes prevents circular imports when the schemas.py file imports its SchemaConfiguration class. + +### Action +- When you instantiate ApiClient, update your code to pass in an instance of SchemaConfiguration + ApiConfiguration + + +## Servers and Security Generation +Servers are now generated as separate files with one class per file wherever they were defined in the openapi document +- servers/server_0.py +- paths/somePath/servers/server_0.py +- paths/somePath/get/servers/server_0.py +Security requirements objects are now generated as separate files with one security requirement object per file +wherever they were defined in the openapi document +- security/security_requirement_object_0.py +- paths/somePath/get/security/security_requirement_object_0.py + +### Reason +Server classes now re-use schema validation code to ensure that inputs to server variables are valid. +Generating these separate files minimizes generated code and maximizes code re-use. + +### Action +- If endpoints need to use specific servers or security not at index 0, pass security_index_info + server_index_info + into ApiConfiguration when instantiating it +- If you use non-default server variable values, then update your code to pass in server_info into ApiConfiguration + +## Java Classes for Openapi Data Refactored +Almost every java class used to store openapi document data at generation time has been re-written or refactored. +The new classes are much shorter and contain only what is needed to generate code and documentation. +This will make it much easier to add new openapi v3.1.0 features like new json schema keywords. +Generator interface methods were also refactored to simplify Java model instantiation and code generation. +Almost all properties are now public static final and are: +- immutable +- publicly accessible to the templates + +### Reason +These updates make the code much more maintainable. +The number of properties that have to be maintained is much smaller +- Component Schema: ~100 properties in CodegenModel.java -> ~50 properties in CodegenSchema.java +- PathItem Operation: ~75 properties CodegenOperation: ~25 properties + +This will reduce bugs like: why can't I access this property in this template +Because instances are mostly immutable it is very clear where the wrong value is being created/assigned. + +### Action +- if you are customizing the python generator, you will need to update your java code + +## Api Access By Tags and Paths Updated +Previously, keys togo from tags and paths to apis were enums. +The code was updated to use a TypedDict and uses strings as the keys. + +### Reason +Making this change allows type hinting to work for the TypedDict with string keys + +### Action +- If you use path_to_api.py or tag_to_api.py, update the key that you use to access the api + +## Some Method/Property/Input/Class Names Updated +- is_true_oapg -> is_true_ +- is_false_oapg -> is_false_ +- is_none_oapg -> is_none_ +- as_date_oapg -> as_date_ +- as_datetime_oapg -> as_datetime_ +- as_decimal_oapg -> as_decimal_ +- as_uuid_oapg -> as_uuid_ +- as_float_oapg -> as_float_ +- as_int_oapg -> as_int_ +- get_item_oapg -> get_item_ +- from_openapi_data_oapg -> from_openapi_data_ +- _verify_typed_dict_inputs_oapg -> _verify_typed_dict_inputs +- _configuration -> configuration_ +- _arg -> arg_ +- _args -> args_ +- MetaOapg -> Schema_ +- JsonSchema -> OpenApiSchema + +### Reason +Classes can have arbitrarily named properties set on them +Endpoints can have arbitrary operationId method names set +For those reasons, I use the prefix and suffix _ to greatly reduce the likelihood of collisions +on protected + public classes/methods. + +### Action +- if you use the above methods/inputs/properties/classes update them to the latest names + +## Documentation Updated +- components now have sections in the readme + - models became component schemas +- one file is now generated for each endpoint + - that file now has a table of contents + - heading indentation levels now are indented correctly in descending order + - endpoint now includes server and security info (if security exists) +- servers section added to readme if servers were defined in the openapi document root +- security section added to readme if security was defined in the openapi document root + +### Reason +Endpoint documentation had indentation and linking bugs before, this fixes them. +When all endpoints docs were written in one file it was difficult to link ot the correct section. +How to set server and security info was unclear before, the new docs and classes should clarify that. + +### Action +- if you link to specific parts of the documentation, update your links \ No newline at end of file diff --git a/samples/openapi3/client/features/security/python/migration_other_python_generators.md b/samples/openapi3/client/features/security/python/migration_other_python_generators.md new file mode 100644 index 00000000000..36ab6416ee0 --- /dev/null +++ b/samples/openapi3/client/features/security/python/migration_other_python_generators.md @@ -0,0 +1,92 @@ +# Migration from Other Python Generators + +When switching from other python client generators you will need to make some changes to your code. + +1. This generator uses spec case for all (object) property names and parameter names. + - So if the spec has a property name like camelCase, it will use camelCase rather than camel_case + - So you will need to update how you input and read properties to use spec case + - endpoint calls will need to have their input arguments updated + - schema instance property usage and instantiation will need to be updated +2. Endpoint parameters are stored in dictionaries to prevent collisions (explanation below) + - So you will need to update how you pass data in to endpoints + - update your endpoint calls to pass in parameter data in path_params, query_params, header_params etc dict inputs +3. Endpoint responses now include the original response, the deserialized response body, and (todo)the deserialized headers + - So you will need to update your code to use response.body to access deserialized data +4. All validated data is instantiated in an instance that subclasses all validated Schema classes and Decimal/str/tuple/frozendict/NoneClass/BoolClass/bytes/io.FileIO + - This means that you can use isinstance to check if a payload validated against a schema class + - This means that no data will be of type None/True/False + - ingested None will subclass NoneClass + - ingested True will subclass BoolClass + - ingested False will subclass BoolClass + - So if you need to check is True/False/None, instead use instance.is_true_()/.is_false_()/.is_none_() +5. All validated class instances are immutable except for ones based on io.File + - This is because if properties were changed after validation, that validation would no longer apply + - So no changing values or property values after a class has been instantiated +6. String + Number types with formats + - String type data is stored as a string and if you need to access types based on its format like date, + date-time, uuid, number etc then you will need to use accessor functions on the instance + - type string + format: See .as_date_, .as_datetime_, .as_decimal_, .as_uuid_ + - type number + format: See .as_float_, .as_int_ + - this was done because openapi/json-schema defines constraints. string data may be type string with no format + keyword in one schema, and include a format constraint in another schema + - So if you need to access a string format based type, use as_date_/as_datetime_/as_decimal_/as_uuid_ + - So if you need to access a number format based type, use as_int_/as_float_ +7. Property access on AnyType(type unset) or object(dict) schemas + - Only required keys with valid python names are properties like .someProp and have type hints + - All optional keys may not exist, so properties are not defined for them + - One can access optional values with dict_instance['optionalProp'] and KeyError will be raised if it does not exist + - Use get_item_ if you need a way to always get a value whether or not the key exists + - If the key does not exist, schemas.unset is returned from calling dict_instance.get_item_('optionalProp') + - All required and optional keys have type hints for this method, and @typing.overload is used + - A type hint is also generated for additionalProperties accessed using this method + - So you will need to update you code to use some_instance['optionalProp'] to access optional property + and additionalProperty values +8. The location of the api classes has changed + - Api classes are located in your_package.apis.tags.some_api + - This change was made to eliminate redundant code generation + - Legacy generators generated the same endpoint twice if it had > 1 tag on it + - This generator defines an endpoint in one class, then inherits that class to generate + apis by tags and by paths + - This change reduces code and allows quicker run time if you use the path apis + - path apis are at your_package.apis.paths.some_path + - Those apis will only load their needed models, which is less to load than all of the resources needed in a tag api + - So you will need to update your import paths to the api classes + +### Why are Leading and Trailing Underscores in class and method names? +Classes can have arbitrarily named properties set on them +Endpoints can have arbitrary operationId method names set +For those reasons, I use the prefix and suffix _ to greatly reduce the likelihood of collisions +on protected + public classes/methods. + +### Object property spec case +This was done because when payloads are ingested, they can be validated against N number of schemas. +If the input signature used a different property name then that has mutated the payload. +So SchemaA and SchemaB must both see the camelCase spec named variable. +Also it is possible to send in two properties, named camelCase and camel_case in the same payload. +That use case should work, so spec case is used. + +### Parameter spec case +Parameters can be included in different locations including: +- query +- path +- header +- cookie + +Any of those parameters could use the same parameter names, so if every parameter +was included as an endpoint parameter in a function signature, they would collide. +For that reason, each of those inputs have been separated out into separate typed dictionaries: +- query_params +- path_params +- header_params +- cookie_params + +So when updating your code, you will need to pass endpoint parameters in using those +dictionaries. + +### Endpoint responses +Endpoint responses have been enriched to now include more information. +Any response reom an endpoint will now include the following properties: +response: urllib3.HTTPResponse +body: typing.Union[Unset, Schema] +headers: typing.Union[Unset, TODO] +Note: response header deserialization has not yet been added \ No newline at end of file diff --git a/samples/openapi3/client/features/security/python/pyproject.toml b/samples/openapi3/client/features/security/python/pyproject.toml new file mode 100644 index 00000000000..f47c989594b --- /dev/null +++ b/samples/openapi3/client/features/security/python/pyproject.toml @@ -0,0 +1,30 @@ +# Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + +[build-system] +requires = ["setuptools>=61.0"] +build-backend = "setuptools.build_meta" + +[project] +name = "this-package" +version = "1.0.0" +authors = [ + { name="OpenAPI JSON Schema Generator community" }, +] +description = "security-test" +readme = "README.md" +requires-python = ">=3.7" +dependencies = [ + "certifi >= 14.5.14", + "frozendict ~= 2.3.4", + "python-dateutil ~= 2.7.0", + "setuptools >= 61.0", + "typing_extensions ~= 4.5.0", + "urllib3 ~= 2.0.a3", +] +classifiers = [ + "Programming Language :: Python :: 3", + + "Operating System :: OS Independent", + "Topic :: Software Development :: Code Generators" +] + diff --git a/samples/openapi3/client/features/security/python/src/this_package/__init__.py b/samples/openapi3/client/features/security/python/src/this_package/__init__.py new file mode 100644 index 00000000000..5484e9e10c4 --- /dev/null +++ b/samples/openapi3/client/features/security/python/src/this_package/__init__.py @@ -0,0 +1,28 @@ +# coding: utf-8 + +# flake8: noqa + +""" + security-test + + No description provided (generated by Openapi JSON Schema Generator https://github.com/openapi-json-schema-tools/openapi-json-schema-generator) # noqa: E501 + + The version of the OpenAPI document: 1.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +__version__ = "1.0.0" + +# import ApiClient +from this_package.api_client import ApiClient + +# import Configuration +from this_package.configurations.api_configuration import ApiConfiguration + +# import exceptions +from this_package.exceptions import OpenApiException +from this_package.exceptions import ApiAttributeError +from this_package.exceptions import ApiTypeError +from this_package.exceptions import ApiValueError +from this_package.exceptions import ApiKeyError +from this_package.exceptions import ApiException diff --git a/samples/openapi3/client/features/security/python/src/this_package/api_client.py b/samples/openapi3/client/features/security/python/src/this_package/api_client.py new file mode 100644 index 00000000000..564ea769ccc --- /dev/null +++ b/samples/openapi3/client/features/security/python/src/this_package/api_client.py @@ -0,0 +1,1400 @@ +# coding: utf-8 +""" + security-test + + No description provided (generated by Openapi JSON Schema Generator https://github.com/openapi-json-schema-tools/openapi-json-schema-generator) # noqa: E501 + + The version of the OpenAPI document: 1.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime +import dataclasses +import decimal +import enum +import email +import json +import os +import io +import atexit +from multiprocessing import pool +import re +import tempfile +import typing +import typing_extensions +from urllib import parse +import urllib3 +from urllib3 import _collections, fields + +import frozendict + +from this_package import exceptions, rest, schemas, security_schemes +from this_package.configurations import schema_configuration, api_configuration + + +class RequestField(fields.RequestField): + def __eq__(self, other): + if not isinstance(other, RequestField): + return False + return self.__dict__ == other.__dict__ + + +class JSONEncoder(json.JSONEncoder): + compact_separators = (',', ':') + + def default(self, obj): + if isinstance(obj, str): + return str(obj) + elif isinstance(obj, float): + return float(obj) + elif isinstance(obj, int): + return int(obj) + elif isinstance(obj, decimal.Decimal): + if obj.as_tuple().exponent >= 0: + return int(obj) + return float(obj) + elif isinstance(obj, schemas.NoneClass): + return None + elif isinstance(obj, schemas.BoolClass): + return bool(obj) + elif isinstance(obj, (dict, frozendict.frozendict)): + return {key: self.default(val) for key, val in obj.items()} + elif isinstance(obj, (list, tuple)): + return [self.default(item) for item in obj] + raise exceptions.ApiValueError('Unable to prepare type {} for serialization'.format(obj.__class__.__name__)) + + +class ParameterInType(enum.Enum): + QUERY = 'query' + HEADER = 'header' + PATH = 'path' + COOKIE = 'cookie' + + +class ParameterStyle(enum.Enum): + MATRIX = 'matrix' + LABEL = 'label' + FORM = 'form' + SIMPLE = 'simple' + SPACE_DELIMITED = 'spaceDelimited' + PIPE_DELIMITED = 'pipeDelimited' + DEEP_OBJECT = 'deepObject' + + +class PrefixSeparatorIterator: + # A class to store prefixes and separators for rfc6570 expansions + + def __init__(self, prefix: str, separator: str): + self.prefix = prefix + self.separator = separator + self.first = True + if separator in {'.', '|', '%20'}: + item_separator = separator + else: + item_separator = ',' + self.item_separator = item_separator + + def __iter__(self): + return self + + def __next__(self): + if self.first: + self.first = False + return self.prefix + return self.separator + + +class ParameterSerializerBase: + @staticmethod + def __ref6570_item_value(in_data: typing.Any, percent_encode: bool): + """ + Get representation if str/float/int/None/items in list/ values in dict + None is returned if an item is undefined, use cases are value= + - None + - [] + - {} + - [None, None None] + - {'a': None, 'b': None} + """ + if type(in_data) in {str, float, int}: + if percent_encode: + return parse.quote(str(in_data)) + return str(in_data) + elif isinstance(in_data, schemas.none_type_): + # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 + return None + elif isinstance(in_data, list) and not in_data: + # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 + return None + elif isinstance(in_data, dict) and not in_data: + # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 + return None + raise exceptions.ApiValueError('Unable to generate a ref6570 item representation of {}'.format(in_data)) + + @staticmethod + def _to_dict(name: str, value: str): + return {name: value} + + @classmethod + def __ref6570_str_float_int_expansion( + cls, + variable_name: str, + in_data: typing.Any, + explode: bool, + percent_encode: bool, + prefix_separator_iterator: PrefixSeparatorIterator, + var_name_piece: str, + named_parameter_expansion: bool + ) -> str: + item_value = cls.__ref6570_item_value(in_data, percent_encode) + if item_value is None or (item_value == '' and prefix_separator_iterator.separator == ';'): + return next(prefix_separator_iterator) + var_name_piece + value_pair_equals = '=' if named_parameter_expansion else '' + return next(prefix_separator_iterator) + var_name_piece + value_pair_equals + item_value + + @classmethod + def __ref6570_list_expansion( + cls, + variable_name: str, + in_data: typing.Any, + explode: bool, + percent_encode: bool, + prefix_separator_iterator: PrefixSeparatorIterator, + var_name_piece: str, + named_parameter_expansion: bool + ) -> str: + item_values = [cls.__ref6570_item_value(v, percent_encode) for v in in_data] + item_values = [v for v in item_values if v is not None] + if not item_values: + # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 + return "" + value_pair_equals = '=' if named_parameter_expansion else '' + if not explode: + return ( + next(prefix_separator_iterator) + + var_name_piece + + value_pair_equals + + prefix_separator_iterator.item_separator.join(item_values) + ) + # exploded + return next(prefix_separator_iterator) + next(prefix_separator_iterator).join( + [var_name_piece + value_pair_equals + val for val in item_values] + ) + + @classmethod + def __ref6570_dict_expansion( + cls, + variable_name: str, + in_data: typing.Any, + explode: bool, + percent_encode: bool, + prefix_separator_iterator: PrefixSeparatorIterator, + var_name_piece: str, + named_parameter_expansion: bool + ) -> str: + in_data_transformed = {key: cls.__ref6570_item_value(val, percent_encode) for key, val in in_data.items()} + in_data_transformed = {key: val for key, val in in_data_transformed.items() if val is not None} + if not in_data_transformed: + # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 + return "" + value_pair_equals = '=' if named_parameter_expansion else '' + if not explode: + return ( + next(prefix_separator_iterator) + + var_name_piece + value_pair_equals + + prefix_separator_iterator.item_separator.join( + prefix_separator_iterator.item_separator.join( + item_pair + ) for item_pair in in_data_transformed.items() + ) + ) + # exploded + return next(prefix_separator_iterator) + next(prefix_separator_iterator).join( + [key + '=' + val for key, val in in_data_transformed.items()] + ) + + @classmethod + def _ref6570_expansion( + cls, + variable_name: str, + in_data: typing.Any, + explode: bool, + percent_encode: bool, + prefix_separator_iterator: PrefixSeparatorIterator + ) -> str: + """ + Separator is for separate variables like dict with explode true, not for array item separation + """ + named_parameter_expansion = prefix_separator_iterator.separator in {'&', ';'} + var_name_piece = variable_name if named_parameter_expansion else '' + if type(in_data) in {str, float, int}: + return cls.__ref6570_str_float_int_expansion( + variable_name, + in_data, + explode, + percent_encode, + prefix_separator_iterator, + var_name_piece, + named_parameter_expansion + ) + elif isinstance(in_data, schemas.none_type_): + # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 + return "" + elif isinstance(in_data, list): + return cls.__ref6570_list_expansion( + variable_name, + in_data, + explode, + percent_encode, + prefix_separator_iterator, + var_name_piece, + named_parameter_expansion + ) + elif isinstance(in_data, dict): + return cls.__ref6570_dict_expansion( + variable_name, + in_data, + explode, + percent_encode, + prefix_separator_iterator, + var_name_piece, + named_parameter_expansion + ) + # bool, bytes, etc + raise exceptions.ApiValueError('Unable to generate a ref6570 representation of {}'.format(in_data)) + + +class StyleFormSerializer(ParameterSerializerBase): + @classmethod + def _serialize_form( + cls, + in_data: typing.Union[None, int, float, str, bool, dict, list], + name: str, + explode: bool, + percent_encode: bool, + prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] = None + ) -> str: + if prefix_separator_iterator is None: + prefix_separator_iterator = PrefixSeparatorIterator('', '&') + return cls._ref6570_expansion( + variable_name=name, + in_data=in_data, + explode=explode, + percent_encode=percent_encode, + prefix_separator_iterator=prefix_separator_iterator + ) + + +class StyleSimpleSerializer(ParameterSerializerBase): + + @classmethod + def _serialize_simple( + cls, + in_data: typing.Union[None, int, float, str, bool, dict, list], + name: str, + explode: bool, + percent_encode: bool + ) -> str: + prefix_separator_iterator = PrefixSeparatorIterator('', ',') + return cls._ref6570_expansion( + variable_name=name, + in_data=in_data, + explode=explode, + percent_encode=percent_encode, + prefix_separator_iterator=prefix_separator_iterator + ) + + @classmethod + def _deserialize_simple( + cls, + in_data: str, + name: str, + explode: bool, + percent_encode: bool + ) -> typing.Union[str, typing.List[str], typing.Dict[str, str]]: + raise NotImplementedError( + "Deserialization of style=simple has not yet been added. " + "If you need this how about you submit a PR adding it?" + ) + + +class JSONDetector: + """ + Works for: + application/json + application/json; charset=UTF-8 + application/json-patch+json + application/geo+json + """ + __json_content_type_pattern = re.compile("application/[^+]*[+]?(json);?.*") + + @classmethod + def _content_type_is_json(cls, content_type: str) -> bool: + if cls.__json_content_type_pattern.match(content_type): + return True + return False + + +class Encoding: + def __init__( + self, + content_type: str, + headers: typing.Optional[typing.Dict[str, 'HeaderParameter']] = None, + style: typing.Optional[ParameterStyle] = None, + explode: bool = False, + allow_reserved: bool = False, + ): + self.content_type = content_type + self.headers = headers + self.style = style + self.explode = explode + self.allow_reserved = allow_reserved + + +@dataclasses.dataclass +class MediaType: + """ + Used to store request and response body schema information + encoding: + A map between a property name and its encoding information. + The key, being the property name, MUST exist in the schema as a property. + The encoding object SHALL only apply to requestBody objects when the media type is + multipart or application/x-www-form-urlencoded. + """ + schema: typing.Optional[typing.Type[schemas.Schema]] = None + encoding: typing.Optional[typing.Dict[str, Encoding]] = None + + +@dataclasses.dataclass +class ParameterBase(JSONDetector): + in_type: ParameterInType + required: bool + style: typing.Optional[ParameterStyle] + explode: typing.Optional[bool] + allow_reserved: typing.Optional[bool] + schema: typing.Optional[typing.Type[schemas.Schema]] + content: typing.Optional[typing.Dict[str, typing.Type[MediaType]]] + + _json_encoder = JSONEncoder() + + def __init_subclass__(cls, **kwargs): + if cls.explode is None: + if cls.style is ParameterStyle.FORM: + cls.explode = True + else: + cls.explode = False + + @classmethod + def _serialize_json( + cls, + in_data: typing.Union[None, int, float, str, bool, dict, list], + eliminate_whitespace: bool = False + ) -> str: + if eliminate_whitespace: + return json.dumps(in_data, separators=cls._json_encoder.compact_separators) + return json.dumps(in_data) + + +class PathParameter(ParameterBase, StyleSimpleSerializer): + name: str + required: bool = False + in_type: ParameterInType = ParameterInType.PATH + style: ParameterStyle = ParameterStyle.SIMPLE + explode: bool = False + allow_reserved: typing.Optional[bool] = None + schema: typing.Optional[typing.Type[schemas.Schema]] = None + content: typing.Optional[typing.Dict[str, typing.Type[schemas.Schema]]] = None + + @classmethod + def __serialize_label( + cls, + in_data: typing.Union[None, int, float, str, bool, dict, list] + ) -> typing.Dict[str, str]: + prefix_separator_iterator = PrefixSeparatorIterator('.', '.') + value = cls._ref6570_expansion( + variable_name=cls.name, + in_data=in_data, + explode=cls.explode, + percent_encode=True, + prefix_separator_iterator=prefix_separator_iterator + ) + return cls._to_dict(cls.name, value) + + @classmethod + def __serialize_matrix( + cls, + in_data: typing.Union[None, int, float, str, bool, dict, list] + ) -> typing.Dict[str, str]: + prefix_separator_iterator = PrefixSeparatorIterator(';', ';') + value = cls._ref6570_expansion( + variable_name=cls.name, + in_data=in_data, + explode=cls.explode, + percent_encode=True, + prefix_separator_iterator=prefix_separator_iterator + ) + return cls._to_dict(cls.name, value) + + @classmethod + def __serialize_simple( + cls, + in_data: typing.Union[None, int, float, str, bool, dict, list], + ) -> typing.Dict[str, str]: + value = cls._serialize_simple( + in_data=in_data, + name=cls.name, + explode=cls.explode, + percent_encode=True + ) + return cls._to_dict(cls.name, value) + + @classmethod + def serialize( + cls, + in_data: typing.Union[ + schemas.Schema, decimal.Decimal, int, float, str, datetime.date, datetime.datetime, None, bool, list, tuple, dict, frozendict.frozendict] + ) -> typing.Dict[str, str]: + if cls.schema: + cast_in_data = cls.schema(in_data) + cast_in_data = cls._json_encoder.default(cast_in_data) + """ + simple -> path + path: + returns path_params: dict + label -> path + returns path_params + matrix -> path + returns path_params + """ + if cls.style: + if cls.style is ParameterStyle.SIMPLE: + return cls.__serialize_simple(cast_in_data) + elif cls.style is ParameterStyle.LABEL: + return cls.__serialize_label(cast_in_data) + elif cls.style is ParameterStyle.MATRIX: + return cls.__serialize_matrix(cast_in_data) + # cls.content will be length one + for content_type, schema in cls.content.items(): + cast_in_data = schema(in_data) + cast_in_data = cls._json_encoder.default(cast_in_data) + if cls._content_type_is_json(content_type): + value = cls._serialize_json(cast_in_data) + return cls._to_dict(cls.name, value) + raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) + + +class QueryParameter(ParameterBase, StyleFormSerializer): + name: str + required: bool = False + in_type: ParameterInType = ParameterInType.QUERY + style: ParameterStyle = ParameterStyle.FORM + explode: typing.Optional[bool] = None + allow_reserved: typing.Optional[bool] = None + schema: typing.Optional[typing.Type[schemas.Schema]] = None + content: typing.Optional[typing.Dict[str, typing.Type[schemas.Schema]]] = None + + @classmethod + def __serialize_space_delimited( + cls, + in_data: typing.Union[None, int, float, str, bool, dict, list], + prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] + ) -> typing.Dict[str, str]: + if prefix_separator_iterator is None: + prefix_separator_iterator = cls.get_prefix_separator_iterator() + value = cls._ref6570_expansion( + variable_name=cls.name, + in_data=in_data, + explode=cls.explode, + percent_encode=True, + prefix_separator_iterator=prefix_separator_iterator + ) + return cls._to_dict(cls.name, value) + + @classmethod + def __serialize_pipe_delimited( + cls, + in_data: typing.Union[None, int, float, str, bool, dict, list], + prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] + ) -> typing.Dict[str, str]: + if prefix_separator_iterator is None: + prefix_separator_iterator = cls.get_prefix_separator_iterator() + value = cls._ref6570_expansion( + variable_name=cls.name, + in_data=in_data, + explode=cls.explode, + percent_encode=True, + prefix_separator_iterator=prefix_separator_iterator + ) + return cls._to_dict(cls.name, value) + + @classmethod + def __serialize_form( + cls, + in_data: typing.Union[None, int, float, str, bool, dict, list], + prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] + ) -> typing.Dict[str, str]: + if prefix_separator_iterator is None: + prefix_separator_iterator = cls.get_prefix_separator_iterator() + value = cls._serialize_form( + in_data, + name=cls.name, + explode=cls.explode, + percent_encode=True, + prefix_separator_iterator=prefix_separator_iterator + ) + return cls._to_dict(cls.name, value) + + @classmethod + def get_prefix_separator_iterator(cls) -> typing.Optional[PrefixSeparatorIterator]: + if cls.style is ParameterStyle.FORM: + return PrefixSeparatorIterator('?', '&') + elif cls.style is ParameterStyle.SPACE_DELIMITED: + return PrefixSeparatorIterator('', '%20') + elif cls.style is ParameterStyle.PIPE_DELIMITED: + return PrefixSeparatorIterator('', '|') + + @classmethod + def serialize( + cls, + in_data: typing.Union[ + schemas.Schema, decimal.Decimal, int, float, str, datetime.date, datetime.datetime, None, bool, list, tuple, dict, frozendict.frozendict], + prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] = None + ) -> typing.Dict[str, str]: + if cls.schema: + cast_in_data = cls.schema(in_data) + cast_in_data = cls._json_encoder.default(cast_in_data) + """ + form -> query + query: + - GET/HEAD/DELETE: could use fields + - PUT/POST: must use urlencode to send parameters + returns fields: tuple + spaceDelimited -> query + returns fields + pipeDelimited -> query + returns fields + deepObject -> query, https://github.com/OAI/OpenAPI-Specification/issues/1706 + returns fields + """ + if cls.style: + # TODO update query ones to omit setting values when [] {} or None is input + if cls.style is ParameterStyle.FORM: + return cls.__serialize_form(cast_in_data, prefix_separator_iterator) + elif cls.style is ParameterStyle.SPACE_DELIMITED: + return cls.__serialize_space_delimited(cast_in_data, prefix_separator_iterator) + elif cls.style is ParameterStyle.PIPE_DELIMITED: + return cls.__serialize_pipe_delimited(cast_in_data, prefix_separator_iterator) + # cls.content will be length one + if prefix_separator_iterator is None: + prefix_separator_iterator = cls.get_prefix_separator_iterator() + for content_type, media_type in cls.content.items(): + cast_in_data = media_type.schema(in_data) + cast_in_data = cls._json_encoder.default(cast_in_data) + if cls._content_type_is_json(content_type): + value = cls._serialize_json(cast_in_data, eliminate_whitespace=True) + return cls._to_dict( + cls.name, + next(prefix_separator_iterator) + cls.name + '=' + parse.quote(value) + ) + raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) + + +class CookieParameter(ParameterBase, StyleFormSerializer): + name: str + required: bool = False + style: ParameterStyle = ParameterStyle.FORM + in_type: ParameterInType = ParameterInType.COOKIE + explode: typing.Optional[bool] = None + allow_reserved: typing.Optional[bool] = None + schema: typing.Optional[typing.Type[schemas.Schema]] = None + content: typing.Optional[typing.Dict[str, typing.Type[schemas.Schema]]] = None + + @classmethod + def serialize( + cls, + in_data: typing.Union[ + schemas.Schema, decimal.Decimal, int, float, str, datetime.date, datetime.datetime, None, bool, list, tuple, dict, frozendict.frozendict] + ) -> typing.Dict[str, str]: + if cls.schema: + cast_in_data = cls.schema(in_data) + cast_in_data = cls._json_encoder.default(cast_in_data) + """ + form -> cookie + returns fields: tuple + """ + if cls.style: + """ + TODO add escaping of comma, space, equals + or turn encoding on + """ + value = cls._serialize_form( + cast_in_data, + explode=cls.explode, + name=cls.name, + percent_encode=False, + prefix_separator_iterator=PrefixSeparatorIterator('', '&') + ) + return cls._to_dict(cls.name, value) + # cls.content will be length one + for content_type, media_type in cls.content.items(): + cast_in_data = media_type.schema(in_data) + cast_in_data = cls._json_encoder.default(cast_in_data) + if cls._content_type_is_json(content_type): + value = cls._serialize_json(cast_in_data) + return cls._to_dict(cls.name, value) + raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) + + +class HeaderParameterWithoutName(ParameterBase, StyleSimpleSerializer): + required: bool = False + style: ParameterStyle = ParameterStyle.SIMPLE + in_type: ParameterInType = ParameterInType.HEADER + explode: bool = False + allow_reserved: typing.Optional[bool] = None + schema: typing.Optional[typing.Type[schemas.Schema]] = None + content: typing.Optional[typing.Dict[str, typing.Type[schemas.Schema]]] = None + + @staticmethod + def __to_headers(in_data: typing.Tuple[typing.Tuple[str, str], ...]) -> _collections.HTTPHeaderDict: + data = tuple(t for t in in_data if t) + headers = _collections.HTTPHeaderDict() + if not data: + return headers + headers.extend(data) + return headers + + @classmethod + def serialize( + cls, + in_data: typing.Union[ + schemas.Schema, decimal.Decimal, int, float, str, datetime.date, datetime.datetime, None, bool, list, tuple, dict, frozendict.frozendict], + name: str + ) -> _collections.HTTPHeaderDict: + if cls.schema: + cast_in_data = cls.schema(in_data) + cast_in_data = cls._json_encoder.default(cast_in_data) + """ + simple -> header + headers: PoolManager needs a mapping, tuple is close + returns headers: dict + """ + if cls.style: + value = cls._serialize_simple(cast_in_data, name, cls.explode, False) + return cls.__to_headers(((name, value),)) + # cls.content will be length one + for content_type, media_type in cls.content.items(): + cast_in_data = media_type.schema(in_data) + cast_in_data = cls._json_encoder.default(cast_in_data) + if cls._content_type_is_json(content_type): + value = cls._serialize_json(cast_in_data) + return cls.__to_headers(((name, value),)) + raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) + + @classmethod + def deserialize( + cls, + in_data: str, + name: str + ) -> schemas.Schema: + if cls.schema: + """ + simple -> header + headers: PoolManager needs a mapping, tuple is close + returns headers: dict + """ + if cls.style: + extracted_data = cls._deserialize_simple(in_data, name, cls.explode, False) + return cls.schema.from_openapi_data_(extracted_data) + # cls.content will be length one + for content_type, media_type in cls.content.items(): + if cls._content_type_is_json(content_type): + cast_in_data = json.loads(in_data) + return media_type.schema.from_openapi_data_(cast_in_data) + raise NotImplementedError('Deserialization of {} has not yet been implemented'.format(content_type)) + + +class HeaderParameter(HeaderParameterWithoutName): + name: str + + @classmethod + def serialize( + cls, + in_data: typing.Union[ + schemas.Schema, decimal.Decimal, int, float, str, datetime.date, datetime.datetime, None, bool, list, tuple, dict, frozendict.frozendict] + ) -> _collections.HTTPHeaderDict: + return super().serialize( + in_data, + cls.name + ) + + +@dataclasses.dataclass +class ApiResponse: + response: urllib3.HTTPResponse + body: typing.Union[schemas.Unset, schemas.Schema] = schemas.unset + headers: typing.Union[schemas.Unset, typing.Dict[str, schemas.Schema]] = schemas.unset + + def __init__( + self, + response: urllib3.HTTPResponse, + body: typing.Union[schemas.Unset, schemas.Schema] = schemas.unset, + headers: typing.Union[schemas.Unset, typing.Dict[str, schemas.Schema]] = schemas.unset + ): + """ + pycharm needs this to prevent 'Unexpected argument' warnings + """ + self.response = response + self.body = body + self.headers = headers + + +@dataclasses.dataclass +class ApiResponseWithoutDeserialization(ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[schemas.Unset, schemas.Schema] = schemas.unset + headers: typing.Union[schemas.Unset, typing.Dict[str, schemas.Schema]] = schemas.unset + + +class TypedDictInputVerifier: + @staticmethod + def _verify_typed_dict_inputs(cls: typing.Type[typing_extensions.TypedDict], data: typing.Dict[str, typing.Any]): + """ + Ensures that: + - required keys are present + - additional properties are not input + - value stored under required keys do not have the value schemas.unset + Note: detailed value checking is done in schema classes + """ + missing_required_keys = [] + required_keys_with_unset_values = [] + for required_key in cls.__required_keys__: + if required_key not in data: + missing_required_keys.append(required_key) + continue + value = data[required_key] + if value is schemas.unset: + required_keys_with_unset_values.append(required_key) + if missing_required_keys: + raise exceptions.ApiTypeError( + '{} missing {} required arguments: {}'.format( + cls.__name__, len(missing_required_keys), missing_required_keys + ) + ) + if required_keys_with_unset_values: + raise exceptions.ApiValueError( + '{} contains invalid unset values for {} required keys: {}'.format( + cls.__name__, len(required_keys_with_unset_values), required_keys_with_unset_values + ) + ) + + disallowed_additional_keys = [] + for key in data: + if key in cls.__required_keys__ or key in cls.__optional_keys__: + continue + disallowed_additional_keys.append(key) + if disallowed_additional_keys: + raise exceptions.ApiTypeError( + '{} got {} unexpected keyword arguments: {}'.format( + cls.__name__, len(disallowed_additional_keys), disallowed_additional_keys + ) + ) + + +T = typing.TypeVar("T") + + +@dataclasses.dataclass +class OpenApiResponse(JSONDetector, TypedDictInputVerifier, typing.Generic[T]): + __filename_content_disposition_pattern = re.compile('filename="(.+?)"') + response_cls: typing.Type[T] + content: typing.Optional[typing.Dict[str, MediaType]] = None + headers: typing.Optional[typing.Dict[str, HeaderParameterWithoutName]] = None + + @staticmethod + def __deserialize_json(response: urllib3.HTTPResponse) -> typing.Any: + # python must be >= 3.9 so we can pass in bytes into json.loads + return json.loads(response.data) + + @staticmethod + def __file_name_from_response_url(response_url: typing.Optional[str]) -> typing.Optional[str]: + if response_url is None: + return None + url_path = parse.urlparse(response_url).path + if url_path: + path_basename = os.path.basename(url_path) + if path_basename: + _filename, ext = os.path.splitext(path_basename) + if ext: + return path_basename + return None + + @classmethod + def __file_name_from_content_disposition(cls, content_disposition: typing.Optional[str]) -> typing.Optional[str]: + if content_disposition is None: + return None + match = cls.__filename_content_disposition_pattern.search(content_disposition) + if not match: + return None + return match.group(1) + + @classmethod + def __deserialize_application_octet_stream( + cls, response: urllib3.HTTPResponse + ) -> typing.Union[bytes, io.BufferedReader]: + """ + urllib3 use cases: + 1. when preload_content=True (stream=False) then supports_chunked_reads is False and bytes are returned + 2. when preload_content=False (stream=True) then supports_chunked_reads is True and + a file will be written and returned + """ + if response.supports_chunked_reads(): + file_name = ( + cls.__file_name_from_content_disposition(response.headers.get('content-disposition')) + or cls.__file_name_from_response_url(response.geturl()) + ) + + if file_name is None: + _fd, path = tempfile.mkstemp() + else: + path = os.path.join(tempfile.gettempdir(), file_name) + + with open(path, 'wb') as new_file: + chunk_size = 1024 + while True: + data = response.read(chunk_size) + if not data: + break + new_file.write(data) + # release_conn is needed for streaming connections only + response.release_conn() + new_file = open(path, 'rb') + return new_file + else: + return response.data + + @staticmethod + def __deserialize_multipart_form_data( + response: urllib3.HTTPResponse + ) -> typing.Dict[str, typing.Any]: + msg = email.message_from_bytes(response.data) + return { + part.get_param("name", header="Content-Disposition"): part.get_payload( + decode=True + ).decode(part.get_content_charset()) + if part.get_content_charset() + else part.get_payload() + for part in msg.get_payload() + } + + @classmethod + def deserialize(cls, response: urllib3.HTTPResponse, configuration: schema_configuration.SchemaConfiguration) -> T: + content_type = response.headers.get('content-type') + deserialized_body = schemas.unset + streamed = response.supports_chunked_reads() + + deserialized_headers = schemas.unset + if cls.headers is not None: + cls._verify_typed_dict_inputs(cls.response_cls.headers, response.headers) + deserialized_headers = {} + for header_name, header_param in cls.headers.items(): + header_value = response.headers.get(header_name) + if header_value is None: + continue + header_value = header_param.deserialize(header_value, header_name) + deserialized_headers[header_name] = header_value + + if cls.content is not None: + if content_type not in cls.content: + raise exceptions.ApiValueError( + f"Invalid content_type returned. Content_type='{content_type}' was returned " + f"when only {str(set(cls.content))} are defined for status_code={str(response.status)}" + ) + body_schema = cls.content[content_type].schema + if body_schema is None: + # some specs do not define response content media type schemas + return cls.response_cls( + response=response, + headers=deserialized_headers, + body=schemas.unset + ) + + if cls._content_type_is_json(content_type): + body_data = cls.__deserialize_json(response) + elif content_type == 'application/octet-stream': + body_data = cls.__deserialize_application_octet_stream(response) + elif content_type.startswith('multipart/form-data'): + body_data = cls.__deserialize_multipart_form_data(response) + content_type = 'multipart/form-data' + else: + raise NotImplementedError('Deserialization of {} has not yet been implemented'.format(content_type)) + deserialized_body = body_schema.from_openapi_data_( + body_data, configuration_=configuration) + elif streamed: + response.release_conn() + + return cls.response_cls( + response=response, + headers=deserialized_headers, + body=deserialized_body + ) + + +class ApiClient: + """Generic API client for OpenAPI client library builds. + + OpenAPI generic API client. This client handles the client- + server communication, and is invariant across implementations. Specifics of + the methods and models for each application are generated from the OpenAPI + templates. + + NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + Do not edit the class manually. + + :param configuration: api_configuration.ApiConfiguration object for this client + :param schema_configuration: schema_configuration.SchemaConfiguration object for this client + :param header_name: a header to pass when making calls to the API. + :param header_value: a header value to pass when making calls to + the API. + :param cookie: a cookie to include in the header when making calls + to the API + :param pool_threads: The number of threads to use for async requests + to the API. More threads means more concurrent API requests. + """ + + _pool = None + + def __init__( + self, + configuration: typing.Optional[api_configuration.ApiConfiguration] = None, + schema_config: typing.Optional[schema_configuration.SchemaConfiguration] = None, + header_name: typing.Optional[str] = None, + header_value: typing.Optional[str] = None, + cookie: typing.Optional[str] = None, + pool_threads: int = 1 + ): + self.configuration: api_configuration.ApiConfiguration = configuration or api_configuration.ApiConfiguration() + self.schema_configuration: schema_configuration.SchemaConfiguration = schema_config or schema_configuration.SchemaConfiguration() + self.pool_threads = pool_threads + self.rest_client = rest.RESTClientObject(self.configuration) + self.default_headers = _collections.HTTPHeaderDict() + if header_name is not None: + self.default_headers[header_name] = header_value + self.cookie = cookie + # Set default User-Agent. + self.user_agent = 'OpenAPI-JSON-Schema-Generator/1.0.0/python' + + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_value, traceback): + self.close() + + def close(self): + if self._pool: + self._pool.close() + self._pool.join() + self._pool = None + if hasattr(atexit, 'unregister'): + atexit.unregister(self.close) + + @property + def pool(self): + """Create thread pool on first request + avoids instantiating unused threadpool for blocking clients. + """ + if self._pool is None: + atexit.register(self.close) + self._pool = pool.ThreadPool(self.pool_threads) + return self._pool + + @property + def user_agent(self): + """User agent for this API client""" + return self.default_headers['User-Agent'] + + @user_agent.setter + def user_agent(self, value): + self.default_headers['User-Agent'] = value + + def set_default_header(self, header_name, header_value): + self.default_headers[header_name] = header_value + + def __call_api( + self, + resource_path: str, + method: str, + host: str, + headers: typing.Optional[_collections.HTTPHeaderDict] = None, + body: typing.Optional[typing.Union[str, bytes]] = None, + fields: typing.Optional[typing.Tuple[typing.Tuple[str, str], ...]] = None, + security_requirement_object: typing.Optional[security_schemes.SecurityRequirementObject] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> urllib3.HTTPResponse: + + # header parameters + used_headers = _collections.HTTPHeaderDict(self.default_headers) + if self.cookie: + headers['Cookie'] = self.cookie + + # auth setting + self.update_params_for_auth( + used_headers, + security_requirement_object, + resource_path, + method, + body + ) + + # must happen after cookie setting and auth setting in case user is overriding those + if headers: + used_headers.update(headers) + + # request url + url = host + resource_path + + # perform request and return response + response = self.request( + method, + url, + headers=used_headers, + fields=fields, + body=body, + stream=stream, + timeout=timeout, + ) + return response + + def call_api( + self, + resource_path: str, + method: str, + host: str, + headers: typing.Optional[_collections.HTTPHeaderDict] = None, + body: typing.Optional[typing.Union[str, bytes]] = None, + fields: typing.Optional[typing.Tuple[typing.Tuple[str, str], ...]] = None, + security_requirement_object: typing.Optional[security_schemes.SecurityRequirementObject] = None, + async_req: typing.Optional[bool] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> urllib3.HTTPResponse: + """Makes the HTTP request (synchronous) and returns deserialized data. + + To make an async_req request, set the async_req parameter. + + :param resource_path: Path to method endpoint. + :param method: Method to call. + :param headers: Header parameters to be + placed in the request header. + :param body: Request body. + :param fields: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data` + :param security_requirement_object: The security requirement object, used to apply auth when making the call + :param async_req: execute request asynchronously + :type async_req: bool, optional TODO remove, unused + :param stream: if True, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Also when True, if the openapi spec describes a file download, + the data will be written to a local filesystem file and the schemas.BinarySchema + instance will also inherit from FileSchema and schemas.FileIO + Default is False. + :type stream: bool, optional + :param timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param host: api endpoint host + :return: + If async_req parameter is True, + the request will be called asynchronously. + The method will return the request thread. + If parameter async_req is False or missing, + then the method will return the response directly. + """ + + if not async_req: + return self.__call_api( + resource_path, + method, + host, + headers, + body, + fields, + security_requirement_object, + stream, + timeout, + ) + + return self.pool.apply_async( + self.__call_api, + ( + resource_path, + method, + host, + headers, + body, + json, + fields, + security_requirement_object, + stream, + timeout, + ) + ) + + def request( + self, + method: str, + url: str, + headers: typing.Optional[_collections.HTTPHeaderDict] = None, + fields: typing.Optional[typing.Tuple[typing.Tuple[str, str], ...]] = None, + body: typing.Optional[typing.Union[str, bytes]] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> urllib3.HTTPResponse: + """Makes the HTTP request using RESTClient.""" + if method == "get": + return self.rest_client.get(url, + stream=stream, + timeout=timeout, + headers=headers) + elif method == "head": + return self.rest_client.head(url, + stream=stream, + timeout=timeout, + headers=headers) + elif method == "options": + return self.rest_client.options(url, + headers=headers, + fields=fields, + stream=stream, + timeout=timeout, + body=body) + elif method == "post": + return self.rest_client.post(url, + headers=headers, + fields=fields, + stream=stream, + timeout=timeout, + body=body) + elif method == "put": + return self.rest_client.put(url, + headers=headers, + fields=fields, + stream=stream, + timeout=timeout, + body=body) + elif method == "patch": + return self.rest_client.patch(url, + headers=headers, + fields=fields, + stream=stream, + timeout=timeout, + body=body) + elif method == "delete": + return self.rest_client.delete(url, + headers=headers, + stream=stream, + timeout=timeout, + body=body) + else: + raise exceptions.ApiValueError( + "http method must be `GET`, `HEAD`, `OPTIONS`," + " `POST`, `PATCH`, `PUT` or `DELETE`." + ) + + def update_params_for_auth( + self, + headers: _collections.HTTPHeaderDict, + security_requirement_object: typing.Optional[security_schemes.SecurityRequirementObject], + resource_path: str, + method: str, + body: typing.Optional[typing.Union[str, bytes]] = None + ): + """Updates header and query params based on authentication setting. + + :param headers: Header parameters dict to be updated. + :param security_requirement_object: the openapi security requirement object + :param resource_path: A string representation of the HTTP request resource path. + :param method: A string representation of the HTTP request method. + :param body: A object representing the body of the HTTP request. + The object type is the return value of _encoder.default(). + """ + if not security_requirement_object: + # optional auth cause, use no auth + return + for security_scheme_component_name, scope_names in security_requirement_object.items(): + security_scheme_instance = self.configuration.security_scheme_info[security_scheme_component_name] + security_scheme_instance.apply_auth( + headers, + resource_path, + method, + body, + scope_names + ) + + +class Api(TypedDictInputVerifier): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + def __init__(self, api_client: typing.Optional[ApiClient] = None): + self.api_client: ApiClient = api_client or ApiClient() + + +class SerializedRequestBody(typing_extensions.TypedDict, total=False): + body: typing.Union[str, bytes] + fields: typing.Tuple[typing.Union[RequestField, typing.Tuple[str, str]], ...] + + +class RequestBody(StyleFormSerializer, JSONDetector): + """ + A request body parameter + content: content_type to MediaType schemas.Schema info + """ + __json_encoder = JSONEncoder() + content: typing.Dict[str, MediaType] + required: bool = False + + @classmethod + def __serialize_json( + cls, + in_data: typing.Any + ) -> typing.Dict[str, bytes]: + in_data = cls.__json_encoder.default(in_data) + json_str = json.dumps(in_data, separators=(",", ":"), ensure_ascii=False).encode( + "utf-8" + ) + return dict(body=json_str) + + @staticmethod + def __serialize_text_plain(in_data: typing.Any) -> typing.Dict[str, str]: + if isinstance(in_data, frozendict.frozendict): + raise ValueError('Unable to serialize type frozendict.frozendict to text/plain') + elif isinstance(in_data, tuple): + raise ValueError('Unable to serialize type tuple to text/plain') + elif isinstance(in_data, schemas.NoneClass): + raise ValueError('Unable to serialize type NoneClass to text/plain') + elif isinstance(in_data, schemas.BoolClass): + raise ValueError('Unable to serialize type BoolClass to text/plain') + return dict(body=str(in_data)) + + @classmethod + def __multipart_json_item(cls, key: str, value: schemas.Schema) -> RequestField: + json_value = cls.__json_encoder.default(value) + request_field = RequestField(name=key, data=json.dumps(json_value)) + request_field.make_multipart(content_type='application/json') + return request_field + + @classmethod + def __multipart_form_item(cls, key: str, value: schemas.Schema) -> RequestField: + if isinstance(value, str): + request_field = RequestField(name=key, data=str(value)) + request_field.make_multipart(content_type='text/plain') + elif isinstance(value, bytes): + request_field = RequestField(name=key, data=value) + request_field.make_multipart(content_type='application/octet-stream') + elif isinstance(value, schemas.FileIO): + # TODO use content.encoding to limit allowed content types if they are present + request_field = RequestField.from_tuples(key, (os.path.basename(value.name), value.read())) + value.close() + else: + request_field = cls.__multipart_json_item(key=key, value=value) + return request_field + + @classmethod + def __serialize_multipart_form_data( + cls, in_data: schemas.Schema + ) -> typing.Dict[str, typing.Tuple[RequestField, ...]]: + if not isinstance(in_data, frozendict.frozendict): + raise ValueError(f'Unable to serialize {in_data} to multipart/form-data because it is not a dict of data') + """ + In a multipart/form-data request body, each schema property, or each element of a schema array property, + takes a section in the payload with an internal header as defined by RFC7578. The serialization strategy + for each property of a multipart/form-data request body can be specified in an associated Encoding Object. + + When passing in multipart types, boundaries MAY be used to separate sections of the content being + transferred – thus, the following default Content-Types are defined for multipart: + + If the (object) property is a primitive, or an array of primitive values, the default Content-Type is text/plain + If the property is complex, or an array of complex values, the default Content-Type is application/json + Question: how is the array of primitives encoded? + If the property is a type: string with a contentEncoding, the default Content-Type is application/octet-stream + """ + fields = [] + for key, value in in_data.items(): + if isinstance(value, tuple): + if value: + # values use explode = True, so the code makes a RequestField for each item with name=key + for item in value: + request_field = cls.__multipart_form_item(key=key, value=item) + fields.append(request_field) + else: + # send an empty array as json because exploding will not send it + request_field = cls.__multipart_json_item(key=key, value=value) + fields.append(request_field) + else: + request_field = cls.__multipart_form_item(key=key, value=value) + fields.append(request_field) + + return dict(fields=tuple(fields)) + + @staticmethod + def __serialize_application_octet_stream(in_data: schemas.BinarySchema) -> typing.Dict[str, bytes]: + if isinstance(in_data, bytes): + return dict(body=in_data) + # schemas.FileIO type + result = dict(body=in_data.read()) + in_data.close() + return result + + @classmethod + def __serialize_application_x_www_form_data( + cls, in_data: typing.Any + ) -> SerializedRequestBody: + """ + POST submission of form data in body + """ + if not isinstance(in_data, frozendict.frozendict): + raise ValueError( + f'Unable to serialize {in_data} to application/x-www-form-urlencoded because it is not a dict of data') + cast_in_data = cls.__json_encoder.default(in_data) + value = cls._serialize_form(cast_in_data, name='', explode=True, percent_encode=True) + return dict(body=value) + + @classmethod + def serialize( + cls, in_data: typing.Any, content_type: str + ) -> SerializedRequestBody: + """ + If a str is returned then the result will be assigned to data when making the request + If a tuple is returned then the result will be used as fields input in encode_multipart_formdata + Return a tuple of + + The key of the return dict is + - body for application/json + - encode_multipart and fields for multipart/form-data + """ + media_type = cls.content[content_type] + if isinstance(in_data, media_type.schema): + cast_in_data = in_data + elif isinstance(in_data, (dict, frozendict.frozendict)) and in_data: + cast_in_data = media_type.schema(**in_data) + else: + cast_in_data = media_type.schema(in_data) + # TODO check for and use encoding if it exists + # and content_type is multipart or application/x-www-form-urlencoded + if cls._content_type_is_json(content_type): + return cls.__serialize_json(cast_in_data) + elif content_type == 'text/plain': + return cls.__serialize_text_plain(cast_in_data) + elif content_type == 'multipart/form-data': + return cls.__serialize_multipart_form_data(cast_in_data) + elif content_type == 'application/x-www-form-urlencoded': + return cls.__serialize_application_x_www_form_data(cast_in_data) + elif content_type == 'application/octet-stream': + return cls.__serialize_application_octet_stream(cast_in_data) + raise NotImplementedError('Serialization has not yet been implemented for {}'.format(content_type)) diff --git a/samples/openapi3/client/petstore/python/petstore_api/apis/__init__.py b/samples/openapi3/client/features/security/python/src/this_package/apis/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python/petstore_api/apis/__init__.py rename to samples/openapi3/client/features/security/python/src/this_package/apis/__init__.py diff --git a/samples/openapi3/client/features/security/python/src/this_package/apis/path_to_api.py b/samples/openapi3/client/features/security/python/src/this_package/apis/path_to_api.py new file mode 100644 index 00000000000..3f15addab19 --- /dev/null +++ b/samples/openapi3/client/features/security/python/src/this_package/apis/path_to_api.py @@ -0,0 +1,26 @@ +import typing +import typing_extensions + +from this_package.apis.paths.path_with_no_explicit_security import PathWithNoExplicitSecurity +from this_package.apis.paths.path_with_one_explicit_security import PathWithOneExplicitSecurity +from this_package.apis.paths.path_with_security_from_root import PathWithSecurityFromRoot +from this_package.apis.paths.path_with_two_explicit_security import PathWithTwoExplicitSecurity + +PathToApi = typing_extensions.TypedDict( + 'PathToApi', + { + "/pathWithNoExplicitSecurity": typing.Type[PathWithNoExplicitSecurity], + "/pathWithOneExplicitSecurity": typing.Type[PathWithOneExplicitSecurity], + "/pathWithSecurityFromRoot": typing.Type[PathWithSecurityFromRoot], + "/pathWithTwoExplicitSecurity": typing.Type[PathWithTwoExplicitSecurity], + } +) + +path_to_api = PathToApi( + { + "/pathWithNoExplicitSecurity": PathWithNoExplicitSecurity, + "/pathWithOneExplicitSecurity": PathWithOneExplicitSecurity, + "/pathWithSecurityFromRoot": PathWithSecurityFromRoot, + "/pathWithTwoExplicitSecurity": PathWithTwoExplicitSecurity, + } +) diff --git a/samples/openapi3/client/features/security/python/src/this_package/apis/paths/__init__.py b/samples/openapi3/client/features/security/python/src/this_package/apis/paths/__init__.py new file mode 100644 index 00000000000..55179ce77cd --- /dev/null +++ b/samples/openapi3/client/features/security/python/src/this_package/apis/paths/__init__.py @@ -0,0 +1,3 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from this_package.apis.path_to_api import path_to_api \ No newline at end of file diff --git a/samples/openapi3/client/features/security/python/src/this_package/apis/paths/path_with_no_explicit_security.py b/samples/openapi3/client/features/security/python/src/this_package/apis/paths/path_with_no_explicit_security.py new file mode 100644 index 00000000000..47488a6629d --- /dev/null +++ b/samples/openapi3/client/features/security/python/src/this_package/apis/paths/path_with_no_explicit_security.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from this_package.paths.path_with_no_explicit_security.get.operation import ApiForGet + + +class PathWithNoExplicitSecurity( + ApiForGet, +): + pass diff --git a/samples/openapi3/client/features/security/python/src/this_package/apis/paths/path_with_one_explicit_security.py b/samples/openapi3/client/features/security/python/src/this_package/apis/paths/path_with_one_explicit_security.py new file mode 100644 index 00000000000..18bfce2f1d3 --- /dev/null +++ b/samples/openapi3/client/features/security/python/src/this_package/apis/paths/path_with_one_explicit_security.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from this_package.paths.path_with_one_explicit_security.get.operation import ApiForGet + + +class PathWithOneExplicitSecurity( + ApiForGet, +): + pass diff --git a/samples/openapi3/client/features/security/python/src/this_package/apis/paths/path_with_security_from_root.py b/samples/openapi3/client/features/security/python/src/this_package/apis/paths/path_with_security_from_root.py new file mode 100644 index 00000000000..46043e31b59 --- /dev/null +++ b/samples/openapi3/client/features/security/python/src/this_package/apis/paths/path_with_security_from_root.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from this_package.paths.path_with_security_from_root.get.operation import ApiForGet + + +class PathWithSecurityFromRoot( + ApiForGet, +): + pass diff --git a/samples/openapi3/client/features/security/python/src/this_package/apis/paths/path_with_two_explicit_security.py b/samples/openapi3/client/features/security/python/src/this_package/apis/paths/path_with_two_explicit_security.py new file mode 100644 index 00000000000..8e80eae915f --- /dev/null +++ b/samples/openapi3/client/features/security/python/src/this_package/apis/paths/path_with_two_explicit_security.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from this_package.paths.path_with_two_explicit_security.get.operation import ApiForGet + + +class PathWithTwoExplicitSecurity( + ApiForGet, +): + pass diff --git a/samples/openapi3/client/features/security/python/src/this_package/apis/tag_to_api.py b/samples/openapi3/client/features/security/python/src/this_package/apis/tag_to_api.py new file mode 100644 index 00000000000..c58c06a5153 --- /dev/null +++ b/samples/openapi3/client/features/security/python/src/this_package/apis/tag_to_api.py @@ -0,0 +1,17 @@ +import typing +import typing_extensions + +from this_package.apis.tags.default_api import DefaultApi + +TagToApi = typing_extensions.TypedDict( + 'TagToApi', + { + "default": typing.Type[DefaultApi], + } +) + +tag_to_api = TagToApi( + { + "default": DefaultApi, + } +) diff --git a/samples/openapi3/client/features/security/python/src/this_package/apis/tags/__init__.py b/samples/openapi3/client/features/security/python/src/this_package/apis/tags/__init__.py new file mode 100644 index 00000000000..55ef8cf0321 --- /dev/null +++ b/samples/openapi3/client/features/security/python/src/this_package/apis/tags/__init__.py @@ -0,0 +1,3 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from this_package.apis.tag_to_api import tag_to_api \ No newline at end of file diff --git a/samples/openapi3/client/features/security/python/src/this_package/apis/tags/default_api.py b/samples/openapi3/client/features/security/python/src/this_package/apis/tags/default_api.py new file mode 100644 index 00000000000..aa980347df8 --- /dev/null +++ b/samples/openapi3/client/features/security/python/src/this_package/apis/tags/default_api.py @@ -0,0 +1,26 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from this_package.paths.path_with_one_explicit_security.get.operation import PathWithOneExplicitSecurity +from this_package.paths.path_with_no_explicit_security.get.operation import PathWithNoExplicitSecurity +from this_package.paths.path_with_security_from_root.get.operation import PathWithSecurityFromRoot +from this_package.paths.path_with_two_explicit_security.get.operation import PathWithTwoExplicitSecurity + + +class DefaultApi( + PathWithOneExplicitSecurity, + PathWithNoExplicitSecurity, + PathWithSecurityFromRoot, + PathWithTwoExplicitSecurity, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + pass diff --git a/samples/openapi3/client/features/security/python/src/this_package/components/schemas/__init__.py b/samples/openapi3/client/features/security/python/src/this_package/components/schemas/__init__.py new file mode 100644 index 00000000000..31197d997c1 --- /dev/null +++ b/samples/openapi3/client/features/security/python/src/this_package/components/schemas/__init__.py @@ -0,0 +1,13 @@ +# coding: utf-8 + +# flake8: noqa + +# import all models into this package +# if you have many models here with many references from one model to another this may +# raise a RecursionError +# to avoid this, import only the models that you directly need like: +# from from this_package.components.schema.pet import Pet +# or import this package, but before doing it, use: +# import sys +# sys.setrecursionlimit(n) + diff --git a/samples/openapi3/client/features/security/python/src/this_package/components/security_schemes/__init__.py b/samples/openapi3/client/features/security/python/src/this_package/components/security_schemes/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/features/security/python/src/this_package/components/security_schemes/security_scheme_api_key.py b/samples/openapi3/client/features/security/python/src/this_package/components/security_schemes/security_scheme_api_key.py new file mode 100644 index 00000000000..86b5d1f7ede --- /dev/null +++ b/samples/openapi3/client/features/security/python/src/this_package/components/security_schemes/security_scheme_api_key.py @@ -0,0 +1,21 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import typing +import typing_extensions + +from this_package import security_schemes + +@dataclasses.dataclass +class ApiKey(security_schemes.ApiKeySecurityScheme): + ''' + apiKey in header + ''' + name: str = "api_key" + in_location: security_schemes.ApiKeyInLocation = security_schemes.ApiKeyInLocation.HEADER diff --git a/samples/openapi3/client/features/security/python/src/this_package/components/security_schemes/security_scheme_bearer_test.py b/samples/openapi3/client/features/security/python/src/this_package/components/security_schemes/security_scheme_bearer_test.py new file mode 100644 index 00000000000..59c01eba03e --- /dev/null +++ b/samples/openapi3/client/features/security/python/src/this_package/components/security_schemes/security_scheme_bearer_test.py @@ -0,0 +1,20 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import typing +import typing_extensions + +from this_package import security_schemes + +@dataclasses.dataclass +class BearerTest(security_schemes.HTTPBearerSecurityScheme): + ''' + http bearer with JWT bearer format + ''' + bearer_format = "JWT" diff --git a/samples/openapi3/client/features/security/python/src/this_package/components/security_schemes/security_scheme_http_basic_test.py b/samples/openapi3/client/features/security/python/src/this_package/components/security_schemes/security_scheme_http_basic_test.py new file mode 100644 index 00000000000..47dc80c71df --- /dev/null +++ b/samples/openapi3/client/features/security/python/src/this_package/components/security_schemes/security_scheme_http_basic_test.py @@ -0,0 +1,19 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import typing +import typing_extensions + +from this_package import security_schemes + +@dataclasses.dataclass +class HttpBasicTest(security_schemes.HTTPBasicSecurityScheme): + ''' + http basic + ''' diff --git a/samples/openapi3/client/features/security/python/src/this_package/configurations/__init__.py b/samples/openapi3/client/features/security/python/src/this_package/configurations/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/features/security/python/src/this_package/configurations/api_configuration.py b/samples/openapi3/client/features/security/python/src/this_package/configurations/api_configuration.py new file mode 100644 index 00000000000..86b96971044 --- /dev/null +++ b/samples/openapi3/client/features/security/python/src/this_package/configurations/api_configuration.py @@ -0,0 +1,322 @@ +# coding: utf-8 + +""" + security-test + + No description provided (generated by Openapi JSON Schema Generator https://github.com/openapi-json-schema-tools/openapi-json-schema-generator) # noqa: E501 + + The version of the OpenAPI document: 1.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import copy +from http import client as http_client +import logging +import multiprocessing +import sys +import typing +import typing_extensions + +import urllib3 + +from this_package import exceptions +from this_package import security_schemes +from this_package.components.security_schemes import security_scheme_api_key +from this_package.components.security_schemes import security_scheme_bearer_test +from this_package.components.security_schemes import security_scheme_http_basic_test +from this_package.servers import server_0 + +# security scheme key identifier to security scheme instance +SecuritySchemeInfo = typing_extensions.TypedDict( + 'SecuritySchemeInfo', + { + "api_key": security_scheme_api_key.ApiKey, + "bearer_test": security_scheme_bearer_test.BearerTest, + "http_basic_test": security_scheme_http_basic_test.HttpBasicTest, + }, + total=False +) + +""" +the default security_index to use at each openapi document json path +the fallback value is stored in the 'security' key +""" +SecurityIndexInfo = typing_extensions.TypedDict( + 'SecurityIndexInfo', + { + 'security': typing_extensions.Literal[0, 1, 2, 3], + "paths//pathWithOneExplicitSecurity/get/security": typing_extensions.Literal[0], + "paths//pathWithTwoExplicitSecurity/get/security": typing_extensions.Literal[0, 1], + }, + total=False +) + +# the server to use at each openapi document json path +ServerInfo = typing_extensions.TypedDict( + 'ServerInfo', + { + 'servers/0': server_0.Server0, + }, + total=False +) + +""" +the default server_index to use at each openapi document json path +the fallback value is stored in the 'servers' key +""" +ServerIndexInfo = typing_extensions.TypedDict( + 'ServerIndexInfo', + { + 'servers': typing_extensions.Literal[0], + }, + total=False +) + + +class ApiConfiguration(object): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator + + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + Do not edit the class manually. + + :param security_scheme_info: the security scheme auth info that can be used when calling endpoints + The key is a string that identifies the component security scheme that one is adding auth info for + The value is an instance of the component security scheme class for that security scheme + See the SecuritySchemeInfo TypedDict definition + :param security_index_info: path to security_index information + :param server_info: the servers that can be used to make endpoint calls + :param server_index_info: index to servers configuration + """ + + def __init__( + self, + security_scheme_info: typing.Optional[SecuritySchemeInfo] = None, + security_index_info: typing.Optional[SecurityIndexInfo] = None, + server_info: typing.Optional[ServerInfo] = None, + server_index_info: typing.Optional[ServerIndexInfo] = None, + ): + """Constructor + """ + # Authentication Settings + self.security_scheme_info: SecuritySchemeInfo = security_scheme_info or SecuritySchemeInfo() + self.security_index_info: SecurityIndexInfo = security_index_info or {'security': 0} + # Server Info + self.server_info: ServerInfo = server_info or { + 'servers/0': server_0.Server0(), + } + self.server_index_info: ServerIndexInfo = server_index_info or {'servers': 0} + self.logger = {} + """Logging Settings + """ + self.logger["package_logger"] = logging.getLogger("this_package") + self.logger["urllib3_logger"] = logging.getLogger("urllib3") + self.logger_format = '%(asctime)s %(levelname)s %(message)s' + """Log format + """ + self.logger_stream_handler = None + """Log stream handler + """ + self.logger_file_handler = None + """Log file handler + """ + self.logger_file = None + """Debug file location + """ + self.debug = False + """Debug switch + """ + + self.verify_ssl = True + """SSL/TLS verification + Set this to false to skip verifying SSL certificate when calling API + from https server. + """ + self.ssl_ca_cert = None + """Set this to customize the certificate file to verify the peer. + """ + self.cert_file = None + """client certificate file + """ + self.key_file = None + """client key file + """ + self.assert_hostname = None + """Set this to True/False to enable/disable SSL hostname verification. + """ + + self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 + """urllib3 connection pool's maximum number of connections saved + per pool. urllib3 uses 1 connection as default value, but this is + not the best value when you are making a lot of possibly parallel + requests to the same host, which is often the case here. + cpu_count * 5 is used as default value to increase performance. + """ + + self.proxy = None + """Proxy URL + """ + self.proxy_headers = None + """Proxy headers + """ + self.safe_chars_for_path_param = '' + """Safe chars for path_param + """ + self.retries = None + """Adding retries to override urllib3 default value 3 + """ + # Enable client side validation + self.client_side_validation = True + + # Options to pass down to the underlying urllib3 socket + self.socket_options = None + + def __deepcopy__(self, memo): + cls = self.__class__ + result = cls.__new__(cls) + memo[id(self)] = result + for k, v in self.__dict__.items(): + if k not in ('logger', 'logger_file_handler'): + setattr(result, k, copy.deepcopy(v, memo)) + # shallow copy of loggers + result.logger = copy.copy(self.logger) + # use setters to configure loggers + result.logger_file = self.logger_file + result.debug = self.debug + return result + + @property + def logger_file(self): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + return self.__logger_file + + @logger_file.setter + def logger_file(self, value): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + self.__logger_file = value + if self.__logger_file: + # If set logging file, + # then add file handler and remove stream handler. + self.logger_file_handler = logging.FileHandler(self.__logger_file) + self.logger_file_handler.setFormatter(self.logger_formatter) + for _, logger in self.logger.items(): + logger.addHandler(self.logger_file_handler) + + @property + def debug(self): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + return self.__debug + + @debug.setter + def debug(self, value): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + self.__debug = value + if self.__debug: + # if debug status is True, turn on debug logging + for _, logger in self.logger.items(): + logger.setLevel(logging.DEBUG) + # turn on http_client debug + http_client.HTTPConnection.debuglevel = 1 + else: + # if debug status is False, turn off debug logging, + # setting log level to default `logging.WARNING` + for _, logger in self.logger.items(): + logger.setLevel(logging.WARNING) + # turn off http_client debug + http_client.HTTPConnection.debuglevel = 0 + + @property + def logger_format(self): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + return self.__logger_format + + @logger_format.setter + def logger_format(self, value): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + self.__logger_format = value + self.logger_formatter = logging.Formatter(self.__logger_format) + + def to_debug_report(self): + """Gets the essential information for debugging. + + :return: The report for debugging. + """ + return "Python SDK Debug Report:\n"\ + "OS: {env}\n"\ + "Python Version: {pyversion}\n"\ + "Version of the API: 1.0\n"\ + "SDK Package Version: 1.0.0".\ + format(env=sys.platform, pyversion=sys.version) + + def get_server_url( + self, + key_prefix: str, + index: typing.Optional[int], + ) -> str: + """Gets host URL based on the index + :param index: array index of the host settings + :return: URL based on host settings + """ + if index: + used_index = index + else: + try: + used_index = self.server_index_info[key_prefix] + except KeyError: + # fallback and use the default index + used_index = self.server_index_info["servers"] + server = self.server_info[f"{key_prefix}/{used_index}"] + return server.url + + def get_security_requirement_object( + self, + key_prefix: str, + security_requirement_objects: typing.List[security_schemes.SecurityRequirementObject], + index: typing.Optional[int], + ) -> security_schemes.SecurityRequirementObject: + """Gets security_schemes.SecurityRequirementObject based on the index + :param index: array index of the SecurityRequirementObject + :return: the selected security_schemes.SecurityRequirementObject + """ + if index: + used_index = index + else: + try: + used_index = self.security_index_info[key_prefix] + except KeyError: + # fallback and use the default index + used_index = self.security_index_info["security"] + return security_requirement_objects[used_index] diff --git a/samples/openapi3/client/features/security/python/src/this_package/configurations/schema_configuration.py b/samples/openapi3/client/features/security/python/src/this_package/configurations/schema_configuration.py new file mode 100644 index 00000000000..ea1d0e633d3 --- /dev/null +++ b/samples/openapi3/client/features/security/python/src/this_package/configurations/schema_configuration.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + security-test + + No description provided (generated by Openapi JSON Schema Generator https://github.com/openapi-json-schema-tools/openapi-json-schema-generator) # noqa: E501 + + The version of the OpenAPI document: 1.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing + +from this_package import exceptions + + +PYTHON_KEYWORD_TO_JSON_SCHEMA_KEYWORD = { + 'types': 'type', + 'enum_value_to_name': 'enum', + 'unique_items': 'uniqueItems', + 'min_items': 'minItems', + 'max_items': 'maxItems', + 'min_properties': 'minProperties', + 'max_properties': 'maxProperties', + 'min_length': 'minLength', + 'max_length': 'maxLength', + 'inclusive_minimum': 'minimum', + 'exclusive_minimum': 'exclusiveMinimum', + 'inclusive_maximum': 'maximum', + 'exclusive_maximum': 'exclusiveMaximum', + 'multiple_of': 'multipleOf', + 'regex': 'pattern', + 'format': 'format', + 'required': 'required', + 'items': 'items', + 'Items': 'items', + 'Properties': 'properties', + 'additional_properties': 'additionalProperties', + 'additionalProperties': 'additionalProperties', + 'OneOf': 'oneOf', + 'AnyOf': 'anyOf', + 'AllOf': 'allOf', + '_not': 'not', + '_Not': 'not', + 'discriminator': 'discriminator' +} + +class SchemaConfiguration: + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator + + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + Do not edit the class manually. + + :param disabled_json_schema_keywords (set): Set of + JSON schema validation keywords to disable JSON schema structural validation + rules. The following keywords may be specified: multipleOf, maximum, + exclusiveMaximum, minimum, exclusiveMinimum, maxLength, minLength, pattern, + maxItems, minItems. + By default, the validation is performed for data generated locally by the client + and data received from the server, independent of any validation performed by + the server side. If the input data does not satisfy the JSON schema validation + rules specified in the OpenAPI document, an exception is raised. + If disabled_json_schema_keywords is set, structural validation is + disabled. This can be useful to troubleshoot data validation problem, such as + when the OpenAPI document validation rules do not match the actual API data + received by the server. + :param server_index: Index to servers configuration. + """ + + def __init__( + self, + disabled_json_schema_keywords = frozenset(), + ): + """Constructor + """ + self.disabled_json_schema_keywords = disabled_json_schema_keywords + + @property + def disabled_json_schema_keywords(self) -> typing.Set[str]: + return self.__disabled_json_schema_keywords + + @property + def disabled_json_schema_python_keywords(self) -> typing.Set[str]: + return self.__disabled_json_schema_python_keywords + + @disabled_json_schema_keywords.setter + def disabled_json_schema_keywords(self, json_keywords: typing.Set[str]): + disabled_json_schema_keywords = set() + disabled_json_schema_python_keywords = set() + for k in json_keywords: + python_keywords = {key for key, val in PYTHON_KEYWORD_TO_JSON_SCHEMA_KEYWORD.items() if val == k} + if not python_keywords: + raise exceptions.ApiValueError( + "Invalid keyword: '{0}''".format(k)) + disabled_json_schema_keywords.add(k) + disabled_json_schema_python_keywords.update(python_keywords) + self.__disabled_json_schema_keywords = disabled_json_schema_keywords + self.__disabled_json_schema_python_keywords = disabled_json_schema_python_keywords \ No newline at end of file diff --git a/samples/openapi3/client/features/security/python/src/this_package/exceptions.py b/samples/openapi3/client/features/security/python/src/this_package/exceptions.py new file mode 100644 index 00000000000..c0a303eea0e --- /dev/null +++ b/samples/openapi3/client/features/security/python/src/this_package/exceptions.py @@ -0,0 +1,135 @@ +# coding: utf-8 + +""" + security-test + + No description provided (generated by Openapi JSON Schema Generator https://github.com/openapi-json-schema-tools/openapi-json-schema-generator) # noqa: E501 + + The version of the OpenAPI document: 1.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" +import dataclasses +import typing + +from urllib3._collections import HTTPHeaderDict + + +class OpenApiException(Exception): + """The base exception class for all OpenAPIExceptions""" + + +class ApiTypeError(OpenApiException, TypeError): + def __init__(self, msg, path_to_item=None, valid_classes=None, + key_type=None): + """ Raises an exception for TypeErrors + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list): a list of keys an indices to get to the + current_item + None if unset + valid_classes (tuple): the primitive classes that current item + should be an instance of + None if unset + key_type (bool): False if our value is a value in a dict + True if it is a key in a dict + False if our item is an item in a list + None if unset + """ + self.path_to_item = path_to_item + self.valid_classes = valid_classes + self.key_type = key_type + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiTypeError, self).__init__(full_msg) + + +class ApiValueError(OpenApiException, ValueError): + def __init__(self, msg, path_to_item=None): + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list) the path to the exception in the + received_data dict. None if unset + """ + + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiValueError, self).__init__(full_msg) + + +class ApiAttributeError(OpenApiException, AttributeError): + def __init__(self, msg, path_to_item=None): + """ + Raised when an attribute reference or assignment fails. + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiAttributeError, self).__init__(full_msg) + + +class ApiKeyError(OpenApiException, KeyError): + def __init__(self, msg, path_to_item=None): + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiKeyError, self).__init__(full_msg) + + +T = typing.TypeVar("T") + + +@dataclasses.dataclass +class ApiException(OpenApiException, typing.Generic[T]): + status: int + reason: str + api_response: typing.Optional[T] = None + + def __str__(self): + """Custom error messages for exception""" + error_message = "({0})\n"\ + "Reason: {1}\n".format(self.status, self.reason) + if self.api_response: + if self.api_response.response.headers: + error_message += "HTTP response headers: {0}\n".format( + self.api_response.response.headers) + if self.api_response.response.data: + error_message += "HTTP response body: {0}\n".format(self.api_response.response.data) + + return error_message + + +def render_path(path_to_item): + """Returns a string representation of a path""" + result = "" + for pth in path_to_item: + if isinstance(pth, int): + result += "[{0}]".format(pth) + else: + result += "['{0}']".format(pth) + return result diff --git a/samples/openapi3/client/features/security/python/src/this_package/paths/__init__.py b/samples/openapi3/client/features/security/python/src/this_package/paths/__init__.py new file mode 100644 index 00000000000..cd4e1d7d97f --- /dev/null +++ b/samples/openapi3/client/features/security/python/src/this_package/paths/__init__.py @@ -0,0 +1,3 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from this_package.apis import path_to_api diff --git a/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_no_explicit_security/__init__.py b/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_no_explicit_security/__init__.py new file mode 100644 index 00000000000..937c4c01de9 --- /dev/null +++ b/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_no_explicit_security/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from this_package.apis.paths.path_with_no_explicit_security import PathWithNoExplicitSecurity + +path = "/pathWithNoExplicitSecurity" \ No newline at end of file diff --git a/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_no_explicit_security/get/__init__.py b/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_no_explicit_security/get/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_no_explicit_security/get/operation.py b/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_no_explicit_security/get/operation.py new file mode 100644 index 00000000000..b39de0f0c86 --- /dev/null +++ b/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_no_explicit_security/get/operation.py @@ -0,0 +1,219 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from this_package import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from this_package import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _path_with_no_explicit_security( + self, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _path_with_no_explicit_security( + self, + skip_deserialization: typing_extensions.Literal[True], + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _path_with_no_explicit_security( + self, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _path_with_no_explicit_security( + self, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + path with no explicit security + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + # TODO add cookie handling + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='get', + host=host, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PathWithNoExplicitSecurity(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def path_with_no_explicit_security( + self, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def path_with_no_explicit_security( + self, + skip_deserialization: typing_extensions.Literal[True], + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def path_with_no_explicit_security( + self, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def path_with_no_explicit_security( + self, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._path_with_no_explicit_security( + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForGet(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def get( + self, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def get( + self, + skip_deserialization: typing_extensions.Literal[True], + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get( + self, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get( + self, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._path_with_no_explicit_security( + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_no_explicit_security/get/responses/__init__.py b/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_no_explicit_security/get/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_no_explicit_security/get/responses/response_200/__init__.py b/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_no_explicit_security/get/responses/response_200/__init__.py new file mode 100644 index 00000000000..3c8134e99d5 --- /dev/null +++ b/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_no_explicit_security/get/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from this_package import api_client +from this_package import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_one_explicit_security/__init__.py b/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_one_explicit_security/__init__.py new file mode 100644 index 00000000000..c193dacba88 --- /dev/null +++ b/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_one_explicit_security/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from this_package.apis.paths.path_with_one_explicit_security import PathWithOneExplicitSecurity + +path = "/pathWithOneExplicitSecurity" \ No newline at end of file diff --git a/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_one_explicit_security/get/__init__.py b/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_one_explicit_security/get/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_one_explicit_security/get/operation.py b/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_one_explicit_security/get/operation.py new file mode 100644 index 00000000000..f69fb4a3c2c --- /dev/null +++ b/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_one_explicit_security/get/operation.py @@ -0,0 +1,244 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from this_package import api_client, exceptions, security_schemes +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from this_package import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from .security import security_requirement_object_0 + + +_security: typing.List[security_schemes.SecurityRequirementObject] = [ + security_requirement_object_0.security_requirement_object, +] + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _path_with_one_explicit_security( + self, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _path_with_one_explicit_security( + self, + skip_deserialization: typing_extensions.Literal[True], + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _path_with_one_explicit_security( + self, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _path_with_one_explicit_security( + self, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + path with one explicit security + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + # TODO add cookie handling + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + security_requirement_object = self.api_client.configuration.get_security_requirement_object( + 'paths/' + path + '/get/security', + _security, + security_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='get', + host=host, + security_requirement_object=security_requirement_object, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PathWithOneExplicitSecurity(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def path_with_one_explicit_security( + self, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def path_with_one_explicit_security( + self, + skip_deserialization: typing_extensions.Literal[True], + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def path_with_one_explicit_security( + self, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def path_with_one_explicit_security( + self, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._path_with_one_explicit_security( + security_index=security_index, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForGet(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def get( + self, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def get( + self, + skip_deserialization: typing_extensions.Literal[True], + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get( + self, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get( + self, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._path_with_one_explicit_security( + security_index=security_index, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_one_explicit_security/get/responses/__init__.py b/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_one_explicit_security/get/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_one_explicit_security/get/responses/response_200/__init__.py b/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_one_explicit_security/get/responses/response_200/__init__.py new file mode 100644 index 00000000000..3c8134e99d5 --- /dev/null +++ b/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_one_explicit_security/get/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from this_package import api_client +from this_package import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_one_explicit_security/get/security/__init__.py b/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_one_explicit_security/get/security/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_one_explicit_security/get/security/security_requirement_object_0.py b/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_one_explicit_security/get/security/security_requirement_object_0.py new file mode 100644 index 00000000000..f73d578eb18 --- /dev/null +++ b/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_one_explicit_security/get/security/security_requirement_object_0.py @@ -0,0 +1,13 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from this_package import security_schemes + +security_requirement_object: security_schemes.SecurityRequirementObject = { + "api_key": (), +} diff --git a/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_security_from_root/__init__.py b/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_security_from_root/__init__.py new file mode 100644 index 00000000000..9b5f4865df4 --- /dev/null +++ b/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_security_from_root/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from this_package.apis.paths.path_with_security_from_root import PathWithSecurityFromRoot + +path = "/pathWithSecurityFromRoot" \ No newline at end of file diff --git a/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_security_from_root/get/__init__.py b/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_security_from_root/get/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_security_from_root/get/operation.py b/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_security_from_root/get/operation.py new file mode 100644 index 00000000000..b56090cc0da --- /dev/null +++ b/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_security_from_root/get/operation.py @@ -0,0 +1,247 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from this_package import api_client, exceptions, security_schemes +from this_package.security import ( + security_requirement_object_0, + security_requirement_object_1, + security_requirement_object_2, + security_requirement_object_3, +) +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from this_package import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + +_security: typing.List[security_schemes.SecurityRequirementObject] = [ + security_requirement_object_0.security_requirement_object, + security_requirement_object_1.security_requirement_object, + security_requirement_object_2.security_requirement_object, + security_requirement_object_3.security_requirement_object, +] + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _path_with_security_from_root( + self, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _path_with_security_from_root( + self, + skip_deserialization: typing_extensions.Literal[True], + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _path_with_security_from_root( + self, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _path_with_security_from_root( + self, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + path with security from root + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + # TODO add cookie handling + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + security_requirement_object = self.api_client.configuration.get_security_requirement_object( + 'servers', + _security, + security_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='get', + host=host, + security_requirement_object=security_requirement_object, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PathWithSecurityFromRoot(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def path_with_security_from_root( + self, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def path_with_security_from_root( + self, + skip_deserialization: typing_extensions.Literal[True], + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def path_with_security_from_root( + self, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def path_with_security_from_root( + self, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._path_with_security_from_root( + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForGet(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def get( + self, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def get( + self, + skip_deserialization: typing_extensions.Literal[True], + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get( + self, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get( + self, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._path_with_security_from_root( + security_index=security_index, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_security_from_root/get/responses/__init__.py b/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_security_from_root/get/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_security_from_root/get/responses/response_200/__init__.py b/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_security_from_root/get/responses/response_200/__init__.py new file mode 100644 index 00000000000..3c8134e99d5 --- /dev/null +++ b/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_security_from_root/get/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from this_package import api_client +from this_package import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_two_explicit_security/__init__.py b/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_two_explicit_security/__init__.py new file mode 100644 index 00000000000..154c3ccb963 --- /dev/null +++ b/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_two_explicit_security/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from this_package.apis.paths.path_with_two_explicit_security import PathWithTwoExplicitSecurity + +path = "/pathWithTwoExplicitSecurity" \ No newline at end of file diff --git a/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_two_explicit_security/get/__init__.py b/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_two_explicit_security/get/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_two_explicit_security/get/operation.py b/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_two_explicit_security/get/operation.py new file mode 100644 index 00000000000..0eb194e379c --- /dev/null +++ b/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_two_explicit_security/get/operation.py @@ -0,0 +1,248 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from this_package import api_client, exceptions, security_schemes +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from this_package import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from .security import ( + security_requirement_object_0, + security_requirement_object_1, +) + + +_security: typing.List[security_schemes.SecurityRequirementObject] = [ + security_requirement_object_0.security_requirement_object, + security_requirement_object_1.security_requirement_object, +] + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _path_with_two_explicit_security( + self, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _path_with_two_explicit_security( + self, + skip_deserialization: typing_extensions.Literal[True], + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _path_with_two_explicit_security( + self, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _path_with_two_explicit_security( + self, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + path with two explicit security + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + # TODO add cookie handling + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + security_requirement_object = self.api_client.configuration.get_security_requirement_object( + 'paths/' + path + '/get/security', + _security, + security_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='get', + host=host, + security_requirement_object=security_requirement_object, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PathWithTwoExplicitSecurity(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def path_with_two_explicit_security( + self, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def path_with_two_explicit_security( + self, + skip_deserialization: typing_extensions.Literal[True], + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def path_with_two_explicit_security( + self, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def path_with_two_explicit_security( + self, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._path_with_two_explicit_security( + security_index=security_index, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForGet(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def get( + self, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def get( + self, + skip_deserialization: typing_extensions.Literal[True], + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get( + self, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get( + self, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._path_with_two_explicit_security( + security_index=security_index, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_two_explicit_security/get/responses/__init__.py b/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_two_explicit_security/get/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_two_explicit_security/get/responses/response_200/__init__.py b/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_two_explicit_security/get/responses/response_200/__init__.py new file mode 100644 index 00000000000..3c8134e99d5 --- /dev/null +++ b/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_two_explicit_security/get/responses/response_200/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from this_package import api_client +from this_package import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_two_explicit_security/get/security/__init__.py b/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_two_explicit_security/get/security/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_two_explicit_security/get/security/security_requirement_object_0.py b/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_two_explicit_security/get/security/security_requirement_object_0.py new file mode 100644 index 00000000000..f73d578eb18 --- /dev/null +++ b/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_two_explicit_security/get/security/security_requirement_object_0.py @@ -0,0 +1,13 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from this_package import security_schemes + +security_requirement_object: security_schemes.SecurityRequirementObject = { + "api_key": (), +} diff --git a/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_two_explicit_security/get/security/security_requirement_object_1.py b/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_two_explicit_security/get/security/security_requirement_object_1.py new file mode 100644 index 00000000000..5cbd32474a2 --- /dev/null +++ b/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_two_explicit_security/get/security/security_requirement_object_1.py @@ -0,0 +1,13 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from this_package import security_schemes + +security_requirement_object: security_schemes.SecurityRequirementObject = { + "bearer_test": (), +} diff --git a/samples/openapi3/client/features/security/python/src/this_package/rest.py b/samples/openapi3/client/features/security/python/src/this_package/rest.py new file mode 100644 index 00000000000..2ba15ade23f --- /dev/null +++ b/samples/openapi3/client/features/security/python/src/this_package/rest.py @@ -0,0 +1,252 @@ +# coding: utf-8 + +""" + security-test + + No description provided (generated by Openapi JSON Schema Generator https://github.com/openapi-json-schema-tools/openapi-json-schema-generator) # noqa: E501 + + The version of the OpenAPI document: 1.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import logging +import ssl +from urllib.parse import urlencode +import typing + +import certifi +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from this_package.exceptions import ApiException, ApiValueError + + +logger = logging.getLogger(__name__) + + +class RESTClientObject(object): + + def __init__(self, configuration, pools_size=4, maxsize=None): + # urllib3.PoolManager will pass all kw parameters to connectionpool + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 + # maxsize is the number of requests to host that are allowed in parallel # noqa: E501 + # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 + + # cert_reqs + if configuration.verify_ssl: + cert_reqs = ssl.CERT_REQUIRED + else: + cert_reqs = ssl.CERT_NONE + + # ca_certs + if configuration.ssl_ca_cert: + ca_certs = configuration.ssl_ca_cert + else: + # if not set certificate file, use Mozilla's root certificates. + ca_certs = certifi.where() + + addition_pool_args = {} + if configuration.assert_hostname is not None: + addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 + + if configuration.retries is not None: + addition_pool_args['retries'] = configuration.retries + + if configuration.socket_options is not None: + addition_pool_args['socket_options'] = configuration.socket_options + + if maxsize is None: + if configuration.connection_pool_maxsize is not None: + maxsize = configuration.connection_pool_maxsize + else: + maxsize = 4 + + # https pool manager + if configuration.proxy: + self.pool_manager = urllib3.ProxyManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=ca_certs, + cert_file=configuration.cert_file, + key_file=configuration.key_file, + proxy_url=configuration.proxy, + proxy_headers=configuration.proxy_headers, + **addition_pool_args + ) + else: + self.pool_manager = urllib3.PoolManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=ca_certs, + cert_file=configuration.cert_file, + key_file=configuration.key_file, + **addition_pool_args + ) + + def request( + self, + method: str, + url: str, + headers: typing.Optional[HTTPHeaderDict] = None, + fields: typing.Optional[typing.Tuple[typing.Tuple[str, typing.Any], ...]] = None, + body: typing.Optional[typing.Union[str, bytes]] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> urllib3.HTTPResponse: + """Perform requests. + + :param method: http request method + :param url: http request url + :param headers: http request headers + :param body: request body, for other types + :param fields: request parameters for + `application/x-www-form-urlencoded` + or `multipart/form-data` + :param stream: if True, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is False. + :param timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + """ + assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', + 'PATCH', 'OPTIONS'] + + if fields and body: + raise ApiValueError( + "body parameter cannot be used with fields parameter." + ) + + fields = fields or {} + headers = headers or {} + + if timeout: + if isinstance(timeout, (int, float)): # noqa: E501,F821 + timeout = urllib3.Timeout(total=timeout) + elif (isinstance(timeout, tuple) and + len(timeout) == 2): + timeout = urllib3.Timeout(connect=timeout[0], read=timeout[1]) + + try: + # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` + if method in {'POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE'}: + if 'Content-Type' not in headers and body is None: + r = self.pool_manager.request( + method, + url, + preload_content=not stream, + timeout=timeout, + headers=headers + ) + elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 + r = self.pool_manager.request( + method, url, + body=body, + encode_multipart=False, + preload_content=not stream, + timeout=timeout, + headers=headers) + elif headers['Content-Type'] == 'multipart/form-data': + # must del headers['Content-Type'], or the correct + # Content-Type which generated by urllib3 will be + # overwritten. + del headers['Content-Type'] + r = self.pool_manager.request( + method, url, + fields=fields, + encode_multipart=True, + preload_content=not stream, + timeout=timeout, + headers=headers) + # Pass a `string` parameter directly in the body to support + # other content types than Json when `body` argument is + # provided in serialized form + elif isinstance(body, str) or isinstance(body, bytes): + request_body = body + r = self.pool_manager.request( + method, url, + body=request_body, + preload_content=not stream, + timeout=timeout, + headers=headers) + else: + # Cannot generate the request from given parameters + msg = """Cannot prepare a request message for provided + arguments. Please check that your arguments match + declared content type.""" + raise ApiException(status=0, reason=msg) + # For `GET`, `HEAD` + else: + r = self.pool_manager.request(method, url, + preload_content=not stream, + timeout=timeout, + headers=headers) + except urllib3.exceptions.SSLError as e: + msg = "{0}\n{1}".format(type(e).__name__, str(e)) + raise ApiException(status=0, reason=msg) + + if not stream: + # log response body + logger.debug("response body: %s", r.data) + + return r + + def get(self, url, headers=None, stream=False, + timeout=None, fields=None) -> urllib3.HTTPResponse: + return self.request("GET", url, + headers=headers, + stream=stream, + timeout=timeout, + fields=fields) + + def head(self, url, headers=None, stream=False, + timeout=None, fields=None) -> urllib3.HTTPResponse: + return self.request("HEAD", url, + headers=headers, + stream=stream, + timeout=timeout, + fields=fields) + + def options(self, url, headers=None, + body=None, stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: + return self.request("OPTIONS", url, + headers=headers, + stream=stream, + timeout=timeout, + body=body, fields=fields) + + def delete(self, url, headers=None, body=None, + stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: + return self.request("DELETE", url, + headers=headers, + stream=stream, + timeout=timeout, + body=body, fields=fields) + + def post(self, url, headers=None, + body=None, stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: + return self.request("POST", url, + headers=headers, + stream=stream, + timeout=timeout, + body=body, fields=fields) + + def put(self, url, headers=None, + body=None, stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: + return self.request("PUT", url, + headers=headers, + stream=stream, + timeout=timeout, + body=body, fields=fields) + + def patch(self, url, headers=None, + body=None, stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: + return self.request("PATCH", url, + headers=headers, + stream=stream, + timeout=timeout, + body=body, fields=fields) diff --git a/samples/openapi3/client/features/security/python/src/this_package/schemas.py b/samples/openapi3/client/features/security/python/src/this_package/schemas.py new file mode 100644 index 00000000000..0a3b1cd5978 --- /dev/null +++ b/samples/openapi3/client/features/security/python/src/this_package/schemas.py @@ -0,0 +1,2401 @@ +# coding: utf-8 + +""" + security-test + + No description provided (generated by Openapi JSON Schema Generator https://github.com/openapi-json-schema-tools/openapi-json-schema-generator) # noqa: E501 + + The version of the OpenAPI document: 1.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import collections +import datetime +import functools +import decimal +import io +import re +import types +import typing +import uuid + +from dateutil import parser +from dateutil.parser.isoparser import _takes_ascii +import frozendict + +from this_package import exceptions +from this_package.configurations import schema_configuration + + +class Unset(object): + """ + An instance of this class is set as the default value for object type(dict) properties that are optional + When a property has an unset value, that property will not be assigned in the dict + """ + pass + +unset = Unset() + +none_type_ = type(None) + + +class FileIO(io.FileIO): + """ + A class for storing files + Note: this class is not immutable + """ + + def __new__(cls, arg_: typing.Union[io.FileIO, io.BufferedReader]): + if isinstance(arg_, (io.FileIO, io.BufferedReader)): + if arg_.closed: + raise exceptions.ApiValueError('Invalid file state; file is closed and must be open') + arg_.close() + inst = super(FileIO, cls).__new__(cls, arg_.name) + super(FileIO, inst).__init__(arg_.name) + return inst + raise exceptions.ApiValueError('FileIO must be passed arg_ which contains the open file') + + def __init__(self, arg_: typing.Union[io.FileIO, io.BufferedReader]): + pass + + +def update(d: dict, u: dict): + """ + Adds u to d + Where each dict is collections.defaultdict(set) + """ + if not u: + return d + for k, v in u.items(): + if k not in d: + d[k] = v + else: + d[k] = d[k] | v + + +class ValidationMetadata(frozendict.frozendict): + """ + A class storing metadata that is needed to validate OpenApi Schema payloads + """ + def __new__( + cls, + path_to_item: typing.Tuple[typing.Union[str, int], ...], + configuration: schema_configuration.SchemaConfiguration, + seen_classes: typing.FrozenSet[typing.Type] = frozenset(), + validated_path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Type]] = frozendict.frozendict() + ): + """ + Args: + path_to_item: the path to the current data being instantiated. + For {'a': [1]} if the code is handling, 1, then the path is ('args[0]', 'a', 0) + This changes from location to location + configuration: the schema_configuration.SchemaConfiguration instance to use + This is needed because in schema_configuration.SchemaConfiguration: + - one can disable validation checking + This does not change from location to location + seen_classes: when deserializing data that matches multiple schemas, this is used to store + the schemas that have been traversed. This is used to stop processing when a cycle is seen. + This changes from location to location + validated_path_to_schemas: stores the already validated schema classes for a given path location + This does not change from location to location + """ + return super().__new__( + cls, + path_to_item=path_to_item, + configuration=configuration, + seen_classes=seen_classes, + validated_path_to_schemas=validated_path_to_schemas + ) + + def validation_ran_earlier(self, cls: type) -> bool: + validated_schemas = self.validated_path_to_schemas.get(self.path_to_item, set()) + validation_ran_earlier = validated_schemas and cls in validated_schemas + if validation_ran_earlier: + return True + if cls in self.seen_classes: + return True + return False + + @property + def path_to_item(self) -> typing.Tuple[typing.Union[str, int], ...]: + return self['path_to_item'] + + @property + def configuration(self) -> schema_configuration.SchemaConfiguration: + return self['configuration'] + + @property + def seen_classes(self) -> typing.FrozenSet[typing.Type]: + return self['seen_classes'] + + @property + def validated_path_to_schemas(self) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Type]]: + return self['validated_path_to_schemas'] + + +def add_deeper_validated_schemas(validation_metadata: ValidationMetadata, path_to_schemas: dict): + # this is called if validation_ran_earlier and current and deeper locations need to be added + current_path_to_item = validation_metadata.path_to_item + other_path_to_schemas = {} + for path_to_item, schemas in validation_metadata.validated_path_to_schemas.items(): + if len(path_to_item) < len(current_path_to_item): + continue + path_begins_with_current_path = path_to_item[:len(current_path_to_item)] == current_path_to_item + if path_begins_with_current_path: + other_path_to_schemas[path_to_item] = schemas + update(path_to_schemas, other_path_to_schemas) + + +class Singleton: + """ + Enums and singletons are the same + The same instance is returned for a given key of (cls, arg_) + """ + _instances = {} + + def __new__(cls, arg_: typing.Any, **kwargs): + """ + cls base classes: BoolClass, NoneClass, str, decimal.Decimal + The 3rd key is used in the tuple below for a corner case where an enum contains integer 1 + However 1.0 can also be ingested into that enum schema because 1.0 == 1 and + Decimal('1.0') == Decimal('1') + But if we omitted the 3rd value in the key, then Decimal('1.0') would be stored as Decimal('1') + and json serializing that instance would be '1' rather than the expected '1.0' + Adding the 3rd value, the str of arg_ ensures that 1.0 -> Decimal('1.0') which is serialized as 1.0 + """ + key = (cls, arg_, str(arg_)) + if key not in cls._instances: + if isinstance(arg_, (none_type_, bool, BoolClass, NoneClass)): + inst = super().__new__(cls) + cls._instances[key] = inst + else: + cls._instances[key] = super().__new__(cls, arg_) + return cls._instances[key] + + def __repr__(self): + if isinstance(self, NoneClass): + return f'<{self.__class__.__name__}: None>' + elif isinstance(self, BoolClass): + if bool(self): + return f'<{self.__class__.__name__}: True>' + return f'<{self.__class__.__name__}: False>' + return f'<{self.__class__.__name__}: {super().__repr__()}>' + + +class classproperty: + + def __init__(self, fget): + self.fget = fget + + def __get__(self, owner_self, owner_cls): + return self.fget(owner_cls) + + +class NoneClass(Singleton): + @classproperty + def NONE(cls): + return cls(None) + + def __bool__(self) -> bool: + return False + + +class BoolClass(Singleton): + @classproperty + def TRUE(cls): + return cls(True) + + @classproperty + def FALSE(cls): + return cls(False) + + @functools.lru_cache() + def __bool__(self) -> bool: + for key, instance in self._instances.items(): + if self is instance: + return bool(key[1]) + raise ValueError('Unable to find the boolean value of this instance') + + +class SchemaTyped: + types: typing.Optional[typing.Set[typing.Type]] + exclusive_maximum: typing.Union[int, float] + inclusive_maximum: typing.Union[int, float] + exclusive_minimum: typing.Union[int, float] + inclusive_minimum: typing.Union[int, float] + max_items: int + min_items: int + discriminator: typing.Dict[str, typing.Dict[str, typing.Type['Schema']]] + + + class Properties: + # to hold object properties + pass + + additionalProperties: typing.Optional[typing.Type['Schema']] + max_properties: int + min_properties: int + AllOf: typing.List[typing.Type['Schema']] + OneOf: typing.List[typing.Type['Schema']] + AnyOf: typing.List[typing.Type['Schema']] + _not: typing.Type['Schema'] + max_length: int + min_length: int + items: typing.Type['Schema'] + +PathToSchemasType = typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]] + + +def __get_valid_classes_phrase(input_classes): + """Returns a string phrase describing what types are allowed""" + all_classes = list(input_classes) + all_classes = sorted(all_classes, key=lambda cls: cls.__name__) + all_class_names = [cls.__name__ for cls in all_classes] + if len(all_class_names) == 1: + return "is {0}".format(all_class_names[0]) + return "is one of [{0}]".format(", ".join(all_class_names)) + + +def __type_error_message( + var_value=None, var_name=None, valid_classes=None, key_type=None +): + """ + Keyword Args: + var_value (any): the variable which has the type_error + var_name (str): the name of the variable which has the typ error + valid_classes (tuple): the accepted classes for current_item's + value + key_type (bool): False if our value is a value in a dict + True if it is a key in a dict + False if our item is an item in a tuple + """ + key_or_value = "value" + if key_type: + key_or_value = "key" + valid_classes_phrase = __get_valid_classes_phrase(valid_classes) + msg = "Invalid type. Required {1} type {2} and " "passed type was {3}".format( + var_name, + key_or_value, + valid_classes_phrase, + type(var_value).__name__, + ) + return msg + + +def __get_type_error(var_value, path_to_item, valid_classes, key_type=False): + error_msg = __type_error_message( + var_name=path_to_item[-1], + var_value=var_value, + valid_classes=valid_classes, + key_type=key_type, + ) + return exceptions.ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=valid_classes, + key_type=key_type, + ) + + +def validate_types( + arg: typing.Any, + allowed_types: typing.Set[typing.Type], + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> None: + if type(arg) not in allowed_types: + raise __get_type_error( + arg, + validation_metadata.path_to_item, + allowed_types, + key_type=False, + ) + return None + +def validate_enum( + arg: typing.Any, + enum_value_to_name: typing.Dict[typing.Any, str], + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> None: + if arg not in enum_value_to_name: + raise exceptions.ApiValueError("Invalid value {} passed in to {}, allowed_values={}".format(arg, cls, enum_value_to_name.keys())) + return None + + +def _raise_validation_error_message(value, constraint_msg, constraint_value, path_to_item, additional_txt=""): + raise exceptions.ApiValueError( + "Invalid value `{value}`, {constraint_msg} `{constraint_value}`{additional_txt} at {path_to_item}".format( + value=value, + constraint_msg=constraint_msg, + constraint_value=constraint_value, + additional_txt=additional_txt, + path_to_item=path_to_item, + ) + ) + + +def validate_unique_items( + arg: typing.Any, + unique_items_value: bool, + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> None: + if not unique_items_value or not isinstance(arg, tuple): + return None + if len(arg) > len(set(arg)): + _raise_validation_error_message( + value=arg, + constraint_msg="duplicate items were found, and the tuple must not contain duplicates because", + constraint_value='unique_items==True', + path_to_item=validation_metadata.path_to_item + ) + return None + + +def validate_min_items( + arg: typing.Any, + min_items: int, + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> None: + if not isinstance(arg, tuple): + return None + if len(arg) < min_items: + _raise_validation_error_message( + value=arg, + constraint_msg="number of items must be greater than or equal to", + constraint_value=min_items, + path_to_item=validation_metadata.path_to_item + ) + return None + + +def validate_max_items( + arg: typing.Any, + max_items: int, + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> None: + if not isinstance(arg, tuple): + return None + if len(arg) > max_items: + _raise_validation_error_message( + value=arg, + constraint_msg="number of items must be less than or equal to", + constraint_value=max_items, + path_to_item=validation_metadata.path_to_item + ) + return None + + +def validate_min_properties( + arg: typing.Any, + min_properties: int, + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> None: + if not isinstance(arg, frozendict.frozendict): + return None + if len(arg) < min_properties: + _raise_validation_error_message( + value=arg, + constraint_msg="number of properties must be greater than or equal to", + constraint_value=min_properties, + path_to_item=validation_metadata.path_to_item + ) + return None + + +def validate_max_properties( + arg: typing.Any, + max_properties: int, + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> None: + if not isinstance(arg, frozendict.frozendict): + return None + if len(arg) > max_properties: + _raise_validation_error_message( + value=arg, + constraint_msg="number of properties must be less than or equal to", + constraint_value=max_properties, + path_to_item=validation_metadata.path_to_item + ) + return None + + +def validate_min_length( + arg: typing.Any, + min_length: int, + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> None: + if not isinstance(arg, str): + return None + if len(arg) < min_length: + _raise_validation_error_message( + value=arg, + constraint_msg="length must be greater than or equal to", + constraint_value=min_length, + path_to_item=validation_metadata.path_to_item + ) + return None + + +def validate_max_length( + arg: typing.Any, + max_length: int, + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> None: + if not isinstance(arg, str): + return None + if len(arg) > max_length: + _raise_validation_error_message( + value=arg, + constraint_msg="length must be less than or equal to", + constraint_value=max_length, + path_to_item=validation_metadata.path_to_item + ) + return None + + +def validate_inclusive_minimum( + arg: typing.Any, + inclusive_minimum: typing.Union[int, float], + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> None: + if not isinstance(arg, decimal.Decimal): + return None + if arg < inclusive_minimum: + _raise_validation_error_message( + value=arg, + constraint_msg="must be a value greater than or equal to", + constraint_value=inclusive_minimum, + path_to_item=validation_metadata.path_to_item + ) + return None + + +def validate_exclusive_minimum( + arg: typing.Any, + exclusive_minimum: typing.Union[int, float], + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> None: + if not isinstance(arg, decimal.Decimal): + return None + if arg <= exclusive_minimum: + _raise_validation_error_message( + value=arg, + constraint_msg="must be a value greater than", + constraint_value=exclusive_minimum, + path_to_item=validation_metadata.path_to_item + ) + return None + + +def validate_inclusive_maximum( + arg: typing.Any, + inclusive_maximum: typing.Union[int, float], + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> None: + if not isinstance(arg, decimal.Decimal): + return None + if arg > inclusive_maximum: + _raise_validation_error_message( + value=arg, + constraint_msg="must be a value less than or equal to", + constraint_value=inclusive_maximum, + path_to_item=validation_metadata.path_to_item + ) + return None + + +def validate_exclusive_maximum( + arg: typing.Any, + exclusive_maximum: typing.Union[int, float], + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> None: + if not isinstance(arg, decimal.Decimal): + return None + if arg >= exclusive_maximum: + _raise_validation_error_message( + value=arg, + constraint_msg="must be a value less than", + constraint_value=exclusive_maximum, + path_to_item=validation_metadata.path_to_item + ) + return None + +def validate_multiple_of( + arg: typing.Any, + multiple_of: typing.Union[int, float], + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> None: + if not isinstance(arg, decimal.Decimal): + return None + if (not (float(arg) / multiple_of).is_integer()): + # Note 'multipleOf' will be as good as the floating point arithmetic. + _raise_validation_error_message( + value=arg, + constraint_msg="value must be a multiple of", + constraint_value=multiple_of, + path_to_item=validation_metadata.path_to_item + ) + return None + + +def validate_regex( + arg: typing.Any, + regex_dict: typing.Dict, + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> None: + if not isinstance(arg, str): + return None + flags = regex_dict.get('flags', 0) + if not re.search(regex_dict['pattern'], arg, flags=flags): + if flags != 0: + # Don't print the regex flags if the flags are not + # specified in the OAS document. + _raise_validation_error_message( + value=arg, + constraint_msg="must match regular expression", + constraint_value=regex_dict['pattern'], + path_to_item=validation_metadata.path_to_item, + additional_txt=" with flags=`{}`".format(flags) + ) + _raise_validation_error_message( + value=arg, + constraint_msg="must match regular expression", + constraint_value=regex_dict['pattern'], + path_to_item=validation_metadata.path_to_item + ) + return None + + +__int32_inclusive_minimum = decimal.Decimal(-2147483648) +__int32_inclusive_maximum = decimal.Decimal(2147483647) +__int64_inclusive_minimum = decimal.Decimal(-9223372036854775808) +__int64_inclusive_maximum = decimal.Decimal(9223372036854775807) +__float_inclusive_minimum = decimal.Decimal(-3.4028234663852886e+38) +__float_inclusive_maximum = decimal.Decimal(3.4028234663852886e+38) +__double_inclusive_minimum = decimal.Decimal(-1.7976931348623157E+308) +__double_inclusive_maximum = decimal.Decimal(1.7976931348623157E+308) + +def __validate_numeric_format( + arg: decimal.Decimal, + format: str, + validation_metadata: ValidationMetadata +) -> None: + if format[:3] == 'int': + # there is a json schema test where 1.0 validates as an integer + if arg != int(arg): + raise exceptions.ApiValueError( + "Invalid non-integer value '{}' for type {} at {}".format( + arg, format, validation_metadata.path_to_item + ) + ) + if format == 'int32': + if not __int32_inclusive_minimum <= arg <= __int32_inclusive_maximum: + raise exceptions.ApiValueError( + "Invalid value '{}' for type int32 at {}".format(arg, validation_metadata.path_to_item) + ) + return None + elif format == 'int64': + if not __int64_inclusive_minimum <= arg <= __int64_inclusive_maximum: + raise exceptions.ApiValueError( + "Invalid value '{}' for type int64 at {}".format(arg, validation_metadata.path_to_item) + ) + return None + return None + elif format in {'float', 'double'}: + if format == 'float': + if not __float_inclusive_minimum <= arg <= __float_inclusive_maximum: + raise exceptions.ApiValueError( + "Invalid value '{}' for type float at {}".format(arg, validation_metadata.path_to_item) + ) + return None + # double + if not __double_inclusive_minimum <= arg <= __double_inclusive_maximum: + raise exceptions.ApiValueError( + "Invalid value '{}' for type double at {}".format(arg, validation_metadata.path_to_item) + ) + return None + return None + + +class CustomIsoparser(parser.isoparser): + @_takes_ascii + def parse_isodatetime(self, dt_str): + components, pos = self._parse_isodate(dt_str) + if len(dt_str) > pos: + if self._sep is None or dt_str[pos:pos + 1] == self._sep: + components += self._parse_isotime(dt_str[pos + 1:]) + else: + raise ValueError('String contains unknown ISO components') + + if len(components) > 3 and components[3] == 24: + components[3] = 0 + return datetime.datetime(*components) + datetime.timedelta(days=1) + + if len(components) <= 3: + raise ValueError('Value is not a datetime') + + return datetime.datetime(*components) + + @_takes_ascii + def parse_isodate(self, datestr): + components, pos = self._parse_isodate(datestr) + + if len(datestr) > pos: + raise ValueError('String contains invalid time components') + + if len(components) > 3: + raise ValueError('String contains invalid time components') + + return datetime.date(*components) + + +DEFAULT_ISOPARSER = CustomIsoparser() + + +def __validate_string_format( + arg: str, + format: str, + validation_metadata: ValidationMetadata +) -> None: + if format == 'uuid': + try: + uuid.UUID(arg) + return None + except ValueError: + raise exceptions.ApiValueError( + "Invalid value '{}' for type UUID at {}".format(arg, validation_metadata.path_to_item) + ) + elif format == 'number': + try: + decimal.Decimal(arg) + return None + except decimal.InvalidOperation: + raise exceptions.ApiValueError( + "Value cannot be converted to a decimal. " + "Invalid value '{}' for type decimal at {}".format(arg, validation_metadata.path_to_item) + ) + elif format == 'date': + try: + DEFAULT_ISOPARSER.parse_isodate(arg) + return None + except ValueError: + raise exceptions.ApiValueError( + "Value does not conform to the required ISO-8601 date format. " + "Invalid value '{}' for type date at {}".format(arg, validation_metadata.path_to_item) + ) + elif format == 'date-time': + try: + DEFAULT_ISOPARSER.parse_isodatetime(arg) + return None + except ValueError: + raise exceptions.ApiValueError( + "Value does not conform to the required ISO-8601 datetime format. " + "Invalid value '{}' for type datetime at {}".format(arg, validation_metadata.path_to_item) + ) + return None + + +def validate_format( + arg: typing.Any, + format: str, + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> None: + # formats work for strings + numbers + if isinstance(arg, decimal.Decimal): + return __validate_numeric_format( + arg, + format, + validation_metadata + ) + elif isinstance(arg, str): + return __validate_string_format( + arg, + format, + validation_metadata + ) + return None + + +def validate_required( + arg: typing.Any, + required: typing.Set[str], + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> None: + if not isinstance(arg, frozendict.frozendict): + return None + missing_required_arguments = required - arg.keys() + if missing_required_arguments: + missing_required_arguments = list(missing_required_arguments) + missing_required_arguments.sort() + raise exceptions.ApiTypeError( + "{} is missing {} required argument{}: {}".format( + cls.__name__, + len(missing_required_arguments), + "s" if len(missing_required_arguments) > 1 else "", + missing_required_arguments + ) + ) + return None + + +def _get_class(item_cls: typing.Union[types.FunctionType, staticmethod, typing.Type['Schema']]) -> typing.Type['Schema']: + if isinstance(item_cls, types.FunctionType): + # referenced schema + return item_cls() + elif isinstance(item_cls, staticmethod): + # referenced schema + return item_cls.__func__() + return item_cls + + +def validate_items( + arg: typing.Any, + item_cls: typing.Type, + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> PathToSchemasType: + if not isinstance(arg, tuple): + return None + item_cls = _get_class(item_cls) + path_to_schemas = {} + for i, value in enumerate(arg): + item_validation_metadata = ValidationMetadata( + path_to_item=validation_metadata.path_to_item+(i,), + configuration=validation_metadata.configuration, + validated_path_to_schemas=validation_metadata.validated_path_to_schemas + ) + if item_validation_metadata.validation_ran_earlier(item_cls): + add_deeper_validated_schemas(item_validation_metadata, path_to_schemas) + continue + other_path_to_schemas = item_cls._validate( + value, validation_metadata=item_validation_metadata) + update(path_to_schemas, other_path_to_schemas) + return path_to_schemas + + +def validate_properties( + arg: typing.Any, + properties: typing.Type, + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> typing.Optional[PathToSchemasType]: + if not isinstance(arg, frozendict.frozendict): + return None + path_to_schemas = {} + present_properties = {k: v for k, v, in arg.items() if k in properties.__annotations__} + for property_name, value in present_properties.items(): + path_to_item = validation_metadata.path_to_item + (property_name,) + schema = properties.__annotations__[property_name] + schema = _get_class(schema) + arg_validation_metadata = ValidationMetadata( + path_to_item=path_to_item, + configuration=validation_metadata.configuration, + validated_path_to_schemas=validation_metadata.validated_path_to_schemas + ) + if arg_validation_metadata.validation_ran_earlier(schema): + add_deeper_validated_schemas(arg_validation_metadata, path_to_schemas) + continue + other_path_to_schemas = schema._validate(value, validation_metadata=arg_validation_metadata) + update(path_to_schemas, other_path_to_schemas) + return path_to_schemas + + +def validate_additional_properties( + arg: typing.Any, + additional_properties_schema: typing.Type, + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> typing.Optional[PathToSchemasType]: + if not isinstance(arg, frozendict.frozendict): + return None + schema = _get_class(additional_properties_schema) + path_to_schemas = {} + properties_annotations = cls.Schema_.Properties.__annotations__ if hasattr(cls.Schema_, 'Properties') else {} + present_additional_properties = {k: v for k, v, in arg.items() if k not in properties_annotations} + for property_name, value in present_additional_properties.items(): + path_to_item = validation_metadata.path_to_item + (property_name,) + arg_validation_metadata = ValidationMetadata( + path_to_item=path_to_item, + configuration=validation_metadata.configuration, + validated_path_to_schemas=validation_metadata.validated_path_to_schemas + ) + if arg_validation_metadata.validation_ran_earlier(schema): + add_deeper_validated_schemas(arg_validation_metadata, path_to_schemas) + continue + other_path_to_schemas = schema._validate(value, validation_metadata=arg_validation_metadata) + update(path_to_schemas, other_path_to_schemas) + return path_to_schemas + + +def validate_one_of( + arg: typing.Any, + one_of_container_cls: typing.Type, + cls: 'Schema', + validation_metadata: ValidationMetadata, +) -> PathToSchemasType: + oneof_classes = [] + path_to_schemas = collections.defaultdict(set) + for one_of_cls in one_of_container_cls.classes: + schema = _get_class(one_of_cls) + if schema in path_to_schemas[validation_metadata.path_to_item]: + oneof_classes.append(schema) + continue + if schema is cls: + """ + optimistically assume that cls schema will pass validation + do not invoke _validate on it because that is recursive + """ + oneof_classes.append(schema) + continue + if validation_metadata.validation_ran_earlier(schema): + oneof_classes.append(schema) + add_deeper_validated_schemas(validation_metadata, path_to_schemas) + continue + try: + path_to_schemas = schema._validate(arg, validation_metadata=validation_metadata) + except (exceptions.ApiValueError, exceptions.ApiTypeError) as ex: + # silence exceptions because the code needs to accumulate oneof_classes + continue + oneof_classes.append(schema) + if not oneof_classes: + raise exceptions.ApiValueError( + "Invalid inputs given to generate an instance of {}. None " + "of the oneOf schemas matched the input data.".format(cls) + ) + elif len(oneof_classes) > 1: + raise exceptions.ApiValueError( + "Invalid inputs given to generate an instance of {}. Multiple " + "oneOf schemas {} matched the inputs, but a max of one is allowed.".format(cls, oneof_classes) + ) + # exactly one class matches + return path_to_schemas + + +def validate_any_of( + arg: typing.Any, + any_of_container_cls: typing.Type, + cls: 'Schema', + validation_metadata: ValidationMetadata, +) -> PathToSchemasType: + anyof_classes = [] + path_to_schemas = collections.defaultdict(set) + for any_of_cls in any_of_container_cls.classes: + schema = _get_class(any_of_cls) + if schema is cls: + """ + optimistically assume that cls schema will pass validation + do not invoke _validate on it because that is recursive + """ + anyof_classes.append(schema) + continue + if validation_metadata.validation_ran_earlier(schema): + anyof_classes.append(schema) + add_deeper_validated_schemas(validation_metadata, path_to_schemas) + continue + + try: + other_path_to_schemas = schema._validate(arg, validation_metadata=validation_metadata) + except (exceptions.ApiValueError, exceptions.ApiTypeError) as ex: + # silence exceptions because the code needs to accumulate anyof_classes + continue + anyof_classes.append(schema) + update(path_to_schemas, other_path_to_schemas) + if not anyof_classes: + raise exceptions.ApiValueError( + "Invalid inputs given to generate an instance of {}. None " + "of the anyOf schemas matched the input data.".format(cls) + ) + return path_to_schemas + + +def validate_all_of( + arg: typing.Any, + all_of_cls: typing.Type, + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> PathToSchemasType: + path_to_schemas = collections.defaultdict(set) + for allof_cls in all_of_cls.classes: + schema = _get_class(allof_cls) + if schema is cls: + """ + optimistically assume that cls schema will pass validation + do not invoke _validate on it because that is recursive + """ + continue + if validation_metadata.validation_ran_earlier(schema): + add_deeper_validated_schemas(validation_metadata, path_to_schemas) + continue + other_path_to_schemas = schema._validate(arg, validation_metadata=validation_metadata) + update(path_to_schemas, other_path_to_schemas) + return path_to_schemas + + +def validate_not( + arg: typing.Any, + not_cls: typing.Type, + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> None: + not_schema = _get_class(not_cls) + other_path_to_schemas = None + not_exception = exceptions.ApiValueError( + "Invalid value '{}' was passed in to {}. Value is invalid because it is disallowed by {}".format( + arg, + cls.__name__, + not_schema.__name__, + ) + ) + if validation_metadata.validation_ran_earlier(not_schema): + raise not_exception + + try: + other_path_to_schemas = not_schema._validate(arg, validation_metadata=validation_metadata) + except (exceptions.ApiValueError, exceptions.ApiTypeError): + pass + if other_path_to_schemas: + raise not_exception + return None + + +def __ensure_discriminator_value_present( + disc_property_name: str, + validation_metadata: ValidationMetadata, + arg +): + if disc_property_name not in arg: + # The input data does not contain the discriminator property + raise exceptions.ApiValueError( + "Cannot deserialize input data due to missing discriminator. " + "The discriminator property '{}' is missing at path: {}".format(disc_property_name, validation_metadata.path_to_item) + ) + + +def __get_discriminated_class(cls, disc_property_name: str, disc_payload_value: str): + """ + Used in schemas with discriminators + """ + if not hasattr(cls.Schema_, 'discriminator'): + return None + disc = cls.Schema_.discriminator() + if disc_property_name not in disc: + return None + discriminated_cls = disc[disc_property_name].get(disc_payload_value) + if discriminated_cls is not None: + return discriminated_cls + if not ( + hasattr(cls.Schema_, 'AllOf') or + hasattr(cls.Schema_, 'OneOf') or + hasattr(cls.Schema_, 'AnyOf') + ): + return None + # TODO stop traveling if a cycle is hit + if hasattr(cls.Schema_, 'AllOf'): + for allof_cls in cls.Schema_.AllOf.classes: + allof_cls = _get_class(allof_cls) + discriminated_cls = __get_discriminated_class( + allof_cls, disc_property_name=disc_property_name, disc_payload_value=disc_payload_value) + if discriminated_cls is not None: + return discriminated_cls + if hasattr(cls.Schema_, 'OneOf'): + for oneof_cls in cls.Schema_.OneOf.classes: + oneof_cls = _get_class(oneof_cls) + discriminated_cls = __get_discriminated_class( + oneof_cls, disc_property_name=disc_property_name, disc_payload_value=disc_payload_value) + if discriminated_cls is not None: + return discriminated_cls + if hasattr(cls.Schema_, 'AnyOf'): + for anyof_cls in cls.Schema_.AnyOf.classes: + anyof_cls = _get_class(anyof_cls) + discriminated_cls = __get_discriminated_class( + anyof_cls, disc_property_name=disc_property_name, disc_payload_value=disc_payload_value) + if discriminated_cls is not None: + return discriminated_cls + return None + + +def validate_discriminator( + arg: typing.Any, + discriminator_fn: typing.Type, + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> typing.Optional[PathToSchemasType]: + if not isinstance(arg, frozendict.frozendict): + return None + discriminator = discriminator_fn.__func__() + disc_prop_name = list(discriminator.keys())[0] + __ensure_discriminator_value_present(disc_prop_name, validation_metadata, arg) + discriminated_cls = __get_discriminated_class( + cls, disc_property_name=disc_prop_name, disc_payload_value=arg[disc_prop_name] + ) + if discriminated_cls is None: + raise exceptions.ApiValueError( + "Invalid discriminator value was passed in to {}.{} Only the values {} are allowed at {}".format( + cls.__name__, + disc_prop_name, + list(discriminator[disc_prop_name].keys()), + validation_metadata.path_to_item + (disc_prop_name,) + ) + ) + if discriminated_cls is cls: + """ + Optimistically assume that cls will pass validation + If the code invoked _validate on cls it would infinitely recurse + """ + return None + if validation_metadata.validation_ran_earlier(discriminated_cls): + path_to_schemas = {} + add_deeper_validated_schemas(validation_metadata, path_to_schemas) + return path_to_schemas + updated_vm = ValidationMetadata( + path_to_item=validation_metadata.path_to_item, + configuration=validation_metadata.configuration, + seen_classes=validation_metadata.seen_classes | frozenset({cls}), + validated_path_to_schemas=validation_metadata.validated_path_to_schemas + ) + return discriminated_cls._validate(arg, validation_metadata=updated_vm) + + +json_schema_keyword_to_validator = { + 'types': validate_types, + 'enum_value_to_name': validate_enum, + 'unique_items': validate_unique_items, + 'min_items': validate_min_items, + 'max_items': validate_max_items, + 'min_properties': validate_min_properties, + 'max_properties': validate_max_properties, + 'min_length': validate_min_length, + 'max_length': validate_max_length, + 'inclusive_minimum': validate_inclusive_minimum, + 'exclusive_minimum': validate_exclusive_minimum, + 'inclusive_maximum': validate_inclusive_maximum, + 'exclusive_maximum': validate_exclusive_maximum, + 'multiple_of': validate_multiple_of, + 'regex': validate_regex, + 'format': validate_format, + 'required': validate_required, + 'items': validate_items, + 'Items': validate_items, + 'Properties': validate_properties, + 'AdditionalProperties': validate_additional_properties, + 'additional_properties': validate_additional_properties, + 'OneOf': validate_one_of, + 'AnyOf': validate_any_of, + 'AllOf': validate_all_of, + '_not': validate_not, + '_Not': validate_not, + 'ModelNot': validate_not, + 'discriminator': validate_discriminator +} + + +class Schema: + """ + the base class of all swagger/openapi schemas/models + """ + __inheritable_primitive_types_set = {decimal.Decimal, str, tuple, frozendict.frozendict, FileIO, bytes, BoolClass, NoneClass} + Schema_: SchemaTyped + __excluded_cls_properties = { + '__module__', + '__dict__', + '__weakref__', + '__doc__', + 'default', # excluded because it has no impact on validation + } + + @classmethod + def _validate( + cls, + arg, + validation_metadata: ValidationMetadata, + ) -> PathToSchemasType: + """ + Schema validate + All keyword validation except for type checking was done in calling stack frames + If those validations passed, the validated classes are collected in path_to_schemas + """ + json_schema_data = { + k: v + for k, v in vars(cls.Schema_).items() + if k not in cls.__excluded_cls_properties + and k + not in validation_metadata.configuration.disabled_json_schema_python_keywords + } + path_to_schemas = {} + for keyword, val in json_schema_data.items(): + validator = json_schema_keyword_to_validator[keyword] + + other_path_to_schemas = validator( + arg, + val, + cls, + validation_metadata, + ) + if other_path_to_schemas: + update(path_to_schemas, other_path_to_schemas) + + base_class = type(arg) + if validation_metadata.path_to_item not in path_to_schemas: + path_to_schemas[validation_metadata.path_to_item] = set() + path_to_schemas[validation_metadata.path_to_item].add(cls) + path_to_schemas[validation_metadata.path_to_item].add(base_class) + return path_to_schemas + + @staticmethod + def _process_schema_classes( + schema_classes: typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]] + ): + """ + Processes and mutates schema_classes + If a SomeSchema is a subclass of DictSchema then remove DictSchema because it is already included + """ + if len(schema_classes) < 2: + return + if len(schema_classes) > 2 and UnsetAnyTypeSchema in schema_classes: + schema_classes.remove(UnsetAnyTypeSchema) + x_schema = schema_type_classes & schema_classes + if not x_schema: + return + # the only way len == 2 is to have one be AnyTypeSchema + x_schema = x_schema.pop() if len(x_schema) == 1 else AnyTypeSchema + if any(c is not x_schema and issubclass(c, x_schema) for c in schema_classes): + # needed to not have a mro error in get_new_class + schema_classes.remove(x_schema) + + @staticmethod + def __bases_by_type(): + return { + str: (UnsetAnyTypeSchema, str), + decimal.Decimal: (UnsetAnyTypeSchema, decimal.Decimal), + BoolClass: (UnsetAnyTypeSchema, BoolClass), + NoneClass: (UnsetAnyTypeSchema, NoneClass), + tuple: (UnsetAnyTypeSchema, tuple), + frozendict.frozendict: (UnsetAnyTypeSchema, frozendict.frozendict), + bytes: (UnsetAnyTypeSchema, bytes), + FileIO: (UnsetAnyTypeSchema, FileIO), + } + + @classmethod + def __get_new_cls( + cls, + arg, + validation_metadata: ValidationMetadata, + path_to_type: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Type] + ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Type['Schema']]: + """ + Make a new dynamic class and return an instance of that class + We are making an instance of cls, but instead of making cls + make a new class, new_cls + which includes dynamic bases including cls + return an instance of that new class + + Dict property + List Item Assignment Use cases: + 1. value is NOT an instance of the required schema class + the value is validated by _validate + _validate returns a key value pair + where the key is the path to the item, and the value will be the required manufactured class + made out of the matching schemas + 2. value is an instance of the correct schema type + the value is NOT validated by _validate, _validate only checks that the instance is of the correct schema type + for this value, _validate does NOT return an entry for it in _path_to_schemas + and in list/dict _get_items,_get_properties the value will be directly assigned + because value is of the correct type, and validation was run earlier when the instance was created + """ + _path_to_schemas = {} + if validation_metadata.validation_ran_earlier(cls): + add_deeper_validated_schemas(validation_metadata, _path_to_schemas) + else: + other_path_to_schemas = cls._validate(arg, validation_metadata=validation_metadata) + update(_path_to_schemas, other_path_to_schemas) + # loop through it make a new class for each entry + # do not modify the returned result because it is cached and we would be modifying the cached value + path_to_schemas = {} + for path, schema_classes in _path_to_schemas.items(): + """ + Use cases + 1. N number of schema classes + enum + type != bool/None, classes in path_to_schemas: tuple/frozendict.frozendict/str/Decimal/bytes/FileIo + needs Singleton added + 2. N number of schema classes + enum + type == bool/None, classes in path_to_schemas: BoolClass/NoneClass + Singleton already added + 3. N number of schema classes, classes in path_to_schemas: BoolClass/NoneClass/tuple/frozendict.frozendict/str/Decimal/bytes/FileIo + """ + cls._process_schema_classes(schema_classes) + enum_schema = any( + issubclass(this_cls, Schema) and hasattr(this_cls.Schema_, "enum_value_to_name") + for this_cls in schema_classes + ) + inheritable_primitive_type = schema_classes.intersection(cls.__inheritable_primitive_types_set) + chosen_schema_classes = schema_classes - inheritable_primitive_type + suffix = tuple(inheritable_primitive_type) + if enum_schema and suffix[0] not in {NoneClass, BoolClass}: + suffix = (Singleton,) + suffix + + used_classes = tuple(sorted(chosen_schema_classes, key=lambda a_cls: a_cls.__name__)) + suffix + mfg_cls = get_new_class(class_name='DynamicSchema', bases=used_classes) + path_to_schemas[path] = mfg_cls + + """ + For locations that validation did not check + the code still needs to mfg a class to hold those values + All of these classes will be based on UnsetAnyTypeSchema + """ + missing_paths = path_to_type.keys() - path_to_schemas.keys() + for missing_path in missing_paths: + value_type = path_to_type[missing_path] + bases = cls.__bases_by_type()[value_type] + mfg_cls = get_new_class(class_name='DynamicSchema', bases=bases) + path_to_schemas[missing_path] = mfg_cls + + return path_to_schemas + + @classmethod + def _get_new_instance_without_conversion( + cls, + arg: typing.Any, + path_to_item: typing.Tuple[typing.Union[str, int], ...], + path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Type['Schema']] + ): + # We have a Dynamic class and we are making an instance of it + if issubclass(cls, frozendict.frozendict) and issubclass(cls, DictBase): + properties = cls._get_properties(arg, path_to_item, path_to_schemas) + return super(Schema, cls).__new__(cls, properties) + elif issubclass(cls, tuple) and issubclass(cls, ListBase): + items = cls._get_items(arg, path_to_item, path_to_schemas) + return super(Schema, cls).__new__(cls, items) + """ + str = openapi str, datetime.date, and datetime.datetime + decimal.Decimal = openapi int and float + FileIO = openapi binary type and the user inputs a file + bytes = openapi binary type and the user inputs bytes + """ + return super(Schema, cls).__new__(cls, arg) + + @classmethod + def from_openapi_data_( + cls, + arg: typing.Union[ + str, + int, + float, + bool, + None, + dict, + list, + io.FileIO, + io.BufferedReader, + bytes + ], + configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None + ): + """ + Schema from_openapi_data_ + """ + from_server = True + validated_path_to_schemas = {} + path_to_type = {} + arg = cast_to_allowed_types(arg, from_server, validated_path_to_schemas, ('args[0]',), path_to_type) + validation_metadata = ValidationMetadata( + path_to_item=('args[0]',), + configuration=configuration_ or schema_configuration.SchemaConfiguration(), + validated_path_to_schemas=frozendict.frozendict(validated_path_to_schemas) + ) + path_to_schemas = cls.__get_new_cls(arg, validation_metadata, path_to_type) + new_cls = path_to_schemas[validation_metadata.path_to_item] + new_inst = new_cls._get_new_instance_without_conversion( + arg, + validation_metadata.path_to_item, + path_to_schemas + ) + return new_inst + + @staticmethod + def __get_input_dict(*args, **kwargs) -> frozendict.frozendict: + input_dict = {} + if args and isinstance(args[0], (dict, frozendict.frozendict)): + input_dict.update(args[0]) + if kwargs: + input_dict.update(kwargs) + return frozendict.frozendict(input_dict) + + @staticmethod + def __remove_unsets(kwargs): + return {key: val for key, val in kwargs.items() if val is not unset} + + def __new__( + cls, + *args_: typing.Union[ + dict, + frozendict.frozendict, + list, + tuple, + decimal.Decimal, + float, + int, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + bool, + None, + bytes, + io.FileIO, + io.BufferedReader, + 'Schema', ], + configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[ + dict, + frozendict.frozendict, + list, + tuple, + decimal.Decimal, + float, + int, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + bool, + None, + bytes, + io.FileIO, + io.BufferedReader, + 'Schema', Unset + ] + ): + """ + Schema __new__ + + Args: + args_ (int/float/decimal.Decimal/str/list/tuple/dict/frozendict.frozendict/bool/None): the value + kwargs (str, int/float/decimal.Decimal/str/list/tuple/dict/frozendict.frozendict/bool/None): dict values + configuration_: contains the schema_configuration.SchemaConfiguration that enables json schema validation keywords + like minItems, minLength etc + + Note: double underscores are used here because pycharm thinks that these variables + are instance properties if they are named normally :( + """ + __kwargs = cls.__remove_unsets(kwargs) + if not args_ and not __kwargs: + raise TypeError( + 'No input given. args or kwargs must be given.' + ) + if not __kwargs and args_ and not isinstance(args_[0], dict): + __arg = args_[0] + else: + __arg = cls.__get_input_dict(*args_, **__kwargs) + __from_server = False + __validated_path_to_schemas = {} + __path_to_type = {} + __arg = cast_to_allowed_types( + __arg, __from_server, __validated_path_to_schemas, ('args[0]',), __path_to_type) + __validation_metadata = ValidationMetadata( + path_to_item=('args[0]',), + configuration=configuration_ or schema_configuration.SchemaConfiguration(), + validated_path_to_schemas=frozendict.frozendict(__validated_path_to_schemas) + ) + __path_to_schemas = cls.__get_new_cls(__arg, __validation_metadata, __path_to_type) + __new_cls = __path_to_schemas[__validation_metadata.path_to_item] + return __new_cls._get_new_instance_without_conversion( + __arg, + __validation_metadata.path_to_item, + __path_to_schemas + ) + + +""" +import itertools +data_types = ('None', 'FrozenDict', 'Tuple', 'Str', 'Decimal', 'Bool') +type_to_cls = { + 'None': 'NoneClass', + 'FrozenDict': 'frozendict.frozendict', + 'Tuple': 'tuple', + 'Str': 'str', + 'Decimal': 'decimal.Decimal', + 'Bool': 'BoolClass' +} +cls_tuples = [v for v in itertools.combinations(data_types, 5)] +typed_classes = [f"class {''.join(cls_tuple)}Mixin({', '.join(type_to_cls[typ] for typ in cls_tuple)}):\n pass" for cls_tuple in cls_tuples] +for cls in typed_classes: + print(cls) +object_classes = [f"{''.join(cls_tuple)}Mixin = object" for cls_tuple in cls_tuples] +for cls in object_classes: + print(cls) +""" +if typing.TYPE_CHECKING: + # qty 1 + NoneMixin = NoneClass + FrozenDictMixin = frozendict.frozendict + TupleMixin = tuple + StrMixin = str + DecimalMixin = decimal.Decimal + BoolMixin = BoolClass + BytesMixin = bytes + FileMixin = FileIO + # qty 2 + class BinaryMixin(bytes, FileIO): + pass + class NoneFrozenDictMixin(NoneClass, frozendict.frozendict): + pass + class NoneTupleMixin(NoneClass, tuple): + pass + class NoneStrMixin(NoneClass, str): + pass + class NoneDecimalMixin(NoneClass, decimal.Decimal): + pass + class NoneBoolMixin(NoneClass, BoolClass): + pass + class FrozenDictTupleMixin(frozendict.frozendict, tuple): + pass + class FrozenDictStrMixin(frozendict.frozendict, str): + pass + class FrozenDictDecimalMixin(frozendict.frozendict, decimal.Decimal): + pass + class FrozenDictBoolMixin(frozendict.frozendict, BoolClass): + pass + class TupleStrMixin(tuple, str): + pass + class TupleDecimalMixin(tuple, decimal.Decimal): + pass + class TupleBoolMixin(tuple, BoolClass): + pass + class StrDecimalMixin(str, decimal.Decimal): + pass + class StrBoolMixin(str, BoolClass): + pass + class DecimalBoolMixin(decimal.Decimal, BoolClass): + pass + # qty 3 + class NoneFrozenDictTupleMixin(NoneClass, frozendict.frozendict, tuple): + pass + class NoneFrozenDictStrMixin(NoneClass, frozendict.frozendict, str): + pass + class NoneFrozenDictDecimalMixin(NoneClass, frozendict.frozendict, decimal.Decimal): + pass + class NoneFrozenDictBoolMixin(NoneClass, frozendict.frozendict, BoolClass): + pass + class NoneTupleStrMixin(NoneClass, tuple, str): + pass + class NoneTupleDecimalMixin(NoneClass, tuple, decimal.Decimal): + pass + class NoneTupleBoolMixin(NoneClass, tuple, BoolClass): + pass + class NoneStrDecimalMixin(NoneClass, str, decimal.Decimal): + pass + class NoneStrBoolMixin(NoneClass, str, BoolClass): + pass + class NoneDecimalBoolMixin(NoneClass, decimal.Decimal, BoolClass): + pass + class FrozenDictTupleStrMixin(frozendict.frozendict, tuple, str): + pass + class FrozenDictTupleDecimalMixin(frozendict.frozendict, tuple, decimal.Decimal): + pass + class FrozenDictTupleBoolMixin(frozendict.frozendict, tuple, BoolClass): + pass + class FrozenDictStrDecimalMixin(frozendict.frozendict, str, decimal.Decimal): + pass + class FrozenDictStrBoolMixin(frozendict.frozendict, str, BoolClass): + pass + class FrozenDictDecimalBoolMixin(frozendict.frozendict, decimal.Decimal, BoolClass): + pass + class TupleStrDecimalMixin(tuple, str, decimal.Decimal): + pass + class TupleStrBoolMixin(tuple, str, BoolClass): + pass + class TupleDecimalBoolMixin(tuple, decimal.Decimal, BoolClass): + pass + class StrDecimalBoolMixin(str, decimal.Decimal, BoolClass): + pass + # qty 4 + class NoneFrozenDictTupleStrMixin(NoneClass, frozendict.frozendict, tuple, str): + pass + class NoneFrozenDictTupleDecimalMixin(NoneClass, frozendict.frozendict, tuple, decimal.Decimal): + pass + class NoneFrozenDictTupleBoolMixin(NoneClass, frozendict.frozendict, tuple, BoolClass): + pass + class NoneFrozenDictStrDecimalMixin(NoneClass, frozendict.frozendict, str, decimal.Decimal): + pass + class NoneFrozenDictStrBoolMixin(NoneClass, frozendict.frozendict, str, BoolClass): + pass + class NoneFrozenDictDecimalBoolMixin(NoneClass, frozendict.frozendict, decimal.Decimal, BoolClass): + pass + class NoneTupleStrDecimalMixin(NoneClass, tuple, str, decimal.Decimal): + pass + class NoneTupleStrBoolMixin(NoneClass, tuple, str, BoolClass): + pass + class NoneTupleDecimalBoolMixin(NoneClass, tuple, decimal.Decimal, BoolClass): + pass + class NoneStrDecimalBoolMixin(NoneClass, str, decimal.Decimal, BoolClass): + pass + class FrozenDictTupleStrDecimalMixin(frozendict.frozendict, tuple, str, decimal.Decimal): + pass + class FrozenDictTupleStrBoolMixin(frozendict.frozendict, tuple, str, BoolClass): + pass + class FrozenDictTupleDecimalBoolMixin(frozendict.frozendict, tuple, decimal.Decimal, BoolClass): + pass + class FrozenDictStrDecimalBoolMixin(frozendict.frozendict, str, decimal.Decimal, BoolClass): + pass + class TupleStrDecimalBoolMixin(tuple, str, decimal.Decimal, BoolClass): + pass + # qty 5 + class NoneFrozenDictTupleStrDecimalMixin(NoneClass, frozendict.frozendict, tuple, str, decimal.Decimal): + pass + class NoneFrozenDictTupleStrBoolMixin(NoneClass, frozendict.frozendict, tuple, str, BoolClass): + pass + class NoneFrozenDictTupleDecimalBoolMixin(NoneClass, frozendict.frozendict, tuple, decimal.Decimal, BoolClass): + pass + class NoneFrozenDictStrDecimalBoolMixin(NoneClass, frozendict.frozendict, str, decimal.Decimal, BoolClass): + pass + class NoneTupleStrDecimalBoolMixin(NoneClass, tuple, str, decimal.Decimal, BoolClass): + pass + class FrozenDictTupleStrDecimalBoolMixin(frozendict.frozendict, tuple, str, decimal.Decimal, BoolClass): + pass + # qty 6 + class NoneFrozenDictTupleStrDecimalBoolMixin(NoneClass, frozendict.frozendict, tuple, str, decimal.Decimal, BoolClass): + pass + # qty 8 + class NoneFrozenDictTupleStrDecimalBoolFileBytesMixin(NoneClass, frozendict.frozendict, tuple, str, decimal.Decimal, BoolClass, FileIO, bytes): + pass +else: + # qty 1 + class NoneMixin: + pass + class FrozenDictMixin: + pass + class TupleMixin: + pass + class StrMixin: + pass + class DecimalMixin: + pass + class BoolMixin: + pass + class BytesMixin: + pass + class FileMixin: + pass + # qty 2 + class BinaryMixin: + pass + class NoneFrozenDictMixin: + pass + class NoneTupleMixin: + pass + class NoneStrMixin: + pass + class NoneDecimalMixin: + pass + class NoneBoolMixin: + pass + class FrozenDictTupleMixin: + pass + class FrozenDictStrMixin: + pass + class FrozenDictDecimalMixin: + pass + class FrozenDictBoolMixin: + pass + class TupleStrMixin: + pass + class TupleDecimalMixin: + pass + class TupleBoolMixin: + pass + class StrDecimalMixin: + pass + class StrBoolMixin: + pass + class DecimalBoolMixin: + pass + # qty 3 + class NoneFrozenDictTupleMixin: + pass + class NoneFrozenDictStrMixin: + pass + class NoneFrozenDictDecimalMixin: + pass + class NoneFrozenDictBoolMixin: + pass + class NoneTupleStrMixin: + pass + class NoneTupleDecimalMixin: + pass + class NoneTupleBoolMixin: + pass + class NoneStrDecimalMixin: + pass + class NoneStrBoolMixin: + pass + class NoneDecimalBoolMixin: + pass + class FrozenDictTupleStrMixin: + pass + class FrozenDictTupleDecimalMixin: + pass + class FrozenDictTupleBoolMixin: + pass + class FrozenDictStrDecimalMixin: + pass + class FrozenDictStrBoolMixin: + pass + class FrozenDictDecimalBoolMixin: + pass + class TupleStrDecimalMixin: + pass + class TupleStrBoolMixin: + pass + class TupleDecimalBoolMixin: + pass + class StrDecimalBoolMixin: + pass + # qty 4 + class NoneFrozenDictTupleStrMixin: + pass + class NoneFrozenDictTupleDecimalMixin: + pass + class NoneFrozenDictTupleBoolMixin: + pass + class NoneFrozenDictStrDecimalMixin: + pass + class NoneFrozenDictStrBoolMixin: + pass + class NoneFrozenDictDecimalBoolMixin: + pass + class NoneTupleStrDecimalMixin: + pass + class NoneTupleStrBoolMixin: + pass + class NoneTupleDecimalBoolMixin: + pass + class NoneStrDecimalBoolMixin: + pass + class FrozenDictTupleStrDecimalMixin: + pass + class FrozenDictTupleStrBoolMixin: + pass + class FrozenDictTupleDecimalBoolMixin: + pass + class FrozenDictStrDecimalBoolMixin: + pass + class TupleStrDecimalBoolMixin: + pass + # qty 5 + class NoneFrozenDictTupleStrDecimalMixin: + pass + class NoneFrozenDictTupleStrBoolMixin: + pass + class NoneFrozenDictTupleDecimalBoolMixin: + pass + class NoneFrozenDictStrDecimalBoolMixin: + pass + class NoneTupleStrDecimalBoolMixin: + pass + class FrozenDictTupleStrDecimalBoolMixin: + pass + # qty 6 + class NoneFrozenDictTupleStrDecimalBoolMixin: + pass + # qty 8 + class NoneFrozenDictTupleStrDecimalBoolFileBytesMixin: + pass + + +class BoolBase: + def is_true_(self) -> bool: + """ + A replacement for x is True + True if the instance is a BoolClass True Singleton + """ + if not issubclass(self.__class__, BoolClass): + return False + return bool(self) + + def is_false_(self) -> bool: + """ + A replacement for x is False + True if the instance is a BoolClass False Singleton + """ + if not issubclass(self.__class__, BoolClass): + return False + return bool(self) is False + + +class NoneBase: + def is_none_(self) -> bool: + """ + A replacement for x is None + True if the instance is a NoneClass None Singleton + """ + if issubclass(self.__class__, NoneClass): + return True + return False + + +class StrBase: + Schema_: SchemaTyped + + @property + def as_str_(self) -> str: + return self + + @property + def as_date_(self) -> datetime.date: + raise Exception('not implemented') + + @property + def as_datetime_(self) -> datetime.datetime: + raise Exception('not implemented') + + @property + def as_decimal_(self) -> decimal.Decimal: + raise Exception('not implemented') + + @property + def as_uuid_(self) -> uuid.UUID: + raise Exception('not implemented') + + +class UUIDBase: + @property + @functools.lru_cache() + def as_uuid_(self) -> uuid.UUID: + return uuid.UUID(self) + + +class DateBase: + @property + @functools.lru_cache() + def as_date_(self) -> datetime.date: + return DEFAULT_ISOPARSER.parse_isodate(self) + + +class DateTimeBase: + @property + @functools.lru_cache() + def as_datetime_(self) -> datetime.datetime: + return DEFAULT_ISOPARSER.parse_isodatetime(self) + + +class DecimalBase: + """ + A class for storing decimals that are sent over the wire as strings + These schemas must remain based on StrBase rather than NumberBase + because picking base classes must be deterministic + """ + + @property + @functools.lru_cache() + def as_decimal_(self) -> decimal.Decimal: + return decimal.Decimal(self) + + +class NumberBase: + Schema_: SchemaTyped + + @property + def as_int_(self) -> int: + try: + return self._as_int + except AttributeError: + """ + Note: for some numbers like 9.0 they could be represented as an + integer but our code chooses to store them as + >>> Decimal('9.0').as_tuple() + DecimalTuple(sign=0, digits=(9, 0), exponent=-1) + so we can tell that the value came from a float and convert it back to a float + during later serialization + """ + if self.as_tuple().exponent < 0: + # this could be represented as an integer but should be represented as a float + # because that's what it was serialized from + raise exceptions.ApiValueError(f'{self} is not an integer') + self._as_int = int(self) + return self._as_int + + @property + def as_float_(self) -> float: + try: + return self._as_float + except AttributeError: + if self.as_tuple().exponent >= 0: + raise exceptions.ApiValueError(f'{self} is not a float') + self._as_float = float(self) + return self._as_float + + +class ListBase: + Schema_: SchemaTyped + + @classmethod + def _get_items( + cls: 'Schema', + arg: typing.List[typing.Any], + path_to_item: typing.Tuple[typing.Union[str, int], ...], + path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Type['Schema']] + ): + ''' + ListBase _get_items + ''' + cast_items = [] + + for i, value in enumerate(arg): + item_path_to_item = path_to_item + (i,) + item_cls = path_to_schemas[item_path_to_item] + new_value = item_cls._get_new_instance_without_conversion( + value, + item_path_to_item, + path_to_schemas + ) + cast_items.append(new_value) + + return cast_items + + +class DictBase: + @classmethod + def _get_properties( + cls, + arg: typing.Dict[str, typing.Any], + path_to_item: typing.Tuple[typing.Union[str, int], ...], + path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Type['Schema']] + ): + """ + DictBase _get_properties, this is how properties are set + These values already passed validation + """ + dict_items = {} + + for property_name_js, value in arg.items(): + property_path_to_item = path_to_item + (property_name_js,) + property_cls = path_to_schemas[property_path_to_item] + new_value = property_cls._get_new_instance_without_conversion( + value, + property_path_to_item, + path_to_schemas + ) + dict_items[property_name_js] = new_value + + return dict_items + + def __setattr__(self, name: str, value: typing.Any): + if not isinstance(self, FileIO): + raise AttributeError('property setting not supported on immutable instances') + + def __getattr__(self, name: str): + """ + for instance.name access + Properties are only type hinted for required properties + so that hasattr(instance, 'optionalProp') is False when that key is not present + """ + if not isinstance(self, frozendict.frozendict): + return super().__getattr__(name) + if name not in self.__class__.__annotations__: + raise AttributeError(f"{self} has no attribute '{name}'") + try: + value = self[name] + return value + except KeyError as ex: + raise AttributeError(str(ex)) + + def get_item_(self, name: str) -> typing.Union['AnyTypeSchema', Unset]: + # dict_instance[name] accessor + if not isinstance(self, frozendict.frozendict): + raise NotImplementedError() + try: + return super().__getitem__(name) + except KeyError: + return unset + + +def cast_to_allowed_types( + arg: typing.Union[ + dict, + frozendict.frozendict, + list, + tuple, + decimal.Decimal, + float, + int, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + bool, + None, + bytes, + io.FileIO, + io.BufferedReader, + 'Schema', ], + from_server: bool, + validated_path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]], + path_to_item: typing.Tuple[typing.Union[str, int], ...], + path_to_type: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Type] +) -> typing.Union[ + frozendict.frozendict, + tuple, + decimal.Decimal, + str, + bytes, + BoolClass, + NoneClass, + FileIO]: + """ + Casts the input payload arg into the allowed types + The input validated_path_to_schemas is mutated by running this function + + When from_server is False then + - date/datetime is cast to str + - int/float is cast to Decimal + + If a Schema instance is passed in it is converted back to a primitive instance because + One may need to validate that data to the original Schema class AND additional different classes + those additional classes will need to be added to the new manufactured class for that payload + If the code didn't do this and kept the payload as a Schema instance it would fail to validate to other + Schema classes and the code wouldn't be able to mfg a new class that includes all valid schemas + TODO: store the validated schema classes in validation_metadata + + Args: + arg: the payload + from_server: whether this payload came from the server or not + validated_path_to_schemas: a dict that stores the validated classes at any path location in the payload + """ + if isinstance(arg, Schema) and not isinstance(arg, UnsetAnyTypeSchema): + """ + store the already run validations + but omit UnsetAnyTypeSchema instances because they were not validated + """ + schema_classes = set() + for cls in arg.__class__.__bases__: + if cls is Singleton: + # Skip Singleton + continue + schema_classes.add(cls) + validated_path_to_schemas[path_to_item] = schema_classes + + type_error = exceptions.ApiTypeError(f"Invalid type. Required value type is str and passed type was {type(arg)} at {path_to_item}") + if isinstance(arg, str): + path_to_type[path_to_item] = str + return str(arg) + elif isinstance(arg, (dict, frozendict.frozendict)): + path_to_type[path_to_item] = frozendict.frozendict + return frozendict.frozendict( + { + key: cast_to_allowed_types( + val, + from_server, + validated_path_to_schemas, + path_to_item + (key,), + path_to_type, + ) + for key, val in arg.items() + } + ) + elif isinstance(arg, (bool, BoolClass)): + path_to_type[path_to_item] = BoolClass + """ + this check must come before isinstance(arg, (int, float)) + because isinstance(True, int) is True + """ + if arg: + return BoolClass.TRUE + return BoolClass.FALSE + elif isinstance(arg, int): + path_to_type[path_to_item] = decimal.Decimal + return decimal.Decimal(arg) + elif isinstance(arg, float): + path_to_type[path_to_item] = decimal.Decimal + decimal_from_float = decimal.Decimal(arg) + if decimal_from_float.as_integer_ratio()[1] == 1: + # 9.0 -> Decimal('9.0') + # 3.4028234663852886e+38 -> Decimal('340282346638528859811704183484516925440.0') + return decimal.Decimal(str(decimal_from_float)+'.0') + return decimal_from_float + elif isinstance(arg, (tuple, list)): + path_to_type[path_to_item] = tuple + return tuple( + [ + cast_to_allowed_types( + item, + from_server, + validated_path_to_schemas, + path_to_item + (i,), + path_to_type, + ) + for i, item in enumerate(arg) + ] + ) + elif isinstance(arg, (none_type_, NoneClass)): + path_to_type[path_to_item] = NoneClass + return NoneClass.NONE + elif isinstance(arg, (datetime.date, datetime.datetime)): + path_to_type[path_to_item] = str + if not from_server: + return arg.isoformat() + raise type_error + elif isinstance(arg, uuid.UUID): + path_to_type[path_to_item] = str + if not from_server: + return str(arg) + raise type_error + elif isinstance(arg, decimal.Decimal): + path_to_type[path_to_item] = decimal.Decimal + return decimal.Decimal(arg) + elif isinstance(arg, bytes): + path_to_type[path_to_item] = bytes + return bytes(arg) + elif isinstance(arg, (io.FileIO, io.BufferedReader)): + path_to_type[path_to_item] = FileIO + return FileIO(arg) + raise ValueError('Invalid type passed in got input={} type={}'.format(arg, type(arg))) + + +class ListSchema( + ListBase, + Schema, + TupleMixin +): + class Schema_: + types = {tuple} + + @classmethod + def from_openapi_data_(cls, arg: typing.List[typing.Any], configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): + return super().from_openapi_data_(arg, configuration_=configuration_) + + def __new__(cls, arg_: typing.Union[typing.List[typing.Any], typing.Tuple[typing.Any]], **kwargs: schema_configuration.SchemaConfiguration): + return super().__new__(cls, arg_, **kwargs) + + +class NoneSchema( + NoneBase, + Schema, + NoneMixin +): + class Schema_: + types = {NoneClass} + + @classmethod + def from_openapi_data_(cls, arg: None, configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): + return super().from_openapi_data_(arg, configuration_=configuration_) + + def __new__(cls, arg_: None, **kwargs: schema_configuration.SchemaConfiguration): + return super().__new__(cls, arg_, **kwargs) + + +class NumberSchema( + NumberBase, + Schema, + DecimalMixin +): + """ + This is used for type: number with no format + Both integers AND floats are accepted + """ + class Schema_: + types = {decimal.Decimal} + + @classmethod + def from_openapi_data_(cls, arg: typing.Union[int, float], configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): + return super().from_openapi_data_(arg, configuration_=configuration_) + + def __new__(cls, arg_: typing.Union[decimal.Decimal, int, float], **kwargs: schema_configuration.SchemaConfiguration): + return super().__new__(cls, arg_, **kwargs) + + +class IntBase: + @property + def as_int_(self) -> int: + try: + return self._as_int + except AttributeError: + self._as_int = int(self) + return self._as_int + + +class IntSchema(IntBase, NumberSchema): + class Schema_: + types = {decimal.Decimal} + format = 'int' + + @classmethod + def from_openapi_data_(cls, arg: int, configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): + return super().from_openapi_data_(arg, configuration_=configuration_) + + def __new__(cls, arg_: typing.Union[decimal.Decimal, int], **kwargs: schema_configuration.SchemaConfiguration): + return super().__new__(cls, arg_, **kwargs) + + +class Int32Schema( + IntSchema +): + class Schema_: + types = {decimal.Decimal} + format = 'int32' + + +class Int64Schema( + IntSchema +): + class Schema_: + types = {decimal.Decimal} + format = 'int64' + + +class Float32Schema( + NumberSchema +): + class Schema_: + types = {decimal.Decimal} + format = 'float' + + @classmethod + def from_openapi_data_(cls, arg: float, configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): + return super().from_openapi_data_(arg, configuration_=configuration_) + + +class Float64Schema( + NumberSchema +): + class Schema_: + types = {decimal.Decimal} + format = 'double' + + @classmethod + def from_openapi_data_(cls, arg: float, configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): + return super().from_openapi_data_(arg, configuration_=configuration_) + + +class StrSchema( + StrBase, + Schema, + StrMixin +): + """ + date + datetime string types must inherit from this class + That is because one can validate a str payload as both: + - type: string (format unset) + - type: string, format: date + """ + class Schema_: + types = {str} + + @classmethod + def from_openapi_data_(cls, arg: str, configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None) -> 'StrSchema': + return super().from_openapi_data_(arg, configuration_=configuration_) + + def __new__(cls, arg_: typing.Union[str, datetime.date, datetime.datetime, uuid.UUID], **kwargs: schema_configuration.SchemaConfiguration): + return super().__new__(cls, arg_, **kwargs) + + +class UUIDSchema(UUIDBase, StrSchema): + class Schema_: + types = {str} + format = 'uuid' + + def __new__(cls, arg_: typing.Union[str, uuid.UUID], **kwargs: schema_configuration.SchemaConfiguration): + return super().__new__(cls, arg_, **kwargs) + + +class DateSchema(DateBase, StrSchema): + class Schema_: + types = {str} + format = 'date' + + def __new__(cls, arg_: typing.Union[str, datetime.date], **kwargs: schema_configuration.SchemaConfiguration): + return super().__new__(cls, arg_, **kwargs) + + +class DateTimeSchema(DateTimeBase, StrSchema): + class Schema_: + types = {str} + format = 'date-time' + + def __new__(cls, arg_: typing.Union[str, datetime.datetime], **kwargs: schema_configuration.SchemaConfiguration): + return super().__new__(cls, arg_, **kwargs) + + +class DecimalSchema(DecimalBase, StrSchema): + class Schema_: + types = {str} + format = 'number' + + def __new__(cls, arg_: str, **kwargs: schema_configuration.SchemaConfiguration): + """ + Note: Decimals may not be passed in because cast_to_allowed_types is only invoked once for payloads + which can be simple (str) or complex (dicts or lists with nested values) + Because casting is only done once and recursively casts all values prior to validation then for a potential + client side Decimal input if Decimal was accepted as an input in DecimalSchema then one would not know + if one was using it for a StrSchema (where it should be cast to str) or one is using it for NumberSchema + where it should stay as Decimal. + """ + return super().__new__(cls, arg_, **kwargs) + + +class BytesSchema( + Schema, + BytesMixin +): + """ + this class will subclass bytes and is immutable + """ + class Schema_: + types = {bytes} + + def __new__(cls, arg_: bytes, **kwargs: schema_configuration.SchemaConfiguration): + return super(Schema, cls).__new__(cls, arg_) + + +class FileSchema( + Schema, + FileMixin +): + """ + This class is NOT immutable + Dynamic classes are built using it for example when AnyType allows in binary data + Al other schema classes ARE immutable + If one wanted to make this immutable one could make this a DictSchema with required properties: + - data = BytesSchema (which would be an immutable bytes based schema) + - file_name = StrSchema + and cast_to_allowed_types would convert bytes and file instances into dicts containing data + file_name + The downside would be that data would be stored in memory which one may not want to do for very large files + + The developer is responsible for closing this file and deleting it + + This class was kept as mutable: + - to allow file reading and writing to disk + - to be able to preserve file name info + """ + class Schema_: + types = {FileIO} + + def __new__(cls, arg_: typing.Union[io.FileIO, io.BufferedReader], **kwargs: schema_configuration.SchemaConfiguration): + return super(Schema, cls).__new__(cls, arg_) + + +class BinarySchema( + Schema, + BinaryMixin +): + class Schema_: + types = {FileIO, bytes} + format = 'binary' + + class OneOf: + classes = [ + BytesSchema, + FileSchema, + ] + + def __new__(cls, arg_: typing.Union[io.FileIO, io.BufferedReader, bytes], **kwargs: schema_configuration.SchemaConfiguration): + return super().__new__(cls, arg_) + + +class BoolSchema( + BoolBase, + Schema, + BoolMixin +): + class Schema_: + types = {BoolClass} + + @classmethod + def from_openapi_data_(cls, arg: bool, configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): + return super().from_openapi_data_(arg, configuration_=configuration_) + + def __new__(cls, arg_: bool, **kwargs: ValidationMetadata): + return super().__new__(cls, arg_, **kwargs) + + +class AnyTypeSchema( + NoneBase, + DictBase, + ListBase, + StrBase, + NumberBase, + BoolBase, + Schema, + NoneFrozenDictTupleStrDecimalBoolFileBytesMixin +): + # Python representation of a schema defined as true or {} + class Schema_: + pass + + +class UnsetAnyTypeSchema(AnyTypeSchema): + # Used when additionalProperties/items was not explicitly defined and a defining schema is needed + pass + + +class NotAnyTypeSchema(AnyTypeSchema): + """ + Python representation of a schema defined as false or {'not': {}} + Does not allow inputs in of AnyType + Note: validations on this class are never run because the code knows that no inputs will ever validate + """ + + class Schema_: + _not = AnyTypeSchema + + def __new__( + cls, + *args_, + configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None, + ) -> 'NotAnyTypeSchema': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + ) + + +class DictSchema( + DictBase, + Schema, + FrozenDictMixin +): + class Schema_: + types = {frozendict.frozendict} + + @classmethod + def from_openapi_data_(cls, arg: typing.Dict[str, typing.Any], configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): + return super().from_openapi_data_(arg, configuration_=configuration_) + + def __new__(cls, *args_: typing.Union[dict, frozendict.frozendict], **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, bool, None, bytes, Schema, Unset, ValidationMetadata]): + return super().__new__(cls, *args_, **kwargs) + + +schema_type_classes = {NoneSchema, DictSchema, ListSchema, NumberSchema, StrSchema, BoolSchema, AnyTypeSchema} + + +@functools.lru_cache() +def get_new_class( + class_name: str, + bases: typing.Tuple[typing.Type[typing.Union[Schema, typing.Any]], ...] +) -> typing.Type[Schema]: + """ + Returns a new class that is made with the subclass bases + """ + new_cls: typing.Type[Schema] = type(class_name, bases, {}) + return new_cls + + +LOG_CACHE_USAGE = False + + +def log_cache_usage(cache_fn): + if LOG_CACHE_USAGE: + print(cache_fn.__name__, cache_fn.cache_info()) diff --git a/samples/openapi3/client/features/security/python/src/this_package/security/__init__.py b/samples/openapi3/client/features/security/python/src/this_package/security/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/features/security/python/src/this_package/security/security_requirement_object_0.py b/samples/openapi3/client/features/security/python/src/this_package/security/security_requirement_object_0.py new file mode 100644 index 00000000000..f73d578eb18 --- /dev/null +++ b/samples/openapi3/client/features/security/python/src/this_package/security/security_requirement_object_0.py @@ -0,0 +1,13 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from this_package import security_schemes + +security_requirement_object: security_schemes.SecurityRequirementObject = { + "api_key": (), +} diff --git a/samples/openapi3/client/features/security/python/src/this_package/security/security_requirement_object_1.py b/samples/openapi3/client/features/security/python/src/this_package/security/security_requirement_object_1.py new file mode 100644 index 00000000000..ff296b2376a --- /dev/null +++ b/samples/openapi3/client/features/security/python/src/this_package/security/security_requirement_object_1.py @@ -0,0 +1,13 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from this_package import security_schemes + +security_requirement_object: security_schemes.SecurityRequirementObject = { + "http_basic_test": (), +} diff --git a/samples/openapi3/client/features/security/python/src/this_package/security/security_requirement_object_2.py b/samples/openapi3/client/features/security/python/src/this_package/security/security_requirement_object_2.py new file mode 100644 index 00000000000..48d8b4123ae --- /dev/null +++ b/samples/openapi3/client/features/security/python/src/this_package/security/security_requirement_object_2.py @@ -0,0 +1,12 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from this_package import security_schemes + +security_requirement_object: security_schemes.SecurityRequirementObject = { +} diff --git a/samples/openapi3/client/features/security/python/src/this_package/security/security_requirement_object_3.py b/samples/openapi3/client/features/security/python/src/this_package/security/security_requirement_object_3.py new file mode 100644 index 00000000000..950027d1f9e --- /dev/null +++ b/samples/openapi3/client/features/security/python/src/this_package/security/security_requirement_object_3.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from this_package import security_schemes + +security_requirement_object: security_schemes.SecurityRequirementObject = { + "http_basic_test": (), + "api_key": (), +} diff --git a/samples/openapi3/client/features/security/python/src/this_package/security_schemes.py b/samples/openapi3/client/features/security/python/src/this_package/security_schemes.py new file mode 100644 index 00000000000..6f6cbb0eddf --- /dev/null +++ b/samples/openapi3/client/features/security/python/src/this_package/security_schemes.py @@ -0,0 +1,224 @@ +# coding: utf-8 +""" + security-test + + No description provided (generated by Openapi JSON Schema Generator https://github.com/openapi-json-schema-tools/openapi-json-schema-generator) # noqa: E501 + + The version of the OpenAPI document: 1.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import abc +import base64 +import dataclasses +import enum +import typing +import typing_extensions + +from urllib3 import _collections + + +class SecuritySchemeType(enum.Enum): + API_KEY = 'apiKey' + HTTP = 'http' + MUTUAL_TLS = 'mutualTLS' + OAUTH_2 = 'oauth2' + OPENID_CONNECT = 'openIdConnect' + + +class ApiKeyInLocation(enum.Enum): + QUERY = 'query' + HEADER = 'header' + COOKIE = 'cookie' + + +class __SecuritySchemeBase(metaclass=abc.ABCMeta): + @abc.abstractmethod + def apply_auth( + self, + headers: _collections.HTTPHeaderDict, + resource_path: str, + method: str, + body: typing.Optional[typing.Union[str, bytes]], + scope_names: typing.Tuple[str] = (), + ) -> None: + pass + + +@dataclasses.dataclass +class ApiKeySecurityScheme(__SecuritySchemeBase, abc.ABC): + api_key: str # this must be set by the developer + name: str = '' + in_location: ApiKeyInLocation = ApiKeyInLocation.QUERY + type: SecuritySchemeType = SecuritySchemeType.API_KEY + + def apply_auth( + self, + headers: _collections.HTTPHeaderDict, + resource_path: str, + method: str, + body: typing.Optional[typing.Union[str, bytes]], + scope_names: typing.Tuple[str] = (), + ) -> None: + if self.in_location is ApiKeyInLocation.COOKIE: + headers.add('Cookie', self.api_key) + elif self.in_location is ApiKeyInLocation.HEADER: + headers.add(self.name, self.api_key) + elif self.in_location is ApiKeyInLocation.QUERY: + # todo add query handling + raise NotImplementedError("ApiKeySecurityScheme in query not yet implemented") + return + + +class HTTPSchemeType(enum.Enum): + BASIC = 'basic' + BEARER = 'bearer' + DIGEST = 'digest' + SIGNATURE = 'signature' # https://datatracker.ietf.org/doc/draft-cavage-http-signatures/ + + +@dataclasses.dataclass +class HTTPBasicSecurityScheme(__SecuritySchemeBase): + user_id: str # user name + password: str + scheme: HTTPSchemeType = HTTPSchemeType.BASIC + encoding: str = 'utf-8' + type: SecuritySchemeType = SecuritySchemeType.HTTP + """ + https://www.rfc-editor.org/rfc/rfc7617.html + """ + + def apply_auth( + self, + headers: _collections.HTTPHeaderDict, + resource_path: str, + method: str, + body: typing.Optional[typing.Union[str, bytes]], + scope_names: typing.Tuple[str] = (), + ) -> None: + user_pass = f"{self.user_id}:{self.password}" + b64_user_pass = base64.b64encode(user_pass.encode(encoding=self.encoding)) + headers.add('Authorization', f"Basic {b64_user_pass.decode()}") + + +@dataclasses.dataclass +class HTTPBearerSecurityScheme(__SecuritySchemeBase): + access_token: str + bearer_format: typing.Optional[str] = None + scheme: HTTPSchemeType = HTTPSchemeType.BEARER + type: SecuritySchemeType = SecuritySchemeType.HTTP + + def apply_auth( + self, + headers: _collections.HTTPHeaderDict, + resource_path: str, + method: str, + body: typing.Optional[typing.Union[str, bytes]], + scope_names: typing.Tuple[str] = (), + ) -> None: + headers.add('Authorization', f"Bearer {self.access_token}") + + +@dataclasses.dataclass +class HTTPDigestSecurityScheme(__SecuritySchemeBase): + scheme: HTTPSchemeType = HTTPSchemeType.DIGEST + type: SecuritySchemeType = SecuritySchemeType.HTTP + + def apply_auth( + self, + headers: _collections.HTTPHeaderDict, + resource_path: str, + method: str, + body: typing.Optional[typing.Union[str, bytes]], + scope_names: typing.Tuple[str] = (), + ) -> None: + raise NotImplementedError("HTTPDigestSecurityScheme not yet implemented") + + +@dataclasses.dataclass +class MutualTLSSecurityScheme(__SecuritySchemeBase): + type: SecuritySchemeType = SecuritySchemeType.MUTUAL_TLS + + def apply_auth( + self, + headers: _collections.HTTPHeaderDict, + resource_path: str, + method: str, + body: typing.Optional[typing.Union[str, bytes]], + scope_names: typing.Tuple[str] = (), + ) -> None: + raise NotImplementedError("MutualTLSSecurityScheme not yet implemented") + + +@dataclasses.dataclass +class ImplicitOAuthFlow: + authorization_url: str + scopes: typing.Dict[str, str] + refresh_url: typing.Optional[str] = None + + +@dataclasses.dataclass +class TokenUrlOauthFlow: + token_url: str + scopes: typing.Dict[str, str] + refresh_url: typing.Optional[str] = None + + +@dataclasses.dataclass +class AuthorizationCodeOauthFlow: + authorization_url: str + token_url: str + scopes: typing.Dict[str, str] + refresh_url: typing.Optional[str] = None + + +@dataclasses.dataclass +class OAuthFlows: + implicit: typing.Optional[ImplicitOAuthFlow] = None + password: typing.Optional[TokenUrlOauthFlow] = None + client_credentials: typing.Optional[TokenUrlOauthFlow] = None + authorization_code: typing.Optional[AuthorizationCodeOauthFlow] = None + + +class OAuth2SecurityScheme(__SecuritySchemeBase, abc.ABC): + flows: OAuthFlows + type: SecuritySchemeType = SecuritySchemeType.OAUTH_2 + + def apply_auth( + self, + headers: _collections.HTTPHeaderDict, + resource_path: str, + method: str, + body: typing.Optional[typing.Union[str, bytes]], + scope_names: typing.Tuple[str] = (), + ) -> None: + raise NotImplementedError("OAuth2SecurityScheme not yet implemented") + + +class OpenIdConnectSecurityScheme(__SecuritySchemeBase, abc.ABC): + openid_connect_url: str + type: SecuritySchemeType = SecuritySchemeType.OPENID_CONNECT + + def apply_auth( + self, + headers: _collections.HTTPHeaderDict, + resource_path: str, + method: str, + body: typing.Optional[typing.Union[str, bytes]], + scope_names: typing.Tuple[str] = (), + ) -> None: + raise NotImplementedError("OpenIdConnectSecurityScheme not yet implemented") + +""" +Key is the Security scheme class +Value is the list of scopes +""" +SecurityRequirementObject = typing_extensions.TypedDict( + 'SecurityRequirementObject', + { + 'api_key': typing.List[str], + 'bearer_test': typing.List[str], + 'http_basic_test': typing.List[str], + }, + total=False +) \ No newline at end of file diff --git a/samples/openapi3/client/features/security/python/src/this_package/server.py b/samples/openapi3/client/features/security/python/src/this_package/server.py new file mode 100644 index 00000000000..7d806db0788 --- /dev/null +++ b/samples/openapi3/client/features/security/python/src/this_package/server.py @@ -0,0 +1,37 @@ +# coding: utf-8 +""" + security-test + + No description provided (generated by Openapi JSON Schema Generator https://github.com/openapi-json-schema-tools/openapi-json-schema-generator) # noqa: E501 + + The version of the OpenAPI document: 1.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import abc +import dataclasses +import typing + + +@dataclasses.dataclass +class Server(abc.ABC): + _url: str + variables: typing.Optional[typing.Dict[str, str]] = None + variable_schemas: typing.Optional[typing.Dict[str, typing.Type['schemas.Schema']]] = None + url: str = dataclasses.field(init=False) + + def __post_init__(self): + if not self.variable_schemas: + self.url = self._url + return + url = self._url + for (key, schema) in self.variable_schemas.items(): + if self.variables and key in self.variables: + value = self.variables[key] + cast_value = schema(value) + else: + cast_value = schema.Schema_.default + url = url.replace("{" + key + "}", cast_value) + self.url = url + +from this_package import schemas diff --git a/samples/openapi3/client/features/security/python/src/this_package/servers/__init__.py b/samples/openapi3/client/features/security/python/src/this_package/servers/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/features/security/python/src/this_package/servers/server_0.py b/samples/openapi3/client/features/security/python/src/this_package/servers/server_0.py new file mode 100644 index 00000000000..0c8638e3989 --- /dev/null +++ b/samples/openapi3/client/features/security/python/src/this_package/servers/server_0.py @@ -0,0 +1,16 @@ +# coding: utf-8 +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import typing + +from this_package import server + + +@dataclasses.dataclass +class Server0(server.Server): + _url: str = "http://localhost:3000" diff --git a/samples/openapi3/client/features/security/python/test-requirements.txt b/samples/openapi3/client/features/security/python/test-requirements.txt new file mode 100644 index 00000000000..3043888202a --- /dev/null +++ b/samples/openapi3/client/features/security/python/test-requirements.txt @@ -0,0 +1,2 @@ +pytest ~= 7.2.0 +pytest-cov ~= 4.0.0 diff --git a/samples/openapi3/client/features/security/python/test/__init__.py b/samples/openapi3/client/features/security/python/test/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/features/security/python/test/components/__init__.py b/samples/openapi3/client/features/security/python/test/components/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/features/security/python/test/components/schema/__init__.py b/samples/openapi3/client/features/security/python/test/components/schema/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/features/security/python/test/test_paths/__init__.py b/samples/openapi3/client/features/security/python/test/test_paths/__init__.py new file mode 100644 index 00000000000..bcc864a1738 --- /dev/null +++ b/samples/openapi3/client/features/security/python/test/test_paths/__init__.py @@ -0,0 +1,68 @@ +import json +import typing + +import urllib3 +from urllib3._collections import HTTPHeaderDict + + +class ApiTestMixin: + json_content_type = 'application/json' + user_agent = 'OpenAPI-JSON-Schema-Generator/1.0.0/python' + + @classmethod + def assert_pool_manager_request_called_with( + cls, + mock_request, + url: str, + method: str = 'POST', + body: typing.Optional[bytes] = None, + content_type: typing.Optional[str] = None, + accept_content_type: typing.Optional[str] = None, + stream: bool = False, + ): + headers = { + 'User-Agent': cls.user_agent + } + if accept_content_type: + headers['Accept'] = accept_content_type + if content_type: + headers['Content-Type'] = content_type + kwargs = dict( + headers=HTTPHeaderDict(headers), + preload_content=not stream, + timeout=None, + ) + if content_type and method != 'GET': + kwargs['body'] = body + mock_request.assert_called_with( + method, + url, + **kwargs + ) + + @staticmethod + def headers_for_content_type(content_type: str) -> typing.Dict[str, str]: + return {'content-type': content_type} + + @classmethod + def response( + cls, + body: typing.Union[str, bytes], + status: int = 200, + content_type: str = json_content_type, + headers: typing.Optional[typing.Dict[str, str]] = None, + preload_content: bool = True + ) -> urllib3.HTTPResponse: + if headers is None: + headers = {} + headers.update(cls.headers_for_content_type(content_type)) + return urllib3.HTTPResponse( + body, + headers=headers, + status=status, + preload_content=preload_content + ) + + @staticmethod + def json_bytes(in_data: typing.Any) -> bytes: + return json.dumps(in_data, separators=(",", ":"), ensure_ascii=False).encode('utf-8') diff --git a/samples/openapi3/client/features/security/python/test/test_paths/test_path_with_no_explicit_security/__init__.py b/samples/openapi3/client/features/security/python/test/test_paths/test_path_with_no_explicit_security/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/features/security/python/test/test_paths/test_path_with_no_explicit_security/test_get.py b/samples/openapi3/client/features/security/python/test/test_paths/test_path_with_no_explicit_security/test_get.py new file mode 100644 index 00000000000..c67de147f3a --- /dev/null +++ b/samples/openapi3/client/features/security/python/test/test_paths/test_path_with_no_explicit_security/test_get.py @@ -0,0 +1,36 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest +from unittest.mock import patch + +import urllib3 + +import this_package +from this_package.paths.path_with_no_explicit_security.get import operation as get # noqa: E501 +from this_package import schemas, api_client +from this_package.configurations import api_configuration, schema_configuration + +from .. import ApiTestMixin + + +class TestGet(ApiTestMixin, unittest.TestCase): + """ + Get unit test stubs + path with no explicit security # noqa: E501 + """ + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = get.ApiForGet(api_client=used_api_client) # noqa: E501 + + response_status = 200 + response_body = '' + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/features/security/python/test/test_paths/test_path_with_one_explicit_security/__init__.py b/samples/openapi3/client/features/security/python/test/test_paths/test_path_with_one_explicit_security/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/features/security/python/test/test_paths/test_path_with_one_explicit_security/test_get.py b/samples/openapi3/client/features/security/python/test/test_paths/test_path_with_one_explicit_security/test_get.py new file mode 100644 index 00000000000..09575bc6f92 --- /dev/null +++ b/samples/openapi3/client/features/security/python/test/test_paths/test_path_with_one_explicit_security/test_get.py @@ -0,0 +1,36 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest +from unittest.mock import patch + +import urllib3 + +import this_package +from this_package.paths.path_with_one_explicit_security.get import operation as get # noqa: E501 +from this_package import schemas, api_client +from this_package.configurations import api_configuration, schema_configuration + +from .. import ApiTestMixin + + +class TestGet(ApiTestMixin, unittest.TestCase): + """ + Get unit test stubs + path with one explicit security # noqa: E501 + """ + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = get.ApiForGet(api_client=used_api_client) # noqa: E501 + + response_status = 200 + response_body = '' + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/features/security/python/test/test_paths/test_path_with_security_from_root/__init__.py b/samples/openapi3/client/features/security/python/test/test_paths/test_path_with_security_from_root/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/features/security/python/test/test_paths/test_path_with_security_from_root/test_get.py b/samples/openapi3/client/features/security/python/test/test_paths/test_path_with_security_from_root/test_get.py new file mode 100644 index 00000000000..ea4c0d9109d --- /dev/null +++ b/samples/openapi3/client/features/security/python/test/test_paths/test_path_with_security_from_root/test_get.py @@ -0,0 +1,36 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest +from unittest.mock import patch + +import urllib3 + +import this_package +from this_package.paths.path_with_security_from_root.get import operation as get # noqa: E501 +from this_package import schemas, api_client +from this_package.configurations import api_configuration, schema_configuration + +from .. import ApiTestMixin + + +class TestGet(ApiTestMixin, unittest.TestCase): + """ + Get unit test stubs + path with security from root # noqa: E501 + """ + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = get.ApiForGet(api_client=used_api_client) # noqa: E501 + + response_status = 200 + response_body = '' + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/features/security/python/test/test_paths/test_path_with_two_explicit_security/__init__.py b/samples/openapi3/client/features/security/python/test/test_paths/test_path_with_two_explicit_security/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/features/security/python/test/test_paths/test_path_with_two_explicit_security/test_get.py b/samples/openapi3/client/features/security/python/test/test_paths/test_path_with_two_explicit_security/test_get.py new file mode 100644 index 00000000000..67d8a3b7dff --- /dev/null +++ b/samples/openapi3/client/features/security/python/test/test_paths/test_path_with_two_explicit_security/test_get.py @@ -0,0 +1,36 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest +from unittest.mock import patch + +import urllib3 + +import this_package +from this_package.paths.path_with_two_explicit_security.get import operation as get # noqa: E501 +from this_package import schemas, api_client +from this_package.configurations import api_configuration, schema_configuration + +from .. import ApiTestMixin + + +class TestGet(ApiTestMixin, unittest.TestCase): + """ + Get unit test stubs + path with two explicit security # noqa: E501 + """ + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = get.ApiForGet(api_client=used_api_client) # noqa: E501 + + response_status = 200 + response_body = '' + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/features/security/python/test_manual/__init__.py b/samples/openapi3/client/features/security/python/test_manual/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/features/security/python/test_manual/test_paths/__init__.py b/samples/openapi3/client/features/security/python/test_manual/test_paths/__init__.py new file mode 100644 index 00000000000..c05324061c9 --- /dev/null +++ b/samples/openapi3/client/features/security/python/test_manual/test_paths/__init__.py @@ -0,0 +1,73 @@ +import json +import typing + +import urllib3 +from urllib3._collections import HTTPHeaderDict + + +class ApiTestMixin: + json_content_type = 'application/json' + user_agent = 'OpenAPI-JSON-Schema-Generator/1.0.0/python' + + @classmethod + def assert_pool_manager_request_called_with( + cls, + mock_request, + url: str, + method: str = 'POST', + body: typing.Optional[bytes] = None, + content_type: typing.Optional[str] = None, + accept_content_type: typing.Optional[str] = None, + stream: bool = False, + additional_headers: typing.Optional[dict] = None + ): + headers = { + 'User-Agent': cls.user_agent + } + if additional_headers: + assert 'Accept' not in additional_headers + assert 'Content-Type' not in additional_headers + headers.update(additional_headers) + if accept_content_type: + headers['Accept'] = accept_content_type + if content_type: + headers['Content-Type'] = content_type + kwargs = dict( + headers=HTTPHeaderDict(headers), + preload_content=not stream, + timeout=None, + ) + if content_type and method != 'GET': + kwargs['body'] = body + mock_request.assert_called_with( + method, + url, + **kwargs + ) + + @staticmethod + def headers_for_content_type(content_type: str) -> typing.Dict[str, str]: + return {'content-type': content_type} + + @classmethod + def response( + cls, + body: typing.Union[str, bytes], + status: int = 200, + content_type: str = json_content_type, + headers: typing.Optional[typing.Dict[str, str]] = None, + preload_content: bool = True + ) -> urllib3.HTTPResponse: + if headers is None: + headers = {} + headers.update(cls.headers_for_content_type(content_type)) + return urllib3.HTTPResponse( + body, + headers=headers, + status=status, + preload_content=preload_content + ) + + @staticmethod + def json_bytes(in_data: typing.Any) -> bytes: + return json.dumps(in_data, separators=(",", ":"), ensure_ascii=False).encode('utf-8') diff --git a/samples/openapi3/client/features/security/python/test_manual/test_paths/test_path_with_no_explicit_security/__init__.py b/samples/openapi3/client/features/security/python/test_manual/test_paths/test_path_with_no_explicit_security/__init__.py new file mode 100644 index 00000000000..c67de147f3a --- /dev/null +++ b/samples/openapi3/client/features/security/python/test_manual/test_paths/test_path_with_no_explicit_security/__init__.py @@ -0,0 +1,36 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest +from unittest.mock import patch + +import urllib3 + +import this_package +from this_package.paths.path_with_no_explicit_security.get import operation as get # noqa: E501 +from this_package import schemas, api_client +from this_package.configurations import api_configuration, schema_configuration + +from .. import ApiTestMixin + + +class TestGet(ApiTestMixin, unittest.TestCase): + """ + Get unit test stubs + path with no explicit security # noqa: E501 + """ + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = get.ApiForGet(api_client=used_api_client) # noqa: E501 + + response_status = 200 + response_body = '' + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/features/security/python/test_manual/test_paths/test_path_with_no_explicit_security/test_get.py b/samples/openapi3/client/features/security/python/test_manual/test_paths/test_path_with_no_explicit_security/test_get.py new file mode 100644 index 00000000000..ccb774ce784 --- /dev/null +++ b/samples/openapi3/client/features/security/python/test_manual/test_paths/test_path_with_no_explicit_security/test_get.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest +from unittest.mock import patch + +import urllib3 + +import this_package +from this_package.paths.path_with_no_explicit_security.get import operation as get # noqa: E501 +from this_package import schemas, api_client +from this_package.configurations import api_configuration, schema_configuration + +from .. import ApiTestMixin + + +class TestGet(ApiTestMixin, unittest.TestCase): + """ + Get unit test stubs + path with no explicit security # noqa: E501 + """ + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = get.ApiForGet(api_client=used_api_client) # noqa: E501 + + @patch.object(urllib3.PoolManager, 'request') + def test_endpoint_call_lacks_security(self, mock_request): + mock_request.return_value = self.response(b'') + + api = get.ApiForGet(api_client=self.used_api_client) + api_response = api.get() + self.assert_pool_manager_request_called_with( + mock_request, + f'http://localhost:3000/pathWithNoExplicitSecurity', + body=None, + method='GET', + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + assert isinstance(api_response.body, schemas.Unset) + assert isinstance(api_response.headers, schemas.Unset) + assert api_response.response.status == 200 + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/features/security/python/test_manual/test_paths/test_path_with_one_explicit_security/__init__.py b/samples/openapi3/client/features/security/python/test_manual/test_paths/test_path_with_one_explicit_security/__init__.py new file mode 100644 index 00000000000..09575bc6f92 --- /dev/null +++ b/samples/openapi3/client/features/security/python/test_manual/test_paths/test_path_with_one_explicit_security/__init__.py @@ -0,0 +1,36 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest +from unittest.mock import patch + +import urllib3 + +import this_package +from this_package.paths.path_with_one_explicit_security.get import operation as get # noqa: E501 +from this_package import schemas, api_client +from this_package.configurations import api_configuration, schema_configuration + +from .. import ApiTestMixin + + +class TestGet(ApiTestMixin, unittest.TestCase): + """ + Get unit test stubs + path with one explicit security # noqa: E501 + """ + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = get.ApiForGet(api_client=used_api_client) # noqa: E501 + + response_status = 200 + response_body = '' + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/features/security/python/test_manual/test_paths/test_path_with_one_explicit_security/test_get.py b/samples/openapi3/client/features/security/python/test_manual/test_paths/test_path_with_one_explicit_security/test_get.py new file mode 100644 index 00000000000..edfb47a47bb --- /dev/null +++ b/samples/openapi3/client/features/security/python/test_manual/test_paths/test_path_with_one_explicit_security/test_get.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest +from unittest.mock import patch + +import urllib3 + +import this_package +from this_package.paths.path_with_one_explicit_security.get import operation as get # noqa: E501 +from this_package import schemas, api_client +from this_package.configurations import api_configuration, schema_configuration +from this_package.components.security_schemes import security_scheme_api_key + +from .. import ApiTestMixin + + +class TestGet(ApiTestMixin, unittest.TestCase): + """ + Get unit test stubs + path with one explicit security # noqa: E501 + """ + security_scheme_info: api_configuration.SecuritySchemeInfo = { + "api_key": security_scheme_api_key.ApiKey( + api_key='sampleApiKeyValue' + ), + } + api_config = api_configuration.ApiConfiguration( + security_scheme_info=security_scheme_info + ) + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = get.ApiForGet(api_client=used_api_client) # noqa: E501 + + @patch.object(urllib3.PoolManager, 'request') + def test_endpoint_call_contains_security(self, mock_request): + mock_request.return_value = self.response(b'') + + api = get.ApiForGet(api_client=self.used_api_client) + api_response = api.get() + self.assert_pool_manager_request_called_with( + mock_request, + f'http://localhost:3000/pathWithOneExplicitSecurity', + method='GET', + additional_headers={'api_key': 'sampleApiKeyValue'} + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + assert isinstance(api_response.body, schemas.Unset) + assert isinstance(api_response.headers, schemas.Unset) + assert api_response.response.status == 200 + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/features/security/python/test_manual/test_paths/test_path_with_security_from_root/__init__.py b/samples/openapi3/client/features/security/python/test_manual/test_paths/test_path_with_security_from_root/__init__.py new file mode 100644 index 00000000000..ea4c0d9109d --- /dev/null +++ b/samples/openapi3/client/features/security/python/test_manual/test_paths/test_path_with_security_from_root/__init__.py @@ -0,0 +1,36 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest +from unittest.mock import patch + +import urllib3 + +import this_package +from this_package.paths.path_with_security_from_root.get import operation as get # noqa: E501 +from this_package import schemas, api_client +from this_package.configurations import api_configuration, schema_configuration + +from .. import ApiTestMixin + + +class TestGet(ApiTestMixin, unittest.TestCase): + """ + Get unit test stubs + path with security from root # noqa: E501 + """ + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = get.ApiForGet(api_client=used_api_client) # noqa: E501 + + response_status = 200 + response_body = '' + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/features/security/python/test_manual/test_paths/test_path_with_security_from_root/test_get.py b/samples/openapi3/client/features/security/python/test_manual/test_paths/test_path_with_security_from_root/test_get.py new file mode 100644 index 00000000000..ac230f7b29c --- /dev/null +++ b/samples/openapi3/client/features/security/python/test_manual/test_paths/test_path_with_security_from_root/test_get.py @@ -0,0 +1,126 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest +from unittest.mock import patch + +import urllib3 + +import this_package +from this_package.paths.path_with_security_from_root.get import operation as get # noqa: E501 +from this_package import schemas, api_client +from this_package.configurations import api_configuration, schema_configuration +from this_package.components.security_schemes import security_scheme_api_key +from this_package.components.security_schemes import security_scheme_http_basic_test +from this_package.components.security_schemes import security_scheme_http_basic_test +from this_package.components.security_schemes import security_scheme_api_key + +from .. import ApiTestMixin + + +class TestGet(ApiTestMixin, unittest.TestCase): + """ + Get unit test stubs + path with security from root # noqa: E501 + """ + security_scheme_info: api_configuration.SecuritySchemeInfo = { + # security_scheme_info for security_index 0 + 3 + "api_key": security_scheme_api_key.ApiKey( + api_key='sampleApiKeyValue' + ), + # security_scheme_info for security_index 1 + 3 + "http_basic_test": security_scheme_http_basic_test.HttpBasicTest( + user_id='someUserIdOrName', + password='somePassword', + ), + } + + api_config = api_configuration.ApiConfiguration( + security_scheme_info=security_scheme_info + ) + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = get.ApiForGet(api_client=used_api_client) # noqa: E501 + + @patch.object(urllib3.PoolManager, 'request') + def test_endpoint_call_contains_security0(self, mock_request): + mock_request.return_value = self.response(b'') + + api = get.ApiForGet(api_client=self.used_api_client) + api_response = api.get() + self.assert_pool_manager_request_called_with( + mock_request, + f'http://localhost:3000/pathWithSecurityFromRoot', + method='GET', + additional_headers={'api_key': 'sampleApiKeyValue'} + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + assert isinstance(api_response.body, schemas.Unset) + assert isinstance(api_response.headers, schemas.Unset) + assert api_response.response.status == 200 + + @patch.object(urllib3.PoolManager, 'request') + def test_endpoint_call_contains_security1(self, mock_request): + mock_request.return_value = self.response(b'') + + api = get.ApiForGet(api_client=self.used_api_client) + api_response = api.get(security_index=1) + self.assert_pool_manager_request_called_with( + mock_request, + f'http://localhost:3000/pathWithSecurityFromRoot', + method='GET', + additional_headers={'Authorization': 'Basic c29tZVVzZXJJZE9yTmFtZTpzb21lUGFzc3dvcmQ='} + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + assert isinstance(api_response.body, schemas.Unset) + assert isinstance(api_response.headers, schemas.Unset) + assert api_response.response.status == 200 + + @patch.object(urllib3.PoolManager, 'request') + def test_endpoint_call_contains_security2(self, mock_request): + mock_request.return_value = self.response(b'') + + api = get.ApiForGet(api_client=self.used_api_client) + api_response = api.get(security_index=2) + self.assert_pool_manager_request_called_with( + mock_request, + f'http://localhost:3000/pathWithSecurityFromRoot', + method='GET', + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + assert isinstance(api_response.body, schemas.Unset) + assert isinstance(api_response.headers, schemas.Unset) + assert api_response.response.status == 200 + + @patch.object(urllib3.PoolManager, 'request') + def test_endpoint_call_contains_security3(self, mock_request): + mock_request.return_value = self.response(b'') + + api = get.ApiForGet(api_client=self.used_api_client) + api_response = api.get(security_index=3) + self.assert_pool_manager_request_called_with( + mock_request, + f'http://localhost:3000/pathWithSecurityFromRoot', + method='GET', + additional_headers={ + 'Authorization': 'Basic c29tZVVzZXJJZE9yTmFtZTpzb21lUGFzc3dvcmQ=', + 'api_key': 'sampleApiKeyValue' + } + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + assert isinstance(api_response.body, schemas.Unset) + assert isinstance(api_response.headers, schemas.Unset) + assert api_response.response.status == 200 + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/features/security/python/test_manual/test_paths/test_path_with_two_explicit_security/__init__.py b/samples/openapi3/client/features/security/python/test_manual/test_paths/test_path_with_two_explicit_security/__init__.py new file mode 100644 index 00000000000..67d8a3b7dff --- /dev/null +++ b/samples/openapi3/client/features/security/python/test_manual/test_paths/test_path_with_two_explicit_security/__init__.py @@ -0,0 +1,36 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest +from unittest.mock import patch + +import urllib3 + +import this_package +from this_package.paths.path_with_two_explicit_security.get import operation as get # noqa: E501 +from this_package import schemas, api_client +from this_package.configurations import api_configuration, schema_configuration + +from .. import ApiTestMixin + + +class TestGet(ApiTestMixin, unittest.TestCase): + """ + Get unit test stubs + path with two explicit security # noqa: E501 + """ + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = get.ApiForGet(api_client=used_api_client) # noqa: E501 + + response_status = 200 + response_body = '' + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/features/security/python/test_manual/test_paths/test_path_with_two_explicit_security/test_get.py b/samples/openapi3/client/features/security/python/test_manual/test_paths/test_path_with_two_explicit_security/test_get.py new file mode 100644 index 00000000000..7bdd89cef13 --- /dev/null +++ b/samples/openapi3/client/features/security/python/test_manual/test_paths/test_path_with_two_explicit_security/test_get.py @@ -0,0 +1,131 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest +from unittest.mock import patch + +import urllib3 + +import this_package +from this_package.paths.path_with_two_explicit_security.get import operation as get # noqa: E501 +from this_package import schemas, api_client +from this_package.configurations import api_configuration, schema_configuration +from this_package.components.security_schemes import security_scheme_api_key +from this_package.components.security_schemes import security_scheme_bearer_test + +from .. import ApiTestMixin + + +class TestGet(ApiTestMixin, unittest.TestCase): + """ + Get unit test stubs + path with two explicit security # noqa: E501 + """ + security_scheme_info: api_configuration.SecuritySchemeInfo = { + # security_scheme_info for security_index 0 + "api_key": security_scheme_api_key.ApiKey( + api_key='sampleApiKeyValue' + ), + # security_scheme_info for security_index 1 + "bearer_test": security_scheme_bearer_test.BearerTest( + access_token='someAccessToken' + ), + } + + api_config = api_configuration.ApiConfiguration( + security_scheme_info=security_scheme_info + ) + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = get.ApiForGet(api_client=used_api_client) # noqa: E501 + + @patch.object(urllib3.PoolManager, 'request') + def test_endpoint_call_contains_security_index0(self, mock_request): + mock_request.return_value = self.response(b'') + + api = get.ApiForGet(api_client=self.used_api_client) + api_response = api.get() + self.assert_pool_manager_request_called_with( + mock_request, + f'http://localhost:3000/pathWithTwoExplicitSecurity', + method='GET', + additional_headers={'api_key': 'sampleApiKeyValue'} + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + assert isinstance(api_response.body, schemas.Unset) + assert isinstance(api_response.headers, schemas.Unset) + assert api_response.response.status == 200 + + @patch.object(urllib3.PoolManager, 'request') + def test_endpoint_call_contains_security_index1(self, mock_request): + mock_request.return_value = self.response(b'') + + api = get.ApiForGet(api_client=self.used_api_client) + api_response = api.get(security_index=1) + self.assert_pool_manager_request_called_with( + mock_request, + f'http://localhost:3000/pathWithTwoExplicitSecurity', + method='GET', + additional_headers={'Authorization': 'Bearer someAccessToken'} + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + assert isinstance(api_response.body, schemas.Unset) + assert isinstance(api_response.headers, schemas.Unset) + assert api_response.response.status == 200 + + @patch.object(urllib3.PoolManager, 'request') + def test_endpoint_call_contains_security_index1_from_endpoint_config(self, mock_request): + mock_request.return_value = self.response(b'') + + api_config = api_configuration.ApiConfiguration( + security_scheme_info=self.security_scheme_info, + security_index_info={'paths//pathWithTwoExplicitSecurity/get/security': 1} + ) + used_api_client = api_client.ApiClient(configuration=api_config) + api = get.ApiForGet(api_client=used_api_client) + api_response = api.get() + self.assert_pool_manager_request_called_with( + mock_request, + f'http://localhost:3000/pathWithTwoExplicitSecurity', + method='GET', + additional_headers={'Authorization': 'Bearer someAccessToken'} + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + assert isinstance(api_response.body, schemas.Unset) + assert isinstance(api_response.headers, schemas.Unset) + assert api_response.response.status == 200 + + @patch.object(urllib3.PoolManager, 'request') + def test_endpoint_call_contains_security_index1_from_root_config(self, mock_request): + mock_request.return_value = self.response(b'') + + api_config = api_configuration.ApiConfiguration( + security_scheme_info=self.security_scheme_info, + security_index_info={'security': 1} + ) + used_api_client = api_client.ApiClient(configuration=api_config) + api = get.ApiForGet(api_client=used_api_client) + api_response = api.get() + self.assert_pool_manager_request_called_with( + mock_request, + f'http://localhost:3000/pathWithTwoExplicitSecurity', + method='GET', + additional_headers={'Authorization': 'Bearer someAccessToken'} + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + assert isinstance(api_response.body, schemas.Unset) + assert isinstance(api_response.headers, schemas.Unset) + assert api_response.response.status == 200 + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/features/security/python/test_python.sh b/samples/openapi3/client/features/security/python/test_python.sh new file mode 100755 index 00000000000..f170f03a6e2 --- /dev/null +++ b/samples/openapi3/client/features/security/python/test_python.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +SETUP_OUT=*.egg-info +VENV=venv +DEACTIVE=false + +export LC_ALL=en_US.UTF-8 +export LANG=en_US.UTF-8 + +### set virtualenv +if [ -z "$VENVV" ]; then + python3 -m venv $VENV + source $VENV/bin/activate + DEACTIVE=true +fi + +### install dependencies +pip install tox +### locally install the package, needed for pycharm problem checking +python -m pip install . + +### run tests +tox || exit 1 + +### static analysis of code +#flake8 --show-source petstore_api/ + +### deactivate virtualenv +#if [ $DEACTIVE == true ]; then +# deactivate +#fi diff --git a/samples/openapi3/client/features/security/python/tox.ini b/samples/openapi3/client/features/security/python/tox.ini new file mode 100644 index 00000000000..d450a327dd5 --- /dev/null +++ b/samples/openapi3/client/features/security/python/tox.ini @@ -0,0 +1,10 @@ +[tox] +envlist = py37 +isolated_build = True + +[testenv] +passenv = PYTHON_VERSION +deps=-r{toxinidir}/test-requirements.txt + +commands= + pytest --cov=this_package diff --git a/samples/openapi3/client/petstore/python/.openapi-generator-ignore b/samples/openapi3/client/petstore/python/.openapi-generator-ignore index 7484ee590a3..d24a2da8ae5 100644 --- a/samples/openapi3/client/petstore/python/.openapi-generator-ignore +++ b/samples/openapi3/client/petstore/python/.openapi-generator-ignore @@ -1,5 +1,5 @@ # OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator +# Generated by openapi-generator https://github.com/openapi-json-schema-tools/openapi-json-schema-generator # Use this file to prevent files from being overwritten by the generator. # The patterns follow closely to .gitignore or .dockerignore. diff --git a/samples/openapi3/client/petstore/python/.openapi-generator/FILES b/samples/openapi3/client/petstore/python/.openapi-generator/FILES index df884ab6e63..457d3b64894 100644 --- a/samples/openapi3/client/petstore/python/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/python/.openapi-generator/FILES @@ -2,404 +2,1482 @@ .gitlab-ci.yml .travis.yml README.md -docs/apis/tags/AnotherFakeApi.md -docs/apis/tags/DefaultApi.md -docs/apis/tags/FakeApi.md -docs/apis/tags/FakeClassnameTags123Api.md -docs/apis/tags/PetApi.md -docs/apis/tags/StoreApi.md -docs/apis/tags/UserApi.md -docs/models/AbstractStepMessage.md -docs/models/AdditionalPropertiesClass.md -docs/models/AdditionalPropertiesValidator.md -docs/models/AdditionalPropertiesWithArrayOfEnums.md -docs/models/Address.md -docs/models/Animal.md -docs/models/AnimalFarm.md -docs/models/AnyTypeAndFormat.md -docs/models/AnyTypeNotString.md -docs/models/ApiResponse.md -docs/models/Apple.md -docs/models/AppleReq.md -docs/models/ArrayHoldingAnyType.md -docs/models/ArrayOfArrayOfNumberOnly.md -docs/models/ArrayOfEnums.md -docs/models/ArrayOfNumberOnly.md -docs/models/ArrayTest.md -docs/models/ArrayWithValidationsInItems.md -docs/models/Banana.md -docs/models/BananaReq.md -docs/models/Bar.md -docs/models/BasquePig.md -docs/models/Boolean.md -docs/models/BooleanEnum.md -docs/models/Capitalization.md -docs/models/Cat.md -docs/models/Category.md -docs/models/ChildCat.md -docs/models/ClassModel.md -docs/models/Client.md -docs/models/ComplexQuadrilateral.md -docs/models/ComposedAnyOfDifferentTypesNoValidations.md -docs/models/ComposedArray.md -docs/models/ComposedBool.md -docs/models/ComposedNone.md -docs/models/ComposedNumber.md -docs/models/ComposedObject.md -docs/models/ComposedOneOfDifferentTypes.md -docs/models/ComposedString.md -docs/models/Currency.md -docs/models/DanishPig.md -docs/models/DateTimeTest.md -docs/models/DateTimeWithValidations.md -docs/models/DateWithValidations.md -docs/models/DecimalPayload.md -docs/models/Dog.md -docs/models/Drawing.md -docs/models/EnumArrays.md -docs/models/EnumClass.md -docs/models/EnumTest.md -docs/models/EquilateralTriangle.md -docs/models/File.md -docs/models/FileSchemaTestClass.md -docs/models/Foo.md -docs/models/FormatTest.md -docs/models/FromSchema.md -docs/models/Fruit.md -docs/models/FruitReq.md -docs/models/GmFruit.md -docs/models/GrandparentAnimal.md -docs/models/HasOnlyReadOnly.md -docs/models/HealthCheckResult.md -docs/models/IntegerEnum.md -docs/models/IntegerEnumBig.md -docs/models/IntegerEnumOneValue.md -docs/models/IntegerEnumWithDefaultValue.md -docs/models/IntegerMax10.md -docs/models/IntegerMin15.md -docs/models/IsoscelesTriangle.md -docs/models/JSONPatchRequest.md -docs/models/JSONPatchRequestAddReplaceTest.md -docs/models/JSONPatchRequestMoveCopy.md -docs/models/JSONPatchRequestRemove.md -docs/models/Mammal.md -docs/models/MapTest.md -docs/models/MixedPropertiesAndAdditionalPropertiesClass.md -docs/models/Model200Response.md -docs/models/ModelReturn.md -docs/models/Money.md -docs/models/Name.md -docs/models/NoAdditionalProperties.md -docs/models/NullableClass.md -docs/models/NullableShape.md -docs/models/NullableString.md -docs/models/Number.md -docs/models/NumberOnly.md -docs/models/NumberWithValidations.md -docs/models/ObjectInterface.md -docs/models/ObjectModelWithArgAndArgsProperties.md -docs/models/ObjectModelWithRefProps.md -docs/models/ObjectWithAllOfWithReqTestPropFromUnsetAddProp.md -docs/models/ObjectWithDecimalProperties.md -docs/models/ObjectWithDifficultlyNamedProps.md -docs/models/ObjectWithInlineCompositionProperty.md -docs/models/ObjectWithInvalidNamedRefedProperties.md -docs/models/ObjectWithOptionalTestProp.md -docs/models/ObjectWithValidations.md -docs/models/Order.md -docs/models/ParentPet.md -docs/models/Pet.md -docs/models/Pig.md -docs/models/Player.md -docs/models/Quadrilateral.md -docs/models/QuadrilateralInterface.md -docs/models/ReadOnlyFirst.md -docs/models/ScaleneTriangle.md -docs/models/Shape.md -docs/models/ShapeOrNull.md -docs/models/SimpleQuadrilateral.md -docs/models/SomeObject.md -docs/models/SpecialModelName.md -docs/models/String.md -docs/models/StringBooleanMap.md -docs/models/StringEnum.md -docs/models/StringEnumWithDefaultValue.md -docs/models/StringWithValidation.md -docs/models/Tag.md -docs/models/Triangle.md -docs/models/TriangleInterface.md -docs/models/UUIDString.md -docs/models/User.md -docs/models/Whale.md -docs/models/Zebra.md +docs/apis/tags/another_fake_api.md +docs/apis/tags/default_api.md +docs/apis/tags/fake_api.md +docs/apis/tags/fake_classname_tags123_api.md +docs/apis/tags/pet_api.md +docs/apis/tags/store_api.md +docs/apis/tags/user_api.md +docs/components/headers/header_int32_json_content_type_header.md +docs/components/headers/header_number_header.md +docs/components/headers/header_ref_content_schema_header.md +docs/components/headers/header_ref_schema_header.md +docs/components/headers/header_ref_string_header.md +docs/components/headers/header_string_header.md +docs/components/parameters/parameter_component_ref_schema_string_with_validation.md +docs/components/parameters/parameter_path_user_name.md +docs/components/parameters/parameter_ref_path_user_name.md +docs/components/parameters/parameter_ref_schema_string_with_validation.md +docs/components/request_bodies/request_body_client.md +docs/components/request_bodies/request_body_pet.md +docs/components/request_bodies/request_body_ref_user_array.md +docs/components/request_bodies/request_body_user_array.md +docs/components/responses/response_ref_success_description_only.md +docs/components/responses/response_ref_successful_xml_and_json_array_of_pet.md +docs/components/responses/response_success_description_only.md +docs/components/responses/response_success_inline_content_and_header.md +docs/components/responses/response_success_with_json_api_response.md +docs/components/responses/response_successful_xml_and_json_array_of_pet.md +docs/components/schema/_200_response.md +docs/components/schema/_return.md +docs/components/schema/abstract_step_message.md +docs/components/schema/additional_properties_class.md +docs/components/schema/additional_properties_validator.md +docs/components/schema/additional_properties_with_array_of_enums.md +docs/components/schema/address.md +docs/components/schema/animal.md +docs/components/schema/animal_farm.md +docs/components/schema/any_type_and_format.md +docs/components/schema/any_type_not_string.md +docs/components/schema/api_response.md +docs/components/schema/apple.md +docs/components/schema/apple_req.md +docs/components/schema/array_holding_any_type.md +docs/components/schema/array_of_array_of_number_only.md +docs/components/schema/array_of_enums.md +docs/components/schema/array_of_number_only.md +docs/components/schema/array_test.md +docs/components/schema/array_with_validations_in_items.md +docs/components/schema/banana.md +docs/components/schema/banana_req.md +docs/components/schema/bar.md +docs/components/schema/basque_pig.md +docs/components/schema/boolean.md +docs/components/schema/boolean_enum.md +docs/components/schema/capitalization.md +docs/components/schema/cat.md +docs/components/schema/category.md +docs/components/schema/child_cat.md +docs/components/schema/class_model.md +docs/components/schema/client.md +docs/components/schema/complex_quadrilateral.md +docs/components/schema/composed_any_of_different_types_no_validations.md +docs/components/schema/composed_array.md +docs/components/schema/composed_bool.md +docs/components/schema/composed_none.md +docs/components/schema/composed_number.md +docs/components/schema/composed_object.md +docs/components/schema/composed_one_of_different_types.md +docs/components/schema/composed_string.md +docs/components/schema/currency.md +docs/components/schema/danish_pig.md +docs/components/schema/date_time_test.md +docs/components/schema/date_time_with_validations.md +docs/components/schema/date_with_validations.md +docs/components/schema/decimal_payload.md +docs/components/schema/dog.md +docs/components/schema/drawing.md +docs/components/schema/enum_arrays.md +docs/components/schema/enum_class.md +docs/components/schema/enum_test.md +docs/components/schema/equilateral_triangle.md +docs/components/schema/file.md +docs/components/schema/file_schema_test_class.md +docs/components/schema/foo.md +docs/components/schema/format_test.md +docs/components/schema/from_schema.md +docs/components/schema/fruit.md +docs/components/schema/fruit_req.md +docs/components/schema/gm_fruit.md +docs/components/schema/grandparent_animal.md +docs/components/schema/has_only_read_only.md +docs/components/schema/health_check_result.md +docs/components/schema/integer_enum.md +docs/components/schema/integer_enum_big.md +docs/components/schema/integer_enum_one_value.md +docs/components/schema/integer_enum_with_default_value.md +docs/components/schema/integer_max10.md +docs/components/schema/integer_min15.md +docs/components/schema/isosceles_triangle.md +docs/components/schema/items.md +docs/components/schema/json_patch_request.md +docs/components/schema/json_patch_request_add_replace_test.md +docs/components/schema/json_patch_request_move_copy.md +docs/components/schema/json_patch_request_remove.md +docs/components/schema/mammal.md +docs/components/schema/map_test.md +docs/components/schema/mixed_properties_and_additional_properties_class.md +docs/components/schema/money.md +docs/components/schema/name.md +docs/components/schema/no_additional_properties.md +docs/components/schema/nullable_class.md +docs/components/schema/nullable_shape.md +docs/components/schema/nullable_string.md +docs/components/schema/number.md +docs/components/schema/number_only.md +docs/components/schema/number_with_validations.md +docs/components/schema/object_interface.md +docs/components/schema/object_model_with_arg_and_args_properties.md +docs/components/schema/object_model_with_ref_props.md +docs/components/schema/object_with_all_of_with_req_test_prop_from_unset_add_prop.md +docs/components/schema/object_with_colliding_properties.md +docs/components/schema/object_with_decimal_properties.md +docs/components/schema/object_with_difficultly_named_props.md +docs/components/schema/object_with_inline_composition_property.md +docs/components/schema/object_with_invalid_named_refed_properties.md +docs/components/schema/object_with_optional_test_prop.md +docs/components/schema/object_with_validations.md +docs/components/schema/order.md +docs/components/schema/parent_pet.md +docs/components/schema/pet.md +docs/components/schema/pig.md +docs/components/schema/player.md +docs/components/schema/quadrilateral.md +docs/components/schema/quadrilateral_interface.md +docs/components/schema/read_only_first.md +docs/components/schema/ref_pet.md +docs/components/schema/req_props_from_explicit_add_props.md +docs/components/schema/req_props_from_true_add_props.md +docs/components/schema/req_props_from_unset_add_props.md +docs/components/schema/scalene_triangle.md +docs/components/schema/self_referencing_array_model.md +docs/components/schema/self_referencing_object_model.md +docs/components/schema/shape.md +docs/components/schema/shape_or_null.md +docs/components/schema/simple_quadrilateral.md +docs/components/schema/some_object.md +docs/components/schema/special_model_name.md +docs/components/schema/string.md +docs/components/schema/string_boolean_map.md +docs/components/schema/string_enum.md +docs/components/schema/string_enum_with_default_value.md +docs/components/schema/string_with_validation.md +docs/components/schema/tag.md +docs/components/schema/triangle.md +docs/components/schema/triangle_interface.md +docs/components/schema/user.md +docs/components/schema/uuid_string.md +docs/components/schema/whale.md +docs/components/schema/zebra.md +docs/components/security_schemes/security_scheme_api_key.md +docs/components/security_schemes/security_scheme_api_key_query.md +docs/components/security_schemes/security_scheme_bearer_test.md +docs/components/security_schemes/security_scheme_http_basic_test.md +docs/components/security_schemes/security_scheme_http_signature_test.md +docs/components/security_schemes/security_scheme_open_id_connect_test.md +docs/components/security_schemes/security_scheme_petstore_auth.md +docs/paths/another_fake_dummy/patch.md +docs/paths/fake/delete.md +docs/paths/fake/get.md +docs/paths/fake/patch.md +docs/paths/fake/post.md +docs/paths/fake_additional_properties_with_array_of_enums/get.md +docs/paths/fake_body_with_file_schema/put.md +docs/paths/fake_body_with_query_params/put.md +docs/paths/fake_case_sensitive_params/put.md +docs/paths/fake_classname_test/patch.md +docs/paths/fake_delete_coffee_id/delete.md +docs/paths/fake_health/get.md +docs/paths/fake_inline_additional_properties/post.md +docs/paths/fake_inline_composition/post.md +docs/paths/fake_json_form_data/get.md +docs/paths/fake_json_patch/patch.md +docs/paths/fake_json_with_charset/post.md +docs/paths/fake_multiple_response_bodies/get.md +docs/paths/fake_multiple_securities/get.md +docs/paths/fake_obj_in_query/get.md +docs/paths/fake_parameter_collisions1_abab_self_ab/post.md +docs/paths/fake_pet_id_upload_image_with_required_file/post.md +docs/paths/fake_query_param_with_json_content_type/get.md +docs/paths/fake_redirection/get.md +docs/paths/fake_ref_obj_in_query/get.md +docs/paths/fake_refs_array_of_enums/post.md +docs/paths/fake_refs_arraymodel/post.md +docs/paths/fake_refs_boolean/post.md +docs/paths/fake_refs_composed_one_of_number_with_validations/post.md +docs/paths/fake_refs_enum/post.md +docs/paths/fake_refs_mammal/post.md +docs/paths/fake_refs_number/post.md +docs/paths/fake_refs_object_model_with_ref_props/post.md +docs/paths/fake_refs_string/post.md +docs/paths/fake_response_without_schema/get.md +docs/paths/fake_test_query_paramters/put.md +docs/paths/fake_upload_download_file/post.md +docs/paths/fake_upload_file/post.md +docs/paths/fake_upload_files/post.md +docs/paths/fake_wild_card_responses/get.md +docs/paths/foo/get.md +docs/paths/pet/post.md +docs/paths/pet/put.md +docs/paths/pet_find_by_status/get.md +docs/paths/pet_find_by_tags/get.md +docs/paths/pet_pet_id/delete.md +docs/paths/pet_pet_id/get.md +docs/paths/pet_pet_id/post.md +docs/paths/pet_pet_id_upload_image/post.md +docs/paths/store_inventory/get.md +docs/paths/store_order/post.md +docs/paths/store_order_order_id/delete.md +docs/paths/store_order_order_id/get.md +docs/paths/user/post.md +docs/paths/user_create_with_array/post.md +docs/paths/user_create_with_list/post.md +docs/paths/user_login/get.md +docs/paths/user_logout/get.md +docs/paths/user_username/delete.md +docs/paths/user_username/get.md +docs/paths/user_username/put.md +docs/servers/server_0.md +docs/servers/server_1.md +docs/servers/server_2.md git_push.sh -petstore_api/__init__.py -petstore_api/api_client.py -petstore_api/apis/__init__.py -petstore_api/apis/tags/another_fake_api.py -petstore_api/apis/tags/default_api.py -petstore_api/apis/tags/fake_api.py -petstore_api/apis/tags/fake_classname_tags123_api.py -petstore_api/apis/tags/pet_api.py -petstore_api/apis/tags/store_api.py -petstore_api/apis/tags/user_api.py -petstore_api/configuration.py -petstore_api/exceptions.py -petstore_api/model/__init__.py -petstore_api/model/abstract_step_message.py -petstore_api/model/abstract_step_message.pyi -petstore_api/model/additional_properties_class.py -petstore_api/model/additional_properties_class.pyi -petstore_api/model/additional_properties_validator.py -petstore_api/model/additional_properties_validator.pyi -petstore_api/model/additional_properties_with_array_of_enums.py -petstore_api/model/additional_properties_with_array_of_enums.pyi -petstore_api/model/address.py -petstore_api/model/address.pyi -petstore_api/model/animal.py -petstore_api/model/animal.pyi -petstore_api/model/animal_farm.py -petstore_api/model/animal_farm.pyi -petstore_api/model/any_type_and_format.py -petstore_api/model/any_type_and_format.pyi -petstore_api/model/any_type_not_string.py -petstore_api/model/any_type_not_string.pyi -petstore_api/model/api_response.py -petstore_api/model/api_response.pyi -petstore_api/model/apple.py -petstore_api/model/apple.pyi -petstore_api/model/apple_req.py -petstore_api/model/apple_req.pyi -petstore_api/model/array_holding_any_type.py -petstore_api/model/array_holding_any_type.pyi -petstore_api/model/array_of_array_of_number_only.py -petstore_api/model/array_of_array_of_number_only.pyi -petstore_api/model/array_of_enums.py -petstore_api/model/array_of_enums.pyi -petstore_api/model/array_of_number_only.py -petstore_api/model/array_of_number_only.pyi -petstore_api/model/array_test.py -petstore_api/model/array_test.pyi -petstore_api/model/array_with_validations_in_items.py -petstore_api/model/array_with_validations_in_items.pyi -petstore_api/model/banana.py -petstore_api/model/banana.pyi -petstore_api/model/banana_req.py -petstore_api/model/banana_req.pyi -petstore_api/model/bar.py -petstore_api/model/bar.pyi -petstore_api/model/basque_pig.py -petstore_api/model/basque_pig.pyi -petstore_api/model/boolean.py -petstore_api/model/boolean.pyi -petstore_api/model/boolean_enum.py -petstore_api/model/boolean_enum.pyi -petstore_api/model/capitalization.py -petstore_api/model/capitalization.pyi -petstore_api/model/cat.py -petstore_api/model/cat.pyi -petstore_api/model/category.py -petstore_api/model/category.pyi -petstore_api/model/child_cat.py -petstore_api/model/child_cat.pyi -petstore_api/model/class_model.py -petstore_api/model/class_model.pyi -petstore_api/model/client.py -petstore_api/model/client.pyi -petstore_api/model/complex_quadrilateral.py -petstore_api/model/complex_quadrilateral.pyi -petstore_api/model/composed_any_of_different_types_no_validations.py -petstore_api/model/composed_any_of_different_types_no_validations.pyi -petstore_api/model/composed_array.py -petstore_api/model/composed_array.pyi -petstore_api/model/composed_bool.py -petstore_api/model/composed_bool.pyi -petstore_api/model/composed_none.py -petstore_api/model/composed_none.pyi -petstore_api/model/composed_number.py -petstore_api/model/composed_number.pyi -petstore_api/model/composed_object.py -petstore_api/model/composed_object.pyi -petstore_api/model/composed_one_of_different_types.py -petstore_api/model/composed_one_of_different_types.pyi -petstore_api/model/composed_string.py -petstore_api/model/composed_string.pyi -petstore_api/model/currency.py -petstore_api/model/currency.pyi -petstore_api/model/danish_pig.py -petstore_api/model/danish_pig.pyi -petstore_api/model/date_time_test.py -petstore_api/model/date_time_test.pyi -petstore_api/model/date_time_with_validations.py -petstore_api/model/date_time_with_validations.pyi -petstore_api/model/date_with_validations.py -petstore_api/model/date_with_validations.pyi -petstore_api/model/decimal_payload.py -petstore_api/model/decimal_payload.pyi -petstore_api/model/dog.py -petstore_api/model/dog.pyi -petstore_api/model/drawing.py -petstore_api/model/drawing.pyi -petstore_api/model/enum_arrays.py -petstore_api/model/enum_arrays.pyi -petstore_api/model/enum_class.py -petstore_api/model/enum_class.pyi -petstore_api/model/enum_test.py -petstore_api/model/enum_test.pyi -petstore_api/model/equilateral_triangle.py -petstore_api/model/equilateral_triangle.pyi -petstore_api/model/file.py -petstore_api/model/file.pyi -petstore_api/model/file_schema_test_class.py -petstore_api/model/file_schema_test_class.pyi -petstore_api/model/foo.py -petstore_api/model/foo.pyi -petstore_api/model/format_test.py -petstore_api/model/format_test.pyi -petstore_api/model/from_schema.py -petstore_api/model/from_schema.pyi -petstore_api/model/fruit.py -petstore_api/model/fruit.pyi -petstore_api/model/fruit_req.py -petstore_api/model/fruit_req.pyi -petstore_api/model/gm_fruit.py -petstore_api/model/gm_fruit.pyi -petstore_api/model/grandparent_animal.py -petstore_api/model/grandparent_animal.pyi -petstore_api/model/has_only_read_only.py -petstore_api/model/has_only_read_only.pyi -petstore_api/model/health_check_result.py -petstore_api/model/health_check_result.pyi -petstore_api/model/integer_enum.py -petstore_api/model/integer_enum.pyi -petstore_api/model/integer_enum_big.py -petstore_api/model/integer_enum_big.pyi -petstore_api/model/integer_enum_one_value.py -petstore_api/model/integer_enum_one_value.pyi -petstore_api/model/integer_enum_with_default_value.py -petstore_api/model/integer_enum_with_default_value.pyi -petstore_api/model/integer_max10.py -petstore_api/model/integer_max10.pyi -petstore_api/model/integer_min15.py -petstore_api/model/integer_min15.pyi -petstore_api/model/isosceles_triangle.py -petstore_api/model/isosceles_triangle.pyi -petstore_api/model/json_patch_request.py -petstore_api/model/json_patch_request.pyi -petstore_api/model/json_patch_request_add_replace_test.py -petstore_api/model/json_patch_request_add_replace_test.pyi -petstore_api/model/json_patch_request_move_copy.py -petstore_api/model/json_patch_request_move_copy.pyi -petstore_api/model/json_patch_request_remove.py -petstore_api/model/json_patch_request_remove.pyi -petstore_api/model/mammal.py -petstore_api/model/mammal.pyi -petstore_api/model/map_test.py -petstore_api/model/map_test.pyi -petstore_api/model/mixed_properties_and_additional_properties_class.py -petstore_api/model/mixed_properties_and_additional_properties_class.pyi -petstore_api/model/model200_response.py -petstore_api/model/model200_response.pyi -petstore_api/model/model_return.py -petstore_api/model/model_return.pyi -petstore_api/model/money.py -petstore_api/model/money.pyi -petstore_api/model/name.py -petstore_api/model/name.pyi -petstore_api/model/no_additional_properties.py -petstore_api/model/no_additional_properties.pyi -petstore_api/model/nullable_class.py -petstore_api/model/nullable_class.pyi -petstore_api/model/nullable_shape.py -petstore_api/model/nullable_shape.pyi -petstore_api/model/nullable_string.py -petstore_api/model/nullable_string.pyi -petstore_api/model/number.py -petstore_api/model/number.pyi -petstore_api/model/number_only.py -petstore_api/model/number_only.pyi -petstore_api/model/number_with_validations.py -petstore_api/model/number_with_validations.pyi -petstore_api/model/object_interface.py -petstore_api/model/object_interface.pyi -petstore_api/model/object_model_with_arg_and_args_properties.py -petstore_api/model/object_model_with_arg_and_args_properties.pyi -petstore_api/model/object_model_with_ref_props.py -petstore_api/model/object_model_with_ref_props.pyi -petstore_api/model/object_with_all_of_with_req_test_prop_from_unset_add_prop.py -petstore_api/model/object_with_all_of_with_req_test_prop_from_unset_add_prop.pyi -petstore_api/model/object_with_decimal_properties.py -petstore_api/model/object_with_decimal_properties.pyi -petstore_api/model/object_with_difficultly_named_props.py -petstore_api/model/object_with_difficultly_named_props.pyi -petstore_api/model/object_with_inline_composition_property.py -petstore_api/model/object_with_inline_composition_property.pyi -petstore_api/model/object_with_invalid_named_refed_properties.py -petstore_api/model/object_with_invalid_named_refed_properties.pyi -petstore_api/model/object_with_optional_test_prop.py -petstore_api/model/object_with_optional_test_prop.pyi -petstore_api/model/object_with_validations.py -petstore_api/model/object_with_validations.pyi -petstore_api/model/order.py -petstore_api/model/order.pyi -petstore_api/model/parent_pet.py -petstore_api/model/parent_pet.pyi -petstore_api/model/pet.py -petstore_api/model/pet.pyi -petstore_api/model/pig.py -petstore_api/model/pig.pyi -petstore_api/model/player.py -petstore_api/model/player.pyi -petstore_api/model/quadrilateral.py -petstore_api/model/quadrilateral.pyi -petstore_api/model/quadrilateral_interface.py -petstore_api/model/quadrilateral_interface.pyi -petstore_api/model/read_only_first.py -petstore_api/model/read_only_first.pyi -petstore_api/model/scalene_triangle.py -petstore_api/model/scalene_triangle.pyi -petstore_api/model/shape.py -petstore_api/model/shape.pyi -petstore_api/model/shape_or_null.py -petstore_api/model/shape_or_null.pyi -petstore_api/model/simple_quadrilateral.py -petstore_api/model/simple_quadrilateral.pyi -petstore_api/model/some_object.py -petstore_api/model/some_object.pyi -petstore_api/model/special_model_name.py -petstore_api/model/special_model_name.pyi -petstore_api/model/string.py -petstore_api/model/string.pyi -petstore_api/model/string_boolean_map.py -petstore_api/model/string_boolean_map.pyi -petstore_api/model/string_enum.py -petstore_api/model/string_enum.pyi -petstore_api/model/string_enum_with_default_value.py -petstore_api/model/string_enum_with_default_value.pyi -petstore_api/model/string_with_validation.py -petstore_api/model/string_with_validation.pyi -petstore_api/model/tag.py -petstore_api/model/tag.pyi -petstore_api/model/triangle.py -petstore_api/model/triangle.pyi -petstore_api/model/triangle_interface.py -petstore_api/model/triangle_interface.pyi -petstore_api/model/user.py -petstore_api/model/user.pyi -petstore_api/model/uuid_string.py -petstore_api/model/uuid_string.pyi -petstore_api/model/whale.py -petstore_api/model/whale.pyi -petstore_api/model/zebra.py -petstore_api/model/zebra.pyi -petstore_api/models/__init__.py -petstore_api/rest.py -petstore_api/schemas.py -petstore_api/signing.py -requirements.txt -setup.cfg -setup.py +migration_2_0_0.md +migration_other_python_generators.md +pyproject.toml +src/petstore_api/__init__.py +src/petstore_api/api_client.py +src/petstore_api/apis/__init__.py +src/petstore_api/apis/path_to_api.py +src/petstore_api/apis/paths/__init__.py +src/petstore_api/apis/paths/another_fake_dummy.py +src/petstore_api/apis/paths/fake.py +src/petstore_api/apis/paths/fake_additional_properties_with_array_of_enums.py +src/petstore_api/apis/paths/fake_body_with_file_schema.py +src/petstore_api/apis/paths/fake_body_with_query_params.py +src/petstore_api/apis/paths/fake_case_sensitive_params.py +src/petstore_api/apis/paths/fake_classname_test.py +src/petstore_api/apis/paths/fake_delete_coffee_id.py +src/petstore_api/apis/paths/fake_health.py +src/petstore_api/apis/paths/fake_inline_additional_properties.py +src/petstore_api/apis/paths/fake_inline_composition.py +src/petstore_api/apis/paths/fake_json_form_data.py +src/petstore_api/apis/paths/fake_json_patch.py +src/petstore_api/apis/paths/fake_json_with_charset.py +src/petstore_api/apis/paths/fake_multiple_response_bodies.py +src/petstore_api/apis/paths/fake_multiple_securities.py +src/petstore_api/apis/paths/fake_obj_in_query.py +src/petstore_api/apis/paths/fake_parameter_collisions1_abab_self_ab.py +src/petstore_api/apis/paths/fake_pet_id_upload_image_with_required_file.py +src/petstore_api/apis/paths/fake_query_param_with_json_content_type.py +src/petstore_api/apis/paths/fake_redirection.py +src/petstore_api/apis/paths/fake_ref_obj_in_query.py +src/petstore_api/apis/paths/fake_refs_array_of_enums.py +src/petstore_api/apis/paths/fake_refs_arraymodel.py +src/petstore_api/apis/paths/fake_refs_boolean.py +src/petstore_api/apis/paths/fake_refs_composed_one_of_number_with_validations.py +src/petstore_api/apis/paths/fake_refs_enum.py +src/petstore_api/apis/paths/fake_refs_mammal.py +src/petstore_api/apis/paths/fake_refs_number.py +src/petstore_api/apis/paths/fake_refs_object_model_with_ref_props.py +src/petstore_api/apis/paths/fake_refs_string.py +src/petstore_api/apis/paths/fake_response_without_schema.py +src/petstore_api/apis/paths/fake_test_query_paramters.py +src/petstore_api/apis/paths/fake_upload_download_file.py +src/petstore_api/apis/paths/fake_upload_file.py +src/petstore_api/apis/paths/fake_upload_files.py +src/petstore_api/apis/paths/fake_wild_card_responses.py +src/petstore_api/apis/paths/foo.py +src/petstore_api/apis/paths/pet.py +src/petstore_api/apis/paths/pet_find_by_status.py +src/petstore_api/apis/paths/pet_find_by_tags.py +src/petstore_api/apis/paths/pet_pet_id.py +src/petstore_api/apis/paths/pet_pet_id_upload_image.py +src/petstore_api/apis/paths/store_inventory.py +src/petstore_api/apis/paths/store_order.py +src/petstore_api/apis/paths/store_order_order_id.py +src/petstore_api/apis/paths/user.py +src/petstore_api/apis/paths/user_create_with_array.py +src/petstore_api/apis/paths/user_create_with_list.py +src/petstore_api/apis/paths/user_login.py +src/petstore_api/apis/paths/user_logout.py +src/petstore_api/apis/paths/user_username.py +src/petstore_api/apis/tag_to_api.py +src/petstore_api/apis/tags/__init__.py +src/petstore_api/apis/tags/another_fake_api.py +src/petstore_api/apis/tags/default_api.py +src/petstore_api/apis/tags/fake_api.py +src/petstore_api/apis/tags/fake_classname_tags123_api.py +src/petstore_api/apis/tags/pet_api.py +src/petstore_api/apis/tags/store_api.py +src/petstore_api/apis/tags/user_api.py +src/petstore_api/components/__init__.py +src/petstore_api/components/headers/__init__.py +src/petstore_api/components/headers/header_int32_json_content_type_header/__init__.py +src/petstore_api/components/headers/header_int32_json_content_type_header/content/__init__.py +src/petstore_api/components/headers/header_int32_json_content_type_header/content/application_json/__init__.py +src/petstore_api/components/headers/header_int32_json_content_type_header/content/application_json/schema.py +src/petstore_api/components/headers/header_number_header/__init__.py +src/petstore_api/components/headers/header_number_header/schema.py +src/petstore_api/components/headers/header_ref_content_schema_header/__init__.py +src/petstore_api/components/headers/header_ref_content_schema_header/content/__init__.py +src/petstore_api/components/headers/header_ref_content_schema_header/content/application_json/__init__.py +src/petstore_api/components/headers/header_ref_content_schema_header/content/application_json/schema.py +src/petstore_api/components/headers/header_ref_schema_header/__init__.py +src/petstore_api/components/headers/header_ref_schema_header/schema.py +src/petstore_api/components/headers/header_ref_string_header/__init__.py +src/petstore_api/components/headers/header_string_header/__init__.py +src/petstore_api/components/headers/header_string_header/schema.py +src/petstore_api/components/parameters/__init__.py +src/petstore_api/components/parameters/parameter_component_ref_schema_string_with_validation/__init__.py +src/petstore_api/components/parameters/parameter_component_ref_schema_string_with_validation/content/__init__.py +src/petstore_api/components/parameters/parameter_component_ref_schema_string_with_validation/content/application_json/__init__.py +src/petstore_api/components/parameters/parameter_component_ref_schema_string_with_validation/content/application_json/schema.py +src/petstore_api/components/parameters/parameter_path_user_name/__init__.py +src/petstore_api/components/parameters/parameter_path_user_name/schema.py +src/petstore_api/components/parameters/parameter_ref_path_user_name/__init__.py +src/petstore_api/components/parameters/parameter_ref_schema_string_with_validation/__init__.py +src/petstore_api/components/parameters/parameter_ref_schema_string_with_validation/schema.py +src/petstore_api/components/request_bodies/__init__.py +src/petstore_api/components/request_bodies/request_body_client/__init__.py +src/petstore_api/components/request_bodies/request_body_client/content/__init__.py +src/petstore_api/components/request_bodies/request_body_client/content/application_json/__init__.py +src/petstore_api/components/request_bodies/request_body_client/content/application_json/schema.py +src/petstore_api/components/request_bodies/request_body_pet/__init__.py +src/petstore_api/components/request_bodies/request_body_pet/content/__init__.py +src/petstore_api/components/request_bodies/request_body_pet/content/application_json/__init__.py +src/petstore_api/components/request_bodies/request_body_pet/content/application_json/schema.py +src/petstore_api/components/request_bodies/request_body_pet/content/application_xml/__init__.py +src/petstore_api/components/request_bodies/request_body_pet/content/application_xml/schema.py +src/petstore_api/components/request_bodies/request_body_ref_user_array/__init__.py +src/petstore_api/components/request_bodies/request_body_user_array/__init__.py +src/petstore_api/components/request_bodies/request_body_user_array/content/__init__.py +src/petstore_api/components/request_bodies/request_body_user_array/content/application_json/__init__.py +src/petstore_api/components/request_bodies/request_body_user_array/content/application_json/schema.py +src/petstore_api/components/responses/__init__.py +src/petstore_api/components/responses/response_ref_success_description_only/__init__.py +src/petstore_api/components/responses/response_ref_successful_xml_and_json_array_of_pet/__init__.py +src/petstore_api/components/responses/response_success_description_only/__init__.py +src/petstore_api/components/responses/response_success_inline_content_and_header/__init__.py +src/petstore_api/components/responses/response_success_inline_content_and_header/content/__init__.py +src/petstore_api/components/responses/response_success_inline_content_and_header/content/application_json/__init__.py +src/petstore_api/components/responses/response_success_inline_content_and_header/content/application_json/schema.py +src/petstore_api/components/responses/response_success_inline_content_and_header/headers/__init__.py +src/petstore_api/components/responses/response_success_inline_content_and_header/headers/header_some_header/__init__.py +src/petstore_api/components/responses/response_success_inline_content_and_header/headers/header_some_header/schema.py +src/petstore_api/components/responses/response_success_with_json_api_response/__init__.py +src/petstore_api/components/responses/response_success_with_json_api_response/content/__init__.py +src/petstore_api/components/responses/response_success_with_json_api_response/content/application_json/__init__.py +src/petstore_api/components/responses/response_success_with_json_api_response/content/application_json/schema.py +src/petstore_api/components/responses/response_success_with_json_api_response/headers/__init__.py +src/petstore_api/components/responses/response_success_with_json_api_response/headers/header_int32/__init__.py +src/petstore_api/components/responses/response_success_with_json_api_response/headers/header_number_header/__init__.py +src/petstore_api/components/responses/response_success_with_json_api_response/headers/header_ref_content_schema_header/__init__.py +src/petstore_api/components/responses/response_success_with_json_api_response/headers/header_ref_schema_header/__init__.py +src/petstore_api/components/responses/response_success_with_json_api_response/headers/header_string_header/__init__.py +src/petstore_api/components/responses/response_successful_xml_and_json_array_of_pet/__init__.py +src/petstore_api/components/responses/response_successful_xml_and_json_array_of_pet/content/__init__.py +src/petstore_api/components/responses/response_successful_xml_and_json_array_of_pet/content/application_json/__init__.py +src/petstore_api/components/responses/response_successful_xml_and_json_array_of_pet/content/application_json/schema.py +src/petstore_api/components/responses/response_successful_xml_and_json_array_of_pet/content/application_xml/__init__.py +src/petstore_api/components/responses/response_successful_xml_and_json_array_of_pet/content/application_xml/schema.py +src/petstore_api/components/schema/_200_response.py +src/petstore_api/components/schema/__init__.py +src/petstore_api/components/schema/_return.py +src/petstore_api/components/schema/abstract_step_message.py +src/petstore_api/components/schema/additional_properties_class.py +src/petstore_api/components/schema/additional_properties_validator.py +src/petstore_api/components/schema/additional_properties_with_array_of_enums.py +src/petstore_api/components/schema/address.py +src/petstore_api/components/schema/animal.py +src/petstore_api/components/schema/animal_farm.py +src/petstore_api/components/schema/any_type_and_format.py +src/petstore_api/components/schema/any_type_not_string.py +src/petstore_api/components/schema/api_response.py +src/petstore_api/components/schema/apple.py +src/petstore_api/components/schema/apple_req.py +src/petstore_api/components/schema/array_holding_any_type.py +src/petstore_api/components/schema/array_of_array_of_number_only.py +src/petstore_api/components/schema/array_of_enums.py +src/petstore_api/components/schema/array_of_number_only.py +src/petstore_api/components/schema/array_test.py +src/petstore_api/components/schema/array_with_validations_in_items.py +src/petstore_api/components/schema/banana.py +src/petstore_api/components/schema/banana_req.py +src/petstore_api/components/schema/bar.py +src/petstore_api/components/schema/basque_pig.py +src/petstore_api/components/schema/boolean.py +src/petstore_api/components/schema/boolean_enum.py +src/petstore_api/components/schema/capitalization.py +src/petstore_api/components/schema/cat.py +src/petstore_api/components/schema/category.py +src/petstore_api/components/schema/child_cat.py +src/petstore_api/components/schema/class_model.py +src/petstore_api/components/schema/client.py +src/petstore_api/components/schema/complex_quadrilateral.py +src/petstore_api/components/schema/composed_any_of_different_types_no_validations.py +src/petstore_api/components/schema/composed_array.py +src/petstore_api/components/schema/composed_bool.py +src/petstore_api/components/schema/composed_none.py +src/petstore_api/components/schema/composed_number.py +src/petstore_api/components/schema/composed_object.py +src/petstore_api/components/schema/composed_one_of_different_types.py +src/petstore_api/components/schema/composed_string.py +src/petstore_api/components/schema/currency.py +src/petstore_api/components/schema/danish_pig.py +src/petstore_api/components/schema/date_time_test.py +src/petstore_api/components/schema/date_time_with_validations.py +src/petstore_api/components/schema/date_with_validations.py +src/petstore_api/components/schema/decimal_payload.py +src/petstore_api/components/schema/dog.py +src/petstore_api/components/schema/drawing.py +src/petstore_api/components/schema/enum_arrays.py +src/petstore_api/components/schema/enum_class.py +src/petstore_api/components/schema/enum_test.py +src/petstore_api/components/schema/equilateral_triangle.py +src/petstore_api/components/schema/file.py +src/petstore_api/components/schema/file_schema_test_class.py +src/petstore_api/components/schema/foo.py +src/petstore_api/components/schema/format_test.py +src/petstore_api/components/schema/from_schema.py +src/petstore_api/components/schema/fruit.py +src/petstore_api/components/schema/fruit_req.py +src/petstore_api/components/schema/gm_fruit.py +src/petstore_api/components/schema/grandparent_animal.py +src/petstore_api/components/schema/has_only_read_only.py +src/petstore_api/components/schema/health_check_result.py +src/petstore_api/components/schema/integer_enum.py +src/petstore_api/components/schema/integer_enum_big.py +src/petstore_api/components/schema/integer_enum_one_value.py +src/petstore_api/components/schema/integer_enum_with_default_value.py +src/petstore_api/components/schema/integer_max10.py +src/petstore_api/components/schema/integer_min15.py +src/petstore_api/components/schema/isosceles_triangle.py +src/petstore_api/components/schema/items.py +src/petstore_api/components/schema/json_patch_request.py +src/petstore_api/components/schema/json_patch_request_add_replace_test.py +src/petstore_api/components/schema/json_patch_request_move_copy.py +src/petstore_api/components/schema/json_patch_request_remove.py +src/petstore_api/components/schema/mammal.py +src/petstore_api/components/schema/map_test.py +src/petstore_api/components/schema/mixed_properties_and_additional_properties_class.py +src/petstore_api/components/schema/money.py +src/petstore_api/components/schema/name.py +src/petstore_api/components/schema/no_additional_properties.py +src/petstore_api/components/schema/nullable_class.py +src/petstore_api/components/schema/nullable_shape.py +src/petstore_api/components/schema/nullable_string.py +src/petstore_api/components/schema/number.py +src/petstore_api/components/schema/number_only.py +src/petstore_api/components/schema/number_with_validations.py +src/petstore_api/components/schema/object_interface.py +src/petstore_api/components/schema/object_model_with_arg_and_args_properties.py +src/petstore_api/components/schema/object_model_with_ref_props.py +src/petstore_api/components/schema/object_with_all_of_with_req_test_prop_from_unset_add_prop.py +src/petstore_api/components/schema/object_with_colliding_properties.py +src/petstore_api/components/schema/object_with_decimal_properties.py +src/petstore_api/components/schema/object_with_difficultly_named_props.py +src/petstore_api/components/schema/object_with_inline_composition_property.py +src/petstore_api/components/schema/object_with_invalid_named_refed_properties.py +src/petstore_api/components/schema/object_with_optional_test_prop.py +src/petstore_api/components/schema/object_with_validations.py +src/petstore_api/components/schema/order.py +src/petstore_api/components/schema/parent_pet.py +src/petstore_api/components/schema/pet.py +src/petstore_api/components/schema/pig.py +src/petstore_api/components/schema/player.py +src/petstore_api/components/schema/quadrilateral.py +src/petstore_api/components/schema/quadrilateral_interface.py +src/petstore_api/components/schema/read_only_first.py +src/petstore_api/components/schema/ref_pet.py +src/petstore_api/components/schema/req_props_from_explicit_add_props.py +src/petstore_api/components/schema/req_props_from_true_add_props.py +src/petstore_api/components/schema/req_props_from_unset_add_props.py +src/petstore_api/components/schema/scalene_triangle.py +src/petstore_api/components/schema/self_referencing_array_model.py +src/petstore_api/components/schema/self_referencing_object_model.py +src/petstore_api/components/schema/shape.py +src/petstore_api/components/schema/shape_or_null.py +src/petstore_api/components/schema/simple_quadrilateral.py +src/petstore_api/components/schema/some_object.py +src/petstore_api/components/schema/special_model_name.py +src/petstore_api/components/schema/string.py +src/petstore_api/components/schema/string_boolean_map.py +src/petstore_api/components/schema/string_enum.py +src/petstore_api/components/schema/string_enum_with_default_value.py +src/petstore_api/components/schema/string_with_validation.py +src/petstore_api/components/schema/tag.py +src/petstore_api/components/schema/triangle.py +src/petstore_api/components/schema/triangle_interface.py +src/petstore_api/components/schema/user.py +src/petstore_api/components/schema/uuid_string.py +src/petstore_api/components/schema/whale.py +src/petstore_api/components/schema/zebra.py +src/petstore_api/components/schemas/__init__.py +src/petstore_api/components/security_schemes/__init__.py +src/petstore_api/components/security_schemes/security_scheme_api_key.py +src/petstore_api/components/security_schemes/security_scheme_api_key_query.py +src/petstore_api/components/security_schemes/security_scheme_bearer_test.py +src/petstore_api/components/security_schemes/security_scheme_http_basic_test.py +src/petstore_api/components/security_schemes/security_scheme_http_signature_test.py +src/petstore_api/components/security_schemes/security_scheme_open_id_connect_test.py +src/petstore_api/components/security_schemes/security_scheme_petstore_auth.py +src/petstore_api/configurations/__init__.py +src/petstore_api/configurations/api_configuration.py +src/petstore_api/configurations/schema_configuration.py +src/petstore_api/exceptions.py +src/petstore_api/paths/__init__.py +src/petstore_api/paths/another_fake_dummy/__init__.py +src/petstore_api/paths/another_fake_dummy/patch/__init__.py +src/petstore_api/paths/another_fake_dummy/patch/operation.py +src/petstore_api/paths/another_fake_dummy/patch/request_body/__init__.py +src/petstore_api/paths/another_fake_dummy/patch/responses/__init__.py +src/petstore_api/paths/another_fake_dummy/patch/responses/response_200/__init__.py +src/petstore_api/paths/another_fake_dummy/patch/responses/response_200/content/__init__.py +src/petstore_api/paths/another_fake_dummy/patch/responses/response_200/content/application_json/__init__.py +src/petstore_api/paths/another_fake_dummy/patch/responses/response_200/content/application_json/schema.py +src/petstore_api/paths/fake/__init__.py +src/petstore_api/paths/fake/delete/__init__.py +src/petstore_api/paths/fake/delete/operation.py +src/petstore_api/paths/fake/delete/parameters/__init__.py +src/petstore_api/paths/fake/delete/parameters/parameter_0/__init__.py +src/petstore_api/paths/fake/delete/parameters/parameter_0/schema.py +src/petstore_api/paths/fake/delete/parameters/parameter_1/__init__.py +src/petstore_api/paths/fake/delete/parameters/parameter_1/schema.py +src/petstore_api/paths/fake/delete/parameters/parameter_2/__init__.py +src/petstore_api/paths/fake/delete/parameters/parameter_2/schema.py +src/petstore_api/paths/fake/delete/parameters/parameter_3/__init__.py +src/petstore_api/paths/fake/delete/parameters/parameter_3/schema.py +src/petstore_api/paths/fake/delete/parameters/parameter_4/__init__.py +src/petstore_api/paths/fake/delete/parameters/parameter_4/schema.py +src/petstore_api/paths/fake/delete/parameters/parameter_5/__init__.py +src/petstore_api/paths/fake/delete/parameters/parameter_5/schema.py +src/petstore_api/paths/fake/delete/responses/__init__.py +src/petstore_api/paths/fake/delete/responses/response_200/__init__.py +src/petstore_api/paths/fake/delete/security/__init__.py +src/petstore_api/paths/fake/delete/security/security_requirement_object_0.py +src/petstore_api/paths/fake/get/__init__.py +src/petstore_api/paths/fake/get/operation.py +src/petstore_api/paths/fake/get/parameters/__init__.py +src/petstore_api/paths/fake/get/parameters/parameter_0/__init__.py +src/petstore_api/paths/fake/get/parameters/parameter_0/schema.py +src/petstore_api/paths/fake/get/parameters/parameter_1/__init__.py +src/petstore_api/paths/fake/get/parameters/parameter_1/schema.py +src/petstore_api/paths/fake/get/parameters/parameter_2/__init__.py +src/petstore_api/paths/fake/get/parameters/parameter_2/schema.py +src/petstore_api/paths/fake/get/parameters/parameter_3/__init__.py +src/petstore_api/paths/fake/get/parameters/parameter_3/schema.py +src/petstore_api/paths/fake/get/parameters/parameter_4/__init__.py +src/petstore_api/paths/fake/get/parameters/parameter_4/schema.py +src/petstore_api/paths/fake/get/parameters/parameter_5/__init__.py +src/petstore_api/paths/fake/get/parameters/parameter_5/schema.py +src/petstore_api/paths/fake/get/request_body/__init__.py +src/petstore_api/paths/fake/get/request_body/content/__init__.py +src/petstore_api/paths/fake/get/request_body/content/application_x_www_form_urlencoded/__init__.py +src/petstore_api/paths/fake/get/request_body/content/application_x_www_form_urlencoded/schema.py +src/petstore_api/paths/fake/get/responses/__init__.py +src/petstore_api/paths/fake/get/responses/response_200/__init__.py +src/petstore_api/paths/fake/get/responses/response_404/__init__.py +src/petstore_api/paths/fake/get/responses/response_404/content/__init__.py +src/petstore_api/paths/fake/get/responses/response_404/content/application_json/__init__.py +src/petstore_api/paths/fake/get/responses/response_404/content/application_json/schema.py +src/petstore_api/paths/fake/patch/__init__.py +src/petstore_api/paths/fake/patch/operation.py +src/petstore_api/paths/fake/patch/request_body/__init__.py +src/petstore_api/paths/fake/patch/responses/__init__.py +src/petstore_api/paths/fake/patch/responses/response_200/__init__.py +src/petstore_api/paths/fake/patch/responses/response_200/content/__init__.py +src/petstore_api/paths/fake/patch/responses/response_200/content/application_json/__init__.py +src/petstore_api/paths/fake/patch/responses/response_200/content/application_json/schema.py +src/petstore_api/paths/fake/post/__init__.py +src/petstore_api/paths/fake/post/operation.py +src/petstore_api/paths/fake/post/request_body/__init__.py +src/petstore_api/paths/fake/post/request_body/content/__init__.py +src/petstore_api/paths/fake/post/request_body/content/application_x_www_form_urlencoded/__init__.py +src/petstore_api/paths/fake/post/request_body/content/application_x_www_form_urlencoded/schema.py +src/petstore_api/paths/fake/post/responses/__init__.py +src/petstore_api/paths/fake/post/responses/response_200/__init__.py +src/petstore_api/paths/fake/post/responses/response_404/__init__.py +src/petstore_api/paths/fake/post/security/__init__.py +src/petstore_api/paths/fake/post/security/security_requirement_object_0.py +src/petstore_api/paths/fake_additional_properties_with_array_of_enums/__init__.py +src/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/__init__.py +src/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/operation.py +src/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/request_body/__init__.py +src/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/request_body/content/__init__.py +src/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/request_body/content/application_json/__init__.py +src/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/request_body/content/application_json/schema.py +src/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/responses/__init__.py +src/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/responses/response_200/__init__.py +src/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/responses/response_200/content/__init__.py +src/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/responses/response_200/content/application_json/__init__.py +src/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/responses/response_200/content/application_json/schema.py +src/petstore_api/paths/fake_body_with_file_schema/__init__.py +src/petstore_api/paths/fake_body_with_file_schema/put/__init__.py +src/petstore_api/paths/fake_body_with_file_schema/put/operation.py +src/petstore_api/paths/fake_body_with_file_schema/put/request_body/__init__.py +src/petstore_api/paths/fake_body_with_file_schema/put/request_body/content/__init__.py +src/petstore_api/paths/fake_body_with_file_schema/put/request_body/content/application_json/__init__.py +src/petstore_api/paths/fake_body_with_file_schema/put/request_body/content/application_json/schema.py +src/petstore_api/paths/fake_body_with_file_schema/put/responses/__init__.py +src/petstore_api/paths/fake_body_with_file_schema/put/responses/response_200/__init__.py +src/petstore_api/paths/fake_body_with_query_params/__init__.py +src/petstore_api/paths/fake_body_with_query_params/put/__init__.py +src/petstore_api/paths/fake_body_with_query_params/put/operation.py +src/petstore_api/paths/fake_body_with_query_params/put/parameters/__init__.py +src/petstore_api/paths/fake_body_with_query_params/put/parameters/parameter_0/__init__.py +src/petstore_api/paths/fake_body_with_query_params/put/parameters/parameter_0/schema.py +src/petstore_api/paths/fake_body_with_query_params/put/request_body/__init__.py +src/petstore_api/paths/fake_body_with_query_params/put/request_body/content/__init__.py +src/petstore_api/paths/fake_body_with_query_params/put/request_body/content/application_json/__init__.py +src/petstore_api/paths/fake_body_with_query_params/put/request_body/content/application_json/schema.py +src/petstore_api/paths/fake_body_with_query_params/put/responses/__init__.py +src/petstore_api/paths/fake_body_with_query_params/put/responses/response_200/__init__.py +src/petstore_api/paths/fake_case_sensitive_params/__init__.py +src/petstore_api/paths/fake_case_sensitive_params/put/__init__.py +src/petstore_api/paths/fake_case_sensitive_params/put/operation.py +src/petstore_api/paths/fake_case_sensitive_params/put/parameters/__init__.py +src/petstore_api/paths/fake_case_sensitive_params/put/parameters/parameter_0/__init__.py +src/petstore_api/paths/fake_case_sensitive_params/put/parameters/parameter_0/schema.py +src/petstore_api/paths/fake_case_sensitive_params/put/parameters/parameter_1/__init__.py +src/petstore_api/paths/fake_case_sensitive_params/put/parameters/parameter_1/schema.py +src/petstore_api/paths/fake_case_sensitive_params/put/parameters/parameter_2/__init__.py +src/petstore_api/paths/fake_case_sensitive_params/put/parameters/parameter_2/schema.py +src/petstore_api/paths/fake_case_sensitive_params/put/responses/__init__.py +src/petstore_api/paths/fake_case_sensitive_params/put/responses/response_200/__init__.py +src/petstore_api/paths/fake_classname_test/__init__.py +src/petstore_api/paths/fake_classname_test/patch/__init__.py +src/petstore_api/paths/fake_classname_test/patch/operation.py +src/petstore_api/paths/fake_classname_test/patch/request_body/__init__.py +src/petstore_api/paths/fake_classname_test/patch/responses/__init__.py +src/petstore_api/paths/fake_classname_test/patch/responses/response_200/__init__.py +src/petstore_api/paths/fake_classname_test/patch/responses/response_200/content/__init__.py +src/petstore_api/paths/fake_classname_test/patch/responses/response_200/content/application_json/__init__.py +src/petstore_api/paths/fake_classname_test/patch/responses/response_200/content/application_json/schema.py +src/petstore_api/paths/fake_classname_test/patch/security/__init__.py +src/petstore_api/paths/fake_classname_test/patch/security/security_requirement_object_0.py +src/petstore_api/paths/fake_delete_coffee_id/__init__.py +src/petstore_api/paths/fake_delete_coffee_id/delete/__init__.py +src/petstore_api/paths/fake_delete_coffee_id/delete/operation.py +src/petstore_api/paths/fake_delete_coffee_id/delete/parameters/__init__.py +src/petstore_api/paths/fake_delete_coffee_id/delete/parameters/parameter_0/__init__.py +src/petstore_api/paths/fake_delete_coffee_id/delete/parameters/parameter_0/schema.py +src/petstore_api/paths/fake_delete_coffee_id/delete/responses/__init__.py +src/petstore_api/paths/fake_delete_coffee_id/delete/responses/response_200/__init__.py +src/petstore_api/paths/fake_delete_coffee_id/delete/responses/response_default/__init__.py +src/petstore_api/paths/fake_health/__init__.py +src/petstore_api/paths/fake_health/get/__init__.py +src/petstore_api/paths/fake_health/get/operation.py +src/petstore_api/paths/fake_health/get/responses/__init__.py +src/petstore_api/paths/fake_health/get/responses/response_200/__init__.py +src/petstore_api/paths/fake_health/get/responses/response_200/content/__init__.py +src/petstore_api/paths/fake_health/get/responses/response_200/content/application_json/__init__.py +src/petstore_api/paths/fake_health/get/responses/response_200/content/application_json/schema.py +src/petstore_api/paths/fake_inline_additional_properties/__init__.py +src/petstore_api/paths/fake_inline_additional_properties/post/__init__.py +src/petstore_api/paths/fake_inline_additional_properties/post/operation.py +src/petstore_api/paths/fake_inline_additional_properties/post/request_body/__init__.py +src/petstore_api/paths/fake_inline_additional_properties/post/request_body/content/__init__.py +src/petstore_api/paths/fake_inline_additional_properties/post/request_body/content/application_json/__init__.py +src/petstore_api/paths/fake_inline_additional_properties/post/request_body/content/application_json/schema.py +src/petstore_api/paths/fake_inline_additional_properties/post/responses/__init__.py +src/petstore_api/paths/fake_inline_additional_properties/post/responses/response_200/__init__.py +src/petstore_api/paths/fake_inline_composition/__init__.py +src/petstore_api/paths/fake_inline_composition/post/__init__.py +src/petstore_api/paths/fake_inline_composition/post/operation.py +src/petstore_api/paths/fake_inline_composition/post/parameters/__init__.py +src/petstore_api/paths/fake_inline_composition/post/parameters/parameter_0/__init__.py +src/petstore_api/paths/fake_inline_composition/post/parameters/parameter_0/schema.py +src/petstore_api/paths/fake_inline_composition/post/parameters/parameter_1/__init__.py +src/petstore_api/paths/fake_inline_composition/post/parameters/parameter_1/schema.py +src/petstore_api/paths/fake_inline_composition/post/request_body/__init__.py +src/petstore_api/paths/fake_inline_composition/post/request_body/content/__init__.py +src/petstore_api/paths/fake_inline_composition/post/request_body/content/application_json/__init__.py +src/petstore_api/paths/fake_inline_composition/post/request_body/content/application_json/schema.py +src/petstore_api/paths/fake_inline_composition/post/request_body/content/multipart_form_data/__init__.py +src/petstore_api/paths/fake_inline_composition/post/request_body/content/multipart_form_data/schema.py +src/petstore_api/paths/fake_inline_composition/post/responses/__init__.py +src/petstore_api/paths/fake_inline_composition/post/responses/response_200/__init__.py +src/petstore_api/paths/fake_inline_composition/post/responses/response_200/content/__init__.py +src/petstore_api/paths/fake_inline_composition/post/responses/response_200/content/application_json/__init__.py +src/petstore_api/paths/fake_inline_composition/post/responses/response_200/content/application_json/schema.py +src/petstore_api/paths/fake_inline_composition/post/responses/response_200/content/multipart_form_data/__init__.py +src/petstore_api/paths/fake_inline_composition/post/responses/response_200/content/multipart_form_data/schema.py +src/petstore_api/paths/fake_json_form_data/__init__.py +src/petstore_api/paths/fake_json_form_data/get/__init__.py +src/petstore_api/paths/fake_json_form_data/get/operation.py +src/petstore_api/paths/fake_json_form_data/get/request_body/__init__.py +src/petstore_api/paths/fake_json_form_data/get/request_body/content/__init__.py +src/petstore_api/paths/fake_json_form_data/get/request_body/content/application_x_www_form_urlencoded/__init__.py +src/petstore_api/paths/fake_json_form_data/get/request_body/content/application_x_www_form_urlencoded/schema.py +src/petstore_api/paths/fake_json_form_data/get/responses/__init__.py +src/petstore_api/paths/fake_json_form_data/get/responses/response_200/__init__.py +src/petstore_api/paths/fake_json_patch/__init__.py +src/petstore_api/paths/fake_json_patch/patch/__init__.py +src/petstore_api/paths/fake_json_patch/patch/operation.py +src/petstore_api/paths/fake_json_patch/patch/request_body/__init__.py +src/petstore_api/paths/fake_json_patch/patch/request_body/content/__init__.py +src/petstore_api/paths/fake_json_patch/patch/request_body/content/application_json_patchjson/__init__.py +src/petstore_api/paths/fake_json_patch/patch/request_body/content/application_json_patchjson/schema.py +src/petstore_api/paths/fake_json_patch/patch/responses/__init__.py +src/petstore_api/paths/fake_json_patch/patch/responses/response_200/__init__.py +src/petstore_api/paths/fake_json_with_charset/__init__.py +src/petstore_api/paths/fake_json_with_charset/post/__init__.py +src/petstore_api/paths/fake_json_with_charset/post/operation.py +src/petstore_api/paths/fake_json_with_charset/post/request_body/__init__.py +src/petstore_api/paths/fake_json_with_charset/post/request_body/content/__init__.py +src/petstore_api/paths/fake_json_with_charset/post/request_body/content/application_json_charsetutf8/__init__.py +src/petstore_api/paths/fake_json_with_charset/post/request_body/content/application_json_charsetutf8/schema.py +src/petstore_api/paths/fake_json_with_charset/post/responses/__init__.py +src/petstore_api/paths/fake_json_with_charset/post/responses/response_200/__init__.py +src/petstore_api/paths/fake_json_with_charset/post/responses/response_200/content/__init__.py +src/petstore_api/paths/fake_json_with_charset/post/responses/response_200/content/application_json_charsetutf8/__init__.py +src/petstore_api/paths/fake_json_with_charset/post/responses/response_200/content/application_json_charsetutf8/schema.py +src/petstore_api/paths/fake_multiple_response_bodies/__init__.py +src/petstore_api/paths/fake_multiple_response_bodies/get/__init__.py +src/petstore_api/paths/fake_multiple_response_bodies/get/operation.py +src/petstore_api/paths/fake_multiple_response_bodies/get/responses/__init__.py +src/petstore_api/paths/fake_multiple_response_bodies/get/responses/response_200/__init__.py +src/petstore_api/paths/fake_multiple_response_bodies/get/responses/response_200/content/__init__.py +src/petstore_api/paths/fake_multiple_response_bodies/get/responses/response_200/content/application_json/__init__.py +src/petstore_api/paths/fake_multiple_response_bodies/get/responses/response_200/content/application_json/schema.py +src/petstore_api/paths/fake_multiple_response_bodies/get/responses/response_202/__init__.py +src/petstore_api/paths/fake_multiple_response_bodies/get/responses/response_202/content/__init__.py +src/petstore_api/paths/fake_multiple_response_bodies/get/responses/response_202/content/application_json/__init__.py +src/petstore_api/paths/fake_multiple_response_bodies/get/responses/response_202/content/application_json/schema.py +src/petstore_api/paths/fake_multiple_securities/__init__.py +src/petstore_api/paths/fake_multiple_securities/get/__init__.py +src/petstore_api/paths/fake_multiple_securities/get/operation.py +src/petstore_api/paths/fake_multiple_securities/get/responses/__init__.py +src/petstore_api/paths/fake_multiple_securities/get/responses/response_200/__init__.py +src/petstore_api/paths/fake_multiple_securities/get/responses/response_200/content/__init__.py +src/petstore_api/paths/fake_multiple_securities/get/responses/response_200/content/application_json/__init__.py +src/petstore_api/paths/fake_multiple_securities/get/responses/response_200/content/application_json/schema.py +src/petstore_api/paths/fake_multiple_securities/get/security/__init__.py +src/petstore_api/paths/fake_multiple_securities/get/security/security_requirement_object_0.py +src/petstore_api/paths/fake_multiple_securities/get/security/security_requirement_object_1.py +src/petstore_api/paths/fake_multiple_securities/get/security/security_requirement_object_2.py +src/petstore_api/paths/fake_obj_in_query/__init__.py +src/petstore_api/paths/fake_obj_in_query/get/__init__.py +src/petstore_api/paths/fake_obj_in_query/get/operation.py +src/petstore_api/paths/fake_obj_in_query/get/parameters/__init__.py +src/petstore_api/paths/fake_obj_in_query/get/parameters/parameter_0/__init__.py +src/petstore_api/paths/fake_obj_in_query/get/parameters/parameter_0/schema.py +src/petstore_api/paths/fake_obj_in_query/get/responses/__init__.py +src/petstore_api/paths/fake_obj_in_query/get/responses/response_200/__init__.py +src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/__init__.py +src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/__init__.py +src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/operation.py +src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/__init__.py +src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_0/__init__.py +src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_0/schema.py +src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_1/__init__.py +src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_1/schema.py +src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_10/__init__.py +src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_10/schema.py +src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_11/__init__.py +src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_11/schema.py +src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_12/__init__.py +src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_12/schema.py +src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_13/__init__.py +src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_13/schema.py +src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_14/__init__.py +src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_14/schema.py +src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_15/__init__.py +src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_15/schema.py +src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_16/__init__.py +src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_16/schema.py +src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_17/__init__.py +src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_17/schema.py +src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_18/__init__.py +src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_18/schema.py +src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_2/__init__.py +src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_2/schema.py +src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_3/__init__.py +src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_3/schema.py +src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_4/__init__.py +src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_4/schema.py +src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_5/__init__.py +src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_5/schema.py +src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_6/__init__.py +src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_6/schema.py +src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_7/__init__.py +src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_7/schema.py +src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_8/__init__.py +src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_8/schema.py +src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_9/__init__.py +src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_9/schema.py +src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/request_body/__init__.py +src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/request_body/content/__init__.py +src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/request_body/content/application_json/__init__.py +src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/request_body/content/application_json/schema.py +src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/responses/__init__.py +src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/responses/response_200/__init__.py +src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/responses/response_200/content/__init__.py +src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/responses/response_200/content/application_json/__init__.py +src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/responses/response_200/content/application_json/schema.py +src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/__init__.py +src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/__init__.py +src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/operation.py +src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/parameters/__init__.py +src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/parameters/parameter_0/__init__.py +src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/parameters/parameter_0/schema.py +src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/request_body/__init__.py +src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/request_body/content/__init__.py +src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/request_body/content/multipart_form_data/__init__.py +src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/request_body/content/multipart_form_data/schema.py +src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/responses/__init__.py +src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/responses/response_200/__init__.py +src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/responses/response_200/content/__init__.py +src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/responses/response_200/content/application_json/__init__.py +src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/responses/response_200/content/application_json/schema.py +src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/security/__init__.py +src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/security/security_requirement_object_0.py +src/petstore_api/paths/fake_query_param_with_json_content_type/__init__.py +src/petstore_api/paths/fake_query_param_with_json_content_type/get/__init__.py +src/petstore_api/paths/fake_query_param_with_json_content_type/get/operation.py +src/petstore_api/paths/fake_query_param_with_json_content_type/get/parameters/__init__.py +src/petstore_api/paths/fake_query_param_with_json_content_type/get/parameters/parameter_0/__init__.py +src/petstore_api/paths/fake_query_param_with_json_content_type/get/parameters/parameter_0/content/__init__.py +src/petstore_api/paths/fake_query_param_with_json_content_type/get/parameters/parameter_0/content/application_json/__init__.py +src/petstore_api/paths/fake_query_param_with_json_content_type/get/parameters/parameter_0/content/application_json/schema.py +src/petstore_api/paths/fake_query_param_with_json_content_type/get/responses/__init__.py +src/petstore_api/paths/fake_query_param_with_json_content_type/get/responses/response_200/__init__.py +src/petstore_api/paths/fake_query_param_with_json_content_type/get/responses/response_200/content/__init__.py +src/petstore_api/paths/fake_query_param_with_json_content_type/get/responses/response_200/content/application_json/__init__.py +src/petstore_api/paths/fake_query_param_with_json_content_type/get/responses/response_200/content/application_json/schema.py +src/petstore_api/paths/fake_redirection/__init__.py +src/petstore_api/paths/fake_redirection/get/__init__.py +src/petstore_api/paths/fake_redirection/get/operation.py +src/petstore_api/paths/fake_redirection/get/responses/__init__.py +src/petstore_api/paths/fake_redirection/get/responses/response_303/__init__.py +src/petstore_api/paths/fake_redirection/get/responses/response_3xx/__init__.py +src/petstore_api/paths/fake_ref_obj_in_query/__init__.py +src/petstore_api/paths/fake_ref_obj_in_query/get/__init__.py +src/petstore_api/paths/fake_ref_obj_in_query/get/operation.py +src/petstore_api/paths/fake_ref_obj_in_query/get/parameters/__init__.py +src/petstore_api/paths/fake_ref_obj_in_query/get/parameters/parameter_0/__init__.py +src/petstore_api/paths/fake_ref_obj_in_query/get/parameters/parameter_0/schema.py +src/petstore_api/paths/fake_ref_obj_in_query/get/responses/__init__.py +src/petstore_api/paths/fake_ref_obj_in_query/get/responses/response_200/__init__.py +src/petstore_api/paths/fake_refs_array_of_enums/__init__.py +src/petstore_api/paths/fake_refs_array_of_enums/post/__init__.py +src/petstore_api/paths/fake_refs_array_of_enums/post/operation.py +src/petstore_api/paths/fake_refs_array_of_enums/post/request_body/__init__.py +src/petstore_api/paths/fake_refs_array_of_enums/post/request_body/content/__init__.py +src/petstore_api/paths/fake_refs_array_of_enums/post/request_body/content/application_json/__init__.py +src/petstore_api/paths/fake_refs_array_of_enums/post/request_body/content/application_json/schema.py +src/petstore_api/paths/fake_refs_array_of_enums/post/responses/__init__.py +src/petstore_api/paths/fake_refs_array_of_enums/post/responses/response_200/__init__.py +src/petstore_api/paths/fake_refs_array_of_enums/post/responses/response_200/content/__init__.py +src/petstore_api/paths/fake_refs_array_of_enums/post/responses/response_200/content/application_json/__init__.py +src/petstore_api/paths/fake_refs_array_of_enums/post/responses/response_200/content/application_json/schema.py +src/petstore_api/paths/fake_refs_arraymodel/__init__.py +src/petstore_api/paths/fake_refs_arraymodel/post/__init__.py +src/petstore_api/paths/fake_refs_arraymodel/post/operation.py +src/petstore_api/paths/fake_refs_arraymodel/post/request_body/__init__.py +src/petstore_api/paths/fake_refs_arraymodel/post/request_body/content/__init__.py +src/petstore_api/paths/fake_refs_arraymodel/post/request_body/content/application_json/__init__.py +src/petstore_api/paths/fake_refs_arraymodel/post/request_body/content/application_json/schema.py +src/petstore_api/paths/fake_refs_arraymodel/post/responses/__init__.py +src/petstore_api/paths/fake_refs_arraymodel/post/responses/response_200/__init__.py +src/petstore_api/paths/fake_refs_arraymodel/post/responses/response_200/content/__init__.py +src/petstore_api/paths/fake_refs_arraymodel/post/responses/response_200/content/application_json/__init__.py +src/petstore_api/paths/fake_refs_arraymodel/post/responses/response_200/content/application_json/schema.py +src/petstore_api/paths/fake_refs_boolean/__init__.py +src/petstore_api/paths/fake_refs_boolean/post/__init__.py +src/petstore_api/paths/fake_refs_boolean/post/operation.py +src/petstore_api/paths/fake_refs_boolean/post/request_body/__init__.py +src/petstore_api/paths/fake_refs_boolean/post/request_body/content/__init__.py +src/petstore_api/paths/fake_refs_boolean/post/request_body/content/application_json/__init__.py +src/petstore_api/paths/fake_refs_boolean/post/request_body/content/application_json/schema.py +src/petstore_api/paths/fake_refs_boolean/post/responses/__init__.py +src/petstore_api/paths/fake_refs_boolean/post/responses/response_200/__init__.py +src/petstore_api/paths/fake_refs_boolean/post/responses/response_200/content/__init__.py +src/petstore_api/paths/fake_refs_boolean/post/responses/response_200/content/application_json/__init__.py +src/petstore_api/paths/fake_refs_boolean/post/responses/response_200/content/application_json/schema.py +src/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/__init__.py +src/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/__init__.py +src/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/operation.py +src/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/request_body/__init__.py +src/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/request_body/content/__init__.py +src/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/request_body/content/application_json/__init__.py +src/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/request_body/content/application_json/schema.py +src/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/responses/__init__.py +src/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/responses/response_200/__init__.py +src/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/responses/response_200/content/__init__.py +src/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/responses/response_200/content/application_json/__init__.py +src/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/responses/response_200/content/application_json/schema.py +src/petstore_api/paths/fake_refs_enum/__init__.py +src/petstore_api/paths/fake_refs_enum/post/__init__.py +src/petstore_api/paths/fake_refs_enum/post/operation.py +src/petstore_api/paths/fake_refs_enum/post/request_body/__init__.py +src/petstore_api/paths/fake_refs_enum/post/request_body/content/__init__.py +src/petstore_api/paths/fake_refs_enum/post/request_body/content/application_json/__init__.py +src/petstore_api/paths/fake_refs_enum/post/request_body/content/application_json/schema.py +src/petstore_api/paths/fake_refs_enum/post/responses/__init__.py +src/petstore_api/paths/fake_refs_enum/post/responses/response_200/__init__.py +src/petstore_api/paths/fake_refs_enum/post/responses/response_200/content/__init__.py +src/petstore_api/paths/fake_refs_enum/post/responses/response_200/content/application_json/__init__.py +src/petstore_api/paths/fake_refs_enum/post/responses/response_200/content/application_json/schema.py +src/petstore_api/paths/fake_refs_mammal/__init__.py +src/petstore_api/paths/fake_refs_mammal/post/__init__.py +src/petstore_api/paths/fake_refs_mammal/post/operation.py +src/petstore_api/paths/fake_refs_mammal/post/request_body/__init__.py +src/petstore_api/paths/fake_refs_mammal/post/request_body/content/__init__.py +src/petstore_api/paths/fake_refs_mammal/post/request_body/content/application_json/__init__.py +src/petstore_api/paths/fake_refs_mammal/post/request_body/content/application_json/schema.py +src/petstore_api/paths/fake_refs_mammal/post/responses/__init__.py +src/petstore_api/paths/fake_refs_mammal/post/responses/response_200/__init__.py +src/petstore_api/paths/fake_refs_mammal/post/responses/response_200/content/__init__.py +src/petstore_api/paths/fake_refs_mammal/post/responses/response_200/content/application_json/__init__.py +src/petstore_api/paths/fake_refs_mammal/post/responses/response_200/content/application_json/schema.py +src/petstore_api/paths/fake_refs_number/__init__.py +src/petstore_api/paths/fake_refs_number/post/__init__.py +src/petstore_api/paths/fake_refs_number/post/operation.py +src/petstore_api/paths/fake_refs_number/post/request_body/__init__.py +src/petstore_api/paths/fake_refs_number/post/request_body/content/__init__.py +src/petstore_api/paths/fake_refs_number/post/request_body/content/application_json/__init__.py +src/petstore_api/paths/fake_refs_number/post/request_body/content/application_json/schema.py +src/petstore_api/paths/fake_refs_number/post/responses/__init__.py +src/petstore_api/paths/fake_refs_number/post/responses/response_200/__init__.py +src/petstore_api/paths/fake_refs_number/post/responses/response_200/content/__init__.py +src/petstore_api/paths/fake_refs_number/post/responses/response_200/content/application_json/__init__.py +src/petstore_api/paths/fake_refs_number/post/responses/response_200/content/application_json/schema.py +src/petstore_api/paths/fake_refs_object_model_with_ref_props/__init__.py +src/petstore_api/paths/fake_refs_object_model_with_ref_props/post/__init__.py +src/petstore_api/paths/fake_refs_object_model_with_ref_props/post/operation.py +src/petstore_api/paths/fake_refs_object_model_with_ref_props/post/request_body/__init__.py +src/petstore_api/paths/fake_refs_object_model_with_ref_props/post/request_body/content/__init__.py +src/petstore_api/paths/fake_refs_object_model_with_ref_props/post/request_body/content/application_json/__init__.py +src/petstore_api/paths/fake_refs_object_model_with_ref_props/post/request_body/content/application_json/schema.py +src/petstore_api/paths/fake_refs_object_model_with_ref_props/post/responses/__init__.py +src/petstore_api/paths/fake_refs_object_model_with_ref_props/post/responses/response_200/__init__.py +src/petstore_api/paths/fake_refs_object_model_with_ref_props/post/responses/response_200/content/__init__.py +src/petstore_api/paths/fake_refs_object_model_with_ref_props/post/responses/response_200/content/application_json/__init__.py +src/petstore_api/paths/fake_refs_object_model_with_ref_props/post/responses/response_200/content/application_json/schema.py +src/petstore_api/paths/fake_refs_string/__init__.py +src/petstore_api/paths/fake_refs_string/post/__init__.py +src/petstore_api/paths/fake_refs_string/post/operation.py +src/petstore_api/paths/fake_refs_string/post/request_body/__init__.py +src/petstore_api/paths/fake_refs_string/post/request_body/content/__init__.py +src/petstore_api/paths/fake_refs_string/post/request_body/content/application_json/__init__.py +src/petstore_api/paths/fake_refs_string/post/request_body/content/application_json/schema.py +src/petstore_api/paths/fake_refs_string/post/responses/__init__.py +src/petstore_api/paths/fake_refs_string/post/responses/response_200/__init__.py +src/petstore_api/paths/fake_refs_string/post/responses/response_200/content/__init__.py +src/petstore_api/paths/fake_refs_string/post/responses/response_200/content/application_json/__init__.py +src/petstore_api/paths/fake_refs_string/post/responses/response_200/content/application_json/schema.py +src/petstore_api/paths/fake_response_without_schema/__init__.py +src/petstore_api/paths/fake_response_without_schema/get/__init__.py +src/petstore_api/paths/fake_response_without_schema/get/operation.py +src/petstore_api/paths/fake_response_without_schema/get/responses/__init__.py +src/petstore_api/paths/fake_response_without_schema/get/responses/response_200/__init__.py +src/petstore_api/paths/fake_test_query_paramters/__init__.py +src/petstore_api/paths/fake_test_query_paramters/put/__init__.py +src/petstore_api/paths/fake_test_query_paramters/put/operation.py +src/petstore_api/paths/fake_test_query_paramters/put/parameters/__init__.py +src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_0/__init__.py +src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_0/schema.py +src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_1/__init__.py +src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_1/schema.py +src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_2/__init__.py +src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_2/schema.py +src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_3/__init__.py +src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_3/schema.py +src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_4/__init__.py +src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_4/schema.py +src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_5/__init__.py +src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_5/schema.py +src/petstore_api/paths/fake_test_query_paramters/put/responses/__init__.py +src/petstore_api/paths/fake_test_query_paramters/put/responses/response_200/__init__.py +src/petstore_api/paths/fake_upload_download_file/__init__.py +src/petstore_api/paths/fake_upload_download_file/post/__init__.py +src/petstore_api/paths/fake_upload_download_file/post/operation.py +src/petstore_api/paths/fake_upload_download_file/post/request_body/__init__.py +src/petstore_api/paths/fake_upload_download_file/post/request_body/content/__init__.py +src/petstore_api/paths/fake_upload_download_file/post/request_body/content/application_octet_stream/__init__.py +src/petstore_api/paths/fake_upload_download_file/post/request_body/content/application_octet_stream/schema.py +src/petstore_api/paths/fake_upload_download_file/post/responses/__init__.py +src/petstore_api/paths/fake_upload_download_file/post/responses/response_200/__init__.py +src/petstore_api/paths/fake_upload_download_file/post/responses/response_200/content/__init__.py +src/petstore_api/paths/fake_upload_download_file/post/responses/response_200/content/application_octet_stream/__init__.py +src/petstore_api/paths/fake_upload_download_file/post/responses/response_200/content/application_octet_stream/schema.py +src/petstore_api/paths/fake_upload_file/__init__.py +src/petstore_api/paths/fake_upload_file/post/__init__.py +src/petstore_api/paths/fake_upload_file/post/operation.py +src/petstore_api/paths/fake_upload_file/post/request_body/__init__.py +src/petstore_api/paths/fake_upload_file/post/request_body/content/__init__.py +src/petstore_api/paths/fake_upload_file/post/request_body/content/multipart_form_data/__init__.py +src/petstore_api/paths/fake_upload_file/post/request_body/content/multipart_form_data/schema.py +src/petstore_api/paths/fake_upload_file/post/responses/__init__.py +src/petstore_api/paths/fake_upload_file/post/responses/response_200/__init__.py +src/petstore_api/paths/fake_upload_file/post/responses/response_200/content/__init__.py +src/petstore_api/paths/fake_upload_file/post/responses/response_200/content/application_json/__init__.py +src/petstore_api/paths/fake_upload_file/post/responses/response_200/content/application_json/schema.py +src/petstore_api/paths/fake_upload_files/__init__.py +src/petstore_api/paths/fake_upload_files/post/__init__.py +src/petstore_api/paths/fake_upload_files/post/operation.py +src/petstore_api/paths/fake_upload_files/post/request_body/__init__.py +src/petstore_api/paths/fake_upload_files/post/request_body/content/__init__.py +src/petstore_api/paths/fake_upload_files/post/request_body/content/multipart_form_data/__init__.py +src/petstore_api/paths/fake_upload_files/post/request_body/content/multipart_form_data/schema.py +src/petstore_api/paths/fake_upload_files/post/responses/__init__.py +src/petstore_api/paths/fake_upload_files/post/responses/response_200/__init__.py +src/petstore_api/paths/fake_upload_files/post/responses/response_200/content/__init__.py +src/petstore_api/paths/fake_upload_files/post/responses/response_200/content/application_json/__init__.py +src/petstore_api/paths/fake_upload_files/post/responses/response_200/content/application_json/schema.py +src/petstore_api/paths/fake_wild_card_responses/__init__.py +src/petstore_api/paths/fake_wild_card_responses/get/__init__.py +src/petstore_api/paths/fake_wild_card_responses/get/operation.py +src/petstore_api/paths/fake_wild_card_responses/get/responses/__init__.py +src/petstore_api/paths/fake_wild_card_responses/get/responses/response_1xx/__init__.py +src/petstore_api/paths/fake_wild_card_responses/get/responses/response_1xx/content/__init__.py +src/petstore_api/paths/fake_wild_card_responses/get/responses/response_1xx/content/application_json/__init__.py +src/petstore_api/paths/fake_wild_card_responses/get/responses/response_1xx/content/application_json/schema.py +src/petstore_api/paths/fake_wild_card_responses/get/responses/response_200/__init__.py +src/petstore_api/paths/fake_wild_card_responses/get/responses/response_200/content/__init__.py +src/petstore_api/paths/fake_wild_card_responses/get/responses/response_200/content/application_json/__init__.py +src/petstore_api/paths/fake_wild_card_responses/get/responses/response_200/content/application_json/schema.py +src/petstore_api/paths/fake_wild_card_responses/get/responses/response_2xx/__init__.py +src/petstore_api/paths/fake_wild_card_responses/get/responses/response_2xx/content/__init__.py +src/petstore_api/paths/fake_wild_card_responses/get/responses/response_2xx/content/application_json/__init__.py +src/petstore_api/paths/fake_wild_card_responses/get/responses/response_2xx/content/application_json/schema.py +src/petstore_api/paths/fake_wild_card_responses/get/responses/response_3xx/__init__.py +src/petstore_api/paths/fake_wild_card_responses/get/responses/response_3xx/content/__init__.py +src/petstore_api/paths/fake_wild_card_responses/get/responses/response_3xx/content/application_json/__init__.py +src/petstore_api/paths/fake_wild_card_responses/get/responses/response_3xx/content/application_json/schema.py +src/petstore_api/paths/fake_wild_card_responses/get/responses/response_4xx/__init__.py +src/petstore_api/paths/fake_wild_card_responses/get/responses/response_4xx/content/__init__.py +src/petstore_api/paths/fake_wild_card_responses/get/responses/response_4xx/content/application_json/__init__.py +src/petstore_api/paths/fake_wild_card_responses/get/responses/response_4xx/content/application_json/schema.py +src/petstore_api/paths/fake_wild_card_responses/get/responses/response_5xx/__init__.py +src/petstore_api/paths/fake_wild_card_responses/get/responses/response_5xx/content/__init__.py +src/petstore_api/paths/fake_wild_card_responses/get/responses/response_5xx/content/application_json/__init__.py +src/petstore_api/paths/fake_wild_card_responses/get/responses/response_5xx/content/application_json/schema.py +src/petstore_api/paths/foo/__init__.py +src/petstore_api/paths/foo/get/__init__.py +src/petstore_api/paths/foo/get/operation.py +src/petstore_api/paths/foo/get/responses/__init__.py +src/petstore_api/paths/foo/get/responses/response_default/__init__.py +src/petstore_api/paths/foo/get/responses/response_default/content/__init__.py +src/petstore_api/paths/foo/get/responses/response_default/content/application_json/__init__.py +src/petstore_api/paths/foo/get/responses/response_default/content/application_json/schema.py +src/petstore_api/paths/foo/get/servers/__init__.py +src/petstore_api/paths/foo/get/servers/server_0.py +src/petstore_api/paths/foo/get/servers/server_1.py +src/petstore_api/paths/pet/__init__.py +src/petstore_api/paths/pet/post/__init__.py +src/petstore_api/paths/pet/post/operation.py +src/petstore_api/paths/pet/post/request_body/__init__.py +src/petstore_api/paths/pet/post/responses/__init__.py +src/petstore_api/paths/pet/post/responses/response_200/__init__.py +src/petstore_api/paths/pet/post/responses/response_405/__init__.py +src/petstore_api/paths/pet/post/security/__init__.py +src/petstore_api/paths/pet/post/security/security_requirement_object_0.py +src/petstore_api/paths/pet/post/security/security_requirement_object_1.py +src/petstore_api/paths/pet/post/security/security_requirement_object_2.py +src/petstore_api/paths/pet/put/__init__.py +src/petstore_api/paths/pet/put/operation.py +src/petstore_api/paths/pet/put/request_body/__init__.py +src/petstore_api/paths/pet/put/responses/__init__.py +src/petstore_api/paths/pet/put/responses/response_400/__init__.py +src/petstore_api/paths/pet/put/responses/response_404/__init__.py +src/petstore_api/paths/pet/put/responses/response_405/__init__.py +src/petstore_api/paths/pet/put/security/__init__.py +src/petstore_api/paths/pet/put/security/security_requirement_object_0.py +src/petstore_api/paths/pet/put/security/security_requirement_object_1.py +src/petstore_api/paths/pet_find_by_status/__init__.py +src/petstore_api/paths/pet_find_by_status/get/__init__.py +src/petstore_api/paths/pet_find_by_status/get/operation.py +src/petstore_api/paths/pet_find_by_status/get/parameters/__init__.py +src/petstore_api/paths/pet_find_by_status/get/parameters/parameter_0/__init__.py +src/petstore_api/paths/pet_find_by_status/get/parameters/parameter_0/schema.py +src/petstore_api/paths/pet_find_by_status/get/responses/__init__.py +src/petstore_api/paths/pet_find_by_status/get/responses/response_200/__init__.py +src/petstore_api/paths/pet_find_by_status/get/responses/response_400/__init__.py +src/petstore_api/paths/pet_find_by_status/get/security/__init__.py +src/petstore_api/paths/pet_find_by_status/get/security/security_requirement_object_0.py +src/petstore_api/paths/pet_find_by_status/get/security/security_requirement_object_1.py +src/petstore_api/paths/pet_find_by_status/get/security/security_requirement_object_2.py +src/petstore_api/paths/pet_find_by_status/servers/__init__.py +src/petstore_api/paths/pet_find_by_status/servers/server_0.py +src/petstore_api/paths/pet_find_by_status/servers/server_1.py +src/petstore_api/paths/pet_find_by_tags/__init__.py +src/petstore_api/paths/pet_find_by_tags/get/__init__.py +src/petstore_api/paths/pet_find_by_tags/get/operation.py +src/petstore_api/paths/pet_find_by_tags/get/parameters/__init__.py +src/petstore_api/paths/pet_find_by_tags/get/parameters/parameter_0/__init__.py +src/petstore_api/paths/pet_find_by_tags/get/parameters/parameter_0/schema.py +src/petstore_api/paths/pet_find_by_tags/get/responses/__init__.py +src/petstore_api/paths/pet_find_by_tags/get/responses/response_200/__init__.py +src/petstore_api/paths/pet_find_by_tags/get/responses/response_400/__init__.py +src/petstore_api/paths/pet_find_by_tags/get/security/__init__.py +src/petstore_api/paths/pet_find_by_tags/get/security/security_requirement_object_0.py +src/petstore_api/paths/pet_find_by_tags/get/security/security_requirement_object_1.py +src/petstore_api/paths/pet_pet_id/__init__.py +src/petstore_api/paths/pet_pet_id/delete/__init__.py +src/petstore_api/paths/pet_pet_id/delete/operation.py +src/petstore_api/paths/pet_pet_id/delete/parameters/__init__.py +src/petstore_api/paths/pet_pet_id/delete/parameters/parameter_0/__init__.py +src/petstore_api/paths/pet_pet_id/delete/parameters/parameter_0/schema.py +src/petstore_api/paths/pet_pet_id/delete/parameters/parameter_1/__init__.py +src/petstore_api/paths/pet_pet_id/delete/parameters/parameter_1/schema.py +src/petstore_api/paths/pet_pet_id/delete/responses/__init__.py +src/petstore_api/paths/pet_pet_id/delete/responses/response_400/__init__.py +src/petstore_api/paths/pet_pet_id/delete/security/__init__.py +src/petstore_api/paths/pet_pet_id/delete/security/security_requirement_object_0.py +src/petstore_api/paths/pet_pet_id/delete/security/security_requirement_object_1.py +src/petstore_api/paths/pet_pet_id/get/__init__.py +src/petstore_api/paths/pet_pet_id/get/operation.py +src/petstore_api/paths/pet_pet_id/get/parameters/__init__.py +src/petstore_api/paths/pet_pet_id/get/parameters/parameter_0/__init__.py +src/petstore_api/paths/pet_pet_id/get/parameters/parameter_0/schema.py +src/petstore_api/paths/pet_pet_id/get/responses/__init__.py +src/petstore_api/paths/pet_pet_id/get/responses/response_200/__init__.py +src/petstore_api/paths/pet_pet_id/get/responses/response_200/content/__init__.py +src/petstore_api/paths/pet_pet_id/get/responses/response_200/content/application_json/__init__.py +src/petstore_api/paths/pet_pet_id/get/responses/response_200/content/application_json/schema.py +src/petstore_api/paths/pet_pet_id/get/responses/response_200/content/application_xml/__init__.py +src/petstore_api/paths/pet_pet_id/get/responses/response_200/content/application_xml/schema.py +src/petstore_api/paths/pet_pet_id/get/responses/response_400/__init__.py +src/petstore_api/paths/pet_pet_id/get/responses/response_404/__init__.py +src/petstore_api/paths/pet_pet_id/get/security/__init__.py +src/petstore_api/paths/pet_pet_id/get/security/security_requirement_object_0.py +src/petstore_api/paths/pet_pet_id/post/__init__.py +src/petstore_api/paths/pet_pet_id/post/operation.py +src/petstore_api/paths/pet_pet_id/post/parameters/__init__.py +src/petstore_api/paths/pet_pet_id/post/parameters/parameter_0/__init__.py +src/petstore_api/paths/pet_pet_id/post/parameters/parameter_0/schema.py +src/petstore_api/paths/pet_pet_id/post/request_body/__init__.py +src/petstore_api/paths/pet_pet_id/post/request_body/content/__init__.py +src/petstore_api/paths/pet_pet_id/post/request_body/content/application_x_www_form_urlencoded/__init__.py +src/petstore_api/paths/pet_pet_id/post/request_body/content/application_x_www_form_urlencoded/schema.py +src/petstore_api/paths/pet_pet_id/post/responses/__init__.py +src/petstore_api/paths/pet_pet_id/post/responses/response_405/__init__.py +src/petstore_api/paths/pet_pet_id/post/security/__init__.py +src/petstore_api/paths/pet_pet_id/post/security/security_requirement_object_0.py +src/petstore_api/paths/pet_pet_id/post/security/security_requirement_object_1.py +src/petstore_api/paths/pet_pet_id_upload_image/__init__.py +src/petstore_api/paths/pet_pet_id_upload_image/post/__init__.py +src/petstore_api/paths/pet_pet_id_upload_image/post/operation.py +src/petstore_api/paths/pet_pet_id_upload_image/post/parameters/__init__.py +src/petstore_api/paths/pet_pet_id_upload_image/post/parameters/parameter_0/__init__.py +src/petstore_api/paths/pet_pet_id_upload_image/post/parameters/parameter_0/schema.py +src/petstore_api/paths/pet_pet_id_upload_image/post/request_body/__init__.py +src/petstore_api/paths/pet_pet_id_upload_image/post/request_body/content/__init__.py +src/petstore_api/paths/pet_pet_id_upload_image/post/request_body/content/multipart_form_data/__init__.py +src/petstore_api/paths/pet_pet_id_upload_image/post/request_body/content/multipart_form_data/schema.py +src/petstore_api/paths/pet_pet_id_upload_image/post/responses/__init__.py +src/petstore_api/paths/pet_pet_id_upload_image/post/responses/response_200/__init__.py +src/petstore_api/paths/pet_pet_id_upload_image/post/security/__init__.py +src/petstore_api/paths/pet_pet_id_upload_image/post/security/security_requirement_object_0.py +src/petstore_api/paths/store_inventory/__init__.py +src/petstore_api/paths/store_inventory/get/__init__.py +src/petstore_api/paths/store_inventory/get/operation.py +src/petstore_api/paths/store_inventory/get/responses/__init__.py +src/petstore_api/paths/store_inventory/get/responses/response_200/__init__.py +src/petstore_api/paths/store_inventory/get/security/__init__.py +src/petstore_api/paths/store_inventory/get/security/security_requirement_object_0.py +src/petstore_api/paths/store_order/__init__.py +src/petstore_api/paths/store_order/post/__init__.py +src/petstore_api/paths/store_order/post/operation.py +src/petstore_api/paths/store_order/post/request_body/__init__.py +src/petstore_api/paths/store_order/post/request_body/content/__init__.py +src/petstore_api/paths/store_order/post/request_body/content/application_json/__init__.py +src/petstore_api/paths/store_order/post/request_body/content/application_json/schema.py +src/petstore_api/paths/store_order/post/responses/__init__.py +src/petstore_api/paths/store_order/post/responses/response_200/__init__.py +src/petstore_api/paths/store_order/post/responses/response_200/content/__init__.py +src/petstore_api/paths/store_order/post/responses/response_200/content/application_json/__init__.py +src/petstore_api/paths/store_order/post/responses/response_200/content/application_json/schema.py +src/petstore_api/paths/store_order/post/responses/response_200/content/application_xml/__init__.py +src/petstore_api/paths/store_order/post/responses/response_200/content/application_xml/schema.py +src/petstore_api/paths/store_order/post/responses/response_400/__init__.py +src/petstore_api/paths/store_order_order_id/__init__.py +src/petstore_api/paths/store_order_order_id/delete/__init__.py +src/petstore_api/paths/store_order_order_id/delete/operation.py +src/petstore_api/paths/store_order_order_id/delete/parameters/__init__.py +src/petstore_api/paths/store_order_order_id/delete/parameters/parameter_0/__init__.py +src/petstore_api/paths/store_order_order_id/delete/parameters/parameter_0/schema.py +src/petstore_api/paths/store_order_order_id/delete/responses/__init__.py +src/petstore_api/paths/store_order_order_id/delete/responses/response_400/__init__.py +src/petstore_api/paths/store_order_order_id/delete/responses/response_404/__init__.py +src/petstore_api/paths/store_order_order_id/get/__init__.py +src/petstore_api/paths/store_order_order_id/get/operation.py +src/petstore_api/paths/store_order_order_id/get/parameters/__init__.py +src/petstore_api/paths/store_order_order_id/get/parameters/parameter_0/__init__.py +src/petstore_api/paths/store_order_order_id/get/parameters/parameter_0/schema.py +src/petstore_api/paths/store_order_order_id/get/responses/__init__.py +src/petstore_api/paths/store_order_order_id/get/responses/response_200/__init__.py +src/petstore_api/paths/store_order_order_id/get/responses/response_200/content/__init__.py +src/petstore_api/paths/store_order_order_id/get/responses/response_200/content/application_json/__init__.py +src/petstore_api/paths/store_order_order_id/get/responses/response_200/content/application_json/schema.py +src/petstore_api/paths/store_order_order_id/get/responses/response_200/content/application_xml/__init__.py +src/petstore_api/paths/store_order_order_id/get/responses/response_200/content/application_xml/schema.py +src/petstore_api/paths/store_order_order_id/get/responses/response_400/__init__.py +src/petstore_api/paths/store_order_order_id/get/responses/response_404/__init__.py +src/petstore_api/paths/user/__init__.py +src/petstore_api/paths/user/post/__init__.py +src/petstore_api/paths/user/post/operation.py +src/petstore_api/paths/user/post/request_body/__init__.py +src/petstore_api/paths/user/post/request_body/content/__init__.py +src/petstore_api/paths/user/post/request_body/content/application_json/__init__.py +src/petstore_api/paths/user/post/request_body/content/application_json/schema.py +src/petstore_api/paths/user/post/responses/__init__.py +src/petstore_api/paths/user/post/responses/response_default/__init__.py +src/petstore_api/paths/user_create_with_array/__init__.py +src/petstore_api/paths/user_create_with_array/post/__init__.py +src/petstore_api/paths/user_create_with_array/post/operation.py +src/petstore_api/paths/user_create_with_array/post/request_body/__init__.py +src/petstore_api/paths/user_create_with_array/post/responses/__init__.py +src/petstore_api/paths/user_create_with_array/post/responses/response_default/__init__.py +src/petstore_api/paths/user_create_with_list/__init__.py +src/petstore_api/paths/user_create_with_list/post/__init__.py +src/petstore_api/paths/user_create_with_list/post/operation.py +src/petstore_api/paths/user_create_with_list/post/request_body/__init__.py +src/petstore_api/paths/user_create_with_list/post/responses/__init__.py +src/petstore_api/paths/user_create_with_list/post/responses/response_default/__init__.py +src/petstore_api/paths/user_login/__init__.py +src/petstore_api/paths/user_login/get/__init__.py +src/petstore_api/paths/user_login/get/operation.py +src/petstore_api/paths/user_login/get/parameters/__init__.py +src/petstore_api/paths/user_login/get/parameters/parameter_0/__init__.py +src/petstore_api/paths/user_login/get/parameters/parameter_0/schema.py +src/petstore_api/paths/user_login/get/parameters/parameter_1/__init__.py +src/petstore_api/paths/user_login/get/parameters/parameter_1/schema.py +src/petstore_api/paths/user_login/get/responses/__init__.py +src/petstore_api/paths/user_login/get/responses/response_200/__init__.py +src/petstore_api/paths/user_login/get/responses/response_200/content/__init__.py +src/petstore_api/paths/user_login/get/responses/response_200/content/application_json/__init__.py +src/petstore_api/paths/user_login/get/responses/response_200/content/application_json/schema.py +src/petstore_api/paths/user_login/get/responses/response_200/content/application_xml/__init__.py +src/petstore_api/paths/user_login/get/responses/response_200/content/application_xml/schema.py +src/petstore_api/paths/user_login/get/responses/response_200/headers/__init__.py +src/petstore_api/paths/user_login/get/responses/response_200/headers/header_int32/__init__.py +src/petstore_api/paths/user_login/get/responses/response_200/headers/header_number_header/__init__.py +src/petstore_api/paths/user_login/get/responses/response_200/headers/header_ref_content_schema_header/__init__.py +src/petstore_api/paths/user_login/get/responses/response_200/headers/header_ref_schema_header/__init__.py +src/petstore_api/paths/user_login/get/responses/response_200/headers/header_string_header/__init__.py +src/petstore_api/paths/user_login/get/responses/response_200/headers/header_x_expires_after/__init__.py +src/petstore_api/paths/user_login/get/responses/response_200/headers/header_x_expires_after/schema.py +src/petstore_api/paths/user_login/get/responses/response_200/headers/header_x_rate_limit/__init__.py +src/petstore_api/paths/user_login/get/responses/response_200/headers/header_x_rate_limit/content/__init__.py +src/petstore_api/paths/user_login/get/responses/response_200/headers/header_x_rate_limit/content/application_json/__init__.py +src/petstore_api/paths/user_login/get/responses/response_200/headers/header_x_rate_limit/content/application_json/schema.py +src/petstore_api/paths/user_login/get/responses/response_400/__init__.py +src/petstore_api/paths/user_logout/__init__.py +src/petstore_api/paths/user_logout/get/__init__.py +src/petstore_api/paths/user_logout/get/operation.py +src/petstore_api/paths/user_logout/get/responses/__init__.py +src/petstore_api/paths/user_logout/get/responses/response_default/__init__.py +src/petstore_api/paths/user_username/__init__.py +src/petstore_api/paths/user_username/delete/__init__.py +src/petstore_api/paths/user_username/delete/operation.py +src/petstore_api/paths/user_username/delete/parameters/__init__.py +src/petstore_api/paths/user_username/delete/parameters/parameter_0/__init__.py +src/petstore_api/paths/user_username/delete/responses/__init__.py +src/petstore_api/paths/user_username/delete/responses/response_200/__init__.py +src/petstore_api/paths/user_username/delete/responses/response_404/__init__.py +src/petstore_api/paths/user_username/get/__init__.py +src/petstore_api/paths/user_username/get/operation.py +src/petstore_api/paths/user_username/get/parameters/__init__.py +src/petstore_api/paths/user_username/get/parameters/parameter_0/__init__.py +src/petstore_api/paths/user_username/get/responses/__init__.py +src/petstore_api/paths/user_username/get/responses/response_200/__init__.py +src/petstore_api/paths/user_username/get/responses/response_200/content/__init__.py +src/petstore_api/paths/user_username/get/responses/response_200/content/application_json/__init__.py +src/petstore_api/paths/user_username/get/responses/response_200/content/application_json/schema.py +src/petstore_api/paths/user_username/get/responses/response_200/content/application_xml/__init__.py +src/petstore_api/paths/user_username/get/responses/response_200/content/application_xml/schema.py +src/petstore_api/paths/user_username/get/responses/response_400/__init__.py +src/petstore_api/paths/user_username/get/responses/response_404/__init__.py +src/petstore_api/paths/user_username/put/__init__.py +src/petstore_api/paths/user_username/put/operation.py +src/petstore_api/paths/user_username/put/parameters/__init__.py +src/petstore_api/paths/user_username/put/parameters/parameter_0/__init__.py +src/petstore_api/paths/user_username/put/request_body/__init__.py +src/petstore_api/paths/user_username/put/request_body/content/__init__.py +src/petstore_api/paths/user_username/put/request_body/content/application_json/__init__.py +src/petstore_api/paths/user_username/put/request_body/content/application_json/schema.py +src/petstore_api/paths/user_username/put/responses/__init__.py +src/petstore_api/paths/user_username/put/responses/response_400/__init__.py +src/petstore_api/paths/user_username/put/responses/response_404/__init__.py +src/petstore_api/rest.py +src/petstore_api/schemas.py +src/petstore_api/security_schemes.py +src/petstore_api/server.py +src/petstore_api/servers/__init__.py +src/petstore_api/servers/server_0.py +src/petstore_api/servers/server_1.py +src/petstore_api/servers/server_2.py +src/petstore_api/signing.py test-requirements.txt test/__init__.py -test/test_models/__init__.py +test/components/__init__.py +test/components/schema/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/__init__.py +test/test_paths/test_another_fake_dummy/__init__.py +test/test_paths/test_another_fake_dummy/test_patch.py +test/test_paths/test_fake/__init__.py +test/test_paths/test_fake/test_delete.py +test/test_paths/test_fake/test_get.py +test/test_paths/test_fake/test_patch.py +test/test_paths/test_fake/test_post.py +test/test_paths/test_fake_additional_properties_with_array_of_enums/__init__.py +test/test_paths/test_fake_additional_properties_with_array_of_enums/test_get.py +test/test_paths/test_fake_body_with_file_schema/__init__.py +test/test_paths/test_fake_body_with_file_schema/test_put.py +test/test_paths/test_fake_body_with_query_params/__init__.py +test/test_paths/test_fake_body_with_query_params/test_put.py +test/test_paths/test_fake_case_sensitive_params/__init__.py +test/test_paths/test_fake_case_sensitive_params/test_put.py +test/test_paths/test_fake_classname_test/__init__.py +test/test_paths/test_fake_classname_test/test_patch.py +test/test_paths/test_fake_delete_coffee_id/__init__.py +test/test_paths/test_fake_delete_coffee_id/test_delete.py +test/test_paths/test_fake_health/__init__.py +test/test_paths/test_fake_health/test_get.py +test/test_paths/test_fake_inline_additional_properties/__init__.py +test/test_paths/test_fake_inline_additional_properties/test_post.py +test/test_paths/test_fake_inline_composition/__init__.py +test/test_paths/test_fake_inline_composition/test_post.py +test/test_paths/test_fake_json_form_data/__init__.py +test/test_paths/test_fake_json_form_data/test_get.py +test/test_paths/test_fake_json_patch/__init__.py +test/test_paths/test_fake_json_patch/test_patch.py +test/test_paths/test_fake_json_with_charset/__init__.py +test/test_paths/test_fake_json_with_charset/test_post.py +test/test_paths/test_fake_multiple_response_bodies/__init__.py +test/test_paths/test_fake_multiple_response_bodies/test_get.py +test/test_paths/test_fake_multiple_securities/__init__.py +test/test_paths/test_fake_multiple_securities/test_get.py +test/test_paths/test_fake_obj_in_query/__init__.py +test/test_paths/test_fake_obj_in_query/test_get.py +test/test_paths/test_fake_parameter_collisions1_abab_self_ab/__init__.py +test/test_paths/test_fake_parameter_collisions1_abab_self_ab/test_post.py +test/test_paths/test_fake_pet_id_upload_image_with_required_file/__init__.py +test/test_paths/test_fake_pet_id_upload_image_with_required_file/test_post.py +test/test_paths/test_fake_query_param_with_json_content_type/__init__.py +test/test_paths/test_fake_query_param_with_json_content_type/test_get.py +test/test_paths/test_fake_redirection/__init__.py +test/test_paths/test_fake_redirection/test_get.py +test/test_paths/test_fake_ref_obj_in_query/__init__.py +test/test_paths/test_fake_ref_obj_in_query/test_get.py +test/test_paths/test_fake_refs_array_of_enums/__init__.py +test/test_paths/test_fake_refs_array_of_enums/test_post.py +test/test_paths/test_fake_refs_arraymodel/__init__.py +test/test_paths/test_fake_refs_arraymodel/test_post.py +test/test_paths/test_fake_refs_boolean/__init__.py +test/test_paths/test_fake_refs_boolean/test_post.py +test/test_paths/test_fake_refs_composed_one_of_number_with_validations/__init__.py +test/test_paths/test_fake_refs_composed_one_of_number_with_validations/test_post.py +test/test_paths/test_fake_refs_enum/__init__.py +test/test_paths/test_fake_refs_enum/test_post.py +test/test_paths/test_fake_refs_mammal/__init__.py +test/test_paths/test_fake_refs_mammal/test_post.py +test/test_paths/test_fake_refs_number/__init__.py +test/test_paths/test_fake_refs_number/test_post.py +test/test_paths/test_fake_refs_object_model_with_ref_props/__init__.py +test/test_paths/test_fake_refs_object_model_with_ref_props/test_post.py +test/test_paths/test_fake_refs_string/__init__.py +test/test_paths/test_fake_refs_string/test_post.py +test/test_paths/test_fake_response_without_schema/__init__.py +test/test_paths/test_fake_response_without_schema/test_get.py +test/test_paths/test_fake_test_query_paramters/__init__.py +test/test_paths/test_fake_test_query_paramters/test_put.py +test/test_paths/test_fake_upload_download_file/__init__.py +test/test_paths/test_fake_upload_download_file/test_post.py +test/test_paths/test_fake_upload_file/__init__.py +test/test_paths/test_fake_upload_file/test_post.py +test/test_paths/test_fake_upload_files/__init__.py +test/test_paths/test_fake_upload_files/test_post.py +test/test_paths/test_fake_wild_card_responses/__init__.py +test/test_paths/test_fake_wild_card_responses/test_get.py +test/test_paths/test_foo/__init__.py +test/test_paths/test_foo/test_get.py +test/test_paths/test_pet/__init__.py +test/test_paths/test_pet/test_post.py +test/test_paths/test_pet/test_put.py +test/test_paths/test_pet_find_by_status/__init__.py +test/test_paths/test_pet_find_by_status/test_get.py +test/test_paths/test_pet_find_by_tags/__init__.py +test/test_paths/test_pet_find_by_tags/test_get.py +test/test_paths/test_pet_pet_id/__init__.py +test/test_paths/test_pet_pet_id/test_delete.py +test/test_paths/test_pet_pet_id/test_get.py +test/test_paths/test_pet_pet_id/test_post.py +test/test_paths/test_pet_pet_id_upload_image/__init__.py +test/test_paths/test_pet_pet_id_upload_image/test_post.py +test/test_paths/test_store_inventory/__init__.py +test/test_paths/test_store_inventory/test_get.py +test/test_paths/test_store_order/__init__.py +test/test_paths/test_store_order/test_post.py +test/test_paths/test_store_order_order_id/__init__.py +test/test_paths/test_store_order_order_id/test_delete.py +test/test_paths/test_store_order_order_id/test_get.py +test/test_paths/test_user/__init__.py +test/test_paths/test_user/test_post.py +test/test_paths/test_user_create_with_array/__init__.py +test/test_paths/test_user_create_with_array/test_post.py +test/test_paths/test_user_create_with_list/__init__.py +test/test_paths/test_user_create_with_list/test_post.py +test/test_paths/test_user_login/__init__.py +test/test_paths/test_user_login/test_get.py +test/test_paths/test_user_logout/__init__.py +test/test_paths/test_user_logout/test_get.py +test/test_paths/test_user_username/__init__.py +test/test_paths/test_user_username/test_delete.py +test/test_paths/test_user_username/test_get.py +test/test_paths/test_user_username/test_put.py tox.ini diff --git a/samples/openapi3/client/petstore/python/.openapi-generator/VERSION b/samples/openapi3/client/petstore/python/.openapi-generator/VERSION index a6a3a43c3a0..359a5b952d4 100644 --- a/samples/openapi3/client/petstore/python/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/python/.openapi-generator/VERSION @@ -1 +1 @@ -1.0.4 \ No newline at end of file +2.0.0 \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/Makefile b/samples/openapi3/client/petstore/python/Makefile index 863c380ebef..b73277d308c 100644 --- a/samples/openapi3/client/petstore/python/Makefile +++ b/samples/openapi3/client/petstore/python/Makefile @@ -1,10 +1,7 @@ -REQUIREMENTS_FILE=dev-requirements.txt -REQUIREMENTS_OUT=dev-requirements.txt.log SETUP_OUT=*.egg-info VENV=venv clean: - rm -rf $(REQUIREMENTS_OUT) rm -rf $(SETUP_OUT) rm -rf $(VENV) rm -rf .tox diff --git a/samples/openapi3/client/petstore/python/README.md b/samples/openapi3/client/petstore/python/README.md index 09d4c31da9b..da0691aed7c 100644 --- a/samples/openapi3/client/petstore/python/README.md +++ b/samples/openapi3/client/petstore/python/README.md @@ -1,108 +1,22 @@ # petstore-api This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: +This Python package is automatically generated by the [OpenAPI JSON Schema Generator](https://github.com/openapi-json-schema-tools/openapi-json-schema-generator) project: - API version: 1.0.0 - Package version: 1.0.0 -- Build package: org.openapitools.codegen.languages.PythonClientCodegen +- Build package: PythonClientCodegen -## Requirements. +## Requirements Python >=3.7 -## Migration from other generators like python and python-legacy - -### Changes -1. This generator uses spec case for all (object) property names and parameter names. - - So if the spec has a property name like camelCase, it will use camelCase rather than camel_case - - So you will need to update how you input and read properties to use spec case -2. Endpoint parameters are stored in dictionaries to prevent collisions (explanation below) - - So you will need to update how you pass data in to endpoints -3. Endpoint responses now include the original response, the deserialized response body, and (todo)the deserialized headers - - So you will need to update your code to use response.body to access deserialized data -4. All validated data is instantiated in an instance that subclasses all validated Schema classes and Decimal/str/list/tuple/frozendict/NoneClass/BoolClass/bytes/io.FileIO - - This means that you can use isinstance to check if a payload validated against a schema class - - This means that no data will be of type None/True/False - - ingested None will subclass NoneClass - - ingested True will subclass BoolClass - - ingested False will subclass BoolClass - - So if you need to check is True/False/None, instead use instance.is_true_oapg()/.is_false_oapg()/.is_none_oapg() -5. All validated class instances are immutable except for ones based on io.File - - This is because if properties were changed after validation, that validation would no longer apply - - So no changing values or property values after a class has been instantiated -6. String + Number types with formats - - String type data is stored as a string and if you need to access types based on its format like date, - date-time, uuid, number etc then you will need to use accessor functions on the instance - - type string + format: See .as_date_oapg, .as_datetime_oapg, .as_decimal_oapg, .as_uuid_oapg - - type number + format: See .as_float_oapg, .as_int_oapg - - this was done because openapi/json-schema defines constraints. string data may be type string with no format - keyword in one schema, and include a format constraint in another schema - - So if you need to access a string format based type, use as_date_oapg/as_datetime_oapg/as_decimal_oapg/as_uuid_oapg - - So if you need to access a number format based type, use as_int_oapg/as_float_oapg -7. Property access on AnyType(type unset) or object(dict) schemas - - Only required keys with valid python names are properties like .someProp and have type hints - - All optional keys may not exist, so properties are not defined for them - - One can access optional values with dict_instance['optionalProp'] and KeyError will be raised if it does not exist - - Use get_item_oapg if you need a way to always get a value whether or not the key exists - - If the key does not exist, schemas.unset is returned from calling dict_instance.get_item_oapg('optionalProp') - - All required and optional keys have type hints for this method, and @typing.overload is used - - A type hint is also generated for additionalProperties accessed using this method - - So you will need to update you code to use some_instance['optionalProp'] to access optional property - and additionalProperty values -8. The location of the api classes has changed - - Api classes are located in your_package.apis.tags.some_api - - This change was made to eliminate redundant code generation - - Legacy generators generated the same endpoint twice if it had > 1 tag on it - - This generator defines an endpoint in one class, then inherits that class to generate - apis by tags and by paths - - This change reduces code and allows quicker run time if you use the path apis - - path apis are at your_package.apis.paths.some_path - - Those apis will only load their needed models, which is less to load than all of the resources needed in a tag api - - So you will need to update your import paths to the api classes - -### Why are Oapg and _oapg used in class and method names? -Classes can have arbitrarily named properties set on them -Endpoints can have arbitrary operationId method names set -For those reasons, I use the prefix Oapg and _oapg to greatly reduce the likelihood of collisions -on protected + public classes/methods. -oapg stands for OpenApi Python Generator. - -### Object property spec case -This was done because when payloads are ingested, they can be validated against N number of schemas. -If the input signature used a different property name then that has mutated the payload. -So SchemaA and SchemaB must both see the camelCase spec named variable. -Also it is possible to send in two properties, named camelCase and camel_case in the same payload. -That use case should be support so spec case is used. - -### Parameter spec case -Parameters can be included in different locations including: -- query -- path -- header -- cookie - -Any of those parameters could use the same parameter names, so if every parameter -was included as an endpoint parameter in a function signature, they would collide. -For that reason, each of those inputs have been separated out into separate typed dictionaries: -- query_params -- path_params -- header_params -- cookie_params - -So when updating your code, you will need to pass endpoint parameters in using those -dictionaries. - -### Endpoint responses -Endpoint responses have been enriched to now include more information. -Any response reom an endpoint will now include the following properties: -response: urllib3.HTTPResponse -body: typing.Union[Unset, Schema] -headers: typing.Union[Unset, TODO] -Note: response header deserialization has not yet been added - - -## Installation & Usage +## Migration Guides +- [2.0.0 Migration Guide](migration_2_0_0.md) +- [Migration from Other Python Generators](migration_other_python_generators.md) + + +## Installation ### pip install If the python package is hosted on a repository, you can install directly using: @@ -122,306 +36,451 @@ import petstore_api Install via [Setuptools](http://pypi.python.org/pypi/setuptools). ```sh -python setup.py install --user +python -m pip install . --user ``` -(or `sudo python setup.py install` to install the package for all users) +(or `python -m pip install .` to install the package for all users) Then import the package: ```python import petstore_api ``` +## Usage Notes +### Validation, Immutability, and Data Type +This python code validates data to schema classes and return back an immutable instance containing the data +which subclasses all validated schema classes. This ensure that +- valid data cannot be mutated and become invalid to a set of schemas + - the one exception is that files are not immutable, so schema instances storing/sending/receiving files are not immutable +- one can use isinstance to check if a instance or property is valid to a schema class + - this means that expensive validation does not need to be run twice + +
    + Reason + +To do that, some changes had to be made. Python bool and NoneType cannot be subclassed, +so to be able to meet the above design goals, I implemented BoolClass and NoneClass classes +to allow schemas to subclass them. + +In python 0 == False and 1 == True. This is a problem for json schema which is language independent. +The [json schema test suite](https://github.com/json-schema-org/JSON-Schema-Test-Suite) has +[explicit tests that require that 0 != False and 1 != True](https://github.com/json-schema-org/JSON-Schema-Test-Suite/blob/main/tests/draft2020-12/type.json#L260-L267) +Using the above described BoolClass and NoneClasses allows those tests to pass. +- Another example of a package using it's own boolean class is [numpy's bool_](https://numpy.org/doc/stable/reference/arrays.scalars.html#numpy.bool_) +
    + +If you need to check is True/False/None, instead use instance.is_true_()/.is_false_()/.is_none_() + +Here is the mapping from json schema types to python subclassed types: +| Json Schema Type | Python Base Class | +| ---------------- | ----------------- | +| object | frozendict.frozendict | +| array | tuple | +| string | str | +| number | decimal.Decimal | +| integer | decimal.Decimal | +| boolean | BoolClass | +| null | NoneClass | +| AnyType (unset) | typing.Union[frozendict.frozendict, tuple, str, decimal.Decimal, BoolClass, NoneClass] | + +### Storage of Json Schema Definition in Python Classes +In openapi v3.0.3 there are ~ 28 json schema keywords. Almost all of them can apply if +type is unset. This data could be stored as +1. class properties +2. in a container in the class like in a dict or in a nested class + +This data is stored in a nested class named Schema_. +Storing this data as a nested class ensures that the data is encapsulated, does not collide with +class properties, and allows for deeper complex inline definitions. + +
    + Reason + +If the data were stored at the class property level, then the keywords could collide with +type object property names. To avoid that, one could make the properties semi or fully private with +a single or double underscore prefix, but that it a lot of data to put there. +Better to separate out json schema data from type object properties at the class property level. + +If the data were stored in a container that would segregate the different data which is good. +But json schemas can be inlined to any depth. Those complex deeper schemas would need to be included. +One could define them higher in the class file and then refer to them in the dict. That would required +iterating over schemas and adding all of the inner into a collection, and then generate that collection. + +The schema definitions are already nested from the json schema definition. The easiest solution is +to use a nested json schema definition class which holds that data. That way: +- the data is separated from class properties +- deeper complicated schemas can still be stored + +So a nested class was chosen to store json schema data, this class is named Schema_. +- The [django project uses this same pattern to store model class metadata in a Meta class](https://docs.djangoproject.com/en/4.1/topics/db/models/#meta-options) +
    + +### Json Schema Type Object +Most component schemas (models) are probably of type object. Which is a map data structure. +Json schema allows string keys in this map, which means schema properties can have key names that are +invalid python variable names. Names like: +- "hi-there" +- "1variable" +- "@now" +- " " +- "from" + +To allow these use cases to work, frozendict.frozendict is used as the base class of type object schemas. +This means that one can use normal dict methods on instances of these classes. + +
    + Other Details + +- optional properties which were not set will not exist in the instance +- None is only allowed in as a value if type: "null" was included or nullable: true was set +- type hints are written for accessing values by key literals like instance["hi-there"] +- and there is a method instance.get_item_["hi-there"] which returns an schemas.Unset value if the key was not set +- required properties with valid python names are accessible with instance.SomeRequiredProp + which uses the exact key from the openapi document + - preserving the original key names is required to properly validate a payload to multiple json schemas +
    + +### Json Schema Type + Format, Validated Data Storage +N schemas can be validated on the same payload. +To allow multiple schemas to validate, the data must be stored using one base class whether or not +a json schema format constraint exists in the schema. +See te below accessors for string data: +- type string + format: See .as_date_, .as_datetime_, .as_decimal_, .as_uuid_ + +In json schema, type: number with no format validates both integers and floats, so decimal.Decimal is used to store them. +See te below accessors for number data: +- type number + format: See .as_float_, .as_int_ + +
    + String + Date Example + +For example the string payload '2023-12-20' is validates to both of these schemas: +1. string only +``` +- type: string +``` +2. string and date format +``` +- type: string + format: date +``` +Because of use cases like this, a datetime.date is allowed as an input to this schema, but the data +is stored as a string, with a date accessor, instance.as_date_ +
    + ## Getting Started -Please follow the [installation procedure](#installation--usage) and then run the following: +Please follow the [installation procedure](#installation) and then run the following: ```python -import datetimeimport datetimeimport datetimeimport datetimeimport datetimeimport datetimeimport datetime -import time import petstore_api -from pprint import pprint +from petstore_api.configurations import api_configuration from petstore_api.apis.tags import another_fake_api -from petstore_api.model.client import Client -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( ) - - # Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: +with petstore_api.ApiClient(used_configuration) as api_client: # Create an instance of the API class api_instance = another_fake_api.AnotherFakeApi(api_client) - client = Client( - client="client_example", - ) # Client | client model + # example passing only required values which don't have defaults set + body = client.Client( + client="client_example", + ) try: # To test special tags - api_response = api_instance.call_123_test_special_tags(client) + api_response = api_instance.call_123_test__special_tags( + body=body, + ) pprint(api_response) except petstore_api.ApiException as e: - print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e) + print("Exception when calling AnotherFakeApi->call_123_test__special_tags: %s\n" % e) ``` -## Documentation for API Endpoints - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*AnotherFakeApi* | [**call_123_test_special_tags**](docs/apis/tags/AnotherFakeApi.md#call_123_test_special_tags) | **patch** /another-fake/dummy | To test special tags -*DefaultApi* | [**foo_get**](docs/apis/tags/DefaultApi.md#foo_get) | **get** /foo | -*FakeApi* | [**additional_properties_with_array_of_enums**](docs/apis/tags/FakeApi.md#additional_properties_with_array_of_enums) | **get** /fake/additional-properties-with-array-of-enums | Additional Properties with Array of Enums -*FakeApi* | [**array_model**](docs/apis/tags/FakeApi.md#array_model) | **post** /fake/refs/arraymodel | -*FakeApi* | [**array_of_enums**](docs/apis/tags/FakeApi.md#array_of_enums) | **post** /fake/refs/array-of-enums | Array of Enums -*FakeApi* | [**body_with_file_schema**](docs/apis/tags/FakeApi.md#body_with_file_schema) | **put** /fake/body-with-file-schema | -*FakeApi* | [**body_with_query_params**](docs/apis/tags/FakeApi.md#body_with_query_params) | **put** /fake/body-with-query-params | -*FakeApi* | [**boolean**](docs/apis/tags/FakeApi.md#boolean) | **post** /fake/refs/boolean | -*FakeApi* | [**case_sensitive_params**](docs/apis/tags/FakeApi.md#case_sensitive_params) | **put** /fake/case-sensitive-params | -*FakeApi* | [**client_model**](docs/apis/tags/FakeApi.md#client_model) | **patch** /fake | To test \"client\" model -*FakeApi* | [**composed_one_of_different_types**](docs/apis/tags/FakeApi.md#composed_one_of_different_types) | **post** /fake/refs/composed_one_of_number_with_validations | -*FakeApi* | [**delete_coffee**](docs/apis/tags/FakeApi.md#delete_coffee) | **delete** /fake/deleteCoffee/{id} | Delete coffee -*FakeApi* | [**endpoint_parameters**](docs/apis/tags/FakeApi.md#endpoint_parameters) | **post** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -*FakeApi* | [**enum_parameters**](docs/apis/tags/FakeApi.md#enum_parameters) | **get** /fake | To test enum parameters -*FakeApi* | [**fake_health_get**](docs/apis/tags/FakeApi.md#fake_health_get) | **get** /fake/health | Health check endpoint -*FakeApi* | [**group_parameters**](docs/apis/tags/FakeApi.md#group_parameters) | **delete** /fake | Fake endpoint to test group parameters (optional) -*FakeApi* | [**inline_additional_properties**](docs/apis/tags/FakeApi.md#inline_additional_properties) | **post** /fake/inline-additionalProperties | test inline additionalProperties -*FakeApi* | [**inline_composition**](docs/apis/tags/FakeApi.md#inline_composition) | **post** /fake/inlineComposition/ | testing composed schemas at inline locations -*FakeApi* | [**json_form_data**](docs/apis/tags/FakeApi.md#json_form_data) | **get** /fake/jsonFormData | test json serialization of form data -*FakeApi* | [**json_patch**](docs/apis/tags/FakeApi.md#json_patch) | **patch** /fake/jsonPatch | json patch -*FakeApi* | [**json_with_charset**](docs/apis/tags/FakeApi.md#json_with_charset) | **post** /fake/jsonWithCharset | json with charset tx and rx -*FakeApi* | [**mammal**](docs/apis/tags/FakeApi.md#mammal) | **post** /fake/refs/mammal | -*FakeApi* | [**number_with_validations**](docs/apis/tags/FakeApi.md#number_with_validations) | **post** /fake/refs/number | -*FakeApi* | [**object_in_query**](docs/apis/tags/FakeApi.md#object_in_query) | **get** /fake/objInQuery | user list -*FakeApi* | [**object_model_with_ref_props**](docs/apis/tags/FakeApi.md#object_model_with_ref_props) | **post** /fake/refs/object_model_with_ref_props | -*FakeApi* | [**parameter_collisions**](docs/apis/tags/FakeApi.md#parameter_collisions) | **post** /fake/parameterCollisions/{1}/{aB}/{Ab}/{self}/{A-B}/ | parameter collision case -*FakeApi* | [**query_param_with_json_content_type**](docs/apis/tags/FakeApi.md#query_param_with_json_content_type) | **get** /fake/queryParamWithJsonContentType | query param with json content-type -*FakeApi* | [**query_parameter_collection_format**](docs/apis/tags/FakeApi.md#query_parameter_collection_format) | **put** /fake/test-query-paramters | -*FakeApi* | [**ref_object_in_query**](docs/apis/tags/FakeApi.md#ref_object_in_query) | **get** /fake/refObjInQuery | user list -*FakeApi* | [**response_without_schema**](docs/apis/tags/FakeApi.md#response_without_schema) | **get** /fake/responseWithoutSchema | receives a response without schema -*FakeApi* | [**string**](docs/apis/tags/FakeApi.md#string) | **post** /fake/refs/string | -*FakeApi* | [**string_enum**](docs/apis/tags/FakeApi.md#string_enum) | **post** /fake/refs/enum | -*FakeApi* | [**upload_download_file**](docs/apis/tags/FakeApi.md#upload_download_file) | **post** /fake/uploadDownloadFile | uploads a file and downloads a file using application/octet-stream -*FakeApi* | [**upload_file**](docs/apis/tags/FakeApi.md#upload_file) | **post** /fake/uploadFile | uploads a file using multipart/form-data -*FakeApi* | [**upload_files**](docs/apis/tags/FakeApi.md#upload_files) | **post** /fake/uploadFiles | uploads files using multipart/form-data -*FakeClassnameTags123Api* | [**classname**](docs/apis/tags/FakeClassnameTags123Api.md#classname) | **patch** /fake_classname_test | To test class name in snake case -*PetApi* | [**add_pet**](docs/apis/tags/PetApi.md#add_pet) | **post** /pet | Add a new pet to the store -*PetApi* | [**delete_pet**](docs/apis/tags/PetApi.md#delete_pet) | **delete** /pet/{petId} | Deletes a pet -*PetApi* | [**find_pets_by_status**](docs/apis/tags/PetApi.md#find_pets_by_status) | **get** /pet/findByStatus | Finds Pets by status -*PetApi* | [**find_pets_by_tags**](docs/apis/tags/PetApi.md#find_pets_by_tags) | **get** /pet/findByTags | Finds Pets by tags -*PetApi* | [**get_pet_by_id**](docs/apis/tags/PetApi.md#get_pet_by_id) | **get** /pet/{petId} | Find pet by ID -*PetApi* | [**update_pet**](docs/apis/tags/PetApi.md#update_pet) | **put** /pet | Update an existing pet -*PetApi* | [**update_pet_with_form**](docs/apis/tags/PetApi.md#update_pet_with_form) | **post** /pet/{petId} | Updates a pet in the store with form data -*PetApi* | [**upload_file_with_required_file**](docs/apis/tags/PetApi.md#upload_file_with_required_file) | **post** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) -*PetApi* | [**upload_image**](docs/apis/tags/PetApi.md#upload_image) | **post** /pet/{petId}/uploadImage | uploads an image -*StoreApi* | [**delete_order**](docs/apis/tags/StoreApi.md#delete_order) | **delete** /store/order/{order_id} | Delete purchase order by ID -*StoreApi* | [**get_inventory**](docs/apis/tags/StoreApi.md#get_inventory) | **get** /store/inventory | Returns pet inventories by status -*StoreApi* | [**get_order_by_id**](docs/apis/tags/StoreApi.md#get_order_by_id) | **get** /store/order/{order_id} | Find purchase order by ID -*StoreApi* | [**place_order**](docs/apis/tags/StoreApi.md#place_order) | **post** /store/order | Place an order for a pet -*UserApi* | [**create_user**](docs/apis/tags/UserApi.md#create_user) | **post** /user | Create user -*UserApi* | [**create_users_with_array_input**](docs/apis/tags/UserApi.md#create_users_with_array_input) | **post** /user/createWithArray | Creates list of users with given input array -*UserApi* | [**create_users_with_list_input**](docs/apis/tags/UserApi.md#create_users_with_list_input) | **post** /user/createWithList | Creates list of users with given input array -*UserApi* | [**delete_user**](docs/apis/tags/UserApi.md#delete_user) | **delete** /user/{username} | Delete user -*UserApi* | [**get_user_by_name**](docs/apis/tags/UserApi.md#get_user_by_name) | **get** /user/{username} | Get user by user name -*UserApi* | [**login_user**](docs/apis/tags/UserApi.md#login_user) | **get** /user/login | Logs user into the system -*UserApi* | [**logout_user**](docs/apis/tags/UserApi.md#logout_user) | **get** /user/logout | Logs out current logged in user session -*UserApi* | [**update_user**](docs/apis/tags/UserApi.md#update_user) | **put** /user/{username} | Updated user - -## Documentation For Models - - - [AbstractStepMessage](docs/models/AbstractStepMessage.md) - - [AdditionalPropertiesClass](docs/models/AdditionalPropertiesClass.md) - - [AdditionalPropertiesValidator](docs/models/AdditionalPropertiesValidator.md) - - [AdditionalPropertiesWithArrayOfEnums](docs/models/AdditionalPropertiesWithArrayOfEnums.md) - - [Address](docs/models/Address.md) - - [Animal](docs/models/Animal.md) - - [AnimalFarm](docs/models/AnimalFarm.md) - - [AnyTypeAndFormat](docs/models/AnyTypeAndFormat.md) - - [AnyTypeNotString](docs/models/AnyTypeNotString.md) - - [ApiResponse](docs/models/ApiResponse.md) - - [Apple](docs/models/Apple.md) - - [AppleReq](docs/models/AppleReq.md) - - [ArrayHoldingAnyType](docs/models/ArrayHoldingAnyType.md) - - [ArrayOfArrayOfNumberOnly](docs/models/ArrayOfArrayOfNumberOnly.md) - - [ArrayOfEnums](docs/models/ArrayOfEnums.md) - - [ArrayOfNumberOnly](docs/models/ArrayOfNumberOnly.md) - - [ArrayTest](docs/models/ArrayTest.md) - - [ArrayWithValidationsInItems](docs/models/ArrayWithValidationsInItems.md) - - [Banana](docs/models/Banana.md) - - [BananaReq](docs/models/BananaReq.md) - - [Bar](docs/models/Bar.md) - - [BasquePig](docs/models/BasquePig.md) - - [Boolean](docs/models/Boolean.md) - - [BooleanEnum](docs/models/BooleanEnum.md) - - [Capitalization](docs/models/Capitalization.md) - - [Cat](docs/models/Cat.md) - - [Category](docs/models/Category.md) - - [ChildCat](docs/models/ChildCat.md) - - [ClassModel](docs/models/ClassModel.md) - - [Client](docs/models/Client.md) - - [ComplexQuadrilateral](docs/models/ComplexQuadrilateral.md) - - [ComposedAnyOfDifferentTypesNoValidations](docs/models/ComposedAnyOfDifferentTypesNoValidations.md) - - [ComposedArray](docs/models/ComposedArray.md) - - [ComposedBool](docs/models/ComposedBool.md) - - [ComposedNone](docs/models/ComposedNone.md) - - [ComposedNumber](docs/models/ComposedNumber.md) - - [ComposedObject](docs/models/ComposedObject.md) - - [ComposedOneOfDifferentTypes](docs/models/ComposedOneOfDifferentTypes.md) - - [ComposedString](docs/models/ComposedString.md) - - [Currency](docs/models/Currency.md) - - [DanishPig](docs/models/DanishPig.md) - - [DateTimeTest](docs/models/DateTimeTest.md) - - [DateTimeWithValidations](docs/models/DateTimeWithValidations.md) - - [DateWithValidations](docs/models/DateWithValidations.md) - - [DecimalPayload](docs/models/DecimalPayload.md) - - [Dog](docs/models/Dog.md) - - [Drawing](docs/models/Drawing.md) - - [EnumArrays](docs/models/EnumArrays.md) - - [EnumClass](docs/models/EnumClass.md) - - [EnumTest](docs/models/EnumTest.md) - - [EquilateralTriangle](docs/models/EquilateralTriangle.md) - - [File](docs/models/File.md) - - [FileSchemaTestClass](docs/models/FileSchemaTestClass.md) - - [Foo](docs/models/Foo.md) - - [FormatTest](docs/models/FormatTest.md) - - [FromSchema](docs/models/FromSchema.md) - - [Fruit](docs/models/Fruit.md) - - [FruitReq](docs/models/FruitReq.md) - - [GmFruit](docs/models/GmFruit.md) - - [GrandparentAnimal](docs/models/GrandparentAnimal.md) - - [HasOnlyReadOnly](docs/models/HasOnlyReadOnly.md) - - [HealthCheckResult](docs/models/HealthCheckResult.md) - - [IntegerEnum](docs/models/IntegerEnum.md) - - [IntegerEnumBig](docs/models/IntegerEnumBig.md) - - [IntegerEnumOneValue](docs/models/IntegerEnumOneValue.md) - - [IntegerEnumWithDefaultValue](docs/models/IntegerEnumWithDefaultValue.md) - - [IntegerMax10](docs/models/IntegerMax10.md) - - [IntegerMin15](docs/models/IntegerMin15.md) - - [IsoscelesTriangle](docs/models/IsoscelesTriangle.md) - - [JSONPatchRequest](docs/models/JSONPatchRequest.md) - - [JSONPatchRequestAddReplaceTest](docs/models/JSONPatchRequestAddReplaceTest.md) - - [JSONPatchRequestMoveCopy](docs/models/JSONPatchRequestMoveCopy.md) - - [JSONPatchRequestRemove](docs/models/JSONPatchRequestRemove.md) - - [Mammal](docs/models/Mammal.md) - - [MapTest](docs/models/MapTest.md) - - [MixedPropertiesAndAdditionalPropertiesClass](docs/models/MixedPropertiesAndAdditionalPropertiesClass.md) - - [Model200Response](docs/models/Model200Response.md) - - [ModelReturn](docs/models/ModelReturn.md) - - [Money](docs/models/Money.md) - - [Name](docs/models/Name.md) - - [NoAdditionalProperties](docs/models/NoAdditionalProperties.md) - - [NullableClass](docs/models/NullableClass.md) - - [NullableShape](docs/models/NullableShape.md) - - [NullableString](docs/models/NullableString.md) - - [Number](docs/models/Number.md) - - [NumberOnly](docs/models/NumberOnly.md) - - [NumberWithValidations](docs/models/NumberWithValidations.md) - - [ObjectInterface](docs/models/ObjectInterface.md) - - [ObjectModelWithArgAndArgsProperties](docs/models/ObjectModelWithArgAndArgsProperties.md) - - [ObjectModelWithRefProps](docs/models/ObjectModelWithRefProps.md) - - [ObjectWithAllOfWithReqTestPropFromUnsetAddProp](docs/models/ObjectWithAllOfWithReqTestPropFromUnsetAddProp.md) - - [ObjectWithDecimalProperties](docs/models/ObjectWithDecimalProperties.md) - - [ObjectWithDifficultlyNamedProps](docs/models/ObjectWithDifficultlyNamedProps.md) - - [ObjectWithInlineCompositionProperty](docs/models/ObjectWithInlineCompositionProperty.md) - - [ObjectWithInvalidNamedRefedProperties](docs/models/ObjectWithInvalidNamedRefedProperties.md) - - [ObjectWithOptionalTestProp](docs/models/ObjectWithOptionalTestProp.md) - - [ObjectWithValidations](docs/models/ObjectWithValidations.md) - - [Order](docs/models/Order.md) - - [ParentPet](docs/models/ParentPet.md) - - [Pet](docs/models/Pet.md) - - [Pig](docs/models/Pig.md) - - [Player](docs/models/Player.md) - - [Quadrilateral](docs/models/Quadrilateral.md) - - [QuadrilateralInterface](docs/models/QuadrilateralInterface.md) - - [ReadOnlyFirst](docs/models/ReadOnlyFirst.md) - - [ScaleneTriangle](docs/models/ScaleneTriangle.md) - - [Shape](docs/models/Shape.md) - - [ShapeOrNull](docs/models/ShapeOrNull.md) - - [SimpleQuadrilateral](docs/models/SimpleQuadrilateral.md) - - [SomeObject](docs/models/SomeObject.md) - - [SpecialModelName](docs/models/SpecialModelName.md) - - [String](docs/models/String.md) - - [StringBooleanMap](docs/models/StringBooleanMap.md) - - [StringEnum](docs/models/StringEnum.md) - - [StringEnumWithDefaultValue](docs/models/StringEnumWithDefaultValue.md) - - [StringWithValidation](docs/models/StringWithValidation.md) - - [Tag](docs/models/Tag.md) - - [Triangle](docs/models/Triangle.md) - - [TriangleInterface](docs/models/TriangleInterface.md) - - [UUIDString](docs/models/UUIDString.md) - - [User](docs/models/User.md) - - [Whale](docs/models/Whale.md) - - [Zebra](docs/models/Zebra.md) - -## Documentation For Authorization - - -## api_key - -- **Type**: API key -- **API key parameter name**: api_key -- **Location**: HTTP header - - -## api_key_query - -- **Type**: API key -- **API key parameter name**: api_key_query -- **Location**: URL query string - - -## bearer_test - -- **Type**: Bearer authentication (JWT) - - -## http_basic_test - -- **Type**: HTTP basic authentication - - -## http_signature_test - -- **Type**: HTTP signature authentication - - Authentication schemes defined for the API: -## petstore_auth - -- **Type**: OAuth -- **Flow**: implicit -- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog -- **Scopes**: - - **write:pets**: modify pets in your account - - **read:pets**: read your pets - - -## Author - - - - - - - +## Servers +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](docs/servers/server_0.md) | petstore server +1 | [Server1](docs/servers/server_1.md) | The local server +2 | [Server2](docs/servers/server_2.md) | staging server with no variables + +## Endpoints + +All URIs are relative to the selected server +- The server is selected by passing in server_info and server_index into api_configuration.ApiConfiguration +- Code samples in endpoints documents show how to do this +- server_index can also be passed in to endpoint calls, see endpoint documentation + +HTTP request | Method | Description +------------ | ------ | ------------- +/another-fake/dummy **patch** | [AnotherFakeApi](docs/apis/tags/another_fake_api.md).[call_123_test__special_tags](docs/paths/another_fake_dummy/patch.md) | To test special tags +/fake **delete** | [FakeApi](docs/apis/tags/fake_api.md).[group_parameters](docs/paths/fake/delete.md) | Fake endpoint to test group parameters (optional) +/fake **get** | [FakeApi](docs/apis/tags/fake_api.md).[enum_parameters](docs/paths/fake/get.md) | To test enum parameters +/fake **patch** | [FakeApi](docs/apis/tags/fake_api.md).[client_model](docs/paths/fake/patch.md) | To test \"client\" model +/fake **post** | [FakeApi](docs/apis/tags/fake_api.md).[endpoint_parameters](docs/paths/fake/post.md) | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +/fake/additional-properties-with-array-of-enums **get** | [FakeApi](docs/apis/tags/fake_api.md).[additional_properties_with_array_of_enums](docs/paths/fake_additional_properties_with_array_of_enums/get.md) | Additional Properties with Array of Enums +/fake/body-with-file-schema **put** | [FakeApi](docs/apis/tags/fake_api.md).[body_with_file_schema](docs/paths/fake_body_with_file_schema/put.md) | +/fake/body-with-query-params **put** | [FakeApi](docs/apis/tags/fake_api.md).[body_with_query_params](docs/paths/fake_body_with_query_params/put.md) | +/fake/case-sensitive-params **put** | [FakeApi](docs/apis/tags/fake_api.md).[case_sensitive_params](docs/paths/fake_case_sensitive_params/put.md) | +/fake/deleteCoffee/{id} **delete** | [FakeApi](docs/apis/tags/fake_api.md).[delete_coffee](docs/paths/fake_delete_coffee_id/delete.md) | Delete coffee +/fake/health **get** | [FakeApi](docs/apis/tags/fake_api.md).[fake_health_get](docs/paths/fake_health/get.md) | Health check endpoint +/fake/inline-additionalProperties **post** | [FakeApi](docs/apis/tags/fake_api.md).[inline_additional_properties](docs/paths/fake_inline_additional_properties/post.md) | test inline additionalProperties +/fake/inlineComposition/ **post** | [FakeApi](docs/apis/tags/fake_api.md).[inline_composition](docs/paths/fake_inline_composition/post.md) | testing composed schemas at inline locations +/fake/jsonFormData **get** | [FakeApi](docs/apis/tags/fake_api.md).[json_form_data](docs/paths/fake_json_form_data/get.md) | test json serialization of form data +/fake/jsonPatch **patch** | [FakeApi](docs/apis/tags/fake_api.md).[json_patch](docs/paths/fake_json_patch/patch.md) | json patch +/fake/jsonWithCharset **post** | [FakeApi](docs/apis/tags/fake_api.md).[json_with_charset](docs/paths/fake_json_with_charset/post.md) | json with charset tx and rx +/fake/multipleResponseBodies **get** | [FakeApi](docs/apis/tags/fake_api.md).[multiple_response_bodies](docs/paths/fake_multiple_response_bodies/get.md) | multiple responses have response bodies +/fake/multipleSecurities **get** | [FakeApi](docs/apis/tags/fake_api.md).[multiple_securities](docs/paths/fake_multiple_securities/get.md) | multiple security requirements +/fake/objInQuery **get** | [FakeApi](docs/apis/tags/fake_api.md).[object_in_query](docs/paths/fake_obj_in_query/get.md) | user list +/fake/parameterCollisions/{1}/{aB}/{Ab}/{self}/{A-B}/ **post** | [FakeApi](docs/apis/tags/fake_api.md).[parameter_collisions](docs/paths/fake_parameter_collisions1_abab_self_ab/post.md) | parameter collision case +/fake/queryParamWithJsonContentType **get** | [FakeApi](docs/apis/tags/fake_api.md).[query_param_with_json_content_type](docs/paths/fake_query_param_with_json_content_type/get.md) | query param with json content-type +/fake/redirection **get** | [FakeApi](docs/apis/tags/fake_api.md).[redirection](docs/paths/fake_redirection/get.md) | operation with redirection responses +/fake/refObjInQuery **get** | [FakeApi](docs/apis/tags/fake_api.md).[ref_object_in_query](docs/paths/fake_ref_obj_in_query/get.md) | user list +/fake/refs/array-of-enums **post** | [FakeApi](docs/apis/tags/fake_api.md).[array_of_enums](docs/paths/fake_refs_array_of_enums/post.md) | Array of Enums +/fake/refs/arraymodel **post** | [FakeApi](docs/apis/tags/fake_api.md).[array_model](docs/paths/fake_refs_arraymodel/post.md) | +/fake/refs/boolean **post** | [FakeApi](docs/apis/tags/fake_api.md).[boolean](docs/paths/fake_refs_boolean/post.md) | +/fake/refs/composed_one_of_number_with_validations **post** | [FakeApi](docs/apis/tags/fake_api.md).[composed_one_of_different_types](docs/paths/fake_refs_composed_one_of_number_with_validations/post.md) | +/fake/refs/enum **post** | [FakeApi](docs/apis/tags/fake_api.md).[string_enum](docs/paths/fake_refs_enum/post.md) | +/fake/refs/mammal **post** | [FakeApi](docs/apis/tags/fake_api.md).[mammal](docs/paths/fake_refs_mammal/post.md) | +/fake/refs/number **post** | [FakeApi](docs/apis/tags/fake_api.md).[number_with_validations](docs/paths/fake_refs_number/post.md) | +/fake/refs/object_model_with_ref_props **post** | [FakeApi](docs/apis/tags/fake_api.md).[object_model_with_ref_props](docs/paths/fake_refs_object_model_with_ref_props/post.md) | +/fake/refs/string **post** | [FakeApi](docs/apis/tags/fake_api.md).[string](docs/paths/fake_refs_string/post.md) | +/fake/responseWithoutSchema **get** | [FakeApi](docs/apis/tags/fake_api.md).[response_without_schema](docs/paths/fake_response_without_schema/get.md) | receives a response without schema +/fake/test-query-paramters **put** | [FakeApi](docs/apis/tags/fake_api.md).[query_parameter_collection_format](docs/paths/fake_test_query_paramters/put.md) | +/fake/uploadDownloadFile **post** | [FakeApi](docs/apis/tags/fake_api.md).[upload_download_file](docs/paths/fake_upload_download_file/post.md) | uploads a file and downloads a file using application/octet-stream +/fake/uploadFile **post** | [FakeApi](docs/apis/tags/fake_api.md).[upload_file](docs/paths/fake_upload_file/post.md) | uploads a file using multipart/form-data +/fake/uploadFiles **post** | [FakeApi](docs/apis/tags/fake_api.md).[upload_files](docs/paths/fake_upload_files/post.md) | uploads files using multipart/form-data +/fake/wildCardResponses **get** | [FakeApi](docs/apis/tags/fake_api.md).[wild_card_responses](docs/paths/fake_wild_card_responses/get.md) | operation with wildcard responses +/fake/{petId}/uploadImageWithRequiredFile **post** | [PetApi](docs/apis/tags/pet_api.md).[upload_file_with_required_file](docs/paths/fake_pet_id_upload_image_with_required_file/post.md) | uploads an image (required) +/fake_classname_test **patch** | [FakeClassnameTags123Api](docs/apis/tags/fake_classname_tags123_api.md).[classname](docs/paths/fake_classname_test/patch.md) | To test class name in snake case +/foo **get** | [DefaultApi](docs/apis/tags/default_api.md).[foo_get](docs/paths/foo/get.md) | +/pet **post** | [PetApi](docs/apis/tags/pet_api.md).[add_pet](docs/paths/pet/post.md) | Add a new pet to the store +/pet **put** | [PetApi](docs/apis/tags/pet_api.md).[update_pet](docs/paths/pet/put.md) | Update an existing pet +/pet/findByStatus **get** | [PetApi](docs/apis/tags/pet_api.md).[find_pets_by_status](docs/paths/pet_find_by_status/get.md) | Finds Pets by status +/pet/findByTags **get** | [PetApi](docs/apis/tags/pet_api.md).[find_pets_by_tags](docs/paths/pet_find_by_tags/get.md) | Finds Pets by tags +/pet/{petId} **delete** | [PetApi](docs/apis/tags/pet_api.md).[delete_pet](docs/paths/pet_pet_id/delete.md) | Deletes a pet +/pet/{petId} **get** | [PetApi](docs/apis/tags/pet_api.md).[get_pet_by_id](docs/paths/pet_pet_id/get.md) | Find pet by ID +/pet/{petId} **post** | [PetApi](docs/apis/tags/pet_api.md).[update_pet_with_form](docs/paths/pet_pet_id/post.md) | Updates a pet in the store with form data +/pet/{petId}/uploadImage **post** | [PetApi](docs/apis/tags/pet_api.md).[upload_image](docs/paths/pet_pet_id_upload_image/post.md) | uploads an image +/store/inventory **get** | [StoreApi](docs/apis/tags/store_api.md).[get_inventory](docs/paths/store_inventory/get.md) | Returns pet inventories by status +/store/order **post** | [StoreApi](docs/apis/tags/store_api.md).[place_order](docs/paths/store_order/post.md) | Place an order for a pet +/store/order/{order_id} **delete** | [StoreApi](docs/apis/tags/store_api.md).[delete_order](docs/paths/store_order_order_id/delete.md) | Delete purchase order by ID +/store/order/{order_id} **get** | [StoreApi](docs/apis/tags/store_api.md).[get_order_by_id](docs/paths/store_order_order_id/get.md) | Find purchase order by ID +/user **post** | [UserApi](docs/apis/tags/user_api.md).[create_user](docs/paths/user/post.md) | Create user +/user/createWithArray **post** | [UserApi](docs/apis/tags/user_api.md).[create_users_with_array_input](docs/paths/user_create_with_array/post.md) | Creates list of users with given input array +/user/createWithList **post** | [UserApi](docs/apis/tags/user_api.md).[create_users_with_list_input](docs/paths/user_create_with_list/post.md) | Creates list of users with given input array +/user/login **get** | [UserApi](docs/apis/tags/user_api.md).[login_user](docs/paths/user_login/get.md) | Logs user into the system +/user/logout **get** | [UserApi](docs/apis/tags/user_api.md).[logout_user](docs/paths/user_logout/get.md) | Logs out current logged in user session +/user/{username} **delete** | [UserApi](docs/apis/tags/user_api.md).[delete_user](docs/paths/user_username/delete.md) | Delete user +/user/{username} **get** | [UserApi](docs/apis/tags/user_api.md).[get_user_by_name](docs/paths/user_username/get.md) | Get user by user name +/user/{username} **put** | [UserApi](docs/apis/tags/user_api.md).[update_user](docs/paths/user_username/put.md) | Updated user + +## Component Schemas + +Class | Description +----- | ------------ +[_200Response](docs/components/schema/_200_response.md) | model with an invalid class name for python, starts with a number +[AbstractStepMessage](docs/components/schema/abstract_step_message.md) | Abstract Step +[AdditionalPropertiesClass](docs/components/schema/additional_properties_class.md) | +[AdditionalPropertiesValidator](docs/components/schema/additional_properties_validator.md) | +[AdditionalPropertiesWithArrayOfEnums](docs/components/schema/additional_properties_with_array_of_enums.md) | +[Address](docs/components/schema/address.md) | +[Animal](docs/components/schema/animal.md) | +[AnimalFarm](docs/components/schema/animal_farm.md) | +[AnyTypeAndFormat](docs/components/schema/any_type_and_format.md) | +[AnyTypeNotString](docs/components/schema/any_type_not_string.md) | +[ApiResponse](docs/components/schema/api_response.md) | +[ArrayHoldingAnyType](docs/components/schema/array_holding_any_type.md) | +[ArrayOfArrayOfNumberOnly](docs/components/schema/array_of_array_of_number_only.md) | +[ArrayOfEnums](docs/components/schema/array_of_enums.md) | +[ArrayOfNumberOnly](docs/components/schema/array_of_number_only.md) | +[ArrayTest](docs/components/schema/array_test.md) | +[ArrayWithValidationsInItems](docs/components/schema/array_with_validations_in_items.md) | +[Bar](docs/components/schema/bar.md) | +[BasquePig](docs/components/schema/basque_pig.md) | +[Boolean](docs/components/schema/boolean.md) | +[BooleanEnum](docs/components/schema/boolean_enum.md) | +[Capitalization](docs/components/schema/capitalization.md) | +[Cat](docs/components/schema/cat.md) | +[Category](docs/components/schema/category.md) | +[ChildCat](docs/components/schema/child_cat.md) | +[ClassModel](docs/components/schema/class_model.md) | Model for testing model with \"_class\" property +[Client](docs/components/schema/client.md) | +[ComplexQuadrilateral](docs/components/schema/complex_quadrilateral.md) | +[ComposedAnyOfDifferentTypesNoValidations](docs/components/schema/composed_any_of_different_types_no_validations.md) | +[ComposedArray](docs/components/schema/composed_array.md) | +[ComposedBool](docs/components/schema/composed_bool.md) | +[ComposedNone](docs/components/schema/composed_none.md) | +[ComposedNumber](docs/components/schema/composed_number.md) | +[ComposedObject](docs/components/schema/composed_object.md) | +[ComposedOneOfDifferentTypes](docs/components/schema/composed_one_of_different_types.md) | this is a model that allows payloads of type object or number +[ComposedString](docs/components/schema/composed_string.md) | +[Currency](docs/components/schema/currency.md) | +[DanishPig](docs/components/schema/danish_pig.md) | +[DateTimeTest](docs/components/schema/date_time_test.md) | +[DateTimeWithValidations](docs/components/schema/date_time_with_validations.md) | +[DateWithValidations](docs/components/schema/date_with_validations.md) | +[DecimalPayload](docs/components/schema/decimal_payload.md) | +[Dog](docs/components/schema/dog.md) | +[Drawing](docs/components/schema/drawing.md) | +[EnumArrays](docs/components/schema/enum_arrays.md) | +[EnumClass](docs/components/schema/enum_class.md) | +[EnumTest](docs/components/schema/enum_test.md) | +[EquilateralTriangle](docs/components/schema/equilateral_triangle.md) | +[File](docs/components/schema/file.md) | Must be named `File` for test. +[FileSchemaTestClass](docs/components/schema/file_schema_test_class.md) | +[Foo](docs/components/schema/foo.md) | +[FormatTest](docs/components/schema/format_test.md) | +[FromSchema](docs/components/schema/from_schema.md) | +[GrandparentAnimal](docs/components/schema/grandparent_animal.md) | +[HealthCheckResult](docs/components/schema/health_check_result.md) | Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. +[IntegerEnum](docs/components/schema/integer_enum.md) | +[IntegerEnumBig](docs/components/schema/integer_enum_big.md) | +[IntegerEnumOneValue](docs/components/schema/integer_enum_one_value.md) | +[IntegerEnumWithDefaultValue](docs/components/schema/integer_enum_with_default_value.md) | +[IntegerMax10](docs/components/schema/integer_max10.md) | +[IntegerMin15](docs/components/schema/integer_min15.md) | +[IsoscelesTriangle](docs/components/schema/isosceles_triangle.md) | +[Items](docs/components/schema/items.md) | component's name collides with the inner schema name +[JSONPatchRequest](docs/components/schema/json_patch_request.md) | +[JSONPatchRequestAddReplaceTest](docs/components/schema/json_patch_request_add_replace_test.md) | +[JSONPatchRequestMoveCopy](docs/components/schema/json_patch_request_move_copy.md) | +[JSONPatchRequestRemove](docs/components/schema/json_patch_request_remove.md) | +[MapTest](docs/components/schema/map_test.md) | +[MixedPropertiesAndAdditionalPropertiesClass](docs/components/schema/mixed_properties_and_additional_properties_class.md) | +[Money](docs/components/schema/money.md) | +[Name](docs/components/schema/name.md) | Model for testing model name same as property name +[NoAdditionalProperties](docs/components/schema/no_additional_properties.md) | +[NullableClass](docs/components/schema/nullable_class.md) | +[NullableShape](docs/components/schema/nullable_shape.md) | The value may be a shape or the 'null' value. For a composed schema to validate a null payload, one of its chosen oneOf schemas must be type null or nullable (introduced in OAS schema >= 3.0) +[NullableString](docs/components/schema/nullable_string.md) | +[Number](docs/components/schema/number.md) | +[NumberOnly](docs/components/schema/number_only.md) | +[NumberWithValidations](docs/components/schema/number_with_validations.md) | +[ObjectInterface](docs/components/schema/object_interface.md) | +[ObjectModelWithArgAndArgsProperties](docs/components/schema/object_model_with_arg_and_args_properties.md) | +[ObjectModelWithRefProps](docs/components/schema/object_model_with_ref_props.md) | a model that includes properties which should stay primitive (String + Boolean) and one which is defined as a class, NumberWithValidations +[ObjectWithAllOfWithReqTestPropFromUnsetAddProp](docs/components/schema/object_with_all_of_with_req_test_prop_from_unset_add_prop.md) | +[ObjectWithCollidingProperties](docs/components/schema/object_with_colliding_properties.md) | component with properties that have name collisions +[ObjectWithDecimalProperties](docs/components/schema/object_with_decimal_properties.md) | +[ObjectWithDifficultlyNamedProps](docs/components/schema/object_with_difficultly_named_props.md) | model with properties that have invalid names for python +[ObjectWithInlineCompositionProperty](docs/components/schema/object_with_inline_composition_property.md) | +[ObjectWithInvalidNamedRefedProperties](docs/components/schema/object_with_invalid_named_refed_properties.md) | +[ObjectWithOptionalTestProp](docs/components/schema/object_with_optional_test_prop.md) | +[ObjectWithValidations](docs/components/schema/object_with_validations.md) | +[Order](docs/components/schema/order.md) | +[ParentPet](docs/components/schema/parent_pet.md) | +[Pet](docs/components/schema/pet.md) | Pet object that needs to be added to the store +[Pig](docs/components/schema/pig.md) | +[Player](docs/components/schema/player.md) | a model that includes a self reference this forces properties and additionalProperties to be lazy loaded in python models because the Player class has not fully loaded when defining properties +[Quadrilateral](docs/components/schema/quadrilateral.md) | +[QuadrilateralInterface](docs/components/schema/quadrilateral_interface.md) | +[ReadOnlyFirst](docs/components/schema/read_only_first.md) | +[RefPet](docs/components/schema/ref_pet.md) | +[ReqPropsFromExplicitAddProps](docs/components/schema/req_props_from_explicit_add_props.md) | +[ReqPropsFromTrueAddProps](docs/components/schema/req_props_from_true_add_props.md) | +[ReqPropsFromUnsetAddProps](docs/components/schema/req_props_from_unset_add_props.md) | +[_Return](docs/components/schema/_return.md) | Model for testing reserved words +[ScaleneTriangle](docs/components/schema/scalene_triangle.md) | +[SelfReferencingArrayModel](docs/components/schema/self_referencing_array_model.md) | +[SelfReferencingObjectModel](docs/components/schema/self_referencing_object_model.md) | +[Shape](docs/components/schema/shape.md) | +[ShapeOrNull](docs/components/schema/shape_or_null.md) | The value may be a shape or the 'null' value. This is introduced in OAS schema >= 3.1. +[SimpleQuadrilateral](docs/components/schema/simple_quadrilateral.md) | +[SomeObject](docs/components/schema/some_object.md) | +[String](docs/components/schema/string.md) | +[StringBooleanMap](docs/components/schema/string_boolean_map.md) | +[StringEnum](docs/components/schema/string_enum.md) | +[StringEnumWithDefaultValue](docs/components/schema/string_enum_with_default_value.md) | +[StringWithValidation](docs/components/schema/string_with_validation.md) | +[Tag](docs/components/schema/tag.md) | +[Triangle](docs/components/schema/triangle.md) | +[TriangleInterface](docs/components/schema/triangle_interface.md) | +[UUIDString](docs/components/schema/uuid_string.md) | +[User](docs/components/schema/user.md) | +[SpecialModelName](docs/components/schema/special_model_name.md) | model with an invalid class name for python +[Apple](docs/components/schema/apple.md) | +[AppleReq](docs/components/schema/apple_req.md) | +[Banana](docs/components/schema/banana.md) | +[BananaReq](docs/components/schema/banana_req.md) | +[Fruit](docs/components/schema/fruit.md) | +[FruitReq](docs/components/schema/fruit_req.md) | +[GmFruit](docs/components/schema/gm_fruit.md) | +[HasOnlyReadOnly](docs/components/schema/has_only_read_only.md) | +[Mammal](docs/components/schema/mammal.md) | +[Whale](docs/components/schema/whale.md) | +[Zebra](docs/components/schema/zebra.md) | + +## Component RequestBodies + +Class | Description +----- | ------------ +[Client](docs/components/request_bodies/request_body_client.md) | client model +[Pet](docs/components/request_bodies/request_body_pet.md) | Pet object that needs to be added to the store, multiple content types +[RefUserArray](docs/components/request_bodies/request_body_ref_user_array.md) | +[UserArray](docs/components/request_bodies/request_body_user_array.md) | List of user object + +## Component Responses + +Class | Description +----- | ------------ +[RefSuccessDescriptionOnly](docs/components/responses/response_ref_success_description_only.md) | +[RefSuccessfulXmlAndJsonArrayOfPet](docs/components/responses/response_ref_successful_xml_and_json_array_of_pet.md) | +[SuccessDescriptionOnly](docs/components/responses/response_success_description_only.md) | Success +[SuccessInlineContentAndHeader](docs/components/responses/response_success_inline_content_and_header.md) | successful operation +[SuccessWithJsonApiResponse](docs/components/responses/response_success_with_json_api_response.md) | successful operation +[SuccessfulXmlAndJsonArrayOfPet](docs/components/responses/response_successful_xml_and_json_array_of_pet.md) | successful operation, multiple content types + +## Component Headers + +Class | Description +----- | ------------ +[Int32JsonContentTypeHeader](docs/components/headers/header_int32_json_content_type_header.md) | int32 JSON content-type header +[NumberHeader](docs/components/headers/header_number_header.md) | number header description +[RefContentSchemaHeader](docs/components/headers/header_ref_content_schema_header.md) | int32 JSON content-type header +[RefSchemaHeader](docs/components/headers/header_ref_schema_header.md) | header that has a ref in the schema +[RefStringHeader](docs/components/headers/header_ref_string_header.md) | +[StringHeader](docs/components/headers/header_string_header.md) | string header description + +## Component Parameters + +Class | Description +----- | ------------ +[ComponentRefSchemaStringWithValidation](docs/components/parameters/parameter_component_ref_schema_string_with_validation.md) | a path string with validation +[PathUserName](docs/components/parameters/parameter_path_user_name.md) | the use name to use +[RefPathUserName](docs/components/parameters/parameter_ref_path_user_name.md) | +[RefSchemaStringWithValidation](docs/components/parameters/parameter_ref_schema_string_with_validation.md) | a path string with validation + +## Component SecuritySchemes + +Class | Description +----- | ------------ +[ApiKey](docs/components/security_schemes/security_scheme_api_key.md) | apiKey in header +[ApiKeyQuery](docs/components/security_schemes/security_scheme_api_key_query.md) | apiKey in query +[BearerTest](docs/components/security_schemes/security_scheme_bearer_test.md) | http bearer with JWT bearer format +[HttpBasicTest](docs/components/security_schemes/security_scheme_http_basic_test.md) | http basic +[HttpSignatureTest](docs/components/security_schemes/security_scheme_http_signature_test.md) | http + signature +[OpenIdConnectTest](docs/components/security_schemes/security_scheme_open_id_connect_test.md) | openIdConnect +[PetstoreAuth](docs/components/security_schemes/security_scheme_petstore_auth.md) | oauth2 implicit flow with two scopes ## Notes for Large OpenAPI documents -If the OpenAPI document is large, imports in petstore_api.apis and petstore_api.models may fail with a +If the OpenAPI document is large, imports in petstore_api.apis.tags.tag_to_api and petstore_api.components.schemas may fail with a RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions: Solution 1: Use specific imports for apis and models like: -- `from petstore_api.apis.default_api import DefaultApi` -- `from petstore_api.model.pet import Pet` +- tagged api: `from petstore_api.apis.tags.default_api import DefaultApi` +- api for one path: `from petstore_api.apis.paths.some_path import SomePath` +- api for one operation (path + verb): `from petstore_api.paths.some_path.get import ApiForget` +- single model import: `from petstore_api.components.schema.pet import Pet` -Solution 1: +Solution 2: Before importing the package, adjust the maximum recursion limit as shown below: ``` import sys sys.setrecursionlimit(1500) import petstore_api -from petstore_api.apis import * -from petstore_api.models import * +from petstore_api.apis.tags.tag_to_api import * +from petstore_api.components.schemas import * ``` diff --git a/samples/openapi3/client/petstore/python/dev-requirements.txt b/samples/openapi3/client/petstore/python/dev-requirements.txt deleted file mode 100644 index ccdfca62949..00000000000 --- a/samples/openapi3/client/petstore/python/dev-requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -tox -flake8 diff --git a/samples/openapi3/client/petstore/python/docs/apis/tags/AnotherFakeApi.md b/samples/openapi3/client/petstore/python/docs/apis/tags/AnotherFakeApi.md deleted file mode 100644 index 2a76dabc358..00000000000 --- a/samples/openapi3/client/petstore/python/docs/apis/tags/AnotherFakeApi.md +++ /dev/null @@ -1,93 +0,0 @@ - -# petstore_api.apis.tags.another_fake_api.AnotherFakeApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**call_123_test_special_tags**](#call_123_test_special_tags) | **patch** /another-fake/dummy | To test special tags - -# **call_123_test_special_tags** - -> Client call_123_test_special_tags(client) - -To test special tags - -To test special tags and operation ID starting with number - -### Example - -```python -import petstore_api -from petstore_api.apis.tags import another_fake_api -from petstore_api.model.client import Client -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = another_fake_api.AnotherFakeApi(api_client) - - # example passing only required values which don't have defaults set - body = Client( - client="client_example", - ) - try: - # To test special tags - api_response = api_instance.call_123_test_special_tags( - body=body, - ) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**Client**](../../models/Client.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#call_123_test_special_tags.ApiResponseFor200) | successful operation - -#### call_123_test_special_tags.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**Client**](../../models/Client.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/apis/tags/DefaultApi.md b/samples/openapi3/client/petstore/python/docs/apis/tags/DefaultApi.md deleted file mode 100644 index 768d80a1c35..00000000000 --- a/samples/openapi3/client/petstore/python/docs/apis/tags/DefaultApi.md +++ /dev/null @@ -1,76 +0,0 @@ - -# petstore_api.apis.tags.default_api.DefaultApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**foo_get**](#foo_get) | **get** /foo | - -# **foo_get** - -> {str: (bool, date, datetime, dict, float, int, list, str, none_type)} foo_get() - - - -### Example - -```python -import petstore_api -from petstore_api.apis.tags import default_api -from petstore_api.model.foo import Foo -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = default_api.DefaultApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.foo_get() - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling DefaultApi->foo_get: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -default | [ApiResponseForDefault](#foo_get.ApiResponseForDefault) | response - -#### foo_get.ApiResponseForDefault -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor0ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor0ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**string** | [**Foo**]({{complexTypePrefix}}Foo.md) | [**Foo**]({{complexTypePrefix}}Foo.md) | | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/apis/tags/FakeApi.md b/samples/openapi3/client/petstore/python/docs/apis/tags/FakeApi.md deleted file mode 100644 index a7b7c493a67..00000000000 --- a/samples/openapi3/client/petstore/python/docs/apis/tags/FakeApi.md +++ /dev/null @@ -1,3499 +0,0 @@ - -# petstore_api.apis.tags.fake_api.FakeApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**additional_properties_with_array_of_enums**](#additional_properties_with_array_of_enums) | **get** /fake/additional-properties-with-array-of-enums | Additional Properties with Array of Enums -[**array_model**](#array_model) | **post** /fake/refs/arraymodel | -[**array_of_enums**](#array_of_enums) | **post** /fake/refs/array-of-enums | Array of Enums -[**body_with_file_schema**](#body_with_file_schema) | **put** /fake/body-with-file-schema | -[**body_with_query_params**](#body_with_query_params) | **put** /fake/body-with-query-params | -[**boolean**](#boolean) | **post** /fake/refs/boolean | -[**case_sensitive_params**](#case_sensitive_params) | **put** /fake/case-sensitive-params | -[**client_model**](#client_model) | **patch** /fake | To test \"client\" model -[**composed_one_of_different_types**](#composed_one_of_different_types) | **post** /fake/refs/composed_one_of_number_with_validations | -[**delete_coffee**](#delete_coffee) | **delete** /fake/deleteCoffee/{id} | Delete coffee -[**endpoint_parameters**](#endpoint_parameters) | **post** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -[**enum_parameters**](#enum_parameters) | **get** /fake | To test enum parameters -[**fake_health_get**](#fake_health_get) | **get** /fake/health | Health check endpoint -[**group_parameters**](#group_parameters) | **delete** /fake | Fake endpoint to test group parameters (optional) -[**inline_additional_properties**](#inline_additional_properties) | **post** /fake/inline-additionalProperties | test inline additionalProperties -[**inline_composition**](#inline_composition) | **post** /fake/inlineComposition/ | testing composed schemas at inline locations -[**json_form_data**](#json_form_data) | **get** /fake/jsonFormData | test json serialization of form data -[**json_patch**](#json_patch) | **patch** /fake/jsonPatch | json patch -[**json_with_charset**](#json_with_charset) | **post** /fake/jsonWithCharset | json with charset tx and rx -[**mammal**](#mammal) | **post** /fake/refs/mammal | -[**number_with_validations**](#number_with_validations) | **post** /fake/refs/number | -[**object_in_query**](#object_in_query) | **get** /fake/objInQuery | user list -[**object_model_with_ref_props**](#object_model_with_ref_props) | **post** /fake/refs/object_model_with_ref_props | -[**parameter_collisions**](#parameter_collisions) | **post** /fake/parameterCollisions/{1}/{aB}/{Ab}/{self}/{A-B}/ | parameter collision case -[**query_param_with_json_content_type**](#query_param_with_json_content_type) | **get** /fake/queryParamWithJsonContentType | query param with json content-type -[**query_parameter_collection_format**](#query_parameter_collection_format) | **put** /fake/test-query-paramters | -[**ref_object_in_query**](#ref_object_in_query) | **get** /fake/refObjInQuery | user list -[**response_without_schema**](#response_without_schema) | **get** /fake/responseWithoutSchema | receives a response without schema -[**string**](#string) | **post** /fake/refs/string | -[**string_enum**](#string_enum) | **post** /fake/refs/enum | -[**upload_download_file**](#upload_download_file) | **post** /fake/uploadDownloadFile | uploads a file and downloads a file using application/octet-stream -[**upload_file**](#upload_file) | **post** /fake/uploadFile | uploads a file using multipart/form-data -[**upload_files**](#upload_files) | **post** /fake/uploadFiles | uploads files using multipart/form-data - -# **additional_properties_with_array_of_enums** - -> AdditionalPropertiesWithArrayOfEnums additional_properties_with_array_of_enums() - -Additional Properties with Array of Enums - -### Example - -```python -import petstore_api -from petstore_api.apis.tags import fake_api -from petstore_api.model.additional_properties_with_array_of_enums import AdditionalPropertiesWithArrayOfEnums -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - - # example passing only optional values - body = AdditionalPropertiesWithArrayOfEnums( - key=[ - EnumClass("-efg") - ], - ) - try: - # Additional Properties with Array of Enums - api_response = api_instance.additional_properties_with_array_of_enums( - body=body, - ) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->additional_properties_with_array_of_enums: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson, Unset] | optional, default is unset | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AdditionalPropertiesWithArrayOfEnums**](../../models/AdditionalPropertiesWithArrayOfEnums.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#additional_properties_with_array_of_enums.ApiResponseFor200) | Got object with additional properties with array of enums - -#### additional_properties_with_array_of_enums.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AdditionalPropertiesWithArrayOfEnums**](../../models/AdditionalPropertiesWithArrayOfEnums.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **array_model** - -> AnimalFarm array_model() - - - -Test serialization of ArrayModel - -### Example - -```python -import petstore_api -from petstore_api.apis.tags import fake_api -from petstore_api.model.animal_farm import AnimalFarm -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - - # example passing only optional values - body = AnimalFarm([ - Animal() - ]) - try: - api_response = api_instance.array_model( - body=body, - ) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->array_model: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson, Unset] | optional, default is unset | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AnimalFarm**](../../models/AnimalFarm.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#array_model.ApiResponseFor200) | Output model - -#### array_model.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**AnimalFarm**](../../models/AnimalFarm.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **array_of_enums** - -> ArrayOfEnums array_of_enums() - -Array of Enums - -### Example - -```python -import petstore_api -from petstore_api.apis.tags import fake_api -from petstore_api.model.array_of_enums import ArrayOfEnums -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - - # example passing only optional values - body = ArrayOfEnums([ - StringEnum("placed") - ]) - try: - # Array of Enums - api_response = api_instance.array_of_enums( - body=body, - ) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->array_of_enums: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson, Unset] | optional, default is unset | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**ArrayOfEnums**](../../models/ArrayOfEnums.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#array_of_enums.ApiResponseFor200) | Got named array of enums - -#### array_of_enums.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**ArrayOfEnums**](../../models/ArrayOfEnums.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **body_with_file_schema** - -> body_with_file_schema(file_schema_test_class) - - - -For this test, the body for this request much reference a schema named `File`. - -### Example - -```python -import petstore_api -from petstore_api.apis.tags import fake_api -from petstore_api.model.file_schema_test_class import FileSchemaTestClass -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - - # example passing only required values which don't have defaults set - body = FileSchemaTestClass( - file=File( - source_uri="source_uri_example", - ), - files=[ - File() - ], - ) - try: - api_response = api_instance.body_with_file_schema( - body=body, - ) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->body_with_file_schema: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**FileSchemaTestClass**](../../models/FileSchemaTestClass.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#body_with_file_schema.ApiResponseFor200) | Success - -#### body_with_file_schema.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **body_with_query_params** - -> body_with_query_params(queryuser) - - - -### Example - -```python -import petstore_api -from petstore_api.apis.tags import fake_api -from petstore_api.model.user import User -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - - # example passing only required values which don't have defaults set - query_params = { - 'query': "query_example", - } - body = User( - id=1, - username="username_example", - first_name="first_name_example", - last_name="last_name_example", - email="email_example", - password="password_example", - phone="phone_example", - user_status=1, - object_with_no_declared_props=dict(), - object_with_no_declared_props_nullable=dict(), - any_type_prop=None, - any_type_except_null_prop=None, - any_type_prop_nullable=None, - ) - try: - api_response = api_instance.body_with_query_params( - query_params=query_params, - body=body, - ) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->body_with_query_params: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -query_params | RequestQueryParams | | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**User**](../../models/User.md) | | - - -### query_params -#### RequestQueryParams - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -query | QuerySchema | | - - -# QuerySchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#body_with_query_params.ApiResponseFor200) | Success - -#### body_with_query_params.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **boolean** - -> bool boolean() - - - -Test serialization of outer boolean types - -### Example - -```python -import petstore_api -from petstore_api.apis.tags import fake_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - - # example passing only optional values - body = True - try: - api_response = api_instance.boolean( - body=body, - ) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->boolean: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson, Unset] | optional, default is unset | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -bool, | BoolClass, | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#boolean.ApiResponseFor200) | Output boolean - -#### boolean.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -bool, | BoolClass, | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **case_sensitive_params** - -> case_sensitive_params(some_varsome_var2some_var3) - - - -Ensures that original naming is used in endpoint params, that way we on't have collisions - -### Example - -```python -import petstore_api -from petstore_api.apis.tags import fake_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - - # example passing only required values which don't have defaults set - query_params = { - 'someVar': "someVar_example", - 'SomeVar': "SomeVar_example", - 'some_var': "some_var_example", - } - try: - api_response = api_instance.case_sensitive_params( - query_params=query_params, - ) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->case_sensitive_params: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -query_params | RequestQueryParams | | -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### query_params -#### RequestQueryParams - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -someVar | SomeVarSchema | | -SomeVar | SomeVarSchema | | -some_var | SomeVarSchema | | - - -# SomeVarSchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | - -# SomeVarSchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | - -# SomeVarSchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#case_sensitive_params.ApiResponseFor200) | Success - -#### case_sensitive_params.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **client_model** - -> Client client_model(client) - -To test \"client\" model - -To test \"client\" model - -### Example - -```python -import petstore_api -from petstore_api.apis.tags import fake_api -from petstore_api.model.client import Client -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - - # example passing only required values which don't have defaults set - body = Client( - client="client_example", - ) - try: - # To test \"client\" model - api_response = api_instance.client_model( - body=body, - ) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->client_model: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**Client**](../../models/Client.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#client_model.ApiResponseFor200) | successful operation - -#### client_model.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**Client**](../../models/Client.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **composed_one_of_different_types** - -> ComposedOneOfDifferentTypes composed_one_of_different_types() - - - -Test serialization of object with $refed properties - -### Example - -```python -import petstore_api -from petstore_api.apis.tags import fake_api -from petstore_api.model.composed_one_of_different_types import ComposedOneOfDifferentTypes -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - - # example passing only optional values - body = ComposedOneOfDifferentTypes(None) - try: - api_response = api_instance.composed_one_of_different_types( - body=body, - ) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->composed_one_of_different_types: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson, Unset] | optional, default is unset | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**ComposedOneOfDifferentTypes**](../../models/ComposedOneOfDifferentTypes.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#composed_one_of_different_types.ApiResponseFor200) | Output model - -#### composed_one_of_different_types.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**ComposedOneOfDifferentTypes**](../../models/ComposedOneOfDifferentTypes.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **delete_coffee** - -> delete_coffee(id) - -Delete coffee - -Delete the coffee identified by the given id, (delete without request body) - -### Example - -```python -import petstore_api -from petstore_api.apis.tags import fake_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - - # example passing only required values which don't have defaults set - path_params = { - 'id': "id_example", - } - try: - # Delete coffee - api_response = api_instance.delete_coffee( - path_params=path_params, - ) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->delete_coffee: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -path_params | RequestPathParams | | -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### path_params -#### RequestPathParams - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -id | IdSchema | | - -# IdSchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#delete_coffee.ApiResponseFor200) | OK -default | [ApiResponseForDefault](#delete_coffee.ApiResponseForDefault) | Unexpected error - -#### delete_coffee.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -#### delete_coffee.ApiResponseForDefault -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **endpoint_parameters** - -> endpoint_parameters() - -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - -### Example - -* Basic Authentication (http_basic_test): -```python -import petstore_api -from petstore_api.apis.tags import fake_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure HTTP basic authorization: http_basic_test -configuration = petstore_api.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - - # example passing only optional values - body = dict( - integer=10, - int32=20, - int64=1, - number=32.1, - _float=3.14, - double=67.8, - string="a", - pattern_without_delimiter="AUR,rZ#UM/?R,Fp^l6$ARjbhJk C>", - byte='YQ==', - binary=open('/path/to/file', 'rb'), - date="1970-01-01", - date_time="2020-02-02T20:20:20.222220Z", - password="password_example", - callback="callback_example", - ) - try: - # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - api_response = api_instance.endpoint_parameters( - body=body, - ) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->endpoint_parameters: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, Unset] | optional, default is unset | -content_type | str | optional, default is 'application/x-www-form-urlencoded' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationXWwwFormUrlencoded - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**number** | decimal.Decimal, int, float, | decimal.Decimal, | None | -**pattern_without_delimiter** | str, | str, | None | -**byte** | str, | str, | None | -**double** | decimal.Decimal, int, float, | decimal.Decimal, | None | value must be a 64 bit float -**integer** | decimal.Decimal, int, | decimal.Decimal, | None | [optional] -**int32** | decimal.Decimal, int, | decimal.Decimal, | None | [optional] value must be a 32 bit integer -**int64** | decimal.Decimal, int, | decimal.Decimal, | None | [optional] value must be a 64 bit integer -**float** | decimal.Decimal, int, float, | decimal.Decimal, | None | [optional] value must be a 32 bit float -**string** | str, | str, | None | [optional] -**binary** | bytes, io.FileIO, io.BufferedReader, | bytes, FileIO, | None | [optional] -**date** | str, date, | str, | None | [optional] value must conform to RFC-3339 full-date YYYY-MM-DD -**dateTime** | str, datetime, | str, | None | [optional] if omitted the server will use the default value of 2010-02-01T10:20:10.11111+01:00value must conform to RFC-3339 date-time -**password** | str, | str, | None | [optional] -**callback** | str, | str, | None | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#endpoint_parameters.ApiResponseFor200) | Success -404 | [ApiResponseFor404](#endpoint_parameters.ApiResponseFor404) | User not found - -#### endpoint_parameters.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -#### endpoint_parameters.ApiResponseFor404 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -[http_basic_test](../../../README.md#http_basic_test) - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **enum_parameters** - -> enum_parameters() - -To test enum parameters - -To test enum parameters - -### Example - -```python -import petstore_api -from petstore_api.apis.tags import fake_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - - # example passing only optional values - query_params = { - 'enum_query_string_array': [ - "$" - ], - 'enum_query_string': "-efg", - 'enum_query_integer': 1, - 'enum_query_double': 1.1, - } - header_params = { - 'enum_header_string_array': [ - "$" - ], - 'enum_header_string': "-efg", - } - body = dict( - enum_form_string_array=[ - "$" - ], - enum_form_string="-efg", - ) - try: - # To test enum parameters - api_response = api_instance.enum_parameters( - query_params=query_params, - header_params=header_params, - body=body, - ) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->enum_parameters: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, Unset] | optional, default is unset | -query_params | RequestQueryParams | | -header_params | RequestHeaderParams | | -content_type | str | optional, default is 'application/x-www-form-urlencoded' | Selects the schema and serialization of the request body -accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationXWwwFormUrlencoded - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**[enum_form_string_array](#enum_form_string_array)** | list, tuple, | tuple, | Form parameter enum test (string array) | [optional] -**enum_form_string** | str, | str, | Form parameter enum test (string) | [optional] must be one of ["_abc", "-efg", "(xyz)", ] if omitted the server will use the default value of "-efg" -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -# enum_form_string_array - -Form parameter enum test (string array) - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -list, tuple, | tuple, | Form parameter enum test (string array) | - -### Tuple Items -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -items | str, | str, | | must be one of [">", "$", ] if omitted the server will use the default value of "$" - -### query_params -#### RequestQueryParams - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -enum_query_string_array | EnumQueryStringArraySchema | | optional -enum_query_string | EnumQueryStringSchema | | optional -enum_query_integer | EnumQueryIntegerSchema | | optional -enum_query_double | EnumQueryDoubleSchema | | optional - - -# EnumQueryStringArraySchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -list, tuple, | tuple, | | - -### Tuple Items -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -items | str, | str, | | must be one of [">", "$", ] if omitted the server will use the default value of "$" - -# EnumQueryStringSchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | must be one of ["_abc", "-efg", "(xyz)", ] if omitted the server will use the default value of "-efg" - -# EnumQueryIntegerSchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -decimal.Decimal, int, | decimal.Decimal, | | must be one of [1, -2, ] value must be a 32 bit integer - -# EnumQueryDoubleSchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -decimal.Decimal, int, float, | decimal.Decimal, | | must be one of [1.1, -1.2, ] value must be a 64 bit float - -### header_params -#### RequestHeaderParams - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -enum_header_string_array | EnumHeaderStringArraySchema | | optional -enum_header_string | EnumHeaderStringSchema | | optional - -# EnumHeaderStringArraySchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -list, tuple, | tuple, | | - -### Tuple Items -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -items | str, | str, | | must be one of [">", "$", ] if omitted the server will use the default value of "$" - -# EnumHeaderStringSchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | must be one of ["_abc", "-efg", "(xyz)", ] if omitted the server will use the default value of "-efg" - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#enum_parameters.ApiResponseFor200) | Success -404 | [ApiResponseFor404](#enum_parameters.ApiResponseFor404) | Not found - -#### enum_parameters.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -#### enum_parameters.ApiResponseFor404 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor404ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor404ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **fake_health_get** - -> HealthCheckResult fake_health_get() - -Health check endpoint - -### Example - -```python -import petstore_api -from petstore_api.apis.tags import fake_api -from petstore_api.model.health_check_result import HealthCheckResult -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - # Health check endpoint - api_response = api_instance.fake_health_get() - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->fake_health_get: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#fake_health_get.ApiResponseFor200) | The instance started successfully - -#### fake_health_get.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**HealthCheckResult**](../../models/HealthCheckResult.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **group_parameters** - -> group_parameters(required_string_grouprequired_boolean_grouprequired_int64_group) - -Fake endpoint to test group parameters (optional) - -Fake endpoint to test group parameters (optional) - -### Example - -* Bearer (JWT) Authentication (bearer_test): -```python -import petstore_api -from petstore_api.apis.tags import fake_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure Bearer authorization (JWT): bearer_test -configuration = petstore_api.Configuration( - access_token = 'YOUR_BEARER_TOKEN' -) -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - - # example passing only required values which don't have defaults set - query_params = { - 'required_string_group': "required_string_group_example", - 'required_int64_group': 1, - } - header_params = { - 'required_boolean_group': "true", - } - try: - # Fake endpoint to test group parameters (optional) - api_response = api_instance.group_parameters( - query_params=query_params, - header_params=header_params, - ) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->group_parameters: %s\n" % e) - - # example passing only optional values - query_params = { - 'required_string_group': "required_string_group_example", - 'required_int64_group': 1, - 'string_group': "string_group_example", - 'int64_group': 1, - } - header_params = { - 'required_boolean_group': "true", - 'boolean_group': "true", - } - try: - # Fake endpoint to test group parameters (optional) - api_response = api_instance.group_parameters( - query_params=query_params, - header_params=header_params, - ) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->group_parameters: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -query_params | RequestQueryParams | | -header_params | RequestHeaderParams | | -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### query_params -#### RequestQueryParams - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -required_string_group | RequiredStringGroupSchema | | -required_int64_group | RequiredInt64GroupSchema | | -string_group | StringGroupSchema | | optional -int64_group | Int64GroupSchema | | optional - - -# RequiredStringGroupSchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | - -# RequiredInt64GroupSchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -decimal.Decimal, int, | decimal.Decimal, | | value must be a 64 bit integer - -# StringGroupSchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | - -# Int64GroupSchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -decimal.Decimal, int, | decimal.Decimal, | | value must be a 64 bit integer - -### header_params -#### RequestHeaderParams - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -required_boolean_group | RequiredBooleanGroupSchema | | -boolean_group | BooleanGroupSchema | | optional - -# RequiredBooleanGroupSchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | must be one of ["true", "false", ] - -# BooleanGroupSchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | must be one of ["true", "false", ] - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#group_parameters.ApiResponseFor200) | succeeded - -#### group_parameters.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -[bearer_test](../../../README.md#bearer_test) - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **inline_additional_properties** - -> inline_additional_properties(request_body) - -test inline additionalProperties - -### Example - -```python -import petstore_api -from petstore_api.apis.tags import fake_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - - # example passing only required values which don't have defaults set - body = dict( - "key": "key_example", - ) - try: - # test inline additionalProperties - api_response = api_instance.inline_additional_properties( - body=body, - ) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->inline_additional_properties: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**any_string_name** | str, | str, | any string name can be used but the value must be the correct type | [optional] - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#inline_additional_properties.ApiResponseFor200) | successful operation - -#### inline_additional_properties.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **inline_composition** - -> bool, date, datetime, dict, float, int, list, str, none_type inline_composition() - -testing composed schemas at inline locations - -### Example - -```python -import petstore_api -from petstore_api.apis.tags import fake_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - - # example passing only optional values - query_params = { - 'compositionAtRoot': None, - 'compositionInProperty': dict( - some_prop=None, - ), - } - body = None - try: - # testing composed schemas at inline locations - api_response = api_instance.inline_composition( - query_params=query_params, - body=body, - ) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->inline_composition: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson, SchemaForRequestBodyMultipartFormData, Unset] | optional, default is unset | -query_params | RequestQueryParams | | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -accept_content_types | typing.Tuple[str] | default is ('application/json', 'multipart/form-data', ) | Tells the server the content type(s) that are accepted by the client -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### allOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[all_of_0](#all_of_0) | str, | str, | | - -# all_of_0 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | - -# SchemaForRequestBodyMultipartFormData - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**[someProp](#someProp)** | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -# someProp - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### allOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[all_of_0](#all_of_0) | str, | str, | | - -# all_of_0 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | - -### query_params -#### RequestQueryParams - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -compositionAtRoot | CompositionAtRootSchema | | optional -compositionInProperty | CompositionInPropertySchema | | optional - - -# CompositionAtRootSchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### allOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[all_of_0](#all_of_0) | str, | str, | | - -# all_of_0 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | - -# CompositionInPropertySchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**[someProp](#someProp)** | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -# someProp - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### allOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[all_of_0](#all_of_0) | str, | str, | | - -# all_of_0 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#inline_composition.ApiResponseFor200) | success - -#### inline_composition.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, SchemaFor200ResponseBodyMultipartFormData, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### allOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[all_of_0](#all_of_0) | str, | str, | | - -# all_of_0 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | - -# SchemaFor200ResponseBodyMultipartFormData - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**[someProp](#someProp)** | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -# someProp - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### allOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[all_of_0](#all_of_0) | str, | str, | | - -# all_of_0 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **json_form_data** - -> json_form_data() - -test json serialization of form data - -### Example - -```python -import petstore_api -from petstore_api.apis.tags import fake_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - - # example passing only optional values - body = dict( - param="param_example", - param2="param2_example", - ) - try: - # test json serialization of form data - api_response = api_instance.json_form_data( - body=body, - ) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->json_form_data: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, Unset] | optional, default is unset | -content_type | str | optional, default is 'application/x-www-form-urlencoded' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationXWwwFormUrlencoded - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**param** | str, | str, | field1 | -**param2** | str, | str, | field2 | -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#json_form_data.ApiResponseFor200) | successful operation - -#### json_form_data.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **json_patch** - -> json_patch() - -json patch - -json patch route with a requestBody - -### Example - -```python -import petstore_api -from petstore_api.apis.tags import fake_api -from petstore_api.model.json_patch_request import JSONPatchRequest -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - - # example passing only optional values - body = JSONPatchRequest([ - None - ]) - try: - # json patch - api_response = api_instance.json_patch( - body=body, - ) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->json_patch: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJsonPatchjson, Unset] | optional, default is unset | -content_type | str | optional, default is 'application/json-patch+json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJsonPatchjson -Type | Description | Notes -------------- | ------------- | ------------- -[**JSONPatchRequest**](../../models/JSONPatchRequest.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#json_patch.ApiResponseFor200) | OK - -#### json_patch.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **json_with_charset** - -> bool, date, datetime, dict, float, int, list, str, none_type json_with_charset() - -json with charset tx and rx - -### Example - -```python -import petstore_api -from petstore_api.apis.tags import fake_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - - # example passing only optional values - body = None - try: - # json with charset tx and rx - api_response = api_instance.json_with_charset( - body=body, - ) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->json_with_charset: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJsonCharsetutf8, Unset] | optional, default is unset | -content_type | str | optional, default is 'application/json; charset=utf-8' | Selects the schema and serialization of the request body -accept_content_types | typing.Tuple[str] | default is ('application/json; charset=utf-8', ) | Tells the server the content type(s) that are accepted by the client -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJsonCharsetutf8 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#json_with_charset.ApiResponseFor200) | success - -#### json_with_charset.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJsonCharsetutf8, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJsonCharsetutf8 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **mammal** - -> Mammal mammal(mammal) - - - -Test serialization of mammals - -### Example - -```python -import petstore_api -from petstore_api.apis.tags import fake_api -from petstore_api.model.mammal import Mammal -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - - # example passing only required values which don't have defaults set - body = Mammal( - has_baleen=True, - has_teeth=True, - class_name="whale", - ) - try: - api_response = api_instance.mammal( - body=body, - ) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->mammal: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**Mammal**](../../models/Mammal.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#mammal.ApiResponseFor200) | Output mammal - -#### mammal.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**Mammal**](../../models/Mammal.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **number_with_validations** - -> NumberWithValidations number_with_validations() - - - -Test serialization of outer number types - -### Example - -```python -import petstore_api -from petstore_api.apis.tags import fake_api -from petstore_api.model.number_with_validations import NumberWithValidations -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - - # example passing only optional values - body = NumberWithValidations(10) - try: - api_response = api_instance.number_with_validations( - body=body, - ) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->number_with_validations: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson, Unset] | optional, default is unset | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**NumberWithValidations**](../../models/NumberWithValidations.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#number_with_validations.ApiResponseFor200) | Output number - -#### number_with_validations.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**NumberWithValidations**](../../models/NumberWithValidations.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **object_in_query** - -> object_in_query() - -user list - -### Example - -```python -import petstore_api -from petstore_api.apis.tags import fake_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - - # example passing only optional values - query_params = { - 'mapBean': dict( - keyword="keyword_example", - ), - } - try: - # user list - api_response = api_instance.object_in_query( - query_params=query_params, - ) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->object_in_query: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -query_params | RequestQueryParams | | -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### query_params -#### RequestQueryParams - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -mapBean | MapBeanSchema | | optional - - -# MapBeanSchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**keyword** | str, | str, | | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#object_in_query.ApiResponseFor200) | ok - -#### object_in_query.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **object_model_with_ref_props** - -> ObjectModelWithRefProps object_model_with_ref_props() - - - -Test serialization of object with $refed properties - -### Example - -```python -import petstore_api -from petstore_api.apis.tags import fake_api -from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - - # example passing only optional values - body = ObjectModelWithRefProps( - my_number=NumberWithValidations(10), - my_string="my_string_example", - my_boolean=True, - ) - try: - api_response = api_instance.object_model_with_ref_props( - body=body, - ) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->object_model_with_ref_props: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson, Unset] | optional, default is unset | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**ObjectModelWithRefProps**](../../models/ObjectModelWithRefProps.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#object_model_with_ref_props.ApiResponseFor200) | Output model - -#### object_model_with_ref_props.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**ObjectModelWithRefProps**](../../models/ObjectModelWithRefProps.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **parameter_collisions** - -> bool, date, datetime, dict, float, int, list, str, none_type parameter_collisions(_3a_b5ab2_self3a_b6) - -parameter collision case - -### Example - -```python -import petstore_api -from petstore_api.apis.tags import fake_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - - # example passing only required values which don't have defaults set - path_params = { - '1': "1_example", - 'aB': "aB_example", - 'Ab': "Ab_example", - 'self': "self_example", - 'A-B': "A-B_example", - } - query_params = { - } - cookie_params = { - } - header_params = { - } - try: - # parameter collision case - api_response = api_instance.parameter_collisions( - path_params=path_params, - query_params=query_params, - header_params=header_params, - cookie_params=cookie_params, - ) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->parameter_collisions: %s\n" % e) - - # example passing only optional values - path_params = { - '1': "1_example", - 'aB': "aB_example", - 'Ab': "Ab_example", - 'self': "self_example", - 'A-B': "A-B_example", - } - query_params = { - '1': "1_example", - 'aB': "aB_example", - 'Ab': "Ab_example", - 'self': "self_example", - 'A-B': "A-B_example", - } - cookie_params = { - '1': "1_example", - 'aB': "aB_example", - 'Ab': "Ab_example", - 'self': "self_example", - 'A-B': "A-B_example", - } - header_params = { - '1': "1_example", - 'aB': "aB_example", - 'self': "self_example", - 'A-B': "A-B_example", - } - body = None - try: - # parameter collision case - api_response = api_instance.parameter_collisions( - path_params=path_params, - query_params=query_params, - header_params=header_params, - cookie_params=cookie_params, - body=body, - ) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->parameter_collisions: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson, Unset] | optional, default is unset | -query_params | RequestQueryParams | | -header_params | RequestHeaderParams | | -path_params | RequestPathParams | | -cookie_params | RequestCookieParams | | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### query_params -#### RequestQueryParams - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -1 | Model1Schema | | optional -aB | ABSchema | | optional -Ab | AbSchema | | optional -self | ModelSelfSchema | | optional -A-B | ABSchema | | optional - - -# Model1Schema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | - -# ABSchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | - -# AbSchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | - -# ModelSelfSchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | - -# ABSchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | - -### header_params -#### RequestHeaderParams - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -1 | Model1Schema | | optional -aB | ABSchema | | optional -self | ModelSelfSchema | | optional -A-B | ABSchema | | optional - -# Model1Schema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | - -# ABSchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | - -# ModelSelfSchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | - -# ABSchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | - -### path_params -#### RequestPathParams - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -1 | Model1Schema | | -aB | ABSchema | | -Ab | AbSchema | | -self | ModelSelfSchema | | -A-B | ABSchema | | - -# Model1Schema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | - -# ABSchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | - -# AbSchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | - -# ModelSelfSchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | - -# ABSchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | - -### cookie_params -#### RequestCookieParams - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -1 | Model1Schema | | optional -aB | ABSchema | | optional -Ab | AbSchema | | optional -self | ModelSelfSchema | | optional -A-B | ABSchema | | optional - -# Model1Schema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | - -# ABSchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | - -# AbSchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | - -# ModelSelfSchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | - -# ABSchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#parameter_collisions.ApiResponseFor200) | success - -#### parameter_collisions.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **query_param_with_json_content_type** - -> bool, date, datetime, dict, float, int, list, str, none_type query_param_with_json_content_type(some_param) - -query param with json content-type - -### Example - -```python -import petstore_api -from petstore_api.apis.tags import fake_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - - # example passing only required values which don't have defaults set - query_params = { - 'someParam': , - } - try: - # query param with json content-type - api_response = api_instance.query_param_with_json_content_type( - query_params=query_params, - ) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->query_param_with_json_content_type: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -query_params | RequestQueryParams | | -accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### query_params -#### RequestQueryParams - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -someParam | | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#query_param_with_json_content_type.ApiResponseFor200) | success - -#### query_param_with_json_content_type.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **query_parameter_collection_format** - -> query_parameter_collection_format(pipeioutilhttpurlcontextref_param) - - - -To test the collection format in query parameters - -### Example - -```python -import petstore_api -from petstore_api.apis.tags import fake_api -from petstore_api.model.string_with_validation import StringWithValidation -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - - # example passing only required values which don't have defaults set - query_params = { - 'pipe': [ - "pipe_example" - ], - 'ioutil': [ - "ioutil_example" - ], - 'http': [ - "http_example" - ], - 'url': [ - "url_example" - ], - 'context': [ - "context_example" - ], - 'refParam': StringWithValidation("refParam_example"), - } - try: - api_response = api_instance.query_parameter_collection_format( - query_params=query_params, - ) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->query_parameter_collection_format: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -query_params | RequestQueryParams | | -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### query_params -#### RequestQueryParams - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -pipe | PipeSchema | | -ioutil | IoutilSchema | | -http | HttpSchema | | -url | UrlSchema | | -context | ContextSchema | | -refParam | RefParamSchema | | - - -# PipeSchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -list, tuple, | tuple, | | - -### Tuple Items -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -items | str, | str, | | - -# IoutilSchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -list, tuple, | tuple, | | - -### Tuple Items -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -items | str, | str, | | - -# HttpSchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -list, tuple, | tuple, | | - -### Tuple Items -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -items | str, | str, | | - -# UrlSchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -list, tuple, | tuple, | | - -### Tuple Items -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -items | str, | str, | | - -# ContextSchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -list, tuple, | tuple, | | - -### Tuple Items -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -items | str, | str, | | - -# RefParamSchema -Type | Description | Notes -------------- | ------------- | ------------- -[**StringWithValidation**](../../models/StringWithValidation.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#query_parameter_collection_format.ApiResponseFor200) | Success - -#### query_parameter_collection_format.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **ref_object_in_query** - -> ref_object_in_query() - -user list - -### Example - -```python -import petstore_api -from petstore_api.apis.tags import fake_api -from petstore_api.model.foo import Foo -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - - # example passing only optional values - query_params = { - 'mapBean': Foo( - bar="bar", - ), - } - try: - # user list - api_response = api_instance.ref_object_in_query( - query_params=query_params, - ) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->ref_object_in_query: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -query_params | RequestQueryParams | | -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### query_params -#### RequestQueryParams - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -mapBean | MapBeanSchema | | optional - - -# MapBeanSchema -Type | Description | Notes -------------- | ------------- | ------------- -[**Foo**](../../models/Foo.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#ref_object_in_query.ApiResponseFor200) | ok - -#### ref_object_in_query.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **response_without_schema** - -> response_without_schema() - -receives a response without schema - -### Example - -```python -import petstore_api -from petstore_api.apis.tags import fake_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - # receives a response without schema - api_response = api_instance.response_without_schema() - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->response_without_schema: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#response_without_schema.ApiResponseFor200) | contents without schema definition - -#### response_without_schema.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[Unset, Unset, ] | | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **string** - -> str string() - - - -Test serialization of outer string types - -### Example - -```python -import petstore_api -from petstore_api.apis.tags import fake_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - - # example passing only optional values - body = "body_example" - try: - api_response = api_instance.string( - body=body, - ) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->string: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson, Unset] | optional, default is unset | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#string.ApiResponseFor200) | Output string - -#### string.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **string_enum** - -> StringEnum string_enum() - - - -Test serialization of outer enum - -### Example - -```python -import petstore_api -from petstore_api.apis.tags import fake_api -from petstore_api.model.string_enum import StringEnum -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - - # example passing only optional values - body = StringEnum("placed") - try: - api_response = api_instance.string_enum( - body=body, - ) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->string_enum: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson, Unset] | optional, default is unset | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**StringEnum**](../../models/StringEnum.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#string_enum.ApiResponseFor200) | Output enum - -#### string_enum.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**StringEnum**](../../models/StringEnum.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **upload_download_file** - -> file_type upload_download_file(body) - -uploads a file and downloads a file using application/octet-stream - -### Example - -```python -import petstore_api -from petstore_api.apis.tags import fake_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - - # example passing only required values which don't have defaults set - body = open('/path/to/file', 'rb') - try: - # uploads a file and downloads a file using application/octet-stream - api_response = api_instance.upload_download_file( - body=body, - ) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->upload_download_file: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationOctetStream] | required | -content_type | str | optional, default is 'application/octet-stream' | Selects the schema and serialization of the request body -accept_content_types | typing.Tuple[str] | default is ('application/octet-stream', ) | Tells the server the content type(s) that are accepted by the client -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationOctetStream - -file to upload - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -bytes, io.FileIO, io.BufferedReader, | bytes, FileIO, | file to upload | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#upload_download_file.ApiResponseFor200) | successful operation - -#### upload_download_file.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationOctetStream, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationOctetStream - -file to download - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -bytes, io.FileIO, io.BufferedReader, | bytes, FileIO, | file to download | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **upload_file** - -> ApiResponse upload_file() - -uploads a file using multipart/form-data - -### Example - -```python -import petstore_api -from petstore_api.apis.tags import fake_api -from petstore_api.model.api_response import ApiResponse -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - - # example passing only optional values - body = dict( - additional_metadata="additional_metadata_example", - file=open('/path/to/file', 'rb'), - ) - try: - # uploads a file using multipart/form-data - api_response = api_instance.upload_file( - body=body, - ) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->upload_file: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyMultipartFormData, Unset] | optional, default is unset | -content_type | str | optional, default is 'multipart/form-data' | Selects the schema and serialization of the request body -accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyMultipartFormData - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**file** | bytes, io.FileIO, io.BufferedReader, | bytes, FileIO, | file to upload | -**additionalMetadata** | str, | str, | Additional data to pass to server | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#upload_file.ApiResponseFor200) | successful operation - -#### upload_file.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**ApiResponse**](../../models/ApiResponse.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **upload_files** - -> ApiResponse upload_files() - -uploads files using multipart/form-data - -### Example - -```python -import petstore_api -from petstore_api.apis.tags import fake_api -from petstore_api.model.api_response import ApiResponse -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - - # example passing only optional values - body = dict( - files=[ - open('/path/to/file', 'rb') - ], - ) - try: - # uploads files using multipart/form-data - api_response = api_instance.upload_files( - body=body, - ) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->upload_files: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyMultipartFormData, Unset] | optional, default is unset | -content_type | str | optional, default is 'multipart/form-data' | Selects the schema and serialization of the request body -accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyMultipartFormData - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**[files](#files)** | list, tuple, | tuple, | | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -# files - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -list, tuple, | tuple, | | - -### Tuple Items -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -items | bytes, io.FileIO, io.BufferedReader, | bytes, FileIO, | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#upload_files.ApiResponseFor200) | successful operation - -#### upload_files.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**ApiResponse**](../../models/ApiResponse.md) | | - - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/apis/tags/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/python/docs/apis/tags/FakeClassnameTags123Api.md deleted file mode 100644 index 87b99456ada..00000000000 --- a/samples/openapi3/client/petstore/python/docs/apis/tags/FakeClassnameTags123Api.md +++ /dev/null @@ -1,104 +0,0 @@ - -# petstore_api.apis.tags.fake_classname_tags123_api.FakeClassnameTags123Api - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**classname**](#classname) | **patch** /fake_classname_test | To test class name in snake case - -# **classname** - -> Client classname(client) - -To test class name in snake case - -To test class name in snake case - -### Example - -* Api Key Authentication (api_key_query): -```python -import petstore_api -from petstore_api.apis.tags import fake_classname_tags123_api -from petstore_api.model.client import Client -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: api_key_query -configuration.api_key['api_key_query'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_query'] = 'Bearer' -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = fake_classname_tags123_api.FakeClassnameTags123Api(api_client) - - # example passing only required values which don't have defaults set - body = Client( - client="client_example", - ) - try: - # To test class name in snake case - api_response = api_instance.classname( - body=body, - ) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling FakeClassnameTags123Api->classname: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**Client**](../../models/Client.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#classname.ApiResponseFor200) | successful operation - -#### classname.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**Client**](../../models/Client.md) | | - - -### Authorization - -[api_key_query](../../../README.md#api_key_query) - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/apis/tags/PetApi.md b/samples/openapi3/client/petstore/python/docs/apis/tags/PetApi.md deleted file mode 100644 index 28787e08d35..00000000000 --- a/samples/openapi3/client/petstore/python/docs/apis/tags/PetApi.md +++ /dev/null @@ -1,1402 +0,0 @@ - -# petstore_api.apis.tags.pet_api.PetApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**add_pet**](#add_pet) | **post** /pet | Add a new pet to the store -[**delete_pet**](#delete_pet) | **delete** /pet/{petId} | Deletes a pet -[**find_pets_by_status**](#find_pets_by_status) | **get** /pet/findByStatus | Finds Pets by status -[**find_pets_by_tags**](#find_pets_by_tags) | **get** /pet/findByTags | Finds Pets by tags -[**get_pet_by_id**](#get_pet_by_id) | **get** /pet/{petId} | Find pet by ID -[**update_pet**](#update_pet) | **put** /pet | Update an existing pet -[**update_pet_with_form**](#update_pet_with_form) | **post** /pet/{petId} | Updates a pet in the store with form data -[**upload_file_with_required_file**](#upload_file_with_required_file) | **post** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) -[**upload_image**](#upload_image) | **post** /pet/{petId}/uploadImage | uploads an image - -# **add_pet** - -> add_pet(pet) - -Add a new pet to the store - -Add a new pet to the store - -### Example - -* OAuth Authentication (petstore_auth): -```python -import petstore_api -from petstore_api.apis.tags import pet_api -from petstore_api.model.pet import Pet -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure HTTP message signature: http_signature_test -# The HTTP Signature Header mechanism that can be used by a client to -# authenticate the sender of a message and ensure that particular headers -# have not been modified in transit. -# -# You can specify the signing key-id, private key path, signing scheme, -# signing algorithm, list of signed headers and signature max validity. -# The 'key_id' parameter is an opaque string that the API server can use -# to lookup the client and validate the signature. -# The 'private_key_path' parameter should be the path to a file that -# contains a DER or base-64 encoded private key. -# The 'private_key_passphrase' parameter is optional. Set the passphrase -# if the private key is encrypted. -# The 'signed_headers' parameter is used to specify the list of -# HTTP headers included when generating the signature for the message. -# You can specify HTTP headers that you want to protect with a cryptographic -# signature. Note that proxies may add, modify or remove HTTP headers -# for legitimate reasons, so you should only add headers that you know -# will not be modified. For example, if you want to protect the HTTP request -# body, you can specify the Digest header. In that case, the client calculates -# the digest of the HTTP request body and includes the digest in the message -# signature. -# The 'signature_max_validity' parameter is optional. It is configured as a -# duration to express when the signature ceases to be valid. The client calculates -# the expiration date every time it generates the cryptographic signature -# of an HTTP request. The API server may have its own security policy -# that controls the maximum validity of the signature. The client max validity -# must be lower than the server max validity. -# The time on the client and server must be synchronized, otherwise the -# server may reject the client signature. -# -# The client must use a combination of private key, signing scheme, -# signing algorithm and hash algorithm that matches the security policy of -# the API server. -# -# See petstore_api.signing for a list of all supported parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2", - signing_info = petstore_api.signing.HttpSigningConfiguration( - key_id = 'my-key-id', - private_key_path = 'private_key.pem', - private_key_passphrase = 'YOUR_PASSPHRASE', - signing_scheme = petstore_api.signing.SCHEME_HS2019, - signing_algorithm = petstore_api.signing.ALGORITHM_ECDSA_MODE_FIPS_186_3, - hash_algorithm = petstore_api.signing.SCHEME_RSA_SHA256, - signed_headers = [ - petstore_api.signing.HEADER_REQUEST_TARGET, - petstore_api.signing.HEADER_CREATED, - petstore_api.signing.HEADER_EXPIRES, - petstore_api.signing.HEADER_HOST, - petstore_api.signing.HEADER_DATE, - petstore_api.signing.HEADER_DIGEST, - 'Content-Type', - 'Content-Length', - 'User-Agent' - ], - signature_max_validity = datetime.timedelta(minutes=5) - ) -) - -# Configure OAuth2 access token for authorization: petstore_auth -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2", - access_token = 'YOUR_ACCESS_TOKEN' -) -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = pet_api.PetApi(api_client) - - # example passing only required values which don't have defaults set - body = Pet( - id=1, - category=Category( - id=1, - name="default-name", - ), - name="doggie", - photo_urls=[ - "photo_urls_example" - ], - tags=[ - Tag( - id=1, - name="name_example", - ) - ], - status="available", - ) - try: - # Add a new pet to the store - api_response = api_instance.add_pet( - body=body, - ) - except petstore_api.ApiException as e: - print("Exception when calling PetApi->add_pet: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson, SchemaForRequestBodyApplicationXml] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -host_index | typing.Optional[int] | default is None | Allows one to select a different host -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**Pet**](../../models/Pet.md) | | - - -# SchemaForRequestBodyApplicationXml -Type | Description | Notes -------------- | ------------- | ------------- -[**Pet**](../../models/Pet.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#add_pet.ApiResponseFor200) | Ok -405 | [ApiResponseFor405](#add_pet.ApiResponseFor405) | Invalid input - -#### add_pet.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -#### add_pet.ApiResponseFor405 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -[http_signature_test](../../../README.md#http_signature_test), [petstore_auth](../../../README.md#petstore_auth) - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **delete_pet** - -> delete_pet(pet_id) - -Deletes a pet - -### Example - -* OAuth Authentication (petstore_auth): -```python -import petstore_api -from petstore_api.apis.tags import pet_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure OAuth2 access token for authorization: petstore_auth -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2", - access_token = 'YOUR_ACCESS_TOKEN' -) -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = pet_api.PetApi(api_client) - - # example passing only required values which don't have defaults set - path_params = { - 'petId': 1, - } - header_params = { - } - try: - # Deletes a pet - api_response = api_instance.delete_pet( - path_params=path_params, - header_params=header_params, - ) - except petstore_api.ApiException as e: - print("Exception when calling PetApi->delete_pet: %s\n" % e) - - # example passing only optional values - path_params = { - 'petId': 1, - } - header_params = { - 'api_key': "api_key_example", - } - try: - # Deletes a pet - api_response = api_instance.delete_pet( - path_params=path_params, - header_params=header_params, - ) - except petstore_api.ApiException as e: - print("Exception when calling PetApi->delete_pet: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -header_params | RequestHeaderParams | | -path_params | RequestPathParams | | -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### header_params -#### RequestHeaderParams - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -api_key | ApiKeySchema | | optional - -# ApiKeySchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | - -### path_params -#### RequestPathParams - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -petId | PetIdSchema | | - -# PetIdSchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -decimal.Decimal, int, | decimal.Decimal, | | value must be a 64 bit integer - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -400 | [ApiResponseFor400](#delete_pet.ApiResponseFor400) | Invalid pet value - -#### delete_pet.ApiResponseFor400 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -[petstore_auth](../../../README.md#petstore_auth) - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **find_pets_by_status** - -> [Pet] find_pets_by_status(status) - -Finds Pets by status - -Multiple status values can be provided with comma separated strings - -### Example - -* OAuth Authentication (petstore_auth): -```python -import petstore_api -from petstore_api.apis.tags import pet_api -from petstore_api.model.pet import Pet -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure HTTP message signature: http_signature_test -# The HTTP Signature Header mechanism that can be used by a client to -# authenticate the sender of a message and ensure that particular headers -# have not been modified in transit. -# -# You can specify the signing key-id, private key path, signing scheme, -# signing algorithm, list of signed headers and signature max validity. -# The 'key_id' parameter is an opaque string that the API server can use -# to lookup the client and validate the signature. -# The 'private_key_path' parameter should be the path to a file that -# contains a DER or base-64 encoded private key. -# The 'private_key_passphrase' parameter is optional. Set the passphrase -# if the private key is encrypted. -# The 'signed_headers' parameter is used to specify the list of -# HTTP headers included when generating the signature for the message. -# You can specify HTTP headers that you want to protect with a cryptographic -# signature. Note that proxies may add, modify or remove HTTP headers -# for legitimate reasons, so you should only add headers that you know -# will not be modified. For example, if you want to protect the HTTP request -# body, you can specify the Digest header. In that case, the client calculates -# the digest of the HTTP request body and includes the digest in the message -# signature. -# The 'signature_max_validity' parameter is optional. It is configured as a -# duration to express when the signature ceases to be valid. The client calculates -# the expiration date every time it generates the cryptographic signature -# of an HTTP request. The API server may have its own security policy -# that controls the maximum validity of the signature. The client max validity -# must be lower than the server max validity. -# The time on the client and server must be synchronized, otherwise the -# server may reject the client signature. -# -# The client must use a combination of private key, signing scheme, -# signing algorithm and hash algorithm that matches the security policy of -# the API server. -# -# See petstore_api.signing for a list of all supported parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2", - signing_info = petstore_api.signing.HttpSigningConfiguration( - key_id = 'my-key-id', - private_key_path = 'private_key.pem', - private_key_passphrase = 'YOUR_PASSPHRASE', - signing_scheme = petstore_api.signing.SCHEME_HS2019, - signing_algorithm = petstore_api.signing.ALGORITHM_ECDSA_MODE_FIPS_186_3, - hash_algorithm = petstore_api.signing.SCHEME_RSA_SHA256, - signed_headers = [ - petstore_api.signing.HEADER_REQUEST_TARGET, - petstore_api.signing.HEADER_CREATED, - petstore_api.signing.HEADER_EXPIRES, - petstore_api.signing.HEADER_HOST, - petstore_api.signing.HEADER_DATE, - petstore_api.signing.HEADER_DIGEST, - 'Content-Type', - 'Content-Length', - 'User-Agent' - ], - signature_max_validity = datetime.timedelta(minutes=5) - ) -) - -# Configure OAuth2 access token for authorization: petstore_auth -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2", - access_token = 'YOUR_ACCESS_TOKEN' -) -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = pet_api.PetApi(api_client) - - # example passing only required values which don't have defaults set - query_params = { - 'status': [ - "available" - ], - } - try: - # Finds Pets by status - api_response = api_instance.find_pets_by_status( - query_params=query_params, - ) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling PetApi->find_pets_by_status: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -query_params | RequestQueryParams | | -accept_content_types | typing.Tuple[str] | default is ('application/xml', 'application/json', ) | Tells the server the content type(s) that are accepted by the client -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### query_params -#### RequestQueryParams - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -status | StatusSchema | | - - -# StatusSchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -list, tuple, | tuple, | | - -### Tuple Items -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -items | str, | str, | | must be one of ["available", "pending", "sold", ] if omitted the server will use the default value of "available" - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#find_pets_by_status.ApiResponseFor200) | successful operation -400 | [ApiResponseFor400](#find_pets_by_status.ApiResponseFor400) | Invalid status value - -#### find_pets_by_status.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationXml, SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationXml - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -list, tuple, | tuple, | | - -### Tuple Items -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[**Pet**]({{complexTypePrefix}}Pet.md) | [**Pet**]({{complexTypePrefix}}Pet.md) | [**Pet**]({{complexTypePrefix}}Pet.md) | | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -list, tuple, | tuple, | | - -### Tuple Items -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[**Pet**]({{complexTypePrefix}}Pet.md) | [**Pet**]({{complexTypePrefix}}Pet.md) | [**Pet**]({{complexTypePrefix}}Pet.md) | | - -#### find_pets_by_status.ApiResponseFor400 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -[http_signature_test](../../../README.md#http_signature_test), [petstore_auth](../../../README.md#petstore_auth) - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **find_pets_by_tags** - -> [Pet] find_pets_by_tags(tags) - -Finds Pets by tags - -Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - -### Example - -* OAuth Authentication (petstore_auth): -```python -import petstore_api -from petstore_api.apis.tags import pet_api -from petstore_api.model.pet import Pet -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure HTTP message signature: http_signature_test -# The HTTP Signature Header mechanism that can be used by a client to -# authenticate the sender of a message and ensure that particular headers -# have not been modified in transit. -# -# You can specify the signing key-id, private key path, signing scheme, -# signing algorithm, list of signed headers and signature max validity. -# The 'key_id' parameter is an opaque string that the API server can use -# to lookup the client and validate the signature. -# The 'private_key_path' parameter should be the path to a file that -# contains a DER or base-64 encoded private key. -# The 'private_key_passphrase' parameter is optional. Set the passphrase -# if the private key is encrypted. -# The 'signed_headers' parameter is used to specify the list of -# HTTP headers included when generating the signature for the message. -# You can specify HTTP headers that you want to protect with a cryptographic -# signature. Note that proxies may add, modify or remove HTTP headers -# for legitimate reasons, so you should only add headers that you know -# will not be modified. For example, if you want to protect the HTTP request -# body, you can specify the Digest header. In that case, the client calculates -# the digest of the HTTP request body and includes the digest in the message -# signature. -# The 'signature_max_validity' parameter is optional. It is configured as a -# duration to express when the signature ceases to be valid. The client calculates -# the expiration date every time it generates the cryptographic signature -# of an HTTP request. The API server may have its own security policy -# that controls the maximum validity of the signature. The client max validity -# must be lower than the server max validity. -# The time on the client and server must be synchronized, otherwise the -# server may reject the client signature. -# -# The client must use a combination of private key, signing scheme, -# signing algorithm and hash algorithm that matches the security policy of -# the API server. -# -# See petstore_api.signing for a list of all supported parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2", - signing_info = petstore_api.signing.HttpSigningConfiguration( - key_id = 'my-key-id', - private_key_path = 'private_key.pem', - private_key_passphrase = 'YOUR_PASSPHRASE', - signing_scheme = petstore_api.signing.SCHEME_HS2019, - signing_algorithm = petstore_api.signing.ALGORITHM_ECDSA_MODE_FIPS_186_3, - hash_algorithm = petstore_api.signing.SCHEME_RSA_SHA256, - signed_headers = [ - petstore_api.signing.HEADER_REQUEST_TARGET, - petstore_api.signing.HEADER_CREATED, - petstore_api.signing.HEADER_EXPIRES, - petstore_api.signing.HEADER_HOST, - petstore_api.signing.HEADER_DATE, - petstore_api.signing.HEADER_DIGEST, - 'Content-Type', - 'Content-Length', - 'User-Agent' - ], - signature_max_validity = datetime.timedelta(minutes=5) - ) -) - -# Configure OAuth2 access token for authorization: petstore_auth -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2", - access_token = 'YOUR_ACCESS_TOKEN' -) -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = pet_api.PetApi(api_client) - - # example passing only required values which don't have defaults set - query_params = { - 'tags': [ - "tags_example" - ], - } - try: - # Finds Pets by tags - api_response = api_instance.find_pets_by_tags( - query_params=query_params, - ) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling PetApi->find_pets_by_tags: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -query_params | RequestQueryParams | | -accept_content_types | typing.Tuple[str] | default is ('application/xml', 'application/json', ) | Tells the server the content type(s) that are accepted by the client -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### query_params -#### RequestQueryParams - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -tags | TagsSchema | | - - -# TagsSchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -list, tuple, | tuple, | | - -### Tuple Items -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -items | str, | str, | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#find_pets_by_tags.ApiResponseFor200) | successful operation -400 | [ApiResponseFor400](#find_pets_by_tags.ApiResponseFor400) | Invalid tag value - -#### find_pets_by_tags.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationXml, SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationXml - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -list, tuple, | tuple, | | - -### Tuple Items -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[**Pet**]({{complexTypePrefix}}Pet.md) | [**Pet**]({{complexTypePrefix}}Pet.md) | [**Pet**]({{complexTypePrefix}}Pet.md) | | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -list, tuple, | tuple, | | - -### Tuple Items -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[**Pet**]({{complexTypePrefix}}Pet.md) | [**Pet**]({{complexTypePrefix}}Pet.md) | [**Pet**]({{complexTypePrefix}}Pet.md) | | - -#### find_pets_by_tags.ApiResponseFor400 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -[http_signature_test](../../../README.md#http_signature_test), [petstore_auth](../../../README.md#petstore_auth) - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **get_pet_by_id** - -> Pet get_pet_by_id(pet_id) - -Find pet by ID - -Returns a single pet - -### Example - -* Api Key Authentication (api_key): -```python -import petstore_api -from petstore_api.apis.tags import pet_api -from petstore_api.model.pet import Pet -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: api_key -configuration.api_key['api_key'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key'] = 'Bearer' -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = pet_api.PetApi(api_client) - - # example passing only required values which don't have defaults set - path_params = { - 'petId': 1, - } - try: - # Find pet by ID - api_response = api_instance.get_pet_by_id( - path_params=path_params, - ) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling PetApi->get_pet_by_id: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -path_params | RequestPathParams | | -accept_content_types | typing.Tuple[str] | default is ('application/xml', 'application/json', ) | Tells the server the content type(s) that are accepted by the client -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### path_params -#### RequestPathParams - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -petId | PetIdSchema | | - -# PetIdSchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -decimal.Decimal, int, | decimal.Decimal, | | value must be a 64 bit integer - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#get_pet_by_id.ApiResponseFor200) | successful operation -400 | [ApiResponseFor400](#get_pet_by_id.ApiResponseFor400) | Invalid ID supplied -404 | [ApiResponseFor404](#get_pet_by_id.ApiResponseFor404) | Pet not found - -#### get_pet_by_id.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationXml, SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationXml -Type | Description | Notes -------------- | ------------- | ------------- -[**Pet**](../../models/Pet.md) | | - - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**Pet**](../../models/Pet.md) | | - - -#### get_pet_by_id.ApiResponseFor400 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -#### get_pet_by_id.ApiResponseFor404 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -[api_key](../../../README.md#api_key) - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **update_pet** - -> update_pet(pet) - -Update an existing pet - -### Example - -* OAuth Authentication (petstore_auth): -```python -import petstore_api -from petstore_api.apis.tags import pet_api -from petstore_api.model.pet import Pet -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure HTTP message signature: http_signature_test -# The HTTP Signature Header mechanism that can be used by a client to -# authenticate the sender of a message and ensure that particular headers -# have not been modified in transit. -# -# You can specify the signing key-id, private key path, signing scheme, -# signing algorithm, list of signed headers and signature max validity. -# The 'key_id' parameter is an opaque string that the API server can use -# to lookup the client and validate the signature. -# The 'private_key_path' parameter should be the path to a file that -# contains a DER or base-64 encoded private key. -# The 'private_key_passphrase' parameter is optional. Set the passphrase -# if the private key is encrypted. -# The 'signed_headers' parameter is used to specify the list of -# HTTP headers included when generating the signature for the message. -# You can specify HTTP headers that you want to protect with a cryptographic -# signature. Note that proxies may add, modify or remove HTTP headers -# for legitimate reasons, so you should only add headers that you know -# will not be modified. For example, if you want to protect the HTTP request -# body, you can specify the Digest header. In that case, the client calculates -# the digest of the HTTP request body and includes the digest in the message -# signature. -# The 'signature_max_validity' parameter is optional. It is configured as a -# duration to express when the signature ceases to be valid. The client calculates -# the expiration date every time it generates the cryptographic signature -# of an HTTP request. The API server may have its own security policy -# that controls the maximum validity of the signature. The client max validity -# must be lower than the server max validity. -# The time on the client and server must be synchronized, otherwise the -# server may reject the client signature. -# -# The client must use a combination of private key, signing scheme, -# signing algorithm and hash algorithm that matches the security policy of -# the API server. -# -# See petstore_api.signing for a list of all supported parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2", - signing_info = petstore_api.signing.HttpSigningConfiguration( - key_id = 'my-key-id', - private_key_path = 'private_key.pem', - private_key_passphrase = 'YOUR_PASSPHRASE', - signing_scheme = petstore_api.signing.SCHEME_HS2019, - signing_algorithm = petstore_api.signing.ALGORITHM_ECDSA_MODE_FIPS_186_3, - hash_algorithm = petstore_api.signing.SCHEME_RSA_SHA256, - signed_headers = [ - petstore_api.signing.HEADER_REQUEST_TARGET, - petstore_api.signing.HEADER_CREATED, - petstore_api.signing.HEADER_EXPIRES, - petstore_api.signing.HEADER_HOST, - petstore_api.signing.HEADER_DATE, - petstore_api.signing.HEADER_DIGEST, - 'Content-Type', - 'Content-Length', - 'User-Agent' - ], - signature_max_validity = datetime.timedelta(minutes=5) - ) -) - -# Configure OAuth2 access token for authorization: petstore_auth -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2", - access_token = 'YOUR_ACCESS_TOKEN' -) -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = pet_api.PetApi(api_client) - - # example passing only required values which don't have defaults set - body = Pet( - id=1, - category=Category( - id=1, - name="default-name", - ), - name="doggie", - photo_urls=[ - "photo_urls_example" - ], - tags=[ - Tag( - id=1, - name="name_example", - ) - ], - status="available", - ) - try: - # Update an existing pet - api_response = api_instance.update_pet( - body=body, - ) - except petstore_api.ApiException as e: - print("Exception when calling PetApi->update_pet: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson, SchemaForRequestBodyApplicationXml] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -host_index | typing.Optional[int] | default is None | Allows one to select a different host -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**Pet**](../../models/Pet.md) | | - - -# SchemaForRequestBodyApplicationXml -Type | Description | Notes -------------- | ------------- | ------------- -[**Pet**](../../models/Pet.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -400 | [ApiResponseFor400](#update_pet.ApiResponseFor400) | Invalid ID supplied -404 | [ApiResponseFor404](#update_pet.ApiResponseFor404) | Pet not found -405 | [ApiResponseFor405](#update_pet.ApiResponseFor405) | Validation exception - -#### update_pet.ApiResponseFor400 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -#### update_pet.ApiResponseFor404 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -#### update_pet.ApiResponseFor405 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -[http_signature_test](../../../README.md#http_signature_test), [petstore_auth](../../../README.md#petstore_auth) - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **update_pet_with_form** - -> update_pet_with_form(pet_id) - -Updates a pet in the store with form data - -### Example - -* OAuth Authentication (petstore_auth): -```python -import petstore_api -from petstore_api.apis.tags import pet_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure OAuth2 access token for authorization: petstore_auth -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2", - access_token = 'YOUR_ACCESS_TOKEN' -) -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = pet_api.PetApi(api_client) - - # example passing only required values which don't have defaults set - path_params = { - 'petId': 1, - } - try: - # Updates a pet in the store with form data - api_response = api_instance.update_pet_with_form( - path_params=path_params, - ) - except petstore_api.ApiException as e: - print("Exception when calling PetApi->update_pet_with_form: %s\n" % e) - - # example passing only optional values - path_params = { - 'petId': 1, - } - body = dict( - name="name_example", - status="status_example", - ) - try: - # Updates a pet in the store with form data - api_response = api_instance.update_pet_with_form( - path_params=path_params, - body=body, - ) - except petstore_api.ApiException as e: - print("Exception when calling PetApi->update_pet_with_form: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, Unset] | optional, default is unset | -path_params | RequestPathParams | | -content_type | str | optional, default is 'application/x-www-form-urlencoded' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationXWwwFormUrlencoded - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**name** | str, | str, | Updated name of the pet | [optional] -**status** | str, | str, | Updated status of the pet | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -### path_params -#### RequestPathParams - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -petId | PetIdSchema | | - -# PetIdSchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -decimal.Decimal, int, | decimal.Decimal, | | value must be a 64 bit integer - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -405 | [ApiResponseFor405](#update_pet_with_form.ApiResponseFor405) | Invalid input - -#### update_pet_with_form.ApiResponseFor405 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -[petstore_auth](../../../README.md#petstore_auth) - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **upload_file_with_required_file** - -> ApiResponse upload_file_with_required_file(pet_id) - -uploads an image (required) - -### Example - -* OAuth Authentication (petstore_auth): -```python -import petstore_api -from petstore_api.apis.tags import pet_api -from petstore_api.model.api_response import ApiResponse -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure OAuth2 access token for authorization: petstore_auth -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2", - access_token = 'YOUR_ACCESS_TOKEN' -) -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = pet_api.PetApi(api_client) - - # example passing only required values which don't have defaults set - path_params = { - 'petId': 1, - } - try: - # uploads an image (required) - api_response = api_instance.upload_file_with_required_file( - path_params=path_params, - ) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling PetApi->upload_file_with_required_file: %s\n" % e) - - # example passing only optional values - path_params = { - 'petId': 1, - } - body = dict( - additional_metadata="additional_metadata_example", - required_file=open('/path/to/file', 'rb'), - ) - try: - # uploads an image (required) - api_response = api_instance.upload_file_with_required_file( - path_params=path_params, - body=body, - ) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling PetApi->upload_file_with_required_file: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyMultipartFormData, Unset] | optional, default is unset | -path_params | RequestPathParams | | -content_type | str | optional, default is 'multipart/form-data' | Selects the schema and serialization of the request body -accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyMultipartFormData - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**requiredFile** | bytes, io.FileIO, io.BufferedReader, | bytes, FileIO, | file to upload | -**additionalMetadata** | str, | str, | Additional data to pass to server | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -### path_params -#### RequestPathParams - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -petId | PetIdSchema | | - -# PetIdSchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -decimal.Decimal, int, | decimal.Decimal, | | value must be a 64 bit integer - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#upload_file_with_required_file.ApiResponseFor200) | successful operation - -#### upload_file_with_required_file.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**ApiResponse**](../../models/ApiResponse.md) | | - - -### Authorization - -[petstore_auth](../../../README.md#petstore_auth) - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **upload_image** - -> ApiResponse upload_image(pet_id) - -uploads an image - -### Example - -* OAuth Authentication (petstore_auth): -```python -import petstore_api -from petstore_api.apis.tags import pet_api -from petstore_api.model.api_response import ApiResponse -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure OAuth2 access token for authorization: petstore_auth -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2", - access_token = 'YOUR_ACCESS_TOKEN' -) -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = pet_api.PetApi(api_client) - - # example passing only required values which don't have defaults set - path_params = { - 'petId': 1, - } - try: - # uploads an image - api_response = api_instance.upload_image( - path_params=path_params, - ) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling PetApi->upload_image: %s\n" % e) - - # example passing only optional values - path_params = { - 'petId': 1, - } - body = dict( - additional_metadata="additional_metadata_example", - file=open('/path/to/file', 'rb'), - ) - try: - # uploads an image - api_response = api_instance.upload_image( - path_params=path_params, - body=body, - ) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling PetApi->upload_image: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyMultipartFormData, Unset] | optional, default is unset | -path_params | RequestPathParams | | -content_type | str | optional, default is 'multipart/form-data' | Selects the schema and serialization of the request body -accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyMultipartFormData - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**additionalMetadata** | str, | str, | Additional data to pass to server | [optional] -**file** | bytes, io.FileIO, io.BufferedReader, | bytes, FileIO, | file to upload | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -### path_params -#### RequestPathParams - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -petId | PetIdSchema | | - -# PetIdSchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -decimal.Decimal, int, | decimal.Decimal, | | value must be a 64 bit integer - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#upload_image.ApiResponseFor200) | successful operation - -#### upload_image.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**ApiResponse**](../../models/ApiResponse.md) | | - - -### Authorization - -[petstore_auth](../../../README.md#petstore_auth) - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/apis/tags/StoreApi.md b/samples/openapi3/client/petstore/python/docs/apis/tags/StoreApi.md deleted file mode 100644 index a75abbcffc0..00000000000 --- a/samples/openapi3/client/petstore/python/docs/apis/tags/StoreApi.md +++ /dev/null @@ -1,391 +0,0 @@ - -# petstore_api.apis.tags.store_api.StoreApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**delete_order**](#delete_order) | **delete** /store/order/{order_id} | Delete purchase order by ID -[**get_inventory**](#get_inventory) | **get** /store/inventory | Returns pet inventories by status -[**get_order_by_id**](#get_order_by_id) | **get** /store/order/{order_id} | Find purchase order by ID -[**place_order**](#place_order) | **post** /store/order | Place an order for a pet - -# **delete_order** - -> delete_order(order_id) - -Delete purchase order by ID - -For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - -### Example - -```python -import petstore_api -from petstore_api.apis.tags import store_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = store_api.StoreApi(api_client) - - # example passing only required values which don't have defaults set - path_params = { - 'order_id': "order_id_example", - } - try: - # Delete purchase order by ID - api_response = api_instance.delete_order( - path_params=path_params, - ) - except petstore_api.ApiException as e: - print("Exception when calling StoreApi->delete_order: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -path_params | RequestPathParams | | -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### path_params -#### RequestPathParams - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -order_id | OrderIdSchema | | - -# OrderIdSchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -400 | [ApiResponseFor400](#delete_order.ApiResponseFor400) | Invalid ID supplied -404 | [ApiResponseFor404](#delete_order.ApiResponseFor404) | Order not found - -#### delete_order.ApiResponseFor400 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -#### delete_order.ApiResponseFor404 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **get_inventory** - -> {str: (int,)} get_inventory() - -Returns pet inventories by status - -Returns a map of status codes to quantities - -### Example - -* Api Key Authentication (api_key): -```python -import petstore_api -from petstore_api.apis.tags import store_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: api_key -configuration.api_key['api_key'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key'] = 'Bearer' -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = store_api.StoreApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - # Returns pet inventories by status - api_response = api_instance.get_inventory() - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling StoreApi->get_inventory: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#get_inventory.ApiResponseFor200) | successful operation - -#### get_inventory.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**any_string_name** | decimal.Decimal, int, | decimal.Decimal, | any string name can be used but the value must be the correct type | [optional] value must be a 32 bit integer - -### Authorization - -[api_key](../../../README.md#api_key) - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **get_order_by_id** - -> Order get_order_by_id(order_id) - -Find purchase order by ID - -For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - -### Example - -```python -import petstore_api -from petstore_api.apis.tags import store_api -from petstore_api.model.order import Order -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = store_api.StoreApi(api_client) - - # example passing only required values which don't have defaults set - path_params = { - 'order_id': 1, - } - try: - # Find purchase order by ID - api_response = api_instance.get_order_by_id( - path_params=path_params, - ) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling StoreApi->get_order_by_id: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -path_params | RequestPathParams | | -accept_content_types | typing.Tuple[str] | default is ('application/xml', 'application/json', ) | Tells the server the content type(s) that are accepted by the client -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### path_params -#### RequestPathParams - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -order_id | OrderIdSchema | | - -# OrderIdSchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -decimal.Decimal, int, | decimal.Decimal, | | value must be a 64 bit integer - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#get_order_by_id.ApiResponseFor200) | successful operation -400 | [ApiResponseFor400](#get_order_by_id.ApiResponseFor400) | Invalid ID supplied -404 | [ApiResponseFor404](#get_order_by_id.ApiResponseFor404) | Order not found - -#### get_order_by_id.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationXml, SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationXml -Type | Description | Notes -------------- | ------------- | ------------- -[**Order**](../../models/Order.md) | | - - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**Order**](../../models/Order.md) | | - - -#### get_order_by_id.ApiResponseFor400 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -#### get_order_by_id.ApiResponseFor404 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **place_order** - -> Order place_order(order) - -Place an order for a pet - -### Example - -```python -import petstore_api -from petstore_api.apis.tags import store_api -from petstore_api.model.order import Order -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = store_api.StoreApi(api_client) - - # example passing only required values which don't have defaults set - body = Order( - id=1, - pet_id=1, - quantity=1, - ship_date="2020-02-02T20:20:20.000222Z", - status="placed", - complete=False, - ) - try: - # Place an order for a pet - api_response = api_instance.place_order( - body=body, - ) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling StoreApi->place_order: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -accept_content_types | typing.Tuple[str] | default is ('application/xml', 'application/json', ) | Tells the server the content type(s) that are accepted by the client -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**Order**](../../models/Order.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#place_order.ApiResponseFor200) | successful operation -400 | [ApiResponseFor400](#place_order.ApiResponseFor400) | Invalid Order - -#### place_order.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationXml, SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationXml -Type | Description | Notes -------------- | ------------- | ------------- -[**Order**](../../models/Order.md) | | - - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**Order**](../../models/Order.md) | | - - -#### place_order.ApiResponseFor400 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/apis/tags/UserApi.md b/samples/openapi3/client/petstore/python/docs/apis/tags/UserApi.md deleted file mode 100644 index 6b0fd83c5db..00000000000 --- a/samples/openapi3/client/petstore/python/docs/apis/tags/UserApi.md +++ /dev/null @@ -1,794 +0,0 @@ - -# petstore_api.apis.tags.user_api.UserApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**create_user**](#create_user) | **post** /user | Create user -[**create_users_with_array_input**](#create_users_with_array_input) | **post** /user/createWithArray | Creates list of users with given input array -[**create_users_with_list_input**](#create_users_with_list_input) | **post** /user/createWithList | Creates list of users with given input array -[**delete_user**](#delete_user) | **delete** /user/{username} | Delete user -[**get_user_by_name**](#get_user_by_name) | **get** /user/{username} | Get user by user name -[**login_user**](#login_user) | **get** /user/login | Logs user into the system -[**logout_user**](#logout_user) | **get** /user/logout | Logs out current logged in user session -[**update_user**](#update_user) | **put** /user/{username} | Updated user - -# **create_user** - -> create_user(user) - -Create user - -This can only be done by the logged in user. - -### Example - -```python -import petstore_api -from petstore_api.apis.tags import user_api -from petstore_api.model.user import User -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = user_api.UserApi(api_client) - - # example passing only required values which don't have defaults set - body = User( - id=1, - username="username_example", - first_name="first_name_example", - last_name="last_name_example", - email="email_example", - password="password_example", - phone="phone_example", - user_status=1, - object_with_no_declared_props=dict(), - object_with_no_declared_props_nullable=dict(), - any_type_prop=None, - any_type_except_null_prop=None, - any_type_prop_nullable=None, - ) - try: - # Create user - api_response = api_instance.create_user( - body=body, - ) - except petstore_api.ApiException as e: - print("Exception when calling UserApi->create_user: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**User**](../../models/User.md) | | - - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -default | [ApiResponseForDefault](#create_user.ApiResponseForDefault) | successful operation - -#### create_user.ApiResponseForDefault -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **create_users_with_array_input** - -> create_users_with_array_input(user) - -Creates list of users with given input array - -### Example - -```python -import petstore_api -from petstore_api.apis.tags import user_api -from petstore_api.model.user import User -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = user_api.UserApi(api_client) - - # example passing only required values which don't have defaults set - body = [ - User( - id=1, - username="username_example", - first_name="first_name_example", - last_name="last_name_example", - email="email_example", - password="password_example", - phone="phone_example", - user_status=1, - object_with_no_declared_props=dict(), - object_with_no_declared_props_nullable=dict(), - any_type_prop=None, - any_type_except_null_prop=None, - any_type_prop_nullable=None, - ) - ] - try: - # Creates list of users with given input array - api_response = api_instance.create_users_with_array_input( - body=body, - ) - except petstore_api.ApiException as e: - print("Exception when calling UserApi->create_users_with_array_input: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -list, tuple, | tuple, | | - -### Tuple Items -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[**User**]({{complexTypePrefix}}User.md) | [**User**]({{complexTypePrefix}}User.md) | [**User**]({{complexTypePrefix}}User.md) | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -default | [ApiResponseForDefault](#create_users_with_array_input.ApiResponseForDefault) | successful operation - -#### create_users_with_array_input.ApiResponseForDefault -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **create_users_with_list_input** - -> create_users_with_list_input(user) - -Creates list of users with given input array - -### Example - -```python -import petstore_api -from petstore_api.apis.tags import user_api -from petstore_api.model.user import User -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = user_api.UserApi(api_client) - - # example passing only required values which don't have defaults set - body = [ - User( - id=1, - username="username_example", - first_name="first_name_example", - last_name="last_name_example", - email="email_example", - password="password_example", - phone="phone_example", - user_status=1, - object_with_no_declared_props=dict(), - object_with_no_declared_props_nullable=dict(), - any_type_prop=None, - any_type_except_null_prop=None, - any_type_prop_nullable=None, - ) - ] - try: - # Creates list of users with given input array - api_response = api_instance.create_users_with_list_input( - body=body, - ) - except petstore_api.ApiException as e: - print("Exception when calling UserApi->create_users_with_list_input: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -list, tuple, | tuple, | | - -### Tuple Items -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[**User**]({{complexTypePrefix}}User.md) | [**User**]({{complexTypePrefix}}User.md) | [**User**]({{complexTypePrefix}}User.md) | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -default | [ApiResponseForDefault](#create_users_with_list_input.ApiResponseForDefault) | successful operation - -#### create_users_with_list_input.ApiResponseForDefault -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **delete_user** - -> delete_user(username) - -Delete user - -This can only be done by the logged in user. - -### Example - -```python -import petstore_api -from petstore_api.apis.tags import user_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = user_api.UserApi(api_client) - - # example passing only required values which don't have defaults set - path_params = { - 'username': "username_example", - } - try: - # Delete user - api_response = api_instance.delete_user( - path_params=path_params, - ) - except petstore_api.ApiException as e: - print("Exception when calling UserApi->delete_user: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -path_params | RequestPathParams | | -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### path_params -#### RequestPathParams - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -username | UsernameSchema | | - -# UsernameSchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#delete_user.ApiResponseFor200) | Success -404 | [ApiResponseFor404](#delete_user.ApiResponseFor404) | User not found - -#### delete_user.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -#### delete_user.ApiResponseFor404 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **get_user_by_name** - -> User get_user_by_name(username) - -Get user by user name - -### Example - -```python -import petstore_api -from petstore_api.apis.tags import user_api -from petstore_api.model.user import User -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = user_api.UserApi(api_client) - - # example passing only required values which don't have defaults set - path_params = { - 'username': "username_example", - } - try: - # Get user by user name - api_response = api_instance.get_user_by_name( - path_params=path_params, - ) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling UserApi->get_user_by_name: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -path_params | RequestPathParams | | -accept_content_types | typing.Tuple[str] | default is ('application/xml', 'application/json', ) | Tells the server the content type(s) that are accepted by the client -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### path_params -#### RequestPathParams - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -username | UsernameSchema | | - -# UsernameSchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#get_user_by_name.ApiResponseFor200) | successful operation -400 | [ApiResponseFor400](#get_user_by_name.ApiResponseFor400) | Invalid username supplied -404 | [ApiResponseFor404](#get_user_by_name.ApiResponseFor404) | User not found - -#### get_user_by_name.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationXml, SchemaFor200ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor200ResponseBodyApplicationXml -Type | Description | Notes -------------- | ------------- | ------------- -[**User**](../../models/User.md) | | - - -# SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**User**](../../models/User.md) | | - - -#### get_user_by_name.ApiResponseFor400 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -#### get_user_by_name.ApiResponseFor404 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **login_user** - -> str login_user(usernamepassword) - -Logs user into the system - -### Example - -```python -import petstore_api -from petstore_api.apis.tags import user_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = user_api.UserApi(api_client) - - # example passing only required values which don't have defaults set - query_params = { - 'username': "username_example", - 'password': "password_example", - } - try: - # Logs user into the system - api_response = api_instance.login_user( - query_params=query_params, - ) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling UserApi->login_user: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -query_params | RequestQueryParams | | -accept_content_types | typing.Tuple[str] | default is ('application/xml', 'application/json', ) | Tells the server the content type(s) that are accepted by the client -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### query_params -#### RequestQueryParams - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -username | UsernameSchema | | -password | PasswordSchema | | - - -# UsernameSchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | - -# PasswordSchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#login_user.ApiResponseFor200) | successful operation -400 | [ApiResponseFor400](#login_user.ApiResponseFor400) | Invalid username/password supplied - -#### login_user.ApiResponseFor200 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationXml, SchemaFor200ResponseBodyApplicationJson, ] | | -headers | ResponseHeadersFor200 | | - -# SchemaFor200ResponseBodyApplicationXml - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | - -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | -#### ResponseHeadersFor200 - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -X-Rate-Limit | XRateLimitSchema | | optional -X-Expires-After | XExpiresAfterSchema | | optional - -# XRateLimitSchema - -calls per hour allowed by the user - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -decimal.Decimal, int, | decimal.Decimal, | calls per hour allowed by the user | value must be a 32 bit integer - -# XExpiresAfterSchema - -date in UTC when token expires - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, datetime, | str, | date in UTC when token expires | value must conform to RFC-3339 date-time - - -#### login_user.ApiResponseFor400 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **logout_user** - -> logout_user() - -Logs out current logged in user session - -### Example - -```python -import petstore_api -from petstore_api.apis.tags import user_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = user_api.UserApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - # Logs out current logged in user session - api_response = api_instance.logout_user() - except petstore_api.ApiException as e: - print("Exception when calling UserApi->logout_user: %s\n" % e) -``` -### Parameters -This endpoint does not need any parameter. - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -default | [ApiResponseForDefault](#logout_user.ApiResponseForDefault) | successful operation - -#### logout_user.ApiResponseForDefault -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - -# **update_user** - -> update_user(usernameuser) - -Updated user - -This can only be done by the logged in user. - -### Example - -```python -import petstore_api -from petstore_api.apis.tags import user_api -from petstore_api.model.user import User -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = user_api.UserApi(api_client) - - # example passing only required values which don't have defaults set - path_params = { - 'username': "username_example", - } - body = User( - id=1, - username="username_example", - first_name="first_name_example", - last_name="last_name_example", - email="email_example", - password="password_example", - phone="phone_example", - user_status=1, - object_with_no_declared_props=dict(), - object_with_no_declared_props_nullable=dict(), - any_type_prop=None, - any_type_except_null_prop=None, - any_type_prop_nullable=None, - ) - try: - # Updated user - api_response = api_instance.update_user( - path_params=path_params, - body=body, - ) - except petstore_api.ApiException as e: - print("Exception when calling UserApi->update_user: %s\n" % e) -``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | -path_params | RequestPathParams | | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body -stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file -timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client -skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned - -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**User**](../../models/User.md) | | - - -### path_params -#### RequestPathParams - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -username | UsernameSchema | | - -# UsernameSchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | - -### Return Types, Responses - -Code | Class | Description -------------- | ------------- | ------------- -n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -400 | [ApiResponseFor400](#update_user.ApiResponseFor400) | Invalid user supplied -404 | [ApiResponseFor404](#update_user.ApiResponseFor404) | User not found - -#### update_user.ApiResponseFor400 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -#### update_user.ApiResponseFor404 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | Unset | body was not defined | -headers | Unset | headers were not defined | - -### Authorization - -No authorization required - -[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/apis/tags/another_fake_api.md b/samples/openapi3/client/petstore/python/docs/apis/tags/another_fake_api.md new file mode 100644 index 00000000000..d08e53b4b38 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/apis/tags/another_fake_api.md @@ -0,0 +1,14 @@ + +petstore_api.apis.tags.another_fake_api +# AnotherFakeApi + +All URIs are relative to the selected server +- The server is selected by passing in server_info and server_index into api_configuration.ApiConfiguration +- Code samples in endpoints documents show how to do this +- server_index can also be passed in to endpoint calls, see endpoint documentation + +Method | Description +------ | ------------- +[**call_123_test__special_tags**](../../paths/another_fake_dummy/patch.md) | To test special tags + +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/apis/tags/default_api.md b/samples/openapi3/client/petstore/python/docs/apis/tags/default_api.md new file mode 100644 index 00000000000..f5cff3da626 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/apis/tags/default_api.md @@ -0,0 +1,17 @@ + +petstore_api.apis.tags.default_api +# DefaultApi + +## Description +operations that lack tags are assigned this default tag + +All URIs are relative to the selected server +- The server is selected by passing in server_info and server_index into api_configuration.ApiConfiguration +- Code samples in endpoints documents show how to do this +- server_index can also be passed in to endpoint calls, see endpoint documentation + +Method | Description +------ | ------------- +[**foo_get**](../../paths/foo/get.md) | + +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/apis/tags/fake_api.md b/samples/openapi3/client/petstore/python/docs/apis/tags/fake_api.md new file mode 100644 index 00000000000..addb0e893ac --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/apis/tags/fake_api.md @@ -0,0 +1,50 @@ + +petstore_api.apis.tags.fake_api +# FakeApi + +All URIs are relative to the selected server +- The server is selected by passing in server_info and server_index into api_configuration.ApiConfiguration +- Code samples in endpoints documents show how to do this +- server_index can also be passed in to endpoint calls, see endpoint documentation + +Method | Description +------ | ------------- +[**additional_properties_with_array_of_enums**](../../paths/fake_additional_properties_with_array_of_enums/get.md) | Additional Properties with Array of Enums +[**array_model**](../../paths/fake_refs_arraymodel/post.md) | +[**array_of_enums**](../../paths/fake_refs_array_of_enums/post.md) | Array of Enums +[**body_with_file_schema**](../../paths/fake_body_with_file_schema/put.md) | +[**body_with_query_params**](../../paths/fake_body_with_query_params/put.md) | +[**boolean**](../../paths/fake_refs_boolean/post.md) | +[**case_sensitive_params**](../../paths/fake_case_sensitive_params/put.md) | +[**client_model**](../../paths/fake/patch.md) | To test \"client\" model +[**composed_one_of_different_types**](../../paths/fake_refs_composed_one_of_number_with_validations/post.md) | +[**delete_coffee**](../../paths/fake_delete_coffee_id/delete.md) | Delete coffee +[**endpoint_parameters**](../../paths/fake/post.md) | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[**enum_parameters**](../../paths/fake/get.md) | To test enum parameters +[**fake_health_get**](../../paths/fake_health/get.md) | Health check endpoint +[**group_parameters**](../../paths/fake/delete.md) | Fake endpoint to test group parameters (optional) +[**inline_additional_properties**](../../paths/fake_inline_additional_properties/post.md) | test inline additionalProperties +[**inline_composition**](../../paths/fake_inline_composition/post.md) | testing composed schemas at inline locations +[**json_form_data**](../../paths/fake_json_form_data/get.md) | test json serialization of form data +[**json_patch**](../../paths/fake_json_patch/patch.md) | json patch +[**json_with_charset**](../../paths/fake_json_with_charset/post.md) | json with charset tx and rx +[**mammal**](../../paths/fake_refs_mammal/post.md) | +[**multiple_response_bodies**](../../paths/fake_multiple_response_bodies/get.md) | multiple responses have response bodies +[**multiple_securities**](../../paths/fake_multiple_securities/get.md) | multiple security requirements +[**number_with_validations**](../../paths/fake_refs_number/post.md) | +[**object_in_query**](../../paths/fake_obj_in_query/get.md) | user list +[**object_model_with_ref_props**](../../paths/fake_refs_object_model_with_ref_props/post.md) | +[**parameter_collisions**](../../paths/fake_parameter_collisions1_abab_self_ab/post.md) | parameter collision case +[**query_param_with_json_content_type**](../../paths/fake_query_param_with_json_content_type/get.md) | query param with json content-type +[**query_parameter_collection_format**](../../paths/fake_test_query_paramters/put.md) | +[**redirection**](../../paths/fake_redirection/get.md) | operation with redirection responses +[**ref_object_in_query**](../../paths/fake_ref_obj_in_query/get.md) | user list +[**response_without_schema**](../../paths/fake_response_without_schema/get.md) | receives a response without schema +[**string**](../../paths/fake_refs_string/post.md) | +[**string_enum**](../../paths/fake_refs_enum/post.md) | +[**upload_download_file**](../../paths/fake_upload_download_file/post.md) | uploads a file and downloads a file using application/octet-stream +[**upload_file**](../../paths/fake_upload_file/post.md) | uploads a file using multipart/form-data +[**upload_files**](../../paths/fake_upload_files/post.md) | uploads files using multipart/form-data +[**wild_card_responses**](../../paths/fake_wild_card_responses/get.md) | operation with wildcard responses + +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/apis/tags/fake_classname_tags123_api.md b/samples/openapi3/client/petstore/python/docs/apis/tags/fake_classname_tags123_api.md new file mode 100644 index 00000000000..03a78ae2221 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/apis/tags/fake_classname_tags123_api.md @@ -0,0 +1,14 @@ + +petstore_api.apis.tags.fake_classname_tags123_api +# FakeClassnameTags123Api + +All URIs are relative to the selected server +- The server is selected by passing in server_info and server_index into api_configuration.ApiConfiguration +- Code samples in endpoints documents show how to do this +- server_index can also be passed in to endpoint calls, see endpoint documentation + +Method | Description +------ | ------------- +[**classname**](../../paths/fake_classname_test/patch.md) | To test class name in snake case + +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/apis/tags/pet_api.md b/samples/openapi3/client/petstore/python/docs/apis/tags/pet_api.md new file mode 100644 index 00000000000..712c3394921 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/apis/tags/pet_api.md @@ -0,0 +1,25 @@ + +petstore_api.apis.tags.pet_api +# PetApi + +## Description +Everything about your Pets + +All URIs are relative to the selected server +- The server is selected by passing in server_info and server_index into api_configuration.ApiConfiguration +- Code samples in endpoints documents show how to do this +- server_index can also be passed in to endpoint calls, see endpoint documentation + +Method | Description +------ | ------------- +[**add_pet**](../../paths/pet/post.md) | Add a new pet to the store +[**delete_pet**](../../paths/pet_pet_id/delete.md) | Deletes a pet +[**find_pets_by_status**](../../paths/pet_find_by_status/get.md) | Finds Pets by status +[**find_pets_by_tags**](../../paths/pet_find_by_tags/get.md) | Finds Pets by tags +[**get_pet_by_id**](../../paths/pet_pet_id/get.md) | Find pet by ID +[**update_pet**](../../paths/pet/put.md) | Update an existing pet +[**update_pet_with_form**](../../paths/pet_pet_id/post.md) | Updates a pet in the store with form data +[**upload_file_with_required_file**](../../paths/fake_pet_id_upload_image_with_required_file/post.md) | uploads an image (required) +[**upload_image**](../../paths/pet_pet_id_upload_image/post.md) | uploads an image + +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/apis/tags/store_api.md b/samples/openapi3/client/petstore/python/docs/apis/tags/store_api.md new file mode 100644 index 00000000000..2b031a628e1 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/apis/tags/store_api.md @@ -0,0 +1,20 @@ + +petstore_api.apis.tags.store_api +# StoreApi + +## Description +Access to Petstore orders + +All URIs are relative to the selected server +- The server is selected by passing in server_info and server_index into api_configuration.ApiConfiguration +- Code samples in endpoints documents show how to do this +- server_index can also be passed in to endpoint calls, see endpoint documentation + +Method | Description +------ | ------------- +[**delete_order**](../../paths/store_order_order_id/delete.md) | Delete purchase order by ID +[**get_inventory**](../../paths/store_inventory/get.md) | Returns pet inventories by status +[**get_order_by_id**](../../paths/store_order_order_id/get.md) | Find purchase order by ID +[**place_order**](../../paths/store_order/post.md) | Place an order for a pet + +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/apis/tags/user_api.md b/samples/openapi3/client/petstore/python/docs/apis/tags/user_api.md new file mode 100644 index 00000000000..55b7c628c58 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/apis/tags/user_api.md @@ -0,0 +1,24 @@ + +petstore_api.apis.tags.user_api +# UserApi + +## Description +Operations about user + +All URIs are relative to the selected server +- The server is selected by passing in server_info and server_index into api_configuration.ApiConfiguration +- Code samples in endpoints documents show how to do this +- server_index can also be passed in to endpoint calls, see endpoint documentation + +Method | Description +------ | ------------- +[**create_user**](../../paths/user/post.md) | Create user +[**create_users_with_array_input**](../../paths/user_create_with_array/post.md) | Creates list of users with given input array +[**create_users_with_list_input**](../../paths/user_create_with_list/post.md) | Creates list of users with given input array +[**delete_user**](../../paths/user_username/delete.md) | Delete user +[**get_user_by_name**](../../paths/user_username/get.md) | Get user by user name +[**login_user**](../../paths/user_login/get.md) | Logs user into the system +[**logout_user**](../../paths/user_logout/get.md) | Logs out current logged in user session +[**update_user**](../../paths/user_username/put.md) | Updated user + +[[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/headers/header_int32_json_content_type_header.md b/samples/openapi3/client/petstore/python/docs/components/headers/header_int32_json_content_type_header.md new file mode 100644 index 00000000000..06480907d4a --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/headers/header_int32_json_content_type_header.md @@ -0,0 +1,19 @@ +petstore_api.components.headers.header_int32_json_content_type_header +# Header Int32JsonContentTypeHeader + +## Description +int32 JSON content-type header + +## Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#content-applicationjson-schema) + +## content ApplicationJson Schema + +### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +decimal.Decimal, int | decimal.Decimal | | value must be a 32 bit integer + +[[Back to top]](#top) [[Back to Component Headers]](../../../README.md#Component-Headers) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/headers/header_number_header.md b/samples/openapi3/client/petstore/python/docs/components/headers/header_number_header.md new file mode 100644 index 00000000000..ace777068c0 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/headers/header_number_header.md @@ -0,0 +1,14 @@ +petstore_api.components.headers.header_number_header +# Header NumberHeader + +## Description +number header description + +## Schema + +### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str | str | | value must be numeric and storable in decimal.Decimal + +[[Back to top]](#top) [[Back to Component Headers]](../../../README.md#Component-Headers) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/headers/header_ref_content_schema_header.md b/samples/openapi3/client/petstore/python/docs/components/headers/header_ref_content_schema_header.md new file mode 100644 index 00000000000..69b7b5ef736 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/headers/header_ref_content_schema_header.md @@ -0,0 +1,19 @@ +petstore_api.components.headers.header_ref_content_schema_header +# Header RefContentSchemaHeader + +## Description +int32 JSON content-type header + +## Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#content-applicationjson-schema) + +## content ApplicationJson Schema + +### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[StringWithValidation](../../components/schema/string_with_validation.md) | str | str | + +[[Back to top]](#top) [[Back to Component Headers]](../../../README.md#Component-Headers) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/headers/header_ref_schema_header.md b/samples/openapi3/client/petstore/python/docs/components/headers/header_ref_schema_header.md new file mode 100644 index 00000000000..5d2f86b954e --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/headers/header_ref_schema_header.md @@ -0,0 +1,14 @@ +petstore_api.components.headers.header_ref_schema_header +# Header RefSchemaHeader + +## Description +header that has a ref in the schema + +## Schema + +### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[StringWithValidation](../../components/schema/string_with_validation.md) | str | str | + +[[Back to top]](#top) [[Back to Component Headers]](../../../README.md#Component-Headers) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/headers/header_ref_string_header.md b/samples/openapi3/client/petstore/python/docs/components/headers/header_ref_string_header.md new file mode 100644 index 00000000000..3fb984d2c04 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/headers/header_ref_string_header.md @@ -0,0 +1,8 @@ +petstore_api.components.headers.header_ref_string_header +# Header RefStringHeader +## Schema +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[StringHeader.schema](../../components/headers/header_string_header.md#schema) | str | str | + +[[Back to top]](#top) [[Back to Component Headers]](../../../README.md#Component-Headers) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/headers/header_string_header.md b/samples/openapi3/client/petstore/python/docs/components/headers/header_string_header.md new file mode 100644 index 00000000000..b954dc0b734 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/headers/header_string_header.md @@ -0,0 +1,14 @@ +petstore_api.components.headers.header_string_header +# Header StringHeader + +## Description +string header description + +## Schema + +### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str | str | | + +[[Back to top]](#top) [[Back to Component Headers]](../../../README.md#Component-Headers) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/parameters/parameter_component_ref_schema_string_with_validation.md b/samples/openapi3/client/petstore/python/docs/components/parameters/parameter_component_ref_schema_string_with_validation.md new file mode 100644 index 00000000000..0aee4efb41e --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/parameters/parameter_component_ref_schema_string_with_validation.md @@ -0,0 +1,18 @@ +petstore_api.components.parameters.parameter_component_ref_schema_string_with_validation +# Parameter ComponentRefSchemaStringWithValidation + +## Description +a path string with validation + +## Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#content-applicationjson-schema) +## content ApplicationJson Schema + +### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[StringWithValidation](../../components/schema/string_with_validation.md) | str | str | + +[[Back to top]](#top) [[Back to Component Parameters]](../../../README.md#Component-Parameters) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/parameters/parameter_path_user_name.md b/samples/openapi3/client/petstore/python/docs/components/parameters/parameter_path_user_name.md new file mode 100644 index 00000000000..4a332e34abc --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/parameters/parameter_path_user_name.md @@ -0,0 +1,14 @@ +petstore_api.components.parameters.parameter_path_user_name +# Parameter PathUserName + +## Description +the use name to use + +## Schema + +### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str | str | | + +[[Back to top]](#top) [[Back to Component Parameters]](../../../README.md#Component-Parameters) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/parameters/parameter_ref_path_user_name.md b/samples/openapi3/client/petstore/python/docs/components/parameters/parameter_ref_path_user_name.md new file mode 100644 index 00000000000..a4521372033 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/parameters/parameter_ref_path_user_name.md @@ -0,0 +1,8 @@ +petstore_api.components.parameters.parameter_ref_path_user_name +# Parameter RefPathUserName +## Schema +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[PathUserName.schema](../../components/parameters/parameter_path_user_name.md#schema) | str | str | + +[[Back to top]](#top) [[Back to Component Parameters]](../../../README.md#Component-Parameters) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/parameters/parameter_ref_schema_string_with_validation.md b/samples/openapi3/client/petstore/python/docs/components/parameters/parameter_ref_schema_string_with_validation.md new file mode 100644 index 00000000000..742967d6a49 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/parameters/parameter_ref_schema_string_with_validation.md @@ -0,0 +1,14 @@ +petstore_api.components.parameters.parameter_ref_schema_string_with_validation +# Parameter RefSchemaStringWithValidation + +## Description +a path string with validation + +## Schema + +### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[StringWithValidation](../../components/schema/string_with_validation.md) | str | str | + +[[Back to top]](#top) [[Back to Component Parameters]](../../../README.md#Component-Parameters) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/request_bodies/request_body_client.md b/samples/openapi3/client/petstore/python/docs/components/request_bodies/request_body_client.md new file mode 100644 index 00000000000..ef19e9497f0 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/request_bodies/request_body_client.md @@ -0,0 +1,19 @@ +petstore_api.components.request_bodies.request_body_client +# RequestBody Client + +## Description +client model + +## Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#content-applicationjson-schema) + +## content ApplicationJson Schema + +### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[Client](../../components/schema/client.md) | dict, frozendict.frozendict | frozendict.frozendict | + +[[Back to top]](#top) [[Back to Component RequestBodies]](../../../README.md#Component-RequestBodies) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/request_bodies/request_body_pet.md b/samples/openapi3/client/petstore/python/docs/components/request_bodies/request_body_pet.md new file mode 100644 index 00000000000..ffc5be4f822 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/request_bodies/request_body_pet.md @@ -0,0 +1,26 @@ +petstore_api.components.request_bodies.request_body_pet +# RequestBody Pet + +## Description +Pet object that needs to be added to the store, multiple content types + +## Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#content-applicationjson-schema) +"application/xml" | [content.application_xml.Schema](#content-applicationxml-schema) + +## content ApplicationJson Schema + +### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[Pet](../../components/schema/pet.md) | dict, frozendict.frozendict | frozendict.frozendict | +## content ApplicationXml Schema + +### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[RefPet](../../components/schema/ref_pet.md) | dict, frozendict.frozendict | frozendict.frozendict | + +[[Back to top]](#top) [[Back to Component RequestBodies]](../../../README.md#Component-RequestBodies) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/request_bodies/request_body_ref_user_array.md b/samples/openapi3/client/petstore/python/docs/components/request_bodies/request_body_ref_user_array.md new file mode 100644 index 00000000000..5af92bc4e39 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/request_bodies/request_body_ref_user_array.md @@ -0,0 +1,14 @@ +petstore_api.components.request_bodies.request_body_ref_user_array +# RequestBody RefUserArray + +## Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#content-applicationjson-schema) + +## content ApplicationJson Schema +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[UserArray.content.application_json.schema](../../components/request_bodies/request_body_user_array.md#content-applicationjson-schema) | list, tuple | tuple | + +[[Back to top]](#top) [[Back to Component RequestBodies]](../../../README.md#Component-RequestBodies) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/request_bodies/request_body_user_array.md b/samples/openapi3/client/petstore/python/docs/components/request_bodies/request_body_user_array.md new file mode 100644 index 00000000000..4bb780d180e --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/request_bodies/request_body_user_array.md @@ -0,0 +1,24 @@ +petstore_api.components.request_bodies.request_body_user_array +# RequestBody UserArray + +## Description +List of user object + +## Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#content-applicationjson-schema) + +## content ApplicationJson Schema + +### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +list, tuple | tuple | | + +### List Items +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[**User**](../../components/schema/user.md) | [**User**](../../components/schema/user.md) | [**User**](../../components/schema/user.md) | | + +[[Back to top]](#top) [[Back to Component RequestBodies]](../../../README.md#Component-RequestBodies) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/responses/response_ref_success_description_only.md b/samples/openapi3/client/petstore/python/docs/components/responses/response_ref_success_description_only.md new file mode 100644 index 00000000000..183cda5d99d --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/responses/response_ref_success_description_only.md @@ -0,0 +1,11 @@ +petstore_api.components.responses.response_ref_success_description_only +# Response RefSuccessDescriptionOnly + +## response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +[[Back to top]](#top) [[Back to Component Responses]](../../../README.md#Component-Responses) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/responses/response_ref_successful_xml_and_json_array_of_pet.md b/samples/openapi3/client/petstore/python/docs/components/responses/response_ref_successful_xml_and_json_array_of_pet.md new file mode 100644 index 00000000000..6f093ae5ee6 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/responses/response_ref_successful_xml_and_json_array_of_pet.md @@ -0,0 +1,11 @@ +petstore_api.components.responses.response_ref_successful_xml_and_json_array_of_pet +# Response RefSuccessfulXmlAndJsonArrayOfPet + +## response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | typing.Union[[SuccessfulXmlAndJsonArrayOfPet.content.application_xml.schema](../../components/responses/response_successful_xml_and_json_array_of_pet.md#content-applicationxml-schema), [SuccessfulXmlAndJsonArrayOfPet.content.application_json.schema](../../components/responses/response_successful_xml_and_json_array_of_pet.md#content-applicationjson-schema)] | | +headers | Unset | headers were not defined | + +[[Back to top]](#top) [[Back to Component Responses]](../../../README.md#Component-Responses) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/responses/response_success_description_only.md b/samples/openapi3/client/petstore/python/docs/components/responses/response_success_description_only.md new file mode 100644 index 00000000000..ad982ca15d1 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/responses/response_success_description_only.md @@ -0,0 +1,14 @@ +petstore_api.components.responses.response_success_description_only +# Response SuccessDescriptionOnly + +## Description +Success + +## response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +[[Back to top]](#top) [[Back to Component Responses]](../../../README.md#Component-Responses) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/responses/response_success_inline_content_and_header.md b/samples/openapi3/client/petstore/python/docs/components/responses/response_success_inline_content_and_header.md new file mode 100644 index 00000000000..107fb333448 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/responses/response_success_inline_content_and_header.md @@ -0,0 +1,47 @@ +petstore_api.components.responses.response_success_inline_content_and_header +# Response SuccessInlineContentAndHeader + +## Description +successful operation + +## response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#body) | [content.application_json.schema](#content-applicationjson-schema) | | +[headers](#headers) | [Headers](#headers) | | + +## Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#content-applicationjson-schema) + +## Headers +Key | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- +someHeader | [headers.header_some_header.schema](#headers-someheader-schema) | | optional + +## Body Details +### content ApplicationJson Schema + +#### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +#### Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**any_string_name** | decimal.Decimal, int | decimal.Decimal | any string name can be used but the value must be the correct type | [optional] value must be a 32 bit integer + +## Header Details +### headers SomeHeader + +#### headers SomeHeader Schema + +##### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str | str | | + +[[Back to top]](#top) [[Back to Component Responses]](../../../README.md#Component-Responses) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/responses/response_success_with_json_api_response.md b/samples/openapi3/client/petstore/python/docs/components/responses/response_success_with_json_api_response.md new file mode 100644 index 00000000000..d5e266d56c3 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/responses/response_success_with_json_api_response.md @@ -0,0 +1,36 @@ +petstore_api.components.responses.response_success_with_json_api_response +# Response SuccessWithJsonApiResponse + +## Description +successful operation + +## response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#body) | [content.application_json.schema](#content-applicationjson-schema) | | +[headers](#headers) | [Headers](#headers) | | + +## Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#content-applicationjson-schema) + +## Headers +Key | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- +ref-schema-header | [RefSchemaHeader.schema](../../components/headers/header_ref_schema_header.md#schema) | | +int32 | [Int32JsonContentTypeHeader.content.application_json.schema](../../components/headers/header_int32_json_content_type_header.md#content-applicationjson-schema) | | +ref-content-schema-header | [RefContentSchemaHeader.content.application_json.schema](../../components/headers/header_ref_content_schema_header.md#content-applicationjson-schema) | | +stringHeader | [RefStringHeader.schema](../../components/headers/header_ref_string_header.md#schema) | | +numberHeader | [NumberHeader.schema](../../components/headers/header_number_header.md#schema) | | optional + +## Body Details +### content ApplicationJson Schema + +#### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[ApiResponse](../../components/schema/api_response.md) | dict, frozendict.frozendict | frozendict.frozendict | + +[[Back to top]](#top) [[Back to Component Responses]](../../../README.md#Component-Responses) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/responses/response_successful_xml_and_json_array_of_pet.md b/samples/openapi3/client/petstore/python/docs/components/responses/response_successful_xml_and_json_array_of_pet.md new file mode 100644 index 00000000000..cc511437038 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/responses/response_successful_xml_and_json_array_of_pet.md @@ -0,0 +1,44 @@ +petstore_api.components.responses.response_successful_xml_and_json_array_of_pet +# Response SuccessfulXmlAndJsonArrayOfPet + +## Description +successful operation, multiple content types + +## response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#body) | typing.Union[[content.application_xml.schema](#content-applicationxml-schema), [content.application_json.schema](#content-applicationjson-schema)] | | +headers | Unset | headers were not defined | + +## Body +Content-Type | Schema +------------ | ------- +"application/xml" | [content.application_xml.Schema](#content-applicationxml-schema) +"application/json" | [content.application_json.Schema](#content-applicationjson-schema) + +## Body Details +### content ApplicationXml Schema + +#### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +list, tuple | tuple | | + +#### List Items +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[**Pet**](../../components/schema/pet.md) | [**Pet**](../../components/schema/pet.md) | [**Pet**](../../components/schema/pet.md) | | +### content ApplicationJson Schema + +#### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +list, tuple | tuple | | + +#### List Items +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[**RefPet**](../../components/schema/ref_pet.md) | [**RefPet**](../../components/schema/ref_pet.md) | [**RefPet**](../../components/schema/ref_pet.md) | | + +[[Back to top]](#top) [[Back to Component Responses]](../../../README.md#Component-Responses) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/_200_response.md b/samples/openapi3/client/petstore/python/docs/components/schema/_200_response.md new file mode 100644 index 00000000000..d8da613a696 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/_200_response.md @@ -0,0 +1,19 @@ +petstore_api.components.schema._200_response +# Schema _200Response + +## Description +model with an invalid class name for python, starts with a number + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | model with an invalid class name for python, starts with a number | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**name** | decimal.Decimal, int | decimal.Decimal | | [optional] value must be a 32 bit integer +**class** | str | str | this is a reserved python keyword | [optional] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/_return.md b/samples/openapi3/client/petstore/python/docs/components/schema/_return.md new file mode 100644 index 00000000000..e6985899ed4 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/_return.md @@ -0,0 +1,18 @@ +petstore_api.components.schema._return +# Schema _Return + +## Description +Model for testing reserved words + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | Model for testing reserved words | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**return** | decimal.Decimal, int | decimal.Decimal | this is a reserved python keyword | [optional] value must be a 32 bit integer +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/abstract_step_message.md b/samples/openapi3/client/petstore/python/docs/components/schema/abstract_step_message.md new file mode 100644 index 00000000000..04312078352 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/abstract_step_message.md @@ -0,0 +1,26 @@ +petstore_api.components.schema.abstract_step_message +# Schema AbstractStepMessage + +## Description +Abstract Step + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | Abstract Step | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**description** | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | +**discriminator** | str | str | | +**sequenceNumber** | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +## Composed Schemas (allOf/anyOf/oneOf/not) +## anyOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[**AbstractStepMessage**](#top) | [**AbstractStepMessage**](#top) | [**AbstractStepMessage**](#top) | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/additional_properties_class.md b/samples/openapi3/client/petstore/python/docs/components/schema/additional_properties_class.md new file mode 100644 index 00000000000..6a92ea9cc1a --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/additional_properties_class.md @@ -0,0 +1,110 @@ +petstore_api.components.schema.additional_properties_class +# Schema AdditionalPropertiesClass + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**map_property** | dict, frozendict.frozendict | [properties.MapProperty](#properties-mapproperty) | | [optional] +**map_of_map_property** | dict, frozendict.frozendict | [properties.MapOfMapProperty](#properties-mapofmapproperty) | | [optional] +**anytype_1** | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | [optional] +**map_with_undeclared_properties_anytype_1** | dict, frozendict.frozendict | [properties.MapWithUndeclaredPropertiesAnytype1](#properties-mapwithundeclaredpropertiesanytype1) | | [optional] +**map_with_undeclared_properties_anytype_2** | dict, frozendict.frozendict | [properties.MapWithUndeclaredPropertiesAnytype2](#properties-mapwithundeclaredpropertiesanytype2) | | [optional] +**map_with_undeclared_properties_anytype_3** | dict, frozendict.frozendict | [properties.MapWithUndeclaredPropertiesAnytype3](#properties-mapwithundeclaredpropertiesanytype3) | | [optional] +**empty_map** | dict, frozendict.frozendict | [properties.EmptyMap](#properties-emptymap) | an object with no declared properties and no undeclared properties, hence it's an empty map. | [optional] +**map_with_undeclared_properties_string** | dict, frozendict.frozendict | [properties.MapWithUndeclaredPropertiesString](#properties-mapwithundeclaredpropertiesstring) | | [optional] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +# properties MapProperty + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**any_string_name** | str | str | any string name can be used but the value must be the correct type | [optional] + +# properties MapOfMapProperty + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**any_string_name** | dict, frozendict.frozendict | [AdditionalProperties](#properties-mapofmapproperty-additionalproperties) | any string name can be used but the value must be the correct type | [optional] + +# properties MapOfMapProperty AdditionalProperties + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**any_string_name** | str | str | any string name can be used but the value must be the correct type | [optional] + +# properties MapWithUndeclaredPropertiesAnytype1 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +# properties MapWithUndeclaredPropertiesAnytype2 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +# properties MapWithUndeclaredPropertiesAnytype3 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**any_string_name** | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | any string name can be used but the value must be the correct type | [optional] + +# properties EmptyMap + +## Description +an object with no declared properties and no undeclared properties, hence it's an empty map. + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | an object with no declared properties and no undeclared properties, hence it's an empty map. | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- + +# properties MapWithUndeclaredPropertiesString + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**any_string_name** | str | str | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/additional_properties_validator.md b/samples/openapi3/client/petstore/python/docs/components/schema/additional_properties_validator.md new file mode 100644 index 00000000000..4c73a073156 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/additional_properties_validator.md @@ -0,0 +1,53 @@ +petstore_api.components.schema.additional_properties_validator +# Schema AdditionalPropertiesValidator + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Composed Schemas (allOf/anyOf/oneOf/not) +## allOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[_0](#allof-_0) | dict, frozendict.frozendict | frozendict.frozendict | | +[_1](#allof-_1) | dict, frozendict.frozendict | frozendict.frozendict | | +[_2](#allof-_2) | dict, frozendict.frozendict | frozendict.frozendict | | + +# allof _0 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**any_string_name** | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | any string name can be used but the value must be the correct type | [optional] + +# allof _1 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**any_string_name** | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | any string name can be used but the value must be the correct type | [optional] + +# allof _2 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**any_string_name** | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/additional_properties_with_array_of_enums.md b/samples/openapi3/client/petstore/python/docs/components/schema/additional_properties_with_array_of_enums.md new file mode 100644 index 00000000000..e8b7dc87323 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/additional_properties_with_array_of_enums.md @@ -0,0 +1,26 @@ +petstore_api.components.schema.additional_properties_with_array_of_enums +# Schema AdditionalPropertiesWithArrayOfEnums + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**any_string_name** | list, tuple | [AdditionalProperties](#additionalproperties) | any string name can be used but the value must be the correct type | [optional] + +# AdditionalProperties + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +list, tuple | tuple | | + +## List Items +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[**EnumClass**](enum_class.md) | [**EnumClass**](enum_class.md) | [**EnumClass**](enum_class.md) | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/address.md b/samples/openapi3/client/petstore/python/docs/components/schema/address.md new file mode 100644 index 00000000000..9c526d8c31d --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/address.md @@ -0,0 +1,14 @@ +petstore_api.components.schema.address +# Schema Address + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**any_string_name** | decimal.Decimal, int | decimal.Decimal | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/animal.md b/samples/openapi3/client/petstore/python/docs/components/schema/animal.md new file mode 100644 index 00000000000..bad562dd739 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/animal.md @@ -0,0 +1,16 @@ +petstore_api.components.schema.animal +# Schema Animal + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**className** | str | str | | +**color** | str | str | | [optional] if omitted the server will use the default value of red +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/animal_farm.md b/samples/openapi3/client/petstore/python/docs/components/schema/animal_farm.md new file mode 100644 index 00000000000..c03e8fe0815 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/animal_farm.md @@ -0,0 +1,14 @@ +petstore_api.components.schema.animal_farm +# Schema AnimalFarm + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +list, tuple | tuple | | + +## List Items +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[**Animal**](animal.md) | [**Animal**](animal.md) | [**Animal**](animal.md) | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/any_type_and_format.md b/samples/openapi3/client/petstore/python/docs/components/schema/any_type_and_format.md new file mode 100644 index 00000000000..3db6967a1f7 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/any_type_and_format.md @@ -0,0 +1,23 @@ +petstore_api.components.schema.any_type_and_format +# Schema AnyTypeAndFormat + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**uuid** | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | [optional] value must be a uuid +**date** | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | [optional] value must conform to RFC-3339 full-date YYYY-MM-DD +**date-time** | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | [optional] value must conform to RFC-3339 date-time +**number** | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | [optional] value must be numeric and storable in decimal.Decimal +**binary** | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | [optional] +**int32** | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | [optional] value must be a 32 bit integer +**int64** | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | [optional] value must be a 64 bit integer +**double** | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | [optional] value must be a 64 bit float +**float** | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | [optional] value must be a 32 bit float +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/any_type_not_string.md b/samples/openapi3/client/petstore/python/docs/components/schema/any_type_not_string.md new file mode 100644 index 00000000000..5069660202e --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/any_type_not_string.md @@ -0,0 +1,22 @@ +petstore_api.components.schema.any_type_not_string +# Schema AnyTypeNotString + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Composed Schemas (allOf/anyOf/oneOf/not) +## not +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[_not](#_not) | str | str | | + +# _Not + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str | str | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/api_response.md b/samples/openapi3/client/petstore/python/docs/components/schema/api_response.md new file mode 100644 index 00000000000..2983bbdce1a --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/api_response.md @@ -0,0 +1,17 @@ +petstore_api.components.schema.api_response +# Schema ApiResponse + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**code** | decimal.Decimal, int | decimal.Decimal | | [optional] value must be a 32 bit integer +**type** | str | str | | [optional] +**message** | str | str | | [optional] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/apple.md b/samples/openapi3/client/petstore/python/docs/components/schema/apple.md new file mode 100644 index 00000000000..1d512492454 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/apple.md @@ -0,0 +1,16 @@ +petstore_api.components.schema.apple +# Schema Apple + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +None, dict, frozendict.frozendict | NoneClass, frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**cultivar** | str | str | | +**origin** | str | str | | [optional] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/apple_req.md b/samples/openapi3/client/petstore/python/docs/components/schema/apple_req.md new file mode 100644 index 00000000000..2c70d71165e --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/apple_req.md @@ -0,0 +1,15 @@ +petstore_api.components.schema.apple_req +# Schema AppleReq + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**cultivar** | str | str | | +**mealy** | bool | BoolClass | | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/array_holding_any_type.md b/samples/openapi3/client/petstore/python/docs/components/schema/array_holding_any_type.md new file mode 100644 index 00000000000..5a5c6b2ce9e --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/array_holding_any_type.md @@ -0,0 +1,14 @@ +petstore_api.components.schema.array_holding_any_type +# Schema ArrayHoldingAnyType + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +list, tuple | tuple | | + +## List Items +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +items | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | any type can be stored here | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/array_of_array_of_number_only.md b/samples/openapi3/client/petstore/python/docs/components/schema/array_of_array_of_number_only.md new file mode 100644 index 00000000000..06f58d1bfc6 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/array_of_array_of_number_only.md @@ -0,0 +1,39 @@ +petstore_api.components.schema.array_of_array_of_number_only +# Schema ArrayOfArrayOfNumberOnly + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**ArrayArrayNumber** | list, tuple | [properties.ArrayArrayNumber](#properties-arrayarraynumber) | | [optional] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +# properties ArrayArrayNumber + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +list, tuple | tuple | | + +## List Items +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[items](#properties-arrayarraynumber-items) | list, tuple | tuple | | + +# properties ArrayArrayNumber Items + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +list, tuple | tuple | | + +## List Items +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +items | decimal.Decimal, int, float | decimal.Decimal | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/array_of_enums.md b/samples/openapi3/client/petstore/python/docs/components/schema/array_of_enums.md new file mode 100644 index 00000000000..9927536fabb --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/array_of_enums.md @@ -0,0 +1,14 @@ +petstore_api.components.schema.array_of_enums +# Schema ArrayOfEnums + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +list, tuple | tuple | | + +## List Items +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[**StringEnum**](string_enum.md) | [**StringEnum**](string_enum.md) | [**StringEnum**](string_enum.md) | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/array_of_number_only.md b/samples/openapi3/client/petstore/python/docs/components/schema/array_of_number_only.md new file mode 100644 index 00000000000..965b67726a5 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/array_of_number_only.md @@ -0,0 +1,27 @@ +petstore_api.components.schema.array_of_number_only +# Schema ArrayOfNumberOnly + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**ArrayNumber** | list, tuple | [properties.ArrayNumber](#properties-arraynumber) | | [optional] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +# properties ArrayNumber + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +list, tuple | tuple | | + +## List Items +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +items | decimal.Decimal, int, float | decimal.Decimal | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/array_test.md b/samples/openapi3/client/petstore/python/docs/components/schema/array_test.md new file mode 100644 index 00000000000..9f0a23efc2d --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/array_test.md @@ -0,0 +1,77 @@ +petstore_api.components.schema.array_test +# Schema ArrayTest + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**array_of_string** | list, tuple | [properties.ArrayOfString](#properties-arrayofstring) | | [optional] +**array_array_of_integer** | list, tuple | [properties.ArrayArrayOfInteger](#properties-arrayarrayofinteger) | | [optional] +**array_array_of_model** | list, tuple | [properties.ArrayArrayOfModel](#properties-arrayarrayofmodel) | | [optional] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +# properties ArrayOfString + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +list, tuple | tuple | | + +## List Items +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +items | str | str | | + +# properties ArrayArrayOfInteger + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +list, tuple | tuple | | + +## List Items +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[items](#properties-arrayarrayofinteger-items) | list, tuple | tuple | | + +# properties ArrayArrayOfInteger Items + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +list, tuple | tuple | | + +## List Items +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +items | decimal.Decimal, int | decimal.Decimal | | value must be a 64 bit integer + +# properties ArrayArrayOfModel + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +list, tuple | tuple | | + +## List Items +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[items](#properties-arrayarrayofmodel-items) | list, tuple | tuple | | + +# properties ArrayArrayOfModel Items + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +list, tuple | tuple | | + +## List Items +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[**ReadOnlyFirst**](read_only_first.md) | [**ReadOnlyFirst**](read_only_first.md) | [**ReadOnlyFirst**](read_only_first.md) | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/array_with_validations_in_items.md b/samples/openapi3/client/petstore/python/docs/components/schema/array_with_validations_in_items.md new file mode 100644 index 00000000000..3409e7cdf11 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/array_with_validations_in_items.md @@ -0,0 +1,14 @@ +petstore_api.components.schema.array_with_validations_in_items +# Schema ArrayWithValidationsInItems + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +list, tuple | tuple | | + +## List Items +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +items | decimal.Decimal, int | decimal.Decimal | | value must be a 64 bit integer + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/banana.md b/samples/openapi3/client/petstore/python/docs/components/schema/banana.md new file mode 100644 index 00000000000..78c5beeae61 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/banana.md @@ -0,0 +1,15 @@ +petstore_api.components.schema.banana +# Schema Banana + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**lengthCm** | decimal.Decimal, int, float | decimal.Decimal | | +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/banana_req.md b/samples/openapi3/client/petstore/python/docs/components/schema/banana_req.md new file mode 100644 index 00000000000..5e7357026cf --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/banana_req.md @@ -0,0 +1,15 @@ +petstore_api.components.schema.banana_req +# Schema BananaReq + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**lengthCm** | decimal.Decimal, int, float | decimal.Decimal | | +**sweet** | bool | BoolClass | | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/bar.md b/samples/openapi3/client/petstore/python/docs/components/schema/bar.md new file mode 100644 index 00000000000..bf6b8393424 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/bar.md @@ -0,0 +1,9 @@ +petstore_api.components.schema.bar +# Schema Bar + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str | str | | if omitted the server will use the default value of bar + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/basque_pig.md b/samples/openapi3/client/petstore/python/docs/components/schema/basque_pig.md new file mode 100644 index 00000000000..3df5c74ab5b --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/basque_pig.md @@ -0,0 +1,15 @@ +petstore_api.components.schema.basque_pig +# Schema BasquePig + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**className** | str | str | | must be one of ["BasquePig"] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/boolean.md b/samples/openapi3/client/petstore/python/docs/components/schema/boolean.md new file mode 100644 index 00000000000..58be860930d --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/boolean.md @@ -0,0 +1,9 @@ +petstore_api.components.schema.boolean +# Schema Boolean + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +bool | BoolClass | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/boolean_enum.md b/samples/openapi3/client/petstore/python/docs/components/schema/boolean_enum.md new file mode 100644 index 00000000000..a9e13de44c2 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/boolean_enum.md @@ -0,0 +1,9 @@ +petstore_api.components.schema.boolean_enum +# Schema BooleanEnum + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +bool | BoolClass | | must be one of [True] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/capitalization.md b/samples/openapi3/client/petstore/python/docs/components/schema/capitalization.md new file mode 100644 index 00000000000..bdd51789774 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/capitalization.md @@ -0,0 +1,20 @@ +petstore_api.components.schema.capitalization +# Schema Capitalization + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**smallCamel** | str | str | | [optional] +**CapitalCamel** | str | str | | [optional] +**small_Snake** | str | str | | [optional] +**Capital_Snake** | str | str | | [optional] +**SCA_ETH_Flow_Points** | str | str | | [optional] +**ATT_NAME** | str | str | Name of the pet | [optional] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/cat.md b/samples/openapi3/client/petstore/python/docs/components/schema/cat.md new file mode 100644 index 00000000000..05484d8200b --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/cat.md @@ -0,0 +1,29 @@ +petstore_api.components.schema.cat +# Schema Cat + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Composed Schemas (allOf/anyOf/oneOf/not) +## allOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[**Animal**](animal.md) | [**Animal**](animal.md) | [**Animal**](animal.md) | | +[_1](#allof-_1) | dict, frozendict.frozendict | frozendict.frozendict | | + +# allof _1 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**declawed** | bool | BoolClass | | [optional] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/category.md b/samples/openapi3/client/petstore/python/docs/components/schema/category.md new file mode 100644 index 00000000000..50f23ccdcf2 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/category.md @@ -0,0 +1,16 @@ +petstore_api.components.schema.category +# Schema Category + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**name** | str | str | | if omitted the server will use the default value of default-name +**id** | decimal.Decimal, int | decimal.Decimal | | [optional] value must be a 64 bit integer +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/child_cat.md b/samples/openapi3/client/petstore/python/docs/components/schema/child_cat.md new file mode 100644 index 00000000000..12c010d615d --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/child_cat.md @@ -0,0 +1,29 @@ +petstore_api.components.schema.child_cat +# Schema ChildCat + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Composed Schemas (allOf/anyOf/oneOf/not) +## allOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[**ParentPet**](parent_pet.md) | [**ParentPet**](parent_pet.md) | [**ParentPet**](parent_pet.md) | | +[_1](#allof-_1) | dict, frozendict.frozendict | frozendict.frozendict | | + +# allof _1 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**name** | str | str | | [optional] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/class_model.md b/samples/openapi3/client/petstore/python/docs/components/schema/class_model.md new file mode 100644 index 00000000000..a7642e8fa08 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/class_model.md @@ -0,0 +1,18 @@ +petstore_api.components.schema.class_model +# Schema ClassModel + +## Description +Model for testing model with \"_class\" property + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | Model for testing model with \"_class\" property | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**_class** | str | str | | [optional] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/client.md b/samples/openapi3/client/petstore/python/docs/components/schema/client.md new file mode 100644 index 00000000000..b7d0bf63baa --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/client.md @@ -0,0 +1,15 @@ +petstore_api.components.schema.client +# Schema Client + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**client** | str | str | | [optional] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/complex_quadrilateral.md b/samples/openapi3/client/petstore/python/docs/components/schema/complex_quadrilateral.md new file mode 100644 index 00000000000..8cd70635451 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/complex_quadrilateral.md @@ -0,0 +1,29 @@ +petstore_api.components.schema.complex_quadrilateral +# Schema ComplexQuadrilateral + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Composed Schemas (allOf/anyOf/oneOf/not) +## allOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[**QuadrilateralInterface**](quadrilateral_interface.md) | [**QuadrilateralInterface**](quadrilateral_interface.md) | [**QuadrilateralInterface**](quadrilateral_interface.md) | | +[_1](#allof-_1) | dict, frozendict.frozendict | frozendict.frozendict | | + +# allof _1 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**quadrilateralType** | str | str | | [optional] must be one of ["ComplexQuadrilateral"] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/composed_any_of_different_types_no_validations.md b/samples/openapi3/client/petstore/python/docs/components/schema/composed_any_of_different_types_no_validations.md new file mode 100644 index 00000000000..83c43fb6a99 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/composed_any_of_different_types_no_validations.md @@ -0,0 +1,147 @@ +petstore_api.components.schema.composed_any_of_different_types_no_validations +# Schema ComposedAnyOfDifferentTypesNoValidations + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Composed Schemas (allOf/anyOf/oneOf/not) +## anyOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[_0](#anyof-_0) | dict, frozendict.frozendict | frozendict.frozendict | | +[_1](#anyof-_1) | str, datetime.date | str | | value must conform to RFC-3339 full-date YYYY-MM-DD +[_2](#anyof-_2) | str, datetime.datetime | str | | value must conform to RFC-3339 date-time +[_3](#anyof-_3) | bytes, io.FileIO, io.BufferedReader | bytes, io.FileIO | | +[_4](#anyof-_4) | str | str | | +[_5](#anyof-_5) | str | str | | +[_6](#anyof-_6) | dict, frozendict.frozendict | frozendict.frozendict | | +[_7](#anyof-_7) | bool | BoolClass | | +[_8](#anyof-_8) | None | NoneClass | | +[_9](#anyof-_9) | list, tuple | tuple | | +[_10](#anyof-_10) | decimal.Decimal, int, float | decimal.Decimal | | +[_11](#anyof-_11) | decimal.Decimal, int, float | decimal.Decimal | | value must be a 32 bit float +[_12](#anyof-_12) | decimal.Decimal, int, float | decimal.Decimal | | value must be a 64 bit float +[_13](#anyof-_13) | decimal.Decimal, int | decimal.Decimal | | +[_14](#anyof-_14) | decimal.Decimal, int | decimal.Decimal | | value must be a 32 bit integer +[_15](#anyof-_15) | decimal.Decimal, int | decimal.Decimal | | value must be a 64 bit integer + +# anyof _0 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +# anyof _1 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, datetime.date | str | | value must conform to RFC-3339 full-date YYYY-MM-DD + +# anyof _2 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, datetime.datetime | str | | value must conform to RFC-3339 date-time + +# anyof _3 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +bytes, io.FileIO, io.BufferedReader | bytes, io.FileIO | | + +# anyof _4 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str | str | | + +# anyof _5 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str | str | | + +# anyof _6 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +# anyof _7 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +bool | BoolClass | | + +# anyof _8 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +None | NoneClass | | + +# anyof _9 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +list, tuple | tuple | | + +## List Items +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +items | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +# anyof _10 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +decimal.Decimal, int, float | decimal.Decimal | | + +# anyof _11 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +decimal.Decimal, int, float | decimal.Decimal | | value must be a 32 bit float + +# anyof _12 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +decimal.Decimal, int, float | decimal.Decimal | | value must be a 64 bit float + +# anyof _13 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +decimal.Decimal, int | decimal.Decimal | | + +# anyof _14 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +decimal.Decimal, int | decimal.Decimal | | value must be a 32 bit integer + +# anyof _15 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +decimal.Decimal, int | decimal.Decimal | | value must be a 64 bit integer + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/composed_array.md b/samples/openapi3/client/petstore/python/docs/components/schema/composed_array.md new file mode 100644 index 00000000000..367df83bec5 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/composed_array.md @@ -0,0 +1,14 @@ +petstore_api.components.schema.composed_array +# Schema ComposedArray + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +list, tuple | tuple | | + +## List Items +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +items | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/composed_bool.md b/samples/openapi3/client/petstore/python/docs/components/schema/composed_bool.md new file mode 100644 index 00000000000..b55dff83c6d --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/composed_bool.md @@ -0,0 +1,22 @@ +petstore_api.components.schema.composed_bool +# Schema ComposedBool + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +bool | BoolClass | | + +## Composed Schemas (allOf/anyOf/oneOf/not) +## allOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[_0](#allof-_0) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +# allof _0 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/composed_none.md b/samples/openapi3/client/petstore/python/docs/components/schema/composed_none.md new file mode 100644 index 00000000000..1d51af5acca --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/composed_none.md @@ -0,0 +1,22 @@ +petstore_api.components.schema.composed_none +# Schema ComposedNone + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +None | NoneClass | | + +## Composed Schemas (allOf/anyOf/oneOf/not) +## allOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[_0](#allof-_0) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +# allof _0 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/composed_number.md b/samples/openapi3/client/petstore/python/docs/components/schema/composed_number.md new file mode 100644 index 00000000000..c541dece90e --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/composed_number.md @@ -0,0 +1,22 @@ +petstore_api.components.schema.composed_number +# Schema ComposedNumber + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +decimal.Decimal, int, float | decimal.Decimal | | + +## Composed Schemas (allOf/anyOf/oneOf/not) +## allOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[_0](#allof-_0) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +# allof _0 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/composed_object.md b/samples/openapi3/client/petstore/python/docs/components/schema/composed_object.md new file mode 100644 index 00000000000..474b16c7581 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/composed_object.md @@ -0,0 +1,22 @@ +petstore_api.components.schema.composed_object +# Schema ComposedObject + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Composed Schemas (allOf/anyOf/oneOf/not) +## allOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[_0](#allof-_0) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +# allof _0 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/composed_one_of_different_types.md b/samples/openapi3/client/petstore/python/docs/components/schema/composed_one_of_different_types.md new file mode 100644 index 00000000000..bd4447a727e --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/composed_one_of_different_types.md @@ -0,0 +1,64 @@ +petstore_api.components.schema.composed_one_of_different_types +# Schema ComposedOneOfDifferentTypes + +## Description +this is a model that allows payloads of type object or number + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | this is a model that allows payloads of type object or number | + +## Composed Schemas (allOf/anyOf/oneOf/not) +## oneOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[**NumberWithValidations**](number_with_validations.md) | [**NumberWithValidations**](number_with_validations.md) | [**NumberWithValidations**](number_with_validations.md) | | +[**Animal**](animal.md) | [**Animal**](animal.md) | [**Animal**](animal.md) | | +[_2](#oneof-_2) | None | NoneClass | | +[_3](#oneof-_3) | str, datetime.date | str | | value must conform to RFC-3339 full-date YYYY-MM-DD +[_4](#oneof-_4) | dict, frozendict.frozendict | frozendict.frozendict | | +[_5](#oneof-_5) | list, tuple | tuple | | +[_6](#oneof-_6) | str, datetime.datetime | str | | value must conform to RFC-3339 date-time + +# oneof _2 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +None | NoneClass | | + +# oneof _3 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, datetime.date | str | | value must conform to RFC-3339 full-date YYYY-MM-DD + +# oneof _4 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +# oneof _5 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +list, tuple | tuple | | + +## List Items +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +items | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +# oneof _6 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, datetime.datetime | str | | value must conform to RFC-3339 date-time + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/composed_string.md b/samples/openapi3/client/petstore/python/docs/components/schema/composed_string.md new file mode 100644 index 00000000000..4377f0a0d44 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/composed_string.md @@ -0,0 +1,22 @@ +petstore_api.components.schema.composed_string +# Schema ComposedString + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str | str | | + +## Composed Schemas (allOf/anyOf/oneOf/not) +## allOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[_0](#allof-_0) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +# allof _0 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/currency.md b/samples/openapi3/client/petstore/python/docs/components/schema/currency.md new file mode 100644 index 00000000000..a988a49ba4c --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/currency.md @@ -0,0 +1,9 @@ +petstore_api.components.schema.currency +# Schema Currency + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str | str | | must be one of ["eur", "usd"] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/danish_pig.md b/samples/openapi3/client/petstore/python/docs/components/schema/danish_pig.md new file mode 100644 index 00000000000..d58bc97a2c1 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/danish_pig.md @@ -0,0 +1,15 @@ +petstore_api.components.schema.danish_pig +# Schema DanishPig + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**className** | str | str | | must be one of ["DanishPig"] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/date_time_test.md b/samples/openapi3/client/petstore/python/docs/components/schema/date_time_test.md new file mode 100644 index 00000000000..8d2d0679ecb --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/date_time_test.md @@ -0,0 +1,9 @@ +petstore_api.components.schema.date_time_test +# Schema DateTimeTest + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, datetime.datetime | str | | if omitted the server will use the default value of 2010-01-01T10:10:10.000111+01:00 value must conform to RFC-3339 date-time + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/date_time_with_validations.md b/samples/openapi3/client/petstore/python/docs/components/schema/date_time_with_validations.md new file mode 100644 index 00000000000..d25f494eb32 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/date_time_with_validations.md @@ -0,0 +1,9 @@ +petstore_api.components.schema.date_time_with_validations +# Schema DateTimeWithValidations + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, datetime.datetime | str | | value must conform to RFC-3339 date-time + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/date_with_validations.md b/samples/openapi3/client/petstore/python/docs/components/schema/date_with_validations.md new file mode 100644 index 00000000000..190254a8217 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/date_with_validations.md @@ -0,0 +1,9 @@ +petstore_api.components.schema.date_with_validations +# Schema DateWithValidations + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, datetime.date | str | | value must conform to RFC-3339 full-date YYYY-MM-DD + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/decimal_payload.md b/samples/openapi3/client/petstore/python/docs/components/schema/decimal_payload.md new file mode 100644 index 00000000000..659c95780a3 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/decimal_payload.md @@ -0,0 +1,9 @@ +petstore_api.components.schema.decimal_payload +# Schema DecimalPayload + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str | str | | value must be numeric and storable in decimal.Decimal + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/dog.md b/samples/openapi3/client/petstore/python/docs/components/schema/dog.md new file mode 100644 index 00000000000..db05518781f --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/dog.md @@ -0,0 +1,29 @@ +petstore_api.components.schema.dog +# Schema Dog + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Composed Schemas (allOf/anyOf/oneOf/not) +## allOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[**Animal**](animal.md) | [**Animal**](animal.md) | [**Animal**](animal.md) | | +[_1](#allof-_1) | dict, frozendict.frozendict | frozendict.frozendict | | + +# allof _1 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**breed** | str | str | | [optional] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/drawing.md b/samples/openapi3/client/petstore/python/docs/components/schema/drawing.md new file mode 100644 index 00000000000..ab7d3daaa27 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/drawing.md @@ -0,0 +1,30 @@ +petstore_api.components.schema.drawing +# Schema Drawing + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**mainShape** | [**Shape**](shape.md), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | [**Shape**](shape.md) | | [optional] +**shapeOrNull** | [**ShapeOrNull**](shape_or_null.md), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | [**ShapeOrNull**](shape_or_null.md) | | [optional] +**nullableShape** | [**NullableShape**](nullable_shape.md), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | [**NullableShape**](nullable_shape.md) | | [optional] +**shapes** | list, tuple | [properties.Shapes](#properties-shapes) | | [optional] +**any_string_name** | [**Fruit**](fruit.md), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | [**Fruit**](fruit.md) | any string name can be used but the value must be the correct type | [optional] + +# properties Shapes + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +list, tuple | tuple | | + +## List Items +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[**Shape**](shape.md) | [**Shape**](shape.md) | [**Shape**](shape.md) | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/enum_arrays.md b/samples/openapi3/client/petstore/python/docs/components/schema/enum_arrays.md new file mode 100644 index 00000000000..0878c46bfa8 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/enum_arrays.md @@ -0,0 +1,28 @@ +petstore_api.components.schema.enum_arrays +# Schema EnumArrays + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**just_symbol** | str | str | | [optional] must be one of [">=", "$"] +**array_enum** | list, tuple | [properties.ArrayEnum](#properties-arrayenum) | | [optional] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +# properties ArrayEnum + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +list, tuple | tuple | | + +## List Items +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +items | str | str | | must be one of ["fish", "crab"] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/enum_class.md b/samples/openapi3/client/petstore/python/docs/components/schema/enum_class.md new file mode 100644 index 00000000000..c64ce4f6bad --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/enum_class.md @@ -0,0 +1,9 @@ +petstore_api.components.schema.enum_class +# Schema EnumClass + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str | str | | must be one of ["_abc", "-efg", "(xyz)", "COUNT_1M", "COUNT_50M"] if omitted the server will use the default value of -efg + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/enum_test.md b/samples/openapi3/client/petstore/python/docs/components/schema/enum_test.md new file mode 100644 index 00000000000..044aa6947a6 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/enum_test.md @@ -0,0 +1,23 @@ +petstore_api.components.schema.enum_test +# Schema EnumTest + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**enum_string_required** | str | str | | must be one of ["UPPER", "lower", ""] +**enum_string** | str | str | | [optional] must be one of ["UPPER", "lower", ""] +**enum_integer** | decimal.Decimal, int | decimal.Decimal | | [optional] must be one of [1, -1] value must be a 32 bit integer +**enum_number** | decimal.Decimal, int, float | decimal.Decimal | | [optional] must be one of [1.1, -1.2] value must be a 64 bit float +**stringEnum** | [**StringEnum**](string_enum.md), None, str | [**StringEnum**](string_enum.md) | | [optional] +**IntegerEnum** | [**IntegerEnum**](integer_enum.md), decimal.Decimal, int | [**IntegerEnum**](integer_enum.md) | | [optional] +**StringEnumWithDefaultValue** | [**StringEnumWithDefaultValue**](string_enum_with_default_value.md), str | [**StringEnumWithDefaultValue**](string_enum_with_default_value.md) | | [optional] +**IntegerEnumWithDefaultValue** | [**IntegerEnumWithDefaultValue**](integer_enum_with_default_value.md), decimal.Decimal, int | [**IntegerEnumWithDefaultValue**](integer_enum_with_default_value.md) | | [optional] +**IntegerEnumOneValue** | [**IntegerEnumOneValue**](integer_enum_one_value.md), decimal.Decimal, int | [**IntegerEnumOneValue**](integer_enum_one_value.md) | | [optional] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/equilateral_triangle.md b/samples/openapi3/client/petstore/python/docs/components/schema/equilateral_triangle.md new file mode 100644 index 00000000000..795b4e2b99b --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/equilateral_triangle.md @@ -0,0 +1,29 @@ +petstore_api.components.schema.equilateral_triangle +# Schema EquilateralTriangle + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Composed Schemas (allOf/anyOf/oneOf/not) +## allOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[**TriangleInterface**](triangle_interface.md) | [**TriangleInterface**](triangle_interface.md) | [**TriangleInterface**](triangle_interface.md) | | +[_1](#allof-_1) | dict, frozendict.frozendict | frozendict.frozendict | | + +# allof _1 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**triangleType** | str | str | | [optional] must be one of ["EquilateralTriangle"] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/file.md b/samples/openapi3/client/petstore/python/docs/components/schema/file.md new file mode 100644 index 00000000000..285e9cc3ac4 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/file.md @@ -0,0 +1,18 @@ +petstore_api.components.schema.file +# Schema File + +## Description +Must be named `File` for test. + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | Must be named `File` for test. | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**sourceURI** | str | str | Test capitalization | [optional] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/file_schema_test_class.md b/samples/openapi3/client/petstore/python/docs/components/schema/file_schema_test_class.md new file mode 100644 index 00000000000..a8e833172df --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/file_schema_test_class.md @@ -0,0 +1,28 @@ +petstore_api.components.schema.file_schema_test_class +# Schema FileSchemaTestClass + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**file** | [**File**](file.md), dict, frozendict.frozendict | [**File**](file.md) | | [optional] +**files** | list, tuple | [properties.Files](#properties-files) | | [optional] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +# properties Files + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +list, tuple | tuple | | + +## List Items +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[**File**](file.md) | [**File**](file.md) | [**File**](file.md) | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/foo.md b/samples/openapi3/client/petstore/python/docs/components/schema/foo.md new file mode 100644 index 00000000000..bafa54affe6 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/foo.md @@ -0,0 +1,15 @@ +petstore_api.components.schema.foo +# Schema Foo + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**bar** | [**Bar**](bar.md), str | [**Bar**](bar.md) | | [optional] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/format_test.md b/samples/openapi3/client/petstore/python/docs/components/schema/format_test.md new file mode 100644 index 00000000000..9c21f7e3e99 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/format_test.md @@ -0,0 +1,47 @@ +petstore_api.components.schema.format_test +# Schema FormatTest + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**byte** | str | str | | +**date** | str, datetime.date | str | | value must conform to RFC-3339 full-date YYYY-MM-DD +**number** | decimal.Decimal, int, float | decimal.Decimal | | +**password** | str | str | | +**integer** | decimal.Decimal, int | decimal.Decimal | | [optional] +**int32** | decimal.Decimal, int | decimal.Decimal | | [optional] value must be a 32 bit integer +**int32withValidations** | decimal.Decimal, int | decimal.Decimal | | [optional] value must be a 32 bit integer +**int64** | decimal.Decimal, int | decimal.Decimal | | [optional] value must be a 64 bit integer +**float** | decimal.Decimal, int, float | decimal.Decimal | this is a reserved python keyword | [optional] value must be a 32 bit float +**float32** | decimal.Decimal, int, float | decimal.Decimal | | [optional] value must be a 32 bit float +**double** | decimal.Decimal, int, float | decimal.Decimal | | [optional] value must be a 64 bit float +**float64** | decimal.Decimal, int, float | decimal.Decimal | | [optional] value must be a 64 bit float +**arrayWithUniqueItems** | list, tuple | [properties.ArrayWithUniqueItems](#properties-arraywithuniqueitems) | | [optional] +**string** | str | str | | [optional] +**binary** | bytes, io.FileIO, io.BufferedReader | bytes, io.FileIO | | [optional] +**dateTime** | str, datetime.datetime | str | | [optional] value must conform to RFC-3339 date-time +**uuid** | str, uuid.UUID | str | | [optional] value must be a uuid +**uuidNoExample** | str, uuid.UUID | str | | [optional] value must be a uuid +**pattern_with_digits** | str | str | A string that is a 10 digit number. Can have leading zeros. | [optional] +**pattern_with_digits_and_delimiter** | str | str | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] +**noneProp** | None | NoneClass | | [optional] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +# properties ArrayWithUniqueItems + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +list, tuple | tuple | | + +## List Items +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +items | decimal.Decimal, int, float | decimal.Decimal | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/from_schema.md b/samples/openapi3/client/petstore/python/docs/components/schema/from_schema.md new file mode 100644 index 00000000000..6eb8190dd30 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/from_schema.md @@ -0,0 +1,16 @@ +petstore_api.components.schema.from_schema +# Schema FromSchema + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**data** | str | str | | [optional] +**id** | decimal.Decimal, int | decimal.Decimal | | [optional] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/fruit.md b/samples/openapi3/client/petstore/python/docs/components/schema/fruit.md new file mode 100644 index 00000000000..343d85a45d7 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/fruit.md @@ -0,0 +1,22 @@ +petstore_api.components.schema.fruit +# Schema Fruit + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**color** | str | str | | [optional] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +## Composed Schemas (allOf/anyOf/oneOf/not) +## oneOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[**Apple**](apple.md) | [**Apple**](apple.md) | [**Apple**](apple.md) | | +[**Banana**](banana.md) | [**Banana**](banana.md) | [**Banana**](banana.md) | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/fruit_req.md b/samples/openapi3/client/petstore/python/docs/components/schema/fruit_req.md new file mode 100644 index 00000000000..469c1d4b468 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/fruit_req.md @@ -0,0 +1,24 @@ +petstore_api.components.schema.fruit_req +# Schema FruitReq + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Composed Schemas (allOf/anyOf/oneOf/not) +## oneOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[_0](#oneof-_0) | None | NoneClass | | +[**AppleReq**](apple_req.md) | [**AppleReq**](apple_req.md) | [**AppleReq**](apple_req.md) | | +[**BananaReq**](banana_req.md) | [**BananaReq**](banana_req.md) | [**BananaReq**](banana_req.md) | | + +# oneof _0 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +None | NoneClass | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/gm_fruit.md b/samples/openapi3/client/petstore/python/docs/components/schema/gm_fruit.md new file mode 100644 index 00000000000..fd9ce4c74ed --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/gm_fruit.md @@ -0,0 +1,22 @@ +petstore_api.components.schema.gm_fruit +# Schema GmFruit + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**color** | str | str | | [optional] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +## Composed Schemas (allOf/anyOf/oneOf/not) +## anyOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[**Apple**](apple.md) | [**Apple**](apple.md) | [**Apple**](apple.md) | | +[**Banana**](banana.md) | [**Banana**](banana.md) | [**Banana**](banana.md) | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/grandparent_animal.md b/samples/openapi3/client/petstore/python/docs/components/schema/grandparent_animal.md new file mode 100644 index 00000000000..284ccc80023 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/grandparent_animal.md @@ -0,0 +1,15 @@ +petstore_api.components.schema.grandparent_animal +# Schema GrandparentAnimal + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**pet_type** | str | str | | +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/has_only_read_only.md b/samples/openapi3/client/petstore/python/docs/components/schema/has_only_read_only.md new file mode 100644 index 00000000000..9bbab9818a0 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/has_only_read_only.md @@ -0,0 +1,16 @@ +petstore_api.components.schema.has_only_read_only +# Schema HasOnlyReadOnly + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**bar** | str | str | | [optional] +**foo** | str | str | | [optional] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/health_check_result.md b/samples/openapi3/client/petstore/python/docs/components/schema/health_check_result.md new file mode 100644 index 00000000000..6af3a91effd --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/health_check_result.md @@ -0,0 +1,18 @@ +petstore_api.components.schema.health_check_result +# Schema HealthCheckResult + +## Description +Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**NullableMessage** | None, str | NoneClass, str | | [optional] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/integer_enum.md b/samples/openapi3/client/petstore/python/docs/components/schema/integer_enum.md new file mode 100644 index 00000000000..2dabec76805 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/integer_enum.md @@ -0,0 +1,9 @@ +petstore_api.components.schema.integer_enum +# Schema IntegerEnum + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +decimal.Decimal, int | decimal.Decimal | | must be one of [0, 1, 2] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/integer_enum_big.md b/samples/openapi3/client/petstore/python/docs/components/schema/integer_enum_big.md new file mode 100644 index 00000000000..3c0910e3043 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/integer_enum_big.md @@ -0,0 +1,9 @@ +petstore_api.components.schema.integer_enum_big +# Schema IntegerEnumBig + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +decimal.Decimal, int | decimal.Decimal | | must be one of [10, 11, 12] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/integer_enum_one_value.md b/samples/openapi3/client/petstore/python/docs/components/schema/integer_enum_one_value.md new file mode 100644 index 00000000000..7ff82d84c35 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/integer_enum_one_value.md @@ -0,0 +1,9 @@ +petstore_api.components.schema.integer_enum_one_value +# Schema IntegerEnumOneValue + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +decimal.Decimal, int | decimal.Decimal | | must be one of [0] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/integer_enum_with_default_value.md b/samples/openapi3/client/petstore/python/docs/components/schema/integer_enum_with_default_value.md new file mode 100644 index 00000000000..e8e408d2ca2 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/integer_enum_with_default_value.md @@ -0,0 +1,9 @@ +petstore_api.components.schema.integer_enum_with_default_value +# Schema IntegerEnumWithDefaultValue + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +decimal.Decimal, int | decimal.Decimal | | must be one of [0, 1, 2] if omitted the server will use the default value of 0 + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/integer_max10.md b/samples/openapi3/client/petstore/python/docs/components/schema/integer_max10.md new file mode 100644 index 00000000000..6cb9823af72 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/integer_max10.md @@ -0,0 +1,9 @@ +petstore_api.components.schema.integer_max10 +# Schema IntegerMax10 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +decimal.Decimal, int | decimal.Decimal | | value must be a 64 bit integer + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/integer_min15.md b/samples/openapi3/client/petstore/python/docs/components/schema/integer_min15.md new file mode 100644 index 00000000000..77816476dd4 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/integer_min15.md @@ -0,0 +1,9 @@ +petstore_api.components.schema.integer_min15 +# Schema IntegerMin15 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +decimal.Decimal, int | decimal.Decimal | | value must be a 64 bit integer + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/isosceles_triangle.md b/samples/openapi3/client/petstore/python/docs/components/schema/isosceles_triangle.md new file mode 100644 index 00000000000..5d8dad9cf69 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/isosceles_triangle.md @@ -0,0 +1,29 @@ +petstore_api.components.schema.isosceles_triangle +# Schema IsoscelesTriangle + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Composed Schemas (allOf/anyOf/oneOf/not) +## allOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[**TriangleInterface**](triangle_interface.md) | [**TriangleInterface**](triangle_interface.md) | [**TriangleInterface**](triangle_interface.md) | | +[_1](#allof-_1) | dict, frozendict.frozendict | frozendict.frozendict | | + +# allof _1 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**triangleType** | str | str | | [optional] must be one of ["IsoscelesTriangle"] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/items.md b/samples/openapi3/client/petstore/python/docs/components/schema/items.md new file mode 100644 index 00000000000..dd76e5362c3 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/items.md @@ -0,0 +1,24 @@ +petstore_api.components.schema.items +# Schema Items + +## Description +component's name collides with the inner schema name + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +list, tuple | tuple | component's name collides with the inner schema name | + +## List Items +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[items](#items) | dict, frozendict.frozendict | frozendict.frozendict | | + +# Items + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/json_patch_request.md b/samples/openapi3/client/petstore/python/docs/components/schema/json_patch_request.md new file mode 100644 index 00000000000..210d6dd272b --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/json_patch_request.md @@ -0,0 +1,29 @@ +petstore_api.components.schema.json_patch_request +# Schema JSONPatchRequest + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +list, tuple | tuple | | + +## List Items +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[items](#items) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +# Items + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Composed Schemas (allOf/anyOf/oneOf/not) +## oneOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[**JSONPatchRequestAddReplaceTest**](json_patch_request_add_replace_test.md) | [**JSONPatchRequestAddReplaceTest**](json_patch_request_add_replace_test.md) | [**JSONPatchRequestAddReplaceTest**](json_patch_request_add_replace_test.md) | | +[**JSONPatchRequestRemove**](json_patch_request_remove.md) | [**JSONPatchRequestRemove**](json_patch_request_remove.md) | [**JSONPatchRequestRemove**](json_patch_request_remove.md) | | +[**JSONPatchRequestMoveCopy**](json_patch_request_move_copy.md) | [**JSONPatchRequestMoveCopy**](json_patch_request_move_copy.md) | [**JSONPatchRequestMoveCopy**](json_patch_request_move_copy.md) | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/json_patch_request_add_replace_test.md b/samples/openapi3/client/petstore/python/docs/components/schema/json_patch_request_add_replace_test.md new file mode 100644 index 00000000000..0c2f2d67602 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/json_patch_request_add_replace_test.md @@ -0,0 +1,16 @@ +petstore_api.components.schema.json_patch_request_add_replace_test +# Schema JSONPatchRequestAddReplaceTest + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**op** | str | str | The operation to perform. | must be one of ["add", "replace", "test"] +**path** | str | str | A JSON Pointer path. | +**value** | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | The value to add, replace or test. | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/json_patch_request_move_copy.md b/samples/openapi3/client/petstore/python/docs/components/schema/json_patch_request_move_copy.md new file mode 100644 index 00000000000..7afe39861bf --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/json_patch_request_move_copy.md @@ -0,0 +1,16 @@ +petstore_api.components.schema.json_patch_request_move_copy +# Schema JSONPatchRequestMoveCopy + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**from** | str | str | A JSON Pointer path. | +**op** | str | str | The operation to perform. | must be one of ["move", "copy"] +**path** | str | str | A JSON Pointer path. | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/json_patch_request_remove.md b/samples/openapi3/client/petstore/python/docs/components/schema/json_patch_request_remove.md new file mode 100644 index 00000000000..7e85e1ca89e --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/json_patch_request_remove.md @@ -0,0 +1,15 @@ +petstore_api.components.schema.json_patch_request_remove +# Schema JSONPatchRequestRemove + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**op** | str | str | The operation to perform. | must be one of ["remove"] +**path** | str | str | A JSON Pointer path. | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/mammal.md b/samples/openapi3/client/petstore/python/docs/components/schema/mammal.md new file mode 100644 index 00000000000..051dc3e9f17 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/mammal.md @@ -0,0 +1,17 @@ +petstore_api.components.schema.mammal +# Schema Mammal + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Composed Schemas (allOf/anyOf/oneOf/not) +## oneOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[**Whale**](whale.md) | [**Whale**](whale.md) | [**Whale**](whale.md) | | +[**Zebra**](zebra.md) | [**Zebra**](zebra.md) | [**Zebra**](zebra.md) | | +[**Pig**](pig.md) | [**Pig**](pig.md) | [**Pig**](pig.md) | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/map_test.md b/samples/openapi3/client/petstore/python/docs/components/schema/map_test.md new file mode 100644 index 00000000000..da2ac17a444 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/map_test.md @@ -0,0 +1,66 @@ +petstore_api.components.schema.map_test +# Schema MapTest + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**map_map_of_string** | dict, frozendict.frozendict | [properties.MapMapOfString](#properties-mapmapofstring) | | [optional] +**map_of_enum_string** | dict, frozendict.frozendict | [properties.MapOfEnumString](#properties-mapofenumstring) | | [optional] +**direct_map** | dict, frozendict.frozendict | [properties.DirectMap](#properties-directmap) | | [optional] +**indirect_map** | [**StringBooleanMap**](string_boolean_map.md), dict, frozendict.frozendict | [**StringBooleanMap**](string_boolean_map.md) | | [optional] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +# properties MapMapOfString + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**any_string_name** | dict, frozendict.frozendict | [AdditionalProperties](#properties-mapmapofstring-additionalproperties) | any string name can be used but the value must be the correct type | [optional] + +# properties MapMapOfString AdditionalProperties + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**any_string_name** | str | str | any string name can be used but the value must be the correct type | [optional] + +# properties MapOfEnumString + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**any_string_name** | str | str | any string name can be used but the value must be the correct type | [optional] must be one of ["UPPER", "lower"] + +# properties DirectMap + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**any_string_name** | bool | BoolClass | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/mixed_properties_and_additional_properties_class.md b/samples/openapi3/client/petstore/python/docs/components/schema/mixed_properties_and_additional_properties_class.md new file mode 100644 index 00000000000..d1a87ac4f9e --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/mixed_properties_and_additional_properties_class.md @@ -0,0 +1,29 @@ +petstore_api.components.schema.mixed_properties_and_additional_properties_class +# Schema MixedPropertiesAndAdditionalPropertiesClass + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**uuid** | str, uuid.UUID | str | | [optional] value must be a uuid +**dateTime** | str, datetime.datetime | str | | [optional] value must conform to RFC-3339 date-time +**map** | dict, frozendict.frozendict | [properties.Map](#properties-map) | | [optional] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +# properties Map + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**any_string_name** | [**Animal**](animal.md), dict, frozendict.frozendict | [**Animal**](animal.md) | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/money.md b/samples/openapi3/client/petstore/python/docs/components/schema/money.md new file mode 100644 index 00000000000..b35359b6687 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/money.md @@ -0,0 +1,16 @@ +petstore_api.components.schema.money +# Schema Money + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**amount** | str | str | | value must be numeric and storable in decimal.Decimal +**currency** | [**Currency**](currency.md), str | [**Currency**](currency.md) | | +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/name.md b/samples/openapi3/client/petstore/python/docs/components/schema/name.md new file mode 100644 index 00000000000..3439fd81754 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/name.md @@ -0,0 +1,20 @@ +petstore_api.components.schema.name +# Schema Name + +## Description +Model for testing model name same as property name + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | Model for testing model name same as property name | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**name** | decimal.Decimal, int | decimal.Decimal | | value must be a 32 bit integer +**snake_case** | decimal.Decimal, int | decimal.Decimal | | [optional] value must be a 32 bit integer +**property** | str | str | this is a reserved python keyword | [optional] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/no_additional_properties.md b/samples/openapi3/client/petstore/python/docs/components/schema/no_additional_properties.md new file mode 100644 index 00000000000..80ea3d9d773 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/no_additional_properties.md @@ -0,0 +1,15 @@ +petstore_api.components.schema.no_additional_properties +# Schema NoAdditionalProperties + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**id** | decimal.Decimal, int | decimal.Decimal | | value must be a 64 bit integer +**petId** | decimal.Decimal, int | decimal.Decimal | | [optional] value must be a 64 bit integer + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/nullable_class.md b/samples/openapi3/client/petstore/python/docs/components/schema/nullable_class.md new file mode 100644 index 00000000000..27117058e3a --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/nullable_class.md @@ -0,0 +1,147 @@ +petstore_api.components.schema.nullable_class +# Schema NullableClass + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**integer_prop** | None, decimal.Decimal, int | NoneClass, decimal.Decimal | | [optional] +**number_prop** | None, decimal.Decimal, int, float | NoneClass, decimal.Decimal | | [optional] +**boolean_prop** | None, bool | NoneClass, BoolClass | | [optional] +**string_prop** | None, str | NoneClass, str | | [optional] +**date_prop** | None, str, datetime.date | NoneClass, str | | [optional] value must conform to RFC-3339 full-date YYYY-MM-DD +**datetime_prop** | None, str, datetime.datetime | NoneClass, str | | [optional] value must conform to RFC-3339 date-time +**array_nullable_prop** | None, list, tuple | [properties.ArrayNullableProp](#properties-arraynullableprop) | | [optional] +**array_and_items_nullable_prop** | None, list, tuple | [properties.ArrayAndItemsNullableProp](#properties-arrayanditemsnullableprop) | | [optional] +**array_items_nullable** | list, tuple | [properties.ArrayItemsNullable](#properties-arrayitemsnullable) | | [optional] +**object_nullable_prop** | None, dict, frozendict.frozendict | [properties.ObjectNullableProp](#properties-objectnullableprop) | | [optional] +**object_and_items_nullable_prop** | None, dict, frozendict.frozendict | [properties.ObjectAndItemsNullableProp](#properties-objectanditemsnullableprop) | | [optional] +**object_items_nullable** | dict, frozendict.frozendict | [properties.ObjectItemsNullable](#properties-objectitemsnullable) | | [optional] +**any_string_name** | None, dict, frozendict.frozendict | [AdditionalProperties](#additionalproperties) | any string name can be used but the value must be the correct type | [optional] + +# properties ArrayNullableProp + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +None, list, tuple | NoneClass, tuple | | + +## List Items +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[items](#properties-arraynullableprop-items) | dict, frozendict.frozendict | frozendict.frozendict | | + +# properties ArrayNullableProp Items + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +# properties ArrayAndItemsNullableProp + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +None, list, tuple | NoneClass, tuple | | + +## List Items +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[items](#properties-arrayanditemsnullableprop-items) | None, dict, frozendict.frozendict | NoneClass, frozendict.frozendict | | + +# properties ArrayAndItemsNullableProp Items + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +None, dict, frozendict.frozendict | NoneClass, frozendict.frozendict | | + +# properties ArrayItemsNullable + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +list, tuple | tuple | | + +## List Items +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[items](#properties-arrayitemsnullable-items) | None, dict, frozendict.frozendict | NoneClass, frozendict.frozendict | | + +# properties ArrayItemsNullable Items + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +None, dict, frozendict.frozendict | NoneClass, frozendict.frozendict | | + +# properties ObjectNullableProp + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +None, dict, frozendict.frozendict | NoneClass, frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**any_string_name** | dict, frozendict.frozendict | [AdditionalProperties](#properties-objectnullableprop-additionalproperties) | any string name can be used but the value must be the correct type | [optional] + +# properties ObjectNullableProp AdditionalProperties + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +# properties ObjectAndItemsNullableProp + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +None, dict, frozendict.frozendict | NoneClass, frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**any_string_name** | None, dict, frozendict.frozendict | [AdditionalProperties](#properties-objectanditemsnullableprop-additionalproperties) | any string name can be used but the value must be the correct type | [optional] + +# properties ObjectAndItemsNullableProp AdditionalProperties + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +None, dict, frozendict.frozendict | NoneClass, frozendict.frozendict | | + +# properties ObjectItemsNullable + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**any_string_name** | None, dict, frozendict.frozendict | [AdditionalProperties](#properties-objectitemsnullable-additionalproperties) | any string name can be used but the value must be the correct type | [optional] + +# properties ObjectItemsNullable AdditionalProperties + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +None, dict, frozendict.frozendict | NoneClass, frozendict.frozendict | | + +# AdditionalProperties + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +None, dict, frozendict.frozendict | NoneClass, frozendict.frozendict | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/nullable_shape.md b/samples/openapi3/client/petstore/python/docs/components/schema/nullable_shape.md new file mode 100644 index 00000000000..c184b13f888 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/nullable_shape.md @@ -0,0 +1,27 @@ +petstore_api.components.schema.nullable_shape +# Schema NullableShape + +## Description +The value may be a shape or the 'null' value. For a composed schema to validate a null payload, one of its chosen oneOf schemas must be type null or nullable (introduced in OAS schema >= 3.0) + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | The value may be a shape or the 'null' value. For a composed schema to validate a null payload, one of its chosen oneOf schemas must be type null or nullable (introduced in OAS schema >= 3.0) | + +## Composed Schemas (allOf/anyOf/oneOf/not) +## oneOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[**Triangle**](triangle.md) | [**Triangle**](triangle.md) | [**Triangle**](triangle.md) | | +[**Quadrilateral**](quadrilateral.md) | [**Quadrilateral**](quadrilateral.md) | [**Quadrilateral**](quadrilateral.md) | | +[_2](#oneof-_2) | None | NoneClass | | + +# oneof _2 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +None | NoneClass | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/nullable_string.md b/samples/openapi3/client/petstore/python/docs/components/schema/nullable_string.md new file mode 100644 index 00000000000..4e9fb1b068e --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/nullable_string.md @@ -0,0 +1,9 @@ +petstore_api.components.schema.nullable_string +# Schema NullableString + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +None, str | NoneClass, str | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/number.md b/samples/openapi3/client/petstore/python/docs/components/schema/number.md new file mode 100644 index 00000000000..c5c0a9137ab --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/number.md @@ -0,0 +1,9 @@ +petstore_api.components.schema.number +# Schema Number + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +decimal.Decimal, int, float | decimal.Decimal | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/number_only.md b/samples/openapi3/client/petstore/python/docs/components/schema/number_only.md new file mode 100644 index 00000000000..e6ce33df0aa --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/number_only.md @@ -0,0 +1,15 @@ +petstore_api.components.schema.number_only +# Schema NumberOnly + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**JustNumber** | decimal.Decimal, int, float | decimal.Decimal | | [optional] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/number_with_validations.md b/samples/openapi3/client/petstore/python/docs/components/schema/number_with_validations.md new file mode 100644 index 00000000000..bfaba196136 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/number_with_validations.md @@ -0,0 +1,9 @@ +petstore_api.components.schema.number_with_validations +# Schema NumberWithValidations + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +decimal.Decimal, int, float | decimal.Decimal | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/object_interface.md b/samples/openapi3/client/petstore/python/docs/components/schema/object_interface.md new file mode 100644 index 00000000000..f3391bb0c84 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/object_interface.md @@ -0,0 +1,9 @@ +petstore_api.components.schema.object_interface +# Schema ObjectInterface + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/object_model_with_arg_and_args_properties.md b/samples/openapi3/client/petstore/python/docs/components/schema/object_model_with_arg_and_args_properties.md new file mode 100644 index 00000000000..4811ed2110c --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/object_model_with_arg_and_args_properties.md @@ -0,0 +1,16 @@ +petstore_api.components.schema.object_model_with_arg_and_args_properties +# Schema ObjectModelWithArgAndArgsProperties + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**arg** | str | str | | +**args** | str | str | | +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/object_model_with_ref_props.md b/samples/openapi3/client/petstore/python/docs/components/schema/object_model_with_ref_props.md new file mode 100644 index 00000000000..a8973a389cf --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/object_model_with_ref_props.md @@ -0,0 +1,20 @@ +petstore_api.components.schema.object_model_with_ref_props +# Schema ObjectModelWithRefProps + +## Description +a model that includes properties which should stay primitive (String + Boolean) and one which is defined as a class, NumberWithValidations + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | a model that includes properties which should stay primitive (String + Boolean) and one which is defined as a class, NumberWithValidations | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**myNumber** | [**NumberWithValidations**](number_with_validations.md), decimal.Decimal, int, float | [**NumberWithValidations**](number_with_validations.md) | | [optional] +**myString** | [**String**](string.md), str | [**String**](string.md) | | [optional] +**myBoolean** | [**Boolean**](boolean.md), bool | [**Boolean**](boolean.md) | | [optional] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/object_with_all_of_with_req_test_prop_from_unset_add_prop.md b/samples/openapi3/client/petstore/python/docs/components/schema/object_with_all_of_with_req_test_prop_from_unset_add_prop.md new file mode 100644 index 00000000000..0a434163e4d --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/object_with_all_of_with_req_test_prop_from_unset_add_prop.md @@ -0,0 +1,29 @@ +petstore_api.components.schema.object_with_all_of_with_req_test_prop_from_unset_add_prop +# Schema ObjectWithAllOfWithReqTestPropFromUnsetAddProp + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Composed Schemas (allOf/anyOf/oneOf/not) +## allOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[**ObjectWithOptionalTestProp**](object_with_optional_test_prop.md) | [**ObjectWithOptionalTestProp**](object_with_optional_test_prop.md) | [**ObjectWithOptionalTestProp**](object_with_optional_test_prop.md) | | +[_1](#allof-_1) | dict, frozendict.frozendict | frozendict.frozendict | | + +# allof _1 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**test** | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/object_with_colliding_properties.md b/samples/openapi3/client/petstore/python/docs/components/schema/object_with_colliding_properties.md new file mode 100644 index 00000000000..a74b0cdd42c --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/object_with_colliding_properties.md @@ -0,0 +1,33 @@ +petstore_api.components.schema.object_with_colliding_properties +# Schema ObjectWithCollidingProperties + +## Description +component with properties that have name collisions + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | component with properties that have name collisions | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**someProp** | dict, frozendict.frozendict | [properties.SomeProp](#properties-someprop) | | [optional] +**someprop** | dict, frozendict.frozendict | [properties.Someprop](#properties-someprop) | | [optional] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +# properties SomeProp + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +# properties Someprop + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/object_with_decimal_properties.md b/samples/openapi3/client/petstore/python/docs/components/schema/object_with_decimal_properties.md new file mode 100644 index 00000000000..55b1581cc5e --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/object_with_decimal_properties.md @@ -0,0 +1,17 @@ +petstore_api.components.schema.object_with_decimal_properties +# Schema ObjectWithDecimalProperties + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**length** | [**DecimalPayload**](decimal_payload.md), str | [**DecimalPayload**](decimal_payload.md) | | [optional] +**width** | str | str | | [optional] value must be numeric and storable in decimal.Decimal +**cost** | [**Money**](money.md), dict, frozendict.frozendict | [**Money**](money.md) | | [optional] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/object_with_difficultly_named_props.md b/samples/openapi3/client/petstore/python/docs/components/schema/object_with_difficultly_named_props.md new file mode 100644 index 00000000000..1e0d9f812d3 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/object_with_difficultly_named_props.md @@ -0,0 +1,20 @@ +petstore_api.components.schema.object_with_difficultly_named_props +# Schema ObjectWithDifficultlyNamedProps + +## Description +model with properties that have invalid names for python + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | model with properties that have invalid names for python | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**123-list** | str | str | | +**$special[property.name]** | decimal.Decimal, int | decimal.Decimal | | [optional] value must be a 64 bit integer +**123Number** | decimal.Decimal, int | decimal.Decimal | | [optional] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/object_with_inline_composition_property.md b/samples/openapi3/client/petstore/python/docs/components/schema/object_with_inline_composition_property.md new file mode 100644 index 00000000000..6ec8d62c45c --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/object_with_inline_composition_property.md @@ -0,0 +1,35 @@ +petstore_api.components.schema.object_with_inline_composition_property +# Schema ObjectWithInlineCompositionProperty + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**someProp** | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | [properties.SomeProp](#properties-someprop) | | [optional] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +# properties SomeProp + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Composed Schemas (allOf/anyOf/oneOf/not) +## allOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[_0](#properties-someprop-allof-_0) | str | str | | + +# properties SomeProp allof _0 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str | str | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/object_with_invalid_named_refed_properties.md b/samples/openapi3/client/petstore/python/docs/components/schema/object_with_invalid_named_refed_properties.md new file mode 100644 index 00000000000..f74a8b16251 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/object_with_invalid_named_refed_properties.md @@ -0,0 +1,16 @@ +petstore_api.components.schema.object_with_invalid_named_refed_properties +# Schema ObjectWithInvalidNamedRefedProperties + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**!reference** | [**ArrayWithValidationsInItems**](array_with_validations_in_items.md), list, tuple | [**ArrayWithValidationsInItems**](array_with_validations_in_items.md) | | +**from** | [**FromSchema**](from_schema.md), dict, frozendict.frozendict | [**FromSchema**](from_schema.md) | | +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/object_with_optional_test_prop.md b/samples/openapi3/client/petstore/python/docs/components/schema/object_with_optional_test_prop.md new file mode 100644 index 00000000000..f4f2fe30258 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/object_with_optional_test_prop.md @@ -0,0 +1,15 @@ +petstore_api.components.schema.object_with_optional_test_prop +# Schema ObjectWithOptionalTestProp + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**test** | str | str | | [optional] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/object_with_validations.md b/samples/openapi3/client/petstore/python/docs/components/schema/object_with_validations.md new file mode 100644 index 00000000000..8c6ccab3f7f --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/object_with_validations.md @@ -0,0 +1,9 @@ +petstore_api.components.schema.object_with_validations +# Schema ObjectWithValidations + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/order.md b/samples/openapi3/client/petstore/python/docs/components/schema/order.md new file mode 100644 index 00000000000..6019804d0b9 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/order.md @@ -0,0 +1,20 @@ +petstore_api.components.schema.order +# Schema Order + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**id** | decimal.Decimal, int | decimal.Decimal | | [optional] value must be a 64 bit integer +**petId** | decimal.Decimal, int | decimal.Decimal | | [optional] value must be a 64 bit integer +**quantity** | decimal.Decimal, int | decimal.Decimal | | [optional] value must be a 32 bit integer +**shipDate** | str, datetime.datetime | str | | [optional] value must conform to RFC-3339 date-time +**status** | str | str | Order Status | [optional] must be one of ["placed", "approved", "delivered"] +**complete** | bool | BoolClass | | [optional] if omitted the server will use the default value of false +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/parent_pet.md b/samples/openapi3/client/petstore/python/docs/components/schema/parent_pet.md new file mode 100644 index 00000000000..1306646d3eb --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/parent_pet.md @@ -0,0 +1,15 @@ +petstore_api.components.schema.parent_pet +# Schema ParentPet + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Composed Schemas (allOf/anyOf/oneOf/not) +## allOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[**GrandparentAnimal**](grandparent_animal.md) | [**GrandparentAnimal**](grandparent_animal.md) | [**GrandparentAnimal**](grandparent_animal.md) | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/pet.md b/samples/openapi3/client/petstore/python/docs/components/schema/pet.md new file mode 100644 index 00000000000..35e713d42e2 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/pet.md @@ -0,0 +1,47 @@ +petstore_api.components.schema.pet +# Schema Pet + +## Description +Pet object that needs to be added to the store + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | Pet object that needs to be added to the store | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**name** | str | str | | +**photoUrls** | list, tuple | [properties.PhotoUrls](#properties-photourls) | | +**id** | decimal.Decimal, int | decimal.Decimal | | [optional] value must be a 64 bit integer +**category** | [**Category**](category.md), dict, frozendict.frozendict | [**Category**](category.md) | | [optional] +**tags** | list, tuple | [properties.Tags](#properties-tags) | | [optional] +**status** | str | str | pet status in the store | [optional] must be one of ["available", "pending", "sold"] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +# properties PhotoUrls + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +list, tuple | tuple | | + +## List Items +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +items | str | str | | + +# properties Tags + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +list, tuple | tuple | | + +## List Items +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[**Tag**](tag.md) | [**Tag**](tag.md) | [**Tag**](tag.md) | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/pig.md b/samples/openapi3/client/petstore/python/docs/components/schema/pig.md new file mode 100644 index 00000000000..a16256b6530 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/pig.md @@ -0,0 +1,16 @@ +petstore_api.components.schema.pig +# Schema Pig + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Composed Schemas (allOf/anyOf/oneOf/not) +## oneOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[**BasquePig**](basque_pig.md) | [**BasquePig**](basque_pig.md) | [**BasquePig**](basque_pig.md) | | +[**DanishPig**](danish_pig.md) | [**DanishPig**](danish_pig.md) | [**DanishPig**](danish_pig.md) | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/player.md b/samples/openapi3/client/petstore/python/docs/components/schema/player.md new file mode 100644 index 00000000000..eba885bf1df --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/player.md @@ -0,0 +1,19 @@ +petstore_api.components.schema.player +# Schema Player + +## Description +a model that includes a self reference this forces properties and additionalProperties to be lazy loaded in python models because the Player class has not fully loaded when defining properties + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | a model that includes a self reference this forces properties and additionalProperties to be lazy loaded in python models because the Player class has not fully loaded when defining properties | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**name** | str | str | | [optional] +**enemyPlayer** | [**Player**](#top), dict, frozendict.frozendict | [**Player**](#top) | | [optional] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/quadrilateral.md b/samples/openapi3/client/petstore/python/docs/components/schema/quadrilateral.md new file mode 100644 index 00000000000..321996aa4bd --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/quadrilateral.md @@ -0,0 +1,16 @@ +petstore_api.components.schema.quadrilateral +# Schema Quadrilateral + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Composed Schemas (allOf/anyOf/oneOf/not) +## oneOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[**SimpleQuadrilateral**](simple_quadrilateral.md) | [**SimpleQuadrilateral**](simple_quadrilateral.md) | [**SimpleQuadrilateral**](simple_quadrilateral.md) | | +[**ComplexQuadrilateral**](complex_quadrilateral.md) | [**ComplexQuadrilateral**](complex_quadrilateral.md) | [**ComplexQuadrilateral**](complex_quadrilateral.md) | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/quadrilateral_interface.md b/samples/openapi3/client/petstore/python/docs/components/schema/quadrilateral_interface.md new file mode 100644 index 00000000000..00d7faba1ba --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/quadrilateral_interface.md @@ -0,0 +1,16 @@ +petstore_api.components.schema.quadrilateral_interface +# Schema QuadrilateralInterface + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**quadrilateralType** | str | str | | +**shapeType** | str | str | | must be one of ["Quadrilateral"] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/read_only_first.md b/samples/openapi3/client/petstore/python/docs/components/schema/read_only_first.md new file mode 100644 index 00000000000..b66e475094f --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/read_only_first.md @@ -0,0 +1,16 @@ +petstore_api.components.schema.read_only_first +# Schema ReadOnlyFirst + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**bar** | str | str | | [optional] +**baz** | str | str | | [optional] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/ref_pet.md b/samples/openapi3/client/petstore/python/docs/components/schema/ref_pet.md new file mode 100644 index 00000000000..015e6035596 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/ref_pet.md @@ -0,0 +1,9 @@ +petstore_api.components.schema.ref_pet +# Schema RefPet + +## Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[Pet](pet.md) | dict, frozendict.frozendict | frozendict.frozendict | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/req_props_from_explicit_add_props.md b/samples/openapi3/client/petstore/python/docs/components/schema/req_props_from_explicit_add_props.md new file mode 100644 index 00000000000..9e0ab2d970c --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/req_props_from_explicit_add_props.md @@ -0,0 +1,16 @@ +petstore_api.components.schema.req_props_from_explicit_add_props +# Schema ReqPropsFromExplicitAddProps + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**invalid-name** | str | str | | +**validName** | str | str | | +**any_string_name** | str | str | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/req_props_from_true_add_props.md b/samples/openapi3/client/petstore/python/docs/components/schema/req_props_from_true_add_props.md new file mode 100644 index 00000000000..23a1d391be7 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/req_props_from_true_add_props.md @@ -0,0 +1,16 @@ +petstore_api.components.schema.req_props_from_true_add_props +# Schema ReqPropsFromTrueAddProps + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**invalid-name** | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | +**validName** | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | +**any_string_name** | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/req_props_from_unset_add_props.md b/samples/openapi3/client/petstore/python/docs/components/schema/req_props_from_unset_add_props.md new file mode 100644 index 00000000000..f7a6e17c59e --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/req_props_from_unset_add_props.md @@ -0,0 +1,16 @@ +petstore_api.components.schema.req_props_from_unset_add_props +# Schema ReqPropsFromUnsetAddProps + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**invalid-name** | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | +**validName** | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/scalene_triangle.md b/samples/openapi3/client/petstore/python/docs/components/schema/scalene_triangle.md new file mode 100644 index 00000000000..c2a7554ee5c --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/scalene_triangle.md @@ -0,0 +1,29 @@ +petstore_api.components.schema.scalene_triangle +# Schema ScaleneTriangle + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Composed Schemas (allOf/anyOf/oneOf/not) +## allOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[**TriangleInterface**](triangle_interface.md) | [**TriangleInterface**](triangle_interface.md) | [**TriangleInterface**](triangle_interface.md) | | +[_1](#allof-_1) | dict, frozendict.frozendict | frozendict.frozendict | | + +# allof _1 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**triangleType** | str | str | | [optional] must be one of ["ScaleneTriangle"] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/self_referencing_array_model.md b/samples/openapi3/client/petstore/python/docs/components/schema/self_referencing_array_model.md new file mode 100644 index 00000000000..83b055693ba --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/self_referencing_array_model.md @@ -0,0 +1,14 @@ +petstore_api.components.schema.self_referencing_array_model +# Schema SelfReferencingArrayModel + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +list, tuple | tuple | | + +## List Items +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[**SelfReferencingArrayModel**](#top) | [**SelfReferencingArrayModel**](#top) | [**SelfReferencingArrayModel**](#top) | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/self_referencing_object_model.md b/samples/openapi3/client/petstore/python/docs/components/schema/self_referencing_object_model.md new file mode 100644 index 00000000000..8750d3cb15c --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/self_referencing_object_model.md @@ -0,0 +1,15 @@ +petstore_api.components.schema.self_referencing_object_model +# Schema SelfReferencingObjectModel + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**selfRef** | [**SelfReferencingObjectModel**](#top), dict, frozendict.frozendict | [**SelfReferencingObjectModel**](#top) | | [optional] +**any_string_name** | [**SelfReferencingObjectModel**](#top), dict, frozendict.frozendict | [**SelfReferencingObjectModel**](#top) | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/shape.md b/samples/openapi3/client/petstore/python/docs/components/schema/shape.md new file mode 100644 index 00000000000..64064b9ace0 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/shape.md @@ -0,0 +1,16 @@ +petstore_api.components.schema.shape +# Schema Shape + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Composed Schemas (allOf/anyOf/oneOf/not) +## oneOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[**Triangle**](triangle.md) | [**Triangle**](triangle.md) | [**Triangle**](triangle.md) | | +[**Quadrilateral**](quadrilateral.md) | [**Quadrilateral**](quadrilateral.md) | [**Quadrilateral**](quadrilateral.md) | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/shape_or_null.md b/samples/openapi3/client/petstore/python/docs/components/schema/shape_or_null.md new file mode 100644 index 00000000000..c8b3227beba --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/shape_or_null.md @@ -0,0 +1,27 @@ +petstore_api.components.schema.shape_or_null +# Schema ShapeOrNull + +## Description +The value may be a shape or the 'null' value. This is introduced in OAS schema >= 3.1. + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | The value may be a shape or the 'null' value. This is introduced in OAS schema >= 3.1. | + +## Composed Schemas (allOf/anyOf/oneOf/not) +## oneOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[_0](#oneof-_0) | None | NoneClass | | +[**Triangle**](triangle.md) | [**Triangle**](triangle.md) | [**Triangle**](triangle.md) | | +[**Quadrilateral**](quadrilateral.md) | [**Quadrilateral**](quadrilateral.md) | [**Quadrilateral**](quadrilateral.md) | | + +# oneof _0 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +None | NoneClass | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/simple_quadrilateral.md b/samples/openapi3/client/petstore/python/docs/components/schema/simple_quadrilateral.md new file mode 100644 index 00000000000..1eff5e486ad --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/simple_quadrilateral.md @@ -0,0 +1,29 @@ +petstore_api.components.schema.simple_quadrilateral +# Schema SimpleQuadrilateral + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Composed Schemas (allOf/anyOf/oneOf/not) +## allOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[**QuadrilateralInterface**](quadrilateral_interface.md) | [**QuadrilateralInterface**](quadrilateral_interface.md) | [**QuadrilateralInterface**](quadrilateral_interface.md) | | +[_1](#allof-_1) | dict, frozendict.frozendict | frozendict.frozendict | | + +# allof _1 + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**quadrilateralType** | str | str | | [optional] must be one of ["SimpleQuadrilateral"] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/some_object.md b/samples/openapi3/client/petstore/python/docs/components/schema/some_object.md new file mode 100644 index 00000000000..71179089983 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/some_object.md @@ -0,0 +1,15 @@ +petstore_api.components.schema.some_object +# Schema SomeObject + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Composed Schemas (allOf/anyOf/oneOf/not) +## allOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[**ObjectInterface**](object_interface.md) | [**ObjectInterface**](object_interface.md) | [**ObjectInterface**](object_interface.md) | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/special_model_name.md b/samples/openapi3/client/petstore/python/docs/components/schema/special_model_name.md new file mode 100644 index 00000000000..26f29b5ae1d --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/special_model_name.md @@ -0,0 +1,18 @@ +petstore_api.components.schema.special_model_name +# Schema SpecialModelName + +## Description +model with an invalid class name for python + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | model with an invalid class name for python | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**a** | str | str | | [optional] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/string.md b/samples/openapi3/client/petstore/python/docs/components/schema/string.md new file mode 100644 index 00000000000..39b9d4f0fa8 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/string.md @@ -0,0 +1,9 @@ +petstore_api.components.schema.string +# Schema String + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str | str | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/string_boolean_map.md b/samples/openapi3/client/petstore/python/docs/components/schema/string_boolean_map.md new file mode 100644 index 00000000000..3b95f170ef7 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/string_boolean_map.md @@ -0,0 +1,14 @@ +petstore_api.components.schema.string_boolean_map +# Schema StringBooleanMap + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**any_string_name** | bool | BoolClass | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/string_enum.md b/samples/openapi3/client/petstore/python/docs/components/schema/string_enum.md new file mode 100644 index 00000000000..d9b229a03aa --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/string_enum.md @@ -0,0 +1,9 @@ +petstore_api.components.schema.string_enum +# Schema StringEnum + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +None, str | NoneClass, str | | must be one of ["placed", "approved", "delivered", "single quoted", "multiple\nlines", "double quote \n with newline", None] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/string_enum_with_default_value.md b/samples/openapi3/client/petstore/python/docs/components/schema/string_enum_with_default_value.md new file mode 100644 index 00000000000..537504fc9a7 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/string_enum_with_default_value.md @@ -0,0 +1,9 @@ +petstore_api.components.schema.string_enum_with_default_value +# Schema StringEnumWithDefaultValue + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str | str | | must be one of ["placed", "approved", "delivered"] if omitted the server will use the default value of placed + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/string_with_validation.md b/samples/openapi3/client/petstore/python/docs/components/schema/string_with_validation.md new file mode 100644 index 00000000000..d1c961e438a --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/string_with_validation.md @@ -0,0 +1,9 @@ +petstore_api.components.schema.string_with_validation +# Schema StringWithValidation + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str | str | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/tag.md b/samples/openapi3/client/petstore/python/docs/components/schema/tag.md new file mode 100644 index 00000000000..018431a2a26 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/tag.md @@ -0,0 +1,16 @@ +petstore_api.components.schema.tag +# Schema Tag + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**id** | decimal.Decimal, int | decimal.Decimal | | [optional] value must be a 64 bit integer +**name** | str | str | | [optional] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/triangle.md b/samples/openapi3/client/petstore/python/docs/components/schema/triangle.md new file mode 100644 index 00000000000..93687a30924 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/triangle.md @@ -0,0 +1,17 @@ +petstore_api.components.schema.triangle +# Schema Triangle + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Composed Schemas (allOf/anyOf/oneOf/not) +## oneOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[**EquilateralTriangle**](equilateral_triangle.md) | [**EquilateralTriangle**](equilateral_triangle.md) | [**EquilateralTriangle**](equilateral_triangle.md) | | +[**IsoscelesTriangle**](isosceles_triangle.md) | [**IsoscelesTriangle**](isosceles_triangle.md) | [**IsoscelesTriangle**](isosceles_triangle.md) | | +[**ScaleneTriangle**](scalene_triangle.md) | [**ScaleneTriangle**](scalene_triangle.md) | [**ScaleneTriangle**](scalene_triangle.md) | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/triangle_interface.md b/samples/openapi3/client/petstore/python/docs/components/schema/triangle_interface.md new file mode 100644 index 00000000000..383ce293503 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/triangle_interface.md @@ -0,0 +1,16 @@ +petstore_api.components.schema.triangle_interface +# Schema TriangleInterface + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**shapeType** | str | str | | must be one of ["Triangle"] +**triangleType** | str | str | | +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/user.md b/samples/openapi3/client/petstore/python/docs/components/schema/user.md new file mode 100644 index 00000000000..f4ea92ecb78 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/user.md @@ -0,0 +1,70 @@ +petstore_api.components.schema.user +# Schema User + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**id** | decimal.Decimal, int | decimal.Decimal | | [optional] value must be a 64 bit integer +**username** | str | str | | [optional] +**firstName** | str | str | | [optional] +**lastName** | str | str | | [optional] +**email** | str | str | | [optional] +**password** | str | str | | [optional] +**phone** | str | str | | [optional] +**userStatus** | decimal.Decimal, int | decimal.Decimal | User Status | [optional] value must be a 32 bit integer +**objectWithNoDeclaredProps** | dict, frozendict.frozendict | [properties.ObjectWithNoDeclaredProps](#properties-objectwithnodeclaredprops) | test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. | [optional] +**objectWithNoDeclaredPropsNullable** | None, dict, frozendict.frozendict | [properties.ObjectWithNoDeclaredPropsNullable](#properties-objectwithnodeclaredpropsnullable) | test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. | [optional] +**anyTypeProp** | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 | [optional] +**anyTypeExceptNullProp** | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | [properties.AnyTypeExceptNullProp](#properties-anytypeexceptnullprop) | any type except 'null' Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. | [optional] +**anyTypePropNullable** | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values. | [optional] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +# properties ObjectWithNoDeclaredProps + +## Description +test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. | + +# properties ObjectWithNoDeclaredPropsNullable + +## Description +test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +None, dict, frozendict.frozendict | NoneClass, frozendict.frozendict | test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. | + +# properties AnyTypeExceptNullProp + +## Description +any type except 'null' Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | any type except 'null' Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. | + +## Composed Schemas (allOf/anyOf/oneOf/not) +## not +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[_not](#properties-anytypeexceptnullprop-_not) | None | NoneClass | | + +# properties AnyTypeExceptNullProp _Not + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +None | NoneClass | | + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/uuid_string.md b/samples/openapi3/client/petstore/python/docs/components/schema/uuid_string.md new file mode 100644 index 00000000000..092827b5ae5 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/uuid_string.md @@ -0,0 +1,9 @@ +petstore_api.components.schema.uuid_string +# Schema UUIDString + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, uuid.UUID | str | | value must be a uuid + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/whale.md b/samples/openapi3/client/petstore/python/docs/components/schema/whale.md new file mode 100644 index 00000000000..c5e2166b843 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/whale.md @@ -0,0 +1,17 @@ +petstore_api.components.schema.whale +# Schema Whale + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**className** | str | str | | must be one of ["whale"] +**hasBaleen** | bool | BoolClass | | [optional] +**hasTeeth** | bool | BoolClass | | [optional] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/zebra.md b/samples/openapi3/client/petstore/python/docs/components/schema/zebra.md new file mode 100644 index 00000000000..252142dcb58 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/schema/zebra.md @@ -0,0 +1,16 @@ +petstore_api.components.schema.zebra +# Schema Zebra + +## Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**className** | str | str | | must be one of ["zebra"] +**type** | str | str | | [optional] must be one of ["plains", "mountain", "grevys"] +**any_string_name** | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/security_schemes/security_scheme_api_key.md b/samples/openapi3/client/petstore/python/docs/components/security_schemes/security_scheme_api_key.md new file mode 100644 index 00000000000..f11daf9fe69 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/security_schemes/security_scheme_api_key.md @@ -0,0 +1,21 @@ +petstore_api.components.security_schemes.security_scheme_api_key +# SecurityScheme ApiKey + +## Description +apiKey in header + +## Type +security_schemes.SecuritySchemeType.API_KEY + +## Name +"api_key" + +## api_key +Type | Notes +---- | ------ +str | Set by the developer + +## In Location +security_schemes.ApiKeyInLocation.HEADER + +[[Back to top]](#top) [[Back to Component Security Schemes]](../../../README.md#Component-SecuritySchemes) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/security_schemes/security_scheme_api_key_query.md b/samples/openapi3/client/petstore/python/docs/components/security_schemes/security_scheme_api_key_query.md new file mode 100644 index 00000000000..8a6f218c97a --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/security_schemes/security_scheme_api_key_query.md @@ -0,0 +1,21 @@ +petstore_api.components.security_schemes.security_scheme_api_key_query +# SecurityScheme ApiKeyQuery + +## Description +apiKey in query + +## Type +security_schemes.SecuritySchemeType.API_KEY + +## Name +"api_key_query" + +## api_key +Type | Notes +---- | ------ +str | Set by the developer + +## In Location +security_schemes.ApiKeyInLocation.QUERY + +[[Back to top]](#top) [[Back to Component Security Schemes]](../../../README.md#Component-SecuritySchemes) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/security_schemes/security_scheme_bearer_test.md b/samples/openapi3/client/petstore/python/docs/components/security_schemes/security_scheme_bearer_test.md new file mode 100644 index 00000000000..335a24ff2ce --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/security_schemes/security_scheme_bearer_test.md @@ -0,0 +1,21 @@ +petstore_api.components.security_schemes.security_scheme_bearer_test +# SecurityScheme BearerTest + +## Description +http bearer with JWT bearer format + +## Type +security_schemes.SecuritySchemeType.HTTP + +## Scheme +security_schemes.HTTPSchemeType.BEARER + +## Bearer Format +"JWT" + +## access_token +Type | Notes +---- | ------ +str | Set by the developer + +[[Back to top]](#top) [[Back to Component Security Schemes]](../../../README.md#Component-SecuritySchemes) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/security_schemes/security_scheme_http_basic_test.md b/samples/openapi3/client/petstore/python/docs/components/security_schemes/security_scheme_http_basic_test.md new file mode 100644 index 00000000000..471590e65aa --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/security_schemes/security_scheme_http_basic_test.md @@ -0,0 +1,23 @@ +petstore_api.components.security_schemes.security_scheme_http_basic_test +# SecurityScheme HttpBasicTest + +## Description +http basic + +## Type +security_schemes.SecuritySchemeType.HTTP + +## Scheme +security_schemes.HTTPSchemeType.BASIC + +## user_id +Type | Notes +---- | ------ +str | Set by the developer + +## password +Type | Notes +---- | ------ +str | Set by the developer + +[[Back to top]](#top) [[Back to Component Security Schemes]](../../../README.md#Component-SecuritySchemes) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/security_schemes/security_scheme_http_signature_test.md b/samples/openapi3/client/petstore/python/docs/components/security_schemes/security_scheme_http_signature_test.md new file mode 100644 index 00000000000..f1eb69567f1 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/security_schemes/security_scheme_http_signature_test.md @@ -0,0 +1,18 @@ +petstore_api.components.security_schemes.security_scheme_http_signature_test +# SecurityScheme HttpSignatureTest + +## Description +http + signature + +## Type +security_schemes.SecuritySchemeType.HTTP + +## Scheme +security_schemes.HTTPSchemeType.SIGNATURE + +## signing_info +Type | Notes +---- | ------ +petstore_api.signing.HttpSigningConfiguration | Set by the developer + +[[Back to top]](#top) [[Back to Component Security Schemes]](../../../README.md#Component-SecuritySchemes) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/security_schemes/security_scheme_open_id_connect_test.md b/samples/openapi3/client/petstore/python/docs/components/security_schemes/security_scheme_open_id_connect_test.md new file mode 100644 index 00000000000..dbe8f7d5d6e --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/security_schemes/security_scheme_open_id_connect_test.md @@ -0,0 +1,13 @@ +petstore_api.components.security_schemes.security_scheme_open_id_connect_test +# SecurityScheme OpenIdConnectTest + +## Description +openIdConnect + +## Type +security_schemes.SecuritySchemeType.OPENID_CONNECT + +## OpenIdConnect Url +"https://somesite.com/.well-known/openid-configuration" + +[[Back to top]](#top) [[Back to Component Security Schemes]](../../../README.md#Component-SecuritySchemes) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/security_schemes/security_scheme_petstore_auth.md b/samples/openapi3/client/petstore/python/docs/components/security_schemes/security_scheme_petstore_auth.md new file mode 100644 index 00000000000..3f97e58236b --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/components/security_schemes/security_scheme_petstore_auth.md @@ -0,0 +1,20 @@ +petstore_api.components.security_schemes.security_scheme_petstore_auth +# SecurityScheme PetstoreAuth + +## Description +oauth2 implicit flow with two scopes + +## Type +security_schemes.SecuritySchemeType.OAUTH_2 + +## Flows +## Implicit Flow +### Scopes +Scope Name | Scope Description +| -------- | ---------------- | +"write:pets" | modify pets in your account +"read:pets" | read your pets +### Authorization Url +"http://petstore.swagger.io/api/oauth/dialog" + +[[Back to top]](#top) [[Back to Component Security Schemes]](../../../README.md#Component-SecuritySchemes) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/models/AbstractStepMessage.md b/samples/openapi3/client/petstore/python/docs/models/AbstractStepMessage.md deleted file mode 100644 index 8e92fdf3c42..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/AbstractStepMessage.md +++ /dev/null @@ -1,25 +0,0 @@ -# petstore_api.model.abstract_step_message.AbstractStepMessage - -Abstract Step - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | Abstract Step | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**sequenceNumber** | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | -**description** | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | -**discriminator** | str, | str, | | -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### anyOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[AbstractStepMessage](AbstractStepMessage.md) | [**AbstractStepMessage**](AbstractStepMessage.md) | [**AbstractStepMessage**](AbstractStepMessage.md) | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/AdditionalPropertiesClass.md b/samples/openapi3/client/petstore/python/docs/models/AdditionalPropertiesClass.md deleted file mode 100644 index 80e4e770991..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/AdditionalPropertiesClass.md +++ /dev/null @@ -1,109 +0,0 @@ -# petstore_api.model.additional_properties_class.AdditionalPropertiesClass - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**[map_property](#map_property)** | dict, frozendict.frozendict, | frozendict.frozendict, | | [optional] -**[map_of_map_property](#map_of_map_property)** | dict, frozendict.frozendict, | frozendict.frozendict, | | [optional] -**anytype_1** | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | [optional] -**[map_with_undeclared_properties_anytype_1](#map_with_undeclared_properties_anytype_1)** | dict, frozendict.frozendict, | frozendict.frozendict, | | [optional] -**[map_with_undeclared_properties_anytype_2](#map_with_undeclared_properties_anytype_2)** | dict, frozendict.frozendict, | frozendict.frozendict, | | [optional] -**[map_with_undeclared_properties_anytype_3](#map_with_undeclared_properties_anytype_3)** | dict, frozendict.frozendict, | frozendict.frozendict, | | [optional] -**[empty_map](#empty_map)** | dict, frozendict.frozendict, | frozendict.frozendict, | an object with no declared properties and no undeclared properties, hence it's an empty map. | [optional] -**[map_with_undeclared_properties_string](#map_with_undeclared_properties_string)** | dict, frozendict.frozendict, | frozendict.frozendict, | | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -# map_property - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**any_string_name** | str, | str, | any string name can be used but the value must be the correct type | [optional] - -# map_of_map_property - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**[any_string_name](#any_string_name)** | dict, frozendict.frozendict, | frozendict.frozendict, | any string name can be used but the value must be the correct type | [optional] - -# any_string_name - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**any_string_name** | str, | str, | any string name can be used but the value must be the correct type | [optional] - -# map_with_undeclared_properties_anytype_1 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -# map_with_undeclared_properties_anytype_2 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -# map_with_undeclared_properties_anytype_3 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -# empty_map - -an object with no declared properties and no undeclared properties, hence it's an empty map. - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | an object with no declared properties and no undeclared properties, hence it's an empty map. | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- - -# map_with_undeclared_properties_string - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**any_string_name** | str, | str, | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/AdditionalPropertiesValidator.md b/samples/openapi3/client/petstore/python/docs/models/AdditionalPropertiesValidator.md deleted file mode 100644 index 4a386a3864c..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/AdditionalPropertiesValidator.md +++ /dev/null @@ -1,53 +0,0 @@ -# petstore_api.model.additional_properties_validator.AdditionalPropertiesValidator - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### allOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[all_of_0](#all_of_0) | dict, frozendict.frozendict, | frozendict.frozendict, | | -[all_of_1](#all_of_1) | dict, frozendict.frozendict, | frozendict.frozendict, | | -[all_of_2](#all_of_2) | dict, frozendict.frozendict, | frozendict.frozendict, | | - -# all_of_0 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -# all_of_1 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -# all_of_2 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/AdditionalPropertiesWithArrayOfEnums.md b/samples/openapi3/client/petstore/python/docs/models/AdditionalPropertiesWithArrayOfEnums.md deleted file mode 100644 index 22dd693183c..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/AdditionalPropertiesWithArrayOfEnums.md +++ /dev/null @@ -1,26 +0,0 @@ -# petstore_api.model.additional_properties_with_array_of_enums.AdditionalPropertiesWithArrayOfEnums - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**[any_string_name](#any_string_name)** | list, tuple, | tuple, | any string name can be used but the value must be the correct type | [optional] - -# any_string_name - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -list, tuple, | tuple, | | - -### Tuple Items -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[**EnumClass**](EnumClass.md) | [**EnumClass**](EnumClass.md) | [**EnumClass**](EnumClass.md) | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/Address.md b/samples/openapi3/client/petstore/python/docs/models/Address.md deleted file mode 100644 index 1ec43dfd0bc..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/Address.md +++ /dev/null @@ -1,14 +0,0 @@ -# petstore_api.model.address.Address - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**any_string_name** | decimal.Decimal, int, | decimal.Decimal, | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/Animal.md b/samples/openapi3/client/petstore/python/docs/models/Animal.md deleted file mode 100644 index bf064d289ed..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/Animal.md +++ /dev/null @@ -1,16 +0,0 @@ -# petstore_api.model.animal.Animal - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**className** | str, | str, | | -**color** | str, | str, | | [optional] if omitted the server will use the default value of "red" -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/AnimalFarm.md b/samples/openapi3/client/petstore/python/docs/models/AnimalFarm.md deleted file mode 100644 index f1b1468e77e..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/AnimalFarm.md +++ /dev/null @@ -1,14 +0,0 @@ -# petstore_api.model.animal_farm.AnimalFarm - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -list, tuple, | tuple, | | - -### Tuple Items -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[**Animal**](Animal.md) | [**Animal**](Animal.md) | [**Animal**](Animal.md) | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/AnyTypeAndFormat.md b/samples/openapi3/client/petstore/python/docs/models/AnyTypeAndFormat.md deleted file mode 100644 index 812e5c6a1ee..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/AnyTypeAndFormat.md +++ /dev/null @@ -1,23 +0,0 @@ -# petstore_api.model.any_type_and_format.AnyTypeAndFormat - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**uuid** | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | [optional] value must be a uuid -**date** | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | [optional] value must conform to RFC-3339 full-date YYYY-MM-DD -**date-time** | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | [optional] value must conform to RFC-3339 date-time -**number** | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | [optional] value must be numeric and storable in decimal.Decimal -**binary** | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | [optional] -**int32** | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | [optional] value must be a 32 bit integer -**int64** | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | [optional] value must be a 64 bit integer -**double** | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | [optional] value must be a 64 bit float -**float** | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | [optional] value must be a 32 bit float -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/AnyTypeNotString.md b/samples/openapi3/client/petstore/python/docs/models/AnyTypeNotString.md deleted file mode 100644 index ff57ed8d213..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/AnyTypeNotString.md +++ /dev/null @@ -1,22 +0,0 @@ -# petstore_api.model.any_type_not_string.AnyTypeNotString - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### not -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[not_schema](#not_schema) | str, | str, | | - -# not_schema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/ApiResponse.md b/samples/openapi3/client/petstore/python/docs/models/ApiResponse.md deleted file mode 100644 index 578aa06cb50..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/ApiResponse.md +++ /dev/null @@ -1,17 +0,0 @@ -# petstore_api.model.api_response.ApiResponse - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**code** | decimal.Decimal, int, | decimal.Decimal, | | [optional] value must be a 32 bit integer -**type** | str, | str, | | [optional] -**message** | str, | str, | | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/Apple.md b/samples/openapi3/client/petstore/python/docs/models/Apple.md deleted file mode 100644 index 84c3ab8da58..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/Apple.md +++ /dev/null @@ -1,16 +0,0 @@ -# petstore_api.model.apple.Apple - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, None, | frozendict.frozendict, NoneClass, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**cultivar** | str, | str, | | -**origin** | str, | str, | | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/AppleReq.md b/samples/openapi3/client/petstore/python/docs/models/AppleReq.md deleted file mode 100644 index 59e2c1b00c8..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/AppleReq.md +++ /dev/null @@ -1,15 +0,0 @@ -# petstore_api.model.apple_req.AppleReq - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**cultivar** | str, | str, | | -**mealy** | bool, | BoolClass, | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/ArrayHoldingAnyType.md b/samples/openapi3/client/petstore/python/docs/models/ArrayHoldingAnyType.md deleted file mode 100644 index 7dc14c3018e..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/ArrayHoldingAnyType.md +++ /dev/null @@ -1,14 +0,0 @@ -# petstore_api.model.array_holding_any_type.ArrayHoldingAnyType - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -list, tuple, | tuple, | | - -### Tuple Items -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -items | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | any type can be stored here | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/ArrayOfArrayOfNumberOnly.md b/samples/openapi3/client/petstore/python/docs/models/ArrayOfArrayOfNumberOnly.md deleted file mode 100644 index b3e7a281e0a..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/ArrayOfArrayOfNumberOnly.md +++ /dev/null @@ -1,39 +0,0 @@ -# petstore_api.model.array_of_array_of_number_only.ArrayOfArrayOfNumberOnly - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**[ArrayArrayNumber](#ArrayArrayNumber)** | list, tuple, | tuple, | | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -# ArrayArrayNumber - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -list, tuple, | tuple, | | - -### Tuple Items -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[items](#items) | list, tuple, | tuple, | | - -# items - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -list, tuple, | tuple, | | - -### Tuple Items -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -items | decimal.Decimal, int, float, | decimal.Decimal, | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/ArrayOfEnums.md b/samples/openapi3/client/petstore/python/docs/models/ArrayOfEnums.md deleted file mode 100644 index dca614b9ae6..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/ArrayOfEnums.md +++ /dev/null @@ -1,14 +0,0 @@ -# petstore_api.model.array_of_enums.ArrayOfEnums - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -list, tuple, | tuple, | | - -### Tuple Items -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[**StringEnum**](StringEnum.md) | [**StringEnum**](StringEnum.md) | [**StringEnum**](StringEnum.md) | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/ArrayOfNumberOnly.md b/samples/openapi3/client/petstore/python/docs/models/ArrayOfNumberOnly.md deleted file mode 100644 index 271dff52fd0..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/ArrayOfNumberOnly.md +++ /dev/null @@ -1,27 +0,0 @@ -# petstore_api.model.array_of_number_only.ArrayOfNumberOnly - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**[ArrayNumber](#ArrayNumber)** | list, tuple, | tuple, | | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -# ArrayNumber - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -list, tuple, | tuple, | | - -### Tuple Items -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -items | decimal.Decimal, int, float, | decimal.Decimal, | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/ArrayTest.md b/samples/openapi3/client/petstore/python/docs/models/ArrayTest.md deleted file mode 100644 index 657329575ee..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/ArrayTest.md +++ /dev/null @@ -1,77 +0,0 @@ -# petstore_api.model.array_test.ArrayTest - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**[array_of_string](#array_of_string)** | list, tuple, | tuple, | | [optional] -**[array_array_of_integer](#array_array_of_integer)** | list, tuple, | tuple, | | [optional] -**[array_array_of_model](#array_array_of_model)** | list, tuple, | tuple, | | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -# array_of_string - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -list, tuple, | tuple, | | - -### Tuple Items -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -items | str, | str, | | - -# array_array_of_integer - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -list, tuple, | tuple, | | - -### Tuple Items -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[items](#items) | list, tuple, | tuple, | | - -# items - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -list, tuple, | tuple, | | - -### Tuple Items -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -items | decimal.Decimal, int, | decimal.Decimal, | | value must be a 64 bit integer - -# array_array_of_model - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -list, tuple, | tuple, | | - -### Tuple Items -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[items](#items) | list, tuple, | tuple, | | - -# items - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -list, tuple, | tuple, | | - -### Tuple Items -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[**ReadOnlyFirst**](ReadOnlyFirst.md) | [**ReadOnlyFirst**](ReadOnlyFirst.md) | [**ReadOnlyFirst**](ReadOnlyFirst.md) | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/ArrayWithValidationsInItems.md b/samples/openapi3/client/petstore/python/docs/models/ArrayWithValidationsInItems.md deleted file mode 100644 index b81ab8cd5d6..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/ArrayWithValidationsInItems.md +++ /dev/null @@ -1,14 +0,0 @@ -# petstore_api.model.array_with_validations_in_items.ArrayWithValidationsInItems - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -list, tuple, | tuple, | | - -### Tuple Items -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -items | decimal.Decimal, int, | decimal.Decimal, | | value must be a 64 bit integer - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/Banana.md b/samples/openapi3/client/petstore/python/docs/models/Banana.md deleted file mode 100644 index 034c7f77709..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/Banana.md +++ /dev/null @@ -1,15 +0,0 @@ -# petstore_api.model.banana.Banana - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**lengthCm** | decimal.Decimal, int, float, | decimal.Decimal, | | -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/BananaReq.md b/samples/openapi3/client/petstore/python/docs/models/BananaReq.md deleted file mode 100644 index ae53efbfe95..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/BananaReq.md +++ /dev/null @@ -1,15 +0,0 @@ -# petstore_api.model.banana_req.BananaReq - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**lengthCm** | decimal.Decimal, int, float, | decimal.Decimal, | | -**sweet** | bool, | BoolClass, | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/Bar.md b/samples/openapi3/client/petstore/python/docs/models/Bar.md deleted file mode 100644 index 55aa05fa180..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/Bar.md +++ /dev/null @@ -1,9 +0,0 @@ -# petstore_api.model.bar.Bar - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | if omitted the server will use the default value of "bar" - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/BasquePig.md b/samples/openapi3/client/petstore/python/docs/models/BasquePig.md deleted file mode 100644 index b0860be169a..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/BasquePig.md +++ /dev/null @@ -1,15 +0,0 @@ -# petstore_api.model.basque_pig.BasquePig - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**className** | str, | str, | | must be one of ["BasquePig", ] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/Boolean.md b/samples/openapi3/client/petstore/python/docs/models/Boolean.md deleted file mode 100644 index c2e0e952aca..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/Boolean.md +++ /dev/null @@ -1,9 +0,0 @@ -# petstore_api.model.boolean.Boolean - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -bool, | BoolClass, | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/BooleanEnum.md b/samples/openapi3/client/petstore/python/docs/models/BooleanEnum.md deleted file mode 100644 index a84330415cb..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/BooleanEnum.md +++ /dev/null @@ -1,9 +0,0 @@ -# petstore_api.model.boolean_enum.BooleanEnum - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -bool, | BoolClass, | | must be one of [True, ] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/Capitalization.md b/samples/openapi3/client/petstore/python/docs/models/Capitalization.md deleted file mode 100644 index cc39af70e1e..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/Capitalization.md +++ /dev/null @@ -1,20 +0,0 @@ -# petstore_api.model.capitalization.Capitalization - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**smallCamel** | str, | str, | | [optional] -**CapitalCamel** | str, | str, | | [optional] -**small_Snake** | str, | str, | | [optional] -**Capital_Snake** | str, | str, | | [optional] -**SCA_ETH_Flow_Points** | str, | str, | | [optional] -**ATT_NAME** | str, | str, | Name of the pet | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/Cat.md b/samples/openapi3/client/petstore/python/docs/models/Cat.md deleted file mode 100644 index b5e0986f57b..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/Cat.md +++ /dev/null @@ -1,29 +0,0 @@ -# petstore_api.model.cat.Cat - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### allOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[Animal](Animal.md) | [**Animal**](Animal.md) | [**Animal**](Animal.md) | | -[all_of_1](#all_of_1) | dict, frozendict.frozendict, | frozendict.frozendict, | | - -# all_of_1 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**declawed** | bool, | BoolClass, | | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/Category.md b/samples/openapi3/client/petstore/python/docs/models/Category.md deleted file mode 100644 index 0087571a3a6..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/Category.md +++ /dev/null @@ -1,16 +0,0 @@ -# petstore_api.model.category.Category - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**name** | str, | str, | | if omitted the server will use the default value of "default-name" -**id** | decimal.Decimal, int, | decimal.Decimal, | | [optional] value must be a 64 bit integer -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/ChildCat.md b/samples/openapi3/client/petstore/python/docs/models/ChildCat.md deleted file mode 100644 index 645ea5062dd..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/ChildCat.md +++ /dev/null @@ -1,29 +0,0 @@ -# petstore_api.model.child_cat.ChildCat - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### allOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[ParentPet](ParentPet.md) | [**ParentPet**](ParentPet.md) | [**ParentPet**](ParentPet.md) | | -[all_of_1](#all_of_1) | dict, frozendict.frozendict, | frozendict.frozendict, | | - -# all_of_1 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**name** | str, | str, | | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/ClassModel.md b/samples/openapi3/client/petstore/python/docs/models/ClassModel.md deleted file mode 100644 index b1686ebb799..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/ClassModel.md +++ /dev/null @@ -1,17 +0,0 @@ -# petstore_api.model.class_model.ClassModel - -Model for testing model with \"_class\" property - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | Model for testing model with \"_class\" property | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**_class** | str, | str, | | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/Client.md b/samples/openapi3/client/petstore/python/docs/models/Client.md deleted file mode 100644 index e94c360dd28..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/Client.md +++ /dev/null @@ -1,15 +0,0 @@ -# petstore_api.model.client.Client - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**client** | str, | str, | | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/ComplexQuadrilateral.md b/samples/openapi3/client/petstore/python/docs/models/ComplexQuadrilateral.md deleted file mode 100644 index a00ac0d9da6..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/ComplexQuadrilateral.md +++ /dev/null @@ -1,29 +0,0 @@ -# petstore_api.model.complex_quadrilateral.ComplexQuadrilateral - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### allOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[QuadrilateralInterface](QuadrilateralInterface.md) | [**QuadrilateralInterface**](QuadrilateralInterface.md) | [**QuadrilateralInterface**](QuadrilateralInterface.md) | | -[all_of_1](#all_of_1) | dict, frozendict.frozendict, | frozendict.frozendict, | | - -# all_of_1 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**quadrilateralType** | str, | str, | | [optional] must be one of ["ComplexQuadrilateral", ] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/ComposedAnyOfDifferentTypesNoValidations.md b/samples/openapi3/client/petstore/python/docs/models/ComposedAnyOfDifferentTypesNoValidations.md deleted file mode 100644 index f4389c50eb2..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/ComposedAnyOfDifferentTypesNoValidations.md +++ /dev/null @@ -1,147 +0,0 @@ -# petstore_api.model.composed_any_of_different_types_no_validations.ComposedAnyOfDifferentTypesNoValidations - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### anyOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[any_of_0](#any_of_0) | dict, frozendict.frozendict, | frozendict.frozendict, | | -[any_of_1](#any_of_1) | str, date, | str, | | value must conform to RFC-3339 full-date YYYY-MM-DD -[any_of_2](#any_of_2) | str, datetime, | str, | | value must conform to RFC-3339 date-time -[any_of_3](#any_of_3) | bytes, io.FileIO, io.BufferedReader, | bytes, FileIO, | | -[any_of_4](#any_of_4) | str, | str, | | -[any_of_5](#any_of_5) | str, | str, | | -[any_of_6](#any_of_6) | dict, frozendict.frozendict, | frozendict.frozendict, | | -[any_of_7](#any_of_7) | bool, | BoolClass, | | -[any_of_8](#any_of_8) | None, | NoneClass, | | -[any_of_9](#any_of_9) | list, tuple, | tuple, | | -[any_of_10](#any_of_10) | decimal.Decimal, int, float, | decimal.Decimal, | | -[any_of_11](#any_of_11) | decimal.Decimal, int, float, | decimal.Decimal, | | value must be a 32 bit float -[any_of_12](#any_of_12) | decimal.Decimal, int, float, | decimal.Decimal, | | value must be a 64 bit float -[any_of_13](#any_of_13) | decimal.Decimal, int, | decimal.Decimal, | | -[any_of_14](#any_of_14) | decimal.Decimal, int, | decimal.Decimal, | | value must be a 32 bit integer -[any_of_15](#any_of_15) | decimal.Decimal, int, | decimal.Decimal, | | value must be a 64 bit integer - -# any_of_0 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -# any_of_1 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, date, | str, | | value must conform to RFC-3339 full-date YYYY-MM-DD - -# any_of_2 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, datetime, | str, | | value must conform to RFC-3339 date-time - -# any_of_3 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -bytes, io.FileIO, io.BufferedReader, | bytes, FileIO, | | - -# any_of_4 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | - -# any_of_5 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | - -# any_of_6 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -# any_of_7 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -bool, | BoolClass, | | - -# any_of_8 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -None, | NoneClass, | | - -# any_of_9 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -list, tuple, | tuple, | | - -### Tuple Items -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -items | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -# any_of_10 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -decimal.Decimal, int, float, | decimal.Decimal, | | - -# any_of_11 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -decimal.Decimal, int, float, | decimal.Decimal, | | value must be a 32 bit float - -# any_of_12 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -decimal.Decimal, int, float, | decimal.Decimal, | | value must be a 64 bit float - -# any_of_13 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -decimal.Decimal, int, | decimal.Decimal, | | - -# any_of_14 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -decimal.Decimal, int, | decimal.Decimal, | | value must be a 32 bit integer - -# any_of_15 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -decimal.Decimal, int, | decimal.Decimal, | | value must be a 64 bit integer - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/ComposedArray.md b/samples/openapi3/client/petstore/python/docs/models/ComposedArray.md deleted file mode 100644 index bc506aa5f8a..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/ComposedArray.md +++ /dev/null @@ -1,14 +0,0 @@ -# petstore_api.model.composed_array.ComposedArray - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -list, tuple, | tuple, | | - -### Tuple Items -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -items | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/ComposedBool.md b/samples/openapi3/client/petstore/python/docs/models/ComposedBool.md deleted file mode 100644 index 29ed69f72f1..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/ComposedBool.md +++ /dev/null @@ -1,22 +0,0 @@ -# petstore_api.model.composed_bool.ComposedBool - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -bool, | BoolClass, | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### allOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[all_of_0](#all_of_0) | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -# all_of_0 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/ComposedNone.md b/samples/openapi3/client/petstore/python/docs/models/ComposedNone.md deleted file mode 100644 index df4ec85f2cc..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/ComposedNone.md +++ /dev/null @@ -1,22 +0,0 @@ -# petstore_api.model.composed_none.ComposedNone - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -None, | NoneClass, | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### allOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[all_of_0](#all_of_0) | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -# all_of_0 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/ComposedNumber.md b/samples/openapi3/client/petstore/python/docs/models/ComposedNumber.md deleted file mode 100644 index fa1f87c730c..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/ComposedNumber.md +++ /dev/null @@ -1,22 +0,0 @@ -# petstore_api.model.composed_number.ComposedNumber - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -decimal.Decimal, int, float, | decimal.Decimal, | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### allOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[all_of_0](#all_of_0) | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -# all_of_0 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/ComposedObject.md b/samples/openapi3/client/petstore/python/docs/models/ComposedObject.md deleted file mode 100644 index ebbbaede6b7..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/ComposedObject.md +++ /dev/null @@ -1,22 +0,0 @@ -# petstore_api.model.composed_object.ComposedObject - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### allOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[all_of_0](#all_of_0) | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -# all_of_0 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/ComposedOneOfDifferentTypes.md b/samples/openapi3/client/petstore/python/docs/models/ComposedOneOfDifferentTypes.md deleted file mode 100644 index 0094f7e44c5..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/ComposedOneOfDifferentTypes.md +++ /dev/null @@ -1,63 +0,0 @@ -# petstore_api.model.composed_one_of_different_types.ComposedOneOfDifferentTypes - -this is a model that allows payloads of type object or number - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | this is a model that allows payloads of type object or number | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### oneOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[NumberWithValidations](NumberWithValidations.md) | [**NumberWithValidations**](NumberWithValidations.md) | [**NumberWithValidations**](NumberWithValidations.md) | | -[Animal](Animal.md) | [**Animal**](Animal.md) | [**Animal**](Animal.md) | | -[one_of_2](#one_of_2) | None, | NoneClass, | | -[one_of_3](#one_of_3) | str, date, | str, | | value must conform to RFC-3339 full-date YYYY-MM-DD -[one_of_4](#one_of_4) | dict, frozendict.frozendict, | frozendict.frozendict, | | -[one_of_5](#one_of_5) | list, tuple, | tuple, | | -[one_of_6](#one_of_6) | str, datetime, | str, | | value must conform to RFC-3339 date-time - -# one_of_2 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -None, | NoneClass, | | - -# one_of_3 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, date, | str, | | value must conform to RFC-3339 full-date YYYY-MM-DD - -# one_of_4 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -# one_of_5 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -list, tuple, | tuple, | | - -### Tuple Items -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -items | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -# one_of_6 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, datetime, | str, | | value must conform to RFC-3339 date-time - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/ComposedString.md b/samples/openapi3/client/petstore/python/docs/models/ComposedString.md deleted file mode 100644 index 235511b37a2..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/ComposedString.md +++ /dev/null @@ -1,22 +0,0 @@ -# petstore_api.model.composed_string.ComposedString - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### allOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[all_of_0](#all_of_0) | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -# all_of_0 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/Currency.md b/samples/openapi3/client/petstore/python/docs/models/Currency.md deleted file mode 100644 index eeb1c6a47db..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/Currency.md +++ /dev/null @@ -1,9 +0,0 @@ -# petstore_api.model.currency.Currency - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | must be one of ["eur", "usd", ] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/DanishPig.md b/samples/openapi3/client/petstore/python/docs/models/DanishPig.md deleted file mode 100644 index 15917a42ef8..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/DanishPig.md +++ /dev/null @@ -1,15 +0,0 @@ -# petstore_api.model.danish_pig.DanishPig - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**className** | str, | str, | | must be one of ["DanishPig", ] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/DateTimeTest.md b/samples/openapi3/client/petstore/python/docs/models/DateTimeTest.md deleted file mode 100644 index ccfc8df5936..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/DateTimeTest.md +++ /dev/null @@ -1,9 +0,0 @@ -# petstore_api.model.date_time_test.DateTimeTest - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, datetime, | str, | | if omitted the server will use the default value of 2010-01-01T10:10:10.000111+01:00value must conform to RFC-3339 date-time - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/DateTimeWithValidations.md b/samples/openapi3/client/petstore/python/docs/models/DateTimeWithValidations.md deleted file mode 100644 index ed7dfc06d13..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/DateTimeWithValidations.md +++ /dev/null @@ -1,9 +0,0 @@ -# petstore_api.model.date_time_with_validations.DateTimeWithValidations - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, datetime, | str, | | value must conform to RFC-3339 date-time - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/DateWithValidations.md b/samples/openapi3/client/petstore/python/docs/models/DateWithValidations.md deleted file mode 100644 index 97901a33f55..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/DateWithValidations.md +++ /dev/null @@ -1,9 +0,0 @@ -# petstore_api.model.date_with_validations.DateWithValidations - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, date, | str, | | value must conform to RFC-3339 full-date YYYY-MM-DD - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/DecimalPayload.md b/samples/openapi3/client/petstore/python/docs/models/DecimalPayload.md deleted file mode 100644 index 26ef601ff9f..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/DecimalPayload.md +++ /dev/null @@ -1,9 +0,0 @@ -# petstore_api.model.decimal_payload.DecimalPayload - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | value must be numeric and storable in decimal.Decimal - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/Dog.md b/samples/openapi3/client/petstore/python/docs/models/Dog.md deleted file mode 100644 index 08201e4423b..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/Dog.md +++ /dev/null @@ -1,29 +0,0 @@ -# petstore_api.model.dog.Dog - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### allOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[Animal](Animal.md) | [**Animal**](Animal.md) | [**Animal**](Animal.md) | | -[all_of_1](#all_of_1) | dict, frozendict.frozendict, | frozendict.frozendict, | | - -# all_of_1 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**breed** | str, | str, | | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/Drawing.md b/samples/openapi3/client/petstore/python/docs/models/Drawing.md deleted file mode 100644 index dce65cbb0b5..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/Drawing.md +++ /dev/null @@ -1,30 +0,0 @@ -# petstore_api.model.drawing.Drawing - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**mainShape** | [**Shape**](Shape.md) | [**Shape**](Shape.md) | | [optional] -**shapeOrNull** | [**ShapeOrNull**](ShapeOrNull.md) | [**ShapeOrNull**](ShapeOrNull.md) | | [optional] -**nullableShape** | [**NullableShape**](NullableShape.md) | [**NullableShape**](NullableShape.md) | | [optional] -**[shapes](#shapes)** | list, tuple, | tuple, | | [optional] -**any_string_name** | [**Fruit**](Fruit.md) | [**Fruit**](Fruit.md) | any string name can be used but the value must be the correct type | [optional] - -# shapes - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -list, tuple, | tuple, | | - -### Tuple Items -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[**Shape**](Shape.md) | [**Shape**](Shape.md) | [**Shape**](Shape.md) | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/EnumArrays.md b/samples/openapi3/client/petstore/python/docs/models/EnumArrays.md deleted file mode 100644 index cfff6ea29bd..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/EnumArrays.md +++ /dev/null @@ -1,28 +0,0 @@ -# petstore_api.model.enum_arrays.EnumArrays - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**just_symbol** | str, | str, | | [optional] must be one of [">=", "$", ] -**[array_enum](#array_enum)** | list, tuple, | tuple, | | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -# array_enum - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -list, tuple, | tuple, | | - -### Tuple Items -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -items | str, | str, | | must be one of ["fish", "crab", ] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/EnumClass.md b/samples/openapi3/client/petstore/python/docs/models/EnumClass.md deleted file mode 100644 index 9e08aab1455..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/EnumClass.md +++ /dev/null @@ -1,9 +0,0 @@ -# petstore_api.model.enum_class.EnumClass - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | must be one of ["_abc", "-efg", "(xyz)", "COUNT_1M", "COUNT_50M", ] if omitted the server will use the default value of "-efg" - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/EnumTest.md b/samples/openapi3/client/petstore/python/docs/models/EnumTest.md deleted file mode 100644 index 02c3b08a201..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/EnumTest.md +++ /dev/null @@ -1,23 +0,0 @@ -# petstore_api.model.enum_test.EnumTest - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**enum_string_required** | str, | str, | | must be one of ["UPPER", "lower", "", ] -**enum_string** | str, | str, | | [optional] must be one of ["UPPER", "lower", "", ] -**enum_integer** | decimal.Decimal, int, | decimal.Decimal, | | [optional] must be one of [1, -1, ] value must be a 32 bit integer -**enum_number** | decimal.Decimal, int, float, | decimal.Decimal, | | [optional] must be one of [1.1, -1.2, ] value must be a 64 bit float -**stringEnum** | [**StringEnum**](StringEnum.md) | [**StringEnum**](StringEnum.md) | | [optional] -**IntegerEnum** | [**IntegerEnum**](IntegerEnum.md) | [**IntegerEnum**](IntegerEnum.md) | | [optional] -**StringEnumWithDefaultValue** | [**StringEnumWithDefaultValue**](StringEnumWithDefaultValue.md) | [**StringEnumWithDefaultValue**](StringEnumWithDefaultValue.md) | | [optional] -**IntegerEnumWithDefaultValue** | [**IntegerEnumWithDefaultValue**](IntegerEnumWithDefaultValue.md) | [**IntegerEnumWithDefaultValue**](IntegerEnumWithDefaultValue.md) | | [optional] -**IntegerEnumOneValue** | [**IntegerEnumOneValue**](IntegerEnumOneValue.md) | [**IntegerEnumOneValue**](IntegerEnumOneValue.md) | | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/EquilateralTriangle.md b/samples/openapi3/client/petstore/python/docs/models/EquilateralTriangle.md deleted file mode 100644 index 96971a1c0c6..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/EquilateralTriangle.md +++ /dev/null @@ -1,29 +0,0 @@ -# petstore_api.model.equilateral_triangle.EquilateralTriangle - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### allOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[TriangleInterface](TriangleInterface.md) | [**TriangleInterface**](TriangleInterface.md) | [**TriangleInterface**](TriangleInterface.md) | | -[all_of_1](#all_of_1) | dict, frozendict.frozendict, | frozendict.frozendict, | | - -# all_of_1 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**triangleType** | str, | str, | | [optional] must be one of ["EquilateralTriangle", ] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/File.md b/samples/openapi3/client/petstore/python/docs/models/File.md deleted file mode 100644 index d85669c84f5..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/File.md +++ /dev/null @@ -1,17 +0,0 @@ -# petstore_api.model.file.File - -Must be named `File` for test. - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | Must be named `File` for test. | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**sourceURI** | str, | str, | Test capitalization | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/FileSchemaTestClass.md b/samples/openapi3/client/petstore/python/docs/models/FileSchemaTestClass.md deleted file mode 100644 index 35dcfdca4ec..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/FileSchemaTestClass.md +++ /dev/null @@ -1,28 +0,0 @@ -# petstore_api.model.file_schema_test_class.FileSchemaTestClass - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**file** | [**File**](File.md) | [**File**](File.md) | | [optional] -**[files](#files)** | list, tuple, | tuple, | | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -# files - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -list, tuple, | tuple, | | - -### Tuple Items -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[**File**](File.md) | [**File**](File.md) | [**File**](File.md) | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/Foo.md b/samples/openapi3/client/petstore/python/docs/models/Foo.md deleted file mode 100644 index 5ea8d33d369..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/Foo.md +++ /dev/null @@ -1,15 +0,0 @@ -# petstore_api.model.foo.Foo - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**bar** | str, | str, | | [optional] if omitted the server will use the default value of "bar" -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/FormatTest.md b/samples/openapi3/client/petstore/python/docs/models/FormatTest.md deleted file mode 100644 index 55ca4583a1b..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/FormatTest.md +++ /dev/null @@ -1,47 +0,0 @@ -# petstore_api.model.format_test.FormatTest - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**date** | str, date, | str, | | value must conform to RFC-3339 full-date YYYY-MM-DD -**number** | decimal.Decimal, int, float, | decimal.Decimal, | | -**password** | str, | str, | | -**byte** | str, | str, | | -**integer** | decimal.Decimal, int, | decimal.Decimal, | | [optional] -**int32** | decimal.Decimal, int, | decimal.Decimal, | | [optional] value must be a 32 bit integer -**int32withValidations** | decimal.Decimal, int, | decimal.Decimal, | | [optional] value must be a 32 bit integer -**int64** | decimal.Decimal, int, | decimal.Decimal, | | [optional] value must be a 64 bit integer -**float** | decimal.Decimal, int, float, | decimal.Decimal, | this is a reserved python keyword | [optional] value must be a 32 bit float -**float32** | decimal.Decimal, int, float, | decimal.Decimal, | | [optional] value must be a 32 bit float -**double** | decimal.Decimal, int, float, | decimal.Decimal, | | [optional] value must be a 64 bit float -**float64** | decimal.Decimal, int, float, | decimal.Decimal, | | [optional] value must be a 64 bit float -**[arrayWithUniqueItems](#arrayWithUniqueItems)** | list, tuple, | tuple, | | [optional] -**string** | str, | str, | | [optional] -**binary** | bytes, io.FileIO, io.BufferedReader, | bytes, FileIO, | | [optional] -**dateTime** | str, datetime, | str, | | [optional] value must conform to RFC-3339 date-time -**uuid** | str, uuid.UUID, | str, | | [optional] value must be a uuid -**uuidNoExample** | str, uuid.UUID, | str, | | [optional] value must be a uuid -**pattern_with_digits** | str, | str, | A string that is a 10 digit number. Can have leading zeros. | [optional] -**pattern_with_digits_and_delimiter** | str, | str, | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] -**noneProp** | None, | NoneClass, | | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -# arrayWithUniqueItems - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -list, tuple, | tuple, | | - -### Tuple Items -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -items | decimal.Decimal, int, float, | decimal.Decimal, | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/FromSchema.md b/samples/openapi3/client/petstore/python/docs/models/FromSchema.md deleted file mode 100644 index c11c63adb63..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/FromSchema.md +++ /dev/null @@ -1,16 +0,0 @@ -# petstore_api.model.from_schema.FromSchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**data** | str, | str, | | [optional] -**id** | decimal.Decimal, int, | decimal.Decimal, | | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/Fruit.md b/samples/openapi3/client/petstore/python/docs/models/Fruit.md deleted file mode 100644 index 44d670623fe..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/Fruit.md +++ /dev/null @@ -1,22 +0,0 @@ -# petstore_api.model.fruit.Fruit - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**color** | str, | str, | | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### oneOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[Apple](Apple.md) | [**Apple**](Apple.md) | [**Apple**](Apple.md) | | -[Banana](Banana.md) | [**Banana**](Banana.md) | [**Banana**](Banana.md) | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/FruitReq.md b/samples/openapi3/client/petstore/python/docs/models/FruitReq.md deleted file mode 100644 index c4c18e3e4c9..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/FruitReq.md +++ /dev/null @@ -1,24 +0,0 @@ -# petstore_api.model.fruit_req.FruitReq - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### oneOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[one_of_0](#one_of_0) | None, | NoneClass, | | -[AppleReq](AppleReq.md) | [**AppleReq**](AppleReq.md) | [**AppleReq**](AppleReq.md) | | -[BananaReq](BananaReq.md) | [**BananaReq**](BananaReq.md) | [**BananaReq**](BananaReq.md) | | - -# one_of_0 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -None, | NoneClass, | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/GmFruit.md b/samples/openapi3/client/petstore/python/docs/models/GmFruit.md deleted file mode 100644 index 6515df977c9..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/GmFruit.md +++ /dev/null @@ -1,22 +0,0 @@ -# petstore_api.model.gm_fruit.GmFruit - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**color** | str, | str, | | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### anyOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[Apple](Apple.md) | [**Apple**](Apple.md) | [**Apple**](Apple.md) | | -[Banana](Banana.md) | [**Banana**](Banana.md) | [**Banana**](Banana.md) | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/GrandparentAnimal.md b/samples/openapi3/client/petstore/python/docs/models/GrandparentAnimal.md deleted file mode 100644 index 813fe61b95a..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/GrandparentAnimal.md +++ /dev/null @@ -1,15 +0,0 @@ -# petstore_api.model.grandparent_animal.GrandparentAnimal - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**pet_type** | str, | str, | | -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/HasOnlyReadOnly.md b/samples/openapi3/client/petstore/python/docs/models/HasOnlyReadOnly.md deleted file mode 100644 index d9de17196fa..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/HasOnlyReadOnly.md +++ /dev/null @@ -1,16 +0,0 @@ -# petstore_api.model.has_only_read_only.HasOnlyReadOnly - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**bar** | str, | str, | | [optional] -**foo** | str, | str, | | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/HealthCheckResult.md b/samples/openapi3/client/petstore/python/docs/models/HealthCheckResult.md deleted file mode 100644 index 0985cffd05e..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/HealthCheckResult.md +++ /dev/null @@ -1,17 +0,0 @@ -# petstore_api.model.health_check_result.HealthCheckResult - -Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**NullableMessage** | None, str, | NoneClass, str, | | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/IntegerEnum.md b/samples/openapi3/client/petstore/python/docs/models/IntegerEnum.md deleted file mode 100644 index 59dd6239f78..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/IntegerEnum.md +++ /dev/null @@ -1,9 +0,0 @@ -# petstore_api.model.integer_enum.IntegerEnum - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -decimal.Decimal, int, | decimal.Decimal, | | must be one of [0, 1, 2, ] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/IntegerEnumBig.md b/samples/openapi3/client/petstore/python/docs/models/IntegerEnumBig.md deleted file mode 100644 index d4891543c05..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/IntegerEnumBig.md +++ /dev/null @@ -1,9 +0,0 @@ -# petstore_api.model.integer_enum_big.IntegerEnumBig - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -decimal.Decimal, int, | decimal.Decimal, | | must be one of [10, 11, 12, ] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/IntegerEnumOneValue.md b/samples/openapi3/client/petstore/python/docs/models/IntegerEnumOneValue.md deleted file mode 100644 index c2dd787bc57..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/IntegerEnumOneValue.md +++ /dev/null @@ -1,9 +0,0 @@ -# petstore_api.model.integer_enum_one_value.IntegerEnumOneValue - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -decimal.Decimal, int, | decimal.Decimal, | | must be one of [0, ] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/IntegerEnumWithDefaultValue.md b/samples/openapi3/client/petstore/python/docs/models/IntegerEnumWithDefaultValue.md deleted file mode 100644 index 4eef737f884..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/IntegerEnumWithDefaultValue.md +++ /dev/null @@ -1,9 +0,0 @@ -# petstore_api.model.integer_enum_with_default_value.IntegerEnumWithDefaultValue - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -decimal.Decimal, int, | decimal.Decimal, | | must be one of [0, 1, 2, ] if omitted the server will use the default value of 0 - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/IntegerMax10.md b/samples/openapi3/client/petstore/python/docs/models/IntegerMax10.md deleted file mode 100644 index 93f3c282521..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/IntegerMax10.md +++ /dev/null @@ -1,9 +0,0 @@ -# petstore_api.model.integer_max10.IntegerMax10 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -decimal.Decimal, int, | decimal.Decimal, | | value must be a 64 bit integer - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/IntegerMin15.md b/samples/openapi3/client/petstore/python/docs/models/IntegerMin15.md deleted file mode 100644 index 1a900cf7b43..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/IntegerMin15.md +++ /dev/null @@ -1,9 +0,0 @@ -# petstore_api.model.integer_min15.IntegerMin15 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -decimal.Decimal, int, | decimal.Decimal, | | value must be a 64 bit integer - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/IsoscelesTriangle.md b/samples/openapi3/client/petstore/python/docs/models/IsoscelesTriangle.md deleted file mode 100644 index 3a05686f411..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/IsoscelesTriangle.md +++ /dev/null @@ -1,29 +0,0 @@ -# petstore_api.model.isosceles_triangle.IsoscelesTriangle - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### allOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[TriangleInterface](TriangleInterface.md) | [**TriangleInterface**](TriangleInterface.md) | [**TriangleInterface**](TriangleInterface.md) | | -[all_of_1](#all_of_1) | dict, frozendict.frozendict, | frozendict.frozendict, | | - -# all_of_1 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**triangleType** | str, | str, | | [optional] must be one of ["IsoscelesTriangle", ] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/JSONPatchRequest.md b/samples/openapi3/client/petstore/python/docs/models/JSONPatchRequest.md deleted file mode 100644 index fbc12502927..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/JSONPatchRequest.md +++ /dev/null @@ -1,29 +0,0 @@ -# petstore_api.model.json_patch_request.JSONPatchRequest - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -list, tuple, | tuple, | | - -### Tuple Items -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[items](#items) | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -# items - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### oneOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[JSONPatchRequestAddReplaceTest](JSONPatchRequestAddReplaceTest.md) | [**JSONPatchRequestAddReplaceTest**](JSONPatchRequestAddReplaceTest.md) | [**JSONPatchRequestAddReplaceTest**](JSONPatchRequestAddReplaceTest.md) | | -[JSONPatchRequestRemove](JSONPatchRequestRemove.md) | [**JSONPatchRequestRemove**](JSONPatchRequestRemove.md) | [**JSONPatchRequestRemove**](JSONPatchRequestRemove.md) | | -[JSONPatchRequestMoveCopy](JSONPatchRequestMoveCopy.md) | [**JSONPatchRequestMoveCopy**](JSONPatchRequestMoveCopy.md) | [**JSONPatchRequestMoveCopy**](JSONPatchRequestMoveCopy.md) | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/JSONPatchRequestAddReplaceTest.md b/samples/openapi3/client/petstore/python/docs/models/JSONPatchRequestAddReplaceTest.md deleted file mode 100644 index a95e8f95743..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/JSONPatchRequestAddReplaceTest.md +++ /dev/null @@ -1,16 +0,0 @@ -# petstore_api.model.json_patch_request_add_replace_test.JSONPatchRequestAddReplaceTest - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**op** | str, | str, | The operation to perform. | must be one of ["add", "replace", "test", ] -**path** | str, | str, | A JSON Pointer path. | -**value** | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | The value to add, replace or test. | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/JSONPatchRequestMoveCopy.md b/samples/openapi3/client/petstore/python/docs/models/JSONPatchRequestMoveCopy.md deleted file mode 100644 index 56c8fac4b77..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/JSONPatchRequestMoveCopy.md +++ /dev/null @@ -1,16 +0,0 @@ -# petstore_api.model.json_patch_request_move_copy.JSONPatchRequestMoveCopy - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**op** | str, | str, | The operation to perform. | must be one of ["move", "copy", ] -**path** | str, | str, | A JSON Pointer path. | -**from** | str, | str, | A JSON Pointer path. | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/JSONPatchRequestRemove.md b/samples/openapi3/client/petstore/python/docs/models/JSONPatchRequestRemove.md deleted file mode 100644 index a57981c57c9..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/JSONPatchRequestRemove.md +++ /dev/null @@ -1,15 +0,0 @@ -# petstore_api.model.json_patch_request_remove.JSONPatchRequestRemove - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**op** | str, | str, | The operation to perform. | must be one of ["remove", ] -**path** | str, | str, | A JSON Pointer path. | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/Mammal.md b/samples/openapi3/client/petstore/python/docs/models/Mammal.md deleted file mode 100644 index 12ac20a8200..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/Mammal.md +++ /dev/null @@ -1,17 +0,0 @@ -# petstore_api.model.mammal.Mammal - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### oneOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[Whale](Whale.md) | [**Whale**](Whale.md) | [**Whale**](Whale.md) | | -[Zebra](Zebra.md) | [**Zebra**](Zebra.md) | [**Zebra**](Zebra.md) | | -[Pig](Pig.md) | [**Pig**](Pig.md) | [**Pig**](Pig.md) | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/MapTest.md b/samples/openapi3/client/petstore/python/docs/models/MapTest.md deleted file mode 100644 index 68c8d882955..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/MapTest.md +++ /dev/null @@ -1,66 +0,0 @@ -# petstore_api.model.map_test.MapTest - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**[map_map_of_string](#map_map_of_string)** | dict, frozendict.frozendict, | frozendict.frozendict, | | [optional] -**[map_of_enum_string](#map_of_enum_string)** | dict, frozendict.frozendict, | frozendict.frozendict, | | [optional] -**[direct_map](#direct_map)** | dict, frozendict.frozendict, | frozendict.frozendict, | | [optional] -**indirect_map** | [**StringBooleanMap**](StringBooleanMap.md) | [**StringBooleanMap**](StringBooleanMap.md) | | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -# map_map_of_string - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**[any_string_name](#any_string_name)** | dict, frozendict.frozendict, | frozendict.frozendict, | any string name can be used but the value must be the correct type | [optional] - -# any_string_name - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**any_string_name** | str, | str, | any string name can be used but the value must be the correct type | [optional] - -# map_of_enum_string - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**any_string_name** | str, | str, | any string name can be used but the value must be the correct type | [optional] must be one of ["UPPER", "lower", ] - -# direct_map - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**any_string_name** | bool, | BoolClass, | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/openapi3/client/petstore/python/docs/models/MixedPropertiesAndAdditionalPropertiesClass.md deleted file mode 100644 index f85a43f4c7d..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/MixedPropertiesAndAdditionalPropertiesClass.md +++ /dev/null @@ -1,29 +0,0 @@ -# petstore_api.model.mixed_properties_and_additional_properties_class.MixedPropertiesAndAdditionalPropertiesClass - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**uuid** | str, uuid.UUID, | str, | | [optional] value must be a uuid -**dateTime** | str, datetime, | str, | | [optional] value must conform to RFC-3339 date-time -**[map](#map)** | dict, frozendict.frozendict, | frozendict.frozendict, | | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -# map - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**any_string_name** | [**Animal**](Animal.md) | [**Animal**](Animal.md) | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/Model200Response.md b/samples/openapi3/client/petstore/python/docs/models/Model200Response.md deleted file mode 100644 index 90e17dd402b..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/Model200Response.md +++ /dev/null @@ -1,18 +0,0 @@ -# petstore_api.model.model200_response.Model200Response - -model with an invalid class name for python, starts with a number - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | model with an invalid class name for python, starts with a number | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**name** | decimal.Decimal, int, | decimal.Decimal, | | [optional] value must be a 32 bit integer -**class** | str, | str, | this is a reserved python keyword | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/ModelReturn.md b/samples/openapi3/client/petstore/python/docs/models/ModelReturn.md deleted file mode 100644 index d896e1fbacb..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/ModelReturn.md +++ /dev/null @@ -1,17 +0,0 @@ -# petstore_api.model.model_return.ModelReturn - -Model for testing reserved words - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | Model for testing reserved words | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**return** | decimal.Decimal, int, | decimal.Decimal, | this is a reserved python keyword | [optional] value must be a 32 bit integer -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/Money.md b/samples/openapi3/client/petstore/python/docs/models/Money.md deleted file mode 100644 index f6e182a846d..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/Money.md +++ /dev/null @@ -1,16 +0,0 @@ -# petstore_api.model.money.Money - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**amount** | str, | str, | | value must be numeric and storable in decimal.Decimal -**currency** | [**Currency**](Currency.md) | [**Currency**](Currency.md) | | -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/Name.md b/samples/openapi3/client/petstore/python/docs/models/Name.md deleted file mode 100644 index 9e53cbabab1..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/Name.md +++ /dev/null @@ -1,19 +0,0 @@ -# petstore_api.model.name.Name - -Model for testing model name same as property name - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | Model for testing model name same as property name | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**name** | decimal.Decimal, int, | decimal.Decimal, | | value must be a 32 bit integer -**snake_case** | decimal.Decimal, int, | decimal.Decimal, | | [optional] value must be a 32 bit integer -**property** | str, | str, | this is a reserved python keyword | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/NoAdditionalProperties.md b/samples/openapi3/client/petstore/python/docs/models/NoAdditionalProperties.md deleted file mode 100644 index 70e6c8c1205..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/NoAdditionalProperties.md +++ /dev/null @@ -1,15 +0,0 @@ -# petstore_api.model.no_additional_properties.NoAdditionalProperties - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**id** | decimal.Decimal, int, | decimal.Decimal, | | value must be a 64 bit integer -**petId** | decimal.Decimal, int, | decimal.Decimal, | | [optional] value must be a 64 bit integer - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/NullableClass.md b/samples/openapi3/client/petstore/python/docs/models/NullableClass.md deleted file mode 100644 index d9ad1059145..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/NullableClass.md +++ /dev/null @@ -1,147 +0,0 @@ -# petstore_api.model.nullable_class.NullableClass - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**integer_prop** | None, decimal.Decimal, int, | NoneClass, decimal.Decimal, | | [optional] -**number_prop** | None, decimal.Decimal, int, float, | NoneClass, decimal.Decimal, | | [optional] -**boolean_prop** | None, bool, | NoneClass, BoolClass, | | [optional] -**string_prop** | None, str, | NoneClass, str, | | [optional] -**date_prop** | None, str, date, | NoneClass, str, | | [optional] value must conform to RFC-3339 full-date YYYY-MM-DD -**datetime_prop** | None, str, datetime, | NoneClass, str, | | [optional] value must conform to RFC-3339 date-time -**[array_nullable_prop](#array_nullable_prop)** | list, tuple, None, | tuple, NoneClass, | | [optional] -**[array_and_items_nullable_prop](#array_and_items_nullable_prop)** | list, tuple, None, | tuple, NoneClass, | | [optional] -**[array_items_nullable](#array_items_nullable)** | list, tuple, | tuple, | | [optional] -**[object_nullable_prop](#object_nullable_prop)** | dict, frozendict.frozendict, None, | frozendict.frozendict, NoneClass, | | [optional] -**[object_and_items_nullable_prop](#object_and_items_nullable_prop)** | dict, frozendict.frozendict, None, | frozendict.frozendict, NoneClass, | | [optional] -**[object_items_nullable](#object_items_nullable)** | dict, frozendict.frozendict, | frozendict.frozendict, | | [optional] -**[any_string_name](#any_string_name)** | dict, frozendict.frozendict, None, | frozendict.frozendict, NoneClass, | any string name can be used but the value must be the correct type | [optional] - -# array_nullable_prop - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -list, tuple, None, | tuple, NoneClass, | | - -### Tuple Items -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[items](#items) | dict, frozendict.frozendict, | frozendict.frozendict, | | - -# items - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -# array_and_items_nullable_prop - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -list, tuple, None, | tuple, NoneClass, | | - -### Tuple Items -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[items](#items) | dict, frozendict.frozendict, None, | frozendict.frozendict, NoneClass, | | - -# items - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, None, | frozendict.frozendict, NoneClass, | | - -# array_items_nullable - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -list, tuple, | tuple, | | - -### Tuple Items -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[items](#items) | dict, frozendict.frozendict, None, | frozendict.frozendict, NoneClass, | | - -# items - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, None, | frozendict.frozendict, NoneClass, | | - -# object_nullable_prop - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, None, | frozendict.frozendict, NoneClass, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**[any_string_name](#any_string_name)** | dict, frozendict.frozendict, | frozendict.frozendict, | any string name can be used but the value must be the correct type | [optional] - -# any_string_name - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -# object_and_items_nullable_prop - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, None, | frozendict.frozendict, NoneClass, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**[any_string_name](#any_string_name)** | dict, frozendict.frozendict, None, | frozendict.frozendict, NoneClass, | any string name can be used but the value must be the correct type | [optional] - -# any_string_name - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, None, | frozendict.frozendict, NoneClass, | | - -# object_items_nullable - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**[any_string_name](#any_string_name)** | dict, frozendict.frozendict, None, | frozendict.frozendict, NoneClass, | any string name can be used but the value must be the correct type | [optional] - -# any_string_name - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, None, | frozendict.frozendict, NoneClass, | | - -# any_string_name - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, None, | frozendict.frozendict, NoneClass, | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/NullableShape.md b/samples/openapi3/client/petstore/python/docs/models/NullableShape.md deleted file mode 100644 index 9871dfe1e10..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/NullableShape.md +++ /dev/null @@ -1,26 +0,0 @@ -# petstore_api.model.nullable_shape.NullableShape - -The value may be a shape or the 'null' value. For a composed schema to validate a null payload, one of its chosen oneOf schemas must be type null or nullable (introduced in OAS schema >= 3.0) - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | The value may be a shape or the 'null' value. For a composed schema to validate a null payload, one of its chosen oneOf schemas must be type null or nullable (introduced in OAS schema >= 3.0) | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### oneOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[Triangle](Triangle.md) | [**Triangle**](Triangle.md) | [**Triangle**](Triangle.md) | | -[Quadrilateral](Quadrilateral.md) | [**Quadrilateral**](Quadrilateral.md) | [**Quadrilateral**](Quadrilateral.md) | | -[one_of_2](#one_of_2) | None, | NoneClass, | | - -# one_of_2 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -None, | NoneClass, | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/NullableString.md b/samples/openapi3/client/petstore/python/docs/models/NullableString.md deleted file mode 100644 index 60b4aba3168..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/NullableString.md +++ /dev/null @@ -1,9 +0,0 @@ -# petstore_api.model.nullable_string.NullableString - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -None, str, | NoneClass, str, | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/Number.md b/samples/openapi3/client/petstore/python/docs/models/Number.md deleted file mode 100644 index b1172e284fc..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/Number.md +++ /dev/null @@ -1,9 +0,0 @@ -# petstore_api.model.number.Number - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -decimal.Decimal, int, float, | decimal.Decimal, | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/NumberOnly.md b/samples/openapi3/client/petstore/python/docs/models/NumberOnly.md deleted file mode 100644 index 42996c4e4cd..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/NumberOnly.md +++ /dev/null @@ -1,15 +0,0 @@ -# petstore_api.model.number_only.NumberOnly - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**JustNumber** | decimal.Decimal, int, float, | decimal.Decimal, | | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/NumberWithValidations.md b/samples/openapi3/client/petstore/python/docs/models/NumberWithValidations.md deleted file mode 100644 index fac4f59efe7..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/NumberWithValidations.md +++ /dev/null @@ -1,9 +0,0 @@ -# petstore_api.model.number_with_validations.NumberWithValidations - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -decimal.Decimal, int, float, | decimal.Decimal, | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/ObjectInterface.md b/samples/openapi3/client/petstore/python/docs/models/ObjectInterface.md deleted file mode 100644 index e818da00c6f..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/ObjectInterface.md +++ /dev/null @@ -1,9 +0,0 @@ -# petstore_api.model.object_interface.ObjectInterface - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/ObjectModelWithArgAndArgsProperties.md b/samples/openapi3/client/petstore/python/docs/models/ObjectModelWithArgAndArgsProperties.md deleted file mode 100644 index f7d2a859506..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/ObjectModelWithArgAndArgsProperties.md +++ /dev/null @@ -1,16 +0,0 @@ -# petstore_api.model.object_model_with_arg_and_args_properties.ObjectModelWithArgAndArgsProperties - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**args** | str, | str, | | -**arg** | str, | str, | | -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/ObjectModelWithRefProps.md b/samples/openapi3/client/petstore/python/docs/models/ObjectModelWithRefProps.md deleted file mode 100644 index 8bb001aa771..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/ObjectModelWithRefProps.md +++ /dev/null @@ -1,19 +0,0 @@ -# petstore_api.model.object_model_with_ref_props.ObjectModelWithRefProps - -a model that includes properties which should stay primitive (String + Boolean) and one which is defined as a class, NumberWithValidations - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | a model that includes properties which should stay primitive (String + Boolean) and one which is defined as a class, NumberWithValidations | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**myNumber** | [**NumberWithValidations**](NumberWithValidations.md) | [**NumberWithValidations**](NumberWithValidations.md) | | [optional] -**myString** | str, | str, | | [optional] -**myBoolean** | bool, | BoolClass, | | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/ObjectWithAllOfWithReqTestPropFromUnsetAddProp.md b/samples/openapi3/client/petstore/python/docs/models/ObjectWithAllOfWithReqTestPropFromUnsetAddProp.md deleted file mode 100644 index 6c4f1033e0e..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/ObjectWithAllOfWithReqTestPropFromUnsetAddProp.md +++ /dev/null @@ -1,30 +0,0 @@ -# petstore_api.model.object_with_all_of_with_req_test_prop_from_unset_add_prop.ObjectWithAllOfWithReqTestPropFromUnsetAddProp - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### allOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[ObjectWithOptionalTestProp](ObjectWithOptionalTestProp.md) | [**ObjectWithOptionalTestProp**](ObjectWithOptionalTestProp.md) | [**ObjectWithOptionalTestProp**](ObjectWithOptionalTestProp.md) | | -[all_of_1](#all_of_1) | dict, frozendict.frozendict, | frozendict.frozendict, | | - -# all_of_1 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**test** | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | -**name** | str, | str, | | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/ObjectWithDecimalProperties.md b/samples/openapi3/client/petstore/python/docs/models/ObjectWithDecimalProperties.md deleted file mode 100644 index 82c1abadd60..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/ObjectWithDecimalProperties.md +++ /dev/null @@ -1,17 +0,0 @@ -# petstore_api.model.object_with_decimal_properties.ObjectWithDecimalProperties - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**length** | str, | str, | | [optional] value must be numeric and storable in decimal.Decimal -**width** | str, | str, | | [optional] value must be numeric and storable in decimal.Decimal -**cost** | [**Money**](Money.md) | [**Money**](Money.md) | | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/ObjectWithDifficultlyNamedProps.md b/samples/openapi3/client/petstore/python/docs/models/ObjectWithDifficultlyNamedProps.md deleted file mode 100644 index 13ca7fa1458..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/ObjectWithDifficultlyNamedProps.md +++ /dev/null @@ -1,19 +0,0 @@ -# petstore_api.model.object_with_difficultly_named_props.ObjectWithDifficultlyNamedProps - -model with properties that have invalid names for python - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | model with properties that have invalid names for python | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**123-list** | str, | str, | | -**$special[property.name]** | decimal.Decimal, int, | decimal.Decimal, | | [optional] value must be a 64 bit integer -**123Number** | decimal.Decimal, int, | decimal.Decimal, | | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/ObjectWithInlineCompositionProperty.md b/samples/openapi3/client/petstore/python/docs/models/ObjectWithInlineCompositionProperty.md deleted file mode 100644 index ddf1df42175..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/ObjectWithInlineCompositionProperty.md +++ /dev/null @@ -1,35 +0,0 @@ -# petstore_api.model.object_with_inline_composition_property.ObjectWithInlineCompositionProperty - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**[someProp](#someProp)** | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -# someProp - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### allOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[all_of_0](#all_of_0) | str, | str, | | - -# all_of_0 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/ObjectWithInvalidNamedRefedProperties.md b/samples/openapi3/client/petstore/python/docs/models/ObjectWithInvalidNamedRefedProperties.md deleted file mode 100644 index d3762cc45cc..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/ObjectWithInvalidNamedRefedProperties.md +++ /dev/null @@ -1,16 +0,0 @@ -# petstore_api.model.object_with_invalid_named_refed_properties.ObjectWithInvalidNamedRefedProperties - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**!reference** | [**ArrayWithValidationsInItems**](ArrayWithValidationsInItems.md) | [**ArrayWithValidationsInItems**](ArrayWithValidationsInItems.md) | | -**from** | [**FromSchema**](FromSchema.md) | [**FromSchema**](FromSchema.md) | | -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/ObjectWithOptionalTestProp.md b/samples/openapi3/client/petstore/python/docs/models/ObjectWithOptionalTestProp.md deleted file mode 100644 index 2f437c22d07..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/ObjectWithOptionalTestProp.md +++ /dev/null @@ -1,15 +0,0 @@ -# petstore_api.model.object_with_optional_test_prop.ObjectWithOptionalTestProp - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**test** | str, | str, | | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/ObjectWithValidations.md b/samples/openapi3/client/petstore/python/docs/models/ObjectWithValidations.md deleted file mode 100644 index be9d36e49b6..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/ObjectWithValidations.md +++ /dev/null @@ -1,9 +0,0 @@ -# petstore_api.model.object_with_validations.ObjectWithValidations - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/Order.md b/samples/openapi3/client/petstore/python/docs/models/Order.md deleted file mode 100644 index 0007dc9178d..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/Order.md +++ /dev/null @@ -1,20 +0,0 @@ -# petstore_api.model.order.Order - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**id** | decimal.Decimal, int, | decimal.Decimal, | | [optional] value must be a 64 bit integer -**petId** | decimal.Decimal, int, | decimal.Decimal, | | [optional] value must be a 64 bit integer -**quantity** | decimal.Decimal, int, | decimal.Decimal, | | [optional] value must be a 32 bit integer -**shipDate** | str, datetime, | str, | | [optional] value must conform to RFC-3339 date-time -**status** | str, | str, | Order Status | [optional] must be one of ["placed", "approved", "delivered", ] -**complete** | bool, | BoolClass, | | [optional] if omitted the server will use the default value of False -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/ParentPet.md b/samples/openapi3/client/petstore/python/docs/models/ParentPet.md deleted file mode 100644 index 1baad19537f..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/ParentPet.md +++ /dev/null @@ -1,15 +0,0 @@ -# petstore_api.model.parent_pet.ParentPet - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### allOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[GrandparentAnimal](GrandparentAnimal.md) | [**GrandparentAnimal**](GrandparentAnimal.md) | [**GrandparentAnimal**](GrandparentAnimal.md) | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/Pet.md b/samples/openapi3/client/petstore/python/docs/models/Pet.md deleted file mode 100644 index eacf6aa431d..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/Pet.md +++ /dev/null @@ -1,46 +0,0 @@ -# petstore_api.model.pet.Pet - -Pet object that needs to be added to the store - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | Pet object that needs to be added to the store | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**[photoUrls](#photoUrls)** | list, tuple, | tuple, | | -**name** | str, | str, | | -**id** | decimal.Decimal, int, | decimal.Decimal, | | [optional] value must be a 64 bit integer -**category** | [**Category**](Category.md) | [**Category**](Category.md) | | [optional] -**[tags](#tags)** | list, tuple, | tuple, | | [optional] -**status** | str, | str, | pet status in the store | [optional] must be one of ["available", "pending", "sold", ] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -# photoUrls - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -list, tuple, | tuple, | | - -### Tuple Items -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -items | str, | str, | | - -# tags - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -list, tuple, | tuple, | | - -### Tuple Items -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[**Tag**](Tag.md) | [**Tag**](Tag.md) | [**Tag**](Tag.md) | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/Pig.md b/samples/openapi3/client/petstore/python/docs/models/Pig.md deleted file mode 100644 index 33a8aca85ea..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/Pig.md +++ /dev/null @@ -1,16 +0,0 @@ -# petstore_api.model.pig.Pig - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### oneOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[BasquePig](BasquePig.md) | [**BasquePig**](BasquePig.md) | [**BasquePig**](BasquePig.md) | | -[DanishPig](DanishPig.md) | [**DanishPig**](DanishPig.md) | [**DanishPig**](DanishPig.md) | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/Player.md b/samples/openapi3/client/petstore/python/docs/models/Player.md deleted file mode 100644 index 98ec6b5d152..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/Player.md +++ /dev/null @@ -1,18 +0,0 @@ -# petstore_api.model.player.Player - -a model that includes a self reference this forces properties and additionalProperties to be lazy loaded in python models because the Player class has not fully loaded when defining properties - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | a model that includes a self reference this forces properties and additionalProperties to be lazy loaded in python models because the Player class has not fully loaded when defining properties | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**name** | str, | str, | | [optional] -**enemyPlayer** | [**Player**](Player.md) | [**Player**](Player.md) | | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/Quadrilateral.md b/samples/openapi3/client/petstore/python/docs/models/Quadrilateral.md deleted file mode 100644 index 55f18627244..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/Quadrilateral.md +++ /dev/null @@ -1,16 +0,0 @@ -# petstore_api.model.quadrilateral.Quadrilateral - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### oneOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[SimpleQuadrilateral](SimpleQuadrilateral.md) | [**SimpleQuadrilateral**](SimpleQuadrilateral.md) | [**SimpleQuadrilateral**](SimpleQuadrilateral.md) | | -[ComplexQuadrilateral](ComplexQuadrilateral.md) | [**ComplexQuadrilateral**](ComplexQuadrilateral.md) | [**ComplexQuadrilateral**](ComplexQuadrilateral.md) | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/QuadrilateralInterface.md b/samples/openapi3/client/petstore/python/docs/models/QuadrilateralInterface.md deleted file mode 100644 index 8344d0ffbaf..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/QuadrilateralInterface.md +++ /dev/null @@ -1,16 +0,0 @@ -# petstore_api.model.quadrilateral_interface.QuadrilateralInterface - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**shapeType** | str, | str, | | must be one of ["Quadrilateral", ] -**quadrilateralType** | str, | str, | | -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/ReadOnlyFirst.md b/samples/openapi3/client/petstore/python/docs/models/ReadOnlyFirst.md deleted file mode 100644 index a8f4053a418..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/ReadOnlyFirst.md +++ /dev/null @@ -1,16 +0,0 @@ -# petstore_api.model.read_only_first.ReadOnlyFirst - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**bar** | str, | str, | | [optional] -**baz** | str, | str, | | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/ScaleneTriangle.md b/samples/openapi3/client/petstore/python/docs/models/ScaleneTriangle.md deleted file mode 100644 index dde662e47e2..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/ScaleneTriangle.md +++ /dev/null @@ -1,29 +0,0 @@ -# petstore_api.model.scalene_triangle.ScaleneTriangle - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### allOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[TriangleInterface](TriangleInterface.md) | [**TriangleInterface**](TriangleInterface.md) | [**TriangleInterface**](TriangleInterface.md) | | -[all_of_1](#all_of_1) | dict, frozendict.frozendict, | frozendict.frozendict, | | - -# all_of_1 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**triangleType** | str, | str, | | [optional] must be one of ["ScaleneTriangle", ] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/Shape.md b/samples/openapi3/client/petstore/python/docs/models/Shape.md deleted file mode 100644 index f8bec209ec2..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/Shape.md +++ /dev/null @@ -1,16 +0,0 @@ -# petstore_api.model.shape.Shape - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### oneOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[Triangle](Triangle.md) | [**Triangle**](Triangle.md) | [**Triangle**](Triangle.md) | | -[Quadrilateral](Quadrilateral.md) | [**Quadrilateral**](Quadrilateral.md) | [**Quadrilateral**](Quadrilateral.md) | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/ShapeOrNull.md b/samples/openapi3/client/petstore/python/docs/models/ShapeOrNull.md deleted file mode 100644 index 908b69e0587..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/ShapeOrNull.md +++ /dev/null @@ -1,26 +0,0 @@ -# petstore_api.model.shape_or_null.ShapeOrNull - -The value may be a shape or the 'null' value. This is introduced in OAS schema >= 3.1. - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | The value may be a shape or the 'null' value. This is introduced in OAS schema >= 3.1. | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### oneOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[one_of_0](#one_of_0) | None, | NoneClass, | | -[Triangle](Triangle.md) | [**Triangle**](Triangle.md) | [**Triangle**](Triangle.md) | | -[Quadrilateral](Quadrilateral.md) | [**Quadrilateral**](Quadrilateral.md) | [**Quadrilateral**](Quadrilateral.md) | | - -# one_of_0 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -None, | NoneClass, | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/SimpleQuadrilateral.md b/samples/openapi3/client/petstore/python/docs/models/SimpleQuadrilateral.md deleted file mode 100644 index 288684f5dcc..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/SimpleQuadrilateral.md +++ /dev/null @@ -1,29 +0,0 @@ -# petstore_api.model.simple_quadrilateral.SimpleQuadrilateral - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### allOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[QuadrilateralInterface](QuadrilateralInterface.md) | [**QuadrilateralInterface**](QuadrilateralInterface.md) | [**QuadrilateralInterface**](QuadrilateralInterface.md) | | -[all_of_1](#all_of_1) | dict, frozendict.frozendict, | frozendict.frozendict, | | - -# all_of_1 - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**quadrilateralType** | str, | str, | | [optional] must be one of ["SimpleQuadrilateral", ] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/SomeObject.md b/samples/openapi3/client/petstore/python/docs/models/SomeObject.md deleted file mode 100644 index 7599329a36d..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/SomeObject.md +++ /dev/null @@ -1,15 +0,0 @@ -# petstore_api.model.some_object.SomeObject - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### allOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[ObjectInterface](ObjectInterface.md) | [**ObjectInterface**](ObjectInterface.md) | [**ObjectInterface**](ObjectInterface.md) | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/SpecialModelName.md b/samples/openapi3/client/petstore/python/docs/models/SpecialModelName.md deleted file mode 100644 index f40d98660aa..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/SpecialModelName.md +++ /dev/null @@ -1,17 +0,0 @@ -# petstore_api.model.special_model_name.SpecialModelName - -model with an invalid class name for python - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | model with an invalid class name for python | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**a** | str, | str, | | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/String.md b/samples/openapi3/client/petstore/python/docs/models/String.md deleted file mode 100644 index 75fc685c2ca..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/String.md +++ /dev/null @@ -1,9 +0,0 @@ -# petstore_api.model.string.String - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/StringBooleanMap.md b/samples/openapi3/client/petstore/python/docs/models/StringBooleanMap.md deleted file mode 100644 index 48f1fe881e2..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/StringBooleanMap.md +++ /dev/null @@ -1,14 +0,0 @@ -# petstore_api.model.string_boolean_map.StringBooleanMap - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**any_string_name** | bool, | BoolClass, | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/StringEnum.md b/samples/openapi3/client/petstore/python/docs/models/StringEnum.md deleted file mode 100644 index 06c26a7a1ac..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/StringEnum.md +++ /dev/null @@ -1,9 +0,0 @@ -# petstore_api.model.string_enum.StringEnum - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -None, str, | NoneClass, str, | | must be one of ["placed", "approved", "delivered", "single quoted", "multiple\nlines", "double quote \n with newline", None, ] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/StringEnumWithDefaultValue.md b/samples/openapi3/client/petstore/python/docs/models/StringEnumWithDefaultValue.md deleted file mode 100644 index 028f1b3733c..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/StringEnumWithDefaultValue.md +++ /dev/null @@ -1,9 +0,0 @@ -# petstore_api.model.string_enum_with_default_value.StringEnumWithDefaultValue - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | must be one of ["placed", "approved", "delivered", ] if omitted the server will use the default value of "placed" - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/StringWithValidation.md b/samples/openapi3/client/petstore/python/docs/models/StringWithValidation.md deleted file mode 100644 index 3effe032b8c..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/StringWithValidation.md +++ /dev/null @@ -1,9 +0,0 @@ -# petstore_api.model.string_with_validation.StringWithValidation - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/Tag.md b/samples/openapi3/client/petstore/python/docs/models/Tag.md deleted file mode 100644 index 7e61a1fffa9..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/Tag.md +++ /dev/null @@ -1,16 +0,0 @@ -# petstore_api.model.tag.Tag - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**id** | decimal.Decimal, int, | decimal.Decimal, | | [optional] value must be a 64 bit integer -**name** | str, | str, | | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/Triangle.md b/samples/openapi3/client/petstore/python/docs/models/Triangle.md deleted file mode 100644 index c89258b99fe..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/Triangle.md +++ /dev/null @@ -1,17 +0,0 @@ -# petstore_api.model.triangle.Triangle - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### oneOf -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[EquilateralTriangle](EquilateralTriangle.md) | [**EquilateralTriangle**](EquilateralTriangle.md) | [**EquilateralTriangle**](EquilateralTriangle.md) | | -[IsoscelesTriangle](IsoscelesTriangle.md) | [**IsoscelesTriangle**](IsoscelesTriangle.md) | [**IsoscelesTriangle**](IsoscelesTriangle.md) | | -[ScaleneTriangle](ScaleneTriangle.md) | [**ScaleneTriangle**](ScaleneTriangle.md) | [**ScaleneTriangle**](ScaleneTriangle.md) | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/TriangleInterface.md b/samples/openapi3/client/petstore/python/docs/models/TriangleInterface.md deleted file mode 100644 index 259594c7880..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/TriangleInterface.md +++ /dev/null @@ -1,16 +0,0 @@ -# petstore_api.model.triangle_interface.TriangleInterface - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**shapeType** | str, | str, | | must be one of ["Triangle", ] -**triangleType** | str, | str, | | -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/UUIDString.md b/samples/openapi3/client/petstore/python/docs/models/UUIDString.md deleted file mode 100644 index 020676d5843..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/UUIDString.md +++ /dev/null @@ -1,9 +0,0 @@ -# petstore_api.model.uuid_string.UUIDString - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, uuid.UUID, | str, | | value must be a uuid - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/User.md b/samples/openapi3/client/petstore/python/docs/models/User.md deleted file mode 100644 index 11da137c640..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/User.md +++ /dev/null @@ -1,67 +0,0 @@ -# petstore_api.model.user.User - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**id** | decimal.Decimal, int, | decimal.Decimal, | | [optional] value must be a 64 bit integer -**username** | str, | str, | | [optional] -**firstName** | str, | str, | | [optional] -**lastName** | str, | str, | | [optional] -**email** | str, | str, | | [optional] -**password** | str, | str, | | [optional] -**phone** | str, | str, | | [optional] -**userStatus** | decimal.Decimal, int, | decimal.Decimal, | User Status | [optional] value must be a 32 bit integer -**[objectWithNoDeclaredProps](#objectWithNoDeclaredProps)** | dict, frozendict.frozendict, | frozendict.frozendict, | test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. | [optional] -**[objectWithNoDeclaredPropsNullable](#objectWithNoDeclaredPropsNullable)** | dict, frozendict.frozendict, None, | frozendict.frozendict, NoneClass, | test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. | [optional] -**anyTypeProp** | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 | [optional] -**[anyTypeExceptNullProp](#anyTypeExceptNullProp)** | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | any type except 'null' Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. | [optional] -**anyTypePropNullable** | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values. | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -# objectWithNoDeclaredProps - -test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. | - -# objectWithNoDeclaredPropsNullable - -test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, None, | frozendict.frozendict, NoneClass, | test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. | - -# anyTypeExceptNullProp - -any type except 'null' Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | any type except 'null' Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. | - -### Composed Schemas (allOf/anyOf/oneOf/not) -#### not -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[not_schema](#not_schema) | None, | NoneClass, | | - -# not_schema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -None, | NoneClass, | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/Whale.md b/samples/openapi3/client/petstore/python/docs/models/Whale.md deleted file mode 100644 index bd92a1048d4..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/Whale.md +++ /dev/null @@ -1,17 +0,0 @@ -# petstore_api.model.whale.Whale - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**className** | str, | str, | | must be one of ["whale", ] -**hasBaleen** | bool, | BoolClass, | | [optional] -**hasTeeth** | bool, | BoolClass, | | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/models/Zebra.md b/samples/openapi3/client/petstore/python/docs/models/Zebra.md deleted file mode 100644 index c710364ef8c..00000000000 --- a/samples/openapi3/client/petstore/python/docs/models/Zebra.md +++ /dev/null @@ -1,16 +0,0 @@ -# petstore_api.model.zebra.Zebra - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**className** | str, | str, | | must be one of ["zebra", ] -**type** | str, | str, | | [optional] must be one of ["plains", "mountain", "grevys", ] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/python/docs/paths/another_fake_dummy/patch.md b/samples/openapi3/client/petstore/python/docs/paths/another_fake_dummy/patch.md new file mode 100644 index 00000000000..b623ba50fd8 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/paths/another_fake_dummy/patch.md @@ -0,0 +1,113 @@ +petstore_api.paths.another_fake_dummy.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| call_123_test__special_tags | [AnotherFakeApi](../../apis/tags/another_fake_api.md) | This api is only for tag=$another-fake? | +| patch | ApiForPatch | This api is only for this endpoint | +| patch | AnotherFakeDummy | This api is only for path=/another-fake/dummy | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Summary | To test special tags | +| Description | To test special tags and operation ID starting with number | +| Path | "/another-fake/dummy" | +| HTTP Method | patch | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[**body**](../../components/request_bodies/request_body_client.md) | typing.Union[[Client.content.application_json.schema](../../components/request_bodies/request_body_client.md#content-applicationjson-schema), dict, frozendict.frozendict] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | successful operation + +## ResponseFor200 + +### Description +successful operation + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[Client](../../components/schema/client.md) | dict, frozendict.frozendict | frozendict.frozendict | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://petstore.swagger.io:80/v2 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | petstore server +1 | [Server1](../../../servers/server_1.md) | The local server +2 | [Server2](../../../servers/server_2.md) | staging server with no variables + +## Code Sample + +```python +import petstore_api +from petstore_api.configurations import api_configuration +from petstore_api.apis.tags import another_fake_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = another_fake_api.AnotherFakeApi(api_client) + + # example passing only required values which don't have defaults set + body = client.Client( + client="client_example", + ) + try: + # To test special tags + api_response = api_instance.call_123_test__special_tags( + body=body, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling AnotherFakeApi->call_123_test__special_tags: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to AnotherFakeApi API]](../../apis/tags/another_fake_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/docs/paths/fake/delete.md b/samples/openapi3/client/petstore/python/docs/paths/fake/delete.md new file mode 100644 index 00000000000..a7640f36abe --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/paths/fake/delete.md @@ -0,0 +1,234 @@ +petstore_api.paths.fake.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| group_parameters | [FakeApi](../../apis/tags/fake_api.md) | This api is only for tag=fake | +| delete | ApiForDelete | This api is only for this endpoint | +| delete | Fake | This api is only for path=/fake | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Security](#security) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Summary | Fake endpoint to test group parameters (optional) | +| Description | Fake endpoint to test group parameters (optional) | +| Path | "/fake" | +| HTTP Method | delete | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[query_params](#query_params) | [RequestQueryParameters.Params](#requestqueryparametersparams), dict | | +[header_params](#header_params) | [RequestHeaderParameters.Params](#requestheaderparametersparams), dict | | +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### query_params +#### RequestQueryParameters.Params +This is a TypedDict + +Key | Input Type | Description | Notes +------------- | ------------- | ------------- | ------------- +required_string_group | [Parameter0.schema](#parameter0-schema), str | | +required_int64_group | [Parameter2.schema](#parameter2-schema), decimal.Decimal, int | | +string_group | [Parameter3.schema](#parameter3-schema), str | | optional +int64_group | [Parameter5.schema](#parameter5-schema), decimal.Decimal, int | | optional + + +#### Parameter0 + +##### Description +Required String in group parameters + +##### Parameter0 Schema + +###### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str | str | | + +#### Parameter2 + +##### Description +Required Integer in group parameters + +##### Parameter2 Schema + +###### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +decimal.Decimal, int | decimal.Decimal | | value must be a 64 bit integer + +#### Parameter3 + +##### Description +String in group parameters + +##### Parameter3 Schema + +###### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str | str | | + +#### Parameter5 + +##### Description +Integer in group parameters + +##### Parameter5 Schema + +###### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +decimal.Decimal, int | decimal.Decimal | | value must be a 64 bit integer + +### header_params +#### RequestHeaderParameters.Params +This is a TypedDict + +Key | Input Type | Description | Notes +------------- | ------------- | ------------- | ------------- +required_boolean_group | [Parameter1.schema](#parameter1-schema), str | | +boolean_group | [Parameter4.schema](#parameter4-schema), str | | optional + + +#### Parameter1 + +##### Description +Required Boolean in group parameters + +##### Parameter1 Schema + +###### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str | str | | must be one of ["true", "false"] + +#### Parameter4 + +##### Description +Boolean in group parameters + +##### Parameter4 Schema + +###### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str | str | | must be one of ["true", "false"] + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [SuccessDescriptionOnly.response_cls](../../components/responses/response_success_description_only.md#response_success_description_onlyresponse_cls) | Success + +## Security + +Set auth info by setting ApiConfiguration.security_scheme_info to a dict where the +key is the below security scheme quoted name, and the value is an instance of the linked +component security scheme class. +Select the security index by setting ApiConfiguration.security_index_info or by +passing in security_index into the endpoint method. +See how to do this in the code sample. +- these securities are specific to this to this endpoint + +| Security Index | Security Scheme to Scope Names | +| -------------- | ------------------------------ | +| 0 | ["bearer_test"](../../components/security_schemes/security_scheme_bearer_test.md) []
    | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://petstore.swagger.io:80/v2 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | petstore server +1 | [Server1](../../../servers/server_1.md) | The local server +2 | [Server2](../../../servers/server_2.md) | staging server with no variables + +## Code Sample + +```python +import petstore_api +from petstore_api.configurations import api_configuration +from petstore_api.apis.tags import fake_api +from petstore_api.paths.fake.delete import operation +from pprint import pprint +# security_index 0 +from petstore_api.components.security_schemes import security_scheme_bearer_test + +# security_scheme_info for security_index 0 +security_scheme_info: api_configuration.SecuritySchemeInfo = { + "bearer_test": security_scheme_bearer_test.BearerTest( + access_token='someAccessToken' + ), +} + +used_configuration = api_configuration.ApiConfiguration( + security_scheme_info=security_scheme_info +) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = fake_api.FakeApi(api_client) + + # example passing only required values which don't have defaults set + query_params: operation.RequestQueryParameters.Params = { + 'required_string_group': "required_string_group_example", + 'required_int64_group': 1, + } + header_params: operation.RequestHeaderParameters.Params = { + 'required_boolean_group': "true", + } + try: + # Fake endpoint to test group parameters (optional) + api_response = api_instance.group_parameters( + query_params=query_params, + header_params=header_params, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->group_parameters: %s\n" % e) + + # example passing only optional values + query_params: operation.RequestQueryParameters.Params = { + 'required_string_group': "required_string_group_example", + 'required_int64_group': 1, + 'string_group': "string_group_example", + 'int64_group': 1, + } + header_params: operation.RequestHeaderParameters.Params = { + 'required_boolean_group': "true", + 'boolean_group': "true", + } + try: + # Fake endpoint to test group parameters (optional) + api_response = api_instance.group_parameters( + query_params=query_params, + header_params=header_params, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->group_parameters: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to FakeApi API]](../../apis/tags/fake_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/docs/paths/fake/get.md b/samples/openapi3/client/petstore/python/docs/paths/fake/get.md new file mode 100644 index 00000000000..277d5f45275 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/paths/fake/get.md @@ -0,0 +1,276 @@ +petstore_api.paths.fake.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| enum_parameters | [FakeApi](../../apis/tags/fake_api.md) | This api is only for tag=fake | +| get | ApiForGet | This api is only for this endpoint | +| get | Fake | This api is only for path=/fake | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Summary | To test enum parameters | +| Description | To test enum parameters | +| Path | "/fake" | +| HTTP Method | get | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_x_www_form_urlencoded.schema](#RequestBody-content-applicationxwwwformurlencoded-schema), Unset, dict, frozendict.frozendict] | optional, default is unset | +[query_params](#query_params) | [RequestQueryParameters.Params](#requestqueryparametersparams), dict | | +[header_params](#header_params) | [RequestHeaderParameters.Params](#requestheaderparametersparams), dict | | +content_type | str | optional, default is 'application/x-www-form-urlencoded' | Selects the schema and serialization of the request body +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/x-www-form-urlencoded" | [content.application_x_www_form_urlencoded.Schema](#requestbody-content-applicationxwwwformurlencoded-schema) + +#### RequestBody content ApplicationXWwwFormUrlencoded Schema + +##### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +##### Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**enum_form_string_array** | list, tuple | [properties.EnumFormStringArray](#requestbody-content-applicationxwwwformurlencoded-schema-properties-enumformstringarray) | Form parameter enum test (string array) | [optional] +**enum_form_string** | str | str | Form parameter enum test (string) | [optional] must be one of ["_abc", "-efg", "(xyz)"] if omitted the server will use the default value of -efg +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +#### RequestBody content ApplicationXWwwFormUrlencoded Schema properties EnumFormStringArray + +##### Description +Form parameter enum test (string array) + +##### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +list, tuple | tuple | Form parameter enum test (string array) | + +##### List Items +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +items | str | str | | must be one of [">", "$"] if omitted the server will use the default value of $ + +### query_params +#### RequestQueryParameters.Params +This is a TypedDict + +Key | Input Type | Description | Notes +------------- | ------------- | ------------- | ------------- +enum_query_string_array | [Parameter2.schema](#parameter2-schema), list, tuple | | optional +enum_query_string | [Parameter3.schema](#parameter3-schema), str | | optional +enum_query_integer | [Parameter4.schema](#parameter4-schema), decimal.Decimal, int | | optional +enum_query_double | [Parameter5.schema](#parameter5-schema), decimal.Decimal, int, float | | optional + + +#### Parameter2 + +##### Description +Query parameter enum test (string array) + +##### Parameter2 Schema + +###### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +list, tuple | tuple | | + +###### List Items +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +items | str | str | | must be one of [">", "$"] if omitted the server will use the default value of $ + +#### Parameter3 + +##### Description +Query parameter enum test (string) + +##### Parameter3 Schema + +###### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str | str | | must be one of ["_abc", "-efg", "(xyz)"] if omitted the server will use the default value of -efg + +#### Parameter4 + +##### Description +Query parameter enum test (double) + +##### Parameter4 Schema + +###### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +decimal.Decimal, int | decimal.Decimal | | must be one of [1, -2] value must be a 32 bit integer + +#### Parameter5 + +##### Description +Query parameter enum test (double) + +##### Parameter5 Schema + +###### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +decimal.Decimal, int, float | decimal.Decimal | | must be one of [1.1, -1.2] value must be a 64 bit float + +### header_params +#### RequestHeaderParameters.Params +This is a TypedDict + +Key | Input Type | Description | Notes +------------- | ------------- | ------------- | ------------- +enum_header_string_array | [Parameter0.schema](#parameter0-schema), list, tuple | | optional +enum_header_string | [Parameter1.schema](#parameter1-schema), str | | optional + + +#### Parameter0 + +##### Description +Header parameter enum test (string array) + +##### Parameter0 Schema + +###### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +list, tuple | tuple | | + +###### List Items +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +items | str | str | | must be one of [">", "$"] if omitted the server will use the default value of $ + +#### Parameter1 + +##### Description +Header parameter enum test (string) + +##### Parameter1 Schema + +###### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str | str | | must be one of ["_abc", "-efg", "(xyz)"] if omitted the server will use the default value of -efg + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [SuccessDescriptionOnly.response_cls](../../components/responses/response_success_description_only.md#response_success_description_onlyresponse_cls) | Success +404 | [ResponseFor404.response_cls](#responsefor404-response_cls) | Not found + +## ResponseFor404 + +### Description +Not found + +### ResponseFor404 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor404-body) | [content.application_json.schema](#responsefor404-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor404 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor404-content-applicationjson-schema) + +### Body Details +#### ResponseFor404 content ApplicationJson Schema + +##### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://petstore.swagger.io:80/v2 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | petstore server +1 | [Server1](../../../servers/server_1.md) | The local server +2 | [Server2](../../../servers/server_2.md) | staging server with no variables + +## Code Sample + +```python +import petstore_api +from petstore_api.configurations import api_configuration +from petstore_api.apis.tags import fake_api +from petstore_api.paths.fake.get import operation +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = fake_api.FakeApi(api_client) + + # example passing only optional values + query_params: operation.RequestQueryParameters.Params = { + 'enum_query_string_array': [ + "$" + ], + 'enum_query_string': "-efg", + 'enum_query_integer': 1, + 'enum_query_double': 1.1, + } + header_params: operation.RequestHeaderParameters.Params = { + 'enum_header_string_array': [ + "$" + ], + 'enum_header_string': "-efg", + } + body = dict( + enum_form_string_array=[ + "$" + ], + enum_form_string="-efg", + ) + try: + # To test enum parameters + api_response = api_instance.enum_parameters( + query_params=query_params, + header_params=header_params, + body=body, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->enum_parameters: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to FakeApi API]](../../apis/tags/fake_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/docs/paths/fake/patch.md b/samples/openapi3/client/petstore/python/docs/paths/fake/patch.md new file mode 100644 index 00000000000..ca973ba30ee --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/paths/fake/patch.md @@ -0,0 +1,113 @@ +petstore_api.paths.fake.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| client_model | [FakeApi](../../apis/tags/fake_api.md) | This api is only for tag=fake | +| patch | ApiForPatch | This api is only for this endpoint | +| patch | Fake | This api is only for path=/fake | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Summary | To test \"client\" model | +| Description | To test \"client\" model | +| Path | "/fake" | +| HTTP Method | patch | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[**body**](../../components/request_bodies/request_body_client.md) | typing.Union[[Client.content.application_json.schema](../../components/request_bodies/request_body_client.md#content-applicationjson-schema), dict, frozendict.frozendict] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | successful operation + +## ResponseFor200 + +### Description +successful operation + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[Client](../../components/schema/client.md) | dict, frozendict.frozendict | frozendict.frozendict | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://petstore.swagger.io:80/v2 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | petstore server +1 | [Server1](../../../servers/server_1.md) | The local server +2 | [Server2](../../../servers/server_2.md) | staging server with no variables + +## Code Sample + +```python +import petstore_api +from petstore_api.configurations import api_configuration +from petstore_api.apis.tags import fake_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = fake_api.FakeApi(api_client) + + # example passing only required values which don't have defaults set + body = client.Client( + client="client_example", + ) + try: + # To test \"client\" model + api_response = api_instance.client_model( + body=body, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->client_model: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to FakeApi API]](../../apis/tags/fake_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/docs/paths/fake/post.md b/samples/openapi3/client/petstore/python/docs/paths/fake/post.md new file mode 100644 index 00000000000..b6bedb14c61 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/paths/fake/post.md @@ -0,0 +1,173 @@ +petstore_api.paths.fake.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| endpoint_parameters | [FakeApi](../../apis/tags/fake_api.md) | This api is only for tag=fake | +| post | ApiForPost | This api is only for this endpoint | +| post | Fake | This api is only for path=/fake | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Security](#security) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Summary | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 | +| Description | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 | +| Path | "/fake" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_x_www_form_urlencoded.schema](#RequestBody-content-applicationxwwwformurlencoded-schema), Unset, dict, frozendict.frozendict] | optional, default is unset | +content_type | str | optional, default is 'application/x-www-form-urlencoded' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/x-www-form-urlencoded" | [content.application_x_www_form_urlencoded.Schema](#requestbody-content-applicationxwwwformurlencoded-schema) + +#### RequestBody content ApplicationXWwwFormUrlencoded Schema + +##### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +##### Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**byte** | str | str | None | +**double** | decimal.Decimal, int, float | decimal.Decimal | None | value must be a 64 bit float +**number** | decimal.Decimal, int, float | decimal.Decimal | None | +**pattern_without_delimiter** | str | str | None | +**integer** | decimal.Decimal, int | decimal.Decimal | None | [optional] +**int32** | decimal.Decimal, int | decimal.Decimal | None | [optional] value must be a 32 bit integer +**int64** | decimal.Decimal, int | decimal.Decimal | None | [optional] value must be a 64 bit integer +**float** | decimal.Decimal, int, float | decimal.Decimal | None | [optional] value must be a 32 bit float +**string** | str | str | None | [optional] +**binary** | bytes, io.FileIO, io.BufferedReader | bytes, io.FileIO | None | [optional] +**date** | str, datetime.date | str | None | [optional] value must conform to RFC-3339 full-date YYYY-MM-DD +**dateTime** | str, datetime.datetime | str | None | [optional] if omitted the server will use the default value of 2010-02-01T10:20:10.111110+01:00 value must conform to RFC-3339 date-time +**password** | str | str | None | [optional] +**callback** | str | str | None | [optional] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [SuccessDescriptionOnly.response_cls](../../components/responses/response_success_description_only.md#response_success_description_onlyresponse_cls) | Success +404 | [ResponseFor404.response_cls](#responsefor404-response_cls) | User not found + +## ResponseFor404 + +### Description +User not found + +### ResponseFor404 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Security + +Set auth info by setting ApiConfiguration.security_scheme_info to a dict where the +key is the below security scheme quoted name, and the value is an instance of the linked +component security scheme class. +Select the security index by setting ApiConfiguration.security_index_info or by +passing in security_index into the endpoint method. +See how to do this in the code sample. +- these securities are specific to this to this endpoint + +| Security Index | Security Scheme to Scope Names | +| -------------- | ------------------------------ | +| 0 | ["http_basic_test"](../../components/security_schemes/security_scheme_http_basic_test.md) []
    | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://petstore.swagger.io:80/v2 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | petstore server +1 | [Server1](../../../servers/server_1.md) | The local server +2 | [Server2](../../../servers/server_2.md) | staging server with no variables + +## Code Sample + +```python +import petstore_api +from petstore_api.configurations import api_configuration +from petstore_api.apis.tags import fake_api +from pprint import pprint +# security_index 0 +from petstore_api.components.security_schemes import security_scheme_http_basic_test + +# security_scheme_info for security_index 0 +security_scheme_info: api_configuration.SecuritySchemeInfo = { + "http_basic_test": security_scheme_http_basic_test.HttpBasicTest( + user_id='someUserIdOrName', + password='somePassword', + ), +} + +used_configuration = api_configuration.ApiConfiguration( + security_scheme_info=security_scheme_info +) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = fake_api.FakeApi(api_client) + + # example passing only optional values + body = dict( + integer=10, + int32=20, + int64=1, + number=32.1, + _float=3.14, + double=67.8, + string="A", + pattern_without_delimiter="AUR,rZ#UM/?R,Fp^l6$ARjbhJk C>", + byte='YQ==', + binary=open('/path/to/file', 'rb'), + date="1970-01-01", + date_time="2020-02-02T20:20:20.222220Z", + password="password_example", + callback="callback_example", + ) + try: + # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + api_response = api_instance.endpoint_parameters( + body=body, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->endpoint_parameters: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to FakeApi API]](../../apis/tags/fake_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/docs/paths/fake_additional_properties_with_array_of_enums/get.md b/samples/openapi3/client/petstore/python/docs/paths/fake_additional_properties_with_array_of_enums/get.md new file mode 100644 index 00000000000..24baaae5f43 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/paths/fake_additional_properties_with_array_of_enums/get.md @@ -0,0 +1,131 @@ +petstore_api.paths.fake_additional_properties_with_array_of_enums.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| additional_properties_with_array_of_enums | [FakeApi](../../apis/tags/fake_api.md) | This api is only for tag=fake | +| get | ApiForGet | This api is only for this endpoint | +| get | FakeAdditionalPropertiesWithArrayOfEnums | This api is only for path=/fake/additional-properties-with-array-of-enums | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Summary | Additional Properties with Array of Enums | +| Path | "/fake/additional-properties-with-array-of-enums" | +| HTTP Method | get | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), Unset, dict, frozendict.frozendict] | optional, default is unset | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Description +Input enum + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[AdditionalPropertiesWithArrayOfEnums](../../components/schema/additional_properties_with_array_of_enums.md) | dict, frozendict.frozendict | frozendict.frozendict | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | Got object with additional properties with array of enums + +## ResponseFor200 + +### Description +Got object with additional properties with array of enums + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[AdditionalPropertiesWithArrayOfEnums](../../components/schema/additional_properties_with_array_of_enums.md) | dict, frozendict.frozendict | frozendict.frozendict | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://petstore.swagger.io:80/v2 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | petstore server +1 | [Server1](../../../servers/server_1.md) | The local server +2 | [Server2](../../../servers/server_2.md) | staging server with no variables + +## Code Sample + +```python +import petstore_api +from petstore_api.configurations import api_configuration +from petstore_api.apis.tags import fake_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = fake_api.FakeApi(api_client) + + # example passing only optional values + body = additional_properties_with_array_of_enums.AdditionalPropertiesWithArrayOfEnums( + key=[ + enum_class.EnumClass("-efg") + ], + ) + try: + # Additional Properties with Array of Enums + api_response = api_instance.additional_properties_with_array_of_enums( + body=body, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->additional_properties_with_array_of_enums: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to FakeApi API]](../../apis/tags/fake_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/docs/paths/fake_body_with_file_schema/put.md b/samples/openapi3/client/petstore/python/docs/paths/fake_body_with_file_schema/put.md new file mode 100644 index 00000000000..3e7d1a25613 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/paths/fake_body_with_file_schema/put.md @@ -0,0 +1,104 @@ +petstore_api.paths.fake_body_with_file_schema.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| body_with_file_schema | [FakeApi](../../apis/tags/fake_api.md) | This api is only for tag=fake | +| put | ApiForPut | This api is only for this endpoint | +| put | FakeBodyWithFileSchema | This api is only for path=/fake/body-with-file-schema | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Description | For this test, the body for this request much reference a schema named `File`. | +| Path | "/fake/body-with-file-schema" | +| HTTP Method | put | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[FileSchemaTestClass](../../components/schema/file_schema_test_class.md) | dict, frozendict.frozendict | frozendict.frozendict | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [SuccessDescriptionOnly.response_cls](../../components/responses/response_success_description_only.md#response_success_description_onlyresponse_cls) | Success + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://petstore.swagger.io:80/v2 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | petstore server +1 | [Server1](../../../servers/server_1.md) | The local server +2 | [Server2](../../../servers/server_2.md) | staging server with no variables + +## Code Sample + +```python +import petstore_api +from petstore_api.configurations import api_configuration +from petstore_api.apis.tags import fake_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = fake_api.FakeApi(api_client) + + # example passing only required values which don't have defaults set + body = file_schema_test_class.FileSchemaTestClass( + file=file.File( + source_uri="source_uri_example", + ), + files=[ + file.File() + ], + ) + try: + api_response = api_instance.body_with_file_schema( + body=body, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->body_with_file_schema: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to FakeApi API]](../../apis/tags/fake_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/docs/paths/fake_body_with_query_params/put.md b/samples/openapi3/client/petstore/python/docs/paths/fake_body_with_query_params/put.md new file mode 100644 index 00000000000..3c608e29f79 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/paths/fake_body_with_query_params/put.md @@ -0,0 +1,134 @@ +petstore_api.paths.fake_body_with_query_params.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| body_with_query_params | [FakeApi](../../apis/tags/fake_api.md) | This api is only for tag=fake | +| put | ApiForPut | This api is only for this endpoint | +| put | FakeBodyWithQueryParams | This api is only for path=/fake/body-with-query-params | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/fake/body-with-query-params" | +| HTTP Method | put | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict] | required | +[query_params](#query_params) | [RequestQueryParameters.Params](#requestqueryparametersparams), dict | | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[User](../../components/schema/user.md) | dict, frozendict.frozendict | frozendict.frozendict | + +### query_params +#### RequestQueryParameters.Params +This is a TypedDict + +Key | Input Type | Description | Notes +------------- | ------------- | ------------- | ------------- +query | [Parameter0.schema](#parameter0-schema), str | | + + +#### Parameter0 + +##### Parameter0 Schema + +###### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str | str | | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [SuccessDescriptionOnly.response_cls](../../components/responses/response_success_description_only.md#response_success_description_onlyresponse_cls) | Success + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://petstore.swagger.io:80/v2 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | petstore server +1 | [Server1](../../../servers/server_1.md) | The local server +2 | [Server2](../../../servers/server_2.md) | staging server with no variables + +## Code Sample + +```python +import petstore_api +from petstore_api.configurations import api_configuration +from petstore_api.apis.tags import fake_api +from petstore_api.paths.fake_body_with_query_params.put import operation +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = fake_api.FakeApi(api_client) + + # example passing only required values which don't have defaults set + query_params: operation.RequestQueryParameters.Params = { + 'query': "query_example", + } + body = user.User( + id=1, + username="username_example", + first_name="first_name_example", + last_name="last_name_example", + email="email_example", + password="password_example", + phone="phone_example", + user_status=1, + object_with_no_declared_props=dict(), + object_with_no_declared_props_nullable=dict(), + any_type_prop=None, + any_type_except_null_prop=None, + any_type_prop_nullable=None, + ) + try: + api_response = api_instance.body_with_query_params( + query_params=query_params, + body=body, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->body_with_query_params: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to FakeApi API]](../../apis/tags/fake_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/docs/paths/fake_case_sensitive_params/put.md b/samples/openapi3/client/petstore/python/docs/paths/fake_case_sensitive_params/put.md new file mode 100644 index 00000000000..57c5148cb4d --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/paths/fake_case_sensitive_params/put.md @@ -0,0 +1,125 @@ +petstore_api.paths.fake_case_sensitive_params.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| case_sensitive_params | [FakeApi](../../apis/tags/fake_api.md) | This api is only for tag=fake | +| put | ApiForPut | This api is only for this endpoint | +| put | FakeCaseSensitiveParams | This api is only for path=/fake/case-sensitive-params | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Description | Ensures that original naming is used in endpoint params, that way we on't have collisions | +| Path | "/fake/case-sensitive-params" | +| HTTP Method | put | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[query_params](#query_params) | [RequestQueryParameters.Params](#requestqueryparametersparams), dict | | +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### query_params +#### RequestQueryParameters.Params +This is a TypedDict + +Key | Input Type | Description | Notes +------------- | ------------- | ------------- | ------------- +someVar | [Parameter0.schema](#parameter0-schema), str | | +SomeVar | [Parameter1.schema](#parameter1-schema), str | | +some_var | [Parameter2.schema](#parameter2-schema), str | | + + +#### Parameter0 + +##### Parameter0 Schema + +###### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str | str | | + +#### Parameter1 + +##### Parameter1 Schema + +###### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str | str | | + +#### Parameter2 + +##### Parameter2 Schema + +###### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str | str | | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [SuccessDescriptionOnly.response_cls](../../components/responses/response_success_description_only.md#response_success_description_onlyresponse_cls) | Success + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://petstore.swagger.io:80/v2 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | petstore server +1 | [Server1](../../../servers/server_1.md) | The local server +2 | [Server2](../../../servers/server_2.md) | staging server with no variables + +## Code Sample + +```python +import petstore_api +from petstore_api.configurations import api_configuration +from petstore_api.apis.tags import fake_api +from petstore_api.paths.fake_case_sensitive_params.put import operation +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = fake_api.FakeApi(api_client) + + # example passing only required values which don't have defaults set + query_params: operation.RequestQueryParameters.Params = { + 'someVar': "someVar_example", + 'SomeVar': "SomeVar_example", + 'some_var': "some_var_example", + } + try: + api_response = api_instance.case_sensitive_params( + query_params=query_params, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->case_sensitive_params: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to FakeApi API]](../../apis/tags/fake_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/docs/paths/fake_classname_test/patch.md b/samples/openapi3/client/petstore/python/docs/paths/fake_classname_test/patch.md new file mode 100644 index 00000000000..d3a64c8d3ef --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/paths/fake_classname_test/patch.md @@ -0,0 +1,139 @@ +petstore_api.paths.fake_classname_test.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| classname | [FakeClassnameTags123Api](../../apis/tags/fake_classname_tags123_api.md) | This api is only for tag=fake_classname_tags 123#$%^ | +| patch | ApiForPatch | This api is only for this endpoint | +| patch | FakeClassnameTest | This api is only for path=/fake_classname_test | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Security](#security) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Summary | To test class name in snake case | +| Description | To test class name in snake case | +| Path | "/fake_classname_test" | +| HTTP Method | patch | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[**body**](../../components/request_bodies/request_body_client.md) | typing.Union[[Client.content.application_json.schema](../../components/request_bodies/request_body_client.md#content-applicationjson-schema), dict, frozendict.frozendict] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | successful operation + +## ResponseFor200 + +### Description +successful operation + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[Client](../../components/schema/client.md) | dict, frozendict.frozendict | frozendict.frozendict | + +## Security + +Set auth info by setting ApiConfiguration.security_scheme_info to a dict where the +key is the below security scheme quoted name, and the value is an instance of the linked +component security scheme class. +Select the security index by setting ApiConfiguration.security_index_info or by +passing in security_index into the endpoint method. +See how to do this in the code sample. +- these securities are specific to this to this endpoint + +| Security Index | Security Scheme to Scope Names | +| -------------- | ------------------------------ | +| 0 | ["api_key_query"](../../components/security_schemes/security_scheme_api_key_query.md) []
    | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://petstore.swagger.io:80/v2 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | petstore server +1 | [Server1](../../../servers/server_1.md) | The local server +2 | [Server2](../../../servers/server_2.md) | staging server with no variables + +## Code Sample + +```python +import petstore_api +from petstore_api.configurations import api_configuration +from petstore_api.apis.tags import fake_classname_tags123_api +from pprint import pprint +# security_index 0 +from petstore_api.components.security_schemes import security_scheme_api_key_query + +# security_scheme_info for security_index 0 +security_scheme_info: api_configuration.SecuritySchemeInfo = { + "api_key_query": security_scheme_api_key_query.ApiKeyQuery( + api_key='sampleApiKeyValue' + ), +} + +used_configuration = api_configuration.ApiConfiguration( + security_scheme_info=security_scheme_info +) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = fake_classname_tags123_api.FakeClassnameTags123Api(api_client) + + # example passing only required values which don't have defaults set + body = client.Client( + client="client_example", + ) + try: + # To test class name in snake case + api_response = api_instance.classname( + body=body, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeClassnameTags123Api->classname: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to FakeClassnameTags123Api API]](../../apis/tags/fake_classname_tags123_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/docs/paths/fake_delete_coffee_id/delete.md b/samples/openapi3/client/petstore/python/docs/paths/fake_delete_coffee_id/delete.md new file mode 100644 index 00000000000..62d32bc4cca --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/paths/fake_delete_coffee_id/delete.md @@ -0,0 +1,121 @@ +petstore_api.paths.fake_delete_coffee_id.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| delete_coffee | [FakeApi](../../apis/tags/fake_api.md) | This api is only for tag=fake | +| delete | ApiForDelete | This api is only for this endpoint | +| delete | FakeDeleteCoffeeId | This api is only for path=/fake/deleteCoffee/{id} | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Summary | Delete coffee | +| Description | Delete the coffee identified by the given id, (delete without request body) | +| Path | "/fake/deleteCoffee/{id}" | +| HTTP Method | delete | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[path_params](#path_params) | [RequestPathParameters.Params](#requestpathparametersparams), dict | | +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### path_params +#### RequestPathParameters.Params +This is a TypedDict + +Key | Input Type | Description | Notes +------------- | ------------- | ------------- | ------------- +id | [Parameter0.schema](#parameter0-schema), str | | + + +#### Parameter0 + +##### Description +The internal object id + +##### Parameter0 Schema + +###### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str | str | | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +default | [Default.response_cls](#default-response_cls) | Unexpected error +200 | [SuccessDescriptionOnly.response_cls](../../components/responses/response_success_description_only.md#response_success_description_onlyresponse_cls) | Success + +## Default + +### Description +Unexpected error + +### Default response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://petstore.swagger.io:80/v2 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | petstore server +1 | [Server1](../../../servers/server_1.md) | The local server +2 | [Server2](../../../servers/server_2.md) | staging server with no variables + +## Code Sample + +```python +import petstore_api +from petstore_api.configurations import api_configuration +from petstore_api.apis.tags import fake_api +from petstore_api.paths.fake_delete_coffee_id.delete import operation +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = fake_api.FakeApi(api_client) + + # example passing only required values which don't have defaults set + path_params: operation.RequestPathParameters.Params = { + 'id': "id_example", + } + try: + # Delete coffee + api_response = api_instance.delete_coffee( + path_params=path_params, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->delete_coffee: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to FakeApi API]](../../apis/tags/fake_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/docs/paths/fake_health/get.md b/samples/openapi3/client/petstore/python/docs/paths/fake_health/get.md new file mode 100644 index 00000000000..d30de68da64 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/paths/fake_health/get.md @@ -0,0 +1,105 @@ +petstore_api.paths.fake_health.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| fake_health_get | [FakeApi](../../apis/tags/fake_api.md) | This api is only for tag=fake | +| get | ApiForGet | This api is only for this endpoint | +| get | FakeHealth | This api is only for path=/fake/health | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Summary | Health check endpoint | +| Path | "/fake/health" | +| HTTP Method | get | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | The instance started successfully + +## ResponseFor200 + +### Description +The instance started successfully + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[HealthCheckResult](../../components/schema/health_check_result.md) | dict, frozendict.frozendict | frozendict.frozendict | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://petstore.swagger.io:80/v2 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | petstore server +1 | [Server1](../../../servers/server_1.md) | The local server +2 | [Server2](../../../servers/server_2.md) | staging server with no variables + +## Code Sample + +```python +import petstore_api +from petstore_api.configurations import api_configuration +from petstore_api.apis.tags import fake_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = fake_api.FakeApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + # Health check endpoint + api_response = api_instance.fake_health_get() + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->fake_health_get: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to FakeApi API]](../../apis/tags/fake_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/docs/paths/fake_inline_additional_properties/post.md b/samples/openapi3/client/petstore/python/docs/paths/fake_inline_additional_properties/post.md new file mode 100644 index 00000000000..a9afc5f8187 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/paths/fake_inline_additional_properties/post.md @@ -0,0 +1,108 @@ +petstore_api.paths.fake_inline_additional_properties.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| inline_additional_properties | [FakeApi](../../apis/tags/fake_api.md) | This api is only for tag=fake | +| post | ApiForPost | This api is only for this endpoint | +| post | FakeInlineAdditionalProperties | This api is only for path=/fake/inline-additionalProperties | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Summary | test inline additionalProperties | +| Path | "/fake/inline-additionalProperties" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Description +request body + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +##### Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**any_string_name** | str | str | any string name can be used but the value must be the correct type | [optional] + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [SuccessDescriptionOnly.response_cls](../../components/responses/response_success_description_only.md#response_success_description_onlyresponse_cls) | Success + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://petstore.swagger.io:80/v2 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | petstore server +1 | [Server1](../../../servers/server_1.md) | The local server +2 | [Server2](../../../servers/server_2.md) | staging server with no variables + +## Code Sample + +```python +import petstore_api +from petstore_api.configurations import api_configuration +from petstore_api.apis.tags import fake_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = fake_api.FakeApi(api_client) + + # example passing only required values which don't have defaults set + body = dict( + "key": "key_example", + ) + try: + # test inline additionalProperties + api_response = api_instance.inline_additional_properties( + body=body, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->inline_additional_properties: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to FakeApi API]](../../apis/tags/fake_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/docs/paths/fake_inline_composition/post.md b/samples/openapi3/client/petstore/python/docs/paths/fake_inline_composition/post.md new file mode 100644 index 00000000000..7393154a317 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/paths/fake_inline_composition/post.md @@ -0,0 +1,296 @@ +petstore_api.paths.fake_inline_composition.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| inline_composition | [FakeApi](../../apis/tags/fake_api.md) | This api is only for tag=fake | +| post | ApiForPost | This api is only for this endpoint | +| post | FakeInlineComposition | This api is only for path=/fake/inlineComposition/ | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Summary | testing composed schemas at inline locations | +| Description | composed schemas at inline locations + multiple requestBody content types | +| Path | "/fake/inlineComposition/" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), [RequestBody.content.multipart_form_data.schema](#RequestBody-content-multipartformdata-schema), Unset, dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | optional, default is unset | +[query_params](#query_params) | [RequestQueryParameters.Params](#requestqueryparametersparams), dict | | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +accept_content_types | typing.Tuple[str] | default is ("application/json", "multipart/form-data", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Description +multiple content types + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) +"multipart/form-data" | [content.multipart_form_data.Schema](#requestbody-content-multipartformdata-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +##### Composed Schemas (allOf/anyOf/oneOf/not) +##### allOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[_0](#requestbody-content-applicationjson-schema-allof-_0) | str | str | | + +#### RequestBody content ApplicationJson Schema allof _0 + +##### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str | str | | +#### RequestBody content MultipartFormData Schema + +##### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +##### Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**someProp** | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | [properties.SomeProp](#requestbody-content-multipartformdata-schema-properties-someprop) | | [optional] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +#### RequestBody content MultipartFormData Schema properties SomeProp + +##### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +##### Composed Schemas (allOf/anyOf/oneOf/not) +##### allOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[_0](#requestbody-content-multipartformdata-schema-properties-someprop-allof-_0) | str | str | | + +#### RequestBody content MultipartFormData Schema properties SomeProp allof _0 + +##### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str | str | | + +### query_params +#### RequestQueryParameters.Params +This is a TypedDict + +Key | Input Type | Description | Notes +------------- | ------------- | ------------- | ------------- +compositionAtRoot | [Parameter0.schema](#parameter0-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | | optional +compositionInProperty | [Parameter1.schema](#parameter1-schema), dict, frozendict.frozendict | | optional + + +#### Parameter0 + +##### Parameter0 Schema + +###### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +###### Composed Schemas (allOf/anyOf/oneOf/not) +###### allOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[_0](#parameter0-schema-allof-_0) | str | str | | + +##### Parameter0 Schema allof _0 + +###### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str | str | | + +#### Parameter1 + +##### Parameter1 Schema + +###### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +###### Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**someProp** | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | [properties.SomeProp](#parameter1-schema-properties-someprop) | | [optional] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +##### Parameter1 Schema properties SomeProp + +###### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +###### Composed Schemas (allOf/anyOf/oneOf/not) +###### allOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[_0](#parameter1-schema-properties-someprop-allof-_0) | str | str | | + +##### Parameter1 Schema properties SomeProp allof _0 + +###### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str | str | | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success, multiple content types + +## ResponseFor200 + +### Description +success, multiple content types + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | typing.Union[[content.application_json.schema](#responsefor200-content-applicationjson-schema), [content.multipart_form_data.schema](#responsefor200-content-multipartformdata-schema)] | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) +"multipart/form-data" | [content.multipart_form_data.Schema](#responsefor200-content-multipartformdata-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +##### Composed Schemas (allOf/anyOf/oneOf/not) +##### allOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[_0](#responsefor200-content-applicationjson-schema-allof-_0) | str | str | | + +#### ResponseFor200 content ApplicationJson Schema allof _0 + +##### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str | str | | +#### ResponseFor200 content MultipartFormData Schema + +##### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +##### Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**someProp** | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | [properties.SomeProp](#responsefor200-content-multipartformdata-schema-properties-someprop) | | [optional] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +#### ResponseFor200 content MultipartFormData Schema properties SomeProp + +##### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +##### Composed Schemas (allOf/anyOf/oneOf/not) +##### allOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[_0](#responsefor200-content-multipartformdata-schema-properties-someprop-allof-_0) | str | str | | + +#### ResponseFor200 content MultipartFormData Schema properties SomeProp allof _0 + +##### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str | str | | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://petstore.swagger.io:80/v2 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | petstore server +1 | [Server1](../../../servers/server_1.md) | The local server +2 | [Server2](../../../servers/server_2.md) | staging server with no variables + +## Code Sample + +```python +import petstore_api +from petstore_api.configurations import api_configuration +from petstore_api.apis.tags import fake_api +from petstore_api.paths.fake_inline_composition.post import operation +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = fake_api.FakeApi(api_client) + + # example passing only optional values + query_params: operation.RequestQueryParameters.Params = { + 'compositionAtRoot': None, + 'compositionInProperty': dict( + some_prop=None, + ), + } + body = None + try: + # testing composed schemas at inline locations + api_response = api_instance.inline_composition( + query_params=query_params, + body=body, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->inline_composition: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to FakeApi API]](../../apis/tags/fake_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/docs/paths/fake_json_form_data/get.md b/samples/openapi3/client/petstore/python/docs/paths/fake_json_form_data/get.md new file mode 100644 index 00000000000..052d98b638b --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/paths/fake_json_form_data/get.md @@ -0,0 +1,108 @@ +petstore_api.paths.fake_json_form_data.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| json_form_data | [FakeApi](../../apis/tags/fake_api.md) | This api is only for tag=fake | +| get | ApiForGet | This api is only for this endpoint | +| get | FakeJsonFormData | This api is only for path=/fake/jsonFormData | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Summary | test json serialization of form data | +| Path | "/fake/jsonFormData" | +| HTTP Method | get | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_x_www_form_urlencoded.schema](#RequestBody-content-applicationxwwwformurlencoded-schema), Unset, dict, frozendict.frozendict] | optional, default is unset | +content_type | str | optional, default is 'application/x-www-form-urlencoded' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/x-www-form-urlencoded" | [content.application_x_www_form_urlencoded.Schema](#requestbody-content-applicationxwwwformurlencoded-schema) + +#### RequestBody content ApplicationXWwwFormUrlencoded Schema + +##### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +##### Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**param** | str | str | field1 | +**param2** | str | str | field2 | +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [SuccessDescriptionOnly.response_cls](../../components/responses/response_success_description_only.md#response_success_description_onlyresponse_cls) | Success + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://petstore.swagger.io:80/v2 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | petstore server +1 | [Server1](../../../servers/server_1.md) | The local server +2 | [Server2](../../../servers/server_2.md) | staging server with no variables + +## Code Sample + +```python +import petstore_api +from petstore_api.configurations import api_configuration +from petstore_api.apis.tags import fake_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = fake_api.FakeApi(api_client) + + # example passing only optional values + body = dict( + param="param_example", + param2="param2_example", + ) + try: + # test json serialization of form data + api_response = api_instance.json_form_data( + body=body, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->json_form_data: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to FakeApi API]](../../apis/tags/fake_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/docs/paths/fake_json_patch/patch.md b/samples/openapi3/client/petstore/python/docs/paths/fake_json_patch/patch.md new file mode 100644 index 00000000000..ed582731514 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/paths/fake_json_patch/patch.md @@ -0,0 +1,101 @@ +petstore_api.paths.fake_json_patch.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| json_patch | [FakeApi](../../apis/tags/fake_api.md) | This api is only for tag=fake | +| patch | ApiForPatch | This api is only for this endpoint | +| patch | FakeJsonPatch | This api is only for path=/fake/jsonPatch | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Summary | json patch | +| Description | json patch route with a requestBody | +| Path | "/fake/jsonPatch" | +| HTTP Method | patch | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json_patchjson.schema](#RequestBody-content-applicationjsonpatchjson-schema), Unset, list, tuple] | optional, default is unset | +content_type | str | optional, default is 'application/json-patch+json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json-patch+json" | [content.application_json_patchjson.Schema](#requestbody-content-applicationjsonpatchjson-schema) + +#### RequestBody content ApplicationJsonPatchjson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[JSONPatchRequest](../../components/schema/json_patch_request.md) | list, tuple | tuple | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [SuccessDescriptionOnly.response_cls](../../components/responses/response_success_description_only.md#response_success_description_onlyresponse_cls) | Success + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://petstore.swagger.io:80/v2 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | petstore server +1 | [Server1](../../../servers/server_1.md) | The local server +2 | [Server2](../../../servers/server_2.md) | staging server with no variables + +## Code Sample + +```python +import petstore_api +from petstore_api.configurations import api_configuration +from petstore_api.apis.tags import fake_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = fake_api.FakeApi(api_client) + + # example passing only optional values + body = json_patch_request.JSONPatchRequest([ + None + ]) + try: + # json patch + api_response = api_instance.json_patch( + body=body, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->json_patch: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to FakeApi API]](../../apis/tags/fake_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/docs/paths/fake_json_with_charset/post.md b/samples/openapi3/client/petstore/python/docs/paths/fake_json_with_charset/post.md new file mode 100644 index 00000000000..1c048375286 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/paths/fake_json_with_charset/post.md @@ -0,0 +1,124 @@ +petstore_api.paths.fake_json_with_charset.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| json_with_charset | [FakeApi](../../apis/tags/fake_api.md) | This api is only for tag=fake | +| post | ApiForPost | This api is only for this endpoint | +| post | FakeJsonWithCharset | This api is only for path=/fake/jsonWithCharset | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Summary | json with charset tx and rx | +| Path | "/fake/jsonWithCharset" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json_charsetutf8.schema](#RequestBody-content-applicationjsoncharsetutf8-schema), Unset, dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | optional, default is unset | +content_type | str | optional, default is 'application/json; charset=utf-8' | Selects the schema and serialization of the request body +accept_content_types | typing.Tuple[str] | default is ("application/json; charset=utf-8", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json; charset=utf-8" | [content.application_json_charsetutf8.Schema](#requestbody-content-applicationjsoncharsetutf8-schema) + +#### RequestBody content ApplicationJsonCharsetutf8 Schema + +##### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json_charsetutf8.schema](#responsefor200-content-applicationjsoncharsetutf8-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json; charset=utf-8" | [content.application_json_charsetutf8.Schema](#responsefor200-content-applicationjsoncharsetutf8-schema) + +### Body Details +#### ResponseFor200 content ApplicationJsonCharsetutf8 Schema + +##### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://petstore.swagger.io:80/v2 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | petstore server +1 | [Server1](../../../servers/server_1.md) | The local server +2 | [Server2](../../../servers/server_2.md) | staging server with no variables + +## Code Sample + +```python +import petstore_api +from petstore_api.configurations import api_configuration +from petstore_api.apis.tags import fake_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = fake_api.FakeApi(api_client) + + # example passing only optional values + body = None + try: + # json with charset tx and rx + api_response = api_instance.json_with_charset( + body=body, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->json_with_charset: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to FakeApi API]](../../apis/tags/fake_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/docs/paths/fake_multiple_response_bodies/get.md b/samples/openapi3/client/petstore/python/docs/paths/fake_multiple_response_bodies/get.md new file mode 100644 index 00000000000..2a0004d4675 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/paths/fake_multiple_response_bodies/get.md @@ -0,0 +1,131 @@ +petstore_api.paths.fake_multiple_response_bodies.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| multiple_response_bodies | [FakeApi](../../apis/tags/fake_api.md) | This api is only for tag=fake | +| get | ApiForGet | This api is only for this endpoint | +| get | FakeMultipleResponseBodies | This api is only for path=/fake/multipleResponseBodies | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Summary | multiple responses have response bodies | +| Path | "/fake/multipleResponseBodies" | +| HTTP Method | get | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success +202 | [ResponseFor202.response_cls](#responsefor202-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## ResponseFor202 + +### Description +success + +### ResponseFor202 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor202-body) | [content.application_json.schema](#responsefor202-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor202 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor202-content-applicationjson-schema) + +### Body Details +#### ResponseFor202 content ApplicationJson Schema + +##### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://petstore.swagger.io:80/v2 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | petstore server +1 | [Server1](../../../servers/server_1.md) | The local server +2 | [Server2](../../../servers/server_2.md) | staging server with no variables + +## Code Sample + +```python +import petstore_api +from petstore_api.configurations import api_configuration +from petstore_api.apis.tags import fake_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = fake_api.FakeApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + # multiple responses have response bodies + api_response = api_instance.multiple_response_bodies() + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->multiple_response_bodies: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to FakeApi API]](../../apis/tags/fake_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/docs/paths/fake_multiple_securities/get.md b/samples/openapi3/client/petstore/python/docs/paths/fake_multiple_securities/get.md new file mode 100644 index 00000000000..ba9653f9e33 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/paths/fake_multiple_securities/get.md @@ -0,0 +1,152 @@ +petstore_api.paths.fake_multiple_securities.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| multiple_securities | [FakeApi](../../apis/tags/fake_api.md) | This api is only for tag=fake | +| get | ApiForGet | This api is only for this endpoint | +| get | FakeMultipleSecurities | This api is only for path=/fake/multipleSecurities | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Security](#security) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Summary | multiple security requirements | +| Path | "/fake/multipleSecurities" | +| HTTP Method | get | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Security + +Set auth info by setting ApiConfiguration.security_scheme_info to a dict where the +key is the below security scheme quoted name, and the value is an instance of the linked +component security scheme class. +Select the security index by setting ApiConfiguration.security_index_info or by +passing in security_index into the endpoint method. +See how to do this in the code sample. +- these securities are specific to this to this endpoint + +| Security Index | Security Scheme to Scope Names | +| -------------- | ------------------------------ | +| 0 | no security | +| 1 | ["http_basic_test"](../../components/security_schemes/security_scheme_http_basic_test.md) []
    ["api_key"](../../components/security_schemes/security_scheme_api_key.md) []
    | +| 2 | ["petstore_auth"](../../components/security_schemes/security_scheme_petstore_auth.md) [write:pets, read:pets]
    | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://petstore.swagger.io:80/v2 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | petstore server +1 | [Server1](../../../servers/server_1.md) | The local server +2 | [Server2](../../../servers/server_2.md) | staging server with no variables + +## Code Sample + +```python +import petstore_api +from petstore_api.configurations import api_configuration +from petstore_api.apis.tags import fake_api +from pprint import pprint +# security_index 1 +from petstore_api.components.security_schemes import security_scheme_http_basic_test +from petstore_api.components.security_schemes import security_scheme_api_key +# security_index 2 +from petstore_api.components.security_schemes import security_scheme_petstore_auth + +# security_scheme_info for security_index 0 +# no auth required for this security_index +security_scheme_info: api_configuration.SecuritySchemeInfo = {} + + +# security_scheme_info for security_index 1 +security_scheme_info: api_configuration.SecuritySchemeInfo = { + "http_basic_test": security_scheme_http_basic_test.HttpBasicTest( + user_id='someUserIdOrName', + password='somePassword', + ), + "api_key": security_scheme_api_key.ApiKey( + api_key='sampleApiKeyValue' + ), +} + + +# security_scheme_info for security_index 2 +security_scheme_info: api_configuration.SecuritySchemeInfo = { + "petstore_auth": security_scheme_petstore_auth.PetstoreAuth( + ), +} + +used_configuration = api_configuration.ApiConfiguration( + security_scheme_info=security_scheme_info +) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = fake_api.FakeApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + # multiple security requirements + api_response = api_instance.multiple_securities() + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->multiple_securities: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to FakeApi API]](../../apis/tags/fake_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/docs/paths/fake_obj_in_query/get.md b/samples/openapi3/client/petstore/python/docs/paths/fake_obj_in_query/get.md new file mode 100644 index 00000000000..3539a9eb19e --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/paths/fake_obj_in_query/get.md @@ -0,0 +1,115 @@ +petstore_api.paths.fake_obj_in_query.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| object_in_query | [FakeApi](../../apis/tags/fake_api.md) | This api is only for tag=fake | +| get | ApiForGet | This api is only for this endpoint | +| get | FakeObjInQuery | This api is only for path=/fake/objInQuery | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Summary | user list | +| Path | "/fake/objInQuery" | +| HTTP Method | get | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[query_params](#query_params) | [RequestQueryParameters.Params](#requestqueryparametersparams), dict | | +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### query_params +#### RequestQueryParameters.Params +This is a TypedDict + +Key | Input Type | Description | Notes +------------- | ------------- | ------------- | ------------- +mapBean | [Parameter0.schema](#parameter0-schema), dict, frozendict.frozendict | | optional + + +#### Parameter0 + +##### Description +mapBean + +##### Parameter0 Schema + +###### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +###### Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**keyword** | str | str | | [optional] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [SuccessDescriptionOnly.response_cls](../../components/responses/response_success_description_only.md#response_success_description_onlyresponse_cls) | Success + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://petstore.swagger.io:80/v2 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | petstore server +1 | [Server1](../../../servers/server_1.md) | The local server +2 | [Server2](../../../servers/server_2.md) | staging server with no variables + +## Code Sample + +```python +import petstore_api +from petstore_api.configurations import api_configuration +from petstore_api.apis.tags import fake_api +from petstore_api.paths.fake_obj_in_query.get import operation +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = fake_api.FakeApi(api_client) + + # example passing only optional values + query_params: operation.RequestQueryParameters.Params = { + 'mapBean': dict( + keyword="keyword_example", + ), + } + try: + # user list + api_response = api_instance.object_in_query( + query_params=query_params, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->object_in_query: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to FakeApi API]](../../apis/tags/fake_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/docs/paths/fake_parameter_collisions1_abab_self_ab/post.md b/samples/openapi3/client/petstore/python/docs/paths/fake_parameter_collisions1_abab_self_ab/post.md new file mode 100644 index 00000000000..e81c0bf0661 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/paths/fake_parameter_collisions1_abab_self_ab/post.md @@ -0,0 +1,408 @@ +petstore_api.paths.fake_parameter_collisions1_abab_self_ab.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| parameter_collisions | [FakeApi](../../apis/tags/fake_api.md) | This api is only for tag=fake | +| post | ApiForPost | This api is only for this endpoint | +| post | FakeParameterCollisions1ABAbSelfAB | This api is only for path=/fake/parameterCollisions/{1}/{aB}/{Ab}/{self}/{A-B}/ | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Summary | parameter collision case | +| Path | "/fake/parameterCollisions/{1}/{aB}/{Ab}/{self}/{A-B}/" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), Unset, dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | optional, default is unset | +[query_params](#query_params) | [RequestQueryParameters.Params](#requestqueryparametersparams), dict | | +[header_params](#header_params) | [RequestHeaderParameters.Params](#requestheaderparametersparams), dict | | +[path_params](#path_params) | [RequestPathParameters.Params](#requestpathparametersparams), dict | | +[cookie_params](#cookie-params) | [RequestCookieParameters.Params](#requestcookieparametersparams), dict | | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +### query_params +#### RequestQueryParameters.Params +This is a TypedDict + +Key | Input Type | Description | Notes +------------- | ------------- | ------------- | ------------- +1 | [Parameter0.schema](#parameter0-schema), str | | optional +aB | [Parameter1.schema](#parameter1-schema), str | | optional +Ab | [Parameter2.schema](#parameter2-schema), str | | optional +self | [Parameter3.schema](#parameter3-schema), str | | optional +A-B | [Parameter4.schema](#parameter4-schema), str | | optional + + +#### Parameter0 + +##### Parameter0 Schema + +###### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str | str | | + +#### Parameter1 + +##### Parameter1 Schema + +###### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str | str | | + +#### Parameter2 + +##### Parameter2 Schema + +###### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str | str | | + +#### Parameter3 + +##### Parameter3 Schema + +###### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str | str | | + +#### Parameter4 + +##### Parameter4 Schema + +###### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str | str | | + +### header_params +#### RequestHeaderParameters.Params +This is a TypedDict + +Key | Input Type | Description | Notes +------------- | ------------- | ------------- | ------------- +1 | [Parameter5.schema](#parameter5-schema), str | | optional +aB | [Parameter6.schema](#parameter6-schema), str | | optional +self | [Parameter7.schema](#parameter7-schema), str | | optional +A-B | [Parameter8.schema](#parameter8-schema), str | | optional + + +#### Parameter5 + +##### Parameter5 Schema + +###### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str | str | | + +#### Parameter6 + +##### Parameter6 Schema + +###### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str | str | | + +#### Parameter7 + +##### Parameter7 Schema + +###### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str | str | | + +#### Parameter8 + +##### Parameter8 Schema + +###### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str | str | | + +### path_params +#### RequestPathParameters.Params +This is a TypedDict + +Key | Input Type | Description | Notes +------------- | ------------- | ------------- | ------------- +1 | [Parameter9.schema](#parameter9-schema), str | | +aB | [Parameter10.schema](#parameter10-schema), str | | +Ab | [Parameter11.schema](#parameter11-schema), str | | +self | [Parameter12.schema](#parameter12-schema), str | | +A-B | [Parameter13.schema](#parameter13-schema), str | | + + +#### Parameter9 + +##### Parameter9 Schema + +###### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str | str | | + +#### Parameter10 + +##### Parameter10 Schema + +###### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str | str | | + +#### Parameter11 + +##### Parameter11 Schema + +###### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str | str | | + +#### Parameter12 + +##### Parameter12 Schema + +###### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str | str | | + +#### Parameter13 + +##### Parameter13 Schema + +###### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str | str | | + +### cookie_params +#### RequestCookieParameters.Params +This is a TypedDict + +Key | Input Type | Description | Notes +------------- | ------------- | ------------- | ------------- +1 | [Parameter14.schema](#parameter14-schema), str | | optional +aB | [Parameter15.schema](#parameter15-schema), str | | optional +Ab | [Parameter16.schema](#parameter16-schema), str | | optional +self | [Parameter17.schema](#parameter17-schema), str | | optional +A-B | [Parameter18.schema](#parameter18-schema), str | | optional + + +#### Parameter14 + +##### Parameter14 Schema + +###### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str | str | | + +#### Parameter15 + +##### Parameter15 Schema + +###### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str | str | | + +#### Parameter16 + +##### Parameter16 Schema + +###### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str | str | | + +#### Parameter17 + +##### Parameter17 Schema + +###### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str | str | | + +#### Parameter18 + +##### Parameter18 Schema + +###### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str | str | | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://petstore.swagger.io:80/v2 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | petstore server +1 | [Server1](../../../servers/server_1.md) | The local server +2 | [Server2](../../../servers/server_2.md) | staging server with no variables + +## Code Sample + +```python +import petstore_api +from petstore_api.configurations import api_configuration +from petstore_api.apis.tags import fake_api +from petstore_api.paths.fake_parameter_collisions1_abab_self_ab.post import operation +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = fake_api.FakeApi(api_client) + + # example passing only required values which don't have defaults set + path_params: operation.RequestPathParameters.Params = { + '1': "1_example", + 'aB': "aB_example", + 'Ab': "Ab_example", + 'self': "self_example", + 'A-B': "A-B_example", + } + query_params: operation.RequestQueryParameters.Params = { + } + cookie_params: operation.RequestCookieParameters.Params = { + } + header_params: operation.RequestHeaderParameters.Params = { + } + try: + # parameter collision case + api_response = api_instance.parameter_collisions( + path_params=path_params, + query_params=query_params, + header_params=header_params, + cookie_params=cookie_params, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->parameter_collisions: %s\n" % e) + + # example passing only optional values + path_params = { + '1': "1_example", + 'aB': "aB_example", + 'Ab': "Ab_example", + 'self': "self_example", + 'A-B': "A-B_example", + } + query_params: operation.RequestQueryParameters.Params = { + '1': "1_example", + 'aB': "aB_example", + 'Ab': "Ab_example", + 'self': "self_example", + 'A-B': "A-B_example", + } + cookie_params: operation.RequestCookieParameters.Params = { + '1': "1_example", + 'aB': "aB_example", + 'Ab': "Ab_example", + 'self': "self_example", + 'A-B': "A-B_example", + } + header_params: operation.RequestHeaderParameters.Params = { + '1': "1_example", + 'aB': "aB_example", + 'self': "self_example", + 'A-B': "A-B_example", + } + body = None + try: + # parameter collision case + api_response = api_instance.parameter_collisions( + path_params=path_params, + query_params=query_params, + header_params=header_params, + cookie_params=cookie_params, + body=body, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->parameter_collisions: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to FakeApi API]](../../apis/tags/fake_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/docs/paths/fake_pet_id_upload_image_with_required_file/post.md b/samples/openapi3/client/petstore/python/docs/paths/fake_pet_id_upload_image_with_required_file/post.md new file mode 100644 index 00000000000..a1de2fa1966 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/paths/fake_pet_id_upload_image_with_required_file/post.md @@ -0,0 +1,199 @@ +petstore_api.paths.fake_pet_id_upload_image_with_required_file.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| upload_file_with_required_file | [PetApi](../../apis/tags/pet_api.md) | This api is only for tag=pet | +| post | ApiForPost | This api is only for this endpoint | +| post | FakePetIdUploadImageWithRequiredFile | This api is only for path=/fake/{petId}/uploadImageWithRequiredFile | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Security](#security) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Summary | uploads an image (required) | +| Path | "/fake/{petId}/uploadImageWithRequiredFile" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.multipart_form_data.schema](#RequestBody-content-multipartformdata-schema), Unset, dict, frozendict.frozendict] | optional, default is unset | +[path_params](#path_params) | [RequestPathParameters.Params](#requestpathparametersparams), dict | | +content_type | str | optional, default is 'multipart/form-data' | Selects the schema and serialization of the request body +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"multipart/form-data" | [content.multipart_form_data.Schema](#requestbody-content-multipartformdata-schema) + +#### RequestBody content MultipartFormData Schema + +##### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +##### Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**requiredFile** | bytes, io.FileIO, io.BufferedReader | bytes, io.FileIO | file to upload | +**additionalMetadata** | str | str | Additional data to pass to server | [optional] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +### path_params +#### RequestPathParameters.Params +This is a TypedDict + +Key | Input Type | Description | Notes +------------- | ------------- | ------------- | ------------- +petId | [Parameter0.schema](#parameter0-schema), decimal.Decimal, int | | + + +#### Parameter0 + +##### Description +ID of pet to update + +##### Parameter0 Schema + +###### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +decimal.Decimal, int | decimal.Decimal | | value must be a 64 bit integer + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | successful operation + +## ResponseFor200 + +### Description +successful operation + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[ApiResponse](../../components/schema/api_response.md) | dict, frozendict.frozendict | frozendict.frozendict | + +## Security + +Set auth info by setting ApiConfiguration.security_scheme_info to a dict where the +key is the below security scheme quoted name, and the value is an instance of the linked +component security scheme class. +Select the security index by setting ApiConfiguration.security_index_info or by +passing in security_index into the endpoint method. +See how to do this in the code sample. +- these securities are specific to this to this endpoint + +| Security Index | Security Scheme to Scope Names | +| -------------- | ------------------------------ | +| 0 | ["petstore_auth"](../../components/security_schemes/security_scheme_petstore_auth.md) [write:pets, read:pets]
    | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://petstore.swagger.io:80/v2 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | petstore server +1 | [Server1](../../../servers/server_1.md) | The local server +2 | [Server2](../../../servers/server_2.md) | staging server with no variables + +## Code Sample + +```python +import petstore_api +from petstore_api.configurations import api_configuration +from petstore_api.apis.tags import pet_api +from petstore_api.paths.fake_pet_id_upload_image_with_required_file.post import operation +from pprint import pprint +# security_index 0 +from petstore_api.components.security_schemes import security_scheme_petstore_auth + +# security_scheme_info for security_index 0 +security_scheme_info: api_configuration.SecuritySchemeInfo = { + "petstore_auth": security_scheme_petstore_auth.PetstoreAuth( + ), +} + +used_configuration = api_configuration.ApiConfiguration( + security_scheme_info=security_scheme_info +) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = pet_api.PetApi(api_client) + + # example passing only required values which don't have defaults set + path_params: operation.RequestPathParameters.Params = { + 'petId': 1, + } + try: + # uploads an image (required) + api_response = api_instance.upload_file_with_required_file( + path_params=path_params, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->upload_file_with_required_file: %s\n" % e) + + # example passing only optional values + path_params = { + 'petId': 1, + } + body = dict( + additional_metadata="additional_metadata_example", + required_file=open('/path/to/file', 'rb'), + ) + try: + # uploads an image (required) + api_response = api_instance.upload_file_with_required_file( + path_params=path_params, + body=body, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->upload_file_with_required_file: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PetApi API]](../../apis/tags/pet_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/docs/paths/fake_query_param_with_json_content_type/get.md b/samples/openapi3/client/petstore/python/docs/paths/fake_query_param_with_json_content_type/get.md new file mode 100644 index 00000000000..8728fb28fe3 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/paths/fake_query_param_with_json_content_type/get.md @@ -0,0 +1,137 @@ +petstore_api.paths.fake_query_param_with_json_content_type.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| query_param_with_json_content_type | [FakeApi](../../apis/tags/fake_api.md) | This api is only for tag=fake | +| get | ApiForGet | This api is only for this endpoint | +| get | FakeQueryParamWithJsonContentType | This api is only for path=/fake/queryParamWithJsonContentType | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Summary | query param with json content-type | +| Path | "/fake/queryParamWithJsonContentType" | +| HTTP Method | get | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[query_params](#query_params) | [RequestQueryParameters.Params](#requestqueryparametersparams), dict | | +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### query_params +#### RequestQueryParameters.Params +This is a TypedDict + +Key | Input Type | Description | Notes +------------- | ------------- | ------------- | ------------- +someParam | [Parameter0.content.application_json.schema](#parameter0-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | | + + +#### Parameter0 + +##### Description +The internal object id + +##### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#parameter0-content-applicationjson-schema) +##### Parameter0 content ApplicationJson Schema + +###### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://petstore.swagger.io:80/v2 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | petstore server +1 | [Server1](../../../servers/server_1.md) | The local server +2 | [Server2](../../../servers/server_2.md) | staging server with no variables + +## Code Sample + +```python +import petstore_api +from petstore_api.configurations import api_configuration +from petstore_api.apis.tags import fake_api +from petstore_api.paths.fake_query_param_with_json_content_type.get import operation +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = fake_api.FakeApi(api_client) + + # example passing only required values which don't have defaults set + query_params: operation.RequestQueryParameters.Params = { + 'someParam': , + } + try: + # query param with json content-type + api_response = api_instance.query_param_with_json_content_type( + query_params=query_params, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->query_param_with_json_content_type: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to FakeApi API]](../../apis/tags/fake_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/docs/paths/fake_redirection/get.md b/samples/openapi3/client/petstore/python/docs/paths/fake_redirection/get.md new file mode 100644 index 00000000000..203387a725c --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/paths/fake_redirection/get.md @@ -0,0 +1,104 @@ +petstore_api.paths.fake_redirection.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| redirection | [FakeApi](../../apis/tags/fake_api.md) | This api is only for tag=fake | +| get | ApiForGet | This api is only for this endpoint | +| get | FakeRedirection | This api is only for path=/fake/redirection | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Summary | operation with redirection responses | +| Path | "/fake/redirection" | +| HTTP Method | get | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +303 | [ResponseFor303.response_cls](#responsefor303-response_cls) | see other +3XX | [ResponseFor3XX.response_cls](#responsefor3xx-response_cls) | 3XX response + +## ResponseFor303 + +### Description +see other + +### ResponseFor303 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## ResponseFor3XX + +### Description +3XX response + +### ResponseFor3XX response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://petstore.swagger.io:80/v2 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | petstore server +1 | [Server1](../../../servers/server_1.md) | The local server +2 | [Server2](../../../servers/server_2.md) | staging server with no variables + +## Code Sample + +```python +import petstore_api +from petstore_api.configurations import api_configuration +from petstore_api.apis.tags import fake_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = fake_api.FakeApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + # operation with redirection responses + api_response = api_instance.redirection() + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->redirection: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to FakeApi API]](../../apis/tags/fake_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/docs/paths/fake_ref_obj_in_query/get.md b/samples/openapi3/client/petstore/python/docs/paths/fake_ref_obj_in_query/get.md new file mode 100644 index 00000000000..c9cd1e5da55 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/paths/fake_ref_obj_in_query/get.md @@ -0,0 +1,109 @@ +petstore_api.paths.fake_ref_obj_in_query.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| ref_object_in_query | [FakeApi](../../apis/tags/fake_api.md) | This api is only for tag=fake | +| get | ApiForGet | This api is only for this endpoint | +| get | FakeRefObjInQuery | This api is only for path=/fake/refObjInQuery | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Summary | user list | +| Path | "/fake/refObjInQuery" | +| HTTP Method | get | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[query_params](#query_params) | [RequestQueryParameters.Params](#requestqueryparametersparams), dict | | +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### query_params +#### RequestQueryParameters.Params +This is a TypedDict + +Key | Input Type | Description | Notes +------------- | ------------- | ------------- | ------------- +mapBean | [Parameter0.schema](#parameter0-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | | optional + + +#### Parameter0 + +##### Description +mapBean + +##### Parameter0 Schema + +###### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[Foo](../../components/schema/foo.md) | dict, frozendict.frozendict | frozendict.frozendict | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [SuccessDescriptionOnly.response_cls](../../components/responses/response_success_description_only.md#response_success_description_onlyresponse_cls) | Success + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://petstore.swagger.io:80/v2 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | petstore server +1 | [Server1](../../../servers/server_1.md) | The local server +2 | [Server2](../../../servers/server_2.md) | staging server with no variables + +## Code Sample + +```python +import petstore_api +from petstore_api.configurations import api_configuration +from petstore_api.apis.tags import fake_api +from petstore_api.paths.fake_ref_obj_in_query.get import operation +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = fake_api.FakeApi(api_client) + + # example passing only optional values + query_params: operation.RequestQueryParameters.Params = { + 'mapBean': foo.Foo( + bar=bar.Bar("bar"), + ), + } + try: + # user list + api_response = api_instance.ref_object_in_query( + query_params=query_params, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->ref_object_in_query: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to FakeApi API]](../../apis/tags/fake_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/docs/paths/fake_refs_array_of_enums/post.md b/samples/openapi3/client/petstore/python/docs/paths/fake_refs_array_of_enums/post.md new file mode 100644 index 00000000000..3e24d3a4a06 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/paths/fake_refs_array_of_enums/post.md @@ -0,0 +1,129 @@ +petstore_api.paths.fake_refs_array_of_enums.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| array_of_enums | [FakeApi](../../apis/tags/fake_api.md) | This api is only for tag=fake | +| post | ApiForPost | This api is only for this endpoint | +| post | FakeRefsArrayOfEnums | This api is only for path=/fake/refs/array-of-enums | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Summary | Array of Enums | +| Path | "/fake/refs/array-of-enums" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), Unset, list, tuple] | optional, default is unset | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Description +Input enum + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[ArrayOfEnums](../../components/schema/array_of_enums.md) | list, tuple | tuple | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | Got named array of enums + +## ResponseFor200 + +### Description +Got named array of enums + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[ArrayOfEnums](../../components/schema/array_of_enums.md) | list, tuple | tuple | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://petstore.swagger.io:80/v2 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | petstore server +1 | [Server1](../../../servers/server_1.md) | The local server +2 | [Server2](../../../servers/server_2.md) | staging server with no variables + +## Code Sample + +```python +import petstore_api +from petstore_api.configurations import api_configuration +from petstore_api.apis.tags import fake_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = fake_api.FakeApi(api_client) + + # example passing only optional values + body = array_of_enums.ArrayOfEnums([ + string_enum.StringEnum("string_example") + ]) + try: + # Array of Enums + api_response = api_instance.array_of_enums( + body=body, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->array_of_enums: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to FakeApi API]](../../apis/tags/fake_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/docs/paths/fake_refs_arraymodel/post.md b/samples/openapi3/client/petstore/python/docs/paths/fake_refs_arraymodel/post.md new file mode 100644 index 00000000000..40cbe47e6ce --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/paths/fake_refs_arraymodel/post.md @@ -0,0 +1,128 @@ +petstore_api.paths.fake_refs_arraymodel.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| array_model | [FakeApi](../../apis/tags/fake_api.md) | This api is only for tag=fake | +| post | ApiForPost | This api is only for this endpoint | +| post | FakeRefsArraymodel | This api is only for path=/fake/refs/arraymodel | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Description | Test serialization of ArrayModel | +| Path | "/fake/refs/arraymodel" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), Unset, list, tuple] | optional, default is unset | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Description +Input model + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[AnimalFarm](../../components/schema/animal_farm.md) | list, tuple | tuple | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | Output model + +## ResponseFor200 + +### Description +Output model + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[AnimalFarm](../../components/schema/animal_farm.md) | list, tuple | tuple | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://petstore.swagger.io:80/v2 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | petstore server +1 | [Server1](../../../servers/server_1.md) | The local server +2 | [Server2](../../../servers/server_2.md) | staging server with no variables + +## Code Sample + +```python +import petstore_api +from petstore_api.configurations import api_configuration +from petstore_api.apis.tags import fake_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = fake_api.FakeApi(api_client) + + # example passing only optional values + body = animal_farm.AnimalFarm([ + animal.Animal() + ]) + try: + api_response = api_instance.array_model( + body=body, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->array_model: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to FakeApi API]](../../apis/tags/fake_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/docs/paths/fake_refs_boolean/post.md b/samples/openapi3/client/petstore/python/docs/paths/fake_refs_boolean/post.md new file mode 100644 index 00000000000..d125ae008ab --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/paths/fake_refs_boolean/post.md @@ -0,0 +1,126 @@ +petstore_api.paths.fake_refs_boolean.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| boolean | [FakeApi](../../apis/tags/fake_api.md) | This api is only for tag=fake | +| post | ApiForPost | This api is only for this endpoint | +| post | FakeRefsBoolean | This api is only for path=/fake/refs/boolean | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Description | Test serialization of outer boolean types | +| Path | "/fake/refs/boolean" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), Unset, bool] | optional, default is unset | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Description +Input boolean as post body + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[Boolean](../../components/schema/boolean.md) | bool | BoolClass | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | Output boolean + +## ResponseFor200 + +### Description +Output boolean + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[Boolean](../../components/schema/boolean.md) | bool | BoolClass | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://petstore.swagger.io:80/v2 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | petstore server +1 | [Server1](../../../servers/server_1.md) | The local server +2 | [Server2](../../../servers/server_2.md) | staging server with no variables + +## Code Sample + +```python +import petstore_api +from petstore_api.configurations import api_configuration +from petstore_api.apis.tags import fake_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = fake_api.FakeApi(api_client) + + # example passing only optional values + body = boolean.Boolean(True) + try: + api_response = api_instance.boolean( + body=body, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->boolean: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to FakeApi API]](../../apis/tags/fake_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/docs/paths/fake_refs_composed_one_of_number_with_validations/post.md b/samples/openapi3/client/petstore/python/docs/paths/fake_refs_composed_one_of_number_with_validations/post.md new file mode 100644 index 00000000000..f44b91177d6 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/paths/fake_refs_composed_one_of_number_with_validations/post.md @@ -0,0 +1,126 @@ +petstore_api.paths.fake_refs_composed_one_of_number_with_validations.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| composed_one_of_different_types | [FakeApi](../../apis/tags/fake_api.md) | This api is only for tag=fake | +| post | ApiForPost | This api is only for this endpoint | +| post | FakeRefsComposedOneOfNumberWithValidations | This api is only for path=/fake/refs/composed_one_of_number_with_validations | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Description | Test serialization of object with $refed properties | +| Path | "/fake/refs/composed_one_of_number_with_validations" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), Unset, dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | optional, default is unset | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Description +Input model + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[ComposedOneOfDifferentTypes](../../components/schema/composed_one_of_different_types.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | Output model + +## ResponseFor200 + +### Description +Output model + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[ComposedOneOfDifferentTypes](../../components/schema/composed_one_of_different_types.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://petstore.swagger.io:80/v2 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | petstore server +1 | [Server1](../../../servers/server_1.md) | The local server +2 | [Server2](../../../servers/server_2.md) | staging server with no variables + +## Code Sample + +```python +import petstore_api +from petstore_api.configurations import api_configuration +from petstore_api.apis.tags import fake_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = fake_api.FakeApi(api_client) + + # example passing only optional values + body = composed_one_of_different_types.ComposedOneOfDifferentTypes(None) + try: + api_response = api_instance.composed_one_of_different_types( + body=body, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->composed_one_of_different_types: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to FakeApi API]](../../apis/tags/fake_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/docs/paths/fake_refs_enum/post.md b/samples/openapi3/client/petstore/python/docs/paths/fake_refs_enum/post.md new file mode 100644 index 00000000000..7a70c863235 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/paths/fake_refs_enum/post.md @@ -0,0 +1,126 @@ +petstore_api.paths.fake_refs_enum.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| string_enum | [FakeApi](../../apis/tags/fake_api.md) | This api is only for tag=fake | +| post | ApiForPost | This api is only for this endpoint | +| post | FakeRefsEnum | This api is only for path=/fake/refs/enum | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Description | Test serialization of outer enum | +| Path | "/fake/refs/enum" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), Unset, None, str] | optional, default is unset | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Description +Input enum + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[StringEnum](../../components/schema/string_enum.md) | None, str | NoneClass, str | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | Output enum + +## ResponseFor200 + +### Description +Output enum + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[StringEnum](../../components/schema/string_enum.md) | None, str | NoneClass, str | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://petstore.swagger.io:80/v2 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | petstore server +1 | [Server1](../../../servers/server_1.md) | The local server +2 | [Server2](../../../servers/server_2.md) | staging server with no variables + +## Code Sample + +```python +import petstore_api +from petstore_api.configurations import api_configuration +from petstore_api.apis.tags import fake_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = fake_api.FakeApi(api_client) + + # example passing only optional values + body = string_enum.StringEnum("placed") + try: + api_response = api_instance.string_enum( + body=body, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->string_enum: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to FakeApi API]](../../apis/tags/fake_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/docs/paths/fake_refs_mammal/post.md b/samples/openapi3/client/petstore/python/docs/paths/fake_refs_mammal/post.md new file mode 100644 index 00000000000..b1109f5c603 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/paths/fake_refs_mammal/post.md @@ -0,0 +1,130 @@ +petstore_api.paths.fake_refs_mammal.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| mammal | [FakeApi](../../apis/tags/fake_api.md) | This api is only for tag=fake | +| post | ApiForPost | This api is only for this endpoint | +| post | FakeRefsMammal | This api is only for path=/fake/refs/mammal | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Description | Test serialization of mammals | +| Path | "/fake/refs/mammal" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Description +Input mammal + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[Mammal](../../components/schema/mammal.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | Output mammal + +## ResponseFor200 + +### Description +Output mammal + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[Mammal](../../components/schema/mammal.md) | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://petstore.swagger.io:80/v2 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | petstore server +1 | [Server1](../../../servers/server_1.md) | The local server +2 | [Server2](../../../servers/server_2.md) | staging server with no variables + +## Code Sample + +```python +import petstore_api +from petstore_api.configurations import api_configuration +from petstore_api.apis.tags import fake_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = fake_api.FakeApi(api_client) + + # example passing only required values which don't have defaults set + body = mammal.Mammal( + has_baleen=True, + has_teeth=True, + class_name="whale", + ) + try: + api_response = api_instance.mammal( + body=body, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->mammal: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to FakeApi API]](../../apis/tags/fake_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/docs/paths/fake_refs_number/post.md b/samples/openapi3/client/petstore/python/docs/paths/fake_refs_number/post.md new file mode 100644 index 00000000000..f9c1ed596ea --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/paths/fake_refs_number/post.md @@ -0,0 +1,126 @@ +petstore_api.paths.fake_refs_number.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| number_with_validations | [FakeApi](../../apis/tags/fake_api.md) | This api is only for tag=fake | +| post | ApiForPost | This api is only for this endpoint | +| post | FakeRefsNumber | This api is only for path=/fake/refs/number | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Description | Test serialization of outer number types | +| Path | "/fake/refs/number" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), Unset, decimal.Decimal, int, float] | optional, default is unset | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Description +Input number as post body + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[NumberWithValidations](../../components/schema/number_with_validations.md) | decimal.Decimal, int, float | decimal.Decimal | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | Output number + +## ResponseFor200 + +### Description +Output number + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[NumberWithValidations](../../components/schema/number_with_validations.md) | decimal.Decimal, int, float | decimal.Decimal | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://petstore.swagger.io:80/v2 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | petstore server +1 | [Server1](../../../servers/server_1.md) | The local server +2 | [Server2](../../../servers/server_2.md) | staging server with no variables + +## Code Sample + +```python +import petstore_api +from petstore_api.configurations import api_configuration +from petstore_api.apis.tags import fake_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = fake_api.FakeApi(api_client) + + # example passing only optional values + body = number_with_validations.NumberWithValidations(10) + try: + api_response = api_instance.number_with_validations( + body=body, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->number_with_validations: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to FakeApi API]](../../apis/tags/fake_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/docs/paths/fake_refs_object_model_with_ref_props/post.md b/samples/openapi3/client/petstore/python/docs/paths/fake_refs_object_model_with_ref_props/post.md new file mode 100644 index 00000000000..bf42fa98151 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/paths/fake_refs_object_model_with_ref_props/post.md @@ -0,0 +1,130 @@ +petstore_api.paths.fake_refs_object_model_with_ref_props.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| object_model_with_ref_props | [FakeApi](../../apis/tags/fake_api.md) | This api is only for tag=fake | +| post | ApiForPost | This api is only for this endpoint | +| post | FakeRefsObjectModelWithRefProps | This api is only for path=/fake/refs/object_model_with_ref_props | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Description | Test serialization of object with $refed properties | +| Path | "/fake/refs/object_model_with_ref_props" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), Unset, dict, frozendict.frozendict] | optional, default is unset | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Description +Input model + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[ObjectModelWithRefProps](../../components/schema/object_model_with_ref_props.md) | dict, frozendict.frozendict | frozendict.frozendict | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | Output model + +## ResponseFor200 + +### Description +Output model + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[ObjectModelWithRefProps](../../components/schema/object_model_with_ref_props.md) | dict, frozendict.frozendict | frozendict.frozendict | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://petstore.swagger.io:80/v2 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | petstore server +1 | [Server1](../../../servers/server_1.md) | The local server +2 | [Server2](../../../servers/server_2.md) | staging server with no variables + +## Code Sample + +```python +import petstore_api +from petstore_api.configurations import api_configuration +from petstore_api.apis.tags import fake_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = fake_api.FakeApi(api_client) + + # example passing only optional values + body = object_model_with_ref_props.ObjectModelWithRefProps( + my_number=number_with_validations.NumberWithValidations(10), + my_string=string.String("my_string_example"), + my_boolean=boolean.Boolean(True), + ) + try: + api_response = api_instance.object_model_with_ref_props( + body=body, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->object_model_with_ref_props: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to FakeApi API]](../../apis/tags/fake_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/docs/paths/fake_refs_string/post.md b/samples/openapi3/client/petstore/python/docs/paths/fake_refs_string/post.md new file mode 100644 index 00000000000..94bb952e2de --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/paths/fake_refs_string/post.md @@ -0,0 +1,126 @@ +petstore_api.paths.fake_refs_string.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| string | [FakeApi](../../apis/tags/fake_api.md) | This api is only for tag=fake | +| post | ApiForPost | This api is only for this endpoint | +| post | FakeRefsString | This api is only for path=/fake/refs/string | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Description | Test serialization of outer string types | +| Path | "/fake/refs/string" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), Unset, str] | optional, default is unset | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Description +Input string as post body + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[String](../../components/schema/string.md) | str | str | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | Output string + +## ResponseFor200 + +### Description +Output string + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[String](../../components/schema/string.md) | str | str | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://petstore.swagger.io:80/v2 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | petstore server +1 | [Server1](../../../servers/server_1.md) | The local server +2 | [Server2](../../../servers/server_2.md) | staging server with no variables + +## Code Sample + +```python +import petstore_api +from petstore_api.configurations import api_configuration +from petstore_api.apis.tags import fake_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = fake_api.FakeApi(api_client) + + # example passing only optional values + body = string.String("string_example") + try: + api_response = api_instance.string( + body=body, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->string: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to FakeApi API]](../../apis/tags/fake_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/docs/paths/fake_response_without_schema/get.md b/samples/openapi3/client/petstore/python/docs/paths/fake_response_without_schema/get.md new file mode 100644 index 00000000000..bdbc5a9a9b0 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/paths/fake_response_without_schema/get.md @@ -0,0 +1,98 @@ +petstore_api.paths.fake_response_without_schema.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| response_without_schema | [FakeApi](../../apis/tags/fake_api.md) | This api is only for tag=fake | +| get | ApiForGet | This api is only for this endpoint | +| get | FakeResponseWithoutSchema | This api is only for path=/fake/responseWithoutSchema | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Summary | receives a response without schema | +| Path | "/fake/responseWithoutSchema" | +| HTTP Method | get | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", "application/xml", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | contents without schema definition, multiple content types + +## ResponseFor200 + +### Description +contents without schema definition, multiple content types + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | Unset | body was not defined | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | no schema defined +"application/xml" | no schema defined + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://petstore.swagger.io:80/v2 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | petstore server +1 | [Server1](../../../servers/server_1.md) | The local server +2 | [Server2](../../../servers/server_2.md) | staging server with no variables + +## Code Sample + +```python +import petstore_api +from petstore_api.configurations import api_configuration +from petstore_api.apis.tags import fake_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = fake_api.FakeApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + # receives a response without schema + api_response = api_instance.response_without_schema() + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->response_without_schema: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to FakeApi API]](../../apis/tags/fake_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/docs/paths/fake_test_query_paramters/put.md b/samples/openapi3/client/petstore/python/docs/paths/fake_test_query_paramters/put.md new file mode 100644 index 00000000000..396069c0c34 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/paths/fake_test_query_paramters/put.md @@ -0,0 +1,193 @@ +petstore_api.paths.fake_test_query_paramters.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| query_parameter_collection_format | [FakeApi](../../apis/tags/fake_api.md) | This api is only for tag=fake | +| put | ApiForPut | This api is only for this endpoint | +| put | FakeTestQueryParamters | This api is only for path=/fake/test-query-paramters | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Description | To test the collection format in query parameters | +| Path | "/fake/test-query-paramters" | +| HTTP Method | put | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[query_params](#query_params) | [RequestQueryParameters.Params](#requestqueryparametersparams), dict | | +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### query_params +#### RequestQueryParameters.Params +This is a TypedDict + +Key | Input Type | Description | Notes +------------- | ------------- | ------------- | ------------- +pipe | [Parameter0.schema](#parameter0-schema), list, tuple | | +ioutil | [Parameter1.schema](#parameter1-schema), list, tuple | | +http | [Parameter2.schema](#parameter2-schema), list, tuple | | +url | [Parameter3.schema](#parameter3-schema), list, tuple | | +context | [Parameter4.schema](#parameter4-schema), list, tuple | | +refParam | [Parameter5.schema](#parameter5-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | | + + +#### Parameter0 + +##### Parameter0 Schema + +###### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +list, tuple | tuple | | + +###### List Items +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +items | str | str | | + +#### Parameter1 + +##### Parameter1 Schema + +###### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +list, tuple | tuple | | + +###### List Items +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +items | str | str | | + +#### Parameter2 + +##### Parameter2 Schema + +###### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +list, tuple | tuple | | + +###### List Items +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +items | str | str | | + +#### Parameter3 + +##### Parameter3 Schema + +###### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +list, tuple | tuple | | + +###### List Items +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +items | str | str | | + +#### Parameter4 + +##### Parameter4 Schema + +###### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +list, tuple | tuple | | + +###### List Items +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +items | str | str | | + +#### Parameter5 + +##### Parameter5 Schema + +###### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[StringWithValidation](../../components/schema/string_with_validation.md) | str | str | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [SuccessDescriptionOnly.response_cls](../../components/responses/response_success_description_only.md#response_success_description_onlyresponse_cls) | Success + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://petstore.swagger.io:80/v2 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | petstore server +1 | [Server1](../../../servers/server_1.md) | The local server +2 | [Server2](../../../servers/server_2.md) | staging server with no variables + +## Code Sample + +```python +import petstore_api +from petstore_api.configurations import api_configuration +from petstore_api.apis.tags import fake_api +from petstore_api.paths.fake_test_query_paramters.put import operation +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = fake_api.FakeApi(api_client) + + # example passing only required values which don't have defaults set + query_params: operation.RequestQueryParameters.Params = { + 'pipe': [ + "pipe_example" + ], + 'ioutil': [ + "ioutil_example" + ], + 'http': [ + "http_example" + ], + 'url': [ + "url_example" + ], + 'context': [ + "context_example" + ], + 'refParam': string_with_validation.StringWithValidation("refParam_example"), + } + try: + api_response = api_instance.query_parameter_collection_format( + query_params=query_params, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->query_parameter_collection_format: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to FakeApi API]](../../apis/tags/fake_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/docs/paths/fake_upload_download_file/post.md b/samples/openapi3/client/petstore/python/docs/paths/fake_upload_download_file/post.md new file mode 100644 index 00000000000..dff03f573f6 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/paths/fake_upload_download_file/post.md @@ -0,0 +1,130 @@ +petstore_api.paths.fake_upload_download_file.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| upload_download_file | [FakeApi](../../apis/tags/fake_api.md) | This api is only for tag=fake | +| post | ApiForPost | This api is only for this endpoint | +| post | FakeUploadDownloadFile | This api is only for path=/fake/uploadDownloadFile | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Summary | uploads a file and downloads a file using application/octet-stream | +| Path | "/fake/uploadDownloadFile" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_octet_stream.schema](#RequestBody-content-applicationoctetstream-schema), bytes, io.FileIO, io.BufferedReader] | required | +content_type | str | optional, default is 'application/octet-stream' | Selects the schema and serialization of the request body +accept_content_types | typing.Tuple[str] | default is ("application/octet-stream", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/octet-stream" | [content.application_octet_stream.Schema](#requestbody-content-applicationoctetstream-schema) + +#### RequestBody content ApplicationOctetStream Schema + +##### Description +file to upload + +##### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +bytes, io.FileIO, io.BufferedReader | bytes, io.FileIO | file to upload | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | successful operation + +## ResponseFor200 + +### Description +successful operation + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_octet_stream.schema](#responsefor200-content-applicationoctetstream-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/octet-stream" | [content.application_octet_stream.Schema](#responsefor200-content-applicationoctetstream-schema) + +### Body Details +#### ResponseFor200 content ApplicationOctetStream Schema + +##### Description +file to download + +##### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +bytes, io.FileIO, io.BufferedReader | bytes, io.FileIO | file to download | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://petstore.swagger.io:80/v2 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | petstore server +1 | [Server1](../../../servers/server_1.md) | The local server +2 | [Server2](../../../servers/server_2.md) | staging server with no variables + +## Code Sample + +```python +import petstore_api +from petstore_api.configurations import api_configuration +from petstore_api.apis.tags import fake_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = fake_api.FakeApi(api_client) + + # example passing only required values which don't have defaults set + body = open('/path/to/file', 'rb') + try: + # uploads a file and downloads a file using application/octet-stream + api_response = api_instance.upload_download_file( + body=body, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->upload_download_file: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to FakeApi API]](../../apis/tags/fake_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/docs/paths/fake_upload_file/post.md b/samples/openapi3/client/petstore/python/docs/paths/fake_upload_file/post.md new file mode 100644 index 00000000000..cff57bf920d --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/paths/fake_upload_file/post.md @@ -0,0 +1,134 @@ +petstore_api.paths.fake_upload_file.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| upload_file | [FakeApi](../../apis/tags/fake_api.md) | This api is only for tag=fake | +| post | ApiForPost | This api is only for this endpoint | +| post | FakeUploadFile | This api is only for path=/fake/uploadFile | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Summary | uploads a file using multipart/form-data | +| Path | "/fake/uploadFile" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.multipart_form_data.schema](#RequestBody-content-multipartformdata-schema), Unset, dict, frozendict.frozendict] | optional, default is unset | +content_type | str | optional, default is 'multipart/form-data' | Selects the schema and serialization of the request body +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"multipart/form-data" | [content.multipart_form_data.Schema](#requestbody-content-multipartformdata-schema) + +#### RequestBody content MultipartFormData Schema + +##### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +##### Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**file** | bytes, io.FileIO, io.BufferedReader | bytes, io.FileIO | file to upload | +**additionalMetadata** | str | str | Additional data to pass to server | [optional] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | successful operation + +## ResponseFor200 + +### Description +successful operation + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[ApiResponse](../../components/schema/api_response.md) | dict, frozendict.frozendict | frozendict.frozendict | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://petstore.swagger.io:80/v2 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | petstore server +1 | [Server1](../../../servers/server_1.md) | The local server +2 | [Server2](../../../servers/server_2.md) | staging server with no variables + +## Code Sample + +```python +import petstore_api +from petstore_api.configurations import api_configuration +from petstore_api.apis.tags import fake_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = fake_api.FakeApi(api_client) + + # example passing only optional values + body = dict( + additional_metadata="additional_metadata_example", + file=open('/path/to/file', 'rb'), + ) + try: + # uploads a file using multipart/form-data + api_response = api_instance.upload_file( + body=body, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->upload_file: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to FakeApi API]](../../apis/tags/fake_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/docs/paths/fake_upload_files/post.md b/samples/openapi3/client/petstore/python/docs/paths/fake_upload_files/post.md new file mode 100644 index 00000000000..53e4d248912 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/paths/fake_upload_files/post.md @@ -0,0 +1,146 @@ +petstore_api.paths.fake_upload_files.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| upload_files | [FakeApi](../../apis/tags/fake_api.md) | This api is only for tag=fake | +| post | ApiForPost | This api is only for this endpoint | +| post | FakeUploadFiles | This api is only for path=/fake/uploadFiles | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Summary | uploads files using multipart/form-data | +| Path | "/fake/uploadFiles" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.multipart_form_data.schema](#RequestBody-content-multipartformdata-schema), Unset, dict, frozendict.frozendict] | optional, default is unset | +content_type | str | optional, default is 'multipart/form-data' | Selects the schema and serialization of the request body +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"multipart/form-data" | [content.multipart_form_data.Schema](#requestbody-content-multipartformdata-schema) + +#### RequestBody content MultipartFormData Schema + +##### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +##### Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**files** | list, tuple | [properties.Files](#requestbody-content-multipartformdata-schema-properties-files) | | [optional] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +#### RequestBody content MultipartFormData Schema properties Files + +##### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +list, tuple | tuple | | + +##### List Items +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +items | bytes, io.FileIO, io.BufferedReader | bytes, io.FileIO | | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | successful operation + +## ResponseFor200 + +### Description +successful operation + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[ApiResponse](../../components/schema/api_response.md) | dict, frozendict.frozendict | frozendict.frozendict | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://petstore.swagger.io:80/v2 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | petstore server +1 | [Server1](../../../servers/server_1.md) | The local server +2 | [Server2](../../../servers/server_2.md) | staging server with no variables + +## Code Sample + +```python +import petstore_api +from petstore_api.configurations import api_configuration +from petstore_api.apis.tags import fake_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = fake_api.FakeApi(api_client) + + # example passing only optional values + body = dict( + files=[ + open('/path/to/file', 'rb') + ], + ) + try: + # uploads files using multipart/form-data + api_response = api_instance.upload_files( + body=body, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->upload_files: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to FakeApi API]](../../apis/tags/fake_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/docs/paths/fake_wild_card_responses/get.md b/samples/openapi3/client/petstore/python/docs/paths/fake_wild_card_responses/get.md new file mode 100644 index 00000000000..8a05219793d --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/paths/fake_wild_card_responses/get.md @@ -0,0 +1,235 @@ +petstore_api.paths.fake_wild_card_responses.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| wild_card_responses | [FakeApi](../../apis/tags/fake_api.md) | This api is only for tag=fake | +| get | ApiForGet | This api is only for this endpoint | +| get | FakeWildCardResponses | This api is only for path=/fake/wildCardResponses | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Summary | operation with wildcard responses | +| Path | "/fake/wildCardResponses" | +| HTTP Method | get | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +1XX | [ResponseFor1XX.response_cls](#responsefor1xx-response_cls) | 1XX response +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success +2XX | [ResponseFor2XX.response_cls](#responsefor2xx-response_cls) | 2XX response +3XX | [ResponseFor3XX.response_cls](#responsefor3xx-response_cls) | 3XX response +4XX | [ResponseFor4XX.response_cls](#responsefor4xx-response_cls) | 4XX response +5XX | [ResponseFor5XX.response_cls](#responsefor5xx-response_cls) | 5XX response + +## ResponseFor1XX + +### Description +1XX response + +### ResponseFor1XX response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor1xx-body) | [content.application_json.schema](#responsefor1xx-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor1XX Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor1xx-content-applicationjson-schema) + +### Body Details +#### ResponseFor1XX content ApplicationJson Schema + +##### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## ResponseFor2XX + +### Description +2XX response + +### ResponseFor2XX response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor2xx-body) | [content.application_json.schema](#responsefor2xx-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor2XX Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor2xx-content-applicationjson-schema) + +### Body Details +#### ResponseFor2XX content ApplicationJson Schema + +##### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## ResponseFor3XX + +### Description +3XX response + +### ResponseFor3XX response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor3xx-body) | [content.application_json.schema](#responsefor3xx-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor3XX Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor3xx-content-applicationjson-schema) + +### Body Details +#### ResponseFor3XX content ApplicationJson Schema + +##### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## ResponseFor4XX + +### Description +4XX response + +### ResponseFor4XX response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor4xx-body) | [content.application_json.schema](#responsefor4xx-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor4XX Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor4xx-content-applicationjson-schema) + +### Body Details +#### ResponseFor4XX content ApplicationJson Schema + +##### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## ResponseFor5XX + +### Description +5XX response + +### ResponseFor5XX response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor5xx-body) | [content.application_json.schema](#responsefor5xx-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor5XX Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor5xx-content-applicationjson-schema) + +### Body Details +#### ResponseFor5XX content ApplicationJson Schema + +##### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://petstore.swagger.io:80/v2 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | petstore server +1 | [Server1](../../../servers/server_1.md) | The local server +2 | [Server2](../../../servers/server_2.md) | staging server with no variables + +## Code Sample + +```python +import petstore_api +from petstore_api.configurations import api_configuration +from petstore_api.apis.tags import fake_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = fake_api.FakeApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + # operation with wildcard responses + api_response = api_instance.wild_card_responses() + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->wild_card_responses: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to FakeApi API]](../../apis/tags/fake_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/docs/paths/foo/get.md b/samples/openapi3/client/petstore/python/docs/paths/foo/get.md new file mode 100644 index 00000000000..d44230891a2 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/paths/foo/get.md @@ -0,0 +1,123 @@ +petstore_api.paths.foo.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| foo_get | [DefaultApi](../../apis/tags/default_api.md) | This api is only for tag=default | +| get | ApiForGet | This api is only for this endpoint | +| get | Foo | This api is only for path=/foo | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Path | "/foo" | +| HTTP Method | get | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +default | [Default.response_cls](#default-response_cls) | response + +## Default + +### Description +response + +### Default response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#default-body) | [content.application_json.schema](#default-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### Default Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#default-content-applicationjson-schema) + +### Body Details +#### Default content ApplicationJson Schema + +##### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +##### Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**string** | [**Foo**](../../components/schema/foo.md), dict, frozendict.frozendict | [**Foo**](../../components/schema/foo.md) | | [optional] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are specific to this endpoint +- defaults to server_index=0, server.url = https://path-server-test.petstore.local/v2 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](#server0) | +1 | [Server1](#server1) | + +### Server0 + +#### Url +https://path-server-test.petstore.local/v2 + +### Server1 + +#### Url +https://petstore.swagger.io/{version} + +#### Variables +Key | Type | Description | Notes +--- | ---- | ----------- | ------ +**version** | str | | must be one of ["v1", "v2"] if omitted the client will use the default value of v1 + +## Code Sample + +```python +import petstore_api +from petstore_api.configurations import api_configuration +from petstore_api.apis.tags import default_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = default_api.DefaultApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.foo_get() + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling DefaultApi->foo_get: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to DefaultApi API]](../../apis/tags/default_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/docs/paths/pet/post.md b/samples/openapi3/client/petstore/python/docs/paths/pet/post.md new file mode 100644 index 00000000000..fdc1ef5d163 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/paths/pet/post.md @@ -0,0 +1,179 @@ +petstore_api.paths.pet.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| add_pet | [PetApi](../../apis/tags/pet_api.md) | This api is only for tag=pet | +| post | ApiForPost | This api is only for this endpoint | +| post | Pet | This api is only for path=/pet | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Security](#security) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Summary | Add a new pet to the store | +| Description | Add a new pet to the store | +| Path | "/pet" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[**body**](../../components/request_bodies/request_body_pet.md) | typing.Union[[Pet.content.application_json.schema](../../components/request_bodies/request_body_pet.md#content-applicationjson-schema), [Pet.content.application_xml.schema](../../components/request_bodies/request_body_pet.md#content-applicationxml-schema), dict, frozendict.frozendict] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [SuccessDescriptionOnly.response_cls](../../components/responses/response_success_description_only.md#response_success_description_onlyresponse_cls) | Success +405 | [ResponseFor405.response_cls](#responsefor405-response_cls) | Invalid input + +## ResponseFor405 + +### Description +Invalid input + +### ResponseFor405 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Security + +Set auth info by setting ApiConfiguration.security_scheme_info to a dict where the +key is the below security scheme quoted name, and the value is an instance of the linked +component security scheme class. +Select the security index by setting ApiConfiguration.security_index_info or by +passing in security_index into the endpoint method. +See how to do this in the code sample. +- these securities are specific to this to this endpoint + +| Security Index | Security Scheme to Scope Names | +| -------------- | ------------------------------ | +| 0 | ["api_key"](../../components/security_schemes/security_scheme_api_key.md) []
    | +| 1 | ["http_signature_test"](../../components/security_schemes/security_scheme_http_signature_test.md) []
    | +| 2 | ["petstore_auth"](../../components/security_schemes/security_scheme_petstore_auth.md) [write:pets, read:pets]
    | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://petstore.swagger.io:80/v2 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | petstore server +1 | [Server1](../../../servers/server_1.md) | The local server +2 | [Server2](../../../servers/server_2.md) | staging server with no variables + +## Code Sample + +```python +import petstore_api +from petstore_api.configurations import api_configuration +from petstore_api.apis.tags import pet_api +from pprint import pprint +# security_index 0 +from petstore_api.components.security_schemes import security_scheme_api_key +# security_index 1 +from petstore_api.components.security_schemes import security_scheme_http_signature_test +# security_index 2 +from petstore_api.components.security_schemes import security_scheme_petstore_auth + +# security_scheme_info for security_index 0 +security_scheme_info: api_configuration.SecuritySchemeInfo = { + "api_key": security_scheme_api_key.ApiKey( + api_key='sampleApiKeyValue' + ), +} + + +# security_scheme_info for security_index 1 +security_scheme_info: api_configuration.SecuritySchemeInfo = { + "http_signature_test": security_scheme_http_signature_test.HttpSignatureTest( + signing_info=petstore_api.signing.HttpSigningConfiguration( + key_id='my-key-id', + private_key_path='rsa.pem', + signing_scheme=petstore_api.signing.SCHEME_HS2019, + signing_algorithm=petstore_api.signing.ALGORITHM_RSASSA_PSS, + signed_headers=[ + petstore_api.signing.HEADER_REQUEST_TARGET, + petstore_api.signing.HEADER_CREATED, + petstore_api.signing.HEADER_EXPIRES, + petstore_api.signing.HEADER_HOST, + petstore_api.signing.HEADER_DATE, + petstore_api.signing.HEADER_DIGEST, + 'Content-Type', + 'User-Agent' + ], + signature_max_validity=datetime.timedelta(minutes=5) + ) + + ), +} + + +# security_scheme_info for security_index 2 +security_scheme_info: api_configuration.SecuritySchemeInfo = { + "petstore_auth": security_scheme_petstore_auth.PetstoreAuth( + ), +} + +used_configuration = api_configuration.ApiConfiguration( + security_scheme_info=security_scheme_info +) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = pet_api.PetApi(api_client) + + # example passing only required values which don't have defaults set + body = pet.Pet( + id=1, + category=category.Category( + id=1, + name="default-name", + ), + name="doggie", + photo_urls=[ + "photo_urls_example" + ], + tags=[ + tag.Tag( + id=1, + name="name_example", + ) + ], + status="available", + ) + try: + # Add a new pet to the store + api_response = api_instance.add_pet( + body=body, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->add_pet: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PetApi API]](../../apis/tags/pet_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/docs/paths/pet/put.md b/samples/openapi3/client/petstore/python/docs/paths/pet/put.md new file mode 100644 index 00000000000..a308d90a253 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/paths/pet/put.md @@ -0,0 +1,192 @@ +petstore_api.paths.pet.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| update_pet | [PetApi](../../apis/tags/pet_api.md) | This api is only for tag=pet | +| put | ApiForPut | This api is only for this endpoint | +| put | Pet | This api is only for path=/pet | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Security](#security) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Summary | Update an existing pet | +| Path | "/pet" | +| HTTP Method | put | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[**body**](../../components/request_bodies/request_body_pet.md) | typing.Union[[Pet.content.application_json.schema](../../components/request_bodies/request_body_pet.md#content-applicationjson-schema), [Pet.content.application_xml.schema](../../components/request_bodies/request_body_pet.md#content-applicationxml-schema), dict, frozendict.frozendict] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +400 | [ResponseFor400.response_cls](#responsefor400-response_cls) | Invalid ID supplied +404 | [ResponseFor404.response_cls](#responsefor404-response_cls) | Pet not found +405 | [ResponseFor405.response_cls](#responsefor405-response_cls) | Validation exception + +## ResponseFor400 + +### Description +Invalid ID supplied + +### ResponseFor400 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## ResponseFor404 + +### Description +Pet not found + +### ResponseFor404 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## ResponseFor405 + +### Description +Validation exception + +### ResponseFor405 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Security + +Set auth info by setting ApiConfiguration.security_scheme_info to a dict where the +key is the below security scheme quoted name, and the value is an instance of the linked +component security scheme class. +Select the security index by setting ApiConfiguration.security_index_info or by +passing in security_index into the endpoint method. +See how to do this in the code sample. +- these securities are specific to this to this endpoint + +| Security Index | Security Scheme to Scope Names | +| -------------- | ------------------------------ | +| 0 | ["http_signature_test"](../../components/security_schemes/security_scheme_http_signature_test.md) []
    | +| 1 | ["petstore_auth"](../../components/security_schemes/security_scheme_petstore_auth.md) [write:pets, read:pets]
    | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://petstore.swagger.io:80/v2 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | petstore server +1 | [Server1](../../../servers/server_1.md) | The local server +2 | [Server2](../../../servers/server_2.md) | staging server with no variables + +## Code Sample + +```python +import petstore_api +from petstore_api.configurations import api_configuration +from petstore_api.apis.tags import pet_api +from pprint import pprint +# security_index 0 +from petstore_api.components.security_schemes import security_scheme_http_signature_test +# security_index 1 +from petstore_api.components.security_schemes import security_scheme_petstore_auth + +# security_scheme_info for security_index 0 +security_scheme_info: api_configuration.SecuritySchemeInfo = { + "http_signature_test": security_scheme_http_signature_test.HttpSignatureTest( + signing_info=petstore_api.signing.HttpSigningConfiguration( + key_id='my-key-id', + private_key_path='rsa.pem', + signing_scheme=petstore_api.signing.SCHEME_HS2019, + signing_algorithm=petstore_api.signing.ALGORITHM_RSASSA_PSS, + signed_headers=[ + petstore_api.signing.HEADER_REQUEST_TARGET, + petstore_api.signing.HEADER_CREATED, + petstore_api.signing.HEADER_EXPIRES, + petstore_api.signing.HEADER_HOST, + petstore_api.signing.HEADER_DATE, + petstore_api.signing.HEADER_DIGEST, + 'Content-Type', + 'User-Agent' + ], + signature_max_validity=datetime.timedelta(minutes=5) + ) + + ), +} + + +# security_scheme_info for security_index 1 +security_scheme_info: api_configuration.SecuritySchemeInfo = { + "petstore_auth": security_scheme_petstore_auth.PetstoreAuth( + ), +} + +used_configuration = api_configuration.ApiConfiguration( + security_scheme_info=security_scheme_info +) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = pet_api.PetApi(api_client) + + # example passing only required values which don't have defaults set + body = pet.Pet( + id=1, + category=category.Category( + id=1, + name="default-name", + ), + name="doggie", + photo_urls=[ + "photo_urls_example" + ], + tags=[ + tag.Tag( + id=1, + name="name_example", + ) + ], + status="available", + ) + try: + # Update an existing pet + api_response = api_instance.update_pet( + body=body, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->update_pet: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PetApi API]](../../apis/tags/pet_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/docs/paths/pet_find_by_status/get.md b/samples/openapi3/client/petstore/python/docs/paths/pet_find_by_status/get.md new file mode 100644 index 00000000000..be4403d9294 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/paths/pet_find_by_status/get.md @@ -0,0 +1,206 @@ +petstore_api.paths.pet_find_by_status.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| find_pets_by_status | [PetApi](../../apis/tags/pet_api.md) | This api is only for tag=pet | +| get | ApiForGet | This api is only for this endpoint | +| get | PetFindByStatus | This api is only for path=/pet/findByStatus | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Security](#security) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Summary | Finds Pets by status | +| Description | Multiple status values can be provided with comma separated strings | +| Path | "/pet/findByStatus" | +| HTTP Method | get | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[query_params](#query_params) | [RequestQueryParameters.Params](#requestqueryparametersparams), dict | | +accept_content_types | typing.Tuple[str] | default is ("application/xml", "application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### query_params +#### RequestQueryParameters.Params +This is a TypedDict + +Key | Input Type | Description | Notes +------------- | ------------- | ------------- | ------------- +status | [Parameter0.schema](#parameter0-schema), list, tuple | | + + +#### Parameter0 + +##### Description +Status values that need to be considered for filter + +##### Parameter0 Schema + +###### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +list, tuple | tuple | | + +###### List Items +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +items | str | str | | must be one of ["available", "pending", "sold"] if omitted the server will use the default value of available + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [SuccessfulXmlAndJsonArrayOfPet.response_cls](../../components/responses/response_successful_xml_and_json_array_of_pet.md#response_successful_xml_and_json_array_of_petresponse_cls) | successful operation, multiple content types +400 | [ResponseFor400.response_cls](#responsefor400-response_cls) | Invalid status value + +## ResponseFor400 + +### Description +Invalid status value + +### ResponseFor400 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Security + +Set auth info by setting ApiConfiguration.security_scheme_info to a dict where the +key is the below security scheme quoted name, and the value is an instance of the linked +component security scheme class. +Select the security index by setting ApiConfiguration.security_index_info or by +passing in security_index into the endpoint method. +See how to do this in the code sample. +- these securities are specific to this to this endpoint + +| Security Index | Security Scheme to Scope Names | +| -------------- | ------------------------------ | +| 0 | ["api_key"](../../components/security_schemes/security_scheme_api_key.md) []
    | +| 1 | ["http_signature_test"](../../components/security_schemes/security_scheme_http_signature_test.md) []
    | +| 2 | ["petstore_auth"](../../components/security_schemes/security_scheme_petstore_auth.md) [write:pets, read:pets]
    | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are specific to this "/pet/findByStatus" path +- defaults to server_index=0, server.url = https://path-server-test.petstore.local/v2 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](#server0) | +1 | [Server1](#server1) | + +### Server0 + +#### Url +https://path-server-test.petstore.local/v2 +### Server1 + +#### Url +https://petstore.swagger.io/{version} + +#### Variables +Key | Type | Description | Notes +--- | ---- | ----------- | ------ +**version** | str | | must be one of ["v1", "v2"] if omitted the client will use the default value of v1 + +## Code Sample + +```python +import petstore_api +from petstore_api.configurations import api_configuration +from petstore_api.apis.tags import pet_api +from petstore_api.paths.pet_find_by_status.get import operation +from pprint import pprint +# security_index 0 +from petstore_api.components.security_schemes import security_scheme_api_key +# security_index 1 +from petstore_api.components.security_schemes import security_scheme_http_signature_test +# security_index 2 +from petstore_api.components.security_schemes import security_scheme_petstore_auth + +# security_scheme_info for security_index 0 +security_scheme_info: api_configuration.SecuritySchemeInfo = { + "api_key": security_scheme_api_key.ApiKey( + api_key='sampleApiKeyValue' + ), +} + + +# security_scheme_info for security_index 1 +security_scheme_info: api_configuration.SecuritySchemeInfo = { + "http_signature_test": security_scheme_http_signature_test.HttpSignatureTest( + signing_info=petstore_api.signing.HttpSigningConfiguration( + key_id='my-key-id', + private_key_path='rsa.pem', + signing_scheme=petstore_api.signing.SCHEME_HS2019, + signing_algorithm=petstore_api.signing.ALGORITHM_RSASSA_PSS, + signed_headers=[ + petstore_api.signing.HEADER_REQUEST_TARGET, + petstore_api.signing.HEADER_CREATED, + petstore_api.signing.HEADER_EXPIRES, + petstore_api.signing.HEADER_HOST, + petstore_api.signing.HEADER_DATE, + petstore_api.signing.HEADER_DIGEST, + 'Content-Type', + 'User-Agent' + ], + signature_max_validity=datetime.timedelta(minutes=5) + ) + + ), +} + + +# security_scheme_info for security_index 2 +security_scheme_info: api_configuration.SecuritySchemeInfo = { + "petstore_auth": security_scheme_petstore_auth.PetstoreAuth( + ), +} + +used_configuration = api_configuration.ApiConfiguration( + security_scheme_info=security_scheme_info +) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = pet_api.PetApi(api_client) + + # example passing only required values which don't have defaults set + query_params: operation.RequestQueryParameters.Params = { + 'status': [ + "available" + ], + } + try: + # Finds Pets by status + api_response = api_instance.find_pets_by_status( + query_params=query_params, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->find_pets_by_status: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PetApi API]](../../apis/tags/pet_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/docs/paths/pet_find_by_tags/get.md b/samples/openapi3/client/petstore/python/docs/paths/pet_find_by_tags/get.md new file mode 100644 index 00000000000..d2e6e55400d --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/paths/pet_find_by_tags/get.md @@ -0,0 +1,181 @@ +petstore_api.paths.pet_find_by_tags.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| find_pets_by_tags | [PetApi](../../apis/tags/pet_api.md) | This api is only for tag=pet | +| get | ApiForGet | This api is only for this endpoint | +| get | PetFindByTags | This api is only for path=/pet/findByTags | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Security](#security) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Summary | Finds Pets by tags | +| Description | Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. | +| Path | "/pet/findByTags" | +| HTTP Method | get | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[query_params](#query_params) | [RequestQueryParameters.Params](#requestqueryparametersparams), dict | | +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### query_params +#### RequestQueryParameters.Params +This is a TypedDict + +Key | Input Type | Description | Notes +------------- | ------------- | ------------- | ------------- +tags | [Parameter0.schema](#parameter0-schema), list, tuple | | + + +#### Parameter0 + +##### Description +Tags to filter by + +##### Parameter0 Schema + +###### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +list, tuple | tuple | | + +###### List Items +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +items | str | str | | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [RefSuccessfulXmlAndJsonArrayOfPet.response_cls](../../components/responses/response_ref_successful_xml_and_json_array_of_pet.md#response_ref_successful_xml_and_json_array_of_petresponse_cls) | successful operation, multiple content types +400 | [ResponseFor400.response_cls](#responsefor400-response_cls) | Invalid tag value + +## ResponseFor400 + +### Description +Invalid tag value + +### ResponseFor400 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Security + +Set auth info by setting ApiConfiguration.security_scheme_info to a dict where the +key is the below security scheme quoted name, and the value is an instance of the linked +component security scheme class. +Select the security index by setting ApiConfiguration.security_index_info or by +passing in security_index into the endpoint method. +See how to do this in the code sample. +- these securities are specific to this to this endpoint + +| Security Index | Security Scheme to Scope Names | +| -------------- | ------------------------------ | +| 0 | ["http_signature_test"](../../components/security_schemes/security_scheme_http_signature_test.md) []
    | +| 1 | ["petstore_auth"](../../components/security_schemes/security_scheme_petstore_auth.md) [write:pets, read:pets]
    | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://petstore.swagger.io:80/v2 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | petstore server +1 | [Server1](../../../servers/server_1.md) | The local server +2 | [Server2](../../../servers/server_2.md) | staging server with no variables + +## Code Sample + +```python +import petstore_api +from petstore_api.configurations import api_configuration +from petstore_api.apis.tags import pet_api +from petstore_api.paths.pet_find_by_tags.get import operation +from pprint import pprint +# security_index 0 +from petstore_api.components.security_schemes import security_scheme_http_signature_test +# security_index 1 +from petstore_api.components.security_schemes import security_scheme_petstore_auth + +# security_scheme_info for security_index 0 +security_scheme_info: api_configuration.SecuritySchemeInfo = { + "http_signature_test": security_scheme_http_signature_test.HttpSignatureTest( + signing_info=petstore_api.signing.HttpSigningConfiguration( + key_id='my-key-id', + private_key_path='rsa.pem', + signing_scheme=petstore_api.signing.SCHEME_HS2019, + signing_algorithm=petstore_api.signing.ALGORITHM_RSASSA_PSS, + signed_headers=[ + petstore_api.signing.HEADER_REQUEST_TARGET, + petstore_api.signing.HEADER_CREATED, + petstore_api.signing.HEADER_EXPIRES, + petstore_api.signing.HEADER_HOST, + petstore_api.signing.HEADER_DATE, + petstore_api.signing.HEADER_DIGEST, + 'Content-Type', + 'User-Agent' + ], + signature_max_validity=datetime.timedelta(minutes=5) + ) + + ), +} + + +# security_scheme_info for security_index 1 +security_scheme_info: api_configuration.SecuritySchemeInfo = { + "petstore_auth": security_scheme_petstore_auth.PetstoreAuth( + ), +} + +used_configuration = api_configuration.ApiConfiguration( + security_scheme_info=security_scheme_info +) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = pet_api.PetApi(api_client) + + # example passing only required values which don't have defaults set + query_params: operation.RequestQueryParameters.Params = { + 'tags': [ + "tags_example" + ], + } + try: + # Finds Pets by tags + api_response = api_instance.find_pets_by_tags( + query_params=query_params, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->find_pets_by_tags: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PetApi API]](../../apis/tags/pet_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/docs/paths/pet_pet_id/delete.md b/samples/openapi3/client/petstore/python/docs/paths/pet_pet_id/delete.md new file mode 100644 index 00000000000..e32ba8b5881 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/paths/pet_pet_id/delete.md @@ -0,0 +1,194 @@ +petstore_api.paths.pet_pet_id.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| delete_pet | [PetApi](../../apis/tags/pet_api.md) | This api is only for tag=pet | +| delete | ApiForDelete | This api is only for this endpoint | +| delete | PetPetId | This api is only for path=/pet/{petId} | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Security](#security) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Summary | Deletes a pet | +| Path | "/pet/{petId}" | +| HTTP Method | delete | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[header_params](#header_params) | [RequestHeaderParameters.Params](#requestheaderparametersparams), dict | | +[path_params](#path_params) | [RequestPathParameters.Params](#requestpathparametersparams), dict | | +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### header_params +#### RequestHeaderParameters.Params +This is a TypedDict + +Key | Input Type | Description | Notes +------------- | ------------- | ------------- | ------------- +api_key | [Parameter0.schema](#parameter0-schema), str | | optional + + +#### Parameter0 + +##### Parameter0 Schema + +###### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str | str | | + +### path_params +#### RequestPathParameters.Params +This is a TypedDict + +Key | Input Type | Description | Notes +------------- | ------------- | ------------- | ------------- +petId | [Parameter1.schema](#parameter1-schema), decimal.Decimal, int | | + + +#### Parameter1 + +##### Description +Pet id to delete + +##### Parameter1 Schema + +###### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +decimal.Decimal, int | decimal.Decimal | | value must be a 64 bit integer + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +400 | [ResponseFor400.response_cls](#responsefor400-response_cls) | Invalid pet value + +## ResponseFor400 + +### Description +Invalid pet value + +### ResponseFor400 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Security + +Set auth info by setting ApiConfiguration.security_scheme_info to a dict where the +key is the below security scheme quoted name, and the value is an instance of the linked +component security scheme class. +Select the security index by setting ApiConfiguration.security_index_info or by +passing in security_index into the endpoint method. +See how to do this in the code sample. +- these securities are specific to this to this endpoint + +| Security Index | Security Scheme to Scope Names | +| -------------- | ------------------------------ | +| 0 | ["api_key"](../../components/security_schemes/security_scheme_api_key.md) []
    | +| 1 | ["petstore_auth"](../../components/security_schemes/security_scheme_petstore_auth.md) [write:pets, read:pets]
    | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://petstore.swagger.io:80/v2 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | petstore server +1 | [Server1](../../../servers/server_1.md) | The local server +2 | [Server2](../../../servers/server_2.md) | staging server with no variables + +## Code Sample + +```python +import petstore_api +from petstore_api.configurations import api_configuration +from petstore_api.apis.tags import pet_api +from petstore_api.paths.pet_pet_id.delete import operation +from pprint import pprint +# security_index 0 +from petstore_api.components.security_schemes import security_scheme_api_key +# security_index 1 +from petstore_api.components.security_schemes import security_scheme_petstore_auth + +# security_scheme_info for security_index 0 +security_scheme_info: api_configuration.SecuritySchemeInfo = { + "api_key": security_scheme_api_key.ApiKey( + api_key='sampleApiKeyValue' + ), +} + + +# security_scheme_info for security_index 1 +security_scheme_info: api_configuration.SecuritySchemeInfo = { + "petstore_auth": security_scheme_petstore_auth.PetstoreAuth( + ), +} + +used_configuration = api_configuration.ApiConfiguration( + security_scheme_info=security_scheme_info +) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = pet_api.PetApi(api_client) + + # example passing only required values which don't have defaults set + path_params: operation.RequestPathParameters.Params = { + 'petId': 1, + } + header_params: operation.RequestHeaderParameters.Params = { + } + try: + # Deletes a pet + api_response = api_instance.delete_pet( + path_params=path_params, + header_params=header_params, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->delete_pet: %s\n" % e) + + # example passing only optional values + path_params = { + 'petId': 1, + } + header_params: operation.RequestHeaderParameters.Params = { + 'api_key': "api_key_example", + } + try: + # Deletes a pet + api_response = api_instance.delete_pet( + path_params=path_params, + header_params=header_params, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->delete_pet: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PetApi API]](../../apis/tags/pet_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/docs/paths/pet_pet_id/get.md b/samples/openapi3/client/petstore/python/docs/paths/pet_pet_id/get.md new file mode 100644 index 00000000000..c1c422e13c4 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/paths/pet_pet_id/get.md @@ -0,0 +1,193 @@ +petstore_api.paths.pet_pet_id.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| get_pet_by_id | [PetApi](../../apis/tags/pet_api.md) | This api is only for tag=pet | +| get | ApiForGet | This api is only for this endpoint | +| get | PetPetId | This api is only for path=/pet/{petId} | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Security](#security) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Summary | Find pet by ID | +| Description | Returns a single pet | +| Path | "/pet/{petId}" | +| HTTP Method | get | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[path_params](#path_params) | [RequestPathParameters.Params](#requestpathparametersparams), dict | | +accept_content_types | typing.Tuple[str] | default is ("application/xml", "application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### path_params +#### RequestPathParameters.Params +This is a TypedDict + +Key | Input Type | Description | Notes +------------- | ------------- | ------------- | ------------- +petId | [Parameter0.schema](#parameter0-schema), decimal.Decimal, int | | + + +#### Parameter0 + +##### Description +ID of pet to return + +##### Parameter0 Schema + +###### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +decimal.Decimal, int | decimal.Decimal | | value must be a 64 bit integer + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | successful operation +400 | [ResponseFor400.response_cls](#responsefor400-response_cls) | Invalid ID supplied +404 | [ResponseFor404.response_cls](#responsefor404-response_cls) | Pet not found + +## ResponseFor200 + +### Description +successful operation + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | typing.Union[[content.application_xml.schema](#responsefor200-content-applicationxml-schema), [content.application_json.schema](#responsefor200-content-applicationjson-schema)] | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/xml" | [content.application_xml.Schema](#responsefor200-content-applicationxml-schema) +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationXml Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[Pet](../../components/schema/pet.md) | dict, frozendict.frozendict | frozendict.frozendict | +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[RefPet](../../components/schema/ref_pet.md) | dict, frozendict.frozendict | frozendict.frozendict | + +## ResponseFor400 + +### Description +Invalid ID supplied + +### ResponseFor400 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## ResponseFor404 + +### Description +Pet not found + +### ResponseFor404 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Security + +Set auth info by setting ApiConfiguration.security_scheme_info to a dict where the +key is the below security scheme quoted name, and the value is an instance of the linked +component security scheme class. +Select the security index by setting ApiConfiguration.security_index_info or by +passing in security_index into the endpoint method. +See how to do this in the code sample. +- these securities are specific to this to this endpoint + +| Security Index | Security Scheme to Scope Names | +| -------------- | ------------------------------ | +| 0 | ["api_key"](../../components/security_schemes/security_scheme_api_key.md) []
    | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://petstore.swagger.io:80/v2 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | petstore server +1 | [Server1](../../../servers/server_1.md) | The local server +2 | [Server2](../../../servers/server_2.md) | staging server with no variables + +## Code Sample + +```python +import petstore_api +from petstore_api.configurations import api_configuration +from petstore_api.apis.tags import pet_api +from petstore_api.paths.pet_pet_id.get import operation +from pprint import pprint +# security_index 0 +from petstore_api.components.security_schemes import security_scheme_api_key + +# security_scheme_info for security_index 0 +security_scheme_info: api_configuration.SecuritySchemeInfo = { + "api_key": security_scheme_api_key.ApiKey( + api_key='sampleApiKeyValue' + ), +} + +used_configuration = api_configuration.ApiConfiguration( + security_scheme_info=security_scheme_info +) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = pet_api.PetApi(api_client) + + # example passing only required values which don't have defaults set + path_params: operation.RequestPathParameters.Params = { + 'petId': 1, + } + try: + # Find pet by ID + api_response = api_instance.get_pet_by_id( + path_params=path_params, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->get_pet_by_id: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PetApi API]](../../apis/tags/pet_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/docs/paths/pet_pet_id/post.md b/samples/openapi3/client/petstore/python/docs/paths/pet_pet_id/post.md new file mode 100644 index 00000000000..631003e0942 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/paths/pet_pet_id/post.md @@ -0,0 +1,196 @@ +petstore_api.paths.pet_pet_id.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| update_pet_with_form | [PetApi](../../apis/tags/pet_api.md) | This api is only for tag=pet | +| post | ApiForPost | This api is only for this endpoint | +| post | PetPetId | This api is only for path=/pet/{petId} | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Security](#security) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Summary | Updates a pet in the store with form data | +| Path | "/pet/{petId}" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_x_www_form_urlencoded.schema](#RequestBody-content-applicationxwwwformurlencoded-schema), Unset, dict, frozendict.frozendict] | optional, default is unset | +[path_params](#path_params) | [RequestPathParameters.Params](#requestpathparametersparams), dict | | +content_type | str | optional, default is 'application/x-www-form-urlencoded' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/x-www-form-urlencoded" | [content.application_x_www_form_urlencoded.Schema](#requestbody-content-applicationxwwwformurlencoded-schema) + +#### RequestBody content ApplicationXWwwFormUrlencoded Schema + +##### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +##### Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**name** | str | str | Updated name of the pet | [optional] +**status** | str | str | Updated status of the pet | [optional] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +### path_params +#### RequestPathParameters.Params +This is a TypedDict + +Key | Input Type | Description | Notes +------------- | ------------- | ------------- | ------------- +petId | [Parameter0.schema](#parameter0-schema), decimal.Decimal, int | | + + +#### Parameter0 + +##### Description +ID of pet that needs to be updated + +##### Parameter0 Schema + +###### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +decimal.Decimal, int | decimal.Decimal | | value must be a 64 bit integer + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +405 | [ResponseFor405.response_cls](#responsefor405-response_cls) | Invalid input + +## ResponseFor405 + +### Description +Invalid input + +### ResponseFor405 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Security + +Set auth info by setting ApiConfiguration.security_scheme_info to a dict where the +key is the below security scheme quoted name, and the value is an instance of the linked +component security scheme class. +Select the security index by setting ApiConfiguration.security_index_info or by +passing in security_index into the endpoint method. +See how to do this in the code sample. +- these securities are specific to this to this endpoint + +| Security Index | Security Scheme to Scope Names | +| -------------- | ------------------------------ | +| 0 | ["api_key"](../../components/security_schemes/security_scheme_api_key.md) []
    | +| 1 | ["petstore_auth"](../../components/security_schemes/security_scheme_petstore_auth.md) [write:pets, read:pets]
    | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://petstore.swagger.io:80/v2 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | petstore server +1 | [Server1](../../../servers/server_1.md) | The local server +2 | [Server2](../../../servers/server_2.md) | staging server with no variables + +## Code Sample + +```python +import petstore_api +from petstore_api.configurations import api_configuration +from petstore_api.apis.tags import pet_api +from petstore_api.paths.pet_pet_id.post import operation +from pprint import pprint +# security_index 0 +from petstore_api.components.security_schemes import security_scheme_api_key +# security_index 1 +from petstore_api.components.security_schemes import security_scheme_petstore_auth + +# security_scheme_info for security_index 0 +security_scheme_info: api_configuration.SecuritySchemeInfo = { + "api_key": security_scheme_api_key.ApiKey( + api_key='sampleApiKeyValue' + ), +} + + +# security_scheme_info for security_index 1 +security_scheme_info: api_configuration.SecuritySchemeInfo = { + "petstore_auth": security_scheme_petstore_auth.PetstoreAuth( + ), +} + +used_configuration = api_configuration.ApiConfiguration( + security_scheme_info=security_scheme_info +) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = pet_api.PetApi(api_client) + + # example passing only required values which don't have defaults set + path_params: operation.RequestPathParameters.Params = { + 'petId': 1, + } + try: + # Updates a pet in the store with form data + api_response = api_instance.update_pet_with_form( + path_params=path_params, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->update_pet_with_form: %s\n" % e) + + # example passing only optional values + path_params = { + 'petId': 1, + } + body = dict( + name="name_example", + status="status_example", + ) + try: + # Updates a pet in the store with form data + api_response = api_instance.update_pet_with_form( + path_params=path_params, + body=body, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->update_pet_with_form: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PetApi API]](../../apis/tags/pet_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/docs/paths/pet_pet_id_upload_image/post.md b/samples/openapi3/client/petstore/python/docs/paths/pet_pet_id_upload_image/post.md new file mode 100644 index 00000000000..b44f8637500 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/paths/pet_pet_id_upload_image/post.md @@ -0,0 +1,174 @@ +petstore_api.paths.pet_pet_id_upload_image.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| upload_image | [PetApi](../../apis/tags/pet_api.md) | This api is only for tag=pet | +| post | ApiForPost | This api is only for this endpoint | +| post | PetPetIdUploadImage | This api is only for path=/pet/{petId}/uploadImage | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Security](#security) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Summary | uploads an image | +| Path | "/pet/{petId}/uploadImage" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.multipart_form_data.schema](#RequestBody-content-multipartformdata-schema), Unset, dict, frozendict.frozendict] | optional, default is unset | +[path_params](#path_params) | [RequestPathParameters.Params](#requestpathparametersparams), dict | | +content_type | str | optional, default is 'multipart/form-data' | Selects the schema and serialization of the request body +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"multipart/form-data" | [content.multipart_form_data.Schema](#requestbody-content-multipartformdata-schema) + +#### RequestBody content MultipartFormData Schema + +##### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict | frozendict.frozendict | | + +##### Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**additionalMetadata** | str | str | Additional data to pass to server | [optional] +**file** | bytes, io.FileIO, io.BufferedReader | bytes, io.FileIO | file to upload | [optional] +**any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] + +### path_params +#### RequestPathParameters.Params +This is a TypedDict + +Key | Input Type | Description | Notes +------------- | ------------- | ------------- | ------------- +petId | [Parameter0.schema](#parameter0-schema), decimal.Decimal, int | | + + +#### Parameter0 + +##### Description +ID of pet to update + +##### Parameter0 Schema + +###### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +decimal.Decimal, int | decimal.Decimal | | value must be a 64 bit integer + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [SuccessWithJsonApiResponse.response_cls](../../components/responses/response_success_with_json_api_response.md#response_success_with_json_api_responseresponse_cls) | successful operation + +## Security + +Set auth info by setting ApiConfiguration.security_scheme_info to a dict where the +key is the below security scheme quoted name, and the value is an instance of the linked +component security scheme class. +Select the security index by setting ApiConfiguration.security_index_info or by +passing in security_index into the endpoint method. +See how to do this in the code sample. +- these securities are specific to this to this endpoint + +| Security Index | Security Scheme to Scope Names | +| -------------- | ------------------------------ | +| 0 | ["petstore_auth"](../../components/security_schemes/security_scheme_petstore_auth.md) [write:pets, read:pets]
    | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://petstore.swagger.io:80/v2 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | petstore server +1 | [Server1](../../../servers/server_1.md) | The local server +2 | [Server2](../../../servers/server_2.md) | staging server with no variables + +## Code Sample + +```python +import petstore_api +from petstore_api.configurations import api_configuration +from petstore_api.apis.tags import pet_api +from petstore_api.paths.pet_pet_id_upload_image.post import operation +from pprint import pprint +# security_index 0 +from petstore_api.components.security_schemes import security_scheme_petstore_auth + +# security_scheme_info for security_index 0 +security_scheme_info: api_configuration.SecuritySchemeInfo = { + "petstore_auth": security_scheme_petstore_auth.PetstoreAuth( + ), +} + +used_configuration = api_configuration.ApiConfiguration( + security_scheme_info=security_scheme_info +) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = pet_api.PetApi(api_client) + + # example passing only required values which don't have defaults set + path_params: operation.RequestPathParameters.Params = { + 'petId': 1, + } + try: + # uploads an image + api_response = api_instance.upload_image( + path_params=path_params, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->upload_image: %s\n" % e) + + # example passing only optional values + path_params = { + 'petId': 1, + } + body = dict( + additional_metadata="additional_metadata_example", + file=open('/path/to/file', 'rb'), + ) + try: + # uploads an image + api_response = api_instance.upload_image( + path_params=path_params, + body=body, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->upload_image: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to PetApi API]](../../apis/tags/pet_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/docs/paths/store_inventory/get.md b/samples/openapi3/client/petstore/python/docs/paths/store_inventory/get.md new file mode 100644 index 00000000000..599f15fc1b6 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/paths/store_inventory/get.md @@ -0,0 +1,107 @@ +petstore_api.paths.store_inventory.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| get_inventory | [StoreApi](../../apis/tags/store_api.md) | This api is only for tag=store | +| get | ApiForGet | This api is only for this endpoint | +| get | StoreInventory | This api is only for path=/store/inventory | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Security](#security) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Summary | Returns pet inventories by status | +| Description | Returns a map of status codes to quantities | +| Path | "/store/inventory" | +| HTTP Method | get | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [SuccessInlineContentAndHeader.response_cls](../../components/responses/response_success_inline_content_and_header.md#response_success_inline_content_and_headerresponse_cls) | successful operation + +## Security + +Set auth info by setting ApiConfiguration.security_scheme_info to a dict where the +key is the below security scheme quoted name, and the value is an instance of the linked +component security scheme class. +Select the security index by setting ApiConfiguration.security_index_info or by +passing in security_index into the endpoint method. +See how to do this in the code sample. +- these securities are specific to this to this endpoint + +| Security Index | Security Scheme to Scope Names | +| -------------- | ------------------------------ | +| 0 | ["api_key"](../../components/security_schemes/security_scheme_api_key.md) []
    | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://petstore.swagger.io:80/v2 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | petstore server +1 | [Server1](../../../servers/server_1.md) | The local server +2 | [Server2](../../../servers/server_2.md) | staging server with no variables + +## Code Sample + +```python +import petstore_api +from petstore_api.configurations import api_configuration +from petstore_api.apis.tags import store_api +from pprint import pprint +# security_index 0 +from petstore_api.components.security_schemes import security_scheme_api_key + +# security_scheme_info for security_index 0 +security_scheme_info: api_configuration.SecuritySchemeInfo = { + "api_key": security_scheme_api_key.ApiKey( + api_key='sampleApiKeyValue' + ), +} + +used_configuration = api_configuration.ApiConfiguration( + security_scheme_info=security_scheme_info +) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = store_api.StoreApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + # Returns pet inventories by status + api_response = api_instance.get_inventory() + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling StoreApi->get_inventory: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to StoreApi API]](../../apis/tags/store_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/docs/paths/store_order/post.md b/samples/openapi3/client/petstore/python/docs/paths/store_order/post.md new file mode 100644 index 00000000000..ac8e03e8799 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/paths/store_order/post.md @@ -0,0 +1,154 @@ +petstore_api.paths.store_order.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| place_order | [StoreApi](../../apis/tags/store_api.md) | This api is only for tag=store | +| post | ApiForPost | This api is only for this endpoint | +| post | StoreOrder | This api is only for path=/store/order | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Summary | Place an order for a pet | +| Path | "/store/order" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +accept_content_types | typing.Tuple[str] | default is ("application/xml", "application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Description +order placed for purchasing the pet + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[Order](../../components/schema/order.md) | dict, frozendict.frozendict | frozendict.frozendict | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | successful operation +400 | [ResponseFor400.response_cls](#responsefor400-response_cls) | Invalid Order + +## ResponseFor200 + +### Description +successful operation + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | typing.Union[[content.application_xml.schema](#responsefor200-content-applicationxml-schema), [content.application_json.schema](#responsefor200-content-applicationjson-schema)] | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/xml" | [content.application_xml.Schema](#responsefor200-content-applicationxml-schema) +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationXml Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[Order](../../components/schema/order.md) | dict, frozendict.frozendict | frozendict.frozendict | +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[Order](../../components/schema/order.md) | dict, frozendict.frozendict | frozendict.frozendict | + +## ResponseFor400 + +### Description +Invalid Order + +### ResponseFor400 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://petstore.swagger.io:80/v2 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | petstore server +1 | [Server1](../../../servers/server_1.md) | The local server +2 | [Server2](../../../servers/server_2.md) | staging server with no variables + +## Code Sample + +```python +import petstore_api +from petstore_api.configurations import api_configuration +from petstore_api.apis.tags import store_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = store_api.StoreApi(api_client) + + # example passing only required values which don't have defaults set + body = order.Order( + id=1, + pet_id=1, + quantity=1, + ship_date="2020-02-02T20:20:20.000222Z", + status="placed", + complete=False, + ) + try: + # Place an order for a pet + api_response = api_instance.place_order( + body=body, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling StoreApi->place_order: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to StoreApi API]](../../apis/tags/store_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/docs/paths/store_order_order_id/delete.md b/samples/openapi3/client/petstore/python/docs/paths/store_order_order_id/delete.md new file mode 100644 index 00000000000..d1940363207 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/paths/store_order_order_id/delete.md @@ -0,0 +1,133 @@ +petstore_api.paths.store_order_order_id.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| delete_order | [StoreApi](../../apis/tags/store_api.md) | This api is only for tag=store | +| delete | ApiForDelete | This api is only for this endpoint | +| delete | StoreOrderOrderId | This api is only for path=/store/order/{order_id} | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Summary | Delete purchase order by ID | +| Description | For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors | +| Path | "/store/order/{order_id}" | +| HTTP Method | delete | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[path_params](#path_params) | [RequestPathParameters.Params](#requestpathparametersparams), dict | | +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### path_params +#### RequestPathParameters.Params +This is a TypedDict + +Key | Input Type | Description | Notes +------------- | ------------- | ------------- | ------------- +order_id | [Parameter0.schema](#parameter0-schema), str | | + + +#### Parameter0 + +##### Description +ID of the order that needs to be deleted + +##### Parameter0 Schema + +###### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str | str | | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +400 | [ResponseFor400.response_cls](#responsefor400-response_cls) | Invalid ID supplied +404 | [ResponseFor404.response_cls](#responsefor404-response_cls) | Order not found + +## ResponseFor400 + +### Description +Invalid ID supplied + +### ResponseFor400 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## ResponseFor404 + +### Description +Order not found + +### ResponseFor404 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://petstore.swagger.io:80/v2 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | petstore server +1 | [Server1](../../../servers/server_1.md) | The local server +2 | [Server2](../../../servers/server_2.md) | staging server with no variables + +## Code Sample + +```python +import petstore_api +from petstore_api.configurations import api_configuration +from petstore_api.apis.tags import store_api +from petstore_api.paths.store_order_order_id.delete import operation +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = store_api.StoreApi(api_client) + + # example passing only required values which don't have defaults set + path_params: operation.RequestPathParameters.Params = { + 'order_id': "order_id_example", + } + try: + # Delete purchase order by ID + api_response = api_instance.delete_order( + path_params=path_params, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling StoreApi->delete_order: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to StoreApi API]](../../apis/tags/store_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/docs/paths/store_order_order_id/get.md b/samples/openapi3/client/petstore/python/docs/paths/store_order_order_id/get.md new file mode 100644 index 00000000000..d58992d9dfe --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/paths/store_order_order_id/get.md @@ -0,0 +1,167 @@ +petstore_api.paths.store_order_order_id.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| get_order_by_id | [StoreApi](../../apis/tags/store_api.md) | This api is only for tag=store | +| get | ApiForGet | This api is only for this endpoint | +| get | StoreOrderOrderId | This api is only for path=/store/order/{order_id} | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Summary | Find purchase order by ID | +| Description | For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions | +| Path | "/store/order/{order_id}" | +| HTTP Method | get | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[path_params](#path_params) | [RequestPathParameters.Params](#requestpathparametersparams), dict | | +accept_content_types | typing.Tuple[str] | default is ("application/xml", "application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### path_params +#### RequestPathParameters.Params +This is a TypedDict + +Key | Input Type | Description | Notes +------------- | ------------- | ------------- | ------------- +order_id | [Parameter0.schema](#parameter0-schema), decimal.Decimal, int | | + + +#### Parameter0 + +##### Description +ID of pet that needs to be fetched + +##### Parameter0 Schema + +###### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +decimal.Decimal, int | decimal.Decimal | | value must be a 64 bit integer + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | successful operation +400 | [ResponseFor400.response_cls](#responsefor400-response_cls) | Invalid ID supplied +404 | [ResponseFor404.response_cls](#responsefor404-response_cls) | Order not found + +## ResponseFor200 + +### Description +successful operation + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | typing.Union[[content.application_xml.schema](#responsefor200-content-applicationxml-schema), [content.application_json.schema](#responsefor200-content-applicationjson-schema)] | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/xml" | [content.application_xml.Schema](#responsefor200-content-applicationxml-schema) +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationXml Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[Order](../../components/schema/order.md) | dict, frozendict.frozendict | frozendict.frozendict | +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[Order](../../components/schema/order.md) | dict, frozendict.frozendict | frozendict.frozendict | + +## ResponseFor400 + +### Description +Invalid ID supplied + +### ResponseFor400 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## ResponseFor404 + +### Description +Order not found + +### ResponseFor404 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://petstore.swagger.io:80/v2 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | petstore server +1 | [Server1](../../../servers/server_1.md) | The local server +2 | [Server2](../../../servers/server_2.md) | staging server with no variables + +## Code Sample + +```python +import petstore_api +from petstore_api.configurations import api_configuration +from petstore_api.apis.tags import store_api +from petstore_api.paths.store_order_order_id.get import operation +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = store_api.StoreApi(api_client) + + # example passing only required values which don't have defaults set + path_params: operation.RequestPathParameters.Params = { + 'order_id': 1, + } + try: + # Find purchase order by ID + api_response = api_instance.get_order_by_id( + path_params=path_params, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling StoreApi->get_order_by_id: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to StoreApi API]](../../apis/tags/store_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/docs/paths/user/post.md b/samples/openapi3/client/petstore/python/docs/paths/user/post.md new file mode 100644 index 00000000000..9d30c7dd171 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/paths/user/post.md @@ -0,0 +1,128 @@ +petstore_api.paths.user.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| create_user | [UserApi](../../apis/tags/user_api.md) | This api is only for tag=user | +| post | ApiForPost | This api is only for this endpoint | +| post | User | This api is only for path=/user | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Summary | Create user | +| Description | This can only be done by the logged in user. | +| Path | "/user" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Description +Created user object + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[User](../../components/schema/user.md) | dict, frozendict.frozendict | frozendict.frozendict | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +default | [Default.response_cls](#default-response_cls) | successful operation + +## Default + +### Description +successful operation + +### Default response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://petstore.swagger.io:80/v2 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | petstore server +1 | [Server1](../../../servers/server_1.md) | The local server +2 | [Server2](../../../servers/server_2.md) | staging server with no variables + +## Code Sample + +```python +import petstore_api +from petstore_api.configurations import api_configuration +from petstore_api.apis.tags import user_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = user_api.UserApi(api_client) + + # example passing only required values which don't have defaults set + body = user.User( + id=1, + username="username_example", + first_name="first_name_example", + last_name="last_name_example", + email="email_example", + password="password_example", + phone="phone_example", + user_status=1, + object_with_no_declared_props=dict(), + object_with_no_declared_props_nullable=dict(), + any_type_prop=None, + any_type_except_null_prop=None, + any_type_prop_nullable=None, + ) + try: + # Create user + api_response = api_instance.create_user( + body=body, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling UserApi->create_user: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to UserApi API]](../../apis/tags/user_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/docs/paths/user_create_with_array/post.md b/samples/openapi3/client/petstore/python/docs/paths/user_create_with_array/post.md new file mode 100644 index 00000000000..eb5a9d3c765 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/paths/user_create_with_array/post.md @@ -0,0 +1,112 @@ +petstore_api.paths.user_create_with_array.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| create_users_with_array_input | [UserApi](../../apis/tags/user_api.md) | This api is only for tag=user | +| post | ApiForPost | This api is only for this endpoint | +| post | UserCreateWithArray | This api is only for path=/user/createWithArray | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Summary | Creates list of users with given input array | +| Path | "/user/createWithArray" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[**body**](../../components/request_bodies/request_body_user_array.md) | typing.Union[[UserArray.content.application_json.schema](../../components/request_bodies/request_body_user_array.md#content-applicationjson-schema), list, tuple] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +default | [Default.response_cls](#default-response_cls) | successful operation + +## Default + +### Description +successful operation + +### Default response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://petstore.swagger.io:80/v2 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | petstore server +1 | [Server1](../../../servers/server_1.md) | The local server +2 | [Server2](../../../servers/server_2.md) | staging server with no variables + +## Code Sample + +```python +import petstore_api +from petstore_api.configurations import api_configuration +from petstore_api.apis.tags import user_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = user_api.UserApi(api_client) + + # example passing only required values which don't have defaults set + body = [ + user.User( + id=1, + username="username_example", + first_name="first_name_example", + last_name="last_name_example", + email="email_example", + password="password_example", + phone="phone_example", + user_status=1, + object_with_no_declared_props=dict(), + object_with_no_declared_props_nullable=dict(), + any_type_prop=None, + any_type_except_null_prop=None, + any_type_prop_nullable=None, + ) + ] + try: + # Creates list of users with given input array + api_response = api_instance.create_users_with_array_input( + body=body, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling UserApi->create_users_with_array_input: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to UserApi API]](../../apis/tags/user_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/docs/paths/user_create_with_list/post.md b/samples/openapi3/client/petstore/python/docs/paths/user_create_with_list/post.md new file mode 100644 index 00000000000..cf648150847 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/paths/user_create_with_list/post.md @@ -0,0 +1,112 @@ +petstore_api.paths.user_create_with_list.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| create_users_with_list_input | [UserApi](../../apis/tags/user_api.md) | This api is only for tag=user | +| post | ApiForPost | This api is only for this endpoint | +| post | UserCreateWithList | This api is only for path=/user/createWithList | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Summary | Creates list of users with given input array | +| Path | "/user/createWithList" | +| HTTP Method | post | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[**body**](../../components/request_bodies/request_body_ref_user_array.md) | typing.Union[[RefUserArray.content.application_json.schema](../../components/request_bodies/request_body_ref_user_array.md#content-applicationjson-schema), list, tuple] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +default | [Default.response_cls](#default-response_cls) | successful operation + +## Default + +### Description +successful operation + +### Default response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://petstore.swagger.io:80/v2 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | petstore server +1 | [Server1](../../../servers/server_1.md) | The local server +2 | [Server2](../../../servers/server_2.md) | staging server with no variables + +## Code Sample + +```python +import petstore_api +from petstore_api.configurations import api_configuration +from petstore_api.apis.tags import user_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = user_api.UserApi(api_client) + + # example passing only required values which don't have defaults set + body = [ + user.User( + id=1, + username="username_example", + first_name="first_name_example", + last_name="last_name_example", + email="email_example", + password="password_example", + phone="phone_example", + user_status=1, + object_with_no_declared_props=dict(), + object_with_no_declared_props_nullable=dict(), + any_type_prop=None, + any_type_except_null_prop=None, + any_type_prop_nullable=None, + ) + ] + try: + # Creates list of users with given input array + api_response = api_instance.create_users_with_list_input( + body=body, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling UserApi->create_users_with_list_input: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to UserApi API]](../../apis/tags/user_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/docs/paths/user_login/get.md b/samples/openapi3/client/petstore/python/docs/paths/user_login/get.md new file mode 100644 index 00000000000..10f5acb493b --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/paths/user_login/get.md @@ -0,0 +1,207 @@ +petstore_api.paths.user_login.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| login_user | [UserApi](../../apis/tags/user_api.md) | This api is only for tag=user | +| get | ApiForGet | This api is only for this endpoint | +| get | UserLogin | This api is only for path=/user/login | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Summary | Logs user into the system | +| Path | "/user/login" | +| HTTP Method | get | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[query_params](#query_params) | [RequestQueryParameters.Params](#requestqueryparametersparams), dict | | +accept_content_types | typing.Tuple[str] | default is ("application/xml", "application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### query_params +#### RequestQueryParameters.Params +This is a TypedDict + +Key | Input Type | Description | Notes +------------- | ------------- | ------------- | ------------- +username | [Parameter0.schema](#parameter0-schema), str | | +password | [Parameter1.schema](#parameter1-schema), str | | + + +#### Parameter0 + +##### Description +The user name for login + +##### Parameter0 Schema + +###### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str | str | | + +#### Parameter1 + +##### Description +The password for login in clear text + +##### Parameter1 Schema + +###### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str | str | | + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | successful operation +400 | [ResponseFor400.response_cls](#responsefor400-response_cls) | Invalid username/password supplied + +## ResponseFor200 + +### Description +successful operation + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | typing.Union[[content.application_xml.schema](#responsefor200-content-applicationxml-schema), [content.application_json.schema](#responsefor200-content-applicationjson-schema)] | | +[headers](#headers) | [Headers](#headers) | | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/xml" | [content.application_xml.Schema](#responsefor200-content-applicationxml-schema) +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Headers +Key | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- +ref-schema-header | [RefSchemaHeader.schema](../../../components/headers/header_ref_schema_header.md#schema) | | +X-Rate-Limit | [headers.header_x_rate_limit.content.application_json.schema](#responsefor200-headers-xratelimit-content-applicationjson-schema) | | +int32 | [Int32JsonContentTypeHeader.content.application_json.schema](../../../components/headers/header_int32_json_content_type_header.md#content-applicationjson-schema) | | +X-Expires-After | [headers.header_x_expires_after.schema](#responsefor200-headers-xexpiresafter-schema) | | optional +ref-content-schema-header | [RefContentSchemaHeader.content.application_json.schema](../../../components/headers/header_ref_content_schema_header.md#content-applicationjson-schema) | | +stringHeader | [RefStringHeader.schema](../../../components/headers/header_ref_string_header.md#schema) | | +numberHeader | [NumberHeader.schema](../../../components/headers/header_number_header.md#schema) | | optional + +### Body Details +#### ResponseFor200 content ApplicationXml Schema + +##### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str | str | | +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str | str | | + +### Header Details +#### ResponseFor200 headers XRateLimit + +##### Description +calls per hour allowed by the user + +##### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-headers-xratelimit-content-applicationjson-schema) + +##### ResponseFor200 headers XRateLimit content ApplicationJson Schema + +###### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +decimal.Decimal, int | decimal.Decimal | | value must be a 32 bit integer +#### ResponseFor200 headers XExpiresAfter + +##### Description +date in UTC when token expires + +##### ResponseFor200 headers XExpiresAfter Schema + +###### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, datetime.datetime | str | | value must conform to RFC-3339 date-time + +## ResponseFor400 + +### Description +Invalid username/password supplied + +### ResponseFor400 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://petstore.swagger.io:80/v2 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | petstore server +1 | [Server1](../../../servers/server_1.md) | The local server +2 | [Server2](../../../servers/server_2.md) | staging server with no variables + +## Code Sample + +```python +import petstore_api +from petstore_api.configurations import api_configuration +from petstore_api.apis.tags import user_api +from petstore_api.paths.user_login.get import operation +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = user_api.UserApi(api_client) + + # example passing only required values which don't have defaults set + query_params: operation.RequestQueryParameters.Params = { + 'username': "username_example", + 'password': "password_example", + } + try: + # Logs user into the system + api_response = api_instance.login_user( + query_params=query_params, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling UserApi->login_user: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to UserApi API]](../../apis/tags/user_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/docs/paths/user_logout/get.md b/samples/openapi3/client/petstore/python/docs/paths/user_logout/get.md new file mode 100644 index 00000000000..07357ef5c53 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/paths/user_logout/get.md @@ -0,0 +1,79 @@ +petstore_api.paths.user_logout.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| logout_user | [UserApi](../../apis/tags/user_api.md) | This api is only for tag=user | +| get | ApiForGet | This api is only for this endpoint | +| get | UserLogout | This api is only for path=/user/logout | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Summary | Logs out current logged in user session | +| Path | "/user/logout" | +| HTTP Method | get | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +default | [RefSuccessDescriptionOnly.response_cls](../../components/responses/response_ref_success_description_only.md#response_ref_success_description_onlyresponse_cls) | Success + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://petstore.swagger.io:80/v2 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | petstore server +1 | [Server1](../../../servers/server_1.md) | The local server +2 | [Server2](../../../servers/server_2.md) | staging server with no variables + +## Code Sample + +```python +import petstore_api +from petstore_api.configurations import api_configuration +from petstore_api.apis.tags import user_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = user_api.UserApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + # Logs out current logged in user session + api_response = api_instance.logout_user() + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling UserApi->logout_user: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to UserApi API]](../../apis/tags/user_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/docs/paths/user_username/delete.md b/samples/openapi3/client/petstore/python/docs/paths/user_username/delete.md new file mode 100644 index 00000000000..96795fe829b --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/paths/user_username/delete.md @@ -0,0 +1,109 @@ +petstore_api.paths.user_username.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| delete_user | [UserApi](../../apis/tags/user_api.md) | This api is only for tag=user | +| delete | ApiForDelete | This api is only for this endpoint | +| delete | UserUsername | This api is only for path=/user/{username} | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Summary | Delete user | +| Description | This can only be done by the logged in user. | +| Path | "/user/{username}" | +| HTTP Method | delete | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[path_params](#path_params) | [RequestPathParameters.Params](#requestpathparametersparams), dict | | +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### path_params +#### RequestPathParameters.Params +This is a TypedDict + +Key | Input Type | Description | Notes +------------- | ------------- | ------------- | ------------- +username | [RefPathUserName.schema](../../../components/parameters/parameter_ref_path_user_name.md#schema), str | | + + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [SuccessDescriptionOnly.response_cls](../../components/responses/response_success_description_only.md#response_success_description_onlyresponse_cls) | Success +404 | [ResponseFor404.response_cls](#responsefor404-response_cls) | User not found + +## ResponseFor404 + +### Description +User not found + +### ResponseFor404 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://petstore.swagger.io:80/v2 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | petstore server +1 | [Server1](../../../servers/server_1.md) | The local server +2 | [Server2](../../../servers/server_2.md) | staging server with no variables + +## Code Sample + +```python +import petstore_api +from petstore_api.configurations import api_configuration +from petstore_api.apis.tags import user_api +from petstore_api.paths.user_username.delete import operation +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = user_api.UserApi(api_client) + + # example passing only required values which don't have defaults set + path_params: operation.RequestPathParameters.Params = { + 'username': "username_example", + } + try: + # Delete user + api_response = api_instance.delete_user( + path_params=path_params, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling UserApi->delete_user: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to UserApi API]](../../apis/tags/user_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/docs/paths/user_username/get.md b/samples/openapi3/client/petstore/python/docs/paths/user_username/get.md new file mode 100644 index 00000000000..d5874d7a7ae --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/paths/user_username/get.md @@ -0,0 +1,154 @@ +petstore_api.paths.user_username.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| get_user_by_name | [UserApi](../../apis/tags/user_api.md) | This api is only for tag=user | +| get | ApiForGet | This api is only for this endpoint | +| get | UserUsername | This api is only for path=/user/{username} | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Summary | Get user by user name | +| Path | "/user/{username}" | +| HTTP Method | get | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[path_params](#path_params) | [RequestPathParameters.Params](#requestpathparametersparams), dict | | +accept_content_types | typing.Tuple[str] | default is ("application/xml", "application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### path_params +#### RequestPathParameters.Params +This is a TypedDict + +Key | Input Type | Description | Notes +------------- | ------------- | ------------- | ------------- +username | [PathUserName.schema](../../../components/parameters/parameter_path_user_name.md#schema), str | | + + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | successful operation +400 | [ResponseFor400.response_cls](#responsefor400-response_cls) | Invalid username supplied +404 | [ResponseFor404.response_cls](#responsefor404-response_cls) | User not found + +## ResponseFor200 + +### Description +successful operation + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | typing.Union[[content.application_xml.schema](#responsefor200-content-applicationxml-schema), [content.application_json.schema](#responsefor200-content-applicationjson-schema)] | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/xml" | [content.application_xml.Schema](#responsefor200-content-applicationxml-schema) +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationXml Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[User](../../components/schema/user.md) | dict, frozendict.frozendict | frozendict.frozendict | +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[User](../../components/schema/user.md) | dict, frozendict.frozendict | frozendict.frozendict | + +## ResponseFor400 + +### Description +Invalid username supplied + +### ResponseFor400 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## ResponseFor404 + +### Description +User not found + +### ResponseFor404 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://petstore.swagger.io:80/v2 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | petstore server +1 | [Server1](../../../servers/server_1.md) | The local server +2 | [Server2](../../../servers/server_2.md) | staging server with no variables + +## Code Sample + +```python +import petstore_api +from petstore_api.configurations import api_configuration +from petstore_api.apis.tags import user_api +from petstore_api.paths.user_username.get import operation +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = user_api.UserApi(api_client) + + # example passing only required values which don't have defaults set + path_params: operation.RequestPathParameters.Params = { + 'username': "username_example", + } + try: + # Get user by user name + api_response = api_instance.get_user_by_name( + path_params=path_params, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling UserApi->get_user_by_name: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to UserApi API]](../../apis/tags/user_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/docs/paths/user_username/put.md b/samples/openapi3/client/petstore/python/docs/paths/user_username/put.md new file mode 100644 index 00000000000..290597873ef --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/paths/user_username/put.md @@ -0,0 +1,156 @@ +petstore_api.paths.user_username.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| update_user | [UserApi](../../apis/tags/user_api.md) | This api is only for tag=user | +| put | ApiForPut | This api is only for this endpoint | +| put | UserUsername | This api is only for path=/user/{username} | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Summary | Updated user | +| Description | This can only be done by the logged in user. | +| Path | "/user/{username}" | +| HTTP Method | put | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict] | required | +[path_params](#path_params) | [RequestPathParameters.Params](#requestpathparametersparams), dict | | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### RequestBody + +#### Description +Updated user object + +#### Content Type To Schema +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#requestbody-content-applicationjson-schema) + +#### RequestBody content ApplicationJson Schema + +##### Type Info +Ref Class | Input Type | Accessed Type | Description +--------- | ---------- | ------------- | ------------ +[User](../../components/schema/user.md) | dict, frozendict.frozendict | frozendict.frozendict | + +### path_params +#### RequestPathParameters.Params +This is a TypedDict + +Key | Input Type | Description | Notes +------------- | ------------- | ------------- | ------------- +username | [PathUserName.schema](../../../components/parameters/parameter_path_user_name.md#schema), str | | + + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +400 | [ResponseFor400.response_cls](#responsefor400-response_cls) | Invalid user supplied +404 | [ResponseFor404.response_cls](#responsefor404-response_cls) | User not found + +## ResponseFor400 + +### Description +Invalid user supplied + +### ResponseFor400 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## ResponseFor404 + +### Description +User not found + +### ResponseFor404 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://petstore.swagger.io:80/v2 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | petstore server +1 | [Server1](../../../servers/server_1.md) | The local server +2 | [Server2](../../../servers/server_2.md) | staging server with no variables + +## Code Sample + +```python +import petstore_api +from petstore_api.configurations import api_configuration +from petstore_api.apis.tags import user_api +from petstore_api.paths.user_username.put import operation +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = user_api.UserApi(api_client) + + # example passing only required values which don't have defaults set + path_params: operation.RequestPathParameters.Params = { + 'username': "username_example", + } + body = user.User( + id=1, + username="username_example", + first_name="first_name_example", + last_name="last_name_example", + email="email_example", + password="password_example", + phone="phone_example", + user_status=1, + object_with_no_declared_props=dict(), + object_with_no_declared_props_nullable=dict(), + any_type_prop=None, + any_type_except_null_prop=None, + any_type_prop_nullable=None, + ) + try: + # Updated user + api_response = api_instance.update_user( + path_params=path_params, + body=body, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling UserApi->update_user: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to UserApi API]](../../apis/tags/user_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/docs/servers/server_0.md b/samples/openapi3/client/petstore/python/docs/servers/server_0.md new file mode 100644 index 00000000000..bf27bacb919 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/servers/server_0.md @@ -0,0 +1,16 @@ +petstore_api.servers.server_0 +# Server Server0 + +## Description +petstore server + +## Url +http://{server}.swagger.io:{port}/v2 + +## Variables +Key | Type | Description | Notes +--- | ---- | ----------- | ------ +**server** | str | server host prefix | must be one of ["petstore", "qa-petstore", "dev-petstore"] if omitted the client will use the default value of petstore +**port** | str | the port | must be one of ["80", "8080"] if omitted the client will use the default value of 80 + +[[Back to top]](#top) [[Back to Servers]](../../README.md#Servers) [[Back to README]](../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/servers/server_1.md b/samples/openapi3/client/petstore/python/docs/servers/server_1.md new file mode 100644 index 00000000000..4fe13818cd6 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/servers/server_1.md @@ -0,0 +1,15 @@ +petstore_api.servers.server_1 +# Server Server1 + +## Description +The local server + +## Url +https://localhost:8080/{version} + +## Variables +Key | Type | Description | Notes +--- | ---- | ----------- | ------ +**version** | str | | must be one of ["v1", "v2"] if omitted the client will use the default value of v2 + +[[Back to top]](#top) [[Back to Servers]](../../README.md#Servers) [[Back to README]](../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/servers/server_2.md b/samples/openapi3/client/petstore/python/docs/servers/server_2.md new file mode 100644 index 00000000000..25c19fc0f6e --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/servers/server_2.md @@ -0,0 +1,10 @@ +petstore_api.servers.server_2 +# Server Server2 + +## Description +staging server with no variables + +## Url +https://localhost:8080 + +[[Back to top]](#top) [[Back to Servers]](../../README.md#Servers) [[Back to README]](../../README.md) diff --git a/samples/openapi3/client/petstore/python/migration_2_0_0.md b/samples/openapi3/client/petstore/python/migration_2_0_0.md new file mode 100644 index 00000000000..ed19050a503 --- /dev/null +++ b/samples/openapi3/client/petstore/python/migration_2_0_0.md @@ -0,0 +1,203 @@ +# Migration v1.X.X to v2.0.0 + +- [Compatibility note for opeanpi-generator](#compatibility-note-for-opeanpi-generator) +- [Component Generation](#component-generation) +- [Packaging Changes](#packaging-changes) +- [Path Generation](#path-generation) +- [Configuration Info Refactored](#configuration-info-refactored) +- [Servers and Security Generation](#servers-and-security-generation) +- [Java Classes for Openapi Data Refactored](#java-classes-for-openapi-data-refactored) +- [Api Access by Tags and Paths Updated](#api-access-by-tags-and-paths-updated) +- [Some Method/Property/Input/Class Names Updated](#some-methodpropertyinputclass-names-updated) +- [Documentation Updated](#documentation-updated) + +## Compatibility note for opeanpi-generator +The v1.0.4 release is nearly identical to the openapi-generator v6.3.0 release + +Below is a summary of big changes when updating you code from v1.X.X to 2.0.0 + +## Component Generation +Update: +Openapi document components in "#/components/x" are now generated in a components/x packages +Ths applies to: +- headers +- parameters +- request_bodies +- responses +- schemas +- security_schemes + +The generator now writes a class for each of those generated components. + +### Reason +A lot of openapi data is $ref references throughout an openapi document. +With this update, those $ref source locations are generated with file system paths that closely mirror the openapi +document json schema path to that info. $ref definition is then imported in generated python code. +This minimizes the amount of code that is generated, imposes well defined encapsulation and allows templates to be +re-used for many types of data regardless of where the data is in the source openapi document. + +### Action +- Update where you are importing models from, models are now component schemas + - File path change: model/pet.py -> components/schema/pet.py + +## Packaging changes +Code has been updated to use .toml packaging. Code is now distributed in a src directory + +### Reason +These updates follow latest python packaging best practices + +### Action +- if you are suppressing generation of any files, you will need to edit those file paths + - File Path Change: package_name -> src/package_name + +## Path Generation +If paths contain inline descriptions of parameters, request bodies, responses, security, or servers, +then those are now generated in separate files. Those files are imported into the endpoint code. +File locations closely mirror the openapi data json schema path. + +### Reason +Generating those files in paths that closely mirror the json schema paths will allow +the generator to use $ref to any location in the openapi document in the future, not just components. +These could include: +- relative $refs +- a request body $ref referring to the request body in another endpoint + +This also allowed the generation code to work the same way regardless of where the header/requestBody etc +is in the source spec. + +Note: +Operations are now at +paths/somePath/get/operation.py +and not at +paths/somePath/get/__init__.py +to minimize the amount of memory needed when importing the python package. +The configurations.api_configuration.py file imports all servers defined at: +- openapi document root +- pathItem +- pathItem operation +And if servers were defined in pathItem operations, then every operation that contains a server would be imported +in api_configuration.py. Which could be many many files. + +So instead +- operation endpoint definition was moved to paths/somePath/get/operation.py +- paths/somePath/get/__init__.py stays empty and does not need lots of memory when api_configuration.py imports servers +- server information was kept in paths/somePath/get/servers/server_x.py + +### Action +- if you are importing any endpoint form its file, update your import + - File path update: paths/somePath/get.py -> paths/somePath/get/operation.py + +## Configuration Info Refactored +Configuration information was separated into two classes +- configurations/api_configuration.py ApiConfiguration for: + - server info + - security (auth) info + - logging info +- configurations/schema_configuration.py SchemaConfiguration for: + - disabled openapi/json-schema keywords + +### Reason +Schema validation only relies on SchemaConfiguration data and does not need to know about any ApiConfiguration info +General api configuration info was poorly structured in the legacy configuration class which had 13 inputs. +The refactored ApiConfiguration now has 4 inputs which define servers and security info. +Having these separate classes prevents circular imports when the schemas.py file imports its SchemaConfiguration class. + +### Action +- When you instantiate ApiClient, update your code to pass in an instance of SchemaConfiguration + ApiConfiguration + + +## Servers and Security Generation +Servers are now generated as separate files with one class per file wherever they were defined in the openapi document +- servers/server_0.py +- paths/somePath/servers/server_0.py +- paths/somePath/get/servers/server_0.py +Security requirements objects are now generated as separate files with one security requirement object per file +wherever they were defined in the openapi document +- security/security_requirement_object_0.py +- paths/somePath/get/security/security_requirement_object_0.py + +### Reason +Server classes now re-use schema validation code to ensure that inputs to server variables are valid. +Generating these separate files minimizes generated code and maximizes code re-use. + +### Action +- If endpoints need to use specific servers or security not at index 0, pass security_index_info + server_index_info + into ApiConfiguration when instantiating it +- If you use non-default server variable values, then update your code to pass in server_info into ApiConfiguration + +## Java Classes for Openapi Data Refactored +Almost every java class used to store openapi document data at generation time has been re-written or refactored. +The new classes are much shorter and contain only what is needed to generate code and documentation. +This will make it much easier to add new openapi v3.1.0 features like new json schema keywords. +Generator interface methods were also refactored to simplify Java model instantiation and code generation. +Almost all properties are now public static final and are: +- immutable +- publicly accessible to the templates + +### Reason +These updates make the code much more maintainable. +The number of properties that have to be maintained is much smaller +- Component Schema: ~100 properties in CodegenModel.java -> ~50 properties in CodegenSchema.java +- PathItem Operation: ~75 properties CodegenOperation: ~25 properties + +This will reduce bugs like: why can't I access this property in this template +Because instances are mostly immutable it is very clear where the wrong value is being created/assigned. + +### Action +- if you are customizing the python generator, you will need to update your java code + +## Api Access By Tags and Paths Updated +Previously, keys togo from tags and paths to apis were enums. +The code was updated to use a TypedDict and uses strings as the keys. + +### Reason +Making this change allows type hinting to work for the TypedDict with string keys + +### Action +- If you use path_to_api.py or tag_to_api.py, update the key that you use to access the api + +## Some Method/Property/Input/Class Names Updated +- is_true_oapg -> is_true_ +- is_false_oapg -> is_false_ +- is_none_oapg -> is_none_ +- as_date_oapg -> as_date_ +- as_datetime_oapg -> as_datetime_ +- as_decimal_oapg -> as_decimal_ +- as_uuid_oapg -> as_uuid_ +- as_float_oapg -> as_float_ +- as_int_oapg -> as_int_ +- get_item_oapg -> get_item_ +- from_openapi_data_oapg -> from_openapi_data_ +- _verify_typed_dict_inputs_oapg -> _verify_typed_dict_inputs +- _configuration -> configuration_ +- _arg -> arg_ +- _args -> args_ +- MetaOapg -> Schema_ +- JsonSchema -> OpenApiSchema + +### Reason +Classes can have arbitrarily named properties set on them +Endpoints can have arbitrary operationId method names set +For those reasons, I use the prefix and suffix _ to greatly reduce the likelihood of collisions +on protected + public classes/methods. + +### Action +- if you use the above methods/inputs/properties/classes update them to the latest names + +## Documentation Updated +- components now have sections in the readme + - models became component schemas +- one file is now generated for each endpoint + - that file now has a table of contents + - heading indentation levels now are indented correctly in descending order + - endpoint now includes server and security info (if security exists) +- servers section added to readme if servers were defined in the openapi document root +- security section added to readme if security was defined in the openapi document root + +### Reason +Endpoint documentation had indentation and linking bugs before, this fixes them. +When all endpoints docs were written in one file it was difficult to link ot the correct section. +How to set server and security info was unclear before, the new docs and classes should clarify that. + +### Action +- if you link to specific parts of the documentation, update your links \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/migration_other_python_generators.md b/samples/openapi3/client/petstore/python/migration_other_python_generators.md new file mode 100644 index 00000000000..36ab6416ee0 --- /dev/null +++ b/samples/openapi3/client/petstore/python/migration_other_python_generators.md @@ -0,0 +1,92 @@ +# Migration from Other Python Generators + +When switching from other python client generators you will need to make some changes to your code. + +1. This generator uses spec case for all (object) property names and parameter names. + - So if the spec has a property name like camelCase, it will use camelCase rather than camel_case + - So you will need to update how you input and read properties to use spec case + - endpoint calls will need to have their input arguments updated + - schema instance property usage and instantiation will need to be updated +2. Endpoint parameters are stored in dictionaries to prevent collisions (explanation below) + - So you will need to update how you pass data in to endpoints + - update your endpoint calls to pass in parameter data in path_params, query_params, header_params etc dict inputs +3. Endpoint responses now include the original response, the deserialized response body, and (todo)the deserialized headers + - So you will need to update your code to use response.body to access deserialized data +4. All validated data is instantiated in an instance that subclasses all validated Schema classes and Decimal/str/tuple/frozendict/NoneClass/BoolClass/bytes/io.FileIO + - This means that you can use isinstance to check if a payload validated against a schema class + - This means that no data will be of type None/True/False + - ingested None will subclass NoneClass + - ingested True will subclass BoolClass + - ingested False will subclass BoolClass + - So if you need to check is True/False/None, instead use instance.is_true_()/.is_false_()/.is_none_() +5. All validated class instances are immutable except for ones based on io.File + - This is because if properties were changed after validation, that validation would no longer apply + - So no changing values or property values after a class has been instantiated +6. String + Number types with formats + - String type data is stored as a string and if you need to access types based on its format like date, + date-time, uuid, number etc then you will need to use accessor functions on the instance + - type string + format: See .as_date_, .as_datetime_, .as_decimal_, .as_uuid_ + - type number + format: See .as_float_, .as_int_ + - this was done because openapi/json-schema defines constraints. string data may be type string with no format + keyword in one schema, and include a format constraint in another schema + - So if you need to access a string format based type, use as_date_/as_datetime_/as_decimal_/as_uuid_ + - So if you need to access a number format based type, use as_int_/as_float_ +7. Property access on AnyType(type unset) or object(dict) schemas + - Only required keys with valid python names are properties like .someProp and have type hints + - All optional keys may not exist, so properties are not defined for them + - One can access optional values with dict_instance['optionalProp'] and KeyError will be raised if it does not exist + - Use get_item_ if you need a way to always get a value whether or not the key exists + - If the key does not exist, schemas.unset is returned from calling dict_instance.get_item_('optionalProp') + - All required and optional keys have type hints for this method, and @typing.overload is used + - A type hint is also generated for additionalProperties accessed using this method + - So you will need to update you code to use some_instance['optionalProp'] to access optional property + and additionalProperty values +8. The location of the api classes has changed + - Api classes are located in your_package.apis.tags.some_api + - This change was made to eliminate redundant code generation + - Legacy generators generated the same endpoint twice if it had > 1 tag on it + - This generator defines an endpoint in one class, then inherits that class to generate + apis by tags and by paths + - This change reduces code and allows quicker run time if you use the path apis + - path apis are at your_package.apis.paths.some_path + - Those apis will only load their needed models, which is less to load than all of the resources needed in a tag api + - So you will need to update your import paths to the api classes + +### Why are Leading and Trailing Underscores in class and method names? +Classes can have arbitrarily named properties set on them +Endpoints can have arbitrary operationId method names set +For those reasons, I use the prefix and suffix _ to greatly reduce the likelihood of collisions +on protected + public classes/methods. + +### Object property spec case +This was done because when payloads are ingested, they can be validated against N number of schemas. +If the input signature used a different property name then that has mutated the payload. +So SchemaA and SchemaB must both see the camelCase spec named variable. +Also it is possible to send in two properties, named camelCase and camel_case in the same payload. +That use case should work, so spec case is used. + +### Parameter spec case +Parameters can be included in different locations including: +- query +- path +- header +- cookie + +Any of those parameters could use the same parameter names, so if every parameter +was included as an endpoint parameter in a function signature, they would collide. +For that reason, each of those inputs have been separated out into separate typed dictionaries: +- query_params +- path_params +- header_params +- cookie_params + +So when updating your code, you will need to pass endpoint parameters in using those +dictionaries. + +### Endpoint responses +Endpoint responses have been enriched to now include more information. +Any response reom an endpoint will now include the following properties: +response: urllib3.HTTPResponse +body: typing.Union[Unset, Schema] +headers: typing.Union[Unset, TODO] +Note: response header deserialization has not yet been added \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/petstore_api/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/__init__.py deleted file mode 100644 index 26b0467759d..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/__init__.py +++ /dev/null @@ -1,31 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -__version__ = "1.0.0" - -# import ApiClient -from petstore_api.api_client import ApiClient - -# import Configuration -from petstore_api.configuration import Configuration -from petstore_api.signing import HttpSigningConfiguration - -# import exceptions -from petstore_api.exceptions import OpenApiException -from petstore_api.exceptions import ApiAttributeError -from petstore_api.exceptions import ApiTypeError -from petstore_api.exceptions import ApiValueError -from petstore_api.exceptions import ApiKeyError -from petstore_api.exceptions import ApiException - -__import__('sys').setrecursionlimit(1234) diff --git a/samples/openapi3/client/petstore/python/petstore_api/api_client.py b/samples/openapi3/client/petstore/python/petstore_api/api_client.py deleted file mode 100644 index ca9b91e6d04..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/api_client.py +++ /dev/null @@ -1,1508 +0,0 @@ -# coding: utf-8 -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -from decimal import Decimal -import enum -import email -import json -import os -import io -import atexit -from multiprocessing.pool import ThreadPool -import re -import tempfile -import typing -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict -from urllib.parse import urlparse, quote -from urllib3.fields import RequestField as RequestFieldBase - -import frozendict - -from petstore_api import rest -from petstore_api.configuration import Configuration -from petstore_api.exceptions import ApiTypeError, ApiValueError -from petstore_api.schemas import ( - NoneClass, - BoolClass, - Schema, - FileIO, - BinarySchema, - date, - datetime, - none_type, - Unset, - unset, -) - - -class RequestField(RequestFieldBase): - def __eq__(self, other): - if not isinstance(other, RequestField): - return False - return self.__dict__ == other.__dict__ - - -class JSONEncoder(json.JSONEncoder): - compact_separators = (',', ':') - - def default(self, obj): - if isinstance(obj, str): - return str(obj) - elif isinstance(obj, float): - return float(obj) - elif isinstance(obj, int): - return int(obj) - elif isinstance(obj, Decimal): - if obj.as_tuple().exponent >= 0: - return int(obj) - return float(obj) - elif isinstance(obj, NoneClass): - return None - elif isinstance(obj, BoolClass): - return bool(obj) - elif isinstance(obj, (dict, frozendict.frozendict)): - return {key: self.default(val) for key, val in obj.items()} - elif isinstance(obj, (list, tuple)): - return [self.default(item) for item in obj] - raise ApiValueError('Unable to prepare type {} for serialization'.format(obj.__class__.__name__)) - - -class ParameterInType(enum.Enum): - QUERY = 'query' - HEADER = 'header' - PATH = 'path' - COOKIE = 'cookie' - - -class ParameterStyle(enum.Enum): - MATRIX = 'matrix' - LABEL = 'label' - FORM = 'form' - SIMPLE = 'simple' - SPACE_DELIMITED = 'spaceDelimited' - PIPE_DELIMITED = 'pipeDelimited' - DEEP_OBJECT = 'deepObject' - - -class PrefixSeparatorIterator: - # A class to store prefixes and separators for rfc6570 expansions - - def __init__(self, prefix: str, separator: str): - self.prefix = prefix - self.separator = separator - self.first = True - if separator in {'.', '|', '%20'}: - item_separator = separator - else: - item_separator = ',' - self.item_separator = item_separator - - def __iter__(self): - return self - - def __next__(self): - if self.first: - self.first = False - return self.prefix - return self.separator - - -class ParameterSerializerBase: - @classmethod - def _get_default_explode(cls, style: ParameterStyle) -> bool: - return False - - @staticmethod - def __ref6570_item_value(in_data: typing.Any, percent_encode: bool): - """ - Get representation if str/float/int/None/items in list/ values in dict - None is returned if an item is undefined, use cases are value= - - None - - [] - - {} - - [None, None None] - - {'a': None, 'b': None} - """ - if type(in_data) in {str, float, int}: - if percent_encode: - return quote(str(in_data)) - return str(in_data) - elif isinstance(in_data, none_type): - # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 - return None - elif isinstance(in_data, list) and not in_data: - # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 - return None - elif isinstance(in_data, dict) and not in_data: - # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 - return None - raise ApiValueError('Unable to generate a ref6570 item representation of {}'.format(in_data)) - - @staticmethod - def _to_dict(name: str, value: str): - return {name: value} - - @classmethod - def __ref6570_str_float_int_expansion( - cls, - variable_name: str, - in_data: typing.Any, - explode: bool, - percent_encode: bool, - prefix_separator_iterator: PrefixSeparatorIterator, - var_name_piece: str, - named_parameter_expansion: bool - ) -> str: - item_value = cls.__ref6570_item_value(in_data, percent_encode) - if item_value is None or (item_value == '' and prefix_separator_iterator.separator == ';'): - return next(prefix_separator_iterator) + var_name_piece - value_pair_equals = '=' if named_parameter_expansion else '' - return next(prefix_separator_iterator) + var_name_piece + value_pair_equals + item_value - - @classmethod - def __ref6570_list_expansion( - cls, - variable_name: str, - in_data: typing.Any, - explode: bool, - percent_encode: bool, - prefix_separator_iterator: PrefixSeparatorIterator, - var_name_piece: str, - named_parameter_expansion: bool - ) -> str: - item_values = [cls.__ref6570_item_value(v, percent_encode) for v in in_data] - item_values = [v for v in item_values if v is not None] - if not item_values: - # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 - return "" - value_pair_equals = '=' if named_parameter_expansion else '' - if not explode: - return ( - next(prefix_separator_iterator) + - var_name_piece + - value_pair_equals + - prefix_separator_iterator.item_separator.join(item_values) - ) - # exploded - return next(prefix_separator_iterator) + next(prefix_separator_iterator).join( - [var_name_piece + value_pair_equals + val for val in item_values] - ) - - @classmethod - def __ref6570_dict_expansion( - cls, - variable_name: str, - in_data: typing.Any, - explode: bool, - percent_encode: bool, - prefix_separator_iterator: PrefixSeparatorIterator, - var_name_piece: str, - named_parameter_expansion: bool - ) -> str: - in_data_transformed = {key: cls.__ref6570_item_value(val, percent_encode) for key, val in in_data.items()} - in_data_transformed = {key: val for key, val in in_data_transformed.items() if val is not None} - if not in_data_transformed: - # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 - return "" - value_pair_equals = '=' if named_parameter_expansion else '' - if not explode: - return ( - next(prefix_separator_iterator) + - var_name_piece + value_pair_equals + - prefix_separator_iterator.item_separator.join( - prefix_separator_iterator.item_separator.join( - item_pair - ) for item_pair in in_data_transformed.items() - ) - ) - # exploded - return next(prefix_separator_iterator) + next(prefix_separator_iterator).join( - [key + '=' + val for key, val in in_data_transformed.items()] - ) - - @classmethod - def _ref6570_expansion( - cls, - variable_name: str, - in_data: typing.Any, - explode: bool, - percent_encode: bool, - prefix_separator_iterator: PrefixSeparatorIterator - ) -> str: - """ - Separator is for separate variables like dict with explode true, not for array item separation - """ - named_parameter_expansion = prefix_separator_iterator.separator in {'&', ';'} - var_name_piece = variable_name if named_parameter_expansion else '' - if type(in_data) in {str, float, int}: - return cls.__ref6570_str_float_int_expansion( - variable_name, - in_data, - explode, - percent_encode, - prefix_separator_iterator, - var_name_piece, - named_parameter_expansion - ) - elif isinstance(in_data, none_type): - # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 - return "" - elif isinstance(in_data, list): - return cls.__ref6570_list_expansion( - variable_name, - in_data, - explode, - percent_encode, - prefix_separator_iterator, - var_name_piece, - named_parameter_expansion - ) - elif isinstance(in_data, dict): - return cls.__ref6570_dict_expansion( - variable_name, - in_data, - explode, - percent_encode, - prefix_separator_iterator, - var_name_piece, - named_parameter_expansion - ) - # bool, bytes, etc - raise ApiValueError('Unable to generate a ref6570 representation of {}'.format(in_data)) - - -class StyleFormSerializer(ParameterSerializerBase): - @classmethod - def _get_default_explode(cls, style: ParameterStyle) -> bool: - if style is ParameterStyle.FORM: - return True - return super()._get_default_explode(style) - - def _serialize_form( - self, - in_data: typing.Union[None, int, float, str, bool, dict, list], - name: str, - explode: bool, - percent_encode: bool, - prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] = None - ) -> str: - if prefix_separator_iterator is None: - prefix_separator_iterator = PrefixSeparatorIterator('', '&') - return self._ref6570_expansion( - variable_name=name, - in_data=in_data, - explode=explode, - percent_encode=percent_encode, - prefix_separator_iterator=prefix_separator_iterator - ) - - -class StyleSimpleSerializer(ParameterSerializerBase): - - def _serialize_simple( - self, - in_data: typing.Union[None, int, float, str, bool, dict, list], - name: str, - explode: bool, - percent_encode: bool - ) -> str: - prefix_separator_iterator = PrefixSeparatorIterator('', ',') - return self._ref6570_expansion( - variable_name=name, - in_data=in_data, - explode=explode, - percent_encode=percent_encode, - prefix_separator_iterator=prefix_separator_iterator - ) - - -class JSONDetector: - """ - Works for: - application/json - application/json; charset=UTF-8 - application/json-patch+json - application/geo+json - """ - __json_content_type_pattern = re.compile("application/[^+]*[+]?(json);?.*") - - @classmethod - def _content_type_is_json(cls, content_type: str) -> bool: - if cls.__json_content_type_pattern.match(content_type): - return True - return False - - -@dataclass -class ParameterBase(JSONDetector): - name: str - in_type: ParameterInType - required: bool - style: typing.Optional[ParameterStyle] - explode: typing.Optional[bool] - allow_reserved: typing.Optional[bool] - schema: typing.Optional[typing.Type[Schema]] - content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] - - __style_to_in_type = { - ParameterStyle.MATRIX: {ParameterInType.PATH}, - ParameterStyle.LABEL: {ParameterInType.PATH}, - ParameterStyle.FORM: {ParameterInType.QUERY, ParameterInType.COOKIE}, - ParameterStyle.SIMPLE: {ParameterInType.PATH, ParameterInType.HEADER}, - ParameterStyle.SPACE_DELIMITED: {ParameterInType.QUERY}, - ParameterStyle.PIPE_DELIMITED: {ParameterInType.QUERY}, - ParameterStyle.DEEP_OBJECT: {ParameterInType.QUERY}, - } - __in_type_to_default_style = { - ParameterInType.QUERY: ParameterStyle.FORM, - ParameterInType.PATH: ParameterStyle.SIMPLE, - ParameterInType.HEADER: ParameterStyle.SIMPLE, - ParameterInType.COOKIE: ParameterStyle.FORM, - } - __disallowed_header_names = {'Accept', 'Content-Type', 'Authorization'} - _json_encoder = JSONEncoder() - - @classmethod - def __verify_style_to_in_type(cls, style: typing.Optional[ParameterStyle], in_type: ParameterInType): - if style is None: - return - in_type_set = cls.__style_to_in_type[style] - if in_type not in in_type_set: - raise ValueError( - 'Invalid style and in_type combination. For style={} only in_type={} are allowed'.format( - style, in_type_set - ) - ) - - def __init__( - self, - name: str, - in_type: ParameterInType, - required: bool = False, - style: typing.Optional[ParameterStyle] = None, - explode: bool = False, - allow_reserved: typing.Optional[bool] = None, - schema: typing.Optional[typing.Type[Schema]] = None, - content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None - ): - if schema is None and content is None: - raise ValueError('Value missing; Pass in either schema or content') - if schema and content: - raise ValueError('Too many values provided. Both schema and content were provided. Only one may be input') - if name in self.__disallowed_header_names and in_type is ParameterInType.HEADER: - raise ValueError('Invalid name, name may not be one of {}'.format(self.__disallowed_header_names)) - self.__verify_style_to_in_type(style, in_type) - if content is None and style is None: - style = self.__in_type_to_default_style[in_type] - if content is not None and in_type in self.__in_type_to_default_style and len(content) != 1: - raise ValueError('Invalid content length, content length must equal 1') - self.in_type = in_type - self.name = name - self.required = required - self.style = style - self.explode = explode - self.allow_reserved = allow_reserved - self.schema = schema - self.content = content - - def _serialize_json( - self, - in_data: typing.Union[None, int, float, str, bool, dict, list], - eliminate_whitespace: bool = False - ) -> str: - if eliminate_whitespace: - return json.dumps(in_data, separators=self._json_encoder.compact_separators) - return json.dumps(in_data) - - -class PathParameter(ParameterBase, StyleSimpleSerializer): - - def __init__( - self, - name: str, - required: bool = False, - style: typing.Optional[ParameterStyle] = None, - explode: bool = False, - allow_reserved: typing.Optional[bool] = None, - schema: typing.Optional[typing.Type[Schema]] = None, - content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None - ): - super().__init__( - name, - in_type=ParameterInType.PATH, - required=required, - style=style, - explode=explode, - allow_reserved=allow_reserved, - schema=schema, - content=content - ) - - def __serialize_label( - self, - in_data: typing.Union[None, int, float, str, bool, dict, list] - ) -> typing.Dict[str, str]: - prefix_separator_iterator = PrefixSeparatorIterator('.', '.') - value = self._ref6570_expansion( - variable_name=self.name, - in_data=in_data, - explode=self.explode, - percent_encode=True, - prefix_separator_iterator=prefix_separator_iterator - ) - return self._to_dict(self.name, value) - - def __serialize_matrix( - self, - in_data: typing.Union[None, int, float, str, bool, dict, list] - ) -> typing.Dict[str, str]: - prefix_separator_iterator = PrefixSeparatorIterator(';', ';') - value = self._ref6570_expansion( - variable_name=self.name, - in_data=in_data, - explode=self.explode, - percent_encode=True, - prefix_separator_iterator=prefix_separator_iterator - ) - return self._to_dict(self.name, value) - - def __serialize_simple( - self, - in_data: typing.Union[None, int, float, str, bool, dict, list], - ) -> typing.Dict[str, str]: - value = self._serialize_simple( - in_data=in_data, - name=self.name, - explode=self.explode, - percent_encode=True - ) - return self._to_dict(self.name, value) - - def serialize( - self, - in_data: typing.Union[ - Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict] - ) -> typing.Dict[str, str]: - if self.schema: - cast_in_data = self.schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) - """ - simple -> path - path: - returns path_params: dict - label -> path - returns path_params - matrix -> path - returns path_params - """ - if self.style: - if self.style is ParameterStyle.SIMPLE: - return self.__serialize_simple(cast_in_data) - elif self.style is ParameterStyle.LABEL: - return self.__serialize_label(cast_in_data) - elif self.style is ParameterStyle.MATRIX: - return self.__serialize_matrix(cast_in_data) - # self.content will be length one - for content_type, schema in self.content.items(): - cast_in_data = schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) - if self._content_type_is_json(content_type): - value = self._serialize_json(cast_in_data) - return self._to_dict(self.name, value) - raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) - - -class QueryParameter(ParameterBase, StyleFormSerializer): - - def __init__( - self, - name: str, - required: bool = False, - style: typing.Optional[ParameterStyle] = None, - explode: typing.Optional[bool] = None, - allow_reserved: typing.Optional[bool] = None, - schema: typing.Optional[typing.Type[Schema]] = None, - content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None - ): - used_style = ParameterStyle.FORM if style is None else style - used_explode = self._get_default_explode(used_style) if explode is None else explode - - super().__init__( - name, - in_type=ParameterInType.QUERY, - required=required, - style=used_style, - explode=used_explode, - allow_reserved=allow_reserved, - schema=schema, - content=content - ) - - def __serialize_space_delimited( - self, - in_data: typing.Union[None, int, float, str, bool, dict, list], - prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] - ) -> typing.Dict[str, str]: - if prefix_separator_iterator is None: - prefix_separator_iterator = self.get_prefix_separator_iterator() - value = self._ref6570_expansion( - variable_name=self.name, - in_data=in_data, - explode=self.explode, - percent_encode=True, - prefix_separator_iterator=prefix_separator_iterator - ) - return self._to_dict(self.name, value) - - def __serialize_pipe_delimited( - self, - in_data: typing.Union[None, int, float, str, bool, dict, list], - prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] - ) -> typing.Dict[str, str]: - if prefix_separator_iterator is None: - prefix_separator_iterator = self.get_prefix_separator_iterator() - value = self._ref6570_expansion( - variable_name=self.name, - in_data=in_data, - explode=self.explode, - percent_encode=True, - prefix_separator_iterator=prefix_separator_iterator - ) - return self._to_dict(self.name, value) - - def __serialize_form( - self, - in_data: typing.Union[None, int, float, str, bool, dict, list], - prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] - ) -> typing.Dict[str, str]: - if prefix_separator_iterator is None: - prefix_separator_iterator = self.get_prefix_separator_iterator() - value = self._serialize_form( - in_data, - name=self.name, - explode=self.explode, - percent_encode=True, - prefix_separator_iterator=prefix_separator_iterator - ) - return self._to_dict(self.name, value) - - def get_prefix_separator_iterator(self) -> typing.Optional[PrefixSeparatorIterator]: - if self.style is ParameterStyle.FORM: - return PrefixSeparatorIterator('?', '&') - elif self.style is ParameterStyle.SPACE_DELIMITED: - return PrefixSeparatorIterator('', '%20') - elif self.style is ParameterStyle.PIPE_DELIMITED: - return PrefixSeparatorIterator('', '|') - - def serialize( - self, - in_data: typing.Union[ - Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict], - prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] = None - ) -> typing.Dict[str, str]: - if self.schema: - cast_in_data = self.schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) - """ - form -> query - query: - - GET/HEAD/DELETE: could use fields - - PUT/POST: must use urlencode to send parameters - returns fields: tuple - spaceDelimited -> query - returns fields - pipeDelimited -> query - returns fields - deepObject -> query, https://github.com/OAI/OpenAPI-Specification/issues/1706 - returns fields - """ - if self.style: - # TODO update query ones to omit setting values when [] {} or None is input - if self.style is ParameterStyle.FORM: - return self.__serialize_form(cast_in_data, prefix_separator_iterator) - elif self.style is ParameterStyle.SPACE_DELIMITED: - return self.__serialize_space_delimited(cast_in_data, prefix_separator_iterator) - elif self.style is ParameterStyle.PIPE_DELIMITED: - return self.__serialize_pipe_delimited(cast_in_data, prefix_separator_iterator) - # self.content will be length one - if prefix_separator_iterator is None: - prefix_separator_iterator = self.get_prefix_separator_iterator() - for content_type, schema in self.content.items(): - cast_in_data = schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) - if self._content_type_is_json(content_type): - value = self._serialize_json(cast_in_data, eliminate_whitespace=True) - return self._to_dict( - self.name, - next(prefix_separator_iterator) + self.name + '=' + quote(value) - ) - raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) - - -class CookieParameter(ParameterBase, StyleFormSerializer): - - def __init__( - self, - name: str, - required: bool = False, - style: typing.Optional[ParameterStyle] = None, - explode: typing.Optional[bool] = None, - allow_reserved: typing.Optional[bool] = None, - schema: typing.Optional[typing.Type[Schema]] = None, - content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None - ): - used_style = ParameterStyle.FORM if style is None and content is None and schema else style - used_explode = self._get_default_explode(used_style) if explode is None else explode - - super().__init__( - name, - in_type=ParameterInType.COOKIE, - required=required, - style=used_style, - explode=used_explode, - allow_reserved=allow_reserved, - schema=schema, - content=content - ) - - def serialize( - self, - in_data: typing.Union[ - Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict] - ) -> typing.Dict[str, str]: - if self.schema: - cast_in_data = self.schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) - """ - form -> cookie - returns fields: tuple - """ - if self.style: - """ - TODO add escaping of comma, space, equals - or turn encoding on - """ - value = self._serialize_form( - cast_in_data, - explode=self.explode, - name=self.name, - percent_encode=False, - prefix_separator_iterator=PrefixSeparatorIterator('', '&') - ) - return self._to_dict(self.name, value) - # self.content will be length one - for content_type, schema in self.content.items(): - cast_in_data = schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) - if self._content_type_is_json(content_type): - value = self._serialize_json(cast_in_data) - return self._to_dict(self.name, value) - raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) - - -class HeaderParameter(ParameterBase, StyleSimpleSerializer): - def __init__( - self, - name: str, - required: bool = False, - style: typing.Optional[ParameterStyle] = None, - explode: bool = False, - allow_reserved: typing.Optional[bool] = None, - schema: typing.Optional[typing.Type[Schema]] = None, - content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None - ): - super().__init__( - name, - in_type=ParameterInType.HEADER, - required=required, - style=style, - explode=explode, - allow_reserved=allow_reserved, - schema=schema, - content=content - ) - - @staticmethod - def __to_headers(in_data: typing.Tuple[typing.Tuple[str, str], ...]) -> HTTPHeaderDict: - data = tuple(t for t in in_data if t) - headers = HTTPHeaderDict() - if not data: - return headers - headers.extend(data) - return headers - - def serialize( - self, - in_data: typing.Union[ - Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict] - ) -> HTTPHeaderDict: - if self.schema: - cast_in_data = self.schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) - """ - simple -> header - headers: PoolManager needs a mapping, tuple is close - returns headers: dict - """ - if self.style: - value = self._serialize_simple(cast_in_data, self.name, self.explode, False) - return self.__to_headers(((self.name, value),)) - # self.content will be length one - for content_type, schema in self.content.items(): - cast_in_data = schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) - if self._content_type_is_json(content_type): - value = self._serialize_json(cast_in_data) - return self.__to_headers(((self.name, value),)) - raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) - - -class Encoding: - def __init__( - self, - content_type: str, - headers: typing.Optional[typing.Dict[str, HeaderParameter]] = None, - style: typing.Optional[ParameterStyle] = None, - explode: bool = False, - allow_reserved: bool = False, - ): - self.content_type = content_type - self.headers = headers - self.style = style - self.explode = explode - self.allow_reserved = allow_reserved - - -@dataclass -class MediaType: - """ - Used to store request and response body schema information - encoding: - A map between a property name and its encoding information. - The key, being the property name, MUST exist in the schema as a property. - The encoding object SHALL only apply to requestBody objects when the media type is - multipart or application/x-www-form-urlencoded. - """ - schema: typing.Optional[typing.Type[Schema]] = None - encoding: typing.Optional[typing.Dict[str, Encoding]] = None - - -@dataclass -class ApiResponse: - response: urllib3.HTTPResponse - body: typing.Union[Unset, Schema] = unset - headers: typing.Union[Unset, typing.Dict[str, Schema]] = unset - - def __init__( - self, - response: urllib3.HTTPResponse, - body: typing.Union[Unset, Schema] = unset, - headers: typing.Union[Unset, typing.Dict[str, Schema]] = unset - ): - """ - pycharm needs this to prevent 'Unexpected argument' warnings - """ - self.response = response - self.body = body - self.headers = headers - - -@dataclass -class ApiResponseWithoutDeserialization(ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[Unset, typing.Type[Schema]] = unset - headers: typing.Union[Unset, typing.List[HeaderParameter]] = unset - - -class OpenApiResponse(JSONDetector): - __filename_content_disposition_pattern = re.compile('filename="(.+?)"') - - def __init__( - self, - response_cls: typing.Type[ApiResponse] = ApiResponse, - content: typing.Optional[typing.Dict[str, MediaType]] = None, - headers: typing.Optional[typing.List[HeaderParameter]] = None, - ): - self.headers = headers - if content is not None and len(content) == 0: - raise ValueError('Invalid value for content, the content dict must have >= 1 entry') - self.content = content - self.response_cls = response_cls - - @staticmethod - def __deserialize_json(response: urllib3.HTTPResponse) -> typing.Any: - # python must be >= 3.9 so we can pass in bytes into json.loads - return json.loads(response.data) - - @staticmethod - def __file_name_from_response_url(response_url: typing.Optional[str]) -> typing.Optional[str]: - if response_url is None: - return None - url_path = urlparse(response_url).path - if url_path: - path_basename = os.path.basename(url_path) - if path_basename: - _filename, ext = os.path.splitext(path_basename) - if ext: - return path_basename - return None - - @classmethod - def __file_name_from_content_disposition(cls, content_disposition: typing.Optional[str]) -> typing.Optional[str]: - if content_disposition is None: - return None - match = cls.__filename_content_disposition_pattern.search(content_disposition) - if not match: - return None - return match.group(1) - - def __deserialize_application_octet_stream( - self, response: urllib3.HTTPResponse - ) -> typing.Union[bytes, io.BufferedReader]: - """ - urllib3 use cases: - 1. when preload_content=True (stream=False) then supports_chunked_reads is False and bytes are returned - 2. when preload_content=False (stream=True) then supports_chunked_reads is True and - a file will be written and returned - """ - if response.supports_chunked_reads(): - file_name = ( - self.__file_name_from_content_disposition(response.headers.get('content-disposition')) - or self.__file_name_from_response_url(response.geturl()) - ) - - if file_name is None: - _fd, path = tempfile.mkstemp() - else: - path = os.path.join(tempfile.gettempdir(), file_name) - - with open(path, 'wb') as new_file: - chunk_size = 1024 - while True: - data = response.read(chunk_size) - if not data: - break - new_file.write(data) - # release_conn is needed for streaming connections only - response.release_conn() - new_file = open(path, 'rb') - return new_file - else: - return response.data - - @staticmethod - def __deserialize_multipart_form_data( - response: urllib3.HTTPResponse - ) -> typing.Dict[str, typing.Any]: - msg = email.message_from_bytes(response.data) - return { - part.get_param("name", header="Content-Disposition"): part.get_payload( - decode=True - ).decode(part.get_content_charset()) - if part.get_content_charset() - else part.get_payload() - for part in msg.get_payload() - } - - def deserialize(self, response: urllib3.HTTPResponse, configuration: Configuration) -> ApiResponse: - content_type = response.getheader('content-type') - deserialized_body = unset - streamed = response.supports_chunked_reads() - - deserialized_headers = unset - if self.headers is not None: - # TODO add header deserialiation here - pass - - if self.content is not None: - if content_type not in self.content: - raise ApiValueError( - f"Invalid content_type returned. Content_type='{content_type}' was returned " - f"when only {str(set(self.content))} are defined for status_code={str(response.status)}" - ) - body_schema = self.content[content_type].schema - if body_schema is None: - # some specs do not define response content media type schemas - return self.response_cls( - response=response, - headers=deserialized_headers, - body=unset - ) - - if self._content_type_is_json(content_type): - body_data = self.__deserialize_json(response) - elif content_type == 'application/octet-stream': - body_data = self.__deserialize_application_octet_stream(response) - elif content_type.startswith('multipart/form-data'): - body_data = self.__deserialize_multipart_form_data(response) - content_type = 'multipart/form-data' - else: - raise NotImplementedError('Deserialization of {} has not yet been implemented'.format(content_type)) - deserialized_body = body_schema.from_openapi_data_oapg( - body_data, _configuration=configuration) - elif streamed: - response.release_conn() - - return self.response_cls( - response=response, - headers=deserialized_headers, - body=deserialized_body - ) - - -class ApiClient: - """Generic API client for OpenAPI client library builds. - - OpenAPI generic API client. This client handles the client- - server communication, and is invariant across implementations. Specifics of - the methods and models for each application are generated from the OpenAPI - templates. - - NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - Do not edit the class manually. - - :param configuration: .Configuration object for this client - :param header_name: a header to pass when making calls to the API. - :param header_value: a header value to pass when making calls to - the API. - :param cookie: a cookie to include in the header when making calls - to the API - :param pool_threads: The number of threads to use for async requests - to the API. More threads means more concurrent API requests. - """ - - _pool = None - - def __init__( - self, - configuration: typing.Optional[Configuration] = None, - header_name: typing.Optional[str] = None, - header_value: typing.Optional[str] = None, - cookie: typing.Optional[str] = None, - pool_threads: int = 1 - ): - if configuration is None: - configuration = Configuration() - self.configuration = configuration - self.pool_threads = pool_threads - - self.rest_client = rest.RESTClientObject(configuration) - self.default_headers = HTTPHeaderDict() - if header_name is not None: - self.default_headers[header_name] = header_value - self.cookie = cookie - # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/1.0.0/python' - - def __enter__(self): - return self - - def __exit__(self, exc_type, exc_value, traceback): - self.close() - - def close(self): - if self._pool: - self._pool.close() - self._pool.join() - self._pool = None - if hasattr(atexit, 'unregister'): - atexit.unregister(self.close) - - @property - def pool(self): - """Create thread pool on first request - avoids instantiating unused threadpool for blocking clients. - """ - if self._pool is None: - atexit.register(self.close) - self._pool = ThreadPool(self.pool_threads) - return self._pool - - @property - def user_agent(self): - """User agent for this API client""" - return self.default_headers['User-Agent'] - - @user_agent.setter - def user_agent(self, value): - self.default_headers['User-Agent'] = value - - def set_default_header(self, header_name, header_value): - self.default_headers[header_name] = header_value - - def __call_api( - self, - resource_path: str, - method: str, - headers: typing.Optional[HTTPHeaderDict] = None, - body: typing.Optional[typing.Union[str, bytes]] = None, - fields: typing.Optional[typing.Tuple[typing.Tuple[str, str], ...]] = None, - auth_settings: typing.Optional[typing.List[str]] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - host: typing.Optional[str] = None, - ) -> urllib3.HTTPResponse: - - # header parameters - used_headers = HTTPHeaderDict(self.default_headers) - if self.cookie: - headers['Cookie'] = self.cookie - - # auth setting - self.update_params_for_auth(used_headers, - auth_settings, resource_path, method, body) - - # must happen after cookie setting and auth setting in case user is overriding those - if headers: - used_headers.update(headers) - - # request url - if host is None: - url = self.configuration.host + resource_path - else: - # use server/host defined in path or operation instead - url = host + resource_path - - # perform request and return response - response = self.request( - method, - url, - headers=used_headers, - fields=fields, - body=body, - stream=stream, - timeout=timeout, - ) - return response - - def call_api( - self, - resource_path: str, - method: str, - headers: typing.Optional[HTTPHeaderDict] = None, - body: typing.Optional[typing.Union[str, bytes]] = None, - fields: typing.Optional[typing.Tuple[typing.Tuple[str, str], ...]] = None, - auth_settings: typing.Optional[typing.List[str]] = None, - async_req: typing.Optional[bool] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - host: typing.Optional[str] = None, - ) -> urllib3.HTTPResponse: - """Makes the HTTP request (synchronous) and returns deserialized data. - - To make an async_req request, set the async_req parameter. - - :param resource_path: Path to method endpoint. - :param method: Method to call. - :param headers: Header parameters to be - placed in the request header. - :param body: Request body. - :param fields: Request post form parameters, - for `application/x-www-form-urlencoded`, `multipart/form-data`. - :param auth_settings: Auth Settings names for the request. - :param async_req: execute request asynchronously - :type async_req: bool, optional TODO remove, unused - :param stream: if True, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Also when True, if the openapi spec describes a file download, - the data will be written to a local filesystme file and the BinarySchema - instance will also inherit from FileSchema and FileIO - Default is False. - :type stream: bool, optional - :param timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param host: api endpoint host - :return: - If async_req parameter is True, - the request will be called asynchronously. - The method will return the request thread. - If parameter async_req is False or missing, - then the method will return the response directly. - """ - - if not async_req: - return self.__call_api( - resource_path, - method, - headers, - body, - fields, - auth_settings, - stream, - timeout, - host, - ) - - return self.pool.apply_async( - self.__call_api, - ( - resource_path, - method, - headers, - body, - json, - fields, - auth_settings, - stream, - timeout, - host, - ) - ) - - def request( - self, - method: str, - url: str, - headers: typing.Optional[HTTPHeaderDict] = None, - fields: typing.Optional[typing.Tuple[typing.Tuple[str, str], ...]] = None, - body: typing.Optional[typing.Union[str, bytes]] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> urllib3.HTTPResponse: - """Makes the HTTP request using RESTClient.""" - if method == "GET": - return self.rest_client.GET(url, - stream=stream, - timeout=timeout, - headers=headers) - elif method == "HEAD": - return self.rest_client.HEAD(url, - stream=stream, - timeout=timeout, - headers=headers) - elif method == "OPTIONS": - return self.rest_client.OPTIONS(url, - headers=headers, - fields=fields, - stream=stream, - timeout=timeout, - body=body) - elif method == "POST": - return self.rest_client.POST(url, - headers=headers, - fields=fields, - stream=stream, - timeout=timeout, - body=body) - elif method == "PUT": - return self.rest_client.PUT(url, - headers=headers, - fields=fields, - stream=stream, - timeout=timeout, - body=body) - elif method == "PATCH": - return self.rest_client.PATCH(url, - headers=headers, - fields=fields, - stream=stream, - timeout=timeout, - body=body) - elif method == "DELETE": - return self.rest_client.DELETE(url, - headers=headers, - stream=stream, - timeout=timeout, - body=body) - else: - raise ApiValueError( - "http method must be `GET`, `HEAD`, `OPTIONS`," - " `POST`, `PATCH`, `PUT` or `DELETE`." - ) - - def update_params_for_auth(self, headers, auth_settings, - resource_path, method, body): - """Updates header and query params based on authentication setting. - - :param headers: Header parameters dict to be updated. - :param auth_settings: Authentication setting identifiers list. - :param resource_path: A string representation of the HTTP request resource path. - :param method: A string representation of the HTTP request method. - :param body: A object representing the body of the HTTP request. - The object type is the return value of _encoder.default(). - """ - if not auth_settings: - return - - for auth in auth_settings: - auth_setting = self.configuration.auth_settings().get(auth) - if not auth_setting: - continue - if auth_setting['in'] == 'cookie': - headers.add('Cookie', auth_setting['value']) - elif auth_setting['in'] == 'header': - if auth_setting['type'] != 'http-signature': - headers.add(auth_setting['key'], auth_setting['value']) - else: - # The HTTP signature scheme requires multiple HTTP headers - # that are calculated dynamically. - signing_info = self.configuration.signing_info - querys = tuple() - auth_headers = signing_info.get_http_signature_headers( - resource_path, method, headers, body, querys) - for key, value in auth_headers.items(): - headers.add(key, value) - elif auth_setting['in'] == 'query': - """ TODO implement auth in query - need to pass in prefix_separator_iterator - and need to output resource_path with query params added - """ - raise ApiValueError("Auth in query not yet implemented") - else: - raise ApiValueError( - 'Authentication token must be in `query` or `header`' - ) - - -class Api: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client: typing.Optional[ApiClient] = None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - @staticmethod - def _verify_typed_dict_inputs_oapg(cls: typing.Type[typing_extensions.TypedDict], data: typing.Dict[str, typing.Any]): - """ - Ensures that: - - required keys are present - - additional properties are not input - - value stored under required keys do not have the value unset - Note: detailed value checking is done in schema classes - """ - missing_required_keys = [] - required_keys_with_unset_values = [] - for required_key in cls.__required_keys__: - if required_key not in data: - missing_required_keys.append(required_key) - continue - value = data[required_key] - if value is unset: - required_keys_with_unset_values.append(required_key) - if missing_required_keys: - raise ApiTypeError( - '{} missing {} required arguments: {}'.format( - cls.__name__, len(missing_required_keys), missing_required_keys - ) - ) - if required_keys_with_unset_values: - raise ApiValueError( - '{} contains invalid unset values for {} required keys: {}'.format( - cls.__name__, len(required_keys_with_unset_values), required_keys_with_unset_values - ) - ) - - disallowed_additional_keys = [] - for key in data: - if key in cls.__required_keys__ or key in cls.__optional_keys__: - continue - disallowed_additional_keys.append(key) - if disallowed_additional_keys: - raise ApiTypeError( - '{} got {} unexpected keyword arguments: {}'.format( - cls.__name__, len(disallowed_additional_keys), disallowed_additional_keys - ) - ) - - def _get_host_oapg( - self, - operation_id: str, - servers: typing.Tuple[typing.Dict[str, str], ...] = tuple(), - host_index: typing.Optional[int] = None - ) -> typing.Optional[str]: - configuration = self.api_client.configuration - try: - if host_index is None: - index = configuration.server_operation_index.get( - operation_id, configuration.server_index - ) - else: - index = host_index - server_variables = configuration.server_operation_variables.get( - operation_id, configuration.server_variables - ) - host = configuration.get_host_from_settings( - index, variables=server_variables, servers=servers - ) - except IndexError: - if servers: - raise ApiValueError( - "Invalid host index. Must be 0 <= index < %s" % - len(servers) - ) - host = None - return host - - -class SerializedRequestBody(typing_extensions.TypedDict, total=False): - body: typing.Union[str, bytes] - fields: typing.Tuple[typing.Union[RequestField, typing.Tuple[str, str]], ...] - - -class RequestBody(StyleFormSerializer, JSONDetector): - """ - A request body parameter - content: content_type to MediaType Schema info - """ - __json_encoder = JSONEncoder() - - def __init__( - self, - content: typing.Dict[str, MediaType], - required: bool = False, - ): - self.required = required - if len(content) == 0: - raise ValueError('Invalid value for content, the content dict must have >= 1 entry') - self.content = content - - def __serialize_json( - self, - in_data: typing.Any - ) -> typing.Dict[str, bytes]: - in_data = self.__json_encoder.default(in_data) - json_str = json.dumps(in_data, separators=(",", ":"), ensure_ascii=False).encode( - "utf-8" - ) - return dict(body=json_str) - - @staticmethod - def __serialize_text_plain(in_data: typing.Any) -> typing.Dict[str, str]: - if isinstance(in_data, frozendict.frozendict): - raise ValueError('Unable to serialize type frozendict.frozendict to text/plain') - elif isinstance(in_data, tuple): - raise ValueError('Unable to serialize type tuple to text/plain') - elif isinstance(in_data, NoneClass): - raise ValueError('Unable to serialize type NoneClass to text/plain') - elif isinstance(in_data, BoolClass): - raise ValueError('Unable to serialize type BoolClass to text/plain') - return dict(body=str(in_data)) - - def __multipart_json_item(self, key: str, value: Schema) -> RequestField: - json_value = self.__json_encoder.default(value) - request_field = RequestField(name=key, data=json.dumps(json_value)) - request_field.make_multipart(content_type='application/json') - return request_field - - def __multipart_form_item(self, key: str, value: Schema) -> RequestField: - if isinstance(value, str): - request_field = RequestField(name=key, data=str(value)) - request_field.make_multipart(content_type='text/plain') - elif isinstance(value, bytes): - request_field = RequestField(name=key, data=value) - request_field.make_multipart(content_type='application/octet-stream') - elif isinstance(value, FileIO): - # TODO use content.encoding to limit allowed content types if they are present - request_field = RequestField.from_tuples(key, (os.path.basename(value.name), value.read())) - value.close() - else: - request_field = self.__multipart_json_item(key=key, value=value) - return request_field - - def __serialize_multipart_form_data( - self, in_data: Schema - ) -> typing.Dict[str, typing.Tuple[RequestField, ...]]: - if not isinstance(in_data, frozendict.frozendict): - raise ValueError(f'Unable to serialize {in_data} to multipart/form-data because it is not a dict of data') - """ - In a multipart/form-data request body, each schema property, or each element of a schema array property, - takes a section in the payload with an internal header as defined by RFC7578. The serialization strategy - for each property of a multipart/form-data request body can be specified in an associated Encoding Object. - - When passing in multipart types, boundaries MAY be used to separate sections of the content being - transferred – thus, the following default Content-Types are defined for multipart: - - If the (object) property is a primitive, or an array of primitive values, the default Content-Type is text/plain - If the property is complex, or an array of complex values, the default Content-Type is application/json - Question: how is the array of primitives encoded? - If the property is a type: string with a contentEncoding, the default Content-Type is application/octet-stream - """ - fields = [] - for key, value in in_data.items(): - if isinstance(value, tuple): - if value: - # values use explode = True, so the code makes a RequestField for each item with name=key - for item in value: - request_field = self.__multipart_form_item(key=key, value=item) - fields.append(request_field) - else: - # send an empty array as json because exploding will not send it - request_field = self.__multipart_json_item(key=key, value=value) - fields.append(request_field) - else: - request_field = self.__multipart_form_item(key=key, value=value) - fields.append(request_field) - - return dict(fields=tuple(fields)) - - def __serialize_application_octet_stream(self, in_data: BinarySchema) -> typing.Dict[str, bytes]: - if isinstance(in_data, bytes): - return dict(body=in_data) - # FileIO type - result = dict(body=in_data.read()) - in_data.close() - return result - - def __serialize_application_x_www_form_data( - self, in_data: typing.Any - ) -> SerializedRequestBody: - """ - POST submission of form data in body - """ - if not isinstance(in_data, frozendict.frozendict): - raise ValueError( - f'Unable to serialize {in_data} to application/x-www-form-urlencoded because it is not a dict of data') - cast_in_data = self.__json_encoder.default(in_data) - value = self._serialize_form(cast_in_data, name='', explode=True, percent_encode=True) - return dict(body=value) - - def serialize( - self, in_data: typing.Any, content_type: str - ) -> SerializedRequestBody: - """ - If a str is returned then the result will be assigned to data when making the request - If a tuple is returned then the result will be used as fields input in encode_multipart_formdata - Return a tuple of - - The key of the return dict is - - body for application/json - - encode_multipart and fields for multipart/form-data - """ - media_type = self.content[content_type] - if isinstance(in_data, media_type.schema): - cast_in_data = in_data - elif isinstance(in_data, (dict, frozendict.frozendict)) and in_data: - cast_in_data = media_type.schema(**in_data) - else: - cast_in_data = media_type.schema(in_data) - # TODO check for and use encoding if it exists - # and content_type is multipart or application/x-www-form-urlencoded - if self._content_type_is_json(content_type): - return self.__serialize_json(cast_in_data) - elif content_type == 'text/plain': - return self.__serialize_text_plain(cast_in_data) - elif content_type == 'multipart/form-data': - return self.__serialize_multipart_form_data(cast_in_data) - elif content_type == 'application/x-www-form-urlencoded': - return self.__serialize_application_x_www_form_data(cast_in_data) - elif content_type == 'application/octet-stream': - return self.__serialize_application_octet_stream(cast_in_data) - raise NotImplementedError('Serialization has not yet been implemented for {}'.format(content_type)) diff --git a/samples/openapi3/client/petstore/python/petstore_api/apis/path_to_api.py b/samples/openapi3/client/petstore/python/petstore_api/apis/path_to_api.py deleted file mode 100644 index db788e61059..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/apis/path_to_api.py +++ /dev/null @@ -1,158 +0,0 @@ -import typing_extensions - -from petstore_api.paths import PathValues -from petstore_api.apis.paths.foo import Foo -from petstore_api.apis.paths.pet import Pet -from petstore_api.apis.paths.pet_find_by_status import PetFindByStatus -from petstore_api.apis.paths.pet_find_by_tags import PetFindByTags -from petstore_api.apis.paths.pet_pet_id import PetPetId -from petstore_api.apis.paths.pet_pet_id_upload_image import PetPetIdUploadImage -from petstore_api.apis.paths.store_inventory import StoreInventory -from petstore_api.apis.paths.store_order import StoreOrder -from petstore_api.apis.paths.store_order_order_id import StoreOrderOrderId -from petstore_api.apis.paths.user import User -from petstore_api.apis.paths.user_create_with_array import UserCreateWithArray -from petstore_api.apis.paths.user_create_with_list import UserCreateWithList -from petstore_api.apis.paths.user_login import UserLogin -from petstore_api.apis.paths.user_logout import UserLogout -from petstore_api.apis.paths.user_username import UserUsername -from petstore_api.apis.paths.fake_classname_test import FakeClassnameTest -from petstore_api.apis.paths.fake import Fake -from petstore_api.apis.paths.fake_refs_number import FakeRefsNumber -from petstore_api.apis.paths.fake_refs_mammal import FakeRefsMammal -from petstore_api.apis.paths.fake_refs_string import FakeRefsString -from petstore_api.apis.paths.fake_refs_boolean import FakeRefsBoolean -from petstore_api.apis.paths.fake_refs_arraymodel import FakeRefsArraymodel -from petstore_api.apis.paths.fake_refs_composed_one_of_number_with_validations import FakeRefsComposedOneOfNumberWithValidations -from petstore_api.apis.paths.fake_refs_object_model_with_ref_props import FakeRefsObjectModelWithRefProps -from petstore_api.apis.paths.fake_refs_enum import FakeRefsEnum -from petstore_api.apis.paths.fake_refs_array_of_enums import FakeRefsArrayOfEnums -from petstore_api.apis.paths.fake_additional_properties_with_array_of_enums import FakeAdditionalPropertiesWithArrayOfEnums -from petstore_api.apis.paths.fake_json_form_data import FakeJsonFormData -from petstore_api.apis.paths.fake_inline_additional_properties import FakeInlineAdditionalProperties -from petstore_api.apis.paths.fake_body_with_query_params import FakeBodyWithQueryParams -from petstore_api.apis.paths.another_fake_dummy import AnotherFakeDummy -from petstore_api.apis.paths.fake_body_with_file_schema import FakeBodyWithFileSchema -from petstore_api.apis.paths.fake_case_sensitive_params import FakeCaseSensitiveParams -from petstore_api.apis.paths.fake_test_query_paramters import FakeTestQueryParamters -from petstore_api.apis.paths.fake_pet_id_upload_image_with_required_file import FakePetIdUploadImageWithRequiredFile -from petstore_api.apis.paths.fake_parameter_collisions_1_a_b_ab_self_a_b_ import FakeParameterCollisions1ABAbSelfAB -from petstore_api.apis.paths.fake_upload_file import FakeUploadFile -from petstore_api.apis.paths.fake_upload_files import FakeUploadFiles -from petstore_api.apis.paths.fake_upload_download_file import FakeUploadDownloadFile -from petstore_api.apis.paths.fake_health import FakeHealth -from petstore_api.apis.paths.fake_inline_composition_ import FakeInlineComposition -from petstore_api.apis.paths.fake_obj_in_query import FakeObjInQuery -from petstore_api.apis.paths.fake_ref_obj_in_query import FakeRefObjInQuery -from petstore_api.apis.paths.fake_json_with_charset import FakeJsonWithCharset -from petstore_api.apis.paths.fake_response_without_schema import FakeResponseWithoutSchema -from petstore_api.apis.paths.fake_json_patch import FakeJsonPatch -from petstore_api.apis.paths.fake_delete_coffee_id import FakeDeleteCoffeeId -from petstore_api.apis.paths.fake_query_param_with_json_content_type import FakeQueryParamWithJsonContentType - -PathToApi = typing_extensions.TypedDict( - 'PathToApi', - { - PathValues.FOO: Foo, - PathValues.PET: Pet, - PathValues.PET_FIND_BY_STATUS: PetFindByStatus, - PathValues.PET_FIND_BY_TAGS: PetFindByTags, - PathValues.PET_PET_ID: PetPetId, - PathValues.PET_PET_ID_UPLOAD_IMAGE: PetPetIdUploadImage, - PathValues.STORE_INVENTORY: StoreInventory, - PathValues.STORE_ORDER: StoreOrder, - PathValues.STORE_ORDER_ORDER_ID: StoreOrderOrderId, - PathValues.USER: User, - PathValues.USER_CREATE_WITH_ARRAY: UserCreateWithArray, - PathValues.USER_CREATE_WITH_LIST: UserCreateWithList, - PathValues.USER_LOGIN: UserLogin, - PathValues.USER_LOGOUT: UserLogout, - PathValues.USER_USERNAME: UserUsername, - PathValues.FAKE_CLASSNAME_TEST: FakeClassnameTest, - PathValues.FAKE: Fake, - PathValues.FAKE_REFS_NUMBER: FakeRefsNumber, - PathValues.FAKE_REFS_MAMMAL: FakeRefsMammal, - PathValues.FAKE_REFS_STRING: FakeRefsString, - PathValues.FAKE_REFS_BOOLEAN: FakeRefsBoolean, - PathValues.FAKE_REFS_ARRAYMODEL: FakeRefsArraymodel, - PathValues.FAKE_REFS_COMPOSED_ONE_OF_NUMBER_WITH_VALIDATIONS: FakeRefsComposedOneOfNumberWithValidations, - PathValues.FAKE_REFS_OBJECT_MODEL_WITH_REF_PROPS: FakeRefsObjectModelWithRefProps, - PathValues.FAKE_REFS_ENUM: FakeRefsEnum, - PathValues.FAKE_REFS_ARRAYOFENUMS: FakeRefsArrayOfEnums, - PathValues.FAKE_ADDITIONALPROPERTIESWITHARRAYOFENUMS: FakeAdditionalPropertiesWithArrayOfEnums, - PathValues.FAKE_JSON_FORM_DATA: FakeJsonFormData, - PathValues.FAKE_INLINEADDITIONAL_PROPERTIES: FakeInlineAdditionalProperties, - PathValues.FAKE_BODYWITHQUERYPARAMS: FakeBodyWithQueryParams, - PathValues.ANOTHERFAKE_DUMMY: AnotherFakeDummy, - PathValues.FAKE_BODYWITHFILESCHEMA: FakeBodyWithFileSchema, - PathValues.FAKE_CASESENSITIVEPARAMS: FakeCaseSensitiveParams, - PathValues.FAKE_TESTQUERYPARAMTERS: FakeTestQueryParamters, - PathValues.FAKE_PET_ID_UPLOAD_IMAGE_WITH_REQUIRED_FILE: FakePetIdUploadImageWithRequiredFile, - PathValues.FAKE_PARAMETER_COLLISIONS_1_A_B_AB_SELF_AB_: FakeParameterCollisions1ABAbSelfAB, - PathValues.FAKE_UPLOAD_FILE: FakeUploadFile, - PathValues.FAKE_UPLOAD_FILES: FakeUploadFiles, - PathValues.FAKE_UPLOAD_DOWNLOAD_FILE: FakeUploadDownloadFile, - PathValues.FAKE_HEALTH: FakeHealth, - PathValues.FAKE_INLINE_COMPOSITION_: FakeInlineComposition, - PathValues.FAKE_OBJ_IN_QUERY: FakeObjInQuery, - PathValues.FAKE_REF_OBJ_IN_QUERY: FakeRefObjInQuery, - PathValues.FAKE_JSON_WITH_CHARSET: FakeJsonWithCharset, - PathValues.FAKE_RESPONSE_WITHOUT_SCHEMA: FakeResponseWithoutSchema, - PathValues.FAKE_JSON_PATCH: FakeJsonPatch, - PathValues.FAKE_DELETE_COFFEE_ID: FakeDeleteCoffeeId, - PathValues.FAKE_QUERY_PARAM_WITH_JSON_CONTENT_TYPE: FakeQueryParamWithJsonContentType, - } -) - -path_to_api = PathToApi( - { - PathValues.FOO: Foo, - PathValues.PET: Pet, - PathValues.PET_FIND_BY_STATUS: PetFindByStatus, - PathValues.PET_FIND_BY_TAGS: PetFindByTags, - PathValues.PET_PET_ID: PetPetId, - PathValues.PET_PET_ID_UPLOAD_IMAGE: PetPetIdUploadImage, - PathValues.STORE_INVENTORY: StoreInventory, - PathValues.STORE_ORDER: StoreOrder, - PathValues.STORE_ORDER_ORDER_ID: StoreOrderOrderId, - PathValues.USER: User, - PathValues.USER_CREATE_WITH_ARRAY: UserCreateWithArray, - PathValues.USER_CREATE_WITH_LIST: UserCreateWithList, - PathValues.USER_LOGIN: UserLogin, - PathValues.USER_LOGOUT: UserLogout, - PathValues.USER_USERNAME: UserUsername, - PathValues.FAKE_CLASSNAME_TEST: FakeClassnameTest, - PathValues.FAKE: Fake, - PathValues.FAKE_REFS_NUMBER: FakeRefsNumber, - PathValues.FAKE_REFS_MAMMAL: FakeRefsMammal, - PathValues.FAKE_REFS_STRING: FakeRefsString, - PathValues.FAKE_REFS_BOOLEAN: FakeRefsBoolean, - PathValues.FAKE_REFS_ARRAYMODEL: FakeRefsArraymodel, - PathValues.FAKE_REFS_COMPOSED_ONE_OF_NUMBER_WITH_VALIDATIONS: FakeRefsComposedOneOfNumberWithValidations, - PathValues.FAKE_REFS_OBJECT_MODEL_WITH_REF_PROPS: FakeRefsObjectModelWithRefProps, - PathValues.FAKE_REFS_ENUM: FakeRefsEnum, - PathValues.FAKE_REFS_ARRAYOFENUMS: FakeRefsArrayOfEnums, - PathValues.FAKE_ADDITIONALPROPERTIESWITHARRAYOFENUMS: FakeAdditionalPropertiesWithArrayOfEnums, - PathValues.FAKE_JSON_FORM_DATA: FakeJsonFormData, - PathValues.FAKE_INLINEADDITIONAL_PROPERTIES: FakeInlineAdditionalProperties, - PathValues.FAKE_BODYWITHQUERYPARAMS: FakeBodyWithQueryParams, - PathValues.ANOTHERFAKE_DUMMY: AnotherFakeDummy, - PathValues.FAKE_BODYWITHFILESCHEMA: FakeBodyWithFileSchema, - PathValues.FAKE_CASESENSITIVEPARAMS: FakeCaseSensitiveParams, - PathValues.FAKE_TESTQUERYPARAMTERS: FakeTestQueryParamters, - PathValues.FAKE_PET_ID_UPLOAD_IMAGE_WITH_REQUIRED_FILE: FakePetIdUploadImageWithRequiredFile, - PathValues.FAKE_PARAMETER_COLLISIONS_1_A_B_AB_SELF_AB_: FakeParameterCollisions1ABAbSelfAB, - PathValues.FAKE_UPLOAD_FILE: FakeUploadFile, - PathValues.FAKE_UPLOAD_FILES: FakeUploadFiles, - PathValues.FAKE_UPLOAD_DOWNLOAD_FILE: FakeUploadDownloadFile, - PathValues.FAKE_HEALTH: FakeHealth, - PathValues.FAKE_INLINE_COMPOSITION_: FakeInlineComposition, - PathValues.FAKE_OBJ_IN_QUERY: FakeObjInQuery, - PathValues.FAKE_REF_OBJ_IN_QUERY: FakeRefObjInQuery, - PathValues.FAKE_JSON_WITH_CHARSET: FakeJsonWithCharset, - PathValues.FAKE_RESPONSE_WITHOUT_SCHEMA: FakeResponseWithoutSchema, - PathValues.FAKE_JSON_PATCH: FakeJsonPatch, - PathValues.FAKE_DELETE_COFFEE_ID: FakeDeleteCoffeeId, - PathValues.FAKE_QUERY_PARAM_WITH_JSON_CONTENT_TYPE: FakeQueryParamWithJsonContentType, - } -) diff --git a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/__init__.py deleted file mode 100644 index a0e17c5536e..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from petstore_api.apis.path_to_api import path_to_api diff --git a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/another_fake_dummy.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/another_fake_dummy.py deleted file mode 100644 index 8fafb8f1156..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/another_fake_dummy.py +++ /dev/null @@ -1,7 +0,0 @@ -from petstore_api.paths.another_fake_dummy.patch import ApiForpatch - - -class AnotherFakeDummy( - ApiForpatch, -): - pass diff --git a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake.py deleted file mode 100644 index f8de5e6f9d9..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake.py +++ /dev/null @@ -1,13 +0,0 @@ -from petstore_api.paths.fake.get import ApiForget -from petstore_api.paths.fake.post import ApiForpost -from petstore_api.paths.fake.delete import ApiFordelete -from petstore_api.paths.fake.patch import ApiForpatch - - -class Fake( - ApiForget, - ApiForpost, - ApiFordelete, - ApiForpatch, -): - pass diff --git a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_additional_properties_with_array_of_enums.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_additional_properties_with_array_of_enums.py deleted file mode 100644 index 3df79a3103d..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_additional_properties_with_array_of_enums.py +++ /dev/null @@ -1,7 +0,0 @@ -from petstore_api.paths.fake_additional_properties_with_array_of_enums.get import ApiForget - - -class FakeAdditionalPropertiesWithArrayOfEnums( - ApiForget, -): - pass diff --git a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_body_with_file_schema.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_body_with_file_schema.py deleted file mode 100644 index d95c287ecc9..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_body_with_file_schema.py +++ /dev/null @@ -1,7 +0,0 @@ -from petstore_api.paths.fake_body_with_file_schema.put import ApiForput - - -class FakeBodyWithFileSchema( - ApiForput, -): - pass diff --git a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_body_with_query_params.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_body_with_query_params.py deleted file mode 100644 index 4c77fc0c0dc..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_body_with_query_params.py +++ /dev/null @@ -1,7 +0,0 @@ -from petstore_api.paths.fake_body_with_query_params.put import ApiForput - - -class FakeBodyWithQueryParams( - ApiForput, -): - pass diff --git a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_case_sensitive_params.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_case_sensitive_params.py deleted file mode 100644 index c5dafb43a08..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_case_sensitive_params.py +++ /dev/null @@ -1,7 +0,0 @@ -from petstore_api.paths.fake_case_sensitive_params.put import ApiForput - - -class FakeCaseSensitiveParams( - ApiForput, -): - pass diff --git a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_classname_test.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_classname_test.py deleted file mode 100644 index 090ec6025f7..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_classname_test.py +++ /dev/null @@ -1,7 +0,0 @@ -from petstore_api.paths.fake_classname_test.patch import ApiForpatch - - -class FakeClassnameTest( - ApiForpatch, -): - pass diff --git a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_delete_coffee_id.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_delete_coffee_id.py deleted file mode 100644 index 589ba701a7b..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_delete_coffee_id.py +++ /dev/null @@ -1,7 +0,0 @@ -from petstore_api.paths.fake_delete_coffee_id.delete import ApiFordelete - - -class FakeDeleteCoffeeId( - ApiFordelete, -): - pass diff --git a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_health.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_health.py deleted file mode 100644 index fc5bf3258bd..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_health.py +++ /dev/null @@ -1,7 +0,0 @@ -from petstore_api.paths.fake_health.get import ApiForget - - -class FakeHealth( - ApiForget, -): - pass diff --git a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_inline_additional_properties.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_inline_additional_properties.py deleted file mode 100644 index 57bdd0745ab..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_inline_additional_properties.py +++ /dev/null @@ -1,7 +0,0 @@ -from petstore_api.paths.fake_inline_additional_properties.post import ApiForpost - - -class FakeInlineAdditionalProperties( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_inline_composition_.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_inline_composition_.py deleted file mode 100644 index 9854c250b1b..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_inline_composition_.py +++ /dev/null @@ -1,7 +0,0 @@ -from petstore_api.paths.fake_inline_composition_.post import ApiForpost - - -class FakeInlineComposition( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_json_form_data.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_json_form_data.py deleted file mode 100644 index 1533f9805ec..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_json_form_data.py +++ /dev/null @@ -1,7 +0,0 @@ -from petstore_api.paths.fake_json_form_data.get import ApiForget - - -class FakeJsonFormData( - ApiForget, -): - pass diff --git a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_json_patch.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_json_patch.py deleted file mode 100644 index 53e563dbdb9..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_json_patch.py +++ /dev/null @@ -1,7 +0,0 @@ -from petstore_api.paths.fake_json_patch.patch import ApiForpatch - - -class FakeJsonPatch( - ApiForpatch, -): - pass diff --git a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_json_with_charset.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_json_with_charset.py deleted file mode 100644 index a1a4c38e671..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_json_with_charset.py +++ /dev/null @@ -1,7 +0,0 @@ -from petstore_api.paths.fake_json_with_charset.post import ApiForpost - - -class FakeJsonWithCharset( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_obj_in_query.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_obj_in_query.py deleted file mode 100644 index a0515808141..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_obj_in_query.py +++ /dev/null @@ -1,7 +0,0 @@ -from petstore_api.paths.fake_obj_in_query.get import ApiForget - - -class FakeObjInQuery( - ApiForget, -): - pass diff --git a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_parameter_collisions_1_a_b_ab_self_a_b_.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_parameter_collisions_1_a_b_ab_self_a_b_.py deleted file mode 100644 index e99db37cd94..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_parameter_collisions_1_a_b_ab_self_a_b_.py +++ /dev/null @@ -1,7 +0,0 @@ -from petstore_api.paths.fake_parameter_collisions_1_a_b_ab_self_a_b_.post import ApiForpost - - -class FakeParameterCollisions1ABAbSelfAB( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_pet_id_upload_image_with_required_file.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_pet_id_upload_image_with_required_file.py deleted file mode 100644 index 06b4b53bbd6..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_pet_id_upload_image_with_required_file.py +++ /dev/null @@ -1,7 +0,0 @@ -from petstore_api.paths.fake_pet_id_upload_image_with_required_file.post import ApiForpost - - -class FakePetIdUploadImageWithRequiredFile( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_query_param_with_json_content_type.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_query_param_with_json_content_type.py deleted file mode 100644 index 96aa0592a02..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_query_param_with_json_content_type.py +++ /dev/null @@ -1,7 +0,0 @@ -from petstore_api.paths.fake_query_param_with_json_content_type.get import ApiForget - - -class FakeQueryParamWithJsonContentType( - ApiForget, -): - pass diff --git a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_ref_obj_in_query.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_ref_obj_in_query.py deleted file mode 100644 index 5cb347c09ce..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_ref_obj_in_query.py +++ /dev/null @@ -1,7 +0,0 @@ -from petstore_api.paths.fake_ref_obj_in_query.get import ApiForget - - -class FakeRefObjInQuery( - ApiForget, -): - pass diff --git a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_refs_array_of_enums.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_refs_array_of_enums.py deleted file mode 100644 index 8aca3fb8d06..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_refs_array_of_enums.py +++ /dev/null @@ -1,7 +0,0 @@ -from petstore_api.paths.fake_refs_array_of_enums.post import ApiForpost - - -class FakeRefsArrayOfEnums( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_refs_arraymodel.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_refs_arraymodel.py deleted file mode 100644 index de94cbe4983..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_refs_arraymodel.py +++ /dev/null @@ -1,7 +0,0 @@ -from petstore_api.paths.fake_refs_arraymodel.post import ApiForpost - - -class FakeRefsArraymodel( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_refs_boolean.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_refs_boolean.py deleted file mode 100644 index d3a08723b2f..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_refs_boolean.py +++ /dev/null @@ -1,7 +0,0 @@ -from petstore_api.paths.fake_refs_boolean.post import ApiForpost - - -class FakeRefsBoolean( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_refs_composed_one_of_number_with_validations.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_refs_composed_one_of_number_with_validations.py deleted file mode 100644 index 2caf9048a4d..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_refs_composed_one_of_number_with_validations.py +++ /dev/null @@ -1,7 +0,0 @@ -from petstore_api.paths.fake_refs_composed_one_of_number_with_validations.post import ApiForpost - - -class FakeRefsComposedOneOfNumberWithValidations( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_refs_enum.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_refs_enum.py deleted file mode 100644 index b05f5b2d012..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_refs_enum.py +++ /dev/null @@ -1,7 +0,0 @@ -from petstore_api.paths.fake_refs_enum.post import ApiForpost - - -class FakeRefsEnum( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_refs_mammal.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_refs_mammal.py deleted file mode 100644 index fe0e0b427d0..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_refs_mammal.py +++ /dev/null @@ -1,7 +0,0 @@ -from petstore_api.paths.fake_refs_mammal.post import ApiForpost - - -class FakeRefsMammal( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_refs_number.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_refs_number.py deleted file mode 100644 index af4111830d7..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_refs_number.py +++ /dev/null @@ -1,7 +0,0 @@ -from petstore_api.paths.fake_refs_number.post import ApiForpost - - -class FakeRefsNumber( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_refs_object_model_with_ref_props.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_refs_object_model_with_ref_props.py deleted file mode 100644 index 1554afa997a..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_refs_object_model_with_ref_props.py +++ /dev/null @@ -1,7 +0,0 @@ -from petstore_api.paths.fake_refs_object_model_with_ref_props.post import ApiForpost - - -class FakeRefsObjectModelWithRefProps( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_refs_string.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_refs_string.py deleted file mode 100644 index 9420eeb048f..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_refs_string.py +++ /dev/null @@ -1,7 +0,0 @@ -from petstore_api.paths.fake_refs_string.post import ApiForpost - - -class FakeRefsString( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_response_without_schema.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_response_without_schema.py deleted file mode 100644 index 56590de8d0b..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_response_without_schema.py +++ /dev/null @@ -1,7 +0,0 @@ -from petstore_api.paths.fake_response_without_schema.get import ApiForget - - -class FakeResponseWithoutSchema( - ApiForget, -): - pass diff --git a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_test_query_paramters.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_test_query_paramters.py deleted file mode 100644 index ff97fcdf59b..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_test_query_paramters.py +++ /dev/null @@ -1,7 +0,0 @@ -from petstore_api.paths.fake_test_query_paramters.put import ApiForput - - -class FakeTestQueryParamters( - ApiForput, -): - pass diff --git a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_upload_download_file.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_upload_download_file.py deleted file mode 100644 index f41a00e3e45..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_upload_download_file.py +++ /dev/null @@ -1,7 +0,0 @@ -from petstore_api.paths.fake_upload_download_file.post import ApiForpost - - -class FakeUploadDownloadFile( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_upload_file.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_upload_file.py deleted file mode 100644 index b080fcd26c7..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_upload_file.py +++ /dev/null @@ -1,7 +0,0 @@ -from petstore_api.paths.fake_upload_file.post import ApiForpost - - -class FakeUploadFile( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_upload_files.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_upload_files.py deleted file mode 100644 index 6f47e0b8f09..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_upload_files.py +++ /dev/null @@ -1,7 +0,0 @@ -from petstore_api.paths.fake_upload_files.post import ApiForpost - - -class FakeUploadFiles( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/foo.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/foo.py deleted file mode 100644 index 237a0fba70b..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/foo.py +++ /dev/null @@ -1,7 +0,0 @@ -from petstore_api.paths.foo.get import ApiForget - - -class Foo( - ApiForget, -): - pass diff --git a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/pet.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/pet.py deleted file mode 100644 index 8e9f07940b6..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/pet.py +++ /dev/null @@ -1,9 +0,0 @@ -from petstore_api.paths.pet.put import ApiForput -from petstore_api.paths.pet.post import ApiForpost - - -class Pet( - ApiForput, - ApiForpost, -): - pass diff --git a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/pet_find_by_status.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/pet_find_by_status.py deleted file mode 100644 index 86a6eebf135..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/pet_find_by_status.py +++ /dev/null @@ -1,7 +0,0 @@ -from petstore_api.paths.pet_find_by_status.get import ApiForget - - -class PetFindByStatus( - ApiForget, -): - pass diff --git a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/pet_find_by_tags.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/pet_find_by_tags.py deleted file mode 100644 index c0f4090e4eb..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/pet_find_by_tags.py +++ /dev/null @@ -1,7 +0,0 @@ -from petstore_api.paths.pet_find_by_tags.get import ApiForget - - -class PetFindByTags( - ApiForget, -): - pass diff --git a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/pet_pet_id.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/pet_pet_id.py deleted file mode 100644 index 6290395b837..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/pet_pet_id.py +++ /dev/null @@ -1,11 +0,0 @@ -from petstore_api.paths.pet_pet_id.get import ApiForget -from petstore_api.paths.pet_pet_id.post import ApiForpost -from petstore_api.paths.pet_pet_id.delete import ApiFordelete - - -class PetPetId( - ApiForget, - ApiForpost, - ApiFordelete, -): - pass diff --git a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/pet_pet_id_upload_image.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/pet_pet_id_upload_image.py deleted file mode 100644 index 92bfe397009..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/pet_pet_id_upload_image.py +++ /dev/null @@ -1,7 +0,0 @@ -from petstore_api.paths.pet_pet_id_upload_image.post import ApiForpost - - -class PetPetIdUploadImage( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/store_inventory.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/store_inventory.py deleted file mode 100644 index f614016a111..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/store_inventory.py +++ /dev/null @@ -1,7 +0,0 @@ -from petstore_api.paths.store_inventory.get import ApiForget - - -class StoreInventory( - ApiForget, -): - pass diff --git a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/store_order.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/store_order.py deleted file mode 100644 index 827bc76647c..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/store_order.py +++ /dev/null @@ -1,7 +0,0 @@ -from petstore_api.paths.store_order.post import ApiForpost - - -class StoreOrder( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/store_order_order_id.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/store_order_order_id.py deleted file mode 100644 index 1436ff0b936..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/store_order_order_id.py +++ /dev/null @@ -1,9 +0,0 @@ -from petstore_api.paths.store_order_order_id.get import ApiForget -from petstore_api.paths.store_order_order_id.delete import ApiFordelete - - -class StoreOrderOrderId( - ApiForget, - ApiFordelete, -): - pass diff --git a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/user.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/user.py deleted file mode 100644 index b708c602e74..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/user.py +++ /dev/null @@ -1,7 +0,0 @@ -from petstore_api.paths.user.post import ApiForpost - - -class User( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/user_create_with_array.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/user_create_with_array.py deleted file mode 100644 index d3d5904cebc..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/user_create_with_array.py +++ /dev/null @@ -1,7 +0,0 @@ -from petstore_api.paths.user_create_with_array.post import ApiForpost - - -class UserCreateWithArray( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/user_create_with_list.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/user_create_with_list.py deleted file mode 100644 index f8f3f34d400..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/user_create_with_list.py +++ /dev/null @@ -1,7 +0,0 @@ -from petstore_api.paths.user_create_with_list.post import ApiForpost - - -class UserCreateWithList( - ApiForpost, -): - pass diff --git a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/user_login.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/user_login.py deleted file mode 100644 index 5cd6b4e0f89..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/user_login.py +++ /dev/null @@ -1,7 +0,0 @@ -from petstore_api.paths.user_login.get import ApiForget - - -class UserLogin( - ApiForget, -): - pass diff --git a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/user_logout.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/user_logout.py deleted file mode 100644 index 621e15a8a31..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/user_logout.py +++ /dev/null @@ -1,7 +0,0 @@ -from petstore_api.paths.user_logout.get import ApiForget - - -class UserLogout( - ApiForget, -): - pass diff --git a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/user_username.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/user_username.py deleted file mode 100644 index 16710585ee0..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/apis/paths/user_username.py +++ /dev/null @@ -1,11 +0,0 @@ -from petstore_api.paths.user_username.get import ApiForget -from petstore_api.paths.user_username.put import ApiForput -from petstore_api.paths.user_username.delete import ApiFordelete - - -class UserUsername( - ApiForget, - ApiForput, - ApiFordelete, -): - pass diff --git a/samples/openapi3/client/petstore/python/petstore_api/apis/tag_to_api.py b/samples/openapi3/client/petstore/python/petstore_api/apis/tag_to_api.py deleted file mode 100644 index ad42a5d1dec..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/apis/tag_to_api.py +++ /dev/null @@ -1,35 +0,0 @@ -import typing_extensions - -from petstore_api.apis.tags import TagValues -from petstore_api.apis.tags.pet_api import PetApi -from petstore_api.apis.tags.store_api import StoreApi -from petstore_api.apis.tags.user_api import UserApi -from petstore_api.apis.tags.another_fake_api import AnotherFakeApi -from petstore_api.apis.tags.default_api import DefaultApi -from petstore_api.apis.tags.fake_api import FakeApi -from petstore_api.apis.tags.fake_classname_tags123_api import FakeClassnameTags123Api - -TagToApi = typing_extensions.TypedDict( - 'TagToApi', - { - TagValues.PET: PetApi, - TagValues.STORE: StoreApi, - TagValues.USER: UserApi, - TagValues.ANOTHERFAKE: AnotherFakeApi, - TagValues.DEFAULT: DefaultApi, - TagValues.FAKE: FakeApi, - TagValues.FAKE_CLASSNAME_TAGS_123: FakeClassnameTags123Api, - } -) - -tag_to_api = TagToApi( - { - TagValues.PET: PetApi, - TagValues.STORE: StoreApi, - TagValues.USER: UserApi, - TagValues.ANOTHERFAKE: AnotherFakeApi, - TagValues.DEFAULT: DefaultApi, - TagValues.FAKE: FakeApi, - TagValues.FAKE_CLASSNAME_TAGS_123: FakeClassnameTags123Api, - } -) diff --git a/samples/openapi3/client/petstore/python/petstore_api/apis/tags/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/apis/tags/__init__.py deleted file mode 100644 index a8ec6fddd9a..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/apis/tags/__init__.py +++ /dev/null @@ -1,15 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from petstore_api.apis.tag_to_api import tag_to_api - -import enum - - -class TagValues(str, enum.Enum): - PET = "pet" - STORE = "store" - USER = "user" - ANOTHERFAKE = "$another-fake?" - DEFAULT = "default" - FAKE = "fake" - FAKE_CLASSNAME_TAGS_123 = "fake_classname_tags 123#$%^" diff --git a/samples/openapi3/client/petstore/python/petstore_api/apis/tags/another_fake_api.py b/samples/openapi3/client/petstore/python/petstore_api/apis/tags/another_fake_api.py deleted file mode 100644 index 129fbd75107..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/apis/tags/another_fake_api.py +++ /dev/null @@ -1,23 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from petstore_api.paths.another_fake_dummy.patch import Call123TestSpecialTags - - -class AnotherFakeApi( - Call123TestSpecialTags, -): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - pass diff --git a/samples/openapi3/client/petstore/python/petstore_api/apis/tags/default_api.py b/samples/openapi3/client/petstore/python/petstore_api/apis/tags/default_api.py deleted file mode 100644 index 99639a6994d..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/apis/tags/default_api.py +++ /dev/null @@ -1,23 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from petstore_api.paths.foo.get import FooGet - - -class DefaultApi( - FooGet, -): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - pass diff --git a/samples/openapi3/client/petstore/python/petstore_api/apis/tags/fake_api.py b/samples/openapi3/client/petstore/python/petstore_api/apis/tags/fake_api.py deleted file mode 100644 index 564d77038a3..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/apis/tags/fake_api.py +++ /dev/null @@ -1,87 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from petstore_api.paths.fake_additional_properties_with_array_of_enums.get import AdditionalPropertiesWithArrayOfEnums -from petstore_api.paths.fake_refs_arraymodel.post import ArrayModel -from petstore_api.paths.fake_refs_array_of_enums.post import ArrayOfEnums -from petstore_api.paths.fake_body_with_file_schema.put import BodyWithFileSchema -from petstore_api.paths.fake_body_with_query_params.put import BodyWithQueryParams -from petstore_api.paths.fake_refs_boolean.post import Boolean -from petstore_api.paths.fake_case_sensitive_params.put import CaseSensitiveParams -from petstore_api.paths.fake.patch import ClientModel -from petstore_api.paths.fake_refs_composed_one_of_number_with_validations.post import ComposedOneOfDifferentTypes -from petstore_api.paths.fake_delete_coffee_id.delete import DeleteCoffee -from petstore_api.paths.fake.post import EndpointParameters -from petstore_api.paths.fake.get import EnumParameters -from petstore_api.paths.fake_health.get import FakeHealthGet -from petstore_api.paths.fake.delete import GroupParameters -from petstore_api.paths.fake_inline_additional_properties.post import InlineAdditionalProperties -from petstore_api.paths.fake_inline_composition_.post import InlineComposition -from petstore_api.paths.fake_json_form_data.get import JsonFormData -from petstore_api.paths.fake_json_patch.patch import JsonPatch -from petstore_api.paths.fake_json_with_charset.post import JsonWithCharset -from petstore_api.paths.fake_refs_mammal.post import Mammal -from petstore_api.paths.fake_refs_number.post import NumberWithValidations -from petstore_api.paths.fake_obj_in_query.get import ObjectInQuery -from petstore_api.paths.fake_refs_object_model_with_ref_props.post import ObjectModelWithRefProps -from petstore_api.paths.fake_parameter_collisions_1_a_b_ab_self_a_b_.post import ParameterCollisions -from petstore_api.paths.fake_query_param_with_json_content_type.get import QueryParamWithJsonContentType -from petstore_api.paths.fake_test_query_paramters.put import QueryParameterCollectionFormat -from petstore_api.paths.fake_ref_obj_in_query.get import RefObjectInQuery -from petstore_api.paths.fake_response_without_schema.get import ResponseWithoutSchema -from petstore_api.paths.fake_refs_string.post import String -from petstore_api.paths.fake_refs_enum.post import StringEnum -from petstore_api.paths.fake_upload_download_file.post import UploadDownloadFile -from petstore_api.paths.fake_upload_file.post import UploadFile -from petstore_api.paths.fake_upload_files.post import UploadFiles - - -class FakeApi( - AdditionalPropertiesWithArrayOfEnums, - ArrayModel, - ArrayOfEnums, - BodyWithFileSchema, - BodyWithQueryParams, - Boolean, - CaseSensitiveParams, - ClientModel, - ComposedOneOfDifferentTypes, - DeleteCoffee, - EndpointParameters, - EnumParameters, - FakeHealthGet, - GroupParameters, - InlineAdditionalProperties, - InlineComposition, - JsonFormData, - JsonPatch, - JsonWithCharset, - Mammal, - NumberWithValidations, - ObjectInQuery, - ObjectModelWithRefProps, - ParameterCollisions, - QueryParamWithJsonContentType, - QueryParameterCollectionFormat, - RefObjectInQuery, - ResponseWithoutSchema, - String, - StringEnum, - UploadDownloadFile, - UploadFile, - UploadFiles, -): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - pass diff --git a/samples/openapi3/client/petstore/python/petstore_api/apis/tags/fake_classname_tags123_api.py b/samples/openapi3/client/petstore/python/petstore_api/apis/tags/fake_classname_tags123_api.py deleted file mode 100644 index 9997b64ba73..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/apis/tags/fake_classname_tags123_api.py +++ /dev/null @@ -1,23 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from petstore_api.paths.fake_classname_test.patch import Classname - - -class FakeClassnameTags123Api( - Classname, -): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - pass diff --git a/samples/openapi3/client/petstore/python/petstore_api/apis/tags/pet_api.py b/samples/openapi3/client/petstore/python/petstore_api/apis/tags/pet_api.py deleted file mode 100644 index 402e69c9cfc..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/apis/tags/pet_api.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from petstore_api.paths.pet.post import AddPet -from petstore_api.paths.pet_pet_id.delete import DeletePet -from petstore_api.paths.pet_find_by_status.get import FindPetsByStatus -from petstore_api.paths.pet_find_by_tags.get import FindPetsByTags -from petstore_api.paths.pet_pet_id.get import GetPetById -from petstore_api.paths.pet.put import UpdatePet -from petstore_api.paths.pet_pet_id.post import UpdatePetWithForm -from petstore_api.paths.fake_pet_id_upload_image_with_required_file.post import UploadFileWithRequiredFile -from petstore_api.paths.pet_pet_id_upload_image.post import UploadImage - - -class PetApi( - AddPet, - DeletePet, - FindPetsByStatus, - FindPetsByTags, - GetPetById, - UpdatePet, - UpdatePetWithForm, - UploadFileWithRequiredFile, - UploadImage, -): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - pass diff --git a/samples/openapi3/client/petstore/python/petstore_api/apis/tags/store_api.py b/samples/openapi3/client/petstore/python/petstore_api/apis/tags/store_api.py deleted file mode 100644 index b9e1d09ed52..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/apis/tags/store_api.py +++ /dev/null @@ -1,29 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from petstore_api.paths.store_order_order_id.delete import DeleteOrder -from petstore_api.paths.store_inventory.get import GetInventory -from petstore_api.paths.store_order_order_id.get import GetOrderById -from petstore_api.paths.store_order.post import PlaceOrder - - -class StoreApi( - DeleteOrder, - GetInventory, - GetOrderById, - PlaceOrder, -): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - pass diff --git a/samples/openapi3/client/petstore/python/petstore_api/apis/tags/user_api.py b/samples/openapi3/client/petstore/python/petstore_api/apis/tags/user_api.py deleted file mode 100644 index b84994811c1..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/apis/tags/user_api.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from petstore_api.paths.user.post import CreateUser -from petstore_api.paths.user_create_with_array.post import CreateUsersWithArrayInput -from petstore_api.paths.user_create_with_list.post import CreateUsersWithListInput -from petstore_api.paths.user_username.delete import DeleteUser -from petstore_api.paths.user_username.get import GetUserByName -from petstore_api.paths.user_login.get import LoginUser -from petstore_api.paths.user_logout.get import LogoutUser -from petstore_api.paths.user_username.put import UpdateUser - - -class UserApi( - CreateUser, - CreateUsersWithArrayInput, - CreateUsersWithListInput, - DeleteUser, - GetUserByName, - LoginUser, - LogoutUser, - UpdateUser, -): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - pass diff --git a/samples/openapi3/client/petstore/python/petstore_api/configuration.py b/samples/openapi3/client/petstore/python/petstore_api/configuration.py deleted file mode 100644 index 3e09af0b250..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/configuration.py +++ /dev/null @@ -1,604 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import copy -import logging -import multiprocessing -import sys -import urllib3 - -from http import client as http_client -from petstore_api.exceptions import ApiValueError - - -JSON_SCHEMA_VALIDATION_KEYWORDS = { - 'multipleOf', 'maximum', 'exclusiveMaximum', - 'minimum', 'exclusiveMinimum', 'maxLength', - 'minLength', 'pattern', 'maxItems', 'minItems', - 'uniqueItems', 'maxProperties', 'minProperties', -} - -class Configuration(object): - """NOTE: This class is auto generated by OpenAPI Generator - - Ref: https://openapi-generator.tech - Do not edit the class manually. - - :param host: Base url - :param api_key: Dict to store API key(s). - Each entry in the dict specifies an API key. - The dict key is the name of the security scheme in the OAS specification. - The dict value is the API key secret. - :param api_key_prefix: Dict to store API prefix (e.g. Bearer) - The dict key is the name of the security scheme in the OAS specification. - The dict value is an API key prefix when generating the auth data. - :param username: Username for HTTP basic authentication - :param password: Password for HTTP basic authentication - :param disabled_client_side_validations (string): Comma-separated list of - JSON schema validation keywords to disable JSON schema structural validation - rules. The following keywords may be specified: multipleOf, maximum, - exclusiveMaximum, minimum, exclusiveMinimum, maxLength, minLength, pattern, - maxItems, minItems. - By default, the validation is performed for data generated locally by the client - and data received from the server, independent of any validation performed by - the server side. If the input data does not satisfy the JSON schema validation - rules specified in the OpenAPI document, an exception is raised. - If disabled_client_side_validations is set, structural validation is - disabled. This can be useful to troubleshoot data validation problem, such as - when the OpenAPI document validation rules do not match the actual API data - received by the server. - :param signing_info: Configuration parameters for the HTTP signature security scheme. - Must be an instance of petstore_api.signing.HttpSigningConfiguration - :param server_index: Index to servers configuration. - :param server_variables: Mapping with string values to replace variables in - templated server configuration. The validation of enums is performed for - variables with defined enum values before. - :param server_operation_index: Mapping from operation ID to an index to server - configuration. - :param server_operation_variables: Mapping from operation ID to a mapping with - string values to replace variables in templated server configuration. - The validation of enums is performed for variables with defined enum values before. - - :Example: - - API Key Authentication Example. - Given the following security scheme in the OpenAPI specification: - components: - securitySchemes: - cookieAuth: # name for the security scheme - type: apiKey - in: cookie - name: JSESSIONID # cookie name - - You can programmatically set the cookie: - -conf = petstore_api.Configuration( - api_key={'cookieAuth': 'abc123'} - api_key_prefix={'cookieAuth': 'JSESSIONID'} -) - - The following cookie will be added to the HTTP request: - Cookie: JSESSIONID abc123 - - HTTP Basic Authentication Example. - Given the following security scheme in the OpenAPI specification: - components: - securitySchemes: - http_basic_auth: - type: http - scheme: basic - - Configure API client with HTTP basic authentication: - -conf = petstore_api.Configuration( - username='the-user', - password='the-password', -) - - - HTTP Signature Authentication Example. - Given the following security scheme in the OpenAPI specification: - components: - securitySchemes: - http_basic_auth: - type: http - scheme: signature - - Configure API client with HTTP signature authentication. Use the 'hs2019' signature scheme, - sign the HTTP requests with the RSA-SSA-PSS signature algorithm, and set the expiration time - of the signature to 5 minutes after the signature has been created. - Note you can use the constants defined in the petstore_api.signing module, and you can - also specify arbitrary HTTP headers to be included in the HTTP signature, except for the - 'Authorization' header, which is used to carry the signature. - - One may be tempted to sign all headers by default, but in practice it rarely works. - This is beccause explicit proxies, transparent proxies, TLS termination endpoints or - load balancers may add/modify/remove headers. Include the HTTP headers that you know - are not going to be modified in transit. - -conf = petstore_api.Configuration( - signing_info = petstore_api.signing.HttpSigningConfiguration( - key_id = 'my-key-id', - private_key_path = 'rsa.pem', - signing_scheme = petstore_api.signing.SCHEME_HS2019, - signing_algorithm = petstore_api.signing.ALGORITHM_RSASSA_PSS, - signed_headers = [petstore_api.signing.HEADER_REQUEST_TARGET, - petstore_api.signing.HEADER_CREATED, - petstore_api.signing.HEADER_EXPIRES, - petstore_api.signing.HEADER_HOST, - petstore_api.signing.HEADER_DATE, - petstore_api.signing.HEADER_DIGEST, - 'Content-Type', - 'User-Agent' - ], - signature_max_validity = datetime.timedelta(minutes=5) - ) -) - """ - - _default = None - - def __init__( - self, - host=None, - api_key=None, - api_key_prefix=None, - username=None, - password=None, - disabled_client_side_validations="", - signing_info=None, - server_index=None, - server_variables=None, - server_operation_index=None, - server_operation_variables=None, - access_token=None, - ): - """Constructor - """ - self._base_path = "http://petstore.swagger.io:80/v2" if host is None else host - """Default Base url - """ - self.server_index = 0 if server_index is None and host is None else server_index - self.server_operation_index = server_operation_index or {} - """Default server index - """ - self.server_variables = server_variables or {} - self.server_operation_variables = server_operation_variables or {} - """Default server variables - """ - self.temp_folder_path = None - """Temp file folder for downloading files - """ - # Authentication Settings - self.api_key = {} - if api_key: - self.api_key = api_key - """dict to store API key(s) - """ - self.api_key_prefix = {} - if api_key_prefix: - self.api_key_prefix = api_key_prefix - """dict to store API prefix (e.g. Bearer) - """ - self.refresh_api_key_hook = None - """function hook to refresh API key if expired - """ - self.username = username - """Username for HTTP basic authentication - """ - self.password = password - """Password for HTTP basic authentication - """ - self.disabled_client_side_validations = disabled_client_side_validations - if signing_info is not None: - signing_info.host = host - self.signing_info = signing_info - """The HTTP signing configuration - """ - self.access_token = access_token - """access token for OAuth/Bearer - """ - self.logger = {} - """Logging Settings - """ - self.logger["package_logger"] = logging.getLogger("petstore_api") - self.logger["urllib3_logger"] = logging.getLogger("urllib3") - self.logger_format = '%(asctime)s %(levelname)s %(message)s' - """Log format - """ - self.logger_stream_handler = None - """Log stream handler - """ - self.logger_file_handler = None - """Log file handler - """ - self.logger_file = None - """Debug file location - """ - self.debug = False - """Debug switch - """ - - self.verify_ssl = True - """SSL/TLS verification - Set this to false to skip verifying SSL certificate when calling API - from https server. - """ - self.ssl_ca_cert = None - """Set this to customize the certificate file to verify the peer. - """ - self.cert_file = None - """client certificate file - """ - self.key_file = None - """client key file - """ - self.assert_hostname = None - """Set this to True/False to enable/disable SSL hostname verification. - """ - - self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 - """urllib3 connection pool's maximum number of connections saved - per pool. urllib3 uses 1 connection as default value, but this is - not the best value when you are making a lot of possibly parallel - requests to the same host, which is often the case here. - cpu_count * 5 is used as default value to increase performance. - """ - - self.proxy = None - """Proxy URL - """ - self.proxy_headers = None - """Proxy headers - """ - self.safe_chars_for_path_param = '' - """Safe chars for path_param - """ - self.retries = None - """Adding retries to override urllib3 default value 3 - """ - # Enable client side validation - self.client_side_validation = True - - # Options to pass down to the underlying urllib3 socket - self.socket_options = None - - def __deepcopy__(self, memo): - cls = self.__class__ - result = cls.__new__(cls) - memo[id(self)] = result - for k, v in self.__dict__.items(): - if k not in ('logger', 'logger_file_handler'): - setattr(result, k, copy.deepcopy(v, memo)) - # shallow copy of loggers - result.logger = copy.copy(self.logger) - # use setters to configure loggers - result.logger_file = self.logger_file - result.debug = self.debug - return result - - def __setattr__(self, name, value): - object.__setattr__(self, name, value) - if name == 'disabled_client_side_validations': - s = set(filter(None, value.split(','))) - for v in s: - if v not in JSON_SCHEMA_VALIDATION_KEYWORDS: - raise ApiValueError( - "Invalid keyword: '{0}''".format(v)) - self._disabled_client_side_validations = s - if name == "signing_info" and value is not None: - # Ensure the host paramater from signing info is the same as - # Configuration.host. - value.host = self.host - - @classmethod - def set_default(cls, default): - """Set default instance of configuration. - - It stores default configuration, which can be - returned by get_default_copy method. - - :param default: object of Configuration - """ - cls._default = copy.deepcopy(default) - - @classmethod - def get_default_copy(cls): - """Return new instance of configuration. - - This method returns newly created, based on default constructor, - object of Configuration class or returns a copy of default - configuration passed by the set_default method. - - :return: The configuration object. - """ - if cls._default is not None: - return copy.deepcopy(cls._default) - return Configuration() - - @property - def logger_file(self): - """The logger file. - - If the logger_file is None, then add stream handler and remove file - handler. Otherwise, add file handler and remove stream handler. - - :param value: The logger_file path. - :type: str - """ - return self.__logger_file - - @logger_file.setter - def logger_file(self, value): - """The logger file. - - If the logger_file is None, then add stream handler and remove file - handler. Otherwise, add file handler and remove stream handler. - - :param value: The logger_file path. - :type: str - """ - self.__logger_file = value - if self.__logger_file: - # If set logging file, - # then add file handler and remove stream handler. - self.logger_file_handler = logging.FileHandler(self.__logger_file) - self.logger_file_handler.setFormatter(self.logger_formatter) - for _, logger in self.logger.items(): - logger.addHandler(self.logger_file_handler) - - @property - def debug(self): - """Debug status - - :param value: The debug status, True or False. - :type: bool - """ - return self.__debug - - @debug.setter - def debug(self, value): - """Debug status - - :param value: The debug status, True or False. - :type: bool - """ - self.__debug = value - if self.__debug: - # if debug status is True, turn on debug logging - for _, logger in self.logger.items(): - logger.setLevel(logging.DEBUG) - # turn on http_client debug - http_client.HTTPConnection.debuglevel = 1 - else: - # if debug status is False, turn off debug logging, - # setting log level to default `logging.WARNING` - for _, logger in self.logger.items(): - logger.setLevel(logging.WARNING) - # turn off http_client debug - http_client.HTTPConnection.debuglevel = 0 - - @property - def logger_format(self): - """The logger format. - - The logger_formatter will be updated when sets logger_format. - - :param value: The format string. - :type: str - """ - return self.__logger_format - - @logger_format.setter - def logger_format(self, value): - """The logger format. - - The logger_formatter will be updated when sets logger_format. - - :param value: The format string. - :type: str - """ - self.__logger_format = value - self.logger_formatter = logging.Formatter(self.__logger_format) - - def get_api_key_with_prefix(self, identifier, alias=None): - """Gets API key (with prefix if set). - - :param identifier: The identifier of apiKey. - :param alias: The alternative identifier of apiKey. - :return: The token for api key authentication. - """ - if self.refresh_api_key_hook is not None: - self.refresh_api_key_hook(self) - key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None) - if key: - prefix = self.api_key_prefix.get(identifier) - if prefix: - return "%s %s" % (prefix, key) - else: - return key - - def get_basic_auth_token(self): - """Gets HTTP basic authentication header (string). - - :return: The token for basic HTTP authentication. - """ - username = "" - if self.username is not None: - username = self.username - password = "" - if self.password is not None: - password = self.password - return urllib3.util.make_headers( - basic_auth=username + ':' + password - ).get('authorization') - - def auth_settings(self): - """Gets Auth Settings dict for api client. - - :return: The Auth Settings information dict. - """ - auth = {} - if 'api_key' in self.api_key: - auth['api_key'] = { - 'type': 'api_key', - 'in': 'header', - 'key': 'api_key', - 'value': self.get_api_key_with_prefix( - 'api_key', - ), - } - if 'api_key_query' in self.api_key: - auth['api_key_query'] = { - 'type': 'api_key', - 'in': 'query', - 'key': 'api_key_query', - 'value': self.get_api_key_with_prefix( - 'api_key_query', - ), - } - if self.access_token is not None: - auth['bearer_test'] = { - 'type': 'bearer', - 'in': 'header', - 'format': 'JWT', - 'key': 'Authorization', - 'value': 'Bearer ' + self.access_token - } - if self.username is not None and self.password is not None: - auth['http_basic_test'] = { - 'type': 'basic', - 'in': 'header', - 'key': 'Authorization', - 'value': self.get_basic_auth_token() - } - if self.signing_info is not None: - auth['http_signature_test'] = { - 'type': 'http-signature', - 'in': 'header', - 'key': 'Authorization', - 'value': None # Signature headers are calculated for every HTTP request - } - if self.access_token is not None: - auth['petstore_auth'] = { - 'type': 'oauth2', - 'in': 'header', - 'key': 'Authorization', - 'value': 'Bearer ' + self.access_token - } - return auth - - def to_debug_report(self): - """Gets the essential information for debugging. - - :return: The report for debugging. - """ - return "Python SDK Debug Report:\n"\ - "OS: {env}\n"\ - "Python Version: {pyversion}\n"\ - "Version of the API: 1.0.0\n"\ - "SDK Package Version: 1.0.0".\ - format(env=sys.platform, pyversion=sys.version) - - def get_host_settings(self): - """Gets an array of host settings - - :return: An array of host settings - """ - return [ - { - 'url': "http://{server}.swagger.io:{port}/v2", - 'description': "petstore server", - 'variables': { - 'server': { - 'description': "No description provided", - 'default_value': "petstore", - 'enum_values': [ - "petstore", - "qa-petstore", - "dev-petstore" - ] - }, - 'port': { - 'description': "No description provided", - 'default_value': "80", - 'enum_values': [ - "80", - "8080" - ] - } - } - }, - { - 'url': "https://localhost:8080/{version}", - 'description': "The local server", - 'variables': { - 'version': { - 'description': "No description provided", - 'default_value': "v2", - 'enum_values': [ - "v1", - "v2" - ] - } - } - } - ] - - def get_host_from_settings(self, index, variables=None, servers=None): - """Gets host URL based on the index and variables - :param index: array index of the host settings - :param variables: hash of variable and the corresponding value - :param servers: an array of host settings or None - :return: URL based on host settings - """ - if index is None: - return self._base_path - - variables = {} if variables is None else variables - servers = self.get_host_settings() if servers is None else servers - - try: - server = servers[index] - except IndexError: - raise ValueError( - "Invalid index {0} when selecting the host settings. " - "Must be less than {1}".format(index, len(servers))) - - url = server['url'] - - # go through variables and replace placeholders - for variable_name, variable in server.get('variables', {}).items(): - used_value = variables.get( - variable_name, variable['default_value']) - - if 'enum_values' in variable \ - and used_value not in variable['enum_values']: - raise ValueError( - "The variable `{0}` in the host URL has invalid value " - "{1}. Must be {2}.".format( - variable_name, variables[variable_name], - variable['enum_values'])) - - url = url.replace("{" + variable_name + "}", used_value) - - return url - - @property - def host(self): - """Return generated host.""" - return self.get_host_from_settings(self.server_index, variables=self.server_variables) - - @host.setter - def host(self, value): - """Fix base path.""" - self._base_path = value - self.server_index = None diff --git a/samples/openapi3/client/petstore/python/petstore_api/exceptions.py b/samples/openapi3/client/petstore/python/petstore_api/exceptions.py deleted file mode 100644 index 3bfb8228388..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/exceptions.py +++ /dev/null @@ -1,147 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" -import dataclasses -import typing - -from urllib3._collections import HTTPHeaderDict - - -class OpenApiException(Exception): - """The base exception class for all OpenAPIExceptions""" - - -class ApiTypeError(OpenApiException, TypeError): - def __init__(self, msg, path_to_item=None, valid_classes=None, - key_type=None): - """ Raises an exception for TypeErrors - - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (list): a list of keys an indices to get to the - current_item - None if unset - valid_classes (tuple): the primitive classes that current item - should be an instance of - None if unset - key_type (bool): False if our value is a value in a dict - True if it is a key in a dict - False if our item is an item in a list - None if unset - """ - self.path_to_item = path_to_item - self.valid_classes = valid_classes - self.key_type = key_type - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiTypeError, self).__init__(full_msg) - - -class ApiValueError(OpenApiException, ValueError): - def __init__(self, msg, path_to_item=None): - """ - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (list) the path to the exception in the - received_data dict. None if unset - """ - - self.path_to_item = path_to_item - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiValueError, self).__init__(full_msg) - - -class ApiAttributeError(OpenApiException, AttributeError): - def __init__(self, msg, path_to_item=None): - """ - Raised when an attribute reference or assignment fails. - - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (None/list) the path to the exception in the - received_data dict - """ - self.path_to_item = path_to_item - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiAttributeError, self).__init__(full_msg) - - -class ApiKeyError(OpenApiException, KeyError): - def __init__(self, msg, path_to_item=None): - """ - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (None/list) the path to the exception in the - received_data dict - """ - self.path_to_item = path_to_item - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiKeyError, self).__init__(full_msg) - - -T = typing.TypeVar("T") - - -@dataclasses.dataclass -class ApiException(OpenApiException, typing.Generic[T]): - status: int - reason: str - api_response: typing.Optional[T] = None - - @property - def body(self) -> typing.Union[str, bytes, None]: - if not self.api_response: - return None - return self.api_response.response.data - - @property - def headers(self) -> typing.Optional[HTTPHeaderDict]: - if not self.api_response: - return None - return self.api_response.response.getheaders() - - def __str__(self): - """Custom error messages for exception""" - error_message = "({0})\n"\ - "Reason: {1}\n".format(self.status, self.reason) - if self.headers: - error_message += "HTTP response headers: {0}\n".format( - self.headers) - - if self.body: - error_message += "HTTP response body: {0}\n".format(self.body) - - return error_message - - -def render_path(path_to_item): - """Returns a string representation of a path""" - result = "" - for pth in path_to_item: - if isinstance(pth, int): - result += "[{0}]".format(pth) - else: - result += "['{0}']".format(pth) - return result diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/model/__init__.py deleted file mode 100644 index 027452f37a8..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -# we can not import model classes here because that would create a circular -# reference which would not work in python2 -# do not import all models into this module because that uses a lot of memory and stack frames -# if you need the ability to import all models from one package, import them with -# from petstore_api.models import ModelA, ModelB diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/abstract_step_message.py b/samples/openapi3/client/petstore/python/petstore_api/model/abstract_step_message.py deleted file mode 100644 index 85822aa886e..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/abstract_step_message.py +++ /dev/null @@ -1,119 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class AbstractStepMessage( - schemas.ComposedBase, - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Abstract Step - """ - - - class MetaOapg: - required = { - "sequenceNumber", - "description", - "discriminator", - } - - @staticmethod - def discriminator(): - return { - 'discriminator': { - 'AbstractStepMessage': AbstractStepMessage, - } - } - - class properties: - discriminator = schemas.StrSchema - __annotations__ = { - "discriminator": discriminator, - } - - @classmethod - @functools.lru_cache() - def any_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - AbstractStepMessage, - ] - - - sequenceNumber: schemas.AnyTypeSchema - description: schemas.AnyTypeSchema - discriminator: MetaOapg.properties.discriminator - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["discriminator"]) -> MetaOapg.properties.discriminator: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["discriminator", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["discriminator"]) -> MetaOapg.properties.discriminator: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["discriminator", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - sequenceNumber: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - description: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - discriminator: typing.Union[MetaOapg.properties.discriminator, str, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'AbstractStepMessage': - return super().__new__( - cls, - *_args, - sequenceNumber=sequenceNumber, - description=description, - discriminator=discriminator, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.abstract_step_message import AbstractStepMessage diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/abstract_step_message.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/abstract_step_message.pyi deleted file mode 100644 index 85822aa886e..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/abstract_step_message.pyi +++ /dev/null @@ -1,119 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class AbstractStepMessage( - schemas.ComposedBase, - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Abstract Step - """ - - - class MetaOapg: - required = { - "sequenceNumber", - "description", - "discriminator", - } - - @staticmethod - def discriminator(): - return { - 'discriminator': { - 'AbstractStepMessage': AbstractStepMessage, - } - } - - class properties: - discriminator = schemas.StrSchema - __annotations__ = { - "discriminator": discriminator, - } - - @classmethod - @functools.lru_cache() - def any_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - AbstractStepMessage, - ] - - - sequenceNumber: schemas.AnyTypeSchema - description: schemas.AnyTypeSchema - discriminator: MetaOapg.properties.discriminator - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["discriminator"]) -> MetaOapg.properties.discriminator: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["discriminator", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["discriminator"]) -> MetaOapg.properties.discriminator: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["discriminator", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - sequenceNumber: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - description: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - discriminator: typing.Union[MetaOapg.properties.discriminator, str, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'AbstractStepMessage': - return super().__new__( - cls, - *_args, - sequenceNumber=sequenceNumber, - description=description, - discriminator=discriminator, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.abstract_step_message import AbstractStepMessage diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/additional_properties_class.py b/samples/openapi3/client/petstore/python/petstore_api/model/additional_properties_class.py deleted file mode 100644 index 3417b0b35cc..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/additional_properties_class.py +++ /dev/null @@ -1,307 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class AdditionalPropertiesClass( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - - - class map_property( - schemas.DictSchema - ): - - - class MetaOapg: - additional_properties = schemas.StrSchema - - def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, str, ], - ) -> 'map_property': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - - class map_of_map_property( - schemas.DictSchema - ): - - - class MetaOapg: - - - class additional_properties( - schemas.DictSchema - ): - - - class MetaOapg: - additional_properties = schemas.StrSchema - - def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, str, ], - ) -> 'additional_properties': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, ], - ) -> 'map_of_map_property': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - anytype_1 = schemas.AnyTypeSchema - map_with_undeclared_properties_anytype_1 = schemas.DictSchema - map_with_undeclared_properties_anytype_2 = schemas.DictSchema - - - class map_with_undeclared_properties_anytype_3( - schemas.DictSchema - ): - - - class MetaOapg: - additional_properties = schemas.AnyTypeSchema - - def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - ) -> 'map_with_undeclared_properties_anytype_3': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - - class empty_map( - schemas.DictSchema - ): - - - class MetaOapg: - additional_properties = schemas.NotAnyTypeSchema - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'empty_map': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - ) - - - class map_with_undeclared_properties_string( - schemas.DictSchema - ): - - - class MetaOapg: - additional_properties = schemas.StrSchema - - def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, str, ], - ) -> 'map_with_undeclared_properties_string': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - __annotations__ = { - "map_property": map_property, - "map_of_map_property": map_of_map_property, - "anytype_1": anytype_1, - "map_with_undeclared_properties_anytype_1": map_with_undeclared_properties_anytype_1, - "map_with_undeclared_properties_anytype_2": map_with_undeclared_properties_anytype_2, - "map_with_undeclared_properties_anytype_3": map_with_undeclared_properties_anytype_3, - "empty_map": empty_map, - "map_with_undeclared_properties_string": map_with_undeclared_properties_string, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["map_property"]) -> MetaOapg.properties.map_property: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["map_of_map_property"]) -> MetaOapg.properties.map_of_map_property: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["anytype_1"]) -> MetaOapg.properties.anytype_1: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["map_with_undeclared_properties_anytype_1"]) -> MetaOapg.properties.map_with_undeclared_properties_anytype_1: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["map_with_undeclared_properties_anytype_2"]) -> MetaOapg.properties.map_with_undeclared_properties_anytype_2: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["map_with_undeclared_properties_anytype_3"]) -> MetaOapg.properties.map_with_undeclared_properties_anytype_3: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["empty_map"]) -> MetaOapg.properties.empty_map: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["map_with_undeclared_properties_string"]) -> MetaOapg.properties.map_with_undeclared_properties_string: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["map_property", "map_of_map_property", "anytype_1", "map_with_undeclared_properties_anytype_1", "map_with_undeclared_properties_anytype_2", "map_with_undeclared_properties_anytype_3", "empty_map", "map_with_undeclared_properties_string", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["map_property"]) -> typing.Union[MetaOapg.properties.map_property, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["map_of_map_property"]) -> typing.Union[MetaOapg.properties.map_of_map_property, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["anytype_1"]) -> typing.Union[MetaOapg.properties.anytype_1, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["map_with_undeclared_properties_anytype_1"]) -> typing.Union[MetaOapg.properties.map_with_undeclared_properties_anytype_1, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["map_with_undeclared_properties_anytype_2"]) -> typing.Union[MetaOapg.properties.map_with_undeclared_properties_anytype_2, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["map_with_undeclared_properties_anytype_3"]) -> typing.Union[MetaOapg.properties.map_with_undeclared_properties_anytype_3, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["empty_map"]) -> typing.Union[MetaOapg.properties.empty_map, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["map_with_undeclared_properties_string"]) -> typing.Union[MetaOapg.properties.map_with_undeclared_properties_string, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["map_property", "map_of_map_property", "anytype_1", "map_with_undeclared_properties_anytype_1", "map_with_undeclared_properties_anytype_2", "map_with_undeclared_properties_anytype_3", "empty_map", "map_with_undeclared_properties_string", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - map_property: typing.Union[MetaOapg.properties.map_property, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - map_of_map_property: typing.Union[MetaOapg.properties.map_of_map_property, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - anytype_1: typing.Union[MetaOapg.properties.anytype_1, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - map_with_undeclared_properties_anytype_1: typing.Union[MetaOapg.properties.map_with_undeclared_properties_anytype_1, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - map_with_undeclared_properties_anytype_2: typing.Union[MetaOapg.properties.map_with_undeclared_properties_anytype_2, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - map_with_undeclared_properties_anytype_3: typing.Union[MetaOapg.properties.map_with_undeclared_properties_anytype_3, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - empty_map: typing.Union[MetaOapg.properties.empty_map, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - map_with_undeclared_properties_string: typing.Union[MetaOapg.properties.map_with_undeclared_properties_string, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'AdditionalPropertiesClass': - return super().__new__( - cls, - *_args, - map_property=map_property, - map_of_map_property=map_of_map_property, - anytype_1=anytype_1, - map_with_undeclared_properties_anytype_1=map_with_undeclared_properties_anytype_1, - map_with_undeclared_properties_anytype_2=map_with_undeclared_properties_anytype_2, - map_with_undeclared_properties_anytype_3=map_with_undeclared_properties_anytype_3, - empty_map=empty_map, - map_with_undeclared_properties_string=map_with_undeclared_properties_string, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/additional_properties_class.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/additional_properties_class.pyi deleted file mode 100644 index 3417b0b35cc..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/additional_properties_class.pyi +++ /dev/null @@ -1,307 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class AdditionalPropertiesClass( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - - - class map_property( - schemas.DictSchema - ): - - - class MetaOapg: - additional_properties = schemas.StrSchema - - def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, str, ], - ) -> 'map_property': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - - class map_of_map_property( - schemas.DictSchema - ): - - - class MetaOapg: - - - class additional_properties( - schemas.DictSchema - ): - - - class MetaOapg: - additional_properties = schemas.StrSchema - - def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, str, ], - ) -> 'additional_properties': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, ], - ) -> 'map_of_map_property': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - anytype_1 = schemas.AnyTypeSchema - map_with_undeclared_properties_anytype_1 = schemas.DictSchema - map_with_undeclared_properties_anytype_2 = schemas.DictSchema - - - class map_with_undeclared_properties_anytype_3( - schemas.DictSchema - ): - - - class MetaOapg: - additional_properties = schemas.AnyTypeSchema - - def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - ) -> 'map_with_undeclared_properties_anytype_3': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - - class empty_map( - schemas.DictSchema - ): - - - class MetaOapg: - additional_properties = schemas.NotAnyTypeSchema - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'empty_map': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - ) - - - class map_with_undeclared_properties_string( - schemas.DictSchema - ): - - - class MetaOapg: - additional_properties = schemas.StrSchema - - def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, str, ], - ) -> 'map_with_undeclared_properties_string': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - __annotations__ = { - "map_property": map_property, - "map_of_map_property": map_of_map_property, - "anytype_1": anytype_1, - "map_with_undeclared_properties_anytype_1": map_with_undeclared_properties_anytype_1, - "map_with_undeclared_properties_anytype_2": map_with_undeclared_properties_anytype_2, - "map_with_undeclared_properties_anytype_3": map_with_undeclared_properties_anytype_3, - "empty_map": empty_map, - "map_with_undeclared_properties_string": map_with_undeclared_properties_string, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["map_property"]) -> MetaOapg.properties.map_property: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["map_of_map_property"]) -> MetaOapg.properties.map_of_map_property: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["anytype_1"]) -> MetaOapg.properties.anytype_1: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["map_with_undeclared_properties_anytype_1"]) -> MetaOapg.properties.map_with_undeclared_properties_anytype_1: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["map_with_undeclared_properties_anytype_2"]) -> MetaOapg.properties.map_with_undeclared_properties_anytype_2: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["map_with_undeclared_properties_anytype_3"]) -> MetaOapg.properties.map_with_undeclared_properties_anytype_3: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["empty_map"]) -> MetaOapg.properties.empty_map: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["map_with_undeclared_properties_string"]) -> MetaOapg.properties.map_with_undeclared_properties_string: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["map_property", "map_of_map_property", "anytype_1", "map_with_undeclared_properties_anytype_1", "map_with_undeclared_properties_anytype_2", "map_with_undeclared_properties_anytype_3", "empty_map", "map_with_undeclared_properties_string", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["map_property"]) -> typing.Union[MetaOapg.properties.map_property, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["map_of_map_property"]) -> typing.Union[MetaOapg.properties.map_of_map_property, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["anytype_1"]) -> typing.Union[MetaOapg.properties.anytype_1, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["map_with_undeclared_properties_anytype_1"]) -> typing.Union[MetaOapg.properties.map_with_undeclared_properties_anytype_1, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["map_with_undeclared_properties_anytype_2"]) -> typing.Union[MetaOapg.properties.map_with_undeclared_properties_anytype_2, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["map_with_undeclared_properties_anytype_3"]) -> typing.Union[MetaOapg.properties.map_with_undeclared_properties_anytype_3, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["empty_map"]) -> typing.Union[MetaOapg.properties.empty_map, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["map_with_undeclared_properties_string"]) -> typing.Union[MetaOapg.properties.map_with_undeclared_properties_string, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["map_property", "map_of_map_property", "anytype_1", "map_with_undeclared_properties_anytype_1", "map_with_undeclared_properties_anytype_2", "map_with_undeclared_properties_anytype_3", "empty_map", "map_with_undeclared_properties_string", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - map_property: typing.Union[MetaOapg.properties.map_property, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - map_of_map_property: typing.Union[MetaOapg.properties.map_of_map_property, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - anytype_1: typing.Union[MetaOapg.properties.anytype_1, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - map_with_undeclared_properties_anytype_1: typing.Union[MetaOapg.properties.map_with_undeclared_properties_anytype_1, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - map_with_undeclared_properties_anytype_2: typing.Union[MetaOapg.properties.map_with_undeclared_properties_anytype_2, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - map_with_undeclared_properties_anytype_3: typing.Union[MetaOapg.properties.map_with_undeclared_properties_anytype_3, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - empty_map: typing.Union[MetaOapg.properties.empty_map, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - map_with_undeclared_properties_string: typing.Union[MetaOapg.properties.map_with_undeclared_properties_string, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'AdditionalPropertiesClass': - return super().__new__( - cls, - *_args, - map_property=map_property, - map_of_map_property=map_of_map_property, - anytype_1=anytype_1, - map_with_undeclared_properties_anytype_1=map_with_undeclared_properties_anytype_1, - map_with_undeclared_properties_anytype_2=map_with_undeclared_properties_anytype_2, - map_with_undeclared_properties_anytype_3=map_with_undeclared_properties_anytype_3, - empty_map=empty_map, - map_with_undeclared_properties_string=map_with_undeclared_properties_string, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/additional_properties_validator.py b/samples/openapi3/client/petstore/python/petstore_api/model/additional_properties_validator.py deleted file mode 100644 index 102c99fac1e..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/additional_properties_validator.py +++ /dev/null @@ -1,198 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class AdditionalPropertiesValidator( - schemas.ComposedBase, - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - class all_of_0( - schemas.DictSchema - ): - - - class MetaOapg: - additional_properties = schemas.AnyTypeSchema - - def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - ) -> 'all_of_0': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - - class all_of_1( - schemas.DictSchema - ): - - - class MetaOapg: - - - class additional_properties( - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - min_length = 3 - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'additional_properties': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - ) -> 'all_of_1': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - - class all_of_2( - schemas.DictSchema - ): - - - class MetaOapg: - - - class additional_properties( - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - max_length = 5 - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'additional_properties': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - ) -> 'all_of_2': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.all_of_0, - cls.all_of_1, - cls.all_of_2, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'AdditionalPropertiesValidator': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/additional_properties_validator.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/additional_properties_validator.pyi deleted file mode 100644 index 41f0865542e..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/additional_properties_validator.pyi +++ /dev/null @@ -1,196 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class AdditionalPropertiesValidator( - schemas.ComposedBase, - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - class all_of_0( - schemas.DictSchema - ): - - - class MetaOapg: - additional_properties = schemas.AnyTypeSchema - - def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - ) -> 'all_of_0': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - - class all_of_1( - schemas.DictSchema - ): - - - class MetaOapg: - - - class additional_properties( - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'additional_properties': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - ) -> 'all_of_1': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - - class all_of_2( - schemas.DictSchema - ): - - - class MetaOapg: - - - class additional_properties( - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'additional_properties': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - ) -> 'all_of_2': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.all_of_0, - cls.all_of_1, - cls.all_of_2, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'AdditionalPropertiesValidator': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/additional_properties_with_array_of_enums.py b/samples/openapi3/client/petstore/python/petstore_api/model/additional_properties_with_array_of_enums.py deleted file mode 100644 index a2955cc292f..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/additional_properties_with_array_of_enums.py +++ /dev/null @@ -1,84 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class AdditionalPropertiesWithArrayOfEnums( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - class additional_properties( - schemas.ListSchema - ): - - - class MetaOapg: - - @staticmethod - def items() -> typing.Type['EnumClass']: - return EnumClass - - def __new__( - cls, - _arg: typing.Union[typing.Tuple['EnumClass'], typing.List['EnumClass']], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'additional_properties': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> 'EnumClass': - return super().__getitem__(i) - - def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, list, tuple, ], - ) -> 'AdditionalPropertiesWithArrayOfEnums': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.enum_class import EnumClass diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/additional_properties_with_array_of_enums.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/additional_properties_with_array_of_enums.pyi deleted file mode 100644 index a2955cc292f..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/additional_properties_with_array_of_enums.pyi +++ /dev/null @@ -1,84 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class AdditionalPropertiesWithArrayOfEnums( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - class additional_properties( - schemas.ListSchema - ): - - - class MetaOapg: - - @staticmethod - def items() -> typing.Type['EnumClass']: - return EnumClass - - def __new__( - cls, - _arg: typing.Union[typing.Tuple['EnumClass'], typing.List['EnumClass']], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'additional_properties': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> 'EnumClass': - return super().__getitem__(i) - - def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, list, tuple, ], - ) -> 'AdditionalPropertiesWithArrayOfEnums': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.enum_class import EnumClass diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/address.py b/samples/openapi3/client/petstore/python/petstore_api/model/address.py deleted file mode 100644 index 46e70b0aac0..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/address.py +++ /dev/null @@ -1,57 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Address( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - additional_properties = schemas.IntSchema - - def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, decimal.Decimal, int, ], - ) -> 'Address': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/address.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/address.pyi deleted file mode 100644 index 46e70b0aac0..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/address.pyi +++ /dev/null @@ -1,57 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Address( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - additional_properties = schemas.IntSchema - - def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, decimal.Decimal, int, ], - ) -> 'Address': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/animal.py b/samples/openapi3/client/petstore/python/petstore_api/model/animal.py deleted file mode 100644 index 10cc8231ca0..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/animal.py +++ /dev/null @@ -1,105 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Animal( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "className", - } - - @staticmethod - def discriminator(): - return { - 'className': { - 'Cat': Cat, - 'Dog': Dog, - } - } - - class properties: - className = schemas.StrSchema - color = schemas.StrSchema - __annotations__ = { - "className": className, - "color": color, - } - - className: MetaOapg.properties.className - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["className"]) -> MetaOapg.properties.className: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["color"]) -> MetaOapg.properties.color: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["className", "color", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["className"]) -> MetaOapg.properties.className: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["color"]) -> typing.Union[MetaOapg.properties.color, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["className", "color", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - className: typing.Union[MetaOapg.properties.className, str, ], - color: typing.Union[MetaOapg.properties.color, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Animal': - return super().__new__( - cls, - *_args, - className=className, - color=color, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.cat import Cat -from petstore_api.model.dog import Dog diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/animal.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/animal.pyi deleted file mode 100644 index 10cc8231ca0..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/animal.pyi +++ /dev/null @@ -1,105 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Animal( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "className", - } - - @staticmethod - def discriminator(): - return { - 'className': { - 'Cat': Cat, - 'Dog': Dog, - } - } - - class properties: - className = schemas.StrSchema - color = schemas.StrSchema - __annotations__ = { - "className": className, - "color": color, - } - - className: MetaOapg.properties.className - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["className"]) -> MetaOapg.properties.className: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["color"]) -> MetaOapg.properties.color: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["className", "color", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["className"]) -> MetaOapg.properties.className: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["color"]) -> typing.Union[MetaOapg.properties.color, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["className", "color", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - className: typing.Union[MetaOapg.properties.className, str, ], - color: typing.Union[MetaOapg.properties.color, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Animal': - return super().__new__( - cls, - *_args, - className=className, - color=color, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.cat import Cat -from petstore_api.model.dog import Dog diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/animal_farm.py b/samples/openapi3/client/petstore/python/petstore_api/model/animal_farm.py deleted file mode 100644 index 6fda316363c..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/animal_farm.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class AnimalFarm( - schemas.ListSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - @staticmethod - def items() -> typing.Type['Animal']: - return Animal - - def __new__( - cls, - _arg: typing.Union[typing.Tuple['Animal'], typing.List['Animal']], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'AnimalFarm': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> 'Animal': - return super().__getitem__(i) - -from petstore_api.model.animal import Animal diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/animal_farm.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/animal_farm.pyi deleted file mode 100644 index 6fda316363c..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/animal_farm.pyi +++ /dev/null @@ -1,56 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class AnimalFarm( - schemas.ListSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - @staticmethod - def items() -> typing.Type['Animal']: - return Animal - - def __new__( - cls, - _arg: typing.Union[typing.Tuple['Animal'], typing.List['Animal']], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'AnimalFarm': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> 'Animal': - return super().__getitem__(i) - -from petstore_api.model.animal import Animal diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/any_type_and_format.py b/samples/openapi3/client/petstore/python/petstore_api/model/any_type_and_format.py deleted file mode 100644 index 79ef085dbfd..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/any_type_and_format.py +++ /dev/null @@ -1,361 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class AnyTypeAndFormat( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - - - class uuid( - schemas.UUIDBase, - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - format = 'uuid' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'uuid': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - - class date( - schemas.DateBase, - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - format = 'date' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'date': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - - class date_time( - schemas.DateTimeBase, - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - format = 'date-time' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'date_time': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - - class number( - schemas.DecimalBase, - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - format = 'number' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'number': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - - class binary( - schemas.BinaryBase, - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - format = 'binary' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'binary': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - - class int32( - schemas.Int32Base, - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - format = 'int32' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'int32': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - - class int64( - schemas.Int64Base, - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - format = 'int64' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'int64': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - - class double( - schemas.Float64Base, - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - format = 'double' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'double': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - - class _float( - schemas.Float32Base, - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - format = 'float' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> '_float': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - __annotations__ = { - "uuid": uuid, - "date": date, - "date-time": date_time, - "number": number, - "binary": binary, - "int32": int32, - "int64": int64, - "double": double, - "float": _float, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["uuid"]) -> MetaOapg.properties.uuid: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["date"]) -> MetaOapg.properties.date: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["date-time"]) -> MetaOapg.properties.date_time: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["number"]) -> MetaOapg.properties.number: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["binary"]) -> MetaOapg.properties.binary: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["int32"]) -> MetaOapg.properties.int32: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["int64"]) -> MetaOapg.properties.int64: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["double"]) -> MetaOapg.properties.double: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["float"]) -> MetaOapg.properties._float: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["uuid", "date", "date-time", "number", "binary", "int32", "int64", "double", "float", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["uuid"]) -> typing.Union[MetaOapg.properties.uuid, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["date"]) -> typing.Union[MetaOapg.properties.date, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["date-time"]) -> typing.Union[MetaOapg.properties.date_time, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["number"]) -> typing.Union[MetaOapg.properties.number, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["binary"]) -> typing.Union[MetaOapg.properties.binary, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["int32"]) -> typing.Union[MetaOapg.properties.int32, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["int64"]) -> typing.Union[MetaOapg.properties.int64, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["double"]) -> typing.Union[MetaOapg.properties.double, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["float"]) -> typing.Union[MetaOapg.properties._float, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["uuid", "date", "date-time", "number", "binary", "int32", "int64", "double", "float", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - uuid: typing.Union[MetaOapg.properties.uuid, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - date: typing.Union[MetaOapg.properties.date, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - number: typing.Union[MetaOapg.properties.number, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - binary: typing.Union[MetaOapg.properties.binary, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - int32: typing.Union[MetaOapg.properties.int32, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - int64: typing.Union[MetaOapg.properties.int64, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - double: typing.Union[MetaOapg.properties.double, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'AnyTypeAndFormat': - return super().__new__( - cls, - *_args, - uuid=uuid, - date=date, - number=number, - binary=binary, - int32=int32, - int64=int64, - double=double, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/any_type_and_format.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/any_type_and_format.pyi deleted file mode 100644 index 79ef085dbfd..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/any_type_and_format.pyi +++ /dev/null @@ -1,361 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class AnyTypeAndFormat( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - - - class uuid( - schemas.UUIDBase, - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - format = 'uuid' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'uuid': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - - class date( - schemas.DateBase, - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - format = 'date' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'date': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - - class date_time( - schemas.DateTimeBase, - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - format = 'date-time' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'date_time': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - - class number( - schemas.DecimalBase, - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - format = 'number' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'number': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - - class binary( - schemas.BinaryBase, - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - format = 'binary' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'binary': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - - class int32( - schemas.Int32Base, - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - format = 'int32' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'int32': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - - class int64( - schemas.Int64Base, - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - format = 'int64' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'int64': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - - class double( - schemas.Float64Base, - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - format = 'double' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'double': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - - class _float( - schemas.Float32Base, - schemas.AnyTypeSchema, - ): - - - class MetaOapg: - format = 'float' - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> '_float': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - __annotations__ = { - "uuid": uuid, - "date": date, - "date-time": date_time, - "number": number, - "binary": binary, - "int32": int32, - "int64": int64, - "double": double, - "float": _float, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["uuid"]) -> MetaOapg.properties.uuid: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["date"]) -> MetaOapg.properties.date: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["date-time"]) -> MetaOapg.properties.date_time: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["number"]) -> MetaOapg.properties.number: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["binary"]) -> MetaOapg.properties.binary: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["int32"]) -> MetaOapg.properties.int32: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["int64"]) -> MetaOapg.properties.int64: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["double"]) -> MetaOapg.properties.double: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["float"]) -> MetaOapg.properties._float: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["uuid", "date", "date-time", "number", "binary", "int32", "int64", "double", "float", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["uuid"]) -> typing.Union[MetaOapg.properties.uuid, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["date"]) -> typing.Union[MetaOapg.properties.date, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["date-time"]) -> typing.Union[MetaOapg.properties.date_time, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["number"]) -> typing.Union[MetaOapg.properties.number, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["binary"]) -> typing.Union[MetaOapg.properties.binary, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["int32"]) -> typing.Union[MetaOapg.properties.int32, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["int64"]) -> typing.Union[MetaOapg.properties.int64, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["double"]) -> typing.Union[MetaOapg.properties.double, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["float"]) -> typing.Union[MetaOapg.properties._float, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["uuid", "date", "date-time", "number", "binary", "int32", "int64", "double", "float", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - uuid: typing.Union[MetaOapg.properties.uuid, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - date: typing.Union[MetaOapg.properties.date, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - number: typing.Union[MetaOapg.properties.number, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - binary: typing.Union[MetaOapg.properties.binary, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - int32: typing.Union[MetaOapg.properties.int32, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - int64: typing.Union[MetaOapg.properties.int64, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - double: typing.Union[MetaOapg.properties.double, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'AnyTypeAndFormat': - return super().__new__( - cls, - *_args, - uuid=uuid, - date=date, - number=number, - binary=binary, - int32=int32, - int64=int64, - double=double, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/any_type_not_string.py b/samples/openapi3/client/petstore/python/petstore_api/model/any_type_not_string.py deleted file mode 100644 index 032003cf1cb..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/any_type_not_string.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class AnyTypeNotString( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - not_schema = schemas.StrSchema - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'AnyTypeNotString': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/any_type_not_string.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/any_type_not_string.pyi deleted file mode 100644 index 032003cf1cb..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/any_type_not_string.pyi +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class AnyTypeNotString( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - not_schema = schemas.StrSchema - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'AnyTypeNotString': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/api_response.py b/samples/openapi3/client/petstore/python/petstore_api/model/api_response.py deleted file mode 100644 index a5ffc8f4b99..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/api_response.py +++ /dev/null @@ -1,98 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ApiResponse( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - code = schemas.Int32Schema - type = schemas.StrSchema - message = schemas.StrSchema - __annotations__ = { - "code": code, - "type": type, - "message": message, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["code"]) -> MetaOapg.properties.code: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["type"]) -> MetaOapg.properties.type: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["message"]) -> MetaOapg.properties.message: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["code", "type", "message", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["code"]) -> typing.Union[MetaOapg.properties.code, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["type"]) -> typing.Union[MetaOapg.properties.type, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["message"]) -> typing.Union[MetaOapg.properties.message, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["code", "type", "message", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - code: typing.Union[MetaOapg.properties.code, decimal.Decimal, int, schemas.Unset] = schemas.unset, - type: typing.Union[MetaOapg.properties.type, str, schemas.Unset] = schemas.unset, - message: typing.Union[MetaOapg.properties.message, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ApiResponse': - return super().__new__( - cls, - *_args, - code=code, - type=type, - message=message, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/api_response.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/api_response.pyi deleted file mode 100644 index a5ffc8f4b99..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/api_response.pyi +++ /dev/null @@ -1,98 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ApiResponse( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - code = schemas.Int32Schema - type = schemas.StrSchema - message = schemas.StrSchema - __annotations__ = { - "code": code, - "type": type, - "message": message, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["code"]) -> MetaOapg.properties.code: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["type"]) -> MetaOapg.properties.type: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["message"]) -> MetaOapg.properties.message: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["code", "type", "message", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["code"]) -> typing.Union[MetaOapg.properties.code, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["type"]) -> typing.Union[MetaOapg.properties.type, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["message"]) -> typing.Union[MetaOapg.properties.message, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["code", "type", "message", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - code: typing.Union[MetaOapg.properties.code, decimal.Decimal, int, schemas.Unset] = schemas.unset, - type: typing.Union[MetaOapg.properties.type, str, schemas.Unset] = schemas.unset, - message: typing.Union[MetaOapg.properties.message, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ApiResponse': - return super().__new__( - cls, - *_args, - code=code, - type=type, - message=message, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/apple.py b/samples/openapi3/client/petstore/python/petstore_api/model/apple.py deleted file mode 100644 index 9b0a5b7d643..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/apple.py +++ /dev/null @@ -1,118 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Apple( - schemas.DictBase, - schemas.NoneBase, - schemas.Schema, - schemas.NoneFrozenDictMixin -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "cultivar", - } - - class properties: - - - class cultivar( - schemas.StrSchema - ): - - - class MetaOapg: - regex=[{ - 'pattern': r'^[a-zA-Z\s]*$', # noqa: E501 - }] - - - class origin( - schemas.StrSchema - ): - - - class MetaOapg: - regex=[{ - 'pattern': r'^[A-Z\s]*$', # noqa: E501 - 'flags': ( - re.IGNORECASE - ) - }] - __annotations__ = { - "cultivar": cultivar, - "origin": origin, - } - - - cultivar: MetaOapg.properties.cultivar - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["cultivar"]) -> MetaOapg.properties.cultivar: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["origin"]) -> MetaOapg.properties.origin: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["cultivar", "origin", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["cultivar"]) -> MetaOapg.properties.cultivar: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["origin"]) -> typing.Union[MetaOapg.properties.origin, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["cultivar", "origin", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, None, ], - origin: typing.Union[MetaOapg.properties.origin, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Apple': - return super().__new__( - cls, - *_args, - origin=origin, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/apple.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/apple.pyi deleted file mode 100644 index 635b0909673..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/apple.pyi +++ /dev/null @@ -1,105 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Apple( - schemas.DictBase, - schemas.NoneBase, - schemas.Schema, - schemas.NoneFrozenDictMixin -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "cultivar", - } - - class properties: - - - class cultivar( - schemas.StrSchema - ): - pass - - - class origin( - schemas.StrSchema - ): - pass - __annotations__ = { - "cultivar": cultivar, - "origin": origin, - } - - - cultivar: MetaOapg.properties.cultivar - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["cultivar"]) -> MetaOapg.properties.cultivar: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["origin"]) -> MetaOapg.properties.origin: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["cultivar", "origin", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["cultivar"]) -> MetaOapg.properties.cultivar: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["origin"]) -> typing.Union[MetaOapg.properties.origin, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["cultivar", "origin", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, None, ], - origin: typing.Union[MetaOapg.properties.origin, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Apple': - return super().__new__( - cls, - *_args, - origin=origin, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/apple_req.py b/samples/openapi3/client/petstore/python/petstore_api/model/apple_req.py deleted file mode 100644 index d6bbd106ea9..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/apple_req.py +++ /dev/null @@ -1,84 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class AppleReq( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "cultivar", - } - - class properties: - cultivar = schemas.StrSchema - mealy = schemas.BoolSchema - __annotations__ = { - "cultivar": cultivar, - "mealy": mealy, - } - additional_properties = schemas.NotAnyTypeSchema - - cultivar: MetaOapg.properties.cultivar - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["cultivar"]) -> MetaOapg.properties.cultivar: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["mealy"]) -> MetaOapg.properties.mealy: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["cultivar"], typing_extensions.Literal["mealy"], ]): - # dict_instance[name] accessor - return super().__getitem__(name) - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["cultivar"]) -> MetaOapg.properties.cultivar: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["mealy"]) -> typing.Union[MetaOapg.properties.mealy, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["cultivar"], typing_extensions.Literal["mealy"], ]): - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - cultivar: typing.Union[MetaOapg.properties.cultivar, str, ], - mealy: typing.Union[MetaOapg.properties.mealy, bool, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'AppleReq': - return super().__new__( - cls, - *_args, - cultivar=cultivar, - mealy=mealy, - _configuration=_configuration, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/apple_req.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/apple_req.pyi deleted file mode 100644 index d6bbd106ea9..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/apple_req.pyi +++ /dev/null @@ -1,84 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class AppleReq( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "cultivar", - } - - class properties: - cultivar = schemas.StrSchema - mealy = schemas.BoolSchema - __annotations__ = { - "cultivar": cultivar, - "mealy": mealy, - } - additional_properties = schemas.NotAnyTypeSchema - - cultivar: MetaOapg.properties.cultivar - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["cultivar"]) -> MetaOapg.properties.cultivar: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["mealy"]) -> MetaOapg.properties.mealy: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["cultivar"], typing_extensions.Literal["mealy"], ]): - # dict_instance[name] accessor - return super().__getitem__(name) - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["cultivar"]) -> MetaOapg.properties.cultivar: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["mealy"]) -> typing.Union[MetaOapg.properties.mealy, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["cultivar"], typing_extensions.Literal["mealy"], ]): - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - cultivar: typing.Union[MetaOapg.properties.cultivar, str, ], - mealy: typing.Union[MetaOapg.properties.mealy, bool, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'AppleReq': - return super().__new__( - cls, - *_args, - cultivar=cultivar, - mealy=mealy, - _configuration=_configuration, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/array_holding_any_type.py b/samples/openapi3/client/petstore/python/petstore_api/model/array_holding_any_type.py deleted file mode 100644 index 1c8e2491bd9..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/array_holding_any_type.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ArrayHoldingAnyType( - schemas.ListSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - items = schemas.AnyTypeSchema - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ]], typing.List[typing.Union[MetaOapg.items, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'ArrayHoldingAnyType': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/array_holding_any_type.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/array_holding_any_type.pyi deleted file mode 100644 index 1c8e2491bd9..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/array_holding_any_type.pyi +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ArrayHoldingAnyType( - schemas.ListSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - items = schemas.AnyTypeSchema - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ]], typing.List[typing.Union[MetaOapg.items, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'ArrayHoldingAnyType': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python/petstore_api/model/array_of_array_of_number_only.py deleted file mode 100644 index c2cad28411e..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/array_of_array_of_number_only.py +++ /dev/null @@ -1,122 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ArrayOfArrayOfNumberOnly( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - - - class ArrayArrayNumber( - schemas.ListSchema - ): - - - class MetaOapg: - - - class items( - schemas.ListSchema - ): - - - class MetaOapg: - items = schemas.NumberSchema - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, decimal.Decimal, int, float, ]], typing.List[typing.Union[MetaOapg.items, decimal.Decimal, int, float, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'items': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, list, tuple, ]], typing.List[typing.Union[MetaOapg.items, list, tuple, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'ArrayArrayNumber': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - __annotations__ = { - "ArrayArrayNumber": ArrayArrayNumber, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["ArrayArrayNumber"]) -> MetaOapg.properties.ArrayArrayNumber: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["ArrayArrayNumber", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["ArrayArrayNumber"]) -> typing.Union[MetaOapg.properties.ArrayArrayNumber, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["ArrayArrayNumber", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - ArrayArrayNumber: typing.Union[MetaOapg.properties.ArrayArrayNumber, list, tuple, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ArrayOfArrayOfNumberOnly': - return super().__new__( - cls, - *_args, - ArrayArrayNumber=ArrayArrayNumber, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/array_of_array_of_number_only.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/array_of_array_of_number_only.pyi deleted file mode 100644 index c2cad28411e..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/array_of_array_of_number_only.pyi +++ /dev/null @@ -1,122 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ArrayOfArrayOfNumberOnly( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - - - class ArrayArrayNumber( - schemas.ListSchema - ): - - - class MetaOapg: - - - class items( - schemas.ListSchema - ): - - - class MetaOapg: - items = schemas.NumberSchema - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, decimal.Decimal, int, float, ]], typing.List[typing.Union[MetaOapg.items, decimal.Decimal, int, float, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'items': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, list, tuple, ]], typing.List[typing.Union[MetaOapg.items, list, tuple, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'ArrayArrayNumber': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - __annotations__ = { - "ArrayArrayNumber": ArrayArrayNumber, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["ArrayArrayNumber"]) -> MetaOapg.properties.ArrayArrayNumber: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["ArrayArrayNumber", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["ArrayArrayNumber"]) -> typing.Union[MetaOapg.properties.ArrayArrayNumber, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["ArrayArrayNumber", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - ArrayArrayNumber: typing.Union[MetaOapg.properties.ArrayArrayNumber, list, tuple, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ArrayOfArrayOfNumberOnly': - return super().__new__( - cls, - *_args, - ArrayArrayNumber=ArrayArrayNumber, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/array_of_enums.py b/samples/openapi3/client/petstore/python/petstore_api/model/array_of_enums.py deleted file mode 100644 index 1be72e32c39..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/array_of_enums.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ArrayOfEnums( - schemas.ListSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - @staticmethod - def items() -> typing.Type['StringEnum']: - return StringEnum - - def __new__( - cls, - _arg: typing.Union[typing.Tuple['StringEnum'], typing.List['StringEnum']], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'ArrayOfEnums': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> 'StringEnum': - return super().__getitem__(i) - -from petstore_api.model.string_enum import StringEnum diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/array_of_enums.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/array_of_enums.pyi deleted file mode 100644 index 1be72e32c39..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/array_of_enums.pyi +++ /dev/null @@ -1,56 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ArrayOfEnums( - schemas.ListSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - @staticmethod - def items() -> typing.Type['StringEnum']: - return StringEnum - - def __new__( - cls, - _arg: typing.Union[typing.Tuple['StringEnum'], typing.List['StringEnum']], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'ArrayOfEnums': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> 'StringEnum': - return super().__getitem__(i) - -from petstore_api.model.string_enum import StringEnum diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/array_of_number_only.py b/samples/openapi3/client/petstore/python/petstore_api/model/array_of_number_only.py deleted file mode 100644 index 6a9731e65c9..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/array_of_number_only.py +++ /dev/null @@ -1,100 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ArrayOfNumberOnly( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - - - class ArrayNumber( - schemas.ListSchema - ): - - - class MetaOapg: - items = schemas.NumberSchema - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, decimal.Decimal, int, float, ]], typing.List[typing.Union[MetaOapg.items, decimal.Decimal, int, float, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'ArrayNumber': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - __annotations__ = { - "ArrayNumber": ArrayNumber, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["ArrayNumber"]) -> MetaOapg.properties.ArrayNumber: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["ArrayNumber", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["ArrayNumber"]) -> typing.Union[MetaOapg.properties.ArrayNumber, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["ArrayNumber", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - ArrayNumber: typing.Union[MetaOapg.properties.ArrayNumber, list, tuple, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ArrayOfNumberOnly': - return super().__new__( - cls, - *_args, - ArrayNumber=ArrayNumber, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/array_of_number_only.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/array_of_number_only.pyi deleted file mode 100644 index 6a9731e65c9..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/array_of_number_only.pyi +++ /dev/null @@ -1,100 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ArrayOfNumberOnly( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - - - class ArrayNumber( - schemas.ListSchema - ): - - - class MetaOapg: - items = schemas.NumberSchema - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, decimal.Decimal, int, float, ]], typing.List[typing.Union[MetaOapg.items, decimal.Decimal, int, float, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'ArrayNumber': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - __annotations__ = { - "ArrayNumber": ArrayNumber, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["ArrayNumber"]) -> MetaOapg.properties.ArrayNumber: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["ArrayNumber", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["ArrayNumber"]) -> typing.Union[MetaOapg.properties.ArrayNumber, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["ArrayNumber", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - ArrayNumber: typing.Union[MetaOapg.properties.ArrayNumber, list, tuple, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ArrayOfNumberOnly': - return super().__new__( - cls, - *_args, - ArrayNumber=ArrayNumber, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/array_test.py b/samples/openapi3/client/petstore/python/petstore_api/model/array_test.py deleted file mode 100644 index e17a16af2ae..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/array_test.py +++ /dev/null @@ -1,213 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ArrayTest( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - - - class array_of_string( - schemas.ListSchema - ): - - - class MetaOapg: - items = schemas.StrSchema - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, str, ]], typing.List[typing.Union[MetaOapg.items, str, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'array_of_string': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - - - class array_array_of_integer( - schemas.ListSchema - ): - - - class MetaOapg: - - - class items( - schemas.ListSchema - ): - - - class MetaOapg: - items = schemas.Int64Schema - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, decimal.Decimal, int, ]], typing.List[typing.Union[MetaOapg.items, decimal.Decimal, int, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'items': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, list, tuple, ]], typing.List[typing.Union[MetaOapg.items, list, tuple, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'array_array_of_integer': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - - - class array_array_of_model( - schemas.ListSchema - ): - - - class MetaOapg: - - - class items( - schemas.ListSchema - ): - - - class MetaOapg: - - @staticmethod - def items() -> typing.Type['ReadOnlyFirst']: - return ReadOnlyFirst - - def __new__( - cls, - _arg: typing.Union[typing.Tuple['ReadOnlyFirst'], typing.List['ReadOnlyFirst']], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'items': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> 'ReadOnlyFirst': - return super().__getitem__(i) - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, list, tuple, ]], typing.List[typing.Union[MetaOapg.items, list, tuple, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'array_array_of_model': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - __annotations__ = { - "array_of_string": array_of_string, - "array_array_of_integer": array_array_of_integer, - "array_array_of_model": array_array_of_model, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["array_of_string"]) -> MetaOapg.properties.array_of_string: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["array_array_of_integer"]) -> MetaOapg.properties.array_array_of_integer: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["array_array_of_model"]) -> MetaOapg.properties.array_array_of_model: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["array_of_string", "array_array_of_integer", "array_array_of_model", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["array_of_string"]) -> typing.Union[MetaOapg.properties.array_of_string, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["array_array_of_integer"]) -> typing.Union[MetaOapg.properties.array_array_of_integer, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["array_array_of_model"]) -> typing.Union[MetaOapg.properties.array_array_of_model, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["array_of_string", "array_array_of_integer", "array_array_of_model", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - array_of_string: typing.Union[MetaOapg.properties.array_of_string, list, tuple, schemas.Unset] = schemas.unset, - array_array_of_integer: typing.Union[MetaOapg.properties.array_array_of_integer, list, tuple, schemas.Unset] = schemas.unset, - array_array_of_model: typing.Union[MetaOapg.properties.array_array_of_model, list, tuple, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ArrayTest': - return super().__new__( - cls, - *_args, - array_of_string=array_of_string, - array_array_of_integer=array_array_of_integer, - array_array_of_model=array_array_of_model, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.read_only_first import ReadOnlyFirst diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/array_test.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/array_test.pyi deleted file mode 100644 index e17a16af2ae..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/array_test.pyi +++ /dev/null @@ -1,213 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ArrayTest( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - - - class array_of_string( - schemas.ListSchema - ): - - - class MetaOapg: - items = schemas.StrSchema - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, str, ]], typing.List[typing.Union[MetaOapg.items, str, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'array_of_string': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - - - class array_array_of_integer( - schemas.ListSchema - ): - - - class MetaOapg: - - - class items( - schemas.ListSchema - ): - - - class MetaOapg: - items = schemas.Int64Schema - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, decimal.Decimal, int, ]], typing.List[typing.Union[MetaOapg.items, decimal.Decimal, int, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'items': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, list, tuple, ]], typing.List[typing.Union[MetaOapg.items, list, tuple, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'array_array_of_integer': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - - - class array_array_of_model( - schemas.ListSchema - ): - - - class MetaOapg: - - - class items( - schemas.ListSchema - ): - - - class MetaOapg: - - @staticmethod - def items() -> typing.Type['ReadOnlyFirst']: - return ReadOnlyFirst - - def __new__( - cls, - _arg: typing.Union[typing.Tuple['ReadOnlyFirst'], typing.List['ReadOnlyFirst']], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'items': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> 'ReadOnlyFirst': - return super().__getitem__(i) - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, list, tuple, ]], typing.List[typing.Union[MetaOapg.items, list, tuple, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'array_array_of_model': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - __annotations__ = { - "array_of_string": array_of_string, - "array_array_of_integer": array_array_of_integer, - "array_array_of_model": array_array_of_model, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["array_of_string"]) -> MetaOapg.properties.array_of_string: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["array_array_of_integer"]) -> MetaOapg.properties.array_array_of_integer: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["array_array_of_model"]) -> MetaOapg.properties.array_array_of_model: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["array_of_string", "array_array_of_integer", "array_array_of_model", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["array_of_string"]) -> typing.Union[MetaOapg.properties.array_of_string, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["array_array_of_integer"]) -> typing.Union[MetaOapg.properties.array_array_of_integer, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["array_array_of_model"]) -> typing.Union[MetaOapg.properties.array_array_of_model, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["array_of_string", "array_array_of_integer", "array_array_of_model", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - array_of_string: typing.Union[MetaOapg.properties.array_of_string, list, tuple, schemas.Unset] = schemas.unset, - array_array_of_integer: typing.Union[MetaOapg.properties.array_array_of_integer, list, tuple, schemas.Unset] = schemas.unset, - array_array_of_model: typing.Union[MetaOapg.properties.array_array_of_model, list, tuple, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ArrayTest': - return super().__new__( - cls, - *_args, - array_of_string=array_of_string, - array_array_of_integer=array_array_of_integer, - array_array_of_model=array_array_of_model, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.read_only_first import ReadOnlyFirst diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/array_with_validations_in_items.py b/samples/openapi3/client/petstore/python/petstore_api/model/array_with_validations_in_items.py deleted file mode 100644 index 4871e133597..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/array_with_validations_in_items.py +++ /dev/null @@ -1,61 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ArrayWithValidationsInItems( - schemas.ListSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - max_items = 2 - - - class items( - schemas.Int64Schema - ): - - - class MetaOapg: - format = 'int64' - inclusive_maximum = 7 - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, decimal.Decimal, int, ]], typing.List[typing.Union[MetaOapg.items, decimal.Decimal, int, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'ArrayWithValidationsInItems': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/array_with_validations_in_items.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/array_with_validations_in_items.pyi deleted file mode 100644 index 4adeeacb60b..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/array_with_validations_in_items.pyi +++ /dev/null @@ -1,56 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ArrayWithValidationsInItems( - schemas.ListSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - class items( - schemas.Int64Schema - ): - pass - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, decimal.Decimal, int, ]], typing.List[typing.Union[MetaOapg.items, decimal.Decimal, int, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'ArrayWithValidationsInItems': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/banana.py b/samples/openapi3/client/petstore/python/petstore_api/model/banana.py deleted file mode 100644 index e98306eb7db..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/banana.py +++ /dev/null @@ -1,83 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Banana( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "lengthCm", - } - - class properties: - lengthCm = schemas.NumberSchema - __annotations__ = { - "lengthCm": lengthCm, - } - - lengthCm: MetaOapg.properties.lengthCm - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["lengthCm"]) -> MetaOapg.properties.lengthCm: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["lengthCm", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["lengthCm"]) -> MetaOapg.properties.lengthCm: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["lengthCm", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - lengthCm: typing.Union[MetaOapg.properties.lengthCm, decimal.Decimal, int, float, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Banana': - return super().__new__( - cls, - *_args, - lengthCm=lengthCm, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/banana.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/banana.pyi deleted file mode 100644 index e98306eb7db..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/banana.pyi +++ /dev/null @@ -1,83 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Banana( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "lengthCm", - } - - class properties: - lengthCm = schemas.NumberSchema - __annotations__ = { - "lengthCm": lengthCm, - } - - lengthCm: MetaOapg.properties.lengthCm - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["lengthCm"]) -> MetaOapg.properties.lengthCm: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["lengthCm", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["lengthCm"]) -> MetaOapg.properties.lengthCm: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["lengthCm", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - lengthCm: typing.Union[MetaOapg.properties.lengthCm, decimal.Decimal, int, float, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Banana': - return super().__new__( - cls, - *_args, - lengthCm=lengthCm, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/banana_req.py b/samples/openapi3/client/petstore/python/petstore_api/model/banana_req.py deleted file mode 100644 index 0fd0634e237..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/banana_req.py +++ /dev/null @@ -1,84 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class BananaReq( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "lengthCm", - } - - class properties: - lengthCm = schemas.NumberSchema - sweet = schemas.BoolSchema - __annotations__ = { - "lengthCm": lengthCm, - "sweet": sweet, - } - additional_properties = schemas.NotAnyTypeSchema - - lengthCm: MetaOapg.properties.lengthCm - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["lengthCm"]) -> MetaOapg.properties.lengthCm: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["sweet"]) -> MetaOapg.properties.sweet: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["lengthCm"], typing_extensions.Literal["sweet"], ]): - # dict_instance[name] accessor - return super().__getitem__(name) - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["lengthCm"]) -> MetaOapg.properties.lengthCm: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["sweet"]) -> typing.Union[MetaOapg.properties.sweet, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["lengthCm"], typing_extensions.Literal["sweet"], ]): - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - lengthCm: typing.Union[MetaOapg.properties.lengthCm, decimal.Decimal, int, float, ], - sweet: typing.Union[MetaOapg.properties.sweet, bool, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'BananaReq': - return super().__new__( - cls, - *_args, - lengthCm=lengthCm, - sweet=sweet, - _configuration=_configuration, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/banana_req.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/banana_req.pyi deleted file mode 100644 index 0fd0634e237..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/banana_req.pyi +++ /dev/null @@ -1,84 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class BananaReq( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "lengthCm", - } - - class properties: - lengthCm = schemas.NumberSchema - sweet = schemas.BoolSchema - __annotations__ = { - "lengthCm": lengthCm, - "sweet": sweet, - } - additional_properties = schemas.NotAnyTypeSchema - - lengthCm: MetaOapg.properties.lengthCm - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["lengthCm"]) -> MetaOapg.properties.lengthCm: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["sweet"]) -> MetaOapg.properties.sweet: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["lengthCm"], typing_extensions.Literal["sweet"], ]): - # dict_instance[name] accessor - return super().__getitem__(name) - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["lengthCm"]) -> MetaOapg.properties.lengthCm: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["sweet"]) -> typing.Union[MetaOapg.properties.sweet, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["lengthCm"], typing_extensions.Literal["sweet"], ]): - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - lengthCm: typing.Union[MetaOapg.properties.lengthCm, decimal.Decimal, int, float, ], - sweet: typing.Union[MetaOapg.properties.sweet, bool, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'BananaReq': - return super().__new__( - cls, - *_args, - lengthCm=lengthCm, - sweet=sweet, - _configuration=_configuration, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/bar.py b/samples/openapi3/client/petstore/python/petstore_api/model/bar.py deleted file mode 100644 index d100ad83c56..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/bar.py +++ /dev/null @@ -1,24 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 -Bar = schemas.StrSchema diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/bar.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/bar.pyi deleted file mode 100644 index d100ad83c56..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/bar.pyi +++ /dev/null @@ -1,24 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 -Bar = schemas.StrSchema diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/basque_pig.py b/samples/openapi3/client/petstore/python/petstore_api/model/basque_pig.py deleted file mode 100644 index 89ea200394d..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/basque_pig.py +++ /dev/null @@ -1,98 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class BasquePig( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "className", - } - - class properties: - - - class className( - schemas.EnumBase, - schemas.StrSchema - ): - - - class MetaOapg: - enum_value_to_name = { - "BasquePig": "BASQUE_PIG", - } - - @schemas.classproperty - def BASQUE_PIG(cls): - return cls("BasquePig") - __annotations__ = { - "className": className, - } - - className: MetaOapg.properties.className - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["className"]) -> MetaOapg.properties.className: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["className", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["className"]) -> MetaOapg.properties.className: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["className", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - className: typing.Union[MetaOapg.properties.className, str, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'BasquePig': - return super().__new__( - cls, - *_args, - className=className, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/basque_pig.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/basque_pig.pyi deleted file mode 100644 index 9eaea822ed0..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/basque_pig.pyi +++ /dev/null @@ -1,92 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class BasquePig( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "className", - } - - class properties: - - - class className( - schemas.EnumBase, - schemas.StrSchema - ): - - @schemas.classproperty - def BASQUE_PIG(cls): - return cls("BasquePig") - __annotations__ = { - "className": className, - } - - className: MetaOapg.properties.className - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["className"]) -> MetaOapg.properties.className: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["className", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["className"]) -> MetaOapg.properties.className: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["className", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - className: typing.Union[MetaOapg.properties.className, str, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'BasquePig': - return super().__new__( - cls, - *_args, - className=className, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/boolean.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/boolean.pyi deleted file mode 100644 index 6f667d4c0b4..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/boolean.pyi +++ /dev/null @@ -1,24 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 -Boolean = schemas.BoolSchema diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/boolean_enum.py b/samples/openapi3/client/petstore/python/petstore_api/model/boolean_enum.py deleted file mode 100644 index 66d5be71312..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/boolean_enum.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class BooleanEnum( - schemas.EnumBase, - schemas.BoolSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - enum_value_to_name = { - schemas.BoolClass.TRUE: "TRUE", - } - - @schemas.classproperty - def TRUE(cls): - return cls(True) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/boolean_enum.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/boolean_enum.pyi deleted file mode 100644 index 69fe2e6af4e..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/boolean_enum.pyi +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class BooleanEnum( - schemas.EnumBase, - schemas.BoolSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - @schemas.classproperty - def TRUE(cls): - return cls(True) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/capitalization.py b/samples/openapi3/client/petstore/python/petstore_api/model/capitalization.py deleted file mode 100644 index b8888bde183..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/capitalization.py +++ /dev/null @@ -1,128 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Capitalization( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - smallCamel = schemas.StrSchema - CapitalCamel = schemas.StrSchema - small_Snake = schemas.StrSchema - Capital_Snake = schemas.StrSchema - SCA_ETH_Flow_Points = schemas.StrSchema - ATT_NAME = schemas.StrSchema - __annotations__ = { - "smallCamel": smallCamel, - "CapitalCamel": CapitalCamel, - "small_Snake": small_Snake, - "Capital_Snake": Capital_Snake, - "SCA_ETH_Flow_Points": SCA_ETH_Flow_Points, - "ATT_NAME": ATT_NAME, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["smallCamel"]) -> MetaOapg.properties.smallCamel: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["CapitalCamel"]) -> MetaOapg.properties.CapitalCamel: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["small_Snake"]) -> MetaOapg.properties.small_Snake: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["Capital_Snake"]) -> MetaOapg.properties.Capital_Snake: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["SCA_ETH_Flow_Points"]) -> MetaOapg.properties.SCA_ETH_Flow_Points: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["ATT_NAME"]) -> MetaOapg.properties.ATT_NAME: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["smallCamel", "CapitalCamel", "small_Snake", "Capital_Snake", "SCA_ETH_Flow_Points", "ATT_NAME", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["smallCamel"]) -> typing.Union[MetaOapg.properties.smallCamel, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["CapitalCamel"]) -> typing.Union[MetaOapg.properties.CapitalCamel, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["small_Snake"]) -> typing.Union[MetaOapg.properties.small_Snake, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["Capital_Snake"]) -> typing.Union[MetaOapg.properties.Capital_Snake, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["SCA_ETH_Flow_Points"]) -> typing.Union[MetaOapg.properties.SCA_ETH_Flow_Points, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["ATT_NAME"]) -> typing.Union[MetaOapg.properties.ATT_NAME, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["smallCamel", "CapitalCamel", "small_Snake", "Capital_Snake", "SCA_ETH_Flow_Points", "ATT_NAME", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - smallCamel: typing.Union[MetaOapg.properties.smallCamel, str, schemas.Unset] = schemas.unset, - CapitalCamel: typing.Union[MetaOapg.properties.CapitalCamel, str, schemas.Unset] = schemas.unset, - small_Snake: typing.Union[MetaOapg.properties.small_Snake, str, schemas.Unset] = schemas.unset, - Capital_Snake: typing.Union[MetaOapg.properties.Capital_Snake, str, schemas.Unset] = schemas.unset, - SCA_ETH_Flow_Points: typing.Union[MetaOapg.properties.SCA_ETH_Flow_Points, str, schemas.Unset] = schemas.unset, - ATT_NAME: typing.Union[MetaOapg.properties.ATT_NAME, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Capitalization': - return super().__new__( - cls, - *_args, - smallCamel=smallCamel, - CapitalCamel=CapitalCamel, - small_Snake=small_Snake, - Capital_Snake=Capital_Snake, - SCA_ETH_Flow_Points=SCA_ETH_Flow_Points, - ATT_NAME=ATT_NAME, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/capitalization.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/capitalization.pyi deleted file mode 100644 index b8888bde183..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/capitalization.pyi +++ /dev/null @@ -1,128 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Capitalization( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - smallCamel = schemas.StrSchema - CapitalCamel = schemas.StrSchema - small_Snake = schemas.StrSchema - Capital_Snake = schemas.StrSchema - SCA_ETH_Flow_Points = schemas.StrSchema - ATT_NAME = schemas.StrSchema - __annotations__ = { - "smallCamel": smallCamel, - "CapitalCamel": CapitalCamel, - "small_Snake": small_Snake, - "Capital_Snake": Capital_Snake, - "SCA_ETH_Flow_Points": SCA_ETH_Flow_Points, - "ATT_NAME": ATT_NAME, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["smallCamel"]) -> MetaOapg.properties.smallCamel: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["CapitalCamel"]) -> MetaOapg.properties.CapitalCamel: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["small_Snake"]) -> MetaOapg.properties.small_Snake: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["Capital_Snake"]) -> MetaOapg.properties.Capital_Snake: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["SCA_ETH_Flow_Points"]) -> MetaOapg.properties.SCA_ETH_Flow_Points: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["ATT_NAME"]) -> MetaOapg.properties.ATT_NAME: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["smallCamel", "CapitalCamel", "small_Snake", "Capital_Snake", "SCA_ETH_Flow_Points", "ATT_NAME", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["smallCamel"]) -> typing.Union[MetaOapg.properties.smallCamel, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["CapitalCamel"]) -> typing.Union[MetaOapg.properties.CapitalCamel, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["small_Snake"]) -> typing.Union[MetaOapg.properties.small_Snake, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["Capital_Snake"]) -> typing.Union[MetaOapg.properties.Capital_Snake, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["SCA_ETH_Flow_Points"]) -> typing.Union[MetaOapg.properties.SCA_ETH_Flow_Points, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["ATT_NAME"]) -> typing.Union[MetaOapg.properties.ATT_NAME, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["smallCamel", "CapitalCamel", "small_Snake", "Capital_Snake", "SCA_ETH_Flow_Points", "ATT_NAME", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - smallCamel: typing.Union[MetaOapg.properties.smallCamel, str, schemas.Unset] = schemas.unset, - CapitalCamel: typing.Union[MetaOapg.properties.CapitalCamel, str, schemas.Unset] = schemas.unset, - small_Snake: typing.Union[MetaOapg.properties.small_Snake, str, schemas.Unset] = schemas.unset, - Capital_Snake: typing.Union[MetaOapg.properties.Capital_Snake, str, schemas.Unset] = schemas.unset, - SCA_ETH_Flow_Points: typing.Union[MetaOapg.properties.SCA_ETH_Flow_Points, str, schemas.Unset] = schemas.unset, - ATT_NAME: typing.Union[MetaOapg.properties.ATT_NAME, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Capitalization': - return super().__new__( - cls, - *_args, - smallCamel=smallCamel, - CapitalCamel=CapitalCamel, - small_Snake=small_Snake, - Capital_Snake=Capital_Snake, - SCA_ETH_Flow_Points=SCA_ETH_Flow_Points, - ATT_NAME=ATT_NAME, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/cat.py b/samples/openapi3/client/petstore/python/petstore_api/model/cat.py deleted file mode 100644 index 0545d82acae..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/cat.py +++ /dev/null @@ -1,117 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Cat( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - class all_of_1( - schemas.DictSchema - ): - - - class MetaOapg: - - class properties: - declawed = schemas.BoolSchema - __annotations__ = { - "declawed": declawed, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["declawed"]) -> MetaOapg.properties.declawed: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["declawed", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["declawed"]) -> typing.Union[MetaOapg.properties.declawed, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["declawed", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - declawed: typing.Union[MetaOapg.properties.declawed, bool, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'all_of_1': - return super().__new__( - cls, - *_args, - declawed=declawed, - _configuration=_configuration, - **kwargs, - ) - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - Animal, - cls.all_of_1, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Cat': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.animal import Animal diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/cat.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/cat.pyi deleted file mode 100644 index 0545d82acae..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/cat.pyi +++ /dev/null @@ -1,117 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Cat( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - class all_of_1( - schemas.DictSchema - ): - - - class MetaOapg: - - class properties: - declawed = schemas.BoolSchema - __annotations__ = { - "declawed": declawed, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["declawed"]) -> MetaOapg.properties.declawed: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["declawed", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["declawed"]) -> typing.Union[MetaOapg.properties.declawed, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["declawed", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - declawed: typing.Union[MetaOapg.properties.declawed, bool, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'all_of_1': - return super().__new__( - cls, - *_args, - declawed=declawed, - _configuration=_configuration, - **kwargs, - ) - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - Animal, - cls.all_of_1, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Cat': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.animal import Animal diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/category.py b/samples/openapi3/client/petstore/python/petstore_api/model/category.py deleted file mode 100644 index ed26c6fe29b..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/category.py +++ /dev/null @@ -1,93 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Category( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "name", - } - - class properties: - name = schemas.StrSchema - id = schemas.Int64Schema - __annotations__ = { - "name": name, - "id": id, - } - - name: MetaOapg.properties.name - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["id"]) -> MetaOapg.properties.id: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["name", "id", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["id"]) -> typing.Union[MetaOapg.properties.id, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["name", "id", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - name: typing.Union[MetaOapg.properties.name, str, ], - id: typing.Union[MetaOapg.properties.id, decimal.Decimal, int, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Category': - return super().__new__( - cls, - *_args, - name=name, - id=id, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/category.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/category.pyi deleted file mode 100644 index ed26c6fe29b..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/category.pyi +++ /dev/null @@ -1,93 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Category( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "name", - } - - class properties: - name = schemas.StrSchema - id = schemas.Int64Schema - __annotations__ = { - "name": name, - "id": id, - } - - name: MetaOapg.properties.name - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["id"]) -> MetaOapg.properties.id: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["name", "id", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["id"]) -> typing.Union[MetaOapg.properties.id, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["name", "id", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - name: typing.Union[MetaOapg.properties.name, str, ], - id: typing.Union[MetaOapg.properties.id, decimal.Decimal, int, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Category': - return super().__new__( - cls, - *_args, - name=name, - id=id, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/child_cat.py b/samples/openapi3/client/petstore/python/petstore_api/model/child_cat.py deleted file mode 100644 index e17837b7a4b..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/child_cat.py +++ /dev/null @@ -1,117 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ChildCat( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - class all_of_1( - schemas.DictSchema - ): - - - class MetaOapg: - - class properties: - name = schemas.StrSchema - __annotations__ = { - "name": name, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["name", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["name"]) -> typing.Union[MetaOapg.properties.name, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["name", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - name: typing.Union[MetaOapg.properties.name, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'all_of_1': - return super().__new__( - cls, - *_args, - name=name, - _configuration=_configuration, - **kwargs, - ) - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - ParentPet, - cls.all_of_1, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ChildCat': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.parent_pet import ParentPet diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/child_cat.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/child_cat.pyi deleted file mode 100644 index e17837b7a4b..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/child_cat.pyi +++ /dev/null @@ -1,117 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ChildCat( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - class all_of_1( - schemas.DictSchema - ): - - - class MetaOapg: - - class properties: - name = schemas.StrSchema - __annotations__ = { - "name": name, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["name", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["name"]) -> typing.Union[MetaOapg.properties.name, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["name", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - name: typing.Union[MetaOapg.properties.name, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'all_of_1': - return super().__new__( - cls, - *_args, - name=name, - _configuration=_configuration, - **kwargs, - ) - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - ParentPet, - cls.all_of_1, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ChildCat': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.parent_pet import ParentPet diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/class_model.py b/samples/openapi3/client/petstore/python/petstore_api/model/class_model.py deleted file mode 100644 index cf43a386a7b..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/class_model.py +++ /dev/null @@ -1,81 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ClassModel( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Model for testing model with "_class" property - """ - - - class MetaOapg: - - class properties: - _class = schemas.StrSchema - __annotations__ = { - "_class": _class, - } - - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["_class"]) -> MetaOapg.properties._class: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["_class", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["_class"]) -> typing.Union[MetaOapg.properties._class, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["_class", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _class: typing.Union[MetaOapg.properties._class, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ClassModel': - return super().__new__( - cls, - *_args, - _class=_class, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/class_model.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/class_model.pyi deleted file mode 100644 index cf43a386a7b..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/class_model.pyi +++ /dev/null @@ -1,81 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ClassModel( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Model for testing model with "_class" property - """ - - - class MetaOapg: - - class properties: - _class = schemas.StrSchema - __annotations__ = { - "_class": _class, - } - - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["_class"]) -> MetaOapg.properties._class: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["_class", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["_class"]) -> typing.Union[MetaOapg.properties._class, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["_class", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _class: typing.Union[MetaOapg.properties._class, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ClassModel': - return super().__new__( - cls, - *_args, - _class=_class, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/client.py b/samples/openapi3/client/petstore/python/petstore_api/model/client.py deleted file mode 100644 index fb8e65556d7..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/client.py +++ /dev/null @@ -1,78 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Client( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - client = schemas.StrSchema - __annotations__ = { - "client": client, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["client"]) -> MetaOapg.properties.client: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["client", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["client"]) -> typing.Union[MetaOapg.properties.client, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["client", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - client: typing.Union[MetaOapg.properties.client, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Client': - return super().__new__( - cls, - *_args, - client=client, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/client.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/client.pyi deleted file mode 100644 index fb8e65556d7..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/client.pyi +++ /dev/null @@ -1,78 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Client( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - client = schemas.StrSchema - __annotations__ = { - "client": client, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["client"]) -> MetaOapg.properties.client: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["client", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["client"]) -> typing.Union[MetaOapg.properties.client, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["client", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - client: typing.Union[MetaOapg.properties.client, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Client': - return super().__new__( - cls, - *_args, - client=client, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/complex_quadrilateral.py b/samples/openapi3/client/petstore/python/petstore_api/model/complex_quadrilateral.py deleted file mode 100644 index e24a3e3b0b3..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/complex_quadrilateral.py +++ /dev/null @@ -1,132 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ComplexQuadrilateral( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - class all_of_1( - schemas.DictSchema - ): - - - class MetaOapg: - - class properties: - - - class quadrilateralType( - schemas.EnumBase, - schemas.StrSchema - ): - - - class MetaOapg: - enum_value_to_name = { - "ComplexQuadrilateral": "COMPLEX_QUADRILATERAL", - } - - @schemas.classproperty - def COMPLEX_QUADRILATERAL(cls): - return cls("ComplexQuadrilateral") - __annotations__ = { - "quadrilateralType": quadrilateralType, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["quadrilateralType"]) -> MetaOapg.properties.quadrilateralType: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["quadrilateralType", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["quadrilateralType"]) -> typing.Union[MetaOapg.properties.quadrilateralType, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["quadrilateralType", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - quadrilateralType: typing.Union[MetaOapg.properties.quadrilateralType, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'all_of_1': - return super().__new__( - cls, - *_args, - quadrilateralType=quadrilateralType, - _configuration=_configuration, - **kwargs, - ) - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - QuadrilateralInterface, - cls.all_of_1, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ComplexQuadrilateral': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.quadrilateral_interface import QuadrilateralInterface diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/complex_quadrilateral.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/complex_quadrilateral.pyi deleted file mode 100644 index efaa4be332d..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/complex_quadrilateral.pyi +++ /dev/null @@ -1,126 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ComplexQuadrilateral( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - class all_of_1( - schemas.DictSchema - ): - - - class MetaOapg: - - class properties: - - - class quadrilateralType( - schemas.EnumBase, - schemas.StrSchema - ): - - @schemas.classproperty - def COMPLEX_QUADRILATERAL(cls): - return cls("ComplexQuadrilateral") - __annotations__ = { - "quadrilateralType": quadrilateralType, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["quadrilateralType"]) -> MetaOapg.properties.quadrilateralType: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["quadrilateralType", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["quadrilateralType"]) -> typing.Union[MetaOapg.properties.quadrilateralType, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["quadrilateralType", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - quadrilateralType: typing.Union[MetaOapg.properties.quadrilateralType, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'all_of_1': - return super().__new__( - cls, - *_args, - quadrilateralType=quadrilateralType, - _configuration=_configuration, - **kwargs, - ) - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - QuadrilateralInterface, - cls.all_of_1, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ComplexQuadrilateral': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.quadrilateral_interface import QuadrilateralInterface diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/composed_any_of_different_types_no_validations.py b/samples/openapi3/client/petstore/python/petstore_api/model/composed_any_of_different_types_no_validations.py deleted file mode 100644 index 85e92968997..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/composed_any_of_different_types_no_validations.py +++ /dev/null @@ -1,117 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ComposedAnyOfDifferentTypesNoValidations( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - any_of_0 = schemas.DictSchema - any_of_1 = schemas.DateSchema - any_of_2 = schemas.DateTimeSchema - any_of_3 = schemas.BinarySchema - any_of_4 = schemas.StrSchema - any_of_5 = schemas.StrSchema - any_of_6 = schemas.DictSchema - any_of_7 = schemas.BoolSchema - any_of_8 = schemas.NoneSchema - - - class any_of_9( - schemas.ListSchema - ): - - - class MetaOapg: - items = schemas.AnyTypeSchema - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ]], typing.List[typing.Union[MetaOapg.items, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'any_of_9': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - any_of_10 = schemas.NumberSchema - any_of_11 = schemas.Float32Schema - any_of_12 = schemas.Float64Schema - any_of_13 = schemas.IntSchema - any_of_14 = schemas.Int32Schema - any_of_15 = schemas.Int64Schema - - @classmethod - @functools.lru_cache() - def any_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.any_of_0, - cls.any_of_1, - cls.any_of_2, - cls.any_of_3, - cls.any_of_4, - cls.any_of_5, - cls.any_of_6, - cls.any_of_7, - cls.any_of_8, - cls.any_of_9, - cls.any_of_10, - cls.any_of_11, - cls.any_of_12, - cls.any_of_13, - cls.any_of_14, - cls.any_of_15, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ComposedAnyOfDifferentTypesNoValidations': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/composed_any_of_different_types_no_validations.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/composed_any_of_different_types_no_validations.pyi deleted file mode 100644 index 85e92968997..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/composed_any_of_different_types_no_validations.pyi +++ /dev/null @@ -1,117 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ComposedAnyOfDifferentTypesNoValidations( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - any_of_0 = schemas.DictSchema - any_of_1 = schemas.DateSchema - any_of_2 = schemas.DateTimeSchema - any_of_3 = schemas.BinarySchema - any_of_4 = schemas.StrSchema - any_of_5 = schemas.StrSchema - any_of_6 = schemas.DictSchema - any_of_7 = schemas.BoolSchema - any_of_8 = schemas.NoneSchema - - - class any_of_9( - schemas.ListSchema - ): - - - class MetaOapg: - items = schemas.AnyTypeSchema - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ]], typing.List[typing.Union[MetaOapg.items, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'any_of_9': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - any_of_10 = schemas.NumberSchema - any_of_11 = schemas.Float32Schema - any_of_12 = schemas.Float64Schema - any_of_13 = schemas.IntSchema - any_of_14 = schemas.Int32Schema - any_of_15 = schemas.Int64Schema - - @classmethod - @functools.lru_cache() - def any_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.any_of_0, - cls.any_of_1, - cls.any_of_2, - cls.any_of_3, - cls.any_of_4, - cls.any_of_5, - cls.any_of_6, - cls.any_of_7, - cls.any_of_8, - cls.any_of_9, - cls.any_of_10, - cls.any_of_11, - cls.any_of_12, - cls.any_of_13, - cls.any_of_14, - cls.any_of_15, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ComposedAnyOfDifferentTypesNoValidations': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/composed_array.py b/samples/openapi3/client/petstore/python/petstore_api/model/composed_array.py deleted file mode 100644 index 792eb8c78a2..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/composed_array.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ComposedArray( - schemas.ListSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - items = schemas.AnyTypeSchema - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ]], typing.List[typing.Union[MetaOapg.items, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'ComposedArray': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/composed_array.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/composed_array.pyi deleted file mode 100644 index 792eb8c78a2..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/composed_array.pyi +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ComposedArray( - schemas.ListSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - items = schemas.AnyTypeSchema - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ]], typing.List[typing.Union[MetaOapg.items, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'ComposedArray': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/composed_bool.py b/samples/openapi3/client/petstore/python/petstore_api/model/composed_bool.py deleted file mode 100644 index 9252324147d..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/composed_bool.py +++ /dev/null @@ -1,64 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ComposedBool( - schemas.ComposedBase, - schemas.BoolSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - all_of_0 = schemas.AnyTypeSchema - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.all_of_0, - ] - - - def __new__( - cls, - *_args: typing.Union[bool, ], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'ComposedBool': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/composed_bool.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/composed_bool.pyi deleted file mode 100644 index 9252324147d..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/composed_bool.pyi +++ /dev/null @@ -1,64 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ComposedBool( - schemas.ComposedBase, - schemas.BoolSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - all_of_0 = schemas.AnyTypeSchema - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.all_of_0, - ] - - - def __new__( - cls, - *_args: typing.Union[bool, ], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'ComposedBool': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/composed_none.py b/samples/openapi3/client/petstore/python/petstore_api/model/composed_none.py deleted file mode 100644 index 5facdd344b5..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/composed_none.py +++ /dev/null @@ -1,64 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ComposedNone( - schemas.ComposedBase, - schemas.NoneSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - all_of_0 = schemas.AnyTypeSchema - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.all_of_0, - ] - - - def __new__( - cls, - *_args: typing.Union[None, ], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'ComposedNone': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/composed_none.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/composed_none.pyi deleted file mode 100644 index 5facdd344b5..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/composed_none.pyi +++ /dev/null @@ -1,64 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ComposedNone( - schemas.ComposedBase, - schemas.NoneSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - all_of_0 = schemas.AnyTypeSchema - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.all_of_0, - ] - - - def __new__( - cls, - *_args: typing.Union[None, ], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'ComposedNone': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/composed_number.py b/samples/openapi3/client/petstore/python/petstore_api/model/composed_number.py deleted file mode 100644 index b417ee0ee61..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/composed_number.py +++ /dev/null @@ -1,64 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ComposedNumber( - schemas.ComposedBase, - schemas.NumberSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - all_of_0 = schemas.AnyTypeSchema - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.all_of_0, - ] - - - def __new__( - cls, - *_args: typing.Union[decimal.Decimal, int, float, ], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'ComposedNumber': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/composed_number.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/composed_number.pyi deleted file mode 100644 index b417ee0ee61..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/composed_number.pyi +++ /dev/null @@ -1,64 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ComposedNumber( - schemas.ComposedBase, - schemas.NumberSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - all_of_0 = schemas.AnyTypeSchema - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.all_of_0, - ] - - - def __new__( - cls, - *_args: typing.Union[decimal.Decimal, int, float, ], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'ComposedNumber': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/composed_object.py b/samples/openapi3/client/petstore/python/petstore_api/model/composed_object.py deleted file mode 100644 index 474f09ef8e5..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/composed_object.py +++ /dev/null @@ -1,66 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ComposedObject( - schemas.ComposedBase, - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - all_of_0 = schemas.AnyTypeSchema - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.all_of_0, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ComposedObject': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/composed_object.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/composed_object.pyi deleted file mode 100644 index 474f09ef8e5..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/composed_object.pyi +++ /dev/null @@ -1,66 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ComposedObject( - schemas.ComposedBase, - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - all_of_0 = schemas.AnyTypeSchema - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.all_of_0, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ComposedObject': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/composed_one_of_different_types.py b/samples/openapi3/client/petstore/python/petstore_api/model/composed_one_of_different_types.py deleted file mode 100644 index a49a14190e6..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/composed_one_of_different_types.py +++ /dev/null @@ -1,137 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ComposedOneOfDifferentTypes( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - this is a model that allows payloads of type object or number - """ - - - class MetaOapg: - one_of_2 = schemas.NoneSchema - one_of_3 = schemas.DateSchema - - - class one_of_4( - schemas.DictSchema - ): - - - class MetaOapg: - max_properties = 4 - min_properties = 4 - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'one_of_4': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - - class one_of_5( - schemas.ListSchema - ): - - - class MetaOapg: - max_items = 4 - min_items = 4 - items = schemas.AnyTypeSchema - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ]], typing.List[typing.Union[MetaOapg.items, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'one_of_5': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - - - class one_of_6( - schemas.DateTimeSchema - ): - - - class MetaOapg: - format = 'date-time' - regex=[{ - 'pattern': r'^2020.*', # noqa: E501 - }] - - @classmethod - @functools.lru_cache() - def one_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - NumberWithValidations, - Animal, - cls.one_of_2, - cls.one_of_3, - cls.one_of_4, - cls.one_of_5, - cls.one_of_6, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ComposedOneOfDifferentTypes': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.animal import Animal -from petstore_api.model.number_with_validations import NumberWithValidations diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/composed_one_of_different_types.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/composed_one_of_different_types.pyi deleted file mode 100644 index 3e108524af1..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/composed_one_of_different_types.pyi +++ /dev/null @@ -1,124 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ComposedOneOfDifferentTypes( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - this is a model that allows payloads of type object or number - """ - - - class MetaOapg: - one_of_2 = schemas.NoneSchema - one_of_3 = schemas.DateSchema - - - class one_of_4( - schemas.DictSchema - ): - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'one_of_4': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - - class one_of_5( - schemas.ListSchema - ): - - - class MetaOapg: - items = schemas.AnyTypeSchema - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ]], typing.List[typing.Union[MetaOapg.items, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'one_of_5': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - - - class one_of_6( - schemas.DateTimeSchema - ): - pass - - @classmethod - @functools.lru_cache() - def one_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - NumberWithValidations, - Animal, - cls.one_of_2, - cls.one_of_3, - cls.one_of_4, - cls.one_of_5, - cls.one_of_6, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ComposedOneOfDifferentTypes': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.animal import Animal -from petstore_api.model.number_with_validations import NumberWithValidations diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/composed_string.py b/samples/openapi3/client/petstore/python/petstore_api/model/composed_string.py deleted file mode 100644 index 23be061de44..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/composed_string.py +++ /dev/null @@ -1,64 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ComposedString( - schemas.ComposedBase, - schemas.StrSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - all_of_0 = schemas.AnyTypeSchema - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.all_of_0, - ] - - - def __new__( - cls, - *_args: typing.Union[str, ], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'ComposedString': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/composed_string.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/composed_string.pyi deleted file mode 100644 index 23be061de44..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/composed_string.pyi +++ /dev/null @@ -1,64 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ComposedString( - schemas.ComposedBase, - schemas.StrSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - all_of_0 = schemas.AnyTypeSchema - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.all_of_0, - ] - - - def __new__( - cls, - *_args: typing.Union[str, ], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'ComposedString': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/currency.py b/samples/openapi3/client/petstore/python/petstore_api/model/currency.py deleted file mode 100644 index 8714c9adcc7..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/currency.py +++ /dev/null @@ -1,49 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Currency( - schemas.EnumBase, - schemas.StrSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - enum_value_to_name = { - "eur": "EUR", - "usd": "USD", - } - - @schemas.classproperty - def EUR(cls): - return cls("eur") - - @schemas.classproperty - def USD(cls): - return cls("usd") diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/currency.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/currency.pyi deleted file mode 100644 index 7706629add2..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/currency.pyi +++ /dev/null @@ -1,42 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Currency( - schemas.EnumBase, - schemas.StrSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - @schemas.classproperty - def EUR(cls): - return cls("eur") - - @schemas.classproperty - def USD(cls): - return cls("usd") diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/danish_pig.py b/samples/openapi3/client/petstore/python/petstore_api/model/danish_pig.py deleted file mode 100644 index b6081d20e23..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/danish_pig.py +++ /dev/null @@ -1,98 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class DanishPig( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "className", - } - - class properties: - - - class className( - schemas.EnumBase, - schemas.StrSchema - ): - - - class MetaOapg: - enum_value_to_name = { - "DanishPig": "DANISH_PIG", - } - - @schemas.classproperty - def DANISH_PIG(cls): - return cls("DanishPig") - __annotations__ = { - "className": className, - } - - className: MetaOapg.properties.className - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["className"]) -> MetaOapg.properties.className: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["className", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["className"]) -> MetaOapg.properties.className: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["className", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - className: typing.Union[MetaOapg.properties.className, str, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'DanishPig': - return super().__new__( - cls, - *_args, - className=className, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/danish_pig.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/danish_pig.pyi deleted file mode 100644 index f67a4b5d8cc..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/danish_pig.pyi +++ /dev/null @@ -1,92 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class DanishPig( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "className", - } - - class properties: - - - class className( - schemas.EnumBase, - schemas.StrSchema - ): - - @schemas.classproperty - def DANISH_PIG(cls): - return cls("DanishPig") - __annotations__ = { - "className": className, - } - - className: MetaOapg.properties.className - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["className"]) -> MetaOapg.properties.className: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["className", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["className"]) -> MetaOapg.properties.className: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["className", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - className: typing.Union[MetaOapg.properties.className, str, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'DanishPig': - return super().__new__( - cls, - *_args, - className=className, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/date_time_test.py b/samples/openapi3/client/petstore/python/petstore_api/model/date_time_test.py deleted file mode 100644 index 1a616cac271..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/date_time_test.py +++ /dev/null @@ -1,24 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 -DateTimeTest = schemas.DateTimeSchema diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/date_time_test.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/date_time_test.pyi deleted file mode 100644 index 1a616cac271..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/date_time_test.pyi +++ /dev/null @@ -1,24 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 -DateTimeTest = schemas.DateTimeSchema diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/date_time_with_validations.py b/samples/openapi3/client/petstore/python/petstore_api/model/date_time_with_validations.py deleted file mode 100644 index a5a7858195a..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/date_time_with_validations.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class DateTimeWithValidations( - schemas.DateTimeSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - format = 'date-time' - regex=[{ - 'pattern': r'^2020.*', # noqa: E501 - }] diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/date_time_with_validations.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/date_time_with_validations.pyi deleted file mode 100644 index 2898b619005..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/date_time_with_validations.pyi +++ /dev/null @@ -1,34 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class DateTimeWithValidations( - schemas.DateTimeSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - pass diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/date_with_validations.py b/samples/openapi3/client/petstore/python/petstore_api/model/date_with_validations.py deleted file mode 100644 index 82d0122a279..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/date_with_validations.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class DateWithValidations( - schemas.DateSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - format = 'date' - regex=[{ - 'pattern': r'^2020.*', # noqa: E501 - }] diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/date_with_validations.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/date_with_validations.pyi deleted file mode 100644 index 52770358d18..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/date_with_validations.pyi +++ /dev/null @@ -1,34 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class DateWithValidations( - schemas.DateSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - pass diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/decimal_payload.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/decimal_payload.pyi deleted file mode 100644 index 8e3b63175a4..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/decimal_payload.pyi +++ /dev/null @@ -1,24 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 -DecimalPayload = schemas.DecimalSchema diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/dog.py b/samples/openapi3/client/petstore/python/petstore_api/model/dog.py deleted file mode 100644 index aa5ccd90aac..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/dog.py +++ /dev/null @@ -1,117 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Dog( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - class all_of_1( - schemas.DictSchema - ): - - - class MetaOapg: - - class properties: - breed = schemas.StrSchema - __annotations__ = { - "breed": breed, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["breed"]) -> MetaOapg.properties.breed: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["breed", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["breed"]) -> typing.Union[MetaOapg.properties.breed, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["breed", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - breed: typing.Union[MetaOapg.properties.breed, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'all_of_1': - return super().__new__( - cls, - *_args, - breed=breed, - _configuration=_configuration, - **kwargs, - ) - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - Animal, - cls.all_of_1, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Dog': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.animal import Animal diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/dog.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/dog.pyi deleted file mode 100644 index aa5ccd90aac..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/dog.pyi +++ /dev/null @@ -1,117 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Dog( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - class all_of_1( - schemas.DictSchema - ): - - - class MetaOapg: - - class properties: - breed = schemas.StrSchema - __annotations__ = { - "breed": breed, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["breed"]) -> MetaOapg.properties.breed: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["breed", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["breed"]) -> typing.Union[MetaOapg.properties.breed, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["breed", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - breed: typing.Union[MetaOapg.properties.breed, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'all_of_1': - return super().__new__( - cls, - *_args, - breed=breed, - _configuration=_configuration, - **kwargs, - ) - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - Animal, - cls.all_of_1, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Dog': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.animal import Animal diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/drawing.py b/samples/openapi3/client/petstore/python/petstore_api/model/drawing.py deleted file mode 100644 index b4b8da6a73a..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/drawing.py +++ /dev/null @@ -1,149 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Drawing( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - - @staticmethod - def mainShape() -> typing.Type['Shape']: - return Shape - - @staticmethod - def shapeOrNull() -> typing.Type['ShapeOrNull']: - return ShapeOrNull - - @staticmethod - def nullableShape() -> typing.Type['NullableShape']: - return NullableShape - - - class shapes( - schemas.ListSchema - ): - - - class MetaOapg: - - @staticmethod - def items() -> typing.Type['Shape']: - return Shape - - def __new__( - cls, - _arg: typing.Union[typing.Tuple['Shape'], typing.List['Shape']], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'shapes': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> 'Shape': - return super().__getitem__(i) - __annotations__ = { - "mainShape": mainShape, - "shapeOrNull": shapeOrNull, - "nullableShape": nullableShape, - "shapes": shapes, - } - - @staticmethod - def additional_properties() -> typing.Type['Fruit']: - return Fruit - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["mainShape"]) -> 'Shape': ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["shapeOrNull"]) -> 'ShapeOrNull': ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["nullableShape"]) -> 'NullableShape': ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["shapes"]) -> MetaOapg.properties.shapes: ... - - @typing.overload - def __getitem__(self, name: str) -> 'Fruit': ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["mainShape"], typing_extensions.Literal["shapeOrNull"], typing_extensions.Literal["nullableShape"], typing_extensions.Literal["shapes"], str, ]): - # dict_instance[name] accessor - return super().__getitem__(name) - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["mainShape"]) -> typing.Union['Shape', schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["shapeOrNull"]) -> typing.Union['ShapeOrNull', schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["nullableShape"]) -> typing.Union['NullableShape', schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["shapes"]) -> typing.Union[MetaOapg.properties.shapes, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union['Fruit', schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["mainShape"], typing_extensions.Literal["shapeOrNull"], typing_extensions.Literal["nullableShape"], typing_extensions.Literal["shapes"], str, ]): - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - mainShape: typing.Union['Shape', schemas.Unset] = schemas.unset, - shapeOrNull: typing.Union['ShapeOrNull', schemas.Unset] = schemas.unset, - nullableShape: typing.Union['NullableShape', schemas.Unset] = schemas.unset, - shapes: typing.Union[MetaOapg.properties.shapes, list, tuple, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: 'Fruit', - ) -> 'Drawing': - return super().__new__( - cls, - *_args, - mainShape=mainShape, - shapeOrNull=shapeOrNull, - nullableShape=nullableShape, - shapes=shapes, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.fruit import Fruit -from petstore_api.model.nullable_shape import NullableShape -from petstore_api.model.shape import Shape -from petstore_api.model.shape_or_null import ShapeOrNull diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/drawing.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/drawing.pyi deleted file mode 100644 index b4b8da6a73a..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/drawing.pyi +++ /dev/null @@ -1,149 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Drawing( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - - @staticmethod - def mainShape() -> typing.Type['Shape']: - return Shape - - @staticmethod - def shapeOrNull() -> typing.Type['ShapeOrNull']: - return ShapeOrNull - - @staticmethod - def nullableShape() -> typing.Type['NullableShape']: - return NullableShape - - - class shapes( - schemas.ListSchema - ): - - - class MetaOapg: - - @staticmethod - def items() -> typing.Type['Shape']: - return Shape - - def __new__( - cls, - _arg: typing.Union[typing.Tuple['Shape'], typing.List['Shape']], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'shapes': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> 'Shape': - return super().__getitem__(i) - __annotations__ = { - "mainShape": mainShape, - "shapeOrNull": shapeOrNull, - "nullableShape": nullableShape, - "shapes": shapes, - } - - @staticmethod - def additional_properties() -> typing.Type['Fruit']: - return Fruit - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["mainShape"]) -> 'Shape': ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["shapeOrNull"]) -> 'ShapeOrNull': ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["nullableShape"]) -> 'NullableShape': ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["shapes"]) -> MetaOapg.properties.shapes: ... - - @typing.overload - def __getitem__(self, name: str) -> 'Fruit': ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["mainShape"], typing_extensions.Literal["shapeOrNull"], typing_extensions.Literal["nullableShape"], typing_extensions.Literal["shapes"], str, ]): - # dict_instance[name] accessor - return super().__getitem__(name) - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["mainShape"]) -> typing.Union['Shape', schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["shapeOrNull"]) -> typing.Union['ShapeOrNull', schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["nullableShape"]) -> typing.Union['NullableShape', schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["shapes"]) -> typing.Union[MetaOapg.properties.shapes, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union['Fruit', schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["mainShape"], typing_extensions.Literal["shapeOrNull"], typing_extensions.Literal["nullableShape"], typing_extensions.Literal["shapes"], str, ]): - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - mainShape: typing.Union['Shape', schemas.Unset] = schemas.unset, - shapeOrNull: typing.Union['ShapeOrNull', schemas.Unset] = schemas.unset, - nullableShape: typing.Union['NullableShape', schemas.Unset] = schemas.unset, - shapes: typing.Union[MetaOapg.properties.shapes, list, tuple, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: 'Fruit', - ) -> 'Drawing': - return super().__new__( - cls, - *_args, - mainShape=mainShape, - shapeOrNull=shapeOrNull, - nullableShape=nullableShape, - shapes=shapes, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.fruit import Fruit -from petstore_api.model.nullable_shape import NullableShape -from petstore_api.model.shape import Shape -from petstore_api.model.shape_or_null import ShapeOrNull diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/enum_arrays.py b/samples/openapi3/client/petstore/python/petstore_api/model/enum_arrays.py deleted file mode 100644 index 37e81347d54..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/enum_arrays.py +++ /dev/null @@ -1,150 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class EnumArrays( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - - - class just_symbol( - schemas.EnumBase, - schemas.StrSchema - ): - - - class MetaOapg: - enum_value_to_name = { - ">=": "GREATER_THAN_EQUALS", - "$": "DOLLAR", - } - - @schemas.classproperty - def GREATER_THAN_EQUALS(cls): - return cls(">=") - - @schemas.classproperty - def DOLLAR(cls): - return cls("$") - - - class array_enum( - schemas.ListSchema - ): - - - class MetaOapg: - - - class items( - schemas.EnumBase, - schemas.StrSchema - ): - - - class MetaOapg: - enum_value_to_name = { - "fish": "FISH", - "crab": "CRAB", - } - - @schemas.classproperty - def FISH(cls): - return cls("fish") - - @schemas.classproperty - def CRAB(cls): - return cls("crab") - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, str, ]], typing.List[typing.Union[MetaOapg.items, str, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'array_enum': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - __annotations__ = { - "just_symbol": just_symbol, - "array_enum": array_enum, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["just_symbol"]) -> MetaOapg.properties.just_symbol: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["array_enum"]) -> MetaOapg.properties.array_enum: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["just_symbol", "array_enum", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["just_symbol"]) -> typing.Union[MetaOapg.properties.just_symbol, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["array_enum"]) -> typing.Union[MetaOapg.properties.array_enum, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["just_symbol", "array_enum", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - just_symbol: typing.Union[MetaOapg.properties.just_symbol, str, schemas.Unset] = schemas.unset, - array_enum: typing.Union[MetaOapg.properties.array_enum, list, tuple, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'EnumArrays': - return super().__new__( - cls, - *_args, - just_symbol=just_symbol, - array_enum=array_enum, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/enum_arrays.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/enum_arrays.pyi deleted file mode 100644 index ec85821f0ef..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/enum_arrays.pyi +++ /dev/null @@ -1,136 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class EnumArrays( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - - - class just_symbol( - schemas.EnumBase, - schemas.StrSchema - ): - - @schemas.classproperty - def GREATER_THAN_EQUALS(cls): - return cls(">=") - - @schemas.classproperty - def DOLLAR(cls): - return cls("$") - - - class array_enum( - schemas.ListSchema - ): - - - class MetaOapg: - - - class items( - schemas.EnumBase, - schemas.StrSchema - ): - - @schemas.classproperty - def FISH(cls): - return cls("fish") - - @schemas.classproperty - def CRAB(cls): - return cls("crab") - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, str, ]], typing.List[typing.Union[MetaOapg.items, str, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'array_enum': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - __annotations__ = { - "just_symbol": just_symbol, - "array_enum": array_enum, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["just_symbol"]) -> MetaOapg.properties.just_symbol: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["array_enum"]) -> MetaOapg.properties.array_enum: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["just_symbol", "array_enum", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["just_symbol"]) -> typing.Union[MetaOapg.properties.just_symbol, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["array_enum"]) -> typing.Union[MetaOapg.properties.array_enum, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["just_symbol", "array_enum", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - just_symbol: typing.Union[MetaOapg.properties.just_symbol, str, schemas.Unset] = schemas.unset, - array_enum: typing.Union[MetaOapg.properties.array_enum, list, tuple, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'EnumArrays': - return super().__new__( - cls, - *_args, - just_symbol=just_symbol, - array_enum=array_enum, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/enum_class.py b/samples/openapi3/client/petstore/python/petstore_api/model/enum_class.py deleted file mode 100644 index 27018e19a6d..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/enum_class.py +++ /dev/null @@ -1,64 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class EnumClass( - schemas.EnumBase, - schemas.StrSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - enum_value_to_name = { - "_abc": "_ABC", - "-efg": "EFG", - "(xyz)": "XYZ", - "COUNT_1M": "COUNT_1M", - "COUNT_50M": "COUNT_50M", - } - - @schemas.classproperty - def _ABC(cls): - return cls("_abc") - - @schemas.classproperty - def EFG(cls): - return cls("-efg") - - @schemas.classproperty - def XYZ(cls): - return cls("(xyz)") - - @schemas.classproperty - def COUNT_1M(cls): - return cls("COUNT_1M") - - @schemas.classproperty - def COUNT_50M(cls): - return cls("COUNT_50M") diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/enum_class.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/enum_class.pyi deleted file mode 100644 index 7d43347fd84..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/enum_class.pyi +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class EnumClass( - schemas.EnumBase, - schemas.StrSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - @schemas.classproperty - def _ABC(cls): - return cls("_abc") - - @schemas.classproperty - def EFG(cls): - return cls("-efg") - - @schemas.classproperty - def XYZ(cls): - return cls("(xyz)") - - @schemas.classproperty - def COUNT_1M(cls): - return cls("COUNT_1M") - - @schemas.classproperty - def COUNT_50M(cls): - return cls("COUNT_50M") diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/enum_test.py b/samples/openapi3/client/petstore/python/petstore_api/model/enum_test.py deleted file mode 100644 index 26427171455..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/enum_test.py +++ /dev/null @@ -1,276 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class EnumTest( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "enum_string_required", - } - - class properties: - - - class enum_string_required( - schemas.EnumBase, - schemas.StrSchema - ): - - - class MetaOapg: - enum_value_to_name = { - "UPPER": "UPPER", - "lower": "LOWER", - "": "EMPTY", - } - - @schemas.classproperty - def UPPER(cls): - return cls("UPPER") - - @schemas.classproperty - def LOWER(cls): - return cls("lower") - - @schemas.classproperty - def EMPTY(cls): - return cls("") - - - class enum_string( - schemas.EnumBase, - schemas.StrSchema - ): - - - class MetaOapg: - enum_value_to_name = { - "UPPER": "UPPER", - "lower": "LOWER", - "": "EMPTY", - } - - @schemas.classproperty - def UPPER(cls): - return cls("UPPER") - - @schemas.classproperty - def LOWER(cls): - return cls("lower") - - @schemas.classproperty - def EMPTY(cls): - return cls("") - - - class enum_integer( - schemas.EnumBase, - schemas.Int32Schema - ): - - - class MetaOapg: - format = 'int32' - enum_value_to_name = { - 1: "POSITIVE_1", - -1: "NEGATIVE_1", - } - - @schemas.classproperty - def POSITIVE_1(cls): - return cls(1) - - @schemas.classproperty - def NEGATIVE_1(cls): - return cls(-1) - - - class enum_number( - schemas.EnumBase, - schemas.Float64Schema - ): - - - class MetaOapg: - format = 'double' - enum_value_to_name = { - 1.1: "POSITIVE_1_PT_1", - -1.2: "NEGATIVE_1_PT_2", - } - - @schemas.classproperty - def POSITIVE_1_PT_1(cls): - return cls(1.1) - - @schemas.classproperty - def NEGATIVE_1_PT_2(cls): - return cls(-1.2) - - @staticmethod - def stringEnum() -> typing.Type['StringEnum']: - return StringEnum - - @staticmethod - def IntegerEnum() -> typing.Type['IntegerEnum']: - return IntegerEnum - - @staticmethod - def StringEnumWithDefaultValue() -> typing.Type['StringEnumWithDefaultValue']: - return StringEnumWithDefaultValue - - @staticmethod - def IntegerEnumWithDefaultValue() -> typing.Type['IntegerEnumWithDefaultValue']: - return IntegerEnumWithDefaultValue - - @staticmethod - def IntegerEnumOneValue() -> typing.Type['IntegerEnumOneValue']: - return IntegerEnumOneValue - __annotations__ = { - "enum_string_required": enum_string_required, - "enum_string": enum_string, - "enum_integer": enum_integer, - "enum_number": enum_number, - "stringEnum": stringEnum, - "IntegerEnum": IntegerEnum, - "StringEnumWithDefaultValue": StringEnumWithDefaultValue, - "IntegerEnumWithDefaultValue": IntegerEnumWithDefaultValue, - "IntegerEnumOneValue": IntegerEnumOneValue, - } - - enum_string_required: MetaOapg.properties.enum_string_required - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["enum_string_required"]) -> MetaOapg.properties.enum_string_required: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["enum_string"]) -> MetaOapg.properties.enum_string: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["enum_integer"]) -> MetaOapg.properties.enum_integer: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["enum_number"]) -> MetaOapg.properties.enum_number: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["stringEnum"]) -> 'StringEnum': ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["IntegerEnum"]) -> 'IntegerEnum': ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["StringEnumWithDefaultValue"]) -> 'StringEnumWithDefaultValue': ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["IntegerEnumWithDefaultValue"]) -> 'IntegerEnumWithDefaultValue': ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["IntegerEnumOneValue"]) -> 'IntegerEnumOneValue': ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["enum_string_required", "enum_string", "enum_integer", "enum_number", "stringEnum", "IntegerEnum", "StringEnumWithDefaultValue", "IntegerEnumWithDefaultValue", "IntegerEnumOneValue", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["enum_string_required"]) -> MetaOapg.properties.enum_string_required: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["enum_string"]) -> typing.Union[MetaOapg.properties.enum_string, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["enum_integer"]) -> typing.Union[MetaOapg.properties.enum_integer, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["enum_number"]) -> typing.Union[MetaOapg.properties.enum_number, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["stringEnum"]) -> typing.Union['StringEnum', schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["IntegerEnum"]) -> typing.Union['IntegerEnum', schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["StringEnumWithDefaultValue"]) -> typing.Union['StringEnumWithDefaultValue', schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["IntegerEnumWithDefaultValue"]) -> typing.Union['IntegerEnumWithDefaultValue', schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["IntegerEnumOneValue"]) -> typing.Union['IntegerEnumOneValue', schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["enum_string_required", "enum_string", "enum_integer", "enum_number", "stringEnum", "IntegerEnum", "StringEnumWithDefaultValue", "IntegerEnumWithDefaultValue", "IntegerEnumOneValue", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - enum_string_required: typing.Union[MetaOapg.properties.enum_string_required, str, ], - enum_string: typing.Union[MetaOapg.properties.enum_string, str, schemas.Unset] = schemas.unset, - enum_integer: typing.Union[MetaOapg.properties.enum_integer, decimal.Decimal, int, schemas.Unset] = schemas.unset, - enum_number: typing.Union[MetaOapg.properties.enum_number, decimal.Decimal, int, float, schemas.Unset] = schemas.unset, - stringEnum: typing.Union['StringEnum', schemas.Unset] = schemas.unset, - IntegerEnum: typing.Union['IntegerEnum', schemas.Unset] = schemas.unset, - StringEnumWithDefaultValue: typing.Union['StringEnumWithDefaultValue', schemas.Unset] = schemas.unset, - IntegerEnumWithDefaultValue: typing.Union['IntegerEnumWithDefaultValue', schemas.Unset] = schemas.unset, - IntegerEnumOneValue: typing.Union['IntegerEnumOneValue', schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'EnumTest': - return super().__new__( - cls, - *_args, - enum_string_required=enum_string_required, - enum_string=enum_string, - enum_integer=enum_integer, - enum_number=enum_number, - stringEnum=stringEnum, - IntegerEnum=IntegerEnum, - StringEnumWithDefaultValue=StringEnumWithDefaultValue, - IntegerEnumWithDefaultValue=IntegerEnumWithDefaultValue, - IntegerEnumOneValue=IntegerEnumOneValue, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.integer_enum import IntegerEnum -from petstore_api.model.integer_enum_one_value import IntegerEnumOneValue -from petstore_api.model.integer_enum_with_default_value import IntegerEnumWithDefaultValue -from petstore_api.model.string_enum import StringEnum -from petstore_api.model.string_enum_with_default_value import StringEnumWithDefaultValue diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/enum_test.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/enum_test.pyi deleted file mode 100644 index 7cfb414bb05..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/enum_test.pyi +++ /dev/null @@ -1,244 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class EnumTest( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "enum_string_required", - } - - class properties: - - - class enum_string_required( - schemas.EnumBase, - schemas.StrSchema - ): - - @schemas.classproperty - def UPPER(cls): - return cls("UPPER") - - @schemas.classproperty - def LOWER(cls): - return cls("lower") - - @schemas.classproperty - def EMPTY(cls): - return cls("") - - - class enum_string( - schemas.EnumBase, - schemas.StrSchema - ): - - @schemas.classproperty - def UPPER(cls): - return cls("UPPER") - - @schemas.classproperty - def LOWER(cls): - return cls("lower") - - @schemas.classproperty - def EMPTY(cls): - return cls("") - - - class enum_integer( - schemas.EnumBase, - schemas.Int32Schema - ): - - @schemas.classproperty - def POSITIVE_1(cls): - return cls(1) - - @schemas.classproperty - def NEGATIVE_1(cls): - return cls(-1) - - - class enum_number( - schemas.EnumBase, - schemas.Float64Schema - ): - - @schemas.classproperty - def POSITIVE_1_PT_1(cls): - return cls(1.1) - - @schemas.classproperty - def NEGATIVE_1_PT_2(cls): - return cls(-1.2) - - @staticmethod - def stringEnum() -> typing.Type['StringEnum']: - return StringEnum - - @staticmethod - def IntegerEnum() -> typing.Type['IntegerEnum']: - return IntegerEnum - - @staticmethod - def StringEnumWithDefaultValue() -> typing.Type['StringEnumWithDefaultValue']: - return StringEnumWithDefaultValue - - @staticmethod - def IntegerEnumWithDefaultValue() -> typing.Type['IntegerEnumWithDefaultValue']: - return IntegerEnumWithDefaultValue - - @staticmethod - def IntegerEnumOneValue() -> typing.Type['IntegerEnumOneValue']: - return IntegerEnumOneValue - __annotations__ = { - "enum_string_required": enum_string_required, - "enum_string": enum_string, - "enum_integer": enum_integer, - "enum_number": enum_number, - "stringEnum": stringEnum, - "IntegerEnum": IntegerEnum, - "StringEnumWithDefaultValue": StringEnumWithDefaultValue, - "IntegerEnumWithDefaultValue": IntegerEnumWithDefaultValue, - "IntegerEnumOneValue": IntegerEnumOneValue, - } - - enum_string_required: MetaOapg.properties.enum_string_required - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["enum_string_required"]) -> MetaOapg.properties.enum_string_required: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["enum_string"]) -> MetaOapg.properties.enum_string: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["enum_integer"]) -> MetaOapg.properties.enum_integer: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["enum_number"]) -> MetaOapg.properties.enum_number: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["stringEnum"]) -> 'StringEnum': ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["IntegerEnum"]) -> 'IntegerEnum': ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["StringEnumWithDefaultValue"]) -> 'StringEnumWithDefaultValue': ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["IntegerEnumWithDefaultValue"]) -> 'IntegerEnumWithDefaultValue': ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["IntegerEnumOneValue"]) -> 'IntegerEnumOneValue': ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["enum_string_required", "enum_string", "enum_integer", "enum_number", "stringEnum", "IntegerEnum", "StringEnumWithDefaultValue", "IntegerEnumWithDefaultValue", "IntegerEnumOneValue", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["enum_string_required"]) -> MetaOapg.properties.enum_string_required: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["enum_string"]) -> typing.Union[MetaOapg.properties.enum_string, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["enum_integer"]) -> typing.Union[MetaOapg.properties.enum_integer, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["enum_number"]) -> typing.Union[MetaOapg.properties.enum_number, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["stringEnum"]) -> typing.Union['StringEnum', schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["IntegerEnum"]) -> typing.Union['IntegerEnum', schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["StringEnumWithDefaultValue"]) -> typing.Union['StringEnumWithDefaultValue', schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["IntegerEnumWithDefaultValue"]) -> typing.Union['IntegerEnumWithDefaultValue', schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["IntegerEnumOneValue"]) -> typing.Union['IntegerEnumOneValue', schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["enum_string_required", "enum_string", "enum_integer", "enum_number", "stringEnum", "IntegerEnum", "StringEnumWithDefaultValue", "IntegerEnumWithDefaultValue", "IntegerEnumOneValue", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - enum_string_required: typing.Union[MetaOapg.properties.enum_string_required, str, ], - enum_string: typing.Union[MetaOapg.properties.enum_string, str, schemas.Unset] = schemas.unset, - enum_integer: typing.Union[MetaOapg.properties.enum_integer, decimal.Decimal, int, schemas.Unset] = schemas.unset, - enum_number: typing.Union[MetaOapg.properties.enum_number, decimal.Decimal, int, float, schemas.Unset] = schemas.unset, - stringEnum: typing.Union['StringEnum', schemas.Unset] = schemas.unset, - IntegerEnum: typing.Union['IntegerEnum', schemas.Unset] = schemas.unset, - StringEnumWithDefaultValue: typing.Union['StringEnumWithDefaultValue', schemas.Unset] = schemas.unset, - IntegerEnumWithDefaultValue: typing.Union['IntegerEnumWithDefaultValue', schemas.Unset] = schemas.unset, - IntegerEnumOneValue: typing.Union['IntegerEnumOneValue', schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'EnumTest': - return super().__new__( - cls, - *_args, - enum_string_required=enum_string_required, - enum_string=enum_string, - enum_integer=enum_integer, - enum_number=enum_number, - stringEnum=stringEnum, - IntegerEnum=IntegerEnum, - StringEnumWithDefaultValue=StringEnumWithDefaultValue, - IntegerEnumWithDefaultValue=IntegerEnumWithDefaultValue, - IntegerEnumOneValue=IntegerEnumOneValue, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.integer_enum import IntegerEnum -from petstore_api.model.integer_enum_one_value import IntegerEnumOneValue -from petstore_api.model.integer_enum_with_default_value import IntegerEnumWithDefaultValue -from petstore_api.model.string_enum import StringEnum -from petstore_api.model.string_enum_with_default_value import StringEnumWithDefaultValue diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/equilateral_triangle.py b/samples/openapi3/client/petstore/python/petstore_api/model/equilateral_triangle.py deleted file mode 100644 index 1d2acc4177d..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/equilateral_triangle.py +++ /dev/null @@ -1,132 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class EquilateralTriangle( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - class all_of_1( - schemas.DictSchema - ): - - - class MetaOapg: - - class properties: - - - class triangleType( - schemas.EnumBase, - schemas.StrSchema - ): - - - class MetaOapg: - enum_value_to_name = { - "EquilateralTriangle": "EQUILATERAL_TRIANGLE", - } - - @schemas.classproperty - def EQUILATERAL_TRIANGLE(cls): - return cls("EquilateralTriangle") - __annotations__ = { - "triangleType": triangleType, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["triangleType"]) -> MetaOapg.properties.triangleType: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["triangleType", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["triangleType"]) -> typing.Union[MetaOapg.properties.triangleType, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["triangleType", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - triangleType: typing.Union[MetaOapg.properties.triangleType, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'all_of_1': - return super().__new__( - cls, - *_args, - triangleType=triangleType, - _configuration=_configuration, - **kwargs, - ) - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - TriangleInterface, - cls.all_of_1, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'EquilateralTriangle': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.triangle_interface import TriangleInterface diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/equilateral_triangle.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/equilateral_triangle.pyi deleted file mode 100644 index 120edbf1a27..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/equilateral_triangle.pyi +++ /dev/null @@ -1,126 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class EquilateralTriangle( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - class all_of_1( - schemas.DictSchema - ): - - - class MetaOapg: - - class properties: - - - class triangleType( - schemas.EnumBase, - schemas.StrSchema - ): - - @schemas.classproperty - def EQUILATERAL_TRIANGLE(cls): - return cls("EquilateralTriangle") - __annotations__ = { - "triangleType": triangleType, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["triangleType"]) -> MetaOapg.properties.triangleType: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["triangleType", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["triangleType"]) -> typing.Union[MetaOapg.properties.triangleType, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["triangleType", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - triangleType: typing.Union[MetaOapg.properties.triangleType, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'all_of_1': - return super().__new__( - cls, - *_args, - triangleType=triangleType, - _configuration=_configuration, - **kwargs, - ) - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - TriangleInterface, - cls.all_of_1, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'EquilateralTriangle': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.triangle_interface import TriangleInterface diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/file.py b/samples/openapi3/client/petstore/python/petstore_api/model/file.py deleted file mode 100644 index 9a159ffe89e..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/file.py +++ /dev/null @@ -1,80 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class File( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Must be named `File` for test. - """ - - - class MetaOapg: - - class properties: - sourceURI = schemas.StrSchema - __annotations__ = { - "sourceURI": sourceURI, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["sourceURI"]) -> MetaOapg.properties.sourceURI: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["sourceURI", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["sourceURI"]) -> typing.Union[MetaOapg.properties.sourceURI, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["sourceURI", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - sourceURI: typing.Union[MetaOapg.properties.sourceURI, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'File': - return super().__new__( - cls, - *_args, - sourceURI=sourceURI, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/file.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/file.pyi deleted file mode 100644 index 9a159ffe89e..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/file.pyi +++ /dev/null @@ -1,80 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class File( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Must be named `File` for test. - """ - - - class MetaOapg: - - class properties: - sourceURI = schemas.StrSchema - __annotations__ = { - "sourceURI": sourceURI, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["sourceURI"]) -> MetaOapg.properties.sourceURI: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["sourceURI", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["sourceURI"]) -> typing.Union[MetaOapg.properties.sourceURI, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["sourceURI", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - sourceURI: typing.Union[MetaOapg.properties.sourceURI, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'File': - return super().__new__( - cls, - *_args, - sourceURI=sourceURI, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/file_schema_test_class.py b/samples/openapi3/client/petstore/python/petstore_api/model/file_schema_test_class.py deleted file mode 100644 index 1a0851a5c4d..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/file_schema_test_class.py +++ /dev/null @@ -1,118 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class FileSchemaTestClass( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - - @staticmethod - def file() -> typing.Type['File']: - return File - - - class files( - schemas.ListSchema - ): - - - class MetaOapg: - - @staticmethod - def items() -> typing.Type['File']: - return File - - def __new__( - cls, - _arg: typing.Union[typing.Tuple['File'], typing.List['File']], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'files': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> 'File': - return super().__getitem__(i) - __annotations__ = { - "file": file, - "files": files, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["file"]) -> 'File': ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["files"]) -> MetaOapg.properties.files: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["file", "files", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["file"]) -> typing.Union['File', schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["files"]) -> typing.Union[MetaOapg.properties.files, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["file", "files", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - file: typing.Union['File', schemas.Unset] = schemas.unset, - files: typing.Union[MetaOapg.properties.files, list, tuple, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'FileSchemaTestClass': - return super().__new__( - cls, - *_args, - file=file, - files=files, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.file import File diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/file_schema_test_class.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/file_schema_test_class.pyi deleted file mode 100644 index 1a0851a5c4d..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/file_schema_test_class.pyi +++ /dev/null @@ -1,118 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class FileSchemaTestClass( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - - @staticmethod - def file() -> typing.Type['File']: - return File - - - class files( - schemas.ListSchema - ): - - - class MetaOapg: - - @staticmethod - def items() -> typing.Type['File']: - return File - - def __new__( - cls, - _arg: typing.Union[typing.Tuple['File'], typing.List['File']], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'files': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> 'File': - return super().__getitem__(i) - __annotations__ = { - "file": file, - "files": files, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["file"]) -> 'File': ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["files"]) -> MetaOapg.properties.files: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["file", "files", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["file"]) -> typing.Union['File', schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["files"]) -> typing.Union[MetaOapg.properties.files, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["file", "files", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - file: typing.Union['File', schemas.Unset] = schemas.unset, - files: typing.Union[MetaOapg.properties.files, list, tuple, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'FileSchemaTestClass': - return super().__new__( - cls, - *_args, - file=file, - files=files, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.file import File diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/foo.py b/samples/openapi3/client/petstore/python/petstore_api/model/foo.py deleted file mode 100644 index e77d76a1657..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/foo.py +++ /dev/null @@ -1,78 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Foo( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - bar = schemas.StrSchema - __annotations__ = { - "bar": bar, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["bar"]) -> MetaOapg.properties.bar: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["bar", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["bar"]) -> typing.Union[MetaOapg.properties.bar, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["bar", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - bar: typing.Union[MetaOapg.properties.bar, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Foo': - return super().__new__( - cls, - *_args, - bar=bar, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/foo.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/foo.pyi deleted file mode 100644 index e77d76a1657..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/foo.pyi +++ /dev/null @@ -1,78 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Foo( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - bar = schemas.StrSchema - __annotations__ = { - "bar": bar, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["bar"]) -> MetaOapg.properties.bar: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["bar", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["bar"]) -> typing.Union[MetaOapg.properties.bar, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["bar", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - bar: typing.Union[MetaOapg.properties.bar, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Foo': - return super().__new__( - cls, - *_args, - bar=bar, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/format_test.py b/samples/openapi3/client/petstore/python/petstore_api/model/format_test.py deleted file mode 100644 index a734b96135d..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/format_test.py +++ /dev/null @@ -1,406 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class FormatTest( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "date", - "number", - "password", - "byte", - } - - class properties: - - - class number( - schemas.NumberSchema - ): - - - class MetaOapg: - inclusive_maximum = 543.2 - inclusive_minimum = 32.1 - multiple_of = 32.5 - byte = schemas.StrSchema - date = schemas.DateSchema - - - class password( - schemas.StrSchema - ): - - - class MetaOapg: - format = 'password' - max_length = 64 - min_length = 10 - - - class integer( - schemas.IntSchema - ): - - - class MetaOapg: - inclusive_maximum = 100 - inclusive_minimum = 10 - multiple_of = 2 - int32 = schemas.Int32Schema - - - class int32withValidations( - schemas.Int32Schema - ): - - - class MetaOapg: - format = 'int32' - inclusive_maximum = 200 - inclusive_minimum = 20 - int64 = schemas.Int64Schema - - - class _float( - schemas.Float32Schema - ): - - - class MetaOapg: - format = 'float' - inclusive_maximum = 987.6 - inclusive_minimum = 54.3 - float32 = schemas.Float32Schema - - - class double( - schemas.Float64Schema - ): - - - class MetaOapg: - format = 'double' - inclusive_maximum = 123.4 - inclusive_minimum = 67.8 - float64 = schemas.Float64Schema - - - class arrayWithUniqueItems( - schemas.ListSchema - ): - - - class MetaOapg: - unique_items = True - items = schemas.NumberSchema - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, decimal.Decimal, int, float, ]], typing.List[typing.Union[MetaOapg.items, decimal.Decimal, int, float, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'arrayWithUniqueItems': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - - - class string( - schemas.StrSchema - ): - - - class MetaOapg: - regex=[{ - 'pattern': r'[a-z]', # noqa: E501 - 'flags': ( - re.IGNORECASE - ) - }] - binary = schemas.BinarySchema - dateTime = schemas.DateTimeSchema - uuid = schemas.UUIDSchema - uuidNoExample = schemas.UUIDSchema - - - class pattern_with_digits( - schemas.StrSchema - ): - - - class MetaOapg: - regex=[{ - 'pattern': r'^\d{10}$', # noqa: E501 - }] - - - class pattern_with_digits_and_delimiter( - schemas.StrSchema - ): - - - class MetaOapg: - regex=[{ - 'pattern': r'^image_\d{1,3}$', # noqa: E501 - 'flags': ( - re.IGNORECASE - ) - }] - noneProp = schemas.NoneSchema - __annotations__ = { - "number": number, - "byte": byte, - "date": date, - "password": password, - "integer": integer, - "int32": int32, - "int32withValidations": int32withValidations, - "int64": int64, - "float": _float, - "float32": float32, - "double": double, - "float64": float64, - "arrayWithUniqueItems": arrayWithUniqueItems, - "string": string, - "binary": binary, - "dateTime": dateTime, - "uuid": uuid, - "uuidNoExample": uuidNoExample, - "pattern_with_digits": pattern_with_digits, - "pattern_with_digits_and_delimiter": pattern_with_digits_and_delimiter, - "noneProp": noneProp, - } - - date: MetaOapg.properties.date - number: MetaOapg.properties.number - password: MetaOapg.properties.password - byte: MetaOapg.properties.byte - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["number"]) -> MetaOapg.properties.number: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["byte"]) -> MetaOapg.properties.byte: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["date"]) -> MetaOapg.properties.date: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["password"]) -> MetaOapg.properties.password: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["integer"]) -> MetaOapg.properties.integer: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["int32"]) -> MetaOapg.properties.int32: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["int32withValidations"]) -> MetaOapg.properties.int32withValidations: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["int64"]) -> MetaOapg.properties.int64: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["float"]) -> MetaOapg.properties._float: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["float32"]) -> MetaOapg.properties.float32: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["double"]) -> MetaOapg.properties.double: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["float64"]) -> MetaOapg.properties.float64: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["arrayWithUniqueItems"]) -> MetaOapg.properties.arrayWithUniqueItems: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["string"]) -> MetaOapg.properties.string: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["binary"]) -> MetaOapg.properties.binary: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["dateTime"]) -> MetaOapg.properties.dateTime: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["uuid"]) -> MetaOapg.properties.uuid: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["uuidNoExample"]) -> MetaOapg.properties.uuidNoExample: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["pattern_with_digits"]) -> MetaOapg.properties.pattern_with_digits: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["pattern_with_digits_and_delimiter"]) -> MetaOapg.properties.pattern_with_digits_and_delimiter: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["noneProp"]) -> MetaOapg.properties.noneProp: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["number", "byte", "date", "password", "integer", "int32", "int32withValidations", "int64", "float", "float32", "double", "float64", "arrayWithUniqueItems", "string", "binary", "dateTime", "uuid", "uuidNoExample", "pattern_with_digits", "pattern_with_digits_and_delimiter", "noneProp", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["number"]) -> MetaOapg.properties.number: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["byte"]) -> MetaOapg.properties.byte: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["date"]) -> MetaOapg.properties.date: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["password"]) -> MetaOapg.properties.password: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["integer"]) -> typing.Union[MetaOapg.properties.integer, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["int32"]) -> typing.Union[MetaOapg.properties.int32, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["int32withValidations"]) -> typing.Union[MetaOapg.properties.int32withValidations, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["int64"]) -> typing.Union[MetaOapg.properties.int64, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["float"]) -> typing.Union[MetaOapg.properties._float, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["float32"]) -> typing.Union[MetaOapg.properties.float32, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["double"]) -> typing.Union[MetaOapg.properties.double, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["float64"]) -> typing.Union[MetaOapg.properties.float64, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["arrayWithUniqueItems"]) -> typing.Union[MetaOapg.properties.arrayWithUniqueItems, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["string"]) -> typing.Union[MetaOapg.properties.string, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["binary"]) -> typing.Union[MetaOapg.properties.binary, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["dateTime"]) -> typing.Union[MetaOapg.properties.dateTime, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["uuid"]) -> typing.Union[MetaOapg.properties.uuid, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["uuidNoExample"]) -> typing.Union[MetaOapg.properties.uuidNoExample, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["pattern_with_digits"]) -> typing.Union[MetaOapg.properties.pattern_with_digits, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["pattern_with_digits_and_delimiter"]) -> typing.Union[MetaOapg.properties.pattern_with_digits_and_delimiter, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["noneProp"]) -> typing.Union[MetaOapg.properties.noneProp, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["number", "byte", "date", "password", "integer", "int32", "int32withValidations", "int64", "float", "float32", "double", "float64", "arrayWithUniqueItems", "string", "binary", "dateTime", "uuid", "uuidNoExample", "pattern_with_digits", "pattern_with_digits_and_delimiter", "noneProp", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - date: typing.Union[MetaOapg.properties.date, str, date, ], - number: typing.Union[MetaOapg.properties.number, decimal.Decimal, int, float, ], - password: typing.Union[MetaOapg.properties.password, str, ], - byte: typing.Union[MetaOapg.properties.byte, str, ], - integer: typing.Union[MetaOapg.properties.integer, decimal.Decimal, int, schemas.Unset] = schemas.unset, - int32: typing.Union[MetaOapg.properties.int32, decimal.Decimal, int, schemas.Unset] = schemas.unset, - int32withValidations: typing.Union[MetaOapg.properties.int32withValidations, decimal.Decimal, int, schemas.Unset] = schemas.unset, - int64: typing.Union[MetaOapg.properties.int64, decimal.Decimal, int, schemas.Unset] = schemas.unset, - float32: typing.Union[MetaOapg.properties.float32, decimal.Decimal, int, float, schemas.Unset] = schemas.unset, - double: typing.Union[MetaOapg.properties.double, decimal.Decimal, int, float, schemas.Unset] = schemas.unset, - float64: typing.Union[MetaOapg.properties.float64, decimal.Decimal, int, float, schemas.Unset] = schemas.unset, - arrayWithUniqueItems: typing.Union[MetaOapg.properties.arrayWithUniqueItems, list, tuple, schemas.Unset] = schemas.unset, - string: typing.Union[MetaOapg.properties.string, str, schemas.Unset] = schemas.unset, - binary: typing.Union[MetaOapg.properties.binary, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - dateTime: typing.Union[MetaOapg.properties.dateTime, str, datetime, schemas.Unset] = schemas.unset, - uuid: typing.Union[MetaOapg.properties.uuid, str, uuid.UUID, schemas.Unset] = schemas.unset, - uuidNoExample: typing.Union[MetaOapg.properties.uuidNoExample, str, uuid.UUID, schemas.Unset] = schemas.unset, - pattern_with_digits: typing.Union[MetaOapg.properties.pattern_with_digits, str, schemas.Unset] = schemas.unset, - pattern_with_digits_and_delimiter: typing.Union[MetaOapg.properties.pattern_with_digits_and_delimiter, str, schemas.Unset] = schemas.unset, - noneProp: typing.Union[MetaOapg.properties.noneProp, None, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'FormatTest': - return super().__new__( - cls, - *_args, - date=date, - number=number, - password=password, - byte=byte, - integer=integer, - int32=int32, - int32withValidations=int32withValidations, - int64=int64, - float32=float32, - double=double, - float64=float64, - arrayWithUniqueItems=arrayWithUniqueItems, - string=string, - binary=binary, - dateTime=dateTime, - uuid=uuid, - uuidNoExample=uuidNoExample, - pattern_with_digits=pattern_with_digits, - pattern_with_digits_and_delimiter=pattern_with_digits_and_delimiter, - noneProp=noneProp, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/format_test.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/format_test.pyi deleted file mode 100644 index 54eb193a6d6..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/format_test.pyi +++ /dev/null @@ -1,354 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class FormatTest( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "date", - "number", - "password", - "byte", - } - - class properties: - - - class number( - schemas.NumberSchema - ): - pass - byte = schemas.StrSchema - date = schemas.DateSchema - - - class password( - schemas.StrSchema - ): - pass - - - class integer( - schemas.IntSchema - ): - pass - int32 = schemas.Int32Schema - - - class int32withValidations( - schemas.Int32Schema - ): - pass - int64 = schemas.Int64Schema - - - class _float( - schemas.Float32Schema - ): - pass - float32 = schemas.Float32Schema - - - class double( - schemas.Float64Schema - ): - pass - float64 = schemas.Float64Schema - - - class arrayWithUniqueItems( - schemas.ListSchema - ): - - - class MetaOapg: - items = schemas.NumberSchema - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, decimal.Decimal, int, float, ]], typing.List[typing.Union[MetaOapg.items, decimal.Decimal, int, float, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'arrayWithUniqueItems': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - - - class string( - schemas.StrSchema - ): - pass - binary = schemas.BinarySchema - dateTime = schemas.DateTimeSchema - uuid = schemas.UUIDSchema - uuidNoExample = schemas.UUIDSchema - - - class pattern_with_digits( - schemas.StrSchema - ): - pass - - - class pattern_with_digits_and_delimiter( - schemas.StrSchema - ): - pass - noneProp = schemas.NoneSchema - __annotations__ = { - "number": number, - "byte": byte, - "date": date, - "password": password, - "integer": integer, - "int32": int32, - "int32withValidations": int32withValidations, - "int64": int64, - "float": _float, - "float32": float32, - "double": double, - "float64": float64, - "arrayWithUniqueItems": arrayWithUniqueItems, - "string": string, - "binary": binary, - "dateTime": dateTime, - "uuid": uuid, - "uuidNoExample": uuidNoExample, - "pattern_with_digits": pattern_with_digits, - "pattern_with_digits_and_delimiter": pattern_with_digits_and_delimiter, - "noneProp": noneProp, - } - - date: MetaOapg.properties.date - number: MetaOapg.properties.number - password: MetaOapg.properties.password - byte: MetaOapg.properties.byte - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["number"]) -> MetaOapg.properties.number: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["byte"]) -> MetaOapg.properties.byte: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["date"]) -> MetaOapg.properties.date: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["password"]) -> MetaOapg.properties.password: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["integer"]) -> MetaOapg.properties.integer: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["int32"]) -> MetaOapg.properties.int32: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["int32withValidations"]) -> MetaOapg.properties.int32withValidations: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["int64"]) -> MetaOapg.properties.int64: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["float"]) -> MetaOapg.properties._float: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["float32"]) -> MetaOapg.properties.float32: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["double"]) -> MetaOapg.properties.double: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["float64"]) -> MetaOapg.properties.float64: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["arrayWithUniqueItems"]) -> MetaOapg.properties.arrayWithUniqueItems: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["string"]) -> MetaOapg.properties.string: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["binary"]) -> MetaOapg.properties.binary: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["dateTime"]) -> MetaOapg.properties.dateTime: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["uuid"]) -> MetaOapg.properties.uuid: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["uuidNoExample"]) -> MetaOapg.properties.uuidNoExample: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["pattern_with_digits"]) -> MetaOapg.properties.pattern_with_digits: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["pattern_with_digits_and_delimiter"]) -> MetaOapg.properties.pattern_with_digits_and_delimiter: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["noneProp"]) -> MetaOapg.properties.noneProp: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["number", "byte", "date", "password", "integer", "int32", "int32withValidations", "int64", "float", "float32", "double", "float64", "arrayWithUniqueItems", "string", "binary", "dateTime", "uuid", "uuidNoExample", "pattern_with_digits", "pattern_with_digits_and_delimiter", "noneProp", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["number"]) -> MetaOapg.properties.number: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["byte"]) -> MetaOapg.properties.byte: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["date"]) -> MetaOapg.properties.date: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["password"]) -> MetaOapg.properties.password: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["integer"]) -> typing.Union[MetaOapg.properties.integer, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["int32"]) -> typing.Union[MetaOapg.properties.int32, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["int32withValidations"]) -> typing.Union[MetaOapg.properties.int32withValidations, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["int64"]) -> typing.Union[MetaOapg.properties.int64, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["float"]) -> typing.Union[MetaOapg.properties._float, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["float32"]) -> typing.Union[MetaOapg.properties.float32, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["double"]) -> typing.Union[MetaOapg.properties.double, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["float64"]) -> typing.Union[MetaOapg.properties.float64, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["arrayWithUniqueItems"]) -> typing.Union[MetaOapg.properties.arrayWithUniqueItems, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["string"]) -> typing.Union[MetaOapg.properties.string, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["binary"]) -> typing.Union[MetaOapg.properties.binary, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["dateTime"]) -> typing.Union[MetaOapg.properties.dateTime, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["uuid"]) -> typing.Union[MetaOapg.properties.uuid, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["uuidNoExample"]) -> typing.Union[MetaOapg.properties.uuidNoExample, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["pattern_with_digits"]) -> typing.Union[MetaOapg.properties.pattern_with_digits, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["pattern_with_digits_and_delimiter"]) -> typing.Union[MetaOapg.properties.pattern_with_digits_and_delimiter, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["noneProp"]) -> typing.Union[MetaOapg.properties.noneProp, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["number", "byte", "date", "password", "integer", "int32", "int32withValidations", "int64", "float", "float32", "double", "float64", "arrayWithUniqueItems", "string", "binary", "dateTime", "uuid", "uuidNoExample", "pattern_with_digits", "pattern_with_digits_and_delimiter", "noneProp", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - date: typing.Union[MetaOapg.properties.date, str, date, ], - number: typing.Union[MetaOapg.properties.number, decimal.Decimal, int, float, ], - password: typing.Union[MetaOapg.properties.password, str, ], - byte: typing.Union[MetaOapg.properties.byte, str, ], - integer: typing.Union[MetaOapg.properties.integer, decimal.Decimal, int, schemas.Unset] = schemas.unset, - int32: typing.Union[MetaOapg.properties.int32, decimal.Decimal, int, schemas.Unset] = schemas.unset, - int32withValidations: typing.Union[MetaOapg.properties.int32withValidations, decimal.Decimal, int, schemas.Unset] = schemas.unset, - int64: typing.Union[MetaOapg.properties.int64, decimal.Decimal, int, schemas.Unset] = schemas.unset, - float32: typing.Union[MetaOapg.properties.float32, decimal.Decimal, int, float, schemas.Unset] = schemas.unset, - double: typing.Union[MetaOapg.properties.double, decimal.Decimal, int, float, schemas.Unset] = schemas.unset, - float64: typing.Union[MetaOapg.properties.float64, decimal.Decimal, int, float, schemas.Unset] = schemas.unset, - arrayWithUniqueItems: typing.Union[MetaOapg.properties.arrayWithUniqueItems, list, tuple, schemas.Unset] = schemas.unset, - string: typing.Union[MetaOapg.properties.string, str, schemas.Unset] = schemas.unset, - binary: typing.Union[MetaOapg.properties.binary, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - dateTime: typing.Union[MetaOapg.properties.dateTime, str, datetime, schemas.Unset] = schemas.unset, - uuid: typing.Union[MetaOapg.properties.uuid, str, uuid.UUID, schemas.Unset] = schemas.unset, - uuidNoExample: typing.Union[MetaOapg.properties.uuidNoExample, str, uuid.UUID, schemas.Unset] = schemas.unset, - pattern_with_digits: typing.Union[MetaOapg.properties.pattern_with_digits, str, schemas.Unset] = schemas.unset, - pattern_with_digits_and_delimiter: typing.Union[MetaOapg.properties.pattern_with_digits_and_delimiter, str, schemas.Unset] = schemas.unset, - noneProp: typing.Union[MetaOapg.properties.noneProp, None, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'FormatTest': - return super().__new__( - cls, - *_args, - date=date, - number=number, - password=password, - byte=byte, - integer=integer, - int32=int32, - int32withValidations=int32withValidations, - int64=int64, - float32=float32, - double=double, - float64=float64, - arrayWithUniqueItems=arrayWithUniqueItems, - string=string, - binary=binary, - dateTime=dateTime, - uuid=uuid, - uuidNoExample=uuidNoExample, - pattern_with_digits=pattern_with_digits, - pattern_with_digits_and_delimiter=pattern_with_digits_and_delimiter, - noneProp=noneProp, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/from_schema.py b/samples/openapi3/client/petstore/python/petstore_api/model/from_schema.py deleted file mode 100644 index 637d16a5eab..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/from_schema.py +++ /dev/null @@ -1,88 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class FromSchema( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - data = schemas.StrSchema - id = schemas.IntSchema - __annotations__ = { - "data": data, - "id": id, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["data"]) -> MetaOapg.properties.data: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["id"]) -> MetaOapg.properties.id: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["data", "id", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["data"]) -> typing.Union[MetaOapg.properties.data, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["id"]) -> typing.Union[MetaOapg.properties.id, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["data", "id", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - data: typing.Union[MetaOapg.properties.data, str, schemas.Unset] = schemas.unset, - id: typing.Union[MetaOapg.properties.id, decimal.Decimal, int, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'FromSchema': - return super().__new__( - cls, - *_args, - data=data, - id=id, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/from_schema.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/from_schema.pyi deleted file mode 100644 index 637d16a5eab..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/from_schema.pyi +++ /dev/null @@ -1,88 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class FromSchema( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - data = schemas.StrSchema - id = schemas.IntSchema - __annotations__ = { - "data": data, - "id": id, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["data"]) -> MetaOapg.properties.data: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["id"]) -> MetaOapg.properties.id: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["data", "id", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["data"]) -> typing.Union[MetaOapg.properties.data, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["id"]) -> typing.Union[MetaOapg.properties.id, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["data", "id", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - data: typing.Union[MetaOapg.properties.data, str, schemas.Unset] = schemas.unset, - id: typing.Union[MetaOapg.properties.id, decimal.Decimal, int, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'FromSchema': - return super().__new__( - cls, - *_args, - data=data, - id=id, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/fruit.py b/samples/openapi3/client/petstore/python/petstore_api/model/fruit.py deleted file mode 100644 index 892ccdbf6e5..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/fruit.py +++ /dev/null @@ -1,97 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Fruit( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - color = schemas.StrSchema - __annotations__ = { - "color": color, - } - - @classmethod - @functools.lru_cache() - def one_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - Apple, - Banana, - ] - - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["color"]) -> MetaOapg.properties.color: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["color", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["color"]) -> typing.Union[MetaOapg.properties.color, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["color", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - color: typing.Union[MetaOapg.properties.color, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Fruit': - return super().__new__( - cls, - *_args, - color=color, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.apple import Apple -from petstore_api.model.banana import Banana diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/fruit.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/fruit.pyi deleted file mode 100644 index 892ccdbf6e5..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/fruit.pyi +++ /dev/null @@ -1,97 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Fruit( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - color = schemas.StrSchema - __annotations__ = { - "color": color, - } - - @classmethod - @functools.lru_cache() - def one_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - Apple, - Banana, - ] - - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["color"]) -> MetaOapg.properties.color: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["color", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["color"]) -> typing.Union[MetaOapg.properties.color, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["color", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - color: typing.Union[MetaOapg.properties.color, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Fruit': - return super().__new__( - cls, - *_args, - color=color, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.apple import Apple -from petstore_api.model.banana import Banana diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/fruit_req.py b/samples/openapi3/client/petstore/python/petstore_api/model/fruit_req.py deleted file mode 100644 index d95300a1cef..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/fruit_req.py +++ /dev/null @@ -1,70 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class FruitReq( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - one_of_0 = schemas.NoneSchema - - @classmethod - @functools.lru_cache() - def one_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.one_of_0, - AppleReq, - BananaReq, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'FruitReq': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.apple_req import AppleReq -from petstore_api.model.banana_req import BananaReq diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/fruit_req.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/fruit_req.pyi deleted file mode 100644 index d95300a1cef..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/fruit_req.pyi +++ /dev/null @@ -1,70 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class FruitReq( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - one_of_0 = schemas.NoneSchema - - @classmethod - @functools.lru_cache() - def one_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.one_of_0, - AppleReq, - BananaReq, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'FruitReq': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.apple_req import AppleReq -from petstore_api.model.banana_req import BananaReq diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/gm_fruit.py b/samples/openapi3/client/petstore/python/petstore_api/model/gm_fruit.py deleted file mode 100644 index 07ebabbc3ff..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/gm_fruit.py +++ /dev/null @@ -1,97 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class GmFruit( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - color = schemas.StrSchema - __annotations__ = { - "color": color, - } - - @classmethod - @functools.lru_cache() - def any_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - Apple, - Banana, - ] - - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["color"]) -> MetaOapg.properties.color: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["color", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["color"]) -> typing.Union[MetaOapg.properties.color, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["color", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - color: typing.Union[MetaOapg.properties.color, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'GmFruit': - return super().__new__( - cls, - *_args, - color=color, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.apple import Apple -from petstore_api.model.banana import Banana diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/gm_fruit.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/gm_fruit.pyi deleted file mode 100644 index 07ebabbc3ff..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/gm_fruit.pyi +++ /dev/null @@ -1,97 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class GmFruit( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - color = schemas.StrSchema - __annotations__ = { - "color": color, - } - - @classmethod - @functools.lru_cache() - def any_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - Apple, - Banana, - ] - - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["color"]) -> MetaOapg.properties.color: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["color", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["color"]) -> typing.Union[MetaOapg.properties.color, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["color", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - color: typing.Union[MetaOapg.properties.color, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'GmFruit': - return super().__new__( - cls, - *_args, - color=color, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.apple import Apple -from petstore_api.model.banana import Banana diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/grandparent_animal.py b/samples/openapi3/client/petstore/python/petstore_api/model/grandparent_animal.py deleted file mode 100644 index 08f64735dc1..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/grandparent_animal.py +++ /dev/null @@ -1,95 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class GrandparentAnimal( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "pet_type", - } - - @staticmethod - def discriminator(): - return { - 'pet_type': { - 'ChildCat': ChildCat, - 'ParentPet': ParentPet, - } - } - - class properties: - pet_type = schemas.StrSchema - __annotations__ = { - "pet_type": pet_type, - } - - pet_type: MetaOapg.properties.pet_type - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["pet_type"]) -> MetaOapg.properties.pet_type: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["pet_type", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["pet_type"]) -> MetaOapg.properties.pet_type: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["pet_type", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - pet_type: typing.Union[MetaOapg.properties.pet_type, str, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'GrandparentAnimal': - return super().__new__( - cls, - *_args, - pet_type=pet_type, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.child_cat import ChildCat -from petstore_api.model.parent_pet import ParentPet diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/grandparent_animal.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/grandparent_animal.pyi deleted file mode 100644 index 08f64735dc1..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/grandparent_animal.pyi +++ /dev/null @@ -1,95 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class GrandparentAnimal( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "pet_type", - } - - @staticmethod - def discriminator(): - return { - 'pet_type': { - 'ChildCat': ChildCat, - 'ParentPet': ParentPet, - } - } - - class properties: - pet_type = schemas.StrSchema - __annotations__ = { - "pet_type": pet_type, - } - - pet_type: MetaOapg.properties.pet_type - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["pet_type"]) -> MetaOapg.properties.pet_type: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["pet_type", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["pet_type"]) -> MetaOapg.properties.pet_type: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["pet_type", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - pet_type: typing.Union[MetaOapg.properties.pet_type, str, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'GrandparentAnimal': - return super().__new__( - cls, - *_args, - pet_type=pet_type, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.child_cat import ChildCat -from petstore_api.model.parent_pet import ParentPet diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/has_only_read_only.py b/samples/openapi3/client/petstore/python/petstore_api/model/has_only_read_only.py deleted file mode 100644 index 809b27defd5..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/has_only_read_only.py +++ /dev/null @@ -1,88 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class HasOnlyReadOnly( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - bar = schemas.StrSchema - foo = schemas.StrSchema - __annotations__ = { - "bar": bar, - "foo": foo, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["bar"]) -> MetaOapg.properties.bar: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["bar", "foo", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["bar"]) -> typing.Union[MetaOapg.properties.bar, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["foo"]) -> typing.Union[MetaOapg.properties.foo, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["bar", "foo", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - bar: typing.Union[MetaOapg.properties.bar, str, schemas.Unset] = schemas.unset, - foo: typing.Union[MetaOapg.properties.foo, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'HasOnlyReadOnly': - return super().__new__( - cls, - *_args, - bar=bar, - foo=foo, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/has_only_read_only.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/has_only_read_only.pyi deleted file mode 100644 index 809b27defd5..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/has_only_read_only.pyi +++ /dev/null @@ -1,88 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class HasOnlyReadOnly( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - bar = schemas.StrSchema - foo = schemas.StrSchema - __annotations__ = { - "bar": bar, - "foo": foo, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["bar"]) -> MetaOapg.properties.bar: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["bar", "foo", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["bar"]) -> typing.Union[MetaOapg.properties.bar, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["foo"]) -> typing.Union[MetaOapg.properties.foo, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["bar", "foo", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - bar: typing.Union[MetaOapg.properties.bar, str, schemas.Unset] = schemas.unset, - foo: typing.Union[MetaOapg.properties.foo, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'HasOnlyReadOnly': - return super().__new__( - cls, - *_args, - bar=bar, - foo=foo, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/health_check_result.py b/samples/openapi3/client/petstore/python/petstore_api/model/health_check_result.py deleted file mode 100644 index be6712279e5..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/health_check_result.py +++ /dev/null @@ -1,99 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class HealthCheckResult( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. - """ - - - class MetaOapg: - - class properties: - - - class NullableMessage( - schemas.StrBase, - schemas.NoneBase, - schemas.Schema, - schemas.NoneStrMixin - ): - - - def __new__( - cls, - *_args: typing.Union[None, str, ], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'NullableMessage': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - ) - __annotations__ = { - "NullableMessage": NullableMessage, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["NullableMessage"]) -> MetaOapg.properties.NullableMessage: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["NullableMessage", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["NullableMessage"]) -> typing.Union[MetaOapg.properties.NullableMessage, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["NullableMessage", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - NullableMessage: typing.Union[MetaOapg.properties.NullableMessage, None, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'HealthCheckResult': - return super().__new__( - cls, - *_args, - NullableMessage=NullableMessage, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/health_check_result.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/health_check_result.pyi deleted file mode 100644 index be6712279e5..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/health_check_result.pyi +++ /dev/null @@ -1,99 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class HealthCheckResult( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. - """ - - - class MetaOapg: - - class properties: - - - class NullableMessage( - schemas.StrBase, - schemas.NoneBase, - schemas.Schema, - schemas.NoneStrMixin - ): - - - def __new__( - cls, - *_args: typing.Union[None, str, ], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'NullableMessage': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - ) - __annotations__ = { - "NullableMessage": NullableMessage, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["NullableMessage"]) -> MetaOapg.properties.NullableMessage: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["NullableMessage", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["NullableMessage"]) -> typing.Union[MetaOapg.properties.NullableMessage, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["NullableMessage", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - NullableMessage: typing.Union[MetaOapg.properties.NullableMessage, None, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'HealthCheckResult': - return super().__new__( - cls, - *_args, - NullableMessage=NullableMessage, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum.py b/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum.py deleted file mode 100644 index 18cd8df6434..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class IntegerEnum( - schemas.EnumBase, - schemas.IntSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - enum_value_to_name = { - 0: "POSITIVE_0", - 1: "POSITIVE_1", - 2: "POSITIVE_2", - } - - @schemas.classproperty - def POSITIVE_0(cls): - return cls(0) - - @schemas.classproperty - def POSITIVE_1(cls): - return cls(1) - - @schemas.classproperty - def POSITIVE_2(cls): - return cls(2) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum.pyi deleted file mode 100644 index 5f88412337f..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum.pyi +++ /dev/null @@ -1,46 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class IntegerEnum( - schemas.EnumBase, - schemas.IntSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - @schemas.classproperty - def POSITIVE_0(cls): - return cls(0) - - @schemas.classproperty - def POSITIVE_1(cls): - return cls(1) - - @schemas.classproperty - def POSITIVE_2(cls): - return cls(2) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum_big.py b/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum_big.py deleted file mode 100644 index 615680bd126..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum_big.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class IntegerEnumBig( - schemas.EnumBase, - schemas.IntSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - enum_value_to_name = { - 10: "POSITIVE_10", - 11: "POSITIVE_11", - 12: "POSITIVE_12", - } - - @schemas.classproperty - def POSITIVE_10(cls): - return cls(10) - - @schemas.classproperty - def POSITIVE_11(cls): - return cls(11) - - @schemas.classproperty - def POSITIVE_12(cls): - return cls(12) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum_big.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum_big.pyi deleted file mode 100644 index 939443fcaaa..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum_big.pyi +++ /dev/null @@ -1,46 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class IntegerEnumBig( - schemas.EnumBase, - schemas.IntSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - @schemas.classproperty - def POSITIVE_10(cls): - return cls(10) - - @schemas.classproperty - def POSITIVE_11(cls): - return cls(11) - - @schemas.classproperty - def POSITIVE_12(cls): - return cls(12) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum_one_value.py b/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum_one_value.py deleted file mode 100644 index 6ab7f2f2130..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum_one_value.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class IntegerEnumOneValue( - schemas.EnumBase, - schemas.IntSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - enum_value_to_name = { - 0: "POSITIVE_0", - } - - @schemas.classproperty - def POSITIVE_0(cls): - return cls(0) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum_one_value.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum_one_value.pyi deleted file mode 100644 index 1e911e5f24b..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum_one_value.pyi +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class IntegerEnumOneValue( - schemas.EnumBase, - schemas.IntSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - @schemas.classproperty - def POSITIVE_0(cls): - return cls(0) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum_with_default_value.py b/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum_with_default_value.py deleted file mode 100644 index 87b44b36f16..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum_with_default_value.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class IntegerEnumWithDefaultValue( - schemas.EnumBase, - schemas.IntSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - enum_value_to_name = { - 0: "POSITIVE_0", - 1: "POSITIVE_1", - 2: "POSITIVE_2", - } - - @schemas.classproperty - def POSITIVE_0(cls): - return cls(0) - - @schemas.classproperty - def POSITIVE_1(cls): - return cls(1) - - @schemas.classproperty - def POSITIVE_2(cls): - return cls(2) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum_with_default_value.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum_with_default_value.pyi deleted file mode 100644 index 9ecbb8d1630..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum_with_default_value.pyi +++ /dev/null @@ -1,46 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class IntegerEnumWithDefaultValue( - schemas.EnumBase, - schemas.IntSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - @schemas.classproperty - def POSITIVE_0(cls): - return cls(0) - - @schemas.classproperty - def POSITIVE_1(cls): - return cls(1) - - @schemas.classproperty - def POSITIVE_2(cls): - return cls(2) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/integer_max10.py b/samples/openapi3/client/petstore/python/petstore_api/model/integer_max10.py deleted file mode 100644 index ac4541fad1f..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/integer_max10.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class IntegerMax10( - schemas.Int64Schema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - format = 'int64' - inclusive_maximum = 10 diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/integer_max10.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/integer_max10.pyi deleted file mode 100644 index 7e0c4ee3373..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/integer_max10.pyi +++ /dev/null @@ -1,34 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class IntegerMax10( - schemas.Int64Schema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - pass diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/integer_min15.py b/samples/openapi3/client/petstore/python/petstore_api/model/integer_min15.py deleted file mode 100644 index 8424c1012a0..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/integer_min15.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class IntegerMin15( - schemas.Int64Schema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - format = 'int64' - inclusive_minimum = 15 diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/integer_min15.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/integer_min15.pyi deleted file mode 100644 index 73d4df6c230..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/integer_min15.pyi +++ /dev/null @@ -1,34 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class IntegerMin15( - schemas.Int64Schema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - pass diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/isosceles_triangle.py b/samples/openapi3/client/petstore/python/petstore_api/model/isosceles_triangle.py deleted file mode 100644 index 5ca02f0fa56..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/isosceles_triangle.py +++ /dev/null @@ -1,132 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class IsoscelesTriangle( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - class all_of_1( - schemas.DictSchema - ): - - - class MetaOapg: - - class properties: - - - class triangleType( - schemas.EnumBase, - schemas.StrSchema - ): - - - class MetaOapg: - enum_value_to_name = { - "IsoscelesTriangle": "ISOSCELES_TRIANGLE", - } - - @schemas.classproperty - def ISOSCELES_TRIANGLE(cls): - return cls("IsoscelesTriangle") - __annotations__ = { - "triangleType": triangleType, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["triangleType"]) -> MetaOapg.properties.triangleType: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["triangleType", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["triangleType"]) -> typing.Union[MetaOapg.properties.triangleType, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["triangleType", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - triangleType: typing.Union[MetaOapg.properties.triangleType, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'all_of_1': - return super().__new__( - cls, - *_args, - triangleType=triangleType, - _configuration=_configuration, - **kwargs, - ) - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - TriangleInterface, - cls.all_of_1, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'IsoscelesTriangle': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.triangle_interface import TriangleInterface diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/isosceles_triangle.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/isosceles_triangle.pyi deleted file mode 100644 index 1ae4ed92dfe..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/isosceles_triangle.pyi +++ /dev/null @@ -1,126 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class IsoscelesTriangle( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - class all_of_1( - schemas.DictSchema - ): - - - class MetaOapg: - - class properties: - - - class triangleType( - schemas.EnumBase, - schemas.StrSchema - ): - - @schemas.classproperty - def ISOSCELES_TRIANGLE(cls): - return cls("IsoscelesTriangle") - __annotations__ = { - "triangleType": triangleType, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["triangleType"]) -> MetaOapg.properties.triangleType: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["triangleType", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["triangleType"]) -> typing.Union[MetaOapg.properties.triangleType, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["triangleType", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - triangleType: typing.Union[MetaOapg.properties.triangleType, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'all_of_1': - return super().__new__( - cls, - *_args, - triangleType=triangleType, - _configuration=_configuration, - **kwargs, - ) - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - TriangleInterface, - cls.all_of_1, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'IsoscelesTriangle': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.triangle_interface import TriangleInterface diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/json_patch_request.py b/samples/openapi3/client/petstore/python/petstore_api/model/json_patch_request.py deleted file mode 100644 index bcbf6521ca6..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/json_patch_request.py +++ /dev/null @@ -1,92 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class JSONPatchRequest( - schemas.ListSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - class items( - schemas.ComposedSchema, - ): - - - class MetaOapg: - - @classmethod - @functools.lru_cache() - def one_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - JSONPatchRequestAddReplaceTest, - JSONPatchRequestRemove, - JSONPatchRequestMoveCopy, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'items': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ]], typing.List[typing.Union[MetaOapg.items, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'JSONPatchRequest': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - -from petstore_api.model.json_patch_request_add_replace_test import JSONPatchRequestAddReplaceTest -from petstore_api.model.json_patch_request_move_copy import JSONPatchRequestMoveCopy -from petstore_api.model.json_patch_request_remove import JSONPatchRequestRemove diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/json_patch_request.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/json_patch_request.pyi deleted file mode 100644 index bcbf6521ca6..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/json_patch_request.pyi +++ /dev/null @@ -1,92 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class JSONPatchRequest( - schemas.ListSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - class items( - schemas.ComposedSchema, - ): - - - class MetaOapg: - - @classmethod - @functools.lru_cache() - def one_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - JSONPatchRequestAddReplaceTest, - JSONPatchRequestRemove, - JSONPatchRequestMoveCopy, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'items': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ]], typing.List[typing.Union[MetaOapg.items, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'JSONPatchRequest': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - -from petstore_api.model.json_patch_request_add_replace_test import JSONPatchRequestAddReplaceTest -from petstore_api.model.json_patch_request_move_copy import JSONPatchRequestMoveCopy -from petstore_api.model.json_patch_request_remove import JSONPatchRequestRemove diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/json_patch_request_add_replace_test.py b/samples/openapi3/client/petstore/python/petstore_api/model/json_patch_request_add_replace_test.py deleted file mode 100644 index 7198cce9031..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/json_patch_request_add_replace_test.py +++ /dev/null @@ -1,123 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class JSONPatchRequestAddReplaceTest( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "op", - "path", - "value", - } - - class properties: - path = schemas.StrSchema - value = schemas.AnyTypeSchema - - - class op( - schemas.EnumBase, - schemas.StrSchema - ): - - - class MetaOapg: - enum_value_to_name = { - "add": "ADD", - "replace": "REPLACE", - "test": "TEST", - } - - @schemas.classproperty - def ADD(cls): - return cls("add") - - @schemas.classproperty - def REPLACE(cls): - return cls("replace") - - @schemas.classproperty - def TEST(cls): - return cls("test") - __annotations__ = { - "path": path, - "value": value, - "op": op, - } - additional_properties = schemas.NotAnyTypeSchema - - op: MetaOapg.properties.op - path: MetaOapg.properties.path - value: MetaOapg.properties.value - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["op"]) -> MetaOapg.properties.op: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["path"]) -> MetaOapg.properties.path: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["value"]) -> MetaOapg.properties.value: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["op"], typing_extensions.Literal["path"], typing_extensions.Literal["value"], ]): - # dict_instance[name] accessor - return super().__getitem__(name) - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["op"]) -> MetaOapg.properties.op: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["path"]) -> MetaOapg.properties.path: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["value"]) -> MetaOapg.properties.value: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["op"], typing_extensions.Literal["path"], typing_extensions.Literal["value"], ]): - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - op: typing.Union[MetaOapg.properties.op, str, ], - path: typing.Union[MetaOapg.properties.path, str, ], - value: typing.Union[MetaOapg.properties.value, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'JSONPatchRequestAddReplaceTest': - return super().__new__( - cls, - *_args, - op=op, - path=path, - value=value, - _configuration=_configuration, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/json_patch_request_add_replace_test.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/json_patch_request_add_replace_test.pyi deleted file mode 100644 index 682f79942af..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/json_patch_request_add_replace_test.pyi +++ /dev/null @@ -1,115 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class JSONPatchRequestAddReplaceTest( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "op", - "path", - "value", - } - - class properties: - path = schemas.StrSchema - value = schemas.AnyTypeSchema - - - class op( - schemas.EnumBase, - schemas.StrSchema - ): - - @schemas.classproperty - def ADD(cls): - return cls("add") - - @schemas.classproperty - def REPLACE(cls): - return cls("replace") - - @schemas.classproperty - def TEST(cls): - return cls("test") - __annotations__ = { - "path": path, - "value": value, - "op": op, - } - additional_properties = schemas.NotAnyTypeSchema - - op: MetaOapg.properties.op - path: MetaOapg.properties.path - value: MetaOapg.properties.value - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["op"]) -> MetaOapg.properties.op: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["path"]) -> MetaOapg.properties.path: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["value"]) -> MetaOapg.properties.value: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["op"], typing_extensions.Literal["path"], typing_extensions.Literal["value"], ]): - # dict_instance[name] accessor - return super().__getitem__(name) - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["op"]) -> MetaOapg.properties.op: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["path"]) -> MetaOapg.properties.path: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["value"]) -> MetaOapg.properties.value: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["op"], typing_extensions.Literal["path"], typing_extensions.Literal["value"], ]): - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - op: typing.Union[MetaOapg.properties.op, str, ], - path: typing.Union[MetaOapg.properties.path, str, ], - value: typing.Union[MetaOapg.properties.value, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'JSONPatchRequestAddReplaceTest': - return super().__new__( - cls, - *_args, - op=op, - path=path, - value=value, - _configuration=_configuration, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/json_patch_request_move_copy.py b/samples/openapi3/client/petstore/python/petstore_api/model/json_patch_request_move_copy.py deleted file mode 100644 index 0a4e78afa7a..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/json_patch_request_move_copy.py +++ /dev/null @@ -1,115 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class JSONPatchRequestMoveCopy( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "op", - "path", - "from", - } - - class properties: - _from = schemas.StrSchema - path = schemas.StrSchema - - - class op( - schemas.EnumBase, - schemas.StrSchema - ): - - - class MetaOapg: - enum_value_to_name = { - "move": "MOVE", - "copy": "COPY", - } - - @schemas.classproperty - def MOVE(cls): - return cls("move") - - @schemas.classproperty - def COPY(cls): - return cls("copy") - __annotations__ = { - "from": _from, - "path": path, - "op": op, - } - additional_properties = schemas.NotAnyTypeSchema - - op: MetaOapg.properties.op - path: MetaOapg.properties.path - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["op"]) -> MetaOapg.properties.op: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["path"]) -> MetaOapg.properties.path: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["from"]) -> MetaOapg.properties._from: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["op"], typing_extensions.Literal["path"], typing_extensions.Literal["from"], ]): - # dict_instance[name] accessor - return super().__getitem__(name) - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["op"]) -> MetaOapg.properties.op: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["path"]) -> MetaOapg.properties.path: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["from"]) -> MetaOapg.properties._from: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["op"], typing_extensions.Literal["path"], typing_extensions.Literal["from"], ]): - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - op: typing.Union[MetaOapg.properties.op, str, ], - path: typing.Union[MetaOapg.properties.path, str, ], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'JSONPatchRequestMoveCopy': - return super().__new__( - cls, - *_args, - op=op, - path=path, - _configuration=_configuration, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/json_patch_request_move_copy.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/json_patch_request_move_copy.pyi deleted file mode 100644 index ac1b968a3da..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/json_patch_request_move_copy.pyi +++ /dev/null @@ -1,108 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class JSONPatchRequestMoveCopy( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "op", - "path", - "from", - } - - class properties: - _from = schemas.StrSchema - path = schemas.StrSchema - - - class op( - schemas.EnumBase, - schemas.StrSchema - ): - - @schemas.classproperty - def MOVE(cls): - return cls("move") - - @schemas.classproperty - def COPY(cls): - return cls("copy") - __annotations__ = { - "from": _from, - "path": path, - "op": op, - } - additional_properties = schemas.NotAnyTypeSchema - - op: MetaOapg.properties.op - path: MetaOapg.properties.path - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["op"]) -> MetaOapg.properties.op: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["path"]) -> MetaOapg.properties.path: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["from"]) -> MetaOapg.properties._from: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["op"], typing_extensions.Literal["path"], typing_extensions.Literal["from"], ]): - # dict_instance[name] accessor - return super().__getitem__(name) - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["op"]) -> MetaOapg.properties.op: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["path"]) -> MetaOapg.properties.path: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["from"]) -> MetaOapg.properties._from: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["op"], typing_extensions.Literal["path"], typing_extensions.Literal["from"], ]): - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - op: typing.Union[MetaOapg.properties.op, str, ], - path: typing.Union[MetaOapg.properties.path, str, ], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'JSONPatchRequestMoveCopy': - return super().__new__( - cls, - *_args, - op=op, - path=path, - _configuration=_configuration, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/json_patch_request_remove.py b/samples/openapi3/client/petstore/python/petstore_api/model/json_patch_request_remove.py deleted file mode 100644 index f4d5490a996..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/json_patch_request_remove.py +++ /dev/null @@ -1,101 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class JSONPatchRequestRemove( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "op", - "path", - } - - class properties: - path = schemas.StrSchema - - - class op( - schemas.EnumBase, - schemas.StrSchema - ): - - - class MetaOapg: - enum_value_to_name = { - "remove": "REMOVE", - } - - @schemas.classproperty - def REMOVE(cls): - return cls("remove") - __annotations__ = { - "path": path, - "op": op, - } - additional_properties = schemas.NotAnyTypeSchema - - op: MetaOapg.properties.op - path: MetaOapg.properties.path - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["op"]) -> MetaOapg.properties.op: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["path"]) -> MetaOapg.properties.path: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["op"], typing_extensions.Literal["path"], ]): - # dict_instance[name] accessor - return super().__getitem__(name) - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["op"]) -> MetaOapg.properties.op: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["path"]) -> MetaOapg.properties.path: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["op"], typing_extensions.Literal["path"], ]): - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - op: typing.Union[MetaOapg.properties.op, str, ], - path: typing.Union[MetaOapg.properties.path, str, ], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'JSONPatchRequestRemove': - return super().__new__( - cls, - *_args, - op=op, - path=path, - _configuration=_configuration, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/json_patch_request_remove.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/json_patch_request_remove.pyi deleted file mode 100644 index 306cb088dae..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/json_patch_request_remove.pyi +++ /dev/null @@ -1,95 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class JSONPatchRequestRemove( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "op", - "path", - } - - class properties: - path = schemas.StrSchema - - - class op( - schemas.EnumBase, - schemas.StrSchema - ): - - @schemas.classproperty - def REMOVE(cls): - return cls("remove") - __annotations__ = { - "path": path, - "op": op, - } - additional_properties = schemas.NotAnyTypeSchema - - op: MetaOapg.properties.op - path: MetaOapg.properties.path - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["op"]) -> MetaOapg.properties.op: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["path"]) -> MetaOapg.properties.path: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["op"], typing_extensions.Literal["path"], ]): - # dict_instance[name] accessor - return super().__getitem__(name) - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["op"]) -> MetaOapg.properties.op: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["path"]) -> MetaOapg.properties.path: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["op"], typing_extensions.Literal["path"], ]): - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - op: typing.Union[MetaOapg.properties.op, str, ], - path: typing.Union[MetaOapg.properties.path, str, ], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'JSONPatchRequestRemove': - return super().__new__( - cls, - *_args, - op=op, - path=path, - _configuration=_configuration, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/mammal.py b/samples/openapi3/client/petstore/python/petstore_api/model/mammal.py deleted file mode 100644 index d69264dd94f..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/mammal.py +++ /dev/null @@ -1,80 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Mammal( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - @staticmethod - def discriminator(): - return { - 'className': { - 'Pig': Pig, - 'whale': Whale, - 'zebra': Zebra, - } - } - - @classmethod - @functools.lru_cache() - def one_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - Whale, - Zebra, - Pig, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Mammal': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.pig import Pig -from petstore_api.model.whale import Whale -from petstore_api.model.zebra import Zebra diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/mammal.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/mammal.pyi deleted file mode 100644 index d69264dd94f..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/mammal.pyi +++ /dev/null @@ -1,80 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Mammal( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - @staticmethod - def discriminator(): - return { - 'className': { - 'Pig': Pig, - 'whale': Whale, - 'zebra': Zebra, - } - } - - @classmethod - @functools.lru_cache() - def one_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - Whale, - Zebra, - Pig, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Mammal': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.pig import Pig -from petstore_api.model.whale import Whale -from petstore_api.model.zebra import Zebra diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/map_test.py b/samples/openapi3/client/petstore/python/petstore_api/model/map_test.py deleted file mode 100644 index 18f0a81e871..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/map_test.py +++ /dev/null @@ -1,245 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class MapTest( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - - - class map_map_of_string( - schemas.DictSchema - ): - - - class MetaOapg: - - - class additional_properties( - schemas.DictSchema - ): - - - class MetaOapg: - additional_properties = schemas.StrSchema - - def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, str, ], - ) -> 'additional_properties': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, ], - ) -> 'map_map_of_string': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - - class map_of_enum_string( - schemas.DictSchema - ): - - - class MetaOapg: - - - class additional_properties( - schemas.EnumBase, - schemas.StrSchema - ): - - - class MetaOapg: - enum_value_to_name = { - "UPPER": "UPPER", - "lower": "LOWER", - } - - @schemas.classproperty - def UPPER(cls): - return cls("UPPER") - - @schemas.classproperty - def LOWER(cls): - return cls("lower") - - def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, str, ], - ) -> 'map_of_enum_string': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - - class direct_map( - schemas.DictSchema - ): - - - class MetaOapg: - additional_properties = schemas.BoolSchema - - def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, bool, ], - ) -> 'direct_map': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - @staticmethod - def indirect_map() -> typing.Type['StringBooleanMap']: - return StringBooleanMap - __annotations__ = { - "map_map_of_string": map_map_of_string, - "map_of_enum_string": map_of_enum_string, - "direct_map": direct_map, - "indirect_map": indirect_map, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["map_map_of_string"]) -> MetaOapg.properties.map_map_of_string: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["map_of_enum_string"]) -> MetaOapg.properties.map_of_enum_string: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["direct_map"]) -> MetaOapg.properties.direct_map: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["indirect_map"]) -> 'StringBooleanMap': ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["map_map_of_string", "map_of_enum_string", "direct_map", "indirect_map", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["map_map_of_string"]) -> typing.Union[MetaOapg.properties.map_map_of_string, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["map_of_enum_string"]) -> typing.Union[MetaOapg.properties.map_of_enum_string, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["direct_map"]) -> typing.Union[MetaOapg.properties.direct_map, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["indirect_map"]) -> typing.Union['StringBooleanMap', schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["map_map_of_string", "map_of_enum_string", "direct_map", "indirect_map", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - map_map_of_string: typing.Union[MetaOapg.properties.map_map_of_string, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - map_of_enum_string: typing.Union[MetaOapg.properties.map_of_enum_string, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - direct_map: typing.Union[MetaOapg.properties.direct_map, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - indirect_map: typing.Union['StringBooleanMap', schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'MapTest': - return super().__new__( - cls, - *_args, - map_map_of_string=map_map_of_string, - map_of_enum_string=map_of_enum_string, - direct_map=direct_map, - indirect_map=indirect_map, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.string_boolean_map import StringBooleanMap diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/map_test.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/map_test.pyi deleted file mode 100644 index 027c7831cc3..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/map_test.pyi +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class MapTest( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - - - class map_map_of_string( - schemas.DictSchema - ): - - - class MetaOapg: - - - class additional_properties( - schemas.DictSchema - ): - - - class MetaOapg: - additional_properties = schemas.StrSchema - - def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, str, ], - ) -> 'additional_properties': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, ], - ) -> 'map_map_of_string': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - - class map_of_enum_string( - schemas.DictSchema - ): - - - class MetaOapg: - - - class additional_properties( - schemas.EnumBase, - schemas.StrSchema - ): - - @schemas.classproperty - def UPPER(cls): - return cls("UPPER") - - @schemas.classproperty - def LOWER(cls): - return cls("lower") - - def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, str, ], - ) -> 'map_of_enum_string': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - - class direct_map( - schemas.DictSchema - ): - - - class MetaOapg: - additional_properties = schemas.BoolSchema - - def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, bool, ], - ) -> 'direct_map': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - @staticmethod - def indirect_map() -> typing.Type['StringBooleanMap']: - return StringBooleanMap - __annotations__ = { - "map_map_of_string": map_map_of_string, - "map_of_enum_string": map_of_enum_string, - "direct_map": direct_map, - "indirect_map": indirect_map, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["map_map_of_string"]) -> MetaOapg.properties.map_map_of_string: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["map_of_enum_string"]) -> MetaOapg.properties.map_of_enum_string: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["direct_map"]) -> MetaOapg.properties.direct_map: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["indirect_map"]) -> 'StringBooleanMap': ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["map_map_of_string", "map_of_enum_string", "direct_map", "indirect_map", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["map_map_of_string"]) -> typing.Union[MetaOapg.properties.map_map_of_string, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["map_of_enum_string"]) -> typing.Union[MetaOapg.properties.map_of_enum_string, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["direct_map"]) -> typing.Union[MetaOapg.properties.direct_map, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["indirect_map"]) -> typing.Union['StringBooleanMap', schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["map_map_of_string", "map_of_enum_string", "direct_map", "indirect_map", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - map_map_of_string: typing.Union[MetaOapg.properties.map_map_of_string, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - map_of_enum_string: typing.Union[MetaOapg.properties.map_of_enum_string, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - direct_map: typing.Union[MetaOapg.properties.direct_map, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - indirect_map: typing.Union['StringBooleanMap', schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'MapTest': - return super().__new__( - cls, - *_args, - map_map_of_string=map_map_of_string, - map_of_enum_string=map_of_enum_string, - direct_map=direct_map, - indirect_map=indirect_map, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.string_boolean_map import StringBooleanMap diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python/petstore_api/model/mixed_properties_and_additional_properties_class.py deleted file mode 100644 index 9096dc77828..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/mixed_properties_and_additional_properties_class.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class MixedPropertiesAndAdditionalPropertiesClass( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - uuid = schemas.UUIDSchema - dateTime = schemas.DateTimeSchema - - - class map( - schemas.DictSchema - ): - - - class MetaOapg: - - @staticmethod - def additional_properties() -> typing.Type['Animal']: - return Animal - - def __getitem__(self, name: typing.Union[str, ]) -> 'Animal': - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> 'Animal': - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: 'Animal', - ) -> 'map': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - __annotations__ = { - "uuid": uuid, - "dateTime": dateTime, - "map": map, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["uuid"]) -> MetaOapg.properties.uuid: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["dateTime"]) -> MetaOapg.properties.dateTime: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["map"]) -> MetaOapg.properties.map: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["uuid", "dateTime", "map", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["uuid"]) -> typing.Union[MetaOapg.properties.uuid, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["dateTime"]) -> typing.Union[MetaOapg.properties.dateTime, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["map"]) -> typing.Union[MetaOapg.properties.map, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["uuid", "dateTime", "map", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - uuid: typing.Union[MetaOapg.properties.uuid, str, uuid.UUID, schemas.Unset] = schemas.unset, - dateTime: typing.Union[MetaOapg.properties.dateTime, str, datetime, schemas.Unset] = schemas.unset, - map: typing.Union[MetaOapg.properties.map, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'MixedPropertiesAndAdditionalPropertiesClass': - return super().__new__( - cls, - *_args, - uuid=uuid, - dateTime=dateTime, - map=map, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.animal import Animal diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/mixed_properties_and_additional_properties_class.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/mixed_properties_and_additional_properties_class.pyi deleted file mode 100644 index 9096dc77828..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/mixed_properties_and_additional_properties_class.pyi +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class MixedPropertiesAndAdditionalPropertiesClass( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - uuid = schemas.UUIDSchema - dateTime = schemas.DateTimeSchema - - - class map( - schemas.DictSchema - ): - - - class MetaOapg: - - @staticmethod - def additional_properties() -> typing.Type['Animal']: - return Animal - - def __getitem__(self, name: typing.Union[str, ]) -> 'Animal': - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> 'Animal': - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: 'Animal', - ) -> 'map': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - __annotations__ = { - "uuid": uuid, - "dateTime": dateTime, - "map": map, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["uuid"]) -> MetaOapg.properties.uuid: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["dateTime"]) -> MetaOapg.properties.dateTime: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["map"]) -> MetaOapg.properties.map: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["uuid", "dateTime", "map", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["uuid"]) -> typing.Union[MetaOapg.properties.uuid, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["dateTime"]) -> typing.Union[MetaOapg.properties.dateTime, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["map"]) -> typing.Union[MetaOapg.properties.map, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["uuid", "dateTime", "map", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - uuid: typing.Union[MetaOapg.properties.uuid, str, uuid.UUID, schemas.Unset] = schemas.unset, - dateTime: typing.Union[MetaOapg.properties.dateTime, str, datetime, schemas.Unset] = schemas.unset, - map: typing.Union[MetaOapg.properties.map, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'MixedPropertiesAndAdditionalPropertiesClass': - return super().__new__( - cls, - *_args, - uuid=uuid, - dateTime=dateTime, - map=map, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.animal import Animal diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/model200_response.py b/samples/openapi3/client/petstore/python/petstore_api/model/model200_response.py deleted file mode 100644 index ba582159e82..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/model200_response.py +++ /dev/null @@ -1,89 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Model200Response( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - model with an invalid class name for python, starts with a number - """ - - - class MetaOapg: - - class properties: - name = schemas.Int32Schema - _class = schemas.StrSchema - __annotations__ = { - "name": name, - "class": _class, - } - - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["class"]) -> MetaOapg.properties._class: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["name", "class", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["name"]) -> typing.Union[MetaOapg.properties.name, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["class"]) -> typing.Union[MetaOapg.properties._class, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["name", "class", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - name: typing.Union[MetaOapg.properties.name, decimal.Decimal, int, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Model200Response': - return super().__new__( - cls, - *_args, - name=name, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/model200_response.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/model200_response.pyi deleted file mode 100644 index ba582159e82..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/model200_response.pyi +++ /dev/null @@ -1,89 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Model200Response( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - model with an invalid class name for python, starts with a number - """ - - - class MetaOapg: - - class properties: - name = schemas.Int32Schema - _class = schemas.StrSchema - __annotations__ = { - "name": name, - "class": _class, - } - - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["class"]) -> MetaOapg.properties._class: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["name", "class", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["name"]) -> typing.Union[MetaOapg.properties.name, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["class"]) -> typing.Union[MetaOapg.properties._class, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["name", "class", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - name: typing.Union[MetaOapg.properties.name, decimal.Decimal, int, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Model200Response': - return super().__new__( - cls, - *_args, - name=name, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/model_return.py b/samples/openapi3/client/petstore/python/petstore_api/model/model_return.py deleted file mode 100644 index be6cb94a5e6..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/model_return.py +++ /dev/null @@ -1,79 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ModelReturn( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Model for testing reserved words - """ - - - class MetaOapg: - - class properties: - _return = schemas.Int32Schema - __annotations__ = { - "return": _return, - } - - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["return"]) -> MetaOapg.properties._return: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["return", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["return"]) -> typing.Union[MetaOapg.properties._return, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["return", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ModelReturn': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/model_return.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/model_return.pyi deleted file mode 100644 index be6cb94a5e6..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/model_return.pyi +++ /dev/null @@ -1,79 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ModelReturn( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Model for testing reserved words - """ - - - class MetaOapg: - - class properties: - _return = schemas.Int32Schema - __annotations__ = { - "return": _return, - } - - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["return"]) -> MetaOapg.properties._return: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["return", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["return"]) -> typing.Union[MetaOapg.properties._return, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["return", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ModelReturn': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/money.py b/samples/openapi3/client/petstore/python/petstore_api/model/money.py deleted file mode 100644 index 16d38505949..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/money.py +++ /dev/null @@ -1,100 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Money( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "amount", - "currency", - } - - class properties: - amount = schemas.DecimalSchema - - @staticmethod - def currency() -> typing.Type['Currency']: - return Currency - __annotations__ = { - "amount": amount, - "currency": currency, - } - - amount: MetaOapg.properties.amount - currency: 'Currency' - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["amount"]) -> MetaOapg.properties.amount: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["currency"]) -> 'Currency': ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["amount", "currency", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["amount"]) -> MetaOapg.properties.amount: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["currency"]) -> 'Currency': ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["amount", "currency", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - amount: typing.Union[MetaOapg.properties.amount, str, ], - currency: 'Currency', - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Money': - return super().__new__( - cls, - *_args, - amount=amount, - currency=currency, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.currency import Currency diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/money.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/money.pyi deleted file mode 100644 index 16d38505949..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/money.pyi +++ /dev/null @@ -1,100 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Money( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "amount", - "currency", - } - - class properties: - amount = schemas.DecimalSchema - - @staticmethod - def currency() -> typing.Type['Currency']: - return Currency - __annotations__ = { - "amount": amount, - "currency": currency, - } - - amount: MetaOapg.properties.amount - currency: 'Currency' - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["amount"]) -> MetaOapg.properties.amount: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["currency"]) -> 'Currency': ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["amount", "currency", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["amount"]) -> MetaOapg.properties.amount: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["currency"]) -> 'Currency': ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["amount", "currency", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - amount: typing.Union[MetaOapg.properties.amount, str, ], - currency: 'Currency', - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Money': - return super().__new__( - cls, - *_args, - amount=amount, - currency=currency, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.currency import Currency diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/name.py b/samples/openapi3/client/petstore/python/petstore_api/model/name.py deleted file mode 100644 index 94e37c1dabf..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/name.py +++ /dev/null @@ -1,104 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Name( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Model for testing model name same as property name - """ - - - class MetaOapg: - required = { - "name", - } - - class properties: - name = schemas.Int32Schema - snake_case = schemas.Int32Schema - _property = schemas.StrSchema - __annotations__ = { - "name": name, - "snake_case": snake_case, - "property": _property, - } - - - name: MetaOapg.properties.name - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["snake_case"]) -> MetaOapg.properties.snake_case: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["property"]) -> MetaOapg.properties._property: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["name", "snake_case", "property", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["snake_case"]) -> typing.Union[MetaOapg.properties.snake_case, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["property"]) -> typing.Union[MetaOapg.properties._property, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["name", "snake_case", "property", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - name: typing.Union[MetaOapg.properties.name, decimal.Decimal, int, ], - snake_case: typing.Union[MetaOapg.properties.snake_case, decimal.Decimal, int, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Name': - return super().__new__( - cls, - *_args, - name=name, - snake_case=snake_case, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/name.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/name.pyi deleted file mode 100644 index 94e37c1dabf..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/name.pyi +++ /dev/null @@ -1,104 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Name( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Model for testing model name same as property name - """ - - - class MetaOapg: - required = { - "name", - } - - class properties: - name = schemas.Int32Schema - snake_case = schemas.Int32Schema - _property = schemas.StrSchema - __annotations__ = { - "name": name, - "snake_case": snake_case, - "property": _property, - } - - - name: MetaOapg.properties.name - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["snake_case"]) -> MetaOapg.properties.snake_case: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["property"]) -> MetaOapg.properties._property: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["name", "snake_case", "property", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["snake_case"]) -> typing.Union[MetaOapg.properties.snake_case, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["property"]) -> typing.Union[MetaOapg.properties._property, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["name", "snake_case", "property", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - name: typing.Union[MetaOapg.properties.name, decimal.Decimal, int, ], - snake_case: typing.Union[MetaOapg.properties.snake_case, decimal.Decimal, int, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Name': - return super().__new__( - cls, - *_args, - name=name, - snake_case=snake_case, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/no_additional_properties.py b/samples/openapi3/client/petstore/python/petstore_api/model/no_additional_properties.py deleted file mode 100644 index 4eb3cf9bbb7..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/no_additional_properties.py +++ /dev/null @@ -1,84 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class NoAdditionalProperties( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "id", - } - - class properties: - id = schemas.Int64Schema - petId = schemas.Int64Schema - __annotations__ = { - "id": id, - "petId": petId, - } - additional_properties = schemas.NotAnyTypeSchema - - id: MetaOapg.properties.id - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["id"]) -> MetaOapg.properties.id: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["petId"]) -> MetaOapg.properties.petId: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["id"], typing_extensions.Literal["petId"], ]): - # dict_instance[name] accessor - return super().__getitem__(name) - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["id"]) -> MetaOapg.properties.id: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["petId"]) -> typing.Union[MetaOapg.properties.petId, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["id"], typing_extensions.Literal["petId"], ]): - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - id: typing.Union[MetaOapg.properties.id, decimal.Decimal, int, ], - petId: typing.Union[MetaOapg.properties.petId, decimal.Decimal, int, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'NoAdditionalProperties': - return super().__new__( - cls, - *_args, - id=id, - petId=petId, - _configuration=_configuration, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/no_additional_properties.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/no_additional_properties.pyi deleted file mode 100644 index 4eb3cf9bbb7..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/no_additional_properties.pyi +++ /dev/null @@ -1,84 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class NoAdditionalProperties( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "id", - } - - class properties: - id = schemas.Int64Schema - petId = schemas.Int64Schema - __annotations__ = { - "id": id, - "petId": petId, - } - additional_properties = schemas.NotAnyTypeSchema - - id: MetaOapg.properties.id - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["id"]) -> MetaOapg.properties.id: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["petId"]) -> MetaOapg.properties.petId: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["id"], typing_extensions.Literal["petId"], ]): - # dict_instance[name] accessor - return super().__getitem__(name) - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["id"]) -> MetaOapg.properties.id: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["petId"]) -> typing.Union[MetaOapg.properties.petId, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["id"], typing_extensions.Literal["petId"], ]): - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - id: typing.Union[MetaOapg.properties.id, decimal.Decimal, int, ], - petId: typing.Union[MetaOapg.properties.petId, decimal.Decimal, int, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'NoAdditionalProperties': - return super().__new__( - cls, - *_args, - id=id, - petId=petId, - _configuration=_configuration, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/nullable_class.py b/samples/openapi3/client/petstore/python/petstore_api/model/nullable_class.py deleted file mode 100644 index 4bc17e7e05c..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/nullable_class.py +++ /dev/null @@ -1,576 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class NullableClass( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - - - class integer_prop( - schemas.IntBase, - schemas.NoneBase, - schemas.Schema, - schemas.NoneDecimalMixin - ): - - - def __new__( - cls, - *_args: typing.Union[None, decimal.Decimal, int, ], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'integer_prop': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - ) - - - class number_prop( - schemas.NumberBase, - schemas.NoneBase, - schemas.Schema, - schemas.NoneDecimalMixin - ): - - - def __new__( - cls, - *_args: typing.Union[None, decimal.Decimal, int, float, ], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'number_prop': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - ) - - - class boolean_prop( - schemas.BoolBase, - schemas.NoneBase, - schemas.Schema, - schemas.NoneBoolMixin - ): - - - def __new__( - cls, - *_args: typing.Union[None, bool, ], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'boolean_prop': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - ) - - - class string_prop( - schemas.StrBase, - schemas.NoneBase, - schemas.Schema, - schemas.NoneStrMixin - ): - - - def __new__( - cls, - *_args: typing.Union[None, str, ], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'string_prop': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - ) - - - class date_prop( - schemas.DateBase, - schemas.StrBase, - schemas.NoneBase, - schemas.Schema, - schemas.NoneStrMixin - ): - - - class MetaOapg: - format = 'date' - - - def __new__( - cls, - *_args: typing.Union[None, str, date, ], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'date_prop': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - ) - - - class datetime_prop( - schemas.DateTimeBase, - schemas.StrBase, - schemas.NoneBase, - schemas.Schema, - schemas.NoneStrMixin - ): - - - class MetaOapg: - format = 'date-time' - - - def __new__( - cls, - *_args: typing.Union[None, str, datetime, ], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'datetime_prop': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - ) - - - class array_nullable_prop( - schemas.ListBase, - schemas.NoneBase, - schemas.Schema, - schemas.NoneTupleMixin - ): - - - class MetaOapg: - items = schemas.DictSchema - - - def __new__( - cls, - *_args: typing.Union[list, tuple, None, ], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'array_nullable_prop': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - ) - - - class array_and_items_nullable_prop( - schemas.ListBase, - schemas.NoneBase, - schemas.Schema, - schemas.NoneTupleMixin - ): - - - class MetaOapg: - - - class items( - schemas.DictBase, - schemas.NoneBase, - schemas.Schema, - schemas.NoneFrozenDictMixin - ): - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, None, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'items': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - - def __new__( - cls, - *_args: typing.Union[list, tuple, None, ], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'array_and_items_nullable_prop': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - ) - - - class array_items_nullable( - schemas.ListSchema - ): - - - class MetaOapg: - - - class items( - schemas.DictBase, - schemas.NoneBase, - schemas.Schema, - schemas.NoneFrozenDictMixin - ): - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, None, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'items': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, dict, frozendict.frozendict, None, ]], typing.List[typing.Union[MetaOapg.items, dict, frozendict.frozendict, None, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'array_items_nullable': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - - - class object_nullable_prop( - schemas.DictBase, - schemas.NoneBase, - schemas.Schema, - schemas.NoneFrozenDictMixin - ): - - - class MetaOapg: - additional_properties = schemas.DictSchema - - - def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, None, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, ], - ) -> 'object_nullable_prop': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - - class object_and_items_nullable_prop( - schemas.DictBase, - schemas.NoneBase, - schemas.Schema, - schemas.NoneFrozenDictMixin - ): - - - class MetaOapg: - - - class additional_properties( - schemas.DictBase, - schemas.NoneBase, - schemas.Schema, - schemas.NoneFrozenDictMixin - ): - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, None, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'additional_properties': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - - def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, None, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, None, ], - ) -> 'object_and_items_nullable_prop': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - - class object_items_nullable( - schemas.DictSchema - ): - - - class MetaOapg: - - - class additional_properties( - schemas.DictBase, - schemas.NoneBase, - schemas.Schema, - schemas.NoneFrozenDictMixin - ): - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, None, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'additional_properties': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, None, ], - ) -> 'object_items_nullable': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - __annotations__ = { - "integer_prop": integer_prop, - "number_prop": number_prop, - "boolean_prop": boolean_prop, - "string_prop": string_prop, - "date_prop": date_prop, - "datetime_prop": datetime_prop, - "array_nullable_prop": array_nullable_prop, - "array_and_items_nullable_prop": array_and_items_nullable_prop, - "array_items_nullable": array_items_nullable, - "object_nullable_prop": object_nullable_prop, - "object_and_items_nullable_prop": object_and_items_nullable_prop, - "object_items_nullable": object_items_nullable, - } - - - class additional_properties( - schemas.DictBase, - schemas.NoneBase, - schemas.Schema, - schemas.NoneFrozenDictMixin - ): - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, None, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'additional_properties': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["integer_prop"]) -> MetaOapg.properties.integer_prop: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["number_prop"]) -> MetaOapg.properties.number_prop: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["boolean_prop"]) -> MetaOapg.properties.boolean_prop: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["string_prop"]) -> MetaOapg.properties.string_prop: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["date_prop"]) -> MetaOapg.properties.date_prop: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["datetime_prop"]) -> MetaOapg.properties.datetime_prop: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["array_nullable_prop"]) -> MetaOapg.properties.array_nullable_prop: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["array_and_items_nullable_prop"]) -> MetaOapg.properties.array_and_items_nullable_prop: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["array_items_nullable"]) -> MetaOapg.properties.array_items_nullable: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["object_nullable_prop"]) -> MetaOapg.properties.object_nullable_prop: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["object_and_items_nullable_prop"]) -> MetaOapg.properties.object_and_items_nullable_prop: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["object_items_nullable"]) -> MetaOapg.properties.object_items_nullable: ... - - @typing.overload - def __getitem__(self, name: str) -> MetaOapg.additional_properties: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["integer_prop"], typing_extensions.Literal["number_prop"], typing_extensions.Literal["boolean_prop"], typing_extensions.Literal["string_prop"], typing_extensions.Literal["date_prop"], typing_extensions.Literal["datetime_prop"], typing_extensions.Literal["array_nullable_prop"], typing_extensions.Literal["array_and_items_nullable_prop"], typing_extensions.Literal["array_items_nullable"], typing_extensions.Literal["object_nullable_prop"], typing_extensions.Literal["object_and_items_nullable_prop"], typing_extensions.Literal["object_items_nullable"], str, ]): - # dict_instance[name] accessor - return super().__getitem__(name) - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["integer_prop"]) -> typing.Union[MetaOapg.properties.integer_prop, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["number_prop"]) -> typing.Union[MetaOapg.properties.number_prop, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["boolean_prop"]) -> typing.Union[MetaOapg.properties.boolean_prop, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["string_prop"]) -> typing.Union[MetaOapg.properties.string_prop, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["date_prop"]) -> typing.Union[MetaOapg.properties.date_prop, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["datetime_prop"]) -> typing.Union[MetaOapg.properties.datetime_prop, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["array_nullable_prop"]) -> typing.Union[MetaOapg.properties.array_nullable_prop, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["array_and_items_nullable_prop"]) -> typing.Union[MetaOapg.properties.array_and_items_nullable_prop, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["array_items_nullable"]) -> typing.Union[MetaOapg.properties.array_items_nullable, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["object_nullable_prop"]) -> typing.Union[MetaOapg.properties.object_nullable_prop, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["object_and_items_nullable_prop"]) -> typing.Union[MetaOapg.properties.object_and_items_nullable_prop, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["object_items_nullable"]) -> typing.Union[MetaOapg.properties.object_items_nullable, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[MetaOapg.additional_properties, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["integer_prop"], typing_extensions.Literal["number_prop"], typing_extensions.Literal["boolean_prop"], typing_extensions.Literal["string_prop"], typing_extensions.Literal["date_prop"], typing_extensions.Literal["datetime_prop"], typing_extensions.Literal["array_nullable_prop"], typing_extensions.Literal["array_and_items_nullable_prop"], typing_extensions.Literal["array_items_nullable"], typing_extensions.Literal["object_nullable_prop"], typing_extensions.Literal["object_and_items_nullable_prop"], typing_extensions.Literal["object_items_nullable"], str, ]): - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - integer_prop: typing.Union[MetaOapg.properties.integer_prop, None, decimal.Decimal, int, schemas.Unset] = schemas.unset, - number_prop: typing.Union[MetaOapg.properties.number_prop, None, decimal.Decimal, int, float, schemas.Unset] = schemas.unset, - boolean_prop: typing.Union[MetaOapg.properties.boolean_prop, None, bool, schemas.Unset] = schemas.unset, - string_prop: typing.Union[MetaOapg.properties.string_prop, None, str, schemas.Unset] = schemas.unset, - date_prop: typing.Union[MetaOapg.properties.date_prop, None, str, date, schemas.Unset] = schemas.unset, - datetime_prop: typing.Union[MetaOapg.properties.datetime_prop, None, str, datetime, schemas.Unset] = schemas.unset, - array_nullable_prop: typing.Union[MetaOapg.properties.array_nullable_prop, list, tuple, None, schemas.Unset] = schemas.unset, - array_and_items_nullable_prop: typing.Union[MetaOapg.properties.array_and_items_nullable_prop, list, tuple, None, schemas.Unset] = schemas.unset, - array_items_nullable: typing.Union[MetaOapg.properties.array_items_nullable, list, tuple, schemas.Unset] = schemas.unset, - object_nullable_prop: typing.Union[MetaOapg.properties.object_nullable_prop, dict, frozendict.frozendict, None, schemas.Unset] = schemas.unset, - object_and_items_nullable_prop: typing.Union[MetaOapg.properties.object_and_items_nullable_prop, dict, frozendict.frozendict, None, schemas.Unset] = schemas.unset, - object_items_nullable: typing.Union[MetaOapg.properties.object_items_nullable, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, None, ], - ) -> 'NullableClass': - return super().__new__( - cls, - *_args, - integer_prop=integer_prop, - number_prop=number_prop, - boolean_prop=boolean_prop, - string_prop=string_prop, - date_prop=date_prop, - datetime_prop=datetime_prop, - array_nullable_prop=array_nullable_prop, - array_and_items_nullable_prop=array_and_items_nullable_prop, - array_items_nullable=array_items_nullable, - object_nullable_prop=object_nullable_prop, - object_and_items_nullable_prop=object_and_items_nullable_prop, - object_items_nullable=object_items_nullable, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/nullable_class.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/nullable_class.pyi deleted file mode 100644 index 4bc17e7e05c..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/nullable_class.pyi +++ /dev/null @@ -1,576 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class NullableClass( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - - - class integer_prop( - schemas.IntBase, - schemas.NoneBase, - schemas.Schema, - schemas.NoneDecimalMixin - ): - - - def __new__( - cls, - *_args: typing.Union[None, decimal.Decimal, int, ], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'integer_prop': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - ) - - - class number_prop( - schemas.NumberBase, - schemas.NoneBase, - schemas.Schema, - schemas.NoneDecimalMixin - ): - - - def __new__( - cls, - *_args: typing.Union[None, decimal.Decimal, int, float, ], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'number_prop': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - ) - - - class boolean_prop( - schemas.BoolBase, - schemas.NoneBase, - schemas.Schema, - schemas.NoneBoolMixin - ): - - - def __new__( - cls, - *_args: typing.Union[None, bool, ], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'boolean_prop': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - ) - - - class string_prop( - schemas.StrBase, - schemas.NoneBase, - schemas.Schema, - schemas.NoneStrMixin - ): - - - def __new__( - cls, - *_args: typing.Union[None, str, ], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'string_prop': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - ) - - - class date_prop( - schemas.DateBase, - schemas.StrBase, - schemas.NoneBase, - schemas.Schema, - schemas.NoneStrMixin - ): - - - class MetaOapg: - format = 'date' - - - def __new__( - cls, - *_args: typing.Union[None, str, date, ], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'date_prop': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - ) - - - class datetime_prop( - schemas.DateTimeBase, - schemas.StrBase, - schemas.NoneBase, - schemas.Schema, - schemas.NoneStrMixin - ): - - - class MetaOapg: - format = 'date-time' - - - def __new__( - cls, - *_args: typing.Union[None, str, datetime, ], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'datetime_prop': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - ) - - - class array_nullable_prop( - schemas.ListBase, - schemas.NoneBase, - schemas.Schema, - schemas.NoneTupleMixin - ): - - - class MetaOapg: - items = schemas.DictSchema - - - def __new__( - cls, - *_args: typing.Union[list, tuple, None, ], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'array_nullable_prop': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - ) - - - class array_and_items_nullable_prop( - schemas.ListBase, - schemas.NoneBase, - schemas.Schema, - schemas.NoneTupleMixin - ): - - - class MetaOapg: - - - class items( - schemas.DictBase, - schemas.NoneBase, - schemas.Schema, - schemas.NoneFrozenDictMixin - ): - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, None, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'items': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - - def __new__( - cls, - *_args: typing.Union[list, tuple, None, ], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'array_and_items_nullable_prop': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - ) - - - class array_items_nullable( - schemas.ListSchema - ): - - - class MetaOapg: - - - class items( - schemas.DictBase, - schemas.NoneBase, - schemas.Schema, - schemas.NoneFrozenDictMixin - ): - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, None, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'items': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, dict, frozendict.frozendict, None, ]], typing.List[typing.Union[MetaOapg.items, dict, frozendict.frozendict, None, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'array_items_nullable': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - - - class object_nullable_prop( - schemas.DictBase, - schemas.NoneBase, - schemas.Schema, - schemas.NoneFrozenDictMixin - ): - - - class MetaOapg: - additional_properties = schemas.DictSchema - - - def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, None, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, ], - ) -> 'object_nullable_prop': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - - class object_and_items_nullable_prop( - schemas.DictBase, - schemas.NoneBase, - schemas.Schema, - schemas.NoneFrozenDictMixin - ): - - - class MetaOapg: - - - class additional_properties( - schemas.DictBase, - schemas.NoneBase, - schemas.Schema, - schemas.NoneFrozenDictMixin - ): - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, None, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'additional_properties': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - - def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, None, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, None, ], - ) -> 'object_and_items_nullable_prop': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - - class object_items_nullable( - schemas.DictSchema - ): - - - class MetaOapg: - - - class additional_properties( - schemas.DictBase, - schemas.NoneBase, - schemas.Schema, - schemas.NoneFrozenDictMixin - ): - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, None, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'additional_properties': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, None, ], - ) -> 'object_items_nullable': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - __annotations__ = { - "integer_prop": integer_prop, - "number_prop": number_prop, - "boolean_prop": boolean_prop, - "string_prop": string_prop, - "date_prop": date_prop, - "datetime_prop": datetime_prop, - "array_nullable_prop": array_nullable_prop, - "array_and_items_nullable_prop": array_and_items_nullable_prop, - "array_items_nullable": array_items_nullable, - "object_nullable_prop": object_nullable_prop, - "object_and_items_nullable_prop": object_and_items_nullable_prop, - "object_items_nullable": object_items_nullable, - } - - - class additional_properties( - schemas.DictBase, - schemas.NoneBase, - schemas.Schema, - schemas.NoneFrozenDictMixin - ): - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, None, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'additional_properties': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["integer_prop"]) -> MetaOapg.properties.integer_prop: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["number_prop"]) -> MetaOapg.properties.number_prop: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["boolean_prop"]) -> MetaOapg.properties.boolean_prop: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["string_prop"]) -> MetaOapg.properties.string_prop: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["date_prop"]) -> MetaOapg.properties.date_prop: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["datetime_prop"]) -> MetaOapg.properties.datetime_prop: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["array_nullable_prop"]) -> MetaOapg.properties.array_nullable_prop: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["array_and_items_nullable_prop"]) -> MetaOapg.properties.array_and_items_nullable_prop: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["array_items_nullable"]) -> MetaOapg.properties.array_items_nullable: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["object_nullable_prop"]) -> MetaOapg.properties.object_nullable_prop: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["object_and_items_nullable_prop"]) -> MetaOapg.properties.object_and_items_nullable_prop: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["object_items_nullable"]) -> MetaOapg.properties.object_items_nullable: ... - - @typing.overload - def __getitem__(self, name: str) -> MetaOapg.additional_properties: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["integer_prop"], typing_extensions.Literal["number_prop"], typing_extensions.Literal["boolean_prop"], typing_extensions.Literal["string_prop"], typing_extensions.Literal["date_prop"], typing_extensions.Literal["datetime_prop"], typing_extensions.Literal["array_nullable_prop"], typing_extensions.Literal["array_and_items_nullable_prop"], typing_extensions.Literal["array_items_nullable"], typing_extensions.Literal["object_nullable_prop"], typing_extensions.Literal["object_and_items_nullable_prop"], typing_extensions.Literal["object_items_nullable"], str, ]): - # dict_instance[name] accessor - return super().__getitem__(name) - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["integer_prop"]) -> typing.Union[MetaOapg.properties.integer_prop, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["number_prop"]) -> typing.Union[MetaOapg.properties.number_prop, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["boolean_prop"]) -> typing.Union[MetaOapg.properties.boolean_prop, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["string_prop"]) -> typing.Union[MetaOapg.properties.string_prop, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["date_prop"]) -> typing.Union[MetaOapg.properties.date_prop, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["datetime_prop"]) -> typing.Union[MetaOapg.properties.datetime_prop, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["array_nullable_prop"]) -> typing.Union[MetaOapg.properties.array_nullable_prop, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["array_and_items_nullable_prop"]) -> typing.Union[MetaOapg.properties.array_and_items_nullable_prop, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["array_items_nullable"]) -> typing.Union[MetaOapg.properties.array_items_nullable, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["object_nullable_prop"]) -> typing.Union[MetaOapg.properties.object_nullable_prop, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["object_and_items_nullable_prop"]) -> typing.Union[MetaOapg.properties.object_and_items_nullable_prop, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["object_items_nullable"]) -> typing.Union[MetaOapg.properties.object_items_nullable, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[MetaOapg.additional_properties, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["integer_prop"], typing_extensions.Literal["number_prop"], typing_extensions.Literal["boolean_prop"], typing_extensions.Literal["string_prop"], typing_extensions.Literal["date_prop"], typing_extensions.Literal["datetime_prop"], typing_extensions.Literal["array_nullable_prop"], typing_extensions.Literal["array_and_items_nullable_prop"], typing_extensions.Literal["array_items_nullable"], typing_extensions.Literal["object_nullable_prop"], typing_extensions.Literal["object_and_items_nullable_prop"], typing_extensions.Literal["object_items_nullable"], str, ]): - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - integer_prop: typing.Union[MetaOapg.properties.integer_prop, None, decimal.Decimal, int, schemas.Unset] = schemas.unset, - number_prop: typing.Union[MetaOapg.properties.number_prop, None, decimal.Decimal, int, float, schemas.Unset] = schemas.unset, - boolean_prop: typing.Union[MetaOapg.properties.boolean_prop, None, bool, schemas.Unset] = schemas.unset, - string_prop: typing.Union[MetaOapg.properties.string_prop, None, str, schemas.Unset] = schemas.unset, - date_prop: typing.Union[MetaOapg.properties.date_prop, None, str, date, schemas.Unset] = schemas.unset, - datetime_prop: typing.Union[MetaOapg.properties.datetime_prop, None, str, datetime, schemas.Unset] = schemas.unset, - array_nullable_prop: typing.Union[MetaOapg.properties.array_nullable_prop, list, tuple, None, schemas.Unset] = schemas.unset, - array_and_items_nullable_prop: typing.Union[MetaOapg.properties.array_and_items_nullable_prop, list, tuple, None, schemas.Unset] = schemas.unset, - array_items_nullable: typing.Union[MetaOapg.properties.array_items_nullable, list, tuple, schemas.Unset] = schemas.unset, - object_nullable_prop: typing.Union[MetaOapg.properties.object_nullable_prop, dict, frozendict.frozendict, None, schemas.Unset] = schemas.unset, - object_and_items_nullable_prop: typing.Union[MetaOapg.properties.object_and_items_nullable_prop, dict, frozendict.frozendict, None, schemas.Unset] = schemas.unset, - object_items_nullable: typing.Union[MetaOapg.properties.object_items_nullable, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, None, ], - ) -> 'NullableClass': - return super().__new__( - cls, - *_args, - integer_prop=integer_prop, - number_prop=number_prop, - boolean_prop=boolean_prop, - string_prop=string_prop, - date_prop=date_prop, - datetime_prop=datetime_prop, - array_nullable_prop=array_nullable_prop, - array_and_items_nullable_prop=array_and_items_nullable_prop, - array_items_nullable=array_items_nullable, - object_nullable_prop=object_nullable_prop, - object_and_items_nullable_prop=object_and_items_nullable_prop, - object_items_nullable=object_items_nullable, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/nullable_shape.py b/samples/openapi3/client/petstore/python/petstore_api/model/nullable_shape.py deleted file mode 100644 index 8db6f7f445b..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/nullable_shape.py +++ /dev/null @@ -1,72 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class NullableShape( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - The value may be a shape or the 'null' value. For a composed schema to validate a null payload, one of its chosen oneOf schemas must be type null or nullable (introduced in OAS schema >= 3.0) - """ - - - class MetaOapg: - one_of_2 = schemas.NoneSchema - - @classmethod - @functools.lru_cache() - def one_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - Triangle, - Quadrilateral, - cls.one_of_2, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'NullableShape': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.quadrilateral import Quadrilateral -from petstore_api.model.triangle import Triangle diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/nullable_shape.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/nullable_shape.pyi deleted file mode 100644 index 8db6f7f445b..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/nullable_shape.pyi +++ /dev/null @@ -1,72 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class NullableShape( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - The value may be a shape or the 'null' value. For a composed schema to validate a null payload, one of its chosen oneOf schemas must be type null or nullable (introduced in OAS schema >= 3.0) - """ - - - class MetaOapg: - one_of_2 = schemas.NoneSchema - - @classmethod - @functools.lru_cache() - def one_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - Triangle, - Quadrilateral, - cls.one_of_2, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'NullableShape': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.quadrilateral import Quadrilateral -from petstore_api.model.triangle import Triangle diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/nullable_string.py b/samples/openapi3/client/petstore/python/petstore_api/model/nullable_string.py deleted file mode 100644 index 6a101a6f191..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/nullable_string.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class NullableString( - schemas.StrBase, - schemas.NoneBase, - schemas.Schema, - schemas.NoneStrMixin -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - def __new__( - cls, - *_args: typing.Union[None, str, ], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'NullableString': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/nullable_string.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/nullable_string.pyi deleted file mode 100644 index 6a101a6f191..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/nullable_string.pyi +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class NullableString( - schemas.StrBase, - schemas.NoneBase, - schemas.Schema, - schemas.NoneStrMixin -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - def __new__( - cls, - *_args: typing.Union[None, str, ], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'NullableString': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/number.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/number.pyi deleted file mode 100644 index 7210b911ced..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/number.pyi +++ /dev/null @@ -1,24 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 -Number = schemas.NumberSchema diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/number_only.py b/samples/openapi3/client/petstore/python/petstore_api/model/number_only.py deleted file mode 100644 index 1fe492fe06e..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/number_only.py +++ /dev/null @@ -1,78 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class NumberOnly( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - JustNumber = schemas.NumberSchema - __annotations__ = { - "JustNumber": JustNumber, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["JustNumber"]) -> MetaOapg.properties.JustNumber: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["JustNumber", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["JustNumber"]) -> typing.Union[MetaOapg.properties.JustNumber, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["JustNumber", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - JustNumber: typing.Union[MetaOapg.properties.JustNumber, decimal.Decimal, int, float, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'NumberOnly': - return super().__new__( - cls, - *_args, - JustNumber=JustNumber, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/number_only.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/number_only.pyi deleted file mode 100644 index 1fe492fe06e..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/number_only.pyi +++ /dev/null @@ -1,78 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class NumberOnly( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - JustNumber = schemas.NumberSchema - __annotations__ = { - "JustNumber": JustNumber, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["JustNumber"]) -> MetaOapg.properties.JustNumber: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["JustNumber", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["JustNumber"]) -> typing.Union[MetaOapg.properties.JustNumber, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["JustNumber", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - JustNumber: typing.Union[MetaOapg.properties.JustNumber, decimal.Decimal, int, float, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'NumberOnly': - return super().__new__( - cls, - *_args, - JustNumber=JustNumber, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/number_with_validations.py b/samples/openapi3/client/petstore/python/petstore_api/model/number_with_validations.py deleted file mode 100644 index f8b63e35856..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/number_with_validations.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class NumberWithValidations( - schemas.NumberSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - inclusive_maximum = 20 - inclusive_minimum = 10 diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/number_with_validations.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/number_with_validations.pyi deleted file mode 100644 index 4e92a920061..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/number_with_validations.pyi +++ /dev/null @@ -1,34 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class NumberWithValidations( - schemas.NumberSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - pass diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/object_interface.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/object_interface.pyi deleted file mode 100644 index 05dc6ddd565..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/object_interface.pyi +++ /dev/null @@ -1,24 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 -ObjectInterface = schemas.DictSchema diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/object_model_with_arg_and_args_properties.py b/samples/openapi3/client/petstore/python/petstore_api/model/object_model_with_arg_and_args_properties.py deleted file mode 100644 index 7e933ca8efc..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/object_model_with_arg_and_args_properties.py +++ /dev/null @@ -1,95 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ObjectModelWithArgAndArgsProperties( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "args", - "arg", - } - - class properties: - arg = schemas.StrSchema - args = schemas.StrSchema - __annotations__ = { - "arg": arg, - "args": args, - } - - args: MetaOapg.properties.args - arg: MetaOapg.properties.arg - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["arg"]) -> MetaOapg.properties.arg: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["args"]) -> MetaOapg.properties.args: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["arg", "args", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["arg"]) -> MetaOapg.properties.arg: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["args"]) -> MetaOapg.properties.args: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["arg", "args", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - args: typing.Union[MetaOapg.properties.args, str, ], - arg: typing.Union[MetaOapg.properties.arg, str, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ObjectModelWithArgAndArgsProperties': - return super().__new__( - cls, - *_args, - args=args, - arg=arg, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/object_model_with_arg_and_args_properties.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/object_model_with_arg_and_args_properties.pyi deleted file mode 100644 index 7e933ca8efc..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/object_model_with_arg_and_args_properties.pyi +++ /dev/null @@ -1,95 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ObjectModelWithArgAndArgsProperties( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "args", - "arg", - } - - class properties: - arg = schemas.StrSchema - args = schemas.StrSchema - __annotations__ = { - "arg": arg, - "args": args, - } - - args: MetaOapg.properties.args - arg: MetaOapg.properties.arg - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["arg"]) -> MetaOapg.properties.arg: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["args"]) -> MetaOapg.properties.args: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["arg", "args", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["arg"]) -> MetaOapg.properties.arg: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["args"]) -> MetaOapg.properties.args: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["arg", "args", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - args: typing.Union[MetaOapg.properties.args, str, ], - arg: typing.Union[MetaOapg.properties.arg, str, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ObjectModelWithArgAndArgsProperties': - return super().__new__( - cls, - *_args, - args=args, - arg=arg, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/object_model_with_ref_props.py b/samples/openapi3/client/petstore/python/petstore_api/model/object_model_with_ref_props.py deleted file mode 100644 index c8a6acc6e6a..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/object_model_with_ref_props.py +++ /dev/null @@ -1,105 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ObjectModelWithRefProps( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - a model that includes properties which should stay primitive (String + Boolean) and one which is defined as a class, NumberWithValidations - """ - - - class MetaOapg: - - class properties: - - @staticmethod - def myNumber() -> typing.Type['NumberWithValidations']: - return NumberWithValidations - myString = schemas.StrSchema - myBoolean = schemas.BoolSchema - __annotations__ = { - "myNumber": myNumber, - "myString": myString, - "myBoolean": myBoolean, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["myNumber"]) -> 'NumberWithValidations': ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["myString"]) -> MetaOapg.properties.myString: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["myBoolean"]) -> MetaOapg.properties.myBoolean: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["myNumber", "myString", "myBoolean", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["myNumber"]) -> typing.Union['NumberWithValidations', schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["myString"]) -> typing.Union[MetaOapg.properties.myString, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["myBoolean"]) -> typing.Union[MetaOapg.properties.myBoolean, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["myNumber", "myString", "myBoolean", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - myNumber: typing.Union['NumberWithValidations', schemas.Unset] = schemas.unset, - myString: typing.Union[MetaOapg.properties.myString, str, schemas.Unset] = schemas.unset, - myBoolean: typing.Union[MetaOapg.properties.myBoolean, bool, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ObjectModelWithRefProps': - return super().__new__( - cls, - *_args, - myNumber=myNumber, - myString=myString, - myBoolean=myBoolean, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.number_with_validations import NumberWithValidations diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/object_model_with_ref_props.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/object_model_with_ref_props.pyi deleted file mode 100644 index c8a6acc6e6a..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/object_model_with_ref_props.pyi +++ /dev/null @@ -1,105 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ObjectModelWithRefProps( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - a model that includes properties which should stay primitive (String + Boolean) and one which is defined as a class, NumberWithValidations - """ - - - class MetaOapg: - - class properties: - - @staticmethod - def myNumber() -> typing.Type['NumberWithValidations']: - return NumberWithValidations - myString = schemas.StrSchema - myBoolean = schemas.BoolSchema - __annotations__ = { - "myNumber": myNumber, - "myString": myString, - "myBoolean": myBoolean, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["myNumber"]) -> 'NumberWithValidations': ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["myString"]) -> MetaOapg.properties.myString: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["myBoolean"]) -> MetaOapg.properties.myBoolean: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["myNumber", "myString", "myBoolean", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["myNumber"]) -> typing.Union['NumberWithValidations', schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["myString"]) -> typing.Union[MetaOapg.properties.myString, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["myBoolean"]) -> typing.Union[MetaOapg.properties.myBoolean, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["myNumber", "myString", "myBoolean", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - myNumber: typing.Union['NumberWithValidations', schemas.Unset] = schemas.unset, - myString: typing.Union[MetaOapg.properties.myString, str, schemas.Unset] = schemas.unset, - myBoolean: typing.Union[MetaOapg.properties.myBoolean, bool, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ObjectModelWithRefProps': - return super().__new__( - cls, - *_args, - myNumber=myNumber, - myString=myString, - myBoolean=myBoolean, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.number_with_validations import NumberWithValidations diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/object_with_all_of_with_req_test_prop_from_unset_add_prop.py b/samples/openapi3/client/petstore/python/petstore_api/model/object_with_all_of_with_req_test_prop_from_unset_add_prop.py deleted file mode 100644 index 8e2e6d57fbf..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/object_with_all_of_with_req_test_prop_from_unset_add_prop.py +++ /dev/null @@ -1,124 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ObjectWithAllOfWithReqTestPropFromUnsetAddProp( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - class all_of_1( - schemas.DictSchema - ): - - - class MetaOapg: - required = { - "test", - } - - class properties: - name = schemas.StrSchema - __annotations__ = { - "name": name, - } - - test: schemas.AnyTypeSchema - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["name", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["name"]) -> typing.Union[MetaOapg.properties.name, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["name", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - test: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - name: typing.Union[MetaOapg.properties.name, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'all_of_1': - return super().__new__( - cls, - *_args, - test=test, - name=name, - _configuration=_configuration, - **kwargs, - ) - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - ObjectWithOptionalTestProp, - cls.all_of_1, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ObjectWithAllOfWithReqTestPropFromUnsetAddProp': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.object_with_optional_test_prop import ObjectWithOptionalTestProp diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/object_with_all_of_with_req_test_prop_from_unset_add_prop.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/object_with_all_of_with_req_test_prop_from_unset_add_prop.pyi deleted file mode 100644 index 8e2e6d57fbf..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/object_with_all_of_with_req_test_prop_from_unset_add_prop.pyi +++ /dev/null @@ -1,124 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ObjectWithAllOfWithReqTestPropFromUnsetAddProp( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - class all_of_1( - schemas.DictSchema - ): - - - class MetaOapg: - required = { - "test", - } - - class properties: - name = schemas.StrSchema - __annotations__ = { - "name": name, - } - - test: schemas.AnyTypeSchema - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["name", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["name"]) -> typing.Union[MetaOapg.properties.name, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["name", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - test: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - name: typing.Union[MetaOapg.properties.name, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'all_of_1': - return super().__new__( - cls, - *_args, - test=test, - name=name, - _configuration=_configuration, - **kwargs, - ) - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - ObjectWithOptionalTestProp, - cls.all_of_1, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ObjectWithAllOfWithReqTestPropFromUnsetAddProp': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.object_with_optional_test_prop import ObjectWithOptionalTestProp diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/object_with_decimal_properties.py b/samples/openapi3/client/petstore/python/petstore_api/model/object_with_decimal_properties.py deleted file mode 100644 index 0a7e9039310..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/object_with_decimal_properties.py +++ /dev/null @@ -1,103 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ObjectWithDecimalProperties( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - length = schemas.DecimalSchema - width = schemas.DecimalSchema - - @staticmethod - def cost() -> typing.Type['Money']: - return Money - __annotations__ = { - "length": length, - "width": width, - "cost": cost, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["length"]) -> MetaOapg.properties.length: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["width"]) -> MetaOapg.properties.width: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["cost"]) -> 'Money': ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["length", "width", "cost", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["length"]) -> typing.Union[MetaOapg.properties.length, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["width"]) -> typing.Union[MetaOapg.properties.width, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["cost"]) -> typing.Union['Money', schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["length", "width", "cost", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - length: typing.Union[MetaOapg.properties.length, str, schemas.Unset] = schemas.unset, - width: typing.Union[MetaOapg.properties.width, str, schemas.Unset] = schemas.unset, - cost: typing.Union['Money', schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ObjectWithDecimalProperties': - return super().__new__( - cls, - *_args, - length=length, - width=width, - cost=cost, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.money import Money diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/object_with_decimal_properties.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/object_with_decimal_properties.pyi deleted file mode 100644 index 0a7e9039310..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/object_with_decimal_properties.pyi +++ /dev/null @@ -1,103 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ObjectWithDecimalProperties( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - length = schemas.DecimalSchema - width = schemas.DecimalSchema - - @staticmethod - def cost() -> typing.Type['Money']: - return Money - __annotations__ = { - "length": length, - "width": width, - "cost": cost, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["length"]) -> MetaOapg.properties.length: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["width"]) -> MetaOapg.properties.width: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["cost"]) -> 'Money': ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["length", "width", "cost", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["length"]) -> typing.Union[MetaOapg.properties.length, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["width"]) -> typing.Union[MetaOapg.properties.width, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["cost"]) -> typing.Union['Money', schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["length", "width", "cost", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - length: typing.Union[MetaOapg.properties.length, str, schemas.Unset] = schemas.unset, - width: typing.Union[MetaOapg.properties.width, str, schemas.Unset] = schemas.unset, - cost: typing.Union['Money', schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ObjectWithDecimalProperties': - return super().__new__( - cls, - *_args, - length=length, - width=width, - cost=cost, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.money import Money diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/object_with_difficultly_named_props.py b/samples/openapi3/client/petstore/python/petstore_api/model/object_with_difficultly_named_props.py deleted file mode 100644 index 37f42e7b076..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/object_with_difficultly_named_props.py +++ /dev/null @@ -1,98 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ObjectWithDifficultlyNamedProps( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - model with properties that have invalid names for python - """ - - - class MetaOapg: - required = { - "123-list", - } - - class properties: - _123_list = schemas.StrSchema - special_property_name = schemas.Int64Schema - _123_number = schemas.IntSchema - __annotations__ = { - "123-list": _123_list, - "$special[property.name]": special_property_name, - "123Number": _123_number, - } - - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["123-list"]) -> MetaOapg.properties._123_list: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["$special[property.name]"]) -> MetaOapg.properties.special_property_name: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["123Number"]) -> MetaOapg.properties._123_number: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["123-list", "$special[property.name]", "123Number", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["123-list"]) -> MetaOapg.properties._123_list: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["$special[property.name]"]) -> typing.Union[MetaOapg.properties.special_property_name, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["123Number"]) -> typing.Union[MetaOapg.properties._123_number, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["123-list", "$special[property.name]", "123Number", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ObjectWithDifficultlyNamedProps': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/object_with_difficultly_named_props.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/object_with_difficultly_named_props.pyi deleted file mode 100644 index 37f42e7b076..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/object_with_difficultly_named_props.pyi +++ /dev/null @@ -1,98 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ObjectWithDifficultlyNamedProps( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - model with properties that have invalid names for python - """ - - - class MetaOapg: - required = { - "123-list", - } - - class properties: - _123_list = schemas.StrSchema - special_property_name = schemas.Int64Schema - _123_number = schemas.IntSchema - __annotations__ = { - "123-list": _123_list, - "$special[property.name]": special_property_name, - "123Number": _123_number, - } - - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["123-list"]) -> MetaOapg.properties._123_list: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["$special[property.name]"]) -> MetaOapg.properties.special_property_name: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["123Number"]) -> MetaOapg.properties._123_number: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["123-list", "$special[property.name]", "123Number", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["123-list"]) -> MetaOapg.properties._123_list: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["$special[property.name]"]) -> typing.Union[MetaOapg.properties.special_property_name, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["123Number"]) -> typing.Union[MetaOapg.properties._123_number, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["123-list", "$special[property.name]", "123Number", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ObjectWithDifficultlyNamedProps': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/object_with_inline_composition_property.py b/samples/openapi3/client/petstore/python/petstore_api/model/object_with_inline_composition_property.py deleted file mode 100644 index 9e3d9a17421..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/object_with_inline_composition_property.py +++ /dev/null @@ -1,122 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ObjectWithInlineCompositionProperty( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - - - class someProp( - schemas.ComposedSchema, - ): - - - class MetaOapg: - - - class all_of_0( - schemas.StrSchema - ): - - - class MetaOapg: - min_length = 1 - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.all_of_0, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'someProp': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - __annotations__ = { - "someProp": someProp, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["someProp"]) -> MetaOapg.properties.someProp: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["someProp", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["someProp"]) -> typing.Union[MetaOapg.properties.someProp, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["someProp", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - someProp: typing.Union[MetaOapg.properties.someProp, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ObjectWithInlineCompositionProperty': - return super().__new__( - cls, - *_args, - someProp=someProp, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/object_with_inline_composition_property.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/object_with_inline_composition_property.pyi deleted file mode 100644 index f1c85b1203f..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/object_with_inline_composition_property.pyi +++ /dev/null @@ -1,119 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ObjectWithInlineCompositionProperty( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - - - class someProp( - schemas.ComposedSchema, - ): - - - class MetaOapg: - - - class all_of_0( - schemas.StrSchema - ): - pass - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.all_of_0, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'someProp': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - __annotations__ = { - "someProp": someProp, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["someProp"]) -> MetaOapg.properties.someProp: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["someProp", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["someProp"]) -> typing.Union[MetaOapg.properties.someProp, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["someProp", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - someProp: typing.Union[MetaOapg.properties.someProp, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ObjectWithInlineCompositionProperty': - return super().__new__( - cls, - *_args, - someProp=someProp, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/object_with_invalid_named_refed_properties.py b/samples/openapi3/client/petstore/python/petstore_api/model/object_with_invalid_named_refed_properties.py deleted file mode 100644 index 4a2cff98032..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/object_with_invalid_named_refed_properties.py +++ /dev/null @@ -1,98 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ObjectWithInvalidNamedRefedProperties( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "!reference", - "from", - } - - class properties: - - @staticmethod - def _from() -> typing.Type['FromSchema']: - return FromSchema - - @staticmethod - def reference() -> typing.Type['ArrayWithValidationsInItems']: - return ArrayWithValidationsInItems - __annotations__ = { - "from": _from, - "!reference": reference, - } - - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["from"]) -> 'FromSchema': ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["!reference"]) -> 'ArrayWithValidationsInItems': ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["from", "!reference", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["from"]) -> 'FromSchema': ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["!reference"]) -> 'ArrayWithValidationsInItems': ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["from", "!reference", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ObjectWithInvalidNamedRefedProperties': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.array_with_validations_in_items import ArrayWithValidationsInItems -from petstore_api.model.from_schema import FromSchema diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/object_with_invalid_named_refed_properties.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/object_with_invalid_named_refed_properties.pyi deleted file mode 100644 index 4a2cff98032..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/object_with_invalid_named_refed_properties.pyi +++ /dev/null @@ -1,98 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ObjectWithInvalidNamedRefedProperties( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "!reference", - "from", - } - - class properties: - - @staticmethod - def _from() -> typing.Type['FromSchema']: - return FromSchema - - @staticmethod - def reference() -> typing.Type['ArrayWithValidationsInItems']: - return ArrayWithValidationsInItems - __annotations__ = { - "from": _from, - "!reference": reference, - } - - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["from"]) -> 'FromSchema': ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["!reference"]) -> 'ArrayWithValidationsInItems': ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["from", "!reference", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["from"]) -> 'FromSchema': ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["!reference"]) -> 'ArrayWithValidationsInItems': ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["from", "!reference", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ObjectWithInvalidNamedRefedProperties': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.array_with_validations_in_items import ArrayWithValidationsInItems -from petstore_api.model.from_schema import FromSchema diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/object_with_optional_test_prop.py b/samples/openapi3/client/petstore/python/petstore_api/model/object_with_optional_test_prop.py deleted file mode 100644 index 9a75d3bd022..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/object_with_optional_test_prop.py +++ /dev/null @@ -1,78 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ObjectWithOptionalTestProp( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - test = schemas.StrSchema - __annotations__ = { - "test": test, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["test"]) -> MetaOapg.properties.test: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["test", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["test"]) -> typing.Union[MetaOapg.properties.test, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["test", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - test: typing.Union[MetaOapg.properties.test, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ObjectWithOptionalTestProp': - return super().__new__( - cls, - *_args, - test=test, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/object_with_optional_test_prop.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/object_with_optional_test_prop.pyi deleted file mode 100644 index 9a75d3bd022..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/object_with_optional_test_prop.pyi +++ /dev/null @@ -1,78 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ObjectWithOptionalTestProp( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - test = schemas.StrSchema - __annotations__ = { - "test": test, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["test"]) -> MetaOapg.properties.test: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["test", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["test"]) -> typing.Union[MetaOapg.properties.test, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["test", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - test: typing.Union[MetaOapg.properties.test, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ObjectWithOptionalTestProp': - return super().__new__( - cls, - *_args, - test=test, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/object_with_validations.py b/samples/openapi3/client/petstore/python/petstore_api/model/object_with_validations.py deleted file mode 100644 index 474721b0401..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/object_with_validations.py +++ /dev/null @@ -1,50 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ObjectWithValidations( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - min_properties = 2 - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ObjectWithValidations': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/object_with_validations.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/object_with_validations.pyi deleted file mode 100644 index d1937c96fa0..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/object_with_validations.pyi +++ /dev/null @@ -1,46 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ObjectWithValidations( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ObjectWithValidations': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/order.py b/samples/openapi3/client/petstore/python/petstore_api/model/order.py deleted file mode 100644 index 83a587222a1..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/order.py +++ /dev/null @@ -1,153 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Order( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - id = schemas.Int64Schema - petId = schemas.Int64Schema - quantity = schemas.Int32Schema - shipDate = schemas.DateTimeSchema - - - class status( - schemas.EnumBase, - schemas.StrSchema - ): - - - class MetaOapg: - enum_value_to_name = { - "placed": "PLACED", - "approved": "APPROVED", - "delivered": "DELIVERED", - } - - @schemas.classproperty - def PLACED(cls): - return cls("placed") - - @schemas.classproperty - def APPROVED(cls): - return cls("approved") - - @schemas.classproperty - def DELIVERED(cls): - return cls("delivered") - complete = schemas.BoolSchema - __annotations__ = { - "id": id, - "petId": petId, - "quantity": quantity, - "shipDate": shipDate, - "status": status, - "complete": complete, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["id"]) -> MetaOapg.properties.id: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["petId"]) -> MetaOapg.properties.petId: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["quantity"]) -> MetaOapg.properties.quantity: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["shipDate"]) -> MetaOapg.properties.shipDate: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["status"]) -> MetaOapg.properties.status: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["complete"]) -> MetaOapg.properties.complete: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["id", "petId", "quantity", "shipDate", "status", "complete", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["id"]) -> typing.Union[MetaOapg.properties.id, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["petId"]) -> typing.Union[MetaOapg.properties.petId, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["quantity"]) -> typing.Union[MetaOapg.properties.quantity, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["shipDate"]) -> typing.Union[MetaOapg.properties.shipDate, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["status"]) -> typing.Union[MetaOapg.properties.status, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["complete"]) -> typing.Union[MetaOapg.properties.complete, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["id", "petId", "quantity", "shipDate", "status", "complete", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - id: typing.Union[MetaOapg.properties.id, decimal.Decimal, int, schemas.Unset] = schemas.unset, - petId: typing.Union[MetaOapg.properties.petId, decimal.Decimal, int, schemas.Unset] = schemas.unset, - quantity: typing.Union[MetaOapg.properties.quantity, decimal.Decimal, int, schemas.Unset] = schemas.unset, - shipDate: typing.Union[MetaOapg.properties.shipDate, str, datetime, schemas.Unset] = schemas.unset, - status: typing.Union[MetaOapg.properties.status, str, schemas.Unset] = schemas.unset, - complete: typing.Union[MetaOapg.properties.complete, bool, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Order': - return super().__new__( - cls, - *_args, - id=id, - petId=petId, - quantity=quantity, - shipDate=shipDate, - status=status, - complete=complete, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/order.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/order.pyi deleted file mode 100644 index 61ac9cf6f63..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/order.pyi +++ /dev/null @@ -1,145 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Order( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - id = schemas.Int64Schema - petId = schemas.Int64Schema - quantity = schemas.Int32Schema - shipDate = schemas.DateTimeSchema - - - class status( - schemas.EnumBase, - schemas.StrSchema - ): - - @schemas.classproperty - def PLACED(cls): - return cls("placed") - - @schemas.classproperty - def APPROVED(cls): - return cls("approved") - - @schemas.classproperty - def DELIVERED(cls): - return cls("delivered") - complete = schemas.BoolSchema - __annotations__ = { - "id": id, - "petId": petId, - "quantity": quantity, - "shipDate": shipDate, - "status": status, - "complete": complete, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["id"]) -> MetaOapg.properties.id: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["petId"]) -> MetaOapg.properties.petId: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["quantity"]) -> MetaOapg.properties.quantity: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["shipDate"]) -> MetaOapg.properties.shipDate: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["status"]) -> MetaOapg.properties.status: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["complete"]) -> MetaOapg.properties.complete: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["id", "petId", "quantity", "shipDate", "status", "complete", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["id"]) -> typing.Union[MetaOapg.properties.id, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["petId"]) -> typing.Union[MetaOapg.properties.petId, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["quantity"]) -> typing.Union[MetaOapg.properties.quantity, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["shipDate"]) -> typing.Union[MetaOapg.properties.shipDate, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["status"]) -> typing.Union[MetaOapg.properties.status, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["complete"]) -> typing.Union[MetaOapg.properties.complete, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["id", "petId", "quantity", "shipDate", "status", "complete", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - id: typing.Union[MetaOapg.properties.id, decimal.Decimal, int, schemas.Unset] = schemas.unset, - petId: typing.Union[MetaOapg.properties.petId, decimal.Decimal, int, schemas.Unset] = schemas.unset, - quantity: typing.Union[MetaOapg.properties.quantity, decimal.Decimal, int, schemas.Unset] = schemas.unset, - shipDate: typing.Union[MetaOapg.properties.shipDate, str, datetime, schemas.Unset] = schemas.unset, - status: typing.Union[MetaOapg.properties.status, str, schemas.Unset] = schemas.unset, - complete: typing.Union[MetaOapg.properties.complete, bool, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Order': - return super().__new__( - cls, - *_args, - id=id, - petId=petId, - quantity=quantity, - shipDate=shipDate, - status=status, - complete=complete, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/parent_pet.py b/samples/openapi3/client/petstore/python/petstore_api/model/parent_pet.py deleted file mode 100644 index 6988fb92ef7..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/parent_pet.py +++ /dev/null @@ -1,76 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ParentPet( - schemas.ComposedBase, - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - @staticmethod - def discriminator(): - return { - 'pet_type': { - 'ChildCat': ChildCat, - } - } - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - GrandparentAnimal, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ParentPet': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.child_cat import ChildCat -from petstore_api.model.grandparent_animal import GrandparentAnimal diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/parent_pet.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/parent_pet.pyi deleted file mode 100644 index 6988fb92ef7..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/parent_pet.pyi +++ /dev/null @@ -1,76 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ParentPet( - schemas.ComposedBase, - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - @staticmethod - def discriminator(): - return { - 'pet_type': { - 'ChildCat': ChildCat, - } - } - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - GrandparentAnimal, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ParentPet': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.child_cat import ChildCat -from petstore_api.model.grandparent_animal import GrandparentAnimal diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/pet.py b/samples/openapi3/client/petstore/python/petstore_api/model/pet.py deleted file mode 100644 index 4a9b5902024..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/pet.py +++ /dev/null @@ -1,215 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Pet( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Pet object that needs to be added to the store - """ - - - class MetaOapg: - required = { - "photoUrls", - "name", - } - - class properties: - name = schemas.StrSchema - - - class photoUrls( - schemas.ListSchema - ): - - - class MetaOapg: - items = schemas.StrSchema - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, str, ]], typing.List[typing.Union[MetaOapg.items, str, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'photoUrls': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - id = schemas.Int64Schema - - @staticmethod - def category() -> typing.Type['Category']: - return Category - - - class tags( - schemas.ListSchema - ): - - - class MetaOapg: - - @staticmethod - def items() -> typing.Type['Tag']: - return Tag - - def __new__( - cls, - _arg: typing.Union[typing.Tuple['Tag'], typing.List['Tag']], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'tags': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> 'Tag': - return super().__getitem__(i) - - - class status( - schemas.EnumBase, - schemas.StrSchema - ): - - - class MetaOapg: - enum_value_to_name = { - "available": "AVAILABLE", - "pending": "PENDING", - "sold": "SOLD", - } - - @schemas.classproperty - def AVAILABLE(cls): - return cls("available") - - @schemas.classproperty - def PENDING(cls): - return cls("pending") - - @schemas.classproperty - def SOLD(cls): - return cls("sold") - __annotations__ = { - "name": name, - "photoUrls": photoUrls, - "id": id, - "category": category, - "tags": tags, - "status": status, - } - - photoUrls: MetaOapg.properties.photoUrls - name: MetaOapg.properties.name - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["photoUrls"]) -> MetaOapg.properties.photoUrls: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["id"]) -> MetaOapg.properties.id: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["category"]) -> 'Category': ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["tags"]) -> MetaOapg.properties.tags: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["status"]) -> MetaOapg.properties.status: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["name", "photoUrls", "id", "category", "tags", "status", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["photoUrls"]) -> MetaOapg.properties.photoUrls: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["id"]) -> typing.Union[MetaOapg.properties.id, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["category"]) -> typing.Union['Category', schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["tags"]) -> typing.Union[MetaOapg.properties.tags, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["status"]) -> typing.Union[MetaOapg.properties.status, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["name", "photoUrls", "id", "category", "tags", "status", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - photoUrls: typing.Union[MetaOapg.properties.photoUrls, list, tuple, ], - name: typing.Union[MetaOapg.properties.name, str, ], - id: typing.Union[MetaOapg.properties.id, decimal.Decimal, int, schemas.Unset] = schemas.unset, - category: typing.Union['Category', schemas.Unset] = schemas.unset, - tags: typing.Union[MetaOapg.properties.tags, list, tuple, schemas.Unset] = schemas.unset, - status: typing.Union[MetaOapg.properties.status, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Pet': - return super().__new__( - cls, - *_args, - photoUrls=photoUrls, - name=name, - id=id, - category=category, - tags=tags, - status=status, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.category import Category -from petstore_api.model.tag import Tag diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/pet.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/pet.pyi deleted file mode 100644 index e0a7276e144..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/pet.pyi +++ /dev/null @@ -1,207 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Pet( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Pet object that needs to be added to the store - """ - - - class MetaOapg: - required = { - "photoUrls", - "name", - } - - class properties: - name = schemas.StrSchema - - - class photoUrls( - schemas.ListSchema - ): - - - class MetaOapg: - items = schemas.StrSchema - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, str, ]], typing.List[typing.Union[MetaOapg.items, str, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'photoUrls': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - id = schemas.Int64Schema - - @staticmethod - def category() -> typing.Type['Category']: - return Category - - - class tags( - schemas.ListSchema - ): - - - class MetaOapg: - - @staticmethod - def items() -> typing.Type['Tag']: - return Tag - - def __new__( - cls, - _arg: typing.Union[typing.Tuple['Tag'], typing.List['Tag']], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'tags': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> 'Tag': - return super().__getitem__(i) - - - class status( - schemas.EnumBase, - schemas.StrSchema - ): - - @schemas.classproperty - def AVAILABLE(cls): - return cls("available") - - @schemas.classproperty - def PENDING(cls): - return cls("pending") - - @schemas.classproperty - def SOLD(cls): - return cls("sold") - __annotations__ = { - "name": name, - "photoUrls": photoUrls, - "id": id, - "category": category, - "tags": tags, - "status": status, - } - - photoUrls: MetaOapg.properties.photoUrls - name: MetaOapg.properties.name - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["photoUrls"]) -> MetaOapg.properties.photoUrls: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["id"]) -> MetaOapg.properties.id: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["category"]) -> 'Category': ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["tags"]) -> MetaOapg.properties.tags: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["status"]) -> MetaOapg.properties.status: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["name", "photoUrls", "id", "category", "tags", "status", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["photoUrls"]) -> MetaOapg.properties.photoUrls: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["id"]) -> typing.Union[MetaOapg.properties.id, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["category"]) -> typing.Union['Category', schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["tags"]) -> typing.Union[MetaOapg.properties.tags, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["status"]) -> typing.Union[MetaOapg.properties.status, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["name", "photoUrls", "id", "category", "tags", "status", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - photoUrls: typing.Union[MetaOapg.properties.photoUrls, list, tuple, ], - name: typing.Union[MetaOapg.properties.name, str, ], - id: typing.Union[MetaOapg.properties.id, decimal.Decimal, int, schemas.Unset] = schemas.unset, - category: typing.Union['Category', schemas.Unset] = schemas.unset, - tags: typing.Union[MetaOapg.properties.tags, list, tuple, schemas.Unset] = schemas.unset, - status: typing.Union[MetaOapg.properties.status, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Pet': - return super().__new__( - cls, - *_args, - photoUrls=photoUrls, - name=name, - id=id, - category=category, - tags=tags, - status=status, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.category import Category -from petstore_api.model.tag import Tag diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/pig.py b/samples/openapi3/client/petstore/python/petstore_api/model/pig.py deleted file mode 100644 index 55fd75d15dc..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/pig.py +++ /dev/null @@ -1,77 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Pig( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - @staticmethod - def discriminator(): - return { - 'className': { - 'BasquePig': BasquePig, - 'DanishPig': DanishPig, - } - } - - @classmethod - @functools.lru_cache() - def one_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - BasquePig, - DanishPig, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Pig': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.basque_pig import BasquePig -from petstore_api.model.danish_pig import DanishPig diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/pig.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/pig.pyi deleted file mode 100644 index 55fd75d15dc..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/pig.pyi +++ /dev/null @@ -1,77 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Pig( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - @staticmethod - def discriminator(): - return { - 'className': { - 'BasquePig': BasquePig, - 'DanishPig': DanishPig, - } - } - - @classmethod - @functools.lru_cache() - def one_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - BasquePig, - DanishPig, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Pig': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.basque_pig import BasquePig -from petstore_api.model.danish_pig import DanishPig diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/player.py b/samples/openapi3/client/petstore/python/petstore_api/model/player.py deleted file mode 100644 index 832a0af4697..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/player.py +++ /dev/null @@ -1,93 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Player( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - a model that includes a self reference this forces properties and additionalProperties to be lazy loaded in python models because the Player class has not fully loaded when defining properties - """ - - - class MetaOapg: - - class properties: - name = schemas.StrSchema - - @staticmethod - def enemyPlayer() -> typing.Type['Player']: - return Player - __annotations__ = { - "name": name, - "enemyPlayer": enemyPlayer, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["enemyPlayer"]) -> 'Player': ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["name", "enemyPlayer", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["name"]) -> typing.Union[MetaOapg.properties.name, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["enemyPlayer"]) -> typing.Union['Player', schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["name", "enemyPlayer", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - name: typing.Union[MetaOapg.properties.name, str, schemas.Unset] = schemas.unset, - enemyPlayer: typing.Union['Player', schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Player': - return super().__new__( - cls, - *_args, - name=name, - enemyPlayer=enemyPlayer, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/player.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/player.pyi deleted file mode 100644 index 832a0af4697..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/player.pyi +++ /dev/null @@ -1,93 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Player( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - a model that includes a self reference this forces properties and additionalProperties to be lazy loaded in python models because the Player class has not fully loaded when defining properties - """ - - - class MetaOapg: - - class properties: - name = schemas.StrSchema - - @staticmethod - def enemyPlayer() -> typing.Type['Player']: - return Player - __annotations__ = { - "name": name, - "enemyPlayer": enemyPlayer, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["enemyPlayer"]) -> 'Player': ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["name", "enemyPlayer", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["name"]) -> typing.Union[MetaOapg.properties.name, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["enemyPlayer"]) -> typing.Union['Player', schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["name", "enemyPlayer", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - name: typing.Union[MetaOapg.properties.name, str, schemas.Unset] = schemas.unset, - enemyPlayer: typing.Union['Player', schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Player': - return super().__new__( - cls, - *_args, - name=name, - enemyPlayer=enemyPlayer, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/quadrilateral.py b/samples/openapi3/client/petstore/python/petstore_api/model/quadrilateral.py deleted file mode 100644 index 757991e0b89..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/quadrilateral.py +++ /dev/null @@ -1,77 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Quadrilateral( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - @staticmethod - def discriminator(): - return { - 'quadrilateralType': { - 'ComplexQuadrilateral': ComplexQuadrilateral, - 'SimpleQuadrilateral': SimpleQuadrilateral, - } - } - - @classmethod - @functools.lru_cache() - def one_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - SimpleQuadrilateral, - ComplexQuadrilateral, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Quadrilateral': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.complex_quadrilateral import ComplexQuadrilateral -from petstore_api.model.simple_quadrilateral import SimpleQuadrilateral diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/quadrilateral.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/quadrilateral.pyi deleted file mode 100644 index 757991e0b89..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/quadrilateral.pyi +++ /dev/null @@ -1,77 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Quadrilateral( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - @staticmethod - def discriminator(): - return { - 'quadrilateralType': { - 'ComplexQuadrilateral': ComplexQuadrilateral, - 'SimpleQuadrilateral': SimpleQuadrilateral, - } - } - - @classmethod - @functools.lru_cache() - def one_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - SimpleQuadrilateral, - ComplexQuadrilateral, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Quadrilateral': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.complex_quadrilateral import ComplexQuadrilateral -from petstore_api.model.simple_quadrilateral import SimpleQuadrilateral diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/quadrilateral_interface.py b/samples/openapi3/client/petstore/python/petstore_api/model/quadrilateral_interface.py deleted file mode 100644 index 2370a2a9945..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/quadrilateral_interface.py +++ /dev/null @@ -1,111 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class QuadrilateralInterface( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "shapeType", - "quadrilateralType", - } - - class properties: - - - class shapeType( - schemas.EnumBase, - schemas.StrSchema - ): - - - class MetaOapg: - enum_value_to_name = { - "Quadrilateral": "QUADRILATERAL", - } - - @schemas.classproperty - def QUADRILATERAL(cls): - return cls("Quadrilateral") - quadrilateralType = schemas.StrSchema - __annotations__ = { - "shapeType": shapeType, - "quadrilateralType": quadrilateralType, - } - - - shapeType: MetaOapg.properties.shapeType - quadrilateralType: MetaOapg.properties.quadrilateralType - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["shapeType"]) -> MetaOapg.properties.shapeType: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["quadrilateralType"]) -> MetaOapg.properties.quadrilateralType: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["shapeType", "quadrilateralType", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["shapeType"]) -> MetaOapg.properties.shapeType: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["quadrilateralType"]) -> MetaOapg.properties.quadrilateralType: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["shapeType", "quadrilateralType", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - shapeType: typing.Union[MetaOapg.properties.shapeType, str, ], - quadrilateralType: typing.Union[MetaOapg.properties.quadrilateralType, str, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'QuadrilateralInterface': - return super().__new__( - cls, - *_args, - shapeType=shapeType, - quadrilateralType=quadrilateralType, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/quadrilateral_interface.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/quadrilateral_interface.pyi deleted file mode 100644 index 0cf90d53917..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/quadrilateral_interface.pyi +++ /dev/null @@ -1,105 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class QuadrilateralInterface( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "shapeType", - "quadrilateralType", - } - - class properties: - - - class shapeType( - schemas.EnumBase, - schemas.StrSchema - ): - - @schemas.classproperty - def QUADRILATERAL(cls): - return cls("Quadrilateral") - quadrilateralType = schemas.StrSchema - __annotations__ = { - "shapeType": shapeType, - "quadrilateralType": quadrilateralType, - } - - - shapeType: MetaOapg.properties.shapeType - quadrilateralType: MetaOapg.properties.quadrilateralType - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["shapeType"]) -> MetaOapg.properties.shapeType: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["quadrilateralType"]) -> MetaOapg.properties.quadrilateralType: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["shapeType", "quadrilateralType", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["shapeType"]) -> MetaOapg.properties.shapeType: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["quadrilateralType"]) -> MetaOapg.properties.quadrilateralType: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["shapeType", "quadrilateralType", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - shapeType: typing.Union[MetaOapg.properties.shapeType, str, ], - quadrilateralType: typing.Union[MetaOapg.properties.quadrilateralType, str, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'QuadrilateralInterface': - return super().__new__( - cls, - *_args, - shapeType=shapeType, - quadrilateralType=quadrilateralType, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/read_only_first.py b/samples/openapi3/client/petstore/python/petstore_api/model/read_only_first.py deleted file mode 100644 index 8636a04494b..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/read_only_first.py +++ /dev/null @@ -1,88 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ReadOnlyFirst( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - bar = schemas.StrSchema - baz = schemas.StrSchema - __annotations__ = { - "bar": bar, - "baz": baz, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["bar"]) -> MetaOapg.properties.bar: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["baz"]) -> MetaOapg.properties.baz: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["bar", "baz", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["bar"]) -> typing.Union[MetaOapg.properties.bar, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["baz"]) -> typing.Union[MetaOapg.properties.baz, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["bar", "baz", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - bar: typing.Union[MetaOapg.properties.bar, str, schemas.Unset] = schemas.unset, - baz: typing.Union[MetaOapg.properties.baz, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ReadOnlyFirst': - return super().__new__( - cls, - *_args, - bar=bar, - baz=baz, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/read_only_first.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/read_only_first.pyi deleted file mode 100644 index 8636a04494b..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/read_only_first.pyi +++ /dev/null @@ -1,88 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ReadOnlyFirst( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - bar = schemas.StrSchema - baz = schemas.StrSchema - __annotations__ = { - "bar": bar, - "baz": baz, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["bar"]) -> MetaOapg.properties.bar: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["baz"]) -> MetaOapg.properties.baz: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["bar", "baz", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["bar"]) -> typing.Union[MetaOapg.properties.bar, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["baz"]) -> typing.Union[MetaOapg.properties.baz, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["bar", "baz", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - bar: typing.Union[MetaOapg.properties.bar, str, schemas.Unset] = schemas.unset, - baz: typing.Union[MetaOapg.properties.baz, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ReadOnlyFirst': - return super().__new__( - cls, - *_args, - bar=bar, - baz=baz, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/scalene_triangle.py b/samples/openapi3/client/petstore/python/petstore_api/model/scalene_triangle.py deleted file mode 100644 index 2bb4e44cf5d..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/scalene_triangle.py +++ /dev/null @@ -1,132 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ScaleneTriangle( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - class all_of_1( - schemas.DictSchema - ): - - - class MetaOapg: - - class properties: - - - class triangleType( - schemas.EnumBase, - schemas.StrSchema - ): - - - class MetaOapg: - enum_value_to_name = { - "ScaleneTriangle": "SCALENE_TRIANGLE", - } - - @schemas.classproperty - def SCALENE_TRIANGLE(cls): - return cls("ScaleneTriangle") - __annotations__ = { - "triangleType": triangleType, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["triangleType"]) -> MetaOapg.properties.triangleType: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["triangleType", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["triangleType"]) -> typing.Union[MetaOapg.properties.triangleType, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["triangleType", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - triangleType: typing.Union[MetaOapg.properties.triangleType, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'all_of_1': - return super().__new__( - cls, - *_args, - triangleType=triangleType, - _configuration=_configuration, - **kwargs, - ) - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - TriangleInterface, - cls.all_of_1, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ScaleneTriangle': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.triangle_interface import TriangleInterface diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/scalene_triangle.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/scalene_triangle.pyi deleted file mode 100644 index 7411424cfa4..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/scalene_triangle.pyi +++ /dev/null @@ -1,126 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ScaleneTriangle( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - class all_of_1( - schemas.DictSchema - ): - - - class MetaOapg: - - class properties: - - - class triangleType( - schemas.EnumBase, - schemas.StrSchema - ): - - @schemas.classproperty - def SCALENE_TRIANGLE(cls): - return cls("ScaleneTriangle") - __annotations__ = { - "triangleType": triangleType, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["triangleType"]) -> MetaOapg.properties.triangleType: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["triangleType", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["triangleType"]) -> typing.Union[MetaOapg.properties.triangleType, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["triangleType", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - triangleType: typing.Union[MetaOapg.properties.triangleType, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'all_of_1': - return super().__new__( - cls, - *_args, - triangleType=triangleType, - _configuration=_configuration, - **kwargs, - ) - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - TriangleInterface, - cls.all_of_1, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ScaleneTriangle': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.triangle_interface import TriangleInterface diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/shape.py b/samples/openapi3/client/petstore/python/petstore_api/model/shape.py deleted file mode 100644 index 59fb712a683..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/shape.py +++ /dev/null @@ -1,77 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Shape( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - @staticmethod - def discriminator(): - return { - 'shapeType': { - 'Quadrilateral': Quadrilateral, - 'Triangle': Triangle, - } - } - - @classmethod - @functools.lru_cache() - def one_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - Triangle, - Quadrilateral, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Shape': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.quadrilateral import Quadrilateral -from petstore_api.model.triangle import Triangle diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/shape.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/shape.pyi deleted file mode 100644 index 59fb712a683..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/shape.pyi +++ /dev/null @@ -1,77 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Shape( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - @staticmethod - def discriminator(): - return { - 'shapeType': { - 'Quadrilateral': Quadrilateral, - 'Triangle': Triangle, - } - } - - @classmethod - @functools.lru_cache() - def one_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - Triangle, - Quadrilateral, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Shape': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.quadrilateral import Quadrilateral -from petstore_api.model.triangle import Triangle diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/shape_or_null.py b/samples/openapi3/client/petstore/python/petstore_api/model/shape_or_null.py deleted file mode 100644 index 8481fb3a8de..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/shape_or_null.py +++ /dev/null @@ -1,81 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ShapeOrNull( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - The value may be a shape or the 'null' value. This is introduced in OAS schema >= 3.1. - """ - - - class MetaOapg: - - @staticmethod - def discriminator(): - return { - 'shapeType': { - 'Quadrilateral': Quadrilateral, - 'Triangle': Triangle, - } - } - one_of_0 = schemas.NoneSchema - - @classmethod - @functools.lru_cache() - def one_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.one_of_0, - Triangle, - Quadrilateral, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ShapeOrNull': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.quadrilateral import Quadrilateral -from petstore_api.model.triangle import Triangle diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/shape_or_null.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/shape_or_null.pyi deleted file mode 100644 index 8481fb3a8de..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/shape_or_null.pyi +++ /dev/null @@ -1,81 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ShapeOrNull( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - The value may be a shape or the 'null' value. This is introduced in OAS schema >= 3.1. - """ - - - class MetaOapg: - - @staticmethod - def discriminator(): - return { - 'shapeType': { - 'Quadrilateral': Quadrilateral, - 'Triangle': Triangle, - } - } - one_of_0 = schemas.NoneSchema - - @classmethod - @functools.lru_cache() - def one_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.one_of_0, - Triangle, - Quadrilateral, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ShapeOrNull': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.quadrilateral import Quadrilateral -from petstore_api.model.triangle import Triangle diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/simple_quadrilateral.py b/samples/openapi3/client/petstore/python/petstore_api/model/simple_quadrilateral.py deleted file mode 100644 index b7037f9a543..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/simple_quadrilateral.py +++ /dev/null @@ -1,132 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class SimpleQuadrilateral( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - class all_of_1( - schemas.DictSchema - ): - - - class MetaOapg: - - class properties: - - - class quadrilateralType( - schemas.EnumBase, - schemas.StrSchema - ): - - - class MetaOapg: - enum_value_to_name = { - "SimpleQuadrilateral": "SIMPLE_QUADRILATERAL", - } - - @schemas.classproperty - def SIMPLE_QUADRILATERAL(cls): - return cls("SimpleQuadrilateral") - __annotations__ = { - "quadrilateralType": quadrilateralType, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["quadrilateralType"]) -> MetaOapg.properties.quadrilateralType: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["quadrilateralType", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["quadrilateralType"]) -> typing.Union[MetaOapg.properties.quadrilateralType, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["quadrilateralType", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - quadrilateralType: typing.Union[MetaOapg.properties.quadrilateralType, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'all_of_1': - return super().__new__( - cls, - *_args, - quadrilateralType=quadrilateralType, - _configuration=_configuration, - **kwargs, - ) - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - QuadrilateralInterface, - cls.all_of_1, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SimpleQuadrilateral': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.quadrilateral_interface import QuadrilateralInterface diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/simple_quadrilateral.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/simple_quadrilateral.pyi deleted file mode 100644 index 5c0b4007b85..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/simple_quadrilateral.pyi +++ /dev/null @@ -1,126 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class SimpleQuadrilateral( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - class all_of_1( - schemas.DictSchema - ): - - - class MetaOapg: - - class properties: - - - class quadrilateralType( - schemas.EnumBase, - schemas.StrSchema - ): - - @schemas.classproperty - def SIMPLE_QUADRILATERAL(cls): - return cls("SimpleQuadrilateral") - __annotations__ = { - "quadrilateralType": quadrilateralType, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["quadrilateralType"]) -> MetaOapg.properties.quadrilateralType: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["quadrilateralType", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["quadrilateralType"]) -> typing.Union[MetaOapg.properties.quadrilateralType, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["quadrilateralType", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - quadrilateralType: typing.Union[MetaOapg.properties.quadrilateralType, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'all_of_1': - return super().__new__( - cls, - *_args, - quadrilateralType=quadrilateralType, - _configuration=_configuration, - **kwargs, - ) - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - QuadrilateralInterface, - cls.all_of_1, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SimpleQuadrilateral': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.quadrilateral_interface import QuadrilateralInterface diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/some_object.py b/samples/openapi3/client/petstore/python/petstore_api/model/some_object.py deleted file mode 100644 index 6bab0aa21be..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/some_object.py +++ /dev/null @@ -1,66 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class SomeObject( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - ObjectInterface, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SomeObject': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.object_interface import ObjectInterface diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/some_object.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/some_object.pyi deleted file mode 100644 index 6bab0aa21be..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/some_object.pyi +++ /dev/null @@ -1,66 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class SomeObject( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - ObjectInterface, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SomeObject': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.object_interface import ObjectInterface diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/special_model_name.py b/samples/openapi3/client/petstore/python/petstore_api/model/special_model_name.py deleted file mode 100644 index cf21054ba50..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/special_model_name.py +++ /dev/null @@ -1,80 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class SpecialModelName( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - model with an invalid class name for python - """ - - - class MetaOapg: - - class properties: - a = schemas.StrSchema - __annotations__ = { - "a": a, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["a"]) -> MetaOapg.properties.a: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["a", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["a"]) -> typing.Union[MetaOapg.properties.a, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["a", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - a: typing.Union[MetaOapg.properties.a, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SpecialModelName': - return super().__new__( - cls, - *_args, - a=a, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/special_model_name.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/special_model_name.pyi deleted file mode 100644 index cf21054ba50..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/special_model_name.pyi +++ /dev/null @@ -1,80 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class SpecialModelName( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - model with an invalid class name for python - """ - - - class MetaOapg: - - class properties: - a = schemas.StrSchema - __annotations__ = { - "a": a, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["a"]) -> MetaOapg.properties.a: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["a", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["a"]) -> typing.Union[MetaOapg.properties.a, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["a", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - a: typing.Union[MetaOapg.properties.a, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SpecialModelName': - return super().__new__( - cls, - *_args, - a=a, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/string.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/string.pyi deleted file mode 100644 index 9e0907b4269..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/string.pyi +++ /dev/null @@ -1,24 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 -String = schemas.StrSchema diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/string_boolean_map.py b/samples/openapi3/client/petstore/python/petstore_api/model/string_boolean_map.py deleted file mode 100644 index 005f6d1ade7..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/string_boolean_map.py +++ /dev/null @@ -1,57 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class StringBooleanMap( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - additional_properties = schemas.BoolSchema - - def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, bool, ], - ) -> 'StringBooleanMap': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/string_boolean_map.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/string_boolean_map.pyi deleted file mode 100644 index 005f6d1ade7..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/string_boolean_map.pyi +++ /dev/null @@ -1,57 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class StringBooleanMap( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - additional_properties = schemas.BoolSchema - - def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, bool, ], - ) -> 'StringBooleanMap': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/string_enum.py b/samples/openapi3/client/petstore/python/petstore_api/model/string_enum.py deleted file mode 100644 index 0f3c2561625..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/string_enum.py +++ /dev/null @@ -1,89 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class StringEnum( - schemas.EnumBase, - schemas.StrBase, - schemas.NoneBase, - schemas.Schema, - schemas.NoneStrMixin -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - enum_value_to_name = { - "placed": "PLACED", - "approved": "APPROVED", - "delivered": "DELIVERED", - "single quoted": "SINGLE_QUOTED", - "multiple\nlines": "MULTIPLE_LINES", - "double quote \n with newline": "DOUBLE_QUOTE_WITH_NEWLINE", - schemas.NoneClass.NONE: "NONE", - } - - @schemas.classproperty - def PLACED(cls): - return cls("placed") - - @schemas.classproperty - def APPROVED(cls): - return cls("approved") - - @schemas.classproperty - def DELIVERED(cls): - return cls("delivered") - - @schemas.classproperty - def SINGLE_QUOTED(cls): - return cls("single quoted") - - @schemas.classproperty - def MULTIPLE_LINES(cls): - return cls("multiple\nlines") - - @schemas.classproperty - def DOUBLE_QUOTE_WITH_NEWLINE(cls): - return cls("double quote \n with newline") - - @schemas.classproperty - def NONE(cls): - return cls(None) - - - def __new__( - cls, - *_args: typing.Union[None, str, ], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'StringEnum': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/string_enum.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/string_enum.pyi deleted file mode 100644 index 0f3c2561625..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/string_enum.pyi +++ /dev/null @@ -1,89 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class StringEnum( - schemas.EnumBase, - schemas.StrBase, - schemas.NoneBase, - schemas.Schema, - schemas.NoneStrMixin -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - enum_value_to_name = { - "placed": "PLACED", - "approved": "APPROVED", - "delivered": "DELIVERED", - "single quoted": "SINGLE_QUOTED", - "multiple\nlines": "MULTIPLE_LINES", - "double quote \n with newline": "DOUBLE_QUOTE_WITH_NEWLINE", - schemas.NoneClass.NONE: "NONE", - } - - @schemas.classproperty - def PLACED(cls): - return cls("placed") - - @schemas.classproperty - def APPROVED(cls): - return cls("approved") - - @schemas.classproperty - def DELIVERED(cls): - return cls("delivered") - - @schemas.classproperty - def SINGLE_QUOTED(cls): - return cls("single quoted") - - @schemas.classproperty - def MULTIPLE_LINES(cls): - return cls("multiple\nlines") - - @schemas.classproperty - def DOUBLE_QUOTE_WITH_NEWLINE(cls): - return cls("double quote \n with newline") - - @schemas.classproperty - def NONE(cls): - return cls(None) - - - def __new__( - cls, - *_args: typing.Union[None, str, ], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'StringEnum': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/string_enum_with_default_value.py b/samples/openapi3/client/petstore/python/petstore_api/model/string_enum_with_default_value.py deleted file mode 100644 index 85260096555..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/string_enum_with_default_value.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class StringEnumWithDefaultValue( - schemas.EnumBase, - schemas.StrSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - enum_value_to_name = { - "placed": "PLACED", - "approved": "APPROVED", - "delivered": "DELIVERED", - } - - @schemas.classproperty - def PLACED(cls): - return cls("placed") - - @schemas.classproperty - def APPROVED(cls): - return cls("approved") - - @schemas.classproperty - def DELIVERED(cls): - return cls("delivered") diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/string_enum_with_default_value.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/string_enum_with_default_value.pyi deleted file mode 100644 index e51581c628f..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/string_enum_with_default_value.pyi +++ /dev/null @@ -1,46 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class StringEnumWithDefaultValue( - schemas.EnumBase, - schemas.StrSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - @schemas.classproperty - def PLACED(cls): - return cls("placed") - - @schemas.classproperty - def APPROVED(cls): - return cls("approved") - - @schemas.classproperty - def DELIVERED(cls): - return cls("delivered") diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/string_with_validation.py b/samples/openapi3/client/petstore/python/petstore_api/model/string_with_validation.py deleted file mode 100644 index 61ff6fcc31d..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/string_with_validation.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class StringWithValidation( - schemas.StrSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - min_length = 7 diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/string_with_validation.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/string_with_validation.pyi deleted file mode 100644 index df0be025130..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/string_with_validation.pyi +++ /dev/null @@ -1,34 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class StringWithValidation( - schemas.StrSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - pass diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/tag.py b/samples/openapi3/client/petstore/python/petstore_api/model/tag.py deleted file mode 100644 index 2628e605ba7..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/tag.py +++ /dev/null @@ -1,88 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Tag( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - id = schemas.Int64Schema - name = schemas.StrSchema - __annotations__ = { - "id": id, - "name": name, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["id"]) -> MetaOapg.properties.id: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["id", "name", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["id"]) -> typing.Union[MetaOapg.properties.id, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["name"]) -> typing.Union[MetaOapg.properties.name, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["id", "name", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - id: typing.Union[MetaOapg.properties.id, decimal.Decimal, int, schemas.Unset] = schemas.unset, - name: typing.Union[MetaOapg.properties.name, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Tag': - return super().__new__( - cls, - *_args, - id=id, - name=name, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/tag.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/tag.pyi deleted file mode 100644 index 2628e605ba7..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/tag.pyi +++ /dev/null @@ -1,88 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Tag( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - id = schemas.Int64Schema - name = schemas.StrSchema - __annotations__ = { - "id": id, - "name": name, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["id"]) -> MetaOapg.properties.id: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["id", "name", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["id"]) -> typing.Union[MetaOapg.properties.id, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["name"]) -> typing.Union[MetaOapg.properties.name, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["id", "name", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - id: typing.Union[MetaOapg.properties.id, decimal.Decimal, int, schemas.Unset] = schemas.unset, - name: typing.Union[MetaOapg.properties.name, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Tag': - return super().__new__( - cls, - *_args, - id=id, - name=name, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/triangle.py b/samples/openapi3/client/petstore/python/petstore_api/model/triangle.py deleted file mode 100644 index 1e7b13c2785..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/triangle.py +++ /dev/null @@ -1,80 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Triangle( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - @staticmethod - def discriminator(): - return { - 'triangleType': { - 'EquilateralTriangle': EquilateralTriangle, - 'IsoscelesTriangle': IsoscelesTriangle, - 'ScaleneTriangle': ScaleneTriangle, - } - } - - @classmethod - @functools.lru_cache() - def one_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - EquilateralTriangle, - IsoscelesTriangle, - ScaleneTriangle, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Triangle': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.equilateral_triangle import EquilateralTriangle -from petstore_api.model.isosceles_triangle import IsoscelesTriangle -from petstore_api.model.scalene_triangle import ScaleneTriangle diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/triangle.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/triangle.pyi deleted file mode 100644 index 1e7b13c2785..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/triangle.pyi +++ /dev/null @@ -1,80 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Triangle( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - @staticmethod - def discriminator(): - return { - 'triangleType': { - 'EquilateralTriangle': EquilateralTriangle, - 'IsoscelesTriangle': IsoscelesTriangle, - 'ScaleneTriangle': ScaleneTriangle, - } - } - - @classmethod - @functools.lru_cache() - def one_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - EquilateralTriangle, - IsoscelesTriangle, - ScaleneTriangle, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Triangle': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.equilateral_triangle import EquilateralTriangle -from petstore_api.model.isosceles_triangle import IsoscelesTriangle -from petstore_api.model.scalene_triangle import ScaleneTriangle diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/triangle_interface.py b/samples/openapi3/client/petstore/python/petstore_api/model/triangle_interface.py deleted file mode 100644 index 2521058b489..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/triangle_interface.py +++ /dev/null @@ -1,111 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class TriangleInterface( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "shapeType", - "triangleType", - } - - class properties: - - - class shapeType( - schemas.EnumBase, - schemas.StrSchema - ): - - - class MetaOapg: - enum_value_to_name = { - "Triangle": "TRIANGLE", - } - - @schemas.classproperty - def TRIANGLE(cls): - return cls("Triangle") - triangleType = schemas.StrSchema - __annotations__ = { - "shapeType": shapeType, - "triangleType": triangleType, - } - - - shapeType: MetaOapg.properties.shapeType - triangleType: MetaOapg.properties.triangleType - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["shapeType"]) -> MetaOapg.properties.shapeType: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["triangleType"]) -> MetaOapg.properties.triangleType: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["shapeType", "triangleType", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["shapeType"]) -> MetaOapg.properties.shapeType: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["triangleType"]) -> MetaOapg.properties.triangleType: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["shapeType", "triangleType", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - shapeType: typing.Union[MetaOapg.properties.shapeType, str, ], - triangleType: typing.Union[MetaOapg.properties.triangleType, str, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'TriangleInterface': - return super().__new__( - cls, - *_args, - shapeType=shapeType, - triangleType=triangleType, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/triangle_interface.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/triangle_interface.pyi deleted file mode 100644 index 24d263a5695..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/triangle_interface.pyi +++ /dev/null @@ -1,105 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class TriangleInterface( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "shapeType", - "triangleType", - } - - class properties: - - - class shapeType( - schemas.EnumBase, - schemas.StrSchema - ): - - @schemas.classproperty - def TRIANGLE(cls): - return cls("Triangle") - triangleType = schemas.StrSchema - __annotations__ = { - "shapeType": shapeType, - "triangleType": triangleType, - } - - - shapeType: MetaOapg.properties.shapeType - triangleType: MetaOapg.properties.triangleType - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["shapeType"]) -> MetaOapg.properties.shapeType: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["triangleType"]) -> MetaOapg.properties.triangleType: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["shapeType", "triangleType", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["shapeType"]) -> MetaOapg.properties.shapeType: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["triangleType"]) -> MetaOapg.properties.triangleType: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["shapeType", "triangleType", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - shapeType: typing.Union[MetaOapg.properties.shapeType, str, ], - triangleType: typing.Union[MetaOapg.properties.triangleType, str, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'TriangleInterface': - return super().__new__( - cls, - *_args, - shapeType=shapeType, - triangleType=triangleType, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/user.py b/samples/openapi3/client/petstore/python/petstore_api/model/user.py deleted file mode 100644 index ade6f72fce5..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/user.py +++ /dev/null @@ -1,241 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class User( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - id = schemas.Int64Schema - username = schemas.StrSchema - firstName = schemas.StrSchema - lastName = schemas.StrSchema - email = schemas.StrSchema - password = schemas.StrSchema - phone = schemas.StrSchema - userStatus = schemas.Int32Schema - objectWithNoDeclaredProps = schemas.DictSchema - - - class objectWithNoDeclaredPropsNullable( - schemas.DictBase, - schemas.NoneBase, - schemas.Schema, - schemas.NoneFrozenDictMixin - ): - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, None, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'objectWithNoDeclaredPropsNullable': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - anyTypeProp = schemas.AnyTypeSchema - - - class anyTypeExceptNullProp( - schemas.ComposedSchema, - ): - - - class MetaOapg: - not_schema = schemas.NoneSchema - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'anyTypeExceptNullProp': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - anyTypePropNullable = schemas.AnyTypeSchema - __annotations__ = { - "id": id, - "username": username, - "firstName": firstName, - "lastName": lastName, - "email": email, - "password": password, - "phone": phone, - "userStatus": userStatus, - "objectWithNoDeclaredProps": objectWithNoDeclaredProps, - "objectWithNoDeclaredPropsNullable": objectWithNoDeclaredPropsNullable, - "anyTypeProp": anyTypeProp, - "anyTypeExceptNullProp": anyTypeExceptNullProp, - "anyTypePropNullable": anyTypePropNullable, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["id"]) -> MetaOapg.properties.id: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["username"]) -> MetaOapg.properties.username: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["firstName"]) -> MetaOapg.properties.firstName: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["lastName"]) -> MetaOapg.properties.lastName: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["email"]) -> MetaOapg.properties.email: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["password"]) -> MetaOapg.properties.password: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["phone"]) -> MetaOapg.properties.phone: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["userStatus"]) -> MetaOapg.properties.userStatus: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["objectWithNoDeclaredProps"]) -> MetaOapg.properties.objectWithNoDeclaredProps: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["objectWithNoDeclaredPropsNullable"]) -> MetaOapg.properties.objectWithNoDeclaredPropsNullable: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["anyTypeProp"]) -> MetaOapg.properties.anyTypeProp: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["anyTypeExceptNullProp"]) -> MetaOapg.properties.anyTypeExceptNullProp: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["anyTypePropNullable"]) -> MetaOapg.properties.anyTypePropNullable: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["id", "username", "firstName", "lastName", "email", "password", "phone", "userStatus", "objectWithNoDeclaredProps", "objectWithNoDeclaredPropsNullable", "anyTypeProp", "anyTypeExceptNullProp", "anyTypePropNullable", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["id"]) -> typing.Union[MetaOapg.properties.id, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["username"]) -> typing.Union[MetaOapg.properties.username, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["firstName"]) -> typing.Union[MetaOapg.properties.firstName, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["lastName"]) -> typing.Union[MetaOapg.properties.lastName, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["email"]) -> typing.Union[MetaOapg.properties.email, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["password"]) -> typing.Union[MetaOapg.properties.password, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["phone"]) -> typing.Union[MetaOapg.properties.phone, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["userStatus"]) -> typing.Union[MetaOapg.properties.userStatus, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["objectWithNoDeclaredProps"]) -> typing.Union[MetaOapg.properties.objectWithNoDeclaredProps, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["objectWithNoDeclaredPropsNullable"]) -> typing.Union[MetaOapg.properties.objectWithNoDeclaredPropsNullable, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["anyTypeProp"]) -> typing.Union[MetaOapg.properties.anyTypeProp, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["anyTypeExceptNullProp"]) -> typing.Union[MetaOapg.properties.anyTypeExceptNullProp, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["anyTypePropNullable"]) -> typing.Union[MetaOapg.properties.anyTypePropNullable, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["id", "username", "firstName", "lastName", "email", "password", "phone", "userStatus", "objectWithNoDeclaredProps", "objectWithNoDeclaredPropsNullable", "anyTypeProp", "anyTypeExceptNullProp", "anyTypePropNullable", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - id: typing.Union[MetaOapg.properties.id, decimal.Decimal, int, schemas.Unset] = schemas.unset, - username: typing.Union[MetaOapg.properties.username, str, schemas.Unset] = schemas.unset, - firstName: typing.Union[MetaOapg.properties.firstName, str, schemas.Unset] = schemas.unset, - lastName: typing.Union[MetaOapg.properties.lastName, str, schemas.Unset] = schemas.unset, - email: typing.Union[MetaOapg.properties.email, str, schemas.Unset] = schemas.unset, - password: typing.Union[MetaOapg.properties.password, str, schemas.Unset] = schemas.unset, - phone: typing.Union[MetaOapg.properties.phone, str, schemas.Unset] = schemas.unset, - userStatus: typing.Union[MetaOapg.properties.userStatus, decimal.Decimal, int, schemas.Unset] = schemas.unset, - objectWithNoDeclaredProps: typing.Union[MetaOapg.properties.objectWithNoDeclaredProps, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - objectWithNoDeclaredPropsNullable: typing.Union[MetaOapg.properties.objectWithNoDeclaredPropsNullable, dict, frozendict.frozendict, None, schemas.Unset] = schemas.unset, - anyTypeProp: typing.Union[MetaOapg.properties.anyTypeProp, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - anyTypeExceptNullProp: typing.Union[MetaOapg.properties.anyTypeExceptNullProp, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - anyTypePropNullable: typing.Union[MetaOapg.properties.anyTypePropNullable, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'User': - return super().__new__( - cls, - *_args, - id=id, - username=username, - firstName=firstName, - lastName=lastName, - email=email, - password=password, - phone=phone, - userStatus=userStatus, - objectWithNoDeclaredProps=objectWithNoDeclaredProps, - objectWithNoDeclaredPropsNullable=objectWithNoDeclaredPropsNullable, - anyTypeProp=anyTypeProp, - anyTypeExceptNullProp=anyTypeExceptNullProp, - anyTypePropNullable=anyTypePropNullable, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/user.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/user.pyi deleted file mode 100644 index ade6f72fce5..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/user.pyi +++ /dev/null @@ -1,241 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class User( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - id = schemas.Int64Schema - username = schemas.StrSchema - firstName = schemas.StrSchema - lastName = schemas.StrSchema - email = schemas.StrSchema - password = schemas.StrSchema - phone = schemas.StrSchema - userStatus = schemas.Int32Schema - objectWithNoDeclaredProps = schemas.DictSchema - - - class objectWithNoDeclaredPropsNullable( - schemas.DictBase, - schemas.NoneBase, - schemas.Schema, - schemas.NoneFrozenDictMixin - ): - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, None, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'objectWithNoDeclaredPropsNullable': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - anyTypeProp = schemas.AnyTypeSchema - - - class anyTypeExceptNullProp( - schemas.ComposedSchema, - ): - - - class MetaOapg: - not_schema = schemas.NoneSchema - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'anyTypeExceptNullProp': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - anyTypePropNullable = schemas.AnyTypeSchema - __annotations__ = { - "id": id, - "username": username, - "firstName": firstName, - "lastName": lastName, - "email": email, - "password": password, - "phone": phone, - "userStatus": userStatus, - "objectWithNoDeclaredProps": objectWithNoDeclaredProps, - "objectWithNoDeclaredPropsNullable": objectWithNoDeclaredPropsNullable, - "anyTypeProp": anyTypeProp, - "anyTypeExceptNullProp": anyTypeExceptNullProp, - "anyTypePropNullable": anyTypePropNullable, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["id"]) -> MetaOapg.properties.id: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["username"]) -> MetaOapg.properties.username: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["firstName"]) -> MetaOapg.properties.firstName: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["lastName"]) -> MetaOapg.properties.lastName: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["email"]) -> MetaOapg.properties.email: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["password"]) -> MetaOapg.properties.password: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["phone"]) -> MetaOapg.properties.phone: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["userStatus"]) -> MetaOapg.properties.userStatus: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["objectWithNoDeclaredProps"]) -> MetaOapg.properties.objectWithNoDeclaredProps: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["objectWithNoDeclaredPropsNullable"]) -> MetaOapg.properties.objectWithNoDeclaredPropsNullable: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["anyTypeProp"]) -> MetaOapg.properties.anyTypeProp: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["anyTypeExceptNullProp"]) -> MetaOapg.properties.anyTypeExceptNullProp: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["anyTypePropNullable"]) -> MetaOapg.properties.anyTypePropNullable: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["id", "username", "firstName", "lastName", "email", "password", "phone", "userStatus", "objectWithNoDeclaredProps", "objectWithNoDeclaredPropsNullable", "anyTypeProp", "anyTypeExceptNullProp", "anyTypePropNullable", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["id"]) -> typing.Union[MetaOapg.properties.id, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["username"]) -> typing.Union[MetaOapg.properties.username, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["firstName"]) -> typing.Union[MetaOapg.properties.firstName, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["lastName"]) -> typing.Union[MetaOapg.properties.lastName, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["email"]) -> typing.Union[MetaOapg.properties.email, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["password"]) -> typing.Union[MetaOapg.properties.password, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["phone"]) -> typing.Union[MetaOapg.properties.phone, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["userStatus"]) -> typing.Union[MetaOapg.properties.userStatus, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["objectWithNoDeclaredProps"]) -> typing.Union[MetaOapg.properties.objectWithNoDeclaredProps, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["objectWithNoDeclaredPropsNullable"]) -> typing.Union[MetaOapg.properties.objectWithNoDeclaredPropsNullable, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["anyTypeProp"]) -> typing.Union[MetaOapg.properties.anyTypeProp, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["anyTypeExceptNullProp"]) -> typing.Union[MetaOapg.properties.anyTypeExceptNullProp, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["anyTypePropNullable"]) -> typing.Union[MetaOapg.properties.anyTypePropNullable, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["id", "username", "firstName", "lastName", "email", "password", "phone", "userStatus", "objectWithNoDeclaredProps", "objectWithNoDeclaredPropsNullable", "anyTypeProp", "anyTypeExceptNullProp", "anyTypePropNullable", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - id: typing.Union[MetaOapg.properties.id, decimal.Decimal, int, schemas.Unset] = schemas.unset, - username: typing.Union[MetaOapg.properties.username, str, schemas.Unset] = schemas.unset, - firstName: typing.Union[MetaOapg.properties.firstName, str, schemas.Unset] = schemas.unset, - lastName: typing.Union[MetaOapg.properties.lastName, str, schemas.Unset] = schemas.unset, - email: typing.Union[MetaOapg.properties.email, str, schemas.Unset] = schemas.unset, - password: typing.Union[MetaOapg.properties.password, str, schemas.Unset] = schemas.unset, - phone: typing.Union[MetaOapg.properties.phone, str, schemas.Unset] = schemas.unset, - userStatus: typing.Union[MetaOapg.properties.userStatus, decimal.Decimal, int, schemas.Unset] = schemas.unset, - objectWithNoDeclaredProps: typing.Union[MetaOapg.properties.objectWithNoDeclaredProps, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - objectWithNoDeclaredPropsNullable: typing.Union[MetaOapg.properties.objectWithNoDeclaredPropsNullable, dict, frozendict.frozendict, None, schemas.Unset] = schemas.unset, - anyTypeProp: typing.Union[MetaOapg.properties.anyTypeProp, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - anyTypeExceptNullProp: typing.Union[MetaOapg.properties.anyTypeExceptNullProp, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - anyTypePropNullable: typing.Union[MetaOapg.properties.anyTypePropNullable, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'User': - return super().__new__( - cls, - *_args, - id=id, - username=username, - firstName=firstName, - lastName=lastName, - email=email, - password=password, - phone=phone, - userStatus=userStatus, - objectWithNoDeclaredProps=objectWithNoDeclaredProps, - objectWithNoDeclaredPropsNullable=objectWithNoDeclaredPropsNullable, - anyTypeProp=anyTypeProp, - anyTypeExceptNullProp=anyTypeExceptNullProp, - anyTypePropNullable=anyTypePropNullable, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/uuid_string.py b/samples/openapi3/client/petstore/python/petstore_api/model/uuid_string.py deleted file mode 100644 index 92a3825e376..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/uuid_string.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class UUIDString( - schemas.UUIDSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - format = 'uuid' - min_length = 1 diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/uuid_string.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/uuid_string.pyi deleted file mode 100644 index 80495060cf8..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/uuid_string.pyi +++ /dev/null @@ -1,34 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class UUIDString( - schemas.UUIDSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - pass diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/whale.py b/samples/openapi3/client/petstore/python/petstore_api/model/whale.py deleted file mode 100644 index 40c14099ab8..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/whale.py +++ /dev/null @@ -1,118 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Whale( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "className", - } - - class properties: - - - class className( - schemas.EnumBase, - schemas.StrSchema - ): - - - class MetaOapg: - enum_value_to_name = { - "whale": "WHALE", - } - - @schemas.classproperty - def WHALE(cls): - return cls("whale") - hasBaleen = schemas.BoolSchema - hasTeeth = schemas.BoolSchema - __annotations__ = { - "className": className, - "hasBaleen": hasBaleen, - "hasTeeth": hasTeeth, - } - - className: MetaOapg.properties.className - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["className"]) -> MetaOapg.properties.className: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["hasBaleen"]) -> MetaOapg.properties.hasBaleen: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["hasTeeth"]) -> MetaOapg.properties.hasTeeth: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["className", "hasBaleen", "hasTeeth", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["className"]) -> MetaOapg.properties.className: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["hasBaleen"]) -> typing.Union[MetaOapg.properties.hasBaleen, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["hasTeeth"]) -> typing.Union[MetaOapg.properties.hasTeeth, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["className", "hasBaleen", "hasTeeth", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - className: typing.Union[MetaOapg.properties.className, str, ], - hasBaleen: typing.Union[MetaOapg.properties.hasBaleen, bool, schemas.Unset] = schemas.unset, - hasTeeth: typing.Union[MetaOapg.properties.hasTeeth, bool, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Whale': - return super().__new__( - cls, - *_args, - className=className, - hasBaleen=hasBaleen, - hasTeeth=hasTeeth, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/whale.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/whale.pyi deleted file mode 100644 index 3eb37ff18d7..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/whale.pyi +++ /dev/null @@ -1,112 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Whale( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "className", - } - - class properties: - - - class className( - schemas.EnumBase, - schemas.StrSchema - ): - - @schemas.classproperty - def WHALE(cls): - return cls("whale") - hasBaleen = schemas.BoolSchema - hasTeeth = schemas.BoolSchema - __annotations__ = { - "className": className, - "hasBaleen": hasBaleen, - "hasTeeth": hasTeeth, - } - - className: MetaOapg.properties.className - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["className"]) -> MetaOapg.properties.className: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["hasBaleen"]) -> MetaOapg.properties.hasBaleen: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["hasTeeth"]) -> MetaOapg.properties.hasTeeth: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["className", "hasBaleen", "hasTeeth", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["className"]) -> MetaOapg.properties.className: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["hasBaleen"]) -> typing.Union[MetaOapg.properties.hasBaleen, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["hasTeeth"]) -> typing.Union[MetaOapg.properties.hasTeeth, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["className", "hasBaleen", "hasTeeth", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - className: typing.Union[MetaOapg.properties.className, str, ], - hasBaleen: typing.Union[MetaOapg.properties.hasBaleen, bool, schemas.Unset] = schemas.unset, - hasTeeth: typing.Union[MetaOapg.properties.hasTeeth, bool, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Whale': - return super().__new__( - cls, - *_args, - className=className, - hasBaleen=hasBaleen, - hasTeeth=hasTeeth, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/zebra.py b/samples/openapi3/client/petstore/python/petstore_api/model/zebra.py deleted file mode 100644 index 92723dd978b..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/zebra.py +++ /dev/null @@ -1,132 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Zebra( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "className", - } - - class properties: - - - class className( - schemas.EnumBase, - schemas.StrSchema - ): - - - class MetaOapg: - enum_value_to_name = { - "zebra": "ZEBRA", - } - - @schemas.classproperty - def ZEBRA(cls): - return cls("zebra") - - - class type( - schemas.EnumBase, - schemas.StrSchema - ): - - - class MetaOapg: - enum_value_to_name = { - "plains": "PLAINS", - "mountain": "MOUNTAIN", - "grevys": "GREVYS", - } - - @schemas.classproperty - def PLAINS(cls): - return cls("plains") - - @schemas.classproperty - def MOUNTAIN(cls): - return cls("mountain") - - @schemas.classproperty - def GREVYS(cls): - return cls("grevys") - __annotations__ = { - "className": className, - "type": type, - } - additional_properties = schemas.AnyTypeSchema - - className: MetaOapg.properties.className - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["className"]) -> MetaOapg.properties.className: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["type"]) -> MetaOapg.properties.type: ... - - @typing.overload - def __getitem__(self, name: str) -> MetaOapg.additional_properties: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["className"], typing_extensions.Literal["type"], str, ]): - # dict_instance[name] accessor - return super().__getitem__(name) - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["className"]) -> MetaOapg.properties.className: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["type"]) -> typing.Union[MetaOapg.properties.type, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[MetaOapg.additional_properties, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["className"], typing_extensions.Literal["type"], str, ]): - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - className: typing.Union[MetaOapg.properties.className, str, ], - type: typing.Union[MetaOapg.properties.type, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - ) -> 'Zebra': - return super().__new__( - cls, - *_args, - className=className, - type=type, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/zebra.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/zebra.pyi deleted file mode 100644 index ee12ea4ba47..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/model/zebra.pyi +++ /dev/null @@ -1,118 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Zebra( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "className", - } - - class properties: - - - class className( - schemas.EnumBase, - schemas.StrSchema - ): - - @schemas.classproperty - def ZEBRA(cls): - return cls("zebra") - - - class type( - schemas.EnumBase, - schemas.StrSchema - ): - - @schemas.classproperty - def PLAINS(cls): - return cls("plains") - - @schemas.classproperty - def MOUNTAIN(cls): - return cls("mountain") - - @schemas.classproperty - def GREVYS(cls): - return cls("grevys") - __annotations__ = { - "className": className, - "type": type, - } - additional_properties = schemas.AnyTypeSchema - - className: MetaOapg.properties.className - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["className"]) -> MetaOapg.properties.className: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["type"]) -> MetaOapg.properties.type: ... - - @typing.overload - def __getitem__(self, name: str) -> MetaOapg.additional_properties: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["className"], typing_extensions.Literal["type"], str, ]): - # dict_instance[name] accessor - return super().__getitem__(name) - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["className"]) -> MetaOapg.properties.className: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["type"]) -> typing.Union[MetaOapg.properties.type, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[MetaOapg.additional_properties, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["className"], typing_extensions.Literal["type"], str, ]): - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - className: typing.Union[MetaOapg.properties.className, str, ], - type: typing.Union[MetaOapg.properties.type, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - ) -> 'Zebra': - return super().__new__( - cls, - *_args, - className=className, - type=type, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/models/__init__.py deleted file mode 100644 index d0e4161b873..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/models/__init__.py +++ /dev/null @@ -1,136 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -# import all models into this package -# if you have many models here with many references from one model to another this may -# raise a RecursionError -# to avoid this, import only the models that you directly need like: -# from from petstore_api.model.pet import Pet -# or import this package, but before doing it, use: -# import sys -# sys.setrecursionlimit(n) - -from petstore_api.model.abstract_step_message import AbstractStepMessage -from petstore_api.model.additional_properties_class import AdditionalPropertiesClass -from petstore_api.model.additional_properties_validator import AdditionalPropertiesValidator -from petstore_api.model.additional_properties_with_array_of_enums import AdditionalPropertiesWithArrayOfEnums -from petstore_api.model.address import Address -from petstore_api.model.animal import Animal -from petstore_api.model.animal_farm import AnimalFarm -from petstore_api.model.any_type_and_format import AnyTypeAndFormat -from petstore_api.model.any_type_not_string import AnyTypeNotString -from petstore_api.model.api_response import ApiResponse -from petstore_api.model.apple import Apple -from petstore_api.model.apple_req import AppleReq -from petstore_api.model.array_holding_any_type import ArrayHoldingAnyType -from petstore_api.model.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly -from petstore_api.model.array_of_enums import ArrayOfEnums -from petstore_api.model.array_of_number_only import ArrayOfNumberOnly -from petstore_api.model.array_test import ArrayTest -from petstore_api.model.array_with_validations_in_items import ArrayWithValidationsInItems -from petstore_api.model.banana import Banana -from petstore_api.model.banana_req import BananaReq -from petstore_api.model.bar import Bar -from petstore_api.model.basque_pig import BasquePig -from petstore_api.model.boolean import Boolean -from petstore_api.model.boolean_enum import BooleanEnum -from petstore_api.model.capitalization import Capitalization -from petstore_api.model.cat import Cat -from petstore_api.model.category import Category -from petstore_api.model.child_cat import ChildCat -from petstore_api.model.class_model import ClassModel -from petstore_api.model.client import Client -from petstore_api.model.complex_quadrilateral import ComplexQuadrilateral -from petstore_api.model.composed_any_of_different_types_no_validations import ComposedAnyOfDifferentTypesNoValidations -from petstore_api.model.composed_array import ComposedArray -from petstore_api.model.composed_bool import ComposedBool -from petstore_api.model.composed_none import ComposedNone -from petstore_api.model.composed_number import ComposedNumber -from petstore_api.model.composed_object import ComposedObject -from petstore_api.model.composed_one_of_different_types import ComposedOneOfDifferentTypes -from petstore_api.model.composed_string import ComposedString -from petstore_api.model.currency import Currency -from petstore_api.model.danish_pig import DanishPig -from petstore_api.model.date_time_test import DateTimeTest -from petstore_api.model.date_time_with_validations import DateTimeWithValidations -from petstore_api.model.date_with_validations import DateWithValidations -from petstore_api.model.decimal_payload import DecimalPayload -from petstore_api.model.dog import Dog -from petstore_api.model.drawing import Drawing -from petstore_api.model.enum_arrays import EnumArrays -from petstore_api.model.enum_class import EnumClass -from petstore_api.model.enum_test import EnumTest -from petstore_api.model.equilateral_triangle import EquilateralTriangle -from petstore_api.model.file import File -from petstore_api.model.file_schema_test_class import FileSchemaTestClass -from petstore_api.model.foo import Foo -from petstore_api.model.format_test import FormatTest -from petstore_api.model.from_schema import FromSchema -from petstore_api.model.fruit import Fruit -from petstore_api.model.fruit_req import FruitReq -from petstore_api.model.gm_fruit import GmFruit -from petstore_api.model.grandparent_animal import GrandparentAnimal -from petstore_api.model.has_only_read_only import HasOnlyReadOnly -from petstore_api.model.health_check_result import HealthCheckResult -from petstore_api.model.integer_enum import IntegerEnum -from petstore_api.model.integer_enum_big import IntegerEnumBig -from petstore_api.model.integer_enum_one_value import IntegerEnumOneValue -from petstore_api.model.integer_enum_with_default_value import IntegerEnumWithDefaultValue -from petstore_api.model.integer_max10 import IntegerMax10 -from petstore_api.model.integer_min15 import IntegerMin15 -from petstore_api.model.isosceles_triangle import IsoscelesTriangle -from petstore_api.model.json_patch_request import JSONPatchRequest -from petstore_api.model.json_patch_request_add_replace_test import JSONPatchRequestAddReplaceTest -from petstore_api.model.json_patch_request_move_copy import JSONPatchRequestMoveCopy -from petstore_api.model.json_patch_request_remove import JSONPatchRequestRemove -from petstore_api.model.mammal import Mammal -from petstore_api.model.map_test import MapTest -from petstore_api.model.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass -from petstore_api.model.model200_response import Model200Response -from petstore_api.model.model_return import ModelReturn -from petstore_api.model.money import Money -from petstore_api.model.name import Name -from petstore_api.model.no_additional_properties import NoAdditionalProperties -from petstore_api.model.nullable_class import NullableClass -from petstore_api.model.nullable_shape import NullableShape -from petstore_api.model.nullable_string import NullableString -from petstore_api.model.number import Number -from petstore_api.model.number_only import NumberOnly -from petstore_api.model.number_with_validations import NumberWithValidations -from petstore_api.model.object_interface import ObjectInterface -from petstore_api.model.object_model_with_arg_and_args_properties import ObjectModelWithArgAndArgsProperties -from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps -from petstore_api.model.object_with_all_of_with_req_test_prop_from_unset_add_prop import ObjectWithAllOfWithReqTestPropFromUnsetAddProp -from petstore_api.model.object_with_decimal_properties import ObjectWithDecimalProperties -from petstore_api.model.object_with_difficultly_named_props import ObjectWithDifficultlyNamedProps -from petstore_api.model.object_with_inline_composition_property import ObjectWithInlineCompositionProperty -from petstore_api.model.object_with_invalid_named_refed_properties import ObjectWithInvalidNamedRefedProperties -from petstore_api.model.object_with_optional_test_prop import ObjectWithOptionalTestProp -from petstore_api.model.object_with_validations import ObjectWithValidations -from petstore_api.model.order import Order -from petstore_api.model.parent_pet import ParentPet -from petstore_api.model.pet import Pet -from petstore_api.model.pig import Pig -from petstore_api.model.player import Player -from petstore_api.model.quadrilateral import Quadrilateral -from petstore_api.model.quadrilateral_interface import QuadrilateralInterface -from petstore_api.model.read_only_first import ReadOnlyFirst -from petstore_api.model.scalene_triangle import ScaleneTriangle -from petstore_api.model.shape import Shape -from petstore_api.model.shape_or_null import ShapeOrNull -from petstore_api.model.simple_quadrilateral import SimpleQuadrilateral -from petstore_api.model.some_object import SomeObject -from petstore_api.model.special_model_name import SpecialModelName -from petstore_api.model.string import String -from petstore_api.model.string_boolean_map import StringBooleanMap -from petstore_api.model.string_enum import StringEnum -from petstore_api.model.string_enum_with_default_value import StringEnumWithDefaultValue -from petstore_api.model.string_with_validation import StringWithValidation -from petstore_api.model.tag import Tag -from petstore_api.model.triangle import Triangle -from petstore_api.model.triangle_interface import TriangleInterface -from petstore_api.model.uuid_string import UUIDString -from petstore_api.model.user import User -from petstore_api.model.whale import Whale -from petstore_api.model.zebra import Zebra diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/__init__.py deleted file mode 100644 index 9b8c0ff4bbf..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/__init__.py +++ /dev/null @@ -1,56 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from petstore_api.apis.path_to_api import path_to_api - -import enum - - -class PathValues(str, enum.Enum): - FOO = "/foo" - PET = "/pet" - PET_FIND_BY_STATUS = "/pet/findByStatus" - PET_FIND_BY_TAGS = "/pet/findByTags" - PET_PET_ID = "/pet/{petId}" - PET_PET_ID_UPLOAD_IMAGE = "/pet/{petId}/uploadImage" - STORE_INVENTORY = "/store/inventory" - STORE_ORDER = "/store/order" - STORE_ORDER_ORDER_ID = "/store/order/{order_id}" - USER = "/user" - USER_CREATE_WITH_ARRAY = "/user/createWithArray" - USER_CREATE_WITH_LIST = "/user/createWithList" - USER_LOGIN = "/user/login" - USER_LOGOUT = "/user/logout" - USER_USERNAME = "/user/{username}" - FAKE_CLASSNAME_TEST = "/fake_classname_test" - FAKE = "/fake" - FAKE_REFS_NUMBER = "/fake/refs/number" - FAKE_REFS_MAMMAL = "/fake/refs/mammal" - FAKE_REFS_STRING = "/fake/refs/string" - FAKE_REFS_BOOLEAN = "/fake/refs/boolean" - FAKE_REFS_ARRAYMODEL = "/fake/refs/arraymodel" - FAKE_REFS_COMPOSED_ONE_OF_NUMBER_WITH_VALIDATIONS = "/fake/refs/composed_one_of_number_with_validations" - FAKE_REFS_OBJECT_MODEL_WITH_REF_PROPS = "/fake/refs/object_model_with_ref_props" - FAKE_REFS_ENUM = "/fake/refs/enum" - FAKE_REFS_ARRAYOFENUMS = "/fake/refs/array-of-enums" - FAKE_ADDITIONALPROPERTIESWITHARRAYOFENUMS = "/fake/additional-properties-with-array-of-enums" - FAKE_JSON_FORM_DATA = "/fake/jsonFormData" - FAKE_INLINEADDITIONAL_PROPERTIES = "/fake/inline-additionalProperties" - FAKE_BODYWITHQUERYPARAMS = "/fake/body-with-query-params" - ANOTHERFAKE_DUMMY = "/another-fake/dummy" - FAKE_BODYWITHFILESCHEMA = "/fake/body-with-file-schema" - FAKE_CASESENSITIVEPARAMS = "/fake/case-sensitive-params" - FAKE_TESTQUERYPARAMTERS = "/fake/test-query-paramters" - FAKE_PET_ID_UPLOAD_IMAGE_WITH_REQUIRED_FILE = "/fake/{petId}/uploadImageWithRequiredFile" - FAKE_PARAMETER_COLLISIONS_1_A_B_AB_SELF_AB_ = "/fake/parameterCollisions/{1}/{aB}/{Ab}/{self}/{A-B}/" - FAKE_UPLOAD_FILE = "/fake/uploadFile" - FAKE_UPLOAD_FILES = "/fake/uploadFiles" - FAKE_UPLOAD_DOWNLOAD_FILE = "/fake/uploadDownloadFile" - FAKE_HEALTH = "/fake/health" - FAKE_INLINE_COMPOSITION_ = "/fake/inlineComposition/" - FAKE_OBJ_IN_QUERY = "/fake/objInQuery" - FAKE_REF_OBJ_IN_QUERY = "/fake/refObjInQuery" - FAKE_JSON_WITH_CHARSET = "/fake/jsonWithCharset" - FAKE_RESPONSE_WITHOUT_SCHEMA = "/fake/responseWithoutSchema" - FAKE_JSON_PATCH = "/fake/jsonPatch" - FAKE_DELETE_COFFEE_ID = "/fake/deleteCoffee/{id}" - FAKE_QUERY_PARAM_WITH_JSON_CONTENT_TYPE = "/fake/queryParamWithJsonContentType" diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/another_fake_dummy/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/another_fake_dummy/__init__.py deleted file mode 100644 index 565ab17736e..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/another_fake_dummy/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from petstore_api.paths.another_fake_dummy import Api - -from petstore_api.paths import PathValues - -path = PathValues.ANOTHERFAKE_DUMMY \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/another_fake_dummy/patch.py b/samples/openapi3/client/petstore/python/petstore_api/paths/another_fake_dummy/patch.py deleted file mode 100644 index 344845d8e66..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/another_fake_dummy/patch.py +++ /dev/null @@ -1,333 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.client import Client - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = Client - - -request_body_client = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) -SchemaFor200ResponseBodyApplicationJson = Client - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _call_123_test_special_tags_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _call_123_test_special_tags_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _call_123_test_special_tags_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _call_123_test_special_tags_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _call_123_test_special_tags_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - To test special tags - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_client.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='patch'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class Call123TestSpecialTags(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def call_123_test_special_tags( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def call_123_test_special_tags( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def call_123_test_special_tags( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def call_123_test_special_tags( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def call_123_test_special_tags( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._call_123_test_special_tags_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpatch(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def patch( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def patch( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def patch( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def patch( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def patch( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._call_123_test_special_tags_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/another_fake_dummy/patch.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/another_fake_dummy/patch.pyi deleted file mode 100644 index e8fddde768d..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/another_fake_dummy/patch.pyi +++ /dev/null @@ -1,328 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.client import Client - -# body param -SchemaForRequestBodyApplicationJson = Client - - -request_body_client = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) -SchemaFor200ResponseBodyApplicationJson = Client - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _call_123_test_special_tags_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _call_123_test_special_tags_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _call_123_test_special_tags_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _call_123_test_special_tags_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _call_123_test_special_tags_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - To test special tags - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_client.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='patch'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class Call123TestSpecialTags(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def call_123_test_special_tags( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def call_123_test_special_tags( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def call_123_test_special_tags( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def call_123_test_special_tags( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def call_123_test_special_tags( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._call_123_test_special_tags_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpatch(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def patch( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def patch( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def patch( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def patch( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def patch( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._call_123_test_special_tags_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/__init__.py deleted file mode 100644 index 6e6df72bd84..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from petstore_api.paths.fake import Api - -from petstore_api.paths import PathValues - -path = PathValues.FAKE \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/delete.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/delete.py deleted file mode 100644 index d13203b0b67..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/delete.py +++ /dev/null @@ -1,394 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from . import path - -# Query params -RequiredStringGroupSchema = schemas.StrSchema -RequiredInt64GroupSchema = schemas.Int64Schema -StringGroupSchema = schemas.StrSchema -Int64GroupSchema = schemas.Int64Schema -RequestRequiredQueryParams = typing_extensions.TypedDict( - 'RequestRequiredQueryParams', - { - 'required_string_group': typing.Union[RequiredStringGroupSchema, str, ], - 'required_int64_group': typing.Union[RequiredInt64GroupSchema, decimal.Decimal, int, ], - } -) -RequestOptionalQueryParams = typing_extensions.TypedDict( - 'RequestOptionalQueryParams', - { - 'string_group': typing.Union[StringGroupSchema, str, ], - 'int64_group': typing.Union[Int64GroupSchema, decimal.Decimal, int, ], - }, - total=False -) - - -class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): - pass - - -request_query_required_string_group = api_client.QueryParameter( - name="required_string_group", - style=api_client.ParameterStyle.FORM, - schema=RequiredStringGroupSchema, - required=True, - explode=True, -) -request_query_required_int64_group = api_client.QueryParameter( - name="required_int64_group", - style=api_client.ParameterStyle.FORM, - schema=RequiredInt64GroupSchema, - required=True, - explode=True, -) -request_query_string_group = api_client.QueryParameter( - name="string_group", - style=api_client.ParameterStyle.FORM, - schema=StringGroupSchema, - explode=True, -) -request_query_int64_group = api_client.QueryParameter( - name="int64_group", - style=api_client.ParameterStyle.FORM, - schema=Int64GroupSchema, - explode=True, -) -# Header params - - -class RequiredBooleanGroupSchema( - schemas.EnumBase, - schemas.StrSchema -): - - - class MetaOapg: - enum_value_to_name = { - "true": "TRUE", - "false": "FALSE", - } - - @schemas.classproperty - def TRUE(cls): - return cls("true") - - @schemas.classproperty - def FALSE(cls): - return cls("false") - - -class BooleanGroupSchema( - schemas.EnumBase, - schemas.StrSchema -): - - - class MetaOapg: - enum_value_to_name = { - "true": "TRUE", - "false": "FALSE", - } - - @schemas.classproperty - def TRUE(cls): - return cls("true") - - @schemas.classproperty - def FALSE(cls): - return cls("false") -RequestRequiredHeaderParams = typing_extensions.TypedDict( - 'RequestRequiredHeaderParams', - { - 'required_boolean_group': typing.Union[RequiredBooleanGroupSchema, str, ], - } -) -RequestOptionalHeaderParams = typing_extensions.TypedDict( - 'RequestOptionalHeaderParams', - { - 'boolean_group': typing.Union[BooleanGroupSchema, str, ], - }, - total=False -) - - -class RequestHeaderParams(RequestRequiredHeaderParams, RequestOptionalHeaderParams): - pass - - -request_header_required_boolean_group = api_client.HeaderParameter( - name="required_boolean_group", - style=api_client.ParameterStyle.SIMPLE, - schema=RequiredBooleanGroupSchema, - required=True, -) -request_header_boolean_group = api_client.HeaderParameter( - name="boolean_group", - style=api_client.ParameterStyle.SIMPLE, - schema=BooleanGroupSchema, -) -_auth = [ - 'bearer_test', -] - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _group_parameters_oapg( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _group_parameters_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _group_parameters_oapg( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _group_parameters_oapg( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - Fake endpoint to test group parameters (optional) - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) - self._verify_typed_dict_inputs_oapg(RequestHeaderParams, header_params) - used_path = path.value - - prefix_separator_iterator = None - for parameter in ( - request_query_required_string_group, - request_query_required_int64_group, - request_query_string_group, - request_query_int64_group, - ): - parameter_data = query_params.get(parameter.name, schemas.unset) - if parameter_data is schemas.unset: - continue - if prefix_separator_iterator is None: - prefix_separator_iterator = parameter.get_prefix_separator_iterator() - serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) - for serialized_value in serialized_data.values(): - used_path += serialized_value - - _headers = HTTPHeaderDict() - for parameter in ( - request_header_required_boolean_group, - request_header_boolean_group, - ): - parameter_data = header_params.get(parameter.name, schemas.unset) - if parameter_data is schemas.unset: - continue - serialized_data = parameter.serialize(parameter_data) - _headers.extend(serialized_data) - # TODO add cookie handling - - response = self.api_client.call_api( - resource_path=used_path, - method='delete'.upper(), - headers=_headers, - auth_settings=_auth, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class GroupParameters(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def group_parameters( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def group_parameters( - self, - skip_deserialization: typing_extensions.Literal[True], - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def group_parameters( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def group_parameters( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._group_parameters_oapg( - query_params=query_params, - header_params=header_params, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiFordelete(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def delete( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def delete( - self, - skip_deserialization: typing_extensions.Literal[True], - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def delete( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def delete( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._group_parameters_oapg( - query_params=query_params, - header_params=header_params, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/delete.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/delete.pyi deleted file mode 100644 index 54d9c56fd10..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/delete.pyi +++ /dev/null @@ -1,372 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -# Query params -RequiredStringGroupSchema = schemas.StrSchema -RequiredInt64GroupSchema = schemas.Int64Schema -StringGroupSchema = schemas.StrSchema -Int64GroupSchema = schemas.Int64Schema -RequestRequiredQueryParams = typing_extensions.TypedDict( - 'RequestRequiredQueryParams', - { - 'required_string_group': typing.Union[RequiredStringGroupSchema, str, ], - 'required_int64_group': typing.Union[RequiredInt64GroupSchema, decimal.Decimal, int, ], - } -) -RequestOptionalQueryParams = typing_extensions.TypedDict( - 'RequestOptionalQueryParams', - { - 'string_group': typing.Union[StringGroupSchema, str, ], - 'int64_group': typing.Union[Int64GroupSchema, decimal.Decimal, int, ], - }, - total=False -) - - -class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): - pass - - -request_query_required_string_group = api_client.QueryParameter( - name="required_string_group", - style=api_client.ParameterStyle.FORM, - schema=RequiredStringGroupSchema, - required=True, - explode=True, -) -request_query_required_int64_group = api_client.QueryParameter( - name="required_int64_group", - style=api_client.ParameterStyle.FORM, - schema=RequiredInt64GroupSchema, - required=True, - explode=True, -) -request_query_string_group = api_client.QueryParameter( - name="string_group", - style=api_client.ParameterStyle.FORM, - schema=StringGroupSchema, - explode=True, -) -request_query_int64_group = api_client.QueryParameter( - name="int64_group", - style=api_client.ParameterStyle.FORM, - schema=Int64GroupSchema, - explode=True, -) -# Header params - - -class RequiredBooleanGroupSchema( - schemas.EnumBase, - schemas.StrSchema -): - - @schemas.classproperty - def TRUE(cls): - return cls("true") - - @schemas.classproperty - def FALSE(cls): - return cls("false") - - -class BooleanGroupSchema( - schemas.EnumBase, - schemas.StrSchema -): - - @schemas.classproperty - def TRUE(cls): - return cls("true") - - @schemas.classproperty - def FALSE(cls): - return cls("false") -RequestRequiredHeaderParams = typing_extensions.TypedDict( - 'RequestRequiredHeaderParams', - { - 'required_boolean_group': typing.Union[RequiredBooleanGroupSchema, str, ], - } -) -RequestOptionalHeaderParams = typing_extensions.TypedDict( - 'RequestOptionalHeaderParams', - { - 'boolean_group': typing.Union[BooleanGroupSchema, str, ], - }, - total=False -) - - -class RequestHeaderParams(RequestRequiredHeaderParams, RequestOptionalHeaderParams): - pass - - -request_header_required_boolean_group = api_client.HeaderParameter( - name="required_boolean_group", - style=api_client.ParameterStyle.SIMPLE, - schema=RequiredBooleanGroupSchema, - required=True, -) -request_header_boolean_group = api_client.HeaderParameter( - name="boolean_group", - style=api_client.ParameterStyle.SIMPLE, - schema=BooleanGroupSchema, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _group_parameters_oapg( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _group_parameters_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _group_parameters_oapg( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _group_parameters_oapg( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - Fake endpoint to test group parameters (optional) - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) - self._verify_typed_dict_inputs_oapg(RequestHeaderParams, header_params) - used_path = path.value - - prefix_separator_iterator = None - for parameter in ( - request_query_required_string_group, - request_query_required_int64_group, - request_query_string_group, - request_query_int64_group, - ): - parameter_data = query_params.get(parameter.name, schemas.unset) - if parameter_data is schemas.unset: - continue - if prefix_separator_iterator is None: - prefix_separator_iterator = parameter.get_prefix_separator_iterator() - serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) - for serialized_value in serialized_data.values(): - used_path += serialized_value - - _headers = HTTPHeaderDict() - for parameter in ( - request_header_required_boolean_group, - request_header_boolean_group, - ): - parameter_data = header_params.get(parameter.name, schemas.unset) - if parameter_data is schemas.unset: - continue - serialized_data = parameter.serialize(parameter_data) - _headers.extend(serialized_data) - # TODO add cookie handling - - response = self.api_client.call_api( - resource_path=used_path, - method='delete'.upper(), - headers=_headers, - auth_settings=_auth, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class GroupParameters(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def group_parameters( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def group_parameters( - self, - skip_deserialization: typing_extensions.Literal[True], - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def group_parameters( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def group_parameters( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._group_parameters_oapg( - query_params=query_params, - header_params=header_params, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiFordelete(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def delete( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def delete( - self, - skip_deserialization: typing_extensions.Literal[True], - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def delete( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def delete( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._group_parameters_oapg( - query_params=query_params, - header_params=header_params, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get.py deleted file mode 100644 index 968217f3d23..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get.py +++ /dev/null @@ -1,786 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from . import path - -# Query params - - -class EnumQueryStringArraySchema( - schemas.ListSchema -): - - - class MetaOapg: - - - class items( - schemas.EnumBase, - schemas.StrSchema - ): - - - class MetaOapg: - enum_value_to_name = { - ">": "GREATER_THAN", - "$": "DOLLAR", - } - - @schemas.classproperty - def GREATER_THAN(cls): - return cls(">") - - @schemas.classproperty - def DOLLAR(cls): - return cls("$") - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, str, ]], typing.List[typing.Union[MetaOapg.items, str, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'EnumQueryStringArraySchema': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - - -class EnumQueryStringSchema( - schemas.EnumBase, - schemas.StrSchema -): - - - class MetaOapg: - enum_value_to_name = { - "_abc": "_ABC", - "-efg": "EFG", - "(xyz)": "XYZ", - } - - @schemas.classproperty - def _ABC(cls): - return cls("_abc") - - @schemas.classproperty - def EFG(cls): - return cls("-efg") - - @schemas.classproperty - def XYZ(cls): - return cls("(xyz)") - - -class EnumQueryIntegerSchema( - schemas.EnumBase, - schemas.Int32Schema -): - - - class MetaOapg: - format = 'int32' - enum_value_to_name = { - 1: "POSITIVE_1", - -2: "NEGATIVE_2", - } - - @schemas.classproperty - def POSITIVE_1(cls): - return cls(1) - - @schemas.classproperty - def NEGATIVE_2(cls): - return cls(-2) - - -class EnumQueryDoubleSchema( - schemas.EnumBase, - schemas.Float64Schema -): - - - class MetaOapg: - format = 'double' - enum_value_to_name = { - 1.1: "POSITIVE_1_PT_1", - -1.2: "NEGATIVE_1_PT_2", - } - - @schemas.classproperty - def POSITIVE_1_PT_1(cls): - return cls(1.1) - - @schemas.classproperty - def NEGATIVE_1_PT_2(cls): - return cls(-1.2) -RequestRequiredQueryParams = typing_extensions.TypedDict( - 'RequestRequiredQueryParams', - { - } -) -RequestOptionalQueryParams = typing_extensions.TypedDict( - 'RequestOptionalQueryParams', - { - 'enum_query_string_array': typing.Union[EnumQueryStringArraySchema, list, tuple, ], - 'enum_query_string': typing.Union[EnumQueryStringSchema, str, ], - 'enum_query_integer': typing.Union[EnumQueryIntegerSchema, decimal.Decimal, int, ], - 'enum_query_double': typing.Union[EnumQueryDoubleSchema, decimal.Decimal, int, float, ], - }, - total=False -) - - -class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): - pass - - -request_query_enum_query_string_array = api_client.QueryParameter( - name="enum_query_string_array", - style=api_client.ParameterStyle.FORM, - schema=EnumQueryStringArraySchema, - explode=True, -) -request_query_enum_query_string = api_client.QueryParameter( - name="enum_query_string", - style=api_client.ParameterStyle.FORM, - schema=EnumQueryStringSchema, - explode=True, -) -request_query_enum_query_integer = api_client.QueryParameter( - name="enum_query_integer", - style=api_client.ParameterStyle.FORM, - schema=EnumQueryIntegerSchema, - explode=True, -) -request_query_enum_query_double = api_client.QueryParameter( - name="enum_query_double", - style=api_client.ParameterStyle.FORM, - schema=EnumQueryDoubleSchema, - explode=True, -) -# Header params - - -class EnumHeaderStringArraySchema( - schemas.ListSchema -): - - - class MetaOapg: - - - class items( - schemas.EnumBase, - schemas.StrSchema - ): - - - class MetaOapg: - enum_value_to_name = { - ">": "GREATER_THAN", - "$": "DOLLAR", - } - - @schemas.classproperty - def GREATER_THAN(cls): - return cls(">") - - @schemas.classproperty - def DOLLAR(cls): - return cls("$") - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, str, ]], typing.List[typing.Union[MetaOapg.items, str, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'EnumHeaderStringArraySchema': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - - -class EnumHeaderStringSchema( - schemas.EnumBase, - schemas.StrSchema -): - - - class MetaOapg: - enum_value_to_name = { - "_abc": "_ABC", - "-efg": "EFG", - "(xyz)": "XYZ", - } - - @schemas.classproperty - def _ABC(cls): - return cls("_abc") - - @schemas.classproperty - def EFG(cls): - return cls("-efg") - - @schemas.classproperty - def XYZ(cls): - return cls("(xyz)") -RequestRequiredHeaderParams = typing_extensions.TypedDict( - 'RequestRequiredHeaderParams', - { - } -) -RequestOptionalHeaderParams = typing_extensions.TypedDict( - 'RequestOptionalHeaderParams', - { - 'enum_header_string_array': typing.Union[EnumHeaderStringArraySchema, list, tuple, ], - 'enum_header_string': typing.Union[EnumHeaderStringSchema, str, ], - }, - total=False -) - - -class RequestHeaderParams(RequestRequiredHeaderParams, RequestOptionalHeaderParams): - pass - - -request_header_enum_header_string_array = api_client.HeaderParameter( - name="enum_header_string_array", - style=api_client.ParameterStyle.SIMPLE, - schema=EnumHeaderStringArraySchema, -) -request_header_enum_header_string = api_client.HeaderParameter( - name="enum_header_string", - style=api_client.ParameterStyle.SIMPLE, - schema=EnumHeaderStringSchema, -) -# body param - - -class SchemaForRequestBodyApplicationXWwwFormUrlencoded( - schemas.DictSchema -): - - - class MetaOapg: - - class properties: - - - class enum_form_string_array( - schemas.ListSchema - ): - - - class MetaOapg: - - - class items( - schemas.EnumBase, - schemas.StrSchema - ): - - - class MetaOapg: - enum_value_to_name = { - ">": "GREATER_THAN", - "$": "DOLLAR", - } - - @schemas.classproperty - def GREATER_THAN(cls): - return cls(">") - - @schemas.classproperty - def DOLLAR(cls): - return cls("$") - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, str, ]], typing.List[typing.Union[MetaOapg.items, str, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'enum_form_string_array': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - - - class enum_form_string( - schemas.EnumBase, - schemas.StrSchema - ): - - - class MetaOapg: - enum_value_to_name = { - "_abc": "_ABC", - "-efg": "EFG", - "(xyz)": "XYZ", - } - - @schemas.classproperty - def _ABC(cls): - return cls("_abc") - - @schemas.classproperty - def EFG(cls): - return cls("-efg") - - @schemas.classproperty - def XYZ(cls): - return cls("(xyz)") - __annotations__ = { - "enum_form_string_array": enum_form_string_array, - "enum_form_string": enum_form_string, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["enum_form_string_array"]) -> MetaOapg.properties.enum_form_string_array: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["enum_form_string"]) -> MetaOapg.properties.enum_form_string: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["enum_form_string_array", "enum_form_string", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["enum_form_string_array"]) -> typing.Union[MetaOapg.properties.enum_form_string_array, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["enum_form_string"]) -> typing.Union[MetaOapg.properties.enum_form_string, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["enum_form_string_array", "enum_form_string", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - enum_form_string_array: typing.Union[MetaOapg.properties.enum_form_string_array, list, tuple, schemas.Unset] = schemas.unset, - enum_form_string: typing.Union[MetaOapg.properties.enum_form_string, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaForRequestBodyApplicationXWwwFormUrlencoded': - return super().__new__( - cls, - *_args, - enum_form_string_array=enum_form_string_array, - enum_form_string=enum_form_string, - _configuration=_configuration, - **kwargs, - ) - - -request_body_body = api_client.RequestBody( - content={ - 'application/x-www-form-urlencoded': api_client.MediaType( - schema=SchemaForRequestBodyApplicationXWwwFormUrlencoded), - }, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -SchemaFor404ResponseBodyApplicationJson = schemas.DictSchema - - -@dataclass -class ApiResponseFor404(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor404ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_404 = api_client.OpenApiResponse( - response_cls=ApiResponseFor404, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor404ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, - '404': _response_for_404, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _enum_parameters_oapg( - self, - content_type: typing_extensions.Literal["application/x-www-form-urlencoded"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _enum_parameters_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _enum_parameters_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _enum_parameters_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _enum_parameters_oapg( - self, - content_type: str = 'application/x-www-form-urlencoded', - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - To test enum parameters - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) - self._verify_typed_dict_inputs_oapg(RequestHeaderParams, header_params) - used_path = path.value - - prefix_separator_iterator = None - for parameter in ( - request_query_enum_query_string_array, - request_query_enum_query_string, - request_query_enum_query_integer, - request_query_enum_query_double, - ): - parameter_data = query_params.get(parameter.name, schemas.unset) - if parameter_data is schemas.unset: - continue - if prefix_separator_iterator is None: - prefix_separator_iterator = parameter.get_prefix_separator_iterator() - serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) - for serialized_value in serialized_data.values(): - used_path += serialized_value - - _headers = HTTPHeaderDict() - for parameter in ( - request_header_enum_header_string_array, - request_header_enum_header_string, - ): - parameter_data = header_params.get(parameter.name, schemas.unset) - if parameter_data is schemas.unset: - continue - serialized_data = parameter.serialize(parameter_data) - _headers.extend(serialized_data) - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - _fields = None - _body = None - if body is not schemas.unset: - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='get'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class EnumParameters(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def enum_parameters( - self, - content_type: typing_extensions.Literal["application/x-www-form-urlencoded"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def enum_parameters( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def enum_parameters( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def enum_parameters( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def enum_parameters( - self, - content_type: str = 'application/x-www-form-urlencoded', - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._enum_parameters_oapg( - body=body, - query_params=query_params, - header_params=header_params, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForget(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def get( - self, - content_type: typing_extensions.Literal["application/x-www-form-urlencoded"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def get( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def get( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def get( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def get( - self, - content_type: str = 'application/x-www-form-urlencoded', - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._enum_parameters_oapg( - body=body, - query_params=query_params, - header_params=header_params, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get.pyi deleted file mode 100644 index b2241774a99..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get.pyi +++ /dev/null @@ -1,719 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -# Query params - - -class EnumQueryStringArraySchema( - schemas.ListSchema -): - - - class MetaOapg: - - - class items( - schemas.EnumBase, - schemas.StrSchema - ): - - @schemas.classproperty - def GREATER_THAN(cls): - return cls(">") - - @schemas.classproperty - def DOLLAR(cls): - return cls("$") - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, str, ]], typing.List[typing.Union[MetaOapg.items, str, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'EnumQueryStringArraySchema': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - - -class EnumQueryStringSchema( - schemas.EnumBase, - schemas.StrSchema -): - - @schemas.classproperty - def _ABC(cls): - return cls("_abc") - - @schemas.classproperty - def EFG(cls): - return cls("-efg") - - @schemas.classproperty - def XYZ(cls): - return cls("(xyz)") - - -class EnumQueryIntegerSchema( - schemas.EnumBase, - schemas.Int32Schema -): - - @schemas.classproperty - def POSITIVE_1(cls): - return cls(1) - - @schemas.classproperty - def NEGATIVE_2(cls): - return cls(-2) - - -class EnumQueryDoubleSchema( - schemas.EnumBase, - schemas.Float64Schema -): - - @schemas.classproperty - def POSITIVE_1_PT_1(cls): - return cls(1.1) - - @schemas.classproperty - def NEGATIVE_1_PT_2(cls): - return cls(-1.2) -RequestRequiredQueryParams = typing_extensions.TypedDict( - 'RequestRequiredQueryParams', - { - } -) -RequestOptionalQueryParams = typing_extensions.TypedDict( - 'RequestOptionalQueryParams', - { - 'enum_query_string_array': typing.Union[EnumQueryStringArraySchema, list, tuple, ], - 'enum_query_string': typing.Union[EnumQueryStringSchema, str, ], - 'enum_query_integer': typing.Union[EnumQueryIntegerSchema, decimal.Decimal, int, ], - 'enum_query_double': typing.Union[EnumQueryDoubleSchema, decimal.Decimal, int, float, ], - }, - total=False -) - - -class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): - pass - - -request_query_enum_query_string_array = api_client.QueryParameter( - name="enum_query_string_array", - style=api_client.ParameterStyle.FORM, - schema=EnumQueryStringArraySchema, - explode=True, -) -request_query_enum_query_string = api_client.QueryParameter( - name="enum_query_string", - style=api_client.ParameterStyle.FORM, - schema=EnumQueryStringSchema, - explode=True, -) -request_query_enum_query_integer = api_client.QueryParameter( - name="enum_query_integer", - style=api_client.ParameterStyle.FORM, - schema=EnumQueryIntegerSchema, - explode=True, -) -request_query_enum_query_double = api_client.QueryParameter( - name="enum_query_double", - style=api_client.ParameterStyle.FORM, - schema=EnumQueryDoubleSchema, - explode=True, -) -# Header params - - -class EnumHeaderStringArraySchema( - schemas.ListSchema -): - - - class MetaOapg: - - - class items( - schemas.EnumBase, - schemas.StrSchema - ): - - @schemas.classproperty - def GREATER_THAN(cls): - return cls(">") - - @schemas.classproperty - def DOLLAR(cls): - return cls("$") - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, str, ]], typing.List[typing.Union[MetaOapg.items, str, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'EnumHeaderStringArraySchema': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - - -class EnumHeaderStringSchema( - schemas.EnumBase, - schemas.StrSchema -): - - @schemas.classproperty - def _ABC(cls): - return cls("_abc") - - @schemas.classproperty - def EFG(cls): - return cls("-efg") - - @schemas.classproperty - def XYZ(cls): - return cls("(xyz)") -RequestRequiredHeaderParams = typing_extensions.TypedDict( - 'RequestRequiredHeaderParams', - { - } -) -RequestOptionalHeaderParams = typing_extensions.TypedDict( - 'RequestOptionalHeaderParams', - { - 'enum_header_string_array': typing.Union[EnumHeaderStringArraySchema, list, tuple, ], - 'enum_header_string': typing.Union[EnumHeaderStringSchema, str, ], - }, - total=False -) - - -class RequestHeaderParams(RequestRequiredHeaderParams, RequestOptionalHeaderParams): - pass - - -request_header_enum_header_string_array = api_client.HeaderParameter( - name="enum_header_string_array", - style=api_client.ParameterStyle.SIMPLE, - schema=EnumHeaderStringArraySchema, -) -request_header_enum_header_string = api_client.HeaderParameter( - name="enum_header_string", - style=api_client.ParameterStyle.SIMPLE, - schema=EnumHeaderStringSchema, -) -# body param - - -class SchemaForRequestBodyApplicationXWwwFormUrlencoded( - schemas.DictSchema -): - - - class MetaOapg: - - class properties: - - - class enum_form_string_array( - schemas.ListSchema - ): - - - class MetaOapg: - - - class items( - schemas.EnumBase, - schemas.StrSchema - ): - - @schemas.classproperty - def GREATER_THAN(cls): - return cls(">") - - @schemas.classproperty - def DOLLAR(cls): - return cls("$") - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, str, ]], typing.List[typing.Union[MetaOapg.items, str, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'enum_form_string_array': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - - - class enum_form_string( - schemas.EnumBase, - schemas.StrSchema - ): - - @schemas.classproperty - def _ABC(cls): - return cls("_abc") - - @schemas.classproperty - def EFG(cls): - return cls("-efg") - - @schemas.classproperty - def XYZ(cls): - return cls("(xyz)") - __annotations__ = { - "enum_form_string_array": enum_form_string_array, - "enum_form_string": enum_form_string, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["enum_form_string_array"]) -> MetaOapg.properties.enum_form_string_array: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["enum_form_string"]) -> MetaOapg.properties.enum_form_string: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["enum_form_string_array", "enum_form_string", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["enum_form_string_array"]) -> typing.Union[MetaOapg.properties.enum_form_string_array, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["enum_form_string"]) -> typing.Union[MetaOapg.properties.enum_form_string, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["enum_form_string_array", "enum_form_string", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - enum_form_string_array: typing.Union[MetaOapg.properties.enum_form_string_array, list, tuple, schemas.Unset] = schemas.unset, - enum_form_string: typing.Union[MetaOapg.properties.enum_form_string, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaForRequestBodyApplicationXWwwFormUrlencoded': - return super().__new__( - cls, - *_args, - enum_form_string_array=enum_form_string_array, - enum_form_string=enum_form_string, - _configuration=_configuration, - **kwargs, - ) - - -request_body_body = api_client.RequestBody( - content={ - 'application/x-www-form-urlencoded': api_client.MediaType( - schema=SchemaForRequestBodyApplicationXWwwFormUrlencoded), - }, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -SchemaFor404ResponseBodyApplicationJson = schemas.DictSchema - - -@dataclass -class ApiResponseFor404(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor404ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_404 = api_client.OpenApiResponse( - response_cls=ApiResponseFor404, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor404ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _enum_parameters_oapg( - self, - content_type: typing_extensions.Literal["application/x-www-form-urlencoded"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _enum_parameters_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _enum_parameters_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _enum_parameters_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _enum_parameters_oapg( - self, - content_type: str = 'application/x-www-form-urlencoded', - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - To test enum parameters - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) - self._verify_typed_dict_inputs_oapg(RequestHeaderParams, header_params) - used_path = path.value - - prefix_separator_iterator = None - for parameter in ( - request_query_enum_query_string_array, - request_query_enum_query_string, - request_query_enum_query_integer, - request_query_enum_query_double, - ): - parameter_data = query_params.get(parameter.name, schemas.unset) - if parameter_data is schemas.unset: - continue - if prefix_separator_iterator is None: - prefix_separator_iterator = parameter.get_prefix_separator_iterator() - serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) - for serialized_value in serialized_data.values(): - used_path += serialized_value - - _headers = HTTPHeaderDict() - for parameter in ( - request_header_enum_header_string_array, - request_header_enum_header_string, - ): - parameter_data = header_params.get(parameter.name, schemas.unset) - if parameter_data is schemas.unset: - continue - serialized_data = parameter.serialize(parameter_data) - _headers.extend(serialized_data) - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - _fields = None - _body = None - if body is not schemas.unset: - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='get'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class EnumParameters(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def enum_parameters( - self, - content_type: typing_extensions.Literal["application/x-www-form-urlencoded"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def enum_parameters( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def enum_parameters( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def enum_parameters( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def enum_parameters( - self, - content_type: str = 'application/x-www-form-urlencoded', - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._enum_parameters_oapg( - body=body, - query_params=query_params, - header_params=header_params, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForget(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def get( - self, - content_type: typing_extensions.Literal["application/x-www-form-urlencoded"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def get( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def get( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def get( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def get( - self, - content_type: str = 'application/x-www-form-urlencoded', - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._enum_parameters_oapg( - body=body, - query_params=query_params, - header_params=header_params, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/patch.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/patch.py deleted file mode 100644 index 21b28d9a460..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/patch.py +++ /dev/null @@ -1,333 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.client import Client - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = Client - - -request_body_client = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) -SchemaFor200ResponseBodyApplicationJson = Client - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _client_model_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _client_model_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _client_model_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _client_model_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _client_model_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - To test \"client\" model - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_client.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='patch'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class ClientModel(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def client_model( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def client_model( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def client_model( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def client_model( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def client_model( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._client_model_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpatch(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def patch( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def patch( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def patch( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def patch( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def patch( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._client_model_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/patch.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/patch.pyi deleted file mode 100644 index 93f842e888a..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/patch.pyi +++ /dev/null @@ -1,328 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.client import Client - -# body param -SchemaForRequestBodyApplicationJson = Client - - -request_body_client = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) -SchemaFor200ResponseBodyApplicationJson = Client - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _client_model_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _client_model_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _client_model_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _client_model_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _client_model_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - To test \"client\" model - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_client.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='patch'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class ClientModel(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def client_model( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def client_model( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def client_model( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def client_model( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def client_model( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._client_model_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpatch(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def patch( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def patch( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def patch( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def patch( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def patch( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._client_model_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/post.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/post.py deleted file mode 100644 index 6f5d487b91d..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/post.py +++ /dev/null @@ -1,583 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from . import path - -# body param - - -class SchemaForRequestBodyApplicationXWwwFormUrlencoded( - schemas.DictSchema -): - - - class MetaOapg: - required = { - "number", - "pattern_without_delimiter", - "byte", - "double", - } - - class properties: - - - class integer( - schemas.IntSchema - ): - - - class MetaOapg: - inclusive_maximum = 100 - inclusive_minimum = 10 - - - class int32( - schemas.Int32Schema - ): - - - class MetaOapg: - format = 'int32' - inclusive_maximum = 200 - inclusive_minimum = 20 - int64 = schemas.Int64Schema - - - class number( - schemas.NumberSchema - ): - - - class MetaOapg: - inclusive_maximum = 543.2 - inclusive_minimum = 32.1 - - - class _float( - schemas.Float32Schema - ): - - - class MetaOapg: - format = 'float' - inclusive_maximum = 987.6 - - - class double( - schemas.Float64Schema - ): - - - class MetaOapg: - format = 'double' - inclusive_maximum = 123.4 - inclusive_minimum = 67.8 - - - class string( - schemas.StrSchema - ): - - - class MetaOapg: - regex=[{ - 'pattern': r'[a-z]', # noqa: E501 - 'flags': ( - re.IGNORECASE - ) - }] - - - class pattern_without_delimiter( - schemas.StrSchema - ): - - - class MetaOapg: - regex=[{ - 'pattern': r'^[A-Z].*', # noqa: E501 - }] - byte = schemas.StrSchema - binary = schemas.BinarySchema - date = schemas.DateSchema - dateTime = schemas.DateTimeSchema - - - class password( - schemas.StrSchema - ): - - - class MetaOapg: - format = 'password' - max_length = 64 - min_length = 10 - callback = schemas.StrSchema - __annotations__ = { - "integer": integer, - "int32": int32, - "int64": int64, - "number": number, - "float": _float, - "double": double, - "string": string, - "pattern_without_delimiter": pattern_without_delimiter, - "byte": byte, - "binary": binary, - "date": date, - "dateTime": dateTime, - "password": password, - "callback": callback, - } - - number: MetaOapg.properties.number - pattern_without_delimiter: MetaOapg.properties.pattern_without_delimiter - byte: MetaOapg.properties.byte - double: MetaOapg.properties.double - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["integer"]) -> MetaOapg.properties.integer: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["int32"]) -> MetaOapg.properties.int32: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["int64"]) -> MetaOapg.properties.int64: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["number"]) -> MetaOapg.properties.number: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["float"]) -> MetaOapg.properties._float: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["double"]) -> MetaOapg.properties.double: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["string"]) -> MetaOapg.properties.string: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["pattern_without_delimiter"]) -> MetaOapg.properties.pattern_without_delimiter: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["byte"]) -> MetaOapg.properties.byte: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["binary"]) -> MetaOapg.properties.binary: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["date"]) -> MetaOapg.properties.date: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["dateTime"]) -> MetaOapg.properties.dateTime: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["password"]) -> MetaOapg.properties.password: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["callback"]) -> MetaOapg.properties.callback: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["integer", "int32", "int64", "number", "float", "double", "string", "pattern_without_delimiter", "byte", "binary", "date", "dateTime", "password", "callback", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["integer"]) -> typing.Union[MetaOapg.properties.integer, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["int32"]) -> typing.Union[MetaOapg.properties.int32, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["int64"]) -> typing.Union[MetaOapg.properties.int64, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["number"]) -> MetaOapg.properties.number: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["float"]) -> typing.Union[MetaOapg.properties._float, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["double"]) -> MetaOapg.properties.double: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["string"]) -> typing.Union[MetaOapg.properties.string, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["pattern_without_delimiter"]) -> MetaOapg.properties.pattern_without_delimiter: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["byte"]) -> MetaOapg.properties.byte: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["binary"]) -> typing.Union[MetaOapg.properties.binary, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["date"]) -> typing.Union[MetaOapg.properties.date, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["dateTime"]) -> typing.Union[MetaOapg.properties.dateTime, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["password"]) -> typing.Union[MetaOapg.properties.password, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["callback"]) -> typing.Union[MetaOapg.properties.callback, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["integer", "int32", "int64", "number", "float", "double", "string", "pattern_without_delimiter", "byte", "binary", "date", "dateTime", "password", "callback", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - number: typing.Union[MetaOapg.properties.number, decimal.Decimal, int, float, ], - pattern_without_delimiter: typing.Union[MetaOapg.properties.pattern_without_delimiter, str, ], - byte: typing.Union[MetaOapg.properties.byte, str, ], - double: typing.Union[MetaOapg.properties.double, decimal.Decimal, int, float, ], - integer: typing.Union[MetaOapg.properties.integer, decimal.Decimal, int, schemas.Unset] = schemas.unset, - int32: typing.Union[MetaOapg.properties.int32, decimal.Decimal, int, schemas.Unset] = schemas.unset, - int64: typing.Union[MetaOapg.properties.int64, decimal.Decimal, int, schemas.Unset] = schemas.unset, - string: typing.Union[MetaOapg.properties.string, str, schemas.Unset] = schemas.unset, - binary: typing.Union[MetaOapg.properties.binary, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - date: typing.Union[MetaOapg.properties.date, str, date, schemas.Unset] = schemas.unset, - dateTime: typing.Union[MetaOapg.properties.dateTime, str, datetime, schemas.Unset] = schemas.unset, - password: typing.Union[MetaOapg.properties.password, str, schemas.Unset] = schemas.unset, - callback: typing.Union[MetaOapg.properties.callback, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaForRequestBodyApplicationXWwwFormUrlencoded': - return super().__new__( - cls, - *_args, - number=number, - pattern_without_delimiter=pattern_without_delimiter, - byte=byte, - double=double, - integer=integer, - int32=int32, - int64=int64, - string=string, - binary=binary, - date=date, - dateTime=dateTime, - password=password, - callback=callback, - _configuration=_configuration, - **kwargs, - ) - - -request_body_body = api_client.RequestBody( - content={ - 'application/x-www-form-urlencoded': api_client.MediaType( - schema=SchemaForRequestBodyApplicationXWwwFormUrlencoded), - }, -) -_auth = [ - 'http_basic_test', -] - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -@dataclass -class ApiResponseFor404(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_404 = api_client.OpenApiResponse( - response_cls=ApiResponseFor404, -) -_status_code_to_response = { - '200': _response_for_200, - '404': _response_for_404, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _endpoint_parameters_oapg( - self, - content_type: typing_extensions.Literal["application/x-www-form-urlencoded"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _endpoint_parameters_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _endpoint_parameters_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _endpoint_parameters_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _endpoint_parameters_oapg( - self, - content_type: str = 'application/x-www-form-urlencoded', - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - _fields = None - _body = None - if body is not schemas.unset: - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - auth_settings=_auth, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class EndpointParameters(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def endpoint_parameters( - self, - content_type: typing_extensions.Literal["application/x-www-form-urlencoded"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def endpoint_parameters( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def endpoint_parameters( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def endpoint_parameters( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def endpoint_parameters( - self, - content_type: str = 'application/x-www-form-urlencoded', - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._endpoint_parameters_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - content_type: typing_extensions.Literal["application/x-www-form-urlencoded"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - content_type: str = 'application/x-www-form-urlencoded', - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._endpoint_parameters_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/post.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/post.pyi deleted file mode 100644 index 3795898d9d3..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/post.pyi +++ /dev/null @@ -1,534 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -# body param - - -class SchemaForRequestBodyApplicationXWwwFormUrlencoded( - schemas.DictSchema -): - - - class MetaOapg: - required = { - "number", - "pattern_without_delimiter", - "byte", - "double", - } - - class properties: - - - class integer( - schemas.IntSchema - ): - pass - - - class int32( - schemas.Int32Schema - ): - pass - int64 = schemas.Int64Schema - - - class number( - schemas.NumberSchema - ): - pass - - - class _float( - schemas.Float32Schema - ): - pass - - - class double( - schemas.Float64Schema - ): - pass - - - class string( - schemas.StrSchema - ): - pass - - - class pattern_without_delimiter( - schemas.StrSchema - ): - pass - byte = schemas.StrSchema - binary = schemas.BinarySchema - date = schemas.DateSchema - dateTime = schemas.DateTimeSchema - - - class password( - schemas.StrSchema - ): - pass - callback = schemas.StrSchema - __annotations__ = { - "integer": integer, - "int32": int32, - "int64": int64, - "number": number, - "float": _float, - "double": double, - "string": string, - "pattern_without_delimiter": pattern_without_delimiter, - "byte": byte, - "binary": binary, - "date": date, - "dateTime": dateTime, - "password": password, - "callback": callback, - } - - number: MetaOapg.properties.number - pattern_without_delimiter: MetaOapg.properties.pattern_without_delimiter - byte: MetaOapg.properties.byte - double: MetaOapg.properties.double - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["integer"]) -> MetaOapg.properties.integer: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["int32"]) -> MetaOapg.properties.int32: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["int64"]) -> MetaOapg.properties.int64: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["number"]) -> MetaOapg.properties.number: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["float"]) -> MetaOapg.properties._float: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["double"]) -> MetaOapg.properties.double: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["string"]) -> MetaOapg.properties.string: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["pattern_without_delimiter"]) -> MetaOapg.properties.pattern_without_delimiter: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["byte"]) -> MetaOapg.properties.byte: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["binary"]) -> MetaOapg.properties.binary: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["date"]) -> MetaOapg.properties.date: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["dateTime"]) -> MetaOapg.properties.dateTime: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["password"]) -> MetaOapg.properties.password: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["callback"]) -> MetaOapg.properties.callback: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["integer", "int32", "int64", "number", "float", "double", "string", "pattern_without_delimiter", "byte", "binary", "date", "dateTime", "password", "callback", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["integer"]) -> typing.Union[MetaOapg.properties.integer, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["int32"]) -> typing.Union[MetaOapg.properties.int32, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["int64"]) -> typing.Union[MetaOapg.properties.int64, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["number"]) -> MetaOapg.properties.number: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["float"]) -> typing.Union[MetaOapg.properties._float, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["double"]) -> MetaOapg.properties.double: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["string"]) -> typing.Union[MetaOapg.properties.string, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["pattern_without_delimiter"]) -> MetaOapg.properties.pattern_without_delimiter: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["byte"]) -> MetaOapg.properties.byte: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["binary"]) -> typing.Union[MetaOapg.properties.binary, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["date"]) -> typing.Union[MetaOapg.properties.date, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["dateTime"]) -> typing.Union[MetaOapg.properties.dateTime, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["password"]) -> typing.Union[MetaOapg.properties.password, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["callback"]) -> typing.Union[MetaOapg.properties.callback, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["integer", "int32", "int64", "number", "float", "double", "string", "pattern_without_delimiter", "byte", "binary", "date", "dateTime", "password", "callback", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - number: typing.Union[MetaOapg.properties.number, decimal.Decimal, int, float, ], - pattern_without_delimiter: typing.Union[MetaOapg.properties.pattern_without_delimiter, str, ], - byte: typing.Union[MetaOapg.properties.byte, str, ], - double: typing.Union[MetaOapg.properties.double, decimal.Decimal, int, float, ], - integer: typing.Union[MetaOapg.properties.integer, decimal.Decimal, int, schemas.Unset] = schemas.unset, - int32: typing.Union[MetaOapg.properties.int32, decimal.Decimal, int, schemas.Unset] = schemas.unset, - int64: typing.Union[MetaOapg.properties.int64, decimal.Decimal, int, schemas.Unset] = schemas.unset, - string: typing.Union[MetaOapg.properties.string, str, schemas.Unset] = schemas.unset, - binary: typing.Union[MetaOapg.properties.binary, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - date: typing.Union[MetaOapg.properties.date, str, date, schemas.Unset] = schemas.unset, - dateTime: typing.Union[MetaOapg.properties.dateTime, str, datetime, schemas.Unset] = schemas.unset, - password: typing.Union[MetaOapg.properties.password, str, schemas.Unset] = schemas.unset, - callback: typing.Union[MetaOapg.properties.callback, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaForRequestBodyApplicationXWwwFormUrlencoded': - return super().__new__( - cls, - *_args, - number=number, - pattern_without_delimiter=pattern_without_delimiter, - byte=byte, - double=double, - integer=integer, - int32=int32, - int64=int64, - string=string, - binary=binary, - date=date, - dateTime=dateTime, - password=password, - callback=callback, - _configuration=_configuration, - **kwargs, - ) - - -request_body_body = api_client.RequestBody( - content={ - 'application/x-www-form-urlencoded': api_client.MediaType( - schema=SchemaForRequestBodyApplicationXWwwFormUrlencoded), - }, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -@dataclass -class ApiResponseFor404(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_404 = api_client.OpenApiResponse( - response_cls=ApiResponseFor404, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _endpoint_parameters_oapg( - self, - content_type: typing_extensions.Literal["application/x-www-form-urlencoded"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _endpoint_parameters_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _endpoint_parameters_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _endpoint_parameters_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _endpoint_parameters_oapg( - self, - content_type: str = 'application/x-www-form-urlencoded', - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - _fields = None - _body = None - if body is not schemas.unset: - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - auth_settings=_auth, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class EndpointParameters(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def endpoint_parameters( - self, - content_type: typing_extensions.Literal["application/x-www-form-urlencoded"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def endpoint_parameters( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def endpoint_parameters( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def endpoint_parameters( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def endpoint_parameters( - self, - content_type: str = 'application/x-www-form-urlencoded', - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._endpoint_parameters_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - content_type: typing_extensions.Literal["application/x-www-form-urlencoded"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - content_type: str = 'application/x-www-form-urlencoded', - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._endpoint_parameters_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_additional_properties_with_array_of_enums/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_additional_properties_with_array_of_enums/__init__.py deleted file mode 100644 index 704e7f24d97..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_additional_properties_with_array_of_enums/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from petstore_api.paths.fake_additional_properties_with_array_of_enums import Api - -from petstore_api.paths import PathValues - -path = PathValues.FAKE_ADDITIONALPROPERTIESWITHARRAYOFENUMS \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_additional_properties_with_array_of_enums/get.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_additional_properties_with_array_of_enums/get.py deleted file mode 100644 index 8ea9735c6fb..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_additional_properties_with_array_of_enums/get.py +++ /dev/null @@ -1,330 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.additional_properties_with_array_of_enums import AdditionalPropertiesWithArrayOfEnums - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = AdditionalPropertiesWithArrayOfEnums - - -request_body_additional_properties_with_array_of_enums = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, -) -SchemaFor200ResponseBodyApplicationJson = AdditionalPropertiesWithArrayOfEnums - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _additional_properties_with_array_of_enums_oapg( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _additional_properties_with_array_of_enums_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _additional_properties_with_array_of_enums_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _additional_properties_with_array_of_enums_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _additional_properties_with_array_of_enums_oapg( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - Additional Properties with Array of Enums - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - _fields = None - _body = None - if body is not schemas.unset: - serialized_data = request_body_additional_properties_with_array_of_enums.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='get'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class AdditionalPropertiesWithArrayOfEnums(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def additional_properties_with_array_of_enums( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def additional_properties_with_array_of_enums( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def additional_properties_with_array_of_enums( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def additional_properties_with_array_of_enums( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def additional_properties_with_array_of_enums( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._additional_properties_with_array_of_enums_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForget(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def get( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def get( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def get( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def get( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def get( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._additional_properties_with_array_of_enums_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_additional_properties_with_array_of_enums/get.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_additional_properties_with_array_of_enums/get.pyi deleted file mode 100644 index 7422eeaa767..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_additional_properties_with_array_of_enums/get.pyi +++ /dev/null @@ -1,325 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.additional_properties_with_array_of_enums import AdditionalPropertiesWithArrayOfEnums - -# body param -SchemaForRequestBodyApplicationJson = AdditionalPropertiesWithArrayOfEnums - - -request_body_additional_properties_with_array_of_enums = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, -) -SchemaFor200ResponseBodyApplicationJson = AdditionalPropertiesWithArrayOfEnums - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _additional_properties_with_array_of_enums_oapg( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _additional_properties_with_array_of_enums_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _additional_properties_with_array_of_enums_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _additional_properties_with_array_of_enums_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _additional_properties_with_array_of_enums_oapg( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - Additional Properties with Array of Enums - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - _fields = None - _body = None - if body is not schemas.unset: - serialized_data = request_body_additional_properties_with_array_of_enums.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='get'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class AdditionalPropertiesWithArrayOfEnums(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def additional_properties_with_array_of_enums( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def additional_properties_with_array_of_enums( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def additional_properties_with_array_of_enums( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def additional_properties_with_array_of_enums( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def additional_properties_with_array_of_enums( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._additional_properties_with_array_of_enums_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForget(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def get( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def get( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def get( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def get( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def get( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._additional_properties_with_array_of_enums_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_file_schema/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_file_schema/__init__.py deleted file mode 100644 index cae3a5325e8..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_file_schema/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from petstore_api.paths.fake_body_with_file_schema import Api - -from petstore_api.paths import PathValues - -path = PathValues.FAKE_BODYWITHFILESCHEMA \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_file_schema/put.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_file_schema/put.py deleted file mode 100644 index bd4bef9f23e..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_file_schema/put.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.file_schema_test_class import FileSchemaTestClass - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = FileSchemaTestClass - - -request_body_file_schema_test_class = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _body_with_file_schema_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _body_with_file_schema_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _body_with_file_schema_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _body_with_file_schema_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _body_with_file_schema_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_file_schema_test_class.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='put'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class BodyWithFileSchema(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def body_with_file_schema( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def body_with_file_schema( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def body_with_file_schema( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def body_with_file_schema( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def body_with_file_schema( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._body_with_file_schema_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForput(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def put( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def put( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def put( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def put( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def put( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._body_with_file_schema_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_file_schema/put.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_file_schema/put.pyi deleted file mode 100644 index 4ceb43cdc37..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_file_schema/put.pyi +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.file_schema_test_class import FileSchemaTestClass - -# body param -SchemaForRequestBodyApplicationJson = FileSchemaTestClass - - -request_body_file_schema_test_class = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _body_with_file_schema_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _body_with_file_schema_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _body_with_file_schema_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _body_with_file_schema_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _body_with_file_schema_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_file_schema_test_class.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='put'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class BodyWithFileSchema(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def body_with_file_schema( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def body_with_file_schema( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def body_with_file_schema( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def body_with_file_schema( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def body_with_file_schema( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._body_with_file_schema_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForput(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def put( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def put( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def put( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def put( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def put( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._body_with_file_schema_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_query_params/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_query_params/__init__.py deleted file mode 100644 index c79334843e0..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_query_params/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from petstore_api.paths.fake_body_with_query_params import Api - -from petstore_api.paths import PathValues - -path = PathValues.FAKE_BODYWITHQUERYPARAMS \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_query_params/put.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_query_params/put.py deleted file mode 100644 index 6e0bb85629e..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_query_params/put.py +++ /dev/null @@ -1,360 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.user import User - -from . import path - -# Query params -QuerySchema = schemas.StrSchema -RequestRequiredQueryParams = typing_extensions.TypedDict( - 'RequestRequiredQueryParams', - { - 'query': typing.Union[QuerySchema, str, ], - } -) -RequestOptionalQueryParams = typing_extensions.TypedDict( - 'RequestOptionalQueryParams', - { - }, - total=False -) - - -class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): - pass - - -request_query_query = api_client.QueryParameter( - name="query", - style=api_client.ParameterStyle.FORM, - schema=QuerySchema, - required=True, - explode=True, -) -# body param -SchemaForRequestBodyApplicationJson = User - - -request_body_user = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _body_with_query_params_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _body_with_query_params_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _body_with_query_params_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _body_with_query_params_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _body_with_query_params_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) - used_path = path.value - - prefix_separator_iterator = None - for parameter in ( - request_query_query, - ): - parameter_data = query_params.get(parameter.name, schemas.unset) - if parameter_data is schemas.unset: - continue - if prefix_separator_iterator is None: - prefix_separator_iterator = parameter.get_prefix_separator_iterator() - serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) - for serialized_value in serialized_data.values(): - used_path += serialized_value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_user.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='put'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class BodyWithQueryParams(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def body_with_query_params( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def body_with_query_params( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def body_with_query_params( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def body_with_query_params( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def body_with_query_params( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._body_with_query_params_oapg( - body=body, - query_params=query_params, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForput(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def put( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def put( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def put( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def put( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def put( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._body_with_query_params_oapg( - body=body, - query_params=query_params, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_query_params/put.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_query_params/put.pyi deleted file mode 100644 index 95d12b2a433..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_query_params/put.pyi +++ /dev/null @@ -1,355 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.user import User - -# Query params -QuerySchema = schemas.StrSchema -RequestRequiredQueryParams = typing_extensions.TypedDict( - 'RequestRequiredQueryParams', - { - 'query': typing.Union[QuerySchema, str, ], - } -) -RequestOptionalQueryParams = typing_extensions.TypedDict( - 'RequestOptionalQueryParams', - { - }, - total=False -) - - -class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): - pass - - -request_query_query = api_client.QueryParameter( - name="query", - style=api_client.ParameterStyle.FORM, - schema=QuerySchema, - required=True, - explode=True, -) -# body param -SchemaForRequestBodyApplicationJson = User - - -request_body_user = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _body_with_query_params_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _body_with_query_params_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _body_with_query_params_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _body_with_query_params_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _body_with_query_params_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) - used_path = path.value - - prefix_separator_iterator = None - for parameter in ( - request_query_query, - ): - parameter_data = query_params.get(parameter.name, schemas.unset) - if parameter_data is schemas.unset: - continue - if prefix_separator_iterator is None: - prefix_separator_iterator = parameter.get_prefix_separator_iterator() - serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) - for serialized_value in serialized_data.values(): - used_path += serialized_value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_user.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='put'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class BodyWithQueryParams(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def body_with_query_params( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def body_with_query_params( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def body_with_query_params( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def body_with_query_params( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def body_with_query_params( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._body_with_query_params_oapg( - body=body, - query_params=query_params, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForput(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def put( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def put( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def put( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def put( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def put( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._body_with_query_params_oapg( - body=body, - query_params=query_params, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_case_sensitive_params/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_case_sensitive_params/__init__.py deleted file mode 100644 index dcc9e69f9bd..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_case_sensitive_params/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from petstore_api.paths.fake_case_sensitive_params import Api - -from petstore_api.paths import PathValues - -path = PathValues.FAKE_CASESENSITIVEPARAMS \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_case_sensitive_params/put.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_case_sensitive_params/put.py deleted file mode 100644 index 9bf9cf6480e..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_case_sensitive_params/put.py +++ /dev/null @@ -1,280 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from . import path - -# Query params -SomeVarSchema = schemas.StrSchema -SomeVarSchema = schemas.StrSchema -SomeVarSchema = schemas.StrSchema -RequestRequiredQueryParams = typing_extensions.TypedDict( - 'RequestRequiredQueryParams', - { - 'someVar': typing.Union[SomeVarSchema, str, ], - 'SomeVar': typing.Union[SomeVarSchema, str, ], - 'some_var': typing.Union[SomeVarSchema, str, ], - } -) -RequestOptionalQueryParams = typing_extensions.TypedDict( - 'RequestOptionalQueryParams', - { - }, - total=False -) - - -class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): - pass - - -request_query_some_var = api_client.QueryParameter( - name="someVar", - style=api_client.ParameterStyle.FORM, - schema=SomeVarSchema, - required=True, - explode=True, -) -request_query_some_var2 = api_client.QueryParameter( - name="SomeVar", - style=api_client.ParameterStyle.FORM, - schema=SomeVarSchema, - required=True, - explode=True, -) -request_query_some_var3 = api_client.QueryParameter( - name="some_var", - style=api_client.ParameterStyle.FORM, - schema=SomeVarSchema, - required=True, - explode=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _case_sensitive_params_oapg( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _case_sensitive_params_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _case_sensitive_params_oapg( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _case_sensitive_params_oapg( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) - used_path = path.value - - prefix_separator_iterator = None - for parameter in ( - request_query_some_var, - request_query_some_var2, - request_query_some_var3, - ): - parameter_data = query_params.get(parameter.name, schemas.unset) - if parameter_data is schemas.unset: - continue - if prefix_separator_iterator is None: - prefix_separator_iterator = parameter.get_prefix_separator_iterator() - serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) - for serialized_value in serialized_data.values(): - used_path += serialized_value - # TODO add cookie handling - - response = self.api_client.call_api( - resource_path=used_path, - method='put'.upper(), - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class CaseSensitiveParams(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def case_sensitive_params( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def case_sensitive_params( - self, - skip_deserialization: typing_extensions.Literal[True], - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def case_sensitive_params( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def case_sensitive_params( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._case_sensitive_params_oapg( - query_params=query_params, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForput(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def put( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def put( - self, - skip_deserialization: typing_extensions.Literal[True], - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def put( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def put( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._case_sensitive_params_oapg( - query_params=query_params, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_case_sensitive_params/put.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_case_sensitive_params/put.pyi deleted file mode 100644 index edcd028d8bd..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_case_sensitive_params/put.pyi +++ /dev/null @@ -1,275 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -# Query params -SomeVarSchema = schemas.StrSchema -SomeVarSchema = schemas.StrSchema -SomeVarSchema = schemas.StrSchema -RequestRequiredQueryParams = typing_extensions.TypedDict( - 'RequestRequiredQueryParams', - { - 'someVar': typing.Union[SomeVarSchema, str, ], - 'SomeVar': typing.Union[SomeVarSchema, str, ], - 'some_var': typing.Union[SomeVarSchema, str, ], - } -) -RequestOptionalQueryParams = typing_extensions.TypedDict( - 'RequestOptionalQueryParams', - { - }, - total=False -) - - -class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): - pass - - -request_query_some_var = api_client.QueryParameter( - name="someVar", - style=api_client.ParameterStyle.FORM, - schema=SomeVarSchema, - required=True, - explode=True, -) -request_query_some_var2 = api_client.QueryParameter( - name="SomeVar", - style=api_client.ParameterStyle.FORM, - schema=SomeVarSchema, - required=True, - explode=True, -) -request_query_some_var3 = api_client.QueryParameter( - name="some_var", - style=api_client.ParameterStyle.FORM, - schema=SomeVarSchema, - required=True, - explode=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _case_sensitive_params_oapg( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _case_sensitive_params_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _case_sensitive_params_oapg( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _case_sensitive_params_oapg( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) - used_path = path.value - - prefix_separator_iterator = None - for parameter in ( - request_query_some_var, - request_query_some_var2, - request_query_some_var3, - ): - parameter_data = query_params.get(parameter.name, schemas.unset) - if parameter_data is schemas.unset: - continue - if prefix_separator_iterator is None: - prefix_separator_iterator = parameter.get_prefix_separator_iterator() - serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) - for serialized_value in serialized_data.values(): - used_path += serialized_value - # TODO add cookie handling - - response = self.api_client.call_api( - resource_path=used_path, - method='put'.upper(), - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class CaseSensitiveParams(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def case_sensitive_params( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def case_sensitive_params( - self, - skip_deserialization: typing_extensions.Literal[True], - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def case_sensitive_params( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def case_sensitive_params( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._case_sensitive_params_oapg( - query_params=query_params, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForput(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def put( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def put( - self, - skip_deserialization: typing_extensions.Literal[True], - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def put( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def put( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._case_sensitive_params_oapg( - query_params=query_params, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_classname_test/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_classname_test/__init__.py deleted file mode 100644 index d162dcc8f69..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_classname_test/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from petstore_api.paths.fake_classname_test import Api - -from petstore_api.paths import PathValues - -path = PathValues.FAKE_CLASSNAME_TEST \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_classname_test/patch.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_classname_test/patch.py deleted file mode 100644 index 6a8ea9a94ed..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_classname_test/patch.py +++ /dev/null @@ -1,337 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.client import Client - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = Client - - -request_body_client = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) -_auth = [ - 'api_key_query', -] -SchemaFor200ResponseBodyApplicationJson = Client - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _classname_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _classname_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _classname_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _classname_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _classname_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - To test class name in snake case - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_client.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='patch'.upper(), - headers=_headers, - fields=_fields, - body=_body, - auth_settings=_auth, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class Classname(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def classname( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def classname( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def classname( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def classname( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def classname( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._classname_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpatch(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def patch( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def patch( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def patch( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def patch( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def patch( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._classname_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_classname_test/patch.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_classname_test/patch.pyi deleted file mode 100644 index 63a2d59889a..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_classname_test/patch.pyi +++ /dev/null @@ -1,329 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.client import Client - -# body param -SchemaForRequestBodyApplicationJson = Client - - -request_body_client = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) -SchemaFor200ResponseBodyApplicationJson = Client - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _classname_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _classname_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _classname_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _classname_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _classname_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - To test class name in snake case - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_client.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='patch'.upper(), - headers=_headers, - fields=_fields, - body=_body, - auth_settings=_auth, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class Classname(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def classname( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def classname( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def classname( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def classname( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def classname( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._classname_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpatch(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def patch( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def patch( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def patch( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def patch( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def patch( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._classname_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_delete_coffee_id/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_delete_coffee_id/__init__.py deleted file mode 100644 index 810d63883b8..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_delete_coffee_id/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from petstore_api.paths.fake_delete_coffee_id import Api - -from petstore_api.paths import PathValues - -path = PathValues.FAKE_DELETE_COFFEE_ID \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_delete_coffee_id/delete.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_delete_coffee_id/delete.py deleted file mode 100644 index b51db4af2b5..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_delete_coffee_id/delete.py +++ /dev/null @@ -1,283 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from . import path - -# Path params -IdSchema = schemas.StrSchema -RequestRequiredPathParams = typing_extensions.TypedDict( - 'RequestRequiredPathParams', - { - 'id': typing.Union[IdSchema, str, ], - } -) -RequestOptionalPathParams = typing_extensions.TypedDict( - 'RequestOptionalPathParams', - { - }, - total=False -) - - -class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): - pass - - -request_path_id = api_client.PathParameter( - name="id", - style=api_client.ParameterStyle.SIMPLE, - schema=IdSchema, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -@dataclass -class ApiResponseForDefault(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_default = api_client.OpenApiResponse( - response_cls=ApiResponseForDefault, -) -_status_code_to_response = { - '200': _response_for_200, - 'default': _response_for_default, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _delete_coffee_oapg( - self, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ApiResponseForDefault, - ]: ... - - @typing.overload - def _delete_coffee_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _delete_coffee_oapg( - self, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - ApiResponseForDefault, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _delete_coffee_oapg( - self, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - Delete coffee - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) - used_path = path.value - - _path_params = {} - for parameter in ( - request_path_id, - ): - parameter_data = path_params.get(parameter.name, schemas.unset) - if parameter_data is schemas.unset: - continue - serialized_data = parameter.serialize(parameter_data) - _path_params.update(serialized_data) - - for k, v in _path_params.items(): - used_path = used_path.replace('{%s}' % k, v) - # TODO add cookie handling - - response = self.api_client.call_api( - resource_path=used_path, - method='delete'.upper(), - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - default_response = _status_code_to_response.get('default') - if default_response: - api_response = default_response.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class DeleteCoffee(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def delete_coffee( - self, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ApiResponseForDefault, - ]: ... - - @typing.overload - def delete_coffee( - self, - skip_deserialization: typing_extensions.Literal[True], - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def delete_coffee( - self, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - ApiResponseForDefault, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def delete_coffee( - self, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._delete_coffee_oapg( - path_params=path_params, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiFordelete(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def delete( - self, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ApiResponseForDefault, - ]: ... - - @typing.overload - def delete( - self, - skip_deserialization: typing_extensions.Literal[True], - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def delete( - self, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - ApiResponseForDefault, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def delete( - self, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._delete_coffee_oapg( - path_params=path_params, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_delete_coffee_id/delete.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_delete_coffee_id/delete.pyi deleted file mode 100644 index c283abc29a9..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_delete_coffee_id/delete.pyi +++ /dev/null @@ -1,277 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -# Path params -IdSchema = schemas.StrSchema -RequestRequiredPathParams = typing_extensions.TypedDict( - 'RequestRequiredPathParams', - { - 'id': typing.Union[IdSchema, str, ], - } -) -RequestOptionalPathParams = typing_extensions.TypedDict( - 'RequestOptionalPathParams', - { - }, - total=False -) - - -class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): - pass - - -request_path_id = api_client.PathParameter( - name="id", - style=api_client.ParameterStyle.SIMPLE, - schema=IdSchema, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -@dataclass -class ApiResponseForDefault(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_default = api_client.OpenApiResponse( - response_cls=ApiResponseForDefault, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _delete_coffee_oapg( - self, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ApiResponseForDefault, - ]: ... - - @typing.overload - def _delete_coffee_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _delete_coffee_oapg( - self, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - ApiResponseForDefault, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _delete_coffee_oapg( - self, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - Delete coffee - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) - used_path = path.value - - _path_params = {} - for parameter in ( - request_path_id, - ): - parameter_data = path_params.get(parameter.name, schemas.unset) - if parameter_data is schemas.unset: - continue - serialized_data = parameter.serialize(parameter_data) - _path_params.update(serialized_data) - - for k, v in _path_params.items(): - used_path = used_path.replace('{%s}' % k, v) - # TODO add cookie handling - - response = self.api_client.call_api( - resource_path=used_path, - method='delete'.upper(), - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - default_response = _status_code_to_response.get('default') - if default_response: - api_response = default_response.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class DeleteCoffee(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def delete_coffee( - self, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ApiResponseForDefault, - ]: ... - - @typing.overload - def delete_coffee( - self, - skip_deserialization: typing_extensions.Literal[True], - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def delete_coffee( - self, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - ApiResponseForDefault, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def delete_coffee( - self, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._delete_coffee_oapg( - path_params=path_params, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiFordelete(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def delete( - self, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ApiResponseForDefault, - ]: ... - - @typing.overload - def delete( - self, - skip_deserialization: typing_extensions.Literal[True], - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def delete( - self, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - ApiResponseForDefault, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def delete( - self, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._delete_coffee_oapg( - path_params=path_params, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_health/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_health/__init__.py deleted file mode 100644 index d113dc832c1..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_health/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from petstore_api.paths.fake_health import Api - -from petstore_api.paths import PathValues - -path = PathValues.FAKE_HEALTH \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_health/get.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_health/get.py deleted file mode 100644 index 2875b270fa9..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_health/get.py +++ /dev/null @@ -1,239 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.health_check_result import HealthCheckResult - -from . import path - -SchemaFor200ResponseBodyApplicationJson = HealthCheckResult - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _fake_health_get_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _fake_health_get_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _fake_health_get_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _fake_health_get_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - Health check endpoint - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='get'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class FakeHealthGet(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def fake_health_get( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def fake_health_get( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def fake_health_get( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def fake_health_get( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._fake_health_get_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForget(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def get( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def get( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def get( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def get( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._fake_health_get_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_health/get.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_health/get.pyi deleted file mode 100644 index bf79bef82cf..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_health/get.pyi +++ /dev/null @@ -1,234 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.health_check_result import HealthCheckResult - -SchemaFor200ResponseBodyApplicationJson = HealthCheckResult - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _fake_health_get_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _fake_health_get_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _fake_health_get_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _fake_health_get_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - Health check endpoint - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='get'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class FakeHealthGet(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def fake_health_get( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def fake_health_get( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def fake_health_get( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def fake_health_get( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._fake_health_get_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForget(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def get( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def get( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def get( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def get( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._fake_health_get_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_additional_properties/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_additional_properties/__init__.py deleted file mode 100644 index 4f2ec020c5b..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_additional_properties/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from petstore_api.paths.fake_inline_additional_properties import Api - -from petstore_api.paths import PathValues - -path = PathValues.FAKE_INLINEADDITIONAL_PROPERTIES \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_additional_properties/post.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_additional_properties/post.py deleted file mode 100644 index eacced100b5..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_additional_properties/post.py +++ /dev/null @@ -1,329 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from . import path - -# body param - - -class SchemaForRequestBodyApplicationJson( - schemas.DictSchema -): - - - class MetaOapg: - additional_properties = schemas.StrSchema - - def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, str, ], - ) -> 'SchemaForRequestBodyApplicationJson': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - -request_body_request_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _inline_additional_properties_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _inline_additional_properties_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _inline_additional_properties_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _inline_additional_properties_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _inline_additional_properties_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - test inline additionalProperties - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_request_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class InlineAdditionalProperties(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def inline_additional_properties( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def inline_additional_properties( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def inline_additional_properties( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def inline_additional_properties( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def inline_additional_properties( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._inline_additional_properties_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._inline_additional_properties_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_additional_properties/post.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_additional_properties/post.pyi deleted file mode 100644 index 8cd14929f0f..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_additional_properties/post.pyi +++ /dev/null @@ -1,324 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -# body param - - -class SchemaForRequestBodyApplicationJson( - schemas.DictSchema -): - - - class MetaOapg: - additional_properties = schemas.StrSchema - - def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, str, ], - ) -> 'SchemaForRequestBodyApplicationJson': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - -request_body_request_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _inline_additional_properties_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _inline_additional_properties_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _inline_additional_properties_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _inline_additional_properties_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _inline_additional_properties_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - test inline additionalProperties - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_request_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class InlineAdditionalProperties(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def inline_additional_properties( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def inline_additional_properties( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def inline_additional_properties( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def inline_additional_properties( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def inline_additional_properties( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._inline_additional_properties_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._inline_additional_properties_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_composition_/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_composition_/__init__.py deleted file mode 100644 index b3a8a011277..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_composition_/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from petstore_api.paths.fake_inline_composition_ import Api - -from petstore_api.paths import PathValues - -path = PathValues.FAKE_INLINE_COMPOSITION_ \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_composition_/post.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_composition_/post.py deleted file mode 100644 index 91df2c90f1a..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_composition_/post.py +++ /dev/null @@ -1,855 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from . import path - -# Query params - - -class CompositionAtRootSchema( - schemas.ComposedSchema, -): - - - class MetaOapg: - - - class all_of_0( - schemas.StrSchema - ): - - - class MetaOapg: - min_length = 1 - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.all_of_0, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'CompositionAtRootSchema': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - -class CompositionInPropertySchema( - schemas.DictSchema -): - - - class MetaOapg: - - class properties: - - - class someProp( - schemas.ComposedSchema, - ): - - - class MetaOapg: - - - class all_of_0( - schemas.StrSchema - ): - - - class MetaOapg: - min_length = 1 - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.all_of_0, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'someProp': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - __annotations__ = { - "someProp": someProp, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["someProp"]) -> MetaOapg.properties.someProp: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["someProp", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["someProp"]) -> typing.Union[MetaOapg.properties.someProp, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["someProp", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - someProp: typing.Union[MetaOapg.properties.someProp, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'CompositionInPropertySchema': - return super().__new__( - cls, - *_args, - someProp=someProp, - _configuration=_configuration, - **kwargs, - ) -RequestRequiredQueryParams = typing_extensions.TypedDict( - 'RequestRequiredQueryParams', - { - } -) -RequestOptionalQueryParams = typing_extensions.TypedDict( - 'RequestOptionalQueryParams', - { - 'compositionAtRoot': typing.Union[CompositionAtRootSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - 'compositionInProperty': typing.Union[CompositionInPropertySchema, dict, frozendict.frozendict, ], - }, - total=False -) - - -class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): - pass - - -request_query_composition_at_root = api_client.QueryParameter( - name="compositionAtRoot", - style=api_client.ParameterStyle.FORM, - schema=CompositionAtRootSchema, - explode=True, -) -request_query_composition_in_property = api_client.QueryParameter( - name="compositionInProperty", - style=api_client.ParameterStyle.FORM, - schema=CompositionInPropertySchema, - explode=True, -) -# body param - - -class SchemaForRequestBodyApplicationJson( - schemas.ComposedSchema, -): - - - class MetaOapg: - - - class all_of_0( - schemas.StrSchema - ): - - - class MetaOapg: - min_length = 1 - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.all_of_0, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaForRequestBodyApplicationJson': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - -class SchemaForRequestBodyMultipartFormData( - schemas.DictSchema -): - - - class MetaOapg: - - class properties: - - - class someProp( - schemas.ComposedSchema, - ): - - - class MetaOapg: - - - class all_of_0( - schemas.StrSchema - ): - - - class MetaOapg: - min_length = 1 - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.all_of_0, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'someProp': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - __annotations__ = { - "someProp": someProp, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["someProp"]) -> MetaOapg.properties.someProp: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["someProp", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["someProp"]) -> typing.Union[MetaOapg.properties.someProp, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["someProp", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - someProp: typing.Union[MetaOapg.properties.someProp, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaForRequestBodyMultipartFormData': - return super().__new__( - cls, - *_args, - someProp=someProp, - _configuration=_configuration, - **kwargs, - ) - - -request_body_any_type = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - 'multipart/form-data': api_client.MediaType( - schema=SchemaForRequestBodyMultipartFormData), - }, -) - - -class SchemaFor200ResponseBodyApplicationJson( - schemas.ComposedSchema, -): - - - class MetaOapg: - - - class all_of_0( - schemas.StrSchema - ): - - - class MetaOapg: - min_length = 1 - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.all_of_0, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaFor200ResponseBodyApplicationJson': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - -class SchemaFor200ResponseBodyMultipartFormData( - schemas.DictSchema -): - - - class MetaOapg: - - class properties: - - - class someProp( - schemas.ComposedSchema, - ): - - - class MetaOapg: - - - class all_of_0( - schemas.StrSchema - ): - - - class MetaOapg: - min_length = 1 - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.all_of_0, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'someProp': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - __annotations__ = { - "someProp": someProp, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["someProp"]) -> MetaOapg.properties.someProp: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["someProp", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["someProp"]) -> typing.Union[MetaOapg.properties.someProp, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["someProp", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - someProp: typing.Union[MetaOapg.properties.someProp, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaFor200ResponseBodyMultipartFormData': - return super().__new__( - cls, - *_args, - someProp=someProp, - _configuration=_configuration, - **kwargs, - ) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - SchemaFor200ResponseBodyMultipartFormData, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - 'multipart/form-data': api_client.MediaType( - schema=SchemaFor200ResponseBodyMultipartFormData), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', - 'multipart/form-data', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _inline_composition_oapg( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _inline_composition_oapg( - self, - content_type: typing_extensions.Literal["multipart/form-data"], - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _inline_composition_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _inline_composition_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _inline_composition_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _inline_composition_oapg( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - testing composed schemas at inline locations - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) - used_path = path.value - - prefix_separator_iterator = None - for parameter in ( - request_query_composition_at_root, - request_query_composition_in_property, - ): - parameter_data = query_params.get(parameter.name, schemas.unset) - if parameter_data is schemas.unset: - continue - if prefix_separator_iterator is None: - prefix_separator_iterator = parameter.get_prefix_separator_iterator() - serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) - for serialized_value in serialized_data.values(): - used_path += serialized_value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - _fields = None - _body = None - if body is not schemas.unset: - serialized_data = request_body_any_type.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class InlineComposition(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def inline_composition( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def inline_composition( - self, - content_type: typing_extensions.Literal["multipart/form-data"], - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def inline_composition( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def inline_composition( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def inline_composition( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def inline_composition( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._inline_composition_oapg( - body=body, - query_params=query_params, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - content_type: typing_extensions.Literal["multipart/form-data"], - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._inline_composition_oapg( - body=body, - query_params=query_params, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_composition_/post.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_composition_/post.pyi deleted file mode 100644 index 1492f6b64a8..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_composition_/post.pyi +++ /dev/null @@ -1,832 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -# Query params - - -class CompositionAtRootSchema( - schemas.ComposedSchema, -): - - - class MetaOapg: - - - class all_of_0( - schemas.StrSchema - ): - pass - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.all_of_0, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'CompositionAtRootSchema': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - -class CompositionInPropertySchema( - schemas.DictSchema -): - - - class MetaOapg: - - class properties: - - - class someProp( - schemas.ComposedSchema, - ): - - - class MetaOapg: - - - class all_of_0( - schemas.StrSchema - ): - pass - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.all_of_0, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'someProp': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - __annotations__ = { - "someProp": someProp, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["someProp"]) -> MetaOapg.properties.someProp: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["someProp", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["someProp"]) -> typing.Union[MetaOapg.properties.someProp, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["someProp", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - someProp: typing.Union[MetaOapg.properties.someProp, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'CompositionInPropertySchema': - return super().__new__( - cls, - *_args, - someProp=someProp, - _configuration=_configuration, - **kwargs, - ) -RequestRequiredQueryParams = typing_extensions.TypedDict( - 'RequestRequiredQueryParams', - { - } -) -RequestOptionalQueryParams = typing_extensions.TypedDict( - 'RequestOptionalQueryParams', - { - 'compositionAtRoot': typing.Union[CompositionAtRootSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - 'compositionInProperty': typing.Union[CompositionInPropertySchema, dict, frozendict.frozendict, ], - }, - total=False -) - - -class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): - pass - - -request_query_composition_at_root = api_client.QueryParameter( - name="compositionAtRoot", - style=api_client.ParameterStyle.FORM, - schema=CompositionAtRootSchema, - explode=True, -) -request_query_composition_in_property = api_client.QueryParameter( - name="compositionInProperty", - style=api_client.ParameterStyle.FORM, - schema=CompositionInPropertySchema, - explode=True, -) -# body param - - -class SchemaForRequestBodyApplicationJson( - schemas.ComposedSchema, -): - - - class MetaOapg: - - - class all_of_0( - schemas.StrSchema - ): - pass - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.all_of_0, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaForRequestBodyApplicationJson': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - -class SchemaForRequestBodyMultipartFormData( - schemas.DictSchema -): - - - class MetaOapg: - - class properties: - - - class someProp( - schemas.ComposedSchema, - ): - - - class MetaOapg: - - - class all_of_0( - schemas.StrSchema - ): - pass - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.all_of_0, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'someProp': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - __annotations__ = { - "someProp": someProp, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["someProp"]) -> MetaOapg.properties.someProp: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["someProp", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["someProp"]) -> typing.Union[MetaOapg.properties.someProp, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["someProp", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - someProp: typing.Union[MetaOapg.properties.someProp, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaForRequestBodyMultipartFormData': - return super().__new__( - cls, - *_args, - someProp=someProp, - _configuration=_configuration, - **kwargs, - ) - - -request_body_any_type = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - 'multipart/form-data': api_client.MediaType( - schema=SchemaForRequestBodyMultipartFormData), - }, -) - - -class SchemaFor200ResponseBodyApplicationJson( - schemas.ComposedSchema, -): - - - class MetaOapg: - - - class all_of_0( - schemas.StrSchema - ): - pass - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.all_of_0, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaFor200ResponseBodyApplicationJson': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - -class SchemaFor200ResponseBodyMultipartFormData( - schemas.DictSchema -): - - - class MetaOapg: - - class properties: - - - class someProp( - schemas.ComposedSchema, - ): - - - class MetaOapg: - - - class all_of_0( - schemas.StrSchema - ): - pass - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.all_of_0, - ] - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'someProp': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - __annotations__ = { - "someProp": someProp, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["someProp"]) -> MetaOapg.properties.someProp: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["someProp", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["someProp"]) -> typing.Union[MetaOapg.properties.someProp, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["someProp", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - someProp: typing.Union[MetaOapg.properties.someProp, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaFor200ResponseBodyMultipartFormData': - return super().__new__( - cls, - *_args, - someProp=someProp, - _configuration=_configuration, - **kwargs, - ) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - SchemaFor200ResponseBodyMultipartFormData, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - 'multipart/form-data': api_client.MediaType( - schema=SchemaFor200ResponseBodyMultipartFormData), - }, -) -_all_accept_content_types = ( - 'application/json', - 'multipart/form-data', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _inline_composition_oapg( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _inline_composition_oapg( - self, - content_type: typing_extensions.Literal["multipart/form-data"], - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _inline_composition_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _inline_composition_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _inline_composition_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _inline_composition_oapg( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - testing composed schemas at inline locations - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) - used_path = path.value - - prefix_separator_iterator = None - for parameter in ( - request_query_composition_at_root, - request_query_composition_in_property, - ): - parameter_data = query_params.get(parameter.name, schemas.unset) - if parameter_data is schemas.unset: - continue - if prefix_separator_iterator is None: - prefix_separator_iterator = parameter.get_prefix_separator_iterator() - serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) - for serialized_value in serialized_data.values(): - used_path += serialized_value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - _fields = None - _body = None - if body is not schemas.unset: - serialized_data = request_body_any_type.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class InlineComposition(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def inline_composition( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def inline_composition( - self, - content_type: typing_extensions.Literal["multipart/form-data"], - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def inline_composition( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def inline_composition( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def inline_composition( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def inline_composition( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._inline_composition_oapg( - body=body, - query_params=query_params, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - content_type: typing_extensions.Literal["multipart/form-data"], - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._inline_composition_oapg( - body=body, - query_params=query_params, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_form_data/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_form_data/__init__.py deleted file mode 100644 index e66fc387729..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_form_data/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from petstore_api.paths.fake_json_form_data import Api - -from petstore_api.paths import PathValues - -path = PathValues.FAKE_JSON_FORM_DATA \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_form_data/get.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_form_data/get.py deleted file mode 100644 index 3ccf0eac8e1..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_form_data/get.py +++ /dev/null @@ -1,364 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from . import path - -# body param - - -class SchemaForRequestBodyApplicationXWwwFormUrlencoded( - schemas.DictSchema -): - - - class MetaOapg: - required = { - "param", - "param2", - } - - class properties: - param = schemas.StrSchema - param2 = schemas.StrSchema - __annotations__ = { - "param": param, - "param2": param2, - } - - param: MetaOapg.properties.param - param2: MetaOapg.properties.param2 - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["param"]) -> MetaOapg.properties.param: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["param2"]) -> MetaOapg.properties.param2: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["param", "param2", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["param"]) -> MetaOapg.properties.param: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["param2"]) -> MetaOapg.properties.param2: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["param", "param2", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - param: typing.Union[MetaOapg.properties.param, str, ], - param2: typing.Union[MetaOapg.properties.param2, str, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaForRequestBodyApplicationXWwwFormUrlencoded': - return super().__new__( - cls, - *_args, - param=param, - param2=param2, - _configuration=_configuration, - **kwargs, - ) - - -request_body_body = api_client.RequestBody( - content={ - 'application/x-www-form-urlencoded': api_client.MediaType( - schema=SchemaForRequestBodyApplicationXWwwFormUrlencoded), - }, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _json_form_data_oapg( - self, - content_type: typing_extensions.Literal["application/x-www-form-urlencoded"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _json_form_data_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _json_form_data_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _json_form_data_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _json_form_data_oapg( - self, - content_type: str = 'application/x-www-form-urlencoded', - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - test json serialization of form data - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - _fields = None - _body = None - if body is not schemas.unset: - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='get'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class JsonFormData(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def json_form_data( - self, - content_type: typing_extensions.Literal["application/x-www-form-urlencoded"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def json_form_data( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def json_form_data( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def json_form_data( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def json_form_data( - self, - content_type: str = 'application/x-www-form-urlencoded', - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._json_form_data_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForget(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def get( - self, - content_type: typing_extensions.Literal["application/x-www-form-urlencoded"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def get( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def get( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def get( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def get( - self, - content_type: str = 'application/x-www-form-urlencoded', - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._json_form_data_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_form_data/get.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_form_data/get.pyi deleted file mode 100644 index c9db50fba68..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_form_data/get.pyi +++ /dev/null @@ -1,359 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -# body param - - -class SchemaForRequestBodyApplicationXWwwFormUrlencoded( - schemas.DictSchema -): - - - class MetaOapg: - required = { - "param", - "param2", - } - - class properties: - param = schemas.StrSchema - param2 = schemas.StrSchema - __annotations__ = { - "param": param, - "param2": param2, - } - - param: MetaOapg.properties.param - param2: MetaOapg.properties.param2 - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["param"]) -> MetaOapg.properties.param: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["param2"]) -> MetaOapg.properties.param2: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["param", "param2", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["param"]) -> MetaOapg.properties.param: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["param2"]) -> MetaOapg.properties.param2: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["param", "param2", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - param: typing.Union[MetaOapg.properties.param, str, ], - param2: typing.Union[MetaOapg.properties.param2, str, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaForRequestBodyApplicationXWwwFormUrlencoded': - return super().__new__( - cls, - *_args, - param=param, - param2=param2, - _configuration=_configuration, - **kwargs, - ) - - -request_body_body = api_client.RequestBody( - content={ - 'application/x-www-form-urlencoded': api_client.MediaType( - schema=SchemaForRequestBodyApplicationXWwwFormUrlencoded), - }, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _json_form_data_oapg( - self, - content_type: typing_extensions.Literal["application/x-www-form-urlencoded"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _json_form_data_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _json_form_data_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _json_form_data_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _json_form_data_oapg( - self, - content_type: str = 'application/x-www-form-urlencoded', - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - test json serialization of form data - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - _fields = None - _body = None - if body is not schemas.unset: - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='get'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class JsonFormData(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def json_form_data( - self, - content_type: typing_extensions.Literal["application/x-www-form-urlencoded"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def json_form_data( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def json_form_data( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def json_form_data( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def json_form_data( - self, - content_type: str = 'application/x-www-form-urlencoded', - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._json_form_data_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForget(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def get( - self, - content_type: typing_extensions.Literal["application/x-www-form-urlencoded"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def get( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def get( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def get( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def get( - self, - content_type: str = 'application/x-www-form-urlencoded', - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._json_form_data_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_patch/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_patch/__init__.py deleted file mode 100644 index b302e74cceb..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_patch/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from petstore_api.paths.fake_json_patch import Api - -from petstore_api.paths import PathValues - -path = PathValues.FAKE_JSON_PATCH \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_patch/patch.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_patch/patch.py deleted file mode 100644 index a6644e4413d..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_patch/patch.py +++ /dev/null @@ -1,300 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.json_patch_request import JSONPatchRequest - -from . import path - -# body param -SchemaForRequestBodyApplicationJsonPatchjson = JSONPatchRequest - - -request_body_json_patch_request = api_client.RequestBody( - content={ - 'application/json-patch+json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJsonPatchjson), - }, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _json_patch_oapg( - self, - content_type: typing_extensions.Literal["application/json-patch+json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJsonPatchjson, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _json_patch_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJsonPatchjson, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _json_patch_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJsonPatchjson, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _json_patch_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJsonPatchjson, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _json_patch_oapg( - self, - content_type: str = 'application/json-patch+json', - body: typing.Union[SchemaForRequestBodyApplicationJsonPatchjson, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - json patch - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - _fields = None - _body = None - if body is not schemas.unset: - serialized_data = request_body_json_patch_request.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='patch'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class JsonPatch(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def json_patch( - self, - content_type: typing_extensions.Literal["application/json-patch+json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJsonPatchjson, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def json_patch( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJsonPatchjson, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def json_patch( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJsonPatchjson, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def json_patch( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJsonPatchjson, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def json_patch( - self, - content_type: str = 'application/json-patch+json', - body: typing.Union[SchemaForRequestBodyApplicationJsonPatchjson, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._json_patch_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpatch(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def patch( - self, - content_type: typing_extensions.Literal["application/json-patch+json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJsonPatchjson, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def patch( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJsonPatchjson, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def patch( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJsonPatchjson, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def patch( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJsonPatchjson, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def patch( - self, - content_type: str = 'application/json-patch+json', - body: typing.Union[SchemaForRequestBodyApplicationJsonPatchjson, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._json_patch_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_patch/patch.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_patch/patch.pyi deleted file mode 100644 index 0199f31ca69..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_patch/patch.pyi +++ /dev/null @@ -1,295 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.json_patch_request import JSONPatchRequest - -# body param -SchemaForRequestBodyApplicationJsonPatchjson = JSONPatchRequest - - -request_body_json_patch_request = api_client.RequestBody( - content={ - 'application/json-patch+json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJsonPatchjson), - }, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _json_patch_oapg( - self, - content_type: typing_extensions.Literal["application/json-patch+json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJsonPatchjson, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _json_patch_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJsonPatchjson, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _json_patch_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJsonPatchjson, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _json_patch_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJsonPatchjson, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _json_patch_oapg( - self, - content_type: str = 'application/json-patch+json', - body: typing.Union[SchemaForRequestBodyApplicationJsonPatchjson, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - json patch - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - _fields = None - _body = None - if body is not schemas.unset: - serialized_data = request_body_json_patch_request.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='patch'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class JsonPatch(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def json_patch( - self, - content_type: typing_extensions.Literal["application/json-patch+json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJsonPatchjson, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def json_patch( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJsonPatchjson, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def json_patch( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJsonPatchjson, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def json_patch( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJsonPatchjson, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def json_patch( - self, - content_type: str = 'application/json-patch+json', - body: typing.Union[SchemaForRequestBodyApplicationJsonPatchjson, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._json_patch_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpatch(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def patch( - self, - content_type: typing_extensions.Literal["application/json-patch+json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJsonPatchjson, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def patch( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJsonPatchjson, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def patch( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJsonPatchjson, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def patch( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJsonPatchjson, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def patch( - self, - content_type: str = 'application/json-patch+json', - body: typing.Union[SchemaForRequestBodyApplicationJsonPatchjson, schemas.Unset] = schemas.unset, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._json_patch_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_with_charset/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_with_charset/__init__.py deleted file mode 100644 index 3adee6e9d67..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_with_charset/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from petstore_api.paths.fake_json_with_charset import Api - -from petstore_api.paths import PathValues - -path = PathValues.FAKE_JSON_WITH_CHARSET \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_with_charset/post.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_with_charset/post.py deleted file mode 100644 index 5e82e1fb637..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_with_charset/post.py +++ /dev/null @@ -1,328 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from . import path - -# body param -SchemaForRequestBodyApplicationJsonCharsetutf8 = schemas.AnyTypeSchema - - -request_body_body = api_client.RequestBody( - content={ - 'application/json; charset=utf-8': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJsonCharsetutf8), - }, -) -SchemaFor200ResponseBodyApplicationJsonCharsetutf8 = schemas.AnyTypeSchema - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJsonCharsetutf8, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json; charset=utf-8': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJsonCharsetutf8), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json; charset=utf-8', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _json_with_charset_oapg( - self, - content_type: typing_extensions.Literal["application/json; charset=utf-8"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJsonCharsetutf8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _json_with_charset_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJsonCharsetutf8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _json_with_charset_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJsonCharsetutf8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _json_with_charset_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJsonCharsetutf8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _json_with_charset_oapg( - self, - content_type: str = 'application/json; charset=utf-8', - body: typing.Union[SchemaForRequestBodyApplicationJsonCharsetutf8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - json with charset tx and rx - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - _fields = None - _body = None - if body is not schemas.unset: - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class JsonWithCharset(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def json_with_charset( - self, - content_type: typing_extensions.Literal["application/json; charset=utf-8"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJsonCharsetutf8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def json_with_charset( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJsonCharsetutf8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def json_with_charset( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJsonCharsetutf8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def json_with_charset( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJsonCharsetutf8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def json_with_charset( - self, - content_type: str = 'application/json; charset=utf-8', - body: typing.Union[SchemaForRequestBodyApplicationJsonCharsetutf8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._json_with_charset_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - content_type: typing_extensions.Literal["application/json; charset=utf-8"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJsonCharsetutf8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJsonCharsetutf8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJsonCharsetutf8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJsonCharsetutf8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - content_type: str = 'application/json; charset=utf-8', - body: typing.Union[SchemaForRequestBodyApplicationJsonCharsetutf8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._json_with_charset_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_with_charset/post.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_with_charset/post.pyi deleted file mode 100644 index 8a83a49e9dd..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_with_charset/post.pyi +++ /dev/null @@ -1,323 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -# body param -SchemaForRequestBodyApplicationJsonCharsetutf8 = schemas.AnyTypeSchema - - -request_body_body = api_client.RequestBody( - content={ - 'application/json; charset=utf-8': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJsonCharsetutf8), - }, -) -SchemaFor200ResponseBodyApplicationJsonCharsetutf8 = schemas.AnyTypeSchema - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJsonCharsetutf8, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json; charset=utf-8': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJsonCharsetutf8), - }, -) -_all_accept_content_types = ( - 'application/json; charset=utf-8', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _json_with_charset_oapg( - self, - content_type: typing_extensions.Literal["application/json; charset=utf-8"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJsonCharsetutf8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _json_with_charset_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJsonCharsetutf8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _json_with_charset_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJsonCharsetutf8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _json_with_charset_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJsonCharsetutf8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _json_with_charset_oapg( - self, - content_type: str = 'application/json; charset=utf-8', - body: typing.Union[SchemaForRequestBodyApplicationJsonCharsetutf8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - json with charset tx and rx - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - _fields = None - _body = None - if body is not schemas.unset: - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class JsonWithCharset(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def json_with_charset( - self, - content_type: typing_extensions.Literal["application/json; charset=utf-8"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJsonCharsetutf8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def json_with_charset( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJsonCharsetutf8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def json_with_charset( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJsonCharsetutf8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def json_with_charset( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJsonCharsetutf8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def json_with_charset( - self, - content_type: str = 'application/json; charset=utf-8', - body: typing.Union[SchemaForRequestBodyApplicationJsonCharsetutf8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._json_with_charset_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - content_type: typing_extensions.Literal["application/json; charset=utf-8"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJsonCharsetutf8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJsonCharsetutf8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJsonCharsetutf8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJsonCharsetutf8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - content_type: str = 'application/json; charset=utf-8', - body: typing.Union[SchemaForRequestBodyApplicationJsonCharsetutf8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._json_with_charset_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_obj_in_query/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_obj_in_query/__init__.py deleted file mode 100644 index 758109e7c09..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_obj_in_query/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from petstore_api.paths.fake_obj_in_query import Api - -from petstore_api.paths import PathValues - -path = PathValues.FAKE_OBJ_IN_QUERY \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_obj_in_query/get.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_obj_in_query/get.py deleted file mode 100644 index 37ece8a5a78..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_obj_in_query/get.py +++ /dev/null @@ -1,309 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from . import path - -# Query params - - -class MapBeanSchema( - schemas.DictSchema -): - - - class MetaOapg: - - class properties: - keyword = schemas.StrSchema - __annotations__ = { - "keyword": keyword, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["keyword"]) -> MetaOapg.properties.keyword: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["keyword", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["keyword"]) -> typing.Union[MetaOapg.properties.keyword, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["keyword", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - keyword: typing.Union[MetaOapg.properties.keyword, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'MapBeanSchema': - return super().__new__( - cls, - *_args, - keyword=keyword, - _configuration=_configuration, - **kwargs, - ) -RequestRequiredQueryParams = typing_extensions.TypedDict( - 'RequestRequiredQueryParams', - { - } -) -RequestOptionalQueryParams = typing_extensions.TypedDict( - 'RequestOptionalQueryParams', - { - 'mapBean': typing.Union[MapBeanSchema, dict, frozendict.frozendict, ], - }, - total=False -) - - -class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): - pass - - -request_query_map_bean = api_client.QueryParameter( - name="mapBean", - style=api_client.ParameterStyle.DEEP_OBJECT, - schema=MapBeanSchema, - explode=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _object_in_query_oapg( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _object_in_query_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _object_in_query_oapg( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _object_in_query_oapg( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - user list - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) - used_path = path.value - - prefix_separator_iterator = None - for parameter in ( - request_query_map_bean, - ): - parameter_data = query_params.get(parameter.name, schemas.unset) - if parameter_data is schemas.unset: - continue - if prefix_separator_iterator is None: - prefix_separator_iterator = parameter.get_prefix_separator_iterator() - serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) - for serialized_value in serialized_data.values(): - used_path += serialized_value - # TODO add cookie handling - - response = self.api_client.call_api( - resource_path=used_path, - method='get'.upper(), - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class ObjectInQuery(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def object_in_query( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def object_in_query( - self, - skip_deserialization: typing_extensions.Literal[True], - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def object_in_query( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def object_in_query( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._object_in_query_oapg( - query_params=query_params, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForget(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def get( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def get( - self, - skip_deserialization: typing_extensions.Literal[True], - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def get( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def get( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._object_in_query_oapg( - query_params=query_params, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_obj_in_query/get.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_obj_in_query/get.pyi deleted file mode 100644 index 9eeca38c684..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_obj_in_query/get.pyi +++ /dev/null @@ -1,304 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -# Query params - - -class MapBeanSchema( - schemas.DictSchema -): - - - class MetaOapg: - - class properties: - keyword = schemas.StrSchema - __annotations__ = { - "keyword": keyword, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["keyword"]) -> MetaOapg.properties.keyword: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["keyword", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["keyword"]) -> typing.Union[MetaOapg.properties.keyword, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["keyword", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - keyword: typing.Union[MetaOapg.properties.keyword, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'MapBeanSchema': - return super().__new__( - cls, - *_args, - keyword=keyword, - _configuration=_configuration, - **kwargs, - ) -RequestRequiredQueryParams = typing_extensions.TypedDict( - 'RequestRequiredQueryParams', - { - } -) -RequestOptionalQueryParams = typing_extensions.TypedDict( - 'RequestOptionalQueryParams', - { - 'mapBean': typing.Union[MapBeanSchema, dict, frozendict.frozendict, ], - }, - total=False -) - - -class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): - pass - - -request_query_map_bean = api_client.QueryParameter( - name="mapBean", - style=api_client.ParameterStyle.DEEP_OBJECT, - schema=MapBeanSchema, - explode=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _object_in_query_oapg( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _object_in_query_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _object_in_query_oapg( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _object_in_query_oapg( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - user list - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) - used_path = path.value - - prefix_separator_iterator = None - for parameter in ( - request_query_map_bean, - ): - parameter_data = query_params.get(parameter.name, schemas.unset) - if parameter_data is schemas.unset: - continue - if prefix_separator_iterator is None: - prefix_separator_iterator = parameter.get_prefix_separator_iterator() - serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) - for serialized_value in serialized_data.values(): - used_path += serialized_value - # TODO add cookie handling - - response = self.api_client.call_api( - resource_path=used_path, - method='get'.upper(), - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class ObjectInQuery(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def object_in_query( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def object_in_query( - self, - skip_deserialization: typing_extensions.Literal[True], - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def object_in_query( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def object_in_query( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._object_in_query_oapg( - query_params=query_params, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForget(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def get( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def get( - self, - skip_deserialization: typing_extensions.Literal[True], - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def get( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def get( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._object_in_query_oapg( - query_params=query_params, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions_1_a_b_ab_self_a_b_/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions_1_a_b_ab_self_a_b_/__init__.py deleted file mode 100644 index e82cc25a7d2..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions_1_a_b_ab_self_a_b_/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from petstore_api.paths.fake_parameter_collisions_1_a_b_ab_self_a_b_ import Api - -from petstore_api.paths import PathValues - -path = PathValues.FAKE_PARAMETER_COLLISIONS_1_A_B_AB_SELF_AB_ \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions_1_a_b_ab_self_a_b_/post.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions_1_a_b_ab_self_a_b_/post.py deleted file mode 100644 index b4b0263ae17..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions_1_a_b_ab_self_a_b_/post.py +++ /dev/null @@ -1,665 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from . import path - -# Query params -Model1Schema = schemas.StrSchema -ABSchema = schemas.StrSchema -AbSchema = schemas.StrSchema -ModelSelfSchema = schemas.StrSchema -ABSchema = schemas.StrSchema -RequestRequiredQueryParams = typing_extensions.TypedDict( - 'RequestRequiredQueryParams', - { - } -) -RequestOptionalQueryParams = typing_extensions.TypedDict( - 'RequestOptionalQueryParams', - { - '1': typing.Union[Model1Schema, str, ], - 'aB': typing.Union[ABSchema, str, ], - 'Ab': typing.Union[AbSchema, str, ], - 'self': typing.Union[ModelSelfSchema, str, ], - 'A-B': typing.Union[ABSchema, str, ], - }, - total=False -) - - -class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): - pass - - -request_query__1 = api_client.QueryParameter( - name="1", - style=api_client.ParameterStyle.FORM, - schema=Model1Schema, - explode=True, -) -request_query_a_b = api_client.QueryParameter( - name="aB", - style=api_client.ParameterStyle.FORM, - schema=ABSchema, - explode=True, -) -request_query_ab = api_client.QueryParameter( - name="Ab", - style=api_client.ParameterStyle.FORM, - schema=AbSchema, - explode=True, -) -request_query__self = api_client.QueryParameter( - name="self", - style=api_client.ParameterStyle.FORM, - schema=ModelSelfSchema, - explode=True, -) -request_query_a_b2 = api_client.QueryParameter( - name="A-B", - style=api_client.ParameterStyle.FORM, - schema=ABSchema, - explode=True, -) -# Header params -Model1Schema = schemas.StrSchema -ABSchema = schemas.StrSchema -ModelSelfSchema = schemas.StrSchema -ABSchema = schemas.StrSchema -RequestRequiredHeaderParams = typing_extensions.TypedDict( - 'RequestRequiredHeaderParams', - { - } -) -RequestOptionalHeaderParams = typing_extensions.TypedDict( - 'RequestOptionalHeaderParams', - { - '1': typing.Union[Model1Schema, str, ], - 'aB': typing.Union[ABSchema, str, ], - 'self': typing.Union[ModelSelfSchema, str, ], - 'A-B': typing.Union[ABSchema, str, ], - }, - total=False -) - - -class RequestHeaderParams(RequestRequiredHeaderParams, RequestOptionalHeaderParams): - pass - - -request_header__2 = api_client.HeaderParameter( - name="1", - style=api_client.ParameterStyle.SIMPLE, - schema=Model1Schema, -) -request_header_a_b3 = api_client.HeaderParameter( - name="aB", - style=api_client.ParameterStyle.SIMPLE, - schema=ABSchema, -) -request_header__self2 = api_client.HeaderParameter( - name="self", - style=api_client.ParameterStyle.SIMPLE, - schema=ModelSelfSchema, -) -request_header_a_b4 = api_client.HeaderParameter( - name="A-B", - style=api_client.ParameterStyle.SIMPLE, - schema=ABSchema, -) -# Path params -Model1Schema = schemas.StrSchema -ABSchema = schemas.StrSchema -AbSchema = schemas.StrSchema -ModelSelfSchema = schemas.StrSchema -ABSchema = schemas.StrSchema -RequestRequiredPathParams = typing_extensions.TypedDict( - 'RequestRequiredPathParams', - { - '1': typing.Union[Model1Schema, str, ], - 'aB': typing.Union[ABSchema, str, ], - 'Ab': typing.Union[AbSchema, str, ], - 'self': typing.Union[ModelSelfSchema, str, ], - 'A-B': typing.Union[ABSchema, str, ], - } -) -RequestOptionalPathParams = typing_extensions.TypedDict( - 'RequestOptionalPathParams', - { - }, - total=False -) - - -class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): - pass - - -request_path__3 = api_client.PathParameter( - name="1", - style=api_client.ParameterStyle.SIMPLE, - schema=Model1Schema, - required=True, -) -request_path_a_b5 = api_client.PathParameter( - name="aB", - style=api_client.ParameterStyle.SIMPLE, - schema=ABSchema, - required=True, -) -request_path_ab2 = api_client.PathParameter( - name="Ab", - style=api_client.ParameterStyle.SIMPLE, - schema=AbSchema, - required=True, -) -request_path__self3 = api_client.PathParameter( - name="self", - style=api_client.ParameterStyle.SIMPLE, - schema=ModelSelfSchema, - required=True, -) -request_path_a_b6 = api_client.PathParameter( - name="A-B", - style=api_client.ParameterStyle.SIMPLE, - schema=ABSchema, - required=True, -) -# Cookie params -Model1Schema = schemas.StrSchema -ABSchema = schemas.StrSchema -AbSchema = schemas.StrSchema -ModelSelfSchema = schemas.StrSchema -ABSchema = schemas.StrSchema -RequestRequiredCookieParams = typing_extensions.TypedDict( - 'RequestRequiredCookieParams', - { - } -) -RequestOptionalCookieParams = typing_extensions.TypedDict( - 'RequestOptionalCookieParams', - { - '1': typing.Union[Model1Schema, str, ], - 'aB': typing.Union[ABSchema, str, ], - 'Ab': typing.Union[AbSchema, str, ], - 'self': typing.Union[ModelSelfSchema, str, ], - 'A-B': typing.Union[ABSchema, str, ], - }, - total=False -) - - -class RequestCookieParams(RequestRequiredCookieParams, RequestOptionalCookieParams): - pass - - -request_cookie__4 = api_client.CookieParameter( - name="1", - style=api_client.ParameterStyle.FORM, - schema=Model1Schema, - explode=True, -) -request_cookie_a_b7 = api_client.CookieParameter( - name="aB", - style=api_client.ParameterStyle.FORM, - schema=ABSchema, - explode=True, -) -request_cookie_ab3 = api_client.CookieParameter( - name="Ab", - style=api_client.ParameterStyle.FORM, - schema=AbSchema, - explode=True, -) -request_cookie__self4 = api_client.CookieParameter( - name="self", - style=api_client.ParameterStyle.FORM, - schema=ModelSelfSchema, - explode=True, -) -request_cookie_a_b8 = api_client.CookieParameter( - name="A-B", - style=api_client.ParameterStyle.FORM, - schema=ABSchema, - explode=True, -) -# body param -SchemaForRequestBodyApplicationJson = schemas.AnyTypeSchema - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, -) -SchemaFor200ResponseBodyApplicationJson = schemas.AnyTypeSchema - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _parameter_collisions_oapg( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - path_params: RequestPathParams = frozendict.frozendict(), - cookie_params: RequestCookieParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _parameter_collisions_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - path_params: RequestPathParams = frozendict.frozendict(), - cookie_params: RequestCookieParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _parameter_collisions_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - path_params: RequestPathParams = frozendict.frozendict(), - cookie_params: RequestCookieParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _parameter_collisions_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - path_params: RequestPathParams = frozendict.frozendict(), - cookie_params: RequestCookieParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _parameter_collisions_oapg( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - path_params: RequestPathParams = frozendict.frozendict(), - cookie_params: RequestCookieParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - parameter collision case - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) - self._verify_typed_dict_inputs_oapg(RequestHeaderParams, header_params) - self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) - self._verify_typed_dict_inputs_oapg(RequestCookieParams, cookie_params) - used_path = path.value - - _path_params = {} - for parameter in ( - request_path__3, - request_path_a_b5, - request_path_ab2, - request_path__self3, - request_path_a_b6, - ): - parameter_data = path_params.get(parameter.name, schemas.unset) - if parameter_data is schemas.unset: - continue - serialized_data = parameter.serialize(parameter_data) - _path_params.update(serialized_data) - - for k, v in _path_params.items(): - used_path = used_path.replace('{%s}' % k, v) - - prefix_separator_iterator = None - for parameter in ( - request_query__1, - request_query_a_b, - request_query_ab, - request_query__self, - request_query_a_b2, - ): - parameter_data = query_params.get(parameter.name, schemas.unset) - if parameter_data is schemas.unset: - continue - if prefix_separator_iterator is None: - prefix_separator_iterator = parameter.get_prefix_separator_iterator() - serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) - for serialized_value in serialized_data.values(): - used_path += serialized_value - - _headers = HTTPHeaderDict() - for parameter in ( - request_header__2, - request_header_a_b3, - request_header__self2, - request_header_a_b4, - ): - parameter_data = header_params.get(parameter.name, schemas.unset) - if parameter_data is schemas.unset: - continue - serialized_data = parameter.serialize(parameter_data) - _headers.extend(serialized_data) - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - _fields = None - _body = None - if body is not schemas.unset: - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class ParameterCollisions(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def parameter_collisions( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - path_params: RequestPathParams = frozendict.frozendict(), - cookie_params: RequestCookieParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def parameter_collisions( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - path_params: RequestPathParams = frozendict.frozendict(), - cookie_params: RequestCookieParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def parameter_collisions( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - path_params: RequestPathParams = frozendict.frozendict(), - cookie_params: RequestCookieParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def parameter_collisions( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - path_params: RequestPathParams = frozendict.frozendict(), - cookie_params: RequestCookieParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def parameter_collisions( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - path_params: RequestPathParams = frozendict.frozendict(), - cookie_params: RequestCookieParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._parameter_collisions_oapg( - body=body, - query_params=query_params, - header_params=header_params, - path_params=path_params, - cookie_params=cookie_params, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - path_params: RequestPathParams = frozendict.frozendict(), - cookie_params: RequestCookieParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - path_params: RequestPathParams = frozendict.frozendict(), - cookie_params: RequestCookieParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - path_params: RequestPathParams = frozendict.frozendict(), - cookie_params: RequestCookieParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - path_params: RequestPathParams = frozendict.frozendict(), - cookie_params: RequestCookieParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - path_params: RequestPathParams = frozendict.frozendict(), - cookie_params: RequestCookieParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._parameter_collisions_oapg( - body=body, - query_params=query_params, - header_params=header_params, - path_params=path_params, - cookie_params=cookie_params, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions_1_a_b_ab_self_a_b_/post.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions_1_a_b_ab_self_a_b_/post.pyi deleted file mode 100644 index 2cce3169e58..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions_1_a_b_ab_self_a_b_/post.pyi +++ /dev/null @@ -1,660 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -# Query params -Model1Schema = schemas.StrSchema -ABSchema = schemas.StrSchema -AbSchema = schemas.StrSchema -ModelSelfSchema = schemas.StrSchema -ABSchema = schemas.StrSchema -RequestRequiredQueryParams = typing_extensions.TypedDict( - 'RequestRequiredQueryParams', - { - } -) -RequestOptionalQueryParams = typing_extensions.TypedDict( - 'RequestOptionalQueryParams', - { - '1': typing.Union[Model1Schema, str, ], - 'aB': typing.Union[ABSchema, str, ], - 'Ab': typing.Union[AbSchema, str, ], - 'self': typing.Union[ModelSelfSchema, str, ], - 'A-B': typing.Union[ABSchema, str, ], - }, - total=False -) - - -class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): - pass - - -request_query__1 = api_client.QueryParameter( - name="1", - style=api_client.ParameterStyle.FORM, - schema=Model1Schema, - explode=True, -) -request_query_a_b = api_client.QueryParameter( - name="aB", - style=api_client.ParameterStyle.FORM, - schema=ABSchema, - explode=True, -) -request_query_ab = api_client.QueryParameter( - name="Ab", - style=api_client.ParameterStyle.FORM, - schema=AbSchema, - explode=True, -) -request_query__self = api_client.QueryParameter( - name="self", - style=api_client.ParameterStyle.FORM, - schema=ModelSelfSchema, - explode=True, -) -request_query_a_b2 = api_client.QueryParameter( - name="A-B", - style=api_client.ParameterStyle.FORM, - schema=ABSchema, - explode=True, -) -# Header params -Model1Schema = schemas.StrSchema -ABSchema = schemas.StrSchema -ModelSelfSchema = schemas.StrSchema -ABSchema = schemas.StrSchema -RequestRequiredHeaderParams = typing_extensions.TypedDict( - 'RequestRequiredHeaderParams', - { - } -) -RequestOptionalHeaderParams = typing_extensions.TypedDict( - 'RequestOptionalHeaderParams', - { - '1': typing.Union[Model1Schema, str, ], - 'aB': typing.Union[ABSchema, str, ], - 'self': typing.Union[ModelSelfSchema, str, ], - 'A-B': typing.Union[ABSchema, str, ], - }, - total=False -) - - -class RequestHeaderParams(RequestRequiredHeaderParams, RequestOptionalHeaderParams): - pass - - -request_header__2 = api_client.HeaderParameter( - name="1", - style=api_client.ParameterStyle.SIMPLE, - schema=Model1Schema, -) -request_header_a_b3 = api_client.HeaderParameter( - name="aB", - style=api_client.ParameterStyle.SIMPLE, - schema=ABSchema, -) -request_header__self2 = api_client.HeaderParameter( - name="self", - style=api_client.ParameterStyle.SIMPLE, - schema=ModelSelfSchema, -) -request_header_a_b4 = api_client.HeaderParameter( - name="A-B", - style=api_client.ParameterStyle.SIMPLE, - schema=ABSchema, -) -# Path params -Model1Schema = schemas.StrSchema -ABSchema = schemas.StrSchema -AbSchema = schemas.StrSchema -ModelSelfSchema = schemas.StrSchema -ABSchema = schemas.StrSchema -RequestRequiredPathParams = typing_extensions.TypedDict( - 'RequestRequiredPathParams', - { - '1': typing.Union[Model1Schema, str, ], - 'aB': typing.Union[ABSchema, str, ], - 'Ab': typing.Union[AbSchema, str, ], - 'self': typing.Union[ModelSelfSchema, str, ], - 'A-B': typing.Union[ABSchema, str, ], - } -) -RequestOptionalPathParams = typing_extensions.TypedDict( - 'RequestOptionalPathParams', - { - }, - total=False -) - - -class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): - pass - - -request_path__3 = api_client.PathParameter( - name="1", - style=api_client.ParameterStyle.SIMPLE, - schema=Model1Schema, - required=True, -) -request_path_a_b5 = api_client.PathParameter( - name="aB", - style=api_client.ParameterStyle.SIMPLE, - schema=ABSchema, - required=True, -) -request_path_ab2 = api_client.PathParameter( - name="Ab", - style=api_client.ParameterStyle.SIMPLE, - schema=AbSchema, - required=True, -) -request_path__self3 = api_client.PathParameter( - name="self", - style=api_client.ParameterStyle.SIMPLE, - schema=ModelSelfSchema, - required=True, -) -request_path_a_b6 = api_client.PathParameter( - name="A-B", - style=api_client.ParameterStyle.SIMPLE, - schema=ABSchema, - required=True, -) -# Cookie params -Model1Schema = schemas.StrSchema -ABSchema = schemas.StrSchema -AbSchema = schemas.StrSchema -ModelSelfSchema = schemas.StrSchema -ABSchema = schemas.StrSchema -RequestRequiredCookieParams = typing_extensions.TypedDict( - 'RequestRequiredCookieParams', - { - } -) -RequestOptionalCookieParams = typing_extensions.TypedDict( - 'RequestOptionalCookieParams', - { - '1': typing.Union[Model1Schema, str, ], - 'aB': typing.Union[ABSchema, str, ], - 'Ab': typing.Union[AbSchema, str, ], - 'self': typing.Union[ModelSelfSchema, str, ], - 'A-B': typing.Union[ABSchema, str, ], - }, - total=False -) - - -class RequestCookieParams(RequestRequiredCookieParams, RequestOptionalCookieParams): - pass - - -request_cookie__4 = api_client.CookieParameter( - name="1", - style=api_client.ParameterStyle.FORM, - schema=Model1Schema, - explode=True, -) -request_cookie_a_b7 = api_client.CookieParameter( - name="aB", - style=api_client.ParameterStyle.FORM, - schema=ABSchema, - explode=True, -) -request_cookie_ab3 = api_client.CookieParameter( - name="Ab", - style=api_client.ParameterStyle.FORM, - schema=AbSchema, - explode=True, -) -request_cookie__self4 = api_client.CookieParameter( - name="self", - style=api_client.ParameterStyle.FORM, - schema=ModelSelfSchema, - explode=True, -) -request_cookie_a_b8 = api_client.CookieParameter( - name="A-B", - style=api_client.ParameterStyle.FORM, - schema=ABSchema, - explode=True, -) -# body param -SchemaForRequestBodyApplicationJson = schemas.AnyTypeSchema - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, -) -SchemaFor200ResponseBodyApplicationJson = schemas.AnyTypeSchema - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _parameter_collisions_oapg( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - path_params: RequestPathParams = frozendict.frozendict(), - cookie_params: RequestCookieParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _parameter_collisions_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - path_params: RequestPathParams = frozendict.frozendict(), - cookie_params: RequestCookieParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _parameter_collisions_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - path_params: RequestPathParams = frozendict.frozendict(), - cookie_params: RequestCookieParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _parameter_collisions_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - path_params: RequestPathParams = frozendict.frozendict(), - cookie_params: RequestCookieParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _parameter_collisions_oapg( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - path_params: RequestPathParams = frozendict.frozendict(), - cookie_params: RequestCookieParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - parameter collision case - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) - self._verify_typed_dict_inputs_oapg(RequestHeaderParams, header_params) - self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) - self._verify_typed_dict_inputs_oapg(RequestCookieParams, cookie_params) - used_path = path.value - - _path_params = {} - for parameter in ( - request_path__3, - request_path_a_b5, - request_path_ab2, - request_path__self3, - request_path_a_b6, - ): - parameter_data = path_params.get(parameter.name, schemas.unset) - if parameter_data is schemas.unset: - continue - serialized_data = parameter.serialize(parameter_data) - _path_params.update(serialized_data) - - for k, v in _path_params.items(): - used_path = used_path.replace('{%s}' % k, v) - - prefix_separator_iterator = None - for parameter in ( - request_query__1, - request_query_a_b, - request_query_ab, - request_query__self, - request_query_a_b2, - ): - parameter_data = query_params.get(parameter.name, schemas.unset) - if parameter_data is schemas.unset: - continue - if prefix_separator_iterator is None: - prefix_separator_iterator = parameter.get_prefix_separator_iterator() - serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) - for serialized_value in serialized_data.values(): - used_path += serialized_value - - _headers = HTTPHeaderDict() - for parameter in ( - request_header__2, - request_header_a_b3, - request_header__self2, - request_header_a_b4, - ): - parameter_data = header_params.get(parameter.name, schemas.unset) - if parameter_data is schemas.unset: - continue - serialized_data = parameter.serialize(parameter_data) - _headers.extend(serialized_data) - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - _fields = None - _body = None - if body is not schemas.unset: - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class ParameterCollisions(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def parameter_collisions( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - path_params: RequestPathParams = frozendict.frozendict(), - cookie_params: RequestCookieParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def parameter_collisions( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - path_params: RequestPathParams = frozendict.frozendict(), - cookie_params: RequestCookieParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def parameter_collisions( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - path_params: RequestPathParams = frozendict.frozendict(), - cookie_params: RequestCookieParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def parameter_collisions( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - path_params: RequestPathParams = frozendict.frozendict(), - cookie_params: RequestCookieParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def parameter_collisions( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - path_params: RequestPathParams = frozendict.frozendict(), - cookie_params: RequestCookieParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._parameter_collisions_oapg( - body=body, - query_params=query_params, - header_params=header_params, - path_params=path_params, - cookie_params=cookie_params, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - path_params: RequestPathParams = frozendict.frozendict(), - cookie_params: RequestCookieParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - path_params: RequestPathParams = frozendict.frozendict(), - cookie_params: RequestCookieParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - path_params: RequestPathParams = frozendict.frozendict(), - cookie_params: RequestCookieParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - path_params: RequestPathParams = frozendict.frozendict(), - cookie_params: RequestCookieParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict.frozendict(), - header_params: RequestHeaderParams = frozendict.frozendict(), - path_params: RequestPathParams = frozendict.frozendict(), - cookie_params: RequestCookieParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._parameter_collisions_oapg( - body=body, - query_params=query_params, - header_params=header_params, - path_params=path_params, - cookie_params=cookie_params, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_pet_id_upload_image_with_required_file/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_pet_id_upload_image_with_required_file/__init__.py deleted file mode 100644 index 5463e577692..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_pet_id_upload_image_with_required_file/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from petstore_api.paths.fake_pet_id_upload_image_with_required_file import Api - -from petstore_api.paths import PathValues - -path = PathValues.FAKE_PET_ID_UPLOAD_IMAGE_WITH_REQUIRED_FILE \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post.py deleted file mode 100644 index a532d0121a7..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post.py +++ /dev/null @@ -1,455 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.api_response import ApiResponse - -from . import path - -# Path params -PetIdSchema = schemas.Int64Schema -RequestRequiredPathParams = typing_extensions.TypedDict( - 'RequestRequiredPathParams', - { - 'petId': typing.Union[PetIdSchema, decimal.Decimal, int, ], - } -) -RequestOptionalPathParams = typing_extensions.TypedDict( - 'RequestOptionalPathParams', - { - }, - total=False -) - - -class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): - pass - - -request_path_pet_id = api_client.PathParameter( - name="petId", - style=api_client.ParameterStyle.SIMPLE, - schema=PetIdSchema, - required=True, -) -# body param - - -class SchemaForRequestBodyMultipartFormData( - schemas.DictSchema -): - - - class MetaOapg: - required = { - "requiredFile", - } - - class properties: - additionalMetadata = schemas.StrSchema - requiredFile = schemas.BinarySchema - __annotations__ = { - "additionalMetadata": additionalMetadata, - "requiredFile": requiredFile, - } - - requiredFile: MetaOapg.properties.requiredFile - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["additionalMetadata"]) -> MetaOapg.properties.additionalMetadata: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["requiredFile"]) -> MetaOapg.properties.requiredFile: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["additionalMetadata", "requiredFile", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["additionalMetadata"]) -> typing.Union[MetaOapg.properties.additionalMetadata, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["requiredFile"]) -> MetaOapg.properties.requiredFile: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["additionalMetadata", "requiredFile", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - requiredFile: typing.Union[MetaOapg.properties.requiredFile, bytes, io.FileIO, io.BufferedReader, ], - additionalMetadata: typing.Union[MetaOapg.properties.additionalMetadata, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaForRequestBodyMultipartFormData': - return super().__new__( - cls, - *_args, - requiredFile=requiredFile, - additionalMetadata=additionalMetadata, - _configuration=_configuration, - **kwargs, - ) - - -request_body_body = api_client.RequestBody( - content={ - 'multipart/form-data': api_client.MediaType( - schema=SchemaForRequestBodyMultipartFormData), - }, -) -_auth = [ - 'petstore_auth', -] -SchemaFor200ResponseBodyApplicationJson = ApiResponse - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _upload_file_with_required_file_oapg( - self, - content_type: typing_extensions.Literal["multipart/form-data"] = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _upload_file_with_required_file_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _upload_file_with_required_file_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _upload_file_with_required_file_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _upload_file_with_required_file_oapg( - self, - content_type: str = 'multipart/form-data', - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - uploads an image (required) - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) - used_path = path.value - - _path_params = {} - for parameter in ( - request_path_pet_id, - ): - parameter_data = path_params.get(parameter.name, schemas.unset) - if parameter_data is schemas.unset: - continue - serialized_data = parameter.serialize(parameter_data) - _path_params.update(serialized_data) - - for k, v in _path_params.items(): - used_path = used_path.replace('{%s}' % k, v) - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - _fields = None - _body = None - if body is not schemas.unset: - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - auth_settings=_auth, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class UploadFileWithRequiredFile(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def upload_file_with_required_file( - self, - content_type: typing_extensions.Literal["multipart/form-data"] = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def upload_file_with_required_file( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def upload_file_with_required_file( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def upload_file_with_required_file( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def upload_file_with_required_file( - self, - content_type: str = 'multipart/form-data', - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._upload_file_with_required_file_oapg( - body=body, - path_params=path_params, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - content_type: typing_extensions.Literal["multipart/form-data"] = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - content_type: str = 'multipart/form-data', - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._upload_file_with_required_file_oapg( - body=body, - path_params=path_params, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post.pyi deleted file mode 100644 index 2ce97ae9dd9..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post.pyi +++ /dev/null @@ -1,447 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.api_response import ApiResponse - -# Path params -PetIdSchema = schemas.Int64Schema -RequestRequiredPathParams = typing_extensions.TypedDict( - 'RequestRequiredPathParams', - { - 'petId': typing.Union[PetIdSchema, decimal.Decimal, int, ], - } -) -RequestOptionalPathParams = typing_extensions.TypedDict( - 'RequestOptionalPathParams', - { - }, - total=False -) - - -class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): - pass - - -request_path_pet_id = api_client.PathParameter( - name="petId", - style=api_client.ParameterStyle.SIMPLE, - schema=PetIdSchema, - required=True, -) -# body param - - -class SchemaForRequestBodyMultipartFormData( - schemas.DictSchema -): - - - class MetaOapg: - required = { - "requiredFile", - } - - class properties: - additionalMetadata = schemas.StrSchema - requiredFile = schemas.BinarySchema - __annotations__ = { - "additionalMetadata": additionalMetadata, - "requiredFile": requiredFile, - } - - requiredFile: MetaOapg.properties.requiredFile - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["additionalMetadata"]) -> MetaOapg.properties.additionalMetadata: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["requiredFile"]) -> MetaOapg.properties.requiredFile: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["additionalMetadata", "requiredFile", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["additionalMetadata"]) -> typing.Union[MetaOapg.properties.additionalMetadata, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["requiredFile"]) -> MetaOapg.properties.requiredFile: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["additionalMetadata", "requiredFile", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - requiredFile: typing.Union[MetaOapg.properties.requiredFile, bytes, io.FileIO, io.BufferedReader, ], - additionalMetadata: typing.Union[MetaOapg.properties.additionalMetadata, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaForRequestBodyMultipartFormData': - return super().__new__( - cls, - *_args, - requiredFile=requiredFile, - additionalMetadata=additionalMetadata, - _configuration=_configuration, - **kwargs, - ) - - -request_body_body = api_client.RequestBody( - content={ - 'multipart/form-data': api_client.MediaType( - schema=SchemaForRequestBodyMultipartFormData), - }, -) -SchemaFor200ResponseBodyApplicationJson = ApiResponse - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _upload_file_with_required_file_oapg( - self, - content_type: typing_extensions.Literal["multipart/form-data"] = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _upload_file_with_required_file_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _upload_file_with_required_file_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _upload_file_with_required_file_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _upload_file_with_required_file_oapg( - self, - content_type: str = 'multipart/form-data', - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - uploads an image (required) - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) - used_path = path.value - - _path_params = {} - for parameter in ( - request_path_pet_id, - ): - parameter_data = path_params.get(parameter.name, schemas.unset) - if parameter_data is schemas.unset: - continue - serialized_data = parameter.serialize(parameter_data) - _path_params.update(serialized_data) - - for k, v in _path_params.items(): - used_path = used_path.replace('{%s}' % k, v) - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - _fields = None - _body = None - if body is not schemas.unset: - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - auth_settings=_auth, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class UploadFileWithRequiredFile(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def upload_file_with_required_file( - self, - content_type: typing_extensions.Literal["multipart/form-data"] = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def upload_file_with_required_file( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def upload_file_with_required_file( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def upload_file_with_required_file( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def upload_file_with_required_file( - self, - content_type: str = 'multipart/form-data', - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._upload_file_with_required_file_oapg( - body=body, - path_params=path_params, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - content_type: typing_extensions.Literal["multipart/form-data"] = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - content_type: str = 'multipart/form-data', - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._upload_file_with_required_file_oapg( - body=body, - path_params=path_params, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_query_param_with_json_content_type/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_query_param_with_json_content_type/__init__.py deleted file mode 100644 index d6a09bc162b..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_query_param_with_json_content_type/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from petstore_api.paths.fake_query_param_with_json_content_type import Api - -from petstore_api.paths import PathValues - -path = PathValues.FAKE_QUERY_PARAM_WITH_JSON_CONTENT_TYPE \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_query_param_with_json_content_type/get.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_query_param_with_json_content_type/get.py deleted file mode 100644 index 13d27a1f351..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_query_param_with_json_content_type/get.py +++ /dev/null @@ -1,292 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from . import path - -# Query params -SchemaForRequestParameterSomeParamApplicationJson = schemas.AnyTypeSchema -RequestRequiredQueryParams = typing_extensions.TypedDict( - 'RequestRequiredQueryParams', - { - 'someParam': typing.Union[SchemaForRequestParameterSomeParamApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - } -) -RequestOptionalQueryParams = typing_extensions.TypedDict( - 'RequestOptionalQueryParams', - { - }, - total=False -) - - -class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): - pass - - -request_query_some_param = api_client.QueryParameter( - name="someParam", - content={ - "application/json": SchemaForRequestParameterSomeParamApplicationJson, - }, - required=True, -) -SchemaFor200ResponseBodyApplicationJson = schemas.AnyTypeSchema - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _query_param_with_json_content_type_oapg( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _query_param_with_json_content_type_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _query_param_with_json_content_type_oapg( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _query_param_with_json_content_type_oapg( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - query param with json content-type - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) - used_path = path.value - - prefix_separator_iterator = None - for parameter in ( - request_query_some_param, - ): - parameter_data = query_params.get(parameter.name, schemas.unset) - if parameter_data is schemas.unset: - continue - if prefix_separator_iterator is None: - prefix_separator_iterator = parameter.get_prefix_separator_iterator() - serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) - for serialized_value in serialized_data.values(): - used_path += serialized_value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='get'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class QueryParamWithJsonContentType(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def query_param_with_json_content_type( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def query_param_with_json_content_type( - self, - skip_deserialization: typing_extensions.Literal[True], - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def query_param_with_json_content_type( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def query_param_with_json_content_type( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._query_param_with_json_content_type_oapg( - query_params=query_params, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForget(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def get( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def get( - self, - skip_deserialization: typing_extensions.Literal[True], - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def get( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def get( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._query_param_with_json_content_type_oapg( - query_params=query_params, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_query_param_with_json_content_type/get.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_query_param_with_json_content_type/get.pyi deleted file mode 100644 index 9ae7ba171b5..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_query_param_with_json_content_type/get.pyi +++ /dev/null @@ -1,287 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -# Query params -SchemaForRequestParameterSomeParamApplicationJson = schemas.AnyTypeSchema -RequestRequiredQueryParams = typing_extensions.TypedDict( - 'RequestRequiredQueryParams', - { - 'someParam': typing.Union[SchemaForRequestParameterSomeParamApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - } -) -RequestOptionalQueryParams = typing_extensions.TypedDict( - 'RequestOptionalQueryParams', - { - }, - total=False -) - - -class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): - pass - - -request_query_some_param = api_client.QueryParameter( - name="someParam", - content={ - "application/json": SchemaForRequestParameterSomeParamApplicationJson, - }, - required=True, -) -SchemaFor200ResponseBodyApplicationJson = schemas.AnyTypeSchema - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _query_param_with_json_content_type_oapg( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _query_param_with_json_content_type_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _query_param_with_json_content_type_oapg( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _query_param_with_json_content_type_oapg( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - query param with json content-type - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) - used_path = path.value - - prefix_separator_iterator = None - for parameter in ( - request_query_some_param, - ): - parameter_data = query_params.get(parameter.name, schemas.unset) - if parameter_data is schemas.unset: - continue - if prefix_separator_iterator is None: - prefix_separator_iterator = parameter.get_prefix_separator_iterator() - serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) - for serialized_value in serialized_data.values(): - used_path += serialized_value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='get'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class QueryParamWithJsonContentType(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def query_param_with_json_content_type( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def query_param_with_json_content_type( - self, - skip_deserialization: typing_extensions.Literal[True], - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def query_param_with_json_content_type( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def query_param_with_json_content_type( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._query_param_with_json_content_type_oapg( - query_params=query_params, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForget(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def get( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def get( - self, - skip_deserialization: typing_extensions.Literal[True], - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def get( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def get( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._query_param_with_json_content_type_oapg( - query_params=query_params, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_ref_obj_in_query/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_ref_obj_in_query/__init__.py deleted file mode 100644 index f14640328a9..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_ref_obj_in_query/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from petstore_api.paths.fake_ref_obj_in_query import Api - -from petstore_api.paths import PathValues - -path = PathValues.FAKE_REF_OBJ_IN_QUERY \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_ref_obj_in_query/get.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_ref_obj_in_query/get.py deleted file mode 100644 index 64987f350bf..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_ref_obj_in_query/get.py +++ /dev/null @@ -1,262 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.foo import Foo - -from . import path - -# Query params -MapBeanSchema = Foo -RequestRequiredQueryParams = typing_extensions.TypedDict( - 'RequestRequiredQueryParams', - { - } -) -RequestOptionalQueryParams = typing_extensions.TypedDict( - 'RequestOptionalQueryParams', - { - 'mapBean': typing.Union[MapBeanSchema, ], - }, - total=False -) - - -class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): - pass - - -request_query_map_bean = api_client.QueryParameter( - name="mapBean", - style=api_client.ParameterStyle.DEEP_OBJECT, - schema=MapBeanSchema, - explode=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _ref_object_in_query_oapg( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _ref_object_in_query_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _ref_object_in_query_oapg( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _ref_object_in_query_oapg( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - user list - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) - used_path = path.value - - prefix_separator_iterator = None - for parameter in ( - request_query_map_bean, - ): - parameter_data = query_params.get(parameter.name, schemas.unset) - if parameter_data is schemas.unset: - continue - if prefix_separator_iterator is None: - prefix_separator_iterator = parameter.get_prefix_separator_iterator() - serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) - for serialized_value in serialized_data.values(): - used_path += serialized_value - # TODO add cookie handling - - response = self.api_client.call_api( - resource_path=used_path, - method='get'.upper(), - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class RefObjectInQuery(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def ref_object_in_query( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def ref_object_in_query( - self, - skip_deserialization: typing_extensions.Literal[True], - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def ref_object_in_query( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def ref_object_in_query( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._ref_object_in_query_oapg( - query_params=query_params, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForget(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def get( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def get( - self, - skip_deserialization: typing_extensions.Literal[True], - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def get( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def get( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._ref_object_in_query_oapg( - query_params=query_params, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_ref_obj_in_query/get.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_ref_obj_in_query/get.pyi deleted file mode 100644 index abdca20c729..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_ref_obj_in_query/get.pyi +++ /dev/null @@ -1,257 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.foo import Foo - -# Query params -MapBeanSchema = Foo -RequestRequiredQueryParams = typing_extensions.TypedDict( - 'RequestRequiredQueryParams', - { - } -) -RequestOptionalQueryParams = typing_extensions.TypedDict( - 'RequestOptionalQueryParams', - { - 'mapBean': typing.Union[MapBeanSchema, ], - }, - total=False -) - - -class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): - pass - - -request_query_map_bean = api_client.QueryParameter( - name="mapBean", - style=api_client.ParameterStyle.DEEP_OBJECT, - schema=MapBeanSchema, - explode=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _ref_object_in_query_oapg( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _ref_object_in_query_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _ref_object_in_query_oapg( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _ref_object_in_query_oapg( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - user list - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) - used_path = path.value - - prefix_separator_iterator = None - for parameter in ( - request_query_map_bean, - ): - parameter_data = query_params.get(parameter.name, schemas.unset) - if parameter_data is schemas.unset: - continue - if prefix_separator_iterator is None: - prefix_separator_iterator = parameter.get_prefix_separator_iterator() - serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) - for serialized_value in serialized_data.values(): - used_path += serialized_value - # TODO add cookie handling - - response = self.api_client.call_api( - resource_path=used_path, - method='get'.upper(), - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class RefObjectInQuery(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def ref_object_in_query( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def ref_object_in_query( - self, - skip_deserialization: typing_extensions.Literal[True], - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def ref_object_in_query( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def ref_object_in_query( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._ref_object_in_query_oapg( - query_params=query_params, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForget(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def get( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def get( - self, - skip_deserialization: typing_extensions.Literal[True], - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def get( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def get( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._ref_object_in_query_oapg( - query_params=query_params, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_array_of_enums/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_array_of_enums/__init__.py deleted file mode 100644 index 59f3e61b17d..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_array_of_enums/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from petstore_api.paths.fake_refs_array_of_enums import Api - -from petstore_api.paths import PathValues - -path = PathValues.FAKE_REFS_ARRAYOFENUMS \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_array_of_enums/post.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_array_of_enums/post.py deleted file mode 100644 index 2894d829ebd..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_array_of_enums/post.py +++ /dev/null @@ -1,330 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.array_of_enums import ArrayOfEnums - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = ArrayOfEnums - - -request_body_array_of_enums = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, -) -SchemaFor200ResponseBodyApplicationJson = ArrayOfEnums - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _array_of_enums_oapg( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _array_of_enums_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _array_of_enums_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _array_of_enums_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _array_of_enums_oapg( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - Array of Enums - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - _fields = None - _body = None - if body is not schemas.unset: - serialized_data = request_body_array_of_enums.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class ArrayOfEnums(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def array_of_enums( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def array_of_enums( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def array_of_enums( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def array_of_enums( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def array_of_enums( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._array_of_enums_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._array_of_enums_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_array_of_enums/post.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_array_of_enums/post.pyi deleted file mode 100644 index 24206b9a2e6..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_array_of_enums/post.pyi +++ /dev/null @@ -1,325 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.array_of_enums import ArrayOfEnums - -# body param -SchemaForRequestBodyApplicationJson = ArrayOfEnums - - -request_body_array_of_enums = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, -) -SchemaFor200ResponseBodyApplicationJson = ArrayOfEnums - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _array_of_enums_oapg( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _array_of_enums_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _array_of_enums_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _array_of_enums_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _array_of_enums_oapg( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - Array of Enums - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - _fields = None - _body = None - if body is not schemas.unset: - serialized_data = request_body_array_of_enums.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class ArrayOfEnums(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def array_of_enums( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def array_of_enums( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def array_of_enums( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def array_of_enums( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def array_of_enums( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._array_of_enums_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._array_of_enums_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_arraymodel/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_arraymodel/__init__.py deleted file mode 100644 index c90c7330633..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_arraymodel/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from petstore_api.paths.fake_refs_arraymodel import Api - -from petstore_api.paths import PathValues - -path = PathValues.FAKE_REFS_ARRAYMODEL \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_arraymodel/post.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_arraymodel/post.py deleted file mode 100644 index e42a1889d5c..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_arraymodel/post.py +++ /dev/null @@ -1,329 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.animal_farm import AnimalFarm - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = AnimalFarm - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, -) -SchemaFor200ResponseBodyApplicationJson = AnimalFarm - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _array_model_oapg( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _array_model_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _array_model_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _array_model_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _array_model_oapg( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - _fields = None - _body = None - if body is not schemas.unset: - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class ArrayModel(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def array_model( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def array_model( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def array_model( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def array_model( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def array_model( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._array_model_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._array_model_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_arraymodel/post.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_arraymodel/post.pyi deleted file mode 100644 index a2b06a441a2..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_arraymodel/post.pyi +++ /dev/null @@ -1,324 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.animal_farm import AnimalFarm - -# body param -SchemaForRequestBodyApplicationJson = AnimalFarm - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, -) -SchemaFor200ResponseBodyApplicationJson = AnimalFarm - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _array_model_oapg( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _array_model_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _array_model_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _array_model_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _array_model_oapg( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - _fields = None - _body = None - if body is not schemas.unset: - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class ArrayModel(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def array_model( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def array_model( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def array_model( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def array_model( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def array_model( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._array_model_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._array_model_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_boolean/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_boolean/__init__.py deleted file mode 100644 index 0c4592391c5..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_boolean/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from petstore_api.paths.fake_refs_boolean import Api - -from petstore_api.paths import PathValues - -path = PathValues.FAKE_REFS_BOOLEAN \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_boolean/post.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_boolean/post.py deleted file mode 100644 index 2baae62355e..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_boolean/post.py +++ /dev/null @@ -1,327 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = schemas.BoolSchema - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, -) -SchemaFor200ResponseBodyApplicationJson = schemas.BoolSchema - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _boolean_oapg( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, bool, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _boolean_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, bool, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _boolean_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, bool, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _boolean_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, bool, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _boolean_oapg( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, bool, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - _fields = None - _body = None - if body is not schemas.unset: - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class Boolean(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def boolean( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, bool, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def boolean( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, bool, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def boolean( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, bool, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def boolean( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, bool, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def boolean( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, bool, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._boolean_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, bool, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, bool, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, bool, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, bool, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, bool, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._boolean_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_boolean/post.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_boolean/post.pyi deleted file mode 100644 index 0050c5cb872..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_boolean/post.pyi +++ /dev/null @@ -1,322 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -# body param -SchemaForRequestBodyApplicationJson = schemas.BoolSchema - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, -) -SchemaFor200ResponseBodyApplicationJson = schemas.BoolSchema - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _boolean_oapg( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, bool, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _boolean_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, bool, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _boolean_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, bool, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _boolean_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, bool, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _boolean_oapg( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, bool, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - _fields = None - _body = None - if body is not schemas.unset: - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class Boolean(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def boolean( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, bool, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def boolean( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, bool, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def boolean( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, bool, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def boolean( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, bool, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def boolean( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, bool, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._boolean_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, bool, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, bool, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, bool, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, bool, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, bool, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._boolean_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/__init__.py deleted file mode 100644 index 0d1296a31b0..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from petstore_api.paths.fake_refs_composed_one_of_number_with_validations import Api - -from petstore_api.paths import PathValues - -path = PathValues.FAKE_REFS_COMPOSED_ONE_OF_NUMBER_WITH_VALIDATIONS \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post.py deleted file mode 100644 index 6bd2dd9456d..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post.py +++ /dev/null @@ -1,329 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.composed_one_of_different_types import ComposedOneOfDifferentTypes - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = ComposedOneOfDifferentTypes - - -request_body_composed_one_of_different_types = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, -) -SchemaFor200ResponseBodyApplicationJson = ComposedOneOfDifferentTypes - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _composed_one_of_different_types_oapg( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _composed_one_of_different_types_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _composed_one_of_different_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _composed_one_of_different_types_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _composed_one_of_different_types_oapg( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - _fields = None - _body = None - if body is not schemas.unset: - serialized_data = request_body_composed_one_of_different_types.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class ComposedOneOfDifferentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def composed_one_of_different_types( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def composed_one_of_different_types( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def composed_one_of_different_types( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def composed_one_of_different_types( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def composed_one_of_different_types( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._composed_one_of_different_types_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._composed_one_of_different_types_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post.pyi deleted file mode 100644 index 0aa5907b063..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post.pyi +++ /dev/null @@ -1,324 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.composed_one_of_different_types import ComposedOneOfDifferentTypes - -# body param -SchemaForRequestBodyApplicationJson = ComposedOneOfDifferentTypes - - -request_body_composed_one_of_different_types = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, -) -SchemaFor200ResponseBodyApplicationJson = ComposedOneOfDifferentTypes - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _composed_one_of_different_types_oapg( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _composed_one_of_different_types_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _composed_one_of_different_types_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _composed_one_of_different_types_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _composed_one_of_different_types_oapg( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - _fields = None - _body = None - if body is not schemas.unset: - serialized_data = request_body_composed_one_of_different_types.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class ComposedOneOfDifferentTypes(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def composed_one_of_different_types( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def composed_one_of_different_types( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def composed_one_of_different_types( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def composed_one_of_different_types( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def composed_one_of_different_types( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._composed_one_of_different_types_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._composed_one_of_different_types_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_enum/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_enum/__init__.py deleted file mode 100644 index f383b115070..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_enum/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from petstore_api.paths.fake_refs_enum import Api - -from petstore_api.paths import PathValues - -path = PathValues.FAKE_REFS_ENUM \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_enum/post.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_enum/post.py deleted file mode 100644 index 6cc35c14821..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_enum/post.py +++ /dev/null @@ -1,329 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.string_enum import StringEnum - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = StringEnum - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, -) -SchemaFor200ResponseBodyApplicationJson = StringEnum - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _string_enum_oapg( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _string_enum_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _string_enum_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _string_enum_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _string_enum_oapg( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - _fields = None - _body = None - if body is not schemas.unset: - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class StringEnum(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def string_enum( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def string_enum( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def string_enum( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def string_enum( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def string_enum( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._string_enum_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._string_enum_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_enum/post.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_enum/post.pyi deleted file mode 100644 index 221b4d0b639..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_enum/post.pyi +++ /dev/null @@ -1,324 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.string_enum import StringEnum - -# body param -SchemaForRequestBodyApplicationJson = StringEnum - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, -) -SchemaFor200ResponseBodyApplicationJson = StringEnum - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _string_enum_oapg( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _string_enum_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _string_enum_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _string_enum_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _string_enum_oapg( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - _fields = None - _body = None - if body is not schemas.unset: - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class StringEnum(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def string_enum( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def string_enum( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def string_enum( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def string_enum( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def string_enum( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._string_enum_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._string_enum_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_mammal/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_mammal/__init__.py deleted file mode 100644 index 8714057f419..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_mammal/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from petstore_api.paths.fake_refs_mammal import Api - -from petstore_api.paths import PathValues - -path = PathValues.FAKE_REFS_MAMMAL \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_mammal/post.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_mammal/post.py deleted file mode 100644 index e7e13243f96..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_mammal/post.py +++ /dev/null @@ -1,332 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.mammal import Mammal - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = Mammal - - -request_body_mammal = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) -SchemaFor200ResponseBodyApplicationJson = Mammal - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _mammal_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _mammal_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _mammal_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _mammal_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _mammal_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_mammal.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class Mammal(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def mammal( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def mammal( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def mammal( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def mammal( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def mammal( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._mammal_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._mammal_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_mammal/post.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_mammal/post.pyi deleted file mode 100644 index 6ea8a6d19aa..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_mammal/post.pyi +++ /dev/null @@ -1,327 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.mammal import Mammal - -# body param -SchemaForRequestBodyApplicationJson = Mammal - - -request_body_mammal = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) -SchemaFor200ResponseBodyApplicationJson = Mammal - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _mammal_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _mammal_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _mammal_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _mammal_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _mammal_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_mammal.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class Mammal(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def mammal( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def mammal( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def mammal( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def mammal( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def mammal( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._mammal_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._mammal_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_number/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_number/__init__.py deleted file mode 100644 index 7ca1c08dff0..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_number/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from petstore_api.paths.fake_refs_number import Api - -from petstore_api.paths import PathValues - -path = PathValues.FAKE_REFS_NUMBER \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_number/post.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_number/post.py deleted file mode 100644 index ec018264aae..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_number/post.py +++ /dev/null @@ -1,329 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.number_with_validations import NumberWithValidations - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = NumberWithValidations - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, -) -SchemaFor200ResponseBodyApplicationJson = NumberWithValidations - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _number_with_validations_oapg( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _number_with_validations_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _number_with_validations_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _number_with_validations_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _number_with_validations_oapg( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - _fields = None - _body = None - if body is not schemas.unset: - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class NumberWithValidations(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def number_with_validations( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def number_with_validations( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def number_with_validations( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def number_with_validations( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def number_with_validations( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._number_with_validations_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._number_with_validations_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_number/post.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_number/post.pyi deleted file mode 100644 index c61052f767d..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_number/post.pyi +++ /dev/null @@ -1,324 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.number_with_validations import NumberWithValidations - -# body param -SchemaForRequestBodyApplicationJson = NumberWithValidations - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, -) -SchemaFor200ResponseBodyApplicationJson = NumberWithValidations - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _number_with_validations_oapg( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _number_with_validations_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _number_with_validations_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _number_with_validations_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _number_with_validations_oapg( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - _fields = None - _body = None - if body is not schemas.unset: - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class NumberWithValidations(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def number_with_validations( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def number_with_validations( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def number_with_validations( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def number_with_validations( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def number_with_validations( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._number_with_validations_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._number_with_validations_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_object_model_with_ref_props/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_object_model_with_ref_props/__init__.py deleted file mode 100644 index 75f23321286..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_object_model_with_ref_props/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from petstore_api.paths.fake_refs_object_model_with_ref_props import Api - -from petstore_api.paths import PathValues - -path = PathValues.FAKE_REFS_OBJECT_MODEL_WITH_REF_PROPS \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_object_model_with_ref_props/post.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_object_model_with_ref_props/post.py deleted file mode 100644 index cbea3511256..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_object_model_with_ref_props/post.py +++ /dev/null @@ -1,329 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = ObjectModelWithRefProps - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, -) -SchemaFor200ResponseBodyApplicationJson = ObjectModelWithRefProps - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _object_model_with_ref_props_oapg( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _object_model_with_ref_props_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _object_model_with_ref_props_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _object_model_with_ref_props_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _object_model_with_ref_props_oapg( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - _fields = None - _body = None - if body is not schemas.unset: - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class ObjectModelWithRefProps(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def object_model_with_ref_props( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def object_model_with_ref_props( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def object_model_with_ref_props( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def object_model_with_ref_props( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def object_model_with_ref_props( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._object_model_with_ref_props_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._object_model_with_ref_props_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_object_model_with_ref_props/post.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_object_model_with_ref_props/post.pyi deleted file mode 100644 index 68fd4a90f65..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_object_model_with_ref_props/post.pyi +++ /dev/null @@ -1,324 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps - -# body param -SchemaForRequestBodyApplicationJson = ObjectModelWithRefProps - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, -) -SchemaFor200ResponseBodyApplicationJson = ObjectModelWithRefProps - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _object_model_with_ref_props_oapg( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _object_model_with_ref_props_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _object_model_with_ref_props_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _object_model_with_ref_props_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _object_model_with_ref_props_oapg( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - _fields = None - _body = None - if body is not schemas.unset: - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class ObjectModelWithRefProps(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def object_model_with_ref_props( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def object_model_with_ref_props( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def object_model_with_ref_props( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def object_model_with_ref_props( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def object_model_with_ref_props( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._object_model_with_ref_props_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._object_model_with_ref_props_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_string/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_string/__init__.py deleted file mode 100644 index 5f3cba3f0c9..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_string/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from petstore_api.paths.fake_refs_string import Api - -from petstore_api.paths import PathValues - -path = PathValues.FAKE_REFS_STRING \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_string/post.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_string/post.py deleted file mode 100644 index 14757e3972f..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_string/post.py +++ /dev/null @@ -1,327 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = schemas.StrSchema - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, -) -SchemaFor200ResponseBodyApplicationJson = schemas.StrSchema - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _string_oapg( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, str, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _string_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, str, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _string_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, str, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _string_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, str, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _string_oapg( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, str, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - _fields = None - _body = None - if body is not schemas.unset: - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class String(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def string( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, str, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def string( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, str, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def string( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, str, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def string( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, str, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def string( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, str, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._string_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, str, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, str, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, str, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, str, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, str, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._string_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_string/post.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_string/post.pyi deleted file mode 100644 index 789db0c1a2a..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_string/post.pyi +++ /dev/null @@ -1,322 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -# body param -SchemaForRequestBodyApplicationJson = schemas.StrSchema - - -request_body_body = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, -) -SchemaFor200ResponseBodyApplicationJson = schemas.StrSchema - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _string_oapg( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, str, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _string_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, str, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _string_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, str, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _string_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, str, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _string_oapg( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, str, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - _fields = None - _body = None - if body is not schemas.unset: - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class String(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def string( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, str, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def string( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, str, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def string( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, str, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def string( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, str, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def string( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, str, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._string_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, str, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, str, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, str, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationJson, str, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - content_type: str = 'application/json', - body: typing.Union[SchemaForRequestBodyApplicationJson, str, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._string_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_response_without_schema/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_response_without_schema/__init__.py deleted file mode 100644 index 52d9f34614f..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_response_without_schema/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from petstore_api.paths.fake_response_without_schema import Api - -from petstore_api.paths import PathValues - -path = PathValues.FAKE_RESPONSE_WITHOUT_SCHEMA \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_response_without_schema/get.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_response_without_schema/get.py deleted file mode 100644 index c488bce612e..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_response_without_schema/get.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from . import path - - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - schemas.Unset, - schemas.Unset, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType(), - 'application/xml': api_client.MediaType(), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', - 'application/xml', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _response_without_schema_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _response_without_schema_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _response_without_schema_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _response_without_schema_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - receives a response without schema - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='get'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class ResponseWithoutSchema(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def response_without_schema( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def response_without_schema( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def response_without_schema( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def response_without_schema( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._response_without_schema_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForget(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def get( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def get( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def get( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def get( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._response_without_schema_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_response_without_schema/get.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_response_without_schema/get.pyi deleted file mode 100644 index 008429c2b59..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_response_without_schema/get.pyi +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - schemas.Unset, - schemas.Unset, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType(), - 'application/xml': api_client.MediaType(), - }, -) -_all_accept_content_types = ( - 'application/json', - 'application/xml', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _response_without_schema_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _response_without_schema_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _response_without_schema_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _response_without_schema_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - receives a response without schema - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='get'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class ResponseWithoutSchema(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def response_without_schema( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def response_without_schema( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def response_without_schema( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def response_without_schema( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._response_without_schema_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForget(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def get( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def get( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def get( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def get( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._response_without_schema_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_test_query_paramters/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_test_query_paramters/__init__.py deleted file mode 100644 index ada97981537..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_test_query_paramters/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from petstore_api.paths.fake_test_query_paramters import Api - -from petstore_api.paths import PathValues - -path = PathValues.FAKE_TESTQUERYPARAMTERS \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_test_query_paramters/put.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_test_query_paramters/put.py deleted file mode 100644 index aac0cf90591..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_test_query_paramters/put.py +++ /dev/null @@ -1,419 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.string_with_validation import StringWithValidation - -from . import path - -# Query params - - -class PipeSchema( - schemas.ListSchema -): - - - class MetaOapg: - items = schemas.StrSchema - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, str, ]], typing.List[typing.Union[MetaOapg.items, str, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'PipeSchema': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - - -class IoutilSchema( - schemas.ListSchema -): - - - class MetaOapg: - items = schemas.StrSchema - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, str, ]], typing.List[typing.Union[MetaOapg.items, str, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'IoutilSchema': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - - -class HttpSchema( - schemas.ListSchema -): - - - class MetaOapg: - items = schemas.StrSchema - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, str, ]], typing.List[typing.Union[MetaOapg.items, str, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'HttpSchema': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - - -class UrlSchema( - schemas.ListSchema -): - - - class MetaOapg: - items = schemas.StrSchema - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, str, ]], typing.List[typing.Union[MetaOapg.items, str, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'UrlSchema': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - - -class ContextSchema( - schemas.ListSchema -): - - - class MetaOapg: - items = schemas.StrSchema - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, str, ]], typing.List[typing.Union[MetaOapg.items, str, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'ContextSchema': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) -RefParamSchema = StringWithValidation -RequestRequiredQueryParams = typing_extensions.TypedDict( - 'RequestRequiredQueryParams', - { - 'pipe': typing.Union[PipeSchema, list, tuple, ], - 'ioutil': typing.Union[IoutilSchema, list, tuple, ], - 'http': typing.Union[HttpSchema, list, tuple, ], - 'url': typing.Union[UrlSchema, list, tuple, ], - 'context': typing.Union[ContextSchema, list, tuple, ], - 'refParam': typing.Union[RefParamSchema, ], - } -) -RequestOptionalQueryParams = typing_extensions.TypedDict( - 'RequestOptionalQueryParams', - { - }, - total=False -) - - -class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): - pass - - -request_query_pipe = api_client.QueryParameter( - name="pipe", - style=api_client.ParameterStyle.FORM, - schema=PipeSchema, - required=True, - explode=True, -) -request_query_ioutil = api_client.QueryParameter( - name="ioutil", - style=api_client.ParameterStyle.FORM, - schema=IoutilSchema, - required=True, -) -request_query_http = api_client.QueryParameter( - name="http", - style=api_client.ParameterStyle.SPACE_DELIMITED, - schema=HttpSchema, - required=True, -) -request_query_url = api_client.QueryParameter( - name="url", - style=api_client.ParameterStyle.FORM, - schema=UrlSchema, - required=True, -) -request_query_context = api_client.QueryParameter( - name="context", - style=api_client.ParameterStyle.FORM, - schema=ContextSchema, - required=True, - explode=True, -) -request_query_ref_param = api_client.QueryParameter( - name="refParam", - style=api_client.ParameterStyle.FORM, - schema=RefParamSchema, - required=True, - explode=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) -_status_code_to_response = { - '200': _response_for_200, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _query_parameter_collection_format_oapg( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _query_parameter_collection_format_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _query_parameter_collection_format_oapg( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _query_parameter_collection_format_oapg( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) - used_path = path.value - - prefix_separator_iterator = None - for parameter in ( - request_query_pipe, - request_query_ioutil, - request_query_http, - request_query_url, - request_query_context, - request_query_ref_param, - ): - parameter_data = query_params.get(parameter.name, schemas.unset) - if parameter_data is schemas.unset: - continue - if prefix_separator_iterator is None: - prefix_separator_iterator = parameter.get_prefix_separator_iterator() - serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) - for serialized_value in serialized_data.values(): - used_path += serialized_value - # TODO add cookie handling - - response = self.api_client.call_api( - resource_path=used_path, - method='put'.upper(), - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class QueryParameterCollectionFormat(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def query_parameter_collection_format( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def query_parameter_collection_format( - self, - skip_deserialization: typing_extensions.Literal[True], - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def query_parameter_collection_format( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def query_parameter_collection_format( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._query_parameter_collection_format_oapg( - query_params=query_params, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForput(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def put( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def put( - self, - skip_deserialization: typing_extensions.Literal[True], - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def put( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def put( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._query_parameter_collection_format_oapg( - query_params=query_params, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_test_query_paramters/put.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_test_query_paramters/put.pyi deleted file mode 100644 index 088f67d331a..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_test_query_paramters/put.pyi +++ /dev/null @@ -1,414 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.string_with_validation import StringWithValidation - -# Query params - - -class PipeSchema( - schemas.ListSchema -): - - - class MetaOapg: - items = schemas.StrSchema - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, str, ]], typing.List[typing.Union[MetaOapg.items, str, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'PipeSchema': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - - -class IoutilSchema( - schemas.ListSchema -): - - - class MetaOapg: - items = schemas.StrSchema - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, str, ]], typing.List[typing.Union[MetaOapg.items, str, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'IoutilSchema': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - - -class HttpSchema( - schemas.ListSchema -): - - - class MetaOapg: - items = schemas.StrSchema - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, str, ]], typing.List[typing.Union[MetaOapg.items, str, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'HttpSchema': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - - -class UrlSchema( - schemas.ListSchema -): - - - class MetaOapg: - items = schemas.StrSchema - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, str, ]], typing.List[typing.Union[MetaOapg.items, str, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'UrlSchema': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - - -class ContextSchema( - schemas.ListSchema -): - - - class MetaOapg: - items = schemas.StrSchema - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, str, ]], typing.List[typing.Union[MetaOapg.items, str, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'ContextSchema': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) -RefParamSchema = StringWithValidation -RequestRequiredQueryParams = typing_extensions.TypedDict( - 'RequestRequiredQueryParams', - { - 'pipe': typing.Union[PipeSchema, list, tuple, ], - 'ioutil': typing.Union[IoutilSchema, list, tuple, ], - 'http': typing.Union[HttpSchema, list, tuple, ], - 'url': typing.Union[UrlSchema, list, tuple, ], - 'context': typing.Union[ContextSchema, list, tuple, ], - 'refParam': typing.Union[RefParamSchema, ], - } -) -RequestOptionalQueryParams = typing_extensions.TypedDict( - 'RequestOptionalQueryParams', - { - }, - total=False -) - - -class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): - pass - - -request_query_pipe = api_client.QueryParameter( - name="pipe", - style=api_client.ParameterStyle.FORM, - schema=PipeSchema, - required=True, - explode=True, -) -request_query_ioutil = api_client.QueryParameter( - name="ioutil", - style=api_client.ParameterStyle.FORM, - schema=IoutilSchema, - required=True, -) -request_query_http = api_client.QueryParameter( - name="http", - style=api_client.ParameterStyle.SPACE_DELIMITED, - schema=HttpSchema, - required=True, -) -request_query_url = api_client.QueryParameter( - name="url", - style=api_client.ParameterStyle.FORM, - schema=UrlSchema, - required=True, -) -request_query_context = api_client.QueryParameter( - name="context", - style=api_client.ParameterStyle.FORM, - schema=ContextSchema, - required=True, - explode=True, -) -request_query_ref_param = api_client.QueryParameter( - name="refParam", - style=api_client.ParameterStyle.FORM, - schema=RefParamSchema, - required=True, - explode=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _query_parameter_collection_format_oapg( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _query_parameter_collection_format_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _query_parameter_collection_format_oapg( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _query_parameter_collection_format_oapg( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) - used_path = path.value - - prefix_separator_iterator = None - for parameter in ( - request_query_pipe, - request_query_ioutil, - request_query_http, - request_query_url, - request_query_context, - request_query_ref_param, - ): - parameter_data = query_params.get(parameter.name, schemas.unset) - if parameter_data is schemas.unset: - continue - if prefix_separator_iterator is None: - prefix_separator_iterator = parameter.get_prefix_separator_iterator() - serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) - for serialized_value in serialized_data.values(): - used_path += serialized_value - # TODO add cookie handling - - response = self.api_client.call_api( - resource_path=used_path, - method='put'.upper(), - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class QueryParameterCollectionFormat(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def query_parameter_collection_format( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def query_parameter_collection_format( - self, - skip_deserialization: typing_extensions.Literal[True], - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def query_parameter_collection_format( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def query_parameter_collection_format( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._query_parameter_collection_format_oapg( - query_params=query_params, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForput(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def put( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def put( - self, - skip_deserialization: typing_extensions.Literal[True], - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def put( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def put( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._query_parameter_collection_format_oapg( - query_params=query_params, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_download_file/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_download_file/__init__.py deleted file mode 100644 index b7321672f11..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_download_file/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from petstore_api.paths.fake_upload_download_file import Api - -from petstore_api.paths import PathValues - -path = PathValues.FAKE_UPLOAD_DOWNLOAD_FILE \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_download_file/post.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_download_file/post.py deleted file mode 100644 index 174a4b2e916..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_download_file/post.py +++ /dev/null @@ -1,331 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from . import path - -# body param -SchemaForRequestBodyApplicationOctetStream = schemas.BinarySchema - - -request_body_body = api_client.RequestBody( - content={ - 'application/octet-stream': api_client.MediaType( - schema=SchemaForRequestBodyApplicationOctetStream), - }, - required=True, -) -SchemaFor200ResponseBodyApplicationOctetStream = schemas.BinarySchema - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationOctetStream, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/octet-stream': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationOctetStream), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/octet-stream', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _upload_download_file_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationOctetStream,bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/octet-stream"] = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _upload_download_file_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationOctetStream,bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _upload_download_file_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationOctetStream,bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _upload_download_file_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationOctetStream,bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _upload_download_file_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationOctetStream,bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/octet-stream', - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - uploads a file and downloads a file using application/octet-stream - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class UploadDownloadFile(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def upload_download_file( - self, - body: typing.Union[SchemaForRequestBodyApplicationOctetStream,bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/octet-stream"] = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def upload_download_file( - self, - body: typing.Union[SchemaForRequestBodyApplicationOctetStream,bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def upload_download_file( - self, - body: typing.Union[SchemaForRequestBodyApplicationOctetStream,bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def upload_download_file( - self, - body: typing.Union[SchemaForRequestBodyApplicationOctetStream,bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def upload_download_file( - self, - body: typing.Union[SchemaForRequestBodyApplicationOctetStream,bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/octet-stream', - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._upload_download_file_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationOctetStream,bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/octet-stream"] = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationOctetStream,bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationOctetStream,bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationOctetStream,bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationOctetStream,bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/octet-stream', - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._upload_download_file_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_download_file/post.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_download_file/post.pyi deleted file mode 100644 index 1759d975a6c..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_download_file/post.pyi +++ /dev/null @@ -1,326 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -# body param -SchemaForRequestBodyApplicationOctetStream = schemas.BinarySchema - - -request_body_body = api_client.RequestBody( - content={ - 'application/octet-stream': api_client.MediaType( - schema=SchemaForRequestBodyApplicationOctetStream), - }, - required=True, -) -SchemaFor200ResponseBodyApplicationOctetStream = schemas.BinarySchema - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationOctetStream, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/octet-stream': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationOctetStream), - }, -) -_all_accept_content_types = ( - 'application/octet-stream', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _upload_download_file_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationOctetStream,bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/octet-stream"] = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _upload_download_file_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationOctetStream,bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _upload_download_file_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationOctetStream,bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _upload_download_file_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationOctetStream,bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _upload_download_file_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationOctetStream,bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/octet-stream', - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - uploads a file and downloads a file using application/octet-stream - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class UploadDownloadFile(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def upload_download_file( - self, - body: typing.Union[SchemaForRequestBodyApplicationOctetStream,bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/octet-stream"] = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def upload_download_file( - self, - body: typing.Union[SchemaForRequestBodyApplicationOctetStream,bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def upload_download_file( - self, - body: typing.Union[SchemaForRequestBodyApplicationOctetStream,bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def upload_download_file( - self, - body: typing.Union[SchemaForRequestBodyApplicationOctetStream,bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def upload_download_file( - self, - body: typing.Union[SchemaForRequestBodyApplicationOctetStream,bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/octet-stream', - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._upload_download_file_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationOctetStream,bytes, io.FileIO, io.BufferedReader, ], - content_type: typing_extensions.Literal["application/octet-stream"] = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationOctetStream,bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationOctetStream,bytes, io.FileIO, io.BufferedReader, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationOctetStream,bytes, io.FileIO, io.BufferedReader, ], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationOctetStream,bytes, io.FileIO, io.BufferedReader, ], - content_type: str = 'application/octet-stream', - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._upload_download_file_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_file/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_file/__init__.py deleted file mode 100644 index 3f4bf5709f3..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_file/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from petstore_api.paths.fake_upload_file import Api - -from petstore_api.paths import PathValues - -path = PathValues.FAKE_UPLOAD_FILE \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_file/post.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_file/post.py deleted file mode 100644 index 3c286bcf958..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_file/post.py +++ /dev/null @@ -1,394 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.api_response import ApiResponse - -from . import path - -# body param - - -class SchemaForRequestBodyMultipartFormData( - schemas.DictSchema -): - - - class MetaOapg: - required = { - "file", - } - - class properties: - additionalMetadata = schemas.StrSchema - file = schemas.BinarySchema - __annotations__ = { - "additionalMetadata": additionalMetadata, - "file": file, - } - - file: MetaOapg.properties.file - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["additionalMetadata"]) -> MetaOapg.properties.additionalMetadata: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["file"]) -> MetaOapg.properties.file: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["additionalMetadata", "file", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["additionalMetadata"]) -> typing.Union[MetaOapg.properties.additionalMetadata, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["file"]) -> MetaOapg.properties.file: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["additionalMetadata", "file", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - file: typing.Union[MetaOapg.properties.file, bytes, io.FileIO, io.BufferedReader, ], - additionalMetadata: typing.Union[MetaOapg.properties.additionalMetadata, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaForRequestBodyMultipartFormData': - return super().__new__( - cls, - *_args, - file=file, - additionalMetadata=additionalMetadata, - _configuration=_configuration, - **kwargs, - ) - - -request_body_body = api_client.RequestBody( - content={ - 'multipart/form-data': api_client.MediaType( - schema=SchemaForRequestBodyMultipartFormData), - }, -) -SchemaFor200ResponseBodyApplicationJson = ApiResponse - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _upload_file_oapg( - self, - content_type: typing_extensions.Literal["multipart/form-data"] = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _upload_file_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _upload_file_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _upload_file_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _upload_file_oapg( - self, - content_type: str = 'multipart/form-data', - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - uploads a file using multipart/form-data - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - _fields = None - _body = None - if body is not schemas.unset: - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class UploadFile(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def upload_file( - self, - content_type: typing_extensions.Literal["multipart/form-data"] = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def upload_file( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def upload_file( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def upload_file( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def upload_file( - self, - content_type: str = 'multipart/form-data', - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._upload_file_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - content_type: typing_extensions.Literal["multipart/form-data"] = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - content_type: str = 'multipart/form-data', - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._upload_file_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_file/post.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_file/post.pyi deleted file mode 100644 index ede3be6b8a6..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_file/post.pyi +++ /dev/null @@ -1,389 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.api_response import ApiResponse - -# body param - - -class SchemaForRequestBodyMultipartFormData( - schemas.DictSchema -): - - - class MetaOapg: - required = { - "file", - } - - class properties: - additionalMetadata = schemas.StrSchema - file = schemas.BinarySchema - __annotations__ = { - "additionalMetadata": additionalMetadata, - "file": file, - } - - file: MetaOapg.properties.file - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["additionalMetadata"]) -> MetaOapg.properties.additionalMetadata: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["file"]) -> MetaOapg.properties.file: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["additionalMetadata", "file", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["additionalMetadata"]) -> typing.Union[MetaOapg.properties.additionalMetadata, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["file"]) -> MetaOapg.properties.file: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["additionalMetadata", "file", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - file: typing.Union[MetaOapg.properties.file, bytes, io.FileIO, io.BufferedReader, ], - additionalMetadata: typing.Union[MetaOapg.properties.additionalMetadata, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaForRequestBodyMultipartFormData': - return super().__new__( - cls, - *_args, - file=file, - additionalMetadata=additionalMetadata, - _configuration=_configuration, - **kwargs, - ) - - -request_body_body = api_client.RequestBody( - content={ - 'multipart/form-data': api_client.MediaType( - schema=SchemaForRequestBodyMultipartFormData), - }, -) -SchemaFor200ResponseBodyApplicationJson = ApiResponse - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _upload_file_oapg( - self, - content_type: typing_extensions.Literal["multipart/form-data"] = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _upload_file_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _upload_file_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _upload_file_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _upload_file_oapg( - self, - content_type: str = 'multipart/form-data', - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - uploads a file using multipart/form-data - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - _fields = None - _body = None - if body is not schemas.unset: - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class UploadFile(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def upload_file( - self, - content_type: typing_extensions.Literal["multipart/form-data"] = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def upload_file( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def upload_file( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def upload_file( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def upload_file( - self, - content_type: str = 'multipart/form-data', - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._upload_file_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - content_type: typing_extensions.Literal["multipart/form-data"] = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - content_type: str = 'multipart/form-data', - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._upload_file_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_files/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_files/__init__.py deleted file mode 100644 index 20c593a329a..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_files/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from petstore_api.paths.fake_upload_files import Api - -from petstore_api.paths import PathValues - -path = PathValues.FAKE_UPLOAD_FILES \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_files/post.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_files/post.py deleted file mode 100644 index 3f1e0405e55..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_files/post.py +++ /dev/null @@ -1,401 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.api_response import ApiResponse - -from . import path - -# body param - - -class SchemaForRequestBodyMultipartFormData( - schemas.DictSchema -): - - - class MetaOapg: - - class properties: - - - class files( - schemas.ListSchema - ): - - - class MetaOapg: - items = schemas.BinarySchema - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, bytes, io.FileIO, io.BufferedReader, ]], typing.List[typing.Union[MetaOapg.items, bytes, io.FileIO, io.BufferedReader, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'files': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - __annotations__ = { - "files": files, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["files"]) -> MetaOapg.properties.files: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["files", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["files"]) -> typing.Union[MetaOapg.properties.files, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["files", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - files: typing.Union[MetaOapg.properties.files, list, tuple, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaForRequestBodyMultipartFormData': - return super().__new__( - cls, - *_args, - files=files, - _configuration=_configuration, - **kwargs, - ) - - -request_body_body = api_client.RequestBody( - content={ - 'multipart/form-data': api_client.MediaType( - schema=SchemaForRequestBodyMultipartFormData), - }, -) -SchemaFor200ResponseBodyApplicationJson = ApiResponse - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _upload_files_oapg( - self, - content_type: typing_extensions.Literal["multipart/form-data"] = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _upload_files_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _upload_files_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _upload_files_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _upload_files_oapg( - self, - content_type: str = 'multipart/form-data', - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - uploads files using multipart/form-data - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - _fields = None - _body = None - if body is not schemas.unset: - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class UploadFiles(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def upload_files( - self, - content_type: typing_extensions.Literal["multipart/form-data"] = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def upload_files( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def upload_files( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def upload_files( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def upload_files( - self, - content_type: str = 'multipart/form-data', - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._upload_files_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - content_type: typing_extensions.Literal["multipart/form-data"] = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - content_type: str = 'multipart/form-data', - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._upload_files_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_files/post.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_files/post.pyi deleted file mode 100644 index 985e5f7be29..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_files/post.pyi +++ /dev/null @@ -1,396 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.api_response import ApiResponse - -# body param - - -class SchemaForRequestBodyMultipartFormData( - schemas.DictSchema -): - - - class MetaOapg: - - class properties: - - - class files( - schemas.ListSchema - ): - - - class MetaOapg: - items = schemas.BinarySchema - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, bytes, io.FileIO, io.BufferedReader, ]], typing.List[typing.Union[MetaOapg.items, bytes, io.FileIO, io.BufferedReader, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'files': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - __annotations__ = { - "files": files, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["files"]) -> MetaOapg.properties.files: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["files", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["files"]) -> typing.Union[MetaOapg.properties.files, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["files", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - files: typing.Union[MetaOapg.properties.files, list, tuple, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaForRequestBodyMultipartFormData': - return super().__new__( - cls, - *_args, - files=files, - _configuration=_configuration, - **kwargs, - ) - - -request_body_body = api_client.RequestBody( - content={ - 'multipart/form-data': api_client.MediaType( - schema=SchemaForRequestBodyMultipartFormData), - }, -) -SchemaFor200ResponseBodyApplicationJson = ApiResponse - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _upload_files_oapg( - self, - content_type: typing_extensions.Literal["multipart/form-data"] = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _upload_files_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _upload_files_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _upload_files_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _upload_files_oapg( - self, - content_type: str = 'multipart/form-data', - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - uploads files using multipart/form-data - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - _fields = None - _body = None - if body is not schemas.unset: - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class UploadFiles(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def upload_files( - self, - content_type: typing_extensions.Literal["multipart/form-data"] = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def upload_files( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def upload_files( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def upload_files( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def upload_files( - self, - content_type: str = 'multipart/form-data', - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._upload_files_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - content_type: typing_extensions.Literal["multipart/form-data"] = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - content_type: str = 'multipart/form-data', - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._upload_files_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/foo/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/foo/__init__.py deleted file mode 100644 index e7bea652ad4..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/foo/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from petstore_api.paths.foo import Api - -from petstore_api.paths import PathValues - -path = PathValues.FOO \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/foo/get.py b/samples/openapi3/client/petstore/python/petstore_api/paths/foo/get.py deleted file mode 100644 index 1e47032f220..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/foo/get.py +++ /dev/null @@ -1,294 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.foo import Foo - -from . import path - - - -class SchemaFor0ResponseBodyApplicationJson( - schemas.DictSchema -): - - - class MetaOapg: - - class properties: - - @staticmethod - def string() -> typing.Type['Foo']: - return Foo - __annotations__ = { - "string": string, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["string"]) -> 'Foo': ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["string", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["string"]) -> typing.Union['Foo', schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["string", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - string: typing.Union['Foo', schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaFor0ResponseBodyApplicationJson': - return super().__new__( - cls, - *_args, - string=string, - _configuration=_configuration, - **kwargs, - ) - - -@dataclass -class ApiResponseForDefault(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor0ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_default = api_client.OpenApiResponse( - response_cls=ApiResponseForDefault, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor0ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - 'default': _response_for_default, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _foo_get_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseForDefault, - ]: ... - - @typing.overload - def _foo_get_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _foo_get_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseForDefault, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _foo_get_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='get'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - default_response = _status_code_to_response.get('default') - if default_response: - api_response = default_response.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class FooGet(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def foo_get( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseForDefault, - ]: ... - - @typing.overload - def foo_get( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def foo_get( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseForDefault, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def foo_get( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._foo_get_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForget(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def get( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseForDefault, - ]: ... - - @typing.overload - def get( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def get( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseForDefault, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def get( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._foo_get_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/foo/get.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/foo/get.pyi deleted file mode 100644 index 4cdef988684..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/foo/get.pyi +++ /dev/null @@ -1,289 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.foo import Foo - - - -class SchemaFor0ResponseBodyApplicationJson( - schemas.DictSchema -): - - - class MetaOapg: - - class properties: - - @staticmethod - def string() -> typing.Type['Foo']: - return Foo - __annotations__ = { - "string": string, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["string"]) -> 'Foo': ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["string", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["string"]) -> typing.Union['Foo', schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["string", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - string: typing.Union['Foo', schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaFor0ResponseBodyApplicationJson': - return super().__new__( - cls, - *_args, - string=string, - _configuration=_configuration, - **kwargs, - ) - - -@dataclass -class ApiResponseForDefault(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor0ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_default = api_client.OpenApiResponse( - response_cls=ApiResponseForDefault, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor0ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _foo_get_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseForDefault, - ]: ... - - @typing.overload - def _foo_get_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _foo_get_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseForDefault, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _foo_get_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='get'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - default_response = _status_code_to_response.get('default') - if default_response: - api_response = default_response.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class FooGet(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def foo_get( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseForDefault, - ]: ... - - @typing.overload - def foo_get( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def foo_get( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseForDefault, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def foo_get( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._foo_get_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForget(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def get( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseForDefault, - ]: ... - - @typing.overload - def get( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def get( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseForDefault, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def get( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._foo_get_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet/__init__.py deleted file mode 100644 index a52ddaccdbb..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from petstore_api.paths.pet import Api - -from petstore_api.paths import PathValues - -path = PathValues.PET \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet/post.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet/post.py deleted file mode 100644 index 8e267ad6491..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet/post.py +++ /dev/null @@ -1,393 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.pet import Pet - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = Pet -SchemaForRequestBodyApplicationXml = Pet - - -request_body_pet = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - 'application/xml': api_client.MediaType( - schema=SchemaForRequestBodyApplicationXml), - }, - required=True, -) -_auth = [ - 'http_signature_test', - 'petstore_auth', -] -_servers = ( - { - 'url': "https://petstore.swagger.io/v2", - 'description': "No description provided", - }, - { - 'url': "https://path-server-test.petstore.local/v2", - 'description': "No description provided", - }, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -@dataclass -class ApiResponseFor405(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_405 = api_client.OpenApiResponse( - response_cls=ApiResponseFor405, -) -_status_code_to_response = { - '200': _response_for_200, - '405': _response_for_405, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _add_pet_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _add_pet_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationXml,], - content_type: typing_extensions.Literal["application/xml"], - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _add_pet_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,SchemaForRequestBodyApplicationXml,], - content_type: str = ..., - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _add_pet_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,SchemaForRequestBodyApplicationXml,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _add_pet_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,SchemaForRequestBodyApplicationXml,], - content_type: str = ..., - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _add_pet_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,SchemaForRequestBodyApplicationXml,], - content_type: str = 'application/json', - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - Add a new pet to the store - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_pet.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - host = self._get_host_oapg('add_pet', _servers, host_index) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - auth_settings=_auth, - host=host, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class AddPet(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def add_pet( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def add_pet( - self, - body: typing.Union[SchemaForRequestBodyApplicationXml,], - content_type: typing_extensions.Literal["application/xml"], - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def add_pet( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,SchemaForRequestBodyApplicationXml,], - content_type: str = ..., - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def add_pet( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,SchemaForRequestBodyApplicationXml,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def add_pet( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,SchemaForRequestBodyApplicationXml,], - content_type: str = ..., - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def add_pet( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,SchemaForRequestBodyApplicationXml,], - content_type: str = 'application/json', - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._add_pet_oapg( - body=body, - content_type=content_type, - host_index=host_index, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationXml,], - content_type: typing_extensions.Literal["application/xml"], - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,SchemaForRequestBodyApplicationXml,], - content_type: str = ..., - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,SchemaForRequestBodyApplicationXml,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,SchemaForRequestBodyApplicationXml,], - content_type: str = ..., - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,SchemaForRequestBodyApplicationXml,], - content_type: str = 'application/json', - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._add_pet_oapg( - body=body, - content_type=content_type, - host_index=host_index, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet/post.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/pet/post.pyi deleted file mode 100644 index b42118a94c6..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet/post.pyi +++ /dev/null @@ -1,373 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.pet import Pet - -# body param -SchemaForRequestBodyApplicationJson = Pet -SchemaForRequestBodyApplicationXml = Pet - - -request_body_pet = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - 'application/xml': api_client.MediaType( - schema=SchemaForRequestBodyApplicationXml), - }, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -@dataclass -class ApiResponseFor405(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_405 = api_client.OpenApiResponse( - response_cls=ApiResponseFor405, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _add_pet_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _add_pet_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationXml,], - content_type: typing_extensions.Literal["application/xml"], - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _add_pet_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,SchemaForRequestBodyApplicationXml,], - content_type: str = ..., - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _add_pet_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,SchemaForRequestBodyApplicationXml,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _add_pet_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,SchemaForRequestBodyApplicationXml,], - content_type: str = ..., - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _add_pet_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,SchemaForRequestBodyApplicationXml,], - content_type: str = 'application/json', - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - Add a new pet to the store - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_pet.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - host = self._get_host_oapg('add_pet', _servers, host_index) - - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - auth_settings=_auth, - host=host, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class AddPet(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def add_pet( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def add_pet( - self, - body: typing.Union[SchemaForRequestBodyApplicationXml,], - content_type: typing_extensions.Literal["application/xml"], - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def add_pet( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,SchemaForRequestBodyApplicationXml,], - content_type: str = ..., - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def add_pet( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,SchemaForRequestBodyApplicationXml,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def add_pet( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,SchemaForRequestBodyApplicationXml,], - content_type: str = ..., - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def add_pet( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,SchemaForRequestBodyApplicationXml,], - content_type: str = 'application/json', - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._add_pet_oapg( - body=body, - content_type=content_type, - host_index=host_index, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationXml,], - content_type: typing_extensions.Literal["application/xml"], - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,SchemaForRequestBodyApplicationXml,], - content_type: str = ..., - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,SchemaForRequestBodyApplicationXml,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,SchemaForRequestBodyApplicationXml,], - content_type: str = ..., - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,SchemaForRequestBodyApplicationXml,], - content_type: str = 'application/json', - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._add_pet_oapg( - body=body, - content_type=content_type, - host_index=host_index, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet/put.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet/put.py deleted file mode 100644 index 59a92186bfa..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet/put.py +++ /dev/null @@ -1,376 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.pet import Pet - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = Pet -SchemaForRequestBodyApplicationXml = Pet - - -request_body_pet = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - 'application/xml': api_client.MediaType( - schema=SchemaForRequestBodyApplicationXml), - }, - required=True, -) -_auth = [ - 'http_signature_test', - 'petstore_auth', -] -_servers = ( - { - 'url': "https://petstore.swagger.io/v2", - 'description': "No description provided", - }, - { - 'url': "https://path-server-test.petstore.local/v2", - 'description': "No description provided", - }, -) - - -@dataclass -class ApiResponseFor400(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_400 = api_client.OpenApiResponse( - response_cls=ApiResponseFor400, -) - - -@dataclass -class ApiResponseFor404(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_404 = api_client.OpenApiResponse( - response_cls=ApiResponseFor404, -) - - -@dataclass -class ApiResponseFor405(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_405 = api_client.OpenApiResponse( - response_cls=ApiResponseFor405, -) -_status_code_to_response = { - '400': _response_for_400, - '404': _response_for_404, - '405': _response_for_405, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _update_pet_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> api_client.ApiResponseWithoutDeserialization: ... - @typing.overload - def _update_pet_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationXml,], - content_type: typing_extensions.Literal["application/xml"], - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> api_client.ApiResponseWithoutDeserialization: ... - @typing.overload - def _update_pet_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,SchemaForRequestBodyApplicationXml,], - content_type: str = ..., - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _update_pet_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,SchemaForRequestBodyApplicationXml,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _update_pet_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,SchemaForRequestBodyApplicationXml,], - content_type: str = ..., - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _update_pet_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,SchemaForRequestBodyApplicationXml,], - content_type: str = 'application/json', - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - Update an existing pet - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_pet.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - host = self._get_host_oapg('update_pet', _servers, host_index) - - response = self.api_client.call_api( - resource_path=used_path, - method='put'.upper(), - headers=_headers, - fields=_fields, - body=_body, - auth_settings=_auth, - host=host, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class UpdatePet(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def update_pet( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> api_client.ApiResponseWithoutDeserialization: ... - @typing.overload - def update_pet( - self, - body: typing.Union[SchemaForRequestBodyApplicationXml,], - content_type: typing_extensions.Literal["application/xml"], - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> api_client.ApiResponseWithoutDeserialization: ... - @typing.overload - def update_pet( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,SchemaForRequestBodyApplicationXml,], - content_type: str = ..., - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def update_pet( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,SchemaForRequestBodyApplicationXml,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def update_pet( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,SchemaForRequestBodyApplicationXml,], - content_type: str = ..., - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def update_pet( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,SchemaForRequestBodyApplicationXml,], - content_type: str = 'application/json', - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._update_pet_oapg( - body=body, - content_type=content_type, - host_index=host_index, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForput(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def put( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> api_client.ApiResponseWithoutDeserialization: ... - @typing.overload - def put( - self, - body: typing.Union[SchemaForRequestBodyApplicationXml,], - content_type: typing_extensions.Literal["application/xml"], - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> api_client.ApiResponseWithoutDeserialization: ... - @typing.overload - def put( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,SchemaForRequestBodyApplicationXml,], - content_type: str = ..., - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def put( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,SchemaForRequestBodyApplicationXml,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def put( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,SchemaForRequestBodyApplicationXml,], - content_type: str = ..., - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def put( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,SchemaForRequestBodyApplicationXml,], - content_type: str = 'application/json', - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._update_pet_oapg( - body=body, - content_type=content_type, - host_index=host_index, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet/put.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/pet/put.pyi deleted file mode 100644 index fbea6f42af3..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet/put.pyi +++ /dev/null @@ -1,355 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.pet import Pet - -# body param -SchemaForRequestBodyApplicationJson = Pet -SchemaForRequestBodyApplicationXml = Pet - - -request_body_pet = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - 'application/xml': api_client.MediaType( - schema=SchemaForRequestBodyApplicationXml), - }, - required=True, -) - - -@dataclass -class ApiResponseFor400(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_400 = api_client.OpenApiResponse( - response_cls=ApiResponseFor400, -) - - -@dataclass -class ApiResponseFor404(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_404 = api_client.OpenApiResponse( - response_cls=ApiResponseFor404, -) - - -@dataclass -class ApiResponseFor405(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_405 = api_client.OpenApiResponse( - response_cls=ApiResponseFor405, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _update_pet_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> api_client.ApiResponseWithoutDeserialization: ... - @typing.overload - def _update_pet_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationXml,], - content_type: typing_extensions.Literal["application/xml"], - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> api_client.ApiResponseWithoutDeserialization: ... - @typing.overload - def _update_pet_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,SchemaForRequestBodyApplicationXml,], - content_type: str = ..., - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _update_pet_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,SchemaForRequestBodyApplicationXml,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _update_pet_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,SchemaForRequestBodyApplicationXml,], - content_type: str = ..., - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _update_pet_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,SchemaForRequestBodyApplicationXml,], - content_type: str = 'application/json', - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - Update an existing pet - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_pet.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - host = self._get_host_oapg('update_pet', _servers, host_index) - - response = self.api_client.call_api( - resource_path=used_path, - method='put'.upper(), - headers=_headers, - fields=_fields, - body=_body, - auth_settings=_auth, - host=host, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class UpdatePet(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def update_pet( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> api_client.ApiResponseWithoutDeserialization: ... - @typing.overload - def update_pet( - self, - body: typing.Union[SchemaForRequestBodyApplicationXml,], - content_type: typing_extensions.Literal["application/xml"], - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> api_client.ApiResponseWithoutDeserialization: ... - @typing.overload - def update_pet( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,SchemaForRequestBodyApplicationXml,], - content_type: str = ..., - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def update_pet( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,SchemaForRequestBodyApplicationXml,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def update_pet( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,SchemaForRequestBodyApplicationXml,], - content_type: str = ..., - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def update_pet( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,SchemaForRequestBodyApplicationXml,], - content_type: str = 'application/json', - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._update_pet_oapg( - body=body, - content_type=content_type, - host_index=host_index, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForput(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def put( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> api_client.ApiResponseWithoutDeserialization: ... - @typing.overload - def put( - self, - body: typing.Union[SchemaForRequestBodyApplicationXml,], - content_type: typing_extensions.Literal["application/xml"], - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> api_client.ApiResponseWithoutDeserialization: ... - @typing.overload - def put( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,SchemaForRequestBodyApplicationXml,], - content_type: str = ..., - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def put( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,SchemaForRequestBodyApplicationXml,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def put( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,SchemaForRequestBodyApplicationXml,], - content_type: str = ..., - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def put( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,SchemaForRequestBodyApplicationXml,], - content_type: str = 'application/json', - host_index: typing.Optional[int] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._update_pet_oapg( - body=body, - content_type=content_type, - host_index=host_index, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_status/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_status/__init__.py deleted file mode 100644 index f0f9ca9ac2e..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_status/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from petstore_api.paths.pet_find_by_status import Api - -from petstore_api.paths import PathValues - -path = PathValues.PET_FIND_BY_STATUS \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_status/get.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_status/get.py deleted file mode 100644 index c88c43fdb22..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_status/get.py +++ /dev/null @@ -1,413 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.pet import Pet - -from . import path - -# Query params - - -class StatusSchema( - schemas.ListSchema -): - - - class MetaOapg: - - - class items( - schemas.EnumBase, - schemas.StrSchema - ): - - - class MetaOapg: - enum_value_to_name = { - "available": "AVAILABLE", - "pending": "PENDING", - "sold": "SOLD", - } - - @schemas.classproperty - def AVAILABLE(cls): - return cls("available") - - @schemas.classproperty - def PENDING(cls): - return cls("pending") - - @schemas.classproperty - def SOLD(cls): - return cls("sold") - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, str, ]], typing.List[typing.Union[MetaOapg.items, str, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'StatusSchema': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) -RequestRequiredQueryParams = typing_extensions.TypedDict( - 'RequestRequiredQueryParams', - { - 'status': typing.Union[StatusSchema, list, tuple, ], - } -) -RequestOptionalQueryParams = typing_extensions.TypedDict( - 'RequestOptionalQueryParams', - { - }, - total=False -) - - -class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): - pass - - -request_query_status = api_client.QueryParameter( - name="status", - style=api_client.ParameterStyle.FORM, - schema=StatusSchema, - required=True, -) -_auth = [ - 'http_signature_test', - 'petstore_auth', -] - - -class SchemaFor200ResponseBodyApplicationXml( - schemas.ListSchema -): - - - class MetaOapg: - - @staticmethod - def items() -> typing.Type['Pet']: - return Pet - - def __new__( - cls, - _arg: typing.Union[typing.Tuple['Pet'], typing.List['Pet']], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'SchemaFor200ResponseBodyApplicationXml': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> 'Pet': - return super().__getitem__(i) - - -class SchemaFor200ResponseBodyApplicationJson( - schemas.ListSchema -): - - - class MetaOapg: - - @staticmethod - def items() -> typing.Type['Pet']: - return Pet - - def __new__( - cls, - _arg: typing.Union[typing.Tuple['Pet'], typing.List['Pet']], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'SchemaFor200ResponseBodyApplicationJson': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> 'Pet': - return super().__getitem__(i) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationXml, - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/xml': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationXml), - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) - - -@dataclass -class ApiResponseFor400(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_400 = api_client.OpenApiResponse( - response_cls=ApiResponseFor400, -) -_status_code_to_response = { - '200': _response_for_200, - '400': _response_for_400, -} -_all_accept_content_types = ( - 'application/xml', - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _find_pets_by_status_oapg( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _find_pets_by_status_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _find_pets_by_status_oapg( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _find_pets_by_status_oapg( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - Finds Pets by status - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) - used_path = path.value - - prefix_separator_iterator = None - for parameter in ( - request_query_status, - ): - parameter_data = query_params.get(parameter.name, schemas.unset) - if parameter_data is schemas.unset: - continue - if prefix_separator_iterator is None: - prefix_separator_iterator = parameter.get_prefix_separator_iterator() - serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) - for serialized_value in serialized_data.values(): - used_path += serialized_value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='get'.upper(), - headers=_headers, - auth_settings=_auth, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class FindPetsByStatus(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def find_pets_by_status( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def find_pets_by_status( - self, - skip_deserialization: typing_extensions.Literal[True], - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def find_pets_by_status( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def find_pets_by_status( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._find_pets_by_status_oapg( - query_params=query_params, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForget(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def get( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def get( - self, - skip_deserialization: typing_extensions.Literal[True], - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def get( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def get( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._find_pets_by_status_oapg( - query_params=query_params, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_status/get.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_status/get.pyi deleted file mode 100644 index b155bb61f74..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_status/get.pyi +++ /dev/null @@ -1,395 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.pet import Pet - -# Query params - - -class StatusSchema( - schemas.ListSchema -): - - - class MetaOapg: - - - class items( - schemas.EnumBase, - schemas.StrSchema - ): - - @schemas.classproperty - def AVAILABLE(cls): - return cls("available") - - @schemas.classproperty - def PENDING(cls): - return cls("pending") - - @schemas.classproperty - def SOLD(cls): - return cls("sold") - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, str, ]], typing.List[typing.Union[MetaOapg.items, str, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'StatusSchema': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) -RequestRequiredQueryParams = typing_extensions.TypedDict( - 'RequestRequiredQueryParams', - { - 'status': typing.Union[StatusSchema, list, tuple, ], - } -) -RequestOptionalQueryParams = typing_extensions.TypedDict( - 'RequestOptionalQueryParams', - { - }, - total=False -) - - -class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): - pass - - -request_query_status = api_client.QueryParameter( - name="status", - style=api_client.ParameterStyle.FORM, - schema=StatusSchema, - required=True, -) - - -class SchemaFor200ResponseBodyApplicationXml( - schemas.ListSchema -): - - - class MetaOapg: - - @staticmethod - def items() -> typing.Type['Pet']: - return Pet - - def __new__( - cls, - _arg: typing.Union[typing.Tuple['Pet'], typing.List['Pet']], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'SchemaFor200ResponseBodyApplicationXml': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> 'Pet': - return super().__getitem__(i) - - -class SchemaFor200ResponseBodyApplicationJson( - schemas.ListSchema -): - - - class MetaOapg: - - @staticmethod - def items() -> typing.Type['Pet']: - return Pet - - def __new__( - cls, - _arg: typing.Union[typing.Tuple['Pet'], typing.List['Pet']], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'SchemaFor200ResponseBodyApplicationJson': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> 'Pet': - return super().__getitem__(i) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationXml, - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/xml': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationXml), - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) - - -@dataclass -class ApiResponseFor400(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_400 = api_client.OpenApiResponse( - response_cls=ApiResponseFor400, -) -_all_accept_content_types = ( - 'application/xml', - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _find_pets_by_status_oapg( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _find_pets_by_status_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _find_pets_by_status_oapg( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _find_pets_by_status_oapg( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - Finds Pets by status - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) - used_path = path.value - - prefix_separator_iterator = None - for parameter in ( - request_query_status, - ): - parameter_data = query_params.get(parameter.name, schemas.unset) - if parameter_data is schemas.unset: - continue - if prefix_separator_iterator is None: - prefix_separator_iterator = parameter.get_prefix_separator_iterator() - serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) - for serialized_value in serialized_data.values(): - used_path += serialized_value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='get'.upper(), - headers=_headers, - auth_settings=_auth, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class FindPetsByStatus(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def find_pets_by_status( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def find_pets_by_status( - self, - skip_deserialization: typing_extensions.Literal[True], - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def find_pets_by_status( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def find_pets_by_status( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._find_pets_by_status_oapg( - query_params=query_params, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForget(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def get( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def get( - self, - skip_deserialization: typing_extensions.Literal[True], - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def get( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def get( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._find_pets_by_status_oapg( - query_params=query_params, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_tags/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_tags/__init__.py deleted file mode 100644 index 55063b645ec..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_tags/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from petstore_api.paths.pet_find_by_tags import Api - -from petstore_api.paths import PathValues - -path = PathValues.PET_FIND_BY_TAGS \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_tags/get.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_tags/get.py deleted file mode 100644 index dcc3db50dcd..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_tags/get.py +++ /dev/null @@ -1,388 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.pet import Pet - -from . import path - -# Query params - - -class TagsSchema( - schemas.ListSchema -): - - - class MetaOapg: - items = schemas.StrSchema - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, str, ]], typing.List[typing.Union[MetaOapg.items, str, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'TagsSchema': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) -RequestRequiredQueryParams = typing_extensions.TypedDict( - 'RequestRequiredQueryParams', - { - 'tags': typing.Union[TagsSchema, list, tuple, ], - } -) -RequestOptionalQueryParams = typing_extensions.TypedDict( - 'RequestOptionalQueryParams', - { - }, - total=False -) - - -class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): - pass - - -request_query_tags = api_client.QueryParameter( - name="tags", - style=api_client.ParameterStyle.FORM, - schema=TagsSchema, - required=True, -) -_auth = [ - 'http_signature_test', - 'petstore_auth', -] - - -class SchemaFor200ResponseBodyApplicationXml( - schemas.ListSchema -): - - - class MetaOapg: - - @staticmethod - def items() -> typing.Type['Pet']: - return Pet - - def __new__( - cls, - _arg: typing.Union[typing.Tuple['Pet'], typing.List['Pet']], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'SchemaFor200ResponseBodyApplicationXml': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> 'Pet': - return super().__getitem__(i) - - -class SchemaFor200ResponseBodyApplicationJson( - schemas.ListSchema -): - - - class MetaOapg: - - @staticmethod - def items() -> typing.Type['Pet']: - return Pet - - def __new__( - cls, - _arg: typing.Union[typing.Tuple['Pet'], typing.List['Pet']], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'SchemaFor200ResponseBodyApplicationJson': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> 'Pet': - return super().__getitem__(i) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationXml, - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/xml': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationXml), - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) - - -@dataclass -class ApiResponseFor400(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_400 = api_client.OpenApiResponse( - response_cls=ApiResponseFor400, -) -_status_code_to_response = { - '200': _response_for_200, - '400': _response_for_400, -} -_all_accept_content_types = ( - 'application/xml', - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _find_pets_by_tags_oapg( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _find_pets_by_tags_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _find_pets_by_tags_oapg( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _find_pets_by_tags_oapg( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - Finds Pets by tags - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) - used_path = path.value - - prefix_separator_iterator = None - for parameter in ( - request_query_tags, - ): - parameter_data = query_params.get(parameter.name, schemas.unset) - if parameter_data is schemas.unset: - continue - if prefix_separator_iterator is None: - prefix_separator_iterator = parameter.get_prefix_separator_iterator() - serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) - for serialized_value in serialized_data.values(): - used_path += serialized_value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='get'.upper(), - headers=_headers, - auth_settings=_auth, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class FindPetsByTags(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def find_pets_by_tags( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def find_pets_by_tags( - self, - skip_deserialization: typing_extensions.Literal[True], - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def find_pets_by_tags( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def find_pets_by_tags( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._find_pets_by_tags_oapg( - query_params=query_params, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForget(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def get( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def get( - self, - skip_deserialization: typing_extensions.Literal[True], - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def get( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def get( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._find_pets_by_tags_oapg( - query_params=query_params, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_tags/get.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_tags/get.pyi deleted file mode 100644 index e383b274078..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_tags/get.pyi +++ /dev/null @@ -1,378 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.pet import Pet - -# Query params - - -class TagsSchema( - schemas.ListSchema -): - - - class MetaOapg: - items = schemas.StrSchema - - def __new__( - cls, - _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, str, ]], typing.List[typing.Union[MetaOapg.items, str, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'TagsSchema': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) -RequestRequiredQueryParams = typing_extensions.TypedDict( - 'RequestRequiredQueryParams', - { - 'tags': typing.Union[TagsSchema, list, tuple, ], - } -) -RequestOptionalQueryParams = typing_extensions.TypedDict( - 'RequestOptionalQueryParams', - { - }, - total=False -) - - -class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): - pass - - -request_query_tags = api_client.QueryParameter( - name="tags", - style=api_client.ParameterStyle.FORM, - schema=TagsSchema, - required=True, -) - - -class SchemaFor200ResponseBodyApplicationXml( - schemas.ListSchema -): - - - class MetaOapg: - - @staticmethod - def items() -> typing.Type['Pet']: - return Pet - - def __new__( - cls, - _arg: typing.Union[typing.Tuple['Pet'], typing.List['Pet']], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'SchemaFor200ResponseBodyApplicationXml': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> 'Pet': - return super().__getitem__(i) - - -class SchemaFor200ResponseBodyApplicationJson( - schemas.ListSchema -): - - - class MetaOapg: - - @staticmethod - def items() -> typing.Type['Pet']: - return Pet - - def __new__( - cls, - _arg: typing.Union[typing.Tuple['Pet'], typing.List['Pet']], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'SchemaFor200ResponseBodyApplicationJson': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> 'Pet': - return super().__getitem__(i) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationXml, - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/xml': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationXml), - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) - - -@dataclass -class ApiResponseFor400(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_400 = api_client.OpenApiResponse( - response_cls=ApiResponseFor400, -) -_all_accept_content_types = ( - 'application/xml', - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _find_pets_by_tags_oapg( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _find_pets_by_tags_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _find_pets_by_tags_oapg( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _find_pets_by_tags_oapg( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - Finds Pets by tags - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) - used_path = path.value - - prefix_separator_iterator = None - for parameter in ( - request_query_tags, - ): - parameter_data = query_params.get(parameter.name, schemas.unset) - if parameter_data is schemas.unset: - continue - if prefix_separator_iterator is None: - prefix_separator_iterator = parameter.get_prefix_separator_iterator() - serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) - for serialized_value in serialized_data.values(): - used_path += serialized_value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='get'.upper(), - headers=_headers, - auth_settings=_auth, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class FindPetsByTags(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def find_pets_by_tags( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def find_pets_by_tags( - self, - skip_deserialization: typing_extensions.Literal[True], - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def find_pets_by_tags( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def find_pets_by_tags( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._find_pets_by_tags_oapg( - query_params=query_params, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForget(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def get( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def get( - self, - skip_deserialization: typing_extensions.Literal[True], - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def get( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def get( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._find_pets_by_tags_oapg( - query_params=query_params, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/__init__.py deleted file mode 100644 index b165f841464..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from petstore_api.paths.pet_pet_id import Api - -from petstore_api.paths import PathValues - -path = PathValues.PET_PET_ID \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/delete.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/delete.py deleted file mode 100644 index 4f1fc57d6bf..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/delete.py +++ /dev/null @@ -1,304 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from . import path - -# Header params -ApiKeySchema = schemas.StrSchema -RequestRequiredHeaderParams = typing_extensions.TypedDict( - 'RequestRequiredHeaderParams', - { - } -) -RequestOptionalHeaderParams = typing_extensions.TypedDict( - 'RequestOptionalHeaderParams', - { - 'api_key': typing.Union[ApiKeySchema, str, ], - }, - total=False -) - - -class RequestHeaderParams(RequestRequiredHeaderParams, RequestOptionalHeaderParams): - pass - - -request_header_api_key = api_client.HeaderParameter( - name="api_key", - style=api_client.ParameterStyle.SIMPLE, - schema=ApiKeySchema, -) -# Path params -PetIdSchema = schemas.Int64Schema -RequestRequiredPathParams = typing_extensions.TypedDict( - 'RequestRequiredPathParams', - { - 'petId': typing.Union[PetIdSchema, decimal.Decimal, int, ], - } -) -RequestOptionalPathParams = typing_extensions.TypedDict( - 'RequestOptionalPathParams', - { - }, - total=False -) - - -class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): - pass - - -request_path_pet_id = api_client.PathParameter( - name="petId", - style=api_client.ParameterStyle.SIMPLE, - schema=PetIdSchema, - required=True, -) -_auth = [ - 'petstore_auth', -] - - -@dataclass -class ApiResponseFor400(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_400 = api_client.OpenApiResponse( - response_cls=ApiResponseFor400, -) -_status_code_to_response = { - '400': _response_for_400, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _delete_pet_oapg( - self, - header_params: RequestHeaderParams = frozendict.frozendict(), - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> api_client.ApiResponseWithoutDeserialization: ... - @typing.overload - def _delete_pet_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - header_params: RequestHeaderParams = frozendict.frozendict(), - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _delete_pet_oapg( - self, - header_params: RequestHeaderParams = frozendict.frozendict(), - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _delete_pet_oapg( - self, - header_params: RequestHeaderParams = frozendict.frozendict(), - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - Deletes a pet - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - self._verify_typed_dict_inputs_oapg(RequestHeaderParams, header_params) - self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) - used_path = path.value - - _path_params = {} - for parameter in ( - request_path_pet_id, - ): - parameter_data = path_params.get(parameter.name, schemas.unset) - if parameter_data is schemas.unset: - continue - serialized_data = parameter.serialize(parameter_data) - _path_params.update(serialized_data) - - for k, v in _path_params.items(): - used_path = used_path.replace('{%s}' % k, v) - - _headers = HTTPHeaderDict() - for parameter in ( - request_header_api_key, - ): - parameter_data = header_params.get(parameter.name, schemas.unset) - if parameter_data is schemas.unset: - continue - serialized_data = parameter.serialize(parameter_data) - _headers.extend(serialized_data) - # TODO add cookie handling - - response = self.api_client.call_api( - resource_path=used_path, - method='delete'.upper(), - headers=_headers, - auth_settings=_auth, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class DeletePet(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def delete_pet( - self, - header_params: RequestHeaderParams = frozendict.frozendict(), - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> api_client.ApiResponseWithoutDeserialization: ... - @typing.overload - def delete_pet( - self, - skip_deserialization: typing_extensions.Literal[True], - header_params: RequestHeaderParams = frozendict.frozendict(), - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def delete_pet( - self, - header_params: RequestHeaderParams = frozendict.frozendict(), - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def delete_pet( - self, - header_params: RequestHeaderParams = frozendict.frozendict(), - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._delete_pet_oapg( - header_params=header_params, - path_params=path_params, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiFordelete(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def delete( - self, - header_params: RequestHeaderParams = frozendict.frozendict(), - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> api_client.ApiResponseWithoutDeserialization: ... - @typing.overload - def delete( - self, - skip_deserialization: typing_extensions.Literal[True], - header_params: RequestHeaderParams = frozendict.frozendict(), - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def delete( - self, - header_params: RequestHeaderParams = frozendict.frozendict(), - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def delete( - self, - header_params: RequestHeaderParams = frozendict.frozendict(), - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._delete_pet_oapg( - header_params=header_params, - path_params=path_params, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/delete.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/delete.pyi deleted file mode 100644 index bae37d55ea9..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/delete.pyi +++ /dev/null @@ -1,296 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -# Header params -ApiKeySchema = schemas.StrSchema -RequestRequiredHeaderParams = typing_extensions.TypedDict( - 'RequestRequiredHeaderParams', - { - } -) -RequestOptionalHeaderParams = typing_extensions.TypedDict( - 'RequestOptionalHeaderParams', - { - 'api_key': typing.Union[ApiKeySchema, str, ], - }, - total=False -) - - -class RequestHeaderParams(RequestRequiredHeaderParams, RequestOptionalHeaderParams): - pass - - -request_header_api_key = api_client.HeaderParameter( - name="api_key", - style=api_client.ParameterStyle.SIMPLE, - schema=ApiKeySchema, -) -# Path params -PetIdSchema = schemas.Int64Schema -RequestRequiredPathParams = typing_extensions.TypedDict( - 'RequestRequiredPathParams', - { - 'petId': typing.Union[PetIdSchema, decimal.Decimal, int, ], - } -) -RequestOptionalPathParams = typing_extensions.TypedDict( - 'RequestOptionalPathParams', - { - }, - total=False -) - - -class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): - pass - - -request_path_pet_id = api_client.PathParameter( - name="petId", - style=api_client.ParameterStyle.SIMPLE, - schema=PetIdSchema, - required=True, -) - - -@dataclass -class ApiResponseFor400(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_400 = api_client.OpenApiResponse( - response_cls=ApiResponseFor400, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _delete_pet_oapg( - self, - header_params: RequestHeaderParams = frozendict.frozendict(), - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> api_client.ApiResponseWithoutDeserialization: ... - @typing.overload - def _delete_pet_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - header_params: RequestHeaderParams = frozendict.frozendict(), - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _delete_pet_oapg( - self, - header_params: RequestHeaderParams = frozendict.frozendict(), - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _delete_pet_oapg( - self, - header_params: RequestHeaderParams = frozendict.frozendict(), - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - Deletes a pet - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - self._verify_typed_dict_inputs_oapg(RequestHeaderParams, header_params) - self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) - used_path = path.value - - _path_params = {} - for parameter in ( - request_path_pet_id, - ): - parameter_data = path_params.get(parameter.name, schemas.unset) - if parameter_data is schemas.unset: - continue - serialized_data = parameter.serialize(parameter_data) - _path_params.update(serialized_data) - - for k, v in _path_params.items(): - used_path = used_path.replace('{%s}' % k, v) - - _headers = HTTPHeaderDict() - for parameter in ( - request_header_api_key, - ): - parameter_data = header_params.get(parameter.name, schemas.unset) - if parameter_data is schemas.unset: - continue - serialized_data = parameter.serialize(parameter_data) - _headers.extend(serialized_data) - # TODO add cookie handling - - response = self.api_client.call_api( - resource_path=used_path, - method='delete'.upper(), - headers=_headers, - auth_settings=_auth, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class DeletePet(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def delete_pet( - self, - header_params: RequestHeaderParams = frozendict.frozendict(), - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> api_client.ApiResponseWithoutDeserialization: ... - @typing.overload - def delete_pet( - self, - skip_deserialization: typing_extensions.Literal[True], - header_params: RequestHeaderParams = frozendict.frozendict(), - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def delete_pet( - self, - header_params: RequestHeaderParams = frozendict.frozendict(), - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def delete_pet( - self, - header_params: RequestHeaderParams = frozendict.frozendict(), - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._delete_pet_oapg( - header_params=header_params, - path_params=path_params, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiFordelete(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def delete( - self, - header_params: RequestHeaderParams = frozendict.frozendict(), - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> api_client.ApiResponseWithoutDeserialization: ... - @typing.overload - def delete( - self, - skip_deserialization: typing_extensions.Literal[True], - header_params: RequestHeaderParams = frozendict.frozendict(), - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def delete( - self, - header_params: RequestHeaderParams = frozendict.frozendict(), - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def delete( - self, - header_params: RequestHeaderParams = frozendict.frozendict(), - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._delete_pet_oapg( - header_params=header_params, - path_params=path_params, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/get.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/get.py deleted file mode 100644 index f7816a024e4..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/get.py +++ /dev/null @@ -1,328 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.pet import Pet - -from . import path - -# Path params -PetIdSchema = schemas.Int64Schema -RequestRequiredPathParams = typing_extensions.TypedDict( - 'RequestRequiredPathParams', - { - 'petId': typing.Union[PetIdSchema, decimal.Decimal, int, ], - } -) -RequestOptionalPathParams = typing_extensions.TypedDict( - 'RequestOptionalPathParams', - { - }, - total=False -) - - -class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): - pass - - -request_path_pet_id = api_client.PathParameter( - name="petId", - style=api_client.ParameterStyle.SIMPLE, - schema=PetIdSchema, - required=True, -) -_auth = [ - 'api_key', -] -SchemaFor200ResponseBodyApplicationXml = Pet -SchemaFor200ResponseBodyApplicationJson = Pet - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationXml, - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/xml': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationXml), - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) - - -@dataclass -class ApiResponseFor400(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_400 = api_client.OpenApiResponse( - response_cls=ApiResponseFor400, -) - - -@dataclass -class ApiResponseFor404(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_404 = api_client.OpenApiResponse( - response_cls=ApiResponseFor404, -) -_status_code_to_response = { - '200': _response_for_200, - '400': _response_for_400, - '404': _response_for_404, -} -_all_accept_content_types = ( - 'application/xml', - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _get_pet_by_id_oapg( - self, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _get_pet_by_id_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _get_pet_by_id_oapg( - self, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _get_pet_by_id_oapg( - self, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - Find pet by ID - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) - used_path = path.value - - _path_params = {} - for parameter in ( - request_path_pet_id, - ): - parameter_data = path_params.get(parameter.name, schemas.unset) - if parameter_data is schemas.unset: - continue - serialized_data = parameter.serialize(parameter_data) - _path_params.update(serialized_data) - - for k, v in _path_params.items(): - used_path = used_path.replace('{%s}' % k, v) - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='get'.upper(), - headers=_headers, - auth_settings=_auth, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class GetPetById(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def get_pet_by_id( - self, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def get_pet_by_id( - self, - skip_deserialization: typing_extensions.Literal[True], - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def get_pet_by_id( - self, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def get_pet_by_id( - self, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._get_pet_by_id_oapg( - path_params=path_params, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForget(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def get( - self, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def get( - self, - skip_deserialization: typing_extensions.Literal[True], - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def get( - self, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def get( - self, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._get_pet_by_id_oapg( - path_params=path_params, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/get.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/get.pyi deleted file mode 100644 index fedba6a0610..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/get.pyi +++ /dev/null @@ -1,318 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.pet import Pet - -# Path params -PetIdSchema = schemas.Int64Schema -RequestRequiredPathParams = typing_extensions.TypedDict( - 'RequestRequiredPathParams', - { - 'petId': typing.Union[PetIdSchema, decimal.Decimal, int, ], - } -) -RequestOptionalPathParams = typing_extensions.TypedDict( - 'RequestOptionalPathParams', - { - }, - total=False -) - - -class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): - pass - - -request_path_pet_id = api_client.PathParameter( - name="petId", - style=api_client.ParameterStyle.SIMPLE, - schema=PetIdSchema, - required=True, -) -SchemaFor200ResponseBodyApplicationXml = Pet -SchemaFor200ResponseBodyApplicationJson = Pet - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationXml, - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/xml': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationXml), - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) - - -@dataclass -class ApiResponseFor400(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_400 = api_client.OpenApiResponse( - response_cls=ApiResponseFor400, -) - - -@dataclass -class ApiResponseFor404(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_404 = api_client.OpenApiResponse( - response_cls=ApiResponseFor404, -) -_all_accept_content_types = ( - 'application/xml', - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _get_pet_by_id_oapg( - self, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _get_pet_by_id_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _get_pet_by_id_oapg( - self, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _get_pet_by_id_oapg( - self, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - Find pet by ID - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) - used_path = path.value - - _path_params = {} - for parameter in ( - request_path_pet_id, - ): - parameter_data = path_params.get(parameter.name, schemas.unset) - if parameter_data is schemas.unset: - continue - serialized_data = parameter.serialize(parameter_data) - _path_params.update(serialized_data) - - for k, v in _path_params.items(): - used_path = used_path.replace('{%s}' % k, v) - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='get'.upper(), - headers=_headers, - auth_settings=_auth, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class GetPetById(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def get_pet_by_id( - self, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def get_pet_by_id( - self, - skip_deserialization: typing_extensions.Literal[True], - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def get_pet_by_id( - self, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def get_pet_by_id( - self, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._get_pet_by_id_oapg( - path_params=path_params, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForget(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def get( - self, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def get( - self, - skip_deserialization: typing_extensions.Literal[True], - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def get( - self, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def get( - self, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._get_pet_by_id_oapg( - path_params=path_params, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/post.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/post.py deleted file mode 100644 index 4e13d8387ea..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/post.py +++ /dev/null @@ -1,397 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from . import path - -# Path params -PetIdSchema = schemas.Int64Schema -RequestRequiredPathParams = typing_extensions.TypedDict( - 'RequestRequiredPathParams', - { - 'petId': typing.Union[PetIdSchema, decimal.Decimal, int, ], - } -) -RequestOptionalPathParams = typing_extensions.TypedDict( - 'RequestOptionalPathParams', - { - }, - total=False -) - - -class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): - pass - - -request_path_pet_id = api_client.PathParameter( - name="petId", - style=api_client.ParameterStyle.SIMPLE, - schema=PetIdSchema, - required=True, -) -# body param - - -class SchemaForRequestBodyApplicationXWwwFormUrlencoded( - schemas.DictSchema -): - - - class MetaOapg: - - class properties: - name = schemas.StrSchema - status = schemas.StrSchema - __annotations__ = { - "name": name, - "status": status, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["status"]) -> MetaOapg.properties.status: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["name", "status", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["name"]) -> typing.Union[MetaOapg.properties.name, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["status"]) -> typing.Union[MetaOapg.properties.status, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["name", "status", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - name: typing.Union[MetaOapg.properties.name, str, schemas.Unset] = schemas.unset, - status: typing.Union[MetaOapg.properties.status, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaForRequestBodyApplicationXWwwFormUrlencoded': - return super().__new__( - cls, - *_args, - name=name, - status=status, - _configuration=_configuration, - **kwargs, - ) - - -request_body_body = api_client.RequestBody( - content={ - 'application/x-www-form-urlencoded': api_client.MediaType( - schema=SchemaForRequestBodyApplicationXWwwFormUrlencoded), - }, -) -_auth = [ - 'petstore_auth', -] - - -@dataclass -class ApiResponseFor405(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_405 = api_client.OpenApiResponse( - response_cls=ApiResponseFor405, -) -_status_code_to_response = { - '405': _response_for_405, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _update_pet_with_form_oapg( - self, - content_type: typing_extensions.Literal["application/x-www-form-urlencoded"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> api_client.ApiResponseWithoutDeserialization: ... - @typing.overload - def _update_pet_with_form_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _update_pet_with_form_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _update_pet_with_form_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _update_pet_with_form_oapg( - self, - content_type: str = 'application/x-www-form-urlencoded', - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - Updates a pet in the store with form data - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) - used_path = path.value - - _path_params = {} - for parameter in ( - request_path_pet_id, - ): - parameter_data = path_params.get(parameter.name, schemas.unset) - if parameter_data is schemas.unset: - continue - serialized_data = parameter.serialize(parameter_data) - _path_params.update(serialized_data) - - for k, v in _path_params.items(): - used_path = used_path.replace('{%s}' % k, v) - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - _fields = None - _body = None - if body is not schemas.unset: - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - auth_settings=_auth, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class UpdatePetWithForm(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def update_pet_with_form( - self, - content_type: typing_extensions.Literal["application/x-www-form-urlencoded"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> api_client.ApiResponseWithoutDeserialization: ... - @typing.overload - def update_pet_with_form( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def update_pet_with_form( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def update_pet_with_form( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def update_pet_with_form( - self, - content_type: str = 'application/x-www-form-urlencoded', - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._update_pet_with_form_oapg( - body=body, - path_params=path_params, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - content_type: typing_extensions.Literal["application/x-www-form-urlencoded"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> api_client.ApiResponseWithoutDeserialization: ... - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - content_type: str = 'application/x-www-form-urlencoded', - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._update_pet_with_form_oapg( - body=body, - path_params=path_params, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/post.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/post.pyi deleted file mode 100644 index 5cbb4082d29..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/post.pyi +++ /dev/null @@ -1,389 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -# Path params -PetIdSchema = schemas.Int64Schema -RequestRequiredPathParams = typing_extensions.TypedDict( - 'RequestRequiredPathParams', - { - 'petId': typing.Union[PetIdSchema, decimal.Decimal, int, ], - } -) -RequestOptionalPathParams = typing_extensions.TypedDict( - 'RequestOptionalPathParams', - { - }, - total=False -) - - -class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): - pass - - -request_path_pet_id = api_client.PathParameter( - name="petId", - style=api_client.ParameterStyle.SIMPLE, - schema=PetIdSchema, - required=True, -) -# body param - - -class SchemaForRequestBodyApplicationXWwwFormUrlencoded( - schemas.DictSchema -): - - - class MetaOapg: - - class properties: - name = schemas.StrSchema - status = schemas.StrSchema - __annotations__ = { - "name": name, - "status": status, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["status"]) -> MetaOapg.properties.status: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["name", "status", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["name"]) -> typing.Union[MetaOapg.properties.name, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["status"]) -> typing.Union[MetaOapg.properties.status, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["name", "status", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - name: typing.Union[MetaOapg.properties.name, str, schemas.Unset] = schemas.unset, - status: typing.Union[MetaOapg.properties.status, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaForRequestBodyApplicationXWwwFormUrlencoded': - return super().__new__( - cls, - *_args, - name=name, - status=status, - _configuration=_configuration, - **kwargs, - ) - - -request_body_body = api_client.RequestBody( - content={ - 'application/x-www-form-urlencoded': api_client.MediaType( - schema=SchemaForRequestBodyApplicationXWwwFormUrlencoded), - }, -) - - -@dataclass -class ApiResponseFor405(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_405 = api_client.OpenApiResponse( - response_cls=ApiResponseFor405, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _update_pet_with_form_oapg( - self, - content_type: typing_extensions.Literal["application/x-www-form-urlencoded"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> api_client.ApiResponseWithoutDeserialization: ... - @typing.overload - def _update_pet_with_form_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _update_pet_with_form_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _update_pet_with_form_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _update_pet_with_form_oapg( - self, - content_type: str = 'application/x-www-form-urlencoded', - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - Updates a pet in the store with form data - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) - used_path = path.value - - _path_params = {} - for parameter in ( - request_path_pet_id, - ): - parameter_data = path_params.get(parameter.name, schemas.unset) - if parameter_data is schemas.unset: - continue - serialized_data = parameter.serialize(parameter_data) - _path_params.update(serialized_data) - - for k, v in _path_params.items(): - used_path = used_path.replace('{%s}' % k, v) - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - _fields = None - _body = None - if body is not schemas.unset: - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - auth_settings=_auth, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class UpdatePetWithForm(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def update_pet_with_form( - self, - content_type: typing_extensions.Literal["application/x-www-form-urlencoded"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> api_client.ApiResponseWithoutDeserialization: ... - @typing.overload - def update_pet_with_form( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def update_pet_with_form( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def update_pet_with_form( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def update_pet_with_form( - self, - content_type: str = 'application/x-www-form-urlencoded', - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._update_pet_with_form_oapg( - body=body, - path_params=path_params, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - content_type: typing_extensions.Literal["application/x-www-form-urlencoded"] = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> api_client.ApiResponseWithoutDeserialization: ... - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - content_type: str = 'application/x-www-form-urlencoded', - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._update_pet_with_form_oapg( - body=body, - path_params=path_params, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id_upload_image/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id_upload_image/__init__.py deleted file mode 100644 index 6af43e84e11..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id_upload_image/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from petstore_api.paths.pet_pet_id_upload_image import Api - -from petstore_api.paths import PathValues - -path = PathValues.PET_PET_ID_UPLOAD_IMAGE \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id_upload_image/post.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id_upload_image/post.py deleted file mode 100644 index 967a3f1cfc5..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id_upload_image/post.py +++ /dev/null @@ -1,450 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.api_response import ApiResponse - -from . import path - -# Path params -PetIdSchema = schemas.Int64Schema -RequestRequiredPathParams = typing_extensions.TypedDict( - 'RequestRequiredPathParams', - { - 'petId': typing.Union[PetIdSchema, decimal.Decimal, int, ], - } -) -RequestOptionalPathParams = typing_extensions.TypedDict( - 'RequestOptionalPathParams', - { - }, - total=False -) - - -class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): - pass - - -request_path_pet_id = api_client.PathParameter( - name="petId", - style=api_client.ParameterStyle.SIMPLE, - schema=PetIdSchema, - required=True, -) -# body param - - -class SchemaForRequestBodyMultipartFormData( - schemas.DictSchema -): - - - class MetaOapg: - - class properties: - additionalMetadata = schemas.StrSchema - file = schemas.BinarySchema - __annotations__ = { - "additionalMetadata": additionalMetadata, - "file": file, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["additionalMetadata"]) -> MetaOapg.properties.additionalMetadata: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["file"]) -> MetaOapg.properties.file: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["additionalMetadata", "file", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["additionalMetadata"]) -> typing.Union[MetaOapg.properties.additionalMetadata, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["file"]) -> typing.Union[MetaOapg.properties.file, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["additionalMetadata", "file", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - additionalMetadata: typing.Union[MetaOapg.properties.additionalMetadata, str, schemas.Unset] = schemas.unset, - file: typing.Union[MetaOapg.properties.file, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaForRequestBodyMultipartFormData': - return super().__new__( - cls, - *_args, - additionalMetadata=additionalMetadata, - file=file, - _configuration=_configuration, - **kwargs, - ) - - -request_body_body = api_client.RequestBody( - content={ - 'multipart/form-data': api_client.MediaType( - schema=SchemaForRequestBodyMultipartFormData), - }, -) -_auth = [ - 'petstore_auth', -] -SchemaFor200ResponseBodyApplicationJson = ApiResponse - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _upload_image_oapg( - self, - content_type: typing_extensions.Literal["multipart/form-data"] = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _upload_image_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _upload_image_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _upload_image_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _upload_image_oapg( - self, - content_type: str = 'multipart/form-data', - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - uploads an image - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) - used_path = path.value - - _path_params = {} - for parameter in ( - request_path_pet_id, - ): - parameter_data = path_params.get(parameter.name, schemas.unset) - if parameter_data is schemas.unset: - continue - serialized_data = parameter.serialize(parameter_data) - _path_params.update(serialized_data) - - for k, v in _path_params.items(): - used_path = used_path.replace('{%s}' % k, v) - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - _fields = None - _body = None - if body is not schemas.unset: - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - auth_settings=_auth, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class UploadImage(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def upload_image( - self, - content_type: typing_extensions.Literal["multipart/form-data"] = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def upload_image( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def upload_image( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def upload_image( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def upload_image( - self, - content_type: str = 'multipart/form-data', - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._upload_image_oapg( - body=body, - path_params=path_params, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - content_type: typing_extensions.Literal["multipart/form-data"] = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - content_type: str = 'multipart/form-data', - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._upload_image_oapg( - body=body, - path_params=path_params, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id_upload_image/post.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id_upload_image/post.pyi deleted file mode 100644 index c6e9baa0d0a..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id_upload_image/post.pyi +++ /dev/null @@ -1,442 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.api_response import ApiResponse - -# Path params -PetIdSchema = schemas.Int64Schema -RequestRequiredPathParams = typing_extensions.TypedDict( - 'RequestRequiredPathParams', - { - 'petId': typing.Union[PetIdSchema, decimal.Decimal, int, ], - } -) -RequestOptionalPathParams = typing_extensions.TypedDict( - 'RequestOptionalPathParams', - { - }, - total=False -) - - -class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): - pass - - -request_path_pet_id = api_client.PathParameter( - name="petId", - style=api_client.ParameterStyle.SIMPLE, - schema=PetIdSchema, - required=True, -) -# body param - - -class SchemaForRequestBodyMultipartFormData( - schemas.DictSchema -): - - - class MetaOapg: - - class properties: - additionalMetadata = schemas.StrSchema - file = schemas.BinarySchema - __annotations__ = { - "additionalMetadata": additionalMetadata, - "file": file, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["additionalMetadata"]) -> MetaOapg.properties.additionalMetadata: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["file"]) -> MetaOapg.properties.file: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["additionalMetadata", "file", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["additionalMetadata"]) -> typing.Union[MetaOapg.properties.additionalMetadata, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["file"]) -> typing.Union[MetaOapg.properties.file, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["additionalMetadata", "file", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - additionalMetadata: typing.Union[MetaOapg.properties.additionalMetadata, str, schemas.Unset] = schemas.unset, - file: typing.Union[MetaOapg.properties.file, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SchemaForRequestBodyMultipartFormData': - return super().__new__( - cls, - *_args, - additionalMetadata=additionalMetadata, - file=file, - _configuration=_configuration, - **kwargs, - ) - - -request_body_body = api_client.RequestBody( - content={ - 'multipart/form-data': api_client.MediaType( - schema=SchemaForRequestBodyMultipartFormData), - }, -) -SchemaFor200ResponseBodyApplicationJson = ApiResponse - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _upload_image_oapg( - self, - content_type: typing_extensions.Literal["multipart/form-data"] = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _upload_image_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _upload_image_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _upload_image_oapg( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _upload_image_oapg( - self, - content_type: str = 'multipart/form-data', - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - uploads an image - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) - used_path = path.value - - _path_params = {} - for parameter in ( - request_path_pet_id, - ): - parameter_data = path_params.get(parameter.name, schemas.unset) - if parameter_data is schemas.unset: - continue - serialized_data = parameter.serialize(parameter_data) - _path_params.update(serialized_data) - - for k, v in _path_params.items(): - used_path = used_path.replace('{%s}' % k, v) - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - _fields = None - _body = None - if body is not schemas.unset: - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - auth_settings=_auth, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class UploadImage(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def upload_image( - self, - content_type: typing_extensions.Literal["multipart/form-data"] = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def upload_image( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def upload_image( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def upload_image( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def upload_image( - self, - content_type: str = 'multipart/form-data', - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._upload_image_oapg( - body=body, - path_params=path_params, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - content_type: typing_extensions.Literal["multipart/form-data"] = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - content_type: str = ..., - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - content_type: str = 'multipart/form-data', - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._upload_image_oapg( - body=body, - path_params=path_params, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/store_inventory/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/store_inventory/__init__.py deleted file mode 100644 index 265c07e7bbb..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/store_inventory/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from petstore_api.paths.store_inventory import Api - -from petstore_api.paths import PathValues - -path = PathValues.STORE_INVENTORY \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/store_inventory/get.py b/samples/openapi3/client/petstore/python/petstore_api/paths/store_inventory/get.py deleted file mode 100644 index 6d9149b1d91..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/store_inventory/get.py +++ /dev/null @@ -1,269 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from . import path - -_auth = [ - 'api_key', -] - - -class SchemaFor200ResponseBodyApplicationJson( - schemas.DictSchema -): - - - class MetaOapg: - additional_properties = schemas.Int32Schema - - def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, decimal.Decimal, int, ], - ) -> 'SchemaFor200ResponseBodyApplicationJson': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _get_inventory_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _get_inventory_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _get_inventory_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _get_inventory_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - Returns pet inventories by status - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='get'.upper(), - headers=_headers, - auth_settings=_auth, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class GetInventory(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def get_inventory( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def get_inventory( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def get_inventory( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def get_inventory( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._get_inventory_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForget(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def get( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def get( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def get( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def get( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._get_inventory_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/store_inventory/get.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/store_inventory/get.pyi deleted file mode 100644 index ec2b0fd1499..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/store_inventory/get.pyi +++ /dev/null @@ -1,261 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - - -class SchemaFor200ResponseBodyApplicationJson( - schemas.DictSchema -): - - - class MetaOapg: - additional_properties = schemas.Int32Schema - - def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - return super().get_item_oapg(name) - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, decimal.Decimal, int, ], - ) -> 'SchemaFor200ResponseBodyApplicationJson': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - **kwargs, - ) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _get_inventory_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _get_inventory_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _get_inventory_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _get_inventory_oapg( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - Returns pet inventories by status - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='get'.upper(), - headers=_headers, - auth_settings=_auth, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class GetInventory(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def get_inventory( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def get_inventory( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def get_inventory( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def get_inventory( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._get_inventory_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForget(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def get( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def get( - self, - skip_deserialization: typing_extensions.Literal[True], - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def get( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def get( - self, - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._get_inventory_oapg( - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order/__init__.py deleted file mode 100644 index 2cefcb1299a..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from petstore_api.paths.store_order import Api - -from petstore_api.paths import PathValues - -path = PathValues.STORE_ORDER \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order/post.py b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order/post.py deleted file mode 100644 index d0b0ddb2402..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order/post.py +++ /dev/null @@ -1,351 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.order import Order - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = Order - - -request_body_order = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) -SchemaFor200ResponseBodyApplicationXml = Order -SchemaFor200ResponseBodyApplicationJson = Order - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationXml, - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/xml': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationXml), - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) - - -@dataclass -class ApiResponseFor400(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_400 = api_client.OpenApiResponse( - response_cls=ApiResponseFor400, -) -_status_code_to_response = { - '200': _response_for_200, - '400': _response_for_400, -} -_all_accept_content_types = ( - 'application/xml', - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _place_order_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _place_order_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _place_order_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _place_order_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _place_order_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - Place an order for a pet - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_order.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PlaceOrder(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def place_order( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def place_order( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def place_order( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def place_order( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def place_order( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._place_order_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._place_order_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order/post.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order/post.pyi deleted file mode 100644 index 14f03216c35..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order/post.pyi +++ /dev/null @@ -1,345 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.order import Order - -# body param -SchemaForRequestBodyApplicationJson = Order - - -request_body_order = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) -SchemaFor200ResponseBodyApplicationXml = Order -SchemaFor200ResponseBodyApplicationJson = Order - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationXml, - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/xml': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationXml), - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) - - -@dataclass -class ApiResponseFor400(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_400 = api_client.OpenApiResponse( - response_cls=ApiResponseFor400, -) -_all_accept_content_types = ( - 'application/xml', - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _place_order_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _place_order_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def _place_order_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _place_order_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _place_order_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - Place an order for a pet - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_order.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class PlaceOrder(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def place_order( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def place_order( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def place_order( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def place_order( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def place_order( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._place_order_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._place_order_oapg( - body=body, - content_type=content_type, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/__init__.py deleted file mode 100644 index 435dc451244..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from petstore_api.paths.store_order_order_id import Api - -from petstore_api.paths import PathValues - -path = PathValues.STORE_ORDER_ORDER_ID \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/delete.py b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/delete.py deleted file mode 100644 index 945e984557a..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/delete.py +++ /dev/null @@ -1,261 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from . import path - -# Path params -OrderIdSchema = schemas.StrSchema -RequestRequiredPathParams = typing_extensions.TypedDict( - 'RequestRequiredPathParams', - { - 'order_id': typing.Union[OrderIdSchema, str, ], - } -) -RequestOptionalPathParams = typing_extensions.TypedDict( - 'RequestOptionalPathParams', - { - }, - total=False -) - - -class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): - pass - - -request_path_order_id = api_client.PathParameter( - name="order_id", - style=api_client.ParameterStyle.SIMPLE, - schema=OrderIdSchema, - required=True, -) - - -@dataclass -class ApiResponseFor400(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_400 = api_client.OpenApiResponse( - response_cls=ApiResponseFor400, -) - - -@dataclass -class ApiResponseFor404(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_404 = api_client.OpenApiResponse( - response_cls=ApiResponseFor404, -) -_status_code_to_response = { - '400': _response_for_400, - '404': _response_for_404, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _delete_order_oapg( - self, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> api_client.ApiResponseWithoutDeserialization: ... - @typing.overload - def _delete_order_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _delete_order_oapg( - self, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _delete_order_oapg( - self, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - Delete purchase order by ID - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) - used_path = path.value - - _path_params = {} - for parameter in ( - request_path_order_id, - ): - parameter_data = path_params.get(parameter.name, schemas.unset) - if parameter_data is schemas.unset: - continue - serialized_data = parameter.serialize(parameter_data) - _path_params.update(serialized_data) - - for k, v in _path_params.items(): - used_path = used_path.replace('{%s}' % k, v) - # TODO add cookie handling - - response = self.api_client.call_api( - resource_path=used_path, - method='delete'.upper(), - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class DeleteOrder(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def delete_order( - self, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> api_client.ApiResponseWithoutDeserialization: ... - @typing.overload - def delete_order( - self, - skip_deserialization: typing_extensions.Literal[True], - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def delete_order( - self, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def delete_order( - self, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._delete_order_oapg( - path_params=path_params, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiFordelete(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def delete( - self, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> api_client.ApiResponseWithoutDeserialization: ... - @typing.overload - def delete( - self, - skip_deserialization: typing_extensions.Literal[True], - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def delete( - self, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def delete( - self, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._delete_order_oapg( - path_params=path_params, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/delete.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/delete.pyi deleted file mode 100644 index 12d3d0a1e28..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/delete.pyi +++ /dev/null @@ -1,255 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -# Path params -OrderIdSchema = schemas.StrSchema -RequestRequiredPathParams = typing_extensions.TypedDict( - 'RequestRequiredPathParams', - { - 'order_id': typing.Union[OrderIdSchema, str, ], - } -) -RequestOptionalPathParams = typing_extensions.TypedDict( - 'RequestOptionalPathParams', - { - }, - total=False -) - - -class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): - pass - - -request_path_order_id = api_client.PathParameter( - name="order_id", - style=api_client.ParameterStyle.SIMPLE, - schema=OrderIdSchema, - required=True, -) - - -@dataclass -class ApiResponseFor400(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_400 = api_client.OpenApiResponse( - response_cls=ApiResponseFor400, -) - - -@dataclass -class ApiResponseFor404(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_404 = api_client.OpenApiResponse( - response_cls=ApiResponseFor404, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _delete_order_oapg( - self, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> api_client.ApiResponseWithoutDeserialization: ... - @typing.overload - def _delete_order_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _delete_order_oapg( - self, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _delete_order_oapg( - self, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - Delete purchase order by ID - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) - used_path = path.value - - _path_params = {} - for parameter in ( - request_path_order_id, - ): - parameter_data = path_params.get(parameter.name, schemas.unset) - if parameter_data is schemas.unset: - continue - serialized_data = parameter.serialize(parameter_data) - _path_params.update(serialized_data) - - for k, v in _path_params.items(): - used_path = used_path.replace('{%s}' % k, v) - # TODO add cookie handling - - response = self.api_client.call_api( - resource_path=used_path, - method='delete'.upper(), - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class DeleteOrder(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def delete_order( - self, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> api_client.ApiResponseWithoutDeserialization: ... - @typing.overload - def delete_order( - self, - skip_deserialization: typing_extensions.Literal[True], - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def delete_order( - self, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def delete_order( - self, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._delete_order_oapg( - path_params=path_params, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiFordelete(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def delete( - self, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> api_client.ApiResponseWithoutDeserialization: ... - @typing.overload - def delete( - self, - skip_deserialization: typing_extensions.Literal[True], - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def delete( - self, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def delete( - self, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._delete_order_oapg( - path_params=path_params, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/get.py b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/get.py deleted file mode 100644 index 72396c7aac1..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/get.py +++ /dev/null @@ -1,334 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.order import Order - -from . import path - -# Path params - - -class OrderIdSchema( - schemas.Int64Schema -): - - - class MetaOapg: - format = 'int64' - inclusive_maximum = 5 - inclusive_minimum = 1 -RequestRequiredPathParams = typing_extensions.TypedDict( - 'RequestRequiredPathParams', - { - 'order_id': typing.Union[OrderIdSchema, decimal.Decimal, int, ], - } -) -RequestOptionalPathParams = typing_extensions.TypedDict( - 'RequestOptionalPathParams', - { - }, - total=False -) - - -class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): - pass - - -request_path_order_id = api_client.PathParameter( - name="order_id", - style=api_client.ParameterStyle.SIMPLE, - schema=OrderIdSchema, - required=True, -) -SchemaFor200ResponseBodyApplicationXml = Order -SchemaFor200ResponseBodyApplicationJson = Order - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationXml, - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/xml': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationXml), - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) - - -@dataclass -class ApiResponseFor400(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_400 = api_client.OpenApiResponse( - response_cls=ApiResponseFor400, -) - - -@dataclass -class ApiResponseFor404(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_404 = api_client.OpenApiResponse( - response_cls=ApiResponseFor404, -) -_status_code_to_response = { - '200': _response_for_200, - '400': _response_for_400, - '404': _response_for_404, -} -_all_accept_content_types = ( - 'application/xml', - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _get_order_by_id_oapg( - self, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _get_order_by_id_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _get_order_by_id_oapg( - self, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _get_order_by_id_oapg( - self, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - Find purchase order by ID - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) - used_path = path.value - - _path_params = {} - for parameter in ( - request_path_order_id, - ): - parameter_data = path_params.get(parameter.name, schemas.unset) - if parameter_data is schemas.unset: - continue - serialized_data = parameter.serialize(parameter_data) - _path_params.update(serialized_data) - - for k, v in _path_params.items(): - used_path = used_path.replace('{%s}' % k, v) - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='get'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class GetOrderById(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def get_order_by_id( - self, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def get_order_by_id( - self, - skip_deserialization: typing_extensions.Literal[True], - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def get_order_by_id( - self, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def get_order_by_id( - self, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._get_order_by_id_oapg( - path_params=path_params, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForget(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def get( - self, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def get( - self, - skip_deserialization: typing_extensions.Literal[True], - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def get( - self, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def get( - self, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._get_order_by_id_oapg( - path_params=path_params, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/get.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/get.pyi deleted file mode 100644 index 9a9a783a7bd..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/get.pyi +++ /dev/null @@ -1,322 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.order import Order - -# Path params - - -class OrderIdSchema( - schemas.Int64Schema -): - pass -RequestRequiredPathParams = typing_extensions.TypedDict( - 'RequestRequiredPathParams', - { - 'order_id': typing.Union[OrderIdSchema, decimal.Decimal, int, ], - } -) -RequestOptionalPathParams = typing_extensions.TypedDict( - 'RequestOptionalPathParams', - { - }, - total=False -) - - -class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): - pass - - -request_path_order_id = api_client.PathParameter( - name="order_id", - style=api_client.ParameterStyle.SIMPLE, - schema=OrderIdSchema, - required=True, -) -SchemaFor200ResponseBodyApplicationXml = Order -SchemaFor200ResponseBodyApplicationJson = Order - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationXml, - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/xml': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationXml), - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) - - -@dataclass -class ApiResponseFor400(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_400 = api_client.OpenApiResponse( - response_cls=ApiResponseFor400, -) - - -@dataclass -class ApiResponseFor404(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_404 = api_client.OpenApiResponse( - response_cls=ApiResponseFor404, -) -_all_accept_content_types = ( - 'application/xml', - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _get_order_by_id_oapg( - self, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _get_order_by_id_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _get_order_by_id_oapg( - self, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _get_order_by_id_oapg( - self, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - Find purchase order by ID - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) - used_path = path.value - - _path_params = {} - for parameter in ( - request_path_order_id, - ): - parameter_data = path_params.get(parameter.name, schemas.unset) - if parameter_data is schemas.unset: - continue - serialized_data = parameter.serialize(parameter_data) - _path_params.update(serialized_data) - - for k, v in _path_params.items(): - used_path = used_path.replace('{%s}' % k, v) - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='get'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class GetOrderById(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def get_order_by_id( - self, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def get_order_by_id( - self, - skip_deserialization: typing_extensions.Literal[True], - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def get_order_by_id( - self, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def get_order_by_id( - self, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._get_order_by_id_oapg( - path_params=path_params, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForget(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def get( - self, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def get( - self, - skip_deserialization: typing_extensions.Literal[True], - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def get( - self, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def get( - self, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._get_order_by_id_oapg( - path_params=path_params, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user/__init__.py deleted file mode 100644 index 9cb59c35fb2..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from petstore_api.paths.user import Api - -from petstore_api.paths import PathValues - -path = PathValues.USER \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user/post.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user/post.py deleted file mode 100644 index 185849c735f..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user/post.py +++ /dev/null @@ -1,307 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.user import User - -from . import path - -# body param -SchemaForRequestBodyApplicationJson = User - - -request_body_user = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseForDefault(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_default = api_client.OpenApiResponse( - response_cls=ApiResponseForDefault, -) -_status_code_to_response = { - 'default': _response_for_default, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _create_user_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseForDefault, - ]: ... - - @typing.overload - def _create_user_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseForDefault, - ]: ... - - - @typing.overload - def _create_user_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _create_user_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseForDefault, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _create_user_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - Create user - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_user.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - default_response = _status_code_to_response.get('default') - if default_response: - api_response = default_response.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class CreateUser(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def create_user( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseForDefault, - ]: ... - - @typing.overload - def create_user( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseForDefault, - ]: ... - - - @typing.overload - def create_user( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def create_user( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseForDefault, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def create_user( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._create_user_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseForDefault, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseForDefault, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseForDefault, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._create_user_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user/post.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/user/post.pyi deleted file mode 100644 index d0bae910206..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user/post.pyi +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.user import User - -# body param -SchemaForRequestBodyApplicationJson = User - - -request_body_user = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseForDefault(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_default = api_client.OpenApiResponse( - response_cls=ApiResponseForDefault, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _create_user_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseForDefault, - ]: ... - - @typing.overload - def _create_user_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseForDefault, - ]: ... - - - @typing.overload - def _create_user_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _create_user_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseForDefault, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _create_user_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - Create user - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_user.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - default_response = _status_code_to_response.get('default') - if default_response: - api_response = default_response.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class CreateUser(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def create_user( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseForDefault, - ]: ... - - @typing.overload - def create_user( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseForDefault, - ]: ... - - - @typing.overload - def create_user( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def create_user( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseForDefault, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def create_user( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._create_user_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseForDefault, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseForDefault, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseForDefault, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._create_user_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_array/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_array/__init__.py deleted file mode 100644 index 984db1ea2bb..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_array/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from petstore_api.paths.user_create_with_array import Api - -from petstore_api.paths import PathValues - -path = PathValues.USER_CREATE_WITH_ARRAY \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_array/post.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_array/post.py deleted file mode 100644 index ac14f66afff..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_array/post.py +++ /dev/null @@ -1,332 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.user import User - -from . import path - -# body param - - -class SchemaForRequestBodyApplicationJson( - schemas.ListSchema -): - - - class MetaOapg: - - @staticmethod - def items() -> typing.Type['User']: - return User - - def __new__( - cls, - _arg: typing.Union[typing.Tuple['User'], typing.List['User']], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'SchemaForRequestBodyApplicationJson': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> 'User': - return super().__getitem__(i) - - -request_body_user = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseForDefault(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_default = api_client.OpenApiResponse( - response_cls=ApiResponseForDefault, -) -_status_code_to_response = { - 'default': _response_for_default, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _create_users_with_array_input_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,list, tuple, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseForDefault, - ]: ... - - @typing.overload - def _create_users_with_array_input_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,list, tuple, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseForDefault, - ]: ... - - - @typing.overload - def _create_users_with_array_input_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,list, tuple, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _create_users_with_array_input_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,list, tuple, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseForDefault, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _create_users_with_array_input_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,list, tuple, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - Creates list of users with given input array - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_user.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - default_response = _status_code_to_response.get('default') - if default_response: - api_response = default_response.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class CreateUsersWithArrayInput(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def create_users_with_array_input( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,list, tuple, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseForDefault, - ]: ... - - @typing.overload - def create_users_with_array_input( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,list, tuple, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseForDefault, - ]: ... - - - @typing.overload - def create_users_with_array_input( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,list, tuple, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def create_users_with_array_input( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,list, tuple, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseForDefault, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def create_users_with_array_input( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,list, tuple, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._create_users_with_array_input_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,list, tuple, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseForDefault, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,list, tuple, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseForDefault, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,list, tuple, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,list, tuple, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseForDefault, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,list, tuple, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._create_users_with_array_input_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_array/post.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_array/post.pyi deleted file mode 100644 index 0b6b0a59f76..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_array/post.pyi +++ /dev/null @@ -1,327 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.user import User - -# body param - - -class SchemaForRequestBodyApplicationJson( - schemas.ListSchema -): - - - class MetaOapg: - - @staticmethod - def items() -> typing.Type['User']: - return User - - def __new__( - cls, - _arg: typing.Union[typing.Tuple['User'], typing.List['User']], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'SchemaForRequestBodyApplicationJson': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> 'User': - return super().__getitem__(i) - - -request_body_user = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseForDefault(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_default = api_client.OpenApiResponse( - response_cls=ApiResponseForDefault, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _create_users_with_array_input_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,list, tuple, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseForDefault, - ]: ... - - @typing.overload - def _create_users_with_array_input_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,list, tuple, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseForDefault, - ]: ... - - - @typing.overload - def _create_users_with_array_input_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,list, tuple, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _create_users_with_array_input_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,list, tuple, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseForDefault, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _create_users_with_array_input_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,list, tuple, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - Creates list of users with given input array - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_user.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - default_response = _status_code_to_response.get('default') - if default_response: - api_response = default_response.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class CreateUsersWithArrayInput(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def create_users_with_array_input( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,list, tuple, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseForDefault, - ]: ... - - @typing.overload - def create_users_with_array_input( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,list, tuple, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseForDefault, - ]: ... - - - @typing.overload - def create_users_with_array_input( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,list, tuple, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def create_users_with_array_input( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,list, tuple, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseForDefault, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def create_users_with_array_input( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,list, tuple, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._create_users_with_array_input_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,list, tuple, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseForDefault, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,list, tuple, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseForDefault, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,list, tuple, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,list, tuple, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseForDefault, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,list, tuple, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._create_users_with_array_input_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_list/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_list/__init__.py deleted file mode 100644 index 3930d4bbca5..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_list/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from petstore_api.paths.user_create_with_list import Api - -from petstore_api.paths import PathValues - -path = PathValues.USER_CREATE_WITH_LIST \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_list/post.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_list/post.py deleted file mode 100644 index 948b69eb707..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_list/post.py +++ /dev/null @@ -1,332 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.user import User - -from . import path - -# body param - - -class SchemaForRequestBodyApplicationJson( - schemas.ListSchema -): - - - class MetaOapg: - - @staticmethod - def items() -> typing.Type['User']: - return User - - def __new__( - cls, - _arg: typing.Union[typing.Tuple['User'], typing.List['User']], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'SchemaForRequestBodyApplicationJson': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> 'User': - return super().__getitem__(i) - - -request_body_user = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseForDefault(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_default = api_client.OpenApiResponse( - response_cls=ApiResponseForDefault, -) -_status_code_to_response = { - 'default': _response_for_default, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _create_users_with_list_input_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,list, tuple, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseForDefault, - ]: ... - - @typing.overload - def _create_users_with_list_input_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,list, tuple, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseForDefault, - ]: ... - - - @typing.overload - def _create_users_with_list_input_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,list, tuple, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _create_users_with_list_input_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,list, tuple, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseForDefault, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _create_users_with_list_input_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,list, tuple, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - Creates list of users with given input array - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_user.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - default_response = _status_code_to_response.get('default') - if default_response: - api_response = default_response.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class CreateUsersWithListInput(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def create_users_with_list_input( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,list, tuple, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseForDefault, - ]: ... - - @typing.overload - def create_users_with_list_input( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,list, tuple, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseForDefault, - ]: ... - - - @typing.overload - def create_users_with_list_input( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,list, tuple, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def create_users_with_list_input( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,list, tuple, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseForDefault, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def create_users_with_list_input( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,list, tuple, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._create_users_with_list_input_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,list, tuple, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseForDefault, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,list, tuple, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseForDefault, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,list, tuple, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,list, tuple, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseForDefault, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,list, tuple, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._create_users_with_list_input_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_list/post.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_list/post.pyi deleted file mode 100644 index 56449661bdb..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_list/post.pyi +++ /dev/null @@ -1,327 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.user import User - -# body param - - -class SchemaForRequestBodyApplicationJson( - schemas.ListSchema -): - - - class MetaOapg: - - @staticmethod - def items() -> typing.Type['User']: - return User - - def __new__( - cls, - _arg: typing.Union[typing.Tuple['User'], typing.List['User']], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'SchemaForRequestBodyApplicationJson': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> 'User': - return super().__getitem__(i) - - -request_body_user = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseForDefault(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_default = api_client.OpenApiResponse( - response_cls=ApiResponseForDefault, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _create_users_with_list_input_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,list, tuple, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseForDefault, - ]: ... - - @typing.overload - def _create_users_with_list_input_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,list, tuple, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseForDefault, - ]: ... - - - @typing.overload - def _create_users_with_list_input_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,list, tuple, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _create_users_with_list_input_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,list, tuple, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseForDefault, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _create_users_with_list_input_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,list, tuple, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - Creates list of users with given input array - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_user.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='post'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - default_response = _status_code_to_response.get('default') - if default_response: - api_response = default_response.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class CreateUsersWithListInput(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def create_users_with_list_input( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,list, tuple, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseForDefault, - ]: ... - - @typing.overload - def create_users_with_list_input( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,list, tuple, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseForDefault, - ]: ... - - - @typing.overload - def create_users_with_list_input( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,list, tuple, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def create_users_with_list_input( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,list, tuple, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseForDefault, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def create_users_with_list_input( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,list, tuple, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._create_users_with_list_input_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForpost(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,list, tuple, ], - content_type: typing_extensions.Literal["application/json"] = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseForDefault, - ]: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,list, tuple, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseForDefault, - ]: ... - - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,list, tuple, ], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,list, tuple, ], - content_type: str = ..., - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseForDefault, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def post( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,list, tuple, ], - content_type: str = 'application/json', - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._create_users_with_list_input_oapg( - body=body, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_login/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user_login/__init__.py deleted file mode 100644 index 7dbf363c109..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_login/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from petstore_api.paths.user_login import Api - -from petstore_api.paths import PathValues - -path = PathValues.USER_LOGIN \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_login/get.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user_login/get.py deleted file mode 100644 index 6f7e561cefb..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_login/get.py +++ /dev/null @@ -1,343 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from . import path - -# Query params -UsernameSchema = schemas.StrSchema -PasswordSchema = schemas.StrSchema -RequestRequiredQueryParams = typing_extensions.TypedDict( - 'RequestRequiredQueryParams', - { - 'username': typing.Union[UsernameSchema, str, ], - 'password': typing.Union[PasswordSchema, str, ], - } -) -RequestOptionalQueryParams = typing_extensions.TypedDict( - 'RequestOptionalQueryParams', - { - }, - total=False -) - - -class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): - pass - - -request_query_username = api_client.QueryParameter( - name="username", - style=api_client.ParameterStyle.FORM, - schema=UsernameSchema, - required=True, - explode=True, -) -request_query_password = api_client.QueryParameter( - name="password", - style=api_client.ParameterStyle.FORM, - schema=PasswordSchema, - required=True, - explode=True, -) -XRateLimitSchema = schemas.Int32Schema -x_rate_limit_parameter = api_client.HeaderParameter( - name="X-Rate-Limit", - style=api_client.ParameterStyle.SIMPLE, - schema=XRateLimitSchema, -) -XExpiresAfterSchema = schemas.DateTimeSchema -x_expires_after_parameter = api_client.HeaderParameter( - name="X-Expires-After", - style=api_client.ParameterStyle.SIMPLE, - schema=XExpiresAfterSchema, -) -SchemaFor200ResponseBodyApplicationXml = schemas.StrSchema -SchemaFor200ResponseBodyApplicationJson = schemas.StrSchema -ResponseHeadersFor200 = typing_extensions.TypedDict( - 'ResponseHeadersFor200', - { - 'X-Rate-Limit': XRateLimitSchema, - 'X-Expires-After': XExpiresAfterSchema, - } -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationXml, - SchemaFor200ResponseBodyApplicationJson, - ] - headers: ResponseHeadersFor200 - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/xml': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationXml), - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, - headers=[ - x_rate_limit_parameter, - x_expires_after_parameter, - ] -) - - -@dataclass -class ApiResponseFor400(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_400 = api_client.OpenApiResponse( - response_cls=ApiResponseFor400, -) -_status_code_to_response = { - '200': _response_for_200, - '400': _response_for_400, -} -_all_accept_content_types = ( - 'application/xml', - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _login_user_oapg( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _login_user_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _login_user_oapg( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _login_user_oapg( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - Logs user into the system - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) - used_path = path.value - - prefix_separator_iterator = None - for parameter in ( - request_query_username, - request_query_password, - ): - parameter_data = query_params.get(parameter.name, schemas.unset) - if parameter_data is schemas.unset: - continue - if prefix_separator_iterator is None: - prefix_separator_iterator = parameter.get_prefix_separator_iterator() - serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) - for serialized_value in serialized_data.values(): - used_path += serialized_value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='get'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class LoginUser(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def login_user( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def login_user( - self, - skip_deserialization: typing_extensions.Literal[True], - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def login_user( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def login_user( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._login_user_oapg( - query_params=query_params, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForget(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def get( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def get( - self, - skip_deserialization: typing_extensions.Literal[True], - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def get( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def get( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._login_user_oapg( - query_params=query_params, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_login/get.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/user_login/get.pyi deleted file mode 100644 index a3fcbd6103d..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_login/get.pyi +++ /dev/null @@ -1,327 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -# Query params -UsernameSchema = schemas.StrSchema -PasswordSchema = schemas.StrSchema -RequestRequiredQueryParams = typing_extensions.TypedDict( - 'RequestRequiredQueryParams', - { - 'username': typing.Union[UsernameSchema, str, ], - 'password': typing.Union[PasswordSchema, str, ], - } -) -RequestOptionalQueryParams = typing_extensions.TypedDict( - 'RequestOptionalQueryParams', - { - }, - total=False -) - - -class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): - pass - - -request_query_username = api_client.QueryParameter( - name="username", - style=api_client.ParameterStyle.FORM, - schema=UsernameSchema, - required=True, - explode=True, -) -request_query_password = api_client.QueryParameter( - name="password", - style=api_client.ParameterStyle.FORM, - schema=PasswordSchema, - required=True, - explode=True, -) -XRateLimitSchema = schemas.Int32Schema -XExpiresAfterSchema = schemas.DateTimeSchema -SchemaFor200ResponseBodyApplicationXml = schemas.StrSchema -SchemaFor200ResponseBodyApplicationJson = schemas.StrSchema -ResponseHeadersFor200 = typing_extensions.TypedDict( - 'ResponseHeadersFor200', - { - 'X-Rate-Limit': XRateLimitSchema, - 'X-Expires-After': XExpiresAfterSchema, - } -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationXml, - SchemaFor200ResponseBodyApplicationJson, - ] - headers: ResponseHeadersFor200 - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/xml': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationXml), - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, - headers=[ - x_rate_limit_parameter, - x_expires_after_parameter, - ] -) - - -@dataclass -class ApiResponseFor400(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_400 = api_client.OpenApiResponse( - response_cls=ApiResponseFor400, -) -_all_accept_content_types = ( - 'application/xml', - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _login_user_oapg( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _login_user_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _login_user_oapg( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _login_user_oapg( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - Logs user into the system - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) - used_path = path.value - - prefix_separator_iterator = None - for parameter in ( - request_query_username, - request_query_password, - ): - parameter_data = query_params.get(parameter.name, schemas.unset) - if parameter_data is schemas.unset: - continue - if prefix_separator_iterator is None: - prefix_separator_iterator = parameter.get_prefix_separator_iterator() - serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) - for serialized_value in serialized_data.values(): - used_path += serialized_value - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='get'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class LoginUser(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def login_user( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def login_user( - self, - skip_deserialization: typing_extensions.Literal[True], - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def login_user( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def login_user( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._login_user_oapg( - query_params=query_params, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForget(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def get( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def get( - self, - skip_deserialization: typing_extensions.Literal[True], - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def get( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def get( - self, - query_params: RequestQueryParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._login_user_oapg( - query_params=query_params, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_logout/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user_logout/__init__.py deleted file mode 100644 index 625c23c6d0e..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_logout/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from petstore_api.paths.user_logout import Api - -from petstore_api.paths import PathValues - -path = PathValues.USER_LOGOUT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_logout/get.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user_logout/get.py deleted file mode 100644 index b323541d77f..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_logout/get.py +++ /dev/null @@ -1,210 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from . import path - - - -@dataclass -class ApiResponseForDefault(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_default = api_client.OpenApiResponse( - response_cls=ApiResponseForDefault, -) -_status_code_to_response = { - 'default': _response_for_default, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _logout_user_oapg( - self, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseForDefault, - ]: ... - - @typing.overload - def _logout_user_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _logout_user_oapg( - self, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseForDefault, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _logout_user_oapg( - self, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - Logs out current logged in user session - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - # TODO add cookie handling - - response = self.api_client.call_api( - resource_path=used_path, - method='get'.upper(), - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - default_response = _status_code_to_response.get('default') - if default_response: - api_response = default_response.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class LogoutUser(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def logout_user( - self, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseForDefault, - ]: ... - - @typing.overload - def logout_user( - self, - skip_deserialization: typing_extensions.Literal[True], - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def logout_user( - self, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseForDefault, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def logout_user( - self, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._logout_user_oapg( - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForget(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def get( - self, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseForDefault, - ]: ... - - @typing.overload - def get( - self, - skip_deserialization: typing_extensions.Literal[True], - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def get( - self, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseForDefault, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def get( - self, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._logout_user_oapg( - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_logout/get.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/user_logout/get.pyi deleted file mode 100644 index caf593877aa..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_logout/get.pyi +++ /dev/null @@ -1,205 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - - -@dataclass -class ApiResponseForDefault(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_default = api_client.OpenApiResponse( - response_cls=ApiResponseForDefault, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _logout_user_oapg( - self, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseForDefault, - ]: ... - - @typing.overload - def _logout_user_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _logout_user_oapg( - self, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseForDefault, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _logout_user_oapg( - self, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - Logs out current logged in user session - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - used_path = path.value - # TODO add cookie handling - - response = self.api_client.call_api( - resource_path=used_path, - method='get'.upper(), - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - default_response = _status_code_to_response.get('default') - if default_response: - api_response = default_response.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class LogoutUser(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def logout_user( - self, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseForDefault, - ]: ... - - @typing.overload - def logout_user( - self, - skip_deserialization: typing_extensions.Literal[True], - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def logout_user( - self, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseForDefault, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def logout_user( - self, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._logout_user_oapg( - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForget(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def get( - self, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseForDefault, - ]: ... - - @typing.overload - def get( - self, - skip_deserialization: typing_extensions.Literal[True], - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def get( - self, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseForDefault, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def get( - self, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._logout_user_oapg( - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/__init__.py deleted file mode 100644 index c78d37255f6..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from petstore_api.paths.user_username import Api - -from petstore_api.paths import PathValues - -path = PathValues.USER_USERNAME \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/delete.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/delete.py deleted file mode 100644 index 8b3f7928cc2..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/delete.py +++ /dev/null @@ -1,273 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from . import path - -# Path params -UsernameSchema = schemas.StrSchema -RequestRequiredPathParams = typing_extensions.TypedDict( - 'RequestRequiredPathParams', - { - 'username': typing.Union[UsernameSchema, str, ], - } -) -RequestOptionalPathParams = typing_extensions.TypedDict( - 'RequestOptionalPathParams', - { - }, - total=False -) - - -class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): - pass - - -request_path_username = api_client.PathParameter( - name="username", - style=api_client.ParameterStyle.SIMPLE, - schema=UsernameSchema, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -@dataclass -class ApiResponseFor404(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_404 = api_client.OpenApiResponse( - response_cls=ApiResponseFor404, -) -_status_code_to_response = { - '200': _response_for_200, - '404': _response_for_404, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _delete_user_oapg( - self, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _delete_user_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _delete_user_oapg( - self, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _delete_user_oapg( - self, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - Delete user - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) - used_path = path.value - - _path_params = {} - for parameter in ( - request_path_username, - ): - parameter_data = path_params.get(parameter.name, schemas.unset) - if parameter_data is schemas.unset: - continue - serialized_data = parameter.serialize(parameter_data) - _path_params.update(serialized_data) - - for k, v in _path_params.items(): - used_path = used_path.replace('{%s}' % k, v) - # TODO add cookie handling - - response = self.api_client.call_api( - resource_path=used_path, - method='delete'.upper(), - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class DeleteUser(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def delete_user( - self, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def delete_user( - self, - skip_deserialization: typing_extensions.Literal[True], - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def delete_user( - self, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def delete_user( - self, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._delete_user_oapg( - path_params=path_params, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiFordelete(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def delete( - self, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def delete( - self, - skip_deserialization: typing_extensions.Literal[True], - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def delete( - self, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def delete( - self, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._delete_user_oapg( - path_params=path_params, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/delete.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/delete.pyi deleted file mode 100644 index 757358c2c3a..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/delete.pyi +++ /dev/null @@ -1,267 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -# Path params -UsernameSchema = schemas.StrSchema -RequestRequiredPathParams = typing_extensions.TypedDict( - 'RequestRequiredPathParams', - { - 'username': typing.Union[UsernameSchema, str, ], - } -) -RequestOptionalPathParams = typing_extensions.TypedDict( - 'RequestOptionalPathParams', - { - }, - total=False -) - - -class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): - pass - - -request_path_username = api_client.PathParameter( - name="username", - style=api_client.ParameterStyle.SIMPLE, - schema=UsernameSchema, - required=True, -) - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, -) - - -@dataclass -class ApiResponseFor404(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_404 = api_client.OpenApiResponse( - response_cls=ApiResponseFor404, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _delete_user_oapg( - self, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _delete_user_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _delete_user_oapg( - self, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _delete_user_oapg( - self, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - Delete user - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) - used_path = path.value - - _path_params = {} - for parameter in ( - request_path_username, - ): - parameter_data = path_params.get(parameter.name, schemas.unset) - if parameter_data is schemas.unset: - continue - serialized_data = parameter.serialize(parameter_data) - _path_params.update(serialized_data) - - for k, v in _path_params.items(): - used_path = used_path.replace('{%s}' % k, v) - # TODO add cookie handling - - response = self.api_client.call_api( - resource_path=used_path, - method='delete'.upper(), - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class DeleteUser(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def delete_user( - self, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def delete_user( - self, - skip_deserialization: typing_extensions.Literal[True], - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def delete_user( - self, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def delete_user( - self, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._delete_user_oapg( - path_params=path_params, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiFordelete(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def delete( - self, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def delete( - self, - skip_deserialization: typing_extensions.Literal[True], - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def delete( - self, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def delete( - self, - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._delete_user_oapg( - path_params=path_params, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/get.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/get.py deleted file mode 100644 index 866197ce326..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/get.py +++ /dev/null @@ -1,324 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.user import User - -from . import path - -# Path params -UsernameSchema = schemas.StrSchema -RequestRequiredPathParams = typing_extensions.TypedDict( - 'RequestRequiredPathParams', - { - 'username': typing.Union[UsernameSchema, str, ], - } -) -RequestOptionalPathParams = typing_extensions.TypedDict( - 'RequestOptionalPathParams', - { - }, - total=False -) - - -class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): - pass - - -request_path_username = api_client.PathParameter( - name="username", - style=api_client.ParameterStyle.SIMPLE, - schema=UsernameSchema, - required=True, -) -SchemaFor200ResponseBodyApplicationXml = User -SchemaFor200ResponseBodyApplicationJson = User - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationXml, - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/xml': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationXml), - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) - - -@dataclass -class ApiResponseFor400(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_400 = api_client.OpenApiResponse( - response_cls=ApiResponseFor400, -) - - -@dataclass -class ApiResponseFor404(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_404 = api_client.OpenApiResponse( - response_cls=ApiResponseFor404, -) -_status_code_to_response = { - '200': _response_for_200, - '400': _response_for_400, - '404': _response_for_404, -} -_all_accept_content_types = ( - 'application/xml', - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _get_user_by_name_oapg( - self, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _get_user_by_name_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _get_user_by_name_oapg( - self, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _get_user_by_name_oapg( - self, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - Get user by user name - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) - used_path = path.value - - _path_params = {} - for parameter in ( - request_path_username, - ): - parameter_data = path_params.get(parameter.name, schemas.unset) - if parameter_data is schemas.unset: - continue - serialized_data = parameter.serialize(parameter_data) - _path_params.update(serialized_data) - - for k, v in _path_params.items(): - used_path = used_path.replace('{%s}' % k, v) - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='get'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class GetUserByName(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def get_user_by_name( - self, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def get_user_by_name( - self, - skip_deserialization: typing_extensions.Literal[True], - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def get_user_by_name( - self, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def get_user_by_name( - self, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._get_user_by_name_oapg( - path_params=path_params, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForget(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def get( - self, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def get( - self, - skip_deserialization: typing_extensions.Literal[True], - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def get( - self, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def get( - self, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._get_user_by_name_oapg( - path_params=path_params, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/get.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/get.pyi deleted file mode 100644 index 237f8380594..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/get.pyi +++ /dev/null @@ -1,317 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.user import User - -# Path params -UsernameSchema = schemas.StrSchema -RequestRequiredPathParams = typing_extensions.TypedDict( - 'RequestRequiredPathParams', - { - 'username': typing.Union[UsernameSchema, str, ], - } -) -RequestOptionalPathParams = typing_extensions.TypedDict( - 'RequestOptionalPathParams', - { - }, - total=False -) - - -class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): - pass - - -request_path_username = api_client.PathParameter( - name="username", - style=api_client.ParameterStyle.SIMPLE, - schema=UsernameSchema, - required=True, -) -SchemaFor200ResponseBodyApplicationXml = User -SchemaFor200ResponseBodyApplicationJson = User - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationXml, - SchemaFor200ResponseBodyApplicationJson, - ] - headers: schemas.Unset = schemas.unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/xml': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationXml), - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) - - -@dataclass -class ApiResponseFor400(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_400 = api_client.OpenApiResponse( - response_cls=ApiResponseFor400, -) - - -@dataclass -class ApiResponseFor404(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_404 = api_client.OpenApiResponse( - response_cls=ApiResponseFor404, -) -_all_accept_content_types = ( - 'application/xml', - 'application/json', -) - - -class BaseApi(api_client.Api): - @typing.overload - def _get_user_by_name_oapg( - self, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def _get_user_by_name_oapg( - self, - skip_deserialization: typing_extensions.Literal[True], - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _get_user_by_name_oapg( - self, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _get_user_by_name_oapg( - self, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - Get user by user name - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) - used_path = path.value - - _path_params = {} - for parameter in ( - request_path_username, - ): - parameter_data = path_params.get(parameter.name, schemas.unset) - if parameter_data is schemas.unset: - continue - serialized_data = parameter.serialize(parameter_data) - _path_params.update(serialized_data) - - for k, v in _path_params.items(): - used_path = used_path.replace('{%s}' % k, v) - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - response = self.api_client.call_api( - resource_path=used_path, - method='get'.upper(), - headers=_headers, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class GetUserByName(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def get_user_by_name( - self, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def get_user_by_name( - self, - skip_deserialization: typing_extensions.Literal[True], - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def get_user_by_name( - self, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def get_user_by_name( - self, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._get_user_by_name_oapg( - path_params=path_params, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForget(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def get( - self, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> typing.Union[ - ApiResponseFor200, - ]: ... - - @typing.overload - def get( - self, - skip_deserialization: typing_extensions.Literal[True], - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def get( - self, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def get( - self, - path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._get_user_by_name_oapg( - path_params=path_params, - accept_content_types=accept_content_types, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/put.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/put.py deleted file mode 100644 index ceecd6565fe..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/put.py +++ /dev/null @@ -1,352 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.user import User - -from . import path - -# Path params -UsernameSchema = schemas.StrSchema -RequestRequiredPathParams = typing_extensions.TypedDict( - 'RequestRequiredPathParams', - { - 'username': typing.Union[UsernameSchema, str, ], - } -) -RequestOptionalPathParams = typing_extensions.TypedDict( - 'RequestOptionalPathParams', - { - }, - total=False -) - - -class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): - pass - - -request_path_username = api_client.PathParameter( - name="username", - style=api_client.ParameterStyle.SIMPLE, - schema=UsernameSchema, - required=True, -) -# body param -SchemaForRequestBodyApplicationJson = User - - -request_body_user = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor400(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_400 = api_client.OpenApiResponse( - response_cls=ApiResponseFor400, -) - - -@dataclass -class ApiResponseFor404(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_404 = api_client.OpenApiResponse( - response_cls=ApiResponseFor404, -) -_status_code_to_response = { - '400': _response_for_400, - '404': _response_for_404, -} - - -class BaseApi(api_client.Api): - @typing.overload - def _update_user_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> api_client.ApiResponseWithoutDeserialization: ... - @typing.overload - def _update_user_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _update_user_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _update_user_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _update_user_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - Updated user - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) - used_path = path.value - - _path_params = {} - for parameter in ( - request_path_username, - ): - parameter_data = path_params.get(parameter.name, schemas.unset) - if parameter_data is schemas.unset: - continue - serialized_data = parameter.serialize(parameter_data) - _path_params.update(serialized_data) - - for k, v in _path_params.items(): - used_path = used_path.replace('{%s}' % k, v) - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_user.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='put'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class UpdateUser(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def update_user( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> api_client.ApiResponseWithoutDeserialization: ... - @typing.overload - def update_user( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def update_user( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def update_user( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def update_user( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._update_user_oapg( - body=body, - path_params=path_params, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForput(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def put( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> api_client.ApiResponseWithoutDeserialization: ... - @typing.overload - def put( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def put( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def put( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def put( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._update_user_oapg( - body=body, - path_params=path_params, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/put.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/put.pyi deleted file mode 100644 index b4bc40a4a14..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/put.pyi +++ /dev/null @@ -1,346 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - -from petstore_api.model.user import User - -# Path params -UsernameSchema = schemas.StrSchema -RequestRequiredPathParams = typing_extensions.TypedDict( - 'RequestRequiredPathParams', - { - 'username': typing.Union[UsernameSchema, str, ], - } -) -RequestOptionalPathParams = typing_extensions.TypedDict( - 'RequestOptionalPathParams', - { - }, - total=False -) - - -class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): - pass - - -request_path_username = api_client.PathParameter( - name="username", - style=api_client.ParameterStyle.SIMPLE, - schema=UsernameSchema, - required=True, -) -# body param -SchemaForRequestBodyApplicationJson = User - - -request_body_user = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=SchemaForRequestBodyApplicationJson), - }, - required=True, -) - - -@dataclass -class ApiResponseFor400(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_400 = api_client.OpenApiResponse( - response_cls=ApiResponseFor400, -) - - -@dataclass -class ApiResponseFor404(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: schemas.Unset = schemas.unset - headers: schemas.Unset = schemas.unset - - -_response_for_404 = api_client.OpenApiResponse( - response_cls=ApiResponseFor404, -) - - -class BaseApi(api_client.Api): - @typing.overload - def _update_user_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> api_client.ApiResponseWithoutDeserialization: ... - @typing.overload - def _update_user_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _update_user_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def _update_user_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def _update_user_oapg( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - """ - Updated user - :param skip_deserialization: If true then api_response.response will be set but - api_response.body and api_response.headers will not be deserialized into schema - class instances - """ - self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) - used_path = path.value - - _path_params = {} - for parameter in ( - request_path_username, - ): - parameter_data = path_params.get(parameter.name, schemas.unset) - if parameter_data is schemas.unset: - continue - serialized_data = parameter.serialize(parameter_data) - _path_params.update(serialized_data) - - for k, v in _path_params.items(): - used_path = used_path.replace('{%s}' % k, v) - - _headers = HTTPHeaderDict() - # TODO add cookie handling - - if body is schemas.unset: - raise exceptions.ApiValueError( - 'The required body parameter has an invalid value of: unset. Set a valid value instead') - _fields = None - _body = None - serialized_data = request_body_user.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=used_path, - method='put'.upper(), - headers=_headers, - fields=_fields, - body=_body, - stream=stream, - timeout=timeout, - ) - - if skip_deserialization: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException( - status=response.status, - reason=response.reason, - api_response=api_response - ) - - return api_response - - -class UpdateUser(BaseApi): - # this class is used by api classes that refer to endpoints with operationId fn names - - @typing.overload - def update_user( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> api_client.ApiResponseWithoutDeserialization: ... - @typing.overload - def update_user( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def update_user( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def update_user( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def update_user( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._update_user_oapg( - body=body, - path_params=path_params, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - -class ApiForput(BaseApi): - # this class is used by api classes that refer to endpoints by path and http method names - - @typing.overload - def put( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: typing_extensions.Literal["application/json"] = ..., - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> api_client.ApiResponseWithoutDeserialization: ... - @typing.overload - def put( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: typing_extensions.Literal[False] = ..., - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def put( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - skip_deserialization: typing_extensions.Literal[True], - content_type: str = ..., - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> api_client.ApiResponseWithoutDeserialization: ... - - @typing.overload - def put( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = ..., - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = ..., - ) -> typing.Union[ - api_client.ApiResponseWithoutDeserialization, - ]: ... - - def put( - self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], - content_type: str = 'application/json', - path_params: RequestPathParams = frozendict.frozendict(), - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - skip_deserialization: bool = False, - ): - return self._update_user_oapg( - body=body, - path_params=path_params, - content_type=content_type, - stream=stream, - timeout=timeout, - skip_deserialization=skip_deserialization - ) - - diff --git a/samples/openapi3/client/petstore/python/petstore_api/rest.py b/samples/openapi3/client/petstore/python/petstore_api/rest.py deleted file mode 100644 index 6c12a23c4a6..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/rest.py +++ /dev/null @@ -1,253 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import logging -import ssl -from urllib.parse import urlencode -import typing - -import certifi -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api.exceptions import ApiException, ApiValueError - - -logger = logging.getLogger(__name__) - - -class RESTClientObject(object): - - def __init__(self, configuration, pools_size=4, maxsize=None): - # urllib3.PoolManager will pass all kw parameters to connectionpool - # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 - # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 - # maxsize is the number of requests to host that are allowed in parallel # noqa: E501 - # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 - - # cert_reqs - if configuration.verify_ssl: - cert_reqs = ssl.CERT_REQUIRED - else: - cert_reqs = ssl.CERT_NONE - - # ca_certs - if configuration.ssl_ca_cert: - ca_certs = configuration.ssl_ca_cert - else: - # if not set certificate file, use Mozilla's root certificates. - ca_certs = certifi.where() - - addition_pool_args = {} - if configuration.assert_hostname is not None: - addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 - - if configuration.retries is not None: - addition_pool_args['retries'] = configuration.retries - - if configuration.socket_options is not None: - addition_pool_args['socket_options'] = configuration.socket_options - - if maxsize is None: - if configuration.connection_pool_maxsize is not None: - maxsize = configuration.connection_pool_maxsize - else: - maxsize = 4 - - # https pool manager - if configuration.proxy: - self.pool_manager = urllib3.ProxyManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=ca_certs, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - proxy_url=configuration.proxy, - proxy_headers=configuration.proxy_headers, - **addition_pool_args - ) - else: - self.pool_manager = urllib3.PoolManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=ca_certs, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - **addition_pool_args - ) - - def request( - self, - method: str, - url: str, - headers: typing.Optional[HTTPHeaderDict] = None, - fields: typing.Optional[typing.Tuple[typing.Tuple[str, typing.Any], ...]] = None, - body: typing.Optional[typing.Union[str, bytes]] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> urllib3.HTTPResponse: - """Perform requests. - - :param method: http request method - :param url: http request url - :param headers: http request headers - :param body: request body, for other types - :param fields: request parameters for - `application/x-www-form-urlencoded` - or `multipart/form-data` - :param stream: if True, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is False. - :param timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - """ - method = method.upper() - assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', - 'PATCH', 'OPTIONS'] - - if fields and body: - raise ApiValueError( - "body parameter cannot be used with fields parameter." - ) - - fields = fields or {} - headers = headers or {} - - if timeout: - if isinstance(timeout, (int, float)): # noqa: E501,F821 - timeout = urllib3.Timeout(total=timeout) - elif (isinstance(timeout, tuple) and - len(timeout) == 2): - timeout = urllib3.Timeout(connect=timeout[0], read=timeout[1]) - - try: - # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` - if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: - if 'Content-Type' not in headers and body is None: - r = self.pool_manager.request( - method, - url, - preload_content=not stream, - timeout=timeout, - headers=headers - ) - elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 - r = self.pool_manager.request( - method, url, - body=body, - encode_multipart=False, - preload_content=not stream, - timeout=timeout, - headers=headers) - elif headers['Content-Type'] == 'multipart/form-data': - # must del headers['Content-Type'], or the correct - # Content-Type which generated by urllib3 will be - # overwritten. - del headers['Content-Type'] - r = self.pool_manager.request( - method, url, - fields=fields, - encode_multipart=True, - preload_content=not stream, - timeout=timeout, - headers=headers) - # Pass a `string` parameter directly in the body to support - # other content types than Json when `body` argument is - # provided in serialized form - elif isinstance(body, str) or isinstance(body, bytes): - request_body = body - r = self.pool_manager.request( - method, url, - body=request_body, - preload_content=not stream, - timeout=timeout, - headers=headers) - else: - # Cannot generate the request from given parameters - msg = """Cannot prepare a request message for provided - arguments. Please check that your arguments match - declared content type.""" - raise ApiException(status=0, reason=msg) - # For `GET`, `HEAD` - else: - r = self.pool_manager.request(method, url, - preload_content=not stream, - timeout=timeout, - headers=headers) - except urllib3.exceptions.SSLError as e: - msg = "{0}\n{1}".format(type(e).__name__, str(e)) - raise ApiException(status=0, reason=msg) - - if not stream: - # log response body - logger.debug("response body: %s", r.data) - - return r - - def GET(self, url, headers=None, stream=False, - timeout=None, fields=None) -> urllib3.HTTPResponse: - return self.request("GET", url, - headers=headers, - stream=stream, - timeout=timeout, - fields=fields) - - def HEAD(self, url, headers=None, stream=False, - timeout=None, fields=None) -> urllib3.HTTPResponse: - return self.request("HEAD", url, - headers=headers, - stream=stream, - timeout=timeout, - fields=fields) - - def OPTIONS(self, url, headers=None, - body=None, stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: - return self.request("OPTIONS", url, - headers=headers, - stream=stream, - timeout=timeout, - body=body, fields=fields) - - def DELETE(self, url, headers=None, body=None, - stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: - return self.request("DELETE", url, - headers=headers, - stream=stream, - timeout=timeout, - body=body, fields=fields) - - def POST(self, url, headers=None, - body=None, stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: - return self.request("POST", url, - headers=headers, - stream=stream, - timeout=timeout, - body=body, fields=fields) - - def PUT(self, url, headers=None, - body=None, stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: - return self.request("PUT", url, - headers=headers, - stream=stream, - timeout=timeout, - body=body, fields=fields) - - def PATCH(self, url, headers=None, - body=None, stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: - return self.request("PATCH", url, - headers=headers, - stream=stream, - timeout=timeout, - body=body, fields=fields) diff --git a/samples/openapi3/client/petstore/python/petstore_api/schemas.py b/samples/openapi3/client/petstore/python/petstore_api/schemas.py deleted file mode 100644 index 33d6e5b48b3..00000000000 --- a/samples/openapi3/client/petstore/python/petstore_api/schemas.py +++ /dev/null @@ -1,2475 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from collections import defaultdict -from datetime import date, datetime, timedelta # noqa: F401 -import functools -import decimal -import io -import re -import types -import typing -import uuid - -from dateutil.parser.isoparser import isoparser, _takes_ascii -import frozendict - -from petstore_api.exceptions import ( - ApiTypeError, - ApiValueError, -) -from petstore_api.configuration import ( - Configuration, -) - - -class Unset(object): - """ - An instance of this class is set as the default value for object type(dict) properties that are optional - When a property has an unset value, that property will not be assigned in the dict - """ - pass - -unset = Unset() - -none_type = type(None) -file_type = io.IOBase - - -class FileIO(io.FileIO): - """ - A class for storing files - Note: this class is not immutable - """ - - def __new__(cls, _arg: typing.Union[io.FileIO, io.BufferedReader]): - if isinstance(_arg, (io.FileIO, io.BufferedReader)): - if _arg.closed: - raise ApiValueError('Invalid file state; file is closed and must be open') - _arg.close() - inst = super(FileIO, cls).__new__(cls, _arg.name) - super(FileIO, inst).__init__(_arg.name) - return inst - raise ApiValueError('FileIO must be passed _arg which contains the open file') - - def __init__(self, _arg: typing.Union[io.FileIO, io.BufferedReader]): - pass - - -def update(d: dict, u: dict): - """ - Adds u to d - Where each dict is defaultdict(set) - """ - if not u: - return d - for k, v in u.items(): - if k not in d: - d[k] = v - else: - d[k] = d[k] | v - - -class ValidationMetadata(frozendict.frozendict): - """ - A class storing metadata that is needed to validate OpenApi Schema payloads - """ - def __new__( - cls, - path_to_item: typing.Tuple[typing.Union[str, int], ...] = tuple(['args[0]']), - from_server: bool = False, - configuration: typing.Optional[Configuration] = None, - seen_classes: typing.FrozenSet[typing.Type] = frozenset(), - validated_path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Type]] = frozendict.frozendict() - ): - """ - Args: - path_to_item: the path to the current data being instantiated. - For {'a': [1]} if the code is handling, 1, then the path is ('args[0]', 'a', 0) - This changes from location to location - from_server: whether or not this data came form the server - True when receiving server data - False when instantiating model with client side data not form the server - This does not change from location to location - configuration: the Configuration instance to use - This is needed because in Configuration: - - one can disable validation checking - This does not change from location to location - seen_classes: when deserializing data that matches multiple schemas, this is used to store - the schemas that have been traversed. This is used to stop processing when a cycle is seen. - This changes from location to location - validated_path_to_schemas: stores the already validated schema classes for a given path location - This does not change from location to location - """ - return super().__new__( - cls, - path_to_item=path_to_item, - from_server=from_server, - configuration=configuration, - seen_classes=seen_classes, - validated_path_to_schemas=validated_path_to_schemas - ) - - def validation_ran_earlier(self, cls: type) -> bool: - validated_schemas = self.validated_path_to_schemas.get(self.path_to_item, set()) - validation_ran_earlier = validated_schemas and cls in validated_schemas - if validation_ran_earlier: - return True - if cls in self.seen_classes: - return True - return False - - @property - def path_to_item(self) -> typing.Tuple[typing.Union[str, int], ...]: - return self.get('path_to_item') - - @property - def from_server(self) -> bool: - return self.get('from_server') - - @property - def configuration(self) -> typing.Optional[Configuration]: - return self.get('configuration') - - @property - def seen_classes(self) -> typing.FrozenSet[typing.Type]: - return self.get('seen_classes') - - @property - def validated_path_to_schemas(self) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Type]]: - return self.get('validated_path_to_schemas') - - -def add_deeper_validated_schemas(validation_metadata: ValidationMetadata, path_to_schemas: dict): - # this is called if validation_ran_earlier and current and deeper locations need to be added - current_path_to_item = validation_metadata.path_to_item - other_path_to_schemas = {} - for path_to_item, schemas in validation_metadata.validated_path_to_schemas.items(): - if len(path_to_item) < len(current_path_to_item): - continue - path_begins_with_current_path = path_to_item[:len(current_path_to_item)] == current_path_to_item - if path_begins_with_current_path: - other_path_to_schemas[path_to_item] = schemas - update(path_to_schemas, other_path_to_schemas) - - -class Singleton: - """ - Enums and singletons are the same - The same instance is returned for a given key of (cls, _arg) - """ - _instances = {} - - def __new__(cls, _arg: typing.Any, **kwargs): - """ - cls base classes: BoolClass, NoneClass, str, decimal.Decimal - The 3rd key is used in the tuple below for a corner case where an enum contains integer 1 - However 1.0 can also be ingested into that enum schema because 1.0 == 1 and - Decimal('1.0') == Decimal('1') - But if we omitted the 3rd value in the key, then Decimal('1.0') would be stored as Decimal('1') - and json serializing that instance would be '1' rather than the expected '1.0' - Adding the 3rd value, the str of _arg ensures that 1.0 -> Decimal('1.0') which is serialized as 1.0 - """ - key = (cls, _arg, str(_arg)) - if key not in cls._instances: - if isinstance(_arg, (none_type, bool, BoolClass, NoneClass)): - inst = super().__new__(cls) - cls._instances[key] = inst - else: - cls._instances[key] = super().__new__(cls, _arg) - return cls._instances[key] - - def __repr__(self): - if isinstance(self, NoneClass): - return f'<{self.__class__.__name__}: None>' - elif isinstance(self, BoolClass): - if bool(self): - return f'<{self.__class__.__name__}: True>' - return f'<{self.__class__.__name__}: False>' - return f'<{self.__class__.__name__}: {super().__repr__()}>' - - -class classproperty: - - def __init__(self, fget): - self.fget = fget - - def __get__(self, owner_self, owner_cls): - return self.fget(owner_cls) - - -class NoneClass(Singleton): - @classproperty - def NONE(cls): - return cls(None) - - def __bool__(self) -> bool: - return False - - -class BoolClass(Singleton): - @classproperty - def TRUE(cls): - return cls(True) - - @classproperty - def FALSE(cls): - return cls(False) - - @functools.lru_cache() - def __bool__(self) -> bool: - for key, instance in self._instances.items(): - if self is instance: - return bool(key[1]) - raise ValueError('Unable to find the boolean value of this instance') - - -class MetaOapgTyped: - exclusive_maximum: typing.Union[int, float] - inclusive_maximum: typing.Union[int, float] - exclusive_minimum: typing.Union[int, float] - inclusive_minimum: typing.Union[int, float] - max_items: int - min_items: int - discriminator: typing.Dict[str, typing.Dict[str, typing.Type['Schema']]] - - - class properties: - # to hold object properties - pass - - additional_properties: typing.Optional[typing.Type['Schema']] - max_properties: int - min_properties: int - all_of: typing.List[typing.Type['Schema']] - one_of: typing.List[typing.Type['Schema']] - any_of: typing.List[typing.Type['Schema']] - not_schema: typing.Type['Schema'] - max_length: int - min_length: int - items: typing.Type['Schema'] - - -class Schema: - """ - the base class of all swagger/openapi schemas/models - """ - __inheritable_primitive_types_set = {decimal.Decimal, str, tuple, frozendict.frozendict, FileIO, bytes, BoolClass, NoneClass} - _types: typing.Set[typing.Type] - MetaOapg = MetaOapgTyped - - @staticmethod - def __get_valid_classes_phrase(input_classes): - """Returns a string phrase describing what types are allowed""" - all_classes = list(input_classes) - all_classes = sorted(all_classes, key=lambda cls: cls.__name__) - all_class_names = [cls.__name__ for cls in all_classes] - if len(all_class_names) == 1: - return "is {0}".format(all_class_names[0]) - return "is one of [{0}]".format(", ".join(all_class_names)) - - @staticmethod - def _get_class_oapg(item_cls: typing.Union[types.FunctionType, staticmethod, typing.Type['Schema']]) -> typing.Type['Schema']: - if isinstance(item_cls, types.FunctionType): - # referenced schema - return item_cls() - elif isinstance(item_cls, staticmethod): - # referenced schema - return item_cls.__func__() - return item_cls - - @classmethod - def __type_error_message( - cls, var_value=None, var_name=None, valid_classes=None, key_type=None - ): - """ - Keyword Args: - var_value (any): the variable which has the type_error - var_name (str): the name of the variable which has the typ error - valid_classes (tuple): the accepted classes for current_item's - value - key_type (bool): False if our value is a value in a dict - True if it is a key in a dict - False if our item is an item in a tuple - """ - key_or_value = "value" - if key_type: - key_or_value = "key" - valid_classes_phrase = cls.__get_valid_classes_phrase(valid_classes) - msg = "Invalid type. Required {1} type {2} and " "passed type was {3}".format( - var_name, - key_or_value, - valid_classes_phrase, - type(var_value).__name__, - ) - return msg - - @classmethod - def __get_type_error(cls, var_value, path_to_item, valid_classes, key_type=False): - error_msg = cls.__type_error_message( - var_name=path_to_item[-1], - var_value=var_value, - valid_classes=valid_classes, - key_type=key_type, - ) - return ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=valid_classes, - key_type=key_type, - ) - - @classmethod - def _validate_oapg( - cls, - arg, - validation_metadata: ValidationMetadata, - ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]]: - """ - Schema _validate_oapg - All keyword validation except for type checking was done in calling stack frames - If those validations passed, the validated classes are collected in path_to_schemas - - Returns: - path_to_schemas: a map of path to schemas - - Raises: - ApiValueError: when a string can't be converted into a date or datetime and it must be one of those classes - ApiTypeError: when the input type is not in the list of allowed spec types - """ - base_class = type(arg) - if base_class not in cls._types: - raise cls.__get_type_error( - arg, - validation_metadata.path_to_item, - cls._types, - key_type=False, - ) - - path_to_schemas = {validation_metadata.path_to_item: set()} - path_to_schemas[validation_metadata.path_to_item].add(cls) - path_to_schemas[validation_metadata.path_to_item].add(base_class) - return path_to_schemas - - @staticmethod - def _process_schema_classes_oapg( - schema_classes: typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]] - ): - """ - Processes and mutates schema_classes - If a SomeSchema is a subclass of DictSchema then remove DictSchema because it is already included - """ - if len(schema_classes) < 2: - return - if len(schema_classes) > 2 and UnsetAnyTypeSchema in schema_classes: - schema_classes.remove(UnsetAnyTypeSchema) - x_schema = schema_type_classes & schema_classes - if not x_schema: - return - x_schema = x_schema.pop() - if any(c is not x_schema and issubclass(c, x_schema) for c in schema_classes): - # needed to not have a mro error in get_new_class - schema_classes.remove(x_schema) - - @classmethod - def __get_new_cls( - cls, - arg, - validation_metadata: ValidationMetadata - ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Type['Schema']]: - """ - Make a new dynamic class and return an instance of that class - We are making an instance of cls, but instead of making cls - make a new class, new_cls - which includes dynamic bases including cls - return an instance of that new class - - Dict property + List Item Assignment Use cases: - 1. value is NOT an instance of the required schema class - the value is validated by _validate_oapg - _validate_oapg returns a key value pair - where the key is the path to the item, and the value will be the required manufactured class - made out of the matching schemas - 2. value is an instance of the correct schema type - the value is NOT validated by _validate_oapg, _validate_oapg only checks that the instance is of the correct schema type - for this value, _validate_oapg does NOT return an entry for it in _path_to_schemas - and in list/dict _get_items_oapg,_get_properties_oapg the value will be directly assigned - because value is of the correct type, and validation was run earlier when the instance was created - """ - _path_to_schemas = {} - if validation_metadata.validation_ran_earlier(cls): - add_deeper_validated_schemas(validation_metadata, _path_to_schemas) - else: - other_path_to_schemas = cls._validate_oapg(arg, validation_metadata=validation_metadata) - update(_path_to_schemas, other_path_to_schemas) - # loop through it make a new class for each entry - # do not modify the returned result because it is cached and we would be modifying the cached value - path_to_schemas = {} - for path, schema_classes in _path_to_schemas.items(): - """ - Use cases - 1. N number of schema classes + enum + type != bool/None, classes in path_to_schemas: tuple/frozendict.frozendict/str/Decimal/bytes/FileIo - needs Singleton added - 2. N number of schema classes + enum + type == bool/None, classes in path_to_schemas: BoolClass/NoneClass - Singleton already added - 3. N number of schema classes, classes in path_to_schemas: BoolClass/NoneClass/tuple/frozendict.frozendict/str/Decimal/bytes/FileIo - """ - cls._process_schema_classes_oapg(schema_classes) - enum_schema = any( - issubclass(this_cls, EnumBase) for this_cls in schema_classes) - inheritable_primitive_type = schema_classes.intersection(cls.__inheritable_primitive_types_set) - chosen_schema_classes = schema_classes - inheritable_primitive_type - suffix = tuple(inheritable_primitive_type) - if enum_schema and suffix[0] not in {NoneClass, BoolClass}: - suffix = (Singleton,) + suffix - - used_classes = tuple(sorted(chosen_schema_classes, key=lambda a_cls: a_cls.__name__)) + suffix - mfg_cls = get_new_class(class_name='DynamicSchema', bases=used_classes) - path_to_schemas[path] = mfg_cls - - return path_to_schemas - - @classmethod - def _get_new_instance_without_conversion_oapg( - cls, - arg: typing.Any, - path_to_item: typing.Tuple[typing.Union[str, int], ...], - path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Type['Schema']] - ): - # We have a Dynamic class and we are making an instance of it - if issubclass(cls, frozendict.frozendict) and issubclass(cls, DictBase): - properties = cls._get_properties_oapg(arg, path_to_item, path_to_schemas) - return super(Schema, cls).__new__(cls, properties) - elif issubclass(cls, tuple) and issubclass(cls, ListBase): - items = cls._get_items_oapg(arg, path_to_item, path_to_schemas) - return super(Schema, cls).__new__(cls, items) - """ - str = openapi str, date, and datetime - decimal.Decimal = openapi int and float - FileIO = openapi binary type and the user inputs a file - bytes = openapi binary type and the user inputs bytes - """ - return super(Schema, cls).__new__(cls, arg) - - @classmethod - def from_openapi_data_oapg( - cls, - arg: typing.Union[ - str, - date, - datetime, - int, - float, - decimal.Decimal, - bool, - None, - 'Schema', - dict, - frozendict.frozendict, - tuple, - list, - io.FileIO, - io.BufferedReader, - bytes - ], - _configuration: typing.Optional[Configuration] - ): - """ - Schema from_openapi_data_oapg - """ - from_server = True - validated_path_to_schemas = {} - arg = cast_to_allowed_types(arg, from_server, validated_path_to_schemas) - validation_metadata = ValidationMetadata( - from_server=from_server, configuration=_configuration, validated_path_to_schemas=validated_path_to_schemas) - path_to_schemas = cls.__get_new_cls(arg, validation_metadata) - new_cls = path_to_schemas[validation_metadata.path_to_item] - new_inst = new_cls._get_new_instance_without_conversion_oapg( - arg, - validation_metadata.path_to_item, - path_to_schemas - ) - return new_inst - - @staticmethod - def __get_input_dict(*args, **kwargs) -> frozendict.frozendict: - input_dict = {} - if args and isinstance(args[0], (dict, frozendict.frozendict)): - input_dict.update(args[0]) - if kwargs: - input_dict.update(kwargs) - return frozendict.frozendict(input_dict) - - @staticmethod - def __remove_unsets(kwargs): - return {key: val for key, val in kwargs.items() if val is not unset} - - def __new__(cls, *_args: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema'], _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema', Unset]): - """ - Schema __new__ - - Args: - _args (int/float/decimal.Decimal/str/list/tuple/dict/frozendict.frozendict/bool/None): the value - kwargs (str, int/float/decimal.Decimal/str/list/tuple/dict/frozendict.frozendict/bool/None): dict values - _configuration: contains the Configuration that enables json schema validation keywords - like minItems, minLength etc - - Note: double underscores are used here because pycharm thinks that these variables - are instance properties if they are named normally :( - """ - __kwargs = cls.__remove_unsets(kwargs) - if not _args and not __kwargs: - raise TypeError( - 'No input given. args or kwargs must be given.' - ) - if not __kwargs and _args and not isinstance(_args[0], dict): - __arg = _args[0] - else: - __arg = cls.__get_input_dict(*_args, **__kwargs) - __from_server = False - __validated_path_to_schemas = {} - __arg = cast_to_allowed_types( - __arg, __from_server, __validated_path_to_schemas) - __validation_metadata = ValidationMetadata( - configuration=_configuration, from_server=__from_server, validated_path_to_schemas=__validated_path_to_schemas) - __path_to_schemas = cls.__get_new_cls(__arg, __validation_metadata) - __new_cls = __path_to_schemas[__validation_metadata.path_to_item] - return __new_cls._get_new_instance_without_conversion_oapg( - __arg, - __validation_metadata.path_to_item, - __path_to_schemas - ) - - def __init__( - self, - *_args: typing.Union[ - dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema'], - _configuration: typing.Optional[Configuration] = None, - **kwargs: typing.Union[ - dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema', Unset - ] - ): - """ - this is needed to fix 'Unexpected argument' warning in pycharm - this code does nothing because all Schema instances are immutable - this means that all input data is passed into and used in new, and after the new instance is made - no new attributes are assigned and init is not used - """ - pass - -""" -import itertools -data_types = ('None', 'FrozenDict', 'Tuple', 'Str', 'Decimal', 'Bool') -type_to_cls = { - 'None': 'NoneClass', - 'FrozenDict': 'frozendict.frozendict', - 'Tuple': 'tuple', - 'Str': 'str', - 'Decimal': 'decimal.Decimal', - 'Bool': 'BoolClass' -} -cls_tuples = [v for v in itertools.combinations(data_types, 5)] -typed_classes = [f"class {''.join(cls_tuple)}Mixin({', '.join(type_to_cls[typ] for typ in cls_tuple)}):\n pass" for cls_tuple in cls_tuples] -for cls in typed_classes: - print(cls) -object_classes = [f"{''.join(cls_tuple)}Mixin = object" for cls_tuple in cls_tuples] -for cls in object_classes: - print(cls) -""" -if typing.TYPE_CHECKING: - # qty 1 - NoneMixin = NoneClass - FrozenDictMixin = frozendict.frozendict - TupleMixin = tuple - StrMixin = str - DecimalMixin = decimal.Decimal - BoolMixin = BoolClass - BytesMixin = bytes - FileMixin = FileIO - # qty 2 - class BinaryMixin(bytes, FileIO): - pass - class NoneFrozenDictMixin(NoneClass, frozendict.frozendict): - pass - class NoneTupleMixin(NoneClass, tuple): - pass - class NoneStrMixin(NoneClass, str): - pass - class NoneDecimalMixin(NoneClass, decimal.Decimal): - pass - class NoneBoolMixin(NoneClass, BoolClass): - pass - class FrozenDictTupleMixin(frozendict.frozendict, tuple): - pass - class FrozenDictStrMixin(frozendict.frozendict, str): - pass - class FrozenDictDecimalMixin(frozendict.frozendict, decimal.Decimal): - pass - class FrozenDictBoolMixin(frozendict.frozendict, BoolClass): - pass - class TupleStrMixin(tuple, str): - pass - class TupleDecimalMixin(tuple, decimal.Decimal): - pass - class TupleBoolMixin(tuple, BoolClass): - pass - class StrDecimalMixin(str, decimal.Decimal): - pass - class StrBoolMixin(str, BoolClass): - pass - class DecimalBoolMixin(decimal.Decimal, BoolClass): - pass - # qty 3 - class NoneFrozenDictTupleMixin(NoneClass, frozendict.frozendict, tuple): - pass - class NoneFrozenDictStrMixin(NoneClass, frozendict.frozendict, str): - pass - class NoneFrozenDictDecimalMixin(NoneClass, frozendict.frozendict, decimal.Decimal): - pass - class NoneFrozenDictBoolMixin(NoneClass, frozendict.frozendict, BoolClass): - pass - class NoneTupleStrMixin(NoneClass, tuple, str): - pass - class NoneTupleDecimalMixin(NoneClass, tuple, decimal.Decimal): - pass - class NoneTupleBoolMixin(NoneClass, tuple, BoolClass): - pass - class NoneStrDecimalMixin(NoneClass, str, decimal.Decimal): - pass - class NoneStrBoolMixin(NoneClass, str, BoolClass): - pass - class NoneDecimalBoolMixin(NoneClass, decimal.Decimal, BoolClass): - pass - class FrozenDictTupleStrMixin(frozendict.frozendict, tuple, str): - pass - class FrozenDictTupleDecimalMixin(frozendict.frozendict, tuple, decimal.Decimal): - pass - class FrozenDictTupleBoolMixin(frozendict.frozendict, tuple, BoolClass): - pass - class FrozenDictStrDecimalMixin(frozendict.frozendict, str, decimal.Decimal): - pass - class FrozenDictStrBoolMixin(frozendict.frozendict, str, BoolClass): - pass - class FrozenDictDecimalBoolMixin(frozendict.frozendict, decimal.Decimal, BoolClass): - pass - class TupleStrDecimalMixin(tuple, str, decimal.Decimal): - pass - class TupleStrBoolMixin(tuple, str, BoolClass): - pass - class TupleDecimalBoolMixin(tuple, decimal.Decimal, BoolClass): - pass - class StrDecimalBoolMixin(str, decimal.Decimal, BoolClass): - pass - # qty 4 - class NoneFrozenDictTupleStrMixin(NoneClass, frozendict.frozendict, tuple, str): - pass - class NoneFrozenDictTupleDecimalMixin(NoneClass, frozendict.frozendict, tuple, decimal.Decimal): - pass - class NoneFrozenDictTupleBoolMixin(NoneClass, frozendict.frozendict, tuple, BoolClass): - pass - class NoneFrozenDictStrDecimalMixin(NoneClass, frozendict.frozendict, str, decimal.Decimal): - pass - class NoneFrozenDictStrBoolMixin(NoneClass, frozendict.frozendict, str, BoolClass): - pass - class NoneFrozenDictDecimalBoolMixin(NoneClass, frozendict.frozendict, decimal.Decimal, BoolClass): - pass - class NoneTupleStrDecimalMixin(NoneClass, tuple, str, decimal.Decimal): - pass - class NoneTupleStrBoolMixin(NoneClass, tuple, str, BoolClass): - pass - class NoneTupleDecimalBoolMixin(NoneClass, tuple, decimal.Decimal, BoolClass): - pass - class NoneStrDecimalBoolMixin(NoneClass, str, decimal.Decimal, BoolClass): - pass - class FrozenDictTupleStrDecimalMixin(frozendict.frozendict, tuple, str, decimal.Decimal): - pass - class FrozenDictTupleStrBoolMixin(frozendict.frozendict, tuple, str, BoolClass): - pass - class FrozenDictTupleDecimalBoolMixin(frozendict.frozendict, tuple, decimal.Decimal, BoolClass): - pass - class FrozenDictStrDecimalBoolMixin(frozendict.frozendict, str, decimal.Decimal, BoolClass): - pass - class TupleStrDecimalBoolMixin(tuple, str, decimal.Decimal, BoolClass): - pass - # qty 5 - class NoneFrozenDictTupleStrDecimalMixin(NoneClass, frozendict.frozendict, tuple, str, decimal.Decimal): - pass - class NoneFrozenDictTupleStrBoolMixin(NoneClass, frozendict.frozendict, tuple, str, BoolClass): - pass - class NoneFrozenDictTupleDecimalBoolMixin(NoneClass, frozendict.frozendict, tuple, decimal.Decimal, BoolClass): - pass - class NoneFrozenDictStrDecimalBoolMixin(NoneClass, frozendict.frozendict, str, decimal.Decimal, BoolClass): - pass - class NoneTupleStrDecimalBoolMixin(NoneClass, tuple, str, decimal.Decimal, BoolClass): - pass - class FrozenDictTupleStrDecimalBoolMixin(frozendict.frozendict, tuple, str, decimal.Decimal, BoolClass): - pass - # qty 6 - class NoneFrozenDictTupleStrDecimalBoolMixin(NoneClass, frozendict.frozendict, tuple, str, decimal.Decimal, BoolClass): - pass - # qty 8 - class NoneFrozenDictTupleStrDecimalBoolFileBytesMixin(NoneClass, frozendict.frozendict, tuple, str, decimal.Decimal, BoolClass, FileIO, bytes): - pass -else: - # qty 1 - class NoneMixin: - _types = {NoneClass} - class FrozenDictMixin: - _types = {frozendict.frozendict} - class TupleMixin: - _types = {tuple} - class StrMixin: - _types = {str} - class DecimalMixin: - _types = {decimal.Decimal} - class BoolMixin: - _types = {BoolClass} - class BytesMixin: - _types = {bytes} - class FileMixin: - _types = {FileIO} - # qty 2 - class BinaryMixin: - _types = {bytes, FileIO} - class NoneFrozenDictMixin: - _types = {NoneClass, frozendict.frozendict} - class NoneTupleMixin: - _types = {NoneClass, tuple} - class NoneStrMixin: - _types = {NoneClass, str} - class NoneDecimalMixin: - _types = {NoneClass, decimal.Decimal} - class NoneBoolMixin: - _types = {NoneClass, BoolClass} - class FrozenDictTupleMixin: - _types = {frozendict.frozendict, tuple} - class FrozenDictStrMixin: - _types = {frozendict.frozendict, str} - class FrozenDictDecimalMixin: - _types = {frozendict.frozendict, decimal.Decimal} - class FrozenDictBoolMixin: - _types = {frozendict.frozendict, BoolClass} - class TupleStrMixin: - _types = {tuple, str} - class TupleDecimalMixin: - _types = {tuple, decimal.Decimal} - class TupleBoolMixin: - _types = {tuple, BoolClass} - class StrDecimalMixin: - _types = {str, decimal.Decimal} - class StrBoolMixin: - _types = {str, BoolClass} - class DecimalBoolMixin: - _types = {decimal.Decimal, BoolClass} - # qty 3 - class NoneFrozenDictTupleMixin: - _types = {NoneClass, frozendict.frozendict, tuple} - class NoneFrozenDictStrMixin: - _types = {NoneClass, frozendict.frozendict, str} - class NoneFrozenDictDecimalMixin: - _types = {NoneClass, frozendict.frozendict, decimal.Decimal} - class NoneFrozenDictBoolMixin: - _types = {NoneClass, frozendict.frozendict, BoolClass} - class NoneTupleStrMixin: - _types = {NoneClass, tuple, str} - class NoneTupleDecimalMixin: - _types = {NoneClass, tuple, decimal.Decimal} - class NoneTupleBoolMixin: - _types = {NoneClass, tuple, BoolClass} - class NoneStrDecimalMixin: - _types = {NoneClass, str, decimal.Decimal} - class NoneStrBoolMixin: - _types = {NoneClass, str, BoolClass} - class NoneDecimalBoolMixin: - _types = {NoneClass, decimal.Decimal, BoolClass} - class FrozenDictTupleStrMixin: - _types = {frozendict.frozendict, tuple, str} - class FrozenDictTupleDecimalMixin: - _types = {frozendict.frozendict, tuple, decimal.Decimal} - class FrozenDictTupleBoolMixin: - _types = {frozendict.frozendict, tuple, BoolClass} - class FrozenDictStrDecimalMixin: - _types = {frozendict.frozendict, str, decimal.Decimal} - class FrozenDictStrBoolMixin: - _types = {frozendict.frozendict, str, BoolClass} - class FrozenDictDecimalBoolMixin: - _types = {frozendict.frozendict, decimal.Decimal, BoolClass} - class TupleStrDecimalMixin: - _types = {tuple, str, decimal.Decimal} - class TupleStrBoolMixin: - _types = {tuple, str, BoolClass} - class TupleDecimalBoolMixin: - _types = {tuple, decimal.Decimal, BoolClass} - class StrDecimalBoolMixin: - _types = {str, decimal.Decimal, BoolClass} - # qty 4 - class NoneFrozenDictTupleStrMixin: - _types = {NoneClass, frozendict.frozendict, tuple, str} - class NoneFrozenDictTupleDecimalMixin: - _types = {NoneClass, frozendict.frozendict, tuple, decimal.Decimal} - class NoneFrozenDictTupleBoolMixin: - _types = {NoneClass, frozendict.frozendict, tuple, BoolClass} - class NoneFrozenDictStrDecimalMixin: - _types = {NoneClass, frozendict.frozendict, str, decimal.Decimal} - class NoneFrozenDictStrBoolMixin: - _types = {NoneClass, frozendict.frozendict, str, BoolClass} - class NoneFrozenDictDecimalBoolMixin: - _types = {NoneClass, frozendict.frozendict, decimal.Decimal, BoolClass} - class NoneTupleStrDecimalMixin: - _types = {NoneClass, tuple, str, decimal.Decimal} - class NoneTupleStrBoolMixin: - _types = {NoneClass, tuple, str, BoolClass} - class NoneTupleDecimalBoolMixin: - _types = {NoneClass, tuple, decimal.Decimal, BoolClass} - class NoneStrDecimalBoolMixin: - _types = {NoneClass, str, decimal.Decimal, BoolClass} - class FrozenDictTupleStrDecimalMixin: - _types = {frozendict.frozendict, tuple, str, decimal.Decimal} - class FrozenDictTupleStrBoolMixin: - _types = {frozendict.frozendict, tuple, str, BoolClass} - class FrozenDictTupleDecimalBoolMixin: - _types = {frozendict.frozendict, tuple, decimal.Decimal, BoolClass} - class FrozenDictStrDecimalBoolMixin: - _types = {frozendict.frozendict, str, decimal.Decimal, BoolClass} - class TupleStrDecimalBoolMixin: - _types = {tuple, str, decimal.Decimal, BoolClass} - # qty 5 - class NoneFrozenDictTupleStrDecimalMixin: - _types = {NoneClass, frozendict.frozendict, tuple, str, decimal.Decimal} - class NoneFrozenDictTupleStrBoolMixin: - _types = {NoneClass, frozendict.frozendict, tuple, str, BoolClass} - class NoneFrozenDictTupleDecimalBoolMixin: - _types = {NoneClass, frozendict.frozendict, tuple, decimal.Decimal, BoolClass} - class NoneFrozenDictStrDecimalBoolMixin: - _types = {NoneClass, frozendict.frozendict, str, decimal.Decimal, BoolClass} - class NoneTupleStrDecimalBoolMixin: - _types = {NoneClass, tuple, str, decimal.Decimal, BoolClass} - class FrozenDictTupleStrDecimalBoolMixin: - _types = {frozendict.frozendict, tuple, str, decimal.Decimal, BoolClass} - # qty 6 - class NoneFrozenDictTupleStrDecimalBoolMixin: - _types = {NoneClass, frozendict.frozendict, tuple, str, decimal.Decimal, BoolClass} - # qty 8 - class NoneFrozenDictTupleStrDecimalBoolFileBytesMixin: - _types = {NoneClass, frozendict.frozendict, tuple, str, decimal.Decimal, BoolClass, FileIO, bytes} - - -class ValidatorBase: - @staticmethod - def _is_json_validation_enabled_oapg(schema_keyword, configuration=None): - """Returns true if JSON schema validation is enabled for the specified - validation keyword. This can be used to skip JSON schema structural validation - as requested in the configuration. - Note: the suffix _oapg stands for openapi python (experimental) generator and - it has been added to prevent collisions with other methods and properties - - Args: - schema_keyword (string): the name of a JSON schema validation keyword. - configuration (Configuration): the configuration class. - """ - - return (configuration is None or - not hasattr(configuration, '_disabled_client_side_validations') or - schema_keyword not in configuration._disabled_client_side_validations) - - @staticmethod - def _raise_validation_error_message_oapg(value, constraint_msg, constraint_value, path_to_item, additional_txt=""): - raise ApiValueError( - "Invalid value `{value}`, {constraint_msg} `{constraint_value}`{additional_txt} at {path_to_item}".format( - value=value, - constraint_msg=constraint_msg, - constraint_value=constraint_value, - additional_txt=additional_txt, - path_to_item=path_to_item, - ) - ) - - -class EnumBase: - @classmethod - def _validate_oapg( - cls, - arg, - validation_metadata: ValidationMetadata, - ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]]: - """ - EnumBase _validate_oapg - Validates that arg is in the enum's allowed values - """ - try: - cls.MetaOapg.enum_value_to_name[arg] - except KeyError: - raise ApiValueError("Invalid value {} passed in to {}, allowed_values={}".format(arg, cls, cls.MetaOapg.enum_value_to_name.keys())) - return super()._validate_oapg(arg, validation_metadata=validation_metadata) - - -class BoolBase: - def is_true_oapg(self) -> bool: - """ - A replacement for x is True - True if the instance is a BoolClass True Singleton - """ - if not issubclass(self.__class__, BoolClass): - return False - return bool(self) - - def is_false_oapg(self) -> bool: - """ - A replacement for x is False - True if the instance is a BoolClass False Singleton - """ - if not issubclass(self.__class__, BoolClass): - return False - return bool(self) is False - - -class NoneBase: - def is_none_oapg(self) -> bool: - """ - A replacement for x is None - True if the instance is a NoneClass None Singleton - """ - if issubclass(self.__class__, NoneClass): - return True - return False - - -class StrBase(ValidatorBase): - MetaOapg: MetaOapgTyped - - @property - def as_str_oapg(self) -> str: - return self - - @property - def as_date_oapg(self) -> date: - raise Exception('not implemented') - - @property - def as_datetime_oapg(self) -> datetime: - raise Exception('not implemented') - - @property - def as_decimal_oapg(self) -> decimal.Decimal: - raise Exception('not implemented') - - @property - def as_uuid_oapg(self) -> uuid.UUID: - raise Exception('not implemented') - - @classmethod - def __check_str_validations( - cls, - arg: str, - validation_metadata: ValidationMetadata - ): - if not hasattr(cls, 'MetaOapg'): - return - if (cls._is_json_validation_enabled_oapg('maxLength', validation_metadata.configuration) and - hasattr(cls.MetaOapg, 'max_length') and - len(arg) > cls.MetaOapg.max_length): - cls._raise_validation_error_message_oapg( - value=arg, - constraint_msg="length must be less than or equal to", - constraint_value=cls.MetaOapg.max_length, - path_to_item=validation_metadata.path_to_item - ) - - if (cls._is_json_validation_enabled_oapg('minLength', validation_metadata.configuration) and - hasattr(cls.MetaOapg, 'min_length') and - len(arg) < cls.MetaOapg.min_length): - cls._raise_validation_error_message_oapg( - value=arg, - constraint_msg="length must be greater than or equal to", - constraint_value=cls.MetaOapg.min_length, - path_to_item=validation_metadata.path_to_item - ) - - if (cls._is_json_validation_enabled_oapg('pattern', validation_metadata.configuration) and - hasattr(cls.MetaOapg, 'regex')): - for regex_dict in cls.MetaOapg.regex: - flags = regex_dict.get('flags', 0) - if not re.search(regex_dict['pattern'], arg, flags=flags): - if flags != 0: - # Don't print the regex flags if the flags are not - # specified in the OAS document. - cls._raise_validation_error_message_oapg( - value=arg, - constraint_msg="must match regular expression", - constraint_value=regex_dict['pattern'], - path_to_item=validation_metadata.path_to_item, - additional_txt=" with flags=`{}`".format(flags) - ) - cls._raise_validation_error_message_oapg( - value=arg, - constraint_msg="must match regular expression", - constraint_value=regex_dict['pattern'], - path_to_item=validation_metadata.path_to_item - ) - - @classmethod - def _validate_oapg( - cls, - arg, - validation_metadata: ValidationMetadata, - ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]]: - """ - StrBase _validate_oapg - Validates that validations pass - """ - if isinstance(arg, str): - cls.__check_str_validations(arg, validation_metadata) - return super()._validate_oapg(arg, validation_metadata=validation_metadata) - - -class UUIDBase: - @property - @functools.lru_cache() - def as_uuid_oapg(self) -> uuid.UUID: - return uuid.UUID(self) - - @classmethod - def __validate_format(cls, arg: typing.Optional[str], validation_metadata: ValidationMetadata): - if isinstance(arg, str): - try: - uuid.UUID(arg) - return True - except ValueError: - raise ApiValueError( - "Invalid value '{}' for type UUID at {}".format(arg, validation_metadata.path_to_item) - ) - - @classmethod - def _validate_oapg( - cls, - arg, - validation_metadata: typing.Optional[ValidationMetadata] = None, - ): - """ - UUIDBase _validate_oapg - """ - cls.__validate_format(arg, validation_metadata=validation_metadata) - return super()._validate_oapg(arg, validation_metadata=validation_metadata) - - -class CustomIsoparser(isoparser): - - @_takes_ascii - def parse_isodatetime(self, dt_str): - components, pos = self._parse_isodate(dt_str) - if len(dt_str) > pos: - if self._sep is None or dt_str[pos:pos + 1] == self._sep: - components += self._parse_isotime(dt_str[pos + 1:]) - else: - raise ValueError('String contains unknown ISO components') - - if len(components) > 3 and components[3] == 24: - components[3] = 0 - return datetime(*components) + timedelta(days=1) - - if len(components) <= 3: - raise ValueError('Value is not a datetime') - - return datetime(*components) - - @_takes_ascii - def parse_isodate(self, datestr): - components, pos = self._parse_isodate(datestr) - - if len(datestr) > pos: - raise ValueError('String contains invalid time components') - - if len(components) > 3: - raise ValueError('String contains invalid time components') - - return date(*components) - - -DEFAULT_ISOPARSER = CustomIsoparser() - - -class DateBase: - @property - @functools.lru_cache() - def as_date_oapg(self) -> date: - return DEFAULT_ISOPARSER.parse_isodate(self) - - @classmethod - def __validate_format(cls, arg: typing.Optional[str], validation_metadata: ValidationMetadata): - if isinstance(arg, str): - try: - DEFAULT_ISOPARSER.parse_isodate(arg) - return True - except ValueError: - raise ApiValueError( - "Value does not conform to the required ISO-8601 date format. " - "Invalid value '{}' for type date at {}".format(arg, validation_metadata.path_to_item) - ) - - @classmethod - def _validate_oapg( - cls, - arg, - validation_metadata: typing.Optional[ValidationMetadata] = None, - ): - """ - DateBase _validate_oapg - """ - cls.__validate_format(arg, validation_metadata=validation_metadata) - return super()._validate_oapg(arg, validation_metadata=validation_metadata) - - -class DateTimeBase: - @property - @functools.lru_cache() - def as_datetime_oapg(self) -> datetime: - return DEFAULT_ISOPARSER.parse_isodatetime(self) - - @classmethod - def __validate_format(cls, arg: typing.Optional[str], validation_metadata: ValidationMetadata): - if isinstance(arg, str): - try: - DEFAULT_ISOPARSER.parse_isodatetime(arg) - return True - except ValueError: - raise ApiValueError( - "Value does not conform to the required ISO-8601 datetime format. " - "Invalid value '{}' for type datetime at {}".format(arg, validation_metadata.path_to_item) - ) - - @classmethod - def _validate_oapg( - cls, - arg, - validation_metadata: ValidationMetadata, - ): - """ - DateTimeBase _validate_oapg - """ - cls.__validate_format(arg, validation_metadata=validation_metadata) - return super()._validate_oapg(arg, validation_metadata=validation_metadata) - - -class DecimalBase: - """ - A class for storing decimals that are sent over the wire as strings - These schemas must remain based on StrBase rather than NumberBase - because picking base classes must be deterministic - """ - - @property - @functools.lru_cache() - def as_decimal_oapg(self) -> decimal.Decimal: - return decimal.Decimal(self) - - @classmethod - def __validate_format(cls, arg: typing.Optional[str], validation_metadata: ValidationMetadata): - if isinstance(arg, str): - try: - decimal.Decimal(arg) - return True - except decimal.InvalidOperation: - raise ApiValueError( - "Value cannot be converted to a decimal. " - "Invalid value '{}' for type decimal at {}".format(arg, validation_metadata.path_to_item) - ) - - @classmethod - def _validate_oapg( - cls, - arg, - validation_metadata: ValidationMetadata, - ): - """ - DecimalBase _validate_oapg - """ - cls.__validate_format(arg, validation_metadata=validation_metadata) - return super()._validate_oapg(arg, validation_metadata=validation_metadata) - - -class NumberBase(ValidatorBase): - MetaOapg: MetaOapgTyped - - @property - def as_int_oapg(self) -> int: - try: - return self._as_int - except AttributeError: - """ - Note: for some numbers like 9.0 they could be represented as an - integer but our code chooses to store them as - >>> Decimal('9.0').as_tuple() - DecimalTuple(sign=0, digits=(9, 0), exponent=-1) - so we can tell that the value came from a float and convert it back to a float - during later serialization - """ - if self.as_tuple().exponent < 0: - # this could be represented as an integer but should be represented as a float - # because that's what it was serialized from - raise ApiValueError(f'{self} is not an integer') - self._as_int = int(self) - return self._as_int - - @property - def as_float_oapg(self) -> float: - try: - return self._as_float - except AttributeError: - if self.as_tuple().exponent >= 0: - raise ApiValueError(f'{self} is not a float') - self._as_float = float(self) - return self._as_float - - @classmethod - def __check_numeric_validations( - cls, - arg, - validation_metadata: ValidationMetadata - ): - if not hasattr(cls, 'MetaOapg'): - return - if cls._is_json_validation_enabled_oapg('multipleOf', - validation_metadata.configuration) and hasattr(cls.MetaOapg, 'multiple_of'): - multiple_of_value = cls.MetaOapg.multiple_of - if (not (float(arg) / multiple_of_value).is_integer()): - # Note 'multipleOf' will be as good as the floating point arithmetic. - cls._raise_validation_error_message_oapg( - value=arg, - constraint_msg="value must be a multiple of", - constraint_value=multiple_of_value, - path_to_item=validation_metadata.path_to_item - ) - - checking_max_or_min_values = any( - hasattr(cls.MetaOapg, validation_key) for validation_key in { - 'exclusive_maximum', - 'inclusive_maximum', - 'exclusive_minimum', - 'inclusive_minimum', - } - ) - if not checking_max_or_min_values: - return - - if (cls._is_json_validation_enabled_oapg('exclusiveMaximum', validation_metadata.configuration) and - hasattr(cls.MetaOapg, 'exclusive_maximum') and - arg >= cls.MetaOapg.exclusive_maximum): - cls._raise_validation_error_message_oapg( - value=arg, - constraint_msg="must be a value less than", - constraint_value=cls.MetaOapg.exclusive_maximum, - path_to_item=validation_metadata.path_to_item - ) - - if (cls._is_json_validation_enabled_oapg('maximum', validation_metadata.configuration) and - hasattr(cls.MetaOapg, 'inclusive_maximum') and - arg > cls.MetaOapg.inclusive_maximum): - cls._raise_validation_error_message_oapg( - value=arg, - constraint_msg="must be a value less than or equal to", - constraint_value=cls.MetaOapg.inclusive_maximum, - path_to_item=validation_metadata.path_to_item - ) - - if (cls._is_json_validation_enabled_oapg('exclusiveMinimum', validation_metadata.configuration) and - hasattr(cls.MetaOapg, 'exclusive_minimum') and - arg <= cls.MetaOapg.exclusive_minimum): - cls._raise_validation_error_message_oapg( - value=arg, - constraint_msg="must be a value greater than", - constraint_value=cls.MetaOapg.exclusive_maximum, - path_to_item=validation_metadata.path_to_item - ) - - if (cls._is_json_validation_enabled_oapg('minimum', validation_metadata.configuration) and - hasattr(cls.MetaOapg, 'inclusive_minimum') and - arg < cls.MetaOapg.inclusive_minimum): - cls._raise_validation_error_message_oapg( - value=arg, - constraint_msg="must be a value greater than or equal to", - constraint_value=cls.MetaOapg.inclusive_minimum, - path_to_item=validation_metadata.path_to_item - ) - - @classmethod - def _validate_oapg( - cls, - arg, - validation_metadata: ValidationMetadata, - ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]]: - """ - NumberBase _validate_oapg - Validates that validations pass - """ - if isinstance(arg, decimal.Decimal): - cls.__check_numeric_validations(arg, validation_metadata) - return super()._validate_oapg(arg, validation_metadata=validation_metadata) - - -class ListBase(ValidatorBase): - MetaOapg: MetaOapgTyped - - @classmethod - def __validate_items(cls, list_items, validation_metadata: ValidationMetadata): - """ - Ensures that: - - values passed in for items are valid - Exceptions will be raised if: - - invalid arguments were passed in - - Args: - list_items: the input list of items - - Raises: - ApiTypeError - for missing required arguments, or for invalid properties - """ - - # if we have definitions for an items schema, use it - # otherwise accept anything - item_cls = getattr(cls.MetaOapg, 'items', UnsetAnyTypeSchema) - item_cls = cls._get_class_oapg(item_cls) - path_to_schemas = {} - for i, value in enumerate(list_items): - item_validation_metadata = ValidationMetadata( - from_server=validation_metadata.from_server, - configuration=validation_metadata.configuration, - path_to_item=validation_metadata.path_to_item+(i,), - validated_path_to_schemas=validation_metadata.validated_path_to_schemas - ) - if item_validation_metadata.validation_ran_earlier(item_cls): - add_deeper_validated_schemas(item_validation_metadata, path_to_schemas) - continue - other_path_to_schemas = item_cls._validate_oapg( - value, validation_metadata=item_validation_metadata) - update(path_to_schemas, other_path_to_schemas) - return path_to_schemas - - @classmethod - def __check_tuple_validations( - cls, arg, - validation_metadata: ValidationMetadata): - if not hasattr(cls, 'MetaOapg'): - return - if (cls._is_json_validation_enabled_oapg('maxItems', validation_metadata.configuration) and - hasattr(cls.MetaOapg, 'max_items') and - len(arg) > cls.MetaOapg.max_items): - cls._raise_validation_error_message_oapg( - value=arg, - constraint_msg="number of items must be less than or equal to", - constraint_value=cls.MetaOapg.max_items, - path_to_item=validation_metadata.path_to_item - ) - - if (cls._is_json_validation_enabled_oapg('minItems', validation_metadata.configuration) and - hasattr(cls.MetaOapg, 'min_items') and - len(arg) < cls.MetaOapg.min_items): - cls._raise_validation_error_message_oapg( - value=arg, - constraint_msg="number of items must be greater than or equal to", - constraint_value=cls.MetaOapg.min_items, - path_to_item=validation_metadata.path_to_item - ) - - if (cls._is_json_validation_enabled_oapg('uniqueItems', validation_metadata.configuration) and - hasattr(cls.MetaOapg, 'unique_items') and cls.MetaOapg.unique_items and arg): - unique_items = set(arg) - if len(arg) > len(unique_items): - cls._raise_validation_error_message_oapg( - value=arg, - constraint_msg="duplicate items were found, and the tuple must not contain duplicates because", - constraint_value='unique_items==True', - path_to_item=validation_metadata.path_to_item - ) - - @classmethod - def _validate_oapg( - cls, - arg, - validation_metadata: ValidationMetadata, - ): - """ - ListBase _validate_oapg - We return dynamic classes of different bases depending upon the inputs - This makes it so: - - the returned instance is always a subclass of our defining schema - - this allows us to check type based on whether an instance is a subclass of a schema - - the returned instance is a serializable type (except for None, True, and False) which are enums - - Returns: - new_cls (type): the new class - - Raises: - ApiValueError: when a string can't be converted into a date or datetime and it must be one of those classes - ApiTypeError: when the input type is not in the list of allowed spec types - """ - if isinstance(arg, tuple): - cls.__check_tuple_validations(arg, validation_metadata) - _path_to_schemas = super()._validate_oapg(arg, validation_metadata=validation_metadata) - if not isinstance(arg, tuple): - return _path_to_schemas - updated_vm = ValidationMetadata( - configuration=validation_metadata.configuration, - from_server=validation_metadata.from_server, - path_to_item=validation_metadata.path_to_item, - seen_classes=validation_metadata.seen_classes | frozenset({cls}), - validated_path_to_schemas=validation_metadata.validated_path_to_schemas - ) - other_path_to_schemas = cls.__validate_items(arg, validation_metadata=updated_vm) - update(_path_to_schemas, other_path_to_schemas) - return _path_to_schemas - - @classmethod - def _get_items_oapg( - cls: 'Schema', - arg: typing.List[typing.Any], - path_to_item: typing.Tuple[typing.Union[str, int], ...], - path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Type['Schema']] - ): - ''' - ListBase _get_items_oapg - ''' - cast_items = [] - - for i, value in enumerate(arg): - item_path_to_item = path_to_item + (i,) - item_cls = path_to_schemas[item_path_to_item] - new_value = item_cls._get_new_instance_without_conversion_oapg( - value, - item_path_to_item, - path_to_schemas - ) - cast_items.append(new_value) - - return cast_items - - -class Discriminable: - MetaOapg: MetaOapgTyped - - @classmethod - def _ensure_discriminator_value_present_oapg(cls, disc_property_name: str, validation_metadata: ValidationMetadata, *args): - if not args or args and disc_property_name not in args[0]: - # The input data does not contain the discriminator property - raise ApiValueError( - "Cannot deserialize input data due to missing discriminator. " - "The discriminator property '{}' is missing at path: {}".format(disc_property_name, validation_metadata.path_to_item) - ) - - @classmethod - def get_discriminated_class_oapg(cls, disc_property_name: str, disc_payload_value: str): - """ - Used in schemas with discriminators - """ - if not hasattr(cls.MetaOapg, 'discriminator'): - return None - disc = cls.MetaOapg.discriminator() - if disc_property_name not in disc: - return None - discriminated_cls = disc[disc_property_name].get(disc_payload_value) - if discriminated_cls is not None: - return discriminated_cls - if not hasattr(cls, 'MetaOapg'): - return None - elif not ( - hasattr(cls.MetaOapg, 'all_of') or - hasattr(cls.MetaOapg, 'one_of') or - hasattr(cls.MetaOapg, 'any_of') - ): - return None - # TODO stop traveling if a cycle is hit - if hasattr(cls.MetaOapg, 'all_of'): - for allof_cls in cls.MetaOapg.all_of(): - discriminated_cls = allof_cls.get_discriminated_class_oapg( - disc_property_name=disc_property_name, disc_payload_value=disc_payload_value) - if discriminated_cls is not None: - return discriminated_cls - if hasattr(cls.MetaOapg, 'one_of'): - for oneof_cls in cls.MetaOapg.one_of(): - discriminated_cls = oneof_cls.get_discriminated_class_oapg( - disc_property_name=disc_property_name, disc_payload_value=disc_payload_value) - if discriminated_cls is not None: - return discriminated_cls - if hasattr(cls.MetaOapg, 'any_of'): - for anyof_cls in cls.MetaOapg.any_of(): - discriminated_cls = anyof_cls.get_discriminated_class_oapg( - disc_property_name=disc_property_name, disc_payload_value=disc_payload_value) - if discriminated_cls is not None: - return discriminated_cls - return None - - -class DictBase(Discriminable, ValidatorBase): - - @classmethod - def __validate_arg_presence(cls, arg): - """ - Ensures that: - - all required arguments are passed in - - the input variable names are valid - - present in properties or - - accepted because additionalProperties exists - Exceptions will be raised if: - - invalid arguments were passed in - - a var_name is invalid if additional_properties == NotAnyTypeSchema - and var_name not in properties.__annotations__ - - required properties were not passed in - - Args: - arg: the input dict - - Raises: - ApiTypeError - for missing required arguments, or for invalid properties - """ - seen_required_properties = set() - invalid_arguments = [] - required_property_names = getattr(cls.MetaOapg, 'required', set()) - additional_properties = getattr(cls.MetaOapg, 'additional_properties', UnsetAnyTypeSchema) - properties = getattr(cls.MetaOapg, 'properties', {}) - property_annotations = getattr(properties, '__annotations__', {}) - for property_name in arg: - if property_name in required_property_names: - seen_required_properties.add(property_name) - elif property_name in property_annotations: - continue - elif additional_properties is not NotAnyTypeSchema: - continue - else: - invalid_arguments.append(property_name) - missing_required_arguments = list(required_property_names - seen_required_properties) - if missing_required_arguments: - missing_required_arguments.sort() - raise ApiTypeError( - "{} is missing {} required argument{}: {}".format( - cls.__name__, - len(missing_required_arguments), - "s" if len(missing_required_arguments) > 1 else "", - missing_required_arguments - ) - ) - if invalid_arguments: - invalid_arguments.sort() - raise ApiTypeError( - "{} was passed {} invalid argument{}: {}".format( - cls.__name__, - len(invalid_arguments), - "s" if len(invalid_arguments) > 1 else "", - invalid_arguments - ) - ) - - @classmethod - def __validate_args(cls, arg, validation_metadata: ValidationMetadata): - """ - Ensures that: - - values passed in for properties are valid - Exceptions will be raised if: - - invalid arguments were passed in - - Args: - arg: the input dict - - Raises: - ApiTypeError - for missing required arguments, or for invalid properties - """ - path_to_schemas = {} - additional_properties = getattr(cls.MetaOapg, 'additional_properties', UnsetAnyTypeSchema) - properties = getattr(cls.MetaOapg, 'properties', {}) - property_annotations = getattr(properties, '__annotations__', {}) - for property_name, value in arg.items(): - path_to_item = validation_metadata.path_to_item+(property_name,) - if property_name in property_annotations: - schema = property_annotations[property_name] - elif additional_properties is not NotAnyTypeSchema: - if additional_properties is UnsetAnyTypeSchema: - """ - If additionalProperties is unset and this path_to_item does not yet have - any validations on it, validate it. - If it already has validations on it, skip this validation. - """ - if path_to_item in path_to_schemas: - continue - schema = additional_properties - else: - raise ApiTypeError('Unable to find schema for value={} in class={} at path_to_item={}'.format( - value, cls, validation_metadata.path_to_item+(property_name,) - )) - schema = cls._get_class_oapg(schema) - arg_validation_metadata = ValidationMetadata( - from_server=validation_metadata.from_server, - configuration=validation_metadata.configuration, - path_to_item=path_to_item, - validated_path_to_schemas=validation_metadata.validated_path_to_schemas - ) - if arg_validation_metadata.validation_ran_earlier(schema): - add_deeper_validated_schemas(arg_validation_metadata, path_to_schemas) - continue - other_path_to_schemas = schema._validate_oapg(value, validation_metadata=arg_validation_metadata) - update(path_to_schemas, other_path_to_schemas) - return path_to_schemas - - @classmethod - def __check_dict_validations( - cls, - arg, - validation_metadata: ValidationMetadata - ): - if not hasattr(cls, 'MetaOapg'): - return - if (cls._is_json_validation_enabled_oapg('maxProperties', validation_metadata.configuration) and - hasattr(cls.MetaOapg, 'max_properties') and - len(arg) > cls.MetaOapg.max_properties): - cls._raise_validation_error_message_oapg( - value=arg, - constraint_msg="number of properties must be less than or equal to", - constraint_value=cls.MetaOapg.max_properties, - path_to_item=validation_metadata.path_to_item - ) - - if (cls._is_json_validation_enabled_oapg('minProperties', validation_metadata.configuration) and - hasattr(cls.MetaOapg, 'min_properties') and - len(arg) < cls.MetaOapg.min_properties): - cls._raise_validation_error_message_oapg( - value=arg, - constraint_msg="number of properties must be greater than or equal to", - constraint_value=cls.MetaOapg.min_properties, - path_to_item=validation_metadata.path_to_item - ) - - @classmethod - def _validate_oapg( - cls, - arg, - validation_metadata: ValidationMetadata, - ): - """ - DictBase _validate_oapg - We return dynamic classes of different bases depending upon the inputs - This makes it so: - - the returned instance is always a subclass of our defining schema - - this allows us to check type based on whether an instance is a subclass of a schema - - the returned instance is a serializable type (except for None, True, and False) which are enums - - Returns: - new_cls (type): the new class - - Raises: - ApiValueError: when a string can't be converted into a date or datetime and it must be one of those classes - ApiTypeError: when the input type is not in the list of allowed spec types - """ - if isinstance(arg, frozendict.frozendict): - cls.__check_dict_validations(arg, validation_metadata) - _path_to_schemas = super()._validate_oapg(arg, validation_metadata=validation_metadata) - if not isinstance(arg, frozendict.frozendict): - return _path_to_schemas - cls.__validate_arg_presence(arg) - other_path_to_schemas = cls.__validate_args(arg, validation_metadata=validation_metadata) - update(_path_to_schemas, other_path_to_schemas) - try: - discriminator = cls.MetaOapg.discriminator() - except AttributeError: - return _path_to_schemas - # discriminator exists - disc_prop_name = list(discriminator.keys())[0] - cls._ensure_discriminator_value_present_oapg(disc_prop_name, validation_metadata, arg) - discriminated_cls = cls.get_discriminated_class_oapg( - disc_property_name=disc_prop_name, disc_payload_value=arg[disc_prop_name]) - if discriminated_cls is None: - raise ApiValueError( - "Invalid discriminator value was passed in to {}.{} Only the values {} are allowed at {}".format( - cls.__name__, - disc_prop_name, - list(discriminator[disc_prop_name].keys()), - validation_metadata.path_to_item + (disc_prop_name,) - ) - ) - updated_vm = ValidationMetadata( - configuration=validation_metadata.configuration, - from_server=validation_metadata.from_server, - path_to_item=validation_metadata.path_to_item, - seen_classes=validation_metadata.seen_classes | frozenset({cls}), - validated_path_to_schemas=validation_metadata.validated_path_to_schemas - ) - if updated_vm.validation_ran_earlier(discriminated_cls): - add_deeper_validated_schemas(updated_vm, _path_to_schemas) - return _path_to_schemas - other_path_to_schemas = discriminated_cls._validate_oapg(arg, validation_metadata=updated_vm) - update(_path_to_schemas, other_path_to_schemas) - return _path_to_schemas - - @classmethod - def _get_properties_oapg( - cls, - arg: typing.Dict[str, typing.Any], - path_to_item: typing.Tuple[typing.Union[str, int], ...], - path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Type['Schema']] - ): - """ - DictBase _get_properties_oapg, this is how properties are set - These values already passed validation - """ - dict_items = {} - - for property_name_js, value in arg.items(): - property_path_to_item = path_to_item + (property_name_js,) - property_cls = path_to_schemas[property_path_to_item] - new_value = property_cls._get_new_instance_without_conversion_oapg( - value, - property_path_to_item, - path_to_schemas - ) - dict_items[property_name_js] = new_value - - return dict_items - - def __setattr__(self, name: str, value: typing.Any): - if not isinstance(self, FileIO): - raise AttributeError('property setting not supported on immutable instances') - - def __getattr__(self, name: str): - """ - for instance.name access - Properties are only type hinted for required properties - so that hasattr(instance, 'optionalProp') is False when that key is not present - """ - if not isinstance(self, frozendict.frozendict): - return super().__getattr__(name) - if name not in self.__class__.__annotations__: - raise AttributeError(f"{self} has no attribute '{name}'") - try: - value = self[name] - return value - except KeyError as ex: - raise AttributeError(str(ex)) - - def __getitem__(self, name: str): - """ - dict_instance[name] accessor - key errors thrown - """ - if not isinstance(self, frozendict.frozendict): - return super().__getattr__(name) - return super().__getitem__(name) - - def get_item_oapg(self, name: str) -> typing.Union['AnyTypeSchema', Unset]: - # dict_instance[name] accessor - if not isinstance(self, frozendict.frozendict): - raise NotImplementedError() - try: - return super().__getitem__(name) - except KeyError: - return unset - - -def cast_to_allowed_types( - arg: typing.Union[str, date, datetime, uuid.UUID, decimal.Decimal, int, float, None, dict, frozendict.frozendict, list, tuple, bytes, Schema, io.FileIO, io.BufferedReader], - from_server: bool, - validated_path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]], - path_to_item: typing.Tuple[typing.Union[str, int], ...] = tuple(['args[0]']), -) -> typing.Union[frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO]: - """ - Casts the input payload arg into the allowed types - The input validated_path_to_schemas is mutated by running this function - - When from_server is False then - - date/datetime is cast to str - - int/float is cast to Decimal - - If a Schema instance is passed in it is converted back to a primitive instance because - One may need to validate that data to the original Schema class AND additional different classes - those additional classes will need to be added to the new manufactured class for that payload - If the code didn't do this and kept the payload as a Schema instance it would fail to validate to other - Schema classes and the code wouldn't be able to mfg a new class that includes all valid schemas - TODO: store the validated schema classes in validation_metadata - - Args: - arg: the payload - from_server: whether this payload came from the server or not - validated_path_to_schemas: a dict that stores the validated classes at any path location in the payload - """ - if isinstance(arg, Schema): - # store the already run validations - schema_classes = set() - for cls in arg.__class__.__bases__: - if cls is Singleton: - # Skip Singleton - continue - schema_classes.add(cls) - validated_path_to_schemas[path_to_item] = schema_classes - - type_error = ApiTypeError(f"Invalid type. Required value type is str and passed type was {type(arg)} at {path_to_item}") - if isinstance(arg, str): - return str(arg) - elif isinstance(arg, (dict, frozendict.frozendict)): - return frozendict.frozendict({key: cast_to_allowed_types(val, from_server, validated_path_to_schemas, path_to_item + (key,)) for key, val in arg.items()}) - elif isinstance(arg, (bool, BoolClass)): - """ - this check must come before isinstance(arg, (int, float)) - because isinstance(True, int) is True - """ - if arg: - return BoolClass.TRUE - return BoolClass.FALSE - elif isinstance(arg, int): - return decimal.Decimal(arg) - elif isinstance(arg, float): - decimal_from_float = decimal.Decimal(arg) - if decimal_from_float.as_integer_ratio()[1] == 1: - # 9.0 -> Decimal('9.0') - # 3.4028234663852886e+38 -> Decimal('340282346638528859811704183484516925440.0') - return decimal.Decimal(str(decimal_from_float)+'.0') - return decimal_from_float - elif isinstance(arg, (tuple, list)): - return tuple([cast_to_allowed_types(item, from_server, validated_path_to_schemas, path_to_item + (i,)) for i, item in enumerate(arg)]) - elif isinstance(arg, (none_type, NoneClass)): - return NoneClass.NONE - elif isinstance(arg, (date, datetime)): - if not from_server: - return arg.isoformat() - raise type_error - elif isinstance(arg, uuid.UUID): - if not from_server: - return str(arg) - raise type_error - elif isinstance(arg, decimal.Decimal): - return decimal.Decimal(arg) - elif isinstance(arg, bytes): - return bytes(arg) - elif isinstance(arg, (io.FileIO, io.BufferedReader)): - return FileIO(arg) - raise ValueError('Invalid type passed in got input={} type={}'.format(arg, type(arg))) - - -class ComposedBase(Discriminable): - - @classmethod - def __get_allof_classes(cls, arg, validation_metadata: ValidationMetadata): - path_to_schemas = defaultdict(set) - for allof_cls in cls.MetaOapg.all_of(): - if validation_metadata.validation_ran_earlier(allof_cls): - add_deeper_validated_schemas(validation_metadata, path_to_schemas) - continue - other_path_to_schemas = allof_cls._validate_oapg(arg, validation_metadata=validation_metadata) - update(path_to_schemas, other_path_to_schemas) - return path_to_schemas - - @classmethod - def __get_oneof_class( - cls, - arg, - discriminated_cls, - validation_metadata: ValidationMetadata, - ): - oneof_classes = [] - path_to_schemas = defaultdict(set) - for oneof_cls in cls.MetaOapg.one_of(): - if oneof_cls in path_to_schemas[validation_metadata.path_to_item]: - oneof_classes.append(oneof_cls) - continue - if validation_metadata.validation_ran_earlier(oneof_cls): - oneof_classes.append(oneof_cls) - add_deeper_validated_schemas(validation_metadata, path_to_schemas) - continue - try: - path_to_schemas = oneof_cls._validate_oapg(arg, validation_metadata=validation_metadata) - except (ApiValueError, ApiTypeError) as ex: - if discriminated_cls is not None and oneof_cls is discriminated_cls: - raise ex - continue - oneof_classes.append(oneof_cls) - if not oneof_classes: - raise ApiValueError( - "Invalid inputs given to generate an instance of {}. None " - "of the oneOf schemas matched the input data.".format(cls) - ) - elif len(oneof_classes) > 1: - raise ApiValueError( - "Invalid inputs given to generate an instance of {}. Multiple " - "oneOf schemas {} matched the inputs, but a max of one is allowed.".format(cls, oneof_classes) - ) - # exactly one class matches - return path_to_schemas - - @classmethod - def __get_anyof_classes( - cls, - arg, - discriminated_cls, - validation_metadata: ValidationMetadata - ): - anyof_classes = [] - path_to_schemas = defaultdict(set) - for anyof_cls in cls.MetaOapg.any_of(): - if validation_metadata.validation_ran_earlier(anyof_cls): - anyof_classes.append(anyof_cls) - add_deeper_validated_schemas(validation_metadata, path_to_schemas) - continue - - try: - other_path_to_schemas = anyof_cls._validate_oapg(arg, validation_metadata=validation_metadata) - except (ApiValueError, ApiTypeError) as ex: - if discriminated_cls is not None and anyof_cls is discriminated_cls: - raise ex - continue - anyof_classes.append(anyof_cls) - update(path_to_schemas, other_path_to_schemas) - if not anyof_classes: - raise ApiValueError( - "Invalid inputs given to generate an instance of {}. None " - "of the anyOf schemas matched the input data.".format(cls) - ) - return path_to_schemas - - @classmethod - def _validate_oapg( - cls, - arg, - validation_metadata: ValidationMetadata, - ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]]: - """ - ComposedBase _validate_oapg - We return dynamic classes of different bases depending upon the inputs - This makes it so: - - the returned instance is always a subclass of our defining schema - - this allows us to check type based on whether an instance is a subclass of a schema - - the returned instance is a serializable type (except for None, True, and False) which are enums - - Returns: - new_cls (type): the new class - - Raises: - ApiValueError: when a string can't be converted into a date or datetime and it must be one of those classes - ApiTypeError: when the input type is not in the list of allowed spec types - """ - # validation checking on types, validations, and enums - path_to_schemas = super()._validate_oapg(arg, validation_metadata=validation_metadata) - - updated_vm = ValidationMetadata( - configuration=validation_metadata.configuration, - from_server=validation_metadata.from_server, - path_to_item=validation_metadata.path_to_item, - seen_classes=validation_metadata.seen_classes | frozenset({cls}), - validated_path_to_schemas=validation_metadata.validated_path_to_schemas - ) - - # process composed schema - discriminator = None - if hasattr(cls, 'MetaOapg') and hasattr(cls.MetaOapg, 'discriminator'): - discriminator = cls.MetaOapg.discriminator() - discriminated_cls = None - if discriminator and arg and isinstance(arg, frozendict.frozendict): - disc_property_name = list(discriminator.keys())[0] - cls._ensure_discriminator_value_present_oapg(disc_property_name, updated_vm, arg) - # get discriminated_cls by looking at the dict in the current class - discriminated_cls = cls.get_discriminated_class_oapg( - disc_property_name=disc_property_name, disc_payload_value=arg[disc_property_name]) - if discriminated_cls is None: - raise ApiValueError( - "Invalid discriminator value '{}' was passed in to {}.{} Only the values {} are allowed at {}".format( - arg[disc_property_name], - cls.__name__, - disc_property_name, - list(discriminator[disc_property_name].keys()), - updated_vm.path_to_item + (disc_property_name,) - ) - ) - - if hasattr(cls, 'MetaOapg') and hasattr(cls.MetaOapg, 'all_of'): - other_path_to_schemas = cls.__get_allof_classes(arg, validation_metadata=updated_vm) - update(path_to_schemas, other_path_to_schemas) - if hasattr(cls, 'MetaOapg') and hasattr(cls.MetaOapg, 'one_of'): - other_path_to_schemas = cls.__get_oneof_class( - arg, - discriminated_cls=discriminated_cls, - validation_metadata=updated_vm - ) - update(path_to_schemas, other_path_to_schemas) - if hasattr(cls, 'MetaOapg') and hasattr(cls.MetaOapg, 'any_of'): - other_path_to_schemas = cls.__get_anyof_classes( - arg, - discriminated_cls=discriminated_cls, - validation_metadata=updated_vm - ) - update(path_to_schemas, other_path_to_schemas) - not_cls = None - if hasattr(cls, 'MetaOapg') and hasattr(cls.MetaOapg, 'not_schema'): - not_cls = cls.MetaOapg.not_schema - not_cls = cls._get_class_oapg(not_cls) - if not_cls: - other_path_to_schemas = None - not_exception = ApiValueError( - "Invalid value '{}' was passed in to {}. Value is invalid because it is disallowed by {}".format( - arg, - cls.__name__, - not_cls.__name__, - ) - ) - if updated_vm.validation_ran_earlier(not_cls): - raise not_exception - - try: - other_path_to_schemas = not_cls._validate_oapg(arg, validation_metadata=updated_vm) - except (ApiValueError, ApiTypeError): - pass - if other_path_to_schemas: - raise not_exception - - if discriminated_cls is not None and not updated_vm.validation_ran_earlier(discriminated_cls): - # TODO use an exception from this package here - add_deeper_validated_schemas(updated_vm, path_to_schemas) - assert discriminated_cls in path_to_schemas[updated_vm.path_to_item] - return path_to_schemas - - -# DictBase, ListBase, NumberBase, StrBase, BoolBase, NoneBase -class ComposedSchema( - ComposedBase, - DictBase, - ListBase, - NumberBase, - StrBase, - BoolBase, - NoneBase, - Schema, - NoneFrozenDictTupleStrDecimalBoolMixin -): - @classmethod - def from_openapi_data_oapg(cls, *args: typing.Any, _configuration: typing.Optional[Configuration] = None, **kwargs): - if not args: - if not kwargs: - raise ApiTypeError('{} is missing required input data in args or kwargs'.format(cls.__name__)) - args = (kwargs, ) - return super().from_openapi_data_oapg(args[0], _configuration=_configuration) - - -class ListSchema( - ListBase, - Schema, - TupleMixin -): - - @classmethod - def from_openapi_data_oapg(cls, arg: typing.List[typing.Any], _configuration: typing.Optional[Configuration] = None): - return super().from_openapi_data_oapg(arg, _configuration=_configuration) - - def __new__(cls, _arg: typing.Union[typing.List[typing.Any], typing.Tuple[typing.Any]], **kwargs: Configuration): - return super().__new__(cls, _arg, **kwargs) - - -class NoneSchema( - NoneBase, - Schema, - NoneMixin -): - - @classmethod - def from_openapi_data_oapg(cls, arg: None, _configuration: typing.Optional[Configuration] = None): - return super().from_openapi_data_oapg(arg, _configuration=_configuration) - - def __new__(cls, _arg: None, **kwargs: Configuration): - return super().__new__(cls, _arg, **kwargs) - - -class NumberSchema( - NumberBase, - Schema, - DecimalMixin -): - """ - This is used for type: number with no format - Both integers AND floats are accepted - """ - - @classmethod - def from_openapi_data_oapg(cls, arg: typing.Union[int, float], _configuration: typing.Optional[Configuration] = None): - return super().from_openapi_data_oapg(arg, _configuration=_configuration) - - def __new__(cls, _arg: typing.Union[decimal.Decimal, int, float], **kwargs: Configuration): - return super().__new__(cls, _arg, **kwargs) - - -class IntBase: - @property - def as_int_oapg(self) -> int: - try: - return self._as_int - except AttributeError: - self._as_int = int(self) - return self._as_int - - @classmethod - def __validate_format(cls, arg: typing.Optional[decimal.Decimal], validation_metadata: ValidationMetadata): - if isinstance(arg, decimal.Decimal): - - denominator = arg.as_integer_ratio()[-1] - if denominator != 1: - raise ApiValueError( - "Invalid value '{}' for type integer at {}".format(arg, validation_metadata.path_to_item) - ) - - @classmethod - def _validate_oapg( - cls, - arg, - validation_metadata: ValidationMetadata, - ): - """ - IntBase _validate_oapg - TODO what about types = (int, number) -> IntBase, NumberBase? We could drop int and keep number only - """ - cls.__validate_format(arg, validation_metadata=validation_metadata) - return super()._validate_oapg(arg, validation_metadata=validation_metadata) - - -class IntSchema(IntBase, NumberSchema): - - @classmethod - def from_openapi_data_oapg(cls, arg: int, _configuration: typing.Optional[Configuration] = None): - return super().from_openapi_data_oapg(arg, _configuration=_configuration) - - def __new__(cls, _arg: typing.Union[decimal.Decimal, int], **kwargs: Configuration): - return super().__new__(cls, _arg, **kwargs) - - -class Int32Base: - __inclusive_minimum = decimal.Decimal(-2147483648) - __inclusive_maximum = decimal.Decimal(2147483647) - - @classmethod - def __validate_format(cls, arg: typing.Optional[decimal.Decimal], validation_metadata: ValidationMetadata): - if isinstance(arg, decimal.Decimal) and arg.as_tuple().exponent == 0: - if not cls.__inclusive_minimum <= arg <= cls.__inclusive_maximum: - raise ApiValueError( - "Invalid value '{}' for type int32 at {}".format(arg, validation_metadata.path_to_item) - ) - - @classmethod - def _validate_oapg( - cls, - arg, - validation_metadata: ValidationMetadata, - ): - """ - Int32Base _validate_oapg - """ - cls.__validate_format(arg, validation_metadata=validation_metadata) - return super()._validate_oapg(arg, validation_metadata=validation_metadata) - - -class Int32Schema( - Int32Base, - IntSchema -): - pass - - -class Int64Base: - __inclusive_minimum = decimal.Decimal(-9223372036854775808) - __inclusive_maximum = decimal.Decimal(9223372036854775807) - - @classmethod - def __validate_format(cls, arg: typing.Optional[decimal.Decimal], validation_metadata: ValidationMetadata): - if isinstance(arg, decimal.Decimal) and arg.as_tuple().exponent == 0: - if not cls.__inclusive_minimum <= arg <= cls.__inclusive_maximum: - raise ApiValueError( - "Invalid value '{}' for type int64 at {}".format(arg, validation_metadata.path_to_item) - ) - - @classmethod - def _validate_oapg( - cls, - arg, - validation_metadata: ValidationMetadata, - ): - """ - Int64Base _validate_oapg - """ - cls.__validate_format(arg, validation_metadata=validation_metadata) - return super()._validate_oapg(arg, validation_metadata=validation_metadata) - - -class Int64Schema( - Int64Base, - IntSchema -): - pass - - -class Float32Base: - __inclusive_minimum = decimal.Decimal(-3.4028234663852886e+38) - __inclusive_maximum = decimal.Decimal(3.4028234663852886e+38) - - @classmethod - def __validate_format(cls, arg: typing.Optional[decimal.Decimal], validation_metadata: ValidationMetadata): - if isinstance(arg, decimal.Decimal): - if not cls.__inclusive_minimum <= arg <= cls.__inclusive_maximum: - raise ApiValueError( - "Invalid value '{}' for type float at {}".format(arg, validation_metadata.path_to_item) - ) - - @classmethod - def _validate_oapg( - cls, - arg, - validation_metadata: ValidationMetadata, - ): - """ - Float32Base _validate_oapg - """ - cls.__validate_format(arg, validation_metadata=validation_metadata) - return super()._validate_oapg(arg, validation_metadata=validation_metadata) - - -class Float32Schema( - Float32Base, - NumberSchema -): - - @classmethod - def from_openapi_data_oapg(cls, arg: float, _configuration: typing.Optional[Configuration] = None): - return super().from_openapi_data_oapg(arg, _configuration=_configuration) - - -class Float64Base: - __inclusive_minimum = decimal.Decimal(-1.7976931348623157E+308) - __inclusive_maximum = decimal.Decimal(1.7976931348623157E+308) - - @classmethod - def __validate_format(cls, arg: typing.Optional[decimal.Decimal], validation_metadata: ValidationMetadata): - if isinstance(arg, decimal.Decimal): - if not cls.__inclusive_minimum <= arg <= cls.__inclusive_maximum: - raise ApiValueError( - "Invalid value '{}' for type double at {}".format(arg, validation_metadata.path_to_item) - ) - - @classmethod - def _validate_oapg( - cls, - arg, - validation_metadata: ValidationMetadata, - ): - """ - Float64Base _validate_oapg - """ - cls.__validate_format(arg, validation_metadata=validation_metadata) - return super()._validate_oapg(arg, validation_metadata=validation_metadata) - -class Float64Schema( - Float64Base, - NumberSchema -): - - @classmethod - def from_openapi_data_oapg(cls, arg: float, _configuration: typing.Optional[Configuration] = None): - # todo check format - return super().from_openapi_data_oapg(arg, _configuration=_configuration) - - -class StrSchema( - StrBase, - Schema, - StrMixin -): - """ - date + datetime string types must inherit from this class - That is because one can validate a str payload as both: - - type: string (format unset) - - type: string, format: date - """ - - @classmethod - def from_openapi_data_oapg(cls, arg: str, _configuration: typing.Optional[Configuration] = None) -> 'StrSchema': - return super().from_openapi_data_oapg(arg, _configuration=_configuration) - - def __new__(cls, _arg: typing.Union[str, date, datetime, uuid.UUID], **kwargs: Configuration): - return super().__new__(cls, _arg, **kwargs) - - -class UUIDSchema(UUIDBase, StrSchema): - - def __new__(cls, _arg: typing.Union[str, uuid.UUID], **kwargs: Configuration): - return super().__new__(cls, _arg, **kwargs) - - -class DateSchema(DateBase, StrSchema): - - def __new__(cls, _arg: typing.Union[str, date], **kwargs: Configuration): - return super().__new__(cls, _arg, **kwargs) - - -class DateTimeSchema(DateTimeBase, StrSchema): - - def __new__(cls, _arg: typing.Union[str, datetime], **kwargs: Configuration): - return super().__new__(cls, _arg, **kwargs) - - -class DecimalSchema(DecimalBase, StrSchema): - - def __new__(cls, _arg: str, **kwargs: Configuration): - """ - Note: Decimals may not be passed in because cast_to_allowed_types is only invoked once for payloads - which can be simple (str) or complex (dicts or lists with nested values) - Because casting is only done once and recursively casts all values prior to validation then for a potential - client side Decimal input if Decimal was accepted as an input in DecimalSchema then one would not know - if one was using it for a StrSchema (where it should be cast to str) or one is using it for NumberSchema - where it should stay as Decimal. - """ - return super().__new__(cls, _arg, **kwargs) - - -class BytesSchema( - Schema, - BytesMixin -): - """ - this class will subclass bytes and is immutable - """ - def __new__(cls, _arg: bytes, **kwargs: Configuration): - return super(Schema, cls).__new__(cls, _arg) - - -class FileSchema( - Schema, - FileMixin -): - """ - This class is NOT immutable - Dynamic classes are built using it for example when AnyType allows in binary data - Al other schema classes ARE immutable - If one wanted to make this immutable one could make this a DictSchema with required properties: - - data = BytesSchema (which would be an immutable bytes based schema) - - file_name = StrSchema - and cast_to_allowed_types would convert bytes and file instances into dicts containing data + file_name - The downside would be that data would be stored in memory which one may not want to do for very large files - - The developer is responsible for closing this file and deleting it - - This class was kept as mutable: - - to allow file reading and writing to disk - - to be able to preserve file name info - """ - - def __new__(cls, _arg: typing.Union[io.FileIO, io.BufferedReader], **kwargs: Configuration): - return super(Schema, cls).__new__(cls, _arg) - - -class BinaryBase: - pass - - -class BinarySchema( - ComposedBase, - BinaryBase, - Schema, - BinaryMixin -): - class MetaOapg: - @staticmethod - def one_of(): - return [ - BytesSchema, - FileSchema, - ] - - def __new__(cls, _arg: typing.Union[io.FileIO, io.BufferedReader, bytes], **kwargs: Configuration): - return super().__new__(cls, _arg) - - -class BoolSchema( - BoolBase, - Schema, - BoolMixin -): - - @classmethod - def from_openapi_data_oapg(cls, arg: bool, _configuration: typing.Optional[Configuration] = None): - return super().from_openapi_data_oapg(arg, _configuration=_configuration) - - def __new__(cls, _arg: bool, **kwargs: ValidationMetadata): - return super().__new__(cls, _arg, **kwargs) - - -class AnyTypeSchema( - DictBase, - ListBase, - NumberBase, - StrBase, - BoolBase, - NoneBase, - Schema, - NoneFrozenDictTupleStrDecimalBoolFileBytesMixin -): - # Python representation of a schema defined as true or {} - pass - - -class UnsetAnyTypeSchema(AnyTypeSchema): - # Used when additionalProperties/items was not explicitly defined and a defining schema is needed - pass - - -class NotAnyTypeSchema( - ComposedSchema, -): - """ - Python representation of a schema defined as false or {'not': {}} - Does not allow inputs in of AnyType - Note: validations on this class are never run because the code knows that no inputs will ever validate - """ - - class MetaOapg: - not_schema = AnyTypeSchema - - def __new__( - cls, - *_args, - _configuration: typing.Optional[Configuration] = None, - ) -> 'NotAnyTypeSchema': - return super().__new__( - cls, - *_args, - _configuration=_configuration, - ) - - -class DictSchema( - DictBase, - Schema, - FrozenDictMixin -): - @classmethod - def from_openapi_data_oapg(cls, arg: typing.Dict[str, typing.Any], _configuration: typing.Optional[Configuration] = None): - return super().from_openapi_data_oapg(arg, _configuration=_configuration) - - def __new__(cls, *_args: typing.Union[dict, frozendict.frozendict], **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, bytes, Schema, Unset, ValidationMetadata]): - return super().__new__(cls, *_args, **kwargs) - - -schema_type_classes = {NoneSchema, DictSchema, ListSchema, NumberSchema, StrSchema, BoolSchema, AnyTypeSchema} - - -@functools.lru_cache() -def get_new_class( - class_name: str, - bases: typing.Tuple[typing.Type[typing.Union[Schema, typing.Any]], ...] -) -> typing.Type[Schema]: - """ - Returns a new class that is made with the subclass bases - """ - new_cls: typing.Type[Schema] = type(class_name, bases, {}) - return new_cls - - -LOG_CACHE_USAGE = False - - -def log_cache_usage(cache_fn): - if LOG_CACHE_USAGE: - print(cache_fn.__name__, cache_fn.cache_info()) diff --git a/samples/openapi3/client/petstore/python/pom.xml b/samples/openapi3/client/petstore/python/pom.xml index 7e737c36111..86b12f6fd8a 100644 --- a/samples/openapi3/client/petstore/python/pom.xml +++ b/samples/openapi3/client/petstore/python/pom.xml @@ -1,6 +1,6 @@ 4.0.0 - org.openapitools + org.openapijsonschematools PythonExperimentalOAS3PetstoreTests pom 1.0-SNAPSHOT diff --git a/samples/openapi3/client/petstore/python/pyproject.toml b/samples/openapi3/client/petstore/python/pyproject.toml new file mode 100644 index 00000000000..d8f6f12f69b --- /dev/null +++ b/samples/openapi3/client/petstore/python/pyproject.toml @@ -0,0 +1,32 @@ +# Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + +[build-system] +requires = ["setuptools>=61.0"] +build-backend = "setuptools.build_meta" + +[project] +name = "petstore-api" +version = "1.0.0" +authors = [ + { name="OpenAPI JSON Schema Generator community" }, +] +description = "OpenAPI Petstore" +readme = "README.md" +requires-python = ">=3.7" +dependencies = [ + "certifi >= 14.5.14", + "frozendict ~= 2.3.4", + "pem >= 19.3.0", + "pycryptodome >= 3.9.0", + "python-dateutil ~= 2.7.0", + "setuptools >= 61.0", + "typing_extensions ~= 4.5.0", + "urllib3 ~= 2.0.a3", +] +classifiers = [ + "Programming Language :: Python :: 3", + "License :: Apache-2.0", + "Operating System :: OS Independent", + "Topic :: Software Development :: Code Generators" +] + diff --git a/samples/openapi3/client/petstore/python/requirements.txt b/samples/openapi3/client/petstore/python/requirements.txt deleted file mode 100644 index 342f6630cb7..00000000000 --- a/samples/openapi3/client/petstore/python/requirements.txt +++ /dev/null @@ -1,8 +0,0 @@ -certifi >= 14.5.14 -frozendict ~= 2.3.4 -pem >= 19.3.0 -pycryptodome >= 3.9.0 -python-dateutil ~= 2.7.0 -setuptools >= 21.0.0 -typing_extensions ~= 4.3.0 -urllib3 ~= 1.26.7 diff --git a/samples/openapi3/client/petstore/python/setup.cfg b/samples/openapi3/client/petstore/python/setup.cfg deleted file mode 100644 index 11433ee875a..00000000000 --- a/samples/openapi3/client/petstore/python/setup.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -max-line-length=99 diff --git a/samples/openapi3/client/petstore/python/setup.py b/samples/openapi3/client/petstore/python/setup.py deleted file mode 100644 index 992aa9853b7..00000000000 --- a/samples/openapi3/client/petstore/python/setup.py +++ /dev/null @@ -1,50 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from setuptools import setup, find_packages # noqa: H301 - -NAME = "petstore-api" -VERSION = "1.0.0" -# To install the library, run the following -# -# python setup.py install -# -# prerequisite: setuptools -# http://pypi.python.org/pypi/setuptools - -REQUIRES = [ - "certifi >= 14.5.14", - "frozendict ~= 2.3.4", - "pem >= 19.3.0", - "pycryptodome >= 3.9.0", - "python-dateutil ~= 2.7.0", - "setuptools >= 21.0.0", - "typing_extensions ~= 4.3.0", - "urllib3 ~= 1.26.7", -] - -setup( - name=NAME, - version=VERSION, - description="OpenAPI Petstore", - author="OpenAPI Generator community", - author_email="team@openapitools.org", - url="", - keywords=["OpenAPI", "OpenAPI-Generator", "OpenAPI Petstore"], - python_requires=">=3.7", - install_requires=REQUIRES, - packages=find_packages(exclude=["test", "tests"]), - include_package_data=True, - license="Apache-2.0", - long_description="""\ - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - """ -) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/__init__.py new file mode 100644 index 00000000000..34240bcd3d0 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/__init__.py @@ -0,0 +1,31 @@ +# coding: utf-8 + +# flake8: noqa + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +__version__ = "1.0.0" + +# import ApiClient +from petstore_api.api_client import ApiClient + +# import Configuration +from petstore_api.configurations.api_configuration import ApiConfiguration +from petstore_api.signing import HttpSigningConfiguration + +# import exceptions +from petstore_api.exceptions import OpenApiException +from petstore_api.exceptions import ApiAttributeError +from petstore_api.exceptions import ApiTypeError +from petstore_api.exceptions import ApiValueError +from petstore_api.exceptions import ApiKeyError +from petstore_api.exceptions import ApiException + +__import__('sys').setrecursionlimit(1234) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/api_client.py b/samples/openapi3/client/petstore/python/src/petstore_api/api_client.py new file mode 100644 index 00000000000..7d4c330ce03 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/api_client.py @@ -0,0 +1,1400 @@ +# coding: utf-8 +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime +import dataclasses +import decimal +import enum +import email +import json +import os +import io +import atexit +from multiprocessing import pool +import re +import tempfile +import typing +import typing_extensions +from urllib import parse +import urllib3 +from urllib3 import _collections, fields + +import frozendict + +from petstore_api import exceptions, rest, schemas, security_schemes +from petstore_api.configurations import schema_configuration, api_configuration + + +class RequestField(fields.RequestField): + def __eq__(self, other): + if not isinstance(other, RequestField): + return False + return self.__dict__ == other.__dict__ + + +class JSONEncoder(json.JSONEncoder): + compact_separators = (',', ':') + + def default(self, obj): + if isinstance(obj, str): + return str(obj) + elif isinstance(obj, float): + return float(obj) + elif isinstance(obj, int): + return int(obj) + elif isinstance(obj, decimal.Decimal): + if obj.as_tuple().exponent >= 0: + return int(obj) + return float(obj) + elif isinstance(obj, schemas.NoneClass): + return None + elif isinstance(obj, schemas.BoolClass): + return bool(obj) + elif isinstance(obj, (dict, frozendict.frozendict)): + return {key: self.default(val) for key, val in obj.items()} + elif isinstance(obj, (list, tuple)): + return [self.default(item) for item in obj] + raise exceptions.ApiValueError('Unable to prepare type {} for serialization'.format(obj.__class__.__name__)) + + +class ParameterInType(enum.Enum): + QUERY = 'query' + HEADER = 'header' + PATH = 'path' + COOKIE = 'cookie' + + +class ParameterStyle(enum.Enum): + MATRIX = 'matrix' + LABEL = 'label' + FORM = 'form' + SIMPLE = 'simple' + SPACE_DELIMITED = 'spaceDelimited' + PIPE_DELIMITED = 'pipeDelimited' + DEEP_OBJECT = 'deepObject' + + +class PrefixSeparatorIterator: + # A class to store prefixes and separators for rfc6570 expansions + + def __init__(self, prefix: str, separator: str): + self.prefix = prefix + self.separator = separator + self.first = True + if separator in {'.', '|', '%20'}: + item_separator = separator + else: + item_separator = ',' + self.item_separator = item_separator + + def __iter__(self): + return self + + def __next__(self): + if self.first: + self.first = False + return self.prefix + return self.separator + + +class ParameterSerializerBase: + @staticmethod + def __ref6570_item_value(in_data: typing.Any, percent_encode: bool): + """ + Get representation if str/float/int/None/items in list/ values in dict + None is returned if an item is undefined, use cases are value= + - None + - [] + - {} + - [None, None None] + - {'a': None, 'b': None} + """ + if type(in_data) in {str, float, int}: + if percent_encode: + return parse.quote(str(in_data)) + return str(in_data) + elif isinstance(in_data, schemas.none_type_): + # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 + return None + elif isinstance(in_data, list) and not in_data: + # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 + return None + elif isinstance(in_data, dict) and not in_data: + # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 + return None + raise exceptions.ApiValueError('Unable to generate a ref6570 item representation of {}'.format(in_data)) + + @staticmethod + def _to_dict(name: str, value: str): + return {name: value} + + @classmethod + def __ref6570_str_float_int_expansion( + cls, + variable_name: str, + in_data: typing.Any, + explode: bool, + percent_encode: bool, + prefix_separator_iterator: PrefixSeparatorIterator, + var_name_piece: str, + named_parameter_expansion: bool + ) -> str: + item_value = cls.__ref6570_item_value(in_data, percent_encode) + if item_value is None or (item_value == '' and prefix_separator_iterator.separator == ';'): + return next(prefix_separator_iterator) + var_name_piece + value_pair_equals = '=' if named_parameter_expansion else '' + return next(prefix_separator_iterator) + var_name_piece + value_pair_equals + item_value + + @classmethod + def __ref6570_list_expansion( + cls, + variable_name: str, + in_data: typing.Any, + explode: bool, + percent_encode: bool, + prefix_separator_iterator: PrefixSeparatorIterator, + var_name_piece: str, + named_parameter_expansion: bool + ) -> str: + item_values = [cls.__ref6570_item_value(v, percent_encode) for v in in_data] + item_values = [v for v in item_values if v is not None] + if not item_values: + # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 + return "" + value_pair_equals = '=' if named_parameter_expansion else '' + if not explode: + return ( + next(prefix_separator_iterator) + + var_name_piece + + value_pair_equals + + prefix_separator_iterator.item_separator.join(item_values) + ) + # exploded + return next(prefix_separator_iterator) + next(prefix_separator_iterator).join( + [var_name_piece + value_pair_equals + val for val in item_values] + ) + + @classmethod + def __ref6570_dict_expansion( + cls, + variable_name: str, + in_data: typing.Any, + explode: bool, + percent_encode: bool, + prefix_separator_iterator: PrefixSeparatorIterator, + var_name_piece: str, + named_parameter_expansion: bool + ) -> str: + in_data_transformed = {key: cls.__ref6570_item_value(val, percent_encode) for key, val in in_data.items()} + in_data_transformed = {key: val for key, val in in_data_transformed.items() if val is not None} + if not in_data_transformed: + # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 + return "" + value_pair_equals = '=' if named_parameter_expansion else '' + if not explode: + return ( + next(prefix_separator_iterator) + + var_name_piece + value_pair_equals + + prefix_separator_iterator.item_separator.join( + prefix_separator_iterator.item_separator.join( + item_pair + ) for item_pair in in_data_transformed.items() + ) + ) + # exploded + return next(prefix_separator_iterator) + next(prefix_separator_iterator).join( + [key + '=' + val for key, val in in_data_transformed.items()] + ) + + @classmethod + def _ref6570_expansion( + cls, + variable_name: str, + in_data: typing.Any, + explode: bool, + percent_encode: bool, + prefix_separator_iterator: PrefixSeparatorIterator + ) -> str: + """ + Separator is for separate variables like dict with explode true, not for array item separation + """ + named_parameter_expansion = prefix_separator_iterator.separator in {'&', ';'} + var_name_piece = variable_name if named_parameter_expansion else '' + if type(in_data) in {str, float, int}: + return cls.__ref6570_str_float_int_expansion( + variable_name, + in_data, + explode, + percent_encode, + prefix_separator_iterator, + var_name_piece, + named_parameter_expansion + ) + elif isinstance(in_data, schemas.none_type_): + # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 + return "" + elif isinstance(in_data, list): + return cls.__ref6570_list_expansion( + variable_name, + in_data, + explode, + percent_encode, + prefix_separator_iterator, + var_name_piece, + named_parameter_expansion + ) + elif isinstance(in_data, dict): + return cls.__ref6570_dict_expansion( + variable_name, + in_data, + explode, + percent_encode, + prefix_separator_iterator, + var_name_piece, + named_parameter_expansion + ) + # bool, bytes, etc + raise exceptions.ApiValueError('Unable to generate a ref6570 representation of {}'.format(in_data)) + + +class StyleFormSerializer(ParameterSerializerBase): + @classmethod + def _serialize_form( + cls, + in_data: typing.Union[None, int, float, str, bool, dict, list], + name: str, + explode: bool, + percent_encode: bool, + prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] = None + ) -> str: + if prefix_separator_iterator is None: + prefix_separator_iterator = PrefixSeparatorIterator('', '&') + return cls._ref6570_expansion( + variable_name=name, + in_data=in_data, + explode=explode, + percent_encode=percent_encode, + prefix_separator_iterator=prefix_separator_iterator + ) + + +class StyleSimpleSerializer(ParameterSerializerBase): + + @classmethod + def _serialize_simple( + cls, + in_data: typing.Union[None, int, float, str, bool, dict, list], + name: str, + explode: bool, + percent_encode: bool + ) -> str: + prefix_separator_iterator = PrefixSeparatorIterator('', ',') + return cls._ref6570_expansion( + variable_name=name, + in_data=in_data, + explode=explode, + percent_encode=percent_encode, + prefix_separator_iterator=prefix_separator_iterator + ) + + @classmethod + def _deserialize_simple( + cls, + in_data: str, + name: str, + explode: bool, + percent_encode: bool + ) -> typing.Union[str, typing.List[str], typing.Dict[str, str]]: + raise NotImplementedError( + "Deserialization of style=simple has not yet been added. " + "If you need this how about you submit a PR adding it?" + ) + + +class JSONDetector: + """ + Works for: + application/json + application/json; charset=UTF-8 + application/json-patch+json + application/geo+json + """ + __json_content_type_pattern = re.compile("application/[^+]*[+]?(json);?.*") + + @classmethod + def _content_type_is_json(cls, content_type: str) -> bool: + if cls.__json_content_type_pattern.match(content_type): + return True + return False + + +class Encoding: + def __init__( + self, + content_type: str, + headers: typing.Optional[typing.Dict[str, 'HeaderParameter']] = None, + style: typing.Optional[ParameterStyle] = None, + explode: bool = False, + allow_reserved: bool = False, + ): + self.content_type = content_type + self.headers = headers + self.style = style + self.explode = explode + self.allow_reserved = allow_reserved + + +@dataclasses.dataclass +class MediaType: + """ + Used to store request and response body schema information + encoding: + A map between a property name and its encoding information. + The key, being the property name, MUST exist in the schema as a property. + The encoding object SHALL only apply to requestBody objects when the media type is + multipart or application/x-www-form-urlencoded. + """ + schema: typing.Optional[typing.Type[schemas.Schema]] = None + encoding: typing.Optional[typing.Dict[str, Encoding]] = None + + +@dataclasses.dataclass +class ParameterBase(JSONDetector): + in_type: ParameterInType + required: bool + style: typing.Optional[ParameterStyle] + explode: typing.Optional[bool] + allow_reserved: typing.Optional[bool] + schema: typing.Optional[typing.Type[schemas.Schema]] + content: typing.Optional[typing.Dict[str, typing.Type[MediaType]]] + + _json_encoder = JSONEncoder() + + def __init_subclass__(cls, **kwargs): + if cls.explode is None: + if cls.style is ParameterStyle.FORM: + cls.explode = True + else: + cls.explode = False + + @classmethod + def _serialize_json( + cls, + in_data: typing.Union[None, int, float, str, bool, dict, list], + eliminate_whitespace: bool = False + ) -> str: + if eliminate_whitespace: + return json.dumps(in_data, separators=cls._json_encoder.compact_separators) + return json.dumps(in_data) + + +class PathParameter(ParameterBase, StyleSimpleSerializer): + name: str + required: bool = False + in_type: ParameterInType = ParameterInType.PATH + style: ParameterStyle = ParameterStyle.SIMPLE + explode: bool = False + allow_reserved: typing.Optional[bool] = None + schema: typing.Optional[typing.Type[schemas.Schema]] = None + content: typing.Optional[typing.Dict[str, typing.Type[schemas.Schema]]] = None + + @classmethod + def __serialize_label( + cls, + in_data: typing.Union[None, int, float, str, bool, dict, list] + ) -> typing.Dict[str, str]: + prefix_separator_iterator = PrefixSeparatorIterator('.', '.') + value = cls._ref6570_expansion( + variable_name=cls.name, + in_data=in_data, + explode=cls.explode, + percent_encode=True, + prefix_separator_iterator=prefix_separator_iterator + ) + return cls._to_dict(cls.name, value) + + @classmethod + def __serialize_matrix( + cls, + in_data: typing.Union[None, int, float, str, bool, dict, list] + ) -> typing.Dict[str, str]: + prefix_separator_iterator = PrefixSeparatorIterator(';', ';') + value = cls._ref6570_expansion( + variable_name=cls.name, + in_data=in_data, + explode=cls.explode, + percent_encode=True, + prefix_separator_iterator=prefix_separator_iterator + ) + return cls._to_dict(cls.name, value) + + @classmethod + def __serialize_simple( + cls, + in_data: typing.Union[None, int, float, str, bool, dict, list], + ) -> typing.Dict[str, str]: + value = cls._serialize_simple( + in_data=in_data, + name=cls.name, + explode=cls.explode, + percent_encode=True + ) + return cls._to_dict(cls.name, value) + + @classmethod + def serialize( + cls, + in_data: typing.Union[ + schemas.Schema, decimal.Decimal, int, float, str, datetime.date, datetime.datetime, None, bool, list, tuple, dict, frozendict.frozendict] + ) -> typing.Dict[str, str]: + if cls.schema: + cast_in_data = cls.schema(in_data) + cast_in_data = cls._json_encoder.default(cast_in_data) + """ + simple -> path + path: + returns path_params: dict + label -> path + returns path_params + matrix -> path + returns path_params + """ + if cls.style: + if cls.style is ParameterStyle.SIMPLE: + return cls.__serialize_simple(cast_in_data) + elif cls.style is ParameterStyle.LABEL: + return cls.__serialize_label(cast_in_data) + elif cls.style is ParameterStyle.MATRIX: + return cls.__serialize_matrix(cast_in_data) + # cls.content will be length one + for content_type, schema in cls.content.items(): + cast_in_data = schema(in_data) + cast_in_data = cls._json_encoder.default(cast_in_data) + if cls._content_type_is_json(content_type): + value = cls._serialize_json(cast_in_data) + return cls._to_dict(cls.name, value) + raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) + + +class QueryParameter(ParameterBase, StyleFormSerializer): + name: str + required: bool = False + in_type: ParameterInType = ParameterInType.QUERY + style: ParameterStyle = ParameterStyle.FORM + explode: typing.Optional[bool] = None + allow_reserved: typing.Optional[bool] = None + schema: typing.Optional[typing.Type[schemas.Schema]] = None + content: typing.Optional[typing.Dict[str, typing.Type[schemas.Schema]]] = None + + @classmethod + def __serialize_space_delimited( + cls, + in_data: typing.Union[None, int, float, str, bool, dict, list], + prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] + ) -> typing.Dict[str, str]: + if prefix_separator_iterator is None: + prefix_separator_iterator = cls.get_prefix_separator_iterator() + value = cls._ref6570_expansion( + variable_name=cls.name, + in_data=in_data, + explode=cls.explode, + percent_encode=True, + prefix_separator_iterator=prefix_separator_iterator + ) + return cls._to_dict(cls.name, value) + + @classmethod + def __serialize_pipe_delimited( + cls, + in_data: typing.Union[None, int, float, str, bool, dict, list], + prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] + ) -> typing.Dict[str, str]: + if prefix_separator_iterator is None: + prefix_separator_iterator = cls.get_prefix_separator_iterator() + value = cls._ref6570_expansion( + variable_name=cls.name, + in_data=in_data, + explode=cls.explode, + percent_encode=True, + prefix_separator_iterator=prefix_separator_iterator + ) + return cls._to_dict(cls.name, value) + + @classmethod + def __serialize_form( + cls, + in_data: typing.Union[None, int, float, str, bool, dict, list], + prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] + ) -> typing.Dict[str, str]: + if prefix_separator_iterator is None: + prefix_separator_iterator = cls.get_prefix_separator_iterator() + value = cls._serialize_form( + in_data, + name=cls.name, + explode=cls.explode, + percent_encode=True, + prefix_separator_iterator=prefix_separator_iterator + ) + return cls._to_dict(cls.name, value) + + @classmethod + def get_prefix_separator_iterator(cls) -> typing.Optional[PrefixSeparatorIterator]: + if cls.style is ParameterStyle.FORM: + return PrefixSeparatorIterator('?', '&') + elif cls.style is ParameterStyle.SPACE_DELIMITED: + return PrefixSeparatorIterator('', '%20') + elif cls.style is ParameterStyle.PIPE_DELIMITED: + return PrefixSeparatorIterator('', '|') + + @classmethod + def serialize( + cls, + in_data: typing.Union[ + schemas.Schema, decimal.Decimal, int, float, str, datetime.date, datetime.datetime, None, bool, list, tuple, dict, frozendict.frozendict], + prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] = None + ) -> typing.Dict[str, str]: + if cls.schema: + cast_in_data = cls.schema(in_data) + cast_in_data = cls._json_encoder.default(cast_in_data) + """ + form -> query + query: + - GET/HEAD/DELETE: could use fields + - PUT/POST: must use urlencode to send parameters + returns fields: tuple + spaceDelimited -> query + returns fields + pipeDelimited -> query + returns fields + deepObject -> query, https://github.com/OAI/OpenAPI-Specification/issues/1706 + returns fields + """ + if cls.style: + # TODO update query ones to omit setting values when [] {} or None is input + if cls.style is ParameterStyle.FORM: + return cls.__serialize_form(cast_in_data, prefix_separator_iterator) + elif cls.style is ParameterStyle.SPACE_DELIMITED: + return cls.__serialize_space_delimited(cast_in_data, prefix_separator_iterator) + elif cls.style is ParameterStyle.PIPE_DELIMITED: + return cls.__serialize_pipe_delimited(cast_in_data, prefix_separator_iterator) + # cls.content will be length one + if prefix_separator_iterator is None: + prefix_separator_iterator = cls.get_prefix_separator_iterator() + for content_type, media_type in cls.content.items(): + cast_in_data = media_type.schema(in_data) + cast_in_data = cls._json_encoder.default(cast_in_data) + if cls._content_type_is_json(content_type): + value = cls._serialize_json(cast_in_data, eliminate_whitespace=True) + return cls._to_dict( + cls.name, + next(prefix_separator_iterator) + cls.name + '=' + parse.quote(value) + ) + raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) + + +class CookieParameter(ParameterBase, StyleFormSerializer): + name: str + required: bool = False + style: ParameterStyle = ParameterStyle.FORM + in_type: ParameterInType = ParameterInType.COOKIE + explode: typing.Optional[bool] = None + allow_reserved: typing.Optional[bool] = None + schema: typing.Optional[typing.Type[schemas.Schema]] = None + content: typing.Optional[typing.Dict[str, typing.Type[schemas.Schema]]] = None + + @classmethod + def serialize( + cls, + in_data: typing.Union[ + schemas.Schema, decimal.Decimal, int, float, str, datetime.date, datetime.datetime, None, bool, list, tuple, dict, frozendict.frozendict] + ) -> typing.Dict[str, str]: + if cls.schema: + cast_in_data = cls.schema(in_data) + cast_in_data = cls._json_encoder.default(cast_in_data) + """ + form -> cookie + returns fields: tuple + """ + if cls.style: + """ + TODO add escaping of comma, space, equals + or turn encoding on + """ + value = cls._serialize_form( + cast_in_data, + explode=cls.explode, + name=cls.name, + percent_encode=False, + prefix_separator_iterator=PrefixSeparatorIterator('', '&') + ) + return cls._to_dict(cls.name, value) + # cls.content will be length one + for content_type, media_type in cls.content.items(): + cast_in_data = media_type.schema(in_data) + cast_in_data = cls._json_encoder.default(cast_in_data) + if cls._content_type_is_json(content_type): + value = cls._serialize_json(cast_in_data) + return cls._to_dict(cls.name, value) + raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) + + +class HeaderParameterWithoutName(ParameterBase, StyleSimpleSerializer): + required: bool = False + style: ParameterStyle = ParameterStyle.SIMPLE + in_type: ParameterInType = ParameterInType.HEADER + explode: bool = False + allow_reserved: typing.Optional[bool] = None + schema: typing.Optional[typing.Type[schemas.Schema]] = None + content: typing.Optional[typing.Dict[str, typing.Type[schemas.Schema]]] = None + + @staticmethod + def __to_headers(in_data: typing.Tuple[typing.Tuple[str, str], ...]) -> _collections.HTTPHeaderDict: + data = tuple(t for t in in_data if t) + headers = _collections.HTTPHeaderDict() + if not data: + return headers + headers.extend(data) + return headers + + @classmethod + def serialize( + cls, + in_data: typing.Union[ + schemas.Schema, decimal.Decimal, int, float, str, datetime.date, datetime.datetime, None, bool, list, tuple, dict, frozendict.frozendict], + name: str + ) -> _collections.HTTPHeaderDict: + if cls.schema: + cast_in_data = cls.schema(in_data) + cast_in_data = cls._json_encoder.default(cast_in_data) + """ + simple -> header + headers: PoolManager needs a mapping, tuple is close + returns headers: dict + """ + if cls.style: + value = cls._serialize_simple(cast_in_data, name, cls.explode, False) + return cls.__to_headers(((name, value),)) + # cls.content will be length one + for content_type, media_type in cls.content.items(): + cast_in_data = media_type.schema(in_data) + cast_in_data = cls._json_encoder.default(cast_in_data) + if cls._content_type_is_json(content_type): + value = cls._serialize_json(cast_in_data) + return cls.__to_headers(((name, value),)) + raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) + + @classmethod + def deserialize( + cls, + in_data: str, + name: str + ) -> schemas.Schema: + if cls.schema: + """ + simple -> header + headers: PoolManager needs a mapping, tuple is close + returns headers: dict + """ + if cls.style: + extracted_data = cls._deserialize_simple(in_data, name, cls.explode, False) + return cls.schema.from_openapi_data_(extracted_data) + # cls.content will be length one + for content_type, media_type in cls.content.items(): + if cls._content_type_is_json(content_type): + cast_in_data = json.loads(in_data) + return media_type.schema.from_openapi_data_(cast_in_data) + raise NotImplementedError('Deserialization of {} has not yet been implemented'.format(content_type)) + + +class HeaderParameter(HeaderParameterWithoutName): + name: str + + @classmethod + def serialize( + cls, + in_data: typing.Union[ + schemas.Schema, decimal.Decimal, int, float, str, datetime.date, datetime.datetime, None, bool, list, tuple, dict, frozendict.frozendict] + ) -> _collections.HTTPHeaderDict: + return super().serialize( + in_data, + cls.name + ) + + +@dataclasses.dataclass +class ApiResponse: + response: urllib3.HTTPResponse + body: typing.Union[schemas.Unset, schemas.Schema] = schemas.unset + headers: typing.Union[schemas.Unset, typing.Dict[str, schemas.Schema]] = schemas.unset + + def __init__( + self, + response: urllib3.HTTPResponse, + body: typing.Union[schemas.Unset, schemas.Schema] = schemas.unset, + headers: typing.Union[schemas.Unset, typing.Dict[str, schemas.Schema]] = schemas.unset + ): + """ + pycharm needs this to prevent 'Unexpected argument' warnings + """ + self.response = response + self.body = body + self.headers = headers + + +@dataclasses.dataclass +class ApiResponseWithoutDeserialization(ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[schemas.Unset, schemas.Schema] = schemas.unset + headers: typing.Union[schemas.Unset, typing.Dict[str, schemas.Schema]] = schemas.unset + + +class TypedDictInputVerifier: + @staticmethod + def _verify_typed_dict_inputs(cls: typing.Type[typing_extensions.TypedDict], data: typing.Dict[str, typing.Any]): + """ + Ensures that: + - required keys are present + - additional properties are not input + - value stored under required keys do not have the value schemas.unset + Note: detailed value checking is done in schema classes + """ + missing_required_keys = [] + required_keys_with_unset_values = [] + for required_key in cls.__required_keys__: + if required_key not in data: + missing_required_keys.append(required_key) + continue + value = data[required_key] + if value is schemas.unset: + required_keys_with_unset_values.append(required_key) + if missing_required_keys: + raise exceptions.ApiTypeError( + '{} missing {} required arguments: {}'.format( + cls.__name__, len(missing_required_keys), missing_required_keys + ) + ) + if required_keys_with_unset_values: + raise exceptions.ApiValueError( + '{} contains invalid unset values for {} required keys: {}'.format( + cls.__name__, len(required_keys_with_unset_values), required_keys_with_unset_values + ) + ) + + disallowed_additional_keys = [] + for key in data: + if key in cls.__required_keys__ or key in cls.__optional_keys__: + continue + disallowed_additional_keys.append(key) + if disallowed_additional_keys: + raise exceptions.ApiTypeError( + '{} got {} unexpected keyword arguments: {}'.format( + cls.__name__, len(disallowed_additional_keys), disallowed_additional_keys + ) + ) + + +T = typing.TypeVar("T") + + +@dataclasses.dataclass +class OpenApiResponse(JSONDetector, TypedDictInputVerifier, typing.Generic[T]): + __filename_content_disposition_pattern = re.compile('filename="(.+?)"') + response_cls: typing.Type[T] + content: typing.Optional[typing.Dict[str, MediaType]] = None + headers: typing.Optional[typing.Dict[str, HeaderParameterWithoutName]] = None + + @staticmethod + def __deserialize_json(response: urllib3.HTTPResponse) -> typing.Any: + # python must be >= 3.9 so we can pass in bytes into json.loads + return json.loads(response.data) + + @staticmethod + def __file_name_from_response_url(response_url: typing.Optional[str]) -> typing.Optional[str]: + if response_url is None: + return None + url_path = parse.urlparse(response_url).path + if url_path: + path_basename = os.path.basename(url_path) + if path_basename: + _filename, ext = os.path.splitext(path_basename) + if ext: + return path_basename + return None + + @classmethod + def __file_name_from_content_disposition(cls, content_disposition: typing.Optional[str]) -> typing.Optional[str]: + if content_disposition is None: + return None + match = cls.__filename_content_disposition_pattern.search(content_disposition) + if not match: + return None + return match.group(1) + + @classmethod + def __deserialize_application_octet_stream( + cls, response: urllib3.HTTPResponse + ) -> typing.Union[bytes, io.BufferedReader]: + """ + urllib3 use cases: + 1. when preload_content=True (stream=False) then supports_chunked_reads is False and bytes are returned + 2. when preload_content=False (stream=True) then supports_chunked_reads is True and + a file will be written and returned + """ + if response.supports_chunked_reads(): + file_name = ( + cls.__file_name_from_content_disposition(response.headers.get('content-disposition')) + or cls.__file_name_from_response_url(response.geturl()) + ) + + if file_name is None: + _fd, path = tempfile.mkstemp() + else: + path = os.path.join(tempfile.gettempdir(), file_name) + + with open(path, 'wb') as new_file: + chunk_size = 1024 + while True: + data = response.read(chunk_size) + if not data: + break + new_file.write(data) + # release_conn is needed for streaming connections only + response.release_conn() + new_file = open(path, 'rb') + return new_file + else: + return response.data + + @staticmethod + def __deserialize_multipart_form_data( + response: urllib3.HTTPResponse + ) -> typing.Dict[str, typing.Any]: + msg = email.message_from_bytes(response.data) + return { + part.get_param("name", header="Content-Disposition"): part.get_payload( + decode=True + ).decode(part.get_content_charset()) + if part.get_content_charset() + else part.get_payload() + for part in msg.get_payload() + } + + @classmethod + def deserialize(cls, response: urllib3.HTTPResponse, configuration: schema_configuration.SchemaConfiguration) -> T: + content_type = response.headers.get('content-type') + deserialized_body = schemas.unset + streamed = response.supports_chunked_reads() + + deserialized_headers = schemas.unset + if cls.headers is not None: + cls._verify_typed_dict_inputs(cls.response_cls.headers, response.headers) + deserialized_headers = {} + for header_name, header_param in cls.headers.items(): + header_value = response.headers.get(header_name) + if header_value is None: + continue + header_value = header_param.deserialize(header_value, header_name) + deserialized_headers[header_name] = header_value + + if cls.content is not None: + if content_type not in cls.content: + raise exceptions.ApiValueError( + f"Invalid content_type returned. Content_type='{content_type}' was returned " + f"when only {str(set(cls.content))} are defined for status_code={str(response.status)}" + ) + body_schema = cls.content[content_type].schema + if body_schema is None: + # some specs do not define response content media type schemas + return cls.response_cls( + response=response, + headers=deserialized_headers, + body=schemas.unset + ) + + if cls._content_type_is_json(content_type): + body_data = cls.__deserialize_json(response) + elif content_type == 'application/octet-stream': + body_data = cls.__deserialize_application_octet_stream(response) + elif content_type.startswith('multipart/form-data'): + body_data = cls.__deserialize_multipart_form_data(response) + content_type = 'multipart/form-data' + else: + raise NotImplementedError('Deserialization of {} has not yet been implemented'.format(content_type)) + deserialized_body = body_schema.from_openapi_data_( + body_data, configuration_=configuration) + elif streamed: + response.release_conn() + + return cls.response_cls( + response=response, + headers=deserialized_headers, + body=deserialized_body + ) + + +class ApiClient: + """Generic API client for OpenAPI client library builds. + + OpenAPI generic API client. This client handles the client- + server communication, and is invariant across implementations. Specifics of + the methods and models for each application are generated from the OpenAPI + templates. + + NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + Do not edit the class manually. + + :param configuration: api_configuration.ApiConfiguration object for this client + :param schema_configuration: schema_configuration.SchemaConfiguration object for this client + :param header_name: a header to pass when making calls to the API. + :param header_value: a header value to pass when making calls to + the API. + :param cookie: a cookie to include in the header when making calls + to the API + :param pool_threads: The number of threads to use for async requests + to the API. More threads means more concurrent API requests. + """ + + _pool = None + + def __init__( + self, + configuration: typing.Optional[api_configuration.ApiConfiguration] = None, + schema_config: typing.Optional[schema_configuration.SchemaConfiguration] = None, + header_name: typing.Optional[str] = None, + header_value: typing.Optional[str] = None, + cookie: typing.Optional[str] = None, + pool_threads: int = 1 + ): + self.configuration: api_configuration.ApiConfiguration = configuration or api_configuration.ApiConfiguration() + self.schema_configuration: schema_configuration.SchemaConfiguration = schema_config or schema_configuration.SchemaConfiguration() + self.pool_threads = pool_threads + self.rest_client = rest.RESTClientObject(self.configuration) + self.default_headers = _collections.HTTPHeaderDict() + if header_name is not None: + self.default_headers[header_name] = header_value + self.cookie = cookie + # Set default User-Agent. + self.user_agent = 'OpenAPI-JSON-Schema-Generator/1.0.0/python' + + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_value, traceback): + self.close() + + def close(self): + if self._pool: + self._pool.close() + self._pool.join() + self._pool = None + if hasattr(atexit, 'unregister'): + atexit.unregister(self.close) + + @property + def pool(self): + """Create thread pool on first request + avoids instantiating unused threadpool for blocking clients. + """ + if self._pool is None: + atexit.register(self.close) + self._pool = pool.ThreadPool(self.pool_threads) + return self._pool + + @property + def user_agent(self): + """User agent for this API client""" + return self.default_headers['User-Agent'] + + @user_agent.setter + def user_agent(self, value): + self.default_headers['User-Agent'] = value + + def set_default_header(self, header_name, header_value): + self.default_headers[header_name] = header_value + + def __call_api( + self, + resource_path: str, + method: str, + host: str, + headers: typing.Optional[_collections.HTTPHeaderDict] = None, + body: typing.Optional[typing.Union[str, bytes]] = None, + fields: typing.Optional[typing.Tuple[typing.Tuple[str, str], ...]] = None, + security_requirement_object: typing.Optional[security_schemes.SecurityRequirementObject] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> urllib3.HTTPResponse: + + # header parameters + used_headers = _collections.HTTPHeaderDict(self.default_headers) + if self.cookie: + headers['Cookie'] = self.cookie + + # auth setting + self.update_params_for_auth( + used_headers, + security_requirement_object, + resource_path, + method, + body + ) + + # must happen after cookie setting and auth setting in case user is overriding those + if headers: + used_headers.update(headers) + + # request url + url = host + resource_path + + # perform request and return response + response = self.request( + method, + url, + headers=used_headers, + fields=fields, + body=body, + stream=stream, + timeout=timeout, + ) + return response + + def call_api( + self, + resource_path: str, + method: str, + host: str, + headers: typing.Optional[_collections.HTTPHeaderDict] = None, + body: typing.Optional[typing.Union[str, bytes]] = None, + fields: typing.Optional[typing.Tuple[typing.Tuple[str, str], ...]] = None, + security_requirement_object: typing.Optional[security_schemes.SecurityRequirementObject] = None, + async_req: typing.Optional[bool] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> urllib3.HTTPResponse: + """Makes the HTTP request (synchronous) and returns deserialized data. + + To make an async_req request, set the async_req parameter. + + :param resource_path: Path to method endpoint. + :param method: Method to call. + :param headers: Header parameters to be + placed in the request header. + :param body: Request body. + :param fields: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data` + :param security_requirement_object: The security requirement object, used to apply auth when making the call + :param async_req: execute request asynchronously + :type async_req: bool, optional TODO remove, unused + :param stream: if True, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Also when True, if the openapi spec describes a file download, + the data will be written to a local filesystem file and the schemas.BinarySchema + instance will also inherit from FileSchema and schemas.FileIO + Default is False. + :type stream: bool, optional + :param timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param host: api endpoint host + :return: + If async_req parameter is True, + the request will be called asynchronously. + The method will return the request thread. + If parameter async_req is False or missing, + then the method will return the response directly. + """ + + if not async_req: + return self.__call_api( + resource_path, + method, + host, + headers, + body, + fields, + security_requirement_object, + stream, + timeout, + ) + + return self.pool.apply_async( + self.__call_api, + ( + resource_path, + method, + host, + headers, + body, + json, + fields, + security_requirement_object, + stream, + timeout, + ) + ) + + def request( + self, + method: str, + url: str, + headers: typing.Optional[_collections.HTTPHeaderDict] = None, + fields: typing.Optional[typing.Tuple[typing.Tuple[str, str], ...]] = None, + body: typing.Optional[typing.Union[str, bytes]] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> urllib3.HTTPResponse: + """Makes the HTTP request using RESTClient.""" + if method == "get": + return self.rest_client.get(url, + stream=stream, + timeout=timeout, + headers=headers) + elif method == "head": + return self.rest_client.head(url, + stream=stream, + timeout=timeout, + headers=headers) + elif method == "options": + return self.rest_client.options(url, + headers=headers, + fields=fields, + stream=stream, + timeout=timeout, + body=body) + elif method == "post": + return self.rest_client.post(url, + headers=headers, + fields=fields, + stream=stream, + timeout=timeout, + body=body) + elif method == "put": + return self.rest_client.put(url, + headers=headers, + fields=fields, + stream=stream, + timeout=timeout, + body=body) + elif method == "patch": + return self.rest_client.patch(url, + headers=headers, + fields=fields, + stream=stream, + timeout=timeout, + body=body) + elif method == "delete": + return self.rest_client.delete(url, + headers=headers, + stream=stream, + timeout=timeout, + body=body) + else: + raise exceptions.ApiValueError( + "http method must be `GET`, `HEAD`, `OPTIONS`," + " `POST`, `PATCH`, `PUT` or `DELETE`." + ) + + def update_params_for_auth( + self, + headers: _collections.HTTPHeaderDict, + security_requirement_object: typing.Optional[security_schemes.SecurityRequirementObject], + resource_path: str, + method: str, + body: typing.Optional[typing.Union[str, bytes]] = None + ): + """Updates header and query params based on authentication setting. + + :param headers: Header parameters dict to be updated. + :param security_requirement_object: the openapi security requirement object + :param resource_path: A string representation of the HTTP request resource path. + :param method: A string representation of the HTTP request method. + :param body: A object representing the body of the HTTP request. + The object type is the return value of _encoder.default(). + """ + if not security_requirement_object: + # optional auth cause, use no auth + return + for security_scheme_component_name, scope_names in security_requirement_object.items(): + security_scheme_instance = self.configuration.security_scheme_info[security_scheme_component_name] + security_scheme_instance.apply_auth( + headers, + resource_path, + method, + body, + scope_names + ) + + +class Api(TypedDictInputVerifier): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + def __init__(self, api_client: typing.Optional[ApiClient] = None): + self.api_client: ApiClient = api_client or ApiClient() + + +class SerializedRequestBody(typing_extensions.TypedDict, total=False): + body: typing.Union[str, bytes] + fields: typing.Tuple[typing.Union[RequestField, typing.Tuple[str, str]], ...] + + +class RequestBody(StyleFormSerializer, JSONDetector): + """ + A request body parameter + content: content_type to MediaType schemas.Schema info + """ + __json_encoder = JSONEncoder() + content: typing.Dict[str, MediaType] + required: bool = False + + @classmethod + def __serialize_json( + cls, + in_data: typing.Any + ) -> typing.Dict[str, bytes]: + in_data = cls.__json_encoder.default(in_data) + json_str = json.dumps(in_data, separators=(",", ":"), ensure_ascii=False).encode( + "utf-8" + ) + return dict(body=json_str) + + @staticmethod + def __serialize_text_plain(in_data: typing.Any) -> typing.Dict[str, str]: + if isinstance(in_data, frozendict.frozendict): + raise ValueError('Unable to serialize type frozendict.frozendict to text/plain') + elif isinstance(in_data, tuple): + raise ValueError('Unable to serialize type tuple to text/plain') + elif isinstance(in_data, schemas.NoneClass): + raise ValueError('Unable to serialize type NoneClass to text/plain') + elif isinstance(in_data, schemas.BoolClass): + raise ValueError('Unable to serialize type BoolClass to text/plain') + return dict(body=str(in_data)) + + @classmethod + def __multipart_json_item(cls, key: str, value: schemas.Schema) -> RequestField: + json_value = cls.__json_encoder.default(value) + request_field = RequestField(name=key, data=json.dumps(json_value)) + request_field.make_multipart(content_type='application/json') + return request_field + + @classmethod + def __multipart_form_item(cls, key: str, value: schemas.Schema) -> RequestField: + if isinstance(value, str): + request_field = RequestField(name=key, data=str(value)) + request_field.make_multipart(content_type='text/plain') + elif isinstance(value, bytes): + request_field = RequestField(name=key, data=value) + request_field.make_multipart(content_type='application/octet-stream') + elif isinstance(value, schemas.FileIO): + # TODO use content.encoding to limit allowed content types if they are present + request_field = RequestField.from_tuples(key, (os.path.basename(value.name), value.read())) + value.close() + else: + request_field = cls.__multipart_json_item(key=key, value=value) + return request_field + + @classmethod + def __serialize_multipart_form_data( + cls, in_data: schemas.Schema + ) -> typing.Dict[str, typing.Tuple[RequestField, ...]]: + if not isinstance(in_data, frozendict.frozendict): + raise ValueError(f'Unable to serialize {in_data} to multipart/form-data because it is not a dict of data') + """ + In a multipart/form-data request body, each schema property, or each element of a schema array property, + takes a section in the payload with an internal header as defined by RFC7578. The serialization strategy + for each property of a multipart/form-data request body can be specified in an associated Encoding Object. + + When passing in multipart types, boundaries MAY be used to separate sections of the content being + transferred – thus, the following default Content-Types are defined for multipart: + + If the (object) property is a primitive, or an array of primitive values, the default Content-Type is text/plain + If the property is complex, or an array of complex values, the default Content-Type is application/json + Question: how is the array of primitives encoded? + If the property is a type: string with a contentEncoding, the default Content-Type is application/octet-stream + """ + fields = [] + for key, value in in_data.items(): + if isinstance(value, tuple): + if value: + # values use explode = True, so the code makes a RequestField for each item with name=key + for item in value: + request_field = cls.__multipart_form_item(key=key, value=item) + fields.append(request_field) + else: + # send an empty array as json because exploding will not send it + request_field = cls.__multipart_json_item(key=key, value=value) + fields.append(request_field) + else: + request_field = cls.__multipart_form_item(key=key, value=value) + fields.append(request_field) + + return dict(fields=tuple(fields)) + + @staticmethod + def __serialize_application_octet_stream(in_data: schemas.BinarySchema) -> typing.Dict[str, bytes]: + if isinstance(in_data, bytes): + return dict(body=in_data) + # schemas.FileIO type + result = dict(body=in_data.read()) + in_data.close() + return result + + @classmethod + def __serialize_application_x_www_form_data( + cls, in_data: typing.Any + ) -> SerializedRequestBody: + """ + POST submission of form data in body + """ + if not isinstance(in_data, frozendict.frozendict): + raise ValueError( + f'Unable to serialize {in_data} to application/x-www-form-urlencoded because it is not a dict of data') + cast_in_data = cls.__json_encoder.default(in_data) + value = cls._serialize_form(cast_in_data, name='', explode=True, percent_encode=True) + return dict(body=value) + + @classmethod + def serialize( + cls, in_data: typing.Any, content_type: str + ) -> SerializedRequestBody: + """ + If a str is returned then the result will be assigned to data when making the request + If a tuple is returned then the result will be used as fields input in encode_multipart_formdata + Return a tuple of + + The key of the return dict is + - body for application/json + - encode_multipart and fields for multipart/form-data + """ + media_type = cls.content[content_type] + if isinstance(in_data, media_type.schema): + cast_in_data = in_data + elif isinstance(in_data, (dict, frozendict.frozendict)) and in_data: + cast_in_data = media_type.schema(**in_data) + else: + cast_in_data = media_type.schema(in_data) + # TODO check for and use encoding if it exists + # and content_type is multipart or application/x-www-form-urlencoded + if cls._content_type_is_json(content_type): + return cls.__serialize_json(cast_in_data) + elif content_type == 'text/plain': + return cls.__serialize_text_plain(cast_in_data) + elif content_type == 'multipart/form-data': + return cls.__serialize_multipart_form_data(cast_in_data) + elif content_type == 'application/x-www-form-urlencoded': + return cls.__serialize_application_x_www_form_data(cast_in_data) + elif content_type == 'application/octet-stream': + return cls.__serialize_application_octet_stream(cast_in_data) + raise NotImplementedError('Serialization has not yet been implemented for {}'.format(content_type)) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/__init__.py new file mode 100644 index 00000000000..7840f7726f6 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/__init__.py @@ -0,0 +1,3 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints then import them from +# tags, paths, or path_to_api, or tag_to_api \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/path_to_api.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/path_to_api.py new file mode 100644 index 00000000000..19cae0f05ac --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/path_to_api.py @@ -0,0 +1,170 @@ +import typing +import typing_extensions + +from petstore_api.apis.paths.another_fake_dummy import AnotherFakeDummy +from petstore_api.apis.paths.fake import Fake +from petstore_api.apis.paths.fake_additional_properties_with_array_of_enums import FakeAdditionalPropertiesWithArrayOfEnums +from petstore_api.apis.paths.fake_body_with_file_schema import FakeBodyWithFileSchema +from petstore_api.apis.paths.fake_body_with_query_params import FakeBodyWithQueryParams +from petstore_api.apis.paths.fake_case_sensitive_params import FakeCaseSensitiveParams +from petstore_api.apis.paths.fake_delete_coffee_id import FakeDeleteCoffeeId +from petstore_api.apis.paths.fake_health import FakeHealth +from petstore_api.apis.paths.fake_inline_additional_properties import FakeInlineAdditionalProperties +from petstore_api.apis.paths.fake_inline_composition import FakeInlineComposition +from petstore_api.apis.paths.fake_json_form_data import FakeJsonFormData +from petstore_api.apis.paths.fake_json_patch import FakeJsonPatch +from petstore_api.apis.paths.fake_json_with_charset import FakeJsonWithCharset +from petstore_api.apis.paths.fake_multiple_response_bodies import FakeMultipleResponseBodies +from petstore_api.apis.paths.fake_multiple_securities import FakeMultipleSecurities +from petstore_api.apis.paths.fake_obj_in_query import FakeObjInQuery +from petstore_api.apis.paths.fake_parameter_collisions1_abab_self_ab import FakeParameterCollisions1ABAbSelfAB +from petstore_api.apis.paths.fake_query_param_with_json_content_type import FakeQueryParamWithJsonContentType +from petstore_api.apis.paths.fake_redirection import FakeRedirection +from petstore_api.apis.paths.fake_ref_obj_in_query import FakeRefObjInQuery +from petstore_api.apis.paths.fake_refs_array_of_enums import FakeRefsArrayOfEnums +from petstore_api.apis.paths.fake_refs_arraymodel import FakeRefsArraymodel +from petstore_api.apis.paths.fake_refs_boolean import FakeRefsBoolean +from petstore_api.apis.paths.fake_refs_composed_one_of_number_with_validations import FakeRefsComposedOneOfNumberWithValidations +from petstore_api.apis.paths.fake_refs_enum import FakeRefsEnum +from petstore_api.apis.paths.fake_refs_mammal import FakeRefsMammal +from petstore_api.apis.paths.fake_refs_number import FakeRefsNumber +from petstore_api.apis.paths.fake_refs_object_model_with_ref_props import FakeRefsObjectModelWithRefProps +from petstore_api.apis.paths.fake_refs_string import FakeRefsString +from petstore_api.apis.paths.fake_response_without_schema import FakeResponseWithoutSchema +from petstore_api.apis.paths.fake_test_query_paramters import FakeTestQueryParamters +from petstore_api.apis.paths.fake_upload_download_file import FakeUploadDownloadFile +from petstore_api.apis.paths.fake_upload_file import FakeUploadFile +from petstore_api.apis.paths.fake_upload_files import FakeUploadFiles +from petstore_api.apis.paths.fake_wild_card_responses import FakeWildCardResponses +from petstore_api.apis.paths.fake_pet_id_upload_image_with_required_file import FakePetIdUploadImageWithRequiredFile +from petstore_api.apis.paths.fake_classname_test import FakeClassnameTest +from petstore_api.apis.paths.foo import Foo +from petstore_api.apis.paths.pet import Pet +from petstore_api.apis.paths.pet_find_by_status import PetFindByStatus +from petstore_api.apis.paths.pet_find_by_tags import PetFindByTags +from petstore_api.apis.paths.pet_pet_id import PetPetId +from petstore_api.apis.paths.pet_pet_id_upload_image import PetPetIdUploadImage +from petstore_api.apis.paths.store_inventory import StoreInventory +from petstore_api.apis.paths.store_order import StoreOrder +from petstore_api.apis.paths.store_order_order_id import StoreOrderOrderId +from petstore_api.apis.paths.user import User +from petstore_api.apis.paths.user_create_with_array import UserCreateWithArray +from petstore_api.apis.paths.user_create_with_list import UserCreateWithList +from petstore_api.apis.paths.user_login import UserLogin +from petstore_api.apis.paths.user_logout import UserLogout +from petstore_api.apis.paths.user_username import UserUsername + +PathToApi = typing_extensions.TypedDict( + 'PathToApi', + { + "/another-fake/dummy": typing.Type[AnotherFakeDummy], + "/fake": typing.Type[Fake], + "/fake/additional-properties-with-array-of-enums": typing.Type[FakeAdditionalPropertiesWithArrayOfEnums], + "/fake/body-with-file-schema": typing.Type[FakeBodyWithFileSchema], + "/fake/body-with-query-params": typing.Type[FakeBodyWithQueryParams], + "/fake/case-sensitive-params": typing.Type[FakeCaseSensitiveParams], + "/fake/deleteCoffee/{id}": typing.Type[FakeDeleteCoffeeId], + "/fake/health": typing.Type[FakeHealth], + "/fake/inline-additionalProperties": typing.Type[FakeInlineAdditionalProperties], + "/fake/inlineComposition/": typing.Type[FakeInlineComposition], + "/fake/jsonFormData": typing.Type[FakeJsonFormData], + "/fake/jsonPatch": typing.Type[FakeJsonPatch], + "/fake/jsonWithCharset": typing.Type[FakeJsonWithCharset], + "/fake/multipleResponseBodies": typing.Type[FakeMultipleResponseBodies], + "/fake/multipleSecurities": typing.Type[FakeMultipleSecurities], + "/fake/objInQuery": typing.Type[FakeObjInQuery], + "/fake/parameterCollisions/{1}/{aB}/{Ab}/{self}/{A-B}/": typing.Type[FakeParameterCollisions1ABAbSelfAB], + "/fake/queryParamWithJsonContentType": typing.Type[FakeQueryParamWithJsonContentType], + "/fake/redirection": typing.Type[FakeRedirection], + "/fake/refObjInQuery": typing.Type[FakeRefObjInQuery], + "/fake/refs/array-of-enums": typing.Type[FakeRefsArrayOfEnums], + "/fake/refs/arraymodel": typing.Type[FakeRefsArraymodel], + "/fake/refs/boolean": typing.Type[FakeRefsBoolean], + "/fake/refs/composed_one_of_number_with_validations": typing.Type[FakeRefsComposedOneOfNumberWithValidations], + "/fake/refs/enum": typing.Type[FakeRefsEnum], + "/fake/refs/mammal": typing.Type[FakeRefsMammal], + "/fake/refs/number": typing.Type[FakeRefsNumber], + "/fake/refs/object_model_with_ref_props": typing.Type[FakeRefsObjectModelWithRefProps], + "/fake/refs/string": typing.Type[FakeRefsString], + "/fake/responseWithoutSchema": typing.Type[FakeResponseWithoutSchema], + "/fake/test-query-paramters": typing.Type[FakeTestQueryParamters], + "/fake/uploadDownloadFile": typing.Type[FakeUploadDownloadFile], + "/fake/uploadFile": typing.Type[FakeUploadFile], + "/fake/uploadFiles": typing.Type[FakeUploadFiles], + "/fake/wildCardResponses": typing.Type[FakeWildCardResponses], + "/fake/{petId}/uploadImageWithRequiredFile": typing.Type[FakePetIdUploadImageWithRequiredFile], + "/fake_classname_test": typing.Type[FakeClassnameTest], + "/foo": typing.Type[Foo], + "/pet": typing.Type[Pet], + "/pet/findByStatus": typing.Type[PetFindByStatus], + "/pet/findByTags": typing.Type[PetFindByTags], + "/pet/{petId}": typing.Type[PetPetId], + "/pet/{petId}/uploadImage": typing.Type[PetPetIdUploadImage], + "/store/inventory": typing.Type[StoreInventory], + "/store/order": typing.Type[StoreOrder], + "/store/order/{order_id}": typing.Type[StoreOrderOrderId], + "/user": typing.Type[User], + "/user/createWithArray": typing.Type[UserCreateWithArray], + "/user/createWithList": typing.Type[UserCreateWithList], + "/user/login": typing.Type[UserLogin], + "/user/logout": typing.Type[UserLogout], + "/user/{username}": typing.Type[UserUsername], + } +) + +path_to_api = PathToApi( + { + "/another-fake/dummy": AnotherFakeDummy, + "/fake": Fake, + "/fake/additional-properties-with-array-of-enums": FakeAdditionalPropertiesWithArrayOfEnums, + "/fake/body-with-file-schema": FakeBodyWithFileSchema, + "/fake/body-with-query-params": FakeBodyWithQueryParams, + "/fake/case-sensitive-params": FakeCaseSensitiveParams, + "/fake/deleteCoffee/{id}": FakeDeleteCoffeeId, + "/fake/health": FakeHealth, + "/fake/inline-additionalProperties": FakeInlineAdditionalProperties, + "/fake/inlineComposition/": FakeInlineComposition, + "/fake/jsonFormData": FakeJsonFormData, + "/fake/jsonPatch": FakeJsonPatch, + "/fake/jsonWithCharset": FakeJsonWithCharset, + "/fake/multipleResponseBodies": FakeMultipleResponseBodies, + "/fake/multipleSecurities": FakeMultipleSecurities, + "/fake/objInQuery": FakeObjInQuery, + "/fake/parameterCollisions/{1}/{aB}/{Ab}/{self}/{A-B}/": FakeParameterCollisions1ABAbSelfAB, + "/fake/queryParamWithJsonContentType": FakeQueryParamWithJsonContentType, + "/fake/redirection": FakeRedirection, + "/fake/refObjInQuery": FakeRefObjInQuery, + "/fake/refs/array-of-enums": FakeRefsArrayOfEnums, + "/fake/refs/arraymodel": FakeRefsArraymodel, + "/fake/refs/boolean": FakeRefsBoolean, + "/fake/refs/composed_one_of_number_with_validations": FakeRefsComposedOneOfNumberWithValidations, + "/fake/refs/enum": FakeRefsEnum, + "/fake/refs/mammal": FakeRefsMammal, + "/fake/refs/number": FakeRefsNumber, + "/fake/refs/object_model_with_ref_props": FakeRefsObjectModelWithRefProps, + "/fake/refs/string": FakeRefsString, + "/fake/responseWithoutSchema": FakeResponseWithoutSchema, + "/fake/test-query-paramters": FakeTestQueryParamters, + "/fake/uploadDownloadFile": FakeUploadDownloadFile, + "/fake/uploadFile": FakeUploadFile, + "/fake/uploadFiles": FakeUploadFiles, + "/fake/wildCardResponses": FakeWildCardResponses, + "/fake/{petId}/uploadImageWithRequiredFile": FakePetIdUploadImageWithRequiredFile, + "/fake_classname_test": FakeClassnameTest, + "/foo": Foo, + "/pet": Pet, + "/pet/findByStatus": PetFindByStatus, + "/pet/findByTags": PetFindByTags, + "/pet/{petId}": PetPetId, + "/pet/{petId}/uploadImage": PetPetIdUploadImage, + "/store/inventory": StoreInventory, + "/store/order": StoreOrder, + "/store/order/{order_id}": StoreOrderOrderId, + "/user": User, + "/user/createWithArray": UserCreateWithArray, + "/user/createWithList": UserCreateWithList, + "/user/login": UserLogin, + "/user/logout": UserLogout, + "/user/{username}": UserUsername, + } +) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/__init__.py new file mode 100644 index 00000000000..5b69d6460e1 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/__init__.py @@ -0,0 +1,3 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from petstore_api.apis.path_to_api import path_to_api \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/another_fake_dummy.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/another_fake_dummy.py new file mode 100644 index 00000000000..c713c0faf45 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/another_fake_dummy.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api.paths.another_fake_dummy.patch.operation import ApiForPatch + + +class AnotherFakeDummy( + ApiForPatch, +): + pass diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake.py new file mode 100644 index 00000000000..f5f9a72e85b --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake.py @@ -0,0 +1,21 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api.paths.fake.delete.operation import ApiForDelete +from petstore_api.paths.fake.get.operation import ApiForGet +from petstore_api.paths.fake.patch.operation import ApiForPatch +from petstore_api.paths.fake.post.operation import ApiForPost + + +class Fake( + ApiForDelete, + ApiForGet, + ApiForPatch, + ApiForPost, +): + pass diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_additional_properties_with_array_of_enums.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_additional_properties_with_array_of_enums.py new file mode 100644 index 00000000000..5589bbfe11b --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_additional_properties_with_array_of_enums.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api.paths.fake_additional_properties_with_array_of_enums.get.operation import ApiForGet + + +class FakeAdditionalPropertiesWithArrayOfEnums( + ApiForGet, +): + pass diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_body_with_file_schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_body_with_file_schema.py new file mode 100644 index 00000000000..ed798639eeb --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_body_with_file_schema.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api.paths.fake_body_with_file_schema.put.operation import ApiForPut + + +class FakeBodyWithFileSchema( + ApiForPut, +): + pass diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_body_with_query_params.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_body_with_query_params.py new file mode 100644 index 00000000000..0691e6a17c1 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_body_with_query_params.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api.paths.fake_body_with_query_params.put.operation import ApiForPut + + +class FakeBodyWithQueryParams( + ApiForPut, +): + pass diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_case_sensitive_params.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_case_sensitive_params.py new file mode 100644 index 00000000000..8a8e7ae0f9a --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_case_sensitive_params.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api.paths.fake_case_sensitive_params.put.operation import ApiForPut + + +class FakeCaseSensitiveParams( + ApiForPut, +): + pass diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_classname_test.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_classname_test.py new file mode 100644 index 00000000000..355b14608c5 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_classname_test.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api.paths.fake_classname_test.patch.operation import ApiForPatch + + +class FakeClassnameTest( + ApiForPatch, +): + pass diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_delete_coffee_id.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_delete_coffee_id.py new file mode 100644 index 00000000000..dafb0da1c62 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_delete_coffee_id.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api.paths.fake_delete_coffee_id.delete.operation import ApiForDelete + + +class FakeDeleteCoffeeId( + ApiForDelete, +): + pass diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_health.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_health.py new file mode 100644 index 00000000000..44b79617f39 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_health.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api.paths.fake_health.get.operation import ApiForGet + + +class FakeHealth( + ApiForGet, +): + pass diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_inline_additional_properties.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_inline_additional_properties.py new file mode 100644 index 00000000000..a52d84c9a3f --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_inline_additional_properties.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api.paths.fake_inline_additional_properties.post.operation import ApiForPost + + +class FakeInlineAdditionalProperties( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_inline_composition.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_inline_composition.py new file mode 100644 index 00000000000..ec40aa9e69b --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_inline_composition.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api.paths.fake_inline_composition.post.operation import ApiForPost + + +class FakeInlineComposition( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_json_form_data.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_json_form_data.py new file mode 100644 index 00000000000..099fa04ab0c --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_json_form_data.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api.paths.fake_json_form_data.get.operation import ApiForGet + + +class FakeJsonFormData( + ApiForGet, +): + pass diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_json_patch.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_json_patch.py new file mode 100644 index 00000000000..d3371cd8b0e --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_json_patch.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api.paths.fake_json_patch.patch.operation import ApiForPatch + + +class FakeJsonPatch( + ApiForPatch, +): + pass diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_json_with_charset.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_json_with_charset.py new file mode 100644 index 00000000000..e9a37f7f175 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_json_with_charset.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api.paths.fake_json_with_charset.post.operation import ApiForPost + + +class FakeJsonWithCharset( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_multiple_response_bodies.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_multiple_response_bodies.py new file mode 100644 index 00000000000..e7e67db7499 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_multiple_response_bodies.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api.paths.fake_multiple_response_bodies.get.operation import ApiForGet + + +class FakeMultipleResponseBodies( + ApiForGet, +): + pass diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_multiple_securities.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_multiple_securities.py new file mode 100644 index 00000000000..0b18f1a38e4 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_multiple_securities.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api.paths.fake_multiple_securities.get.operation import ApiForGet + + +class FakeMultipleSecurities( + ApiForGet, +): + pass diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_obj_in_query.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_obj_in_query.py new file mode 100644 index 00000000000..6a8e7160eaf --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_obj_in_query.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api.paths.fake_obj_in_query.get.operation import ApiForGet + + +class FakeObjInQuery( + ApiForGet, +): + pass diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_parameter_collisions1_abab_self_ab.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_parameter_collisions1_abab_self_ab.py new file mode 100644 index 00000000000..5cbb97fbe45 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_parameter_collisions1_abab_self_ab.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api.paths.fake_parameter_collisions1_abab_self_ab.post.operation import ApiForPost + + +class FakeParameterCollisions1ABAbSelfAB( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_pet_id_upload_image_with_required_file.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_pet_id_upload_image_with_required_file.py new file mode 100644 index 00000000000..6f9d374a90a --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_pet_id_upload_image_with_required_file.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api.paths.fake_pet_id_upload_image_with_required_file.post.operation import ApiForPost + + +class FakePetIdUploadImageWithRequiredFile( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_query_param_with_json_content_type.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_query_param_with_json_content_type.py new file mode 100644 index 00000000000..4abe5dad2e0 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_query_param_with_json_content_type.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api.paths.fake_query_param_with_json_content_type.get.operation import ApiForGet + + +class FakeQueryParamWithJsonContentType( + ApiForGet, +): + pass diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_redirection.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_redirection.py new file mode 100644 index 00000000000..ba7c21799ca --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_redirection.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api.paths.fake_redirection.get.operation import ApiForGet + + +class FakeRedirection( + ApiForGet, +): + pass diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_ref_obj_in_query.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_ref_obj_in_query.py new file mode 100644 index 00000000000..b374b7877be --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_ref_obj_in_query.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api.paths.fake_ref_obj_in_query.get.operation import ApiForGet + + +class FakeRefObjInQuery( + ApiForGet, +): + pass diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_refs_array_of_enums.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_refs_array_of_enums.py new file mode 100644 index 00000000000..7c7d3a3af84 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_refs_array_of_enums.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api.paths.fake_refs_array_of_enums.post.operation import ApiForPost + + +class FakeRefsArrayOfEnums( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_refs_arraymodel.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_refs_arraymodel.py new file mode 100644 index 00000000000..4b80b6806e9 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_refs_arraymodel.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api.paths.fake_refs_arraymodel.post.operation import ApiForPost + + +class FakeRefsArraymodel( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_refs_boolean.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_refs_boolean.py new file mode 100644 index 00000000000..b935ca12859 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_refs_boolean.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api.paths.fake_refs_boolean.post.operation import ApiForPost + + +class FakeRefsBoolean( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_refs_composed_one_of_number_with_validations.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_refs_composed_one_of_number_with_validations.py new file mode 100644 index 00000000000..9db1650e9a6 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_refs_composed_one_of_number_with_validations.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api.paths.fake_refs_composed_one_of_number_with_validations.post.operation import ApiForPost + + +class FakeRefsComposedOneOfNumberWithValidations( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_refs_enum.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_refs_enum.py new file mode 100644 index 00000000000..813ee80c214 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_refs_enum.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api.paths.fake_refs_enum.post.operation import ApiForPost + + +class FakeRefsEnum( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_refs_mammal.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_refs_mammal.py new file mode 100644 index 00000000000..9daabdd4118 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_refs_mammal.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api.paths.fake_refs_mammal.post.operation import ApiForPost + + +class FakeRefsMammal( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_refs_number.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_refs_number.py new file mode 100644 index 00000000000..1d4f2ca89e8 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_refs_number.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api.paths.fake_refs_number.post.operation import ApiForPost + + +class FakeRefsNumber( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_refs_object_model_with_ref_props.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_refs_object_model_with_ref_props.py new file mode 100644 index 00000000000..5933d289b08 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_refs_object_model_with_ref_props.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api.paths.fake_refs_object_model_with_ref_props.post.operation import ApiForPost + + +class FakeRefsObjectModelWithRefProps( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_refs_string.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_refs_string.py new file mode 100644 index 00000000000..7572aa4d8f7 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_refs_string.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api.paths.fake_refs_string.post.operation import ApiForPost + + +class FakeRefsString( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_response_without_schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_response_without_schema.py new file mode 100644 index 00000000000..4269bc7d340 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_response_without_schema.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api.paths.fake_response_without_schema.get.operation import ApiForGet + + +class FakeResponseWithoutSchema( + ApiForGet, +): + pass diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_test_query_paramters.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_test_query_paramters.py new file mode 100644 index 00000000000..1b4862912ef --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_test_query_paramters.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api.paths.fake_test_query_paramters.put.operation import ApiForPut + + +class FakeTestQueryParamters( + ApiForPut, +): + pass diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_upload_download_file.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_upload_download_file.py new file mode 100644 index 00000000000..34a75a54215 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_upload_download_file.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api.paths.fake_upload_download_file.post.operation import ApiForPost + + +class FakeUploadDownloadFile( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_upload_file.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_upload_file.py new file mode 100644 index 00000000000..290615a53ce --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_upload_file.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api.paths.fake_upload_file.post.operation import ApiForPost + + +class FakeUploadFile( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_upload_files.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_upload_files.py new file mode 100644 index 00000000000..5d7439387d8 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_upload_files.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api.paths.fake_upload_files.post.operation import ApiForPost + + +class FakeUploadFiles( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_wild_card_responses.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_wild_card_responses.py new file mode 100644 index 00000000000..9c5e89f191f --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_wild_card_responses.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api.paths.fake_wild_card_responses.get.operation import ApiForGet + + +class FakeWildCardResponses( + ApiForGet, +): + pass diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/foo.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/foo.py new file mode 100644 index 00000000000..c8006fac5c5 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/foo.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api.paths.foo.get.operation import ApiForGet + + +class Foo( + ApiForGet, +): + pass diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/pet.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/pet.py new file mode 100644 index 00000000000..63945213703 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/pet.py @@ -0,0 +1,17 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api.paths.pet.post.operation import ApiForPost +from petstore_api.paths.pet.put.operation import ApiForPut + + +class Pet( + ApiForPost, + ApiForPut, +): + pass diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/pet_find_by_status.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/pet_find_by_status.py new file mode 100644 index 00000000000..b5b54aa8d03 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/pet_find_by_status.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api.paths.pet_find_by_status.get.operation import ApiForGet + + +class PetFindByStatus( + ApiForGet, +): + pass diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/pet_find_by_tags.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/pet_find_by_tags.py new file mode 100644 index 00000000000..7b003678092 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/pet_find_by_tags.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api.paths.pet_find_by_tags.get.operation import ApiForGet + + +class PetFindByTags( + ApiForGet, +): + pass diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/pet_pet_id.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/pet_pet_id.py new file mode 100644 index 00000000000..6dfa8fc5a97 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/pet_pet_id.py @@ -0,0 +1,19 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api.paths.pet_pet_id.delete.operation import ApiForDelete +from petstore_api.paths.pet_pet_id.get.operation import ApiForGet +from petstore_api.paths.pet_pet_id.post.operation import ApiForPost + + +class PetPetId( + ApiForDelete, + ApiForGet, + ApiForPost, +): + pass diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/pet_pet_id_upload_image.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/pet_pet_id_upload_image.py new file mode 100644 index 00000000000..88b380e5e04 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/pet_pet_id_upload_image.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api.paths.pet_pet_id_upload_image.post.operation import ApiForPost + + +class PetPetIdUploadImage( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/store_inventory.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/store_inventory.py new file mode 100644 index 00000000000..f6fe027d57e --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/store_inventory.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api.paths.store_inventory.get.operation import ApiForGet + + +class StoreInventory( + ApiForGet, +): + pass diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/store_order.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/store_order.py new file mode 100644 index 00000000000..34bb9866f44 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/store_order.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api.paths.store_order.post.operation import ApiForPost + + +class StoreOrder( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/store_order_order_id.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/store_order_order_id.py new file mode 100644 index 00000000000..53bab836c4a --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/store_order_order_id.py @@ -0,0 +1,17 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api.paths.store_order_order_id.delete.operation import ApiForDelete +from petstore_api.paths.store_order_order_id.get.operation import ApiForGet + + +class StoreOrderOrderId( + ApiForDelete, + ApiForGet, +): + pass diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/user.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/user.py new file mode 100644 index 00000000000..bab094cd204 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/user.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api.paths.user.post.operation import ApiForPost + + +class User( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/user_create_with_array.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/user_create_with_array.py new file mode 100644 index 00000000000..53e017d0398 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/user_create_with_array.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api.paths.user_create_with_array.post.operation import ApiForPost + + +class UserCreateWithArray( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/user_create_with_list.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/user_create_with_list.py new file mode 100644 index 00000000000..cc3bc21e3a3 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/user_create_with_list.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api.paths.user_create_with_list.post.operation import ApiForPost + + +class UserCreateWithList( + ApiForPost, +): + pass diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/user_login.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/user_login.py new file mode 100644 index 00000000000..e43dea149a4 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/user_login.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api.paths.user_login.get.operation import ApiForGet + + +class UserLogin( + ApiForGet, +): + pass diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/user_logout.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/user_logout.py new file mode 100644 index 00000000000..c898117e65f --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/user_logout.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api.paths.user_logout.get.operation import ApiForGet + + +class UserLogout( + ApiForGet, +): + pass diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/user_username.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/user_username.py new file mode 100644 index 00000000000..5ef12f7e7c2 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/user_username.py @@ -0,0 +1,19 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api.paths.user_username.delete.operation import ApiForDelete +from petstore_api.paths.user_username.get.operation import ApiForGet +from petstore_api.paths.user_username.put.operation import ApiForPut + + +class UserUsername( + ApiForDelete, + ApiForGet, + ApiForPut, +): + pass diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/tag_to_api.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/tag_to_api.py new file mode 100644 index 00000000000..ed161a6b7f0 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/tag_to_api.py @@ -0,0 +1,35 @@ +import typing +import typing_extensions + +from petstore_api.apis.tags.pet_api import PetApi +from petstore_api.apis.tags.store_api import StoreApi +from petstore_api.apis.tags.default_api import DefaultApi +from petstore_api.apis.tags.fake_api import FakeApi +from petstore_api.apis.tags.user_api import UserApi +from petstore_api.apis.tags.fake_classname_tags123_api import FakeClassnameTags123Api +from petstore_api.apis.tags.another_fake_api import AnotherFakeApi + +TagToApi = typing_extensions.TypedDict( + 'TagToApi', + { + "pet": typing.Type[PetApi], + "store": typing.Type[StoreApi], + "default": typing.Type[DefaultApi], + "fake": typing.Type[FakeApi], + "user": typing.Type[UserApi], + "fake_classname_tags 123#$%^": typing.Type[FakeClassnameTags123Api], + "$another-fake?": typing.Type[AnotherFakeApi], + } +) + +tag_to_api = TagToApi( + { + "pet": PetApi, + "store": StoreApi, + "default": DefaultApi, + "fake": FakeApi, + "user": UserApi, + "fake_classname_tags 123#$%^": FakeClassnameTags123Api, + "$another-fake?": AnotherFakeApi, + } +) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/tags/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/tags/__init__.py new file mode 100644 index 00000000000..b1fef59bef3 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/tags/__init__.py @@ -0,0 +1,3 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from petstore_api.apis.tag_to_api import tag_to_api \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/tags/another_fake_api.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/tags/another_fake_api.py new file mode 100644 index 00000000000..068ef20133f --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/tags/another_fake_api.py @@ -0,0 +1,20 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api.paths.another_fake_dummy.patch.operation import _123TestSpecialTags + + +class AnotherFakeApi( + _123TestSpecialTags, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + pass diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/tags/default_api.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/tags/default_api.py new file mode 100644 index 00000000000..1778d115ee0 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/tags/default_api.py @@ -0,0 +1,20 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api.paths.foo.get.operation import FooGet + + +class DefaultApi( + FooGet, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + pass diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/tags/fake_api.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/tags/fake_api.py new file mode 100644 index 00000000000..2d42927d02a --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/tags/fake_api.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api.paths.fake_json_with_charset.post.operation import JsonWithCharset +from petstore_api.paths.fake_multiple_response_bodies.get.operation import MultipleResponseBodies +from petstore_api.paths.fake_multiple_securities.get.operation import MultipleSecurities +from petstore_api.paths.fake_query_param_with_json_content_type.get.operation import QueryParamWithJsonContentType +from petstore_api.paths.fake_parameter_collisions1_abab_self_ab.post.operation import ParameterCollisions +from petstore_api.paths.fake_wild_card_responses.get.operation import WildCardResponses +from petstore_api.paths.fake_refs_array_of_enums.post.operation import ArrayOfEnums +from petstore_api.paths.fake_additional_properties_with_array_of_enums.get.operation import AdditionalPropertiesWithArrayOfEnums +from petstore_api.paths.fake_json_patch.patch.operation import JsonPatch +from petstore_api.paths.fake_upload_files.post.operation import UploadFiles +from petstore_api.paths.fake_json_form_data.get.operation import JsonFormData +from petstore_api.paths.fake_refs_string.post.operation import String +from petstore_api.paths.fake_response_without_schema.get.operation import ResponseWithoutSchema +from petstore_api.paths.fake_refs_object_model_with_ref_props.post.operation import ObjectModelWithRefProps +from petstore_api.paths.fake_redirection.get.operation import Redirection +from petstore_api.paths.fake_obj_in_query.get.operation import ObjectInQuery +from petstore_api.paths.fake_case_sensitive_params.put.operation import CaseSensitiveParams +from petstore_api.paths.fake_inline_additional_properties.post.operation import InlineAdditionalProperties +from petstore_api.paths.fake_refs_arraymodel.post.operation import ArrayModel +from petstore_api.paths.fake.delete.operation import GroupParameters +from petstore_api.paths.fake.get.operation import EnumParameters +from petstore_api.paths.fake.patch.operation import ClientModel +from petstore_api.paths.fake.post.operation import EndpointParameters +from petstore_api.paths.fake_inline_composition.post.operation import InlineComposition +from petstore_api.paths.fake_health.get.operation import FakeHealthGet +from petstore_api.paths.fake_refs_composed_one_of_number_with_validations.post.operation import ComposedOneOfDifferentTypes +from petstore_api.paths.fake_refs_mammal.post.operation import Mammal +from petstore_api.paths.fake_ref_obj_in_query.get.operation import RefObjectInQuery +from petstore_api.paths.fake_test_query_paramters.put.operation import QueryParameterCollectionFormat +from petstore_api.paths.fake_body_with_query_params.put.operation import BodyWithQueryParams +from petstore_api.paths.fake_refs_boolean.post.operation import Boolean +from petstore_api.paths.fake_delete_coffee_id.delete.operation import DeleteCoffee +from petstore_api.paths.fake_refs_enum.post.operation import StringEnum +from petstore_api.paths.fake_refs_number.post.operation import NumberWithValidations +from petstore_api.paths.fake_upload_file.post.operation import UploadFile +from petstore_api.paths.fake_body_with_file_schema.put.operation import BodyWithFileSchema +from petstore_api.paths.fake_upload_download_file.post.operation import UploadDownloadFile + + +class FakeApi( + JsonWithCharset, + MultipleResponseBodies, + MultipleSecurities, + QueryParamWithJsonContentType, + ParameterCollisions, + WildCardResponses, + ArrayOfEnums, + AdditionalPropertiesWithArrayOfEnums, + JsonPatch, + UploadFiles, + JsonFormData, + String, + ResponseWithoutSchema, + ObjectModelWithRefProps, + Redirection, + ObjectInQuery, + CaseSensitiveParams, + InlineAdditionalProperties, + ArrayModel, + GroupParameters, + EnumParameters, + ClientModel, + EndpointParameters, + InlineComposition, + FakeHealthGet, + ComposedOneOfDifferentTypes, + Mammal, + RefObjectInQuery, + QueryParameterCollectionFormat, + BodyWithQueryParams, + Boolean, + DeleteCoffee, + StringEnum, + NumberWithValidations, + UploadFile, + BodyWithFileSchema, + UploadDownloadFile, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + pass diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/tags/fake_classname_tags123_api.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/tags/fake_classname_tags123_api.py new file mode 100644 index 00000000000..458c89bf476 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/tags/fake_classname_tags123_api.py @@ -0,0 +1,20 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api.paths.fake_classname_test.patch.operation import Classname + + +class FakeClassnameTags123Api( + Classname, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + pass diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/tags/pet_api.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/tags/pet_api.py new file mode 100644 index 00000000000..e10ad765b18 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/tags/pet_api.py @@ -0,0 +1,36 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api.paths.pet_find_by_status.get.operation import FindPetsByStatus +from petstore_api.paths.pet_find_by_tags.get.operation import FindPetsByTags +from petstore_api.paths.pet_pet_id_upload_image.post.operation import UploadImage +from petstore_api.paths.fake_pet_id_upload_image_with_required_file.post.operation import UploadFileWithRequiredFile +from petstore_api.paths.pet_pet_id.delete.operation import DeletePet +from petstore_api.paths.pet_pet_id.get.operation import GetPetById +from petstore_api.paths.pet_pet_id.post.operation import UpdatePetWithForm +from petstore_api.paths.pet.post.operation import AddPet +from petstore_api.paths.pet.put.operation import UpdatePet + + +class PetApi( + FindPetsByStatus, + FindPetsByTags, + UploadImage, + UploadFileWithRequiredFile, + DeletePet, + GetPetById, + UpdatePetWithForm, + AddPet, + UpdatePet, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + pass diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/tags/store_api.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/tags/store_api.py new file mode 100644 index 00000000000..9079924c3ce --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/tags/store_api.py @@ -0,0 +1,26 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api.paths.store_inventory.get.operation import GetInventory +from petstore_api.paths.store_order_order_id.delete.operation import DeleteOrder +from petstore_api.paths.store_order_order_id.get.operation import GetOrderById +from petstore_api.paths.store_order.post.operation import PlaceOrder + + +class StoreApi( + GetInventory, + DeleteOrder, + GetOrderById, + PlaceOrder, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + pass diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/tags/user_api.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/tags/user_api.py new file mode 100644 index 00000000000..bac3a6e65b9 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/tags/user_api.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api.paths.user_login.get.operation import LoginUser +from petstore_api.paths.user_logout.get.operation import LogoutUser +from petstore_api.paths.user_username.delete.operation import DeleteUser +from petstore_api.paths.user_username.get.operation import GetUserByName +from petstore_api.paths.user_username.put.operation import UpdateUser +from petstore_api.paths.user_create_with_array.post.operation import CreateUsersWithArrayInput +from petstore_api.paths.user_create_with_list.post.operation import CreateUsersWithListInput +from petstore_api.paths.user.post.operation import CreateUser + + +class UserApi( + LoginUser, + LogoutUser, + DeleteUser, + GetUserByName, + UpdateUser, + CreateUsersWithArrayInput, + CreateUsersWithListInput, + CreateUser, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + pass diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/headers/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/headers/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/headers/header_int32_json_content_type_header/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/headers/header_int32_json_content_type_header/__init__.py new file mode 100644 index 00000000000..7aaa57719f7 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/headers/header_int32_json_content_type_header/__init__.py @@ -0,0 +1,31 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client +from .content.application_json import schema as application_json_schema + + +class Int32JsonContentTypeHeader(api_client.HeaderParameterWithoutName): + style = api_client.ParameterStyle.SIMPLE + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/headers/header_int32_json_content_type_header/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/headers/header_int32_json_content_type_header/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/headers/header_int32_json_content_type_header/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/headers/header_int32_json_content_type_header/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/headers/header_int32_json_content_type_header/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/headers/header_int32_json_content_type_header/content/application_json/schema.py new file mode 100644 index 00000000000..dbe3b8f3aed --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/headers/header_int32_json_content_type_header/content/application_json/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.Int32Schema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/headers/header_int32_json_content_type_header/content/application_json/schema.pyi b/samples/openapi3/client/petstore/python/src/petstore_api/components/headers/header_int32_json_content_type_header/content/application_json/schema.pyi new file mode 100644 index 00000000000..dbe3b8f3aed --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/headers/header_int32_json_content_type_header/content/application_json/schema.pyi @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.Int32Schema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/headers/header_number_header/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/headers/header_number_header/__init__.py new file mode 100644 index 00000000000..d62d8f80f71 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/headers/header_number_header/__init__.py @@ -0,0 +1,18 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client +from . import schema + + +class NumberHeader(api_client.HeaderParameterWithoutName): + style = api_client.ParameterStyle.SIMPLE + schema = schema.Schema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/headers/header_number_header/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/headers/header_number_header/schema.py new file mode 100644 index 00000000000..688cdc8dfb0 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/headers/header_number_header/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.DecimalSchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/headers/header_number_header/schema.pyi b/samples/openapi3/client/petstore/python/src/petstore_api/components/headers/header_number_header/schema.pyi new file mode 100644 index 00000000000..688cdc8dfb0 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/headers/header_number_header/schema.pyi @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.DecimalSchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/headers/header_ref_content_schema_header/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/headers/header_ref_content_schema_header/__init__.py new file mode 100644 index 00000000000..38486305029 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/headers/header_ref_content_schema_header/__init__.py @@ -0,0 +1,31 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client +from .content.application_json import schema as application_json_schema + + +class RefContentSchemaHeader(api_client.HeaderParameterWithoutName): + style = api_client.ParameterStyle.SIMPLE + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/headers/header_ref_content_schema_header/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/headers/header_ref_content_schema_header/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/headers/header_ref_content_schema_header/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/headers/header_ref_content_schema_header/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/headers/header_ref_content_schema_header/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/headers/header_ref_content_schema_header/content/application_json/schema.py new file mode 100644 index 00000000000..96c02825f5a --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/headers/header_ref_content_schema_header/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.schema import string_with_validation +Schema = string_with_validation.StringWithValidation diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/headers/header_ref_content_schema_header/content/application_json/schema.pyi b/samples/openapi3/client/petstore/python/src/petstore_api/components/headers/header_ref_content_schema_header/content/application_json/schema.pyi new file mode 100644 index 00000000000..96c02825f5a --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/headers/header_ref_content_schema_header/content/application_json/schema.pyi @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.schema import string_with_validation +Schema = string_with_validation.StringWithValidation diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/headers/header_ref_schema_header/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/headers/header_ref_schema_header/__init__.py new file mode 100644 index 00000000000..505b1885675 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/headers/header_ref_schema_header/__init__.py @@ -0,0 +1,19 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client +from . import schema + + +class RefSchemaHeader(api_client.HeaderParameterWithoutName): + style = api_client.ParameterStyle.SIMPLE + schema = schema.Schema + required = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/headers/header_ref_schema_header/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/headers/header_ref_schema_header/schema.py new file mode 100644 index 00000000000..96c02825f5a --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/headers/header_ref_schema_header/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.schema import string_with_validation +Schema = string_with_validation.StringWithValidation diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/headers/header_ref_schema_header/schema.pyi b/samples/openapi3/client/petstore/python/src/petstore_api/components/headers/header_ref_schema_header/schema.pyi new file mode 100644 index 00000000000..96c02825f5a --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/headers/header_ref_schema_header/schema.pyi @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.schema import string_with_validation +Schema = string_with_validation.StringWithValidation diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/headers/header_ref_string_header/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/headers/header_ref_string_header/__init__.py new file mode 100644 index 00000000000..6e12478b039 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/headers/header_ref_string_header/__init__.py @@ -0,0 +1,11 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.headers import header_string_header +RefStringHeader = header_string_header.StringHeader diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/headers/header_string_header/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/headers/header_string_header/__init__.py new file mode 100644 index 00000000000..a999165ae41 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/headers/header_string_header/__init__.py @@ -0,0 +1,19 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client +from . import schema + + +class StringHeader(api_client.HeaderParameterWithoutName): + style = api_client.ParameterStyle.SIMPLE + schema = schema.Schema + required = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/headers/header_string_header/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/headers/header_string_header/schema.py new file mode 100644 index 00000000000..0518c0e6e64 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/headers/header_string_header/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.StrSchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/headers/header_string_header/schema.pyi b/samples/openapi3/client/petstore/python/src/petstore_api/components/headers/header_string_header/schema.pyi new file mode 100644 index 00000000000..0518c0e6e64 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/headers/header_string_header/schema.pyi @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.StrSchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/parameters/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/parameters/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/parameters/parameter_component_ref_schema_string_with_validation/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/parameters/parameter_component_ref_schema_string_with_validation/__init__.py new file mode 100644 index 00000000000..8e4ab26fd10 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/parameters/parameter_component_ref_schema_string_with_validation/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client + +from .content.application_json import schema as application_json_schema + + +class ComponentRefSchemaStringWithValidation(api_client.PathParameter): + name = "CRSstringWithValidation" + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/parameters/parameter_component_ref_schema_string_with_validation/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/parameters/parameter_component_ref_schema_string_with_validation/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/parameters/parameter_component_ref_schema_string_with_validation/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/parameters/parameter_component_ref_schema_string_with_validation/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/parameters/parameter_component_ref_schema_string_with_validation/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/parameters/parameter_component_ref_schema_string_with_validation/content/application_json/schema.py new file mode 100644 index 00000000000..96c02825f5a --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/parameters/parameter_component_ref_schema_string_with_validation/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.schema import string_with_validation +Schema = string_with_validation.StringWithValidation diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/parameters/parameter_component_ref_schema_string_with_validation/content/application_json/schema.pyi b/samples/openapi3/client/petstore/python/src/petstore_api/components/parameters/parameter_component_ref_schema_string_with_validation/content/application_json/schema.pyi new file mode 100644 index 00000000000..96c02825f5a --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/parameters/parameter_component_ref_schema_string_with_validation/content/application_json/schema.pyi @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.schema import string_with_validation +Schema = string_with_validation.StringWithValidation diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/parameters/parameter_path_user_name/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/parameters/parameter_path_user_name/__init__.py new file mode 100644 index 00000000000..ee14122089d --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/parameters/parameter_path_user_name/__init__.py @@ -0,0 +1,21 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client + +from . import schema + + +class PathUserName(api_client.PathParameter): + name = "username" + style = api_client.ParameterStyle.SIMPLE + schema = schema.Schema + required = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/parameters/parameter_path_user_name/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/parameters/parameter_path_user_name/schema.py new file mode 100644 index 00000000000..0518c0e6e64 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/parameters/parameter_path_user_name/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.StrSchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/parameters/parameter_path_user_name/schema.pyi b/samples/openapi3/client/petstore/python/src/petstore_api/components/parameters/parameter_path_user_name/schema.pyi new file mode 100644 index 00000000000..0518c0e6e64 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/parameters/parameter_path_user_name/schema.pyi @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.StrSchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/parameters/parameter_ref_path_user_name/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/parameters/parameter_ref_path_user_name/__init__.py new file mode 100644 index 00000000000..ef0641db565 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/parameters/parameter_ref_path_user_name/__init__.py @@ -0,0 +1,11 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.parameters import parameter_path_user_name +RefPathUserName = parameter_path_user_name.PathUserName diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/parameters/parameter_ref_schema_string_with_validation/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/parameters/parameter_ref_schema_string_with_validation/__init__.py new file mode 100644 index 00000000000..331d98a5e09 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/parameters/parameter_ref_schema_string_with_validation/__init__.py @@ -0,0 +1,21 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client + +from . import schema + + +class RefSchemaStringWithValidation(api_client.PathParameter): + name = "RSstringWithValidation" + style = api_client.ParameterStyle.SIMPLE + schema = schema.Schema + required = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/parameters/parameter_ref_schema_string_with_validation/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/parameters/parameter_ref_schema_string_with_validation/schema.py new file mode 100644 index 00000000000..96c02825f5a --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/parameters/parameter_ref_schema_string_with_validation/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.schema import string_with_validation +Schema = string_with_validation.StringWithValidation diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/parameters/parameter_ref_schema_string_with_validation/schema.pyi b/samples/openapi3/client/petstore/python/src/petstore_api/components/parameters/parameter_ref_schema_string_with_validation/schema.pyi new file mode 100644 index 00000000000..96c02825f5a --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/parameters/parameter_ref_schema_string_with_validation/schema.pyi @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.schema import string_with_validation +Schema = string_with_validation.StringWithValidation diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/request_bodies/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/request_bodies/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/request_bodies/request_body_client/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/request_bodies/request_body_client/__init__.py new file mode 100644 index 00000000000..c96feb49812 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/request_bodies/request_body_client/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client +from .content.application_json import schema as application_json_schema + +class Client(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/request_bodies/request_body_client/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/request_bodies/request_body_client/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/request_bodies/request_body_client/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/request_bodies/request_body_client/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/request_bodies/request_body_client/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/request_bodies/request_body_client/content/application_json/schema.py new file mode 100644 index 00000000000..b5013031afd --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/request_bodies/request_body_client/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.schema import client +Schema = client.Client diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/request_bodies/request_body_client/content/application_json/schema.pyi b/samples/openapi3/client/petstore/python/src/petstore_api/components/request_bodies/request_body_client/content/application_json/schema.pyi new file mode 100644 index 00000000000..b5013031afd --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/request_bodies/request_body_client/content/application_json/schema.pyi @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.schema import client +Schema = client.Client diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/request_bodies/request_body_pet/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/request_bodies/request_body_pet/__init__.py new file mode 100644 index 00000000000..78bca9dcc94 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/request_bodies/request_body_pet/__init__.py @@ -0,0 +1,36 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client +from .content.application_json import schema as application_json_schema +from .content.application_xml import schema as application_xml_schema + +class Pet(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + + + class __ApplicationXmlMediaType(api_client.MediaType): + schema: typing.Type[application_xml_schema.Schema] = application_xml_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + 'application/xml': typing.Type[__ApplicationXmlMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + 'application/xml': __ApplicationXmlMediaType, + } + required = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/request_bodies/request_body_pet/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/request_bodies/request_body_pet/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/request_bodies/request_body_pet/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/request_bodies/request_body_pet/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/request_bodies/request_body_pet/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/request_bodies/request_body_pet/content/application_json/schema.py new file mode 100644 index 00000000000..cf483f6eb79 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/request_bodies/request_body_pet/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.schema import pet +Schema = pet.Pet diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/request_bodies/request_body_pet/content/application_json/schema.pyi b/samples/openapi3/client/petstore/python/src/petstore_api/components/request_bodies/request_body_pet/content/application_json/schema.pyi new file mode 100644 index 00000000000..cf483f6eb79 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/request_bodies/request_body_pet/content/application_json/schema.pyi @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.schema import pet +Schema = pet.Pet diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/request_bodies/request_body_pet/content/application_xml/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/request_bodies/request_body_pet/content/application_xml/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/request_bodies/request_body_pet/content/application_xml/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/request_bodies/request_body_pet/content/application_xml/schema.py new file mode 100644 index 00000000000..8cafbc98d19 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/request_bodies/request_body_pet/content/application_xml/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.schema import ref_pet +Schema = ref_pet.RefPet diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/request_bodies/request_body_pet/content/application_xml/schema.pyi b/samples/openapi3/client/petstore/python/src/petstore_api/components/request_bodies/request_body_pet/content/application_xml/schema.pyi new file mode 100644 index 00000000000..8cafbc98d19 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/request_bodies/request_body_pet/content/application_xml/schema.pyi @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.schema import ref_pet +Schema = ref_pet.RefPet diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/request_bodies/request_body_ref_user_array/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/request_bodies/request_body_ref_user_array/__init__.py new file mode 100644 index 00000000000..70d5d098f6a --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/request_bodies/request_body_ref_user_array/__init__.py @@ -0,0 +1,11 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.request_bodies import request_body_user_array +RefUserArray = request_body_user_array.UserArray diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/request_bodies/request_body_user_array/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/request_bodies/request_body_user_array/__init__.py new file mode 100644 index 00000000000..8dfc8f887ed --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/request_bodies/request_body_user_array/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client +from .content.application_json import schema as application_json_schema + +class UserArray(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/request_bodies/request_body_user_array/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/request_bodies/request_body_user_array/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/request_bodies/request_body_user_array/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/request_bodies/request_body_user_array/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/request_bodies/request_body_user_array/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/request_bodies/request_body_user_array/content/application_json/schema.py new file mode 100644 index 00000000000..431e1b94c8e --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/request_bodies/request_body_user_array/content/application_json/schema.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Schema( + schemas.ListSchema +): + + + class Schema_: + types = {tuple} + + @staticmethod + def items() -> typing.Type['user.User']: + return user.User + + def __new__( + cls, + arg_: typing.Union[ + typing.Tuple[ + typing.Union['user.User', dict, frozendict.frozendict], ... + ], + typing.List[ + typing.Union['user.User', dict, frozendict.frozendict] + ], + ], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'Schema': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) + + def __getitem__(self, i: int) -> 'user.User': + return super().__getitem__(i) + +from petstore_api.components.schema import user diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/request_bodies/request_body_user_array/content/application_json/schema.pyi b/samples/openapi3/client/petstore/python/src/petstore_api/components/request_bodies/request_body_user_array/content/application_json/schema.pyi new file mode 100644 index 00000000000..431e1b94c8e --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/request_bodies/request_body_user_array/content/application_json/schema.pyi @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Schema( + schemas.ListSchema +): + + + class Schema_: + types = {tuple} + + @staticmethod + def items() -> typing.Type['user.User']: + return user.User + + def __new__( + cls, + arg_: typing.Union[ + typing.Tuple[ + typing.Union['user.User', dict, frozendict.frozendict], ... + ], + typing.List[ + typing.Union['user.User', dict, frozendict.frozendict] + ], + ], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'Schema': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) + + def __getitem__(self, i: int) -> 'user.User': + return super().__getitem__(i) + +from petstore_api.components.schema import user diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_ref_success_description_only/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_ref_success_description_only/__init__.py new file mode 100644 index 00000000000..13f1fd5bdca --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_ref_success_description_only/__init__.py @@ -0,0 +1,11 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.responses import response_success_description_only +RefSuccessDescriptionOnly = response_success_description_only.SuccessDescriptionOnly diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_ref_successful_xml_and_json_array_of_pet/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_ref_successful_xml_and_json_array_of_pet/__init__.py new file mode 100644 index 00000000000..2264dde1333 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_ref_successful_xml_and_json_array_of_pet/__init__.py @@ -0,0 +1,11 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.responses import response_successful_xml_and_json_array_of_pet +RefSuccessfulXmlAndJsonArrayOfPet = response_successful_xml_and_json_array_of_pet.SuccessfulXmlAndJsonArrayOfPet diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_success_description_only/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_success_description_only/__init__.py new file mode 100644 index 00000000000..d7ae7e49836 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_success_description_only/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class SuccessDescriptionOnly(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_success_inline_content_and_header/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_success_inline_content_and_header/__init__.py new file mode 100644 index 00000000000..e4b394495e6 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_success_inline_content_and_header/__init__.py @@ -0,0 +1,71 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas +from .content.application_json import schema as application_json_schema +from .headers import header_some_header + + +class Header: + RequiredParams = typing_extensions.TypedDict( + 'RequiredParams', + { + } + ) + OptionalParams = typing_extensions.TypedDict( + 'OptionalParams', + { + 'someHeader': typing.Union[header_some_header.SomeHeader.schema, str], + }, + total=False + ) + + + class Params(RequiredParams, OptionalParams): + pass + + + parameters = [ + header_some_header.SomeHeader, + ] + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: Header.Params + + +class SuccessInlineContentAndHeader(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + headers=Header.parameters diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_success_inline_content_and_header/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_success_inline_content_and_header/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_success_inline_content_and_header/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_success_inline_content_and_header/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_success_inline_content_and_header/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_success_inline_content_and_header/content/application_json/schema.py new file mode 100644 index 00000000000..e6423765d02 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_success_inline_content_and_header/content/application_json/schema.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Schema( + schemas.DictSchema +): + + + class Schema_: + types = {frozendict.frozendict} + AdditionalProperties = schemas.Int32Schema + + def __getitem__(self, name: str) -> Schema_.AdditionalProperties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def get_item_(self, name: str) -> Schema_.AdditionalProperties: + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[Schema_.AdditionalProperties, decimal.Decimal, int], + ) -> 'Schema': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_success_inline_content_and_header/content/application_json/schema.pyi b/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_success_inline_content_and_header/content/application_json/schema.pyi new file mode 100644 index 00000000000..896a90f022a --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_success_inline_content_and_header/content/application_json/schema.pyi @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Schema( + schemas.DictSchema +): + + + class Schema_: + AdditionalProperties = schemas.Int32Schema + + def __getitem__(self, name: str) -> Schema_.AdditionalProperties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def get_item_(self, name: str) -> Schema_.AdditionalProperties: + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[Schema_.AdditionalProperties, decimal.Decimal, int], + ) -> 'Schema': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_success_inline_content_and_header/headers/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_success_inline_content_and_header/headers/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_success_inline_content_and_header/headers/header_some_header/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_success_inline_content_and_header/headers/header_some_header/__init__.py new file mode 100644 index 00000000000..6667c9b4424 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_success_inline_content_and_header/headers/header_some_header/__init__.py @@ -0,0 +1,18 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client +from . import schema + + +class SomeHeader(api_client.HeaderParameterWithoutName): + style = api_client.ParameterStyle.SIMPLE + schema = schema.Schema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_success_inline_content_and_header/headers/header_some_header/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_success_inline_content_and_header/headers/header_some_header/schema.py new file mode 100644 index 00000000000..0518c0e6e64 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_success_inline_content_and_header/headers/header_some_header/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.StrSchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_success_inline_content_and_header/headers/header_some_header/schema.pyi b/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_success_inline_content_and_header/headers/header_some_header/schema.pyi new file mode 100644 index 00000000000..0518c0e6e64 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_success_inline_content_and_header/headers/header_some_header/schema.pyi @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.StrSchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_success_with_json_api_response/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_success_with_json_api_response/__init__.py new file mode 100644 index 00000000000..7ac12296dc9 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_success_with_json_api_response/__init__.py @@ -0,0 +1,83 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas +from .content.application_json import schema as application_json_schema +from .headers import header_ref_schema_header +from .headers import header_int32 +from .headers import header_ref_content_schema_header +from .headers import header_string_header +from .headers import header_number_header + + +class Header: + RequiredParams = typing_extensions.TypedDict( + 'RequiredParams', + { + 'ref-schema-header': typing.Union[header_ref_schema_header.RefSchemaHeader.schema, dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + 'int32': typing.Union[header_int32.Int32.content["application/json"].schema, decimal.Decimal, int], + 'ref-content-schema-header': typing.Union[header_ref_content_schema_header.RefContentSchemaHeader.content["application/json"].schema, dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + 'stringHeader': typing.Union[header_string_header.StringHeader.schema, str], + } + ) + OptionalParams = typing_extensions.TypedDict( + 'OptionalParams', + { + 'numberHeader': typing.Union[header_number_header.NumberHeader.schema, str], + }, + total=False + ) + + + class Params(RequiredParams, OptionalParams): + pass + + + parameters = [ + header_ref_schema_header.RefSchemaHeader, + header_int32.Int32, + header_ref_content_schema_header.RefContentSchemaHeader, + header_string_header.StringHeader, + header_number_header.NumberHeader, + ] + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: Header.Params + + +class SuccessWithJsonApiResponse(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + headers=Header.parameters diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_success_with_json_api_response/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_success_with_json_api_response/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_success_with_json_api_response/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_success_with_json_api_response/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_success_with_json_api_response/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_success_with_json_api_response/content/application_json/schema.py new file mode 100644 index 00000000000..38685cadefa --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_success_with_json_api_response/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.schema import api_response +Schema = api_response.ApiResponse diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_success_with_json_api_response/content/application_json/schema.pyi b/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_success_with_json_api_response/content/application_json/schema.pyi new file mode 100644 index 00000000000..38685cadefa --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_success_with_json_api_response/content/application_json/schema.pyi @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.schema import api_response +Schema = api_response.ApiResponse diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_success_with_json_api_response/headers/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_success_with_json_api_response/headers/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_success_with_json_api_response/headers/header_int32/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_success_with_json_api_response/headers/header_int32/__init__.py new file mode 100644 index 00000000000..bd696ad8603 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_success_with_json_api_response/headers/header_int32/__init__.py @@ -0,0 +1,11 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.headers import header_int32_json_content_type_header +Int32 = header_int32_json_content_type_header.Int32JsonContentTypeHeader diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_success_with_json_api_response/headers/header_number_header/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_success_with_json_api_response/headers/header_number_header/__init__.py new file mode 100644 index 00000000000..e4bf13be424 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_success_with_json_api_response/headers/header_number_header/__init__.py @@ -0,0 +1,11 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.headers import header_number_header +NumberHeader = header_number_header.NumberHeader diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_success_with_json_api_response/headers/header_ref_content_schema_header/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_success_with_json_api_response/headers/header_ref_content_schema_header/__init__.py new file mode 100644 index 00000000000..1095b306fa8 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_success_with_json_api_response/headers/header_ref_content_schema_header/__init__.py @@ -0,0 +1,11 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.headers import header_ref_content_schema_header +RefContentSchemaHeader = header_ref_content_schema_header.RefContentSchemaHeader diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_success_with_json_api_response/headers/header_ref_schema_header/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_success_with_json_api_response/headers/header_ref_schema_header/__init__.py new file mode 100644 index 00000000000..5f38c523d80 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_success_with_json_api_response/headers/header_ref_schema_header/__init__.py @@ -0,0 +1,11 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.headers import header_ref_schema_header +RefSchemaHeader = header_ref_schema_header.RefSchemaHeader diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_success_with_json_api_response/headers/header_string_header/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_success_with_json_api_response/headers/header_string_header/__init__.py new file mode 100644 index 00000000000..f9fb5b15f68 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_success_with_json_api_response/headers/header_string_header/__init__.py @@ -0,0 +1,11 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.headers import header_ref_string_header +StringHeader = header_ref_string_header.RefStringHeader diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_successful_xml_and_json_array_of_pet/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_successful_xml_and_json_array_of_pet/__init__.py new file mode 100644 index 00000000000..2bbe114c094 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_successful_xml_and_json_array_of_pet/__init__.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas +from .content.application_xml import schema as application_xml_schema +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + application_xml_schema.Schema, + application_json_schema.Schema, + ] + headers: schemas.Unset = schemas.unset + + +class SuccessfulXmlAndJsonArrayOfPet(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationXmlMediaType(api_client.MediaType): + schema: typing.Type[application_xml_schema.Schema] = application_xml_schema.Schema + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/xml': typing.Type[__ApplicationXmlMediaType], + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/xml': __ApplicationXmlMediaType, + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_successful_xml_and_json_array_of_pet/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_successful_xml_and_json_array_of_pet/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_successful_xml_and_json_array_of_pet/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_successful_xml_and_json_array_of_pet/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_successful_xml_and_json_array_of_pet/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_successful_xml_and_json_array_of_pet/content/application_json/schema.py new file mode 100644 index 00000000000..af0fcba9c2e --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_successful_xml_and_json_array_of_pet/content/application_json/schema.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Schema( + schemas.ListSchema +): + + + class Schema_: + types = {tuple} + + @staticmethod + def items() -> typing.Type['ref_pet.RefPet']: + return ref_pet.RefPet + + def __new__( + cls, + arg_: typing.Union[ + typing.Tuple[ + typing.Union['ref_pet.RefPet', dict, frozendict.frozendict], ... + ], + typing.List[ + typing.Union['ref_pet.RefPet', dict, frozendict.frozendict] + ], + ], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'Schema': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) + + def __getitem__(self, i: int) -> 'ref_pet.RefPet': + return super().__getitem__(i) + +from petstore_api.components.schema import ref_pet diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_successful_xml_and_json_array_of_pet/content/application_json/schema.pyi b/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_successful_xml_and_json_array_of_pet/content/application_json/schema.pyi new file mode 100644 index 00000000000..af0fcba9c2e --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_successful_xml_and_json_array_of_pet/content/application_json/schema.pyi @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Schema( + schemas.ListSchema +): + + + class Schema_: + types = {tuple} + + @staticmethod + def items() -> typing.Type['ref_pet.RefPet']: + return ref_pet.RefPet + + def __new__( + cls, + arg_: typing.Union[ + typing.Tuple[ + typing.Union['ref_pet.RefPet', dict, frozendict.frozendict], ... + ], + typing.List[ + typing.Union['ref_pet.RefPet', dict, frozendict.frozendict] + ], + ], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'Schema': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) + + def __getitem__(self, i: int) -> 'ref_pet.RefPet': + return super().__getitem__(i) + +from petstore_api.components.schema import ref_pet diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_successful_xml_and_json_array_of_pet/content/application_xml/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_successful_xml_and_json_array_of_pet/content/application_xml/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_successful_xml_and_json_array_of_pet/content/application_xml/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_successful_xml_and_json_array_of_pet/content/application_xml/schema.py new file mode 100644 index 00000000000..1e80197931f --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_successful_xml_and_json_array_of_pet/content/application_xml/schema.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Schema( + schemas.ListSchema +): + + + class Schema_: + types = {tuple} + + @staticmethod + def items() -> typing.Type['pet.Pet']: + return pet.Pet + + def __new__( + cls, + arg_: typing.Union[ + typing.Tuple[ + typing.Union['pet.Pet', dict, frozendict.frozendict], ... + ], + typing.List[ + typing.Union['pet.Pet', dict, frozendict.frozendict] + ], + ], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'Schema': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) + + def __getitem__(self, i: int) -> 'pet.Pet': + return super().__getitem__(i) + +from petstore_api.components.schema import pet diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_successful_xml_and_json_array_of_pet/content/application_xml/schema.pyi b/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_successful_xml_and_json_array_of_pet/content/application_xml/schema.pyi new file mode 100644 index 00000000000..1e80197931f --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_successful_xml_and_json_array_of_pet/content/application_xml/schema.pyi @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Schema( + schemas.ListSchema +): + + + class Schema_: + types = {tuple} + + @staticmethod + def items() -> typing.Type['pet.Pet']: + return pet.Pet + + def __new__( + cls, + arg_: typing.Union[ + typing.Tuple[ + typing.Union['pet.Pet', dict, frozendict.frozendict], ... + ], + typing.List[ + typing.Union['pet.Pet', dict, frozendict.frozendict] + ], + ], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'Schema': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) + + def __getitem__(self, i: int) -> 'pet.Pet': + return super().__getitem__(i) + +from petstore_api.components.schema import pet diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/_200_response.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/_200_response.py new file mode 100644 index 00000000000..98bee6ba407 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/_200_response.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class _200Response( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + + model with an invalid class name for python, starts with a number + """ + + + class Schema_: + # any type + + class Properties: + Name = schemas.Int32Schema + _Class = schemas.StrSchema + __annotations__ = { + "name": Name, + "class": _Class, + } + + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["name"]) -> Schema_.Properties.Name: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["class"]) -> Schema_.Properties._Class: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["name"], + typing_extensions.Literal["class"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["name"]) -> typing.Union[Schema_.Properties.Name, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["class"]) -> typing.Union[Schema_.Properties._Class, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["name"], + typing_extensions.Literal["class"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + name: typing.Union[Schema_.Properties.Name, decimal.Decimal, int, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> '_200Response': + return super().__new__( + cls, + *args_, + name=name, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/__init__.py new file mode 100644 index 00000000000..bc3f877293f --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/__init__.py @@ -0,0 +1,5 @@ +# we can not import model classes here because that would create a circular +# reference which would not work in python2 +# do not import all models into this module because that uses a lot of memory and stack frames +# if you need the ability to import all models from one package, import them with +# from petstore_api.components.schemas import ModelA, ModelB diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/_return.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/_return.py new file mode 100644 index 00000000000..97af31fa8cd --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/_return.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class _Return( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + + Model for testing reserved words + """ + + + class Schema_: + # any type + + class Properties: + _Return = schemas.Int32Schema + __annotations__ = { + "return": _Return, + } + + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["return"]) -> Schema_.Properties._Return: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["return"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["return"]) -> typing.Union[Schema_.Properties._Return, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["return"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> '_Return': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/abstract_step_message.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/abstract_step_message.py new file mode 100644 index 00000000000..d62ceed78d4 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/abstract_step_message.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class AbstractStepMessage( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + + Abstract Step + """ + + + class Schema_: + types = { + frozendict.frozendict, + } + required = { + "description", + "discriminator", + "sequenceNumber", + } + + @staticmethod + def discriminator(): + return { + 'discriminator': { + 'AbstractStepMessage': AbstractStepMessage, + } + } + + class Properties: + Discriminator = schemas.StrSchema + __annotations__ = { + "discriminator": Discriminator, + } + + class AnyOf: + + @staticmethod + def _0() -> typing.Type['AbstractStepMessage']: + return AbstractStepMessage + classes = [ + _0, + ] + + + description: schemas.AnyTypeSchema + discriminator: Schema_.Properties.Discriminator + sequenceNumber: schemas.AnyTypeSchema + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["description"]) -> schemas.AnyTypeSchema: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["discriminator"]) -> Schema_.Properties.Discriminator: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["sequenceNumber"]) -> schemas.AnyTypeSchema: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["description"], + typing_extensions.Literal["discriminator"], + typing_extensions.Literal["sequenceNumber"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["description"]) -> schemas.AnyTypeSchema: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["discriminator"]) -> Schema_.Properties.Discriminator: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["sequenceNumber"]) -> schemas.AnyTypeSchema: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["description"], + typing_extensions.Literal["discriminator"], + typing_extensions.Literal["sequenceNumber"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + description: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + discriminator: typing.Union[Schema_.Properties.Discriminator, str], + sequenceNumber: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'AbstractStepMessage': + return super().__new__( + cls, + *args_, + description=description, + discriminator=discriminator, + sequenceNumber=sequenceNumber, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/additional_properties_class.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/additional_properties_class.py new file mode 100644 index 00000000000..df84ac0b4c7 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/additional_properties_class.py @@ -0,0 +1,338 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class AdditionalPropertiesClass( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {frozendict.frozendict} + + class Properties: + + + class MapProperty( + schemas.DictSchema + ): + + + class Schema_: + types = {frozendict.frozendict} + AdditionalProperties = schemas.StrSchema + + def __getitem__(self, name: str) -> Schema_.AdditionalProperties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def get_item_(self, name: str) -> Schema_.AdditionalProperties: + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[Schema_.AdditionalProperties, str], + ) -> 'AdditionalPropertiesClass.Schema_.Properties.MapProperty': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + + + class MapOfMapProperty( + schemas.DictSchema + ): + + + class Schema_: + types = {frozendict.frozendict} + + + class AdditionalProperties( + schemas.DictSchema + ): + + + class Schema_: + types = {frozendict.frozendict} + AdditionalProperties = schemas.StrSchema + + def __getitem__(self, name: str) -> Schema_.AdditionalProperties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def get_item_(self, name: str) -> Schema_.AdditionalProperties: + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[Schema_.AdditionalProperties, str], + ) -> 'AdditionalPropertiesClass.Schema_.Properties.MapOfMapProperty.Schema_.AdditionalProperties': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + + def __getitem__(self, name: str) -> Schema_.AdditionalProperties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def get_item_(self, name: str) -> Schema_.AdditionalProperties: + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[Schema_.AdditionalProperties, dict, frozendict.frozendict], + ) -> 'AdditionalPropertiesClass.Schema_.Properties.MapOfMapProperty': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + Anytype1 = schemas.AnyTypeSchema + MapWithUndeclaredPropertiesAnytype1 = schemas.DictSchema + MapWithUndeclaredPropertiesAnytype2 = schemas.DictSchema + + + class MapWithUndeclaredPropertiesAnytype3( + schemas.DictSchema + ): + + + class Schema_: + types = {frozendict.frozendict} + AdditionalProperties = schemas.AnyTypeSchema + + def __getitem__(self, name: str) -> Schema_.AdditionalProperties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def get_item_(self, name: str) -> Schema_.AdditionalProperties: + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[Schema_.AdditionalProperties, dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + ) -> 'AdditionalPropertiesClass.Schema_.Properties.MapWithUndeclaredPropertiesAnytype3': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + + + class EmptyMap( + schemas.DictSchema + ): + + + class Schema_: + types = {frozendict.frozendict} + AdditionalProperties = schemas.NotAnyTypeSchema + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'AdditionalPropertiesClass.Schema_.Properties.EmptyMap': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + ) + + + class MapWithUndeclaredPropertiesString( + schemas.DictSchema + ): + + + class Schema_: + types = {frozendict.frozendict} + AdditionalProperties = schemas.StrSchema + + def __getitem__(self, name: str) -> Schema_.AdditionalProperties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def get_item_(self, name: str) -> Schema_.AdditionalProperties: + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[Schema_.AdditionalProperties, str], + ) -> 'AdditionalPropertiesClass.Schema_.Properties.MapWithUndeclaredPropertiesString': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + __annotations__ = { + "map_property": MapProperty, + "map_of_map_property": MapOfMapProperty, + "anytype_1": Anytype1, + "map_with_undeclared_properties_anytype_1": MapWithUndeclaredPropertiesAnytype1, + "map_with_undeclared_properties_anytype_2": MapWithUndeclaredPropertiesAnytype2, + "map_with_undeclared_properties_anytype_3": MapWithUndeclaredPropertiesAnytype3, + "empty_map": EmptyMap, + "map_with_undeclared_properties_string": MapWithUndeclaredPropertiesString, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["map_property"]) -> Schema_.Properties.MapProperty: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["map_of_map_property"]) -> Schema_.Properties.MapOfMapProperty: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["anytype_1"]) -> Schema_.Properties.Anytype1: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["map_with_undeclared_properties_anytype_1"]) -> Schema_.Properties.MapWithUndeclaredPropertiesAnytype1: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["map_with_undeclared_properties_anytype_2"]) -> Schema_.Properties.MapWithUndeclaredPropertiesAnytype2: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["map_with_undeclared_properties_anytype_3"]) -> Schema_.Properties.MapWithUndeclaredPropertiesAnytype3: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["empty_map"]) -> Schema_.Properties.EmptyMap: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["map_with_undeclared_properties_string"]) -> Schema_.Properties.MapWithUndeclaredPropertiesString: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["map_property"], + typing_extensions.Literal["map_of_map_property"], + typing_extensions.Literal["anytype_1"], + typing_extensions.Literal["map_with_undeclared_properties_anytype_1"], + typing_extensions.Literal["map_with_undeclared_properties_anytype_2"], + typing_extensions.Literal["map_with_undeclared_properties_anytype_3"], + typing_extensions.Literal["empty_map"], + typing_extensions.Literal["map_with_undeclared_properties_string"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["map_property"]) -> typing.Union[Schema_.Properties.MapProperty, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["map_of_map_property"]) -> typing.Union[Schema_.Properties.MapOfMapProperty, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["anytype_1"]) -> typing.Union[Schema_.Properties.Anytype1, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["map_with_undeclared_properties_anytype_1"]) -> typing.Union[Schema_.Properties.MapWithUndeclaredPropertiesAnytype1, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["map_with_undeclared_properties_anytype_2"]) -> typing.Union[Schema_.Properties.MapWithUndeclaredPropertiesAnytype2, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["map_with_undeclared_properties_anytype_3"]) -> typing.Union[Schema_.Properties.MapWithUndeclaredPropertiesAnytype3, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["empty_map"]) -> typing.Union[Schema_.Properties.EmptyMap, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["map_with_undeclared_properties_string"]) -> typing.Union[Schema_.Properties.MapWithUndeclaredPropertiesString, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["map_property"], + typing_extensions.Literal["map_of_map_property"], + typing_extensions.Literal["anytype_1"], + typing_extensions.Literal["map_with_undeclared_properties_anytype_1"], + typing_extensions.Literal["map_with_undeclared_properties_anytype_2"], + typing_extensions.Literal["map_with_undeclared_properties_anytype_3"], + typing_extensions.Literal["empty_map"], + typing_extensions.Literal["map_with_undeclared_properties_string"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + map_property: typing.Union[Schema_.Properties.MapProperty, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + map_of_map_property: typing.Union[Schema_.Properties.MapOfMapProperty, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + anytype_1: typing.Union[Schema_.Properties.Anytype1, dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + map_with_undeclared_properties_anytype_1: typing.Union[Schema_.Properties.MapWithUndeclaredPropertiesAnytype1, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + map_with_undeclared_properties_anytype_2: typing.Union[Schema_.Properties.MapWithUndeclaredPropertiesAnytype2, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + map_with_undeclared_properties_anytype_3: typing.Union[Schema_.Properties.MapWithUndeclaredPropertiesAnytype3, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + empty_map: typing.Union[Schema_.Properties.EmptyMap, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + map_with_undeclared_properties_string: typing.Union[Schema_.Properties.MapWithUndeclaredPropertiesString, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'AdditionalPropertiesClass': + return super().__new__( + cls, + *args_, + map_property=map_property, + map_of_map_property=map_of_map_property, + anytype_1=anytype_1, + map_with_undeclared_properties_anytype_1=map_with_undeclared_properties_anytype_1, + map_with_undeclared_properties_anytype_2=map_with_undeclared_properties_anytype_2, + map_with_undeclared_properties_anytype_3=map_with_undeclared_properties_anytype_3, + empty_map=empty_map, + map_with_undeclared_properties_string=map_with_undeclared_properties_string, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/additional_properties_validator.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/additional_properties_validator.py new file mode 100644 index 00000000000..7feb014e667 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/additional_properties_validator.py @@ -0,0 +1,196 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class AdditionalPropertiesValidator( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = { + frozendict.frozendict, + } + + class AllOf: + + + class _0( + schemas.DictSchema + ): + + + class Schema_: + types = {frozendict.frozendict} + AdditionalProperties = schemas.AnyTypeSchema + + def __getitem__(self, name: str) -> Schema_.AdditionalProperties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def get_item_(self, name: str) -> Schema_.AdditionalProperties: + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[Schema_.AdditionalProperties, dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + ) -> 'AdditionalPropertiesValidator.Schema_.AllOf._0': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + + + class _1( + schemas.DictSchema + ): + + + class Schema_: + types = {frozendict.frozendict} + + + class AdditionalProperties( + schemas.AnyTypeSchema, + ): + + + class Schema_: + # any type + min_length = 3 + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'AdditionalPropertiesValidator.Schema_.AllOf._1.Schema_.AdditionalProperties': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + + def __getitem__(self, name: str) -> Schema_.AdditionalProperties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def get_item_(self, name: str) -> Schema_.AdditionalProperties: + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[Schema_.AdditionalProperties, dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + ) -> 'AdditionalPropertiesValidator.Schema_.AllOf._1': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + + + class _2( + schemas.DictSchema + ): + + + class Schema_: + types = {frozendict.frozendict} + + + class AdditionalProperties( + schemas.AnyTypeSchema, + ): + + + class Schema_: + # any type + max_length = 5 + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'AdditionalPropertiesValidator.Schema_.AllOf._2.Schema_.AdditionalProperties': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + + def __getitem__(self, name: str) -> Schema_.AdditionalProperties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def get_item_(self, name: str) -> Schema_.AdditionalProperties: + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[Schema_.AdditionalProperties, dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + ) -> 'AdditionalPropertiesValidator.Schema_.AllOf._2': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + classes = [ + _0, + _1, + _2, + ] + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'AdditionalPropertiesValidator': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/additional_properties_with_array_of_enums.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/additional_properties_with_array_of_enums.py new file mode 100644 index 00000000000..aed8505f45c --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/additional_properties_with_array_of_enums.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class AdditionalPropertiesWithArrayOfEnums( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {frozendict.frozendict} + + + class AdditionalProperties( + schemas.ListSchema + ): + + + class Schema_: + types = {tuple} + + @staticmethod + def items() -> typing.Type['enum_class.EnumClass']: + return enum_class.EnumClass + + def __new__( + cls, + arg_: typing.Union[ + typing.Tuple[ + typing.Union['enum_class.EnumClass', str], ... + ], + typing.List[ + typing.Union['enum_class.EnumClass', str] + ], + ], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'AdditionalPropertiesWithArrayOfEnums.Schema_.AdditionalProperties': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) + + def __getitem__(self, i: int) -> 'enum_class.EnumClass': + return super().__getitem__(i) + + def __getitem__(self, name: str) -> Schema_.AdditionalProperties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def get_item_(self, name: str) -> Schema_.AdditionalProperties: + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[Schema_.AdditionalProperties, list, tuple], + ) -> 'AdditionalPropertiesWithArrayOfEnums': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + +from petstore_api.components.schema import enum_class diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/address.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/address.py new file mode 100644 index 00000000000..e20d1f05966 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/address.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Address( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {frozendict.frozendict} + AdditionalProperties = schemas.IntSchema + + def __getitem__(self, name: str) -> Schema_.AdditionalProperties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def get_item_(self, name: str) -> Schema_.AdditionalProperties: + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[Schema_.AdditionalProperties, decimal.Decimal, int], + ) -> 'Address': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/animal.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/animal.py new file mode 100644 index 00000000000..f62f7e591b4 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/animal.py @@ -0,0 +1,129 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Animal( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {frozendict.frozendict} + required = { + "className", + } + + @staticmethod + def discriminator(): + return { + 'className': { + 'Cat': cat.Cat, + 'Dog': dog.Dog, + } + } + + class Properties: + ClassName = schemas.StrSchema + + + class Color( + schemas.StrSchema + ): + + + class Schema_: + types = { + str, + } + default = "red" + __annotations__ = { + "className": ClassName, + "color": Color, + } + + className: Schema_.Properties.ClassName + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["className"]) -> Schema_.Properties.ClassName: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["color"]) -> Schema_.Properties.Color: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["className"], + typing_extensions.Literal["color"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["className"]) -> Schema_.Properties.ClassName: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["color"]) -> typing.Union[Schema_.Properties.Color, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["className"], + typing_extensions.Literal["color"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + className: typing.Union[Schema_.Properties.ClassName, str], + color: typing.Union[Schema_.Properties.Color, str, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'Animal': + return super().__new__( + cls, + *args_, + className=className, + color=color, + configuration_=configuration_, + **kwargs, + ) + +from petstore_api.components.schema import cat +from petstore_api.components.schema import dog diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/animal_farm.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/animal_farm.py new file mode 100644 index 00000000000..22bb53972bd --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/animal_farm.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class AnimalFarm( + schemas.ListSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {tuple} + + @staticmethod + def items() -> typing.Type['animal.Animal']: + return animal.Animal + + def __new__( + cls, + arg_: typing.Union[ + typing.Tuple[ + typing.Union['animal.Animal', dict, frozendict.frozendict], ... + ], + typing.List[ + typing.Union['animal.Animal', dict, frozendict.frozendict] + ], + ], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'AnimalFarm': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) + + def __getitem__(self, i: int) -> 'animal.Animal': + return super().__getitem__(i) + +from petstore_api.components.schema import animal diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/any_type_and_format.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/any_type_and_format.py new file mode 100644 index 00000000000..f199c17c3d6 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/any_type_and_format.py @@ -0,0 +1,392 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class AnyTypeAndFormat( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {frozendict.frozendict} + + class Properties: + + + class Uuid( + schemas.UUIDBase, + schemas.AnyTypeSchema, + ): + + + class Schema_: + # any type + format = 'uuid' + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'AnyTypeAndFormat.Schema_.Properties.Uuid': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + + + class Date( + schemas.DateBase, + schemas.AnyTypeSchema, + ): + + + class Schema_: + # any type + format = 'date' + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'AnyTypeAndFormat.Schema_.Properties.Date': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + + + class DateTime( + schemas.DateTimeBase, + schemas.AnyTypeSchema, + ): + + + class Schema_: + # any type + format = 'date-time' + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'AnyTypeAndFormat.Schema_.Properties.DateTime': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + + + class Number( + schemas.DecimalBase, + schemas.AnyTypeSchema, + ): + + + class Schema_: + # any type + format = 'number' + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'AnyTypeAndFormat.Schema_.Properties.Number': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + + + class Binary( + schemas.AnyTypeSchema, + ): + + + class Schema_: + # any type + format = 'binary' + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'AnyTypeAndFormat.Schema_.Properties.Binary': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + + + class Int32( + schemas.AnyTypeSchema, + ): + + + class Schema_: + # any type + format = 'int32' + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'AnyTypeAndFormat.Schema_.Properties.Int32': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + + + class Int64( + schemas.AnyTypeSchema, + ): + + + class Schema_: + # any type + format = 'int64' + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'AnyTypeAndFormat.Schema_.Properties.Int64': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + + + class Double( + schemas.AnyTypeSchema, + ): + + + class Schema_: + # any type + format = 'double' + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'AnyTypeAndFormat.Schema_.Properties.Double': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + + + class _Float( + schemas.AnyTypeSchema, + ): + + + class Schema_: + # any type + format = 'float' + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'AnyTypeAndFormat.Schema_.Properties._Float': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + __annotations__ = { + "uuid": Uuid, + "date": Date, + "date-time": DateTime, + "number": Number, + "binary": Binary, + "int32": Int32, + "int64": Int64, + "double": Double, + "float": _Float, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["uuid"]) -> Schema_.Properties.Uuid: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["date"]) -> Schema_.Properties.Date: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["date-time"]) -> Schema_.Properties.DateTime: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["number"]) -> Schema_.Properties.Number: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["binary"]) -> Schema_.Properties.Binary: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["int32"]) -> Schema_.Properties.Int32: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["int64"]) -> Schema_.Properties.Int64: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["double"]) -> Schema_.Properties.Double: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["float"]) -> Schema_.Properties._Float: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["uuid"], + typing_extensions.Literal["date"], + typing_extensions.Literal["date-time"], + typing_extensions.Literal["number"], + typing_extensions.Literal["binary"], + typing_extensions.Literal["int32"], + typing_extensions.Literal["int64"], + typing_extensions.Literal["double"], + typing_extensions.Literal["float"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["uuid"]) -> typing.Union[Schema_.Properties.Uuid, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["date"]) -> typing.Union[Schema_.Properties.Date, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["date-time"]) -> typing.Union[Schema_.Properties.DateTime, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["number"]) -> typing.Union[Schema_.Properties.Number, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["binary"]) -> typing.Union[Schema_.Properties.Binary, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["int32"]) -> typing.Union[Schema_.Properties.Int32, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["int64"]) -> typing.Union[Schema_.Properties.Int64, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["double"]) -> typing.Union[Schema_.Properties.Double, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["float"]) -> typing.Union[Schema_.Properties._Float, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["uuid"], + typing_extensions.Literal["date"], + typing_extensions.Literal["date-time"], + typing_extensions.Literal["number"], + typing_extensions.Literal["binary"], + typing_extensions.Literal["int32"], + typing_extensions.Literal["int64"], + typing_extensions.Literal["double"], + typing_extensions.Literal["float"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + uuid: typing.Union[Schema_.Properties.Uuid, dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + date: typing.Union[Schema_.Properties.Date, dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + number: typing.Union[Schema_.Properties.Number, dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + binary: typing.Union[Schema_.Properties.Binary, dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + int32: typing.Union[Schema_.Properties.Int32, dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + int64: typing.Union[Schema_.Properties.Int64, dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + double: typing.Union[Schema_.Properties.Double, dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'AnyTypeAndFormat': + return super().__new__( + cls, + *args_, + uuid=uuid, + date=date, + number=number, + binary=binary, + int32=int32, + int64=int64, + double=double, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/any_type_not_string.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/any_type_not_string.py new file mode 100644 index 00000000000..db3f0063b57 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/any_type_not_string.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class AnyTypeNotString( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + _Not = schemas.StrSchema + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'AnyTypeNotString': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/api_response.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/api_response.py new file mode 100644 index 00000000000..7379961b09c --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/api_response.py @@ -0,0 +1,113 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ApiResponse( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {frozendict.frozendict} + + class Properties: + Code = schemas.Int32Schema + Type = schemas.StrSchema + Message = schemas.StrSchema + __annotations__ = { + "code": Code, + "type": Type, + "message": Message, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["code"]) -> Schema_.Properties.Code: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["type"]) -> Schema_.Properties.Type: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["message"]) -> Schema_.Properties.Message: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["code"], + typing_extensions.Literal["type"], + typing_extensions.Literal["message"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["code"]) -> typing.Union[Schema_.Properties.Code, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["type"]) -> typing.Union[Schema_.Properties.Type, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["message"]) -> typing.Union[Schema_.Properties.Message, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["code"], + typing_extensions.Literal["type"], + typing_extensions.Literal["message"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + code: typing.Union[Schema_.Properties.Code, decimal.Decimal, int, schemas.Unset] = schemas.unset, + type: typing.Union[Schema_.Properties.Type, str, schemas.Unset] = schemas.unset, + message: typing.Union[Schema_.Properties.Message, str, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'ApiResponse': + return super().__new__( + cls, + *args_, + code=code, + type=type, + message=message, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/apple.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/apple.py new file mode 100644 index 00000000000..65b77502ca0 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/apple.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Apple( + schemas.NoneBase, + schemas.DictBase, + schemas.Schema, + schemas.NoneFrozenDictMixin +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = { + schemas.NoneClass, + frozendict.frozendict, + } + required = { + "cultivar", + } + + class Properties: + + + class Cultivar( + schemas.StrSchema + ): + + + class Schema_: + types = { + str, + } + regex={ + 'pattern': r'^[a-zA-Z\s]*$', # noqa: E501 + } + + + class Origin( + schemas.StrSchema + ): + + + class Schema_: + types = { + str, + } + regex={ + 'pattern': r'^[A-Z\s]*$', # noqa: E501 + 'flags': re.I, + } + __annotations__ = { + "cultivar": Cultivar, + "origin": Origin, + } + + + cultivar: Schema_.Properties.Cultivar + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["cultivar"]) -> Schema_.Properties.Cultivar: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["origin"]) -> Schema_.Properties.Origin: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["cultivar"], + typing_extensions.Literal["origin"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["cultivar"]) -> Schema_.Properties.Cultivar: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["origin"]) -> typing.Union[Schema_.Properties.Origin, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["cultivar"], + typing_extensions.Literal["origin"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[None, dict, frozendict.frozendict], + origin: typing.Union[Schema_.Properties.Origin, str, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'Apple': + return super().__new__( + cls, + *args_, + origin=origin, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/apple_req.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/apple_req.py new file mode 100644 index 00000000000..67889e32d97 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/apple_req.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class AppleReq( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {frozendict.frozendict} + required = { + "cultivar", + } + + class Properties: + Cultivar = schemas.StrSchema + Mealy = schemas.BoolSchema + __annotations__ = { + "cultivar": Cultivar, + "mealy": Mealy, + } + AdditionalProperties = schemas.NotAnyTypeSchema + + cultivar: Schema_.Properties.Cultivar + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["cultivar"]) -> Schema_.Properties.Cultivar: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["mealy"]) -> Schema_.Properties.Mealy: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["cultivar"], + typing_extensions.Literal["mealy"], + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["cultivar"]) -> Schema_.Properties.Cultivar: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["mealy"]) -> typing.Union[Schema_.Properties.Mealy, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["cultivar"], + typing_extensions.Literal["mealy"], + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + cultivar: typing.Union[Schema_.Properties.Cultivar, str], + mealy: typing.Union[Schema_.Properties.Mealy, bool, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'AppleReq': + return super().__new__( + cls, + *args_, + cultivar=cultivar, + mealy=mealy, + configuration_=configuration_, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/array_holding_any_type.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/array_holding_any_type.py new file mode 100644 index 00000000000..5ac0bf2a3a9 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/array_holding_any_type.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ArrayHoldingAnyType( + schemas.ListSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {tuple} + Items = schemas.AnyTypeSchema + + def __new__( + cls, + arg_: typing.Union[ + typing.Tuple[ + typing.Union[Schema_.Items, dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], ... + ], + typing.List[ + typing.Union[Schema_.Items, dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] + ], + ], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'ArrayHoldingAnyType': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) + + def __getitem__(self, i: int) -> Schema_.Items: + return super().__getitem__(i) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/array_of_array_of_number_only.py new file mode 100644 index 00000000000..986742694ac --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/array_of_array_of_number_only.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ArrayOfArrayOfNumberOnly( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {frozendict.frozendict} + + class Properties: + + + class ArrayArrayNumber( + schemas.ListSchema + ): + + + class Schema_: + types = {tuple} + + + class Items( + schemas.ListSchema + ): + + + class Schema_: + types = {tuple} + Items = schemas.NumberSchema + + def __new__( + cls, + arg_: typing.Union[ + typing.Tuple[ + typing.Union[Schema_.Items, decimal.Decimal, int, float], ... + ], + typing.List[ + typing.Union[Schema_.Items, decimal.Decimal, int, float] + ], + ], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'ArrayOfArrayOfNumberOnly.Schema_.Properties.ArrayArrayNumber.Schema_.Items': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) + + def __getitem__(self, i: int) -> Schema_.Items: + return super().__getitem__(i) + + def __new__( + cls, + arg_: typing.Union[ + typing.Tuple[ + typing.Union[Schema_.Items, list, tuple], ... + ], + typing.List[ + typing.Union[Schema_.Items, list, tuple] + ], + ], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'ArrayOfArrayOfNumberOnly.Schema_.Properties.ArrayArrayNumber': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) + + def __getitem__(self, i: int) -> Schema_.Items: + return super().__getitem__(i) + __annotations__ = { + "ArrayArrayNumber": ArrayArrayNumber, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["ArrayArrayNumber"]) -> Schema_.Properties.ArrayArrayNumber: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["ArrayArrayNumber"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["ArrayArrayNumber"]) -> typing.Union[Schema_.Properties.ArrayArrayNumber, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["ArrayArrayNumber"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + ArrayArrayNumber: typing.Union[Schema_.Properties.ArrayArrayNumber, list, tuple, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'ArrayOfArrayOfNumberOnly': + return super().__new__( + cls, + *args_, + ArrayArrayNumber=ArrayArrayNumber, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/array_of_enums.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/array_of_enums.py new file mode 100644 index 00000000000..18e25156e17 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/array_of_enums.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ArrayOfEnums( + schemas.ListSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {tuple} + + @staticmethod + def items() -> typing.Type['string_enum.StringEnum']: + return string_enum.StringEnum + + def __new__( + cls, + arg_: typing.Union[ + typing.Tuple[ + typing.Union['string_enum.StringEnum', None, str], ... + ], + typing.List[ + typing.Union['string_enum.StringEnum', None, str] + ], + ], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'ArrayOfEnums': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) + + def __getitem__(self, i: int) -> 'string_enum.StringEnum': + return super().__getitem__(i) + +from petstore_api.components.schema import string_enum diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/array_of_number_only.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/array_of_number_only.py new file mode 100644 index 00000000000..c84b8499491 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/array_of_number_only.py @@ -0,0 +1,119 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ArrayOfNumberOnly( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {frozendict.frozendict} + + class Properties: + + + class ArrayNumber( + schemas.ListSchema + ): + + + class Schema_: + types = {tuple} + Items = schemas.NumberSchema + + def __new__( + cls, + arg_: typing.Union[ + typing.Tuple[ + typing.Union[Schema_.Items, decimal.Decimal, int, float], ... + ], + typing.List[ + typing.Union[Schema_.Items, decimal.Decimal, int, float] + ], + ], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'ArrayOfNumberOnly.Schema_.Properties.ArrayNumber': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) + + def __getitem__(self, i: int) -> Schema_.Items: + return super().__getitem__(i) + __annotations__ = { + "ArrayNumber": ArrayNumber, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["ArrayNumber"]) -> Schema_.Properties.ArrayNumber: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["ArrayNumber"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["ArrayNumber"]) -> typing.Union[Schema_.Properties.ArrayNumber, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["ArrayNumber"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + ArrayNumber: typing.Union[Schema_.Properties.ArrayNumber, list, tuple, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'ArrayOfNumberOnly': + return super().__new__( + cls, + *args_, + ArrayNumber=ArrayNumber, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/array_test.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/array_test.py new file mode 100644 index 00000000000..9161235e324 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/array_test.py @@ -0,0 +1,268 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ArrayTest( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {frozendict.frozendict} + + class Properties: + + + class ArrayOfString( + schemas.ListSchema + ): + + + class Schema_: + types = {tuple} + Items = schemas.StrSchema + + def __new__( + cls, + arg_: typing.Union[ + typing.Tuple[ + typing.Union[Schema_.Items, str], ... + ], + typing.List[ + typing.Union[Schema_.Items, str] + ], + ], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'ArrayTest.Schema_.Properties.ArrayOfString': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) + + def __getitem__(self, i: int) -> Schema_.Items: + return super().__getitem__(i) + + + class ArrayArrayOfInteger( + schemas.ListSchema + ): + + + class Schema_: + types = {tuple} + + + class Items( + schemas.ListSchema + ): + + + class Schema_: + types = {tuple} + Items = schemas.Int64Schema + + def __new__( + cls, + arg_: typing.Union[ + typing.Tuple[ + typing.Union[Schema_.Items, decimal.Decimal, int], ... + ], + typing.List[ + typing.Union[Schema_.Items, decimal.Decimal, int] + ], + ], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'ArrayTest.Schema_.Properties.ArrayArrayOfInteger.Schema_.Items': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) + + def __getitem__(self, i: int) -> Schema_.Items: + return super().__getitem__(i) + + def __new__( + cls, + arg_: typing.Union[ + typing.Tuple[ + typing.Union[Schema_.Items, list, tuple], ... + ], + typing.List[ + typing.Union[Schema_.Items, list, tuple] + ], + ], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'ArrayTest.Schema_.Properties.ArrayArrayOfInteger': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) + + def __getitem__(self, i: int) -> Schema_.Items: + return super().__getitem__(i) + + + class ArrayArrayOfModel( + schemas.ListSchema + ): + + + class Schema_: + types = {tuple} + + + class Items( + schemas.ListSchema + ): + + + class Schema_: + types = {tuple} + + @staticmethod + def items() -> typing.Type['read_only_first.ReadOnlyFirst']: + return read_only_first.ReadOnlyFirst + + def __new__( + cls, + arg_: typing.Union[ + typing.Tuple[ + typing.Union['read_only_first.ReadOnlyFirst', dict, frozendict.frozendict], ... + ], + typing.List[ + typing.Union['read_only_first.ReadOnlyFirst', dict, frozendict.frozendict] + ], + ], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'ArrayTest.Schema_.Properties.ArrayArrayOfModel.Schema_.Items': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) + + def __getitem__(self, i: int) -> 'read_only_first.ReadOnlyFirst': + return super().__getitem__(i) + + def __new__( + cls, + arg_: typing.Union[ + typing.Tuple[ + typing.Union[Schema_.Items, list, tuple], ... + ], + typing.List[ + typing.Union[Schema_.Items, list, tuple] + ], + ], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'ArrayTest.Schema_.Properties.ArrayArrayOfModel': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) + + def __getitem__(self, i: int) -> Schema_.Items: + return super().__getitem__(i) + __annotations__ = { + "array_of_string": ArrayOfString, + "array_array_of_integer": ArrayArrayOfInteger, + "array_array_of_model": ArrayArrayOfModel, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["array_of_string"]) -> Schema_.Properties.ArrayOfString: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["array_array_of_integer"]) -> Schema_.Properties.ArrayArrayOfInteger: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["array_array_of_model"]) -> Schema_.Properties.ArrayArrayOfModel: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["array_of_string"], + typing_extensions.Literal["array_array_of_integer"], + typing_extensions.Literal["array_array_of_model"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["array_of_string"]) -> typing.Union[Schema_.Properties.ArrayOfString, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["array_array_of_integer"]) -> typing.Union[Schema_.Properties.ArrayArrayOfInteger, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["array_array_of_model"]) -> typing.Union[Schema_.Properties.ArrayArrayOfModel, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["array_of_string"], + typing_extensions.Literal["array_array_of_integer"], + typing_extensions.Literal["array_array_of_model"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + array_of_string: typing.Union[Schema_.Properties.ArrayOfString, list, tuple, schemas.Unset] = schemas.unset, + array_array_of_integer: typing.Union[Schema_.Properties.ArrayArrayOfInteger, list, tuple, schemas.Unset] = schemas.unset, + array_array_of_model: typing.Union[Schema_.Properties.ArrayArrayOfModel, list, tuple, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'ArrayTest': + return super().__new__( + cls, + *args_, + array_of_string=array_of_string, + array_array_of_integer=array_array_of_integer, + array_array_of_model=array_array_of_model, + configuration_=configuration_, + **kwargs, + ) + +from petstore_api.components.schema import read_only_first diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/array_with_validations_in_items.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/array_with_validations_in_items.py new file mode 100644 index 00000000000..44f7698ff7b --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/array_with_validations_in_items.py @@ -0,0 +1,72 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ArrayWithValidationsInItems( + schemas.ListSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {tuple} + max_items = 2 + + + class Items( + schemas.Int64Schema + ): + + + class Schema_: + types = { + decimal.Decimal, + } + format = 'int64' + inclusive_maximum = 7 + + def __new__( + cls, + arg_: typing.Union[ + typing.Tuple[ + typing.Union[Schema_.Items, decimal.Decimal, int], ... + ], + typing.List[ + typing.Union[Schema_.Items, decimal.Decimal, int] + ], + ], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'ArrayWithValidationsInItems': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) + + def __getitem__(self, i: int) -> Schema_.Items: + return super().__getitem__(i) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/banana.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/banana.py new file mode 100644 index 00000000000..edefc0f0e7f --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/banana.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Banana( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {frozendict.frozendict} + required = { + "lengthCm", + } + + class Properties: + LengthCm = schemas.NumberSchema + __annotations__ = { + "lengthCm": LengthCm, + } + + lengthCm: Schema_.Properties.LengthCm + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["lengthCm"]) -> Schema_.Properties.LengthCm: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["lengthCm"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["lengthCm"]) -> Schema_.Properties.LengthCm: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["lengthCm"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + lengthCm: typing.Union[Schema_.Properties.LengthCm, decimal.Decimal, int, float], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'Banana': + return super().__new__( + cls, + *args_, + lengthCm=lengthCm, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/banana_req.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/banana_req.py new file mode 100644 index 00000000000..3acf179ce17 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/banana_req.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class BananaReq( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {frozendict.frozendict} + required = { + "lengthCm", + } + + class Properties: + LengthCm = schemas.NumberSchema + Sweet = schemas.BoolSchema + __annotations__ = { + "lengthCm": LengthCm, + "sweet": Sweet, + } + AdditionalProperties = schemas.NotAnyTypeSchema + + lengthCm: Schema_.Properties.LengthCm + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["lengthCm"]) -> Schema_.Properties.LengthCm: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["sweet"]) -> Schema_.Properties.Sweet: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["lengthCm"], + typing_extensions.Literal["sweet"], + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["lengthCm"]) -> Schema_.Properties.LengthCm: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["sweet"]) -> typing.Union[Schema_.Properties.Sweet, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["lengthCm"], + typing_extensions.Literal["sweet"], + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + lengthCm: typing.Union[Schema_.Properties.LengthCm, decimal.Decimal, int, float], + sweet: typing.Union[Schema_.Properties.Sweet, bool, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'BananaReq': + return super().__new__( + cls, + *args_, + lengthCm=lengthCm, + sweet=sweet, + configuration_=configuration_, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/bar.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/bar.py new file mode 100644 index 00000000000..48b0d4bf378 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/bar.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Bar( + schemas.StrSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = { + str, + } + default = "bar" diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/basque_pig.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/basque_pig.py new file mode 100644 index 00000000000..d28d08d956e --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/basque_pig.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class BasquePig( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {frozendict.frozendict} + required = { + "className", + } + + class Properties: + + + class ClassName( + schemas.StrSchema + ): + + + class Schema_: + types = { + str, + } + enum_value_to_name = { + "BasquePig": "BASQUE_PIG", + } + + @schemas.classproperty + def BASQUE_PIG(cls): + return cls("BasquePig") + __annotations__ = { + "className": ClassName, + } + + className: Schema_.Properties.ClassName + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["className"]) -> Schema_.Properties.ClassName: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["className"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["className"]) -> Schema_.Properties.ClassName: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["className"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + className: typing.Union[Schema_.Properties.ClassName, str], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'BasquePig': + return super().__new__( + cls, + *args_, + className=className, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/boolean.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/boolean.py similarity index 82% rename from samples/openapi3/client/petstore/python/petstore_api/model/boolean.py rename to samples/openapi3/client/petstore/python/src/petstore_api/components/schema/boolean.py index 6f667d4c0b4..74f06ecfb9b 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/boolean.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/boolean.py @@ -6,10 +6,10 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ -from datetime import date, datetime # noqa: F401 +import datetime # noqa: F401 import decimal # noqa: F401 import functools # noqa: F401 import io # noqa: F401 diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/boolean_enum.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/boolean_enum.py new file mode 100644 index 00000000000..72f8c5e4d65 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/boolean_enum.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class BooleanEnum( + schemas.BoolSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = { + schemas.BoolClass, + } + enum_value_to_name = { + schemas.BoolClass.TRUE: "TRUE", + } + + @schemas.classproperty + def TRUE(cls): + return cls(True) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/capitalization.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/capitalization.py new file mode 100644 index 00000000000..bdf9575c69a --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/capitalization.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Capitalization( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {frozendict.frozendict} + + class Properties: + SmallCamel = schemas.StrSchema + CapitalCamel = schemas.StrSchema + SmallSnake = schemas.StrSchema + CapitalSnake = schemas.StrSchema + SCAETHFlowPoints = schemas.StrSchema + ATTNAME = schemas.StrSchema + __annotations__ = { + "smallCamel": SmallCamel, + "CapitalCamel": CapitalCamel, + "small_Snake": SmallSnake, + "Capital_Snake": CapitalSnake, + "SCA_ETH_Flow_Points": SCAETHFlowPoints, + "ATT_NAME": ATTNAME, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["smallCamel"]) -> Schema_.Properties.SmallCamel: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["CapitalCamel"]) -> Schema_.Properties.CapitalCamel: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["small_Snake"]) -> Schema_.Properties.SmallSnake: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["Capital_Snake"]) -> Schema_.Properties.CapitalSnake: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["SCA_ETH_Flow_Points"]) -> Schema_.Properties.SCAETHFlowPoints: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["ATT_NAME"]) -> Schema_.Properties.ATTNAME: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["smallCamel"], + typing_extensions.Literal["CapitalCamel"], + typing_extensions.Literal["small_Snake"], + typing_extensions.Literal["Capital_Snake"], + typing_extensions.Literal["SCA_ETH_Flow_Points"], + typing_extensions.Literal["ATT_NAME"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["smallCamel"]) -> typing.Union[Schema_.Properties.SmallCamel, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["CapitalCamel"]) -> typing.Union[Schema_.Properties.CapitalCamel, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["small_Snake"]) -> typing.Union[Schema_.Properties.SmallSnake, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["Capital_Snake"]) -> typing.Union[Schema_.Properties.CapitalSnake, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["SCA_ETH_Flow_Points"]) -> typing.Union[Schema_.Properties.SCAETHFlowPoints, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["ATT_NAME"]) -> typing.Union[Schema_.Properties.ATTNAME, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["smallCamel"], + typing_extensions.Literal["CapitalCamel"], + typing_extensions.Literal["small_Snake"], + typing_extensions.Literal["Capital_Snake"], + typing_extensions.Literal["SCA_ETH_Flow_Points"], + typing_extensions.Literal["ATT_NAME"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + smallCamel: typing.Union[Schema_.Properties.SmallCamel, str, schemas.Unset] = schemas.unset, + CapitalCamel: typing.Union[Schema_.Properties.CapitalCamel, str, schemas.Unset] = schemas.unset, + small_Snake: typing.Union[Schema_.Properties.SmallSnake, str, schemas.Unset] = schemas.unset, + Capital_Snake: typing.Union[Schema_.Properties.CapitalSnake, str, schemas.Unset] = schemas.unset, + SCA_ETH_Flow_Points: typing.Union[Schema_.Properties.SCAETHFlowPoints, str, schemas.Unset] = schemas.unset, + ATT_NAME: typing.Union[Schema_.Properties.ATTNAME, str, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'Capitalization': + return super().__new__( + cls, + *args_, + smallCamel=smallCamel, + CapitalCamel=CapitalCamel, + small_Snake=small_Snake, + Capital_Snake=Capital_Snake, + SCA_ETH_Flow_Points=SCA_ETH_Flow_Points, + ATT_NAME=ATT_NAME, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/cat.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/cat.py new file mode 100644 index 00000000000..e7b025ec746 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/cat.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Cat( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + + class AllOf: + + @staticmethod + def _0() -> typing.Type['animal.Animal']: + return animal.Animal + + + class _1( + schemas.DictSchema + ): + + + class Schema_: + types = {frozendict.frozendict} + + class Properties: + Declawed = schemas.BoolSchema + __annotations__ = { + "declawed": Declawed, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["declawed"]) -> Schema_.Properties.Declawed: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["declawed"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["declawed"]) -> typing.Union[Schema_.Properties.Declawed, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["declawed"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + declawed: typing.Union[Schema_.Properties.Declawed, bool, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'Cat.Schema_.AllOf._1': + return super().__new__( + cls, + *args_, + declawed=declawed, + configuration_=configuration_, + **kwargs, + ) + classes = [ + _0, + _1, + ] + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'Cat': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + +from petstore_api.components.schema import animal diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/category.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/category.py new file mode 100644 index 00000000000..0358df038d4 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/category.py @@ -0,0 +1,117 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Category( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {frozendict.frozendict} + required = { + "name", + } + + class Properties: + Id = schemas.Int64Schema + + + class Name( + schemas.StrSchema + ): + + + class Schema_: + types = { + str, + } + default = "default-name" + __annotations__ = { + "id": Id, + "name": Name, + } + + name: Schema_.Properties.Name + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["name"]) -> Schema_.Properties.Name: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["id"]) -> Schema_.Properties.Id: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["name"], + typing_extensions.Literal["id"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["name"]) -> Schema_.Properties.Name: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["id"]) -> typing.Union[Schema_.Properties.Id, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["name"], + typing_extensions.Literal["id"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + name: typing.Union[Schema_.Properties.Name, str], + id: typing.Union[Schema_.Properties.Id, decimal.Decimal, int, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'Category': + return super().__new__( + cls, + *args_, + name=name, + id=id, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/child_cat.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/child_cat.py new file mode 100644 index 00000000000..4d412439594 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/child_cat.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ChildCat( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + + class AllOf: + + @staticmethod + def _0() -> typing.Type['parent_pet.ParentPet']: + return parent_pet.ParentPet + + + class _1( + schemas.DictSchema + ): + + + class Schema_: + types = {frozendict.frozendict} + + class Properties: + Name = schemas.StrSchema + __annotations__ = { + "name": Name, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["name"]) -> Schema_.Properties.Name: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["name"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["name"]) -> typing.Union[Schema_.Properties.Name, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["name"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + name: typing.Union[Schema_.Properties.Name, str, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'ChildCat.Schema_.AllOf._1': + return super().__new__( + cls, + *args_, + name=name, + configuration_=configuration_, + **kwargs, + ) + classes = [ + _0, + _1, + ] + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'ChildCat': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + +from petstore_api.components.schema import parent_pet diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/class_model.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/class_model.py new file mode 100644 index 00000000000..61f6a6d6fbe --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/class_model.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ClassModel( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + + Model for testing model with "_class" property + """ + + + class Schema_: + # any type + + class Properties: + _Class = schemas.StrSchema + __annotations__ = { + "_class": _Class, + } + + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["_class"]) -> Schema_.Properties._Class: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["_class"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["_class"]) -> typing.Union[Schema_.Properties._Class, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["_class"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + _class: typing.Union[Schema_.Properties._Class, str, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'ClassModel': + return super().__new__( + cls, + *args_, + _class=_class, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/client.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/client.py new file mode 100644 index 00000000000..8973816f1ec --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/client.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Client( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {frozendict.frozendict} + + class Properties: + Client = schemas.StrSchema + __annotations__ = { + "client": Client, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["client"]) -> Schema_.Properties.Client: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["client"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["client"]) -> typing.Union[Schema_.Properties.Client, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["client"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + client: typing.Union[Schema_.Properties.Client, str, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'Client': + return super().__new__( + cls, + *args_, + client=client, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/complex_quadrilateral.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/complex_quadrilateral.py new file mode 100644 index 00000000000..0c0f20b5f9a --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/complex_quadrilateral.py @@ -0,0 +1,141 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ComplexQuadrilateral( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + + class AllOf: + + @staticmethod + def _0() -> typing.Type['quadrilateral_interface.QuadrilateralInterface']: + return quadrilateral_interface.QuadrilateralInterface + + + class _1( + schemas.DictSchema + ): + + + class Schema_: + types = {frozendict.frozendict} + + class Properties: + + + class QuadrilateralType( + schemas.StrSchema + ): + + + class Schema_: + types = { + str, + } + enum_value_to_name = { + "ComplexQuadrilateral": "COMPLEX_QUADRILATERAL", + } + + @schemas.classproperty + def COMPLEX_QUADRILATERAL(cls): + return cls("ComplexQuadrilateral") + __annotations__ = { + "quadrilateralType": QuadrilateralType, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["quadrilateralType"]) -> Schema_.Properties.QuadrilateralType: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["quadrilateralType"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["quadrilateralType"]) -> typing.Union[Schema_.Properties.QuadrilateralType, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["quadrilateralType"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + quadrilateralType: typing.Union[Schema_.Properties.QuadrilateralType, str, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'ComplexQuadrilateral.Schema_.AllOf._1': + return super().__new__( + cls, + *args_, + quadrilateralType=quadrilateralType, + configuration_=configuration_, + **kwargs, + ) + classes = [ + _0, + _1, + ] + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'ComplexQuadrilateral': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + +from petstore_api.components.schema import quadrilateral_interface diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/composed_any_of_different_types_no_validations.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/composed_any_of_different_types_no_validations.py new file mode 100644 index 00000000000..11b13ddb3ad --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/composed_any_of_different_types_no_validations.py @@ -0,0 +1,117 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ComposedAnyOfDifferentTypesNoValidations( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + + class AnyOf: + _0 = schemas.DictSchema + _1 = schemas.DateSchema + _2 = schemas.DateTimeSchema + _3 = schemas.BinarySchema + _4 = schemas.StrSchema + _5 = schemas.StrSchema + _6 = schemas.DictSchema + _7 = schemas.BoolSchema + _8 = schemas.NoneSchema + + + class _9( + schemas.ListSchema + ): + + + class Schema_: + types = {tuple} + Items = schemas.AnyTypeSchema + + def __new__( + cls, + arg_: typing.Union[ + typing.Tuple[ + typing.Union[Schema_.Items, dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], ... + ], + typing.List[ + typing.Union[Schema_.Items, dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] + ], + ], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'ComposedAnyOfDifferentTypesNoValidations.Schema_.AnyOf._9': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) + + def __getitem__(self, i: int) -> Schema_.Items: + return super().__getitem__(i) + _10 = schemas.NumberSchema + _11 = schemas.Float32Schema + _12 = schemas.Float64Schema + _13 = schemas.IntSchema + _14 = schemas.Int32Schema + _15 = schemas.Int64Schema + classes = [ + _0, + _1, + _2, + _3, + _4, + _5, + _6, + _7, + _8, + _9, + _10, + _11, + _12, + _13, + _14, + _15, + ] + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'ComposedAnyOfDifferentTypesNoValidations': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/composed_array.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/composed_array.py new file mode 100644 index 00000000000..1707eb4f586 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/composed_array.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ComposedArray( + schemas.ListSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {tuple} + Items = schemas.AnyTypeSchema + + def __new__( + cls, + arg_: typing.Union[ + typing.Tuple[ + typing.Union[Schema_.Items, dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], ... + ], + typing.List[ + typing.Union[Schema_.Items, dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] + ], + ], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'ComposedArray': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) + + def __getitem__(self, i: int) -> Schema_.Items: + return super().__getitem__(i) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/composed_bool.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/composed_bool.py new file mode 100644 index 00000000000..68ccba1d6d4 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/composed_bool.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ComposedBool( + schemas.BoolSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = { + schemas.BoolClass, + } + + class AllOf: + _0 = schemas.AnyTypeSchema + classes = [ + _0, + ] + + + def __new__( + cls, + arg_: bool, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'ComposedBool': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/composed_none.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/composed_none.py new file mode 100644 index 00000000000..4794def0820 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/composed_none.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ComposedNone( + schemas.NoneSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = { + schemas.NoneClass, + } + + class AllOf: + _0 = schemas.AnyTypeSchema + classes = [ + _0, + ] + + + def __new__( + cls, + arg_: None, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'ComposedNone': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/composed_number.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/composed_number.py new file mode 100644 index 00000000000..3831a3ca97a --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/composed_number.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ComposedNumber( + schemas.NumberSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = { + decimal.Decimal, + } + + class AllOf: + _0 = schemas.AnyTypeSchema + classes = [ + _0, + ] + + + def __new__( + cls, + arg_: typing.Union[decimal.Decimal, int, float], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'ComposedNumber': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/composed_object.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/composed_object.py new file mode 100644 index 00000000000..2b0208e78a7 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/composed_object.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ComposedObject( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = { + frozendict.frozendict, + } + + class AllOf: + _0 = schemas.AnyTypeSchema + classes = [ + _0, + ] + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'ComposedObject': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/composed_one_of_different_types.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/composed_one_of_different_types.py new file mode 100644 index 00000000000..47df15dc694 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/composed_one_of_different_types.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ComposedOneOfDifferentTypes( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + + this is a model that allows payloads of type object or number + """ + + + class Schema_: + # any type + + class OneOf: + + @staticmethod + def _0() -> typing.Type['number_with_validations.NumberWithValidations']: + return number_with_validations.NumberWithValidations + + @staticmethod + def _1() -> typing.Type['animal.Animal']: + return animal.Animal + _2 = schemas.NoneSchema + _3 = schemas.DateSchema + + + class _4( + schemas.DictSchema + ): + + + class Schema_: + types = {frozendict.frozendict} + max_properties = 4 + min_properties = 4 + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'ComposedOneOfDifferentTypes.Schema_.OneOf._4': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + + + class _5( + schemas.ListSchema + ): + + + class Schema_: + types = {tuple} + max_items = 4 + min_items = 4 + Items = schemas.AnyTypeSchema + + def __new__( + cls, + arg_: typing.Union[ + typing.Tuple[ + typing.Union[Schema_.Items, dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], ... + ], + typing.List[ + typing.Union[Schema_.Items, dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] + ], + ], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'ComposedOneOfDifferentTypes.Schema_.OneOf._5': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) + + def __getitem__(self, i: int) -> Schema_.Items: + return super().__getitem__(i) + + + class _6( + schemas.DateTimeSchema + ): + + + class Schema_: + types = { + str, + } + format = 'date-time' + regex={ + 'pattern': r'^2020.*', # noqa: E501 + } + classes = [ + _0, + _1, + _2, + _3, + _4, + _5, + _6, + ] + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'ComposedOneOfDifferentTypes': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + +from petstore_api.components.schema import animal +from petstore_api.components.schema import number_with_validations diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/composed_string.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/composed_string.py new file mode 100644 index 00000000000..9b5a8bef8f8 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/composed_string.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ComposedString( + schemas.StrSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = { + str, + } + + class AllOf: + _0 = schemas.AnyTypeSchema + classes = [ + _0, + ] + + + def __new__( + cls, + arg_: str, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'ComposedString': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/currency.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/currency.py new file mode 100644 index 00000000000..20bc1af65ac --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/currency.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Currency( + schemas.StrSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = { + str, + } + enum_value_to_name = { + "eur": "EUR", + "usd": "USD", + } + + @schemas.classproperty + def EUR(cls): + return cls("eur") + + @schemas.classproperty + def USD(cls): + return cls("usd") diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/danish_pig.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/danish_pig.py new file mode 100644 index 00000000000..e051c9408f6 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/danish_pig.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class DanishPig( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {frozendict.frozendict} + required = { + "className", + } + + class Properties: + + + class ClassName( + schemas.StrSchema + ): + + + class Schema_: + types = { + str, + } + enum_value_to_name = { + "DanishPig": "DANISH_PIG", + } + + @schemas.classproperty + def DANISH_PIG(cls): + return cls("DanishPig") + __annotations__ = { + "className": ClassName, + } + + className: Schema_.Properties.ClassName + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["className"]) -> Schema_.Properties.ClassName: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["className"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["className"]) -> Schema_.Properties.ClassName: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["className"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + className: typing.Union[Schema_.Properties.ClassName, str], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'DanishPig': + return super().__new__( + cls, + *args_, + className=className, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/date_time_test.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/date_time_test.py new file mode 100644 index 00000000000..9679d50c233 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/date_time_test.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class DateTimeTest( + schemas.DateTimeSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = { + str, + } + format = 'date-time' diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/date_time_with_validations.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/date_time_with_validations.py new file mode 100644 index 00000000000..f0b7be44a09 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/date_time_with_validations.py @@ -0,0 +1,43 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class DateTimeWithValidations( + schemas.DateTimeSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = { + str, + } + format = 'date-time' + regex={ + 'pattern': r'^2020.*', # noqa: E501 + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/date_with_validations.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/date_with_validations.py new file mode 100644 index 00000000000..72e64d67102 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/date_with_validations.py @@ -0,0 +1,43 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class DateWithValidations( + schemas.DateSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = { + str, + } + format = 'date' + regex={ + 'pattern': r'^2020.*', # noqa: E501 + } diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/decimal_payload.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/decimal_payload.py similarity index 82% rename from samples/openapi3/client/petstore/python/petstore_api/model/decimal_payload.py rename to samples/openapi3/client/petstore/python/src/petstore_api/components/schema/decimal_payload.py index 8e3b63175a4..a646d0c1770 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/decimal_payload.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/decimal_payload.py @@ -6,10 +6,10 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ -from datetime import date, datetime # noqa: F401 +import datetime # noqa: F401 import decimal # noqa: F401 import functools # noqa: F401 import io # noqa: F401 diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/dog.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/dog.py new file mode 100644 index 00000000000..613885c4230 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/dog.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Dog( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + + class AllOf: + + @staticmethod + def _0() -> typing.Type['animal.Animal']: + return animal.Animal + + + class _1( + schemas.DictSchema + ): + + + class Schema_: + types = {frozendict.frozendict} + + class Properties: + Breed = schemas.StrSchema + __annotations__ = { + "breed": Breed, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["breed"]) -> Schema_.Properties.Breed: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["breed"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["breed"]) -> typing.Union[Schema_.Properties.Breed, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["breed"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + breed: typing.Union[Schema_.Properties.Breed, str, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'Dog.Schema_.AllOf._1': + return super().__new__( + cls, + *args_, + breed=breed, + configuration_=configuration_, + **kwargs, + ) + classes = [ + _0, + _1, + ] + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'Dog': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + +from petstore_api.components.schema import animal diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/drawing.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/drawing.py new file mode 100644 index 00000000000..59747d718f4 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/drawing.py @@ -0,0 +1,176 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Drawing( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {frozendict.frozendict} + + class Properties: + + @staticmethod + def main_shape() -> typing.Type['shape.Shape']: + return shape.Shape + + @staticmethod + def shape_or_null() -> typing.Type['shape_or_null.ShapeOrNull']: + return shape_or_null.ShapeOrNull + + @staticmethod + def nullable_shape() -> typing.Type['nullable_shape.NullableShape']: + return nullable_shape.NullableShape + + + class Shapes( + schemas.ListSchema + ): + + + class Schema_: + types = {tuple} + + @staticmethod + def items() -> typing.Type['shape.Shape']: + return shape.Shape + + def __new__( + cls, + arg_: typing.Union[ + typing.Tuple[ + typing.Union['shape.Shape', dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], ... + ], + typing.List[ + typing.Union['shape.Shape', dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] + ], + ], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'Drawing.Schema_.Properties.Shapes': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) + + def __getitem__(self, i: int) -> 'shape.Shape': + return super().__getitem__(i) + __annotations__ = { + "mainShape": main_shape, + "shapeOrNull": shape_or_null, + "nullableShape": nullable_shape, + "shapes": Shapes, + } + + @staticmethod + def additional_properties() -> typing.Type['fruit.Fruit']: + return fruit.Fruit + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["mainShape"]) -> 'shape.Shape': ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["shapeOrNull"]) -> 'shape_or_null.ShapeOrNull': ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["nullableShape"]) -> 'nullable_shape.NullableShape': ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["shapes"]) -> Schema_.Properties.Shapes: ... + + @typing.overload + def __getitem__(self, name: str) -> 'fruit.Fruit': ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["mainShape"], + typing_extensions.Literal["shapeOrNull"], + typing_extensions.Literal["nullableShape"], + typing_extensions.Literal["shapes"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["mainShape"]) -> typing.Union['shape.Shape', schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["shapeOrNull"]) -> typing.Union['shape_or_null.ShapeOrNull', schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["nullableShape"]) -> typing.Union['nullable_shape.NullableShape', schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["shapes"]) -> typing.Union[Schema_.Properties.Shapes, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union['fruit.Fruit', schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["mainShape"], + typing_extensions.Literal["shapeOrNull"], + typing_extensions.Literal["nullableShape"], + typing_extensions.Literal["shapes"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + mainShape: typing.Union['shape.Shape', dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + shapeOrNull: typing.Union['shape_or_null.ShapeOrNull', dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + nullableShape: typing.Union['nullable_shape.NullableShape', dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + shapes: typing.Union[Schema_.Properties.Shapes, list, tuple, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union['fruit.Fruit', dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + ) -> 'Drawing': + return super().__new__( + cls, + *args_, + mainShape=mainShape, + shapeOrNull=shapeOrNull, + nullableShape=nullableShape, + shapes=shapes, + configuration_=configuration_, + **kwargs, + ) + +from petstore_api.components.schema import fruit +from petstore_api.components.schema import nullable_shape +from petstore_api.components.schema import shape +from petstore_api.components.schema import shape_or_null diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/enum_arrays.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/enum_arrays.py new file mode 100644 index 00000000000..2df0ff66ca3 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/enum_arrays.py @@ -0,0 +1,175 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class EnumArrays( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {frozendict.frozendict} + + class Properties: + + + class JustSymbol( + schemas.StrSchema + ): + + + class Schema_: + types = { + str, + } + enum_value_to_name = { + ">=": "GREATER_THAN_SIGN_EQUALS_SIGN", + "$": "DOLLAR_SIGN", + } + + @schemas.classproperty + def GREATER_THAN_SIGN_EQUALS_SIGN(cls): + return cls(">=") + + @schemas.classproperty + def DOLLAR_SIGN(cls): + return cls("$") + + + class ArrayEnum( + schemas.ListSchema + ): + + + class Schema_: + types = {tuple} + + + class Items( + schemas.StrSchema + ): + + + class Schema_: + types = { + str, + } + enum_value_to_name = { + "fish": "FISH", + "crab": "CRAB", + } + + @schemas.classproperty + def FISH(cls): + return cls("fish") + + @schemas.classproperty + def CRAB(cls): + return cls("crab") + + def __new__( + cls, + arg_: typing.Union[ + typing.Tuple[ + typing.Union[Schema_.Items, str], ... + ], + typing.List[ + typing.Union[Schema_.Items, str] + ], + ], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'EnumArrays.Schema_.Properties.ArrayEnum': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) + + def __getitem__(self, i: int) -> Schema_.Items: + return super().__getitem__(i) + __annotations__ = { + "just_symbol": JustSymbol, + "array_enum": ArrayEnum, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["just_symbol"]) -> Schema_.Properties.JustSymbol: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["array_enum"]) -> Schema_.Properties.ArrayEnum: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["just_symbol"], + typing_extensions.Literal["array_enum"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["just_symbol"]) -> typing.Union[Schema_.Properties.JustSymbol, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["array_enum"]) -> typing.Union[Schema_.Properties.ArrayEnum, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["just_symbol"], + typing_extensions.Literal["array_enum"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + just_symbol: typing.Union[Schema_.Properties.JustSymbol, str, schemas.Unset] = schemas.unset, + array_enum: typing.Union[Schema_.Properties.ArrayEnum, list, tuple, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'EnumArrays': + return super().__new__( + cls, + *args_, + just_symbol=just_symbol, + array_enum=array_enum, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/enum_class.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/enum_class.py new file mode 100644 index 00000000000..8f4c6de15c6 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/enum_class.py @@ -0,0 +1,67 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class EnumClass( + schemas.StrSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = { + str, + } + default = "-efg" + enum_value_to_name = { + "_abc": "_ABC", + "-efg": "HYPHEN_MINUS_EFG", + "(xyz)": "LEFT_PARENTHESIS_XYZ_RIGHT_PARENTHESIS", + "COUNT_1M": "COUNT_1M", + "COUNT_50M": "COUNT_50M", + } + + @schemas.classproperty + def _ABC(cls): + return cls("_abc") + + @schemas.classproperty + def HYPHEN_MINUS_EFG(cls): + return cls("-efg") + + @schemas.classproperty + def LEFT_PARENTHESIS_XYZ_RIGHT_PARENTHESIS(cls): + return cls("(xyz)") + + @schemas.classproperty + def COUNT_1M(cls): + return cls("COUNT_1M") + + @schemas.classproperty + def COUNT_50M(cls): + return cls("COUNT_50M") diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/enum_test.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/enum_test.py new file mode 100644 index 00000000000..8de10e15989 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/enum_test.py @@ -0,0 +1,311 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class EnumTest( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {frozendict.frozendict} + required = { + "enum_string_required", + } + + class Properties: + + + class EnumString( + schemas.StrSchema + ): + + + class Schema_: + types = { + str, + } + enum_value_to_name = { + "UPPER": "UPPER", + "lower": "LOWER", + "": "EMPTY", + } + + @schemas.classproperty + def UPPER(cls): + return cls("UPPER") + + @schemas.classproperty + def LOWER(cls): + return cls("lower") + + @schemas.classproperty + def EMPTY(cls): + return cls("") + + + class EnumStringRequired( + schemas.StrSchema + ): + + + class Schema_: + types = { + str, + } + enum_value_to_name = { + "UPPER": "UPPER", + "lower": "LOWER", + "": "EMPTY", + } + + @schemas.classproperty + def UPPER(cls): + return cls("UPPER") + + @schemas.classproperty + def LOWER(cls): + return cls("lower") + + @schemas.classproperty + def EMPTY(cls): + return cls("") + + + class EnumInteger( + schemas.Int32Schema + ): + + + class Schema_: + types = { + decimal.Decimal, + } + format = 'int32' + enum_value_to_name = { + 1: "POSITIVE_1", + -1: "NEGATIVE_1", + } + + @schemas.classproperty + def POSITIVE_1(cls): + return cls(1) + + @schemas.classproperty + def NEGATIVE_1(cls): + return cls(-1) + + + class EnumNumber( + schemas.Float64Schema + ): + + + class Schema_: + types = { + decimal.Decimal, + } + format = 'double' + enum_value_to_name = { + 1.1: "POSITIVE_1_PT_1", + -1.2: "NEGATIVE_1_PT_2", + } + + @schemas.classproperty + def POSITIVE_1_PT_1(cls): + return cls(1.1) + + @schemas.classproperty + def NEGATIVE_1_PT_2(cls): + return cls(-1.2) + + @staticmethod + def string_enum() -> typing.Type['string_enum.StringEnum']: + return string_enum.StringEnum + + @staticmethod + def integer_enum() -> typing.Type['integer_enum.IntegerEnum']: + return integer_enum.IntegerEnum + + @staticmethod + def string_enum_with_default_value() -> typing.Type['string_enum_with_default_value.StringEnumWithDefaultValue']: + return string_enum_with_default_value.StringEnumWithDefaultValue + + @staticmethod + def integer_enum_with_default_value() -> typing.Type['integer_enum_with_default_value.IntegerEnumWithDefaultValue']: + return integer_enum_with_default_value.IntegerEnumWithDefaultValue + + @staticmethod + def integer_enum_one_value() -> typing.Type['integer_enum_one_value.IntegerEnumOneValue']: + return integer_enum_one_value.IntegerEnumOneValue + __annotations__ = { + "enum_string": EnumString, + "enum_string_required": EnumStringRequired, + "enum_integer": EnumInteger, + "enum_number": EnumNumber, + "stringEnum": string_enum, + "IntegerEnum": integer_enum, + "StringEnumWithDefaultValue": string_enum_with_default_value, + "IntegerEnumWithDefaultValue": integer_enum_with_default_value, + "IntegerEnumOneValue": integer_enum_one_value, + } + + enum_string_required: Schema_.Properties.EnumStringRequired + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["enum_string_required"]) -> Schema_.Properties.EnumStringRequired: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["enum_string"]) -> Schema_.Properties.EnumString: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["enum_integer"]) -> Schema_.Properties.EnumInteger: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["enum_number"]) -> Schema_.Properties.EnumNumber: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["stringEnum"]) -> 'string_enum.StringEnum': ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["IntegerEnum"]) -> 'integer_enum.IntegerEnum': ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["StringEnumWithDefaultValue"]) -> 'string_enum_with_default_value.StringEnumWithDefaultValue': ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["IntegerEnumWithDefaultValue"]) -> 'integer_enum_with_default_value.IntegerEnumWithDefaultValue': ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["IntegerEnumOneValue"]) -> 'integer_enum_one_value.IntegerEnumOneValue': ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["enum_string_required"], + typing_extensions.Literal["enum_string"], + typing_extensions.Literal["enum_integer"], + typing_extensions.Literal["enum_number"], + typing_extensions.Literal["stringEnum"], + typing_extensions.Literal["IntegerEnum"], + typing_extensions.Literal["StringEnumWithDefaultValue"], + typing_extensions.Literal["IntegerEnumWithDefaultValue"], + typing_extensions.Literal["IntegerEnumOneValue"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["enum_string_required"]) -> Schema_.Properties.EnumStringRequired: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["enum_string"]) -> typing.Union[Schema_.Properties.EnumString, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["enum_integer"]) -> typing.Union[Schema_.Properties.EnumInteger, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["enum_number"]) -> typing.Union[Schema_.Properties.EnumNumber, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["stringEnum"]) -> typing.Union['string_enum.StringEnum', schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["IntegerEnum"]) -> typing.Union['integer_enum.IntegerEnum', schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["StringEnumWithDefaultValue"]) -> typing.Union['string_enum_with_default_value.StringEnumWithDefaultValue', schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["IntegerEnumWithDefaultValue"]) -> typing.Union['integer_enum_with_default_value.IntegerEnumWithDefaultValue', schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["IntegerEnumOneValue"]) -> typing.Union['integer_enum_one_value.IntegerEnumOneValue', schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["enum_string_required"], + typing_extensions.Literal["enum_string"], + typing_extensions.Literal["enum_integer"], + typing_extensions.Literal["enum_number"], + typing_extensions.Literal["stringEnum"], + typing_extensions.Literal["IntegerEnum"], + typing_extensions.Literal["StringEnumWithDefaultValue"], + typing_extensions.Literal["IntegerEnumWithDefaultValue"], + typing_extensions.Literal["IntegerEnumOneValue"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + enum_string_required: typing.Union[Schema_.Properties.EnumStringRequired, str], + enum_string: typing.Union[Schema_.Properties.EnumString, str, schemas.Unset] = schemas.unset, + enum_integer: typing.Union[Schema_.Properties.EnumInteger, decimal.Decimal, int, schemas.Unset] = schemas.unset, + enum_number: typing.Union[Schema_.Properties.EnumNumber, decimal.Decimal, int, float, schemas.Unset] = schemas.unset, + stringEnum: typing.Union['string_enum.StringEnum', None, str, schemas.Unset] = schemas.unset, + IntegerEnum: typing.Union['integer_enum.IntegerEnum', decimal.Decimal, int, schemas.Unset] = schemas.unset, + StringEnumWithDefaultValue: typing.Union['string_enum_with_default_value.StringEnumWithDefaultValue', str, schemas.Unset] = schemas.unset, + IntegerEnumWithDefaultValue: typing.Union['integer_enum_with_default_value.IntegerEnumWithDefaultValue', decimal.Decimal, int, schemas.Unset] = schemas.unset, + IntegerEnumOneValue: typing.Union['integer_enum_one_value.IntegerEnumOneValue', decimal.Decimal, int, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'EnumTest': + return super().__new__( + cls, + *args_, + enum_string_required=enum_string_required, + enum_string=enum_string, + enum_integer=enum_integer, + enum_number=enum_number, + stringEnum=stringEnum, + IntegerEnum=IntegerEnum, + StringEnumWithDefaultValue=StringEnumWithDefaultValue, + IntegerEnumWithDefaultValue=IntegerEnumWithDefaultValue, + IntegerEnumOneValue=IntegerEnumOneValue, + configuration_=configuration_, + **kwargs, + ) + +from petstore_api.components.schema import integer_enum +from petstore_api.components.schema import integer_enum_one_value +from petstore_api.components.schema import integer_enum_with_default_value +from petstore_api.components.schema import string_enum +from petstore_api.components.schema import string_enum_with_default_value diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/equilateral_triangle.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/equilateral_triangle.py new file mode 100644 index 00000000000..c029e61d7c8 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/equilateral_triangle.py @@ -0,0 +1,141 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class EquilateralTriangle( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + + class AllOf: + + @staticmethod + def _0() -> typing.Type['triangle_interface.TriangleInterface']: + return triangle_interface.TriangleInterface + + + class _1( + schemas.DictSchema + ): + + + class Schema_: + types = {frozendict.frozendict} + + class Properties: + + + class TriangleType( + schemas.StrSchema + ): + + + class Schema_: + types = { + str, + } + enum_value_to_name = { + "EquilateralTriangle": "EQUILATERAL_TRIANGLE", + } + + @schemas.classproperty + def EQUILATERAL_TRIANGLE(cls): + return cls("EquilateralTriangle") + __annotations__ = { + "triangleType": TriangleType, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["triangleType"]) -> Schema_.Properties.TriangleType: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["triangleType"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["triangleType"]) -> typing.Union[Schema_.Properties.TriangleType, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["triangleType"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + triangleType: typing.Union[Schema_.Properties.TriangleType, str, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'EquilateralTriangle.Schema_.AllOf._1': + return super().__new__( + cls, + *args_, + triangleType=triangleType, + configuration_=configuration_, + **kwargs, + ) + classes = [ + _0, + _1, + ] + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'EquilateralTriangle': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + +from petstore_api.components.schema import triangle_interface diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/file.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/file.py new file mode 100644 index 00000000000..4ac9c300e54 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/file.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class File( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + + Must be named `File` for test. + """ + + + class Schema_: + types = {frozendict.frozendict} + + class Properties: + SourceURI = schemas.StrSchema + __annotations__ = { + "sourceURI": SourceURI, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["sourceURI"]) -> Schema_.Properties.SourceURI: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["sourceURI"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["sourceURI"]) -> typing.Union[Schema_.Properties.SourceURI, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["sourceURI"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + sourceURI: typing.Union[Schema_.Properties.SourceURI, str, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'File': + return super().__new__( + cls, + *args_, + sourceURI=sourceURI, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/file_schema_test_class.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/file_schema_test_class.py new file mode 100644 index 00000000000..29fb541fac0 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/file_schema_test_class.py @@ -0,0 +1,139 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class FileSchemaTestClass( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {frozendict.frozendict} + + class Properties: + + @staticmethod + def file() -> typing.Type['file.File']: + return file.File + + + class Files( + schemas.ListSchema + ): + + + class Schema_: + types = {tuple} + + @staticmethod + def items() -> typing.Type['file.File']: + return file.File + + def __new__( + cls, + arg_: typing.Union[ + typing.Tuple[ + typing.Union['file.File', dict, frozendict.frozendict], ... + ], + typing.List[ + typing.Union['file.File', dict, frozendict.frozendict] + ], + ], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'FileSchemaTestClass.Schema_.Properties.Files': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) + + def __getitem__(self, i: int) -> 'file.File': + return super().__getitem__(i) + __annotations__ = { + "file": file, + "files": Files, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["file"]) -> 'file.File': ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["files"]) -> Schema_.Properties.Files: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["file"], + typing_extensions.Literal["files"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["file"]) -> typing.Union['file.File', schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["files"]) -> typing.Union[Schema_.Properties.Files, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["file"], + typing_extensions.Literal["files"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + file: typing.Union['file.File', dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + files: typing.Union[Schema_.Properties.Files, list, tuple, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'FileSchemaTestClass': + return super().__new__( + cls, + *args_, + file=file, + files=files, + configuration_=configuration_, + **kwargs, + ) + +from petstore_api.components.schema import file diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/foo.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/foo.py new file mode 100644 index 00000000000..bdcffbc1829 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/foo.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Foo( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {frozendict.frozendict} + + class Properties: + + @staticmethod + def bar() -> typing.Type['bar.Bar']: + return bar.Bar + __annotations__ = { + "bar": bar, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["bar"]) -> 'bar.Bar': ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["bar"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["bar"]) -> typing.Union['bar.Bar', schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["bar"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + bar: typing.Union['bar.Bar', str, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'Foo': + return super().__new__( + cls, + *args_, + bar=bar, + configuration_=configuration_, + **kwargs, + ) + +from petstore_api.components.schema import bar diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/format_test.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/format_test.py new file mode 100644 index 00000000000..e2db63bd85f --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/format_test.py @@ -0,0 +1,489 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class FormatTest( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {frozendict.frozendict} + required = { + "byte", + "date", + "number", + "password", + } + + class Properties: + + + class Integer( + schemas.IntSchema + ): + + + class Schema_: + types = { + decimal.Decimal, + } + format = 'int' + inclusive_maximum = 100 + inclusive_minimum = 10 + multiple_of = 2 + Int32 = schemas.Int32Schema + + + class Int32withValidations( + schemas.Int32Schema + ): + + + class Schema_: + types = { + decimal.Decimal, + } + format = 'int32' + inclusive_maximum = 200 + inclusive_minimum = 20 + Int64 = schemas.Int64Schema + + + class Number( + schemas.NumberSchema + ): + + + class Schema_: + types = { + decimal.Decimal, + } + inclusive_maximum = 543.2 + inclusive_minimum = 32.1 + multiple_of = 32.5 + + + class _Float( + schemas.Float32Schema + ): + + + class Schema_: + types = { + decimal.Decimal, + } + format = 'float' + inclusive_maximum = 987.6 + inclusive_minimum = 54.3 + Float32 = schemas.Float32Schema + + + class Double( + schemas.Float64Schema + ): + + + class Schema_: + types = { + decimal.Decimal, + } + format = 'double' + inclusive_maximum = 123.4 + inclusive_minimum = 67.8 + Float64 = schemas.Float64Schema + + + class ArrayWithUniqueItems( + schemas.ListSchema + ): + + + class Schema_: + types = {tuple} + unique_items = True + Items = schemas.NumberSchema + + def __new__( + cls, + arg_: typing.Union[ + typing.Tuple[ + typing.Union[Schema_.Items, decimal.Decimal, int, float], ... + ], + typing.List[ + typing.Union[Schema_.Items, decimal.Decimal, int, float] + ], + ], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'FormatTest.Schema_.Properties.ArrayWithUniqueItems': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) + + def __getitem__(self, i: int) -> Schema_.Items: + return super().__getitem__(i) + + + class String( + schemas.StrSchema + ): + + + class Schema_: + types = { + str, + } + regex={ + 'pattern': r'[a-z]', # noqa: E501 + 'flags': re.I, + } + Byte = schemas.StrSchema + Binary = schemas.BinarySchema + Date = schemas.DateSchema + DateTime = schemas.DateTimeSchema + Uuid = schemas.UUIDSchema + UuidNoExample = schemas.UUIDSchema + + + class Password( + schemas.StrSchema + ): + + + class Schema_: + types = { + str, + } + format = 'password' + max_length = 64 + min_length = 10 + + + class PatternWithDigits( + schemas.StrSchema + ): + + + class Schema_: + types = { + str, + } + regex={ + 'pattern': r'^\d{10}$', # noqa: E501 + } + + + class PatternWithDigitsAndDelimiter( + schemas.StrSchema + ): + + + class Schema_: + types = { + str, + } + regex={ + 'pattern': r'^image_\d{1,3}$', # noqa: E501 + 'flags': re.I, + } + NoneProp = schemas.NoneSchema + __annotations__ = { + "integer": Integer, + "int32": Int32, + "int32withValidations": Int32withValidations, + "int64": Int64, + "number": Number, + "float": _Float, + "float32": Float32, + "double": Double, + "float64": Float64, + "arrayWithUniqueItems": ArrayWithUniqueItems, + "string": String, + "byte": Byte, + "binary": Binary, + "date": Date, + "dateTime": DateTime, + "uuid": Uuid, + "uuidNoExample": UuidNoExample, + "password": Password, + "pattern_with_digits": PatternWithDigits, + "pattern_with_digits_and_delimiter": PatternWithDigitsAndDelimiter, + "noneProp": NoneProp, + } + + byte: Schema_.Properties.Byte + date: Schema_.Properties.Date + number: Schema_.Properties.Number + password: Schema_.Properties.Password + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["byte"]) -> Schema_.Properties.Byte: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["date"]) -> Schema_.Properties.Date: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["number"]) -> Schema_.Properties.Number: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["password"]) -> Schema_.Properties.Password: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["integer"]) -> Schema_.Properties.Integer: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["int32"]) -> Schema_.Properties.Int32: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["int32withValidations"]) -> Schema_.Properties.Int32withValidations: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["int64"]) -> Schema_.Properties.Int64: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["float"]) -> Schema_.Properties._Float: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["float32"]) -> Schema_.Properties.Float32: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["double"]) -> Schema_.Properties.Double: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["float64"]) -> Schema_.Properties.Float64: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["arrayWithUniqueItems"]) -> Schema_.Properties.ArrayWithUniqueItems: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["string"]) -> Schema_.Properties.String: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["binary"]) -> Schema_.Properties.Binary: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["dateTime"]) -> Schema_.Properties.DateTime: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["uuid"]) -> Schema_.Properties.Uuid: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["uuidNoExample"]) -> Schema_.Properties.UuidNoExample: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["pattern_with_digits"]) -> Schema_.Properties.PatternWithDigits: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["pattern_with_digits_and_delimiter"]) -> Schema_.Properties.PatternWithDigitsAndDelimiter: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["noneProp"]) -> Schema_.Properties.NoneProp: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["byte"], + typing_extensions.Literal["date"], + typing_extensions.Literal["number"], + typing_extensions.Literal["password"], + typing_extensions.Literal["integer"], + typing_extensions.Literal["int32"], + typing_extensions.Literal["int32withValidations"], + typing_extensions.Literal["int64"], + typing_extensions.Literal["float"], + typing_extensions.Literal["float32"], + typing_extensions.Literal["double"], + typing_extensions.Literal["float64"], + typing_extensions.Literal["arrayWithUniqueItems"], + typing_extensions.Literal["string"], + typing_extensions.Literal["binary"], + typing_extensions.Literal["dateTime"], + typing_extensions.Literal["uuid"], + typing_extensions.Literal["uuidNoExample"], + typing_extensions.Literal["pattern_with_digits"], + typing_extensions.Literal["pattern_with_digits_and_delimiter"], + typing_extensions.Literal["noneProp"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["byte"]) -> Schema_.Properties.Byte: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["date"]) -> Schema_.Properties.Date: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["number"]) -> Schema_.Properties.Number: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["password"]) -> Schema_.Properties.Password: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["integer"]) -> typing.Union[Schema_.Properties.Integer, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["int32"]) -> typing.Union[Schema_.Properties.Int32, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["int32withValidations"]) -> typing.Union[Schema_.Properties.Int32withValidations, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["int64"]) -> typing.Union[Schema_.Properties.Int64, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["float"]) -> typing.Union[Schema_.Properties._Float, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["float32"]) -> typing.Union[Schema_.Properties.Float32, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["double"]) -> typing.Union[Schema_.Properties.Double, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["float64"]) -> typing.Union[Schema_.Properties.Float64, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["arrayWithUniqueItems"]) -> typing.Union[Schema_.Properties.ArrayWithUniqueItems, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["string"]) -> typing.Union[Schema_.Properties.String, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["binary"]) -> typing.Union[Schema_.Properties.Binary, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["dateTime"]) -> typing.Union[Schema_.Properties.DateTime, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["uuid"]) -> typing.Union[Schema_.Properties.Uuid, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["uuidNoExample"]) -> typing.Union[Schema_.Properties.UuidNoExample, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["pattern_with_digits"]) -> typing.Union[Schema_.Properties.PatternWithDigits, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["pattern_with_digits_and_delimiter"]) -> typing.Union[Schema_.Properties.PatternWithDigitsAndDelimiter, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["noneProp"]) -> typing.Union[Schema_.Properties.NoneProp, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["byte"], + typing_extensions.Literal["date"], + typing_extensions.Literal["number"], + typing_extensions.Literal["password"], + typing_extensions.Literal["integer"], + typing_extensions.Literal["int32"], + typing_extensions.Literal["int32withValidations"], + typing_extensions.Literal["int64"], + typing_extensions.Literal["float"], + typing_extensions.Literal["float32"], + typing_extensions.Literal["double"], + typing_extensions.Literal["float64"], + typing_extensions.Literal["arrayWithUniqueItems"], + typing_extensions.Literal["string"], + typing_extensions.Literal["binary"], + typing_extensions.Literal["dateTime"], + typing_extensions.Literal["uuid"], + typing_extensions.Literal["uuidNoExample"], + typing_extensions.Literal["pattern_with_digits"], + typing_extensions.Literal["pattern_with_digits_and_delimiter"], + typing_extensions.Literal["noneProp"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + byte: typing.Union[Schema_.Properties.Byte, str], + date: typing.Union[Schema_.Properties.Date, str, datetime.date], + number: typing.Union[Schema_.Properties.Number, decimal.Decimal, int, float], + password: typing.Union[Schema_.Properties.Password, str], + integer: typing.Union[Schema_.Properties.Integer, decimal.Decimal, int, schemas.Unset] = schemas.unset, + int32: typing.Union[Schema_.Properties.Int32, decimal.Decimal, int, schemas.Unset] = schemas.unset, + int32withValidations: typing.Union[Schema_.Properties.Int32withValidations, decimal.Decimal, int, schemas.Unset] = schemas.unset, + int64: typing.Union[Schema_.Properties.Int64, decimal.Decimal, int, schemas.Unset] = schemas.unset, + float32: typing.Union[Schema_.Properties.Float32, decimal.Decimal, int, float, schemas.Unset] = schemas.unset, + double: typing.Union[Schema_.Properties.Double, decimal.Decimal, int, float, schemas.Unset] = schemas.unset, + float64: typing.Union[Schema_.Properties.Float64, decimal.Decimal, int, float, schemas.Unset] = schemas.unset, + arrayWithUniqueItems: typing.Union[Schema_.Properties.ArrayWithUniqueItems, list, tuple, schemas.Unset] = schemas.unset, + string: typing.Union[Schema_.Properties.String, str, schemas.Unset] = schemas.unset, + binary: typing.Union[Schema_.Properties.Binary, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + dateTime: typing.Union[Schema_.Properties.DateTime, str, datetime.datetime, schemas.Unset] = schemas.unset, + uuid: typing.Union[Schema_.Properties.Uuid, str, uuid.UUID, schemas.Unset] = schemas.unset, + uuidNoExample: typing.Union[Schema_.Properties.UuidNoExample, str, uuid.UUID, schemas.Unset] = schemas.unset, + pattern_with_digits: typing.Union[Schema_.Properties.PatternWithDigits, str, schemas.Unset] = schemas.unset, + pattern_with_digits_and_delimiter: typing.Union[Schema_.Properties.PatternWithDigitsAndDelimiter, str, schemas.Unset] = schemas.unset, + noneProp: typing.Union[Schema_.Properties.NoneProp, None, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'FormatTest': + return super().__new__( + cls, + *args_, + byte=byte, + date=date, + number=number, + password=password, + integer=integer, + int32=int32, + int32withValidations=int32withValidations, + int64=int64, + float32=float32, + double=double, + float64=float64, + arrayWithUniqueItems=arrayWithUniqueItems, + string=string, + binary=binary, + dateTime=dateTime, + uuid=uuid, + uuidNoExample=uuidNoExample, + pattern_with_digits=pattern_with_digits, + pattern_with_digits_and_delimiter=pattern_with_digits_and_delimiter, + noneProp=noneProp, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/from_schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/from_schema.py new file mode 100644 index 00000000000..8b8b94570c6 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/from_schema.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class FromSchema( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {frozendict.frozendict} + + class Properties: + Data = schemas.StrSchema + Id = schemas.IntSchema + __annotations__ = { + "data": Data, + "id": Id, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["data"]) -> Schema_.Properties.Data: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["id"]) -> Schema_.Properties.Id: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["data"], + typing_extensions.Literal["id"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["data"]) -> typing.Union[Schema_.Properties.Data, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["id"]) -> typing.Union[Schema_.Properties.Id, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["data"], + typing_extensions.Literal["id"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + data: typing.Union[Schema_.Properties.Data, str, schemas.Unset] = schemas.unset, + id: typing.Union[Schema_.Properties.Id, decimal.Decimal, int, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'FromSchema': + return super().__new__( + cls, + *args_, + data=data, + id=id, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/fruit.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/fruit.py new file mode 100644 index 00000000000..fe571c77aed --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/fruit.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Fruit( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + + class Properties: + Color = schemas.StrSchema + __annotations__ = { + "color": Color, + } + + class OneOf: + + @staticmethod + def _0() -> typing.Type['apple.Apple']: + return apple.Apple + + @staticmethod + def _1() -> typing.Type['banana.Banana']: + return banana.Banana + classes = [ + _0, + _1, + ] + + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["color"]) -> Schema_.Properties.Color: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["color"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["color"]) -> typing.Union[Schema_.Properties.Color, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["color"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + color: typing.Union[Schema_.Properties.Color, str, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'Fruit': + return super().__new__( + cls, + *args_, + color=color, + configuration_=configuration_, + **kwargs, + ) + +from petstore_api.components.schema import apple +from petstore_api.components.schema import banana diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/fruit_req.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/fruit_req.py new file mode 100644 index 00000000000..b51355f18ea --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/fruit_req.py @@ -0,0 +1,70 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class FruitReq( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + + class OneOf: + _0 = schemas.NoneSchema + + @staticmethod + def _1() -> typing.Type['apple_req.AppleReq']: + return apple_req.AppleReq + + @staticmethod + def _2() -> typing.Type['banana_req.BananaReq']: + return banana_req.BananaReq + classes = [ + _0, + _1, + _2, + ] + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'FruitReq': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + +from petstore_api.components.schema import apple_req +from petstore_api.components.schema import banana_req diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/gm_fruit.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/gm_fruit.py new file mode 100644 index 00000000000..f32f0a4c270 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/gm_fruit.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class GmFruit( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + + class Properties: + Color = schemas.StrSchema + __annotations__ = { + "color": Color, + } + + class AnyOf: + + @staticmethod + def _0() -> typing.Type['apple.Apple']: + return apple.Apple + + @staticmethod + def _1() -> typing.Type['banana.Banana']: + return banana.Banana + classes = [ + _0, + _1, + ] + + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["color"]) -> Schema_.Properties.Color: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["color"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["color"]) -> typing.Union[Schema_.Properties.Color, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["color"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + color: typing.Union[Schema_.Properties.Color, str, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'GmFruit': + return super().__new__( + cls, + *args_, + color=color, + configuration_=configuration_, + **kwargs, + ) + +from petstore_api.components.schema import apple +from petstore_api.components.schema import banana diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/grandparent_animal.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/grandparent_animal.py new file mode 100644 index 00000000000..111c0dc88e6 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/grandparent_animal.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class GrandparentAnimal( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {frozendict.frozendict} + required = { + "pet_type", + } + + @staticmethod + def discriminator(): + return { + 'pet_type': { + 'ChildCat': child_cat.ChildCat, + 'ParentPet': parent_pet.ParentPet, + } + } + + class Properties: + PetType = schemas.StrSchema + __annotations__ = { + "pet_type": PetType, + } + + pet_type: Schema_.Properties.PetType + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["pet_type"]) -> Schema_.Properties.PetType: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["pet_type"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["pet_type"]) -> Schema_.Properties.PetType: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["pet_type"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + pet_type: typing.Union[Schema_.Properties.PetType, str], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'GrandparentAnimal': + return super().__new__( + cls, + *args_, + pet_type=pet_type, + configuration_=configuration_, + **kwargs, + ) + +from petstore_api.components.schema import child_cat +from petstore_api.components.schema import parent_pet diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/has_only_read_only.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/has_only_read_only.py new file mode 100644 index 00000000000..2bee1177b93 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/has_only_read_only.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class HasOnlyReadOnly( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {frozendict.frozendict} + + class Properties: + Bar = schemas.StrSchema + Foo = schemas.StrSchema + __annotations__ = { + "bar": Bar, + "foo": Foo, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["bar"]) -> Schema_.Properties.Bar: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["foo"]) -> Schema_.Properties.Foo: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["bar"], + typing_extensions.Literal["foo"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["bar"]) -> typing.Union[Schema_.Properties.Bar, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["foo"]) -> typing.Union[Schema_.Properties.Foo, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["bar"], + typing_extensions.Literal["foo"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + bar: typing.Union[Schema_.Properties.Bar, str, schemas.Unset] = schemas.unset, + foo: typing.Union[Schema_.Properties.Foo, str, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'HasOnlyReadOnly': + return super().__new__( + cls, + *args_, + bar=bar, + foo=foo, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/health_check_result.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/health_check_result.py new file mode 100644 index 00000000000..8331bdfc2e1 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/health_check_result.py @@ -0,0 +1,117 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class HealthCheckResult( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + + Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + """ + + + class Schema_: + types = {frozendict.frozendict} + + class Properties: + + + class NullableMessage( + schemas.NoneBase, + schemas.StrBase, + schemas.Schema, + schemas.NoneStrMixin + ): + + + class Schema_: + types = { + schemas.NoneClass, + str, + } + + + def __new__( + cls, + arg_: typing.Union[None, str], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'HealthCheckResult.Schema_.Properties.NullableMessage': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) + __annotations__ = { + "NullableMessage": NullableMessage, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["NullableMessage"]) -> Schema_.Properties.NullableMessage: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["NullableMessage"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["NullableMessage"]) -> typing.Union[Schema_.Properties.NullableMessage, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["NullableMessage"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + NullableMessage: typing.Union[Schema_.Properties.NullableMessage, None, str, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'HealthCheckResult': + return super().__new__( + cls, + *args_, + NullableMessage=NullableMessage, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/integer_enum.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/integer_enum.py new file mode 100644 index 00000000000..3f54dbdf74c --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/integer_enum.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class IntegerEnum( + schemas.IntSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = { + decimal.Decimal, + } + format = 'int' + enum_value_to_name = { + 0: "POSITIVE_0", + 1: "POSITIVE_1", + 2: "POSITIVE_2", + } + + @schemas.classproperty + def POSITIVE_0(cls): + return cls(0) + + @schemas.classproperty + def POSITIVE_1(cls): + return cls(1) + + @schemas.classproperty + def POSITIVE_2(cls): + return cls(2) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/integer_enum_big.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/integer_enum_big.py new file mode 100644 index 00000000000..d5a152a5097 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/integer_enum_big.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class IntegerEnumBig( + schemas.IntSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = { + decimal.Decimal, + } + format = 'int' + enum_value_to_name = { + 10: "POSITIVE_10", + 11: "POSITIVE_11", + 12: "POSITIVE_12", + } + + @schemas.classproperty + def POSITIVE_10(cls): + return cls(10) + + @schemas.classproperty + def POSITIVE_11(cls): + return cls(11) + + @schemas.classproperty + def POSITIVE_12(cls): + return cls(12) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/integer_enum_one_value.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/integer_enum_one_value.py new file mode 100644 index 00000000000..ede0a6705af --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/integer_enum_one_value.py @@ -0,0 +1,47 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class IntegerEnumOneValue( + schemas.IntSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = { + decimal.Decimal, + } + format = 'int' + enum_value_to_name = { + 0: "POSITIVE_0", + } + + @schemas.classproperty + def POSITIVE_0(cls): + return cls(0) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/integer_enum_with_default_value.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/integer_enum_with_default_value.py new file mode 100644 index 00000000000..3518fc5a25b --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/integer_enum_with_default_value.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class IntegerEnumWithDefaultValue( + schemas.IntSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = { + decimal.Decimal, + } + format = 'int' + default = 0 + enum_value_to_name = { + 0: "POSITIVE_0", + 1: "POSITIVE_1", + 2: "POSITIVE_2", + } + + @schemas.classproperty + def POSITIVE_0(cls): + return cls(0) + + @schemas.classproperty + def POSITIVE_1(cls): + return cls(1) + + @schemas.classproperty + def POSITIVE_2(cls): + return cls(2) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/integer_max10.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/integer_max10.py new file mode 100644 index 00000000000..a6fa47f2975 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/integer_max10.py @@ -0,0 +1,41 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class IntegerMax10( + schemas.Int64Schema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = { + decimal.Decimal, + } + format = 'int64' + inclusive_maximum = 10 diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/integer_min15.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/integer_min15.py new file mode 100644 index 00000000000..3b00ce0e4fe --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/integer_min15.py @@ -0,0 +1,41 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class IntegerMin15( + schemas.Int64Schema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = { + decimal.Decimal, + } + format = 'int64' + inclusive_minimum = 15 diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/isosceles_triangle.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/isosceles_triangle.py new file mode 100644 index 00000000000..ce1183c2400 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/isosceles_triangle.py @@ -0,0 +1,141 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class IsoscelesTriangle( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + + class AllOf: + + @staticmethod + def _0() -> typing.Type['triangle_interface.TriangleInterface']: + return triangle_interface.TriangleInterface + + + class _1( + schemas.DictSchema + ): + + + class Schema_: + types = {frozendict.frozendict} + + class Properties: + + + class TriangleType( + schemas.StrSchema + ): + + + class Schema_: + types = { + str, + } + enum_value_to_name = { + "IsoscelesTriangle": "ISOSCELES_TRIANGLE", + } + + @schemas.classproperty + def ISOSCELES_TRIANGLE(cls): + return cls("IsoscelesTriangle") + __annotations__ = { + "triangleType": TriangleType, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["triangleType"]) -> Schema_.Properties.TriangleType: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["triangleType"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["triangleType"]) -> typing.Union[Schema_.Properties.TriangleType, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["triangleType"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + triangleType: typing.Union[Schema_.Properties.TriangleType, str, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'IsoscelesTriangle.Schema_.AllOf._1': + return super().__new__( + cls, + *args_, + triangleType=triangleType, + configuration_=configuration_, + **kwargs, + ) + classes = [ + _0, + _1, + ] + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'IsoscelesTriangle': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + +from petstore_api.components.schema import triangle_interface diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/items.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/items.py new file mode 100644 index 00000000000..52feddd73b1 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/items.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Items( + schemas.ListSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + + component's name collides with the inner schema name + """ + + + class Schema_: + types = {tuple} + Items = schemas.DictSchema + + def __new__( + cls, + arg_: typing.Union[ + typing.Tuple[ + typing.Union[Schema_.Items, dict, frozendict.frozendict], ... + ], + typing.List[ + typing.Union[Schema_.Items, dict, frozendict.frozendict] + ], + ], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'Items': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) + + def __getitem__(self, i: int) -> Schema_.Items: + return super().__getitem__(i) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/json_patch_request.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/json_patch_request.py new file mode 100644 index 00000000000..cf8a15cc37a --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/json_patch_request.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class JSONPatchRequest( + schemas.ListSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {tuple} + + + class Items( + schemas.AnyTypeSchema, + ): + + + class Schema_: + # any type + + class OneOf: + + @staticmethod + def _0() -> typing.Type['json_patch_request_add_replace_test.JSONPatchRequestAddReplaceTest']: + return json_patch_request_add_replace_test.JSONPatchRequestAddReplaceTest + + @staticmethod + def _1() -> typing.Type['json_patch_request_remove.JSONPatchRequestRemove']: + return json_patch_request_remove.JSONPatchRequestRemove + + @staticmethod + def _2() -> typing.Type['json_patch_request_move_copy.JSONPatchRequestMoveCopy']: + return json_patch_request_move_copy.JSONPatchRequestMoveCopy + classes = [ + _0, + _1, + _2, + ] + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'JSONPatchRequest.Schema_.Items': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + + def __new__( + cls, + arg_: typing.Union[ + typing.Tuple[ + typing.Union[Schema_.Items, dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], ... + ], + typing.List[ + typing.Union[Schema_.Items, dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] + ], + ], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'JSONPatchRequest': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) + + def __getitem__(self, i: int) -> Schema_.Items: + return super().__getitem__(i) + +from petstore_api.components.schema import json_patch_request_add_replace_test +from petstore_api.components.schema import json_patch_request_move_copy +from petstore_api.components.schema import json_patch_request_remove diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/json_patch_request_add_replace_test.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/json_patch_request_add_replace_test.py new file mode 100644 index 00000000000..dfa36d392d2 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/json_patch_request_add_replace_test.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class JSONPatchRequestAddReplaceTest( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {frozendict.frozendict} + required = { + "op", + "path", + "value", + } + + class Properties: + Path = schemas.StrSchema + Value = schemas.AnyTypeSchema + + + class Op( + schemas.StrSchema + ): + + + class Schema_: + types = { + str, + } + enum_value_to_name = { + "add": "ADD", + "replace": "REPLACE", + "test": "TEST", + } + + @schemas.classproperty + def ADD(cls): + return cls("add") + + @schemas.classproperty + def REPLACE(cls): + return cls("replace") + + @schemas.classproperty + def TEST(cls): + return cls("test") + __annotations__ = { + "path": Path, + "value": Value, + "op": Op, + } + AdditionalProperties = schemas.NotAnyTypeSchema + + op: Schema_.Properties.Op + path: Schema_.Properties.Path + value: Schema_.Properties.Value + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["op"]) -> Schema_.Properties.Op: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["path"]) -> Schema_.Properties.Path: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["value"]) -> Schema_.Properties.Value: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["op"], + typing_extensions.Literal["path"], + typing_extensions.Literal["value"], + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["op"]) -> Schema_.Properties.Op: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["path"]) -> Schema_.Properties.Path: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["value"]) -> Schema_.Properties.Value: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["op"], + typing_extensions.Literal["path"], + typing_extensions.Literal["value"], + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + op: typing.Union[Schema_.Properties.Op, str], + path: typing.Union[Schema_.Properties.Path, str], + value: typing.Union[Schema_.Properties.Value, dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'JSONPatchRequestAddReplaceTest': + return super().__new__( + cls, + *args_, + op=op, + path=path, + value=value, + configuration_=configuration_, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/json_patch_request_move_copy.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/json_patch_request_move_copy.py new file mode 100644 index 00000000000..f1f3580bcab --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/json_patch_request_move_copy.py @@ -0,0 +1,132 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class JSONPatchRequestMoveCopy( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {frozendict.frozendict} + required = { + "from", + "op", + "path", + } + + class Properties: + _From = schemas.StrSchema + Path = schemas.StrSchema + + + class Op( + schemas.StrSchema + ): + + + class Schema_: + types = { + str, + } + enum_value_to_name = { + "move": "MOVE", + "copy": "COPY", + } + + @schemas.classproperty + def MOVE(cls): + return cls("move") + + @schemas.classproperty + def COPY(cls): + return cls("copy") + __annotations__ = { + "from": _From, + "path": Path, + "op": Op, + } + AdditionalProperties = schemas.NotAnyTypeSchema + + op: Schema_.Properties.Op + path: Schema_.Properties.Path + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["from"]) -> Schema_.Properties._From: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["op"]) -> Schema_.Properties.Op: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["path"]) -> Schema_.Properties.Path: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["from"], + typing_extensions.Literal["op"], + typing_extensions.Literal["path"], + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["from"]) -> Schema_.Properties._From: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["op"]) -> Schema_.Properties.Op: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["path"]) -> Schema_.Properties.Path: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["from"], + typing_extensions.Literal["op"], + typing_extensions.Literal["path"], + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + op: typing.Union[Schema_.Properties.Op, str], + path: typing.Union[Schema_.Properties.Path, str], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'JSONPatchRequestMoveCopy': + return super().__new__( + cls, + *args_, + op=op, + path=path, + configuration_=configuration_, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/json_patch_request_remove.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/json_patch_request_remove.py new file mode 100644 index 00000000000..f8a96f42f17 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/json_patch_request_remove.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class JSONPatchRequestRemove( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {frozendict.frozendict} + required = { + "op", + "path", + } + + class Properties: + Path = schemas.StrSchema + + + class Op( + schemas.StrSchema + ): + + + class Schema_: + types = { + str, + } + enum_value_to_name = { + "remove": "REMOVE", + } + + @schemas.classproperty + def REMOVE(cls): + return cls("remove") + __annotations__ = { + "path": Path, + "op": Op, + } + AdditionalProperties = schemas.NotAnyTypeSchema + + op: Schema_.Properties.Op + path: Schema_.Properties.Path + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["op"]) -> Schema_.Properties.Op: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["path"]) -> Schema_.Properties.Path: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["op"], + typing_extensions.Literal["path"], + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["op"]) -> Schema_.Properties.Op: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["path"]) -> Schema_.Properties.Path: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["op"], + typing_extensions.Literal["path"], + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + op: typing.Union[Schema_.Properties.Op, str], + path: typing.Union[Schema_.Properties.Path, str], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'JSONPatchRequestRemove': + return super().__new__( + cls, + *args_, + op=op, + path=path, + configuration_=configuration_, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/mammal.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/mammal.py new file mode 100644 index 00000000000..810eb6be5a0 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/mammal.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Mammal( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + + @staticmethod + def discriminator(): + return { + 'className': { + 'Pig': pig.Pig, + 'whale': whale.Whale, + 'zebra': zebra.Zebra, + } + } + + class OneOf: + + @staticmethod + def _0() -> typing.Type['whale.Whale']: + return whale.Whale + + @staticmethod + def _1() -> typing.Type['zebra.Zebra']: + return zebra.Zebra + + @staticmethod + def _2() -> typing.Type['pig.Pig']: + return pig.Pig + classes = [ + _0, + _1, + _2, + ] + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'Mammal': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + +from petstore_api.components.schema import pig +from petstore_api.components.schema import whale +from petstore_api.components.schema import zebra diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/map_test.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/map_test.py new file mode 100644 index 00000000000..17a4a5609f9 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/map_test.py @@ -0,0 +1,268 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class MapTest( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {frozendict.frozendict} + + class Properties: + + + class MapMapOfString( + schemas.DictSchema + ): + + + class Schema_: + types = {frozendict.frozendict} + + + class AdditionalProperties( + schemas.DictSchema + ): + + + class Schema_: + types = {frozendict.frozendict} + AdditionalProperties = schemas.StrSchema + + def __getitem__(self, name: str) -> Schema_.AdditionalProperties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def get_item_(self, name: str) -> Schema_.AdditionalProperties: + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[Schema_.AdditionalProperties, str], + ) -> 'MapTest.Schema_.Properties.MapMapOfString.Schema_.AdditionalProperties': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + + def __getitem__(self, name: str) -> Schema_.AdditionalProperties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def get_item_(self, name: str) -> Schema_.AdditionalProperties: + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[Schema_.AdditionalProperties, dict, frozendict.frozendict], + ) -> 'MapTest.Schema_.Properties.MapMapOfString': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + + + class MapOfEnumString( + schemas.DictSchema + ): + + + class Schema_: + types = {frozendict.frozendict} + + + class AdditionalProperties( + schemas.StrSchema + ): + + + class Schema_: + types = { + str, + } + enum_value_to_name = { + "UPPER": "UPPER", + "lower": "LOWER", + } + + @schemas.classproperty + def UPPER(cls): + return cls("UPPER") + + @schemas.classproperty + def LOWER(cls): + return cls("lower") + + def __getitem__(self, name: str) -> Schema_.AdditionalProperties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def get_item_(self, name: str) -> Schema_.AdditionalProperties: + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[Schema_.AdditionalProperties, str], + ) -> 'MapTest.Schema_.Properties.MapOfEnumString': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + + + class DirectMap( + schemas.DictSchema + ): + + + class Schema_: + types = {frozendict.frozendict} + AdditionalProperties = schemas.BoolSchema + + def __getitem__(self, name: str) -> Schema_.AdditionalProperties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def get_item_(self, name: str) -> Schema_.AdditionalProperties: + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[Schema_.AdditionalProperties, bool], + ) -> 'MapTest.Schema_.Properties.DirectMap': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + + @staticmethod + def indirect_map() -> typing.Type['string_boolean_map.StringBooleanMap']: + return string_boolean_map.StringBooleanMap + __annotations__ = { + "map_map_of_string": MapMapOfString, + "map_of_enum_string": MapOfEnumString, + "direct_map": DirectMap, + "indirect_map": indirect_map, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["map_map_of_string"]) -> Schema_.Properties.MapMapOfString: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["map_of_enum_string"]) -> Schema_.Properties.MapOfEnumString: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["direct_map"]) -> Schema_.Properties.DirectMap: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["indirect_map"]) -> 'string_boolean_map.StringBooleanMap': ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["map_map_of_string"], + typing_extensions.Literal["map_of_enum_string"], + typing_extensions.Literal["direct_map"], + typing_extensions.Literal["indirect_map"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["map_map_of_string"]) -> typing.Union[Schema_.Properties.MapMapOfString, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["map_of_enum_string"]) -> typing.Union[Schema_.Properties.MapOfEnumString, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["direct_map"]) -> typing.Union[Schema_.Properties.DirectMap, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["indirect_map"]) -> typing.Union['string_boolean_map.StringBooleanMap', schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["map_map_of_string"], + typing_extensions.Literal["map_of_enum_string"], + typing_extensions.Literal["direct_map"], + typing_extensions.Literal["indirect_map"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + map_map_of_string: typing.Union[Schema_.Properties.MapMapOfString, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + map_of_enum_string: typing.Union[Schema_.Properties.MapOfEnumString, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + direct_map: typing.Union[Schema_.Properties.DirectMap, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + indirect_map: typing.Union['string_boolean_map.StringBooleanMap', dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'MapTest': + return super().__new__( + cls, + *args_, + map_map_of_string=map_map_of_string, + map_of_enum_string=map_of_enum_string, + direct_map=direct_map, + indirect_map=indirect_map, + configuration_=configuration_, + **kwargs, + ) + +from petstore_api.components.schema import string_boolean_map diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/mixed_properties_and_additional_properties_class.py new file mode 100644 index 00000000000..7c7e40fc6eb --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/mixed_properties_and_additional_properties_class.py @@ -0,0 +1,147 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class MixedPropertiesAndAdditionalPropertiesClass( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {frozendict.frozendict} + + class Properties: + Uuid = schemas.UUIDSchema + DateTime = schemas.DateTimeSchema + + + class Map( + schemas.DictSchema + ): + + + class Schema_: + types = {frozendict.frozendict} + + @staticmethod + def additional_properties() -> typing.Type['animal.Animal']: + return animal.Animal + + def __getitem__(self, name: str) -> 'animal.Animal': + # dict_instance[name] accessor + return super().__getitem__(name) + + def get_item_(self, name: str) -> 'animal.Animal': + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union['animal.Animal', dict, frozendict.frozendict], + ) -> 'MixedPropertiesAndAdditionalPropertiesClass.Schema_.Properties.Map': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + __annotations__ = { + "uuid": Uuid, + "dateTime": DateTime, + "map": Map, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["uuid"]) -> Schema_.Properties.Uuid: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["dateTime"]) -> Schema_.Properties.DateTime: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["map"]) -> Schema_.Properties.Map: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["uuid"], + typing_extensions.Literal["dateTime"], + typing_extensions.Literal["map"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["uuid"]) -> typing.Union[Schema_.Properties.Uuid, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["dateTime"]) -> typing.Union[Schema_.Properties.DateTime, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["map"]) -> typing.Union[Schema_.Properties.Map, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["uuid"], + typing_extensions.Literal["dateTime"], + typing_extensions.Literal["map"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + uuid: typing.Union[Schema_.Properties.Uuid, str, uuid.UUID, schemas.Unset] = schemas.unset, + dateTime: typing.Union[Schema_.Properties.DateTime, str, datetime.datetime, schemas.Unset] = schemas.unset, + map: typing.Union[Schema_.Properties.Map, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'MixedPropertiesAndAdditionalPropertiesClass': + return super().__new__( + cls, + *args_, + uuid=uuid, + dateTime=dateTime, + map=map, + configuration_=configuration_, + **kwargs, + ) + +from petstore_api.components.schema import animal diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/money.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/money.py new file mode 100644 index 00000000000..4e71cd6de4f --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/money.py @@ -0,0 +1,113 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Money( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {frozendict.frozendict} + required = { + "amount", + "currency", + } + + class Properties: + Amount = schemas.DecimalSchema + + @staticmethod + def currency() -> typing.Type['currency.Currency']: + return currency.Currency + __annotations__ = { + "amount": Amount, + "currency": currency, + } + + amount: Schema_.Properties.Amount + currency: 'currency.Currency' + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["amount"]) -> Schema_.Properties.Amount: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["currency"]) -> 'currency.Currency': ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["amount"], + typing_extensions.Literal["currency"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["amount"]) -> Schema_.Properties.Amount: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["currency"]) -> 'currency.Currency': ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["amount"], + typing_extensions.Literal["currency"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + amount: typing.Union[Schema_.Properties.Amount, str], + currency: typing.Union['currency.Currency', str], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'Money': + return super().__new__( + cls, + *args_, + amount=amount, + currency=currency, + configuration_=configuration_, + **kwargs, + ) + +from petstore_api.components.schema import currency diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/name.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/name.py new file mode 100644 index 00000000000..44f707b9c73 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/name.py @@ -0,0 +1,117 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Name( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + + Model for testing model name same as property name + """ + + + class Schema_: + # any type + required = { + "name", + } + + class Properties: + Name = schemas.Int32Schema + SnakeCase = schemas.Int32Schema + _Property = schemas.StrSchema + __annotations__ = { + "name": Name, + "snake_case": SnakeCase, + "property": _Property, + } + + + name: Schema_.Properties.Name + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["name"]) -> Schema_.Properties.Name: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["snake_case"]) -> Schema_.Properties.SnakeCase: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["property"]) -> Schema_.Properties._Property: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["name"], + typing_extensions.Literal["snake_case"], + typing_extensions.Literal["property"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["name"]) -> Schema_.Properties.Name: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["snake_case"]) -> typing.Union[Schema_.Properties.SnakeCase, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["property"]) -> typing.Union[Schema_.Properties._Property, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["name"], + typing_extensions.Literal["snake_case"], + typing_extensions.Literal["property"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + snake_case: typing.Union[Schema_.Properties.SnakeCase, decimal.Decimal, int, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'Name': + return super().__new__( + cls, + *args_, + snake_case=snake_case, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/no_additional_properties.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/no_additional_properties.py new file mode 100644 index 00000000000..b44cc0b5b59 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/no_additional_properties.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class NoAdditionalProperties( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {frozendict.frozendict} + required = { + "id", + } + + class Properties: + Id = schemas.Int64Schema + PetId = schemas.Int64Schema + __annotations__ = { + "id": Id, + "petId": PetId, + } + AdditionalProperties = schemas.NotAnyTypeSchema + + id: Schema_.Properties.Id + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["id"]) -> Schema_.Properties.Id: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["petId"]) -> Schema_.Properties.PetId: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["id"], + typing_extensions.Literal["petId"], + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["id"]) -> Schema_.Properties.Id: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["petId"]) -> typing.Union[Schema_.Properties.PetId, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["id"], + typing_extensions.Literal["petId"], + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + id: typing.Union[Schema_.Properties.Id, decimal.Decimal, int], + petId: typing.Union[Schema_.Properties.PetId, decimal.Decimal, int, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'NoAdditionalProperties': + return super().__new__( + cls, + *args_, + id=id, + petId=petId, + configuration_=configuration_, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/nullable_class.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/nullable_class.py new file mode 100644 index 00000000000..fb5c4eab3c3 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/nullable_class.py @@ -0,0 +1,708 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class NullableClass( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {frozendict.frozendict} + + class Properties: + + + class IntegerProp( + schemas.NoneBase, + schemas.IntBase, + schemas.Schema, + schemas.NoneDecimalMixin + ): + + + class Schema_: + types = { + schemas.NoneClass, + decimal.Decimal, + } + format = 'int' + + + def __new__( + cls, + arg_: typing.Union[None, decimal.Decimal, int], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'NullableClass.Schema_.Properties.IntegerProp': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) + + + class NumberProp( + schemas.NoneBase, + schemas.NumberBase, + schemas.Schema, + schemas.NoneDecimalMixin + ): + + + class Schema_: + types = { + schemas.NoneClass, + decimal.Decimal, + } + + + def __new__( + cls, + arg_: typing.Union[None, decimal.Decimal, int, float], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'NullableClass.Schema_.Properties.NumberProp': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) + + + class BooleanProp( + schemas.NoneBase, + schemas.BoolBase, + schemas.Schema, + schemas.NoneBoolMixin + ): + + + class Schema_: + types = { + schemas.NoneClass, + schemas.BoolClass, + } + + + def __new__( + cls, + arg_: typing.Union[None, bool], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'NullableClass.Schema_.Properties.BooleanProp': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) + + + class StringProp( + schemas.NoneBase, + schemas.StrBase, + schemas.Schema, + schemas.NoneStrMixin + ): + + + class Schema_: + types = { + schemas.NoneClass, + str, + } + + + def __new__( + cls, + arg_: typing.Union[None, str], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'NullableClass.Schema_.Properties.StringProp': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) + + + class DateProp( + schemas.NoneBase, + schemas.DateBase, + schemas.StrBase, + schemas.Schema, + schemas.NoneStrMixin + ): + + + class Schema_: + types = { + schemas.NoneClass, + str, + } + format = 'date' + + + def __new__( + cls, + arg_: typing.Union[None, str, datetime.date], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'NullableClass.Schema_.Properties.DateProp': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) + + + class DatetimeProp( + schemas.NoneBase, + schemas.DateTimeBase, + schemas.StrBase, + schemas.Schema, + schemas.NoneStrMixin + ): + + + class Schema_: + types = { + schemas.NoneClass, + str, + } + format = 'date-time' + + + def __new__( + cls, + arg_: typing.Union[None, str, datetime.datetime], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'NullableClass.Schema_.Properties.DatetimeProp': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) + + + class ArrayNullableProp( + schemas.NoneBase, + schemas.ListBase, + schemas.Schema, + schemas.NoneTupleMixin + ): + + + class Schema_: + types = { + schemas.NoneClass, + tuple, + } + Items = schemas.DictSchema + + + def __new__( + cls, + arg_: typing.Union[None, list, tuple], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'NullableClass.Schema_.Properties.ArrayNullableProp': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) + + + class ArrayAndItemsNullableProp( + schemas.NoneBase, + schemas.ListBase, + schemas.Schema, + schemas.NoneTupleMixin + ): + + + class Schema_: + types = { + schemas.NoneClass, + tuple, + } + + + class Items( + schemas.NoneBase, + schemas.DictBase, + schemas.Schema, + schemas.NoneFrozenDictMixin + ): + + + class Schema_: + types = { + schemas.NoneClass, + frozendict.frozendict, + } + + + def __new__( + cls, + *args_: typing.Union[None, dict, frozendict.frozendict], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'NullableClass.Schema_.Properties.ArrayAndItemsNullableProp.Schema_.Items': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + + + def __new__( + cls, + arg_: typing.Union[None, list, tuple], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'NullableClass.Schema_.Properties.ArrayAndItemsNullableProp': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) + + + class ArrayItemsNullable( + schemas.ListSchema + ): + + + class Schema_: + types = {tuple} + + + class Items( + schemas.NoneBase, + schemas.DictBase, + schemas.Schema, + schemas.NoneFrozenDictMixin + ): + + + class Schema_: + types = { + schemas.NoneClass, + frozendict.frozendict, + } + + + def __new__( + cls, + *args_: typing.Union[None, dict, frozendict.frozendict], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'NullableClass.Schema_.Properties.ArrayItemsNullable.Schema_.Items': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + + def __new__( + cls, + arg_: typing.Union[ + typing.Tuple[ + typing.Union[Schema_.Items, None, dict, frozendict.frozendict], ... + ], + typing.List[ + typing.Union[Schema_.Items, None, dict, frozendict.frozendict] + ], + ], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'NullableClass.Schema_.Properties.ArrayItemsNullable': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) + + def __getitem__(self, i: int) -> Schema_.Items: + return super().__getitem__(i) + + + class ObjectNullableProp( + schemas.NoneBase, + schemas.DictBase, + schemas.Schema, + schemas.NoneFrozenDictMixin + ): + + + class Schema_: + types = { + schemas.NoneClass, + frozendict.frozendict, + } + AdditionalProperties = schemas.DictSchema + + + def __getitem__(self, name: str) -> Schema_.AdditionalProperties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def get_item_(self, name: str) -> Schema_.AdditionalProperties: + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[None, dict, frozendict.frozendict], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[Schema_.AdditionalProperties, dict, frozendict.frozendict], + ) -> 'NullableClass.Schema_.Properties.ObjectNullableProp': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + + + class ObjectAndItemsNullableProp( + schemas.NoneBase, + schemas.DictBase, + schemas.Schema, + schemas.NoneFrozenDictMixin + ): + + + class Schema_: + types = { + schemas.NoneClass, + frozendict.frozendict, + } + + + class AdditionalProperties( + schemas.NoneBase, + schemas.DictBase, + schemas.Schema, + schemas.NoneFrozenDictMixin + ): + + + class Schema_: + types = { + schemas.NoneClass, + frozendict.frozendict, + } + + + def __new__( + cls, + *args_: typing.Union[None, dict, frozendict.frozendict], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'NullableClass.Schema_.Properties.ObjectAndItemsNullableProp.Schema_.AdditionalProperties': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + + + def __getitem__(self, name: str) -> Schema_.AdditionalProperties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def get_item_(self, name: str) -> Schema_.AdditionalProperties: + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[None, dict, frozendict.frozendict], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[Schema_.AdditionalProperties, None, dict, frozendict.frozendict], + ) -> 'NullableClass.Schema_.Properties.ObjectAndItemsNullableProp': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + + + class ObjectItemsNullable( + schemas.DictSchema + ): + + + class Schema_: + types = {frozendict.frozendict} + + + class AdditionalProperties( + schemas.NoneBase, + schemas.DictBase, + schemas.Schema, + schemas.NoneFrozenDictMixin + ): + + + class Schema_: + types = { + schemas.NoneClass, + frozendict.frozendict, + } + + + def __new__( + cls, + *args_: typing.Union[None, dict, frozendict.frozendict], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'NullableClass.Schema_.Properties.ObjectItemsNullable.Schema_.AdditionalProperties': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + + def __getitem__(self, name: str) -> Schema_.AdditionalProperties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def get_item_(self, name: str) -> Schema_.AdditionalProperties: + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[Schema_.AdditionalProperties, None, dict, frozendict.frozendict], + ) -> 'NullableClass.Schema_.Properties.ObjectItemsNullable': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + __annotations__ = { + "integer_prop": IntegerProp, + "number_prop": NumberProp, + "boolean_prop": BooleanProp, + "string_prop": StringProp, + "date_prop": DateProp, + "datetime_prop": DatetimeProp, + "array_nullable_prop": ArrayNullableProp, + "array_and_items_nullable_prop": ArrayAndItemsNullableProp, + "array_items_nullable": ArrayItemsNullable, + "object_nullable_prop": ObjectNullableProp, + "object_and_items_nullable_prop": ObjectAndItemsNullableProp, + "object_items_nullable": ObjectItemsNullable, + } + + + class AdditionalProperties( + schemas.NoneBase, + schemas.DictBase, + schemas.Schema, + schemas.NoneFrozenDictMixin + ): + + + class Schema_: + types = { + schemas.NoneClass, + frozendict.frozendict, + } + + + def __new__( + cls, + *args_: typing.Union[None, dict, frozendict.frozendict], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'NullableClass.Schema_.AdditionalProperties': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["integer_prop"]) -> Schema_.Properties.IntegerProp: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["number_prop"]) -> Schema_.Properties.NumberProp: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["boolean_prop"]) -> Schema_.Properties.BooleanProp: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["string_prop"]) -> Schema_.Properties.StringProp: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["date_prop"]) -> Schema_.Properties.DateProp: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["datetime_prop"]) -> Schema_.Properties.DatetimeProp: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["array_nullable_prop"]) -> Schema_.Properties.ArrayNullableProp: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["array_and_items_nullable_prop"]) -> Schema_.Properties.ArrayAndItemsNullableProp: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["array_items_nullable"]) -> Schema_.Properties.ArrayItemsNullable: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["object_nullable_prop"]) -> Schema_.Properties.ObjectNullableProp: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["object_and_items_nullable_prop"]) -> Schema_.Properties.ObjectAndItemsNullableProp: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["object_items_nullable"]) -> Schema_.Properties.ObjectItemsNullable: ... + + @typing.overload + def __getitem__(self, name: str) -> Schema_.AdditionalProperties: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["integer_prop"], + typing_extensions.Literal["number_prop"], + typing_extensions.Literal["boolean_prop"], + typing_extensions.Literal["string_prop"], + typing_extensions.Literal["date_prop"], + typing_extensions.Literal["datetime_prop"], + typing_extensions.Literal["array_nullable_prop"], + typing_extensions.Literal["array_and_items_nullable_prop"], + typing_extensions.Literal["array_items_nullable"], + typing_extensions.Literal["object_nullable_prop"], + typing_extensions.Literal["object_and_items_nullable_prop"], + typing_extensions.Literal["object_items_nullable"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["integer_prop"]) -> typing.Union[Schema_.Properties.IntegerProp, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["number_prop"]) -> typing.Union[Schema_.Properties.NumberProp, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["boolean_prop"]) -> typing.Union[Schema_.Properties.BooleanProp, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["string_prop"]) -> typing.Union[Schema_.Properties.StringProp, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["date_prop"]) -> typing.Union[Schema_.Properties.DateProp, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["datetime_prop"]) -> typing.Union[Schema_.Properties.DatetimeProp, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["array_nullable_prop"]) -> typing.Union[Schema_.Properties.ArrayNullableProp, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["array_and_items_nullable_prop"]) -> typing.Union[Schema_.Properties.ArrayAndItemsNullableProp, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["array_items_nullable"]) -> typing.Union[Schema_.Properties.ArrayItemsNullable, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["object_nullable_prop"]) -> typing.Union[Schema_.Properties.ObjectNullableProp, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["object_and_items_nullable_prop"]) -> typing.Union[Schema_.Properties.ObjectAndItemsNullableProp, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["object_items_nullable"]) -> typing.Union[Schema_.Properties.ObjectItemsNullable, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[Schema_.AdditionalProperties, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["integer_prop"], + typing_extensions.Literal["number_prop"], + typing_extensions.Literal["boolean_prop"], + typing_extensions.Literal["string_prop"], + typing_extensions.Literal["date_prop"], + typing_extensions.Literal["datetime_prop"], + typing_extensions.Literal["array_nullable_prop"], + typing_extensions.Literal["array_and_items_nullable_prop"], + typing_extensions.Literal["array_items_nullable"], + typing_extensions.Literal["object_nullable_prop"], + typing_extensions.Literal["object_and_items_nullable_prop"], + typing_extensions.Literal["object_items_nullable"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + integer_prop: typing.Union[Schema_.Properties.IntegerProp, None, decimal.Decimal, int, schemas.Unset] = schemas.unset, + number_prop: typing.Union[Schema_.Properties.NumberProp, None, decimal.Decimal, int, float, schemas.Unset] = schemas.unset, + boolean_prop: typing.Union[Schema_.Properties.BooleanProp, None, bool, schemas.Unset] = schemas.unset, + string_prop: typing.Union[Schema_.Properties.StringProp, None, str, schemas.Unset] = schemas.unset, + date_prop: typing.Union[Schema_.Properties.DateProp, None, str, datetime.date, schemas.Unset] = schemas.unset, + datetime_prop: typing.Union[Schema_.Properties.DatetimeProp, None, str, datetime.datetime, schemas.Unset] = schemas.unset, + array_nullable_prop: typing.Union[Schema_.Properties.ArrayNullableProp, None, list, tuple, schemas.Unset] = schemas.unset, + array_and_items_nullable_prop: typing.Union[Schema_.Properties.ArrayAndItemsNullableProp, None, list, tuple, schemas.Unset] = schemas.unset, + array_items_nullable: typing.Union[Schema_.Properties.ArrayItemsNullable, list, tuple, schemas.Unset] = schemas.unset, + object_nullable_prop: typing.Union[Schema_.Properties.ObjectNullableProp, None, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + object_and_items_nullable_prop: typing.Union[Schema_.Properties.ObjectAndItemsNullableProp, None, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + object_items_nullable: typing.Union[Schema_.Properties.ObjectItemsNullable, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[Schema_.AdditionalProperties, None, dict, frozendict.frozendict], + ) -> 'NullableClass': + return super().__new__( + cls, + *args_, + integer_prop=integer_prop, + number_prop=number_prop, + boolean_prop=boolean_prop, + string_prop=string_prop, + date_prop=date_prop, + datetime_prop=datetime_prop, + array_nullable_prop=array_nullable_prop, + array_and_items_nullable_prop=array_and_items_nullable_prop, + array_items_nullable=array_items_nullable, + object_nullable_prop=object_nullable_prop, + object_and_items_nullable_prop=object_and_items_nullable_prop, + object_items_nullable=object_items_nullable, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/nullable_shape.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/nullable_shape.py new file mode 100644 index 00000000000..9844c999d03 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/nullable_shape.py @@ -0,0 +1,72 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class NullableShape( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + + The value may be a shape or the 'null' value. For a composed schema to validate a null payload, one of its chosen oneOf schemas must be type null or nullable (introduced in OAS schema >= 3.0) + """ + + + class Schema_: + # any type + + class OneOf: + + @staticmethod + def _0() -> typing.Type['triangle.Triangle']: + return triangle.Triangle + + @staticmethod + def _1() -> typing.Type['quadrilateral.Quadrilateral']: + return quadrilateral.Quadrilateral + _2 = schemas.NoneSchema + classes = [ + _0, + _1, + _2, + ] + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'NullableShape': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + +from petstore_api.components.schema import quadrilateral +from petstore_api.components.schema import triangle diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/nullable_string.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/nullable_string.py new file mode 100644 index 00000000000..4afac58271d --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/nullable_string.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class NullableString( + schemas.NoneBase, + schemas.StrBase, + schemas.Schema, + schemas.NoneStrMixin +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = { + schemas.NoneClass, + str, + } + + + def __new__( + cls, + arg_: typing.Union[None, str], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'NullableString': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/number.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/number.py similarity index 82% rename from samples/openapi3/client/petstore/python/petstore_api/model/number.py rename to samples/openapi3/client/petstore/python/src/petstore_api/components/schema/number.py index 7210b911ced..214af7c087c 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/number.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/number.py @@ -6,10 +6,10 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ -from datetime import date, datetime # noqa: F401 +import datetime # noqa: F401 import decimal # noqa: F401 import functools # noqa: F401 import io # noqa: F401 diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/number_only.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/number_only.py new file mode 100644 index 00000000000..7b4327c23e2 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/number_only.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class NumberOnly( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {frozendict.frozendict} + + class Properties: + JustNumber = schemas.NumberSchema + __annotations__ = { + "JustNumber": JustNumber, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["JustNumber"]) -> Schema_.Properties.JustNumber: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["JustNumber"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["JustNumber"]) -> typing.Union[Schema_.Properties.JustNumber, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["JustNumber"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + JustNumber: typing.Union[Schema_.Properties.JustNumber, decimal.Decimal, int, float, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'NumberOnly': + return super().__new__( + cls, + *args_, + JustNumber=JustNumber, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/number_with_validations.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/number_with_validations.py new file mode 100644 index 00000000000..046793d24ad --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/number_with_validations.py @@ -0,0 +1,41 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class NumberWithValidations( + schemas.NumberSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = { + decimal.Decimal, + } + inclusive_maximum = 20 + inclusive_minimum = 10 diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/object_interface.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_interface.py similarity index 82% rename from samples/openapi3/client/petstore/python/petstore_api/model/object_interface.py rename to samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_interface.py index 05dc6ddd565..a8bf8f8b1bb 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/object_interface.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_interface.py @@ -6,10 +6,10 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ -from datetime import date, datetime # noqa: F401 +import datetime # noqa: F401 import decimal # noqa: F401 import functools # noqa: F401 import io # noqa: F401 diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_model_with_arg_and_args_properties.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_model_with_arg_and_args_properties.py new file mode 100644 index 00000000000..74815e96bd8 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_model_with_arg_and_args_properties.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ObjectModelWithArgAndArgsProperties( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {frozendict.frozendict} + required = { + "arg", + "args", + } + + class Properties: + Arg = schemas.StrSchema + Args = schemas.StrSchema + __annotations__ = { + "arg": Arg, + "args": Args, + } + + arg: Schema_.Properties.Arg + args: Schema_.Properties.Args + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["arg"]) -> Schema_.Properties.Arg: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["args"]) -> Schema_.Properties.Args: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["arg"], + typing_extensions.Literal["args"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["arg"]) -> Schema_.Properties.Arg: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["args"]) -> Schema_.Properties.Args: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["arg"], + typing_extensions.Literal["args"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + arg: typing.Union[Schema_.Properties.Arg, str], + args: typing.Union[Schema_.Properties.Args, str], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'ObjectModelWithArgAndArgsProperties': + return super().__new__( + cls, + *args_, + arg=arg, + args=args, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_model_with_ref_props.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_model_with_ref_props.py new file mode 100644 index 00000000000..5ff691476f1 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_model_with_ref_props.py @@ -0,0 +1,128 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ObjectModelWithRefProps( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + + a model that includes properties which should stay primitive (String + Boolean) and one which is defined as a class, NumberWithValidations + """ + + + class Schema_: + types = {frozendict.frozendict} + + class Properties: + + @staticmethod + def my_number() -> typing.Type['number_with_validations.NumberWithValidations']: + return number_with_validations.NumberWithValidations + + @staticmethod + def my_string() -> typing.Type['string.String']: + return string.String + + @staticmethod + def my_boolean() -> typing.Type['boolean.Boolean']: + return boolean.Boolean + __annotations__ = { + "myNumber": my_number, + "myString": my_string, + "myBoolean": my_boolean, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["myNumber"]) -> 'number_with_validations.NumberWithValidations': ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["myString"]) -> 'string.String': ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["myBoolean"]) -> 'boolean.Boolean': ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["myNumber"], + typing_extensions.Literal["myString"], + typing_extensions.Literal["myBoolean"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["myNumber"]) -> typing.Union['number_with_validations.NumberWithValidations', schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["myString"]) -> typing.Union['string.String', schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["myBoolean"]) -> typing.Union['boolean.Boolean', schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["myNumber"], + typing_extensions.Literal["myString"], + typing_extensions.Literal["myBoolean"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + myNumber: typing.Union['number_with_validations.NumberWithValidations', decimal.Decimal, int, float, schemas.Unset] = schemas.unset, + myString: typing.Union['string.String', str, schemas.Unset] = schemas.unset, + myBoolean: typing.Union['boolean.Boolean', bool, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'ObjectModelWithRefProps': + return super().__new__( + cls, + *args_, + myNumber=myNumber, + myString=myString, + myBoolean=myBoolean, + configuration_=configuration_, + **kwargs, + ) + +from petstore_api.components.schema import boolean +from petstore_api.components.schema import number_with_validations +from petstore_api.components.schema import string diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_with_all_of_with_req_test_prop_from_unset_add_prop.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_with_all_of_with_req_test_prop_from_unset_add_prop.py new file mode 100644 index 00000000000..4c2b570ac13 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_with_all_of_with_req_test_prop_from_unset_add_prop.py @@ -0,0 +1,129 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ObjectWithAllOfWithReqTestPropFromUnsetAddProp( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + + class AllOf: + + @staticmethod + def _0() -> typing.Type['object_with_optional_test_prop.ObjectWithOptionalTestProp']: + return object_with_optional_test_prop.ObjectWithOptionalTestProp + + + class _1( + schemas.DictSchema + ): + + + class Schema_: + types = {frozendict.frozendict} + required = { + "test", + } + + class Properties: + Name = schemas.StrSchema + __annotations__ = { + "name": Name, + } + + test: schemas.AnyTypeSchema + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["test"]) -> schemas.AnyTypeSchema: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["test"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["test"]) -> schemas.AnyTypeSchema: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["test"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + test: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'ObjectWithAllOfWithReqTestPropFromUnsetAddProp.Schema_.AllOf._1': + return super().__new__( + cls, + *args_, + test=test, + configuration_=configuration_, + **kwargs, + ) + classes = [ + _0, + _1, + ] + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'ObjectWithAllOfWithReqTestPropFromUnsetAddProp': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + +from petstore_api.components.schema import object_with_optional_test_prop diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_with_colliding_properties.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_with_colliding_properties.py new file mode 100644 index 00000000000..c5f50af2be4 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_with_colliding_properties.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ObjectWithCollidingProperties( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + + component with properties that have name collisions + """ + + + class Schema_: + types = {frozendict.frozendict} + + class Properties: + SomeProp = schemas.DictSchema + Someprop = schemas.DictSchema + __annotations__ = { + "someProp": SomeProp, + "someprop": Someprop, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["someProp"]) -> Schema_.Properties.SomeProp: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["someprop"]) -> Schema_.Properties.Someprop: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["someProp"], + typing_extensions.Literal["someprop"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["someProp"]) -> typing.Union[Schema_.Properties.SomeProp, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["someprop"]) -> typing.Union[Schema_.Properties.Someprop, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["someProp"], + typing_extensions.Literal["someprop"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + someProp: typing.Union[Schema_.Properties.SomeProp, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + someprop: typing.Union[Schema_.Properties.Someprop, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'ObjectWithCollidingProperties': + return super().__new__( + cls, + *args_, + someProp=someProp, + someprop=someprop, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_with_decimal_properties.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_with_decimal_properties.py new file mode 100644 index 00000000000..d170f9cfbfb --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_with_decimal_properties.py @@ -0,0 +1,122 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ObjectWithDecimalProperties( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {frozendict.frozendict} + + class Properties: + + @staticmethod + def length() -> typing.Type['decimal_payload.DecimalPayload']: + return decimal_payload.DecimalPayload + Width = schemas.DecimalSchema + + @staticmethod + def cost() -> typing.Type['money.Money']: + return money.Money + __annotations__ = { + "length": length, + "width": Width, + "cost": cost, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["length"]) -> 'decimal_payload.DecimalPayload': ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["width"]) -> Schema_.Properties.Width: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["cost"]) -> 'money.Money': ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["length"], + typing_extensions.Literal["width"], + typing_extensions.Literal["cost"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["length"]) -> typing.Union['decimal_payload.DecimalPayload', schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["width"]) -> typing.Union[Schema_.Properties.Width, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["cost"]) -> typing.Union['money.Money', schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["length"], + typing_extensions.Literal["width"], + typing_extensions.Literal["cost"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + length: typing.Union['decimal_payload.DecimalPayload', str, schemas.Unset] = schemas.unset, + width: typing.Union[Schema_.Properties.Width, str, schemas.Unset] = schemas.unset, + cost: typing.Union['money.Money', dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'ObjectWithDecimalProperties': + return super().__new__( + cls, + *args_, + length=length, + width=width, + cost=cost, + configuration_=configuration_, + **kwargs, + ) + +from petstore_api.components.schema import decimal_payload +from petstore_api.components.schema import money diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_with_difficultly_named_props.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_with_difficultly_named_props.py new file mode 100644 index 00000000000..0ecb707420d --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_with_difficultly_named_props.py @@ -0,0 +1,113 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ObjectWithDifficultlyNamedProps( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + + model with properties that have invalid names for python + """ + + + class Schema_: + types = {frozendict.frozendict} + required = { + "123-list", + } + + class Properties: + SpecialPropertyName = schemas.Int64Schema + _123List = schemas.StrSchema + _123Number = schemas.IntSchema + __annotations__ = { + "$special[property.name]": SpecialPropertyName, + "123-list": _123List, + "123Number": _123Number, + } + + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["123-list"]) -> Schema_.Properties._123List: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["$special[property.name]"]) -> Schema_.Properties.SpecialPropertyName: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["123Number"]) -> Schema_.Properties._123Number: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["123-list"], + typing_extensions.Literal["$special[property.name]"], + typing_extensions.Literal["123Number"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["123-list"]) -> Schema_.Properties._123List: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["$special[property.name]"]) -> typing.Union[Schema_.Properties.SpecialPropertyName, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["123Number"]) -> typing.Union[Schema_.Properties._123Number, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["123-list"], + typing_extensions.Literal["$special[property.name]"], + typing_extensions.Literal["123Number"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'ObjectWithDifficultlyNamedProps': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_with_inline_composition_property.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_with_inline_composition_property.py new file mode 100644 index 00000000000..5728e3469a5 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_with_inline_composition_property.py @@ -0,0 +1,128 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ObjectWithInlineCompositionProperty( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {frozendict.frozendict} + + class Properties: + + + class SomeProp( + schemas.AnyTypeSchema, + ): + + + class Schema_: + # any type + + class AllOf: + + + class _0( + schemas.StrSchema + ): + + + class Schema_: + types = { + str, + } + min_length = 1 + classes = [ + _0, + ] + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'ObjectWithInlineCompositionProperty.Schema_.Properties.SomeProp': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + __annotations__ = { + "someProp": SomeProp, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["someProp"]) -> Schema_.Properties.SomeProp: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["someProp"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["someProp"]) -> typing.Union[Schema_.Properties.SomeProp, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["someProp"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + someProp: typing.Union[Schema_.Properties.SomeProp, dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'ObjectWithInlineCompositionProperty': + return super().__new__( + cls, + *args_, + someProp=someProp, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_with_invalid_named_refed_properties.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_with_invalid_named_refed_properties.py new file mode 100644 index 00000000000..33943ea818b --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_with_invalid_named_refed_properties.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ObjectWithInvalidNamedRefedProperties( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {frozendict.frozendict} + required = { + "!reference", + "from", + } + + class Properties: + + @staticmethod + def _from() -> typing.Type['from_schema.FromSchema']: + return from_schema.FromSchema + + @staticmethod + def reference() -> typing.Type['array_with_validations_in_items.ArrayWithValidationsInItems']: + return array_with_validations_in_items.ArrayWithValidationsInItems + __annotations__ = { + "from": _from, + "!reference": reference, + } + + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["!reference"]) -> 'array_with_validations_in_items.ArrayWithValidationsInItems': ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["from"]) -> 'from_schema.FromSchema': ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["!reference"], + typing_extensions.Literal["from"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["!reference"]) -> 'array_with_validations_in_items.ArrayWithValidationsInItems': ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["from"]) -> 'from_schema.FromSchema': ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["!reference"], + typing_extensions.Literal["from"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'ObjectWithInvalidNamedRefedProperties': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + +from petstore_api.components.schema import array_with_validations_in_items +from petstore_api.components.schema import from_schema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_with_optional_test_prop.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_with_optional_test_prop.py new file mode 100644 index 00000000000..5b23c75d360 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_with_optional_test_prop.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ObjectWithOptionalTestProp( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {frozendict.frozendict} + + class Properties: + Test = schemas.StrSchema + __annotations__ = { + "test": Test, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["test"]) -> Schema_.Properties.Test: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["test"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["test"]) -> typing.Union[Schema_.Properties.Test, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["test"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + test: typing.Union[Schema_.Properties.Test, str, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'ObjectWithOptionalTestProp': + return super().__new__( + cls, + *args_, + test=test, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_with_validations.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_with_validations.py new file mode 100644 index 00000000000..08119d42288 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_with_validations.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ObjectWithValidations( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {frozendict.frozendict} + min_properties = 2 + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'ObjectWithValidations': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/order.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/order.py new file mode 100644 index 00000000000..e5aeeeecbce --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/order.py @@ -0,0 +1,187 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Order( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {frozendict.frozendict} + + class Properties: + Id = schemas.Int64Schema + PetId = schemas.Int64Schema + Quantity = schemas.Int32Schema + ShipDate = schemas.DateTimeSchema + + + class Status( + schemas.StrSchema + ): + + + class Schema_: + types = { + str, + } + enum_value_to_name = { + "placed": "PLACED", + "approved": "APPROVED", + "delivered": "DELIVERED", + } + + @schemas.classproperty + def PLACED(cls): + return cls("placed") + + @schemas.classproperty + def APPROVED(cls): + return cls("approved") + + @schemas.classproperty + def DELIVERED(cls): + return cls("delivered") + + + class Complete( + schemas.BoolSchema + ): + + + class Schema_: + types = { + schemas.BoolClass, + } + default = schemas.BoolClass.FALSE + __annotations__ = { + "id": Id, + "petId": PetId, + "quantity": Quantity, + "shipDate": ShipDate, + "status": Status, + "complete": Complete, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["id"]) -> Schema_.Properties.Id: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["petId"]) -> Schema_.Properties.PetId: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["quantity"]) -> Schema_.Properties.Quantity: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["shipDate"]) -> Schema_.Properties.ShipDate: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["status"]) -> Schema_.Properties.Status: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["complete"]) -> Schema_.Properties.Complete: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["id"], + typing_extensions.Literal["petId"], + typing_extensions.Literal["quantity"], + typing_extensions.Literal["shipDate"], + typing_extensions.Literal["status"], + typing_extensions.Literal["complete"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["id"]) -> typing.Union[Schema_.Properties.Id, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["petId"]) -> typing.Union[Schema_.Properties.PetId, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["quantity"]) -> typing.Union[Schema_.Properties.Quantity, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["shipDate"]) -> typing.Union[Schema_.Properties.ShipDate, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["status"]) -> typing.Union[Schema_.Properties.Status, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["complete"]) -> typing.Union[Schema_.Properties.Complete, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["id"], + typing_extensions.Literal["petId"], + typing_extensions.Literal["quantity"], + typing_extensions.Literal["shipDate"], + typing_extensions.Literal["status"], + typing_extensions.Literal["complete"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + id: typing.Union[Schema_.Properties.Id, decimal.Decimal, int, schemas.Unset] = schemas.unset, + petId: typing.Union[Schema_.Properties.PetId, decimal.Decimal, int, schemas.Unset] = schemas.unset, + quantity: typing.Union[Schema_.Properties.Quantity, decimal.Decimal, int, schemas.Unset] = schemas.unset, + shipDate: typing.Union[Schema_.Properties.ShipDate, str, datetime.datetime, schemas.Unset] = schemas.unset, + status: typing.Union[Schema_.Properties.Status, str, schemas.Unset] = schemas.unset, + complete: typing.Union[Schema_.Properties.Complete, bool, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'Order': + return super().__new__( + cls, + *args_, + id=id, + petId=petId, + quantity=quantity, + shipDate=shipDate, + status=status, + complete=complete, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/parent_pet.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/parent_pet.py new file mode 100644 index 00000000000..8ddf68e8f2a --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/parent_pet.py @@ -0,0 +1,73 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ParentPet( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = { + frozendict.frozendict, + } + + @staticmethod + def discriminator(): + return { + 'pet_type': { + 'ChildCat': child_cat.ChildCat, + } + } + + class AllOf: + + @staticmethod + def _0() -> typing.Type['grandparent_animal.GrandparentAnimal']: + return grandparent_animal.GrandparentAnimal + classes = [ + _0, + ] + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'ParentPet': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + +from petstore_api.components.schema import child_cat +from petstore_api.components.schema import grandparent_animal diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/pet.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/pet.py new file mode 100644 index 00000000000..9e22892e1e5 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/pet.py @@ -0,0 +1,254 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Pet( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + + Pet object that needs to be added to the store + """ + + + class Schema_: + types = {frozendict.frozendict} + required = { + "name", + "photoUrls", + } + + class Properties: + Id = schemas.Int64Schema + + @staticmethod + def category() -> typing.Type['category.Category']: + return category.Category + Name = schemas.StrSchema + + + class PhotoUrls( + schemas.ListSchema + ): + + + class Schema_: + types = {tuple} + Items = schemas.StrSchema + + def __new__( + cls, + arg_: typing.Union[ + typing.Tuple[ + typing.Union[Schema_.Items, str], ... + ], + typing.List[ + typing.Union[Schema_.Items, str] + ], + ], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'Pet.Schema_.Properties.PhotoUrls': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) + + def __getitem__(self, i: int) -> Schema_.Items: + return super().__getitem__(i) + + + class Tags( + schemas.ListSchema + ): + + + class Schema_: + types = {tuple} + + @staticmethod + def items() -> typing.Type['tag.Tag']: + return tag.Tag + + def __new__( + cls, + arg_: typing.Union[ + typing.Tuple[ + typing.Union['tag.Tag', dict, frozendict.frozendict], ... + ], + typing.List[ + typing.Union['tag.Tag', dict, frozendict.frozendict] + ], + ], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'Pet.Schema_.Properties.Tags': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) + + def __getitem__(self, i: int) -> 'tag.Tag': + return super().__getitem__(i) + + + class Status( + schemas.StrSchema + ): + + + class Schema_: + types = { + str, + } + enum_value_to_name = { + "available": "AVAILABLE", + "pending": "PENDING", + "sold": "SOLD", + } + + @schemas.classproperty + def AVAILABLE(cls): + return cls("available") + + @schemas.classproperty + def PENDING(cls): + return cls("pending") + + @schemas.classproperty + def SOLD(cls): + return cls("sold") + __annotations__ = { + "id": Id, + "category": category, + "name": Name, + "photoUrls": PhotoUrls, + "tags": Tags, + "status": Status, + } + + name: Schema_.Properties.Name + photoUrls: Schema_.Properties.PhotoUrls + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["name"]) -> Schema_.Properties.Name: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["photoUrls"]) -> Schema_.Properties.PhotoUrls: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["id"]) -> Schema_.Properties.Id: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["category"]) -> 'category.Category': ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["tags"]) -> Schema_.Properties.Tags: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["status"]) -> Schema_.Properties.Status: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["name"], + typing_extensions.Literal["photoUrls"], + typing_extensions.Literal["id"], + typing_extensions.Literal["category"], + typing_extensions.Literal["tags"], + typing_extensions.Literal["status"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["name"]) -> Schema_.Properties.Name: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["photoUrls"]) -> Schema_.Properties.PhotoUrls: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["id"]) -> typing.Union[Schema_.Properties.Id, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["category"]) -> typing.Union['category.Category', schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["tags"]) -> typing.Union[Schema_.Properties.Tags, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["status"]) -> typing.Union[Schema_.Properties.Status, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["name"], + typing_extensions.Literal["photoUrls"], + typing_extensions.Literal["id"], + typing_extensions.Literal["category"], + typing_extensions.Literal["tags"], + typing_extensions.Literal["status"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + name: typing.Union[Schema_.Properties.Name, str], + photoUrls: typing.Union[Schema_.Properties.PhotoUrls, list, tuple], + id: typing.Union[Schema_.Properties.Id, decimal.Decimal, int, schemas.Unset] = schemas.unset, + category: typing.Union['category.Category', dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + tags: typing.Union[Schema_.Properties.Tags, list, tuple, schemas.Unset] = schemas.unset, + status: typing.Union[Schema_.Properties.Status, str, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'Pet': + return super().__new__( + cls, + *args_, + name=name, + photoUrls=photoUrls, + id=id, + category=category, + tags=tags, + status=status, + configuration_=configuration_, + **kwargs, + ) + +from petstore_api.components.schema import category +from petstore_api.components.schema import tag diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/pig.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/pig.py new file mode 100644 index 00000000000..9c364e80262 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/pig.py @@ -0,0 +1,77 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Pig( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + + @staticmethod + def discriminator(): + return { + 'className': { + 'BasquePig': basque_pig.BasquePig, + 'DanishPig': danish_pig.DanishPig, + } + } + + class OneOf: + + @staticmethod + def _0() -> typing.Type['basque_pig.BasquePig']: + return basque_pig.BasquePig + + @staticmethod + def _1() -> typing.Type['danish_pig.DanishPig']: + return danish_pig.DanishPig + classes = [ + _0, + _1, + ] + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'Pig': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + +from petstore_api.components.schema import basque_pig +from petstore_api.components.schema import danish_pig diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/player.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/player.py new file mode 100644 index 00000000000..4ce89eca23e --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/player.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Player( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + + a model that includes a self reference this forces properties and additionalProperties to be lazy loaded in python models because the Player class has not fully loaded when defining properties + """ + + + class Schema_: + types = {frozendict.frozendict} + + class Properties: + Name = schemas.StrSchema + + @staticmethod + def enemy_player() -> typing.Type['Player']: + return Player + __annotations__ = { + "name": Name, + "enemyPlayer": enemy_player, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["name"]) -> Schema_.Properties.Name: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["enemyPlayer"]) -> 'Player': ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["name"], + typing_extensions.Literal["enemyPlayer"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["name"]) -> typing.Union[Schema_.Properties.Name, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["enemyPlayer"]) -> typing.Union['Player', schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["name"], + typing_extensions.Literal["enemyPlayer"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + name: typing.Union[Schema_.Properties.Name, str, schemas.Unset] = schemas.unset, + enemyPlayer: typing.Union['Player', dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'Player': + return super().__new__( + cls, + *args_, + name=name, + enemyPlayer=enemyPlayer, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/quadrilateral.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/quadrilateral.py new file mode 100644 index 00000000000..5a9b2cf24c0 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/quadrilateral.py @@ -0,0 +1,77 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Quadrilateral( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + + @staticmethod + def discriminator(): + return { + 'quadrilateralType': { + 'ComplexQuadrilateral': complex_quadrilateral.ComplexQuadrilateral, + 'SimpleQuadrilateral': simple_quadrilateral.SimpleQuadrilateral, + } + } + + class OneOf: + + @staticmethod + def _0() -> typing.Type['simple_quadrilateral.SimpleQuadrilateral']: + return simple_quadrilateral.SimpleQuadrilateral + + @staticmethod + def _1() -> typing.Type['complex_quadrilateral.ComplexQuadrilateral']: + return complex_quadrilateral.ComplexQuadrilateral + classes = [ + _0, + _1, + ] + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'Quadrilateral': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + +from petstore_api.components.schema import complex_quadrilateral +from petstore_api.components.schema import simple_quadrilateral diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/quadrilateral_interface.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/quadrilateral_interface.py new file mode 100644 index 00000000000..a872eebb736 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/quadrilateral_interface.py @@ -0,0 +1,122 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class QuadrilateralInterface( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + required = { + "quadrilateralType", + "shapeType", + } + + class Properties: + + + class ShapeType( + schemas.StrSchema + ): + + + class Schema_: + types = { + str, + } + enum_value_to_name = { + "Quadrilateral": "QUADRILATERAL", + } + + @schemas.classproperty + def QUADRILATERAL(cls): + return cls("Quadrilateral") + QuadrilateralType = schemas.StrSchema + __annotations__ = { + "shapeType": ShapeType, + "quadrilateralType": QuadrilateralType, + } + + + quadrilateralType: Schema_.Properties.QuadrilateralType + shapeType: Schema_.Properties.ShapeType + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["quadrilateralType"]) -> Schema_.Properties.QuadrilateralType: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["shapeType"]) -> Schema_.Properties.ShapeType: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["quadrilateralType"], + typing_extensions.Literal["shapeType"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["quadrilateralType"]) -> Schema_.Properties.QuadrilateralType: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["shapeType"]) -> Schema_.Properties.ShapeType: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["quadrilateralType"], + typing_extensions.Literal["shapeType"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'QuadrilateralInterface': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/read_only_first.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/read_only_first.py new file mode 100644 index 00000000000..78285dffbb1 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/read_only_first.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ReadOnlyFirst( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {frozendict.frozendict} + + class Properties: + Bar = schemas.StrSchema + Baz = schemas.StrSchema + __annotations__ = { + "bar": Bar, + "baz": Baz, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["bar"]) -> Schema_.Properties.Bar: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["baz"]) -> Schema_.Properties.Baz: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["bar"], + typing_extensions.Literal["baz"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["bar"]) -> typing.Union[Schema_.Properties.Bar, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["baz"]) -> typing.Union[Schema_.Properties.Baz, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["bar"], + typing_extensions.Literal["baz"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + bar: typing.Union[Schema_.Properties.Bar, str, schemas.Unset] = schemas.unset, + baz: typing.Union[Schema_.Properties.Baz, str, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'ReadOnlyFirst': + return super().__new__( + cls, + *args_, + bar=bar, + baz=baz, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/ref_pet.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/ref_pet.py new file mode 100644 index 00000000000..66df4060457 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/ref_pet.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.schema import pet +RefPet = pet.Pet diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/req_props_from_explicit_add_props.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/req_props_from_explicit_add_props.py new file mode 100644 index 00000000000..9fd1260cfaf --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/req_props_from_explicit_add_props.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ReqPropsFromExplicitAddProps( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {frozendict.frozendict} + required = { + "invalid-name", + "validName", + } + AdditionalProperties = schemas.StrSchema + + validName: Schema_.AdditionalProperties + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["invalid-name"]) -> Schema_.AdditionalProperties: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["validName"]) -> Schema_.AdditionalProperties: ... + + @typing.overload + def __getitem__(self, name: str) -> Schema_.AdditionalProperties: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["invalid-name"], + typing_extensions.Literal["validName"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["invalid-name"]) -> Schema_.AdditionalProperties: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["validName"]) -> Schema_.AdditionalProperties: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[Schema_.AdditionalProperties, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["invalid-name"], + typing_extensions.Literal["validName"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + validName: typing.Union[Schema_.AdditionalProperties, str], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[Schema_.AdditionalProperties, str], + ) -> 'ReqPropsFromExplicitAddProps': + return super().__new__( + cls, + *args_, + validName=validName, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/req_props_from_true_add_props.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/req_props_from_true_add_props.py new file mode 100644 index 00000000000..d1ecdd111b7 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/req_props_from_true_add_props.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ReqPropsFromTrueAddProps( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {frozendict.frozendict} + required = { + "invalid-name", + "validName", + } + AdditionalProperties = schemas.AnyTypeSchema + + validName: Schema_.AdditionalProperties + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["invalid-name"]) -> Schema_.AdditionalProperties: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["validName"]) -> Schema_.AdditionalProperties: ... + + @typing.overload + def __getitem__(self, name: str) -> Schema_.AdditionalProperties: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["invalid-name"], + typing_extensions.Literal["validName"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["invalid-name"]) -> Schema_.AdditionalProperties: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["validName"]) -> Schema_.AdditionalProperties: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[Schema_.AdditionalProperties, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["invalid-name"], + typing_extensions.Literal["validName"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + validName: typing.Union[Schema_.AdditionalProperties, dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[Schema_.AdditionalProperties, dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + ) -> 'ReqPropsFromTrueAddProps': + return super().__new__( + cls, + *args_, + validName=validName, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/req_props_from_unset_add_props.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/req_props_from_unset_add_props.py new file mode 100644 index 00000000000..4276aa83954 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/req_props_from_unset_add_props.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ReqPropsFromUnsetAddProps( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {frozendict.frozendict} + required = { + "invalid-name", + "validName", + } + + validName: schemas.AnyTypeSchema + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["invalid-name"]) -> schemas.AnyTypeSchema: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["validName"]) -> schemas.AnyTypeSchema: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["invalid-name"], + typing_extensions.Literal["validName"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["invalid-name"]) -> schemas.AnyTypeSchema: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["validName"]) -> schemas.AnyTypeSchema: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["invalid-name"], + typing_extensions.Literal["validName"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + validName: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'ReqPropsFromUnsetAddProps': + return super().__new__( + cls, + *args_, + validName=validName, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/scalene_triangle.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/scalene_triangle.py new file mode 100644 index 00000000000..ce6f1d33a47 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/scalene_triangle.py @@ -0,0 +1,141 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ScaleneTriangle( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + + class AllOf: + + @staticmethod + def _0() -> typing.Type['triangle_interface.TriangleInterface']: + return triangle_interface.TriangleInterface + + + class _1( + schemas.DictSchema + ): + + + class Schema_: + types = {frozendict.frozendict} + + class Properties: + + + class TriangleType( + schemas.StrSchema + ): + + + class Schema_: + types = { + str, + } + enum_value_to_name = { + "ScaleneTriangle": "SCALENE_TRIANGLE", + } + + @schemas.classproperty + def SCALENE_TRIANGLE(cls): + return cls("ScaleneTriangle") + __annotations__ = { + "triangleType": TriangleType, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["triangleType"]) -> Schema_.Properties.TriangleType: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["triangleType"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["triangleType"]) -> typing.Union[Schema_.Properties.TriangleType, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["triangleType"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + triangleType: typing.Union[Schema_.Properties.TriangleType, str, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'ScaleneTriangle.Schema_.AllOf._1': + return super().__new__( + cls, + *args_, + triangleType=triangleType, + configuration_=configuration_, + **kwargs, + ) + classes = [ + _0, + _1, + ] + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'ScaleneTriangle': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + +from petstore_api.components.schema import triangle_interface diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/self_referencing_array_model.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/self_referencing_array_model.py new file mode 100644 index 00000000000..4abafae8312 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/self_referencing_array_model.py @@ -0,0 +1,62 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class SelfReferencingArrayModel( + schemas.ListSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {tuple} + + @staticmethod + def items() -> typing.Type['SelfReferencingArrayModel']: + return SelfReferencingArrayModel + + def __new__( + cls, + arg_: typing.Union[ + typing.Tuple[ + typing.Union['SelfReferencingArrayModel', list, tuple], ... + ], + typing.List[ + typing.Union['SelfReferencingArrayModel', list, tuple] + ], + ], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'SelfReferencingArrayModel': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) + + def __getitem__(self, i: int) -> 'SelfReferencingArrayModel': + return super().__getitem__(i) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/self_referencing_object_model.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/self_referencing_object_model.py new file mode 100644 index 00000000000..84e8c2a43a7 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/self_referencing_object_model.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class SelfReferencingObjectModel( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {frozendict.frozendict} + + class Properties: + + @staticmethod + def self_ref() -> typing.Type['SelfReferencingObjectModel']: + return SelfReferencingObjectModel + __annotations__ = { + "selfRef": self_ref, + } + + @staticmethod + def additional_properties() -> typing.Type['SelfReferencingObjectModel']: + return SelfReferencingObjectModel + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["selfRef"]) -> 'SelfReferencingObjectModel': ... + + @typing.overload + def __getitem__(self, name: str) -> 'SelfReferencingObjectModel': ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["selfRef"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["selfRef"]) -> typing.Union['SelfReferencingObjectModel', schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union['SelfReferencingObjectModel', schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["selfRef"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + selfRef: typing.Union['SelfReferencingObjectModel', dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union['SelfReferencingObjectModel', dict, frozendict.frozendict], + ) -> 'SelfReferencingObjectModel': + return super().__new__( + cls, + *args_, + selfRef=selfRef, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/shape.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/shape.py new file mode 100644 index 00000000000..bb588f9eda5 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/shape.py @@ -0,0 +1,77 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Shape( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + + @staticmethod + def discriminator(): + return { + 'shapeType': { + 'Quadrilateral': quadrilateral.Quadrilateral, + 'Triangle': triangle.Triangle, + } + } + + class OneOf: + + @staticmethod + def _0() -> typing.Type['triangle.Triangle']: + return triangle.Triangle + + @staticmethod + def _1() -> typing.Type['quadrilateral.Quadrilateral']: + return quadrilateral.Quadrilateral + classes = [ + _0, + _1, + ] + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'Shape': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + +from petstore_api.components.schema import quadrilateral +from petstore_api.components.schema import triangle diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/shape_or_null.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/shape_or_null.py new file mode 100644 index 00000000000..3e753ee0527 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/shape_or_null.py @@ -0,0 +1,81 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ShapeOrNull( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + + The value may be a shape or the 'null' value. This is introduced in OAS schema >= 3.1. + """ + + + class Schema_: + # any type + + @staticmethod + def discriminator(): + return { + 'shapeType': { + 'Quadrilateral': quadrilateral.Quadrilateral, + 'Triangle': triangle.Triangle, + } + } + + class OneOf: + _0 = schemas.NoneSchema + + @staticmethod + def _1() -> typing.Type['triangle.Triangle']: + return triangle.Triangle + + @staticmethod + def _2() -> typing.Type['quadrilateral.Quadrilateral']: + return quadrilateral.Quadrilateral + classes = [ + _0, + _1, + _2, + ] + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'ShapeOrNull': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + +from petstore_api.components.schema import quadrilateral +from petstore_api.components.schema import triangle diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/simple_quadrilateral.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/simple_quadrilateral.py new file mode 100644 index 00000000000..2e3758d199a --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/simple_quadrilateral.py @@ -0,0 +1,141 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class SimpleQuadrilateral( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + + class AllOf: + + @staticmethod + def _0() -> typing.Type['quadrilateral_interface.QuadrilateralInterface']: + return quadrilateral_interface.QuadrilateralInterface + + + class _1( + schemas.DictSchema + ): + + + class Schema_: + types = {frozendict.frozendict} + + class Properties: + + + class QuadrilateralType( + schemas.StrSchema + ): + + + class Schema_: + types = { + str, + } + enum_value_to_name = { + "SimpleQuadrilateral": "SIMPLE_QUADRILATERAL", + } + + @schemas.classproperty + def SIMPLE_QUADRILATERAL(cls): + return cls("SimpleQuadrilateral") + __annotations__ = { + "quadrilateralType": QuadrilateralType, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["quadrilateralType"]) -> Schema_.Properties.QuadrilateralType: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["quadrilateralType"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["quadrilateralType"]) -> typing.Union[Schema_.Properties.QuadrilateralType, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["quadrilateralType"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + quadrilateralType: typing.Union[Schema_.Properties.QuadrilateralType, str, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'SimpleQuadrilateral.Schema_.AllOf._1': + return super().__new__( + cls, + *args_, + quadrilateralType=quadrilateralType, + configuration_=configuration_, + **kwargs, + ) + classes = [ + _0, + _1, + ] + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'SimpleQuadrilateral': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + +from petstore_api.components.schema import quadrilateral_interface diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/some_object.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/some_object.py new file mode 100644 index 00000000000..6056559b955 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/some_object.py @@ -0,0 +1,62 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class SomeObject( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + + class AllOf: + + @staticmethod + def _0() -> typing.Type['object_interface.ObjectInterface']: + return object_interface.ObjectInterface + classes = [ + _0, + ] + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'SomeObject': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + +from petstore_api.components.schema import object_interface diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/special_model_name.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/special_model_name.py new file mode 100644 index 00000000000..c2b2bfb12c9 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/special_model_name.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class SpecialModelName( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + + model with an invalid class name for python + """ + + + class Schema_: + types = {frozendict.frozendict} + + class Properties: + A = schemas.StrSchema + __annotations__ = { + "a": A, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["a"]) -> Schema_.Properties.A: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["a"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["a"]) -> typing.Union[Schema_.Properties.A, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["a"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + a: typing.Union[Schema_.Properties.A, str, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'SpecialModelName': + return super().__new__( + cls, + *args_, + a=a, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/string.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/string.py similarity index 82% rename from samples/openapi3/client/petstore/python/petstore_api/model/string.py rename to samples/openapi3/client/petstore/python/src/petstore_api/components/schema/string.py index 9e0907b4269..8ed44279cb1 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/string.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/string.py @@ -6,10 +6,10 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ -from datetime import date, datetime # noqa: F401 +import datetime # noqa: F401 import decimal # noqa: F401 import functools # noqa: F401 import io # noqa: F401 diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/string_boolean_map.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/string_boolean_map.py new file mode 100644 index 00000000000..5789bc87210 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/string_boolean_map.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class StringBooleanMap( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {frozendict.frozendict} + AdditionalProperties = schemas.BoolSchema + + def __getitem__(self, name: str) -> Schema_.AdditionalProperties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def get_item_(self, name: str) -> Schema_.AdditionalProperties: + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[Schema_.AdditionalProperties, bool], + ) -> 'StringBooleanMap': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/string_enum.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/string_enum.py new file mode 100644 index 00000000000..d0f92a895b8 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/string_enum.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class StringEnum( + schemas.NoneBase, + schemas.StrBase, + schemas.Schema, + schemas.NoneStrMixin +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = { + schemas.NoneClass, + str, + } + enum_value_to_name = { + "placed": "PLACED", + "approved": "APPROVED", + "delivered": "DELIVERED", + "single quoted": "SINGLE_QUOTED", + "multiple\nlines": "MULTIPLE_LINE_FEED_LF_LINES", + "double quote \n with newline": "DOUBLE_QUOTE_LINE_FEED_LF_WITH_NEWLINE", + schemas.NoneClass.NONE: "NONE", + } + + @schemas.classproperty + def PLACED(cls): + return cls("placed") + + @schemas.classproperty + def APPROVED(cls): + return cls("approved") + + @schemas.classproperty + def DELIVERED(cls): + return cls("delivered") + + @schemas.classproperty + def SINGLE_QUOTED(cls): + return cls("single quoted") + + @schemas.classproperty + def MULTIPLE_LINE_FEED_LF_LINES(cls): + return cls("multiple\nlines") + + @schemas.classproperty + def DOUBLE_QUOTE_LINE_FEED_LF_WITH_NEWLINE(cls): + return cls("double quote \n with newline") + + @schemas.classproperty + def NONE(cls): + return cls(None) + + + def __new__( + cls, + arg_: typing.Union[None, str], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'StringEnum': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/string_enum_with_default_value.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/string_enum_with_default_value.py new file mode 100644 index 00000000000..cfd9e88ddcc --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/string_enum_with_default_value.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class StringEnumWithDefaultValue( + schemas.StrSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = { + str, + } + default = "placed" + enum_value_to_name = { + "placed": "PLACED", + "approved": "APPROVED", + "delivered": "DELIVERED", + } + + @schemas.classproperty + def PLACED(cls): + return cls("placed") + + @schemas.classproperty + def APPROVED(cls): + return cls("approved") + + @schemas.classproperty + def DELIVERED(cls): + return cls("delivered") diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/string_with_validation.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/string_with_validation.py new file mode 100644 index 00000000000..b12322974df --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/string_with_validation.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class StringWithValidation( + schemas.StrSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = { + str, + } + min_length = 7 diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/tag.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/tag.py new file mode 100644 index 00000000000..ee61b66214a --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/tag.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Tag( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {frozendict.frozendict} + + class Properties: + Id = schemas.Int64Schema + Name = schemas.StrSchema + __annotations__ = { + "id": Id, + "name": Name, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["id"]) -> Schema_.Properties.Id: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["name"]) -> Schema_.Properties.Name: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["id"], + typing_extensions.Literal["name"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["id"]) -> typing.Union[Schema_.Properties.Id, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["name"]) -> typing.Union[Schema_.Properties.Name, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["id"], + typing_extensions.Literal["name"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + id: typing.Union[Schema_.Properties.Id, decimal.Decimal, int, schemas.Unset] = schemas.unset, + name: typing.Union[Schema_.Properties.Name, str, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'Tag': + return super().__new__( + cls, + *args_, + id=id, + name=name, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/triangle.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/triangle.py new file mode 100644 index 00000000000..439d63d0a1d --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/triangle.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Triangle( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + + @staticmethod + def discriminator(): + return { + 'triangleType': { + 'EquilateralTriangle': equilateral_triangle.EquilateralTriangle, + 'IsoscelesTriangle': isosceles_triangle.IsoscelesTriangle, + 'ScaleneTriangle': scalene_triangle.ScaleneTriangle, + } + } + + class OneOf: + + @staticmethod + def _0() -> typing.Type['equilateral_triangle.EquilateralTriangle']: + return equilateral_triangle.EquilateralTriangle + + @staticmethod + def _1() -> typing.Type['isosceles_triangle.IsoscelesTriangle']: + return isosceles_triangle.IsoscelesTriangle + + @staticmethod + def _2() -> typing.Type['scalene_triangle.ScaleneTriangle']: + return scalene_triangle.ScaleneTriangle + classes = [ + _0, + _1, + _2, + ] + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'Triangle': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + +from petstore_api.components.schema import equilateral_triangle +from petstore_api.components.schema import isosceles_triangle +from petstore_api.components.schema import scalene_triangle diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/triangle_interface.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/triangle_interface.py new file mode 100644 index 00000000000..f929d952737 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/triangle_interface.py @@ -0,0 +1,122 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class TriangleInterface( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + # any type + required = { + "shapeType", + "triangleType", + } + + class Properties: + + + class ShapeType( + schemas.StrSchema + ): + + + class Schema_: + types = { + str, + } + enum_value_to_name = { + "Triangle": "TRIANGLE", + } + + @schemas.classproperty + def TRIANGLE(cls): + return cls("Triangle") + TriangleType = schemas.StrSchema + __annotations__ = { + "shapeType": ShapeType, + "triangleType": TriangleType, + } + + + shapeType: Schema_.Properties.ShapeType + triangleType: Schema_.Properties.TriangleType + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["shapeType"]) -> Schema_.Properties.ShapeType: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["triangleType"]) -> Schema_.Properties.TriangleType: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["shapeType"], + typing_extensions.Literal["triangleType"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["shapeType"]) -> Schema_.Properties.ShapeType: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["triangleType"]) -> Schema_.Properties.TriangleType: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["shapeType"], + typing_extensions.Literal["triangleType"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'TriangleInterface': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/user.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/user.py new file mode 100644 index 00000000000..d0028ed30ed --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/user.py @@ -0,0 +1,284 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class User( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {frozendict.frozendict} + + class Properties: + Id = schemas.Int64Schema + Username = schemas.StrSchema + FirstName = schemas.StrSchema + LastName = schemas.StrSchema + Email = schemas.StrSchema + Password = schemas.StrSchema + Phone = schemas.StrSchema + UserStatus = schemas.Int32Schema + ObjectWithNoDeclaredProps = schemas.DictSchema + + + class ObjectWithNoDeclaredPropsNullable( + schemas.NoneBase, + schemas.DictBase, + schemas.Schema, + schemas.NoneFrozenDictMixin + ): + + + class Schema_: + types = { + schemas.NoneClass, + frozendict.frozendict, + } + + + def __new__( + cls, + *args_: typing.Union[None, dict, frozendict.frozendict], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'User.Schema_.Properties.ObjectWithNoDeclaredPropsNullable': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + AnyTypeProp = schemas.AnyTypeSchema + + + class AnyTypeExceptNullProp( + schemas.AnyTypeSchema, + ): + + + class Schema_: + # any type + _Not = schemas.NoneSchema + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'User.Schema_.Properties.AnyTypeExceptNullProp': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + AnyTypePropNullable = schemas.AnyTypeSchema + __annotations__ = { + "id": Id, + "username": Username, + "firstName": FirstName, + "lastName": LastName, + "email": Email, + "password": Password, + "phone": Phone, + "userStatus": UserStatus, + "objectWithNoDeclaredProps": ObjectWithNoDeclaredProps, + "objectWithNoDeclaredPropsNullable": ObjectWithNoDeclaredPropsNullable, + "anyTypeProp": AnyTypeProp, + "anyTypeExceptNullProp": AnyTypeExceptNullProp, + "anyTypePropNullable": AnyTypePropNullable, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["id"]) -> Schema_.Properties.Id: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["username"]) -> Schema_.Properties.Username: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["firstName"]) -> Schema_.Properties.FirstName: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["lastName"]) -> Schema_.Properties.LastName: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["email"]) -> Schema_.Properties.Email: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["password"]) -> Schema_.Properties.Password: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["phone"]) -> Schema_.Properties.Phone: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["userStatus"]) -> Schema_.Properties.UserStatus: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["objectWithNoDeclaredProps"]) -> Schema_.Properties.ObjectWithNoDeclaredProps: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["objectWithNoDeclaredPropsNullable"]) -> Schema_.Properties.ObjectWithNoDeclaredPropsNullable: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["anyTypeProp"]) -> Schema_.Properties.AnyTypeProp: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["anyTypeExceptNullProp"]) -> Schema_.Properties.AnyTypeExceptNullProp: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["anyTypePropNullable"]) -> Schema_.Properties.AnyTypePropNullable: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["id"], + typing_extensions.Literal["username"], + typing_extensions.Literal["firstName"], + typing_extensions.Literal["lastName"], + typing_extensions.Literal["email"], + typing_extensions.Literal["password"], + typing_extensions.Literal["phone"], + typing_extensions.Literal["userStatus"], + typing_extensions.Literal["objectWithNoDeclaredProps"], + typing_extensions.Literal["objectWithNoDeclaredPropsNullable"], + typing_extensions.Literal["anyTypeProp"], + typing_extensions.Literal["anyTypeExceptNullProp"], + typing_extensions.Literal["anyTypePropNullable"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["id"]) -> typing.Union[Schema_.Properties.Id, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["username"]) -> typing.Union[Schema_.Properties.Username, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["firstName"]) -> typing.Union[Schema_.Properties.FirstName, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["lastName"]) -> typing.Union[Schema_.Properties.LastName, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["email"]) -> typing.Union[Schema_.Properties.Email, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["password"]) -> typing.Union[Schema_.Properties.Password, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["phone"]) -> typing.Union[Schema_.Properties.Phone, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["userStatus"]) -> typing.Union[Schema_.Properties.UserStatus, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["objectWithNoDeclaredProps"]) -> typing.Union[Schema_.Properties.ObjectWithNoDeclaredProps, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["objectWithNoDeclaredPropsNullable"]) -> typing.Union[Schema_.Properties.ObjectWithNoDeclaredPropsNullable, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["anyTypeProp"]) -> typing.Union[Schema_.Properties.AnyTypeProp, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["anyTypeExceptNullProp"]) -> typing.Union[Schema_.Properties.AnyTypeExceptNullProp, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["anyTypePropNullable"]) -> typing.Union[Schema_.Properties.AnyTypePropNullable, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["id"], + typing_extensions.Literal["username"], + typing_extensions.Literal["firstName"], + typing_extensions.Literal["lastName"], + typing_extensions.Literal["email"], + typing_extensions.Literal["password"], + typing_extensions.Literal["phone"], + typing_extensions.Literal["userStatus"], + typing_extensions.Literal["objectWithNoDeclaredProps"], + typing_extensions.Literal["objectWithNoDeclaredPropsNullable"], + typing_extensions.Literal["anyTypeProp"], + typing_extensions.Literal["anyTypeExceptNullProp"], + typing_extensions.Literal["anyTypePropNullable"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + id: typing.Union[Schema_.Properties.Id, decimal.Decimal, int, schemas.Unset] = schemas.unset, + username: typing.Union[Schema_.Properties.Username, str, schemas.Unset] = schemas.unset, + firstName: typing.Union[Schema_.Properties.FirstName, str, schemas.Unset] = schemas.unset, + lastName: typing.Union[Schema_.Properties.LastName, str, schemas.Unset] = schemas.unset, + email: typing.Union[Schema_.Properties.Email, str, schemas.Unset] = schemas.unset, + password: typing.Union[Schema_.Properties.Password, str, schemas.Unset] = schemas.unset, + phone: typing.Union[Schema_.Properties.Phone, str, schemas.Unset] = schemas.unset, + userStatus: typing.Union[Schema_.Properties.UserStatus, decimal.Decimal, int, schemas.Unset] = schemas.unset, + objectWithNoDeclaredProps: typing.Union[Schema_.Properties.ObjectWithNoDeclaredProps, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + objectWithNoDeclaredPropsNullable: typing.Union[Schema_.Properties.ObjectWithNoDeclaredPropsNullable, None, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + anyTypeProp: typing.Union[Schema_.Properties.AnyTypeProp, dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + anyTypeExceptNullProp: typing.Union[Schema_.Properties.AnyTypeExceptNullProp, dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + anyTypePropNullable: typing.Union[Schema_.Properties.AnyTypePropNullable, dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'User': + return super().__new__( + cls, + *args_, + id=id, + username=username, + firstName=firstName, + lastName=lastName, + email=email, + password=password, + phone=phone, + userStatus=userStatus, + objectWithNoDeclaredProps=objectWithNoDeclaredProps, + objectWithNoDeclaredPropsNullable=objectWithNoDeclaredPropsNullable, + anyTypeProp=anyTypeProp, + anyTypeExceptNullProp=anyTypeExceptNullProp, + anyTypePropNullable=anyTypePropNullable, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/uuid_string.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/uuid_string.py new file mode 100644 index 00000000000..595f244676d --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/uuid_string.py @@ -0,0 +1,41 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class UUIDString( + schemas.UUIDSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = { + str, + } + format = 'uuid' + min_length = 1 diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/whale.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/whale.py new file mode 100644 index 00000000000..0a6d0651875 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/whale.py @@ -0,0 +1,135 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Whale( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {frozendict.frozendict} + required = { + "className", + } + + class Properties: + HasBaleen = schemas.BoolSchema + HasTeeth = schemas.BoolSchema + + + class ClassName( + schemas.StrSchema + ): + + + class Schema_: + types = { + str, + } + enum_value_to_name = { + "whale": "WHALE", + } + + @schemas.classproperty + def WHALE(cls): + return cls("whale") + __annotations__ = { + "hasBaleen": HasBaleen, + "hasTeeth": HasTeeth, + "className": ClassName, + } + + className: Schema_.Properties.ClassName + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["className"]) -> Schema_.Properties.ClassName: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["hasBaleen"]) -> Schema_.Properties.HasBaleen: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["hasTeeth"]) -> Schema_.Properties.HasTeeth: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["className"], + typing_extensions.Literal["hasBaleen"], + typing_extensions.Literal["hasTeeth"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["className"]) -> Schema_.Properties.ClassName: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["hasBaleen"]) -> typing.Union[Schema_.Properties.HasBaleen, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["hasTeeth"]) -> typing.Union[Schema_.Properties.HasTeeth, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["className"], + typing_extensions.Literal["hasBaleen"], + typing_extensions.Literal["hasTeeth"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + className: typing.Union[Schema_.Properties.ClassName, str], + hasBaleen: typing.Union[Schema_.Properties.HasBaleen, bool, schemas.Unset] = schemas.unset, + hasTeeth: typing.Union[Schema_.Properties.HasTeeth, bool, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'Whale': + return super().__new__( + cls, + *args_, + className=className, + hasBaleen=hasBaleen, + hasTeeth=hasTeeth, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/zebra.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/zebra.py new file mode 100644 index 00000000000..5ac9070e0d7 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/zebra.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Zebra( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator. + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + + Do not edit the class manually. + """ + + + class Schema_: + types = {frozendict.frozendict} + required = { + "className", + } + + class Properties: + + + class Type( + schemas.StrSchema + ): + + + class Schema_: + types = { + str, + } + enum_value_to_name = { + "plains": "PLAINS", + "mountain": "MOUNTAIN", + "grevys": "GREVYS", + } + + @schemas.classproperty + def PLAINS(cls): + return cls("plains") + + @schemas.classproperty + def MOUNTAIN(cls): + return cls("mountain") + + @schemas.classproperty + def GREVYS(cls): + return cls("grevys") + + + class ClassName( + schemas.StrSchema + ): + + + class Schema_: + types = { + str, + } + enum_value_to_name = { + "zebra": "ZEBRA", + } + + @schemas.classproperty + def ZEBRA(cls): + return cls("zebra") + __annotations__ = { + "type": Type, + "className": ClassName, + } + AdditionalProperties = schemas.AnyTypeSchema + + className: Schema_.Properties.ClassName + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["className"]) -> Schema_.Properties.ClassName: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["type"]) -> Schema_.Properties.Type: ... + + @typing.overload + def __getitem__(self, name: str) -> Schema_.AdditionalProperties: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["className"], + typing_extensions.Literal["type"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["className"]) -> Schema_.Properties.ClassName: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["type"]) -> typing.Union[Schema_.Properties.Type, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[Schema_.AdditionalProperties, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["className"], + typing_extensions.Literal["type"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + className: typing.Union[Schema_.Properties.ClassName, str], + type: typing.Union[Schema_.Properties.Type, str, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[Schema_.AdditionalProperties, dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + ) -> 'Zebra': + return super().__new__( + cls, + *args_, + className=className, + type=type, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schemas/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schemas/__init__.py new file mode 100644 index 00000000000..b9d89f5d808 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schemas/__init__.py @@ -0,0 +1,144 @@ +# coding: utf-8 + +# flake8: noqa + +# import all models into this package +# if you have many models here with many references from one model to another this may +# raise a RecursionError +# to avoid this, import only the models that you directly need like: +# from from petstore_api.components.schema.pet import Pet +# or import this package, but before doing it, use: +# import sys +# sys.setrecursionlimit(n) + +from petstore_api.components.schema._200_response import _200Response +from petstore_api.components.schema.abstract_step_message import AbstractStepMessage +from petstore_api.components.schema.additional_properties_class import AdditionalPropertiesClass +from petstore_api.components.schema.additional_properties_validator import AdditionalPropertiesValidator +from petstore_api.components.schema.additional_properties_with_array_of_enums import AdditionalPropertiesWithArrayOfEnums +from petstore_api.components.schema.address import Address +from petstore_api.components.schema.animal import Animal +from petstore_api.components.schema.animal_farm import AnimalFarm +from petstore_api.components.schema.any_type_and_format import AnyTypeAndFormat +from petstore_api.components.schema.any_type_not_string import AnyTypeNotString +from petstore_api.components.schema.api_response import ApiResponse +from petstore_api.components.schema.array_holding_any_type import ArrayHoldingAnyType +from petstore_api.components.schema.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly +from petstore_api.components.schema.array_of_enums import ArrayOfEnums +from petstore_api.components.schema.array_of_number_only import ArrayOfNumberOnly +from petstore_api.components.schema.array_test import ArrayTest +from petstore_api.components.schema.array_with_validations_in_items import ArrayWithValidationsInItems +from petstore_api.components.schema.bar import Bar +from petstore_api.components.schema.basque_pig import BasquePig +from petstore_api.components.schema.boolean import Boolean +from petstore_api.components.schema.boolean_enum import BooleanEnum +from petstore_api.components.schema.capitalization import Capitalization +from petstore_api.components.schema.cat import Cat +from petstore_api.components.schema.category import Category +from petstore_api.components.schema.child_cat import ChildCat +from petstore_api.components.schema.class_model import ClassModel +from petstore_api.components.schema.client import Client +from petstore_api.components.schema.complex_quadrilateral import ComplexQuadrilateral +from petstore_api.components.schema.composed_any_of_different_types_no_validations import ComposedAnyOfDifferentTypesNoValidations +from petstore_api.components.schema.composed_array import ComposedArray +from petstore_api.components.schema.composed_bool import ComposedBool +from petstore_api.components.schema.composed_none import ComposedNone +from petstore_api.components.schema.composed_number import ComposedNumber +from petstore_api.components.schema.composed_object import ComposedObject +from petstore_api.components.schema.composed_one_of_different_types import ComposedOneOfDifferentTypes +from petstore_api.components.schema.composed_string import ComposedString +from petstore_api.components.schema.currency import Currency +from petstore_api.components.schema.danish_pig import DanishPig +from petstore_api.components.schema.date_time_test import DateTimeTest +from petstore_api.components.schema.date_time_with_validations import DateTimeWithValidations +from petstore_api.components.schema.date_with_validations import DateWithValidations +from petstore_api.components.schema.decimal_payload import DecimalPayload +from petstore_api.components.schema.dog import Dog +from petstore_api.components.schema.drawing import Drawing +from petstore_api.components.schema.enum_arrays import EnumArrays +from petstore_api.components.schema.enum_class import EnumClass +from petstore_api.components.schema.enum_test import EnumTest +from petstore_api.components.schema.equilateral_triangle import EquilateralTriangle +from petstore_api.components.schema.file import File +from petstore_api.components.schema.file_schema_test_class import FileSchemaTestClass +from petstore_api.components.schema.foo import Foo +from petstore_api.components.schema.format_test import FormatTest +from petstore_api.components.schema.from_schema import FromSchema +from petstore_api.components.schema.grandparent_animal import GrandparentAnimal +from petstore_api.components.schema.health_check_result import HealthCheckResult +from petstore_api.components.schema.integer_enum import IntegerEnum +from petstore_api.components.schema.integer_enum_big import IntegerEnumBig +from petstore_api.components.schema.integer_enum_one_value import IntegerEnumOneValue +from petstore_api.components.schema.integer_enum_with_default_value import IntegerEnumWithDefaultValue +from petstore_api.components.schema.integer_max10 import IntegerMax10 +from petstore_api.components.schema.integer_min15 import IntegerMin15 +from petstore_api.components.schema.isosceles_triangle import IsoscelesTriangle +from petstore_api.components.schema.items import Items +from petstore_api.components.schema.json_patch_request import JSONPatchRequest +from petstore_api.components.schema.json_patch_request_add_replace_test import JSONPatchRequestAddReplaceTest +from petstore_api.components.schema.json_patch_request_move_copy import JSONPatchRequestMoveCopy +from petstore_api.components.schema.json_patch_request_remove import JSONPatchRequestRemove +from petstore_api.components.schema.map_test import MapTest +from petstore_api.components.schema.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass +from petstore_api.components.schema.money import Money +from petstore_api.components.schema.name import Name +from petstore_api.components.schema.no_additional_properties import NoAdditionalProperties +from petstore_api.components.schema.nullable_class import NullableClass +from petstore_api.components.schema.nullable_shape import NullableShape +from petstore_api.components.schema.nullable_string import NullableString +from petstore_api.components.schema.number import Number +from petstore_api.components.schema.number_only import NumberOnly +from petstore_api.components.schema.number_with_validations import NumberWithValidations +from petstore_api.components.schema.object_interface import ObjectInterface +from petstore_api.components.schema.object_model_with_arg_and_args_properties import ObjectModelWithArgAndArgsProperties +from petstore_api.components.schema.object_model_with_ref_props import ObjectModelWithRefProps +from petstore_api.components.schema.object_with_all_of_with_req_test_prop_from_unset_add_prop import ObjectWithAllOfWithReqTestPropFromUnsetAddProp +from petstore_api.components.schema.object_with_colliding_properties import ObjectWithCollidingProperties +from petstore_api.components.schema.object_with_decimal_properties import ObjectWithDecimalProperties +from petstore_api.components.schema.object_with_difficultly_named_props import ObjectWithDifficultlyNamedProps +from petstore_api.components.schema.object_with_inline_composition_property import ObjectWithInlineCompositionProperty +from petstore_api.components.schema.object_with_invalid_named_refed_properties import ObjectWithInvalidNamedRefedProperties +from petstore_api.components.schema.object_with_optional_test_prop import ObjectWithOptionalTestProp +from petstore_api.components.schema.object_with_validations import ObjectWithValidations +from petstore_api.components.schema.order import Order +from petstore_api.components.schema.parent_pet import ParentPet +from petstore_api.components.schema.pet import Pet +from petstore_api.components.schema.pig import Pig +from petstore_api.components.schema.player import Player +from petstore_api.components.schema.quadrilateral import Quadrilateral +from petstore_api.components.schema.quadrilateral_interface import QuadrilateralInterface +from petstore_api.components.schema.read_only_first import ReadOnlyFirst +from petstore_api.components.schema.ref_pet import RefPet +from petstore_api.components.schema.req_props_from_explicit_add_props import ReqPropsFromExplicitAddProps +from petstore_api.components.schema.req_props_from_true_add_props import ReqPropsFromTrueAddProps +from petstore_api.components.schema.req_props_from_unset_add_props import ReqPropsFromUnsetAddProps +from petstore_api.components.schema._return import _Return +from petstore_api.components.schema.scalene_triangle import ScaleneTriangle +from petstore_api.components.schema.self_referencing_array_model import SelfReferencingArrayModel +from petstore_api.components.schema.self_referencing_object_model import SelfReferencingObjectModel +from petstore_api.components.schema.shape import Shape +from petstore_api.components.schema.shape_or_null import ShapeOrNull +from petstore_api.components.schema.simple_quadrilateral import SimpleQuadrilateral +from petstore_api.components.schema.some_object import SomeObject +from petstore_api.components.schema.string import String +from petstore_api.components.schema.string_boolean_map import StringBooleanMap +from petstore_api.components.schema.string_enum import StringEnum +from petstore_api.components.schema.string_enum_with_default_value import StringEnumWithDefaultValue +from petstore_api.components.schema.string_with_validation import StringWithValidation +from petstore_api.components.schema.tag import Tag +from petstore_api.components.schema.triangle import Triangle +from petstore_api.components.schema.triangle_interface import TriangleInterface +from petstore_api.components.schema.uuid_string import UUIDString +from petstore_api.components.schema.user import User +from petstore_api.components.schema.special_model_name import SpecialModelName +from petstore_api.components.schema.apple import Apple +from petstore_api.components.schema.apple_req import AppleReq +from petstore_api.components.schema.banana import Banana +from petstore_api.components.schema.banana_req import BananaReq +from petstore_api.components.schema.fruit import Fruit +from petstore_api.components.schema.fruit_req import FruitReq +from petstore_api.components.schema.gm_fruit import GmFruit +from petstore_api.components.schema.has_only_read_only import HasOnlyReadOnly +from petstore_api.components.schema.mammal import Mammal +from petstore_api.components.schema.whale import Whale +from petstore_api.components.schema.zebra import Zebra diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/security_schemes/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/security_schemes/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/security_schemes/security_scheme_api_key.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/security_schemes/security_scheme_api_key.py new file mode 100644 index 00000000000..9d721306d75 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/security_schemes/security_scheme_api_key.py @@ -0,0 +1,21 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import typing +import typing_extensions + +from petstore_api import security_schemes + +@dataclasses.dataclass +class ApiKey(security_schemes.ApiKeySecurityScheme): + ''' + apiKey in header + ''' + name: str = "api_key" + in_location: security_schemes.ApiKeyInLocation = security_schemes.ApiKeyInLocation.HEADER diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/security_schemes/security_scheme_api_key_query.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/security_schemes/security_scheme_api_key_query.py new file mode 100644 index 00000000000..cc3a7e4d631 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/security_schemes/security_scheme_api_key_query.py @@ -0,0 +1,21 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import typing +import typing_extensions + +from petstore_api import security_schemes + +@dataclasses.dataclass +class ApiKeyQuery(security_schemes.ApiKeySecurityScheme): + ''' + apiKey in query + ''' + name: str = "api_key_query" + in_location: security_schemes.ApiKeyInLocation = security_schemes.ApiKeyInLocation.QUERY diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/security_schemes/security_scheme_bearer_test.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/security_schemes/security_scheme_bearer_test.py new file mode 100644 index 00000000000..f1bf44f840f --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/security_schemes/security_scheme_bearer_test.py @@ -0,0 +1,20 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import typing +import typing_extensions + +from petstore_api import security_schemes + +@dataclasses.dataclass +class BearerTest(security_schemes.HTTPBearerSecurityScheme): + ''' + http bearer with JWT bearer format + ''' + bearer_format = "JWT" diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/security_schemes/security_scheme_http_basic_test.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/security_schemes/security_scheme_http_basic_test.py new file mode 100644 index 00000000000..1f5aac6e8d0 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/security_schemes/security_scheme_http_basic_test.py @@ -0,0 +1,19 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import typing +import typing_extensions + +from petstore_api import security_schemes + +@dataclasses.dataclass +class HttpBasicTest(security_schemes.HTTPBasicSecurityScheme): + ''' + http basic + ''' diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/security_schemes/security_scheme_http_signature_test.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/security_schemes/security_scheme_http_signature_test.py new file mode 100644 index 00000000000..47fadd81839 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/security_schemes/security_scheme_http_signature_test.py @@ -0,0 +1,19 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import typing +import typing_extensions + +from petstore_api import security_schemes + +@dataclasses.dataclass +class HttpSignatureTest(security_schemes.HTTPSignatureSecurityScheme): + ''' + http + signature + ''' diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/security_schemes/security_scheme_open_id_connect_test.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/security_schemes/security_scheme_open_id_connect_test.py new file mode 100644 index 00000000000..0a63c30ff6a --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/security_schemes/security_scheme_open_id_connect_test.py @@ -0,0 +1,20 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import typing +import typing_extensions + +from petstore_api import security_schemes + +@dataclasses.dataclass +class OpenIdConnectTest(security_schemes.OpenIdConnectSecurityScheme): + ''' + openIdConnect + ''' + openid_connect_url = "https://somesite.com/.well-known/openid-configuration" diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/security_schemes/security_scheme_petstore_auth.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/security_schemes/security_scheme_petstore_auth.py new file mode 100644 index 00000000000..1167ed5dbf5 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/security_schemes/security_scheme_petstore_auth.py @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import typing +import typing_extensions + +from petstore_api import security_schemes + +@dataclasses.dataclass +class PetstoreAuth(security_schemes.OAuth2SecurityScheme): + ''' + oauth2 implicit flow with two scopes + ''' + flows = security_schemes.OAuthFlows( + implicit=security_schemes.ImplicitOAuthFlow( + authorization_url="http://petstore.swagger.io/api/oauth/dialog", + scopes={ + "write:pets": "modify pets in your account", + "read:pets": "read your pets", + }, + ) + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/configurations/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/configurations/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/configurations/api_configuration.py b/samples/openapi3/client/petstore/python/src/petstore_api/configurations/api_configuration.py new file mode 100644 index 00000000000..a22b2474039 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/configurations/api_configuration.py @@ -0,0 +1,362 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import copy +from http import client as http_client +import logging +import multiprocessing +import sys +import typing +import typing_extensions + +import urllib3 + +from petstore_api import exceptions +from petstore_api import security_schemes +from petstore_api.components.security_schemes import security_scheme_api_key +from petstore_api.components.security_schemes import security_scheme_api_key_query +from petstore_api.components.security_schemes import security_scheme_bearer_test +from petstore_api.components.security_schemes import security_scheme_http_basic_test +from petstore_api.components.security_schemes import security_scheme_http_signature_test +from petstore_api.components.security_schemes import security_scheme_open_id_connect_test +from petstore_api.components.security_schemes import security_scheme_petstore_auth +from petstore_api.servers import server_0 +from petstore_api.servers import server_1 +from petstore_api.servers import server_2 +from petstore_api.paths.foo.get.servers import server_0 as foo_get_server_0 +from petstore_api.paths.foo.get.servers import server_1 as foo_get_server_1 +from petstore_api.paths.pet_find_by_status.servers import server_0 as pet_find_by_status_server_0 +from petstore_api.paths.pet_find_by_status.servers import server_1 as pet_find_by_status_server_1 + +# security scheme key identifier to security scheme instance +SecuritySchemeInfo = typing_extensions.TypedDict( + 'SecuritySchemeInfo', + { + "api_key": security_scheme_api_key.ApiKey, + "api_key_query": security_scheme_api_key_query.ApiKeyQuery, + "bearer_test": security_scheme_bearer_test.BearerTest, + "http_basic_test": security_scheme_http_basic_test.HttpBasicTest, + "http_signature_test": security_scheme_http_signature_test.HttpSignatureTest, + "openIdConnect_test": security_scheme_open_id_connect_test.OpenIdConnectTest, + "petstore_auth": security_scheme_petstore_auth.PetstoreAuth, + }, + total=False +) + +""" +the default security_index to use at each openapi document json path +the fallback value is stored in the 'security' key +""" +SecurityIndexInfo = typing_extensions.TypedDict( + 'SecurityIndexInfo', + { + 'security': int, + "paths//fake/delete/security": typing_extensions.Literal[0], + "paths//fake/post/security": typing_extensions.Literal[0], + "paths//fake/multipleSecurities/get/security": typing_extensions.Literal[0, 1, 2], + "paths//fake/{petId}/uploadImageWithRequiredFile/post/security": typing_extensions.Literal[0], + "paths//fake_classname_test/patch/security": typing_extensions.Literal[0], + "paths//pet/post/security": typing_extensions.Literal[0, 1, 2], + "paths//pet/put/security": typing_extensions.Literal[0, 1], + "paths//pet/findByStatus/get/security": typing_extensions.Literal[0, 1, 2], + "paths//pet/findByTags/get/security": typing_extensions.Literal[0, 1], + "paths//pet/{petId}/delete/security": typing_extensions.Literal[0, 1], + "paths//pet/{petId}/get/security": typing_extensions.Literal[0], + "paths//pet/{petId}/post/security": typing_extensions.Literal[0, 1], + "paths//pet/{petId}/uploadImage/post/security": typing_extensions.Literal[0], + "paths//store/inventory/get/security": typing_extensions.Literal[0], + }, + total=False +) + +# the server to use at each openapi document json path +ServerInfo = typing_extensions.TypedDict( + 'ServerInfo', + { + 'servers/0': server_0.Server0, + 'servers/1': server_1.Server1, + 'servers/2': server_2.Server2, + "paths//foo/get/servers/0": foo_get_server_0.Server0, + "paths//foo/get/servers/1": foo_get_server_1.Server1, + "paths//pet/findByStatus/servers/0": pet_find_by_status_server_0.Server0, + "paths//pet/findByStatus/servers/1": pet_find_by_status_server_1.Server1, + }, + total=False +) + +""" +the default server_index to use at each openapi document json path +the fallback value is stored in the 'servers' key +""" +ServerIndexInfo = typing_extensions.TypedDict( + 'ServerIndexInfo', + { + 'servers': typing_extensions.Literal[0, 1, 2], + "paths//foo/get/servers": typing_extensions.Literal[0, 1], + "paths//pet/findByStatus/servers": typing_extensions.Literal[0, 1], + }, + total=False +) + + +class ApiConfiguration(object): + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator + + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + Do not edit the class manually. + + :param security_scheme_info: the security scheme auth info that can be used when calling endpoints + The key is a string that identifies the component security scheme that one is adding auth info for + The value is an instance of the component security scheme class for that security scheme + See the SecuritySchemeInfo TypedDict definition + :param security_index_info: path to security_index information + :param server_info: the servers that can be used to make endpoint calls + :param server_index_info: index to servers configuration + """ + + def __init__( + self, + security_scheme_info: typing.Optional[SecuritySchemeInfo] = None, + security_index_info: typing.Optional[SecurityIndexInfo] = None, + server_info: typing.Optional[ServerInfo] = None, + server_index_info: typing.Optional[ServerIndexInfo] = None, + ): + """Constructor + """ + # Authentication Settings + self.security_scheme_info: SecuritySchemeInfo = security_scheme_info or SecuritySchemeInfo() + self.security_index_info: SecurityIndexInfo = security_index_info or {'security': 0} + # Server Info + self.server_info: ServerInfo = server_info or { + 'servers/0': server_0.Server0(), + 'servers/1': server_1.Server1(), + 'servers/2': server_2.Server2(), + "paths//foo/get/servers/0": foo_get_server_0.Server0(), + "paths//foo/get/servers/1": foo_get_server_1.Server1(), + "paths//pet/findByStatus/servers/0": pet_find_by_status_server_0.Server0(), + "paths//pet/findByStatus/servers/1": pet_find_by_status_server_1.Server1(), + } + self.server_index_info: ServerIndexInfo = server_index_info or {'servers': 0} + self.logger = {} + """Logging Settings + """ + self.logger["package_logger"] = logging.getLogger("petstore_api") + self.logger["urllib3_logger"] = logging.getLogger("urllib3") + self.logger_format = '%(asctime)s %(levelname)s %(message)s' + """Log format + """ + self.logger_stream_handler = None + """Log stream handler + """ + self.logger_file_handler = None + """Log file handler + """ + self.logger_file = None + """Debug file location + """ + self.debug = False + """Debug switch + """ + + self.verify_ssl = True + """SSL/TLS verification + Set this to false to skip verifying SSL certificate when calling API + from https server. + """ + self.ssl_ca_cert = None + """Set this to customize the certificate file to verify the peer. + """ + self.cert_file = None + """client certificate file + """ + self.key_file = None + """client key file + """ + self.assert_hostname = None + """Set this to True/False to enable/disable SSL hostname verification. + """ + + self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 + """urllib3 connection pool's maximum number of connections saved + per pool. urllib3 uses 1 connection as default value, but this is + not the best value when you are making a lot of possibly parallel + requests to the same host, which is often the case here. + cpu_count * 5 is used as default value to increase performance. + """ + + self.proxy = None + """Proxy URL + """ + self.proxy_headers = None + """Proxy headers + """ + self.safe_chars_for_path_param = '' + """Safe chars for path_param + """ + self.retries = None + """Adding retries to override urllib3 default value 3 + """ + # Enable client side validation + self.client_side_validation = True + + # Options to pass down to the underlying urllib3 socket + self.socket_options = None + + def __deepcopy__(self, memo): + cls = self.__class__ + result = cls.__new__(cls) + memo[id(self)] = result + for k, v in self.__dict__.items(): + if k not in ('logger', 'logger_file_handler'): + setattr(result, k, copy.deepcopy(v, memo)) + # shallow copy of loggers + result.logger = copy.copy(self.logger) + # use setters to configure loggers + result.logger_file = self.logger_file + result.debug = self.debug + return result + + @property + def logger_file(self): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + return self.__logger_file + + @logger_file.setter + def logger_file(self, value): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + self.__logger_file = value + if self.__logger_file: + # If set logging file, + # then add file handler and remove stream handler. + self.logger_file_handler = logging.FileHandler(self.__logger_file) + self.logger_file_handler.setFormatter(self.logger_formatter) + for _, logger in self.logger.items(): + logger.addHandler(self.logger_file_handler) + + @property + def debug(self): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + return self.__debug + + @debug.setter + def debug(self, value): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + self.__debug = value + if self.__debug: + # if debug status is True, turn on debug logging + for _, logger in self.logger.items(): + logger.setLevel(logging.DEBUG) + # turn on http_client debug + http_client.HTTPConnection.debuglevel = 1 + else: + # if debug status is False, turn off debug logging, + # setting log level to default `logging.WARNING` + for _, logger in self.logger.items(): + logger.setLevel(logging.WARNING) + # turn off http_client debug + http_client.HTTPConnection.debuglevel = 0 + + @property + def logger_format(self): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + return self.__logger_format + + @logger_format.setter + def logger_format(self, value): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + self.__logger_format = value + self.logger_formatter = logging.Formatter(self.__logger_format) + + def to_debug_report(self): + """Gets the essential information for debugging. + + :return: The report for debugging. + """ + return "Python SDK Debug Report:\n"\ + "OS: {env}\n"\ + "Python Version: {pyversion}\n"\ + "Version of the API: 1.0.0\n"\ + "SDK Package Version: 1.0.0".\ + format(env=sys.platform, pyversion=sys.version) + + def get_server_url( + self, + key_prefix: str, + index: typing.Optional[int], + ) -> str: + """Gets host URL based on the index + :param index: array index of the host settings + :return: URL based on host settings + """ + if index: + used_index = index + else: + try: + used_index = self.server_index_info[key_prefix] + except KeyError: + # fallback and use the default index + used_index = self.server_index_info["servers"] + server = self.server_info[f"{key_prefix}/{used_index}"] + return server.url + + def get_security_requirement_object( + self, + key_prefix: str, + security_requirement_objects: typing.List[security_schemes.SecurityRequirementObject], + index: typing.Optional[int], + ) -> security_schemes.SecurityRequirementObject: + """Gets security_schemes.SecurityRequirementObject based on the index + :param index: array index of the SecurityRequirementObject + :return: the selected security_schemes.SecurityRequirementObject + """ + if index: + used_index = index + else: + try: + used_index = self.security_index_info[key_prefix] + except KeyError: + # fallback and use the default index + used_index = self.security_index_info["security"] + return security_requirement_objects[used_index] diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/configurations/schema_configuration.py b/samples/openapi3/client/petstore/python/src/petstore_api/configurations/schema_configuration.py new file mode 100644 index 00000000000..17b795bf53a --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/configurations/schema_configuration.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing + +from petstore_api import exceptions + + +PYTHON_KEYWORD_TO_JSON_SCHEMA_KEYWORD = { + 'types': 'type', + 'enum_value_to_name': 'enum', + 'unique_items': 'uniqueItems', + 'min_items': 'minItems', + 'max_items': 'maxItems', + 'min_properties': 'minProperties', + 'max_properties': 'maxProperties', + 'min_length': 'minLength', + 'max_length': 'maxLength', + 'inclusive_minimum': 'minimum', + 'exclusive_minimum': 'exclusiveMinimum', + 'inclusive_maximum': 'maximum', + 'exclusive_maximum': 'exclusiveMaximum', + 'multiple_of': 'multipleOf', + 'regex': 'pattern', + 'format': 'format', + 'required': 'required', + 'items': 'items', + 'Items': 'items', + 'Properties': 'properties', + 'additional_properties': 'additionalProperties', + 'additionalProperties': 'additionalProperties', + 'OneOf': 'oneOf', + 'AnyOf': 'anyOf', + 'AllOf': 'allOf', + '_not': 'not', + '_Not': 'not', + 'discriminator': 'discriminator' +} + +class SchemaConfiguration: + """NOTE: This class is auto generated by OpenAPI JSON Schema Generator + + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator + Do not edit the class manually. + + :param disabled_json_schema_keywords (set): Set of + JSON schema validation keywords to disable JSON schema structural validation + rules. The following keywords may be specified: multipleOf, maximum, + exclusiveMaximum, minimum, exclusiveMinimum, maxLength, minLength, pattern, + maxItems, minItems. + By default, the validation is performed for data generated locally by the client + and data received from the server, independent of any validation performed by + the server side. If the input data does not satisfy the JSON schema validation + rules specified in the OpenAPI document, an exception is raised. + If disabled_json_schema_keywords is set, structural validation is + disabled. This can be useful to troubleshoot data validation problem, such as + when the OpenAPI document validation rules do not match the actual API data + received by the server. + :param server_index: Index to servers configuration. + """ + + def __init__( + self, + disabled_json_schema_keywords = frozenset(), + ): + """Constructor + """ + self.disabled_json_schema_keywords = disabled_json_schema_keywords + + @property + def disabled_json_schema_keywords(self) -> typing.Set[str]: + return self.__disabled_json_schema_keywords + + @property + def disabled_json_schema_python_keywords(self) -> typing.Set[str]: + return self.__disabled_json_schema_python_keywords + + @disabled_json_schema_keywords.setter + def disabled_json_schema_keywords(self, json_keywords: typing.Set[str]): + disabled_json_schema_keywords = set() + disabled_json_schema_python_keywords = set() + for k in json_keywords: + python_keywords = {key for key, val in PYTHON_KEYWORD_TO_JSON_SCHEMA_KEYWORD.items() if val == k} + if not python_keywords: + raise exceptions.ApiValueError( + "Invalid keyword: '{0}''".format(k)) + disabled_json_schema_keywords.add(k) + disabled_json_schema_python_keywords.update(python_keywords) + self.__disabled_json_schema_keywords = disabled_json_schema_keywords + self.__disabled_json_schema_python_keywords = disabled_json_schema_python_keywords \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/exceptions.py b/samples/openapi3/client/petstore/python/src/petstore_api/exceptions.py new file mode 100644 index 00000000000..1997da9a05f --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/exceptions.py @@ -0,0 +1,135 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" +import dataclasses +import typing + +from urllib3._collections import HTTPHeaderDict + + +class OpenApiException(Exception): + """The base exception class for all OpenAPIExceptions""" + + +class ApiTypeError(OpenApiException, TypeError): + def __init__(self, msg, path_to_item=None, valid_classes=None, + key_type=None): + """ Raises an exception for TypeErrors + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list): a list of keys an indices to get to the + current_item + None if unset + valid_classes (tuple): the primitive classes that current item + should be an instance of + None if unset + key_type (bool): False if our value is a value in a dict + True if it is a key in a dict + False if our item is an item in a list + None if unset + """ + self.path_to_item = path_to_item + self.valid_classes = valid_classes + self.key_type = key_type + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiTypeError, self).__init__(full_msg) + + +class ApiValueError(OpenApiException, ValueError): + def __init__(self, msg, path_to_item=None): + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list) the path to the exception in the + received_data dict. None if unset + """ + + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiValueError, self).__init__(full_msg) + + +class ApiAttributeError(OpenApiException, AttributeError): + def __init__(self, msg, path_to_item=None): + """ + Raised when an attribute reference or assignment fails. + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiAttributeError, self).__init__(full_msg) + + +class ApiKeyError(OpenApiException, KeyError): + def __init__(self, msg, path_to_item=None): + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiKeyError, self).__init__(full_msg) + + +T = typing.TypeVar("T") + + +@dataclasses.dataclass +class ApiException(OpenApiException, typing.Generic[T]): + status: int + reason: str + api_response: typing.Optional[T] = None + + def __str__(self): + """Custom error messages for exception""" + error_message = "({0})\n"\ + "Reason: {1}\n".format(self.status, self.reason) + if self.api_response: + if self.api_response.response.headers: + error_message += "HTTP response headers: {0}\n".format( + self.api_response.response.headers) + if self.api_response.response.data: + error_message += "HTTP response body: {0}\n".format(self.api_response.response.data) + + return error_message + + +def render_path(path_to_item): + """Returns a string representation of a path""" + result = "" + for pth in path_to_item: + if isinstance(pth, int): + result += "[{0}]".format(pth) + else: + result += "['{0}']".format(pth) + return result diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/__init__.py new file mode 100644 index 00000000000..27d5c9ead13 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/__init__.py @@ -0,0 +1,3 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from petstore_api.apis import path_to_api diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/another_fake_dummy/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/another_fake_dummy/__init__.py new file mode 100644 index 00000000000..63cc6f7cb82 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/another_fake_dummy/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from petstore_api.apis.paths.another_fake_dummy import AnotherFakeDummy + +path = "/another-fake/dummy" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/another_fake_dummy/patch/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/another_fake_dummy/patch/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/another_fake_dummy/patch/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/another_fake_dummy/patch/operation.py new file mode 100644 index 00000000000..e0517a5ce57 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/another_fake_dummy/patch/operation.py @@ -0,0 +1,386 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _call_123_test__special_tags( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: typing_extensions.Literal["application/json"] = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _call_123_test__special_tags( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _call_123_test__special_tags( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _call_123_test__special_tags( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _call_123_test__special_tags( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = 'application/json', + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + To test special tags + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='patch', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class _123TestSpecialTags(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def call_123_test__special_tags( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: typing_extensions.Literal["application/json"] = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def call_123_test__special_tags( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def call_123_test__special_tags( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def call_123_test__special_tags( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def call_123_test__special_tags( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = 'application/json', + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._call_123_test__special_tags( + body=body, + content_type=content_type, + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPatch(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def patch( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: typing_extensions.Literal["application/json"] = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def patch( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def patch( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def patch( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def patch( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = 'application/json', + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._call_123_test__special_tags( + body=body, + content_type=content_type, + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/another_fake_dummy/patch/request_body/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/another_fake_dummy/patch/request_body/__init__.py new file mode 100644 index 00000000000..302c945db27 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/another_fake_dummy/patch/request_body/__init__.py @@ -0,0 +1,11 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.request_bodies import request_body_client +RequestBody = request_body_client.Client diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/another_fake_dummy/patch/responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/another_fake_dummy/patch/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/another_fake_dummy/patch/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/another_fake_dummy/patch/responses/response_200/__init__.py new file mode 100644 index 00000000000..60c9bf3cf80 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/another_fake_dummy/patch/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/another_fake_dummy/patch/responses/response_200/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/another_fake_dummy/patch/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/another_fake_dummy/patch/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/another_fake_dummy/patch/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/another_fake_dummy/patch/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/another_fake_dummy/patch/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..b5013031afd --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/another_fake_dummy/patch/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.schema import client +Schema = client.Client diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/__init__.py new file mode 100644 index 00000000000..6db1bcb9c9c --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from petstore_api.apis.paths.fake import Fake + +path = "/fake" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/delete/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/delete/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/delete/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/delete/operation.py new file mode 100644 index 00000000000..2905c2df97a --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/delete/operation.py @@ -0,0 +1,357 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions, security_schemes +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from .parameters import ( + parameter_0, + parameter_1, + parameter_2, + parameter_3, + parameter_4, + parameter_5, +) +from .security import security_requirement_object_0 + + + +class RequestQueryParameters: + RequiredParams = typing_extensions.TypedDict( + 'RequiredParams', + { + 'required_string_group': typing.Union[parameter_0.Parameter0.schema, str], + 'required_int64_group': typing.Union[parameter_2.Parameter2.schema, decimal.Decimal, int], + } + ) + OptionalParams = typing_extensions.TypedDict( + 'OptionalParams', + { + 'string_group': typing.Union[parameter_3.Parameter3.schema, str], + 'int64_group': typing.Union[parameter_5.Parameter5.schema, decimal.Decimal, int], + }, + total=False + ) + + + class Params(RequiredParams, OptionalParams): + pass + + + parameters = [ + parameter_0.Parameter0, + parameter_2.Parameter2, + parameter_3.Parameter3, + parameter_5.Parameter5, + ] + +class RequestHeaderParameters: + RequiredParams = typing_extensions.TypedDict( + 'RequiredParams', + { + 'required_boolean_group': typing.Union[parameter_1.Parameter1.schema, str], + } + ) + OptionalParams = typing_extensions.TypedDict( + 'OptionalParams', + { + 'boolean_group': typing.Union[parameter_4.Parameter4.schema, str], + }, + total=False + ) + + + class Params(RequiredParams, OptionalParams): + pass + + + parameters = [ + parameter_1.Parameter1, + parameter_4.Parameter4, + ] +_security: typing.List[security_schemes.SecurityRequirementObject] = [ + security_requirement_object_0.security_requirement_object, +] + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _group_parameters( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + header_params: RequestHeaderParameters.Params = frozendict.frozendict(), + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _group_parameters( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + header_params: RequestHeaderParameters.Params = frozendict.frozendict(), + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _group_parameters( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + header_params: RequestHeaderParameters.Params = frozendict.frozendict(), + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _group_parameters( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + header_params: RequestHeaderParameters.Params = frozendict.frozendict(), + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + Fake endpoint to test group parameters (optional) + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs(RequestQueryParameters.Params, query_params) + self._verify_typed_dict_inputs(RequestHeaderParameters.Params, header_params) + used_path = path + + prefix_separator_iterator = None + for parameter in RequestQueryParameters.parameters: + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + + _headers = HTTPHeaderDict() + for parameter in RequestHeaderParameters.parameters: + parameter_data = header_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _headers.extend(serialized_data) + # TODO add cookie handling + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + security_requirement_object = self.api_client.configuration.get_security_requirement_object( + 'paths/' + path + '/delete/security', + _security, + security_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='delete', + host=host, + headers=_headers, + security_requirement_object=security_requirement_object, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class GroupParameters(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def group_parameters( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + header_params: RequestHeaderParameters.Params = frozendict.frozendict(), + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def group_parameters( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + header_params: RequestHeaderParameters.Params = frozendict.frozendict(), + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def group_parameters( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + header_params: RequestHeaderParameters.Params = frozendict.frozendict(), + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def group_parameters( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + header_params: RequestHeaderParameters.Params = frozendict.frozendict(), + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._group_parameters( + query_params=query_params, + header_params=header_params, + security_index=security_index, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForDelete(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def delete( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + header_params: RequestHeaderParameters.Params = frozendict.frozendict(), + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def delete( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + header_params: RequestHeaderParameters.Params = frozendict.frozendict(), + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def delete( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + header_params: RequestHeaderParameters.Params = frozendict.frozendict(), + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def delete( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + header_params: RequestHeaderParameters.Params = frozendict.frozendict(), + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._group_parameters( + query_params=query_params, + header_params=header_params, + security_index=security_index, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/delete/parameters/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/delete/parameters/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/delete/parameters/parameter_0/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/delete/parameters/parameter_0/__init__.py new file mode 100644 index 00000000000..22662e440a3 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/delete/parameters/parameter_0/__init__.py @@ -0,0 +1,22 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client + +from . import schema + + +class Parameter0(api_client.QueryParameter): + name = "required_string_group" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + required = True + explode = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/delete/parameters/parameter_0/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/delete/parameters/parameter_0/schema.py new file mode 100644 index 00000000000..0518c0e6e64 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/delete/parameters/parameter_0/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.StrSchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/delete/parameters/parameter_1/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/delete/parameters/parameter_1/__init__.py new file mode 100644 index 00000000000..340dec9554e --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/delete/parameters/parameter_1/__init__.py @@ -0,0 +1,21 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client + +from . import schema + + +class Parameter1(api_client.HeaderParameter): + name = "required_boolean_group" + style = api_client.ParameterStyle.SIMPLE + schema = schema.Schema + required = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/delete/parameters/parameter_1/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/delete/parameters/parameter_1/schema.py new file mode 100644 index 00000000000..8b2eabad37d --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/delete/parameters/parameter_1/schema.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Schema( + schemas.StrSchema +): + + + class Schema_: + types = { + str, + } + enum_value_to_name = { + "true": "TRUE", + "false": "FALSE", + } + + @schemas.classproperty + def TRUE(cls): + return cls("true") + + @schemas.classproperty + def FALSE(cls): + return cls("false") diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/delete/parameters/parameter_2/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/delete/parameters/parameter_2/__init__.py new file mode 100644 index 00000000000..89a1faa7bf3 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/delete/parameters/parameter_2/__init__.py @@ -0,0 +1,22 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client + +from . import schema + + +class Parameter2(api_client.QueryParameter): + name = "required_int64_group" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + required = True + explode = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/delete/parameters/parameter_2/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/delete/parameters/parameter_2/schema.py new file mode 100644 index 00000000000..77eefe64028 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/delete/parameters/parameter_2/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.Int64Schema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/delete/parameters/parameter_3/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/delete/parameters/parameter_3/__init__.py new file mode 100644 index 00000000000..6c78b3edc9b --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/delete/parameters/parameter_3/__init__.py @@ -0,0 +1,21 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client + +from . import schema + + +class Parameter3(api_client.QueryParameter): + name = "string_group" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + explode = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/delete/parameters/parameter_3/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/delete/parameters/parameter_3/schema.py new file mode 100644 index 00000000000..0518c0e6e64 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/delete/parameters/parameter_3/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.StrSchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/delete/parameters/parameter_4/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/delete/parameters/parameter_4/__init__.py new file mode 100644 index 00000000000..302a99a628b --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/delete/parameters/parameter_4/__init__.py @@ -0,0 +1,20 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client + +from . import schema + + +class Parameter4(api_client.HeaderParameter): + name = "boolean_group" + style = api_client.ParameterStyle.SIMPLE + schema = schema.Schema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/delete/parameters/parameter_4/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/delete/parameters/parameter_4/schema.py new file mode 100644 index 00000000000..8b2eabad37d --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/delete/parameters/parameter_4/schema.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Schema( + schemas.StrSchema +): + + + class Schema_: + types = { + str, + } + enum_value_to_name = { + "true": "TRUE", + "false": "FALSE", + } + + @schemas.classproperty + def TRUE(cls): + return cls("true") + + @schemas.classproperty + def FALSE(cls): + return cls("false") diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/delete/parameters/parameter_5/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/delete/parameters/parameter_5/__init__.py new file mode 100644 index 00000000000..a94ae540c42 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/delete/parameters/parameter_5/__init__.py @@ -0,0 +1,21 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client + +from . import schema + + +class Parameter5(api_client.QueryParameter): + name = "int64_group" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + explode = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/delete/parameters/parameter_5/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/delete/parameters/parameter_5/schema.py new file mode 100644 index 00000000000..77eefe64028 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/delete/parameters/parameter_5/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.Int64Schema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/delete/responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/delete/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/delete/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/delete/responses/response_200/__init__.py new file mode 100644 index 00000000000..60dc7cec19a --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/delete/responses/response_200/__init__.py @@ -0,0 +1,11 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.responses import response_success_description_only +ResponseFor200 = response_success_description_only.SuccessDescriptionOnly diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/delete/security/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/delete/security/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/delete/security/security_requirement_object_0.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/delete/security/security_requirement_object_0.py new file mode 100644 index 00000000000..d023844656d --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/delete/security/security_requirement_object_0.py @@ -0,0 +1,13 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api import security_schemes + +security_requirement_object: security_schemes.SecurityRequirementObject = { + "bearer_test": (), +} diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/operation.py new file mode 100644 index 00000000000..9169bb3e4d9 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/operation.py @@ -0,0 +1,520 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from .. import path +from .responses import ( + response_200, + response_404, +) +from . import request_body +from .parameters import ( + parameter_0, + parameter_1, + parameter_2, + parameter_3, + parameter_4, + parameter_5, +) + + + +class RequestQueryParameters: + RequiredParams = typing_extensions.TypedDict( + 'RequiredParams', + { + } + ) + OptionalParams = typing_extensions.TypedDict( + 'OptionalParams', + { + 'enum_query_string_array': typing.Union[parameter_2.Parameter2.schema, list, tuple], + 'enum_query_string': typing.Union[parameter_3.Parameter3.schema, str], + 'enum_query_integer': typing.Union[parameter_4.Parameter4.schema, decimal.Decimal, int], + 'enum_query_double': typing.Union[parameter_5.Parameter5.schema, decimal.Decimal, int, float], + }, + total=False + ) + + + class Params(RequiredParams, OptionalParams): + pass + + + parameters = [ + parameter_2.Parameter2, + parameter_3.Parameter3, + parameter_4.Parameter4, + parameter_5.Parameter5, + ] + +class RequestHeaderParameters: + RequiredParams = typing_extensions.TypedDict( + 'RequiredParams', + { + } + ) + OptionalParams = typing_extensions.TypedDict( + 'OptionalParams', + { + 'enum_header_string_array': typing.Union[parameter_0.Parameter0.schema, list, tuple], + 'enum_header_string': typing.Union[parameter_1.Parameter1.schema, str], + }, + total=False + ) + + + class Params(RequiredParams, OptionalParams): + pass + + + parameters = [ + parameter_0.Parameter0, + parameter_1.Parameter1, + ] + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + '404': typing.Type[response_404.ResponseFor404], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, + '404': response_404.ResponseFor404, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _enum_parameters( + self, + content_type: typing_extensions.Literal["application/x-www-form-urlencoded"] = ..., + body: typing.Union[ + request_body.RequestBody.content["application/x-www-form-urlencoded"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + header_params: RequestHeaderParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _enum_parameters( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/x-www-form-urlencoded"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + header_params: RequestHeaderParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _enum_parameters( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/x-www-form-urlencoded"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + header_params: RequestHeaderParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _enum_parameters( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/x-www-form-urlencoded"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + header_params: RequestHeaderParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _enum_parameters( + self, + content_type: str = 'application/x-www-form-urlencoded', + body: typing.Union[ + request_body.RequestBody.content["application/x-www-form-urlencoded"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + header_params: RequestHeaderParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + To test enum parameters + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs(RequestQueryParameters.Params, query_params) + self._verify_typed_dict_inputs(RequestHeaderParameters.Params, header_params) + used_path = path + + prefix_separator_iterator = None + for parameter in RequestQueryParameters.parameters: + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + + _headers = HTTPHeaderDict() + for parameter in RequestHeaderParameters.parameters: + parameter_data = header_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _headers.extend(serialized_data) + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + _fields = None + _body = None + if body is not schemas.unset: + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='get', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + '404', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class EnumParameters(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def enum_parameters( + self, + content_type: typing_extensions.Literal["application/x-www-form-urlencoded"] = ..., + body: typing.Union[ + request_body.RequestBody.content["application/x-www-form-urlencoded"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + header_params: RequestHeaderParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def enum_parameters( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/x-www-form-urlencoded"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + header_params: RequestHeaderParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def enum_parameters( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/x-www-form-urlencoded"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + header_params: RequestHeaderParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def enum_parameters( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/x-www-form-urlencoded"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + header_params: RequestHeaderParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def enum_parameters( + self, + content_type: str = 'application/x-www-form-urlencoded', + body: typing.Union[ + request_body.RequestBody.content["application/x-www-form-urlencoded"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + header_params: RequestHeaderParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._enum_parameters( + body=body, + query_params=query_params, + header_params=header_params, + content_type=content_type, + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForGet(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def get( + self, + content_type: typing_extensions.Literal["application/x-www-form-urlencoded"] = ..., + body: typing.Union[ + request_body.RequestBody.content["application/x-www-form-urlencoded"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + header_params: RequestHeaderParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def get( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/x-www-form-urlencoded"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + header_params: RequestHeaderParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def get( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/x-www-form-urlencoded"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + header_params: RequestHeaderParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/x-www-form-urlencoded"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + header_params: RequestHeaderParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get( + self, + content_type: str = 'application/x-www-form-urlencoded', + body: typing.Union[ + request_body.RequestBody.content["application/x-www-form-urlencoded"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + header_params: RequestHeaderParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._enum_parameters( + body=body, + query_params=query_params, + header_params=header_params, + content_type=content_type, + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/parameters/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/parameters/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/parameters/parameter_0/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/parameters/parameter_0/__init__.py new file mode 100644 index 00000000000..157b2595b3b --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/parameters/parameter_0/__init__.py @@ -0,0 +1,20 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client + +from . import schema + + +class Parameter0(api_client.HeaderParameter): + name = "enum_header_string_array" + style = api_client.ParameterStyle.SIMPLE + schema = schema.Schema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/parameters/parameter_0/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/parameters/parameter_0/schema.py new file mode 100644 index 00000000000..9d14af21cc1 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/parameters/parameter_0/schema.py @@ -0,0 +1,77 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Schema( + schemas.ListSchema +): + + + class Schema_: + types = {tuple} + + + class Items( + schemas.StrSchema + ): + + + class Schema_: + types = { + str, + } + default = "$" + enum_value_to_name = { + ">": "GREATER_THAN_SIGN", + "$": "DOLLAR_SIGN", + } + + @schemas.classproperty + def GREATER_THAN_SIGN(cls): + return cls(">") + + @schemas.classproperty + def DOLLAR_SIGN(cls): + return cls("$") + + def __new__( + cls, + arg_: typing.Union[ + typing.Tuple[ + typing.Union[Schema_.Items, str], ... + ], + typing.List[ + typing.Union[Schema_.Items, str] + ], + ], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'Schema': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) + + def __getitem__(self, i: int) -> Schema_.Items: + return super().__getitem__(i) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/parameters/parameter_1/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/parameters/parameter_1/__init__.py new file mode 100644 index 00000000000..c267214f06e --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/parameters/parameter_1/__init__.py @@ -0,0 +1,20 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client + +from . import schema + + +class Parameter1(api_client.HeaderParameter): + name = "enum_header_string" + style = api_client.ParameterStyle.SIMPLE + schema = schema.Schema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/parameters/parameter_1/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/parameters/parameter_1/schema.py new file mode 100644 index 00000000000..6d756d705c1 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/parameters/parameter_1/schema.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Schema( + schemas.StrSchema +): + + + class Schema_: + types = { + str, + } + default = "-efg" + enum_value_to_name = { + "_abc": "_ABC", + "-efg": "HYPHEN_MINUS_EFG", + "(xyz)": "LEFT_PARENTHESIS_XYZ_RIGHT_PARENTHESIS", + } + + @schemas.classproperty + def _ABC(cls): + return cls("_abc") + + @schemas.classproperty + def HYPHEN_MINUS_EFG(cls): + return cls("-efg") + + @schemas.classproperty + def LEFT_PARENTHESIS_XYZ_RIGHT_PARENTHESIS(cls): + return cls("(xyz)") diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/parameters/parameter_2/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/parameters/parameter_2/__init__.py new file mode 100644 index 00000000000..7f3c767f3b2 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/parameters/parameter_2/__init__.py @@ -0,0 +1,21 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client + +from . import schema + + +class Parameter2(api_client.QueryParameter): + name = "enum_query_string_array" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + explode = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/parameters/parameter_2/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/parameters/parameter_2/schema.py new file mode 100644 index 00000000000..9d14af21cc1 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/parameters/parameter_2/schema.py @@ -0,0 +1,77 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Schema( + schemas.ListSchema +): + + + class Schema_: + types = {tuple} + + + class Items( + schemas.StrSchema + ): + + + class Schema_: + types = { + str, + } + default = "$" + enum_value_to_name = { + ">": "GREATER_THAN_SIGN", + "$": "DOLLAR_SIGN", + } + + @schemas.classproperty + def GREATER_THAN_SIGN(cls): + return cls(">") + + @schemas.classproperty + def DOLLAR_SIGN(cls): + return cls("$") + + def __new__( + cls, + arg_: typing.Union[ + typing.Tuple[ + typing.Union[Schema_.Items, str], ... + ], + typing.List[ + typing.Union[Schema_.Items, str] + ], + ], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'Schema': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) + + def __getitem__(self, i: int) -> Schema_.Items: + return super().__getitem__(i) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/parameters/parameter_3/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/parameters/parameter_3/__init__.py new file mode 100644 index 00000000000..5dade6d55b9 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/parameters/parameter_3/__init__.py @@ -0,0 +1,21 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client + +from . import schema + + +class Parameter3(api_client.QueryParameter): + name = "enum_query_string" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + explode = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/parameters/parameter_3/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/parameters/parameter_3/schema.py new file mode 100644 index 00000000000..6d756d705c1 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/parameters/parameter_3/schema.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Schema( + schemas.StrSchema +): + + + class Schema_: + types = { + str, + } + default = "-efg" + enum_value_to_name = { + "_abc": "_ABC", + "-efg": "HYPHEN_MINUS_EFG", + "(xyz)": "LEFT_PARENTHESIS_XYZ_RIGHT_PARENTHESIS", + } + + @schemas.classproperty + def _ABC(cls): + return cls("_abc") + + @schemas.classproperty + def HYPHEN_MINUS_EFG(cls): + return cls("-efg") + + @schemas.classproperty + def LEFT_PARENTHESIS_XYZ_RIGHT_PARENTHESIS(cls): + return cls("(xyz)") diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/parameters/parameter_4/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/parameters/parameter_4/__init__.py new file mode 100644 index 00000000000..80c88b8141b --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/parameters/parameter_4/__init__.py @@ -0,0 +1,21 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client + +from . import schema + + +class Parameter4(api_client.QueryParameter): + name = "enum_query_integer" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + explode = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/parameters/parameter_4/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/parameters/parameter_4/schema.py new file mode 100644 index 00000000000..f7b61bdc3ca --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/parameters/parameter_4/schema.py @@ -0,0 +1,47 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Schema( + schemas.Int32Schema +): + + + class Schema_: + types = { + decimal.Decimal, + } + format = 'int32' + enum_value_to_name = { + 1: "POSITIVE_1", + -2: "NEGATIVE_2", + } + + @schemas.classproperty + def POSITIVE_1(cls): + return cls(1) + + @schemas.classproperty + def NEGATIVE_2(cls): + return cls(-2) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/parameters/parameter_5/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/parameters/parameter_5/__init__.py new file mode 100644 index 00000000000..fced2e5a282 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/parameters/parameter_5/__init__.py @@ -0,0 +1,21 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client + +from . import schema + + +class Parameter5(api_client.QueryParameter): + name = "enum_query_double" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + explode = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/parameters/parameter_5/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/parameters/parameter_5/schema.py new file mode 100644 index 00000000000..1fb37e7ed8c --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/parameters/parameter_5/schema.py @@ -0,0 +1,47 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Schema( + schemas.Float64Schema +): + + + class Schema_: + types = { + decimal.Decimal, + } + format = 'double' + enum_value_to_name = { + 1.1: "POSITIVE_1_PT_1", + -1.2: "NEGATIVE_1_PT_2", + } + + @schemas.classproperty + def POSITIVE_1_PT_1(cls): + return cls(1.1) + + @schemas.classproperty + def NEGATIVE_1_PT_2(cls): + return cls(-1.2) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/request_body/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/request_body/__init__.py new file mode 100644 index 00000000000..027fa5924fc --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/request_body/__init__.py @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client +from .content.application_x_www_form_urlencoded import schema as application_x_www_form_urlencoded_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationXWwwFormUrlencodedMediaType(api_client.MediaType): + schema: typing.Type[application_x_www_form_urlencoded_schema.Schema] = application_x_www_form_urlencoded_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/x-www-form-urlencoded': typing.Type[__ApplicationXWwwFormUrlencodedMediaType], + } + ) + content: __Content = { + 'application/x-www-form-urlencoded': __ApplicationXWwwFormUrlencodedMediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/request_body/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/request_body/content/application_x_www_form_urlencoded/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/request_body/content/application_x_www_form_urlencoded/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/request_body/content/application_x_www_form_urlencoded/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/request_body/content/application_x_www_form_urlencoded/schema.py new file mode 100644 index 00000000000..b5a433c6576 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/request_body/content/application_x_www_form_urlencoded/schema.py @@ -0,0 +1,177 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Schema( + schemas.DictSchema +): + + + class Schema_: + types = {frozendict.frozendict} + + class Properties: + + + class EnumFormStringArray( + schemas.ListSchema + ): + + + class Schema_: + types = {tuple} + + + class Items( + schemas.StrSchema + ): + + + class Schema_: + types = { + str, + } + default = "$" + enum_value_to_name = { + ">": "GREATER_THAN_SIGN", + "$": "DOLLAR_SIGN", + } + + @schemas.classproperty + def GREATER_THAN_SIGN(cls): + return cls(">") + + @schemas.classproperty + def DOLLAR_SIGN(cls): + return cls("$") + + def __new__( + cls, + arg_: typing.Union[ + typing.Tuple[ + typing.Union[Schema_.Items, str], ... + ], + typing.List[ + typing.Union[Schema_.Items, str] + ], + ], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'Schema.Schema_.Properties.EnumFormStringArray': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) + + def __getitem__(self, i: int) -> Schema_.Items: + return super().__getitem__(i) + + + class EnumFormString( + schemas.StrSchema + ): + + + class Schema_: + types = { + str, + } + default = "-efg" + enum_value_to_name = { + "_abc": "_ABC", + "-efg": "HYPHEN_MINUS_EFG", + "(xyz)": "LEFT_PARENTHESIS_XYZ_RIGHT_PARENTHESIS", + } + + @schemas.classproperty + def _ABC(cls): + return cls("_abc") + + @schemas.classproperty + def HYPHEN_MINUS_EFG(cls): + return cls("-efg") + + @schemas.classproperty + def LEFT_PARENTHESIS_XYZ_RIGHT_PARENTHESIS(cls): + return cls("(xyz)") + __annotations__ = { + "enum_form_string_array": EnumFormStringArray, + "enum_form_string": EnumFormString, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["enum_form_string_array"]) -> Schema_.Properties.EnumFormStringArray: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["enum_form_string"]) -> Schema_.Properties.EnumFormString: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["enum_form_string_array"], + typing_extensions.Literal["enum_form_string"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["enum_form_string_array"]) -> typing.Union[Schema_.Properties.EnumFormStringArray, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["enum_form_string"]) -> typing.Union[Schema_.Properties.EnumFormString, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["enum_form_string_array"], + typing_extensions.Literal["enum_form_string"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + enum_form_string_array: typing.Union[Schema_.Properties.EnumFormStringArray, list, tuple, schemas.Unset] = schemas.unset, + enum_form_string: typing.Union[Schema_.Properties.EnumFormString, str, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'Schema': + return super().__new__( + cls, + *args_, + enum_form_string_array=enum_form_string_array, + enum_form_string=enum_form_string, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/responses/response_200/__init__.py new file mode 100644 index 00000000000..60dc7cec19a --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/responses/response_200/__init__.py @@ -0,0 +1,11 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.responses import response_success_description_only +ResponseFor200 = response_success_description_only.SuccessDescriptionOnly diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/responses/response_404/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/responses/response_404/__init__.py new file mode 100644 index 00000000000..1b4e0a00f87 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/responses/response_404/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor404(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/responses/response_404/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/responses/response_404/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/responses/response_404/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/responses/response_404/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/responses/response_404/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/responses/response_404/content/application_json/schema.py new file mode 100644 index 00000000000..e7d3e8d6bc0 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/responses/response_404/content/application_json/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.DictSchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/patch/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/patch/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/patch/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/patch/operation.py new file mode 100644 index 00000000000..3e12f9cac6c --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/patch/operation.py @@ -0,0 +1,386 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _client_model( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: typing_extensions.Literal["application/json"] = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _client_model( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _client_model( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _client_model( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _client_model( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = 'application/json', + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + To test \"client\" model + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='patch', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class ClientModel(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def client_model( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: typing_extensions.Literal["application/json"] = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def client_model( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def client_model( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def client_model( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def client_model( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = 'application/json', + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._client_model( + body=body, + content_type=content_type, + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPatch(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def patch( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: typing_extensions.Literal["application/json"] = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def patch( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def patch( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def patch( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def patch( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = 'application/json', + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._client_model( + body=body, + content_type=content_type, + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/patch/request_body/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/patch/request_body/__init__.py new file mode 100644 index 00000000000..302c945db27 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/patch/request_body/__init__.py @@ -0,0 +1,11 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.request_bodies import request_body_client +RequestBody = request_body_client.Client diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/patch/responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/patch/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/patch/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/patch/responses/response_200/__init__.py new file mode 100644 index 00000000000..60c9bf3cf80 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/patch/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/patch/responses/response_200/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/patch/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/patch/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/patch/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/patch/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/patch/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..b5013031afd --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/patch/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.schema import client +Schema = client.Client diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/post/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/post/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/post/operation.py new file mode 100644 index 00000000000..f33d5683d7b --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/post/operation.py @@ -0,0 +1,409 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions, security_schemes +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from .. import path +from .responses import ( + response_200, + response_404, +) +from . import request_body +from .security import security_requirement_object_0 + + +_security: typing.List[security_schemes.SecurityRequirementObject] = [ + security_requirement_object_0.security_requirement_object, +] + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + '404': typing.Type[response_404.ResponseFor404], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, + '404': response_404.ResponseFor404, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _endpoint_parameters( + self, + content_type: typing_extensions.Literal["application/x-www-form-urlencoded"] = ..., + body: typing.Union[ + request_body.RequestBody.content["application/x-www-form-urlencoded"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _endpoint_parameters( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/x-www-form-urlencoded"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _endpoint_parameters( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/x-www-form-urlencoded"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _endpoint_parameters( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/x-www-form-urlencoded"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _endpoint_parameters( + self, + content_type: str = 'application/x-www-form-urlencoded', + body: typing.Union[ + request_body.RequestBody.content["application/x-www-form-urlencoded"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + _fields = None + _body = None + if body is not schemas.unset: + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + security_requirement_object = self.api_client.configuration.get_security_requirement_object( + 'paths/' + path + '/post/security', + _security, + security_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + security_requirement_object=security_requirement_object, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + '404', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class EndpointParameters(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def endpoint_parameters( + self, + content_type: typing_extensions.Literal["application/x-www-form-urlencoded"] = ..., + body: typing.Union[ + request_body.RequestBody.content["application/x-www-form-urlencoded"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def endpoint_parameters( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/x-www-form-urlencoded"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def endpoint_parameters( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/x-www-form-urlencoded"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def endpoint_parameters( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/x-www-form-urlencoded"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def endpoint_parameters( + self, + content_type: str = 'application/x-www-form-urlencoded', + body: typing.Union[ + request_body.RequestBody.content["application/x-www-form-urlencoded"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._endpoint_parameters( + body=body, + content_type=content_type, + security_index=security_index, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + content_type: typing_extensions.Literal["application/x-www-form-urlencoded"] = ..., + body: typing.Union[ + request_body.RequestBody.content["application/x-www-form-urlencoded"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/x-www-form-urlencoded"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/x-www-form-urlencoded"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/x-www-form-urlencoded"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + content_type: str = 'application/x-www-form-urlencoded', + body: typing.Union[ + request_body.RequestBody.content["application/x-www-form-urlencoded"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._endpoint_parameters( + body=body, + content_type=content_type, + security_index=security_index, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/post/request_body/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/post/request_body/__init__.py new file mode 100644 index 00000000000..027fa5924fc --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/post/request_body/__init__.py @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client +from .content.application_x_www_form_urlencoded import schema as application_x_www_form_urlencoded_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationXWwwFormUrlencodedMediaType(api_client.MediaType): + schema: typing.Type[application_x_www_form_urlencoded_schema.Schema] = application_x_www_form_urlencoded_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/x-www-form-urlencoded': typing.Type[__ApplicationXWwwFormUrlencodedMediaType], + } + ) + content: __Content = { + 'application/x-www-form-urlencoded': __ApplicationXWwwFormUrlencodedMediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/post/request_body/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/post/request_body/content/application_x_www_form_urlencoded/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/post/request_body/content/application_x_www_form_urlencoded/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/post/request_body/content/application_x_www_form_urlencoded/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/post/request_body/content/application_x_www_form_urlencoded/schema.py new file mode 100644 index 00000000000..2089b12bd14 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/post/request_body/content/application_x_www_form_urlencoded/schema.py @@ -0,0 +1,363 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Schema( + schemas.DictSchema +): + + + class Schema_: + types = {frozendict.frozendict} + required = { + "byte", + "double", + "number", + "pattern_without_delimiter", + } + + class Properties: + + + class Integer( + schemas.IntSchema + ): + + + class Schema_: + types = { + decimal.Decimal, + } + format = 'int' + inclusive_maximum = 100 + inclusive_minimum = 10 + + + class Int32( + schemas.Int32Schema + ): + + + class Schema_: + types = { + decimal.Decimal, + } + format = 'int32' + inclusive_maximum = 200 + inclusive_minimum = 20 + Int64 = schemas.Int64Schema + + + class Number( + schemas.NumberSchema + ): + + + class Schema_: + types = { + decimal.Decimal, + } + inclusive_maximum = 543.2 + inclusive_minimum = 32.1 + + + class _Float( + schemas.Float32Schema + ): + + + class Schema_: + types = { + decimal.Decimal, + } + format = 'float' + inclusive_maximum = 987.6 + + + class Double( + schemas.Float64Schema + ): + + + class Schema_: + types = { + decimal.Decimal, + } + format = 'double' + inclusive_maximum = 123.4 + inclusive_minimum = 67.8 + + + class String( + schemas.StrSchema + ): + + + class Schema_: + types = { + str, + } + regex={ + 'pattern': r'[a-z]', # noqa: E501 + 'flags': re.I, + } + + + class PatternWithoutDelimiter( + schemas.StrSchema + ): + + + class Schema_: + types = { + str, + } + regex={ + 'pattern': r'^[A-Z].*', # noqa: E501 + } + Byte = schemas.StrSchema + Binary = schemas.BinarySchema + Date = schemas.DateSchema + + + class DateTime( + schemas.DateTimeSchema + ): + + + class Schema_: + types = { + str, + } + format = 'date-time' + + + class Password( + schemas.StrSchema + ): + + + class Schema_: + types = { + str, + } + format = 'password' + max_length = 64 + min_length = 10 + Callback = schemas.StrSchema + __annotations__ = { + "integer": Integer, + "int32": Int32, + "int64": Int64, + "number": Number, + "float": _Float, + "double": Double, + "string": String, + "pattern_without_delimiter": PatternWithoutDelimiter, + "byte": Byte, + "binary": Binary, + "date": Date, + "dateTime": DateTime, + "password": Password, + "callback": Callback, + } + + byte: Schema_.Properties.Byte + double: Schema_.Properties.Double + number: Schema_.Properties.Number + pattern_without_delimiter: Schema_.Properties.PatternWithoutDelimiter + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["byte"]) -> Schema_.Properties.Byte: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["double"]) -> Schema_.Properties.Double: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["number"]) -> Schema_.Properties.Number: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["pattern_without_delimiter"]) -> Schema_.Properties.PatternWithoutDelimiter: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["integer"]) -> Schema_.Properties.Integer: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["int32"]) -> Schema_.Properties.Int32: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["int64"]) -> Schema_.Properties.Int64: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["float"]) -> Schema_.Properties._Float: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["string"]) -> Schema_.Properties.String: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["binary"]) -> Schema_.Properties.Binary: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["date"]) -> Schema_.Properties.Date: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["dateTime"]) -> Schema_.Properties.DateTime: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["password"]) -> Schema_.Properties.Password: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["callback"]) -> Schema_.Properties.Callback: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["byte"], + typing_extensions.Literal["double"], + typing_extensions.Literal["number"], + typing_extensions.Literal["pattern_without_delimiter"], + typing_extensions.Literal["integer"], + typing_extensions.Literal["int32"], + typing_extensions.Literal["int64"], + typing_extensions.Literal["float"], + typing_extensions.Literal["string"], + typing_extensions.Literal["binary"], + typing_extensions.Literal["date"], + typing_extensions.Literal["dateTime"], + typing_extensions.Literal["password"], + typing_extensions.Literal["callback"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["byte"]) -> Schema_.Properties.Byte: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["double"]) -> Schema_.Properties.Double: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["number"]) -> Schema_.Properties.Number: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["pattern_without_delimiter"]) -> Schema_.Properties.PatternWithoutDelimiter: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["integer"]) -> typing.Union[Schema_.Properties.Integer, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["int32"]) -> typing.Union[Schema_.Properties.Int32, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["int64"]) -> typing.Union[Schema_.Properties.Int64, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["float"]) -> typing.Union[Schema_.Properties._Float, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["string"]) -> typing.Union[Schema_.Properties.String, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["binary"]) -> typing.Union[Schema_.Properties.Binary, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["date"]) -> typing.Union[Schema_.Properties.Date, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["dateTime"]) -> typing.Union[Schema_.Properties.DateTime, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["password"]) -> typing.Union[Schema_.Properties.Password, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["callback"]) -> typing.Union[Schema_.Properties.Callback, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["byte"], + typing_extensions.Literal["double"], + typing_extensions.Literal["number"], + typing_extensions.Literal["pattern_without_delimiter"], + typing_extensions.Literal["integer"], + typing_extensions.Literal["int32"], + typing_extensions.Literal["int64"], + typing_extensions.Literal["float"], + typing_extensions.Literal["string"], + typing_extensions.Literal["binary"], + typing_extensions.Literal["date"], + typing_extensions.Literal["dateTime"], + typing_extensions.Literal["password"], + typing_extensions.Literal["callback"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + byte: typing.Union[Schema_.Properties.Byte, str], + double: typing.Union[Schema_.Properties.Double, decimal.Decimal, int, float], + number: typing.Union[Schema_.Properties.Number, decimal.Decimal, int, float], + pattern_without_delimiter: typing.Union[Schema_.Properties.PatternWithoutDelimiter, str], + integer: typing.Union[Schema_.Properties.Integer, decimal.Decimal, int, schemas.Unset] = schemas.unset, + int32: typing.Union[Schema_.Properties.Int32, decimal.Decimal, int, schemas.Unset] = schemas.unset, + int64: typing.Union[Schema_.Properties.Int64, decimal.Decimal, int, schemas.Unset] = schemas.unset, + string: typing.Union[Schema_.Properties.String, str, schemas.Unset] = schemas.unset, + binary: typing.Union[Schema_.Properties.Binary, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + date: typing.Union[Schema_.Properties.Date, str, datetime.date, schemas.Unset] = schemas.unset, + dateTime: typing.Union[Schema_.Properties.DateTime, str, datetime.datetime, schemas.Unset] = schemas.unset, + password: typing.Union[Schema_.Properties.Password, str, schemas.Unset] = schemas.unset, + callback: typing.Union[Schema_.Properties.Callback, str, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'Schema': + return super().__new__( + cls, + *args_, + byte=byte, + double=double, + number=number, + pattern_without_delimiter=pattern_without_delimiter, + integer=integer, + int32=int32, + int64=int64, + string=string, + binary=binary, + date=date, + dateTime=dateTime, + password=password, + callback=callback, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/post/responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/post/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..60dc7cec19a --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/post/responses/response_200/__init__.py @@ -0,0 +1,11 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.responses import response_success_description_only +ResponseFor200 = response_success_description_only.SuccessDescriptionOnly diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/post/responses/response_404/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/post/responses/response_404/__init__.py new file mode 100644 index 00000000000..e82142578f7 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/post/responses/response_404/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor404(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/post/security/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/post/security/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/post/security/security_requirement_object_0.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/post/security/security_requirement_object_0.py new file mode 100644 index 00000000000..4fa83154711 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/post/security/security_requirement_object_0.py @@ -0,0 +1,13 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api import security_schemes + +security_requirement_object: security_schemes.SecurityRequirementObject = { + "http_basic_test": (), +} diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_additional_properties_with_array_of_enums/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_additional_properties_with_array_of_enums/__init__.py new file mode 100644 index 00000000000..3c8edee79fa --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_additional_properties_with_array_of_enums/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from petstore_api.apis.paths.fake_additional_properties_with_array_of_enums import FakeAdditionalPropertiesWithArrayOfEnums + +path = "/fake/additional-properties-with-array-of-enums" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/operation.py new file mode 100644 index 00000000000..804551ce429 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/operation.py @@ -0,0 +1,399 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _additional_properties_with_array_of_enums( + self, + content_type: typing_extensions.Literal["application/json"] = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _additional_properties_with_array_of_enums( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _additional_properties_with_array_of_enums( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _additional_properties_with_array_of_enums( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _additional_properties_with_array_of_enums( + self, + content_type: str = 'application/json', + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + Additional Properties with Array of Enums + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + _fields = None + _body = None + if body is not schemas.unset: + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='get', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class AdditionalPropertiesWithArrayOfEnums(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def additional_properties_with_array_of_enums( + self, + content_type: typing_extensions.Literal["application/json"] = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def additional_properties_with_array_of_enums( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def additional_properties_with_array_of_enums( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def additional_properties_with_array_of_enums( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def additional_properties_with_array_of_enums( + self, + content_type: str = 'application/json', + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._additional_properties_with_array_of_enums( + body=body, + content_type=content_type, + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForGet(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def get( + self, + content_type: typing_extensions.Literal["application/json"] = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def get( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def get( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get( + self, + content_type: str = 'application/json', + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._additional_properties_with_array_of_enums( + body=body, + content_type=content_type, + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/request_body/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/request_body/__init__.py new file mode 100644 index 00000000000..b4604475a48 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/request_body/__init__.py @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/request_body/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/request_body/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/request_body/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..46d58a83c39 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.schema import additional_properties_with_array_of_enums +Schema = additional_properties_with_array_of_enums.AdditionalPropertiesWithArrayOfEnums diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/responses/response_200/__init__.py new file mode 100644 index 00000000000..60c9bf3cf80 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/responses/response_200/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..46d58a83c39 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.schema import additional_properties_with_array_of_enums +Schema = additional_properties_with_array_of_enums.AdditionalPropertiesWithArrayOfEnums diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_body_with_file_schema/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_body_with_file_schema/__init__.py new file mode 100644 index 00000000000..6d1ba235516 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_body_with_file_schema/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from petstore_api.apis.paths.fake_body_with_file_schema import FakeBodyWithFileSchema + +path = "/fake/body-with-file-schema" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_body_with_file_schema/put/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_body_with_file_schema/put/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_body_with_file_schema/put/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_body_with_file_schema/put/operation.py new file mode 100644 index 00000000000..ce16e8aaa97 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_body_with_file_schema/put/operation.py @@ -0,0 +1,361 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _body_with_file_schema( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _body_with_file_schema( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _body_with_file_schema( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _body_with_file_schema( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _body_with_file_schema( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='put', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class BodyWithFileSchema(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def body_with_file_schema( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def body_with_file_schema( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def body_with_file_schema( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def body_with_file_schema( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def body_with_file_schema( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._body_with_file_schema( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPut(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def put( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def put( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def put( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def put( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def put( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._body_with_file_schema( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_body_with_file_schema/put/request_body/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_body_with_file_schema/put/request_body/__init__.py new file mode 100644 index 00000000000..01f76b5c2be --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_body_with_file_schema/put/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_body_with_file_schema/put/request_body/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_body_with_file_schema/put/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_body_with_file_schema/put/request_body/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_body_with_file_schema/put/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_body_with_file_schema/put/request_body/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_body_with_file_schema/put/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..2bf775682dc --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_body_with_file_schema/put/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.schema import file_schema_test_class +Schema = file_schema_test_class.FileSchemaTestClass diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_body_with_file_schema/put/responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_body_with_file_schema/put/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_body_with_file_schema/put/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_body_with_file_schema/put/responses/response_200/__init__.py new file mode 100644 index 00000000000..60dc7cec19a --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_body_with_file_schema/put/responses/response_200/__init__.py @@ -0,0 +1,11 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.responses import response_success_description_only +ResponseFor200 = response_success_description_only.SuccessDescriptionOnly diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_body_with_query_params/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_body_with_query_params/__init__.py new file mode 100644 index 00000000000..dcba6e1bf38 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_body_with_query_params/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from petstore_api.apis.paths.fake_body_with_query_params import FakeBodyWithQueryParams + +path = "/fake/body-with-query-params" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_body_with_query_params/put/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_body_with_query_params/put/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_body_with_query_params/put/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_body_with_query_params/put/operation.py new file mode 100644 index 00000000000..44c0f944e02 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_body_with_query_params/put/operation.py @@ -0,0 +1,414 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body +from .parameters import parameter_0 + + + +class RequestQueryParameters: + RequiredParams = typing_extensions.TypedDict( + 'RequiredParams', + { + 'query': typing.Union[parameter_0.Parameter0.schema, str], + } + ) + OptionalParams = typing_extensions.TypedDict( + 'OptionalParams', + { + }, + total=False + ) + + + class Params(RequiredParams, OptionalParams): + pass + + + parameters = [ + parameter_0.Parameter0, + ] + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _body_with_query_params( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: typing_extensions.Literal["application/json"] = ..., + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _body_with_query_params( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _body_with_query_params( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _body_with_query_params( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _body_with_query_params( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = 'application/json', + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs(RequestQueryParameters.Params, query_params) + used_path = path + + prefix_separator_iterator = None + for parameter in RequestQueryParameters.parameters: + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='put', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class BodyWithQueryParams(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def body_with_query_params( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: typing_extensions.Literal["application/json"] = ..., + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def body_with_query_params( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def body_with_query_params( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def body_with_query_params( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def body_with_query_params( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = 'application/json', + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._body_with_query_params( + body=body, + query_params=query_params, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPut(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def put( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: typing_extensions.Literal["application/json"] = ..., + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def put( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def put( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def put( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def put( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = 'application/json', + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._body_with_query_params( + body=body, + query_params=query_params, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_body_with_query_params/put/parameters/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_body_with_query_params/put/parameters/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_body_with_query_params/put/parameters/parameter_0/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_body_with_query_params/put/parameters/parameter_0/__init__.py new file mode 100644 index 00000000000..e555440a5c0 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_body_with_query_params/put/parameters/parameter_0/__init__.py @@ -0,0 +1,22 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client + +from . import schema + + +class Parameter0(api_client.QueryParameter): + name = "query" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + required = True + explode = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_body_with_query_params/put/parameters/parameter_0/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_body_with_query_params/put/parameters/parameter_0/schema.py new file mode 100644 index 00000000000..0518c0e6e64 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_body_with_query_params/put/parameters/parameter_0/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.StrSchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_body_with_query_params/put/request_body/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_body_with_query_params/put/request_body/__init__.py new file mode 100644 index 00000000000..01f76b5c2be --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_body_with_query_params/put/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_body_with_query_params/put/request_body/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_body_with_query_params/put/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_body_with_query_params/put/request_body/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_body_with_query_params/put/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_body_with_query_params/put/request_body/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_body_with_query_params/put/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..483ea128c04 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_body_with_query_params/put/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.schema import user +Schema = user.User diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_body_with_query_params/put/responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_body_with_query_params/put/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_body_with_query_params/put/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_body_with_query_params/put/responses/response_200/__init__.py new file mode 100644 index 00000000000..60dc7cec19a --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_body_with_query_params/put/responses/response_200/__init__.py @@ -0,0 +1,11 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.responses import response_success_description_only +ResponseFor200 = response_success_description_only.SuccessDescriptionOnly diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_case_sensitive_params/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_case_sensitive_params/__init__.py new file mode 100644 index 00000000000..23858eb0e08 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_case_sensitive_params/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from petstore_api.apis.paths.fake_case_sensitive_params import FakeCaseSensitiveParams + +path = "/fake/case-sensitive-params" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_case_sensitive_params/put/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_case_sensitive_params/put/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_case_sensitive_params/put/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_case_sensitive_params/put/operation.py new file mode 100644 index 00000000000..3161cb09f9a --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_case_sensitive_params/put/operation.py @@ -0,0 +1,276 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from petstore_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from .parameters import ( + parameter_0, + parameter_1, + parameter_2, +) + + + +class RequestQueryParameters: + RequiredParams = typing_extensions.TypedDict( + 'RequiredParams', + { + 'someVar': typing.Union[parameter_0.Parameter0.schema, str], + 'SomeVar': typing.Union[parameter_1.Parameter1.schema, str], + 'some_var': typing.Union[parameter_2.Parameter2.schema, str], + } + ) + OptionalParams = typing_extensions.TypedDict( + 'OptionalParams', + { + }, + total=False + ) + + + class Params(RequiredParams, OptionalParams): + pass + + + parameters = [ + parameter_0.Parameter0, + parameter_1.Parameter1, + parameter_2.Parameter2, + ] + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _case_sensitive_params( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _case_sensitive_params( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _case_sensitive_params( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _case_sensitive_params( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs(RequestQueryParameters.Params, query_params) + used_path = path + + prefix_separator_iterator = None + for parameter in RequestQueryParameters.parameters: + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + # TODO add cookie handling + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='put', + host=host, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class CaseSensitiveParams(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def case_sensitive_params( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def case_sensitive_params( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def case_sensitive_params( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def case_sensitive_params( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._case_sensitive_params( + query_params=query_params, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPut(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def put( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def put( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def put( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def put( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._case_sensitive_params( + query_params=query_params, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_case_sensitive_params/put/parameters/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_case_sensitive_params/put/parameters/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_case_sensitive_params/put/parameters/parameter_0/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_case_sensitive_params/put/parameters/parameter_0/__init__.py new file mode 100644 index 00000000000..7bc70cb793d --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_case_sensitive_params/put/parameters/parameter_0/__init__.py @@ -0,0 +1,22 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client + +from . import schema + + +class Parameter0(api_client.QueryParameter): + name = "someVar" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + required = True + explode = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_case_sensitive_params/put/parameters/parameter_0/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_case_sensitive_params/put/parameters/parameter_0/schema.py new file mode 100644 index 00000000000..0518c0e6e64 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_case_sensitive_params/put/parameters/parameter_0/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.StrSchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_case_sensitive_params/put/parameters/parameter_1/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_case_sensitive_params/put/parameters/parameter_1/__init__.py new file mode 100644 index 00000000000..177cb88390b --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_case_sensitive_params/put/parameters/parameter_1/__init__.py @@ -0,0 +1,22 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client + +from . import schema + + +class Parameter1(api_client.QueryParameter): + name = "SomeVar" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + required = True + explode = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_case_sensitive_params/put/parameters/parameter_1/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_case_sensitive_params/put/parameters/parameter_1/schema.py new file mode 100644 index 00000000000..0518c0e6e64 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_case_sensitive_params/put/parameters/parameter_1/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.StrSchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_case_sensitive_params/put/parameters/parameter_2/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_case_sensitive_params/put/parameters/parameter_2/__init__.py new file mode 100644 index 00000000000..10eb1585ec2 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_case_sensitive_params/put/parameters/parameter_2/__init__.py @@ -0,0 +1,22 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client + +from . import schema + + +class Parameter2(api_client.QueryParameter): + name = "some_var" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + required = True + explode = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_case_sensitive_params/put/parameters/parameter_2/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_case_sensitive_params/put/parameters/parameter_2/schema.py new file mode 100644 index 00000000000..0518c0e6e64 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_case_sensitive_params/put/parameters/parameter_2/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.StrSchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_case_sensitive_params/put/responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_case_sensitive_params/put/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_case_sensitive_params/put/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_case_sensitive_params/put/responses/response_200/__init__.py new file mode 100644 index 00000000000..60dc7cec19a --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_case_sensitive_params/put/responses/response_200/__init__.py @@ -0,0 +1,11 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.responses import response_success_description_only +ResponseFor200 = response_success_description_only.SuccessDescriptionOnly diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_classname_test/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_classname_test/__init__.py new file mode 100644 index 00000000000..7d8f1bd911f --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_classname_test/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from petstore_api.apis.paths.fake_classname_test import FakeClassnameTest + +path = "/fake_classname_test" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_classname_test/patch/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_classname_test/patch/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_classname_test/patch/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_classname_test/patch/operation.py new file mode 100644 index 00000000000..bec0b123906 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_classname_test/patch/operation.py @@ -0,0 +1,414 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions, security_schemes +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body +from .security import security_requirement_object_0 + + +_security: typing.List[security_schemes.SecurityRequirementObject] = [ + security_requirement_object_0.security_requirement_object, +] + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _classname( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: typing_extensions.Literal["application/json"] = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _classname( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _classname( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _classname( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _classname( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = 'application/json', + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + To test class name in snake case + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + security_requirement_object = self.api_client.configuration.get_security_requirement_object( + 'paths/' + path + '/patch/security', + _security, + security_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='patch', + host=host, + headers=_headers, + fields=_fields, + body=_body, + security_requirement_object=security_requirement_object, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class Classname(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def classname( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: typing_extensions.Literal["application/json"] = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def classname( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def classname( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def classname( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def classname( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = 'application/json', + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._classname( + body=body, + content_type=content_type, + accept_content_types=accept_content_types, + security_index=security_index, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPatch(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def patch( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: typing_extensions.Literal["application/json"] = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def patch( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def patch( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def patch( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def patch( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = 'application/json', + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._classname( + body=body, + content_type=content_type, + accept_content_types=accept_content_types, + security_index=security_index, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_classname_test/patch/request_body/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_classname_test/patch/request_body/__init__.py new file mode 100644 index 00000000000..302c945db27 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_classname_test/patch/request_body/__init__.py @@ -0,0 +1,11 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.request_bodies import request_body_client +RequestBody = request_body_client.Client diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_classname_test/patch/responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_classname_test/patch/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_classname_test/patch/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_classname_test/patch/responses/response_200/__init__.py new file mode 100644 index 00000000000..60c9bf3cf80 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_classname_test/patch/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_classname_test/patch/responses/response_200/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_classname_test/patch/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_classname_test/patch/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_classname_test/patch/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_classname_test/patch/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_classname_test/patch/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..b5013031afd --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_classname_test/patch/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.schema import client +Schema = client.Client diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_classname_test/patch/security/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_classname_test/patch/security/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_classname_test/patch/security/security_requirement_object_0.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_classname_test/patch/security/security_requirement_object_0.py new file mode 100644 index 00000000000..b14ae03d3c0 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_classname_test/patch/security/security_requirement_object_0.py @@ -0,0 +1,13 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api import security_schemes + +security_requirement_object: security_schemes.SecurityRequirementObject = { + "api_key_query": (), +} diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_delete_coffee_id/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_delete_coffee_id/__init__.py new file mode 100644 index 00000000000..1afe16c51fd --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_delete_coffee_id/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from petstore_api.apis.paths.fake_delete_coffee_id import FakeDeleteCoffeeId + +path = "/fake/deleteCoffee/{id}" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_delete_coffee_id/delete/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_delete_coffee_id/delete/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_delete_coffee_id/delete/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_delete_coffee_id/delete/operation.py new file mode 100644 index 00000000000..089bc54a9ea --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_delete_coffee_id/delete/operation.py @@ -0,0 +1,285 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from petstore_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from .. import path +from .responses import ( + response_200, + response_default, +) +from .parameters import parameter_0 + + + +class RequestPathParameters: + RequiredParams = typing_extensions.TypedDict( + 'RequiredParams', + { + 'id': typing.Union[parameter_0.Parameter0.schema, str], + } + ) + OptionalParams = typing_extensions.TypedDict( + 'OptionalParams', + { + }, + total=False + ) + + + class Params(RequiredParams, OptionalParams): + pass + + + parameters = [ + parameter_0.Parameter0, + ] + +default_response = response_default.Default +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _delete_coffee( + self, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + response_default.Default.response_cls, + ]: ... + + @typing.overload + def _delete_coffee( + self, + skip_deserialization: typing_extensions.Literal[True], + path_params: RequestPathParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _delete_coffee( + self, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + response_default.Default.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _delete_coffee( + self, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + Delete coffee + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs(RequestPathParameters.Params, path_params) + used_path = path + + _path_params = {} + for parameter in RequestPathParameters.parameters: + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + # TODO add cookie handling + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='delete', + host=host, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = default_response.deserialize(response, self.api_client.schema_configuration) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class DeleteCoffee(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def delete_coffee( + self, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + response_default.Default.response_cls, + ]: ... + + @typing.overload + def delete_coffee( + self, + skip_deserialization: typing_extensions.Literal[True], + path_params: RequestPathParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def delete_coffee( + self, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + response_default.Default.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def delete_coffee( + self, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._delete_coffee( + path_params=path_params, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForDelete(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def delete( + self, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + response_default.Default.response_cls, + ]: ... + + @typing.overload + def delete( + self, + skip_deserialization: typing_extensions.Literal[True], + path_params: RequestPathParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def delete( + self, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + response_default.Default.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def delete( + self, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._delete_coffee( + path_params=path_params, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_delete_coffee_id/delete/parameters/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_delete_coffee_id/delete/parameters/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_delete_coffee_id/delete/parameters/parameter_0/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_delete_coffee_id/delete/parameters/parameter_0/__init__.py new file mode 100644 index 00000000000..da1cb235953 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_delete_coffee_id/delete/parameters/parameter_0/__init__.py @@ -0,0 +1,21 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client + +from . import schema + + +class Parameter0(api_client.PathParameter): + name = "id" + style = api_client.ParameterStyle.SIMPLE + schema = schema.Schema + required = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_delete_coffee_id/delete/parameters/parameter_0/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_delete_coffee_id/delete/parameters/parameter_0/schema.py new file mode 100644 index 00000000000..0518c0e6e64 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_delete_coffee_id/delete/parameters/parameter_0/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.StrSchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_delete_coffee_id/delete/responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_delete_coffee_id/delete/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_delete_coffee_id/delete/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_delete_coffee_id/delete/responses/response_200/__init__.py new file mode 100644 index 00000000000..60dc7cec19a --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_delete_coffee_id/delete/responses/response_200/__init__.py @@ -0,0 +1,11 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.responses import response_success_description_only +ResponseFor200 = response_success_description_only.SuccessDescriptionOnly diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_delete_coffee_id/delete/responses/response_default/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_delete_coffee_id/delete/responses/response_default/__init__.py new file mode 100644 index 00000000000..60374e129f0 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_delete_coffee_id/delete/responses/response_default/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class Default(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_health/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_health/__init__.py new file mode 100644 index 00000000000..425ee37c33b --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_health/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from petstore_api.apis.paths.fake_health import FakeHealth + +path = "/fake/health" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_health/get/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_health/get/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_health/get/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_health/get/operation.py new file mode 100644 index 00000000000..a42ddb37051 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_health/get/operation.py @@ -0,0 +1,244 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _fake_health_get( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _fake_health_get( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _fake_health_get( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _fake_health_get( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + Health check endpoint + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='get', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class FakeHealthGet(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def fake_health_get( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def fake_health_get( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def fake_health_get( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def fake_health_get( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._fake_health_get( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForGet(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def get( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def get( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._fake_health_get( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_health/get/responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_health/get/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_health/get/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_health/get/responses/response_200/__init__.py new file mode 100644 index 00000000000..60c9bf3cf80 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_health/get/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_health/get/responses/response_200/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_health/get/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_health/get/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_health/get/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_health/get/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_health/get/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..0f59109a199 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_health/get/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.schema import health_check_result +Schema = health_check_result.HealthCheckResult diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_additional_properties/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_additional_properties/__init__.py new file mode 100644 index 00000000000..a78ca8303ca --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_additional_properties/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from petstore_api.apis.paths.fake_inline_additional_properties import FakeInlineAdditionalProperties + +path = "/fake/inline-additionalProperties" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_additional_properties/post/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_additional_properties/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_additional_properties/post/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_additional_properties/post/operation.py new file mode 100644 index 00000000000..570a826c744 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_additional_properties/post/operation.py @@ -0,0 +1,362 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _inline_additional_properties( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _inline_additional_properties( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _inline_additional_properties( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _inline_additional_properties( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _inline_additional_properties( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + test inline additionalProperties + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class InlineAdditionalProperties(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def inline_additional_properties( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def inline_additional_properties( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def inline_additional_properties( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def inline_additional_properties( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def inline_additional_properties( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._inline_additional_properties( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._inline_additional_properties( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_additional_properties/post/request_body/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_additional_properties/post/request_body/__init__.py new file mode 100644 index 00000000000..01f76b5c2be --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_additional_properties/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_additional_properties/post/request_body/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_additional_properties/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_additional_properties/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_additional_properties/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_additional_properties/post/request_body/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_additional_properties/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..c8c118cc195 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_additional_properties/post/request_body/content/application_json/schema.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Schema( + schemas.DictSchema +): + + + class Schema_: + types = {frozendict.frozendict} + AdditionalProperties = schemas.StrSchema + + def __getitem__(self, name: str) -> Schema_.AdditionalProperties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def get_item_(self, name: str) -> Schema_.AdditionalProperties: + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[Schema_.AdditionalProperties, str], + ) -> 'Schema': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_additional_properties/post/responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_additional_properties/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_additional_properties/post/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_additional_properties/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..60dc7cec19a --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_additional_properties/post/responses/response_200/__init__.py @@ -0,0 +1,11 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.responses import response_success_description_only +ResponseFor200 = response_success_description_only.SuccessDescriptionOnly diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/__init__.py new file mode 100644 index 00000000000..c92e8a23193 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from petstore_api.apis.paths.fake_inline_composition import FakeInlineComposition + +path = "/fake/inlineComposition/" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/operation.py new file mode 100644 index 00000000000..a2a48efb20c --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/operation.py @@ -0,0 +1,734 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body +from .parameters import ( + parameter_0, + parameter_1, +) + + + +class RequestQueryParameters: + RequiredParams = typing_extensions.TypedDict( + 'RequiredParams', + { + } + ) + OptionalParams = typing_extensions.TypedDict( + 'OptionalParams', + { + 'compositionAtRoot': typing.Union[parameter_0.Parameter0.schema, dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + 'compositionInProperty': typing.Union[parameter_1.Parameter1.schema, dict, frozendict.frozendict], + }, + total=False + ) + + + class Params(RequiredParams, OptionalParams): + pass + + + parameters = [ + parameter_0.Parameter0, + parameter_1.Parameter1, + ] + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", + "multipart/form-data", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _inline_composition( + self, + content_type: typing_extensions.Literal["application/json"] = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _inline_composition( + self, + content_type: typing_extensions.Literal["multipart/form-data"], + body: typing.Union[ + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _inline_composition( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _inline_composition( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _inline_composition( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _inline_composition( + self, + content_type: str = 'application/json', + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + testing composed schemas at inline locations + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs(RequestQueryParameters.Params, query_params) + used_path = path + + prefix_separator_iterator = None + for parameter in RequestQueryParameters.parameters: + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + _fields = None + _body = None + if body is not schemas.unset: + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class InlineComposition(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def inline_composition( + self, + content_type: typing_extensions.Literal["application/json"] = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def inline_composition( + self, + content_type: typing_extensions.Literal["multipart/form-data"], + body: typing.Union[ + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def inline_composition( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def inline_composition( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def inline_composition( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def inline_composition( + self, + content_type: str = 'application/json', + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._inline_composition( + body=body, + query_params=query_params, + content_type=content_type, + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + content_type: typing_extensions.Literal["application/json"] = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + content_type: typing_extensions.Literal["multipart/form-data"], + body: typing.Union[ + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + content_type: str = 'application/json', + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._inline_composition( + body=body, + query_params=query_params, + content_type=content_type, + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/parameters/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/parameters/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/parameters/parameter_0/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/parameters/parameter_0/__init__.py new file mode 100644 index 00000000000..8b29cbcb315 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/parameters/parameter_0/__init__.py @@ -0,0 +1,21 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client + +from . import schema + + +class Parameter0(api_client.QueryParameter): + name = "compositionAtRoot" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + explode = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/parameters/parameter_0/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/parameters/parameter_0/schema.py new file mode 100644 index 00000000000..70cc932e4aa --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/parameters/parameter_0/schema.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Schema( + schemas.AnyTypeSchema, +): + + + class Schema_: + # any type + + class AllOf: + + + class _0( + schemas.StrSchema + ): + + + class Schema_: + types = { + str, + } + min_length = 1 + classes = [ + _0, + ] + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'Schema': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/parameters/parameter_1/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/parameters/parameter_1/__init__.py new file mode 100644 index 00000000000..6d7a76fc8b5 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/parameters/parameter_1/__init__.py @@ -0,0 +1,21 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client + +from . import schema + + +class Parameter1(api_client.QueryParameter): + name = "compositionInProperty" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + explode = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/parameters/parameter_1/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/parameters/parameter_1/schema.py new file mode 100644 index 00000000000..4be3811452a --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/parameters/parameter_1/schema.py @@ -0,0 +1,123 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Schema( + schemas.DictSchema +): + + + class Schema_: + types = {frozendict.frozendict} + + class Properties: + + + class SomeProp( + schemas.AnyTypeSchema, + ): + + + class Schema_: + # any type + + class AllOf: + + + class _0( + schemas.StrSchema + ): + + + class Schema_: + types = { + str, + } + min_length = 1 + classes = [ + _0, + ] + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'Schema.Schema_.Properties.SomeProp': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + __annotations__ = { + "someProp": SomeProp, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["someProp"]) -> Schema_.Properties.SomeProp: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["someProp"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["someProp"]) -> typing.Union[Schema_.Properties.SomeProp, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["someProp"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + someProp: typing.Union[Schema_.Properties.SomeProp, dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'Schema': + return super().__new__( + cls, + *args_, + someProp=someProp, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/request_body/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/request_body/__init__.py new file mode 100644 index 00000000000..5d2f4141364 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/request_body/__init__.py @@ -0,0 +1,35 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client +from .content.application_json import schema as application_json_schema +from .content.multipart_form_data import schema as multipart_form_data_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + + + class __MultipartFormDataMediaType(api_client.MediaType): + schema: typing.Type[multipart_form_data_schema.Schema] = multipart_form_data_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + 'multipart/form-data': typing.Type[__MultipartFormDataMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + 'multipart/form-data': __MultipartFormDataMediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/request_body/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/request_body/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..70cc932e4aa --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/request_body/content/application_json/schema.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Schema( + schemas.AnyTypeSchema, +): + + + class Schema_: + # any type + + class AllOf: + + + class _0( + schemas.StrSchema + ): + + + class Schema_: + types = { + str, + } + min_length = 1 + classes = [ + _0, + ] + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'Schema': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/request_body/content/multipart_form_data/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/request_body/content/multipart_form_data/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/request_body/content/multipart_form_data/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/request_body/content/multipart_form_data/schema.py new file mode 100644 index 00000000000..4be3811452a --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/request_body/content/multipart_form_data/schema.py @@ -0,0 +1,123 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Schema( + schemas.DictSchema +): + + + class Schema_: + types = {frozendict.frozendict} + + class Properties: + + + class SomeProp( + schemas.AnyTypeSchema, + ): + + + class Schema_: + # any type + + class AllOf: + + + class _0( + schemas.StrSchema + ): + + + class Schema_: + types = { + str, + } + min_length = 1 + classes = [ + _0, + ] + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'Schema.Schema_.Properties.SomeProp': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + __annotations__ = { + "someProp": SomeProp, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["someProp"]) -> Schema_.Properties.SomeProp: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["someProp"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["someProp"]) -> typing.Union[Schema_.Properties.SomeProp, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["someProp"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + someProp: typing.Union[Schema_.Properties.SomeProp, dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'Schema': + return super().__new__( + cls, + *args_, + someProp=someProp, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..11285745946 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/responses/response_200/__init__.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas +from .content.application_json import schema as application_json_schema +from .content.multipart_form_data import schema as multipart_form_data_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + application_json_schema.Schema, + multipart_form_data_schema.Schema, + ] + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + + + class __MultipartFormDataMediaType(api_client.MediaType): + schema: typing.Type[multipart_form_data_schema.Schema] = multipart_form_data_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + 'multipart/form-data': typing.Type[__MultipartFormDataMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + 'multipart/form-data': __MultipartFormDataMediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/responses/response_200/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..70cc932e4aa --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Schema( + schemas.AnyTypeSchema, +): + + + class Schema_: + # any type + + class AllOf: + + + class _0( + schemas.StrSchema + ): + + + class Schema_: + types = { + str, + } + min_length = 1 + classes = [ + _0, + ] + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'Schema': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/responses/response_200/content/multipart_form_data/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/responses/response_200/content/multipart_form_data/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/responses/response_200/content/multipart_form_data/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/responses/response_200/content/multipart_form_data/schema.py new file mode 100644 index 00000000000..4be3811452a --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/responses/response_200/content/multipart_form_data/schema.py @@ -0,0 +1,123 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Schema( + schemas.DictSchema +): + + + class Schema_: + types = {frozendict.frozendict} + + class Properties: + + + class SomeProp( + schemas.AnyTypeSchema, + ): + + + class Schema_: + # any type + + class AllOf: + + + class _0( + schemas.StrSchema + ): + + + class Schema_: + types = { + str, + } + min_length = 1 + classes = [ + _0, + ] + + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'Schema.Schema_.Properties.SomeProp': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + **kwargs, + ) + __annotations__ = { + "someProp": SomeProp, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["someProp"]) -> Schema_.Properties.SomeProp: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["someProp"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["someProp"]) -> typing.Union[Schema_.Properties.SomeProp, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["someProp"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + someProp: typing.Union[Schema_.Properties.SomeProp, dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'Schema': + return super().__new__( + cls, + *args_, + someProp=someProp, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_form_data/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_form_data/__init__.py new file mode 100644 index 00000000000..ed037bdfc09 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_form_data/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from petstore_api.apis.paths.fake_json_form_data import FakeJsonFormData + +path = "/fake/jsonFormData" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_form_data/get/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_form_data/get/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_form_data/get/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_form_data/get/operation.py new file mode 100644 index 00000000000..01861fd4661 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_form_data/get/operation.py @@ -0,0 +1,375 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _json_form_data( + self, + content_type: typing_extensions.Literal["application/x-www-form-urlencoded"] = ..., + body: typing.Union[ + request_body.RequestBody.content["application/x-www-form-urlencoded"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _json_form_data( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/x-www-form-urlencoded"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _json_form_data( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/x-www-form-urlencoded"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _json_form_data( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/x-www-form-urlencoded"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _json_form_data( + self, + content_type: str = 'application/x-www-form-urlencoded', + body: typing.Union[ + request_body.RequestBody.content["application/x-www-form-urlencoded"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + test json serialization of form data + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + _fields = None + _body = None + if body is not schemas.unset: + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='get', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class JsonFormData(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def json_form_data( + self, + content_type: typing_extensions.Literal["application/x-www-form-urlencoded"] = ..., + body: typing.Union[ + request_body.RequestBody.content["application/x-www-form-urlencoded"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def json_form_data( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/x-www-form-urlencoded"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def json_form_data( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/x-www-form-urlencoded"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def json_form_data( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/x-www-form-urlencoded"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def json_form_data( + self, + content_type: str = 'application/x-www-form-urlencoded', + body: typing.Union[ + request_body.RequestBody.content["application/x-www-form-urlencoded"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._json_form_data( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForGet(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def get( + self, + content_type: typing_extensions.Literal["application/x-www-form-urlencoded"] = ..., + body: typing.Union[ + request_body.RequestBody.content["application/x-www-form-urlencoded"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def get( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/x-www-form-urlencoded"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def get( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/x-www-form-urlencoded"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/x-www-form-urlencoded"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get( + self, + content_type: str = 'application/x-www-form-urlencoded', + body: typing.Union[ + request_body.RequestBody.content["application/x-www-form-urlencoded"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._json_form_data( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_form_data/get/request_body/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_form_data/get/request_body/__init__.py new file mode 100644 index 00000000000..027fa5924fc --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_form_data/get/request_body/__init__.py @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client +from .content.application_x_www_form_urlencoded import schema as application_x_www_form_urlencoded_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationXWwwFormUrlencodedMediaType(api_client.MediaType): + schema: typing.Type[application_x_www_form_urlencoded_schema.Schema] = application_x_www_form_urlencoded_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/x-www-form-urlencoded': typing.Type[__ApplicationXWwwFormUrlencodedMediaType], + } + ) + content: __Content = { + 'application/x-www-form-urlencoded': __ApplicationXWwwFormUrlencodedMediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_form_data/get/request_body/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_form_data/get/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_form_data/get/request_body/content/application_x_www_form_urlencoded/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_form_data/get/request_body/content/application_x_www_form_urlencoded/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_form_data/get/request_body/content/application_x_www_form_urlencoded/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_form_data/get/request_body/content/application_x_www_form_urlencoded/schema.py new file mode 100644 index 00000000000..ecbd7df9184 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_form_data/get/request_body/content/application_x_www_form_urlencoded/schema.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Schema( + schemas.DictSchema +): + + + class Schema_: + types = {frozendict.frozendict} + required = { + "param", + "param2", + } + + class Properties: + Param = schemas.StrSchema + Param2 = schemas.StrSchema + __annotations__ = { + "param": Param, + "param2": Param2, + } + + param: Schema_.Properties.Param + param2: Schema_.Properties.Param2 + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["param"]) -> Schema_.Properties.Param: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["param2"]) -> Schema_.Properties.Param2: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["param"], + typing_extensions.Literal["param2"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["param"]) -> Schema_.Properties.Param: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["param2"]) -> Schema_.Properties.Param2: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["param"], + typing_extensions.Literal["param2"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + param: typing.Union[Schema_.Properties.Param, str], + param2: typing.Union[Schema_.Properties.Param2, str], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'Schema': + return super().__new__( + cls, + *args_, + param=param, + param2=param2, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_form_data/get/responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_form_data/get/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_form_data/get/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_form_data/get/responses/response_200/__init__.py new file mode 100644 index 00000000000..60dc7cec19a --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_form_data/get/responses/response_200/__init__.py @@ -0,0 +1,11 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.responses import response_success_description_only +ResponseFor200 = response_success_description_only.SuccessDescriptionOnly diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_patch/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_patch/__init__.py new file mode 100644 index 00000000000..efe1a463518 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_patch/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from petstore_api.apis.paths.fake_json_patch import FakeJsonPatch + +path = "/fake/jsonPatch" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_patch/patch/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_patch/patch/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_patch/patch/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_patch/patch/operation.py new file mode 100644 index 00000000000..0ac5cea2f78 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_patch/patch/operation.py @@ -0,0 +1,375 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _json_patch( + self, + content_type: typing_extensions.Literal["application/json-patch+json"] = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json-patch+json"].schema, + schemas.Unset, + list, + tuple + ] = schemas.unset, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _json_patch( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json-patch+json"].schema, + schemas.Unset, + list, + tuple + ] = schemas.unset, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _json_patch( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json-patch+json"].schema, + schemas.Unset, + list, + tuple + ] = schemas.unset, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _json_patch( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json-patch+json"].schema, + schemas.Unset, + list, + tuple + ] = schemas.unset, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _json_patch( + self, + content_type: str = 'application/json-patch+json', + body: typing.Union[ + request_body.RequestBody.content["application/json-patch+json"].schema, + schemas.Unset, + list, + tuple + ] = schemas.unset, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + json patch + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + _fields = None + _body = None + if body is not schemas.unset: + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='patch', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class JsonPatch(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def json_patch( + self, + content_type: typing_extensions.Literal["application/json-patch+json"] = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json-patch+json"].schema, + schemas.Unset, + list, + tuple + ] = schemas.unset, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def json_patch( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json-patch+json"].schema, + schemas.Unset, + list, + tuple + ] = schemas.unset, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def json_patch( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json-patch+json"].schema, + schemas.Unset, + list, + tuple + ] = schemas.unset, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def json_patch( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json-patch+json"].schema, + schemas.Unset, + list, + tuple + ] = schemas.unset, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def json_patch( + self, + content_type: str = 'application/json-patch+json', + body: typing.Union[ + request_body.RequestBody.content["application/json-patch+json"].schema, + schemas.Unset, + list, + tuple + ] = schemas.unset, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._json_patch( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPatch(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def patch( + self, + content_type: typing_extensions.Literal["application/json-patch+json"] = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json-patch+json"].schema, + schemas.Unset, + list, + tuple + ] = schemas.unset, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def patch( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json-patch+json"].schema, + schemas.Unset, + list, + tuple + ] = schemas.unset, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def patch( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json-patch+json"].schema, + schemas.Unset, + list, + tuple + ] = schemas.unset, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def patch( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json-patch+json"].schema, + schemas.Unset, + list, + tuple + ] = schemas.unset, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def patch( + self, + content_type: str = 'application/json-patch+json', + body: typing.Union[ + request_body.RequestBody.content["application/json-patch+json"].schema, + schemas.Unset, + list, + tuple + ] = schemas.unset, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._json_patch( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_patch/patch/request_body/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_patch/patch/request_body/__init__.py new file mode 100644 index 00000000000..0f5233f978d --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_patch/patch/request_body/__init__.py @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client +from .content.application_json_patchjson import schema as application_json_patchjson_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonPatchjsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_patchjson_schema.Schema] = application_json_patchjson_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json-patch+json': typing.Type[__ApplicationJsonPatchjsonMediaType], + } + ) + content: __Content = { + 'application/json-patch+json': __ApplicationJsonPatchjsonMediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_patch/patch/request_body/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_patch/patch/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_patch/patch/request_body/content/application_json_patchjson/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_patch/patch/request_body/content/application_json_patchjson/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_patch/patch/request_body/content/application_json_patchjson/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_patch/patch/request_body/content/application_json_patchjson/schema.py new file mode 100644 index 00000000000..89f1d84248a --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_patch/patch/request_body/content/application_json_patchjson/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.schema import json_patch_request +Schema = json_patch_request.JSONPatchRequest diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_patch/patch/responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_patch/patch/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_patch/patch/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_patch/patch/responses/response_200/__init__.py new file mode 100644 index 00000000000..60dc7cec19a --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_patch/patch/responses/response_200/__init__.py @@ -0,0 +1,11 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.responses import response_success_description_only +ResponseFor200 = response_success_description_only.SuccessDescriptionOnly diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_with_charset/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_with_charset/__init__.py new file mode 100644 index 00000000000..ab62c3a90a4 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_with_charset/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from petstore_api.apis.paths.fake_json_with_charset import FakeJsonWithCharset + +path = "/fake/jsonWithCharset" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_with_charset/post/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_with_charset/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_with_charset/post/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_with_charset/post/operation.py new file mode 100644 index 00000000000..b1ab48c9603 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_with_charset/post/operation.py @@ -0,0 +1,609 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json; charset=utf-8", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _json_with_charset( + self, + content_type: typing_extensions.Literal["application/json; charset=utf-8"] = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json; charset=utf-8"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _json_with_charset( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json; charset=utf-8"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _json_with_charset( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json; charset=utf-8"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _json_with_charset( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json; charset=utf-8"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _json_with_charset( + self, + content_type: str = 'application/json; charset=utf-8', + body: typing.Union[ + request_body.RequestBody.content["application/json; charset=utf-8"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + json with charset tx and rx + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + _fields = None + _body = None + if body is not schemas.unset: + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class JsonWithCharset(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def json_with_charset( + self, + content_type: typing_extensions.Literal["application/json; charset=utf-8"] = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json; charset=utf-8"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def json_with_charset( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json; charset=utf-8"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def json_with_charset( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json; charset=utf-8"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def json_with_charset( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json; charset=utf-8"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def json_with_charset( + self, + content_type: str = 'application/json; charset=utf-8', + body: typing.Union[ + request_body.RequestBody.content["application/json; charset=utf-8"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._json_with_charset( + body=body, + content_type=content_type, + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + content_type: typing_extensions.Literal["application/json; charset=utf-8"] = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json; charset=utf-8"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json; charset=utf-8"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json; charset=utf-8"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json; charset=utf-8"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + content_type: str = 'application/json; charset=utf-8', + body: typing.Union[ + request_body.RequestBody.content["application/json; charset=utf-8"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._json_with_charset( + body=body, + content_type=content_type, + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_with_charset/post/request_body/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_with_charset/post/request_body/__init__.py new file mode 100644 index 00000000000..438943616fe --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_with_charset/post/request_body/__init__.py @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client +from .content.application_json_charsetutf8 import schema as application_json_charsetutf8_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonCharsetutf8MediaType(api_client.MediaType): + schema: typing.Type[application_json_charsetutf8_schema.Schema] = application_json_charsetutf8_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json; charset=utf-8': typing.Type[__ApplicationJsonCharsetutf8MediaType], + } + ) + content: __Content = { + 'application/json; charset=utf-8': __ApplicationJsonCharsetutf8MediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_with_charset/post/request_body/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_with_charset/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_with_charset/post/request_body/content/application_json_charsetutf8/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_with_charset/post/request_body/content/application_json_charsetutf8/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_with_charset/post/request_body/content/application_json_charsetutf8/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_with_charset/post/request_body/content/application_json_charsetutf8/schema.py new file mode 100644 index 00000000000..03b3f1d7666 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_with_charset/post/request_body/content/application_json_charsetutf8/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.AnyTypeSchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_with_charset/post/responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_with_charset/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_with_charset/post/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_with_charset/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..fcd145814bf --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_with_charset/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas +from .content.application_json_charsetutf8 import schema as application_json_charsetutf8_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_charsetutf8_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonCharsetutf8MediaType(api_client.MediaType): + schema: typing.Type[application_json_charsetutf8_schema.Schema] = application_json_charsetutf8_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json; charset=utf-8': typing.Type[__ApplicationJsonCharsetutf8MediaType], + } + ) + content: __Content = { + 'application/json; charset=utf-8': __ApplicationJsonCharsetutf8MediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_with_charset/post/responses/response_200/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_with_charset/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_with_charset/post/responses/response_200/content/application_json_charsetutf8/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_with_charset/post/responses/response_200/content/application_json_charsetutf8/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_with_charset/post/responses/response_200/content/application_json_charsetutf8/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_with_charset/post/responses/response_200/content/application_json_charsetutf8/schema.py new file mode 100644 index 00000000000..03b3f1d7666 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_with_charset/post/responses/response_200/content/application_json_charsetutf8/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.AnyTypeSchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_response_bodies/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_response_bodies/__init__.py new file mode 100644 index 00000000000..6f8c6b9e593 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_response_bodies/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from petstore_api.apis.paths.fake_multiple_response_bodies import FakeMultipleResponseBodies + +path = "/fake/multipleResponseBodies" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_response_bodies/get/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_response_bodies/get/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_response_bodies/get/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_response_bodies/get/operation.py new file mode 100644 index 00000000000..e2312d34df4 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_response_bodies/get/operation.py @@ -0,0 +1,262 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from .. import path +from .responses import ( + response_200, + response_202, +) + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + '202': typing.Type[response_202.ResponseFor202], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, + '202': response_202.ResponseFor202, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _multiple_response_bodies( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + response_202.ResponseFor202.response_cls, + ]: ... + + @typing.overload + def _multiple_response_bodies( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _multiple_response_bodies( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + response_202.ResponseFor202.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _multiple_response_bodies( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + multiple responses have response bodies + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='get', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + '202', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class MultipleResponseBodies(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def multiple_response_bodies( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + response_202.ResponseFor202.response_cls, + ]: ... + + @typing.overload + def multiple_response_bodies( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def multiple_response_bodies( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + response_202.ResponseFor202.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def multiple_response_bodies( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._multiple_response_bodies( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForGet(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def get( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + response_202.ResponseFor202.response_cls, + ]: ... + + @typing.overload + def get( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + response_202.ResponseFor202.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._multiple_response_bodies( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_response_bodies/get/responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_response_bodies/get/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_response_bodies/get/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_response_bodies/get/responses/response_200/__init__.py new file mode 100644 index 00000000000..60c9bf3cf80 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_response_bodies/get/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_response_bodies/get/responses/response_200/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_response_bodies/get/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_response_bodies/get/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_response_bodies/get/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_response_bodies/get/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_response_bodies/get/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..03b3f1d7666 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_response_bodies/get/responses/response_200/content/application_json/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.AnyTypeSchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_response_bodies/get/responses/response_202/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_response_bodies/get/responses/response_202/__init__.py new file mode 100644 index 00000000000..5582938ee1f --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_response_bodies/get/responses/response_202/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor202(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_response_bodies/get/responses/response_202/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_response_bodies/get/responses/response_202/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_response_bodies/get/responses/response_202/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_response_bodies/get/responses/response_202/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_response_bodies/get/responses/response_202/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_response_bodies/get/responses/response_202/content/application_json/schema.py new file mode 100644 index 00000000000..03b3f1d7666 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_response_bodies/get/responses/response_202/content/application_json/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.AnyTypeSchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_securities/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_securities/__init__.py new file mode 100644 index 00000000000..7e8bed81ecf --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_securities/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from petstore_api.apis.paths.fake_multiple_securities import FakeMultipleSecurities + +path = "/fake/multipleSecurities" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_securities/get/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_securities/get/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_securities/get/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_securities/get/operation.py new file mode 100644 index 00000000000..eccfdfa5d60 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_securities/get/operation.py @@ -0,0 +1,275 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions, security_schemes +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from .security import ( + security_requirement_object_0, + security_requirement_object_1, + security_requirement_object_2, +) + + +_security: typing.List[security_schemes.SecurityRequirementObject] = [ + security_requirement_object_0.security_requirement_object, + security_requirement_object_1.security_requirement_object, + security_requirement_object_2.security_requirement_object, +] + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _multiple_securities( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _multiple_securities( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _multiple_securities( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _multiple_securities( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + multiple security requirements + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + security_requirement_object = self.api_client.configuration.get_security_requirement_object( + 'paths/' + path + '/get/security', + _security, + security_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='get', + host=host, + headers=_headers, + security_requirement_object=security_requirement_object, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class MultipleSecurities(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def multiple_securities( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def multiple_securities( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def multiple_securities( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def multiple_securities( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._multiple_securities( + accept_content_types=accept_content_types, + security_index=security_index, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForGet(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def get( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def get( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._multiple_securities( + accept_content_types=accept_content_types, + security_index=security_index, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_securities/get/responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_securities/get/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_securities/get/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_securities/get/responses/response_200/__init__.py new file mode 100644 index 00000000000..60c9bf3cf80 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_securities/get/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_securities/get/responses/response_200/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_securities/get/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_securities/get/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_securities/get/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_securities/get/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_securities/get/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..03b3f1d7666 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_securities/get/responses/response_200/content/application_json/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.AnyTypeSchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_securities/get/security/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_securities/get/security/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_securities/get/security/security_requirement_object_0.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_securities/get/security/security_requirement_object_0.py new file mode 100644 index 00000000000..9885f295e5a --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_securities/get/security/security_requirement_object_0.py @@ -0,0 +1,12 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api import security_schemes + +security_requirement_object: security_schemes.SecurityRequirementObject = { +} diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_securities/get/security/security_requirement_object_1.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_securities/get/security/security_requirement_object_1.py new file mode 100644 index 00000000000..666c213f2a0 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_securities/get/security/security_requirement_object_1.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api import security_schemes + +security_requirement_object: security_schemes.SecurityRequirementObject = { + "http_basic_test": (), + "api_key": (), +} diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_securities/get/security/security_requirement_object_2.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_securities/get/security/security_requirement_object_2.py new file mode 100644 index 00000000000..3a74df60685 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_securities/get/security/security_requirement_object_2.py @@ -0,0 +1,13 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api import security_schemes + +security_requirement_object: security_schemes.SecurityRequirementObject = { + "petstore_auth": ("write:pets", "read:pets", ), +} diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_obj_in_query/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_obj_in_query/__init__.py new file mode 100644 index 00000000000..38e57254132 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_obj_in_query/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from petstore_api.apis.paths.fake_obj_in_query import FakeObjInQuery + +path = "/fake/objInQuery" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_obj_in_query/get/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_obj_in_query/get/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_obj_in_query/get/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_obj_in_query/get/operation.py new file mode 100644 index 00000000000..be9d1a8539f --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_obj_in_query/get/operation.py @@ -0,0 +1,269 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from petstore_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from .parameters import parameter_0 + + + +class RequestQueryParameters: + RequiredParams = typing_extensions.TypedDict( + 'RequiredParams', + { + } + ) + OptionalParams = typing_extensions.TypedDict( + 'OptionalParams', + { + 'mapBean': typing.Union[parameter_0.Parameter0.schema, dict, frozendict.frozendict], + }, + total=False + ) + + + class Params(RequiredParams, OptionalParams): + pass + + + parameters = [ + parameter_0.Parameter0, + ] + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _object_in_query( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _object_in_query( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _object_in_query( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _object_in_query( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + user list + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs(RequestQueryParameters.Params, query_params) + used_path = path + + prefix_separator_iterator = None + for parameter in RequestQueryParameters.parameters: + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + # TODO add cookie handling + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='get', + host=host, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class ObjectInQuery(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def object_in_query( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def object_in_query( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def object_in_query( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def object_in_query( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._object_in_query( + query_params=query_params, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForGet(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def get( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def get( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._object_in_query( + query_params=query_params, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_obj_in_query/get/parameters/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_obj_in_query/get/parameters/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_obj_in_query/get/parameters/parameter_0/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_obj_in_query/get/parameters/parameter_0/__init__.py new file mode 100644 index 00000000000..e14e80915ff --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_obj_in_query/get/parameters/parameter_0/__init__.py @@ -0,0 +1,21 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client + +from . import schema + + +class Parameter0(api_client.QueryParameter): + name = "mapBean" + style=api_client.ParameterStyle.DEEP_OBJECT + schema = schema.Schema + explode = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_obj_in_query/get/parameters/parameter_0/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_obj_in_query/get/parameters/parameter_0/schema.py new file mode 100644 index 00000000000..1b18c38ca91 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_obj_in_query/get/parameters/parameter_0/schema.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Schema( + schemas.DictSchema +): + + + class Schema_: + types = {frozendict.frozendict} + + class Properties: + Keyword = schemas.StrSchema + __annotations__ = { + "keyword": Keyword, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["keyword"]) -> Schema_.Properties.Keyword: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["keyword"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["keyword"]) -> typing.Union[Schema_.Properties.Keyword, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["keyword"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + keyword: typing.Union[Schema_.Properties.Keyword, str, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'Schema': + return super().__new__( + cls, + *args_, + keyword=keyword, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_obj_in_query/get/responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_obj_in_query/get/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_obj_in_query/get/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_obj_in_query/get/responses/response_200/__init__.py new file mode 100644 index 00000000000..60dc7cec19a --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_obj_in_query/get/responses/response_200/__init__.py @@ -0,0 +1,11 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.responses import response_success_description_only +ResponseFor200 = response_success_description_only.SuccessDescriptionOnly diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/__init__.py new file mode 100644 index 00000000000..96d88c66720 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from petstore_api.apis.paths.fake_parameter_collisions1_abab_self_ab import FakeParameterCollisions1ABAbSelfAB + +path = "/fake/parameterCollisions/{1}/{aB}/{Ab}/{self}/{A-B}/" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/operation.py new file mode 100644 index 00000000000..5b174e99ada --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/operation.py @@ -0,0 +1,852 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body +from .parameters import ( + parameter_0, + parameter_1, + parameter_2, + parameter_3, + parameter_4, + parameter_5, + parameter_6, + parameter_7, + parameter_8, + parameter_9, + parameter_10, + parameter_11, + parameter_12, + parameter_13, + parameter_14, + parameter_15, + parameter_16, + parameter_17, + parameter_18, +) + + + +class RequestQueryParameters: + RequiredParams = typing_extensions.TypedDict( + 'RequiredParams', + { + } + ) + OptionalParams = typing_extensions.TypedDict( + 'OptionalParams', + { + '1': typing.Union[parameter_0.Parameter0.schema, str], + 'aB': typing.Union[parameter_1.Parameter1.schema, str], + 'Ab': typing.Union[parameter_2.Parameter2.schema, str], + 'self': typing.Union[parameter_3.Parameter3.schema, str], + 'A-B': typing.Union[parameter_4.Parameter4.schema, str], + }, + total=False + ) + + + class Params(RequiredParams, OptionalParams): + pass + + + parameters = [ + parameter_0.Parameter0, + parameter_1.Parameter1, + parameter_2.Parameter2, + parameter_3.Parameter3, + parameter_4.Parameter4, + ] + +class RequestHeaderParameters: + RequiredParams = typing_extensions.TypedDict( + 'RequiredParams', + { + } + ) + OptionalParams = typing_extensions.TypedDict( + 'OptionalParams', + { + '1': typing.Union[parameter_5.Parameter5.schema, str], + 'aB': typing.Union[parameter_6.Parameter6.schema, str], + 'self': typing.Union[parameter_7.Parameter7.schema, str], + 'A-B': typing.Union[parameter_8.Parameter8.schema, str], + }, + total=False + ) + + + class Params(RequiredParams, OptionalParams): + pass + + + parameters = [ + parameter_5.Parameter5, + parameter_6.Parameter6, + parameter_7.Parameter7, + parameter_8.Parameter8, + ] + +class RequestPathParameters: + RequiredParams = typing_extensions.TypedDict( + 'RequiredParams', + { + '1': typing.Union[parameter_9.Parameter9.schema, str], + 'aB': typing.Union[parameter_10.Parameter10.schema, str], + 'Ab': typing.Union[parameter_11.Parameter11.schema, str], + 'self': typing.Union[parameter_12.Parameter12.schema, str], + 'A-B': typing.Union[parameter_13.Parameter13.schema, str], + } + ) + OptionalParams = typing_extensions.TypedDict( + 'OptionalParams', + { + }, + total=False + ) + + + class Params(RequiredParams, OptionalParams): + pass + + + parameters = [ + parameter_9.Parameter9, + parameter_10.Parameter10, + parameter_11.Parameter11, + parameter_12.Parameter12, + parameter_13.Parameter13, + ] + +class RequestCookieParameters: + RequiredParams = typing_extensions.TypedDict( + 'RequiredParams', + { + } + ) + OptionalParams = typing_extensions.TypedDict( + 'OptionalParams', + { + '1': typing.Union[parameter_14.Parameter14.schema, str], + 'aB': typing.Union[parameter_15.Parameter15.schema, str], + 'Ab': typing.Union[parameter_16.Parameter16.schema, str], + 'self': typing.Union[parameter_17.Parameter17.schema, str], + 'A-B': typing.Union[parameter_18.Parameter18.schema, str], + }, + total=False + ) + + + class Params(RequiredParams, OptionalParams): + pass + + + parameters = [ + parameter_14.Parameter14, + parameter_15.Parameter15, + parameter_16.Parameter16, + parameter_17.Parameter17, + parameter_18.Parameter18, + ] + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _parameter_collisions( + self, + content_type: typing_extensions.Literal["application/json"] = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + header_params: RequestHeaderParameters.Params = frozendict.frozendict(), + path_params: RequestPathParameters.Params = frozendict.frozendict(), + cookie_params: RequestCookieParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _parameter_collisions( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + header_params: RequestHeaderParameters.Params = frozendict.frozendict(), + path_params: RequestPathParameters.Params = frozendict.frozendict(), + cookie_params: RequestCookieParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _parameter_collisions( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + header_params: RequestHeaderParameters.Params = frozendict.frozendict(), + path_params: RequestPathParameters.Params = frozendict.frozendict(), + cookie_params: RequestCookieParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _parameter_collisions( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + header_params: RequestHeaderParameters.Params = frozendict.frozendict(), + path_params: RequestPathParameters.Params = frozendict.frozendict(), + cookie_params: RequestCookieParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _parameter_collisions( + self, + content_type: str = 'application/json', + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + header_params: RequestHeaderParameters.Params = frozendict.frozendict(), + path_params: RequestPathParameters.Params = frozendict.frozendict(), + cookie_params: RequestCookieParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + parameter collision case + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs(RequestQueryParameters.Params, query_params) + self._verify_typed_dict_inputs(RequestHeaderParameters.Params, header_params) + self._verify_typed_dict_inputs(RequestPathParameters.Params, path_params) + self._verify_typed_dict_inputs(RequestCookieParameters.Params, cookie_params) + used_path = path + + _path_params = {} + for parameter in RequestPathParameters.parameters: + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + + prefix_separator_iterator = None + for parameter in RequestQueryParameters.parameters: + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + + _headers = HTTPHeaderDict() + for parameter in RequestHeaderParameters.parameters: + parameter_data = header_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _headers.extend(serialized_data) + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + _fields = None + _body = None + if body is not schemas.unset: + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class ParameterCollisions(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def parameter_collisions( + self, + content_type: typing_extensions.Literal["application/json"] = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + header_params: RequestHeaderParameters.Params = frozendict.frozendict(), + path_params: RequestPathParameters.Params = frozendict.frozendict(), + cookie_params: RequestCookieParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def parameter_collisions( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + header_params: RequestHeaderParameters.Params = frozendict.frozendict(), + path_params: RequestPathParameters.Params = frozendict.frozendict(), + cookie_params: RequestCookieParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def parameter_collisions( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + header_params: RequestHeaderParameters.Params = frozendict.frozendict(), + path_params: RequestPathParameters.Params = frozendict.frozendict(), + cookie_params: RequestCookieParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def parameter_collisions( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + header_params: RequestHeaderParameters.Params = frozendict.frozendict(), + path_params: RequestPathParameters.Params = frozendict.frozendict(), + cookie_params: RequestCookieParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def parameter_collisions( + self, + content_type: str = 'application/json', + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + header_params: RequestHeaderParameters.Params = frozendict.frozendict(), + path_params: RequestPathParameters.Params = frozendict.frozendict(), + cookie_params: RequestCookieParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._parameter_collisions( + body=body, + query_params=query_params, + header_params=header_params, + path_params=path_params, + cookie_params=cookie_params, + content_type=content_type, + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + content_type: typing_extensions.Literal["application/json"] = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + header_params: RequestHeaderParameters.Params = frozendict.frozendict(), + path_params: RequestPathParameters.Params = frozendict.frozendict(), + cookie_params: RequestCookieParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + header_params: RequestHeaderParameters.Params = frozendict.frozendict(), + path_params: RequestPathParameters.Params = frozendict.frozendict(), + cookie_params: RequestCookieParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + header_params: RequestHeaderParameters.Params = frozendict.frozendict(), + path_params: RequestPathParameters.Params = frozendict.frozendict(), + cookie_params: RequestCookieParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + header_params: RequestHeaderParameters.Params = frozendict.frozendict(), + path_params: RequestPathParameters.Params = frozendict.frozendict(), + cookie_params: RequestCookieParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + content_type: str = 'application/json', + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + header_params: RequestHeaderParameters.Params = frozendict.frozendict(), + path_params: RequestPathParameters.Params = frozendict.frozendict(), + cookie_params: RequestCookieParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._parameter_collisions( + body=body, + query_params=query_params, + header_params=header_params, + path_params=path_params, + cookie_params=cookie_params, + content_type=content_type, + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_0/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_0/__init__.py new file mode 100644 index 00000000000..10333d70ed8 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_0/__init__.py @@ -0,0 +1,21 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client + +from . import schema + + +class Parameter0(api_client.QueryParameter): + name = "1" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + explode = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_0/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_0/schema.py new file mode 100644 index 00000000000..0518c0e6e64 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_0/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.StrSchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_1/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_1/__init__.py new file mode 100644 index 00000000000..6bfa40b178c --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_1/__init__.py @@ -0,0 +1,21 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client + +from . import schema + + +class Parameter1(api_client.QueryParameter): + name = "aB" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + explode = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_1/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_1/schema.py new file mode 100644 index 00000000000..0518c0e6e64 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_1/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.StrSchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_10/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_10/__init__.py new file mode 100644 index 00000000000..ed5f60c41cd --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_10/__init__.py @@ -0,0 +1,21 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client + +from . import schema + + +class Parameter10(api_client.PathParameter): + name = "aB" + style = api_client.ParameterStyle.SIMPLE + schema = schema.Schema + required = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_10/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_10/schema.py new file mode 100644 index 00000000000..0518c0e6e64 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_10/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.StrSchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_11/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_11/__init__.py new file mode 100644 index 00000000000..70d9f0e162b --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_11/__init__.py @@ -0,0 +1,21 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client + +from . import schema + + +class Parameter11(api_client.PathParameter): + name = "Ab" + style = api_client.ParameterStyle.SIMPLE + schema = schema.Schema + required = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_11/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_11/schema.py new file mode 100644 index 00000000000..0518c0e6e64 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_11/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.StrSchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_12/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_12/__init__.py new file mode 100644 index 00000000000..a34866108f8 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_12/__init__.py @@ -0,0 +1,21 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client + +from . import schema + + +class Parameter12(api_client.PathParameter): + name = "self" + style = api_client.ParameterStyle.SIMPLE + schema = schema.Schema + required = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_12/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_12/schema.py new file mode 100644 index 00000000000..0518c0e6e64 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_12/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.StrSchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_13/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_13/__init__.py new file mode 100644 index 00000000000..3adc8c175f6 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_13/__init__.py @@ -0,0 +1,21 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client + +from . import schema + + +class Parameter13(api_client.PathParameter): + name = "A-B" + style = api_client.ParameterStyle.SIMPLE + schema = schema.Schema + required = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_13/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_13/schema.py new file mode 100644 index 00000000000..0518c0e6e64 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_13/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.StrSchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_14/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_14/__init__.py new file mode 100644 index 00000000000..d2c2d5c70d6 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_14/__init__.py @@ -0,0 +1,21 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client + +from . import schema + + +class Parameter14(api_client.CookieParameter): + name = "1" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + explode = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_14/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_14/schema.py new file mode 100644 index 00000000000..0518c0e6e64 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_14/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.StrSchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_15/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_15/__init__.py new file mode 100644 index 00000000000..cbf4331f464 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_15/__init__.py @@ -0,0 +1,21 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client + +from . import schema + + +class Parameter15(api_client.CookieParameter): + name = "aB" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + explode = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_15/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_15/schema.py new file mode 100644 index 00000000000..0518c0e6e64 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_15/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.StrSchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_16/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_16/__init__.py new file mode 100644 index 00000000000..b8c9788dbbf --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_16/__init__.py @@ -0,0 +1,21 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client + +from . import schema + + +class Parameter16(api_client.CookieParameter): + name = "Ab" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + explode = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_16/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_16/schema.py new file mode 100644 index 00000000000..0518c0e6e64 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_16/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.StrSchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_17/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_17/__init__.py new file mode 100644 index 00000000000..3a1de44b74d --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_17/__init__.py @@ -0,0 +1,21 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client + +from . import schema + + +class Parameter17(api_client.CookieParameter): + name = "self" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + explode = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_17/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_17/schema.py new file mode 100644 index 00000000000..0518c0e6e64 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_17/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.StrSchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_18/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_18/__init__.py new file mode 100644 index 00000000000..d0be5b2e303 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_18/__init__.py @@ -0,0 +1,21 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client + +from . import schema + + +class Parameter18(api_client.CookieParameter): + name = "A-B" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + explode = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_18/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_18/schema.py new file mode 100644 index 00000000000..0518c0e6e64 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_18/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.StrSchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_2/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_2/__init__.py new file mode 100644 index 00000000000..19d920fee5d --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_2/__init__.py @@ -0,0 +1,21 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client + +from . import schema + + +class Parameter2(api_client.QueryParameter): + name = "Ab" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + explode = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_2/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_2/schema.py new file mode 100644 index 00000000000..0518c0e6e64 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_2/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.StrSchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_3/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_3/__init__.py new file mode 100644 index 00000000000..0b5812d71de --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_3/__init__.py @@ -0,0 +1,21 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client + +from . import schema + + +class Parameter3(api_client.QueryParameter): + name = "self" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + explode = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_3/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_3/schema.py new file mode 100644 index 00000000000..0518c0e6e64 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_3/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.StrSchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_4/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_4/__init__.py new file mode 100644 index 00000000000..5b1db867417 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_4/__init__.py @@ -0,0 +1,21 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client + +from . import schema + + +class Parameter4(api_client.QueryParameter): + name = "A-B" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + explode = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_4/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_4/schema.py new file mode 100644 index 00000000000..0518c0e6e64 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_4/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.StrSchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_5/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_5/__init__.py new file mode 100644 index 00000000000..90732a16ec3 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_5/__init__.py @@ -0,0 +1,20 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client + +from . import schema + + +class Parameter5(api_client.HeaderParameter): + name = "1" + style = api_client.ParameterStyle.SIMPLE + schema = schema.Schema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_5/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_5/schema.py new file mode 100644 index 00000000000..0518c0e6e64 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_5/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.StrSchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_6/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_6/__init__.py new file mode 100644 index 00000000000..b97c12fcad2 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_6/__init__.py @@ -0,0 +1,20 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client + +from . import schema + + +class Parameter6(api_client.HeaderParameter): + name = "aB" + style = api_client.ParameterStyle.SIMPLE + schema = schema.Schema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_6/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_6/schema.py new file mode 100644 index 00000000000..0518c0e6e64 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_6/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.StrSchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_7/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_7/__init__.py new file mode 100644 index 00000000000..f33a53d9a20 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_7/__init__.py @@ -0,0 +1,20 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client + +from . import schema + + +class Parameter7(api_client.HeaderParameter): + name = "self" + style = api_client.ParameterStyle.SIMPLE + schema = schema.Schema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_7/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_7/schema.py new file mode 100644 index 00000000000..0518c0e6e64 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_7/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.StrSchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_8/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_8/__init__.py new file mode 100644 index 00000000000..34e8b583617 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_8/__init__.py @@ -0,0 +1,20 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client + +from . import schema + + +class Parameter8(api_client.HeaderParameter): + name = "A-B" + style = api_client.ParameterStyle.SIMPLE + schema = schema.Schema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_8/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_8/schema.py new file mode 100644 index 00000000000..0518c0e6e64 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_8/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.StrSchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_9/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_9/__init__.py new file mode 100644 index 00000000000..045ca4c270b --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_9/__init__.py @@ -0,0 +1,21 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client + +from . import schema + + +class Parameter9(api_client.PathParameter): + name = "1" + style = api_client.ParameterStyle.SIMPLE + schema = schema.Schema + required = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_9/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_9/schema.py new file mode 100644 index 00000000000..0518c0e6e64 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameters/parameter_9/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.StrSchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/request_body/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/request_body/__init__.py new file mode 100644 index 00000000000..b4604475a48 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/request_body/__init__.py @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/request_body/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/request_body/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..03b3f1d7666 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/request_body/content/application_json/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.AnyTypeSchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..60c9bf3cf80 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/responses/response_200/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..03b3f1d7666 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.AnyTypeSchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/__init__.py new file mode 100644 index 00000000000..b700e47746f --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from petstore_api.apis.paths.fake_pet_id_upload_image_with_required_file import FakePetIdUploadImageWithRequiredFile + +path = "/fake/{petId}/uploadImageWithRequiredFile" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/operation.py new file mode 100644 index 00000000000..1135c5b1ea6 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/operation.py @@ -0,0 +1,480 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions, security_schemes +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body +from .parameters import parameter_0 +from .security import security_requirement_object_0 + + + +class RequestPathParameters: + RequiredParams = typing_extensions.TypedDict( + 'RequiredParams', + { + 'petId': typing.Union[parameter_0.Parameter0.schema, decimal.Decimal, int], + } + ) + OptionalParams = typing_extensions.TypedDict( + 'OptionalParams', + { + }, + total=False + ) + + + class Params(RequiredParams, OptionalParams): + pass + + + parameters = [ + parameter_0.Parameter0, + ] +_security: typing.List[security_schemes.SecurityRequirementObject] = [ + security_requirement_object_0.security_requirement_object, +] + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _upload_file_with_required_file( + self, + content_type: typing_extensions.Literal["multipart/form-data"] = ..., + body: typing.Union[ + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _upload_file_with_required_file( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _upload_file_with_required_file( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _upload_file_with_required_file( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _upload_file_with_required_file( + self, + content_type: str = 'multipart/form-data', + body: typing.Union[ + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + uploads an image (required) + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs(RequestPathParameters.Params, path_params) + used_path = path + + _path_params = {} + for parameter in RequestPathParameters.parameters: + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + _fields = None + _body = None + if body is not schemas.unset: + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + security_requirement_object = self.api_client.configuration.get_security_requirement_object( + 'paths/' + path + '/post/security', + _security, + security_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + security_requirement_object=security_requirement_object, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class UploadFileWithRequiredFile(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def upload_file_with_required_file( + self, + content_type: typing_extensions.Literal["multipart/form-data"] = ..., + body: typing.Union[ + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def upload_file_with_required_file( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def upload_file_with_required_file( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def upload_file_with_required_file( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def upload_file_with_required_file( + self, + content_type: str = 'multipart/form-data', + body: typing.Union[ + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._upload_file_with_required_file( + body=body, + path_params=path_params, + content_type=content_type, + accept_content_types=accept_content_types, + security_index=security_index, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + content_type: typing_extensions.Literal["multipart/form-data"] = ..., + body: typing.Union[ + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + content_type: str = 'multipart/form-data', + body: typing.Union[ + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._upload_file_with_required_file( + body=body, + path_params=path_params, + content_type=content_type, + accept_content_types=accept_content_types, + security_index=security_index, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/parameters/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/parameters/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/parameters/parameter_0/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/parameters/parameter_0/__init__.py new file mode 100644 index 00000000000..bdb481da5c2 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/parameters/parameter_0/__init__.py @@ -0,0 +1,21 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client + +from . import schema + + +class Parameter0(api_client.PathParameter): + name = "petId" + style = api_client.ParameterStyle.SIMPLE + schema = schema.Schema + required = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/parameters/parameter_0/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/parameters/parameter_0/schema.py new file mode 100644 index 00000000000..77eefe64028 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/parameters/parameter_0/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.Int64Schema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/request_body/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/request_body/__init__.py new file mode 100644 index 00000000000..528cb05ef27 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/request_body/__init__.py @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client +from .content.multipart_form_data import schema as multipart_form_data_schema + +class RequestBody(api_client.RequestBody): + + + class __MultipartFormDataMediaType(api_client.MediaType): + schema: typing.Type[multipart_form_data_schema.Schema] = multipart_form_data_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'multipart/form-data': typing.Type[__MultipartFormDataMediaType], + } + ) + content: __Content = { + 'multipart/form-data': __MultipartFormDataMediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/request_body/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/request_body/content/multipart_form_data/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/request_body/content/multipart_form_data/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/request_body/content/multipart_form_data/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/request_body/content/multipart_form_data/schema.py new file mode 100644 index 00000000000..15e7030b269 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/request_body/content/multipart_form_data/schema.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Schema( + schemas.DictSchema +): + + + class Schema_: + types = {frozendict.frozendict} + required = { + "requiredFile", + } + + class Properties: + AdditionalMetadata = schemas.StrSchema + RequiredFile = schemas.BinarySchema + __annotations__ = { + "additionalMetadata": AdditionalMetadata, + "requiredFile": RequiredFile, + } + + requiredFile: Schema_.Properties.RequiredFile + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["requiredFile"]) -> Schema_.Properties.RequiredFile: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["additionalMetadata"]) -> Schema_.Properties.AdditionalMetadata: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["requiredFile"], + typing_extensions.Literal["additionalMetadata"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["requiredFile"]) -> Schema_.Properties.RequiredFile: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["additionalMetadata"]) -> typing.Union[Schema_.Properties.AdditionalMetadata, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["requiredFile"], + typing_extensions.Literal["additionalMetadata"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + requiredFile: typing.Union[Schema_.Properties.RequiredFile, bytes, io.FileIO, io.BufferedReader], + additionalMetadata: typing.Union[Schema_.Properties.AdditionalMetadata, str, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'Schema': + return super().__new__( + cls, + *args_, + requiredFile=requiredFile, + additionalMetadata=additionalMetadata, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..60c9bf3cf80 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/responses/response_200/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..38685cadefa --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.schema import api_response +Schema = api_response.ApiResponse diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/security/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/security/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/security/security_requirement_object_0.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/security/security_requirement_object_0.py new file mode 100644 index 00000000000..3a74df60685 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/security/security_requirement_object_0.py @@ -0,0 +1,13 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api import security_schemes + +security_requirement_object: security_schemes.SecurityRequirementObject = { + "petstore_auth": ("write:pets", "read:pets", ), +} diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_query_param_with_json_content_type/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_query_param_with_json_content_type/__init__.py new file mode 100644 index 00000000000..a4241220ae1 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_query_param_with_json_content_type/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from petstore_api.apis.paths.fake_query_param_with_json_content_type import FakeQueryParamWithJsonContentType + +path = "/fake/queryParamWithJsonContentType" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_query_param_with_json_content_type/get/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_query_param_with_json_content_type/get/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_query_param_with_json_content_type/get/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_query_param_with_json_content_type/get/operation.py new file mode 100644 index 00000000000..6e381b045d4 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_query_param_with_json_content_type/get/operation.py @@ -0,0 +1,294 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from .parameters import parameter_0 + + + +class RequestQueryParameters: + RequiredParams = typing_extensions.TypedDict( + 'RequiredParams', + { + 'someParam': typing.Union[parameter_0.Parameter0.content["application/json"].schema, dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + } + ) + OptionalParams = typing_extensions.TypedDict( + 'OptionalParams', + { + }, + total=False + ) + + + class Params(RequiredParams, OptionalParams): + pass + + + parameters = [ + parameter_0.Parameter0, + ] + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _query_param_with_json_content_type( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _query_param_with_json_content_type( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _query_param_with_json_content_type( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _query_param_with_json_content_type( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + query param with json content-type + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs(RequestQueryParameters.Params, query_params) + used_path = path + + prefix_separator_iterator = None + for parameter in RequestQueryParameters.parameters: + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='get', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class QueryParamWithJsonContentType(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def query_param_with_json_content_type( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def query_param_with_json_content_type( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def query_param_with_json_content_type( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def query_param_with_json_content_type( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._query_param_with_json_content_type( + query_params=query_params, + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForGet(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def get( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def get( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._query_param_with_json_content_type( + query_params=query_params, + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_query_param_with_json_content_type/get/parameters/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_query_param_with_json_content_type/get/parameters/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_query_param_with_json_content_type/get/parameters/parameter_0/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_query_param_with_json_content_type/get/parameters/parameter_0/__init__.py new file mode 100644 index 00000000000..d6d9e6d9a3b --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_query_param_with_json_content_type/get/parameters/parameter_0/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client + +from .content.application_json import schema as application_json_schema + + +class Parameter0(api_client.QueryParameter): + name = "someParam" + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_query_param_with_json_content_type/get/parameters/parameter_0/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_query_param_with_json_content_type/get/parameters/parameter_0/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_query_param_with_json_content_type/get/parameters/parameter_0/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_query_param_with_json_content_type/get/parameters/parameter_0/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_query_param_with_json_content_type/get/parameters/parameter_0/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_query_param_with_json_content_type/get/parameters/parameter_0/content/application_json/schema.py new file mode 100644 index 00000000000..03b3f1d7666 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_query_param_with_json_content_type/get/parameters/parameter_0/content/application_json/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.AnyTypeSchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_query_param_with_json_content_type/get/responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_query_param_with_json_content_type/get/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_query_param_with_json_content_type/get/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_query_param_with_json_content_type/get/responses/response_200/__init__.py new file mode 100644 index 00000000000..60c9bf3cf80 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_query_param_with_json_content_type/get/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_query_param_with_json_content_type/get/responses/response_200/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_query_param_with_json_content_type/get/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_query_param_with_json_content_type/get/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_query_param_with_json_content_type/get/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_query_param_with_json_content_type/get/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_query_param_with_json_content_type/get/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..03b3f1d7666 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_query_param_with_json_content_type/get/responses/response_200/content/application_json/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.AnyTypeSchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_redirection/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_redirection/__init__.py new file mode 100644 index 00000000000..1f9d1b25459 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_redirection/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from petstore_api.apis.paths.fake_redirection import FakeRedirection + +path = "/fake/redirection" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_redirection/get/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_redirection/get/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_redirection/get/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_redirection/get/operation.py new file mode 100644 index 00000000000..e52f7795455 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_redirection/get/operation.py @@ -0,0 +1,250 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from petstore_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from .. import path +from .responses import ( + response_303, + response_3xx, +) + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '303': typing.Type[response_303.ResponseFor303], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '303': response_303.ResponseFor303, +} +__RangedStatusCodeToResponse = typing_extensions.TypedDict( + '__RangedStatusCodeToResponse', + { + '3': typing.Type[response_3xx.ResponseFor3XX], + } +) +_ranged_status_code_to_response: __RangedStatusCodeToResponse = { + '3': response_3xx.ResponseFor3XX, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _redirection( + self, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + response_3xx.ResponseFor3XX.response_cls, + response_303.ResponseFor303.response_cls, + ]: ... + + @typing.overload + def _redirection( + self, + skip_deserialization: typing_extensions.Literal[True], + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _redirection( + self, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_3xx.ResponseFor3XX.response_cls, + response_303.ResponseFor303.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _redirection( + self, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + operation with redirection responses + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + # TODO add cookie handling + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='get', + host=host, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + ranged_response_status_code = status[0] + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '303', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + elif ranged_response_status_code in _ranged_status_code_to_response: + ranged_response_status_code: typing_extensions.Literal[ + '3', + ] + api_response = _ranged_status_code_to_response[ranged_response_status_code].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class Redirection(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def redirection( + self, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + response_3xx.ResponseFor3XX.response_cls, + response_303.ResponseFor303.response_cls, + ]: ... + + @typing.overload + def redirection( + self, + skip_deserialization: typing_extensions.Literal[True], + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def redirection( + self, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_3xx.ResponseFor3XX.response_cls, + response_303.ResponseFor303.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def redirection( + self, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._redirection( + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForGet(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def get( + self, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + response_3xx.ResponseFor3XX.response_cls, + response_303.ResponseFor303.response_cls, + ]: ... + + @typing.overload + def get( + self, + skip_deserialization: typing_extensions.Literal[True], + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get( + self, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_3xx.ResponseFor3XX.response_cls, + response_303.ResponseFor303.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get( + self, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._redirection( + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_redirection/get/responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_redirection/get/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_redirection/get/responses/response_303/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_redirection/get/responses/response_303/__init__.py new file mode 100644 index 00000000000..c29ae74f89b --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_redirection/get/responses/response_303/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor303(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_redirection/get/responses/response_3xx/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_redirection/get/responses/response_3xx/__init__.py new file mode 100644 index 00000000000..b82582cfad8 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_redirection/get/responses/response_3xx/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor3XX(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_ref_obj_in_query/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_ref_obj_in_query/__init__.py new file mode 100644 index 00000000000..c9be91e44ad --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_ref_obj_in_query/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from petstore_api.apis.paths.fake_ref_obj_in_query import FakeRefObjInQuery + +path = "/fake/refObjInQuery" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_ref_obj_in_query/get/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_ref_obj_in_query/get/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_ref_obj_in_query/get/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_ref_obj_in_query/get/operation.py new file mode 100644 index 00000000000..653d5df5227 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_ref_obj_in_query/get/operation.py @@ -0,0 +1,269 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from petstore_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from .parameters import parameter_0 + + + +class RequestQueryParameters: + RequiredParams = typing_extensions.TypedDict( + 'RequiredParams', + { + } + ) + OptionalParams = typing_extensions.TypedDict( + 'OptionalParams', + { + 'mapBean': typing.Union[parameter_0.Parameter0.schema, dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + }, + total=False + ) + + + class Params(RequiredParams, OptionalParams): + pass + + + parameters = [ + parameter_0.Parameter0, + ] + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _ref_object_in_query( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _ref_object_in_query( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _ref_object_in_query( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _ref_object_in_query( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + user list + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs(RequestQueryParameters.Params, query_params) + used_path = path + + prefix_separator_iterator = None + for parameter in RequestQueryParameters.parameters: + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + # TODO add cookie handling + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='get', + host=host, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class RefObjectInQuery(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def ref_object_in_query( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def ref_object_in_query( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def ref_object_in_query( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def ref_object_in_query( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._ref_object_in_query( + query_params=query_params, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForGet(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def get( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def get( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._ref_object_in_query( + query_params=query_params, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_ref_obj_in_query/get/parameters/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_ref_obj_in_query/get/parameters/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_ref_obj_in_query/get/parameters/parameter_0/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_ref_obj_in_query/get/parameters/parameter_0/__init__.py new file mode 100644 index 00000000000..e14e80915ff --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_ref_obj_in_query/get/parameters/parameter_0/__init__.py @@ -0,0 +1,21 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client + +from . import schema + + +class Parameter0(api_client.QueryParameter): + name = "mapBean" + style=api_client.ParameterStyle.DEEP_OBJECT + schema = schema.Schema + explode = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_ref_obj_in_query/get/parameters/parameter_0/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_ref_obj_in_query/get/parameters/parameter_0/schema.py new file mode 100644 index 00000000000..c6b54a96feb --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_ref_obj_in_query/get/parameters/parameter_0/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.schema import foo +Schema = foo.Foo diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_ref_obj_in_query/get/responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_ref_obj_in_query/get/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_ref_obj_in_query/get/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_ref_obj_in_query/get/responses/response_200/__init__.py new file mode 100644 index 00000000000..60dc7cec19a --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_ref_obj_in_query/get/responses/response_200/__init__.py @@ -0,0 +1,11 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.responses import response_success_description_only +ResponseFor200 = response_success_description_only.SuccessDescriptionOnly diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_array_of_enums/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_array_of_enums/__init__.py new file mode 100644 index 00000000000..9cd0c3e3c5f --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_array_of_enums/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from petstore_api.apis.paths.fake_refs_array_of_enums import FakeRefsArrayOfEnums + +path = "/fake/refs/array-of-enums" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_array_of_enums/post/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_array_of_enums/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_array_of_enums/post/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_array_of_enums/post/operation.py new file mode 100644 index 00000000000..c138154fd18 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_array_of_enums/post/operation.py @@ -0,0 +1,399 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _array_of_enums( + self, + content_type: typing_extensions.Literal["application/json"] = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + list, + tuple + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _array_of_enums( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + list, + tuple + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _array_of_enums( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + list, + tuple + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _array_of_enums( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + list, + tuple + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _array_of_enums( + self, + content_type: str = 'application/json', + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + list, + tuple + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + Array of Enums + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + _fields = None + _body = None + if body is not schemas.unset: + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class ArrayOfEnums(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def array_of_enums( + self, + content_type: typing_extensions.Literal["application/json"] = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + list, + tuple + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def array_of_enums( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + list, + tuple + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def array_of_enums( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + list, + tuple + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def array_of_enums( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + list, + tuple + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def array_of_enums( + self, + content_type: str = 'application/json', + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + list, + tuple + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._array_of_enums( + body=body, + content_type=content_type, + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + content_type: typing_extensions.Literal["application/json"] = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + list, + tuple + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + list, + tuple + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + list, + tuple + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + list, + tuple + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + content_type: str = 'application/json', + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + list, + tuple + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._array_of_enums( + body=body, + content_type=content_type, + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_array_of_enums/post/request_body/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_array_of_enums/post/request_body/__init__.py new file mode 100644 index 00000000000..b4604475a48 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_array_of_enums/post/request_body/__init__.py @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_array_of_enums/post/request_body/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_array_of_enums/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_array_of_enums/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_array_of_enums/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_array_of_enums/post/request_body/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_array_of_enums/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..fbba160e3df --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_array_of_enums/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.schema import array_of_enums +Schema = array_of_enums.ArrayOfEnums diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_array_of_enums/post/responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_array_of_enums/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_array_of_enums/post/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_array_of_enums/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..60c9bf3cf80 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_array_of_enums/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_array_of_enums/post/responses/response_200/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_array_of_enums/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_array_of_enums/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_array_of_enums/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_array_of_enums/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_array_of_enums/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..fbba160e3df --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_array_of_enums/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.schema import array_of_enums +Schema = array_of_enums.ArrayOfEnums diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_arraymodel/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_arraymodel/__init__.py new file mode 100644 index 00000000000..aaea81c6447 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_arraymodel/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from petstore_api.apis.paths.fake_refs_arraymodel import FakeRefsArraymodel + +path = "/fake/refs/arraymodel" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_arraymodel/post/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_arraymodel/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_arraymodel/post/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_arraymodel/post/operation.py new file mode 100644 index 00000000000..125b6716d34 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_arraymodel/post/operation.py @@ -0,0 +1,398 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _array_model( + self, + content_type: typing_extensions.Literal["application/json"] = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + list, + tuple + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _array_model( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + list, + tuple + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _array_model( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + list, + tuple + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _array_model( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + list, + tuple + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _array_model( + self, + content_type: str = 'application/json', + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + list, + tuple + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + _fields = None + _body = None + if body is not schemas.unset: + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class ArrayModel(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def array_model( + self, + content_type: typing_extensions.Literal["application/json"] = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + list, + tuple + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def array_model( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + list, + tuple + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def array_model( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + list, + tuple + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def array_model( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + list, + tuple + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def array_model( + self, + content_type: str = 'application/json', + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + list, + tuple + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._array_model( + body=body, + content_type=content_type, + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + content_type: typing_extensions.Literal["application/json"] = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + list, + tuple + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + list, + tuple + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + list, + tuple + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + list, + tuple + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + content_type: str = 'application/json', + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + list, + tuple + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._array_model( + body=body, + content_type=content_type, + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_arraymodel/post/request_body/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_arraymodel/post/request_body/__init__.py new file mode 100644 index 00000000000..b4604475a48 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_arraymodel/post/request_body/__init__.py @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_arraymodel/post/request_body/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_arraymodel/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_arraymodel/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_arraymodel/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_arraymodel/post/request_body/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_arraymodel/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..f4fa4210ebe --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_arraymodel/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.schema import animal_farm +Schema = animal_farm.AnimalFarm diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_arraymodel/post/responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_arraymodel/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_arraymodel/post/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_arraymodel/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..60c9bf3cf80 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_arraymodel/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_arraymodel/post/responses/response_200/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_arraymodel/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_arraymodel/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_arraymodel/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_arraymodel/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_arraymodel/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..f4fa4210ebe --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_arraymodel/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.schema import animal_farm +Schema = animal_farm.AnimalFarm diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_boolean/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_boolean/__init__.py new file mode 100644 index 00000000000..4bd5eaa643a --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_boolean/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from petstore_api.apis.paths.fake_refs_boolean import FakeRefsBoolean + +path = "/fake/refs/boolean" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_boolean/post/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_boolean/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_boolean/post/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_boolean/post/operation.py new file mode 100644 index 00000000000..fb56d7f5475 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_boolean/post/operation.py @@ -0,0 +1,383 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _boolean( + self, + content_type: typing_extensions.Literal["application/json"] = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + bool + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _boolean( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + bool + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _boolean( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + bool + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _boolean( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + bool + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _boolean( + self, + content_type: str = 'application/json', + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + bool + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + _fields = None + _body = None + if body is not schemas.unset: + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class Boolean(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def boolean( + self, + content_type: typing_extensions.Literal["application/json"] = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + bool + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def boolean( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + bool + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def boolean( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + bool + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def boolean( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + bool + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def boolean( + self, + content_type: str = 'application/json', + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + bool + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._boolean( + body=body, + content_type=content_type, + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + content_type: typing_extensions.Literal["application/json"] = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + bool + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + bool + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + bool + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + bool + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + content_type: str = 'application/json', + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + bool + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._boolean( + body=body, + content_type=content_type, + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_boolean/post/request_body/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_boolean/post/request_body/__init__.py new file mode 100644 index 00000000000..b4604475a48 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_boolean/post/request_body/__init__.py @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_boolean/post/request_body/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_boolean/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_boolean/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_boolean/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_boolean/post/request_body/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_boolean/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..b0d51235439 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_boolean/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.schema import boolean +Schema = boolean.Boolean diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_boolean/post/responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_boolean/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_boolean/post/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_boolean/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..60c9bf3cf80 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_boolean/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_boolean/post/responses/response_200/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_boolean/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_boolean/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_boolean/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_boolean/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_boolean/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..b0d51235439 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_boolean/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.schema import boolean +Schema = boolean.Boolean diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/__init__.py new file mode 100644 index 00000000000..2a5338d1827 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from petstore_api.apis.paths.fake_refs_composed_one_of_number_with_validations import FakeRefsComposedOneOfNumberWithValidations + +path = "/fake/refs/composed_one_of_number_with_validations" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/operation.py new file mode 100644 index 00000000000..8e0315b4a8f --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/operation.py @@ -0,0 +1,608 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _composed_one_of_different_types( + self, + content_type: typing_extensions.Literal["application/json"] = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _composed_one_of_different_types( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _composed_one_of_different_types( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _composed_one_of_different_types( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _composed_one_of_different_types( + self, + content_type: str = 'application/json', + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + _fields = None + _body = None + if body is not schemas.unset: + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class ComposedOneOfDifferentTypes(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def composed_one_of_different_types( + self, + content_type: typing_extensions.Literal["application/json"] = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def composed_one_of_different_types( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def composed_one_of_different_types( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def composed_one_of_different_types( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def composed_one_of_different_types( + self, + content_type: str = 'application/json', + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._composed_one_of_different_types( + body=body, + content_type=content_type, + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + content_type: typing_extensions.Literal["application/json"] = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + content_type: str = 'application/json', + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._composed_one_of_different_types( + body=body, + content_type=content_type, + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/request_body/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/request_body/__init__.py new file mode 100644 index 00000000000..b4604475a48 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/request_body/__init__.py @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/request_body/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/request_body/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..94c5d7c3efa --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.schema import composed_one_of_different_types +Schema = composed_one_of_different_types.ComposedOneOfDifferentTypes diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..60c9bf3cf80 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/responses/response_200/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..94c5d7c3efa --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.schema import composed_one_of_different_types +Schema = composed_one_of_different_types.ComposedOneOfDifferentTypes diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_enum/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_enum/__init__.py new file mode 100644 index 00000000000..9c89ed5e998 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_enum/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from petstore_api.apis.paths.fake_refs_enum import FakeRefsEnum + +path = "/fake/refs/enum" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_enum/post/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_enum/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_enum/post/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_enum/post/operation.py new file mode 100644 index 00000000000..12b8531c110 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_enum/post/operation.py @@ -0,0 +1,398 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _string_enum( + self, + content_type: typing_extensions.Literal["application/json"] = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + None, + str + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _string_enum( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + None, + str + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _string_enum( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + None, + str + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _string_enum( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + None, + str + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _string_enum( + self, + content_type: str = 'application/json', + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + None, + str + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + _fields = None + _body = None + if body is not schemas.unset: + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class StringEnum(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def string_enum( + self, + content_type: typing_extensions.Literal["application/json"] = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + None, + str + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def string_enum( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + None, + str + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def string_enum( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + None, + str + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def string_enum( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + None, + str + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def string_enum( + self, + content_type: str = 'application/json', + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + None, + str + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._string_enum( + body=body, + content_type=content_type, + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + content_type: typing_extensions.Literal["application/json"] = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + None, + str + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + None, + str + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + None, + str + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + None, + str + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + content_type: str = 'application/json', + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + None, + str + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._string_enum( + body=body, + content_type=content_type, + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_enum/post/request_body/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_enum/post/request_body/__init__.py new file mode 100644 index 00000000000..b4604475a48 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_enum/post/request_body/__init__.py @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_enum/post/request_body/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_enum/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_enum/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_enum/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_enum/post/request_body/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_enum/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..38797b32f2c --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_enum/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.schema import string_enum +Schema = string_enum.StringEnum diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_enum/post/responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_enum/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_enum/post/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_enum/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..60c9bf3cf80 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_enum/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_enum/post/responses/response_200/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_enum/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_enum/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_enum/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_enum/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_enum/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..38797b32f2c --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_enum/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.schema import string_enum +Schema = string_enum.StringEnum diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_mammal/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_mammal/__init__.py new file mode 100644 index 00000000000..0fff296049a --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_mammal/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from petstore_api.apis.paths.fake_refs_mammal import FakeRefsMammal + +path = "/fake/refs/mammal" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_mammal/post/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_mammal/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_mammal/post/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_mammal/post/operation.py new file mode 100644 index 00000000000..00fc194e005 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_mammal/post/operation.py @@ -0,0 +1,595 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _mammal( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _mammal( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _mammal( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _mammal( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _mammal( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class Mammal(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def mammal( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def mammal( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def mammal( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def mammal( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def mammal( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._mammal( + body=body, + content_type=content_type, + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/json"] = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/json', + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._mammal( + body=body, + content_type=content_type, + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_mammal/post/request_body/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_mammal/post/request_body/__init__.py new file mode 100644 index 00000000000..01f76b5c2be --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_mammal/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_mammal/post/request_body/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_mammal/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_mammal/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_mammal/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_mammal/post/request_body/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_mammal/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..9df1a53b6e0 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_mammal/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.schema import mammal +Schema = mammal.Mammal diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_mammal/post/responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_mammal/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_mammal/post/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_mammal/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..60c9bf3cf80 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_mammal/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_mammal/post/responses/response_200/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_mammal/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_mammal/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_mammal/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_mammal/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_mammal/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..9df1a53b6e0 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_mammal/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.schema import mammal +Schema = mammal.Mammal diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_number/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_number/__init__.py new file mode 100644 index 00000000000..62ce0285e57 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_number/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from petstore_api.apis.paths.fake_refs_number import FakeRefsNumber + +path = "/fake/refs/number" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_number/post/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_number/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_number/post/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_number/post/operation.py new file mode 100644 index 00000000000..1f650e0638d --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_number/post/operation.py @@ -0,0 +1,413 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _number_with_validations( + self, + content_type: typing_extensions.Literal["application/json"] = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + decimal.Decimal, + int, + float + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _number_with_validations( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + decimal.Decimal, + int, + float + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _number_with_validations( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + decimal.Decimal, + int, + float + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _number_with_validations( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + decimal.Decimal, + int, + float + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _number_with_validations( + self, + content_type: str = 'application/json', + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + decimal.Decimal, + int, + float + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + _fields = None + _body = None + if body is not schemas.unset: + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class NumberWithValidations(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def number_with_validations( + self, + content_type: typing_extensions.Literal["application/json"] = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + decimal.Decimal, + int, + float + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def number_with_validations( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + decimal.Decimal, + int, + float + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def number_with_validations( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + decimal.Decimal, + int, + float + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def number_with_validations( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + decimal.Decimal, + int, + float + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def number_with_validations( + self, + content_type: str = 'application/json', + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + decimal.Decimal, + int, + float + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._number_with_validations( + body=body, + content_type=content_type, + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + content_type: typing_extensions.Literal["application/json"] = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + decimal.Decimal, + int, + float + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + decimal.Decimal, + int, + float + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + decimal.Decimal, + int, + float + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + decimal.Decimal, + int, + float + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + content_type: str = 'application/json', + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + decimal.Decimal, + int, + float + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._number_with_validations( + body=body, + content_type=content_type, + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_number/post/request_body/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_number/post/request_body/__init__.py new file mode 100644 index 00000000000..b4604475a48 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_number/post/request_body/__init__.py @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_number/post/request_body/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_number/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_number/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_number/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_number/post/request_body/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_number/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..1bbb8a96745 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_number/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.schema import number_with_validations +Schema = number_with_validations.NumberWithValidations diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_number/post/responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_number/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_number/post/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_number/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..60c9bf3cf80 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_number/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_number/post/responses/response_200/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_number/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_number/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_number/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_number/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_number/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..1bbb8a96745 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_number/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.schema import number_with_validations +Schema = number_with_validations.NumberWithValidations diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_object_model_with_ref_props/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_object_model_with_ref_props/__init__.py new file mode 100644 index 00000000000..019e8d77243 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_object_model_with_ref_props/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from petstore_api.apis.paths.fake_refs_object_model_with_ref_props import FakeRefsObjectModelWithRefProps + +path = "/fake/refs/object_model_with_ref_props" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_object_model_with_ref_props/post/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_object_model_with_ref_props/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_object_model_with_ref_props/post/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_object_model_with_ref_props/post/operation.py new file mode 100644 index 00000000000..f7810e8df99 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_object_model_with_ref_props/post/operation.py @@ -0,0 +1,398 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _object_model_with_ref_props( + self, + content_type: typing_extensions.Literal["application/json"] = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _object_model_with_ref_props( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _object_model_with_ref_props( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _object_model_with_ref_props( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _object_model_with_ref_props( + self, + content_type: str = 'application/json', + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + _fields = None + _body = None + if body is not schemas.unset: + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class ObjectModelWithRefProps(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def object_model_with_ref_props( + self, + content_type: typing_extensions.Literal["application/json"] = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def object_model_with_ref_props( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def object_model_with_ref_props( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def object_model_with_ref_props( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def object_model_with_ref_props( + self, + content_type: str = 'application/json', + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._object_model_with_ref_props( + body=body, + content_type=content_type, + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + content_type: typing_extensions.Literal["application/json"] = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + content_type: str = 'application/json', + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._object_model_with_ref_props( + body=body, + content_type=content_type, + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_object_model_with_ref_props/post/request_body/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_object_model_with_ref_props/post/request_body/__init__.py new file mode 100644 index 00000000000..b4604475a48 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_object_model_with_ref_props/post/request_body/__init__.py @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_object_model_with_ref_props/post/request_body/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_object_model_with_ref_props/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_object_model_with_ref_props/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_object_model_with_ref_props/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_object_model_with_ref_props/post/request_body/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_object_model_with_ref_props/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..8bc866e7691 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_object_model_with_ref_props/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.schema import object_model_with_ref_props +Schema = object_model_with_ref_props.ObjectModelWithRefProps diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_object_model_with_ref_props/post/responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_object_model_with_ref_props/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_object_model_with_ref_props/post/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_object_model_with_ref_props/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..60c9bf3cf80 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_object_model_with_ref_props/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_object_model_with_ref_props/post/responses/response_200/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_object_model_with_ref_props/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_object_model_with_ref_props/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_object_model_with_ref_props/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_object_model_with_ref_props/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_object_model_with_ref_props/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..8bc866e7691 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_object_model_with_ref_props/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.schema import object_model_with_ref_props +Schema = object_model_with_ref_props.ObjectModelWithRefProps diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_string/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_string/__init__.py new file mode 100644 index 00000000000..7c9ea7c1d0f --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_string/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from petstore_api.apis.paths.fake_refs_string import FakeRefsString + +path = "/fake/refs/string" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_string/post/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_string/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_string/post/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_string/post/operation.py new file mode 100644 index 00000000000..9a3685b439a --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_string/post/operation.py @@ -0,0 +1,383 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _string( + self, + content_type: typing_extensions.Literal["application/json"] = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + str + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _string( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + str + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _string( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + str + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _string( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + str + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _string( + self, + content_type: str = 'application/json', + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + str + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + _fields = None + _body = None + if body is not schemas.unset: + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class String(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def string( + self, + content_type: typing_extensions.Literal["application/json"] = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + str + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def string( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + str + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def string( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + str + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def string( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + str + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def string( + self, + content_type: str = 'application/json', + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + str + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._string( + body=body, + content_type=content_type, + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + content_type: typing_extensions.Literal["application/json"] = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + str + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + str + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + str + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + str + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + content_type: str = 'application/json', + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + schemas.Unset, + str + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._string( + body=body, + content_type=content_type, + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_string/post/request_body/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_string/post/request_body/__init__.py new file mode 100644 index 00000000000..b4604475a48 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_string/post/request_body/__init__.py @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_string/post/request_body/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_string/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_string/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_string/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_string/post/request_body/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_string/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..1ce89f3c8ed --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_string/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.schema import string +Schema = string.String diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_string/post/responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_string/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_string/post/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_string/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..60c9bf3cf80 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_string/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_string/post/responses/response_200/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_string/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_string/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_string/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_string/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_string/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..1ce89f3c8ed --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_string/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.schema import string +Schema = string.String diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_response_without_schema/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_response_without_schema/__init__.py new file mode 100644 index 00000000000..e659f0dc78b --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_response_without_schema/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from petstore_api.apis.paths.fake_response_without_schema import FakeResponseWithoutSchema + +path = "/fake/responseWithoutSchema" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_response_without_schema/get/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_response_without_schema/get/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_response_without_schema/get/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_response_without_schema/get/operation.py new file mode 100644 index 00000000000..18dd6230c23 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_response_without_schema/get/operation.py @@ -0,0 +1,245 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", + "application/xml", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _response_without_schema( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _response_without_schema( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _response_without_schema( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _response_without_schema( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + receives a response without schema + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='get', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class ResponseWithoutSchema(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def response_without_schema( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def response_without_schema( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def response_without_schema( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def response_without_schema( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._response_without_schema( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForGet(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def get( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def get( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._response_without_schema( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_response_without_schema/get/responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_response_without_schema/get/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_response_without_schema/get/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_response_without_schema/get/responses/response_200/__init__.py new file mode 100644 index 00000000000..40a813d5b31 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_response_without_schema/get/responses/response_200/__init__.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + pass + + + class __ApplicationXmlMediaType(api_client.MediaType): + pass + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + 'application/xml': typing.Type[__ApplicationXmlMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + 'application/xml': __ApplicationXmlMediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/__init__.py new file mode 100644 index 00000000000..90b846d3609 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from petstore_api.apis.paths.fake_test_query_paramters import FakeTestQueryParamters + +path = "/fake/test-query-paramters" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/operation.py new file mode 100644 index 00000000000..a17445abcbb --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/operation.py @@ -0,0 +1,285 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from petstore_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from .parameters import ( + parameter_0, + parameter_1, + parameter_2, + parameter_3, + parameter_4, + parameter_5, +) + + + +class RequestQueryParameters: + RequiredParams = typing_extensions.TypedDict( + 'RequiredParams', + { + 'pipe': typing.Union[parameter_0.Parameter0.schema, list, tuple], + 'ioutil': typing.Union[parameter_1.Parameter1.schema, list, tuple], + 'http': typing.Union[parameter_2.Parameter2.schema, list, tuple], + 'url': typing.Union[parameter_3.Parameter3.schema, list, tuple], + 'context': typing.Union[parameter_4.Parameter4.schema, list, tuple], + 'refParam': typing.Union[parameter_5.Parameter5.schema, dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + } + ) + OptionalParams = typing_extensions.TypedDict( + 'OptionalParams', + { + }, + total=False + ) + + + class Params(RequiredParams, OptionalParams): + pass + + + parameters = [ + parameter_0.Parameter0, + parameter_1.Parameter1, + parameter_2.Parameter2, + parameter_3.Parameter3, + parameter_4.Parameter4, + parameter_5.Parameter5, + ] + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _query_parameter_collection_format( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _query_parameter_collection_format( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _query_parameter_collection_format( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _query_parameter_collection_format( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs(RequestQueryParameters.Params, query_params) + used_path = path + + prefix_separator_iterator = None + for parameter in RequestQueryParameters.parameters: + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + # TODO add cookie handling + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='put', + host=host, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class QueryParameterCollectionFormat(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def query_parameter_collection_format( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def query_parameter_collection_format( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def query_parameter_collection_format( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def query_parameter_collection_format( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._query_parameter_collection_format( + query_params=query_params, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPut(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def put( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def put( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def put( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def put( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._query_parameter_collection_format( + query_params=query_params, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/parameters/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/parameters/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_0/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_0/__init__.py new file mode 100644 index 00000000000..8b7bd85b373 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_0/__init__.py @@ -0,0 +1,22 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client + +from . import schema + + +class Parameter0(api_client.QueryParameter): + name = "pipe" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + required = True + explode = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_0/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_0/schema.py new file mode 100644 index 00000000000..59aff0b39f0 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_0/schema.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Schema( + schemas.ListSchema +): + + + class Schema_: + types = {tuple} + Items = schemas.StrSchema + + def __new__( + cls, + arg_: typing.Union[ + typing.Tuple[ + typing.Union[Schema_.Items, str], ... + ], + typing.List[ + typing.Union[Schema_.Items, str] + ], + ], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'Schema': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) + + def __getitem__(self, i: int) -> Schema_.Items: + return super().__getitem__(i) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_1/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_1/__init__.py new file mode 100644 index 00000000000..ac8e9f20e5f --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_1/__init__.py @@ -0,0 +1,21 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client + +from . import schema + + +class Parameter1(api_client.QueryParameter): + name = "ioutil" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + required = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_1/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_1/schema.py new file mode 100644 index 00000000000..59aff0b39f0 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_1/schema.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Schema( + schemas.ListSchema +): + + + class Schema_: + types = {tuple} + Items = schemas.StrSchema + + def __new__( + cls, + arg_: typing.Union[ + typing.Tuple[ + typing.Union[Schema_.Items, str], ... + ], + typing.List[ + typing.Union[Schema_.Items, str] + ], + ], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'Schema': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) + + def __getitem__(self, i: int) -> Schema_.Items: + return super().__getitem__(i) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_2/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_2/__init__.py new file mode 100644 index 00000000000..e90bd21e92a --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_2/__init__.py @@ -0,0 +1,21 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client + +from . import schema + + +class Parameter2(api_client.QueryParameter): + name = "http" + style = api_client.ParameterStyle.SPACE_DELIMITED + schema = schema.Schema + required = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_2/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_2/schema.py new file mode 100644 index 00000000000..59aff0b39f0 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_2/schema.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Schema( + schemas.ListSchema +): + + + class Schema_: + types = {tuple} + Items = schemas.StrSchema + + def __new__( + cls, + arg_: typing.Union[ + typing.Tuple[ + typing.Union[Schema_.Items, str], ... + ], + typing.List[ + typing.Union[Schema_.Items, str] + ], + ], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'Schema': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) + + def __getitem__(self, i: int) -> Schema_.Items: + return super().__getitem__(i) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_3/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_3/__init__.py new file mode 100644 index 00000000000..e1528901f5e --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_3/__init__.py @@ -0,0 +1,21 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client + +from . import schema + + +class Parameter3(api_client.QueryParameter): + name = "url" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + required = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_3/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_3/schema.py new file mode 100644 index 00000000000..59aff0b39f0 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_3/schema.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Schema( + schemas.ListSchema +): + + + class Schema_: + types = {tuple} + Items = schemas.StrSchema + + def __new__( + cls, + arg_: typing.Union[ + typing.Tuple[ + typing.Union[Schema_.Items, str], ... + ], + typing.List[ + typing.Union[Schema_.Items, str] + ], + ], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'Schema': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) + + def __getitem__(self, i: int) -> Schema_.Items: + return super().__getitem__(i) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_4/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_4/__init__.py new file mode 100644 index 00000000000..7874df1f497 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_4/__init__.py @@ -0,0 +1,22 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client + +from . import schema + + +class Parameter4(api_client.QueryParameter): + name = "context" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + required = True + explode = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_4/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_4/schema.py new file mode 100644 index 00000000000..59aff0b39f0 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_4/schema.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Schema( + schemas.ListSchema +): + + + class Schema_: + types = {tuple} + Items = schemas.StrSchema + + def __new__( + cls, + arg_: typing.Union[ + typing.Tuple[ + typing.Union[Schema_.Items, str], ... + ], + typing.List[ + typing.Union[Schema_.Items, str] + ], + ], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'Schema': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) + + def __getitem__(self, i: int) -> Schema_.Items: + return super().__getitem__(i) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_5/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_5/__init__.py new file mode 100644 index 00000000000..6b29dabd1ac --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_5/__init__.py @@ -0,0 +1,22 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client + +from . import schema + + +class Parameter5(api_client.QueryParameter): + name = "refParam" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + required = True + explode = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_5/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_5/schema.py new file mode 100644 index 00000000000..96c02825f5a --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_5/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.schema import string_with_validation +Schema = string_with_validation.StringWithValidation diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/responses/response_200/__init__.py new file mode 100644 index 00000000000..60dc7cec19a --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/responses/response_200/__init__.py @@ -0,0 +1,11 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.responses import response_success_description_only +ResponseFor200 = response_success_description_only.SuccessDescriptionOnly diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_download_file/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_download_file/__init__.py new file mode 100644 index 00000000000..80629de25a0 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_download_file/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from petstore_api.apis.paths.fake_upload_download_file import FakeUploadDownloadFile + +path = "/fake/uploadDownloadFile" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_download_file/post/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_download_file/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_download_file/post/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_download_file/post/operation.py new file mode 100644 index 00000000000..67ecd04241e --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_download_file/post/operation.py @@ -0,0 +1,401 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/octet-stream", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _upload_download_file( + self, + body: typing.Union[ + request_body.RequestBody.content["application/octet-stream"].schema, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/octet-stream"] = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _upload_download_file( + self, + body: typing.Union[ + request_body.RequestBody.content["application/octet-stream"].schema, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _upload_download_file( + self, + body: typing.Union[ + request_body.RequestBody.content["application/octet-stream"].schema, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _upload_download_file( + self, + body: typing.Union[ + request_body.RequestBody.content["application/octet-stream"].schema, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _upload_download_file( + self, + body: typing.Union[ + request_body.RequestBody.content["application/octet-stream"].schema, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/octet-stream', + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + uploads a file and downloads a file using application/octet-stream + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class UploadDownloadFile(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def upload_download_file( + self, + body: typing.Union[ + request_body.RequestBody.content["application/octet-stream"].schema, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/octet-stream"] = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def upload_download_file( + self, + body: typing.Union[ + request_body.RequestBody.content["application/octet-stream"].schema, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def upload_download_file( + self, + body: typing.Union[ + request_body.RequestBody.content["application/octet-stream"].schema, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def upload_download_file( + self, + body: typing.Union[ + request_body.RequestBody.content["application/octet-stream"].schema, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def upload_download_file( + self, + body: typing.Union[ + request_body.RequestBody.content["application/octet-stream"].schema, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/octet-stream', + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._upload_download_file( + body=body, + content_type=content_type, + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/octet-stream"].schema, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: typing_extensions.Literal["application/octet-stream"] = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/octet-stream"].schema, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/octet-stream"].schema, + bytes, + io.FileIO, + io.BufferedReader + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/octet-stream"].schema, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/octet-stream"].schema, + bytes, + io.FileIO, + io.BufferedReader + ], + content_type: str = 'application/octet-stream', + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._upload_download_file( + body=body, + content_type=content_type, + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_download_file/post/request_body/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_download_file/post/request_body/__init__.py new file mode 100644 index 00000000000..f2d5b7e4793 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_download_file/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client +from .content.application_octet_stream import schema as application_octet_stream_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationOctetStreamMediaType(api_client.MediaType): + schema: typing.Type[application_octet_stream_schema.Schema] = application_octet_stream_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/octet-stream': typing.Type[__ApplicationOctetStreamMediaType], + } + ) + content: __Content = { + 'application/octet-stream': __ApplicationOctetStreamMediaType, + } + required = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_download_file/post/request_body/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_download_file/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_download_file/post/request_body/content/application_octet_stream/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_download_file/post/request_body/content/application_octet_stream/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_download_file/post/request_body/content/application_octet_stream/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_download_file/post/request_body/content/application_octet_stream/schema.py new file mode 100644 index 00000000000..eb6b8359e9d --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_download_file/post/request_body/content/application_octet_stream/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.BinarySchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_download_file/post/responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_download_file/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_download_file/post/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_download_file/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..1f81bfefebe --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_download_file/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas +from .content.application_octet_stream import schema as application_octet_stream_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_octet_stream_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationOctetStreamMediaType(api_client.MediaType): + schema: typing.Type[application_octet_stream_schema.Schema] = application_octet_stream_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/octet-stream': typing.Type[__ApplicationOctetStreamMediaType], + } + ) + content: __Content = { + 'application/octet-stream': __ApplicationOctetStreamMediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_download_file/post/responses/response_200/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_download_file/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_download_file/post/responses/response_200/content/application_octet_stream/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_download_file/post/responses/response_200/content/application_octet_stream/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_download_file/post/responses/response_200/content/application_octet_stream/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_download_file/post/responses/response_200/content/application_octet_stream/schema.py new file mode 100644 index 00000000000..eb6b8359e9d --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_download_file/post/responses/response_200/content/application_octet_stream/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.BinarySchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_file/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_file/__init__.py new file mode 100644 index 00000000000..ec54eda3a71 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_file/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from petstore_api.apis.paths.fake_upload_file import FakeUploadFile + +path = "/fake/uploadFile" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_file/post/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_file/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_file/post/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_file/post/operation.py new file mode 100644 index 00000000000..f14bc8f65f6 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_file/post/operation.py @@ -0,0 +1,399 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _upload_file( + self, + content_type: typing_extensions.Literal["multipart/form-data"] = ..., + body: typing.Union[ + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _upload_file( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _upload_file( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _upload_file( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _upload_file( + self, + content_type: str = 'multipart/form-data', + body: typing.Union[ + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + uploads a file using multipart/form-data + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + _fields = None + _body = None + if body is not schemas.unset: + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class UploadFile(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def upload_file( + self, + content_type: typing_extensions.Literal["multipart/form-data"] = ..., + body: typing.Union[ + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def upload_file( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def upload_file( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def upload_file( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def upload_file( + self, + content_type: str = 'multipart/form-data', + body: typing.Union[ + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._upload_file( + body=body, + content_type=content_type, + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + content_type: typing_extensions.Literal["multipart/form-data"] = ..., + body: typing.Union[ + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + content_type: str = 'multipart/form-data', + body: typing.Union[ + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._upload_file( + body=body, + content_type=content_type, + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_file/post/request_body/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_file/post/request_body/__init__.py new file mode 100644 index 00000000000..528cb05ef27 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_file/post/request_body/__init__.py @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client +from .content.multipart_form_data import schema as multipart_form_data_schema + +class RequestBody(api_client.RequestBody): + + + class __MultipartFormDataMediaType(api_client.MediaType): + schema: typing.Type[multipart_form_data_schema.Schema] = multipart_form_data_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'multipart/form-data': typing.Type[__MultipartFormDataMediaType], + } + ) + content: __Content = { + 'multipart/form-data': __MultipartFormDataMediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_file/post/request_body/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_file/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_file/post/request_body/content/multipart_form_data/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_file/post/request_body/content/multipart_form_data/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_file/post/request_body/content/multipart_form_data/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_file/post/request_body/content/multipart_form_data/schema.py new file mode 100644 index 00000000000..1f2d7770571 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_file/post/request_body/content/multipart_form_data/schema.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Schema( + schemas.DictSchema +): + + + class Schema_: + types = {frozendict.frozendict} + required = { + "file", + } + + class Properties: + AdditionalMetadata = schemas.StrSchema + File = schemas.BinarySchema + __annotations__ = { + "additionalMetadata": AdditionalMetadata, + "file": File, + } + + file: Schema_.Properties.File + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["file"]) -> Schema_.Properties.File: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["additionalMetadata"]) -> Schema_.Properties.AdditionalMetadata: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["file"], + typing_extensions.Literal["additionalMetadata"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["file"]) -> Schema_.Properties.File: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["additionalMetadata"]) -> typing.Union[Schema_.Properties.AdditionalMetadata, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["file"], + typing_extensions.Literal["additionalMetadata"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + file: typing.Union[Schema_.Properties.File, bytes, io.FileIO, io.BufferedReader], + additionalMetadata: typing.Union[Schema_.Properties.AdditionalMetadata, str, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'Schema': + return super().__new__( + cls, + *args_, + file=file, + additionalMetadata=additionalMetadata, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_file/post/responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_file/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_file/post/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_file/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..60c9bf3cf80 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_file/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_file/post/responses/response_200/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_file/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_file/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_file/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_file/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_file/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..38685cadefa --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_file/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.schema import api_response +Schema = api_response.ApiResponse diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_files/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_files/__init__.py new file mode 100644 index 00000000000..ef209e59561 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_files/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from petstore_api.apis.paths.fake_upload_files import FakeUploadFiles + +path = "/fake/uploadFiles" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_files/post/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_files/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_files/post/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_files/post/operation.py new file mode 100644 index 00000000000..7c12cb1b245 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_files/post/operation.py @@ -0,0 +1,399 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _upload_files( + self, + content_type: typing_extensions.Literal["multipart/form-data"] = ..., + body: typing.Union[ + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _upload_files( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _upload_files( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _upload_files( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _upload_files( + self, + content_type: str = 'multipart/form-data', + body: typing.Union[ + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + uploads files using multipart/form-data + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + _fields = None + _body = None + if body is not schemas.unset: + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class UploadFiles(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def upload_files( + self, + content_type: typing_extensions.Literal["multipart/form-data"] = ..., + body: typing.Union[ + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def upload_files( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def upload_files( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def upload_files( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def upload_files( + self, + content_type: str = 'multipart/form-data', + body: typing.Union[ + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._upload_files( + body=body, + content_type=content_type, + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + content_type: typing_extensions.Literal["multipart/form-data"] = ..., + body: typing.Union[ + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + content_type: str = 'multipart/form-data', + body: typing.Union[ + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._upload_files( + body=body, + content_type=content_type, + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_files/post/request_body/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_files/post/request_body/__init__.py new file mode 100644 index 00000000000..528cb05ef27 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_files/post/request_body/__init__.py @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client +from .content.multipart_form_data import schema as multipart_form_data_schema + +class RequestBody(api_client.RequestBody): + + + class __MultipartFormDataMediaType(api_client.MediaType): + schema: typing.Type[multipart_form_data_schema.Schema] = multipart_form_data_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'multipart/form-data': typing.Type[__MultipartFormDataMediaType], + } + ) + content: __Content = { + 'multipart/form-data': __MultipartFormDataMediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_files/post/request_body/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_files/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_files/post/request_body/content/multipart_form_data/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_files/post/request_body/content/multipart_form_data/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_files/post/request_body/content/multipart_form_data/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_files/post/request_body/content/multipart_form_data/schema.py new file mode 100644 index 00000000000..ebf398f4ca7 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_files/post/request_body/content/multipart_form_data/schema.py @@ -0,0 +1,114 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Schema( + schemas.DictSchema +): + + + class Schema_: + types = {frozendict.frozendict} + + class Properties: + + + class Files( + schemas.ListSchema + ): + + + class Schema_: + types = {tuple} + Items = schemas.BinarySchema + + def __new__( + cls, + arg_: typing.Union[ + typing.Tuple[ + typing.Union[Schema_.Items, bytes, io.FileIO, io.BufferedReader], ... + ], + typing.List[ + typing.Union[Schema_.Items, bytes, io.FileIO, io.BufferedReader] + ], + ], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'Schema.Schema_.Properties.Files': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) + + def __getitem__(self, i: int) -> Schema_.Items: + return super().__getitem__(i) + __annotations__ = { + "files": Files, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["files"]) -> Schema_.Properties.Files: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["files"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["files"]) -> typing.Union[Schema_.Properties.Files, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["files"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + files: typing.Union[Schema_.Properties.Files, list, tuple, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'Schema': + return super().__new__( + cls, + *args_, + files=files, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_files/post/responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_files/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_files/post/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_files/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..60c9bf3cf80 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_files/post/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_files/post/responses/response_200/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_files/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_files/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_files/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_files/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_files/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..38685cadefa --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_files/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.schema import api_response +Schema = api_response.ApiResponse diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/__init__.py new file mode 100644 index 00000000000..eebf4174b26 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from petstore_api.apis.paths.fake_wild_card_responses import FakeWildCardResponses + +path = "/fake/wildCardResponses" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/operation.py new file mode 100644 index 00000000000..7a74db7e7d6 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/operation.py @@ -0,0 +1,297 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from .. import path +from .responses import ( + response_1xx, + response_200, + response_2xx, + response_3xx, + response_4xx, + response_5xx, +) + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} +__RangedStatusCodeToResponse = typing_extensions.TypedDict( + '__RangedStatusCodeToResponse', + { + '1': typing.Type[response_1xx.ResponseFor1XX], + '2': typing.Type[response_2xx.ResponseFor2XX], + '3': typing.Type[response_3xx.ResponseFor3XX], + '4': typing.Type[response_4xx.ResponseFor4XX], + '5': typing.Type[response_5xx.ResponseFor5XX], + } +) +_ranged_status_code_to_response: __RangedStatusCodeToResponse = { + '1': response_1xx.ResponseFor1XX, + '2': response_2xx.ResponseFor2XX, + '3': response_3xx.ResponseFor3XX, + '4': response_4xx.ResponseFor4XX, + '5': response_5xx.ResponseFor5XX, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _wild_card_responses( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + response_2xx.ResponseFor2XX.response_cls, + response_3xx.ResponseFor3XX.response_cls, + ]: ... + + @typing.overload + def _wild_card_responses( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _wild_card_responses( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + response_2xx.ResponseFor2XX.response_cls, + response_3xx.ResponseFor3XX.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _wild_card_responses( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + operation with wildcard responses + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='get', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + ranged_response_status_code = status[0] + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + elif ranged_response_status_code in _ranged_status_code_to_response: + ranged_response_status_code: typing_extensions.Literal[ + '1', + '2', + '3', + '4', + '5', + ] + api_response = _ranged_status_code_to_response[ranged_response_status_code].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class WildCardResponses(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def wild_card_responses( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + response_2xx.ResponseFor2XX.response_cls, + response_3xx.ResponseFor3XX.response_cls, + ]: ... + + @typing.overload + def wild_card_responses( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def wild_card_responses( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + response_2xx.ResponseFor2XX.response_cls, + response_3xx.ResponseFor3XX.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def wild_card_responses( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._wild_card_responses( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForGet(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def get( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + response_2xx.ResponseFor2XX.response_cls, + response_3xx.ResponseFor3XX.response_cls, + ]: ... + + @typing.overload + def get( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + response_2xx.ResponseFor2XX.response_cls, + response_3xx.ResponseFor3XX.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._wild_card_responses( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_1xx/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_1xx/__init__.py new file mode 100644 index 00000000000..ab29228ce06 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_1xx/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor1XX(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_1xx/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_1xx/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_1xx/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_1xx/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_1xx/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_1xx/content/application_json/schema.py new file mode 100644 index 00000000000..03b3f1d7666 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_1xx/content/application_json/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.AnyTypeSchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_200/__init__.py new file mode 100644 index 00000000000..60c9bf3cf80 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_200/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..03b3f1d7666 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_200/content/application_json/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.AnyTypeSchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_2xx/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_2xx/__init__.py new file mode 100644 index 00000000000..2a17044b3da --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_2xx/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor2XX(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_2xx/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_2xx/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_2xx/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_2xx/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_2xx/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_2xx/content/application_json/schema.py new file mode 100644 index 00000000000..03b3f1d7666 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_2xx/content/application_json/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.AnyTypeSchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_3xx/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_3xx/__init__.py new file mode 100644 index 00000000000..31a0690e812 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_3xx/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor3XX(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_3xx/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_3xx/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_3xx/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_3xx/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_3xx/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_3xx/content/application_json/schema.py new file mode 100644 index 00000000000..03b3f1d7666 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_3xx/content/application_json/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.AnyTypeSchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_4xx/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_4xx/__init__.py new file mode 100644 index 00000000000..e696ce70cc5 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_4xx/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor4XX(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_4xx/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_4xx/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_4xx/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_4xx/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_4xx/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_4xx/content/application_json/schema.py new file mode 100644 index 00000000000..03b3f1d7666 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_4xx/content/application_json/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.AnyTypeSchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_5xx/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_5xx/__init__.py new file mode 100644 index 00000000000..fe67442e0b9 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_5xx/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor5XX(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_5xx/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_5xx/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_5xx/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_5xx/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_5xx/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_5xx/content/application_json/schema.py new file mode 100644 index 00000000000..03b3f1d7666 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_5xx/content/application_json/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.AnyTypeSchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/foo/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/foo/__init__.py new file mode 100644 index 00000000000..6deeb866284 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/foo/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from petstore_api.apis.paths.foo import Foo + +path = "/foo" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/foo/get/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/foo/get/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/foo/get/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/foo/get/operation.py new file mode 100644 index 00000000000..0658728adf1 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/foo/get/operation.py @@ -0,0 +1,227 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from .. import path +from .responses import response_default + + + +default_response = response_default.Default + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _foo_get( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_default.Default.response_cls: ... + + @typing.overload + def _foo_get( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _foo_get( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_default.Default.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _foo_get( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'paths/' + path + '/get/servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='get', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + api_response = default_response.deserialize(response, self.api_client.schema_configuration) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class FooGet(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def foo_get( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_default.Default.response_cls: ... + + @typing.overload + def foo_get( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def foo_get( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_default.Default.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def foo_get( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._foo_get( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForGet(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def get( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_default.Default.response_cls: ... + + @typing.overload + def get( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_default.Default.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._foo_get( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/foo/get/responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/foo/get/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/foo/get/responses/response_default/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/foo/get/responses/response_default/__init__.py new file mode 100644 index 00000000000..25fe5df6d0c --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/foo/get/responses/response_default/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class Default(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/foo/get/responses/response_default/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/foo/get/responses/response_default/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/foo/get/responses/response_default/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/foo/get/responses/response_default/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/foo/get/responses/response_default/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/foo/get/responses/response_default/content/application_json/schema.py new file mode 100644 index 00000000000..14977ef4801 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/foo/get/responses/response_default/content/application_json/schema.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Schema( + schemas.DictSchema +): + + + class Schema_: + types = {frozendict.frozendict} + + class Properties: + + @staticmethod + def string() -> typing.Type['foo.Foo']: + return foo.Foo + __annotations__ = { + "string": string, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["string"]) -> 'foo.Foo': ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["string"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["string"]) -> typing.Union['foo.Foo', schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["string"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + string: typing.Union['foo.Foo', dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'Schema': + return super().__new__( + cls, + *args_, + string=string, + configuration_=configuration_, + **kwargs, + ) + +from petstore_api.components.schema import foo diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/foo/get/servers/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/foo/get/servers/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/foo/get/servers/server_0.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/foo/get/servers/server_0.py new file mode 100644 index 00000000000..c07da2397b5 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/foo/get/servers/server_0.py @@ -0,0 +1,16 @@ +# coding: utf-8 +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import typing + +from petstore_api import server + + +@dataclasses.dataclass +class Server0(server.Server): + _url: str = "https://path-server-test.petstore.local/v2" diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/foo/get/servers/server_1.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/foo/get/servers/server_1.py new file mode 100644 index 00000000000..11300222049 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/foo/get/servers/server_1.py @@ -0,0 +1,70 @@ +# coding: utf-8 +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import typing +import typing_extensions + +from petstore_api import server, schemas + + +class _Variables: + + + class Version( + schemas.StrSchema + ): + + + class Schema_: + types = { + str, + } + default = "v1" + enum_value_to_name = { + "v1": "V1", + "v2": "V2", + } + + @schemas.classproperty + def V1(cls): + return cls("v1") + + @schemas.classproperty + def V2(cls): + return cls("v2") + +_VariablesSchemas = typing_extensions.TypedDict( + '_VariablesSchemas', + { + "version": typing.Type[_Variables.Version], + }, + total=False +) + +Variables = typing_extensions.TypedDict( + 'Variables', + { + "version": typing_extensions.Literal[ + "v1", + "v2", + ], + }, + total=False +) + +def _default_variable_schemas(): + return { + "version": _Variables.Version, + } + + +@dataclasses.dataclass +class Server1(server.Server): + _url: str = "https://petstore.swagger.io/{version}" + variables: Variables + variable_schemas: _VariablesSchemas = dataclasses.field(default_factory=_default_variable_schemas) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/__init__.py new file mode 100644 index 00000000000..c0e9f49c887 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from petstore_api.apis.paths.pet import Pet + +path = "/pet" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/post/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/post/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/post/operation.py new file mode 100644 index 00000000000..019aefd87c2 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/post/operation.py @@ -0,0 +1,462 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions, security_schemes +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from .. import path +from .responses import ( + response_200, + response_405, +) +from . import request_body +from .security import ( + security_requirement_object_0, + security_requirement_object_1, + security_requirement_object_2, +) + + +_security: typing.List[security_schemes.SecurityRequirementObject] = [ + security_requirement_object_0.security_requirement_object, + security_requirement_object_1.security_requirement_object, + security_requirement_object_2.security_requirement_object, +] + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + '405': typing.Type[response_405.ResponseFor405], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, + '405': response_405.ResponseFor405, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _add_pet( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: typing_extensions.Literal["application/json"] = ..., + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _add_pet( + self, + body: typing.Union[ + request_body.RequestBody.content["application/xml"].schema, + dict, + frozendict.frozendict + ], + content_type: typing_extensions.Literal["application/xml"], + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _add_pet( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + request_body.RequestBody.content["application/xml"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _add_pet( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + request_body.RequestBody.content["application/xml"].schema, + dict, + frozendict.frozendict + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _add_pet( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + request_body.RequestBody.content["application/xml"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _add_pet( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + request_body.RequestBody.content["application/xml"].schema, + dict, + frozendict.frozendict + ], + content_type: str = 'application/json', + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + Add a new pet to the store + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + security_requirement_object = self.api_client.configuration.get_security_requirement_object( + 'paths/' + path + '/post/security', + _security, + security_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + security_requirement_object=security_requirement_object, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + '405', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class AddPet(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def add_pet( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: typing_extensions.Literal["application/json"] = ..., + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def add_pet( + self, + body: typing.Union[ + request_body.RequestBody.content["application/xml"].schema, + dict, + frozendict.frozendict + ], + content_type: typing_extensions.Literal["application/xml"], + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def add_pet( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + request_body.RequestBody.content["application/xml"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def add_pet( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + request_body.RequestBody.content["application/xml"].schema, + dict, + frozendict.frozendict + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def add_pet( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + request_body.RequestBody.content["application/xml"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def add_pet( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + request_body.RequestBody.content["application/xml"].schema, + dict, + frozendict.frozendict + ], + content_type: str = 'application/json', + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._add_pet( + body=body, + content_type=content_type, + security_index=security_index, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: typing_extensions.Literal["application/json"] = ..., + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/xml"].schema, + dict, + frozendict.frozendict + ], + content_type: typing_extensions.Literal["application/xml"], + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + request_body.RequestBody.content["application/xml"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + request_body.RequestBody.content["application/xml"].schema, + dict, + frozendict.frozendict + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + request_body.RequestBody.content["application/xml"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + request_body.RequestBody.content["application/xml"].schema, + dict, + frozendict.frozendict + ], + content_type: str = 'application/json', + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._add_pet( + body=body, + content_type=content_type, + security_index=security_index, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/post/request_body/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/post/request_body/__init__.py new file mode 100644 index 00000000000..531d33a81bc --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/post/request_body/__init__.py @@ -0,0 +1,11 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.request_bodies import request_body_pet +RequestBody = request_body_pet.Pet diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/post/responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/post/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..60dc7cec19a --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/post/responses/response_200/__init__.py @@ -0,0 +1,11 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.responses import response_success_description_only +ResponseFor200 = response_success_description_only.SuccessDescriptionOnly diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/post/responses/response_405/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/post/responses/response_405/__init__.py new file mode 100644 index 00000000000..d13237fc695 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/post/responses/response_405/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor405(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/post/security/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/post/security/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/post/security/security_requirement_object_0.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/post/security/security_requirement_object_0.py new file mode 100644 index 00000000000..b90c03aa300 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/post/security/security_requirement_object_0.py @@ -0,0 +1,13 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api import security_schemes + +security_requirement_object: security_schemes.SecurityRequirementObject = { + "api_key": (), +} diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/post/security/security_requirement_object_1.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/post/security/security_requirement_object_1.py new file mode 100644 index 00000000000..18260b0a41a --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/post/security/security_requirement_object_1.py @@ -0,0 +1,13 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api import security_schemes + +security_requirement_object: security_schemes.SecurityRequirementObject = { + "http_signature_test": (), +} diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/post/security/security_requirement_object_2.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/post/security/security_requirement_object_2.py new file mode 100644 index 00000000000..3a74df60685 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/post/security/security_requirement_object_2.py @@ -0,0 +1,13 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api import security_schemes + +security_requirement_object: security_schemes.SecurityRequirementObject = { + "petstore_auth": ("write:pets", "read:pets", ), +} diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/put/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/put/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/put/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/put/operation.py new file mode 100644 index 00000000000..fd14c41557f --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/put/operation.py @@ -0,0 +1,452 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions, security_schemes +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from .. import path +from .responses import ( + response_400, + response_404, + response_405, +) +from . import request_body +from .security import ( + security_requirement_object_0, + security_requirement_object_1, +) + + +_security: typing.List[security_schemes.SecurityRequirementObject] = [ + security_requirement_object_0.security_requirement_object, + security_requirement_object_1.security_requirement_object, +] + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '400': typing.Type[response_400.ResponseFor400], + '404': typing.Type[response_404.ResponseFor404], + '405': typing.Type[response_405.ResponseFor405], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '400': response_400.ResponseFor400, + '404': response_404.ResponseFor404, + '405': response_405.ResponseFor405, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _update_pet( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: typing_extensions.Literal["application/json"] = ..., + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> api_client.ApiResponseWithoutDeserialization: ... + @typing.overload + def _update_pet( + self, + body: typing.Union[ + request_body.RequestBody.content["application/xml"].schema, + dict, + frozendict.frozendict + ], + content_type: typing_extensions.Literal["application/xml"], + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> api_client.ApiResponseWithoutDeserialization: ... + @typing.overload + def _update_pet( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + request_body.RequestBody.content["application/xml"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _update_pet( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + request_body.RequestBody.content["application/xml"].schema, + dict, + frozendict.frozendict + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _update_pet( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + request_body.RequestBody.content["application/xml"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _update_pet( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + request_body.RequestBody.content["application/xml"].schema, + dict, + frozendict.frozendict + ], + content_type: str = 'application/json', + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + Update an existing pet + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + security_requirement_object = self.api_client.configuration.get_security_requirement_object( + 'paths/' + path + '/put/security', + _security, + security_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='put', + host=host, + headers=_headers, + fields=_fields, + body=_body, + security_requirement_object=security_requirement_object, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '400', + '404', + '405', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class UpdatePet(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def update_pet( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: typing_extensions.Literal["application/json"] = ..., + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> api_client.ApiResponseWithoutDeserialization: ... + @typing.overload + def update_pet( + self, + body: typing.Union[ + request_body.RequestBody.content["application/xml"].schema, + dict, + frozendict.frozendict + ], + content_type: typing_extensions.Literal["application/xml"], + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> api_client.ApiResponseWithoutDeserialization: ... + @typing.overload + def update_pet( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + request_body.RequestBody.content["application/xml"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def update_pet( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + request_body.RequestBody.content["application/xml"].schema, + dict, + frozendict.frozendict + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def update_pet( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + request_body.RequestBody.content["application/xml"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def update_pet( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + request_body.RequestBody.content["application/xml"].schema, + dict, + frozendict.frozendict + ], + content_type: str = 'application/json', + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._update_pet( + body=body, + content_type=content_type, + security_index=security_index, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPut(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def put( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: typing_extensions.Literal["application/json"] = ..., + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> api_client.ApiResponseWithoutDeserialization: ... + @typing.overload + def put( + self, + body: typing.Union[ + request_body.RequestBody.content["application/xml"].schema, + dict, + frozendict.frozendict + ], + content_type: typing_extensions.Literal["application/xml"], + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> api_client.ApiResponseWithoutDeserialization: ... + @typing.overload + def put( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + request_body.RequestBody.content["application/xml"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def put( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + request_body.RequestBody.content["application/xml"].schema, + dict, + frozendict.frozendict + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def put( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + request_body.RequestBody.content["application/xml"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def put( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + request_body.RequestBody.content["application/xml"].schema, + dict, + frozendict.frozendict + ], + content_type: str = 'application/json', + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._update_pet( + body=body, + content_type=content_type, + security_index=security_index, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/put/request_body/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/put/request_body/__init__.py new file mode 100644 index 00000000000..531d33a81bc --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/put/request_body/__init__.py @@ -0,0 +1,11 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.request_bodies import request_body_pet +RequestBody = request_body_pet.Pet diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/put/responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/put/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/put/responses/response_400/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/put/responses/response_400/__init__.py new file mode 100644 index 00000000000..5f3123bab72 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/put/responses/response_400/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor400(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/put/responses/response_404/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/put/responses/response_404/__init__.py new file mode 100644 index 00000000000..e82142578f7 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/put/responses/response_404/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor404(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/put/responses/response_405/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/put/responses/response_405/__init__.py new file mode 100644 index 00000000000..d13237fc695 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/put/responses/response_405/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor405(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/put/security/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/put/security/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/put/security/security_requirement_object_0.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/put/security/security_requirement_object_0.py new file mode 100644 index 00000000000..18260b0a41a --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/put/security/security_requirement_object_0.py @@ -0,0 +1,13 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api import security_schemes + +security_requirement_object: security_schemes.SecurityRequirementObject = { + "http_signature_test": (), +} diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/put/security/security_requirement_object_1.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/put/security/security_requirement_object_1.py new file mode 100644 index 00000000000..3a74df60685 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/put/security/security_requirement_object_1.py @@ -0,0 +1,13 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api import security_schemes + +security_requirement_object: security_schemes.SecurityRequirementObject = { + "petstore_auth": ("write:pets", "read:pets", ), +} diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_status/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_status/__init__.py new file mode 100644 index 00000000000..a80cd1f3dd7 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_status/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from petstore_api.apis.paths.pet_find_by_status import PetFindByStatus + +path = "/pet/findByStatus" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_status/get/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_status/get/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_status/get/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_status/get/operation.py new file mode 100644 index 00000000000..2e54e0c296e --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_status/get/operation.py @@ -0,0 +1,332 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions, security_schemes +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from .. import path +from .responses import ( + response_200, + response_400, +) +from .parameters import parameter_0 +from .security import ( + security_requirement_object_0, + security_requirement_object_1, + security_requirement_object_2, +) + + + +class RequestQueryParameters: + RequiredParams = typing_extensions.TypedDict( + 'RequiredParams', + { + 'status': typing.Union[parameter_0.Parameter0.schema, list, tuple], + } + ) + OptionalParams = typing_extensions.TypedDict( + 'OptionalParams', + { + }, + total=False + ) + + + class Params(RequiredParams, OptionalParams): + pass + + + parameters = [ + parameter_0.Parameter0, + ] +_security: typing.List[security_schemes.SecurityRequirementObject] = [ + security_requirement_object_0.security_requirement_object, + security_requirement_object_1.security_requirement_object, + security_requirement_object_2.security_requirement_object, +] + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + '400': typing.Type[response_400.ResponseFor400], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, + '400': response_400.ResponseFor400, +} + +_all_accept_content_types = ( + "application/xml", + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _find_pets_by_status( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _find_pets_by_status( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _find_pets_by_status( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _find_pets_by_status( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + Finds Pets by status + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs(RequestQueryParameters.Params, query_params) + used_path = path + + prefix_separator_iterator = None + for parameter in RequestQueryParameters.parameters: + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'paths/' + path + '/' + '/servers', server_index + ) + security_requirement_object = self.api_client.configuration.get_security_requirement_object( + 'paths/' + path + '/get/security', + _security, + security_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='get', + host=host, + headers=_headers, + security_requirement_object=security_requirement_object, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + '400', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class FindPetsByStatus(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def find_pets_by_status( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def find_pets_by_status( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def find_pets_by_status( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def find_pets_by_status( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._find_pets_by_status( + query_params=query_params, + accept_content_types=accept_content_types, + security_index=security_index, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForGet(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def get( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def get( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._find_pets_by_status( + query_params=query_params, + accept_content_types=accept_content_types, + security_index=security_index, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_status/get/parameters/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_status/get/parameters/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_status/get/parameters/parameter_0/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_status/get/parameters/parameter_0/__init__.py new file mode 100644 index 00000000000..5677a95ee95 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_status/get/parameters/parameter_0/__init__.py @@ -0,0 +1,21 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client + +from . import schema + + +class Parameter0(api_client.QueryParameter): + name = "status" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + required = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_status/get/parameters/parameter_0/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_status/get/parameters/parameter_0/schema.py new file mode 100644 index 00000000000..7bbdcce4300 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_status/get/parameters/parameter_0/schema.py @@ -0,0 +1,82 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Schema( + schemas.ListSchema +): + + + class Schema_: + types = {tuple} + + + class Items( + schemas.StrSchema + ): + + + class Schema_: + types = { + str, + } + default = "available" + enum_value_to_name = { + "available": "AVAILABLE", + "pending": "PENDING", + "sold": "SOLD", + } + + @schemas.classproperty + def AVAILABLE(cls): + return cls("available") + + @schemas.classproperty + def PENDING(cls): + return cls("pending") + + @schemas.classproperty + def SOLD(cls): + return cls("sold") + + def __new__( + cls, + arg_: typing.Union[ + typing.Tuple[ + typing.Union[Schema_.Items, str], ... + ], + typing.List[ + typing.Union[Schema_.Items, str] + ], + ], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'Schema': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) + + def __getitem__(self, i: int) -> Schema_.Items: + return super().__getitem__(i) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_status/get/responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_status/get/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_status/get/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_status/get/responses/response_200/__init__.py new file mode 100644 index 00000000000..2c58c2d5976 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_status/get/responses/response_200/__init__.py @@ -0,0 +1,11 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.responses import response_successful_xml_and_json_array_of_pet +ResponseFor200 = response_successful_xml_and_json_array_of_pet.SuccessfulXmlAndJsonArrayOfPet diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_status/get/responses/response_400/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_status/get/responses/response_400/__init__.py new file mode 100644 index 00000000000..5f3123bab72 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_status/get/responses/response_400/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor400(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_status/get/security/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_status/get/security/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_status/get/security/security_requirement_object_0.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_status/get/security/security_requirement_object_0.py new file mode 100644 index 00000000000..b90c03aa300 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_status/get/security/security_requirement_object_0.py @@ -0,0 +1,13 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api import security_schemes + +security_requirement_object: security_schemes.SecurityRequirementObject = { + "api_key": (), +} diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_status/get/security/security_requirement_object_1.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_status/get/security/security_requirement_object_1.py new file mode 100644 index 00000000000..18260b0a41a --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_status/get/security/security_requirement_object_1.py @@ -0,0 +1,13 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api import security_schemes + +security_requirement_object: security_schemes.SecurityRequirementObject = { + "http_signature_test": (), +} diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_status/get/security/security_requirement_object_2.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_status/get/security/security_requirement_object_2.py new file mode 100644 index 00000000000..3a74df60685 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_status/get/security/security_requirement_object_2.py @@ -0,0 +1,13 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api import security_schemes + +security_requirement_object: security_schemes.SecurityRequirementObject = { + "petstore_auth": ("write:pets", "read:pets", ), +} diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_status/servers/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_status/servers/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_status/servers/server_0.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_status/servers/server_0.py new file mode 100644 index 00000000000..c07da2397b5 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_status/servers/server_0.py @@ -0,0 +1,16 @@ +# coding: utf-8 +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import typing + +from petstore_api import server + + +@dataclasses.dataclass +class Server0(server.Server): + _url: str = "https://path-server-test.petstore.local/v2" diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_status/servers/server_1.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_status/servers/server_1.py new file mode 100644 index 00000000000..11300222049 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_status/servers/server_1.py @@ -0,0 +1,70 @@ +# coding: utf-8 +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import typing +import typing_extensions + +from petstore_api import server, schemas + + +class _Variables: + + + class Version( + schemas.StrSchema + ): + + + class Schema_: + types = { + str, + } + default = "v1" + enum_value_to_name = { + "v1": "V1", + "v2": "V2", + } + + @schemas.classproperty + def V1(cls): + return cls("v1") + + @schemas.classproperty + def V2(cls): + return cls("v2") + +_VariablesSchemas = typing_extensions.TypedDict( + '_VariablesSchemas', + { + "version": typing.Type[_Variables.Version], + }, + total=False +) + +Variables = typing_extensions.TypedDict( + 'Variables', + { + "version": typing_extensions.Literal[ + "v1", + "v2", + ], + }, + total=False +) + +def _default_variable_schemas(): + return { + "version": _Variables.Version, + } + + +@dataclasses.dataclass +class Server1(server.Server): + _url: str = "https://petstore.swagger.io/{version}" + variables: Variables + variable_schemas: _VariablesSchemas = dataclasses.field(default_factory=_default_variable_schemas) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_tags/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_tags/__init__.py new file mode 100644 index 00000000000..cd435aca2bb --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_tags/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from petstore_api.apis.paths.pet_find_by_tags import PetFindByTags + +path = "/pet/findByTags" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_tags/get/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_tags/get/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_tags/get/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_tags/get/operation.py new file mode 100644 index 00000000000..9e88dbe6c30 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_tags/get/operation.py @@ -0,0 +1,304 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from petstore_api import api_client, exceptions, security_schemes +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from .. import path +from .responses import ( + response_200, + response_400, +) +from .parameters import parameter_0 +from .security import ( + security_requirement_object_0, + security_requirement_object_1, +) + + + +class RequestQueryParameters: + RequiredParams = typing_extensions.TypedDict( + 'RequiredParams', + { + 'tags': typing.Union[parameter_0.Parameter0.schema, list, tuple], + } + ) + OptionalParams = typing_extensions.TypedDict( + 'OptionalParams', + { + }, + total=False + ) + + + class Params(RequiredParams, OptionalParams): + pass + + + parameters = [ + parameter_0.Parameter0, + ] +_security: typing.List[security_schemes.SecurityRequirementObject] = [ + security_requirement_object_0.security_requirement_object, + security_requirement_object_1.security_requirement_object, +] + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + '400': typing.Type[response_400.ResponseFor400], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, + '400': response_400.ResponseFor400, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _find_pets_by_tags( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _find_pets_by_tags( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _find_pets_by_tags( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _find_pets_by_tags( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + Finds Pets by tags + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs(RequestQueryParameters.Params, query_params) + used_path = path + + prefix_separator_iterator = None + for parameter in RequestQueryParameters.parameters: + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + # TODO add cookie handling + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + security_requirement_object = self.api_client.configuration.get_security_requirement_object( + 'paths/' + path + '/get/security', + _security, + security_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='get', + host=host, + security_requirement_object=security_requirement_object, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + '400', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class FindPetsByTags(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def find_pets_by_tags( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def find_pets_by_tags( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def find_pets_by_tags( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def find_pets_by_tags( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._find_pets_by_tags( + query_params=query_params, + security_index=security_index, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForGet(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def get( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def get( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._find_pets_by_tags( + query_params=query_params, + security_index=security_index, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_tags/get/parameters/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_tags/get/parameters/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_tags/get/parameters/parameter_0/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_tags/get/parameters/parameter_0/__init__.py new file mode 100644 index 00000000000..1607674308e --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_tags/get/parameters/parameter_0/__init__.py @@ -0,0 +1,21 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client + +from . import schema + + +class Parameter0(api_client.QueryParameter): + name = "tags" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + required = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_tags/get/parameters/parameter_0/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_tags/get/parameters/parameter_0/schema.py new file mode 100644 index 00000000000..59aff0b39f0 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_tags/get/parameters/parameter_0/schema.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Schema( + schemas.ListSchema +): + + + class Schema_: + types = {tuple} + Items = schemas.StrSchema + + def __new__( + cls, + arg_: typing.Union[ + typing.Tuple[ + typing.Union[Schema_.Items, str], ... + ], + typing.List[ + typing.Union[Schema_.Items, str] + ], + ], + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + ) -> 'Schema': + return super().__new__( + cls, + arg_, + configuration_=configuration_, + ) + + def __getitem__(self, i: int) -> Schema_.Items: + return super().__getitem__(i) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_tags/get/responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_tags/get/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_tags/get/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_tags/get/responses/response_200/__init__.py new file mode 100644 index 00000000000..4d1f7490211 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_tags/get/responses/response_200/__init__.py @@ -0,0 +1,11 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.responses import response_ref_successful_xml_and_json_array_of_pet +ResponseFor200 = response_ref_successful_xml_and_json_array_of_pet.RefSuccessfulXmlAndJsonArrayOfPet diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_tags/get/responses/response_400/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_tags/get/responses/response_400/__init__.py new file mode 100644 index 00000000000..5f3123bab72 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_tags/get/responses/response_400/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor400(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_tags/get/security/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_tags/get/security/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_tags/get/security/security_requirement_object_0.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_tags/get/security/security_requirement_object_0.py new file mode 100644 index 00000000000..18260b0a41a --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_tags/get/security/security_requirement_object_0.py @@ -0,0 +1,13 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api import security_schemes + +security_requirement_object: security_schemes.SecurityRequirementObject = { + "http_signature_test": (), +} diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_tags/get/security/security_requirement_object_1.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_tags/get/security/security_requirement_object_1.py new file mode 100644 index 00000000000..3a74df60685 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_tags/get/security/security_requirement_object_1.py @@ -0,0 +1,13 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api import security_schemes + +security_requirement_object: security_schemes.SecurityRequirementObject = { + "petstore_auth": ("write:pets", "read:pets", ), +} diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/__init__.py new file mode 100644 index 00000000000..0a4a917b1a6 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from petstore_api.apis.paths.pet_pet_id import PetPetId + +path = "/pet/{petId}" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/delete/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/delete/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/delete/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/delete/operation.py new file mode 100644 index 00000000000..89856d0dd49 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/delete/operation.py @@ -0,0 +1,343 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions, security_schemes +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from .. import path +from .responses import response_400 +from .parameters import ( + parameter_0, + parameter_1, +) +from .security import ( + security_requirement_object_0, + security_requirement_object_1, +) + + + +class RequestHeaderParameters: + RequiredParams = typing_extensions.TypedDict( + 'RequiredParams', + { + } + ) + OptionalParams = typing_extensions.TypedDict( + 'OptionalParams', + { + 'api_key': typing.Union[parameter_0.Parameter0.schema, str], + }, + total=False + ) + + + class Params(RequiredParams, OptionalParams): + pass + + + parameters = [ + parameter_0.Parameter0, + ] + +class RequestPathParameters: + RequiredParams = typing_extensions.TypedDict( + 'RequiredParams', + { + 'petId': typing.Union[parameter_1.Parameter1.schema, decimal.Decimal, int], + } + ) + OptionalParams = typing_extensions.TypedDict( + 'OptionalParams', + { + }, + total=False + ) + + + class Params(RequiredParams, OptionalParams): + pass + + + parameters = [ + parameter_1.Parameter1, + ] +_security: typing.List[security_schemes.SecurityRequirementObject] = [ + security_requirement_object_0.security_requirement_object, + security_requirement_object_1.security_requirement_object, +] + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '400': typing.Type[response_400.ResponseFor400], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '400': response_400.ResponseFor400, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _delete_pet( + self, + header_params: RequestHeaderParameters.Params = frozendict.frozendict(), + path_params: RequestPathParameters.Params = frozendict.frozendict(), + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> api_client.ApiResponseWithoutDeserialization: ... + @typing.overload + def _delete_pet( + self, + skip_deserialization: typing_extensions.Literal[True], + header_params: RequestHeaderParameters.Params = frozendict.frozendict(), + path_params: RequestPathParameters.Params = frozendict.frozendict(), + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _delete_pet( + self, + header_params: RequestHeaderParameters.Params = frozendict.frozendict(), + path_params: RequestPathParameters.Params = frozendict.frozendict(), + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _delete_pet( + self, + header_params: RequestHeaderParameters.Params = frozendict.frozendict(), + path_params: RequestPathParameters.Params = frozendict.frozendict(), + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + Deletes a pet + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs(RequestHeaderParameters.Params, header_params) + self._verify_typed_dict_inputs(RequestPathParameters.Params, path_params) + used_path = path + + _path_params = {} + for parameter in RequestPathParameters.parameters: + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + + _headers = HTTPHeaderDict() + for parameter in RequestHeaderParameters.parameters: + parameter_data = header_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _headers.extend(serialized_data) + # TODO add cookie handling + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + security_requirement_object = self.api_client.configuration.get_security_requirement_object( + 'paths/' + path + '/delete/security', + _security, + security_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='delete', + host=host, + headers=_headers, + security_requirement_object=security_requirement_object, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '400', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class DeletePet(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def delete_pet( + self, + header_params: RequestHeaderParameters.Params = frozendict.frozendict(), + path_params: RequestPathParameters.Params = frozendict.frozendict(), + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> api_client.ApiResponseWithoutDeserialization: ... + @typing.overload + def delete_pet( + self, + skip_deserialization: typing_extensions.Literal[True], + header_params: RequestHeaderParameters.Params = frozendict.frozendict(), + path_params: RequestPathParameters.Params = frozendict.frozendict(), + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def delete_pet( + self, + header_params: RequestHeaderParameters.Params = frozendict.frozendict(), + path_params: RequestPathParameters.Params = frozendict.frozendict(), + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def delete_pet( + self, + header_params: RequestHeaderParameters.Params = frozendict.frozendict(), + path_params: RequestPathParameters.Params = frozendict.frozendict(), + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._delete_pet( + header_params=header_params, + path_params=path_params, + security_index=security_index, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForDelete(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def delete( + self, + header_params: RequestHeaderParameters.Params = frozendict.frozendict(), + path_params: RequestPathParameters.Params = frozendict.frozendict(), + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> api_client.ApiResponseWithoutDeserialization: ... + @typing.overload + def delete( + self, + skip_deserialization: typing_extensions.Literal[True], + header_params: RequestHeaderParameters.Params = frozendict.frozendict(), + path_params: RequestPathParameters.Params = frozendict.frozendict(), + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def delete( + self, + header_params: RequestHeaderParameters.Params = frozendict.frozendict(), + path_params: RequestPathParameters.Params = frozendict.frozendict(), + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def delete( + self, + header_params: RequestHeaderParameters.Params = frozendict.frozendict(), + path_params: RequestPathParameters.Params = frozendict.frozendict(), + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._delete_pet( + header_params=header_params, + path_params=path_params, + security_index=security_index, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/delete/parameters/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/delete/parameters/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/delete/parameters/parameter_0/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/delete/parameters/parameter_0/__init__.py new file mode 100644 index 00000000000..27839cbdb3c --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/delete/parameters/parameter_0/__init__.py @@ -0,0 +1,20 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client + +from . import schema + + +class Parameter0(api_client.HeaderParameter): + name = "api_key" + style = api_client.ParameterStyle.SIMPLE + schema = schema.Schema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/delete/parameters/parameter_0/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/delete/parameters/parameter_0/schema.py new file mode 100644 index 00000000000..0518c0e6e64 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/delete/parameters/parameter_0/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.StrSchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/delete/parameters/parameter_1/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/delete/parameters/parameter_1/__init__.py new file mode 100644 index 00000000000..520e8f5396d --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/delete/parameters/parameter_1/__init__.py @@ -0,0 +1,21 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client + +from . import schema + + +class Parameter1(api_client.PathParameter): + name = "petId" + style = api_client.ParameterStyle.SIMPLE + schema = schema.Schema + required = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/delete/parameters/parameter_1/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/delete/parameters/parameter_1/schema.py new file mode 100644 index 00000000000..77eefe64028 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/delete/parameters/parameter_1/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.Int64Schema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/delete/responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/delete/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/delete/responses/response_400/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/delete/responses/response_400/__init__.py new file mode 100644 index 00000000000..5f3123bab72 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/delete/responses/response_400/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor400(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/delete/security/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/delete/security/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/delete/security/security_requirement_object_0.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/delete/security/security_requirement_object_0.py new file mode 100644 index 00000000000..b90c03aa300 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/delete/security/security_requirement_object_0.py @@ -0,0 +1,13 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api import security_schemes + +security_requirement_object: security_schemes.SecurityRequirementObject = { + "api_key": (), +} diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/delete/security/security_requirement_object_1.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/delete/security/security_requirement_object_1.py new file mode 100644 index 00000000000..3a74df60685 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/delete/security/security_requirement_object_1.py @@ -0,0 +1,13 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api import security_schemes + +security_requirement_object: security_schemes.SecurityRequirementObject = { + "petstore_auth": ("write:pets", "read:pets", ), +} diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/get/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/get/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/get/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/get/operation.py new file mode 100644 index 00000000000..65e38e07a07 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/get/operation.py @@ -0,0 +1,330 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions, security_schemes +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from .. import path +from .responses import ( + response_200, + response_400, + response_404, +) +from .parameters import parameter_0 +from .security import security_requirement_object_0 + + + +class RequestPathParameters: + RequiredParams = typing_extensions.TypedDict( + 'RequiredParams', + { + 'petId': typing.Union[parameter_0.Parameter0.schema, decimal.Decimal, int], + } + ) + OptionalParams = typing_extensions.TypedDict( + 'OptionalParams', + { + }, + total=False + ) + + + class Params(RequiredParams, OptionalParams): + pass + + + parameters = [ + parameter_0.Parameter0, + ] +_security: typing.List[security_schemes.SecurityRequirementObject] = [ + security_requirement_object_0.security_requirement_object, +] + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + '400': typing.Type[response_400.ResponseFor400], + '404': typing.Type[response_404.ResponseFor404], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, + '400': response_400.ResponseFor400, + '404': response_404.ResponseFor404, +} + +_all_accept_content_types = ( + "application/xml", + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _get_pet_by_id( + self, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _get_pet_by_id( + self, + skip_deserialization: typing_extensions.Literal[True], + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _get_pet_by_id( + self, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _get_pet_by_id( + self, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + Find pet by ID + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs(RequestPathParameters.Params, path_params) + used_path = path + + _path_params = {} + for parameter in RequestPathParameters.parameters: + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + security_requirement_object = self.api_client.configuration.get_security_requirement_object( + 'paths/' + path + '/get/security', + _security, + security_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='get', + host=host, + headers=_headers, + security_requirement_object=security_requirement_object, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + '400', + '404', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class GetPetById(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def get_pet_by_id( + self, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def get_pet_by_id( + self, + skip_deserialization: typing_extensions.Literal[True], + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get_pet_by_id( + self, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get_pet_by_id( + self, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._get_pet_by_id( + path_params=path_params, + accept_content_types=accept_content_types, + security_index=security_index, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForGet(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def get( + self, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def get( + self, + skip_deserialization: typing_extensions.Literal[True], + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get( + self, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get( + self, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._get_pet_by_id( + path_params=path_params, + accept_content_types=accept_content_types, + security_index=security_index, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/get/parameters/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/get/parameters/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/get/parameters/parameter_0/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/get/parameters/parameter_0/__init__.py new file mode 100644 index 00000000000..bdb481da5c2 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/get/parameters/parameter_0/__init__.py @@ -0,0 +1,21 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client + +from . import schema + + +class Parameter0(api_client.PathParameter): + name = "petId" + style = api_client.ParameterStyle.SIMPLE + schema = schema.Schema + required = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/get/parameters/parameter_0/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/get/parameters/parameter_0/schema.py new file mode 100644 index 00000000000..77eefe64028 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/get/parameters/parameter_0/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.Int64Schema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/get/responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/get/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/get/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/get/responses/response_200/__init__.py new file mode 100644 index 00000000000..6b5fef95b97 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/get/responses/response_200/__init__.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas +from .content.application_xml import schema as application_xml_schema +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + application_xml_schema.Schema, + application_json_schema.Schema, + ] + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationXmlMediaType(api_client.MediaType): + schema: typing.Type[application_xml_schema.Schema] = application_xml_schema.Schema + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/xml': typing.Type[__ApplicationXmlMediaType], + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/xml': __ApplicationXmlMediaType, + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/get/responses/response_200/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/get/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/get/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/get/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/get/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/get/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..8cafbc98d19 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/get/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.schema import ref_pet +Schema = ref_pet.RefPet diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/get/responses/response_200/content/application_xml/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/get/responses/response_200/content/application_xml/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/get/responses/response_200/content/application_xml/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/get/responses/response_200/content/application_xml/schema.py new file mode 100644 index 00000000000..cf483f6eb79 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/get/responses/response_200/content/application_xml/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.schema import pet +Schema = pet.Pet diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/get/responses/response_400/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/get/responses/response_400/__init__.py new file mode 100644 index 00000000000..5f3123bab72 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/get/responses/response_400/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor400(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/get/responses/response_404/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/get/responses/response_404/__init__.py new file mode 100644 index 00000000000..e82142578f7 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/get/responses/response_404/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor404(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/get/security/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/get/security/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/get/security/security_requirement_object_0.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/get/security/security_requirement_object_0.py new file mode 100644 index 00000000000..b90c03aa300 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/get/security/security_requirement_object_0.py @@ -0,0 +1,13 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api import security_schemes + +security_requirement_object: security_schemes.SecurityRequirementObject = { + "api_key": (), +} diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/post/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/post/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/post/operation.py new file mode 100644 index 00000000000..ceae8618502 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/post/operation.py @@ -0,0 +1,451 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions, security_schemes +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from .. import path +from .responses import response_405 +from . import request_body +from .parameters import parameter_0 +from .security import ( + security_requirement_object_0, + security_requirement_object_1, +) + + + +class RequestPathParameters: + RequiredParams = typing_extensions.TypedDict( + 'RequiredParams', + { + 'petId': typing.Union[parameter_0.Parameter0.schema, decimal.Decimal, int], + } + ) + OptionalParams = typing_extensions.TypedDict( + 'OptionalParams', + { + }, + total=False + ) + + + class Params(RequiredParams, OptionalParams): + pass + + + parameters = [ + parameter_0.Parameter0, + ] +_security: typing.List[security_schemes.SecurityRequirementObject] = [ + security_requirement_object_0.security_requirement_object, + security_requirement_object_1.security_requirement_object, +] + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '405': typing.Type[response_405.ResponseFor405], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '405': response_405.ResponseFor405, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _update_pet_with_form( + self, + content_type: typing_extensions.Literal["application/x-www-form-urlencoded"] = ..., + body: typing.Union[ + request_body.RequestBody.content["application/x-www-form-urlencoded"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> api_client.ApiResponseWithoutDeserialization: ... + @typing.overload + def _update_pet_with_form( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/x-www-form-urlencoded"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _update_pet_with_form( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/x-www-form-urlencoded"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _update_pet_with_form( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/x-www-form-urlencoded"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _update_pet_with_form( + self, + content_type: str = 'application/x-www-form-urlencoded', + body: typing.Union[ + request_body.RequestBody.content["application/x-www-form-urlencoded"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + Updates a pet in the store with form data + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs(RequestPathParameters.Params, path_params) + used_path = path + + _path_params = {} + for parameter in RequestPathParameters.parameters: + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + _fields = None + _body = None + if body is not schemas.unset: + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + security_requirement_object = self.api_client.configuration.get_security_requirement_object( + 'paths/' + path + '/post/security', + _security, + security_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + security_requirement_object=security_requirement_object, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '405', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class UpdatePetWithForm(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def update_pet_with_form( + self, + content_type: typing_extensions.Literal["application/x-www-form-urlencoded"] = ..., + body: typing.Union[ + request_body.RequestBody.content["application/x-www-form-urlencoded"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> api_client.ApiResponseWithoutDeserialization: ... + @typing.overload + def update_pet_with_form( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/x-www-form-urlencoded"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def update_pet_with_form( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/x-www-form-urlencoded"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def update_pet_with_form( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/x-www-form-urlencoded"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def update_pet_with_form( + self, + content_type: str = 'application/x-www-form-urlencoded', + body: typing.Union[ + request_body.RequestBody.content["application/x-www-form-urlencoded"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._update_pet_with_form( + body=body, + path_params=path_params, + content_type=content_type, + security_index=security_index, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + content_type: typing_extensions.Literal["application/x-www-form-urlencoded"] = ..., + body: typing.Union[ + request_body.RequestBody.content["application/x-www-form-urlencoded"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> api_client.ApiResponseWithoutDeserialization: ... + @typing.overload + def post( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/x-www-form-urlencoded"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/x-www-form-urlencoded"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["application/x-www-form-urlencoded"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + content_type: str = 'application/x-www-form-urlencoded', + body: typing.Union[ + request_body.RequestBody.content["application/x-www-form-urlencoded"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._update_pet_with_form( + body=body, + path_params=path_params, + content_type=content_type, + security_index=security_index, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/post/parameters/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/post/parameters/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/post/parameters/parameter_0/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/post/parameters/parameter_0/__init__.py new file mode 100644 index 00000000000..bdb481da5c2 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/post/parameters/parameter_0/__init__.py @@ -0,0 +1,21 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client + +from . import schema + + +class Parameter0(api_client.PathParameter): + name = "petId" + style = api_client.ParameterStyle.SIMPLE + schema = schema.Schema + required = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/post/parameters/parameter_0/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/post/parameters/parameter_0/schema.py new file mode 100644 index 00000000000..77eefe64028 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/post/parameters/parameter_0/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.Int64Schema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/post/request_body/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/post/request_body/__init__.py new file mode 100644 index 00000000000..027fa5924fc --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/post/request_body/__init__.py @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client +from .content.application_x_www_form_urlencoded import schema as application_x_www_form_urlencoded_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationXWwwFormUrlencodedMediaType(api_client.MediaType): + schema: typing.Type[application_x_www_form_urlencoded_schema.Schema] = application_x_www_form_urlencoded_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/x-www-form-urlencoded': typing.Type[__ApplicationXWwwFormUrlencodedMediaType], + } + ) + content: __Content = { + 'application/x-www-form-urlencoded': __ApplicationXWwwFormUrlencodedMediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/post/request_body/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/post/request_body/content/application_x_www_form_urlencoded/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/post/request_body/content/application_x_www_form_urlencoded/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/post/request_body/content/application_x_www_form_urlencoded/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/post/request_body/content/application_x_www_form_urlencoded/schema.py new file mode 100644 index 00000000000..bbbf1a071e6 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/post/request_body/content/application_x_www_form_urlencoded/schema.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Schema( + schemas.DictSchema +): + + + class Schema_: + types = {frozendict.frozendict} + + class Properties: + Name = schemas.StrSchema + Status = schemas.StrSchema + __annotations__ = { + "name": Name, + "status": Status, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["name"]) -> Schema_.Properties.Name: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["status"]) -> Schema_.Properties.Status: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["name"], + typing_extensions.Literal["status"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["name"]) -> typing.Union[Schema_.Properties.Name, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["status"]) -> typing.Union[Schema_.Properties.Status, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["name"], + typing_extensions.Literal["status"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + name: typing.Union[Schema_.Properties.Name, str, schemas.Unset] = schemas.unset, + status: typing.Union[Schema_.Properties.Status, str, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'Schema': + return super().__new__( + cls, + *args_, + name=name, + status=status, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/post/responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/post/responses/response_405/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/post/responses/response_405/__init__.py new file mode 100644 index 00000000000..d13237fc695 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/post/responses/response_405/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor405(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/post/security/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/post/security/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/post/security/security_requirement_object_0.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/post/security/security_requirement_object_0.py new file mode 100644 index 00000000000..b90c03aa300 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/post/security/security_requirement_object_0.py @@ -0,0 +1,13 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api import security_schemes + +security_requirement_object: security_schemes.SecurityRequirementObject = { + "api_key": (), +} diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/post/security/security_requirement_object_1.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/post/security/security_requirement_object_1.py new file mode 100644 index 00000000000..3a74df60685 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/post/security/security_requirement_object_1.py @@ -0,0 +1,13 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api import security_schemes + +security_requirement_object: security_schemes.SecurityRequirementObject = { + "petstore_auth": ("write:pets", "read:pets", ), +} diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id_upload_image/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id_upload_image/__init__.py new file mode 100644 index 00000000000..50f1bdb9d7b --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id_upload_image/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from petstore_api.apis.paths.pet_pet_id_upload_image import PetPetIdUploadImage + +path = "/pet/{petId}/uploadImage" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id_upload_image/post/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id_upload_image/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id_upload_image/post/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id_upload_image/post/operation.py new file mode 100644 index 00000000000..05481d9fb86 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id_upload_image/post/operation.py @@ -0,0 +1,480 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions, security_schemes +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from . import request_body +from .parameters import parameter_0 +from .security import security_requirement_object_0 + + + +class RequestPathParameters: + RequiredParams = typing_extensions.TypedDict( + 'RequiredParams', + { + 'petId': typing.Union[parameter_0.Parameter0.schema, decimal.Decimal, int], + } + ) + OptionalParams = typing_extensions.TypedDict( + 'OptionalParams', + { + }, + total=False + ) + + + class Params(RequiredParams, OptionalParams): + pass + + + parameters = [ + parameter_0.Parameter0, + ] +_security: typing.List[security_schemes.SecurityRequirementObject] = [ + security_requirement_object_0.security_requirement_object, +] + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _upload_image( + self, + content_type: typing_extensions.Literal["multipart/form-data"] = ..., + body: typing.Union[ + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _upload_image( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _upload_image( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _upload_image( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _upload_image( + self, + content_type: str = 'multipart/form-data', + body: typing.Union[ + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + uploads an image + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs(RequestPathParameters.Params, path_params) + used_path = path + + _path_params = {} + for parameter in RequestPathParameters.parameters: + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + _fields = None + _body = None + if body is not schemas.unset: + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + security_requirement_object = self.api_client.configuration.get_security_requirement_object( + 'paths/' + path + '/post/security', + _security, + security_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + security_requirement_object=security_requirement_object, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class UploadImage(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def upload_image( + self, + content_type: typing_extensions.Literal["multipart/form-data"] = ..., + body: typing.Union[ + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def upload_image( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def upload_image( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def upload_image( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def upload_image( + self, + content_type: str = 'multipart/form-data', + body: typing.Union[ + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._upload_image( + body=body, + path_params=path_params, + content_type=content_type, + accept_content_types=accept_content_types, + security_index=security_index, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + content_type: typing_extensions.Literal["multipart/form-data"] = ..., + body: typing.Union[ + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + content_type: str = ..., + body: typing.Union[ + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + content_type: str = 'multipart/form-data', + body: typing.Union[ + request_body.RequestBody.content["multipart/form-data"].schema, + schemas.Unset, + dict, + frozendict.frozendict + ] = schemas.unset, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._upload_image( + body=body, + path_params=path_params, + content_type=content_type, + accept_content_types=accept_content_types, + security_index=security_index, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id_upload_image/post/parameters/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id_upload_image/post/parameters/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id_upload_image/post/parameters/parameter_0/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id_upload_image/post/parameters/parameter_0/__init__.py new file mode 100644 index 00000000000..bdb481da5c2 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id_upload_image/post/parameters/parameter_0/__init__.py @@ -0,0 +1,21 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client + +from . import schema + + +class Parameter0(api_client.PathParameter): + name = "petId" + style = api_client.ParameterStyle.SIMPLE + schema = schema.Schema + required = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id_upload_image/post/parameters/parameter_0/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id_upload_image/post/parameters/parameter_0/schema.py new file mode 100644 index 00000000000..77eefe64028 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id_upload_image/post/parameters/parameter_0/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.Int64Schema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id_upload_image/post/request_body/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id_upload_image/post/request_body/__init__.py new file mode 100644 index 00000000000..528cb05ef27 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id_upload_image/post/request_body/__init__.py @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client +from .content.multipart_form_data import schema as multipart_form_data_schema + +class RequestBody(api_client.RequestBody): + + + class __MultipartFormDataMediaType(api_client.MediaType): + schema: typing.Type[multipart_form_data_schema.Schema] = multipart_form_data_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'multipart/form-data': typing.Type[__MultipartFormDataMediaType], + } + ) + content: __Content = { + 'multipart/form-data': __MultipartFormDataMediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id_upload_image/post/request_body/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id_upload_image/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id_upload_image/post/request_body/content/multipart_form_data/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id_upload_image/post/request_body/content/multipart_form_data/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id_upload_image/post/request_body/content/multipart_form_data/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id_upload_image/post/request_body/content/multipart_form_data/schema.py new file mode 100644 index 00000000000..311cdf373dc --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id_upload_image/post/request_body/content/multipart_form_data/schema.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Schema( + schemas.DictSchema +): + + + class Schema_: + types = {frozendict.frozendict} + + class Properties: + AdditionalMetadata = schemas.StrSchema + File = schemas.BinarySchema + __annotations__ = { + "additionalMetadata": AdditionalMetadata, + "file": File, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["additionalMetadata"]) -> Schema_.Properties.AdditionalMetadata: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["file"]) -> Schema_.Properties.File: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__( + self, + name: typing.Union[ + typing_extensions.Literal["additionalMetadata"], + typing_extensions.Literal["file"], + str + ] + ): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["additionalMetadata"]) -> typing.Union[Schema_.Properties.AdditionalMetadata, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: typing_extensions.Literal["file"]) -> typing.Union[Schema_.Properties.File, schemas.Unset]: ... + + @typing.overload + def get_item_(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_( + self, + name: typing.Union[ + typing_extensions.Literal["additionalMetadata"], + typing_extensions.Literal["file"], + str + ] + ): + return super().get_item_(name) + + def __new__( + cls, + *args_: typing.Union[dict, frozendict.frozendict], + additionalMetadata: typing.Union[Schema_.Properties.AdditionalMetadata, str, schemas.Unset] = schemas.unset, + file: typing.Union[Schema_.Properties.File, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema], + ) -> 'Schema': + return super().__new__( + cls, + *args_, + additionalMetadata=additionalMetadata, + file=file, + configuration_=configuration_, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id_upload_image/post/responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id_upload_image/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id_upload_image/post/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id_upload_image/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..2cd08a23a73 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id_upload_image/post/responses/response_200/__init__.py @@ -0,0 +1,11 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.responses import response_success_with_json_api_response +ResponseFor200 = response_success_with_json_api_response.SuccessWithJsonApiResponse diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id_upload_image/post/security/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id_upload_image/post/security/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id_upload_image/post/security/security_requirement_object_0.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id_upload_image/post/security/security_requirement_object_0.py new file mode 100644 index 00000000000..3a74df60685 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id_upload_image/post/security/security_requirement_object_0.py @@ -0,0 +1,13 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api import security_schemes + +security_requirement_object: security_schemes.SecurityRequirementObject = { + "petstore_auth": ("write:pets", "read:pets", ), +} diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_inventory/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_inventory/__init__.py new file mode 100644 index 00000000000..828c2fa4421 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_inventory/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from petstore_api.apis.paths.store_inventory import StoreInventory + +path = "/store/inventory" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_inventory/get/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_inventory/get/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_inventory/get/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_inventory/get/operation.py new file mode 100644 index 00000000000..841841e0a0b --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_inventory/get/operation.py @@ -0,0 +1,269 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions, security_schemes +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from .. import path +from .responses import response_200 +from .security import security_requirement_object_0 + + +_security: typing.List[security_schemes.SecurityRequirementObject] = [ + security_requirement_object_0.security_requirement_object, +] + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _get_inventory( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _get_inventory( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _get_inventory( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _get_inventory( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + Returns pet inventories by status + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + security_requirement_object = self.api_client.configuration.get_security_requirement_object( + 'paths/' + path + '/get/security', + _security, + security_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='get', + host=host, + headers=_headers, + security_requirement_object=security_requirement_object, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class GetInventory(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def get_inventory( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def get_inventory( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get_inventory( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get_inventory( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._get_inventory( + accept_content_types=accept_content_types, + security_index=security_index, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForGet(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def get( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def get( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + security_index: typing.Optional[int] = None, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._get_inventory( + accept_content_types=accept_content_types, + security_index=security_index, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_inventory/get/responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_inventory/get/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_inventory/get/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_inventory/get/responses/response_200/__init__.py new file mode 100644 index 00000000000..92968fd96ef --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_inventory/get/responses/response_200/__init__.py @@ -0,0 +1,11 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.responses import response_success_inline_content_and_header +ResponseFor200 = response_success_inline_content_and_header.SuccessInlineContentAndHeader diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_inventory/get/security/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_inventory/get/security/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_inventory/get/security/security_requirement_object_0.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_inventory/get/security/security_requirement_object_0.py new file mode 100644 index 00000000000..b90c03aa300 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_inventory/get/security/security_requirement_object_0.py @@ -0,0 +1,13 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api import security_schemes + +security_requirement_object: security_schemes.SecurityRequirementObject = { + "api_key": (), +} diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order/__init__.py new file mode 100644 index 00000000000..3acf948157b --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from petstore_api.apis.paths.store_order import StoreOrder + +path = "/store/order" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order/post/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order/post/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order/post/operation.py new file mode 100644 index 00000000000..c65931a359e --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order/post/operation.py @@ -0,0 +1,393 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from .. import path +from .responses import ( + response_200, + response_400, +) +from . import request_body + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + '400': typing.Type[response_400.ResponseFor400], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, + '400': response_400.ResponseFor400, +} + +_all_accept_content_types = ( + "application/xml", + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _place_order( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: typing_extensions.Literal["application/json"] = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _place_order( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def _place_order( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _place_order( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _place_order( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = 'application/json', + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + Place an order for a pet + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + '400', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class PlaceOrder(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def place_order( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: typing_extensions.Literal["application/json"] = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def place_order( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def place_order( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def place_order( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def place_order( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = 'application/json', + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._place_order( + body=body, + content_type=content_type, + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: typing_extensions.Literal["application/json"] = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = 'application/json', + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._place_order( + body=body, + content_type=content_type, + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order/post/request_body/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order/post/request_body/__init__.py new file mode 100644 index 00000000000..01f76b5c2be --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order/post/request_body/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order/post/request_body/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..53ddaf7bb4a --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.schema import order +Schema = order.Order diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order/post/responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order/post/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order/post/responses/response_200/__init__.py new file mode 100644 index 00000000000..6b5fef95b97 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order/post/responses/response_200/__init__.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas +from .content.application_xml import schema as application_xml_schema +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + application_xml_schema.Schema, + application_json_schema.Schema, + ] + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationXmlMediaType(api_client.MediaType): + schema: typing.Type[application_xml_schema.Schema] = application_xml_schema.Schema + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/xml': typing.Type[__ApplicationXmlMediaType], + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/xml': __ApplicationXmlMediaType, + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order/post/responses/response_200/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order/post/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order/post/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order/post/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order/post/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..53ddaf7bb4a --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order/post/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.schema import order +Schema = order.Order diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order/post/responses/response_200/content/application_xml/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order/post/responses/response_200/content/application_xml/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order/post/responses/response_200/content/application_xml/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order/post/responses/response_200/content/application_xml/schema.py new file mode 100644 index 00000000000..53ddaf7bb4a --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order/post/responses/response_200/content/application_xml/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.schema import order +Schema = order.Order diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order/post/responses/response_400/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order/post/responses/response_400/__init__.py new file mode 100644 index 00000000000..5f3123bab72 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order/post/responses/response_400/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor400(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/__init__.py new file mode 100644 index 00000000000..c9e1897b938 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from petstore_api.apis.paths.store_order_order_id import StoreOrderOrderId + +path = "/store/order/{order_id}" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/delete/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/delete/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/delete/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/delete/operation.py new file mode 100644 index 00000000000..940209c1f01 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/delete/operation.py @@ -0,0 +1,269 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from petstore_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from .. import path +from .responses import ( + response_400, + response_404, +) +from .parameters import parameter_0 + + + +class RequestPathParameters: + RequiredParams = typing_extensions.TypedDict( + 'RequiredParams', + { + 'order_id': typing.Union[parameter_0.Parameter0.schema, str], + } + ) + OptionalParams = typing_extensions.TypedDict( + 'OptionalParams', + { + }, + total=False + ) + + + class Params(RequiredParams, OptionalParams): + pass + + + parameters = [ + parameter_0.Parameter0, + ] + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '400': typing.Type[response_400.ResponseFor400], + '404': typing.Type[response_404.ResponseFor404], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '400': response_400.ResponseFor400, + '404': response_404.ResponseFor404, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _delete_order( + self, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> api_client.ApiResponseWithoutDeserialization: ... + @typing.overload + def _delete_order( + self, + skip_deserialization: typing_extensions.Literal[True], + path_params: RequestPathParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _delete_order( + self, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _delete_order( + self, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + Delete purchase order by ID + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs(RequestPathParameters.Params, path_params) + used_path = path + + _path_params = {} + for parameter in RequestPathParameters.parameters: + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + # TODO add cookie handling + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='delete', + host=host, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '400', + '404', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class DeleteOrder(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def delete_order( + self, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> api_client.ApiResponseWithoutDeserialization: ... + @typing.overload + def delete_order( + self, + skip_deserialization: typing_extensions.Literal[True], + path_params: RequestPathParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def delete_order( + self, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def delete_order( + self, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._delete_order( + path_params=path_params, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForDelete(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def delete( + self, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> api_client.ApiResponseWithoutDeserialization: ... + @typing.overload + def delete( + self, + skip_deserialization: typing_extensions.Literal[True], + path_params: RequestPathParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def delete( + self, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def delete( + self, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._delete_order( + path_params=path_params, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/delete/parameters/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/delete/parameters/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/delete/parameters/parameter_0/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/delete/parameters/parameter_0/__init__.py new file mode 100644 index 00000000000..2fb785cd96e --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/delete/parameters/parameter_0/__init__.py @@ -0,0 +1,21 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client + +from . import schema + + +class Parameter0(api_client.PathParameter): + name = "order_id" + style = api_client.ParameterStyle.SIMPLE + schema = schema.Schema + required = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/delete/parameters/parameter_0/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/delete/parameters/parameter_0/schema.py new file mode 100644 index 00000000000..0518c0e6e64 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/delete/parameters/parameter_0/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.StrSchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/delete/responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/delete/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/delete/responses/response_400/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/delete/responses/response_400/__init__.py new file mode 100644 index 00000000000..5f3123bab72 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/delete/responses/response_400/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor400(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/delete/responses/response_404/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/delete/responses/response_404/__init__.py new file mode 100644 index 00000000000..e82142578f7 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/delete/responses/response_404/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor404(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/get/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/get/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/get/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/get/operation.py new file mode 100644 index 00000000000..8cfcc709af6 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/get/operation.py @@ -0,0 +1,305 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from .. import path +from .responses import ( + response_200, + response_400, + response_404, +) +from .parameters import parameter_0 + + + +class RequestPathParameters: + RequiredParams = typing_extensions.TypedDict( + 'RequiredParams', + { + 'order_id': typing.Union[parameter_0.Parameter0.schema, decimal.Decimal, int], + } + ) + OptionalParams = typing_extensions.TypedDict( + 'OptionalParams', + { + }, + total=False + ) + + + class Params(RequiredParams, OptionalParams): + pass + + + parameters = [ + parameter_0.Parameter0, + ] + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + '400': typing.Type[response_400.ResponseFor400], + '404': typing.Type[response_404.ResponseFor404], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, + '400': response_400.ResponseFor400, + '404': response_404.ResponseFor404, +} + +_all_accept_content_types = ( + "application/xml", + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _get_order_by_id( + self, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _get_order_by_id( + self, + skip_deserialization: typing_extensions.Literal[True], + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _get_order_by_id( + self, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _get_order_by_id( + self, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + Find purchase order by ID + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs(RequestPathParameters.Params, path_params) + used_path = path + + _path_params = {} + for parameter in RequestPathParameters.parameters: + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='get', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + '400', + '404', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class GetOrderById(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def get_order_by_id( + self, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def get_order_by_id( + self, + skip_deserialization: typing_extensions.Literal[True], + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get_order_by_id( + self, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get_order_by_id( + self, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._get_order_by_id( + path_params=path_params, + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForGet(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def get( + self, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def get( + self, + skip_deserialization: typing_extensions.Literal[True], + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get( + self, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get( + self, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._get_order_by_id( + path_params=path_params, + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/get/parameters/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/get/parameters/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/get/parameters/parameter_0/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/get/parameters/parameter_0/__init__.py new file mode 100644 index 00000000000..2fb785cd96e --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/get/parameters/parameter_0/__init__.py @@ -0,0 +1,21 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client + +from . import schema + + +class Parameter0(api_client.PathParameter): + name = "order_id" + style = api_client.ParameterStyle.SIMPLE + schema = schema.Schema + required = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/get/parameters/parameter_0/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/get/parameters/parameter_0/schema.py new file mode 100644 index 00000000000..b39ba0ae90b --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/get/parameters/parameter_0/schema.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Schema( + schemas.Int64Schema +): + + + class Schema_: + types = { + decimal.Decimal, + } + format = 'int64' + inclusive_maximum = 5 + inclusive_minimum = 1 diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/get/responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/get/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/get/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/get/responses/response_200/__init__.py new file mode 100644 index 00000000000..6b5fef95b97 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/get/responses/response_200/__init__.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas +from .content.application_xml import schema as application_xml_schema +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + application_xml_schema.Schema, + application_json_schema.Schema, + ] + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationXmlMediaType(api_client.MediaType): + schema: typing.Type[application_xml_schema.Schema] = application_xml_schema.Schema + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/xml': typing.Type[__ApplicationXmlMediaType], + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/xml': __ApplicationXmlMediaType, + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/get/responses/response_200/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/get/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/get/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/get/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/get/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/get/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..53ddaf7bb4a --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/get/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.schema import order +Schema = order.Order diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/get/responses/response_200/content/application_xml/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/get/responses/response_200/content/application_xml/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/get/responses/response_200/content/application_xml/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/get/responses/response_200/content/application_xml/schema.py new file mode 100644 index 00000000000..53ddaf7bb4a --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/get/responses/response_200/content/application_xml/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.schema import order +Schema = order.Order diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/get/responses/response_400/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/get/responses/response_400/__init__.py new file mode 100644 index 00000000000..5f3123bab72 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/get/responses/response_400/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor400(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/get/responses/response_404/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/get/responses/response_404/__init__.py new file mode 100644 index 00000000000..e82142578f7 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/get/responses/response_404/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor404(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user/__init__.py new file mode 100644 index 00000000000..ec0c751a0fa --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from petstore_api.apis.paths.user import User + +path = "/user" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user/post/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user/post/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user/post/operation.py new file mode 100644 index 00000000000..adc1d86f7b2 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user/post/operation.py @@ -0,0 +1,346 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from .. import path +from .responses import response_default +from . import request_body + + + +default_response = response_default.Default + + +class BaseApi(api_client.Api): + @typing.overload + def _create_user( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_default.Default.response_cls: ... + + @typing.overload + def _create_user( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_default.Default.response_cls: ... + + + @typing.overload + def _create_user( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _create_user( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_default.Default.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _create_user( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + Create user + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + api_response = default_response.deserialize(response, self.api_client.schema_configuration) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class CreateUser(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def create_user( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_default.Default.response_cls: ... + + @typing.overload + def create_user( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_default.Default.response_cls: ... + + + @typing.overload + def create_user( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def create_user( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_default.Default.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def create_user( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._create_user( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_default.Default.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_default.Default.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_default.Default.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._create_user( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user/post/request_body/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user/post/request_body/__init__.py new file mode 100644 index 00000000000..01f76b5c2be --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user/post/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user/post/request_body/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user/post/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user/post/request_body/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user/post/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user/post/request_body/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user/post/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..483ea128c04 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user/post/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.schema import user +Schema = user.User diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user/post/responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user/post/responses/response_default/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user/post/responses/response_default/__init__.py new file mode 100644 index 00000000000..60374e129f0 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user/post/responses/response_default/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class Default(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_create_with_array/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_create_with_array/__init__.py new file mode 100644 index 00000000000..5d4c011959b --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_create_with_array/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from petstore_api.apis.paths.user_create_with_array import UserCreateWithArray + +path = "/user/createWithArray" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_create_with_array/post/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_create_with_array/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_create_with_array/post/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_create_with_array/post/operation.py new file mode 100644 index 00000000000..54bc4da6934 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_create_with_array/post/operation.py @@ -0,0 +1,346 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from .. import path +from .responses import response_default +from . import request_body + + + +default_response = response_default.Default + + +class BaseApi(api_client.Api): + @typing.overload + def _create_users_with_array_input( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_default.Default.response_cls: ... + + @typing.overload + def _create_users_with_array_input( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_default.Default.response_cls: ... + + + @typing.overload + def _create_users_with_array_input( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _create_users_with_array_input( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_default.Default.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _create_users_with_array_input( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + Creates list of users with given input array + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + api_response = default_response.deserialize(response, self.api_client.schema_configuration) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class CreateUsersWithArrayInput(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def create_users_with_array_input( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_default.Default.response_cls: ... + + @typing.overload + def create_users_with_array_input( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_default.Default.response_cls: ... + + + @typing.overload + def create_users_with_array_input( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def create_users_with_array_input( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_default.Default.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def create_users_with_array_input( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._create_users_with_array_input( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_default.Default.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_default.Default.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_default.Default.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._create_users_with_array_input( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_create_with_array/post/request_body/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_create_with_array/post/request_body/__init__.py new file mode 100644 index 00000000000..f6d3c890977 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_create_with_array/post/request_body/__init__.py @@ -0,0 +1,11 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.request_bodies import request_body_user_array +RequestBody = request_body_user_array.UserArray diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_create_with_array/post/responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_create_with_array/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_create_with_array/post/responses/response_default/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_create_with_array/post/responses/response_default/__init__.py new file mode 100644 index 00000000000..60374e129f0 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_create_with_array/post/responses/response_default/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class Default(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_create_with_list/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_create_with_list/__init__.py new file mode 100644 index 00000000000..531c7dae9a6 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_create_with_list/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from petstore_api.apis.paths.user_create_with_list import UserCreateWithList + +path = "/user/createWithList" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_create_with_list/post/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_create_with_list/post/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_create_with_list/post/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_create_with_list/post/operation.py new file mode 100644 index 00000000000..f8c56d26947 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_create_with_list/post/operation.py @@ -0,0 +1,346 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from .. import path +from .responses import response_default +from . import request_body + + + +default_response = response_default.Default + + +class BaseApi(api_client.Api): + @typing.overload + def _create_users_with_list_input( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_default.Default.response_cls: ... + + @typing.overload + def _create_users_with_list_input( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_default.Default.response_cls: ... + + + @typing.overload + def _create_users_with_list_input( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _create_users_with_list_input( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_default.Default.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _create_users_with_list_input( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + Creates list of users with given input array + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='post', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + api_response = default_response.deserialize(response, self.api_client.schema_configuration) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class CreateUsersWithListInput(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def create_users_with_list_input( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_default.Default.response_cls: ... + + @typing.overload + def create_users_with_list_input( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_default.Default.response_cls: ... + + + @typing.overload + def create_users_with_list_input( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def create_users_with_list_input( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_default.Default.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def create_users_with_list_input( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._create_users_with_list_input( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + content_type: typing_extensions.Literal["application/json"] = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_default.Default.response_cls: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_default.Default.response_cls: ... + + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + content_type: str = ..., + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_default.Default.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + list, + tuple + ], + content_type: str = 'application/json', + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._create_users_with_list_input( + body=body, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_create_with_list/post/request_body/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_create_with_list/post/request_body/__init__.py new file mode 100644 index 00000000000..76bf7c3bab0 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_create_with_list/post/request_body/__init__.py @@ -0,0 +1,11 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.request_bodies import request_body_ref_user_array +RequestBody = request_body_ref_user_array.RefUserArray diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_create_with_list/post/responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_create_with_list/post/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_create_with_list/post/responses/response_default/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_create_with_list/post/responses/response_default/__init__.py new file mode 100644 index 00000000000..60374e129f0 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_create_with_list/post/responses/response_default/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class Default(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/__init__.py new file mode 100644 index 00000000000..03bca1e640b --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from petstore_api.apis.paths.user_login import UserLogin + +path = "/user/login" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/operation.py new file mode 100644 index 00000000000..cf534ea6358 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/operation.py @@ -0,0 +1,306 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from .. import path +from .responses import ( + response_200, + response_400, +) +from .parameters import ( + parameter_0, + parameter_1, +) + + + +class RequestQueryParameters: + RequiredParams = typing_extensions.TypedDict( + 'RequiredParams', + { + 'username': typing.Union[parameter_0.Parameter0.schema, str], + 'password': typing.Union[parameter_1.Parameter1.schema, str], + } + ) + OptionalParams = typing_extensions.TypedDict( + 'OptionalParams', + { + }, + total=False + ) + + + class Params(RequiredParams, OptionalParams): + pass + + + parameters = [ + parameter_0.Parameter0, + parameter_1.Parameter1, + ] + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + '400': typing.Type[response_400.ResponseFor400], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, + '400': response_400.ResponseFor400, +} + +_all_accept_content_types = ( + "application/xml", + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _login_user( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _login_user( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _login_user( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _login_user( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + Logs user into the system + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs(RequestQueryParameters.Params, query_params) + used_path = path + + prefix_separator_iterator = None + for parameter in RequestQueryParameters.parameters: + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='get', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + '400', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class LoginUser(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def login_user( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def login_user( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def login_user( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def login_user( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._login_user( + query_params=query_params, + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForGet(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def get( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def get( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get( + self, + query_params: RequestQueryParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._login_user( + query_params=query_params, + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/parameters/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/parameters/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/parameters/parameter_0/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/parameters/parameter_0/__init__.py new file mode 100644 index 00000000000..41e51cd22ec --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/parameters/parameter_0/__init__.py @@ -0,0 +1,22 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client + +from . import schema + + +class Parameter0(api_client.QueryParameter): + name = "username" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + required = True + explode = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/parameters/parameter_0/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/parameters/parameter_0/schema.py new file mode 100644 index 00000000000..0518c0e6e64 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/parameters/parameter_0/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.StrSchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/parameters/parameter_1/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/parameters/parameter_1/__init__.py new file mode 100644 index 00000000000..f9674788acb --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/parameters/parameter_1/__init__.py @@ -0,0 +1,22 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client + +from . import schema + + +class Parameter1(api_client.QueryParameter): + name = "password" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + required = True + explode = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/parameters/parameter_1/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/parameters/parameter_1/schema.py new file mode 100644 index 00000000000..0518c0e6e64 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/parameters/parameter_1/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.StrSchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/responses/response_200/__init__.py new file mode 100644 index 00000000000..c9e86e203c1 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/responses/response_200/__init__.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas +from .content.application_xml import schema as application_xml_schema +from .content.application_json import schema as application_json_schema +from .headers import header_ref_schema_header +from .headers import header_x_rate_limit +from .headers import header_int32 +from .headers import header_x_expires_after +from .headers import header_ref_content_schema_header +from .headers import header_string_header +from .headers import header_number_header + + +class Header: + RequiredParams = typing_extensions.TypedDict( + 'RequiredParams', + { + 'ref-schema-header': typing.Union[header_ref_schema_header.RefSchemaHeader.schema, dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + 'X-Rate-Limit': typing.Union[header_x_rate_limit.XRateLimit.content["application/json"].schema, decimal.Decimal, int], + 'int32': typing.Union[header_int32.Int32.content["application/json"].schema, decimal.Decimal, int], + 'ref-content-schema-header': typing.Union[header_ref_content_schema_header.RefContentSchemaHeader.content["application/json"].schema, dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader], + 'stringHeader': typing.Union[header_string_header.StringHeader.schema, str], + } + ) + OptionalParams = typing_extensions.TypedDict( + 'OptionalParams', + { + 'X-Expires-After': typing.Union[header_x_expires_after.XExpiresAfter.schema, str, datetime.datetime], + 'numberHeader': typing.Union[header_number_header.NumberHeader.schema, str], + }, + total=False + ) + + + class Params(RequiredParams, OptionalParams): + pass + + + parameters = [ + header_ref_schema_header.RefSchemaHeader, + header_x_rate_limit.XRateLimit, + header_int32.Int32, + header_x_expires_after.XExpiresAfter, + header_ref_content_schema_header.RefContentSchemaHeader, + header_string_header.StringHeader, + header_number_header.NumberHeader, + ] + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + application_xml_schema.Schema, + application_json_schema.Schema, + ] + headers: Header.Params + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationXmlMediaType(api_client.MediaType): + schema: typing.Type[application_xml_schema.Schema] = application_xml_schema.Schema + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/xml': typing.Type[__ApplicationXmlMediaType], + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/xml': __ApplicationXmlMediaType, + 'application/json': __ApplicationJsonMediaType, + } + headers=Header.parameters diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/responses/response_200/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..0518c0e6e64 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/responses/response_200/content/application_json/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.StrSchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/responses/response_200/content/application_xml/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/responses/response_200/content/application_xml/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/responses/response_200/content/application_xml/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/responses/response_200/content/application_xml/schema.py new file mode 100644 index 00000000000..0518c0e6e64 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/responses/response_200/content/application_xml/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.StrSchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/responses/response_200/headers/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/responses/response_200/headers/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/responses/response_200/headers/header_int32/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/responses/response_200/headers/header_int32/__init__.py new file mode 100644 index 00000000000..bd696ad8603 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/responses/response_200/headers/header_int32/__init__.py @@ -0,0 +1,11 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.headers import header_int32_json_content_type_header +Int32 = header_int32_json_content_type_header.Int32JsonContentTypeHeader diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/responses/response_200/headers/header_number_header/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/responses/response_200/headers/header_number_header/__init__.py new file mode 100644 index 00000000000..e4bf13be424 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/responses/response_200/headers/header_number_header/__init__.py @@ -0,0 +1,11 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.headers import header_number_header +NumberHeader = header_number_header.NumberHeader diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/responses/response_200/headers/header_ref_content_schema_header/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/responses/response_200/headers/header_ref_content_schema_header/__init__.py new file mode 100644 index 00000000000..1095b306fa8 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/responses/response_200/headers/header_ref_content_schema_header/__init__.py @@ -0,0 +1,11 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.headers import header_ref_content_schema_header +RefContentSchemaHeader = header_ref_content_schema_header.RefContentSchemaHeader diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/responses/response_200/headers/header_ref_schema_header/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/responses/response_200/headers/header_ref_schema_header/__init__.py new file mode 100644 index 00000000000..5f38c523d80 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/responses/response_200/headers/header_ref_schema_header/__init__.py @@ -0,0 +1,11 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.headers import header_ref_schema_header +RefSchemaHeader = header_ref_schema_header.RefSchemaHeader diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/responses/response_200/headers/header_string_header/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/responses/response_200/headers/header_string_header/__init__.py new file mode 100644 index 00000000000..f9fb5b15f68 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/responses/response_200/headers/header_string_header/__init__.py @@ -0,0 +1,11 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.headers import header_ref_string_header +StringHeader = header_ref_string_header.RefStringHeader diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/responses/response_200/headers/header_x_expires_after/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/responses/response_200/headers/header_x_expires_after/__init__.py new file mode 100644 index 00000000000..ce8883ea743 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/responses/response_200/headers/header_x_expires_after/__init__.py @@ -0,0 +1,18 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client +from . import schema + + +class XExpiresAfter(api_client.HeaderParameterWithoutName): + style = api_client.ParameterStyle.SIMPLE + schema = schema.Schema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/responses/response_200/headers/header_x_expires_after/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/responses/response_200/headers/header_x_expires_after/schema.py new file mode 100644 index 00000000000..b763991168a --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/responses/response_200/headers/header_x_expires_after/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.DateTimeSchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/responses/response_200/headers/header_x_rate_limit/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/responses/response_200/headers/header_x_rate_limit/__init__.py new file mode 100644 index 00000000000..ea430e419af --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/responses/response_200/headers/header_x_rate_limit/__init__.py @@ -0,0 +1,31 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client +from .content.application_json import schema as application_json_schema + + +class XRateLimit(api_client.HeaderParameterWithoutName): + style = api_client.ParameterStyle.SIMPLE + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/responses/response_200/headers/header_x_rate_limit/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/responses/response_200/headers/header_x_rate_limit/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/responses/response_200/headers/header_x_rate_limit/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/responses/response_200/headers/header_x_rate_limit/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/responses/response_200/headers/header_x_rate_limit/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/responses/response_200/headers/header_x_rate_limit/content/application_json/schema.py new file mode 100644 index 00000000000..dbe3b8f3aed --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/responses/response_200/headers/header_x_rate_limit/content/application_json/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.Int32Schema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/responses/response_400/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/responses/response_400/__init__.py new file mode 100644 index 00000000000..5f3123bab72 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/responses/response_400/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor400(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_logout/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_logout/__init__.py new file mode 100644 index 00000000000..232db4c9196 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_logout/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from petstore_api.apis.paths.user_logout import UserLogout + +path = "/user/logout" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_logout/get/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_logout/get/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_logout/get/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_logout/get/operation.py new file mode 100644 index 00000000000..2e95b1b41b6 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_logout/get/operation.py @@ -0,0 +1,203 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from petstore_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from .. import path +from .responses import response_default + + + +default_response = response_default.Default + + +class BaseApi(api_client.Api): + @typing.overload + def _logout_user( + self, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_default.Default.response_cls: ... + + @typing.overload + def _logout_user( + self, + skip_deserialization: typing_extensions.Literal[True], + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _logout_user( + self, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_default.Default.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _logout_user( + self, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + Logs out current logged in user session + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + # TODO add cookie handling + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='get', + host=host, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + api_response = default_response.deserialize(response, self.api_client.schema_configuration) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class LogoutUser(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def logout_user( + self, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_default.Default.response_cls: ... + + @typing.overload + def logout_user( + self, + skip_deserialization: typing_extensions.Literal[True], + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def logout_user( + self, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_default.Default.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def logout_user( + self, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._logout_user( + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForGet(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def get( + self, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_default.Default.response_cls: ... + + @typing.overload + def get( + self, + skip_deserialization: typing_extensions.Literal[True], + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get( + self, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_default.Default.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get( + self, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._logout_user( + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_logout/get/responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_logout/get/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_logout/get/responses/response_default/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_logout/get/responses/response_default/__init__.py new file mode 100644 index 00000000000..4fb8246c1a7 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_logout/get/responses/response_default/__init__.py @@ -0,0 +1,11 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.responses import response_ref_success_description_only +Default = response_ref_success_description_only.RefSuccessDescriptionOnly diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/__init__.py new file mode 100644 index 00000000000..7201ebc1045 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from petstore_api.apis.paths.user_username import UserUsername + +path = "/user/{username}" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/delete/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/delete/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/delete/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/delete/operation.py new file mode 100644 index 00000000000..00c0b98b7bb --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/delete/operation.py @@ -0,0 +1,275 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from petstore_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from .. import path +from .responses import ( + response_200, + response_404, +) +from .parameters import parameter_0 + + + +class RequestPathParameters: + RequiredParams = typing_extensions.TypedDict( + 'RequiredParams', + { + 'username': typing.Union[parameter_0.Parameter0.schema, str], + } + ) + OptionalParams = typing_extensions.TypedDict( + 'OptionalParams', + { + }, + total=False + ) + + + class Params(RequiredParams, OptionalParams): + pass + + + parameters = [ + parameter_0.Parameter0, + ] + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + '404': typing.Type[response_404.ResponseFor404], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, + '404': response_404.ResponseFor404, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _delete_user( + self, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _delete_user( + self, + skip_deserialization: typing_extensions.Literal[True], + path_params: RequestPathParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _delete_user( + self, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _delete_user( + self, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + Delete user + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs(RequestPathParameters.Params, path_params) + used_path = path + + _path_params = {} + for parameter in RequestPathParameters.parameters: + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + # TODO add cookie handling + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='delete', + host=host, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + '404', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class DeleteUser(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def delete_user( + self, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def delete_user( + self, + skip_deserialization: typing_extensions.Literal[True], + path_params: RequestPathParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def delete_user( + self, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def delete_user( + self, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._delete_user( + path_params=path_params, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForDelete(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def delete( + self, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def delete( + self, + skip_deserialization: typing_extensions.Literal[True], + path_params: RequestPathParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def delete( + self, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def delete( + self, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._delete_user( + path_params=path_params, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/delete/parameters/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/delete/parameters/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/delete/parameters/parameter_0/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/delete/parameters/parameter_0/__init__.py new file mode 100644 index 00000000000..c58d34fbb59 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/delete/parameters/parameter_0/__init__.py @@ -0,0 +1,11 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.parameters import parameter_ref_path_user_name +Parameter0 = parameter_ref_path_user_name.RefPathUserName diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/delete/responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/delete/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/delete/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/delete/responses/response_200/__init__.py new file mode 100644 index 00000000000..60dc7cec19a --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/delete/responses/response_200/__init__.py @@ -0,0 +1,11 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.responses import response_success_description_only +ResponseFor200 = response_success_description_only.SuccessDescriptionOnly diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/delete/responses/response_404/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/delete/responses/response_404/__init__.py new file mode 100644 index 00000000000..e82142578f7 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/delete/responses/response_404/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor404(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/get/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/get/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/get/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/get/operation.py new file mode 100644 index 00000000000..cad2667bb2e --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/get/operation.py @@ -0,0 +1,305 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from .. import path +from .responses import ( + response_200, + response_400, + response_404, +) +from .parameters import parameter_0 + + + +class RequestPathParameters: + RequiredParams = typing_extensions.TypedDict( + 'RequiredParams', + { + 'username': typing.Union[parameter_0.Parameter0.schema, str], + } + ) + OptionalParams = typing_extensions.TypedDict( + 'OptionalParams', + { + }, + total=False + ) + + + class Params(RequiredParams, OptionalParams): + pass + + + parameters = [ + parameter_0.Parameter0, + ] + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + '400': typing.Type[response_400.ResponseFor400], + '404': typing.Type[response_404.ResponseFor404], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, + '400': response_400.ResponseFor400, + '404': response_404.ResponseFor404, +} + +_all_accept_content_types = ( + "application/xml", + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _get_user_by_name( + self, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def _get_user_by_name( + self, + skip_deserialization: typing_extensions.Literal[True], + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _get_user_by_name( + self, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _get_user_by_name( + self, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + Get user by user name + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs(RequestPathParameters.Params, path_params) + used_path = path + + _path_params = {} + for parameter in RequestPathParameters.parameters: + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='get', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + '400', + '404', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class GetUserByName(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def get_user_by_name( + self, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def get_user_by_name( + self, + skip_deserialization: typing_extensions.Literal[True], + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get_user_by_name( + self, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get_user_by_name( + self, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._get_user_by_name( + path_params=path_params, + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForGet(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def get( + self, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> response_200.ResponseFor200.response_cls: ... + + @typing.overload + def get( + self, + skip_deserialization: typing_extensions.Literal[True], + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get( + self, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get( + self, + path_params: RequestPathParameters.Params = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._get_user_by_name( + path_params=path_params, + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/get/parameters/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/get/parameters/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/get/parameters/parameter_0/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/get/parameters/parameter_0/__init__.py new file mode 100644 index 00000000000..0f2e14b0c5e --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/get/parameters/parameter_0/__init__.py @@ -0,0 +1,11 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.parameters import parameter_path_user_name +Parameter0 = parameter_path_user_name.PathUserName diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/get/responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/get/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/get/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/get/responses/response_200/__init__.py new file mode 100644 index 00000000000..6b5fef95b97 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/get/responses/response_200/__init__.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas +from .content.application_xml import schema as application_xml_schema +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + application_xml_schema.Schema, + application_json_schema.Schema, + ] + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationXmlMediaType(api_client.MediaType): + schema: typing.Type[application_xml_schema.Schema] = application_xml_schema.Schema + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/xml': typing.Type[__ApplicationXmlMediaType], + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/xml': __ApplicationXmlMediaType, + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/get/responses/response_200/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/get/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/get/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/get/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/get/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/get/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..483ea128c04 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/get/responses/response_200/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.schema import user +Schema = user.User diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/get/responses/response_200/content/application_xml/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/get/responses/response_200/content/application_xml/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/get/responses/response_200/content/application_xml/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/get/responses/response_200/content/application_xml/schema.py new file mode 100644 index 00000000000..483ea128c04 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/get/responses/response_200/content/application_xml/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.schema import user +Schema = user.User diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/get/responses/response_400/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/get/responses/response_400/__init__.py new file mode 100644 index 00000000000..5f3123bab72 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/get/responses/response_400/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor400(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/get/responses/response_404/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/get/responses/response_404/__init__.py new file mode 100644 index 00000000000..e82142578f7 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/get/responses/response_404/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor404(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/put/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/put/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/put/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/put/operation.py new file mode 100644 index 00000000000..c639fcb00f0 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/put/operation.py @@ -0,0 +1,412 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from .. import path +from .responses import ( + response_400, + response_404, +) +from . import request_body +from .parameters import parameter_0 + + + +class RequestPathParameters: + RequiredParams = typing_extensions.TypedDict( + 'RequiredParams', + { + 'username': typing.Union[parameter_0.Parameter0.schema, str], + } + ) + OptionalParams = typing_extensions.TypedDict( + 'OptionalParams', + { + }, + total=False + ) + + + class Params(RequiredParams, OptionalParams): + pass + + + parameters = [ + parameter_0.Parameter0, + ] + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '400': typing.Type[response_400.ResponseFor400], + '404': typing.Type[response_404.ResponseFor404], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '400': response_400.ResponseFor400, + '404': response_404.ResponseFor404, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _update_user( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: typing_extensions.Literal["application/json"] = ..., + path_params: RequestPathParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> api_client.ApiResponseWithoutDeserialization: ... + @typing.overload + def _update_user( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + path_params: RequestPathParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _update_user( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + path_params: RequestPathParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _update_user( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + path_params: RequestPathParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _update_user( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = 'application/json', + path_params: RequestPathParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + Updated user + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs(RequestPathParameters.Params, path_params) + used_path = path + + _path_params = {} + for parameter in RequestPathParameters.parameters: + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body.RequestBody.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='put', + host=host, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '400', + '404', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 399: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class UpdateUser(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def update_user( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: typing_extensions.Literal["application/json"] = ..., + path_params: RequestPathParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> api_client.ApiResponseWithoutDeserialization: ... + @typing.overload + def update_user( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + path_params: RequestPathParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def update_user( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + path_params: RequestPathParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def update_user( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + path_params: RequestPathParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def update_user( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = 'application/json', + path_params: RequestPathParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._update_user( + body=body, + path_params=path_params, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForPut(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def put( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: typing_extensions.Literal["application/json"] = ..., + path_params: RequestPathParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> api_client.ApiResponseWithoutDeserialization: ... + @typing.overload + def put( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + path_params: RequestPathParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def put( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + path_params: RequestPathParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def put( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = ..., + path_params: RequestPathParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def put( + self, + body: typing.Union[ + request_body.RequestBody.content["application/json"].schema, + dict, + frozendict.frozendict + ], + content_type: str = 'application/json', + path_params: RequestPathParameters.Params = frozendict.frozendict(), + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._update_user( + body=body, + path_params=path_params, + content_type=content_type, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/put/parameters/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/put/parameters/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/put/parameters/parameter_0/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/put/parameters/parameter_0/__init__.py new file mode 100644 index 00000000000..0f2e14b0c5e --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/put/parameters/parameter_0/__init__.py @@ -0,0 +1,11 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.parameters import parameter_path_user_name +Parameter0 = parameter_path_user_name.PathUserName diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/put/request_body/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/put/request_body/__init__.py new file mode 100644 index 00000000000..01f76b5c2be --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/put/request_body/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import typing +import typing_extensions + +from petstore_api import api_client +from .content.application_json import schema as application_json_schema + +class RequestBody(api_client.RequestBody): + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } + required = True diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/put/request_body/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/put/request_body/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/put/request_body/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/put/request_body/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/put/request_body/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/put/request_body/content/application_json/schema.py new file mode 100644 index 00000000000..483ea128c04 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/put/request_body/content/application_json/schema.py @@ -0,0 +1,14 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + + +from petstore_api.components.schema import user +Schema = user.User diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/put/responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/put/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/put/responses/response_400/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/put/responses/response_400/__init__.py new file mode 100644 index 00000000000..5f3123bab72 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/put/responses/response_400/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor400(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/put/responses/response_404/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/put/responses/response_404/__init__.py new file mode 100644 index 00000000000..e82142578f7 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/put/responses/response_404/__init__.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +class ResponseFor404(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/rest.py b/samples/openapi3/client/petstore/python/src/petstore_api/rest.py new file mode 100644 index 00000000000..c831e8b7101 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/rest.py @@ -0,0 +1,252 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import logging +import ssl +from urllib.parse import urlencode +import typing + +import certifi +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api.exceptions import ApiException, ApiValueError + + +logger = logging.getLogger(__name__) + + +class RESTClientObject(object): + + def __init__(self, configuration, pools_size=4, maxsize=None): + # urllib3.PoolManager will pass all kw parameters to connectionpool + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 + # maxsize is the number of requests to host that are allowed in parallel # noqa: E501 + # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 + + # cert_reqs + if configuration.verify_ssl: + cert_reqs = ssl.CERT_REQUIRED + else: + cert_reqs = ssl.CERT_NONE + + # ca_certs + if configuration.ssl_ca_cert: + ca_certs = configuration.ssl_ca_cert + else: + # if not set certificate file, use Mozilla's root certificates. + ca_certs = certifi.where() + + addition_pool_args = {} + if configuration.assert_hostname is not None: + addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 + + if configuration.retries is not None: + addition_pool_args['retries'] = configuration.retries + + if configuration.socket_options is not None: + addition_pool_args['socket_options'] = configuration.socket_options + + if maxsize is None: + if configuration.connection_pool_maxsize is not None: + maxsize = configuration.connection_pool_maxsize + else: + maxsize = 4 + + # https pool manager + if configuration.proxy: + self.pool_manager = urllib3.ProxyManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=ca_certs, + cert_file=configuration.cert_file, + key_file=configuration.key_file, + proxy_url=configuration.proxy, + proxy_headers=configuration.proxy_headers, + **addition_pool_args + ) + else: + self.pool_manager = urllib3.PoolManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=ca_certs, + cert_file=configuration.cert_file, + key_file=configuration.key_file, + **addition_pool_args + ) + + def request( + self, + method: str, + url: str, + headers: typing.Optional[HTTPHeaderDict] = None, + fields: typing.Optional[typing.Tuple[typing.Tuple[str, typing.Any], ...]] = None, + body: typing.Optional[typing.Union[str, bytes]] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> urllib3.HTTPResponse: + """Perform requests. + + :param method: http request method + :param url: http request url + :param headers: http request headers + :param body: request body, for other types + :param fields: request parameters for + `application/x-www-form-urlencoded` + or `multipart/form-data` + :param stream: if True, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is False. + :param timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + """ + assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', + 'PATCH', 'OPTIONS'] + + if fields and body: + raise ApiValueError( + "body parameter cannot be used with fields parameter." + ) + + fields = fields or {} + headers = headers or {} + + if timeout: + if isinstance(timeout, (int, float)): # noqa: E501,F821 + timeout = urllib3.Timeout(total=timeout) + elif (isinstance(timeout, tuple) and + len(timeout) == 2): + timeout = urllib3.Timeout(connect=timeout[0], read=timeout[1]) + + try: + # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` + if method in {'POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE'}: + if 'Content-Type' not in headers and body is None: + r = self.pool_manager.request( + method, + url, + preload_content=not stream, + timeout=timeout, + headers=headers + ) + elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 + r = self.pool_manager.request( + method, url, + body=body, + encode_multipart=False, + preload_content=not stream, + timeout=timeout, + headers=headers) + elif headers['Content-Type'] == 'multipart/form-data': + # must del headers['Content-Type'], or the correct + # Content-Type which generated by urllib3 will be + # overwritten. + del headers['Content-Type'] + r = self.pool_manager.request( + method, url, + fields=fields, + encode_multipart=True, + preload_content=not stream, + timeout=timeout, + headers=headers) + # Pass a `string` parameter directly in the body to support + # other content types than Json when `body` argument is + # provided in serialized form + elif isinstance(body, str) or isinstance(body, bytes): + request_body = body + r = self.pool_manager.request( + method, url, + body=request_body, + preload_content=not stream, + timeout=timeout, + headers=headers) + else: + # Cannot generate the request from given parameters + msg = """Cannot prepare a request message for provided + arguments. Please check that your arguments match + declared content type.""" + raise ApiException(status=0, reason=msg) + # For `GET`, `HEAD` + else: + r = self.pool_manager.request(method, url, + preload_content=not stream, + timeout=timeout, + headers=headers) + except urllib3.exceptions.SSLError as e: + msg = "{0}\n{1}".format(type(e).__name__, str(e)) + raise ApiException(status=0, reason=msg) + + if not stream: + # log response body + logger.debug("response body: %s", r.data) + + return r + + def get(self, url, headers=None, stream=False, + timeout=None, fields=None) -> urllib3.HTTPResponse: + return self.request("GET", url, + headers=headers, + stream=stream, + timeout=timeout, + fields=fields) + + def head(self, url, headers=None, stream=False, + timeout=None, fields=None) -> urllib3.HTTPResponse: + return self.request("HEAD", url, + headers=headers, + stream=stream, + timeout=timeout, + fields=fields) + + def options(self, url, headers=None, + body=None, stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: + return self.request("OPTIONS", url, + headers=headers, + stream=stream, + timeout=timeout, + body=body, fields=fields) + + def delete(self, url, headers=None, body=None, + stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: + return self.request("DELETE", url, + headers=headers, + stream=stream, + timeout=timeout, + body=body, fields=fields) + + def post(self, url, headers=None, + body=None, stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: + return self.request("POST", url, + headers=headers, + stream=stream, + timeout=timeout, + body=body, fields=fields) + + def put(self, url, headers=None, + body=None, stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: + return self.request("PUT", url, + headers=headers, + stream=stream, + timeout=timeout, + body=body, fields=fields) + + def patch(self, url, headers=None, + body=None, stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: + return self.request("PATCH", url, + headers=headers, + stream=stream, + timeout=timeout, + body=body, fields=fields) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/schemas.py b/samples/openapi3/client/petstore/python/src/petstore_api/schemas.py new file mode 100644 index 00000000000..f9ff1cc85e5 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/schemas.py @@ -0,0 +1,2401 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import collections +import datetime +import functools +import decimal +import io +import re +import types +import typing +import uuid + +from dateutil import parser +from dateutil.parser.isoparser import _takes_ascii +import frozendict + +from petstore_api import exceptions +from petstore_api.configurations import schema_configuration + + +class Unset(object): + """ + An instance of this class is set as the default value for object type(dict) properties that are optional + When a property has an unset value, that property will not be assigned in the dict + """ + pass + +unset = Unset() + +none_type_ = type(None) + + +class FileIO(io.FileIO): + """ + A class for storing files + Note: this class is not immutable + """ + + def __new__(cls, arg_: typing.Union[io.FileIO, io.BufferedReader]): + if isinstance(arg_, (io.FileIO, io.BufferedReader)): + if arg_.closed: + raise exceptions.ApiValueError('Invalid file state; file is closed and must be open') + arg_.close() + inst = super(FileIO, cls).__new__(cls, arg_.name) + super(FileIO, inst).__init__(arg_.name) + return inst + raise exceptions.ApiValueError('FileIO must be passed arg_ which contains the open file') + + def __init__(self, arg_: typing.Union[io.FileIO, io.BufferedReader]): + pass + + +def update(d: dict, u: dict): + """ + Adds u to d + Where each dict is collections.defaultdict(set) + """ + if not u: + return d + for k, v in u.items(): + if k not in d: + d[k] = v + else: + d[k] = d[k] | v + + +class ValidationMetadata(frozendict.frozendict): + """ + A class storing metadata that is needed to validate OpenApi Schema payloads + """ + def __new__( + cls, + path_to_item: typing.Tuple[typing.Union[str, int], ...], + configuration: schema_configuration.SchemaConfiguration, + seen_classes: typing.FrozenSet[typing.Type] = frozenset(), + validated_path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Type]] = frozendict.frozendict() + ): + """ + Args: + path_to_item: the path to the current data being instantiated. + For {'a': [1]} if the code is handling, 1, then the path is ('args[0]', 'a', 0) + This changes from location to location + configuration: the schema_configuration.SchemaConfiguration instance to use + This is needed because in schema_configuration.SchemaConfiguration: + - one can disable validation checking + This does not change from location to location + seen_classes: when deserializing data that matches multiple schemas, this is used to store + the schemas that have been traversed. This is used to stop processing when a cycle is seen. + This changes from location to location + validated_path_to_schemas: stores the already validated schema classes for a given path location + This does not change from location to location + """ + return super().__new__( + cls, + path_to_item=path_to_item, + configuration=configuration, + seen_classes=seen_classes, + validated_path_to_schemas=validated_path_to_schemas + ) + + def validation_ran_earlier(self, cls: type) -> bool: + validated_schemas = self.validated_path_to_schemas.get(self.path_to_item, set()) + validation_ran_earlier = validated_schemas and cls in validated_schemas + if validation_ran_earlier: + return True + if cls in self.seen_classes: + return True + return False + + @property + def path_to_item(self) -> typing.Tuple[typing.Union[str, int], ...]: + return self['path_to_item'] + + @property + def configuration(self) -> schema_configuration.SchemaConfiguration: + return self['configuration'] + + @property + def seen_classes(self) -> typing.FrozenSet[typing.Type]: + return self['seen_classes'] + + @property + def validated_path_to_schemas(self) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Type]]: + return self['validated_path_to_schemas'] + + +def add_deeper_validated_schemas(validation_metadata: ValidationMetadata, path_to_schemas: dict): + # this is called if validation_ran_earlier and current and deeper locations need to be added + current_path_to_item = validation_metadata.path_to_item + other_path_to_schemas = {} + for path_to_item, schemas in validation_metadata.validated_path_to_schemas.items(): + if len(path_to_item) < len(current_path_to_item): + continue + path_begins_with_current_path = path_to_item[:len(current_path_to_item)] == current_path_to_item + if path_begins_with_current_path: + other_path_to_schemas[path_to_item] = schemas + update(path_to_schemas, other_path_to_schemas) + + +class Singleton: + """ + Enums and singletons are the same + The same instance is returned for a given key of (cls, arg_) + """ + _instances = {} + + def __new__(cls, arg_: typing.Any, **kwargs): + """ + cls base classes: BoolClass, NoneClass, str, decimal.Decimal + The 3rd key is used in the tuple below for a corner case where an enum contains integer 1 + However 1.0 can also be ingested into that enum schema because 1.0 == 1 and + Decimal('1.0') == Decimal('1') + But if we omitted the 3rd value in the key, then Decimal('1.0') would be stored as Decimal('1') + and json serializing that instance would be '1' rather than the expected '1.0' + Adding the 3rd value, the str of arg_ ensures that 1.0 -> Decimal('1.0') which is serialized as 1.0 + """ + key = (cls, arg_, str(arg_)) + if key not in cls._instances: + if isinstance(arg_, (none_type_, bool, BoolClass, NoneClass)): + inst = super().__new__(cls) + cls._instances[key] = inst + else: + cls._instances[key] = super().__new__(cls, arg_) + return cls._instances[key] + + def __repr__(self): + if isinstance(self, NoneClass): + return f'<{self.__class__.__name__}: None>' + elif isinstance(self, BoolClass): + if bool(self): + return f'<{self.__class__.__name__}: True>' + return f'<{self.__class__.__name__}: False>' + return f'<{self.__class__.__name__}: {super().__repr__()}>' + + +class classproperty: + + def __init__(self, fget): + self.fget = fget + + def __get__(self, owner_self, owner_cls): + return self.fget(owner_cls) + + +class NoneClass(Singleton): + @classproperty + def NONE(cls): + return cls(None) + + def __bool__(self) -> bool: + return False + + +class BoolClass(Singleton): + @classproperty + def TRUE(cls): + return cls(True) + + @classproperty + def FALSE(cls): + return cls(False) + + @functools.lru_cache() + def __bool__(self) -> bool: + for key, instance in self._instances.items(): + if self is instance: + return bool(key[1]) + raise ValueError('Unable to find the boolean value of this instance') + + +class SchemaTyped: + types: typing.Optional[typing.Set[typing.Type]] + exclusive_maximum: typing.Union[int, float] + inclusive_maximum: typing.Union[int, float] + exclusive_minimum: typing.Union[int, float] + inclusive_minimum: typing.Union[int, float] + max_items: int + min_items: int + discriminator: typing.Dict[str, typing.Dict[str, typing.Type['Schema']]] + + + class Properties: + # to hold object properties + pass + + additionalProperties: typing.Optional[typing.Type['Schema']] + max_properties: int + min_properties: int + AllOf: typing.List[typing.Type['Schema']] + OneOf: typing.List[typing.Type['Schema']] + AnyOf: typing.List[typing.Type['Schema']] + _not: typing.Type['Schema'] + max_length: int + min_length: int + items: typing.Type['Schema'] + +PathToSchemasType = typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]] + + +def __get_valid_classes_phrase(input_classes): + """Returns a string phrase describing what types are allowed""" + all_classes = list(input_classes) + all_classes = sorted(all_classes, key=lambda cls: cls.__name__) + all_class_names = [cls.__name__ for cls in all_classes] + if len(all_class_names) == 1: + return "is {0}".format(all_class_names[0]) + return "is one of [{0}]".format(", ".join(all_class_names)) + + +def __type_error_message( + var_value=None, var_name=None, valid_classes=None, key_type=None +): + """ + Keyword Args: + var_value (any): the variable which has the type_error + var_name (str): the name of the variable which has the typ error + valid_classes (tuple): the accepted classes for current_item's + value + key_type (bool): False if our value is a value in a dict + True if it is a key in a dict + False if our item is an item in a tuple + """ + key_or_value = "value" + if key_type: + key_or_value = "key" + valid_classes_phrase = __get_valid_classes_phrase(valid_classes) + msg = "Invalid type. Required {1} type {2} and " "passed type was {3}".format( + var_name, + key_or_value, + valid_classes_phrase, + type(var_value).__name__, + ) + return msg + + +def __get_type_error(var_value, path_to_item, valid_classes, key_type=False): + error_msg = __type_error_message( + var_name=path_to_item[-1], + var_value=var_value, + valid_classes=valid_classes, + key_type=key_type, + ) + return exceptions.ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=valid_classes, + key_type=key_type, + ) + + +def validate_types( + arg: typing.Any, + allowed_types: typing.Set[typing.Type], + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> None: + if type(arg) not in allowed_types: + raise __get_type_error( + arg, + validation_metadata.path_to_item, + allowed_types, + key_type=False, + ) + return None + +def validate_enum( + arg: typing.Any, + enum_value_to_name: typing.Dict[typing.Any, str], + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> None: + if arg not in enum_value_to_name: + raise exceptions.ApiValueError("Invalid value {} passed in to {}, allowed_values={}".format(arg, cls, enum_value_to_name.keys())) + return None + + +def _raise_validation_error_message(value, constraint_msg, constraint_value, path_to_item, additional_txt=""): + raise exceptions.ApiValueError( + "Invalid value `{value}`, {constraint_msg} `{constraint_value}`{additional_txt} at {path_to_item}".format( + value=value, + constraint_msg=constraint_msg, + constraint_value=constraint_value, + additional_txt=additional_txt, + path_to_item=path_to_item, + ) + ) + + +def validate_unique_items( + arg: typing.Any, + unique_items_value: bool, + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> None: + if not unique_items_value or not isinstance(arg, tuple): + return None + if len(arg) > len(set(arg)): + _raise_validation_error_message( + value=arg, + constraint_msg="duplicate items were found, and the tuple must not contain duplicates because", + constraint_value='unique_items==True', + path_to_item=validation_metadata.path_to_item + ) + return None + + +def validate_min_items( + arg: typing.Any, + min_items: int, + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> None: + if not isinstance(arg, tuple): + return None + if len(arg) < min_items: + _raise_validation_error_message( + value=arg, + constraint_msg="number of items must be greater than or equal to", + constraint_value=min_items, + path_to_item=validation_metadata.path_to_item + ) + return None + + +def validate_max_items( + arg: typing.Any, + max_items: int, + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> None: + if not isinstance(arg, tuple): + return None + if len(arg) > max_items: + _raise_validation_error_message( + value=arg, + constraint_msg="number of items must be less than or equal to", + constraint_value=max_items, + path_to_item=validation_metadata.path_to_item + ) + return None + + +def validate_min_properties( + arg: typing.Any, + min_properties: int, + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> None: + if not isinstance(arg, frozendict.frozendict): + return None + if len(arg) < min_properties: + _raise_validation_error_message( + value=arg, + constraint_msg="number of properties must be greater than or equal to", + constraint_value=min_properties, + path_to_item=validation_metadata.path_to_item + ) + return None + + +def validate_max_properties( + arg: typing.Any, + max_properties: int, + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> None: + if not isinstance(arg, frozendict.frozendict): + return None + if len(arg) > max_properties: + _raise_validation_error_message( + value=arg, + constraint_msg="number of properties must be less than or equal to", + constraint_value=max_properties, + path_to_item=validation_metadata.path_to_item + ) + return None + + +def validate_min_length( + arg: typing.Any, + min_length: int, + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> None: + if not isinstance(arg, str): + return None + if len(arg) < min_length: + _raise_validation_error_message( + value=arg, + constraint_msg="length must be greater than or equal to", + constraint_value=min_length, + path_to_item=validation_metadata.path_to_item + ) + return None + + +def validate_max_length( + arg: typing.Any, + max_length: int, + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> None: + if not isinstance(arg, str): + return None + if len(arg) > max_length: + _raise_validation_error_message( + value=arg, + constraint_msg="length must be less than or equal to", + constraint_value=max_length, + path_to_item=validation_metadata.path_to_item + ) + return None + + +def validate_inclusive_minimum( + arg: typing.Any, + inclusive_minimum: typing.Union[int, float], + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> None: + if not isinstance(arg, decimal.Decimal): + return None + if arg < inclusive_minimum: + _raise_validation_error_message( + value=arg, + constraint_msg="must be a value greater than or equal to", + constraint_value=inclusive_minimum, + path_to_item=validation_metadata.path_to_item + ) + return None + + +def validate_exclusive_minimum( + arg: typing.Any, + exclusive_minimum: typing.Union[int, float], + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> None: + if not isinstance(arg, decimal.Decimal): + return None + if arg <= exclusive_minimum: + _raise_validation_error_message( + value=arg, + constraint_msg="must be a value greater than", + constraint_value=exclusive_minimum, + path_to_item=validation_metadata.path_to_item + ) + return None + + +def validate_inclusive_maximum( + arg: typing.Any, + inclusive_maximum: typing.Union[int, float], + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> None: + if not isinstance(arg, decimal.Decimal): + return None + if arg > inclusive_maximum: + _raise_validation_error_message( + value=arg, + constraint_msg="must be a value less than or equal to", + constraint_value=inclusive_maximum, + path_to_item=validation_metadata.path_to_item + ) + return None + + +def validate_exclusive_maximum( + arg: typing.Any, + exclusive_maximum: typing.Union[int, float], + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> None: + if not isinstance(arg, decimal.Decimal): + return None + if arg >= exclusive_maximum: + _raise_validation_error_message( + value=arg, + constraint_msg="must be a value less than", + constraint_value=exclusive_maximum, + path_to_item=validation_metadata.path_to_item + ) + return None + +def validate_multiple_of( + arg: typing.Any, + multiple_of: typing.Union[int, float], + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> None: + if not isinstance(arg, decimal.Decimal): + return None + if (not (float(arg) / multiple_of).is_integer()): + # Note 'multipleOf' will be as good as the floating point arithmetic. + _raise_validation_error_message( + value=arg, + constraint_msg="value must be a multiple of", + constraint_value=multiple_of, + path_to_item=validation_metadata.path_to_item + ) + return None + + +def validate_regex( + arg: typing.Any, + regex_dict: typing.Dict, + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> None: + if not isinstance(arg, str): + return None + flags = regex_dict.get('flags', 0) + if not re.search(regex_dict['pattern'], arg, flags=flags): + if flags != 0: + # Don't print the regex flags if the flags are not + # specified in the OAS document. + _raise_validation_error_message( + value=arg, + constraint_msg="must match regular expression", + constraint_value=regex_dict['pattern'], + path_to_item=validation_metadata.path_to_item, + additional_txt=" with flags=`{}`".format(flags) + ) + _raise_validation_error_message( + value=arg, + constraint_msg="must match regular expression", + constraint_value=regex_dict['pattern'], + path_to_item=validation_metadata.path_to_item + ) + return None + + +__int32_inclusive_minimum = decimal.Decimal(-2147483648) +__int32_inclusive_maximum = decimal.Decimal(2147483647) +__int64_inclusive_minimum = decimal.Decimal(-9223372036854775808) +__int64_inclusive_maximum = decimal.Decimal(9223372036854775807) +__float_inclusive_minimum = decimal.Decimal(-3.4028234663852886e+38) +__float_inclusive_maximum = decimal.Decimal(3.4028234663852886e+38) +__double_inclusive_minimum = decimal.Decimal(-1.7976931348623157E+308) +__double_inclusive_maximum = decimal.Decimal(1.7976931348623157E+308) + +def __validate_numeric_format( + arg: decimal.Decimal, + format: str, + validation_metadata: ValidationMetadata +) -> None: + if format[:3] == 'int': + # there is a json schema test where 1.0 validates as an integer + if arg != int(arg): + raise exceptions.ApiValueError( + "Invalid non-integer value '{}' for type {} at {}".format( + arg, format, validation_metadata.path_to_item + ) + ) + if format == 'int32': + if not __int32_inclusive_minimum <= arg <= __int32_inclusive_maximum: + raise exceptions.ApiValueError( + "Invalid value '{}' for type int32 at {}".format(arg, validation_metadata.path_to_item) + ) + return None + elif format == 'int64': + if not __int64_inclusive_minimum <= arg <= __int64_inclusive_maximum: + raise exceptions.ApiValueError( + "Invalid value '{}' for type int64 at {}".format(arg, validation_metadata.path_to_item) + ) + return None + return None + elif format in {'float', 'double'}: + if format == 'float': + if not __float_inclusive_minimum <= arg <= __float_inclusive_maximum: + raise exceptions.ApiValueError( + "Invalid value '{}' for type float at {}".format(arg, validation_metadata.path_to_item) + ) + return None + # double + if not __double_inclusive_minimum <= arg <= __double_inclusive_maximum: + raise exceptions.ApiValueError( + "Invalid value '{}' for type double at {}".format(arg, validation_metadata.path_to_item) + ) + return None + return None + + +class CustomIsoparser(parser.isoparser): + @_takes_ascii + def parse_isodatetime(self, dt_str): + components, pos = self._parse_isodate(dt_str) + if len(dt_str) > pos: + if self._sep is None or dt_str[pos:pos + 1] == self._sep: + components += self._parse_isotime(dt_str[pos + 1:]) + else: + raise ValueError('String contains unknown ISO components') + + if len(components) > 3 and components[3] == 24: + components[3] = 0 + return datetime.datetime(*components) + datetime.timedelta(days=1) + + if len(components) <= 3: + raise ValueError('Value is not a datetime') + + return datetime.datetime(*components) + + @_takes_ascii + def parse_isodate(self, datestr): + components, pos = self._parse_isodate(datestr) + + if len(datestr) > pos: + raise ValueError('String contains invalid time components') + + if len(components) > 3: + raise ValueError('String contains invalid time components') + + return datetime.date(*components) + + +DEFAULT_ISOPARSER = CustomIsoparser() + + +def __validate_string_format( + arg: str, + format: str, + validation_metadata: ValidationMetadata +) -> None: + if format == 'uuid': + try: + uuid.UUID(arg) + return None + except ValueError: + raise exceptions.ApiValueError( + "Invalid value '{}' for type UUID at {}".format(arg, validation_metadata.path_to_item) + ) + elif format == 'number': + try: + decimal.Decimal(arg) + return None + except decimal.InvalidOperation: + raise exceptions.ApiValueError( + "Value cannot be converted to a decimal. " + "Invalid value '{}' for type decimal at {}".format(arg, validation_metadata.path_to_item) + ) + elif format == 'date': + try: + DEFAULT_ISOPARSER.parse_isodate(arg) + return None + except ValueError: + raise exceptions.ApiValueError( + "Value does not conform to the required ISO-8601 date format. " + "Invalid value '{}' for type date at {}".format(arg, validation_metadata.path_to_item) + ) + elif format == 'date-time': + try: + DEFAULT_ISOPARSER.parse_isodatetime(arg) + return None + except ValueError: + raise exceptions.ApiValueError( + "Value does not conform to the required ISO-8601 datetime format. " + "Invalid value '{}' for type datetime at {}".format(arg, validation_metadata.path_to_item) + ) + return None + + +def validate_format( + arg: typing.Any, + format: str, + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> None: + # formats work for strings + numbers + if isinstance(arg, decimal.Decimal): + return __validate_numeric_format( + arg, + format, + validation_metadata + ) + elif isinstance(arg, str): + return __validate_string_format( + arg, + format, + validation_metadata + ) + return None + + +def validate_required( + arg: typing.Any, + required: typing.Set[str], + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> None: + if not isinstance(arg, frozendict.frozendict): + return None + missing_required_arguments = required - arg.keys() + if missing_required_arguments: + missing_required_arguments = list(missing_required_arguments) + missing_required_arguments.sort() + raise exceptions.ApiTypeError( + "{} is missing {} required argument{}: {}".format( + cls.__name__, + len(missing_required_arguments), + "s" if len(missing_required_arguments) > 1 else "", + missing_required_arguments + ) + ) + return None + + +def _get_class(item_cls: typing.Union[types.FunctionType, staticmethod, typing.Type['Schema']]) -> typing.Type['Schema']: + if isinstance(item_cls, types.FunctionType): + # referenced schema + return item_cls() + elif isinstance(item_cls, staticmethod): + # referenced schema + return item_cls.__func__() + return item_cls + + +def validate_items( + arg: typing.Any, + item_cls: typing.Type, + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> PathToSchemasType: + if not isinstance(arg, tuple): + return None + item_cls = _get_class(item_cls) + path_to_schemas = {} + for i, value in enumerate(arg): + item_validation_metadata = ValidationMetadata( + path_to_item=validation_metadata.path_to_item+(i,), + configuration=validation_metadata.configuration, + validated_path_to_schemas=validation_metadata.validated_path_to_schemas + ) + if item_validation_metadata.validation_ran_earlier(item_cls): + add_deeper_validated_schemas(item_validation_metadata, path_to_schemas) + continue + other_path_to_schemas = item_cls._validate( + value, validation_metadata=item_validation_metadata) + update(path_to_schemas, other_path_to_schemas) + return path_to_schemas + + +def validate_properties( + arg: typing.Any, + properties: typing.Type, + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> typing.Optional[PathToSchemasType]: + if not isinstance(arg, frozendict.frozendict): + return None + path_to_schemas = {} + present_properties = {k: v for k, v, in arg.items() if k in properties.__annotations__} + for property_name, value in present_properties.items(): + path_to_item = validation_metadata.path_to_item + (property_name,) + schema = properties.__annotations__[property_name] + schema = _get_class(schema) + arg_validation_metadata = ValidationMetadata( + path_to_item=path_to_item, + configuration=validation_metadata.configuration, + validated_path_to_schemas=validation_metadata.validated_path_to_schemas + ) + if arg_validation_metadata.validation_ran_earlier(schema): + add_deeper_validated_schemas(arg_validation_metadata, path_to_schemas) + continue + other_path_to_schemas = schema._validate(value, validation_metadata=arg_validation_metadata) + update(path_to_schemas, other_path_to_schemas) + return path_to_schemas + + +def validate_additional_properties( + arg: typing.Any, + additional_properties_schema: typing.Type, + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> typing.Optional[PathToSchemasType]: + if not isinstance(arg, frozendict.frozendict): + return None + schema = _get_class(additional_properties_schema) + path_to_schemas = {} + properties_annotations = cls.Schema_.Properties.__annotations__ if hasattr(cls.Schema_, 'Properties') else {} + present_additional_properties = {k: v for k, v, in arg.items() if k not in properties_annotations} + for property_name, value in present_additional_properties.items(): + path_to_item = validation_metadata.path_to_item + (property_name,) + arg_validation_metadata = ValidationMetadata( + path_to_item=path_to_item, + configuration=validation_metadata.configuration, + validated_path_to_schemas=validation_metadata.validated_path_to_schemas + ) + if arg_validation_metadata.validation_ran_earlier(schema): + add_deeper_validated_schemas(arg_validation_metadata, path_to_schemas) + continue + other_path_to_schemas = schema._validate(value, validation_metadata=arg_validation_metadata) + update(path_to_schemas, other_path_to_schemas) + return path_to_schemas + + +def validate_one_of( + arg: typing.Any, + one_of_container_cls: typing.Type, + cls: 'Schema', + validation_metadata: ValidationMetadata, +) -> PathToSchemasType: + oneof_classes = [] + path_to_schemas = collections.defaultdict(set) + for one_of_cls in one_of_container_cls.classes: + schema = _get_class(one_of_cls) + if schema in path_to_schemas[validation_metadata.path_to_item]: + oneof_classes.append(schema) + continue + if schema is cls: + """ + optimistically assume that cls schema will pass validation + do not invoke _validate on it because that is recursive + """ + oneof_classes.append(schema) + continue + if validation_metadata.validation_ran_earlier(schema): + oneof_classes.append(schema) + add_deeper_validated_schemas(validation_metadata, path_to_schemas) + continue + try: + path_to_schemas = schema._validate(arg, validation_metadata=validation_metadata) + except (exceptions.ApiValueError, exceptions.ApiTypeError) as ex: + # silence exceptions because the code needs to accumulate oneof_classes + continue + oneof_classes.append(schema) + if not oneof_classes: + raise exceptions.ApiValueError( + "Invalid inputs given to generate an instance of {}. None " + "of the oneOf schemas matched the input data.".format(cls) + ) + elif len(oneof_classes) > 1: + raise exceptions.ApiValueError( + "Invalid inputs given to generate an instance of {}. Multiple " + "oneOf schemas {} matched the inputs, but a max of one is allowed.".format(cls, oneof_classes) + ) + # exactly one class matches + return path_to_schemas + + +def validate_any_of( + arg: typing.Any, + any_of_container_cls: typing.Type, + cls: 'Schema', + validation_metadata: ValidationMetadata, +) -> PathToSchemasType: + anyof_classes = [] + path_to_schemas = collections.defaultdict(set) + for any_of_cls in any_of_container_cls.classes: + schema = _get_class(any_of_cls) + if schema is cls: + """ + optimistically assume that cls schema will pass validation + do not invoke _validate on it because that is recursive + """ + anyof_classes.append(schema) + continue + if validation_metadata.validation_ran_earlier(schema): + anyof_classes.append(schema) + add_deeper_validated_schemas(validation_metadata, path_to_schemas) + continue + + try: + other_path_to_schemas = schema._validate(arg, validation_metadata=validation_metadata) + except (exceptions.ApiValueError, exceptions.ApiTypeError) as ex: + # silence exceptions because the code needs to accumulate anyof_classes + continue + anyof_classes.append(schema) + update(path_to_schemas, other_path_to_schemas) + if not anyof_classes: + raise exceptions.ApiValueError( + "Invalid inputs given to generate an instance of {}. None " + "of the anyOf schemas matched the input data.".format(cls) + ) + return path_to_schemas + + +def validate_all_of( + arg: typing.Any, + all_of_cls: typing.Type, + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> PathToSchemasType: + path_to_schemas = collections.defaultdict(set) + for allof_cls in all_of_cls.classes: + schema = _get_class(allof_cls) + if schema is cls: + """ + optimistically assume that cls schema will pass validation + do not invoke _validate on it because that is recursive + """ + continue + if validation_metadata.validation_ran_earlier(schema): + add_deeper_validated_schemas(validation_metadata, path_to_schemas) + continue + other_path_to_schemas = schema._validate(arg, validation_metadata=validation_metadata) + update(path_to_schemas, other_path_to_schemas) + return path_to_schemas + + +def validate_not( + arg: typing.Any, + not_cls: typing.Type, + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> None: + not_schema = _get_class(not_cls) + other_path_to_schemas = None + not_exception = exceptions.ApiValueError( + "Invalid value '{}' was passed in to {}. Value is invalid because it is disallowed by {}".format( + arg, + cls.__name__, + not_schema.__name__, + ) + ) + if validation_metadata.validation_ran_earlier(not_schema): + raise not_exception + + try: + other_path_to_schemas = not_schema._validate(arg, validation_metadata=validation_metadata) + except (exceptions.ApiValueError, exceptions.ApiTypeError): + pass + if other_path_to_schemas: + raise not_exception + return None + + +def __ensure_discriminator_value_present( + disc_property_name: str, + validation_metadata: ValidationMetadata, + arg +): + if disc_property_name not in arg: + # The input data does not contain the discriminator property + raise exceptions.ApiValueError( + "Cannot deserialize input data due to missing discriminator. " + "The discriminator property '{}' is missing at path: {}".format(disc_property_name, validation_metadata.path_to_item) + ) + + +def __get_discriminated_class(cls, disc_property_name: str, disc_payload_value: str): + """ + Used in schemas with discriminators + """ + if not hasattr(cls.Schema_, 'discriminator'): + return None + disc = cls.Schema_.discriminator() + if disc_property_name not in disc: + return None + discriminated_cls = disc[disc_property_name].get(disc_payload_value) + if discriminated_cls is not None: + return discriminated_cls + if not ( + hasattr(cls.Schema_, 'AllOf') or + hasattr(cls.Schema_, 'OneOf') or + hasattr(cls.Schema_, 'AnyOf') + ): + return None + # TODO stop traveling if a cycle is hit + if hasattr(cls.Schema_, 'AllOf'): + for allof_cls in cls.Schema_.AllOf.classes: + allof_cls = _get_class(allof_cls) + discriminated_cls = __get_discriminated_class( + allof_cls, disc_property_name=disc_property_name, disc_payload_value=disc_payload_value) + if discriminated_cls is not None: + return discriminated_cls + if hasattr(cls.Schema_, 'OneOf'): + for oneof_cls in cls.Schema_.OneOf.classes: + oneof_cls = _get_class(oneof_cls) + discriminated_cls = __get_discriminated_class( + oneof_cls, disc_property_name=disc_property_name, disc_payload_value=disc_payload_value) + if discriminated_cls is not None: + return discriminated_cls + if hasattr(cls.Schema_, 'AnyOf'): + for anyof_cls in cls.Schema_.AnyOf.classes: + anyof_cls = _get_class(anyof_cls) + discriminated_cls = __get_discriminated_class( + anyof_cls, disc_property_name=disc_property_name, disc_payload_value=disc_payload_value) + if discriminated_cls is not None: + return discriminated_cls + return None + + +def validate_discriminator( + arg: typing.Any, + discriminator_fn: typing.Type, + cls: typing.Type, + validation_metadata: ValidationMetadata, +) -> typing.Optional[PathToSchemasType]: + if not isinstance(arg, frozendict.frozendict): + return None + discriminator = discriminator_fn.__func__() + disc_prop_name = list(discriminator.keys())[0] + __ensure_discriminator_value_present(disc_prop_name, validation_metadata, arg) + discriminated_cls = __get_discriminated_class( + cls, disc_property_name=disc_prop_name, disc_payload_value=arg[disc_prop_name] + ) + if discriminated_cls is None: + raise exceptions.ApiValueError( + "Invalid discriminator value was passed in to {}.{} Only the values {} are allowed at {}".format( + cls.__name__, + disc_prop_name, + list(discriminator[disc_prop_name].keys()), + validation_metadata.path_to_item + (disc_prop_name,) + ) + ) + if discriminated_cls is cls: + """ + Optimistically assume that cls will pass validation + If the code invoked _validate on cls it would infinitely recurse + """ + return None + if validation_metadata.validation_ran_earlier(discriminated_cls): + path_to_schemas = {} + add_deeper_validated_schemas(validation_metadata, path_to_schemas) + return path_to_schemas + updated_vm = ValidationMetadata( + path_to_item=validation_metadata.path_to_item, + configuration=validation_metadata.configuration, + seen_classes=validation_metadata.seen_classes | frozenset({cls}), + validated_path_to_schemas=validation_metadata.validated_path_to_schemas + ) + return discriminated_cls._validate(arg, validation_metadata=updated_vm) + + +json_schema_keyword_to_validator = { + 'types': validate_types, + 'enum_value_to_name': validate_enum, + 'unique_items': validate_unique_items, + 'min_items': validate_min_items, + 'max_items': validate_max_items, + 'min_properties': validate_min_properties, + 'max_properties': validate_max_properties, + 'min_length': validate_min_length, + 'max_length': validate_max_length, + 'inclusive_minimum': validate_inclusive_minimum, + 'exclusive_minimum': validate_exclusive_minimum, + 'inclusive_maximum': validate_inclusive_maximum, + 'exclusive_maximum': validate_exclusive_maximum, + 'multiple_of': validate_multiple_of, + 'regex': validate_regex, + 'format': validate_format, + 'required': validate_required, + 'items': validate_items, + 'Items': validate_items, + 'Properties': validate_properties, + 'AdditionalProperties': validate_additional_properties, + 'additional_properties': validate_additional_properties, + 'OneOf': validate_one_of, + 'AnyOf': validate_any_of, + 'AllOf': validate_all_of, + '_not': validate_not, + '_Not': validate_not, + 'ModelNot': validate_not, + 'discriminator': validate_discriminator +} + + +class Schema: + """ + the base class of all swagger/openapi schemas/models + """ + __inheritable_primitive_types_set = {decimal.Decimal, str, tuple, frozendict.frozendict, FileIO, bytes, BoolClass, NoneClass} + Schema_: SchemaTyped + __excluded_cls_properties = { + '__module__', + '__dict__', + '__weakref__', + '__doc__', + 'default', # excluded because it has no impact on validation + } + + @classmethod + def _validate( + cls, + arg, + validation_metadata: ValidationMetadata, + ) -> PathToSchemasType: + """ + Schema validate + All keyword validation except for type checking was done in calling stack frames + If those validations passed, the validated classes are collected in path_to_schemas + """ + json_schema_data = { + k: v + for k, v in vars(cls.Schema_).items() + if k not in cls.__excluded_cls_properties + and k + not in validation_metadata.configuration.disabled_json_schema_python_keywords + } + path_to_schemas = {} + for keyword, val in json_schema_data.items(): + validator = json_schema_keyword_to_validator[keyword] + + other_path_to_schemas = validator( + arg, + val, + cls, + validation_metadata, + ) + if other_path_to_schemas: + update(path_to_schemas, other_path_to_schemas) + + base_class = type(arg) + if validation_metadata.path_to_item not in path_to_schemas: + path_to_schemas[validation_metadata.path_to_item] = set() + path_to_schemas[validation_metadata.path_to_item].add(cls) + path_to_schemas[validation_metadata.path_to_item].add(base_class) + return path_to_schemas + + @staticmethod + def _process_schema_classes( + schema_classes: typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]] + ): + """ + Processes and mutates schema_classes + If a SomeSchema is a subclass of DictSchema then remove DictSchema because it is already included + """ + if len(schema_classes) < 2: + return + if len(schema_classes) > 2 and UnsetAnyTypeSchema in schema_classes: + schema_classes.remove(UnsetAnyTypeSchema) + x_schema = schema_type_classes & schema_classes + if not x_schema: + return + # the only way len == 2 is to have one be AnyTypeSchema + x_schema = x_schema.pop() if len(x_schema) == 1 else AnyTypeSchema + if any(c is not x_schema and issubclass(c, x_schema) for c in schema_classes): + # needed to not have a mro error in get_new_class + schema_classes.remove(x_schema) + + @staticmethod + def __bases_by_type(): + return { + str: (UnsetAnyTypeSchema, str), + decimal.Decimal: (UnsetAnyTypeSchema, decimal.Decimal), + BoolClass: (UnsetAnyTypeSchema, BoolClass), + NoneClass: (UnsetAnyTypeSchema, NoneClass), + tuple: (UnsetAnyTypeSchema, tuple), + frozendict.frozendict: (UnsetAnyTypeSchema, frozendict.frozendict), + bytes: (UnsetAnyTypeSchema, bytes), + FileIO: (UnsetAnyTypeSchema, FileIO), + } + + @classmethod + def __get_new_cls( + cls, + arg, + validation_metadata: ValidationMetadata, + path_to_type: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Type] + ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Type['Schema']]: + """ + Make a new dynamic class and return an instance of that class + We are making an instance of cls, but instead of making cls + make a new class, new_cls + which includes dynamic bases including cls + return an instance of that new class + + Dict property + List Item Assignment Use cases: + 1. value is NOT an instance of the required schema class + the value is validated by _validate + _validate returns a key value pair + where the key is the path to the item, and the value will be the required manufactured class + made out of the matching schemas + 2. value is an instance of the correct schema type + the value is NOT validated by _validate, _validate only checks that the instance is of the correct schema type + for this value, _validate does NOT return an entry for it in _path_to_schemas + and in list/dict _get_items,_get_properties the value will be directly assigned + because value is of the correct type, and validation was run earlier when the instance was created + """ + _path_to_schemas = {} + if validation_metadata.validation_ran_earlier(cls): + add_deeper_validated_schemas(validation_metadata, _path_to_schemas) + else: + other_path_to_schemas = cls._validate(arg, validation_metadata=validation_metadata) + update(_path_to_schemas, other_path_to_schemas) + # loop through it make a new class for each entry + # do not modify the returned result because it is cached and we would be modifying the cached value + path_to_schemas = {} + for path, schema_classes in _path_to_schemas.items(): + """ + Use cases + 1. N number of schema classes + enum + type != bool/None, classes in path_to_schemas: tuple/frozendict.frozendict/str/Decimal/bytes/FileIo + needs Singleton added + 2. N number of schema classes + enum + type == bool/None, classes in path_to_schemas: BoolClass/NoneClass + Singleton already added + 3. N number of schema classes, classes in path_to_schemas: BoolClass/NoneClass/tuple/frozendict.frozendict/str/Decimal/bytes/FileIo + """ + cls._process_schema_classes(schema_classes) + enum_schema = any( + issubclass(this_cls, Schema) and hasattr(this_cls.Schema_, "enum_value_to_name") + for this_cls in schema_classes + ) + inheritable_primitive_type = schema_classes.intersection(cls.__inheritable_primitive_types_set) + chosen_schema_classes = schema_classes - inheritable_primitive_type + suffix = tuple(inheritable_primitive_type) + if enum_schema and suffix[0] not in {NoneClass, BoolClass}: + suffix = (Singleton,) + suffix + + used_classes = tuple(sorted(chosen_schema_classes, key=lambda a_cls: a_cls.__name__)) + suffix + mfg_cls = get_new_class(class_name='DynamicSchema', bases=used_classes) + path_to_schemas[path] = mfg_cls + + """ + For locations that validation did not check + the code still needs to mfg a class to hold those values + All of these classes will be based on UnsetAnyTypeSchema + """ + missing_paths = path_to_type.keys() - path_to_schemas.keys() + for missing_path in missing_paths: + value_type = path_to_type[missing_path] + bases = cls.__bases_by_type()[value_type] + mfg_cls = get_new_class(class_name='DynamicSchema', bases=bases) + path_to_schemas[missing_path] = mfg_cls + + return path_to_schemas + + @classmethod + def _get_new_instance_without_conversion( + cls, + arg: typing.Any, + path_to_item: typing.Tuple[typing.Union[str, int], ...], + path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Type['Schema']] + ): + # We have a Dynamic class and we are making an instance of it + if issubclass(cls, frozendict.frozendict) and issubclass(cls, DictBase): + properties = cls._get_properties(arg, path_to_item, path_to_schemas) + return super(Schema, cls).__new__(cls, properties) + elif issubclass(cls, tuple) and issubclass(cls, ListBase): + items = cls._get_items(arg, path_to_item, path_to_schemas) + return super(Schema, cls).__new__(cls, items) + """ + str = openapi str, datetime.date, and datetime.datetime + decimal.Decimal = openapi int and float + FileIO = openapi binary type and the user inputs a file + bytes = openapi binary type and the user inputs bytes + """ + return super(Schema, cls).__new__(cls, arg) + + @classmethod + def from_openapi_data_( + cls, + arg: typing.Union[ + str, + int, + float, + bool, + None, + dict, + list, + io.FileIO, + io.BufferedReader, + bytes + ], + configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None + ): + """ + Schema from_openapi_data_ + """ + from_server = True + validated_path_to_schemas = {} + path_to_type = {} + arg = cast_to_allowed_types(arg, from_server, validated_path_to_schemas, ('args[0]',), path_to_type) + validation_metadata = ValidationMetadata( + path_to_item=('args[0]',), + configuration=configuration_ or schema_configuration.SchemaConfiguration(), + validated_path_to_schemas=frozendict.frozendict(validated_path_to_schemas) + ) + path_to_schemas = cls.__get_new_cls(arg, validation_metadata, path_to_type) + new_cls = path_to_schemas[validation_metadata.path_to_item] + new_inst = new_cls._get_new_instance_without_conversion( + arg, + validation_metadata.path_to_item, + path_to_schemas + ) + return new_inst + + @staticmethod + def __get_input_dict(*args, **kwargs) -> frozendict.frozendict: + input_dict = {} + if args and isinstance(args[0], (dict, frozendict.frozendict)): + input_dict.update(args[0]) + if kwargs: + input_dict.update(kwargs) + return frozendict.frozendict(input_dict) + + @staticmethod + def __remove_unsets(kwargs): + return {key: val for key, val in kwargs.items() if val is not unset} + + def __new__( + cls, + *args_: typing.Union[ + dict, + frozendict.frozendict, + list, + tuple, + decimal.Decimal, + float, + int, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + bool, + None, + bytes, + io.FileIO, + io.BufferedReader, + 'Schema', ], + configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None, + **kwargs: typing.Union[ + dict, + frozendict.frozendict, + list, + tuple, + decimal.Decimal, + float, + int, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + bool, + None, + bytes, + io.FileIO, + io.BufferedReader, + 'Schema', Unset + ] + ): + """ + Schema __new__ + + Args: + args_ (int/float/decimal.Decimal/str/list/tuple/dict/frozendict.frozendict/bool/None): the value + kwargs (str, int/float/decimal.Decimal/str/list/tuple/dict/frozendict.frozendict/bool/None): dict values + configuration_: contains the schema_configuration.SchemaConfiguration that enables json schema validation keywords + like minItems, minLength etc + + Note: double underscores are used here because pycharm thinks that these variables + are instance properties if they are named normally :( + """ + __kwargs = cls.__remove_unsets(kwargs) + if not args_ and not __kwargs: + raise TypeError( + 'No input given. args or kwargs must be given.' + ) + if not __kwargs and args_ and not isinstance(args_[0], dict): + __arg = args_[0] + else: + __arg = cls.__get_input_dict(*args_, **__kwargs) + __from_server = False + __validated_path_to_schemas = {} + __path_to_type = {} + __arg = cast_to_allowed_types( + __arg, __from_server, __validated_path_to_schemas, ('args[0]',), __path_to_type) + __validation_metadata = ValidationMetadata( + path_to_item=('args[0]',), + configuration=configuration_ or schema_configuration.SchemaConfiguration(), + validated_path_to_schemas=frozendict.frozendict(__validated_path_to_schemas) + ) + __path_to_schemas = cls.__get_new_cls(__arg, __validation_metadata, __path_to_type) + __new_cls = __path_to_schemas[__validation_metadata.path_to_item] + return __new_cls._get_new_instance_without_conversion( + __arg, + __validation_metadata.path_to_item, + __path_to_schemas + ) + + +""" +import itertools +data_types = ('None', 'FrozenDict', 'Tuple', 'Str', 'Decimal', 'Bool') +type_to_cls = { + 'None': 'NoneClass', + 'FrozenDict': 'frozendict.frozendict', + 'Tuple': 'tuple', + 'Str': 'str', + 'Decimal': 'decimal.Decimal', + 'Bool': 'BoolClass' +} +cls_tuples = [v for v in itertools.combinations(data_types, 5)] +typed_classes = [f"class {''.join(cls_tuple)}Mixin({', '.join(type_to_cls[typ] for typ in cls_tuple)}):\n pass" for cls_tuple in cls_tuples] +for cls in typed_classes: + print(cls) +object_classes = [f"{''.join(cls_tuple)}Mixin = object" for cls_tuple in cls_tuples] +for cls in object_classes: + print(cls) +""" +if typing.TYPE_CHECKING: + # qty 1 + NoneMixin = NoneClass + FrozenDictMixin = frozendict.frozendict + TupleMixin = tuple + StrMixin = str + DecimalMixin = decimal.Decimal + BoolMixin = BoolClass + BytesMixin = bytes + FileMixin = FileIO + # qty 2 + class BinaryMixin(bytes, FileIO): + pass + class NoneFrozenDictMixin(NoneClass, frozendict.frozendict): + pass + class NoneTupleMixin(NoneClass, tuple): + pass + class NoneStrMixin(NoneClass, str): + pass + class NoneDecimalMixin(NoneClass, decimal.Decimal): + pass + class NoneBoolMixin(NoneClass, BoolClass): + pass + class FrozenDictTupleMixin(frozendict.frozendict, tuple): + pass + class FrozenDictStrMixin(frozendict.frozendict, str): + pass + class FrozenDictDecimalMixin(frozendict.frozendict, decimal.Decimal): + pass + class FrozenDictBoolMixin(frozendict.frozendict, BoolClass): + pass + class TupleStrMixin(tuple, str): + pass + class TupleDecimalMixin(tuple, decimal.Decimal): + pass + class TupleBoolMixin(tuple, BoolClass): + pass + class StrDecimalMixin(str, decimal.Decimal): + pass + class StrBoolMixin(str, BoolClass): + pass + class DecimalBoolMixin(decimal.Decimal, BoolClass): + pass + # qty 3 + class NoneFrozenDictTupleMixin(NoneClass, frozendict.frozendict, tuple): + pass + class NoneFrozenDictStrMixin(NoneClass, frozendict.frozendict, str): + pass + class NoneFrozenDictDecimalMixin(NoneClass, frozendict.frozendict, decimal.Decimal): + pass + class NoneFrozenDictBoolMixin(NoneClass, frozendict.frozendict, BoolClass): + pass + class NoneTupleStrMixin(NoneClass, tuple, str): + pass + class NoneTupleDecimalMixin(NoneClass, tuple, decimal.Decimal): + pass + class NoneTupleBoolMixin(NoneClass, tuple, BoolClass): + pass + class NoneStrDecimalMixin(NoneClass, str, decimal.Decimal): + pass + class NoneStrBoolMixin(NoneClass, str, BoolClass): + pass + class NoneDecimalBoolMixin(NoneClass, decimal.Decimal, BoolClass): + pass + class FrozenDictTupleStrMixin(frozendict.frozendict, tuple, str): + pass + class FrozenDictTupleDecimalMixin(frozendict.frozendict, tuple, decimal.Decimal): + pass + class FrozenDictTupleBoolMixin(frozendict.frozendict, tuple, BoolClass): + pass + class FrozenDictStrDecimalMixin(frozendict.frozendict, str, decimal.Decimal): + pass + class FrozenDictStrBoolMixin(frozendict.frozendict, str, BoolClass): + pass + class FrozenDictDecimalBoolMixin(frozendict.frozendict, decimal.Decimal, BoolClass): + pass + class TupleStrDecimalMixin(tuple, str, decimal.Decimal): + pass + class TupleStrBoolMixin(tuple, str, BoolClass): + pass + class TupleDecimalBoolMixin(tuple, decimal.Decimal, BoolClass): + pass + class StrDecimalBoolMixin(str, decimal.Decimal, BoolClass): + pass + # qty 4 + class NoneFrozenDictTupleStrMixin(NoneClass, frozendict.frozendict, tuple, str): + pass + class NoneFrozenDictTupleDecimalMixin(NoneClass, frozendict.frozendict, tuple, decimal.Decimal): + pass + class NoneFrozenDictTupleBoolMixin(NoneClass, frozendict.frozendict, tuple, BoolClass): + pass + class NoneFrozenDictStrDecimalMixin(NoneClass, frozendict.frozendict, str, decimal.Decimal): + pass + class NoneFrozenDictStrBoolMixin(NoneClass, frozendict.frozendict, str, BoolClass): + pass + class NoneFrozenDictDecimalBoolMixin(NoneClass, frozendict.frozendict, decimal.Decimal, BoolClass): + pass + class NoneTupleStrDecimalMixin(NoneClass, tuple, str, decimal.Decimal): + pass + class NoneTupleStrBoolMixin(NoneClass, tuple, str, BoolClass): + pass + class NoneTupleDecimalBoolMixin(NoneClass, tuple, decimal.Decimal, BoolClass): + pass + class NoneStrDecimalBoolMixin(NoneClass, str, decimal.Decimal, BoolClass): + pass + class FrozenDictTupleStrDecimalMixin(frozendict.frozendict, tuple, str, decimal.Decimal): + pass + class FrozenDictTupleStrBoolMixin(frozendict.frozendict, tuple, str, BoolClass): + pass + class FrozenDictTupleDecimalBoolMixin(frozendict.frozendict, tuple, decimal.Decimal, BoolClass): + pass + class FrozenDictStrDecimalBoolMixin(frozendict.frozendict, str, decimal.Decimal, BoolClass): + pass + class TupleStrDecimalBoolMixin(tuple, str, decimal.Decimal, BoolClass): + pass + # qty 5 + class NoneFrozenDictTupleStrDecimalMixin(NoneClass, frozendict.frozendict, tuple, str, decimal.Decimal): + pass + class NoneFrozenDictTupleStrBoolMixin(NoneClass, frozendict.frozendict, tuple, str, BoolClass): + pass + class NoneFrozenDictTupleDecimalBoolMixin(NoneClass, frozendict.frozendict, tuple, decimal.Decimal, BoolClass): + pass + class NoneFrozenDictStrDecimalBoolMixin(NoneClass, frozendict.frozendict, str, decimal.Decimal, BoolClass): + pass + class NoneTupleStrDecimalBoolMixin(NoneClass, tuple, str, decimal.Decimal, BoolClass): + pass + class FrozenDictTupleStrDecimalBoolMixin(frozendict.frozendict, tuple, str, decimal.Decimal, BoolClass): + pass + # qty 6 + class NoneFrozenDictTupleStrDecimalBoolMixin(NoneClass, frozendict.frozendict, tuple, str, decimal.Decimal, BoolClass): + pass + # qty 8 + class NoneFrozenDictTupleStrDecimalBoolFileBytesMixin(NoneClass, frozendict.frozendict, tuple, str, decimal.Decimal, BoolClass, FileIO, bytes): + pass +else: + # qty 1 + class NoneMixin: + pass + class FrozenDictMixin: + pass + class TupleMixin: + pass + class StrMixin: + pass + class DecimalMixin: + pass + class BoolMixin: + pass + class BytesMixin: + pass + class FileMixin: + pass + # qty 2 + class BinaryMixin: + pass + class NoneFrozenDictMixin: + pass + class NoneTupleMixin: + pass + class NoneStrMixin: + pass + class NoneDecimalMixin: + pass + class NoneBoolMixin: + pass + class FrozenDictTupleMixin: + pass + class FrozenDictStrMixin: + pass + class FrozenDictDecimalMixin: + pass + class FrozenDictBoolMixin: + pass + class TupleStrMixin: + pass + class TupleDecimalMixin: + pass + class TupleBoolMixin: + pass + class StrDecimalMixin: + pass + class StrBoolMixin: + pass + class DecimalBoolMixin: + pass + # qty 3 + class NoneFrozenDictTupleMixin: + pass + class NoneFrozenDictStrMixin: + pass + class NoneFrozenDictDecimalMixin: + pass + class NoneFrozenDictBoolMixin: + pass + class NoneTupleStrMixin: + pass + class NoneTupleDecimalMixin: + pass + class NoneTupleBoolMixin: + pass + class NoneStrDecimalMixin: + pass + class NoneStrBoolMixin: + pass + class NoneDecimalBoolMixin: + pass + class FrozenDictTupleStrMixin: + pass + class FrozenDictTupleDecimalMixin: + pass + class FrozenDictTupleBoolMixin: + pass + class FrozenDictStrDecimalMixin: + pass + class FrozenDictStrBoolMixin: + pass + class FrozenDictDecimalBoolMixin: + pass + class TupleStrDecimalMixin: + pass + class TupleStrBoolMixin: + pass + class TupleDecimalBoolMixin: + pass + class StrDecimalBoolMixin: + pass + # qty 4 + class NoneFrozenDictTupleStrMixin: + pass + class NoneFrozenDictTupleDecimalMixin: + pass + class NoneFrozenDictTupleBoolMixin: + pass + class NoneFrozenDictStrDecimalMixin: + pass + class NoneFrozenDictStrBoolMixin: + pass + class NoneFrozenDictDecimalBoolMixin: + pass + class NoneTupleStrDecimalMixin: + pass + class NoneTupleStrBoolMixin: + pass + class NoneTupleDecimalBoolMixin: + pass + class NoneStrDecimalBoolMixin: + pass + class FrozenDictTupleStrDecimalMixin: + pass + class FrozenDictTupleStrBoolMixin: + pass + class FrozenDictTupleDecimalBoolMixin: + pass + class FrozenDictStrDecimalBoolMixin: + pass + class TupleStrDecimalBoolMixin: + pass + # qty 5 + class NoneFrozenDictTupleStrDecimalMixin: + pass + class NoneFrozenDictTupleStrBoolMixin: + pass + class NoneFrozenDictTupleDecimalBoolMixin: + pass + class NoneFrozenDictStrDecimalBoolMixin: + pass + class NoneTupleStrDecimalBoolMixin: + pass + class FrozenDictTupleStrDecimalBoolMixin: + pass + # qty 6 + class NoneFrozenDictTupleStrDecimalBoolMixin: + pass + # qty 8 + class NoneFrozenDictTupleStrDecimalBoolFileBytesMixin: + pass + + +class BoolBase: + def is_true_(self) -> bool: + """ + A replacement for x is True + True if the instance is a BoolClass True Singleton + """ + if not issubclass(self.__class__, BoolClass): + return False + return bool(self) + + def is_false_(self) -> bool: + """ + A replacement for x is False + True if the instance is a BoolClass False Singleton + """ + if not issubclass(self.__class__, BoolClass): + return False + return bool(self) is False + + +class NoneBase: + def is_none_(self) -> bool: + """ + A replacement for x is None + True if the instance is a NoneClass None Singleton + """ + if issubclass(self.__class__, NoneClass): + return True + return False + + +class StrBase: + Schema_: SchemaTyped + + @property + def as_str_(self) -> str: + return self + + @property + def as_date_(self) -> datetime.date: + raise Exception('not implemented') + + @property + def as_datetime_(self) -> datetime.datetime: + raise Exception('not implemented') + + @property + def as_decimal_(self) -> decimal.Decimal: + raise Exception('not implemented') + + @property + def as_uuid_(self) -> uuid.UUID: + raise Exception('not implemented') + + +class UUIDBase: + @property + @functools.lru_cache() + def as_uuid_(self) -> uuid.UUID: + return uuid.UUID(self) + + +class DateBase: + @property + @functools.lru_cache() + def as_date_(self) -> datetime.date: + return DEFAULT_ISOPARSER.parse_isodate(self) + + +class DateTimeBase: + @property + @functools.lru_cache() + def as_datetime_(self) -> datetime.datetime: + return DEFAULT_ISOPARSER.parse_isodatetime(self) + + +class DecimalBase: + """ + A class for storing decimals that are sent over the wire as strings + These schemas must remain based on StrBase rather than NumberBase + because picking base classes must be deterministic + """ + + @property + @functools.lru_cache() + def as_decimal_(self) -> decimal.Decimal: + return decimal.Decimal(self) + + +class NumberBase: + Schema_: SchemaTyped + + @property + def as_int_(self) -> int: + try: + return self._as_int + except AttributeError: + """ + Note: for some numbers like 9.0 they could be represented as an + integer but our code chooses to store them as + >>> Decimal('9.0').as_tuple() + DecimalTuple(sign=0, digits=(9, 0), exponent=-1) + so we can tell that the value came from a float and convert it back to a float + during later serialization + """ + if self.as_tuple().exponent < 0: + # this could be represented as an integer but should be represented as a float + # because that's what it was serialized from + raise exceptions.ApiValueError(f'{self} is not an integer') + self._as_int = int(self) + return self._as_int + + @property + def as_float_(self) -> float: + try: + return self._as_float + except AttributeError: + if self.as_tuple().exponent >= 0: + raise exceptions.ApiValueError(f'{self} is not a float') + self._as_float = float(self) + return self._as_float + + +class ListBase: + Schema_: SchemaTyped + + @classmethod + def _get_items( + cls: 'Schema', + arg: typing.List[typing.Any], + path_to_item: typing.Tuple[typing.Union[str, int], ...], + path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Type['Schema']] + ): + ''' + ListBase _get_items + ''' + cast_items = [] + + for i, value in enumerate(arg): + item_path_to_item = path_to_item + (i,) + item_cls = path_to_schemas[item_path_to_item] + new_value = item_cls._get_new_instance_without_conversion( + value, + item_path_to_item, + path_to_schemas + ) + cast_items.append(new_value) + + return cast_items + + +class DictBase: + @classmethod + def _get_properties( + cls, + arg: typing.Dict[str, typing.Any], + path_to_item: typing.Tuple[typing.Union[str, int], ...], + path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Type['Schema']] + ): + """ + DictBase _get_properties, this is how properties are set + These values already passed validation + """ + dict_items = {} + + for property_name_js, value in arg.items(): + property_path_to_item = path_to_item + (property_name_js,) + property_cls = path_to_schemas[property_path_to_item] + new_value = property_cls._get_new_instance_without_conversion( + value, + property_path_to_item, + path_to_schemas + ) + dict_items[property_name_js] = new_value + + return dict_items + + def __setattr__(self, name: str, value: typing.Any): + if not isinstance(self, FileIO): + raise AttributeError('property setting not supported on immutable instances') + + def __getattr__(self, name: str): + """ + for instance.name access + Properties are only type hinted for required properties + so that hasattr(instance, 'optionalProp') is False when that key is not present + """ + if not isinstance(self, frozendict.frozendict): + return super().__getattr__(name) + if name not in self.__class__.__annotations__: + raise AttributeError(f"{self} has no attribute '{name}'") + try: + value = self[name] + return value + except KeyError as ex: + raise AttributeError(str(ex)) + + def get_item_(self, name: str) -> typing.Union['AnyTypeSchema', Unset]: + # dict_instance[name] accessor + if not isinstance(self, frozendict.frozendict): + raise NotImplementedError() + try: + return super().__getitem__(name) + except KeyError: + return unset + + +def cast_to_allowed_types( + arg: typing.Union[ + dict, + frozendict.frozendict, + list, + tuple, + decimal.Decimal, + float, + int, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + bool, + None, + bytes, + io.FileIO, + io.BufferedReader, + 'Schema', ], + from_server: bool, + validated_path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]], + path_to_item: typing.Tuple[typing.Union[str, int], ...], + path_to_type: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Type] +) -> typing.Union[ + frozendict.frozendict, + tuple, + decimal.Decimal, + str, + bytes, + BoolClass, + NoneClass, + FileIO]: + """ + Casts the input payload arg into the allowed types + The input validated_path_to_schemas is mutated by running this function + + When from_server is False then + - date/datetime is cast to str + - int/float is cast to Decimal + + If a Schema instance is passed in it is converted back to a primitive instance because + One may need to validate that data to the original Schema class AND additional different classes + those additional classes will need to be added to the new manufactured class for that payload + If the code didn't do this and kept the payload as a Schema instance it would fail to validate to other + Schema classes and the code wouldn't be able to mfg a new class that includes all valid schemas + TODO: store the validated schema classes in validation_metadata + + Args: + arg: the payload + from_server: whether this payload came from the server or not + validated_path_to_schemas: a dict that stores the validated classes at any path location in the payload + """ + if isinstance(arg, Schema) and not isinstance(arg, UnsetAnyTypeSchema): + """ + store the already run validations + but omit UnsetAnyTypeSchema instances because they were not validated + """ + schema_classes = set() + for cls in arg.__class__.__bases__: + if cls is Singleton: + # Skip Singleton + continue + schema_classes.add(cls) + validated_path_to_schemas[path_to_item] = schema_classes + + type_error = exceptions.ApiTypeError(f"Invalid type. Required value type is str and passed type was {type(arg)} at {path_to_item}") + if isinstance(arg, str): + path_to_type[path_to_item] = str + return str(arg) + elif isinstance(arg, (dict, frozendict.frozendict)): + path_to_type[path_to_item] = frozendict.frozendict + return frozendict.frozendict( + { + key: cast_to_allowed_types( + val, + from_server, + validated_path_to_schemas, + path_to_item + (key,), + path_to_type, + ) + for key, val in arg.items() + } + ) + elif isinstance(arg, (bool, BoolClass)): + path_to_type[path_to_item] = BoolClass + """ + this check must come before isinstance(arg, (int, float)) + because isinstance(True, int) is True + """ + if arg: + return BoolClass.TRUE + return BoolClass.FALSE + elif isinstance(arg, int): + path_to_type[path_to_item] = decimal.Decimal + return decimal.Decimal(arg) + elif isinstance(arg, float): + path_to_type[path_to_item] = decimal.Decimal + decimal_from_float = decimal.Decimal(arg) + if decimal_from_float.as_integer_ratio()[1] == 1: + # 9.0 -> Decimal('9.0') + # 3.4028234663852886e+38 -> Decimal('340282346638528859811704183484516925440.0') + return decimal.Decimal(str(decimal_from_float)+'.0') + return decimal_from_float + elif isinstance(arg, (tuple, list)): + path_to_type[path_to_item] = tuple + return tuple( + [ + cast_to_allowed_types( + item, + from_server, + validated_path_to_schemas, + path_to_item + (i,), + path_to_type, + ) + for i, item in enumerate(arg) + ] + ) + elif isinstance(arg, (none_type_, NoneClass)): + path_to_type[path_to_item] = NoneClass + return NoneClass.NONE + elif isinstance(arg, (datetime.date, datetime.datetime)): + path_to_type[path_to_item] = str + if not from_server: + return arg.isoformat() + raise type_error + elif isinstance(arg, uuid.UUID): + path_to_type[path_to_item] = str + if not from_server: + return str(arg) + raise type_error + elif isinstance(arg, decimal.Decimal): + path_to_type[path_to_item] = decimal.Decimal + return decimal.Decimal(arg) + elif isinstance(arg, bytes): + path_to_type[path_to_item] = bytes + return bytes(arg) + elif isinstance(arg, (io.FileIO, io.BufferedReader)): + path_to_type[path_to_item] = FileIO + return FileIO(arg) + raise ValueError('Invalid type passed in got input={} type={}'.format(arg, type(arg))) + + +class ListSchema( + ListBase, + Schema, + TupleMixin +): + class Schema_: + types = {tuple} + + @classmethod + def from_openapi_data_(cls, arg: typing.List[typing.Any], configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): + return super().from_openapi_data_(arg, configuration_=configuration_) + + def __new__(cls, arg_: typing.Union[typing.List[typing.Any], typing.Tuple[typing.Any]], **kwargs: schema_configuration.SchemaConfiguration): + return super().__new__(cls, arg_, **kwargs) + + +class NoneSchema( + NoneBase, + Schema, + NoneMixin +): + class Schema_: + types = {NoneClass} + + @classmethod + def from_openapi_data_(cls, arg: None, configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): + return super().from_openapi_data_(arg, configuration_=configuration_) + + def __new__(cls, arg_: None, **kwargs: schema_configuration.SchemaConfiguration): + return super().__new__(cls, arg_, **kwargs) + + +class NumberSchema( + NumberBase, + Schema, + DecimalMixin +): + """ + This is used for type: number with no format + Both integers AND floats are accepted + """ + class Schema_: + types = {decimal.Decimal} + + @classmethod + def from_openapi_data_(cls, arg: typing.Union[int, float], configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): + return super().from_openapi_data_(arg, configuration_=configuration_) + + def __new__(cls, arg_: typing.Union[decimal.Decimal, int, float], **kwargs: schema_configuration.SchemaConfiguration): + return super().__new__(cls, arg_, **kwargs) + + +class IntBase: + @property + def as_int_(self) -> int: + try: + return self._as_int + except AttributeError: + self._as_int = int(self) + return self._as_int + + +class IntSchema(IntBase, NumberSchema): + class Schema_: + types = {decimal.Decimal} + format = 'int' + + @classmethod + def from_openapi_data_(cls, arg: int, configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): + return super().from_openapi_data_(arg, configuration_=configuration_) + + def __new__(cls, arg_: typing.Union[decimal.Decimal, int], **kwargs: schema_configuration.SchemaConfiguration): + return super().__new__(cls, arg_, **kwargs) + + +class Int32Schema( + IntSchema +): + class Schema_: + types = {decimal.Decimal} + format = 'int32' + + +class Int64Schema( + IntSchema +): + class Schema_: + types = {decimal.Decimal} + format = 'int64' + + +class Float32Schema( + NumberSchema +): + class Schema_: + types = {decimal.Decimal} + format = 'float' + + @classmethod + def from_openapi_data_(cls, arg: float, configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): + return super().from_openapi_data_(arg, configuration_=configuration_) + + +class Float64Schema( + NumberSchema +): + class Schema_: + types = {decimal.Decimal} + format = 'double' + + @classmethod + def from_openapi_data_(cls, arg: float, configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): + return super().from_openapi_data_(arg, configuration_=configuration_) + + +class StrSchema( + StrBase, + Schema, + StrMixin +): + """ + date + datetime string types must inherit from this class + That is because one can validate a str payload as both: + - type: string (format unset) + - type: string, format: date + """ + class Schema_: + types = {str} + + @classmethod + def from_openapi_data_(cls, arg: str, configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None) -> 'StrSchema': + return super().from_openapi_data_(arg, configuration_=configuration_) + + def __new__(cls, arg_: typing.Union[str, datetime.date, datetime.datetime, uuid.UUID], **kwargs: schema_configuration.SchemaConfiguration): + return super().__new__(cls, arg_, **kwargs) + + +class UUIDSchema(UUIDBase, StrSchema): + class Schema_: + types = {str} + format = 'uuid' + + def __new__(cls, arg_: typing.Union[str, uuid.UUID], **kwargs: schema_configuration.SchemaConfiguration): + return super().__new__(cls, arg_, **kwargs) + + +class DateSchema(DateBase, StrSchema): + class Schema_: + types = {str} + format = 'date' + + def __new__(cls, arg_: typing.Union[str, datetime.date], **kwargs: schema_configuration.SchemaConfiguration): + return super().__new__(cls, arg_, **kwargs) + + +class DateTimeSchema(DateTimeBase, StrSchema): + class Schema_: + types = {str} + format = 'date-time' + + def __new__(cls, arg_: typing.Union[str, datetime.datetime], **kwargs: schema_configuration.SchemaConfiguration): + return super().__new__(cls, arg_, **kwargs) + + +class DecimalSchema(DecimalBase, StrSchema): + class Schema_: + types = {str} + format = 'number' + + def __new__(cls, arg_: str, **kwargs: schema_configuration.SchemaConfiguration): + """ + Note: Decimals may not be passed in because cast_to_allowed_types is only invoked once for payloads + which can be simple (str) or complex (dicts or lists with nested values) + Because casting is only done once and recursively casts all values prior to validation then for a potential + client side Decimal input if Decimal was accepted as an input in DecimalSchema then one would not know + if one was using it for a StrSchema (where it should be cast to str) or one is using it for NumberSchema + where it should stay as Decimal. + """ + return super().__new__(cls, arg_, **kwargs) + + +class BytesSchema( + Schema, + BytesMixin +): + """ + this class will subclass bytes and is immutable + """ + class Schema_: + types = {bytes} + + def __new__(cls, arg_: bytes, **kwargs: schema_configuration.SchemaConfiguration): + return super(Schema, cls).__new__(cls, arg_) + + +class FileSchema( + Schema, + FileMixin +): + """ + This class is NOT immutable + Dynamic classes are built using it for example when AnyType allows in binary data + Al other schema classes ARE immutable + If one wanted to make this immutable one could make this a DictSchema with required properties: + - data = BytesSchema (which would be an immutable bytes based schema) + - file_name = StrSchema + and cast_to_allowed_types would convert bytes and file instances into dicts containing data + file_name + The downside would be that data would be stored in memory which one may not want to do for very large files + + The developer is responsible for closing this file and deleting it + + This class was kept as mutable: + - to allow file reading and writing to disk + - to be able to preserve file name info + """ + class Schema_: + types = {FileIO} + + def __new__(cls, arg_: typing.Union[io.FileIO, io.BufferedReader], **kwargs: schema_configuration.SchemaConfiguration): + return super(Schema, cls).__new__(cls, arg_) + + +class BinarySchema( + Schema, + BinaryMixin +): + class Schema_: + types = {FileIO, bytes} + format = 'binary' + + class OneOf: + classes = [ + BytesSchema, + FileSchema, + ] + + def __new__(cls, arg_: typing.Union[io.FileIO, io.BufferedReader, bytes], **kwargs: schema_configuration.SchemaConfiguration): + return super().__new__(cls, arg_) + + +class BoolSchema( + BoolBase, + Schema, + BoolMixin +): + class Schema_: + types = {BoolClass} + + @classmethod + def from_openapi_data_(cls, arg: bool, configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): + return super().from_openapi_data_(arg, configuration_=configuration_) + + def __new__(cls, arg_: bool, **kwargs: ValidationMetadata): + return super().__new__(cls, arg_, **kwargs) + + +class AnyTypeSchema( + NoneBase, + DictBase, + ListBase, + StrBase, + NumberBase, + BoolBase, + Schema, + NoneFrozenDictTupleStrDecimalBoolFileBytesMixin +): + # Python representation of a schema defined as true or {} + class Schema_: + pass + + +class UnsetAnyTypeSchema(AnyTypeSchema): + # Used when additionalProperties/items was not explicitly defined and a defining schema is needed + pass + + +class NotAnyTypeSchema(AnyTypeSchema): + """ + Python representation of a schema defined as false or {'not': {}} + Does not allow inputs in of AnyType + Note: validations on this class are never run because the code knows that no inputs will ever validate + """ + + class Schema_: + _not = AnyTypeSchema + + def __new__( + cls, + *args_, + configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None, + ) -> 'NotAnyTypeSchema': + return super().__new__( + cls, + *args_, + configuration_=configuration_, + ) + + +class DictSchema( + DictBase, + Schema, + FrozenDictMixin +): + class Schema_: + types = {frozendict.frozendict} + + @classmethod + def from_openapi_data_(cls, arg: typing.Dict[str, typing.Any], configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): + return super().from_openapi_data_(arg, configuration_=configuration_) + + def __new__(cls, *args_: typing.Union[dict, frozendict.frozendict], **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, bool, None, bytes, Schema, Unset, ValidationMetadata]): + return super().__new__(cls, *args_, **kwargs) + + +schema_type_classes = {NoneSchema, DictSchema, ListSchema, NumberSchema, StrSchema, BoolSchema, AnyTypeSchema} + + +@functools.lru_cache() +def get_new_class( + class_name: str, + bases: typing.Tuple[typing.Type[typing.Union[Schema, typing.Any]], ...] +) -> typing.Type[Schema]: + """ + Returns a new class that is made with the subclass bases + """ + new_cls: typing.Type[Schema] = type(class_name, bases, {}) + return new_cls + + +LOG_CACHE_USAGE = False + + +def log_cache_usage(cache_fn): + if LOG_CACHE_USAGE: + print(cache_fn.__name__, cache_fn.cache_info()) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/security_schemes.py b/samples/openapi3/client/petstore/python/src/petstore_api/security_schemes.py new file mode 100644 index 00000000000..4a686044c1e --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/security_schemes.py @@ -0,0 +1,251 @@ +# coding: utf-8 +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import abc +import base64 +import dataclasses +import enum +import typing +import typing_extensions + +from urllib3 import _collections + +from petstore_api import signing + + +class SecuritySchemeType(enum.Enum): + API_KEY = 'apiKey' + HTTP = 'http' + MUTUAL_TLS = 'mutualTLS' + OAUTH_2 = 'oauth2' + OPENID_CONNECT = 'openIdConnect' + + +class ApiKeyInLocation(enum.Enum): + QUERY = 'query' + HEADER = 'header' + COOKIE = 'cookie' + + +class __SecuritySchemeBase(metaclass=abc.ABCMeta): + @abc.abstractmethod + def apply_auth( + self, + headers: _collections.HTTPHeaderDict, + resource_path: str, + method: str, + body: typing.Optional[typing.Union[str, bytes]], + scope_names: typing.Tuple[str] = (), + ) -> None: + pass + + +@dataclasses.dataclass +class ApiKeySecurityScheme(__SecuritySchemeBase, abc.ABC): + api_key: str # this must be set by the developer + name: str = '' + in_location: ApiKeyInLocation = ApiKeyInLocation.QUERY + type: SecuritySchemeType = SecuritySchemeType.API_KEY + + def apply_auth( + self, + headers: _collections.HTTPHeaderDict, + resource_path: str, + method: str, + body: typing.Optional[typing.Union[str, bytes]], + scope_names: typing.Tuple[str] = (), + ) -> None: + if self.in_location is ApiKeyInLocation.COOKIE: + headers.add('Cookie', self.api_key) + elif self.in_location is ApiKeyInLocation.HEADER: + headers.add(self.name, self.api_key) + elif self.in_location is ApiKeyInLocation.QUERY: + # todo add query handling + raise NotImplementedError("ApiKeySecurityScheme in query not yet implemented") + return + + +class HTTPSchemeType(enum.Enum): + BASIC = 'basic' + BEARER = 'bearer' + DIGEST = 'digest' + SIGNATURE = 'signature' # https://datatracker.ietf.org/doc/draft-cavage-http-signatures/ + + +@dataclasses.dataclass +class HTTPBasicSecurityScheme(__SecuritySchemeBase): + user_id: str # user name + password: str + scheme: HTTPSchemeType = HTTPSchemeType.BASIC + encoding: str = 'utf-8' + type: SecuritySchemeType = SecuritySchemeType.HTTP + """ + https://www.rfc-editor.org/rfc/rfc7617.html + """ + + def apply_auth( + self, + headers: _collections.HTTPHeaderDict, + resource_path: str, + method: str, + body: typing.Optional[typing.Union[str, bytes]], + scope_names: typing.Tuple[str] = (), + ) -> None: + user_pass = f"{self.user_id}:{self.password}" + b64_user_pass = base64.b64encode(user_pass.encode(encoding=self.encoding)) + headers.add('Authorization', f"Basic {b64_user_pass.decode()}") + + +@dataclasses.dataclass +class HTTPBearerSecurityScheme(__SecuritySchemeBase): + access_token: str + bearer_format: typing.Optional[str] = None + scheme: HTTPSchemeType = HTTPSchemeType.BEARER + type: SecuritySchemeType = SecuritySchemeType.HTTP + + def apply_auth( + self, + headers: _collections.HTTPHeaderDict, + resource_path: str, + method: str, + body: typing.Optional[typing.Union[str, bytes]], + scope_names: typing.Tuple[str] = (), + ) -> None: + headers.add('Authorization', f"Bearer {self.access_token}") + + +@dataclasses.dataclass +class HTTPSignatureSecurityScheme(__SecuritySchemeBase): + signing_info: signing.HttpSigningConfiguration + scheme: HTTPSchemeType = HTTPSchemeType.SIGNATURE + type: SecuritySchemeType = SecuritySchemeType.HTTP + + def apply_auth( + self, + headers: _collections.HTTPHeaderDict, + resource_path: str, + method: str, + body: typing.Optional[typing.Union[str, bytes]], + scope_names: typing.Tuple[str] = (), + ) -> None: + query_params = tuple() + auth_headers = self.signing_info.get_http_signature_headers( + resource_path, method, headers, body, query_params) + for key, value in auth_headers.items(): + headers.add(key, value) + + +@dataclasses.dataclass +class HTTPDigestSecurityScheme(__SecuritySchemeBase): + scheme: HTTPSchemeType = HTTPSchemeType.DIGEST + type: SecuritySchemeType = SecuritySchemeType.HTTP + + def apply_auth( + self, + headers: _collections.HTTPHeaderDict, + resource_path: str, + method: str, + body: typing.Optional[typing.Union[str, bytes]], + scope_names: typing.Tuple[str] = (), + ) -> None: + raise NotImplementedError("HTTPDigestSecurityScheme not yet implemented") + + +@dataclasses.dataclass +class MutualTLSSecurityScheme(__SecuritySchemeBase): + type: SecuritySchemeType = SecuritySchemeType.MUTUAL_TLS + + def apply_auth( + self, + headers: _collections.HTTPHeaderDict, + resource_path: str, + method: str, + body: typing.Optional[typing.Union[str, bytes]], + scope_names: typing.Tuple[str] = (), + ) -> None: + raise NotImplementedError("MutualTLSSecurityScheme not yet implemented") + + +@dataclasses.dataclass +class ImplicitOAuthFlow: + authorization_url: str + scopes: typing.Dict[str, str] + refresh_url: typing.Optional[str] = None + + +@dataclasses.dataclass +class TokenUrlOauthFlow: + token_url: str + scopes: typing.Dict[str, str] + refresh_url: typing.Optional[str] = None + + +@dataclasses.dataclass +class AuthorizationCodeOauthFlow: + authorization_url: str + token_url: str + scopes: typing.Dict[str, str] + refresh_url: typing.Optional[str] = None + + +@dataclasses.dataclass +class OAuthFlows: + implicit: typing.Optional[ImplicitOAuthFlow] = None + password: typing.Optional[TokenUrlOauthFlow] = None + client_credentials: typing.Optional[TokenUrlOauthFlow] = None + authorization_code: typing.Optional[AuthorizationCodeOauthFlow] = None + + +class OAuth2SecurityScheme(__SecuritySchemeBase, abc.ABC): + flows: OAuthFlows + type: SecuritySchemeType = SecuritySchemeType.OAUTH_2 + + def apply_auth( + self, + headers: _collections.HTTPHeaderDict, + resource_path: str, + method: str, + body: typing.Optional[typing.Union[str, bytes]], + scope_names: typing.Tuple[str] = (), + ) -> None: + raise NotImplementedError("OAuth2SecurityScheme not yet implemented") + + +class OpenIdConnectSecurityScheme(__SecuritySchemeBase, abc.ABC): + openid_connect_url: str + type: SecuritySchemeType = SecuritySchemeType.OPENID_CONNECT + + def apply_auth( + self, + headers: _collections.HTTPHeaderDict, + resource_path: str, + method: str, + body: typing.Optional[typing.Union[str, bytes]], + scope_names: typing.Tuple[str] = (), + ) -> None: + raise NotImplementedError("OpenIdConnectSecurityScheme not yet implemented") + +""" +Key is the Security scheme class +Value is the list of scopes +""" +SecurityRequirementObject = typing_extensions.TypedDict( + 'SecurityRequirementObject', + { + 'api_key': typing.List[str], + 'api_key_query': typing.List[str], + 'bearer_test': typing.List[str], + 'http_basic_test': typing.List[str], + 'http_signature_test': typing.List[str], + 'openIdConnect_test': typing.List[str], + 'petstore_auth': typing.List[str], + }, + total=False +) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/server.py b/samples/openapi3/client/petstore/python/src/petstore_api/server.py new file mode 100644 index 00000000000..9f1ded4be01 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/server.py @@ -0,0 +1,37 @@ +# coding: utf-8 +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import abc +import dataclasses +import typing + + +@dataclasses.dataclass +class Server(abc.ABC): + _url: str + variables: typing.Optional[typing.Dict[str, str]] = None + variable_schemas: typing.Optional[typing.Dict[str, typing.Type['schemas.Schema']]] = None + url: str = dataclasses.field(init=False) + + def __post_init__(self): + if not self.variable_schemas: + self.url = self._url + return + url = self._url + for (key, schema) in self.variable_schemas.items(): + if self.variables and key in self.variables: + value = self.variables[key] + cast_value = schema(value) + else: + cast_value = schema.Schema_.default + url = url.replace("{" + key + "}", cast_value) + self.url = url + +from petstore_api import schemas diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/servers/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/servers/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/servers/server_0.py b/samples/openapi3/client/petstore/python/src/petstore_api/servers/server_0.py new file mode 100644 index 00000000000..b6ad83b7cba --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/servers/server_0.py @@ -0,0 +1,109 @@ +# coding: utf-8 +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import typing +import typing_extensions + +from petstore_api import server, schemas + + +class _Variables: + + + class Server( + schemas.StrSchema + ): + + + class Schema_: + types = { + str, + } + default = "petstore" + enum_value_to_name = { + "petstore": "PETSTORE", + "qa-petstore": "QA_HYPHEN_MINUS_PETSTORE", + "dev-petstore": "DEV_HYPHEN_MINUS_PETSTORE", + } + + @schemas.classproperty + def PETSTORE(cls): + return cls("petstore") + + @schemas.classproperty + def QA_HYPHEN_MINUS_PETSTORE(cls): + return cls("qa-petstore") + + @schemas.classproperty + def DEV_HYPHEN_MINUS_PETSTORE(cls): + return cls("dev-petstore") + + + class Port( + schemas.StrSchema + ): + + + class Schema_: + types = { + str, + } + default = "80" + enum_value_to_name = { + "80": "POSITIVE_80", + "8080": "POSITIVE_8080", + } + + @schemas.classproperty + def POSITIVE_80(cls): + return cls("80") + + @schemas.classproperty + def POSITIVE_8080(cls): + return cls("8080") + +_VariablesSchemas = typing_extensions.TypedDict( + '_VariablesSchemas', + { + "server": typing.Type[_Variables.Server], + "port": typing.Type[_Variables.Port], + }, + total=False +) + +Variables = typing_extensions.TypedDict( + 'Variables', + { + "server": typing_extensions.Literal[ + "petstore", + "qa-petstore", + "dev-petstore", + ], + "port": typing_extensions.Literal[ + "80", + "8080", + ], + }, + total=False +) + +def _default_variable_schemas(): + return { + "server": _Variables.Server, + "port": _Variables.Port, + } + + +@dataclasses.dataclass +class Server0(server.Server): + ''' + petstore server + ''' + _url: str = "http://{server}.swagger.io:{port}/v2" + variables: Variables + variable_schemas: _VariablesSchemas = dataclasses.field(default_factory=_default_variable_schemas) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/servers/server_1.py b/samples/openapi3/client/petstore/python/src/petstore_api/servers/server_1.py new file mode 100644 index 00000000000..4f0cf38998f --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/servers/server_1.py @@ -0,0 +1,73 @@ +# coding: utf-8 +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import typing +import typing_extensions + +from petstore_api import server, schemas + + +class _Variables: + + + class Version( + schemas.StrSchema + ): + + + class Schema_: + types = { + str, + } + default = "v2" + enum_value_to_name = { + "v1": "V1", + "v2": "V2", + } + + @schemas.classproperty + def V1(cls): + return cls("v1") + + @schemas.classproperty + def V2(cls): + return cls("v2") + +_VariablesSchemas = typing_extensions.TypedDict( + '_VariablesSchemas', + { + "version": typing.Type[_Variables.Version], + }, + total=False +) + +Variables = typing_extensions.TypedDict( + 'Variables', + { + "version": typing_extensions.Literal[ + "v1", + "v2", + ], + }, + total=False +) + +def _default_variable_schemas(): + return { + "version": _Variables.Version, + } + + +@dataclasses.dataclass +class Server1(server.Server): + ''' + The local server + ''' + _url: str = "https://localhost:8080/{version}" + variables: Variables + variable_schemas: _VariablesSchemas = dataclasses.field(default_factory=_default_variable_schemas) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/servers/server_2.py b/samples/openapi3/client/petstore/python/src/petstore_api/servers/server_2.py new file mode 100644 index 00000000000..b0359f1de8f --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/servers/server_2.py @@ -0,0 +1,19 @@ +# coding: utf-8 +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import typing + +from petstore_api import server + + +@dataclasses.dataclass +class Server2(server.Server): + ''' + staging server with no variables + ''' + _url: str = "https://localhost:8080" diff --git a/samples/openapi3/client/petstore/python/petstore_api/signing.py b/samples/openapi3/client/petstore/python/src/petstore_api/signing.py similarity index 98% rename from samples/openapi3/client/petstore/python/petstore_api/signing.py rename to samples/openapi3/client/petstore/python/src/petstore_api/signing.py index 22b3bf2bf1d..3371c19eff1 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/signing.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/signing.py @@ -5,7 +5,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ from base64 import b64encode @@ -72,9 +72,9 @@ class HttpSigningConfiguration(object): and optionally the body of the HTTP request, then signing the hash value using a private key. The 'Authorization' header is added to outbound HTTP requests. - NOTE: This class is auto generated by OpenAPI Generator + NOTE: This class is auto generated by OpenAPI JSON Schema Generator - Ref: https://openapi-generator.tech + Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator Do not edit the class manually. :param key_id: A string value specifying the identifier of the cryptographic key, diff --git a/samples/openapi3/client/petstore/python/test-requirements.txt b/samples/openapi3/client/petstore/python/test-requirements.txt index 36d9b4fa7a8..bc293d9fc3f 100644 --- a/samples/openapi3/client/petstore/python/test-requirements.txt +++ b/samples/openapi3/client/petstore/python/test-requirements.txt @@ -1,4 +1,3 @@ -pytest~=4.6.7 # needed for python 3.4 -pytest-cov>=2.8.1 -pytest-randomly==1.2.3 # needed for python 3.4 +pytest ~= 7.2.0 +pytest-cov ~= 4.0.0 pycryptodome>=3.9.0 diff --git a/samples/openapi3/client/petstore/python/test/components/__init__.py b/samples/openapi3/client/petstore/python/test/components/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/test/components/schema/__init__.py b/samples/openapi3/client/petstore/python/test/components/schema/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test__200_response.py b/samples/openapi3/client/petstore/python/test/components/schema/test__200_response.py new file mode 100644 index 00000000000..7e51c2ca05f --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test__200_response.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema._200_response import _200Response +from petstore_api.configurations import schema_configuration + + +class Test_200Response(unittest.TestCase): + """_200Response unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test__return.py b/samples/openapi3/client/petstore/python/test/components/schema/test__return.py new file mode 100644 index 00000000000..fc7c074b5b4 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test__return.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema._return import _Return +from petstore_api.configurations import schema_configuration + + +class Test_Return(unittest.TestCase): + """_Return unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_abstract_step_message.py b/samples/openapi3/client/petstore/python/test/components/schema/test_abstract_step_message.py new file mode 100644 index 00000000000..bb8edc1721e --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_abstract_step_message.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.abstract_step_message import AbstractStepMessage +from petstore_api.configurations import schema_configuration + + +class TestAbstractStepMessage(unittest.TestCase): + """AbstractStepMessage unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_additional_properties_class.py b/samples/openapi3/client/petstore/python/test/components/schema/test_additional_properties_class.py new file mode 100644 index 00000000000..f7bd8984027 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_additional_properties_class.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.additional_properties_class import AdditionalPropertiesClass +from petstore_api.configurations import schema_configuration + + +class TestAdditionalPropertiesClass(unittest.TestCase): + """AdditionalPropertiesClass unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_additional_properties_validator.py b/samples/openapi3/client/petstore/python/test/components/schema/test_additional_properties_validator.py new file mode 100644 index 00000000000..389128bdf68 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_additional_properties_validator.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.additional_properties_validator import AdditionalPropertiesValidator +from petstore_api.configurations import schema_configuration + + +class TestAdditionalPropertiesValidator(unittest.TestCase): + """AdditionalPropertiesValidator unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_additional_properties_with_array_of_enums.py b/samples/openapi3/client/petstore/python/test/components/schema/test_additional_properties_with_array_of_enums.py new file mode 100644 index 00000000000..3bd972ffbee --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_additional_properties_with_array_of_enums.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.additional_properties_with_array_of_enums import AdditionalPropertiesWithArrayOfEnums +from petstore_api.configurations import schema_configuration + + +class TestAdditionalPropertiesWithArrayOfEnums(unittest.TestCase): + """AdditionalPropertiesWithArrayOfEnums unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_address.py b/samples/openapi3/client/petstore/python/test/components/schema/test_address.py new file mode 100644 index 00000000000..04bde97afa4 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_address.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.address import Address +from petstore_api.configurations import schema_configuration + + +class TestAddress(unittest.TestCase): + """Address unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_animal.py b/samples/openapi3/client/petstore/python/test/components/schema/test_animal.py new file mode 100644 index 00000000000..2bd4d25f6ac --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_animal.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.animal import Animal +from petstore_api.configurations import schema_configuration + + +class TestAnimal(unittest.TestCase): + """Animal unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_animal_farm.py b/samples/openapi3/client/petstore/python/test/components/schema/test_animal_farm.py new file mode 100644 index 00000000000..b2e96f395f5 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_animal_farm.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.animal_farm import AnimalFarm +from petstore_api.configurations import schema_configuration + + +class TestAnimalFarm(unittest.TestCase): + """AnimalFarm unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_any_type_and_format.py b/samples/openapi3/client/petstore/python/test/components/schema/test_any_type_and_format.py new file mode 100644 index 00000000000..af5e77ab115 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_any_type_and_format.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.any_type_and_format import AnyTypeAndFormat +from petstore_api.configurations import schema_configuration + + +class TestAnyTypeAndFormat(unittest.TestCase): + """AnyTypeAndFormat unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_any_type_not_string.py b/samples/openapi3/client/petstore/python/test/components/schema/test_any_type_not_string.py new file mode 100644 index 00000000000..43dc7273bf6 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_any_type_not_string.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.any_type_not_string import AnyTypeNotString +from petstore_api.configurations import schema_configuration + + +class TestAnyTypeNotString(unittest.TestCase): + """AnyTypeNotString unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_api_response.py b/samples/openapi3/client/petstore/python/test/components/schema/test_api_response.py new file mode 100644 index 00000000000..14d581d3959 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_api_response.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.api_response import ApiResponse +from petstore_api.configurations import schema_configuration + + +class TestApiResponse(unittest.TestCase): + """ApiResponse unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_apple.py b/samples/openapi3/client/petstore/python/test/components/schema/test_apple.py new file mode 100644 index 00000000000..a8efb818c69 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_apple.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.apple import Apple +from petstore_api.configurations import schema_configuration + + +class TestApple(unittest.TestCase): + """Apple unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_apple_req.py b/samples/openapi3/client/petstore/python/test/components/schema/test_apple_req.py new file mode 100644 index 00000000000..8773f7cef50 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_apple_req.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.apple_req import AppleReq +from petstore_api.configurations import schema_configuration + + +class TestAppleReq(unittest.TestCase): + """AppleReq unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_array_holding_any_type.py b/samples/openapi3/client/petstore/python/test/components/schema/test_array_holding_any_type.py new file mode 100644 index 00000000000..97caea0e562 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_array_holding_any_type.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.array_holding_any_type import ArrayHoldingAnyType +from petstore_api.configurations import schema_configuration + + +class TestArrayHoldingAnyType(unittest.TestCase): + """ArrayHoldingAnyType unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python/test/components/schema/test_array_of_array_of_number_only.py new file mode 100644 index 00000000000..4bcf0491039 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_array_of_array_of_number_only.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly +from petstore_api.configurations import schema_configuration + + +class TestArrayOfArrayOfNumberOnly(unittest.TestCase): + """ArrayOfArrayOfNumberOnly unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_array_of_enums.py b/samples/openapi3/client/petstore/python/test/components/schema/test_array_of_enums.py new file mode 100644 index 00000000000..139f46f3347 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_array_of_enums.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.array_of_enums import ArrayOfEnums +from petstore_api.configurations import schema_configuration + + +class TestArrayOfEnums(unittest.TestCase): + """ArrayOfEnums unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_array_of_number_only.py b/samples/openapi3/client/petstore/python/test/components/schema/test_array_of_number_only.py new file mode 100644 index 00000000000..bedee212c9d --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_array_of_number_only.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.array_of_number_only import ArrayOfNumberOnly +from petstore_api.configurations import schema_configuration + + +class TestArrayOfNumberOnly(unittest.TestCase): + """ArrayOfNumberOnly unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_array_test.py b/samples/openapi3/client/petstore/python/test/components/schema/test_array_test.py new file mode 100644 index 00000000000..868c763c84b --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_array_test.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.array_test import ArrayTest +from petstore_api.configurations import schema_configuration + + +class TestArrayTest(unittest.TestCase): + """ArrayTest unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_array_with_validations_in_items.py b/samples/openapi3/client/petstore/python/test/components/schema/test_array_with_validations_in_items.py new file mode 100644 index 00000000000..82ff6a33c3c --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_array_with_validations_in_items.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.array_with_validations_in_items import ArrayWithValidationsInItems +from petstore_api.configurations import schema_configuration + + +class TestArrayWithValidationsInItems(unittest.TestCase): + """ArrayWithValidationsInItems unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_banana.py b/samples/openapi3/client/petstore/python/test/components/schema/test_banana.py new file mode 100644 index 00000000000..d6a7d180a5f --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_banana.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.banana import Banana +from petstore_api.configurations import schema_configuration + + +class TestBanana(unittest.TestCase): + """Banana unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_banana_req.py b/samples/openapi3/client/petstore/python/test/components/schema/test_banana_req.py new file mode 100644 index 00000000000..2e15cf505e0 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_banana_req.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.banana_req import BananaReq +from petstore_api.configurations import schema_configuration + + +class TestBananaReq(unittest.TestCase): + """BananaReq unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_bar.py b/samples/openapi3/client/petstore/python/test/components/schema/test_bar.py new file mode 100644 index 00000000000..00d4e8dcf3f --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_bar.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.bar import Bar +from petstore_api.configurations import schema_configuration + + +class TestBar(unittest.TestCase): + """Bar unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_basque_pig.py b/samples/openapi3/client/petstore/python/test/components/schema/test_basque_pig.py new file mode 100644 index 00000000000..f548ef4aa42 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_basque_pig.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.basque_pig import BasquePig +from petstore_api.configurations import schema_configuration + + +class TestBasquePig(unittest.TestCase): + """BasquePig unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_boolean.py b/samples/openapi3/client/petstore/python/test/components/schema/test_boolean.py new file mode 100644 index 00000000000..4317266b2a1 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_boolean.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.boolean import Boolean +from petstore_api.configurations import schema_configuration + + +class TestBoolean(unittest.TestCase): + """Boolean unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_boolean_enum.py b/samples/openapi3/client/petstore/python/test/components/schema/test_boolean_enum.py new file mode 100644 index 00000000000..6daf6704532 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_boolean_enum.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.boolean_enum import BooleanEnum +from petstore_api.configurations import schema_configuration + + +class TestBooleanEnum(unittest.TestCase): + """BooleanEnum unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_capitalization.py b/samples/openapi3/client/petstore/python/test/components/schema/test_capitalization.py new file mode 100644 index 00000000000..f9904439bc8 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_capitalization.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.capitalization import Capitalization +from petstore_api.configurations import schema_configuration + + +class TestCapitalization(unittest.TestCase): + """Capitalization unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_cat.py b/samples/openapi3/client/petstore/python/test/components/schema/test_cat.py new file mode 100644 index 00000000000..369a8411af2 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_cat.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.cat import Cat +from petstore_api.configurations import schema_configuration + + +class TestCat(unittest.TestCase): + """Cat unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_category.py b/samples/openapi3/client/petstore/python/test/components/schema/test_category.py new file mode 100644 index 00000000000..c62b0b0767c --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_category.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.category import Category +from petstore_api.configurations import schema_configuration + + +class TestCategory(unittest.TestCase): + """Category unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_child_cat.py b/samples/openapi3/client/petstore/python/test/components/schema/test_child_cat.py new file mode 100644 index 00000000000..1f58fe80052 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_child_cat.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.child_cat import ChildCat +from petstore_api.configurations import schema_configuration + + +class TestChildCat(unittest.TestCase): + """ChildCat unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_class_model.py b/samples/openapi3/client/petstore/python/test/components/schema/test_class_model.py new file mode 100644 index 00000000000..55d67e7e938 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_class_model.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.class_model import ClassModel +from petstore_api.configurations import schema_configuration + + +class TestClassModel(unittest.TestCase): + """ClassModel unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_client.py b/samples/openapi3/client/petstore/python/test/components/schema/test_client.py new file mode 100644 index 00000000000..0a6a1769fcf --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_client.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.client import Client +from petstore_api.configurations import schema_configuration + + +class TestClient(unittest.TestCase): + """Client unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_complex_quadrilateral.py b/samples/openapi3/client/petstore/python/test/components/schema/test_complex_quadrilateral.py new file mode 100644 index 00000000000..1f023210c84 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_complex_quadrilateral.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.complex_quadrilateral import ComplexQuadrilateral +from petstore_api.configurations import schema_configuration + + +class TestComplexQuadrilateral(unittest.TestCase): + """ComplexQuadrilateral unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_composed_any_of_different_types_no_validations.py b/samples/openapi3/client/petstore/python/test/components/schema/test_composed_any_of_different_types_no_validations.py new file mode 100644 index 00000000000..3db1c0ad15b --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_composed_any_of_different_types_no_validations.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.composed_any_of_different_types_no_validations import ComposedAnyOfDifferentTypesNoValidations +from petstore_api.configurations import schema_configuration + + +class TestComposedAnyOfDifferentTypesNoValidations(unittest.TestCase): + """ComposedAnyOfDifferentTypesNoValidations unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_composed_array.py b/samples/openapi3/client/petstore/python/test/components/schema/test_composed_array.py new file mode 100644 index 00000000000..2e50b203c3d --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_composed_array.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.composed_array import ComposedArray +from petstore_api.configurations import schema_configuration + + +class TestComposedArray(unittest.TestCase): + """ComposedArray unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_composed_bool.py b/samples/openapi3/client/petstore/python/test/components/schema/test_composed_bool.py new file mode 100644 index 00000000000..b877cec1e46 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_composed_bool.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.composed_bool import ComposedBool +from petstore_api.configurations import schema_configuration + + +class TestComposedBool(unittest.TestCase): + """ComposedBool unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_composed_none.py b/samples/openapi3/client/petstore/python/test/components/schema/test_composed_none.py new file mode 100644 index 00000000000..b4c3bc28bcd --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_composed_none.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.composed_none import ComposedNone +from petstore_api.configurations import schema_configuration + + +class TestComposedNone(unittest.TestCase): + """ComposedNone unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_composed_number.py b/samples/openapi3/client/petstore/python/test/components/schema/test_composed_number.py new file mode 100644 index 00000000000..ff363df9d31 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_composed_number.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.composed_number import ComposedNumber +from petstore_api.configurations import schema_configuration + + +class TestComposedNumber(unittest.TestCase): + """ComposedNumber unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_composed_object.py b/samples/openapi3/client/petstore/python/test/components/schema/test_composed_object.py new file mode 100644 index 00000000000..3ace07694a3 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_composed_object.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.composed_object import ComposedObject +from petstore_api.configurations import schema_configuration + + +class TestComposedObject(unittest.TestCase): + """ComposedObject unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_composed_one_of_different_types.py b/samples/openapi3/client/petstore/python/test/components/schema/test_composed_one_of_different_types.py new file mode 100644 index 00000000000..5b5d3faf5a4 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_composed_one_of_different_types.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.composed_one_of_different_types import ComposedOneOfDifferentTypes +from petstore_api.configurations import schema_configuration + + +class TestComposedOneOfDifferentTypes(unittest.TestCase): + """ComposedOneOfDifferentTypes unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_composed_string.py b/samples/openapi3/client/petstore/python/test/components/schema/test_composed_string.py new file mode 100644 index 00000000000..47625efc880 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_composed_string.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.composed_string import ComposedString +from petstore_api.configurations import schema_configuration + + +class TestComposedString(unittest.TestCase): + """ComposedString unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_currency.py b/samples/openapi3/client/petstore/python/test/components/schema/test_currency.py new file mode 100644 index 00000000000..fa9e2adb744 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_currency.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.currency import Currency +from petstore_api.configurations import schema_configuration + + +class TestCurrency(unittest.TestCase): + """Currency unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_danish_pig.py b/samples/openapi3/client/petstore/python/test/components/schema/test_danish_pig.py new file mode 100644 index 00000000000..8437989bb8d --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_danish_pig.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.danish_pig import DanishPig +from petstore_api.configurations import schema_configuration + + +class TestDanishPig(unittest.TestCase): + """DanishPig unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_date_time_test.py b/samples/openapi3/client/petstore/python/test/components/schema/test_date_time_test.py new file mode 100644 index 00000000000..c87f3165df6 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_date_time_test.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.date_time_test import DateTimeTest +from petstore_api.configurations import schema_configuration + + +class TestDateTimeTest(unittest.TestCase): + """DateTimeTest unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_date_time_with_validations.py b/samples/openapi3/client/petstore/python/test/components/schema/test_date_time_with_validations.py new file mode 100644 index 00000000000..cc68a8b5740 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_date_time_with_validations.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.date_time_with_validations import DateTimeWithValidations +from petstore_api.configurations import schema_configuration + + +class TestDateTimeWithValidations(unittest.TestCase): + """DateTimeWithValidations unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_date_with_validations.py b/samples/openapi3/client/petstore/python/test/components/schema/test_date_with_validations.py new file mode 100644 index 00000000000..d62a400fe20 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_date_with_validations.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.date_with_validations import DateWithValidations +from petstore_api.configurations import schema_configuration + + +class TestDateWithValidations(unittest.TestCase): + """DateWithValidations unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_decimal_payload.py b/samples/openapi3/client/petstore/python/test/components/schema/test_decimal_payload.py new file mode 100644 index 00000000000..456fd06c0c0 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_decimal_payload.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.decimal_payload import DecimalPayload +from petstore_api.configurations import schema_configuration + + +class TestDecimalPayload(unittest.TestCase): + """DecimalPayload unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_dog.py b/samples/openapi3/client/petstore/python/test/components/schema/test_dog.py new file mode 100644 index 00000000000..36b83e2cfbd --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_dog.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.dog import Dog +from petstore_api.configurations import schema_configuration + + +class TestDog(unittest.TestCase): + """Dog unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_drawing.py b/samples/openapi3/client/petstore/python/test/components/schema/test_drawing.py new file mode 100644 index 00000000000..11285ec7c19 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_drawing.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.drawing import Drawing +from petstore_api.configurations import schema_configuration + + +class TestDrawing(unittest.TestCase): + """Drawing unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_enum_arrays.py b/samples/openapi3/client/petstore/python/test/components/schema/test_enum_arrays.py new file mode 100644 index 00000000000..a23addc0baf --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_enum_arrays.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.enum_arrays import EnumArrays +from petstore_api.configurations import schema_configuration + + +class TestEnumArrays(unittest.TestCase): + """EnumArrays unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_enum_class.py b/samples/openapi3/client/petstore/python/test/components/schema/test_enum_class.py new file mode 100644 index 00000000000..2a1b9e5dabb --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_enum_class.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.enum_class import EnumClass +from petstore_api.configurations import schema_configuration + + +class TestEnumClass(unittest.TestCase): + """EnumClass unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_enum_test.py b/samples/openapi3/client/petstore/python/test/components/schema/test_enum_test.py new file mode 100644 index 00000000000..9d2889047d2 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_enum_test.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.enum_test import EnumTest +from petstore_api.configurations import schema_configuration + + +class TestEnumTest(unittest.TestCase): + """EnumTest unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_equilateral_triangle.py b/samples/openapi3/client/petstore/python/test/components/schema/test_equilateral_triangle.py new file mode 100644 index 00000000000..e9b2e6b0789 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_equilateral_triangle.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.equilateral_triangle import EquilateralTriangle +from petstore_api.configurations import schema_configuration + + +class TestEquilateralTriangle(unittest.TestCase): + """EquilateralTriangle unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_file.py b/samples/openapi3/client/petstore/python/test/components/schema/test_file.py new file mode 100644 index 00000000000..fadf055afaa --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_file.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.file import File +from petstore_api.configurations import schema_configuration + + +class TestFile(unittest.TestCase): + """File unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_file_schema_test_class.py b/samples/openapi3/client/petstore/python/test/components/schema/test_file_schema_test_class.py new file mode 100644 index 00000000000..878c7ba4776 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_file_schema_test_class.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.file_schema_test_class import FileSchemaTestClass +from petstore_api.configurations import schema_configuration + + +class TestFileSchemaTestClass(unittest.TestCase): + """FileSchemaTestClass unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_foo.py b/samples/openapi3/client/petstore/python/test/components/schema/test_foo.py new file mode 100644 index 00000000000..4ca788b9076 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_foo.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.foo import Foo +from petstore_api.configurations import schema_configuration + + +class TestFoo(unittest.TestCase): + """Foo unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_format_test.py b/samples/openapi3/client/petstore/python/test/components/schema/test_format_test.py new file mode 100644 index 00000000000..e70cf82b279 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_format_test.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.format_test import FormatTest +from petstore_api.configurations import schema_configuration + + +class TestFormatTest(unittest.TestCase): + """FormatTest unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_from_schema.py b/samples/openapi3/client/petstore/python/test/components/schema/test_from_schema.py new file mode 100644 index 00000000000..755f90db5f5 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_from_schema.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.from_schema import FromSchema +from petstore_api.configurations import schema_configuration + + +class TestFromSchema(unittest.TestCase): + """FromSchema unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_fruit.py b/samples/openapi3/client/petstore/python/test/components/schema/test_fruit.py new file mode 100644 index 00000000000..bef8c35a338 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_fruit.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.fruit import Fruit +from petstore_api.configurations import schema_configuration + + +class TestFruit(unittest.TestCase): + """Fruit unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_fruit_req.py b/samples/openapi3/client/petstore/python/test/components/schema/test_fruit_req.py new file mode 100644 index 00000000000..1963a2667a3 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_fruit_req.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.fruit_req import FruitReq +from petstore_api.configurations import schema_configuration + + +class TestFruitReq(unittest.TestCase): + """FruitReq unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_gm_fruit.py b/samples/openapi3/client/petstore/python/test/components/schema/test_gm_fruit.py new file mode 100644 index 00000000000..a233bd63f96 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_gm_fruit.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.gm_fruit import GmFruit +from petstore_api.configurations import schema_configuration + + +class TestGmFruit(unittest.TestCase): + """GmFruit unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_grandparent_animal.py b/samples/openapi3/client/petstore/python/test/components/schema/test_grandparent_animal.py new file mode 100644 index 00000000000..93aa9e3b389 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_grandparent_animal.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.grandparent_animal import GrandparentAnimal +from petstore_api.configurations import schema_configuration + + +class TestGrandparentAnimal(unittest.TestCase): + """GrandparentAnimal unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_has_only_read_only.py b/samples/openapi3/client/petstore/python/test/components/schema/test_has_only_read_only.py new file mode 100644 index 00000000000..ecbe54fcd96 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_has_only_read_only.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.has_only_read_only import HasOnlyReadOnly +from petstore_api.configurations import schema_configuration + + +class TestHasOnlyReadOnly(unittest.TestCase): + """HasOnlyReadOnly unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_health_check_result.py b/samples/openapi3/client/petstore/python/test/components/schema/test_health_check_result.py new file mode 100644 index 00000000000..e9c0bb96d97 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_health_check_result.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.health_check_result import HealthCheckResult +from petstore_api.configurations import schema_configuration + + +class TestHealthCheckResult(unittest.TestCase): + """HealthCheckResult unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_integer_enum.py b/samples/openapi3/client/petstore/python/test/components/schema/test_integer_enum.py new file mode 100644 index 00000000000..37edfa3cbe6 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_integer_enum.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.integer_enum import IntegerEnum +from petstore_api.configurations import schema_configuration + + +class TestIntegerEnum(unittest.TestCase): + """IntegerEnum unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_integer_enum_big.py b/samples/openapi3/client/petstore/python/test/components/schema/test_integer_enum_big.py new file mode 100644 index 00000000000..aadd6521a97 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_integer_enum_big.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.integer_enum_big import IntegerEnumBig +from petstore_api.configurations import schema_configuration + + +class TestIntegerEnumBig(unittest.TestCase): + """IntegerEnumBig unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_integer_enum_one_value.py b/samples/openapi3/client/petstore/python/test/components/schema/test_integer_enum_one_value.py new file mode 100644 index 00000000000..28cfcfb636e --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_integer_enum_one_value.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.integer_enum_one_value import IntegerEnumOneValue +from petstore_api.configurations import schema_configuration + + +class TestIntegerEnumOneValue(unittest.TestCase): + """IntegerEnumOneValue unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_integer_enum_with_default_value.py b/samples/openapi3/client/petstore/python/test/components/schema/test_integer_enum_with_default_value.py new file mode 100644 index 00000000000..19cbef9aa46 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_integer_enum_with_default_value.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.integer_enum_with_default_value import IntegerEnumWithDefaultValue +from petstore_api.configurations import schema_configuration + + +class TestIntegerEnumWithDefaultValue(unittest.TestCase): + """IntegerEnumWithDefaultValue unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_integer_max10.py b/samples/openapi3/client/petstore/python/test/components/schema/test_integer_max10.py new file mode 100644 index 00000000000..bef8c95cae4 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_integer_max10.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.integer_max10 import IntegerMax10 +from petstore_api.configurations import schema_configuration + + +class TestIntegerMax10(unittest.TestCase): + """IntegerMax10 unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_integer_min15.py b/samples/openapi3/client/petstore/python/test/components/schema/test_integer_min15.py new file mode 100644 index 00000000000..c4962fc71e1 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_integer_min15.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.integer_min15 import IntegerMin15 +from petstore_api.configurations import schema_configuration + + +class TestIntegerMin15(unittest.TestCase): + """IntegerMin15 unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_isosceles_triangle.py b/samples/openapi3/client/petstore/python/test/components/schema/test_isosceles_triangle.py new file mode 100644 index 00000000000..e6ca749d562 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_isosceles_triangle.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.isosceles_triangle import IsoscelesTriangle +from petstore_api.configurations import schema_configuration + + +class TestIsoscelesTriangle(unittest.TestCase): + """IsoscelesTriangle unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_items.py b/samples/openapi3/client/petstore/python/test/components/schema/test_items.py new file mode 100644 index 00000000000..c5bc17d9297 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_items.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.items import Items +from petstore_api.configurations import schema_configuration + + +class TestItems(unittest.TestCase): + """Items unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_json_patch_request.py b/samples/openapi3/client/petstore/python/test/components/schema/test_json_patch_request.py new file mode 100644 index 00000000000..e68e51444b8 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_json_patch_request.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.json_patch_request import JSONPatchRequest +from petstore_api.configurations import schema_configuration + + +class TestJSONPatchRequest(unittest.TestCase): + """JSONPatchRequest unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_json_patch_request_add_replace_test.py b/samples/openapi3/client/petstore/python/test/components/schema/test_json_patch_request_add_replace_test.py new file mode 100644 index 00000000000..4394369820d --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_json_patch_request_add_replace_test.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.json_patch_request_add_replace_test import JSONPatchRequestAddReplaceTest +from petstore_api.configurations import schema_configuration + + +class TestJSONPatchRequestAddReplaceTest(unittest.TestCase): + """JSONPatchRequestAddReplaceTest unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_json_patch_request_move_copy.py b/samples/openapi3/client/petstore/python/test/components/schema/test_json_patch_request_move_copy.py new file mode 100644 index 00000000000..8a33ca5c594 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_json_patch_request_move_copy.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.json_patch_request_move_copy import JSONPatchRequestMoveCopy +from petstore_api.configurations import schema_configuration + + +class TestJSONPatchRequestMoveCopy(unittest.TestCase): + """JSONPatchRequestMoveCopy unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_json_patch_request_remove.py b/samples/openapi3/client/petstore/python/test/components/schema/test_json_patch_request_remove.py new file mode 100644 index 00000000000..2b01129e05e --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_json_patch_request_remove.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.json_patch_request_remove import JSONPatchRequestRemove +from petstore_api.configurations import schema_configuration + + +class TestJSONPatchRequestRemove(unittest.TestCase): + """JSONPatchRequestRemove unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_mammal.py b/samples/openapi3/client/petstore/python/test/components/schema/test_mammal.py new file mode 100644 index 00000000000..2d65e76d545 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_mammal.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.mammal import Mammal +from petstore_api.configurations import schema_configuration + + +class TestMammal(unittest.TestCase): + """Mammal unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_map_test.py b/samples/openapi3/client/petstore/python/test/components/schema/test_map_test.py new file mode 100644 index 00000000000..adf092179d5 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_map_test.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.map_test import MapTest +from petstore_api.configurations import schema_configuration + + +class TestMapTest(unittest.TestCase): + """MapTest unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python/test/components/schema/test_mixed_properties_and_additional_properties_class.py new file mode 100644 index 00000000000..e1476a81e6c --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_mixed_properties_and_additional_properties_class.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass +from petstore_api.configurations import schema_configuration + + +class TestMixedPropertiesAndAdditionalPropertiesClass(unittest.TestCase): + """MixedPropertiesAndAdditionalPropertiesClass unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_money.py b/samples/openapi3/client/petstore/python/test/components/schema/test_money.py new file mode 100644 index 00000000000..3225191457d --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_money.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.money import Money +from petstore_api.configurations import schema_configuration + + +class TestMoney(unittest.TestCase): + """Money unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_name.py b/samples/openapi3/client/petstore/python/test/components/schema/test_name.py new file mode 100644 index 00000000000..32e18736931 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_name.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.name import Name +from petstore_api.configurations import schema_configuration + + +class TestName(unittest.TestCase): + """Name unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_no_additional_properties.py b/samples/openapi3/client/petstore/python/test/components/schema/test_no_additional_properties.py new file mode 100644 index 00000000000..78cbd73e142 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_no_additional_properties.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.no_additional_properties import NoAdditionalProperties +from petstore_api.configurations import schema_configuration + + +class TestNoAdditionalProperties(unittest.TestCase): + """NoAdditionalProperties unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_nullable_class.py b/samples/openapi3/client/petstore/python/test/components/schema/test_nullable_class.py new file mode 100644 index 00000000000..151554c9b0b --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_nullable_class.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.nullable_class import NullableClass +from petstore_api.configurations import schema_configuration + + +class TestNullableClass(unittest.TestCase): + """NullableClass unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_nullable_shape.py b/samples/openapi3/client/petstore/python/test/components/schema/test_nullable_shape.py new file mode 100644 index 00000000000..d61ce67b3f6 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_nullable_shape.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.nullable_shape import NullableShape +from petstore_api.configurations import schema_configuration + + +class TestNullableShape(unittest.TestCase): + """NullableShape unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_nullable_string.py b/samples/openapi3/client/petstore/python/test/components/schema/test_nullable_string.py new file mode 100644 index 00000000000..14f537b00c1 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_nullable_string.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.nullable_string import NullableString +from petstore_api.configurations import schema_configuration + + +class TestNullableString(unittest.TestCase): + """NullableString unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_number.py b/samples/openapi3/client/petstore/python/test/components/schema/test_number.py new file mode 100644 index 00000000000..3b70e2ccb21 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_number.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.number import Number +from petstore_api.configurations import schema_configuration + + +class TestNumber(unittest.TestCase): + """Number unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_number_only.py b/samples/openapi3/client/petstore/python/test/components/schema/test_number_only.py new file mode 100644 index 00000000000..339a6e555b5 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_number_only.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.number_only import NumberOnly +from petstore_api.configurations import schema_configuration + + +class TestNumberOnly(unittest.TestCase): + """NumberOnly unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_number_with_validations.py b/samples/openapi3/client/petstore/python/test/components/schema/test_number_with_validations.py new file mode 100644 index 00000000000..d2e17ff77f5 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_number_with_validations.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.number_with_validations import NumberWithValidations +from petstore_api.configurations import schema_configuration + + +class TestNumberWithValidations(unittest.TestCase): + """NumberWithValidations unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_object_interface.py b/samples/openapi3/client/petstore/python/test/components/schema/test_object_interface.py new file mode 100644 index 00000000000..7f4fa92ec2a --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_object_interface.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.object_interface import ObjectInterface +from petstore_api.configurations import schema_configuration + + +class TestObjectInterface(unittest.TestCase): + """ObjectInterface unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_object_model_with_arg_and_args_properties.py b/samples/openapi3/client/petstore/python/test/components/schema/test_object_model_with_arg_and_args_properties.py new file mode 100644 index 00000000000..f2ecdb77464 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_object_model_with_arg_and_args_properties.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.object_model_with_arg_and_args_properties import ObjectModelWithArgAndArgsProperties +from petstore_api.configurations import schema_configuration + + +class TestObjectModelWithArgAndArgsProperties(unittest.TestCase): + """ObjectModelWithArgAndArgsProperties unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_object_model_with_ref_props.py b/samples/openapi3/client/petstore/python/test/components/schema/test_object_model_with_ref_props.py new file mode 100644 index 00000000000..3b992be7be6 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_object_model_with_ref_props.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.object_model_with_ref_props import ObjectModelWithRefProps +from petstore_api.configurations import schema_configuration + + +class TestObjectModelWithRefProps(unittest.TestCase): + """ObjectModelWithRefProps unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_object_with_all_of_with_req_test_prop_from_unset_add_prop.py b/samples/openapi3/client/petstore/python/test/components/schema/test_object_with_all_of_with_req_test_prop_from_unset_add_prop.py new file mode 100644 index 00000000000..7bcc2a10038 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_object_with_all_of_with_req_test_prop_from_unset_add_prop.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.object_with_all_of_with_req_test_prop_from_unset_add_prop import ObjectWithAllOfWithReqTestPropFromUnsetAddProp +from petstore_api.configurations import schema_configuration + + +class TestObjectWithAllOfWithReqTestPropFromUnsetAddProp(unittest.TestCase): + """ObjectWithAllOfWithReqTestPropFromUnsetAddProp unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_object_with_colliding_properties.py b/samples/openapi3/client/petstore/python/test/components/schema/test_object_with_colliding_properties.py new file mode 100644 index 00000000000..ddce67fd037 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_object_with_colliding_properties.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.object_with_colliding_properties import ObjectWithCollidingProperties +from petstore_api.configurations import schema_configuration + + +class TestObjectWithCollidingProperties(unittest.TestCase): + """ObjectWithCollidingProperties unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_object_with_decimal_properties.py b/samples/openapi3/client/petstore/python/test/components/schema/test_object_with_decimal_properties.py new file mode 100644 index 00000000000..d211da510ef --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_object_with_decimal_properties.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.object_with_decimal_properties import ObjectWithDecimalProperties +from petstore_api.configurations import schema_configuration + + +class TestObjectWithDecimalProperties(unittest.TestCase): + """ObjectWithDecimalProperties unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_object_with_difficultly_named_props.py b/samples/openapi3/client/petstore/python/test/components/schema/test_object_with_difficultly_named_props.py new file mode 100644 index 00000000000..f382da3d73c --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_object_with_difficultly_named_props.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.object_with_difficultly_named_props import ObjectWithDifficultlyNamedProps +from petstore_api.configurations import schema_configuration + + +class TestObjectWithDifficultlyNamedProps(unittest.TestCase): + """ObjectWithDifficultlyNamedProps unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_object_with_inline_composition_property.py b/samples/openapi3/client/petstore/python/test/components/schema/test_object_with_inline_composition_property.py new file mode 100644 index 00000000000..90349fe918c --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_object_with_inline_composition_property.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.object_with_inline_composition_property import ObjectWithInlineCompositionProperty +from petstore_api.configurations import schema_configuration + + +class TestObjectWithInlineCompositionProperty(unittest.TestCase): + """ObjectWithInlineCompositionProperty unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_object_with_invalid_named_refed_properties.py b/samples/openapi3/client/petstore/python/test/components/schema/test_object_with_invalid_named_refed_properties.py new file mode 100644 index 00000000000..ed1e24e3c8f --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_object_with_invalid_named_refed_properties.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.object_with_invalid_named_refed_properties import ObjectWithInvalidNamedRefedProperties +from petstore_api.configurations import schema_configuration + + +class TestObjectWithInvalidNamedRefedProperties(unittest.TestCase): + """ObjectWithInvalidNamedRefedProperties unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_object_with_optional_test_prop.py b/samples/openapi3/client/petstore/python/test/components/schema/test_object_with_optional_test_prop.py new file mode 100644 index 00000000000..5b5dd665f44 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_object_with_optional_test_prop.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.object_with_optional_test_prop import ObjectWithOptionalTestProp +from petstore_api.configurations import schema_configuration + + +class TestObjectWithOptionalTestProp(unittest.TestCase): + """ObjectWithOptionalTestProp unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_object_with_validations.py b/samples/openapi3/client/petstore/python/test/components/schema/test_object_with_validations.py new file mode 100644 index 00000000000..7eea814260d --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_object_with_validations.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.object_with_validations import ObjectWithValidations +from petstore_api.configurations import schema_configuration + + +class TestObjectWithValidations(unittest.TestCase): + """ObjectWithValidations unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_order.py b/samples/openapi3/client/petstore/python/test/components/schema/test_order.py new file mode 100644 index 00000000000..2526f883e78 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_order.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.order import Order +from petstore_api.configurations import schema_configuration + + +class TestOrder(unittest.TestCase): + """Order unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_parent_pet.py b/samples/openapi3/client/petstore/python/test/components/schema/test_parent_pet.py new file mode 100644 index 00000000000..48791b6b135 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_parent_pet.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.parent_pet import ParentPet +from petstore_api.configurations import schema_configuration + + +class TestParentPet(unittest.TestCase): + """ParentPet unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_pet.py b/samples/openapi3/client/petstore/python/test/components/schema/test_pet.py new file mode 100644 index 00000000000..ce5a6a76d49 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_pet.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.pet import Pet +from petstore_api.configurations import schema_configuration + + +class TestPet(unittest.TestCase): + """Pet unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_pig.py b/samples/openapi3/client/petstore/python/test/components/schema/test_pig.py new file mode 100644 index 00000000000..84187767257 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_pig.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.pig import Pig +from petstore_api.configurations import schema_configuration + + +class TestPig(unittest.TestCase): + """Pig unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_player.py b/samples/openapi3/client/petstore/python/test/components/schema/test_player.py new file mode 100644 index 00000000000..23b1640d6f2 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_player.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.player import Player +from petstore_api.configurations import schema_configuration + + +class TestPlayer(unittest.TestCase): + """Player unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_quadrilateral.py b/samples/openapi3/client/petstore/python/test/components/schema/test_quadrilateral.py new file mode 100644 index 00000000000..828525dd62e --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_quadrilateral.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.quadrilateral import Quadrilateral +from petstore_api.configurations import schema_configuration + + +class TestQuadrilateral(unittest.TestCase): + """Quadrilateral unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_quadrilateral_interface.py b/samples/openapi3/client/petstore/python/test/components/schema/test_quadrilateral_interface.py new file mode 100644 index 00000000000..1b1d849c538 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_quadrilateral_interface.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.quadrilateral_interface import QuadrilateralInterface +from petstore_api.configurations import schema_configuration + + +class TestQuadrilateralInterface(unittest.TestCase): + """QuadrilateralInterface unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_read_only_first.py b/samples/openapi3/client/petstore/python/test/components/schema/test_read_only_first.py new file mode 100644 index 00000000000..12156fa7b86 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_read_only_first.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.read_only_first import ReadOnlyFirst +from petstore_api.configurations import schema_configuration + + +class TestReadOnlyFirst(unittest.TestCase): + """ReadOnlyFirst unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_ref_pet.py b/samples/openapi3/client/petstore/python/test/components/schema/test_ref_pet.py new file mode 100644 index 00000000000..fb2f3aa65b1 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_ref_pet.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.ref_pet import RefPet +from petstore_api.configurations import schema_configuration + + +class TestRefPet(unittest.TestCase): + """RefPet unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_req_props_from_explicit_add_props.py b/samples/openapi3/client/petstore/python/test/components/schema/test_req_props_from_explicit_add_props.py new file mode 100644 index 00000000000..045b9f08173 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_req_props_from_explicit_add_props.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.req_props_from_explicit_add_props import ReqPropsFromExplicitAddProps +from petstore_api.configurations import schema_configuration + + +class TestReqPropsFromExplicitAddProps(unittest.TestCase): + """ReqPropsFromExplicitAddProps unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_req_props_from_true_add_props.py b/samples/openapi3/client/petstore/python/test/components/schema/test_req_props_from_true_add_props.py new file mode 100644 index 00000000000..02e9f0e2f76 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_req_props_from_true_add_props.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.req_props_from_true_add_props import ReqPropsFromTrueAddProps +from petstore_api.configurations import schema_configuration + + +class TestReqPropsFromTrueAddProps(unittest.TestCase): + """ReqPropsFromTrueAddProps unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_req_props_from_unset_add_props.py b/samples/openapi3/client/petstore/python/test/components/schema/test_req_props_from_unset_add_props.py new file mode 100644 index 00000000000..5f6d257764e --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_req_props_from_unset_add_props.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.req_props_from_unset_add_props import ReqPropsFromUnsetAddProps +from petstore_api.configurations import schema_configuration + + +class TestReqPropsFromUnsetAddProps(unittest.TestCase): + """ReqPropsFromUnsetAddProps unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_scalene_triangle.py b/samples/openapi3/client/petstore/python/test/components/schema/test_scalene_triangle.py new file mode 100644 index 00000000000..ebadcfa0c41 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_scalene_triangle.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.scalene_triangle import ScaleneTriangle +from petstore_api.configurations import schema_configuration + + +class TestScaleneTriangle(unittest.TestCase): + """ScaleneTriangle unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_self_referencing_array_model.py b/samples/openapi3/client/petstore/python/test/components/schema/test_self_referencing_array_model.py new file mode 100644 index 00000000000..55265171273 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_self_referencing_array_model.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.self_referencing_array_model import SelfReferencingArrayModel +from petstore_api.configurations import schema_configuration + + +class TestSelfReferencingArrayModel(unittest.TestCase): + """SelfReferencingArrayModel unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_self_referencing_object_model.py b/samples/openapi3/client/petstore/python/test/components/schema/test_self_referencing_object_model.py new file mode 100644 index 00000000000..5bbf74c00a0 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_self_referencing_object_model.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.self_referencing_object_model import SelfReferencingObjectModel +from petstore_api.configurations import schema_configuration + + +class TestSelfReferencingObjectModel(unittest.TestCase): + """SelfReferencingObjectModel unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_shape.py b/samples/openapi3/client/petstore/python/test/components/schema/test_shape.py new file mode 100644 index 00000000000..2dbdf882e79 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_shape.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.shape import Shape +from petstore_api.configurations import schema_configuration + + +class TestShape(unittest.TestCase): + """Shape unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_shape_or_null.py b/samples/openapi3/client/petstore/python/test/components/schema/test_shape_or_null.py new file mode 100644 index 00000000000..1ae220993fd --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_shape_or_null.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.shape_or_null import ShapeOrNull +from petstore_api.configurations import schema_configuration + + +class TestShapeOrNull(unittest.TestCase): + """ShapeOrNull unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_simple_quadrilateral.py b/samples/openapi3/client/petstore/python/test/components/schema/test_simple_quadrilateral.py new file mode 100644 index 00000000000..9f4ff05fcf8 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_simple_quadrilateral.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.simple_quadrilateral import SimpleQuadrilateral +from petstore_api.configurations import schema_configuration + + +class TestSimpleQuadrilateral(unittest.TestCase): + """SimpleQuadrilateral unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_some_object.py b/samples/openapi3/client/petstore/python/test/components/schema/test_some_object.py new file mode 100644 index 00000000000..7d63e131138 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_some_object.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.some_object import SomeObject +from petstore_api.configurations import schema_configuration + + +class TestSomeObject(unittest.TestCase): + """SomeObject unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_special_model_name.py b/samples/openapi3/client/petstore/python/test/components/schema/test_special_model_name.py new file mode 100644 index 00000000000..96f8de12940 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_special_model_name.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.special_model_name import SpecialModelName +from petstore_api.configurations import schema_configuration + + +class TestSpecialModelName(unittest.TestCase): + """SpecialModelName unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_string.py b/samples/openapi3/client/petstore/python/test/components/schema/test_string.py new file mode 100644 index 00000000000..dfb4829d12d --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_string.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.string import String +from petstore_api.configurations import schema_configuration + + +class TestString(unittest.TestCase): + """String unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_string_boolean_map.py b/samples/openapi3/client/petstore/python/test/components/schema/test_string_boolean_map.py new file mode 100644 index 00000000000..9d409c20677 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_string_boolean_map.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.string_boolean_map import StringBooleanMap +from petstore_api.configurations import schema_configuration + + +class TestStringBooleanMap(unittest.TestCase): + """StringBooleanMap unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_string_enum.py b/samples/openapi3/client/petstore/python/test/components/schema/test_string_enum.py new file mode 100644 index 00000000000..012ce288d32 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_string_enum.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.string_enum import StringEnum +from petstore_api.configurations import schema_configuration + + +class TestStringEnum(unittest.TestCase): + """StringEnum unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_string_enum_with_default_value.py b/samples/openapi3/client/petstore/python/test/components/schema/test_string_enum_with_default_value.py new file mode 100644 index 00000000000..014732ebe35 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_string_enum_with_default_value.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.string_enum_with_default_value import StringEnumWithDefaultValue +from petstore_api.configurations import schema_configuration + + +class TestStringEnumWithDefaultValue(unittest.TestCase): + """StringEnumWithDefaultValue unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_string_with_validation.py b/samples/openapi3/client/petstore/python/test/components/schema/test_string_with_validation.py new file mode 100644 index 00000000000..a2571ee9df7 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_string_with_validation.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.string_with_validation import StringWithValidation +from petstore_api.configurations import schema_configuration + + +class TestStringWithValidation(unittest.TestCase): + """StringWithValidation unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_tag.py b/samples/openapi3/client/petstore/python/test/components/schema/test_tag.py new file mode 100644 index 00000000000..81539936699 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_tag.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.tag import Tag +from petstore_api.configurations import schema_configuration + + +class TestTag(unittest.TestCase): + """Tag unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_triangle.py b/samples/openapi3/client/petstore/python/test/components/schema/test_triangle.py new file mode 100644 index 00000000000..19a666c7902 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_triangle.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.triangle import Triangle +from petstore_api.configurations import schema_configuration + + +class TestTriangle(unittest.TestCase): + """Triangle unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_triangle_interface.py b/samples/openapi3/client/petstore/python/test/components/schema/test_triangle_interface.py new file mode 100644 index 00000000000..833cdce5669 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_triangle_interface.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.triangle_interface import TriangleInterface +from petstore_api.configurations import schema_configuration + + +class TestTriangleInterface(unittest.TestCase): + """TriangleInterface unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_user.py b/samples/openapi3/client/petstore/python/test/components/schema/test_user.py new file mode 100644 index 00000000000..09a526e4c45 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_user.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.user import User +from petstore_api.configurations import schema_configuration + + +class TestUser(unittest.TestCase): + """User unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_uuid_string.py b/samples/openapi3/client/petstore/python/test/components/schema/test_uuid_string.py new file mode 100644 index 00000000000..165e376b18f --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_uuid_string.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.uuid_string import UUIDString +from petstore_api.configurations import schema_configuration + + +class TestUUIDString(unittest.TestCase): + """UUIDString unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_whale.py b/samples/openapi3/client/petstore/python/test/components/schema/test_whale.py new file mode 100644 index 00000000000..639b1d58157 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_whale.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.whale import Whale +from petstore_api.configurations import schema_configuration + + +class TestWhale(unittest.TestCase): + """Whale unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/components/schema/test_zebra.py b/samples/openapi3/client/petstore/python/test/components/schema/test_zebra.py new file mode 100644 index 00000000000..d31da36ecb4 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/components/schema/test_zebra.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.zebra import Zebra +from petstore_api.configurations import schema_configuration + + +class TestZebra(unittest.TestCase): + """Zebra unit test stubs""" + configuration_ = schema_configuration.SchemaConfiguration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_abstract_step_message.py b/samples/openapi3/client/petstore/python/test/test_models/test_abstract_step_message.py deleted file mode 100644 index 840896b40fe..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_abstract_step_message.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.abstract_step_message import AbstractStepMessage -from petstore_api import configuration - - -class TestAbstractStepMessage(unittest.TestCase): - """AbstractStepMessage unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_additional_properties_class.py b/samples/openapi3/client/petstore/python/test/test_models/test_additional_properties_class.py deleted file mode 100644 index 672b8b4876b..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_additional_properties_class.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.additional_properties_class import AdditionalPropertiesClass -from petstore_api import configuration - - -class TestAdditionalPropertiesClass(unittest.TestCase): - """AdditionalPropertiesClass unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_additional_properties_validator.py b/samples/openapi3/client/petstore/python/test/test_models/test_additional_properties_validator.py deleted file mode 100644 index fa0fe198d79..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_additional_properties_validator.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.additional_properties_validator import AdditionalPropertiesValidator -from petstore_api import configuration - - -class TestAdditionalPropertiesValidator(unittest.TestCase): - """AdditionalPropertiesValidator unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_additional_properties_with_array_of_enums.py b/samples/openapi3/client/petstore/python/test/test_models/test_additional_properties_with_array_of_enums.py deleted file mode 100644 index 02669a5f7f3..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_additional_properties_with_array_of_enums.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.additional_properties_with_array_of_enums import AdditionalPropertiesWithArrayOfEnums -from petstore_api import configuration - - -class TestAdditionalPropertiesWithArrayOfEnums(unittest.TestCase): - """AdditionalPropertiesWithArrayOfEnums unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_address.py b/samples/openapi3/client/petstore/python/test/test_models/test_address.py deleted file mode 100644 index 4bd63aebe19..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_address.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.address import Address -from petstore_api import configuration - - -class TestAddress(unittest.TestCase): - """Address unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_animal.py b/samples/openapi3/client/petstore/python/test/test_models/test_animal.py deleted file mode 100644 index 4a9b77d617d..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_animal.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.animal import Animal -from petstore_api import configuration - - -class TestAnimal(unittest.TestCase): - """Animal unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_animal_farm.py b/samples/openapi3/client/petstore/python/test/test_models/test_animal_farm.py deleted file mode 100644 index 4237b91351c..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_animal_farm.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.animal_farm import AnimalFarm -from petstore_api import configuration - - -class TestAnimalFarm(unittest.TestCase): - """AnimalFarm unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_any_type_and_format.py b/samples/openapi3/client/petstore/python/test/test_models/test_any_type_and_format.py deleted file mode 100644 index dbd95d3b024..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_any_type_and_format.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.any_type_and_format import AnyTypeAndFormat -from petstore_api import configuration - - -class TestAnyTypeAndFormat(unittest.TestCase): - """AnyTypeAndFormat unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_any_type_not_string.py b/samples/openapi3/client/petstore/python/test/test_models/test_any_type_not_string.py deleted file mode 100644 index 74de79873d3..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_any_type_not_string.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.any_type_not_string import AnyTypeNotString -from petstore_api import configuration - - -class TestAnyTypeNotString(unittest.TestCase): - """AnyTypeNotString unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_api_response.py b/samples/openapi3/client/petstore/python/test/test_models/test_api_response.py deleted file mode 100644 index 2631b83ff3d..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_api_response.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.api_response import ApiResponse -from petstore_api import configuration - - -class TestApiResponse(unittest.TestCase): - """ApiResponse unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_apple.py b/samples/openapi3/client/petstore/python/test/test_models/test_apple.py deleted file mode 100644 index 66c9241a73e..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_apple.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.apple import Apple -from petstore_api import configuration - - -class TestApple(unittest.TestCase): - """Apple unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_apple_req.py b/samples/openapi3/client/petstore/python/test/test_models/test_apple_req.py deleted file mode 100644 index 4d20e890cff..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_apple_req.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.apple_req import AppleReq -from petstore_api import configuration - - -class TestAppleReq(unittest.TestCase): - """AppleReq unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_array_holding_any_type.py b/samples/openapi3/client/petstore/python/test/test_models/test_array_holding_any_type.py deleted file mode 100644 index bb9a2603a01..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_array_holding_any_type.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.array_holding_any_type import ArrayHoldingAnyType -from petstore_api import configuration - - -class TestArrayHoldingAnyType(unittest.TestCase): - """ArrayHoldingAnyType unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python/test/test_models/test_array_of_array_of_number_only.py deleted file mode 100644 index 9991efe6573..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_array_of_array_of_number_only.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly -from petstore_api import configuration - - -class TestArrayOfArrayOfNumberOnly(unittest.TestCase): - """ArrayOfArrayOfNumberOnly unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_array_of_enums.py b/samples/openapi3/client/petstore/python/test/test_models/test_array_of_enums.py deleted file mode 100644 index 1040dabae94..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_array_of_enums.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.array_of_enums import ArrayOfEnums -from petstore_api import configuration - - -class TestArrayOfEnums(unittest.TestCase): - """ArrayOfEnums unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_array_of_number_only.py b/samples/openapi3/client/petstore/python/test/test_models/test_array_of_number_only.py deleted file mode 100644 index 9eca2c7a9ee..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_array_of_number_only.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.array_of_number_only import ArrayOfNumberOnly -from petstore_api import configuration - - -class TestArrayOfNumberOnly(unittest.TestCase): - """ArrayOfNumberOnly unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_array_test.py b/samples/openapi3/client/petstore/python/test/test_models/test_array_test.py deleted file mode 100644 index 3c5610cd20b..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_array_test.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.array_test import ArrayTest -from petstore_api import configuration - - -class TestArrayTest(unittest.TestCase): - """ArrayTest unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_array_with_validations_in_items.py b/samples/openapi3/client/petstore/python/test/test_models/test_array_with_validations_in_items.py deleted file mode 100644 index 6c38306b1e4..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_array_with_validations_in_items.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.array_with_validations_in_items import ArrayWithValidationsInItems -from petstore_api import configuration - - -class TestArrayWithValidationsInItems(unittest.TestCase): - """ArrayWithValidationsInItems unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_banana.py b/samples/openapi3/client/petstore/python/test/test_models/test_banana.py deleted file mode 100644 index a0406ea1b8f..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_banana.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.banana import Banana -from petstore_api import configuration - - -class TestBanana(unittest.TestCase): - """Banana unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_banana_req.py b/samples/openapi3/client/petstore/python/test/test_models/test_banana_req.py deleted file mode 100644 index 39ac3c40453..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_banana_req.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.banana_req import BananaReq -from petstore_api import configuration - - -class TestBananaReq(unittest.TestCase): - """BananaReq unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_bar.py b/samples/openapi3/client/petstore/python/test/test_models/test_bar.py deleted file mode 100644 index 52419122ba8..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_bar.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.bar import Bar -from petstore_api import configuration - - -class TestBar(unittest.TestCase): - """Bar unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_basque_pig.py b/samples/openapi3/client/petstore/python/test/test_models/test_basque_pig.py deleted file mode 100644 index f21a84f4dcf..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_basque_pig.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.basque_pig import BasquePig -from petstore_api import configuration - - -class TestBasquePig(unittest.TestCase): - """BasquePig unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_boolean.py b/samples/openapi3/client/petstore/python/test/test_models/test_boolean.py deleted file mode 100644 index cb65350ae50..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_boolean.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.boolean import Boolean -from petstore_api import configuration - - -class TestBoolean(unittest.TestCase): - """Boolean unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_boolean_enum.py b/samples/openapi3/client/petstore/python/test/test_models/test_boolean_enum.py deleted file mode 100644 index 0a1a1fa3cb8..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_boolean_enum.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.boolean_enum import BooleanEnum -from petstore_api import configuration - - -class TestBooleanEnum(unittest.TestCase): - """BooleanEnum unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_capitalization.py b/samples/openapi3/client/petstore/python/test/test_models/test_capitalization.py deleted file mode 100644 index a595cfd15ad..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_capitalization.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.capitalization import Capitalization -from petstore_api import configuration - - -class TestCapitalization(unittest.TestCase): - """Capitalization unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_cat.py b/samples/openapi3/client/petstore/python/test/test_models/test_cat.py deleted file mode 100644 index c8330904ba1..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_cat.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.cat import Cat -from petstore_api import configuration - - -class TestCat(unittest.TestCase): - """Cat unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_category.py b/samples/openapi3/client/petstore/python/test/test_models/test_category.py deleted file mode 100644 index ef8f9dcdf46..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_category.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.category import Category -from petstore_api import configuration - - -class TestCategory(unittest.TestCase): - """Category unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_child_cat.py b/samples/openapi3/client/petstore/python/test/test_models/test_child_cat.py deleted file mode 100644 index 724f0e593c8..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_child_cat.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.child_cat import ChildCat -from petstore_api import configuration - - -class TestChildCat(unittest.TestCase): - """ChildCat unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_class_model.py b/samples/openapi3/client/petstore/python/test/test_models/test_class_model.py deleted file mode 100644 index 133ffbab20b..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_class_model.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.class_model import ClassModel -from petstore_api import configuration - - -class TestClassModel(unittest.TestCase): - """ClassModel unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_client.py b/samples/openapi3/client/petstore/python/test/test_models/test_client.py deleted file mode 100644 index 6849d17a0e1..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_client.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.client import Client -from petstore_api import configuration - - -class TestClient(unittest.TestCase): - """Client unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_complex_quadrilateral.py b/samples/openapi3/client/petstore/python/test/test_models/test_complex_quadrilateral.py deleted file mode 100644 index 0391cbde55d..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_complex_quadrilateral.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.complex_quadrilateral import ComplexQuadrilateral -from petstore_api import configuration - - -class TestComplexQuadrilateral(unittest.TestCase): - """ComplexQuadrilateral unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_composed_any_of_different_types_no_validations.py b/samples/openapi3/client/petstore/python/test/test_models/test_composed_any_of_different_types_no_validations.py deleted file mode 100644 index 0acd76ea3a8..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_composed_any_of_different_types_no_validations.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.composed_any_of_different_types_no_validations import ComposedAnyOfDifferentTypesNoValidations -from petstore_api import configuration - - -class TestComposedAnyOfDifferentTypesNoValidations(unittest.TestCase): - """ComposedAnyOfDifferentTypesNoValidations unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_composed_array.py b/samples/openapi3/client/petstore/python/test/test_models/test_composed_array.py deleted file mode 100644 index 20b69b37bc0..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_composed_array.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.composed_array import ComposedArray -from petstore_api import configuration - - -class TestComposedArray(unittest.TestCase): - """ComposedArray unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_composed_bool.py b/samples/openapi3/client/petstore/python/test/test_models/test_composed_bool.py deleted file mode 100644 index 24d0a279056..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_composed_bool.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.composed_bool import ComposedBool -from petstore_api import configuration - - -class TestComposedBool(unittest.TestCase): - """ComposedBool unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_composed_none.py b/samples/openapi3/client/petstore/python/test/test_models/test_composed_none.py deleted file mode 100644 index 8fdacab439a..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_composed_none.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.composed_none import ComposedNone -from petstore_api import configuration - - -class TestComposedNone(unittest.TestCase): - """ComposedNone unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_composed_number.py b/samples/openapi3/client/petstore/python/test/test_models/test_composed_number.py deleted file mode 100644 index 14a26ab11f3..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_composed_number.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.composed_number import ComposedNumber -from petstore_api import configuration - - -class TestComposedNumber(unittest.TestCase): - """ComposedNumber unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_composed_object.py b/samples/openapi3/client/petstore/python/test/test_models/test_composed_object.py deleted file mode 100644 index dfc7d535604..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_composed_object.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.composed_object import ComposedObject -from petstore_api import configuration - - -class TestComposedObject(unittest.TestCase): - """ComposedObject unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_composed_one_of_different_types.py b/samples/openapi3/client/petstore/python/test/test_models/test_composed_one_of_different_types.py deleted file mode 100644 index 6c003f5468f..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_composed_one_of_different_types.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.composed_one_of_different_types import ComposedOneOfDifferentTypes -from petstore_api import configuration - - -class TestComposedOneOfDifferentTypes(unittest.TestCase): - """ComposedOneOfDifferentTypes unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_composed_string.py b/samples/openapi3/client/petstore/python/test/test_models/test_composed_string.py deleted file mode 100644 index 943dceabba5..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_composed_string.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.composed_string import ComposedString -from petstore_api import configuration - - -class TestComposedString(unittest.TestCase): - """ComposedString unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_currency.py b/samples/openapi3/client/petstore/python/test/test_models/test_currency.py deleted file mode 100644 index cb57f69cfd3..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_currency.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.currency import Currency -from petstore_api import configuration - - -class TestCurrency(unittest.TestCase): - """Currency unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_danish_pig.py b/samples/openapi3/client/petstore/python/test/test_models/test_danish_pig.py deleted file mode 100644 index 600c5d2b42c..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_danish_pig.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.danish_pig import DanishPig -from petstore_api import configuration - - -class TestDanishPig(unittest.TestCase): - """DanishPig unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_date_time_test.py b/samples/openapi3/client/petstore/python/test/test_models/test_date_time_test.py deleted file mode 100644 index 4dca8a44e0d..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_date_time_test.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.date_time_test import DateTimeTest -from petstore_api import configuration - - -class TestDateTimeTest(unittest.TestCase): - """DateTimeTest unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_date_time_with_validations.py b/samples/openapi3/client/petstore/python/test/test_models/test_date_time_with_validations.py deleted file mode 100644 index bb42a49ca27..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_date_time_with_validations.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.date_time_with_validations import DateTimeWithValidations -from petstore_api import configuration - - -class TestDateTimeWithValidations(unittest.TestCase): - """DateTimeWithValidations unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_date_with_validations.py b/samples/openapi3/client/petstore/python/test/test_models/test_date_with_validations.py deleted file mode 100644 index f69834dbe4e..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_date_with_validations.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.date_with_validations import DateWithValidations -from petstore_api import configuration - - -class TestDateWithValidations(unittest.TestCase): - """DateWithValidations unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_decimal_payload.py b/samples/openapi3/client/petstore/python/test/test_models/test_decimal_payload.py deleted file mode 100644 index cbdc32d522a..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_decimal_payload.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.decimal_payload import DecimalPayload -from petstore_api import configuration - - -class TestDecimalPayload(unittest.TestCase): - """DecimalPayload unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_dog.py b/samples/openapi3/client/petstore/python/test/test_models/test_dog.py deleted file mode 100644 index b98ff3d616a..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_dog.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.dog import Dog -from petstore_api import configuration - - -class TestDog(unittest.TestCase): - """Dog unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_drawing.py b/samples/openapi3/client/petstore/python/test/test_models/test_drawing.py deleted file mode 100644 index ef7ebae2245..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_drawing.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.drawing import Drawing -from petstore_api import configuration - - -class TestDrawing(unittest.TestCase): - """Drawing unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_enum_arrays.py b/samples/openapi3/client/petstore/python/test/test_models/test_enum_arrays.py deleted file mode 100644 index 9677bdb09d7..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_enum_arrays.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.enum_arrays import EnumArrays -from petstore_api import configuration - - -class TestEnumArrays(unittest.TestCase): - """EnumArrays unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_enum_class.py b/samples/openapi3/client/petstore/python/test/test_models/test_enum_class.py deleted file mode 100644 index 186d2f9ea40..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_enum_class.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.enum_class import EnumClass -from petstore_api import configuration - - -class TestEnumClass(unittest.TestCase): - """EnumClass unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_enum_test.py b/samples/openapi3/client/petstore/python/test/test_models/test_enum_test.py deleted file mode 100644 index 12b5a83ecc1..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_enum_test.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.enum_test import EnumTest -from petstore_api import configuration - - -class TestEnumTest(unittest.TestCase): - """EnumTest unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_equilateral_triangle.py b/samples/openapi3/client/petstore/python/test/test_models/test_equilateral_triangle.py deleted file mode 100644 index a730b002a18..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_equilateral_triangle.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.equilateral_triangle import EquilateralTriangle -from petstore_api import configuration - - -class TestEquilateralTriangle(unittest.TestCase): - """EquilateralTriangle unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_file.py b/samples/openapi3/client/petstore/python/test/test_models/test_file.py deleted file mode 100644 index f16976abafe..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_file.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.file import File -from petstore_api import configuration - - -class TestFile(unittest.TestCase): - """File unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_file_schema_test_class.py b/samples/openapi3/client/petstore/python/test/test_models/test_file_schema_test_class.py deleted file mode 100644 index 804b3929aaf..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_file_schema_test_class.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.file_schema_test_class import FileSchemaTestClass -from petstore_api import configuration - - -class TestFileSchemaTestClass(unittest.TestCase): - """FileSchemaTestClass unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_foo.py b/samples/openapi3/client/petstore/python/test/test_models/test_foo.py deleted file mode 100644 index b7f7f822e3a..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_foo.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.foo import Foo -from petstore_api import configuration - - -class TestFoo(unittest.TestCase): - """Foo unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_format_test.py b/samples/openapi3/client/petstore/python/test/test_models/test_format_test.py deleted file mode 100644 index 29260143794..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_format_test.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.format_test import FormatTest -from petstore_api import configuration - - -class TestFormatTest(unittest.TestCase): - """FormatTest unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_from_schema.py b/samples/openapi3/client/petstore/python/test/test_models/test_from_schema.py deleted file mode 100644 index 09cf54a1f6c..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_from_schema.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.from_schema import FromSchema -from petstore_api import configuration - - -class TestFromSchema(unittest.TestCase): - """FromSchema unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_fruit.py b/samples/openapi3/client/petstore/python/test/test_models/test_fruit.py deleted file mode 100644 index 18d6acdbbb0..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_fruit.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.fruit import Fruit -from petstore_api import configuration - - -class TestFruit(unittest.TestCase): - """Fruit unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_fruit_req.py b/samples/openapi3/client/petstore/python/test/test_models/test_fruit_req.py deleted file mode 100644 index b3b595f5f28..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_fruit_req.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.fruit_req import FruitReq -from petstore_api import configuration - - -class TestFruitReq(unittest.TestCase): - """FruitReq unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_gm_fruit.py b/samples/openapi3/client/petstore/python/test/test_models/test_gm_fruit.py deleted file mode 100644 index af0199ec494..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_gm_fruit.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.gm_fruit import GmFruit -from petstore_api import configuration - - -class TestGmFruit(unittest.TestCase): - """GmFruit unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_grandparent_animal.py b/samples/openapi3/client/petstore/python/test/test_models/test_grandparent_animal.py deleted file mode 100644 index 748ebdd5b99..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_grandparent_animal.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.grandparent_animal import GrandparentAnimal -from petstore_api import configuration - - -class TestGrandparentAnimal(unittest.TestCase): - """GrandparentAnimal unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_has_only_read_only.py b/samples/openapi3/client/petstore/python/test/test_models/test_has_only_read_only.py deleted file mode 100644 index 84e2c36490a..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_has_only_read_only.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.has_only_read_only import HasOnlyReadOnly -from petstore_api import configuration - - -class TestHasOnlyReadOnly(unittest.TestCase): - """HasOnlyReadOnly unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_health_check_result.py b/samples/openapi3/client/petstore/python/test/test_models/test_health_check_result.py deleted file mode 100644 index cfbd7180491..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_health_check_result.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.health_check_result import HealthCheckResult -from petstore_api import configuration - - -class TestHealthCheckResult(unittest.TestCase): - """HealthCheckResult unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_integer_enum.py b/samples/openapi3/client/petstore/python/test/test_models/test_integer_enum.py deleted file mode 100644 index 7cdaa27f8aa..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_integer_enum.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.integer_enum import IntegerEnum -from petstore_api import configuration - - -class TestIntegerEnum(unittest.TestCase): - """IntegerEnum unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_integer_enum_big.py b/samples/openapi3/client/petstore/python/test/test_models/test_integer_enum_big.py deleted file mode 100644 index 64f39bd58c6..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_integer_enum_big.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.integer_enum_big import IntegerEnumBig -from petstore_api import configuration - - -class TestIntegerEnumBig(unittest.TestCase): - """IntegerEnumBig unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_integer_enum_one_value.py b/samples/openapi3/client/petstore/python/test/test_models/test_integer_enum_one_value.py deleted file mode 100644 index 16052a6086d..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_integer_enum_one_value.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.integer_enum_one_value import IntegerEnumOneValue -from petstore_api import configuration - - -class TestIntegerEnumOneValue(unittest.TestCase): - """IntegerEnumOneValue unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_integer_enum_with_default_value.py b/samples/openapi3/client/petstore/python/test/test_models/test_integer_enum_with_default_value.py deleted file mode 100644 index ffa57385fbe..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_integer_enum_with_default_value.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.integer_enum_with_default_value import IntegerEnumWithDefaultValue -from petstore_api import configuration - - -class TestIntegerEnumWithDefaultValue(unittest.TestCase): - """IntegerEnumWithDefaultValue unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_integer_max10.py b/samples/openapi3/client/petstore/python/test/test_models/test_integer_max10.py deleted file mode 100644 index 46d8c0a7254..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_integer_max10.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.integer_max10 import IntegerMax10 -from petstore_api import configuration - - -class TestIntegerMax10(unittest.TestCase): - """IntegerMax10 unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_integer_min15.py b/samples/openapi3/client/petstore/python/test/test_models/test_integer_min15.py deleted file mode 100644 index 660bf12cd69..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_integer_min15.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.integer_min15 import IntegerMin15 -from petstore_api import configuration - - -class TestIntegerMin15(unittest.TestCase): - """IntegerMin15 unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_isosceles_triangle.py b/samples/openapi3/client/petstore/python/test/test_models/test_isosceles_triangle.py deleted file mode 100644 index 4d82f1056ab..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_isosceles_triangle.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.isosceles_triangle import IsoscelesTriangle -from petstore_api import configuration - - -class TestIsoscelesTriangle(unittest.TestCase): - """IsoscelesTriangle unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_json_patch_request.py b/samples/openapi3/client/petstore/python/test/test_models/test_json_patch_request.py deleted file mode 100644 index 87ab0b27615..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_json_patch_request.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.json_patch_request import JSONPatchRequest -from petstore_api import configuration - - -class TestJSONPatchRequest(unittest.TestCase): - """JSONPatchRequest unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_json_patch_request_add_replace_test.py b/samples/openapi3/client/petstore/python/test/test_models/test_json_patch_request_add_replace_test.py deleted file mode 100644 index bcabf025afe..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_json_patch_request_add_replace_test.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.json_patch_request_add_replace_test import JSONPatchRequestAddReplaceTest -from petstore_api import configuration - - -class TestJSONPatchRequestAddReplaceTest(unittest.TestCase): - """JSONPatchRequestAddReplaceTest unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_json_patch_request_move_copy.py b/samples/openapi3/client/petstore/python/test/test_models/test_json_patch_request_move_copy.py deleted file mode 100644 index 388b38f27a5..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_json_patch_request_move_copy.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.json_patch_request_move_copy import JSONPatchRequestMoveCopy -from petstore_api import configuration - - -class TestJSONPatchRequestMoveCopy(unittest.TestCase): - """JSONPatchRequestMoveCopy unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_json_patch_request_remove.py b/samples/openapi3/client/petstore/python/test/test_models/test_json_patch_request_remove.py deleted file mode 100644 index fe2001a85cb..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_json_patch_request_remove.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.json_patch_request_remove import JSONPatchRequestRemove -from petstore_api import configuration - - -class TestJSONPatchRequestRemove(unittest.TestCase): - """JSONPatchRequestRemove unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_mammal.py b/samples/openapi3/client/petstore/python/test/test_models/test_mammal.py deleted file mode 100644 index 402d785f461..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_mammal.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.mammal import Mammal -from petstore_api import configuration - - -class TestMammal(unittest.TestCase): - """Mammal unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_map_test.py b/samples/openapi3/client/petstore/python/test/test_models/test_map_test.py deleted file mode 100644 index c07747e22a0..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_map_test.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.map_test import MapTest -from petstore_api import configuration - - -class TestMapTest(unittest.TestCase): - """MapTest unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python/test/test_models/test_mixed_properties_and_additional_properties_class.py deleted file mode 100644 index aa8f05809ea..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_mixed_properties_and_additional_properties_class.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass -from petstore_api import configuration - - -class TestMixedPropertiesAndAdditionalPropertiesClass(unittest.TestCase): - """MixedPropertiesAndAdditionalPropertiesClass unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_model200_response.py b/samples/openapi3/client/petstore/python/test/test_models/test_model200_response.py deleted file mode 100644 index 175bce11574..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_model200_response.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.model200_response import Model200Response -from petstore_api import configuration - - -class TestModel200Response(unittest.TestCase): - """Model200Response unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_model_return.py b/samples/openapi3/client/petstore/python/test/test_models/test_model_return.py deleted file mode 100644 index 97cc726a7a4..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_model_return.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.model_return import ModelReturn -from petstore_api import configuration - - -class TestModelReturn(unittest.TestCase): - """ModelReturn unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_money.py b/samples/openapi3/client/petstore/python/test/test_models/test_money.py deleted file mode 100644 index 51977ceb525..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_money.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.money import Money -from petstore_api import configuration - - -class TestMoney(unittest.TestCase): - """Money unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_name.py b/samples/openapi3/client/petstore/python/test/test_models/test_name.py deleted file mode 100644 index 67aa3937383..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_name.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.name import Name -from petstore_api import configuration - - -class TestName(unittest.TestCase): - """Name unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_no_additional_properties.py b/samples/openapi3/client/petstore/python/test/test_models/test_no_additional_properties.py deleted file mode 100644 index 560d41b85b6..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_no_additional_properties.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.no_additional_properties import NoAdditionalProperties -from petstore_api import configuration - - -class TestNoAdditionalProperties(unittest.TestCase): - """NoAdditionalProperties unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_nullable_class.py b/samples/openapi3/client/petstore/python/test/test_models/test_nullable_class.py deleted file mode 100644 index 48e6a9dfca4..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_nullable_class.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.nullable_class import NullableClass -from petstore_api import configuration - - -class TestNullableClass(unittest.TestCase): - """NullableClass unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_nullable_shape.py b/samples/openapi3/client/petstore/python/test/test_models/test_nullable_shape.py deleted file mode 100644 index 5fbf48eb049..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_nullable_shape.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.nullable_shape import NullableShape -from petstore_api import configuration - - -class TestNullableShape(unittest.TestCase): - """NullableShape unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_nullable_string.py b/samples/openapi3/client/petstore/python/test/test_models/test_nullable_string.py deleted file mode 100644 index e25a516b7c3..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_nullable_string.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.nullable_string import NullableString -from petstore_api import configuration - - -class TestNullableString(unittest.TestCase): - """NullableString unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_number.py b/samples/openapi3/client/petstore/python/test/test_models/test_number.py deleted file mode 100644 index 3a82e0c8ac4..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_number.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.number import Number -from petstore_api import configuration - - -class TestNumber(unittest.TestCase): - """Number unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_number_only.py b/samples/openapi3/client/petstore/python/test/test_models/test_number_only.py deleted file mode 100644 index 58b824ecd87..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_number_only.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.number_only import NumberOnly -from petstore_api import configuration - - -class TestNumberOnly(unittest.TestCase): - """NumberOnly unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_number_with_validations.py b/samples/openapi3/client/petstore/python/test/test_models/test_number_with_validations.py deleted file mode 100644 index a4074910185..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_number_with_validations.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.number_with_validations import NumberWithValidations -from petstore_api import configuration - - -class TestNumberWithValidations(unittest.TestCase): - """NumberWithValidations unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_object_interface.py b/samples/openapi3/client/petstore/python/test/test_models/test_object_interface.py deleted file mode 100644 index 3745bece9d0..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_object_interface.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.object_interface import ObjectInterface -from petstore_api import configuration - - -class TestObjectInterface(unittest.TestCase): - """ObjectInterface unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_object_model_with_arg_and_args_properties.py b/samples/openapi3/client/petstore/python/test/test_models/test_object_model_with_arg_and_args_properties.py deleted file mode 100644 index 75de5dd9654..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_object_model_with_arg_and_args_properties.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.object_model_with_arg_and_args_properties import ObjectModelWithArgAndArgsProperties -from petstore_api import configuration - - -class TestObjectModelWithArgAndArgsProperties(unittest.TestCase): - """ObjectModelWithArgAndArgsProperties unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_object_model_with_ref_props.py b/samples/openapi3/client/petstore/python/test/test_models/test_object_model_with_ref_props.py deleted file mode 100644 index 76145b49d05..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_object_model_with_ref_props.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps -from petstore_api import configuration - - -class TestObjectModelWithRefProps(unittest.TestCase): - """ObjectModelWithRefProps unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_object_with_all_of_with_req_test_prop_from_unset_add_prop.py b/samples/openapi3/client/petstore/python/test/test_models/test_object_with_all_of_with_req_test_prop_from_unset_add_prop.py deleted file mode 100644 index 7f9078b4d72..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_object_with_all_of_with_req_test_prop_from_unset_add_prop.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.object_with_all_of_with_req_test_prop_from_unset_add_prop import ObjectWithAllOfWithReqTestPropFromUnsetAddProp -from petstore_api import configuration - - -class TestObjectWithAllOfWithReqTestPropFromUnsetAddProp(unittest.TestCase): - """ObjectWithAllOfWithReqTestPropFromUnsetAddProp unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_object_with_decimal_properties.py b/samples/openapi3/client/petstore/python/test/test_models/test_object_with_decimal_properties.py deleted file mode 100644 index 061eee9471d..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_object_with_decimal_properties.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.object_with_decimal_properties import ObjectWithDecimalProperties -from petstore_api import configuration - - -class TestObjectWithDecimalProperties(unittest.TestCase): - """ObjectWithDecimalProperties unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_object_with_difficultly_named_props.py b/samples/openapi3/client/petstore/python/test/test_models/test_object_with_difficultly_named_props.py deleted file mode 100644 index 531aa29e499..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_object_with_difficultly_named_props.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.object_with_difficultly_named_props import ObjectWithDifficultlyNamedProps -from petstore_api import configuration - - -class TestObjectWithDifficultlyNamedProps(unittest.TestCase): - """ObjectWithDifficultlyNamedProps unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_object_with_inline_composition_property.py b/samples/openapi3/client/petstore/python/test/test_models/test_object_with_inline_composition_property.py deleted file mode 100644 index 4d2ebb2ae4d..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_object_with_inline_composition_property.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.object_with_inline_composition_property import ObjectWithInlineCompositionProperty -from petstore_api import configuration - - -class TestObjectWithInlineCompositionProperty(unittest.TestCase): - """ObjectWithInlineCompositionProperty unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_object_with_invalid_named_refed_properties.py b/samples/openapi3/client/petstore/python/test/test_models/test_object_with_invalid_named_refed_properties.py deleted file mode 100644 index b4bae2d5e6b..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_object_with_invalid_named_refed_properties.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.object_with_invalid_named_refed_properties import ObjectWithInvalidNamedRefedProperties -from petstore_api import configuration - - -class TestObjectWithInvalidNamedRefedProperties(unittest.TestCase): - """ObjectWithInvalidNamedRefedProperties unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_object_with_optional_test_prop.py b/samples/openapi3/client/petstore/python/test/test_models/test_object_with_optional_test_prop.py deleted file mode 100644 index fbd21e71b9f..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_object_with_optional_test_prop.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.object_with_optional_test_prop import ObjectWithOptionalTestProp -from petstore_api import configuration - - -class TestObjectWithOptionalTestProp(unittest.TestCase): - """ObjectWithOptionalTestProp unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_object_with_validations.py b/samples/openapi3/client/petstore/python/test/test_models/test_object_with_validations.py deleted file mode 100644 index 61aa651da9a..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_object_with_validations.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.object_with_validations import ObjectWithValidations -from petstore_api import configuration - - -class TestObjectWithValidations(unittest.TestCase): - """ObjectWithValidations unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_order.py b/samples/openapi3/client/petstore/python/test/test_models/test_order.py deleted file mode 100644 index a46866bc958..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_order.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.order import Order -from petstore_api import configuration - - -class TestOrder(unittest.TestCase): - """Order unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_parent_pet.py b/samples/openapi3/client/petstore/python/test/test_models/test_parent_pet.py deleted file mode 100644 index 1a738ebadcb..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_parent_pet.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.parent_pet import ParentPet -from petstore_api import configuration - - -class TestParentPet(unittest.TestCase): - """ParentPet unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_pet.py b/samples/openapi3/client/petstore/python/test/test_models/test_pet.py deleted file mode 100644 index bfe07aec750..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_pet.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.pet import Pet -from petstore_api import configuration - - -class TestPet(unittest.TestCase): - """Pet unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_pig.py b/samples/openapi3/client/petstore/python/test/test_models/test_pig.py deleted file mode 100644 index 17e9f30ed28..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_pig.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.pig import Pig -from petstore_api import configuration - - -class TestPig(unittest.TestCase): - """Pig unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_player.py b/samples/openapi3/client/petstore/python/test/test_models/test_player.py deleted file mode 100644 index 3a8ce50907e..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_player.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.player import Player -from petstore_api import configuration - - -class TestPlayer(unittest.TestCase): - """Player unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_quadrilateral.py b/samples/openapi3/client/petstore/python/test/test_models/test_quadrilateral.py deleted file mode 100644 index 14db504bcf8..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_quadrilateral.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.quadrilateral import Quadrilateral -from petstore_api import configuration - - -class TestQuadrilateral(unittest.TestCase): - """Quadrilateral unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_quadrilateral_interface.py b/samples/openapi3/client/petstore/python/test/test_models/test_quadrilateral_interface.py deleted file mode 100644 index bd903fc4f3a..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_quadrilateral_interface.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.quadrilateral_interface import QuadrilateralInterface -from petstore_api import configuration - - -class TestQuadrilateralInterface(unittest.TestCase): - """QuadrilateralInterface unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_read_only_first.py b/samples/openapi3/client/petstore/python/test/test_models/test_read_only_first.py deleted file mode 100644 index 12a8689951e..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_read_only_first.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.read_only_first import ReadOnlyFirst -from petstore_api import configuration - - -class TestReadOnlyFirst(unittest.TestCase): - """ReadOnlyFirst unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_scalene_triangle.py b/samples/openapi3/client/petstore/python/test/test_models/test_scalene_triangle.py deleted file mode 100644 index 3d0ba995a6b..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_scalene_triangle.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.scalene_triangle import ScaleneTriangle -from petstore_api import configuration - - -class TestScaleneTriangle(unittest.TestCase): - """ScaleneTriangle unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_shape.py b/samples/openapi3/client/petstore/python/test/test_models/test_shape.py deleted file mode 100644 index 644bae29d8d..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_shape.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.shape import Shape -from petstore_api import configuration - - -class TestShape(unittest.TestCase): - """Shape unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_shape_or_null.py b/samples/openapi3/client/petstore/python/test/test_models/test_shape_or_null.py deleted file mode 100644 index 1c91dc2c7c6..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_shape_or_null.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.shape_or_null import ShapeOrNull -from petstore_api import configuration - - -class TestShapeOrNull(unittest.TestCase): - """ShapeOrNull unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_simple_quadrilateral.py b/samples/openapi3/client/petstore/python/test/test_models/test_simple_quadrilateral.py deleted file mode 100644 index d548e8549c6..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_simple_quadrilateral.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.simple_quadrilateral import SimpleQuadrilateral -from petstore_api import configuration - - -class TestSimpleQuadrilateral(unittest.TestCase): - """SimpleQuadrilateral unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_some_object.py b/samples/openapi3/client/petstore/python/test/test_models/test_some_object.py deleted file mode 100644 index 8e5c966c580..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_some_object.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.some_object import SomeObject -from petstore_api import configuration - - -class TestSomeObject(unittest.TestCase): - """SomeObject unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_special_model_name.py b/samples/openapi3/client/petstore/python/test/test_models/test_special_model_name.py deleted file mode 100644 index d6f945d0691..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_special_model_name.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.special_model_name import SpecialModelName -from petstore_api import configuration - - -class TestSpecialModelName(unittest.TestCase): - """SpecialModelName unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_string.py b/samples/openapi3/client/petstore/python/test/test_models/test_string.py deleted file mode 100644 index b868db50009..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_string.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.string import String -from petstore_api import configuration - - -class TestString(unittest.TestCase): - """String unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_string_boolean_map.py b/samples/openapi3/client/petstore/python/test/test_models/test_string_boolean_map.py deleted file mode 100644 index c24f051d9e5..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_string_boolean_map.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.string_boolean_map import StringBooleanMap -from petstore_api import configuration - - -class TestStringBooleanMap(unittest.TestCase): - """StringBooleanMap unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_string_enum.py b/samples/openapi3/client/petstore/python/test/test_models/test_string_enum.py deleted file mode 100644 index eb44771116d..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_string_enum.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.string_enum import StringEnum -from petstore_api import configuration - - -class TestStringEnum(unittest.TestCase): - """StringEnum unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_string_enum_with_default_value.py b/samples/openapi3/client/petstore/python/test/test_models/test_string_enum_with_default_value.py deleted file mode 100644 index c7d690c6ad5..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_string_enum_with_default_value.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.string_enum_with_default_value import StringEnumWithDefaultValue -from petstore_api import configuration - - -class TestStringEnumWithDefaultValue(unittest.TestCase): - """StringEnumWithDefaultValue unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_string_with_validation.py b/samples/openapi3/client/petstore/python/test/test_models/test_string_with_validation.py deleted file mode 100644 index 3f08996edfa..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_string_with_validation.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.string_with_validation import StringWithValidation -from petstore_api import configuration - - -class TestStringWithValidation(unittest.TestCase): - """StringWithValidation unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_tag.py b/samples/openapi3/client/petstore/python/test/test_models/test_tag.py deleted file mode 100644 index 037216a10fe..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_tag.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.tag import Tag -from petstore_api import configuration - - -class TestTag(unittest.TestCase): - """Tag unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_triangle.py b/samples/openapi3/client/petstore/python/test/test_models/test_triangle.py deleted file mode 100644 index 853f1e14168..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_triangle.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.triangle import Triangle -from petstore_api import configuration - - -class TestTriangle(unittest.TestCase): - """Triangle unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_triangle_interface.py b/samples/openapi3/client/petstore/python/test/test_models/test_triangle_interface.py deleted file mode 100644 index 75fddda7d96..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_triangle_interface.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.triangle_interface import TriangleInterface -from petstore_api import configuration - - -class TestTriangleInterface(unittest.TestCase): - """TriangleInterface unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_user.py b/samples/openapi3/client/petstore/python/test/test_models/test_user.py deleted file mode 100644 index fcc8d79b3e4..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_user.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.user import User -from petstore_api import configuration - - -class TestUser(unittest.TestCase): - """User unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_uuid_string.py b/samples/openapi3/client/petstore/python/test/test_models/test_uuid_string.py deleted file mode 100644 index 27a64c0c440..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_uuid_string.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.uuid_string import UUIDString -from petstore_api import configuration - - -class TestUUIDString(unittest.TestCase): - """UUIDString unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_whale.py b/samples/openapi3/client/petstore/python/test/test_models/test_whale.py deleted file mode 100644 index b3316eb84a1..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_whale.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.whale import Whale -from petstore_api import configuration - - -class TestWhale(unittest.TestCase): - """Whale unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_zebra.py b/samples/openapi3/client/petstore/python/test/test_models/test_zebra.py deleted file mode 100644 index a3ce520e9de..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_models/test_zebra.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import unittest - -import petstore_api -from petstore_api.model.zebra import Zebra -from petstore_api import configuration - - -class TestZebra(unittest.TestCase): - """Zebra unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/__init__.py index 1309632d3d5..bcc864a1738 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/__init__.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/__init__.py @@ -7,7 +7,7 @@ class ApiTestMixin: json_content_type = 'application/json' - user_agent = 'OpenAPI-Generator/1.0.0/python' + user_agent = 'OpenAPI-JSON-Schema-Generator/1.0.0/python' @classmethod def assert_pool_manager_request_called_with( diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_another_fake_dummy/test_patch.py b/samples/openapi3/client/petstore/python/test/test_paths/test_another_fake_dummy/test_patch.py index 827d02aaf11..295ced7c297 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_another_fake_dummy/test_patch.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_another_fake_dummy/test_patch.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,32 +12,25 @@ import urllib3 import petstore_api -from petstore_api.paths.another_fake_dummy import patch # noqa: E501 -from petstore_api import configuration, schemas, api_client +from petstore_api.paths.another_fake_dummy.patch import operation as patch # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestAnotherFakeDummy(ApiTestMixin, unittest.TestCase): +class TestPatch(ApiTestMixin, unittest.TestCase): """ - AnotherFakeDummy unit test stubs + Patch unit test stubs To test special tags # noqa: E501 """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = patch.ApiForpatch(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = patch.ApiForPatch(api_client=used_api_client) # noqa: E501 response_status = 200 - - - - - + response_body_schema = patch.response_200.ResponseFor200.content["application/json"].schema if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake/test_delete.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake/test_delete.py index c22a9853256..93463a6f1ba 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake/test_delete.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake/test_delete.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,29 +12,25 @@ import urllib3 import petstore_api -from petstore_api.paths.fake import delete # noqa: E501 -from petstore_api import configuration, schemas, api_client +from petstore_api.paths.fake.delete import operation as delete # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestFake(ApiTestMixin, unittest.TestCase): +class TestDelete(ApiTestMixin, unittest.TestCase): """ - Fake unit test stubs + Delete unit test stubs Fake endpoint to test group parameters (optional) # noqa: E501 """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = delete.ApiFordelete(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = delete.ApiForDelete(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake/test_get.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake/test_get.py index f5ec3b73469..5b6f55eed57 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake/test_get.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake/test_get.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,29 +12,25 @@ import urllib3 import petstore_api -from petstore_api.paths.fake import get # noqa: E501 -from petstore_api import configuration, schemas, api_client +from petstore_api.paths.fake.get import operation as get # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestFake(ApiTestMixin, unittest.TestCase): +class TestGet(ApiTestMixin, unittest.TestCase): """ - Fake unit test stubs + Get unit test stubs To test enum parameters # noqa: E501 """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = get.ApiForget(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = get.ApiForGet(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake/test_patch.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake/test_patch.py index e8d79727a09..bb72dc20659 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake/test_patch.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake/test_patch.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,32 +12,25 @@ import urllib3 import petstore_api -from petstore_api.paths.fake import patch # noqa: E501 -from petstore_api import configuration, schemas, api_client +from petstore_api.paths.fake.patch import operation as patch # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestFake(ApiTestMixin, unittest.TestCase): +class TestPatch(ApiTestMixin, unittest.TestCase): """ - Fake unit test stubs + Patch unit test stubs To test \"client\" model # noqa: E501 """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = patch.ApiForpatch(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = patch.ApiForPatch(api_client=used_api_client) # noqa: E501 response_status = 200 - - - - - + response_body_schema = patch.response_200.ResponseFor200.content["application/json"].schema if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake/test_post.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake/test_post.py index 714554981c6..ce587b120ba 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake/test_post.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,29 +12,25 @@ import urllib3 import petstore_api -from petstore_api.paths.fake import post # noqa: E501 -from petstore_api import configuration, schemas, api_client +from petstore_api.paths.fake.post import operation as post # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestFake(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - Fake unit test stubs + Post unit test stubs Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_additional_properties_with_array_of_enums/test_get.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_additional_properties_with_array_of_enums/test_get.py index 7a2c11bd646..15038a36a6f 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_additional_properties_with_array_of_enums/test_get.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_additional_properties_with_array_of_enums/test_get.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,30 +12,25 @@ import urllib3 import petstore_api -from petstore_api.paths.fake_additional_properties_with_array_of_enums import get # noqa: E501 -from petstore_api import configuration, schemas, api_client +from petstore_api.paths.fake_additional_properties_with_array_of_enums.get import operation as get # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestFakeAdditionalPropertiesWithArrayOfEnums(ApiTestMixin, unittest.TestCase): +class TestGet(ApiTestMixin, unittest.TestCase): """ - FakeAdditionalPropertiesWithArrayOfEnums unit test stubs + Get unit test stubs Additional Properties with Array of Enums # noqa: E501 """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = get.ApiForget(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = get.ApiForGet(api_client=used_api_client) # noqa: E501 response_status = 200 - - - + response_body_schema = get.response_200.ResponseFor200.content["application/json"].schema if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_body_with_file_schema/test_put.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_body_with_file_schema/test_put.py index 792ba93a1e8..d347f3e034a 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_body_with_file_schema/test_put.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_body_with_file_schema/test_put.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,30 +12,24 @@ import urllib3 import petstore_api -from petstore_api.paths.fake_body_with_file_schema import put # noqa: E501 -from petstore_api import configuration, schemas, api_client +from petstore_api.paths.fake_body_with_file_schema.put import operation as put # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestFakeBodyWithFileSchema(ApiTestMixin, unittest.TestCase): +class TestPut(ApiTestMixin, unittest.TestCase): """ - FakeBodyWithFileSchema unit test stubs + Put unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = put.ApiForput(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = put.ApiForPut(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_body_with_query_params/test_put.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_body_with_query_params/test_put.py index 24385ae529e..ce4a1ce56d3 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_body_with_query_params/test_put.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_body_with_query_params/test_put.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,30 +12,24 @@ import urllib3 import petstore_api -from petstore_api.paths.fake_body_with_query_params import put # noqa: E501 -from petstore_api import configuration, schemas, api_client +from petstore_api.paths.fake_body_with_query_params.put import operation as put # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestFakeBodyWithQueryParams(ApiTestMixin, unittest.TestCase): +class TestPut(ApiTestMixin, unittest.TestCase): """ - FakeBodyWithQueryParams unit test stubs + Put unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = put.ApiForput(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = put.ApiForPut(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_case_sensitive_params/test_put.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_case_sensitive_params/test_put.py index 1f1cb364763..6b49adbffd5 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_case_sensitive_params/test_put.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_case_sensitive_params/test_put.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,28 +12,24 @@ import urllib3 import petstore_api -from petstore_api.paths.fake_case_sensitive_params import put # noqa: E501 -from petstore_api import configuration, schemas, api_client +from petstore_api.paths.fake_case_sensitive_params.put import operation as put # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestFakeCaseSensitiveParams(ApiTestMixin, unittest.TestCase): +class TestPut(ApiTestMixin, unittest.TestCase): """ - FakeCaseSensitiveParams unit test stubs + Put unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = put.ApiForput(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = put.ApiForPut(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_classname_test/test_patch.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_classname_test/test_patch.py index 51c483bdc08..d7a9c847f59 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_classname_test/test_patch.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_classname_test/test_patch.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,32 +12,25 @@ import urllib3 import petstore_api -from petstore_api.paths.fake_classname_test import patch # noqa: E501 -from petstore_api import configuration, schemas, api_client +from petstore_api.paths.fake_classname_test.patch import operation as patch # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestFakeClassnameTest(ApiTestMixin, unittest.TestCase): +class TestPatch(ApiTestMixin, unittest.TestCase): """ - FakeClassnameTest unit test stubs + Patch unit test stubs To test class name in snake case # noqa: E501 """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = patch.ApiForpatch(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = patch.ApiForPatch(api_client=used_api_client) # noqa: E501 response_status = 200 - - - - - + response_body_schema = patch.response_200.ResponseFor200.content["application/json"].schema if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_delete_coffee_id/test_delete.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_delete_coffee_id/test_delete.py index a002c547aa5..bff254ebddd 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_delete_coffee_id/test_delete.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_delete_coffee_id/test_delete.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,29 +12,25 @@ import urllib3 import petstore_api -from petstore_api.paths.fake_delete_coffee_id import delete # noqa: E501 -from petstore_api import configuration, schemas, api_client +from petstore_api.paths.fake_delete_coffee_id.delete import operation as delete # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestFakeDeleteCoffeeId(ApiTestMixin, unittest.TestCase): +class TestDelete(ApiTestMixin, unittest.TestCase): """ - FakeDeleteCoffeeId unit test stubs + Delete unit test stubs Delete coffee # noqa: E501 """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = delete.ApiFordelete(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = delete.ApiForDelete(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_health/test_get.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_health/test_get.py index dd6f2a54850..ddad856cd1f 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_health/test_get.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_health/test_get.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,30 +12,25 @@ import urllib3 import petstore_api -from petstore_api.paths.fake_health import get # noqa: E501 -from petstore_api import configuration, schemas, api_client +from petstore_api.paths.fake_health.get import operation as get # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestFakeHealth(ApiTestMixin, unittest.TestCase): +class TestGet(ApiTestMixin, unittest.TestCase): """ - FakeHealth unit test stubs + Get unit test stubs Health check endpoint # noqa: E501 """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = get.ApiForget(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = get.ApiForGet(api_client=used_api_client) # noqa: E501 response_status = 200 - - - + response_body_schema = get.response_200.ResponseFor200.content["application/json"].schema if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_inline_additional_properties/test_post.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_inline_additional_properties/test_post.py index a1b5801b829..1d54a6c4ff2 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_inline_additional_properties/test_post.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_inline_additional_properties/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,25 @@ import urllib3 import petstore_api -from petstore_api.paths.fake_inline_additional_properties import post # noqa: E501 -from petstore_api import configuration, schemas, api_client +from petstore_api.paths.fake_inline_additional_properties.post import operation as post # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestFakeInlineAdditionalProperties(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - FakeInlineAdditionalProperties unit test stubs + Post unit test stubs test inline additionalProperties # noqa: E501 """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_inline_composition/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_inline_composition/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_inline_composition/test_post.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_inline_composition/test_post.py new file mode 100644 index 00000000000..34ed20ab22f --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_inline_composition/test_post.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest +from unittest.mock import patch + +import urllib3 + +import petstore_api +from petstore_api.paths.fake_inline_composition.post import operation as post # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration + +from .. import ApiTestMixin + + +class TestPost(ApiTestMixin, unittest.TestCase): + """ + Post unit test stubs + testing composed schemas at inline locations # noqa: E501 + """ + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 + + response_status = 200 + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + response_body_schema = post.response_200.ResponseFor200.content["multipart/form-data"].schema + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_inline_composition_/test_post.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_inline_composition_/test_post.py deleted file mode 100644 index fe16f7a4581..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_inline_composition_/test_post.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import petstore_api -from petstore_api.paths.fake_inline_composition_ import post # noqa: E501 -from petstore_api import configuration, schemas, api_client - -from .. import ApiTestMixin - - -class TestFakeInlineComposition(ApiTestMixin, unittest.TestCase): - """ - FakeInlineComposition unit test stubs - testing composed schemas at inline locations # noqa: E501 - """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass - - response_status = 200 - - - - - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_json_form_data/test_get.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_json_form_data/test_get.py index 2c10640ca3f..77572401d63 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_json_form_data/test_get.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_json_form_data/test_get.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,29 +12,25 @@ import urllib3 import petstore_api -from petstore_api.paths.fake_json_form_data import get # noqa: E501 -from petstore_api import configuration, schemas, api_client +from petstore_api.paths.fake_json_form_data.get import operation as get # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestFakeJsonFormData(ApiTestMixin, unittest.TestCase): +class TestGet(ApiTestMixin, unittest.TestCase): """ - FakeJsonFormData unit test stubs + Get unit test stubs test json serialization of form data # noqa: E501 """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = get.ApiForget(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = get.ApiForGet(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_json_patch/test_patch.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_json_patch/test_patch.py index add02d961a0..c85ae28eaba 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_json_patch/test_patch.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_json_patch/test_patch.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,29 +12,25 @@ import urllib3 import petstore_api -from petstore_api.paths.fake_json_patch import patch # noqa: E501 -from petstore_api import configuration, schemas, api_client +from petstore_api.paths.fake_json_patch.patch import operation as patch # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestFakeJsonPatch(ApiTestMixin, unittest.TestCase): +class TestPatch(ApiTestMixin, unittest.TestCase): """ - FakeJsonPatch unit test stubs + Patch unit test stubs json patch # noqa: E501 """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = patch.ApiForpatch(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = patch.ApiForPatch(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_json_with_charset/test_post.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_json_with_charset/test_post.py index 26105cad9f0..b73bc057686 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_json_with_charset/test_post.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_json_with_charset/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,30 +12,25 @@ import urllib3 import petstore_api -from petstore_api.paths.fake_json_with_charset import post # noqa: E501 -from petstore_api import configuration, schemas, api_client +from petstore_api.paths.fake_json_with_charset.post import operation as post # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestFakeJsonWithCharset(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - FakeJsonWithCharset unit test stubs + Post unit test stubs json with charset tx and rx # noqa: E501 """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - - - + response_body_schema = post.response_200.ResponseFor200.content["application/json; charset=utf-8"].schema if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_multiple_response_bodies/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_multiple_response_bodies/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_multiple_response_bodies/test_get.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_multiple_response_bodies/test_get.py new file mode 100644 index 00000000000..49f35805fef --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_multiple_response_bodies/test_get.py @@ -0,0 +1,36 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest +from unittest.mock import patch + +import urllib3 + +import petstore_api +from petstore_api.paths.fake_multiple_response_bodies.get import operation as get # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration + +from .. import ApiTestMixin + + +class TestGet(ApiTestMixin, unittest.TestCase): + """ + Get unit test stubs + multiple responses have response bodies # noqa: E501 + """ + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = get.ApiForGet(api_client=used_api_client) # noqa: E501 + + response_status = 200 + response_body_schema = get.response_200.ResponseFor200.content["application/json"].schema + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_multiple_securities/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_multiple_securities/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_multiple_securities/test_get.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_multiple_securities/test_get.py new file mode 100644 index 00000000000..10f2dc70147 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_multiple_securities/test_get.py @@ -0,0 +1,36 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest +from unittest.mock import patch + +import urllib3 + +import petstore_api +from petstore_api.paths.fake_multiple_securities.get import operation as get # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration + +from .. import ApiTestMixin + + +class TestGet(ApiTestMixin, unittest.TestCase): + """ + Get unit test stubs + multiple security requirements # noqa: E501 + """ + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = get.ApiForGet(api_client=used_api_client) # noqa: E501 + + response_status = 200 + response_body_schema = get.response_200.ResponseFor200.content["application/json"].schema + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_obj_in_query/test_get.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_obj_in_query/test_get.py index fc11f501a40..2d057036cfd 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_obj_in_query/test_get.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_obj_in_query/test_get.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,29 +12,25 @@ import urllib3 import petstore_api -from petstore_api.paths.fake_obj_in_query import get # noqa: E501 -from petstore_api import configuration, schemas, api_client +from petstore_api.paths.fake_obj_in_query.get import operation as get # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestFakeObjInQuery(ApiTestMixin, unittest.TestCase): +class TestGet(ApiTestMixin, unittest.TestCase): """ - FakeObjInQuery unit test stubs + Get unit test stubs user list # noqa: E501 """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = get.ApiForget(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = get.ApiForGet(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_parameter_collisions1_abab_self_ab/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_parameter_collisions1_abab_self_ab/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_parameter_collisions1_abab_self_ab/test_post.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_parameter_collisions1_abab_self_ab/test_post.py new file mode 100644 index 00000000000..6f656ac6a3d --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_parameter_collisions1_abab_self_ab/test_post.py @@ -0,0 +1,36 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest +from unittest.mock import patch + +import urllib3 + +import petstore_api +from petstore_api.paths.fake_parameter_collisions1_abab_self_ab.post import operation as post # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration + +from .. import ApiTestMixin + + +class TestPost(ApiTestMixin, unittest.TestCase): + """ + Post unit test stubs + parameter collision case # noqa: E501 + """ + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 + + response_status = 200 + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_parameter_collisions_1_a_b_ab_self_a_b_/test_post.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_parameter_collisions_1_a_b_ab_self_a_b_/test_post.py deleted file mode 100644 index 8bf351c3dc3..00000000000 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_parameter_collisions_1_a_b_ab_self_a_b_/test_post.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import petstore_api -from petstore_api.paths.fake_parameter_collisions_1_a_b_ab_self_a_b_ import post # noqa: E501 -from petstore_api import configuration, schemas, api_client - -from .. import ApiTestMixin - - -class TestFakeParameterCollisions1ABAbSelfAB(ApiTestMixin, unittest.TestCase): - """ - FakeParameterCollisions1ABAbSelfAB unit test stubs - parameter collision case # noqa: E501 - """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass - - response_status = 200 - - - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_pet_id_upload_image_with_required_file/test_post.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_pet_id_upload_image_with_required_file/test_post.py index 23bc55d273b..2bc6225690b 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_pet_id_upload_image_with_required_file/test_post.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_pet_id_upload_image_with_required_file/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,30 +12,25 @@ import urllib3 import petstore_api -from petstore_api.paths.fake_pet_id_upload_image_with_required_file import post # noqa: E501 -from petstore_api import configuration, schemas, api_client +from petstore_api.paths.fake_pet_id_upload_image_with_required_file.post import operation as post # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestFakePetIdUploadImageWithRequiredFile(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - FakePetIdUploadImageWithRequiredFile unit test stubs + Post unit test stubs uploads an image (required) # noqa: E501 """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - - - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_query_param_with_json_content_type/test_get.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_query_param_with_json_content_type/test_get.py index fe890aad78d..1c392f19d65 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_query_param_with_json_content_type/test_get.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_query_param_with_json_content_type/test_get.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,30 +12,25 @@ import urllib3 import petstore_api -from petstore_api.paths.fake_query_param_with_json_content_type import get # noqa: E501 -from petstore_api import configuration, schemas, api_client +from petstore_api.paths.fake_query_param_with_json_content_type.get import operation as get # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestFakeQueryParamWithJsonContentType(ApiTestMixin, unittest.TestCase): +class TestGet(ApiTestMixin, unittest.TestCase): """ - FakeQueryParamWithJsonContentType unit test stubs + Get unit test stubs query param with json content-type # noqa: E501 """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = get.ApiForget(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = get.ApiForGet(api_client=used_api_client) # noqa: E501 response_status = 200 - - - + response_body_schema = get.response_200.ResponseFor200.content["application/json"].schema if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_redirection/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_redirection/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_redirection/test_get.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_redirection/test_get.py new file mode 100644 index 00000000000..c069a4dc189 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_redirection/test_get.py @@ -0,0 +1,36 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest +from unittest.mock import patch + +import urllib3 + +import petstore_api +from petstore_api.paths.fake_redirection.get import operation as get # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration + +from .. import ApiTestMixin + + +class TestGet(ApiTestMixin, unittest.TestCase): + """ + Get unit test stubs + operation with redirection responses # noqa: E501 + """ + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = get.ApiForGet(api_client=used_api_client) # noqa: E501 + + response_status = 303 + response_body = '' + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_ref_obj_in_query/test_get.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_ref_obj_in_query/test_get.py index 61edf55e3d7..589474c5072 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_ref_obj_in_query/test_get.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_ref_obj_in_query/test_get.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,29 +12,25 @@ import urllib3 import petstore_api -from petstore_api.paths.fake_ref_obj_in_query import get # noqa: E501 -from petstore_api import configuration, schemas, api_client +from petstore_api.paths.fake_ref_obj_in_query.get import operation as get # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestFakeRefObjInQuery(ApiTestMixin, unittest.TestCase): +class TestGet(ApiTestMixin, unittest.TestCase): """ - FakeRefObjInQuery unit test stubs + Get unit test stubs user list # noqa: E501 """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = get.ApiForget(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = get.ApiForGet(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_array_of_enums/test_post.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_array_of_enums/test_post.py index 28aedd8c2c0..e47b4b131f2 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_array_of_enums/test_post.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_array_of_enums/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,30 +12,25 @@ import urllib3 import petstore_api -from petstore_api.paths.fake_refs_array_of_enums import post # noqa: E501 -from petstore_api import configuration, schemas, api_client +from petstore_api.paths.fake_refs_array_of_enums.post import operation as post # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestFakeRefsArrayOfEnums(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - FakeRefsArrayOfEnums unit test stubs + Post unit test stubs Array of Enums # noqa: E501 """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - - - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_arraymodel/test_post.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_arraymodel/test_post.py index a252701f4ee..95361d1239f 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_arraymodel/test_post.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_arraymodel/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,29 +12,24 @@ import urllib3 import petstore_api -from petstore_api.paths.fake_refs_arraymodel import post # noqa: E501 -from petstore_api import configuration, schemas, api_client +from petstore_api.paths.fake_refs_arraymodel.post import operation as post # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestFakeRefsArraymodel(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - FakeRefsArraymodel unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - - - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_boolean/test_post.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_boolean/test_post.py index 3ac8fd5b4ae..75d542bd834 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_boolean/test_post.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_boolean/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,29 +12,24 @@ import urllib3 import petstore_api -from petstore_api.paths.fake_refs_boolean import post # noqa: E501 -from petstore_api import configuration, schemas, api_client +from petstore_api.paths.fake_refs_boolean.post import operation as post # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestFakeRefsBoolean(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - FakeRefsBoolean unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - - - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_composed_one_of_number_with_validations/test_post.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_composed_one_of_number_with_validations/test_post.py index d5963d8503a..77e8c909de1 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_composed_one_of_number_with_validations/test_post.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_composed_one_of_number_with_validations/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,29 +12,24 @@ import urllib3 import petstore_api -from petstore_api.paths.fake_refs_composed_one_of_number_with_validations import post # noqa: E501 -from petstore_api import configuration, schemas, api_client +from petstore_api.paths.fake_refs_composed_one_of_number_with_validations.post import operation as post # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestFakeRefsComposedOneOfNumberWithValidations(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - FakeRefsComposedOneOfNumberWithValidations unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - - - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_enum/test_post.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_enum/test_post.py index fde250a49eb..5c248907fb9 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_enum/test_post.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_enum/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,29 +12,24 @@ import urllib3 import petstore_api -from petstore_api.paths.fake_refs_enum import post # noqa: E501 -from petstore_api import configuration, schemas, api_client +from petstore_api.paths.fake_refs_enum.post import operation as post # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestFakeRefsEnum(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - FakeRefsEnum unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - - - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_mammal/test_post.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_mammal/test_post.py index a692191f471..5e5f22ebde5 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_mammal/test_post.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_mammal/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,24 @@ import urllib3 import petstore_api -from petstore_api.paths.fake_refs_mammal import post # noqa: E501 -from petstore_api import configuration, schemas, api_client +from petstore_api.paths.fake_refs_mammal.post import operation as post # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestFakeRefsMammal(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - FakeRefsMammal unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - - - - - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_number/test_post.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_number/test_post.py index b398b419ba9..3c42de171a7 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_number/test_post.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_number/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,29 +12,24 @@ import urllib3 import petstore_api -from petstore_api.paths.fake_refs_number import post # noqa: E501 -from petstore_api import configuration, schemas, api_client +from petstore_api.paths.fake_refs_number.post import operation as post # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestFakeRefsNumber(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - FakeRefsNumber unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - - - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_object_model_with_ref_props/test_post.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_object_model_with_ref_props/test_post.py index f6c51016d9e..0000cc2b2f2 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_object_model_with_ref_props/test_post.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_object_model_with_ref_props/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,29 +12,24 @@ import urllib3 import petstore_api -from petstore_api.paths.fake_refs_object_model_with_ref_props import post # noqa: E501 -from petstore_api import configuration, schemas, api_client +from petstore_api.paths.fake_refs_object_model_with_ref_props.post import operation as post # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestFakeRefsObjectModelWithRefProps(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - FakeRefsObjectModelWithRefProps unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - - - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_string/test_post.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_string/test_post.py index b7eaa838420..5b2f2d5891f 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_string/test_post.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_string/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,29 +12,24 @@ import urllib3 import petstore_api -from petstore_api.paths.fake_refs_string import post # noqa: E501 -from petstore_api import configuration, schemas, api_client +from petstore_api.paths.fake_refs_string.post import operation as post # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestFakeRefsString(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - FakeRefsString unit test stubs + Post unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - - - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_response_without_schema/test_get.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_response_without_schema/test_get.py index bcab7c96465..1e01e22d09f 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_response_without_schema/test_get.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_response_without_schema/test_get.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,32 +12,24 @@ import urllib3 import petstore_api -from petstore_api.paths.fake_response_without_schema import get # noqa: E501 -from petstore_api import configuration, schemas, api_client +from petstore_api.paths.fake_response_without_schema.get import operation as get # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestFakeResponseWithoutSchema(ApiTestMixin, unittest.TestCase): +class TestGet(ApiTestMixin, unittest.TestCase): """ - FakeResponseWithoutSchema unit test stubs + Get unit test stubs receives a response without schema # noqa: E501 """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = get.ApiForget(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = get.ApiForGet(api_client=used_api_client) # noqa: E501 response_status = 200 - - - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_test_query_paramters/test_put.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_test_query_paramters/test_put.py index e358588324b..e98b08688b3 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_test_query_paramters/test_put.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_test_query_paramters/test_put.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,28 +12,24 @@ import urllib3 import petstore_api -from petstore_api.paths.fake_test_query_paramters import put # noqa: E501 -from petstore_api import configuration, schemas, api_client +from petstore_api.paths.fake_test_query_paramters.put import operation as put # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestFakeTestQueryParamters(ApiTestMixin, unittest.TestCase): +class TestPut(ApiTestMixin, unittest.TestCase): """ - FakeTestQueryParamters unit test stubs + Put unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = put.ApiForput(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = put.ApiForPut(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_upload_download_file/test_post.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_upload_download_file/test_post.py index 5c044094664..898198c6dc8 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_upload_download_file/test_post.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_upload_download_file/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,32 +12,25 @@ import urllib3 import petstore_api -from petstore_api.paths.fake_upload_download_file import post # noqa: E501 -from petstore_api import configuration, schemas, api_client +from petstore_api.paths.fake_upload_download_file.post import operation as post # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestFakeUploadDownloadFile(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - FakeUploadDownloadFile unit test stubs + Post unit test stubs uploads a file and downloads a file using application/octet-stream # noqa: E501 """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - - - - - + response_body_schema = post.response_200.ResponseFor200.content["application/octet-stream"].schema if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_upload_file/test_post.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_upload_file/test_post.py index d877e592ac0..8f5523053e6 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_upload_file/test_post.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_upload_file/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,30 +12,25 @@ import urllib3 import petstore_api -from petstore_api.paths.fake_upload_file import post # noqa: E501 -from petstore_api import configuration, schemas, api_client +from petstore_api.paths.fake_upload_file.post import operation as post # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestFakeUploadFile(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - FakeUploadFile unit test stubs + Post unit test stubs uploads a file using multipart/form-data # noqa: E501 """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - - - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_upload_files/test_post.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_upload_files/test_post.py index b0123d36aea..938d8cdbb5e 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_upload_files/test_post.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_upload_files/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,30 +12,25 @@ import urllib3 import petstore_api -from petstore_api.paths.fake_upload_files import post # noqa: E501 -from petstore_api import configuration, schemas, api_client +from petstore_api.paths.fake_upload_files.post import operation as post # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestFakeUploadFiles(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - FakeUploadFiles unit test stubs + Post unit test stubs uploads files using multipart/form-data # noqa: E501 """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - - - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_wild_card_responses/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_wild_card_responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_wild_card_responses/test_get.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_wild_card_responses/test_get.py new file mode 100644 index 00000000000..821a4484bc4 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_wild_card_responses/test_get.py @@ -0,0 +1,36 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest +from unittest.mock import patch + +import urllib3 + +import petstore_api +from petstore_api.paths.fake_wild_card_responses.get import operation as get # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration + +from .. import ApiTestMixin + + +class TestGet(ApiTestMixin, unittest.TestCase): + """ + Get unit test stubs + operation with wildcard responses # noqa: E501 + """ + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = get.ApiForGet(api_client=used_api_client) # noqa: E501 + + response_status = 200 + response_body_schema = get.response_200.ResponseFor200.content["application/json"].schema + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_foo/test_get.py b/samples/openapi3/client/petstore/python/test/test_paths/test_foo/test_get.py index 809b636d6c3..f3259ec55f9 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_foo/test_get.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_foo/test_get.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,29 +12,24 @@ import urllib3 import petstore_api -from petstore_api.paths.foo import get # noqa: E501 -from petstore_api import configuration, schemas, api_client +from petstore_api.paths.foo.get import operation as get # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestFoo(ApiTestMixin, unittest.TestCase): +class TestGet(ApiTestMixin, unittest.TestCase): """ - Foo unit test stubs + Get unit test stubs """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = get.ApiForget(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass - - response_status = 0 - - + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = get.ApiForGet(api_client=used_api_client) # noqa: E501 + response_status = 200 + response_body_schema = get.response_default.Default.content["application/json"].schema if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_pet/test_post.py b/samples/openapi3/client/petstore/python/test/test_paths/test_pet/test_post.py index 5016a08a9c3..ee79f6dc32d 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_pet/test_post.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_pet/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,33 +12,25 @@ import urllib3 import petstore_api -from petstore_api.paths.pet import post # noqa: E501 -from petstore_api import configuration, schemas, api_client +from petstore_api.paths.pet.post import operation as post # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestPet(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - Pet unit test stubs + Post unit test stubs Add a new pet to the store # noqa: E501 """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' - - - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_pet/test_put.py b/samples/openapi3/client/petstore/python/test/test_paths/test_pet/test_put.py index 903536c66d0..da310fd6921 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_pet/test_put.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_pet/test_put.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,33 +12,25 @@ import urllib3 import petstore_api -from petstore_api.paths.pet import put # noqa: E501 -from petstore_api import configuration, schemas, api_client +from petstore_api.paths.pet.put import operation as put # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestPet(ApiTestMixin, unittest.TestCase): +class TestPut(ApiTestMixin, unittest.TestCase): """ - Pet unit test stubs + Put unit test stubs Update an existing pet # noqa: E501 """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = put.ApiForput(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = put.ApiForPut(api_client=used_api_client) # noqa: E501 response_status = 400 response_body = '' - - - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_pet_find_by_status/test_get.py b/samples/openapi3/client/petstore/python/test/test_paths/test_pet_find_by_status/test_get.py index 2251f64e1b5..66c1de935af 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_pet_find_by_status/test_get.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_pet_find_by_status/test_get.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,32 +12,26 @@ import urllib3 import petstore_api -from petstore_api.paths.pet_find_by_status import get # noqa: E501 -from petstore_api import configuration, schemas, api_client +from petstore_api.paths.pet_find_by_status.get import operation as get # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestPetFindByStatus(ApiTestMixin, unittest.TestCase): +class TestGet(ApiTestMixin, unittest.TestCase): """ - PetFindByStatus unit test stubs + Get unit test stubs Finds Pets by status # noqa: E501 """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = get.ApiForget(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = get.ApiForGet(api_client=used_api_client) # noqa: E501 response_status = 200 - - - - - + response_body_schema = get.response_200.ResponseFor200.content["application/xml"].schema + response_body_schema = get.response_200.ResponseFor200.content["application/json"].schema if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_pet_find_by_tags/test_get.py b/samples/openapi3/client/petstore/python/test/test_paths/test_pet_find_by_tags/test_get.py index 48671bad4f4..c1972cf536b 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_pet_find_by_tags/test_get.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_pet_find_by_tags/test_get.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,32 +12,26 @@ import urllib3 import petstore_api -from petstore_api.paths.pet_find_by_tags import get # noqa: E501 -from petstore_api import configuration, schemas, api_client +from petstore_api.paths.pet_find_by_tags.get import operation as get # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestPetFindByTags(ApiTestMixin, unittest.TestCase): +class TestGet(ApiTestMixin, unittest.TestCase): """ - PetFindByTags unit test stubs + Get unit test stubs Finds Pets by tags # noqa: E501 """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = get.ApiForget(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = get.ApiForGet(api_client=used_api_client) # noqa: E501 response_status = 200 - - - - - + response_body_schema = get.response_200.ResponseFor200.content["application/xml"].schema + response_body_schema = get.response_200.ResponseFor200.content["application/json"].schema if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_pet_pet_id/test_delete.py b/samples/openapi3/client/petstore/python/test/test_paths/test_pet_pet_id/test_delete.py index 04b03559110..432061707ab 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_pet_pet_id/test_delete.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_pet_pet_id/test_delete.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,29 +12,25 @@ import urllib3 import petstore_api -from petstore_api.paths.pet_pet_id import delete # noqa: E501 -from petstore_api import configuration, schemas, api_client +from petstore_api.paths.pet_pet_id.delete import operation as delete # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestPetPetId(ApiTestMixin, unittest.TestCase): +class TestDelete(ApiTestMixin, unittest.TestCase): """ - PetPetId unit test stubs + Delete unit test stubs Deletes a pet # noqa: E501 """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = delete.ApiFordelete(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = delete.ApiForDelete(api_client=used_api_client) # noqa: E501 response_status = 400 response_body = '' - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_pet_pet_id/test_get.py b/samples/openapi3/client/petstore/python/test/test_paths/test_pet_pet_id/test_get.py index 78e02c339c2..a63c84e4bda 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_pet_pet_id/test_get.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_pet_pet_id/test_get.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,32 +12,26 @@ import urllib3 import petstore_api -from petstore_api.paths.pet_pet_id import get # noqa: E501 -from petstore_api import configuration, schemas, api_client +from petstore_api.paths.pet_pet_id.get import operation as get # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestPetPetId(ApiTestMixin, unittest.TestCase): +class TestGet(ApiTestMixin, unittest.TestCase): """ - PetPetId unit test stubs + Get unit test stubs Find pet by ID # noqa: E501 """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = get.ApiForget(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = get.ApiForGet(api_client=used_api_client) # noqa: E501 response_status = 200 - - - - - + response_body_schema = get.response_200.ResponseFor200.content["application/xml"].schema + response_body_schema = get.response_200.ResponseFor200.content["application/json"].schema if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_pet_pet_id/test_post.py b/samples/openapi3/client/petstore/python/test/test_paths/test_pet_pet_id/test_post.py index 6c6c9e60ad3..f62d5e09d5f 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_pet_pet_id/test_post.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_pet_pet_id/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,29 +12,25 @@ import urllib3 import petstore_api -from petstore_api.paths.pet_pet_id import post # noqa: E501 -from petstore_api import configuration, schemas, api_client +from petstore_api.paths.pet_pet_id.post import operation as post # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestPetPetId(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - PetPetId unit test stubs + Post unit test stubs Updates a pet in the store with form data # noqa: E501 """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 405 response_body = '' - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_pet_pet_id_upload_image/test_post.py b/samples/openapi3/client/petstore/python/test/test_paths/test_pet_pet_id_upload_image/test_post.py index b25f4ef89b2..ff5d246e62e 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_pet_pet_id_upload_image/test_post.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_pet_pet_id_upload_image/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,30 +12,25 @@ import urllib3 import petstore_api -from petstore_api.paths.pet_pet_id_upload_image import post # noqa: E501 -from petstore_api import configuration, schemas, api_client +from petstore_api.paths.pet_pet_id_upload_image.post import operation as post # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestPetPetIdUploadImage(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - PetPetIdUploadImage unit test stubs + Post unit test stubs uploads an image # noqa: E501 """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - - - + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_store_inventory/test_get.py b/samples/openapi3/client/petstore/python/test/test_paths/test_store_inventory/test_get.py index e1363824ef8..fd29357b0c6 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_store_inventory/test_get.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_store_inventory/test_get.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,30 +12,25 @@ import urllib3 import petstore_api -from petstore_api.paths.store_inventory import get # noqa: E501 -from petstore_api import configuration, schemas, api_client +from petstore_api.paths.store_inventory.get import operation as get # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestStoreInventory(ApiTestMixin, unittest.TestCase): +class TestGet(ApiTestMixin, unittest.TestCase): """ - StoreInventory unit test stubs + Get unit test stubs Returns pet inventories by status # noqa: E501 """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = get.ApiForget(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = get.ApiForGet(api_client=used_api_client) # noqa: E501 response_status = 200 - - - + response_body_schema = get.response_200.ResponseFor200.content["application/json"].schema if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_store_order/test_post.py b/samples/openapi3/client/petstore/python/test/test_paths/test_store_order/test_post.py index 69adb4340e5..1a80c00d068 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_store_order/test_post.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_store_order/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,34 +12,26 @@ import urllib3 import petstore_api -from petstore_api.paths.store_order import post # noqa: E501 -from petstore_api import configuration, schemas, api_client +from petstore_api.paths.store_order.post import operation as post # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestStoreOrder(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - StoreOrder unit test stubs + Post unit test stubs Place an order for a pet # noqa: E501 """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 response_status = 200 - - - - - - - + response_body_schema = post.response_200.ResponseFor200.content["application/xml"].schema + response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_store_order_order_id/test_delete.py b/samples/openapi3/client/petstore/python/test/test_paths/test_store_order_order_id/test_delete.py index 3b229d2b1b5..a8d99be24aa 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_store_order_order_id/test_delete.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_store_order_order_id/test_delete.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,29 +12,25 @@ import urllib3 import petstore_api -from petstore_api.paths.store_order_order_id import delete # noqa: E501 -from petstore_api import configuration, schemas, api_client +from petstore_api.paths.store_order_order_id.delete import operation as delete # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestStoreOrderOrderId(ApiTestMixin, unittest.TestCase): +class TestDelete(ApiTestMixin, unittest.TestCase): """ - StoreOrderOrderId unit test stubs + Delete unit test stubs Delete purchase order by ID # noqa: E501 """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = delete.ApiFordelete(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = delete.ApiForDelete(api_client=used_api_client) # noqa: E501 response_status = 400 response_body = '' - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_store_order_order_id/test_get.py b/samples/openapi3/client/petstore/python/test/test_paths/test_store_order_order_id/test_get.py index 55a5443d970..fe44b1c6a1d 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_store_order_order_id/test_get.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_store_order_order_id/test_get.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,32 +12,26 @@ import urllib3 import petstore_api -from petstore_api.paths.store_order_order_id import get # noqa: E501 -from petstore_api import configuration, schemas, api_client +from petstore_api.paths.store_order_order_id.get import operation as get # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestStoreOrderOrderId(ApiTestMixin, unittest.TestCase): +class TestGet(ApiTestMixin, unittest.TestCase): """ - StoreOrderOrderId unit test stubs + Get unit test stubs Find purchase order by ID # noqa: E501 """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = get.ApiForget(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = get.ApiForGet(api_client=used_api_client) # noqa: E501 response_status = 200 - - - - - + response_body_schema = get.response_200.ResponseFor200.content["application/xml"].schema + response_body_schema = get.response_200.ResponseFor200.content["application/json"].schema if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_user/test_post.py b/samples/openapi3/client/petstore/python/test/test_paths/test_user/test_post.py index 0b494f2ba22..05055f8e101 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_user/test_post.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_user/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,25 @@ import urllib3 import petstore_api -from petstore_api.paths.user import post # noqa: E501 -from petstore_api import configuration, schemas, api_client +from petstore_api.paths.user.post import operation as post # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestUser(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - User unit test stubs + Post unit test stubs Create user # noqa: E501 """ - _configuration = configuration.Configuration() + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass - - response_status = 0 + response_status = 200 response_body = '' - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_user_create_with_array/test_post.py b/samples/openapi3/client/petstore/python/test/test_paths/test_user_create_with_array/test_post.py index a6ed9b4d735..5149c430f59 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_user_create_with_array/test_post.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_user_create_with_array/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,25 @@ import urllib3 import petstore_api -from petstore_api.paths.user_create_with_array import post # noqa: E501 -from petstore_api import configuration, schemas, api_client +from petstore_api.paths.user_create_with_array.post import operation as post # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestUserCreateWithArray(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - UserCreateWithArray unit test stubs + Post unit test stubs Creates list of users with given input array # noqa: E501 """ - _configuration = configuration.Configuration() + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass - - response_status = 0 + response_status = 200 response_body = '' - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_user_create_with_list/test_post.py b/samples/openapi3/client/petstore/python/test/test_paths/test_user_create_with_list/test_post.py index 173e669239a..8897b9787f6 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_user_create_with_list/test_post.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_user_create_with_list/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,25 @@ import urllib3 import petstore_api -from petstore_api.paths.user_create_with_list import post # noqa: E501 -from petstore_api import configuration, schemas, api_client +from petstore_api.paths.user_create_with_list.post import operation as post # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestUserCreateWithList(ApiTestMixin, unittest.TestCase): +class TestPost(ApiTestMixin, unittest.TestCase): """ - UserCreateWithList unit test stubs + Post unit test stubs Creates list of users with given input array # noqa: E501 """ - _configuration = configuration.Configuration() + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass - - response_status = 0 + response_status = 200 response_body = '' - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_user_login/test_get.py b/samples/openapi3/client/petstore/python/test/test_paths/test_user_login/test_get.py index ad71bc1d4f3..2b18b615e41 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_user_login/test_get.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_user_login/test_get.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,32 +12,26 @@ import urllib3 import petstore_api -from petstore_api.paths.user_login import get # noqa: E501 -from petstore_api import configuration, schemas, api_client +from petstore_api.paths.user_login.get import operation as get # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestUserLogin(ApiTestMixin, unittest.TestCase): +class TestGet(ApiTestMixin, unittest.TestCase): """ - UserLogin unit test stubs + Get unit test stubs Logs user into the system # noqa: E501 """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = get.ApiForget(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = get.ApiForGet(api_client=used_api_client) # noqa: E501 response_status = 200 - - - - - + response_body_schema = get.response_200.ResponseFor200.content["application/xml"].schema + response_body_schema = get.response_200.ResponseFor200.content["application/json"].schema if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_user_logout/test_get.py b/samples/openapi3/client/petstore/python/test/test_paths/test_user_logout/test_get.py index 9329c79fb23..69580efe302 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_user_logout/test_get.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_user_logout/test_get.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,29 +12,25 @@ import urllib3 import petstore_api -from petstore_api.paths.user_logout import get # noqa: E501 -from petstore_api import configuration, schemas, api_client +from petstore_api.paths.user_logout.get import operation as get # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestUserLogout(ApiTestMixin, unittest.TestCase): +class TestGet(ApiTestMixin, unittest.TestCase): """ - UserLogout unit test stubs + Get unit test stubs Logs out current logged in user session # noqa: E501 """ - _configuration = configuration.Configuration() + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = get.ApiForGet(api_client=used_api_client) # noqa: E501 - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = get.ApiForget(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass - - response_status = 0 + response_status = 200 response_body = '' - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_user_username/test_delete.py b/samples/openapi3/client/petstore/python/test/test_paths/test_user_username/test_delete.py index 4ea2cc0f52b..ddafc44bc9a 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_user_username/test_delete.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_user_username/test_delete.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,29 +12,25 @@ import urllib3 import petstore_api -from petstore_api.paths.user_username import delete # noqa: E501 -from petstore_api import configuration, schemas, api_client +from petstore_api.paths.user_username.delete import operation as delete # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestUserUsername(ApiTestMixin, unittest.TestCase): +class TestDelete(ApiTestMixin, unittest.TestCase): """ - UserUsername unit test stubs + Delete unit test stubs Delete user # noqa: E501 """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = delete.ApiFordelete(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = delete.ApiForDelete(api_client=used_api_client) # noqa: E501 response_status = 200 response_body = '' - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_user_username/test_get.py b/samples/openapi3/client/petstore/python/test/test_paths/test_user_username/test_get.py index c56b8bd1e4d..69cf93a651e 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_user_username/test_get.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_user_username/test_get.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,32 +12,26 @@ import urllib3 import petstore_api -from petstore_api.paths.user_username import get # noqa: E501 -from petstore_api import configuration, schemas, api_client +from petstore_api.paths.user_username.get import operation as get # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestUserUsername(ApiTestMixin, unittest.TestCase): +class TestGet(ApiTestMixin, unittest.TestCase): """ - UserUsername unit test stubs + Get unit test stubs Get user by user name # noqa: E501 """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = get.ApiForget(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = get.ApiForGet(api_client=used_api_client) # noqa: E501 response_status = 200 - - - - - + response_body_schema = get.response_200.ResponseFor200.content["application/xml"].schema + response_body_schema = get.response_200.ResponseFor200.content["application/json"].schema if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_user_username/test_put.py b/samples/openapi3/client/petstore/python/test/test_paths/test_user_username/test_put.py index 6e94769a585..ab0df61b482 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_user_username/test_put.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_user_username/test_put.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,31 +12,25 @@ import urllib3 import petstore_api -from petstore_api.paths.user_username import put # noqa: E501 -from petstore_api import configuration, schemas, api_client +from petstore_api.paths.user_username.put import operation as put # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration from .. import ApiTestMixin -class TestUserUsername(ApiTestMixin, unittest.TestCase): +class TestPut(ApiTestMixin, unittest.TestCase): """ - UserUsername unit test stubs + Put unit test stubs Updated user # noqa: E501 """ - _configuration = configuration.Configuration() - - def setUp(self): - used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = put.ApiForput(api_client=used_api_client) # noqa: E501 - - def tearDown(self): - pass + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = put.ApiForPut(api_client=used_api_client) # noqa: E501 response_status = 400 response_body = '' - - - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python/test_python.sh b/samples/openapi3/client/petstore/python/test_python.sh index 9728a9b5316..f170f03a6e2 100755 --- a/samples/openapi3/client/petstore/python/test_python.sh +++ b/samples/openapi3/client/petstore/python/test_python.sh @@ -1,7 +1,5 @@ #!/bin/bash -REQUIREMENTS_FILE=dev-requirements.txt -REQUIREMENTS_OUT=dev-requirements.txt.log SETUP_OUT=*.egg-info VENV=venv DEACTIVE=false @@ -17,9 +15,9 @@ if [ -z "$VENVV" ]; then fi ### install dependencies -pip install -r $REQUIREMENTS_FILE | tee -a $REQUIREMENTS_OUT +pip install tox ### locally install the package, needed for pycharm problem checking -pip install -e . +python -m pip install . ### run tests tox || exit 1 diff --git a/samples/openapi3/client/petstore/python/tests_manual/__init__.py b/samples/openapi3/client/petstore/python/tests_manual/__init__.py index 2d3b295fb8c..e7e18993e5e 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/__init__.py +++ b/samples/openapi3/client/petstore/python/tests_manual/__init__.py @@ -1,4 +1,5 @@ import collections +import http import json import typing import unittest @@ -13,7 +14,7 @@ class ApiTestMixin(unittest.TestCase): json_content_type = 'application/json' - user_agent = 'OpenAPI-Generator/1.0.0/python' + user_agent = 'OpenAPI-JSON-Schema-Generator/1.0.0/python' @classmethod def assert_request_called_with( @@ -87,7 +88,7 @@ def headers_for_content_type(content_type: str) -> typing.Dict[str, str]: @classmethod def response( cls, - body: typing.Union[str, bytes], + body: typing.Union[str, bytes, http.client.HTTPResponse], status: int = 200, content_type: str = json_content_type, headers: typing.Optional[typing.Dict[str, str]] = None, @@ -102,7 +103,8 @@ def response( headers=headers, status=status, preload_content=preload_content, - reason=reason + reason=reason, + auto_close = True ) @staticmethod diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_abstract_step_message.py b/samples/openapi3/client/petstore/python/tests_manual/test_abstract_step_message.py index 85fcc8ea2d3..8d63086258e 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_abstract_step_message.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_abstract_step_message.py @@ -6,13 +6,13 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest import petstore_api -from petstore_api.model.abstract_step_message import AbstractStepMessage +from petstore_api.components.schema.abstract_step_message import AbstractStepMessage class TestAbstractStepMessage(unittest.TestCase): diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_additional_properties_class.py b/samples/openapi3/client/petstore/python/tests_manual/test_additional_properties_class.py index 589beb05cde..f750dfde5a3 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_additional_properties_class.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_additional_properties_class.py @@ -6,12 +6,12 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest -from petstore_api.model.additional_properties_class import AdditionalPropertiesClass +from petstore_api.components.schema.additional_properties_class import AdditionalPropertiesClass from petstore_api import schemas @@ -22,7 +22,7 @@ def test_additional_properties_class(self): inst = AdditionalPropertiesClass({}) with self.assertRaises(KeyError): inst["map_property"] - assert inst.get_item_oapg("map_property") is schemas.unset + assert inst.get_item_("map_property") is schemas.unset with self.assertRaises(AttributeError): inst.map_property diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_additional_properties_validator.py b/samples/openapi3/client/petstore/python/tests_manual/test_additional_properties_validator.py index a54404c542a..cd5e601dea4 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_additional_properties_validator.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_additional_properties_validator.py @@ -6,12 +6,12 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest -from petstore_api.model.additional_properties_validator import AdditionalPropertiesValidator +from petstore_api.components.schema.additional_properties_validator import AdditionalPropertiesValidator from petstore_api import schemas, exceptions @@ -30,8 +30,8 @@ def test_additional_properties_validator(self): assert add_prop == 'abc' assert isinstance(add_prop, str) assert isinstance(add_prop, schemas.AnyTypeSchema) - assert isinstance(add_prop, AdditionalPropertiesValidator.MetaOapg.all_of()[1].MetaOapg.additional_properties) - assert isinstance(add_prop, AdditionalPropertiesValidator.MetaOapg.all_of()[2].MetaOapg.additional_properties) + assert isinstance(add_prop, AdditionalPropertiesValidator.Schema_.AllOf.classes[1].Schema_.AdditionalProperties) + assert isinstance(add_prop, AdditionalPropertiesValidator.Schema_.AllOf.classes[2].Schema_.AdditionalProperties) assert not isinstance(add_prop, schemas.UnsetAnyTypeSchema) diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_animal.py b/samples/openapi3/client/petstore/python/tests_manual/test_animal.py index 68bb19bd249..fcbd99af52d 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_animal.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_animal.py @@ -6,7 +6,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -15,9 +15,9 @@ import frozendict import petstore_api -from petstore_api.model.cat import Cat -from petstore_api.model.dog import Dog -from petstore_api.model.animal import Animal +from petstore_api.components.schema.cat import Cat +from petstore_api.components.schema.dog import Dog +from petstore_api.components.schema.animal import Animal from petstore_api.schemas import StrSchema, BoolSchema @@ -43,7 +43,7 @@ def testAnimal(self): animal = Animal(className='Cat', color='black') assert isinstance(animal, frozendict.frozendict) assert isinstance(animal, Cat) - assert isinstance(animal, Cat.MetaOapg.all_of()[1]) + assert isinstance(animal, Cat.Schema_.AllOf.classes[1]) assert isinstance(animal, Animal) assert set(animal.keys()) == {'className', 'color'} assert animal.className == 'Cat' @@ -56,7 +56,7 @@ def testAnimal(self): assert isinstance(animal, Animal) assert isinstance(animal, frozendict.frozendict) assert isinstance(animal, Cat) - assert isinstance(animal, Cat.MetaOapg.all_of()[1]) + assert isinstance(animal, Cat.Schema_.AllOf.classes[1]) assert set(animal.keys()) == {'className', 'color', 'declawed'} assert animal.className == 'Cat' assert animal["color"] == 'black' @@ -70,7 +70,7 @@ def testAnimal(self): assert isinstance(animal, Animal) assert isinstance(animal, frozendict.frozendict) assert isinstance(animal, Dog) - assert isinstance(animal, Dog.MetaOapg.all_of()[1]) + assert isinstance(animal, Dog.Schema_.AllOf.classes[1]) assert set(animal.keys()) == {'className', 'color'} assert animal.className == 'Dog' assert animal["color"] == 'black' @@ -82,7 +82,7 @@ def testAnimal(self): assert isinstance(animal, Animal) assert isinstance(animal, frozendict.frozendict) assert isinstance(animal, Dog) - assert isinstance(animal, Dog.MetaOapg.all_of()[1]) + assert isinstance(animal, Dog.Schema_.AllOf.classes[1]) assert set(animal.keys()) == {'className', 'color', 'breed'} assert animal.className == 'Dog' assert animal["color"] == 'black' diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_any_type_and_format.py b/samples/openapi3/client/petstore/python/tests_manual/test_any_type_and_format.py index 3882982711a..21a60779bd9 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_any_type_and_format.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_any_type_and_format.py @@ -6,7 +6,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import datetime @@ -14,7 +14,7 @@ import unittest import uuid -from petstore_api.model.any_type_and_format import AnyTypeAndFormat +from petstore_api.components.schema.any_type_and_format import AnyTypeAndFormat from petstore_api import exceptions @@ -114,11 +114,8 @@ def test_int32(self): 'a', {}, 1, - 3.14, min_bound, max_bound, - under_min_number, - over_max_number, True, None, [], @@ -131,7 +128,10 @@ def test_int32(self): # invalid values do not work invalid_values = ( min_bound - 1, - max_bound + 1 + max_bound + 1, + 3.14, + under_min_number, + over_max_number, ) for invalid_value in invalid_values: with self.assertRaises(exceptions.ApiValueError): @@ -146,11 +146,8 @@ def test_int64(self): 'a', {}, 1, - 3.14, min_bound, max_bound, - under_min_number, - over_max_number, True, None, [], @@ -163,7 +160,10 @@ def test_int64(self): # invalid values do not work invalid_values = ( min_bound - 1, - max_bound + 1 + max_bound + 1, + under_min_number, + over_max_number, + 3.14, ) for invalid_value in invalid_values: with self.assertRaises(exceptions.ApiValueError): diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_any_type_not_string.py b/samples/openapi3/client/petstore/python/tests_manual/test_any_type_not_string.py index 88e16175e11..2bc54fde2e8 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_any_type_not_string.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_any_type_not_string.py @@ -6,13 +6,13 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest import petstore_api -from petstore_api.model.any_type_not_string import AnyTypeNotString +from petstore_api.components.schema.any_type_not_string import AnyTypeNotString class TestAnyTypeNotString(unittest.TestCase): diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_any_type_schema.py b/samples/openapi3/client/petstore/python/tests_manual/test_any_type_schema.py index 15f498bcc0a..69539c3bdab 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_any_type_schema.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_any_type_schema.py @@ -6,7 +6,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -28,7 +28,6 @@ DateSchema, DateTimeSchema, DecimalSchema, - ComposedSchema, NoneClass, BoolClass ) @@ -37,11 +36,11 @@ class TestAnyTypeSchema(unittest.TestCase): def testDictSchema(self): - class Model(ComposedSchema): - class MetaOapg: - @staticmethod - def all_of(): - return [ + class Model(AnyTypeSchema): + class Schema_: + + class AllOf: + classes = [ AnyTypeSchema, DictSchema, ] @@ -54,11 +53,11 @@ def all_of(): assert m == frozendict.frozendict(a=Decimal(1), b='hi') def testListSchema(self): - class Model(ComposedSchema): - class MetaOapg: - @staticmethod - def all_of(): - return [ + class Model(AnyTypeSchema): + class Schema_: + + class AllOf: + classes = [ AnyTypeSchema, ListSchema, ] @@ -71,11 +70,11 @@ def all_of(): assert m == tuple([Decimal(1), 'hi']) def testStrSchema(self): - class Model(ComposedSchema): - class MetaOapg: - @staticmethod - def all_of(): - return [ + class Model(AnyTypeSchema): + class Schema_: + + class AllOf: + classes = [ AnyTypeSchema, StrSchema, ] @@ -88,11 +87,11 @@ def all_of(): assert m == 'hi' def testNumberSchema(self): - class Model(ComposedSchema): - class MetaOapg: - @staticmethod - def all_of(): - return [ + class Model(AnyTypeSchema): + class Schema_: + + class AllOf: + classes = [ AnyTypeSchema, NumberSchema, ] @@ -112,11 +111,11 @@ def all_of(): assert m == Decimal(3.14) def testIntSchema(self): - class Model(ComposedSchema): - class MetaOapg: - @staticmethod - def all_of(): - return [ + class Model(AnyTypeSchema): + class Schema_: + + class AllOf: + classes = [ AnyTypeSchema, IntSchema, ] @@ -133,11 +132,11 @@ def all_of(): Model(3.14) def testBoolSchema(self): - class Model(ComposedSchema): - class MetaOapg: - @staticmethod - def all_of(): - return [ + class Model(AnyTypeSchema): + class Schema_: + + class AllOf: + classes = [ AnyTypeSchema, BoolSchema, ] @@ -157,28 +156,28 @@ def all_of(): self.assertFalse(m) def testNoneSchema(self): - class Model(ComposedSchema): - class MetaOapg: - @staticmethod - def all_of(): - return [ + class Model(AnyTypeSchema): + class Schema_: + + class AllOf: + classes = [ AnyTypeSchema, NoneSchema, ] m = Model(None) - self.assertTrue(m.is_none_oapg()) + self.assertTrue(m.is_none_()) assert isinstance(m, Model) assert isinstance(m, AnyTypeSchema) assert isinstance(m, NoneSchema) assert isinstance(m, NoneClass) def testDateSchema(self): - class Model(ComposedSchema): - class MetaOapg: - @staticmethod - def all_of(): - return [ + class Model(AnyTypeSchema): + class Schema_: + + class AllOf: + classes = [ AnyTypeSchema, DateSchema, ] @@ -191,11 +190,11 @@ def all_of(): assert m == '1970-01-01' def testDateTimeSchema(self): - class Model(ComposedSchema): - class MetaOapg: - @staticmethod - def all_of(): - return [ + class Model(AnyTypeSchema): + class Schema_: + + class AllOf: + classes = [ AnyTypeSchema, DateTimeSchema, ] @@ -208,18 +207,18 @@ def all_of(): assert m == '2020-01-01T00:00:00' def testDecimalSchema(self): - class Model(ComposedSchema): - class MetaOapg: - @staticmethod - def all_of(): - return [ + class Model(AnyTypeSchema): + class Schema_: + + class AllOf: + classes = [ AnyTypeSchema, DecimalSchema, ] m = Model('12.34') assert m == '12.34' - assert m.as_decimal_oapg == Decimal('12.34') + assert m.as_decimal_ == Decimal('12.34') assert isinstance(m, Model) assert isinstance(m, AnyTypeSchema) assert isinstance(m, DecimalSchema) diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_array_holding_any_type.py b/samples/openapi3/client/petstore/python/tests_manual/test_array_holding_any_type.py index 6addb31d8fc..3faa2f73c0f 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_array_holding_any_type.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_array_holding_any_type.py @@ -6,7 +6,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -15,7 +15,7 @@ from datetime import date, datetime, timezone import petstore_api -from petstore_api.model.array_holding_any_type import ArrayHoldingAnyType +from petstore_api.components.schema.array_holding_any_type import ArrayHoldingAnyType from petstore_api.schemas import NoneClass, BoolClass diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_array_with_validations_in_items.py b/samples/openapi3/client/petstore/python/tests_manual/test_array_with_validations_in_items.py index 1d3eccb68ed..6f645cb12eb 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_array_with_validations_in_items.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_array_with_validations_in_items.py @@ -6,7 +6,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -14,7 +14,7 @@ import unittest import petstore_api -from petstore_api.model.array_with_validations_in_items import ArrayWithValidationsInItems +from petstore_api.components.schema.array_with_validations_in_items import ArrayWithValidationsInItems class TestArrayWithValidationsInItems(unittest.TestCase): diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_boolean_enum.py b/samples/openapi3/client/petstore/python/tests_manual/test_boolean_enum.py index 530755c0681..ff0eb75430e 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_boolean_enum.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_boolean_enum.py @@ -6,14 +6,14 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest import petstore_api -from petstore_api.model.boolean_enum import BooleanEnum +from petstore_api.components.schema.boolean_enum import BooleanEnum class TestBooleanEnum(unittest.TestCase): @@ -29,8 +29,8 @@ def test_BooleanEnum(self): """Test BooleanEnum""" model = BooleanEnum(True) assert model is BooleanEnum.TRUE - assert model.is_true_oapg() - assert model.is_false_oapg() is False + assert model.is_true_() + assert model.is_false_() is False assert repr(model) == '' with self.assertRaises(petstore_api.ApiValueError): BooleanEnum(False) diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_combine_object_schemas.py b/samples/openapi3/client/petstore/python/tests_manual/test_combine_object_schemas.py index cdbd7b1747c..9569b8553f1 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_combine_object_schemas.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_combine_object_schemas.py @@ -6,7 +6,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -15,13 +15,13 @@ import petstore_api from petstore_api.schemas import AnyTypeSchema, DictSchema, IntSchema, StrSchema, Float32Schema, DateSchema -from petstore_api.model.danish_pig import DanishPig -from petstore_api.model.basque_pig import BasquePig -from petstore_api.model.no_additional_properties import NoAdditionalProperties -from petstore_api.model.address import Address -from petstore_api.model.apple_req import AppleReq -from petstore_api.model.banana_req import BananaReq -from petstore_api.model.player import Player +from petstore_api.components.schema.danish_pig import DanishPig +from petstore_api.components.schema.basque_pig import BasquePig +from petstore_api.components.schema.no_additional_properties import NoAdditionalProperties +from petstore_api.components.schema.address import Address +from petstore_api.components.schema.apple_req import AppleReq +from petstore_api.components.schema.banana_req import BananaReq +from petstore_api.components.schema.player import Player class TestCombineObjectSchemas(unittest.TestCase): pass diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_combine_schemas.py b/samples/openapi3/client/petstore/python/tests_manual/test_combine_schemas.py index f77f71ec46a..7cb9f970f57 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_combine_schemas.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_combine_schemas.py @@ -6,7 +6,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -14,16 +14,16 @@ import unittest import petstore_api -from petstore_api.model.date_with_validations import DateWithValidations -from petstore_api.model.date_time_with_validations import DateTimeWithValidations -from petstore_api.model.string_with_validation import StringWithValidation -from petstore_api.model.integer_enum_one_value import IntegerEnumOneValue -from petstore_api.model.integer_enum import IntegerEnum -from petstore_api.model.integer_enum_big import IntegerEnumBig -from petstore_api.model.integer_max10 import IntegerMax10 -from petstore_api.model.integer_min15 import IntegerMin15 -from petstore_api.model.nullable_string import NullableString -from petstore_api.schemas import AnyTypeSchema, Schema, NoneSchema, StrSchema, none_type, Singleton +from petstore_api.components.schema.date_with_validations import DateWithValidations +from petstore_api.components.schema.date_time_with_validations import DateTimeWithValidations +from petstore_api.components.schema.string_with_validation import StringWithValidation +from petstore_api.components.schema.integer_enum_one_value import IntegerEnumOneValue +from petstore_api.components.schema.integer_enum import IntegerEnum +from petstore_api.components.schema.integer_enum_big import IntegerEnumBig +from petstore_api.components.schema.integer_max10 import IntegerMax10 +from petstore_api.components.schema.integer_min15 import IntegerMin15 +from petstore_api.components.schema.nullable_string import NullableString +from petstore_api.schemas import AnyTypeSchema, Schema, NoneSchema, StrSchema, Singleton class TestCombineNonObjectSchemas(unittest.TestCase): diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_composed_bool.py b/samples/openapi3/client/petstore/python/tests_manual/test_composed_bool.py index 45eb1491066..c56e9e6eae2 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_composed_bool.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_composed_bool.py @@ -6,14 +6,14 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest import petstore_api -from petstore_api.model.composed_bool import ComposedBool +from petstore_api.components.schema.composed_bool import ComposedBool class TestComposedBool(unittest.TestCase): @@ -33,11 +33,11 @@ def test_ComposedBool(self): model = ComposedBool(value) if value is True: self.assertTrue(bool(model)) - self.assertTrue(model.is_true_oapg()) - self.assertFalse(model.is_false_oapg()) + self.assertTrue(model.is_true_()) + self.assertFalse(model.is_false_()) else: - self.assertTrue(model.is_false_oapg()) - self.assertFalse(model.is_true_oapg()) + self.assertTrue(model.is_false_()) + self.assertFalse(model.is_true_()) self.assertFalse(bool(model)) continue with self.assertRaises(petstore_api.ApiTypeError): diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_composed_none.py b/samples/openapi3/client/petstore/python/tests_manual/test_composed_none.py index a37eb26b104..405cf1bc518 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_composed_none.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_composed_none.py @@ -6,7 +6,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -14,7 +14,7 @@ import unittest import petstore_api -from petstore_api.model.composed_none import ComposedNone +from petstore_api.components.schema.composed_none import ComposedNone class TestComposedNone(unittest.TestCase): diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_composed_number.py b/samples/openapi3/client/petstore/python/tests_manual/test_composed_number.py index 1cd982e3f33..53fbad50d72 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_composed_number.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_composed_number.py @@ -6,7 +6,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -14,7 +14,7 @@ import unittest import petstore_api -from petstore_api.model.composed_number import ComposedNumber +from petstore_api.components.schema.composed_number import ComposedNumber class TestComposedNumber(unittest.TestCase): diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_composed_object.py b/samples/openapi3/client/petstore/python/tests_manual/test_composed_object.py index 7c79c574d9b..207b76b73f7 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_composed_object.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_composed_object.py @@ -6,7 +6,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -14,7 +14,7 @@ import unittest import petstore_api -from petstore_api.model.composed_object import ComposedObject +from petstore_api.components.schema.composed_object import ComposedObject class TestComposedObject(unittest.TestCase): diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_composed_one_of_different_types.py b/samples/openapi3/client/petstore/python/tests_manual/test_composed_one_of_different_types.py index e98af8bb8f9..f1e04f3aa21 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_composed_one_of_different_types.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_composed_one_of_different_types.py @@ -6,7 +6,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -17,10 +17,10 @@ import frozendict from petstore_api.schemas import DateSchema, DateTimeSchema, Singleton, NoneClass -from petstore_api.model.animal import Animal -from petstore_api.model.cat import Cat -from petstore_api.model.composed_one_of_different_types import ComposedOneOfDifferentTypes -from petstore_api.model.number_with_validations import NumberWithValidations +from petstore_api.components.schema.animal import Animal +from petstore_api.components.schema.cat import Cat +from petstore_api.components.schema.composed_one_of_different_types import ComposedOneOfDifferentTypes +from petstore_api.components.schema.number_with_validations import NumberWithValidations class TestComposedOneOfDifferentTypes(unittest.TestCase): """ComposedOneOfDifferentTypes unit test stubs""" @@ -52,56 +52,56 @@ def test_ComposedOneOfDifferentTypes(self): # None inst = ComposedOneOfDifferentTypes(None) - inst.is_none_oapg() + inst.is_none_() assert isinstance(inst, ComposedOneOfDifferentTypes) assert isinstance(inst, Singleton) assert isinstance(inst, NoneClass) - assert inst.is_none_oapg() is True + assert inst.is_none_() is True # date - inst = ComposedOneOfDifferentTypes.from_openapi_data_oapg('2019-01-10') + inst = ComposedOneOfDifferentTypes.from_openapi_data_('2019-01-10') assert isinstance(inst, ComposedOneOfDifferentTypes) assert isinstance(inst, DateSchema) assert isinstance(inst, str) - assert inst.as_date_oapg.year == 2019 - assert inst.as_date_oapg.month == 1 - assert inst.as_date_oapg.day == 10 + assert inst.as_date_.year == 2019 + assert inst.as_date_.month == 1 + assert inst.as_date_.day == 10 # date inst = ComposedOneOfDifferentTypes(date(2019, 1, 10)) assert isinstance(inst, ComposedOneOfDifferentTypes) assert isinstance(inst, DateSchema) assert isinstance(inst, str) - assert inst.as_date_oapg.year == 2019 - assert inst.as_date_oapg.month == 1 - assert inst.as_date_oapg.day == 10 + assert inst.as_date_.year == 2019 + assert inst.as_date_.month == 1 + assert inst.as_date_.day == 10 # date-time - inst = ComposedOneOfDifferentTypes.from_openapi_data_oapg('2020-01-02T03:04:05Z') + inst = ComposedOneOfDifferentTypes.from_openapi_data_('2020-01-02T03:04:05Z') assert isinstance(inst, ComposedOneOfDifferentTypes) assert isinstance(inst, DateTimeSchema) assert isinstance(inst, str) - assert inst.as_datetime_oapg.year == 2020 - assert inst.as_datetime_oapg.month == 1 - assert inst.as_datetime_oapg.day == 2 - assert inst.as_datetime_oapg.hour == 3 - assert inst.as_datetime_oapg.minute == 4 - assert inst.as_datetime_oapg.second == 5 + assert inst.as_datetime_.year == 2020 + assert inst.as_datetime_.month == 1 + assert inst.as_datetime_.day == 2 + assert inst.as_datetime_.hour == 3 + assert inst.as_datetime_.minute == 4 + assert inst.as_datetime_.second == 5 utc_tz = tzutc() - assert inst.as_datetime_oapg.tzinfo == utc_tz + assert inst.as_datetime_.tzinfo == utc_tz # date-time inst = ComposedOneOfDifferentTypes(datetime(2020, 1, 2, 3, 4, 5, tzinfo=timezone.utc)) assert isinstance(inst, ComposedOneOfDifferentTypes) assert isinstance(inst, DateTimeSchema) assert isinstance(inst, str) - assert inst.as_datetime_oapg.year == 2020 - assert inst.as_datetime_oapg.month == 1 - assert inst.as_datetime_oapg.day == 2 - assert inst.as_datetime_oapg.hour == 3 - assert inst.as_datetime_oapg.minute == 4 - assert inst.as_datetime_oapg.second == 5 - assert inst.as_datetime_oapg.tzinfo == utc_tz + assert inst.as_datetime_.year == 2020 + assert inst.as_datetime_.month == 1 + assert inst.as_datetime_.day == 2 + assert inst.as_datetime_.hour == 3 + assert inst.as_datetime_.minute == 4 + assert inst.as_datetime_.second == 5 + assert inst.as_datetime_.tzinfo == utc_tz if __name__ == '__main__': diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_composed_string.py b/samples/openapi3/client/petstore/python/tests_manual/test_composed_string.py index aeb5ea3a972..e7bfdaeec75 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_composed_string.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_composed_string.py @@ -6,7 +6,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -14,7 +14,7 @@ import unittest import petstore_api -from petstore_api.model.composed_string import ComposedString +from petstore_api.components.schema.composed_string import ComposedString class TestComposedString(unittest.TestCase): diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_configuration.py b/samples/openapi3/client/petstore/python/tests_manual/test_configuration.py index 1d11ed6cae2..89f0ebbf209 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_configuration.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_configuration.py @@ -2,13 +2,6 @@ # flake8: noqa -""" -Run the tests. -$ pip install nose (optional) -$ cd OpenAPIetstore-python -$ nosetests -v -""" - import unittest from unittest.mock import patch @@ -16,39 +9,52 @@ from urllib3._collections import HTTPHeaderDict import petstore_api +from petstore_api.configurations import schema_configuration, api_configuration from petstore_api.api_client import ApiClient from petstore_api.apis.tags import pet_api +from petstore_api.apis.tags import default_api +from . import ApiTestMixin -class ConfigurationTests(unittest.TestCase): +class ConfigurationTests(ApiTestMixin, unittest.TestCase): def test_configuration(self): - config = petstore_api.Configuration() - config.host = 'https://localhost/' - - config.disabled_client_side_validations = ("multipleOf,maximum,exclusiveMaximum,minimum,exclusiveMinimum," - "maxLength,minLength,pattern,maxItems,minItems") + config = schema_configuration.SchemaConfiguration( + disabled_json_schema_keywords=set(("multipleOf,maximum,exclusiveMaximum,minimum,exclusiveMinimum," + "maxLength,minLength,pattern,maxItems,minItems").split(',')) + ) with self.assertRaisesRegex(ValueError, "Invalid keyword: 'foo'"): - config.disabled_client_side_validations = 'foo' - config.disabled_client_side_validations = "" + config.disabled_json_schema_keywords = {'foo'} + config.disabled_json_schema_keywords = set() - def test_servers(self): - config = petstore_api.Configuration(server_index=1, server_variables={'version': 'v1'}) - client = ApiClient(configuration=config) + def test_spec_root_servers(self): + security_scheme_info = api_configuration.SecuritySchemeInfo( + api_key=api_configuration.security_scheme_api_key.ApiKey(api_key='abcdefg') + ) + server_info: api_configuration.ServerInfo = { + 'servers/1': api_configuration.server_1.Server1(variables={'version': 'v2'}) + } + server_index_info: api_configuration.ServerIndexInfo = { + 'servers': 1 + } + configuration = api_configuration.ApiConfiguration(security_scheme_info=security_scheme_info, server_info=server_info, server_index_info=server_index_info) + client = ApiClient(configuration=configuration) api = pet_api.PetApi(client) with patch.object(ApiClient, 'request') as mock_request: mock_request.return_value = urllib3.HTTPResponse(status=200) - api.add_pet({'name': 'pet', 'photoUrls': []}) + body = {'name': 'pet', 'photoUrls': []} + api.add_pet(body) mock_request.assert_called_with( - 'POST', - 'https://path-server-test.petstore.local/v2/pet', + 'post', + 'https://localhost:8080/v2/pet', headers=HTTPHeaderDict({ 'Content-Type': 'application/json', - 'User-Agent': 'OpenAPI-Generator/1.0.0/python' + 'User-Agent': 'OpenAPI-JSON-Schema-Generator/1.0.0/python', + 'api_key': 'abcdefg' }), fields=None, - body=b'{"photoUrls":[],"name":"pet"}', + body=b'{"name":"pet","photoUrls":[]}', stream=False, timeout=None, ) @@ -57,11 +63,91 @@ def test_servers(self): mock_request.return_value = urllib3.HTTPResponse(status=200) api.delete_pet(path_params=dict(petId=123456789)) mock_request.assert_called_with( - 'DELETE', - 'https://localhost:8080/v1/pet/123456789', - headers={'User-Agent': 'OpenAPI-Generator/1.0.0/python'}, + 'delete', + 'https://localhost:8080/v2/pet/123456789', + headers={ + 'User-Agent': 'OpenAPI-JSON-Schema-Generator/1.0.0/python', + 'api_key': 'abcdefg' + }, + fields=None, + body=None, + stream=False, + timeout=None, + ) + + def test_path_servers(self): + security_scheme_info = api_configuration.SecuritySchemeInfo( + api_key=api_configuration.security_scheme_api_key.ApiKey(api_key='abcdefg') + ) + server_info: api_configuration.ServerInfo = { + "paths//pet/findByStatus//servers/1": api_configuration.pet_find_by_status_server_1.Server1( + variables={'version': 'v2'} + ) + } + configuration = api_configuration.ApiConfiguration(security_scheme_info=security_scheme_info, server_info=server_info) + client = ApiClient(configuration=configuration) + api = pet_api.PetApi(client) + + with patch.object(ApiClient, 'request') as mock_request: + pet_json = { + "name": "pet", + "photoUrls":[] + } + body = self.json_bytes( + [ + pet_json + ] + ) + mock_request.return_value = self.response(body) + _pets = api.find_pets_by_status( + query_params={'status': ['available']}, + server_index=1 + ) + mock_request.assert_called_with( + 'get', + 'https://petstore.swagger.io/v2/pet/findByStatus?status=available', + headers=HTTPHeaderDict({ + 'User-Agent': 'OpenAPI-JSON-Schema-Generator/1.0.0/python', + 'api_key': 'abcdefg', + 'Accept': 'application/xml, application/json' + }), + fields=None, + body=None, + stream=False, + timeout=None, + ) + + def test_operation_servers(self): + server_info: api_configuration.ServerInfo = { + "paths//foo/get/servers/1": api_configuration.foo_get_server_1.Server1( + variables={'version': 'v2'} + ) + } + config = api_configuration.ApiConfiguration(server_info=server_info) + client = ApiClient(configuration=config) + api = default_api.DefaultApi(client) + + with patch.object(ApiClient, 'request') as mock_request: + body = self.json_bytes( + { + 'string': { + 'bar': 'some bar' + } + } + ) + mock_request.return_value = self.response(body) + _api_response = api.foo_get( + server_index=1 + ) + mock_request.assert_called_with( + 'get', + 'https://petstore.swagger.io/v2/foo', + headers=HTTPHeaderDict({ + 'User-Agent': 'OpenAPI-JSON-Schema-Generator/1.0.0/python', + 'Accept': 'application/json' + }), fields=None, body=None, stream=False, timeout=None, - ) \ No newline at end of file + ) diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_date_time_with_validations.py b/samples/openapi3/client/petstore/python/tests_manual/test_date_time_with_validations.py index 336cb29cb39..8af6233f888 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_date_time_with_validations.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_date_time_with_validations.py @@ -6,14 +6,14 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest import petstore_api -from petstore_api.model.date_time_with_validations import DateTimeWithValidations +from petstore_api.components.schema.date_time_with_validations import DateTimeWithValidations from datetime import date, datetime, timezone @@ -36,30 +36,30 @@ def testDateTimeWithValidations(self): inst = DateTimeWithValidations(valid_value) assert inst == expected_datetime - # when passing data in with from_openapi_data_oapg one must use str + # when passing data in with from_openapi_data_ one must use str with self.assertRaisesRegex( petstore_api.ApiTypeError, r"Invalid type. Required value type is str and passed " r"type was at \('args\[0\]',\)" ): - DateTimeWithValidations.from_openapi_data_oapg(datetime(2020, 1, 1)) + DateTimeWithValidations.from_openapi_data_(datetime(2020, 1, 1)) - # when passing data from_openapi_data_oapg we can use str + # when passing data from_openapi_data_ we can use str input_value_to_datetime = { "2020-01-01T00:00:00": datetime(2020, 1, 1, tzinfo=None), "2020-01-01T00:00:00Z": datetime(2020, 1, 1, tzinfo=timezone.utc), "2020-01-01T00:00:00+00:00": datetime(2020, 1, 1, tzinfo=timezone.utc) } for input_value, expected_datetime in input_value_to_datetime.items(): - inst = DateTimeWithValidations.from_openapi_data_oapg(input_value) - assert inst.as_datetime_oapg == expected_datetime + inst = DateTimeWithValidations.from_openapi_data_(input_value) + assert inst.as_datetime_ == expected_datetime # value error is raised if an invalid string is passed in with self.assertRaisesRegex( petstore_api.ApiValueError, r"Value does not conform to the required ISO-8601 datetime format. Invalid value 'abcd' for type datetime at \('args\[0\]',\)" ): - DateTimeWithValidations.from_openapi_data_oapg("abcd") + DateTimeWithValidations.from_openapi_data_("abcd") # value error is raised if a date is passed in with self.assertRaisesRegex( @@ -74,7 +74,7 @@ def testDateTimeWithValidations(self): petstore_api.ApiValueError, error_regex ): - DateTimeWithValidations.from_openapi_data_oapg("2019-01-01T00:00:00Z") + DateTimeWithValidations.from_openapi_data_("2019-01-01T00:00:00Z") # pattern checking with date input error_regex = r"Invalid value `2019-01-01T00:00:00`, must match regular expression `.+?` at \('args\[0\]',\)" with self.assertRaisesRegex( diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_date_with_validations.py b/samples/openapi3/client/petstore/python/tests_manual/test_date_with_validations.py index 658470df0e6..c629ea151ef 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_date_with_validations.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_date_with_validations.py @@ -6,14 +6,14 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest import petstore_api -from petstore_api.model.date_with_validations import DateWithValidations +from petstore_api.components.schema.date_with_validations import DateWithValidations from datetime import date, datetime @@ -36,28 +36,28 @@ def testDateWithValidations(self): inst = DateWithValidations(valid_value) assert inst == expected_date - # when passing data in with from_openapi_data_oapg one must use str + # when passing data in with from_openapi_data_ one must use str with self.assertRaisesRegex( petstore_api.ApiTypeError, r"Invalid type. Required value type is str and passed " r"type was at \('args\[0\]',\)" ): - DateWithValidations.from_openapi_data_oapg(date(2020, 1, 1)) + DateWithValidations.from_openapi_data_(date(2020, 1, 1)) # when passing data in from the server we can use str valid_values = ["2020-01-01", "2020-01", "2020"] expected_date = date(2020, 1, 1) for valid_value in valid_values: - inst = DateWithValidations.from_openapi_data_oapg(valid_value) - assert inst.as_date_oapg == expected_date + inst = DateWithValidations.from_openapi_data_(valid_value) + assert inst.as_date_ == expected_date # value error is raised if an invalid string is passed in with self.assertRaisesRegex( petstore_api.ApiValueError, r"Value does not conform to the required ISO-8601 date format. Invalid value '2020-01-01T00:00:00Z' for type date at \('args\[0\]',\)" ): - DateWithValidations.from_openapi_data_oapg("2020-01-01T00:00:00Z") + DateWithValidations.from_openapi_data_("2020-01-01T00:00:00Z") # value error is raised if a datetime is passed in with self.assertRaisesRegex( @@ -71,7 +71,7 @@ def testDateWithValidations(self): petstore_api.ApiValueError, r"Value does not conform to the required ISO-8601 date format. Invalid value 'abcd' for type date at \('args\[0\]',\)" ): - DateWithValidations.from_openapi_data_oapg("abcd") + DateWithValidations.from_openapi_data_("abcd") # pattern checking for str input error_regex = r"Invalid value `2019-01-01`, must match regular expression `.+?` at \('args\[0\]',\)" @@ -79,7 +79,7 @@ def testDateWithValidations(self): petstore_api.ApiValueError, error_regex ): - DateWithValidations.from_openapi_data_oapg("2019-01-01") + DateWithValidations.from_openapi_data_("2019-01-01") # pattern checking for date input with self.assertRaisesRegex( petstore_api.ApiValueError, diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_decimal_payload.py b/samples/openapi3/client/petstore/python/tests_manual/test_decimal_payload.py index 58f77cbf216..0046fa2248c 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_decimal_payload.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_decimal_payload.py @@ -6,7 +6,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import decimal @@ -14,7 +14,7 @@ import petstore_api from petstore_api.schemas import DecimalSchema -from petstore_api.model.decimal_payload import DecimalPayload +from petstore_api.components.schema.decimal_payload import DecimalPayload class TestDecimalPayload(unittest.TestCase): @@ -28,14 +28,14 @@ def test_DecimalPayload(self): assert isinstance(m, DecimalSchema) assert isinstance(m, str) assert m == '12' - assert m.as_decimal_oapg == decimal.Decimal('12') + assert m.as_decimal_ == decimal.Decimal('12') m = DecimalPayload('12.34') assert isinstance(m, DecimalPayload) assert isinstance(m, DecimalSchema) assert isinstance(m, str) assert m == '12.34' - assert m.as_decimal_oapg == decimal.Decimal('12.34') + assert m.as_decimal_ == decimal.Decimal('12.34') # passing in a Decimal does not work with self.assertRaises(petstore_api.ApiTypeError): diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_deserialization.py b/samples/openapi3/client/petstore/python/tests_manual/test_deserialization.py index 7c0300fbcd1..105cc831d15 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_deserialization.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_deserialization.py @@ -17,8 +17,8 @@ import urllib3 import petstore_api -from petstore_api import api_client -from petstore_api.schemas import NoneClass +from petstore_api import api_client, schemas +from petstore_api.configurations import schema_configuration MockResponse = namedtuple('MockResponse', 'data') @@ -27,7 +27,7 @@ class DeserializationTests(unittest.TestCase): json_content_type = 'application/json' json_content_type_headers = {'content-type': json_content_type} - configuration = petstore_api.Configuration() + configuration = schema_configuration.SchemaConfiguration() @classmethod def __response(cls, data: typing.Any) -> urllib3.HTTPResponse: @@ -48,18 +48,24 @@ def test_deserialize_shape(self): - SimpleQuadrilateral by traveling through 2 discriminators """ - from petstore_api.model import shape, equilateral_triangle - _response_for_200 = api_client.OpenApiResponse( + from petstore_api.components.schema import shape, equilateral_triangle + class ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: shape.Shape + headers: schemas.Unset + + class ResponseFor200(api_client.OpenApiResponse): + response_cls=ApiResponse content={ self.json_content_type: api_client.MediaType(schema=shape.Shape), - }, - ) + } + data = { 'shapeType': 'Triangle', 'triangleType': 'EquilateralTriangle', } response = self.__response(data) - deserialized = _response_for_200.deserialize(response, self.configuration) + deserialized = ResponseFor200.deserialize(response, self.configuration) body = deserialized.body self.assertTrue(isinstance(body, equilateral_triangle.EquilateralTriangle)) self.assertEqual(body['shapeType'], 'Triangle') @@ -77,7 +83,7 @@ def test_deserialize_shape(self): r"\['ComplexQuadrilateral', 'SimpleQuadrilateral'\] are allowed at \('args\[0\]', 'quadrilateralType'\)" ) with self.assertRaisesRegex(petstore_api.ApiValueError, err_msg): - _response_for_200.deserialize(response, self.configuration) + ResponseFor200.deserialize(response, self.configuration) def test_deserialize_animal(self): """ @@ -86,19 +92,25 @@ def test_deserialize_animal(self): that inherrit from Animal This is the swagger (v2) way of doing something like oneOf composition """ - from petstore_api.model import animal, dog - _response_for_200 = api_client.OpenApiResponse( + from petstore_api.components.schema import animal, dog + class ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: animal.Animal + headers: schemas.Unset + + class ResponseFor200(api_client.OpenApiResponse): + response_cls=ApiResponse content={ self.json_content_type: api_client.MediaType(schema=animal.Animal), - }, - ) + } + data = { 'className': 'Dog', 'color': 'white', 'breed': 'Jack Russel Terrier' } response = self.__response(data) - deserialized = _response_for_200.deserialize(response, self.configuration) + deserialized = ResponseFor200.deserialize(response, self.configuration) body = deserialized.body self.assertTrue(isinstance(body, dog.Dog)) self.assertEqual(body['className'], 'Dog') @@ -109,7 +121,7 @@ def test_regex_constraint(self): """ Test regex pattern validation. """ - from petstore_api.model import apple + from petstore_api.components.schema import apple # Test with valid regex pattern. inst = apple.Apple( @@ -150,12 +162,18 @@ def test_deserialize_mammal(self): """ # whale test - from petstore_api.model import mammal, zebra, whale - _response_for_200 = api_client.OpenApiResponse( + from petstore_api.components.schema import mammal, zebra, whale + class ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: mammal.Mammal + headers: schemas.Unset + + class ResponseFor200(api_client.OpenApiResponse): + response_cls=ApiResponse content={ self.json_content_type: api_client.MediaType(schema=mammal.Mammal), - }, - ) + } + has_baleen = True has_teeth = False class_name = 'whale' @@ -165,7 +183,7 @@ def test_deserialize_mammal(self): 'className': class_name } response = self.__response(data) - deserialized = _response_for_200.deserialize(response, self.configuration) + deserialized = ResponseFor200.deserialize(response, self.configuration) body = deserialized.body self.assertTrue(isinstance(body, whale.Whale)) self.assertEqual(bool(body['hasBaleen']), has_baleen) @@ -180,7 +198,7 @@ def test_deserialize_mammal(self): 'className': class_name } response = self.__response(data) - deserialized = _response_for_200.deserialize(response, self.configuration) + deserialized = ResponseFor200.deserialize(response, self.configuration) body = deserialized.body self.assertTrue(isinstance(body, zebra.Zebra)) self.assertEqual(body['type'], zebra_type) @@ -190,17 +208,23 @@ def test_deserialize_float_value(self): """ Deserialize floating point values. """ - from petstore_api.model import banana - _response_for_200 = api_client.OpenApiResponse( + from petstore_api.components.schema import banana + class ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: banana.Banana + headers: schemas.Unset + + class ResponseFor200(api_client.OpenApiResponse): + response_cls=ApiResponse content={ self.json_content_type: api_client.MediaType(schema=banana.Banana), - }, - ) + } + data = { 'lengthCm': 3.1415 } response = self.__response(data) - deserialized = _response_for_200.deserialize(response, self.configuration) + deserialized = ResponseFor200.deserialize(response, self.configuration) body = deserialized.body self.assertTrue(isinstance(body, banana.Banana)) self.assertTrue(isinstance(body.lengthCm, Decimal)) @@ -215,7 +239,7 @@ def test_deserialize_float_value(self): 'lengthCm': 3 } response = self.__response(data) - deserialized = _response_for_200.deserialize(response, self.configuration) + deserialized = ResponseFor200.deserialize(response, self.configuration) body = deserialized.body self.assertTrue(isinstance(body, banana.Banana)) self.assertTrue(isinstance(body.lengthCm, Decimal)) @@ -226,17 +250,23 @@ def test_deserialize_fruit_null_value(self): deserialize fruit with null value. fruitReq is a oneOf composed schema model with discriminator, including 'null' type. """ - from petstore_api.model import fruit_req - _response_for_200 = api_client.OpenApiResponse( + from petstore_api.components.schema import fruit_req + class ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: fruit_req.FruitReq + headers: schemas.Unset + + class ResponseFor200(api_client.OpenApiResponse): + response_cls=ApiResponse content={ self.json_content_type: api_client.MediaType(schema=fruit_req.FruitReq), - }, - ) + } + data = None response = self.__response(data) - deserialized = _response_for_200.deserialize(response, self.configuration) + deserialized = ResponseFor200.deserialize(response, self.configuration) self.assertTrue(isinstance(deserialized.body, fruit_req.FruitReq)) - self.assertTrue(isinstance(deserialized.body, NoneClass)) + self.assertTrue(isinstance(deserialized.body, schemas.NoneClass)) def test_deserialize_with_additional_properties(self): """ @@ -251,7 +281,7 @@ def test_deserialize_with_additional_properties(self): # The additionalProperties keyword is used to control the handling of extra stuff, # that is, properties whose names are not listed in the properties keyword. # By default any additional properties are allowed. - from petstore_api.model import dog, mammal, zebra, banana_req + from petstore_api.components.schema import dog, mammal, zebra, banana_req data = { 'className': 'Dog', 'color': 'brown', @@ -261,12 +291,18 @@ def test_deserialize_with_additional_properties(self): 'size': 'medium', } response = self.__response(data) - _response_for_200 = api_client.OpenApiResponse( + class ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: dog.Dog + headers: schemas.Unset + + class ResponseFor200(api_client.OpenApiResponse): + response_cls=ApiResponse content={ self.json_content_type: api_client.MediaType(schema=dog.Dog), - }, - ) - deserialized = _response_for_200.deserialize(response, self.configuration) + } + + deserialized = ResponseFor200.deserialize(response, self.configuration) body = deserialized.body self.assertTrue(isinstance(body, dog.Dog)) self.assertEqual(body['className'], 'Dog') @@ -288,12 +324,18 @@ def test_deserialize_with_additional_properties(self): 'p2': ['a', 'b', 123], } response = self.__response(data) - _response_for_200 = api_client.OpenApiResponse( + class ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: mammal.Mammal + headers: schemas.Unset + + class ResponseFor200(api_client.OpenApiResponse): + response_cls=ApiResponse content={ self.json_content_type: api_client.MediaType(schema=mammal.Mammal), - }, - ) - deserialized = _response_for_200.deserialize(response, self.configuration) + } + + deserialized = ResponseFor200.deserialize(response, self.configuration) body = deserialized.body self.assertTrue(isinstance(body, zebra.Zebra)) self.assertEqual(body['className'], 'zebra') @@ -302,14 +344,19 @@ def test_deserialize_with_additional_properties(self): # The 'bananaReq' schema disallows additional properties by explicitly setting # additionalProperties: false - _response_for_200 = api_client.OpenApiResponse( + class ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: banana_req.BananaReq + headers: schemas.Unset + + class ResponseFor200(api_client.OpenApiResponse): + response_cls=ApiResponse content={ self.json_content_type: api_client.MediaType(schema=banana_req.BananaReq), - }, - ) - with self.assertRaisesRegex( - petstore_api.exceptions.ApiTypeError, - r"BananaReq was passed 1 invalid argument: \['unknown-group'\]" + } + + with self.assertRaises( + petstore_api.exceptions.ApiValueError ): data = { 'lengthCm': 21.2, @@ -319,19 +366,25 @@ def test_deserialize_with_additional_properties(self): 'unknown-group': 'abc', } response = self.__response(data) - _response_for_200.deserialize(response, self.configuration) + ResponseFor200.deserialize(response, self.configuration) def test_deserialize_with_additional_properties_and_reference(self): """ Deserialize data with schemas that has the additionalProperties keyword and the schema is specified as a reference ($ref). """ - from petstore_api.model import drawing - _response_for_200 = api_client.OpenApiResponse( + from petstore_api.components.schema import drawing + class ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: drawing.Drawing + headers: schemas.Unset + + class ResponseFor200(api_client.OpenApiResponse): + response_cls=ApiResponse content={ self.json_content_type: api_client.MediaType(schema=drawing.Drawing), - }, - ) + } + data = { 'mainShape': { 'shapeType': 'Triangle', @@ -353,36 +406,36 @@ def test_deserialize_with_additional_properties_and_reference(self): } } response = self.__response(data) - _response_for_200.deserialize(response, self.configuration) + ResponseFor200.deserialize(response, self.configuration) def test_deserialize_NumberWithValidations(self): - from petstore_api.model.number_with_validations import NumberWithValidations - from petstore_api.paths.fake_refs_number.post import _response_for_200 + from petstore_api.components.schema.number_with_validations import NumberWithValidations + from petstore_api.paths.fake_refs_number.post.responses import response_200 # make sure that an exception is thrown on an invalid type value with self.assertRaises(petstore_api.ApiTypeError): response = self.__response('test str') - _response_for_200.deserialize(response, self.configuration) + response_200.ResponseFor200.deserialize(response, self.configuration) # make sure that an exception is thrown on an invalid value with self.assertRaises(petstore_api.ApiValueError): response = self.__response(21.0) - _response_for_200.deserialize(response, self.configuration) + response_200.ResponseFor200.deserialize(response, self.configuration) # valid value works number_val = 11.0 response = self.__response(number_val) - response = _response_for_200.deserialize(response, self.configuration) + response = response_200.ResponseFor200.deserialize(response, self.configuration) self.assertTrue(isinstance(response.body, NumberWithValidations)) self.assertEqual(response.body, number_val) def test_array_of_enums(self): - from petstore_api.model.array_of_enums import ArrayOfEnums - from petstore_api.paths.fake_refs_array_of_enums.post import _response_for_200 - from petstore_api.model import string_enum + from petstore_api.components.schema.array_of_enums import ArrayOfEnums + from petstore_api.paths.fake_refs_array_of_enums.post.responses import response_200 + from petstore_api.components.schema import string_enum data = ["placed", None] response = self.__response(data) - deserialized = _response_for_200.deserialize(response, self.configuration) + deserialized = response_200.ResponseFor200.deserialize(response, self.configuration) assert isinstance(deserialized.body, ArrayOfEnums) expected_results = ArrayOfEnums([string_enum.StringEnum(v) for v in data]) assert expected_results == deserialized.body @@ -396,14 +449,20 @@ def test_multiple_of_deserialization(self): 'number': 65.0, 'float': 62.4, } - from petstore_api.model import format_test - _response_for_200 = api_client.OpenApiResponse( + from petstore_api.components.schema import format_test + class ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: format_test.FormatTest + headers: schemas.Unset + + class ResponseFor200(api_client.OpenApiResponse): + response_cls=ApiResponse content={ self.json_content_type: api_client.MediaType(schema=format_test.FormatTest), - }, - ) + } + response = self.__response(data) - deserialized = _response_for_200.deserialize(response, self.configuration) + deserialized = ResponseFor200.deserialize(response, self.configuration) self.assertTrue(isinstance(deserialized.body, format_test.FormatTest)) with self.assertRaisesRegex( @@ -419,11 +478,12 @@ def test_multiple_of_deserialization(self): 'float': 62.4, } response = self.__response(data) - _response_for_200.deserialize(response, self.configuration) + ResponseFor200.deserialize(response, self.configuration) # Disable JSON schema validation. No error should be raised during deserialization. - configuration = petstore_api.Configuration() - configuration.disabled_client_side_validations = "multipleOf" + configuration = schema_configuration.SchemaConfiguration( + disabled_json_schema_keywords={"multipleOf"} + ) data = { 'byte': '3', @@ -434,13 +494,14 @@ def test_multiple_of_deserialization(self): 'float': 62.4, } response = self.__response(data) - deserialized = _response_for_200.deserialize(response, configuration) + deserialized = ResponseFor200.deserialize(response, configuration) self.assertTrue(isinstance(deserialized.body, format_test.FormatTest)) # Disable JSON schema validation but for a different keyword. # An error should be raised during deserialization. - configuration = petstore_api.Configuration() - configuration.disabled_client_side_validations = "maxItems" + configuration = schema_configuration.SchemaConfiguration( + disabled_json_schema_keywords={"maxItems"} + ) with self.assertRaisesRegex( petstore_api.exceptions.ApiValueError, @@ -455,4 +516,4 @@ def test_multiple_of_deserialization(self): 'float': 62.4, } response = self.__response(data) - _response_for_200.deserialize(response, configuration) + ResponseFor200.deserialize(response, configuration) diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_discard_unknown_properties.py b/samples/openapi3/client/petstore/python/tests_manual/test_discard_unknown_properties.py index 97d850d56b6..2173d7cf7e8 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_discard_unknown_properties.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_discard_unknown_properties.py @@ -16,7 +16,7 @@ # import unittest # # import petstore_api -# from petstore_api.model import cat, dog, isosceles_triangle, banana_req +# from petstore_api.components.schema import cat, dog, isosceles_triangle, banana_req # from petstore_api import Configuration, signing # # from petstore_api.schemas import ( diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_drawing.py b/samples/openapi3/client/petstore/python/tests_manual/test_drawing.py index 2febc75e362..53f6208c3c9 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_drawing.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_drawing.py @@ -6,7 +6,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -15,9 +15,9 @@ import petstore_api from petstore_api.schemas import NoneClass -from petstore_api.model import shape -from petstore_api.model import shape_or_null -from petstore_api.model.drawing import Drawing +from petstore_api.components.schema import shape +from petstore_api.components.schema import shape_or_null +from petstore_api.components.schema.drawing import Drawing class TestDrawing(unittest.TestCase): @@ -38,7 +38,7 @@ def test_create_instances(self): shapeType="Triangle", triangleType="IsoscelesTriangle" ) - from petstore_api.model.isosceles_triangle import IsoscelesTriangle + from petstore_api.components.schema.isosceles_triangle import IsoscelesTriangle assert isinstance(inst, IsoscelesTriangle) def test_deserialize_oneof_reference(self): @@ -50,9 +50,9 @@ def test_deserialize_oneof_reference(self): shapeType="Triangle", triangleType="IsoscelesTriangle" ) - from petstore_api.model.isosceles_triangle import IsoscelesTriangle + from petstore_api.components.schema.isosceles_triangle import IsoscelesTriangle assert isinstance(isosceles_triangle, IsoscelesTriangle) - from petstore_api.model.equilateral_triangle import EquilateralTriangle + from petstore_api.components.schema.equilateral_triangle import EquilateralTriangle inst = Drawing( mainShape=isosceles_triangle, @@ -78,7 +78,7 @@ def test_deserialize_oneof_reference(self): assert isinstance(inst, Drawing) assert isinstance(inst["mainShape"], IsoscelesTriangle) self.assertEqual(len(inst["shapes"]), 4) - from petstore_api.model.complex_quadrilateral import ComplexQuadrilateral + from petstore_api.components.schema.complex_quadrilateral import ComplexQuadrilateral assert isinstance(inst["shapes"][0], EquilateralTriangle) assert isinstance(inst["shapes"][1], IsoscelesTriangle) assert isinstance(inst["shapes"][2], EquilateralTriangle) @@ -103,7 +103,7 @@ def test_deserialize_oneof_reference(self): Under the hood it is converted into a dict, and that dict payload does validate as a Shape, so this works """ - from petstore_api.model.triangle import Triangle + from petstore_api.components.schema.triangle import Triangle inst = Drawing( mainShape=isosceles_triangle, shapes=[ @@ -114,7 +114,7 @@ def test_deserialize_oneof_reference(self): ] ) self.assertEqual(len(inst["shapes"]), 1) - from petstore_api.model.triangle_interface import TriangleInterface + from petstore_api.components.schema.triangle_interface import TriangleInterface shapes = inst["shapes"] assert isinstance(shapes[0], shape.Shape) assert isinstance(shapes[0], Triangle) diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_extra_pool_config_options.py b/samples/openapi3/client/petstore/python/tests_manual/test_extra_pool_config_options.py index 5bf6b989ebe..9f846d75180 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_extra_pool_config_options.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_extra_pool_config_options.py @@ -33,7 +33,7 @@ def test_socket_options_get_passed_to_pool_manager(self): socket_options = ["extra", "socket", "options"] - config = petstore_api.Configuration(host="HOST") + config = petstore_api.ApiConfiguration() config.socket_options = socket_options with patch("petstore_api.rest.urllib3.PoolManager", StubPoolManager): @@ -48,7 +48,7 @@ def test_socket_options_get_passed_to_proxy_manager(self): socket_options = ["extra", "socket", "options"] - config = petstore_api.Configuration(host="HOST") + config = petstore_api.ApiConfiguration() config.socket_options = socket_options config.proxy = True diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_fake_api.py b/samples/openapi3/client/petstore/python/tests_manual/test_fake_api.py index cd990c9bc39..234ab9a8784 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_fake_api.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_fake_api.py @@ -6,10 +6,11 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ from email.mime import multipart from email.mime import nonmultipart +import http import io import sys import unittest @@ -21,6 +22,7 @@ from petstore_api import api_client, schemas, exceptions from petstore_api.apis.tags.fake_api import FakeApi # noqa: E501 from petstore_api.rest import RESTClientObject +from petstore_api.configurations import api_configuration from . import ApiTestMixin @@ -34,11 +36,11 @@ def __init__(self, keyname, *args, **kwargs): class TestFakeApi(ApiTestMixin): """FakeApi unit test stubs""" - configuration = petstore_api.Configuration() + configuration = api_configuration.ApiConfiguration() api = FakeApi(api_client=api_client.ApiClient(configuration=configuration)) def test_array_model(self): - from petstore_api.model import animal_farm, animal + from petstore_api.components.schema import animal_farm, animal # serialization + deserialization works with patch.object(RESTClientObject, 'request') as mock_request: @@ -66,7 +68,7 @@ def test_recursionlimit(self): assert sys.getrecursionlimit() == 1234 def test_array_of_enums(self): - from petstore_api.model import array_of_enums, string_enum + from petstore_api.components.schema import array_of_enums, string_enum # serialization + deserialization works with patch.object(RESTClientObject, 'request') as mock_request: @@ -88,7 +90,7 @@ def test_array_of_enums(self): assert api_response.body == body def test_number_with_validations(self): - from petstore_api.model import number_with_validations + from petstore_api.components.schema import number_with_validations # serialization + deserialization works with patch.object(RESTClientObject, 'request') as mock_request: @@ -109,7 +111,7 @@ def test_number_with_validations(self): assert api_response.body == value def test_composed_one_of_different_types(self): - from petstore_api.model import composed_one_of_different_types + from petstore_api.components.schema import composed_one_of_different_types # serialization + deserialization works number = composed_one_of_different_types.ComposedOneOfDifferentTypes(10.0) @@ -177,7 +179,7 @@ def test_string(self): assert api_response.body == value_simple def test_string_enum(self): - from petstore_api.model import string_enum + from petstore_api.components.schema import string_enum # serialization + deserialization works with patch.object(RESTClientObject, 'request') as mock_request: value = "placed" @@ -198,7 +200,7 @@ def test_string_enum(self): def test_mammal(self): # serialization + deserialization works - from petstore_api.model.mammal import Mammal + from petstore_api.components.schema.mammal import Mammal with patch.object(RESTClientObject, 'request') as mock_request: body = Mammal(className="BasquePig") value_simple = dict(className='BasquePig') @@ -225,7 +227,7 @@ def test_missing_or_unset_required_body(self): self.api.mammal(body=schemas.unset) def test_missing_or_unset_required_query_parameter(self): - from petstore_api.model.user import User + from petstore_api.components.schema.user import User user = User({}) # missing required query param with self.assertRaises(petstore_api.ApiTypeError): @@ -235,7 +237,7 @@ def test_missing_or_unset_required_query_parameter(self): self.api.body_with_query_params(body=schemas.unset, query_params=dict(query=schemas.unset)) def test_body_with_query_params(self): - from petstore_api.model import user + from petstore_api.components.schema import user with patch.object(RESTClientObject, 'request') as mock_request: value_simple = dict( @@ -261,7 +263,7 @@ def test_body_with_query_params(self): accept_content_type=None ) - assert isinstance(api_response.body, api_client.Unset) + assert isinstance(api_response.body, schemas.Unset) assert api_response.response.status == 200 def test_upload_download_file_tx_bytes_and_file(self): @@ -282,6 +284,7 @@ def test_upload_download_file_tx_bytes_and_file(self): content_type='application/octet-stream' ) try: + # sending file works with patch.object(RESTClientObject, 'request') as mock_request: mock_request.return_value = mock_response api_response = self.api.upload_download_file(body=file1) @@ -301,7 +304,7 @@ def test_upload_download_file_tx_bytes_and_file(self): finally: file1.close() - # sending just bytes works also + # sending bytes works with patch.object(RESTClientObject, 'request') as mock_request: mock_request.return_value = mock_response api_response = self.api.upload_download_file(body=file_bytes) @@ -314,6 +317,20 @@ def test_upload_download_file_tx_bytes_and_file(self): ) self.assertEqual(api_response.body, file_bytes) + @staticmethod + def __get_streamable_body(file: io.FileIO): + class FileMaker: + @staticmethod + def makefile(mode: str): + return file + streamable_body = http.client.HTTPResponse(sock=FileMaker) + # todo in the future have tests of chunked encoding and this like + # https://github.com/urllib3/urllib3/blob/main/test/test_response.py + streamable_body.chunked = 0 + streamable_body.length = 67 # length of file + return streamable_body + + def test_upload_download_file_rx_file(self): import os test_file_dir = os.path.realpath( @@ -326,21 +343,7 @@ def test_upload_download_file_rx_file(self): # passing in file1 as the response body simulates a streamed response file1 = open(file_path1, "rb") - - class StreamableBody: - """ - This class simulates http.client.HTTPResponse for a streamable response - """ - def __init__(self, file: io.BufferedReader): - self.fp = file - - def read(self, *args, **kwargs): - return self.fp.read(*args, **kwargs) - - def close(self): - self.fp.close() - - streamable_body = StreamableBody(file1) + streamable_body = self.__get_streamable_body(file1) mock_response = self.response( streamable_body, @@ -367,7 +370,7 @@ def close(self): os.unlink(api_response.body.name) file1 = open(file_path1, "rb") - streamable_body = StreamableBody(file1) + streamable_body = self.__get_streamable_body(file1) saved_file_name = "fileName.abc" """ @@ -405,7 +408,7 @@ def close(self): the url of response is used to extract the filename. """ file1 = open(file_path1, "rb") - streamable_body = StreamableBody(file1) + streamable_body = self.__get_streamable_body(file1) expected_filename = "the_file.ext" no_filename_mock_response = self.response( @@ -738,7 +741,7 @@ def test_json_with_charset(self): assert isinstance(api_response.body, schemas.AnyTypeSchema) assert isinstance(api_response.body, schemas.NoneClass) - assert api_response.body.is_none_oapg() + assert api_response.body.is_none_() def test_response_without_schema(self): # received response is not loaded into body because there is no deserialization schema defined @@ -794,8 +797,8 @@ def test_delete_endpoint_without_request_body(self): def test_json_patch(self): with patch.object(urllib3.PoolManager, 'request') as mock_request: - from petstore_api.model import json_patch_request - from petstore_api.model import json_patch_request_add_replace_test + from petstore_api.components.schema import json_patch_request + from petstore_api.components.schema import json_patch_request_add_replace_test mock_request.return_value = self.response("") body = json_patch_request.JSONPatchRequest( diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_format_test.py b/samples/openapi3/client/petstore/python/tests_manual/test_format_test.py index 960d0957517..c6fd74dbc92 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_format_test.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_format_test.py @@ -6,7 +6,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -17,7 +17,7 @@ import frozendict import petstore_api -from petstore_api.model.format_test import FormatTest +from petstore_api.components.schema.format_test import FormatTest from petstore_api.schemas import BinarySchema, BytesSchema, Singleton @@ -103,7 +103,7 @@ def test_FormatTest(self): model = FormatTest(noneProp=None, **required_args) assert isinstance(model["noneProp"], Singleton) self.assertFalse(model["noneProp"]) - self.assertTrue(model["noneProp"].is_none_oapg()) + self.assertTrue(model["noneProp"].is_none_()) # binary check model = FormatTest(binary=b'123', **required_args) diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_fruit.py b/samples/openapi3/client/petstore/python/tests_manual/test_fruit.py index 6f1a2265553..3ecfc91d7fb 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_fruit.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_fruit.py @@ -6,15 +6,15 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest import petstore_api -from petstore_api.model import apple -from petstore_api.model import banana -from petstore_api.model.fruit import Fruit +from petstore_api.components.schema import apple +from petstore_api.components.schema import banana +from petstore_api.components.schema.fruit import Fruit from petstore_api import schemas @@ -51,16 +51,7 @@ def testFruit(self): # with a key with self.assertRaises(KeyError): assert fruit['cultivar'] - assert fruit.get_item_oapg('cultivar') is schemas.unset - - # make sure that the ModelComposed class properties are correct - self.assertEqual( - Fruit.MetaOapg.one_of(), - [ - apple.Apple, - banana.Banana, - ], - ) + assert fruit.get_item_('cultivar') is schemas.unset """ including extra parameters does not raise an exception @@ -73,7 +64,7 @@ def testFruit(self): additional_date='2021-01-02', ) - fruit = Fruit.from_openapi_data_oapg(**kwargs) + fruit = Fruit.from_openapi_data_(kwargs) self.assertEqual( fruit, kwargs @@ -114,7 +105,7 @@ def testFruitNullValue(self): fruit = apple.Apple(None) assert isinstance(fruit, schemas.Singleton) assert isinstance(fruit, apple.Apple) - assert fruit.is_none_oapg() is True + assert fruit.is_none_() is True # 'banana' is not nullable. # TODO cast this into ApiTypeError? @@ -127,7 +118,7 @@ def testFruitNullValue(self): assert isinstance(fruit, schemas.Singleton) assert isinstance(fruit, apple.Apple) assert isinstance(fruit, Fruit) - assert fruit.is_none_oapg() is True + assert fruit.is_none_() is True if __name__ == '__main__': diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_fruit_req.py b/samples/openapi3/client/petstore/python/tests_manual/test_fruit_req.py index bdabb193648..5b361209610 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_fruit_req.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_fruit_req.py @@ -6,16 +6,16 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest import petstore_api -from petstore_api.model import apple_req -from petstore_api.model import banana_req -from petstore_api.model.fruit_req import FruitReq +from petstore_api.components.schema import apple_req +from petstore_api.components.schema import banana_req +from petstore_api.components.schema.fruit_req import FruitReq from petstore_api import schemas @@ -60,7 +60,7 @@ def testFruitReq(self): fruit['cultivar'] with self.assertRaises(AttributeError): fruit.cultivar - assert fruit.get_item_oapg('cultivar') is schemas.unset + assert fruit.get_item_('cultivar') is schemas.unset # with getattr self.assertEqual(getattr(fruit, 'cultivar', 'some value'), 'some value') @@ -68,16 +68,6 @@ def testFruitReq(self): with self.assertRaises(AttributeError): getattr(fruit, 'cultivar') - # make sure that the ModelComposed class properties are correct - self.assertEqual( - FruitReq.MetaOapg.one_of(), - [ - schemas.NoneSchema, - apple_req.AppleReq, - banana_req.BananaReq, - ], - ) - # including extra parameters raises an exception with self.assertRaises(petstore_api.ApiValueError): FruitReq( @@ -113,7 +103,7 @@ def testFruitReq(self): assert isinstance(fruit, schemas.Singleton) assert isinstance(fruit, FruitReq) assert isinstance(fruit, schemas.NoneSchema) - assert fruit.is_none_oapg() is True + assert fruit.is_none_() is True if __name__ == '__main__': diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_gm_fruit.py b/samples/openapi3/client/petstore/python/tests_manual/test_gm_fruit.py index ad650460a4c..cea93b716f9 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_gm_fruit.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_gm_fruit.py @@ -6,7 +6,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -14,9 +14,9 @@ import frozendict -from petstore_api.model import apple -from petstore_api.model import banana -from petstore_api.model.gm_fruit import GmFruit +from petstore_api.components.schema import apple +from petstore_api.components.schema import banana +from petstore_api.components.schema.gm_fruit import GmFruit from petstore_api import schemas class TestGmFruit(unittest.TestCase): @@ -60,23 +60,14 @@ def testGmFruit(self): fruit["origin"] with self.assertRaises(AttributeError): fruit.origin - assert fruit.get_item_oapg("origin") is schemas.unset + assert fruit.get_item_("origin") is schemas.unset with self.assertRaises(KeyError): fruit['unknown_variable'] - assert fruit.get_item_oapg("unknown_variable") is schemas.unset + assert fruit.get_item_("unknown_variable") is schemas.unset # with getattr self.assertTrue(getattr(fruit, 'origin', 'some value'), 'some value') - # make sure that the ModelComposed class properties are correct - self.assertEqual( - GmFruit.MetaOapg.any_of(), - [ - apple.Apple, - banana.Banana, - ], - ) - # including extra parameters works GmFruit( color=color, diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_http_signature.py b/samples/openapi3/client/petstore/python/tests_manual/test_http_signature.py index 1db56c65dd2..a410083b308 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_http_signature.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_http_signature.py @@ -26,7 +26,7 @@ # from Crypto.Signature import pkcs1_15, pss, DSS # # import petstore_api -# from petstore_api.model import category, tag, pet +# from petstore_api.components.schema import category, tag, pet # from petstore_api.apis.tags.pet_api import PetApi # from petstore_api import Configuration, signing # from petstore_api.rest import ( diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_integer_enum_one_value.py b/samples/openapi3/client/petstore/python/tests_manual/test_integer_enum_one_value.py index a5d92cd0833..17ee8aa6e88 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_integer_enum_one_value.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_integer_enum_one_value.py @@ -6,7 +6,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -14,7 +14,7 @@ import unittest import petstore_api -from petstore_api.model.integer_enum_one_value import IntegerEnumOneValue +from petstore_api.components.schema.integer_enum_one_value import IntegerEnumOneValue class TestIntegerEnumOneValue(unittest.TestCase): diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_json_encoder.py b/samples/openapi3/client/petstore/python/tests_manual/test_json_encoder.py index d6cbdfa3757..79ba53badd7 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_json_encoder.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_json_encoder.py @@ -6,7 +6,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ from datetime import date @@ -28,7 +28,7 @@ def test_receive_encode_str_types(self): schemas.DateTimeSchema: '2020-01-01T00:00:00' } for schema, value in schema_to_value.items(): - inst = schema.from_openapi_data_oapg(value) + inst = schema.from_openapi_data_(value) assert value == self.serializer.default(inst) def test_receive_encode_numeric_types(self): @@ -41,7 +41,7 @@ def test_receive_encode_numeric_types(self): 7.14: schemas.NumberSchema, } for value, schema in value_to_schema.items(): - inst = schema.from_openapi_data_oapg(value) + inst = schema.from_openapi_data_(value) pre_serialize_value = self.serializer.default(inst) assert value == pre_serialize_value and type(value) == type(pre_serialize_value) diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_mammal.py b/samples/openapi3/client/petstore/python/tests_manual/test_mammal.py index 975b02e0154..63fca5e4d50 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_mammal.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_mammal.py @@ -6,7 +6,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -14,7 +14,7 @@ import unittest import petstore_api -from petstore_api.model.mammal import Mammal +from petstore_api.components.schema.mammal import Mammal class TestMammal(unittest.TestCase): @@ -31,22 +31,22 @@ def testMammal(self): # tests that we can make a BasquePig by traveling through discriminator in Pig m = Mammal(className="BasquePig") - from petstore_api.model import pig - from petstore_api.model import basque_pig + from petstore_api.components.schema import pig + from petstore_api.components.schema import basque_pig assert isinstance(m, Mammal) assert isinstance(m, basque_pig.BasquePig) assert isinstance(m, pig.Pig) # can make a Whale m = Mammal(className="whale") - from petstore_api.model import whale + from petstore_api.components.schema import whale assert isinstance(m, whale.Whale) # can use the enum value - m = Mammal(className=whale.Whale.MetaOapg.properties.className.WHALE) + m = Mammal(className=whale.Whale.Schema_.Properties.ClassName.WHALE) assert isinstance(m, whale.Whale) - from petstore_api.model import zebra + from petstore_api.components.schema import zebra m = Mammal(className='zebra') assert isinstance(m, zebra.Zebra) diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_money.py b/samples/openapi3/client/petstore/python/tests_manual/test_money.py index 060132ef40b..20f08811b61 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_money.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_money.py @@ -6,12 +6,12 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import decimal import unittest -from petstore_api.model.money import Money +from petstore_api.components.schema.money import Money class TestMoney(unittest.TestCase): @@ -23,7 +23,7 @@ def test_Money(self): currency='usd', amount='10.99' ) - self.assertEqual(price.amount.as_decimal_oapg, decimal.Decimal('10.99')) + self.assertEqual(price.amount.as_decimal_, decimal.Decimal('10.99')) self.assertEqual( price, dict(currency='usd', amount='10.99') diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_no_additional_properties.py b/samples/openapi3/client/petstore/python/tests_manual/test_no_additional_properties.py index 723f32201bd..a387dc6cfd3 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_no_additional_properties.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_no_additional_properties.py @@ -6,13 +6,13 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import decimal import unittest -from petstore_api.model.no_additional_properties import NoAdditionalProperties +from petstore_api.components.schema.no_additional_properties import NoAdditionalProperties from petstore_api import schemas class TestNoAdditionalProperties(unittest.TestCase): @@ -39,7 +39,7 @@ def testNoAdditionalProperties(self): inst.petId with self.assertRaises(KeyError): inst["petId"] - assert inst.get_item_oapg("petId") is schemas.unset + assert inst.get_item_("petId") is schemas.unset # works with required + optional inst = NoAdditionalProperties(id=1, petId=2) diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_nullable_string.py b/samples/openapi3/client/petstore/python/tests_manual/test_nullable_string.py index 2b2616fce95..72835b43b38 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_nullable_string.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_nullable_string.py @@ -6,14 +6,14 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest import petstore_api -from petstore_api.model.nullable_string import NullableString +from petstore_api.components.schema.nullable_string import NullableString from petstore_api.schemas import Schema, Singleton @@ -32,11 +32,11 @@ def testNullableString(self): assert isinstance(inst, Singleton) assert isinstance(inst, NullableString) assert isinstance(inst, Schema) - assert inst.is_none_oapg() is True + assert inst.is_none_() is True assert repr(inst) == '' inst = NullableString('approved') - assert inst.is_none_oapg() is False + assert inst.is_none_() is False assert isinstance(inst, NullableString) assert isinstance(inst, Schema) assert isinstance(inst, str) diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_number_with_validations.py b/samples/openapi3/client/petstore/python/tests_manual/test_number_with_validations.py index 5cf1dfaa9c5..ee643e52401 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_number_with_validations.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_number_with_validations.py @@ -6,7 +6,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -14,7 +14,7 @@ import unittest import petstore_api -from petstore_api.model.number_with_validations import NumberWithValidations +from petstore_api.components.schema.number_with_validations import NumberWithValidations class TestNumberWithValidations(unittest.TestCase): diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_object_model_with_arg_and_args_properties.py b/samples/openapi3/client/petstore/python/tests_manual/test_object_model_with_arg_and_args_properties.py index f5fc6c354dd..56a90f9a500 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_object_model_with_arg_and_args_properties.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_object_model_with_arg_and_args_properties.py @@ -6,13 +6,13 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest from petstore_api import schemas, exceptions -from petstore_api.model.object_model_with_arg_and_args_properties import ObjectModelWithArgAndArgsProperties +from petstore_api.components.schema.object_model_with_arg_and_args_properties import ObjectModelWithArgAndArgsProperties class TestObjectModelWithArgAndArgsProperties(unittest.TestCase): @@ -24,13 +24,13 @@ def test_ObjectModelWithArgAndArgsProperties(self): self.assertTrue( isinstance( model["arg"], - ObjectModelWithArgAndArgsProperties.MetaOapg.properties.arg + ObjectModelWithArgAndArgsProperties.Schema_.Properties.Arg ) ) self.assertTrue( isinstance( model["args"], - ObjectModelWithArgAndArgsProperties.MetaOapg.properties.args + ObjectModelWithArgAndArgsProperties.Schema_.Properties.Args ) ) self.assertTrue(isinstance(model["arg"], schemas.StrSchema)) diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_object_model_with_ref_props.py b/samples/openapi3/client/petstore/python/tests_manual/test_object_model_with_ref_props.py index 42fc674cd2d..af1189068f4 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_object_model_with_ref_props.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_object_model_with_ref_props.py @@ -6,7 +6,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -14,8 +14,8 @@ import frozendict from petstore_api.schemas import BoolClass -from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps -from petstore_api.model.number_with_validations import NumberWithValidations +from petstore_api.components.schema.object_model_with_ref_props import ObjectModelWithRefProps +from petstore_api.components.schema.number_with_validations import NumberWithValidations class TestObjectModelWithRefProps(unittest.TestCase): @@ -36,9 +36,9 @@ def testObjectModelWithRefProps(self): assert inst["myNumber"] == 15.0 assert isinstance(inst["myNumber"], NumberWithValidations) assert inst["myString"] == 'a' - assert isinstance(inst["myString"], ObjectModelWithRefProps.MetaOapg.properties.myString) + assert isinstance(inst["myString"], ObjectModelWithRefProps.Schema_.Properties.my_string()) assert bool(inst["myBoolean"]) is True - assert isinstance(inst["myBoolean"], ObjectModelWithRefProps.MetaOapg.properties.myBoolean) + assert isinstance(inst["myBoolean"], ObjectModelWithRefProps.Schema_.Properties.my_boolean()) assert isinstance(inst["myBoolean"], BoolClass) diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_object_with_all_of_with_req_test_prop_from_unset_add_prop.py b/samples/openapi3/client/petstore/python/tests_manual/test_object_with_all_of_with_req_test_prop_from_unset_add_prop.py index 288ecddd294..3974f926724 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_object_with_all_of_with_req_test_prop_from_unset_add_prop.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_object_with_all_of_with_req_test_prop_from_unset_add_prop.py @@ -6,14 +6,13 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest import petstore_api -from petstore_api.model.object_with_all_of_with_req_test_prop_from_unset_add_prop import ObjectWithAllOfWithReqTestPropFromUnsetAddProp -from petstore_api import configuration +from petstore_api.components.schema.object_with_all_of_with_req_test_prop_from_unset_add_prop import ObjectWithAllOfWithReqTestPropFromUnsetAddProp class TestObjectWithAllOfWithReqTestPropFromUnsetAddProp(unittest.TestCase): diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_object_with_difficultly_named_props.py b/samples/openapi3/client/petstore/python/tests_manual/test_object_with_difficultly_named_props.py index 386304ecc67..29cc38f238a 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_object_with_difficultly_named_props.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_object_with_difficultly_named_props.py @@ -6,7 +6,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -14,7 +14,7 @@ import unittest import petstore_api -from petstore_api.model.object_with_difficultly_named_props import ObjectWithDifficultlyNamedProps +from petstore_api.components.schema.object_with_difficultly_named_props import ObjectWithDifficultlyNamedProps class TestObjectWithDifficultlyNamedProps(unittest.TestCase): diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_object_with_inline_composition_property.py b/samples/openapi3/client/petstore/python/tests_manual/test_object_with_inline_composition_property.py index 8105e51eab2..dfafdf42f19 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_object_with_inline_composition_property.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_object_with_inline_composition_property.py @@ -6,13 +6,13 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest from petstore_api import schemas, exceptions -from petstore_api.model.object_with_inline_composition_property import ObjectWithInlineCompositionProperty +from petstore_api.components.schema.object_with_inline_composition_property import ObjectWithInlineCompositionProperty class TestObjectWithInlineCompositionProperty(unittest.TestCase): @@ -24,7 +24,7 @@ def test_ObjectWithInlineCompositionProperty(self): self.assertTrue( isinstance( model["someProp"], - ObjectWithInlineCompositionProperty.MetaOapg.properties.someProp + ObjectWithInlineCompositionProperty.Schema_.Properties.SomeProp ) ) self.assertTrue(isinstance(model["someProp"], schemas.StrSchema)) diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_object_with_invalid_named_refed_properties.py b/samples/openapi3/client/petstore/python/tests_manual/test_object_with_invalid_named_refed_properties.py index fb8cf4a9885..ae7173aec09 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_object_with_invalid_named_refed_properties.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_object_with_invalid_named_refed_properties.py @@ -6,15 +6,15 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest import petstore_api -from petstore_api.model.object_with_invalid_named_refed_properties import ObjectWithInvalidNamedRefedProperties -from petstore_api.model.array_with_validations_in_items import ArrayWithValidationsInItems -from petstore_api.model.from_schema import FromSchema +from petstore_api.components.schema.object_with_invalid_named_refed_properties import ObjectWithInvalidNamedRefedProperties +from petstore_api.components.schema.array_with_validations_in_items import ArrayWithValidationsInItems +from petstore_api.components.schema.from_schema import FromSchema class TestObjectWithInvalidNamedRefedProperties(unittest.TestCase): @@ -38,8 +38,8 @@ def test_instantiation_success(self): '!reference': (4, 5) } assert inst == primitive_data - # from_openapi_data_oapg works - inst = ObjectWithInvalidNamedRefedProperties.from_openapi_data_oapg(primitive_data) + # from_openapi_data_ works + inst = ObjectWithInvalidNamedRefedProperties.from_openapi_data_(primitive_data) assert inst == primitive_data def test_omitting_required_properties_fails(self): @@ -60,13 +60,13 @@ def test_omitting_required_properties_fails(self): } ) with self.assertRaises(petstore_api.exceptions.ApiTypeError): - ObjectWithInvalidNamedRefedProperties.from_openapi_data_oapg( + ObjectWithInvalidNamedRefedProperties.from_openapi_data_( { 'from': {'data': 'abc', 'id': 1}, } ) with self.assertRaises(petstore_api.exceptions.ApiTypeError): - ObjectWithInvalidNamedRefedProperties.from_openapi_data_oapg( + ObjectWithInvalidNamedRefedProperties.from_openapi_data_( { '!reference': [4, 5] } diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_object_with_validations.py b/samples/openapi3/client/petstore/python/tests_manual/test_object_with_validations.py index 3a443dfa39a..8e1b48d0c83 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_object_with_validations.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_object_with_validations.py @@ -6,7 +6,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -14,7 +14,7 @@ import unittest import petstore_api -from petstore_api.model.object_with_validations import ObjectWithValidations +from petstore_api.components.schema.object_with_validations import ObjectWithValidations class TestObjectWithValidations(unittest.TestCase): diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_parameters.py b/samples/openapi3/client/petstore/python/tests_manual/test_parameters.py index 75ece111b8c..32b86279ef8 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_parameters.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_parameters.py @@ -6,7 +6,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest import collections @@ -17,85 +17,12 @@ class TestParameter(unittest.TestCase): - in_type_to_parameter_cls = { - api_client.ParameterInType.PATH: api_client.PathParameter, - api_client.ParameterInType.QUERY: api_client.QueryParameter, - api_client.ParameterInType.COOKIE: api_client.CookieParameter, - api_client.ParameterInType.HEADER: api_client.HeaderParameter, - } - invalid_inputs = ( True, False ) - def test_throws_exception_when_schema_and_content_omitted(self): - with self.assertRaises(ValueError): - api_client.QueryParameter( - name='' - ) - - def test_throws_exception_when_schema_and_content_input(self): - with self.assertRaises(ValueError): - schema = schemas.StrSchema - api_client.QueryParameter( - name='', - schema=schema, - content={'application/json': schema} - ) - - def test_succeeds_when_schema_or_content_input(self): - schema = schemas.StrSchema - api_client.QueryParameter( - name='', - schema=schema, - ) - api_client.QueryParameter( - name='', - content={'application/json': schema} - ) - - def test_succeeds_and_fails_for_style_and_in_type_combos(self): - style_to_in_type = { - api_client.ParameterStyle.MATRIX: {api_client.ParameterInType.PATH}, - api_client.ParameterStyle.LABEL: {api_client.ParameterInType.PATH}, - api_client.ParameterStyle.FORM: {api_client.ParameterInType.QUERY, api_client.ParameterInType.COOKIE}, - api_client.ParameterStyle.SIMPLE: {api_client.ParameterInType.PATH, api_client.ParameterInType.HEADER}, - api_client.ParameterStyle.SPACE_DELIMITED: {api_client.ParameterInType.QUERY}, - api_client.ParameterStyle.PIPE_DELIMITED: {api_client.ParameterInType.QUERY}, - api_client.ParameterStyle.DEEP_OBJECT: {api_client.ParameterInType.QUERY}, - } - schema = schemas.StrSchema - for style in style_to_in_type: - valid_in_types = style_to_in_type[style] - for valid_in_type in valid_in_types: - parameter_cls = self.in_type_to_parameter_cls[valid_in_type] - parameter_cls( - name='', - style=style, - schema=schema, - ) - invalid_in_types = {in_t for in_t in api_client.ParameterInType if in_t not in valid_in_types} - for invalid_in_type in invalid_in_types: - parameter_cls = self.in_type_to_parameter_cls[invalid_in_type] - with self.assertRaises(ValueError): - parameter_cls( - name='', - style=style, - schema=schema, - ) - - def test_throws_exception_when_invalid_name_input(self): - disallowed_names = {'Accept', 'Content-Type', 'Authorization'} - for disallowed_name in disallowed_names: - with self.assertRaises(ValueError): - api_client.HeaderParameter( - name=disallowed_name, - schema=schemas.StrSchema, - ) - def test_query_style_form_serialization(self): - name = 'color' test_cases = ( ParamTestCase( None, @@ -149,28 +76,27 @@ def test_query_style_form_serialization(self): ), ) for test_case in test_cases: - parameter = api_client.QueryParameter( - name=name, - style=api_client.ParameterStyle.FORM, - schema=schemas.AnyTypeSchema, - explode=test_case.explode, - ) - serialization = parameter.serialize(test_case.payload) + class Parameter(api_client.QueryParameter): + name='color' + style=api_client.ParameterStyle.FORM + schema=schemas.AnyTypeSchema + explode=test_case.explode + + serialization = Parameter.serialize(test_case.payload) self.assertEqual(serialization, test_case.expected_serialization) with self.assertRaises(exceptions.ApiValueError): for invalid_input in self.invalid_inputs: - for explode in (True, False): - parameter = api_client.QueryParameter( - name=name, - style=api_client.ParameterStyle.FORM, - schema=schemas.AnyTypeSchema, - explode=explode, - ) - parameter.serialize(invalid_input) + for explode_value in (True, False): + class Parameter(api_client.QueryParameter): + name='color' + style=api_client.ParameterStyle.FORM + schema=schemas.AnyTypeSchema + explode=explode_value + + Parameter.serialize(invalid_input) def test_cookie_style_form_serialization(self): - name = 'color' test_cases = ( ParamTestCase( None, @@ -224,28 +150,27 @@ def test_cookie_style_form_serialization(self): ), ) for test_case in test_cases: - parameter = api_client.CookieParameter( - name=name, - style=api_client.ParameterStyle.FORM, - schema=schemas.AnyTypeSchema, - explode=test_case.explode, - ) - serialization = parameter.serialize(test_case.payload) + class Parameter(api_client.CookieParameter): + name='color' + style=api_client.ParameterStyle.FORM + schema=schemas.AnyTypeSchema + explode=test_case.explode + + serialization = Parameter.serialize(test_case.payload) self.assertEqual(serialization, test_case.expected_serialization) with self.assertRaises(exceptions.ApiValueError): for invalid_input in self.invalid_inputs: - for explode in (True, False): - parameter = api_client.CookieParameter( - name=name, - style=api_client.ParameterStyle.FORM, - schema=schemas.AnyTypeSchema, - explode=explode, - ) - parameter.serialize(invalid_input) + for explode_value in (True, False): + class Parameter(api_client.CookieParameter): + name='color' + style=api_client.ParameterStyle.FORM + schema=schemas.AnyTypeSchema + explode=explode_value + + Parameter.serialize(invalid_input) def test_style_simple_in_path_serialization(self): - name = 'color' test_cases = ( ParamTestCase( None, @@ -299,28 +224,27 @@ def test_style_simple_in_path_serialization(self): ), ) for test_case in test_cases: - parameter = api_client.PathParameter( - name=name, - style=api_client.ParameterStyle.SIMPLE, - schema=schemas.AnyTypeSchema, - explode=test_case.explode, - ) - serialization = parameter.serialize(test_case.payload) + class Parameter(api_client.PathParameter): + name='color' + style=api_client.ParameterStyle.SIMPLE + schema=schemas.AnyTypeSchema + explode=test_case.explode + + serialization = Parameter.serialize(test_case.payload) self.assertEqual(serialization, test_case.expected_serialization) with self.assertRaises(exceptions.ApiValueError): for invalid_input in self.invalid_inputs: - for explode in (True, False): - parameter = api_client.PathParameter( - name=name, - style=api_client.ParameterStyle.SIMPLE, - schema=schemas.AnyTypeSchema, - explode=explode, - ) - parameter.serialize(invalid_input) + for explode_value in (True, False): + class Parameter(api_client.PathParameter): + name='color' + style=api_client.ParameterStyle.SIMPLE + schema=schemas.AnyTypeSchema + explode=explode_value + + Parameter.serialize(invalid_input) def test_style_simple_in_header_serialization(self): - name = 'color' test_cases = ( ParamTestCase( None, @@ -374,28 +298,27 @@ def test_style_simple_in_header_serialization(self): ), ) for test_case in test_cases: - parameter = api_client.HeaderParameter( - name=name, - style=api_client.ParameterStyle.SIMPLE, - schema=schemas.AnyTypeSchema, - explode=test_case.explode, - ) - serialization = parameter.serialize(test_case.payload) + class Parameter(api_client.HeaderParameter): + name='color' + style=api_client.ParameterStyle.SIMPLE + schema=schemas.AnyTypeSchema + explode=test_case.explode + + serialization = Parameter.serialize(test_case.payload) self.assertEqual(serialization, test_case.expected_serialization) with self.assertRaises(exceptions.ApiValueError): for invalid_input in self.invalid_inputs: - for explode in (True, False): - parameter = api_client.HeaderParameter( - name=name, - style=api_client.ParameterStyle.SIMPLE, - schema=schemas.AnyTypeSchema, - explode=explode, - ) - parameter.serialize(invalid_input) + for explode_value in (True, False): + class Parameter(api_client.HeaderParameter): + name='color' + style=api_client.ParameterStyle.SIMPLE + schema=schemas.AnyTypeSchema + explode=explode_value + + Parameter.serialize(invalid_input) def test_style_label_in_path_serialization(self): - name = 'color' test_cases = ( ParamTestCase( None, @@ -449,28 +372,27 @@ def test_style_label_in_path_serialization(self): ), ) for test_case in test_cases: - parameter = api_client.PathParameter( - name=name, - style=api_client.ParameterStyle.LABEL, - schema=schemas.AnyTypeSchema, - explode=test_case.explode, - ) - serialization = parameter.serialize(test_case.payload) + class Parameter(api_client.PathParameter): + name='color' + style=api_client.ParameterStyle.LABEL + schema=schemas.AnyTypeSchema + explode=test_case.explode + + serialization = Parameter.serialize(test_case.payload) self.assertEqual(serialization, test_case.expected_serialization) with self.assertRaises(exceptions.ApiValueError): for invalid_input in self.invalid_inputs: - for explode in (True, False): - parameter = api_client.PathParameter( - name=name, - style=api_client.ParameterStyle.LABEL, - schema=schemas.AnyTypeSchema, - explode=explode, - ) - parameter.serialize(invalid_input) + for explode_value in (True, False): + class Parameter(api_client.PathParameter): + name='color' + style=api_client.ParameterStyle.LABEL + schema=schemas.AnyTypeSchema + explode=explode_value + + Parameter.serialize(invalid_input) def test_style_matrix_in_path_serialization(self): - name = 'color' test_cases = ( ParamTestCase( None, @@ -524,28 +446,27 @@ def test_style_matrix_in_path_serialization(self): ), ) for test_case in test_cases: - parameter = api_client.PathParameter( - name=name, - style=api_client.ParameterStyle.MATRIX, - schema=schemas.AnyTypeSchema, - explode=test_case.explode, - ) - serialization = parameter.serialize(test_case.payload) + class Parameter(api_client.PathParameter): + name='color' + style=api_client.ParameterStyle.MATRIX + schema=schemas.AnyTypeSchema + explode=test_case.explode + + serialization = Parameter.serialize(test_case.payload) self.assertEqual(serialization, test_case.expected_serialization) with self.assertRaises(exceptions.ApiValueError): for invalid_input in self.invalid_inputs: - for explode in (True, False): - parameter = api_client.PathParameter( - name=name, - style=api_client.ParameterStyle.MATRIX, - schema=schemas.AnyTypeSchema, - explode=explode, - ) - parameter.serialize(invalid_input) + for explode_value in (True, False): + class Parameter(api_client.PathParameter): + name='color' + style=api_client.ParameterStyle.MATRIX + schema=schemas.AnyTypeSchema + explode=explode_value + + Parameter.serialize(invalid_input) def test_style_space_delimited_serialization(self): - name = 'color' test_cases = ( ParamTestCase( None, @@ -589,28 +510,27 @@ def test_style_space_delimited_serialization(self): ), ) for test_case in test_cases: - parameter = api_client.QueryParameter( - name=name, - style=api_client.ParameterStyle.SPACE_DELIMITED, - schema=schemas.AnyTypeSchema, - explode=test_case.explode, - ) - serialization = parameter.serialize(test_case.payload) + class Parameter(api_client.QueryParameter): + name='color' + style=api_client.ParameterStyle.SPACE_DELIMITED + schema=schemas.AnyTypeSchema + explode=test_case.explode + + serialization = Parameter.serialize(test_case.payload) self.assertEqual(serialization, test_case.expected_serialization) with self.assertRaises(exceptions.ApiValueError): for invalid_input in self.invalid_inputs: - for explode in (True, False): - parameter = api_client.QueryParameter( - name=name, - style=api_client.ParameterStyle.SPACE_DELIMITED, - schema=schemas.AnyTypeSchema, - explode=explode, - ) - parameter.serialize(invalid_input) + for explode_value in (True, False): + class Parameter(api_client.QueryParameter): + name='color' + style=api_client.ParameterStyle.SPACE_DELIMITED + schema=schemas.AnyTypeSchema + explode=explode_value + + Parameter.serialize(invalid_input) def test_style_pipe_delimited_serialization(self): - name = 'color' test_cases = ( ParamTestCase( None, @@ -654,28 +574,27 @@ def test_style_pipe_delimited_serialization(self): ), ) for test_case in test_cases: - parameter = api_client.QueryParameter( - name=name, - style=api_client.ParameterStyle.PIPE_DELIMITED, - schema=schemas.AnyTypeSchema, - explode=test_case.explode, - ) - serialization = parameter.serialize(test_case.payload) + class Parameter(api_client.QueryParameter): + name='color' + style=api_client.ParameterStyle.PIPE_DELIMITED + schema=schemas.AnyTypeSchema + explode=test_case.explode + + serialization = Parameter.serialize(test_case.payload) self.assertEqual(serialization, test_case.expected_serialization) with self.assertRaises(exceptions.ApiValueError): for invalid_input in self.invalid_inputs: - for explode in (True, False): - parameter = api_client.QueryParameter( - name=name, - style=api_client.ParameterStyle.PIPE_DELIMITED, - schema=schemas.AnyTypeSchema, - explode=explode, - ) - parameter.serialize(invalid_input) + for explode_value in (True, False): + class Parameter(api_client.QueryParameter): + name='color' + style=api_client.ParameterStyle.PIPE_DELIMITED + schema=schemas.AnyTypeSchema + explode=explode_value + + Parameter.serialize(invalid_input) def test_path_params_no_style(self): - name = 'color' test_cases = ( ParamTestCase( None, @@ -719,23 +638,22 @@ def test_path_params_no_style(self): ), ) for test_case in test_cases: - parameter = api_client.PathParameter( - name=name, - schema=schemas.AnyTypeSchema, - ) - serialization = parameter.serialize(test_case.payload) + class Parameter(api_client.PathParameter): + name='color' + schema=schemas.AnyTypeSchema + + serialization = Parameter.serialize(test_case.payload) self.assertEqual(serialization, test_case.expected_serialization) with self.assertRaises(exceptions.ApiValueError): for invalid_input in self.invalid_inputs: - parameter = api_client.PathParameter( - name=name, - schema=schemas.AnyTypeSchema, - ) - parameter.serialize(invalid_input) + class Parameter(api_client.PathParameter): + name='color' + schema=schemas.AnyTypeSchema + + Parameter.serialize(invalid_input) def test_header_params_no_style(self): - name = 'color' test_cases = ( ParamTestCase( None, @@ -779,23 +697,22 @@ def test_header_params_no_style(self): ), ) for test_case in test_cases: - parameter = api_client.HeaderParameter( - name=name, - schema=schemas.AnyTypeSchema, - ) - serialization = parameter.serialize(test_case.payload) + class Parameter(api_client.HeaderParameter): + name='color' + schema=schemas.AnyTypeSchema + + serialization = Parameter.serialize(test_case.payload) self.assertEqual(serialization, test_case.expected_serialization) with self.assertRaises(exceptions.ApiValueError): for invalid_input in self.invalid_inputs: - parameter = api_client.HeaderParameter( - name=name, - schema=schemas.AnyTypeSchema, - ) - parameter.serialize(invalid_input) + class Parameter(api_client.HeaderParameter): + name='color' + schema=schemas.AnyTypeSchema + + Parameter.serialize(invalid_input) def test_query_params_no_style(self): - name = 'color' test_cases = ( ParamTestCase( None, @@ -839,23 +756,22 @@ def test_query_params_no_style(self): ), ) for test_case in test_cases: - parameter = api_client.QueryParameter( - name=name, - schema=schemas.AnyTypeSchema, - ) - serialization = parameter.serialize(test_case.payload) + class Parameter(api_client.QueryParameter): + name='color' + schema=schemas.AnyTypeSchema + + serialization = Parameter.serialize(test_case.payload) self.assertEqual(serialization, test_case.expected_serialization) with self.assertRaises(exceptions.ApiValueError): for invalid_input in self.invalid_inputs: - parameter = api_client.QueryParameter( - name=name, - schema=schemas.AnyTypeSchema, - ) - parameter.serialize(invalid_input) + class Parameter(api_client.QueryParameter): + name='color' + schema=schemas.AnyTypeSchema + + Parameter.serialize(invalid_input) def test_cookie_params_no_style(self): - name = 'color' test_cases = ( ParamTestCase( None, @@ -899,39 +815,22 @@ def test_cookie_params_no_style(self): ), ) for test_case in test_cases: - parameter = api_client.CookieParameter( - name=name, - schema=schemas.AnyTypeSchema, - ) - serialization = parameter.serialize(test_case.payload) + class Parameter(api_client.CookieParameter): + name='color' + schema=schemas.AnyTypeSchema + + serialization = Parameter.serialize(test_case.payload) self.assertEqual(serialization, test_case.expected_serialization) with self.assertRaises(exceptions.ApiValueError): for invalid_input in self.invalid_inputs: - parameter = api_client.CookieParameter( - name=name, - schema=schemas.AnyTypeSchema, - ) - parameter.serialize(invalid_input) - - def test_checks_content_lengths(self): - with self.assertRaises(ValueError): - api_client.QueryParameter( - name='', content={} - ) - with self.assertRaises(ValueError): - api_client.QueryParameter( - name='', - content={'application/json': schemas.AnyTypeSchema, 'text/plain': schemas.AnyTypeSchema} - ) - # valid length works - api_client.QueryParameter( - name='', - content={'application/json': schemas.AnyTypeSchema} - ) + class Parameter(api_client.CookieParameter): + name='color' + schema=schemas.AnyTypeSchema + + Parameter.serialize(invalid_input) def test_header_content_json_serialization(self): - name = 'color' test_cases = ( ParamTestCase( None, @@ -983,15 +882,19 @@ def test_header_content_json_serialization(self): ), ) for test_case in test_cases: - parameter = api_client.HeaderParameter( - name=name, - content={'application/json': schemas.AnyTypeSchema} - ) - serialization = parameter.serialize(test_case.payload) + class Parameter(api_client.HeaderParameter): + + + class __MediaType(api_client.MediaType): + schema = schemas.AnyTypeSchema + + name='color' + content={'application/json': __MediaType} + + serialization = Parameter.serialize(test_case.payload) self.assertEqual(serialization, test_case.expected_serialization) def test_query_content_json_serialization(self): - name = 'color' test_cases = ( ParamTestCase( None, @@ -1043,20 +946,30 @@ def test_query_content_json_serialization(self): ), ) for test_case in test_cases: - parameter = api_client.QueryParameter( - name=name, - content={'application/json': schemas.AnyTypeSchema} - ) - serialization = parameter.serialize(test_case.payload) + class Parameter(api_client.QueryParameter): + + + class __MediaType(api_client.MediaType): + schema = schemas.AnyTypeSchema + + name='color' + content={'application/json': __MediaType} + + serialization = Parameter.serialize(test_case.payload) self.assertEqual(serialization, test_case.expected_serialization) def test_throws_error_for_unimplemented_serialization(self): with self.assertRaises(NotImplementedError): - parameter = api_client.HeaderParameter( - name='color', - content={'text/plain': schemas.AnyTypeSchema} - ) - parameter.serialize(None) + class Parameter(api_client.HeaderParameter): + + + class __MediaType(api_client.MediaType): + schema = schemas.AnyTypeSchema + + name='color' + content={'text/plain': __MediaType} + + Parameter.serialize(None) if __name__ == '__main__': diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_parent_pet.py b/samples/openapi3/client/petstore/python/tests_manual/test_parent_pet.py index 171310075ab..f45984f4446 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_parent_pet.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_parent_pet.py @@ -6,7 +6,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -14,8 +14,8 @@ import unittest import petstore_api -from petstore_api.model.grandparent_animal import GrandparentAnimal -from petstore_api.model.parent_pet import ParentPet +from petstore_api.components.schema.grandparent_animal import GrandparentAnimal +from petstore_api.components.schema.parent_pet import ParentPet class TestParentPet(unittest.TestCase): diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_paths/test_fake/test_delete.py b/samples/openapi3/client/petstore/python/tests_manual/test_paths/test_fake/test_delete.py index 1a082a9b663..2f31e4ef57c 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_paths/test_fake/test_delete.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_paths/test_fake/test_delete.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -11,20 +11,24 @@ import urllib3 -from petstore_api.paths.fake import delete -from petstore_api import configuration, schemas, api_client +from petstore_api.paths.fake.delete import operation as delete +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration from ... import ApiTestMixin class TestFake(ApiTestMixin, unittest.TestCase): - used_configuration = configuration.Configuration( - access_token='someBearerToken' + security_scheme_info = api_configuration.SecuritySchemeInfo( + bearer_test=api_configuration.security_scheme_bearer_test.BearerTest( + access_token='someAccessToken' + ) ) + used_configuration = api_configuration.ApiConfiguration(security_scheme_info=security_scheme_info) used_api_client = api_client.ApiClient( configuration=used_configuration ) - api = delete.ApiFordelete(api_client=used_api_client) + api = delete.ApiForDelete(api_client=used_api_client) @patch.object(urllib3.PoolManager, 'request') def test_delete_uses_http_bearer_auth(self, mock_request): @@ -46,7 +50,7 @@ def test_delete_uses_http_bearer_auth(self, mock_request): content_type=None, accept_content_type=None, headers={ - 'Authorization': 'Bearer someBearerToken', + 'Authorization': 'Bearer someAccessToken', 'required_boolean_group': 'true' } ) diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_paths/test_fake/test_get.py b/samples/openapi3/client/petstore/python/tests_manual/test_paths/test_fake/test_get.py index 9c86896c4eb..6deda2d7391 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_paths/test_fake/test_get.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_paths/test_fake/test_get.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,8 +12,8 @@ import urllib3 import petstore_api -from petstore_api.paths.fake import get # noqa: E501 -from petstore_api import configuration, schemas, api_client +from petstore_api.paths.fake.get import operation as get # noqa: E501 +from petstore_api import schemas, api_client from ... import ApiTestMixin @@ -32,8 +32,9 @@ class TestFake(ApiTestMixin, unittest.TestCase): def test_passed_in_header_overrides_default(self, mock_request): mock_request.return_value = self.response(b'') - api = get.ApiForget(api_client=self.used_api_client) - api_response = api.get(header_params={'enum_header_string': '-efg'}) + api = get.ApiForGet(api_client=self.used_api_client) + header_params: get.RequestHeaderParameters.Params = {'enum_header_string': '-efg'} + api_response = api.get(header_params=header_params) self.assert_pool_manager_request_called_with( mock_request, f'http://petstore.swagger.io:80/v2/fake', @@ -53,7 +54,7 @@ def test_passed_in_header_overrides_default(self, mock_request): def test_default_header_used_when_no_header_params_input(self, mock_request): mock_request.return_value = self.response(b'') - api = get.ApiForget(api_client=self.used_api_client) + api = get.ApiForGet(api_client=self.used_api_client) api_response = api.get() self.assert_pool_manager_request_called_with( mock_request, @@ -78,18 +79,16 @@ def test_response_exception_info(self, mock_request): response_body_bytes = self.json_bytes(error_dict) mock_request.return_value = self.response(response_body_bytes, status=404, reason='404') - api = get.ApiForget() + api = get.ApiForGet() with self.assertRaises(petstore_api.ApiException) as cm: api_response = api.get() - exc: petstore_api.ApiException[get.ApiResponseFor404] = cm.exception + exc: petstore_api.ApiException[get.response_404.ResponseFor404] = cm.exception expected_status = 404 expected_reason = '404' self.assertEqual(exc.status, expected_status) self.assertEqual(exc.reason, expected_reason) - self.assertEqual(exc.body, response_body_bytes) expected_headers = {'content-type': 'application/json'} - self.assertEqual(exc.headers, expected_headers) self.assertEqual(exc.api_response.response.status, expected_status) self.assertEqual(exc.api_response.response.reason, expected_reason) self.assertEqual(exc.api_response.response.data, response_body_bytes) diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_paths/test_fake/test_post.py b/samples/openapi3/client/petstore/python/tests_manual/test_paths/test_fake/test_post.py index 290c8fc22f9..1fd732b25ea 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_paths/test_fake/test_post.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_paths/test_fake/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -11,21 +11,25 @@ import urllib3 -from petstore_api.paths.fake import post -from petstore_api import configuration, schemas, api_client +from petstore_api.paths.fake.post import operation as post +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration from ... import ApiTestMixin class TestFake(ApiTestMixin, unittest.TestCase): - used_configuration = configuration.Configuration( - username='demo', - password='p@55w0rd' + security_scheme_info = api_configuration.SecuritySchemeInfo( + http_basic_test = api_configuration.security_scheme_http_basic_test.HttpBasicTest( + user_id='demo', + password='p@55w0rd' + ) ) + used_configuration = api_configuration.ApiConfiguration(security_scheme_info=security_scheme_info) used_api_client = api_client.ApiClient( configuration=used_configuration ) - api = post.ApiForpost(api_client=used_api_client) + api = post.ApiForPost(api_client=used_api_client) @patch.object(urllib3.PoolManager, 'request') def test_post_uses_http_basic_auth(self, mock_request): diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_paths/test_fake_query_param_with_json_content_type/test_get.py b/samples/openapi3/client/petstore/python/tests_manual/test_paths/test_fake_query_param_with_json_content_type/test_get.py index 025a4eb2a8f..f30b9a23b6c 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_paths/test_fake_query_param_with_json_content_type/test_get.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_paths/test_fake_query_param_with_json_content_type/test_get.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import collections @@ -13,8 +13,8 @@ import urllib3 import petstore_api -from petstore_api.paths.fake_query_param_with_json_content_type import get # noqa: E501 -from petstore_api import configuration, schemas, api_client +from petstore_api.paths.fake_query_param_with_json_content_type.get import operation as get +from petstore_api import schemas, api_client from ... import ApiTestMixin, ParamTestCase @@ -27,7 +27,7 @@ class TestFakeQueryParamWithJsonContentType(ApiTestMixin, unittest.TestCase): @patch.object(urllib3.PoolManager, 'request') def test_get(self, mock_request): used_api_client = api_client.ApiClient() - api = get.ApiForget(api_client=used_api_client) + api = get.ApiForGet(api_client=used_api_client) response_json = {} body = self.json_bytes(response_json) diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_paths/test_fake_redirection/__init__.py b/samples/openapi3/client/petstore/python/tests_manual/test_paths/test_fake_redirection/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_paths/test_fake_redirection/test_get.py b/samples/openapi3/client/petstore/python/tests_manual/test_paths/test_fake_redirection/test_get.py new file mode 100644 index 00000000000..502c3e25228 --- /dev/null +++ b/samples/openapi3/client/petstore/python/tests_manual/test_paths/test_fake_redirection/test_get.py @@ -0,0 +1,72 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest +from unittest.mock import patch + +import urllib3 + +from petstore_api.paths.fake_redirection.get import operation as get # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration + +from ... import ApiTestMixin + + +class TestGet(ApiTestMixin, unittest.TestCase): + """ + Get unit test stubs + operation with redirection responses # noqa: E501 + """ + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = get.ApiForGet(api_client=used_api_client) # noqa: E501 + + @patch.object(urllib3.PoolManager, 'request') + def test_non_wildcard_response(self, mock_request): + mock_request.return_value = self.response(b'', status=303) + + api_response = self.api.get() + self.assert_pool_manager_request_called_with( + mock_request, + f'http://petstore.swagger.io:80/v2/fake/redirection', + body=None, + method='GET', + content_type=None, + accept_content_type=None, + ) + + assert isinstance(api_response, get.response_303.ResponseFor303.response_cls) + assert isinstance(api_response.response, urllib3.HTTPResponse) + assert isinstance(api_response.body, schemas.Unset) + assert isinstance(api_response.headers, schemas.Unset) + assert api_response.response.status == 303 + + @patch.object(urllib3.PoolManager, 'request') + def test_wildcard_response(self, mock_request): + mock_request.return_value = self.response(b'', status=308) + + api_response = self.api.get() + self.assert_pool_manager_request_called_with( + mock_request, + f'http://petstore.swagger.io:80/v2/fake/redirection', + body=None, + method='GET', + content_type=None, + accept_content_type=None, + ) + + assert isinstance(api_response, get.response_3xx.ResponseFor3XX.response_cls) + assert isinstance(api_response.response, urllib3.HTTPResponse) + assert isinstance(api_response.body, schemas.Unset) + assert isinstance(api_response.headers, schemas.Unset) + assert api_response.response.status == 308 + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_paths/test_fake_wild_card_responses/__init__.py b/samples/openapi3/client/petstore/python/tests_manual/test_paths/test_fake_wild_card_responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_paths/test_fake_wild_card_responses/test_get.py b/samples/openapi3/client/petstore/python/tests_manual/test_paths/test_fake_wild_card_responses/test_get.py new file mode 100644 index 00000000000..aacde704d87 --- /dev/null +++ b/samples/openapi3/client/petstore/python/tests_manual/test_paths/test_fake_wild_card_responses/test_get.py @@ -0,0 +1,81 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest +from unittest.mock import patch + +import urllib3 + +import petstore_api +from petstore_api.paths.fake_wild_card_responses.get import operation as get # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration + +from ... import ApiTestMixin + + +class TestGet(ApiTestMixin, unittest.TestCase): + """ + Get unit test stubs + operation with wildcard responses # noqa: E501 + """ + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = get.ApiForGet(api_client=used_api_client) # noqa: E501 + + response_status = 200 + response_body_schema = get.response_200.ResponseFor200.content["application/json"].schema + + @patch.object(urllib3.PoolManager, 'request') + def test_non_wildcard_response(self, mock_request): + response_json = {} + body = self.json_bytes(response_json) + mock_request.return_value = self.response(body, status=200) + + api_response = self.api.get() + self.assert_pool_manager_request_called_with( + mock_request, + f'http://petstore.swagger.io:80/v2/fake/wildCardResponses', + body=None, + method='GET', + content_type=None, + accept_content_type='application/json', + ) + + assert isinstance(api_response, get.response_200.ResponseFor200.response_cls) + assert isinstance(api_response.response, urllib3.HTTPResponse) + assert isinstance(api_response.body, get.response_200.ResponseFor200.content['application/json'].schema) + assert isinstance(api_response.headers, schemas.Unset) + assert api_response.response.status == 200 + + @patch.object(urllib3.PoolManager, 'request') + def test_wildcard_response(self, mock_request): + response_json = {} + body = self.json_bytes(response_json) + mock_request.return_value = self.response(body, status=202) + + api_response = self.api.get() + self.assert_pool_manager_request_called_with( + mock_request, + f'http://petstore.swagger.io:80/v2/fake/wildCardResponses', + body=None, + method='GET', + content_type=None, + accept_content_type='application/json', + ) + + assert isinstance(api_response, get.response_2xx.ResponseFor2XX.response_cls) + assert isinstance(api_response.response, urllib3.HTTPResponse) + assert isinstance(api_response.body, get.response_2xx.ResponseFor2XX.content['application/json'].schema) + assert isinstance(api_response.headers, schemas.Unset) + assert api_response.response.status == 202 + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_paths/test_pet_pet_id/test_get.py b/samples/openapi3/client/petstore/python/tests_manual/test_paths/test_pet_pet_id/test_get.py index 81cb92cd133..937618dcb05 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_paths/test_pet_pet_id/test_get.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_paths/test_pet_pet_id/test_get.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import json @@ -12,9 +12,10 @@ import urllib3 -from petstore_api.paths.pet_pet_id import get # noqa: E501 -from petstore_api import configuration, schemas, api_client -from petstore_api.model.pet import Pet +from petstore_api.paths.pet_pet_id.get import operation as get +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration +from petstore_api.components.schema.pet import Pet from ... import ApiTestMixin @@ -25,9 +26,14 @@ class TestPetPetId(ApiTestMixin, unittest.TestCase): Find pet by ID # noqa: E501 """ def test_get(self): - config_with_auth = configuration.Configuration(api_key={'api_key': 'someKey'}) + security_scheme_info = api_configuration.SecuritySchemeInfo( + api_key=api_configuration.security_scheme_api_key.ApiKey( + api_key='someKey' + ) + ) + config_with_auth = api_configuration.ApiConfiguration(security_scheme_info=security_scheme_info) used_api_client = api_client.ApiClient(configuration=config_with_auth) - api = get.ApiForget(api_client=used_api_client) + api = get.ApiForGet(api_client=used_api_client) with patch.object(urllib3.PoolManager, 'request') as mock_request: response_json = { diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_paths/test_pet_pet_id/test_post.py b/samples/openapi3/client/petstore/python/tests_manual/test_paths/test_pet_pet_id/test_post.py index dbfb77891de..663807e8f67 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_paths/test_pet_pet_id/test_post.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_paths/test_pet_pet_id/test_post.py @@ -3,7 +3,7 @@ """ - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest @@ -12,8 +12,9 @@ import urllib3 import petstore_api -from petstore_api.paths.pet_pet_id import post -from petstore_api import configuration, schemas, api_client +from petstore_api.paths.pet_pet_id.post import operation as post +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration from ... import ApiTestMixin @@ -25,8 +26,13 @@ class TestPetPetId(ApiTestMixin, unittest.TestCase): """ def test_post(self): - used_api_client = api_client.ApiClient() - api = post.ApiForpost(api_client=used_api_client) + security_scheme_info = api_configuration.SecuritySchemeInfo( + api_key=api_configuration.security_scheme_api_key.ApiKey(api_key='abcdefg') + ) + used_api_client = api_client.ApiClient( + configuration=api_configuration.ApiConfiguration(security_scheme_info=security_scheme_info) + ) + api = post.ApiForPost(api_client=used_api_client) with patch.object(urllib3.PoolManager, 'request') as mock_request: path_params = {'petId': 2345} @@ -46,7 +52,8 @@ def test_post(self): timeout=None, headers={ 'User-Agent': self.user_agent, - 'Content-Type': 'application/x-www-form-urlencoded' + 'Content-Type': 'application/x-www-form-urlencoded', + 'api_key': 'abcdefg' } ) assert isinstance(api_response.response, urllib3.HTTPResponse) diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_pet.py b/samples/openapi3/client/petstore/python/tests_manual/test_pet.py index 726a85c2d35..45c0e2ded1a 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_pet.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_pet.py @@ -6,14 +6,14 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import decimal import unittest -from petstore_api.model import pet -from petstore_api.model import category +from petstore_api.components.schema import pet +from petstore_api.components.schema import category class TesttPet(unittest.TestCase): diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_quadrilateral.py b/samples/openapi3/client/petstore/python/tests_manual/test_quadrilateral.py index dff97bc716a..ba042e060aa 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_quadrilateral.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_quadrilateral.py @@ -6,7 +6,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -14,9 +14,9 @@ import unittest import petstore_api -from petstore_api.model import complex_quadrilateral -from petstore_api.model import simple_quadrilateral -from petstore_api.model.quadrilateral import Quadrilateral +from petstore_api.components.schema import complex_quadrilateral +from petstore_api.components.schema import simple_quadrilateral +from petstore_api.components.schema.quadrilateral import Quadrilateral class TestQuadrilateral(unittest.TestCase): diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_request_body.py b/samples/openapi3/client/petstore/python/tests_manual/test_request_body.py index 14339c2e230..9c8ce81eece 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_request_body.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_request_body.py @@ -6,7 +6,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import collections @@ -19,13 +19,6 @@ class TestParameter(unittest.TestCase): - - def test_throws_exception_when_content_is_invalid_size(self): - with self.assertRaises(ValueError): - api_client.RequestBody( - content={} - ) - def test_content_json_serialization(self): payloads = [ None, @@ -42,10 +35,12 @@ def test_content_json_serialization(self): dict(R=100, G=200, B=150), ] for payload in payloads: - request_body = api_client.RequestBody( - content={'application/json': api_client.MediaType(schema=schemas.AnyTypeSchema)} - ) - serialization = request_body.serialize(payload, 'application/json') + class RequestBody(api_client.RequestBody): + content = { + 'application/json': api_client.MediaType(schema=schemas.AnyTypeSchema) + } + + serialization = RequestBody.serialize(payload, 'application/json') self.assertEqual( serialization, dict(body=json.dumps(payload, separators=(",", ":"), ensure_ascii=False).encode('utf-8')) @@ -62,10 +57,10 @@ def test_content_multipart_form_data_serialization(self): some_dict={}, some_bytes=b'abc' ) - request_body = api_client.RequestBody( + class RequestBody(api_client.RequestBody): content={'multipart/form-data': api_client.MediaType(schema=schemas.AnyTypeSchema)} - ) - serialization = request_body.serialize(payload, 'multipart/form-data') + + serialization = RequestBody.serialize(payload, 'multipart/form-data') self.assertEqual( serialization, dict( @@ -123,21 +118,21 @@ def test_content_multipart_form_data_serialization(self): ) def test_throws_error_for_nonexistant_content_type(self): - request_body = api_client.RequestBody( + class RequestBody(api_client.RequestBody): content={'application/json': api_client.MediaType(schema=schemas.AnyTypeSchema)} - ) + with self.assertRaises(KeyError): - request_body.serialize(None, 'abc/def') + RequestBody.serialize(None, 'abc/def') def test_throws_error_for_not_implemented_content_type(self): - request_body = api_client.RequestBody( + class RequestBody(api_client.RequestBody): content={ 'application/json': api_client.MediaType(schema=schemas.AnyTypeSchema), 'text/css': api_client.MediaType(schema=schemas.AnyTypeSchema) } - ) + with self.assertRaises(NotImplementedError): - request_body.serialize(None, 'text/css') + RequestBody.serialize(None, 'text/css') def test_application_x_www_form_urlencoded_serialization(self): payload = dict( @@ -149,16 +144,16 @@ def test_application_x_www_form_urlencoded_serialization(self): some_dict={}, ) content_type = 'application/x-www-form-urlencoded' - request_body = api_client.RequestBody( + class RequestBody(api_client.RequestBody): content={content_type: api_client.MediaType(schema=schemas.AnyTypeSchema)} - ) - serialization = request_body.serialize(payload, content_type) + + serialization = RequestBody.serialize(payload, content_type) self.assertEqual( serialization, dict(body='some_str=hi%20there&some_int=1&some_float=3.14') ) - serialization = request_body.serialize({}, content_type) + serialization = RequestBody.serialize({}, content_type) self.assertEqual( serialization, dict(body='') @@ -172,7 +167,7 @@ def test_application_x_www_form_urlencoded_serialization(self): ] for invalid_payload in invalid_payloads: with self.assertRaises(exceptions.ApiValueError): - request_body.serialize(invalid_payload, content_type) + RequestBody.serialize(invalid_payload, content_type) if __name__ == '__main__': diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_self_referencing_array_model.py b/samples/openapi3/client/petstore/python/tests_manual/test_self_referencing_array_model.py new file mode 100644 index 00000000000..cbd882e43c9 --- /dev/null +++ b/samples/openapi3/client/petstore/python/tests_manual/test_self_referencing_array_model.py @@ -0,0 +1,43 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.self_referencing_array_model import SelfReferencingArrayModel + + +class TestSelfReferencingArrayModel(unittest.TestCase): + """SelfReferencingArrayModel unit test stubs""" + def test_instantiation(self): + inst = SelfReferencingArrayModel([ + SelfReferencingArrayModel([]) + ]) + assert inst == ( + (), + ) + + invalid_type_args = [ + 1, + [ + 1, + ], + [ + [1] + ] + ] + # error when wrong type passed in + with self.assertRaises(petstore_api.ApiTypeError): + for invalid_type_arg in invalid_type_args: + SelfReferencingArrayModel(invalid_type_arg) + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_self_referencing_object_model.py b/samples/openapi3/client/petstore/python/tests_manual/test_self_referencing_object_model.py new file mode 100644 index 00000000000..4fe8834443f --- /dev/null +++ b/samples/openapi3/client/petstore/python/tests_manual/test_self_referencing_object_model.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest + +import petstore_api +from petstore_api.components.schema.self_referencing_object_model import SelfReferencingObjectModel + + +class TestSelfReferencingObjectModel(unittest.TestCase): + """SelfReferencingObjectModel unit test stubs""" + def test_instantiation(self): + inst = SelfReferencingObjectModel( + selfRef=SelfReferencingObjectModel({}), + someAddProp=SelfReferencingObjectModel({}) + ) + assert inst == { + 'selfRef': {}, + 'someAddProp': {} + } + + invalid_type_kwargs = [ + { + 'selfRef': 1, + }, + { + 'someAddProp': 1 + } + ] + # error when wrong type passed in + with self.assertRaises(petstore_api.ApiTypeError): + for invalid_type_kwarg in invalid_type_kwargs: + SelfReferencingObjectModel(**invalid_type_kwarg) + + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_shape.py b/samples/openapi3/client/petstore/python/tests_manual/test_shape.py index 80bab5b805b..220ac979c0d 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_shape.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_shape.py @@ -6,7 +6,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -17,14 +17,14 @@ import petstore_api from petstore_api.schemas import Singleton -from petstore_api.model.shape import Shape -from petstore_api.model import complex_quadrilateral -from petstore_api.model import simple_quadrilateral -from petstore_api.model import triangle -from petstore_api.model import triangle_interface -from petstore_api.model import equilateral_triangle -from petstore_api.model import isosceles_triangle -from petstore_api.model import scalene_triangle +from petstore_api.components.schema.shape import Shape +from petstore_api.components.schema import complex_quadrilateral +from petstore_api.components.schema import simple_quadrilateral +from petstore_api.components.schema import triangle +from petstore_api.components.schema import triangle_interface +from petstore_api.components.schema import equilateral_triangle +from petstore_api.components.schema import isosceles_triangle +from petstore_api.components.schema import scalene_triangle class TestShape(unittest.TestCase): diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_string_enum.py b/samples/openapi3/client/petstore/python/tests_manual/test_string_enum.py index 0485242b37e..a9e7f14f90d 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_string_enum.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_string_enum.py @@ -6,14 +6,14 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest import petstore_api -from petstore_api.model.string_enum import StringEnum +from petstore_api.components.schema.string_enum import StringEnum from petstore_api.schemas import Singleton, NoneClass @@ -48,8 +48,8 @@ def testStringEnum(self): assert StringEnum.PLACED == 'placed' assert StringEnum.APPROVED == 'approved' assert StringEnum.DELIVERED == 'delivered' - assert StringEnum.DOUBLE_QUOTE_WITH_NEWLINE == "double quote \n with newline" - assert StringEnum.MULTIPLE_LINES == "multiple\nlines" + assert StringEnum.DOUBLE_QUOTE_LINE_FEED_LF_WITH_NEWLINE == "double quote \n with newline" + assert StringEnum.MULTIPLE_LINE_FEED_LF_LINES == "multiple\nlines" assert StringEnum.SINGLE_QUOTED == "single quoted" diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_triangle.py b/samples/openapi3/client/petstore/python/tests_manual/test_triangle.py index 3d19a8d65fa..5cc16d943fb 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_triangle.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_triangle.py @@ -6,7 +6,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -14,11 +14,11 @@ import frozendict -from petstore_api.model.equilateral_triangle import EquilateralTriangle -from petstore_api.model.isosceles_triangle import IsoscelesTriangle -from petstore_api.model.scalene_triangle import ScaleneTriangle -from petstore_api.model.triangle import Triangle -from petstore_api.model.triangle_interface import TriangleInterface +from petstore_api.components.schema.equilateral_triangle import EquilateralTriangle +from petstore_api.components.schema.isosceles_triangle import IsoscelesTriangle +from petstore_api.components.schema.scalene_triangle import ScaleneTriangle +from petstore_api.components.schema.triangle import Triangle +from petstore_api.components.schema.triangle_interface import TriangleInterface class TestTriangle(unittest.TestCase): diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_user_api.py b/samples/openapi3/client/petstore/python/tests_manual/test_user_api.py index 5f52c56f5af..a97f607faac 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_user_api.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_user_api.py @@ -6,7 +6,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest from unittest.mock import patch @@ -15,13 +15,14 @@ from petstore_api import api_client from petstore_api.apis.tags.user_api import UserApi from petstore_api.rest import RESTClientObject +from petstore_api.configurations import api_configuration from . import ApiTestMixin class TestUserApi(ApiTestMixin): """UserApi unit test stubs""" - configuration = petstore_api.Configuration() + configuration = api_configuration.ApiConfiguration() api = UserApi(api_client=api_client.ApiClient(configuration=configuration)) def test_create_user(self): @@ -53,7 +54,7 @@ def test_delete_user(self): pass def test_get_user_by_name(self): - from petstore_api.model import user + from petstore_api.components.schema import user # serialization + deserialization works with patch.object(RESTClientObject, 'request') as mock_request: diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_uuid_string.py b/samples/openapi3/client/petstore/python/tests_manual/test_uuid_string.py index e8715b571a7..a5737ce9544 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_uuid_string.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_uuid_string.py @@ -6,13 +6,13 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest from petstore_api import schemas, exceptions -from petstore_api.model.uuid_string import UUIDString +from petstore_api.components.schema.uuid_string import UUIDString import uuid @@ -28,7 +28,7 @@ def test_UUIDString(self): self.assertTrue(isinstance(u, schemas.UUIDSchema)) self.assertTrue(isinstance(u, schemas.StrSchema)) self.assertTrue(isinstance(u, str)) - self.assertEqual(u.as_uuid_oapg, uuid.UUID(uuid_value)) + self.assertEqual(u.as_uuid_, uuid.UUID(uuid_value)) # passing in a uuid also works u = UUIDString(uuid.UUID(uuid_value)) @@ -37,7 +37,7 @@ def test_UUIDString(self): self.assertTrue(isinstance(u, schemas.UUIDSchema)) self.assertTrue(isinstance(u, schemas.StrSchema)) self.assertTrue(isinstance(u, str)) - self.assertEqual(u.as_uuid_oapg, uuid.UUID(uuid_value)) + self.assertEqual(u.as_uuid_, uuid.UUID(uuid_value)) # an invalid value does not work with self.assertRaises(exceptions.ApiValueError): diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_validate.py b/samples/openapi3/client/petstore/python/tests_manual/test_validate.py index 4a61f9c7f9e..263752aa38b 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_validate.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_validate.py @@ -6,23 +6,25 @@ import frozendict -from petstore_api.model.string_with_validation import StringWithValidation -from petstore_api.model.string_enum import StringEnum -from petstore_api.model.number_with_validations import NumberWithValidations -from petstore_api.model.array_holding_any_type import ArrayHoldingAnyType -from petstore_api.model.array_with_validations_in_items import ( +from petstore_api.components.schema.string_with_validation import StringWithValidation +from petstore_api.components.schema.string_enum import StringEnum +from petstore_api.components.schema.number_with_validations import NumberWithValidations +from petstore_api.components.schema.array_holding_any_type import ArrayHoldingAnyType +from petstore_api.components.schema.array_with_validations_in_items import ( ArrayWithValidationsInItems, ) -from petstore_api.model.foo import Foo -from petstore_api.model.animal import Animal -from petstore_api.model.dog import Dog -from petstore_api.model.boolean_enum import BooleanEnum -from petstore_api.model.pig import Pig -from petstore_api.model.danish_pig import DanishPig -from petstore_api.model.gm_fruit import GmFruit -from petstore_api.model.apple import Apple -from petstore_api.model.banana import Banana +from petstore_api.components.schema.foo import Foo +from petstore_api.components.schema.bar import Bar +from petstore_api.components.schema.animal import Animal +from petstore_api.components.schema.dog import Dog +from petstore_api.components.schema.boolean_enum import BooleanEnum +from petstore_api.components.schema.pig import Pig +from petstore_api.components.schema.danish_pig import DanishPig +from petstore_api.components.schema.gm_fruit import GmFruit +from petstore_api.components.schema.apple import Apple +from petstore_api.components.schema.banana import Banana from petstore_api import schemas +from petstore_api.configurations import schema_configuration from petstore_api.schemas import ( AnyTypeSchema, @@ -37,37 +39,37 @@ class TestValidateResults(unittest.TestCase): def test_str_validate(self): - vm = ValidationMetadata() - path_to_schemas = StringWithValidation._validate_oapg( + vm = ValidationMetadata(path_to_item=("args[0]",), configuration=schema_configuration.SchemaConfiguration()) + path_to_schemas = StringWithValidation._validate( "abcdefg", validation_metadata=vm ) assert path_to_schemas == {("args[0]",): {StringWithValidation, str}} def test_number_validate(self): - vm = ValidationMetadata() - path_to_schemas = NumberWithValidations._validate_oapg( + vm = ValidationMetadata(path_to_item=("args[0]",), configuration=schema_configuration.SchemaConfiguration()) + path_to_schemas = NumberWithValidations._validate( Decimal(11), validation_metadata=vm ) assert path_to_schemas == {("args[0]",): {NumberWithValidations, Decimal}} def test_str_enum_validate(self): - vm = ValidationMetadata() - path_to_schemas = StringEnum._validate_oapg("placed", validation_metadata=vm) + vm = ValidationMetadata(path_to_item=("args[0]",), configuration=schema_configuration.SchemaConfiguration()) + path_to_schemas = StringEnum._validate("placed", validation_metadata=vm) assert path_to_schemas == {("args[0]",): {str, StringEnum}} def test_nullable_enum_validate(self): - vm = ValidationMetadata() - path_to_schemas = StringEnum._validate_oapg(NoneClass.NONE, validation_metadata=vm) + vm = ValidationMetadata(path_to_item=("args[0]",), configuration=schema_configuration.SchemaConfiguration()) + path_to_schemas = StringEnum._validate(NoneClass.NONE, validation_metadata=vm) assert path_to_schemas == {("args[0]",): {NoneClass, StringEnum}} def test_empty_list_validate(self): - vm = ValidationMetadata() - path_to_schemas = ArrayHoldingAnyType._validate_oapg((), validation_metadata=vm) + vm = ValidationMetadata(path_to_item=("args[0]",), configuration=schema_configuration.SchemaConfiguration()) + path_to_schemas = ArrayHoldingAnyType._validate((), validation_metadata=vm) assert path_to_schemas == {("args[0]",): {ArrayHoldingAnyType, tuple}} def test_list_validate(self): - vm = ValidationMetadata() - path_to_schemas = ArrayHoldingAnyType._validate_oapg( + vm = ValidationMetadata(path_to_item=("args[0]",), configuration=schema_configuration.SchemaConfiguration()) + path_to_schemas = ArrayHoldingAnyType._validate( (Decimal(1), "a"), validation_metadata=vm ) assert path_to_schemas == { @@ -77,63 +79,62 @@ def test_list_validate(self): } def test_empty_dict_validate(self): - vm = ValidationMetadata() - path_to_schemas = Foo._validate_oapg(frozendict.frozendict({}), validation_metadata=vm) + vm = ValidationMetadata(path_to_item=("args[0]",), configuration=schema_configuration.SchemaConfiguration()) + path_to_schemas = Foo._validate(frozendict.frozendict({}), validation_metadata=vm) assert path_to_schemas == {("args[0]",): {Foo, frozendict.frozendict}} def test_dict_validate(self): - vm = ValidationMetadata() - path_to_schemas = Foo._validate_oapg( + vm = ValidationMetadata(path_to_item=("args[0]",), configuration=schema_configuration.SchemaConfiguration()) + path_to_schemas = Foo._validate( frozendict.frozendict({"bar": "a", "additional": Decimal(0)}), validation_metadata=vm, ) assert path_to_schemas == { ("args[0]",): {Foo, frozendict.frozendict}, - ("args[0]", "bar"): {StrSchema, str}, - ("args[0]", "additional"): {schemas.UnsetAnyTypeSchema, decimal.Decimal}, + ("args[0]", "bar"): {Bar, str}, } def test_discriminated_dict_validate(self): - vm = ValidationMetadata() - path_to_schemas = Animal._validate_oapg( + vm = ValidationMetadata(path_to_item=("args[0]",), configuration=schema_configuration.SchemaConfiguration()) + path_to_schemas = Animal._validate( frozendict.frozendict(className="Dog", color="black"), validation_metadata=vm ) - for path, schema_classes in path_to_schemas.items(): - Animal._process_schema_classes_oapg(schema_classes) + for schema_classes in path_to_schemas.values(): + Animal._process_schema_classes(schema_classes) assert path_to_schemas == { - ("args[0]",): {Animal, Dog, Dog.MetaOapg.all_of()[1], frozendict.frozendict}, + ("args[0]",): {Animal, Dog, Dog.Schema_.AllOf.classes[1], frozendict.frozendict}, ("args[0]", "className"): {StrSchema, str}, - ("args[0]", "color"): {StrSchema, str}, + ("args[0]", "color"): {Animal.Schema_.Properties.Color, str}, } def test_bool_enum_validate(self): - vm = ValidationMetadata() - path_to_schemas = BooleanEnum._validate_oapg(BoolClass.TRUE, validation_metadata=vm) + vm = ValidationMetadata(path_to_item=("args[0]",), configuration=schema_configuration.SchemaConfiguration()) + path_to_schemas = BooleanEnum._validate(BoolClass.TRUE, validation_metadata=vm) assert path_to_schemas == {("args[0]",): {BoolClass, BooleanEnum}} def test_oneof_composition_pig_validate(self): - vm = ValidationMetadata() - path_to_schemas = Pig._validate_oapg( + vm = ValidationMetadata(path_to_item=("args[0]",), configuration=schema_configuration.SchemaConfiguration()) + path_to_schemas = Pig._validate( frozendict.frozendict(className="DanishPig"), validation_metadata=vm ) - for path, schema_classes in path_to_schemas.items(): - Pig._process_schema_classes_oapg(schema_classes) + for schema_classes in path_to_schemas.values(): + Pig._process_schema_classes(schema_classes) assert path_to_schemas == { ("args[0]",): {Pig, DanishPig, frozendict.frozendict}, - ("args[0]", "className"): {DanishPig.MetaOapg.properties.className, str}, + ("args[0]", "className"): {DanishPig.Schema_.Properties.ClassName, str}, } def test_anyof_composition_gm_fruit_validate(self): - vm = ValidationMetadata() - path_to_schemas = GmFruit._validate_oapg( + vm = ValidationMetadata(path_to_item=("args[0]",), configuration=schema_configuration.SchemaConfiguration()) + path_to_schemas = GmFruit._validate( frozendict.frozendict(cultivar="GoldenDelicious", lengthCm=Decimal(10)), validation_metadata=vm, ) - for path, schema_classes in path_to_schemas.items(): - GmFruit._process_schema_classes_oapg(schema_classes) + for schema_classes in path_to_schemas.values(): + GmFruit._process_schema_classes(schema_classes) assert path_to_schemas == { ("args[0]",): {GmFruit, Apple, Banana, frozendict.frozendict}, - ("args[0]", "cultivar"): {Apple.MetaOapg.properties.cultivar, str}, + ("args[0]", "cultivar"): {Apple.Schema_.Properties.Cultivar, str}, ("args[0]", "lengthCm"): {NumberSchema, Decimal}, } @@ -142,144 +143,168 @@ class TestValidateCalls(unittest.TestCase): def test_empty_list_validate(self): return_value = {("args[0]",): {ArrayHoldingAnyType, tuple}} with patch.object( - Schema, "_validate_oapg", return_value=return_value + Schema, "_validate", return_value=return_value ) as mock_validate: ArrayHoldingAnyType([]) assert mock_validate.call_count == 1 with patch.object( - Schema, "_validate_oapg", return_value=return_value + Schema, "_validate", return_value=return_value ) as mock_validate: - ArrayHoldingAnyType.from_openapi_data_oapg([]) + ArrayHoldingAnyType.from_openapi_data_([]) assert mock_validate.call_count == 1 def test_empty_dict_validate(self): return_value = {("args[0]",): {Foo, frozendict.frozendict}} with patch.object( - Schema, "_validate_oapg", return_value=return_value + Schema, "_validate", return_value=return_value ) as mock_validate: Foo({}) assert mock_validate.call_count == 1 with patch.object( - Schema, "_validate_oapg", return_value=return_value + Schema, "_validate", return_value=return_value ) as mock_validate: - Foo.from_openapi_data_oapg({}) + Foo.from_openapi_data_({}) assert mock_validate.call_count == 1 def test_list_validate_direct_instantiation(self): - results = [ - {("args[0]",): {ArrayWithValidationsInItems, tuple}}, - {("args[0]", 0): {ArrayWithValidationsInItems.MetaOapg.items, Decimal}} - ] - with patch.object(Schema, "_validate_oapg", side_effect=results) as mock_validate: - ArrayWithValidationsInItems([7]) - calls = [ - call( + with patch.object( + ArrayWithValidationsInItems, + "_validate", + side_effect=ArrayWithValidationsInItems._validate, + ) as mock_outer_validate: + with patch.object( + ArrayWithValidationsInItems.Schema_.Items, + "_validate", + side_effect=ArrayWithValidationsInItems.Schema_.Items._validate, + ) as mock_inner_validate: + used_configuration = schema_configuration.SchemaConfiguration() + ArrayWithValidationsInItems([7], configuration_=used_configuration) + mock_outer_validate.assert_called_once_with( (Decimal("7"),), - validation_metadata=ValidationMetadata(path_to_item=("args[0]",)) - ), - call( + validation_metadata=ValidationMetadata(path_to_item=("args[0]",), configuration=used_configuration) + ) + mock_inner_validate.assert_called_once_with( Decimal("7"), - validation_metadata=ValidationMetadata(path_to_item=("args[0]", 0)) + validation_metadata=ValidationMetadata(path_to_item=("args[0]", 0), configuration=used_configuration) ) - ] - mock_validate.assert_has_calls( - calls - ) def test_list_validate_direct_instantiation_cast_item(self): # item validation is skipped if items are of the correct type - item = ArrayWithValidationsInItems.MetaOapg.items(7) - return_value = {("args[0]",): {ArrayWithValidationsInItems, tuple}} - with patch.object(Schema, "_validate_oapg", return_value=return_value) as mock_validate: - ArrayWithValidationsInItems([item]) - mock_validate.assert_called_once_with( - tuple([Decimal('7')]), - validation_metadata=ValidationMetadata( - validated_path_to_schemas={('args[0]', 0): {ArrayWithValidationsInItems.MetaOapg.items, Decimal}} + item = ArrayWithValidationsInItems.Schema_.Items(7) + with patch.object( + ArrayWithValidationsInItems, + "_validate", + side_effect=ArrayWithValidationsInItems._validate, + ) as mock_outer_validate: + with patch.object( + ArrayWithValidationsInItems.Schema_.Items, + "_validate", + side_effect=ArrayWithValidationsInItems.Schema_.Items._validate, + ) as mock_inner_validate: + used_configuration = schema_configuration.SchemaConfiguration() + ArrayWithValidationsInItems([item], configuration_=used_configuration) + mock_outer_validate.assert_called_once_with( + tuple([Decimal('7')]), + validation_metadata=ValidationMetadata( + path_to_item=("args[0]",), + configuration=used_configuration, + validated_path_to_schemas={('args[0]', 0): {ArrayWithValidationsInItems.Schema_.Items, Decimal}} + ) ) - ) + mock_inner_validate.assert_not_called def test_list_validate_from_openai_data_instantiation(self): - - results = [ - {("args[0]",): {ArrayWithValidationsInItems, tuple}}, - {("args[0]", 0): {ArrayWithValidationsInItems.MetaOapg.items, Decimal}} - ] - with patch.object(Schema, "_validate_oapg", side_effect=results) as mock_validate: - ArrayWithValidationsInItems.from_openapi_data_oapg([7]) - calls = [ - call( + with patch.object( + ArrayWithValidationsInItems, + "_validate", + side_effect=ArrayWithValidationsInItems._validate, + ) as mock_outer_validate: + with patch.object( + ArrayWithValidationsInItems.Schema_.Items, + "_validate", + side_effect=ArrayWithValidationsInItems.Schema_.Items._validate, + ) as mock_inner_validate: + used_configuration = schema_configuration.SchemaConfiguration() + ArrayWithValidationsInItems.from_openapi_data_([7], configuration_=used_configuration) + mock_outer_validate.assert_called_once_with( (Decimal("7"),), - validation_metadata=ValidationMetadata(path_to_item=("args[0]",), from_server=True) - ), - call( + validation_metadata=ValidationMetadata(path_to_item=("args[0]",), configuration=used_configuration) + ) + mock_inner_validate.assert_called_once_with( Decimal("7"), - validation_metadata=ValidationMetadata(path_to_item=("args[0]", 0), from_server=True) + validation_metadata=ValidationMetadata(path_to_item=("args[0]", 0), configuration=used_configuration) ) - ] - mock_validate.assert_has_calls( - calls - ) def test_dict_validate_direct_instantiation(self): - call_results = [ - {("args[0]",): {Foo, frozendict.frozendict}}, - {("args[0]", "bar"): {StrSchema, str}} - ] - with patch.object(Schema, "_validate_oapg", side_effect=call_results) as mock_validate: - Foo(bar="a") - calls = [ - call( + with patch.object(Foo, "_validate", side_effect=Foo._validate) as mock_outer_validate: + with patch.object( + Bar, + "_validate", + side_effect=Bar._validate, + ) as mock_inner_validate: + used_configuration = schema_configuration.SchemaConfiguration() + Foo(bar="a", configuration_=used_configuration) + mock_outer_validate.assert_called_once_with( frozendict.frozendict({"bar": "a"}), - validation_metadata=ValidationMetadata(path_to_item=("args[0]",)), - ), - call( + validation_metadata=ValidationMetadata( + path_to_item=("args[0]",), + configuration=used_configuration + ) + ) + mock_inner_validate.assert_called_once_with( "a", - validation_metadata=ValidationMetadata(path_to_item=("args[0]", "bar")), - ), - ] - mock_validate.assert_has_calls( - calls - ) + validation_metadata=ValidationMetadata( + path_to_item=("args[0]", "bar"), + configuration=used_configuration + ), + ) def test_dict_validate_direct_instantiation_cast_item(self): - bar = StrSchema("a") - return_value = { - ("args[0]",): {Foo, frozendict.frozendict} - } + bar = Bar("a") + used_configuration = schema_configuration.SchemaConfiguration() # only the Foo dict is validated because the bar property value was already validated - with patch.object(Schema, "_validate_oapg", return_value=return_value) as mock_validate: - Foo(bar=bar) - mock_validate.assert_called_once_with( - frozendict.frozendict(dict(bar='a')), - validation_metadata=ValidationMetadata( - validated_path_to_schemas={('args[0]', 'bar'): {str, StrSchema}} + with patch.object(Foo, "_validate", side_effect=Foo._validate) as mock_outer_validate: + with patch.object( + Bar, + "_validate", + side_effect=Bar._validate, + ) as mock_inner_validate: + Foo(bar=bar, configuration_=used_configuration) + mock_outer_validate.assert_called_once_with( + frozendict.frozendict(dict(bar='a')), + validation_metadata=ValidationMetadata( + path_to_item=('args[0]',), + configuration=used_configuration, + validated_path_to_schemas={('args[0]', 'bar'): {str, Bar}} + ) ) - ) + mock_inner_validate.assert_not_called() def test_dict_validate_from_openapi_data_instantiation(self): - - return_values = [ - {("args[0]",): {Foo, frozendict.frozendict}}, - {("args[0]", 'bar'): {StrSchema, str}} - ] - with patch.object(Schema, "_validate_oapg", side_effect=return_values) as mock_validate: - Foo.from_openapi_data_oapg({"bar": "a"}) - calls = [ - call( + with patch.object(Foo, "_validate", side_effect=Foo._validate) as mock_outer_validate: + with patch.object( + Bar, + "_validate", + side_effect=Bar._validate, + ) as mock_inner_validate: + used_configuration = schema_configuration.SchemaConfiguration() + Foo.from_openapi_data_({"bar": "a"}, configuration_=used_configuration) + mock_outer_validate.assert_called_once_with( frozendict.frozendict({"bar": "a"}), - validation_metadata=ValidationMetadata(path_to_item=("args[0]",), from_server=True), - ), - call( + validation_metadata=ValidationMetadata( + path_to_item=("args[0]",), + configuration=used_configuration + ) + ) + mock_inner_validate.assert_called_once_with( "a", - validation_metadata=ValidationMetadata(path_to_item=("args[0]", "bar"), from_server=True), - ), - ] - mock_validate.assert_has_calls( - calls - ) + validation_metadata=ValidationMetadata( + path_to_item=("args[0]", "bar"), + configuration=used_configuration + ), + ) if __name__ == "__main__": diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_whale.py b/samples/openapi3/client/petstore/python/tests_manual/test_whale.py index 7ce302faf99..d07bc212010 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_whale.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_whale.py @@ -6,7 +6,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -15,7 +15,7 @@ import petstore_api from petstore_api.schemas import BoolClass -from petstore_api.model.whale import Whale +from petstore_api.components.schema.whale import Whale class TestWhale(unittest.TestCase): diff --git a/samples/openapi3/client/petstore/python/tox.ini b/samples/openapi3/client/petstore/python/tox.ini index e57c17e10c1..b20f2549b0a 100644 --- a/samples/openapi3/client/petstore/python/tox.ini +++ b/samples/openapi3/client/petstore/python/tox.ini @@ -1,10 +1,10 @@ [tox] envlist = py37 +isolated_build = True [testenv] passenv = PYTHON_VERSION -deps=-r{toxinidir}/requirements.txt - -r{toxinidir}/test-requirements.txt +deps=-r{toxinidir}/test-requirements.txt commands= pytest --cov=petstore_api diff --git a/website/src/pages/index.js b/website/src/pages/index.js index 5c59453bc95..04ae8808f0f 100755 --- a/website/src/pages/index.js +++ b/website/src/pages/index.js @@ -133,7 +133,7 @@ const callouts = [ content: ( <>

    - The npm package + The npm package wrapper is cross-platform wrapper around the .jar artifact.

    @@ -144,19 +144,19 @@ const callouts = [

    {stripMargin` |# install the latest version of "openapi-generator-cli" - |npm install @openapitools/openapi-generator-cli -g + |npm install @openapi-json-schema-tools/openapi-json-schema-generator-cli -g | |# use a specific version of "openapi-generator-cli" |openapi-generator-cli version-manager set 6.0.0 | |# Or install it as dev-dependency in your node.js projects - |npm install @openapitools/openapi-generator-cli -D + |npm install @openapi-json-schema-tools/openapi-json-schema-generator-cli -D `}

    {/* */}

    Then, generate a ruby client from a valid petstore.yaml doc:

    {` @@ -177,7 +177,7 @@ const callouts = [

    Then, generate a ruby client from a valid petstore.yaml doc:

    @@ -195,14 +195,14 @@ const callouts = [ installing via homebrew, or for developers who are unable to install Java or upgrade the installed version.

    To generate code from a valid petstore.yaml doc + href="https://raw.githubusercontent.com/openapi-json-schema-tools/openapi-json-schema-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml">petstore.yaml doc with this image, you'll need to mount a local location as a volume.

    {stripMargin` |docker run --rm \\ - | -v $PWD:/local openapitools/openapi-generator-cli generate \\ + | -v $PWD:/local openapi-json-schema-tools/openapi-json-schema-generator-cli generate \\ | -i /local/petstore.yaml \\ | -g go \\ | -o /local/out/go @@ -210,7 +210,7 @@ const callouts = [

    For a full list of our docker images, check out u/openapitools on Docker Hub.

    + href="https://hub.docker.com/u/openapijsonschematools">u/openapijsonschematools on Docker Hub.

    ), }